Repository navigation
Description
Task
T-084b· Milestone M7 — API · Size S · Priority P0 · Epic #7Implements FR-API-001
Branch
test/t-084b-openapi-3-1-snapshot-oasdiff— one task = one branch = one PR (doc 32 §6)
Summary
Commit the generated OpenAPI snapshot (scripts/export_openapi.py), add openapi-check CI job (snapshot freshness + oasdiff breaking vs main) and a nightly schemathesis run against a seeded API.
Context / motivation
M7 exit criterion: OpenAPI snapshot committed and schemathesis clean. The web client types are generated from this file (doc 13 §5).
Scope
In scope
api/openapi.json,make openapi..github/workflows/ci.ymljobopenapi-check; nightly job ine2e.ymlor separateapi-fuzz.yml.
Implementation guidance
scripts/export_openapi.py: importscreate_appwith test settings and writesapi/openapi.jsonwithjson.dumps(spec, indent=2, sort_keys=True)plus a trailing newline;make openapiruns it.- CI job
openapi-check(appended toci.yml): regenerate andgit diff --exit-code api/openapi.json; thenoasdiff breaking origin/main:api/openapi.json api/openapi.json --fail-on ERR(oasdiff Docker image pinned by digest). .github/workflows/api-fuzz.yml(nightly + manual): composecore+ API withseed_small.sql(T-107), runschemathesis run http://localhost:8000/api/v1/openapi.json --checks all --hypothesis-max-examples=50 --exclude-path-regex '/events'with the token header; upload JUnit + failing cases.- The generated web client (T-085c) depends on this file — document the regeneration flow in CONTRIBUTING/AGENTS.md.
- Standards: respect the layering contracts (doc 16 §2) and conventions in doc 34; no hard-coded tunables — thresholds/defaults come from typed settings (doc 27); no magic numbers (ruff
PLR2004); public APIs typed (mypy strict) and documented.
Acceptance criteria
- Snapshot drift fails CI; breaking change without
/api/v2fails. - Schemathesis: no 5xx / schema violations.
- Snapshot is deterministic across two exports (byte-identical).
- Nightly fuzz green, or every finding filed as a bug with its reproducer.
- Tests listed below added and green in CI; coverage of new code meets the gate in doc 18 §3.
- Docs, config reference and CHANGELOG
Unreleasedupdated where behaviour, keys or interfaces changed. - Definition of Done (doc 32 §3) satisfied.
Tests required
- CI jobs.
Dependencies
Blocked by: #146 (T-081a), #148 (T-081c), #150 (T-081e), #151 (T-082a), #152 (T-082b), #153 (T-082c), #156 (T-083b), #157 (T-084a)
Blocks: #164 (T-085c)
Parallelization notes
Files / paths owned by this task — avoid editing other paths; shared files (pyproject.toml entry points, cli/main.py, api/routers/__init__.py, router.tsx, docker/compose.yaml, ci.yml) are append-only:
api/openapi.jsonscripts/export_openapi.py- .github/workflows/ci.yml (job)
.github/workflows/api-fuzz.yml
Final integration of M7.
Definition of Done
Per doc 32 §3 and AGENTS.md §5: lint, format, mypy strict and import-linter green; tests added and passing; docs updated; PR template completed with Closes #<this issue>; Conventional Commit messages referencing T-084b (doc 16 §6); commits authored only by the repository owner identity (AGENTS.md §4); CI green; reviewer checklist (doc 32 §5.1) satisfied.
References
Design docs: doc 12 §1 · doc 18 §4.9 · doc 20 §1 · doc 16 §7
Requirements: FR-API-001 (traceability: doc 28)
External:
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsBacklog
Activity
:start|:pause|:resume|:cancel) and/progress#148/risk,/risk/slice?x=&y=&anchor=&resolution=) #152:analyze, run:replay,scenario.yamlexport, campaign bundle export #153/api/v1/eventswith Last-Event-ID resume, pings and ≤ 2 s latency test #156