Commit Graph

1 Commits

Author SHA1 Message Date
AleFlyX
f8c982a181 test: fail when the committed surface artifact drifts from the app
docs/tests/docs_surface.json is generated from the live CLI and FastAPI app,
then committed so the dependency-light doc tests can read it. Nothing
regenerates it on its own, so without a gate it silently becomes a description
of an older application.

This is the failure this repository already has elsewhere: web/contracts/README.md
documents a `--check` drift gate for the frontend contracts, but no workflow
runs it, so web/contracts/schema/openapi.json can disagree with the backend
while CI stays green. Do not repeat that here.

The gate runs the real entry point (`scripts/export_docs_surface.py --check`)
in a subprocess, so it exercises what a developer runs, and surfaces stdout and
stderr with the regenerate command when it fails. It lives in tests/api/
because that directory's tests run in the python-tests job, which has the full
dependency set installed. A second test pins determinism: two renders of the
same live app must be byte-identical.
2026-11-26 21:35:16 +08:00