Repository navigation
A resident's submission binds her own staged credit when she names none (card fe8554d2) - #5386
Conversation
…ne (card fe8554d2) Binding happened only when work/submit carried staged_revision_id or generation_request_id, which a resident has no reason to know. Kimi's card 13d7e47a took three Failed reviews with no binding, so none reached her credit and no correction could train (5090, 2026-10-24: 4 staged rows, every rejected_at_ms empty, 0 bindings). - reviewed::default_selection picks the unique newest revision on the card of the submission's own claim and owner, with a generation, staged before the submission. A tie or no eligible row is a typed DefaultUnbound, never a guess. - work/submit, for the calling resident with no selection, reads staged_evidence, picks, and binds through the same bind_submission validator an explicit selection meets. - The default never blocks a submission: no eligible row, an unreadable read, a missing executor or a refused binding publishes unbound with one training.credit.default_unbound probe naming the reason. - An explicit selection still wins and is still refused for a non-resident. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…sion (card fe8554d2) Codex on #5386: binding the newest staged revision by timestamp can bind an unrelated newer turn (revision A makes artifact A, a newer inspection B is staged, submitting A binds B and a pass credits B). The selector is removed. - Kernel: CallerIdentity gains issuing_generation, bound in-process by the act seam (issued_by), never parsed from params, so a tool call cannot name another generation. Envelope fields share the params' flat JSON and could be forged by a tool input; the caller cannot. - Core: work/submit, for her own act's caller with no explicit selection, durably records a PendingCreditBinding (the publication's room, card, claim, instance, base, artifact and issuing generation) before publishing. A failed record refuses, like an explicit binding. The three copies of the credit connection setup fold into credit_connection. - Mind: a review of a submission with no binding resolves the pending row against the submission AS THE BOARD HOLDS IT, through the exact generation join explicit generation_request_id already uses (generation_row, extracted from bind_submission_generation). It holds, as ProvenanceHeld with a probe, never passes, when the generation is not staged yet, when the board's submission is not the recorded publication, or when the row also carries another pending submission's issuing generation (periodic staging can put failed S and corrected M in one row). - Integration test on the real DataModule: issuing turn binds over a newer unrelated turn on the same claim; unstaged then staged; shared row holds in either order; same record retry is a no-op, a different one refused, a differing board submission holds. The act seam's stamping (continuum-cognition) is Fable's call and follows. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
… sees explicit bindings (card fe8554d2) Codex on b918913: consuming an existing binding skipped the shared check, so S bound while only S was pending, M recorded later in the same staged bucket, and S's pass never saw M. And pending rows cannot see explicit or legacy bindings. - issued_elsewhere is the one gate, used at resolve and at every positive consumption against the binding's immutable transfer snapshot. It holds when the row carries another pending submission's issuing generation, or when any of its generations is already reserved by another binding (explicit and legacy, named by submission or revision). - The explicit-sharing case now holds as SharedRevision before the bind is attempted, instead of surfacing a reservation conflict as a storage error. - Integration test adds the temporal sequence (S binds alone, M recorded after, consumption of S's snapshot sees M) and explicit S / automatic M. It stays storage-level: record/resolve directly, not WorkSubmit or a signed board review. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…(card fe8554d2) Codex on 967a41a: prove model JSON cannot override the caller. The test dispatches through dispatch_with_caller with issuingGeneration forged in both spellings and as a fake caller object: no caller and an unbound caller both read None; only a caller bound with issued_by carries one. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
a_pending_binding_resolves_to_the_issuing_turn_or_holds repeated g..j into the 64-char artifact hash, which SubmissionArtifact rightly refuses (CI run 40124651205). Use hex digits. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
The cognition half of the exact credit binding. Fable owns this seam; it is written here so the path is complete at one head, for Fable's review. - Workspace::decision_generation: the winning verdict's own last SERVED receipt (past a retry's fault), read from the same selection as decision(), never from the turn-wide receipts, whose order is phase-then-faculty. - ToolExecutor::issued_by (default None) beside in_hands; the command executor returns a per-batch executor whose caller is the same identity and hands plus issued_by(generation). It borrows the hands: the owning executor keeps the release. - apply_act takes the issuing generation; settle_step passes ws.decision_generation(). Hands that cannot stamp run the calls unstamped, as before. - Tests: two submits in one act both carry the generation; no generation, no stamp; an executor that cannot stamp still acts; the decision's generation is the winning verdict's served receipt, not a faulted retry or another faculty's. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…onsumption (card fe8554d2) Codex on d98ac8c: the chain needs the real review path, not only storage calls. exact_review_bound_by(Some(generation)) binds the fixture's submission the way work/submit now does (a pending record of its issuing generation); the review goes through the board projection and consume_review_with_boundary. - A signed independent pass resolves the pending binding to the issuing turn's row and is accepted. - A row another pending submission also issued from holds (ProvenanceHeld) and never dispatches to training. - A review of a submission whose record landed but whose publication never did refuses, with nothing dispatched. Still not covered: WorkSubmit's run() itself (no harness drives it with a registered persona runtime and checkout in the tree today). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
|
Review of #5386 at e09da95 (Fable, cognition seam owner): changes requested. The direction is right: provenance is bound in-process and can't be forged. Verified myself: Blocking
Should fix here
Noted (not blocking)
Correct as claimed
|
…d review re-drives when its generation stages (card fe8554d2) Fable's review of e09da95, both blockers verified: 1. record_pending compared issuing_generation, so the same-id retry work/submit's own errors advise (always from a later act) was ConflictingSubmission. Sameness is now the publication fields only (PendingSelection::same_publication) and the first generation is kept. work/submit records nothing for a submission the board already holds, and the publish-failure error names the minted submission_id. 2. A record whose publication failed counted as another submission, so its staged row held her real retry forever. issued_elsewhere and resolve_pending now count only submissions the board holds published (published_on). Should-fix: 3. TurnCreditCapture::record re-drives held reviews through the one registration replay (reconcile_reviews) when it stages a row carrying a pending submission's issuing generation; the replay counts ProvenanceHeld as deferred, not settled. 4. training.credit.unbound probe when her submission's review arrives with no binding and no pending record. Notes: issued_by derives the identity from the executor (kept beside its connection) instead of a caller-supplied persona; the kernel field doc is generic provenance. Tests: orphan-then-retry binds; same id from a later act keeps the first generation; the shared-row review test publishes its twin on the board. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…hot; re-drives coalesce (card fe8554d2) Codex on 2b95daa: published_on(board) let a lagging view, or a failed publication later retried under the same id, hide a live pending row, so another submission could accept a snapshot carrying its generation. - record_pending supersedes, in its own batch and before publication, any earlier pending row of hers on the same claim that the board does not hold (abandoned_by). A superseded id can never be recorded again (CreditBindingError::Superseded), so it never publishes late. - issued_elsewhere counts every pending row except a superseded one: no board snapshot decides. resolve_pending holds a superseded submission that somehow reached review (Held::Superseded). published_on is gone. - Held-review re-drive is coalesced (redrive.rs): one reconcile_reviews pass per persona at a time; a request during a pass queues exactly one more. Tests: the orphan is superseded by the retry's record, the retry binds, and re-recording the orphan's id is refused as Superseded. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…absent from the board is excluded (card fe8554d2) Codex on b12fb47: A records, pauses before publishing; a concurrent B (two submits in one act's batch) reads a board without A, supersedes it, and A then publishes while excluded. - work/submit holds a per-persona publication fence from before its record to the publication's answer, and reads the board fresh inside it. A second submit of hers sees the first's publication (her own node's store answers her own publish), or its definitive failure. - issued_elsewhere excludes a pending row only when it is superseded AND absent from the consumer's board: a superseded record that landed after all (a cancelled call, an uncertain acknowledgement) counts again. Tests: the fence serializes her submits and not another persona's; a superseded record that lands on the board still holds the submission sharing its row. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…no supersession, no board exclusion (card fe8554d2) Codex on ac059dc, from airc source: a submit_work_in error is not definitive (the daemon may have accepted a frame whose answer was lost or cancelled), so neither a board's absence nor supersession can prove a record never landed. Uncertain records must keep overlapping. - issued_elsewhere counts every pending row, published or not. The board-snapshot filter, supersession (abandoned_by, Superseded) and the publication fence are removed: they were only needed to exclude rows, which is the unsafe move. - An unpublished record resolves by its own same-id retry: work/submit's error names the minted id, and record_pending accepts the same publication from a later act, keeping its first generation. That retry reconciles the outcome instead of guessing it. - Kept from b12fb47: coalesced re-drive of held reviews. Test: an orphan whose answer was lost holds a new-id retry sharing its row (SharedRevision), and its own same-id retry from a later act is accepted. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
|
Re-review of #5386 at df4a849 (Fable, cognition seam owner): PASS. One request below, small enough to fix in this PR. Verified myself:
Request (Joel's point today about types making mismatches unrepresentable):
Then a new publication field can't be forgotten. The typed |
…t out (card fe8554d2) Fable's PASS at df4a849 asked for it. PendingSelection is a Publication (submission, room, card, claim, instance, base, artifact; serde-flattened, so the row shape is unchanged) plus the issuing generation. Publication::of(room, submission) is the one constructor: work/submit records with it, and matches_publication compares the recorded publication with Publication::of(room, board submission). same_publication and the field-by-field comparisons are deleted. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…e real work/submit and work/review (card fcd8d1c1) (#5390) * An ordinary resident submit binds the turn that issued it, through the real work/submit and work/review (card fcd8d1c1) The gate #5386 left before automatic credit recovery may be called proven: the real commands, not storage calls. A resident's submit names no staged revision or generation; her act's caller carries the issuing generation. - work/submit records that generation before publishing and binds nothing yet (bound_staged_revision_id None; PendingCreditBinding holds "issuing-gen"). - A review that arrives before her turn is staged is ProvenanceHeld, never Unbound and never passed. - Once the turn stages, the next review binds exactly the issuing turn's row (staged_revision_id = that row), and the binding reads back from a reopened store. - A same-id retry from a later act keeps the first generation. Training acceptance at the destination stays with the mocked-destination tests (reviewed_credit.rs); this proves the binding a review reaches. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE * The harness covers a second identity's signed pass to acceptance, a lost answer, and a refused record (card fcd8d1c1) Codex on 71d1cab: the first test was a foundation, narrower than the gate. Added, on one Resident fixture (real airc board, real WorkSubmit and WorkReview, real DataModule): - An independent reviewer (a second airc identity on the same wire, same room by name) files a signed pass through work/review: her credit binds the issuing turn and records the decision (AwaitingAcceptance; this executor serves no training destination), and the same exact consumption with the destination answering accepts that row. - A lost answer: the pending record lands, the publication never does; her same-id retry from a later act publishes, keeps the first generation, and a review binds the turn that first issued it. - A refused record (another publication holds the id) refuses the submit; nothing reaches the board. Still not covered here: a checkout-derived artifact (the fixture types it), and process restart (a new runtime rereads the store). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE * Name the harness's claims exactly: a retry from a persisted unpublished record, a mocked destination (card fcd8d1c1) Codex on cad5a56: the seeded-record case is not a cancellation or lost response injected into work/submit's publication, acceptance goes through a MockTransport destination, and a new runtime is not a process restart. The test name and comments now say exactly that. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE * The independent pass is projected through airc's codec; two test identities share no transcript (card fcd8d1c1) CI run 40137174690: the second-identity test failed with WorkCardNotInCurrentRoom. Two airc identities opened for test on one wire root share no transcript without a daemon ("no admissible live route"), so the reviewer never saw the card. The test now takes the submission the real work/submit published, and projects the board holding it plus a Passed review signed by a separate reviewer peer through airc's codec (project_events, extracted from ExactReview::project so both share it). Her credit binds the issuing turn and the exact consumption, with a mocked destination, accepts it. The real work/review run by a second identity needs a daemon and stays on fcd8d1c1. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE * Order the projected events around the real submission's time (card fcd8d1c1) CI run 40137932486: WrongSelection. The projected card and claim used fixed times (1 and 2 ms, a 60 s lease) while the real submission carries its wall-clock submitted_at_ms, so the claim had lapsed before the submission and the review (4 ms) predated it. Anchor created, claimed and reviewed to the submission's own time, inside the lease. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Why (plan: Learning, path step 3; credit lane)
A resident's reviews reach her credit only through a binding from her submission to a staged revision. Binding happened only when
work/submitcarriedstaged_revision_idorgeneration_request_id, and a resident has no reason to know those exist. Kimi's card 13d7e47a took three Failed reviews with no binding. None reached her credit, so no correction could train (Codex's 5090 read, 2026-10-24: 4 staged rows, everyrejected_at_msNULL, 0 bindings).What (head df4a849; replaces the first commit's timestamp selector, which Codex refused)
The first commit bound her newest staged revision by time. That can bind an unrelated newer turn (A makes artifact A, a newer inspection B is staged, submitting A binds B, and a pass credits B). It is removed. The binding now follows the generation that issued the submission.
routing/auth_policy.rs):CallerIdentitygainsissuing_generation. The act seam binds it in-process (issued_by), the same wayhandsis bound, and it is never parsed from params. Envelope fields (contextId,actorKind) share the params' flat JSON (CommandRequest::from_value,handler.rs:250), so a tool input could forge one. The caller identity cannot be forged that way.work/submit): for her own act's caller with no explicit selection, it durably records aPendingCreditBindingbefore publishing. The row holds the publication's room, card, claim, instance, base, artifact and issuing generation. A failed record refuses, as an explicit binding does. Three copies of the credit-connection setup fold intocredit_connection.reviewed/pending_binding.rs, new): a review of an unbound submission resolves the pending row against the submission as the board holds it, through the exact join explicitgeneration_request_idalready uses (generation_row, extracted frombind_submission_generation). It holds the credit asProvenanceHeld, with atraining.credit.provenance_heldprobe, and never passes it, in each of these cases:STAGE_EVERY_ACTS= 4 acts, so failed S and corrected M can share one row. This holds whichever review arrives first.The act seam (continuum-cognition; Fable owns it, written here for Fable's review)
Workspace::decision_generation: the winning verdict's own last served receipt, skipping a retry's fault. It reads from the same selection asdecision(), never from the turn-wide receipts, which are ordered phase-then-faculty, not chronologically.ToolExecutor::issued_by(defaultNone), besidein_hands. The command executor returns a per-batch executor whose caller has the same identity and hands plusissued_by(generation). It borrows the hands; the owning executor keeps the release.apply_acttakes the issuing generation, andsettle_steppassesws.decision_generation(). Hands that cannot stamp run the calls unstamped, as before.Part 2 (a durable unresolved-review gate for old unbound failures) is a separate proposal under discussion with Codex. Already-accepted credit is never revisited.
After Fable's and Codex's reviews (head df4a849)
work/submitrecords nothing for a submission the board already holds, and the publish-failure error names the minted id.reconcile_reviewspass per persona at a time. The replay countsProvenanceHeldas deferred.training.credit.unboundfires when her submission's review arrives with no binding and no pending record.issued_by: it derives the identity from the executor.Limitation, kept on record:
SharedRevision), even after the orphan's same-id retry reconciles it. The fixture tests the hold and the retry's idempotence, not recovery from already-duplicated ids.Tests
An orphan whose answer was lost holds a new-id retry sharing its row; its own same-id retry from a later act is accepted. The same id from a later act keeps the first generation.
an_acts_calls_carry_the_generation_that_issued_them(cognition): two submits in one act both carry the generation; no generation means no stamp; an executor that cannot stamp still acts.the_decision_generation_is_the_winning_verdicts_served_receipt(cognition): picks the winning verdict's served receipt, not a faulted retry and not another faculty's generation.a_tool_input_cannot_name_the_issuing_generation(kernel): a forged field in the JSON never reachesctx.caller.a_pending_binding_resolves_to_the_issuing_turn_or_holds(integration, real DataModule over SQLite, production grid-trust policy):a_row_carrying_another_submissions_issuing_generation_is_shared(pure).Measured
Not compiled locally (no build beside IntelMac's serving), so CI is the compile. Still missing: an end-to-end test through WorkSubmit and a signed board review. After deploy, on the 5090, a resident submission gets a
PendingCreditBindingrow, and its review settles bound orprovenance_heldwith a reason. Owner: Cormac, 24 h after the seam merges.Diff against canary: 13 files, +486 / −238 across both commits.
next_after_submission.rsis 690 lines,consume_review_credit.rs686.🤖 Generated with Claude Code
https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE