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:
04is04-workflow-and-composition.mdand05is05-evaluation-and-lineage.md.
Resolved by interim rules (round 2, 2026-11-09)¶
- F-1. What sets
underpowered. Resolved by G-3 (revised):underpoweredis 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,
underpoweredis true, so an equivalence non-rejection is INCONCLUSIVE, never FAIL (05:82).achieved_powerandplan.n_requiredstay 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: trueis printed in the JSON and text reports. The lr = 0 control on 500 prompts is FAIL withsd_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 forstage-precision edges; the runbook says to record that edge by hand. - F-13. Missing validation metric on Tier B. Closed: at
4f39fd8NeMo 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 clonedrop_last=Trueis on line 888; the decision text said 887, which iscollate_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_scoreandcandidate_scoreuse the paired items only;unpaired_baselineandunpaired_candidateare reported, with awarning: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 declaresdisjoint_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_sizelarger than the training rows (TRAINER-CONFIG onartifacts.<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.jsonllives 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) andinterval.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 ofeval_seeds),sampler(→sampler.name) orevaluator(→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
workflowandgatenames are not compared with the spec. The demo controlsspec-no-train.yamlandspec-bad-train.yamlreuseregistration.yaml, which names the workflowskeleton-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.TestRegistrationIsAuthoritativenow covers G-4 throughgatedtrain runfor alpha, power, mde, margin, type, seeds, sampler and evaluator.
F-7. Registration contents enforced as an interpretation¶
analysis_code_versionmust equal the running code (gatedtrain 0.3.0); otherwise REG-FIELD. 05:142 lists the version in the registration but states no mismatch rule.multiplicitymust be{plan: single_gate, family: null};sigma_planmust beucb80orfixed;unitmust beprompt;intervalmust becluster_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 lonealpha_family,gate.threshold,gate.human,test.bar,test.type) are refused withSPEC-SHAPEinstead 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.yamlkeeps 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-requeueprevents 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-collectrefuses a secondexp_*directory.
Tier B helpers (TIER-B-SPEC H-1 to H-8, interim rules G-15 to G-19)¶
- F-15.
gatedtrain rundoes not drive Tier B. The maintainers' prototype decision says "the samegatedtrain rundrives" Tier B. It does not:runrefusesrl.nemo_rl@0.1and never launches a GPU job. The Tier B path is the helpers, ending ingatedtrain 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-STAGEandTIERB-BASE. The tests fixEXPORT-REVISION,EXPORT-HASH,EXPORT-LAYOUT,MERGE-EVAL,TIERB-RESULTS,TIERB-DATAand the retiredTIERB-PAIRING(design revision 10: unpaired items make the gate MISSING instead). - F-17. Resolved: training starts from the gated base model.
launch_specandbuild_commandtakebase_modeland emitpolicy.model_name=<base_model>once, for every launcher and profile (goldencommon_overrides). - The tokenizer follows it (
name: ${policy.model_name}, grpo_math_1B.yaml:157). NeMo RL loads it withfrom_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, intobase-model/. The second download, therefs/maincheck and R10 are gone. base_modeldefaults toNoneso that older calls keep working.Noneleaves the recipe'sQwen/Qwen3-0.6B, which a gated run must not use.- F-18. The export's download path is untested. Without
--source,export-gsm8kfetches the Hub APIshaand the parquet filesmain/{train,test}-00000-of-00001.parquetat that revision. The file names are unverified (no network here). The--sourcepath is tested. - F-19. The held-out set keeps commas; NeMo Evaluator strips them.
heldout/prompts.jsonlfollows NeMo RL (G-19) and serves only as theprompt_set_hashinput. 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_hashfor 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 recorduv pip freeze. Since design revision 10 (R10-5) the registration carries this resolved hash asevaluators[0].manifest_hash; see the next section. - F-21. Large checkpoints are hashed.
tierb-collecthashes 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-collectrefuses with TIERB-PROMPTS, before creating anything, unless all of these hold: - the paired
problem_idxset isrange(len(heldout)); - every
expected_answerequals 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-collectreadspolicy.model_namefromstep_<last>/config.yamland 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
basedirectory 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.yamlthat 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_modelhandles it. - LOW-2. The runbook's TIERB-BASE row covers both causes: symlinks in the baseline directory, and a
policy.model_namethat is not the spec's base-model directory. - LOW-3.
tierb-collectwalks 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_entriesusedPath.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.tomlrestricts the uv lock to darwin ([tool.uv] environments, G-11), souv sync --lockedfails on a Linux single-GPU host. - Fix.
requirements-tierb-host.txtholds 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.preflightandstubs/. - Runbook step 3b installs these pins into a plain venv with
uv venvanduv pip install.gatedtrainon the host then means<HOST_VENV>/bin/python -m gatedtrain. gatedtrain run,warmupand 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) andevaluate()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_hashnull 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 reasonevaluator_hash_mismatch; the report givesevaluator_hashandevaluator_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_unpairedis 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), withmissing_baselineandmissing_candidatereported;tierb-collectwrites the run instead of refusing withTIERB-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>andpost_hoc: <bool>; the report givesregistration_amendsandpost_hoc. Withpost_hoc: trueonly a PASS changes: it becomes INCONCLUSIVE with reasonpost_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'spost_hocvalue. - 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 andsd_zerostay. - R10A-6 (R10-7, supersedes G-8). The spec's
test.alpha,power,mdeandmarginare optional; the registration is authoritative and must carryclause.alpha. A spec value that differs is still refused (G-4). - R10A-7 (review finding 7). New rule
TIERB-DATAon the run's saveddatasection:shufflemust befalse,data.trainone dataset (a mapping or the one-element list NeMo RL saves), itsdata_path<dir>/<export dir name>/train.jsonl, andsplit_validation_size0 (absent means 0, theResponseDatasetdefault, response_dataset.py:50 at 4f39fd8). - R10A-8 (review finding 8).
k_actualgives 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 whosemetadata.eval_seeddiffers fromeval_seeds[repeat]is MISSING (seed_mismatch). Tier B keeps each record'smetadatawhen it readsscorer_rewards. - R10A-9 (review finding 9).
gatedtrain impactprintscounts: {orphaned, superseded}(JSON) andorphaned: <n>, superseded: <m>(text). Orphaned records (after the last committed cut, one per (step, shard)) are kept inlineage/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 withstatus: "orphaned"; every rollup reads kept rows only.) - R10A-10 (review finding 10).
p_valuewithp_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'sbackend.trainerrecordsnemo_rl_modified("unknown"without the flag) andimage_build_notes. - Status reasons.
status_reasonslistsno_pairs,missing_above_bound,k_mismatch,seed_mismatch,evaluator_hash_mismatch(MISSING) andmin_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;underpoweredis 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() == 0treated 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 thezero_width_intervalreason, so they always agree. With n = 1,sd_zerostays 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 readsp_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 equivalenceplan()still reportsmdewith the one-sided formula (z_{1−α} + z_power) σ √(DE / n) (05:124). It is display-only:n_requireduses 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, optionalestimator: mean | ratio_of_sums) with the top-leveleval_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 rolepromptsof typeprompt_dataset,cluster_by: prompt); a legacy K form withoutdirectionreads ashigher_is_better; a document with both forms of one field is refused on the legacy key.registration.normalizegives a copy in item names, andWorkflow.clauseis 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.EVALUATORSstands in for the evaluator manifest: both prototype evaluators declarehigher_is_better, range [0, 1] and only themeanestimator, so a clause with another direction, or withratio_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
itemsof typeitem_set;Workflow.names["items"]names the artifact for either role. A training stage'sdatastaystraining_dataset. - R11A-4: new writes.
gatedtrain runandtierb-collectwriten_items,samples_per_item,unit,direction,natural_units,eval_distribution,item_set_hash,missing_reasonsandresampling_unit: item;manifests/item_set.json(typeitem_set), lockfileartifacts.item_set, lineage gate roleitems. 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_evaluatorconverts NeMo Evaluator records (a raising scorer becomeserror: {class: scorer_error}, never 0;output_refnames the SHA-256 ofmodel_response, verifier choice 9). Expected items are the registered item set times K per arm; missing reasonsabsent, the error class,out_of_range(NaN and ±inf always) andno_seed(R13-6); MISSING clause reasonsk_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 formevaluate). 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_diffand 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_betterclause are negated before Δ, margins are in oriented units, and the natural-unit difference (oriented interval negated and swapped) is reported beside it;baseline_scoreandcandidate_scorestay in natural units. - R11A-16 (R11-1, R13-7):
post_hoc.gates.is_post_hocis true iffamendsis set and a candidate-arm result of the judged checkpoint was created strictly beforeamended_at(instants, RFC 3339). The registration accepts an optionalcreated_at(RFC 3339 with a zero UTC offset), which is theamended_atto pass. Wiring the evidence intotierb-collectis deferred (NeMo Evaluator arms carry no checkpoint identity or creation time); the declaredpost_hocflag keeps working. - R11A-17: Tier B item set.
tierb-collectgates on the registered held-out set: a held-out problem missing from an arm (or both) is a missing item (absent), a record withoutmetadata.eval_seedisno_seed, and TIERB-PROMPTS (a) refuses only problems outside the held-out set. The item-set hash is checked againsteval_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.SCHEMAhasderivation; Tier A and Tier B rows arereconstructedat precisioniteration(verifier choice 6), checked byledger.check_precision. Impact results carryderivation(null for a pre-revision-11 ledger) and the text line addsderivation <value>. - R11A-19 (R11-16): ranges.
impact --jsonaddsranges: {orphaned: [{run_id, attempt_id, shard, first_step, last_step}], superseded: []}; text linesorphaned_range: …ororphaned_ranges: none, and the same for superseded. The R10A-9 counts stay. - R11A-20 (R11-15): checkpoint completeness. The lockfile's
backend.trainer.checkpoint_completenessdeclares NeMo RL 4f39fd8's rule (atmp_step_Ndirectory is renamed tostep_Nafter the write), and onlystep_Ndirectories are cuts. - Not done (deferred, tests/README.md section 11.16 "Deferred").
model_manifest_hashof Tier B checkpoints and the cut manifest (the run paths pass the arms' manifest hashes but noexpected_models, which would compare a hash with itself);base_refandlora_compose;stage-precision edges; environment parameters as aDatasetSnapshot; 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_hocevidence intierb-collect;unit: training_seed; the export'sexport.jsonprompt_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.combineunchanged (a constraint result is one more clause inand).runand 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_setis a constraint clause: threshold (type: superioritywithbar, P1) ornon_inferiority(withmargin);direction: lower_is_better;interval: clopper_pearsonorclopper_pearson_discordant; nosigma_planorsigma_pilot(P2);planning_effectin (0,bar] or (0,margin]. The registration holdsconstraint_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). Aconstraint_setorjudge_qualificationwithout a constraint clause is refused;baroutside a constraint clause is refused (REG-FIELD). A specgate.thresholdmaps tosuperiorityandtest.constraint_setmust equal the clause's (G-4);runitself still accepts only the three paired gate types. - R12A-3: scorer hash.
constraint_set_hashis the RFC 8785 canonical JSON SHA-256 of the whole set (P9);evaluators[0].manifest_hashmust equal it, and an arm run with another set is MISSINGevaluator_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 isout_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 belowbar, p = P(X ≤ k; n,bar), binomial power atbar − planning_effect. Non-inferiority (R13-1): bound of c/n below δ, p = P(X ≤ c; n, δ); b, c,delta_hat= (b − c)/n anddifference= (c − b)/n reported.sd_zerowhen all per-item values (differences) are equal; the bound keeps positive width, so it is never the zero-width INCONCLUSIVE.underpoweredwhen power is below target, n belown_required, or the planning rate is outside [0, bound) (power not computable). MISSING precedes INCONCLUSIVE;max_unpairedas 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 asmargin − 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_qualificationreturnscan_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 isREG-JUDGEon its own field and the run-time clause is MISSINGjudge_not_qualified; on a non-blocking clause the judge is supporting (noREG-JUDGE). A missing egress approval of an external judge isREG-EGRESSblocking or not, and MISSINGegress_unapprovedat run time. Per-batch canaries (registered set; MISSINGcanary_absent/canary_missed) apply only to a blocking clause (R13-4); a supporting judge's batches are still summarised incanaries(withrequired: falseandby_arm). - Report (R12A-16).
constraint_reportcopies the section 11.17 keys from the result; for the non-inferiority form the top-level canary lists concatenate both arms andevaluate_constraint'scanaries.by_armattributes them. - Not done (deferred). Wiring into
run,tierb-collectandext-collect, the CLI text, readingitems.jsonl/judge_batches.jsonl/eval_meta.jsonfrom 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 MISSINGmalformed_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 theevaluatorsentry whoseidis the spec gate'sevaluator.spec.load_specpasses the gate's evaluator toread_registration/check_contents, which check direction, estimator andbaseline_pilot_meanagainst that entry'sitems.EVALUATORSdeclaration; 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 astest_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) usetierb.EVALUATOR_IDwhen 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 timerunner.gate_and_reportcompares the run's evaluator hash with the deciding entry'smanifest_hash, and the report'sevaluator_hash_registeredis that hash. The review's repro (decoy first, real evaluator second with a null hash,lower_is_better) is refused byvalidateandrunwith both errors. - R11A-25 (MEDIUM-2). Every
evaluators[i].manifest_hashmust besha256: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 itemout_of_range(gates._ratio_parts_usable); it never reaches the sums. - R11A-27 (LOW-4).
evaluate_itemsraisesValueErroron a repeated item ID (verifier choice);constraints.evaluate_constraintdoes the same. - R11A-28 (LOW-5): production reader.
runner.read_arm_recordsreads every non-blank line of an arm'sresults.jsonl: a line that does not parse, is not a JSON object or has noproblem_idxbecomes a record with the unknown keyunreadable_results_line, and duplicates are kept, so both reachevaluate_itemsasmalformed_record(clause MISSING).gates.load_paired_recordsis 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 coercesproblem_idxwithint(), so a string"3"is an unknown item (MISSING) instead of item 3. Extended tomerge-eval(re-review M-1, 2026-11-11).tierb.merge_evalread each single-seed run withload_paired_recordsand 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 withread_arm_records): a line that does not parse, is not a JSON object or has noproblem_idx, aproblem_idxorrepeatthat is not an integer (verifier choice: nothing is coerced), and a second record for one(problem_idx, repeat)refuse withMERGE-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 besidesigma_pilotas 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_atis required whenamendsis 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
amendswithoutcreated_atand were refused by the new rule; each now also setscreated_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 declaredpost_hocflag 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, ...):itemsis a required keyword; the expected items areitemsx K per arm, never the items of the records (a deleted violating record isabsent). Thetest_r12_constraintshelper now passesregistered_items(...), the IDsi0000... for the matrix size (test edit chosen by the maintainers). - R12A-19.
expected_modelsas ingates.evaluate_items: an arm whosemodel_manifest_hashdiffers, is null or absent is MISSINGmodel_hash_mismatch(the baseline arm too, non-inferiority form). - R12A-20.
gates.evaluate_itemsraisesValueErroron a clause withconstraint_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);flaggedcounts only when it istrue. A batch whosejudgeis not a registered judge, a record entry that is not[item, repeat], or a record in two batches of one judge is MISSINGmalformed_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 isREG-JUDGE registration.constraint_set.canaries[<i>]. An approval whosedestinationis notuploadisREG-EGRESS/egress_unapproved(already so; now pinned). - R12A-22.
model_versionfails (d) when empty after stripping or equal, after stripping and case folding, tolatest,current,stable,defaultornewest(constraints.FLOATING_VERSIONS);familyis compared withpolicy_familyandtraining_reward_familiesafter stripping and case folding. - R12A-23.
constraint_report(...).judges.<id>addstransfer_test. For an external judge each arm'segress_approval_idmust equal the registeredapproval_id; another value, null or absent is MISSINGegress_unapproved(either arm).test_r12_constraints.TestJudgeAtRunTime.test_external_judge_recorded_verdicts_no_networknow sets the arm's id (test edit chosen by the maintainers). - Still deferred (R12A-24). Binding the clause's
blockingto the spec gate and excluding supporting clauses fromcombinecome with theext-collectwiring.
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 againsttierb.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 mutantcheck_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 itemout_of_range. Before, 10400 raisedOverflowErrorand a single numerator of 1e308 raisedValueErrorin 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 isout_of_rangetoo (gates._out_of_range). - L-2.
constraints.evaluate_constraintraisingValueErroron a repeated item ID is now pinned by a test. - Deferred (R12A-25). Requirements for wiring constraint clauses through
ext-collect: (a)constraints.check_registrationtakes the gate's evaluator id and compares the deciding entry'smanifest_hashwithconstraint_set_hash(registered set), refusing a missing or duplicated id (it readsevaluators[0]today); (b)evaluate_constraintgets the registeredconstraint_set, and each arm'sconstraint_set_hashmust equal the deciding entry's hash; (c)itemsfrom the registered item set,expected_modelsfrom 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. Commandsext-collect,ext-merge-eval,ext-launch,ext-from-nelincli.py. No module undergatedtrain/extimports a framework, torch or a pickle loader (EXT-12). - Reused, not duplicated.
spec.load_spec(the registry ids validate as backendext;runrefuses them withSPEC-REF,tierb-collectwithTIERB-SPEC),registration.check_contentswith the gate's evaluator deciding (deciding_evaluator, R11A-23;resolved_evaluator_hashreturns the EXT-6 identity hash for registry evaluators),items.EVALUATORS(filled from the registry rows),runner.check_pins,copy_registration,write_plan(new optionaln_available),write_manifests,gate_and_report(new optionalrecords,model_hashes,expected_models; the Tier A and Tier B paths are unchanged),gates.evaluate_items,ledger.SCHEMAandshard_table, thetierbstrict NeMo Evaluator readers (_read_run_strict,_run_seed_and_repeats,_run_sampler,_declared_scorers).ext-merge-evalandext-from-nelread the registration with the runs' or--evaluator's id deciding, never throughtierb.load_registration(R12A-27). - Impact (EXT-19).
impact.impact_queryadds, per run, every checkpoint of a training stage whose data edge has precisionstageand whose snapshot holds the shard (first_stepandderivationnull,possibly consumed), and then followsusedmodel edges bymodel_hashacross the selected runs to a fixpoint, at the coarsest precision on the path (R13-10). Every result row now carriesmodel_hash(null for Tier A and Tier B rows) andvia_model_hash(the parent model hash of a transitive row). - Report.
gate_report.jsonaddsadapter,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-collectalso copies files named byoutput_refintoeval/<arm>/so the record stays resolvable inside the run.ext-merge-evalrequires everyeval_metakey buteval_seedsandcreated_atto agree between runs (MM-5 names five; the others identify the evaluator and arm). A non-numeric scorer value inext-from-nelrefuses (EXT-NEL); a missing one is amissing_scorerecord. Registration keycontaminationtakes onlyallow_exact_overlap(bool). - Test defect, fixed by the maintainers (2026-11-11).
test_ext_collect.TestTransitiveImpact.test_shard_of_second_runcould not pass:_ext.build_stage_outwrote byte-identical checkpoints for runs X and Y, soy.cand_model == x.cand_model. The fixture now takes a weighttag(ExtScenario(stage_tag=...)); run Y usesy-ckpt, andtest_chain_hashesasserts that Y's trained hash differs from X's. No implementation change. - Deferred (tests/README.md section 11.18). TRL
iterationprecision, observed sample logs and exposure, LoRA identity andlora_compose, normalizer and environment versions, two-stage chains, WER and T0 report fixtures, constraint clauses throughext-collect(refusedREG-CONSTRAINT), root-image deviations, registry rows of areas 2a to 8. The TRL layout (checkpoint-<N>,trainer_state.jsonwritten 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, andbuild_commandraises if a value before the image starts with-. Bothext-launchandext-collectrefuse. - M2, EXT-40: sockets. The
docker.socksubstring rule missed/run/docker-gatedtrain.sock,/var/run,/runand/. Mounts are now judged on the lexical path and itsrealpath: a socket path or file, an ancestor of a daemon socket, or anything under/runor/var/runis 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.jsonlraised. 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
usedmodel 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),
RecursionErrorfrom deep nesting is a problem string, offsets must be integers (not booleans) with begin <= end. - L3, EXT-44.
meta_differencesfell back to==, so[False, True]equalled[0, 1];ext-merge-evalcompared with!=alike. Both now compare canonical JSON bytes. - L4, EXT-45. An
output_refnamingeval_meta.json(also./eval_meta.json) madeext-merge-evaloverwrite 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-launchnow appends 12 hex digits of the record's hash, andext-collectrecomputes it. A run whose lastENDhas a non-zero rc refuses.<HOST_WORK>/bin/gpu-step.shhardcodesWORK=<HOST_WORK>and writes its log there whatever host_work the record names;ext-collectreads<host_work>/gpu-guard.logonly when the script'sWORK=line ishost_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-collectchecks a merged arm'smerge.jsonagainst its sources (hashes, seeds, eval_meta) and a non-nullcheckpoint.base_model_hashagainst the spec base.ext-from-nelrecords each run's NeMo Evaluator servicemodel(service_modelinmerge.json) and refuses runs that name different ones; that the server loaded--checkpointstays 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 nomodel_hashon checkpoints orusedmodel edges, soimpact --runs-rootcannot follow an external run that starts from a Tier A or Tier B checkpoint back to the shards of that tier (and the reverse). Addingmodel_hashto 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(labelext-a1-trl-smokebecameext-a1-trl-smoke-c85ff5d6a424, EXT-46);test_ext_launch.TestGoldenCommand.test_record_contents(the label is checked as the hashed label) andtest_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_modelfirst (:3229), optimizer, scheduler and RNG state (:3252-3255),trainer_state.jsonlast (:3269); TRL writes the model card before calling the parent (grpo_trainer.py:3389-3390). The one exception,entropy_ctrl_state.jsonafter the state withuse_adaptive_entropy(:3391-3395), is not used. The completeness rule is unchanged; it now carriessources, andverifiedstays false until a smoke run shows the layout on disk. The fixture cut now has the verified file set (tokenizer filestokenizer.json,tokenizer_config.json,chat_template.jinjaonly), the stage output the filestrain_grpo.pywrites (no top-levelsave_modelfiles, noruns/). - Base binding (EXT-20).
config.jsonnever 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 readsrun_args.jsonmodel_name_or_path(written bytrain_grpo.py) and compares it with the read-only base mount's container path;config.jsonis not read for it. - Consumption (EXT-18, EXT-48, EXT-49; maintainers' decision).
iterationby the MM-22 mapping whenrun_args.jsonshowsshuffle_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 atrain_file_sha256equal to the spec shards' concatenation; P =generation_batch_size / num_generations(grpo_trainer.py:1309-1316). Rows reuseledger.step_shards(same drop-the-tail epoch rule as D-1),derivation: reconstructed. Anything else isstagewith the reason in the report note.samples.jsonlis not read.collectpassesrun_idtoconsumptionandstage_outtochecks. - Seeds (EXT-32, EXT-50).
seed_derivationnamesrun_args.jsonand the known limitation (vLLM colocate engine seedprocess_index // tp= 0, vllm_generation.py:357). New verifier choice:run_args.jsonseedmust equal the launch record'straining_seed(EXT-LAUNCH --launch-record.training_seed). - Launch command (EXT-24, MM-34).
build_commandadds--runtime=nvidiabefore--gpus all(GPU steps only),--shm-size=8gafter the security options, and mounts each tmpfs path:rw,exec,size=8g; fixed in code, the record'stmpfsstays paths only (EXT-39). MM-34 now states theexecrequirement. The golden request follows the area1-trl README shape (venv_in_containerwith a fixture lock, venv and Python mounted read-only at their own paths,/inputs, one writable/out); new labelext-a1-trl-smoke-be4d77f1644d. - Fixture versions.
_ext.FREEZEis now trl 1.16.0, transformers 5.17.0, vllm 0.31.0, torch 2.13.0. - Open:
TOKENIZERS_PARALLELISMis refused. The README's command setsTOKENIZERS_PARALLELISM=false, but the EXT-26 credential-name rule (TOKENanywhere in the name) refuses it, soext-launchwould 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 usesrw,exec,nosuid,nodev,size=8g. Encoded: the maintainers' string (launch.TMPFS_OPTIONS). Whether Docker addsnosuid,nodevto a--tmpfsmount 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.jsondoes 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_checkpointandbuild_stage_outin the verified layout,run_args,shuffle_args,ExtScenario(args_mutate=...)replacingbase_name_or_path);test_ext_collect(TestCollectPassexpectsiteration; thestagetests moved toTestCollectShuffledStage;test_base_binding_mismatcheditsrun_args.json;TestTransitiveImpactuses shuffled runs and copieschat_template.jinja);test_ext_registry(component list, final-save test builds its own output, completenesssources);test_ext_launch(launchcopies 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.realpathreturns/proc/1/rootunchanged for a non-root user (the link cannot be read), while dockerd (root, no user-namespace remapping) mounts the host's/; withuser: "1000:984"the container could then reach the daemon socket. A host path under/proc,/sysor/dev(lexical or resolved) is now refused, every mount source must resolve withrealpath(strict=True), and the container's gid may be neither 0 nor the group of an existing daemon socket (launch.docker_socket_gids, injectable asisolation_problems(socket_gids=...)). Bothext-launchandext-collect. Consequence: a mount source must exist on the launch host whenext-launchruns (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.jsonchecks covered the sources only, so editing the arm's scores passed.ext-collectnow rebuildsitems.jsonlfrom the sources (arm.merge_recordsforext-merge-eval,from_nel.convert_recordswith the registered item set forext-from-nel, the same functions the commands write with) and requires byte equality. Not done, open question below: refusing a multi-seed arm withoutmerge.json. - M-b, EXT-53.
START, END rc=0, START, PREEMPTEDwas accepted; the label's last terminal event must now beEND 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
WORKandLOGonce each (anyX=,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
ENDrc usere.fullmatchwith 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._transitivekeeps every path of a cut inpathsand answers with the finest per-path precision; a row-levelconsumedcut is no longer weakened by astagepath. 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-nelremoves the partial output and exits 3 witherror[EXT-WRITE], not 1.ext-launchis unchanged (it writes one file withopen("xb")). - X2, EXT-60. A direct
build_commandtest now covers every value before the image. - Maintainers' decisions. Credential names are matched by component (EXT-55):
TOKENIZERS_PARALLELISM=falseis back in the golden request (this resolves the TOKENIZERS open item of the TRL section), andAWS_ACCESS_KEY_ID, which the old substring list missed, is now refused.launch.TMPFS_OPTIONSisrw,exec,nosuid,nodev,size=8gas in the area1-trl README (resolves the tmpfs open item). - Open: a multi-seed arm without
merge.json. The review asked to refuse it (deletingmerge.jsonremoves 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-sourceext-merge-evalpasses). Options: (a) keep accepting one-piece arms (recommended for the prototype; document that provenance is checked only whenmerge.jsonis present); (b) requiremerge.jsonwhenever K > 1, i.e. every multi-seed arm passes throughext-merge-evalorext-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 helpersrooted,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) andlaunch-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 bytest_ext_review2/test_ext_hardening/test_ext_launch. Survivor: the hashed-labelfullmatch(EXT-54) reverted tomatchwith$: equivalent, since a label with a trailing newline still differs from the recomputed one. The first run also left the lexical/proccheck, the resolved-path kernel check, the//normalisation and the resolved host_work comparison alive;/proc/self/cwd,//proc/self/cwd, links to/sysand/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/dockeris 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, anditems.jsonlre-derived, only whenmerge.jsonexists. 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/dockeris 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/dockeror/var/lib/containerd, atext-launchandext-collect. Ancestors of the output and of/run,/var/runwere 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 killsTestAncestorAndDockerData.
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()readsGATEDTRAIN_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 keepsoutput_root, compared at ext-collect. ext-collect refuses (EXT-STAGE) any cut file,run_args.json,env-freeze.txtorsamples.jsonlolder 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 missingrun_args.json, a missing or differenttrain_file_sha256, a missing read-only mount of the export directory (the shard directory's parent, export-gsm8k layout), and atrain_fileother than<export mount>/train.jsonl.consumptionstill degrades tostagewhen 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/homeor 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-trlcontains.venv. - M2, EXT-67. host_work must equal the configured one;
--gpu-logmust be<host_work>/gpu-log.md;gpu_step_log_problemruns at ext-launch;gpu_step_sha256recorded and re-checked at ext-collect and--recheck;gpu_est_h > 0(and a full run'sprojected_gpu_h > 0). - M3, EXT-68. run_args
profileequals the record's (EXT-PROFILE),dry_run is False,grpo_config.max_stepsequals the last cut's step (EXT-STAGE). - M4, EXT-69.
build_commandemits the strict realpath of each-vsource;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:1000refused 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
MONKEYis refused too, a false positive accepted);NVIDIA_*,DOCKER_*,LD_PRELOAD,LD_LIBRARY_PATHrefused. - 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 isEXT-WRITEexit 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 carrieschain(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.pyGSM8KReward._log), elsestage. - Fixtures and existing tests changed.
_ext.ExtScenario: export layout<root>/export/{train/, train.jsonl}(spec templatefile:export/train), output root<root>/out, stage output<root>/out/a1/stage-out(was under host-work),gpu-log.mdin host work, launch record with the export mount at/inputs/exportand the new fields,retrain(),env();samples.jsonlfollows 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,TestGpuStepAssignmentsrelaunches the record,run_injected(env=),TestMountNormalisationoutput parent);test_ext_collect.TestContaminationAllowed(retrain()). - Results.
test_ext_*.py304 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)
--specat 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 keepsoutput_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); fortrl_grpothe four area-1 inputs.HostConfig.input_rootsis None unlessGATEDTRAIN_EXT_INPUT_ROOTSis set, andlaunch.adapter_configfills the adapter's roots in ext-launch,--recheckandrecord_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;.venvandsite-packagesare 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'ssecretsmodule (lib/python3.<N>/secrets.pyand its__pycache__byte code) is exempt, because*secret*otherwise refuses the real area-1 interpreter<mm-root>/python; an application'ssecrets.pyelsewhere is still refused. Alternatives: skip a wholelib/python3.<N>standard library likesite-packages, or drop*secret*for.py/.pycfiles. - M1, EXT-81.
hostrefused always; another network needsext-launch --allow-networkand a reason; the record keepsallow_network(true only with the flag and a network other thannone); a record without it, or with a non-boolean, refuses.network_host_reasonstays in the request and record schema without effect (kept so old requests still parse). - M2, EXT-82.
--recheckre-reads<host_work>/gpu-log.md; a different running total exits 3 (EXT-GPU --recheck.gpu_used_h). The review's record (gpu_used_h3.12) would now fail: the host total is 3.22. - M3, EXT-83.
launch.argv_script: the first argv element afterargv[0]that is a container path in a read-only mount naming a regular file that resolves inside the mount; recorded asscript_path,script_sha256; argv without one is refused.record_problemsrecomputes it (ext-collect,--recheck), and the TRL adapter'sscript_problemscomparesenv-runtime.jsonscript_sha256with the record's;env-runtime.jsonjoinedcollect.READ_OUTPUTS(EXT-64 staleness). - L1, EXT-84.
--specrequired at ext-launch and--recheckwhen the registry row setsspec_binding(adapterbinds_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-launchandext-collectprintwarning: <VAR> overrides the host layout (...)per setGATEDTRAIN_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.jsonalone stale. Kill R1 and R5. - L5, EXT-88. Refused: tmpfs at
/, an empty argv string, env values with\n,\ror NUL (value not shown;\radded to the review's list), and a mount or tmpfs strictly inside a read-write mount's container path. - L6, EXT-89.
gatedtrain/cli.pyhas anif __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;ExtScenariowrites<root>/code/train_grpo.pyand passes its SHA-256 tobuild_stage_out(env-runtime.json);launch_recordmounts the code at/code(mounts[3], so collect tests appending a mount now namemounts[4]) and adds the four new fields.test_ext_launch:rootedwrites a stub for a moved.pyargv element,launch(spec=True)passes a bound spec (bound_spec); CASEShost network ...now expect...network;test_network_host_with_both_reasons_acceptedbecame..._refused.test_ext_review3:scenario_requestmounts the code,recheckandTestRecheck.recheckpass--spec,test_environment_override(no global input root).test_ext_review2.test_area1_readme_mounts_acceptedusesadapter_config;mounts[3]tomounts[4]intest_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), passesext-launch --specand--recheck. Spec: a minimal one written by_ext.write_bound_spec(fixture registration and item set) binding the real base<tierb-root>/tierb/base-modeland export<tierb-root>/tierb/export, since no area-1 spec exists yet. Record:script_path<mm-root>/area1-trl/train_grpo.py,script_sha256equal tosha256sumof the file,allow_networkfalse,gpu_used_h3.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 (recheckwithoutadapter_config) is equivalent and survives, becauserecord_problemsapplies the adapter's roots itself. - Open. (1) The stdlib
secretsexemption above. (2)network_host_reasonis 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_ENDPOINTand the probe'sPYTHONPATH=/outstay accepted (outside this round's findings; the second is harmless now that nothing is mounted inside/outexcept the output itself, but code in/outcan 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 andexport-gsm8kwritesensure_ascii=False; the real GSM8K export holds one such row (<tierb-root>/tierb/export/train/shard-00004.jsonlline 382,questionfield; also inexport/train.jsonl).ext-collectrefused every area-1 run witherror[EXT-CONTAMINATION] artifacts.train.uri: ... shard-00004.jsonl:382 does not parse.ledger._count_lines(file iteration) already counted 500 rows for that shard whilesplitlinessaw 502 lines. - Fix.
canonical.text_linessplits at\n,\r\nand\ronly (identical tosplitlinesfor these, including no trailing empty line). Used bycollect.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 readerslaunch.gpu_secondsandlaunch.first_start(gpu-guard.log),launch.gpu_step_assignmentsandgpu_step_log_problem(gpu-step.sh; bash ends lines at\nonly),launch.gpu_used_h(gpu-log.md),trl_grpo.framework_identity(env-freeze.txt) andfrom_nel._framework_version(YAML snapshot header; YAML 1.2 line breaks are\nand\ronly). Behaviour is unchanged except for the separator characters. Not changed:ledger._count_lines(already\n-based) andgates.load_paired_records, a copy of NeMo Evaluator's reader (comparison.py:364 at ea35ba3) that keeps upstream'ssplitlines; NeMo Evaluator writesresults.jsonlwith default (ASCII)json.dumps, so it holds no raw separator; andstubs/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_overlap0) and, with a leaked row beside them, a refusal namingregistration.contamination.allow_exact_overlap(notartifacts.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 (thetest_ext_*.pyset is 374; it ran 375 OK alone before the stub-task test was dropped). - Real export (CPU, read-only).
export/train, 15 shards:shard_table7,473 rows, 7,473 parsed, equal toexport/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_overlaponquestion(the evaluator'spayload_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_argvreplacesargv_script: argv[0] is the interpreter and argv[1] the script, nothing between them; argv[1] starting with-refuses (-c,-m,-,-u). Both resolve withlaunch.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.12resolves 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 namedpython,python3orpython3.<N>(a choice: later areas that runtorchrunor a shell entry point extendINTERPRETER_RE); the script ends in.py. New record keysinterpreter_path(the resolved container path; area 1:.../cpython-3.12.16-linux-x86_64-gnu/bin/python3.12) andinterpreter_sha256(SHA-256 of that host file, 31 MB, about 0.05 s; equal tosha256sum);script_pathstays argv[1] as written.--recheckand 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.jsonis 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) replacesRESERVED_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_namesNone allows nothing;adapter_confignow fills input roots, env names, scan skip and interpreter trees independently, so theGATEDTRAIN_EXT_INPUT_ROOTSoverride 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; registryscan_skip(exact paths) skips<area1-trl>/.venvand<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 namedcredentials); 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 vendoredsite-packages/pip/_vendor/certifi/cacert.pem, hence the interpreter'ssite-packagesskip rather than acacert.pemexemption. The stdlib exemption needstop == <tree>/lib/python3.<N>(or its__pycache__) with<tree>in registryinterpreter_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_filenow 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_VERSION2.0.record_problemsreturns one...schema_versionproblem for any other version ("predates the current launch rules ... never upgraded"), and--recheckstops 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_h0.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 realfull-1.request.yamlpasses 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.rootedmoves host paths only (container paths and argv stay/data/...; under the test root they lay inside the/tmptmpfs and EXT-94 refused them) and creates the interpreter stub;_ext.launch_recordandExtScenariorun/code/bin/python3(a stub), schema 2.0, nonetwork_host_reason;test_ext_review2.unit_configcarries the TRL allow-list; round-3/4 tests that expectedKEYBOARD,PYTHONPATH,CUDA_VISIBLE_DEVICESaccepted,.venv/site-packagesskipped, the stdlib exemption anywhere,FOOas 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.yamldropsnetwork_host_reason;launch-command.golden.txtis unchanged. - Mutants (scratch copy,
PYTHONPATHchecked bygatedtrain.__file__;test_ext_review5.pyfirst, survivors against everytest_ext_*.py): 20, all killed. M1 interpreter not resolved through read-only mounts, M2 interpreter name, M3.pysuffix, 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 withoutlib(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 (--rechecknot 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 stalegpu_used_h, and both are killed. - Real full-1 request.
records/area1-trl/full-1.request.yamlwith onlyoutput_dirand 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 retirednetwork_host_reason: nullaccepted),--recheckok; record schema 2.0, 30 keys,interpreter_path.../cpython-3.12.16-linux-x86_64-gnu/bin/python3.12,interpreter_sha256equal tosha256sumof it,script_sha256unchanged from the real full-1 record. The printed argv is the request's, unchanged.--recheckof the realfull-1.launch.jsonrefuses 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_*.py412 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>/whosecut.json(written last) lists exactly the six other files with matching SHA-256 anditerationI, and whosemodel.zippolicy.pthmember (read withzipfile, bytes only) is the cut'spolicy.pth;.partialdirectories are never cuts.model_hash:policy.pth,policy_meta.json,vecnormalize.pkl,vecnormalize.json,env_version.json;cut_hashaddsmodel.zipandcut.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'scut.json,first_iteration= base iteration + 1, the base cut inside a base-phase run (base_checkpoint: null). The lineage's training stageusedthe base cut's cut and model hashes; the baseline arm must evaluate that model hash. - Consumption, observed.
rollouts.jsonlmust coverfirst_iteration.. the last cut, one line each, chunk =n_steps × n_envsenv 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_inputsnull as 05 §12.2 fixes foriterationrecords (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_filethrough the read-only mounts,env_params_sha256,env_version_sha256againsteval_distribution.env_version,env_params_version(EXT-103). Arms:normalizer_sha256of the evaluated cut,env_version_sha256registered (EXT-109). Sampler: the evaluator'ssampler_keys(EXT-106). - CPU accounting (EXT-105).
gpus: falseallowsgpu_est_h >= 0and a smoke projection>= 0; ext-collect logs 0 GPU-seconds and the wrapper time aswall_seconds(lockfile and report, every adapter; area 1'sgpu_secondsunchanged).gpus: trueunchanged. The smoke of a multi-evaluator adapter is judged on its first, deciding evaluator (was: refused). - Own output as input (EXT-104). The
sb3_ppoinput roots includeout/area2-dronesunder 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 verifiescheckpoint.model_hash,item_set_hash,sampler_hashof 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.pyandeval_hover.pyin the area venv: base phase full (cuts 4, 8),ext-launchfor both phases (records only; the continuation with--profile full --smoke-record --specand--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/tmptmpfs 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 fullfor 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_DIRSplus/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 strictrealpath(the printed command mounts the latter). Checked in request and record mode, so--recheckand ext-collect refuse too. The reviewer's/etc/ld.so.preload,/opt/nvidia/nvidia_entrypoint.shand/usr/lib/python3mounts refuse on both adapters; on the real full-1 request the/etc/ld.so.preloadprobe 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 aninterpreter_treesentry. 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, SB3HOME,XDG_CACHE_HOME): absolute, normal form at or under/tmpor/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/tmptmpfs). NewGATEDTRAIN_EXT_MIRROR_ROOT(the host directory that stands for/in an identity mount),GATEDTRAIN_EXT_INTERPRETERandGATEDTRAIN_EXT_INTERPRETER_TREES. Like everyGATEDTRAIN_EXT_*variable they warn on stderr. Maintainers' follow-up (Q1, EXT-117): they are part ofhost_config_sha256with the effective interpreter and trees, so a record written under one value refuses at--recheckand 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
chunkandseed_inputs.seedforiterationrows, contradicting 05 §12.2; it now says they are null (withdata_ref.row,sample_id,rewards) and that chunk ranges and per-episode data stay in the runtime'srollouts.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.shcounts 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.pyfirst, survivors against everytest_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) bytest_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_filereturns the mount's strictrealpathplus 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--recheckis ok; area-2 base (--profile smoke, argv--phase base --profile full) and continuation smoke (with a fake base cut in a scratch directory standing forout/area2-drones/base-1/checkpoint-8, which does not exist yet, andGATEDTRAIN_EXT_INPUT_ROOTSnaming the scratch output root'sarea2-dronesinstead of the real one) pass with--recheckok.
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>/whosecut.json(written last) hasepochE, positiveglobal_stepandsamples_consumed,deployable= the four components, and lists exactly the five other files with matching SHA-256, with a whole LoRA safetensors file;.partialdirectories are never cuts.find_cutsreports the cut'sglobal_stepaslast_step_included(the ledger'sstepis 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 overcut.jsondeployable; lineage adds onelora_composeactivity per cut. The base manifest is walked once per adapter instance (2.1 GB on the real base). - Bindings. Base (EXT-121):
run_args.jsonbase_modelresolves through the read-only mounts to the spec's base,base_ref.verifiedtrue, every cut'sbase_ref.jsona 40-hex revision withfilesequal to the spec base's file hashes and equal torun_args.jsonbase_ref,adapter_config.jsonnaming the same repo and revision. Data (EXT-122): one prompt shard,train_filethrough the mounts,train_file_sha256. Seed, profile, script and sampler code of run_args, env-runtime.json and every cut (EXT-125); each cut'ssampler.jsonis the registered sampler (EXT-SAMPLER). - Consumption, observed,
row(EXT-123).samples.jsonljoined withtrain_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'sglobal_stepandsamples_consumedequal to the log. One record per (sample, applying step):data_ref.row= sha256(prompt_id),seed_inputs.seed,rewards[reward],sampler_config_hash.sample_idhashes NUL-joined text: the 63-bit noise seed exceeds RFC 8785's safe integers, so canonical JSON would raise. The impact query answersconsumedatrow. - 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_ppoignores it). - Construct alignment (R15-1, EXT-127, EXT-128). The WebP row declares
construct_aligned{reward, statement}; a registration gating on it must carryconstruct_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 verifiescheckpoint.base_model_hashand lets the composed model hash be computed.eval_images.pywritessampler_hashas compact sorted JSON; with the sampler's floats (eta: 1.0,guidance_scale: 5.0, ...) it differs from RFC 8785 (sha256:2516f605...againstsha256:2ff98254...), unlike area 2's integer-only sampler. fill converts a value equal to that encoding of the arm's own sampler (printedconverted) and still refuses any other value.- README and code compared (code followed): (1) components: the README lists three plus
base_ref.jsonas "the reference";train_ddpo.pyDEPLOYABLEandcut.jsondeployableincludebase_ref.json, which MM-17 also counts. (2)item_payload: the README proposesclass_index, an integer initems.jsonl; gatedtrain payload fields are strings, soprompt,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 hash4a99afa6...is the file hash ofitems.jsonl; the registereditem_set_hashis the manifest ofitems/(withitem_set_meta.json),sha256:0a4af3f9.... (5) README item 6'ssample_idcannot be canonical JSON (the seed, above). (6)train_steps.jsonllines also carryutc(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, 4rowrecords, framework diffusers 0.42.1, script binding ok, every adapter check empty with identity mounts, overlap 0 of 150 against 248 prompts, base manifestsha256:1d99f8b6..., the cut's composed model hashsha256:bd27f904....ext-arm-fillon copies of the real base and cut arms: filled,converted sampler_hash; without--basethe cut arm refuses; theprompt_violationarm 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 keysconstraint_set_hash,model_manifest_hashare 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 = SigLIPmodel.safetensors), MM-C3 keys accepted byarm.read_metaandfillfor 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 fulltake 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
ValueErrorand exited 1 (EXIT_NOT_PASS). It now recordsEXT-BASE artifacts.<base>.uriand the collect refuses with exit 3. - M2 (EXT-132). The consumption check re-derives every derived field of
samples.jsonlastrain_ddpo.pydoes (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_kbexactly,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) andjson.dumpswrites both withrepr, which round-trips. The three real cpu-sanity runs pass. - L1 (EXT-133).
eval_images.pyunchanged. Assumption, documented here and in the EVAL-PLAN draft: every evaluation uses the default base<area3-sd15>/models/stable-diffusion-v1-5inside the read-only identity mount, because the evaluator neither hashes nor records the base it loads andext-arm-fill --basestates the base without observing it. Enforced cheaply at launch: adapterargv_problems, called byext-launchand--recheckfor any adapter that declares it, refuses aneval_images.pyargv 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 itsfiles_sha256inenv-runtime.json, and let fill compare them with--base. - L2.
full.request.yamlargv now ends- '<EPOCHS>', so24stays a string. - L3 (EXT-134). (a)
construct_alignmentis 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 asstatementand the registry row's asmanifest_statement; the text prints the registration's and addsconstruct_alignment_manifest:only when they differ. - L4 (EXT-135).
identityof 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_epochs2 (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 onsamplerandsampler_hash), and for the conversion on ansb3_ppoarm. - 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 covertierorconstruct_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>/whosecut.json(written last) hasglobal_stepS, positiveexamples_consumed,deployable= the seven components and lists exactly the nine other files, each plain with matching SHA-256, with a wholemodel.safetensors;.partialandhf-trainer/are never cuts. Full weights: a cut's model hash is the manifest hash of its deployable files (the deployment decoderdecoding.jsonincluded); the base's is the manifest hash of its 11 files; nolora_compose. - Bindings. Base (EXT-141):
model_name_or_path=base_modelthrough the read-only mounts to the spec's base,base_ref.verifiedtrue, each cut'sbase_ref.jsona 40-hex revision withfilesequal to the spec base's hashes,files_sha256recomputed, (repo, revision, files_sha256) equal torun_args.json. Data (EXT-142): one shard,train_file,train_file_sha256,n_trainrecomputed. Run (EXT-145): seed (andsettings.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_sha256equal across cuts, env-runtime.json and run_args.json and equal to the evaluator's pinnedSHARED DECODERhash (sha256:478dd30e...);decoding.json=run_args.jsondecoding,decoding_sha256recomputed; each cut's decoder = the registered sampler withoutbatch_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'ssamples.jsonllines = itsexample_idsin order withmicro_batch0,position,row= sha256(utt_id),attempt; each cut'sexamples_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 nullrewards,seed_inputs,sampler_config_hash(supervised);sample_idhashes 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 newshared_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 singledisclosures:map in the registration would be simpler to extend but would rename area 3's field; not chosen. The WER row declaresshared_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 --baseother than its default refuses (as EXT-133);train_whisper.py --no-verify-baseand a--profileother than smoke or full refuse. Options are resolved as argparse does, unique prefixes included (--no-verify,--prof). Area 3'sargv_problemscompares exact spellings; there every abbreviation of--baseis 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, asddpo_sd15). (2)score_outcomes: the README proposes("empty_transcript", "hallucination"); the code marksemptyandtruncated(the per-utterance token bound), so the row saysempty_transcript,truncated_transcript. (3) Sampler hash: the README sayseval_asr.pywrites 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 hash94d0bea4...is the file hash ofitems.jsonl; the registereditem_set_hashis the manifest ofitems/(withitem_set_meta.jsonandaudio/),sha256:38b26785.... (5) The README does not say thatsamples.jsonl/train_steps.jsonlepochs count from 0 (counters["epoch"]starts at -1,on_epoch_beginincrements); the sanity log confirms 0. (6)run_args.jsonalso carriessettings.seedandsettings.max_steps(checked equal toseedandmax_steps) anddecoding_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.pyrecords the resolvedmodel_dirin itsenv-runtime.jsonbut no hash, so the base binding of a--base-onlyarm is still the launch-side argv rule (EXT-150); fill does not readenv-runtime.json. (9)eval_asr.py check_cutcompares the cut'sbase_ref.jsonrevision and files withMODELS.jsonbut notrepo(harmless: files decide). - Real directories (read only). Base
models/whisper-base.en: a model directory, manifestsha256:583e09fe..., file hashes equal toMODELS.json; data manifestsha256:d5080d22...; items manifestsha256:38b26785...(500 items passread_item_set); exacttextoverlap 0; evaluator identitysha256:d18c705e.... Request drafts (five) passext-launchand--recheckwith 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_alignedorshared_annotation(review 7 L3 c, unchanged). (2)shared_annotationis declared on the evaluator row, so any trainer gating onasr.whisper_items@0.1must state it, also one that did not train on AMI labels; acceptable while the row is area-specific. (3) The training--seedis not compared withtraining_seedat 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 ineval_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_ppomodel_dir_problem) turn anOSErrorinto "cannot be read", so the cut is incomplete (a last cut refuses EXT-STAGE, a middle one is listed inincomplete_cuts). The data hash inchecksgoes through_sha_or_none(an unreadable shard givesEXT-DATA; collect already refusesSPEC-REFfrom the data manifest). collect catches(OSError, ValueError)aroundframework_identity(EXT-FREEZE, every adapter), an unlistable stage directory (EXT-STAGE), and anOSErrorfrom any adapter'sscript_problems,checks,consumption_problemsandsampler_problems(_guarded);stale_outputsusesos.path.lexists(on Python 3.13Path.existsraisedPermissionErrorin an unsearchable directory).ext-arm-fillrefuses an unreadable normalizer or environment version. Sweep:trl_grpoalready 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 withOSErrorwere already a refusal (EXT-WRITE, the directory removed). - L1 (EXT-155 to EXT-157). (1) collect asks the adapter for
arm_problems:hf_seq2seqchecks every referencedoutputs/<item>.jsonnames its item and the registeredreference_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.pywrites 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-identicaleval_asr.pycopy in another input root, with its own base and items, now refuses);--baseand--itemsabsent or the defaults;--limitrefused under--profile full(the hook receives the launch profile,--recheckthe 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, andgates.evaluate_itemsalready does so (the review'sgates.py:27-28is 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_seq2seqrefuses a step log whose length is notmax_steps(reported after the cut checks, so a short log still names the cut beyond it);ddpo_sd15refuses steps or samples of an epoch aftersettings.epochs. - L3 (EXT-159). (a) Area 3's messages restored word for word (per-entry
missing,undeclaredtexts inDISCLOSURES); the earlier claim that they were unchanged was wrong for one message. (b)OPTIONAL_KEYSderives the disclosure fields fromDISCLOSURES. (c) Formatting fixed. (d)registry.disclosure_problemsruns 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'scheckpoint-60at/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 passext-launchand--recheckwith 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 allis 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 usenn.DataParalleland 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 ofDdpoSd15Adapter: the run layout is area 3's (cutscheckpoint-<E>/withcut.jsonlast, four deployable components, composed LoRA model hash,lora_composelineage, exact overlap over the shard andsamples.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 withsamples_filtered, booleanemaandglobal_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_entriesgainedexclude=(top-level names, default none); the adapter declaresbase_excludes = (".cache",)and walks the base once per instance (area 3's cache).ext/collect.pyuses an adapter'sbase_excludesfor the base manifest and skips its.cacherefusal only when.cacheis excluded; the other adapters still refuse a base.cache/. A.cachebelow the top level is hashed. The*.fp16.*duplicates are hashed. Read-only check on the real base:base_dir_problemnone, the 37 files outside.cache/are exactlyMODELS.json's (the 27 GB were not re-hashed here). - Filtered outcomes (MM-28, 05 §12.3). The ledger schema already has
outcome,reasonand a nullablestep; the impact query readsoutcome = 'consumed'only. A filtered sample is one record: outcomefiltered, reasonzero_advantage,stepnull,sample_idwithfilteredin the step's place (choice),rewardsandseed_inputsset. 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 includingsamples_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_accexactly forsettings.rewardocr. 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_sha256recomputed, 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.rewardocr,n_train_prompts. - Launch.
HF_TOKENis refused by the generic credential rule and is outside the allow-list;DOCTR_CACHE_DIRis allowed and path-valued (under/tmpor/out). argv: area 3/4 rules plus--emarefused. The credential file-name scan of the realarea5-sd35directory (with the.venvskipped) 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.jsonllines have nostepsfield (area 3 had one); the step range is inepoch_plan.jsonl. (2) README item 9 proposes consumption fallbackstage; none here. (3)samples_consumedcounts the kept samples once per epoch (train_flow_grpo.py:577), not per applying step. (4) Spec row 2b'scheckpoint-<step>/lora/and T5 embedding manifest do not apply (updated in MULTIMODAL-SPEC). (5)item_payloaddropssource_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_accwhen the engine scored,nonfinite), the target and texts stay inscores.jsonl, the SHARED SAMPLER block unchanged (83133e24...); new SHA-256c100a8fb887f93eedbed37b573198cf3bec01508769ebcea7c5ca5a88d8d3b67in 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) passesext-arm-fillon a copy against the real base (base model hashsha256:a19e90d6...without.cache/, cut model hashsha256:4181b651..., item setsha256:0b01553c..., sampler hash converted) and collect's arm checks. (2)lora_composeactivity 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 hookitem_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
filteredorreincludedsample must have its group's mean reward, computed exactly withfractionsand 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 relabelledfiltered(probe P1) orreincluded(P5);settings.global_stdmust 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 statedtargetrefuses, 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_sd15andhf_seq2seq(P3 crashed with exit 1 in pyarrow);sb3_ppoalready checked,trl_grpoandledger.pyhave no such JSON comparison. (L4)manifest_entriesraises for an excluded name that is a symbolic link or a file, so collect refusesEXT-BASE(P7.cache -> /etcwas 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_accnow scores docTR's text by approximate-substring edit distance (eval_images.pyocr_substring_accuracy, Sellers DP, placed outside the shared sampler block, which still hashes to83133e24...); the reward andocr_a_acckeep flow_grpo's formula. Neweval_images.pysha256:fdad8eb9b8de45a0c002a62469fb043fdeaf1c38b9449d41fd5a430e9adee8adin both registry rows; the B scorer version and theconstruct_alignedstatement (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 passedext-arm-fillagainst the real base and collect's arm checks. An empty normalized target raises inside the evaluator and becomesscorer_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_checkpointin run_args and every cut'sbase_ref.json). Cuts arecuts/checkpoint-<N>/withcut.jsonlast; NeMo RL'snemo/checkpoints/step_Nnever count. Full weights, no composition. The registry row lists both ids; collect accepts an adapter'strainer_idsand passes the spec'susestochecks, which refuses a run whosestageis the other one. - Consumption, observed per row. SFT:
samples.jsonl⋈train_steps.jsonl, every field the wrappedprepare_sft_batchwrites 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_stepslines, calls and positions consecutive, statuses, reward bounds ofcad_protocol.reward,program_sha256null exactly forno_code) joined in order with NeMo RL'strain_data_step<N>.jsonlrewards. NeMo RL logs the float32 tensor value (cad_env.pyreturnstorch.float32), so the join compares the env reward rounded to float32; oneexp_<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 automaticiterationfallback (choice; the README proposed one after a failed smoke join). - Bindings.
base_ref.jsonmust 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 ofrun_args.jsonbase_model; GRPO'sinit_checkpointpath is/inputs/sft-cutmounted onto the spec's base (an SFT cut), with itscut.jsonSHA-256 and global step. The training file isdata/<stage>/train.jsonlbeside the spec's shards, its hash recorded, and the shards' concatenation.hooks_sha256,env_sha256andprotocol_sha256must be the files beside the launched script (the record bindsrun_cad_nemo.pyonly; 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). Cutsampler.json= the registered sampler withoutbackendandprompt_block_sha256; the registered prompt block is the SHARED PROMPT the data was built with. - Overlap (README item 7). Item
textagainst both training sets of the chain (the generic check covers the spec's set only); a training row whosetext(the overlap key) is not itsinput(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'senv-runtime.jsonbeside the arm names the registereditems.jsonl(the scorer's--itemsis otherwise unhashed), the pinned executor lock and the arm's scorer code.gen_meta.jsonmodel_filescannot 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 entershost_config_sha256for 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, tmpfsnoexec,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
sidecarfor an adapter whose row declares one; the adapter decides which launch needs it (the GRPO trainer only). It must be exactly whatexecutor/run-executor.sh serveprints: 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.pybinds the socket with umask 077), read-only root, cap-drop ALL, no-new-privileges, no GPU, tmpfs/tmpnoexec, 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'sdocker --context gatedtrain run -d --name ..., the trainer's gpu-step.sh command, anddocker --context gatedtrain stop <name>; the record keeps the sidecar (names only, lock and file hashes), which the label hash covers and--recheckand 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>/spoolinside 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. outputout/area6-cad/grpo-smoke-1/train, spoolout/area6-cad/grpo-smoke-1/spool(thenrun-executor.sh serve out/area6-cad/grpo-smoke-1prints the matching-v), trainer--socket /spool/cadexec.sock. - Unverified (the GPU smokes must show them). (1) SFT: NeMo RL with
data.shuffle=falseand drop_last batches rows in file order;batch["idx"]is the train.jsonl line;prepare_sft_batchruns once per step beforepolicy.train. (2) GRPO: the env sees the step's 128 samples, andtrain_data_step<N>.jsonlliststotal_rewardin the same order (data-plane path,data_plane.enabled=true); rewards are not rescaled (reward_scaling,reward_shapingdisabled in grpo_math_1B.yaml); each step uses the 16 rows of the epoch in file order; logs go tonemo/logs/exp_001. (3) Cut layout: one consolidated safetensors file underpolicy/weights/model/consolidated/, tokenizer file names underpolicy/tokenizer/,training_info.jsonpresent, thepublishwrapper called. (4)/opt/nemo-rl/.git/HEADreadable 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 Noneand collect refuses). (5) The image's interpreters:/opt/nemo_rl_venv/bin/python(Dockerfile:227, :621;uv run pythonuses it) and the vLLM worker venv'sbin/pythonwithtransformersforgen_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 fallbackhostis refused by EXT-81, decision below). (8)--shm-size=16gand 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(sha256cffdd9ea5144c66a7d35ae9af86f05d89e8797ea490396390f031a4523bf9339, recomputed here; composite scorersha256:d1a95eb50ac9d694a2f80ffdebd9185b14861f3c74110763f6c26739f8edcabarecomputed from the four files, now the registry pin): numericsub_metricswithstatus_codeandtruncated, keys left out when absent,framework{name, version},arm-validundercad.cadquery_valid_items@0.1,gen_meta.jsoncopied into the scoring output. The adapter checksstatus_code(range,executes, the score, the output's status) andgen_meta.json(EXT-197: hash in env-runtime.json, items, prompt block, sampler, framework, andmodel_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, afterext-arm-fillagainst 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, nohostexception (a Ray failure on loopback at the smoke goes to the maintainers); trainer and sidecar run as 1000:1000; no automaticiterationfallback, the shard concatenation,framework.version= commit, the sibling spool layoutout/area6-cad/<run>/train+.../spooland the string-onlyitem_payloadare accepted. - Review 11 fixes (EXT-198). (H1) ext-collect now binds the launch record to the outputs:
--stage,--seed, GRPO--init/--socketand the presence ofsidecarmust matchrun_args.json, an SFT output may hold no environment or GRPO step log, and collect re-runs the adapter'sargv_problemson the record (generic; areas 3 to 5 records pass). (M2)bind_argv's image-interpreter branch guards non-list mounts. (L1) a non-stringdeployableentry is incompleteness in all four cut.json adapters. (L2) the spool must bespool/beside the trainer's output and must not overlap another trainer mount. (L3)--seed=training_seedat launch. (L4) asidecarkey, 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 stepcad_sandbox.py --run-batch); scoring reads the references and runs no generated code. Hashes recomputed here:score_cad.pyf8d5486c...(then60498f9b..., below),executor/cad_sandbox.py05c4d8d2...,executor/cad_protocol.py0f9d801d...(moved, unchanged), composite scorersha256:343647f2...(superseded below). ext-launch enforces each script's exact mount set, the executor scripts'-Iand their three environment names, and prints the execution, scoring and sidecar commands token for token asrun-executor.shdoes (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.pynowsha256:60498f9b2f6467d0ce751d2d77b20acc1ac92b6d6eaed1b97d8575c01102ca26, composite scorersha256: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 ofFlowGrpoSd35Adapter. 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, thevideo_ocrsample fields (frame_ocrfor 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), theall_zero_advantageepochs (all samples kept, none filtered), theflow-grpo-wansample-id domain, the pinned SHARED SAMPLER block (dad91e41...), run and cut schemas and the Wan LoRA targets. usesid. The decision namedrl.flow_grpo@0.1for 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 usesrl.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 addslaunch_problems: area 5's runtime image and lock pinned, network none, GPU, the exact mount set (Python directory,area5-sd35,area3-videoread-only at their own paths,/out, plus/inputs/cutfor 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_EPOCHS40 /save_every10 (the script now says 60 / 15; script hashad8db67d..., not today'sda064300...); the smoke profile is the same. The base evaluation's arms carryeval_videos.pyde9c2e89...(= today's file) and are the registry's scorers. - Open. (1) Collect copies only an arm line's
output_reffile (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.TestRuntimeFactsreads the runtime scripts withastand 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.pyprintedGATEDTRAIN_GPU_CAP_H=24to gpu-step.sh andext/smoke.pyjudgedbudgetagainst 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.mdand 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 failedbudget. 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.pywould have made attempt 1's run uncollectable. The amendment's trainer is a copy,train_flow_grpo_wan_v2.py, differing only inPROFILES(smoke2,full2) andDEFAULT_PROMPTS(prompts-short);eval_videos.pyis 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.jsonitems_sha256must 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'samplestext ("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 withamends(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'scuts/checkpoint-<step>/(hard links to LeRobot'scheckpoints/<step>/,cut.jsonlast, 17 listed files); the model hash covers the ten deployable files;normalizer_sha256follows 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 realsamples.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'ssamples_consumedis 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'sinit_checkpoint,config.jsonpretrained_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 (draftexport_frames.pyhanded to the recipe maintainers; the test helper_lerobot.write_frame_exportis the same rule). - Arms.
eval_libero.pywritesenv_version.jsoninto each arm, not into a cut, soext-arm-fillgained 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.jsonitems_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_noteshook in collect), as the decision asks. --specbinds training launches only (found at the gate's candidate arm).mount_binding_problemsapplied 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_problemsnow passes the launch's argv to an adapter that setsspec_binding_argv(opt-in; other adapters unchanged), and this adapter binds onlytrain_lerobot_logged.pylaunches (at--requestand--recheck). Tests: the direct hook call, andext-launch --specplus--recheckof a candidate-arm request; the end-to-end test fails on the previouslaunch.pywith 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_CAPABILITIESis 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 withnemo_rl_ext). LoRA cuts (<runtime>.agentic_cut, kindlora_adapter, r 32 / alpha 64, the 196 decoder projections inadapter_config.json, neverlm_head); the model hash composes the base's manifest hash with thedeployablefiles (MM-18),ext-arm-fillneeds--basefor 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'sconsumption.buildfield by field (model tokens 191,757 =training_info.jsontotal_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'senvsmaps an environment to its deciding evaluator, which names it back (env_idon the evaluator row), and ext-collect refuses a run of another environment than the gate evaluator's (EXT-ENV, through the new opt-inwants_evaluatorhook of collect). The adapter's environment table holds what each environment's log may show; NeMo RL'ssliding_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-codesENV_ID = "math_code"(no--envoption); a second real environment needs its registration inrun_agentic_nemo.pyand 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 sidecarinterpreter_sha256null, the script re-hashed at--recheckand collect). Both the trainer andgen_agentic.pypair it; the scorer does not. Area 6's row is unchanged (a test keeps itsvenv_in_containerrule). - Scorer pin needs a one-line area change.
score_agentic.py(a3bc32c8) writes"env_id": "math_code"intoeval_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.stepverifies every terminal turn whose text has\boxed, so amax_turnsend 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-stepsunder the full profile is allowed in 60 .. 100 (decision "60-100 steps"), unlike the other NeMo RL adapters. (5) The area'sconsumption.pywraps 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-hub0.2.0 is renamedgatedtrain0.3.0: package, CLI, entry point groupgatedtrain.adapters, schema ids,ANALYSIS_CODE_VERSION, ledgerwriter_id, everyPTC_*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-skeltoptc-hub: a registration withanalysis_code_version: ptc-hub 0.2.0(orptc-skel 0.1.0) is refused with the amendment fix, and a version-only amendment togatedtrain 0.3.0is not post hoc (05 section 3.7, R17-1); records withptc_hub.*orptc_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
gatedtrainones. 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 theGATEDTRAIN_EXT_*overrides too, and enterhost_config_sha256only 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/runstays 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) andGATEDTRAIN_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.lockregenerated without upgrades under the restored[tool.uv] environments(macOS only); the sdist holds the package,LICENSE,NOTICE,THIRD_PARTY_NOTICES.mdandREADME.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-launchandext-collectcrashed on 3.12 where they must refuse.os.path.realpathwithoutstrictraisesPermissionErroron 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 oftest_ext_review2on 3.12). No mount was ever accepted.Path.resolve()(not strict) has the same problem, in the SDK'sbound_mountsand the diffusers family's mount checks among others.gatedtrain.pathsnow holdsrealpathandresolve, Python 3.13's lenientrealpathported line for line, and every lenient resolution of a path from a request, a launch record or a run output (ext/andfamilies/) uses them; paths the user names on the command line keepPath.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/proccases 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_refresolved by path).arm._output_ref_problemchecked that the lenientrealpathof<arm>/<path>lay inside the arm, then hashed and copied by path. Where the lexical resolution exceedsPATH_MAXthe lenientrealpathkeeps the rest of the path unresolved, so a link chain (aanda/beach a 2.5 KB relative chain,b/leaka 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, andext-collectcopied it into the run. An absent path longer thanPATH_MAXraisedOSError(ENAMETOOLONG) out of the check (S5). Maintainers' decision (2026-11-19): anoutput_refpath contains no symbolic link at all (hard links are allowed; MULTIMODAL-SPEC MM-1).arm.open_output_refopens the arm directory, then each component under the previous descriptor withO_NOFOLLOW(O_DIRECTORYfor directories,O_NONBLOCKfor the file, which must be regular byfstat) 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) anddiffers from its sha256are unchanged. - Copy after the check.
ext-collect(both copy sites) andext-merge-evalcopiedoutput_reffiles withshutil.copyfileby path after the checks, so a file swapped in between was copied.arm.copy_output_refcopies 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_linesandprovenance_problemsusedPath.is_file()andPath.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()raisesRuntimeErrorfor a symbolic link loop on Python 3.12. The spec'sfile:URIs and the spec path (spec.py), the manifestroot(canonical.manifest_document) andwarmup --out(cli.py) now resolve withgatedtrain.paths, so a loop is a refusal; this replaces "paths the user names on the command line keepPath.resolve()" of the previous section. - S4 (duplicate arms). With several clauses,
ext-collecttold arms apart by their resolved path string, which differs for one directory reached by two paths when resolution stops early (a path pastPATH_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_treejudged the interpreter's host file by the lenientrealpath, so a loop, a missing file or an unreadable link below a tree's lexical path counted as inside it. It now uses the strictrealpath, 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 throughsudo -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.ymlruns the suite as the runner user. - T1, T2 (
test_pathsoracle). 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 onlyFileNotFoundErrorandPermissionError(ENOTDIR) survived.test_fixed_valuespins values that 3.12 and 3.13 both give (loop1/x,loop1/../a,a/f/x,a/f/.., ...), and aSIGALRMwatchdog fails a test that does not end in 30 s. The review's mutants (edits ofpaths.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 onlyFileNotFoundErrorandPermissionError(ENOTDIR below a regular file raises). - T3. A loop as an
output_refcomponent is a case oftest_path_review(refused as a symbolic link). - T4. A loop and an unreadable link (
/proc/1/root) at the launch record'soutput_diragainst--stage-out, the SDK'sbound_mountsand the diffusers family's mount checks give a mismatch or no binding, never a traceback. - T5.
test_paths.test_unreadable_link_is_keptskips where/proc/1/rootis 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-collectcopieditems.jsonl,eval_meta.jsonandmerge.jsoninto 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'sitems.jsonlcould differ from the records gated. New moduleext/armfs.py:ArmSnapshot.readopens 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_problemsand the EXT-52 re-derivation parse those bytes, andext-collectwrites them into the run. - PR2-A2.
provenance_problemshashed any host path named inmerge.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 newext-collect --sources-root; MULTIMODAL-SPEC MM-5), are reached from the root's descriptor without following links and read as arm files; a mismatch saysdiffers from the recorded hash, and a source outside the root is refused (provenance cannot be checked).ext-merge-evalandext-from-nelrecordos.path.abspathof a source (normal form). - PR2-A3.
read_metafollowed 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(intermediatesO_PATH | O_DIRECTORY | O_NOFOLLOW); only a regular file is reopened for reading (/proc/self/fd,O_NOCTTY) and must be the same inode. WithoutO_PATH(macOS):fstatatwithout following, thenO_NOFOLLOW | O_NONBLOCK | O_NOCTTY. - PR2-A5.
ext-merge-evaltold outputs apart by the raw path string (outputs/x.txtandoutputs/./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)), andmerge.jsonrecords the hashes of the bytes merged. - PR2-A6. A NUL or a lone surrogate in an output path raised
ValueErrororUnicodeEncodeError; nowcontains a NUL characteroris not valid UTF-8. - PR2-B1. An intermediate directory with mode 0o111 (search only) was refused (EACCES);
O_PATHwalks it on Linux. WithoutO_PATH(macOS) it is still refused, and a file swapped for a FIFO or device between the type check andopenis opened without blocking before the identity check refuses it (armfsdocstring). - 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 anEXT-ARMrefusal 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 thanPATH_MAX,armandlnkto one arm) that a resolved path string misses, and both collect copy sites have swap tests; mutants keying arms bypaths.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 underGATEDTRAIN_REQUIRE_CONTAINER_USER=1, which CI sets (and printsid), 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-nelread each NeMo Evaluator run by path:full_config.yamlfour times andresults.jsonltwice, following links (an outside file's hash went intomerge.json) and blocking on a FIFO, and a config swapped after the sampler and seed checks was the one hashed (and later passedext-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_samplertake the parsed config; Tier B is unchanged), the conversion and the recorded hashes use those bytes. - R2-C1. A relative
--sources-rootnever matched an absolute source path; the root is made absolute (CLI) andarmfs.under_roottakes it from the working directory. - R2-C2. A source recorded by the real path of a root that is a link was refused;
under_rootaccepts the root as given or by its real path. The refusal's fix names--sources-root. - R2-C3. The
armfsdocstring and PR2-B1 state what holds only on Linux. - R2-C4.
open_regularcloses the reopened descriptor whenfstatfails. - R2-C5. An invalid
nel_benchmarkand a source withoutrun_dirhave 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 leavesread_metaandread_linesunchanged, the arm directory replaced beforecopy_output_refis refused, the size cap with an explicit limit (read_fd(limit=None)readsMAX_FILE_BYTESwhen called), the provenance refusal tests assert their reason, and./eval_meta.jsonis 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
nullNeMo Evaluator config was read again by path.yaml.safe_loadgives None for an empty file,nullor~, whichtierb._run_seed_and_repeatsand_run_samplertake as "no config given" and readfull_config.yamlagain by path, following a link or blocking on a FIFO the container swapped in after the armfs read.ext-from-nelnow 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 aseltwise jit:avx2on 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 pinATEN_CPU_CAPABILITY=defaultandMKL_CBWR=COMPATIBLEbefore torch is imported (gatedtrain/stubs/__init__.py; an operator's own setting wins) and turn oneDNN off (model.configure_torch);runner.runimports the stand-ins before torch. The CI workflow prints the runner's CPU model and instruction sets.