Repository navigation
refactor(catalog): break the catalogIdentity-recordedCatalogDigests import cycle - #11339
Merged
Merged
Conversation
src/recordedCatalogDigests.ts typed its recorded value with CatalogDigestProfiles from src/catalogIdentity.ts, which imports the recorded value, so the two files imported each other. The recorded file now declares the digest shape (plain type aliases, so they remain JsonValue-compatible) and catalogIdentity imports it. The layer baseline drops the cycle.
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. |
19 tasks
Contributor
[Low impact] The PR appears safe to merge; no blocking issues were found. SummaryMoves the digest types into
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
A["catalogIdentity.ts"] -->|"reads values and imports types"| B["recordedCatalogDigests.ts"]
B -.->|"imports profile type only"| C["config/mcpOutputSchemaProfile.ts"]
Reviews (3) · Last reviewed commit: "refactor(catalog): let the recorded dige..." · Reviewed by Greptile |
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.
Summary
Breaks the
catalogIdentity.ts <-> recordedCatalogDigests.tsmutual import: the recorded-digests file now declares the digest shape (CatalogDigests,CatalogDigestProfiles) andcatalogIdentity.tsimports it, instead of the recorded file importing the type back from the module that reads it. Part of plan W9 (layer enforcement).Problem and expected behavior
src/catalogIdentity.tsreadsRECORDED_CATALOG_DIGEST_PROFILESfromsrc/recordedCatalogDigests.ts, while that file typed the value withCatalogDigestProfilesimported fromcatalogIdentity.ts. Expected: the recorded data file is a leaf that owns its declared shape; the identity module computes values of that shape. No runtime change:scripts/record-catalog-digests.mjsstill replaces the compiled file with the recorded values.Change and scope
src/recordedCatalogDigests.ts: declaresCatalogDigests(tools_sha256,prompts_sha256,combined_sha256) andCatalogDigestProfiles(perMcpOutputSchemaProfile, imported type-only fromsrc/config/). Plain type aliases, because an interface is not assignable toJsonValue(typecheck caught this inDirectAnalysisStatus.ts).src/catalogIdentity.ts: drops its ownCatalogDigests = ReturnType<typeof digestCatalogs>andCatalogDigestProfilesand imports them from the recorded file. The computed digests are still assigned to the sameCatalogDigestsvariable as the recorded ones, so a shape drift fails typecheck.scripts/lib/module-layers.baseline.json: the cycle entry is removed.Not included: the other recorded cycles and the adapters-level imports from
application(catalogDiscovery,catalogIdentity,mcpStartupPolicy,serverIdentity). This touches lines next to, but not inside, the hunks of open #11298.Contribution scope: maintainer-approved W9 approach; no new capability.
Contract and boundary impact
src/recordedCatalogDigests.tsowns the recorded shape;src/catalogIdentity.tsowns computing it.docs/public/product-catalog.json), package, or installation impact: none.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
No target interaction changes: type declarations only.
Evidence and regression coverage
verify:module-boundariesreportedrecorded mutual import no longer present: catalogIdentity.ts <-> recordedCatalogDigests.tsbefore the baseline entry was removed.Validation performed
npm run verify:module-boundaries— passed; reported the cycle as gone.npm run check:fast(typecheck, lint, module boundaries, architecture guards) — passed.npm run test:local -- src/server/registerGuidedWorkflowTool.test.ts— 9 passed (usescreateCatalogDigests).Compatibility, safety, and release
Author readiness
Human owner:
Before merge
type(scope): outcome.