You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(reliability,execution): make cancellation, goldens, diffs, and leak accounting real
Six defects found reviewing the execution/comparison stack:
1. Cancelled queued jobs could still execute. `ExecutionSession.create()`
starts the kernel, and the WS runner checked the persisted "cancelled"
status only afterwards, so the workflow ran (side effects included) and
the branch never cancelled the session. Persistence now runs before the
session is created. The regression test asserts the executor never ran,
not just the DB row.
2. Golden fixtures never reached the verdict. `compareJourney` evaluated
invariants and the cross-surface diff only, so every surface returning
the same wrong answer passed. `core/golden.ts` compares terminal outputs
and the normalized stream (per node-channel) against `expected/`, and
fails the surface on a mismatch; faulted runs skip with a stated reason.
`nodetool reliability update-goldens <journey>` recaptures fixtures from
an unfaulted kernel run; linear-text-pipeline's stale shape is refreshed
(constant-node frames now filtered by normalization, node_name is the
node's name).
3. Nested payload differences vanished from the diff. `canonicalKey` used
`JSON.stringify(msg, keys)`, whose array replacer is a key whitelist at
every depth, so `{result:{output:"A"}}` and `{result:{output:"B"}}`
serialized identically. Replaced with a recursive stable serializer.
4. Every production run built an unbounded, unread message queue.
`ExecutionSession` always constructed `MessageStream`; no production
caller iterates it. Capture is now opt-in (`captureMessages`) and
bounded (`limits.messageBufferLimit`), and overflow throws instead of
retaining.
5. `cleanup-leaks` measured nothing. No driver populated
`resourceCounters`, and `checkLeaks` returned success on absence. The
kernel driver now reads `ExecutionSession.resourceCounters()` (live
actors, pending control responses, timers, bridge requests) and the
ws-server driver reads the runner's slot counters after disconnect;
a missing post-run snapshot is a violation.
6. The ws-server driver hid duplicate terminal frames. It dropped every
repeated `job_update`, leaving "exactly one terminal update"
undetectable on the one surface with a wire. Repeats are recorded and,
only when they match this surface's documented shapes (eager
running/cancel acks, authoritative terminal snapshot), tagged
`redundant` — discounted by normalization and terminal-uniqueness.
Any other duplicate now fails.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dx19BNKrnpQNVD2W8eoA5y
0 commit comments