Skip to content

Development findings

This log records design questions, run findings and the fixes that followed. See the development notes for unpublished references and recipe paths.

  • Interim rules: G-1 to G-20 (G-3 revised on 2026-11-09) and the maintainers' decisions D-1 to D-5 are applied as written. F-1, F-2, F-3, F-6 and F-13 are resolved by those rules; F-5 stays open.
  • Short forms: 04 is 04-workflow-and-composition.md and 05 is 05-evaluation-and-lineage.md.

Resolved by interim rules (round 2, 2026-11-09)

  • F-1. What sets underpowered. Resolved by G-3 (revised): underpowered is true when n < n_required or achieved power < the registered power (04:102, 05:82). The code already did this; the comments now cite the revised rule.
  • F-2. Equivalence has no power or required n. Resolved by G-12: when achieved power cannot be computed, underpowered is true, so an equivalence non-rejection is INCONCLUSIVE, never FAIL (05:82). achieved_power and plan.n_required stay null. The design still lacks the TOST formula (05 section 3.6); the proposed design change stands: "05 §3.6: add the TOST power and sample-size formula so equivalence gates can report achieved power."
  • F-3. Achieved power when the observed SD is 0. Resolved by G-13: the limit 1.0 is kept and sd_zero: true is printed in the JSON and text reports. The lr = 0 control on 500 prompts is FAIL with sd_zero: true; on 30 prompts it is INCONCLUSIVE (plan underpowered).
  • F-6. Tier B data from Hugging Face. Resolved by G-14: the runbook exports the training split to local shard files under a manifest before the first run, and falls back to precision stage (05:348) without the export. The skeleton has no writer for stage-precision edges; the runbook says to record that edge by hand.
  • F-13. Missing validation metric on Tier B. Closed: at 4f39fd8 NeMo RL warns and still saves when no validation metric was collected (grpo_sync.py:1356-1366, save at :1378-1386, verified in the pinned clone).

Round 2 changes from the review (decisions D-1 to D-5)

  • D-1. The stub loader and the ledger follow NeMo RL's StatefulDataLoader(..., drop_last=True) (nemo_rl/algorithms/grpo.py:883-890). In the pinned clone drop_last=True is on line 888; the decision text said 887, which is collate_fn; the review corrected it (L-1). The demo is unaffected: 5,000 % 50 = 0 and 1,000 % 50 = 0, so no tail is dropped and the E2E numbers are unchanged.
  • D-2. A step with zero samples maps to no shard and writes no ledger row.
  • D-3. baseline_score and candidate_score use the paired items only; unpaired_baseline and unpaired_candidate are reported, with a warning: line in the text report when either is above 0.
  • D-4. A registration whose copy hashes differently is refused with REG-HASH (exit 3) and the just-created run directory is removed.
  • D-5. disjoint_from: not-assessed (skeleton) is reported when the spec declares disjoint_from.
  • Canonical-JSON rule C2. Canonical JSON now rejects object keys with supplementary-plane characters.

Round 3 changes from the re-review (low findings)

  • L-3. Preflight refuses a trainer batch_size larger than the training rows (TRAINER-CONFIG on artifacts.<config>.batch_size, exit 3, no run directory). Under drop_last such a batch is never yielded (D-1). Rows are counted from the shard files without loading the model.
  • L-4(a). If copying the registration raises after preflight (for example the file was deleted), the run refuses with REG-MISSING, exit 3, and removes the just-created run directory.
  • L-5. Runbook section 3.1: the concatenated train.jsonl lives outside the shard directory, its SHA-256 is recorded, and before the run it is checked against a fresh concatenation of the shards in file-name order.

Open: needs a maintainers' or design-owner decision

F-4. Interval method: the design says BCa

  • 05:105 names the prompt-clustered bootstrap with 10,000 replicates, BCa. The code computes BCa (bias correction with mid-rank ties, jackknife acceleration).
  • The report records interval.method = "cluster_bootstrap" (the 05 clause vocabulary, 05:78) and interval.bootstrap.variant = "bca".

F-5. G-4 applied beyond the listed fields

  • G-4 names α, power and margin. The code also refuses (REG-FIELD) when the spec's gate type, metric, mde (→ planning_effect), cluster_by (→ unit), seeds (→ number of eval_seeds), sampler (→ sampler.name) or evaluator (→ evaluators[].id) differs from the registration. These are the 04:98 mapped fields plus the sampler and evaluator that 05:142 puts in the registration.
  • The registration's workflow and gate names are not compared with the spec. The demo controls spec-no-train.yaml and spec-bad-train.yaml reuse registration.yaml, which names the workflow skeleton-addition-demo, so such a check would refuse the demo fixtures. Whether one registration may serve several workflows is a design question.
  • test_spec_errors.TestRegistrationIsAuthoritative now covers G-4 through gatedtrain run for alpha, power, mde, margin, type, seeds, sampler and evaluator.

F-7. Registration contents enforced as an interpretation

  • analysis_code_version must equal the running code (gatedtrain 0.3.0); otherwise REG-FIELD. 05:142 lists the version in the registration but states no mismatch rule.
  • multiplicity must be {plan: single_gate, family: null}; sigma_plan must be ucb80 or fixed; unit must be prompt; interval must be cluster_bootstrap. These are skeleton limits, refused with REG-FIELD rather than ignored.

Recorded: naming choices and stand-in scope

  • F-8. Rule IDs beyond tests/README.md section 3. Errors that are not spec or registration rules get their own IDs: TRAINER-CONFIG (stand-in config), ARTIFACT-HASH (a pinned non-registration artifact differs from its pin, 04:80), WARMUP-OUT (existing --out), IMPACT-TARGET (malformed hash or missing path). Grammar keys the skeleton cannot honor (rewards, labels, a lone alpha_family, gate.threshold, gate.human, test.bar, test.type) are refused with SPEC-SHAPE instead of being ignored.
  • F-9. The demo stage runs 20 epochs. The tuned stage consumes 100,000 samples (2,000 steps × 50) from 5,000 rows, so every saved checkpoint (steps 500 to 2,000) possibly consumed every training shard. The E2E impact test still checks the rule last_step_included ≥ first_step(S), but on the demo it cannot tell checkpoints apart. The ledger unit test covers a partial mapping. Fewer steps did not train the stand-in well enough (about 6% exact match after 300 steps of 25).
  • F-10. A failed run leaves its directory. A run that fails after its directory is created leaves a partial directory. It is never reused or overwritten, but no failure marker is written.
  • F-11. Stand-in tuning (Tier A only). Warm-up 1,500 steps × 50 on the 1,000-row warm-up shard gives a baseline of about 24% exact match; the stage (2,000 steps × 50, lr 0.003) gives about 84%; training on shuffled labels gives about 1%. trainer-lr0.yaml keeps lr = 0.
  • F-12. Common random numbers in the stand-in evaluator. Repeat r of every prompt draws its uniforms from eval_seeds[r], one per (prompt, token position), and samples by inverting the model's CDF. Identical models give identical samples (the lr = 0 control shows Δ̂ = 0 exactly), and similar models give coupled samples (05:97).
  • F-14. R9-OI-1. sbatch --no-requeue prevents only Slurm's own requeue. An administrator or an automated health-check service can still requeue; a second attempt would break the ledger writer's one-attempt assumption (05 section 12.4). Noted in the runbook; tierb-collect refuses a second exp_* directory.

Tier B helpers (TIER-B-SPEC H-1 to H-8, interim rules G-15 to G-19)

  • F-15. gatedtrain run does not drive Tier B. The maintainers' prototype decision says "the same gatedtrain run drives" Tier B. It does not: run refuses rl.nemo_rl@0.1 and never launches a GPU job. The Tier B path is the helpers, ending in gatedtrain tierb-collect. The decision is not part of this repository, so its wording is left to the maintainers.
  • F-16. Refusal rule IDs. These rule IDs are naming choices: EXPORT-OUT, EXPORT-SOURCE, NEL-CONFIG, TIERB-SPEC, TIERB-STAGE and TIERB-BASE. The tests fix EXPORT-REVISION, EXPORT-HASH, EXPORT-LAYOUT, MERGE-EVAL, TIERB-RESULTS, TIERB-DATA and the retired TIERB-PAIRING (design revision 10: unpaired items make the gate MISSING instead).
  • F-17. Resolved: training starts from the gated base model. launch_spec and build_command take base_model and emit policy.model_name=<base_model> once, for every launcher and profile (golden common_overrides).
  • The tokenizer follows it (name: ${policy.model_name}, grpo_math_1B.yaml:157). NeMo RL loads it with from_pretrained (nemo_rl/models/automodel/setup.py:374-375, :941-942) and passes it to vLLM (grpo.py:1426).
  • The runbook downloads Qwen3-0.6B once, with --local-dir, into base-model/. The second download, the refs/main check and R10 are gone.
  • base_model defaults to None so that older calls keep working. None leaves the recipe's Qwen/Qwen3-0.6B, which a gated run must not use.
  • F-18. The export's download path is untested. Without --source, export-gsm8k fetches the Hub API sha and the parquet files main/{train,test}-00000-of-00001.parquet at that revision. The file names are unverified (no network here). The --source path is tested.
  • F-19. The held-out set keeps commas; NeMo Evaluator strips them. heldout/prompts.jsonl follows NeMo RL (G-19) and serves only as the prompt_set_hash input. NeMo Evaluator loads the test split itself and compares answers without commas (benchmarks/gsm8k.py:29-32). Problem indices agree because both use the test split's own order (engine/eval_loop.py:132-134). R4 in the runbook covers a Hub revision change between export and evaluation.
  • F-20. Tier B evaluator identity. The report's evaluator_hash for Tier B is the SHA-256 of {evaluator id, benchmark, NeMo Evaluator commit} (plus the scorer, decision D-4). NeMo Evaluator has no lockfile at ea35ba3, so the runbook asks the operator to record uv pip freeze. Since design revision 10 (R10-5) the registration carries this resolved hash as evaluators[0].manifest_hash; see the next section.
  • F-21. Large checkpoints are hashed. tierb-collect hashes every saved checkpoint for the manifests and the lineage, about 5-10 GB each (estimate). On the long run that is minutes of disk reading, not GPU time.

Tier B review round (HIGH-2, LOW-1 to LOW-6, MEDIUM-1)

  • HIGH-2. tierb-collect refuses with TIERB-PROMPTS, before creating anything, unless all of these hold:
  • the paired problem_idx set is range(len(heldout));
  • every expected_answer equals the held-out answer with commas removed (benchmarks/gsm8k.py:29-31 at ea35ba3);
  • every held-out question appears in the record's prompt.

This replaces the R4 caveat that a Hub revision change could pass unnoticed. - LOW-1. merge-eval checks temperature, top_p, max_tokens and enable_thinking of every run against the registration, and the model against runs[0] (config/services.py:38-41, :82-105, :240-259). - LOW-2. tierb-collect checks non-registration @sha256: pins (ARTIFACT-HASH). The check is shared with Tier A preflight (runner.check_pins). - LOW-3. tierb-collect checks grpo.max_num_steps, num_prompts_per_step and num_generations_per_prompt in step_<last>/config.yaml against the trainer.yaml profile (TIERB-PROFILE). - LOW-4. tierb-collect refuses base-model/.cache (TIERB-BASELINE); the fix line says to delete it. - LOW-5. demo/tierb/reward_check.py scores ("3,082", "The answer is 3082.") on its own. - LOW-6. tierb-collect refuses a record without reward (TIERB-RESULTS) instead of reading it as 0. - F-22. Decided: training runs offline. The docker launcher sets -e HF_HUB_OFFLINE=1 (interim rule G-20; golden docker_flag_groups). After F-17 the base model and the data are local, so the training container needs no Hub access. The runbook says both must be local before steps 6 and 7. - F-23. Decided (G-20): truncated training responses stay in the loss. At 4f39fd8 truncated rows are masked only with grpo.overlong_filtering: true (grpo_sync.py:934-937). - overlong_filtering stays false, as the recipe ships it (grpo_math_1B.yaml:18). The prototype keeps the unmodified recipe. - A response cut at 512 tokens therefore stays in the batch and the loss with the reward the environment gives it, usually 0. - The runbook documents this in R1. - Training and gate samplers differ by design (MEDIUM-1; decided, G-20). Training samples at temperature 1.0 with 512 total tokens (grpo_math_1B.yaml:166, :479-481). The gate uses the registered deployment sampler (0.7, 1,024 new tokens), as 05 section 3.3 allows (05:99). Recorded in runbook R1 and R5.

Re-review: root-owned outputs (HIGH-1) and TIERB-BASE (L-1)

  • L-1. tierb-collect reads policy.model_name from step_<last>/config.yaml and refuses with TIERB-BASE before creating anything unless all of these hold:
  • the value is a local absolute path;
  • its final component equals the spec's base directory name.

So a Hub id (Qwen/Qwen3-0.6B) and a different directory (/work/tierb/other-model) are refused, and /work/tierb/base-model, which build_command(..., base_model=...) emits (F-17), passes. Only the name is compared, because the container path (/work/...) is not the host path. - HIGH-1. The image runs as root (docker/Dockerfile:846 at 4f39fd8), and the launcher does not pass --user. The runbook (step 3a): - copies the templates, then pre-creates tierb/base-model and out/{smoke,long}/{rl,eval} as the host user; - deletes base-model/.cache inside the container; - states that root-owned outputs are expected and only read on the host.

Host steps re-checked under this ownership:

Step Host action Works?
4 export-gsm8k creates tierb/export yes
4 find -type l reads base-model/ yes
5 edits the host-owned templates yes
6, 7 grep reads the logs yes, if the files are world-readable (F-25)
9, 10 nel-config writes tierb/nel/ yes
9, 10 nel eval run and merge-eval write out/<run>/eval/... yes, because eval is pre-created
11 tierb-collect reads the root-owned stage outputs and base-model/ yes, if world-readable
11 tierb-collect writes <HOST_WORK>/runs/ yes, host-owned
11 impact reads yes

No host step writes into or deletes from a root-owned directory. - F-24. tierb/export is not pre-created, contrary to the instruction. HIGH-1 asked for mkdir -p <HOST_WORK>/tierb/export. But gatedtrain export-gsm8k refuses an existing --out directory (EXPORT-OUT; pinned by test_tierb_export.test_never_overwrites), so pre-creating it would make step 4 fail. The export runs on the host as the host user, so tierb/export is host-owned without pre-creation. The runbook pre-creates its parent tierb/ (through the template copy) and explains this. If the maintainers want tierb/export pre-created anyway, export-gsm8k would need to accept an empty existing directory, which is a test change. - F-25. Root-written file modes are unverified. The host-side reads (step 6 and 7 checks, tierb-collect, impact) assume the container writes world-readable files, as root's default umask 022 gives. Whether NeMo RL, the Hugging Face CLI or Automodel narrow the modes (for example on checkpoint shards) is unverified. The runbook tells the operator to stop on Permission denied. The fix would be an in-container chmod -R a+rX on the output, which needs a decision because it changes files after the run.

Final re-review (LOW-1 to LOW-3)

  • LOW-1. A step_<last>/config.yaml that is not a mapping (for example a YAML list) gives TIERB-PROFILE, exit 3, before anything is created, instead of an AttributeError. It is handled as _check_base_model handles it.
  • LOW-2. The runbook's TIERB-BASE row covers both causes: symlinks in the baseline directory, and a policy.model_name that is not the spec's base-model directory.
  • LOW-3. tierb-collect walks and hashes the base model and every saved checkpoint, the trained one included, before _new_run_dir. Those entries are reused for the manifests and the lineage, so each tree is read once.
  • An unreadable file or directory gives the new rule TIERB-READ (field --stage-out, or the base-model uri). The message names the path, and the fix points to runbook step 6 and F-25.
  • A symlink or a bad path inside a checkpoint gives TIERB-STAGE.
  • F-26. An unreadable directory used to be skipped silently. manifest_entries used Path.rglob, which skips directories it cannot list, so such a subtree would have been left out of the hash without an error.
  • It now walks with os.walk(onerror=...), so an unreadable directory raises.
  • Entries, sort order and hashes are unchanged for readable trees; the format-convention tests (canonical JSON, content-addressed manifests) and the determinism tests still pass.

F-27: the Tier B host install on Linux

  • Problem. pyproject.toml restricts the uv lock to darwin ([tool.uv] environments, G-11), so uv sync --locked fails on a Linux single-GPU host.
  • Fix. requirements-tierb-host.txt holds exact pins equal to uv.lock: numpy 2.5.4, scipy 1.18.1, pyarrow 26.0.1, duckdb 2.0.0 and pyyaml 6.0.3.
  • In uv.lock, scipy depends only on numpy, and the others have no locked dependencies, so the closure is complete.
  • It has no torch. The host path imports only yaml, numpy, scipy, pyarrow and duckdb; torch is used only in Tier A runner.run, runner.preflight and stubs/.
  • Runbook step 3b installs these pins into a plain venv with uv venv and uv pip install. gatedtrain on the host then means <HOST_VENV>/bin/python -m gatedtrain.
  • gatedtrain run, warmup and the Tier A tests are not available on the host.
  • Unverified. uv.lock lists only macOS wheels for these versions (macosx_* tags), so it cannot confirm linux x86_64 CPython 3.13 wheels. The runbook says to stop if any package would build from source.
  • Hashes (2026-11-18). Each pin now lists the SHA-256 of every distribution PyPI publishes for its version, generated with uv pip compile --generate-hashes (the lock has no Linux wheel hashes to copy); the host installs with --require-hashes.

