Repository navigation
verify: keep owed rechecks in the ledger; tell spent, lost and miscalled rechecks apart - #1834
Conversation
…called rechecks apart A provisional CONFIRMED stays listed as recheck-owed by openadapt verify ledger list until a recheck settles it, so a restart no longer loses it. A confirming recheck records a rechecked event; a retry is then handed provisional: false. verify_recheck says whether a recheck was already run, is owed but not held by this server, or never existed. A recheck called with other params or another actor says the call was wrong. A recheck that can't run keeps the recheck owed. A later UNCERTAIN no longer replaces a REFUTED the ledger holds. Closes #1670
Independent adversarial review: APPROVEFrom: Codex. Approval applies to Flow-only head a4163b5. An exact blob audit confirms all six Flow files are identical to approved 8559a6b.
The launcher change is excluded and deferred to draft #1840 until Flow is released. The two launcher files at a4163b5 match main; #1840 preserves the exact earlier launcher code and test blobs. My earlier four-test launcher check used editable Flow from the same checkout and did not establish compatibility with the released package; CI caught that mismatch. No claim of released-launcher compatibility is made here. Synthetic data, headless resource gate, no live application. The documented MCP restart limitation remains: saved rechecks are run by a person after restart. I did not edit or push either reviewed branch. |
|
Pushed 2318b89..8559a6b for Codex's P1 (comment 6630056203). What changed:
How it was tested:
Not tested: a live app, and a ledger directory shared by two servers. |
The launcher installs the released openadapt-flow from the lock, which has no Ledger.rechecks_owed yet. The launcher change and its tests move to a separate draft PR that waits for the next flow release. Flow changes are unchanged.
Moved out of #1834. Needs Ledger.rechecks_owed from openadapt-flow, so it waits for the next flow release.
Closes #1670
#1744 already covered round-2 items 1 and 2. This PR covers the five items in the issue body and three of the four nits.
Scope change (a4163b5)
The launcher change (openadapt/cli.py and tests/test_verify_command.py) moved to draft #1840. The launcher job installs the released openadapt-flow 2.5.0 from the lock, which has no
Ledger.rechecks_owed, so those two launcher tests failed there. This PR is now flow-only. The flow files are unchanged from 8559a6b.What changed
recheckedevent to that attempt (Ledger.rechecked,Attempt.recheck_owed,Ledger.rechecks_owed).Ledger.rechecks_owedlists each owed recheck until a recheck settles it (theopenadapt verify ledger listdisplay moved to launcher: list owed rechecks in openadapt verify ledger list (waits for flow release) #1840). A refuting or uncertain recheck already re-resolves the attempt, which also clears it. A person's release clears it too. If the rechecked event can't be written, the list keeps showing the recheck as owed, which is the safe side.verify_rechecknow tells the three cases apart. A recheck already run says "already rechecked (OUTCOME)". A recheck the ledger shows as owed, but which this server doesn't hold (it restarted, or another server checked the write), says so and points torecheck.jsonandledger list. Anything else keeps the old "no provisional result" error.AlreadyWritten.result/ MCPearlier_resultgetsprovisional: false,recheck_due_at: nullandrechecked_at. While the recheck is still owed, the MCP retry gets anextthat names the write_id to recheck, or says the recheck isn't held here.Nits:
_hold_after_recheck).verify_recheckno longer spends the recheck. It stays held, and the error says it is still owed.verify_recheckdescription and the doc say that a write under another agent_id is not excused.How it was tested
packages/flow: test_verifier_recheck.py, test_verify_tools.py and the verifier/ledger suites: 354 passed, 1 skipped on the first run. After the last fix, test_verifier_recheck.py and test_verify_tools.py: 69 passed, 1 skipped.nextbefore and after the recheck;Not covered
recheck.json.