Skip to content

chore(recipe): slice 13, drop the dead-code allow and correct the recipe flag help (PMAT-5316) - #7143

Merged
noahgift merged 40 commits into
mainfrom
R075h-recipe-13b
Nov 16, 2026
Merged

noahgift merged 40 commits into
mainfrom
R075h-recipe-13b

Conversation

@noahgift

@noahgift noahgift commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

What

Measured (2026-11-16, head b1c990b)

  • cargo clippy -p apr-cli --lib -- -D warnings: rc 0, with the allow removed.
  • cargo test -p apr-cli --lib -- recipe finetune: rc 0, 169 passed.
  • python3 scripts/ci/fail_fast.py ids: rc 0. cargo fmt -p apr-cli -- --check: rc 0.
  • The help text keeps its line count, so the model_ops_commands.rs line references in docs/audits/surface_audit.csv do not move.
  • Head c090708 changes one comment line in the contract after b1c990b; fail_fast.py ids rc 0 and the YAML loads. Clippy and the tests were not re-run at c090708.

Measured (2026-11-16, head 10ab951, after merging main)

  • Merge conflicts in 3 files, all this slice's own wording against slice 12's older text; this slice's side kept.
  • cargo test -p apr-cli --lib finetune: 111 passed. cargo test -p apr-cli --lib train_recipe: 41 passed.
  • cargo clippy -p apr-cli --lib -- -D warnings: rc 0. cargo fmt --all -- --check: rc 0.
  • cargo test -p aprender-contracts --lib: 2403 passed. cargo deny check advisories: ok.
  • bash scripts/check_readme_claims.sh: rc 1, only on main's stale README contract count (1731 vs 1734), which fix(readme): contract count 1731 -> 1734 (main red since #7128) #7162 fixes. This PR does not touch README.md.

PRE-FLIGHT

  • GATE CHANGE: no. Comments, help text, one audit line reference and one lint attribute; no workflow, guard or gate file.

Review history

  • b1c990b: Opus FAIL (non-author). The contract said --verbose and --quiet are "not passed to the run", which reads as if they do nothing; both act through the process-wide setting. Fixed in c090708 by rewording that line.
  • c090708: Opus PASS (non-author, same family as the author: degraded: same-family). Read-only review; it ran no build.
  • Notes from both rounds, not fixed here: 12 of the 19 flags refused beside --recipe are not recipe fields (--merge, --task, --role and others), so "the flags whose value it carries" is narrower than the list; the new module doc calls train_recipe.rs "the schema and its validator only" though it also builds the receipt and hashes files; -q silences stdout only, so the receipt lines on stderr still print.

Known limits

  • Not taken up from that review: FALSIFY-APR-RECIPE-001 also cites the dispatch test, which checks exit 5 and not a missing eval (the other tests it cites check the missing eval).
  • docs/audits/pp-066-rescope-quorum.md still cites model_ops_commands.rs:67 for --gpu-backend, which is at line 94 after feat(apr-cli): apr finetune --recipe flag and example recipe (R-1 slice 12) #7141. It is a quorum record and is left as written.
  • contracts/qlora-rank-aware-lr-v1.yaml cites model_ops_commands.rs:38; it was not checked or changed here.
  • Clippy over the test modules, the cli_commands and surface-audit tests and scripts/check_contract_test_binding.sh were not run here; CI runs them.
  • After this slice the seed and the eval are still validated and hashed only; apr finetune does not apply them. Declarative recipes for finetune, distill and merge (CRUX-001/002) #5316 stays open for that.

Round at 7ba194d (2026-11-16)

  • CI pr-light was red on scripts/check_dogfood_coverage.sh G2.1: the branch changes crates/apr-cli/src/model_ops_commands.rs without touching docs/audits/surface_audit.csv.
  • Merged origin/main (859cdb9, no conflicts). Two ledger rows re-pointed: apr prune :144 -> :147 (Prune {), apr distill :174 -> :177 (Distill {). Both were already 3 lines off on main.
  • bash scripts/check_dogfood_coverage.sh: rc 0, G2.1 PASS. bash scripts/check_surface_audit_bins.sh: rc 0.

ont-delta: none
Closes #7142
keep-open: #5316 master ticket, the seed and eval are not applied yet

🤖 Generated with Claude Code

noahgift and others added 30 commits November 15, 2026 19:11
…slice 1/6)

Pins contracts.nt, the census witness and the README contract count.

Pmat-Ticket: PMAT-5316

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…(R-1 slice 1/6)

Four falsification tests named fns that land in later slices, so
pv lint --strict-test-binding reported 4 missing. Slice 1 now carries one
shell-harness entry (pv validate); FALSIFY-APR-RECIPE-001..005 return in the
slice that adds each test. Loader and example paths are marked as landing later.

Pmat-Ticket: PMAT-5316

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…st ids)

