Skip to content

A turn's credit follows the claim she takes during it (card 12ddd78f) - #5523

Merged
joelteply merged 7 commits into
canaryfrom
cormac/late-credit-capture
Oct 27, 2026
Merged

joelteply merged 7 commits into
canaryfrom
cormac/late-credit-capture

Conversation

@joelteply

@joelteply joelteply commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Why

A resident's reviewed work only reaches her training if the generation that issued her submission was staged under the claim she submitted with. This is plan path step 3 (Learning, goal 8), the learning lane: a reviewed correction that reaches her genome.

Kimi's PASS on submission c46cc5c6 (card 5c5b7a08, 5090, 2026-10-27) holds forever with training.credit.provenance_held / Unresolved("generation 822892a8 ... must identify exactly one staged revision"). Codex read her store read-only and found:

  • staged_credit_generation for 822892a8 has total=0;
  • the card's rows carry the right claim (e14d6bdc) and complete indexes;
  • 822892a8 is captured in the work room with cause=ambient;
  • the last gate before it was initiative_turn held0 active_claims0.

Her initiative turn began holding nothing, so it opened no capture (drive_in_held_card: "with no card held ... no capture"). In that same turn she reopened the card, claimed it, committed and submitted. apply_act still stamped 822892a8 as issuing, so the pending binding names a generation that nothing would ever stage.

The same defect, one step later: a turn that begins on one claim and takes another stages everything under the first claim. The submission's claim then matches no row.

What

training_producer/claim_following.rs (new), ClaimFollowingCapture:

  • After each act that touched the board (work/*; nothing else can change a hold), it rereads her held card through the same focus_workspace_card the turn's rooting uses.
  • When the card or its claim changed, the current segment closes and a new one opens from that act.
    • The claiming act belongs to the new claim.
    • An act that only let the card go stays with the card it released.
    • No generation before a claim is credited to it (the CapturedCredit evidence floor).
  • An unreadable board after a board act leaves the turn unsettled from that act. Nothing new is staged, and every later act reads again (training.credit.claim_unreadable).
  • The answering read closes the old claim at the first unread act and opens the new one at the latest board act that could have taken it.
  • Across several unread board acts, even an unchanged answer credits that stretch to no claim (training.credit.claim_uncertain_dropped).
  • If the turn ends while still unread, only what came before is staged. Each change raises training.credit.claim_followed.
  • Each segment is an ordinary TurnCreditCapture, opened through the new TurnCreditCapture::opener. This type decides only where segments begin and end.

Both credited drivers use it: card_hands::drive_in_held_card (room and initiative turns) and the held-work turn in act_question. drive_in_held_card now returns the last claim the turn stood on, so a turn that claimed mid-way is card-linked and its speech isn't also submitted as unlinked conversation.

Not recovered: c46cc5c6 itself. Its generation was never staged, and nothing fabricates a binding.

Verified

Not built locally: enrico is serving and measuring a rollback, and IntelMac's builds go to CI.

  • CI at ea3409f: all checks SUCCESS or SKIPPED, including the core lib tests and binding drift (Codex verified, 2026-10-27).
  • Mutation, run in CI: 315dbe8 disables follow (reader filtered to None). Run 40477308653, job 122098699503: 1216 passed, 2 failed, both the new tests on their attribution assertions (Codex verified):
    • a_claim_taken_during_a_turn_credits_from_that_act_on, staging.rs:479: the final record stages nothing;
    • an_unread_claim_stages_nothing_until_a_read_says_whose_it_was, staging.rs:573: the old claim kept [before, claiming, unread, answered] where [before] was expected.
  • Restored head cc5cd08 reverts the mutation; git diff --quiet ea3409fc3 cc5cd08a0 exits 0.

Tests (real DataModule over SQLite):

  • a_claim_taken_during_a_turn_credits_from_that_act_on:
    • begins holding nothing, then claims and submits: one row [claimed, issuing];
    • a reclaim of the same card: separate rows for the old and new claim;
    • resolve_pending binds the issuing generation to exactly the new claim's row.
  • an_unread_claim_stages_nothing_until_a_read_says_whose_it_was (Codex's review cases):
    • a claim whose read fails, answered two acts later: old claim [before]; new claim [claiming, unread, answered];
    • claim Y unread, then claim Z answered: Z begins at its own act; Y's generation goes to no claim;
    • A, claim B unread, release B answered as A: the uncertain stretch goes to no claim, not back to A;
    • never read again before the turn ends: only what came before is staged.
  • claim_following::tests: only board acts reread holds; a new claim on the same card is a new hold.

Measured after deploy

Owner Cormac, by 10-29: on the first node running this, a resident submission made in a turn that claimed mid-way reaches training.credit.transferred after review, or its first missing step is named.

Removed / added

+143 / -11 across 5 files; one new file of about 150 lines. No duplicate removed: TurnCreditCapture stays the one staging owner, and both drivers' hand-built for_turn calls now go through opener.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

Kimi's initiative turn on the 5090 (2026-10-27) began holding nothing, then
reopened 5c5b7a08, claimed it, committed and submitted. A turn's capture was
decided once at its start, so nothing was staged; the submit's issuing
generation (822892a8) bound to no row and the PASS review of c46cc5c6 held
forever (training.credit.provenance_held). A turn that began on one claim and
took another staged everything under the first.

ClaimFollowingCapture rereads her held card after each board act (work/*).
When the card or its claim changes, the current segment closes and a new one
opens from that act, so no generation before a claim is credited to it. Both
credited drivers (drive_in_held_card, the held-work turn) use it; each segment
is an ordinary TurnCreditCapture, opened through TurnCreditCapture::opener.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
joelteply and others added 4 commits October 27, 2026 03:18
…se it was (Codex on #5523)

A failed active_claims read right after a claim kept staging under the old
claim, crediting the new claim's work to it for good. Now the turn is
unsettled from that act: nothing new stages, every later act reads again, and
the answering read puts the boundary at the first unread board act (the new
claim from the latest one; anything between two unread board acts goes to
neither). Still unread at the end: only what came before is staged.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…dex on #5523)

With a hold unread after claim Y, a next act that claims Z and reads Z opened
Z back at Y's act, crediting Y's generation to Z. The answering board act is
the latest that could have taken the claim it shows; the unread stretch before
it goes to no claim.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…ch to no claim (Codex on #5523)

Held A, claim B unread, release B answered as A: 'unchanged' restored B's
generations to A. Unchanged proves no claim was taken only when one board act
was in question; across several, A closes at the first unread act and resumes
after the answering one.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@github-actions github-actions Bot added size: XL and removed size: L labels Oct 27, 2026
@joelteply
joelteply merged commit bc3f79d into canary Oct 27, 2026
15 checks passed
@joelteply
joelteply deleted the cormac/late-credit-capture branch October 27, 2026 09:18
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