Skip to content

feat: add capabilities based on supabase-js public methods - #18

Closed
mandarini wants to merge 26 commits into
mainfrom
feat/add-capabilities
Closed

feat: add capabilities based on supabase-js public methods#18
mandarini wants to merge 26 commits into
mainfrom
feat/add-capabilities

Conversation

@mandarini

@mandarini mandarini commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Seeds all 5 capability files (auth, database, storage, realtime, functions) from supabase-js's typedoc spec.json — ~200 feature entries with ids, names, descriptions, and groups derived mechanically from the public API surface. Generated by scripts/sync-canon.ts in supabase-js. Future SDKs declare compliance against these IDs; future updates land as additive PRs.

grdsdev and others added 26 commits June 8, 2026 11:38
Replace five monolithic YAML area files with one markdown file per
feature, following a Swift Evolution-style proposal structure.

- `capabilities/areas.yaml` — area registry with titles, descriptions,
  and ordered group definitions
- `capabilities/{area}/NNNN-slug.md` — one file per feature; ID is
  derived from folder + stem (hyphens → underscores, numeric prefix
  stripped); SDK entries are sparse (unlisted = not_implemented)
- `capabilities/TEMPLATE.md` — blank template with HTML comment
  guidance for each section; `capabilities/auth/0001-sign-up.md`
  serves as the canonical worked example

Spec template sections: Behavior (required), Prerequisites, Errors,
Notes, Related (all optional). Body is reserved for feature
specification; all matrix data remains in YAML frontmatter.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Each auth feature frontmatter now includes an `openapi` block pointing
to supabase/auth openapi.yaml and the specific operation(s) it maps to.

Format:
  openapi:
    repo: supabase/auth
    path: openapi.yaml
    operations:
      - method: POST
        path: "/signup"
      - method: POST          # optional params for /token variants
        path: "/token"
        params:
          grant_type: password

7 features have no spec operation (client-side only or missing from spec):
set_session, get_claims, on_auth_state_change, restore_session,
mfa_get_aal, mfa_webauthn_update, admin_create_user.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ection

The openapi: frontmatter field is replaced by a ## API section in the
markdown body, keeping all spec/documentation content in the body and
all structured matrix data in the frontmatter.

Format in body:
  ## API
  Spec: https://github.com/supabase/auth/blob/master/openapi.yaml
  - `POST /signup`
  - `POST /token` — `grant_type=password`

TEMPLATE.md updated to include ## API as the first body section
(optional — omit for client-side-only features).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Rolls back the per-feature markdown structure in response to review
feedback. Restores the original per-area YAML files which naturally
solve ordering (list position), compactness, and cross-feature scanning.

Changes:
- capabilities/{area}.yaml — restored to original per-area structure,
  with a new `groups:` block added to each file carrying group titles
  and display order (replaces the standalone areas.yaml)
- specs/{area}/{feature_id}.md — new directory for optional per-feature
  specs, linked by convention from the feature id (auth.sign_up →
  specs/auth/sign_up.md); no explicit field needed in the YAML
- specs/TEMPLATE.md — blank spec template (## API, ## Behavior,
  ## Prerequisites, ## Errors, ## Notes, ## Related)
- specs/auth/sign_up.md — canonical worked example

This cleanly separates structured machine-readable data (YAML) from
human/LLM-readable specification prose (Markdown).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Draft design for moving SDK compliance data out of the central
capabilities YAML and into each SDK's own repository.

Key decisions:
- supabase-capabilities.yaml at root of each SDK repo (sparse, flat)
- Reusable GitHub Actions validation workflow published from this repo
- Hourly aggregation workflow fetches compliance via GitHub API
- Central YAML becomes pure feature registry (no sdks: block)
- No SDK repos touched until team review

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…es.yaml

- Add validateCompliance() to check sdk name, feature ids, and statuses
- Add normalizeCompliance() to convert sparse YAML entries to ComplianceEntry objects
- Add collectFeatureIds() to gather all known feature ids from loaded areas
- Update types.ts: add partially_implemented status, Group interface, ComplianceEntry, ComplianceMap; remove SdkEntry/Reference and sdks field from Feature
… on features)

- Remove sdks: blocks from test YAML (schema now has additionalProperties: false)
- Fix schema-invalid test to use missing required field instead of partial sdks
- Update changedFiles test to verify filtering without reference queries (references moved to compliance files)
- Update report mode assertion (parity=1 when no sdks applicable languages)
When a spec file exists at specs/{area}/{stem}.md, the feature name in
the generated matrix becomes a clickable link to the GitHub URL. Hovering
shows a Supabase green underline; default style is subtle dotted underline.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
checkSpecs() errors on any specs/{area}/{stem}.md that has no matching
{area}.{stem} feature in the capabilities YAML, catching orphaned specs
and typos early. Wired into the validate pipeline via the new specsDir
option on RunOptions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Removes outdated sdks/references instructions and documents the new
model: central repo as pure feature registry, SDK compliance in
per-repo supabase-capabilities.yaml, partially_implemented status,
spec file validation, and the three new CI workflows.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Shorter, clearer name that reads naturally in an SDK repo context.
Updated across aggregate.ts, compliance-cli.ts, references.ts,
the reusable workflow, and the README.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove JS-specific function signature; spec now describes behavior,
  not a method API surface
- Document all inputs per credential type (email vs phone) with a table
  covering data, captchaToken, channel, and emailRedirectTo
- Clarify that redirect_to is a query parameter, not a request body field
- Split confirmation flow into two explicit branches (autoconfirm on/off)
- Add PKCE subsection with S256 + verifier storage semantics
- Document obfuscation behavior for existing confirmed accounts in Notes
- Add over_request_rate_limit to Errors

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mandarini
mandarini force-pushed the feat/add-capabilities branch from 02ba733 to 88f548c Compare June 11, 2026 13:11
Base automatically changed from claude/hungry-wilson-af8300 to main June 11, 2026 17:10
@grdsdev
grdsdev self-requested a review as a code owner June 11, 2026 17:10
@linear-code

linear-code Bot commented Jun 11, 2026

Copy link
Copy Markdown
SDK-1045 Bootstrap supabase-js compliance with supabase/sdk capability matrix

Follow-up work after supabase/sdk#15 merges. That PR moves SDK compliance reporting out of the central supabase/sdk repo and into per-SDK files (sdk-compliance.yaml) in each SDK repo. Once merged, supabase-js needs to be wired up.

1. Write sdk-compliance.yaml in supabase-js

Two PRs recommended (decouple plumbing from audit work):

PR 1 — plumbing (small):

  • Add .github/workflows/validate-capabilities.yml calling the reusable workflow from supabase/sdk:

    on: [pull_request]
    jobs:
      validate:
        uses: supabase/sdk/.github/workflows/validate-sdk-compliance.yml@main
  • Add a skeleton sdk-compliance.yaml at the repo root with sdk: javascript and an empty features: {} (sparse — defaults to not_implemented).

  • Confirm CI passes against the canonical spec.