pr-light's fail_fast ids step refused FALSIFY-APR-RECIPE-000: ids must start at 001.

Pmat-Ticket: PMAT-5316
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Schema types of `apr finetune --recipe` (RecipeMethod, the Raw* shapes, TrainRecipe);
the parser, rules and receipt follow in later slices. FALSIFY-APR-RECIPE-003 cites
the method-spelling test present at this head.

Pmat-Ticket: PMAT-5316
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
TrainRecipe::parse reads the required keys and anchors relative paths at the recipe's directory; FALSIFY-APR-RECIPE-002 cites the test that proves it.

Pmat-Ticket: PMAT-5316
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… (R-1 slice 4)

Tests the required-key refusals the parser already makes (missing eval, missing keys, wrong schema id, unknown keys, wrong type, bad seed); FALSIFY-APR-RECIPE-001 and 003 cite them.

Pmat-Ticket: PMAT-5316
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…lice 5)

Empty strings, the heldout-aliases-train check, and the training block are validated by field; FALSIFY-APR-RECIPE-003 cites the tests.

Pmat-Ticket: PMAT-5316
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…training numbers (R-1 slice 6)

Tests of the rules slice 5 added; FALSIFY-APR-RECIPE-003 and 005 cite them.

Pmat-Ticket: PMAT-5316
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
check_teacher validates the distillation block and TrainRecipe::load reads a recipe file; FALSIFY-APR-RECIPE-002 and 003 cite the tests.

Pmat-Ticket: PMAT-5316
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…lice 8)

require_inputs checks the files a real run reads and the data pin before any model is loaded; sha256_file streams a hash. FALSIFY-APR-RECIPE-002 and 005 cite the tests.

Pmat-Ticket: PMAT-5316
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ice 9)

require_inputs refuses a heldout linked to the training file; TrainRecipe::receipt carries the recipe, data and eval hashes and the engines. FALSIFY-APR-RECIPE-003 and 005 cite the tests.

Pmat-Ticket: PMAT-5316
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Lowers a validated recipe to apr finetune: RecipeRunFlags, preflight_recipe, recipe_model_size, recipe_output_path, run_from_recipe, with one plan test. Not yet reachable from the CLI.

Pmat-Ticket: PMAT-5316
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ice 11)

Adds finetune_recipe_tests (eval refusal, preflight, missing inputs, model_size, output dir, distill refusal, absent file), rejects non-positive or non-finite model sizes, restores FALSIFY-APR-RECIPE-001 and 002 wording.

Pmat-Ticket: PMAT-5316
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Adds the --recipe clap arg (conflicting with every flag the recipe carries), the dispatch arm, the parse tests, examples/recipes/tiny.yaml and the book entry; re-points the surface-audit rows of model_ops_commands.rs; restores FALSIFY-APR-RECIPE-004.

Pmat-Ticket: PMAT-5316
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
# Conflicts:
#	contracts/apr-recipe-v1.yaml
Pmat-Ticket: PMAT-5316

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…der-error limit

Review of #7130 at 4d8e724: no test planted an unknown key under eval, teacher or output, and the contract claimed every fault is listed in one message, which is false for a wrong type or an unknown key (the YAML reader stops at the first). Adds the three rows, one test that pins the limit, and narrows the contract wording.

Pmat-Ticket: PMAT-5316

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Review of #7130 at d5c336a: the contract states heldout != train, teacher <=> distill and training numbers > 0, and the loader at this head checks none of them. Comment-only: names them as not yet enforced and drops stale slice numbering.

Pmat-Ticket: PMAT-5316

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…or optional keys

Keeps the review fixes of #7130 (reader-error limit, unknown-key rows), narrows the contract's not-yet-enforced list to what the loader still lacks, adds valid_optional_fields_are_kept and an infinity row for learning_rate.

Pmat-Ticket: PMAT-5316

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ests catch length and digit faults

Review of #7132 at a4a3cd7 (2 lanes FAIL): lexical_normalize dropped a repeated leading '..' and kept '..' above the root; is_sha256 survived two mutations. Rewrites the '..' arm, skips the same-file rule when data.train is missing, adds tests for both, and narrows FALSIFY-APR-RECIPE-005 to the pin's shape.

Pmat-Ticket: PMAT-5316

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…slices 5+6 (PMAT-5316 slice 7)

Merges R075h-recipe-6 (reviewed at ad76fcc) and keeps its review fixes. Adds tests that fail when a check is removed: alpha bounds inclusive, NaN and negative teacher numbers, the teacher rule waits for a known method, the same-file rule is silent for an empty heldout, load names the file in a refusal. The contract's not-yet-enforced list drops the teacher rule.

Pmat-Ticket: PMAT-5316

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…h and the qlora refusal (PMAT-5316 slice 7)

