Skip to content

test(mcp): record the advertised-schema summary per tool - #11192

Merged
morluto merged 2 commits into
mainfrom
test/per-tool-advertised-schema-summary
Nov 15, 2026
Merged

morluto merged 2 commits into
mainfrom
test/per-tool-advertised-schema-summary

Conversation

@morluto

@morluto morluto commented Nov 15, 2026

Copy link
Copy Markdown
Owner

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 required build:cached and --update-summary locally. 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.mjs summarizes per tool: { schemas: { "<kind> <profile>": digest }, patterns: { input?: [...], output?: [...] } }. describeSummaryChanges rebuilds the pattern → sites view from all tools, so its lines are unchanged in form.
  • scripts/verify-advertised-schemas.mjs reads scripts/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-summary writes and deletes them.
  • The existing summary.json was split into 256 per-tool files from its recorded data (no rebuild), so the recorded state is unchanged.
  • Not included: generating the summary from source instead of the packaged catalog (option C in [Design] Record the advertised-schema summary per tool so concurrent tool PRs stop conflicting #11189).

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); consumer scripts/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

Validation performed

  • npx vitest run tests/boundary/mcp/advertisedCatalogSummary.test.ts: 3 passed
  • node scripts/verify/architecture-guards.mjs: passed
  • npx oxlint on the changed scripts and test: no errors
  • node --check scripts/verify-advertised-schemas.mjs: ok

Compatibility, safety, and release

  • Breaking changes or migration steps: none for users. Open PRs that edited summary.json instead add their tool's file (printed by the failing check).
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable.
  • 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.

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
@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-15T14:09:03.997529Z
We couldn’t complete this review. Comment @codex review to try again.
74dc981 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.

Re-split main's current summary.json into per-tool files.
@morluto
morluto merged commit b4cc1c9 into main Nov 15, 2026
7 checks passed
@morluto
morluto deleted the test/per-tool-advertised-schema-summary branch November 15, 2026 14:11
@greptile-apps

greptile-apps Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The reviewed code appears safe to merge, with file-repair tests still worth adding.

Fix All in CodexFindings

  1. P2 File repair lacks tests ▶
Fix with agent prompt
### Issue 1
scripts/verify-advertised-schemas.mjs:273-278
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.

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!

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Moves advertised-schema records into one file per tool while keeping grouped change messages and adding copyable file-repair output.

  • Advertised-schema summaries are now stored and checked one tool at a time, with aggregated pattern reporting retained.

Reviews (2) · Last reviewed commit: "Merge origin/main into test/per-tool-adv..." · Reviewed by Greptile

Comment on lines +273 to +278
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) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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!

Fix in Codex

@morluto morluto added the area: mcp MCP server, transport, and tool registration label Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: mcp MCP server, transport, and tool registration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Design] Record the advertised-schema summary per tool so concurrent tool PRs stop conflicting

1 participant