Repository navigation
feat: move SDK compliance to per-repo files #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
01ab9b4
feat: migrate capabilities to per-feature markdown files
grdsdev 47a97d3
feat: add OpenAPI spec references to auth feature files
grdsdev 41da7ce
refactor: move openapi operations from frontmatter into body ## API s…
grdsdev edda690
refactor: restore per-area YAML + introduce separate specs/ directory
grdsdev eca1c7c
docs: add SDK compliance per-repo design spec
grdsdev 79d7408
feat: add partially_implemented status and compliance types; retire S…
grdsdev 1a26761
refactor: remove sdks from capability feature schema, add optional gr…
grdsdev 0076594
feat: add compliance module to parse and validate supabase-capabiliti…
grdsdev 532fa3a
refactor: remove sdks-specific checks from structural validator
grdsdev 90bf7c3
refactor: retire source-code reference checking (references moved to …
grdsdev 4da729c
fix: update cli.test.ts for compliance-redesign schema (no sdks field…
grdsdev 0862e5a
refactor: computeParity accepts external compliance map instead of re…
grdsdev 36517f6
refactor: generate-site accepts external compliance map; add partiall…
grdsdev cee7b8c
feat: add compliance-cli and aggregate scripts for SDK compliance wor…
grdsdev 188cb13
fix: correct repoRoot() path resolution in compliance-cli and aggregate
grdsdev c0f455f
feat: add reusable validate-sdk-compliance workflow for SDK repos
grdsdev d255cd6
refactor: strip sdks blocks from all capability YAML files
grdsdev 92dc8a6
feat: add hourly aggregate-capabilities workflow for compliance data …
grdsdev bdf8bc3
chore: ignore docs/superpowers/ from git tracking
grdsdev 0eb24ff
remove docs
grdsdev 9950d83
feat: link feature names to spec files in capability matrix
grdsdev 505ce64
feat: validate spec files against canonical capability IDs
grdsdev 2fb0464
docs: rewrite README for per-repo compliance model
grdsdev 184f22a
refactor: rename supabase-capabilities.yaml to sdk-compliance.yaml
grdsdev 7992c35
docs: rewrite auth.sign_up spec to be stack-agnostic
grdsdev a3146ad
ci: change aggregate workflow to run nightly at 2am
grdsdev dd4595c
chore: add explanatory comments to .gitignore entries
grdsdev 082dc99
fix: add 10s timeout to GitHub API fetch in aggregate
grdsdev c1218a6
fix: log error when sdk-compliance.yaml is missing from an SDK repo
grdsdev 364de10
fix: abort aggregate job if all SDKs fail to avoid blank matrix deploy
grdsdev e96e5cf
fix: use replaceAll for spec URL path segment replacement
grdsdev 1d9454b
refactor: remove references.ts, github.ts and the online validation path
grdsdev 07b83f7
docs: clarify spec template header — prose vs structured metadata
grdsdev b8b06f7
Update specs/TEMPLATE.md
grdsdev 6a82792
docs: remove language-specific signature guidance from spec template
grdsdev c33c974
docs: clarify account-exists obfuscation behavior in sign_up spec
grdsdev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| name: Aggregate SDK Compliance | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: "0 2 * * *" | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pages: write | ||
| id-token: write | ||
|
|
||
| concurrency: | ||
| group: pages | ||
| cancel-in-progress: false | ||
|
|
||
| defaults: | ||
| run: | ||
| working-directory: scripts/capability-matrix | ||
|
|
||
| jobs: | ||
| aggregate-and-deploy: | ||
| name: Aggregate compliance and deploy site | ||
| runs-on: ubuntu-latest | ||
| environment: | ||
| name: github-pages | ||
| url: ${{ steps.deployment.outputs.page_url }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: "22" | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Aggregate compliance data from SDK repos | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: npm run aggregate | ||
|
|
||
| - name: Build site with compliance data | ||
| run: npm run build-site -- ../../site/compliance.json | ||
|
|
||
| - name: Configure Pages | ||
| uses: actions/configure-pages@v4 | ||
|
|
||
| - name: Upload Pages artifact | ||
| uses: actions/upload-pages-artifact@v3 | ||
| with: | ||
| path: site/ | ||
|
|
||
| - id: deployment | ||
| name: Deploy to GitHub Pages | ||
| uses: actions/deploy-pages@v4 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| name: Validate SDK Compliance (reusable) | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| file: | ||
| description: Path to sdk-compliance.yaml in the calling repo | ||
| type: string | ||
| default: sdk-compliance.yaml | ||
|
|
||
| jobs: | ||
| validate: | ||
| name: Validate compliance file | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout SDK repo | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Checkout capability spec | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: supabase/sdk | ||
| path: _sdk-spec | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: "22" | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
| working-directory: _sdk-spec/scripts/capability-matrix | ||
|
|
||
| - name: Validate compliance file | ||
| run: npm run validate-compliance -- "${{ github.workspace }}/${{ inputs.file }}" | ||
| working-directory: _sdk-spec/scripts/capability-matrix |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,8 @@ | ||
| # Claude Code internal state (worktree metadata, session files) | ||
| .claude/ | ||
|
|
||
| # Generated site output | ||
| site/ | ||
|
|
||
| # AI-assisted planning docs (agentic skill framework artefacts — not project documentation) | ||
| docs/superpowers/ | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,70 +1,94 @@ | ||
| # Supabase SDK Capability Matrix | ||
|
|
||
| The canonical, machine-readable record of which features each official Supabase client SDK implements. One YAML file per product area, validated in CI against a JSON Schema, with every claim of "implemented" backed by a verifiable reference to source code in the SDK's repository. | ||
| The canonical, machine-readable record of which features exist across Supabase client SDKs. This repository is a **pure feature registry** — it defines what features exist and what they mean. Each SDK repo is responsible for declaring which features it implements. | ||
|
|
||
| A static site rendered from these files is published at **https://shiny-adventure-ww2255r.pages.github.io/** (see `.github/workflows/deploy-pages.yml`). | ||
| A static site rendered from this data is published at **https://shiny-adventure-ww2255r.pages.github.io/**. | ||
|
|
||
| ## Repository layout | ||
|
|
||
| ``` | ||
| capabilities/ # One YAML file per product area (auth, database, storage, realtime, functions) | ||
| specs/ # Optional human-readable spec per feature: specs/{area}/{feature}.md | ||
| schema/ # JSON Schema for area files | ||
| scripts/ # TypeScript validator + site generator (scripts/capability-matrix) | ||
| .github/ # CI: structural validation, nightly reference drift, Pages deploy | ||
| .github/ # CI workflows (see below) | ||
| ``` | ||
|
|
||
| ## SDKs tracked | ||
|
|
||
| Every feature must declare a status for all seven official SDKs: | ||
|
|
||
| `javascript` · `flutter` · `python` · `swift` · `csharp` · `go` · `kotlin` | ||
|
|
||
| ## Status values | ||
|
|
||
| | Status | Meaning | | ||
| |---|---| | ||
| | `implemented` | Feature ships in the SDK. Requires at least one `references` entry pointing to the implementation. | | ||
| | `not_implemented` | Feature is in scope but not yet shipped. Must not include references. | | ||
| | `not_applicable` | Feature does not apply to this SDK (e.g. browser-only APIs in server SDKs). Must not include references. | | ||
| | `implemented` | Feature is fully implemented in the SDK. | | ||
| | `partially_implemented` | Feature is partially implemented. A `note` explaining what is missing is required. | | ||
| | `not_implemented` | Feature is in scope but not yet shipped (default for unlisted features). | | ||
| | `not_applicable` | Feature does not apply to this SDK (e.g. browser-only APIs in a server SDK). | | ||
|
|
||
| ## Adding or updating a capability | ||
|
|
||
| 1. Open the YAML for the relevant area under `capabilities/` (or create a new file matching the schema). | ||
| 2. Add or edit a feature entry. Each feature needs `id` (`<area>.<snake_case>`), `name`, `description`, optional `group`, and an `sdks` block covering all seven languages. | ||
| 3. For any SDK marked `implemented`, add `references` pointing to the source: | ||
| 2. Add or edit a feature entry. Each feature needs `id` (`<area>.<snake_case>`), `name`, `description`, and an optional `group`. | ||
| 3. Optionally add a spec file at `specs/<area>/<feature>.md` documenting the expected behavior. The validator enforces that every spec file has a matching feature ID. | ||
| 4. Validate locally and open a PR. CI runs structural checks (including spec file validation) on every PR. | ||
|
|
||
| The full schema lives in `schema/capability-matrix.schema.json`. | ||
|
|
||
| ## SDK compliance | ||
|
|
||
| SDK compliance is **declared in each SDK repo**, not here. To report which features your SDK implements, add a `sdk-compliance.yaml` file to the root of your SDK repo: | ||
|
|
||
| ```yaml | ||
| references: | ||
| - repo: supabase/postgrest-js | ||
| path: src/PostgrestQueryBuilder.ts | ||
| symbols: [select] | ||
| ref: v1.2.3 # optional pin to a tag, branch, or commit | ||
| ``` | ||
| ```yaml | ||
| sdk: javascript # one of: javascript, flutter, python, swift, csharp, go, kotlin | ||
|
|
||
| 4. Validate locally (see below). | ||
| 5. Open a PR. CI runs structural checks on every PR and reference checks on changed files. A nightly job re-runs reference checks across the whole matrix to catch upstream renames. | ||
| features: | ||
| auth.sign_up: implemented | ||
| auth.sign_in_with_password: implemented | ||
|
|
||
| auth.mfa_enroll: | ||
| status: partially_implemented | ||
| note: "TOTP only — phone factor not yet supported" | ||
|
|
||
| # Unlisted features default to not_implemented | ||
| ``` | ||
|
|
||
| The full schema lives in `schema/capability-matrix.schema.json` — the validator and editors that understand JSON Schema (via the `yaml-language-server` header at the top of each area file) will autocomplete and error-check as you type. | ||
| The file is **sparse** — only list features that differ from `not_implemented`. Unknown feature IDs and invalid status values fail CI. | ||
|
|
||
| ### Opt-in to validation | ||
|
|
||
| Add `.github/workflows/validate-capabilities.yml` to your SDK repo: | ||
|
|
||
| ```yaml | ||
| on: [pull_request] | ||
| jobs: | ||
| validate: | ||
| uses: supabase/sdk/.github/workflows/validate-sdk-compliance.yml@main | ||
| ``` | ||
|
|
||
| This checks out the canonical feature list from this repo and validates your compliance file against it on every PR. | ||
|
|
||
| ## Local development | ||
|
|
||
| ```bash | ||
| cd scripts/capability-matrix | ||
| npm ci | ||
|
|
||
| npm test # vitest suite for the validator | ||
| npm run typecheck # tsc --noEmit | ||
| npm run validate # tier 1: schema + structural checks (no network) | ||
| npm run validate:online # tier 2: also fetch each reference and verify the file/symbol exists | ||
| npm run report # parity report as JSON (overall, per-area, per-language) | ||
| npm run build-site # render the static site to scripts/capability-matrix/site/ | ||
| npm test # vitest suite for the validator | ||
| npm run typecheck # tsc --noEmit | ||
| npm run validate # schema + structural checks (no network) | ||
| npm run report # parity report as JSON (overall, per-area, per-language) | ||
| npm run validate-compliance <file> # validate a sdk-compliance.yaml against the canonical spec | ||
| npm run aggregate # fetch all SDK compliance files → site/compliance.json | ||
| npm run build-site # render the static site to site/index.html | ||
| npm run build-site compliance.json # render the site with compliance data | ||
| ``` | ||
|
|
||
| `validate:online` and the nightly CI job hit the GitHub REST API; set `GITHUB_TOKEN` in the environment to avoid rate limits. | ||
|
|
||
| ## CI | ||
|
|
||
| | Workflow | Trigger | What it does | | ||
| |---|---|---| | ||
| | `validate-capabilities.yml` | push to `main`, PRs touching matrix files, nightly cron | Tier 1 structural on every run; tier 2 references on PRs (changed files) and nightly (all files). | | ||
| | `deploy-pages.yml` | push to `main` touching matrix files, manual dispatch | Builds the site and deploys to GitHub Pages. | | ||
| | `validate-capabilities.yml` | push to `main`, PRs touching matrix files | Schema + structural checks including spec file validation. | | ||
| | `validate-sdk-compliance.yml` | `workflow_call` from SDK repos | Validates an SDK's `sdk-compliance.yaml` against the canonical feature list. | | ||
| | `aggregate-capabilities.yml` | hourly cron + `workflow_dispatch` | Fetches all SDK compliance files, builds the site, deploys to GitHub Pages. | |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.