2.2 KiB
2.2 KiB
Enterprise Knowledge Platform — Codex Rules
Read first
Before modifying code, read the documents relevant to the task:
docs/product/PRD.mddocs/architecture/ARCHITECTURE.mddocs/architecture/ADR.mddocs/api/API_CONTRACT.mddocs/api/MCP_CONTRACT.mddocs/plans/V1_EXECUTION_PLAN.mddocs/plans/TASKS.mddocs/development/DEFINITION_OF_DONE.md
Do not redesign accepted architecture unless the task explicitly asks for an architecture change.
Architecture invariants
- API First.
- V1 uses a modular monolith plus independent async/GPU workers and an MCP gateway.
- OceanBase relational tables + object storage hold canonical data.
- OceanBase vector tables are rebuildable indexes, not sources of truth, even when co-located with canonical relational tables.
- Business services depend on
VectorStoreabstractions, never directly on Mochow. - Embedding, reranking, parsing, OCR, object storage, and LLMs use provider interfaces.
- Original source documents are immutable.
- Compiled Knowledge is derived and traceable to source document versions/chunks.
- ACL is resolved before or during retrieval. Never retrieve global Top-K and filter afterward.
- MCP exposes business capabilities, not infrastructure/provider details.
- Index profiles are versioned; model/chunk changes use shadow indexes before activation.
- Do not split V1 into unnecessary microservices.
- Never hardcode credentials or production endpoints.
- Core retrieval changes require tests and RAG regression evaluation.
Task discipline
- Work on one Task ID at a time.
- Keep scope limited to the task.
- Do not opportunistically implement future tasks.
- Update relevant contracts/docs when behavior changes.
- Add useful code comments/docstrings and record file or behavior changes in the relevant docs/progress log.
- After validation, push and merge the task branch into
mainbefore starting the next Task ID.
Before finishing
Run relevant checks: format, lint, typecheck, unit tests, relevant integration tests, migration checks, API/MCP contract checks, and RAG evaluation for retrieval changes.
Report changed files, tests/results, unresolved risks, and follow-up tasks.