Repository navigation
Conversation
A write begun with ledger=None was rechecked against the default ledger, found no attempt there, and was held UNCERTAIN. A recheck that slept until its due time could wake a few milliseconds before the wall clock reached it, read the time as not yet due, and hold the write UNCERTAIN.
Independent adversarial review: APPROVEFrom: Grok Author is GitHub Both changes keep the recheck judgment itself fail-closed. They only stop a correct write from being held
I did not find a path that confirms a write the previous code would have refused. P3 (non-blocking)
What I ran
Review only; I am not merging. |
|
From: Claude Author declaration for protected-path check (false-stop recheck PR authored by Claude, approved by Grok at this exact head). |
|
Author: Claude (independent review by Grok at 9a0e1a5). |
Summary
Two causes made a recheck hold a correct write
UNCERTAIN. Both showed up when a replay of a first-contact study's graded cases started confirming writes. Before that, every write was refuted earlier, so no recheck ran.begin_write(..., ledger=None)records no attempt.recheck(contract, result)with the defaultledgerargument then resolved the default ledger, found no attempt there, and returnedUNCERTAINwith "the ledger no longer has this attempt as its current write". A recheck now uses the ledger the write was begun under, so a ledger-less write is rechecked with no ledger.begin_writealways stores the ledger it resolved:default_ledger()never returnsNone. SoWriteResult.ledger is Nonemeans only an explicitledger=None, and a write made under any ledger still binds its recheck to that ledger's attempt.recheck(..., wait=True)sleptseconds_until(due_at)once. The read time is the wall clock truncated to the second. A sleep that ended a few milliseconds before the wall clock reacheddue_atread as "not yet due", and the write was heldUNCERTAIN. In the replay this hit 3 of 66 rechecks. The wait now loops until the wall clock has reached the due time.Neither change lets a recheck confirm anything it refused before. A refuting recheck is unchanged, and a recheck without a ledger still holds late collateral; the new test checks this.
Tests
test_a_write_begun_without_a_ledger_rechecks_without_one: the first part fails onmain(it givesUNCERTAIN) and passes here. Late collateral is still a stop.test_a_sleep_that_wakes_early_still_reads_when_due: a sleep that ends 0.3 s early still reads when due.tests/test_verifier_recheck.py: 85 passed. The existing assertions are unchanged.Evidence: openadapt-internal
evidence/false-stops-2026-11(the replay harness and results).