PolicyEngine / PolicyEngine/microcosm
Delivery gate can prescribe a provably identical retry when the basis is already true (post-#549/#550 residual)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 0
- Forks
- 4
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 94
Description
Carried over from PR #554's round-2 cross-family review (closed as superseded by #549/#550). The reviewer's live counterexample, run against the #554 branch but structurally applicable to main's gate: with the assignment basis equal to the release-weight recomputation, an ordinary band miss still gets the 're-run with --ssi-take-up-prior-weight-basis' remediation — and that retry regenerates byte-identical flags under the same seed (same priors, same draws), the same miss, and the same advice. An endless no-op ladder.
Main's delivery gate (post-#549/#550) has no conditional-advice machinery (grep finds no basis-comparison in the retry path). Required, adapted to main's gate shape rather than ported from the closed branch:
- Retry advice only when the release-weight prior recomputation differs from the assignment prior (exact float inequality — PR #554 round 2 proved a 1e-9 tolerance wrong with a 1e-10 counterexample that flips a marginal draw and clears the gate; only float-identical priors guarantee identical selections) for at least one missing enforced band.
- When every missing band's priors agree: say the basis is already true, that a retry would reproduce identical flags, and direct repair at support/draw realization. Name both priors on every miss line.
- Per-band suffixes (an equal-prior band must not be told its basis differs) with one run-level remedy; run-level applicability boolean stays.
- Nonfinite/missing prior fields in a schema-4 row = invalid diagnostics, not a silent 'priors match'.
- Schema-3 legacy-seed loader: per-band capacity/floor equality pins (the #554 review killed a +1.0 capacity mutation only after these were restored).
Empirical context: attempts 6/7 (populace#507) validated floor-aware + delivered basis (18_64 −0.00%, 65_plus +4.53%); the no-op case becomes reachable in production precisely when the ladder has converged — which is now the expected steady state.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in main's delivery-gate retry path, where the payload reports no basis-comparison machinery, and trace its diagnostics and run-level applicability boolean. Check schema-4 prior validation and the schema-3 legacy-seed loader, including per-band capacity and floor equality coverage. Done means advice appears only for exact prior differences, equal-prior bands explain the no-op retry, invalid priors are rejected, and the required pins are tested.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100