Repository navigation
chore(recipe): slice 13, drop the dead-code allow and correct the recipe flag help (PMAT-5316) - #7143
Merged
Merged
Conversation
…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>
…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>
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
marked this pull request as ready for review
November 16, 2026 12:41
noahgift
enabled auto-merge (squash)
November 16, 2026 12:43
|
§13.11 rung 1 — quorum shadow verdict Shadow mode: this records a verdict and merges nothing. A refusal |
noahgift
disabled auto-merge
November 16, 2026 14:50
Pmat-Ticket: PMAT-7142 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
apr finetune --recipework (Declarative recipes for finetune, distill and merge (CRUX-001/002) #5316). feat(apr-cli): apr finetune --recipe flag and example recipe (R-1 slice 12) #7141 (slice 12) has merged and main is merged in, so the diff against main is this slice only: +13/-10 in 5 files at 10ab951.crates/apr-cli/src/commands/train_recipe.rsno longer allows dead code. The flag calls the loader, so the allow hid nothing.--recipehelp and the book page say the flags whose value the recipe carries are refused beside it. They said "replaces", and clap refuses them.docs/audits/dogfood-the-44.yamlpoints at line 75 ofmodel_ops_commands.rs, where--taskis now.--verboseand--quietwork beside--recipeas for every command, through the process-wide setting, and that no recipe test covers them.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.model_ops_commands.rsline references indocs/audits/surface_audit.csvdo not move.fail_fast.py idsrc 0 and the YAML loads. Clippy and the tests were not re-run at c090708.Measured (2026-11-16, head 10ab951, after merging main)
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
Review history
--verboseand--quietare "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.--recipeare not recipe fields (--merge,--task,--roleand others), so "the flags whose value it carries" is narrower than the list; the new module doc callstrain_recipe.rs"the schema and its validator only" though it also builds the receipt and hashes files;-qsilences stdout only, so the receipt lines on stderr still print.Known limits
docs/audits/pp-066-rescope-quorum.mdstill citesmodel_ops_commands.rs:67for--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.yamlcitesmodel_ops_commands.rs:38; it was not checked or changed here.cli_commandsand surface-audit tests andscripts/check_contract_test_binding.shwere not run here; CI runs them.apr finetunedoes not apply them. Declarative recipes for finetune, distill and merge (CRUX-001/002) #5316 stays open for that.Round at 7ba194d (2026-11-16)
scripts/check_dogfood_coverage.shG2.1: the branch changescrates/apr-cli/src/model_ops_commands.rswithout touchingdocs/audits/surface_audit.csv.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