Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
46fabdd
feat(obs): M1 native identity observation layer (#5571) — one choke p…
ranxianglei Nov 3, 2026
a978523
fix(obs): dual_mismatch event stores digests of both channels, never …
Nov 3, 2026
870265d
refactor(obs): satisfy unused-exports CI gate + drop no-op catch assi…
Nov 3, 2026
e1a3ef3
Merge remote-tracking branch 'origin/ci-fixes' (inherited storage-eng…
Nov 3, 2026
f6968ee
fix(obs): drop dead extraHeaders field never consumed by extraction
Nov 3, 2026
0e83b21
feat(fastpath): v5 identity-only head verification per owner ruling 2…
ranxianglei Nov 3, 2026
50feb19
v6: add watermarkCompactionPassthrough rollout knob (R4) + docs
ranxianglei Nov 3, 2026
26c8fa8
v6: persist cumulative host-id ledger pf:state.lg (R2)
ranxianglei Nov 3, 2026
abace8c
v6: canonical-ledger hit decision — rewrite-passthrough, R5 diagnosti…
ranxianglei Nov 3, 2026
bcf0cf7
v6: transcript-alignment confirmation probe on watermark miss turns (R1)
ranxianglei Nov 3, 2026
2267337
v6: document the mid-insertion proof requirement of rewrite-passthrou…
ranxianglei Nov 3, 2026
7e910aa
v6: pin the canonical-ledger verdicts — rewrite-passthrough, knob-off…
ranxianglei Nov 3, 2026
a3e4aa6
Merge origin/master into m1-native-identity — resolve conflict (PR #5…
Nov 11, 2026
37cbd31
fix(ci): pass architecture-docs + unused-exports gates after master m…
Nov 11, 2026
4b4d024
Merge remote-tracking branch 'refs/remotes/origin/master' into wt-557…
Nov 11, 2026
7d259a6
Merge remote-tracking branch 'origin/master' into wt-5575-conflict
Nov 13, 2026
04d7a70
Merge remote-tracking branch 'origin/master' into wt-5575-conflict-r2
Nov 15, 2026
db7f5f4
Merge remote-tracking branch 'origin/master' into wt-5575-conflict-r3
Nov 21, 2026
f8458a3
fix: growPfLedger — make the defensive dedupe of hand-edited ledger s…
Nov 22, 2026
888167f
fix: drop the redundant PFSavedState cast in the noteCreditedMiss fal…
Nov 22, 2026
de087a9
fix: correct the R7 ledgerHold wording — the swap turn holds ledger g…
Nov 22, 2026
8f428ff
merge master into m1-native-identity: resolve rollout/docs conflict (…
Nov 22, 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
4 changes: 4 additions & 0 deletions docs/configuration.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@
| `rollout.features.base` | string | unset (roll out over everyone) | — | ネストされたロールアウト:指定された機能の有効化コホート内でのみこの機能を評価し、パーセンテージがその母集団に対する相対値となる(Aのユーザーに対してBをロールアウト;チェーンは許可、サイクルはクローズドに失敗する)。 |
| `rollout.features.identityChannelHarvest` | boolean \| number | 0 (off) | BILI_ROLLOUT_IDENTITY_CHANNEL_HARVEST | IDチャネル収穫コホートゲート (#5825):インストールごとの環境スイッチなしで、ループバック専用のトランスクリプト/sqlite収穫(`src/identity-harvest.ts`: claude-code / codebuddy / mcode / goose / qwen レーン)を許可する。インストールごとのスイッチ(`BILI_IDENTITY_HARVEST`)もこのキーも設定されていない場合、クライアントストレージは一切読み取られない。オーナー裁定 2026-11-07:このコホートキーは `rollout.features.pluginLaneServerHistory`(承認済みIDの行固定を管理)とは意図的に分離されている — いずれかのイネーブラーが収穫を有効化できる。デフォルト 0%;小規模コホートでの degrade warn-once レートの観察後に引き上げる。`identity-channels.md` を参照。 |
| `rollout.features.pluginLaneServerHistory` | boolean \| number | 0 (off) | BILI_ROLLOUT_PLUGIN_LANE_SERVER_HISTORY | プラグインレーンのサーバー所有履歴 (#4491):有効化されたインストールにおいて、(a) プラグインレーンのリクエストは `messages` と並行して内部 `biliMsgIds` 配列を持ち、メッセージIDをクライアント提供のIDに固定できる(上流転送前に常に除去;不正な配列は警告付きで無視、ID汚染形状は増分レーンでハードフェイル);(b) ループバック専用の `POST /__bili/plugin/render` エンドポイントは、統合トランスクリプトからレンダリングされた送信プレフィックスを提供する(折り畳み領域はサマリアンカーに縮小;デシンクは非2xxにデグレードし、シムはローカル履歴にフォールバック);(c) 増分レーンのプローブは `serverHistory` をアドバタイズする。デフォルト 0% — ロールアウトされるまで挙動は変わらない。 |
| `rollout.features.nativeIdentityObservation` | boolean \| number | false (off) | BILI_ROLLOUT_NATIVE_IDENTITY_OBSERVATION | ネイティブID観測(#5571 M1、観測レイヤー):モデルAPIリクエストごとに、bili はリクエストがどのクライアントファミリー(WorkBuddy / codex / Claude Code / opencode / Gemini)から来たかを識別し、そのクライアントのネイティブID面(セッションID、メッセージごとのホストID、明示的なコンパクションヘッダー、またはサマリーターンプレフィックス)を sha1-8 ダイジェストの形でセッション ext キー `nidv:obs` に記録する(生のID値はリクエストメモリの外に出ない;不明なクライアントは何も書かない)。単一のリレーチョークポイントでの純粋な収集:転送バイトの変更ゼロ、判定ゼロ、構造上 fail-open。#5571 クライアント収集表を静的フォレンジックからライブ測定データに変え、M2 バインディング表と M3 リベースライン作業に備えるのが目的。デフォルト OFF(0%)— `true` または `BILI_ROLLOUT_NATIVE_IDENTITY_OBSERVATION=1` で有効化。`technical-notes.md` の「Native identity observation layer」を参照。 |
| `rollout.features.pluginFullResendWatermark` | boolean \| number | 5 (experimental grey) | BILI_ROLLOUT_PLUGIN_FULL_RESEND_WATERMARK | フルリセンドウォーターマークファストパス (#5403/#5418):前回のレスポンスに `x-bili-pf-seq` ス tamp を持っていたプラグインレーンのチャットコンプリートターンでは、エコーされたカウントにより再送信プレフィックスをアサートする(構造スキャン、フルパースなし);ヒット時にパイプラインはスタッシュされた正規プレフィックスコアと新しいテールウィンドウのみを消費する(バイト同一の送信プロベナンス;疑義がある場合はターンごとに未変更のフルパースパスにフォールバックし再スタンプ、5回のクレジットミスでレーンを1時間保持)。クライアントがスタンプを `x-bili-pf-count` としてエコーバックすることを要求(dsh/pi/opencode/omp は対応;未適応レーンはヒットしない)。実験的グレースケールロールアウト — インストールの約5%でデフォルトON(オーナー裁定 2026-11-02:GA前に小規模コホート;Web UIで全インストールに一度限りの導入通知、クイック設定に3状態スイッチ)。`true` で強制、`false`(またはパーセンテージ)/ 環境変数 = 0 でオフ。`technical-notes.md` の「Full-resend watermark fastpath」を参照。 |
| `rollout.features.watermarkCompactionPassthrough` | boolean \| number | 100 (on, nested under pluginFullResendWatermark) | BILI_ROLLOUT_WATERMARK_COMPACTION_PASSTHROUGH | ウォーターマーク v6 正規台帳の統一(#5403/#5418 v6):プラグインレーンのウォーターマークターンが形状妥当なホストIDリストを持ち、かつ履歴途中の未知IDがまだ既知のIDより前にある場合(=釘留めプレフィックスコアが記述する内容を変えたクライアントの構造的書き換え(コンパクション/挿入))— このノブが判定を決める:ON(デフォルト)はそのターンに一度だけ保守的な legacy パス(クレジットミス、自己修復による再スタンプ)を支払うため、増分は次のターンから新メッセージとして通り抜け、その新しいIDはセッションの累積ホストID台帳(`pf:state.lg`、FIFO 上限)に追記される — 抑制ロジックなし、投機的な再構築はしない;OFF はそれらのターンで pre-v6 挙動を復元する(書き換えは ID のみ裁定の下で釘留めプレフィックスに乗る、バイト比較は診断に格下げ)。既に有効なウォーターマークコホート内のIDリストターンにのみ影響;カウントのみのターンはどちらの値でもバイト同一。`false` / 環境変数 = 0 で強制オフ。`technical-notes.md` の「Full-resend watermark fastpath」を参照。 |
| `rollout.features.passDshExtensions` | boolean \| number | 0 (off = intercept) | BILI_ROLLOUT_PASS_DSH_EXTENSIONS | DSHクライアント拡張インターセプト (#7168/#7439):DSH(deepseek-harness)は全リクエストにトップレベルの `dsh_*` フィールドを載せる — `dsh_session_log`(公式 DeepSeek API 向けの 8 MiB 無損セッションログアップロード;モデルは読まない)と姉妹フィールド `dsh_plugin_packages`;フォーク/シードされたセッションはウォーターマークが追いつくまで毎ターンログ全体を再送する。デフォルト 0% = インターセプト:bili は受信ボディの解析後、プロトコルパスが送信を構築する前に、すべてのトップレベル `dsh_*` キーを削除する(`src/server/handle.ts`)ため、8 MiB は決して上流に転送されない — バンド幅の無駄がなく、非 DeepSeek 上流での未知フィールドリスクもない。DSH には影響なし:アップロードウォーターマークは 2xx のみで前進し、bili は依然 2xx を返すため、再送は自己修復する。ウィンドウメーターは #7168 の dsh_* スキップ(`src/preflight.ts`)で別途免除。サーバー権威エグレス作業(#6785 / ディスカッション #7439)がクライアント拡張サイドバンドを搭載したら 100% に切り替える(またはストリップを削除する)ことでリリース;当面は `true` / 環境変数 = 1 でパストスルーを強制。 |
| `maskHosts` | boolean | true | BILI_LOG_MASK_HOSTS | ログ内の非公開ターゲットホストを <private-host> としてマスクする。認証情報ヘッダーは常にマスクされる。 |
| `security.adminRelay` | boolean | false | — | エンベディングホスト(現在は dsh web)が、リモートブラウザからパネルを開けるように(#3373)、その自身のエントリーオリジンを通じて /__bili/ 管理サーフェス全体をリレーすることを許可する。フェイルクローズ、ファイルのみ。リレーされたホップはローカル非ブラウザクライアントとしてプロキシに到達する(ループバックソース + ループバック Host、Origin なし)ため、管理ゲートは変更されない。これを有効にすると、ホスト Web エントリーに到達できる者に設定編集と認証情報の書き込みが露出する — まずそのエントリー(認証 / リバースプロキシ)を保護すること。 |
Expand Down Expand Up @@ -2029,9 +2031,11 @@ ACP ネイティブエージェント(現在は `pi` 拡張機能)は、プ
| `BILI_RESUME_INHERITANCE` | `resumeInheritance` | true |
| `BILI_ROLLOUT_<FEATURE>` | `rollout.features.enabled` | unset (bucket math decides) |
| `BILI_ROLLOUT_IDENTITY_CHANNEL_HARVEST` | `rollout.features.identityChannelHarvest` | 0 (off) |
| `BILI_ROLLOUT_NATIVE_IDENTITY_OBSERVATION` | `rollout.features.nativeIdentityObservation` | false (off) |
| `BILI_ROLLOUT_PASS_DSH_EXTENSIONS` | `rollout.features.passDshExtensions` | 0 (off = intercept) |
| `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_COMPACTION_PASSTHROUGH` | `rollout.features.watermarkCompactionPassthrough` | 100 (on, nested under pluginFullResendWatermark) |
| `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
4 changes: 4 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,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.identityChannelHarvest` | boolean \| number | 0 (off) | BILI_ROLLOUT_IDENTITY_CHANNEL_HARVEST | Identity-channel harvest cohort gate (#5825): allows the loopback-only transcript/sqlite harvest (src/identity-harvest.ts: claude-code / codebuddy / mcode / goose / qwen lanes) without any per-install env switch, when neither the per-install switch (BILI_IDENTITY_HARVEST) nor this key is set nothing ever reads client storage. Owner ruling 2026-11-07: this cohort key is deliberately separate from rollout.features.pluginLaneServerHistory (which governs row PINNING of admitted ids) — either enabler may activate harvesting. Default 0%; raise after small-cohort observation of the degrade warn-once rate. See identity-channels.md. |
| `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.nativeIdentityObservation` | boolean \| number | false (off) | BILI_ROLLOUT_NATIVE_IDENTITY_OBSERVATION | Native identity observation (#5571 M1, observational layer): on every model-API request bili recognizes which client family it came from (WorkBuddy / codex / Claude Code / opencode / Gemini) and records that client's NATIVE identity surface — session ids, per-message host ids, explicit compaction headers or summary-turn prefixes — into session ext key `nidv:obs` as sha1-8 DIGESTS only (raw id values never leave request memory; unknown clients write nothing). Pure collection at the single relay choke point: zero forwarded-byte changes, zero decisions, fail-open by construction. It exists to turn the #5571 client-collection table from static forensics into live measured data ahead of the M2 binding table and M3 re-baseline work. Default OFF (0%) — enable with `true` or `BILI_ROLLOUT_NATIVE_IDENTITY_OBSERVATION=1`. See technical-notes.md "Native identity observation layer". |
| `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.watermarkCompactionPassthrough` | boolean \| number | 100 (on, nested under pluginFullResendWatermark) | BILI_ROLLOUT_WATERMARK_COMPACTION_PASSTHROUGH | Watermark v6 canonical-ledger unification (#5403/#5418 v6): when the plugin-lane watermark turn carries a shape-valid host-id list AND a mid-history unknown id sits before a still-known one — a client structural rewrite (compaction/insertion) that changed what the stashed prefix cores describe — this knob decides the verdict: ON (default) pays ONE conservative legacy pass for that turn (credited miss, self-healing re-stamp) so the increment rides through as new messages from the next turn with its fresh ids appended to the session's cumulative host-id ledger (pf:state.lg, FIFO-capped) — no suppression logic, never speculative rebuilds; OFF restores the pre-v6 behavior for those turns (the rewrite rides the stashed prefix under the identity-only ruling, byte-compare demoted to diagnostic). Only matters for id-list turns inside an already-enabled watermark cohort; count-only turns are byte-identical either way. Force off with false / env = 0. See technical-notes.md "Full-resend watermark fastpath". |
| `rollout.features.passDshExtensions` | boolean \| number | 0 (off = intercept) | BILI_ROLLOUT_PASS_DSH_EXTENSIONS | DSH client-extension intercept (#7168/#7439): DSH (deepseek-harness) rides top-level `dsh_*` fields on every request — `dsh_session_log` (the 8 MiB lossless session-log upload for the official DeepSeek API; the model never reads it) plus the sibling `dsh_plugin_packages`; forked/seeded sessions resend the whole log each turn until the watermark catches up. Default 0% = INTERCEPT: bili strips every TOP-LEVEL `dsh_*` key from the inbound body (src/server/handle.ts) before any protocol path builds the outbound, so the 8 MiB is never forwarded upstream — no bandwidth waste, no unknown-field risk on a non-DeepSeek upstream. DSH is unaffected: its upload watermark only advances on a 2xx, which bili still returns, so the resends self-heal. The window meter is separately exempt via the #7168 dsh_* skip (src/preflight.ts). RELEASE by flipping to 100% (or removing the strip) once the server-authoritative egress work (#6785 / discussion #7439) ships the client-extension sideband; force pass-through now with `true` / env = 1. |
| `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. |
Expand Down Expand Up @@ -2044,9 +2046,11 @@ File keys resolve only when the matching env var is unset. Defaults in parenthes
| `BILI_RESUME_INHERITANCE` | `resumeInheritance` | true |
| `BILI_ROLLOUT_<FEATURE>` | `rollout.features.enabled` | unset (bucket math decides) |
| `BILI_ROLLOUT_IDENTITY_CHANNEL_HARVEST` | `rollout.features.identityChannelHarvest` | 0 (off) |
| `BILI_ROLLOUT_NATIVE_IDENTITY_OBSERVATION` | `rollout.features.nativeIdentityObservation` | false (off) |
| `BILI_ROLLOUT_PASS_DSH_EXTENSIONS` | `rollout.features.passDshExtensions` | 0 (off = intercept) |
| `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_COMPACTION_PASSTHROUGH` | `rollout.features.watermarkCompactionPassthrough` | 100 (on, nested under pluginFullResendWatermark) |
| `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
Loading
Loading