Repository navigation
A fact is not stale while a new version of its document is still on its way to extraction, so a re-push no longer flags facts it has not yet had a chance to restate - #1489
Merged
WaylandYang merged 4 commits intoNov 16, 2026
Conversation
…ts way to extraction, so a re-push no longer flags facts it has not yet had a chance to restate Signed-off-by: Bogdan Szabo <bogdan@re-cinq.com>
…t whose new version was unread then is not stale then Signed-off-by: Bogdan Szabo <bogdan@re-cinq.com>
WaylandYang
requested changes
Nov 10, 2026
WaylandYang
left a comment
Contributor
There was a problem hiding this comment.
Thanks, the problem is real: right after a re-push every fact from that document reads as stale until extraction runs. A few things before merge:
- The as-of check rewrites history. `awaits_a_new_version_at` treats a chunk as waiting at T when `extracted_at > T`, but a forced re-extract sets `extracted_at = NULL` on live chunks and then sets it to now again (documents.rs, the two `UPDATE chunks SET extracted_at = NULL`). So if v2 was read on Feb 2 and dropped F, a re-extract in March makes the view as of Feb 15 show F as not stale. Please base the as-of answer on something a re-extract doesn't move, and add a test for it.
- The check joins chunks on `fe.document_id`, which can be NULL; joining through `fe.chunk_id` covers those rows.
- `docs/design/governance.md` still defines unconfirmed as every evidence chunk superseded; please add the waiting rule.
- Small: the macro, the constant and the `None` branch say the same thing; one function would do.
…ugh the cited chunk, so a forced re-extract cannot change what a replay shows and evidence without a document id still waits Signed-off-by: Bogdan Szabo <bogdan@re-cinq.com>
Contributor
Author
|
Thank you for the careful read, you were right on all four. They are in 8203faa.
The re-extract case has its own test, v2 read, then a forced re-extract, then a replay that must read the same as before. |
WaylandYang
approved these changes
Nov 16, 2026
WaylandYang
left a comment
Contributor
There was a problem hiding this comment.
Thanks, this addresses all four points cleanly, and the re-extract replay test is exactly what I was after. Happy to take the first-read timestamp as a separate follow-up if you want to send it. Merging.
gedaiu
added a commit
to re-cinq/utopia
that referenced
this pull request
Nov 16, 2026
Sync upstream dev into re-dev (2026-11-16): deeplethe#1489, deeplethe#1492 and 11 more
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.
Closes #1477
When a document is pushed again, the old chunks are superseded straight away, but the new ones wait in the queue until extraction reads them. In that gap every fact the document supported looks stale, because all of its evidence sits on old chunks, even though nothing has had a chance to restate it yet. This change makes a fact wait instead: while a live chunk of a cited document is still unread and the document is ingesting or queued for extraction, the fact is not stale in the entity view and is not counted or listed in the review queue. Once the new chunk is read and does not restate the fact, it goes stale as before. The entity view takes
as_of, so the wait is read at that moment too: a chunk that was live and unread then holds the fact back, whether it was read later or is still on its way.This includes the refinement from the issue's 2026-11-07 comment: only a version that something will still read holds a fact back. A document whose extraction is off, skipped or failed is not waited for, because on our side about 12,500 facts waited forever on versions like that.
The new test seeds a re-pushed document and checks the entity view, the review badge and the review list while the version is queued or ingesting, after it has been read, and for the extraction off, skipped and failed cases. A second test replays the entity view to before the re-push, between the re-push and its reading, and after it. It fails without the change.
This follows the proposal in the issue, and we are glad to reshape it however you prefer.