feat(value): introduce Object storage abstraction - #735
Merged
anakrish merged 1 commit intoJun 4, 2026
Conversation
Add an opaque Object type for the key→value storage backing Value::Object. It exposes a small set of methods (get, insert, remove, iter, iter_sorted, cursor, serde) and keeps the backing store private, so future representations -- inline small-map, hash-backed, lazy, arena, FFI-callback -- can plug in without touching the call sites that name this type. Nothing in the engine uses Object yet. Value::Object still wraps Rc<BTreeMap<Value, Value>>; the payload swap and call-site migration come in the next PR. Object stands on its own unit tests in the meantime. docs/value/object.md walks through the design, the precedents it follows (serde_json::Map, toml::Table, simdjson DOM), and the concrete workloads the abstraction is meant to unlock. A matching Set abstraction follows in a separate PR. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
anakrish
force-pushed
the
storage-abstraction-object-foundation
branch
from
June 2, 2026 17:44
595029d to
d9892d9
Compare
dpokluda
approved these changes
Jun 4, 2026
anakrish
added a commit
that referenced
this pull request
Jul 21, 2026
Release the core `regorus` crate as v0.11.0 (up from v0.10.1) and align every language binding to the same version. This release carries an API-breaking change (flagged by cargo-semver-checks), so it takes a minor bump under the 0.x SemVer convention. Highlights since v0.10.1: - fix(rvm): assert every-quantifier results so failing cases don't pass (#765) - fix: deep-merge nested data documents in Engine::add_data (#760) - feat(compiler): support registered host-await builtins for natural function call syntax (#667) - feat(value): introduce Set/Object storage abstractions (#740, #735, #736) - security: reject data nested beyond 128 levels to avoid stack overflow Version updates: - Core crate (Cargo.toml/Cargo.lock) 0.10.1 -> 0.11.0 - Bindings aligned via `cargo xtask bindings`: ffi, java, python, wasm, ruby, csharp (manifests, lockfiles, pom.xml, Directory.Packages.props, version.rb) - CHANGELOG.md updated with the 0.11.0 section
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
First in a small series that introduces opaque storage types for
Valuevariants so future backends can swap in without rippling through call sites. The design also lets multiple backends coexist at runtime — differentObjectinstances in the same process can use different implementations (e.g. a lazy DB-backed object forinput, inline small-map objects for SARIF location records, regular sorted maps elsewhere) and interoperate through the same opaque type.The design and rationale are written up in
docs/value/object.md. It covers the encapsulation choice, the explicititervsiter_sortedsplit, the cursor for resumable traversal, whyOrdis defined against sorted iteration, and the concrete workloads driving the abstraction (SARIF small-object pressure, Kubernetes admission, Azure Policy aliases and case-insensitive compare, external/lazy data sources, eval-time arenas, host-language FFI). Precedents:serde_json::Map,toml::Table,simdjsonDOM.Layout: the new type lives at
src/value/object/{mod,iter,serde}.rs;src/value.rsbecomessrc/value/mod.rsto make room. Re-exported asregorus::Object.Nothing in the engine consumes
Objectyet — this PR is additive. Unit tests (34 covering iteration, cursor mutation-safety, ordering invariants, serde determinism with non-string keys, iterator-trait surface, etc.) stand on their own.Follow-ups (separate PRs):