Add MCP compatibility ledger tool and first-pass Go/Rust codegen hardening

This commit is contained in:
Bill
2026-02-25 22:46:33 -07:00
parent 6d60447d50
commit 9fe3c1aa93
11 changed files with 475 additions and 10 deletions

View File

@@ -0,0 +1,26 @@
{
"ledger_version": "2026-02-26",
"records": [
{
"id": "MCP-GORUST-FIRSTPASS-LEGALITY",
"title": "Go/Rust first-pass legality normalization",
"status": "fixed",
"introduced_in": "0.8.1",
"fixed_in": "0.8.4",
"affected_tools": [
"whetstone_generate_code",
"whetstone_run_pipeline"
],
"symptoms": [
"Go outputs missing package/import/type details",
"Rust outputs using print/println in non-macro form",
"High deterministic fixer hit-rate before ready"
],
"verification": [
"run_ast_once_vs_direct_matrix: direct_fix_applied_rate approaches 0%",
"run_ast_once_vs_direct_matrix: ast_fix_applied_rate approaches 0%"
],
"notes": "Deterministic generator/projection defaults were tightened to emit legal Go/Rust first-pass code."
}
]
}

View File

@@ -0,0 +1,45 @@
# MCP Versioning and Compatibility (Agent Guide)
## Why this exists
Agents can fail for reasons that are already fixed in newer MCP runtime builds. This guide defines where to check runtime/tool versions and where fix records are tracked.
## Runtime version header
Whetstone MCP now exposes a `whetstoneVersionHeader` in:
- `initialize.result`
- `ping.result`
- `tools/list.result`
- `tools/call.result`
Header fields:
- `runtimeVersion`: MCP runtime version (for example `0.8.4`)
- `protocolVersion`: MCP protocol date string
- `toolContractDefaultVersion`: default contract version for tools
- `toolSurfaceSchemaVersion`: schema snapshot version
- `toolCount`: tool count in the running server
- `toolSurfaceFingerprint`: deterministic fingerprint of tool names
- `compatibilityLedger.path`: path to the issue/fix ledger JSON
- `compatibilityLedger.version`: ledger schema/snapshot version
## Tool-level contract header
Each `tools/list` entry includes `x-whetstone`:
- `contractVersion`
- `compatibilityLedger`
## Compatibility ledger
Machine-readable ledger:
- `docs/mcp_compatibility_ledger.json`
Use this for checks like:
- "Issue reproduced on `runtimeVersion=0.8.1`"
- "Ledger says fixed in `0.8.4`"
- "Action: update server runtime before more debugging"
## Recommended triage flow for agents
1. Call `initialize` (or `ping`) and capture `whetstoneVersionHeader`.
2. If behavior seems wrong, read `docs/mcp_compatibility_ledger.json` and match symptom tags.
3. If `runtimeVersion < fixed_in`, report upgrade recommendation first.
4. Only escalate to deep debugging after version mismatch is ruled out.
## Notes
- Keep ledger entries small and concrete (symptom, affected tools, fixed version).
- Add entries when a recurring failure pattern is fixed deterministically.

View File

@@ -68,3 +68,28 @@ Observed result:
Result:
- `overall_ready=true` within iteration budget for PriorityQueue spec.
## MCP versioning/compatibility rollout (2026-02-26)
Implemented baseline compatibility/versioning support for multi-agent MCP usage:
- Added MCP runtime/tool version metadata in protocol responses:
- `editor/src/MCPServer.h`
- `editor/src/mcp_main.cpp`
- Added compatibility docs + machine-readable ledger:
- `docs/mcp_versioning_and_compatibility.md`
- `docs/mcp_compatibility_ledger.json`
- `tools/mcp/README.md` (version check flow)
- Added MCP tool for agents to query compatibility data directly:
- `editor/src/mcp/RegisterCompatibilityTools.h`
- registered via:
- `editor/src/mcp/RegisterOnboardingAndAllTools.h`
- `editor/src/MCPServer.h` include
Validation:
- Rebuilt target: `whetstone_mcp`
- Verified `tools/call`:
- `whetstone_get_compatibility_ledger` returns:
- runtime header (`runtimeVersion`, `toolSurfaceFingerprint`, etc.)
- parsed ledger contents from `docs/mcp_compatibility_ledger.json`