Skip to content

Consumer-path audit proofs: ledger drop-fraction + honest decompress failure for reaped blocks - #2738

Merged
ranxianglei merged 2 commits into
masterfrom
2026-10-11_consumer-path-proofs
Oct 11, 2026
Merged

ranxianglei merged 2 commits into
masterfrom
2026-10-11_consumer-path-proofs

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Follow-up to #2732 (merged): a systematic audit of every consumer of the signals we hardened this week, checking which consumption paths still lack proofs. Two gaps found, both closed here.

1. Ledger accrual under a sanctioned reasoning drop (proof, #2202/#2732)

The #2202 coverage ledger (src/cache-ledger.ts) has three proven classes: full coverage (book 1.0/request), verified total loss (freeze), never-present (status quo). The model-switch drop shape — thinking cores permanently off the wire, text cores verbatim forever — sits BETWEEN them and was unproven.

New test in tests/issue2202-coverage-accrual.test.ts: drives the real seam (recordCacheFoldsFromBlocks → reconcileFoldCoverage → recordCacheSample) through a reasoning-ContentType fold; asserts:

Semantics confirmed correct as-is (no src change): counting dropped reasoning as absent is honest accounting.

2. Decompress on a reaped block: honest failure (fix, #2695)

Found by the audit: reapDestroyedSubstrate (#2707) removes zombie blocks from state.blocks but writes a preCompactionArchive entry. resolveDecompress looks blocks up in kernel state first — a reaped block misses, falls through the derived path, and returns the generic [Block bN not found]. The archive gate that names the real reason was unreachable for reaped blocks. The model gets here legitimately (citing a ref from a summary it saw), and "not found" tells it the ref never existed.

Fix in src/decompress-shared.ts (host-only, no kernel change): when the block is absent from state, check the same-session preCompactionArchive first and fail with the recorded reason ("…archived block (covered substrate destroyed by unannounced client history rewrite (#2695))…cannot be restored"); same check added per-ancestor in the derived loop. Unarchived unknown ids keep the exact "[Block bN not found]" behavior (#1333 assertions unchanged).

Proof: new test in tests/compaction-archive.test.ts drives the REAL reap (three total-loss reconcile passes) then decompress — asserts the honest reason, no "not found", blockContents retained (#395 semantics).

A/B teeth: on master (worktree @251cb961) the test fails with [Block bReap not found]; on this branch it passes.

Audit table (signal → consumers → proof status)

signal consumers status
covered-id missing #2193 escalation / #2695 reap / #2202 ledger / web badge all ✅ (this PR closes the last two)
claims rewriteBlocks / lastPassIds / positional backbone ✅ (#2480, #2636 suites)
contentType c escalation classify / reap majority / ledger fraction ✅ (#2732 §4-5 + here)
archive entry #395 decompress gate / #2695 reap decompress gate ✅ (here)
pluginAgent latch injection / carrier / sticky / override ✅ (#2732 P3)
session identity fork mint/absorb/adoption ×3 wires ✅ (#2729, fork-adoption-wires)
model change cache-ledger cause partition ✅ (#2350)

Remaining open gaps from the census (bigger items, not in this PR): multi-instance concurrent state writes (#394 class), tool-args adversarial corpus (SSE boundaries × partial_json × retry × rollback).

Config surface

No config changes.

Kernel boundary

No changes under kernel/ — both files are host-side.

@github-actions

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-11_consumer-path-proofs (8279be3)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.2983-pr.2738.aec8f63

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

Install instructions are refreshed on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 Reviewing this PR now (branch 2026-10-11_consumer-path-proofs @8279be3e, base master @251cb9614). Scope confirmed small: src/decompress-shared.ts + two test files, 111 insertions. Full structured review coming shortly — verifying the A/B teeth claim locally before concluding.

@ranxianglei
ranxianglei merged commit c69eff7 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.262-master.c69eff7 (rolling master tag).

npm install -g billion-context@0.0.262-master.c69eff7  # 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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant