Manuscript Offprint

arXiv:2610.03237

Pinning Decisions Before Failure: Executable Records of Underspecified Choices in AI-Assisted Code Generation

Takeharu Mitsui

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

Abstract

A natural-language requirement does not settle every question a program must answer, and a model asked to implement it resolves the remainder silently. Nothing in the generated artifact marks where a choice was made. We show the consequence is not caught downstream: across 600 generated test suites from three models, 42.7 percent contain no test that distinguishes the competing readings of the decision point at all.

The ordinary remedy is an acceptance example written before implementing; but an example is chosen for representativeness, and one that both readings of a requirement satisfy does not resolve that decision. We insert two steps into that process — enumerate the requirement's underspecified points by name, then for each construct two throwaway implementations differing only in that point and keep a candidate input only if executing both shows they disagree on it — and record what they produce as a decision pin: the named point, an input confirmed by execution to separate the constructed pair, and the value the person chose between the two exhibited results. The confirmation is part of the definition; whether the input isolates the intended reading is measured separately. The same record then constrains generation and decides compliance by execution, and it exists before the target implementation does.

We build a benchmark of 40 tasks in which one decision point is injected and two reference implementations are constructed to differ in that point alone, which makes "did this method reach the decision point" decidable by running code rather than by a model's judgement. On two models, an input separating the two references is obtained for 92.5 percent of decision points, and a pin that survives the comparison rule and identifies the intended decision for 85 and 90 percent. Used as acceptance checks on 703 independently generated implementations, pins agree with the benchmark's own classification on 96 to 97 percent; inspection of the 24 disagreements found errors in both classifiers, including four implementations misclassified by both. Used as constraints on generation, a recorded decision is honoured at its pinned input in all 210 generations, with and without eleven unrelated rules present, and on held-out inputs the pin was never worse than a prose rule in 38 cells. The results support using the same decision record for both generation guidance and executable checking, without establishing an advantage over scope-explicit prose in generation adherence.

The failures are informative. Every compliance failure we observed in generation constrained by a prose rule, on both models, came from the model deciding the scope of a rule whose extension the rule left open. We characterise one case in which this silently overturns a different recorded decision, attribute it to a single rule by leave-one-out on both models, and show that asking either model to reconcile the two rules by their text finds nothing in five attempts out of five — while re-running the recorded input observes the damage directly. We also report a negative result: in this setting we could not produce enough such damage to evaluate a conflict regression step, and we explain why a benchmark of independent tasks covers only part of the conflicts that accumulating decisions can produce.

1. Introduction

A requirement written in natural language settles fewer questions than it appears to. "Write a function that computes the volume of a sphere from its radius" does not say what a negative radius means. "Find the smallest number in a list" does not say whether the list may be reordered in the process. "Return the n-th term" does not say whether n counts from zero or one. These are not defects of the requirement; a requirement that settled every such question would be the program.

A model asked to implement the requirement does not have the option of leaving the question open. It decides, and it decides silently. Nothing in the artifact it produces marks the place where a choice was made, and nothing records which way the choice went.

Two things follow, and both are measurable.

The decision is not visible downstream. We generated test suites from the same requirements and checked, by execution, whether any test in a suite distinguishes the two readings of the injected decision point (a suite is silent when no test in it passes on one reference implementation and fails on the other; five suites per task, three models, the benchmark of Section 4). Over 600 suites, 42.7 percent contain no such test — between 31.0 and 49.5 percent depending on the model. The decision point is simply not exercised, and a suite that passes tells the reader nothing about which way it went. Asking a model to review the finished artifacts adversarially does little better — a strict count, made by reading the raw text rather than by keyword matching, finds the decision point named in 4 of 30 reviews (ten tasks, three reviews each, the model shown specification, tests and implementation and asked where the implementation might diverge from intent). Redirecting the review at the requirement instead does raise the hit rate to 30 of 30, but at a median of seven points listed per review, of which 17.3 percent concern the injected point; enumerating candidate ambiguities is easy, and easiness is the problem.

The decision is not recorded. Even where a person does adjudicate a question, the answer lives in a chat log, a review comment, or nowhere. The next requirement that touches the same question is answered from scratch, possibly differently. Our longer-term goal is to concentrate human review on unresolved decisions by preserving earlier choices as executable records; this paper evaluates the record, not the resulting process.

The ordinary remedy is an acceptance example: before implementing, write down a concrete input and the result the requirement is taken to demand, and keep it as a test. Specification by example and acceptance-test-driven development are that practice made systematic, and handing the example to a code generator along with the requirement is its obvious extension. Two things are missing from it. The example is chosen because it seems representative or important, not because it separates two readings of the requirement — nothing checks that it does, and an example both readings satisfy does not resolve that decision. And the example is attached to a function, not to a decision, so nothing says which open question it settled or whether a later requirement raises the same one.

Recent work supplies pieces of what is missing. Interactive test-driven generation ranks candidate tests by how well they split a set of sampled implementations and asks the user to accept or reject them; clarification systems find an input on which sampled implementations disagree and phrase a question about it. Both obtain the separating input from whatever the sampled implementations happen to differ on — which, as recent measurements show, is often nothing. The first returns its accepted tests alongside the code; what neither records is which open question a test settled, because neither names the point before constructing the contrast. Systems that mine rules from user corrections do accumulate, and pair each rule with an executable check, but a rule can only be acquired after a correction, which is to say after the wrong thing was built once.

This paper inserts two steps into the ordinary process and records what they produce. First, the underspecified points of the requirement are enumerated by name before any example is written. Second, for each named point, two throwaway implementations that differ in that point alone are constructed, and a candidate input is kept only if executing both shows they disagree on it. The product is a decision pin: the named point, an input whose distinguishing power has been confirmed in this way against the constructed pair, and the value the person chose. The confirmation is part of the definition — a pin is an acceptance example that has passed it — and it is what distinguishes a pin from an example chosen for representativeness. What the confirmation establishes is that the two candidates differ on the input; whether they differ only in the named point, and so whether the input isolates the intended reading, is a separate question that Section 5.2 measures. The person's part is reduced to a choice between two exhibited results. The pin is then kept: it is the constraint handed to later generation and the check run on what is generated, with no second artifact and no translation between them, and it is obtained before the target implementation exists rather than after a failure.

We turn an underspecified requirement into a reusable decision record that a person can choose, by constructing a contrast and confirming it by execution; and we evaluate whether such records can be constructed, how they work in generation and in checking, and the conditions under which they fail. The contributions serve the three parts of that sentence.

References (15)