Subcommand dispatch: one parent-level handler for every command, and a check that the parent declares the dispatched subcommands #744

Open
opened 2026-10-07 05:34:51 +00:00 by claude · 1 comment
Member

Found during IW-679 (shared subcommand runner). Follow-ups, verbatim:

  • Service, Server and GateCommand repeat the same onParent body (runParsed(declaration, rest, env)(_ => rejectMissing(declaration, env))); a named Subcommand helper would hold it once — review-phase-01-20261007-070528.md, composition warning.
  • review-state ignores parent-level flags (iw review-state --bogus reports Missing subcommand, but the other dispatchers report Unknown flag).
  • Subcommand.dispatch(parent, subcommands, …) does not enforce parent.subcommands == subcommands.map(_.declaration); Config, Gate and Issue have no exact unknown-subcommand test to catch a drift — review-phase-01-20261007-070528.md, architecture and testing warnings.
  • core/test/ConfigHarnessTest.scala:1 PURPOSE line says "now declared" (temporal wording) — review-phase-01-20261007-070528.md, style warning.
Found during IW-679 (shared subcommand runner). Follow-ups, verbatim: - [ ] `Service`, `Server` and `GateCommand` repeat the same `onParent` body (`runParsed(declaration, rest, env)(_ => rejectMissing(declaration, env))`); a named `Subcommand` helper would hold it once — review-phase-01-20261007-070528.md, composition warning. - [ ] `review-state` ignores parent-level flags (`iw review-state --bogus` reports `Missing subcommand`, but the other dispatchers report `Unknown flag`). - [ ] `Subcommand.dispatch(parent, subcommands, …)` does not enforce `parent.subcommands == subcommands.map(_.declaration)`; Config, Gate and Issue have no exact unknown-subcommand test to catch a drift — review-phase-01-20261007-070528.md, architecture and testing warnings. - [ ] `core/test/ConfigHarnessTest.scala:1` PURPOSE line says "now declared" (temporal wording) — review-phase-01-20261007-070528.md, style warning.
Author
Member

Intake: needs-human
Workflow: waterfall
Reason: G8 waits for PR #746 (IW-679), which adds Subcommand.dispatch and runParsed and is not merged
Analysis: project-management/issues/IW-744/analysis.md on branch IW-744

Intake: needs-human Workflow: waterfall Reason: G8 waits for PR #746 (IW-679), which adds Subcommand.dispatch and runParsed and is not merged Analysis: project-management/issues/IW-744/analysis.md on branch IW-744
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
iterative-works/iw-cli#744
No description provided.