Skip to content

spec(port): port specs/port/trios/crates/trios-trainer/src/bin/trios-train.t27 (Closes #7770) - #9995

Merged
gHashTag merged 1 commit into
gHashTag:masterfrom
dmitrii-f-t27:zcode-port-7770-trios-train
Oct 17, 2026
Merged

gHashTag merged 1 commit into
gHashTag:masterfrom
dmitrii-f-t27:zcode-port-7770-trios-train

Conversation

@dmitrii-f-t27

Copy link
Copy Markdown
Contributor

Summary

Port gHashTag/trios:crates/trios-trainer/src/bin/trios-train.rs (at 8b229e9e9489ee, 95 lines) as specs/port/trios/crates/trios-trainer/src/bin/trios-train.t27 — Roadmap Stage 6 (goal #4548), target t27c gen-rust. Closes #7770.

The original is the training CLI entry point: three flags with overrides, an INV-8 LR gate, a dry-run branch and a Gate-2 verdict.

Per the issue's rule ("Port the decision, not the plumbing"), the one listed function is ported under its name as a pure function (no transports — the clap parsing, the TOML load and the training run are the callers' plumbing) with 6 tests (34 runtime asserts, 0 vacuous, 100% function coverage):

  • the four-flag CLI shape: --config required, --seed and --steps optional overrides, --dry-run a switch (original lines 20-36);
  • the override rule: a present CLI value replaces the config's value, an absent flag leaves it (lines 48-56);
  • the INV-8 LR gate: the LR must sit in the phi band [0.001, 0.01], inclusive on both ends — the error message names the bounds (lines 59-61);
  • the dry-run shape: six printed fields (seed, steps, LR, d_model, n_layers, checkpoint interval), the run exiting before any training (lines 65-74);
  • the three-band Gate-2 verdict on the best BPB: below 1.50 the VICTORY CANDIDATE, below 1.85 the above-target evidence, else the below-target evidence (lines 87-93);
  • the flow order in main: the LR gate first, then the dry-run branch, then training (lines 38-95).

Verification (all run live from the worktree root, zig 0.16.0)

  • t27c parse: OK. t27c spec-status: IMPLEMENTED. t27c typecheck: 0 errors, 0 warnings.
  • t27c coverage: 14/14 tested (100%) — no transports in this port.
  • t27c test-report: 6 tests / 6 pass / 0 FAIL / 0 BLOCKED, 0 vacuous passes — the flag table, the override rule both ways, the LR band at and beyond both boundaries, the dry-run shape with its early exit, the Gate-2 bands at the exact thresholds, and the flow order.
  • t27c gen | grep -c 'not yet implemented': 0; gen | wc -l: 150 (> 12).
  • grep -cE '^\s*(pub )?fn (main)\(': 1. grep -cE '^\s*test\s+(["|[A-Za-z_])': 6 (≥ 1).
  • Boundary: git status --short — exactly this one file. The repo's lefthook pre-commit passed.
  • dupe_scan: all 13 introduced names unique across 2046 specs (checked before the commit); the bare body scan adds no duplicate group (722 bodies / 217 groups on base, identical with this spec present).

Dmitrii Fedorov (@dmitrii-f-t27)

…train.t27 (Closes gHashTag#7770)

Port gHashTag/trios:crates/trios-trainer/src/bin/trios-train.rs (at
8b229e9e9489ee, 95 lines) as specs/port/trios/crates/
trios-trainer/src/bin/trios-train.t27 - Roadmap Stage 6, goal
gHashTag#4548, target t27c gen-rust.

The trios-train CLI's decisions are ported as pure functions and
tested (6 tests, 6 pass, 0 vacuous, 34 runtime asserts, 100%
function coverage): the four-flag CLI shape (--config required,
--seed and --steps optional overrides, --dry-run), the override
rule (a present CLI value replaces the config's value, an absent
flag leaves it), the INV-8 LR gate with its phi band [0.001, 0.01]
inclusive on both ends, the dry-run shape (six printed fields, the
run exiting BEFORE any training), the three-band Gate-2 verdict on
the best BPB (below 1.50 the victory candidate, below 1.85 the
above-target evidence, else the below-target evidence), and the
flow order (the LR gate before the dry-run branch before training).
The clap parsing, the TOML load and the training run are the
callers' plumbing.

Verified: parse OK, spec-status IMPLEMENTED, typecheck 0 errors,
coverage 14/14, test-report 6/6 pass, 0 BLOCKED, gen 150 lines
with 0 'not yet implemented', boundary exactly this one file,
dupe_scan: all 13 introduced names unique across 2046 specs
(checked before the commit), bare body scan adds no duplicate
group (722/217 unchanged).

Dmitrii Fedorov ([@dmitrii-f-t27](https://github.com/dmitrii-f-t27))
@dmitrii-f-t27

Copy link
Copy Markdown
Contributor Author

@gHashTag Please merge this PR into master via the golden chain — my rights on gHashTag/t27 are read-only (403), so only you can merge it.

Verification of this head (f0217c9):

  • Required CI trio green: validate, check-linked-issue, parse-ratchet; also Check L1 TRACEABILITY and Corpus ratchet green, duplicate-bodies green.
  • The t27b-native-run artifact of this head (commit f0217c9, run 39046066604) row for specs/port/trios/crates/trios-trainer/src/bin/trios-train.t27: reference pass, t27b pass, tests 6, invariants 0, asserts 34, blockers [], detail empty, reference_disagree: [].
  • The only red checks are the known base-red pair (cli-tri ci: repair the two workflows whose failure was in the workflow #3324 include_str!, t27b-native-ratchet registration debt) — both red on master without this PR; no other check is red.

After the merge I will: verify the spec file live on the merge SHA, confirm #7770 auto-closed, and file the 14-step report.

Dmitrii Fedorov (@dmitrii-f-t27)

This was referenced Oct 17, 2026
@gHashTag
gHashTag merged commit 0a1066f into gHashTag:master Oct 17, 2026
27 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Port gHashTag/trios:crates/trios-trainer/src/bin/trios-train.rs (Rust, 1 function) to specs/port/trios/crates/trios-trainer/src/bin/trios-train.t27

2 participants