Skip to content

Commit 1376d92

Browse files
committed
Filter stub commands from resume-safe help
Keep claw --help's resume-safe slash command summary aligned with the interactive command list by filtering STUB_COMMANDS and adding regression coverage.
1 parent cb56dc1 commit 1376d92

3 files changed

Lines changed: 39 additions & 1 deletion

File tree

ROADMAP.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2128,7 +2128,7 @@ Original filing (2026-04-13): user requested a `-acp` parameter to support ACP p
21282128

21292129
**Source.** Jobdori dogfood 2026-04-18 against `/tmp/cdJ` on main HEAD `b7539e6` in response to Clawhip pinpoint nudge at `1494744278423961742`. Adjacent to #85 (skill discovery ancestor walk) on the *discovery* side — #85 is "skills are discovered too broadly," #95 is "skills are *installed* too broadly." Together they bound the skill-surface trust problem from both the read and the write axes. Distinct sub-cluster from the permission-audit bundle (#50 / #87 / #91 / #94) and from the truth-audit cluster (#80–#87, #89): this is specifically about *scope asymmetry between install and settings* and the *missing uninstall verb*.
21302130

2131-
96. **`claw --help`'s "Resume-safe commands:" one-liner summary does not filter `STUB_COMMANDS` — 62 documented slash commands that are explicitly marked unimplemented still show up as valid resume-safe entries, contradicting the main Interactive slash commands list just above it (which *does* filter stubs per ROADMAP #39)** — dogfooded 2026-04-18 on main HEAD `8db8e49` from `/tmp/cdK`. The `render_help` output emits two separate enumerations of slash commands; only one of them applies the stub filter. The Resume-safe summary advertises `/budget`, `/rate-limit`, `/metrics`, `/diagnostics`, `/bookmarks`, `/workspace`, `/reasoning`, `/changelog`, `/vim`, `/summary`, `/brief`, `/advisor`, `/stickers`, `/insights`, `/thinkback`, `/keybindings`, `/privacy-settings`, `/output-style`, `/allowed-tools`, `/tool-details`, `/language`, `/max-tokens`, `/temperature`, `/system-prompt` — all of which are explicitly in `STUB_COMMANDS` with "Did you mean" guards and no parse arm.
2131+
96. **`claw --help`'s "Resume-safe commands:" one-liner summary does not filter `STUB_COMMANDS` — 62 documented slash commands that are explicitly marked unimplemented still show up as valid resume-safe entries, contradicting the main Interactive slash commands list just above it (which *does* filter stubs per ROADMAP #39)** — **done (verified 2026-04-29):** the Resume-safe command summary now applies the same `STUB_COMMANDS` filter as the Interactive slash command block before rendering help, so unimplemented slash-command stubs no longer advertise as resume-safe. Added `stub_commands_absent_from_resume_safe_help` to lock the filtered one-liner contract alongside the existing REPL completion filter. Fresh proof: `cargo fmt --all --check`, `cargo test -p rusty-claude-cli stub_commands_absent_from_resume_safe_help -- --nocapture`, and `cargo test -p rusty-claude-cli parses_direct_cli_actions -- --nocapture` pass. Original filing below for traceability.
21322132

21332133
**Concrete repro.**
21342134
```

progress.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,3 +365,14 @@ US-021 COMPLETED (Request body size pre-flight check - from dogfood findings)
365365
- Tests: 5 new tests for size estimation and limit checking
366366

367367
PROJECT STATUS: COMPLETE (21/21 stories)
368+
369+
Iteration 2026-04-29 - ROADMAP #96 COMPLETED
370+
------------------------------------------------
371+
- Pulled origin/main: already up to date.
372+
- Selected ROADMAP #96 as a small repo-local Immediate Backlog item: the `claw --help` Resume-safe command summary leaked slash-command stubs despite the main Interactive command listing filtering them.
373+
- Files: rust/crates/rusty-claude-cli/src/main.rs, ROADMAP.md, progress.txt.
374+
- Changed help rendering to filter `resume_supported_slash_commands()` through `STUB_COMMANDS` before building the Resume-safe one-liner.
375+
- Added `stub_commands_absent_from_resume_safe_help` regression coverage so future stub additions cannot leak into the Resume-safe summary.
376+
- Targeted verification: `cargo test -p rusty-claude-cli stub_commands_absent_from_resume_safe_help -- --nocapture` passed; `cargo test -p rusty-claude-cli parses_direct_cli_actions -- --nocapture` passed.
377+
- Format/check verification: `cargo fmt --all --check`, `git diff --check`, and `cargo check -p rusty-claude-cli` passed.
378+
- Broader clippy note: `cargo clippy -p rusty-claude-cli --all-targets -- -D warnings` is blocked by pre-existing `clippy::unnecessary_wraps` failures in `rust/crates/commands/src/lib.rs` (`render_mcp_report_for`, `render_mcp_report_json_for`), outside this diff.

rust/crates/rusty-claude-cli/src/main.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8952,6 +8952,7 @@ fn print_help_to(out: &mut impl Write) -> io::Result<()> {
89528952
writeln!(out)?;
89538953
let resume_commands = resume_supported_slash_commands()
89548954
.into_iter()
8955+
.filter(|spec| !STUB_COMMANDS.contains(&spec.name))
89558956
.map(|spec| match spec.argument_hint {
89568957
Some(argument_hint) => format!("/{} {}", spec.name, argument_hint),
89578958
None => format!("/{}", spec.name),
@@ -13000,6 +13001,32 @@ UU conflicted.rs",
1300013001
);
1300113002
}
1300213003
}
13004+
13005+
#[test]
13006+
fn stub_commands_absent_from_resume_safe_help() {
13007+
let mut help = Vec::new();
13008+
print_help_to(&mut help).expect("help should render");
13009+
let help = String::from_utf8(help).expect("help should be utf8");
13010+
let resume_line = help
13011+
.lines()
13012+
.find(|line| line.starts_with("Resume-safe commands:"))
13013+
.expect("resume-safe command line should exist");
13014+
let resume_roots = resume_line
13015+
.trim_start_matches("Resume-safe commands:")
13016+
.split(',')
13017+
.filter_map(|entry| entry.trim().strip_prefix('/'))
13018+
.filter_map(|entry| entry.split_whitespace().next())
13019+
.collect::<Vec<_>>();
13020+
13021+
for stub in STUB_COMMANDS {
13022+
assert!(
13023+
!resume_roots.contains(stub),
13024+
"stub command /{stub} should not appear in resume-safe command list"
13025+
);
13026+
}
13027+
13028+
assert!(resume_roots.contains(&"status"));
13029+
}
1300313030
}
1300413031

1300513032
fn write_mcp_server_fixture(script_path: &Path) {

0 commit comments

Comments
 (0)