Repository navigation
docs(check): document --rule, and summary-then-rule for large repos - #724
Conversation
|
@claude /review |
|
Claude finished @aibex-agent[bot]'s task in 1m 46s —— View job Review completeReview mode: incremental — read 0 prior review thread(s) before reviewing.
SummaryThis is a narrowly-scoped docs change (topic v11 → v12) that adds [New] One gap, posted inline on No other correctness, security, or test-adequacy issues found in the diff. |
| - `--summary`: per-rule counts instead of every finding. With `--json` | ||
| it omits `results` and keeps `summary`, so the output stays small on | ||
| any repository. Use it when the question is "how many", not "where". | ||
| - `--rule <id>`: run only the named rule (its directory name); |
There was a problem hiding this comment.
[New] This flag entry documents the happy path for --rule <id> but not the refusal: per openspec/specs/cli-check/spec.md ("Requirement: Check restricts the run to named rules with --rule"), an id that names no rule directory under any engine is refused — check exits 1 and, under --json, reports the standardized error envelope with code RULE_NOT_FOUND naming the id (confirmed in packages/cli/src/rules/rule-filter.ts and wired through packages/cli/src/commands/check.ts).
That refusal isn't reflected anywhere else in this file either — the ## Errors table (lines 155-158) only lists SCAN_FAILED and INVALID_INPUT, and the ## Exit codes section's list of reasons for exit 1 (line 146) doesn't mention an unresolved --rule id. Every sibling recipe that can raise RULE_NOT_FOUND (delete-rule.md, improve-rule.md, recover-rule.md) lists it in its own Errors table, so this is the one place introducing --rule to the check recipe without the matching error row.
Given the 8 KiB default-output budget this file is already close to, a one-row addition to the Errors table (RULE_NOT_FOUND | unknown `--rule` id | re-check the directory name) would likely fit and bring this recipe in line with the others. Not blocking since the error message itself is self-explanatory, but worth considering before this ships as the only place --rule is documented.
There was a problem hiding this comment.
Added in 02bb444: a RULE_NOT_FOUND row in the Errors table, and an unknown --rule id in the exit-1 list. To stay under the 8 KiB default-output budget I tightened two Step 2 sentences without changing what they say. A test pins the new row.
What
The
checkagent recipe now covers--rule <id>, which has existed since 0.11.3 but was never mentioned. It's topic v12 now.--rule <id>runs only the named rule (its directory name), can be repeated, and works with--jsonand--summary.check --json --summaryto see which rules fired, thencheck --json --rule <id>for one rule's findings. This replaces the separate--summaryparagraph and keeps its warnings (don't countresults, and don't read an absentresultsas clean).Default output is unchanged. Docs only. The behavior is already specified in
cli-check("Check restricts the run to named rules with --rule"), so this has no OpenSpec change.Size
The recipe's default output is held to 8 KiB by
recipe-sections.test.ts, andcheckwas already near the limit with every situational section on demand. Merging the new advice into the existing paragraph keeps it under. The next addition tocheck's Steps or Flags will probably need a section moved to on demand.Checks
test/check-recipe.test.tspins topic v12, the--ruleflag entry, and the summary-then-rule order.pnpm typecheck,pnpm lintandpnpm test(3419 passed) all pass.Fixes #716