Repository navigation
Description
Parent epic: #338
Part of the debug-record epic. Depends on the foundation child. More than one PR: sub-issues by decision family are linked below.
What a debugger hits today
The harness chooses a lane and writes which lane, never why: the sentence it composes for the picker is not persisted, nor the frontier it chose from. A hedge fires and the row says it fired, never on what trigger. A relax rung is climbed and the row says which rungs the body had climbed so far, never which rung this attempt added or what provider text caused it; the "retry 2/4: removed reasoning" line is a live notice that is never written. An effort is resolved and the row says what travelled, never what was asked. A stream is cut and the reason word survives while the partial reply is discarded. In a chat, an interrupt, a consent prompt, a guardian veto, a budget stop and a change of approval posture leave no line at all. In one measured run the person's preference asked one lane and another served, with no reason on disk.
The law
Every decision the harness makes about a run is written with its reason, in the words the harness already composed for itself, at the moment it is made.
Fix shape
The recorder's decision method (kind, subject, choice, reason, call id where there is one). Each decision family adds one call at the point where the reason already exists, with no new reasoning and no reformatting:
- routing: the chosen lane, the sentence composed for the picker, the ordered alternatives;
- hedge: fired or not, the trigger reason, the deadline, the winning arm;
- relax rung and refusal: the rung this attempt added and the provider's own text that caused it;
- effort: requested versus resolved and why they differ;
- stream guard: the cut reason and the partial reply kept, not discarded;
- chat-side: interrupt (when, how much text was dropped), consent prompt and answer, guardian veto, budget stop, approval posture change.
When the switch is off each call is one nil check.
Replication
AFORGE_DEBUG=1 aforge chat --once "say hello" --model <a model with several lanes>Today: the call-log row shows a lane asked for and a lane that served; nothing on disk says why either was chosen, and if a hedge fired nothing says what triggered it.
Acceptance (functional)
- After a run with the switch on, the trace holds a routing decision per model call naming the chosen lane and the reason sentence.
- Force a hedge (a slow first lane or a low deadline): the trace holds a hedge decision with its trigger reason and the arm that won.
- Force a relax rung (a model that refuses a reasoning field): the trace holds the rung added and the provider's refusal text.
- Ask for an effort the model cannot honour: the trace holds requested and resolved with the reason.
- Press escape mid-reply in a session with the switch on: the trace holds the interrupt with the count of characters dropped; refuse a consent prompt: the trace holds the prompt and the answer.
- With the switch off, no decision line is written and the run behaves identically.
Sub-issues
- debug record: the routing choice and the hedge verdict are written with their reason #346 routing choice and hedge verdict
- debug record: a relax rung, an effort resolution and a stream-guard cut are written with their reason and what was discarded #347 relax rung, effort resolution, stream-guard cut
- debug record: interrupt, consent, guardian veto, budget stop and approval change leave a line #348 chat-side interrupt, consent, guardian veto, budget stop, approval change
- call log: a stop the harness chose is recorded as a stop with who and why, never as an error #362 a stop the harness chose is recorded as a stop with who and why, never as an error
Drafted with CodeAF · reviewed and owned by the author
Activity
santoshkumarradha commentedon Sep 10, 2026
Consolidated into the epic #338. This issue's law, fix shape, replication and acceptance are reproduced in full in the epic's consolidated plan (comment on #338, 2026-09-10), under the pull request that now carries it — nothing is lost, and this issue stays readable.
Why the children were folded back: the epic split into a foundation child, three decision-family children and a failure-evidence child so separate lanes could take them. Four weeks on, one lane took the foundation and the tree carried nine open issues describing what is now a handful of call sites each. The verified state at dev@95a0d0a9b is that
internal/trace'sRecorder.Call,Recorder.ToolandRecorder.Decisionhave zero callers outside the package's own tests — the shapes are all built and correct, and no feeder is wired, soAFORGE_DEBUG=1today writes a run header and nothing else. That is one lane's work in three pull requests, not nine issues.