Fix preflight --ledger-facts: pass fact rows, not the artifact wrapper#438
Merged
Conversation
…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
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:_load_ledger_target_specshanded theLedgerConsumerArtifactwrapper itself tocompile_us_fiscal_target_registry; the builder's own call site passesledger_artifact.facts. The flag's happy path had no test, so #436 shipped with it broken.What
artifact.facts(the fact rows) to the compiler, matching the builder.test__load_ledger_target_specs__hands_fact_rows_to_the_compiler: a real bareconsumer_facts.jsonlgoes 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=Truechange 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-factson the real feed progresses past the wrapper crash but fails the period contract at registry compile.