schema: spec-driven context: | Project: rag-service (RAG knowledge service for enterprise AI tooling) Tech stack: Node.js 22 (ESM), TypeScript 5.8 strict, Express 4, tsx runner Architecture: modular service — src/modules/{ingest,process,parsers,retrieve,answer,catalog,embeddings,vectorstore,logs}, src/api (OpenAPI), src/shared Data stores: PostgreSQL (pg) + Qdrant (@qdrant/js-client-rest) + OpenAI embeddings Testing: node:test + node:assert/strict via `npm test`; OCR Python service via `ocr-service/.venv/bin/python -m pytest ocr-service/tests` (repo-local venv) Quality: `npm run check` (tsc --noEmit, strict), `npm run build` (tsc emit to dist/) Deploy: Docker + EasyPanel; migrations are manual scripts (migrate:lifecycle, migrate:legacy:lifecycle) No linter, formatter, or coverage tooling is configured. strict_tdd: false # Fail-closed correction (2026-09-21, sdd-init guard before archive): # explicit strict_tdd: true is preserved as intent, but two in-scope projects # (./ and ocr-service/) have no single explicit workspace-level test command # that covers the complete set. Per decision gate, strict_tdd fails closed to # false. Downstream TDD execution requires per-project commands: # - ./ → npm test # - ocr-service/ → ocr-service/.venv/bin/python -m pytest ocr-service/tests testing: projects: - path: ./ stack: Node.js 22 + TypeScript 5.8 (ESM) test_command: npm test test_framework: node:test (node --test via tsx) layers: unit: true integration: true e2e: false coverage: available: false command: "" quality: linter: false type_checker: true type_checker_command: npm run check formatter: false - path: ocr-service/ stack: Python 3.11 + FastAPI 0.116 + PaddleOCR (uvicorn, httpx) test_command: ocr-service/.venv/bin/python -m pytest ocr-service/tests test_framework: pytest 8.4 (FastAPI TestClient) layers: unit: true integration: true e2e: false coverage: available: false command: "" quality: linter: false type_checker: false formatter: false rules: proposal: - Include rollback plan for risky changes (migrations and Qdrant/PostgreSQL data operations) - Reference existing module boundaries under src/modules/ specs: - Use Given/When/Then for scenarios - Use RFC 2119 keywords (MUST, SHALL, SHOULD, MAY) design: - Document architecture decisions with rationale - Keep module boundaries; parsers/ingest extensions must follow the parser-registry pattern tasks: - Group by phase, use hierarchical numbering - Keep tasks completable in one session - Respect review_budget_lines: 400 (auto-chain delivery when exceeded) apply: guidelines: - Follow existing code patterns (ESM imports with .js extensions, strict types) - Never read or expose .env* files, llaves, or backups/ contents tdd: true test_commands: - npm test - ocr-service/.venv/bin/python -m pytest ocr-service/tests verify: test_commands: - npm test - ocr-service/.venv/bin/python -m pytest ocr-service/tests build_command: npm run build coverage_threshold: 0 archive: - Warn before merging destructive deltas