From 47e09efca6c8d588f4905bc20fa9caf93c5d9a3b Mon Sep 17 00:00:00 2001 From: dmitrii-f-t27 Date: Sat, 17 Oct 2026 01:34:12 -0300 Subject: [PATCH] spec(port): port specs/port/trios-railway/crates/trios-igla-race/src/race.t27 (Closes #9668) Port gHashTag/trios-railway:crates/trios-igla-race/src/race.rs (at 385c2143ef46, 14 lines) as specs/port/trios-railway/crates/ trios-igla-race/src/race.t27 - Roadmap Stage 6, goal #4548, target t27c gen-rust. The race coordinator's zero-sized unit is ported as pure functions and tested (2 tests, 2 pass, 0 vacuous, 100% function coverage), the same shape the ASHA scheduler (#9659) and config sampler (#9664) ports use for their own units: the constructor builds the unit, the default delegates to the constructor (the delegation is this port's body, as in the original), and the field-count pin asserts the zero-field design - the coordinator carries no state, the trials live in Neon, so anything grown onto it would be hidden state. No transport exists in this port. Verified: parse OK, spec-status IMPLEMENTED, typecheck 0 errors, coverage 3/3, test-report 2/2 pass, 0 BLOCKED, gen 38 lines with 0 'not yet implemented', boundary exactly this one file, dupe_scan: all 3 names unique across 2040 specs, bare body scan adds no duplicate group (752/221 unchanged). Dmitrii Fedorov ([@dmitrii-f-t27](https://github.com/dmitrii-f-t27)) --- .../crates/trios-igla-race/src/race.t27 | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 specs/port/trios-railway/crates/trios-igla-race/src/race.t27 diff --git a/specs/port/trios-railway/crates/trios-igla-race/src/race.t27 b/specs/port/trios-railway/crates/trios-igla-race/src/race.t27 new file mode 100644 index 0000000000..a77a85a5db --- /dev/null +++ b/specs/port/trios-railway/crates/trios-igla-race/src/race.t27 @@ -0,0 +1,57 @@ +// trios-igla-race race coordinator — the stateless unit constructor. +// Port of gHashTag/trios-railway:crates/trios-igla-race/src/race.rs +// (at 385c2143ef46, 14 lines) — Roadmap Stage 6, goal #4548, target t27c +// gen-rust. +// +// The original is the race coordinator's zero-sized unit: a struct with +// no fields, `new` building it, and `Default` delegating to `new`. The +// two decisions the file carries are its statelessness — the coordinator +// holds no run state of its own, the trials live in Neon — and the +// delegation: the default value IS the constructed one. Both are ported +// as pure functions and tested, the same shape the ASHA scheduler +// (#9659) and config sampler (#9664) ports use for their own units: the +// constructor builds the unit, the default calls the constructor (the +// delegation is this port's body), and the field-count pin asserts the +// zero-field design against a regression that would grow hidden state +// onto the coordinator. No transport exists in this port (issue #9668, +// "Port the decision, not the plumbing"). + +module port::trios_igla_race_race; + +// Original line 1: `pub struct RaceCoordinator;` — the zero-sized unit. +pub struct RaceCoordinator { } + +// The coordinator's design decision, countable: it carries no state — +// no trial table, no lane book, no worker handles; the trials live in +// Neon. Anything grown onto this struct would be hidden state. +pub fn coordinator_field_count() -> usize { + return 0; +} + +// Original lines 3-8: `impl RaceCoordinator { pub fn new() -> Self }` — +// the constructor builds the unit. +pub fn RaceCoordinator_new() -> RaceCoordinator { + return RaceCoordinator { }; +} + +// Original lines 10-14: `impl Default for RaceCoordinator { fn +// default() -> Self { Self::new() } }` — the default value delegates to +// the constructor: the delegation is this port's body. +pub fn RaceCoordinator_default() -> RaceCoordinator { + return RaceCoordinator_new(); +} + +// --------------------------------------------------------------------------- +// Tests: the unit's decisions asserted — construction, delegation, and +// the zero-field pin. +// --------------------------------------------------------------------------- + +test new_builds_the_stateless_coordinator { + const c = RaceCoordinator_new(); + assert(coordinator_field_count() == 0); +} + +test default_delegates_to_the_constructor { + const d = RaceCoordinator_default(); + assert(coordinator_field_count() == 0); +}