Add route manifest contract validation

This commit is contained in:
jwinterm
2026-07-06 04:07:10 -04:00
parent c1d8337365
commit 407d4d106a
13 changed files with 619 additions and 42 deletions
+6 -1
View File
@@ -19,6 +19,10 @@ code. Generated artifacts are committed, then checked in CI by regenerating and
: Generated from renderer definitions. Lists stripped tags, asset limits, link modes,
and defaults for each target.
`schemas/ampg.route-manifest.v1.schema.json`
: Generated from the route-manifest validator. App repos can use it to emit and validate
`ampg.route-manifest.v1` without depending on AMPG internals.
`openapi.json`
: Generated if AMPG exposes a local control API for status, builds, plans, and daemon
health.
@@ -30,7 +34,7 @@ CI should run:
```sh
python3 -m ampg docs generate
python3 -m ampg docs generate --check
git diff --exit-code docs/generated openapi.json
git diff --exit-code docs/generated schemas openapi.json
python3 tools/docs_check.py
```
@@ -58,5 +62,6 @@ outside the public repo.
- [ ] Generate config schema docs from code.
- [ ] Generate daemon adapter docs from registered adapters.
- [ ] Generate renderer docs from renderer defaults.
- [ ] Generate route-manifest JSON Schema from code.
- [ ] Commit generated artifacts.
- [ ] Fail CI when regeneration produces a diff.
+7
View File
@@ -203,6 +203,13 @@ Applications can generate a JSON route manifest instead of hand-maintaining ever
group in TOML. Paths are resolved relative to `gateway.toml`; inline TOML routes are
appended after manifest routes.
The public schema is committed at `schemas/ampg.route-manifest.v1.schema.json`.
Applications can validate generated manifests before AMPG config parsing:
```sh
python3 -m ampg route-manifest validate routes.json
```
```json
{
"schema": "ampg.route-manifest.v1",
+7
View File
@@ -55,6 +55,13 @@ Apps may provide `ampg.route-manifest.v1` JSON. AMPG imports it from
`site.interactions.route_manifest`, merges its denylist with inline TOML, and appends any
inline TOML route entries after the imported route entries.
The schema is generated at `schemas/ampg.route-manifest.v1.schema.json`, and app repos can
validate generated manifests with:
```sh
python3 -m ampg route-manifest validate routes.json
```
Required top-level fields:
- `schema`: must be `ampg.route-manifest.v1`.