[package] name = "jouleclaw-toolcall-repair" version.workspace = true edition.workspace = true license.workspace = true repository.workspace = true authors.workspace = true description = "Typed tool-call repair primitive. Absorbs the operational insight from Ahmad Awais (Command Code, ~600B tokens/day): open-weight LLMs (DeepSeek V4 Pro, Kimi K2, MiniMax) have specific tool-call mis-shaping variations that they REPEAT 50+ times instead of correcting from a returned schema error. The fix is at the HARNESS layer — detect the variation deterministically, repair the call, return the result PLUS a repair hint so the model learns. Provides DetectPattern (6 variants) + RepairAction (5 variants) + RepairRule + RepairLibrary + .apply() + a `presets` module with reference rules for the patterns Ahmad called out (empty object where array expected, JSON-string instead of array, markdown link inside a path string, null where optional default expected, missing optional field). Composes with jouleclaw-llm (between backend response and consumer), jouleclaw-hindsight (repair hits are Observations; high-frequency repairs surface as paradigm pressure), jouleclaw-promotion-path (a repair rule can itself promote)." [dependencies] serde = { workspace = true } serde_json = { workspace = true } thiserror = { workspace = true } blake3 = { workspace = true }