Skip to content

M6 factory: (0,24) projection-coverage pad + pe-us param-dir binding (3e patch: F1/F2/N1 + bridge test) - #197

Merged
MaxGhenis merged 3 commits into
masterfrom
m6-factory-pad
Jul 14, 2026
Merged

M6 factory: (0,24) projection-coverage pad + pe-us param-dir binding (3e patch: F1/F2/N1 + bridge test)#197
MaxGhenis merged 3 commits into
masterfrom
m6-factory-pad

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

The zero-discovery patch pinned by ratified amendment 3e (§2.8.10.5, merged #196) and verified against the merged engine by the 3e referee (#196 comment). Every design decision here was made and refereed in the amendment; this PR only transcribes it.

F1 — the inert (0,24) projection-coverage pad

_pad_below_25_projection_coverage(external_rates, exposure, *, boundary_year) appends one (0,24) band per sex to both mortality fit inputs, after the seven-band construction (build_inputs step 4):

  • external pad: NCHS 2010 (l₀−l₂₅)/(T₀−T₂₅) central rate (≈0.000766 male / ≈0.000451 female) — provenance honesty only; aligned_rate = central_rate × (psid_rate/central_rate) = psid_rate cancels it.
  • exposure pad: dated event_year = required_interview_year = T* (survives the ≤T* flow truncation), start_weight = exposure = 1.0, death = 0.0 → the fitted <25 hazard is −expm1(0) = 0 exactly: no modeled mortality below the age-25 PSID exposure floor.

MORTALITY_BANDS, build_mortality_floors.BANDS, and the committed floors artifacts are untouched; the MORTALITY_BANDS == mf.BANDS guard still binds.

F2 — the parameter-dir binding

assert_pe_us_param_dir() (step 1, right after assert_pe_us_version()) requires (_resolve_pe_us(None)/_SSA).resolve() — the directory load_ssa_parameters will read — to equal the metadata-versioned distribution's own parameters/gov/ssa. Closes the referee-demonstrated silent-wrong-load seam (1.752.2 metadata + a 1.690.7 checkout behind the env var).

N1

The extractor's era-mapping docstring no longer claims a build() verification that does not exist; era records are provenance-only, read by nothing.

The missing bridge test (referee-flagged)

Committed tests now route factory-shaped rates through prepare_mortality_refit_inputs → fit_mortality_model — the run's exact first phase:

  • unpadded seven-band inputs raise mortality bands must start at age zero (the failure the pad exists to prevent);
  • padded inputs fit a valid 8-band 0→120 model; <25 hazard exactly 0 both sexes; the fourteen 25+ cells equal the hand-computed PSID arithmetic −expm1(−deaths/exposure) and are invariant to pad value (0.5) and weight (17.3);
  • pad rows verified against the NCHS lx/Tx formula and the ≤T* truncation;
  • param-dir gate tests run against an injected fake distribution — no real policyengine-us install needed, so the module stays in the always-run unit tier (the env var is referenced through the loader's own _PE_US_ENV constant; a literal would have flipped all 31 module tests to the oracle tier and silently demoted 21 existing always-run factory tests).

tier_counts.json: unit 410 → 420 (CI-equivalent full-collection recount; tier policy green).

One disclosed addition beyond the pinned pointers

_KNOWN_STALE_REGISTRATIONS gains registration 2 (4967241464), whose designed pre-scoring stop is publicly graded (comment 4967433717) — the runner guard must not accept a superseded registration for a PSID-touching run. Guard hygiene from the public record; no design choice, no data selection. (tier_counts.json artifact 1010 → 1011 for the added parametrize case.)

Not in scope

No gates.yaml change, no floor, no threshold, no scored surface. After merge: the THIRD gate_m6 registration on #42, then the one-shot temporal-holdout run.

🤖 Generated with Claude Code

…(amendment 3e patch, F1/F2/N1)

The zero-discovery patch pinned by ratified amendment 3e (§2.8.10.5, PR #196),
verified against the merged engine by the 3e referee (#196 comment 4970729902):

- F1: `_pad_below_25_projection_coverage(external_rates, exposure, *,
  boundary_year)` appends the inert (0,24) band per sex to BOTH mortality fit
  inputs after the seven-band construction — external pad = the NCHS 2010
  (l_0−l_25)/(T_0−T_25) central rate (outcome-inert; aligned_rate = psid_rate
  cancels it), exposure pad dated event_year = required_interview_year = T*
  with death = 0 so the fitted <25 hazard is exactly 0. Called in
  build_inputs step (4). MORTALITY_BANDS and the floors artifacts untouched.
- F2: `assert_pe_us_param_dir()` binds the directory load_ssa_parameters will
  read (env var / default resolution) to the metadata-versioned
  policyengine-us install's own on-disk location; called in step (1) right
  after assert_pe_us_version(). Closes the silent-wrong-load seam the referee
  demonstrated with a 1.690.7 checkout behind a 1.752.2 install.
- N1: the extractor's era-mapping docstring no longer claims a build()
  verification that does not exist (era records are provenance-only).
- The missing fit_mortality_model bridge test the factory referee flagged:
  factory-shaped rates now route through prepare → fit in committed tests —
  unpadded seven-band inputs raise "start at age zero"; padded inputs fit an
  8-band 0→120 model whose <25 hazard is exactly 0 and whose fourteen 25+
  cells equal the PSID arithmetic and are invariant to pad value and weight.
  Plus param-dir gate tests via an injected fake distribution (no real
  policyengine-us needed; the module stays in the always-run unit tier, with
  the env var referenced through the loader's own constant so the
  tier classifier does not demote 21 existing always-run factory tests).
- tier_counts.json: unit 410 → 420 (full-collection recount).

No gates.yaml change, no floor, no scored surface touched.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
social-security-model Ready Ready Preview, Comment Jul 14, 2026 3:34pm

Request Review

4967241464 is a publicly graded pre-scoring stop (grading 4967433717) and
must not authorize a PSID-touching run; only a fresh third registration can.
Disclosed in the PR body as an addition beyond the pinned 3e patch pointers
(guard hygiene from the public record, no design choice). tier_counts:
artifact 1010 -> 1011 (the added parametrize case; full-collection recount).

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