Skip to content

refactor(command-surface): split the system family by command - #4817

Merged
thymikee merged 1 commit into
mainfrom
t3/split-command-surface-system
Nov 20, 2026
Merged

thymikee merged 1 commit into
mainfrom
t3/split-command-surface-system

Conversation

@thymikee

@thymikee thymikee commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Summary

packages/command-surface/src/system/index.ts was 905 lines of unrelated commands (home, back, keyboard, clipboard, orientation, fold, telephony, hardware buttons, TV remote, app switcher, appstate), changed in 16 of the last 200 commits. Each command now owns one file with its schema, description, metadata, CLI schema/reader, daemon writer, facet, and private input readers. index.ts keeps only the family composition and the output-schema projection. 16 files touched.

This is move-only: all 88 module-scope statements are unchanged (base vs head statements compared, and ADR 0027's split tolerance passes with no approval row). No strings, descriptions, help text, schemas, facet ordering, or exported names changed.

One deviation: the 16 *CliReader/*DaemonWriter symbols moved to their command modules instead of being re-exported from the barrel. Re-exported alone they have no production consumer, so check:production-exports flags them, and the only alternative was a Fallow suppression row. Each module now exports what its own facet consumes, matching capture/ and management/. systemCommandFamily and SYSTEM_COMMAND_OUTPUT_SCHEMAS keep their names, values, and index.ts path, so descriptor ownerFiles claims are untouched.

Validation

Tested at 458fe5c8c5. install --frozen-lockfile, build, format, lint, tsc -b pass. Targeted suites pass: command-surface 287, src/commands/schema 114, cli+mcp+command-registry 1214, daemon 4938, eager-closure/closure-growth/repo-guards 1083. check:layering, check:fallow, check:production-exports, check:bundle-owner-files, check:command-docs, check:mcp-metadata, check:di-seams, check:daemon-wire-compat (identical to base) pass. agent-device help is byte-identical to base for all twelve commands. Full unit-ci and device lanes left to CI.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

View guided diff Turn on auto-fix

@apex-sentinel-staging

This comment has been minimized.

packages/command-surface/src/system/index.ts held twelve unrelated commands in
905 lines, so one command's change touched a file every other system command
shared. Each command now owns one file with its schema, description, metadata,
CLI schema and reader, daemon writer, facet, and private input readers.
index.ts keeps only the family composition and the output-schema projection.

The move is statement-neutral: all 88 module-scope statements are unchanged, so
the eager-closure split tolerance in ADR 0027 holds without an approval row.

Co-Authored-By: Apex <noreply@callstack.com>
@thymikee
thymikee force-pushed the t3/split-command-surface-system branch from 458fe5c to fb5b82b Compare November 20, 2026 14:51
@github-actions

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.46 MB 6.46 MB -17 B
Package (unpacked) 6.46 MB 6.46 MB -17 B
Package (download) 1.97 MB 1.97 MB -130 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 22.1 ms 23.8 ms +1.6 ms
CLI --help 49.4 ms 55.1 ms +5.7 ms

@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of fb5b82b

Since the review of 458fe5c: 0 new · 0 still open · 0 no longer raised

No open findings.

Reviewed with this repository's own Sentinel configuration (520e2ca3c27d).

💬 Talking to Sentinel

In a finding's thread, reply with:

Command What it does
@apex-sentinel-staging note <context> Adds context; Sentinel re-checks the cited code
@apex-sentinel-staging pivot <why> Says the finding is wrong; Sentinel re-checks the cited code
@apex-sentinel-staging like Marks the finding as useful
@apex-sentinel-staging dislike <why> Marks it as not useful, so it is not raised again

On this conversation, comment @apex-sentinel-staging review to run a full review once again.

@thymikee

Copy link
Copy Markdown
Member Author

This PR is ready at fb5b82b. The system family split moves statements verbatim and keeps the facet order, and the review found nothing to fix. All checks pass on this commit, and there are no conflicts.

Not verified here: base and head statements were compared line by line, but the help output, check:production-exports, check:fallow and the test suites were not run locally. CI covers them.

Not blocking, take or leave: the 13 system-command ownerFiles claims (for example device-operations.ts#L379) still name system/index.ts, which now holds only the family composition. Each could point at its command module, such as capture/alert.ts and management/push.ts, and command-output-schemas-system.test.ts could iterate the SYSTEM_COMMAND_OUTPUT_SCHEMAS keys. Keeping it as is stays move-only.

The next step is maintainer review.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 20, 2026
@thymikee
thymikee merged commit b52a5cd into main Nov 20, 2026
19 checks passed
@thymikee
thymikee deleted the t3/split-command-surface-system branch November 20, 2026 15:11
thymikee added a commit that referenced this pull request Nov 20, 2026
* origin/main:
  refactor(command-surface): split the system family by command (#4817)
  docs(agents): ask PR bodies for before/after and refactor value, not a file count (#4818)
  refactor(apple-runner): generate the Swift runner error-code enums from runner-contract.ts (#4810)
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