Skip to content

Refresh merged-bundle count pins and make bundle drift loud in CI#93

Merged
MaxGhenis merged 1 commit into
codex/thesis-ledger-factsfrom
codex/arch-bundle-drift-pin
Jul 11, 2026
Merged

Refresh merged-bundle count pins and make bundle drift loud in CI#93
MaxGhenis merged 1 commit into
codex/thesis-ledger-factsfrom
codex/arch-bundle-drift-pin

Conversation

@MaxGhenis

Copy link
Copy Markdown
Contributor

What

tests/test_arch_bundle.py::test_build_bundle_writes_merged_consumer_contract fails on this branch with stale hardcoded counts (7,149 facts / 27 source packages), and CI never notices because the file is not in the "Test Arch surface" pytest whitelist. This PR refreshes the pins to the verified current build (10,268 facts / 39 built packages / 8 year-skipped), runs the file in CI as a standalone job, and fixes a required-check deadlock that any non-ledger PR into this branch — including this one — would otherwise hit.

Diagnosis: legitimate drift, not a regression

  • The counts were last set 2026-05-28 (5ec0956). Fifteen source-package PRs (Add BEA NIPA source packages #34Add SSA SSI Table 7.B1 source package #48: BEA NIPA/regional, CBO projections, ACS B01001, SOI state 2022 + congressional district, CMS ACA + Medicaid monthly, Census projections, LIHEAP FY2023, SSA SSI 7.B1, …) landed on main immediately afterwards, before this branch forked at 5e851c5. None updated the test — nothing ran it.
  • The bundle built at the fork point (5e851c5) and at the branch tip (08d1001) produce byte-identical consumer_facts.jsonl (sha256 78ca9a51…). No branch-side commit (arch/core.py vocabulary widening, ledger appends, witness infrastructure) affects bundle output at all.
  • Every count delta decomposes exactly into the fifteen pre-fork additions: bea +443, cbo +6, census_acs +468, census_population_projections +86, cms_medicaid +255, hhs_acf_liheap +1, irs_soi +1,444, ssa +416 = +3,119 = 10,268 − 7,149. Every pre-existing per-table count is unchanged, and entity/period deltas reconcile the same way (e.g. tax_unit +1,450 = SOI congressional district 1,440 + state totals 4 + CBO 6).
  • The build stays fully valid: 0 errors, duplicates unchanged (0 aggregate / 3 semantic), same single warning.

The 8 skipped packages are the year-specific ACS-2024 and CMS-ACA vintages that cannot produce a year-2023 bundle; the test now pins them by name, mirroring the style main adopted for tests/test_ledger_bundle.py when it refreshed its own pins in #68.

CI placement: standalone job, deliberately outside the required whitelist

The merged build takes ~6 minutes (5:46 for the file locally). "Arch checks" is a required status check gating the Thesis resolver's daily append PRs and currently completes in ~3 minutes — putting the bundle build inside it would roughly triple required-path latency for a drift signal that appends cannot trigger (bundle inputs are frozen on this branch). Instead:

  • New Arch bundle drift job in ci.yml runs uv run pytest tests/test_arch_bundle.py -q on every push and PR — loud and visible, but not blocking the append path.
  • The test's docstring records that the whitelist omission is deliberate and how to regenerate the pins.
  • The file joins the ruff lint whitelist.

Because bundle inputs are frozen on this branch, the refreshed test now acts as a tripwire: any future failure means something unexpectedly changed bundle behavior, not routine drift. (Main needs no change — its CI runs the whole suite, whitelist-free, since #68.)

Required-check deadlock fix

thesis-facts-append.yml carried a paths: filter, but branch protection lists "Append gate" as required: a PR into this branch that touches none of the gated paths never receives the check and deadlocks on "Expected". The filter is removed, so the gate now runs on every PR/push to the branch. For non-ledger PRs the append-only diff is trivially clean and the gate costs ~1 minute; this strictly widens enforcement, never weakens it.

Verification

  • uv run pytest tests/test_arch_bundle.py -q → 5 passed locally on this branch.
  • Dict literals AST-verified equal to the built bundle artifacts.
  • python3 scripts/check_thesis_facts_append.py --base-ref origin/codex/thesis-ledger-facts → OK (143 rows, immutable prefix 128, +0 appended, release 0).
  • Both workflows YAML-parse; ruff check tests/test_arch_bundle.py clean.

🤖 Generated with Claude Code

tests/test_arch_bundle.py::test_build_bundle_writes_merged_consumer_contract
pinned the merged default bundle at 7,149 facts / 27 source packages -- the
state of 2026-05-28 (5ec0956). Main then landed fifteen source-package PRs
(#34-#48) before this branch forked at 5e851c5, and the test is not in the
CI pytest whitelist, so the pins went stale silently: the bundle has built
10,268 facts / 39 packages (8 year-skipped) since the fork point.

Diagnosis (2026-07-11): legitimate additive drift, not a regression. The
bundle built at the fork point 5e851c5 and at branch tip 08d1001 produce
byte-identical consumer_facts.jsonl (sha256 78ca9a51...), so no branch-side
commit changed bundle behavior; every count delta decomposes exactly into
the fifteen pre-fork package additions (bea +443, cbo +6, census_acs +468,
census_population_projections +86, cms_medicaid +255, hhs_acf_liheap +1,
irs_soi +1444, ssa +416 = +3,119), and every pre-existing per-table count
is unchanged.

- Refresh all hardcoded expectations to the current build; pin the eight
  year-2023-skipped packages by name (mirrors main's test_ledger_bundle
  style) and spot-check three post-fork package suites.
- Run the file in CI as a standalone "Arch bundle drift" job. It is
  deliberately NOT added to the required "Arch checks" pytest whitelist:
  the merged build takes ~6 minutes and "Arch checks" gates the resolver's
  daily append PRs, which cannot touch bundle inputs. The test docstring
  records the same rationale. Lint the file via the ruff whitelist.
- Drop the paths filter from the append-gate workflow: "Append gate" is a
  required status check, and with the filter a PR touching none of the
  gated paths (like this one) never receives the check and deadlocks on
  "Expected". The gate is cheap when the ledger diff is empty.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@MaxGhenis MaxGhenis merged commit fcff801 into codex/thesis-ledger-facts Jul 11, 2026
5 checks passed
@MaxGhenis MaxGhenis deleted the codex/arch-bundle-drift-pin branch July 11, 2026 17:06
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