Skip to content

The teacher's fix loop stops on observed grader progress, not a count: a typed grader outcome, failure identity, no 180-char error cut (DEFAULT_MAX_FIX_ITERS deleted; card a4bbae0a) - #5662

Merged
joelteply merged 2 commits into
canaryfrom
cormac/teach-progress-stop
Oct 31, 2026
Merged

joelteply merged 2 commits into
canaryfrom
cormac/teach-progress-stop

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

genome/teach.rs DEFAULT_MAX_FIX_ITERS = 4 was the last unfixed touched-file blocker on the
reasoning-budget field (the cut-think chain: #5644 <- #5645 <- the field). Design agreed with Fable
and Codex 2026-10-31.

  • gym_grader: grade / grade_file return a typed Grade (stage Refused|Compile|Run|Pass, the
    failure set by identity, the failing test line, the whole text). Compile failures come from
    rustc --error-format=json (identity = code + message); a run failure is located against the
    generated main (identity = the test line, so a later failing assertion is progress whatever the
    candidate's length). trunc_stderr's 180-char head cut is deleted: the teacher reads the whole
    error. test_grade / test_grade_file stay (bool, String) projections for callers that measure
    nothing, so they are untouched.
  • teach: AttemptProgress continues a task only while its failure set is new AND it improves the best
    (stage, phase, measure): a run beats a compile; within a compile, getting past the parser (all
    errors coded) beats fewer errors, so a syntax fix that exposes three type errors is progress
    (Codex); then fewer errors; then a later failing test line. ONE sideways step per best level. A
    repeat, a regression, a second sideways step or a refusal ends the task, with the reason in its
    outcome. Terminates: the level rises finitely, one sideways step per level. max_fix_iters is an
    optional caller cap (Option through dreaming, academy and serving); no default.
  • Disk classes (touched files leave clean): the grader's scratch goes through the eval-roots class
    (ClassWriter::of, one owner directory per grade); teach run ledgers through a new progress class
    (kept, with an eviction decision) and ONE writer, genome::teach::progress::write_teach_ledger, used
    by the live rows and dreaming's terminal row; academy's eval-run marker through eval-roots.
  • Kernel (Fable's design): prepare_writer_fixture's test registry holds the real standard classes
    under its temporary home, and tracked_dir / ClassWriter::of resolve through writer_registry(), so a
    test in any crate gets the real class layout by calling the one existing fixture; boot's set-once
    TRACKED_DIRS and production are untouched (an unregistered class is still refused).

Tests: progress (converging, a repeat whatever its text, one sideways step then end, oscillation,
past-the-parser with more errors, refusal and regression end) and a real-rustc typed grade (E0308
compile identity with the whole text; a failing second assertion is test line 2 after 30 lines of
padding). Mutations: dropping the repeat check fails 1, an absolute panic line fails 1.

Receipts (enrico, 2026-10-31): continuum-genome --lib 345 + gym_grader 13, continuum-kernel --lib
1,336 (Metal skipped: wedged driver), serving teacher test passes, cargo check of academy, dreaming,
genome, kernel, serving with tests clean, ratchets exit 0. Two serving budget tests fail on IntelMac
with or without this change (host-dependent, card c4d84be3's class; CI's Linux serving job passes).

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

…: a typed grader outcome, failure identity, no 180-char error cut (DEFAULT_MAX_FIX_ITERS deleted; card a4bbae0a)

genome/teach.rs DEFAULT_MAX_FIX_ITERS = 4 was the last unfixed touched-file blocker on the
reasoning-budget field (the cut-think chain: #5644 <- #5645 <- the field). Design agreed with Fable
and Codex 2026-10-31.

- gym_grader: `grade` / `grade_file` return a typed `Grade` (stage Refused|Compile|Run|Pass, the
  failure set by identity, the failing test line, the whole text). Compile failures come from
  rustc --error-format=json (identity = code + message); a run failure is located against the
  generated main (identity = the test line, so a later failing assertion is progress whatever the
  candidate's length). trunc_stderr's 180-char head cut is deleted: the teacher reads the whole
  error. `test_grade` / `test_grade_file` stay (bool, String) projections for callers that measure
  nothing, so they are untouched.
- teach: AttemptProgress continues a task only while its failure set is new AND it improves the best
  (stage, phase, measure): a run beats a compile; within a compile, getting past the parser (all
  errors coded) beats fewer errors, so a syntax fix that exposes three type errors is progress
  (Codex); then fewer errors; then a later failing test line. ONE sideways step per best level. A
  repeat, a regression, a second sideways step or a refusal ends the task, with the reason in its
  outcome. Terminates: the level rises finitely, one sideways step per level. max_fix_iters is an
  optional caller cap (Option<u32> through dreaming, academy and serving); no default.
- Disk classes (touched files leave clean): the grader's scratch goes through the eval-roots class
  (ClassWriter::of, one owner directory per grade); teach run ledgers through a new `progress` class
  (kept, with an eviction decision) and ONE writer, genome::teach::progress::write_teach_ledger, used
  by the live rows and dreaming's terminal row; academy's eval-run marker through eval-roots.
- Kernel (Fable's design): prepare_writer_fixture's test registry holds the real standard classes
  under its temporary home, and tracked_dir / ClassWriter::of resolve through writer_registry(), so a
  test in any crate gets the real class layout by calling the one existing fixture; boot's set-once
  TRACKED_DIRS and production are untouched (an unregistered class is still refused).

Tests: progress (converging, a repeat whatever its text, one sideways step then end, oscillation,
past-the-parser with more errors, refusal and regression end) and a real-rustc typed grade (E0308
compile identity with the whole text; a failing second assertion is test line 2 after 30 lines of
padding). Mutations: dropping the repeat check fails 1, an absolute panic line fails 1.

Receipts (enrico, 2026-10-31): continuum-genome --lib 345 + gym_grader 13, continuum-kernel --lib
1,336 (Metal skipped: wedged driver), serving teacher test passes, cargo check of academy, dreaming,
genome, kernel, serving with tests clean, ratchets exit 0. Two serving budget tests fail on IntelMac
with or without this change (host-dependent, card c4d84be3's class; CI's Linux serving job passes).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…e grader's scratch is the eval-roots class (CI on #5662: 'disk class eval-roots is not registered')

Receipt (enrico, 2026-10-31T17:34Z): continuum-dreaming --features metal --lib genome::teach 10 passed, including candidate_replay_preserves_acceptance_without_teacher_regeneration (failed on CI without the call); ratchets exit 0.

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

Copy link
Copy Markdown
Contributor Author

APPROVE #5662 at exact head e1e23ca (Fable), termination verified on the bound, not the comment. level is lexicographic (u8 stage, u8 past-parser, i64): within Compile a rise needs fewer errors (or crossing the parser once), within Run a later failing test line; each component is bounded, so best can strictly rise only finitely often. sideways_spent re-arms only on a strict rise, so each best level grants exactly one sideways step, never renewed by a new diagnostic. seen refuses any repeated failure SET (BTreeSet of identities: code: message for compile, the panicking test line or panic message for run; never raw text), so a repeat at any level ends the task. A Refused grade ends it (no level). So attempts <= rises + one sideways per level: the task always ends, bounded by its own errors, no count. DEFAULT_MAX_FIX_ITERS deleted; a caller's explicit cap stays a caller cap. The grader's whole text is kept (the 180-char cut gone) and the teacher reads it whole.

@joelteply

Copy link
Copy Markdown
Contributor Author

APPROVE #5662 at exact head 5824100 (Fable). Delta from e1e23ca read: one line, the dreaming bridge test calls prepare_writer_fixture() before grading (the registry's existing test owner), executed 10/10 on enrico. Termination verdict unchanged.

@joelteply
joelteply merged commit 58d757b into canary Oct 31, 2026
76 of 79 checks passed
@joelteply
joelteply deleted the cormac/teach-progress-stop branch October 31, 2026 17:51
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