Skip to content

refactor(catalog): break the catalogIdentity-recordedCatalogDigests import cycle - #11339

Merged
morluto merged 1 commit into
mainfrom
refactor/catalog-digest-shape
Nov 15, 2026
Merged

morluto merged 1 commit into
mainfrom
refactor/catalog-digest-shape

Conversation

@morluto

@morluto morluto commented Nov 15, 2026

Copy link
Copy Markdown
Owner

Summary

Breaks the catalogIdentity.ts <-> recordedCatalogDigests.ts mutual import: the recorded-digests file now declares the digest shape (CatalogDigests, CatalogDigestProfiles) and catalogIdentity.ts imports 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.ts reads RECORDED_CATALOG_DIGEST_PROFILES from src/recordedCatalogDigests.ts, while that file typed the value with CatalogDigestProfiles imported from catalogIdentity.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.mjs still replaces the compiled file with the recorded values.

Change and scope

  • src/recordedCatalogDigests.ts: declares CatalogDigests (tools_sha256, prompts_sha256, combined_sha256) and CatalogDigestProfiles (per McpOutputSchemaProfile, imported type-only from src/config/). Plain type aliases, because an interface is not assignable to JsonValue (typecheck caught this in DirectAnalysisStatus.ts).
  • src/catalogIdentity.ts: drops its own CatalogDigests = ReturnType<typeof digestCatalogs> and CatalogDigestProfiles and imports them from the recorded file. The computed digests are still assigned to the same CatalogDigests variable 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

  • Semantic owner and earliest changed stage: src/recordedCatalogDigests.ts owns the recorded shape; src/catalogIdentity.ts owns computing it.
  • Contribution scope fit and linked maintainer decision: W9 layer enforcement.
  • CLI and MCP/tool-catalog contract: none; digests and their field names are unchanged.
  • 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): none.
  • Generated metadata (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.

  • 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.

No target interaction changes: type declarations only.

Evidence and regression coverage

  • Tests added or updated: none; the change is type-only. verify:module-boundaries reported recorded mutual import no longer present: catalogIdentity.ts <-> recordedCatalogDigests.ts before the baseline entry was removed.
  • Base reproduction or other evidence: see above.
  • User-visible CLI/MCP output (if applicable): none.
  • Remaining proof gaps: the built catalog-digest recording was not rerun locally.

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 (uses createCatalogDigests).
  • Pre-push hook — passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: none needed.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: none.

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.

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.
@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-15T16:36:00.221011Z
We couldn’t complete this review. Comment @codex review to try again.
aef8fbf 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

[Low impact] The PR appears safe to merge; no blocking issues were found.

Summary

Moves the digest types into recordedCatalogDigests.ts so the recorded data no longer depends on catalogIdentity.ts.

  • The recorded-digest file now owns the catalog digest types.

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"]
Loading

Reviews (3) · Last reviewed commit: "refactor(catalog): let the recorded dige..." · Reviewed by Greptile

@morluto
morluto merged commit bd9f2cc into main Nov 15, 2026
7 checks passed
@morluto
morluto deleted the refactor/catalog-digest-shape branch November 15, 2026 16:51
@morluto morluto added the area: evidence Evidence, artifacts, and reconstruction label Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: evidence Evidence, artifacts, and reconstruction

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant