Mcp tools contract refactor - #13
Conversation
4544ffe to
42f7f3c
Compare
Greptile SummaryThis PR refactors the MCP tools layer by introducing a typed contract in
Confidence Score: 4/5The contract refactor and associated handler cleanup are correct; the splice logic change in patchTurbopack.ts needs attention before merging. The contract DSL, handler refactors, reporter fragility analysis, lazy-label improvements, and finder access tracking are all clean. The changed patch-splice condition introduces a P1 regression: non-all patches with groupApplied=0 are never removed from the evaluation list, causing patchResults to accumulate one entry per shared-factory module rather than one per patch. src/turbopack/patchTurbopack.ts — specifically the groupApplied > 0 splice condition at line 353 and the anyMatched splice condition at line 273. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
TOOLS["TOOLS const\n(contract.ts)"] -->|InferArgs| TYPES["ToolArgsMap\n(types.ts)"]
TOOLS -->|fieldToSchema| DEFS["TOOL_DEFINITIONS\nJSON Schema\n(contract.ts)"]
TYPES --> HANDLERS["Typed handlers\n(index.ts)"]
HANDLERS --> MODULE["handleModule"]
HANDLERS --> PATCH["handlePatch"]
HANDLERS --> STORE["handleStore"]
HANDLERS --> REACT["handleReact"]
HANDLERS --> INTERCEPT["handleIntercept"]
HANDLERS --> GROK["handleGrok"]
HANDLERS --> EVAL["handleEval"]
HANDLERS --> SEARCH["handleSearch"]
HANDLERS --> PLUGIN["handlePlugin"]
UTILS["ActionMap / dispatch\n(utils.ts)"] -->|used by| PATCH
UTILS -->|used by| STORE
UTILS -->|used by| MODULE
PATCH -->|patchResults / patchStats| PTCH["patchTurbopack.ts\npatchFactory"]
PTCH -->|splice on groupApplied>0| PLIST["patches array\n(global list)"]
PTCH -->|splice on anyMatched| VONLY["validateOnly branch"]
Reviews (2): Last reviewed commit: "Mcp: skip function matches in orphan che..." | Re-trigger Greptile |
No description provided.