chore(stack): upgrade EQL v3 bundle (timestamptz → timestamp) + cast_as fix#542
chore(stack): upgrade EQL v3 bundle (timestamptz → timestamp) + cast_as fix#542tobyhede wants to merge 2 commits into
Conversation
Track encrypt-query-language@2e64ca73, which renames the `eql_v3.timestamptz*` domains to `eql_v3.timestamp*`. Regenerate the vendored SQL fixture and propagate the rename through the SDK and tests: - src/eql/v3: TIMESTAMPTZ* domain consts + eqlType `eql_v3.timestamptz*` -> TIMESTAMP* / `eql_v3.timestamp*`; classes `EncryptedTimestamptz*Column` -> `EncryptedTimestamp*Column`; `types.Timestamptz*` -> `types.Timestamp*`; barrel re-exports. - Regenerate __tests__/fixtures/eql-v3/cipherstash-encrypt-v3.sql (new bundle). - Install tooling: the stale-install sentinel moves from `eql_v3.text_search` (present in both generations) to `eql_v3.timestamp` (new this bundle), so a DB carrying an older install is detected as stale and reinstalled (hasEqlV3TextSearch -> hasCurrentEqlV3). - Propagate the rename through the v3 tests, catalog, changesets. Stacked on feat/eql-v3-types-module. NOTE: TIMESTAMP still sets castAs 'date'; if this bundle is meant to fix the time-of-day truncation, a `cast_as:'timestamp'` and re-enabling the schema-v3-client occurredAt skip are still to do.
…ime-of-day)
The native protect-ffi CastAs has a distinct `timestamp` variant (full
date+time) separate from `date` (calendar-date only). Every v3 timestamp domain
was set to `cast_as: 'date'`, so the native layer truncated the time-of-day to
midnight on decrypt.
Add `timestamp` through the cast_as type system and point the timestamp domains
at it:
- schema: `castAsEnum` (SDK/native) and `eqlCastAsEnum` (wasm, via toEqlCastAs)
gain `timestamp`; `toEqlCastAs('timestamp') -> 'timestamp'`.
- eql/v3: `PlaintextKind` gains `timestamp` (decrypts to `Date`, like `date`);
the four `TIMESTAMP*` domain consts set `castAs: 'timestamp'`.
- typed client: `reconstructRow` rebuilds `Date` for `timestamp` as well as
`date`.
TDD: timestamp domains' build() now emits `cast_as: 'timestamp'` (date stays
`date`); catalog + matrix build() assertions updated; the schema-v3-client
`occurredAt` round-trip (a ms-zeroed 12:34:56 instant) is re-enabled to pin
time-of-day preservation live in CI.
|
| Name | Type |
|---|---|
| @cipherstash/stack | Minor |
| @cipherstash/bench | Patch |
| @cipherstash/prisma-next | Patch |
| @cipherstash/basic-example | Patch |
| @cipherstash/prisma-next-example | Patch |
| @cipherstash/e2e | Patch |
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a 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 |
Stacked on #541. Tracks
encrypt-query-language@2e64ca73, which renames theeql_v3.timestamptz*domains toeql_v3.timestamp*, and fixes the time-of-day truncation those domains suffered.1. Bundle rename —
timestamptz→timestamptypes.Timestamptz*→types.Timestamp*; domain consts / classes /eqlType(eql_v3.timestamptz*→eql_v3.timestamp*); barrel re-exports.cipherstash-encrypt-v3.sql).eql_v3.text_search(present in both bundle generations) toeql_v3.timestamp(new this bundle), so a DB carrying an older install is detected as stale and reinstalled.2.
cast_asfix — preserve time-of-dayThe native protect-ffi
CastAshas a distincttimestampvariant (full date+time) separate fromdate(calendar-date only). Every timestamp domain was set tocast_as: 'date', so the native layer truncated the time-of-day to midnight on decrypt. Now:castAsEnum(SDK/native) andeqlCastAsEnum(wasm, viatoEqlCastAs) gaintimestamp;toEqlCastAs('timestamp') → 'timestamp'.PlaintextKindgainstimestamp(decrypts toDate, likedate); the fourTIMESTAMP*domain consts setcastAs: 'timestamp'.reconstructRowrebuildsDatefortimestampas well asdate.schema-v3-clientoccurredAtround-trip (a ms-zeroed12:34:56instant) to pin time-of-day preservation live in CI.Verified
cast_as: 'timestamp', date staysdate,encryptConfigSchemavalidates, fullpnpm buildtypechecks (incl.toEqlCastAsexhaustiveness).occurredAt) run in CI with credentials.Note: the base commit on this branch (
test(stack): v3 lock-context coverage …) belongs to #541 and will drop from this diff once #541 merges.