feat: P4 qdrant collection lifecycle (self-heal + guarded rebuild)

- shared TS collection manager: self-heal creates missing collection (1024/cosine)
  and missing keyword payload indexes; never mutates incompatible contracts
  (semantic_index_incompatible); async index visibility polled with bounded deadline
- session admission (qdrantEnsure) uses the manager in self-heal mode; operator path
  keeps require_existing semantics
- runtime lease exposes semanticQdrantUrl to the operator
- operator commands vector-inspect/vector-rebuild with exact confirmation guards
- thothctl workspace vector inspect|rebuild (Go) with --collection/--confirm/--destroy
- p4 acceptance runner: real Qdrant (v1.18.2) lifecycle checks, 11/11 PASS
- docs: CLI contract, manual walkthrough P4 (PENDING), PROJECT_STATE
This commit is contained in:
2026-08-12 20:00:14 +02:00
parent 230a876314
commit e056c19e62
20 changed files with 1041 additions and 32 deletions
+25
View File
@@ -31,6 +31,31 @@
`3b0726472e15c157…`.
- **Manual gate:** P3 walkthrough in `docs/testing/p2-p6-manual-verification.md`; decision
**PENDING**. P4 starts only after an explicit new authorization.
### P4 Qdrant collection lifecycle — implementation complete, automated PASS, manual PENDING (2026-08-12)
- **Scope:** P4 (PRD D4): one shared TypeScript collection manager owns the Qdrant collection
and payload-index contract; session admission self-heals a missing collection (1024/cosine +
the 8 required keyword payload indexes) and adds missing indexes, but never mutates an
incompatible collection (`semantic_index_incompatible`); the operator path keeps
`require_existing` semantics.
- **Host CLI:** `thothctl workspace vector inspect` (read-only contract report) and
`thothctl workspace vector rebuild --workspace <id> --collection <name> --confirm <name> --destroy`
(guarded delete/recreate of only the descriptor-owned collection, with durable state before
deletion and verification after recreation; mismatched confirmation or missing `--destroy`
→ exit 2).
- **Key files:** `backend/src/workspaces/qdrant-collection.ts` (+test), `backend/src/tht/tht-runner.ts`
(`qdrantEnsure` self-heal for admission; default `require_existing` elsewhere),
`backend/src/workspaces/runtime-config-lease.ts` (lease exposes `semanticQdrantUrl`),
`backend/src/workspace-maintenance.ts` + `preprocessing-service.ts` (`vector-inspect`/`vector-rebuild`
operator commands), `tools/thothctl/internal/workspaceops/operations.go` (+tests).
- **Automated acceptance:** PASS 11/11 (run `p4-3a001f83fae22fe72056dc52e5ff63b5`,
report `.artifacts/p4-integration/...` retained via `--keep`): preflight, clean_state, ownership,
qdrant_up, self_heal_create_missing, self_heal_repairs_missing_index, incompatible_refused,
require_existing_refused, rebuild_recreates_contract, secret_scan, cleanup_confinement.
- **Gates:** backend 666/666 + tsc clean; Go build+test 9/9; p4 runner unit tests 3/3; harness
841 passed (only the two pre-existing debt failures unchanged).
- **Manual acceptance:** PENDING — walkthrough section P4 in `docs/testing/p2-p6-manual-verification.md`.
### P2 host preprocessing CLI — implementation complete, automated PASS, manual PENDING (2026-08-11)