Skip to content

refactor(contracts): own catalog identity in contracts and server identity in process - #11435

Merged
morluto merged 5 commits into
refactor/cli-command-names-contractsfrom
refactor/catalog-identity-contracts
Nov 15, 2026
Merged

morluto merged 5 commits into
refactor/cli-command-names-contractsfrom
refactor/catalog-identity-contracts

Conversation

@morluto

@morluto morluto commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Summary

Implements the decision on #11427. The catalog identity, catalog discovery and recorded catalog digests move into src/contracts/catalog/, and the server identity moves into src/process/. The advertised MCP schema presentation moves into src/contracts/mcpSchemaPresentation.ts: the compact input and output budgets and presentations, the output profile names and advertisedToolPresentation. src/config keeps only the parsing of the REA_MCP_*_SCHEMA_PROFILE settings.

application -> catalogIdentity.ts (2), application -> catalogDiscovery.ts (1) and application -> serverIdentity.ts (1) leave the layer baseline.

Stacked on #11425, because catalogIdentity imports the CLI command names that #11425 moves into contracts. Part of plan W9. Fixes #11427. Refs #11359.

Problem and expected behavior

Doctor and DirectAnalysisStatus report the catalog and server identity, but both owners were root files that scripts/lib/module-layers.mjs places in the adapters layer, so application imported upward.

Expected: the catalog identity sits with the contracts it digests, and the server identity sits in a foundation unit. Application, the server and the doctor then import both inward.

