Repository navigation
spec(port): port specs/port/trios/crates/trios-claude/src/process.t27 (Closes #6384) - #9963
Conversation
…Closes gHashTag#6384) Port gHashTag/trios:crates/trios-claude/src/process.rs (at 8b229e9e9489ee, 130 lines) as specs/port/trios/crates/ trios-claude/src/process.t27 - Roadmap Stage 6, goal gHashTag#4548, target t27c gen-rust. The Claude CLI process driver's decisions are ported as pure functions and tested (7 tests, 7 pass, 0 vacuous, 33 runtime asserts, 100% function coverage): the childless start carrying only the config, the stdout/stderr/exit event triple, the create-only-when-missing directory rule, both invocations' exact argument table (claude --print --model <model> --output-format json, the one-shot prompt appending <prompt> as the final argument), the both-streams piping with the receiver-dropped break, the prompt verdict (trimmed stdout on success, the process-failed error carrying stderr otherwise), the kill that clears the held child, the running/status mapping (held = Running, none = Idle), and the Drop start-kill of only a held child - the last-resort cleanup. The process spawns, the stream pumps and the directory creation are the callers' plumbing. Verified: parse OK, spec-status IMPLEMENTED, typecheck 0 errors, coverage 17/17, test-report 7/7 pass, 0 BLOCKED, gen 159 lines with 0 'not yet implemented', boundary exactly this one file, dupe_scan: all 10 introduced names unique across 2042 specs AND the ProcessState struct verified absent from the corpus type set by grep 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 #6384 port — What is verified:
CI (head a5f0e9f): 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 #6384 auto-closed, and file the 14-step report. Dmitrii Fedorov (@dmitrii-f-t27) |
Summary
Port
gHashTag/trios:crates/trios-claude/src/process.rs(at8b229e9e9489ee, 130 lines) asspecs/port/trios/crates/trios-claude/src/process.t27— Roadmap Stage 6 (goal #4548), target t27c gen-rust. Closes #6384.The original is the Claude CLI process driver: it spawns and streams the
claudeCLI, runs one-shot prompts, and cleans up on drop.Per the issue's rule ("Port the decision, not the plumbing"), all seven listed functions are ported under their names as pure functions (no transports — the process spawns, the stream pumps and the directory creation are the callers' plumbing) with 7 tests (33 runtime asserts, 0 vacuous, 100% function coverage):
ClaudeProcess_new— the childless start carrying only the config (original lines 22-27);ClaudeProcess_spawn— the create-only-when-missing directory rule, both invocations' exact argument table (claude --print --model <model> --output-format json, the one-shot prompt appending<prompt>as the final argument), the both-streams piping with the receiver-dropped break, and the child becoming held (lines 29-79);ClaudeProcess_send_prompt— the trimmed stdout on success, the process-failed error carrying stderr otherwise (lines 81-101);ClaudeProcess_kill— terminating the held child clears it; with no child the kill is a no-op success (lines 103-109);ClaudeProcess_is_running/ClaudeProcess_status— the held-child running verdict and its Running/Idle mapping (lines 111-121);ClaudeProcess_drop— the last-resort cleanup: the drop start-kills only a held child (lines 124-129);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: 17/17 tested (100%) — no transports in this port.t27c test-report: 7 tests / 7 pass / 0 FAIL / 0 BLOCKED, 0 vacuous passes — the childless start with its config, the event triple, the directory rule both ways, the full argument table for both invocations with the piping and break rules, the prompt verdict both ways, the kill-clears and running/status mapping, and the drop start-kill.t27c gen | grep -c 'not yet implemented': 0;gen | wc -l: 159 (> 12).grep -cE '^\s*(pub )?fn (ClaudeProcess_new|ClaudeProcess_spawn|ClaudeProcess_send_prompt|ClaudeProcess_kill|ClaudeProcess_is_running|ClaudeProcess_status|ClaudeProcess_drop)\(': 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 10 introduced names unique across 2042 specs, and theProcessStatestruct verified absent from the corpus type set by grep 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)