Skip to content

One command catalog: socket dispatch, capabilities list, CLI table, and CLI help are four hand-maintained copies of the protocol #87

Description

@arzafran

The socket protocol is enumerated by hand in four places that must track each other verbatim:

  1. The 209-case dispatch switch in Sources/TerminalController.swift (~line 1470)
  2. v2Capabilities() in the same file: a second ~200-entry method-name array with nothing enforcing it matches the switch
  3. The CLI CommandDescriptor table in CLI/programa.swift (~line 1319)
  4. A separate ~1,300-line subcommandUsage help switch in CLI/programa.swift duplicating per-command knowledge the descriptor table was meant to unify

Both review models (Claude and Codex) independently ranked this the highest-leverage restructuring. A shared CommandSpec catalog (name, params, focus policy, help text) deletes the capabilities array and the usage switch outright and makes CLI/server drift structurally impossible. Same move should absorb the identical 3-line workspace_id/surface_id validation blocks copy-pasted across 22+ v2 handlers.

Explicitly cleared by review: the dispatch switch itself is fine (uniform one-line cases, shared typed param extraction). The problem is the three shadow copies, not the switch.


From the 2026-07-09 nuclear review (10 module reviewers + Codex cross-model pass, disprove-first). Line refs are against the reductive-audit branch (PR #81).

Metadata

Metadata

Assignees

No one assigned

    Labels

    nuclear-reviewFrom the 2026-07-09 whole-codebase nuclear reviewtech-debtKnown latent issue / maintenance debt

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions