Repository navigation
docs(design): the threading cutoff is measured per instance from the first rooted reply - #1147
Merged
Merged
Conversation
…first rooted reply — not hardcoded, not from the un-rooted set TASK-046 / pod 57395. A hardcoded deploy instant is wrong for self-hosted instances (the script's header was right); MAX over un-rooted edges is poisoned by retention orphans. MIN(created_at) over replies that carry a root is exact per instance and orphan-immune; the un-rooted MAX remains only as the --derivation-live fallback. The 16:01:52Z instant becomes the cross-check for this instance, not the source. Co-Authored-By: Claude Fable 5 <[email protected]>
…orded boundary is never re-measured Co-Authored-By: Claude Fable 5 <[email protected]>
…f never reaches a client (#1145) Reverses the one-timestamp wire shape recorded after 57132. pod-architect built the server-resolved form in #1145 and retracted the O(1) argument that had justified the other: the join is bounded by thread count, and a migration detail in every future client is the worse cost. following stays raw tri-state on the wire — NULL is a value the wake path resolves; the header toggle renders three states without computing participation. Co-Authored-By: Claude Fable 5 <[email protected]> (cherry picked from commit b234d10)
This was referenced Aug 22, 2026
docs(design): collapsed is server-resolved per root; the cutoff never reaches a client (#1145)
#1146
Closed
lilyshen0722
added a commit
that referenced
this pull request
Aug 22, 2026
…toff, not the newest un-rooted one (TASK-046) (#1148) * fix(threading): the backfill records the first rooted reply as the cutoff, not the newest un-rooted one (TASK-046) The 22:28Z dry run on the live pod recorded cutoff 12:21:11Z — MAX(created_at) over un-rooted edges, which is poisoned by retention orphans (a descendant of a deleted root keeps a live parent and loses its root, so a recent orphan sets the boundary late). A hardcoded deploy instant is no better: it is wrong on every self-hosted instance that ships derivation on a different day, as the script's own header already said. The boundary that survives both: MIN(created_at) over messages that have a reply edge AND a root — the first reply derivation-on-write ever wrote, exact to within one reply, per instance, orphan-immune. The newest un-rooted reply remains only as a fallback when no rooted reply exists, and only behind --derivation-live; otherwise --apply refuses with exit 3, because without a rooted reply there is no evidence derivation is deployed and ON CONFLICT DO NOTHING would freeze a wrong boundary. The ledger row now records which source produced the value (cutoffSource). Also removes the header sentence the ruling rejected — a MISSING ledger row is unknown and expands; a NULL cutoff in a written row is knowledge. Tests: the three pinning suites flipped to the new contract (36 passing); tsc:check clean. Ruling text: docs/design/threading-surface-ruling.md (#1147). Co-Authored-By: Claude Fable 5 <[email protected]> * fix(threading): the backfill's UPDATE and ledger INSERT are one transaction sprint-review (TASK-046 note): losing the INSERT after the UPDATE leaves every chain rooted and no cutoff recorded, and 'the backfill always writes the ledger row' is the only remaining guarantee between a partial run and a permanently unknown cutoff. BEGIN before the UPDATE, COMMIT after the INSERT, ROLLBACK on error, on a dedicated client. Pinned by ordering test. Co-Authored-By: Claude Fable 5 <[email protected]> * fix(threading): the backfill reads the ledger first and never re-measures a recorded boundary sprint-review (57397): after the backfill every pre-threading reply carries a root, so MIN over rooted replies returns the oldest reply ever written — a plausible wrong answer. A run that finds the ledger row reports it and stops before the population count and before CUTOFF_SQL; the recorded value is the only true boundary. Pinned by ordering test. Co-Authored-By: Claude Fable 5 <[email protected]> * fix(threading): the dry run prints the rooted-reply count so a fallback cutoff shows its cause sprint-review (57398): on an instance with no reply written since derivation deployed, the primary MIN is NULL and the gated fallback yields the newest un-rooted reply. The dry run now prints how many derivation-written replies exist, so an operator sees why the fallback fired before deciding on --derivation-live. Co-Authored-By: Claude Fable 5 <[email protected]> --------- Co-authored-by: Claude Fable 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Matches the ruling doc to TASK-046's revised remedy (pod 57395), replacing the "constant" paragraph from #1131.
MAX(created_at)over un-rooted edges is poisoned by retention orphans (sprint-review 57205).MIN(created_at)over messages with a reply edge AND a root is exact per instance and orphan-immune; the un-rootedMAXstays only as the--derivation-livefallback. Written once,ON CONFLICT DO NOTHING.2026-08-22T16:01:52Zbecomes this instance's cross-check, not the source.Docs only, one paragraph. The script change is TASK-046 (pod-architect).
🤖 Generated with Claude Code