Skip to content

43 command modules still accept unknown flags silently — sweep the flag-validation advisory to zero #488

Closed

Description

@sandstream

self-audit/flag-validation reports 43 command modules that accept unknown flags (2/45 validate after #487). The advisory is severity low by deliberate design, so it never gates — but the class is not theoretical:

Both are the same defect: a flag that silently does nothing is indistinguishable from a working one.

Why this is not a mechanical pass

An allowlist built from the wrong source is its own outage. CHECK_FLAGS was first derived from commands/check.ts's own literals, which rejected kit check --attest and --no-auto-install — both documented, both read one import away in cli-checks-shared.ts. The check exited 1 and never ran.

So each module needs its allowlist derived from what the callees read, not from the handler file. Per module:

  1. grep the argv readers on that command's call path (hasFlag/flagValue/flagInt/raw process.argv indexing), including imported modules;
  2. cross-check docs/COMMANDS.md for flags documented on that command;
  3. allowlist = own flags + GLOBAL_FLAGS (added in fix(cli): honor global flags before the command word, and reject a typo'd upgrade flag #487);
  4. add the module to a coverage test whose oracle is the source scan, not a restated list.

Suggested order — the side-effectful ones first, since a typo there does something rather than nothing: secrets, install, setup, hooks, env, policy, identity, login, then the read-only reporters.

Done when

self-audit/flag-validation reports all 45 command module(s) reject unknown flags, and a test pins that a new command module cannot land without an allowlist.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions