Skip to content

test: pin the re-fold generation cache contract across all four wires (#2741, #2733) - #2762

Merged
ranxianglei merged 1 commit into
masterfrom
2026-10-11_cache-proof-refold
Oct 11, 2026
Merged

ranxianglei merged 1 commit into
masterfrom
2026-10-11_cache-proof-refold

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Closes the corpus gap surfaced while investigating #2741: the cache-proof suite only ever exercised first-generation forward folds (makeProofTrigger always cites refs[2]..refs[len-6] of the current body). Production sessions chain re-folds rooted at old anchors constantly (session 01a126aa in the #2733 log re-folds m00007–m00023 after pushing into the m02400s) — exactly the geometry that produced the per-fold prefix collapse fixed by #2755 (kernel 0.0.117), which had no byte-level proof at all.

What the new phase proves

driveRefoldChain (all four wires: chat / anthropic / responses / google):

  1. Seed 12 fat turns → generation-1 forward fold lands.
  2. Rooted chain re-fold: once the threshold re-crosses, the model cites the session's first ever ref (m00001, the pinned first user message) — the 192版本缓存命中率低codex #2733 production geometry. The trigger anchors firstRef on the pin message itself (NOT parseRefIds(body)[0], which is the tool-doc example tag m00175 present in every body).
  3. Steady follow-ups after the re-fold.

Assertions at the re-fold boundary:

Teeth (A/B, kernel rebuilt in place)

kernel chat anthropic responses google
pre-#2755 (db96692c^..d4133a85 reverted) ✖ slot ✖ byte-order ✖ slot ✖ byte-order
master (0.0.117) ✔ ✔ ✔ ✔

All four pre-fix failures carry the exact production signature (summary precedes the pin).

Harness notes

  • isRound2Body finds the round-2 via the compress call; refoldIdx additionally requires the rooted summary text.
  • A failed compress would silently render an unchanged view — asserted against (Compression FAILED check) after the first A/B round caught exactly that (bad firstRef cited the tool-doc example ref).
  • Responses embeds the developer message as input[0], so its pin index is 1, like chat; anthropropic/google hoist the system out of the array.

Config surface

None — test-only change.

Kernel boundary

No kernel/ change. The fix under proof is the already-merged #2755 (kernel 0.0.117); this PR adds the missing bili-side byte-level regression proof.

Refs #2741, #2733, #2755.

@github-actions

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-11_cache-proof-refold (d90cd17)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.3028-pr.2762.e4f98f0

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-pr2762.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei
ranxianglei merged commit 5c86fa7 into master Oct 11, 2026
14 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.274-master.5c86fa7 (rolling master tag).

npm install -g billion-context@0.0.274-master.5c86fa7  # 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant