Repository navigation
spec(port): port specs/port/trios-railway/crates/trios-railway-core/src/transport.t27 (Closes #9795) - #9863
Conversation
…rc/transport.t27 (Closes gHashTag#9795) Port gHashTag/trios-railway:crates/trios-railway-core/src/ transport.rs (at 8b229e9489ee, 210+ lines) as specs/port/ trios-railway/crates/trios-railway-core/src/transport.t27 - Roadmap Stage 6, goal gHashTag#4548, target t27c gen-rust. The RW-02 client's decisions are ported as pure functions and tested (9 tests, 9 pass, 0 vacuous, 36 runtime asserts, 13/14 coverage - the one untested is the fingerprint transport, by design): the canonical 8-4-4-4-12 hex UUID shape check byte by byte (dashes at 8, 13, 18, 23; hex elsewhere; 36 bytes), the env override chain (team | bearer | personal -> team, project -> project) with the UUID heuristic guessing project tokens, the team default of with_token, the auth-mode readback, the endpoint override, the two auth header names (Authorization: Bearer vs Project-Access-Token), and the query verdicts (GraphQL errors -> graphql, absent data -> empty data). The token itself is never stored - presence flags carry its decisions; the fingerprint delegates to the hash module and keeps its transport name with an undefined; body no test calls. Verified: parse OK, spec-status IMPLEMENTED, typecheck 0 errors, test-report 9/9 pass, 0 BLOCKED, gen 197 lines with 0 'not yet implemented', boundary exactly this one file, dupe_scan: all 16 introduced names unique across 2040 specs (checked before the commit), bare body scan adds no duplicate group (752/221 unchanged). Dmitrii Fedorov ([@dmitrii-f-t27](https://github.com/dmitrii-f-t27))
…HashTag#9795) dupe_scan found is_hex_digit already carried by two other specs (compiler/lexer.t27, igla/race/backend.t27) - the name is not mandated by the issue. Renamed to uuid_hex_digit so every name this port introduces is unique across the 2040 specs. All oracles re-verified after the rename. Dmitrii Fedorov ([@dmitrii-f-t27](https://github.com/dmitrii-f-t27))
|
@gHashTag Please merge this PR into master via the golden chain — rights on gHashTag/t27 are read-only for me (403), so the merge itself needs your action. What this is: the #9795 port — What is verified:
CI (head c4bcca6): required trio green — The 3 reds are the base-red trio, not this change: After the merge I will: verify the spec file live on the merge SHA, confirm #9795 auto-closed, and file the 14-step report. Dmitrii Fedorov (@dmitrii-f-t27) |
Summary
Port
gHashTag/trios-railway:crates/trios-railway-core/src/transport.rs(at8b229e9489ee, 210+ lines) asspecs/port/trios-railway/crates/trios-railway-core/src/transport.t27— Roadmap Stage 6 (goal #4548), target t27c gen-rust. Closes #9795.The original is RW-02: the minimal Railway GraphQL client with two authorization styles —
team(the default) sendingAuthorization: Bearerfor account tokens,projectsendingProject-Access-Tokenfor project-scoped tokens — where the env read allows operators to force the mode and otherwise guesses from the token's shape: a canonical 8-4-4-4-12 hex UUID means a project token.Per the issue's rule ("Port the decision, not the plumbing"), the eight listed functions are ported under their names — seven as tested pure functions,
Client_token_fingerprintas the oneundefined;transport (its body delegates to the hash module's audit-safe fingerprint, never exposing the token) — with 9 tests (36 runtime asserts, 0 vacuous, 13/14 coverage — the only untested function is that transport):is_uuid_like— the canonical UUID shape check byte by byte: 36 bytes, dashes at 8, 13, 18, 23, hex digits elsewhere, withuuid_hex_digitandis_dash_positionas its tested helpers (original lines 16-33);Client_from_env— the MissingToken gate, the RAILWAY_TOKEN_AUTH override chain (team | bearer | personal → team, project → project), and the UUID heuristic (a UUID-shaped token guesses project) (lines 88-100);Client_with_token(the team default) /Client_with_token_and_mode(explicit) /Client_auth_mode(the readback) /Client_with_endpoint(the override);Client_query— the two header names and the verdicts: GraphQL errors answer kind graphql, absent data answers empty data (lines 139-170).The token itself is never stored in the port — presence flags carry its decisions.
A note on the second commit
A post-commit
dupe_scanfoundis_hex_digitalready carried by two other specs (specs/compiler/lexer.t27,specs/igla/race/backend.t27) — the name is not mandated by the issue — so it is renamed touuid_hex_digit, making every introduced name unique across the 2040 specs. Both commits carry theirCloses #9795reference, satisfying the per-commit L1 TRACEABILITY rule.Verification (all run live from the worktree root, zig 0.16.0, after the rename)
t27c parse: OK.t27c spec-status: IMPLEMENTED.t27c typecheck: 0 errors, 0 warnings.t27c coverage: 13/14 tested — the only untested function is theClient_token_fingerprinttransport, by design.t27c test-report: 9 tests / 9 pass / 0 FAIL / 0 BLOCKED, 0 vacuous passes — the canonical UUID accepted; wrong length, a broken dash and a non-hex digit rejected; the hex-digit and dash-position tables; the missing-token gate; every override; the heuristic both ways; the team default and readback; the endpoint override; both headers and all three query verdicts.t27c gen | grep -c 'not yet implemented': 0;gen | wc -l: 197 (> 12).grep -cE '^\s*(pub )?fn (is_uuid_like|Client_from_env|Client_with_token|Client_with_token_and_mode|Client_auth_mode|Client_with_endpoint|Client_token_fingerprint|Client_query)\(': 8.grep -cE '^\s*test\s+(["|[A-Za-z_])': 9 (≥ 8).git status --short— exactly this one file. The repo's lefthook pre-commit passed on both commits.dupe_scan: all 16 introduced names unique across 2040 specs (after the rename); the bare body scan adds no duplicate group (752 bodies / 221 groups on base, identical with this spec present).Dmitrii Fedorov (@dmitrii-f-t27)