Skip to content

[P0] Delete persisted pending embeddings by exact identity before staged resume regeneration #162

Description

@100yenadmin

Parent: #130

Problem

Installed 1.6.10-electric.4 resumed the preserved ClawSweeper staged generation, skipped 3,040 cached snapshot rows owned by the pending checkpoint window, then failed on the first regenerated batch with a duplicate CodeEmbedding.id primary key.

The current resume path intentionally does not restore pending snapshot rows, but pending rows already persisted inside the staged LadybugDB generation can remain. runEmbeddingPipeline force-selects those nodes while its stale-row deletion is gated by the restored hash map, which excludes pending owners. The live VECTOR index can therefore reject CREATE even though the restore side skipped the row.

The failure was contained to .gitnexus/lbug.staged-work; no canonical index or registry row was created.

Required behavior

  • Carry exact skipped pending row IDs into the pipeline without treating their hashes as reusable.
  • Before each regenerated batch, delete any known persisted pending row by exact primary-key identity.
  • Keep delete/reinsert exposure bounded to the current embedding batch.
  • Preserve the at-most-5,000-node pending checkpoint contract and existing snapshot preflight guarantees.
  • Add a real LadybugDB regression where the staged database already contains the pending row and the snapshot restore deliberately skips it.

Acceptance

The preserved ClawSweeper staged generation resumes on the exact released fix, promotes once, registry/meta/database counts agree, live doctor reports vector-index, and two MCP semantic queries are non-partial. No retry on .4 before the fix.

Evidence: /Volumes/LEXAR/Codex/session-notes/2026-07-20/gitnexus-repository-health-sprint/evals/clawsweeper-electric4-resume.log.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0Release-blocking priority zero work

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions