Thanks to visit codestin.com
Credit goes to github.com

Skip to content

refactor(command-registry): move CLI flag grammar, text and aliases down (#2543) - #2561

Merged
thymikee merged 1 commit into
mainfrom
refactor/2543-command-registry-vocabulary
Sep 14, 2026
Merged

refactor(command-registry): move CLI flag grammar, text and aliases down (#2543)#2561
thymikee merged 1 commit into
mainfrom
refactor/2543-command-registry-vocabulary

Conversation

@thymikee

Copy link
Copy Markdown
Member

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 and src/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-text
  • cli-command-aliases

Colocated flag-registry.test.ts moves with the source; the cross-layer flag-declaration-admission.test.ts stays at src/commands/cli-grammar/ (it observes the daemon + cli-schema consumers) and now imports the package — its resetModules + 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.ts imports are the harder cut (the apps default is load-bearing — assertResolvedAppsFilter throws on undefined — and the constant sits behind the heavy contracts/device faç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-exportsparity with merge-base (68), no new unused export.
  • pnpm check:mcp-metadata, pnpm check:command-docs — pass.
  • oxlint + oxfmt — clean.
  • Affected unit-core suites (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.

…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.
@github-actions

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
Installed (including dependencies) 4.52 MB 4.52 MB 0 B
Package (unpacked) 4.52 MB 4.52 MB 0 B
Package (download) 1.33 MB 1.33 MB +4 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 21.8 ms 21.7 ms -0.2 ms
CLI --help 58.7 ms 58.7 ms -0.1 ms

@thymikee

Copy link
Copy Markdown
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 thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Sep 13, 2026
@thymikee
thymikee added this pull request to stack #2563 September 13, 2026 17:01
@thymikee
thymikee merged commit 4f5a87b into main Sep 14, 2026
19 checks passed
@thymikee
thymikee deleted the refactor/2543-command-registry-vocabulary branch September 14, 2026 09:27
@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-09-14 09:27 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