Repository navigation
spec(port): port specs/port/trios/crates/trios-bridge/src/relay.t27 (Closes #8684) - #9914
Conversation
…loses gHashTag#8684) Port gHashTag/trios:crates/trios-bridge/src/relay.rs (at 8b229e9489ee, 183 lines) as specs/port/trios/crates/trios-bridge/ src/relay.t27 - Roadmap Stage 6, goal gHashTag#4548, target t27c gen-rust. The HTTP relay with SSE's decisions are ported as pure functions and tested (8 tests, 8 pass, 0 vacuous, 27 runtime asserts, 100% function coverage): the four-route table (/events, /agents, /dispatch, /health with their methods), the SSE rule that a lagged broadcast message is skipped rather than fatal with the stream kept alive, the agents list answering the registered, the dispatch decisions - the broadcast literal fanning to everyone, the registration gate, the claim-then-status ordering when BOTH the issue number and the branch name arrive (the claim first, then the status moves to Working with the task as the message), and the confirmation and error shapes - the health ok with the agent count, and the relay serving ALONGSIDE the bridge, never replacing it. The HTTP server, the SSE transport and the router state are the callers' plumbing. Verified: parse OK, spec-status IMPLEMENTED, typecheck 0 errors, coverage 14/14, test-report 8/8 pass, 0 BLOCKED, gen 134 lines with 0 'not yet implemented', boundary exactly this one file, dupe_scan: all 8 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))
|
@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 #8684 port — What is verified:
CI (head d0fbc00): 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 #8684 auto-closed, and file the 14-step report. Dmitrii Fedorov (@dmitrii-f-t27) |
Summary
Port
gHashTag/trios:crates/trios-bridge/src/relay.rs(at8b229e9489ee, 183 lines) asspecs/port/trios/crates/trios-bridge/src/relay.t27— Roadmap Stage 6 (goal #4548), target t27c gen-rust. Closes #8684.The original is the HTTP relay with SSE for Comet ↔ agent real-time communication: four endpoints over the bridge.
Per the issue's rule ("Port the decision, not the plumbing"), all six listed functions are ported under their names as pure functions (no transports — the HTTP server, the SSE transport and the router state are the callers' plumbing) with 8 tests (27 runtime asserts, 0 vacuous, 100% function coverage):
relay_app— the four-route table:/events,/agents,/dispatch(POST),/health(original lines 62-69);serve_relay— the relay runs alongside the WebSocket bridge, never replacing it (lines 72-87);sse_events— the sidepanel stream: a lagged broadcast message is skipped, not fatal, and the stream keeps alive (lines 96-109);list_agents— the registered agents answered as JSON (lines 112-115);dispatch_task— the dispatch decisions: thebroadcastliteral fans to everyone; a specific agent must be registered; when both the issue number and the branch name arrive, the router claims the issue first, then the status moves to Working with the task as the message, and the command rides the broadcast; the confirmation and error shapes (lines 118-174);health_check— theokstatus with the agent count (lines 177-183).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: 8 tests / 8 pass / 0 FAIL / 0 BLOCKED, 0 vacuous passes — the route table with methods, the lag-skip and keep-alive, the list pass-through, the broadcast literal, the registration gate, the claim-requires-both rule in all four combinations with the claim-then-status ordering, and the health ok both ways.t27c gen | grep -c 'not yet implemented': 0;gen | wc -l: 134 (> 12).grep -cE '^\s*(pub )?fn (relay_app|serve_relay|sse_events|list_agents|dispatch_task|health_check)\(': 6.grep -cE '^\s*test\s+(["|[A-Za-z_])': 8 (≥ 6).git status --short— exactly this one file. The repo's lefthook pre-commit passed.dupe_scan: all 8 introduced names unique across 2040 specs (checked before the commit); the bare body scan adds no duplicate group (752 bodies / 221 groups on base, identical with this spec present).Dmitrii Fedorov (@dmitrii-f-t27)