Conversation
sun-970
requested review from
Bindy-lbb,
PeterGuy326 and
waterbro-8
as code owners
September 8, 2026 05:42
PeterGuy326
requested changes
Sep 9, 2026
PeterGuy326
left a comment
Collaborator
There was a problem hiding this comment.
Gate decision
REQUEST CHANGES on current head 8f08cf6e57685fce5f21be8ac96ddbcfdbd8332f.
Blocking findings
- The branch is stacked on
#184:git log origin/main..origin/pr-185has89bb12bas its parent, and the diff therefore includes the live recall producer files. The PR body presents this as the five-item data-plane hygiene change but does not declare the dependency. Rebase/split it, or explicitly document and enforce the merge order so the same files are not merged twice. - The acceptance table leaves the migration, EXPLAIN, relation cursor, generation-list, and existing-integration checks unchecked; no checks are reported for this head. Please run and attach the exact-head CI/integration evidence.
Do not treat the unit-level changes as complete until the stacked scope and database acceptance are resolved.
…ytefolk#178) 1. Add UNIQUE (file_id, chunk_index) on embeddings_text with defensive deduplication before the constraint. 2. Add partial indexes on memories(source_file_id) and memories(created_by_user_id) to avoid seq scans on ON DELETE SET NULL. 3. Add ON DELETE CASCADE to memory_relations FKs to align with the memories cascade and prevent orphan-edge failures on workspace delete. 4. Fix N+1 in indexgeneration List: batch-fetch generations for all builds in one query instead of per-build. 5. Add keyset cursor to ListRelations reusing the existing encodeListCursor/decodeListCursor helpers from memory/list.go. Includes migration 0025 with Down blocks and an integration test proving the embeddings_text uniqueness constraint rejects duplicates.
- Remove bytefolk#184 stacking (recall benchmark is a separate PR) - Rename migration 0025 → 0026 to avoid collision with bytefolk#180
sun-970
force-pushed
the
chore/data-plane-hygiene-178
branch
from
September 10, 2026 01:51
8f08cf6 to
3104d35
Compare
Collaborator
|
Current-head CI approval readback (2026-09-10) Head:
Failures at this snapshot: |
This was referenced Sep 10, 2026
Contributor
Author
|
Superseded by @PeterGuy326's #195 which covers the same changes on current main. Closing per the '本轮先不合并' directive. |
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
Resolves all five items from #178:
embeddings_textuniqueness — migration 0026 addsUNIQUE (file_id, chunk_index)with defensive deduplication before the constraint. Integration test proves the constraint rejects duplicates.memoriesunindexed FKs — partial indexes onsource_file_idandcreated_by_user_id(WHERE IS NOT NULL) to avoid seq scans onON DELETE SET NULL.memory_relationscascade alignment — FKs nowON DELETE CASCADEto matchmemories.workspace_id, preventing orphan-edge failures on workspace delete.indexgeneration.List— batch-fetches generations for all builds in one query (WHERE build_id = ANY($1)) instead of per-build.ListRelations— reusesencodeListCursor/decodeListCursorfrommemory/list.gowith a relation-specific filter hash.Changes
server/internal/db/migrations/0026_data_plane_hygiene.sql— schema fixes withDownblocksserver/internal/db/migrations_test.go— integration test for uniqueness constraintserver/internal/indexgeneration/service.go+store.go— N+1 fixserver/internal/memory/relation.go— cursor supportserver/internal/api/— handler, interface, and test stub updatesserver/internal/memory/memory_integration_test.go— caller updatesDependencies
This PR was previously stacked on #184. It has been rebased onto main and is now independent.
Test plan
TestEmbeddingsTextUniqueConstraintpasses withMEM_TEST_DBsetEXPLAINforON DELETE SET NULLpath uses the new partial index (item 2)ListRelationsreturnsnext_cursorwhen results exceed limitindexgeneration.Listreturns correct generations per build (no N+1)Closes #178