Home

giogio / openez-graph

public
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

fix: resolve second-round review blockers in RAG flow

3 months ago

af625b4
Authored
asta-nguyen8/10/2026, 1:49:24 AM
Critical 1: Legacy embedding migration no longer causes data loss on DB
open. Instead of DROP TABLE, the migration records embedding_format=text
in index_meta so retrieval skips vector search (defers to FTS). The
reindex path (resetIndexArtifacts) recreates the table as BLOB and clears
the marker. Legacy TEXT data is preserved until explicit reindex.

High 2: Cross-process graph race fixed with lease-based CAS. Build claims
include a lease expiry timestamp; stale leases allow takeover from dead
processes. Before publishing, the builder re-checks ownership and generation.

High 3: Process death with running status no longer hangs queries. The
poll loop has a MAX_WAIT_MS timeout; leases allow takeover.

High 4: Graph migration runs only once via registry_meta marker
graph_invalidation_v1, not on every restart.

Medium 5: codeQuery() requires ensureGraph at runtime when skipGraphExpand
is false, with a clear error instead of silent empty graph.

Medium 6: Duplicate nested function calls resolve to correct lexical scope.
Graph edge resolution tries qualified name (callerName.calleeName) first.

All gates: 176 pass/1 skip/0 fail, turbo typecheck 8/8, root tsc pass,
format check pass, web+cli build pass, MCP smoke test pass.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>

Parent72d2d5d

15 files changed
  • docs/superpowers/plans/2026-08-09-rag-flow-correctness-remediation.md+785−0
  • packages/core/src/retrieval.ts+18−6
  • packages/db/src/sqlite/fts-repository.ts+27−1
  • packages/db/src/sqlite/registry-db.ts+29−7
  • packages/db/src/sqlite/registry-repository.ts+26−6
  • packages/db/src/sqlite/types.ts+17−5
  • packages/db/src/sqlite/workspace-db.ts+19−24
packages/indexer/src/graph-service.ts
+46
−13
  • packages/indexer/src/index-workspace.ts+7−1
  • sol-review.md+426−0
  • tests/e2e-search.test.ts+2−0
  • tests/embedding-migration.test.ts+68−7
  • tests/graph-lifecycle.test.ts+3−2
  • tests/index-workspace.test.ts+36−0
  • tests/oxc-parser.test.ts+8−0