Skip to content

Settle derived conclusions after source cleanup removes their evidence - #897

Merged
WaylandYang merged 4 commits into
deeplethe:devfrom
Maya-Kid:fix/settle-source-cleanup
Sep 24, 2026
Merged

WaylandYang merged 4 commits into
deeplethe:devfrom
Maya-Kid:fix/settle-source-cleanup

Conversation

@Maya-Kid

@Maya-Kid Maya-Kid commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Source cleanup removed missing documents without settling the conclusions supported by them. Reuse the single-document deletion path's settle_derivations once 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 existing api source kind.

Validation: a8d548a, based on dev@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=1 was 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 at 8e60274 succeeds. This PR remains based directly on dev, without a dependency on #884. No schema, API or scheduling policy change.

Refs #875.

…te already does

Signed-off-by: dada-yan <BinjunYann@gmail.com>
Signed-off-by: dada-yan <BinjunYann@gmail.com>

@WaylandYang WaylandYang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@WaylandYang
WaylandYang merged commit 4f9c383 into deeplethe:dev Sep 24, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants