Manuscript Offprint

arXiv:2609.09458

ContractEval: Query-Conditioned Execution Matching for Procedural Instruction Conformance

Praphul Singh, Shanu Kumar, Akshat Agarwal, Ganesh Kumar

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

As LLM agents move from answering questions to carrying out procedures, failures can be unwarranted rather than visibly wrong: the final response looks acceptable even though the system skipped the check, branch, dependency, or invariant that made the answer justified. Output-only evaluation sees the answer, and trace-aware judging sees activity, but neither identifies which obligations were active for the query. We introduce CONTRACTEVAL, a diagnostic framework for making those active obligations explicit. It represents procedural instructions as query-active obligations and matches them against response or trace evidence, turning omissions, wrong branches, ordering errors, extra actions, invariant breaches, and output-contract violations into distinct conformance failures. On a controlled suite of audited procedural contracts, output-only and trace-aware LLM judges miss many injected structural failures; under gold expected and observed graphs, ContractEval detects and localizes all of them. LLM-backed extraction preserves much of this signal but remains calibration-sensitive. ContractEval is therefore not a compliance guarantee; it makes procedural conformance auditable rather than implicit in final-answer quality.

1 Introduction

Modern LLM systems are increasingly asked not only to answer questions, but to carry out procedures. A prompt, policy, rubric, or standard operating procedure may require the system to check evidence, satisfy preconditions, choose the right branch, respect dependencies, and preserve invariants such as privacy, uncertainty, formatting, or tone. In such settings, the final answer is only part of the behavior being evaluated. A response can be useful on the surface while skipping the required verification, taking the wrong branch, reversing a dependency, adding an unsupported intermediate action, or violating an invariant that made the answer justified.

The difficulty is that these failures are often hidden behind plausible outputs. A customer-service assistant may give a reasonable refund answer while never checking eligibility; a medical or legal assistant may state a plausible conclusion while omitting a required source check; an agent trace may contain many tool calls while bypassing a prerequisite step. Output-only benchmarks and holistic LLM judges can accept such cases because the answer reads well. Trace-aware judges see more activity, but activity is not a denominator: the trace alone does not say which obligations should have applied to this query, which branch was active, or which observed actions count as satisfying the procedure.

This turns procedural evaluation into a different question from answer grading: not only whether the response is acceptable, but whether it was supported by the required process. Without explicit active obligations, evaluators infer that process from the same response or trace they are judging.

We introduce CONTRACTEVAL, a framework for evaluating procedural conformance by making this denominator explicit. ContractEval treats an instruction artifact as a semantic contract, conditions it on the input query, and compares the resulting active obligations with evidence extracted from the response or trace. The central idea is falsifiable: a model should be evaluated against the obligations that were active for this query, so failures can be traced to missing or violated obligations rather than opaque judge preferences.

This does not require assuming that every valid behavior follows a single surface trajectory. The query-conditioned expected graph is a partial-order representation of semantic obligations: inactive branches are excluded, required dependencies are retained, and observed behavior can match an obligation at the appropriate level of abstraction. Con-

Figure

Figure 1: ContractEval pipeline. The key evaluation object is the query-active expected graph: only after the instruction artifact is conditioned on the user query can observed response or trace evidence be matched against the obligations it was supposed to support.

tractEval is therefore not a claim that agents must emit identical traces; it asks whether the trace or response contains evidence that the required obligations were satisfied.

We test this idea with a controlled validity suite designed around the hidden failure mode itself. From 10 audited procedural contracts and 200 clean query-conditioned executions, we create paired cases in which the contract, query, and base evidence remain fixed while one known obligation is omitted, misbranched, reordered, supplemented with an extra action, or violated through an invariant or output contract. This setup asks a simple question: when the answer or trace still looks plausible, can an evaluator identify the failed obligation? Across four judge models, output-only LLM judges achieve 0.495 average detection and 0.400 localization, and trace-aware judges reach 0.570 detection and 0.468 localization; the strongest trace-aware judge still misses 29.0% of perturbed cases. Under audited expected and observed graphs, ContractEval detects and localizes all controlled perturbations as a construct-validity check, while LLM-backed observed extraction preserves much of the signal but exposes extractor calibration as the scaling bottleneck.

Our contributions are: (1) a formulation of procedural conformance as matching query-active obligations against observed behavior; (2) a query-conditioning procedure that evaluates only obligations activated by the query while preserving required dependencies; (3) a controlled perturbation benchmark for testing hidden structural failures; (4) an empirical comparison of output-only, trace-aware, expected-graph, oracle, and LLM-backed evaluator regimes; and (5) a component study separating declared contract compilation, expected-subgraph extraction, and observed-graph extraction. We will release the framework, audited contracts, prompts, and benchmark artifacts to support reproducible research on semantic conformance evaluation.