PR 2 — actual audit:

  • Walk every feature ID across all 5 areas in supabase/sdk/capabilities/*.yaml (~67 features).
  • Mark each as implemented / partially_implemented / not_implemented / not_applicable.
  • Add note for partials and notable quirks (e.g. method named differently in JS, parameter not exposed, etc.).
  • Document the baseline supabase-js version being audited (top comment in the file).

2. Audit the canonical capability list for completeness

While doing (1), cross-check the registry. Anything in supabase-js that doesn't map cleanly to a feature ID = gap in the registry. Open a PR against supabase/sdk to add missing feature IDs.

Bonus: cross-check capabilities/auth.yaml against supabase/auth/openapi.yaml operations. Auth is the largest surface; if those line up, the registry is in good shape.

3. Things to flag back to supabase/sdk (post-merge follow-ups)

These came out of reviewing PR #15 and are worth tracking separately or feeding back as issues against supabase/sdk:

  • Rollout/migration plan for the other 6 SDKs — without one, the public matrix sits at 0% for everyone but JS indefinitely.
  • since: field on compliance entries — the old sdks: block had since: 1.2.3 per SDK. Lost in the redesign; would be nice to recover.
  • deprecated status — currently no clean way to mark a feature an SDK once shipped but is removing.
  • Versioning of the capability set — Quintin raised this in his review and it was punted. Once SDKs reference feature IDs, a rename in supabase/sdk@main breaks every SDK's CI immediately.
  • Server-spec drift detection — if supabase/auth adds an error code or changes a response shape, surface that as "supabase-js needs updating." The rolled-back openapi: block was reaching for this.
  • Conformance tests — nothing today verifies that "implemented" actually means anything ships. SDK teams self-report. Once ## API sections in specs/*.md point at server OpenAPI operations, a check could confirm the operations exist.

Some of these were left as PR comments on #15; others are post-merge work for either repo.

Dependencies

Comment thread capabilities/storage.yaml
- id: storage.create_index
name: Create Index
description: Creates a new vector index in this bucket Convenience method that automatically includes the bucket name
group: files

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.

this I think should be another group, vector-bucket? How was this named again?

Comment thread capabilities/storage.yaml
Comment on lines +125 to +128
- id: storage.set_header
name: Set Header
description: Set an HTTP header for the request. Creates a shallow copy of headers to avoid mutating shared state.
group: files

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.

I remember storage team mentioning this wasn't needed anymore, I think we could not consider this as canonical feature.

Comment thread capabilities/storage.yaml
Comment on lines +129 to +132
- id: storage.throw_on_error
name: Throw On Error
description: Enable throwing errors instead of returning them. When enabled, errors are thrown instead of returned in { data, error } format.
group: files

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.

JS specific, remove from canonical features

Comment thread capabilities/storage.yaml
Comment on lines +133 to +136
- id: storage.to_base64
name: To Base64
description: To Base64 (no description in source).
group: files

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.

I don't remember what this is, should it be a canonical feature?

Comment on lines +15 to +18
- id: database.abort_signal
name: Abort Signal
description: Set the AbortSignal for the fetch request.
group: filter

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.

JS specific, remove

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.

I mean the abort signal naming is JS specific, but I understand this "feature" can be implemented in other languages with different naming, this is the capability of aborting/cancelling a request to postgrest.

In Swift would be similar to:

let task = Task {
    try await supabase.from("table").select("*").execute()
}

task.cancel() // No need to specify any "abort signal", cancelling a task is native to the language

This would be not applicable for Swift, but I wonder if we should have a canonical "cancellation" capability.

Comment on lines +151 to +154
- id: database.override_types
name: Override Types
description: Override the type of the returned field in the response.
group: filter

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.

JS specific, remove

Comment on lines +191 to +194
- id: database.returns
name: Returns
description: Override the type of the returned .
group: filter

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.

JS specific, remove

Comment on lines +227 to +230
- id: database.throw_on_error
name: Throw On Error
description: If there's an error with the query, throwOnError will reject the promise by throwing the error instead of returning it as part of a successful response.
group: filter

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.

JS specific, remove

Comment on lines +23 to +26
- id: realtime.copy_bindings
name: Copy Bindings
description: Copy Bindings (no description in source).
group: channel

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.

should not be public exposed I think

Comment on lines +55 to +58
- id: realtime.on
name: "On"
description: Creates an event handler that listens to changes.
group: channel

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.

This is a case where it should not be a 1 to 1 mapping to the SDK method, we have 3 separate features here.

  • Listen for broadcast messages
  • Listen for presence events
  • Listen for postgres changes

How should this be represented in the canonical spec?

Option 1: consider 3 separate features
Option 2: consider a single feature, and specify the 3 cases in the spec file

cc : @supabase/sdk for feedback.

@mandarini

Copy link
Copy Markdown
Contributor Author

Moved here to avoid having to resolve all these conflicts #19

@mandarini mandarini closed this Jun 12, 2026
@grdsdev
grdsdev deleted the feat/add-capabilities branch June 17, 2026 15:03
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