cpatpa lands design docs for five roadmap phases - web search through knowledge collections
Five docs-only commits covering Phases 10-14: web search with SSRF defence, groups and granular RBAC, multi-model side-by-side comparison, pgvector RAG with hybrid retrieval, and knowledge collections. No code yet, but the data model and migration plans are detailed enough to preview where this fork is heading.
The web search design (fb928a96, revised in f96b450a) is the most immediately useful for other forks. The initial design picked SearXNG as the default provider; the revision in the same batch flipped it to Brave Search (cleaner commercial ToS, one env var) with SearXNG as an alternative. That decision reversal within a single design pass is a good sign the author is working from the actual constraints rather than preferences. The SSRF defence section is worth reading regardless of which search story you pick: scheme/port allowlist (http/https, 80/443 only), DNS resolution that blocks RFC1918, loopback, link-local, ULA, and cloud metadata addresses re-checked on every redirect, content-type allowlist, and hard caps on bytes, chars, time, and redirect count. The blocklist is seeded with paste sites and *.onion; workspace blocklists stack on top of the org list and cannot be removed at the workspace level.
Phase 11 (groups, f96b450a) plans four new tables: groups, group_members, permissions (capability catalogue with default_for_role mapping and admin_locked flags), group_permissions. Two auto-managed system groups per workspace ("All members", "Admins") are maintained by triggers. project_members and review_members gain a nullable group_id alongside user_id. Effective permissions are resolved per request and exposed as req.can('capability.key'). The migration uses nullable columns and concurrent index builds to avoid locking on PG16.
Phase 12 (multi-model compare, 876049f9) adds mode and compare_models to chats, and turn_index, branch_index, model_id, and three cost columns to chat_messages. Cost capture is on for every chat from this phase, compare and non-compare alike. A model_prices reference table holds per-model rates, admin-editable. Policy: allow_compare_mode defaults off, compare_mode_admin_only defaults on.
Phase 13 (pgvector RAG, 56917d4b) is the biggest structural change. document_chunks carries page_number, heading_path text[], char_start/char_end, and a generated tsvector column. document_embeddings is one-to-one with chunks. Hybrid retrieval uses HNSW (m=16, ef_construction=64) for vector similarity and ts_rank_cd for full-text, merged with RRF k=60. The ingest queue is Postgres-backed (SELECT FOR UPDATE SKIP LOCKED, retry cap 3). Default embedding model is bge-m3 via Ollama (1024-dim). Switching the embedding model triggers a full reindex. The search_documents tool's external shape is unchanged so the model side needs no update.
Phase 14 (knowledge collections, 5f2e7203) adds a collections table with a visibility enum (private | workspace | shared), collection_documents, and collection_members reusing the Phase 11 dual-principal shape. The ACL model chosen - hybrid intersection - means a user can use any visible collection but only retrieves documents they already have access to. Adding a document to a collection never widens access. System collections per project are trigger-maintained and read-only.
Spotted something wrong? Or know the PR text has fresher detail than the writeup above?