Review of #7135 at 15ba17a (2 lanes FAIL): a temperature bound of 1 passed every test, the not-UTF-8 error was not checked for the file name, no test put a teacher under qlora, and the body said a teacher block is not judged under an unknown method when only the presence rule waits. Adds a test for each; no change to the parser.

Pmat-Ticket: PMAT-5316

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…le and the receipt (R-1 slices 8+9)

require_inputs refuses a directory and a hard-linked held-out file, a pin on an absent file is not compared, sha256_file is tested past one buffer, and the receipt fields are asserted. The contract's not-yet-enforced list drops require_inputs and the receipt.

Pmat-Ticket: PMAT-5316
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…w of a163e81)

sha256_file returns nothing for a directory or a device instead of reading it, so /dev/zero as data.train no longer hangs require_inputs or the receipt. The training file is hashed only when a pin is set. Adds the one-million-a vector for the file hash.

Pmat-Ticket: PMAT-5316
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…is not opened (review of a317857)

Opening a pipe waits for a writer, so the check after the open still hung require_inputs and the receipt. The test now covers a pipe as data.train and eval.heldout, with and without a pin. The pin-only hashing of a317857 is taken back out: no test could tell it from hashing always.

Pmat-Ticket: PMAT-5316
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ed slice 9 head (PMAT-5316)

Merges R075h-recipe-9 (1ecc46a). The contract states what run_from_recipe does at this head; the CLI flag and exit 5 are still listed as not enforced. parse_model_size refuses a size under one parameter or past u64. The epoch default and the NF4 rule are one tested function.

Pmat-Ticket: PMAT-5316

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…l; say what plan mode hashes (PMAT-5316)

Review of 3906c56 (Opus FAIL, Haiku FAIL): the upper size bound had no test at its edge, the distill refusal was tested in plan mode only, and two comments said plan mode hashes nothing.

Pmat-Ticket: PMAT-5316

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Merges R075h-recipe-11 and wires the flag: dispatch calls run_from_recipe
when --recipe is given, and clap refuses every flag the recipe carries.

Added on top of the original slice:
- TrainRecipe::load asks the file type before the open, so a recipe path
  that is a directory, a device or a named pipe is refused instead of read.
- A dispatch test: the shipped example plans, a real run of it is refused
  by field with exit 5, --model-size is passed on, an absent recipe is
  exit 5.
- The contract header and FALSIFY-001/-002 describe this head.

Pmat-Ticket: PMAT-5316

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
noahgift and others added 3 commits November 16, 2026 03:46
…e (PMAT-5316)

Review round 1 on #7141 (both lanes FAIL): the help said the recipe
replaces the flags it carries, while --model-size and --output were
accepted and silently won over model_size and output.dir, and the
receipt's overrides list stayed empty.

- recipe_overrides lists each replacement; recipe_receipt_for_run puts
  it on the receipt and the run prints it.
- Help, book page, comments and contract now state the rule: flags in
  FINETUNE_RECIPE_CARRIES are refused, --model-size and --output win
  and are recorded, --profile only prints its line.

Pmat-Ticket: PMAT-5316

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ed (PMAT-5316)

Slice 13, from the non-blocking notes of the #7141 review at 95e09de:
- train_recipe.rs no longer allows dead code: the flag calls the loader.
- --recipe help and the book page: flags the recipe carries are refused.
- dogfood-the-44.yaml points at the line --task moved to.
- contract header: --verbose/--quiet are accepted and not passed on.

Pmat-Ticket: PMAT-5316

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…AT-5316)

Review of b1c990b found the limit line misleading: both flags take effect through the process-wide verbosity setting, as for every command.

Pmat-Ticket: PMAT-5316

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
noahgift and others added 5 commits November 16, 2026 12:27
Pmat-Ticket: PMAT-5316
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e-sync; stale on main)

Pmat-Ticket: PMAT-5316
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Pmat-Ticket: PMAT-5316

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pmat-Ticket: PMAT-5316

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pmat-Ticket: PMAT-5316

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@noahgift
noahgift marked this pull request as ready for review November 16, 2026 12:41
@noahgift
noahgift enabled auto-merge (squash) November 16, 2026 12:43
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

§13.11 rung 1 — quorum shadow verdict

S13-SHADOW pr=7143 head=7ba194d6c19bbefa69fd9c2a7224e8d7af0629da verdict=REFUSE class=Q1 arm_rc=1

Shadow mode: this records a verdict and merges nothing. A refusal
to arm is not a block (§13 adds zero rows to §7) — the pull request is
exactly as green as it was.

@noahgift
noahgift disabled auto-merge November 16, 2026 14:50
@noahgift
noahgift enabled auto-merge (squash) November 16, 2026 14:52
@noahgift
noahgift merged commit 256cbe1 into main Nov 16, 2026
25 of 28 checks passed
@noahgift
noahgift deleted the R075h-recipe-13b branch November 16, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

apr finetune --recipe: slice 13, drop the dead-code allow and correct the help wording

1 participant