[P1] I04: Publish document versions atomically through a transactional indexing outbox #21

Open
opened 2026-10-21 20:29:28 +02:00 by amiryahaya · 0 comments
Owner

Backlog ID: I04 | Priority: P1 | Phase: M4 — Consistent indexing and hybrid retrieval

Outcome and scope

Connect canonical chunks/FTS and vector indexing through a PostgreSQL transactional outbox with retries, leased work, dead letters and explicit reconciliation.

Dependencies and gates

Engineering prerequisites: #18 (I02), #19 (I03), #20 (R01)

Synthetic-data development may proceed. Production use remains subject to the decision gates in the SRS.

Starting points

crates/ingestion/src/outbox/; crates/storage-postgres/; crates/storage-qdrant/; migrations/

These are current files or proposed responsibility boundaries; finalize a focused implementation plan before coding. Existing local scaffolding is uncommitted and is not evidence of completion.

Acceptance criteria

  • Only mark READY after canonical data, lexical index, vector writes and expected generation/count verification all succeed.
  • Lease expiry, duplicate/out-of-order events and worker restarts cannot publish partial or superseded versions.
  • Failed extraction/index/policy synchronization leaves content unavailable; operators get safe lag/error metrics and remediation commands.
  • Reindex uses a new embedding generation and verified switch; rollback obeys retention and policy.

Verification

Inject failure before/after each PostgreSQL/Qdrant write, redeliver events and restart workers; prove no partial READY versions and eventual consistent recovery.

Behavior changes follow Red → Green → Refactor. Run affected Rust shared contract/unit tests and real PostgreSQL/Qdrant/runtime integration tests where applicable; frontend changes run typecheck/build and the relevant browser tests. Record exact commands/results in the implementation PR. Documentation/decision tasks use recorded review evidence.

Requirements and design

FR-ING-004–005; NFR-OPS-001; architecture §8

Sources: SRS, system design. Local planning context: docs/implementation-plan.md and docs/development-backlog.md (not published by this task).

Security impact: Use synthetic fixtures until approved for operational data. Preserve current authorization, markings, provenance and default-deny behavior; exclude protected payloads/secrets from operational telemetry. No classified-deployment or PQC-compliance claim is implied by closing this issue.

Parent roadmap: #1

**Backlog ID:** I04 | **Priority:** P1 | **Phase:** M4 — Consistent indexing and hybrid retrieval ## Outcome and scope Connect canonical chunks/FTS and vector indexing through a PostgreSQL transactional outbox with retries, leased work, dead letters and explicit reconciliation. ## Dependencies and gates **Engineering prerequisites:** #18 (I02), #19 (I03), #20 (R01) Synthetic-data development may proceed. Production use remains subject to the decision gates in the SRS. ## Starting points crates/ingestion/src/outbox/; crates/storage-postgres/; crates/storage-qdrant/; migrations/ These are current files or proposed responsibility boundaries; finalize a focused implementation plan before coding. Existing local scaffolding is uncommitted and is not evidence of completion. ## Acceptance criteria - [ ] Only mark READY after canonical data, lexical index, vector writes and expected generation/count verification all succeed. - [ ] Lease expiry, duplicate/out-of-order events and worker restarts cannot publish partial or superseded versions. - [ ] Failed extraction/index/policy synchronization leaves content unavailable; operators get safe lag/error metrics and remediation commands. - [ ] Reindex uses a new embedding generation and verified switch; rollback obeys retention and policy. ## Verification Inject failure before/after each PostgreSQL/Qdrant write, redeliver events and restart workers; prove no partial READY versions and eventual consistent recovery. Behavior changes follow Red → Green → Refactor. Run affected Rust shared contract/unit tests and real PostgreSQL/Qdrant/runtime integration tests where applicable; frontend changes run typecheck/build and the relevant browser tests. Record exact commands/results in the implementation PR. Documentation/decision tasks use recorded review evidence. ## Requirements and design FR-ING-004–005; NFR-OPS-001; architecture §8 Sources: [SRS](https://forgejo.primatekun.tech/primatekuntech/rag-rust/src/branch/main/docs/SRS.md), [system design](https://forgejo.primatekun.tech/primatekuntech/rag-rust/src/branch/main/docs/architecture.md). Local planning context: `docs/implementation-plan.md` and `docs/development-backlog.md` (not published by this task). **Security impact:** Use synthetic fixtures until approved for operational data. Preserve current authorization, markings, provenance and default-deny behavior; exclude protected payloads/secrets from operational telemetry. No classified-deployment or PQC-compliance claim is implied by closing this issue. **Parent roadmap:** #1
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
primatekuntech/rag-rust#21
No description provided.