Repository navigation
Fix docs helper import and tighten docs and test hygiene - #10642
Conversation
The documentation helper imported colours Core never exported, so the CTC, ACP and Lifeline notebooks failed on import. The PIA-ratio guide was linked from the calculator page but missing from the table of contents. Comments in the pinned-system test described interpolation metadata Core no longer writes. The calculator reference test checked only direct children, so a calculator-only leaf under a kept node passed, and a stale NEW_PARAMETER_NODES path went unnoticed because apply skips it silently. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LwQq6H3e3QDf7E1R8JgS82
|
Ready for hub review Head: Items
Tests run (one file per process)
Mutants (classification test only, code restored after each)
The test passed again after I restored the file. CIThe PR is a draft, so the Pull request workflow was skipped at this head and hasn't run. Documentation passed: https://github.com/PolicyEngine/policyengine-us/actions/runs/41546159387 Judgment calls
Proposed follow-up
Generated by Claude Code |
#10588 made the ruling PR record a candidate, with the register entry and the marker after it merges. The failure message and the KNOWN_UNMARKED comment still said to register and mark in one PR, and the docstring said verify checks that cites_entry is true, where it checks that the claim matches the file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Hub review in progress Reviewing head Interim findings so far:
Tests and mutants are still running. Superseded by the final review comment below. Generated by Claude Code |
|
Ready for hub review The head is unchanged since FindingsP2 (follow-up, identical on main):
|
| Mutant | main | head |
|---|---|---|
M1: new leaf gov/contrib/ssa/pia/calculator_only_probe.yaml |
1 passed (the gap) | 1 failed: "gov.contrib.ssa.pia.calculator_only_probe is unclassified" |
M2: NEW_PARAMETER_NODES entry gov.ssa.social_security.cola_typo |
not run | 1 failed: "listed in NEW_PARAMETER_NODES but does not exist" |
M3 (mine): leaf four levels down, benefit_levers/cola/means_test/probe/deep.yaml |
not run | 1 failed: "...means_test.probe.deep is unclassified" |
M4 (mine): kept key renamed gov.contrib.ssa.owners_draw_typo |
not run | 1 failed: kept node and every listed leaf "does not exist" |
M5 (mine): recompute_existing listed twice |
not run | 1 failed: "listed more than once" |
After each one I restored the tree and confirmed git status --porcelain was empty, and the unmutated test passes.
Test runs, one file per process at head, Core 3.34.2, Python 3.14:
test_ss_calculator_differential.py: 9 passed (189 s);test_source_conflicts.py: 103 passed (32 s);test_pinned_tbs_sharing.py: 33 passed (911 s).
Source-conflict texts against CONTRIBUTING at main (e6338c34, Order CONTRIBUTING's source-conflict steps the way the guard enforces them #10588 merged).
- The
KNOWN_UNMARKEDcomment (:117-121) matches the ratchet bullet and steps 1 and 3: reword a non-conflict, otherwise a candidate plus a raised line in the same PR, and the line goes when the marker lands. - The failure message matches step 1, apart from the P3 above.
- The other guard messages agree with the four steps:
:384-385"Add the entry to rulespec-us ... first, then bump the pin",:833"delete them from candidates.yaml", and the shrunk-count message. - The docstring's claim about
verifymatches rulespec-ustools/README.mdonmain, read from raw.githubusercontent.com. Its verify list says implementations and tests are "pinned to commits reachable from their repository's default branch ... and they exist there" and "eachcites_entryclaim matches its file, which must name the global id as a whole id".
Scope. Six files: a changelog fragment (top-level, .fixed.md), docs/_toc.yml, three tests and tools/documentation.py. Nothing is under .github/ or policyengine_us/tests/policy/baseline/partners/. The body has impact: none (docs and tests only) and axiom: n/a: docs and tests only, no policy change. No variable or parameter changes, so no population check is needed.
Overlap. Open-PR searches on each changed file name found Add annual Social Security earnings histories and per-year reforms #10560 (adds gov.contrib.ssa.history to NEW_PARAMETER_NODES) and Guard historical state rebate eligibility and document attribution #10309 and Add state tax comparison outputs and caller documentation #10310 (both edit docs/_toc.yml). Add annual Social Security earnings histories and per-year reforms #10560 at 2166886f48 merges cleanly into this head, and the classification test passes on the merged tree (1 passed): its new leaves fall under the new NEW_PARAMETER_NODES path. Add annual Social Security earnings histories and per-year reforms #10560 adds no leaf under a kept node. I didn't merge-test Guard historical state rebate eligibility and document attribution #10309 or Add state tax comparison outputs and caller documentation #10310.
CI at this head. Documentation succeeded (run 41549522787). The Pull request run 41550127572 was still in progress when I posted, with 24 jobs succeeded and 10 still running, including microsimulation, the Python shards and several baseline shards. An earlier Pull request run at this head was skipped while the PR was a draft.
What I couldn't check
- The final conclusion of Pull request run 41550127572.
- I didn't execute the three notebooks end to end, only the two helper functions they call.
- Whether a build of the TOC with
gov/irs/credits/ctcadded still exits 0. - Microsimulation impact. Not needed, since no model code changed.
- I read rulespec-us
tools/README.mdonly at its currentmain, not at the commitsource_conflicts/pin.yamlnames.
Generated by Claude Code
The calculator page links them, and nothing in the navigation led to them. The review built this table of contents with CI's toolchain, and it exits 0. Also let the source-conflict guard's message cover a conflict the pinned register already lists, since test_candidates_are_not_yet_registered fails a second candidate for one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
US + core hub merge audit, us#10642 at
|
Fixes no tracked issue.
What and why
Docs and test hygiene. No model output changes.
policyengine_us/tools/documentation.pyimportedLIGHTER_BLUE,LIGHT_BLUEandDARK_BLUEfrompolicyengine_core.charts, which exports none of them in Core 3.33.2 or 3.34.2, sodocs/gov/irs/credits/ctc.ipynb,docs/gov/fcc/acp.ipynbanddocs/gov/fcc/lifeline.ipynbfailed on import. It now importsformat_fig/display_figfrompolicyengine_core.chartsand four blues (light to dark) frompolicyengine_core.charts.formatting, which defines them in both versions.policyengine_us/tests/test_pinned_tbs_sharing.py: the "change metadata" comment and thetest_each_tree_interpolates_for_itselfdocstring described theinterpolation.completedmetadata Core no longer writes; Core now setsParameter.interpolated.docs/_toc.yml: listsusage/social-security-pia-ratiounder the calculator page, which links to it, and addssocial-security-benefit-levers,social-security-cola-means-testandusage/social-security-scoring-preflight, which only links reached.policyengine_us/tests/unit/test_ss_calculator_differential.py: the classification test now walks every leaf under the classified contrib namespaces.REFERENCE_PARAMETER_NODESmaps each kept node to its leaves, so a calculator-only leaf added under a kept node fails until someone classifies it. The test also flagsNEW_PARAMETER_NODESpaths that don't exist, sinceWithoutHouseholdCalculator.applyskips them silently.policyengine_us/tests/code_health/test_source_conflicts.py: the failure message, theKNOWN_UNMARKEDcomment and the module docstring gave the old order. They now matchCONTRIBUTING.mdsince Order CONTRIBUTING's source-conflict steps the way the guard enforces them #10588: the ruling PR records a candidate and adds or raises the file's line, and the register entry and the marker follow after it merges. The message also covers a conflict the pinned register already lists, which takes no candidate.Test plan
ruff format/ruff checkon changed fileschangelog.d/impact: none (docs and tests only)
axiom: n/a: docs and tests only, no policy change
🤖 Generated with Claude Code