Leave refused container flags out of move and copy help

Merged
RO
6h ago
+100-4

What

A move or copy command refuses a container flag it inherits but doesn't read. Since v0.20.0, that refusal is a usage error. But help still listed those flags. messages copy --help offered --message-board as "required if project has multiple", and following it failed with "does not read --message-board". The new test found 28 such flags across 20 commands, for example --message-board, --schedule, --questionnaire, --card-table on copy, and --vault/--folder on docs, uploads and folders.

Change

  • FilingIgnores (internal/commands/filing.go) is now the one rule for "this command refuses this inherited flag". The guard and help (parentScopedFlags in internal/cli/help.go, used by both text help and --agent help) both read it.
  • The refusal hint says to drop the flag before suggesting a --to-* destination.
  • .surface doesn't change. The flags still parse, so they can be refused.

Evidence

  • TestFilingCommandHelpOffersOnlyTheContainerFlagsItReads renders help for every guarded command. It checks that refused flags are absent and flags the command reads (e.g. cards move --card-table) are present. It fails on main with 28 offers and passes here.
  • bin/ci passes locally.
  • Prod, v0.20.0. In a project with several boards, schedules, Check-ins and card tables, following the help made 4 in-place copies fail. Without the flag they succeeded.
  • Fresh agent sessions on dev bc3. I gave Opus four "duplicate in place" requests: a message, an event, a check-in question and a column. Each build had its own project with duplicate tools. Both this build and v0.20.0 went 4/4, and a readback shows each copy in the right container. Agents already avoided the trap. This fix is for anyone following help as written.

Summary by cubic

Fixes move and copy help so it no longer offers container flags the command refuses.

Since v0.20.0, messages copy --message-board (and 27 similar flags across 20 commands) failed with a usage error, but --help still listed the flag as usable.

  • Help and the refusal guard now share one rule (FilingIgnores), so the two cannot drift.
  • The refusal hint now says to drop the flag before naming a destination.
  • The surface diff records these 28 flags leaving agent help as removals.