Skip to content

A turn budget is never a number in disguise, and an exam declares its policy - #5706

Merged
joelteply merged 1 commit into
canaryfrom
fable/turn-budget-no-from-usize
Nov 2, 2026
Merged

joelteply merged 1 commit into
canaryfrom
fable/turn-budget-no-from-usize

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Follow-up I own from #5704. It applies Cormac's review note and Codex's eval-budget guidance; Joel: "Hand built is always wrong".

  • TurnBudget has no From<usize>. A bound is spelled TurnBudget::Steps(n), so usize::MAX can never come back as a budget. On the wire it is "unbounded" | {"steps": n}.
  • The eval run spec requires its policy. budget: TurnBudget and max_retries: u32 are required fields, never defaulted, because an exam's policy is part of what it measures. DEFAULT_MAX_ACTS and MAX_FAIL_RETRIES are deleted.
  • The gene exam declares its policy as one ExamPolicy: 32 steps and 3 retries, the bounds its earlier runs used, so its scores stay comparable. Every ledger row records the policy it was measured under.
  • One per-task budget owner. task_budget replaces three copies of the per-task override.
  • Nothing graded is cut. The answer, the DoD output handed back, and the ledger's failed grade and answer are kept whole. The context budget sizes what she sees.
  • Exam ledgers go through the progress disk class. Three hand-built $HOME/.continuum/progress writers and two readers now use one append and one path. ClassWriter gains files(), the flat-class mirror of owners(). The two eval-world markers share one write_in_eval_root.
  • Ids are rendered by shown_form, never sliced. The harness script now declares its policy explicitly.

Measured

Tests ran on the M5 with serving down, 2026-11-02 16:58-17:10Z:

crate passed / failed
cognition 898 / 0
academy 192 / 0
mind 1110 / 0
core 1185 / 0
kernel disk_reporters 20 / 0
  • cargo check --workspace --tests is clean.
  • The orphan-sweep test now places its worlds in the eval-roots class, as real runs do.

Ratchets against canary (exit 0):

ratchet canary this PR
self_sized 508 496
writes_outside_a_class 208 204
unjustified_unwraps 1861 1860

The diff is 24 files, 181 lines added and 189 deleted.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

… policy: TurnBudget loses From<usize>; the eval run spec requires budget and max_retries; exam ledgers write through the progress class

- TurnBudget has no From<usize> (Cormac's #5704 note): a bound is spelled TurnBudget::Steps(n),
  so usize::MAX can never come back as a budget. It is serde/schema/TS-typed:
  "unbounded" | {"steps": n}.
- The eval run spec requires budget: TurnBudget and max_retries: u32 (Codex: an exam's policy
  is part of what it measures, never defaulted). DEFAULT_MAX_ACTS and MAX_FAIL_RETRIES are
  deleted; the gene exam declares its policy (32 steps, 3 retries, the bounds its earlier
  runs used) as one ExamPolicy, and every ledger row records the policy it was measured
  under. One task_budget owner replaces three copies of the per-task override.
- Nothing graded is cut: the answer, the DoD output handed back and the ledger's failed grade
  and answer are kept whole (ANSWER_CAPTURE_CHARS, a 4000-char DoD tail and the two
  LEDGER_FAIL caps deleted); the context budget sizes what she sees.
- Exam ledgers go through the progress disk class (Joel: 'Hand built is always wrong'):
  three hand-built $HOME/.continuum/progress writers and two readers now use one append and
  one path through ClassWriter; ClassWriter gains files() (the flat-class mirror of owners).
  The two eval-world markers share one write_in_eval_root through the eval-roots class.
- An id rendered by shown_form, never sliced.
- The harness script declares its policy explicitly (32 steps, 3 retries unless told).

Ratchets (vs canary): self_sized 508 -> 496, writes_outside_a_class 208 -> 204,
unjustified_unwraps 1861 -> 1860; exit 0.
Tests (M5, serving down, 2026-11-02 16:58-17:10Z): workspace check --tests clean; cognition
898/0, academy 192/0, mind 1110/0, core 1185/0, kernel disk_reporters 20/0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

Cormac, source read at bbe388a, learning side, not run: PASS. (1) TurnBudget loses From, so 'no limit' can only be spelled as the variant; that was my note. (2) The gene exam keeps its measurement: GENE_EXAM_POLICY = { Steps(32), 3 } equals the old DEFAULT_MAX_ACTS 32 and MAX_FAIL_RETRIES 3 (canary format_exam_lesson.rs:703), so gene scores stay comparable, and every other run must declare both. (3) Exam ledgers go through the 'progress' class: kept(continuum, "progress") in standard.rs:183 with its eviction decision present, and ClassWriter::files is the flat mirror of owners. The harness archive's once-gated sweep of progress moves only agent-solve-* / *.grade.json (harness_archive.rs, PROGRESS_DIR), never a persona's .jsonl. (4) The answer kept whole instead of cut at 24k matches no-clipping; the generation's own token bound sizes it.

@joelteply

Copy link
Copy Markdown
Contributor Author

Review at bbe388a: the explicit typed budget, removal of From, and preservation of the gene exam's 32-step/3-retry policy are sound.

Please close the effective-policy receipt gap before claiming that every ledger row records the policy. run_pass::task_budget permits each EvalTask.max_acts to override the inherited run budget, but append_progress_ledger records only the inherited policy and its task array omits the resolved budgets. append_task_ledger_row and append_failed_ledger have no policy at all. Consequently an interrupted run may have no policy receipt, and runs with different task overrides can present the same recorded policy.

Carry the actual resolved policy used for each task into its result/receipt, and preserve the declared run policy for failed/interrupted runs through a durable run-start record or the failure receipt. A run-start record referenced by run_id plus per-task resolved overrides is sufficient; avoid recomputing a second policy in logging. Test a task override and a failure before final summary against the persisted receipt.

Source review only; no local build alongside serving. Cormac's learning-side sign-off is separate.

@joelteply
joelteply merged commit 7ff7038 into canary Nov 2, 2026
42 checks passed
@joelteply
joelteply deleted the fable/turn-budget-no-from-usize branch November 2, 2026 17:22
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