Skip to content

Leave refused container flags out of move and copy help - #985

Merged
robzolkos merged 3 commits into
mainfrom
fix-copy-help-flags
Oct 28, 2026
Merged

robzolkos merged 3 commits into
mainfrom
fix-copy-help-flags

Conversation

@robzolkos

@robzolkos robzolkos commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

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.

Written for commit fc4748c. Summary will update on new commits.

View guided diff Turn on auto-fix

A move or copy command refuses a container flag it inherits but never
reads, yet its help still listed the flag: messages copy --help offered
--message-board as "required if project has multiple", and following it
failed with "does not read --message-board". 28 such flags showed across
20 commands.

Help now skips any parent-scoped flag the guard refuses, decided by the
same FilingIgnores rule, so the two cannot drift. The refusal's hint also
says to drop the flag, not only how to name another destination.
@robzolkos
robzolkos requested a review from a team as a code owner October 28, 2026 13:05
Copilot AI balanced review requested due to automatic review settings October 28, 2026 13:05
@github-actions github-actions Bot added commands CLI command implementations tests Tests (unit and e2e) labels Oct 28, 2026
Copilot AI previously approved these changes Oct 28, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approved

No active review issues are reported for the help-text and refused-flag updates.

No open issues 🎉

What changed in this PR

Aligns move and copy help with the container flags those commands actually accept, while preserving flag parsing and usage-error behavior.

Changes:

  • Shares FilingIgnores between the refusal guard and text/agent help.
  • Clarifies refusal hints to tell users to drop the unsupported flag.
  • Adds regression coverage verifying that help hides refused flags and retains supported ones.

[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

File Description
internal/​commands/​filing.go Centralizes refused-flag detection and clarifies recovery hints.
internal/​commands/​filing_guard_test.go Tests help visibility for inherited container flags.
internal/​cli/​help.go Omits refused container flags from shared help output.

Review effort: Balanced

The surface diff reads agent help, so flags help no longer offers show as
removals. Each was already refused as a usage error since v0.20.0.
Copilot AI balanced review requested due to automatic review settings October 28, 2026 13:13
Copilot AI dismissed their stale review, a newer Copilot review was requested October 28, 2026 13:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approved

No active review issues block approval of the move and copy help changes.

No open issues 🎉

Review effort: Balanced

* origin/main:
  Bump golang.org/x/net to v0.62.0 (#986)
@robzolkos
robzolkos merged commit a728f4e into main Oct 28, 2026
32 checks passed
@robzolkos
robzolkos deleted the fix-copy-help-flags branch October 28, 2026 13:48
@robzolkos robzolkos mentioned this pull request Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands CLI command implementations tests Tests (unit and e2e)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants