Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
878aad4
feat(rollout): native-identity observation layer (M1) — collect clien…
Nov 3, 2026
d908da4
fix(guards): register BILI_NATIVE_IDENTITY_PROFILES_JSON, de-export i…
Nov 3, 2026
477ee24
refactor(native-identity): drop dead env-override flag, correct profi…
Nov 3, 2026
6cda69a
feat(fastpath): v5 identity-only head verification (re-port to 2026-1…
ranxianglei Nov 3, 2026
9cd5f5c
feat(fastpath): v6 canonical lane — transcript row-chain is the sole …
ranxianglei Nov 3, 2026
8cce4df
feat(fastpath): v6 msgid lane — server-minted pf_sids over durable sn…
ranxianglei Nov 3, 2026
d9863aa
test: fastpath v6 msgid lane — add contract §8 matrix rows (#5576, #5…
Nov 3, 2026
a27acba
docs: document the v6 msgid lane; seed BILI_PF_V6_REWRITE_STRICT (#55…
Nov 3, 2026
9ad3bed
Merge remote-tracking branch 'origin/ci-fixes' into audit-owner-v6
Nov 3, 2026
1dbdad7
fix: close the two guard gaps left by the fastpath v6 commit (#5576, …
Nov 3, 2026
a3515e3
Merge commit '9dc4c945913e2616cc9a5b49bebbb1da96bef292' into ci-5578-…
Nov 3, 2026
c81e5df
test(storage): follow the #5600 schema bump v10→v11 in the four suite…
Nov 3, 2026
cc854d8
test(rollout): scope the bucket-tier assertion to non-nested features
Nov 3, 2026
089700e
test(text-safe): allowlist the native-identity observation ring-buffe…
Nov 3, 2026
b1f9344
test(nidv): widen the latency-smoke bound 20ms→50ms (observed Windows…
Nov 3, 2026
cf6300e
fix(storage): strip line comments before splitting the MySQL DDL blob
Nov 3, 2026
08334b5
fix(fastpath): review nits — truthful DDL-splitter invariant comment …
Nov 4, 2026
2bdb33f
TEMP pre-merge verification push (#5600/#5576): force watermark cohor…
ranxianglei Nov 3, 2026
e9fa08b
fix(fastpath/storage): #5576 review round-1 — B1 world-origin hydrati…
ranxianglei Nov 4, 2026
4169c69
test(fastpath): #5576 review round-1 pins — v5-lane R7 port + #3617 m…
ranxianglei Nov 4, 2026
1787db4
fix(fastpath): #5576 review round-1 remainder — V1 drift-ride lifetim…
Nov 4, 2026
6862785
revert(fastpath): #5576 TEMP-ON verification push — restore shipped g…
Nov 4, 2026
0a9f14e
Merge remote-tracking branch 'origin/master' into ci-5578-conflict-fix
Nov 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ This index is generated from `website/config-reference/*.yaml` — edit the seed
| `rollout.features.base` | string | unset (roll out over everyone) | — | Nested rollout: evaluate this feature only inside the named feature's enabled cohort, so the percent is relative to that population (roll B out to A's users; chains allowed, cycles fail closed). |
| `rollout.features.pluginLaneServerHistory` | boolean \| number | 0 (off) | BILI_ROLLOUT_PLUGIN_LANE_SERVER_HISTORY | Plugin-lane server-owned history (#4491): for enabled installs, (a) plugin-lane requests may carry an internal `biliMsgIds` array parallel to `messages` that pins message identity to client-supplied ids (always stripped before upstream forwarding; malformed arrays are ignored with a warning, id-poisoning shapes hard-fail on the incremental lane); (b) the loopback-only `POST /__bili/plugin/render` endpoint serves the outbound prefix rendered from the unified transcript (folded regions collapse to summary anchors; any desync degrades to a non-2xx so the shim falls back to its local history); (c) the incremental-lane probe advertises `serverHistory`. Default 0% — no behavior change until rolled out. |
| `rollout.features.pluginFullResendWatermark` | boolean \| number | 5 (experimental grey) | BILI_ROLLOUT_PLUGIN_FULL_RESEND_WATERMARK | Full-resend watermark fastpath (#5403/#5418): plugin-lane chat-completions turns whose previous response carried an x-bili-pf-seq stamp assert the resent prefix via the echoed count (structural scan, no full parse); on a hit the pipeline consumes stashed canonical prefix cores plus only the new tail window (byte-identical outbound provenance; ANY doubt falls back to the untouched full-parse path per turn and re-stamps, five credited misses hold the lane for one hour). Requires the client to echo the stamp back as x-bili-pf-count (dsh/pi/opencode/omp do; unadapted lanes never hit). EXPERIMENTAL grey rollout — ON by default for roughly 5% of installs (owner ruling 2026-11-02: small cohort before GA; one-time intro notice in the web UI for every install, tri-state switch in quick config). Force it with `true`, turn off with `false` (or a percent) / env = 0. See TECHNICAL-NOTES.md “Full-resend watermark fastpath”. |
| `rollout.features.watermarkV6MsgId` | boolean \| number | 0 (off) | BILI_ROLLOUT_WATERMARK_V6_MSG_ID | Watermark v6 msgid lane (#5576/#5600): nested grey inside pluginFullResendWatermark, dispatched BEFORE the canonical lane (which then runs only as its else-if). Identity is server-minted: each session world gets a pf_sid (pf_+12hex) issued via the x-bili-pf-session RESPONSE header (the response IS the issuance channel); resolution = echo (must name a live partition) -> probe real tail-ids against the global ledger index (budget 8) -> mint (v6m-arm cold start, P5's one legal full). Hit authority = ledger-width arithmetic against OUR frontier (K = resident element count, never a client echo) + a window-origin pin on element K-1 of our own pf_rows partition (hard pin; weak pin on id-silent frontiers); content bytes are never judged - in-place edits ride frozen cores. Hits append window rows + geom snapshots to the durable pf_* partition store (LSM meta plane: WAL + checksummed checkpoints folding every 32 entries; post-boot hydration from L1+L0; rows deleted ONLY by deleteSession - archive-and-reset doctrine). Shrink vs frontier = compaction class (uncredited passthrough by default, credited under BILI_PF_V6_REWRITE_STRICT=1); system-at-window-head is always credited; sess-change stays uncredited; model switches are non-events (no model gate); all credits feed the shared five-miss/60-min breaker above every lane. Soft plane: store absent => pre-existing lanes run byte-for-byte. Zero retention: hits pin no seed stash. Default 0% - measure in a small cohort first. See TECHNICAL-NOTES.md “Full-resend watermark fastpath” (§v6 msgid lane). |
| `rollout.features.watermarkCanonicalV6` | boolean \| number | 0 (off) | BILI_ROLLOUT_WATERMARK_CANONICAL_V6 | Watermark v6 canonical lane (#5576): nested grey inside pluginFullResendWatermark. When enabled, the watermark's hit verdict stops trusting client-asserted bytes: surviving pre-filters are pure server-side arithmetic over the client-declared ledger list (ahead / width-shape / no-progress / sess-change), then the body converts once with the REAL codec and anchors against stored unified-transcript rows via the canonical chain walk (kernel id fast path → content-sig fallback, min seam run 2). On a hit the outbound prefix = stored rows up to the seam (folded regions behind synthetic summary anchors) + this turn's fresh tail cores; system text re-decodes from the CURRENT head every turn (passthrough by construction — the v5 head-drift gate is retired); model switches are non-events (one logical ledger shared across models); host-side content rewrites break the chain and self-heal through UNcredited legacy turns unless BILI_PF_V6_REWRITE_STRICT=1 credits them toward the breaker. Zero-retention doctrine: canonical outcomes pin NO seed stash. Default 0% — measure in a small cohort before any promotion. See TECHNICAL-NOTES.md “Full-resend watermark fastpath → v6 canonical lane”. |
| `rollout.features.nativeIdentityObservation` | boolean \| number | 0 (off) | BILI_ROLLOUT_NATIVE_IDENTITY_OBSERVATION | Native-identity observation (#5573 M1): pure-observation collection of client-native session/message identity evidence via a per-client profile table (WorkBuddy x-conversation-id family + X-Compaction headers, codex installation-id / item-id families / previous_response_id rotation + compaction prefaces, Claude Code session header + metadata dual-channel cross-check + continuation preface, opencode ses_ affinity + fork marker + wire-shape assertions, Gemini state-snapshot preface) into the session ext store under nidv:obs (sha1-8 digests only — id values never persist or log in plaintext) plus one debug log line per observed request; compaction hits escalate the line to WARN. Feeds NO decision: request handling, folding, parsing and outbound bytes are untouched, and off-or-unclassified traffic produces zero diff against the golden suites. Default 0% — enable to collect the field data the L2 consumers need (silent fold re-baseline for #5488, fastpath identity binding for #5403/#5418). |
| `maskHosts` | boolean | true | BILI_LOG_MASK_HOSTS | Mask non-public target hosts in logs as <private-host>; credential headers are always masked regardless. |
| `security.adminRelay` | boolean | false | — | Let an embedding host (dsh web today) relay the ENTIRE /__bili/ admin surface through its own entry origin so a remote browser can open the panel (#3373). Fail-closed, file-only. The relayed hop reaches the proxy as a local non-browser client (loopback source + loopback Host, no Origin), so the admin gate stays unchanged; enabling it exposes config editing and credential writes to whoever can reach the host web entry — protect that entry (auth / reverse proxy) first. |
| `subagentSplit` | boolean | true | BILI_SUBAGENT_SPLIT | Claude Code subagents get their own session namespace (<session>\|sub:<agent-id>) instead of queueing behind the main session. Anthropic-wire only — on the Responses wire this switch is a no-op (see the `subagentSplit` / BOTH-mechanisms scope note). |
Expand Down Expand Up @@ -433,6 +436,8 @@ This index is generated from `website/config-reference/*.yaml` — edit the seed
| `BILI_MITM_HOSTS` | string[] (csv) | unset | — | Launcher channel: MITM whitelist hosts handed to the spawned proxy (distinct from the config-file twin BILI_MITM_DOMAINS). |
| `BILI_PLUGIN_AGENT` | boolean-ish | off | — | Spawn channel: marks a plugin-agent process. |
| `BILI_IMAGE_RESCALE_MAX_DIM` | integer | 1600 | — | Longest-edge trigger threshold (px) for the egress image downscale pass (#3400); non-numeric or below 128 ignored (default applies). Env-only by design. |
| `BILI_NATIVE_IDENTITY_PROFILES_JSON` | string | unset (built-in table) | — | Native-identity observation (#5573 M1): JSON object of per-client profile rows merged over the built-in evidence table (src/server/native-identity-profiles.ts) — entries ADD new rows or REPLACE a built-in row by name, never remove one (the built-ins are the floor). Same shape as a built-in row (name, matchHeaders, sessionHeaders, msgidHeaders, compactionEdgeHeader, countPatterns, compactionPrefixes, ...). Malformed JSON fails open silently (built-ins only). Only meaningful while rollout.features.nativeIdentityObservation is enabled; feeds no decision. |
| `BILI_PF_V6_REWRITE_STRICT` | boolean | unset (off) | — | Set `1` to CREDIT watermark-v6 misses toward the five-miss breaker instead of the default SELF-HEALING uncredited legacy turn, per lane: in the MSGID lane (`watermarkV6MsgId`) compaction-class shrinks against the stored frontier (`v6m-compact`); in the CANONICAL lane (`watermarkCanonicalV6`) host-side content rewrites (chain breaks: chain-not-started / seam-too-short) — for exotic hosts whose thrash would otherwise ride free legacy turns forever. (The msgid lane’s `v6m-window-system` verdict is ALWAYS credited, independent of this switch.) Default unset/off; pinned by tests/fastpath-pf-msgid.test.ts and tests/fastpath-v6-canonical.test.ts. |

<!-- /bili:gen -->

Expand Down Expand Up @@ -1931,8 +1936,11 @@ File keys resolve only when the matching env var is unset. Defaults in parenthes
| `BILI_RESIGN_PASSTHROUGH` | `resign` | {} (armed; built-in scheme sdk-hmac-sha256) |
| `BILI_RESUME_INHERITANCE` | `resumeInheritance` | true |
| `BILI_ROLLOUT_<FEATURE>` | `rollout.features.enabled` | unset (bucket math decides) |
| `BILI_ROLLOUT_NATIVE_IDENTITY_OBSERVATION` | `rollout.features.nativeIdentityObservation` | 0 (off) |
| `BILI_ROLLOUT_PLUGIN_FULL_RESEND_WATERMARK` | `rollout.features.pluginFullResendWatermark` | 5 (experimental grey) |
| `BILI_ROLLOUT_PLUGIN_LANE_SERVER_HISTORY` | `rollout.features.pluginLaneServerHistory` | 0 (off) |
| `BILI_ROLLOUT_WATERMARK_CANONICAL_V6` | `rollout.features.watermarkCanonicalV6` | 0 (off) |
| `BILI_ROLLOUT_WATERMARK_V6_MSG_ID` | `rollout.features.watermarkV6MsgId` | 0 (off) |
| `BILI_SESSION_CONTENT_STORE_PIN` | `sessions.contentStorePin` | false |
| `BILI_SESSION_GC` | `sessions.gc.enabled` | false |
| `BILI_SESSION_GC_INTERVAL_MS` | `sessions.gc.intervalMs` | 3600000 |
Expand Down Expand Up @@ -2077,6 +2085,7 @@ File keys resolve only when the matching env var is unset. Defaults in parenthes
| `BILI_SESSION_WARM_MAX_BYTES` | Decoded-byte budget for the boot warm set (#2803; default `67108864` = 64 MiB). Counts DECODED size, not compressed on-disk bytes, so zstd archives cannot sneak past the RAM bound. A single file over the budget is never warmed. File twin: `sessions.warmMaxBytes`. |
| `BILI_SESSION_RESIDENT_MAX_BYTES` | Soft target for estimated resident session bytes (#2803; default `536870912` = 512 MiB). Active/in-flight state stays pinned above it (the byte budget limits the idle cache, not active workload); when over target, idle state discharges back to disk as requests complete. File twin: `sessions.residentMaxBytes`. |
| `BILI_SESSION_RESIDENT_HARD_MAX_BYTES` | Per-session hard cap on estimated resident memory (#4788, decision #4792 D1-A). Why it exists: the pool soft cap above can only pull OTHER idle sessions out of memory to stay under budget — with a single long-lived session there is nothing left to evict, so one conversation grew a ~2 GiB working set off a 58 MiB inbound stream (#4788 baseline). This cap bounds ONE session by itself: whenever a request has finished and the turn's save has provably landed on disk, the session's own resident estimate (the same number `GET /__bili/memory` reports) is compared against the cap; over it, the droppable fields — folded-block original contents, metadata bookkeeping, the unbounded part of the raw message tail — are forced back to disk even though pool eviction would exempt the session, and a warning is logged once per minute per session. Nothing is lost: each dropped field re-materializes on first use from a NARROW disk read (only that field, not the whole record), so the next turn pays one small read instead of carrying megabytes resident. Drops gated by a landed save already run at every request boundary regardless of the cap; the cap decides when a single session is called out for exceeding its own budget. Default: equal to the pool soft cap (`536870912` = 512 MiB); set lower (e.g. `53687091` = 64 MiB) to hold one busy long-running session under a personal ceiling. `0` disables the cap check. Compression state (`state`) and the media content store are non-droppable by design and are untouched by this path. File twin: `sessions.hardMaxBytes`. |
| `BILI_PF_V6_REWRITE_STRICT` | Set `1` to CREDIT watermark-v6 misses toward the five-miss breaker instead of the default SELF-HEALING uncredited legacy turn, per lane: in the MSGID lane (`watermarkV6MsgId`) compaction-class shrinks against the stored frontier (`v6m-compact`); in the CANONICAL lane (`watermarkCanonicalV6`) host-side content rewrites (chain breaks: chain-not-started / seam-too-short) — for exotic hosts whose thrash would otherwise ride free legacy turns forever. (The msgid lane’s `v6m-window-system` verdict is ALWAYS credited, independent of this switch.) Default unset/off; pinned by tests/fastpath-pf-msgid.test.ts and tests/fastpath-v6-canonical.test.ts. |
| `BILI_PUBLIC_SNAPSHOT_CAP_BYTES` | Retention cap (bytes) for the raw wire-history snapshot kept per plugin session to serve the public fork API (#2017). A plugin session whose serialized snapshot exceeds the cap stops being forkable — `GET /__bili/plugin/snapshot` and `POST /__bili/plugin/fork` fail closed with `409` and the capped reason — instead of retaining an unbounded raw copy of the history forever. The cap is re-evaluated on every plugin model request: a session that shrinks back under the cap (after a fork trimmed it, or the host shrank the history) resumes being forkable. Default `104857600` (100 MiB); `0` disables retention entirely (no session is forkable; existing snapshots are dropped on the next request). File twin: `plugin.snapshotCapBytes`. |
| `BILI_SESSIONS_DIR` | Directory for persisted session state (default XDG data dir). |
| `BILI_SESSION_GC` | Cleanup of stale session files (#1082) is **opt-in**: set to `1`/`true`/`on` to enable — off by default, because session files are user data (exportable, resumable) and there is no silent deletion policy. When enabled, the sweep (boot + hourly) deletes a file only when BOTH conditions hold: older than `BILI_SESSION_GC_MAX_AGE_DAYS`, AND small in the lossless sense — the session was **never compressed** (zero folded blocks) and its newest request body ≤ the token ceiling below, so resuming it costs one cold rebuild from the client's own history and nothing else. Safety rails: compressed sessions are NEVER deleted (their summaries cannot be rebuilt losslessly); a session still held in memory is skipped unless idle since its last disk write; unreadable/corrupt files are left in place; every deletion is audit-logged individually (path, size, age) plus one summary line per non-empty sweep; only the sessions dir is ever touched; emptied protocol subdirectories are removed. Note the resident guard is per-process: another proxy instance sharing `BILI_SESSIONS_DIR` that does not persist (e.g. `BILI_PERSIST=0`) never refreshes file mtimes, so its still-live session files can age out and be swept — the cost is the same bounded cold rebuild, backstopped by the age gate. CCR content stores (#1097) share the session's lifecycle (#1180): a `<hash>.content-store.json` companion is deleted together with its session file, an orphaned companion (session file already gone) is swept once past the age gate, and an unreadable companion keeps its session file too (never guessed at). |
Expand Down
Loading
Loading