Repository navigation
feat(schemas): derive the gateway's advertised tool schemas from their models (piece A, see Consiliency/pmcp#236) - #300
Merged
Conversation
…r models (piece A, see #236) Implements piece A of the merged plan (.consiliency/plans/detailed-236-schema-drift-20260923-0915.md, #291), applied exactly as its executor steps state; every file is byte-identical to the reviewed reference code (wip/236-schema-drift-rev2-code @ cb6afa4). - tools/schema.py derives each tool's inputSchema from the pydantic model its handler validates with (refs inlined, titles dropped, optional fields `type: [X, "null"]`), built once per process. - server.py fails closed on a name the registry does not list, inside the audited path and before the scoped-audit model check. - types.py carries the argument descriptions (main's hand-written text kept), task.ttl's range and the digest's exact length. - tests/test_gateway_tool_schemas.py (220) + a committed schema snapshot. Behaviour changes are listed in the CHANGELOG entry. Piece B (forbid unknown keys) is gated on #296. Full suite -m 'not live': 4291 passed, 3 skipped, 25 deselected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017HCiJU6dVVrNdcz461oN33
ViperJuice
added a commit
that referenced
this pull request
Sep 27, 2026
… (see #294) - C1: an exact npm pin is silent only when nothing besides the argv can change what npm runs for it: npm_config_* keys judged by an allowlist derived from the npm 10.9.9 and 11.19.0 config definitions, NODE_OPTIONS, the overlay keys identity selects, a local prefix, and the project, user, global and builtin npmrc files, in both identity modes. - C2: _is_exact_pin decides per launcher; a docker tag floats and only a content digest pins, for the warning and for [PINNED]/[FLOATING]. - NB-1: the fallback cause names a launcher identity does not read. - NB-2: the floating text claims only what holds on every npm release. - NB-3: the #300 test count is attributed correctly (416 for two files). Re-measured on 959d4d4: 153 pin tests (41 red on rev 5), 56/56 mutants red, full suite 4489 passed, conformance 0/0 on npa 12.0.2 and 13.0.2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LT8D8tRmExyQve69DCWRik
This was referenced Oct 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Piece A of #236, implemented from the merged plan (#291). I applied it exactly as the plan's executor steps say. All six files are byte-identical to the reference code the plan board reviewed over eight rounds (
wip/236-schema-drift-rev2-code@cb6afa4).What changes
inputSchemais now derived from the pydantic model its handler validates with, built once per process. The gate and the model can no longer drift.Unknown tool. The guard sits inside the audited path, before any dispatch or scoped-audit model check.update_server.force.task.ttlgets an int64 range, andevidence_label_digestgets an exact length.nullaccepted for optional arguments, stricter type coercion oninvoke.task.*, and a scoped-audit consequence that lasts until Record tools/call gate rejections in the scoped-advisor audit (prerequisite for piece B of #236) #296.Release gate (not a merge gate): before the next tag, run the host
tools/listsmoke test the plan requires, tracked in #301. This PR emitstype: [X, "null"]andnullinenum.Piece B (
extra="forbid") is not in this PR. It is gated on #296. Deferred classes are tracked in #297 and #298.Verification (this branch, off main
1fb36f2)cmpagainst the reviewed referencetests/test_gateway_tool_schemas.pyruff check,ruff format --check,mypy src/-m 'not live'See #236.
🤖 Generated with Claude Code
https://claude.ai/code/session_017HCiJU6dVVrNdcz461oN33