Skip to content

test: prove self-update keeps live compression state across the OLD->NEW hop (proof-coverage audit gap 1) - #2724

Merged
ranxianglei merged 1 commit into
masterfrom
2026-10-11_proof-update-state-survival
Oct 11, 2026
Merged

ranxianglei merged 1 commit into
masterfrom
2026-10-11_proof-update-state-survival

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Closes the first 🔴 gap from the cache/identity proof-coverage audit: the upgrade chain (self-update -> restart) had ZERO coverage for "a live session's fold state must survive the OLD->NEW hop". e2e-registry and e2e-release-canary never touch session state — the canary's fold smoke is actually a refusal receipt (args:{} -> parse:missing-content, ok:true with no block), so nothing anywhere proved persisted folds survive an update.

What the new test proves

tests/e2e/e2e-update-state.test.ts (gated by ACP_TEST_REGISTRY=1, ~19s, hermetic local verdaccio + fixture tarballs like e2e-registry):

  1. OLD build live: install 0.1.191 from the test registry, drive a real plugin-lane conversation (stateful agent, full-history resend) with 10 turns + two agent-driven compress calls with explicit ref ranges (m00003..m00004, m00005..m00006) — both folds land (blocks b1/b2 ACTIVE).
  2. Snapshot: same session file path, blockIds [b1,b2], maxRef m00018, tokensCompressed>0, messageCount 18, and metadata.biliVersion === 0.1.191 — proving the file the NEW build will adopt was written by the OLD build.
  3. Update hop: publish 0.1.192, let the live proxy self-update in place (BILI_UPDATE_CHECK_INTERVAL_MS=1000), stop, verify --version flipped.
  4. Restart + post-turn: the post-upgrade turn's OUTBOUND wire body (recorded by a relay) still folds the covered material: raw fold material absent, both [Compressed conversation section] carriers present, POST_TURN visible. Status endpoint resolves the same sessionId; same session file; blockIds prefix-equal (b1,b2, no rewrite); maxRef/tokensCompressed/messageCount monotonically non-decreasing; metadata.biliVersion flipped to NEW (adoption, not rewrite).

Teeth (A/B verified)

Sabotage run with BILI_PERSIST=0 on the restarted proxy (state never rehydrated) fails at exactly the pre-upgrade folds must still be ACTIVE: folded raw material must not re-enter the wire after the update hop. Reverted; green run passes.

Harness notes (pitfalls encoded in comments)

  • Plugin lane = agent owns history: assistant replies only enter the proxy view once RESENT (turn = send + resync), otherwise fold ranges refuse with gate:none-resolved.
  • args:{} compress is a refusal receipt — explicit {startId,endId,topic,summary} ranges are the real contract.
  • preserveRecentMessages=5 AND preserveRecentTokens=5000 (tail expansion) both gate fold ranges — the corpus needs ~6K tokens of tail filler after the fold chapters.
  • kernel prune.ts first-user-message pin: the session opener survives folding BY DESIGN — keep it tiny so the pinned slot is cheap.

Scope

Test-only addition; no src changes, no config surface, no kernel changes. Registry-gated so CI cost is opt-in (same family as e2e-registry/e2e-release-canary).

Refs: proof-coverage audit (chat thread 2026-10-11); related lanes #2695/#2658 (host-compaction coverage in #2707/#2720).

@github-actions

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-11_proof-update-state-survival (d46964b)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.2956-pr.2724.e305fb9

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Option B — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr2724.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei
ranxianglei merged commit 65ea85b into master Oct 11, 2026
27 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.253-master.65ea85b (rolling master tag).

npm install -g billion-context@0.0.253-master.65ea85b  # this exact build
npm install -g billion-context@master  # always the newest merged build

npm view billion-context@master prints the current version at any time.

@ranxianglei
ranxianglei deleted the 2026-10-11_proof-update-state-survival branch October 15, 2026 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant