You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs/frontapp-openapi.yaml is a vendored, sanitized copy of Front's upstream spec, refreshed via scripts/vendor_spec.py. There is currently no way to diff our local spec against upstream (e.g., to see whether Front shipped a new endpoint, changed a response shape, or deprecated a route) without manually fetching upstream and eyeballing it.
Sibling repo katana solved this in PR #420 + #421 with a pair of focused scripts.
Solution
Adapt katana's pattern to frontapp:
scripts/audit_spec_drift.py — diffs docs/frontapp-openapi.yaml against the upstream Front spec, reports missing/invented endpoints, changed response schemas, deprecated routes. Exits non-zero on drift.
scripts/validate_spec_examples.py — walks every examples: block in the spec and validates each against its referenced JSON schema using Draft202012Validator. Catches handwritten examples that have drifted from their schemas.
Keep docs/frontapp-openapi.yaml as the sanitized vendored copy; add docs/upstream/frontapp-openapi.upstream.yaml (gitignored snapshot or committed for diffability — TBD during implementation) as the unsanitized comparison point.
Files to add
scripts/audit_spec_drift.py (new)
scripts/validate_spec_examples.py (new)
.github/workflows/upstream-spec-drift.yml (new, optional but recommended)
pyproject.toml — add poe spec-audit task
Acceptance criteria
uv run poe spec-audit exits 0 on a freshly vendored spec
Manually mutating an endpoint locally causes the audit to flag it clearly
validate_spec_examples.py catches a deliberately broken example
CI workflow opens a PR (not commit) when upstream drifts
No false positives from the sanitization layer in vendor_spec.py (sanitized diffs are expected and should be filtered)
Problem
docs/frontapp-openapi.yamlis a vendored, sanitized copy of Front's upstream spec, refreshed viascripts/vendor_spec.py. There is currently no way to diff our local spec against upstream (e.g., to see whether Front shipped a new endpoint, changed a response shape, or deprecated a route) without manually fetching upstream and eyeballing it.Sibling repo katana solved this in PR #420 + #421 with a pair of focused scripts.
Solution
Adapt katana's pattern to frontapp:
scripts/audit_spec_drift.py— diffsdocs/frontapp-openapi.yamlagainst the upstream Front spec, reports missing/invented endpoints, changed response schemas, deprecated routes. Exits non-zero on drift.scripts/validate_spec_examples.py— walks everyexamples:block in the spec and validates each against its referenced JSON schema usingDraft202012Validator. Catches handwritten examples that have drifted from their schemas..github/workflows/upstream-spec-drift.ymlruns the auditor on a cron and opens a PR with the upstream diff for human review. Never auto-merges.Keep
docs/frontapp-openapi.yamlas the sanitized vendored copy; adddocs/upstream/frontapp-openapi.upstream.yaml(gitignored snapshot or committed for diffability — TBD during implementation) as the unsanitized comparison point.Files to add
scripts/audit_spec_drift.py(new)scripts/validate_spec_examples.py(new).github/workflows/upstream-spec-drift.yml(new, optional but recommended)pyproject.toml— addpoe spec-audittaskAcceptance criteria
uv run poe spec-auditexits 0 on a freshly vendored specvalidate_spec_examples.pycatches a deliberately broken examplevendor_spec.py(sanitized diffs are expected and should be filtered)Reference