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

Merged
TH
7d ago
+27-21

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 9d8407c84f, 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.