Checked against the real previous build: once an older build has saved a
session it rewrote the ccr_entries rows to the bare { hash } stubs it saw
and released the entry rows, so no link from the placeholders to the texts
is left anywhere. The "take the texts back from the ledger" heal added in
717364a5 could never fire and also broke the export's missing-hash
contract; it is removed. What stays and is real: the nine state fields
come back (an older build's own value wins) and the lost content store is
logged with its cause instead of failing silently. A session the older
build only read is intact after re-upgrading.
New §7 in both languages: what a rollback to an older build loses and what heals, the big-request fix, the outbound op log rules (authority, damaged log, admin routes, compaction), the msgid changes, the migration fix. Three inline sentences point at it.
- .pr-body.md, .ci6785-final.txt, .comment-7439.md, .reply-7439.md were
working notes that slipped into the hand-resolved merge of #6785.
- "KDD #21/#21" -> "KDD #21/#22" in four docs.
- pluginFullResendWatermark is on by default since 2026-11-22 (owner
ruling); AGENTS.md, design-decisions.md KDD #15, the PR #6785 doc table
and the web config label still said 5% / experimental.
Conflicts resolved:
- src/agent/fork-adopt.ts + src/agent/opencode-v2.ts: union of the two
fork-branch-point tracks — master's #5509 resolveForkBranchPoint
(role+text-first, host-declared boundary) stays the base decision;
this branch's #6262 host-msgid identity track extends it afterwards
and never beyond a host-capped boundary. Call sites feed BOTH
msgIds and boundary.
- AGENTS.md + reference/design-decisions.md: master's KDD #20
(#7537 no estimate-based size refusal, already public on master)
keeps its number; this branch's three new KDD entries renumber
#20->#21 (id 存储去重), #21->#22 (pin 增量化), #22->#23 (egress op
log 正史) — all KDD/des…ions.md references repo-wide
updated in the same commit.
Verification: tsc clean; fork battery (5509/6262/fork-adopt/
opencode) green; egress battery 129/129; full-suite verdict = CI on
the pushed head.
The #5874 v2 snapshot-base plane (storage.snapBase) was retired before merge
(bc51c9445) — egress op log (rollout.features.egressPlane) is its successor.
Sweep the remnants that would otherwise enter master:
- config.ts: the orphaned 17-line snapBase doc comment (the field itself was
already removed) is replaced by a one-line retirement note.
- release-gate-local.mjs: --snapbase-full wrote the dead storage.snapBase key
(silent no-op — the plane was unreachable, same bug 52f81bfb fixed in
scripts/gate); it now writes rollout.features.egressPlane=true.
- scripts/gate config.example.json + README en/zh: the knob docs still said
'storage.snapBase' and per-protocol cohorts (the plane has neither).
- docs/architecture/storage{,.zh-CN,.ja}.md: the v2 substrate enumeration
still listed the deleted fold_journal/egress_snapshot tables.
- AGENTS.md KDD #20 + design-decisions.md #20: both describe fold_journal /
egress_snapshot as live interval-ref tables; they were deleted in bc51c9445
(only l1_world survives) — a note marks the pre-retirement description as
history. The entries are new in this PR, so the fix ships with them.
- schema.ts: SNAPBASE_DDL_V12 -> L1WORLD_DDL_V12 (cosmetic; the DDL creates
the live l1_world table, the name cited the retired plane).
N3: lifecycle row said ≥19.2x, the code gate is strict > (src/preflight.ts:2049).
N4: env assignment crammed onto the next statement's line in the #1987 test.
Add README.ko.md, a full Korean translation of README.md, and link it
from the language switcher in every root README and from docs/index.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A session that has never been forwarded (no usage sample ever landed —
lastInputTokens <= 0) resends its whole raw history verbatim, so no
compression blocks can have been lost and folding is pure gain. For those
fresh sessions below the 6M-char bound (~1M real tokens x 4 chars/token x
1.5 headroom), preflight now nominates K=2 disjoint ranges per round, runs
their in-model summarization calls CONCURRENTLY (Promise.all — the pure
call part only), and commits the candidates sequentially afterwards (kernel
state mutates single-threaded, #2678 shape). The serial walk keeps one fold
per round; the half-life of the 15-40s ladder halves, and a range the
parallel pass cannot summarize is deliberately left out of the skipSet so
the walk takes it over with its halving/transient/probe semantics.
Existing sessions are untouched: a large payload there may indicate LOST
folds, and the owner's rule for that case is to diagnose (warn), not to
spend tokens folding — that tier lands as a separate diagnostic. Above the
6M-char bound the request fails fast instead (the default-off digest
regime, prior commit) rather than burning the call budget without
converging.
Nomination, span selection, preview/render gates, acceptance (max cap,
net-shrink monotonicity, rescue truncate) and failure shapes mirror the
walk and the external batch lane byte-for-byte.
Test: fresh anonymous session, 30 x 10k-char messages (~300k chars, under
the doomed-probe byte floor, non-emergency), asserts peak in-flight >= 2
summarization calls, single forward, mid-history folded out of the rebuilt
payload (kernel anchor + recent tail stay resident by design), and the
blocks hold the upstream-written summaries.
Agent review found that qoderSideTaskConversation keyed the |aux: lane on
business_type only, so two side tasks of the SAME type under one parent mapped
to the same session id — and with trustStampedId GA-on (which retires the
in-lane content-guessed split) they would merge + cross-bleed compression
state. Read the per-task id from body metadata.task_id (validated, zcode
x-query-id pattern) and append it to the lane; fall back to the type-only lane
when absent/malformed. Also trim the claude request-class doc line to match the
implementation (only subagent/main act; the rest fall to the legacy heuristic).
Owner ruling (2026-11-22, PR #6785 thread): the fastpath grey has run a long
time without issues, so it goes GA. The 2026-11-02 retraction that pinned the
5% guard is superseded; the guard test is re-pinned to 100 with this
justification. Web notice/i18n and the config docs (en/zh/ja via the seed)
drop the 'experimental / 5% grey' wording; the one-time intro notice stays
(opt-out pointer) with its gate unchanged. Opt out: rollout.features
pluginFullResendWatermark=false (or a percent) / env = 0.
The round-2 (KDD #22) paragraph was hand-edited into the generated
docs/configuration.md + .zh-CN.md (c85e4a304) but never into the seed
yaml, so gen-config-docs generate rewrote it away and docs-sync went red.
Fix at the source: the seed (website/config-reference/rollout.yaml) now
carries the round-2 text in en/zh/ja; the regenerated ja.md gains the
paragraph (it was missing there too). EN/ZH generated output is now
byte-identical to the committed docs.
The review-grade walkthrough (en/zh) still described the pre-round-2
architecture — egress_snapshot tables, messages as the canonical id
truth, no lazy projection, no perf gate. Add the round-2 chapter
(ruling 7439-2/5: op-log canonical numbering, window re-anchor,
sole-canonical + lazy projection, pin-from-flow, envelope freeze,
hard-fail, measured 10w matrix, resident bench) and mark the
superseded sections inline instead of deleting them.
Supporting sync:
- storage.md (en/zh): egress tables + canonical-authority semantics
- msgid-infrastructure.md (en/zh): KDD #22 carve-out on the
'messages.msg_id is the single id truth' statement
- configuration.md (en/zh): egressPlane knob gains the round-2
lazy-projection semantics
- index.md (en/zh): pr-6785 doc row
- reference/testing.md: ACP_TEST_EG_BENCH bench lane
No code changes. Docs-only.
The intercept PR added the passDshExtensions rollout key (src/rollout.ts)
but every other rollout feature carries a seed entry in
website/config-reference/rollout.yaml plus the generated rows in
docs/configuration.{md,zh-CN.md,ja.md} — this key had none, and the PR body
lacked the config-surface section. Add the seed entry (en/zh/ja) and the
regenerated artifacts; check-coverage stays green (the env name is derived
at runtime via rolloutEnvName, so it lands in the expected-dynamic notice
list like its BILI_ROLLOUT_* siblings).
#6639 + #5853 decision: the egress 429 governor (#4204) now requires an
explicit opt-in (BILI_THROTTLE_429=1 or network.throttle429Enabled: true).
With no config, upstream 429 responses are forwarded to the client
unchanged — no local hold, no terminal 424 — and bili logs one
[429-passthrough] warn per observed 429 so incidents stay diagnosable.
This fixes the "shared concurrency limit" false positives: free-tier /
shared-pool accounts (opencode.ai, Magpie) whose hosts legitimately rate
each other now keep their own retry loops instead of having the whole
credential frozen for Retry-After minutes (#7295) with no self-clearing
hold (#7301). The governor stays available as an escape hatch for
accounts where host retry storms would pin a shared concurrency limit.
- src/knobs.ts: throttle429Enabled() default flips to OFF (env override
semantics unchanged)
- src/upstream-throttle.ts: passthrough warn log on both 429 intake
paths (gate + provisional) when disabled
- docs (en/zh/ja): default true -> false + passthrough wording
- tests: new issue6639-throttle429-default-off pins default-OFF behavior
and the opt-in re-arm; issue4743 A-E now opt in explicitly (they test
the ENABLED path and must not rely on the default)
docs/configuration.*.md is generated from website/config-reference/*.yaml
(docs-sync lane) — add the two workbuddy env pins to env-only.yaml and
regenerate instead of hand-editing the table. check-coverage now passes.
WorkBuddy Desktop embeds a CodeBuddy Code CLI fork for every agent session.
The CLI reads env.CODEBUDDY_BASE_URL from its user settings file BEFORE
process.env (decompiled evidence in #7456), so a managed block in
~/.workbuddy/settings.json routes desktop-spawned AND terminal sessions
through the resident proxy — the app's explicit spawn env allowlist makes
shell exports unreachable.
- bili plugin install wb: wraps env.CODEBUDDY_BASE_URL into the pinned
origin (BILI_WB_PROXY override; default http://127.0.0.1:8787) and sets
autoCompactEnabled:false — bili owns compression, manual compaction
survives. A foreign base URL and an explicit autoCompactEnabled:true are
reported, never clobbered. The install warns when no live proxy is
recorded at the pinned origin (origin-matched instance-file liveness).
- bili plugin remove wb / status row / doctor lane: strips exactly the
bili-owned values; .bili-bak snapshot semantics shared with other lanes.
- Pure wire mode by design: desktop-spawned sessions run --strict-mcp-config
(user MCP scopes blocked), so a host tool face is impossible for the app's
own sessions; compression rides the proxy (acp_summary carrier). No
wire/format changes in either compression mode — the lane is config-write
only on the existing /bili/ forward.
Docs: clients.md/.zh-CN WorkBuddy sections, architecture lanes pages
(en/zh/ja), configuration env-var tables, lifecycle ledger
(BILI_WB_PROXY/BILI_WB_UPSTREAM).
The PR's snapshot-plane commits added config fields (sessions.*, plugin.snapshotCapBytes, snapshot.shadow) and src/server/egress-lane-io.ts without doc seeds, so three CI gates went red on head 02fc8f4c2:
- config-surface-guard: 11 leaf fields lacked website/config-reference seed entries
- docs-coverage: 11 env vars + 2 top-level keys (sessions, plugin) undocumented (BILI_SESSION_CONTENT_STORE_PIN is env-only)
- architecture-docs: reference/architecture.md missing src/server/egress-lane-io.ts
Added the seeds (process.yaml: sessions block + 9 leaves; server.yaml: plugin.snapshotCapBytes + snapshot.shadow; env-only.yaml: BILI_SESSION_CONTENT_STORE_PIN), the file-map line, and the regenerated docs/configuration.{md,zh-CN.md,ja.md} + website artifacts.
Verified locally: all three gates green, generate idempotent, typecheck clean.
PR #6785 CI fix.
The egress plane gets a SINGLE rollout key: egressPlane (default 0).
ON = the complete new path in every lane — sparse-op recording,
serve-from-log (byte-identical swap), and server authority for pinned
plugin lanes (rulings 7439-3/5). OFF = legacy chain, zero rows,
byte-identical to pre-feature. Both predecessor keys never shipped
(default 0, born in rollback state) — no migration.
Owner ruling 2026-11-21: '删掉以前的开关 只留下一个开关'.
Verification: typecheck 0; 13-file storage/egress/fastpath battery
112/112; e2e codex 4-phase pass (rollout off = legacy path).
Every v12 table that never entered master is deleted except the ones the
ruling keeps (l1_world, orphan_blocks, state_fields, egress_state,
egress_flow). The #5874 v2 snapshot-base plane (fold_journal +
egress_snapshot + egress_scope_rev) shipped no behavior yet — its D-lane
byte cache was bypassed on the plugin lane and its sole write consumer
was this PR — so it is removed wholesale:
- schema.ts: three DDL consts + all probes (incl. the covered_ids /
ids_json DROP-column and scope_rev ADD-column migrations); v12 keeps
l1_world / orphan_blocks / state_fields / egress_state+flow
(probe-first, unchanged).
- snap.ts: fold-journal + egress-snapshot functions deleted; the L1
world / R3 latch functions (stage-0 identity + pf pin) are kept.
- store.ts / shadow.ts / persist.ts: egressCut / egressReadView /
appendFoldJournal / appendEgressSnapshot / bumpEgressScopeRev and all
seven per-write rev-bump sites gone; delete/archive cascades trimmed.
- snapshot-render.ts: the splice (warm serve) and cut blocks gone — the
D-lane reverts to live derive, pre-#5874 behavior.
- config surface: storage.snapBase (enabled/cohorts/cutEveryKUserTurns)
removed from config.ts, knobs.ts, process.yaml + regenerated docs —
the plane never shipped, so there is no compat story to keep.
- tests: the three plane-only suites retired; 111/111 battery +
108/108 lane suites green, typecheck clean.
The byte-level prefix-cache gain the plane would have given is superseded
by the self-contained egress op-log, which serves the FULL rendered view
from the flow tables on every lane.
Conflicts resolved:
1. src/server/prepare-openai.ts: union of fastpath imports (PR's
DeltaReanchorError/PF_TAIL_IDS_HEADER/evaluateDeltaResend/parseTailIdsForPin
+ master's stampOnlyWatermarkTurn).
2. tests/fastpath.test.ts: union of fastpath imports (PR's
evaluateDeltaResend/PF_DELTA_HEADER + master's stampOnlyWatermarkTurn).
3. src/agent/pf-channel.ts: kept PR's TAIL_MAX_BYTES byte-budget (supersedes
master's MAX_TAIL_IDS count-cap; the byte check is stricter and
tailPayloadFor is the single source of truth for both header emit AND
full-form suppression).
4. src/server/fastpath.ts: kept BOTH evaluateDeltaResend (PR #6785 delta arm)
AND stampOnlyWatermarkTurn (master #7367 stamp-only turn).
5. src/storage/shadow.ts: kept master's fileJsonWriter parameter (new in
master, not in PR branch).
6. tests/pf-channel.test.ts: updated #7367 tail-cap test to match PR branch's
byte-budget behavior (full slice under 8 KB, not capped to 160).
Stop bounded inspection at the first over-budget chunk and replay its
complete prefix and remaining stream through the existing response pipes.
Do not classify a partial response or alter its fake-completion streak.
Keep retry idle timers and client-abort listeners until the live response
and optional raw dump finish. Error-body truncation remains unchanged.
Validation: 5 baseline behavior failures and 2 passing exact-cap controls;
74 targeted tests pass. Typecheck, build and static gates pass. Codex
preflight finds the CLI/artifact but the live upstream is unavailable;
the real four-phase E2E and full remote CI remain pending.
(cherry picked from commit 2703cbe80f)
[PR] fix(storage): in pure SQLite mode, confirmed index corruption no longer silently falls back to JSON; now fails loudly on | fix(storage): 纯 SQLite 姿态下索引证实损坏不再静默降级 JSON,改为响亮拒启 (#7156)
#5794's ingest band proxied 'beyond every model window' by raw decoded bytes,
which is invalid on the re-send lanes (opencode/dsh re-send the whole raw ledger
every turn and bili folds it) — it 413'd a 33.5 MB opencode turn whose folded
context was tiny. Default -> 0 (unlimited, all lanes); the sibling receive (5 GiB)
/ decode (10 GiB) transport guards still bound pathological bodies.
BILI_INGEST_BODY_BYTES re-enables the band. Supersedes #6933.
- NEW docs/pr-6785-unified-storage-and-flows.{md,zh-CN.md}: the full
review-grade report — table structure (schema v12, all 8 new tables +
payload contracts), per-module implementation logic, per-turn data flow
(steady / fold / degrade / lifecycle), the complete switch ledger
(rollout keys, config objects, headers), and the 2026-11-21 ideal-model
incremental bench with honest conclusions.
- REMOVE docs/proposals/snapshot-compression-foundation/ (described the
RETIRED v1 four-table plane; contradicts the shipped v12 shape) and
docs/storage-relations.{en,zh}.svg (5 tables missing, stale cards) —
both were PR-introduced, never on master; the report supersedes them.
docs/index.{md,zh-CN.md} rows swapped; schema.ts comment re-pointed.
- website/config-reference/rollout.yaml: pluginLaneServerHistory default
corrected to 100 (GA), egressServeLog description corrected to the seg
4b reality (self-recording, true swap, whole-turn degrade), new
pluginMsgIdIncremental entry (was undocumented — the dynamic env name
evaded the docs-coverage CI); docs regenerated.
- Stale comment corrections: rollout.ts egressServeLog (no longer 'seg 4a
LOG ONLY' / 'tool rows in v1'), schema.ts v12 note.
Part of #6785.
The scan now flags dsh-mneme as a KNOWN conflict (like dsh-live-compact), but
the configuration docs still enumerated the known-conflict tier without it.
Add dsh-mneme to the tier list (both the env-var row and the scan section) and
a one-line mechanism note, in en/zh/ja, so the docs match the code.
The #7156 fix added the BILI_STORAGE_ALLOW_LEGACY_DEGRADE escape-hatch env var to src/ but only hand-edited the generated en/zh config docs. The seed (website/config-reference/env-only.yaml — the source of truth) and docs/lifecycle.md were never updated, so three doc gates went red: docs-coverage (undocumented env var), docs-sync (hand-edited docs drift from regenerated output), lifecycle-ledger-guard (no ledger entry).
Fix: add the seed entry (en/zh/ja) and split the BILI_STORAGE_QUICK_CHECK row by stance in all three languages, then regenerate (only the ja doc picks up the new rows — en/zh already matched the seed), and register the new var in lifecycle §2.4 as a permanent operator escape hatch.
In the pure-sqlite stance the SQLite index is the ONLY persistent copy of
the sessions — but a proven corruption (this boot's own quick_check, or the
first post-open write on a large store with a cached verdict) still took the
historical #4626-era contract: loud alarm, start WITHOUT the index, serve
the JSON envelopes. Here those envelopes are a near-empty, non-persistent
view, so the degradation silently loses the durable history — worse than the
corruption itself (2026-11-21 production incident: 3.2GB index.db, panel
showed requests:2/context 0 while the real 1,563 requests / 124k context /
cost sat inside the index).
Now, when the effective stance is pure-sqlite (effective mode full + sqlite
backend + no encryption + jsonWriter off — the 2026-11-13 default flip or an
explicit off), a proven corruption makes bili REFUSE TO START with an
actionable manual fix (back up index.db{,-wal,-shm}, move them aside by
hand, start again). The files stay byte-identical (no move/copy/rebuild, the
#4609/#4626 no-auto-touch policy is untouched). Every stance where the
envelopes remain a real recovery source (explicit dual-write full, shadow,
legacy, network backends, encryption) keeps the historical alarm-and-degrade
contract byte-for-byte.
BILI_STORAGE_ALLOW_LEGACY_DEGRADE=1/true/on is the conscious escape hatch
that restores the degrade path in the pure-sqlite stance; it is never the
default and never implied by any config value.
The stance decision is a pure function (storageStancePureSqlite) using the
exact same knobs/precedence as the persist constructor's jsonWriterOff
switch, so the two can never disagree. The refusal is recorded on the
diagnostics surface (REFUSING TO START (pure-sqlite stance) prefix on the
sidecar open error, visible in /__bili/status and the diagnostics dump) and
applies again on every boot.
Docs: docs/configuration.md + configuration.zh-CN.md (BILI_STORAGE_QUICK_CHECK
row split by stance, new BILI_STORAGE_ALLOW_LEGACY_DEGRADE row), CHANGELOG
[Unreleased] Fixed.
Regression: tests/issue7156-pure-sqlite-refusal.test.ts (new: stance truth
table, corrupt-index refusal in both pure-sqlite env spellings + file tier,
escape hatch, repeat refusal, byte-identity assertions, dual-write stance
keeps degrading), tests/issue4816-integrity-throw-quarantine.test.ts,
tests/acp-status-storage-degraded.test.ts, tests/web-storage-banner.test.ts,
tests/storage-durability.test.ts and the full storage suite green.
⚠️ MODEL-FACING TEXT CHANGE — the success compress receipt changes what the
model reads: with the new default (compress.postComPressTail off, the
pre-existing behavior is NOT the default), the receipt no longer re-advises
the remaining foldable ranges after every successful fold, and no longer
emits the 'Uncovered history remains' audit note. With it on (explicit opt-in),
the range list is restored and the uncovered note fires at most once per
nudge-injection cycle (fresh injection re-opens it). The verbatim
context-minimum stop signal is unchanged in both modes.
Consumption-chain reasoning (#6855 discipline): the removed text carried the
only forward-pointing refs the model propagated into its NEXT compress call
(startId/endId copied from the 'Current compressible ranges' list). Removing
it removes the propagation anchor entirely — no phantom-value class possible.
Nothing else in the receipt is altered byte-wise; the stop-signal sentence
(#1387) is preserved verbatim, so models that key on it see identical text.
The per-turn growth nudge (KDD #8) is a separate channel and untouched.
Why: per-receipt re-recommendation drove models into endless fold loops
against explicit user stop requests (#7318: 200+ folds in one night on a
0.1.216 build; #6522 '不要连续推荐' and #5872 are the same family — the
receipt footer drives single-message retry folds). Each fold rewrites the
context prefix and re-bills the prompt cache.
config surface (#1437 discipline, owner decision in-thread 2026-11-20):
adds compress.postComPressTail (boolean, default off) to the existing three-
level compress hierarchy (global/provider/model via mergeCompress); boolean
only (non-boolean rejects the whole block like the sibling requireNudge /
requireRecommendation); no new env var (knob goes through the existing
compress file hierarchy, env-discipline #2030). Docs: config-reference seed
entry + regenerated configuration.md en/zh/ja + website.
Plumbing: the flag is stamped per round on session.transient next to the
existing nudge gate (src/unprompted-gate.ts) and read at the tail decision
point in src/stream.ts — off by default when a session has no stamp
(defensive: never recommend on an unknown posture). The #6522 at-most-once
latch rides on an in-memory Session field (uncoveredReceiptNoted), re-opened
only by an actual nudge injection.
Fixes#7318 (design: default off); implements #6526's at-most-once note (that
PR is superseded — its change was unconditional, this one is gated).
Supersedes: https://github.com/ranxianglei/billion-context/pull/6526
The outbound element array can now be REBUILT from the op-log view alone:
view rows carry role + a unified-content-CAS reference (the message's final
core JSON, hashed at record time — no new content bytes anywhere), and
rebuildOutboundFromLog runs the exact legacy chain (systemToUser ->
coreToOpenai -> hardenOpenaiAssistantContent) over the CAS bodies.
- src/storage/egress-serve.ts (new): rebuild + the degrade ladder — missing
CAS body / casRef-less legacy rows / tool rows / bad JSON -> null, the
caller keeps the legacy bytes. v1 scope pinned: text + acp_summary rows.
- src/storage/egress-state.ts: role?/casRef? ride the I and U ops, the B
base and both replay paths (JSON payload fields only — no schema change;
absent on pre-seg-4 rows, which serve-from-log skips).
- src/storage/egress-record.ts: rows recorded with the CAS seam
(store.egressPutContent); system row included with its own casRef.
- src/storage/store.ts: egressPutContent/egressGetContent public seam over
the existing private content CAS (dedup by sha256, refcount).
- src/server/prepare-openai.ts: captures the legacy core elements + the
recorded source; behind egressServeLog (default 0) it rebuilds from the
log and logs IDENTICAL|DIVERGENT vs the legacy bytes. NO swap: the
pipeline always sends the legacy path until the shadow gate proves it.
- rollout: egressServeLog {percent: 0} (env BILI_ROLLOUT_EGRESS_SERVE_LOG,
requires egressOpLog on); config docs regenerated (348 entries, stable).
- tests/egress-serve.test.ts (new, 6 tests): byte identity vs the legacy
chain (plain + summary re-voicing + table-replayed + post-compaction)
and the three degrade directions (#3617).
- Battery: egress-state/record/serve 24/24, perf-suite set 53/53,
typecheck + build clean.
The four upper-layer shapes now land in the op log behind rollout key
egressOpLog (default 0 = zero impact):
1. new message -> exactly one +I (tail append)
2. nudge injection -> structurally absent: the recording seam sits
BEFORE the nudge/scratch append, so the
ephemeral rows never reach the tables
3. compress fold -> one -D over the folded span + one +I for the
summary row; any -D batch triggers compaction
(replay into a base row, state table bounded)
4. content edit -> exactly one +U (msgid/ref stable, content-only)
recordEgressTurn (new src/storage/egress-record.ts) builds deterministic
view rows (system row first; msgid/ref/tokens/type/contentHash), diffs
against the previous turn's view, appends the sparse ops, and compacts on
folds. Wired in prepare-openai between recordNudgeInject and the single
return: feature-gated, try/catch with per-session disable on any error
(shadow lane — the pipeline never throws from it).
SessionStore.egressOpLogStore() -> UnifiedShadow.egressOpLogSync() exposes
the sqlite UnifiedStore (null on legacy mode / network backends -> the
turn is skipped exactly like every other sqlite-lane fast path).
Tests: tests/egress-record.test.ts 6/6 (build determinism, tail append =
one op, fold = -D + +I + compaction, edit = one +U, identical view = zero
ops, rollout-off default both directions). Battery 71/71.
Full battery + CI green.
CI on fe54b7b2: unused-exports flagged DeltaVerdict (type used only
inside fastpath.ts — drop the export); docs-sync drifted because the
pluginDeltaResend row was hand-written into the generated
docs/configuration*.md instead of the single source
website/config-reference/rollout.yaml — seed entry added (en/zh/ja)
and all three docs regenerated by tools/gen-config-docs.mjs.
Steady plugin-lane turns can now send body.messages = ONLY the new
elements (L = T - stampT) plus x-bili-pf-delta: 1; the anchor (previous
turn's last element) rides x-bili-pf-tail-ids[0] only. evaluateDeltaResend
runs before the full lane and rebuilds the exact same FastpathHit
(stashed prefix cores + rekeyWindowCores(parsed tail)), so every
downstream consumer (stage-0 pin, kernel, ingest, snapshot, ledger window)
is the untouched full-lane path.
Re-anchor ladder: any unsatisfiable claim (bad header value, rollout off,
no/mismatched seed, count/body/tail-ids width mismatch, anchor-chain break
after a known previous list, broken scan, window shape) returns 400
pf_delta_reanchor + x-bili-msgid-mode: full and NO x-bili-pf-seq stamp —
the client resends that turn in full form and converges within one
round-trip. Editing/deleting the previous turn's LAST message breaks the
chain by design (full form next); earlier-history rewrites degrade via the
existing KDD#21 truncated-tail path, never a 400. No anchor byte
re-parse — identity is verified on the ledger/pin (2x2) side.
Rollout: rollout.features.pluginDeltaResend (default 0, OFF). Delta
bodies are unprocessable by servers that do not ship this arm, so the key
stays at 0 until client send-sides exist; env BILI_ROLLOUT_PLUGIN_DELTA_RESEND.
x-bili-pf-delta joins UPSTREAM_HOP_HEADERS.
Tests: tests/fastpath.test.ts delta-oracle test (reconstructed view byte-
equivalent to the legacy full-parse oracle across consecutive slices, then
a full-form turn after a delta hit) + the re-anchor matrix (both
directions, #3617). Full 52-test battery green; typecheck + build clean.
Docs: technical-notes en+zh (delta section), configuration en+zh
(rollout row + env row).