Context Switch

Debugging AI Systems

A failed AI check tells me something went wrong. It does not tell me what is wrong. I learned to find the first meaningful failure before choosing a fix.

My role Expected behavior, severity, investigation & product decisionsAI collaborator Test support, trace review, implementation & documentationScope Controlled State exercises and product QA

In shortWhen an AI check fails, I look for the first meaningful failure before choosing a fix, then rerun the same case to prove the fix worked.

The recurring problem

Very different failures can look the same at the surface.

A bad answer might come from retrieval, missing context, interpretation, authority handling, deterministic logic, the eval expectation, or the final presentation. Reaching for the prompt first can fix the wrong layer.

The question I use insteadWhere is the first place the system stopped matching the intended behavior?
Investigation model

Diagnose before changing anything.

Observed failure→Expected behavior→Trace the system→Locate the failure→Choose the fix→Rerun

I use the failed case as evidence, then classify the problem before changing anything: product behavior, the eval contract, missing evidence, deterministic logic, or presentation. The goal is to change the product only when the product is actually the problem, then rerun the same case to verify the behavior changed for the intended reason.

Example A · product behavior was wrong

The agent found the right evidence and still gave the wrong answer.

In a controlled State agent exercise, the investigator correctly found an open Review proposing an owner. Its final answer then presented that proposed owner as established fact.

RetrievalWorking

The agent found the relevant files and recognized that the Review was still open.

Failure locationInterpretation and authority

The final synthesis promoted a pending proposal into project truth.

FixTighten the authority rule

Open Reviews were made explicitly pending, then the same case was rerun and behaved correctly.

This example used a controlled fake State dataset. It is evidence of the debugging method, not production performance.

Example B · the eval expectation needed revision

Sometimes satisfying the test would make the product worse.

In later State eval work, one scenario expected an answer-only action but observed an answer plus a proposed state update supported by the evidence. Product review found that the broader behavior could be acceptable when the evidence justified it.

What the eval saidFailure

The observed action did not match the original expected action exactly.

Product reviewThe behavior was not necessarily wrong

The evidence supported proposing the additional update for a person to approve, so forcing answer-only behavior would have made the test more important than the product contract.

DecisionRevise the eval

The expectation was updated rather than changing acceptable product behavior just to make the check pass.

What I keep from this

A failing eval is evidence, not an oracle.

Localize firstFind the failing layer

Separate retrieval, context, interpretation, authority, validation, and presentation before choosing a fix.

Retest the same caseProve the failure changed

Rerun the exact scenario, then add nearby regression cases so a narrow fix does not simply move the problem.

Protect uncertaintyFluent is not the same as correct

Authority and uncertainty failures matter even when the answer sounds plausible.

Review the test tooEvals need maintenance

If the expected behavior no longer matches the product contract, the eval should change.

Attribution

How I split the work.

I defined expected behavior, judged severity, classified where the failure belonged, and decided what should change. The same scenario then had to pass again before I treated the fix as real. AI supported case drafting, trace summaries, implementation, and regression coverage.