opspec: finish the ADR 0008 migration behind a one-way limit, so hand-written CLI help can only shrink #515

Open
opened 2026-09-15 23:09:26 +00:00 by hexajon · 1 comment
Owner

What happens

ADR 0008 moved all help and metadata into the surface-neutral registry in internal/opspec, and retired the hand-written Cobra help. The migration stopped at the start:

  • 1 of 258 CLI command files in internal/cmd uses opspec (the labels noun).
  • 343 hand-written Long: help strings remain.
  • Nothing stops a new command from adding more hand-written help.

Ask

  1. A test with a checked-in baseline (a golden file in testdata/, updated with an -update flag, the pattern Go's own go/printer and go/doc tests use) that lists every CLI command still using hand-written help. The test fails when the list grows. The list may only shrink.
  2. A new CLI command must render from opspec; the test fails for any new entry.
  3. An epic with one child per noun, whose exit criterion is an empty baseline. Then the ADR 0008 Confirmation can fail for unfinished work.

Acceptance

  • Adding a hand-written Long: to a new command fails the test.
  • Migrating a noun and running the test with -update shrinks the baseline.
  • The epic lists every remaining noun.
## What happens ADR 0008 moved all help and metadata into the surface-neutral registry in `internal/opspec`, and retired the hand-written Cobra help. The migration stopped at the start: - 1 of 258 CLI command files in `internal/cmd` uses `opspec` (the `labels` noun). - 343 hand-written `Long:` help strings remain. - Nothing stops a new command from adding more hand-written help. ## Ask 1. A test with a checked-in baseline (a golden file in `testdata/`, updated with an `-update` flag, the pattern Go's own `go/printer` and `go/doc` tests use) that lists every CLI command still using hand-written help. The test fails when the list grows. The list may only shrink. 2. A new CLI command must render from `opspec`; the test fails for any new entry. 3. An epic with one child per noun, whose exit criterion is an empty baseline. Then the ADR 0008 Confirmation can fail for unfinished work. ## Acceptance - Adding a hand-written `Long:` to a new command fails the test. - Migrating a noun and running the test with `-update` shrinks the baseline. - The epic lists every remaining noun.
Author
Owner

A concrete case from the #634 work. adr still uses hand-written help, so one change had to write the same facts in three places: the CLI help in internal/cmd/adr/adr.go, the MCP parameter doc in internal/opspec/paramdocs.go, and the MCP example in internal/mcp/tools_adr.go.

They drifted at once. The CLI examples show --decision-issues "#42". The MCP example still shows madt_adr(action="new", slug="origin-first-forge-resolution") with no decision issues, and a record made that way now fails adr check. Nothing caught it, because the parity test checks names, not help text or examples.

The same change also made the hand-written adr help longer, which is the direction this issue wants to stop. adr has three actions (init, new, check), so it is a small command group to move.

A concrete case from the #634 work. `adr` still uses hand-written help, so one change had to write the same facts in three places: the CLI help in `internal/cmd/adr/adr.go`, the MCP parameter doc in `internal/opspec/paramdocs.go`, and the MCP example in `internal/mcp/tools_adr.go`. They drifted at once. The CLI examples show `--decision-issues "#42"`. The MCP example still shows `madt_adr(action="new", slug="origin-first-forge-resolution")` with no decision issues, and a record made that way now fails `adr check`. Nothing caught it, because the parity test checks names, not help text or examples. The same change also made the hand-written `adr` help longer, which is the direction this issue wants to stop. `adr` has three actions (`init`, `new`, `check`), so it is a small command group to move.
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.

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