Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
161 commits
Select commit Hold shift + click to select a range
8d13ffe
msgid: server-side record on all four wires + GA pin rollout (#6525/#…
ranxianglei Nov 13, 2026
ed0e84f
fork: msgid identity track for the plugin fork protocol (#6262)
ranxianglei Nov 11, 2026
6a65e1c
msgid: wire dsh full-resend turns onto the biliMsgIds envelope (#6525)
ranxianglei Nov 13, 2026
79f5614
fix: dsh envelope bailed every tool turn — host ids churned to digest…
ranxianglei Nov 13, 2026
709596e
msgid: pi+omp full-resend turns onto the biliMsgIds envelope (#6525/#…
ranxianglei Nov 13, 2026
b10d880
opencode V2: skip the hoisted leading system run in the msgId header …
ranxianglei Nov 13, 2026
5ed59bc
msgid: scrub biliMsgIds/biliLedgerSeqs on every verbatim-forward lane…
ranxianglei Nov 13, 2026
1bf3bc8
msgid: opencode V1 full-resend envelope onto x-bili-msg-ids (#6525/#6…
ranxianglei Nov 13, 2026
9c4a344
test: hermetic e2e for the msgid envelope over the real HTTP stack (#…
ranxianglei Nov 13, 2026
52e54c7
msgid: responses-wire full-resend envelope for dsh/pi/omp (#6525/#6539)
ranxianglei Nov 14, 2026
ec302b9
storage: snapshot-table compression foundation (P0 schema + P1 shadow…
ranxianglei Nov 7, 2026
9bb3f3f
docs: document storage.snapBase.{enabled,shadowWrite} seeds + regen c…
Nov 7, 2026
5c214be
test: close the snapplane flag stores before rmSync — Windows EBUSY o…
Nov 7, 2026
bbd645f
fix: re-anchor the S4 anchor when GC physically releases plane rows (…
Nov 7, 2026
f6c5a19
refactor: drop the unused completeLog param from snapShadowSync (#5874)
Nov 7, 2026
d7a69b0
soak: run the snapshot plane at 100% default for ci:full + local gate
ranxianglei Nov 8, 2026
68f8a97
docs: add storage-relations diagram (zh/en)
ranxianglei Nov 8, 2026
2707163
docs: land the #5874 snapshot-table design record (zh/en) + index ent…
ranxianglei Nov 8, 2026
ce023c6
docs: list src/storage/snap.ts in the architecture file map (#5874)
Nov 8, 2026
f11f3fc
docs: architecture map schema note v11 → v12 — this branch bumps STOR…
Nov 8, 2026
243e2d6
docs: regenerate configuration index — snapBase rows back to seed tru…
Nov 8, 2026
f2520a2
fix: probe-first v12 DDL so the plane coexists with sibling-branch sc…
ranxianglei Nov 8, 2026
3c7ee7d
test: tolerate mid-reinstall ENOENT in e2e readPkgVersion polls (#590…
Nov 8, 2026
d253f0b
outbound context served from the verified snapshot plane, with a byte…
ranxianglei Nov 8, 2026
ecf3f9f
tests(#5874 P2): widen the msg() helper role to allow the anchor's sy…
ranxianglei Nov 8, 2026
dd71842
fix(#5874 P2): re-apply the per-resend ACP envelope onto plane-render…
ranxianglei Nov 8, 2026
3597fdc
ci(#5874 P2): satisfy the guard jobs — config seeds, architecture doc…
ranxianglei Nov 8, 2026
7781e1f
observability(#5874 P2): log the first diverging field on egress trip…
ranxianglei Nov 8, 2026
39c8e6f
observability(#5874 P2): mismatch context includes field lengths and …
ranxianglei Nov 8, 2026
0d6ef38
fix(#5874 P2): reach render parity by running the kernel's own render…
ranxianglei Nov 8, 2026
bab9407
fix(#5874 P2): anchor summaries at the earliest covered row and adopt…
ranxianglei Nov 8, 2026
036b91f
tests(#5874 P2): pin BILI_MESSAGE_TIMESTAMPS=1 inside the T18a/T18b r…
ranxianglei Nov 8, 2026
e9981c8
fix(#5874 P2): pair tool results by toolCallId for trim adoption; ric…
ranxianglei Nov 8, 2026
ba14b5b
fix(#5874 P2): adopt the dsh tool-result pruner's head+marker+tail shape
ranxianglei Nov 8, 2026
2bc4d14
fix(#5874 P2): tripwire dump head/tail via text-safe clamp (family ga…
Nov 8, 2026
204a192
chore(#5874 P2): seam-window + adoption telemetry on the egress tripwire
ranxianglei Nov 8, 2026
d5a2222
fix(#5874 P2): adopt the kernel's own emergency-truncation clips on t…
ranxianglei Nov 8, 2026
45dc8cc
fix(#5874 P2): tripwire sees codec sidecars; toolCallId seam arm; har…
ranxianglei Nov 8, 2026
26abb94
fix(#5874 P2): run the kernel/lane post-passes over the plane view too
ranxianglei Nov 8, 2026
852a8a8
test: align storage-null-identity schema pins with this PR's v12
Nov 10, 2026
cf9a805
test(e2e): disable repetition guard in delegate-notify hermetic scenario
Nov 10, 2026
0677875
fix(field): live-task receipts — fold-pointer echo acked as no-op, st…
ranxianglei Nov 10, 2026
0553e75
refactor(#5874 P2-final): the snapshot write runs in-request, in the …
ranxianglei Nov 10, 2026
80b535f
fix(#5874 P2): respect the #5608-C timestamp high-water mark in the p…
ranxianglei Nov 10, 2026
3c9a531
fix(#5874 P2): hydrate media in the egress plane view; the plane path…
ranxianglei Nov 10, 2026
1a81e59
refactor(#5874 P2): mapEgress direct authority — no per-round diff, e…
ranxianglei Nov 11, 2026
5f93ec6
chore(#5901): re-trigger CI — the 533b72fb4 push event was not delive…
ranxianglei Nov 11, 2026
ab9157b
fix(#5901): drop unused export — snapEgressFlags is internal to snap-…
ranxianglei Nov 11, 2026
33b1011
fix(#5874 P2): plane write side — remint collisions, in-save folds, r…
ranxianglei Nov 11, 2026
86d3d5d
fix(rebase): drop the relocate-compress import (feature removed on ma…
Nov 11, 2026
d1f0e7d
fix(#5874 P2): #5765 retire parity — the plane egress anchor loop ski…
Nov 11, 2026
60070ca
refactor(#5874): drop the orphaned TRUNCATION_CLIP_RE export — kernel…
Nov 11, 2026
d049dde
docs(#5874 P2): drop the duplicated snapAbCheckTagged doc line (edit …
Nov 11, 2026
815d095
feat(#5874 2×2): 2×2 snapshot egress modes — stage-0 world match, ker…
ranxianglei Nov 11, 2026
5bdb4dc
fix(#5874 2×2): restore the #1954 KEEP=1 contract — strip previous_re…
ranxianglei Nov 11, 2026
5e38cf1
fix(#5874 2x2): review round 1 — B0-B4 + M1-M6 (plane bypass, 400 fun…
ranxianglei Nov 12, 2026
799fab2
fix(#5874 2x2): review round 2 — no-op rounds keep the chain id, same…
ranxianglei Nov 12, 2026
a85ae7d
fix(#5874 2×2): Residual 2 hardening — the chain id is opaque: trust …
ranxianglei Nov 13, 2026
e2c8636
fix(#5874 2x2): use safeSuffix for the mint-scan tail clamp (family g…
Nov 13, 2026
345949e
fix(#6181): 5901-base regressions — untagged-save plane guard (prefix…
ranxianglei Nov 13, 2026
06c410c
fix(#6181): repair the merged process.yaml — desc_ja line lost its ne…
ranxianglei Nov 13, 2026
cba5155
fix(#5901): review cleanup — drop pr-body-6299.md working file, stale…
Nov 13, 2026
fc57eb6
fix(e2e): pin BILI_STORAGE_JSON_WRITER=on in the five native suites —…
ranxianglei Nov 13, 2026
838a2a2
fix(e2e): pin BILI_STORAGE_JSON_WRITER=on in e2e-native-dsh-persona —…
ranxianglei Nov 13, 2026
66db88b
fix(e2e): pin BILI_STORAGE_JSON_WRITER=on in fork-ccr-adoption + lift…
ranxianglei Nov 13, 2026
c3ec9bd
fix(tests): close SessionStores before rmrf under the #6480 full-mode…
ranxianglei Nov 13, 2026
9211084
snapshot-plane review fixes (#5901): B0 delta-view stale-ride, defaul…
ranxianglei Nov 13, 2026
f42f251
fix(rebase): drop the duplicate getStore import in prepare-responses.ts
ranxianglei Nov 14, 2026
eb0670d
fix(#5901): restore the storage.snapBase.enabled/shadowWrite desc_ja …
ranxianglei Nov 14, 2026
3a68dcb
integrate: #5901 (snapshot plane) + #6564 (msgid delivery) on master …
ranxianglei Nov 14, 2026
3467f7a
fix: keep the incremental lane's rolling cache marks byte-exact under…
ranxianglei Nov 14, 2026
8316a91
gate: add --snapbase-full flag to run the #5874 snapshot plane fully …
ranxianglei Nov 15, 2026
6a388fd
Merge remote-tracking branch 'origin/master' into integrate-6564-5901
ranxianglei Nov 15, 2026
13bc38f
fix(#6785): review 修复 — 失败 flush 的 egress bypass + B3 路径载体剥离
ranxianglei Nov 15, 2026
8b6bc19
docs: clear the stale tripwire wording left by the P2 direct-authorit…
ranxianglei Nov 15, 2026
0b89d29
test: #5874 T8 GC-gating (+/-) and T2e update-success rows (#6785 rev…
ranxianglei Nov 15, 2026
3fe1352
refactor: #5874 pure-incremental rework — retire the snap three-table…
ranxianglei Nov 15, 2026
2b07afd
rebase: land the #5874 pure-incremental rework on current master — un…
ranxianglei Nov 15, 2026
e43e430
feat: #5874 v2 — fold_journal: append-only fold decision points with …
ranxianglei Nov 15, 2026
bd9c467
feat(storage): egress_snapshot — materialized stable-prefix cache for…
ranxianglei Nov 15, 2026
22098cc
feat(storage): egress cut advances to the newest user-message boundar…
ranxianglei Nov 15, 2026
7e49101
feat(config): storage.snapBase two-key gate for the egress plane (#67…
ranxianglei Nov 15, 2026
c73d412
Merge origin/master into 2026-11-15_msgid-snapshot-unified
ranxianglei Nov 15, 2026
f59c3ec
fix: dedupe getStore import after the master merge (#6785)
ranxianglei Nov 15, 2026
57a5bca
docs: align architecture docs with the v2 plane (#6785)
ranxianglei Nov 15, 2026
e39dda4
docs: adopt the generator's snapBase rows (docs-sync lane)
ranxianglei Nov 15, 2026
3e57515
fix(storage): sessionStorageStats binds one arg per placeholder (#6785)
ranxianglei Nov 15, 2026
c410281
feat(storage): ccr slim envelope — column keeps the envelope only, or…
ranxianglei Nov 16, 2026
a03c666
feat(storage): orphan_blocks + state_fields — reaped-block views and …
ranxianglei Nov 16, 2026
01b69f2
fix: drop internal-only slim.ts exports and add slim.ts to the archit…
Nov 16, 2026
c28489e
fix: three CI-gate defects from #6785 steps 6/7 (null orig contract, …
Nov 16, 2026
5552ed8
fix: hashless CCR entries keep the "" orig marker so the slim store s…
Nov 16, 2026
41dcac7
Merge branch 'master' into 2026-11-15_msgid-snapshot-unified
ranxianglei Nov 16, 2026
82c475b
fix(storage): #6785 review fixes — migration gate, mysql parity, slim…
ranxianglei Nov 16, 2026
a6991d0
fix(server): #6785 review fixes — scrub the #6548 verbatim lane, stri…
ranxianglei Nov 16, 2026
27e267a
fix(knobs): fail closed on a malformed snapBase.cohorts list
ranxianglei Nov 16, 2026
1e832e6
fix(snapshot): #6785 review fix — the R3 latch gets an operator escap…
ranxianglei Nov 16, 2026
f60e549
test(agent): #6785 review fix — parity-pin the v2 leading-run skip to…
ranxianglei Nov 16, 2026
ac36103
perf(snapshot): K-turn re-cut cadence for the egress prefix cache (#6…
ranxianglei Nov 16, 2026
53a00ec
Merge remote-tracking branch 'origin/master' into 2026-11-15_msgid-sn…
ranxianglei Nov 16, 2026
70d2e1b
#6785 review: seed entry for storage.snapBase.cutEveryKUserTurns (con…
ranxianglei Nov 16, 2026
973c935
#6785 review: regenerate config docs for the cutEveryKUserTurns seed …
ranxianglei Nov 16, 2026
20e998b
Merge remote-tracking branch 'origin/master' into 2026-11-15_msgid-sn…
Nov 16, 2026
d08ce0d
#6785 review: register src/responses-system-sections.ts in the archit…
ranxianglei Nov 16, 2026
1a2e0c3
Merge remote-tracking branch 'origin/ci-fixes' into 2026-11-15_msgid-…
Nov 16, 2026
0283c81
fix: dedupe responses-system-sections.ts module-map entry (ci-fixes m…
Nov 16, 2026
96692fe
merge ci-fixes (sentinel sweep #4599: #2929 root fix + architecture-d…
Nov 16, 2026
5ea3714
Merge branch 'master' into 2026-11-15_msgid-snapshot-unified
ranxianglei Nov 17, 2026
714c717
fix(storage): self-heal R3 latch placeholder on unlatch + steady-stat…
ranxianglei Nov 17, 2026
c3623bf
feat(msgid): pin host msgids on watermark-hit turns + wire fork colle…
ranxianglei Nov 17, 2026
001e16f
msgid 生命周期梳理:存储瘦身(D1/D2/D3)+ fork 车道回归修复(discussion #7064)
ranxianglei Nov 18, 2026
ced9644
chore: 删死模块 src/snapshot/checksums.ts — envelope_checksum 随 #7064 瘦身移…
ranxianglei Nov 18, 2026
53e16b1
test: update #5874-v2 L3 to the #7064 watermark-scope digest semantics
Nov 18, 2026
2cbbc1d
feat(msgid): pin 通道增量化——稳态只发尾部、快照轮才发全量(#7064 §8,owner 裁定 2026-11-18)
ranxianglei Nov 18, 2026
8575e4e
Merge branch 'master' into 2026-11-15_msgid-snapshot-unified
ranxianglei Nov 18, 2026
2837c38
(PR#6785 review) docs: drop the ghost checksums.ts entry that ced9644…
mirandabryna Nov 18, 2026
7808fa8
Merge remote-tracking branch 'origin/master' into 2026-11-15_msgid-sn…
mirandabryna Nov 18, 2026
c0df208
feat(msgid): 增量 pin 全客户端覆盖(#7064 §9 phase 2,owner 裁定 2026-11-18)
ranxianglei Nov 18, 2026
2585952
(PR#6785 review) identity: keep the append-window head TRUE past 512;…
Nov 18, 2026
351ccc1
Merge remote-tracking branch 'origin/2026-11-15_msgid-snapshot-unifie…
Nov 18, 2026
c2fd9b7
(PR#6785 review) msgid: close the two silent pin-loss stuck states
Nov 18, 2026
ed71f12
(pf#6785 review) pf-channel: over-ceiling lists keep their TAIL — ult…
Nov 19, 2026
d8e100d
(PR#6785 review) pin verifies prefix content; egress read side goes O…
Nov 19, 2026
3f40b51
(PR#6785 review) revert the incremental pin's content-hash verification
Nov 19, 2026
950eb8d
fix: 超长会话截断尾清单也能 pin——增量接受规则改为「尾部对齐 + 重叠段逐行对账」
ranxianglei Nov 19, 2026
00f27c6
Merge branch 'master' into 2026-11-15_msgid-snapshot-unified
ranxianglei Nov 19, 2026
44e1ba3
fix(tests): serialize concurrent access to the shared dist/agent/pi.j…
Nov 19, 2026
86565fa
fix(storage): hydrate the always-empty CCR store instead of null
ranxianglei Nov 20, 2026
b4bbaae
fix(fastpath): exclude message ids from the head-prefix check
ranxianglei Nov 20, 2026
2c3bdd1
fix(prepare-openai): mark the watermark-HIT window snapshot as folded
ranxianglei Nov 20, 2026
ac9c3a0
Merge remote-tracking branch 'origin/master' into 2026-11-15_msgid-sn…
Nov 20, 2026
484a3d3
test(#7156): zero the sessions root page dynamically instead of a har…
Nov 20, 2026
9efbf8b
fix(prepare-openai): ledger the pinned tail ids on watermark-HIT turns
ranxianglei Nov 20, 2026
275f467
fix(launcher): widen the win32 birth-stamp powershell budget to 30s
Nov 20, 2026
fe54b7b
feat(fastpath): delta resend arm — the tail-slice form of the waterma…
ranxianglei Nov 20, 2026
bf6d45c
chore(ci): unexport DeltaVerdict (unused-export gate) + regenerate co…
ranxianglei Nov 20, 2026
b31e7e1
feat(storage): egress op-log outbound view — dual-table state+flow wi…
ranxianglei Nov 20, 2026
c52c5dd
feat(storage): egress view diff engine — deterministic sparse ops bet…
ranxianglei Nov 20, 2026
2097058
fix: unexport EgressOpType (unused-export gate)
Nov 20, 2026
5b3b55c
feat(storage): egress op-log recording seam — shadow-record the outbo…
ranxianglei Nov 20, 2026
f2653b0
fix: unexport EgressSourceMsg (unused-export gate)
Nov 20, 2026
a936b3f
feat(storage): egress serve-from-log reconstruction + shadow byte-ide…
ranxianglei Nov 20, 2026
753192c
fix: egress export hygiene — re-export EgressSourceMsg, unexport Egre…
Nov 20, 2026
47ab4ce
feat(egress): serve the outbound conversation from the op log + conte…
ranxianglei Nov 20, 2026
8e403e0
fix(test): close SessionStore before rmSync cleanup (Windows EPERM on…
Nov 20, 2026
d52e65d
perf(fastpath): defer the full-body JSON.parse on pf-protocol OpenAI …
ranxianglei Nov 20, 2026
39941c8
fix(egress): serve tool rows from the op log — the CAS body carries t…
ranxianglei Nov 20, 2026
10a8f6c
fix(egress): close two storage-only-grows leaks found in the PR #6785…
ranxianglei Nov 21, 2026
2e7293e
docs: PR #6785 review-grade walkthrough + remove the outdated docs
ranxianglei Nov 21, 2026
58abab9
merge: resolve prepare-openai.ts conflict with master (#7346 fix alre…
Nov 21, 2026
3ddbc63
fix(test): close store before rmSync + forget leaked "old" chain (Win…
Nov 21, 2026
7fa93d4
fix(storage): close the integrity worker's read-only handle on the er…
Nov 21, 2026
b197406
refactor: egress op-log rows are self-contained bytes (#7439 ruling 1)
Nov 21, 2026
5f7f07c
refactor: egress flow table is the single source of truth (#7439 ruli…
Nov 21, 2026
d3ab5ab
merge: resolve conflicts with master (#7381 pf-tail-ids-cap-and-stamp…
Nov 21, 2026
a993332
refactor(egress): self-contained bytes — the op-log carries the messa…
ranxianglei Nov 21, 2026
07c335b
refactor(egress): server authority — the flow tables are the only sta…
ranxianglei Nov 21, 2026
ad5722e
feat(egress): all four lanes record/serve the op-log (ruling 7439-4)
ranxianglei Nov 21, 2026
bfafd0b
fix(storage): re-apply the #7156 envelopeImport contract onto the rep…
ranxianglei Nov 21, 2026
bc51c94
refactor(egress): retire the fold-journal / egress-snapshot / scope-r…
ranxianglei Nov 21, 2026
02fc8f4
refactor(egress): one switch, one path — collapse egressOpLog/egressS…
ranxianglei Nov 21, 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
8 changes: 8 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ Tier A entries are every-session rules and stay in full below. Tier B entries ca

身份信号来源只有三类:**宿主写入**(msgid body 字段 / 信封 `msgIds` / pf 头)、**宿主盖戳头**(opencode V2 `x-bili-msg-ids`)、**自包含采集器**(`src/identity-harvest.ts` 注册表 + `src/identity-<client>.ts` 适配器;双门:env `BILI_IDENTITY_HARVEST` 或灰度键 `rollout.features.identityChannelHarvest`,均默认关 × 仅回环来源)。**消费者(#5719 归属档 / pin-行链路 / membership / 水位)只从统一缝取数**:handle 入口每请求按「body 字段 > 盖戳头 > 采集」取一次快照——绝不新增「逐调用点单独取数」。新车道 = 新适配器文件 + barrel 一行登记 + 文档一行;适配器自包含、整轮退化(任一环节不判定 ⇒ 该轮整体回退接线前路径,绝不做部分映射)。车道状态表与信任边界:docs/identity-channels.md;身份判定逻辑:docs/session-identity-resolution.md。Full text: design-decisions.md #18.

### #20 — id 存储去重与 msgid 生命周期梳理(#7064, owner 裁定 2026-11-17) (Tier B)

msgid 真身只有 `messages.msg_id` 一处,`l1_world`/`fold_journal`/`egress_snapshot` 里的 id 清单 JSON 全是投影,已全部降级为「区间引用 + 防伪指纹」:l1_world = 尾 512/头 32 id 窗 + count + max_pos(身份闸门→记账游标,中段不可见);fold_journal = [start_seq,end_seq] + input_hash(原文行防伪指纹,按区间重扫重推);egress_snapshot = 水位线以下存活行聚合指纹。**D1 永不判分叉**(判决最强动作是 reanchor 一条 UPDATE,永不 reject/400/reset);**D2 conversation-bound 跳过 id 判定**(宿主身份行的 sid 游标纯记账,R3 故障永不触发,短/缺 msgid 只降级 + 日志);**D3 尾锚常活**(水位命中轮同样 pin + 刷新游标;stage-0 推进 bump revisionEpoch,snapFlush epoch 证明看见推进——fork 拿不到过期父 revision)。改 l1/fold_journal/egress 任何一处前先读 discussion #7064 与本条目——三表回答的是同一个问题(「我缓存的和账本还对得上吗」),不需要 id 清单本身。Full text: design-decisions.md #20.

### #21 — msgid pin 通道增量化:稳态只发尾部,快照轮才发全量(#7064 §8, owner 裁定 2026-11-18) (Tier B)

全量 msgid 清单不再每轮发送:稳态靠既有有界通道 `x-bili-pf-tail-ids`(锚点+新增,≤2048,`?` 占位)携带增量,服务端从前缀**从账本 live 行重盖**(ingest 是 INSERT OR IGNORE on (session_id,seq)——位置上的 msg_id 只写一次,不从账本重盖 kernel ref 空间会漂)。接受规则(2026-11-19 定型:尾部对齐重叠段逐行对账):清单声明覆盖连续尾段 [T-L, T-1],与账本的重叠段 [T-L, C-1] 逐行相等(任一行漂移⇒降级,永不 reject);新增核(重叠之后)逐槽筛查;稳态形态(锚点+新增,L=N+1)= 单行重叠特例 = 原锚点检查,行为不变;**超长会话(>2048)截断尾清单同样可 pin**——重叠段更长、证明更强,「退回全量」退化为「发你有的」,全量不再是必需。任何失配降级 "full" 信号、下轮重锚(D1 家族)。全量形式不删、**全量优先**:只有快照轮(启动账本空 / 压缩/fork 后重锚)发全量。客户端经响应头 `x-bili-msgid-mode: incremental|full` 学 mode(与 x-bili-pf-seq 同头发出、4xx 即清、pf 状态机单学习点 pfLearnStamp);抑制单点 pfSuppressFullMsgIds(wire 短于最近实测 T ⇒ 压缩 ⇒ 清 mode + 发全量)。灰度 `pluginMsgIdIncremental` 默认 0(off = 字节级同改前);opencode 暂留全量(phase 2:core-aligned 列表跳过 leading system 而 /responses T 计 wire,tail off-by-one)。改 pin/信号/tail-ids 任何一处前先读 discussion #7064 §8 与本条目。Full text: design-decisions.md #21. **phase 2(owner 裁定 2026-11-18:全客户端覆盖 + 默认开)**:两形态规则上移到申报通道本身——数组长度 = 视图长度 ⇒ 全量(既有路径),短数组 ⇒ 合法尾部形态(漂移类:只降级发「full」,永不 400;R3 故障只来自全量数组的坏内容;**空账本上的短数组 = 采集故障,沿用旧 R3 400 路径**);body 短数组优先于 pf-tail-ids header。responses/anthropic 车道都接受尾部形态并发 `x-bili-msgid-mode`;opencode V1/V2 已接线(`pfIdTailForm` prevIds 前缀延伸校验,shrink/rewrite 回落全量;core-aligned 列表对 hoist 后 core 计数天然对齐,**无偏移**);omp 无全量申报面(delta 车道天然增量)、claude/codex/google 无申报 = 覆盖完整;`pluginMsgIdIncremental` **默认 100**(回滚 env `BILI_ROLLOUT_PLUGIN_MSG_ID_INCREMENTAL=0`,失配一轮自愈)。

### Install-Lane & Update-Ownership Contract (#1196)

Every bili presence on a machine follows ONE contract — decide changes against it, not ad hoc:
Expand Down
2 changes: 1 addition & 1 deletion docs/architecture/storage.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

**書き込み側。** インジェストパスは統合ビューをバッチ書き込みする(安定した絶対 seq; `identityOfStoredContent` によるコンテンツハッシュ ID; バウンダリフレーム `boundaryMsgId` はバッチとともに格納される)。`persist.ts` はセッションファイルの保存/読み込みと EPERM アラート層を処理する。カーネルは、カーネルが提供する StateStore インターフェースを通じて圧縮状態(ブロック / 参照 / dead_refs / チェックポイント)を書き込む — ホストは実装を差し替える。

**kstate JSON は並列の第二の真実の源である(ペインポイント 1)。** 残存する `CompressionState` フィールドリストは `mergeState()` によってシリアライズされる(フィールドリストの単一の源 — `src/state-hydration.ts`)であり、テーブルとともに読み書きされる — 二重チャネルである。#5643 の進化により、カーネル状態のシリアライズは `snap_ckpt.meta_json` 内に移動され、テーブルが唯一の源となる。
**kstate JSON は並列の第二の真実の源である(ペインポイント 1)。** 残存する `CompressionState` フィールドリストは `mergeState()` によってシリアライズされる(フィールドリストの単一の源 — `src/state-hydration.ts`)であり、テーブルとともに読み書きされる — 二重チャネルである。カーネル状態のテーブル統合はフォローアップ作業(#6858 が #6785 のスコープ外と明記);#5874 v2 の基盤(content CAS、messages、refs、fold_journal、egress_snapshot)がその収束の着地点である。

**読み込み側。** ハイドレーションは、残存フィールドの単一の源として `mergeState()` を使用する(テーブル + kstate が組み立てられる)。エグレスはフォールディングカバレッジチェックとサーバーサイドの正規レンダリングを実行する(D レーン、#3756 — どのデシンクもレガシーパスにフォールバックし、デグレードしても推測しない)。課金とキャッシュ台帳(`cache-ledger`、`store.ts` 内の CCR 取得)および表示/エクスポートサーフェス(`sessions-data`、`acp_status`、`export` — 誠実な出力、#155)はすべて同じ行を読み取る。メンテナンスは `state-gc` / `storage-maintenance` / オルファン GC(`sessions.gc_*` でのストレージ GC、オプトイン、dead-ref の回収)である。

Expand Down
2 changes: 1 addition & 1 deletion docs/architecture/storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Everything that must survive a process restart lands in ONE SQLite file: session

**Write side.** The ingest path batch-writes the unified view (stable absolute seq; content-hash ids via `identityOfStoredContent`; boundary frame `boundaryMsgId` lands with the batch). `persist.ts` handles session file save/load and the EPERM alert layer. The kernel writes compression state (blocks / refs / dead_refs / checkpoints) through the StateStore interface the kernel ships — the host swaps the implementation.

**The kstate JSON is the parallel second source of truth (pain point 1).** The surviving `CompressionState` field list is serialized via `mergeState()` (single source of the field list — `src/state-hydration.ts`) and read/written alongside the tables — a dual channel. The #5643 evolution would move kernel state serialization into `snap_ckpt.meta_json` so the tables become the only source.
**The kstate JSON is the parallel second source of truth (pain point 1).** The surviving `CompressionState` field list is serialized via `mergeState()` (single source of the field list — `src/state-hydration.ts`) and read/written alongside the tables — a dual channel. Consolidating the kernel state into the tables is tracked as follow-up work (#6858 lists it as out of scope for #6785); the #5874 v2 substrate (content CAS, messages, refs, fold_journal, egress_snapshot) is what that consolidation lands on.

**Read side.** Hydration uses `mergeState()` as the single source for surviving fields (tables + kstate assembled). Egress runs the fold-coverage check and the server-side canonical render (D-lane, #3756 — any desync falls back to the legacy path, degrade never guess). Billing & the cache ledger (`cache-ledger`, CCR retrieval in `store.ts`) and the display/export surfaces (`sessions-data`, `acp_status`, `export` — honest output, #155) all read the same rows. Maintenance is `state-gc` / `storage-maintenance` / orphan GC (storage GC on `sessions.gc_*`, opt-in, dead-ref reclaim).

Expand Down
2 changes: 1 addition & 1 deletion docs/architecture/storage.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

**写入侧。** ingest 路径批量写统一视图(稳定绝对 seq;内容哈希 id 走 `identityOfStoredContent`;边界帧 `boundaryMsgId` 随批落地)。`persist.ts` 管会话文件存盘/装载与 EPERM 告警层。内核经 StateStore 接口写压缩状态(blocks / refs / dead_refs / checkpoints)——接口由内核自带,宿主换实现。

**kstate JSON 是平行的第二个真源(痛点 1)。** 存活 `CompressionState` 字段清单经 `mergeState()` 序列化(字段清单的单一事实源在 `src/state-hydration.ts`),与表并行读写——双通道。#5643 演进会把内核态序列化挪进 `snap_ckpt.meta_json`,让表成为唯一真源。
**kstate JSON 是平行的第二个真源(痛点 1)。** 存活 `CompressionState` 字段清单经 `mergeState()` 序列化(字段清单的单一事实源在 `src/state-hydration.ts`),与表并行读写——双通道。把内核态收敛进表是后续工作(#6858 将其列为 #6785 范围外);#5874 v2 基座(内容 CAS、messages、refs、fold_journal、egress_snapshot)就是那次收敛落地的目标。

**读取侧。** 水合用 `mergeState()` 作为存活字段的单一事实源(表 + kstate 拼装)。出站跑折叠覆盖检查与服务端正史渲染(D-lane,#3756——任何失步回退 legacy 路径,**降级不猜**)。计费与缓存账本(`cache-ledger`、CCR 取回在 `store.ts`)、展示/导出面(`sessions-data`、`acp_status`、`export`——诚实输出 #155)读的都是同一批行。维护面是 `state-gc` / `storage-maintenance` / 孤儿 GC(`sessions.gc_*` 上的 storage GC,opt-in,dead-ref 回收)。

Expand Down
Loading
Loading