fix(mcp): present discover_tools input through the selected profile (#10592)

* test(mcp): check advertised schemas against a portable dialect in every profile

* fix(mcp): re-emit advertised patterns in a portable regex grammar

* fix(mcp): present discover_tools input through the selected profile

The hot-cold catalog registered discover_tools directly with the SDK, so
the default compact input profile still advertised its canonical schema,
including page-size defaults clients apply on their own (#5322). Route
every listed input schema, transport discovery included, through one
server-owned presentation, and pass the selected presentation to the
deferred server, which serves recorded tool schemas but not discovery.

* fix(mcp): validate advertised dialect by selected profile

* fix(mcp): preserve schema widening through references

* fix(mcp): refuse zero-padded repeat bounds and record host-specific path patterns

* fix(mcp): keep references valid when presentation widens their targets

* fix(mcp): relax references into negations and conditionals presentation may remove

* fix(mcp): keep astral literals and dynamic references widening in every mode

* fix(mcp): omit astral literals and relax untracked references when presentation widens

* fix(mcp): read reference pointers by schema position, not segment spelling

* fix(mcp): protect references into collapsing boolean unions and keep referencing branches out of the collapse

* fix(mcp): omit patterns whose classes name astral characters

* fix(mcp): decide union collapse and pointer protection from canonical branches

* docs(mcp): document non-u astral matching and pin BMP agreement across V8 modes

* test(mcp): expect the advertised base64 schema to omit the unbounded pad-bit probe

* fix(mcp): protect references into unevaluated keywords lost evaluation removes

* fix(mcp): emit stack-safe classes with non-ASCII members and protect draft-07 reference siblings

* fix(mcp): protect references into literal siblings of relaxed draft-07 references

* fix(mcp): keep the Evidence union on described borrowed inputs (#10597)

* fix(mcp): keep the Evidence union on described borrowed inputs

borrowEvidenceInput installed its advertised projection on one schema
instance. A call site's .describe() rebuilds the schema from its
definition, so match_native_functions advertised left and right as
unconstrained values in every input profile. Install the projection in
the borrowed parser's constructor so derived schemas keep it, for both
borrowed inputs and borrowed arrays.

* test(mcp): select the borrowed Evidence contract from its family

* docs(mcp): admit baseline growth only for restored contract declarations
This commit is contained in:
morluto authored and GitHub committed 2026-11-15 18:08:12 +08:00
1 parent 57f75bb723
commit babfc87ec0
10 files changed
+173 -52

No files matched your search

+5 -2
View File
@@ -293,8 +293,11 @@ rendered declarations. `src/contracts/advertisedDialect.ts` owns the portable
advertised dialect: the keyword allowlist, size and depth limits, and the regex
grammar that compiles in V8, Python, RE2 and Rust. `advertisedDialect.test.ts`
lists every input, output and catalog profile combination and compares the
violation counts with `advertisedDialectBaseline.ts`, which may only shrink;
the packaged catalog check applies the same rules to the default profiles.
violation counts with `advertisedDialectBaseline.ts`, which may only shrink,
except when a runtime analysis setting adds its `update_analysis_settings`
branch, or a fix restores a contract declaration the presentation had lost and
the PR names it; the packaged catalog check applies the same rules to the
default profiles.
Advertised patterns, input and output, are enforced at zero:
`portablePattern.ts` re-emits each one exactly, widens it, or omits it, and the
presentation drops any enclosing `not` or `if` and turns `oneOf` into `anyOf`