Repository Guidelines
Project Structure & Module Organization
This repository is organized as a monorepo with product-facing apps at the top level:
apps/control-plane/: FastAPI service (apps/control-plane/app) and backend tests (apps/control-plane/tests). Control-plane architecture is feature-module based underapps/control-plane/app/modules; seeapps/control-plane/AGENTS.mdfor backend-specific layering and dependency rules.apps/web/: Next.js App Router app with thin route entrypoints inapps/web/appand layered product code inapps/web/src. Frontend architecture followsapp -> widgets -> features -> entities -> shared; seeapps/web/ARCHITECTURE.mdandapps/web/AGENTS.mdfor the current layering and ownership rules.packages/: shared contracts and SDK scaffolds for cross-plane reuse.runtimes/: runner scaffolds for framework-specific execution adapters.docs/,infra/, andschemas/: architecture docs, deployment assets, and neutral schema definitions.apps/web/test: Vitest + React Testing Library test files for UI and logic.apps/control-plane/.venv,apps/control-plane/.uv_cache,apps/web/node_modules,apps/web/.next, package/runtime.venvdirectories, and local CI artifacts such as.phoenix/orapps/control-plane/.agent-atlas-*.dbare generated and should not be committed.
Build, Test, and Development Commands
- Control-plane setup and checks (run in
apps/control-plane/):make install— sync runtime + dev dependencies for local development.make sync— recreate the backend environment fromuv.lockfor reproducible CI/local bootstrap.make fmt— run Ruff formatter and Python compile check.make lint— run Ruff lint/format checks.make typecheck— run mypy onapp/.make test— run unit tests plus non-workflow integration tests without the coverage gate for fast local verification.make test-workflow— run long-running backend workflow tests for experiment, validation, and export loops.make test-check— run pytest with coverage checks (--cov-fail-under=70).make security— run Bandit scan on backend code.uv run uvicorn app.main:app --reload --host 0.0.0.0 --port 8000— start API locally.
- Web app setup and checks (run in
apps/web/):npm install— install JS dependencies.make install-ci— install frontend dependencies withnpm cifor reproducible CI runs.npm run dev— run Next.js dev server onhttp://localhost:3000.npm run lint— run ESLint.npm run typecheck— run TypeScript strict check (tsc --noEmit).npm run test— run Vitest suite.npm run build— production build.make ci— run the frontend CI bundle (lint + typecheck + coverage + build).npm run verify:full— run the local full frontend verification bundle, including Playwright e2e.
- Root monorepo checks (run in repository root):
make lint— run repo-wide lint and syntax checks across apps, shared packages, and runtimes; local runs default to serial orchestration.make typecheck— run all defined type checks; local runs default to serial orchestration.make test— run app tests and shared package/runtime smoke checks; local runs default to serial orchestration.make build— build the frontend and Python package distributions; local runs default to serial orchestration.make ci-packages— validate shared packages and runtimes.make ci— run full monorepo CI coverage across backend, frontend, shared packages, and runtimes; local runs default to serial orchestration.
Coding Style & Naming Conventions
- Python: 4-space indentation, LF line endings, quote-style double, line length 100 (
ruffconfig). - TypeScript/React: 2-space indentation, strict TypeScript enabled, Prettier + ESLint formatting.
- Naming: Python uses
snake_casefor functions/modules/variables,PascalCasefor classes; frontend usescamelCasefor hooks/functions andPascalCasefor React components/files. - Keep API payload mapping explicit and deterministic; avoid implicit schema guessing.
Testing Guidelines
- Backend tests use
pytest; put backend tests underapps/control-plane/testswithtest_*.py. - Frontend tests use Vitest + React Testing Library; test files are
*.spec.ts,*.spec.tsx,*.test.ts,*.test.tsx(covered byapps/web/vitest.config.ts). - Frontend unit/integration tests live under
apps/web/test, while Playwright e2e tests live underapps/web/e2e. - Frontend coverage defaults to
app/**/*andsrc/**/*. - Generated test artifacts such as
__pycache__/,*.pyc, coverage output, build output,.next/, andnode_modules/are not part of the committed test structure. - Run at least
make testandnpm run testbefore opening a PR.
Commit & Pull Request Guidelines
The root and both subdirectories currently have no git history on master, so there is no local convention to infer. Use Conventional Commits now (feat:, fix:, refactor:, test:).
- PRs should include what changed, why, related issue/task link, and command outputs (
make test,npm run test,make lint/npm run lint,make typecheck/npm run typecheck). - For UI work, include relevant screenshots or short screen recordings.
- For API changes, include example request/response payloads and affected endpoints.
Security & Configuration Tips
- Copy
apps/control-plane/.env.exampletoapps/control-plane/.envand configure environment values before running. - Set
NEXT_PUBLIC_API_BASE_URLin frontend when backend URL is nothttp://127.0.0.1:8000. - Do not commit secrets, local database dumps, or generated artifacts.