Commit Graph

5 Commits

Author SHA1 Message Date
Praxis CI 46b46479ca feat(P01): SLICE-06 P1 integration — wire lifespan + auth + verification swap
- TASK-06-01 __main__.py: SessionMiddleware (signed cookies, D-056) added
  AFTER CORS so it is outermost. slowapi limiter state + 429 exception
  handler registered. The lifespan (TASK-01-03) now also runs the VC key
  migration on first boot.
- TASK-06-02 __main__.py: auth_router mounted (POST /api/operator/login,
  POST /api/operator/logout, GET /api/operator/me) BEFORE the StaticFiles
  mount (routes-before-static constraint). Auth routes use app.state.pg_store
  (503 if no Postgres).
- TASK-06-03 __main__.py: /vc/verify swapped to the two-store path (G-011):
  pg_store for key lookup (active + superseded), SQLite fallback for v0.3
  credentials, SQLite-only if no Postgres. _maybe_migrate_issuer_keys()
  runs once in the lifespan (idempotent, G-027 first-boot, non-fatal on
  failure — v0.3 path intact).
- TASK-06-04 tests/test_p1_auth_integration.py: 4 e2e tests (skip if no
  Postgres) — full auth flow, /me without cookie 401, wrong password 401,
  learner voice loop unaffected (REQ-NFR-MT-01).
- TASK-06-05 tests/test_p1_vc_migration_e2e.py: 5 e2e tests (skip if no
  Postgres) — R-VC-MIG-01 critical (v0.3 VC verifies against archived
  superseded key in Postgres), idempotent migration, G-027 first-boot,
  v0.04 VC verifies, tamper detection.

Graceful degradation verified: server starts without Postgres (pg_pool/
pg_store are None; voice loop works; auth routes return 503).

---ci---
project: praxis
phase: 1
milestone: v0.4
status: execute
persona: backend-engineer
task: 06-01,06-02,06-03,06-04,06-05
requirements:
  covered: [REQ-MT-01, REQ-AUTH-01, REQ-NFR-AUTH-01, REQ-NFR-MT-01]
  grill:
    - G-011 (two-store fallback wired in /vc/verify)
  risks:
    - R-VC-MIG-01 (e2e test: v0.3 VC verifies against archived superseded key in Postgres)
---/ci---
2026-08-04 01:00:11 +00:00
Praxis CI fb109337a5 feat(P01): TASK-01-03 asyncpg pool lifespan + graceful degradation
Add @asynccontextmanager lifespan to the FastAPI app that creates an
asyncpg pool (min=1, max=10, command_timeout=10 — D-050) on app.state.pg_pool
and a PgStore on app.state.pg_store when PRAXIS_PG_DSN is set, applies
pg_migrations on startup, and closes the pool on shutdown.

Graceful degradation (REQ-NFR-MT-01): if PRAXIS_PG_DSN is unset, the
server starts with a WARNING and pg_pool/pg_store are None. The learner
voice loop (SQLite PraxisStore) is unaffected. Auth/operator routes will
return 503 (wired in SLICE-06).

---ci---
project: praxis
phase: 1
milestone: v0.4
status: execute
persona: backend-engineer
task: 01-03
requirements:
  covered: [REQ-MT-01, REQ-NFR-MT-01]
---/ci---
2026-08-04 00:47:30 +00:00
Praxis CI 813bd586d6 docs(milestone): merge v0.3-mastery-scoring → main
v0.3 milestone merged to main. Mastery scoring + competency rubrics +
verifiable credentials (formative-tier) shipped. 13/13 REQ-IDs covered.
Next milestone: v0.4 (operator tier — cohort dashboard + auth + Postgres).

---ci---
project: praxis
phase: 2
milestone: v0.3
status: complete
milestone_complete: true
milestone_merged_to_main: true
---/ci---
2026-08-04 00:14:59 +00:00
Praxis CI f04b9b3588 feat(P01): SLICE-01+02 — Dockerfile, .dockerignore, docker-compose.yml, FastAPI StaticFiles, PRAXIS_DB_PATH env (G-102 fix)
SLICE-01 (lead-developer): multi-stage Dockerfile (node:22-slim→python:3.12-slim),
  .dockerignore (excludes secrets/node_modules/.git), docker-compose.yml
  (port 8789, SQLite volume, env injection for all voice-service vars)
SLICE-02 (backend-engineer+data-engineer): FastAPI mounts client/dist as
  StaticFiles at / after API routes (D-023, REQ-DEPLOY-13).
  G-102 MUST fix: db/store.py + db/migrate.py now read PRAXIS_DB_PATH
  from env so the Docker volume mount persists SQLite data.
G-105 FIX: Dockerfile copies pyproject.toml before source (pip install
  layer cached, source changes don't invalidate).

REQ-DEPLOY-01, 02, 13, 16 covered.

---ci---
project: praxis
phase: 1
milestone: v0.2
status: execute
slice: 01-02
wave: 1
---/ci---
2026-08-01 14:16:39 +00:00
Praxis CI fbd6602814 docs(milestone): complete v0.1 foundation
---ci---
phase: 0
milestone: v0.1
status: complete
---/ci---
2026-08-01 13:32:48 +00:00