parity: enforce that a CLI flag name matches the API field / MCP arg it binds to #444

Open
opened 2026-08-17 22:54:07 +00:00 by hexajon · 0 comments
Owner

Problem

The naming rule (ADR 0016) is enforced by internal/parity, but it does not catch a CLI flag whose NAME disagrees with the API field / MCP arg it actually binds to. --allow-ff-only was bound to allow_rebase_update ("update a PR branch by rebase") and shipped through green CI until review caught it (#432, fixed under #443); the parity test never flagged the name-vs-binding mismatch.

Ask

Extend internal/parity so a CLI flag (and MCP arg) whose name does not match the API field / MCP arg it sets fails the gate. For each mapped flag, assert the flag's canonical name matches the JSON field / MCP arg it binds to, with the established short forms enumerated as explicit, sanctioned exceptions (e.g. --allow-merge maps to allow_merge_commits, --allow-squash to allow_squash_merge).

Why

Machine-enforced, this catches the name-vs-behavior class for every contributor, with no reliance on catching it in review. It is the mechanical backstop for the audit in #441.

Acceptance

  • A flag whose name contradicts the field/arg it binds to fails go test ./internal/parity/.
  • The sanctioned short-form mappings are enumerated, not silently tolerated.
  • Existing surfaces pass once #441's fixes land.
  • #441 - the sweep that finds the current mismatches.
  • #432, #443 - surfaced --allow-ff-only.
  • ADR 0016.
## Problem The naming rule (ADR 0016) is enforced by `internal/parity`, but it does not catch a CLI flag whose NAME disagrees with the API field / MCP arg it actually binds to. `--allow-ff-only` was bound to `allow_rebase_update` ("update a PR branch by rebase") and shipped through green CI until review caught it (#432, fixed under #443); the parity test never flagged the name-vs-binding mismatch. ## Ask Extend `internal/parity` so a CLI flag (and MCP arg) whose name does not match the API field / MCP arg it sets fails the gate. For each mapped flag, assert the flag's canonical name matches the JSON field / MCP arg it binds to, with the established short forms enumerated as explicit, sanctioned exceptions (e.g. `--allow-merge` maps to `allow_merge_commits`, `--allow-squash` to `allow_squash_merge`). ## Why Machine-enforced, this catches the name-vs-behavior class for every contributor, with no reliance on catching it in review. It is the mechanical backstop for the audit in #441. ## Acceptance - A flag whose name contradicts the field/arg it binds to fails `go test ./internal/parity/`. - The sanctioned short-form mappings are enumerated, not silently tolerated. - Existing surfaces pass once #441's fixes land. ## Related - #441 - the sweep that finds the current mismatches. - #432, #443 - surfaced `--allow-ff-only`. - ADR 0016.
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#444
No description provided.