Skip to content

fix(security): apply wait_timeout to security_cmd tirith calls (F-06) - #18

Merged
thehoff merged 1 commit into
developfrom
feat/sec-security-cmd-actual-timeout
May 18, 2026
Merged

thehoff merged 1 commit into
developfrom
feat/sec-security-cmd-actual-timeout

Conversation

@thehoff

@thehoff thehoff commented May 18, 2026

Copy link
Copy Markdown
Owner

Summary

Stacked on #17. The v0.1.6 overnight summary claimed src/analytics/security_cmd.rs::{fetch_audit_stats, fetch_doctor_status} had the wait_timeout / stdout-cap / stdin-null pattern via a run_tirith_capture helper. Grepping the current file showed no such helper and no wait_timeout import — both call sites were running unbounded Command::new(bin).output().

Routes both through exec_capture_short with the same 8s budget the gate uses in tirith_gate.rs. Operational shape now matches the gate; a hung tirith reports as "no data" to the contextcrawler security dashboard rather than freezing the command.

Why this is its own PR

The fix depends on exec_capture_short shipping in #17. Once #17 merges, this branch rebases cleanly onto develop.

Same failure mode the project memory rule feedback_verify_code_not_subjects.md covers — the overnight summary's commit subject claimed the hardening landed; the code showed otherwise.

Test plan

  • cargo build clean
  • cargo test 2003 pass / 6 ignored / 0 fail
  • Codex round-2 verdict: CLEAN — both call sites now route through exec_capture_short with the same 8s budget as tirith_gate.rs

🤖 Generated with Claude Code

@thehoff
thehoff changed the base branch from feat/sec-exec-capture-limits to develop May 18, 2026 05:36
The v0.1.6 overnight summary (branch #12) claimed fetch_audit_stats and
fetch_doctor_status had the wait_timeout / stdout-cap / stdin-null
pattern via a run_tirith_capture helper. Grepping the current file
shows no such helper and no wait_timeout import — both call sites were
running unbounded Command::new(bin).output().

Routes both through exec_capture_short with the same 8s budget the
gate uses in tirith_gate.rs. Failure mode is identical to the previous
.ok()? short-circuit: a hung or missing tirith reports as "no data"
to the dashboard rather than freezing the `rtk security` command.

Stacks on feat/sec-exec-capture-limits — that's where
exec_capture_short ships.

Closes F-06 from docs/security/AUDIT-subprocess-timeouts.md. Found by
Codex round-2 review of the original audit doc.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@thehoff
thehoff force-pushed the feat/sec-security-cmd-actual-timeout branch from 0f19913 to f486b00 Compare May 18, 2026 05:36
@thehoff
thehoff merged commit 5504bef into develop May 18, 2026
3 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.

1 participant