19 lines
1.7 KiB
Markdown
19 lines
1.7 KiB
Markdown
# Contract standard
|
|
|
|
The repository has separate public and internal OpenAPI contracts:
|
|
|
|
- api/core/openapi.yml describes browser-to-Go operations.
|
|
- api/ml/openapi.yml describes internal Go-to-ML operations.
|
|
- api/runner/openapi.yml describes internal operations between Go and the code runner.
|
|
- api/labd/openapi.yml describes internal lab provisioner operations.
|
|
|
|
Edit the split source files referenced by these roots. Use the API Makefile to merge schemas, bundle, and lint every specification. Do not hand-edit bundled files.
|
|
|
|
ogen generates Go servers and clients; chi mounts the backend HTTP handler. Orval generates frontend clients, hooks, schemas, and mocks. datamodel-code-generator generates ML Pydantic v2 models. Each consumer keeps configuration in its own codegen/ directory: backend, frontend, ml, runner, or labd. Backend client settings are ogen-ml.yml, ogen-code-runner.yml, and ogen-labd.yml; their output stays in the corresponding secondary adapter's api/ directory. Contract sources remain shared under api/.
|
|
|
|
OpenAPI 3.2.0 is the target contract version. Verify only the feature subset used by this repository through the pinned bundler, linter, ogen, Go runtime path, Orval, Python Pydantic models, and documentation pipeline. A passing fixture does not establish full support for every OpenAPI 3.2 feature. Record the exact checks run.
|
|
|
|
Runtime validation and generated types do not implement authentication, object authorization, consent, or valid product state transitions. Keep those checks in the appropriate application layer.
|
|
|
|
When a contract changes, regenerate every affected consumer from the same source and run generated drift checks. Report if a consumer or generation step was not verified.
|