parity: readme drift test cannot see string-dispatched subcommands - worktree status/rebase shipped as fiction #169

Closed
opened 2026-07-16 21:46:28 +00:00 by hexajon · 0 comments
hexajon commented 2026-07-16 21:46:28 +00:00 (Migrated from codeberg.org)

TestReadmeCommandRefsResolve walks each README invocation down the live cobra tree and treats tokens after the last match as positional args. madtea worktree dispatches its subcommands as strings inside runWorktree (internal/cmd/git/worktree.go), so madtea worktree status resolved as worktree-plus-positional and passed - while the CLI actually supports only list/add/remove/prune. The README taught worktree status, worktree rebase, and a -b flag on worktree add, none of which exist on the CLI (status and rebase live only on madt_worktrees; add takes the branch positionally). Fixed in the readme-edits batch, but the guard's charter is "a rename, removal, or typo on the front page fails CI instead of shipping fiction" - and it shipped fiction.

Two gaps to close:

  • worktree's string switch should be real cobra subcommands (the way issue body does it), so introspection, --help, and the drift test all see the true surface.
  • Short flags: the -b never existed and was not caught either - the scanner should validate short flags in README examples, not just --long ones.

Acceptance:

  • with the old README text restored, the drift test fails on worktree status, worktree rebase, and worktree add -b
  • madtea worktree --help lists the real subcommands
  • README examples with short flags are validated against the command's declared flags
`TestReadmeCommandRefsResolve` walks each README invocation down the live cobra tree and treats tokens after the last match as positional args. `madtea worktree` dispatches its subcommands as strings inside `runWorktree` (`internal/cmd/git/worktree.go`), so `madtea worktree status` resolved as worktree-plus-positional and passed - while the CLI actually supports only list/add/remove/prune. The README taught `worktree status`, `worktree rebase`, and a `-b` flag on `worktree add`, none of which exist on the CLI (status and rebase live only on `madt_worktrees`; add takes the branch positionally). Fixed in the readme-edits batch, but the guard's charter is "a rename, removal, or typo on the front page fails CI instead of shipping fiction" - and it shipped fiction. Two gaps to close: - `worktree`'s string switch should be real cobra subcommands (the way `issue body` does it), so introspection, `--help`, and the drift test all see the true surface. - Short flags: the `-b` never existed and was not caught either - the scanner should validate short flags in README examples, not just `--long` ones. Acceptance: - [ ] with the old README text restored, the drift test fails on `worktree status`, `worktree rebase`, and `worktree add -b` - [ ] `madtea worktree --help` lists the real subcommands - [ ] README examples with short flags are validated against the command's declared flags
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sixfold-space/madtea#169
No description provided.