Skip to content

fix(genome): a completed job holds its competence through adoption (card cb14cc13) - #4802

Merged
joelteply merged 4 commits into
canaryfrom
genome/adoption-holds-the-competence
Oct 6, 2026
Merged

joelteply merged 4 commits into
canaryfrom
genome/adoption-holds-the-competence

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Cormac's point 6 on #4794, as its own PR so the words at #4794/#4796 stand. Stacked on #4798.

The sentinel claimed a job off the board at Completed, then converted (minutes), registered, opened the trial, stamped. In that window nothing held the bucket and the store had no signature: a second gene could mint for the same competence.

  • TrainingJobBoard::adopting + pending() (in flight ∪ adopting) for the gates; snapshot() stays the sentinel's poll set. In memory only.
  • AdoptionHold guard in the chain: dropped on every path out, adoption_done. The no-executor path releases explicitly.
  • Signature stamped BEFORE the trial opens.
  • Test: a fill during adoption joins; after adoption_done it decides again.

Receipt to look for: training.trigger.held with took=joined while a sentinel convert is in flight.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

@joelteply

Copy link
Copy Markdown
Contributor Author

APPROVED at f090d83, pending its lib-test check. This closes point 6. A Completed claim moves the job into adopting, and gates read pending() (in flight plus adopting). The sentinel polls snapshot() alone, so no tick re-handles. The AdoptionHold drop guard releases on every path out of the chain, panics included. I checked every claim site: only the sentinel's Completed arm inserts, and it always spawns the chain (the no-executor path releases explicitly), so nothing can strand in adopting. Stamping before the trial opens is the right order. One nit, not blocking: in claim(), insert into adopting BEFORE removing from jobs. Today there's a gap between the two DashMap ops where pending() sees neither, and a fill landing in it would mint beside the job. Inserting first means a reader at worst sees the job twice, which only means joining it.

@joelteply

Copy link
Copy Markdown
Contributor Author

APPROVED at 64dbd81, pending its lib-test check. ad5b2ac is patch-identical to the f090d83 I approved. 538f90a serializes the typed reason inside journal_returned and records a failure as its own value, never as null. The §6 doc update matches what merged tonight. My earlier ordering nit still stands, not blocking: in claim(), insert into adopting before removing from jobs, so a pending() read can't see neither.

Base automatically changed from genome/train-share-ppm to canary October 6, 2026 01:44
@joelteply
joelteply enabled auto-merge (squash) October 6, 2026 12:01
@joelteply
joelteply disabled auto-merge October 6, 2026 13:21
@joelteply
joelteply force-pushed the genome/adoption-holds-the-competence branch from 64dbd81 to 045ca31 Compare October 6, 2026 13:21
joelteply and others added 4 commits October 6, 2026 08:41
…ard cb14cc13)

The sentinel claimed a job off the board the instant it saw Completed, then
converted (minutes for an MLX export), registered, opened the trial and
stamped the signature. In between: not on the board, no trial yet, no
signature in the store. A full bucket in that window minted a second gene
for the same competence (Cormac on #4794, point 6).

- TrainingJobBoard keeps completed jobs in an `adopting` set; `pending()`
  (in flight + adopting) is what the gates read (held_for, job-create's
  join); `snapshot()` stays the sentinel's poll set. In memory only: a core
  that dies mid-adoption loses the adoption as before, and the ledger's
  terminal row already stands.
- The chain holds an AdoptionHold guard; dropping it on any path out
  (adopted or refused) calls adoption_done. The no-executor path releases
  explicitly.
- The signature is stamped BEFORE the trial opens, so from the moment the
  gene is live a fill finds it by distance.
- Test: a fill during adoption joins the job; after adoption_done the
  competence decides again.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…nal_returned (Cormac on #4802)

journal_returned takes the held-by reason by reference since this PR (it serializes it
itself); the operator return verb landed on canary after with a by-value json!.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply
joelteply force-pushed the genome/adoption-holds-the-competence branch from 045ca31 to ade7dd1 Compare October 6, 2026 13:44
@joelteply

Copy link
Copy Markdown
Contributor Author

APPROVED at ade7dd1.

Since 045ca31: a rebase onto canary plus ade7dd1, the & at return_.rs:89 that fixes the compile break. All 7 checks are SUCCESS, including cargo test -p continuum-core --lib and windows-msvc.

@joelteply
joelteply enabled auto-merge (squash) October 6, 2026 15:52
@joelteply
joelteply merged commit ce67cf1 into canary Oct 6, 2026
7 checks passed
@joelteply
joelteply deleted the genome/adoption-holds-the-competence branch October 6, 2026 15:54
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