Settle derived conclusions after source cleanup removes their evidence - #897
Merged
Merged
Conversation
…te already does Signed-off-by: dada-yan <BinjunYann@gmail.com>
This was referenced Sep 24, 2026
Signed-off-by: dada-yan <BinjunYann@gmail.com>
WaylandYang
approved these changes
Sep 24, 2026
WaylandYang
left a comment
Contributor
There was a problem hiding this comment.
Minimal and correct: it reuses the same settle_derivations the single-delete and ingest paths already call, once per batch, gated by the base's inference setting. The real-database test walks both deletion paths on one fixture and pins the unrelated conclusion's row identity, which is the right invariant. Only note: like single delete, a failure in the settle step returns 500 after the documents are already gone; consistent with existing behaviour, so not blocking. LGTM.
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.
Source cleanup removed missing documents without settling the conclusions supported by them. Reuse the single-document deletion path's
settle_derivationsonce after a nonempty batch, respecting the knowledge base's existing inference setting.The authenticated PostgreSQL regression covers both deletion paths. It verifies that single deletion preserves cup-2's conclusion and that a pre-existing, unrelated cup-3 keeps exactly the same conclusion row IDs through both single deletion and batch cleanup. Source fixtures use
api:external keys under the existingapisource kind.Validation:
a8d548a, based ondev@9f50e3c: Rust format, strict workspace/all-target Clippy and the PostgreSQL 16/pgvector workspace suite passed (1,079 passed, 0 failed, 5 existing ignored).UTOPIA_TEST_REQUIRE_DB=1was set and the cleanup regression was verified by name in the executed-test log. The unavailable PDF fallback utility limits that unrelated coverage.The cleanup test module is registered beside the handler, avoiding the competing module insertion at the bottom of
sources_routes.rs; a merge-tree check with #884 at8e60274succeeds. This PR remains based directly ondev, without a dependency on #884. No schema, API or scheduling policy change.Refs #875.