test(mcp-server): CI guard for proxy/Worker search schema drift#160
Merged
liplus-lin-lay merged 1 commit intoJun 14, 2026
Conversation
Add scripts/check-schema-drift.mjs and run it in CI to assert the proxy
static search schema (mcp-server/server/index.js TOOLS) mirrors the Worker
zod schema (src/mcp.ts). Exact param-set match; drift fails the build.
proxy は tools/list を Worker へ転送せず静的スキーマを返すため、Worker に param を
足して proxy を忘れると黙って出荷される穴があった(graph_expand が v0.9.0 でこれで
欠落 = gh#157)。忘れ得る手順を CI ガード(構造)へ置換する。
Also record the schema-parity invariant in docs/0-requirements{,.ja}.md.
Refs #159
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
github-rag-mcp | 13e1259 | Jun 14 2026, 07:24 AM |
liplus-lin-lay
commented
Jun 14, 2026
liplus-lin-lay
left a comment
Member
Author
There was a problem hiding this comment.
AI セルフレビュー (auto mode / self-review only)
正しさ: drift-check は Worker zod(src/mcp.ts, 16 param) と proxy(mcp-server/server/index.js inputSchema.properties) の param 集合を抽出し厳密一致を判定。陽性=OK/exit0、陰性(graph_hops 改名)=exit1 で欠落/余剰を名指し、を実機確認。空抽出での誤合格は sanity guard(query/repo 必須・size>=5)で封鎖。CI 全 pass(test 20s / CI gate / Workers Builds)。
回帰リスク: runtime 不変。追加は CI スクリプト + ci.yml step + docs のみで、Worker/proxy のレスポンスを変えない。cd.yml は release:published のみ発火=マージで npm 公開は起きない。
later / accepted:
- (later) docs
### searchParameters のプロセ列が別途古い(16中6欠落)。本 PR に混ぜず別タスクへ切り出す。 - (accepted) 抽出は正規表現でソース構造(8スペース字下げ)依存。構造変更時は sanity guard が fail して気づける安全側設計ゆえ、完全 AST パースは過剰として不採用。
release: type=patch。npm 再公開(v0.9.2 相当)は Master の go 待ちで未実行。
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.
@
概要
proxy(
mcp-server/server/index.js) の静的searchスキーマが Worker(src/mcp.tszod) の param と一致することを CI で担保するガードを追加。drift で build を失敗させる。挙動は不変。背景 / 原因(クラス)
tools/listを Worker へ転送せず静的TOOLSを返す(起動時を auth/network なしに保つ設計)。additionalProperties:falseで未知 param を黙って落とし Worker に届かない。graph_expand/graph_hopsが proxy に欠落(fix(mcp-server): add graph_expand / graph_hops to proxy search tool schema #157 / fix(mcp-server): expose graph_expand / graph_hops in proxy search schema #158)。fix(mcp-server): expose graph_expand / graph_hops in proxy search schema #158 はインスタンスを直したが、クラス(次の param 追加でまた忘れ得る)は残存。方針
tools/listを Worker へ委譲 → 起動時に auth/network 強制で UX 退行。却下。searchparam 集合の厳密一致を assert。忘れ得る手順を、必ず発火する構造(CI)へ置換。変更
scripts/check-schema-drift.mjs(新規): Worker zod の param 集合と proxyinputSchema.propertiesの集合を抽出し厳密一致を assert。空抽出の誤合格を防ぐ sanity guard 付き。drift 時は欠落/余剰を名指しして exit 1。.github/workflows/ci.yml: test job にnode scripts/check-schema-drift.mjsを追加。docs/0-requirements{,.ja}.md: スキーマ整合の不変条件を「1. MCP Surface」に記録。検証
OK/ exit 0(16 param 一致)。missing: graph_hops/extra: graph_hopsZZを報告 → revert クリーン。release
Closes #159
@