Change and scope

  • Move (git mv plus specifier rewrites):
    • src/catalogIdentity.ts, src/catalogDiscovery.ts and src/recordedCatalogDigests.ts go to src/contracts/catalog/.
    • src/serverIdentity.ts goes to src/process/ServerIdentity.ts.
  • Server identity package root. The package-root lookup from import.meta.url now goes one more directory up, so package.root_path stays the package root from src/process/, dist/process/ and dist/src/process/.
    • Why process and not config: in config the module would import process/CurrentEntrypointPath, and process already imports config, which would add a new config <-> process mutual pair.
  • Presentation split. catalogIdentity read the advertised presentation from src/config, which is above contracts. The presentation facts now live in src/contracts/mcpSchemaPresentation.ts.
    • config/mcpOutputSchemaProfile.ts builds its zod enum from MCP_OUTPUT_SCHEMA_PROFILES.
    • config/mcpInputSchemaProfile.ts keeps only its setting parser.
    • There are no aliases or re-exports. 20 importers now import the moved names from the contracts file.
  • Built-path consumers. These now load dist/contracts/catalog/*.js (and dist/contracts/mcpSchemaPresentation.js):
    • record-catalog-digests, generate-skill-metadata, verify-package-pack, verify-claude-client, verify-copilot-client, lib/release-package-canary, lib/catalog-core and lib/canonical-output-schema;
    • the dist fixtures in generatedSkill, dependencyInstall and mcpDoctor;
    • the lazy-import list in cliStartupImports;
    • the missing-dist/ assertion in releaseArtifactCanary.
  • Baselines. The layer map drops the four root units. The ambient-host-platform baseline key is renamed to the new path.

Not included:

Contract and boundary impact

  • Semantic owner and earliest changed stage:
    • The catalog identity owner and the advertised schema presentation owner are now in contracts.
    • The server identity owner is now in process.
    • Configuration parsing is unchanged and still lives in config. Digests, schemas and identity output are unchanged.
  • Contribution scope fit and linked maintainer decision: W9 layering. The decision is posted on [Design] Owner below application for the catalog identity, server identity and MCP startup policy root files #11427. No new capability.
  • CLI and MCP/tool-catalog contract: none. Catalog digests are computed from the same contracts and presentations.
  • Provider, bridge, target-format, or platform compatibility: none.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact: built module paths change inside dist/. Every repository script and test that loads them by path is updated. The package entry points are unchanged.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated:

    • tests/boundary/mcp/serverIdentity.test.ts now asserts that package.root_path is the repository root. That guards the depth change.
    • The dist-path fixtures in generatedSkill, dependencyInstall, mcpDoctor and cliStartupImports follow the new paths.
  • Base reproduction or other evidence: node scripts/verify-module-boundaries.mjs no longer observes the three application-to-root edges, and their baseline entries are removed.

    • Before the presentation split, the check reported contracts -> config: 3. After the split it is gone.
    • With the server identity in config, the check reported a config <-> process mutual pair. In process it does not.
  • User-visible CLI/MCP output (if applicable): none.

  • Remaining proof gaps: the release canary, verify-package-pack and the client verifiers were not run. They load the updated paths, which the build emits, as ls dist/contracts/catalog/ confirmed.

  • 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 passed.
  • npm run build:cached: passed. dist/contracts/catalog/recordedCatalogDigests.js holds the recorded profiles.
  • npm run test:focused -- tests/boundary/mcp/serverIdentity.test.ts tests/boundary/cli/cliStartupImports.test.ts tests/boundary/mcp/outputSchemaProfile.test.ts tests/conformance/contracts/mcpInputSchemaProfile.test.ts tests/conformance/contracts/mcpOutputSchemaProfile.test.ts tests/boundary/cli/directAnalysisStatus.test.ts tests/boundary/filesystem/productCatalog.test.ts tests/boundary/mcp/compactInputSchemaMcp.test.ts tests/boundary/mcp/mcpDoctor.test.ts tests/boundary/filesystem/generatedSkill.test.ts
    • First run: 8 failures, from dist paths in generatedSkill and mcpDoctor.
    • After fixing them, those two files plus dependencyInstall: 46 passed. The other 8 files passed on the first run.
  • node scripts/verify-module-boundaries.mjs: passed.
  • After review: npm run test:focused -- tests/boundary/process/releaseArtifactCanary.test.ts passed 1 of 1. After merging refactor(contracts): own CLI command names, catalog identity and schema presentation in contracts #11425's update, npm run test:focused -- tests/boundary/mcp/toolSchemaValidity.test.ts tests/boundary/mcp/compactInputSchemaMcp.test.ts tests/boundary/mcp/serverIdentity.test.ts passed 39.

Compatibility, safety, and release

  • Breaking changes or migration steps: none. These are internal modules, and the package exports are unchanged.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable.
  • Package or release metadata impact: the built file locations inside dist/ change. The packaged entry points do not.
  • Security, privacy, process, or containment review: not applicable.

Author readiness

Human owner:

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-15T20:02:08.119824Z
We couldn’t complete this review. Comment @codex review to try again.
1c86192 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@greptile-apps

greptile-apps Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Low impact] The PR appears safe to merge; the previous release-test failure is addressed and no new issues were found.

Summary

Moves catalog identity and schema presentation into src/contracts/, and server identity into src/process/. Updates source imports, built-module paths, fixtures, and layer baselines.

  • Catalog identity and schema presentation now live with contracts.
  • Server identity now comes from the process foundation.

Reviews (3) · Last reviewed commit: "test(release): expect the catalog identi..." · Reviewed by Greptile

Comment thread scripts/lib/release-package-canary.mjs Resolved
…acts' into refactor/catalog-identity-contracts

# Conflicts:
#	scripts/lib/module-layers.baseline.json
#	tests/boundary/mcp/compactInputSchemaMcp.test.ts
#	tests/boundary/mcp/serverIdentity.test.ts
@morluto
morluto merged commit d0fae4e into refactor/cli-command-names-contracts Nov 15, 2026
2 checks passed
@morluto
morluto deleted the refactor/catalog-identity-contracts branch November 15, 2026 20:17
morluto added a commit that referenced this pull request Nov 15, 2026
…ma presentation in contracts (#11425)

* refactor(contracts): move the CLI command name owner into src/contracts

* refactor(contracts): own catalog identity in contracts and server identity 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

* test(mcp): import the catalog identity from contracts in syntheticContractSurfaces

* refactor(contracts): import CLI command names from contracts in the capability conformance test
@morluto morluto added the area: domain Domain logic, errors, and pure functions label Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: domain Domain logic, errors, and pure functions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant