Skip to content

refactor(cli-schema): orient the schema layer above commands (#2543 step 3) - #2590

Merged
thymikee merged 2 commits into
mainfrom
t3code/implement-2543-step-3
Sep 14, 2026
Merged

thymikee merged 2 commits into
mainfrom
t3code/implement-2543-step-3

Conversation

@thymikee

Copy link
Copy Markdown
Member

Summary

Step 3 of #2543. Orients the CLI/MCP schema layer above commands (not below) — the honest direction: a package cannot import src, and cli-schema renders what the command facets author. Both zones are rank 3, so the gate never ordered them; R2 declares it now.

  • Move CommandSchema / CommandSchemaOverride from src/cli-schema/types.ts into packages/command-registry (@agent-device/command-registry/command-schema), beside the flag grammar they already import. Retires the 22 forward commands → cli-schema type edges.
  • cli-config.ts takes projectConfigFlagKeys from the registry directly instead of through command-schema.ts.
  • Relocate command-explain.ts from src/commands into src/cli (it renders the schema and already types against the daemon route union) — the last commands → cli-schema value edges, and it also retires the last commands → daemon-server type inversion.
  • Gate: R2 commands-floor now rejects any commands → cli-schema import of any kind.

After the change commands → cli-schema is 0 of any kind; cli-schema → commands (reading the facet aggregate) is the declared direction. No CLI/help/MCP behavior change. 35 files, +79/-44.

Validation

Head 9e61949. Green on the commit: check:layering (235/235 + check OK; R4=0, R5=0, R6 4→3, R9 6, R11 301 subpaths), typecheck, check:package, check:mcp-metadata, check:production-exports (parity 68), check:fallow, eager-closure-budgets (612), help-conformance, command-doc-coverage, and check:affected's vitest-related lane (1258 tests). lint + format:check clean.

Pre-existing, unrelated: check:affected's mutation-model stage fails on scripts/mutation/ownership.test.ts (gestures.test.ts → scroll-edge-state). Verified it fails identically at the merge-base 730b20149e — the same failure #2562 recorded. A parallel lint lane flaked under concurrent subprocess load; standalone pnpm lint is exit 0.

…ove commands (#2543)

Move CommandSchema/CommandSchemaOverride from src/cli-schema/types.ts into
packages/command-registry beside the flag grammar they import, retiring 22
forward type-only commands -> cli-schema edges. Take projectConfigFlagKeys
directly from the registry in cli-config. Relocate command-explain.ts up into
the cli zone (it renders the schema and already type-depends on the daemon
route union), retiring the last commands -> cli-schema value edges.

commands -> cli-schema is now 0 of any kind; cli-schema -> commands (the facet
aggregate) is the honest direction: the schema layer renders what the facets
author.
…#2543)

Add the from:commands to:cli-schema policy so the declared direction (cli-schema
reads the command facets; commands never imports cli-schema) cannot regress.
R6 4 -> 3 (command-explain moved above daemon-server). Update the R2 hint, the
check spine comment, and the surviving-inversion notes in the findings doc.
@github-actions

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
Installed (including dependencies) 4.53 MB 4.53 MB 0 B
Package (unpacked) 4.53 MB 4.53 MB 0 B
Package (download) 1.34 MB 1.34 MB -1 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 26.1 ms 25.9 ms -0.2 ms
CLI --help 74.8 ms 75.9 ms +1.1 ms

@thymikee

Copy link
Copy Markdown
Member Author

Looks good at 9e61949. The schema types move into @agent-device/command-registry/command-schema with no shim left behind, command-explain moves to src/cli with its test, and the new R2 row rejects every kind of import from commands into cli-schema. I found no CLI, help or MCP behavior change. CI is green, the size report shows no growth, and there are no conflicts.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Sep 14, 2026
@thymikee
thymikee merged commit b1c068d into main Sep 14, 2026
18 checks passed
@thymikee
thymikee deleted the t3code/implement-2543-step-3 branch September 14, 2026 14:15
@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-09-14 14:16 UTC

thymikee added a commit that referenced this pull request Sep 14, 2026
…tle-on-exit-2522

* origin/main:
  perf(scroll-until): answer every candidate from one visibility index (#2596)
  refactor(daemon): resolve device interactors through a composed capability (#2593)
  refactor(daemon): stop the client value-importing daemon internals (#2559) (#2594)
  refactor(shell-quote): one implementation, reached through the runner host port (#2595)
  docs(agents): delete the file-size tiers nobody enforces (#2597)
  fix(daemon): key the implicit session by workspace and platform (#2587)
  refactor(cli-schema): orient the schema layer above commands (#2543 step 3) (#2590)
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