Add the scoped PostgreSQL/pgvector schema, independent ingestion settings and ports, embedding profile checks, and trusted administrator bootstrap. Include repository contracts and guidance, organized provider-free and PostgreSQL tests, deployment setup, and byte-preserving migration attributes. Validation: 163 tests passed; all 48 PostgreSQL cases passed with pgvector Python 0.5.0 and 0.3.6. No production schema or historical metadata was changed.
2.9 KiB
Repository guidance
Phase 1 development
Use the shared reference map for document authority, current source locations, commands, and unresolved decisions. Read applicable nested instructions before editing.
- Deliver Phase 1 with a modular FastAPI backend and a separate ingestion worker from the same codebase. The current prototype does not yet implement that target.
- Each upload creates an independent document; never overwrite its original content in place. Do not introduce
document_versions,version_id, orversion_nofor document content. - Chunks and ingestion jobs reference
document_id; answer sources referencedocument_idandchunk_id. Retry processes the same eligible failed document and job. - Only authorized, ready, active, undeleted documents are searchable. Backend-derived identity and scope cannot be overridden by model arguments.
- Text and Live use the same backend search implementation. Keep persistent provider secrets server-side and provider-specific objects behind adapters.
- Follow the documented request deduplication, worker claim/lease fencing, atomic publication, and context invalidation rules for affected workflows.
- Preserve configuration revisions, knowledge selection revisions, access epochs, and embedding profile metadata; these are not document-content versioning.
- Keep API/schema documentation and consumers aligned with intentional contract changes. Never change a contract merely to excuse a bug.
- Avoid unnecessary dependencies, services, abstractions, and unrelated refactoring. Preserve unrelated working-tree changes.
The Phase 1 plan governs scope, API/database documents govern their contracts, and the implementation guide governs workflows. Broader architecture is context, not authorization for deferred features. Existing code is evidence, not proof that conflicting behavior is correct. Surface material contradictions; isolate missing product decisions and continue independent work.
Skills and checks
Repository skills live in .agents/skills/: implement-feature, write-tests, and review-change. Implementation includes necessary validation; tests-only work reports product defects without silently fixing them; review is read-only unless fixes are requested. Do not recursively dispatch between skills.
Verified inspection commands from the repository root: git status --short, git diff --check, and rg --files --hidden -g '!.git/**'. The dependency manifest is pyproject.toml; provider-free checks use .venv/Scripts/python -m pytest -m "not postgres". PostgreSQL acceptance uses .venv/Scripts/python -m pytest -m postgres --require-postgres with an isolated TEST_DATABASE_URL. Missing configuration must fail acceptance; ordinary-suite skips do not prove database behavior. No build/lint pipeline exists. See the reference map and docs/ingestion-foundation-setup.md for setup and actual results. Treat applied revisions as immutable.