KB-72FC

GPT Review — Legacy Vector + IU-0 Delay Directive

5 min read Revision 1
vectoriu-0legacy-vectordelaydebouncegpt-reviewopus-directive

GPT Review — Legacy Vector Stabilization + IU-0 Outline-C Delay Directive

Date: 2026-05-02 Reviewed: Opus report on Legacy Vector Stabilization OUTLINE and IU-0 OUTLINE-C Additional user requirement: vector processing from PG/IU should be delayed about 2-3 minutes so AI/Agent CRUD on PG remains fast and stable.

Searched KB for: vector delay 2-3 minutes, PG CRUD AI Agent debounce queue, TD-131, vector sync investigation.

Relevant evidence found:

  • TD-131: API CRUD currently syncs/deletes vector directly; direct SQL bypass caused vector drift; health thresholds and vector audit were introduced.
  • VRC 2026-05-02: update path currently deletes old chunks then upserts new chunks; this is not atomic across PG/Qdrant; PG trigger function exists but trigger missing; scheduled audit failing.

Exact prior design text requiring 2-3 minute vector delay was not found in the quick KB search. Treat the user instruction as a mandatory design requirement to preserve: vector embedding/projection must be asynchronous and delayed/debounced, not synchronous with PG CRUD.

Verdict

Opus deliverables are directionally PASS, but need a mandatory correction before any Agent execution prompt:

  • Do not fix V1 by creating a trigger that causes immediate re-embed/upsert.
  • The trigger/listener path must be lightweight and must enqueue or mark pending only.
  • Real embedding/vector projection should run after a debounce delay of about 2-3 minutes and should coalesce multiple updates for the same document/unit.
  • This applies to legacy PG vector sync repair and future IU vector design.

Required revision to Track A — Legacy Vector Stabilization

Rename V1 from “PG Trigger Missing — create trigger” to “PG Notify/Queue Missing — restore lightweight delayed-sync signal.”

V1 fix principles:

  1. Trigger must not do embeddings.
  2. Trigger must not block CRUD.
  3. Trigger may only notify/enqueue/mark vector_status=pending if safe.
  4. Worker must wait about 120-180 seconds before embedding.
  5. Worker must debounce/coalesce repeated updates by document_id.
  6. Metadata-only updates should not re-embed.
  7. If content changes multiple times inside debounce window, only latest content should be embedded.
  8. Deletion should be safe and may be treated as higher priority, but still must not block CRUD.

V1 now requires an additional read-only investigation step before design execution:

  • whether current pg_vector_listener.py embeds immediately on NOTIFY;
  • whether existing code already supports queue/delay/debounce;
  • if not, propose a delayed queue worker design before any trigger creation.

Required revision to Track B — IU-0 OUTLINE-C

Add a new IU Vector Processing Cadence section:

  • IU-VP-6: Vector projection is asynchronous and delayed by default.
  • Default delay target: 120-180 seconds after last content change.
  • Debounce key: unit_version_id for IU, document_id for legacy KB.
  • CRUD path must stay PG-fast; vector projection must not be in the critical write path.
  • Search freshness SLA is eventual consistency, not immediate consistency.
  • For urgent manual cases, reindex may be an approved explicit operation, not default CRUD behavior.

Duplicate content design must consider delay:

  • KB draft may vectorize before IU final.
  • IU final may become searchable after debounce.
  • Search adapter must expose source/status/freshness and prefer IU enacted only when IU vector is current, not stale/pending.

Directive to Opus

Next output must be a revised pair of artifacts, not execution:

  1. Legacy Vector Stabilization OUTLINE v2

    • Preserve V1-V5 structure.
    • Insert Vector Delay/Debounce requirement at the top.
    • Revise V1 fix plan to avoid immediate vector embedding.
    • Add read-only check for current listener sync timing.
    • Add queue/delay/debounce design options.
    • Keep V5 backup first.
    • Do not execute anything.
  2. IU-0 OUTLINE-D

    • Revise §6 to include IU-VP-6 async/delayed projection.
    • Phase 0 stays read-only mapping adapter.
    • Phase 1 IU collection must use delayed queue semantics.
    • Phase 2 search adapter must handle duplicate + stale/pending IU vectors.
    • Full draft still not allowed until User/GPT passes Outline-D.

Non-negotiable guardrails

  • No trigger creation yet.
  • No immediate embedding in PG CRUD path.
  • No reindex, cleanup, audit heal, or Qdrant mutation.
  • No service restart, no code patch, no crontab change.
  • No P44-6.
  • All fixes require separate approval after revised runbook.

Review conclusion

Proceed with revision, not execution. The missing 2-3 minute delay is a critical design requirement and must be inserted before any legacy vector repair or IU vector design is approved.

Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/reviews/gpt-review-legacy-vector-iu0-outline-c-delay-directive-2026-05-02.md