Skip to content

refactor(prisma-next)!: drop Encrypted prefix from v3 schema types; cipherstashFromStackV3 → cipherstashFromStack#685

Open
coderdan wants to merge 3 commits into
feat/prisma-next-cli-skillfrom
feat/prisma-next-rename-v3-types
Open

refactor(prisma-next)!: drop Encrypted prefix from v3 schema types; cipherstashFromStackV3 → cipherstashFromStack#685
coderdan wants to merge 3 commits into
feat/prisma-next-cli-skillfrom
feat/prisma-next-rename-v3-types

Conversation

@coderdan

Copy link
Copy Markdown
Contributor

Renames the EQL v3 authoring surface to line up with the stack / Drizzle types.* catalog, per Dan's #683 review (comments 3 & 4). Stacked on #683 so the package rename and the skill land together.

What changed (public API)

  • v3 PSL column constructors drop Encrypted — the cipherstash. namespace already disambiguates:
    cipherstash.EncryptedTextSearch()cipherstash.TextSearch(), EncryptedDoubleOrd()DoubleOrd(), EncryptedBoolean()Boolean(), EncryptedJson()Json(), etc. Done at the single derivation seam (contract-authoring.ts v3PascalName).
  • cipherstashFromStackV3cipherstashFromStack (v3 is the default); the v2 setup fn becomes cipherstashFromStackV2.

