Skip to content

Track A v2: implement mechanisms D and S on invented data (a2-ratified-1, §17 items 2–4) - #483

Merged
MaxGhenis merged 12 commits into
masterfrom
dynamics-a2-impl-20260928
Sep 29, 2026
Merged

MaxGhenis merged 12 commits into
masterfrom
dynamics-a2-impl-20260928

Conversation

@MaxGhenis

Copy link
Copy Markdown
Contributor

Implements Track A v2, a2-ratified-1 (docs/design/urban2010_track_a_v2.md, ratified by Max's ruling d513 and #480). It covers §17 items 2–4: implementation in new modules, the §12 invented-data tests, and the invented dry run of all 68 tabulations with forced-refusal recording. Nothing here touches real data. No PSID is read, and no projection, benefit or tabulation runs on real inputs. §11 freezes everything before real-data work, and that comes later through its own registration.

What's in it

  • src/populace_dynamics/track_a_v2/, a new package:
    • mechanism D, the statutory DI computation years (§4, DI only per d513 item 8);
    • mechanism S, DI/spouse dual entitlement with the fixed H filing function (§5, d513 items 5 and 9);
    • estimands and definedness (§7);
    • the frozen 68-row matrix with fixed headlines D×R0 and D×F0 (§8);
    • membership guards (§9);
    • refusal order and the attempt record (§10);
    • a provenance manifest (§6).
  • Scripts:
    • track_a_v2_dry_run.py, which is invented-only and heads every output INVENTED DATA - NOT A COMPARISON;
    • track_a_v2_registered.py;
    • track_a_v2_structural_count.py;
    • track_a_v2_hash_manifest.py.
  • Protection registries: new modules are exact post-review exclusions in scripts/first_estimates_birth_evidence.py and its tests. tests/ss/test_statutory_aime.py registers track_a_v2/benefits.py as a legacy-convention user (§4.3: D is DI-only, so retirement stays legacy).
  • Records:
    • docs/design/urban2010_track_a_v2_implementation.md, the implementation report with 19 conservative readings where the spec was silent;
    • …_invariants.md, with 117 stated invariants;
    • …_reads.txt, the exposure ledger.
  • Untouched: engine/loop.py, engine/steps.py, gates.yaml, committed runs, and the v1 modules under cola_track_a/, fra68_track/, ss/ and estimates/cola_age_profile.py.

Invariants (property-tested with Hypothesis, where the spec states a property)

These are examples; the full list is in docs/design/urban2010_track_a_v2_invariants.md:

  • the computation-years formula: elapsed years less a capped fifth, with a minimum of 2;
  • D selects the N highest years;
  • nonnegative earnings are monotone, D ≥ L, and N is bounded;
  • same-e AIME differences equal the difference of floors;
  • own benefit plus excess conserves the total against an unchanged worker;
  • L replays v1 exactly, and shared caches and invocation order cannot leak D;
  • DS composes D's own PIA with S's fixed age-62 timing;
  • an existing attempt directory is never overwritten;
  • refusal order is deterministic.

Verification

  • pytest tests/track_a_v2: 456 passed, rerun on the rebased tree.
  • Birth-evidence seal tests plus the Track B R1 tests: 197 passed.
  • Black and ruff are clean.
  • Tier recount: unit 4,304 (3,848 + 456), artifact 3,152.
  • The lane's full unit tier: 3,983 passed and 6 failed, all in unchanged tests. They are:
    • three timeouts, under a load average of about 294;
    • three refusals of the local Axiom engine's provenance receipt, which a disk cleanup removed; a separate session is diagnosing this.
    • All four test files involved are byte-identical to master.

Open item (not blocking this PR)

§16.7 authorizes a structural pre-count that computes "projection and counts only: no benefits, weight sums or tabulations". The frozen projection does weighted transition arithmetic internally (engine/di_entitlement.py:690). So track_a_v2_structural_count.py currently refuses before loading population data instead of guessing. Max is asked to clarify whether "no weight sums" bars weight-sum outputs or the projection's own internal arithmetic.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Sep 28, 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 29, 2026 3:38am UTC

Request Review

MaxGhenis and others added 12 commits September 28, 2026 23:34
Add DI-only statutory computation, fixed DI/spouse filing, joint guards,
68 frozen rows, estimands, count-only and registered entry points, and
content-addressed freeze manifests. Preserve protected v1 modules.

Validation: 418 invented tests pass; Black and Ruff clean. Full unit tier
and the 20-draw dry run continue for the separate evidence commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Retain cumulative counts and remaining rows when infrastructure errors or
keyboard interruption stop the joint attempt. Record interrupted loaders and
preserve completed structural counts without introducing outcome fields.

Validated with 23 runner tests and 3 focused entry/structural interruption
tests on invented fixtures; Black and Ruff pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Validate the requested opening-history branch, preserve strict refusal
priority, and retain all worker-only statistic and sampling-floor identities.
Remove misleading all-alive diagnostics from recipient rows. Prepare structural
inputs without legacy weighted diagnostics and require the authorized prior
structural attempt in the registered package. Preserve invented dry-run attempts
and refuse manifest generation if implementation bytes change mid-run.

Invented validation: 99 calculator/history/filing tests, 285 reporting/runner
tests, 55 protocol/structural/input-preparation tests, and 12 dry-protocol tests
passed. The unchanged mortality projector's weighted arithmetic remains an
explicit specification question; real structural execution now refuses before
loading or projection until it is resolved. No real data was executed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Make the protocol seam independent of pytest's basetemp location without
relaxing the production output guard. The minimized cache-root failure is
fixed; all 12 dry-protocol tests pass under the workspace cache basetemp.
Black and Ruff pass. No production implementation bytes changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Record the 456 passing invented tests, full unit coverage with six
unresolved failures in unchanged tests, the verified 68-row dry run,
and the conservative structural pre-count refusal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Record the exact files hashed before Axiom provenance refusal and
consolidate duplicate per-agent path annotations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Master gained Track B R1 (#482); the rebased tree collects 4,304 unit
tests (3,848 + the 456 Track A v2 tests) and 3,152 artifact tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review P2 (pr483-review.md): two invented retirees born 1960 claiming in
2027 with {1987: 840000}. An injected RuntimeError or KeyboardInterrupt
inside person 2's first L×R0 level loses beneficiaries_projected=1 and
person 2's identity; the ValueError control keeps both. Adds the same
check for the exercise-3 scenario collector, a completed-prefix
differential property and an existing-attribution test.

INVENTED DATA - NOT A COMPARISON

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Catch Exception and KeyboardInterrupt around both complete collector person bodies. Attach cumulative local counters and retain existing person attribution before re-raising. The old-code regression replay produced 4 failures and 2 passing ValueError controls on invented inputs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Record the ruling without changing ratified specification bytes. Permit the unchanged weighted projection behind the existing frozen protocol and pre-execution interlocks. Strengthen count-only output rejection and add invented end-to-end and generated-schema coverage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Record the expected old-code regression failures and 494 passing single-threaded tests. Recount 4,329 unit tests and 9,113 total tests. Apply only Black formatting to the existing birth-evidence isolation assertion.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis
MaxGhenis force-pushed the dynamics-a2-impl-20260928 branch from 2ad791e to c84baa8 Compare September 29, 2026 03:37
@MaxGhenis
MaxGhenis merged commit b2495a7 into master Sep 29, 2026
12 checks passed
@MaxGhenis
MaxGhenis deleted the dynamics-a2-impl-20260928 branch September 29, 2026 09:51
MaxGhenis added a commit that referenced this pull request Sep 30, 2026
Track A v2: name the interrupted person at stage 2 and in the paired union (#483 P3)

This branch was successfully deployed

1 active deployment
Preview — c84baa89 Deployed Sep 29, 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