Skip to content

test(cli): every bin that calls refuseUnknownFlags has a row in the unknown-flag table - #285

Merged
StepenkoAnatoli merged 1 commit into
mainfrom
claude/unknown-flag-table-20261011
Oct 11, 2026
Merged

StepenkoAnatoli merged 1 commit into
mainfrom
claude/unknown-flag-table-20261011

Conversation

@StepenkoAnatoli

Copy link
Copy Markdown
Owner

Fixes #271.

What changed

Tests only. The "every CLI refuses a flag it does not know" table in cli.test.mjs gains measure.mjs, export-warc.mjs, artifact.mjs and panel.mjs, and a guard before the loop: every .mjs under bin/ whose source calls refuseUnknownFlags( must have a row, or the test fails naming the files. One CHANGELOG bullet. Inventory unchanged (1789): rows and guard sit in the existing registration. No file under bin/ or lib/ changed.

  • measure and export-warc refuse before they look for a project, so no arguments are needed.
  • artifact with no subcommand names the unknown flag and exits 2; with a subcommand the refusal is exit 3 (BLOCKED), which artifact-cli.test.mjs already covers.
  • panel refuses before it listens on anything.
  • The CLIs with their own refusal code (collect-remote, disclosure, mcp-server, path-authority) are not matched by the guard and keep their own tests.

Verified

  • Red first: with only the guard in place, selftest.mjs cli 117 passed, 1 failed, naming exactly artifact.mjs, export-warc.mjs, measure.mjs, panel.mjs.
  • With the rows: 118 passed, 0 failed.
  • Full offline suite on Node 24.21.0 linux: 1789 passed, 0 failed, 202.4 s.
  • git diff --check clean; both files LF-only.

Untested

This PR's all-seven CI.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Gg4isLfN2Ng16zr5DwTnH9


Generated by Claude Code

…nknown-flag table

What changed: cli.test.mjs's "every CLI refuses a flag it does not know" table gains measure.mjs, export-warc.mjs, artifact.mjs and panel.mjs, each with no arguments (measure and export-warc refuse before they look for a project; artifact with no subcommand names the flag and exits 2, the subcommand path's exit 3 being covered by artifact-cli.test.mjs; panel refuses before it listens), and a guard before the loop: every .mjs under bin/ whose source calls refuseUnknownFlags( must have a row, or the test fails naming the files. CHANGELOG Unreleased, one bullet. Rows and guard sit in the existing registration, so the inventory stays 1789. No file under bin/ or lib/ changed (#271).

Why: four CLIs called refuseUnknownFlags and were never added to the table, so the one test that proves the refusal exists did not run them, and a fifth could be forgotten the same way; the guard turns the omission into a named red. The CLIs with their own refusal (collect-remote, disclosure, mcp-server, path-authority) are not matched by the guard and keep their own tests.

What you verified: verified red first - with only the guard in place, `node research-kit/bin/selftest.mjs cli` from the repository root: 117 passed, 1 failed, "these CLIs refuse unknown flags but have no row in this table: artifact.mjs, export-warc.mjs, measure.mjs, panel.mjs" (Node 24.21.0 linux); verified with the four rows: 118 passed, 0 failed, 25.8 s; verified the full offline suite on Node 24.21.0 linux: 1789 passed, 0 failed, 0 unsupported, 202.4 s, exit 0; verified git diff --check clean, both files LF-only; untested when written: this commit's all-seven CI.

What you got wrong: nothing to report.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gg4isLfN2Ng16zr5DwTnH9
@StepenkoAnatoli
StepenkoAnatoli marked this pull request as ready for review October 11, 2026 11:04
@StepenkoAnatoli
StepenkoAnatoli merged commit 9a47439 into main Oct 11, 2026
7 checks passed
@StepenkoAnatoli
StepenkoAnatoli deleted the claude/unknown-flag-table-20261011 branch October 11, 2026 21:43
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.

tests: four CLIs are missing from "every CLI refuses a flag it does not know"

1 participant