Deliberately unchanged

  • Runtime value envelopes (EncryptedString/EncryptedNumber/EncryptedBoolean/…) — a separate write-side surface; Dan asked to leave them.
  • The cipherstash.*V2 legacy column constructors.
  • Generated contract.json + codec ids — they key off codec ids, not constructor names, so no contract regeneration is needed (which neatly sidesteps the broken prisma-next contract emit on this branch — filed separately as it's pre-existing).
  • The eql* query operators.
  • The camelCase TS-authoring exports (encryptedTextSearch, …) keep their prefix for now — a follow-up will align them (I kept v3CamelName unchanged to avoid desyncing the static exports; flagged below).

Decisions (yours, documented)

  • Namespace stays cipherstash, not eql. It's the extension's vendor identity (CIPHERSTASH_SPACE_ID, woven through every cipherstash/eql-v3/* codec id and cipherstash:* invariant) — switching it would re-identify the whole extension and rewrite every codec id. Drizzle uses types. (a TS namespace), not eql., so there's no cross-adapter eql. precedent either.
  • v2 name = cipherstashFromStackV2 (your pick).

For @calvinbrewer (heads-up on your package)

Two things I did not touch and want your call on:

  1. The camelCase TS-authoring exports (encryptedTextSearch …) — align them to drop encrypted too, as a follow-up?
  2. The package README quick-start was already stale independent of this rename — it used cipherstash.EncryptedString(), which was never a valid v3 constructor (v3 text is Text*). I made it a coherent v3 example (TextSearch/DoubleOrd/DateOrd/Json); please sanity-check it matches your intent.

Verification

  • Package builds clean (rename compiles); bundling-isolation 12/12; authoring / psl-interpretation / column-types / from-stack suites green; code:check clean.
  • Pre-existing failures (live-pg tests, properties.test.ts, migration-v3) are missing-devdep / needs-DB / needs-build issues on the branch, not this change.

Changeset: @cipherstash/prisma-next minor (breaking, rc convention) + stash patch (skill).

https://claude.ai/code/session_01MxTTPaPP16m6br7Hoab94w

…s; cipherstashFromStackV3 -> cipherstashFromStack

Aligns the EQL v3 authoring surface with the stack / Drizzle types.* catalog
(the cipherstash. namespace already disambiguates):

- v3 PSL column constructors drop the Encrypted prefix, at the single
  derivation seam (contract-authoring.ts v3PascalName): EncryptedTextSearch
  -> TextSearch, EncryptedDoubleOrd -> DoubleOrd, EncryptedBoolean -> Boolean,
  EncryptedJson -> Json, etc.
- v3 one-call setup: cipherstashFromStackV3 -> cipherstashFromStack (v3 is the
  default); the v2 setup fn becomes cipherstashFromStackV2.

Deliberately unchanged:
- runtime value envelopes (EncryptedString/Number/BigInt/Date/Boolean/Json) —
  a separate write-side surface; Dan asked to leave them as-is.
- the cipherstash.*V2 legacy column constructors.
- generated contract.json + codec ids (they key off codecIds, not constructor
  names — so no contract regeneration needed, which sidesteps the broken
   on this branch).
- the eql* query operators.
- camelCase TS-authoring exports (encryptedTextSearch, …) keep their prefix for
  now — a follow-up will align them (kept v3CamelName unchanged to avoid
  desyncing the static exports).

Namespace stays cipherstash (not eql): it is the extension's vendor identity
(CIPHERSTASH_SPACE_ID, woven through every cipherstash/eql-v3/* codec id and
cipherstash:* invariant) — switching it would re-identify the whole extension.

Updated: example schema.prisma + db.ts + e2e, both READMEs, the
stash-prisma-next skill, and the authoring/psl-interpretation tests. Verified:
package builds clean, bundling-isolation 12/12, authoring/psl/column-types/
from-stack suites green, code:check clean. (Pre-existing env failures — live
tests, properties, migration-v3 — are missing-devdep/DB issues, not this change.)

Stacked on #683. v2 name per Dan; namespace + scope calls documented above.

Claude-Session: https://claude.ai/code/session_01MxTTPaPP16m6br7Hoab94w
@coderdan
coderdan requested a review from a team as a code owner July 17, 2026 08:00
@changeset-bot

changeset-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 173092b

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

This PR includes changesets to release 11 packages
Name Type
@cipherstash/prisma-next Minor
stash Minor
@cipherstash/prisma-next-example Patch
@cipherstash/basic-example Patch
@cipherstash/e2e Patch
@cipherstash/stack Minor
@cipherstash/stack-drizzle Minor
@cipherstash/stack-supabase Minor
@cipherstash/wizard Minor
@cipherstash/bench Patch
@cipherstash/test-kit 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

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 47179769-d133-4348-b51a-1af93c689410

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/prisma-next-rename-v3-types

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

coderdan added 2 commits July 17, 2026 18:08
…gree

CI (Node 22/24 unit job) caught what my local env masked: test/v3/properties.test.ts
asserts the PSL (pascal) and TS-authoring (camel) constructor names agree modulo
first-letter case. My earlier deferral of the camelCase exports broke that
invariant (pascal 'TextSearch' vs camel 'encryptedTextSearch'), and the property
test only runs with fast-check installed (absent locally, present in CI).

- v3CamelName drops the prefix too (encrypted<Core> -> lowercase-first<Core>),
  restoring the pascal/camel invariant.
- The 31 static TS-authoring exports rename in lockstep: encryptedTextSearch ->
  textSearch, encryptedDoubleOrd -> doubleOrd, encryptedBoolean -> boolean, etc.
  (column-types.ts + its two test consumers). The v2 encryptedStringV2 descriptors
  and the runtime encrypted*ParamsSchema arktype schemas are deliberately untouched.
- properties.test.ts: the assertion updated to the new convention (name does NOT
  start with 'Encrypted', is PascalCase, camel = lowercase-first(pascal)).
- Changeset updated: camelCase exports move with the PSL names (no longer deferred).

Ran the FULL prisma-next suite locally after `pnpm install` (which restored the
missing devdeps my earlier local runs lacked): 599 passed / 30 skipped, including
properties + column-types. Build clean, code:check clean.

Claude-Session: https://claude.ai/code/session_01MxTTPaPP16m6br7Hoab94w
…on names

Follow-up to the camelCase rename: the 'no *OrdOre / no string factory'
negative assertions checked old-convention names (encryptedBigIntOrdOre,
encryptedString) that never existed either way — pass, but off-convention.
Now check the new-convention names (bigIntOrdOre, textOrdOre, string).

Claude-Session: https://claude.ai/code/session_01MxTTPaPP16m6br7Hoab94w
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.

1 participant