Repository navigation
refactor(contracts): own CLI command names, catalog identity and schema presentation in contracts - #11425
Conversation
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
[Low impact] The PR appears safe to merge; no actionable issue was found. SummaryMoves CLI names, catalog identity, and MCP schema presentation into
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
Adapters["CLI and MCP adapters"] --> Catalog["contracts/catalog"]
Adapters --> Presentation["contracts/mcpSchemaPresentation.ts"]
Config["config: setting parsers"] --> Presentation
Catalog --> Presentation
Catalog --> Names["contracts/cliCommandNames.ts"]
Composition["composition"] --> Names
Application["application"] --> Catalog
Application --> Identity["process/ServerIdentity.ts"]
Reviews (6) · Last reviewed commit: "refactor(contracts): import CLI command ..." · Reviewed by Greptile |
…names-contracts # Conflicts: # scripts/lib/module-layers.baseline.json
…ntity in process (#11435) * refactor(contracts): move catalog identity into contracts and server identity into process * refactor(contracts): own the advertised MCP schema presentation in contracts * test(mcp): import the advertised presentation from contracts in toolSchemaValidity * test(release): expect the catalog identity at its contracts path in the canary
…names-contracts # Conflicts: # scripts/lib/module-layers.baseline.json # scripts/lib/module-layers.mjs
|
@greptileai please review the latest commit (103d02b). It now also carries #11435 (folded in). |
# Conflicts: # scripts/verify/baselines/ambient-host-platform.json # src/composition/evm.ts
…apability conformance test
Conflicts: - src/contracts/toolEffects.ts: main morluto#11305 moved each tool's effect audit onto its contract. Take main's file; inspect_pe_rich_header now declares evidenceEffects through toolContractMetadata. - src/cliCommandNames.ts: main morluto#11425 deleted it and derives CLI names from `cli: true` on the contract. Drop our entry, mark the contract `cli: true`, and stop passing `command` to registerContractCommand.
Summary
Moves
src/cliCommandNames.tstosrc/contracts/cliCommandNames.tswithgit mvand specifier rewrites. The file holdscliCommandFor, which derives a contract's CLI command name from the contract name, andCLI_COMMANDS, the CLI commands that no contract names. It has no imports. Its own comment says the contract registry owns these names.As a root-level file it sat in the adapters layer. That made three composition modules (apkSignature, evm, wasm) and
catalogIdentity.tsimport upward. Thecomposition -> cliCommandNames.tsupward entry (3 imports) leaves the layer baseline.This PR also carries #11435, which was folded into it. #11435 implements the decision on #11427:
catalogIdentity.ts,catalogDiscovery.tsandrecordedCatalogDigests.tsmove tosrc/contracts/catalog/.serverIdentity.tsmoves tosrc/process/ServerIdentity.ts.advertisedToolPresentation) moves tosrc/contracts/mcpSchemaPresentation.ts.src/configkeeps only the setting parsers.With that,
application -> catalogIdentity.ts(2),catalogDiscovery.ts(1) andserverIdentity.ts(1) also leave the baseline. See #11435 for its full description and validation.Part of plan W9 (root-file adapter imports). Fixes #11427. Refs #11359.
Problem and expected behavior
Composition binds a few providers to their CLI command names, and the catalog identity digests the CLI command list. Both read
src/cliCommandNames.ts, a root file thatscripts/lib/module-layers.mjsplaces in the adapters layer, the outermost one. Expected: the command-name owner lives in the layer of the contract registry that names those commands, so composition and catalog code import inward.Change and scope
src/cliCommandNames.tstosrc/contracts/cliCommandNames.ts, with 34 importers rewritten (CLI modules, composition, catalog identity and tests).scripts/ci/scopes.mjs: the 8 lane globs that named the old path now name the new one.scripts/lib/module-layers.mjs: the unitcliCommandNames.tsis removed from the adapters list, becausesrc/contractsis already declared.scripts/lib/module-layers.baseline.json:composition -> cliCommandNames.ts(3) is removed.Not included:
mcpStartupPolicy.ts, which merged separately in refactor(config): move the MCP startup policy beside its startup budgets in src/config #11429.mainalready reports as lowerable (process -> artifacts,application <-> dotnet). refactor(architecture): add the ports and resources layers, move ports and shared resource owners there, and ratchet the layer baseline #11208 lowers those.Contract and boundary impact
src/intosrc/contracts/, and the code is unchanged.docs/public/product-catalog.json), package, or installation impact: none. No script loadsdist/cliCommandNames.js.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
Tests added or updated: none. The rewritten tests (13 files) and
tests/boundary/filesystem/ciChangeScope.test.tsrun unchanged apart from specifiers.Base reproduction or other evidence:
node scripts/verify-module-boundaries.mjsreportscomposition -> cliCommandNames.ts: 0, baseline 3after the move. That entry is removed.User-visible CLI/MCP output (if applicable): none.
Remaining proof gaps: none known.
Observed, derived, and inferred claims remain distinguishable.
Artifact identity, source provenance, and failed attempts remain preserved.
Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.
Validation performed
npm run check:fast: passed. The pre-push hook also passed.npm run test:focused -- <the 13 rewritten tests> tests/boundary/filesystem/ciChangeScope.test.ts tests/boundary/filesystem/productCatalog.test.ts tests/composition/evmModuleContract.test.ts: 476 passed, 8 skipped.npm run verify:test-discovery: all 3678 test files discovered exactly once.node scripts/verify-module-boundaries.mjs: passed. It still reports the two lowerable entries that already exist onmain.npm run check:fastpassed.npm run test:focused -- tests/boundary/mcp/syntheticContractSurfaces.test.ts(a new file on main that imported the old path): 1 passed.Compatibility, safety, and release
The squash is no longer a pure move, because it also carries #11435's presentation split and server-identity root fix. It will not be listed in
.git-blame-ignore-revs.Author readiness
Human owner:
Before merge
type(scope): outcome.