Structured tool calls can fail when only a few fields violate a schema or execution contract, yet regenerating the entire object expands the action space and complicates auditing. The paper introduces ContractRL, a contract-constrained sequential repair protocol that treats verifier-guided JSON repair as a bounded decision process. At each step, the policy receives the candidate, typed verifier feedback, a JSON Pointer, immutable repair history, and the remaining budget. A contract-derived action mask filters malformed or prohibited RFC 6902 operations before a deterministic validator applies the transition. The method uses a contract-constrained group-relative objective for choosing among patching, retrying, and abstaining, while keeping canonical targets and semantic labels out of the online state until trace freeze. Across 192 cases per seed and five seeds, ContractRL reached 0.9362 semantic success with 34.4 generated tokens, compared with 0.9076 and 44.9 tokens for Patch-SFT and 0.9148 and 137.2 tokens for full regeneration. Policy optimization raised semantic success from 0.9186 for supervised ContractRL to 0.9375. In a separate three-seed paired evaluation against Patch-SFT, the semantic difference was +0.0396, with a 95% confidence interval of [+0.0137,+0.0662] and p=0.0039. Feedback, action-mask, budget, and schema-shift analyses link the gains to localized correction, while adversarial and multi-turn tests describe remaining failure modes.
AI News
The latest AI releases, research, products, and industry updates.
Loading...