Skip to content

Skip local-input tests exactly when the input is not the pinned one - #475

Open
MaxGhenis wants to merge 4 commits into
masterfrom
dynamics-local-skip-exact-20260926
Open

MaxGhenis wants to merge 4 commits into
masterfrom
dynamics-local-skip-exact-20260926

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Ten tests failed locally on the maintainer's Mac but skip or pass in CI. CI Tests run 36239836717 on 672e677 was green. Each test reads a local input that has drifted from its pin, while its skip condition checked only whether the input was present. This PR makes each skip exact: skip when the local input is absent or is not the pinned one. It changes tests only, and no committed runs/*.json, gates.yaml, engine/* or src/ file changes.

Per test

Test Local cause Change
cola_track_a/test_statutory_capture_oracle.py::test_capture_script_reproduces_the_committed_capture The capture records the checkout's revision (a03e82e503), but the skip checked only the file digests. The capture script still runs, with its own checks. Then the test skips unless git log -1 --format=%h in the checkout gives exactly the captured revision, and only then compares bytes.
…::test_oracle_parameters_pass_every_statutory_check Same statutory_value_checks still runs on the pinned files at any commit. Only the final revision-prefix assert skips unless git's revision starts with the captured one.
min_benefit_track_m/test_quarter_of_coverage_recapture.py::test_the_recapture_equals_the_committed_file The skip checked only that the checkout directory exists. The capture records the QC file's sha256, the wage index's sha256 and the revision. Skip first if either file is not the captured one. build() still runs its statute comparison. Then skip unless git reports the captured revision, and only then compare bytes.
data/test_psid_codebook_inventory_reproduction.py::test_all_codebook_eras_and_adjudication_reproduce_byte_for_byte Homebrew moved poppler to 26.09.0; the inventory pins 26.04.0 (DictionaryDriftError). Skip when inventory._pdftotext_version() raises DictionaryDriftError.
test_rebuild_amendment11_missing_reason_authority.py × 3 (fresh_47_source_build, r05_direct_cli, successful_write_normalizes_output_mode) Same poppler drift. The builder and replay stop with "Poppler version drift before semantic parsing"; the replay reports this as "production source authentication failed". Skip unless extraction.pdftotext_version() equals the literal 26.04.0 that both scripts compare against.
test_axiom_benefit_bridge.py::test_actual_engine_reproduces_published_case_{a,b}… The 49f2225c engine was lost in a cleanup and rebuilt bit-identical (e4116175…). Its .provenance.json receipt now carries the rebuild's built_at (5ba0dde9…, pinned 469d13fd…). The Axiom launch plans were re-pinned to the new receipt and the file is uchg-locked, so the old receipt cannot be restored. Skip when any bound file is absent, a symlink, or not its pin. This is the same per-file judgement AxiomEngineBinding.verify() makes; the transport digest was an assert and is now a skip.
test_track_c_aime_agreement.py::test_actual_engine_agrees_with_the_oracle_on_invented_careers Same receipt Same helper

What stays a failure. Once every input is the pinned one, every existing assertion runs unchanged. Checks that do not depend on the revision run before the revision skip. That includes comparing the recaptured documents with their revision fields masked. The revision comes from git directly, not from the loaders under test, so a change to how they record it still fails. The manifest-binds-engine check in verify() is deliberately not a skip reason: with every file pinned it can fail only on the repository's own pins, so it still fails the test.

Reproducing tests 1, 2 and 4. I pointed POPULACE_DYNAMICS_PE_US_DIR at a policyengine-us checkout at 2fac47ced9 whose pinned SSA files match:

  • Before this PR, all three fail on the revision field. That is the same trio that failed in the earlier sequential runs, while test_every_amount_is_the_statutes passed.
  • After it, all three skip, with a reason naming both revisions.

At the pinned a03e82e503 checkout, all three pass. tests/cola_track_a run sequentially passes (154). Which checkout, or which git failure, the earlier runs actually saw is undetermined; the tests now skip in either case.

Invariants

  • Engine skip is exact (new differential test test_unpinned_inputs_are_exactly_the_files_verify_rejects). For each bound file, and for each of changed, absent and symlink, unpinned_engine_inputs reports exactly that role, and verify() raises BindingMismatch naming it. With no drift, the list is empty and verify() passes.
  • The manifest check is not skipped (test_a_manifest_that_does_not_bind_the_engine_is_not_skipped). A pinned manifest that does not bind the engine gives an empty skip list, and verify() still raises "does not bind engine".
  • tests/tier_counts.json: unit rises from 3650 to 3652, and the tier policy test passes on the full collection.

