Skip to content

spec(port): port specs/port/trinity/src/registry/export_cli.t27 (Closes #9725) - #10131

Closed
dmitrii-f-t27 wants to merge 1 commit into
gHashTag:masterfrom
dmitrii-f-t27:zcode-port-9725-export-cli
Closed

dmitrii-f-t27 wants to merge 1 commit into
gHashTag:masterfrom
dmitrii-f-t27:zcode-port-9725-export-cli

Conversation

@dmitrii-f-t27

Copy link
Copy Markdown
Contributor

Summary

Port gHashTag/trinity:src/registry/export_cli.zig (at ee512359254b, 77 lines) as specs/port/trinity/src/registry/export_cli.t27 — Roadmap Stage 5 (goal #4547), target t27c gen-rust. Closes #9725.

The original is the registry export CLI: it writes the command registry and the MCP schemas to JSON, then prints a stats block.

Per the issue's rule ("Port the decision, not the plumbing"), the one listed function is ported under its name as a pure function (no transports — the registry export, the schema export and the stats gathering live in mcp_gen and are the callers' plumbing) with 4 tests (15 runtime asserts, 0 vacuous, 100% function coverage):

  • the registry destination (original lines 17-20): the first user argument overrides the default .trinity/registry.json — the bar is args.len > 1;
  • the MCP schemas destination (lines 26-29): the second user argument overrides the default .trinity/mcp_schemas.json — one argument is not enough, the bar is args.len > 2;
  • the stats block (lines 36-76): the two top counts (total commands, MCP-enabled) plus one line per mode, per stability and per namespace — 14 lines for the registry's 3 modes, 3 stabilities and 6 namespaces;
  • main: the run ends by printing that block.

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: 4/4 tested (100%) — no transports in this port.
  • t27c test-report: 4 tests / 4 pass / 0 FAIL / 0 BLOCKED, 0 vacuous passes — both paths at their exact argument-count boundaries (1 vs 2, 2 vs 3), and the stats shape at the real registry and degenerate counts.
  • All four generators were run before the push: gen (60 lines, 0 'not yet implemented'), gen-rust, gen-c, gen-verilog.
  • grep -cE '^\s*(pub )?fn (main)\(': 1. grep -cE '^[[:space:]]*test[[:space:]]+("|[A-Za-z_])': 4 (≥ 1).
  • Boundary: git status --short — exactly this one file. The repo's lefthook pre-commit passed.
  • dupe_scan: all 4 function names unique across the corpus (checked before the commit); the bare scan reports zero error lines — no new duplicate group, none grew.

Dmitrii Fedorov (@dmitrii-f-t27)

gHashTag#9725)

Port gHashTag/trinity:src/registry/export_cli.zig (at ee512359254b, 77
lines) as specs/port/trinity/src/registry/export_cli.t27 - Roadmap
Stage 5, goal gHashTag#4547, target t27c gen-rust.

The registry export CLI's decisions are ported as pure functions and
tested (4 tests, 4 pass, 0 vacuous, 15 runtime asserts, 100% function
coverage): the registry destination (the first user argument overrides
the default .trinity/registry.json - the bar is args.len > 1), the MCP
schemas destination (the SECOND user argument overrides the default
.trinity/mcp_schemas.json - one argument is not enough, the bar is
args.len > 2), and the stats block the run ends with (the two top
counts plus one line per mode, per stability and per namespace - 14
lines for the registry's 3 modes, 3 stabilities and 6 namespaces).
The registry export, the schema export and the stats gathering live
in mcp_gen and are the caller's plumbing. All four generators (gen,
gen-rust, gen-c, gen-verilog) emit this spec before the push.

Verified: parse OK, spec-status IMPLEMENTED, typecheck 0 errors,
coverage 4/4, test-report 4/4 pass, 0 BLOCKED, gen 60 lines with
0 'not yet implemented', boundary exactly this one file, dupe_scan:
all 4 function names unique, bare scan reports zero error lines.

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 only you can merge it.

Verification of this head (e35a82c, on current master — no extra merge needed):

  • Required CI trio green: validate, check-linked-issue, parse-ratchet; also Check L1 TRACEABILITY, duplicate-bodies and cli-tri green.
  • The t27b-native-run artifact of this head (commit e35a82c, run 39071027569) row for specs/port/trinity/src/registry/export_cli.t27: reference pass, t27b pass, tests 4, invariants 0, asserts 15, blockers [], detail empty, reference_disagree: [].
  • All four generators were run locally before the push (gen, gen-rust, gen-c, gen-verilog) — this spec emits cleanly everywhere.
  • The only red checks are proven base-red on master WITHOUT this PR:
    • Corpus ratchet: the failing step is 'Every conflicted type name has a written verdict' — docs/reports/type_conflicts_classified.json disagrees with the tree (UNJUDGED/STALE); the identical error fails on master itself. This spec declares no struct or enum.
    • t27b-native-ratchet: the registration debt, red on master across this whole port series.

After the merge I will: verify the spec file live on the merge SHA, confirm #9725 auto-closed, and file the 14-step report.

Dmitrii Fedorov (@dmitrii-f-t27)

@gHashTag

Copy link
Copy Markdown
Owner

Landed unchanged (as a merge commit) in #10174, together with ten other green ports, on top of the master fixes #10160/#10172. Closing this as superseded; the linked issue closes when #10174 merges.

@gHashTag gHashTag closed this Oct 18, 2026
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/trinity:src/registry/export_cli.zig (Zig, 1 function) to specs/port/trinity/src/registry/export_cli.t27

2 participants