Total: 1
Static analyzers rely on API summaries to model library calls. Flawed summaries can cause false alarms or hide real bugs. Repairing them requires preserving dependencies among summary facts, which free-form LLM edits can violate. We present OpCraft, a system that uses counterexamples to validate repairs to static-analyzer API summaries. OpCraft expresses LLM-selected edits in Summary Repair IR (SRI), a typed intermediate representation that makes operator applicability, effects, dependencies, bindings, and ordering explicit. Deterministic backends translate SRI sequences into validation code and analyzer patches. OpCraft accepts a repair only when the generated code produces the expected analyzer behavior. We evaluate OpCraft on single-defect and multi-defect benchmarks for the Clang Static Analyzer (CSA). Across three LLMs, OpCraft repairs at least 96% of single-defect tasks at pass@1, compared with 30% to 37% for free-form repair. It also remains effective on multi-defect tasks. Ablations show that reliable repair requires typed applicability, effects, and dependency semantics beyond output schema checks. CSA C++ patch candidates generated from accepted SRI sequences pass both per-task LLVM validation and the full CSA regression suite.