feat(ci): endpoint-audit gate (client vs 1.29.0 server spec + test coverage)#216
Open
VascoSch92 wants to merge 8 commits into
Open
feat(ci): endpoint-audit gate (client vs 1.29.0 server spec + test coverage)#216VascoSch92 wants to merge 8 commits into
VascoSch92 wants to merge 8 commits into
Conversation
Adds scripts/endpoint-audit.mjs which diffs the client's HTTP surface against the agent-server OpenAPI spec (live from the running container, or the committed specs/agent-server.openapi.json fallback) and reports: - mismatch: client calls an endpoint the server does not expose (gated) - missing API: server exposes an endpoint the client does not implement Runs as a release gate in release.yml (boots the 1.29.0 image for the live spec). Today's 3 known drifts (cloud-proxy, generate_title, skills /update -> /refresh) are baselined in endpoint-audit.config.json so the gate fails only on new drift. Run locally with: npm run audit:endpoints
a63b449 to
a47c7e7
Compare
Run the endpoint audit as a standalone Endpoint Audit workflow on push and pull_request (main/develop) instead of as a gate inside the release job. Releases no longer depend on the audit.
Drop the pull_request branch filter so the audit runs on every PR regardless of target branch, and push only on main (no develop branch).
Define the agent-server image once in package.json (config.agentServerImage) and have the endpoint-audit and integration-tests workflows resolve it at runtime into $GITHUB_ENV. Bumping the pinned version is now a single edit. Update README.md and AGENTS.md to point at package.json as the canonical pin.
- Restore release.yml to its original content (no endpoint-audit gate); the
audit now runs only as its own workflow.
- upload-artifact@v4 skips dot-directories unless include-hidden-files is set,
so the .audit/ report was never uploaded ("No files were found"). Enable
include-hidden-files so the report uploads.
Add a github-script step that renders .audit/endpoint-audit.json into a single self-updating PR comment (matched by a hidden marker). Runs on pull_request events even when the audit gate fails, so reviewers see the mismatches. Grants pull-requests: write for commenting.
Endpoint audit✅ No mismatches — server endpoints: 104, client endpoints: 104 ❌ Mismatch — client calls an endpoint the server does not expose (0)none ➕ Missing API — server exposes it, client does not implement (17)
ℹ️ External backend, not gated (16)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #214 (agent-server image → 1.29.0).
What
Adds an endpoint-audit gate that reconciles the client's HTTP surface against the agent-server OpenAPI spec and against test coverage, reporting four classes of drift:
How
/openapi.json, fetched live from the running container (committedspecs/agent-server.openapi.jsonfor 1.29.0 is the offline fallback). So the audited surface tracks the server version automatically.HttpClientappends${METHOD} ${pathname}to$OH_AUDIT_OUTwhen set (test/CI only — no-op and zero cost in prod). No grep heuristics.release.yml(release gate) andintegration-tests.yml(every PR/push, against the live 1.29.0 server).Gating (ratchet)
Today's 3 known drifts against 1.29.0 are baselined in
endpoint-audit.config.jsonso the gate is green now and fails only on new drift:POST /api/cloud-proxy— dropped server-sidePOST /api/conversations/{id}/generate_title— dropped server-sidePOST /api/skills/installed/{name}/update— server now exposes…/refresh(The ACP
/api/acp/*drift is already resolved by #214.) Coverage gaps are report-only by default (gate.missingUnit/Integ: false) — flip totrueto enforce later.Try it
npm run audit:endpoints # unit coverage + report (uses committed spec offline)Files
scripts/endpoint-audit.mjs— the analyzerendpoint-audit.config.json— specs, external-backend prefixes, allowlists, gate flagsspecs/agent-server.openapi.json— 1.29.0 spec (offline fallback)src/client/http-client.ts— runtime recorder hookpackage.json—audit:unit/audit:integration/audit:report/audit:endpoints.github/workflows/{release,integration-tests}.yml— wiring