Repository navigation
fix(eql): align JSON array flag with SQL and handle empty arrays - #1545
cipherstash-agent wants to merge 4 commits into
Conversation
SteVecDocument now models the root `a` flag the SQL validator allows and the array accessors require. Entry/root `a` is optional but non-nullable in the bindings, schema and TypeScript, matching the SQL CHECK. ste_vec() returns an empty array instead of NULL for an empty sv, so jsonb_array_length returns 0 and jsonb_array_elements / jsonb_document_contains no longer raise on empty arrays. Fixes CIP-5156. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012Jmn7s3rQQHaix17SvioLg
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012Jmn7s3rQQHaix17SvioLg
🦋 Changeset detectedLatest commit: b45333d The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 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 Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true |
This comment has been minimized.
This comment has been minimized.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012Jmn7s3rQQHaix17SvioLg
|
The Generated by Claude Code |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012Jmn7s3rQQHaix17SvioLg
|
Generated by Claude Code |
Requested by CipherStash · project thread
Summary
Fixes CIP-5156 (E5, E6): the EQL v3 JSON array flag
adisagreed between the Rust/TypeScript bindings and the SQL, and empty encrypted arrays broke the SQL accessors.Changes
SteVecDocumentnow has an optional rootafield. The SQL root validator allows it and the array accessors require it, so array documents the database accepts now parse in the bindings.a(root and entry) is optional but non-nullable: schema"type": "boolean", TSa?: boolean, and anullis rejected on deserialize. This matches the SQL CHECKjsonb_typeof(...) = 'boolean'.eql_v3.ste_vecreturns an empty array instead of NULL for an emptysv.jsonb_array_lengthnow returns 0 (was NULL), andjsonb_array_elements/jsonb_document_contains(jsonb[], jsonb)no longer raise "upper bound of FOR loop cannot be null". Their loops now usecardinality().@cipherstash/eqlgenerated sources. Added a changeset.Verification
cargo test -p eql-bindings: all pass, including new tests for rootaround-trip and null rejection.v3_jsonb_empty_array_accessorspasses against a local Postgres with the installer applied. The rest ofv3_jsonb_tests.rsneeds generated fixtures (CipherStash credentials), so I could not run it locally.Related
a).Review notes
languages/typescript/packages/protect-ffi/src/eql-v3-typesare synced from the locked, publishedeql-bindingscrate by design, so they are not touched here and pick up the change on the next release.awere made non-nullable. Other nullable-looking optional fields (i,v,hon entries) are out of scope.skills/does not mention theaflag shape.Generated by Claude Code