fix(knowledge): read an unfilled keyword candidate's source from its document - #8176
Merged
waleedlatif1 merged 3 commits intoSep 22, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
|
…document The Tin keyword page took each candidate's source from its projection row. A row the source and ACL fill has not reached carries a NULL source, so a chunk from a source that needs a live reader proof was never recognized as one: the proof was not resolved, hydration ran without the caller's grants, and the document was hidden from a member who can read it. Until the keyword projection is filled, a page's unfilled rows now take their source from the document, one primary-key read per row of the page after its limit. The excluded-sources filter asks the document the same way, as the vector leg already does, so a denied source's unfilled rows stop taking slots on a rebuilt page. The filled path's statement is unchanged.
…e trigger now skips The projection trigger no longer writes an ACL onto chunks the backfill has not filled, so the ACL write tests can no longer see an unchanged write through those rows. They now count the document writes that fire the fan-out trigger, and expect a changed ACL on filled chunks only.
waleedlatif1
force-pushed
the
fix/search-unfilled-row-source-from-document
branch
from
September 22, 2026 23:23
a8ec9db to
d43d20a
Compare
…rd source exclusion
Collaborator
Author
Collaborator
Author
|
@cubic-dev-ai review this PR |
Contributor
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
waleedlatif1
deleted the
fix/search-unfilled-row-source-from-document
branch
September 22, 2026 23:54
This branch was previously deployed
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.
Summary
connectorIdfrom its projection row. Rows the source/ACL fill hasn't reached carryconnector_id = NULL, so a chunk from a live-proof source (GitHub installation, Confluence site) wasn't recognized as gated: the grants weren't resolved, hydration ran without them, and the document was hidden from a member who can read it (fails closed, no leak). ACL writes used to repair those rows incidentally; now that unchanged ACLs aren't rewritten and unfilled rows are left to the backfill, they stay NULL until the fill reaches themembedding_keyword_tinis filled, the page's unfilled rows (acl IS NULL) take their source from the document: a primary-key read per row of the page, after itsLIMIT, never per ranked row. Filled rows keep the row's sourceembedding_searchis unfilled (vector.page), so it needed no change; the new test covers itsync-persistence.postgres.test.ts. Those tests now count the document writes that fire the fan-out trigger (0 for an unchanged ACL) and expect a changed ACL on filled chunks only; reverting fix(knowledge): refresh unchanged mirrored ACLs without firing the projection fan-out #8169's fix still turns 2 redembedding_search.connector_id, so an unfilled row with a NULL source is only reachable through the sliced/uploads walk until the fill reaches it (recall, not access)Type of Change
Testing
unfilled-projection-source.integration.ts(real migrated Postgres, real GitHub installation grant fixture, Tin operators shimmed since the test DB has no Tin): an unfilled keyword row and an unfilled vector row with NULL source reach the member holding the grant and stay hidden from one without it; the filled path behaves the same; after a denial the rebuilt keyword page no longer carries the denied source's unfilled rowqueries.ts→ 2 red; row-sourced page only → 2 red; row-only exclusion → 1 red; making the vector page trust the row source → 1 redloops= page rows)bun run lint,bun run check:audits,type-check,lib/knowledge/searchunit tests passChecklist