Skip to content

fix(mcpx): docs-history unknown flags are a usage error, not file operands (#16402) - #16412

Merged
developing-today-fleet[bot] merged 1 commit into
mainfrom
sweep/16402-docs-history-unknown-flag
Nov 28, 2026
Merged

developing-today-fleet[bot] merged 1 commit into
mainfrom
sweep/16402-docs-history-unknown-flag

Conversation

@developing-today-fleet

@developing-today-fleet developing-today-fleet Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Closes #16402

Defect

docs-history funneled every unrecognized argument into its file list in all three subcommands: a typo'd flag became a file operand and failed opaquely (open --agant: no such file, exit 1), violating the operator-script argument contract (#3352) and contradicting sibling docs-twins, which rejects unknowns cleanly.

Fix

In pkgs/mcpx/tools/docs-history/main.go, a dash-led token that is not a known flag is now a usage error naming the subcommand and token (docs-history: render: unknown argument "--agant" + usage, exit 2) via a shared rejectUnknownFlag helper, wired into the render/stamp/check parse loops. Bare positionals still flow to files (render's no-files stdin mode preserved); all valid invocations unchanged.

Test

New TestUnknownFlagsExitWithUsage in main_test.go reuses #3312's re-exec pattern: one unknown flag per subcommand must exit 2, not panic, name the flag, and print usage. Full package suite passes; live probes confirm the issue's exact cases now exit 2 with usage, and valid render/check invocations behave as before.

Lane sweep code 2026-11-28. Verification: gofmt/vet clean, go test ./tools/docs-history/ ok.

🤖 Generated with Muse Spark

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-28T03:12:04Z",
    "session_id": "ses_e5de0181bc3ffeyyDBtyr5DI1D",
    "lane": null,
    "host": "amd",
    "worktree": "/home/user/git/fleet/sweep-code-20261128",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/user/git/fleet/sweep-code-20261128",
      "repo": "developing-today/code",
      "branch": "sweep/16402-docs-history-unknown-flag",
      "sha": "21eba3868f61f0d638a43cd522371e3eb9d0b5e5"
    },
    "auth_subject": "oc-code-03",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@coderabbitai

coderabbitai Bot commented Nov 28, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5c141ede-a8f7-485c-9249-5f9df05b18e1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@developing-today-fleet
developing-today-fleet Bot merged commit bed9ec4 into main Nov 28, 2026
2 checks passed
@developing-today-fleet
developing-today-fleet Bot deleted the sweep/16402-docs-history-unknown-flag branch November 28, 2026 03:14
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.

mcpx(docs-history): unknown/typo'd flags silently become file operands — the unrecognized-argument half the #3312 fix left open

0 participants