chore: snapshot local dev updates before merge
This commit is contained in:
+7
-69
@@ -6,67 +6,16 @@
|
||||
- Add dependencies: `uv add <package>`
|
||||
- All dependencies declared in `pyproject.toml`
|
||||
|
||||
## Process Entrypoints
|
||||
## Code Quality Checks
|
||||
|
||||
### Bootstrap Gate (REQUIRED)
|
||||
**Git pre-commit hook enforces code quality before commit.**
|
||||
|
||||
**The bootstrap gate is the ONLY allowed entry point for deployment.**
|
||||
Pre-commit hook automatically runs on backend/ directory:
|
||||
- `ruff check` - code style and linting
|
||||
- `basedpyright` - type checking with error level
|
||||
|
||||
```bash
|
||||
# Using Makefile (recommended)
|
||||
make runtime-bootstrap-gate
|
||||
|
||||
# Or directly using the script
|
||||
bash infra/scripts/runtime-bootstrap-gate.sh
|
||||
```
|
||||
|
||||
This gate:
|
||||
1. Runs `init-job bootstrap` (migrate + init-data)
|
||||
2. Starts web and worker services
|
||||
3. Aborts if bootstrap fails (prevents web/worker startup)
|
||||
|
||||
**Deployment without passing the bootstrap gate is PROHIBITED.**
|
||||
|
||||
### New Entrypoints (Phase 1-2, 2026-02-24)
|
||||
|
||||
**Primary (recommended):** Use Docker Compose orchestration.
|
||||
|
||||
```bash
|
||||
# Bootstrap gate (required before web/worker)
|
||||
docker compose --env-file .env -f infra/docker/docker-compose.yml run --rm init-job bootstrap
|
||||
|
||||
# Web
|
||||
docker compose --env-file .env -f infra/docker/docker-compose.yml up -d web
|
||||
|
||||
# Worker (grouped)
|
||||
docker compose --env-file .env -f infra/docker/docker-compose.yml up -d \
|
||||
worker-critical worker-default worker-bulk
|
||||
```
|
||||
|
||||
**One-shot jobs:**
|
||||
```bash
|
||||
# Migrate only
|
||||
docker compose --env-file .env -f infra/docker/docker-compose.yml run --rm init-job migrate
|
||||
|
||||
# Init data only
|
||||
docker compose --env-file .env -f infra/docker/docker-compose.yml run --rm init-job init-data
|
||||
|
||||
# Full bootstrap (migrate + init-data)
|
||||
docker compose --env-file .env -f infra/docker/docker-compose.yml run --rm init-job bootstrap
|
||||
```
|
||||
|
||||
### One-shot CLI (local development)
|
||||
|
||||
```bash
|
||||
# Bootstrap (migrate + init-data)
|
||||
PYTHONPATH=backend/src uv run python -m core.runtime.cli bootstrap
|
||||
|
||||
# Migrate only
|
||||
PYTHONPATH=backend/src uv run python -m core.runtime.cli migrate
|
||||
|
||||
# Init data only
|
||||
PYTHONPATH=backend/src uv run python -m core.runtime.cli init-data
|
||||
```
|
||||
If any error detected, commit is rejected. Fix errors before committing.
|
||||
Do not bypass or weaken checks (no ignores, disables, or config relaxations). Resolve the underlying issues.
|
||||
|
||||
## Logging
|
||||
|
||||
@@ -94,17 +43,6 @@ PYTHONPATH=backend/src uv run python -m core.runtime.cli init-data
|
||||
- Tests can set env vars via `monkeypatch.setenv`, and should read values via `Settings()` unless the test is explicitly validating env plumbing
|
||||
- Canonical principle: one source of truth per setting; no duplicate/derived env vars in backend code
|
||||
|
||||
## Code Quality Checks
|
||||
|
||||
**Git pre-commit hook enforces code quality before commit.**
|
||||
|
||||
Pre-commit hook automatically runs on backend/ directory:
|
||||
- `ruff check` - code style and linting
|
||||
- `basedpyright` - type checking with error level
|
||||
|
||||
If any error detected, commit is rejected. Fix errors before committing.
|
||||
Do not bypass or weaken checks (no ignores, disables, or config relaxations). Resolve the underlying issues.
|
||||
|
||||
## TDD First Policy
|
||||
|
||||
**Principle: tests before implementation.**
|
||||
|
||||
Reference in New Issue
Block a user