Skip to content

decideVerdictAction

decideVerdictAction(read, spawnFinished, timedOut): VerdictAction

Defined in: src/json-tolerant.ts:89

Shared finalize-gate decision for the recap (src/recap.ts) and critic (src/review.ts) verdict loops, given the 3-way read plus the spawn/timeout state:

  • strict parse → “finalize-value” now (a complete document; unchanged behavior).
  • repaired parse → “finalize-value” only once the spawn is finished (or timed out); else “wait” — a repaired parse may be a truncated partial write jsonrepair closed up, so it isn’t trusted while the agent may still be writing.
  • unparseable → “finalize-null” (fail fast) once finished (or timed out); else “wait”.
  • absent → “finalize-null” only at the hard timeout; else “wait”. The “agent wrote nothing” / genuine-hang class is deliberately NOT fail-fasted (#822).

VerdictRead<unknown>

boolean

boolean

VerdictAction