把 GateFix 的 4D-CQ gate 包成一个 MCP server。暴露三个 tool,显式分成读/写两类——list_precondition_functions 和 gate_history_get 是只读工具,authorize 是有副作用的写工具,用于对调用方提交的 evidence 做真实的 4D-CQ 判定。
Three tools with clear names and detailed descriptions, but significant schema and parameter documentation gaps. Tool names follow verb_noun pattern (list_, authorize, gate_history_get). Descriptions are substantive (200-400 chars) and explain purpose, prerequisites, and side effects. However, input schemas lack proper JSON Schema structure with explicit type declarations and parameter descriptions. The 'evidence' parameter in authorize is documented as 'object' with minimal guidance on expected fields. Output schemas are not formally documented. Error handling is present but lacks recovery guidance. Security considerations (audit trails, permission gates) are well-thought-out in implementation but not surfaced in tool definitions.
对调用方提交的 evidence 做真实的 4D-CQ 判定。返回值是任务 1 定义的机器可判定契约(gate_state/schema_version/cq_scores/reason_code/auto_repair_available/human_readable),外加为了不破坏既有调用方而保留的旧字段:route(=gate_state)、authorized(route=="PASS" 的布尔值)、R/C/O/Ro/Q、verifiable_ext、repair_attempts。核心契约:route/gate_state != "PASS" 时,调用这个 tool 的 agent 绝不能把对应的动作当作已授权去执行。
只读工具:查询 audit.py 记录的历史判定,用于复盘"当初为什么放行/拦截"。不产生新判定,不写任何东西——和 authorize() 是两个独立的 tool,MCP client 不该把这个当成能触发判定的入口。参数都是可选过滤条件;不传就返回全部历史(可能很大,调用方自己控制要不要传窄一点的过滤条件)。
列出 <case> 里所有可被 authorize() 调用的 precondition_fn,附带对应 commit 的名字、是否 soft_commit、有没有 AUTO_REPAIR,以及打分函数的 docstring(说明期望的 evidence 字段)。调用 authorize() 之前应该先调这个,搞清楚要传什么样的 evidence。
Input schemas lack proper JSON Schema structure. 'evidence' parameter in authorize is typed as 'object' with no field descriptions, constraints, or examples. LLMs cannot infer what fields to include.
Output schemas not formally documented. Tool descriptions mention return fields (gate_state, cq_scores, reason_code, etc.) but no structured schema is provided. LLMs must parse prose to understand response structure.
Parameter descriptions are minimal or missing. 'case' parameter has a default but no description of valid values or how to discover them. 'precondition_fn' requires calling list_precondition_functions first but this dependency is not formally documented.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | D | 51 | 2026-07-28+ | v2 |
Error handling lacks recovery guidance. ValueError exceptions for unknown precondition_fn or bypass_to_human commits are raised but no actionable next steps are provided to the LLM (e.g., 'call list_precondition_functions first').
No pagination support documented for gate_history_get. Tool accepts optional filters but no limit, offset, or cursor parameters. Large audit histories could blow context windows.