Skip to content

docs: jsonb domains + per-domain terms/extractors in the manifest (closes #365, #366) - #368

Merged
coderdan merged 4 commits into
eql_v3from
docs/eql-manifest-jsonb-terms
Jul 6, 2026
Merged

docs: jsonb domains + per-domain terms/extractors in the manifest (closes #365, #366)#368
coderdan merged 4 commits into
eql_v3from
docs/eql-manifest-jsonb-terms

Conversation

@coderdan

@coderdan coderdan commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Stacked on #364. Closes #365 and #366 — both achieved through the catalog dump, no SQL autogen.

#365 — jsonb domains in the manifest

Turns out there's nothing to "move": json / jsonb_entry / jsonb_query are already in eql_domains::CATALOG as Shape::SteVec entries. Their SQL is deliberately hand-written (src/v3/jsonb/) with performance-tuned CHECKs (validator functions, inline expressions — #354), and the catalog comment is explicit that "the SQL generator SKIPS these; the catalog drives only their inventory." So full SQL autogen isn't the design (and would fight the hand-tuning) — the gap was simply that scalar_families() filters them out of dump-catalog.

Fix: dump_catalog() now emits them as a new additive stevec field on CatalogDump. Existing scalar-only consumers (the fixture-coverage task in mise.toml, the dump tests) read only types[], so they're untouched. The manifest now carries all 51 domains (48 scalar + 3 jsonb).

#366 — per-domain terms + extractors

Each DomainEntry gains a terms field (key + extractor + ctor, straight from eql_domains::Term), so the manifest links a domain to its extractor functions:

{ "segment": "ord", "supported_ops": ["=","<>","<","<=",">",">="],
  "terms": [{ "key": "ob", "extractor": "ord_term", "ctor": "ore_block_256" }] }

The docs manifest maps this to termFunctions (e.g. integer_ordeql_v3.ord_term) — authoritative, and it resolves the docs drift-lint false-flags on eq_term / ord_term / match_term (real generated extractors that doxygen didn't capture cleanly).

Safety

  • Both fields are additive; nothing existing changes shape.
  • cargo test -p eql-codegen -p eql-domains89 + 91 pass, incl. new tests (stevec_jsonb_family_is_dumped, ordered_domain_exposes_its_extractor_and_ctor).
  • End-to-end verified: doxygen → XML + dump-catalog984 functions + 51 domains.

Docs-side consumer updated in cipherstash/docs#46.

https://claude.ai/code/session_01CqDNqLSEEkCi7xAJFq7HJA

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 38f81f59-2e45-4f8c-8f99-29c32d680646

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/eql-manifest-jsonb-terms

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderdan
coderdan requested a review from tobyhede July 6, 2026 04:14
@coderdan
coderdan force-pushed the docs/eql-manifest-generator branch from ec03a7b to d09852a Compare July 6, 2026 04:18
…ifest

Resolves #365 and #366 — both via the catalog dump, no SQL autogen.

eql_domains::CATALOG (Shape::SteVec), but their SQL is deliberately hand-written
(hand-tuned CHECKs, #354) and `scalar_families()` filters them out of the dump.
Add them as a new **additive** `stevec` field on `CatalogDump` — scalar-only
consumers (the fixture-coverage task) read only `types[]`, so they're
unaffected. The manifest now carries all 51 domains (48 scalar + 3 jsonb).

from eql_domains::Term) to each `DomainEntry`, linking a domain to its extractor
functions (e.g. integer_ord -> eql_v3.ord_term). Authoritative — resolves the
docs drift-lint false-flags on eq_term / ord_term / match_term.

Both fields are additive; all eql-codegen + eql-domains tests pass (89 + 91).
The manifest generator maps them through (termFunctions on scalars; the jsonb
family as `json`-capability domains). Full pipeline verified end-to-end
(doxygen -> XML + dump-catalog -> 984 functions + 51 domains).

Stacked on #364.

Claude-Session: https://claude.ai/code/session_01CqDNqLSEEkCi7xAJFq7HJA
@coderdan
coderdan force-pushed the docs/eql-manifest-jsonb-terms branch from 145a5ba to 85ed74d Compare July 6, 2026 04:21
Base automatically changed from docs/eql-manifest-generator to eql_v3 July 6, 2026 04:48

@tobyhede tobyhede left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two low-severity issues from review — both confirmed against the code, neither a correctness bug.

Comment thread crates/eql-codegen/src/dump.rs Outdated
Comment thread crates/eql-codegen/src/dump.rs Outdated
Comment thread crates/eql-codegen/src/dump.rs
Comment thread tasks/docs/generate/xml-to-json.py
coderdan added 2 commits July 6, 2026 15:16
Per @tobyhede's review on #368:
- dump.rs doc comments referenced `eql_v3.json` / "eql_v3-relative" — the jsonb
  domains resolve under `public` (only the extractor *functions* are eql_v3).
  Corrected the CatalogDump.stevec and SteVecEntry.full_name docs.
- The catalog models no per-SteVec-entry terms (JSONB_DOMAINS carry `terms: &[]`,
  enforced by `shape_and_terms_are_consistent`), so `term_infos(d.terms)` was
  provably empty and the searchable SteVec family rendered inert (no
  termFunctions). Hardcode the real hand-written ste_vec extractors for now:
  `hm` -> eq_term, `oc` -> ore_cllw (src/v3/jsonb/operators.sql). The manifest now
  links public.json / jsonb_entry / jsonb_query to eql_v3.eq_term / eql_v3.ore_cllw.

Operators for the SteVec family remain a follow-up (DB introspection of
pg_operator is the reliable source).

Claude-Session: https://claude.ai/code/session_01CqDNqLSEEkCi7xAJFq7HJA
The inline TermInfo { .. } literals added in the review-response commit
tripped cargo fmt --check (Rust workspace crates CI). Expand them to the
one-field-per-line form rustfmt wants.

Claude-Session: https://claude.ai/code/session_01CqDNqLSEEkCi7xAJFq7HJA
Comment thread tasks/docs/generate/test_xml_to_json.py Outdated
The hardcoded hm/oc terms were stamped onto all three SteVec domains, but
per src/v3/jsonb/{functions,operators}.sql the eq_term/ore_cllw extractors
take public.jsonb_entry (the sv *element* type) exclusively:
  - eq_term(jsonb_entry)  -> = / <>   (coalesce(hm, oc))
  - ore_cllw(jsonb_entry) -> < <= > >= (oc)
The public.json container and public.jsonb_query domains carry no term
extractors — their surface is containment (@>, <@) and path navigation.

stevec_terms() now keys on the catalog domain name and returns terms only
for `entry`; json/query resolve to []. Tests assert the per-domain split.

Claude-Session: https://claude.ai/code/session_01CqDNqLSEEkCi7xAJFq7HJA
@coderdan
coderdan merged commit 6305a68 into eql_v3 Jul 6, 2026
18 checks passed
@coderdan
coderdan deleted the docs/eql-manifest-jsonb-terms branch July 6, 2026 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants