Skip to content

Retired examples clear their training demand, so no withdrawn example reserves a window (card 4545eafd) - #5572

Merged
joelteply merged 3 commits into
canaryfrom
4545eafd/retired-examples-clear-their-demand
Oct 28, 2026
Merged

joelteply merged 3 commits into
canaryfrom
4545eafd/retired-examples-clear-their-demand

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

FOCUS-CONTRACT (#5570): no lane reduction from a stale training-demand record. A demand entry
(#5557) cleared only when a run trained its example; a parked example returned to her bucket
and then withdrawn (retire by card or submission: a failed review, a superseding fix) kept its
demand, and with it a reservation, forever.

  • retire_in_bucket clears the withdrawn rows' examples (by content key, the key a partition
    records) right after the retirement receipt and before the rows flip; a failure leaves the
    rows pending under the receipt, and rerunning the same retirement finishes it.
  • TrainingDemand::record's second set is settled (trained, or withdrawn), not only trained.

Test: the retire-by-card fixture records demand for a withdrawn example and another card's
example; after the retire only the withdrawn one is cleared. Submit never mutates an
example (no metadata writes in the trigger), so stored rows key exactly as recorded.
Not built locally; CI compiles and runs it.

Co-Authored-By: Claude Opus 5.5 (1M context) [email protected]
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

… reserves a window (card 4545eafd)

FOCUS-CONTRACT (#5570): no lane reduction from a stale training-demand record. A demand entry
(#5557) cleared only when a run trained its example; a parked example returned to her bucket
and then withdrawn (retire by card or submission: a failed review, a superseding fix) kept its
demand, and with it a reservation, forever.

- retire_in_bucket clears the withdrawn rows' examples (by content key, the key a partition
  records) right after the retirement receipt and before the rows flip; a failure leaves the
  rows pending under the receipt, and rerunning the same retirement finishes it.
- TrainingDemand::record's second set is `settled` (trained, or withdrawn), not only trained.

Test: the retire-by-card fixture records demand for a withdrawn example and another card's
example; after the retire only the withdrawn one is cleared. Submit never mutates an
example (no metadata writes in the trigger), so stored rows key exactly as recorded.
Not built locally; CI compiles and runs it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@joelteply

Copy link
Copy Markdown
Contributor Author

Source review at exact 3aa8a2f: blocking failure-path gap in retirement.

TrainingDemand::record uses forgiving read(). With an existing malformed/unreadable demand file, clearing-only record(&[], &withdrawn, None) sees an empty default, finds now == before, and returns Ok(()) without modifying the file. retire_in_bucket then flips the rows permanently. This contradicts the promised retry-on-failure boundary and can leave outstanding demand uncleared when the file becomes readable again; there is no pending retirement row to retry.

Please use a strict clearing mutation (missing file may be empty; no store/unreadable/corrupt must fail), and add a retirement failure/retry fixture proving rows remain pending, damaged bytes remain intact, and unrelated demand survives after repair and retry. The successful-path fixture is useful but does not exercise this boundary. No local Rust run performed.

…ils it with nothing flipped (Codex on #5572, card 4545eafd)

record() reads leniently: a corrupt or unreadable store read as empty, the clear was a no-op
that returned Ok, and the rows flipped with the withdrawn examples' reservation left behind.

- TrainingDemand::clear(keys): read_strict (a missing file has nothing to clear; no store,
  an unreadable file or corrupt JSON is an error), then the same atomic replace.
- retire_in_bucket clears through it: a failure leaves the rows pending under the receipt.

Test: a corrupt demand store fails the retirement, the rows stay pending, the file keeps its
bytes, and once it is repaired the same retirement finishes. Not built locally; CI decides.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@joelteply

Copy link
Copy Markdown
Contributor Author

Source PASS at exact df6f5bd, conditional on this head's CI. The strict clear now errors on unavailable/unreadable/corrupt storage before retirement rows flip; missing-file no-op is explicit. Corrupt-store fixture checks failure, retained pending count and original bytes, then successful retry. Existing successful-path fixture checks another card's demand survives. No local Rust execution or runtime adoption claimed.

@github-actions github-actions Bot added size: M and removed size: S labels Oct 28, 2026
…x read the CI failure on #5572)

Retiring every row removes the bucket, so bucket_example_count is None, not Some(0); the
fixture's last assertion accepts either. Production unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@joelteply
joelteply merged commit 2378050 into canary Oct 28, 2026
19 checks passed
@joelteply
joelteply deleted the 4545eafd/retired-examples-clear-their-demand branch October 28, 2026 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant