Skip to content

refactor(command-registry): name each system command's own module as its owner - #4836

Merged
thymikee merged 1 commit into
mainfrom
t3/system-owner-files-per-command
Nov 20, 2026
Merged

thymikee merged 1 commit into
mainfrom
t3/system-owner-files-per-command

Conversation

@thymikee

@thymikee thymikee commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Summary

PR #4817 split packages/command-surface/src/system/index.ts into one file per command and left the reviewer's follow-up undone: every system command still claimed system/index.ts as its owner. All 13 claims (descriptors/device-operations.ts 10, descriptors/session-operations.ts 2, registry.ts 1) name one command each, so each now names that command's own module. No claim covers the family composition, so none stays on index.ts.

ownerFiles is tooling metadata only: explain:command renders it, and the bundle guard proves it stays out of dist/. The observable change is the file list a reader gets — explain:command back now also lists system/back.ts. check-affected and depgraph do not read the claims, so no check or live scenario selection changes.

command-output-schemas-system.test.ts now derives the expected owner path from each SYSTEM_COMMAND_OUTPUT_SCHEMAS key (system/<command>.ts) instead of asserting one fixed path, and the reverse check scans the system/ prefix. A new system command is covered with no test edit; a command claiming the composition file, another family's module, or none still fails. Other assertions are unchanged.

Value

  • Claims naming system/index.ts: 13 → 0.
  • Distinct system owner modules named: 1 → 13.
  • Owner paths the bundle guard forbids in dist/: 52 → 64.
  • Test edits to add a system command's owner claim: 1 → 0.

Validation

Head 9d8407c, local pass: command-registry and command-surface suites, the edited test, command-explain.test.ts, owner-files-no-leak.test.ts, eager-closure budgets, check:affected:test, depgraph:test, check:bundle-owner-files, check:gate-manifest, check:layering, check:fallow, check:production-exports, check:quick, format. No behaviour, help-text or wire change; CI is authoritative for device lanes.


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

@github-actions

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.47 MB 6.47 MB 0 B
Package (unpacked) 6.47 MB 6.47 MB 0 B
Package (download) 1.97 MB 1.97 MB +5 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 25.4 ms 29.1 ms +3.7 ms
CLI --help 55.9 ms 60.6 ms +4.7 ms

@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of 9d8407c

No open findings.

1 finding below minor hidden (user_settings.min_severity).

Reviewed with this repository's own Sentinel configuration (0731b7a06858).

💬 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

The code in 9d8407c looks correct, and all 19 checks pass. No conflicts. Nothing else blocks merge. Not verified here: tests and gates were not re-run locally. One note: the test derives each system command's owner module from the command name (system/.ts). That holds today for all 13 commands. A future system command whose file name differs from its command name would need the file or the test renamed.

@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 8adffea into main Nov 20, 2026
19 checks passed
@thymikee
thymikee deleted the t3/system-owner-files-per-command branch November 20, 2026 18:26
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