Skip to content

Fix preflight --ledger-facts: pass fact rows, not the artifact wrapper#438

Merged
MaxGhenis merged 1 commit into
mainfrom
preflight-ledger-artifact-facts
Jul 16, 2026
Merged

Fix preflight --ledger-facts: pass fact rows, not the artifact wrapper#438
MaxGhenis merged 1 commit into
mainfrom
preflight-ledger-artifact-facts

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Why

Running the #436 preflight tool with --ledger-facts (the Build M launch checklist does, to preview zero-support on the rebuilt base) crashes immediately:

TypeError: 'LedgerConsumerArtifact' object is not iterable

_load_ledger_target_specs handed the LedgerConsumerArtifact wrapper itself to compile_us_fiscal_target_registry; the builder's own call site passes ledger_artifact.facts. The flag's happy path had no test, so #436 shipped with it broken.

What

  • Pass artifact.facts (the fact rows) to the compiler, matching the builder.
  • Regression test test__load_ledger_target_specs__hands_fact_rows_to_the_compiler: a real bare consumer_facts.jsonl goes through the real artifact loader (sha pin exercised); the compiler seam is captured and must receive the fact ROWS. Fails with the pre-fix wrapper-object behavior; the full-registry compile path is not stubbed anywhere else — only the compiler boundary is captured, because a toy feed cannot satisfy the JCT reference facts a real compile validates.

Verified against the real Build M inputs: with this fix the preflight runs end to end on the rebuilt base + v8 facts feed.

🤖 Generated with Claude Code

Correction

An earlier revision of this body described an age_targets=True change as shipping in this PR; it did not (the commit was never pushed here). That change ships in the follow-up PR #439. With only this PR merged, --ledger-facts on the real feed progresses past the wrapper crash but fails the period contract at registry compile.

…mpiler

_load_ledger_target_specs handed the LedgerConsumerArtifact wrapper itself
to compile_us_fiscal_target_registry, so every --ledger-facts preflight
crashed with "'LedgerConsumerArtifact' object is not iterable" before the
zero-support preview could run (the flag's happy path had no test). The
builder's own call site passes ledger_artifact.facts; the preflight now
does the same.

Regression test pins the seam: the compiler receives the artifact's fact
ROWS (and the facts-sha pin reaches the loader), failing with the
pre-fix wrapper-object behavior.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@MaxGhenis
MaxGhenis merged commit 8273ac2 into main Jul 16, 2026
4 checks passed
@MaxGhenis
MaxGhenis deleted the preflight-ledger-artifact-facts branch July 16, 2026 10:47
MaxGhenis added a commit that referenced this pull request Jul 16, 2026
With #438's wrapper fix in place, the real feed still fails the period
contract at preview time (1,488 cross-period dollar targets, e.g. 2023
BEA/Fed/SOI facts in a 2024 build): the release tool compiles with
--age-targets on by default, and the preview must compile the registry
the release run will actually calibrate. _load_ledger_target_specs now
passes age_targets=True; the seam regression test asserts the compiler
receives it.

Verified end to end against the real Build M inputs (rebuilt base +
v8 facts feed): the preflight completes and reports selection
carryover PASS 57,240/57,240, keogh 13/13 supported, and the
export-mass parity advisories.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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