Skip to content

spec(port): port specs/port/trios/crates/trios-cli/src/cmd/race.t27 (Closes #9489) - #9622

Open
dmitrii-f-t27 wants to merge 1 commit into
gHashTag:masterfrom
dmitrii-f-t27:zcode-port-9489-cli-race
Open

dmitrii-f-t27 wants to merge 1 commit into
gHashTag:masterfrom
dmitrii-f-t27:zcode-port-9489-cli-race

Conversation

@dmitrii-f-t27

Copy link
Copy Markdown
Contributor

Summary

Port gHashTag/trios:crates/trios-cli/src/cmd/race.rs (at 8b229e9489ee, 279 lines) as specs/port/trios/crates/trios-cli/src/cmd/race.t27 — Roadmap Stage 6 (goal #4548), target t27c gen-rust. Closes #9489.

The original is the IGLA RACE CLI command: init creates the Optuna study in Neon and prints its SQL schema, status renders the live leaderboard with the ASHA rung ladder, report_trial logs a trial result back to the race.

Per the issue's rule ("Port the decision, not the plumbing"), the four listed functions are ported under their names — the three transports (init, status, report_trial) with undefined; bodies no test calls — and the decisions are ported as pure functions with 12 tests (40 runtime asserts, 0 vacuous), including the original's own test_race_config_default:

  • RaceConfig_default — the default configuration: Neon fallback URL, igla-race study, reduction factor 3, rung bounds 3 (1000 steps) / 27 (9000 steps), target BPB 1.50 (original lines 29-41; the env read is the caller's plumbing, the fallback constants are the decision);
  • the schema shape: 3 tables, 2 views, the igla_race_trials table and igla_leaderboard view under their declared names (lines 77-148);
  • status_limit — the unwrap_or(10) default, with the take(limit) cap against the entry count (lines 168, 207);
  • params_truncated_len / params_needs_ellipsis — the 25-character parameters column with its ellipsis, exactly when longer than 25 (lines 209-213);
  • agent_label — the missing-agent ??? fallback (line 208);
  • the mock leaderboard rows by rank (BPB 2.716/2.743/2.780, ALFA/BRAVO/CHARLIE) and the race statistics (12 active, 42 completed, 23.5% promoted, lines 171-230);
  • asha_step_ladder — 1000 → 3000 → 9000 steps — and igla_found — the BPB < 1.50 threshold on the last rung (lines 232-235);
  • bpb_display_decimals ({:.3}, line 253) and report_includes_agent (the Agent line's presence gate, lines 255-257).

Rust's Option has no unwrap construct in this language: the decisions that read it are ported as verdict functions taking the presence flag, the shape the issue's table gives argv and optional inputs.

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: 21/24 tested — the only untested are the 3 transports, by design (no test may call them).
  • t27c test-report: 12 tests / 12 pass / 0 FAIL / 0 BLOCKED, 0 vacuous passes.
  • t27c gen | grep -c 'not yet implemented': 0; gen | wc -l: 215 (> 12).
  • grep -cE '^\s*(pub )?fn (RaceConfig_default|init|status|report_trial)\(': 4. grep -cE '^\s*test\s+(["|[A-Za-z_])': 12 (≥ 4).
  • Boundary: git status --short — exactly this one file.
  • python3 tools/dupe_scan.py --name <fn> for all 21 new helper names on a clean origin/master worktree: no function named … in 2039 spec(s) — all unique.

Note

The twin issue #9571 carries the identical brief for the same file (same original, same target); this port resolves it — no separate port is needed.

Dmitrii Fedorov (@dmitrii-f-t27)

…loses gHashTag#9489)

Port gHashTag/trios:crates/trios-cli/src/cmd/race.rs (at 8b229e9489ee,
279 lines) as specs/port/trios/crates/trios-cli/src/cmd/race.t27 -
Roadmap Stage 6, goal gHashTag#4548, target t27c gen-rust.

The decisions the command makes are ported as pure functions and
tested (12 tests, 12 pass, 0 vacuous, 40 runtime asserts): the
default RaceConfig (Neon fallback URL, igla-race study, reduction
factor 3, rung bounds 3/27, target BPB 1.50 - including the
original's own test), the schema shape (3 tables, 2 views, names),
the status limit default of 10 with the take() cap, the 25-char
params truncation with its ellipsis edge, the missing-agent ???
fallback, the mock leaderboard rows and race statistics, the ASHA
step ladder 1000/3000/9000, the IGLA FOUND threshold BPB < 1.50,
the 3-decimal BPB display and the agent-line presence gate. The
init/status/report_trial transports keep their names with
undefined; bodies no test calls; Rust's Option decisions are
carried by presence-flag helpers (the language has no unwrap).

Verified: parse OK, spec-status IMPLEMENTED, typecheck 0 errors,
coverage 21/24 (only the 3 transports untested, by design),
test-report 12/12 pass, 0 BLOCKED, gen 215 lines with 0 'not yet
implemented', boundary exactly this one file, dupe_scan: all 21
new helper names unique across 2039 specs.

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

dmitrii-f-t27 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor Author

Correction of my earlier comment on this PR. The earlier text asked for a merge and said the red checks were base failures only. That was wrong while CI is red, and it is withdrawn. This is not a new merge request.

Current state (head de458ef): 26 checks success, 3 failure. The CI is not green. (Correction: the earlier text said 27 passed; the right number is 26.)

The port: specs/port/trios/crates/trios-cli/src/cmd/race.t27 only, Closes #9489. Its own tests: 12 of 12 pass, 40 runtime asserts, 0 vacuous, checked natively with t27b on the latest base and by the reference. The earlier parse, gen and typecheck checks stand.

The three failures, precisely:

Tracking: #9631 (STEP1/STEP2), #9632 (rust_convert), #9633 with PR #9636 (gen_w), #9635 with PR #9637 (mesh-node crypto), #9634 (CLI), #9600 (ledger).

@gHashTag: please keep the golden-chain merge pending until every check on the last SHA is green. Nothing is requested now.

Dmitrii Fedorov (@dmitrii-f-t27)

This branch has not been deployed

No deployments
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-cli/src/cmd/race.rs (Rust, 4 functions) to specs/port/trios/crates/trios-cli/src/cmd/race.t27

1 participant