Skip to content

fix(ci): validate artifact MCP replies against named schemas - #6021

Merged
gensokyo-dev merged 2 commits into
mainfrom
fix/artifact-mcp-output-validation-20261021
Oct 21, 2026
Merged

gensokyo-dev merged 2 commits into
mainfrom
fix/artifact-mcp-output-validation-20261021

Conversation

@gensokyo-dev

@gensokyo-dev gensokyo-dev commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A fresh MCP SDK client has no held tools/list, so the artifact verification helper can skip output-schema validation. A real stdio boundary probe changed result.canonical_path from string to number while retaining the caller path: the old helper passed, although the advertised contract requires a string.

Discover actual tool definitions once per negotiated REA connection and bind lifecycle/analysis calls to the named SDK schema. Reject absent schemas, duplicate names and caller-supplied schema overrides. Share concurrent discovery, discard failed loads and rebind on reconnect. Preserve request options and attempt both owned cleanup operations while retaining the primary error. Raw artifact calls share this owner; the duplicated native-provenance definition index is removed. Existing provider/parity/identity assertions remain. Verification scope only; no new provider capability or authority.

Validation

PR head f734d463c9fe881887d454ee20e5ded2b614b11b; full PR CI tested merge preview 760a75011 with main 2319166c2. Node 24.18.0/npm 11.16.0; four-core affinity, two compiler checkers, one test worker and serial Turbo.

  • Regression guards fail on the old behavior for corrupted ordinary/space/Unicode paths and a permissive supplied schema, then pass with the fix. All 11 cases cover healthy output, discovery reuse/concurrency, same-client reconnect, absent/ambiguous schemas, override rejection and timeout preservation. Faults alter only the client boundary after real REA requests.
  • On this rebased integration:235 tests passed across 15 files;12 macOS-only native plist CLI cases skipped locally and are selected in the real Apple CI lane. This includes all changed test files from five intervening main fixes plus this PR's guard. Completed in 150.8s,201.3 CPU seconds,1684MiB sampled family RSS. npm run check passed (28.3s,54.0 CPU seconds,1530MiB); diff checks passed. The earlier cleanup/SDK/routing guard set passed 284 tests with no skips.
  • Complete PR CI passed on its first attempt:40 jobs passed,1 intentional Source-test skip;24,246 portable tests passed with200 named skips (1900 files passed,24 skipped). Real Apple, Windows, browser and all native-package lanes passed. Apple boundary regressions:271 passed,4 conditional skips. Greptile reviewed this head at5/5; Codex completed review of the actual merge commit f86206535 without findings. The actionable supplied-schema finding is fixed and resolved.
  • Main then advanced to 8e3bf56e1. Its conflict-free integration with this PR has tree ce5264688d5ed5198e6607edd061a6ad041629cd:complete static checks passed, and287 tests passed with1 named skip across11 files (all ten newly changed test files plus this PR guard). This ran391.8s,406.7 CPU seconds,1999MiB sampled family RSS. Full qualification of the actual merge commit passed on its first attempt:24,272 portable tests passed,200 named skips,1901 files passed and24 skipped, with all selected real-platform lanes passing. The earlier main feedback failure at 8e3bf56e1 exposed an unrelated fluctuating heap-observation fixture; its reproduced structural fix is fix(ci): use one heap snapshot for JavaScript admission #6081.

Two-session admission/close measurements on the earlier 6d356b843 runtime: warm filesystem, fresh parent process, separate initially empty child compile-cache roots, equivalent replies with SDK validation active:

Workflow Elapsed CPU Sampled family RSS
SDK validates all listed tools 21.9s 27.5s 1045MiB
Actual helper selects named schemas 12.2s 16.7s 666MiB

The original unvalidated helper took 4.4s and is not an equivalent baseline. RSS samples can double-count shared pages/miss short children. Agent tokens and whole-Apple-job speedup are unmeasured; the historical Apple 15m cancellation's cause is not established by this fix. Linux resource-only admission does not prove native provider behavior; current real-platform CI must pass before merge.

Author readiness

Human owner: @gensokyo-dev

Declarations entered under the user's explicit delegation; independent human review was not observed in this session.

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T15:31:16.228712Z f862065 Manual request
ℹ️ 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.

