Turn failed traces into one repair queue
Use when: a multi-step agent has enough complete traces to show recurring failures, but dashboards of tool accuracy, latency, or handoff quality do not identify which harness change should come first. Define the user-level outcome before examining steps: the answer is correct, the side effect exists, or the artifact passes its independent oracle. Only failed runs enter localization.
run_id,
terminal
outcome,
ordered
states,
tool
receipts,
and
recovery
events.
Assign
exactly
one
first-failure
pair:
(last_successful_state,
attempted_state).
Aggregate
those
pairs
into
a
transition
matrix;
then
rank
cells
by
frequency
times
impact,
not
frequency
alone.
Select
the
highest-priority
cell
and
repair
only
its
governing
layer—prompt,
tool
schema,
router,
handoff,
policy,
or
feedback.
Freeze
a
held-out
trace
set
before
the
change
and
rerun
the
same
tasks
and
budgets
afterward.
Preserve
full
traces
as
evidence,
but
do
not
turn
the
observed
path
into
a
mandatory
sequence:
a
different
route
that
reaches
the
verified
outcome
remains
valid.
Acceptance check: On the held-out fixture, pass only if every end-to-end failure contributes exactly one matrix cell, every successful run contributes none, and the matrix total equals the failed-run count. After the repair, require both the selected cell’s count and the overall outcome-failure count to decrease under identical task inputs, model version, tool surface, and budget; require all safety and side-effect oracles to remain green. Include at least one valid alternate-path fixture and verify it passes despite using different intermediate states. If labels disagree, adjudicate against the raw trace and record the decision before comparing runs.
Caveat: First-failure labeling is an analytical judgment, not causal proof. Cyclic, parallel, or self-recovering workflows may need milestone-specific matrices or multiple hypotheses, and rare catastrophic failures can outrank the busiest cell. This method is weakened if independent reviewers cannot reproduce the selected cell, or if its count falls while end-to-end success, safety, or cost worsens.