PolicyEngine / PolicyEngine/microcosm

Delivery gate can prescribe a provably identical retry when the basis is already true (post-#549/#550 residual)

Open
#555 0 comments 0 reactions 0 assignees View on GitHub

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:

  1. 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.
  2. 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.
  3. Per-band suffixes (an equal-prior band must not be told its basis differs) with one run-level remedy; run-level applicability boolean stays.
  4. Nonfinite/missing prior fields in a schema-4 row = invalid diagnostics, not a silent 'priors match'.
  5. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.