refactor(prisma-next)!: drop Encrypted prefix from v3 schema types; cipherstashFromStackV3 → cipherstashFromStack#685
Conversation
…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
🦋 Changeset detectedLatest commit: 173092b The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
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 |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
…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
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)
Encrypted— thecipherstash.namespace already disambiguates:cipherstash.EncryptedTextSearch()→cipherstash.TextSearch(),EncryptedDoubleOrd()→DoubleOrd(),EncryptedBoolean()→Boolean(),EncryptedJson()→Json(), etc. Done at the single derivation seam (contract-authoring.tsv3PascalName).cipherstashFromStackV3→cipherstashFromStack(v3 is the default); the v2 setup fn becomescipherstashFromStackV2.Deliberately unchanged
EncryptedString/EncryptedNumber/EncryptedBoolean/…) — a separate write-side surface; Dan asked to leave them.cipherstash.*V2legacy column constructors.contract.json+ codec ids — they key off codec ids, not constructor names, so no contract regeneration is needed (which neatly sidesteps the brokenprisma-next contract emiton this branch — filed separately as it's pre-existing).eql*query operators.encryptedTextSearch, …) keep their prefix for now — a follow-up will align them (I keptv3CamelNameunchanged to avoid desyncing the static exports; flagged below).Decisions (yours, documented)
cipherstash, noteql. It's the extension's vendor identity (CIPHERSTASH_SPACE_ID, woven through everycipherstash/eql-v3/*codec id andcipherstash:*invariant) — switching it would re-identify the whole extension and rewrite every codec id. Drizzle usestypes.(a TS namespace), noteql., so there's no cross-adaptereql.precedent either.cipherstashFromStackV2(your pick).For @calvinbrewer (heads-up on your package)
Two things I did not touch and want your call on:
encryptedTextSearch…) — align them to dropencryptedtoo, as a follow-up?cipherstash.EncryptedString(), which was never a valid v3 constructor (v3 text isText*). I made it a coherent v3 example (TextSearch/DoubleOrd/DateOrd/Json); please sanity-check it matches your intent.Verification
code:checkclean.properties.test.ts,migration-v3) are missing-devdep / needs-DB / needs-build issues on the branch, not this change.Changeset:
@cipherstash/prisma-nextminor (breaking, rc convention) +stashpatch (skill).https://claude.ai/code/session_01MxTTPaPP16m6br7Hoab94w