Local results (this Mac, 49ffdea + this commit)

  • Touched modules: 109 passed.
  • 7 skipped, each for the expected reason: the engine receipt (3) and pdftotext 26.09.0 (4). Tests 1, 2 and 4 pass on the pinned checkout.
  • Ruff and black are clean.

Review

  • Round 1 (Opus 5.5, Subfleet 20260927-043446-pr475-review): CHANGES_REQUESTED.
    • The medium finding: the oracle test skipped before its revision-independent checks ran. Fixed in 62684be, together with the lows: the independent git probe, the scripts' literal pin, and the regex escape.
    • Left as is: the nit about importing the helper from another test module. There is precedent for it: from tests.test_closed_cohort_history import step.
  • Round 2 (Opus 5.5, 20260927-044008-pr475-review-r2, with execution): APPROVE on 62684be.
    • The reviewer ran the touched modules (109 passed, 7 skipped), the moved checkout and the tier test.
    • It also ran a mutation battery against the code under test.
    • Its non-blocking findings are applied in 8d69f02:
      • the captures are compared with the revision fields masked, before the revision skip, so a wage-base change for 2011–2030 is now caught on a moved checkout;
      • the git probe skips when git is absent;
      • the QC capture must record a single revision.
  • Round 3 (delta review of 8d69f02): pending.

Follow-up (not in this PR)

Chip task_789c9ae5 covers this. Re-pinning REVIEWED_PINS to the rebuilt receipt (5ba0dde9…) and to the reviewed rebuild manifest (engine-rebuild-20260925/lazy-engine-binding-rebuild-20260925.json, b8c029d1…) would restore the actual-engine tests on this Mac. That is a change to reviewed pins, so it is left out.

axiom: n/a: test-only skip conditions

🤖 Generated with Claude Code

Ten tests failed on the maintainer's Mac but skip or pass in CI. Each
reads a local input that has drifted from its pin, and its skip
condition checked only whether the input was present:

- pdftotext: Homebrew moved poppler to 26.09.0; the codebook inventory
  and the Amendment 11 builder and replay pin 26.04.0 and refuse any
  other version. Four tests (the codebook reproduction and three
  Amendment 11 source rebuilds) now skip on that drift.
- Axiom engine: the 49f2225c engine was rebuilt bit-identical, but its
  provenance receipt now carries the rebuild's built_at, so it is not
  the pinned receipt. The Case A, Case B and Track C actual-engine tests
  now skip when any bound file is absent or not its pin, using the same
  per-file judgement as AxiomEngineBinding.verify(). The manifest check
  is not a skip: with every file pinned it can fail only on the
  repository's own pins.
- policyengine-us revision: the statutory capture and the
  quarter-of-coverage capture record the loader's git revision, which
  the skips never checked. A checkout at another revision (or one whose
  revision git cannot report) with the pinned files failed three tests
  on the revision field. They now skip unless the checkout is the
  captured one.

Two new tests are differential checks on the engine skip: every absent,
changed or symlinked bound file is exactly what verify() rejects, and a
manifest that does not bind the engine still fails. The unit tier count
rises by two.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
social-security-model Ready Ready Preview Sep 27, 2026 10:33am UTC

Request Review

Review of #475 found that the oracle test skipped on the revision before
its statutory checks ran. Those checks read only the pinned files, so a
defect in statutory.py showed up as a skip on a checkout at another
commit.

- The statutory, oracle and quarter-of-coverage tests now run their
  checks (the capture script's checks, statutory_value_checks, and
  build()'s statute comparison) first. They skip on the revision only
  where the comparison actually carries it: the recaptured bytes, or
  the oracle's revision prefix.
- The revision now comes from git directly, not from the loaders under
  test. A change to how the loaders record it still fails the
  recapture.
- The Amendment 11 skip compares against the literal 26.04.0 that both
  scripts check, not the extraction module's constant.
- The differential test escapes the role in its match pattern.
- A docstring line was reflowed to 79 characters.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Round 2 of the #475 review (APPROVE, finding 5) found that on a checkout
at another commit the revision skip still hid every recaptured field,
though pinned files fix all of them but the recorded revision. A loader
change to the 2011-2030 wage base went uncaught there.

- The statutory capture and the quarter-of-coverage recapture now
  compare their documents with the revision fields removed before the
  revision skip. Byte equality still follows at the captured commit.
- The git probe skips rather than errors where git is absent, as the
  loaders fall back (finding 6).
- The QC helper asserts that the committed capture records one
  revision, so a regenerated file cannot turn the skip permanent
  (finding 7).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-exact-20260926

# Conflicts:
#	tests/tier_counts.json

This branch was successfully deployed

1 active deployment
Preview — 6ba169cd Deployed Sep 27, 2026 by vercel[bot]
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