refactor(commands): author each executable command once in its facet - #2313
Merged
Conversation
The integration-progress scanner mapped client calls to command names by finding defineExecutableCommand blocks. Those are gone; a facet's run callback now holds the call, and its name may be a module constant.
thymikee
force-pushed
the
claude/audit-facet-derives-executable
branch
from
September 5, 2026 20:21
f5f1728 to
6a8c155
Compare
Size Report
Startup median (7 runs, lower is better):
|
Member
Author
|
Sentinel at 6a8c155: clean coordinator + independent Terra/high review. Facet construction preserves metadata.readInput -> prior client callback, typed results/formatters and CLI/MCP projections while deleting the duplicate executable declaration. Reported CLI help and 56 MCP-schema parity checks plus exact-head Coverage/Integration/guards and native CI are green. Net source change shrinks; Size reports -1.1 kB unpacked. No conflicts or remaining confirmed findings; merge-ready for maintainer review. No device behavior changed and no additional local device run needed. |
|
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
Before: each command was declared
twice — a standalone
*CommandDefinitionbuilt viadefineExecutableCommand(metadata, run), thenrepeated inside
defineCommandFacet({ ..., definition, ... }). After: a command file authorsmetadataplus a typedrun(client, input)once;defineCommandFacetderivesname,description,mcpDetail,inputSchema, andinvokeinternally, still exposing the deriveddefinitionthatfamily/registry.ts/system/index.tsconsume.defineExecutableCommandandExecutableCommandContractare deleted (no remaining references).Every
text,cliSchema,cliReader,daemonWriter,cliOutputFormatter, andclientMethodisunchanged; existing input casts (clipboard, swipe, focus, settings, etc.) are kept.
CommandFacetgained
Result/Formattertype params so each facet'sdefinition.invoke/cliOutputFormatterkeep per-command types — otherwise
CommandExecutionResult<Name>and a synccliOutputFormattertest both collapsed to
unknown.57 sites, one commit per family plus one foundation commit. One
chore(gates)commit follows: the integration-progress scanner now reads facets instead of executables. The R6commands -> clientcount drops by one on its own (the deleted contract was that type import); #2299 ratchets it against the merge-base.Validation
Tested commit: 6a8c155 —
pnpm check:affected --rungreen locally (scripts/ changed, so the full check set ran).agent-device help commandsandlistCommandTools()'s MCP tool schemas dumped fromthis head and from a temp worktree of
origin/main. Bothdiffs empty — CLI help and all 56 MCP tool schemas byte-identical before/after.
pnpm vitest run --project unit-core src/commands: 69 files, 569 tests passed.pnpm check:quick(oxlint + fulltsc -b/tsc -p): clean.pnpm format: no residual diff.