Hit once during PR #475's pre-merge cycles (2026-07-30), on a run whose only delta from a fully-green prior cycle was a one-line selector comment in an unrelated spec — so not a product regression from that PR.
Symptom:tutor.spec.ts:44 "tutor turn renders a reply and persists encrypted to messages" failed at line 83: expect(rows).toHaveLength(SEEDED_MESSAGE_COUNT + 2) — expected 6, received exactly the 4 seeded rows. The UI reply had rendered (earlier assertions passed), but the one-shot queryRaw read the messages table before the turn's user+assistant rows were committed. Passed on the immediately preceding and following full cycles (zero-flake otherwise).
Rate: 1 failure in ~6 full local cycles today (each cycle runs the spec once) plus every recent green main run — rare.
Root-cause candidates: the persistence contract writes both rows before the SSE done event; if the client renders the final bubble off the last token rather than done, a fast function-mode turn can expose a window where the spec's DB read beats the commit. Either await done explicitly before the DB assert, or make line 83 an expect.poll (the pattern gradebook.spec.ts uses for its mutation assert).
Evidence preserved (screenshot / video / trace.zip / error-context.md) at:
/tmp/claude-1000/-home-andresl-Projects-sapling/428d9f6f-5046-455f-a4b7-b17d5bc2e619/scratchpad/tutor-flake-evidence/ — copy out before that tmpdir is cleaned if needed.
Per the #388 zero-flake policy this should be fixed at the root (poll or done-gate), not retried.
Hit once during PR #475's pre-merge cycles (2026-07-30), on a run whose only delta from a fully-green prior cycle was a one-line selector comment in an unrelated spec — so not a product regression from that PR.
Symptom:
tutor.spec.ts:44"tutor turn renders a reply and persists encrypted to messages" failed at line 83:expect(rows).toHaveLength(SEEDED_MESSAGE_COUNT + 2)— expected 6, received exactly the 4 seeded rows. The UI reply had rendered (earlier assertions passed), but the one-shotqueryRawread themessagestable before the turn's user+assistant rows were committed. Passed on the immediately preceding and following full cycles (zero-flake otherwise).Rate: 1 failure in ~6 full local cycles today (each cycle runs the spec once) plus every recent green main run — rare.
Root-cause candidates: the persistence contract writes both rows before the SSE
doneevent; if the client renders the final bubble off the last token rather thandone, a fast function-mode turn can expose a window where the spec's DB read beats the commit. Either awaitdoneexplicitly before the DB assert, or make line 83 anexpect.poll(the pattern gradebook.spec.ts uses for its mutation assert).Evidence preserved (screenshot / video / trace.zip / error-context.md) at:
/tmp/claude-1000/-home-andresl-Projects-sapling/428d9f6f-5046-455f-a4b7-b17d5bc2e619/scratchpad/tutor-flake-evidence/— copy out before that tmpdir is cleaned if needed.Per the #388 zero-flake policy this should be fixed at the root (poll or done-gate), not retried.