Files
ECC/tests
Muhammad Mirza f64a9b5d04 fix(continuous-learning): flush Stop JSON before exit so the nudge is not truncated
The Stop nudge JSON was written with console.log and main() called
process.exit(0) immediately after. When stdout is a pipe the write is
asynchronous, so the exit can truncate the payload and the model never
sees the nudge. deliverStopNudge now returns whether it delivered, and
writes the JSON with process.stdout.write and exits from the flush
callback; main() exits immediately only when nothing was delivered.

Test: new case in tests/hooks/evaluate-session.test.js forces every
stdout write to be asynchronous with a preload, so the race reproduces
deterministically. It fails on the old code (empty stdout) and passes
with this fix. Full evaluate-session suite: 26/26 pass.
2026-11-10 17:11:03 +07:00
..