KB-535D

GPT Review — OGV P0 Fix Prompt

3 min read Revision 1
gpt-reviewogv-p0soft-deletevector-resurrectionagent-fixlegacy-vector

GPT Review — OGV P0 Fix Prompt

Date: 2026-05-03

Verdict

OGV P0 Fix Prompt is directionally correct and may proceed after one mandatory safety tightening pass. It correctly treats P0-1/P0-2/P0-3 as one end-to-end semantic-delete bug across API → PG trigger → listener → Qdrant.

Must-fix before dispatch

  1. Remove or soften the instruction to run git add -A && git commit before any patch. A pre-fix snapshot should be read-only/non-invasive if possible: record git status, git rev-parse HEAD, and archive/copy changed files. Commit only if repository policy explicitly allows and User approves.
  2. Do not require creating a test document in production without a stricter test namespace and cleanup rule. Use a clearly isolated path such as test/ogv-p0/..., and ensure test docs are cleaned after PASS. If production test document creation is not approved, use staging or a dry-run/unit test harness.
  3. Avoid forcing docker restart unless code reload requires it. Agent must first determine service reload behavior and choose the least disruptive reload. Restart is allowed only if necessary and explicitly reported.
  4. Add a smoke test for API search/RAG after patch: normal KB search must still return expected results from production_documents.
  5. Clarify that cleanup of the 47 known orphan vectors must be performed only after backup and after prevention patch PASS. The cleanup method must be dry-run/list-first, then delete exactly the approved orphan IDs.
  6. Phase 4 must not use broad filter deletes without reviewed ID list. Deleting by deleted_at/status indirectly is forbidden; delete only vectors whose document_id is in the approved orphan list.
  7. Trigger patch must preserve existing skip filters for comments/registries/empty/too-short documents.
  8. Listener patch must be idempotent: missing PG row, deleted row, or deleted status all route to vector delete/no-op; active row routes to upsert.
  9. Report must include before/after counts for all three classes: orphan bug, ghost bug, correct-behavior ghost.

Dispatch condition

After Opus applies the tightening above, dispatch is approved. No further architecture discussion is needed.

Next directive to Opus

Produce OGV-P0 Fix Prompt v0.2 with the nine refinements above, then present the final prompt for dispatch. Do not execute directly.