@gensokyo-dev

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review exact head e105a9c. A real stdio reply with canonical_path:number was accepted by the fresh unlisted SDK client; the forged guard failed before and passes after named-schema binding. Check connection-scoped static REA schema ownership, same-client reconnect, duplicate-name rejection, request options and both cleanup owners. Nine new guards and284 related tests passed; fullci:full run39611862870 is pending. Native Apple/browser/Windows coverage must come from executed CI, not the Linux admission probe.

@greptile-apps

greptile-apps Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable defects were found.

Summary

Artifact verification now selects each tool’s advertised output schema through one shared helper.

  • Artifact verifier calls now check replies against the advertised tool schema.
  • Artifact verifiers attempt both cleanup steps after a check fails.

The merge-base checks differed, so the full PR diff was reviewed as changes since the last review. Tests were not run locally. Live supersession status could not be checked because GitHub access was unavailable.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Artifact verification call] --> B{Caller supplied toolDefinition?}
  B -->|Yes| C[Reject before dispatch]
  B -->|No| D[Get advertised definitions for connection]
  D --> E[Require unique tool name and output schema]
  E --> F[Call SDK with selected definition and request options]
  F --> G[Return reply or validation error]
Loading

Reviews (4) · Last reviewed commit: "fix(ci): reject artifact MCP schema over..." · Reviewed by Greptile

Comment thread scripts/lib/artifact-e2e.mjs Resolved
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: e105a9cda4

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@gensokyo-dev

Copy link
Copy Markdown
Collaborator Author

@codex review

@gensokyo-dev

Copy link
Copy Markdown
Collaborator Author

@greptileai review

Please re-review the schema ownership fix at 3d8410f. The supplied-definition bypass is now rejected before dispatch; the red-before/green-after regression and preservation of explicit request timeouts both pass. Full CI is running on this exact revision.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 3d8410fae3

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

A fresh SDK client has no cached tools/list, so generic tool calls in artifact
verification can skip their output schema. Bind actual advertised definitions
before lifecycle and analysis calls; compile only the selected schema, reuse
one discovery within a negotiated connection and invalidate across reconnects.

Keep request options, all existing provider assertions and both cleanup owners.
Remove the duplicated provenance definition index and raw artifact call paths.

A real stdio boundary fault changes canonical_path from string to number: the
unfixed helper accepts it, while the selected SDK schema rejects it. Preserve
healthy, space/Unicode, missing-schema, ambiguous-catalog and connection reuse
controls. No production provider authority or CLI/MCP contract change.

Assisted-by: Reimu (gensokyo-skills:reimu-incident-triage)
Assisted-by: Kogasa (gensokyo-skills:kogasa-surprise-testing)
Keep schema selection with the advertised-catalog owner while preserving
request options. Prove that a permissive override accepts a corrupted
real reply before the fix, then rejects it before dispatch afterwards.

Assisted-by: Reimu (gensokyo-skills:reimu-incident-triage)
Assisted-by: Kogasa (gensokyo-skills:kogasa-surprise-testing)
@gensokyo-dev
gensokyo-dev force-pushed the fix/artifact-mcp-output-validation-20261021 branch from 3d8410f to f734d46 Compare October 21, 2026 14:56
@gensokyo-dev

Copy link
Copy Markdown
Collaborator Author

@codex review

@greptileai review

Rebased onto current main 2319166, producing f734d46. Both authored patches are identical by git range-diff; the preceding head passed complete CI (24,222 portable tests) and both reviews. This revision also incorporates five intervening runtime fixes, so full CI is running again to qualify the integration.

@gensokyo-dev

Copy link
Copy Markdown
Collaborator Author

@codex review

@gensokyo-dev

Copy link
Copy Markdown
Collaborator Author

@greptileai review

@gensokyo-dev
gensokyo-dev merged commit f862065 into main Oct 21, 2026
51 checks passed
@gensokyo-dev
gensokyo-dev deleted the fix/artifact-mcp-output-validation-20261021 branch October 21, 2026 15:28
@github-actions github-actions Bot mentioned this pull request Oct 21, 2026
3 tasks done
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: f86206535f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@morluto morluto added area: build Build, CI, packaging, and publishing bug Something isn't working labels Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: build Build, CI, packaging, and publishing bug Something isn't working ci:full

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants