fix(interp): refuse help <cmd> in Check for RemediationOnly builtins #709
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.36) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 207 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.319
Real PR Conversation Timeline
1 comments
"Review active on #709"
general
weight: 0.35
louis-cqrl
What
Runrefuseshelp <cmd>for a RemediationOnly builtin (rm,tee,truncate,logrotate,systemctl) outside remediation mode, butCheckreturned early forhelpwithout looking at its operand, so it approved scriptsRunthen refused. Not an escape (Runstill enforces the gate), butCheckshould never approve whatRunrefuses.Checknow applies the sameremediationOnlyRefusalpredicate dispatch uses forhelp <name>(unless the operand is a feature topic) and reportsCheckRemediationRequiredwith the same message.helpnow checks the remediation gate before printing staticHelptext, so a RemediationOnly builtin with static help can't print it outside remediation mode. None of today's five has static help; this closes it for future ones.Not covered here:
Checkalso doesn't modelhelp <cmd>for a command outsideAllowedCommands, whichRunrefuses with exit 1.Credit
Found by Jacob Hayes with his deterministic-simulation tool patina (finding #3: Check-vs-Run oracle, about 6.3k runs). Findings thread: https://dd.slack.com/archives/D0AC8RLB21J/p1793475631273749
Tests
TestCheckHelpOfRemediationOnlyBuiltinMatchesRun(interp/check_test.go) enumerates the RemediationOnly builtins from the registry, so new ones are covered, and asserts that Check's verdict matches Run in read-only and remediation mode. It fails for all five on main.go test ./...passes exceptTestPSPentestLargePIDListDoesNotHanginbuiltins/ps, which fails the same way on clean main on this host.🤖 Generated with Claude Code