Why I Turn Rejected AI Proposals into Tests
AI systems are very good at producing plausible alternatives. Engineering review is often good at rejecting the wrong one. Then we make a mistake: we keep the accepted answer and throw away the rejection.
I do not want a review process that only remembers success. When an AI proposal is rejected for a repeatable technical reason, I want that reason converted into an executable negative test.
The rejected patch is temporary. The boundary it crossed may be permanent.
A review comment is weak memory
Imagine an agent proposes a cache around an authorization lookup. The patch is clean. The latency argument sounds reasonable. The reviewer rejects it because the authorization result is request-scoped and must not survive a policy-version change.
A normal workflow leaves a sentence in a closed pull request:
Do not cache this result across policy versions.
That sentence is useful, but it is not attached to future execution. A later agent may never retrieve it. A human may remember the conclusion but forget the exact condition. The same proposal can return with different variable names and equally persuasive prose.
I would rather preserve the rejection as a test:
negative_case:
id: auth-cache-policy-version
trigger: "authorization result is reused after policy_version changes"
expected: "reuse is rejected and authorization is recomputed"
source_decision: "decision-log/ADR-014"
scope: "authorization cache boundary"
review_when: "authorization contract or policy identity changes"
This is not a test of the old patch. It is a test of the invariant revealed by rejecting it.
Rejected is not the same as useless
A proposal can fail in several ways, and only some failures deserve promotion into the test suite.
| Rejection reason | Durable artifact |
|---|---|
| Violates a stable invariant | Negative regression test |
| Breaks a public contract | Contract fixture |
| Relies on an unsupported assumption | Assumption probe |
| Exceeds current scope | Backlog or non-goal, not a test |
| Is merely less elegant | Decision rationale, not a test |
| Fails because the environment is temporary | Time-bounded observation |
The distinction matters. If every disagreement becomes a test, the suite turns into fossilized preference. Tests should protect behavior, contracts, safety properties, and explicitly chosen trade-offs—not personal taste.
This is also why I separate rejection from omission. An omission says something was not checked; a rejection says something was considered and failed a stated criterion. My earlier note on preserving what AI did not check handles the first case. A negative test handles the second.
The conversion needs a receipt
I use a small promotion record between review and regression:
{
"proposal": "cache authorization decisions",
"rejected_because": "policy identity was absent from cache identity",
"protected_property": "authorization reflects the active policy version",
"minimal_counterexample": "same subject and resource, different policy_version",
"test_target": "authorization cache adapter",
"expiry_trigger": "authorization contract is superseded",
"evidence": ["ADR-014", "review-482"]
}
The most important field is minimal_counterexample. Review prose tends to preserve a broad warning. A useful test needs the smallest input that makes the warning observable.
The expiry_trigger matters too. A negative test is not eternal truth. If the contract changes, the test may need to be rewritten or retired. This connects to my argument that engineering decisions need reopening triggers: a decision preserves rationale, while the test preserves an executable consequence of that rationale.
This changes what review produces
Most AI review pipelines treat the outcome as binary:
proposal -> accept | reject
I prefer a richer terminal state:
proposal
-> accept -> implementation evidence
-> reject -> reason classification
-> negative test
-> contract fixture
-> assumption probe
-> decision-only record
-> discard
Now rejection can improve the system even when no generated code ships.
This is close to the logic behind promoting exploratory evaluations into regression tests, but it starts from a different source. Eval promotion asks when a successful diagnostic deserves permanent authority. Rejection conversion asks what durable guard can be extracted from a failed proposal. One promotes coverage. The other mines counterexamples.
IOSM already gives me compatible artifacts: Hypothesis Cards state expected changes and guardrails; the Decision Log preserves accepted trade-offs and rejected options; learning closure requires a persisted learning artifact or a justified declaration that there was no learning delta. The missing move is to connect a rejected option to a runnable check when its failure condition is stable enough.
The test must detect the reason, not the syntax
There is a trap here. It is easy to write a snapshot that rejects only the old patch shape:
forbid function named cacheAuthorization()
That protects nothing. A future proposal can rename the function and preserve the defect.
The test must observe semantics:
- establish policy version A;
- request authorization and permit caching;
- switch to policy version B;
- repeat the same subject-resource request;
- assert that the result is recomputed under B.
The rejected implementation is evidence for discovering the case, not the identity of the case.
This is where deterministic boundaries help. If effect identity, policy identity, and contract version are explicit, a negative test can target them. If they exist only inside prompt prose, the rejection remains difficult to execute.
What I refuse to automate
I would not let the same agent that generated a rejected proposal automatically canonize the rejection reason. It may misdiagnose its own failure, overfit the test, or turn reviewer preference into policy.
The agent can draft the counterexample. A reviewer or an independent evaluator should confirm:
- the protected property is real;
- the counterexample is minimal;
- the check fails for the rejected mechanism rather than its spelling;
- the test does not forbid valid alternatives;
- an expiry or reopening condition exists.
This is commentary, not a measured claim about defect reduction. The mechanism still needs empirical study across real review histories. Its boundary is deliberate: it is useful when rejection exposes a stable, testable condition. It is noise when the decision is aesthetic, temporary, political, or too context-dependent to encode honestly.
I want disagreement to compile
AI makes alternatives cheap. That makes rejection more frequent, not less valuable.
If every rejected proposal evaporates, the system pays repeatedly to rediscover the same boundary. If every rejection becomes policy, the system calcifies. The engineering move is narrower: classify the reason, extract the smallest counterexample, and promote only stable semantics into a test.
I do not need the machine to remember that a patch lost an argument.
I need the repository to remember exactly how that argument could become wrong again.
Sources and scope
- IOSM v1.0 specification — Hypothesis Cards, Decision Log, guardrails, and learning closure.
- Architecture Decision Record reference repository — decision context, alternatives, consequences, and lifecycle guidance.
- Microsoft guidance on architecture decision records — recording ruled-out alternatives for architecturally significant decisions.
The negative-test promotion record in this article is my proposed engineering pattern. The sources support the surrounding decision and evidence practices; they do not claim measured superiority for this specific pattern.