You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by "me2seeks (via GitHub)" <gi...@apache.org> on 2026/08/21 06:49:11 UTC

[PR] refactor(cli): move the mid-turn slash disposition onto the command spec [maka]

me2seeks opened a new pull request, #3379:
URL: https://github.com/apache/maka/pull/3379

   ## Summary
   
   Follow-up to #3310, per the review seam observation: the routing call site in `editor.onSubmit` matched command names (`'goal' || 'recap'`) to decide which slash commands answer locally while a turn is running. That knowledge now lives on `MakaSlashCommand` as a required `midTurn` field declared next to each handler:
   
   - `'local'` (`/goal`, `/recap`) — answers immediately; the handler must be independent of the running turn and never enter `runControl`, whose busy gate would silently no-op.
   - `'refuse'` (everything else that reaches generic routing) — rejected with the notice introduced in #3310. Safe default for anything that mutates session state or opens a picker the turn would race.
   - `'intercepted'` (`/exit`, `/swarm`, `/graph`) — documents that dedicated checks claim these ahead of generic routing; the disposition is never consulted for them.
   
   Because `slashCommandHandlers` is a `satisfies Record<TuiSlashCommandId, …>` and the field is required, a newly added command must state its mid-turn answer — omitting it is a compile error, instead of silently inheriting the call site's default.
   
   Behavior is unchanged; the mid-turn routing tests from #3310 pin it.
   
   Refs #3308
   
   ## Verification
   
   - `npm --workspace maka-agent test`: 337 pass / 0 fail, including the four `slash commands during a running turn` tests from #3310 unchanged.
   - Compile-time enforcement verified: removing one handler's `midTurn` fails with `TS2741: Property 'midTurn' is missing … but required in type 'Omit<MakaSlashCommand, "aliases" | "name">'`; restored and `tsc` is clean again.
   - `npm run lint`, `npm run format:check`, `npm run typecheck`: pass.
   - Not run: desktop e2e (no desktop change).
   
   ## AI use
   
   Select exactly one:
   
   - [ ] No generative tool made a substantive contribution
   - [x] Generative tooling made a substantive contribution
   
   Tool(s) and scope: Maka (AI agent) implemented the refactor and ran the verification; the commit carries the `Generated-by: Maka` trailer. Human contributor of record reviewed the disposition assignment per command and decided to submit.
   
   ## Checklist
   
   - [x] Tests cover the change and fail without it — behavior is pinned by the #3310 mid-turn routing tests; the type-level guarantee was verified by removing a declaration and observing the compile error
   - [x] Lint, format, typecheck and the affected suites pass locally
   
   Does this PR entail a change in behavior?
   
   - [ ] Yes — described under Summary above
   - [x] No


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] refactor(cli): move the mid-turn slash disposition onto the command spec [maka]

Posted by "Astro-Han (via GitHub)" <gi...@apache.org>.
Astro-Han merged PR #3379:
URL: https://github.com/apache/maka/pull/3379


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org