Skip to content

docs: engine API contract spec + OpenAPI 3.1 document (Epic 0, issue #3011)#3013

Merged
imran-siddique merged 3 commits into
mainfrom
ricky-g/engine-api-contract-spec-openapi
Jun 14, 2026
Merged

docs: engine API contract spec + OpenAPI 3.1 document (Epic 0, issue #3011)#3013
imran-siddique merged 3 commits into
mainfrom
ricky-g/engine-api-contract-spec-openapi

Conversation

@Ricky-G

@Ricky-G Ricky-G commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Define the AGT Studio Engine API by shipping two artifacts: a human-readable spec (docs/studio/engine-api-contract.md) and a machine-readable OpenAPI 3.1 document (docs/studio/openapi.yaml). This is the gate for Epic 0 issues 2-4 and all of Epic 1, fulfilling the contract requirement from ADR 0028 lines 142-148.

Problem

ADR 0028 mandates that an Engine API contract must exist before Studio implementation lands. Without this spec, issues #2 (capability metadata decorator), #3 (FastAPI implementation), and #4 (conformance tests) have no contract to implement or test against.

Changes

File What changed
docs/studio/engine-api-contract.md New human-readable spec: maintainer note (ADR 0029 skip rationale), 12 HTTP endpoint definitions, 3 capability flags, read-only invariant with client-allowlist worked example, auth model, error envelope, pagination model, conformance rules, excluded endpoints, and WebSocket reservation
docs/studio/openapi.yaml New OpenAPI 3.1 document: all 12 HTTP endpoints with x-capability-flags extension, full request/response schemas, reusable Error and PaginationMeta components, BearerToken security scheme; zero warnings from npx @redocly/cli lint
mkdocs.yml Added Studio nav section linking to engine-api-contract.md

No existing source files modified. This is a doc-only PR.

Acceptance criteria verification

  • docs/studio/engine-api-contract.md exists and includes the maintainer note about skipping ADR 0029
  • docs/studio/openapi.yaml exists and passes npx @redocly/cli lint (zero warnings, exit 0)
  • Every endpoint in the issue table is documented in both files
  • Every endpoint declares all three capability metadata flags
  • Exactly one endpoint has runtime_mutating: true (POST /api/v1/policy/save)
  • POST /api/v1/policy/reload is named in the "Excluded Endpoints" section with rationale
  • Read-only invariant is explained with a worked example of the client-allowlist derivation
  • Conformance-rules section enumerates what an engine must implement to be conformant
  • Versioning section defines URL-versioning and breaking-change policy
  • Auth summary references issue build(deps-dev): Bump underscore from 1.13.7 to 1.13.8 in /packages/agent-os/extensions/vscode #6 for the full threat model
  • WebSocket route /api/v1/events is reserved with a pointer to Epic 7a
  • Error envelope schema is defined (status, code, message, optional details)
  • Pagination model is defined for /policies, /audit/log, /decisions, /agents
  • No existing source code modified

Testing

Doc-only PR. Validated with:

  • npx @redocly/cli lint docs/studio/openapi.yaml passes (zero warnings, exit 0)
  • python scripts/docs/check_links.py passes (0 new broken links, exit 0)
  • python scripts/docs/check_frontmatter.py passes (all 300 warnings are pre-existing, exit 0)

…issue #3011)

Create docs/studio/engine-api-contract.md and docs/studio/openapi.yaml to
define the AGT Studio Engine API before implementation begins, fulfilling
the gate requirement in ADR 0028 lines 142-148.

- engine-api-contract.md: human-readable spec covering all 12 HTTP endpoints,
  three capability flags (runtime_mutating, user_intent_required,
  read_only_surface), read-only invariant with client-allowlist worked example,
  auth model (loopback/non-loopback), error envelope, pagination model,
  conformance rules, excluded endpoints (POST /api/v1/policy/reload), and
  WebSocket route reservation (/api/v1/events, Epic 7a)

- openapi.yaml: OpenAPI 3.1 document with x-capability-flags extension on every
  operation, full request/response schemas, reusable error and pagination
  components, and BearerToken security scheme; passes npx @redocly/cli lint
  with zero warnings

- mkdocs.yml: add Studio nav section linking to engine-api-contract.md

No existing source files modified. Docs link check and frontmatter check pass.

Closes #3011

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Ricky Gummadi <ricky.gummadi@outlook.com>
@github-actions

github-actions Bot commented Jun 13, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@github-actions github-actions Bot added documentation Improvements or additions to documentation size/XL Extra large PR (500+ lines) labels Jun 13, 2026
@github-actions

github-actions Bot commented Jun 13, 2026

Copy link
Copy Markdown

PR Review Summary

Check Status Details
🔍 Code Review ⚠️ Missing No current-run comment
🛡️ Security Scan ⚠️ Missing No current-run comment
🔄 Breaking Changes ⚠️ Missing No current-run comment
📝 Docs Sync ⚠️ Missing No current-run comment
🧪 Test Coverage ⚠️ Missing No current-run comment

Verdict: ⚠️ AI review incomplete; ready for human review

AI review comments are untrusted advisory output. The summary reports workflow-generated completion status only, not model-authored pass/fail claims.

@github-actions

Copy link
Copy Markdown

🟡 Contributor Check: MEDIUM

Check Result
Profile MEDIUM
Credential LOW
Overall MEDIUM

Automated check by AGT Contributor Check.

@github-actions github-actions Bot added the needs-review:MEDIUM Contributor check flagged MEDIUM risk label Jun 13, 2026
Ricky-G and others added 2 commits June 13, 2026 23:05
Ground trust_level enum in the real trust_level_for_score vocabulary
(untrusted, probationary, standard, trusted, verified_partner) instead of
invented values, document the reserved WS /api/v1/events route with its three
capability flags in both files (spec flag table + section 12, and an
x-reserved-routes block in openapi.yaml), exclude reserved routes from the
client allowlist, add the optional resolution_metadata field to FixtureResult
to match policy_test.FixtureResult, and clarify how inline fixtures are adapted
for policy_test.replay.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Ricky Gummadi <ricky.gummadi@outlook.com>
Replace informal 'footgun' with 'dangerous pattern', fix two example
error messages that contained the intentional typo 'actiom' (the spell
checker flags example strings too), and add Redocly to the repo cspell
terms file as it is a recognised tool name.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Ricky Gummadi <ricky.gummadi@outlook.com>
@Ricky-G Ricky-G changed the title docs: Engine API contract spec + OpenAPI 3.1 document (Epic 0, issue #3011) docs: engine API contract spec + OpenAPI 3.1 document (Epic 0, issue #3011) Jun 13, 2026
@Ricky-G Ricky-G enabled auto-merge (squash) June 13, 2026 21:37

@imran-siddique imran-siddique left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spec looks good — fulfills the ADR-0028 gate requirement. Approving.

@imran-siddique

Copy link
Copy Markdown
Collaborator

/ok-to-test

@imran-siddique imran-siddique merged commit 34189e2 into main Jun 14, 2026
93 of 94 checks passed
@imran-siddique imran-siddique deleted the ricky-g/engine-api-contract-spec-openapi branch June 14, 2026 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation needs-review:MEDIUM Contributor check flagged MEDIUM risk size/XL Extra large PR (500+ lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants