Repository navigation
Delete the dead embedding push/pull seam; keep embedding.origin for existing databases - #3382
Conversation
|
Review Type: Initial Review Code Review SummaryClean, well-scoped deletion. I verified the risky parts independently rather than relying on the PR description: the 13-param insert lines up exactly, the executable Requirements Check (issue #3337)
Placeholder arithmetic (
FindingsCritical IssuesNone. Suggested Improvements
Nitpicks
Coverage lost (assessed, acceptable)The removed tests covered only behaviour that no longer exists (push cursor, nodespace-sync
RecommendationAPPROVE — no blockers. The test-assert addition is worth a quick follow-up in this PR since it is a few lines, but it should not hold the merge. |
mstomar125
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review: APPROVE (posted as a comment, GitHub blocks self-approval). Full findings in the review comment above.
14e023e to
8cd7f3b
Compare
Address-review summaryThe review verdict was APPROVE with no blockers. One improvement and three nits came back. All four were addressed in Addressed (4 of 4)
Mutation check of the new assertions (each applied, run, reverted; the restored tree passes):
Skipped: none. Verification after the change: Re-Review DecisionDecision: NO RE-REVIEW NEEDED Rationale: the follow-up commit adds test assertions and edits three comments. It changes no production logic, so nothing new needs a second reviewer pass. The production diff is identical to the one that was reviewed. |
Nothing calls the cloud embedding sync API any more: the NodeService get/upsert/delete/apply_remote/modified_since wrappers were used only by core's own tests, and nodespace-sync stopped syncing embeddings. - Delete the five NodeService embedding wrappers. Tests read and write through NodeService::store() instead. - Delete SqliteStore::apply_remote_embeddings and embeddings_modified_since, and fold upsert_embeddings_with_origin into upsert_embeddings. The insert no longer names `origin`, so new rows take the column default 'local'. The row placeholder builder goes from 14 params to 13. - Drop idx_emb_modified from the DDL. Existing databases keep the index, and a new test pins that create_schema still opens one that has it. - Keep embedding.origin and node.sync_seq. create_schema's shape check compares column names, so dropping either would refuse every database an earlier build created. Both are now commented as unused legacy columns. - Rename the store roundtrip test, drop its cursor, provenance and query plan sections, and assert a new row stores origin 'local'. Co-Authored-By: Claude Sonnet 5 <[email protected]>
The upsert's column list and params vector are two hand-aligned lists. The roundtrip test now asserts dimension, model_name, chunk_start, chunk_end, total_chunks, content_hash and token_count, with distinct values per column so a transposed pair fails. Also tighten three comments that still read as if the removed NodeService wrappers and a second SELECT existed. Co-Authored-By: Claude Sonnet 5 <[email protected]>
8cd7f3b to
56dc9ce
Compare
Closes #3337
Deletes the embedding push/pull API that nothing calls any more, while keeping every existing database openable. Implements ADR-083 section 3 (proposed).
What changed
NodeService: deleted the five embedding wrappersget_embeddings,embeddings_modified_since,upsert_embeddings,apply_remote_embeddingsanddelete_embeddings. Core's own tests now go throughsvc.store(). Deletedtest_embedding_write_wrappers_upsert_read_delete, which only exercised the wrappers.SqliteStore: deletedapply_remote_embeddingsandembeddings_modified_since, and foldedupsert_embeddings_with_originintoupsert_embeddings. The insert no longer namesorigin, so a new row takes the column default'local'. The placeholder builder goes from 14 to 13 params per row (base = i * 13). The storeupsert_embeddings,delete_embeddingsandget_embeddingssignatures are unchanged, soembedding_service,crud, the benches and the example compile as before.db/schema.rs, comments only apart from the index): removedidx_emb_modified.embedding.originandnode.sync_seqstay, now commented as unused legacy columns.create_schemacompares column names of existing tables with the DDL, so dropping either column would send every database an earlier build created to the incompatible-database screen. Old databases keep the index, harmlessly.Dead-code confirmation
Before deleting, grepped every caller repo-wide (not just
packages/core):git grep -E 'apply_remote_embeddings|embeddings_modified_since|upsert_embeddings_with_origin'found only the definitions, the wrappers and core tests. Nothing in daemon, cli, agent, desktop-app or the TypeScript side.get_embeddings/upsert_embeddings/delete_embeddingscallers outside the deleted wrappers all use the store (embedding_service.rs,node_service/crud.rs,tests/it/embedding_service_test.rs,tests/it/search_result_scaling_test.rs,benches/query_crud.rs,examples/seed_search_corpus.rs).17f9557has no call to any of them. This PR breaks nothing there.GetEmbeddingStatusgRPC endpoint is an unrelated queue-status call and is untouched.Deviations from the issue text
scripts/check-pro-boundary.tsis not onorigin/mainyet (it is still in review). I ran the unmerged script from the ratchet branch againstorigin/mainand against this branch; it exits 0 on both. Once it lands, its one-way check only prints a notice for the drop below, so the ceilings can be tightened in any later change.fresh_database_gets_the_complete_current_schemanow also assertsnode.sync_seqexists, since the acceptance criteria call for both columns to survive.SCHEMA_SQLdiffers fromorigin/mainonly by the removedCREATE INDEX(checked by diffing the statements with comments stripped), no edited comment contains;, anda_database_that_still_has_idx_emb_modified_opensrunscreate_schemaover a database holding the old index. The embedding generation and semantic search paths are covered byembedding_service_test(all passing).Ratchet delta (script from the ratchet branch,
origin/mainvs this branch)cloudSyncHookscloudWordingproWordingEvery other marker is unchanged. The 4 remaining
cloudSyncHookshits areget_multi_membership_edges, not this seam.Tests
db::sqlite_store::tests::test_get_embeddings_roundtrip(renamed from..._and_modified_since): keeps the chunk round-trip and empty-read assertions and adds a rawSELECT origin FROM embeddingassertion that upserted rows storelocal.schema_test::a_database_that_still_has_idx_emb_modified_opens(new): runscreate_schema, createsidx_emb_modifiedby hand, runscreate_schemaagain and assertsOkand that the index is left in place.schema_test::fresh_database_gets_the_complete_current_schema: keeps theoriginassertion with its new message, addsnode.sync_seq, and dropsidx_emb_modifiedfrom the expected index list. Deletedembedding_modified_index_leads_on_origin.Mutation checks (each applied, run, then reverted)
origincolumn default changed to'remote'test_get_embeddings_roundtripfailsnode.sync_seqremoved from the DDLfresh_database_gets_the_complete_current_schemafailsi * 14test_get_embeddings_roundtripandtest_upsert_embeddings_batches_across_chunk_boundaryfail (Failed to insert embeddings batch)create_schemadrops the legacy indexa_database_that_still_has_idx_emb_modified_opensfails on the "left in place" assertioncreate_schemarefuses a database holding the legacy indexa_database_that_still_has_idx_emb_modified_opensfails on thecreate_schemacallVerification run
cargo clippy -p nodespace-core --all-targets -- -D warnings -D clippy::unused-async: clean.cargo fmt -p nodespace-core --check: clean.bun run test:changed(Rust workspace nextest plus scripts tier): passed.git grep -n -E 'apply_remote_embeddings|embeddings_modified_since|upsert_embeddings_with_origin' -- packagesprints nothing.git grep -n idx_emb_modified -- packagesprints only the new legacy-index test.🤖 Generated with Claude Code