Repository navigation
spec(port): port specs/port/trios/crates/trios-bridge/src/agents.t27 (Closes #6078) - #9981
Conversation
…loses gHashTag#6078) Port gHashTag/trios:crates/trios-bridge/src/agents.rs (at 8b229e9e9489ee, 116 lines) as specs/port/trios/crates/ trios-bridge/src/agents.t27 - Roadmap Stage 6, goal gHashTag#4548, target t27c gen-rust. The agent registry's decisions are ported as pure functions over a presence-flag registry view and tested (7 tests, 7 pass, 0 vacuous, 23 runtime asserts, 100% function coverage), including the original's own register/list, update_status and unregister flows: the empty start, the insert shape (the agent keyed by its id with the Idle status, no task, the connected-at stamp and the last heartbeat set to the same now; the capabilities riding along unused - the comment names future routing), the update that rewrites BOTH the status and the task and refreshes the heartbeat but ONLY for a registered agent, the remove by key, the info-vs-keys answer pair of list and agent_ids, and the membership gate. The RwLock, the HashMap and the clock are the callers' plumbing. Verified: parse OK, spec-status IMPLEMENTED, typecheck 0 errors, coverage 13/13, test-report 7/7 pass, 0 BLOCKED, gen 96 lines with 0 'not yet implemented', boundary exactly this one file, dupe_scan: all 6 introduced names unique across 2046 specs (checked before the commit; the base moved - 722/217 after upstream merges - and the bare scan stays 722/217 with this spec present, no new group). 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 #6078 port — What is verified:
CI (head ba83cb5): required trio green — The 2 reds are the base-red pair, not this change: After the merge I will: verify the spec file live on the merge SHA, confirm #6078 auto-closed, and file the 14-step report. Dmitrii Fedorov (@dmitrii-f-t27) |
Summary
Port
gHashTag/trios:crates/trios-bridge/src/agents.rs(at8b229e9e9489ee, 116 lines) asspecs/port/trios/crates/trios-bridge/src/agents.t27— Roadmap Stage 6 (goal #4548), target t27c gen-rust. Closes #6078.The original is the thread-safe agent registry tracking connected agents and their status.
Per the issue's rule ("Port the decision, not the plumbing"), all seven listed functions are ported under their names as pure functions over a presence-flag registry view (no transports — the RwLock, the HashMap and the clock are the callers' plumbing) with 7 tests (23 runtime asserts, 0 vacuous, 100% function coverage), including the original's own register/list, update_status and unregister flows:
AgentRegistry_new— the empty start (original lines 23-27);AgentRegistry_register— the insert shape: keyed by the id, the Idle status, no task, the connected-at stamp and the last heartbeat set to the same now; the capabilities ride along unused (the comment names future routing) (lines 30-44);AgentRegistry_update_status— rewrites both the status and the task and refreshes the heartbeat, but only for a registered agent; an unknown id changes nothing (lines 47-54);AgentRegistry_unregister— the remove by key (lines 57-59);AgentRegistry_list/AgentRegistry_agent_ids— the info answer and the keys-only answer for broadcast (lines 62-74);AgentRegistry_is_registered— the membership gate (lines 77-79).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: 13/13 tested (100%) — no transports in this port.t27c test-report: 7 tests / 7 pass / 0 FAIL / 0 BLOCKED, 0 vacuous passes — the empty start, the insert shape with its count arithmetic, the membership-gated update with the both-fields and heartbeat rules, the remove, the info/keys pair, the gate, and the original's own register → update → unregister flow.t27c gen | grep -c 'not yet implemented': 0;gen | wc -l: 96 (> 12).grep -cE '^\s*(pub )?fn (AgentRegistry_new|AgentRegistry_register|AgentRegistry_update_status|AgentRegistry_unregister|AgentRegistry_list|AgentRegistry_agent_ids|AgentRegistry_is_registered)\(': 7.grep -cE '^\s*test\s+(["|[A-Za-z_])': 7 (≥ 7).git status --short— exactly this one file. The repo's lefthook pre-commit passed.dupe_scan: all 6 introduced names unique across 2046 specs (checked before the commit); the base moved with the recent upstream merges (now 722 bodies / 217 groups) and the bare scan stays 722/217 with this spec present — no new duplicate group.Dmitrii Fedorov (@dmitrii-f-t27)