Repository navigation
feat(stack-encrypt,eql-bindings): typed JSON queries from a field marker #1687
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
coderdan
wants to merge
6
commits into
refactor/stack-encrypt-remove-chain-and-old-traits
Choose a base branch
from
feat/stack-encrypt-typed-json-queries
base: refactor/stack-encrypt-remove-chain-and-old-traits
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+5,049
−1,521
Draft
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0579ee5
refactor(stack-encrypt): one definition of the JSON operators' inputs…
coderdan ec1a614
feat(stack-encrypt,eql-bindings): typed JSON queries from a field marker
coderdan cf40c37
fix(stack-encrypt): address the review of typed JSON queries
coderdan bf1511f
feat(stack-encrypt)!: Error::Input for a refusal of the caller's input
coderdan a693703
test(stack-encrypt): pin the JSON marker lines the mutation run found…
coderdan 7ca15a4
test(stack-encrypt): name every JSON input's operator, and exclude an…
coderdan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| --- | ||
| '@cipherstash/eql': minor | ||
| --- | ||
|
|
||
| `eql-bindings`, the Rust crate released with this package: a `JsonTreeDocument` field of a derived Stack Encrypt record is queried from its field marker, and each query returns the EQL query type a parameter binds as. | ||
|
|
||
| - `EncryptedCustomer::PROFILE.contains(doc)` gives a `JsonTreeQuery` for `@>`, and `contained_by(doc)` one for `<@`. | ||
| - `at(path).gt(v)` and the other comparisons give a `JsonTreeLeafQuery`, `at(path).between(lo, hi)` two of them, and `at(path).selector()` the `JsonTreeSelector` that `->` takes. | ||
| - `elements(path).eq(member, v)..` gives a `JsonTreeElementsQuery`, `predicate(text)` a `JsonTreePredicateQuery`, and `children(path)` a `JsonTreeToken`. | ||
| - `#[stash(json(ordered = ["$.age"]))]` on the field names the paths the documents order. The field is sealed under those options and queried under them. | ||
|
|
||
| Each query is the operand a data plan naming `JsonSearch` derives for the same column and options, which is what the Go SDK sends. The stored format, the SQL bundle and the TypeScript types do not change. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
F4, minor: the plan says these operand types are retired, but this PR adds them back as public types.
This paragraph, which the PR edits, still ends: "The operand types
Contains,AtPath,ElementMatch,Predicate, andChildrenthat the plan proposed earlier are retired, replaced by these methods, on 7 November 2026." The same claim is at line 1565-1567 ("Names. ... are retired").This PR adds
marker::json::{Selector, ElementMatch, Predicate, Children}as public type tags.MarkedJson<T, Op, S>takesop::Contains,op::ContainedByandop::AtPath<..>asOp(Review note 3). A reader of the plan will look for types that the plan says do not exist, and find them.Verified.
Suggested fix: say that these names now exist as the kind parameter of
MarkedJson, that they carry no values, and that the methods are still the API. Give the date of that decision. Also update "Names. The method names above are proposals" at line 1565.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in cf40c37. Both places in the plan now say that those names were retired as operands a caller builds. They also say that
MarkedJson<T, Op, S>names the query's kind with value-free type tags:op::Contains,op::ContainedByorop::AtPathof a comparison, plusSelector,ElementMatch,PredicateandChildren, recorded on 16 November 2026. The "proposals" line now says the method names were confirmed in the naming review.