Skip to content

runner: accept a pre-integrity ledger of the current layout on open - #631

Merged
luisleo526 merged 2 commits into
mainfrom
org/fix-ledger-open-pre-integrity
Oct 28, 2026
Merged

luisleo526 merged 2 commits into
mainfrom
org/fix-ledger-open-pre-integrity

Conversation

@luisleo526

Copy link
Copy Markdown
Collaborator

The live runner refused a ledger written before integrity digests were added ("native ledger is not an empty or supported ledger database"). The runner README says such a ledger resumes with one verified replay, which repopulates the digests. The open check compared the table count against a hand-written list (3, 6, 7, 8, 9, 12). After the delivery-summary tables landed, the current layout minus the integrity table has 11 tables, which the list did not contain. native_live_report_e2e has failed on main's post-merge native-live jobs since then.

This derives the accepted layouts from one list of schema stages: every historical layout, plus each one without the integrity table. A ledger with any other table count is still refused with the same message.

  • runner/store.cpp: one derived list replaces the hand-written counts.
  • tests/test_native_live_store.cpp: rows for the 11-table pre-integrity ledger resuming with one replay, and for unknown counts (4, 5, 10, 13) still refused.
  • CHANGELOG.md: one entry.

🤖 Generated with Claude Code

luisleo526 and others added 2 commits October 29, 2026 04:33
…ng the accepted table layouts from one list

The ledger open accepted its table counts from a hand-written list (3, 6, 7, 8, 9, 12). The
delivery-summary tables raised the current layout to 12 tables, so the current layout
without report_integrity (11) was refused, although a ledger written before integrity
digests must resume with one verified replay that populates them (the documented
contract). The ledger's tables are now one list with the stage that added each, and the
supported layouts are derived from it: every layout a runner has written, and each of
them without report_integrity. Counts 3, 6, 7, 8, 9 and 12 are accepted as before and 11
is new; every other count (1, 2, 4, 5, 10, 13 and above) is still refused with the same
message. A new test builds each historical layout and the 11-table ledger, checks that
each unsupported count is refused and that the 11-table ledger resumes with one replay
and then exports a report byte-identical to the original.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@luisleo526
luisleo526 marked this pull request as ready for review October 28, 2026 23:22
@luisleo526
luisleo526 merged commit a34a0d0 into main Oct 28, 2026
18 of 20 checks passed

@graphify-labs graphify-labs Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Graphify reviewed this change.

No issues found by static checks — no coupling regressions or blocking issues in the code graph. That is not the same as safe to merge: see what was not checked.

Not checked: tests were not run; no formal proof of the changed code.


Graphify review — findings

Replaces the hard-coded list of accepted table counts in the ledger open with a single ledger_tables list (tagged by layout stage) that supported_layout checks against. It admits every layout a runner has written, plus each one missing report_integrity, and still refuses any other count. A ledger without integrity digests, including one that already has the delivery summaries (11 tables), now opens and gets the missing tables created, but export refuses until one verified run replay repopulates the digests. Adds tests that build each historical layout with that runner's own statements, drop report_integrity from a current ledger and replay it, and confirm unrelated table counts are still refused. The CHANGELOG gets a matching migration note.

No blocking issues surfaced. 1 lower-confidence candidate did not survive cross-model review.

Analysis details — impact, health, verification

Impact & health

Graphify review

Impact — 262 functions depend on the 190 functions this change touches.

Health — this change adds coupling hotspots:

  • worse: commit_input — 18 callers, 11 callees
  • worse: verify_report — 6 callers, 11 callees
  • new: pre_integrity_ledger() — 1 callers, 8 callees

Verification — 262 functions in the blast radius were not formally verified this run (proofs are advisory here).

Gate & verification

graphify gate

PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.

Advisory (not blocking):

  • verification_scope: 260 function(s) in the blast radius were not formally verified this run

· 1 grounded finding(s) anchored inline below; 2 more finding(s) on lines outside this diff (see the check run).

// test does: the current layout without report_integrity. It opens, export
// refuses until one verified replay populates the digests, and the replay
// restores the digests and the export the ledger had.
void pre_integrity_ledger() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Health regression — pre_integrity_ledger()

fans out to 8 callees (efferent coupling).

Grounded coupling-delta finding (deterministic), not an LLM guess.

luisleo526 added a commit that referenced this pull request Oct 29, 2026
…nner report checkpoints branch

The ledger open of main derives the table layouts it accepts from one list of the ledger's
tables; this branch added a thirteenth table, report_checkpoints, and a hand-written list of
counts at the same line. The merge keeps the derived rule only and adds report_checkpoints as the
last stage of the list: accepted counts are 3, 6, 7, 8, 9 (older runners), 11 and 12 (the delivery
summary layouts, with and without report_integrity or report_checkpoints) and 13 (this branch's
layout); every other count, including 10 and 14, is refused. The store rows of both sides are
reconciled to that set: the current layout is 13 tables, a pre-integrity layout with or without
checkpoints resumes with one verified replay, and a written layout plus unrelated tables is
refused. The changelog gets one bullet for the derived rule. No documentation sentence was replaced
or deleted.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
luisleo526 added a commit that referenced this pull request Oct 29, 2026
…nto the live runner report accumulator branch

The checkpoints branch merged main (the pre-integrity ledger open fix, #631) and derives the ledger layouts it accepts, with report_checkpoints as the last stage, from one list: 3, 6, 7, 8, 9, 11, 12 and 13 tables are opened, every other count is refused. This merge brings that rule and its store rows, the changelog bullet and the main workflow and preflight changes into the accumulator branch; the merge needed no manual resolution. No documentation sentence was replaced or deleted.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
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