Skip to content

goal 8: a gene is judged only on tasks it never trained on; the task a turn worked is recorded with its card (card 67af4fca) - #5183

Merged
joelteply merged 8 commits into
canaryfrom
67af4fca/a-reviewed-correction-holds-out-a-task-i
Oct 19, 2026
Merged

joelteply merged 8 commits into
canaryfrom
67af4fca/a-reviewed-correction-holds-out-a-task-i

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

The reviewed and graded credit paths trained every example with no record of
which graded task it came from in a form both shared: the reviewed path wrote
selection.instance, the graded and live-turn path only cardId. A gene could be
A/B-judged on the task it trained on, and memorisation would read as learning
(ONE-RESIDENT section 10.2).

  • cognition/held_out.rs (new owner): CardTask (Task(set, task) | NotATask),
    read from the card title by the one bench-title parser; stamp_examples writes
    it into every example's metadata; trained() reads a job's examples back;
    held_out(set, tasks, trained) keeps the tasks the gene never trained on.
    A card-linked example with no task field (staged before this change) counts
    as unknown, so its held-out set is never reported clean (Astra's condition);
    ordinary work (NotATask) and live conversation do not count against it.
  • CapturedCredit captures the task when a turn roots at its card;
    StagedCredit.task carries it (json column, serde default: None on old rows,
    added by the ORM's column evolution); staged_submission_params, the one
    builder both credit paths use, stamps it onto every example.
  • The bench card-title grammar (dispatch_card_key, bench_card_key,
    dispatch_card_title, parse_card_title) moves from commands/benchmark into
    cognition/bench_title.rs, the mind ring that reads it; callers repointed.
    persona/act_question.rs and persona/card_holder.rs no longer import upward.
  • The credit stamp (CreditRole, OutcomeStamp, ServedProvenance,
    CapturedCredit, ClaimReceipt, SettlementVerdict) moves whole out of
    training_producer.rs into training_producer/stamp.rs, re-exported.

source-hygiene (IntelMac, 37/37): BASELINE_LINES_OVER 158,255 -> 158,016,
BASELINE_UPWARD_IMPORTS 256 -> 255, both measured by the ratchets.
Tests: held_out (2) and a_settled_row_carries_its_task_onto_its_examples.
NOT compiled on IntelMac (fleet rule: no core builds here); CI compiles and
runs them.

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

…a turn worked is recorded with its card (card 67af4fca)

The reviewed and graded credit paths trained every example with no record of
which graded task it came from in a form both shared: the reviewed path wrote
selection.instance, the graded and live-turn path only cardId. A gene could be
A/B-judged on the task it trained on, and memorisation would read as learning
(ONE-RESIDENT section 10.2).

- cognition/held_out.rs (new owner): CardTask (Task(set, task) | NotATask),
  read from the card title by the one bench-title parser; stamp_examples writes
  it into every example's metadata; trained() reads a job's examples back;
  held_out(set, tasks, trained) keeps the tasks the gene never trained on.
  A card-linked example with no task field (staged before this change) counts
  as unknown, so its held-out set is never reported clean (Astra's condition);
  ordinary work (NotATask) and live conversation do not count against it.
- CapturedCredit captures the task when a turn roots at its card;
  StagedCredit.task carries it (json column, serde default: None on old rows,
  added by the ORM's column evolution); staged_submission_params, the one
  builder both credit paths use, stamps it onto every example.
- The bench card-title grammar (dispatch_card_key, bench_card_key,
  dispatch_card_title, parse_card_title) moves from commands/benchmark into
  cognition/bench_title.rs, the mind ring that reads it; callers repointed.
  persona/act_question.rs and persona/card_holder.rs no longer import upward.
- The credit stamp (CreditRole, OutcomeStamp, ServedProvenance,
  CapturedCredit, ClaimReceipt, SettlementVerdict) moves whole out of
  training_producer.rs into training_producer/stamp.rs, re-exported.

source-hygiene (IntelMac, 37/37): BASELINE_LINES_OVER 158,255 -> 158,016,
BASELINE_UPWARD_IMPORTS 256 -> 255, both measured by the ratchets.
Tests: held_out (2) and a_settled_row_carries_its_task_onto_its_examples.
NOT compiled on IntelMac (fleet rule: no core builds here); CI compiles and
runs them.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
joelteply and others added 3 commits October 19, 2026 04:40
…the final tree (158,014)

My first measurement ran before the last two edits; the test-only import in
commands/benchmark.rs put it at 158,017 in CI (job 117989441961). Three
pre-existing double blank lines in benchmark.rs are removed, and the baseline
is the number source-hygiene prints for this exact tree.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…ds its task out (Astra on #5183)

Astra at 276f767:
- trained() read an example with no metadata, {} or no cardId as "no task",
  so a legacy or imported example made a held-out set look clean. Now only an
  explicit record counts: a task field (Task, ReviewOf or NotATask), or an
  UNLINKED producer's source with no card. Everything else is unknown, and
  is_known_clean() is false.
- A [review <parent8>] <instance> card parsed as NotATask, although her review
  saw that task's fix. CardTask::ReviewOf(instance) now holds it out in every
  set (the review title names no set; matching every set can only hold out
  more).

The unlinked record is the `source` already on the wire (received-lesson,
speech-discipline), now ONE list in training_producer (UNLINKED_SOURCES) that
the producers write and the judge reads. No new field is added to unlinked
examples: a replayed received lesson keeps its exact bytes, where a changed
payload under the same submission id is refused as SubmissionConflict
(modules/training_trigger/durable.rs:954). stamp_examples(None) removes any
task field, so a legacy row reads unknown.

The review title writer and parser move beside the bench ones into
cognition/bench_title.rs; persona/act_question.rs and card_ledger_fact.rs no
longer import them upward.

Test only_an_explicit_record_proves_an_example_clean covers no metadata, {},
a non-unlinked source, an unlinked source on a card, a malformed field, a
legacy row, a mixture of a known task with an unknown, and a review.
source-hygiene 37/37 on IntelMac on this tree: lines past 1000 158,014 ->
158,005, upward imports 255 -> 254. Not compiled here; CI compiles.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
joelteply and others added 3 commits October 19, 2026 05:41
…ean (Astra on #5183)

HeldOut.tasks was public, so a future A/B caller could take the candidate
tasks of a set whose contamination is unknown. The tasks are now private and
reachable only through HeldOut::known_clean() -> Result<&[&EvalTask], usize>,
whose Err carries the count of unrecorded examples to report instead of a
lift. Its doc bounds the claim: recorded training provenance only.
source-hygiene 37/37 (158,005 unchanged). Not compiled here.

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

known_clean() read a public unknown count, so a caller could zero it and take
the tasks; Trained's fields were public too, so a hand-made clean one could be
passed in. Every field of both is now private: Trained is built only by
trained(), HeldOut only by held_out(), and the counts are read through
excluded(), unknown() and tasks(), which the tests use too.
source-hygiene 37/37 on IntelMac. Not compiled here.

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

The doc now also states the boundary as it is: the result cannot be edited
clean, and it describes only the examples it was given, so the caller passes
the job's complete set.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…-correction-holds-out-a-task-i

# Conflicts:
#	core/source-hygiene/src/file_size.rs
@joelteply
joelteply merged commit 579381e into canary Oct 19, 2026
9 checks passed
@joelteply
joelteply deleted the 67af4fca/a-reviewed-correction-holds-out-a-task-i branch October 19, 2026 15:09
@joelteply

Copy link
Copy Markdown
Contributor Author

Codex review at a01033b: verified selected-card capture through optional StagedCredit JSON and stamping after lived-example replacement; legacy and malformed provenance remains unknown; private HeldOut fields require known_clean; review-task exposure excludes matching instances across sets. All exact-head CI checks passed before merge. This is approval of recorded-provenance plumbing, not proof of clean ancestor training or live learning. The separate evaluation integration in #5187 still has job/gene and task-set binding findings.

joelteply added a commit that referenced this pull request Oct 19, 2026
…g job never trained on (card 9f0ba854)

Step (c), the interim explicit form Astra recommended: no autonomous trigger,
no sentinel. CognitionEvalParams gains heldOutOfJob, the training job
directory of the gene under test. With it, the A/B runs only on the tasks of
the named evalSet that the job never trained on: cognition::held_out::for_job
reads the job's own request.json through the one reader
(genome::fine_tuning::job_dir::read_job_request, #5185), takes the trained
tasks from its examples (held_out::trained), and keeps the held-out set only
through known_clean(). It is refused, with the reason, when the request has
no examples, when any example's task is unknown, when the gene trained on
every task of the set, or when gene or evalSet is missing.

The command's wire contract (EvalGene, CognitionEvalParams, EvalTaskResult,
InfraUnavailable, CognitionEvalResult) moves whole, unchanged, out of
cognition/eval.rs into cognition/eval/wire.rs, re-exported, so the file-size
ratchet falls: 157,971 -> 157,608 (measured on this tree after `cargo clean -p
source-hygiene`; the shared target had been scanning another worktree).

Test: a_job_names_the_tasks_its_gene_may_be_judged_on (held-out kept, and the
three refusals). source-hygiene 37/37 on IntelMac. Not compiled here.
Stacked on #5183 (task identity + held_out).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
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