Repository navigation
spec(port): port specs/port/trinity/src/cli/tri_record.t27 (Closes #9620) - #10120
Closed
dmitrii-f-t27 wants to merge 1 commit into
Closed
dmitrii-f-t27 wants to merge 1 commit into
dmitrii-f-t27 wants to merge 1 commit into
Conversation
…ashTag#9620) Port gHashTag/trinity:src/cli/tri_record.zig (at ee512359254b, 157 lines) as specs/port/trinity/src/cli/tri_record.t27 - Roadmap Stage 5, goal gHashTag#4547, target t27c gen-rust. The terminal-recording wrapper's decisions are ported as pure functions and tested (7 tests, 7 pass, 0 vacuous, 33 runtime asserts, 100% function coverage): the usage gate (only the program name prints usage and exits 1), the environment overrides with their fallback (a present-but-invalid value keeps the default, exactly like the original's catch; an absent variable too), the TRI_REC_OVERWRITE flag (presence alone turns it on), the basename cut (the GIF is named after the command's first word - the length up to the first space, or the whole command when it has none), the existing-GIF block (without overwrite an existing GIF stops the run), the exit-code cascade (usage, the GIF block, an asciinema failure and an agg failure each exit 1; only a finished recording exits 0), and the KB size display (bytes / 1024, truncated). The argv and environment reads, the directory creation, the file checks, the subprocess runs and the prints are the callers' plumbing; the Config record's five defaults are carried as consts plus the override rule. 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 7/7, test-report 7/7 pass, 0 BLOCKED, gen 124 lines with 0 'not yet implemented', boundary exactly this one file, dupe_scan: all 7 function names unique, bare scan reports zero error lines. Dmitrii Fedorov ([@dmitrii-f-t27](https://github.com/dmitrii-f-t27))
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 (e632042, on current master — no extra merge needed):
After the merge I will: verify the spec file live on the merge SHA, confirm #9620 auto-closed, and file the 14-step report. Dmitrii Fedorov (@dmitrii-f-t27) |
This was referenced Oct 18, 2026
dmitrii-f-t27
pushed a commit
to dmitrii-f-t27/t27
that referenced
this pull request
Oct 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Port
gHashTag/trinity:src/cli/tri_record.zig(atee512359254b, 157 lines) asspecs/port/trinity/src/cli/tri_record.t27— Roadmap Stage 5 (goal #4547), target t27c gen-rust. Closes #9620.The original is the terminal-recording wrapper: it records any
tri *command to GIF via asciinema + agg.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 argv and environment reads, the directory creation, the file checks, the subprocess runs and the prints are the callers' plumbing) with 7 tests (33 runtime asserts, 0 vacuous, 100% function coverage):
catch; an absent variable keeps it too — cols 120, rows 40, idle_max 3 carried as the defaults;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: 7/7 tested (100%) — no transports in this port.t27c test-report: 7 tests / 7 pass / 0 FAIL / 0 BLOCKED, 0 vacuous passes — the usage gate, the override rule for absent/present/valid/invalid values, the presence-only flag, the basename cut for no-space/space-first/multi-word commands, the GIF block both ways, the KB truncation at the 1023/1024 boundary, and the exit cascade through every stage failure.gen(124 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_])': 7 (≥ 1).git status --short— exactly this one file. The repo's lefthook pre-commit passed.dupe_scan: all 7 function names unique across the corpus (checked before the commit); the branch sits on current master and the bare scan reports zero error lines — no new duplicate group, none grew.Dmitrii Fedorov (@dmitrii-f-t27)