refactor(command-registry): move CLI flag grammar, text and aliases down (#2543) - #2561
Merged
Merged
Conversation
…liases down Move the vocabulary that both the CLI and commands read but no command's runtime depends on into the package below both: flag types, registry, groups and the four flag-definitions files, command-text, and cli-command-aliases. These are pure moves; only their import specifiers change. No compat re-export at the old paths — every consumer switches to the owning subpath. The per-command defaults stay where they are for now (the daemon's edge into the facet resolver is the harder cut and belongs with the daemon-closure work). Part of #2545 / #2543.
Size Report
Startup median (7 runs, lower is better):
|
Member
Author
|
No actionable findings on 2774aba. All nine relocated source modules are byte-identical, the consumed subpaths are exported, and the registry tests preserve their module-reset behavior. Current checks pass and there are no conflicts; ready for human review and merge. |
thymikee
added this pull request to stack #2563
September 13, 2026 17:01
|
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.
What
Pure relocation of the CLI flag grammar, text vocabulary and command aliases down into
packages/command-registry, the layer below both the CLI parser andsrc/commands. No compat re-export at the old paths — every consumer switches to the owning@agent-device/command-registry/*subpath.Moved (content unchanged, new export subpaths added):
flag-types,flag-registry,flag-groups,flag-definitions-{action,connection,target,workflow}command-textcli-command-aliasesColocated
flag-registry.test.tsmoves with the source; the cross-layerflag-declaration-admission.test.tsstays atsrc/commands/cli-grammar/(it observes the daemon +cli-schemaconsumers) and now imports the package — itsresetModules+ dynamic-import divergence contract survives the move (verified).Why this is the safe half of #2543
The per-command defaults move and the daemon's two
cli-schema/command-schema.tsimports are the harder cut (theappsdefault is load-bearing —assertResolvedAppsFilterthrows onundefined— and the constant sits behind the heavycontracts/devicefaçade, which blows the flag-grammar entry's eager budget). Those belong with the daemon-closure work, not this move. This PR only re-locates declarations so #2543-B can point the daemon at the package.Gates
pnpm check:layering— OK. R2/R5 clean, R6 = 4 (unchanged), R76 = 15 (unchanged), R11 now 295 exported subpaths (+5).pnpm typecheck— clean.pnpm vitest run scripts/__tests__/eager-closure-budgets.test.ts— 600/600; no entry closure grows (renames tracked).pnpm check:production-exports— parity with merge-base (68), no new unused export.pnpm check:mcp-metadata,pnpm check:command-docs— pass.oxlint+oxfmt— clean.unit-coresuites (command-registry, cli-schema, cli, cli-grammar, command-input/explain/flags, mcp, capture, interaction, metro, replay, family, session-action-recorder): ~1000 tests pass.Part of #2545 (Wave B) / implements the "flag grammar goes down" step of #2543.