Design revision 10 alignment (tests/README.md section 11.15, R10A-1 to R10A-16)

  • R10A-1 (R10-3, supersedes G-3's equivalence part and G-12; resolves F-2). plan() gives the TOST required n (05 §3.6) and evaluate() the TOST achieved power at the planning effect. A powered equivalence non-rejection is now FAIL; an underpowered one stays INCONCLUSIVE.
  • R10A-2 (R10-5, supersedes G-6). evaluators[0].manifest_hash null or absent is refused (REG-FIELD); the fix line names the hash the prototype resolves: the Tier B identity hash (F-20, decision D-4), or for Tier A the stand-in identity hash (runner.stub_evaluator_hash, the hashes of the stub evaluator, model and task code). Every demo registration now carries its resolved hash. At run time a differing registered hash makes the gate MISSING with reason evaluator_hash_mismatch; the report gives evaluator_hash and evaluator_hash_registered. Changing the stub code changes the Tier A hash, so the demo registrations must then be re-resolved and the specs re-pinned.
  • R10A-3 (R10-8, supersedes G-18's refusal). pairing.max_unpaired is an integer count or a fraction in [0, 1) of the 2|E| expected items, default 0. Above it the gate is MISSING (missing_above_bound), with missing_baseline and missing_candidate reported; tierb-collect writes the run instead of refusing with TIERB-PAIRING. TIERB-PROMPTS (a) now compares the union of both arms' problems with the held-out set.
  • R10A-4 (R10-9). Optional amends: sha256:<hex> and post_hoc: <bool>; the report gives registration_amends and post_hoc. With post_hoc: true only a PASS changes: it becomes INCONCLUSIVE with reason post_hoc (maintainers' decision 2026-11-11); FAIL, INCONCLUSIVE and MISSING stay as they are. The prototype learns that an amendment followed candidate results only from the author's post_hoc value.
  • R10A-5 (R10-10). min_paired (integer >= 1, default 10). Fewer pairs is INCONCLUSIVE (min_paired); a zero-width interval (n < 2 or SD 0) is INCONCLUSIVE (zero_width_interval) whatever its limiting power; the G-13 power limit and sd_zero stay.
  • R10A-6 (R10-7, supersedes G-8). The spec's test.alpha, power, mde and margin are optional; the registration is authoritative and must carry clause.alpha. A spec value that differs is still refused (G-4).
  • R10A-7 (review finding 7). New rule TIERB-DATA on the run's saved data section: shuffle must be false, data.train one dataset (a mapping or the one-element list NeMo RL saves), its data_path <dir>/<export dir name>/train.jsonl, and split_validation_size 0 (absent means 0, the ResponseDataset default, response_dataset.py:50 at 4f39fd8).
  • R10A-8 (review finding 8). k_actual gives the [min, max] repeats per prompt of each arm; a maximum other than the registered K, or a repeat outside range(K), is MISSING (k_mismatch); a record whose metadata.eval_seed differs from eval_seeds[repeat] is MISSING (seed_mismatch). Tier B keeps each record's metadata when it reads scorer_rewards.
  • R10A-9 (review finding 9). gatedtrain impact prints counts: {orphaned, superseded} (JSON) and orphaned: <n>, superseded: <m> (text). Orphaned records (after the last committed cut, one per (step, shard)) are kept in lineage/orphaned.parquet, outside the ledger, so they still enter no rollup; superseded is 0 (one attempt, one segment). (Later, EXT-RES-5: a resumed external run's ledger, consumption schema 1.1, also holds its orphaned records with status: "orphaned"; every rollup reads kept rows only.)
  • R10A-10 (review finding 10). p_value with p_value_method: bca_inversion: the one-sided p for H0: Delta <= delta_sup (superiority) or Delta <= -delta (non-inferiority) inverts the BCa lower bound on the same bootstrap draws; equivalence reports the TOST p. Null for a zero-width interval or no pairs. The decision still comes from the interval.
  • R10A-11 (review finding 11). tierb-collect --nemo-rl-modified yes|no --image-build-notes TEXT; the lockfile's backend.trainer records nemo_rl_modified ("unknown" without the flag) and image_build_notes.
  • Status reasons. status_reasons lists no_pairs, missing_above_bound, k_mismatch, seed_mismatch, evaluator_hash_mismatch (MISSING) and min_paired, zero_width_interval, post_hoc, underpowered (INCONCLUSIVE); MISSING takes precedence over INCONCLUSIVE within a clause. All reasons that apply are listed, so a MISSING result may also name INCONCLUSIVE reasons; underpowered is listed only for a non-rejection.
  • R10A-14 (review follow-up MEDIUM-1): zero width up to float noise. 05 §3.6 (05:156) makes a zero-width interval (σ̂_d = 0) INCONCLUSIVE. The prototype reads "σ̂_d = 0" as max(d) − min(d) ≤ 1e-12 · max(1, |mean(d)|) on the per-prompt differences (and n < 2), an implementation choice not in the design: per-prompt means of K binary rewards can equal 1/3 computed two ways (0.3333333333333333 and 0.33333333333333337, SD 9.8e-17), which exact std() == 0 treated as a real interval. One function, gates._zero_width, now decides the zero-width interval (bca_interval), the null p-value (bca_p_value), sd_zero, the G-13 power limit and the zero_width_interval reason, so they always agree. With n = 1, sd_zero stays false (no SD) as before.
  • R10A-16 (review follow-up LOW-1): p_value_at_floor. A prototype report field, not in the 05 §3.8 report list. It is true when the bootstrap tail behind the reported one-sided p is empty: G(null) clipped up to 1/(B+1) for H0: Δ ≤ null, or G(δ) clipped down to B/(B+1) for the upper TOST side; for equivalence the side that gives the reported maximum decides. The p-value is then a bound set by B, not an estimate (the real long run reported 8.54e-05 this way), and the text line reads p_value: <= <p> (bca_inversion). A clip toward p ≈ 1 (a ceiling) and a null p-value give false.
  • p-value and interval at the boundary. On lattice or binary differences the p-value and the interval verdict can disagree right at the boundary: G counts bootstrap ties at the null half, while the interval ends come from interpolated bootstrap quantiles, so p < α with a lower bound equal to the null (or the reverse) is possible. The interval decides the status and the p-value is reported only, which is conservative in the case that matters (p < α while the interval does not reject gives no PASS); the gaps are within the quantile-interpolation step of about 1/B.
  • Equivalence MDE in plan(). For equivalence plan() still reports mde with the one-sided formula (z_{1−α} + z_power) σ √(DE / n) (05:124). It is display-only: n_required uses the TOST formula (R10A-1) and the verdict comes from the interval, so neither depends on it.

Design revision 11 alignment (tests/README.md section 11.16, R11A-1 to R11A-22; design revision 13 notes)

  • R11A-1, R11A-2 (R11-19, R11-10, R11-21): registration names. The clause is read in item names (unit: item, samples_per_item, direction, optional estimator: mean | ratio_of_sums) with the top-level eval_distribution: {item_set_hash, env_version, env_params_version}. The revision 10 names stay readable field by field (prompt_set_hash, samples_per_prompt, unit: prompt, gate role prompts of type prompt_dataset, cluster_by: prompt); a legacy K form without direction reads as higher_is_better; a document with both forms of one field is refused on the legacy key. registration.normalize gives a copy in item names, and Workflow.clause is the normalized clause. The registration hash is still the SHA-256 of the file bytes. The demo files and the Tier B registration template keep the legacy names (they are the legacy-read fixtures).
  • Evaluator declarations (verifier choice 5). items.EVALUATORS stands in for the evaluator manifest: both prototype evaluators declare higher_is_better, range [0, 1] and only the mean estimator, so a clause with another direction, or with ratio_of_sums, is refused for them (REG-FIELD registration.clause.direction / .estimator). The declaration read is the deciding evaluator's (R11A-23 below); constraint evaluators (section 11.17) are not checked against the table.
  • R11A-3 (04 §4.2): spec role. The gate's evaluation items come through role items of type item_set; Workflow.names["items"] names the artifact for either role. A training stage's data stays training_dataset.
  • R11A-4: new writes. gatedtrain run and tierb-collect write n_items, samples_per_item, unit, direction, natural_units, eval_distribution, item_set_hash, missing_reasons and resampling_unit: item; manifests/item_set.json (type item_set), lockfile artifacts.item_set, lineage gate role items. Reports written before revision 11 keep their keys.
  • R11A-5 to R11A-12: gates.evaluate_items. The gate runs on per-item records (gatedtrain/items.py, a naming choice); from_nemo_evaluator converts NeMo Evaluator records (a raising scorer becomes error: {class: scorer_error}, never 0; output_ref names the SHA-256 of model_response, verifier choice 9). Expected items are the registered item set times K per arm; missing reasons absent, the error class, out_of_range (NaN and ±inf always) and no_seed (R13-6); MISSING clause reasons k_mismatch (repeat outside range(K)), seed_mismatch, malformed_record, unknown_item, model_hash_mismatch (verifier choices 1 and 2). Fewer than K records are missing items only (supersedes R10A-8's maximum rule, also in the mapping form evaluate). The item order of the registered set fixes the bootstrap order, so record order and item ID type do not change a result; on the real long run the per-item path reproduces the report to the last bit.
  • Ratio of sums (R11-21, R13-8). Δ is the difference of the arm ratios Σ numerator / Σ denominator over the repeats used in complete pairs; the interval is the BCa item-clustered bootstrap (items resampled with all their repeats, both arms together) with the item jackknife for the acceleration; num_i and den_i are sums over the repeats used (they equal means only with equal repeats, ambiguity (e)); sd_diff and power come from the linearized contributions d_i = (num_i − R·den_i) / mean(den), oriented. The p-value inverts the same bootstrap. The tests accept either bootstrap variant; BCa follows R13-8.
  • R11A-9: direction. Scores of a lower_is_better clause are negated before Δ, margins are in oriented units, and the natural-unit difference (oriented interval negated and swapped) is reported beside it; baseline_score and candidate_score stay in natural units.
  • R11A-16 (R11-1, R13-7): post_hoc. gates.is_post_hoc is true iff amends is set and a candidate-arm result of the judged checkpoint was created strictly before amended_at (instants, RFC 3339). The registration accepts an optional created_at (RFC 3339 with a zero UTC offset), which is the amended_at to pass. Wiring the evidence into tierb-collect is deferred (NeMo Evaluator arms carry no checkpoint identity or creation time); the declared post_hoc flag keeps working.
  • R11A-17: Tier B item set. tierb-collect gates on the registered held-out set: a held-out problem missing from an arm (or both) is a missing item (absent), a record without metadata.eval_seed is no_seed, and TIERB-PROMPTS (a) refuses only problems outside the held-out set. The item-set hash is checked against eval_distribution.item_set_hash (or the legacy key, whichever the registration uses). Scorer errors and out-of-range rewards stay refusals (verifier choice 7).
  • R11A-18 (R11-18): derivation. ledger.SCHEMA has derivation; Tier A and Tier B rows are reconstructed at precision iteration (verifier choice 6), checked by ledger.check_precision. Impact results carry derivation (null for a pre-revision-11 ledger) and the text line adds derivation <value>.
  • R11A-19 (R11-16): ranges. impact --json adds ranges: {orphaned: [{run_id, attempt_id, shard, first_step, last_step}], superseded: []}; text lines orphaned_range: … or orphaned_ranges: none, and the same for superseded. The R10A-9 counts stay.
  • R11A-20 (R11-15): checkpoint completeness. The lockfile's backend.trainer.checkpoint_completeness declares NeMo RL 4f39fd8's rule (a tmp_step_N directory is renamed to step_N after the write), and only step_N directories are cuts.
  • Not done (deferred, tests/README.md section 11.16 "Deferred"). model_manifest_hash of Tier B checkpoints and the cut manifest (the run paths pass the arms' manifest hashes but no expected_models, which would compare a hash with itself); base_ref and lora_compose; stage-precision edges; environment parameters as a DatasetSnapshot; learned-scorer validity; the floor and ceiling refusal from baseline data (R13-9's registered pilot baseline mean is now checked, R11A-29 below); post_hoc evidence in tierb-collect; unit: training_seed; the export's export.json prompt_set_hash.

Design revisions 12 and 13: constraint clauses and blocking judges (tests/README.md section 11.17, R12A-1 to R12A-17)

  • Library only. New module gatedtrain/constraints.py (naming choices): clopper_pearson_upper, threshold_power, binomial_n_required, constraint_set_hash, violation_indicators, judge_qualification, evaluate_constraint, check_registration; report.constraint_report; gates.combine unchanged (a constraint result is one more clause in and). run and the Tier B commands refuse a constraint registration (REG-CONSTRAINT registration.clause.constraint_set, "not wired"): wiring, CLI text and multiplicity stay out of scope (section 11.17 "Scope"). The gate reads recorded verdicts only (MULTIMODAL-SPEC MM-C1 to MM-C4); no code path calls a judge or opens a socket.
  • R12A-1, R12A-2 (R12-1, R12-4): registration. A clause with constraint_set is a constraint clause: threshold (type: superiority with bar, P1) or non_inferiority (with margin); direction: lower_is_better; interval: clopper_pearson or clopper_pearson_discordant; no sigma_plan or sigma_pilot (P2); planning_effect in (0, bar] or (0, margin]. The registration holds constraint_set (id equal to the clause's; numbered constraints with one tool or judge checker; judges with their scorer fields; canaries) and, with judges, judge_qualification (P5). A constraint_set or judge_qualification without a constraint clause is refused; bar outside a constraint clause is refused (REG-FIELD). A spec gate.threshold maps to superiority and test.constraint_set must equal the clause's (G-4); run itself still accepts only the three paired gate types.
  • R12A-3: scorer hash. constraint_set_hash is the RFC 8785 canonical JSON SHA-256 of the whole set (P9); evaluators[0].manifest_hash must equal it, and an arm run with another set is MISSING evaluator_hash_mismatch.
  • R12A-4 to R12A-7: statistics. Records are screened by gates._screen_arm (range [0, 1]); a score other than 0 or 1 is out_of_range (P8), an error its class. v_i is the maximum over the usable repeats (non-inferiority: those usable in both arms). Threshold: exact Clopper-Pearson upper bound of k/n below bar, p = P(X ≤ k; n, bar), binomial power at bar − planning_effect. Non-inferiority (R13-1): bound of c/n below δ, p = P(X ≤ c; n, δ); b, c, delta_hat = (b − c)/n and difference = (c − b)/n reported. sd_zero when all per-item values (differences) are equal; the bound keeps positive width, so it is never the zero-width INCONCLUSIVE. underpowered when power is below target, n below n_required, or the planning rate is outside [0, bound) (power not computable). MISSING precedes INCONCLUSIVE; max_unpaired as a fraction is taken over the expected items of all arms (one arm for the threshold form).
  • R13-2 and prototype choice P4 (revised). Power and n of the non-inferiority form are binomial as in the threshold form with δ for bar. 05 §3.9 says "the registered planning rate of c/n" without naming a field; the prototype reads it as margin − planning_effect, the same construction as the threshold form's planning violation rate, so no clause field is added. To confirm with the design owner (the alternative is a separate clause field holding the rate).
  • R12A-9 to R12A-14 (R12-3, R12-5, R13-3, R13-4): judges. judge_qualification returns can_block_alone, failed (a_validity … e_external), the miss and false-alarm rates and their Clopper-Pearson upper bounds at the clause's α (R13-3), and the identity fields the report needs. On a blocking clause each failing input is REG-JUDGE on its own field and the run-time clause is MISSING judge_not_qualified; on a non-blocking clause the judge is supporting (no REG-JUDGE). A missing egress approval of an external judge is REG-EGRESS blocking or not, and MISSING egress_unapproved at run time. Per-batch canaries (registered set; MISSING canary_absent / canary_missed) apply only to a blocking clause (R13-4); a supporting judge's batches are still summarised in canaries (with required: false and by_arm).
  • Report (R12A-16). constraint_report copies the section 11.17 keys from the result; for the non-inferiority form the top-level canary lists concatenate both arms and evaluate_constraint's canaries.by_arm attributes them.
  • Not done (deferred). Wiring into run, tierb-collect and ext-collect, the CLI text, reading items.jsonl / judge_batches.jsonl / eval_meta.json from disk (MM-C1 to MM-C3; only the in-memory MM-C4 form exists), counting the constraint clause in m (05 §3.5), 06 B26 conformance canaries of supporting judges, and computing tiers and independence from lineage (P5 declares them). (A record in two batches of one judge is now MISSING malformed_batch, R12A-21.)

Review fixes to revision 11 (tests/README.md section 11.16, R11A-23 to R11A-30)

  • R11A-23, R11A-24 (HIGH-1): the deciding evaluator. registration.deciding_evaluator(reg, evaluator_id) returns the evaluators entry whose id is the spec gate's evaluator. spec.load_spec passes the gate's evaluator to read_registration / check_contents, which check direction, estimator and baseline_pilot_mean against that entry's items.EVALUATORS declaration; a deciding evaluator the table does not declare is refused (REG-FIELD registration.evaluators[<i>].id, verifier choice) except for constraint clauses. Without a spec gate (library callers such as test_r12_constraints) the first entry stands in and an undeclared one is not refused; the Tier B commands without a spec (merge-eval, nel-config) use tierb.EVALUATOR_ID when it is listed. The scorer rule G-21 is checked on every entry (REG-SCORER registration.evaluators[<i>].scorer), so the deciding one is covered wherever it stands. tierb.registered_scorer(reg, evaluator_id) reads the deciding entry. At run time runner.gate_and_report compares the run's evaluator hash with the deciding entry's manifest_hash, and the report's evaluator_hash_registered is that hash. The review's repro (decoy first, real evaluator second with a null hash, lower_is_better) is refused by validate and run with both errors.
  • R11A-25 (MEDIUM-2). Every evaluators[i].manifest_hash must be sha256: plus 64 lower-case hex; null and absent are refused on any index (was index 0 only).
  • R11A-26 (MEDIUM-3). For ratio_of_sums, a scored record with a non-finite numerator, or a denominator that is not finite or is <= 0, is a missing item out_of_range (gates._ratio_parts_usable); it never reaches the sums.
  • R11A-27 (LOW-4). evaluate_items raises ValueError on a repeated item ID (verifier choice); constraints.evaluate_constraint does the same.
  • R11A-28 (LOW-5): production reader. runner.read_arm_records reads every non-blank line of an arm's results.jsonl: a line that does not parse, is not a JSON object or has no problem_idx becomes a record with the unknown key unreadable_results_line, and duplicates are kept, so both reach evaluate_items as malformed_record (clause MISSING). gates.load_paired_records is unchanged (NeMo Evaluator's skip-and-last-wins reader, test_pairing) and is no longer used by the gate path; tierb-collect's pre-gate scorer checks still use it. One behaviour change: the gate path no longer coerces problem_idx with int(), so a string "3" is an unknown item (MISSING) instead of item 3. Extended to merge-eval (re-review M-1, 2026-11-11). tierb.merge_eval read each single-seed run with load_paired_records and wrote a clean merged file, so a bad line or a later duplicate (which overwrote the earlier record) never reached the gate. It now reads each run with the same rule (runner.results_lines, shared with read_arm_records): a line that does not parse, is not a JSON object or has no problem_idx, a problem_idx or repeat that is not an integer (verifier choice: nothing is coerced), and a second record for one (problem_idx, repeat) refuse with MERGE-EVAL runs[<r>] (line number and fix); nothing is written.
  • R11A-29 (LOW-6). Top-level baseline_pilot_mean (05 §6.1, R13-9; the name is a verifier choice) is optional: a recorded prototype deviation from R13-9, which states the pilot baseline mean beside sigma_pilot as part of the registration. Absent, nothing is checked, so existing registrations (the demo, the Tier B template, the real long run) stay valid. Given, it must be a finite number (not a bool, string or null) strictly inside the deciding evaluator's declared range; a closed bound equal to it (floor or ceiling) is refused, an open (None) bound checks nothing on its side (REG-FIELD registration.baseline_pilot_mean). created_at is required when amends is given (REG-FIELD registration.created_at).
  • R11A-30 (LOW-7). Boundary and R13-8 pins; no code change needed beyond the above.
  • Existing revision 10 tests changed (R11A-29, chosen by the maintainers 2026-11-11). Five fixtures set amends without created_at and were refused by the new rule; each now also sets created_at: "2026-11-11T09:00:00Z" (test_r10_registration.TestAmendmentFields.test_amends_accepted, test_post_hoc_accepted; test_r10_tierb.TestAmendment, TestPostHoc, TestLongRunShapedRegression). The value does not change their results: the gate reads the declared post_hoc flag only (R11A-16). Recorded in tests/README.md section 11.16.

Review fixes to revision 12 (tests/README.md section 11.17, R12A-18 to R12A-23)

  • R12A-18. evaluate_constraint(..., *, items, ...): items is a required keyword; the expected items are items x K per arm, never the items of the records (a deleted violating record is absent). The test_r12_constraints helper now passes registered_items(...), the IDs i0000 ... for the matrix size (test edit chosen by the maintainers).
  • R12A-19. expected_models as in gates.evaluate_items: an arm whose model_manifest_hash differs, is null or absent is MISSING model_hash_mismatch (the baseline arm too, non-inferiority form).
  • R12A-20. gates.evaluate_items raises ValueError on a clause with constraint_set.
  • R12A-21: batches and canaries. Batch checks run per judge and per arm: every judge checks every record, so each judge's own batches must cover all of an arm's records and each must hold a registered canary (blocking clause: else canary_absent); flagged counts only when it is true. A batch whose judge is not a registered judge, a record entry that is not [item, repeat], or a record in two batches of one judge is MISSING malformed_batch (verifier choice; applied blocking or not, since it is a malformed input, not a canary rule). At registration, on a blocking clause with judges, a canary that violates only tool-checked constraints is REG-JUDGE registration.constraint_set.canaries[<i>]. An approval whose destination is not upload is REG-EGRESS / egress_unapproved (already so; now pinned).
  • R12A-22. model_version fails (d) when empty after stripping or equal, after stripping and case folding, to latest, current, stable, default or newest (constraints.FLOATING_VERSIONS); family is compared with policy_family and training_reward_families after stripping and case folding.
  • R12A-23. constraint_report(...).judges.<id> adds transfer_test. For an external judge each arm's egress_approval_id must equal the registered approval_id; another value, null or absent is MISSING egress_unapproved (either arm). test_r12_constraints.TestJudgeAtRunTime.test_external_judge_recorded_verdicts_no_network now sets the arm's id (test edit chosen by the maintainers).
  • Still deferred (R12A-24). Binding the clause's blocking to the spec gate and excluding supporting clauses from combine come with the ext-collect wiring.

Re-review fixes (tests/README.md sections 11.16 and 11.17: R11A-28 extended, R12A-25 to R12A-28)

  • R12A-26 (L-3). A registration listing one evaluator id twice is refused REG-FIELD registration.evaluators[<i>].id (i the later occurrence): the deciding evaluator, found by id, would be ambiguous (before, the first entry decided and a scorer on a later duplicate was ignored).
  • R12A-27 (L-1, L-4). tierb.load_registration (merge-eval, nel-config) always checks the registration against tierb.EVALUATOR_ID, wherever it is listed, and refuses a registration that does not list it (REG-FIELD registration.evaluators); the index-0 fallback is gone. A decoy listed first decides nothing (regression test; the mutant check_contents(reg) fails it).
  • R12A-28 (L-5). A ratio part too large to convert to a float (OverflowError, such as the integer 10400) or outside the finite range |numerator| <= 1e12, 1e-12 <= denominator <= 1e12 (gates.RATIO_PART_LIMIT, verifier choice) is a missing item out_of_range. Before, 10400 raised OverflowError and a single numerator of 1e308 raised ValueError in the bootstrap (overflow to NaN). Within the range every arm sum, ratio, contribution, jackknife power and bootstrap ratio is finite. A score too large to convert is out_of_range too (gates._out_of_range).
  • L-2. constraints.evaluate_constraint raising ValueError on a repeated item ID is now pinned by a test.
  • Deferred (R12A-25). Requirements for wiring constraint clauses through ext-collect: (a) constraints.check_registration takes the gate's evaluator id and compares the deciding entry's manifest_hash with constraint_set_hash(registered set), refusing a missing or duplicated id (it reads evaluators[0] today); (b) evaluate_constraint gets the registered constraint_set, and each arm's constraint_set_hash must equal the deciding entry's hash; (c) items from the registered item set, expected_models from the run's model manifests; (d) verdict records read with the strict reader.

External-run adapters, slice 1 (tests/README.md section 11.18, EXT-1 to EXT-38; MULTIMODAL-SPEC.md)

  • Modules (naming choices): gatedtrain/ext/registry.py (section 6 tables as data, adapter(name), evaluator_identity_hash), ext/adapters/trl_grpo.py (cuts, identity, consumption, framework pin, base binding; every TRL fact in one constant block marked unverified), ext/arm.py (strict per-item arm reader shared by collect and merge), ext/launch.py (ext-launch, the isolation rules shared with collect, gpu_seconds, gpu_used_h), ext/smoke.py (smoke_verdict), ext/collect.py, ext/merge.py, ext/from_nel.py. Commands ext-collect, ext-merge-eval, ext-launch, ext-from-nel in cli.py. No module under gatedtrain/ext imports a framework, torch or a pickle loader (EXT-12).
  • Reused, not duplicated. spec.load_spec (the registry ids validate as backend ext; run refuses them with SPEC-REF, tierb-collect with TIERB-SPEC), registration.check_contents with the gate's evaluator deciding (deciding_evaluator, R11A-23; resolved_evaluator_hash returns the EXT-6 identity hash for registry evaluators), items.EVALUATORS (filled from the registry rows), runner.check_pins, copy_registration, write_plan (new optional n_available), write_manifests, gate_and_report (new optional records, model_hashes, expected_models; the Tier A and Tier B paths are unchanged), gates.evaluate_items, ledger.SCHEMA and shard_table, the tierb strict NeMo Evaluator readers (_read_run_strict, _run_seed_and_repeats, _run_sampler, _declared_scorers). ext-merge-eval and ext-from-nel read the registration with the runs' or --evaluator's id deciding, never through tierb.load_registration (R12A-27).
  • Impact (EXT-19). impact.impact_query adds, per run, every checkpoint of a training stage whose data edge has precision stage and whose snapshot holds the shard (first_step and derivation null, possibly consumed), and then follows used model edges by model_hash across the selected runs to a fixpoint, at the coarsest precision on the path (R13-10). Every result row now carries model_hash (null for Tier A and Tier B rows) and via_model_hash (the parent model hash of a transitive row).
  • Report. gate_report.json adds adapter, independence_tier, gpu_seconds, contamination, consumption_precision, incomplete_cuts, baseline_model_hash, candidate_model_hash; the text report prints them; a T0 tier prints the non-blocking note beside the status (no T0 evaluator in this slice).
  • Choices made in the implementation. The launch record's field paths are reported as --launch-record.<path> (ext-collect) and --request.<path> (ext-launch). ext-collect also copies files named by output_ref into eval/<arm>/ so the record stays resolvable inside the run. ext-merge-eval requires every eval_meta key but eval_seeds and created_at to agree between runs (MM-5 names five; the others identify the evaluator and arm). A non-numeric scorer value in ext-from-nel refuses (EXT-NEL); a missing one is a missing_score record. Registration key contamination takes only allow_exact_overlap (bool).
  • Test defect, fixed by the maintainers (2026-11-11). test_ext_collect.TestTransitiveImpact.test_shard_of_second_run could not pass: _ext.build_stage_out wrote byte-identical checkpoints for runs X and Y, so y.cand_model == x.cand_model. The fixture now takes a weight tag (ExtScenario(stage_tag=...)); run Y uses y-ckpt, and test_chain_hashes asserts that Y's trained hash differs from X's. No implementation change.
  • Deferred (tests/README.md section 11.18). TRL iteration precision, observed sample logs and exposure, LoRA identity and lora_compose, normalizer and environment versions, two-stage chains, WER and T0 report fixtures, constraint clauses through ext-collect (refused REG-CONSTRAINT), root-image deviations, registry rows of areas 2a to 8. The TRL layout (checkpoint-<N>, trainer_state.json written last, config.json _name_or_path) stays unverified (checkpoint_completeness.verified: false) until the area-1 smoke run.

Slice 1 review fixes (tests/README.md section 11.18, EXT-39 to EXT-47)

  • H1, EXT-39: docker option injection. An image --volume=/:/host@sha256:<64 hex> matched the old image rule ([^\s@]+@sha256:) and landed where docker parses options; ext-collect re-checked with the same rule. The image now follows the Docker reference grammar (never a leading -), mount and tmpfs paths hold no : or ,, environment names are identifiers, the network is a Docker object name, and build_command raises if a value before the image starts with -. Both ext-launch and ext-collect refuse.
  • M2, EXT-40: sockets. The docker.sock substring rule missed /run/docker-gatedtrain.sock, /var/run, /run and /. Mounts are now judged on the lexical path and its realpath: a socket path or file, an ancestor of a daemon socket, or anything under /run or /var/run is refused.
  • M1, L2, EXT-41: refuse before writing. The training-data manifest used to be computed after the run directory existed, so a symbolic link in the training data left a partial run directory and exit 1; a symbolic link in the item set or a non-UTF-8 items.jsonl raised. All manifests are now computed in the checks and every read failure is a refusal; a write failure after the checks removes the run directory.
  • M3, EXT-42: impact merge. A run returned through its own data edge was skipped when also reached through a used model edge, which lost the cuts before its first direct use and kept a finer precision than the path's. Cuts are now merged and coarsened per cut.
  • L1, EXT-43: safetensors. Header length capped at 100 000 000 bytes (the reference implementation's cap; a 300 MB sparse header used to be read into memory), RecursionError from deep nesting is a problem string, offsets must be integers (not booleans) with begin <= end.
  • L3, EXT-44. meta_differences fell back to ==, so [False, True] equalled [0, 1]; ext-merge-eval compared with != alike. Both now compare canonical JSON bytes.
  • L4, EXT-45. An output_ref naming eval_meta.json (also ./eval_meta.json) made ext-merge-eval overwrite the merged eval_meta with a source's; reserved names are refused. A test now pins the resolve-inside-the-arm check (review mutant M01).
  • L6, EXT-46: GPU seconds. Labels were free strings, so two launches sharing a request label were summed together. ext-launch now appends 12 hex digits of the record's hash, and ext-collect recomputes it. A run whose last END has a non-zero rc refuses. <HOST_WORK>/bin/gpu-step.sh hardcodes WORK=<HOST_WORK> and writes its log there whatever host_work the record names; ext-collect reads <host_work>/gpu-guard.log only when the script's WORK= line is host_work (choice: checked against the script, no new record field). For real runs, host_work must therefore be <HOST_WORK> until the script takes its work directory from the environment.
  • L7, EXT-47: provenance. ext-collect checks a merged arm's merge.json against its sources (hashes, seeds, eval_meta) and a non-null checkpoint.base_model_hash against the spec base. ext-from-nel records each run's NeMo Evaluator service model (service_model in merge.json) and refuses runs that name different ones; that the server loaded --checkpoint stays a claim, because a served model name cannot be compared with a directory on the host that ran the prototype (choice). A test now pins the non-numeric score refusal (review mutant M25).
  • L5, deferred: cross-tier transitive impact. Tier A and Tier B lineage (runner, tierb) writes no model_hash on checkpoints or used model edges, so impact --runs-root cannot follow an external run that starts from a Tier A or Tier B checkpoint back to the shards of that tier (and the reverse). Adding model_hash to Tier A/B lineage is deferred; until then cross-tier impact answers are incomplete.
  • Existing tests changed as a direct consequence. tests/fixtures/ext/launch-command.golden.txt (label ext-a1-trl-smoke became ext-a1-trl-smoke-c85ff5d6a424, EXT-46); test_ext_launch.TestGoldenCommand.test_record_contents (the label is checked as the hashed label) and test_never_runs_the_command (label prefix); tests/_ext.py (launch_label, launch_record(hashed_label=...), gpu_step_script, ExtScenario.label, the guard log written for the hashed label); test_ext_collect.TestCollectRefusals.test_gpu_label_without_end (writes and restores the guard log for the scenario's hashed label).

TRL adapter against verified facts (tests/README.md section 11.18, EXT-18, EXT-20, EXT-24 changed; EXT-48 to EXT-50)

Sources: trl 1.16.0 and transformers 5.17.0 clones at <mm-root>/src/ (byte-identical to the area-1 venv), the area-1 runtime <mm-root>/area1-trl/ (README.md, train_grpo.py). Each fact the adapter encodes was re-read at the cited line.

  • Cut layout (EXT-13, EXT-48). checkpoint-<global_step>/ (transformers trainer.py:3222, trainer_utils.py:266), save_model first (:3229), optimizer, scheduler and RNG state (:3252-3255), trainer_state.json last (:3269); TRL writes the model card before calling the parent (grpo_trainer.py:3389-3390). The one exception, entropy_ctrl_state.json after the state with use_adaptive_entropy (:3391-3395), is not used. The completeness rule is unchanged; it now carries sources, and verified stays false until a smoke run shows the layout on disk. The fixture cut now has the verified file set (tokenizer files tokenizer.json, tokenizer_config.json, chat_template.jinja only), the stage output the files train_grpo.py writes (no top-level save_model files, no runs/).
  • Base binding (EXT-20). config.json never holds _name_or_path (configuration_utils.py:1068-1069, written through the diff dict at :606), so the old rule refused every real run. The adapter now reads run_args.json model_name_or_path (written by train_grpo.py) and compares it with the read-only base mount's container path; config.json is not read for it.
  • Consumption (EXT-18, EXT-48, EXT-49; maintainers' decision). iteration by the MM-22 mapping when run_args.json shows shuffle_dataset: false (RepeatSampler file order, utils.py:935; short last chunk dropped, :943), one generation batch per optimizer step (steps_per_generation × num_iterations = gradient_accumulation_steps, grpo_trainer.py:1538-1546), one process (generation_batch_size = per_device_train_batch_size × steps_per_generation, grpo_config.py:1098-1100), and a train_file_sha256 equal to the spec shards' concatenation; P = generation_batch_size / num_generations (grpo_trainer.py:1309-1316). Rows reuse ledger.step_shards (same drop-the-tail epoch rule as D-1), derivation: reconstructed. Anything else is stage with the reason in the report note. samples.jsonl is not read. collect passes run_id to consumption and stage_out to checks.
  • Seeds (EXT-32, EXT-50). seed_derivation names run_args.json and the known limitation (vLLM colocate engine seed process_index // tp = 0, vllm_generation.py:357). New verifier choice: run_args.json seed must equal the launch record's training_seed (EXT-LAUNCH --launch-record.training_seed).
  • Launch command (EXT-24, MM-34). build_command adds --runtime=nvidia before --gpus all (GPU steps only), --shm-size=8g after the security options, and mounts each tmpfs path :rw,exec,size=8g; fixed in code, the record's tmpfs stays paths only (EXT-39). MM-34 now states the exec requirement. The golden request follows the area1-trl README shape (venv_in_container with a fixture lock, venv and Python mounted read-only at their own paths, /inputs, one writable /out); new label ext-a1-trl-smoke-be4d77f1644d.
  • Fixture versions. _ext.FREEZE is now trl 1.16.0, transformers 5.17.0, vllm 0.31.0, torch 2.13.0.
  • Open: TOKENIZERS_PARALLELISM is refused. The README's command sets TOKENIZERS_PARALLELISM=false, but the EXT-26 credential-name rule (TOKEN anywhere in the name) refuses it, so ext-launch would refuse the README request as written. The golden request leaves it out. Options: (a) match credential words as name components ((^|_)TOKEN(S)?($|_) and the like), (b) drop the variable from the area-1 command (tokenizers then may warn after fork), (c) an explicit allow list. Not decided here.
  • Open: tmpfs option string. The maintainers' fact sheet names /tmp:rw,exec,size=8g; the area1-trl README command uses rw,exec,nosuid,nodev,size=8g. Encoded: the maintainers' string (launch.TMPFS_OPTIONS). Whether Docker adds nosuid,nodev to a --tmpfs mount by default (which would make the two strings mount alike) was not checked (no Docker source offline); one constant changes it.
  • Not verified here. That the tokenizer save writes only the three tokenizer files and that weights are fp32 rest on the recipe maintainers' CPU check (README "Outputs"), not on a source read. That an IterableDataset is not used rests on train_grpo.py (Dataset.from_list); run_args.json does not record the dataset type. Nothing was run on a GPU.
  • Existing tests changed as a direct consequence. tests/_ext.py (docstring, FREEZE, build_hf_dir(layout=...), build_checkpoint and build_stage_out in the verified layout, run_args, shuffle_args, ExtScenario(args_mutate=...) replacing base_name_or_path); test_ext_collect (TestCollectPass expects iteration; the stage tests moved to TestCollectShuffledStage; test_base_binding_mismatch edits run_args.json; TestTransitiveImpact uses shuffled runs and copies chat_template.jinja); test_ext_registry (component list, final-save test builds its own output, completeness sources); test_ext_launch (launch copies the lock fixture; record runtime and env names); test_ext_hardening.test_only_fixed_options_before_the_image (the two fixed flags); both golden fixtures.

Review round 2 fixes (tests/README.md section 11.18, EXT-51 to EXT-61; EXT-24, EXT-26, EXT-40, EXT-42, EXT-46, EXT-47 changed)

Sources: the round-2 review of the external-run commands (findings H-1, M-a, M-b, L-a to L-f, mutant X2; probe scripts p_iso.py and test_probe_rv2.py), design revision 14 (R14-1, 05 §11.2), two maintainers' decisions from the TRL adapter round. Host facts read on the host that ran the prototype (2026-11-11): /run/docker.sock, /var/run/docker.sock and a second daemon's socket /run/docker-gatedtrain.sock are sockets of group docker, mode 660; the operator user is in that group.

  • H-1, EXT-51: host paths the daemon resolves. os.path.realpath returns /proc/1/root unchanged for a non-root user (the link cannot be read), while dockerd (root, no user-namespace remapping) mounts the host's /; with user: "1000:984" the container could then reach the daemon socket. A host path under /proc, /sys or /dev (lexical or resolved) is now refused, every mount source must resolve with realpath(strict=True), and the container's gid may be neither 0 nor the group of an existing daemon socket (launch.docker_socket_gids, injectable as isolation_problems(socket_gids=...)). Both ext-launch and ext-collect. Consequence: a mount source must exist on the launch host when ext-launch runs (docker would otherwise create it as root); the golden request's /data/... paths are moved under a created test root (test_ext_launch.rooted), and the golden command is compared with the root removed and the label written <label>.
  • M-a, EXT-52: merged arms re-derived. merge.json checks covered the sources only, so editing the arm's scores passed. ext-collect now rebuilds items.jsonl from the sources (arm.merge_records for ext-merge-eval, from_nel.convert_records with the registered item set for ext-from-nel, the same functions the commands write with) and requires byte equality. Not done, open question below: refusing a multi-seed arm without merge.json.
  • M-b, EXT-53. START, END rc=0, START, PREEMPTED was accepted; the label's last terminal event must now be END rc=0.
  • L-a, EXT-61. The refusal text and docs now say the hashed label is an unkeyed checksum that detects accidental edits only.
  • L-b, EXT-57. gpu-step.sh may assign WORK and LOG once each (any X=, export X=, a; X=, ${X:=...} in a line). Documented as a guard against a misconfigured host_work only: a forged script is read, never run, and is not detected.
  • L-c, EXT-54. Image, label (request and hashed), user, network, environment names and the END rc use re.fullmatch with ASCII [0-9]; a trailing newline or ١٠٠٠ is refused.
  • L-d, EXT-56. A leading // is read as /, and the MM-34 rules compare resolved paths too: //<host_work>, //<parent of output> and symbolic links to either are refused.
  • L-e, EXT-58 (R14-1). impact._transitive keeps every path of a cut in paths and answers with the finest per-path precision; a row-level consumed cut is no longer weakened by a stage path. The EXT-42 tests that asserted coarsening now assert R14-1.
  • L-f, EXT-59. An exception while writing (after every check) in ext-collect, ext-merge-eval, ext-from-nel removes the partial output and exits 3 with error[EXT-WRITE], not 1. ext-launch is unchanged (it writes one file with open("xb")).
  • X2, EXT-60. A direct build_command test now covers every value before the image.
  • Maintainers' decisions. Credential names are matched by component (EXT-55): TOKENIZERS_PARALLELISM=false is back in the golden request (this resolves the TOKENIZERS open item of the TRL section), and AWS_ACCESS_KEY_ID, which the old substring list missed, is now refused. launch.TMPFS_OPTIONS is rw,exec,nosuid,nodev,size=8g as in the area1-trl README (resolves the tmpfs open item).
  • Open: a multi-seed arm without merge.json. The review asked to refuse it (deleting merge.json removes every provenance check). Not implemented: MM-1 and MM-5 accept an arm written in one piece with K repeats (MM-5 merges "single-seed or multi-seed arm directories"), every collect fixture is such an arm, and the rule would not stop a deliberate forgery (a hand-written source wrapped by a one-source ext-merge-eval passes). Options: (a) keep accepting one-piece arms (recommended for the prototype; document that provenance is checked only when merge.json is present); (b) require merge.json whenever K > 1, i.e. every multi-seed arm passes through ext-merge-eval or ext-from-nel (spec change to MM-1/MM-5/MM-9, fixtures rebuilt through merge); (c) have evaluators write a provenance file of their own for one-piece arms.
  • Existing tests changed as a direct consequence. test_ext_launch.launch (requests rooted under a test directory; new helpers rooted, unrooted; root= keyword), TestGoldenCommand.test_command_matches_golden, test_record_contents, test_never_runs_the_command (mount sources created), test_gpu_runtime_shm_and_exec_scratch (tmpfs options); fixtures/ext/launch-request.golden.yaml (TOKENIZERS_PARALLELISM, comment) and launch-command.golden.txt (<label>, tmpfs options, the new -e); test_ext_hardening.TestLaunchLabel.record (one host root), TestImpactMerge (R14-1).
  • Mutation check (copy of the tree, gatedtrain.__file__ in the copy). 18 mutants reverting the new checks: 17 killed by test_ext_review2 / test_ext_hardening / test_ext_launch. Survivor: the hashed-label fullmatch (EXT-54) reverted to match with $: equivalent, since a label with a trailing newline still differs from the recomputed one. The first run also left the lexical /proc check, the resolved-path kernel check, the // normalisation and the resolved host_work comparison alive; /proc/self/cwd, //proc/self/cwd, links to /sys and /dev/shm, and a link to a host_work outside the output tree were added and kill them.
  • Not addressed (outside this round's findings). A read-only mount of an ancestor of host_work (for example the operator's home directory) or of /var/lib/docker is still accepted; the MM-34 rule names host_work itself only.

Follow-up to review round 2: maintainers' decisions (tests/README.md section 11.18, EXT-52 changed, EXT-62)

  • Multi-seed arms without merge.json (EXT-52, option a). Kept as the spec has them: source provenance is checked, and items.jsonl re-derived, only when merge.json exists. A one-piece K-repeat arm's provenance is the evaluator's claim (MM-5, MM-9 text updated).
  • EXT-62: ancestors and engine data. The open item "an ancestor of host_work or /var/lib/docker is accepted" is closed: a mount source that is an ancestor of host_work (lexical after // → /, or resolved) is refused, as is anything at or under /var/lib/docker or /var/lib/containerd, at ext-launch and ext-collect. Ancestors of the output and of /run, /var/run were already refused (EXT-26, EXT-40). The golden request and the area1-trl README's read-only inputs with host_work <HOST_WORK> stay accepted (tested on the host that ran the prototype). Mutants (scratch copy): the ancestor-of-host_work check and the engine-data check removed, one at a time; each kills TestAncestorAndDockerData.

Review round 3 fixes (tests/README.md section 11.18, EXT-63 to EXT-78; EXT-23, EXT-49 changed)

Sources: the round-3 review of the external-run commands (findings H1, H2, M1 to M5, L1 to L8; probes p_iso3.py, test_rv3_probe.py; surviving mutants M15, M18), MULTIMODAL-SPEC MM-21, MM-23, MM-34 to MM-36, design revision 14 (05 §11.2). Host facts read 2026-11-11 on the host that ran the prototype: the operator's primary group is its own (gid equal to its uid) and its supplementary groups include docker; the second daemon's daemon.json sets data-root (only that key read); <output-root> does not exist yet (the operator creates <out root>/area1-trl/<run> before launching, area1-trl README).

  • Host layout as configuration. launch.HostConfig (host work, output root, input roots; home and engine directories and the passwd lookup injectable for unit tests); host_config() reads GATEDTRAIN_EXT_HOST_WORK, GATEDTRAIN_EXT_OUTPUT_ROOT, GATEDTRAIN_EXT_INPUT_ROOTS, defaulting to <HOST_WORK>, <output-root> and <data-root>. Tests pass the variables (run_cli(..., env=), ExtScenario.env(), test_ext_launch.host_layout).
  • H1, EXT-63, EXT-64. The read-write output resolves (strict) to a directory strictly under the output root, outside host_work, owned by the container uid, empty at ext-launch and --recheck; the record keeps output_root, compared at ext-collect. ext-collect refuses (EXT-STAGE) any cut file, run_args.json, env-freeze.txt or samples.jsonl older than the label's first START (launch.first_start).
  • H2, EXT-65. The TRL adapter's checks (now given the spec's data directory) refuses (EXT-DATA) a missing run_args.json, a missing or different train_file_sha256, a missing read-only mount of the export directory (the shard directory's parent, export-gsm8k layout), and a train_file other than <export mount>/train.jsonl. consumption still degrades to stage when called directly. At launch the binding needs --spec (optional; see open questions).
  • M1, EXT-66. gid must be the uid's primary group (pwd); mount sources that are, contain or lie under /etc, /root, /var/log, that are or contain /home or a home directory, or lie in a home's top-level dot-directory are refused; read-only sources must lie under an input root. Decision (minimal): deny-list plus allow-list of input roots; dot-directories at a home's top level only, because the area-1 input .../area1-trl contains .venv.
  • M2, EXT-67. host_work must equal the configured one; --gpu-log must be <host_work>/gpu-log.md; gpu_step_log_problem runs at ext-launch; gpu_step_sha256 recorded and re-checked at ext-collect and --recheck; gpu_est_h > 0 (and a full run's projected_gpu_h > 0).
  • M3, EXT-68. run_args profile equals the record's (EXT-PROFILE), dry_run is False, grpo_config.max_steps equals the last cut's step (EXT-STAGE).
  • M4, EXT-69. build_command emits the strict realpath of each -v source; ext-launch --adapter NAME --recheck RECORD [--spec SPEC] re-validates the record now (exit 3 on any problem). Documented in MM-36 with the remaining window between recheck and docker's mount.
  • M5, EXT-70; L4, EXT-74. 0:1000 refused for request and record; uid/gid above 2^31-1 refused; duplicate container paths (mounts and tmpfs, normalised) refused.
  • L1, L2, EXT-71, EXT-72. Credential components APIKEY, PAT, AUTH, PASSPHRASE and a TOKEN/KEY name suffix (so MONKEY is refused too, a false positive accepted); NVIDIA_*, DOCKER_*, LD_PRELOAD, LD_LIBRARY_PATH refused.
  • L3, EXT-73. Engine data directories include the daemons' data-root; their ancestors are refused (/var/lib, <data-root>/gatedtrain-docker; note <data-root> itself is therefore never mountable).
  • L5, EXT-75. _new_run_dir, the merge/from-nel parent and temporary directory, and the launch record write: OSError is EXT-WRITE exit 3; the write handlers now catch OSError only, so a programming error propagates (traceback, partial run removed).
  • L6, EXT-76. Golden-order test for merge_records (kills M15). L7, EXT-77. Every impact path carries chain (data edge with precision, then model edges with precision null). L8, EXT-78. samples.jsonl, when present, must log exactly the reconstructed rows of steps 1 .. last cut (step = consuming optimizer step, verified in trl 1.16.0 grpo_trainer.py:1538-1546, :1584-1588 and train_grpo.py GSM8KReward._log), else stage.
  • Fixtures and existing tests changed. _ext.ExtScenario: export layout <root>/export/{train/, train.jsonl} (spec template file:export/train), output root <root>/out, stage output <root>/out/a1/stage-out (was under host-work), gpu-log.md in host work, launch record with the export mount at /inputs/export and the new fields, retrain(), env(); samples.jsonl follows the run's batch shape; _support.run_cli(env=). Golden request and command: output /data/gatedtrain-mm/out/a1/stage-out. test_ext_launch.launch (host layout, --gpu-log <host_work>/gpu-log.md), test_never_runs_the_command (script with WORK/LOG lines, input root), CASES "output mounted elsewhere" and "parent of output mounted"; test_ext_review2 (unit_config, gid tests with an injected primary group, README-mounts test with the output root moved, TestGpuStepAssignments relaunches the record, run_injected(env=), TestMountNormalisation output parent); test_ext_collect.TestContaminationAllowed (retrain()).
  • Results. test_ext_*.py 304 tests OK (78 new); full suite 1040 OK, 1 skipped (run before the last 3 tests were added; the ext set was rerun after). Mutation: 47 mutants, one per new check, on scratch copies: first pass 39 killed, 7 survived (directory check, missing hash, train_file path, unknown uid, recheck script log, samples line shape) plus one bad pattern; tests strengthened, all 47 killed.
  • Open. (1) --spec at ext-launch is optional; make it required? (2) Probe items outside this round's findings stay accepted: tmpfs /, an empty argv string, env values with newlines, HF_ENDPOINT, named networks with reasons. (3) The env-variable overrides let an operator loosen the host layout; the record keeps output_root, and ext-collect compares with its own configuration only.

Review round 4 fixes (tests/README.md section 11.18, EXT-79 to EXT-89; EXT-23, EXT-26, EXT-65, EXT-66 changed)

Sources: the round-4 review of ext-launch and ext-collect (findings H1, M1 to M3, L1 to L6; probes p4.py, mut.py; surviving mutants R1, R5; the real area-1 request and record), MULTIMODAL-SPEC MM-21, MM-34 to MM-36. Host facts read 2026-11-11 (file names only, no contents): the data disk holds other projects with .env and *_credentials.json files and <tierb-root>/hf-home-host; the standalone CPython at <mm-root>/python holds the standard library's secrets.py; area1-trl/train_grpo.py writes env-runtime.json script_sha256 = sha256_file(Path(__file__).resolve()) (write_env_freeze).

  • H1, EXT-79. No global input root: registry.TRAINER_ROWS[<adapter>]["input_roots"] (registry.input_roots); for trl_grpo the four area-1 inputs. HostConfig.input_roots is None unless GATEDTRAIN_EXT_INPUT_ROOTS is set, and launch.adapter_config fills the adapter's roots in ext-launch, --recheck and record_problems (ext-collect). Without roots, no read-only mount passes.
  • H1, EXT-80. launch.credential_name_problem: every read-only source that passed the other mount rules is walked (resolved, links not followed) and each name, plus the source's own, is matched lower-cased against the review's list; .venv and site-packages are not descended into; an unlistable directory or more than 200 000 entries refuses. Names only, nothing is opened. Assumption (no decision recorded): the standard library's secrets module (lib/python3.<N>/secrets.py and its __pycache__ byte code) is exempt, because *secret* otherwise refuses the real area-1 interpreter <mm-root>/python; an application's secrets.py elsewhere is still refused. Alternatives: skip a whole lib/python3.<N> standard library like site-packages, or drop *secret* for .py/.pyc files.
  • M1, EXT-81. host refused always; another network needs ext-launch --allow-network and a reason; the record keeps allow_network (true only with the flag and a network other than none); a record without it, or with a non-boolean, refuses. network_host_reason stays in the request and record schema without effect (kept so old requests still parse).
  • M2, EXT-82. --recheck re-reads <host_work>/gpu-log.md; a different running total exits 3 (EXT-GPU --recheck.gpu_used_h). The review's record (gpu_used_h 3.12) would now fail: the host total is 3.22.
  • M3, EXT-83. launch.argv_script: the first argv element after argv[0] that is a container path in a read-only mount naming a regular file that resolves inside the mount; recorded as script_path, script_sha256; argv without one is refused. record_problems recomputes it (ext-collect, --recheck), and the TRL adapter's script_problems compares env-runtime.json script_sha256 with the record's; env-runtime.json joined collect.READ_OUTPUTS (EXT-64 staleness).
  • L1, EXT-84. --spec required at ext-launch and --recheck when the registry row sets spec_binding (adapter binds_spec; TRL). Resolves the round-3 open question (1).
  • L2, EXT-85. host_config_sha256 (canonical JSON {host_work, output_root, input_roots}) in the record, compared at ext-collect and --recheck; ext-launch and ext-collect print warning: <VAR> overrides the host layout (...) per set GATEDTRAIN_EXT_* variable.
  • L3, EXT-86; L4, EXT-87. Tests only: the output root itself as output (empty root at launch; at collect), and each of env-freeze.txt, samples.jsonl, env-runtime.json alone stale. Kill R1 and R5.
  • L5, EXT-88. Refused: tmpfs at /, an empty argv string, env values with \n, \r or NUL (value not shown; \r added to the review's list), and a mount or tmpfs strictly inside a read-write mount's container path.
  • L6, EXT-89. gatedtrain/cli.py has an if __name__ == "__main__" guard; pyproject declares no console script, python -m gatedtrain (__main__.py) is unchanged.
  • Fixtures and existing tests changed. _ext: CODE_CONTAINER, SCRIPT_CONTAINER, SCRIPT_TEXT, host_config_sha256, write_bound_spec; ExtScenario writes <root>/code/train_grpo.py and passes its SHA-256 to build_stage_out (env-runtime.json); launch_record mounts the code at /code (mounts[3], so collect tests appending a mount now name mounts[4]) and adds the four new fields. test_ext_launch: rooted writes a stub for a moved .py argv element, launch(spec=True) passes a bound spec (bound_spec); CASES host network ... now expect ...network; test_network_host_with_both_reasons_accepted became ..._refused. test_ext_review3: scenario_request mounts the code, recheck and TestRecheck.recheck pass --spec, test_environment_override (no global input root). test_ext_review2.test_area1_readme_mounts_accepted uses adapter_config; mounts[3] to mounts[4] in test_ext_review2, test_ext_hardening. Golden command and request unchanged.
  • Real area-1 request. The review's rv4/real/request.yaml, with only the output moved under a scratch output root (GATEDTRAIN_EXT_OUTPUT_ROOT), passes ext-launch --spec and --recheck. Spec: a minimal one written by _ext.write_bound_spec (fixture registration and item set) binding the real base <tierb-root>/tierb/base-model and export <tierb-root>/tierb/export, since no area-1 spec exists yet. Record: script_path <mm-root>/area1-trl/train_grpo.py, script_sha256 equal to sha256sum of the file, allow_network false, gpu_used_h 3.22.
  • Mutation check (scratch copies, gatedtrain.__file__ in the copy). 41 mutants, one per new check plus R1 and R5: 39 killed in the first pass. P26 (env-runtime.json missing or a link) survived and a test was added that kills it. P5 (recheck without adapter_config) is equivalent and survives, because record_problems applies the adapter's roots itself.
  • Open. (1) The stdlib secrets exemption above. (2) network_host_reason is now dead schema; drop it from REQUEST_KEYS/RECORD_KEYS in a later schema version? (3) The name scan runs at ext-collect too (about 5 000 entries for the real interpreter; fast). (4) HF_ENDPOINT and the probe's PYTHONPATH=/out stay accepted (outside this round's findings; the second is harmless now that nothing is mounted inside /out except the output itself, but code in /out can still be imported).

Line separators inside JSON strings (tests/README.md section 11.18, EXT-90)

  • Defect. Readers used str.splitlines(), which also breaks on U+2028, U+2029, U+0085, \x0b, \x0c, \x1c-\x1e. JSON allows U+2028 and U+2029 raw inside strings and export-gsm8k writes ensure_ascii=False; the real GSM8K export holds one such row (<tierb-root>/tierb/export/train/shard-00004.jsonl line 382, question field; also in export/train.jsonl). ext-collect refused every area-1 run with error[EXT-CONTAMINATION] artifacts.train.uri: ... shard-00004.jsonl:382 does not parse. ledger._count_lines (file iteration) already counted 500 rows for that shard while splitlines saw 502 lines.
  • Fix. canonical.text_lines splits at \n, \r\n and \r only (identical to splitlines for these, including no trailing empty line). Used by collect.read_item_set, collect.exact_overlap, arm.read_lines, trl_grpo.read_samples, runner.results_lines, runner.item_ids, runner.write_plan, tierb._read_jsonl, and the text readers launch.gpu_seconds and launch.first_start (gpu-guard.log), launch.gpu_step_assignments and gpu_step_log_problem (gpu-step.sh; bash ends lines at \n only), launch.gpu_used_h (gpu-log.md), trl_grpo.framework_identity (env-freeze.txt) and from_nel._framework_version (YAML snapshot header; YAML 1.2 line breaks are \n and \r only). Behaviour is unchanged except for the separator characters. Not changed: ledger._count_lines (already \n-based) and gates.load_paired_records, a copy of NeMo Evaluator's reader (comparison.py:364 at ea35ba3) that keeps upstream's splitlines; NeMo Evaluator writes results.jsonl with default (ASCII) json.dumps, so it holds no raw separator; and stubs/task.read_rows, whose rows are ASCII digit sums and whose file is hashed into the stand-in evaluator identity that the demo registrations pin (runner.stub_evaluator_hash; editing it broke 14 Tier A tests in the first full run, so the edit was reverted).
  • Tests. tests/test_ext_lines.py (19): each reader with U+2028, U+2029, U+0085 inside JSON strings; error line numbers after such a row; row-count agreement (shard table, item set, item_ids); the text files; ext-collect PASS with separator rows (exact_overlap 0) and, with a leaked row beside them, a refusal naming registration.contamination.allow_exact_overlap (not artifacts.train.uri); the real export (skipped without the data disk). Before the fix every test failed (the env-freeze case first passed by accident, the last line winning, and was reordered; rechecked on a scratch copy with the original modules). Full suite after the revert: 1,113 tests OK, 1 skipped (the test_ext_*.py set is 374; it ran 375 OK alone before the stub-task test was dropped).
  • Real export (CPU, read-only). export/train, 15 shards: shard_table 7,473 rows, 7,473 parsed, equal to export/train.jsonl; one row holds U+2028. Area-1 item set <mm-root>/area1-trl/gate/items/items.jsonl: 1,319 items, no problems; exact_overlap on question (the evaluator's payload_text_field) is 0.

Review round 5 fixes (tests/README.md section 11.18, EXT-91 to EXT-97; EXT-23, EXT-26, EXT-72, EXT-80, EXT-83, EXT-88 changed)

Source: the round-5 review (yes-with-conditions; findings M1, M2, L1 to L4, surviving mutants Q1, Q4, Q5). Tests first: tests/test_ext_review5.py (38) failed on the round-4 code (42 failures, 66 errors) before the change.

  • M1, argv binding (EXT-91). launch.bind_argv replaces argv_script: argv[0] is the interpreter and argv[1] the script, nothing between them; argv[1] starting with - refuses (-c, -m, -, -u). Both resolve with launch.container_file, which walks the path component by component through the read-only mounts as the container would: a link is read on the host, an absolute target is a container path (so the real .venv/bin/python -> <mm-root>/python/cpython-3.12.16-linux-x86_64-gnu/bin/python3.12 resolves because that directory is mounted at its own path, and the same link under another container path refuses), a proper ancestor of a mount's container path is accepted as a directory docker creates, at most 40 links, and the end is a regular file in exactly one read-only mount. The resolved interpreter must be named python, python3 or python3.<N> (a choice: later areas that run torchrun or a shell entry point extend INTERPRETER_RE); the script ends in .py. New record keys interpreter_path (the resolved container path; area 1: .../cpython-3.12.16-linux-x86_64-gnu/bin/python3.12) and interpreter_sha256 (SHA-256 of that host file, 31 MB, about 0.05 s; equal to sha256sum); script_path stays argv[1] as written. --recheck and ext-collect re-bind and compare both paths and hashes. What it does not prove: what the container executes is still a claim (EXT-61); env-runtime.json is written by the container; the image's file system above the mount points is not inspected.
  • L1, environment allow-list (EXT-92). Registry env_names (TRL: exactly the 18 names of the area1-trl README "Environment variable names", checked against the README by a test that skips without it) replaces RESERVED_ENV_RE. Any other name refuses on the request and on the record, the value never shown; the credential message still comes first for credential names. HostConfig.env_names None allows nothing; adapter_config now fills input roots, env names, scan skip and interpreter trees independently, so the GATEDTRAIN_EXT_INPUT_ROOTS override no longer drops the adapter's other lists.
  • L2, credential name scan (EXT-93). Names NFKC-normalised and case-folded; added id_ecdsa*, id_dsa*, .npmrc, .pypirc, *.p12, *.pfx, .s3cfg, .boto, stored_tokens, and the directory-bound .docker/config.json, .kube/config, gh/hosts.yml. No directory is skipped by its name; registry scan_skip (exact paths) skips <area1-trl>/.venv and <cpython-3.12.16>/lib/python3.12/site-packages. Measured on the host that ran the prototype: the venv has 96 947 entries (about 8 s cold) and 100 hits (installed packages named *credential*/*secret*, e.g. SDK modules named credentials); the interpreter tree has 5 927 entries (0.01-0.12 s) and three hits: lib/python3.12/secrets.py, its .pyc, and pip's vendored site-packages/pip/_vendor/certifi/cacert.pem, hence the interpreter's site-packages skip rather than a cacert.pem exemption. The stdlib exemption needs top == <tree>/lib/python3.<N> (or its __pycache__) with <tree> in registry interpreter_trees. The four real sources pass in 0.02 s in all (python 0.018 s, the other three under 1 ms).
  • L3, nesting (EXT-94). One rule over every mount and tmpfs container path: none lies strictly inside another, whatever the modes (equal paths stay EXT-74). Q4: container_file now requires exactly one mount to contain a path; the longest-prefix choice is gone, and a file mounted on the script's path refuses at the mount rule and at the binding.
  • M2, schema version (EXT-95). SCHEMA_VERSION 2.0. record_problems returns one ...schema_version problem for any other version ("predates the current launch rules ... never upgraded"), and --recheck stops there. Real records now uncollectable: records/area1-trl/smoke-1.launch.json, smoke-2.launch.json, full-1.launch.json (all 1.0; area 1 is already collected).
  • Q5 (EXT-96). Test only: a record gpu_used_h 0.01 h off the running total refuses at --recheck.
  • network_host_reason (EXT-97). Removed from REQUEST_KEYS and RECORD_KEYS. Choice: a request may still carry it as null (RETIRED_REQUEST_KEYS), so the real full-1.request.yaml passes unchanged; a value refuses. The alternative, an unknown request key, would refuse every pre-round-5 request until the line is deleted.
  • Test changes for superseded behaviour. test_ext_launch.rooted moves host paths only (container paths and argv stay /data/...; under the test root they lay inside the /tmp tmpfs and EXT-94 refused them) and creates the interpreter stub; _ext.launch_record and ExtScenario run /code/bin/python3 (a stub), schema 2.0, no network_host_reason; test_ext_review2.unit_config carries the TRL allow-list; round-3/4 tests that expected KEYBOARD, PYTHONPATH, CUDA_VISIBLE_DEVICES accepted, .venv/site-packages skipped, the stdlib exemption anywhere, FOO as an env name, a mount nested in a read-only mount, or the round-4 argv cases (python -u script, a directory before the script) now assert the round-5 behaviour. Goldens: launch-request.golden.yaml drops network_host_reason; launch-command.golden.txt is unchanged.
  • Mutants (scratch copy, PYTHONPATH checked by gatedtrain.__file__; test_ext_review5.py first, survivors against every test_ext_*.py): 20, all killed. M1 interpreter not resolved through read-only mounts, M2 interpreter name, M3 .py suffix, M5 link target read as a host path, M6 longest prefix instead of exactly one mount (Q4), M7/M8 allow-list off on request/record, M9 no NFKC, M10 directory-bound names off, M11 skip by directory name, M12 stdlib exemption without lib (Q1), M13 exemption in any tree, M14 nesting only inside rw, M15 old schema accepted, M16 retired key with a value, M17 interpreter hash not re-checked, M18 recheck tolerance 0.02 h (Q5), M19 the input-roots override drops the allow-list. M4 (option check removed) and M20 (--recheck not stopping at an old schema) first survived as equivalent in the tests (an option is never an absolute path; the old-record recheck had no second problem); the tests now assert the "is an option" message and give the old record a stale gpu_used_h, and both are killed.
  • Real full-1 request. records/area1-trl/full-1.request.yaml with only output_dir and the rw mount's host moved to a new empty directory under a scratch output root (GATEDTRAIN_EXT_OUTPUT_ROOT; record in a scratch directory), --spec gatedtrain-mm/area1-trl/gate/spec.yaml, --smoke-record records/area1-trl/smoke-2.smoke.json: ext-launch exit 0 in 0.54 s (the retired network_host_reason: null accepted), --recheck ok; record schema 2.0, 30 keys, interpreter_path .../cpython-3.12.16-linux-x86_64-gnu/bin/python3.12, interpreter_sha256 equal to sha256sum of it, script_sha256 unchanged from the real full-1 record. The printed argv is the request's, unchanged. --recheck of the real full-1.launch.json refuses with the single schema-version problem.
  • Full suite after the last edit: 1,151 tests OK, 1 skipped (was 1,113; +38 in test_ext_review5.py); test_ext_*.py 412 OK.

Area "control" adapter, slice 2 (tests/README.md section 11.19, EXT-98 to EXT-111)

Source: the area runtime <mm-root>/area2-drones (README "What gatedtrain needs", train_ppo.py, eval_hover.py; read only) and the maintainers' decisions of 2026-11-12. Tests first: tests/test_ext_sb3.py (60 at the time) failed on the slice-1 code (57 failing, 3 passing as regressions) before the change; 62 now.

  • Adapter sb3_ppo (ext/adapters/sb3_ppo.py). Cut = checkpoint-<I>/ whose cut.json (written last) lists exactly the six other files with matching SHA-256 and iteration I, and whose model.zip policy.pth member (read with zipfile, bytes only) is the cut's policy.pth; .partial directories are never cuts. model_hash: policy.pth, policy_meta.json, vecnormalize.pkl, vecnormalize.json, env_version.json; cut_hash adds model.zip and cut.json. The pickle is hashed only (MM-12, checked by the AST import test).
  • Two phases. ext-collect gates the continue-phase run against the base cut it loaded: base_checkpoint = the base mount's container path, base_cut = the base cut's cut.json, first_iteration = base iteration + 1, the base cut inside a base-phase run (base_checkpoint: null). The lineage's training stage used the base cut's cut and model hashes; the baseline arm must evaluate that model hash.
  • Consumption, observed. rollouts.jsonl must cover first_iteration .. the last cut, one line each, chunk = n_steps × n_envs env steps contiguous with the previous, episode steps summing to it, shard = the spec's one env-params shard; checked before writing (EXT-CONSUMPTION). Ledger: this run's iterations only, iteration, observed, row/chunk/seed_inputs null as 05 §12.2 fixes for iteration records (MM-25 asks for chunk and seed: a disagreement, recorded as choice 1 in section 11.19).
  • Exact overlap against both runs' episode payloads (base run up to the base cut), never the shard (EXT-107). Data and env binding: env_params_file through the read-only mounts, env_params_sha256, env_version_sha256 against eval_distribution.env_version, env_params_version (EXT-103). Arms: normalizer_sha256 of the evaluated cut, env_version_sha256 registered (EXT-109). Sampler: the evaluator's sampler_keys (EXT-106).
  • CPU accounting (EXT-105). gpus: false allows gpu_est_h >= 0 and a smoke projection >= 0; ext-collect logs 0 GPU-seconds and the wrapper time as wall_seconds (lockfile and report, every adapter; area 1's gpu_seconds unchanged). gpus: true unchanged. The smoke of a multi-evaluator adapter is judged on its first, deciding evaluator (was: refused).
  • Own output as input (EXT-104). The sb3_ppo input roots include out/area2-drones under the output root; a read-only mount at or inside the run's own output directory is now refused. Area 1 is unaffected (its roots never contain the output).
  • ext-arm-fill (EXT-110). Fills or verifies checkpoint.model_hash, item_set_hash, sampler_hash of an arm written in one piece, and verifies its normalizer and environment against the cut; refuses mismatches without writing.
  • Defect found while testing: the first collect version counted an exact overlap but did not refuse it (the refusal sat inside the shard branch); fixed before any mutant run and killed by M15.
  • Mutants (scratch copy per mutant, gatedtrain.__file__ checked): 52, one per new check; 51 killed in the first pass. M8 (chunk size) survived because the test's shortened chunk also broke contiguity; the test now shortens the last chunk and expects the size message, and M8 is killed.
  • Scratch end-to-end (CPU, no docker). Real train_ppo.py and eval_hover.py in the area venv: base phase full (cuts 4, 8), ext-launch for both phases (records only; the continuation with --profile full --smoke-record --spec and --recheck: ok), continuation 10 iterations (cuts 13, 18), arms on the first 30 registered items, ext-arm-fill, ext-collect: INCONCLUSIVE (underpowered, n 30 < 262), Δ̂ −0.300 [−0.420, −0.201], gpu_seconds 0, wall_seconds 19, exact_overlap 0 (677 training states), precision iteration observed, ledger steps 9-18. Simulated: the container, gpu-step.sh (START/END lines), the base cut's container path (= its host path), no /tmp tmpfs in the e2e continuation record (scratch paths are under /tmp). <data-root> unchanged (find -newer).
  • Open. (1) Base-phase lineage: the base run's consumption and cuts 4, 8 enter impact answers only through a run directory of their own, which ext-collect cannot write without a gate (options still open). (2) ext-launch --profile full for the base phase needs a smoke record that can only exist after the base cut: launch the base phase as --profile smoke? (3) gpu-step.sh counts a CPU attempt's wall time against the GPU-hour budget (spent), so a long CPU step still consumes budget headroom. (4) MM-25 chunk and seed versus 05 §12.2 (choice 1).

Review round 6 fixes (tests/README.md section 11.19, EXT-112 to EXT-116; MM-25 aligned with 05 section 12.2)

Source: the round-6 review (ok-with-conditions; Medium-1, Low-1 to Low-3, surviving mutants N2, N4, N9). Tests first: tests/test_ext_review6.py (35 at the time) failed on the pre-round code (31 failing; the three mutant tests and one regression check passed); 37 now.

  • Medium-1, container paths (EXT-112). Registry container_paths (both adapters: read-only at its own host path inside an input root, or strictly under /inputs/; read-write /out; tmpfs /tmp) and, whatever a row says, launch.SYSTEM_CONTAINER_DIRS plus / and /lib*, with one exception: a read-only identity mount of an input root (area 1's <data-root>/...). Identity is judged on the request's host path or its strict realpath (the printed command mounts the latter). Checked in request and record mode, so --recheck and ext-collect refuse too. The reviewer's /etc/ld.so.preload, /opt/nvidia/nvidia_entrypoint.sh and /usr/lib/python3 mounts refuse on both adapters; on the real full-1 request the /etc/ld.so.preload probe now refuses at --request.mounts[5].container.
  • Low-1, interpreter (EXT-113). Registry interpreter: argv[0] exactly <mm-root>/area1-trl/.venv/bin/python (TRL) or <mm-root>/area2-drones/.venv/bin/python (SB3, the README's request shapes), compared as written (no normal form: //, /./, .. change what CPython takes as the venv), and the resolved host file lies strictly inside an interpreter_trees entry. Both host venvs link to .../python/cpython-3.12.16-linux-x86_64-gnu/bin/python3.12, inside the declared tree.
  • Low-2, env values (EXT-114). Registry env_paths (TRL 8 names, SB3 HOME, XDG_CACHE_HOME): absolute, normal form at or under /tmp or /out; refused otherwise without showing the value. Request only (the record has names). The real full-1 request's 8 path-valued values all pass (checked pass/fail per name, values not printed).
  • Low-3 (EXT-115). Duplicate tmpfs paths (normal form) refuse.
  • Mutant tests (EXT-116). 40/41-link chains, s.py -> evil.sh, lib/python3.12/x/secrets.cpython-312.pyc.
  • Test overrides (choice). Tests root their host paths under a temporary directory below /tmp, so the README's identity mounts cannot be identical there (they would nest in the /tmp tmpfs). New GATEDTRAIN_EXT_MIRROR_ROOT (the host directory that stands for / in an identity mount), GATEDTRAIN_EXT_INTERPRETER and GATEDTRAIN_EXT_INTERPRETER_TREES. Like every GATEDTRAIN_EXT_* variable they warn on stderr. Maintainers' follow-up (Q1, EXT-117): they are part of host_config_sha256 with the effective interpreter and trees, so a record written under one value refuses at --recheck and ext-collect under another even where every other rule passes (another tree that still holds the interpreter); every record hash changes, no real 2.0 record matters. Tests: TestOverrideHash (4), TestOverrideHashLaunch; mutants H1 to H3 (one value left out of the hash) killed.
  • MM-25 doc fix. MM-25 named chunk and seed_inputs.seed for iteration rows, contradicting 05 §12.2; it now says they are null (with data_ref.row, sample_id, rewards) and that chunk ranges and per-episode data stay in the runtime's rollouts.jsonl. The code already followed 05 §12.2 (EXT-102).
  • Area-2 operational choices recorded (tests/README.md section 11.19, MULTIMODAL-SPEC §6 row-4 notes): the base phase launched with --profile smoke (script --phase base --profile full) and never collected; impact queries do not return base-phase cuts (known gap); gpu-step.sh counts CPU wall time of earlier attempts against the GPU-hour budget (conservative, accepted).
  • Mutants (a mutation script, scratch copy per mutant, gatedtrain.__file__ checked; test_ext_review6.py first, survivors against every test_ext_*.py): 27 new (R1 to R27) plus N2, N4, N9 re-run. 22 killed by the new file in the first pass, R4 (identity lexical only) by test_ext_review3...test_link_source_printed_resolved; R10 (system-directory exception for any identity mount), R12 (tmpfs system directories) and R20 (adapter interpreter not filled) survived all 509 and are killed by two tests added afterwards; R18 (tree check on the unresolved host path) survives as equivalent: container_file returns the mount's strict realpath plus components each checked not to be a link, so the host path is already resolved. N2, N4, N9 re-run: killed.
  • Real requests (scratch output root, records in a scratch directory): area 1 full-1 (--profile full --smoke-record smoke-2 --spec gate/spec.yaml) passes and --recheck is ok; area-2 base (--profile smoke, argv --phase base --profile full) and continuation smoke (with a fake base cut in a scratch directory standing for out/area2-drones/base-1/checkpoint-8, which does not exist yet, and GATEDTRAIN_EXT_INPUT_ROOTS naming the scratch output root's area2-drones instead of the real one) pass with --recheck ok.

Area "image generation, SD1.5" adapter, slice 3 (tests/README.md section 11.20, EXT-118 to EXT-130)

Source: the area runtime <mm-root>/area3-sd15 (README "What gatedtrain needs", "Decisions taken"; train_ddpo.py, eval_images.py; read only), the maintainers' multimodal decisions ("Area 3 decisions") and design revision 15 (05 §6.1, R15-1). Tests first: tests/test_ext_ddpo.py (66 at the time) failed on the slice-2 code (63 failing, 3 passing as regression or fixture checks) before the change; 67 now.

  • Adapter ddpo_sd15 (ext/adapters/ddpo_sd15.py). Cut = checkpoint-<E>/ whose cut.json (written last) has epoch E, positive global_step and samples_consumed, deployable = the four components, and lists exactly the five other files with matching SHA-256, with a whole LoRA safetensors file; .partial directories are never cuts. find_cuts reports the cut's global_step as last_step_included (the ledger's step is the optimizer step). The base is the plain SD1.5 directory: its model hash is its manifest hash (the baseline arm evaluates the base alone, MM-18); a cut's model hash is sha256(canonical_json({base, adapter})) with the adapter hash over cut.json deployable; lineage adds one lora_compose activity per cut. The base manifest is walked once per adapter instance (2.1 GB on the real base).
  • Bindings. Base (EXT-121): run_args.json base_model resolves through the read-only mounts to the spec's base, base_ref.verified true, every cut's base_ref.json a 40-hex revision with files equal to the spec base's file hashes and equal to run_args.json base_ref, adapter_config.json naming the same repo and revision. Data (EXT-122): one prompt shard, train_file through the mounts, train_file_sha256. Seed, profile, script and sampler code of run_args, env-runtime.json and every cut (EXT-125); each cut's sampler.json is the registered sampler (EXT-SAMPLER).
  • Consumption, observed, row (EXT-123). samples.jsonl joined with train_steps.jsonl, checked before writing: sample fields, prompt text equal to the shard's, each epoch's indexes 0 .. 63, consecutive steps, each inner epoch applying each of the epoch's samples exactly once, each cut's global_step and samples_consumed equal to the log. One record per (sample, applying step): data_ref.row = sha256(prompt_id), seed_inputs.seed, rewards [reward], sampler_config_hash. sample_id hashes NUL-joined text: the 63-bit noise seed exceeds RFC 8785's safe integers, so canonical JSON would raise. The impact query answers consumed at row.
  • Exact overlap (EXT-124): item prompts against the shard's prompts and every sampled prompt up to the last cut; collect now passes the spec's data to training_payloads (sb3_ppo ignores it).
  • Construct alignment (R15-1, EXT-127, EXT-128). The WebP row declares construct_aligned {reward, statement}; a registration gating on it must carry construct_alignment (new optional field, naming choice); the report JSON and text print the row's statement.
  • ext-arm-fill (EXT-126). --base (required for a LoRA cut, refused when it names a cut or no SD1.5 directory) fills or verifies checkpoint.base_model_hash and lets the composed model hash be computed. eval_images.py writes sampler_hash as compact sorted JSON; with the sampler's floats (eta: 1.0, guidance_scale: 5.0, ...) it differs from RFC 8785 (sha256:2516f605... against sha256:2ff98254...), unlike area 2's integer-only sampler. fill converts a value equal to that encoding of the arm's own sampler (printed converted) and still refuses any other value.
  • README and code compared (code followed): (1) components: the README lists three plus base_ref.json as "the reference"; train_ddpo.py DEPLOYABLE and cut.json deployable include base_ref.json, which MM-17 also counts. (2) item_payload: the README proposes class_index, an integer in items.jsonl; gatedtrain payload fields are strings, so prompt, label. (3) "sampler_hash ... as area 2": area 2's compact hash equals RFC 8785 by accident of its integer sampler; area 3's does not (above). (4) The README's item-set hash 4a99afa6... is the file hash of items.jsonl; the registered item_set_hash is the manifest of items/ (with item_set_meta.json), sha256:0a4af3f9.... (5) README item 6's sample_id cannot be canonical JSON (the seed, above). (6) train_steps.jsonl lines also carry utc (harmless).
  • Real outputs checked (read only; writes only to scratch copies). On the 2026-11-12 cpu-sanity run (train-cpu-a): one complete cut (global step 2), consumption problems none, 4 row records, framework diffusers 0.42.1, script binding ok, every adapter check empty with identity mounts, overlap 0 of 150 against 248 prompts, base manifest sha256:1d99f8b6..., the cut's composed model hash sha256:bd27f904.... ext-arm-fill on copies of the real base and cut arms: filled, converted sampler_hash; without --base the cut arm refuses; the prompt_violation arm refuses (its MM-C3 keys).
  • Mutants (a mutation script): 50, one per new check; 46 killed in the first pass, the 4 survivors (D12, D14, D24, D25: test message filters matched a redundant check) killed after the tests were tightened.
  • Open. (1) The SigLIP constraint (prompt_violation, reported only, decision 3) has no registry row; its arm is neither filled nor collected (MM-C3 keys constraint_set_hash, model_manifest_hash are unknown to the MM-2 reader). TODO for the constraint-clause wiring: a registry row (binary, range [0, 1], tier T2 pending the transfer test, scorer weights = SigLIP model.safetensors), MM-C3 keys accepted by arm.read_meta and fill for constraint rows, a non-blocking clause in ext-collect (today REG-CONSTRAINT refuses), the registered constraint-set hash (MM-C3; the runtime hashes compact JSON). Until then the maintainers report it from the two arms (EVAL-PLAN draft section 6). (2) The smoke record's baseline scores for K = 2: per-item means (choice in the draft). (3) Evaluation launches with --profile full take the smoke's training projection as their GPU estimate (conservative).

Review round 8 fixes for ddpo_sd15 (review 7: M1, M2, L1 to L5; tests/README.md section 11.20, EXT-131 to EXT-137)

Tests first: 17 added to tests/test_ext_ddpo.py (84 now); 12 failed on the round-7 code, 5 passed as regression guards.

  • M1 (EXT-131). collect's per-cut identity, which for a LoRA cut hashes the base, ran outside the error handling: a symbolic link in the base or a missing base raised ValueError and exited 1 (EXIT_NOT_PASS). It now records EXT-BASE artifacts.<base>.uri and the collect refuses with exit 3.
  • M2 (EXT-132). The consumption check re-derives every derived field of samples.jsonl as train_ddpo.py does (stdlib only): seed = derive_seed('sample', run seed, e, i) (:605), sample_id = compact-JSON SHA-256 of ["ddpo-sd15", run seed, attempt, e, i, prompt_id, seed, member] (:617-618), member = i % images_per_prompt (:597, the plan is prompt-major), reward = -jpeg_kb exactly, steps = the epoch's [first, last] optimizer step (:598-599; was: the applying step within the range). Reward tolerance: none needed; :616-619 append -kb (exact float negation) and json.dumps writes both with repr, which round-trips. The three real cpu-sanity runs pass.
  • L1 (EXT-133). eval_images.py unchanged. Assumption, documented here and in the EVAL-PLAN draft: every evaluation uses the default base <area3-sd15>/models/stable-diffusion-v1-5 inside the read-only identity mount, because the evaluator neither hashes nor records the base it loads and ext-arm-fill --base states the base without observing it. Enforced cheaply at launch: adapter argv_problems, called by ext-launch and --recheck for any adapter that declares it, refuses an eval_images.py argv with a --base / --base= other than the script directory's default (normalised; .. refused). Not covered: ext-collect does not see the evaluation launch records (arms are passed as directories), so an evaluation launched outside ext-launch is still the operator's assertion. Remaining fix on the runtime side (area owner): record the resolved base and its files_sha256 in env-runtime.json, and let fill compare them with --base.
  • L2. full.request.yaml argv now ends - '<EPOCHS>', so 24 stays a string.
  • L3 (EXT-134). (a) construct_alignment is refused for a deciding evaluator that is not construct-aligned; still required for one that is. (b) The report JSON carries the registration's statement as statement and the registry row's as manifest_statement; the text prints the registration's and adds construct_alignment_manifest: only when they differ.
  • L4 (EXT-135). identity of the base consults the adapter's cache before walking; ext-arm-fill --checkpoint <base> --base <base> walks the 2.1 GB base once.
  • L5 (EXT-136, EXT-137). Tests for num_inner_epochs 2 (collect passes, 2 records per sample; a missing sample in inner epoch 1 refuses), for a converted arm whose own sampler is not the registered one (fill converts, collect refuses on sampler and sampler_hash), and for the conversion on an sb3_ppo arm.
  • Mutants (a mutation script, E1 to E13, one per new check): 13, all killed (E13 first gave a syntax error from a bad anchor; fixed and killed by TestBaseWalkedOnce).
  • Open (L3 c). The evaluator identity hash (registry.evaluator_identity_hash: {evaluator, metric, direction, scorer}) does not cover tier or construct_aligned, so a registration's pinned evaluator hash does not bind the tier or the construct-alignment declaration it was written under; a registry edit of either changes no hash. Pre-existing for every tier; not changed here (decision). Question for the design owner: should the evaluator manifest hash cover tier and construct alignment (05 §6.1 "its manifest says so")?

Area "audio" adapter, slice 4 (tests/README.md section 11.21, EXT-138 to EXT-153)

Source: the area runtime <mm-root>/area4-whisper (README "Trainer", "Cut layout", "What gatedtrain needs", "Launch request facts"; train_whisper.py, eval_asr.py; read only, 2026-11-13), the maintainers' multimodal decisions ("Area 4 decisions") and design revision 16 (05 §6.1, R16-1). Tests first: tests/test_ext_whisper.py (96 at the time, 98 now) failed on the slice-3 code (89 failing, 7 passing: five runtime-fact checks and two regression guards) before the change. The defect classes of review 7 were designed in from the start: the base is hashed only inside error handling (EXT-152), every deterministic derived field is recomputed (EXT-141 to EXT-145), argv is checked at launch (EXT-150), and the base is walked once (EXT-140).

  • Adapter hf_seq2seq (ext/adapters/hf_seq2seq.py). Cut = checkpoint-<S>/ whose cut.json (written last) has global_step S, positive examples_consumed, deployable = the seven components and lists exactly the nine other files, each plain with matching SHA-256, with a whole model.safetensors; .partial and hf-trainer/ are never cuts. Full weights: a cut's model hash is the manifest hash of its deployable files (the deployment decoder decoding.json included); the base's is the manifest hash of its 11 files; no lora_compose.
  • Bindings. Base (EXT-141): model_name_or_path = base_model through the read-only mounts to the spec's base, base_ref.verified true, each cut's base_ref.json a 40-hex revision with files equal to the spec base's hashes, files_sha256 recomputed, (repo, revision, files_sha256) equal to run_args.json. Data (EXT-142): one shard, train_file, train_file_sha256, n_train recomputed. Run (EXT-145): seed (and settings.seed), profile, dry_run, last cut = max_steps = settings.max_steps, script hash in env-runtime.json, run_args.json and every cut; decoder_code_sha256 equal across cuts, env-runtime.json and run_args.json and equal to the evaluator's pinned SHARED DECODER hash (sha256:478dd30e...); decoding.json = run_args.json decoding, decoding_sha256 recomputed; each cut's decoder = the registered sampler without batch_size, dtype, order.
  • Consumption, observed, row (EXT-143). Every rule of README item 6 is recomputed from the shard and the settings, not read from the log: steps consecutive, epoch = (k − 1) // ceil(N / B) from 0, B examples per step except the epoch's last (N − (ceil(N / B) − 1) B: 24 at 3,000 / 32, steps 94, 188, 282), n_examples, ids in the shard and none twice in an epoch, each step's samples.jsonl lines = its example_ids in order with micro_batch 0, position, row = sha256(utt_id), attempt; each cut's examples_consumed. At the real shape (3,000 rows, batch 32, 300 steps) the fixture generator gives cuts 100/200/300 with 3,192/6,384/9,576 examples, the README's numbers, and no problem. Ledger rows have null rewards, seed_inputs, sampler_config_hash (supervised); sample_id hashes NUL-joined (run, attempt, epoch, step, utt_id).
  • Disclosures (R16-1, EXT-147, EXT-148). Decision (naming choice): one mechanism, registry.DISCLOSURES, with two named registration fields: construct_alignment (R15-1, unchanged, area 3's registration is pinned by hash) and the new shared_annotation. Each entry names the registry row key that requires the field, the row's fact the report prints, and the design rule; the registration check, collect's report entry and the text report are one loop over the table (area 3's behaviour and messages are unchanged; its 84 tests pass). A single disclosures: map in the registration would be simpler to extend but would rename area 3's field; not chosen. The WER row declares shared_annotation {convention, statement}; the registration must state it and the report prints it (and the row's text beside it when they differ).
  • Launch-side argv (EXT-150). eval_asr.py --base other than its default refuses (as EXT-133); train_whisper.py --no-verify-base and a --profile other than smoke or full refuse. Options are resolved as argparse does, unique prefixes included (--no-verify, --prof). Area 3's argv_problems compares exact spellings; there every abbreviation of --base is also a prefix of --base-only, so argparse refuses it as ambiguous and nothing slips through, but the exact-spelling rule would be fragile for other options.
  • README and code compared (code followed): (1) consumption fallback: the README proposes {target: row, fallback: stage}; no fallback here (a mismatching log refuses, as ddpo_sd15). (2) score_outcomes: the README proposes ("empty_transcript", "hallucination"); the code marks empty and truncated (the per-utterance token bound), so the row says empty_transcript, truncated_transcript. (3) Sampler hash: the README says eval_asr.py writes compact sorted JSON "not RFC 8785, as areas 2-3" and that fill supplies the RFC 8785 hash; for this sampler (integers, strings, booleans, null) the two encodings are equal (sha256:2649163a...), so fill verifies and converts nothing. (4) The README's item-set hash 94d0bea4... is the file hash of items.jsonl; the registered item_set_hash is the manifest of items/ (with item_set_meta.json and audio/), sha256:38b26785.... (5) The README does not say that samples.jsonl / train_steps.jsonl epochs count from 0 (counters["epoch"] starts at -1, on_epoch_begin increments); the sanity log confirms 0. (6) run_args.json also carries settings.seed and settings.max_steps (checked equal to seed and max_steps) and decoding_sha256 (recomputed). (7) The README says the lock has 60 packages; the venv's distribution list (the freeze) has 59 (the project itself is not installed); the three pins are present. (8) eval_asr.py records the resolved model_dir in its env-runtime.json but no hash, so the base binding of a --base-only arm is still the launch-side argv rule (EXT-150); fill does not read env-runtime.json. (9) eval_asr.py check_cut compares the cut's base_ref.json revision and files with MODELS.json but not repo (harmless: files decide).
  • Real directories (read only). Base models/whisper-base.en: a model directory, manifest sha256:583e09fe..., file hashes equal to MODELS.json; data manifest sha256:d5080d22...; items manifest sha256:38b26785... (500 items pass read_item_set); exact text overlap 0; evaluator identity sha256:d18c705e.... Request drafts (five) pass ext-launch and --recheck with the output root in a scratch directory.
  • Mutants (a mutation script): 71, one per new check; 68 killed in the first pass, the 3 survivors (H21, H39, H48: a redundant check matched first) killed after two tests were added and one tightened (98 tests).
  • Open. (1) The evaluator identity hash does not cover tier, construct_aligned or shared_annotation (review 7 L3 c, unchanged). (2) shared_annotation is declared on the evaluator row, so any trainer gating on asr.whisper_items@0.1 must state it, also one that did not train on AMI labels; acceptable while the row is area-specific. (3) The training --seed is not compared with training_seed at launch (an argv hook sees the argv only); collect compares it. (4) No smoke evaluation of a cut: sigma is fixed, so the smoke record needs only the baseline; the cut-to-evaluator path (decoder and base checks in eval_asr.py) is first exercised by the full run's candidate.

Review round 9 fixes (review 9: M1, L1 to L4; tests/README.md section 11.21, EXT-154 to EXT-159)

Tests first: tests/test_ext_review9.py (26); 24 failed on the round-8 code, 2 passed (the 05 §3.4 coverage rule already held; the optional-keys check was true of the hand-written tuple).

  • M1 (EXT-154), all adapters. Unreadable files no longer crash ext-collect with exit 1. Cut checks (hf_seq2seq, ddpo_sd15 _cut_files_problem, sb3_ppo model_dir_problem) turn an OSError into " cannot be read", so the cut is incomplete (a last cut refuses EXT-STAGE, a middle one is listed in incomplete_cuts). The data hash in checks goes through _sha_or_none (an unreadable shard gives EXT-DATA; collect already refuses SPEC-REF from the data manifest). collect catches (OSError, ValueError) around framework_identity (EXT-FREEZE, every adapter), an unlistable stage directory (EXT-STAGE), and an OSError from any adapter's script_problems, checks, consumption_problems and sampler_problems (_guarded); stale_outputs uses os.path.lexists (on Python 3.13 Path.exists raised PermissionError in an unsearchable directory). ext-arm-fill refuses an unreadable normalizer or environment version. Sweep: trl_grpo already guarded its cut, data and log reads; its freeze is covered by the collect fix. Reads inside _write_run (after the run directory exists) that fail with OSError were already a refusal (EXT-WRITE, the directory removed).
  • L1 (EXT-155 to EXT-157). (1) collect asks the adapter for arm_problems: hf_seq2seq checks every referenced outputs/<item>.json names its item and the registered reference_normalized (eval_asr.py writes the reference of the item set it read). Edited audio is not visible there (no audio hash in the outputs); the launch rule covers it. ddpo_sd15: eval_images.py writes images only, so nothing comparable exists. (2) Launch-side rules for both evaluation scripts (one helper, runtime_argv_problems): argv[1] must be <runtime>/<script> for the adapter's scripts, the runtime being the pinned interpreter's directory (a byte-identical eval_asr.py copy in another input root, with its own base and items, now refuses); --base and --items absent or the defaults; --limit refused under --profile full (the hook receives the launch profile, --recheck the record's). The area-3 drafts and its six real launch records, and the six area-4 drafts, pass. (3) Coverage: 05 §3.4 (G-18) defines expected items as the registered set × K per arm, and gates.evaluate_items already does so (the review's gates.py:27-28 is the revision-10 mapping form, not what collect calls): two arms limited to the same 50 of 60 items give MISSING (missing_above_bound). No design gap.
  • L2 (EXT-158). hf_seq2seq refuses a step log whose length is not max_steps (reported after the cut checks, so a short log still names the cut beyond it); ddpo_sd15 refuses steps or samples of an epoch after settings.epochs.
  • L3 (EXT-159). (a) Area 3's messages restored word for word (per-entry missing, undeclared texts in DISCLOSURES); the earlier claim that they were unchanged was wrong for one message. (b) OPTIONAL_KEYS derives the disclosure fields from DISCLOSURES. (c) Formatting fixed. (d) registry.disclosure_problems runs at registry import: a malformed disclosure fails every command before anything is written.
  • L4. Tests for M1 and L2 added; the ambiguous-prefix test (--ba, --bas, --ite) is cheap and added.
  • Drafts. New draft request eval-smoke-cut.request.yaml (the smoke run's checkpoint-60 at /inputs/cut, the first 20 items, --profile smoke): it exercises the cut-to-evaluation path before the full run. The other five drafts are unchanged; all six pass ext-launch and --recheck with the output root in a scratch directory.
  • Mutants (a mutation script): 20; 19 killed in the first pass, R3 after the sb3 test matched the adapter's own message.
  • Open. --gpus all is fixed in the launcher (one GPU on the host that ran the prototype, verified there); a per-request device list would change the record schema. On a multi-GPU host the Trainer would use nn.DataParallel and the consumption check would refuse the run afterwards.

Area "image generation, SD3.5" adapter, slice 5 (tests/README.md section 11.22, EXT-160 to EXT-178)

Source: the area runtime <mm-root>/area5-sd35 (README "Outputs of train_flow_grpo.py", "Evaluator outputs", "What gatedtrain needs", "Launch request facts"; train_flow_grpo.py, eval_images.py; read only, 2026-11-13), the maintainers' multimodal decisions ("Area 5 decisions") and design revision 16 (05 §6.1 R15-1, §12.3). Tests first: tests/test_ext_flow_grpo.py (123 at the time, 141 now) failed with the adapter unregistered; after wiring, 15 failures, 13 of them the open question below.

  • Adapter flow_grpo_sd35 (ext/adapters/flow_grpo_sd35.py), a subclass of DdpoSd15Adapter: the run layout is area 3's (cuts checkpoint-<E>/ with cut.json last, four deployable components, composed LoRA model hash, lora_compose lineage, exact overlap over the shard and samples.jsonl, the deployment sampler against the registration). Its own: the SD3.5 Medium base check (ten configs, whole safetensors of transformer, VAE and three text encoders), cut completeness with samples_filtered, boolean ema and global_step / samples_consumed ≥ 0 (an all-filtered first epoch trains no step), the pins (paddleocr, paddlepaddle added) and the flow_grpo reference line, the argv rules, and the consumption check with the epoch plan.
  • Base hash without .cache/ (decision). canonical.manifest_entries gained exclude= (top-level names, default none); the adapter declares base_excludes = (".cache",) and walks the base once per instance (area 3's cache). ext/collect.py uses an adapter's base_excludes for the base manifest and skips its .cache refusal only when .cache is excluded; the other adapters still refuse a base .cache/. A .cache below the top level is hashed. The *.fp16.* duplicates are hashed. Read-only check on the real base: base_dir_problem none, the 37 files outside .cache/ are exactly MODELS.json's (the 27 GB were not re-hashed here).
  • Filtered outcomes (MM-28, 05 §12.3). The ledger schema already has outcome, reason and a nullable step; the impact query reads outcome = 'consumed' only. A filtered sample is one record: outcome filtered, reason zero_advantage, step null, sample_id with filtered in the step's place (choice), rewards and seed_inputs set. Re-included samples (the padding rule) are consumed. Refusals: see EXT-166 (kept/filtered partition, order, padding bounds, equal-reward groups never plainly kept, steps only of kept samples, step sizes, plan step ranges, an all-filtered epoch without steps, cut counts including samples_filtered).
  • Derived fields (EXT-167), re-derived with the standard library: noise seed, sample_id, member, the prompt group of each sample and distinct prompts per epoch, target = the first quoted text, reward = ocr_acc exactly for settings.reward ocr. Not re-derived: the prompt draw (numpy PCG64), the padding pick and the training order (torch generators), and float advantages (only "equal rewards ⇒ zero advantage", exact for G = 8 under numpy's pairwise sum and for G = 2, 4).
  • Run checks (EXT-169) beyond area 3's: run_args script_sha256, sampler_sha256 recomputed, sampler code pinned to the evaluator's SHARED SAMPLER block (sha256:83133e24..., as area 4's decoder), EMA off in settings, cuts and adapter configs (decision), settings.reward ocr, n_train_prompts.
  • Launch. HF_TOKEN is refused by the generic credential rule and is outside the allow-list; DOCTR_CACHE_DIR is allowed and path-valued (under /tmp or /out). argv: area 3/4 rules plus --ema refused. The credential file-name scan of the real area5-sd35 directory (with the .venv skipped) and of the Python directory finds nothing.
  • Real outputs (read only, fixtures copied in small slices). The cpu-sanity run's three logs and cut marker pass the consumption check (4 consumed records). The first real cpu-sanity arms were refused for string sub_metrics (round 2 below).
  • README and code compared (code followed): (1) samples.jsonl lines have no steps field (area 3 had one); the step range is in epoch_plan.jsonl. (2) README item 9 proposes consumption fallback stage; none here. (3) samples_consumed counts the kept samples once per epoch (train_flow_grpo.py :577), not per applying step. (4) Spec row 2b's checkpoint-<step>/lora/ and T5 embedding manifest do not apply (updated in MULTIMODAL-SPEC). (5) item_payload drops source_line (an integer).
  • Round 2, maintainers' decisions 2026-11-14. (1) sub_metrics: eval_images.py (area runtime; the old file backed up) now writes finite numbers only (ocr_a_acc, ocr_b_acc when the engine scored, nonfinite), the target and texts stay in scores.jsonl, the SHARED SAMPLER block unchanged (83133e24...); new SHA-256 c100a8fb887f93eedbed37b573198cf3bec01508769ebcea7c5ca5a88d8d3b67 in both registry rows, the fixtures and the area README. A 2-item, 128-px CPU evaluation of the cpu-sanity cut (images byte-identical to the earlier run) passes ext-arm-fill on a copy against the real base (base model hash sha256:a19e90d6... without .cache/, cut model hash sha256:4181b651..., item set sha256:0b01553c..., sampler hash converted) and collect's arm checks. (2) lora_compose activity ids name the cut directory (.../lora_compose/checkpoint-<E>), for every LoRA adapter: two cuts can share a global step. (3) Target-text overlap (README item 7): an item target equal to a training row's after removing spaces and lower-casing refuses (EXT-CONTAMINATION, EXT-176; adapter hook item_overlap_problems); always refused. (4) The other choices are accepted.
  • Review 10 fixes (M1, L1 to L4; EXT-176, EXT-177). Tests first: 10 added, all failing on the round-2 code. (M1) The epoch plan is reconciled with the rewards: a filtered or reincluded sample must have its group's mean reward, computed exactly with fractions and a 1e-12 relative tolerance (numpy's float mean of a zero-advantage group equals the reward; the exact mean differs from it by a few ulps at most), so a trained sample can no longer be relabelled filtered (probe P1) or reincluded (P5); settings.global_std must be a boolean (the runtime's tracker; zero advantage does not depend on it), any other advantage mode refuses. (L1) Targets are derived from the prompt for shard rows and items; a differing stated target refuses, the overlap uses the derived target. (L2) An all-filtered epoch's plan names steps []. (L3) Step numbers must be integers before the == list(range(...)) comparison (True == 1), in this adapter, ddpo_sd15 and hf_seq2seq (P3 crashed with exit 1 in pyarrow); sb3_ppo already checked, trl_grpo and ledger.py have no such JSON comparison. (L4) manifest_entries raises for an excluded name that is a symbolic link or a file, so collect refuses EXT-BASE (P7 .cache -> /etc was accepted); MULTIMODAL-SPEC MM-20 states the exception and its limit. Real data: the 18,359 shard rows and 400 items give no target problem; the real cpu-sanity logs give no consumption problem.
  • Deciding formula changed after the smoke (maintainers' decision 2026-11-14; EXT-178). The GPU smoke base evaluation failed MM-38 on ocr_b_acc (52.5 % zeros: docTR reads background texture and flow_grpo's whole-text edit distance clips to 0). ocr_b_acc now scores docTR's text by approximate-substring edit distance (eval_images.py ocr_substring_accuracy, Sellers DP, placed outside the shared sampler block, which still hashes to 83133e24...); the reward and ocr_a_acc keep flow_grpo's formula. New eval_images.py sha256:fdad8eb9b8de45a0c002a62469fb043fdeaf1c38b9449d41fd5a430e9adee8ad in both registry rows; the B scorer version and the construct_aligned statement (engine and formula differ; chosen after the smoke baseline, before registration) updated; area README updated. Verification: Sellers DP = brute force on 2,937 random cases; on the 40 smoke rows share at 0 0.175, mean 0.412 (the decision's numbers); a 2-item CPU evaluation regenerated the fixture arms, whose scorers equal the registry rows, and passed ext-arm-fill against the real base and collect's arm checks. An empty normalized target raises inside the evaluator and becomes scorer_error (B scoring now wrapped per row).
  • Open. (1) Smoke: the 40-item GPU base evaluation failed MM-38 with the old formula (resolved by the formula change above; the new share at 0 is 0.175). (2) No full mutant run for this slice; the round-2 fixes were reverted once (their tests fail) and every review-10 test failed before its fix.

Area "CAD" adapter and the paired executor sidecar, slice 6 (tests/README.md section 11.23, EXT-180 to EXT-197)

Source: the area runtime <mm-root>/area6-cad (README "Trainer details", "Outputs", "What gatedtrain needs", "Launch request facts", "Executor sandbox", "Proposed MULTIMODAL-SPEC row 6 text"; run_cad_nemo.py, the CAD hooks module, cad_env.py, gen_cad.py, score_cad.py, cad_protocol.py, cad_sandbox.py, executor/run-executor.sh, executor/BUILD.md; read only, 2026-11-13), a NeMo RL clone at 4f39fd8 (GATEDTRAIN_NEMO_RL_DIR), the maintainers' multimodal decisions ("Area 6 decisions"). Tests first: tests/test_ext_nemo_rl.py failed (69 failures, 87 errors with subtests) with the registry rows present and the adapter absent.

  • Adapter nemo_rl_ext (ext/adapters/nemo_rl_ext.py), both stages of the MM-15 chain: SFT (sft.nemo_rl@0.1) from the 8-file Qwen2.5-Coder-0.5B-Instruct directory, GRPO (rl.nemo_rl_env@0.1) from the SFT run's gated cut (read-only /inputs/sft-cut, init_checkpoint in run_args and every cut's base_ref.json). Cuts are cuts/checkpoint-<N>/ with cut.json last; NeMo RL's nemo/checkpoints/step_N never count. Full weights, no composition. The registry row lists both ids; collect accepts an adapter's trainer_ids and passes the spec's uses to checks, which refuses a run whose stage is the other one.
  • Consumption, observed per row. SFT: samples.jsonl ⋈ train_steps.jsonl, every field the wrapped prepare_sft_batch writes re-derived (file order, 32 per step, drop_last epochs, idx, row = sha256(row_id), epoch, position, attempt), held-out families refused, steps = max_steps, examples_consumed = 32 × step. GRPO: env_calls.jsonl (128 × max_steps lines, calls and positions consecutive, statuses, reward bounds of cad_protocol.reward, program_sha256 null exactly for no_code) joined in order with NeMo RL's train_data_step<N>.jsonl rewards. NeMo RL logs the float32 tensor value (cad_env.py returns torch.float32), so the join compares the env reward rounded to float32; one exp_<n> directory; each step's rows are the 16 of the epoch in file order, 8 times each (as a multiset: the order of prompts inside a step is not claimed); examples_consumed = 16 × step. No automatic iteration fallback (choice; the README proposed one after a failed smoke join).
  • Bindings. base_ref.json must name the pinned repo and revision and list exactly the base directory's files (MODELS.json shape, sizes and SHA-256) found through the read-only mount of run_args.json base_model; GRPO's init_checkpoint path is /inputs/sft-cut mounted onto the spec's base (an SFT cut), with its cut.json SHA-256 and global step. The training file is data/<stage>/train.jsonl beside the spec's shards, its hash recorded, and the shards' concatenation. hooks_sha256, env_sha256 and protocol_sha256 must be the files beside the launched script (the record binds run_cad_nemo.py only; the helpers it imports are bound this way). The freeze names exactly the pinned NeMo RL commit; the record's framework is {nemo_rl, commit, commit} (NeMo RL is pinned by commit, choice). Cut sampler.json = the registered sampler without backend and prompt_block_sha256; the registered prompt block is the SHARED PROMPT the data was built with.
  • Overlap (README item 7). Item text against both training sets of the chain (the generic check covers the spec's set only); a training row whose text (the overlap key) is not its input (what NeMo RL reads) refuses (review 10 L1 class); GRPO gate families must not occur in the SFT data, SFT gate items must be SFT families. The real data passes.
  • Arms (README item 8). program = extract_program(response) for every output (the adapter has a standard-library copy, checked equal to the runtime's on the pilot outputs), statuses, a failed program scores 0, and the scoring run's env-runtime.json beside the arm names the registered items.jsonl (the scorer's --items is otherwise unhashed), the pinned executor lock and the arm's scorer code. gen_meta.json model_files cannot be checked: the arm did not carry it; resolved in round 2 (EXT-197).
  • ext-launch: image interpreters and per-script options (generic, opt-in by registry row). NeMo RL's scripts run the image's own interpreters, which no mount holds: argv[0] may be the interpreter the row maps to argv[1]'s script; the record keeps a null interpreter_sha256 (the image ID pins it); the map enters host_config_sha256 for this adapter only. The printed command adds a row's fixed options per script: NeMo RL --shm-size=16g (replaces 8g), memlock and nofile ulimits, -w /opt/nemo-rl; scoring the executor's isolation (--read-only, limits, tmpfs noexec,size=4g). Areas 1 to 5: no row has these keys, records, hashes and commands are unchanged (their tests pass unmodified).
  • ext-launch: the paired sidecar (maintainers' decision 2026-11-13). A request may carry sidecar for an adapter whose row declares one; the adapter decides which launch needs it (the GRPO trainer only). It must be exactly what executor/run-executor.sh serve prints: pinned executor image and lock, argv the serve command (no --cpu-s/--wall-s), identity read-only mounts of the Python tree and the runtime directory only, one read-write spool, network none, the trainer's user (cad_sandbox.py binds the socket with umask 077), read-only root, cap-drop ALL, no-new-privileges, no GPU, tmpfs /tmp noexec, cpus 8, memory and swap 8g, pids 256, nofile 1024:1024, core 0, HOME (under /tmp), PYTHONDONTWRITEBYTECODE, PYTHONUNBUFFERED. The spool is a new, empty directory under the output root owned by the uid, outside the trainer's output, mounted read-write by both containers at /spool; the trainer gets no other extra read-write mount. ext-launch prints the sidecar's docker --context gatedtrain run -d --name ..., the trainer's gpu-step.sh command, and docker --context gatedtrain stop <name>; the record keeps the sidecar (names only, lock and file hashes), which the label hash covers and --recheck and ext-collect re-check (spool empty at --recheck; the spool must still exist at collect).
  • Deviation from the README's layout. The README mounts <grpo-run>/spool inside the trainer's /out; MM-34 refuses a second read-write mount inside the output and the sidecar must not reach the run's outputs, so the spool is a sibling: e.g. output out/area6-cad/grpo-smoke-1/train, spool out/area6-cad/grpo-smoke-1/spool (then run-executor.sh serve out/area6-cad/grpo-smoke-1 prints the matching -v), trainer --socket /spool/cadexec.sock.
  • Unverified (the GPU smokes must show them). (1) SFT: NeMo RL with data.shuffle=false and drop_last batches rows in file order; batch["idx"] is the train.jsonl line; prepare_sft_batch runs once per step before policy.train. (2) GRPO: the env sees the step's 128 samples, and train_data_step<N>.jsonl lists total_reward in the same order (data-plane path, data_plane.enabled=true); rewards are not rescaled (reward_scaling, reward_shaping disabled in grpo_math_1B.yaml); each step uses the 16 rows of the epoch in file order; logs go to nemo/logs/exp_001. (3) Cut layout: one consolidated safetensors file under policy/weights/model/consolidated/, tokenizer file names under policy/tokenizer/, training_info.json present, the publish wrapper called. (4) /opt/nemo-rl/.git/HEAD readable by the non-root uid and detached at the commit (the build clone's HEAD is, so the freeze line names the commit; otherwise # nemo-rl commit None and collect refuses). (5) The image's interpreters: /opt/nemo_rl_venv/bin/python (Dockerfile:227, :621; uv run python uses it) and the vLLM worker venv's bin/python with transformers for gen_cad.py. (6) NeMo RL, Ray and vLLM run as uid 1000 (MM-34 refuses root; the README proposed the image default, root) with HOME and caches under /tmp, the venv readable by others. (7) Ray starts with --network none (the decision's fallback host is refused by EXT-81, decision below). (8) --shm-size=16g and the 8g tmpfs fit in the host's memory alongside the 8g executor.
  • Evaluator format (round 2, maintainers' decision 2026-11-13). The recipe maintainers changed score_cad.py (sha256 cffdd9ea5144c66a7d35ae9af86f05d89e8797ea490396390f031a4523bf9339, recomputed here; composite scorer sha256:d1a95eb50ac9d694a2f80ffdebd9185b14861f3c74110763f6c26739f8edcaba recomputed from the four files, now the registry pin): numeric sub_metrics with status_code and truncated, keys left out when absent, framework {name, version}, arm-valid under cad.cadquery_valid_items@0.1, gen_meta.json copied into the scoring output. The adapter checks status_code (range, executes, the score, the output's status) and gen_meta.json (EXT-197: hash in env-runtime.json, items, prompt block, sampler, framework, and model_files = the files of the model collect expects: the spec's base for the baseline, the last cut for the candidate). A CPU scoring of 8 pilot items with it on the host that ran the prototype (tests/fixtures/ext/cad/real-arm/) passes, after ext-arm-fill against the real base and item set, every arm check for both arms; the old pilot arm and string/null sub-metrics stay refused.
  • Decided (maintainers' decision 2026-11-13, the maintainers' multimodal decisions, "Area 6 decisions"). Trainer network stays none, no host exception (a Ray failure on loopback at the smoke goes to the maintainers); trainer and sidecar run as 1000:1000; no automatic iteration fallback, the shard concatenation, framework.version = commit, the sibling spool layout out/area6-cad/<run>/train + .../spool and the string-only item_payload are accepted.
  • Review 11 fixes (EXT-198). (H1) ext-collect now binds the launch record to the outputs: --stage, --seed, GRPO --init/--socket and the presence of sidecar must match run_args.json, an SFT output may hold no environment or GRPO step log, and collect re-runs the adapter's argv_problems on the record (generic; areas 3 to 5 records pass). (M2) bind_argv's image-interpreter branch guards non-list mounts. (L1) a non-string deployable entry is incompleteness in all four cut.json adapters. (L2) the spool must be spool/ beside the trainer's output and must not overlap another trainer mount. (L3) --seed = training_seed at launch. (L4) a sidecar key, even null, refuses without a sidecar row; null refuses here too. (L5) the request no longer names the sidecar; its name is <hashed label>-cadexec (unique per launch record, not stored in the record, so the label hash stays acyclic). Pending: review 11 M1 (the scoring and serve mount sets), after the runtime's executor redesign.
  • Executor redesign (EXT-199; runtime 2026-11-14, after review 11 M1). Generated code now runs only in containers that mount the Python tree and area6-cad/executor/ (the GRPO sidecar and the new execution step cad_sandbox.py --run-batch); scoring reads the references and runs no generated code. Hashes recomputed here: score_cad.py f8d5486c... (then 60498f9b..., below), executor/cad_sandbox.py 05c4d8d2..., executor/cad_protocol.py 0f9d801d... (moved, unchanged), composite scorer sha256:343647f2... (superseded below). ext-launch enforces each script's exact mount set, the executor scripts' -I and their three environment names, and prints the execution, scoring and sidecar commands token for token as run-executor.sh does (sidecar name <name_prefix><hashed label> (the sidecar row's prefix)). Collect checks the execution record beside the arm.
  • score_cad.py copies exec_meta.json (runtime change chosen by the maintainers). score_cad.py now sha256:60498f9b2f6467d0ce751d2d77b20acc1ac92b6d6eaed1b97d8575c01102ca26, composite scorer sha256:c5b19935c37cb0ae262d88dcaf01d4ccdfc0157e5c17962b4d2e31080b507181 (registry pin); the real fixture was re-scored through exec -> score on the host that ran the prototype without any hand-copied file.

Area "video generation" adapter, slice 8 (tests/README.md section 11.25, EXT-214 to EXT-228)

Source: the area runtime <mm-root>/area3-video (README "Trainer", "Evaluator", "Smoke launch"; train_flow_grpo_wan.py, eval_videos.py; read 2026-11-14) and its GPU probes out/area3-video/probe-train-1 (2-epoch smoke) and probe-base-1 (20-item base evaluation), all read only.

  • Adapter flow_grpo_wan (ext/adapters/flow_grpo_wan.py), a subclass of FlowGrpoSd35Adapter. Area 5's adapter now exposes its SD3.5 facts as class attributes and five rule blocks as hook methods (same code and messages; its 142 tests pass unchanged); the Wan adapter overrides them: the Wan2.1 base directory, the video_ocr sample fields (frame_ocr for frames 0, 4, ..., 16, each frame's accuracy re-derived exactly with a standard-library Levenshtein distance, reward = ocr_acc = the mean of the positive frames, ocr_error = the first failed frame, which does not zero the reward), file-order prompts (epoch e uses shard rows 4(e - 1) .. 4e - 1), the all_zero_advantage epochs (all samples kept, none filtered), the flow-grpo-wan sample-id domain, the pinned SHARED SAMPLER block (dad91e41...), run and cut schemas and the Wan LoRA targets.
  • uses id. The decision named rl.flow_grpo@0.1 for both areas; registry.trainer_ids() maps an id to one adapter, so a shared id would have re-pointed area 5's spec id to the Wan adapter. The Wan row uses rl.flow_grpo_wan@0.1; a test checks that no two rows share an id.
  • Launch. The interpreter is area 5's venv (area5-sd35/.venv/bin/python) and the scripts are area 3's, so area 5's argv rule (the script beside the interpreter) cannot apply; the Wan adapter pins the two script paths, refuses any token argparse would refuse, and adds launch_problems: area 5's runtime image and lock pinned, network none, GPU, the exact mount set (Python directory, area5-sd35, area3-video read-only at their own paths, /out, plus /inputs/cut for a cut evaluation), --seed = training_seed.
  • Real outputs. The GPU smoke's logs pass the consumption check (28 consumed, 4 filtered: epoch 1's never-rendered group; neither epoch was all-zero, so the all-zero and padding cases are exercised by the scenario only). Its run used FULL_EPOCHS 40 / save_every 10 (the script now says 60 / 15; script hash ad8db67d..., not today's da064300...); the smoke profile is the same. The base evaluation's arms carry eval_videos.py de9c2e89... (= today's file) and are the registry's scorers.
  • Open. (1) Collect copies only an arm line's output_ref file (frames.json), not the 17 frames it lists. (2) No GPU run of the adapter's full path yet (full training, cut evaluation); the scenario stands in. (3) test_ext_flow_grpo_wan.TestRuntimeFacts reads the runtime scripts with ast and never imports them.

Area "video generation" attempt 2 (amendment) and the lifted GPU cap (tests/README.md section 11.25, EXT-229 to EXT-232)

Source: maintainers' decisions of 2026-11-14 (GPU-hour budget ceiling raised so that it no longer limits runs) and 2026-11-15 (attempt 1 FAIL, retry with short target texts and 8 prompts x 4 videos per epoch, 100 epochs; the maintainers' multimodal decisions, "Area 3 attempt 1 result and retry"); the area runtime <mm-root>/area3-video (README "Attempt 2 (amendment)", make_short_split.py, train_flow_grpo_wan_v2.py).

  • GPU-hour budget ceiling. ext/launch.py printed GATEDTRAIN_GPU_CAP_H=24 to gpu-step.sh and ext/smoke.py judged budget against 24 h. The budget ceiling was then raised to 1000, high enough not to limit runs (GPU hours are still logged in <HOST_WORK>/gpu-log.md and every full run is preceded by a smoke); direct runs passed 1000 while ext-launch still printed 24, and a smoke record of attempt 2 (about 12 h projected on a 16.7 h log) would have failed budget. Both constants are now 1000; the golden command and the tests that assert the printed prefix were updated (EXT-232).
  • Attempt 1 stays collectable. ext-collect re-hashes the launched script against the launch record (EXT-83), so editing train_flow_grpo_wan.py would have made attempt 1's run uncollectable. The amendment's trainer is a copy, train_flow_grpo_wan_v2.py, differing only in PROFILES (smoke2, full2) and DEFAULT_PROMPTS (prompts-short); eval_videos.py is unchanged (--items items-short). A re-collect of attempt 1 with the new code into a scratch runs root reproduces its FAIL (delta -0.00857).
  • Attempts kept apart (EXT-230, EXT-231). Script ↔ profile ↔ shard at launch and at collect; the launch profile stands for the script's profile in area 5's profile rule; an arm's evaluation env-runtime.json items_sha256 must be the registered items.jsonl's (before, a subset arm with the registered hash claimed was not refused but produced a MISSING gate through unpaired items).
  • Open. (1) The registry's gpu_h_estimate (4.8) and the evaluator rows' samples text ("400, 1") describe attempt 1; attempt 2 adds about 12 GPU-h and has N 288. (2) The amendment needs a new spec and a registration with amends (maintainers).

Area "VLA" adapter, slice 9 (tests/README.md section 11.26, EXT-233 to EXT-247)

Source: the area runtime <mm-root>/area8-vla (README sections 2, 4 to 6 and 11; train_lerobot_logged.py, a8_common.py, eval_libero.py 59cd2182; read 2026-11-15) and its GPU outputs out/area8-vla/base-1 (stage-1 ladder, 3,000 steps, 12 cuts) and base-1-eval2-<step> (probe evaluations), all read only.

  • Adapter lerobot_smolvla (ext/adapters/lerobot_smolvla.py, standalone). Cuts are the launcher's cuts/checkpoint-<step>/ (hard links to LeRobot's checkpoints/<step>/, cut.json last, 17 listed files); the model hash covers the ten deployable files; normalizer_sha256 follows the area's definition (compact JSON of the two processor state files' SHA-256). Checked by hand against the real outputs before the tests: checkpoint-500 is complete and its normalizer recomputes; the real samples.jsonl (3,000 steps, 95,976 samples) has every sampled frame in episodes 807-1260 with the dataset's (episode, frame), every epoch reads each of the 66,984 frames once, the first epoch's step 2,094 carries 8, and every cut's samples_consumed is the log's.
  • Two stages. As area 2: the spec's base is the stage-1 cut (checkpoint-500 by the pre-registered rule), stage 2 records it (base_checkpoint, base_cut, every cut's init_checkpoint, config.json pretrained_path) and must be mounted at /inputs/base-cut; a stage-1 run is never a candidate, a stage-2 cut never a base. Stage 2 must keep the base cut's normalizer (same dataset statistics; MM-19).
  • Training data. ext-collect requires JSONL shards, and the run reads parquet: the spec's data is a frame export (one shard per dataset data file, rows {index, episode_index, frame_index, task_index}, frames_meta.json), which the adapter re-derives with pyarrow from the parquet files reached through the run's read-only mounts (SHA-256 and rows). The export does not exist in the runtime yet: a host step must write it (draft export_frames.py handed to the recipe maintainers; the test helper _lerobot.write_frame_export is the same rule).
  • Arms. eval_libero.py writes env_version.json into each arm, not into a cut, so ext-arm-fill gained an opt-in hook (arm_env_version_sha256); the arm rules re-derive each episode's seeds (common random numbers) and check outcome, score and sub-metrics, and bind the arm to the registered items (env-runtime.json items_sha256) and to the evaluated cut (summary.json). The real base-1-eval2-500 arm passes them with the probe items and refuses under the gate items.
  • Report. Per-task success of both arms and the within-task clustering gap are report notes (opt-in report_notes hook in collect), as the decision asks.
  • --spec binds training launches only (found at the gate's candidate arm). mount_binding_problems applied the training rule (the spec's base cut in a read-only mount) to every launch under --spec, so the candidate arm (another cut at /inputs/cut) was refused with EXT-BASE. launch.spec_binding_problems now passes the launch's argv to an adapter that sets spec_binding_argv (opt-in; other adapters unchanged), and this adapter binds only train_lerobot_logged.py launches (at --request and --recheck). Tests: the direct hook call, and ext-launch --spec plus --recheck of a candidate-arm request; the end-to-end test fails on the previous launch.py with the gate's real message.
  • Spec pins. ext-collect checks a base pin against the whole cut directory's manifest (training_state included; the adapter declares no base_excludes), not the model hash of the ten deployable files; the fixture's spec has no pins, so no test covers this. The real spec first pinned the model hash and was corrected (the maintainers' multimodal decisions, "Area 8 result").
  • Open. (1) The MM-38 smoke record must name the registered (gate) item set to pass collect; the README's smoke evaluates 50 probe items, whose record would be refused (item_set_hash): run the smoke baseline on the gate items (--items gate --per-task 5) or decide otherwise. (2) The frame export must be written on the host before collect. (3) NVIDIA_DRIVER_CAPABILITIES is passed through the allow-list with one value; the image also sets it (ENV), which the direct runs did not rely on. (4) The base run's consumption is not in the stage-2 ledger (as area 2). (5) Collect hashes each 1.6 GB cut twice (completeness, then the manifest); about 15 s per cut on the host that ran the prototype.

Area "agentic RL" adapter, slice 10 (tests/README.md section 11.27, EXT-248 to EXT-262)

Source: the area runtime <mm-root>/area10-agentic (README section 0, in particular 0.10 and 0.11; run_agentic_nemo.py 04603e83, the agentic hooks module, math_code_env.py, agentic_core.py, traj_log.py, consumption.py, executor/, gen_agentic.py 8f32dcd2, score_agentic.py a3bc32c8; read 2026-11-15) and its 3-step GPU probe out/area10-agentic/p1-a3/train, all read only.

  • Adapter nemo_rl_agentic (ext/adapters/nemo_rl_agentic.py, standalone, NeMo RL helpers shared with nemo_rl_ext). LoRA cuts (<runtime>.agentic_cut, kind lora_adapter, r 32 / alpha 64, the 196 decoder projections in adapter_config.json, never lm_head); the model hash composes the base's manifest hash with the deployable files (MM-18), ext-arm-fill needs --base for a cut. Checked by hand on the real probe before the tests: checkpoint-3 is complete, every binding holds through identity mounts, the logs join 384 of 384 and the per-trajectory plan equals the area's consumption.build field by field (model tokens 191,757 = training_info.json total_valid_tokens; 182 executed tool calls, none ending at EOS: the stop-string fix of README 0.10 holds).
  • Environment as configuration. The run, every cut and every log line name env_id; the registry row's envs maps an environment to its deciding evaluator, which names it back (env_id on the evaluator row), and ext-collect refuses a run of another environment than the gate evaluator's (EXT-ENV, through the new opt-in wants_evaluator hook of collect). The adapter's environment table holds what each environment's log may show; NeMo RL's sliding_puzzle (fixture written by the area's own code around NeMo RL's real game logic) joins through the same code and has no evaluator, so it can never be gated. The area launcher itself still hard-codes ENV_ID = "math_code" (no --env option); a second real environment needs its registration in run_agentic_nemo.py and its own evaluator row.
  • Executor sidecar. Area 6's sidecar mechanism is reused with one opt-in key, image_interpreter, for an executor that runs the pinned image's own Python (no venv lock, the record's sidecar interpreter_sha256 null, the script re-hashed at --recheck and collect). Both the trainer and gen_agentic.py pair it; the scorer does not. Area 6's row is unchanged (a test keeps its venv_in_container rule).
  • Scorer pin needs a one-line area change. score_agentic.py (a3bc32c8) writes "env_id": "math_code" into eval_meta.json; MM-2 (arm.read_meta, ext-arm-fill) refuses unknown keys, so none of its arms could be collected. The registry pins the file without that key (a750f5be, composite f8e356f4; proposed copy handed to the recipe maintainers); the test checks that the pin is exactly the runtime file minus that key until the area adopts it.
  • A boxed tool call at turn 4 is rewarded (found at the full run's collect). MathCodeCore.step verifies every terminal turn whose text has \boxed, so a max_turns end can carry reward 1.0 (full-1: 1 of 138). The environment table allowed only 0.0 there and refused the run; it now allows (0.0, 1.0), with a test.
  • Consumption has no token fields. 05 section 12.2's ConsumptionRecord has no place for a trajectory's model and environment tokens, which the area decision asks to distinguish; the adapter checks them (mask runs add up to input_lengths) and puts the totals into the record's reason and the report, per-trajectory counts stay in the run's logs (open point, a maintainers' choice).
  • Open. (1) The scorer change above. (2) Token fields in the consumption record (design gap). (3) The probe profile (--profile probe) cannot be launched through ext-launch (smoke/full only); collect never needs it. (4) --max-steps under the full profile is allowed in 60 .. 100 (decision "60-100 steps"), unlike the other NeMo RL adapters. (5) The area's consumption.py wraps rows modulo the file length, NeMo RL's dataloader drops the last short batch: the same for 2,000 rows and 16 prompts, different for a file whose length is not a multiple of 16 (the adapter follows the dataloader).

Rename to gatedtrain 0.3.0 (tests/README.md section 11.31)

  • Names. ptc-hub 0.2.0 is renamed gatedtrain 0.3.0: package, CLI, entry point group gatedtrain.adapters, schema ids, ANALYSIS_CODE_VERSION, ledger writer_id, every PTC_* environment variable (GATEDTRAIN_*), host file, Docker context and second-daemon paths. Rule ids and error codes are unchanged.
  • Old persisted names are refused, not translated, extending the 0.2.0 rule from ptc-skel to ptc-hub: a registration with analysis_code_version: ptc-hub 0.2.0 (or ptc-skel 0.1.0) is refused with the amendment fix, and a version-only amendment to gatedtrain 0.3.0 is not post hoc (05 section 3.7, R17-1); records with ptc_hub.* or ptc_skel.* schema ids are refused with a note naming the writer. The R17-3 name map chains both renames, so a scorer file of either version proves a rename-only change.
  • Decision (host daemons are host configuration): the built-in daemon configurations and sockets are the standard ones and the gatedtrain ones. A host whose second daemon keeps its configuration or socket under another path lists them in the host file (extra_daemon_configs, extra_daemon_sockets, arrays of absolute paths); they only add refusals, apply under the GATEDTRAIN_EXT_* overrides too, and enter host_config_sha256 only when set, so existing record hashes are unchanged. A host set up before the rename must list its old paths there, or its second daemon's engine data and socket are no longer refused by name (a socket under /run stays refused by the socket-directory rule).
  • Real host data without fixed directory names. The real-data tests read GATEDTRAIN_TEST_TIERB_ROOT (the Tier B host work directory) and GATEDTRAIN_TEST_MM_ROOT (the multimodal recipes' root) instead of one data root with fixed subdirectories; the documents cite those files as <tierb-root>/... and <mm-root>/....
  • Kept bytes. Copies of real outputs (tests/fixtures/r11/longrun) keep their old names; recipe runtime schema ids are cited as <runtime>.<name>, since the recipes may rename them.
  • Packaging. uv.lock regenerated without upgrades under the restored [tool.uv] environments (macOS only); the sdist holds the package, LICENSE, NOTICE, THIRD_PARTY_NOTICES.md and README.md, not the tests (they need the full checkout).

Python 3.12: lenient realpath (found by the first CI dry run, 2026-11-19)

  • ext-launch and ext-collect crashed on 3.12 where they must refuse. os.path.realpath without strict raises PermissionError on Python 3.12 when a path component is a symbolic link the user may not read (/proc/1/root, /proc/1/cwd), where 3.13 keeps the component and goes on. The lenient resolution of a mount source (_real, used by the socket rule, EXT-40, before the strict EXT-51 check) therefore raised, and the CLI exited 1 with a traceback instead of 3 with the refusal (8 subtests of test_ext_review2 on 3.12). No mount was ever accepted. Path.resolve() (not strict) has the same problem, in the SDK's bound_mounts and the diffusers family's mount checks among others. gatedtrain.paths now holds realpath and resolve, Python 3.13's lenient realpath ported line for line, and every lenient resolution of a path from a request, a launch record or a run output (ext/ and families/) uses them; paths the user names on the command line keep Path.resolve(). On 3.13 the results are the standard library's; on 3.12 they differ only after a symbolic link loop, where 3.12 stops and 3.13 resolves the rest (tests/test_paths.py: 2,000 random paths over a tree of link chains, a loop and ..; the /proc cases where the link is not readable).

Review of the 3.12 path fix (2026-11-19)

A review of the lenient realpath change (previous section) reproduced each finding below with a script before the fix; the reproductions are now tests (tests/test_path_review.py, tests/README.md section 11.34).

  • S1, S2, S5 (output_ref resolved by path). arm._output_ref_problem checked that the lenient realpath of <arm>/<path> lay inside the arm, then hashed and copied by path. Where the lexical resolution exceeds PATH_MAX the lenient realpath keeps the rest of the path unresolved, so a link chain (a and a/b each a 2.5 KB relative chain, b/leak a link to a host file; S2) or a relative arm under a long cwd (S1) passed the check while the kernel opened the host file, and ext-collect copied it into the run. An absent path longer than PATH_MAX raised OSError (ENAMETOOLONG) out of the check (S5). Maintainers' decision (2026-11-19): an output_ref path contains no symbolic link at all (hard links are allowed; MULTIMODAL-SPEC MM-1). arm.open_output_ref opens the arm directory, then each component under the previous descriptor with O_NOFOLLOW (O_DIRECTORY for directories, O_NONBLOCK for the file, which must be regular by fstat) and hashes from that descriptor. Messages: output_ref path '<p>' contains a symbolic link ('<component>'; MM-1 allows none), output_ref file '<p>' is absent, ... is not a regular file, ... cannot be opened (<errno name>), ... cannot be opened: the arm directory cannot be (<errno name>); leaves the arm (absolute or .., checked lexically) and differs from its sha256 are unchanged.
  • Copy after the check. ext-collect (both copy sites) and ext-merge-eval copied output_ref files with shutil.copyfile by path after the checks, so a file swapped in between was copied. arm.copy_output_ref copies from the descriptor of the same walk, hashing while it copies; a link or a different hash is refused (EXT-ARM on the arm's flag, (changed after it was checked)), and the partial output is removed as for any refusal.
  • Arm files under a long path. read_meta, read_lines and provenance_problems used Path.is_file() and Path.exists(), which raise ENAMETOOLONG (and EACCES) on Python 3.12; they now report <file> cannot be read (<errno name>).
  • S3 (link loop on 3.12). Path.resolve() raises RuntimeError for a symbolic link loop on Python 3.12. The spec's file: URIs and the spec path (spec.py), the manifest root (canonical.manifest_document) and warmup --out (cli.py) now resolve with gatedtrain.paths, so a loop is a refusal; this replaces "paths the user names on the command line keep Path.resolve()" of the previous section.
  • S4 (duplicate arms). With several clauses, ext-collect told arms apart by their resolved path string, which differs for one directory reached by two paths when resolution stops early (a path past PATH_MAX). Arms are now keyed by (st_dev, st_ino) of the directory; an arm that cannot be inspected is refused.
  • S6 (EXT-113). _in_tree judged the interpreter's host file by the lenient realpath, so a loop, a missing file or an unreadable link below a tree's lexical path counted as inside it. It now uses the strict realpath, and a path that does not resolve is in no tree.
  • C1 (fixtures tied to uid 1000). The launch fixtures named user: "1000:1000", and EXT-63 requires the output directory, which the tests create, to be owned by the container's uid, so the suite passed only as uid 1000 and CI ran it through sudo -u '#1000'. The fixtures now use _ext.container_user() (the running uid and its primary group; the golden request and command carry a <user> placeholder filled at load time); the tests skip with a reason as root, for a uid without a user database entry, or when that primary group owns a Docker socket. .github/workflows/test.yml runs the suite as the runner user.
  • T1, T2 (test_paths oracle). On 3.12 the random comparison left every path through the loop out, and no case had a regular file in the middle, so a 3.12-style loop (stop and keep the rest), an undetected loop (a hang) and catching only FileNotFoundError and PermissionError (ENOTDIR) survived. test_fixed_values pins values that 3.12 and 3.13 both give (loop1/x, loop1/../a, a/f/x, a/f/.., ...), and a SIGALRM watchdog fails a test that does not end in 30 s. The review's mutants (edits of paths.realpath) are killed on 3.12 and 3.13: M1a drops the loop check (resolution never ends), M1b stops at a loop and keeps the rest (3.12's behaviour), M2b catches only FileNotFoundError and PermissionError (ENOTDIR below a regular file raises).
  • T3. A loop as an output_ref component is a case of test_path_review (refused as a symbolic link).
  • T4. A loop and an unreadable link (/proc/1/root) at the launch record's output_dir against --stage-out, the SDK's bound_mounts and the diffusers family's mount checks give a mismatch or no binding, never a traceback.
  • T5. test_paths.test_unreadable_link_is_kept skips where /proc/1/root is readable (as root); accepted.

Review of PR 2 (2026-11-19)

Four reviews and a verifier of the change above (gatedtrain PR 2) found that the arm's own files and the provenance sources were still read by path. Each finding was reproduced before the fix and is now a test (tests/test_arm_reads.py, test_r18_clauses.CollectTwoClauses, tests/README.md section 11.34). The ids are prefixed PR2- here, since the review of the 3.12 path fix used C1 too; test docstrings cite them unprefixed.

  • PR2-A1 (blocking). ext-collect copied items.jsonl, eval_meta.json and merge.json into the run by path (is_file, shutil.copyfile, following links) after checking them, so a container still writing its arm could swap one for a link to a host file between the checks and the copy, and the run's items.jsonl could differ from the records gated. New module ext/armfs.py: ArmSnapshot.read opens the arm directory once and reads the three files once each (without following links, at most 1 GiB) with their SHA-256; read_meta, read_lines, provenance_problems and the EXT-52 re-derivation parse those bytes, and ext-collect writes them into the run.
  • PR2-A2. provenance_problems hashed any host path named in merge.json (sources[].path, run_dir), printed the hash (an oracle for host files) and blocked on a FIFO. Sources must now be absolute paths in normal form under the sources root (the host's output root, or the new ext-collect --sources-root; MULTIMODAL-SPEC MM-5), are reached from the root's descriptor without following links and read as arm files; a mismatch says differs from the recorded hash, and a source outside the root is refused (provenance cannot be checked). ext-merge-eval and ext-from-nel record os.path.abspath of a source (normal form).
  • PR2-A3. read_meta followed links and echoed the content of the file it read (unknown keys, the schema value); a stat-then-read race and a FIFO hang remained. A link is now refused before anything is read, so only the arm's own regular file is ever parsed.
  • PR2-A4. The output walk opened the last component before checking its type (a device node opened by the collecting user). Every component is now opened with O_PATH (intermediates O_PATH | O_DIRECTORY | O_NOFOLLOW); only a regular file is reopened for reading (/proc/self/fd, O_NOCTTY) and must be the same inode. Without O_PATH (macOS): fstatat without following, then O_NOFOLLOW | O_NONBLOCK | O_NOCTTY.
  • PR2-A5. ext-merge-eval told outputs apart by the raw path string (outputs/x.txt and outputs/./x.txt, the second overwrote the first) and hashed its sources by path after the checks. Output paths must be canonical (output_ref path '<p>' is not in canonical form (no.or empty component)), and merge.json records the hashes of the bytes merged.
  • PR2-A6. A NUL or a lone surrogate in an output path raised ValueError or UnicodeEncodeError; now contains a NUL character or is not valid UTF-8.
  • PR2-B1. An intermediate directory with mode 0o111 (search only) was refused (EACCES); O_PATH walks it on Linux. Without O_PATH (macOS) it is still refused, and a file swapped for a FIFO or device between the type check and open is opened without blocking before the identity check refuses it (armfs docstring).
  • PR2-B2. tests/README.md EXT-45 now says any link is refused.
  • PR2-B3. A read error of an output during the copy was reported as a failed write of --runs-root; it is an EXT-ARM refusal now.
  • PR2-B4. The duplicate-arm key is the opened directory's identity from the snapshot; an arm that does not open is reported once (by its files), with the errno name.
  • PR2-C1, PR2-C2. The S4 test now includes an alias past PATH_MAX (a working directory deeper than PATH_MAX, arm and lnk to one arm) that a resolved path string misses, and both collect copy sites have swap tests; mutants keying arms by paths.resolve, copying outputs or arm files by path, hashing merge sources by path or ignoring the sources root are killed.
  • PR2-C3. _ext.container_user() raises AssertionError instead of SkipTest under GATEDTRAIN_REQUIRE_CONTAINER_USER=1, which CI sets (and prints id), so a runner user that cannot launch a container fails the launch tests instead of skipping 176 of them.
  • PR2-D1, PR2-D2 (documentation). The mutant ids and T5 of the previous section are defined (D1); README "Changes since 0.3.0" states the breaking changes (D2).

Review of PR 2, round 2 (2026-11-19)

Round 2 of the review (ids prefixed R2-). Each was reproduced first and is now a test in tests/test_arm_reads.py.

  • R2-S1. ext-from-nel read each NeMo Evaluator run by path: full_config.yaml four times and results.jsonl twice, following links (an outside file's hash went into merge.json) and blocking on a FIFO, and a config swapped after the sampler and seed checks was the one hashed (and later passed ext-collect, which compares only the hash). The run directory is now opened once and both files are read once without following links (armfs.read_file); the seed, sampler and scorer checks (tierb._run_seed_and_repeats, _run_sampler take the parsed config; Tier B is unchanged), the conversion and the recorded hashes use those bytes.
  • R2-C1. A relative --sources-root never matched an absolute source path; the root is made absolute (CLI) and armfs.under_root takes it from the working directory.
  • R2-C2. A source recorded by the real path of a root that is a link was refused; under_root accepts the root as given or by its real path. The refusal's fix names --sources-root.
  • R2-C3. The armfs docstring and PR2-B1 state what holds only on Linux.
  • R2-C4. open_regular closes the reopened descriptor when fstat fails.
  • R2-C5. An invalid nel_benchmark and a source without run_dir have their own messages.
  • R2-T2 to R2-T7. New tests: the normal-form guard of under_root (/root/a/../.., /root/../x, //root/x), a file changed after the snapshot leaves read_meta and read_lines unchanged, the arm directory replaced before copy_output_ref is refused, the size cap with an explicit limit (read_fd(limit=None) reads MAX_FILE_BYTES when called), the provenance refusal tests assert their reason, and ./eval_meta.json is asserted as not canonical (it no longer reaches the reserved-name check). The review's surviving mutants M13, M15, M16, M17, M18 and M21 are killed.
  • MM-5. The sources root is where sources may be read from, not evidence that they are authentic.
  • Not in this change (a follow-up): stage outputs read by path (manifest_entries, sdk.read_json, read_jsonl, families/flow_grpo), tierb-collect's copies, per-file-type size caps, output hash caching and a total cap.

Review of PR 2, round 3

  • R3-1 An empty or null NeMo Evaluator config was read again by path. yaml.safe_load gives None for an empty file, null or ~, which tierb._run_seed_and_repeats and _run_sampler take as "no config given" and read full_config.yaml again by path, following a link or blocking on a FIFO the container swapped in after the armfs read. ext-from-nel now refuses a config that is not a mapping before calling them (tests/test_arm_reads.py, test_null_config_refused_without_a_second_read).

The CPU demo across machines (found by CI, 2026-11-20)

  • The demo's gate depended on the runner's CPU. The stand-ins train on one thread with deterministic algorithms, so a run repeats exactly on one machine, but PyTorch chooses CPU kernels by instruction set and MKL its BLAS code path. On GitHub runners the same commit and the same wheels gave PASS in one job and FAIL in another (test_e2e_slow: the warm-up baseline scored 0.833 there against 0.522 on the development host). Three code paths depend on the CPU: ATen's kernels, MKL's BLAS and oneDNN, which JIT-compiles kernels for the instruction set (the stand-ins' GELU ran as eltwise jit:avx2 on the development host and on AVX-512 on a Xeon runner; a first fix that pinned only ATen and MKL still gave 0.745 there). The stand-ins now pin ATEN_CPU_CAPABILITY=default and MKL_CBWR=COMPATIBLE before torch is imported (gatedtrain/stubs/__init__.py; an operator's own setting wins) and turn oneDNN off (model.configure_torch); runner.run imports the stand-ins before torch. The CI workflow prints the runner's CPU model and instruction sets.