Skip to content

refactor(commands): author each executable command once in its facet - #2313

Merged
thymikee merged 15 commits into
mainfrom
claude/audit-facet-derives-executable
Sep 5, 2026
Merged

refactor(commands): author each executable command once in its facet#2313
thymikee merged 15 commits into
mainfrom
claude/audit-facet-derives-executable

Conversation

@thymikee

@thymikee thymikee commented Sep 5, 2026

Copy link
Copy Markdown
Member

Summary

Before: each command was declared
twice — a standalone *CommandDefinition built via defineExecutableCommand(metadata, run), then
repeated inside defineCommandFacet({ ..., definition, ... }). After: a command file authors
metadata plus a typed run(client, input) once; defineCommandFacet derives name,
description, mcpDetail, inputSchema, and invoke internally, still exposing the derived
definition that family/registry.ts/system/index.ts consume. defineExecutableCommand and
ExecutableCommandContract are deleted (no remaining references).

Every text, cliSchema, cliReader, daemonWriter, cliOutputFormatter, and clientMethod is
unchanged; existing input casts (clipboard, swipe, focus, settings, etc.) are kept. CommandFacet
gained Result/Formatter type params so each facet's definition.invoke/cliOutputFormatter
keep per-command types — otherwise CommandExecutionResult<Name> and a sync cliOutputFormatter
test 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 R6 commands -> client count drops by one on its own (the deleted contract was that type import); #2299 ratchets it against the merge-base.

Validation

Tested commit: 6a8c155pnpm check:affected --run green locally (scripts/ changed, so the full check set ran).

  • Parity: agent-device help commands and listCommandTools()'s MCP tool schemas dumped from
    this head and from a temp worktree of origin/main. Both
    diffs 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 + full tsc -b/tsc -p): clean. pnpm format: no residual diff.

@thymikee
thymikee force-pushed the claude/audit-facet-derives-executable branch from f5f1728 to 6a8c155 Compare September 5, 2026 20:21
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
Installed (including dependencies) 4.44 MB 4.44 MB -1.1 kB
Package (unpacked) 4.44 MB 4.44 MB -1.1 kB
Package (download) 1.32 MB 1.32 MB -575 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 26.4 ms 26.4 ms +0.0 ms
CLI --help 80.4 ms 80.8 ms +0.4 ms

@thymikee

thymikee commented Sep 5, 2026

Copy link
Copy Markdown
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.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Sep 5, 2026
@thymikee
thymikee merged commit 4b7c561 into main Sep 5, 2026
18 checks passed
@thymikee
thymikee deleted the claude/audit-facet-derives-executable branch September 5, 2026 21:12
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-09-05 21:12 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant