Skip to content

feat(embed): add /embed OpenAPI contract + Spectral CI gate - #12

Merged
mattj-monad merged 1 commit into
mainfrom
feature/pro-400
Jul 31, 2026
Merged

feat(embed): add /embed OpenAPI contract + Spectral CI gate#12
mattj-monad merged 1 commit into
mainfrom
feature/pro-400

Conversation

@mattj-monad

Copy link
Copy Markdown
Contributor

Bottom layer of the Monad Embed SDK staged rollout (PRO-400).

What this adds

  • packages/embed/openapi/** — the 9-route /embed OpenAPI contract (embed.openapi.yaml), its README, and the Spectral ruleset. This is the shared artifact every backend router and the browser client conform to.
  • A Spectral lint job in CI that validates the spec on every change.

The workspace scaffold (package.json, pnpm-workspace.yaml, tsconfig.base.json, eslint.config.js, CI) is already on main, so this PR is scoped to just the contract + its lint gate.

Verification

  • spectral lint on the spec → no errors.
  • prettier --check on the new files → clean.

Stack

Layer 1 of 6, merged bottom-up. Next: @monad-inc/embed browser client (PRO-401), then TS router + conformance suite (PRO-402) → Go (PRO-403) → Python (PRO-404) → docs + CI hardening (PRO-405).

🤖 Generated with Claude Code

https://claude.ai/code/session_011ASKA2VrufrNLGGrcFjY7n

@andrewc-monad andrewc-monad 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.

Excited to see the rest of this!

Comment thread packages/embed/openapi/embed.openapi.yaml
Comment thread .github/workflows/ci.yml
The 9-route /embed contract (packages/embed/openapi) is the shared artifact
every router and the browser client conform to. Adds a Spectral lint job to CI
so the spec is validated on every change. The workspace scaffold is already on
main; this is the contract layer (PRO-400) of the staged rollout.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011ASKA2VrufrNLGGrcFjY7n
@mattj-monad

Copy link
Copy Markdown
Contributor Author

Force-pushed a review fix. Error.code now has an explicit enum (it was type: string with the seven codes only described in prose), so response_schema_conformance can actually catch a router returning a wrong/invalid error code. Spectral + the whole stack re-verified green.

@mattj-monad
mattj-monad merged commit 8aa8b17 into main Jul 31, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants