From bc485aacd3dc9126b840dd5f750e7a0b60807f9e Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 19 Aug 2026 21:33:37 +0000 Subject: [PATCH] Add ordering-switch completeness guardrail to M1 The final review round signed off on the plan with one addition: a grep proving no message-reading path still orders by created_at after the position switch. Folded in as a permanent guardrail test with an allowlist of the legitimate cross-thread orderings, rather than a one-time manual check - the bug it guards against is invisible on fresh data (the two orderings coincide until a recovery row lands with a fractional position), so a straggler or a later-added query would pass every demo and misorder exactly the transcripts that needed healing. --- docs/dev/in-progress/conversation-forking.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/dev/in-progress/conversation-forking.md b/docs/dev/in-progress/conversation-forking.md index 8be3e384..25344ab0 100644 --- a/docs/dev/in-progress/conversation-forking.md +++ b/docs/dev/in-progress/conversation-forking.md @@ -371,6 +371,18 @@ Pure ordering refactor; transcripts render identically. at fractional midpoints instead of forged created_at; the move-to-tail path sets position = max+1 instead of re-stamping created_at. +- Prove completeness of the switch, don't assert it: grep for + `order by.*created_at` (TS and SQL) and require every remaining + hit to be one of the documented cross-thread orderings. Ship it + as a guardrail test with an explicit allowlist of the legitimate + sites (same pattern as the existing style/markdownlint guardrail + tests), not a one-time manual check - the failure mode this + guards against is invisible on fresh data, where created_at + order and position order coincide; it only diverges once a + recovery row lands with a fractional position and an honest + timestamp. A missed reader works in every demo and misorders + exactly the transcripts that needed healing, and a guardrail + keeps the next session from reintroducing one. - Verify: gate + M0 ordering baseline re-run. ### M2 - fork columns + transcript resolver