|
1 | | -# Fred AI Coding Instructions |
| 1 | +# Fred Copilot Instructions |
2 | 2 |
|
3 | | -## Big Picture (Read First) |
4 | | -- Three services: `agentic-backend/` (FastAPI + LangGraph agents), `knowledge-flow-backend/` (FastAPI ingestion + vector search + MCP endpoints), `frontend/` (React + Vite UI). |
5 | | -- Agent behavior lives in `agentic-backend/config/configuration.yaml` (agents, MCP servers, feature flags, model providers). |
6 | | -- Ingestion + storage pipelines live in `knowledge-flow-backend/config/configuration.yaml` (input/output processors, storage backends, embeddings). |
7 | | -- The frontend consumes both APIs via generated RTK Query hooks; regenerate after OpenAPI changes. |
| 3 | +## Mandatory Read Order |
8 | 4 |
|
9 | | -## Critical Workflows |
10 | | -- Start services via Makefiles: `make run` in `agentic-backend/` (port 8000), `knowledge-flow-backend/` (port 8111), and `frontend/` (port 5173). |
11 | | -- Temporal workers are separate: `make run-worker` in `agentic-backend/` and `knowledge-flow-backend/` when needed. |
12 | | -- Secrets go in each backend’s `config/.env`; non-secret config stays in `configuration.yaml`. |
13 | | -- Dev Container setup is supported (see root `README.md`). |
| 5 | +1. [`docs/DEVELOPER_CONTRACT.md`](../docs/DEVELOPER_CONTRACT.md) |
| 6 | +2. [`docs/PLATFORM_RUNTIME_MAP.md`](../docs/PLATFORM_RUNTIME_MAP.md) |
| 7 | +3. [`docs/CONFIGURATION_AND_POLICY_CONVENTIONS.md`](../docs/CONFIGURATION_AND_POLICY_CONVENTIONS.md) |
| 8 | +4. [`docs/REBAC.md`](../docs/REBAC.md) for team/access work |
14 | 9 |
|
15 | | -## Frontend Conventions |
16 | | -- Use MUI components and the app theme from `theme.tsx`. |
17 | | -- All UI copy must use `react-i18next` (`t` from `useTranslation`) and update `src/locales/{lang}/translation.json`. |
18 | | -- Use `Link` from `react-router-dom` for navigation; ensure `to` is a valid route. |
19 | | -- Regenerate API clients when backend schemas change: `make update-agentic-api` or `make update-knowledge-flow-api` (run from `frontend/`). |
20 | | -- Format with `prettier` (via `make format`). |
| 10 | +## Non-Negotiable Defaults |
21 | 11 |
|
22 | | -## Python Backend Conventions |
23 | | -- Use `uv` for dependency management. |
24 | | -- Each backend has its own `.venv`; run scripts with `.venv/bin/python` to ensure correct deps. |
25 | | -- Use type hints everywhere and prefer Python 3.10+ unions (`str | None`). |
26 | | -- Format with `ruff` (e.g., `make format` in `knowledge-flow-backend/`). |
| 12 | +- Keep implementation minimal and direct. |
| 13 | +- Do not over-engineer. |
| 14 | +- Run `make code-quality` and `make test` in every touched project. |
| 15 | +- Default tests must stay offline. |
| 16 | +- Tests requiring external services must be marked `integration`. |
| 17 | +- Assume no third-party services are running for default validation (no MinIO/OpenSearch/Postgres/Keycloak/OpenFGA/Temporal, etc.). |
| 18 | +- Every new or modified function must explain: |
| 19 | + - why it exists |
| 20 | + - how to use it |
| 21 | + - and include a short usage example for shared/public helper functions. |
| 22 | +- Avoid conceptual/design-pattern explanation docs; write concrete operational docs developers can apply immediately. |
| 23 | +- Keep function count and helper layers under control: business function or strictly necessary shared helper only. |
| 24 | +- Prefer changes that shrink and simplify the codebase (reuse/remove) instead of growing parallel logic. |
| 25 | + |
| 26 | +## Fred Runtime Topology |
| 27 | + |
| 28 | +Canonical source: |
| 29 | + |
| 30 | +- [`docs/PLATFORM_RUNTIME_MAP.md`](../docs/PLATFORM_RUNTIME_MAP.md) |
0 commit comments