Repository navigation
test(mcp): record the advertised-schema summary per tool - #11192
Conversation
summary.json held every advertised pattern's site list and every tool's schema digests in one file. Each new path-taking tool appended to the shared path pattern's list, so concurrent tool PRs conflicted on it, and updating it required a local build. Each tool's digests and patterns now live in scripts/verify/advertised-schemas/tools/<tool>.json. The check still prints aggregated review lines such as "N tool schemas gained pattern /.../", and on failure also prints the expected contents of each missing or stale file so a PR can commit them from CI output without building. --update-summary writes those files and deletes summaries of removed tools. The existing summary was split into per-tool files from its recorded data. Fixes #11189
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. |
Re-split main's current summary.json into per-tool files.
[Low impact] The reviewed code appears safe to merge, with file-repair tests still worth adding.
|
| if (update) { | ||
| await mkdir(summaryDirectory, { recursive: true }); | ||
| for (const [file, text] of stale) | ||
| await writeFile(join(summaryDirectory, file), text, "utf8"); | ||
| for (const file of removed) await rm(join(summaryDirectory, file)); | ||
| } else if (stale.length > 0 || removed.length > 0) { |
There was a problem hiding this comment.
The new tests call only summarizeAdvertisedCatalogs and describeSummaryChanges. They never exercise the new file checks, printed replacement contents, or deletions, so those paths can break while all three tests stay green.
As a non-blocking improvement, add a temporary-directory test with missing, stale, and removed tools. Check that comparison prints the expected contents and fails without writing. Then check that --update-summary writes and deletes the right files and a second comparison passes.
Prompt To Fix With AI
This is a comment left during a code review.
Path: scripts/verify-advertised-schemas.mjs
Line: 273-278
Comment:
**File repair lacks tests**
The new tests call only `summarizeAdvertisedCatalogs` and `describeSummaryChanges`. They never exercise the new file checks, printed replacement contents, or deletions, so those paths can break while all three tests stay green.
As a non-blocking improvement, add a temporary-directory test with missing, stale, and removed tools. Check that comparison prints the expected contents and fails without writing. Then check that `--update-summary` writes and deletes the right files and a second comparison passes.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Summary
Fixes #11189. Records the advertised-schema summary as one file per tool, so PRs that add different tools no longer conflict on
summary.json, and a stale or missing summary can be fixed from the CI log without a local build.Problem and expected behavior
scripts/verify/advertised-schemas/summary.json(#10985) held, in one file, each pattern's list of<tool> <kind>sites and each tool's schema digests. Every new path-taking tool appended to the shared absolute-path pattern's list, so concurrent tool PRs conflicted on the same array. Updating it requiredbuild:cachedand--update-summarylocally. Observed while updating nine open tool PRs against main.Expected: adding a tool touches only that tool's summary, and review still shows aggregated lines when a change reaches many tools at once (#10830).
Change and scope
scripts/lib/advertised-catalog-summary.mjssummarizes per tool:{ schemas: { "<kind> <profile>": digest }, patterns: { input?: [...], output?: [...] } }.describeSummaryChangesrebuilds the pattern → sites view from all tools, so its lines are unchanged in form.scripts/verify-advertised-schemas.mjsreadsscripts/verify/advertised-schemas/tools/*.json. On mismatch it prints the aggregated lines, then each missing or stale file's expected contents and each file to delete.--update-summarywrites and deletes them.summary.jsonwas split into 256 per-tool files from its recorded data (no rebuild), so the recorded state is unchanged.Contribution scope: test tooling only; not applicable.
Contract and boundary impact
Semantic owner and earliest changed stage:
scripts/lib/advertised-catalog-summary.mjs(summary representation); consumerscripts/verify-advertised-schemas.mjs. The single-file representation is removed.Contribution scope fit and linked maintainer decision: [Design] Record the advertised-schema summary per tool so concurrent tool PRs stop conflicting #11189 (design discussion).
CLI and MCP/tool-catalog contract: none; advertised schemas are unchanged.
Provider, bridge, target-format, or platform compatibility: none. Windows still skips the comparison.
Evidence, artifact, provenance, or reconstruction contract: none.
Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable.
Generated metadata, package, or installation impact: none.
Documentation or usability only; no target interaction.
Evidence and regression coverage
tests/boundary/mcp/advertisedCatalogSummary.test.ts. A tool's record is unaffected when another tool is added, a pattern reaching many tools aggregates into one review line, and records are per tool and sorted.summary.jsonand the deletedadvertisedDialectBaseline.tsacross feat(artifacts): inspect NuGet package metadata and dependencies #10351, feat(artifacts): inspect Maven POM and Gradle module metadata #10353, feat(artifacts): inspect RPM package headers and dependency metadata #10677, feat(artifacts): inspect Debian package control metadata and contents #10689, feat(elf): inspect dynamic dependencies and required symbol versions #7868, feat(evidence): project Go and Rust dependencies as CycloneDX #8445, feat(native): inspect DWARF compile units offline #8523, feat(artifacts): inspect Android boot image components #9487, feat(elf): report separate debug-file linkage and verify a candidate debug file #9560.verify:advertised-schemasrun (packaged build plus client regex/schema engines) was not run locally; CI's Linux schema-engine job exercises the comparison against the migrated files.Validation performed
npx vitest run tests/boundary/mcp/advertisedCatalogSummary.test.ts: 3 passednode scripts/verify/architecture-guards.mjs: passednpx oxlinton the changed scripts and test: no errorsnode --check scripts/verify-advertised-schemas.mjs: okCompatibility, safety, and release
summary.jsoninstead add their tool's file (printed by the failing check).Author readiness
Human owner:
Before merge
type(scope): outcome.