feat(commands): §11e step 2 — registry + per-verb handler files (#264)#1333
Merged
Conversation
Replaces drain.ts's inline if/else dispatch with a registry lookup so
adding a new verb is one entry in registry.ts plus one file in
handlers/. Behavior-zero per kai+link locks (msg-1777932028252 /
msg-1777932030625):
- same poll cadence
- same ack contract
- same unknown-skip semantics
- no auth / intake churn
- no new verbs (the two existing verbs become the first two registry
entries — no scope creep)
New files:
src/commands/types.ts — PendingCommand, CommandContext, CommandHandler
src/commands/registry.ts — COMMAND_REGISTRY (context_sync, run_approve)
src/commands/handlers/context-sync.ts — relocated from drain.ts
src/commands/handlers/run-approve.ts — relocated from drain.ts
drain.ts is now ~80 LOC (down from ~200): poll + error tracking + dispatch
via registry with the existing unknown-skip ack fallback. Net diff +206/-136.
Closes §11e step 2 of reflectt-cloud/docs/COMMAND_PLUGIN_SKILL_ARCHITECTURE.md.
Step 3 (routes/canvas extraction) and step 4 (routes/chat extraction) are
explicitly out of scope for this PR.
Proof:
- typecheck green
- 244/244 test files pass (2647 tests, 1 skipped)
- canonical staging command-queue smoke planned post-merge (poll, ack-complete, ack-fail)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes §11e step 2 of
reflectt-cloud/docs/COMMAND_PLUGIN_SKILL_ARCHITECTURE.md. Replacesdrain.ts's inline if/else dispatch with a registry lookup so adding a new verb is one entry inregistry.tsplus one file inhandlers/. Behavior-zero.Changes
src/commands/types.tsPendingCommand,CommandContext,CommandHandlersrc/commands/registry.tsCOMMAND_REGISTRYmappingcmd.type→ handlersrc/commands/handlers/context-sync.tsdrain.tssrc/commands/handlers/run-approve.tsdrain.tssrc/commands/drain.tsCOMMAND_REGISTRYwith existing unknown-skip ack fallback; ~200 LOC → ~80 LOCNet diff: +206 / -136.
Locks honored (kai msg-1777932028252 + link msg-1777932030625)
ack/complete/fail)reason: 'unknown_type')context_sync,run_approve) become the first two registry entriesProof bar
tsc --noEmit, exit 0)🤖 Generated with Claude Code