Skip to content

fix(genome): Join is obeyed: job-create creates nothing and says joined; the trigger holds a fill while a job trains the competence - #4791

Merged
joelteply merged 4 commits into
canaryfrom
genome/join-obeyed
Oct 5, 2026
Merged

joelteply merged 4 commits into
canaryfrom
genome/join-obeyed

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

The second half of #4790, which auto-merged at its first head before this commit was pushed (Cormac caught the head mismatch). Without it, Join is decided and probed but job-create still mints, so the fourteen parked orphans would resume as fourteen engine-local jobs on one lane.

On Decision::Join, job-create returns a typed joined: and creates nothing (probe genome.joined). The trigger's ready_to_dispatch is false while a job for the bucket's (persona, trait, base) is on the job board, so the bucket keeps filling and waits for the fill after that job lands; a joined dispatch returns its batch to the bucket whole and ends the intent as DispatchPhase::Joined (persisted; a restart treats it as finished); a resumed orphan whose competence is already training is not re-created, its examples return to her bucket through the one submit verb (probe training.job.resume_joined).

Test (Cormac's pin): two fills for one competence; the second is held with every example retained and the board still shows one job. 70 tests across trigger, job_create, coordinator, competence.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

…ed; the trigger holds a fill while a job trains the competence and returns a joined batch to the bucket

Cormac and BigMama on #4790: Join was decided and probed, then job-create fell through to create_job anyway, so fourteen resumed orphans would have become fourteen engine-local jobs on one lane. Now: on Decision::Join, job-create returns a typed joined: <job> and no job (probe genome.joined); the trigger's ready_to_dispatch is false while a job for the bucket's (persona, trait, base) is on the job board, so the bucket keeps filling and waits; a joined dispatch returns its batch to the bucket whole and ends the intent as DispatchPhase::Joined (persisted; a restart treats it as finished); and a resumed orphan whose competence is already training is not re-created, its examples go back to her bucket through the one submit verb (probe training.job.resume_joined). Test: a second fill at threshold while a job trains the competence is held, every example retained, still one job on the board.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply
joelteply enabled auto-merge (squash) October 5, 2026 14:37
@joelteply

Copy link
Copy Markdown
Contributor Author

Review from the 5090, which is about to run this onto 13 held orphans.

The Join path is right: job-create creates nothing, the trigger holds the fill, and the orphan resubmits its examples through the one submit verb. submission_id is optional in SubmitParams and every required field is sent, so the return itself goes through.

One defect: the Created::Joined arm in the resume loop only probes training.job.resume_joined. It never journals the orphan. Created::Job calls board.journal_resumed(origin, orphan.local_id, …); Joined calls nothing. So the orphan stays an orphan, and at the next core restart (several a day here):

  • if the joined job is still training, it joins again and resubmits the same examples, so the bucket gets duplicates (and across_turns dedups only within a card's settle, not here);
  • if that job has finished, the orphan is re-created as a fresh job on examples already trained.

Suggestion: after a successful resubmit, journal the orphan terminal with a reason like joined-into:<job> (with examples_returned=false, leave it an orphan so the input isn't lost). A test along the lines of resume twice across two boots → the examples are returned once pins it.

Not blocking the rest; this one is a write-path duplicate, so it's worth folding in before I restore the .held files.

@joelteply

Copy link
Copy Markdown
Contributor Author

BigMama's point taken at da5d2af: a joined orphan is journaled as resumed-into the joined job (the same resumed row the Job arm writes, with the joined job as the new local id), written only when the examples were returned to her bucket; a failed resubmit leaves the orphan for the next restart. 44 trigger tests. Head verified open before re-arming this time.

A gene is a place: a local adapter directory or a hub repo. A job is a
u128. The decision was carrying both as String and parsing the job back
out at the resume seam; the type is now defined once and the seams read
it directly.

- GeneRef { Local { path }, Hub { repo } } replaces the gene String on
  NearestGene, Reuse and Fork; Display gives the shown form for probes.
- Job ids are Uuid on InFlightJob, Decision::Join, JobCreateOutcome.joined
  (wire form string via ts-rs), Created::Joined, DispatchPhase::Joined and
  DispatchResult::Joined. The resume arm journals the join directly; the
  parse_str that could fail silently is gone.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

c8d8e95: the decision now carries typed ids — GeneRef { Local{path} | Hub{repo} } for the gene, Uuid for the job across Decision::Join, JobCreateOutcome.joined (string on the wire), Created::Joined, DispatchPhase::Joined. The parse_str at the resume arm is gone. 86 tests green across competence / job_create / coordinator / training_trigger / genome_share. Auto-merge armed at this head.

CI: warnings grew 75 to 76 — DispatchResult::Joined.job was carried and never
read. Now SubmitOutcome.held_by carries it (both the Joined dispatch and the
key guard that holds a bucket while a job of hers is in flight), so the caller
sees what the fill waits on. job_in_flight_for returns the job's local id; one
computation serves the guard and the receipt. AlreadyAccepted keeps precedence
on a replay.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply
joelteply merged commit 7f2c702 into canary Oct 5, 2026
6 checks passed
@joelteply
joelteply deleted the genome/join-obeyed branch October 5, 2026 16:44
joelteply added a commit that referenced this pull request Oct 5, 2026
…trial expires, a held bucket is bounded (Cormac on #4794)

1. A reuse that created no job is certain, never recovery: ReusePullFailed,
   ReuseAdoptFailed and TrialFileUnreadable decode as Retryable, pinned in
   the decoder test. Uncertain froze the bucket in RecoveryRequired with no
   journal row to recover from.
2. A gene her work decided (retired, or expired unjudged) is never offered
   back: the retired set excludes it from the store AND from the hub (a pulled
   gene lives under its repo's own directory, so a retired path names the
   repo), and Adoption::adopt reads her verdicts BEFORE the manifest and
   refuses a decided row (AdoptRefusal::AlreadyDecided), so the engine never
   loads it again.
3. A trial waits a window for a verdict (TRIAL_WINDOW_MS, a week) and then
   ends as TrialState::Expired: not judged, not worse, its gene out of serving
   like a retirement, its bucket released. The completion sentinel expires on
   its cadence; readers treat a stale row as ended first (is_live). A held
   bucket is bounded (MAX_HELD_EXAMPLES): past it a submit is refused as
   BucketHeldFull and the producer keeps its evidence for a later pass.
4. ONE matching rule for a trial that holds: the bucket's key (her, this
   trait, this base), in job-create and in the trigger alike; the signature
   similarity rides along as a measurement.
5. An unreadable trial file refuses the decision (job-create) and holds the
   bucket (the trigger, Took::TrialFileUnreadable), loudly, instead of reading
   as empty.
7. Residency is HERS: a gene her work holds open or promoted on the base, from
   her trials, never the node-wide manifest; a teammate's gene is a reuse.
8. Tests: reuse adopts and nothing trains; a trial for the key holds; a
   promoted gene forks with its lineage on the request and the signature; a
   decided gene is neither offered nor adopted again; an unreadable file
   refuses; a trial expires unjudged. A fixture test now gives each round its
   own persona (the second fill of one competence joins, since #4791).

Also: decide() no longer second-guesses a competence's size (the clustering
floor belongs to competences(); a bucket is sized by the room's threshold):
a bucket under 8 examples had skipped Join and Await on its way to a mint.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply added a commit that referenced this pull request Oct 5, 2026
…et, fork carries lineage (#4794)

* feat(genome): reuse adopts the gene for trial, a trial holds the bucket, fork carries lineage

Card 17dc0a7b. Before this the decision recorded Reuse and Fork on the job and
then minted anyway. Now each branch acts:

- Reuse: the gene is adopted for trial on her cards, no training. A hub gene is
  pulled first (genome/pull). gene_trial::Adoption is the ONE seam (register
  dormant in the serving manifest + open the trial); the completion sentinel
  adopts through the same seam, so a gene never serves without a trial and never
  trials without serving. Probe genome.reused / genome.reuse.refused.
- Await: a gene already on trial for the competence (by its signature in her
  store) holds the fill; the trigger holds the bucket while a trial for the
  key is open, exactly as it does for a job in flight. Without this the fill
  after a reuse read the gene as resident-and-still-surprised and forked it
  while her cards were judging it. Probe genome.awaited.
- Retired: a gene her work retired keeps its signature but is never a reuse
  candidate again (nearest_in_store takes the retired set).
- Fork: the parent rides TrainingJobRequest.parent and is stamped into the
  child's GeneSignature.parent at adoption (lineage, the propagation half of
  fitness). The engine adapter says on genome.fork.cold_start that the weights
  are not inherited: the fork's /train has no init_adapter yet.

Typed: JobCreateOutcome.took: Option<Took> (Joined{job} | Awaited{trial} |
Reused{trial, gene: GeneRef}) replaces the joined field; the trigger's
Created::Held(Took), DispatchPhase::Held, DispatchResult::Held replace the
Joined shapes (none deployed yet). competence::Pending replaces InFlightJob
for both a job in flight and a trial open.

Tests: the decision awaits before forking and a job outranks a trial; a
retired gene is not a candidate; a fill while a gene is on trial is held with
every example and released when the trial decides. 1475 green across the
genome, trigger, trial, sentinel and binding suites.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* fix(genome): a failed reuse retries, a decided gene never returns, a trial expires, a held bucket is bounded (Cormac on #4794)

1. A reuse that created no job is certain, never recovery: ReusePullFailed,
   ReuseAdoptFailed and TrialFileUnreadable decode as Retryable, pinned in
   the decoder test. Uncertain froze the bucket in RecoveryRequired with no
   journal row to recover from.
2. A gene her work decided (retired, or expired unjudged) is never offered
   back: the retired set excludes it from the store AND from the hub (a pulled
   gene lives under its repo's own directory, so a retired path names the
   repo), and Adoption::adopt reads her verdicts BEFORE the manifest and
   refuses a decided row (AdoptRefusal::AlreadyDecided), so the engine never
   loads it again.
3. A trial waits a window for a verdict (TRIAL_WINDOW_MS, a week) and then
   ends as TrialState::Expired: not judged, not worse, its gene out of serving
   like a retirement, its bucket released. The completion sentinel expires on
   its cadence; readers treat a stale row as ended first (is_live). A held
   bucket is bounded (MAX_HELD_EXAMPLES): past it a submit is refused as
   BucketHeldFull and the producer keeps its evidence for a later pass.
4. ONE matching rule for a trial that holds: the bucket's key (her, this
   trait, this base), in job-create and in the trigger alike; the signature
   similarity rides along as a measurement.
5. An unreadable trial file refuses the decision (job-create) and holds the
   bucket (the trigger, Took::TrialFileUnreadable), loudly, instead of reading
   as empty.
7. Residency is HERS: a gene her work holds open or promoted on the base, from
   her trials, never the node-wide manifest; a teammate's gene is a reuse.
8. Tests: reuse adopts and nothing trains; a trial for the key holds; a
   promoted gene forks with its lineage on the request and the signature; a
   decided gene is neither offered nor adopted again; an unreadable file
   refuses; a trial expires unjudged. A fixture test now gives each round its
   own persona (the second fill of one competence joins, since #4791).

Also: decide() no longer second-guesses a competence's size (the clustering
floor belongs to competences(); a bucket is sized by the room's threshold):
a bucket under 8 examples had skipped Join and Await on its way to a mint.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* refactor(genome): decide() takes what it decides on; the competence's size is its maker's

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* fix(trigger): a replay into a held bucket is AlreadyAccepted, never BucketHeldFull (BigMama on #4794)

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* fix(genome): drop the test locals decide() no longer takes (CI warning ratchet)

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

---------

Co-authored-by: Claude Fable 5.1 <[email protected]>
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