Skip to content

docs(supabase): document the wasm-inline entry in the two files that ship - #951

Draft
tobyhede wants to merge 1 commit into
mainfrom
docs/supabase-wasm-inline-shipping-docs
Draft

docs(supabase): document the wasm-inline entry in the two files that ship#951
tobyhede wants to merge 1 commit into
mainfrom
docs/supabase-wasm-inline-shipping-docs

Conversation

@tobyhede

@tobyhede tobyhede commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

CipherStash Stack encrypts individual database columns. @cipherstash/stack-supabase is the Supabase integration, and since #912 it has shipped two entry points: the package root, which reads your column types straight out of Postgres and therefore needs Node; and @cipherstash/stack-supabase/wasm-inline, which takes the tables you declare instead and therefore runs on Deno, Supabase Edge Functions and Cloudflare Workers.

The two documents that ship to customers were never updated. Both still said the wrapper cannot run in a Worker, which stopped being true nine days ago. This PR corrects them and documents the edge entry, which the README did not mention even once.

This matters most for the readers who need the edge entry: server code on managed AI platforms (Lovable, v0, Bolt, Replit) runs on an edge runtime. An agent that reads "cannot run in a Worker" does not file a bug — it concludes the product does not support the platform and stops.

Changes

skills/stash-supabase/SKILL.md — ships inside the stash npm package; stash init copies it into the customer's repository, where their coding agent reads it as instruction.

  • The setup section's claim is now scoped to the package root entry, and points forward to the new step 5.
  • New "### 5. Edge runtimes — the wasm-inline entry": an entry-point comparison table, the full call shape, and the four ways that entry differs.
  • The managed-platforms callout and the Edge Function credentials callout now both point at step 5. The second one previously sent a Supabase reader to @cipherstash/stack/wasm-inline, which is the right entry for encrypting without the wrapper and the wrong one for using it.

packages/stack-supabase/README.md — renders on the npm package page.

  • Same correction to the introspection paragraph.
  • New "Edge runtimes" section with the same table and call shape. The file contained zero occurrences of the word "wasm" before this.

.changeset/supabase-docs-wasm-inline-entry.mdstash patch (the skill ships in that tarball) and @cipherstash/stack-supabase patch (the README).

Verification

Every claim about the edge entry was checked against source rather than restated:

Claim Source
schemas is required packages/stack-supabase/src/create.ts:307-313
config is required and carries all four CS_* values packages/stack-supabase/src/wasm-inline.ts:18-30
databaseUrl throws at construction packages/stack-supabase/src/create.ts:359-361
.withLockContext() / .audit() throw packages/stack-supabase/src/wasm-client-adapter.ts:40-66

Test runs:

  • pnpm --filter @cipherstash/stack-supabase test — 565 passed, 16 files.
  • pnpm --filter stash exec vitest run src/__tests__/skill-supabase-apply.test.ts — 29 passed. This is the guard that reads the shipped skills.
  • npx vitest run scripts/__tests__/skills-retired-package-scopes.test.mjs scripts/__tests__/turbo-skills-inputs.test.mjs — 42 passed.

Rebuilt stash, @cipherstash/wizard and @cipherstash/stack-supabase. grep "cannot run in a Worker" over packages/cli/dist/skills/ and packages/wizard/dist/skills/ now returns nothing; before the rebuild both carried it at line 269, so an npm pack shipped it.

pnpm run code:check does not pass on this machine, and does not on main either: it exits at the configuration stage on a nested biome.json inside a local .claude/worktrees/ checkout, before linting anything. Biome does not lint Markdown in this repo regardless — run against the three changed files directly it reports all three as ignored, so this PR cannot affect that check either way.

Related

Closes #950
Refs #912 (added the second entry point), #804 (the browser claim, which is correct and stays), #797 (.withLockContext() on the WASM entry, which throws today).

Review notes

This branch conflicts with #953 in skills/stash-supabase/SKILL.md. Both edit the same paragraph: this one replaces the sentence at line 269, and that one inserts a paragraph immediately below it. The two are complementary — that PR explains why the browser is still ruled out, this one explains why the Worker no longer is — so whichever merges second should rebase and keep both.

Three files carry the same stale sentence and are deliberately untouched: packages/stack/CHANGELOG.md, packages/stack-supabase/CHANGELOG.md, and docs/superpowers/specs/2026-07-09-supabase-v3-introspection-design.md. They are historical records and were accurate on the dates they were written. docs/reference/supabase-sdk.md carries it too, and is fixed in #952 instead — it is internal reference documentation and ships in no package, so it takes no changeset and did not belong in this one.

…ship

`@cipherstash/stack-supabase` has had two entry points since #912. The package
root introspects the database and runs on Node; `/wasm-inline` carries the WASM
engine, takes declared `schemas` instead of introspecting, and runs on Deno,
Supabase Edge Functions and Cloudflare Workers. Introspection was the only
thing needing a Postgres socket, so that entry does run in a Worker.

Two shipping documents were never updated and still describe the state before
that change:

- `packages/stack-supabase/README.md` said the factory "cannot run in an edge
  Worker or the browser", and contained no occurrence of the word "wasm" at
  all. This file renders on the npm package page.
- `skills/stash-supabase/SKILL.md` said the same in its setup section. The
  skill ships inside the `stash` tarball and `stash init` copies it into the
  customer's repo, where their agent reads it as instruction. The file's one
  correct mention of the edge entry sat in a callout the setup steps never
  pointed at, so a reader following the steps never learned it existed.

The readers this misled hardest are the ones who need the edge entry most:
server code on Lovable, v0, Bolt and Replit runs on an edge runtime, which is
exactly what `/wasm-inline` was built for. The failure is silent — an agent
that reads "cannot run in a Worker" concludes the product does not support the
platform and stops.

Both files now carry an entry-point table and the edge call shape, and name the
four ways that entry differs, each checked against the source rather than
restated: `schemas` is required (`create.ts:307-313`), `config` is required and
carries all four `CS_*` values (`wasm-inline.ts:18-30`), `databaseUrl` throws at
construction (`create.ts:359-361`), and `.withLockContext()` / `.audit()` throw
rather than silently dropping an identity claim (`wasm-client-adapter.ts:40-66`,
#797).

The browser half of the old sentence was correct and is kept, with its reason
named: the WASM client requires a workspace `clientKey` on every authentication
path, so a browser build would ship the key with it (#804).

Deliberately untouched: `packages/stack/CHANGELOG.md`,
`packages/stack-supabase/CHANGELOG.md` and the superpowers design spec carry the
same sentence and are historical records, accurate for their dates.
`docs/reference/supabase-sdk.md` carries it too and is fixed separately — it is
internal and ships in no package.

Changeset: `stash` patch for the skill, `@cipherstash/stack-supabase` patch for
the README.

Closes #950
Refs #912, #804, #797

Claude-Session: https://claude.ai/code/session_01E1J2nVGJWVkqvLepDfinRf
@changeset-bot

changeset-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2733d25

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
@cipherstash/stack-supabase Patch
stash Patch
@cipherstash/basic-example Patch
@cipherstash/e2e Patch
@cipherstash/stack Patch
@cipherstash/stack-drizzle Patch
@cipherstash/stack-prisma Patch
@cipherstash/wizard Patch
@cipherstash/bench Patch
@cipherstash/test-kit Patch
@cipherstash/prisma-example Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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.

stash-supabase skill and README tell customers Workers are impossible — supported since #912

1 participant