Repository navigation
improvement(knowledge): finish Confluence passes past unreadable attachments, rank unauthenticated keyword search in one statement - #8975
Conversation
…chments, rank unauthenticated keyword search in one statement - Confluence: a 403/404 on one parent's attachment listing is skipped with a warning instead of recorded as a listing failure, so the pass can finish and advance lastSyncAt. The page still marks the listing reconciliation-unsafe, so attachments it did not list are kept, never deleted. Missing scopes and server failures stay listing failures. - Connector counts: the member engine keeps the recorded document count on an unfinished slice once a pass has finished, the same gate the content engine uses. The count query and gate now live in sync-primitives. - Keyword search: callers with no person behind them rank through the same materialized candidate statement signed-in readers use, instead of ORDER BY ts_rank_cd over a per-chunk join. Same ACL predicate and global ordering, ties now broken by chunk id; still unbudgeted.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
There was a problem hiding this comment.
No issues found across 7 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.
Turn on auto-fix | Re-trigger cubic
|
… two-step reference
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
No issues found across 8 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.
Turn on auto-fix | Re-trigger cubic
Summary
Confluence: a 403/404 on one parent's attachments no longer fails the listing
listConfluenceAttachmentsused to recordattachment_access_denied(403/404 on/pages/{id}/attachments) as a listing failure. Any pass with one permanently restricted page therefore stayed incomplete: the sync waspartial,lastSyncAtnever advanced, and every slice recounted the whole connector.reconciliationSafe: falseand setssyncContext.reconciliationUnsafe. Becausecheckpoint.unsafestays set for the rest of the pass, reconciliation never deletes attachments it did not list. This is the same deletion behavior as before.attachment_scope_mismatch) and server failures (attachment_listing_unavailable, plus the 3-in-a-row abort) are still listing failures. A failure listing the pages themselves still throws.Connector document count
countLiveConnectorDocumentsand the gate (keepsRecordedDocCount) moved tosync-primitivesso both engines share them.Keyword search for callers with no person behind them (workflow, API, Copilot)
keywordCandidateRankingQuery, the materialized match → readable documents → rank statement signed-in readers already use. The oldORDER BY ts_rank_cdover a per-chunkembedding ⋈ documentjoin (with a per-base fan-out for many bases) is gone. Over 7 days in prod the old shape ran p50 ~400 ms / p99 ~9.2 s; the CTE shape ran p50 ~27 ms / p99 ~1.2 s.read.rankCondition, and hydration is unchanged. The ordering is still a globalts_rank_cd DESCover every readable match. Ties are now broken by chunk id instead of arbitrarily. The candidate side also requiresdocument.knowledge_base_idto be in the searched bases, which only makes the filter stricter.Not changed (deliberately)
deletedAt: nullon relisted tombstones) and resurrecting updates are not counted separately. Out-of-band excludes, deletes and restores never touchlastSyncDocCount. Without a recorded count timestamp there is also no bounded-staleness variant.Test plan
attachments.test.ts: a 403/404 parent is skipped, the listing stays complete, nolistingFailures, and it is still reconciliation-unsafe. Fails on the old code.member-sync-engine-content-credential.test.ts: an unfinished slice after a finished pass writes nolastSyncDocCount. Fails on the old code.