Repository navigation
fix(flow): count a P7 fallback as no-write only when nothing changed anywhere - #2528
Conversation
…anywhere P7 (#2491) treats a change to another record during a fallback run (outside_run), or a record check without outside_run, as a possible write and reports RECONCILIATION_REQUIRED. The run ledger now agrees: - A P7 record check proves "no write" only when it is readable, its created/changed/removed counts are zero, and every outside_run count is zero. A missing outside_run proves nothing. - A fallback is VERIFIED only when P7's own record agrees: fallback.status is VERIFIED, and so is run_status when kept. Otherwise it is UNKNOWN (reconciliation_required). The same holds for a wrap run record of the fallback. Tests use run3's real result.json files, as they are and with an outside_run write, a missing outside_run, or a disagreeing status.
|
From: Claude Author declaration for this head. Claude wrote the changes on this branch. It makes the run ledger agree with P7 (#2491): a fallback record check proves no write only when it is readable, its counts are zero and every outside_run count is zero, and a fallback is VERIFIED only when P7's own status agrees; otherwise the run is UNKNOWN. Local checks on this head: flow ledger suites plus the capabilities map, 226 passed; types run_ledger, 19 passed; ruff, mypy, gitleaks and the engine-generality check clean. |
Independent adversarial review: APPROVEFrom: Claude (independent reviewer) I read the diff against main and compared the ledger's Blockers None. Nits
|
P7 (#2491,
wrap/fallback.py_nothing_written) treats a fallback run as a possible write in two cases: a change to another record during the run (outside_run), or a record check with nooutside_runat all. Either way it reports RECONCILIATION_REQUIRED. The merged run ledger never readoutside_run. It could count a declined or refused fallback as "nothing written" (ESCALATEDperson_declined, or FAILEDpolicy_rejected_no_write) when P7 says a person must reconcile. It also took a fallback as VERIFIED from the record check alone.Changes (
run_ledger/readers.py,run_ledger/collect.py)readable: true, its created, changed and removed counts are 0, and everyoutside_runcount is 0. A missingoutside_runproves nothing; such a run is UNKNOWNwrite_unconfirmed.fallback.statusis VERIFIED, and so isrun_statuswhen P7 keeps one. Otherwise the run is UNKNOWNreconciliation_required.Tests
tests/test_run_ledger_joins.py, using real P7result.jsonfiles fromfixtures/run_ledger/run3_fallback:person_declined.outside_runwrite, or with nooutside_run, is UNKNOWNwrite_unconfirmed.statusRECONCILIATION_REQUIRED, or withrun_statusGATE_NOT_PROVED, is UNKNOWNreconciliation_required.reconciliation_required.Local checks: flow ledger suites plus the capabilities map, 226 passed; types run_ledger, 19 passed; ruff, mypy, gitleaks and the engine-generality check are clean.