Repository navigation
test(mcp): compile advertised patterns with the regex engines clients run - #10982
Conversation
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. |
[Medium impact] The PR appears safe to merge; no blocking issues were found. SummaryThis PR checks advertised MCP patterns and schemas with the engines clients use.
No new actionable or security issues were found. This was a source review; builds and engine checks were not run here. Live PR status could not be checked because GitHub authentication was unavailable. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Built or installed package] --> B[List MCP catalogs]
B --> C[Collect distinct schemas and patterns]
C --> D[Run client engines and validators]
B --> E[Compare committed catalog summary]
D --> F{All required checks pass?}
E --> F
F -->|No| G[Exit with failure]
F -->|Yes| H[Check succeeds]
Reviews (3) · Last reviewed commit: "test(mcp): load advertised schemas in th..." · Reviewed by Greptile |
eab7715 to
fc8d966
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
@greptileai please re-review head fc8d966 (rebased onto main 1151763). Issue 1 (helper children outlive the timeout) is fixed: helpers run under the verifier command owner ( |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
… run List the built package's tools over stdio in every input, output and catalog profile and compile each distinct advertised regular expression with V8 (plain, u, v), Go regexp (RE2), C++ RE2, Python re, and Rust regex and fancy-regex through the Rust jsonschema crate. A refusal names the engine, its error, and each tool, schema path and profile. The Python engines are pinned, hash-checked wheels; Go is the host toolchain with GOTOOLCHAIN=local. A missing engine is reported as not verified, and REA_REQUIRE_SCHEMA_ENGINES=1 makes it a failure. The pattern owner now also reports patternProperties keys, which clients compile as well. Refs #10830
…10983) * test(mcp): load advertised schemas in the validators clients build Build a validator for every distinct advertised input and output schema with the Rust jsonschema crate's defaults, which check the declared draft's meta-schema and formats and compile every subschema. --complete adds Python jsonschema's check_schema, which jsonschema.validate runs in Python clients; it takes several seconds, so it is opt-in. Refusals are grouped by reason, so one shared pattern that breaks many schemas is reported once with its sites. Ajv strict mode and OpenAI strict mode are documented as not covered, with the reasons. Refs #10830 * ci(mcp): require the client schema engines on every code change (#10984) * ci(mcp): require the client schema engines on every code change Run scripts/verify-advertised-schemas.mjs at the end of the build job, after its artifacts upload, with REA_REQUIRE_SCHEMA_ENGINES=1 so a missing engine fails rather than passes. Go is the runner's toolchain; the Python engines install into a virtual environment cached by the requirements file's digest and interpreter version. Full qualification adds --complete. Refs #10830 * test(ci): require the client schema engine step in code builds * test(mcp): record a reviewable summary of the advertised catalog (#10985) * test(mcp): record a reviewable summary of the advertised catalog Commit scripts/verify/advertised-schemas/summary.json: each advertised pattern with the tool schemas that carry it, and a digest of every tool's schema per input or output profile. The advertised schema check compares it with the packaged listings it already makes and fails on any difference, printing lines such as '119 tool schemas gained pattern /.../', so a change that reaches many tools at once is visible in review. --update-summary regenerates it. Refs #10830 * docs(release): check the packed catalog with client engines before publishing (#10986) * docs(release): check the packed catalog with client engines before publishing Add a pre-publish step to the release guide: install the packed candidate into an empty prefix and run verify-advertised-schemas.mjs against it with --package-root, requiring the RE2 (Go regexp and C++ RE2) and Rust (regex, fancy-regex and jsonschema) engines. CI checks each commit's build; this covers the archive that will be published. Refs #10830 * docs(release): check the exact qualified archive and clean up afterwards
761c2b1 to
12f7756
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Summary
Combined stack. #10983 (Rust/Python
jsonschemavalidators), #10984 (required CI step in the build job plus its workflow policy test), #10985 (committedsummary.jsonof the advertised catalog) and #10986 (release-guide check of the qualified archive) were collapsed into this PR; their bodies hold the details and the re-run regression proof for #11040 (in #10983). Rebased onto main 598a0c4, andsummary.jsonwas regenerated from that main's catalog (8 tool schemas changed since 1151763; no pattern changes). This PR changespackage.json(one script), so it needs full CI.Compile every regular expression the packaged server advertises, in every schema profile, with the regex engines clients and gateways actually run, so a pattern one of them cannot compile is caught before merge. Refs #10830.
First of five stacked PRs: engines (this), validators, CI wiring, catalog summary, release-gate docs.
Problem and expected behavior
rea-agents 6.9.0 advertised
^[^\uD800-\uDFFF]*$on every local path input. RE2 (Go gateways) and Rustregex/jsonschemaclients cannot compile it, and those clients refuse the wholetools/list, so no tool was usable (#10830). Advertised schemas were only checked with Ajv/V8, so tests passed. #10567 added a rule-based portable grammar, and #10582 now re-emits patterns in it, but neither runs a real engine.Expected: a pattern any supported engine refuses fails a named check, with the engine, its error, and each tool, schema path and profile that advertises it.
Change and scope
scripts/lib/advertised-catalog.mjslists tools from the built package's stdio entry (scripts/rea.mjs mcp, the same entry an installed client starts) for every catalog profile, pairing input and output profiles in turn: 6 server processes, run concurrently, cover all 712 distinct advertised schemas. I checked that against listing all 12 combinations. The full product would only repeat schemas, andadvertisedDialect.test.tsalready lists it in process.scripts/verify-advertised-schemas.mjs(npm run verify:advertised-schemas) deduplicates patterns (180 on current main) and compiles each one once per engine, one process per toolchain:uandv, in process;regexp(RE2) throughgo runof a stdlib-only file, withGOTOOLCHAIN=localso nothing is ever downloaded;google-re2), Pythonre, and Rustregexandfancy-regexthrough the Rustjsonschemacrate (jsonschema-rs), in one Python process.jsonschema-rsruns the actual Rust crate, with both regex backends selectable.requirements.txtpins wheels only (--only-binary=:all:,--require-hashes, PyPI wheel digests). jsonschema-rs is pinned to 0.60.3 (2026-10-27), not 0.61.x, so it is more than two weeks old.scripts/lib/verify-commands.mjs→runOwnedCommandinsrc/process/), which applies a 120 s deadline to the whole process group (go runstarts a grandchild) and drains output; the request is a file argument. Listings use the owned MCP stdio transport (scripts/lib/owned-mcp-stdio.mjs). Each temporary root is aVerifierFixture, removed only after its processes are confirmed stopped. A refusal prints the engine's headline, the first complete explanation, every affected tool and the first exact locations.not verified, never as passed.REA_REQUIRE_SCHEMA_ENGINES=1turns it into a failure (CI sets it in the CI wiring PR). Nothing installs engines on a developer machine.--package-root=DIRlists an installed package instead of the checkout, for the release-gate step in the last PR.advertisedSchemaPatterns(the pattern owner inadvertisedDialect.ts) now also reportspatternPropertieskeys, which clients compile too, so the dialect rules and this check cover them. No current schema advertisespatternProperties, so baseline counts are unchanged.Not included: validators (next PR), CI wiring, the catalog summary and docs (later PRs). Raw
regex::Regex::newcallers that skip thejsonschemacrate's ECMA-262 translation are covered only by the portable-grammar rules.Contract and boundary impact
Semantic owner and earliest changed stage:
advertisedSchemaPatternsinsrc/contracts/advertisedDialect.tsstays the single owner of "which strings are advertised regexes"; the new script consumes it fromdist.Contribution scope fit and linked maintainer decision: test and verification tooling only; not applicable.
CLI and MCP/tool-catalog contract: unchanged.
Provider, bridge, target-format, or platform compatibility: none. The script runs on POSIX and Windows hosts; on Windows the Python default is
python.Evidence, artifact, provenance, or reconstruction contract: none.
Target selection, authority, upstream behavior, and cleanup details (if applicable): the listing uses a temporary HOME per server process, owned by a
VerifierFixtureand removed after the server is stopped.Generated metadata, package, or installation impact: none; no new npm dependency.
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.
Evidence and regression coverage
advertisedDialect.test.tscoverspatternPropertieskeys as advertised patterns, including theunicode-escaperefusal..regex(/^[^\uD800-\uDFFF]*$/u)tolocalPathStringSchemaalone no longer reachestools/list(every engine then accepted 181/181 patterns). The probe therefore also madeprojectPortablePatternreturn that one pattern unchanged, simulating the 6.9.0 advertisement ([Bug] MCP tool schemas contain surrogate code-point regex patterns rejected by DeepSeek's schema validator #11040, [Bug] #10830). The check exited 1:reaccepted it, which is why the earlier tests missed it. Both probe edits were reverted; the clean rebuild passes. The validator PR (test(mcp): load advertised schemas in the validators clients build #10983) carries the Rustjsonschemaresult, which matches DeepSeek's error in [Bug] MCP tool schemas contain surrogate code-point regex patterns rejected by DeepSeek's schema validator #11040.regex-crate clients are not run directly. CI runs the script once the CI wiring PR is in the stack.Validation performed
node scripts/verify-advertised-schemas.mjs(afternpm run build:cached) with the pinned wheels in a scratch venv andREA_REQUIRE_SCHEMA_ENGINES=1, on main 1151763: all 180 patterns accepted by all 8 engines (exit 0).REA_SCHEMA_ENGINES_PYTHON=/nonexistent/python: the four Python engines are reportednot verified (… could not start (ENOENT)); withREA_REQUIRE_SCHEMA_ENGINES=1the run fails naming each.REA_SCHEMA_ENGINES_PYTHON=/usr/bin/false: reported as failed checks.sh -c 'sleep 5 & sleep 5'and a 300 ms deadline returned the deadline failure (the owned process group is stopped; on macOS, cleanup confirmation is withheld for Apple platform binaries such assh, which the Go and venv Python helpers are not).pip install --require-hashes -r scripts/verify/advertised-schemas/requirements.txtinto a fresh venv: installs only the pinned wheels.npm run test:focused -- tests/boundary/mcp/advertisedDialect.test.ts: passed.npm run check:fast,node scripts/verify/architecture-guards.mjs,npx oxfmt --check .,npm run docs:check: passed.gofmt -l: clean.Timings on an Apple-silicon 10-core host shared with other agents (load average 15-30, so these are noisy upper bounds):
regexp(go run, compile included)GOCACHE)re, C++ RE2, Rustregex,fancy-regexCompatibility, safety, and release
-I. Go cannot fetch a toolchain.Author readiness
Human owner:
Before merge
type(scope): outcome.