Skip to content

spec(port): port specs/port/trios/crates/trios-bridge/src/agents.t27 (Closes #6078) - #9981

Merged
gHashTag merged 1 commit into
gHashTag:masterfrom
dmitrii-f-t27:zcode-port-6078-bridge-agents
Oct 17, 2026
Merged

gHashTag merged 1 commit into
gHashTag:masterfrom
dmitrii-f-t27:zcode-port-6078-bridge-agents

Conversation

@dmitrii-f-t27

Copy link
Copy Markdown
Contributor

Summary

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 #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).
  • Boundary: 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)

…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))
@dmitrii-f-t27

Copy link
Copy Markdown
Contributor Author

@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 — crates/trios-bridge/src/agents.rs (gHashTag/trios, at 8b229e9e9489ee, 116 lines) re-authored as specs/port/trios/crates/trios-bridge/src/agents.t27. One file, one commit, head ba83cb5e9, Closes #6078.

What is verified:

  • t27c parse OK, spec-status IMPLEMENTED, typecheck 0 errors / 0 warnings, coverage 13/13 (100%) — no transports in this port, t27c test-report 7 tests / 7 pass / 0 FAIL / 0 BLOCKED, 0 vacuous — the empty start; the insert shape (keyed by id, 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 answer and the keys-only broadcast answer; the membership gate — and the original's own register → update → unregister flow.
  • gen → 96 lines, 0 not yet implemented; the 7 required names count exactly 7; 7 test blocks; boundary exactly the one file.
  • dupe_scan: all 6 introduced names unique across 2046 specs; 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.
  • The t27b-native-run artifact of this head (commit ba83cb5, run 39043749248): agents.t27 row — reference pass, t27b pass, tests 7, invariants 0, asserts 23, blockers [], detail empty, reference_disagree: [].

CI (head ba83cb5): required trio green — validate, check-linked-issue, parse-ratchet — Check L1 TRACEABILITY green and Corpus ratchet green; 27 checks pass overall, incl. emit-bitexact, t27b-native-linux, t27b-native-macos. Note: duplicate-bodies now PASSES on this head — the upstream merges fixed the base debt, so only the two known base-reds remain below.

The 2 reds are the base-red pair, not this change: cli-tri (the #3324 include_str!), t27b-native-ratchet (the same verdict red the Queen's port PRs carry; this spec's own row is reference pass + t27b pass — the registration debt is the UNLISTED class).

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)

This was referenced Oct 17, 2026
@gHashTag
gHashTag merged commit a1002be into gHashTag:master Oct 17, 2026
27 of 29 checks passed
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-bridge/src/agents.rs (Rust, 7 functions) to specs/port/trios/crates/trios-bridge/src/agents.t27

2 participants