From cc4b63ebb2e0ed30b1fc075d5eb50f598c807c32 Mon Sep 17 00:00:00 2001 From: Toby Hede Date: Mon, 29 Jun 2026 16:52:45 +1000 Subject: [PATCH 01/12] feat(eql-bindings): upgrade schemars 0.8 -> 1.x (JSON Schema 2020-12) Migrate the two manual JsonSchema impls (SchemaVersion const:2, BloomFilter i16 bounds) to the 1.x json_schema! macro API, the DomainType::schema return type RootSchema -> schemars::Schema, and the schema-inspecting catalog_parity assertions to the 2020-12 shape ($defs, $ref carries description as a sibling). Regenerate schema/v3/*.json as 2020-12. Wire contract (required, strictness, const:2, i16 bounds) unchanged; ts-rs .ts bindings unchanged. --- Cargo.lock | 9 +-- crates/eql-bindings/Cargo.toml | 2 +- crates/eql-bindings/schema/v3/bool.json | 36 ++++------ crates/eql-bindings/schema/v3/date.json | 36 ++++------ crates/eql-bindings/schema/v3/date_eq.json | 46 +++++-------- crates/eql-bindings/schema/v3/date_ord.json | 46 +++++-------- .../eql-bindings/schema/v3/date_ord_ore.json | 46 +++++-------- crates/eql-bindings/schema/v3/float4.json | 36 ++++------ crates/eql-bindings/schema/v3/float4_eq.json | 46 +++++-------- crates/eql-bindings/schema/v3/float4_ord.json | 46 +++++-------- .../schema/v3/float4_ord_ore.json | 46 +++++-------- crates/eql-bindings/schema/v3/float8.json | 36 ++++------ crates/eql-bindings/schema/v3/float8_eq.json | 46 +++++-------- crates/eql-bindings/schema/v3/float8_ord.json | 46 +++++-------- .../schema/v3/float8_ord_ore.json | 46 +++++-------- crates/eql-bindings/schema/v3/int2.json | 36 ++++------ crates/eql-bindings/schema/v3/int2_eq.json | 46 +++++-------- crates/eql-bindings/schema/v3/int2_ord.json | 46 +++++-------- .../eql-bindings/schema/v3/int2_ord_ore.json | 46 +++++-------- crates/eql-bindings/schema/v3/int4.json | 36 ++++------ crates/eql-bindings/schema/v3/int4_eq.json | 46 +++++-------- crates/eql-bindings/schema/v3/int4_ord.json | 46 +++++-------- .../eql-bindings/schema/v3/int4_ord_ore.json | 50 +++++--------- crates/eql-bindings/schema/v3/int8.json | 36 ++++------ crates/eql-bindings/schema/v3/int8_eq.json | 46 +++++-------- crates/eql-bindings/schema/v3/int8_ord.json | 46 +++++-------- .../eql-bindings/schema/v3/int8_ord_ore.json | 46 +++++-------- crates/eql-bindings/schema/v3/numeric.json | 36 ++++------ crates/eql-bindings/schema/v3/numeric_eq.json | 46 +++++-------- .../eql-bindings/schema/v3/numeric_ord.json | 46 +++++-------- .../schema/v3/numeric_ord_ore.json | 46 +++++-------- crates/eql-bindings/schema/v3/text.json | 36 ++++------ crates/eql-bindings/schema/v3/text_eq.json | 46 +++++-------- crates/eql-bindings/schema/v3/text_match.json | 48 +++++--------- crates/eql-bindings/schema/v3/text_ord.json | 56 +++++----------- .../eql-bindings/schema/v3/text_ord_ore.json | 56 +++++----------- .../eql-bindings/schema/v3/text_search.json | 66 ++++++------------- .../eql-bindings/schema/v3/timestamptz.json | 36 ++++------ .../schema/v3/timestamptz_eq.json | 46 +++++-------- .../schema/v3/timestamptz_ord.json | 46 +++++-------- .../schema/v3/timestamptz_ord_ore.json | 46 +++++-------- crates/eql-bindings/src/lib.rs | 31 ++++----- crates/eql-bindings/src/v3/bool.rs | 4 +- crates/eql-bindings/src/v3/date.rs | 10 +-- crates/eql-bindings/src/v3/float4.rs | 10 +-- crates/eql-bindings/src/v3/float8.rs | 10 +-- crates/eql-bindings/src/v3/int2.rs | 10 +-- crates/eql-bindings/src/v3/int4.rs | 10 +-- crates/eql-bindings/src/v3/int8.rs | 10 +-- crates/eql-bindings/src/v3/mod.rs | 6 +- crates/eql-bindings/src/v3/numeric.rs | 10 +-- crates/eql-bindings/src/v3/terms.rs | 59 ++++++----------- crates/eql-bindings/src/v3/text.rs | 14 ++-- crates/eql-bindings/src/v3/timestamptz.rs | 10 +-- crates/eql-bindings/tests/catalog_parity.rs | 23 +++---- 55 files changed, 672 insertions(+), 1296 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6e8969f29..f8e31d80c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3419,11 +3419,12 @@ dependencies = [ [[package]] name = "schemars" -version = "0.8.22" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615" +checksum = "a2b42f36aa1cd011945615b92222f6bf73c599a102a300334cd7f8dbeec726cc" dependencies = [ "dyn-clone", + "ref-cast", "schemars_derive", "serde", "serde_json", @@ -3431,9 +3432,9 @@ dependencies = [ [[package]] name = "schemars_derive" -version = "0.8.22" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32e265784ad618884abaea0600a9adf15393368d840e0222d101a072f3f7534d" +checksum = "7d115b50f4aaeea07e79c1912f645c7513d81715d0420f8bc77a18c6260b307f" dependencies = [ "proc-macro2", "quote", diff --git a/crates/eql-bindings/Cargo.toml b/crates/eql-bindings/Cargo.toml index ebec21b63..e7e84325a 100644 --- a/crates/eql-bindings/Cargo.toml +++ b/crates/eql-bindings/Cargo.toml @@ -10,7 +10,7 @@ serde = { version = "1", features = ["derive"] } # impl pins `const: 2` via serde_json::json!. serde_json = "1" ts-rs = "10" -schemars = "0.8" +schemars = "1" [dev-dependencies] # Parity oracle: tests/catalog_parity.rs asserts the v3 domain inventory diff --git a/crates/eql-bindings/schema/v3/bool.json b/crates/eql-bindings/schema/v3/bool.json index bcbad6546..f60fbe16a 100644 --- a/crates/eql-bindings/schema/v3/bool.json +++ b/crates/eql-bindings/schema/v3/bool.json @@ -1,8 +1,5 @@ { - "$id": "https://schemas.cipherstash.com/eql/v3/bool.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { + "$defs": { "Ciphertext": { "description": "mp_base85 source ciphertext — the `c` envelope key.\n\nRequired by every v3 domain CHECK; present on every payload.", "type": "string" @@ -21,8 +18,8 @@ } }, "required": [ - "c", - "t" + "t", + "c" ], "type": "object" }, @@ -32,37 +29,28 @@ "type": "integer" } }, + "$id": "https://schemas.cipherstash.com/eql/v3/bool.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, "description": "`eql_v3.bool` — storage only / encryption-only; every operator is blocked.", "properties": { "c": { - "allOf": [ - { - "$ref": "#/definitions/Ciphertext" - } - ], + "$ref": "#/$defs/Ciphertext", "description": "mp_base85 source ciphertext. Required by the domain CHECK." }, "i": { - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ], + "$ref": "#/$defs/Identifier", "description": "Table/column identifier. Required by the domain CHECK." }, "v": { - "allOf": [ - { - "$ref": "#/definitions/SchemaVersion" - } - ], - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other value fails deserialization." + "$ref": "#/$defs/SchemaVersion", + "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." } }, "required": [ - "c", + "v", "i", - "v" + "c" ], "title": "Bool", "type": "object" diff --git a/crates/eql-bindings/schema/v3/date.json b/crates/eql-bindings/schema/v3/date.json index 706e4b566..2b98d521b 100644 --- a/crates/eql-bindings/schema/v3/date.json +++ b/crates/eql-bindings/schema/v3/date.json @@ -1,8 +1,5 @@ { - "$id": "https://schemas.cipherstash.com/eql/v3/date.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { + "$defs": { "Ciphertext": { "description": "mp_base85 source ciphertext — the `c` envelope key.\n\nRequired by every v3 domain CHECK; present on every payload.", "type": "string" @@ -21,8 +18,8 @@ } }, "required": [ - "c", - "t" + "t", + "c" ], "type": "object" }, @@ -32,37 +29,28 @@ "type": "integer" } }, + "$id": "https://schemas.cipherstash.com/eql/v3/date.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, "description": "`eql_v3.date` — storage only; every operator is blocked.", "properties": { "c": { - "allOf": [ - { - "$ref": "#/definitions/Ciphertext" - } - ], + "$ref": "#/$defs/Ciphertext", "description": "mp_base85 source ciphertext. Required by the domain CHECK." }, "i": { - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ], + "$ref": "#/$defs/Identifier", "description": "Table/column identifier. Required by the domain CHECK." }, "v": { - "allOf": [ - { - "$ref": "#/definitions/SchemaVersion" - } - ], - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other value fails deserialization." + "$ref": "#/$defs/SchemaVersion", + "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." } }, "required": [ - "c", + "v", "i", - "v" + "c" ], "title": "Date", "type": "object" diff --git a/crates/eql-bindings/schema/v3/date_eq.json b/crates/eql-bindings/schema/v3/date_eq.json index d7cf20d1b..6d87ca62f 100644 --- a/crates/eql-bindings/schema/v3/date_eq.json +++ b/crates/eql-bindings/schema/v3/date_eq.json @@ -1,14 +1,11 @@ { - "$id": "https://schemas.cipherstash.com/eql/v3/date_eq.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { + "$defs": { "Ciphertext": { "description": "mp_base85 source ciphertext — the `c` envelope key.\n\nRequired by every v3 domain CHECK; present on every payload.", "type": "string" }, "Hmac256": { - "description": "HMAC-SHA-256 equality term — the `hm` wire key. Backs the `_eq` domains (`=`, `<>`). SQL-side constructor: `eql_v3.hmac_256`.", + "description": "HMAC-SHA-256 equality term — the `hm` wire key. Backs the `_eq` domains\n(`=`, `<>`). SQL-side constructor: `eql_v3.hmac_256`.", "type": "string" }, "Identifier": { @@ -25,8 +22,8 @@ } }, "required": [ - "c", - "t" + "t", + "c" ], "type": "object" }, @@ -36,46 +33,33 @@ "type": "integer" } }, + "$id": "https://schemas.cipherstash.com/eql/v3/date_eq.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, "description": "`eql_v3.date_eq` — HMAC equality (`=`, `<>`).", "properties": { "c": { - "allOf": [ - { - "$ref": "#/definitions/Ciphertext" - } - ], + "$ref": "#/$defs/Ciphertext", "description": "mp_base85 source ciphertext. Required by the domain CHECK." }, "hm": { - "allOf": [ - { - "$ref": "#/definitions/Hmac256" - } - ], + "$ref": "#/$defs/Hmac256", "description": "HMAC-SHA-256 equality term." }, "i": { - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ], + "$ref": "#/$defs/Identifier", "description": "Table/column identifier. Required by the domain CHECK." }, "v": { - "allOf": [ - { - "$ref": "#/definitions/SchemaVersion" - } - ], - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other value fails deserialization." + "$ref": "#/$defs/SchemaVersion", + "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." } }, "required": [ - "c", - "hm", + "v", "i", - "v" + "c", + "hm" ], "title": "DateEq", "type": "object" diff --git a/crates/eql-bindings/schema/v3/date_ord.json b/crates/eql-bindings/schema/v3/date_ord.json index 90bbfbfce..57d58b312 100644 --- a/crates/eql-bindings/schema/v3/date_ord.json +++ b/crates/eql-bindings/schema/v3/date_ord.json @@ -1,8 +1,5 @@ { - "$id": "https://schemas.cipherstash.com/eql/v3/date_ord.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { + "$defs": { "Ciphertext": { "description": "mp_base85 source ciphertext — the `c` envelope key.\n\nRequired by every v3 domain CHECK; present on every payload.", "type": "string" @@ -21,13 +18,13 @@ } }, "required": [ - "c", - "t" + "t", + "c" ], "type": "object" }, "OreBlock256": { - "description": "Block-ORE order term — the `ob` wire key. Backs the `_ord` / `_ord_ore` domains (`=` `<>` `<` `<=` `>` `>=`); ORE is lossless over the scalar's domain, so it serves equality too. The block count is width-agnostic on the wire (8 for the int scalars, 12 for timestamptz, 14 for numeric) — the array just carries more block strings. SQL-side constructor: `eql_v3.ore_block_256`.", + "description": "Block-ORE order term — the `ob` wire key. Backs the `_ord` / `_ord_ore`\ndomains (`=` `<>` `<` `<=` `>` `>=`); ORE is lossless over the scalar's\ndomain, so it serves equality too. The block count is width-agnostic on the\nwire (8 for the int scalars, 12 for timestamptz, 14 for numeric) — the\narray just carries more block strings. SQL-side constructor:\n`eql_v3.ore_block_256`.", "items": { "type": "string" }, @@ -39,46 +36,33 @@ "type": "integer" } }, + "$id": "https://schemas.cipherstash.com/eql/v3/date_ord.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, "description": "`eql_v3.date_ord` — full comparison (`=` `<>` `<` `<=` `>` `>=`).", "properties": { "c": { - "allOf": [ - { - "$ref": "#/definitions/Ciphertext" - } - ], + "$ref": "#/$defs/Ciphertext", "description": "mp_base85 source ciphertext. Required by the domain CHECK." }, "i": { - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ], + "$ref": "#/$defs/Identifier", "description": "Table/column identifier. Required by the domain CHECK." }, "ob": { - "allOf": [ - { - "$ref": "#/definitions/OreBlock256" - } - ], + "$ref": "#/$defs/OreBlock256", "description": "Block-ORE order term. Serves equality too." }, "v": { - "allOf": [ - { - "$ref": "#/definitions/SchemaVersion" - } - ], - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other value fails deserialization." + "$ref": "#/$defs/SchemaVersion", + "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." } }, "required": [ - "c", + "v", "i", - "ob", - "v" + "c", + "ob" ], "title": "DateOrd", "type": "object" diff --git a/crates/eql-bindings/schema/v3/date_ord_ore.json b/crates/eql-bindings/schema/v3/date_ord_ore.json index 9c4da4bd0..8b4b3a593 100644 --- a/crates/eql-bindings/schema/v3/date_ord_ore.json +++ b/crates/eql-bindings/schema/v3/date_ord_ore.json @@ -1,8 +1,5 @@ { - "$id": "https://schemas.cipherstash.com/eql/v3/date_ord_ore.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { + "$defs": { "Ciphertext": { "description": "mp_base85 source ciphertext — the `c` envelope key.\n\nRequired by every v3 domain CHECK; present on every payload.", "type": "string" @@ -21,13 +18,13 @@ } }, "required": [ - "c", - "t" + "t", + "c" ], "type": "object" }, "OreBlock256": { - "description": "Block-ORE order term — the `ob` wire key. Backs the `_ord` / `_ord_ore` domains (`=` `<>` `<` `<=` `>` `>=`); ORE is lossless over the scalar's domain, so it serves equality too. The block count is width-agnostic on the wire (8 for the int scalars, 12 for timestamptz, 14 for numeric) — the array just carries more block strings. SQL-side constructor: `eql_v3.ore_block_256`.", + "description": "Block-ORE order term — the `ob` wire key. Backs the `_ord` / `_ord_ore`\ndomains (`=` `<>` `<` `<=` `>` `>=`); ORE is lossless over the scalar's\ndomain, so it serves equality too. The block count is width-agnostic on the\nwire (8 for the int scalars, 12 for timestamptz, 14 for numeric) — the\narray just carries more block strings. SQL-side constructor:\n`eql_v3.ore_block_256`.", "items": { "type": "string" }, @@ -39,46 +36,33 @@ "type": "integer" } }, + "$id": "https://schemas.cipherstash.com/eql/v3/date_ord_ore.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, "description": "`eql_v3.date_ord_ore` — full comparison, scheme-explicit name.", "properties": { "c": { - "allOf": [ - { - "$ref": "#/definitions/Ciphertext" - } - ], + "$ref": "#/$defs/Ciphertext", "description": "mp_base85 source ciphertext. Required by the domain CHECK." }, "i": { - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ], + "$ref": "#/$defs/Identifier", "description": "Table/column identifier. Required by the domain CHECK." }, "ob": { - "allOf": [ - { - "$ref": "#/definitions/OreBlock256" - } - ], + "$ref": "#/$defs/OreBlock256", "description": "Block-ORE order term. Serves equality too." }, "v": { - "allOf": [ - { - "$ref": "#/definitions/SchemaVersion" - } - ], - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other value fails deserialization." + "$ref": "#/$defs/SchemaVersion", + "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." } }, "required": [ - "c", + "v", "i", - "ob", - "v" + "c", + "ob" ], "title": "DateOrdOre", "type": "object" diff --git a/crates/eql-bindings/schema/v3/float4.json b/crates/eql-bindings/schema/v3/float4.json index 747728d8a..32943f12a 100644 --- a/crates/eql-bindings/schema/v3/float4.json +++ b/crates/eql-bindings/schema/v3/float4.json @@ -1,8 +1,5 @@ { - "$id": "https://schemas.cipherstash.com/eql/v3/float4.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { + "$defs": { "Ciphertext": { "description": "mp_base85 source ciphertext — the `c` envelope key.\n\nRequired by every v3 domain CHECK; present on every payload.", "type": "string" @@ -21,8 +18,8 @@ } }, "required": [ - "c", - "t" + "t", + "c" ], "type": "object" }, @@ -32,37 +29,28 @@ "type": "integer" } }, + "$id": "https://schemas.cipherstash.com/eql/v3/float4.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, "description": "`eql_v3.float4` — storage only; every operator is blocked.", "properties": { "c": { - "allOf": [ - { - "$ref": "#/definitions/Ciphertext" - } - ], + "$ref": "#/$defs/Ciphertext", "description": "mp_base85 source ciphertext. Required by the domain CHECK." }, "i": { - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ], + "$ref": "#/$defs/Identifier", "description": "Table/column identifier. Required by the domain CHECK." }, "v": { - "allOf": [ - { - "$ref": "#/definitions/SchemaVersion" - } - ], - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other value fails deserialization." + "$ref": "#/$defs/SchemaVersion", + "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." } }, "required": [ - "c", + "v", "i", - "v" + "c" ], "title": "Float4", "type": "object" diff --git a/crates/eql-bindings/schema/v3/float4_eq.json b/crates/eql-bindings/schema/v3/float4_eq.json index e81332781..3dc29efcd 100644 --- a/crates/eql-bindings/schema/v3/float4_eq.json +++ b/crates/eql-bindings/schema/v3/float4_eq.json @@ -1,14 +1,11 @@ { - "$id": "https://schemas.cipherstash.com/eql/v3/float4_eq.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { + "$defs": { "Ciphertext": { "description": "mp_base85 source ciphertext — the `c` envelope key.\n\nRequired by every v3 domain CHECK; present on every payload.", "type": "string" }, "Hmac256": { - "description": "HMAC-SHA-256 equality term — the `hm` wire key. Backs the `_eq` domains (`=`, `<>`). SQL-side constructor: `eql_v3.hmac_256`.", + "description": "HMAC-SHA-256 equality term — the `hm` wire key. Backs the `_eq` domains\n(`=`, `<>`). SQL-side constructor: `eql_v3.hmac_256`.", "type": "string" }, "Identifier": { @@ -25,8 +22,8 @@ } }, "required": [ - "c", - "t" + "t", + "c" ], "type": "object" }, @@ -36,46 +33,33 @@ "type": "integer" } }, + "$id": "https://schemas.cipherstash.com/eql/v3/float4_eq.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, "description": "`eql_v3.float4_eq` — HMAC equality (`=`, `<>`).", "properties": { "c": { - "allOf": [ - { - "$ref": "#/definitions/Ciphertext" - } - ], + "$ref": "#/$defs/Ciphertext", "description": "mp_base85 source ciphertext. Required by the domain CHECK." }, "hm": { - "allOf": [ - { - "$ref": "#/definitions/Hmac256" - } - ], + "$ref": "#/$defs/Hmac256", "description": "HMAC-SHA-256 equality term." }, "i": { - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ], + "$ref": "#/$defs/Identifier", "description": "Table/column identifier. Required by the domain CHECK." }, "v": { - "allOf": [ - { - "$ref": "#/definitions/SchemaVersion" - } - ], - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other value fails deserialization." + "$ref": "#/$defs/SchemaVersion", + "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." } }, "required": [ - "c", - "hm", + "v", "i", - "v" + "c", + "hm" ], "title": "Float4Eq", "type": "object" diff --git a/crates/eql-bindings/schema/v3/float4_ord.json b/crates/eql-bindings/schema/v3/float4_ord.json index 76d06d29e..0fd6f1d34 100644 --- a/crates/eql-bindings/schema/v3/float4_ord.json +++ b/crates/eql-bindings/schema/v3/float4_ord.json @@ -1,8 +1,5 @@ { - "$id": "https://schemas.cipherstash.com/eql/v3/float4_ord.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { + "$defs": { "Ciphertext": { "description": "mp_base85 source ciphertext — the `c` envelope key.\n\nRequired by every v3 domain CHECK; present on every payload.", "type": "string" @@ -21,13 +18,13 @@ } }, "required": [ - "c", - "t" + "t", + "c" ], "type": "object" }, "OreBlock256": { - "description": "Block-ORE order term — the `ob` wire key. Backs the `_ord` / `_ord_ore` domains (`=` `<>` `<` `<=` `>` `>=`); ORE is lossless over the scalar's domain, so it serves equality too. The block count is width-agnostic on the wire (8 for the int scalars, 12 for timestamptz, 14 for numeric) — the array just carries more block strings. SQL-side constructor: `eql_v3.ore_block_256`.", + "description": "Block-ORE order term — the `ob` wire key. Backs the `_ord` / `_ord_ore`\ndomains (`=` `<>` `<` `<=` `>` `>=`); ORE is lossless over the scalar's\ndomain, so it serves equality too. The block count is width-agnostic on the\nwire (8 for the int scalars, 12 for timestamptz, 14 for numeric) — the\narray just carries more block strings. SQL-side constructor:\n`eql_v3.ore_block_256`.", "items": { "type": "string" }, @@ -39,46 +36,33 @@ "type": "integer" } }, + "$id": "https://schemas.cipherstash.com/eql/v3/float4_ord.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, "description": "`eql_v3.float4_ord` — full comparison (`=` `<>` `<` `<=` `>` `>=`).", "properties": { "c": { - "allOf": [ - { - "$ref": "#/definitions/Ciphertext" - } - ], + "$ref": "#/$defs/Ciphertext", "description": "mp_base85 source ciphertext. Required by the domain CHECK." }, "i": { - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ], + "$ref": "#/$defs/Identifier", "description": "Table/column identifier. Required by the domain CHECK." }, "ob": { - "allOf": [ - { - "$ref": "#/definitions/OreBlock256" - } - ], + "$ref": "#/$defs/OreBlock256", "description": "Block-ORE order term (8 blocks for float). Serves equality too." }, "v": { - "allOf": [ - { - "$ref": "#/definitions/SchemaVersion" - } - ], - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other value fails deserialization." + "$ref": "#/$defs/SchemaVersion", + "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." } }, "required": [ - "c", + "v", "i", - "ob", - "v" + "c", + "ob" ], "title": "Float4Ord", "type": "object" diff --git a/crates/eql-bindings/schema/v3/float4_ord_ore.json b/crates/eql-bindings/schema/v3/float4_ord_ore.json index 1ecbcb1e3..ef776d7e8 100644 --- a/crates/eql-bindings/schema/v3/float4_ord_ore.json +++ b/crates/eql-bindings/schema/v3/float4_ord_ore.json @@ -1,8 +1,5 @@ { - "$id": "https://schemas.cipherstash.com/eql/v3/float4_ord_ore.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { + "$defs": { "Ciphertext": { "description": "mp_base85 source ciphertext — the `c` envelope key.\n\nRequired by every v3 domain CHECK; present on every payload.", "type": "string" @@ -21,13 +18,13 @@ } }, "required": [ - "c", - "t" + "t", + "c" ], "type": "object" }, "OreBlock256": { - "description": "Block-ORE order term — the `ob` wire key. Backs the `_ord` / `_ord_ore` domains (`=` `<>` `<` `<=` `>` `>=`); ORE is lossless over the scalar's domain, so it serves equality too. The block count is width-agnostic on the wire (8 for the int scalars, 12 for timestamptz, 14 for numeric) — the array just carries more block strings. SQL-side constructor: `eql_v3.ore_block_256`.", + "description": "Block-ORE order term — the `ob` wire key. Backs the `_ord` / `_ord_ore`\ndomains (`=` `<>` `<` `<=` `>` `>=`); ORE is lossless over the scalar's\ndomain, so it serves equality too. The block count is width-agnostic on the\nwire (8 for the int scalars, 12 for timestamptz, 14 for numeric) — the\narray just carries more block strings. SQL-side constructor:\n`eql_v3.ore_block_256`.", "items": { "type": "string" }, @@ -39,46 +36,33 @@ "type": "integer" } }, + "$id": "https://schemas.cipherstash.com/eql/v3/float4_ord_ore.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, "description": "`eql_v3.float4_ord_ore` — full comparison, scheme-explicit name.", "properties": { "c": { - "allOf": [ - { - "$ref": "#/definitions/Ciphertext" - } - ], + "$ref": "#/$defs/Ciphertext", "description": "mp_base85 source ciphertext. Required by the domain CHECK." }, "i": { - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ], + "$ref": "#/$defs/Identifier", "description": "Table/column identifier. Required by the domain CHECK." }, "ob": { - "allOf": [ - { - "$ref": "#/definitions/OreBlock256" - } - ], + "$ref": "#/$defs/OreBlock256", "description": "Block-ORE order term (8 blocks for float). Serves equality too." }, "v": { - "allOf": [ - { - "$ref": "#/definitions/SchemaVersion" - } - ], - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other value fails deserialization." + "$ref": "#/$defs/SchemaVersion", + "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." } }, "required": [ - "c", + "v", "i", - "ob", - "v" + "c", + "ob" ], "title": "Float4OrdOre", "type": "object" diff --git a/crates/eql-bindings/schema/v3/float8.json b/crates/eql-bindings/schema/v3/float8.json index 671d7996e..4a5275039 100644 --- a/crates/eql-bindings/schema/v3/float8.json +++ b/crates/eql-bindings/schema/v3/float8.json @@ -1,8 +1,5 @@ { - "$id": "https://schemas.cipherstash.com/eql/v3/float8.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { + "$defs": { "Ciphertext": { "description": "mp_base85 source ciphertext — the `c` envelope key.\n\nRequired by every v3 domain CHECK; present on every payload.", "type": "string" @@ -21,8 +18,8 @@ } }, "required": [ - "c", - "t" + "t", + "c" ], "type": "object" }, @@ -32,37 +29,28 @@ "type": "integer" } }, + "$id": "https://schemas.cipherstash.com/eql/v3/float8.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, "description": "`eql_v3.float8` — storage only; every operator is blocked.", "properties": { "c": { - "allOf": [ - { - "$ref": "#/definitions/Ciphertext" - } - ], + "$ref": "#/$defs/Ciphertext", "description": "mp_base85 source ciphertext. Required by the domain CHECK." }, "i": { - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ], + "$ref": "#/$defs/Identifier", "description": "Table/column identifier. Required by the domain CHECK." }, "v": { - "allOf": [ - { - "$ref": "#/definitions/SchemaVersion" - } - ], - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other value fails deserialization." + "$ref": "#/$defs/SchemaVersion", + "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." } }, "required": [ - "c", + "v", "i", - "v" + "c" ], "title": "Float8", "type": "object" diff --git a/crates/eql-bindings/schema/v3/float8_eq.json b/crates/eql-bindings/schema/v3/float8_eq.json index a83bfa1ca..203c218ab 100644 --- a/crates/eql-bindings/schema/v3/float8_eq.json +++ b/crates/eql-bindings/schema/v3/float8_eq.json @@ -1,14 +1,11 @@ { - "$id": "https://schemas.cipherstash.com/eql/v3/float8_eq.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { + "$defs": { "Ciphertext": { "description": "mp_base85 source ciphertext — the `c` envelope key.\n\nRequired by every v3 domain CHECK; present on every payload.", "type": "string" }, "Hmac256": { - "description": "HMAC-SHA-256 equality term — the `hm` wire key. Backs the `_eq` domains (`=`, `<>`). SQL-side constructor: `eql_v3.hmac_256`.", + "description": "HMAC-SHA-256 equality term — the `hm` wire key. Backs the `_eq` domains\n(`=`, `<>`). SQL-side constructor: `eql_v3.hmac_256`.", "type": "string" }, "Identifier": { @@ -25,8 +22,8 @@ } }, "required": [ - "c", - "t" + "t", + "c" ], "type": "object" }, @@ -36,46 +33,33 @@ "type": "integer" } }, + "$id": "https://schemas.cipherstash.com/eql/v3/float8_eq.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, "description": "`eql_v3.float8_eq` — HMAC equality (`=`, `<>`).", "properties": { "c": { - "allOf": [ - { - "$ref": "#/definitions/Ciphertext" - } - ], + "$ref": "#/$defs/Ciphertext", "description": "mp_base85 source ciphertext. Required by the domain CHECK." }, "hm": { - "allOf": [ - { - "$ref": "#/definitions/Hmac256" - } - ], + "$ref": "#/$defs/Hmac256", "description": "HMAC-SHA-256 equality term." }, "i": { - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ], + "$ref": "#/$defs/Identifier", "description": "Table/column identifier. Required by the domain CHECK." }, "v": { - "allOf": [ - { - "$ref": "#/definitions/SchemaVersion" - } - ], - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other value fails deserialization." + "$ref": "#/$defs/SchemaVersion", + "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." } }, "required": [ - "c", - "hm", + "v", "i", - "v" + "c", + "hm" ], "title": "Float8Eq", "type": "object" diff --git a/crates/eql-bindings/schema/v3/float8_ord.json b/crates/eql-bindings/schema/v3/float8_ord.json index 2753c67cb..416c036cb 100644 --- a/crates/eql-bindings/schema/v3/float8_ord.json +++ b/crates/eql-bindings/schema/v3/float8_ord.json @@ -1,8 +1,5 @@ { - "$id": "https://schemas.cipherstash.com/eql/v3/float8_ord.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { + "$defs": { "Ciphertext": { "description": "mp_base85 source ciphertext — the `c` envelope key.\n\nRequired by every v3 domain CHECK; present on every payload.", "type": "string" @@ -21,13 +18,13 @@ } }, "required": [ - "c", - "t" + "t", + "c" ], "type": "object" }, "OreBlock256": { - "description": "Block-ORE order term — the `ob` wire key. Backs the `_ord` / `_ord_ore` domains (`=` `<>` `<` `<=` `>` `>=`); ORE is lossless over the scalar's domain, so it serves equality too. The block count is width-agnostic on the wire (8 for the int scalars, 12 for timestamptz, 14 for numeric) — the array just carries more block strings. SQL-side constructor: `eql_v3.ore_block_256`.", + "description": "Block-ORE order term — the `ob` wire key. Backs the `_ord` / `_ord_ore`\ndomains (`=` `<>` `<` `<=` `>` `>=`); ORE is lossless over the scalar's\ndomain, so it serves equality too. The block count is width-agnostic on the\nwire (8 for the int scalars, 12 for timestamptz, 14 for numeric) — the\narray just carries more block strings. SQL-side constructor:\n`eql_v3.ore_block_256`.", "items": { "type": "string" }, @@ -39,46 +36,33 @@ "type": "integer" } }, + "$id": "https://schemas.cipherstash.com/eql/v3/float8_ord.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, "description": "`eql_v3.float8_ord` — full comparison (`=` `<>` `<` `<=` `>` `>=`).", "properties": { "c": { - "allOf": [ - { - "$ref": "#/definitions/Ciphertext" - } - ], + "$ref": "#/$defs/Ciphertext", "description": "mp_base85 source ciphertext. Required by the domain CHECK." }, "i": { - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ], + "$ref": "#/$defs/Identifier", "description": "Table/column identifier. Required by the domain CHECK." }, "ob": { - "allOf": [ - { - "$ref": "#/definitions/OreBlock256" - } - ], + "$ref": "#/$defs/OreBlock256", "description": "Block-ORE order term (8 blocks for float). Serves equality too." }, "v": { - "allOf": [ - { - "$ref": "#/definitions/SchemaVersion" - } - ], - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other value fails deserialization." + "$ref": "#/$defs/SchemaVersion", + "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." } }, "required": [ - "c", + "v", "i", - "ob", - "v" + "c", + "ob" ], "title": "Float8Ord", "type": "object" diff --git a/crates/eql-bindings/schema/v3/float8_ord_ore.json b/crates/eql-bindings/schema/v3/float8_ord_ore.json index ea2153a74..f58bc39c2 100644 --- a/crates/eql-bindings/schema/v3/float8_ord_ore.json +++ b/crates/eql-bindings/schema/v3/float8_ord_ore.json @@ -1,8 +1,5 @@ { - "$id": "https://schemas.cipherstash.com/eql/v3/float8_ord_ore.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { + "$defs": { "Ciphertext": { "description": "mp_base85 source ciphertext — the `c` envelope key.\n\nRequired by every v3 domain CHECK; present on every payload.", "type": "string" @@ -21,13 +18,13 @@ } }, "required": [ - "c", - "t" + "t", + "c" ], "type": "object" }, "OreBlock256": { - "description": "Block-ORE order term — the `ob` wire key. Backs the `_ord` / `_ord_ore` domains (`=` `<>` `<` `<=` `>` `>=`); ORE is lossless over the scalar's domain, so it serves equality too. The block count is width-agnostic on the wire (8 for the int scalars, 12 for timestamptz, 14 for numeric) — the array just carries more block strings. SQL-side constructor: `eql_v3.ore_block_256`.", + "description": "Block-ORE order term — the `ob` wire key. Backs the `_ord` / `_ord_ore`\ndomains (`=` `<>` `<` `<=` `>` `>=`); ORE is lossless over the scalar's\ndomain, so it serves equality too. The block count is width-agnostic on the\nwire (8 for the int scalars, 12 for timestamptz, 14 for numeric) — the\narray just carries more block strings. SQL-side constructor:\n`eql_v3.ore_block_256`.", "items": { "type": "string" }, @@ -39,46 +36,33 @@ "type": "integer" } }, + "$id": "https://schemas.cipherstash.com/eql/v3/float8_ord_ore.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, "description": "`eql_v3.float8_ord_ore` — full comparison, scheme-explicit name.", "properties": { "c": { - "allOf": [ - { - "$ref": "#/definitions/Ciphertext" - } - ], + "$ref": "#/$defs/Ciphertext", "description": "mp_base85 source ciphertext. Required by the domain CHECK." }, "i": { - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ], + "$ref": "#/$defs/Identifier", "description": "Table/column identifier. Required by the domain CHECK." }, "ob": { - "allOf": [ - { - "$ref": "#/definitions/OreBlock256" - } - ], + "$ref": "#/$defs/OreBlock256", "description": "Block-ORE order term (8 blocks for float). Serves equality too." }, "v": { - "allOf": [ - { - "$ref": "#/definitions/SchemaVersion" - } - ], - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other value fails deserialization." + "$ref": "#/$defs/SchemaVersion", + "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." } }, "required": [ - "c", + "v", "i", - "ob", - "v" + "c", + "ob" ], "title": "Float8OrdOre", "type": "object" diff --git a/crates/eql-bindings/schema/v3/int2.json b/crates/eql-bindings/schema/v3/int2.json index 118cfbf2d..c27fc54fd 100644 --- a/crates/eql-bindings/schema/v3/int2.json +++ b/crates/eql-bindings/schema/v3/int2.json @@ -1,8 +1,5 @@ { - "$id": "https://schemas.cipherstash.com/eql/v3/int2.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { + "$defs": { "Ciphertext": { "description": "mp_base85 source ciphertext — the `c` envelope key.\n\nRequired by every v3 domain CHECK; present on every payload.", "type": "string" @@ -21,8 +18,8 @@ } }, "required": [ - "c", - "t" + "t", + "c" ], "type": "object" }, @@ -32,37 +29,28 @@ "type": "integer" } }, + "$id": "https://schemas.cipherstash.com/eql/v3/int2.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, "description": "`eql_v3.int2` — storage only; every operator is blocked.", "properties": { "c": { - "allOf": [ - { - "$ref": "#/definitions/Ciphertext" - } - ], + "$ref": "#/$defs/Ciphertext", "description": "mp_base85 source ciphertext. Required by the domain CHECK." }, "i": { - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ], + "$ref": "#/$defs/Identifier", "description": "Table/column identifier. Required by the domain CHECK." }, "v": { - "allOf": [ - { - "$ref": "#/definitions/SchemaVersion" - } - ], - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other value fails deserialization." + "$ref": "#/$defs/SchemaVersion", + "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." } }, "required": [ - "c", + "v", "i", - "v" + "c" ], "title": "Int2", "type": "object" diff --git a/crates/eql-bindings/schema/v3/int2_eq.json b/crates/eql-bindings/schema/v3/int2_eq.json index 2b3616d7f..96a26d0bc 100644 --- a/crates/eql-bindings/schema/v3/int2_eq.json +++ b/crates/eql-bindings/schema/v3/int2_eq.json @@ -1,14 +1,11 @@ { - "$id": "https://schemas.cipherstash.com/eql/v3/int2_eq.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { + "$defs": { "Ciphertext": { "description": "mp_base85 source ciphertext — the `c` envelope key.\n\nRequired by every v3 domain CHECK; present on every payload.", "type": "string" }, "Hmac256": { - "description": "HMAC-SHA-256 equality term — the `hm` wire key. Backs the `_eq` domains (`=`, `<>`). SQL-side constructor: `eql_v3.hmac_256`.", + "description": "HMAC-SHA-256 equality term — the `hm` wire key. Backs the `_eq` domains\n(`=`, `<>`). SQL-side constructor: `eql_v3.hmac_256`.", "type": "string" }, "Identifier": { @@ -25,8 +22,8 @@ } }, "required": [ - "c", - "t" + "t", + "c" ], "type": "object" }, @@ -36,46 +33,33 @@ "type": "integer" } }, + "$id": "https://schemas.cipherstash.com/eql/v3/int2_eq.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, "description": "`eql_v3.int2_eq` — HMAC equality (`=`, `<>`).", "properties": { "c": { - "allOf": [ - { - "$ref": "#/definitions/Ciphertext" - } - ], + "$ref": "#/$defs/Ciphertext", "description": "mp_base85 source ciphertext. Required by the domain CHECK." }, "hm": { - "allOf": [ - { - "$ref": "#/definitions/Hmac256" - } - ], + "$ref": "#/$defs/Hmac256", "description": "HMAC-SHA-256 equality term." }, "i": { - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ], + "$ref": "#/$defs/Identifier", "description": "Table/column identifier. Required by the domain CHECK." }, "v": { - "allOf": [ - { - "$ref": "#/definitions/SchemaVersion" - } - ], - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other value fails deserialization." + "$ref": "#/$defs/SchemaVersion", + "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." } }, "required": [ - "c", - "hm", + "v", "i", - "v" + "c", + "hm" ], "title": "Int2Eq", "type": "object" diff --git a/crates/eql-bindings/schema/v3/int2_ord.json b/crates/eql-bindings/schema/v3/int2_ord.json index bb851fc09..4678285b3 100644 --- a/crates/eql-bindings/schema/v3/int2_ord.json +++ b/crates/eql-bindings/schema/v3/int2_ord.json @@ -1,8 +1,5 @@ { - "$id": "https://schemas.cipherstash.com/eql/v3/int2_ord.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { + "$defs": { "Ciphertext": { "description": "mp_base85 source ciphertext — the `c` envelope key.\n\nRequired by every v3 domain CHECK; present on every payload.", "type": "string" @@ -21,13 +18,13 @@ } }, "required": [ - "c", - "t" + "t", + "c" ], "type": "object" }, "OreBlock256": { - "description": "Block-ORE order term — the `ob` wire key. Backs the `_ord` / `_ord_ore` domains (`=` `<>` `<` `<=` `>` `>=`); ORE is lossless over the scalar's domain, so it serves equality too. The block count is width-agnostic on the wire (8 for the int scalars, 12 for timestamptz, 14 for numeric) — the array just carries more block strings. SQL-side constructor: `eql_v3.ore_block_256`.", + "description": "Block-ORE order term — the `ob` wire key. Backs the `_ord` / `_ord_ore`\ndomains (`=` `<>` `<` `<=` `>` `>=`); ORE is lossless over the scalar's\ndomain, so it serves equality too. The block count is width-agnostic on the\nwire (8 for the int scalars, 12 for timestamptz, 14 for numeric) — the\narray just carries more block strings. SQL-side constructor:\n`eql_v3.ore_block_256`.", "items": { "type": "string" }, @@ -39,46 +36,33 @@ "type": "integer" } }, + "$id": "https://schemas.cipherstash.com/eql/v3/int2_ord.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, "description": "`eql_v3.int2_ord` — full comparison (`=` `<>` `<` `<=` `>` `>=`).", "properties": { "c": { - "allOf": [ - { - "$ref": "#/definitions/Ciphertext" - } - ], + "$ref": "#/$defs/Ciphertext", "description": "mp_base85 source ciphertext. Required by the domain CHECK." }, "i": { - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ], + "$ref": "#/$defs/Identifier", "description": "Table/column identifier. Required by the domain CHECK." }, "ob": { - "allOf": [ - { - "$ref": "#/definitions/OreBlock256" - } - ], + "$ref": "#/$defs/OreBlock256", "description": "Block-ORE order term. Serves equality too." }, "v": { - "allOf": [ - { - "$ref": "#/definitions/SchemaVersion" - } - ], - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other value fails deserialization." + "$ref": "#/$defs/SchemaVersion", + "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." } }, "required": [ - "c", + "v", "i", - "ob", - "v" + "c", + "ob" ], "title": "Int2Ord", "type": "object" diff --git a/crates/eql-bindings/schema/v3/int2_ord_ore.json b/crates/eql-bindings/schema/v3/int2_ord_ore.json index 14782a109..5d465c043 100644 --- a/crates/eql-bindings/schema/v3/int2_ord_ore.json +++ b/crates/eql-bindings/schema/v3/int2_ord_ore.json @@ -1,8 +1,5 @@ { - "$id": "https://schemas.cipherstash.com/eql/v3/int2_ord_ore.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { + "$defs": { "Ciphertext": { "description": "mp_base85 source ciphertext — the `c` envelope key.\n\nRequired by every v3 domain CHECK; present on every payload.", "type": "string" @@ -21,13 +18,13 @@ } }, "required": [ - "c", - "t" + "t", + "c" ], "type": "object" }, "OreBlock256": { - "description": "Block-ORE order term — the `ob` wire key. Backs the `_ord` / `_ord_ore` domains (`=` `<>` `<` `<=` `>` `>=`); ORE is lossless over the scalar's domain, so it serves equality too. The block count is width-agnostic on the wire (8 for the int scalars, 12 for timestamptz, 14 for numeric) — the array just carries more block strings. SQL-side constructor: `eql_v3.ore_block_256`.", + "description": "Block-ORE order term — the `ob` wire key. Backs the `_ord` / `_ord_ore`\ndomains (`=` `<>` `<` `<=` `>` `>=`); ORE is lossless over the scalar's\ndomain, so it serves equality too. The block count is width-agnostic on the\nwire (8 for the int scalars, 12 for timestamptz, 14 for numeric) — the\narray just carries more block strings. SQL-side constructor:\n`eql_v3.ore_block_256`.", "items": { "type": "string" }, @@ -39,46 +36,33 @@ "type": "integer" } }, + "$id": "https://schemas.cipherstash.com/eql/v3/int2_ord_ore.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, "description": "`eql_v3.int2_ord_ore` — full comparison, scheme-explicit name.", "properties": { "c": { - "allOf": [ - { - "$ref": "#/definitions/Ciphertext" - } - ], + "$ref": "#/$defs/Ciphertext", "description": "mp_base85 source ciphertext. Required by the domain CHECK." }, "i": { - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ], + "$ref": "#/$defs/Identifier", "description": "Table/column identifier. Required by the domain CHECK." }, "ob": { - "allOf": [ - { - "$ref": "#/definitions/OreBlock256" - } - ], + "$ref": "#/$defs/OreBlock256", "description": "Block-ORE order term. Serves equality too." }, "v": { - "allOf": [ - { - "$ref": "#/definitions/SchemaVersion" - } - ], - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other value fails deserialization." + "$ref": "#/$defs/SchemaVersion", + "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." } }, "required": [ - "c", + "v", "i", - "ob", - "v" + "c", + "ob" ], "title": "Int2OrdOre", "type": "object" diff --git a/crates/eql-bindings/schema/v3/int4.json b/crates/eql-bindings/schema/v3/int4.json index 4e8506272..6795e6620 100644 --- a/crates/eql-bindings/schema/v3/int4.json +++ b/crates/eql-bindings/schema/v3/int4.json @@ -1,8 +1,5 @@ { - "$id": "https://schemas.cipherstash.com/eql/v3/int4.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { + "$defs": { "Ciphertext": { "description": "mp_base85 source ciphertext — the `c` envelope key.\n\nRequired by every v3 domain CHECK; present on every payload.", "type": "string" @@ -21,8 +18,8 @@ } }, "required": [ - "c", - "t" + "t", + "c" ], "type": "object" }, @@ -32,37 +29,28 @@ "type": "integer" } }, + "$id": "https://schemas.cipherstash.com/eql/v3/int4.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, "description": "`eql_v3.int4` — storage only; every operator is blocked.", "properties": { "c": { - "allOf": [ - { - "$ref": "#/definitions/Ciphertext" - } - ], + "$ref": "#/$defs/Ciphertext", "description": "mp_base85 source ciphertext. Required by the domain CHECK." }, "i": { - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ], + "$ref": "#/$defs/Identifier", "description": "Table/column identifier. Required by the domain CHECK." }, "v": { - "allOf": [ - { - "$ref": "#/definitions/SchemaVersion" - } - ], - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other value fails deserialization." + "$ref": "#/$defs/SchemaVersion", + "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." } }, "required": [ - "c", + "v", "i", - "v" + "c" ], "title": "Int4", "type": "object" diff --git a/crates/eql-bindings/schema/v3/int4_eq.json b/crates/eql-bindings/schema/v3/int4_eq.json index cf88e7f7d..dbc45c0d2 100644 --- a/crates/eql-bindings/schema/v3/int4_eq.json +++ b/crates/eql-bindings/schema/v3/int4_eq.json @@ -1,14 +1,11 @@ { - "$id": "https://schemas.cipherstash.com/eql/v3/int4_eq.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { + "$defs": { "Ciphertext": { "description": "mp_base85 source ciphertext — the `c` envelope key.\n\nRequired by every v3 domain CHECK; present on every payload.", "type": "string" }, "Hmac256": { - "description": "HMAC-SHA-256 equality term — the `hm` wire key. Backs the `_eq` domains (`=`, `<>`). SQL-side constructor: `eql_v3.hmac_256`.", + "description": "HMAC-SHA-256 equality term — the `hm` wire key. Backs the `_eq` domains\n(`=`, `<>`). SQL-side constructor: `eql_v3.hmac_256`.", "type": "string" }, "Identifier": { @@ -25,8 +22,8 @@ } }, "required": [ - "c", - "t" + "t", + "c" ], "type": "object" }, @@ -36,46 +33,33 @@ "type": "integer" } }, + "$id": "https://schemas.cipherstash.com/eql/v3/int4_eq.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, "description": "`eql_v3.int4_eq` — HMAC equality (`=`, `<>`).", "properties": { "c": { - "allOf": [ - { - "$ref": "#/definitions/Ciphertext" - } - ], + "$ref": "#/$defs/Ciphertext", "description": "mp_base85 source ciphertext. Required by the domain CHECK." }, "hm": { - "allOf": [ - { - "$ref": "#/definitions/Hmac256" - } - ], + "$ref": "#/$defs/Hmac256", "description": "HMAC-SHA-256 equality term." }, "i": { - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ], + "$ref": "#/$defs/Identifier", "description": "Table/column identifier. Required by the domain CHECK." }, "v": { - "allOf": [ - { - "$ref": "#/definitions/SchemaVersion" - } - ], - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other value fails deserialization." + "$ref": "#/$defs/SchemaVersion", + "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." } }, "required": [ - "c", - "hm", + "v", "i", - "v" + "c", + "hm" ], "title": "Int4Eq", "type": "object" diff --git a/crates/eql-bindings/schema/v3/int4_ord.json b/crates/eql-bindings/schema/v3/int4_ord.json index 5eb0b7eca..9cc352ba6 100644 --- a/crates/eql-bindings/schema/v3/int4_ord.json +++ b/crates/eql-bindings/schema/v3/int4_ord.json @@ -1,8 +1,5 @@ { - "$id": "https://schemas.cipherstash.com/eql/v3/int4_ord.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { + "$defs": { "Ciphertext": { "description": "mp_base85 source ciphertext — the `c` envelope key.\n\nRequired by every v3 domain CHECK; present on every payload.", "type": "string" @@ -21,13 +18,13 @@ } }, "required": [ - "c", - "t" + "t", + "c" ], "type": "object" }, "OreBlock256": { - "description": "Block-ORE order term — the `ob` wire key. Backs the `_ord` / `_ord_ore` domains (`=` `<>` `<` `<=` `>` `>=`); ORE is lossless over the scalar's domain, so it serves equality too. The block count is width-agnostic on the wire (8 for the int scalars, 12 for timestamptz, 14 for numeric) — the array just carries more block strings. SQL-side constructor: `eql_v3.ore_block_256`.", + "description": "Block-ORE order term — the `ob` wire key. Backs the `_ord` / `_ord_ore`\ndomains (`=` `<>` `<` `<=` `>` `>=`); ORE is lossless over the scalar's\ndomain, so it serves equality too. The block count is width-agnostic on the\nwire (8 for the int scalars, 12 for timestamptz, 14 for numeric) — the\narray just carries more block strings. SQL-side constructor:\n`eql_v3.ore_block_256`.", "items": { "type": "string" }, @@ -39,46 +36,33 @@ "type": "integer" } }, + "$id": "https://schemas.cipherstash.com/eql/v3/int4_ord.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, "description": "`eql_v3.int4_ord` — full comparison (`=` `<>` `<` `<=` `>` `>=`).", "properties": { "c": { - "allOf": [ - { - "$ref": "#/definitions/Ciphertext" - } - ], + "$ref": "#/$defs/Ciphertext", "description": "mp_base85 source ciphertext. Required by the domain CHECK." }, "i": { - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ], + "$ref": "#/$defs/Identifier", "description": "Table/column identifier. Required by the domain CHECK." }, "ob": { - "allOf": [ - { - "$ref": "#/definitions/OreBlock256" - } - ], + "$ref": "#/$defs/OreBlock256", "description": "Block-ORE order term. Serves equality too." }, "v": { - "allOf": [ - { - "$ref": "#/definitions/SchemaVersion" - } - ], - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other value fails deserialization." + "$ref": "#/$defs/SchemaVersion", + "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." } }, "required": [ - "c", + "v", "i", - "ob", - "v" + "c", + "ob" ], "title": "Int4Ord", "type": "object" diff --git a/crates/eql-bindings/schema/v3/int4_ord_ore.json b/crates/eql-bindings/schema/v3/int4_ord_ore.json index 326d2688b..24d6e8877 100644 --- a/crates/eql-bindings/schema/v3/int4_ord_ore.json +++ b/crates/eql-bindings/schema/v3/int4_ord_ore.json @@ -1,8 +1,5 @@ { - "$id": "https://schemas.cipherstash.com/eql/v3/int4_ord_ore.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { + "$defs": { "Ciphertext": { "description": "mp_base85 source ciphertext — the `c` envelope key.\n\nRequired by every v3 domain CHECK; present on every payload.", "type": "string" @@ -21,13 +18,13 @@ } }, "required": [ - "c", - "t" + "t", + "c" ], "type": "object" }, "OreBlock256": { - "description": "Block-ORE order term — the `ob` wire key. Backs the `_ord` / `_ord_ore` domains (`=` `<>` `<` `<=` `>` `>=`); ORE is lossless over the scalar's domain, so it serves equality too. The block count is width-agnostic on the wire (8 for the int scalars, 12 for timestamptz, 14 for numeric) — the array just carries more block strings. SQL-side constructor: `eql_v3.ore_block_256`.", + "description": "Block-ORE order term — the `ob` wire key. Backs the `_ord` / `_ord_ore`\ndomains (`=` `<>` `<` `<=` `>` `>=`); ORE is lossless over the scalar's\ndomain, so it serves equality too. The block count is width-agnostic on the\nwire (8 for the int scalars, 12 for timestamptz, 14 for numeric) — the\narray just carries more block strings. SQL-side constructor:\n`eql_v3.ore_block_256`.", "items": { "type": "string" }, @@ -39,46 +36,33 @@ "type": "integer" } }, - "description": "`eql_v3.int4_ord_ore` — full comparison (`=` `<>` `<` `<=` `>` `>=`), scheme-explicit name. Same shape as [`Int4Ord`], distinct SQL domain.", + "$id": "https://schemas.cipherstash.com/eql/v3/int4_ord_ore.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "description": "`eql_v3.int4_ord_ore` — full comparison (`=` `<>` `<` `<=` `>` `>=`),\nscheme-explicit name. Same shape as [`Int4Ord`], distinct SQL domain.", "properties": { "c": { - "allOf": [ - { - "$ref": "#/definitions/Ciphertext" - } - ], + "$ref": "#/$defs/Ciphertext", "description": "mp_base85 source ciphertext. Required by the domain CHECK." }, "i": { - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ], + "$ref": "#/$defs/Identifier", "description": "Table/column identifier. Required by the domain CHECK." }, "ob": { - "allOf": [ - { - "$ref": "#/definitions/OreBlock256" - } - ], - "description": "Block-ORE order term. Serves equality too — ORE over a full-domain `int4` is lossless, so no separate `hm` is carried." + "$ref": "#/$defs/OreBlock256", + "description": "Block-ORE order term. Serves equality too — ORE over a\nfull-domain `int4` is lossless, so no separate `hm` is carried." }, "v": { - "allOf": [ - { - "$ref": "#/definitions/SchemaVersion" - } - ], - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other value fails deserialization." + "$ref": "#/$defs/SchemaVersion", + "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." } }, "required": [ - "c", + "v", "i", - "ob", - "v" + "c", + "ob" ], "title": "Int4OrdOre", "type": "object" diff --git a/crates/eql-bindings/schema/v3/int8.json b/crates/eql-bindings/schema/v3/int8.json index be50c73b5..12555a6c9 100644 --- a/crates/eql-bindings/schema/v3/int8.json +++ b/crates/eql-bindings/schema/v3/int8.json @@ -1,8 +1,5 @@ { - "$id": "https://schemas.cipherstash.com/eql/v3/int8.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { + "$defs": { "Ciphertext": { "description": "mp_base85 source ciphertext — the `c` envelope key.\n\nRequired by every v3 domain CHECK; present on every payload.", "type": "string" @@ -21,8 +18,8 @@ } }, "required": [ - "c", - "t" + "t", + "c" ], "type": "object" }, @@ -32,37 +29,28 @@ "type": "integer" } }, + "$id": "https://schemas.cipherstash.com/eql/v3/int8.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, "description": "`eql_v3.int8` — storage only; every operator is blocked.", "properties": { "c": { - "allOf": [ - { - "$ref": "#/definitions/Ciphertext" - } - ], + "$ref": "#/$defs/Ciphertext", "description": "mp_base85 source ciphertext. Required by the domain CHECK." }, "i": { - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ], + "$ref": "#/$defs/Identifier", "description": "Table/column identifier. Required by the domain CHECK." }, "v": { - "allOf": [ - { - "$ref": "#/definitions/SchemaVersion" - } - ], - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other value fails deserialization." + "$ref": "#/$defs/SchemaVersion", + "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." } }, "required": [ - "c", + "v", "i", - "v" + "c" ], "title": "Int8", "type": "object" diff --git a/crates/eql-bindings/schema/v3/int8_eq.json b/crates/eql-bindings/schema/v3/int8_eq.json index 3a7d30424..ea34847b0 100644 --- a/crates/eql-bindings/schema/v3/int8_eq.json +++ b/crates/eql-bindings/schema/v3/int8_eq.json @@ -1,14 +1,11 @@ { - "$id": "https://schemas.cipherstash.com/eql/v3/int8_eq.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { + "$defs": { "Ciphertext": { "description": "mp_base85 source ciphertext — the `c` envelope key.\n\nRequired by every v3 domain CHECK; present on every payload.", "type": "string" }, "Hmac256": { - "description": "HMAC-SHA-256 equality term — the `hm` wire key. Backs the `_eq` domains (`=`, `<>`). SQL-side constructor: `eql_v3.hmac_256`.", + "description": "HMAC-SHA-256 equality term — the `hm` wire key. Backs the `_eq` domains\n(`=`, `<>`). SQL-side constructor: `eql_v3.hmac_256`.", "type": "string" }, "Identifier": { @@ -25,8 +22,8 @@ } }, "required": [ - "c", - "t" + "t", + "c" ], "type": "object" }, @@ -36,46 +33,33 @@ "type": "integer" } }, + "$id": "https://schemas.cipherstash.com/eql/v3/int8_eq.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, "description": "`eql_v3.int8_eq` — HMAC equality (`=`, `<>`).", "properties": { "c": { - "allOf": [ - { - "$ref": "#/definitions/Ciphertext" - } - ], + "$ref": "#/$defs/Ciphertext", "description": "mp_base85 source ciphertext. Required by the domain CHECK." }, "hm": { - "allOf": [ - { - "$ref": "#/definitions/Hmac256" - } - ], + "$ref": "#/$defs/Hmac256", "description": "HMAC-SHA-256 equality term." }, "i": { - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ], + "$ref": "#/$defs/Identifier", "description": "Table/column identifier. Required by the domain CHECK." }, "v": { - "allOf": [ - { - "$ref": "#/definitions/SchemaVersion" - } - ], - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other value fails deserialization." + "$ref": "#/$defs/SchemaVersion", + "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." } }, "required": [ - "c", - "hm", + "v", "i", - "v" + "c", + "hm" ], "title": "Int8Eq", "type": "object" diff --git a/crates/eql-bindings/schema/v3/int8_ord.json b/crates/eql-bindings/schema/v3/int8_ord.json index b3146c347..e65dd149d 100644 --- a/crates/eql-bindings/schema/v3/int8_ord.json +++ b/crates/eql-bindings/schema/v3/int8_ord.json @@ -1,8 +1,5 @@ { - "$id": "https://schemas.cipherstash.com/eql/v3/int8_ord.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { + "$defs": { "Ciphertext": { "description": "mp_base85 source ciphertext — the `c` envelope key.\n\nRequired by every v3 domain CHECK; present on every payload.", "type": "string" @@ -21,13 +18,13 @@ } }, "required": [ - "c", - "t" + "t", + "c" ], "type": "object" }, "OreBlock256": { - "description": "Block-ORE order term — the `ob` wire key. Backs the `_ord` / `_ord_ore` domains (`=` `<>` `<` `<=` `>` `>=`); ORE is lossless over the scalar's domain, so it serves equality too. The block count is width-agnostic on the wire (8 for the int scalars, 12 for timestamptz, 14 for numeric) — the array just carries more block strings. SQL-side constructor: `eql_v3.ore_block_256`.", + "description": "Block-ORE order term — the `ob` wire key. Backs the `_ord` / `_ord_ore`\ndomains (`=` `<>` `<` `<=` `>` `>=`); ORE is lossless over the scalar's\ndomain, so it serves equality too. The block count is width-agnostic on the\nwire (8 for the int scalars, 12 for timestamptz, 14 for numeric) — the\narray just carries more block strings. SQL-side constructor:\n`eql_v3.ore_block_256`.", "items": { "type": "string" }, @@ -39,46 +36,33 @@ "type": "integer" } }, + "$id": "https://schemas.cipherstash.com/eql/v3/int8_ord.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, "description": "`eql_v3.int8_ord` — full comparison (`=` `<>` `<` `<=` `>` `>=`).", "properties": { "c": { - "allOf": [ - { - "$ref": "#/definitions/Ciphertext" - } - ], + "$ref": "#/$defs/Ciphertext", "description": "mp_base85 source ciphertext. Required by the domain CHECK." }, "i": { - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ], + "$ref": "#/$defs/Identifier", "description": "Table/column identifier. Required by the domain CHECK." }, "ob": { - "allOf": [ - { - "$ref": "#/definitions/OreBlock256" - } - ], + "$ref": "#/$defs/OreBlock256", "description": "Block-ORE order term. Serves equality too." }, "v": { - "allOf": [ - { - "$ref": "#/definitions/SchemaVersion" - } - ], - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other value fails deserialization." + "$ref": "#/$defs/SchemaVersion", + "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." } }, "required": [ - "c", + "v", "i", - "ob", - "v" + "c", + "ob" ], "title": "Int8Ord", "type": "object" diff --git a/crates/eql-bindings/schema/v3/int8_ord_ore.json b/crates/eql-bindings/schema/v3/int8_ord_ore.json index 4c14eb987..ea6d88fde 100644 --- a/crates/eql-bindings/schema/v3/int8_ord_ore.json +++ b/crates/eql-bindings/schema/v3/int8_ord_ore.json @@ -1,8 +1,5 @@ { - "$id": "https://schemas.cipherstash.com/eql/v3/int8_ord_ore.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { + "$defs": { "Ciphertext": { "description": "mp_base85 source ciphertext — the `c` envelope key.\n\nRequired by every v3 domain CHECK; present on every payload.", "type": "string" @@ -21,13 +18,13 @@ } }, "required": [ - "c", - "t" + "t", + "c" ], "type": "object" }, "OreBlock256": { - "description": "Block-ORE order term — the `ob` wire key. Backs the `_ord` / `_ord_ore` domains (`=` `<>` `<` `<=` `>` `>=`); ORE is lossless over the scalar's domain, so it serves equality too. The block count is width-agnostic on the wire (8 for the int scalars, 12 for timestamptz, 14 for numeric) — the array just carries more block strings. SQL-side constructor: `eql_v3.ore_block_256`.", + "description": "Block-ORE order term — the `ob` wire key. Backs the `_ord` / `_ord_ore`\ndomains (`=` `<>` `<` `<=` `>` `>=`); ORE is lossless over the scalar's\ndomain, so it serves equality too. The block count is width-agnostic on the\nwire (8 for the int scalars, 12 for timestamptz, 14 for numeric) — the\narray just carries more block strings. SQL-side constructor:\n`eql_v3.ore_block_256`.", "items": { "type": "string" }, @@ -39,46 +36,33 @@ "type": "integer" } }, + "$id": "https://schemas.cipherstash.com/eql/v3/int8_ord_ore.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, "description": "`eql_v3.int8_ord_ore` — full comparison, scheme-explicit name.", "properties": { "c": { - "allOf": [ - { - "$ref": "#/definitions/Ciphertext" - } - ], + "$ref": "#/$defs/Ciphertext", "description": "mp_base85 source ciphertext. Required by the domain CHECK." }, "i": { - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ], + "$ref": "#/$defs/Identifier", "description": "Table/column identifier. Required by the domain CHECK." }, "ob": { - "allOf": [ - { - "$ref": "#/definitions/OreBlock256" - } - ], + "$ref": "#/$defs/OreBlock256", "description": "Block-ORE order term. Serves equality too." }, "v": { - "allOf": [ - { - "$ref": "#/definitions/SchemaVersion" - } - ], - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other value fails deserialization." + "$ref": "#/$defs/SchemaVersion", + "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." } }, "required": [ - "c", + "v", "i", - "ob", - "v" + "c", + "ob" ], "title": "Int8OrdOre", "type": "object" diff --git a/crates/eql-bindings/schema/v3/numeric.json b/crates/eql-bindings/schema/v3/numeric.json index c89d356f7..f12015dcd 100644 --- a/crates/eql-bindings/schema/v3/numeric.json +++ b/crates/eql-bindings/schema/v3/numeric.json @@ -1,8 +1,5 @@ { - "$id": "https://schemas.cipherstash.com/eql/v3/numeric.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { + "$defs": { "Ciphertext": { "description": "mp_base85 source ciphertext — the `c` envelope key.\n\nRequired by every v3 domain CHECK; present on every payload.", "type": "string" @@ -21,8 +18,8 @@ } }, "required": [ - "c", - "t" + "t", + "c" ], "type": "object" }, @@ -32,37 +29,28 @@ "type": "integer" } }, + "$id": "https://schemas.cipherstash.com/eql/v3/numeric.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, "description": "`eql_v3.numeric` — storage only; every operator is blocked.", "properties": { "c": { - "allOf": [ - { - "$ref": "#/definitions/Ciphertext" - } - ], + "$ref": "#/$defs/Ciphertext", "description": "mp_base85 source ciphertext. Required by the domain CHECK." }, "i": { - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ], + "$ref": "#/$defs/Identifier", "description": "Table/column identifier. Required by the domain CHECK." }, "v": { - "allOf": [ - { - "$ref": "#/definitions/SchemaVersion" - } - ], - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other value fails deserialization." + "$ref": "#/$defs/SchemaVersion", + "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." } }, "required": [ - "c", + "v", "i", - "v" + "c" ], "title": "Numeric", "type": "object" diff --git a/crates/eql-bindings/schema/v3/numeric_eq.json b/crates/eql-bindings/schema/v3/numeric_eq.json index 8cfc98c83..19c11a2b5 100644 --- a/crates/eql-bindings/schema/v3/numeric_eq.json +++ b/crates/eql-bindings/schema/v3/numeric_eq.json @@ -1,14 +1,11 @@ { - "$id": "https://schemas.cipherstash.com/eql/v3/numeric_eq.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { + "$defs": { "Ciphertext": { "description": "mp_base85 source ciphertext — the `c` envelope key.\n\nRequired by every v3 domain CHECK; present on every payload.", "type": "string" }, "Hmac256": { - "description": "HMAC-SHA-256 equality term — the `hm` wire key. Backs the `_eq` domains (`=`, `<>`). SQL-side constructor: `eql_v3.hmac_256`.", + "description": "HMAC-SHA-256 equality term — the `hm` wire key. Backs the `_eq` domains\n(`=`, `<>`). SQL-side constructor: `eql_v3.hmac_256`.", "type": "string" }, "Identifier": { @@ -25,8 +22,8 @@ } }, "required": [ - "c", - "t" + "t", + "c" ], "type": "object" }, @@ -36,46 +33,33 @@ "type": "integer" } }, + "$id": "https://schemas.cipherstash.com/eql/v3/numeric_eq.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, "description": "`eql_v3.numeric_eq` — HMAC equality (`=`, `<>`).", "properties": { "c": { - "allOf": [ - { - "$ref": "#/definitions/Ciphertext" - } - ], + "$ref": "#/$defs/Ciphertext", "description": "mp_base85 source ciphertext. Required by the domain CHECK." }, "hm": { - "allOf": [ - { - "$ref": "#/definitions/Hmac256" - } - ], + "$ref": "#/$defs/Hmac256", "description": "HMAC-SHA-256 equality term." }, "i": { - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ], + "$ref": "#/$defs/Identifier", "description": "Table/column identifier. Required by the domain CHECK." }, "v": { - "allOf": [ - { - "$ref": "#/definitions/SchemaVersion" - } - ], - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other value fails deserialization." + "$ref": "#/$defs/SchemaVersion", + "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." } }, "required": [ - "c", - "hm", + "v", "i", - "v" + "c", + "hm" ], "title": "NumericEq", "type": "object" diff --git a/crates/eql-bindings/schema/v3/numeric_ord.json b/crates/eql-bindings/schema/v3/numeric_ord.json index f4d6571b1..64ca517eb 100644 --- a/crates/eql-bindings/schema/v3/numeric_ord.json +++ b/crates/eql-bindings/schema/v3/numeric_ord.json @@ -1,8 +1,5 @@ { - "$id": "https://schemas.cipherstash.com/eql/v3/numeric_ord.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { + "$defs": { "Ciphertext": { "description": "mp_base85 source ciphertext — the `c` envelope key.\n\nRequired by every v3 domain CHECK; present on every payload.", "type": "string" @@ -21,13 +18,13 @@ } }, "required": [ - "c", - "t" + "t", + "c" ], "type": "object" }, "OreBlock256": { - "description": "Block-ORE order term — the `ob` wire key. Backs the `_ord` / `_ord_ore` domains (`=` `<>` `<` `<=` `>` `>=`); ORE is lossless over the scalar's domain, so it serves equality too. The block count is width-agnostic on the wire (8 for the int scalars, 12 for timestamptz, 14 for numeric) — the array just carries more block strings. SQL-side constructor: `eql_v3.ore_block_256`.", + "description": "Block-ORE order term — the `ob` wire key. Backs the `_ord` / `_ord_ore`\ndomains (`=` `<>` `<` `<=` `>` `>=`); ORE is lossless over the scalar's\ndomain, so it serves equality too. The block count is width-agnostic on the\nwire (8 for the int scalars, 12 for timestamptz, 14 for numeric) — the\narray just carries more block strings. SQL-side constructor:\n`eql_v3.ore_block_256`.", "items": { "type": "string" }, @@ -39,46 +36,33 @@ "type": "integer" } }, + "$id": "https://schemas.cipherstash.com/eql/v3/numeric_ord.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, "description": "`eql_v3.numeric_ord` — full comparison (`=` `<>` `<` `<=` `>` `>=`).", "properties": { "c": { - "allOf": [ - { - "$ref": "#/definitions/Ciphertext" - } - ], + "$ref": "#/$defs/Ciphertext", "description": "mp_base85 source ciphertext. Required by the domain CHECK." }, "i": { - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ], + "$ref": "#/$defs/Identifier", "description": "Table/column identifier. Required by the domain CHECK." }, "ob": { - "allOf": [ - { - "$ref": "#/definitions/OreBlock256" - } - ], + "$ref": "#/$defs/OreBlock256", "description": "Block-ORE order term (14 blocks for numeric). Serves equality too." }, "v": { - "allOf": [ - { - "$ref": "#/definitions/SchemaVersion" - } - ], - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other value fails deserialization." + "$ref": "#/$defs/SchemaVersion", + "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." } }, "required": [ - "c", + "v", "i", - "ob", - "v" + "c", + "ob" ], "title": "NumericOrd", "type": "object" diff --git a/crates/eql-bindings/schema/v3/numeric_ord_ore.json b/crates/eql-bindings/schema/v3/numeric_ord_ore.json index 748b2ba62..3a2aad720 100644 --- a/crates/eql-bindings/schema/v3/numeric_ord_ore.json +++ b/crates/eql-bindings/schema/v3/numeric_ord_ore.json @@ -1,8 +1,5 @@ { - "$id": "https://schemas.cipherstash.com/eql/v3/numeric_ord_ore.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { + "$defs": { "Ciphertext": { "description": "mp_base85 source ciphertext — the `c` envelope key.\n\nRequired by every v3 domain CHECK; present on every payload.", "type": "string" @@ -21,13 +18,13 @@ } }, "required": [ - "c", - "t" + "t", + "c" ], "type": "object" }, "OreBlock256": { - "description": "Block-ORE order term — the `ob` wire key. Backs the `_ord` / `_ord_ore` domains (`=` `<>` `<` `<=` `>` `>=`); ORE is lossless over the scalar's domain, so it serves equality too. The block count is width-agnostic on the wire (8 for the int scalars, 12 for timestamptz, 14 for numeric) — the array just carries more block strings. SQL-side constructor: `eql_v3.ore_block_256`.", + "description": "Block-ORE order term — the `ob` wire key. Backs the `_ord` / `_ord_ore`\ndomains (`=` `<>` `<` `<=` `>` `>=`); ORE is lossless over the scalar's\ndomain, so it serves equality too. The block count is width-agnostic on the\nwire (8 for the int scalars, 12 for timestamptz, 14 for numeric) — the\narray just carries more block strings. SQL-side constructor:\n`eql_v3.ore_block_256`.", "items": { "type": "string" }, @@ -39,46 +36,33 @@ "type": "integer" } }, + "$id": "https://schemas.cipherstash.com/eql/v3/numeric_ord_ore.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, "description": "`eql_v3.numeric_ord_ore` — full comparison, scheme-explicit name.", "properties": { "c": { - "allOf": [ - { - "$ref": "#/definitions/Ciphertext" - } - ], + "$ref": "#/$defs/Ciphertext", "description": "mp_base85 source ciphertext. Required by the domain CHECK." }, "i": { - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ], + "$ref": "#/$defs/Identifier", "description": "Table/column identifier. Required by the domain CHECK." }, "ob": { - "allOf": [ - { - "$ref": "#/definitions/OreBlock256" - } - ], + "$ref": "#/$defs/OreBlock256", "description": "Block-ORE order term (14 blocks for numeric). Serves equality too." }, "v": { - "allOf": [ - { - "$ref": "#/definitions/SchemaVersion" - } - ], - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other value fails deserialization." + "$ref": "#/$defs/SchemaVersion", + "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." } }, "required": [ - "c", + "v", "i", - "ob", - "v" + "c", + "ob" ], "title": "NumericOrdOre", "type": "object" diff --git a/crates/eql-bindings/schema/v3/text.json b/crates/eql-bindings/schema/v3/text.json index 4b4e34d95..a045b2caf 100644 --- a/crates/eql-bindings/schema/v3/text.json +++ b/crates/eql-bindings/schema/v3/text.json @@ -1,8 +1,5 @@ { - "$id": "https://schemas.cipherstash.com/eql/v3/text.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { + "$defs": { "Ciphertext": { "description": "mp_base85 source ciphertext — the `c` envelope key.\n\nRequired by every v3 domain CHECK; present on every payload.", "type": "string" @@ -21,8 +18,8 @@ } }, "required": [ - "c", - "t" + "t", + "c" ], "type": "object" }, @@ -32,37 +29,28 @@ "type": "integer" } }, + "$id": "https://schemas.cipherstash.com/eql/v3/text.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, "description": "`eql_v3.text` — storage only; every operator is blocked.", "properties": { "c": { - "allOf": [ - { - "$ref": "#/definitions/Ciphertext" - } - ], + "$ref": "#/$defs/Ciphertext", "description": "mp_base85 source ciphertext. Required by the domain CHECK." }, "i": { - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ], + "$ref": "#/$defs/Identifier", "description": "Table/column identifier. Required by the domain CHECK." }, "v": { - "allOf": [ - { - "$ref": "#/definitions/SchemaVersion" - } - ], - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other value fails deserialization." + "$ref": "#/$defs/SchemaVersion", + "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." } }, "required": [ - "c", + "v", "i", - "v" + "c" ], "title": "Text", "type": "object" diff --git a/crates/eql-bindings/schema/v3/text_eq.json b/crates/eql-bindings/schema/v3/text_eq.json index 71a0f15e0..40d452fd5 100644 --- a/crates/eql-bindings/schema/v3/text_eq.json +++ b/crates/eql-bindings/schema/v3/text_eq.json @@ -1,14 +1,11 @@ { - "$id": "https://schemas.cipherstash.com/eql/v3/text_eq.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { + "$defs": { "Ciphertext": { "description": "mp_base85 source ciphertext — the `c` envelope key.\n\nRequired by every v3 domain CHECK; present on every payload.", "type": "string" }, "Hmac256": { - "description": "HMAC-SHA-256 equality term — the `hm` wire key. Backs the `_eq` domains (`=`, `<>`). SQL-side constructor: `eql_v3.hmac_256`.", + "description": "HMAC-SHA-256 equality term — the `hm` wire key. Backs the `_eq` domains\n(`=`, `<>`). SQL-side constructor: `eql_v3.hmac_256`.", "type": "string" }, "Identifier": { @@ -25,8 +22,8 @@ } }, "required": [ - "c", - "t" + "t", + "c" ], "type": "object" }, @@ -36,46 +33,33 @@ "type": "integer" } }, + "$id": "https://schemas.cipherstash.com/eql/v3/text_eq.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, "description": "`eql_v3.text_eq` — HMAC equality (`=`, `<>`).", "properties": { "c": { - "allOf": [ - { - "$ref": "#/definitions/Ciphertext" - } - ], + "$ref": "#/$defs/Ciphertext", "description": "mp_base85 source ciphertext. Required by the domain CHECK." }, "hm": { - "allOf": [ - { - "$ref": "#/definitions/Hmac256" - } - ], + "$ref": "#/$defs/Hmac256", "description": "HMAC-SHA-256 equality term." }, "i": { - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ], + "$ref": "#/$defs/Identifier", "description": "Table/column identifier. Required by the domain CHECK." }, "v": { - "allOf": [ - { - "$ref": "#/definitions/SchemaVersion" - } - ], - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other value fails deserialization." + "$ref": "#/$defs/SchemaVersion", + "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." } }, "required": [ - "c", - "hm", + "v", "i", - "v" + "c", + "hm" ], "title": "TextEq", "type": "object" diff --git a/crates/eql-bindings/schema/v3/text_match.json b/crates/eql-bindings/schema/v3/text_match.json index cedacf786..98c772c40 100644 --- a/crates/eql-bindings/schema/v3/text_match.json +++ b/crates/eql-bindings/schema/v3/text_match.json @@ -1,14 +1,11 @@ { - "$id": "https://schemas.cipherstash.com/eql/v3/text_match.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { + "$defs": { "BloomFilter": { "description": "Bloom-filter match term — the `bf` wire key. Backs the `_match` domains (`@>`/`<@` containment). Signed i16: EQL stores the filter as PostgreSQL `smallint[]`, and filters sized above 32768 emit upper-half bit positions as negative signed values.", "items": { "format": "int16", - "maximum": 32767.0, - "minimum": -32768.0, + "maximum": 32767, + "minimum": -32768, "type": "integer" }, "type": "array" @@ -31,8 +28,8 @@ } }, "required": [ - "c", - "t" + "t", + "c" ], "type": "object" }, @@ -42,46 +39,33 @@ "type": "integer" } }, + "$id": "https://schemas.cipherstash.com/eql/v3/text_match.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, "description": "`eql_v3.text_match` — Bloom-filter containment match.", "properties": { "bf": { - "allOf": [ - { - "$ref": "#/definitions/BloomFilter" - } - ], + "$ref": "#/$defs/BloomFilter", "description": "Bloom-filter match term (signed smallint bit positions)." }, "c": { - "allOf": [ - { - "$ref": "#/definitions/Ciphertext" - } - ], + "$ref": "#/$defs/Ciphertext", "description": "mp_base85 source ciphertext. Required by the domain CHECK." }, "i": { - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ], + "$ref": "#/$defs/Identifier", "description": "Table/column identifier. Required by the domain CHECK." }, "v": { - "allOf": [ - { - "$ref": "#/definitions/SchemaVersion" - } - ], - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other value fails deserialization." + "$ref": "#/$defs/SchemaVersion", + "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." } }, "required": [ - "bf", - "c", + "v", "i", - "v" + "c", + "bf" ], "title": "TextMatch", "type": "object" diff --git a/crates/eql-bindings/schema/v3/text_ord.json b/crates/eql-bindings/schema/v3/text_ord.json index 0b69333db..be2b77459 100644 --- a/crates/eql-bindings/schema/v3/text_ord.json +++ b/crates/eql-bindings/schema/v3/text_ord.json @@ -1,14 +1,11 @@ { - "$id": "https://schemas.cipherstash.com/eql/v3/text_ord.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { + "$defs": { "Ciphertext": { "description": "mp_base85 source ciphertext — the `c` envelope key.\n\nRequired by every v3 domain CHECK; present on every payload.", "type": "string" }, "Hmac256": { - "description": "HMAC-SHA-256 equality term — the `hm` wire key. Backs the `_eq` domains (`=`, `<>`). SQL-side constructor: `eql_v3.hmac_256`.", + "description": "HMAC-SHA-256 equality term — the `hm` wire key. Backs the `_eq` domains\n(`=`, `<>`). SQL-side constructor: `eql_v3.hmac_256`.", "type": "string" }, "Identifier": { @@ -25,13 +22,13 @@ } }, "required": [ - "c", - "t" + "t", + "c" ], "type": "object" }, "OreBlock256": { - "description": "Block-ORE order term — the `ob` wire key. Backs the `_ord` / `_ord_ore` domains (`=` `<>` `<` `<=` `>` `>=`); ORE is lossless over the scalar's domain, so it serves equality too. The block count is width-agnostic on the wire (8 for the int scalars, 12 for timestamptz, 14 for numeric) — the array just carries more block strings. SQL-side constructor: `eql_v3.ore_block_256`.", + "description": "Block-ORE order term — the `ob` wire key. Backs the `_ord` / `_ord_ore`\ndomains (`=` `<>` `<` `<=` `>` `>=`); ORE is lossless over the scalar's\ndomain, so it serves equality too. The block count is width-agnostic on the\nwire (8 for the int scalars, 12 for timestamptz, 14 for numeric) — the\narray just carries more block strings. SQL-side constructor:\n`eql_v3.ore_block_256`.", "items": { "type": "string" }, @@ -43,55 +40,38 @@ "type": "integer" } }, - "description": "`eql_v3.text_ord` — full lexicographic comparison (`=` `<>` `<` `<=` `>` `>=`). Carries both `hm` (equality) and `ob` (ordering) — text routes equality through `hm` (`[Hm, Ore]`).", + "$id": "https://schemas.cipherstash.com/eql/v3/text_ord.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "description": "`eql_v3.text_ord` — full lexicographic comparison\n(`=` `<>` `<` `<=` `>` `>=`). Carries both `hm` (equality) and `ob`\n(ordering) — text routes equality through `hm` (`[Hm, Ore]`).", "properties": { "c": { - "allOf": [ - { - "$ref": "#/definitions/Ciphertext" - } - ], + "$ref": "#/$defs/Ciphertext", "description": "mp_base85 source ciphertext. Required by the domain CHECK." }, "hm": { - "allOf": [ - { - "$ref": "#/definitions/Hmac256" - } - ], + "$ref": "#/$defs/Hmac256", "description": "HMAC-SHA-256 equality term. Text routes `=`/`<>` through `hm`." }, "i": { - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ], + "$ref": "#/$defs/Identifier", "description": "Table/column identifier. Required by the domain CHECK." }, "ob": { - "allOf": [ - { - "$ref": "#/definitions/OreBlock256" - } - ], + "$ref": "#/$defs/OreBlock256", "description": "Block-ORE order term." }, "v": { - "allOf": [ - { - "$ref": "#/definitions/SchemaVersion" - } - ], - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other value fails deserialization." + "$ref": "#/$defs/SchemaVersion", + "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." } }, "required": [ + "v", + "i", "c", "hm", - "i", - "ob", - "v" + "ob" ], "title": "TextOrd", "type": "object" diff --git a/crates/eql-bindings/schema/v3/text_ord_ore.json b/crates/eql-bindings/schema/v3/text_ord_ore.json index 094f9a49d..b35544c05 100644 --- a/crates/eql-bindings/schema/v3/text_ord_ore.json +++ b/crates/eql-bindings/schema/v3/text_ord_ore.json @@ -1,14 +1,11 @@ { - "$id": "https://schemas.cipherstash.com/eql/v3/text_ord_ore.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { + "$defs": { "Ciphertext": { "description": "mp_base85 source ciphertext — the `c` envelope key.\n\nRequired by every v3 domain CHECK; present on every payload.", "type": "string" }, "Hmac256": { - "description": "HMAC-SHA-256 equality term — the `hm` wire key. Backs the `_eq` domains (`=`, `<>`). SQL-side constructor: `eql_v3.hmac_256`.", + "description": "HMAC-SHA-256 equality term — the `hm` wire key. Backs the `_eq` domains\n(`=`, `<>`). SQL-side constructor: `eql_v3.hmac_256`.", "type": "string" }, "Identifier": { @@ -25,13 +22,13 @@ } }, "required": [ - "c", - "t" + "t", + "c" ], "type": "object" }, "OreBlock256": { - "description": "Block-ORE order term — the `ob` wire key. Backs the `_ord` / `_ord_ore` domains (`=` `<>` `<` `<=` `>` `>=`); ORE is lossless over the scalar's domain, so it serves equality too. The block count is width-agnostic on the wire (8 for the int scalars, 12 for timestamptz, 14 for numeric) — the array just carries more block strings. SQL-side constructor: `eql_v3.ore_block_256`.", + "description": "Block-ORE order term — the `ob` wire key. Backs the `_ord` / `_ord_ore`\ndomains (`=` `<>` `<` `<=` `>` `>=`); ORE is lossless over the scalar's\ndomain, so it serves equality too. The block count is width-agnostic on the\nwire (8 for the int scalars, 12 for timestamptz, 14 for numeric) — the\narray just carries more block strings. SQL-side constructor:\n`eql_v3.ore_block_256`.", "items": { "type": "string" }, @@ -43,55 +40,38 @@ "type": "integer" } }, - "description": "`eql_v3.text_ord_ore` — full lexicographic comparison, scheme-explicit name. Unlike the integer ordered domains (`[Ore]` only), text routes equality through `hm` rather than the ORE term, so the domain carries both `hm` and `ob` (`[Hm, Ore]`).", + "$id": "https://schemas.cipherstash.com/eql/v3/text_ord_ore.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "description": "`eql_v3.text_ord_ore` — full lexicographic comparison,\nscheme-explicit name. Unlike the integer ordered domains (`[Ore]` only),\ntext routes equality through `hm` rather than the ORE term, so the domain\ncarries both `hm` and `ob` (`[Hm, Ore]`).", "properties": { "c": { - "allOf": [ - { - "$ref": "#/definitions/Ciphertext" - } - ], + "$ref": "#/$defs/Ciphertext", "description": "mp_base85 source ciphertext. Required by the domain CHECK." }, "hm": { - "allOf": [ - { - "$ref": "#/definitions/Hmac256" - } - ], + "$ref": "#/$defs/Hmac256", "description": "HMAC-SHA-256 equality term. Text routes `=`/`<>` through `hm`." }, "i": { - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ], + "$ref": "#/$defs/Identifier", "description": "Table/column identifier. Required by the domain CHECK." }, "ob": { - "allOf": [ - { - "$ref": "#/definitions/OreBlock256" - } - ], + "$ref": "#/$defs/OreBlock256", "description": "Block-ORE order term." }, "v": { - "allOf": [ - { - "$ref": "#/definitions/SchemaVersion" - } - ], - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other value fails deserialization." + "$ref": "#/$defs/SchemaVersion", + "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." } }, "required": [ + "v", + "i", "c", "hm", - "i", - "ob", - "v" + "ob" ], "title": "TextOrdOre", "type": "object" diff --git a/crates/eql-bindings/schema/v3/text_search.json b/crates/eql-bindings/schema/v3/text_search.json index 2beaeffe8..a66cee2bc 100644 --- a/crates/eql-bindings/schema/v3/text_search.json +++ b/crates/eql-bindings/schema/v3/text_search.json @@ -1,14 +1,11 @@ { - "$id": "https://schemas.cipherstash.com/eql/v3/text_search.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { + "$defs": { "BloomFilter": { "description": "Bloom-filter match term — the `bf` wire key. Backs the `_match` domains (`@>`/`<@` containment). Signed i16: EQL stores the filter as PostgreSQL `smallint[]`, and filters sized above 32768 emit upper-half bit positions as negative signed values.", "items": { "format": "int16", - "maximum": 32767.0, - "minimum": -32768.0, + "maximum": 32767, + "minimum": -32768, "type": "integer" }, "type": "array" @@ -18,7 +15,7 @@ "type": "string" }, "Hmac256": { - "description": "HMAC-SHA-256 equality term — the `hm` wire key. Backs the `_eq` domains (`=`, `<>`). SQL-side constructor: `eql_v3.hmac_256`.", + "description": "HMAC-SHA-256 equality term — the `hm` wire key. Backs the `_eq` domains\n(`=`, `<>`). SQL-side constructor: `eql_v3.hmac_256`.", "type": "string" }, "Identifier": { @@ -35,13 +32,13 @@ } }, "required": [ - "c", - "t" + "t", + "c" ], "type": "object" }, "OreBlock256": { - "description": "Block-ORE order term — the `ob` wire key. Backs the `_ord` / `_ord_ore` domains (`=` `<>` `<` `<=` `>` `>=`); ORE is lossless over the scalar's domain, so it serves equality too. The block count is width-agnostic on the wire (8 for the int scalars, 12 for timestamptz, 14 for numeric) — the array just carries more block strings. SQL-side constructor: `eql_v3.ore_block_256`.", + "description": "Block-ORE order term — the `ob` wire key. Backs the `_ord` / `_ord_ore`\ndomains (`=` `<>` `<` `<=` `>` `>=`); ORE is lossless over the scalar's\ndomain, so it serves equality too. The block count is width-agnostic on the\nwire (8 for the int scalars, 12 for timestamptz, 14 for numeric) — the\narray just carries more block strings. SQL-side constructor:\n`eql_v3.ore_block_256`.", "items": { "type": "string" }, @@ -53,64 +50,43 @@ "type": "integer" } }, - "description": "`eql_v3.text_search` — the full text search surface: HMAC equality, ORE ordering, and Bloom-filter containment match (`[Hm, Ore, Bloom]`). The superset domain combining `_eq`, `_ord`, and `_match`.", + "$id": "https://schemas.cipherstash.com/eql/v3/text_search.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "description": "`eql_v3.text_search` — the full text search surface: HMAC equality, ORE\nordering, and Bloom-filter containment match (`[Hm, Ore, Bloom]`). The\nsuperset domain combining `_eq`, `_ord`, and `_match`.", "properties": { "bf": { - "allOf": [ - { - "$ref": "#/definitions/BloomFilter" - } - ], + "$ref": "#/$defs/BloomFilter", "description": "Bloom-filter match term (signed smallint bit positions)." }, "c": { - "allOf": [ - { - "$ref": "#/definitions/Ciphertext" - } - ], + "$ref": "#/$defs/Ciphertext", "description": "mp_base85 source ciphertext. Required by the domain CHECK." }, "hm": { - "allOf": [ - { - "$ref": "#/definitions/Hmac256" - } - ], + "$ref": "#/$defs/Hmac256", "description": "HMAC-SHA-256 equality term." }, "i": { - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ], + "$ref": "#/$defs/Identifier", "description": "Table/column identifier. Required by the domain CHECK." }, "ob": { - "allOf": [ - { - "$ref": "#/definitions/OreBlock256" - } - ], + "$ref": "#/$defs/OreBlock256", "description": "Block-ORE order term." }, "v": { - "allOf": [ - { - "$ref": "#/definitions/SchemaVersion" - } - ], - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other value fails deserialization." + "$ref": "#/$defs/SchemaVersion", + "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." } }, "required": [ - "bf", + "v", + "i", "c", "hm", - "i", "ob", - "v" + "bf" ], "title": "TextSearch", "type": "object" diff --git a/crates/eql-bindings/schema/v3/timestamptz.json b/crates/eql-bindings/schema/v3/timestamptz.json index 72a154d8e..d8f3650e5 100644 --- a/crates/eql-bindings/schema/v3/timestamptz.json +++ b/crates/eql-bindings/schema/v3/timestamptz.json @@ -1,8 +1,5 @@ { - "$id": "https://schemas.cipherstash.com/eql/v3/timestamptz.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { + "$defs": { "Ciphertext": { "description": "mp_base85 source ciphertext — the `c` envelope key.\n\nRequired by every v3 domain CHECK; present on every payload.", "type": "string" @@ -21,8 +18,8 @@ } }, "required": [ - "c", - "t" + "t", + "c" ], "type": "object" }, @@ -32,37 +29,28 @@ "type": "integer" } }, + "$id": "https://schemas.cipherstash.com/eql/v3/timestamptz.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, "description": "`eql_v3.timestamptz` — storage only; every operator is blocked.", "properties": { "c": { - "allOf": [ - { - "$ref": "#/definitions/Ciphertext" - } - ], + "$ref": "#/$defs/Ciphertext", "description": "mp_base85 source ciphertext. Required by the domain CHECK." }, "i": { - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ], + "$ref": "#/$defs/Identifier", "description": "Table/column identifier. Required by the domain CHECK." }, "v": { - "allOf": [ - { - "$ref": "#/definitions/SchemaVersion" - } - ], - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other value fails deserialization." + "$ref": "#/$defs/SchemaVersion", + "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." } }, "required": [ - "c", + "v", "i", - "v" + "c" ], "title": "Timestamptz", "type": "object" diff --git a/crates/eql-bindings/schema/v3/timestamptz_eq.json b/crates/eql-bindings/schema/v3/timestamptz_eq.json index 90fc71d48..490e463d1 100644 --- a/crates/eql-bindings/schema/v3/timestamptz_eq.json +++ b/crates/eql-bindings/schema/v3/timestamptz_eq.json @@ -1,14 +1,11 @@ { - "$id": "https://schemas.cipherstash.com/eql/v3/timestamptz_eq.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { + "$defs": { "Ciphertext": { "description": "mp_base85 source ciphertext — the `c` envelope key.\n\nRequired by every v3 domain CHECK; present on every payload.", "type": "string" }, "Hmac256": { - "description": "HMAC-SHA-256 equality term — the `hm` wire key. Backs the `_eq` domains (`=`, `<>`). SQL-side constructor: `eql_v3.hmac_256`.", + "description": "HMAC-SHA-256 equality term — the `hm` wire key. Backs the `_eq` domains\n(`=`, `<>`). SQL-side constructor: `eql_v3.hmac_256`.", "type": "string" }, "Identifier": { @@ -25,8 +22,8 @@ } }, "required": [ - "c", - "t" + "t", + "c" ], "type": "object" }, @@ -36,46 +33,33 @@ "type": "integer" } }, + "$id": "https://schemas.cipherstash.com/eql/v3/timestamptz_eq.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, "description": "`eql_v3.timestamptz_eq` — HMAC equality (`=`, `<>`).", "properties": { "c": { - "allOf": [ - { - "$ref": "#/definitions/Ciphertext" - } - ], + "$ref": "#/$defs/Ciphertext", "description": "mp_base85 source ciphertext. Required by the domain CHECK." }, "hm": { - "allOf": [ - { - "$ref": "#/definitions/Hmac256" - } - ], + "$ref": "#/$defs/Hmac256", "description": "HMAC-SHA-256 equality term." }, "i": { - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ], + "$ref": "#/$defs/Identifier", "description": "Table/column identifier. Required by the domain CHECK." }, "v": { - "allOf": [ - { - "$ref": "#/definitions/SchemaVersion" - } - ], - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other value fails deserialization." + "$ref": "#/$defs/SchemaVersion", + "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." } }, "required": [ - "c", - "hm", + "v", "i", - "v" + "c", + "hm" ], "title": "TimestamptzEq", "type": "object" diff --git a/crates/eql-bindings/schema/v3/timestamptz_ord.json b/crates/eql-bindings/schema/v3/timestamptz_ord.json index 993bc94c8..37557b81e 100644 --- a/crates/eql-bindings/schema/v3/timestamptz_ord.json +++ b/crates/eql-bindings/schema/v3/timestamptz_ord.json @@ -1,8 +1,5 @@ { - "$id": "https://schemas.cipherstash.com/eql/v3/timestamptz_ord.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { + "$defs": { "Ciphertext": { "description": "mp_base85 source ciphertext — the `c` envelope key.\n\nRequired by every v3 domain CHECK; present on every payload.", "type": "string" @@ -21,13 +18,13 @@ } }, "required": [ - "c", - "t" + "t", + "c" ], "type": "object" }, "OreBlock256": { - "description": "Block-ORE order term — the `ob` wire key. Backs the `_ord` / `_ord_ore` domains (`=` `<>` `<` `<=` `>` `>=`); ORE is lossless over the scalar's domain, so it serves equality too. The block count is width-agnostic on the wire (8 for the int scalars, 12 for timestamptz, 14 for numeric) — the array just carries more block strings. SQL-side constructor: `eql_v3.ore_block_256`.", + "description": "Block-ORE order term — the `ob` wire key. Backs the `_ord` / `_ord_ore`\ndomains (`=` `<>` `<` `<=` `>` `>=`); ORE is lossless over the scalar's\ndomain, so it serves equality too. The block count is width-agnostic on the\nwire (8 for the int scalars, 12 for timestamptz, 14 for numeric) — the\narray just carries more block strings. SQL-side constructor:\n`eql_v3.ore_block_256`.", "items": { "type": "string" }, @@ -39,46 +36,33 @@ "type": "integer" } }, + "$id": "https://schemas.cipherstash.com/eql/v3/timestamptz_ord.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, "description": "`eql_v3.timestamptz_ord` — full comparison (`=` `<>` `<` `<=` `>` `>=`).", "properties": { "c": { - "allOf": [ - { - "$ref": "#/definitions/Ciphertext" - } - ], + "$ref": "#/$defs/Ciphertext", "description": "mp_base85 source ciphertext. Required by the domain CHECK." }, "i": { - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ], + "$ref": "#/$defs/Identifier", "description": "Table/column identifier. Required by the domain CHECK." }, "ob": { - "allOf": [ - { - "$ref": "#/definitions/OreBlock256" - } - ], + "$ref": "#/$defs/OreBlock256", "description": "Block-ORE order term (12 blocks for timestamptz). Serves equality too." }, "v": { - "allOf": [ - { - "$ref": "#/definitions/SchemaVersion" - } - ], - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other value fails deserialization." + "$ref": "#/$defs/SchemaVersion", + "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." } }, "required": [ - "c", + "v", "i", - "ob", - "v" + "c", + "ob" ], "title": "TimestamptzOrd", "type": "object" diff --git a/crates/eql-bindings/schema/v3/timestamptz_ord_ore.json b/crates/eql-bindings/schema/v3/timestamptz_ord_ore.json index 9d202d6e2..655bb406d 100644 --- a/crates/eql-bindings/schema/v3/timestamptz_ord_ore.json +++ b/crates/eql-bindings/schema/v3/timestamptz_ord_ore.json @@ -1,8 +1,5 @@ { - "$id": "https://schemas.cipherstash.com/eql/v3/timestamptz_ord_ore.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "definitions": { + "$defs": { "Ciphertext": { "description": "mp_base85 source ciphertext — the `c` envelope key.\n\nRequired by every v3 domain CHECK; present on every payload.", "type": "string" @@ -21,13 +18,13 @@ } }, "required": [ - "c", - "t" + "t", + "c" ], "type": "object" }, "OreBlock256": { - "description": "Block-ORE order term — the `ob` wire key. Backs the `_ord` / `_ord_ore` domains (`=` `<>` `<` `<=` `>` `>=`); ORE is lossless over the scalar's domain, so it serves equality too. The block count is width-agnostic on the wire (8 for the int scalars, 12 for timestamptz, 14 for numeric) — the array just carries more block strings. SQL-side constructor: `eql_v3.ore_block_256`.", + "description": "Block-ORE order term — the `ob` wire key. Backs the `_ord` / `_ord_ore`\ndomains (`=` `<>` `<` `<=` `>` `>=`); ORE is lossless over the scalar's\ndomain, so it serves equality too. The block count is width-agnostic on the\nwire (8 for the int scalars, 12 for timestamptz, 14 for numeric) — the\narray just carries more block strings. SQL-side constructor:\n`eql_v3.ore_block_256`.", "items": { "type": "string" }, @@ -39,46 +36,33 @@ "type": "integer" } }, + "$id": "https://schemas.cipherstash.com/eql/v3/timestamptz_ord_ore.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, "description": "`eql_v3.timestamptz_ord_ore` — full comparison, scheme-explicit name.", "properties": { "c": { - "allOf": [ - { - "$ref": "#/definitions/Ciphertext" - } - ], + "$ref": "#/$defs/Ciphertext", "description": "mp_base85 source ciphertext. Required by the domain CHECK." }, "i": { - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ], + "$ref": "#/$defs/Identifier", "description": "Table/column identifier. Required by the domain CHECK." }, "ob": { - "allOf": [ - { - "$ref": "#/definitions/OreBlock256" - } - ], + "$ref": "#/$defs/OreBlock256", "description": "Block-ORE order term (12 blocks for timestamptz). Serves equality too." }, "v": { - "allOf": [ - { - "$ref": "#/definitions/SchemaVersion" - } - ], - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other value fails deserialization." + "$ref": "#/$defs/SchemaVersion", + "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." } }, "required": [ - "c", + "v", "i", - "ob", - "v" + "c", + "ob" ], "title": "TimestamptzOrdOre", "type": "object" diff --git a/crates/eql-bindings/src/lib.rs b/crates/eql-bindings/src/lib.rs index 6146d3ccf..44052e591 100644 --- a/crates/eql-bindings/src/lib.rs +++ b/crates/eql-bindings/src/lib.rs @@ -76,27 +76,20 @@ impl<'de> Deserialize<'de> for SchemaVersion { /// Manual schema: pins `v` to the literal `2` (`const`), mirroring the /// domain CHECK — the derive would emit an unconstrained integer. impl schemars::JsonSchema for SchemaVersion { - fn schema_name() -> String { - "SchemaVersion".to_owned() + fn schema_name() -> std::borrow::Cow<'static, str> { + "SchemaVersion".into() } - fn json_schema(_: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema { - schemars::schema::SchemaObject { - instance_type: Some(schemars::schema::InstanceType::Integer.into()), - const_value: Some(serde_json::json!(EQL_SCHEMA_VERSION)), - metadata: Some(Box::new(schemars::schema::Metadata { - // KEEP IN SYNC with the `SchemaVersion` doc comment above — it - // is the canonical text. A derived `JsonSchema` would copy the - // doc comment automatically; this manual impl can't, so this - // hand-written copy must be updated alongside it. - description: Some( - "The envelope version field (`v`) — always exactly `2` on the wire.".to_owned(), - ), - ..Default::default() - })), - ..Default::default() - } - .into() + fn json_schema(_: &mut schemars::SchemaGenerator) -> schemars::Schema { + // KEEP IN SYNC with the `SchemaVersion` doc comment above — it is the + // canonical text. A derived `JsonSchema` would copy the doc comment + // automatically; this manual impl can't, so this hand-written copy + // must be updated alongside it. + schemars::json_schema!({ + "type": "integer", + "const": EQL_SCHEMA_VERSION, + "description": "The envelope version field (`v`) — always exactly `2` on the wire.", + }) } } diff --git a/crates/eql-bindings/src/v3/bool.rs b/crates/eql-bindings/src/v3/bool.rs index 0b2396a62..7ccc6240c 100644 --- a/crates/eql-bindings/src/v3/bool.rs +++ b/crates/eql-bindings/src/v3/bool.rs @@ -12,7 +12,7 @@ //! trivially leak the plaintext distribution. The payload is `{v,i,c}` only — //! no `hm`/`ob`/`bf` — and every operator on the domain is blocked. -use schemars::{schema::RootSchema, schema_for}; +use schemars::{schema_for, Schema}; use crate::v3::terms::Ciphertext; use crate::v3::DomainType; @@ -44,7 +44,7 @@ impl DomainType for Bool { Self::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(Bool) } } diff --git a/crates/eql-bindings/src/v3/date.rs b/crates/eql-bindings/src/v3/date.rs index 1da37028f..ce44eba03 100644 --- a/crates/eql-bindings/src/v3/date.rs +++ b/crates/eql-bindings/src/v3/date.rs @@ -3,7 +3,7 @@ //! ciphertext, so dates order like integers); see that module for the //! capability table. -use schemars::{schema::RootSchema, schema_for}; +use schemars::{schema_for, Schema}; use crate::v3::terms::{Ciphertext, Hmac256, OreBlock256}; use crate::v3::DomainType; @@ -35,7 +35,7 @@ impl DomainType for Date { Self::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(Date) } } @@ -65,7 +65,7 @@ impl DomainType for DateEq { Self::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(DateEq) } } @@ -95,7 +95,7 @@ impl DomainType for DateOrdOre { Self::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(DateOrdOre) } } @@ -125,7 +125,7 @@ impl DomainType for DateOrd { Self::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(DateOrd) } } diff --git a/crates/eql-bindings/src/v3/float4.rs b/crates/eql-bindings/src/v3/float4.rs index 4af550230..d9549c897 100644 --- a/crates/eql-bindings/src/v3/float4.rs +++ b/crates/eql-bindings/src/v3/float4.rs @@ -13,7 +13,7 @@ //! server-side — reject it client-side** caveat) is identical to `float8`; see //! [`crate::v3::float8`] for the full note. -use schemars::{schema::RootSchema, schema_for}; +use schemars::{schema_for, Schema}; use crate::v3::terms::{Ciphertext, Hmac256, OreBlock256}; use crate::v3::DomainType; @@ -45,7 +45,7 @@ impl DomainType for Float4 { Self::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(Float4) } } @@ -75,7 +75,7 @@ impl DomainType for Float4Eq { Self::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(Float4Eq) } } @@ -105,7 +105,7 @@ impl DomainType for Float4OrdOre { Self::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(Float4OrdOre) } } @@ -135,7 +135,7 @@ impl DomainType for Float4Ord { Self::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(Float4Ord) } } diff --git a/crates/eql-bindings/src/v3/float8.rs b/crates/eql-bindings/src/v3/float8.rs index de2ebba3c..26e1863f6 100644 --- a/crates/eql-bindings/src/v3/float8.rs +++ b/crates/eql-bindings/src/v3/float8.rs @@ -22,7 +22,7 @@ //! rather than being excluded the way native Postgres `double precision` would. //! See the `float_special` regression suite for the locked behaviour. -use schemars::{schema::RootSchema, schema_for}; +use schemars::{schema_for, Schema}; use crate::v3::terms::{Ciphertext, Hmac256, OreBlock256}; use crate::v3::DomainType; @@ -54,7 +54,7 @@ impl DomainType for Float8 { Self::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(Float8) } } @@ -84,7 +84,7 @@ impl DomainType for Float8Eq { Self::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(Float8Eq) } } @@ -114,7 +114,7 @@ impl DomainType for Float8OrdOre { Self::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(Float8OrdOre) } } @@ -144,7 +144,7 @@ impl DomainType for Float8Ord { Self::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(Float8Ord) } } diff --git a/crates/eql-bindings/src/v3/int2.rs b/crates/eql-bindings/src/v3/int2.rs index 6ee64e5af..ee179e6a1 100644 --- a/crates/eql-bindings/src/v3/int2.rs +++ b/crates/eql-bindings/src/v3/int2.rs @@ -1,7 +1,7 @@ //! The `int2` encrypted-domain family. Same four-domain ordered shape as //! [`crate::v3::int4`] — see that module for the capability table. -use schemars::{schema::RootSchema, schema_for}; +use schemars::{schema_for, Schema}; use crate::v3::terms::{Ciphertext, Hmac256, OreBlock256}; use crate::v3::DomainType; @@ -33,7 +33,7 @@ impl DomainType for Int2 { Self::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(Int2) } } @@ -63,7 +63,7 @@ impl DomainType for Int2Eq { Self::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(Int2Eq) } } @@ -93,7 +93,7 @@ impl DomainType for Int2OrdOre { Self::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(Int2OrdOre) } } @@ -123,7 +123,7 @@ impl DomainType for Int2Ord { Self::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(Int2Ord) } } diff --git a/crates/eql-bindings/src/v3/int4.rs b/crates/eql-bindings/src/v3/int4.rs index 74296f495..9bf97fa87 100644 --- a/crates/eql-bindings/src/v3/int4.rs +++ b/crates/eql-bindings/src/v3/int4.rs @@ -7,7 +7,7 @@ //! | [`Int4OrdOre`] | `eql_v3.int4_ord_ore` | `v` `i` `c` `ob` | `=` `<>` `<` `<=` `>` `>=` | //! | [`Int4Ord`] | `eql_v3.int4_ord` | `v` `i` `c` `ob` | `=` `<>` `<` `<=` `>` `>=` | -use schemars::{schema::RootSchema, schema_for}; +use schemars::{schema_for, Schema}; use crate::v3::terms::{Ciphertext, Hmac256, OreBlock256}; use crate::v3::DomainType; @@ -39,7 +39,7 @@ impl DomainType for Int4 { Self::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(Int4) } } @@ -69,7 +69,7 @@ impl DomainType for Int4Eq { Self::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(Int4Eq) } } @@ -101,7 +101,7 @@ impl DomainType for Int4OrdOre { Self::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(Int4OrdOre) } } @@ -131,7 +131,7 @@ impl DomainType for Int4Ord { Self::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(Int4Ord) } } diff --git a/crates/eql-bindings/src/v3/int8.rs b/crates/eql-bindings/src/v3/int8.rs index 0bd46fd29..1502be787 100644 --- a/crates/eql-bindings/src/v3/int8.rs +++ b/crates/eql-bindings/src/v3/int8.rs @@ -1,7 +1,7 @@ //! The `int8` encrypted-domain family. Same four-domain ordered shape as //! [`crate::v3::int4`] — see that module for the capability table. -use schemars::{schema::RootSchema, schema_for}; +use schemars::{schema_for, Schema}; use crate::v3::terms::{Ciphertext, Hmac256, OreBlock256}; use crate::v3::DomainType; @@ -33,7 +33,7 @@ impl DomainType for Int8 { Self::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(Int8) } } @@ -63,7 +63,7 @@ impl DomainType for Int8Eq { Self::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(Int8Eq) } } @@ -93,7 +93,7 @@ impl DomainType for Int8OrdOre { Self::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(Int8OrdOre) } } @@ -123,7 +123,7 @@ impl DomainType for Int8Ord { Self::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(Int8Ord) } } diff --git a/crates/eql-bindings/src/v3/mod.rs b/crates/eql-bindings/src/v3/mod.rs index 53998b457..73219042c 100644 --- a/crates/eql-bindings/src/v3/mod.rs +++ b/crates/eql-bindings/src/v3/mod.rs @@ -46,7 +46,7 @@ use std::marker::PhantomData; -use schemars::{schema::RootSchema, schema_for, JsonSchema}; +use schemars::{schema_for, JsonSchema, Schema}; pub mod bool; pub mod date; @@ -108,7 +108,7 @@ pub trait DomainType { } /// The type's JSON Schema. - fn schema(&self) -> RootSchema; + fn schema(&self) -> Schema; } /// Type-level handle: lets [`all`] enumerate the domain types without @@ -127,7 +127,7 @@ where T::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(T) } } diff --git a/crates/eql-bindings/src/v3/numeric.rs b/crates/eql-bindings/src/v3/numeric.rs index d7d5b08a8..f94f147e2 100644 --- a/crates/eql-bindings/src/v3/numeric.rs +++ b/crates/eql-bindings/src/v3/numeric.rs @@ -8,7 +8,7 @@ //! more block strings — and the generalized `eql_v3.ore_block_256` comparator //! orders any block count, so no new type is needed here. -use schemars::{schema::RootSchema, schema_for}; +use schemars::{schema_for, Schema}; use crate::v3::terms::{Ciphertext, Hmac256, OreBlock256}; use crate::v3::DomainType; @@ -40,7 +40,7 @@ impl DomainType for Numeric { Self::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(Numeric) } } @@ -70,7 +70,7 @@ impl DomainType for NumericEq { Self::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(NumericEq) } } @@ -100,7 +100,7 @@ impl DomainType for NumericOrdOre { Self::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(NumericOrdOre) } } @@ -130,7 +130,7 @@ impl DomainType for NumericOrd { Self::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(NumericOrd) } } diff --git a/crates/eql-bindings/src/v3/terms.rs b/crates/eql-bindings/src/v3/terms.rs index b322ed87d..3275afccc 100644 --- a/crates/eql-bindings/src/v3/terms.rs +++ b/crates/eql-bindings/src/v3/terms.rs @@ -53,47 +53,28 @@ pub struct BloomFilter(pub Vec); /// so an out-of-range bit position would pass schema validation and fail /// at the database. impl schemars::JsonSchema for BloomFilter { - fn schema_name() -> String { - "BloomFilter".to_owned() + fn schema_name() -> std::borrow::Cow<'static, str> { + "BloomFilter".into() } - fn json_schema(_: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema { - use schemars::schema::{ - ArrayValidation, InstanceType, Metadata, NumberValidation, Schema, SchemaObject, - }; - let items = SchemaObject { - instance_type: Some(InstanceType::Integer.into()), - format: Some("int16".to_owned()), - number: Some(Box::new(NumberValidation { - minimum: Some(f64::from(i16::MIN)), - maximum: Some(f64::from(i16::MAX)), - ..Default::default() - })), - ..Default::default() - }; - SchemaObject { - instance_type: Some(InstanceType::Array.into()), - array: Some(Box::new(ArrayValidation { - items: Some(Schema::Object(items).into()), - ..Default::default() - })), - metadata: Some(Box::new(Metadata { - // KEEP IN SYNC with the doc comment on `BloomFilter` above — it - // is the canonical text. A derived `JsonSchema` would copy the - // doc comment automatically; this manual impl can't, so this - // hand-written paraphrase must be updated alongside it. - description: Some( - "Bloom-filter match term — the `bf` wire key. Backs the `_match` \ - domains (`@>`/`<@` containment). Signed i16: EQL stores the filter \ - as PostgreSQL `smallint[]`, and filters sized above 32768 emit \ - upper-half bit positions as negative signed values." - .to_owned(), - ), - ..Default::default() - })), - ..Default::default() - } - .into() + fn json_schema(_: &mut schemars::SchemaGenerator) -> schemars::Schema { + // KEEP IN SYNC with the doc comment on `BloomFilter` above — it is the + // canonical text. A derived `JsonSchema` would copy the doc comment + // automatically; this manual impl can't, so this hand-written + // paraphrase must be updated alongside it. + schemars::json_schema!({ + "type": "array", + "items": { + "type": "integer", + "format": "int16", + "minimum": i16::MIN, + "maximum": i16::MAX, + }, + "description": "Bloom-filter match term — the `bf` wire key. Backs the `_match` \ + domains (`@>`/`<@` containment). Signed i16: EQL stores the filter \ + as PostgreSQL `smallint[]`, and filters sized above 32768 emit \ + upper-half bit positions as negative signed values.", + }) } } diff --git a/crates/eql-bindings/src/v3/text.rs b/crates/eql-bindings/src/v3/text.rs index 2d6b05987..65b385a74 100644 --- a/crates/eql-bindings/src/v3/text.rs +++ b/crates/eql-bindings/src/v3/text.rs @@ -2,7 +2,7 @@ //! [`crate::v3::int4`] plus a `_match` domain backed by the Bloom-filter //! term (`@>`/`<@` containment for `LIKE`-style matching). -use schemars::{schema::RootSchema, schema_for}; +use schemars::{schema_for, Schema}; use crate::v3::terms::{BloomFilter, Ciphertext, Hmac256, OreBlock256}; use crate::v3::DomainType; @@ -34,7 +34,7 @@ impl DomainType for Text { Self::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(Text) } } @@ -64,7 +64,7 @@ impl DomainType for TextEq { Self::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(TextEq) } } @@ -94,7 +94,7 @@ impl DomainType for TextMatch { Self::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(TextMatch) } } @@ -129,7 +129,7 @@ impl DomainType for TextOrdOre { Self::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(TextOrdOre) } } @@ -163,7 +163,7 @@ impl DomainType for TextOrd { Self::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(TextOrd) } } @@ -199,7 +199,7 @@ impl DomainType for TextSearch { Self::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(TextSearch) } } diff --git a/crates/eql-bindings/src/v3/timestamptz.rs b/crates/eql-bindings/src/v3/timestamptz.rs index a86ad5d57..ed1959b03 100644 --- a/crates/eql-bindings/src/v3/timestamptz.rs +++ b/crates/eql-bindings/src/v3/timestamptz.rs @@ -9,7 +9,7 @@ //! length, the 12-block `ob` term orders correctly and the ordered domains //! ship. The wire shape is unchanged — the `ob` array just carries 12 blocks. -use schemars::{schema::RootSchema, schema_for}; +use schemars::{schema_for, Schema}; use crate::v3::terms::{Ciphertext, Hmac256, OreBlock256}; use crate::v3::DomainType; @@ -41,7 +41,7 @@ impl DomainType for Timestamptz { Self::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(Timestamptz) } } @@ -71,7 +71,7 @@ impl DomainType for TimestamptzEq { Self::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(TimestamptzEq) } } @@ -101,7 +101,7 @@ impl DomainType for TimestamptzOrdOre { Self::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(TimestamptzOrdOre) } } @@ -131,7 +131,7 @@ impl DomainType for TimestamptzOrd { Self::sql_domain_static() } - fn schema(&self) -> RootSchema { + fn schema(&self) -> Schema { schema_for!(TimestamptzOrd) } } diff --git a/crates/eql-bindings/tests/catalog_parity.rs b/crates/eql-bindings/tests/catalog_parity.rs index 53bfa16a3..df4969069 100644 --- a/crates/eql-bindings/tests/catalog_parity.rs +++ b/crates/eql-bindings/tests/catalog_parity.rs @@ -43,13 +43,14 @@ fn schema_required_keys_match_catalog_terms() { .find(|e| e.domain() == name) .unwrap_or_else(|| panic!("no domain inventory entry for {name}")); - let schema = entry.schema(); - let object = schema - .schema - .object - .as_ref() - .unwrap_or_else(|| panic!("{name}: schema is not an object")); - let required: BTreeSet<&str> = object.required.iter().map(String::as_str).collect(); + let schema: Value = serde_json::to_value(entry.schema()) + .unwrap_or_else(|e| panic!("{name}: schema does not serialize: {e}")); + let required: BTreeSet<&str> = schema["required"] + .as_array() + .unwrap_or_else(|| panic!("{name}: schema has no required array")) + .iter() + .map(|v| v.as_str().expect("required entry is a string")) + .collect(); let expected: BTreeSet<&str> = ENVELOPE_KEYS .iter() @@ -125,18 +126,18 @@ fn schemas_are_strict() { (struct lost #[serde(deny_unknown_fields)]?)" ); assert_eq!( - schema.pointer("/definitions/Identifier/additionalProperties"), + schema.pointer("/$defs/Identifier/additionalProperties"), Some(&json!(false)), "{name}: Identifier definition must set additionalProperties: false" ); assert_eq!( - schema.pointer("/properties/v/allOf/0/$ref"), - Some(&json!("#/definitions/SchemaVersion")), + schema.pointer("/properties/v/$ref"), + Some(&json!("#/$defs/SchemaVersion")), "{name}: the v property must $ref the SchemaVersion definition \ (field declared as a bare integer instead of SchemaVersion?)" ); assert_eq!( - schema.pointer("/definitions/SchemaVersion/const"), + schema.pointer("/$defs/SchemaVersion/const"), Some(&json!(EQL_SCHEMA_VERSION)), "{name}: SchemaVersion must pin const: {EQL_SCHEMA_VERSION}" ); From d89fb95c7b079213826ce6818b64202e4f7fa1f3 Mon Sep 17 00:00:00 2001 From: Toby Hede Date: Mon, 29 Jun 2026 16:54:53 +1000 Subject: [PATCH 02/12] feat(eql-codegen): add Rust-emitter deps + format_rs helper quote/proc-macro2/syn(v2)/prettyplease(=0.2.37) + RUST_GENERATED_MARKER + format_rs (prettyplease then stable rustfmt, with the @generated marker as line 1). rustfmt is the final formatter so committed generated files are clean under cargo fmt --check. --- Cargo.lock | 4 ++ crates/eql-codegen/Cargo.toml | 4 ++ crates/eql-codegen/src/bindings.rs | 74 ++++++++++++++++++++++++++++++ crates/eql-codegen/src/consts.rs | 8 ++++ crates/eql-codegen/src/lib.rs | 1 + 5 files changed, 91 insertions(+) create mode 100644 crates/eql-codegen/src/bindings.rs diff --git a/Cargo.lock b/Cargo.lock index f8e31d80c..aed770ec1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1178,8 +1178,12 @@ version = "0.1.0" dependencies = [ "eql-domains", "minijinja", + "prettyplease", + "proc-macro2", + "quote", "serde", "serde_json", + "syn 2.0.108", "thiserror 2.0.18", ] diff --git a/crates/eql-codegen/Cargo.toml b/crates/eql-codegen/Cargo.toml index bec6f3989..b245640ca 100644 --- a/crates/eql-codegen/Cargo.toml +++ b/crates/eql-codegen/Cargo.toml @@ -10,6 +10,10 @@ minijinja = "2" serde = { version = "1", features = ["derive"] } serde_json = "1" thiserror = "2" +quote = "1" +proc-macro2 = "1" +syn = { version = "2", features = ["full"] } +prettyplease = "=0.2.37" [[bin]] name = "eql-codegen" diff --git a/crates/eql-codegen/src/bindings.rs b/crates/eql-codegen/src/bindings.rs new file mode 100644 index 000000000..19e631eea --- /dev/null +++ b/crates/eql-codegen/src/bindings.rs @@ -0,0 +1,74 @@ +//! The Rust payload-bindings emitter: renders `eql_domains::CATALOG` to the +//! committed `crates/eql-bindings/src/v3/.rs` structs + `DomainType` +//! impls and the generated `inventory.rs` (`all()`), the same generate-to- +//! committed-source mechanism `generate.rs` uses for SQL. Token stream via +//! `quote!`, formatted by `prettyplease::unparse` then the repo's stable +//! `rustfmt` (prettyplease is rustfmt-clean but not rustfmt-identical), with +//! the `// @generated` ownership marker prepended as line 1. + +use proc_macro2::TokenStream; + +use crate::consts::RUST_GENERATED_MARKER; + +/// Format a token stream into committed Rust source. `prettyplease::unparse` +/// gives deterministic, parseable output; the `@generated` marker is prepended +/// as line 1 (syn/prettyplease drop free-standing line comments, so it cannot +/// live inside the token stream); then the whole file is run through `rustfmt` +/// so it is byte-for-byte what `cargo fmt --check` (`mise run test:crates`) +/// expects. +pub fn format_rs(tokens: TokenStream) -> String { + let file: syn::File = syn::parse2(tokens).expect("emit syntactically valid Rust"); + let body = prettyplease::unparse(&file); + let with_marker = format!("{RUST_GENERATED_MARKER}\n{body}"); + rustfmt(&with_marker) +} + +/// Pipe Rust source through the repo's `rustfmt` (stdin → stdout). Fails loudly: +/// codegen is a dev-time tool and `rustfmt` is always present where `cargo fmt` +/// runs. `rustfmt` preserves the leading `// @generated` line comment, so the +/// marker stays exactly line 1. +fn rustfmt(src: &str) -> String { + use std::io::Write; + use std::process::{Command, Stdio}; + + let mut child = Command::new("rustfmt") + .args(["--edition", "2021"]) + .stdin(Stdio::piped()) + .stdout(Stdio::piped()) + .stderr(Stdio::piped()) + .spawn() + .expect("spawn rustfmt (is the Rust toolchain on PATH?)"); + child + .stdin + .take() + .expect("rustfmt stdin") + .write_all(src.as_bytes()) + .expect("write to rustfmt"); + let out = child.wait_with_output().expect("wait for rustfmt"); + assert!( + out.status.success(), + "rustfmt failed: {}", + String::from_utf8_lossy(&out.stderr) + ); + String::from_utf8(out.stdout).expect("rustfmt output is UTF-8") +} + +#[cfg(test)] +mod tests { + use super::*; + use quote::quote; + + #[test] + fn format_rs_prepends_marker_and_is_rustfmt_clean() { + // Deliberately mis-spaced input: rustfmt must normalize it, proving the + // rustfmt pass runs (prettyplease alone would not re-sort imports). + let out = format_rs(quote! { use b::B; use a::A; pub struct Foo { pub v: u16 } }); + assert_eq!(out.lines().next().unwrap(), RUST_GENERATED_MARKER); + assert!(out.contains("pub struct Foo")); + assert!(out.contains("pub v: u16")); + // rustfmt sorts `use a::A;` before `use b::B;` + assert!(out.find("use a::A;").unwrap() < out.find("use b::B;").unwrap()); + // Idempotent: re-running rustfmt over the output changes nothing. + assert_eq!(rustfmt(&out), out); + } +} diff --git a/crates/eql-codegen/src/consts.rs b/crates/eql-codegen/src/consts.rs index 138036715..392d14d91 100644 --- a/crates/eql-codegen/src/consts.rs +++ b/crates/eql-codegen/src/consts.rs @@ -6,6 +6,14 @@ /// synthesise file bodies append `\n` to form the full header line. pub(crate) const AUTO_GENERATED_MARKER: &str = "-- AUTOMATICALLY GENERATED FILE."; +/// Rust generated-file marker — the `// @generated` header's first line, with +/// no trailing newline. `bindings::format_rs` prepends it (followed by a +/// newline) as line 1 and then runs `rustfmt` over the whole file (rustfmt +/// preserves a leading line comment), and the writer (`GeneratedKind::Rust`) +/// uses it to recognise files it owns. +pub(crate) const RUST_GENERATED_MARKER: &str = + "// @generated by eql-codegen from the eql-domains catalog — do not edit"; + /// The single schema housing the self-contained `eql_v3` surface: the /// encrypted-domain families AND the SEM index-term types/constructors they /// call. v3 has zero dependency on `eql_v2`, so domains and core index-term diff --git a/crates/eql-codegen/src/lib.rs b/crates/eql-codegen/src/lib.rs index c5dbf1a88..c07c8ce6b 100644 --- a/crates/eql-codegen/src/lib.rs +++ b/crates/eql-codegen/src/lib.rs @@ -7,6 +7,7 @@ use std::path::PathBuf; +pub mod bindings; pub mod consts; pub mod context; pub mod dump; From af9dea04f0c89691d0e5fc8f65d0cca1f32bba6e Mon Sep 17 00:00:00 2001 From: Toby Hede Date: Mon, 29 Jun 2026 16:57:37 +1000 Subject: [PATCH 03/12] refactor(eql-codegen): parameterize writer by GeneratedKind {Sql,Rust} The four writer fns take a GeneratedKind selecting the ownership marker and the cleanup extension (.sql vs .rs). SQL call sites pass Sql; generated SQL unchanged (codegen:parity green). --- crates/eql-codegen/src/generate.rs | 23 +++-- crates/eql-codegen/src/writer.rs | 159 ++++++++++++++++++++--------- 2 files changed, 129 insertions(+), 53 deletions(-) diff --git a/crates/eql-codegen/src/generate.rs b/crates/eql-codegen/src/generate.rs index dfa60a4e0..c08cd9d1d 100644 --- a/crates/eql-codegen/src/generate.rs +++ b/crates/eql-codegen/src/generate.rs @@ -198,7 +198,8 @@ pub fn render_aggregates_file(family_name: &str, domain: &Domain) -> Option Result targets.push(out_dir.join(format!("{name}_aggregates.sql"))); } } - ensure_generated_paths_writable(&targets)?; - clean_generated_files(out_dir)?; + ensure_generated_paths_writable(&targets, GeneratedKind::Sql)?; + clean_generated_files(out_dir, GeneratedKind::Sql)?; let mut written: Vec = Vec::new(); let types_path = out_dir.join(format!("{family_name}_types.sql")); - write_generated_file(&types_path, &render_types_file(spec))?; + write_generated_file(&types_path, &render_types_file(spec), GeneratedKind::Sql)?; written.push(types_path); for d in spec.domains { let name = d.full_name(family_name); let fn_path = out_dir.join(format!("{name}_functions.sql")); - write_generated_file(&fn_path, &render_functions_file(family_name, d))?; + write_generated_file( + &fn_path, + &render_functions_file(family_name, d), + GeneratedKind::Sql, + )?; written.push(fn_path); let op_path = out_dir.join(format!("{name}_operators.sql")); - write_generated_file(&op_path, &render_operators_file(family_name, d))?; + write_generated_file( + &op_path, + &render_operators_file(family_name, d), + GeneratedKind::Sql, + )?; written.push(op_path); if let Some(agg) = render_aggregates_file(family_name, d) { let agg_path = out_dir.join(format!("{name}_aggregates.sql")); - write_generated_file(&agg_path, &agg)?; + write_generated_file(&agg_path, &agg, GeneratedKind::Sql)?; written.push(agg_path); } } diff --git a/crates/eql-codegen/src/writer.rs b/crates/eql-codegen/src/writer.rs index 93d6b4489..ed7586fd0 100644 --- a/crates/eql-codegen/src/writer.rs +++ b/crates/eql-codegen/src/writer.rs @@ -4,11 +4,33 @@ use std::fs; use std::io; use std::path::{Path, PathBuf}; -use crate::consts::AUTO_GENERATED_MARKER; +use crate::consts::{AUTO_GENERATED_MARKER, RUST_GENERATED_MARKER}; -/// First line of the SQL header — the ownership marker. -const fn sql_marker() -> &'static str { - AUTO_GENERATED_MARKER +/// Which generated-file family a writer call targets — selects the ownership +/// marker and the cleanup file extension so one writer serves both the SQL +/// surface (`generate.rs`) and the Rust bindings (`bindings.rs`). +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum GeneratedKind { + Sql, + Rust, +} + +impl GeneratedKind { + /// The exact first-line ownership marker for this kind. + pub const fn marker(self) -> &'static str { + match self { + GeneratedKind::Sql => AUTO_GENERATED_MARKER, + GeneratedKind::Rust => RUST_GENERATED_MARKER, + } + } + + /// The file extension `clean_generated_files` filters on for this kind. + pub const fn extension(self) -> &'static str { + match self { + GeneratedKind::Sql => "sql", + GeneratedKind::Rust => "rs", + } + } } /// Raised when the generator would clobber a hand-written file, or on an @@ -32,25 +54,27 @@ fn first_line(path: &Path) -> io::Result { .to_string()) } -/// True if the file carries the SQL AUTO-GENERATED marker. Port of `is_generated`. -pub fn is_generated(path: &Path) -> bool { - path.is_file() && first_line(path).map(|l| l == sql_marker()).unwrap_or(false) +/// True if the file carries this kind's AUTO-GENERATED marker as line 1. +pub fn is_generated(path: &Path, kind: GeneratedKind) -> bool { + path.is_file() + && first_line(path) + .map(|l| l == kind.marker()) + .unwrap_or(false) } -/// Delete every generated .sql file in `directory`, returning removed paths. -/// Port of `clean_generated_files`. -pub fn clean_generated_files(directory: &Path) -> io::Result> { +/// Delete every generated file of `kind` in `directory`, returning removed paths. +pub fn clean_generated_files(directory: &Path, kind: GeneratedKind) -> io::Result> { if !directory.is_dir() { return Ok(Vec::new()); } let mut paths: Vec = fs::read_dir(directory)? .filter_map(|e| e.ok().map(|e| e.path())) - .filter(|p| p.extension().and_then(|x| x.to_str()) == Some("sql")) + .filter(|p| p.extension().and_then(|x| x.to_str()) == Some(kind.extension())) .collect(); paths.sort(); let mut removed = Vec::new(); for p in paths { - if is_generated(&p) { + if is_generated(&p, kind) { fs::remove_file(&p)?; removed.push(p); } @@ -58,43 +82,45 @@ pub fn clean_generated_files(directory: &Path) -> io::Result> { Ok(removed) } -/// Refuse a generation run if any target is hand-written. Port of -/// `ensure_generated_paths_writable`. -pub fn ensure_generated_paths_writable(paths: &[PathBuf]) -> Result<(), WriteError> { +/// Refuse a generation run if any target is hand-written (lacks this kind's marker). +pub fn ensure_generated_paths_writable( + paths: &[PathBuf], + kind: GeneratedKind, +) -> Result<(), WriteError> { for path in paths { - if path.exists() && !is_generated(path) { + if path.exists() && !is_generated(path, kind) { return Err(WriteError::Ownership(format!( - "refusing to overwrite hand-written file: {} (no AUTO-GENERATED header). \ + "refusing to overwrite hand-written file: {} (no {:?} AUTO-GENERATED header). \ Remove it by hand if it is a one-time generator-adoption target.", - path.display() + path.display(), + kind ))); } } Ok(()) } -/// Write the rendered SQL `body` to `path`, after refusing to clobber a -/// hand-written file. The SQL templates emit the `-- AUTOMATICALLY GENERATED -/// FILE.` marker as their own first line, so the writer writes `body` verbatim -/// — it does not prepend a header. -pub fn write_generated_file(path: &Path, body: &str) -> Result<(), WriteError> { - ensure_generated_paths_writable(std::slice::from_ref(&path.to_path_buf()))?; - // The template is trusted to carry the ownership marker as its first line, - // but a renderer bug (or a hand-edited template) could drop it — which would - // then defeat `is_generated`/`clean_generated_files`, leaving an unowned file - // the next run refuses to overwrite. Validate the marker before writing. +/// Write `body` to `path` after refusing to clobber a hand-written file. The +/// renderer is trusted to carry `kind.marker()` as the first line; validate it +/// before writing. +pub fn write_generated_file( + path: &Path, + body: &str, + kind: GeneratedKind, +) -> Result<(), WriteError> { + ensure_generated_paths_writable(std::slice::from_ref(&path.to_path_buf()), kind)?; let first = body .lines() .next() .unwrap_or("") .trim_end_matches(['\r', '\n']); - if first != sql_marker() { + if first != kind.marker() { return Err(WriteError::Ownership(format!( - "refusing to write generated file without the AUTO-GENERATED marker as its \ - first line: {} (expected first line {:?}, got {:?}). The SQL template must \ - emit the marker.", + "refusing to write generated file without the {:?} AUTO-GENERATED marker as its \ + first line: {} (expected first line {:?}, got {:?}).", + kind, path.display(), - sql_marker(), + kind.marker(), first ))); } @@ -141,12 +167,43 @@ mod tests { use super::test_support::tempdir as tmp; use super::*; + #[test] + fn is_generated_recognises_rust_marker_and_ignores_sql_in_rs() { + use crate::consts::RUST_GENERATED_MARKER; + let d = tmp(); + let rs = d.path().join("int4.rs"); + fs::write(&rs, format!("{RUST_GENERATED_MARKER}\npub struct Int4;\n")).unwrap(); + assert!(is_generated(&rs, GeneratedKind::Rust)); + assert!(!is_generated(&rs, GeneratedKind::Sql)); + } + + #[test] + fn clean_filters_by_kind_extension() { + use crate::consts::RUST_GENERATED_MARKER; + let d = tmp(); + let gen_rs = d.path().join("int4.rs"); + let gen_sql = d.path().join("int4_types.sql"); + let hand_rs = d.path().join("terms.rs"); + fs::write( + &gen_rs, + format!("{RUST_GENERATED_MARKER}\npub struct Int4;\n"), + ) + .unwrap(); + fs::write(&gen_sql, format!("{AUTO_GENERATED_MARKER}\nSELECT 1;\n")).unwrap(); + fs::write(&hand_rs, "//! hand-written\npub struct Terms;\n").unwrap(); + let removed = clean_generated_files(d.path(), GeneratedKind::Rust).unwrap(); + assert!(!gen_rs.exists()); + assert!(gen_sql.exists(), "different kind, untouched"); + assert!(hand_rs.exists(), "no marker, kept"); + assert_eq!(removed.len(), 1); + } + #[test] fn is_generated_true_for_header() { let d = tmp(); let p = d.path().join("x.sql"); fs::write(&p, format!("{AUTO_GENERATED_MARKER}\nSELECT 1;\n")).unwrap(); - assert!(is_generated(&p)); + assert!(is_generated(&p, GeneratedKind::Sql)); } #[test] @@ -154,16 +211,16 @@ mod tests { let d = tmp(); let p = d.path().join("x.sql"); fs::write(&p, "-- REQUIRE: src/schema.sql\nSELECT 1;\n").unwrap(); - assert!(!is_generated(&p)); + assert!(!is_generated(&p, GeneratedKind::Sql)); } #[test] fn is_generated_true_for_crlf_header() { let d = tmp(); let p = d.path().join("x.sql"); - let marker = sql_marker(); + let marker = GeneratedKind::Sql.marker(); fs::write(&p, format!("{marker}\r\nSELECT 1;\n")).unwrap(); - assert!(is_generated(&p)); + assert!(is_generated(&p, GeneratedKind::Sql)); } #[test] @@ -173,10 +230,10 @@ mod tests { // The template render carries the marker on line 1; the writer writes it // through unchanged. let body = format!("{AUTO_GENERATED_MARKER}\nDO $$ BEGIN END $$;\n"); - write_generated_file(&p, &body).unwrap(); + write_generated_file(&p, &body, GeneratedKind::Sql).unwrap(); let text = fs::read_to_string(&p).unwrap(); assert_eq!(text, body); - assert!(is_generated(&p)); + assert!(is_generated(&p, GeneratedKind::Sql)); } #[test] @@ -186,7 +243,7 @@ mod tests { // A body whose first line is NOT the AUTO-GENERATED marker must be // rejected — the template is required to emit it. let body = "-- REQUIRE: src/v3/schema.sql\nDO $$ BEGIN END $$;\n"; - let err = write_generated_file(&p, body).unwrap_err(); + let err = write_generated_file(&p, body, GeneratedKind::Sql).unwrap_err(); assert!(matches!(err, WriteError::Ownership(_))); assert!(err.to_string().contains("AUTO-GENERATED marker")); assert!( @@ -200,7 +257,8 @@ mod tests { let d = tmp(); let p = d.path().join("int4_types.sql"); fs::write(&p, "-- REQUIRE: src/schema.sql\n-- hand-written\n").unwrap(); - let err = write_generated_file(&p, "DO $$ BEGIN END $$;\n").unwrap_err(); + let err = + write_generated_file(&p, "DO $$ BEGIN END $$;\n", GeneratedKind::Sql).unwrap_err(); assert!(matches!(err, WriteError::Ownership(_))); assert!(err.to_string().contains("hand-written")); } @@ -216,7 +274,9 @@ mod tests { ) .unwrap(); fs::write(&hand, "-- REQUIRE: src/schema.sql\n-- hand-written\n").unwrap(); - let err = ensure_generated_paths_writable(&[generated.clone(), hand.clone()]).unwrap_err(); + let err = + ensure_generated_paths_writable(&[generated.clone(), hand.clone()], GeneratedKind::Sql) + .unwrap_err(); assert!(err.to_string().contains("int4_eq_functions.sql")); assert!(generated.exists()); assert!(hand.exists()); @@ -227,7 +287,12 @@ mod tests { let d = tmp(); let p = d.path().join("int4_types.sql"); fs::write(&p, format!("{AUTO_GENERATED_MARKER}\n-- old content\n")).unwrap(); - write_generated_file(&p, &format!("{AUTO_GENERATED_MARKER}\n-- new content\n")).unwrap(); + write_generated_file( + &p, + &format!("{AUTO_GENERATED_MARKER}\n-- new content\n"), + GeneratedKind::Sql, + ) + .unwrap(); let text = fs::read_to_string(&p).unwrap(); assert!(text.contains("-- new content")); assert!(!text.contains("-- old content")); @@ -242,7 +307,7 @@ mod tests { fs::write(&gen1, format!("{AUTO_GENERATED_MARKER}\nSELECT 1;\n")).unwrap(); fs::write(&gen2, format!("{AUTO_GENERATED_MARKER}\nSELECT 2;\n")).unwrap(); fs::write(&hand, "-- REQUIRE: src/schema.sql\n-- hand-written\n").unwrap(); - let removed = clean_generated_files(d.path()).unwrap(); + let removed = clean_generated_files(d.path(), GeneratedKind::Sql).unwrap(); assert!(!gen1.exists()); assert!(!gen2.exists()); assert!(hand.exists()); @@ -252,7 +317,9 @@ mod tests { #[test] fn clean_on_empty_directory() { let d = tmp(); - assert!(clean_generated_files(d.path()).unwrap().is_empty()); + assert!(clean_generated_files(d.path(), GeneratedKind::Sql) + .unwrap() + .is_empty()); } #[test] @@ -265,7 +332,7 @@ mod tests { fs::write(&blocker, "i am a file\n").unwrap(); let target = blocker.join("int4_types.sql"); // parent is a file let body = format!("{AUTO_GENERATED_MARKER}\nDO $$ BEGIN END $$;\n"); - let err = write_generated_file(&target, &body).unwrap_err(); + let err = write_generated_file(&target, &body, GeneratedKind::Sql).unwrap_err(); assert!(matches!(err, WriteError::Io(_)), "expected Io, got {err:?}"); assert!(err.to_string().starts_with("io error: ")); } From 24a276528fd7863845bccdf8effdf011fb47099a Mon Sep 17 00:00:00 2001 From: Toby Hede Date: Mon, 29 Jun 2026 17:00:29 +1000 Subject: [PATCH 04/12] refactor(eql-bindings): split DomainType trait + all() out of mod.rs Move the trait/consts/PhantomData impl into hand-written domain_type.rs and the all() inventory into inventory.rs (re-exported at crate::v3, public paths unchanged). Relocate the non-catalog-derivable float NaN and bool storage-only caveats into the hand-written mod.rs doc so the generated per-family modules don't drop them at cutover. mod.rs stays hand-written. types:check green. --- crates/eql-bindings/src/v3/domain_type.rs | 85 +++++++++++++ crates/eql-bindings/src/v3/inventory.rs | 55 ++++++++ crates/eql-bindings/src/v3/mod.rs | 147 ++++------------------ 3 files changed, 165 insertions(+), 122 deletions(-) create mode 100644 crates/eql-bindings/src/v3/domain_type.rs create mode 100644 crates/eql-bindings/src/v3/inventory.rs diff --git a/crates/eql-bindings/src/v3/domain_type.rs b/crates/eql-bindings/src/v3/domain_type.rs new file mode 100644 index 000000000..c9a022756 --- /dev/null +++ b/crates/eql-bindings/src/v3/domain_type.rs @@ -0,0 +1,85 @@ +//! The hand-written `DomainType` trait and its `PhantomData` enumeration +//! plumbing — the stable, NON-generated core of the v3 bindings surface. The +//! per-family payload structs and the `inventory.rs` `all()` list are generated +//! from `eql-domains::CATALOG` by `eql-codegen`; this trait, the schema-id base, +//! and the blanket `PhantomData` impl are authored by hand. + +use std::marker::PhantomData; + +use schemars::{schema_for, JsonSchema, Schema}; + +/// The PostgreSQL schema every domain in this module inhabits. +pub const SQL_SCHEMA: &str = "eql_v3"; + +/// Base URL for the canonical `$id` of every published v3 JSON Schema. +/// The per-domain `$id` is `{SCHEMA_ID_BASE}{domain}.json` (see +/// [`DomainType::schema_id`]); `tests/export.rs` injects it at write time. +pub const SCHEMA_ID_BASE: &str = "https://schemas.cipherstash.com/eql/v3/"; + +/// One v3 domain type — implemented by every payload type, so any payload +/// value can report the SQL domain it inhabits (`payload.sql_domain()`). +/// +/// Each token file implements this next to the type it describes; the SQL +/// domain string is defined exactly once, in that impl, and +/// `tests/catalog_parity.rs` cross-checks every entry of [`all`] against +/// `eql-domains::CATALOG` — a typo'd or mis-ordered domain fails there. +/// Public so FFI consumers can enumerate the protocol surface too. +/// +/// [`all`]: super::all +pub trait DomainType { + /// Fully-qualified SQL domain name, e.g. `"eql_v3.int4_eq"` — the + /// per-type fact everything else derives from, defined once in each + /// type's impl. + /// + /// `where Self: Sized` keeps the trait object-safe (the method is + /// excluded from the vtable); through `dyn DomainType`, use + /// [`Self::sql_domain`]. + fn sql_domain_static() -> &'static str + where + Self: Sized; + + /// Fully-qualified SQL domain name of this payload value. + fn sql_domain(&self) -> &'static str; + + /// Unqualified SQL domain name (e.g. `"int4_eq"`) — [`Self::sql_domain`] + /// minus the schema qualifier; matches `eql-domains` + /// `DomainFamily::domain_name`. + fn domain(&self) -> &'static str { + self.sql_domain() + .strip_prefix("eql_v3.") + .expect("sql_domain must be qualified with the eql_v3 schema") + } + + /// Canonical `$id` for this domain's published JSON Schema — + /// `{SCHEMA_ID_BASE}{domain}.json`. The single source of truth for the + /// identity `tests/export.rs` injects; pinned by `tests/catalog_parity.rs`. + fn schema_id(&self) -> String { + format!("{SCHEMA_ID_BASE}{}.json", self.domain()) + } + + /// The type's JSON Schema. + fn schema(&self) -> Schema; +} + +/// Type-level handle: lets [`all`] enumerate the domain types without +/// payload values to box — `Box::new(PhantomData::)` is zero-sized, +/// and the delegation goes through [`DomainType::sql_domain_static`], so no +/// payload instance is ever constructed. +/// +/// [`all`]: super::all +impl DomainType for PhantomData +where + T: DomainType + JsonSchema, +{ + fn sql_domain_static() -> &'static str { + T::sql_domain_static() + } + + fn sql_domain(&self) -> &'static str { + T::sql_domain_static() + } + + fn schema(&self) -> Schema { + schema_for!(T) + } +} diff --git a/crates/eql-bindings/src/v3/inventory.rs b/crates/eql-bindings/src/v3/inventory.rs new file mode 100644 index 000000000..51193182b --- /dev/null +++ b/crates/eql-bindings/src/v3/inventory.rs @@ -0,0 +1,55 @@ +//! The `all()` inventory — every v3 domain payload type in `eql-domains::CATALOG` +//! order. Moved out of `mod.rs` so PR 4's emitter can own it: this hand-written +//! version is REPLACED by `eql-codegen` output (`// @generated`) at cutover +//! (Task 8). The architectural module doc + `pub mod` decls stay in the +//! hand-written `mod.rs`. + +use std::marker::PhantomData; + +use super::domain_type::DomainType; +use super::{bool, date, float4, float8, int2, int4, int8, numeric, text, timestamptz}; + +/// Every v3 domain type, in `eql-domains::CATALOG` order. +pub fn all() -> Vec> { + vec![ + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + ] +} diff --git a/crates/eql-bindings/src/v3/mod.rs b/crates/eql-bindings/src/v3/mod.rs index 73219042c..98fe3b7ac 100644 --- a/crates/eql-bindings/src/v3/mod.rs +++ b/crates/eql-bindings/src/v3/mod.rs @@ -43,138 +43,41 @@ //! mode this tier exists to retire, and `_ord` vs `_ord_ore` are identical //! shapes that no sniffing can separate. Consumers read from a typed column //! and already know the domain. - -use std::marker::PhantomData; - -use schemars::{schema_for, JsonSchema, Schema}; +//! +//! ## Per-family caller-facing notes +//! +//! These are not derivable from the catalog and are documented here because the +//! per-family modules are generated. +//! +//! **`float8` / `float4` special values.** `-0.0` canonicalizes to `+0.0` +//! (equal under `=`, IEEE-consistent) and `±Inf` order correctly +//! (`-Inf < finite < +Inf`). **NaN is unordered and unspecified in the +//! encoder**: it can be encrypted, stored, and pass the domain CHECK, but it +//! carries **no comparison guarantee** and does NOT follow IEEE semantics. The +//! domain CHECK validates only the envelope — it cannot inspect the ciphertext +//! — so a NaN payload is never rejected server-side. **Reject NaN client-side +//! before encryption** if your column must not contain it; otherwise a NaN row +//! sorts at an arbitrary (but deterministic) position in an encrypted range +//! scan. See the `float_special` regression suite for the locked behaviour. +//! +//! **`bool` is storage-only by design.** It has no `_eq`/`_ord` domain and +//! carries no index term: a two-value column has so little cardinality that any +//! searchable index (even HMAC equality) would trivially leak the plaintext +//! distribution. The payload is `{v,i,c}` only and every operator is blocked. pub mod bool; pub mod date; +pub mod domain_type; pub mod float4; pub mod float8; pub mod int2; pub mod int4; pub mod int8; +pub mod inventory; pub mod numeric; pub mod terms; pub mod text; pub mod timestamptz; -/// The PostgreSQL schema every domain in this module inhabits. -pub const SQL_SCHEMA: &str = "eql_v3"; - -/// Base URL for the canonical `$id` of every published v3 JSON Schema. -/// The per-domain `$id` is `{SCHEMA_ID_BASE}{domain}.json` (see -/// [`DomainType::schema_id`]); `tests/export.rs` injects it at write time. -pub const SCHEMA_ID_BASE: &str = "https://schemas.cipherstash.com/eql/v3/"; - -/// One v3 domain type — implemented by every payload type, so any payload -/// value can report the SQL domain it inhabits (`payload.sql_domain()`). -/// -/// Each token file implements this next to the type it describes; the SQL -/// domain string is defined exactly once, in that impl, and -/// `tests/catalog_parity.rs` cross-checks every entry of [`all`] against -/// `eql-domains::CATALOG` — a typo'd or mis-ordered domain fails there. -/// Public so FFI consumers can enumerate the protocol surface too. -pub trait DomainType { - /// Fully-qualified SQL domain name, e.g. `"eql_v3.int4_eq"` — the - /// per-type fact everything else derives from, defined once in each - /// type's impl. - /// - /// `where Self: Sized` keeps the trait object-safe (the method is - /// excluded from the vtable); through `dyn DomainType`, use - /// [`Self::sql_domain`]. - fn sql_domain_static() -> &'static str - where - Self: Sized; - - /// Fully-qualified SQL domain name of this payload value. - fn sql_domain(&self) -> &'static str; - - /// Unqualified SQL domain name (e.g. `"int4_eq"`) — [`Self::sql_domain`] - /// minus the schema qualifier; matches `eql-domains` - /// `DomainFamily::domain_name`. - fn domain(&self) -> &'static str { - self.sql_domain() - .strip_prefix("eql_v3.") - .expect("sql_domain must be qualified with the eql_v3 schema") - } - - /// Canonical `$id` for this domain's published JSON Schema — - /// `{SCHEMA_ID_BASE}{domain}.json`. The single source of truth for the - /// identity `tests/export.rs` injects; pinned by `tests/catalog_parity.rs`. - fn schema_id(&self) -> String { - format!("{SCHEMA_ID_BASE}{}.json", self.domain()) - } - - /// The type's JSON Schema. - fn schema(&self) -> Schema; -} - -/// Type-level handle: lets [`all`] enumerate the domain types without -/// payload values to box — `Box::new(PhantomData::)` is zero-sized, -/// and the delegation goes through [`DomainType::sql_domain_static`], so no -/// payload instance is ever constructed. -impl DomainType for PhantomData -where - T: DomainType + JsonSchema, -{ - fn sql_domain_static() -> &'static str { - T::sql_domain_static() - } - - fn sql_domain(&self) -> &'static str { - T::sql_domain_static() - } - - fn schema(&self) -> Schema { - schema_for!(T) - } -} - -/// Every v3 domain type, in `eql-domains::CATALOG` order (token order, then -/// each token's domains in manifest order) — the one hand-maintained list of -/// types in the crate. -pub fn all() -> Vec> { - vec![ - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - ] -} +pub use domain_type::{DomainType, SCHEMA_ID_BASE, SQL_SCHEMA}; +pub use inventory::all; From 0c6acad5f07cff2eb3ef9689d1c9cdd23d4e7c75 Mon Sep 17 00:00:00 2001 From: Toby Hede Date: Mon, 29 Jun 2026 17:02:34 +1000 Subject: [PATCH 05/12] feat(eql-domains): Term::binding_newtype + Term::payload_terms The term->binding-newtype mapping (Hm->Hmac256, Ore->OreBlock256, Bloom->BloomFilter) is wire-contract data, so it lives on Term beside json_key/ctor/extractor (unit-tested). payload_terms returns the distinct field-bearing terms in wire order. PR 4's bindings emitter matches on these instead of a &str round-trip, keeping it exhaustive at compile time. --- crates/eql-domains/src/term.rs | 58 ++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/crates/eql-domains/src/term.rs b/crates/eql-domains/src/term.rs index 3b4a0ce61..fb8a0f94d 100644 --- a/crates/eql-domains/src/term.rs +++ b/crates/eql-domains/src/term.rs @@ -33,6 +33,20 @@ impl Term { } } + /// The shared binding newtype carrying this term's payload field on the + /// wire (`Hmac256` for `hm`, `OreBlock256` for `ob`, `BloomFilter` for + /// `bf`). Part of the structural wire contract, beside [`Term::json_key`]/ + /// [`Term::ctor`] — a new term names its newtype HERE, so the bindings + /// emitter (which matches on `Term`) stays exhaustive at compile time + /// instead of panicking at codegen runtime on an unmapped key. + pub const fn binding_newtype(self) -> &'static str { + match self { + Term::Hm => "Hmac256", + Term::Ore => "OreBlock256", + Term::Bloom => "BloomFilter", + } + } + /// Generated-file [`Role`] contributed by this single term. A domain's role /// is the richest of its terms' roles — see [`Term::role_for_terms`]. pub const fn role(self) -> Role { @@ -110,6 +124,23 @@ impl Term { Self::dedupe_preserving_order(terms.iter().map(|t| t.json_key())) } + /// The distinct terms contributing a payload field, in wire order: one per + /// [`Term::json_key`], deduped first-occurrence-wins. Symmetric to + /// [`Term::term_json_keys`] but returns the `Term`s, so the bindings emitter + /// reads both the field key ([`Term::json_key`]) and its newtype + /// ([`Term::binding_newtype`]) while matching on the enum. + pub fn payload_terms(terms: &[Term]) -> Vec { + let mut seen: Vec<&str> = Vec::new(); + let mut out: Vec = Vec::new(); + for &t in terms { + if !seen.contains(&t.json_key()) { + seen.push(t.json_key()); + out.push(t); + } + } + out + } + /// JSON keys whose payload must be a non-empty array across these terms /// (deduped, in order). Symmetric to [`Term::term_json_keys`]; drives the /// domain CHECK's non-empty-array clauses. See [`Term::nonempty_array_key`]. @@ -162,3 +193,30 @@ impl Term { .unwrap_or(Role::Storage) } } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn binding_newtype_maps_each_term() { + assert_eq!(Term::Hm.binding_newtype(), "Hmac256"); + assert_eq!(Term::Ore.binding_newtype(), "OreBlock256"); + assert_eq!(Term::Bloom.binding_newtype(), "BloomFilter"); + } + + #[test] + fn payload_terms_is_one_field_per_json_key_in_order() { + let keys: Vec<&str> = Term::payload_terms(&[Term::Hm, Term::Ore]) + .iter() + .map(|t| t.json_key()) + .collect(); + assert_eq!(keys, ["hm", "ob"]); + let keys: Vec<&str> = Term::payload_terms(&[Term::Hm, Term::Hm]) + .iter() + .map(|t| t.json_key()) + .collect(); + assert_eq!(keys, ["hm"]); + assert!(Term::payload_terms(&[]).is_empty()); + } +} From 82b10207f0bc3f0774ab136f7ae0e94dd43e1f6a Mon Sep 17 00:00:00 2001 From: Toby Hede Date: Mon, 29 Jun 2026 17:04:13 +1000 Subject: [PATCH 06/12] feat(eql-codegen): emit per-family payload structs from the catalog render_family_bindings renders each DomainFamily to its struct set + three- method DomainType impls (schema -> schemars::Schema, 1.x), with pinned envelope-then-term field order (Term::payload_terms, matching on the enum), the canonical derive/ts/serde attributes, a precise term-newtype import set, and one catalog-derived struct doc line (no field docs). --- crates/eql-codegen/src/bindings.rs | 215 +++++++++++++++++++++++++++++ 1 file changed, 215 insertions(+) diff --git a/crates/eql-codegen/src/bindings.rs b/crates/eql-codegen/src/bindings.rs index 19e631eea..a1a629317 100644 --- a/crates/eql-codegen/src/bindings.rs +++ b/crates/eql-codegen/src/bindings.rs @@ -7,6 +7,9 @@ //! the `// @generated` ownership marker prepended as line 1. use proc_macro2::TokenStream; +use quote::{format_ident, quote}; + +use eql_domains::{Domain, DomainFamily, Term}; use crate::consts::RUST_GENERATED_MARKER; @@ -53,11 +56,223 @@ fn rustfmt(src: &str) -> String { String::from_utf8(out.stdout).expect("rustfmt output is UTF-8") } +/// PascalCase a snake_case domain name: "int4_ord_ore" -> "Int4OrdOre". +fn pascal(name: &str) -> String { + name.split('_') + .filter(|s| !s.is_empty()) + .map(|s| { + let mut chars = s.chars(); + match chars.next() { + Some(first) => first.to_uppercase().collect::() + chars.as_str(), + None => String::new(), + } + }) + .collect() +} + +/// Capability label for a domain's single catalog-derived doc line, keyed on +/// the bare domain name. Parallels the SQL emitter's per-domain `--! @brief`. +fn capability_label(domain_name: &str) -> &'static str { + match domain_name { + "" => "storage-only domain", + "eq" => "equality domain", + "ord" | "ord_ore" => "ordering domain", + "match" => "match domain", + "search" => "search domain", + _ => "encrypted domain", + } +} + +/// One payload struct + its three-method `DomainType` impl. One struct doc +/// line, no field docs. Term fields come from `Term::payload_terms`, matching +/// on the enum for the field key and its newtype. The `schema` method returns +/// `schemars::Schema` (1.x). +fn render_struct(family: &DomainFamily, domain: &Domain) -> TokenStream { + let full = domain.full_name(family.name); + let ident = format_ident!("{}", pascal(&full)); + let sql_domain = format!("eql_v3.{full}"); + let sdoc = format!("`eql_v3.{full}` — {}.", capability_label(domain.name)); + + let mut fields = TokenStream::new(); + fields.extend(quote! { pub v: SchemaVersion, }); + fields.extend(quote! { pub i: Identifier, }); + fields.extend(quote! { pub c: Ciphertext, }); + for term in Term::payload_terms(domain.terms) { + let fid = format_ident!("{}", term.json_key()); + let tid = format_ident!("{}", term.binding_newtype()); + fields.extend(quote! { pub #fid: #tid, }); + } + + quote! { + #[doc = #sdoc] + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] + #[ts(export, export_to = "v3/")] + #[serde(deny_unknown_fields)] + pub struct #ident { + #fields + } + + impl DomainType for #ident { + fn sql_domain_static() -> &'static str { + #sql_domain + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn schema(&self) -> Schema { + schema_for!(#ident) + } + } + } +} + +/// Render a whole family module (`int4.rs`, `text.rs`, …): the import header +/// (exactly the term newtypes the family uses) followed by every domain's +/// struct + impl. +pub fn render_family_bindings(family: &DomainFamily) -> String { + let mut used: Vec<&'static str> = vec!["Ciphertext"]; + for d in family.domains { + for term in Term::payload_terms(d.terms) { + let t = term.binding_newtype(); + if !used.contains(&t) { + used.push(t); + } + } + } + let used_idents: Vec<_> = used.iter().map(|t| format_ident!("{t}")).collect(); + + let structs: TokenStream = family + .domains + .iter() + .map(|d| render_struct(family, d)) + .collect(); + + let mod_doc = format!( + "The `{}` encrypted-domain family — generated from the eql-domains catalog.", + family.name + ); + + let file = quote! { + #![doc = #mod_doc] + + use schemars::{schema_for, Schema}; + + use crate::v3::terms::{ #(#used_idents),* }; + use crate::v3::DomainType; + use crate::{Identifier, SchemaVersion}; + use schemars::JsonSchema; + use serde::{Deserialize, Serialize}; + use ts_rs::TS; + + #structs + }; + + format_rs(file) +} + #[cfg(test)] mod tests { use super::*; + use eql_domains::CATALOG; use quote::quote; + fn family(name: &str) -> &'static eql_domains::DomainFamily { + CATALOG.iter().find(|f| f.name == name).expect("family") + } + + /// Declared field idents of `struct_name` in generated source, in order. + fn field_idents(src: &str, struct_name: &str) -> Vec { + let file = syn::parse_file(src).expect("generated source parses"); + for item in &file.items { + if let syn::Item::Struct(s) = item { + if s.ident == struct_name { + return s + .fields + .iter() + .map(|f| f.ident.as_ref().expect("named field").to_string()) + .collect(); + } + } + } + panic!("struct {struct_name} not found in generated source"); + } + + #[test] + fn int4_family_structs_have_pinned_shape() { + let out = render_family_bindings(family("int4")); + assert!(out.starts_with(crate::consts::RUST_GENERATED_MARKER)); + for s in [ + "struct Int4 ", + "struct Int4Eq ", + "struct Int4OrdOre ", + "struct Int4Ord ", + ] { + assert!(out.contains(s), "missing {s}"); + } + assert_eq!( + out.matches( + "#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)]" + ) + .count(), + 4 + ); + assert_eq!(out.matches("#[ts(export, export_to = \"v3/\")]").count(), 4); + assert_eq!(out.matches("#[serde(deny_unknown_fields)]").count(), 4); + assert!(out.contains("`eql_v3.int4_eq` — equality domain.")); + assert!(out.contains("`eql_v3.int4` — storage-only domain.")); + assert!(out.contains("`eql_v3.int4_ord` — ordering domain.")); + assert!(!out.contains("Envelope version")); + assert!(!out.contains("HMAC-SHA-256 equality term")); + assert_eq!(field_idents(&out, "Int4"), ["v", "i", "c"]); + assert_eq!(field_idents(&out, "Int4Eq"), ["v", "i", "c", "hm"]); + assert_eq!(field_idents(&out, "Int4OrdOre"), ["v", "i", "c", "ob"]); + assert_eq!(field_idents(&out, "Int4Ord"), ["v", "i", "c", "ob"]); + assert!(out.contains("impl DomainType for Int4Eq")); + assert!(out.contains("fn sql_domain_static()")); + assert!(out.contains("\"eql_v3.int4_eq\"")); + assert!(out.contains("fn sql_domain(&self)")); + assert!(out.contains("fn schema(&self) -> Schema")); + assert!(out.contains("schema_for!(Int4Eq)")); + assert!(out.contains("use crate::v3::terms::")); + assert!(!out.contains("BloomFilter")); + } + + #[test] + fn text_family_includes_bloom_and_dual_term_ord() { + let out = render_family_bindings(family("text")); + for s in [ + "struct Text ", + "struct TextEq ", + "struct TextMatch ", + "struct TextOrdOre ", + "struct TextOrd ", + "struct TextSearch ", + ] { + assert!(out.contains(s), "missing {s}"); + } + assert!(out.contains("`eql_v3.text_match` — match domain.")); + assert!(out.contains("`eql_v3.text_search` — search domain.")); + assert!(out.contains("bf: BloomFilter")); + assert_eq!(field_idents(&out, "TextOrd"), ["v", "i", "c", "hm", "ob"]); + assert_eq!(field_idents(&out, "TextMatch"), ["v", "i", "c", "bf"]); + assert_eq!( + field_idents(&out, "TextSearch"), + ["v", "i", "c", "hm", "ob", "bf"] + ); + } + + #[test] + fn bool_storage_only_family_has_one_struct_no_terms() { + let out = render_family_bindings(family("bool")); + assert_eq!(out.matches("pub struct ").count(), 1); + assert!(out.contains("`eql_v3.bool` — storage-only domain.")); + assert_eq!(field_idents(&out, "Bool"), ["v", "i", "c"]); + assert!(out.contains("use crate::v3::terms::")); + assert!(!out.contains("Hmac256")); + assert!(!out.contains("OreBlock256")); + assert!(!out.contains("BloomFilter")); + } + #[test] fn format_rs_prepends_marker_and_is_rustfmt_clean() { // Deliberately mis-spaced input: rustfmt must normalize it, proving the From eb0d650d1d777132f30141ef6c886816f1fdf2af Mon Sep 17 00:00:00 2001 From: Toby Hede Date: Mon, 29 Jun 2026 17:05:15 +1000 Subject: [PATCH 07/12] feat(eql-codegen): emit the v3 inventory.rs all() from the catalog render_inventory_rs generates all() in CATALOG order (entries via super::), replacing the hand-maintained inventory. mod.rs stays hand-written (module doc + pub mod decls + re-exports). --- crates/eql-codegen/src/bindings.rs | 72 +++++++++++++++++++++++++++++- 1 file changed, 71 insertions(+), 1 deletion(-) diff --git a/crates/eql-codegen/src/bindings.rs b/crates/eql-codegen/src/bindings.rs index a1a629317..f4c1ca621 100644 --- a/crates/eql-codegen/src/bindings.rs +++ b/crates/eql-codegen/src/bindings.rs @@ -9,7 +9,7 @@ use proc_macro2::TokenStream; use quote::{format_ident, quote}; -use eql_domains::{Domain, DomainFamily, Term}; +use eql_domains::{Domain, DomainFamily, Term, CATALOG}; use crate::consts::RUST_GENERATED_MARKER; @@ -170,6 +170,49 @@ pub fn render_family_bindings(family: &DomainFamily) -> String { format_rs(file) } +/// Render the generated `crates/eql-bindings/src/v3/inventory.rs`: just `all()` +/// in CATALOG order, referencing the family structs through `super::`. The +/// `pub mod` declarations, the trait re-export, the trait/newtypes, and the +/// architectural module doc all stay hand-written (mod.rs / domain_type.rs / +/// terms.rs). +pub fn render_inventory_rs() -> String { + let all_entries: TokenStream = CATALOG + .iter() + .flat_map(|f| { + let m = format_ident!("{}", f.name); + f.domains + .iter() + .map(move |d| { + let s = format_ident!("{}", pascal(&d.full_name(f.name))); + quote! { Box::new(PhantomData::), } + }) + .collect::>() + }) + .collect(); + + let mod_doc = "The `all()` inventory — every v3 domain payload type in \ + eql-domains::CATALOG order. Generated from the catalog; the \ + DomainType trait, the shared newtypes, and the architectural \ + module doc stay hand-written (domain_type.rs / terms.rs / mod.rs)."; + + let file = quote! { + #![doc = #mod_doc] + + use std::marker::PhantomData; + + use super::domain_type::DomainType; + + /// Every v3 domain type, in `eql-domains::CATALOG` order — generated. + pub fn all() -> Vec> { + vec![ + #all_entries + ] + } + }; + + format_rs(file) +} + #[cfg(test)] mod tests { use super::*; @@ -273,6 +316,33 @@ mod tests { assert!(!out.contains("BloomFilter")); } + #[test] + fn inventory_enumerates_all_in_catalog_order() { + let out = render_inventory_rs(); + assert!(out.starts_with(crate::consts::RUST_GENERATED_MARKER)); + assert!(out.contains("pub fn all() -> Vec>")); + assert!(!out.contains("pub mod ")); + let first = out.find("PhantomData::").unwrap(); + let last = out.find("PhantomData::").unwrap(); + assert!(first < last); + for ty in [ + "super::text::Text", + "super::text::TextEq", + "super::text::TextMatch", + "super::text::TextOrdOre", + "super::text::TextOrd", + "super::text::TextSearch", + ] { + assert!( + out.contains(&format!("PhantomData::<{ty}>")), + "missing {ty}" + ); + } + let entries = out.matches("Box::new(PhantomData::<").count(); + let domains: usize = eql_domains::CATALOG.iter().map(|f| f.domains.len()).sum(); + assert_eq!(entries, domains); + } + #[test] fn format_rs_prepends_marker_and_is_rustfmt_clean() { // Deliberately mis-spaced input: rustfmt must normalize it, proving the From 27f312d3ac95b7db2b3ba6a07caedbd5da705b72 Mon Sep 17 00:00:00 2001 From: Toby Hede Date: Mon, 29 Jun 2026 17:06:22 +1000 Subject: [PATCH 08/12] feat(eql-codegen): generate_bindings orchestrator + bindings subcommand generate_bindings writes one .rs per catalog family + inventory.rs under crates/eql-bindings/src/v3 (GeneratedKind::Rust ownership). Exposed as `eql-codegen bindings`; the default no-arg run stays SQL-only so build / codegen:parity are unaffected. --- crates/eql-codegen/src/bindings.rs | 60 ++++++++++++++++++++++++++++++ crates/eql-codegen/src/main.rs | 21 +++++++++++ 2 files changed, 81 insertions(+) diff --git a/crates/eql-codegen/src/bindings.rs b/crates/eql-codegen/src/bindings.rs index f4c1ca621..a760836b4 100644 --- a/crates/eql-codegen/src/bindings.rs +++ b/crates/eql-codegen/src/bindings.rs @@ -6,12 +6,18 @@ //! `rustfmt` (prettyplease is rustfmt-clean but not rustfmt-identical), with //! the `// @generated` ownership marker prepended as line 1. +use std::path::{Path, PathBuf}; + use proc_macro2::TokenStream; use quote::{format_ident, quote}; use eql_domains::{Domain, DomainFamily, Term, CATALOG}; use crate::consts::RUST_GENERATED_MARKER; +use crate::writer::{ + clean_generated_files, ensure_generated_paths_writable, write_generated_file, GeneratedKind, + WriteError, +}; /// Format a token stream into committed Rust source. `prettyplease::unparse` /// gives deterministic, parseable output; the `@generated` marker is prepended @@ -213,6 +219,38 @@ pub fn render_inventory_rs() -> String { format_rs(file) } +/// Relative path (from repo root) of the generated v3 bindings directory. +const V3_BINDINGS_DIR: &str = "crates/eql-bindings/src/v3"; + +/// Regenerate every committed Rust binding file under `out_root`: one +/// `.rs` per catalog family plus the `inventory.rs` `all()` list. +/// Hand-written `terms.rs` / `domain_type.rs` / `mod.rs` carry no marker, so +/// they are never cleaned or clobbered. Returns the written paths. +pub fn generate_bindings(out_root: &Path) -> Result, WriteError> { + let dir = out_root.join(V3_BINDINGS_DIR); + + let mut targets: Vec = CATALOG + .iter() + .map(|f| dir.join(format!("{}.rs", f.name))) + .collect(); + targets.push(dir.join("inventory.rs")); + + ensure_generated_paths_writable(&targets, GeneratedKind::Rust)?; + clean_generated_files(&dir, GeneratedKind::Rust)?; + + let mut written = Vec::new(); + for f in CATALOG { + let p = dir.join(format!("{}.rs", f.name)); + write_generated_file(&p, &render_family_bindings(f), GeneratedKind::Rust)?; + written.push(p); + } + let invp = dir.join("inventory.rs"); + write_generated_file(&invp, &render_inventory_rs(), GeneratedKind::Rust)?; + written.push(invp); + + Ok(written) +} + #[cfg(test)] mod tests { use super::*; @@ -316,6 +354,28 @@ mod tests { assert!(!out.contains("BloomFilter")); } + #[test] + fn generate_bindings_writes_family_files_and_inventory_with_markers() { + let tmp = crate::writer::test_support::tempdir(); + let written = generate_bindings(tmp.path()).unwrap(); + let dir = tmp.path().join("crates/eql-bindings/src/v3"); + assert_eq!(written.len(), eql_domains::CATALOG.len() + 1); + assert!(dir.join("int4.rs").is_file()); + assert!(dir.join("text.rs").is_file()); + assert!(dir.join("inventory.rs").is_file()); + assert!( + !dir.join("mod.rs").exists(), + "mod.rs stays hand-written; not generated" + ); + for p in &written { + let body = std::fs::read_to_string(p).unwrap(); + assert!( + body.starts_with(crate::consts::RUST_GENERATED_MARKER), + "{p:?}" + ); + } + } + #[test] fn inventory_enumerates_all_in_catalog_order() { let out = render_inventory_rs(); diff --git a/crates/eql-codegen/src/main.rs b/crates/eql-codegen/src/main.rs index 336b0ac04..30085c870 100644 --- a/crates/eql-codegen/src/main.rs +++ b/crates/eql-codegen/src/main.rs @@ -27,6 +27,26 @@ fn main() -> ExitCode { return ExitCode::SUCCESS; } + // `bindings`: regenerate the committed Rust payload bindings under + // crates/eql-bindings/src/v3. The default no-arg run stays SQL-only; this + // is wired as the first step of `mise run types:generate`. + if args.len() == 2 && args[1] == "bindings" { + match eql_codegen::bindings::generate_bindings(&repo_root()) { + Ok(written) => { + for p in &written { + let rel = p.strip_prefix(repo_root()).unwrap_or(p); + println!("generated {}", rel.display()); + } + println!("bindings: ok ({} files)", written.len()); + return ExitCode::SUCCESS; + } + Err(e) => { + eprintln!("error: {e}"); + return ExitCode::FAILURE; + } + } + } + if args.len() == 1 { // No args: generate every type's gitignored SQL surface. match generate_all(&repo_root()) { @@ -42,5 +62,6 @@ fn main() -> ExitCode { eprintln!("Usage: eql-codegen (generate all types)"); eprintln!(" eql-codegen list-types (print catalog tokens)"); eprintln!(" eql-codegen dump-catalog (print catalog surface as JSON)"); + eprintln!(" eql-codegen bindings (regenerate eql-bindings Rust payload types)"); ExitCode::from(2) } From d4bbc0a6b4a3530e422c126c9e972e91455751c8 Mon Sep 17 00:00:00 2001 From: Toby Hede Date: Mon, 29 Jun 2026 19:08:57 +1000 Subject: [PATCH 09/12] feat(eql-bindings): generate v3 payload bindings from the catalog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit One Rust payload struct per eql_v3 SQL domain, generated by eql-codegen from eql-domains::CATALOG, with ts-rs/schemars deriving the committed TypeScript and JSON Schema. Each struct carries a catalog-derived doc — a summary line plus the supported operators and required payload keys (capability label, Term::operators_for_terms, ENVELOPE_KEYS ++ Term::term_json_keys); the keys list surfaces structural distinctions such as text's dual-term ordered domains (hm + ob) versus the integer ordered domains (ob). No per-field docs: per-term semantics live on the shared term newtypes and non-derivable per-family caveats in mod.rs. mise run types:generate regenerates Rust then TS/JSON; types:check is the committed-reference drift gate. --- crates/eql-bindings/bindings/v3/Bool.ts | 19 +- crates/eql-bindings/bindings/v3/Date.ts | 19 +- crates/eql-bindings/bindings/v3/DateEq.ts | 23 +- crates/eql-bindings/bindings/v3/DateOrd.ts | 23 +- crates/eql-bindings/bindings/v3/DateOrdOre.ts | 23 +- crates/eql-bindings/bindings/v3/Float4.ts | 19 +- crates/eql-bindings/bindings/v3/Float4Eq.ts | 23 +- crates/eql-bindings/bindings/v3/Float4Ord.ts | 23 +- .../eql-bindings/bindings/v3/Float4OrdOre.ts | 23 +- crates/eql-bindings/bindings/v3/Float8.ts | 19 +- crates/eql-bindings/bindings/v3/Float8Eq.ts | 23 +- crates/eql-bindings/bindings/v3/Float8Ord.ts | 23 +- .../eql-bindings/bindings/v3/Float8OrdOre.ts | 23 +- crates/eql-bindings/bindings/v3/Int2.ts | 19 +- crates/eql-bindings/bindings/v3/Int2Eq.ts | 23 +- crates/eql-bindings/bindings/v3/Int2Ord.ts | 23 +- crates/eql-bindings/bindings/v3/Int2OrdOre.ts | 23 +- crates/eql-bindings/bindings/v3/Int4.ts | 19 +- crates/eql-bindings/bindings/v3/Int4Eq.ts | 23 +- crates/eql-bindings/bindings/v3/Int4Ord.ts | 23 +- crates/eql-bindings/bindings/v3/Int4OrdOre.ts | 25 +- crates/eql-bindings/bindings/v3/Int8.ts | 19 +- crates/eql-bindings/bindings/v3/Int8Eq.ts | 23 +- crates/eql-bindings/bindings/v3/Int8Ord.ts | 23 +- crates/eql-bindings/bindings/v3/Int8OrdOre.ts | 23 +- crates/eql-bindings/bindings/v3/Numeric.ts | 19 +- crates/eql-bindings/bindings/v3/NumericEq.ts | 23 +- crates/eql-bindings/bindings/v3/NumericOrd.ts | 23 +- .../eql-bindings/bindings/v3/NumericOrdOre.ts | 23 +- crates/eql-bindings/bindings/v3/Text.ts | 19 +- crates/eql-bindings/bindings/v3/TextEq.ts | 23 +- crates/eql-bindings/bindings/v3/TextMatch.ts | 23 +- crates/eql-bindings/bindings/v3/TextOrd.ts | 29 +- crates/eql-bindings/bindings/v3/TextOrdOre.ts | 30 +- crates/eql-bindings/bindings/v3/TextSearch.ts | 33 +-- .../eql-bindings/bindings/v3/Timestamptz.ts | 19 +- .../eql-bindings/bindings/v3/TimestamptzEq.ts | 23 +- .../bindings/v3/TimestamptzOrd.ts | 23 +- .../bindings/v3/TimestamptzOrdOre.ts | 23 +- crates/eql-bindings/schema/v3/bool.json | 11 +- crates/eql-bindings/schema/v3/date.json | 11 +- crates/eql-bindings/schema/v3/date_eq.json | 14 +- crates/eql-bindings/schema/v3/date_ord.json | 14 +- .../eql-bindings/schema/v3/date_ord_ore.json | 14 +- crates/eql-bindings/schema/v3/float4.json | 11 +- crates/eql-bindings/schema/v3/float4_eq.json | 14 +- crates/eql-bindings/schema/v3/float4_ord.json | 14 +- .../schema/v3/float4_ord_ore.json | 14 +- crates/eql-bindings/schema/v3/float8.json | 11 +- crates/eql-bindings/schema/v3/float8_eq.json | 14 +- crates/eql-bindings/schema/v3/float8_ord.json | 14 +- .../schema/v3/float8_ord_ore.json | 14 +- crates/eql-bindings/schema/v3/int2.json | 11 +- crates/eql-bindings/schema/v3/int2_eq.json | 14 +- crates/eql-bindings/schema/v3/int2_ord.json | 14 +- .../eql-bindings/schema/v3/int2_ord_ore.json | 14 +- crates/eql-bindings/schema/v3/int4.json | 11 +- crates/eql-bindings/schema/v3/int4_eq.json | 14 +- crates/eql-bindings/schema/v3/int4_ord.json | 14 +- .../eql-bindings/schema/v3/int4_ord_ore.json | 14 +- crates/eql-bindings/schema/v3/int8.json | 11 +- crates/eql-bindings/schema/v3/int8_eq.json | 14 +- crates/eql-bindings/schema/v3/int8_ord.json | 14 +- .../eql-bindings/schema/v3/int8_ord_ore.json | 14 +- crates/eql-bindings/schema/v3/numeric.json | 11 +- crates/eql-bindings/schema/v3/numeric_eq.json | 14 +- .../eql-bindings/schema/v3/numeric_ord.json | 14 +- .../schema/v3/numeric_ord_ore.json | 14 +- crates/eql-bindings/schema/v3/text.json | 11 +- crates/eql-bindings/schema/v3/text_eq.json | 14 +- crates/eql-bindings/schema/v3/text_match.json | 14 +- crates/eql-bindings/schema/v3/text_ord.json | 17 +- .../eql-bindings/schema/v3/text_ord_ore.json | 17 +- .../eql-bindings/schema/v3/text_search.json | 20 +- .../eql-bindings/schema/v3/timestamptz.json | 11 +- .../schema/v3/timestamptz_eq.json | 14 +- .../schema/v3/timestamptz_ord.json | 14 +- .../schema/v3/timestamptz_ord_ore.json | 14 +- crates/eql-bindings/src/v3/bool.rs | 32 +-- crates/eql-bindings/src/v3/date.rs | 62 +---- crates/eql-bindings/src/v3/domain_type.rs | 8 +- crates/eql-bindings/src/v3/float4.rs | 72 +---- crates/eql-bindings/src/v3/float8.rs | 81 +----- crates/eql-bindings/src/v3/int2.rs | 60 +--- crates/eql-bindings/src/v3/int4.rs | 68 +---- crates/eql-bindings/src/v3/int8.rs | 60 +--- crates/eql-bindings/src/v3/inventory.rs | 93 +++---- crates/eql-bindings/src/v3/mod.rs | 16 +- crates/eql-bindings/src/v3/numeric.rs | 67 +---- crates/eql-bindings/src/v3/text.rs | 98 ++----- crates/eql-bindings/src/v3/timestamptz.rs | 68 +---- crates/eql-codegen/src/bindings.rs | 260 +++++++++++++++--- crates/eql-codegen/src/writer.rs | 75 ++++- crates/eql-domains/src/spec.rs | 48 ++++ crates/eql-domains/src/term.rs | 37 +-- mise.toml | 26 +- 96 files changed, 917 insertions(+), 1724 deletions(-) diff --git a/crates/eql-bindings/bindings/v3/Bool.ts b/crates/eql-bindings/bindings/v3/Bool.ts index 06b4fdf35..e9fff3004 100644 --- a/crates/eql-bindings/bindings/v3/Bool.ts +++ b/crates/eql-bindings/bindings/v3/Bool.ts @@ -4,19 +4,8 @@ import type { Identifier } from "./Identifier"; import type { SchemaVersion } from "./SchemaVersion"; /** - * `eql_v3.bool` — storage only / encryption-only; every operator is blocked. + * `eql_v3.bool` — storage-only domain. + * + * Operators: none. Required keys: `v` `i` `c`. */ -export type Bool = { -/** - * Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - * value fails deserialization. - */ -v: SchemaVersion, -/** - * Table/column identifier. Required by the domain CHECK. - */ -i: Identifier, -/** - * mp_base85 source ciphertext. Required by the domain CHECK. - */ -c: Ciphertext, }; +export type Bool = { v: SchemaVersion, i: Identifier, c: Ciphertext, }; diff --git a/crates/eql-bindings/bindings/v3/Date.ts b/crates/eql-bindings/bindings/v3/Date.ts index 06002db6e..08a16cd62 100644 --- a/crates/eql-bindings/bindings/v3/Date.ts +++ b/crates/eql-bindings/bindings/v3/Date.ts @@ -4,19 +4,8 @@ import type { Identifier } from "./Identifier"; import type { SchemaVersion } from "./SchemaVersion"; /** - * `eql_v3.date` — storage only; every operator is blocked. + * `eql_v3.date` — storage-only domain. + * + * Operators: none. Required keys: `v` `i` `c`. */ -export type Date = { -/** - * Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - * value fails deserialization. - */ -v: SchemaVersion, -/** - * Table/column identifier. Required by the domain CHECK. - */ -i: Identifier, -/** - * mp_base85 source ciphertext. Required by the domain CHECK. - */ -c: Ciphertext, }; +export type Date = { v: SchemaVersion, i: Identifier, c: Ciphertext, }; diff --git a/crates/eql-bindings/bindings/v3/DateEq.ts b/crates/eql-bindings/bindings/v3/DateEq.ts index 9bad29675..cb1770f91 100644 --- a/crates/eql-bindings/bindings/v3/DateEq.ts +++ b/crates/eql-bindings/bindings/v3/DateEq.ts @@ -5,23 +5,8 @@ import type { Identifier } from "./Identifier"; import type { SchemaVersion } from "./SchemaVersion"; /** - * `eql_v3.date_eq` — HMAC equality (`=`, `<>`). + * `eql_v3.date_eq` — equality domain. + * + * Operators: `=` `<>`. Required keys: `v` `i` `c` `hm`. */ -export type DateEq = { -/** - * Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - * value fails deserialization. - */ -v: SchemaVersion, -/** - * Table/column identifier. Required by the domain CHECK. - */ -i: Identifier, -/** - * mp_base85 source ciphertext. Required by the domain CHECK. - */ -c: Ciphertext, -/** - * HMAC-SHA-256 equality term. - */ -hm: Hmac256, }; +export type DateEq = { v: SchemaVersion, i: Identifier, c: Ciphertext, hm: Hmac256, }; diff --git a/crates/eql-bindings/bindings/v3/DateOrd.ts b/crates/eql-bindings/bindings/v3/DateOrd.ts index c81eb642a..f038cde74 100644 --- a/crates/eql-bindings/bindings/v3/DateOrd.ts +++ b/crates/eql-bindings/bindings/v3/DateOrd.ts @@ -5,23 +5,8 @@ import type { OreBlock256 } from "./OreBlock256"; import type { SchemaVersion } from "./SchemaVersion"; /** - * `eql_v3.date_ord` — full comparison (`=` `<>` `<` `<=` `>` `>=`). + * `eql_v3.date_ord` — ordering domain. + * + * Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. */ -export type DateOrd = { -/** - * Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - * value fails deserialization. - */ -v: SchemaVersion, -/** - * Table/column identifier. Required by the domain CHECK. - */ -i: Identifier, -/** - * mp_base85 source ciphertext. Required by the domain CHECK. - */ -c: Ciphertext, -/** - * Block-ORE order term. Serves equality too. - */ -ob: OreBlock256, }; +export type DateOrd = { v: SchemaVersion, i: Identifier, c: Ciphertext, ob: OreBlock256, }; diff --git a/crates/eql-bindings/bindings/v3/DateOrdOre.ts b/crates/eql-bindings/bindings/v3/DateOrdOre.ts index 4baf81f67..53235f461 100644 --- a/crates/eql-bindings/bindings/v3/DateOrdOre.ts +++ b/crates/eql-bindings/bindings/v3/DateOrdOre.ts @@ -5,23 +5,8 @@ import type { OreBlock256 } from "./OreBlock256"; import type { SchemaVersion } from "./SchemaVersion"; /** - * `eql_v3.date_ord_ore` — full comparison, scheme-explicit name. + * `eql_v3.date_ord_ore` — ordering domain. + * + * Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. */ -export type DateOrdOre = { -/** - * Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - * value fails deserialization. - */ -v: SchemaVersion, -/** - * Table/column identifier. Required by the domain CHECK. - */ -i: Identifier, -/** - * mp_base85 source ciphertext. Required by the domain CHECK. - */ -c: Ciphertext, -/** - * Block-ORE order term. Serves equality too. - */ -ob: OreBlock256, }; +export type DateOrdOre = { v: SchemaVersion, i: Identifier, c: Ciphertext, ob: OreBlock256, }; diff --git a/crates/eql-bindings/bindings/v3/Float4.ts b/crates/eql-bindings/bindings/v3/Float4.ts index 73752d78e..889bbef98 100644 --- a/crates/eql-bindings/bindings/v3/Float4.ts +++ b/crates/eql-bindings/bindings/v3/Float4.ts @@ -4,19 +4,8 @@ import type { Identifier } from "./Identifier"; import type { SchemaVersion } from "./SchemaVersion"; /** - * `eql_v3.float4` — storage only; every operator is blocked. + * `eql_v3.float4` — storage-only domain. + * + * Operators: none. Required keys: `v` `i` `c`. */ -export type Float4 = { -/** - * Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - * value fails deserialization. - */ -v: SchemaVersion, -/** - * Table/column identifier. Required by the domain CHECK. - */ -i: Identifier, -/** - * mp_base85 source ciphertext. Required by the domain CHECK. - */ -c: Ciphertext, }; +export type Float4 = { v: SchemaVersion, i: Identifier, c: Ciphertext, }; diff --git a/crates/eql-bindings/bindings/v3/Float4Eq.ts b/crates/eql-bindings/bindings/v3/Float4Eq.ts index d734162b5..4603cff7a 100644 --- a/crates/eql-bindings/bindings/v3/Float4Eq.ts +++ b/crates/eql-bindings/bindings/v3/Float4Eq.ts @@ -5,23 +5,8 @@ import type { Identifier } from "./Identifier"; import type { SchemaVersion } from "./SchemaVersion"; /** - * `eql_v3.float4_eq` — HMAC equality (`=`, `<>`). + * `eql_v3.float4_eq` — equality domain. + * + * Operators: `=` `<>`. Required keys: `v` `i` `c` `hm`. */ -export type Float4Eq = { -/** - * Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - * value fails deserialization. - */ -v: SchemaVersion, -/** - * Table/column identifier. Required by the domain CHECK. - */ -i: Identifier, -/** - * mp_base85 source ciphertext. Required by the domain CHECK. - */ -c: Ciphertext, -/** - * HMAC-SHA-256 equality term. - */ -hm: Hmac256, }; +export type Float4Eq = { v: SchemaVersion, i: Identifier, c: Ciphertext, hm: Hmac256, }; diff --git a/crates/eql-bindings/bindings/v3/Float4Ord.ts b/crates/eql-bindings/bindings/v3/Float4Ord.ts index 658564a0d..f0e6bc746 100644 --- a/crates/eql-bindings/bindings/v3/Float4Ord.ts +++ b/crates/eql-bindings/bindings/v3/Float4Ord.ts @@ -5,23 +5,8 @@ import type { OreBlock256 } from "./OreBlock256"; import type { SchemaVersion } from "./SchemaVersion"; /** - * `eql_v3.float4_ord` — full comparison (`=` `<>` `<` `<=` `>` `>=`). + * `eql_v3.float4_ord` — ordering domain. + * + * Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. */ -export type Float4Ord = { -/** - * Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - * value fails deserialization. - */ -v: SchemaVersion, -/** - * Table/column identifier. Required by the domain CHECK. - */ -i: Identifier, -/** - * mp_base85 source ciphertext. Required by the domain CHECK. - */ -c: Ciphertext, -/** - * Block-ORE order term (8 blocks for float). Serves equality too. - */ -ob: OreBlock256, }; +export type Float4Ord = { v: SchemaVersion, i: Identifier, c: Ciphertext, ob: OreBlock256, }; diff --git a/crates/eql-bindings/bindings/v3/Float4OrdOre.ts b/crates/eql-bindings/bindings/v3/Float4OrdOre.ts index 9daebc7c3..6a586fc45 100644 --- a/crates/eql-bindings/bindings/v3/Float4OrdOre.ts +++ b/crates/eql-bindings/bindings/v3/Float4OrdOre.ts @@ -5,23 +5,8 @@ import type { OreBlock256 } from "./OreBlock256"; import type { SchemaVersion } from "./SchemaVersion"; /** - * `eql_v3.float4_ord_ore` — full comparison, scheme-explicit name. + * `eql_v3.float4_ord_ore` — ordering domain. + * + * Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. */ -export type Float4OrdOre = { -/** - * Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - * value fails deserialization. - */ -v: SchemaVersion, -/** - * Table/column identifier. Required by the domain CHECK. - */ -i: Identifier, -/** - * mp_base85 source ciphertext. Required by the domain CHECK. - */ -c: Ciphertext, -/** - * Block-ORE order term (8 blocks for float). Serves equality too. - */ -ob: OreBlock256, }; +export type Float4OrdOre = { v: SchemaVersion, i: Identifier, c: Ciphertext, ob: OreBlock256, }; diff --git a/crates/eql-bindings/bindings/v3/Float8.ts b/crates/eql-bindings/bindings/v3/Float8.ts index 71f064d6e..140dcb6d7 100644 --- a/crates/eql-bindings/bindings/v3/Float8.ts +++ b/crates/eql-bindings/bindings/v3/Float8.ts @@ -4,19 +4,8 @@ import type { Identifier } from "./Identifier"; import type { SchemaVersion } from "./SchemaVersion"; /** - * `eql_v3.float8` — storage only; every operator is blocked. + * `eql_v3.float8` — storage-only domain. + * + * Operators: none. Required keys: `v` `i` `c`. */ -export type Float8 = { -/** - * Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - * value fails deserialization. - */ -v: SchemaVersion, -/** - * Table/column identifier. Required by the domain CHECK. - */ -i: Identifier, -/** - * mp_base85 source ciphertext. Required by the domain CHECK. - */ -c: Ciphertext, }; +export type Float8 = { v: SchemaVersion, i: Identifier, c: Ciphertext, }; diff --git a/crates/eql-bindings/bindings/v3/Float8Eq.ts b/crates/eql-bindings/bindings/v3/Float8Eq.ts index 217146375..5a70ffca6 100644 --- a/crates/eql-bindings/bindings/v3/Float8Eq.ts +++ b/crates/eql-bindings/bindings/v3/Float8Eq.ts @@ -5,23 +5,8 @@ import type { Identifier } from "./Identifier"; import type { SchemaVersion } from "./SchemaVersion"; /** - * `eql_v3.float8_eq` — HMAC equality (`=`, `<>`). + * `eql_v3.float8_eq` — equality domain. + * + * Operators: `=` `<>`. Required keys: `v` `i` `c` `hm`. */ -export type Float8Eq = { -/** - * Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - * value fails deserialization. - */ -v: SchemaVersion, -/** - * Table/column identifier. Required by the domain CHECK. - */ -i: Identifier, -/** - * mp_base85 source ciphertext. Required by the domain CHECK. - */ -c: Ciphertext, -/** - * HMAC-SHA-256 equality term. - */ -hm: Hmac256, }; +export type Float8Eq = { v: SchemaVersion, i: Identifier, c: Ciphertext, hm: Hmac256, }; diff --git a/crates/eql-bindings/bindings/v3/Float8Ord.ts b/crates/eql-bindings/bindings/v3/Float8Ord.ts index 209b1c2ed..48d87b396 100644 --- a/crates/eql-bindings/bindings/v3/Float8Ord.ts +++ b/crates/eql-bindings/bindings/v3/Float8Ord.ts @@ -5,23 +5,8 @@ import type { OreBlock256 } from "./OreBlock256"; import type { SchemaVersion } from "./SchemaVersion"; /** - * `eql_v3.float8_ord` — full comparison (`=` `<>` `<` `<=` `>` `>=`). + * `eql_v3.float8_ord` — ordering domain. + * + * Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. */ -export type Float8Ord = { -/** - * Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - * value fails deserialization. - */ -v: SchemaVersion, -/** - * Table/column identifier. Required by the domain CHECK. - */ -i: Identifier, -/** - * mp_base85 source ciphertext. Required by the domain CHECK. - */ -c: Ciphertext, -/** - * Block-ORE order term (8 blocks for float). Serves equality too. - */ -ob: OreBlock256, }; +export type Float8Ord = { v: SchemaVersion, i: Identifier, c: Ciphertext, ob: OreBlock256, }; diff --git a/crates/eql-bindings/bindings/v3/Float8OrdOre.ts b/crates/eql-bindings/bindings/v3/Float8OrdOre.ts index 9fd0d7184..106cb3cbc 100644 --- a/crates/eql-bindings/bindings/v3/Float8OrdOre.ts +++ b/crates/eql-bindings/bindings/v3/Float8OrdOre.ts @@ -5,23 +5,8 @@ import type { OreBlock256 } from "./OreBlock256"; import type { SchemaVersion } from "./SchemaVersion"; /** - * `eql_v3.float8_ord_ore` — full comparison, scheme-explicit name. + * `eql_v3.float8_ord_ore` — ordering domain. + * + * Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. */ -export type Float8OrdOre = { -/** - * Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - * value fails deserialization. - */ -v: SchemaVersion, -/** - * Table/column identifier. Required by the domain CHECK. - */ -i: Identifier, -/** - * mp_base85 source ciphertext. Required by the domain CHECK. - */ -c: Ciphertext, -/** - * Block-ORE order term (8 blocks for float). Serves equality too. - */ -ob: OreBlock256, }; +export type Float8OrdOre = { v: SchemaVersion, i: Identifier, c: Ciphertext, ob: OreBlock256, }; diff --git a/crates/eql-bindings/bindings/v3/Int2.ts b/crates/eql-bindings/bindings/v3/Int2.ts index 9e0d8f17d..c878a9dd6 100644 --- a/crates/eql-bindings/bindings/v3/Int2.ts +++ b/crates/eql-bindings/bindings/v3/Int2.ts @@ -4,19 +4,8 @@ import type { Identifier } from "./Identifier"; import type { SchemaVersion } from "./SchemaVersion"; /** - * `eql_v3.int2` — storage only; every operator is blocked. + * `eql_v3.int2` — storage-only domain. + * + * Operators: none. Required keys: `v` `i` `c`. */ -export type Int2 = { -/** - * Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - * value fails deserialization. - */ -v: SchemaVersion, -/** - * Table/column identifier. Required by the domain CHECK. - */ -i: Identifier, -/** - * mp_base85 source ciphertext. Required by the domain CHECK. - */ -c: Ciphertext, }; +export type Int2 = { v: SchemaVersion, i: Identifier, c: Ciphertext, }; diff --git a/crates/eql-bindings/bindings/v3/Int2Eq.ts b/crates/eql-bindings/bindings/v3/Int2Eq.ts index eb44df041..b87f16eda 100644 --- a/crates/eql-bindings/bindings/v3/Int2Eq.ts +++ b/crates/eql-bindings/bindings/v3/Int2Eq.ts @@ -5,23 +5,8 @@ import type { Identifier } from "./Identifier"; import type { SchemaVersion } from "./SchemaVersion"; /** - * `eql_v3.int2_eq` — HMAC equality (`=`, `<>`). + * `eql_v3.int2_eq` — equality domain. + * + * Operators: `=` `<>`. Required keys: `v` `i` `c` `hm`. */ -export type Int2Eq = { -/** - * Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - * value fails deserialization. - */ -v: SchemaVersion, -/** - * Table/column identifier. Required by the domain CHECK. - */ -i: Identifier, -/** - * mp_base85 source ciphertext. Required by the domain CHECK. - */ -c: Ciphertext, -/** - * HMAC-SHA-256 equality term. - */ -hm: Hmac256, }; +export type Int2Eq = { v: SchemaVersion, i: Identifier, c: Ciphertext, hm: Hmac256, }; diff --git a/crates/eql-bindings/bindings/v3/Int2Ord.ts b/crates/eql-bindings/bindings/v3/Int2Ord.ts index 38e23008e..f8010d090 100644 --- a/crates/eql-bindings/bindings/v3/Int2Ord.ts +++ b/crates/eql-bindings/bindings/v3/Int2Ord.ts @@ -5,23 +5,8 @@ import type { OreBlock256 } from "./OreBlock256"; import type { SchemaVersion } from "./SchemaVersion"; /** - * `eql_v3.int2_ord` — full comparison (`=` `<>` `<` `<=` `>` `>=`). + * `eql_v3.int2_ord` — ordering domain. + * + * Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. */ -export type Int2Ord = { -/** - * Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - * value fails deserialization. - */ -v: SchemaVersion, -/** - * Table/column identifier. Required by the domain CHECK. - */ -i: Identifier, -/** - * mp_base85 source ciphertext. Required by the domain CHECK. - */ -c: Ciphertext, -/** - * Block-ORE order term. Serves equality too. - */ -ob: OreBlock256, }; +export type Int2Ord = { v: SchemaVersion, i: Identifier, c: Ciphertext, ob: OreBlock256, }; diff --git a/crates/eql-bindings/bindings/v3/Int2OrdOre.ts b/crates/eql-bindings/bindings/v3/Int2OrdOre.ts index 1193826a4..3bf31ac82 100644 --- a/crates/eql-bindings/bindings/v3/Int2OrdOre.ts +++ b/crates/eql-bindings/bindings/v3/Int2OrdOre.ts @@ -5,23 +5,8 @@ import type { OreBlock256 } from "./OreBlock256"; import type { SchemaVersion } from "./SchemaVersion"; /** - * `eql_v3.int2_ord_ore` — full comparison, scheme-explicit name. + * `eql_v3.int2_ord_ore` — ordering domain. + * + * Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. */ -export type Int2OrdOre = { -/** - * Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - * value fails deserialization. - */ -v: SchemaVersion, -/** - * Table/column identifier. Required by the domain CHECK. - */ -i: Identifier, -/** - * mp_base85 source ciphertext. Required by the domain CHECK. - */ -c: Ciphertext, -/** - * Block-ORE order term. Serves equality too. - */ -ob: OreBlock256, }; +export type Int2OrdOre = { v: SchemaVersion, i: Identifier, c: Ciphertext, ob: OreBlock256, }; diff --git a/crates/eql-bindings/bindings/v3/Int4.ts b/crates/eql-bindings/bindings/v3/Int4.ts index 3ab94a30e..4de3cd1ca 100644 --- a/crates/eql-bindings/bindings/v3/Int4.ts +++ b/crates/eql-bindings/bindings/v3/Int4.ts @@ -4,19 +4,8 @@ import type { Identifier } from "./Identifier"; import type { SchemaVersion } from "./SchemaVersion"; /** - * `eql_v3.int4` — storage only; every operator is blocked. + * `eql_v3.int4` — storage-only domain. + * + * Operators: none. Required keys: `v` `i` `c`. */ -export type Int4 = { -/** - * Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - * value fails deserialization. - */ -v: SchemaVersion, -/** - * Table/column identifier. Required by the domain CHECK. - */ -i: Identifier, -/** - * mp_base85 source ciphertext. Required by the domain CHECK. - */ -c: Ciphertext, }; +export type Int4 = { v: SchemaVersion, i: Identifier, c: Ciphertext, }; diff --git a/crates/eql-bindings/bindings/v3/Int4Eq.ts b/crates/eql-bindings/bindings/v3/Int4Eq.ts index 7510a83e1..da9cf0554 100644 --- a/crates/eql-bindings/bindings/v3/Int4Eq.ts +++ b/crates/eql-bindings/bindings/v3/Int4Eq.ts @@ -5,23 +5,8 @@ import type { Identifier } from "./Identifier"; import type { SchemaVersion } from "./SchemaVersion"; /** - * `eql_v3.int4_eq` — HMAC equality (`=`, `<>`). + * `eql_v3.int4_eq` — equality domain. + * + * Operators: `=` `<>`. Required keys: `v` `i` `c` `hm`. */ -export type Int4Eq = { -/** - * Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - * value fails deserialization. - */ -v: SchemaVersion, -/** - * Table/column identifier. Required by the domain CHECK. - */ -i: Identifier, -/** - * mp_base85 source ciphertext. Required by the domain CHECK. - */ -c: Ciphertext, -/** - * HMAC-SHA-256 equality term. - */ -hm: Hmac256, }; +export type Int4Eq = { v: SchemaVersion, i: Identifier, c: Ciphertext, hm: Hmac256, }; diff --git a/crates/eql-bindings/bindings/v3/Int4Ord.ts b/crates/eql-bindings/bindings/v3/Int4Ord.ts index ee25c6707..e6993b126 100644 --- a/crates/eql-bindings/bindings/v3/Int4Ord.ts +++ b/crates/eql-bindings/bindings/v3/Int4Ord.ts @@ -5,23 +5,8 @@ import type { OreBlock256 } from "./OreBlock256"; import type { SchemaVersion } from "./SchemaVersion"; /** - * `eql_v3.int4_ord` — full comparison (`=` `<>` `<` `<=` `>` `>=`). + * `eql_v3.int4_ord` — ordering domain. + * + * Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. */ -export type Int4Ord = { -/** - * Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - * value fails deserialization. - */ -v: SchemaVersion, -/** - * Table/column identifier. Required by the domain CHECK. - */ -i: Identifier, -/** - * mp_base85 source ciphertext. Required by the domain CHECK. - */ -c: Ciphertext, -/** - * Block-ORE order term. Serves equality too. - */ -ob: OreBlock256, }; +export type Int4Ord = { v: SchemaVersion, i: Identifier, c: Ciphertext, ob: OreBlock256, }; diff --git a/crates/eql-bindings/bindings/v3/Int4OrdOre.ts b/crates/eql-bindings/bindings/v3/Int4OrdOre.ts index 17be0f8e3..5b697ff37 100644 --- a/crates/eql-bindings/bindings/v3/Int4OrdOre.ts +++ b/crates/eql-bindings/bindings/v3/Int4OrdOre.ts @@ -5,25 +5,8 @@ import type { OreBlock256 } from "./OreBlock256"; import type { SchemaVersion } from "./SchemaVersion"; /** - * `eql_v3.int4_ord_ore` — full comparison (`=` `<>` `<` `<=` `>` `>=`), - * scheme-explicit name. Same shape as [`Int4Ord`], distinct SQL domain. + * `eql_v3.int4_ord_ore` — ordering domain. + * + * Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. */ -export type Int4OrdOre = { -/** - * Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - * value fails deserialization. - */ -v: SchemaVersion, -/** - * Table/column identifier. Required by the domain CHECK. - */ -i: Identifier, -/** - * mp_base85 source ciphertext. Required by the domain CHECK. - */ -c: Ciphertext, -/** - * Block-ORE order term. Serves equality too — ORE over a - * full-domain `int4` is lossless, so no separate `hm` is carried. - */ -ob: OreBlock256, }; +export type Int4OrdOre = { v: SchemaVersion, i: Identifier, c: Ciphertext, ob: OreBlock256, }; diff --git a/crates/eql-bindings/bindings/v3/Int8.ts b/crates/eql-bindings/bindings/v3/Int8.ts index b8df9f2fe..550ab9de2 100644 --- a/crates/eql-bindings/bindings/v3/Int8.ts +++ b/crates/eql-bindings/bindings/v3/Int8.ts @@ -4,19 +4,8 @@ import type { Identifier } from "./Identifier"; import type { SchemaVersion } from "./SchemaVersion"; /** - * `eql_v3.int8` — storage only; every operator is blocked. + * `eql_v3.int8` — storage-only domain. + * + * Operators: none. Required keys: `v` `i` `c`. */ -export type Int8 = { -/** - * Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - * value fails deserialization. - */ -v: SchemaVersion, -/** - * Table/column identifier. Required by the domain CHECK. - */ -i: Identifier, -/** - * mp_base85 source ciphertext. Required by the domain CHECK. - */ -c: Ciphertext, }; +export type Int8 = { v: SchemaVersion, i: Identifier, c: Ciphertext, }; diff --git a/crates/eql-bindings/bindings/v3/Int8Eq.ts b/crates/eql-bindings/bindings/v3/Int8Eq.ts index c2633feee..aa236626c 100644 --- a/crates/eql-bindings/bindings/v3/Int8Eq.ts +++ b/crates/eql-bindings/bindings/v3/Int8Eq.ts @@ -5,23 +5,8 @@ import type { Identifier } from "./Identifier"; import type { SchemaVersion } from "./SchemaVersion"; /** - * `eql_v3.int8_eq` — HMAC equality (`=`, `<>`). + * `eql_v3.int8_eq` — equality domain. + * + * Operators: `=` `<>`. Required keys: `v` `i` `c` `hm`. */ -export type Int8Eq = { -/** - * Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - * value fails deserialization. - */ -v: SchemaVersion, -/** - * Table/column identifier. Required by the domain CHECK. - */ -i: Identifier, -/** - * mp_base85 source ciphertext. Required by the domain CHECK. - */ -c: Ciphertext, -/** - * HMAC-SHA-256 equality term. - */ -hm: Hmac256, }; +export type Int8Eq = { v: SchemaVersion, i: Identifier, c: Ciphertext, hm: Hmac256, }; diff --git a/crates/eql-bindings/bindings/v3/Int8Ord.ts b/crates/eql-bindings/bindings/v3/Int8Ord.ts index 7199defdb..f1da6cfee 100644 --- a/crates/eql-bindings/bindings/v3/Int8Ord.ts +++ b/crates/eql-bindings/bindings/v3/Int8Ord.ts @@ -5,23 +5,8 @@ import type { OreBlock256 } from "./OreBlock256"; import type { SchemaVersion } from "./SchemaVersion"; /** - * `eql_v3.int8_ord` — full comparison (`=` `<>` `<` `<=` `>` `>=`). + * `eql_v3.int8_ord` — ordering domain. + * + * Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. */ -export type Int8Ord = { -/** - * Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - * value fails deserialization. - */ -v: SchemaVersion, -/** - * Table/column identifier. Required by the domain CHECK. - */ -i: Identifier, -/** - * mp_base85 source ciphertext. Required by the domain CHECK. - */ -c: Ciphertext, -/** - * Block-ORE order term. Serves equality too. - */ -ob: OreBlock256, }; +export type Int8Ord = { v: SchemaVersion, i: Identifier, c: Ciphertext, ob: OreBlock256, }; diff --git a/crates/eql-bindings/bindings/v3/Int8OrdOre.ts b/crates/eql-bindings/bindings/v3/Int8OrdOre.ts index 6dd492db2..064490c92 100644 --- a/crates/eql-bindings/bindings/v3/Int8OrdOre.ts +++ b/crates/eql-bindings/bindings/v3/Int8OrdOre.ts @@ -5,23 +5,8 @@ import type { OreBlock256 } from "./OreBlock256"; import type { SchemaVersion } from "./SchemaVersion"; /** - * `eql_v3.int8_ord_ore` — full comparison, scheme-explicit name. + * `eql_v3.int8_ord_ore` — ordering domain. + * + * Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. */ -export type Int8OrdOre = { -/** - * Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - * value fails deserialization. - */ -v: SchemaVersion, -/** - * Table/column identifier. Required by the domain CHECK. - */ -i: Identifier, -/** - * mp_base85 source ciphertext. Required by the domain CHECK. - */ -c: Ciphertext, -/** - * Block-ORE order term. Serves equality too. - */ -ob: OreBlock256, }; +export type Int8OrdOre = { v: SchemaVersion, i: Identifier, c: Ciphertext, ob: OreBlock256, }; diff --git a/crates/eql-bindings/bindings/v3/Numeric.ts b/crates/eql-bindings/bindings/v3/Numeric.ts index dfcda818a..99277adcf 100644 --- a/crates/eql-bindings/bindings/v3/Numeric.ts +++ b/crates/eql-bindings/bindings/v3/Numeric.ts @@ -4,19 +4,8 @@ import type { Identifier } from "./Identifier"; import type { SchemaVersion } from "./SchemaVersion"; /** - * `eql_v3.numeric` — storage only; every operator is blocked. + * `eql_v3.numeric` — storage-only domain. + * + * Operators: none. Required keys: `v` `i` `c`. */ -export type Numeric = { -/** - * Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - * value fails deserialization. - */ -v: SchemaVersion, -/** - * Table/column identifier. Required by the domain CHECK. - */ -i: Identifier, -/** - * mp_base85 source ciphertext. Required by the domain CHECK. - */ -c: Ciphertext, }; +export type Numeric = { v: SchemaVersion, i: Identifier, c: Ciphertext, }; diff --git a/crates/eql-bindings/bindings/v3/NumericEq.ts b/crates/eql-bindings/bindings/v3/NumericEq.ts index e3b3ff466..f318b3017 100644 --- a/crates/eql-bindings/bindings/v3/NumericEq.ts +++ b/crates/eql-bindings/bindings/v3/NumericEq.ts @@ -5,23 +5,8 @@ import type { Identifier } from "./Identifier"; import type { SchemaVersion } from "./SchemaVersion"; /** - * `eql_v3.numeric_eq` — HMAC equality (`=`, `<>`). + * `eql_v3.numeric_eq` — equality domain. + * + * Operators: `=` `<>`. Required keys: `v` `i` `c` `hm`. */ -export type NumericEq = { -/** - * Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - * value fails deserialization. - */ -v: SchemaVersion, -/** - * Table/column identifier. Required by the domain CHECK. - */ -i: Identifier, -/** - * mp_base85 source ciphertext. Required by the domain CHECK. - */ -c: Ciphertext, -/** - * HMAC-SHA-256 equality term. - */ -hm: Hmac256, }; +export type NumericEq = { v: SchemaVersion, i: Identifier, c: Ciphertext, hm: Hmac256, }; diff --git a/crates/eql-bindings/bindings/v3/NumericOrd.ts b/crates/eql-bindings/bindings/v3/NumericOrd.ts index 491295dc4..6945e4d1f 100644 --- a/crates/eql-bindings/bindings/v3/NumericOrd.ts +++ b/crates/eql-bindings/bindings/v3/NumericOrd.ts @@ -5,23 +5,8 @@ import type { OreBlock256 } from "./OreBlock256"; import type { SchemaVersion } from "./SchemaVersion"; /** - * `eql_v3.numeric_ord` — full comparison (`=` `<>` `<` `<=` `>` `>=`). + * `eql_v3.numeric_ord` — ordering domain. + * + * Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. */ -export type NumericOrd = { -/** - * Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - * value fails deserialization. - */ -v: SchemaVersion, -/** - * Table/column identifier. Required by the domain CHECK. - */ -i: Identifier, -/** - * mp_base85 source ciphertext. Required by the domain CHECK. - */ -c: Ciphertext, -/** - * Block-ORE order term (14 blocks for numeric). Serves equality too. - */ -ob: OreBlock256, }; +export type NumericOrd = { v: SchemaVersion, i: Identifier, c: Ciphertext, ob: OreBlock256, }; diff --git a/crates/eql-bindings/bindings/v3/NumericOrdOre.ts b/crates/eql-bindings/bindings/v3/NumericOrdOre.ts index 846437451..3c14fcaa2 100644 --- a/crates/eql-bindings/bindings/v3/NumericOrdOre.ts +++ b/crates/eql-bindings/bindings/v3/NumericOrdOre.ts @@ -5,23 +5,8 @@ import type { OreBlock256 } from "./OreBlock256"; import type { SchemaVersion } from "./SchemaVersion"; /** - * `eql_v3.numeric_ord_ore` — full comparison, scheme-explicit name. + * `eql_v3.numeric_ord_ore` — ordering domain. + * + * Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. */ -export type NumericOrdOre = { -/** - * Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - * value fails deserialization. - */ -v: SchemaVersion, -/** - * Table/column identifier. Required by the domain CHECK. - */ -i: Identifier, -/** - * mp_base85 source ciphertext. Required by the domain CHECK. - */ -c: Ciphertext, -/** - * Block-ORE order term (14 blocks for numeric). Serves equality too. - */ -ob: OreBlock256, }; +export type NumericOrdOre = { v: SchemaVersion, i: Identifier, c: Ciphertext, ob: OreBlock256, }; diff --git a/crates/eql-bindings/bindings/v3/Text.ts b/crates/eql-bindings/bindings/v3/Text.ts index e506a5a45..a6274a5da 100644 --- a/crates/eql-bindings/bindings/v3/Text.ts +++ b/crates/eql-bindings/bindings/v3/Text.ts @@ -4,19 +4,8 @@ import type { Identifier } from "./Identifier"; import type { SchemaVersion } from "./SchemaVersion"; /** - * `eql_v3.text` — storage only; every operator is blocked. + * `eql_v3.text` — storage-only domain. + * + * Operators: none. Required keys: `v` `i` `c`. */ -export type Text = { -/** - * Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - * value fails deserialization. - */ -v: SchemaVersion, -/** - * Table/column identifier. Required by the domain CHECK. - */ -i: Identifier, -/** - * mp_base85 source ciphertext. Required by the domain CHECK. - */ -c: Ciphertext, }; +export type Text = { v: SchemaVersion, i: Identifier, c: Ciphertext, }; diff --git a/crates/eql-bindings/bindings/v3/TextEq.ts b/crates/eql-bindings/bindings/v3/TextEq.ts index e6650c6d3..e3e5c7b5c 100644 --- a/crates/eql-bindings/bindings/v3/TextEq.ts +++ b/crates/eql-bindings/bindings/v3/TextEq.ts @@ -5,23 +5,8 @@ import type { Identifier } from "./Identifier"; import type { SchemaVersion } from "./SchemaVersion"; /** - * `eql_v3.text_eq` — HMAC equality (`=`, `<>`). + * `eql_v3.text_eq` — equality domain. + * + * Operators: `=` `<>`. Required keys: `v` `i` `c` `hm`. */ -export type TextEq = { -/** - * Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - * value fails deserialization. - */ -v: SchemaVersion, -/** - * Table/column identifier. Required by the domain CHECK. - */ -i: Identifier, -/** - * mp_base85 source ciphertext. Required by the domain CHECK. - */ -c: Ciphertext, -/** - * HMAC-SHA-256 equality term. - */ -hm: Hmac256, }; +export type TextEq = { v: SchemaVersion, i: Identifier, c: Ciphertext, hm: Hmac256, }; diff --git a/crates/eql-bindings/bindings/v3/TextMatch.ts b/crates/eql-bindings/bindings/v3/TextMatch.ts index 400812f51..f1f85c9e3 100644 --- a/crates/eql-bindings/bindings/v3/TextMatch.ts +++ b/crates/eql-bindings/bindings/v3/TextMatch.ts @@ -5,23 +5,8 @@ import type { Identifier } from "./Identifier"; import type { SchemaVersion } from "./SchemaVersion"; /** - * `eql_v3.text_match` — Bloom-filter containment match. + * `eql_v3.text_match` — match domain. + * + * Operators: `@>` `<@`. Required keys: `v` `i` `c` `bf`. */ -export type TextMatch = { -/** - * Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - * value fails deserialization. - */ -v: SchemaVersion, -/** - * Table/column identifier. Required by the domain CHECK. - */ -i: Identifier, -/** - * mp_base85 source ciphertext. Required by the domain CHECK. - */ -c: Ciphertext, -/** - * Bloom-filter match term (signed smallint bit positions). - */ -bf: BloomFilter, }; +export type TextMatch = { v: SchemaVersion, i: Identifier, c: Ciphertext, bf: BloomFilter, }; diff --git a/crates/eql-bindings/bindings/v3/TextOrd.ts b/crates/eql-bindings/bindings/v3/TextOrd.ts index e3e1de7d6..f6c7c856d 100644 --- a/crates/eql-bindings/bindings/v3/TextOrd.ts +++ b/crates/eql-bindings/bindings/v3/TextOrd.ts @@ -6,29 +6,8 @@ import type { OreBlock256 } from "./OreBlock256"; import type { SchemaVersion } from "./SchemaVersion"; /** - * `eql_v3.text_ord` — full lexicographic comparison - * (`=` `<>` `<` `<=` `>` `>=`). Carries both `hm` (equality) and `ob` - * (ordering) — text routes equality through `hm` (`[Hm, Ore]`). + * `eql_v3.text_ord` — ordering domain. + * + * Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `hm` `ob`. */ -export type TextOrd = { -/** - * Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - * value fails deserialization. - */ -v: SchemaVersion, -/** - * Table/column identifier. Required by the domain CHECK. - */ -i: Identifier, -/** - * mp_base85 source ciphertext. Required by the domain CHECK. - */ -c: Ciphertext, -/** - * HMAC-SHA-256 equality term. Text routes `=`/`<>` through `hm`. - */ -hm: Hmac256, -/** - * Block-ORE order term. - */ -ob: OreBlock256, }; +export type TextOrd = { v: SchemaVersion, i: Identifier, c: Ciphertext, hm: Hmac256, ob: OreBlock256, }; diff --git a/crates/eql-bindings/bindings/v3/TextOrdOre.ts b/crates/eql-bindings/bindings/v3/TextOrdOre.ts index 7aed3dd52..f1e264af5 100644 --- a/crates/eql-bindings/bindings/v3/TextOrdOre.ts +++ b/crates/eql-bindings/bindings/v3/TextOrdOre.ts @@ -6,30 +6,8 @@ import type { OreBlock256 } from "./OreBlock256"; import type { SchemaVersion } from "./SchemaVersion"; /** - * `eql_v3.text_ord_ore` — full lexicographic comparison, - * scheme-explicit name. Unlike the integer ordered domains (`[Ore]` only), - * text routes equality through `hm` rather than the ORE term, so the domain - * carries both `hm` and `ob` (`[Hm, Ore]`). + * `eql_v3.text_ord_ore` — ordering domain. + * + * Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `hm` `ob`. */ -export type TextOrdOre = { -/** - * Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - * value fails deserialization. - */ -v: SchemaVersion, -/** - * Table/column identifier. Required by the domain CHECK. - */ -i: Identifier, -/** - * mp_base85 source ciphertext. Required by the domain CHECK. - */ -c: Ciphertext, -/** - * HMAC-SHA-256 equality term. Text routes `=`/`<>` through `hm`. - */ -hm: Hmac256, -/** - * Block-ORE order term. - */ -ob: OreBlock256, }; +export type TextOrdOre = { v: SchemaVersion, i: Identifier, c: Ciphertext, hm: Hmac256, ob: OreBlock256, }; diff --git a/crates/eql-bindings/bindings/v3/TextSearch.ts b/crates/eql-bindings/bindings/v3/TextSearch.ts index e95709378..fe46d46cf 100644 --- a/crates/eql-bindings/bindings/v3/TextSearch.ts +++ b/crates/eql-bindings/bindings/v3/TextSearch.ts @@ -7,33 +7,8 @@ import type { OreBlock256 } from "./OreBlock256"; import type { SchemaVersion } from "./SchemaVersion"; /** - * `eql_v3.text_search` — the full text search surface: HMAC equality, ORE - * ordering, and Bloom-filter containment match (`[Hm, Ore, Bloom]`). The - * superset domain combining `_eq`, `_ord`, and `_match`. + * `eql_v3.text_search` — search domain. + * + * Operators: `=` `<>` `<` `<=` `>` `>=` `@>` `<@`. Required keys: `v` `i` `c` `hm` `ob` `bf`. */ -export type TextSearch = { -/** - * Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - * value fails deserialization. - */ -v: SchemaVersion, -/** - * Table/column identifier. Required by the domain CHECK. - */ -i: Identifier, -/** - * mp_base85 source ciphertext. Required by the domain CHECK. - */ -c: Ciphertext, -/** - * HMAC-SHA-256 equality term. - */ -hm: Hmac256, -/** - * Block-ORE order term. - */ -ob: OreBlock256, -/** - * Bloom-filter match term (signed smallint bit positions). - */ -bf: BloomFilter, }; +export type TextSearch = { v: SchemaVersion, i: Identifier, c: Ciphertext, hm: Hmac256, ob: OreBlock256, bf: BloomFilter, }; diff --git a/crates/eql-bindings/bindings/v3/Timestamptz.ts b/crates/eql-bindings/bindings/v3/Timestamptz.ts index 62ddc82ec..ad15c7ede 100644 --- a/crates/eql-bindings/bindings/v3/Timestamptz.ts +++ b/crates/eql-bindings/bindings/v3/Timestamptz.ts @@ -4,19 +4,8 @@ import type { Identifier } from "./Identifier"; import type { SchemaVersion } from "./SchemaVersion"; /** - * `eql_v3.timestamptz` — storage only; every operator is blocked. + * `eql_v3.timestamptz` — storage-only domain. + * + * Operators: none. Required keys: `v` `i` `c`. */ -export type Timestamptz = { -/** - * Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - * value fails deserialization. - */ -v: SchemaVersion, -/** - * Table/column identifier. Required by the domain CHECK. - */ -i: Identifier, -/** - * mp_base85 source ciphertext. Required by the domain CHECK. - */ -c: Ciphertext, }; +export type Timestamptz = { v: SchemaVersion, i: Identifier, c: Ciphertext, }; diff --git a/crates/eql-bindings/bindings/v3/TimestamptzEq.ts b/crates/eql-bindings/bindings/v3/TimestamptzEq.ts index e27254734..d0d09d557 100644 --- a/crates/eql-bindings/bindings/v3/TimestamptzEq.ts +++ b/crates/eql-bindings/bindings/v3/TimestamptzEq.ts @@ -5,23 +5,8 @@ import type { Identifier } from "./Identifier"; import type { SchemaVersion } from "./SchemaVersion"; /** - * `eql_v3.timestamptz_eq` — HMAC equality (`=`, `<>`). + * `eql_v3.timestamptz_eq` — equality domain. + * + * Operators: `=` `<>`. Required keys: `v` `i` `c` `hm`. */ -export type TimestamptzEq = { -/** - * Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - * value fails deserialization. - */ -v: SchemaVersion, -/** - * Table/column identifier. Required by the domain CHECK. - */ -i: Identifier, -/** - * mp_base85 source ciphertext. Required by the domain CHECK. - */ -c: Ciphertext, -/** - * HMAC-SHA-256 equality term. - */ -hm: Hmac256, }; +export type TimestamptzEq = { v: SchemaVersion, i: Identifier, c: Ciphertext, hm: Hmac256, }; diff --git a/crates/eql-bindings/bindings/v3/TimestamptzOrd.ts b/crates/eql-bindings/bindings/v3/TimestamptzOrd.ts index 19b975732..b99b4a208 100644 --- a/crates/eql-bindings/bindings/v3/TimestamptzOrd.ts +++ b/crates/eql-bindings/bindings/v3/TimestamptzOrd.ts @@ -5,23 +5,8 @@ import type { OreBlock256 } from "./OreBlock256"; import type { SchemaVersion } from "./SchemaVersion"; /** - * `eql_v3.timestamptz_ord` — full comparison (`=` `<>` `<` `<=` `>` `>=`). + * `eql_v3.timestamptz_ord` — ordering domain. + * + * Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. */ -export type TimestamptzOrd = { -/** - * Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - * value fails deserialization. - */ -v: SchemaVersion, -/** - * Table/column identifier. Required by the domain CHECK. - */ -i: Identifier, -/** - * mp_base85 source ciphertext. Required by the domain CHECK. - */ -c: Ciphertext, -/** - * Block-ORE order term (12 blocks for timestamptz). Serves equality too. - */ -ob: OreBlock256, }; +export type TimestamptzOrd = { v: SchemaVersion, i: Identifier, c: Ciphertext, ob: OreBlock256, }; diff --git a/crates/eql-bindings/bindings/v3/TimestamptzOrdOre.ts b/crates/eql-bindings/bindings/v3/TimestamptzOrdOre.ts index a84d68088..497782692 100644 --- a/crates/eql-bindings/bindings/v3/TimestamptzOrdOre.ts +++ b/crates/eql-bindings/bindings/v3/TimestamptzOrdOre.ts @@ -5,23 +5,8 @@ import type { OreBlock256 } from "./OreBlock256"; import type { SchemaVersion } from "./SchemaVersion"; /** - * `eql_v3.timestamptz_ord_ore` — full comparison, scheme-explicit name. + * `eql_v3.timestamptz_ord_ore` — ordering domain. + * + * Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. */ -export type TimestamptzOrdOre = { -/** - * Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - * value fails deserialization. - */ -v: SchemaVersion, -/** - * Table/column identifier. Required by the domain CHECK. - */ -i: Identifier, -/** - * mp_base85 source ciphertext. Required by the domain CHECK. - */ -c: Ciphertext, -/** - * Block-ORE order term (12 blocks for timestamptz). Serves equality too. - */ -ob: OreBlock256, }; +export type TimestamptzOrdOre = { v: SchemaVersion, i: Identifier, c: Ciphertext, ob: OreBlock256, }; diff --git a/crates/eql-bindings/schema/v3/bool.json b/crates/eql-bindings/schema/v3/bool.json index f60fbe16a..2700a83a7 100644 --- a/crates/eql-bindings/schema/v3/bool.json +++ b/crates/eql-bindings/schema/v3/bool.json @@ -32,19 +32,16 @@ "$id": "https://schemas.cipherstash.com/eql/v3/bool.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`eql_v3.bool` — storage only / encryption-only; every operator is blocked.", + "description": "`eql_v3.bool` — storage-only domain.\n\nOperators: none. Required keys: `v` `i` `c`.", "properties": { "c": { - "$ref": "#/$defs/Ciphertext", - "description": "mp_base85 source ciphertext. Required by the domain CHECK." + "$ref": "#/$defs/Ciphertext" }, "i": { - "$ref": "#/$defs/Identifier", - "description": "Table/column identifier. Required by the domain CHECK." + "$ref": "#/$defs/Identifier" }, "v": { - "$ref": "#/$defs/SchemaVersion", - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." + "$ref": "#/$defs/SchemaVersion" } }, "required": [ diff --git a/crates/eql-bindings/schema/v3/date.json b/crates/eql-bindings/schema/v3/date.json index 2b98d521b..1c17fab22 100644 --- a/crates/eql-bindings/schema/v3/date.json +++ b/crates/eql-bindings/schema/v3/date.json @@ -32,19 +32,16 @@ "$id": "https://schemas.cipherstash.com/eql/v3/date.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`eql_v3.date` — storage only; every operator is blocked.", + "description": "`eql_v3.date` — storage-only domain.\n\nOperators: none. Required keys: `v` `i` `c`.", "properties": { "c": { - "$ref": "#/$defs/Ciphertext", - "description": "mp_base85 source ciphertext. Required by the domain CHECK." + "$ref": "#/$defs/Ciphertext" }, "i": { - "$ref": "#/$defs/Identifier", - "description": "Table/column identifier. Required by the domain CHECK." + "$ref": "#/$defs/Identifier" }, "v": { - "$ref": "#/$defs/SchemaVersion", - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." + "$ref": "#/$defs/SchemaVersion" } }, "required": [ diff --git a/crates/eql-bindings/schema/v3/date_eq.json b/crates/eql-bindings/schema/v3/date_eq.json index 6d87ca62f..e1904b313 100644 --- a/crates/eql-bindings/schema/v3/date_eq.json +++ b/crates/eql-bindings/schema/v3/date_eq.json @@ -36,23 +36,19 @@ "$id": "https://schemas.cipherstash.com/eql/v3/date_eq.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`eql_v3.date_eq` — HMAC equality (`=`, `<>`).", + "description": "`eql_v3.date_eq` — equality domain.\n\nOperators: `=` `<>`. Required keys: `v` `i` `c` `hm`.", "properties": { "c": { - "$ref": "#/$defs/Ciphertext", - "description": "mp_base85 source ciphertext. Required by the domain CHECK." + "$ref": "#/$defs/Ciphertext" }, "hm": { - "$ref": "#/$defs/Hmac256", - "description": "HMAC-SHA-256 equality term." + "$ref": "#/$defs/Hmac256" }, "i": { - "$ref": "#/$defs/Identifier", - "description": "Table/column identifier. Required by the domain CHECK." + "$ref": "#/$defs/Identifier" }, "v": { - "$ref": "#/$defs/SchemaVersion", - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." + "$ref": "#/$defs/SchemaVersion" } }, "required": [ diff --git a/crates/eql-bindings/schema/v3/date_ord.json b/crates/eql-bindings/schema/v3/date_ord.json index 57d58b312..2a64c4c7d 100644 --- a/crates/eql-bindings/schema/v3/date_ord.json +++ b/crates/eql-bindings/schema/v3/date_ord.json @@ -39,23 +39,19 @@ "$id": "https://schemas.cipherstash.com/eql/v3/date_ord.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`eql_v3.date_ord` — full comparison (`=` `<>` `<` `<=` `>` `>=`).", + "description": "`eql_v3.date_ord` — ordering domain.\n\nOperators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`.", "properties": { "c": { - "$ref": "#/$defs/Ciphertext", - "description": "mp_base85 source ciphertext. Required by the domain CHECK." + "$ref": "#/$defs/Ciphertext" }, "i": { - "$ref": "#/$defs/Identifier", - "description": "Table/column identifier. Required by the domain CHECK." + "$ref": "#/$defs/Identifier" }, "ob": { - "$ref": "#/$defs/OreBlock256", - "description": "Block-ORE order term. Serves equality too." + "$ref": "#/$defs/OreBlock256" }, "v": { - "$ref": "#/$defs/SchemaVersion", - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." + "$ref": "#/$defs/SchemaVersion" } }, "required": [ diff --git a/crates/eql-bindings/schema/v3/date_ord_ore.json b/crates/eql-bindings/schema/v3/date_ord_ore.json index 8b4b3a593..b2ffeda8b 100644 --- a/crates/eql-bindings/schema/v3/date_ord_ore.json +++ b/crates/eql-bindings/schema/v3/date_ord_ore.json @@ -39,23 +39,19 @@ "$id": "https://schemas.cipherstash.com/eql/v3/date_ord_ore.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`eql_v3.date_ord_ore` — full comparison, scheme-explicit name.", + "description": "`eql_v3.date_ord_ore` — ordering domain.\n\nOperators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`.", "properties": { "c": { - "$ref": "#/$defs/Ciphertext", - "description": "mp_base85 source ciphertext. Required by the domain CHECK." + "$ref": "#/$defs/Ciphertext" }, "i": { - "$ref": "#/$defs/Identifier", - "description": "Table/column identifier. Required by the domain CHECK." + "$ref": "#/$defs/Identifier" }, "ob": { - "$ref": "#/$defs/OreBlock256", - "description": "Block-ORE order term. Serves equality too." + "$ref": "#/$defs/OreBlock256" }, "v": { - "$ref": "#/$defs/SchemaVersion", - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." + "$ref": "#/$defs/SchemaVersion" } }, "required": [ diff --git a/crates/eql-bindings/schema/v3/float4.json b/crates/eql-bindings/schema/v3/float4.json index 32943f12a..b4d726a2c 100644 --- a/crates/eql-bindings/schema/v3/float4.json +++ b/crates/eql-bindings/schema/v3/float4.json @@ -32,19 +32,16 @@ "$id": "https://schemas.cipherstash.com/eql/v3/float4.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`eql_v3.float4` — storage only; every operator is blocked.", + "description": "`eql_v3.float4` — storage-only domain.\n\nOperators: none. Required keys: `v` `i` `c`.", "properties": { "c": { - "$ref": "#/$defs/Ciphertext", - "description": "mp_base85 source ciphertext. Required by the domain CHECK." + "$ref": "#/$defs/Ciphertext" }, "i": { - "$ref": "#/$defs/Identifier", - "description": "Table/column identifier. Required by the domain CHECK." + "$ref": "#/$defs/Identifier" }, "v": { - "$ref": "#/$defs/SchemaVersion", - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." + "$ref": "#/$defs/SchemaVersion" } }, "required": [ diff --git a/crates/eql-bindings/schema/v3/float4_eq.json b/crates/eql-bindings/schema/v3/float4_eq.json index 3dc29efcd..90469a3a8 100644 --- a/crates/eql-bindings/schema/v3/float4_eq.json +++ b/crates/eql-bindings/schema/v3/float4_eq.json @@ -36,23 +36,19 @@ "$id": "https://schemas.cipherstash.com/eql/v3/float4_eq.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`eql_v3.float4_eq` — HMAC equality (`=`, `<>`).", + "description": "`eql_v3.float4_eq` — equality domain.\n\nOperators: `=` `<>`. Required keys: `v` `i` `c` `hm`.", "properties": { "c": { - "$ref": "#/$defs/Ciphertext", - "description": "mp_base85 source ciphertext. Required by the domain CHECK." + "$ref": "#/$defs/Ciphertext" }, "hm": { - "$ref": "#/$defs/Hmac256", - "description": "HMAC-SHA-256 equality term." + "$ref": "#/$defs/Hmac256" }, "i": { - "$ref": "#/$defs/Identifier", - "description": "Table/column identifier. Required by the domain CHECK." + "$ref": "#/$defs/Identifier" }, "v": { - "$ref": "#/$defs/SchemaVersion", - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." + "$ref": "#/$defs/SchemaVersion" } }, "required": [ diff --git a/crates/eql-bindings/schema/v3/float4_ord.json b/crates/eql-bindings/schema/v3/float4_ord.json index 0fd6f1d34..aa05fb2cd 100644 --- a/crates/eql-bindings/schema/v3/float4_ord.json +++ b/crates/eql-bindings/schema/v3/float4_ord.json @@ -39,23 +39,19 @@ "$id": "https://schemas.cipherstash.com/eql/v3/float4_ord.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`eql_v3.float4_ord` — full comparison (`=` `<>` `<` `<=` `>` `>=`).", + "description": "`eql_v3.float4_ord` — ordering domain.\n\nOperators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`.", "properties": { "c": { - "$ref": "#/$defs/Ciphertext", - "description": "mp_base85 source ciphertext. Required by the domain CHECK." + "$ref": "#/$defs/Ciphertext" }, "i": { - "$ref": "#/$defs/Identifier", - "description": "Table/column identifier. Required by the domain CHECK." + "$ref": "#/$defs/Identifier" }, "ob": { - "$ref": "#/$defs/OreBlock256", - "description": "Block-ORE order term (8 blocks for float). Serves equality too." + "$ref": "#/$defs/OreBlock256" }, "v": { - "$ref": "#/$defs/SchemaVersion", - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." + "$ref": "#/$defs/SchemaVersion" } }, "required": [ diff --git a/crates/eql-bindings/schema/v3/float4_ord_ore.json b/crates/eql-bindings/schema/v3/float4_ord_ore.json index ef776d7e8..790a2390b 100644 --- a/crates/eql-bindings/schema/v3/float4_ord_ore.json +++ b/crates/eql-bindings/schema/v3/float4_ord_ore.json @@ -39,23 +39,19 @@ "$id": "https://schemas.cipherstash.com/eql/v3/float4_ord_ore.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`eql_v3.float4_ord_ore` — full comparison, scheme-explicit name.", + "description": "`eql_v3.float4_ord_ore` — ordering domain.\n\nOperators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`.", "properties": { "c": { - "$ref": "#/$defs/Ciphertext", - "description": "mp_base85 source ciphertext. Required by the domain CHECK." + "$ref": "#/$defs/Ciphertext" }, "i": { - "$ref": "#/$defs/Identifier", - "description": "Table/column identifier. Required by the domain CHECK." + "$ref": "#/$defs/Identifier" }, "ob": { - "$ref": "#/$defs/OreBlock256", - "description": "Block-ORE order term (8 blocks for float). Serves equality too." + "$ref": "#/$defs/OreBlock256" }, "v": { - "$ref": "#/$defs/SchemaVersion", - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." + "$ref": "#/$defs/SchemaVersion" } }, "required": [ diff --git a/crates/eql-bindings/schema/v3/float8.json b/crates/eql-bindings/schema/v3/float8.json index 4a5275039..ee3cb70ac 100644 --- a/crates/eql-bindings/schema/v3/float8.json +++ b/crates/eql-bindings/schema/v3/float8.json @@ -32,19 +32,16 @@ "$id": "https://schemas.cipherstash.com/eql/v3/float8.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`eql_v3.float8` — storage only; every operator is blocked.", + "description": "`eql_v3.float8` — storage-only domain.\n\nOperators: none. Required keys: `v` `i` `c`.", "properties": { "c": { - "$ref": "#/$defs/Ciphertext", - "description": "mp_base85 source ciphertext. Required by the domain CHECK." + "$ref": "#/$defs/Ciphertext" }, "i": { - "$ref": "#/$defs/Identifier", - "description": "Table/column identifier. Required by the domain CHECK." + "$ref": "#/$defs/Identifier" }, "v": { - "$ref": "#/$defs/SchemaVersion", - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." + "$ref": "#/$defs/SchemaVersion" } }, "required": [ diff --git a/crates/eql-bindings/schema/v3/float8_eq.json b/crates/eql-bindings/schema/v3/float8_eq.json index 203c218ab..b1780b509 100644 --- a/crates/eql-bindings/schema/v3/float8_eq.json +++ b/crates/eql-bindings/schema/v3/float8_eq.json @@ -36,23 +36,19 @@ "$id": "https://schemas.cipherstash.com/eql/v3/float8_eq.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`eql_v3.float8_eq` — HMAC equality (`=`, `<>`).", + "description": "`eql_v3.float8_eq` — equality domain.\n\nOperators: `=` `<>`. Required keys: `v` `i` `c` `hm`.", "properties": { "c": { - "$ref": "#/$defs/Ciphertext", - "description": "mp_base85 source ciphertext. Required by the domain CHECK." + "$ref": "#/$defs/Ciphertext" }, "hm": { - "$ref": "#/$defs/Hmac256", - "description": "HMAC-SHA-256 equality term." + "$ref": "#/$defs/Hmac256" }, "i": { - "$ref": "#/$defs/Identifier", - "description": "Table/column identifier. Required by the domain CHECK." + "$ref": "#/$defs/Identifier" }, "v": { - "$ref": "#/$defs/SchemaVersion", - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." + "$ref": "#/$defs/SchemaVersion" } }, "required": [ diff --git a/crates/eql-bindings/schema/v3/float8_ord.json b/crates/eql-bindings/schema/v3/float8_ord.json index 416c036cb..dfe7171af 100644 --- a/crates/eql-bindings/schema/v3/float8_ord.json +++ b/crates/eql-bindings/schema/v3/float8_ord.json @@ -39,23 +39,19 @@ "$id": "https://schemas.cipherstash.com/eql/v3/float8_ord.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`eql_v3.float8_ord` — full comparison (`=` `<>` `<` `<=` `>` `>=`).", + "description": "`eql_v3.float8_ord` — ordering domain.\n\nOperators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`.", "properties": { "c": { - "$ref": "#/$defs/Ciphertext", - "description": "mp_base85 source ciphertext. Required by the domain CHECK." + "$ref": "#/$defs/Ciphertext" }, "i": { - "$ref": "#/$defs/Identifier", - "description": "Table/column identifier. Required by the domain CHECK." + "$ref": "#/$defs/Identifier" }, "ob": { - "$ref": "#/$defs/OreBlock256", - "description": "Block-ORE order term (8 blocks for float). Serves equality too." + "$ref": "#/$defs/OreBlock256" }, "v": { - "$ref": "#/$defs/SchemaVersion", - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." + "$ref": "#/$defs/SchemaVersion" } }, "required": [ diff --git a/crates/eql-bindings/schema/v3/float8_ord_ore.json b/crates/eql-bindings/schema/v3/float8_ord_ore.json index f58bc39c2..e3a997c73 100644 --- a/crates/eql-bindings/schema/v3/float8_ord_ore.json +++ b/crates/eql-bindings/schema/v3/float8_ord_ore.json @@ -39,23 +39,19 @@ "$id": "https://schemas.cipherstash.com/eql/v3/float8_ord_ore.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`eql_v3.float8_ord_ore` — full comparison, scheme-explicit name.", + "description": "`eql_v3.float8_ord_ore` — ordering domain.\n\nOperators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`.", "properties": { "c": { - "$ref": "#/$defs/Ciphertext", - "description": "mp_base85 source ciphertext. Required by the domain CHECK." + "$ref": "#/$defs/Ciphertext" }, "i": { - "$ref": "#/$defs/Identifier", - "description": "Table/column identifier. Required by the domain CHECK." + "$ref": "#/$defs/Identifier" }, "ob": { - "$ref": "#/$defs/OreBlock256", - "description": "Block-ORE order term (8 blocks for float). Serves equality too." + "$ref": "#/$defs/OreBlock256" }, "v": { - "$ref": "#/$defs/SchemaVersion", - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." + "$ref": "#/$defs/SchemaVersion" } }, "required": [ diff --git a/crates/eql-bindings/schema/v3/int2.json b/crates/eql-bindings/schema/v3/int2.json index c27fc54fd..5720f8dbc 100644 --- a/crates/eql-bindings/schema/v3/int2.json +++ b/crates/eql-bindings/schema/v3/int2.json @@ -32,19 +32,16 @@ "$id": "https://schemas.cipherstash.com/eql/v3/int2.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`eql_v3.int2` — storage only; every operator is blocked.", + "description": "`eql_v3.int2` — storage-only domain.\n\nOperators: none. Required keys: `v` `i` `c`.", "properties": { "c": { - "$ref": "#/$defs/Ciphertext", - "description": "mp_base85 source ciphertext. Required by the domain CHECK." + "$ref": "#/$defs/Ciphertext" }, "i": { - "$ref": "#/$defs/Identifier", - "description": "Table/column identifier. Required by the domain CHECK." + "$ref": "#/$defs/Identifier" }, "v": { - "$ref": "#/$defs/SchemaVersion", - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." + "$ref": "#/$defs/SchemaVersion" } }, "required": [ diff --git a/crates/eql-bindings/schema/v3/int2_eq.json b/crates/eql-bindings/schema/v3/int2_eq.json index 96a26d0bc..daae2e487 100644 --- a/crates/eql-bindings/schema/v3/int2_eq.json +++ b/crates/eql-bindings/schema/v3/int2_eq.json @@ -36,23 +36,19 @@ "$id": "https://schemas.cipherstash.com/eql/v3/int2_eq.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`eql_v3.int2_eq` — HMAC equality (`=`, `<>`).", + "description": "`eql_v3.int2_eq` — equality domain.\n\nOperators: `=` `<>`. Required keys: `v` `i` `c` `hm`.", "properties": { "c": { - "$ref": "#/$defs/Ciphertext", - "description": "mp_base85 source ciphertext. Required by the domain CHECK." + "$ref": "#/$defs/Ciphertext" }, "hm": { - "$ref": "#/$defs/Hmac256", - "description": "HMAC-SHA-256 equality term." + "$ref": "#/$defs/Hmac256" }, "i": { - "$ref": "#/$defs/Identifier", - "description": "Table/column identifier. Required by the domain CHECK." + "$ref": "#/$defs/Identifier" }, "v": { - "$ref": "#/$defs/SchemaVersion", - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." + "$ref": "#/$defs/SchemaVersion" } }, "required": [ diff --git a/crates/eql-bindings/schema/v3/int2_ord.json b/crates/eql-bindings/schema/v3/int2_ord.json index 4678285b3..e91805b64 100644 --- a/crates/eql-bindings/schema/v3/int2_ord.json +++ b/crates/eql-bindings/schema/v3/int2_ord.json @@ -39,23 +39,19 @@ "$id": "https://schemas.cipherstash.com/eql/v3/int2_ord.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`eql_v3.int2_ord` — full comparison (`=` `<>` `<` `<=` `>` `>=`).", + "description": "`eql_v3.int2_ord` — ordering domain.\n\nOperators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`.", "properties": { "c": { - "$ref": "#/$defs/Ciphertext", - "description": "mp_base85 source ciphertext. Required by the domain CHECK." + "$ref": "#/$defs/Ciphertext" }, "i": { - "$ref": "#/$defs/Identifier", - "description": "Table/column identifier. Required by the domain CHECK." + "$ref": "#/$defs/Identifier" }, "ob": { - "$ref": "#/$defs/OreBlock256", - "description": "Block-ORE order term. Serves equality too." + "$ref": "#/$defs/OreBlock256" }, "v": { - "$ref": "#/$defs/SchemaVersion", - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." + "$ref": "#/$defs/SchemaVersion" } }, "required": [ diff --git a/crates/eql-bindings/schema/v3/int2_ord_ore.json b/crates/eql-bindings/schema/v3/int2_ord_ore.json index 5d465c043..78e1f83ac 100644 --- a/crates/eql-bindings/schema/v3/int2_ord_ore.json +++ b/crates/eql-bindings/schema/v3/int2_ord_ore.json @@ -39,23 +39,19 @@ "$id": "https://schemas.cipherstash.com/eql/v3/int2_ord_ore.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`eql_v3.int2_ord_ore` — full comparison, scheme-explicit name.", + "description": "`eql_v3.int2_ord_ore` — ordering domain.\n\nOperators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`.", "properties": { "c": { - "$ref": "#/$defs/Ciphertext", - "description": "mp_base85 source ciphertext. Required by the domain CHECK." + "$ref": "#/$defs/Ciphertext" }, "i": { - "$ref": "#/$defs/Identifier", - "description": "Table/column identifier. Required by the domain CHECK." + "$ref": "#/$defs/Identifier" }, "ob": { - "$ref": "#/$defs/OreBlock256", - "description": "Block-ORE order term. Serves equality too." + "$ref": "#/$defs/OreBlock256" }, "v": { - "$ref": "#/$defs/SchemaVersion", - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." + "$ref": "#/$defs/SchemaVersion" } }, "required": [ diff --git a/crates/eql-bindings/schema/v3/int4.json b/crates/eql-bindings/schema/v3/int4.json index 6795e6620..fc239d942 100644 --- a/crates/eql-bindings/schema/v3/int4.json +++ b/crates/eql-bindings/schema/v3/int4.json @@ -32,19 +32,16 @@ "$id": "https://schemas.cipherstash.com/eql/v3/int4.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`eql_v3.int4` — storage only; every operator is blocked.", + "description": "`eql_v3.int4` — storage-only domain.\n\nOperators: none. Required keys: `v` `i` `c`.", "properties": { "c": { - "$ref": "#/$defs/Ciphertext", - "description": "mp_base85 source ciphertext. Required by the domain CHECK." + "$ref": "#/$defs/Ciphertext" }, "i": { - "$ref": "#/$defs/Identifier", - "description": "Table/column identifier. Required by the domain CHECK." + "$ref": "#/$defs/Identifier" }, "v": { - "$ref": "#/$defs/SchemaVersion", - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." + "$ref": "#/$defs/SchemaVersion" } }, "required": [ diff --git a/crates/eql-bindings/schema/v3/int4_eq.json b/crates/eql-bindings/schema/v3/int4_eq.json index dbc45c0d2..f919adb1c 100644 --- a/crates/eql-bindings/schema/v3/int4_eq.json +++ b/crates/eql-bindings/schema/v3/int4_eq.json @@ -36,23 +36,19 @@ "$id": "https://schemas.cipherstash.com/eql/v3/int4_eq.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`eql_v3.int4_eq` — HMAC equality (`=`, `<>`).", + "description": "`eql_v3.int4_eq` — equality domain.\n\nOperators: `=` `<>`. Required keys: `v` `i` `c` `hm`.", "properties": { "c": { - "$ref": "#/$defs/Ciphertext", - "description": "mp_base85 source ciphertext. Required by the domain CHECK." + "$ref": "#/$defs/Ciphertext" }, "hm": { - "$ref": "#/$defs/Hmac256", - "description": "HMAC-SHA-256 equality term." + "$ref": "#/$defs/Hmac256" }, "i": { - "$ref": "#/$defs/Identifier", - "description": "Table/column identifier. Required by the domain CHECK." + "$ref": "#/$defs/Identifier" }, "v": { - "$ref": "#/$defs/SchemaVersion", - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." + "$ref": "#/$defs/SchemaVersion" } }, "required": [ diff --git a/crates/eql-bindings/schema/v3/int4_ord.json b/crates/eql-bindings/schema/v3/int4_ord.json index 9cc352ba6..7d3e26ccf 100644 --- a/crates/eql-bindings/schema/v3/int4_ord.json +++ b/crates/eql-bindings/schema/v3/int4_ord.json @@ -39,23 +39,19 @@ "$id": "https://schemas.cipherstash.com/eql/v3/int4_ord.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`eql_v3.int4_ord` — full comparison (`=` `<>` `<` `<=` `>` `>=`).", + "description": "`eql_v3.int4_ord` — ordering domain.\n\nOperators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`.", "properties": { "c": { - "$ref": "#/$defs/Ciphertext", - "description": "mp_base85 source ciphertext. Required by the domain CHECK." + "$ref": "#/$defs/Ciphertext" }, "i": { - "$ref": "#/$defs/Identifier", - "description": "Table/column identifier. Required by the domain CHECK." + "$ref": "#/$defs/Identifier" }, "ob": { - "$ref": "#/$defs/OreBlock256", - "description": "Block-ORE order term. Serves equality too." + "$ref": "#/$defs/OreBlock256" }, "v": { - "$ref": "#/$defs/SchemaVersion", - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." + "$ref": "#/$defs/SchemaVersion" } }, "required": [ diff --git a/crates/eql-bindings/schema/v3/int4_ord_ore.json b/crates/eql-bindings/schema/v3/int4_ord_ore.json index 24d6e8877..baff10a3a 100644 --- a/crates/eql-bindings/schema/v3/int4_ord_ore.json +++ b/crates/eql-bindings/schema/v3/int4_ord_ore.json @@ -39,23 +39,19 @@ "$id": "https://schemas.cipherstash.com/eql/v3/int4_ord_ore.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`eql_v3.int4_ord_ore` — full comparison (`=` `<>` `<` `<=` `>` `>=`),\nscheme-explicit name. Same shape as [`Int4Ord`], distinct SQL domain.", + "description": "`eql_v3.int4_ord_ore` — ordering domain.\n\nOperators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`.", "properties": { "c": { - "$ref": "#/$defs/Ciphertext", - "description": "mp_base85 source ciphertext. Required by the domain CHECK." + "$ref": "#/$defs/Ciphertext" }, "i": { - "$ref": "#/$defs/Identifier", - "description": "Table/column identifier. Required by the domain CHECK." + "$ref": "#/$defs/Identifier" }, "ob": { - "$ref": "#/$defs/OreBlock256", - "description": "Block-ORE order term. Serves equality too — ORE over a\nfull-domain `int4` is lossless, so no separate `hm` is carried." + "$ref": "#/$defs/OreBlock256" }, "v": { - "$ref": "#/$defs/SchemaVersion", - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." + "$ref": "#/$defs/SchemaVersion" } }, "required": [ diff --git a/crates/eql-bindings/schema/v3/int8.json b/crates/eql-bindings/schema/v3/int8.json index 12555a6c9..32e0867c9 100644 --- a/crates/eql-bindings/schema/v3/int8.json +++ b/crates/eql-bindings/schema/v3/int8.json @@ -32,19 +32,16 @@ "$id": "https://schemas.cipherstash.com/eql/v3/int8.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`eql_v3.int8` — storage only; every operator is blocked.", + "description": "`eql_v3.int8` — storage-only domain.\n\nOperators: none. Required keys: `v` `i` `c`.", "properties": { "c": { - "$ref": "#/$defs/Ciphertext", - "description": "mp_base85 source ciphertext. Required by the domain CHECK." + "$ref": "#/$defs/Ciphertext" }, "i": { - "$ref": "#/$defs/Identifier", - "description": "Table/column identifier. Required by the domain CHECK." + "$ref": "#/$defs/Identifier" }, "v": { - "$ref": "#/$defs/SchemaVersion", - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." + "$ref": "#/$defs/SchemaVersion" } }, "required": [ diff --git a/crates/eql-bindings/schema/v3/int8_eq.json b/crates/eql-bindings/schema/v3/int8_eq.json index ea34847b0..f7cb6396d 100644 --- a/crates/eql-bindings/schema/v3/int8_eq.json +++ b/crates/eql-bindings/schema/v3/int8_eq.json @@ -36,23 +36,19 @@ "$id": "https://schemas.cipherstash.com/eql/v3/int8_eq.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`eql_v3.int8_eq` — HMAC equality (`=`, `<>`).", + "description": "`eql_v3.int8_eq` — equality domain.\n\nOperators: `=` `<>`. Required keys: `v` `i` `c` `hm`.", "properties": { "c": { - "$ref": "#/$defs/Ciphertext", - "description": "mp_base85 source ciphertext. Required by the domain CHECK." + "$ref": "#/$defs/Ciphertext" }, "hm": { - "$ref": "#/$defs/Hmac256", - "description": "HMAC-SHA-256 equality term." + "$ref": "#/$defs/Hmac256" }, "i": { - "$ref": "#/$defs/Identifier", - "description": "Table/column identifier. Required by the domain CHECK." + "$ref": "#/$defs/Identifier" }, "v": { - "$ref": "#/$defs/SchemaVersion", - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." + "$ref": "#/$defs/SchemaVersion" } }, "required": [ diff --git a/crates/eql-bindings/schema/v3/int8_ord.json b/crates/eql-bindings/schema/v3/int8_ord.json index e65dd149d..fcb82fbb8 100644 --- a/crates/eql-bindings/schema/v3/int8_ord.json +++ b/crates/eql-bindings/schema/v3/int8_ord.json @@ -39,23 +39,19 @@ "$id": "https://schemas.cipherstash.com/eql/v3/int8_ord.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`eql_v3.int8_ord` — full comparison (`=` `<>` `<` `<=` `>` `>=`).", + "description": "`eql_v3.int8_ord` — ordering domain.\n\nOperators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`.", "properties": { "c": { - "$ref": "#/$defs/Ciphertext", - "description": "mp_base85 source ciphertext. Required by the domain CHECK." + "$ref": "#/$defs/Ciphertext" }, "i": { - "$ref": "#/$defs/Identifier", - "description": "Table/column identifier. Required by the domain CHECK." + "$ref": "#/$defs/Identifier" }, "ob": { - "$ref": "#/$defs/OreBlock256", - "description": "Block-ORE order term. Serves equality too." + "$ref": "#/$defs/OreBlock256" }, "v": { - "$ref": "#/$defs/SchemaVersion", - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." + "$ref": "#/$defs/SchemaVersion" } }, "required": [ diff --git a/crates/eql-bindings/schema/v3/int8_ord_ore.json b/crates/eql-bindings/schema/v3/int8_ord_ore.json index ea6d88fde..630860268 100644 --- a/crates/eql-bindings/schema/v3/int8_ord_ore.json +++ b/crates/eql-bindings/schema/v3/int8_ord_ore.json @@ -39,23 +39,19 @@ "$id": "https://schemas.cipherstash.com/eql/v3/int8_ord_ore.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`eql_v3.int8_ord_ore` — full comparison, scheme-explicit name.", + "description": "`eql_v3.int8_ord_ore` — ordering domain.\n\nOperators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`.", "properties": { "c": { - "$ref": "#/$defs/Ciphertext", - "description": "mp_base85 source ciphertext. Required by the domain CHECK." + "$ref": "#/$defs/Ciphertext" }, "i": { - "$ref": "#/$defs/Identifier", - "description": "Table/column identifier. Required by the domain CHECK." + "$ref": "#/$defs/Identifier" }, "ob": { - "$ref": "#/$defs/OreBlock256", - "description": "Block-ORE order term. Serves equality too." + "$ref": "#/$defs/OreBlock256" }, "v": { - "$ref": "#/$defs/SchemaVersion", - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." + "$ref": "#/$defs/SchemaVersion" } }, "required": [ diff --git a/crates/eql-bindings/schema/v3/numeric.json b/crates/eql-bindings/schema/v3/numeric.json index f12015dcd..ac996aeaf 100644 --- a/crates/eql-bindings/schema/v3/numeric.json +++ b/crates/eql-bindings/schema/v3/numeric.json @@ -32,19 +32,16 @@ "$id": "https://schemas.cipherstash.com/eql/v3/numeric.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`eql_v3.numeric` — storage only; every operator is blocked.", + "description": "`eql_v3.numeric` — storage-only domain.\n\nOperators: none. Required keys: `v` `i` `c`.", "properties": { "c": { - "$ref": "#/$defs/Ciphertext", - "description": "mp_base85 source ciphertext. Required by the domain CHECK." + "$ref": "#/$defs/Ciphertext" }, "i": { - "$ref": "#/$defs/Identifier", - "description": "Table/column identifier. Required by the domain CHECK." + "$ref": "#/$defs/Identifier" }, "v": { - "$ref": "#/$defs/SchemaVersion", - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." + "$ref": "#/$defs/SchemaVersion" } }, "required": [ diff --git a/crates/eql-bindings/schema/v3/numeric_eq.json b/crates/eql-bindings/schema/v3/numeric_eq.json index 19c11a2b5..5160cd5d9 100644 --- a/crates/eql-bindings/schema/v3/numeric_eq.json +++ b/crates/eql-bindings/schema/v3/numeric_eq.json @@ -36,23 +36,19 @@ "$id": "https://schemas.cipherstash.com/eql/v3/numeric_eq.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`eql_v3.numeric_eq` — HMAC equality (`=`, `<>`).", + "description": "`eql_v3.numeric_eq` — equality domain.\n\nOperators: `=` `<>`. Required keys: `v` `i` `c` `hm`.", "properties": { "c": { - "$ref": "#/$defs/Ciphertext", - "description": "mp_base85 source ciphertext. Required by the domain CHECK." + "$ref": "#/$defs/Ciphertext" }, "hm": { - "$ref": "#/$defs/Hmac256", - "description": "HMAC-SHA-256 equality term." + "$ref": "#/$defs/Hmac256" }, "i": { - "$ref": "#/$defs/Identifier", - "description": "Table/column identifier. Required by the domain CHECK." + "$ref": "#/$defs/Identifier" }, "v": { - "$ref": "#/$defs/SchemaVersion", - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." + "$ref": "#/$defs/SchemaVersion" } }, "required": [ diff --git a/crates/eql-bindings/schema/v3/numeric_ord.json b/crates/eql-bindings/schema/v3/numeric_ord.json index 64ca517eb..f9936db57 100644 --- a/crates/eql-bindings/schema/v3/numeric_ord.json +++ b/crates/eql-bindings/schema/v3/numeric_ord.json @@ -39,23 +39,19 @@ "$id": "https://schemas.cipherstash.com/eql/v3/numeric_ord.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`eql_v3.numeric_ord` — full comparison (`=` `<>` `<` `<=` `>` `>=`).", + "description": "`eql_v3.numeric_ord` — ordering domain.\n\nOperators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`.", "properties": { "c": { - "$ref": "#/$defs/Ciphertext", - "description": "mp_base85 source ciphertext. Required by the domain CHECK." + "$ref": "#/$defs/Ciphertext" }, "i": { - "$ref": "#/$defs/Identifier", - "description": "Table/column identifier. Required by the domain CHECK." + "$ref": "#/$defs/Identifier" }, "ob": { - "$ref": "#/$defs/OreBlock256", - "description": "Block-ORE order term (14 blocks for numeric). Serves equality too." + "$ref": "#/$defs/OreBlock256" }, "v": { - "$ref": "#/$defs/SchemaVersion", - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." + "$ref": "#/$defs/SchemaVersion" } }, "required": [ diff --git a/crates/eql-bindings/schema/v3/numeric_ord_ore.json b/crates/eql-bindings/schema/v3/numeric_ord_ore.json index 3a2aad720..355e8c8f1 100644 --- a/crates/eql-bindings/schema/v3/numeric_ord_ore.json +++ b/crates/eql-bindings/schema/v3/numeric_ord_ore.json @@ -39,23 +39,19 @@ "$id": "https://schemas.cipherstash.com/eql/v3/numeric_ord_ore.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`eql_v3.numeric_ord_ore` — full comparison, scheme-explicit name.", + "description": "`eql_v3.numeric_ord_ore` — ordering domain.\n\nOperators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`.", "properties": { "c": { - "$ref": "#/$defs/Ciphertext", - "description": "mp_base85 source ciphertext. Required by the domain CHECK." + "$ref": "#/$defs/Ciphertext" }, "i": { - "$ref": "#/$defs/Identifier", - "description": "Table/column identifier. Required by the domain CHECK." + "$ref": "#/$defs/Identifier" }, "ob": { - "$ref": "#/$defs/OreBlock256", - "description": "Block-ORE order term (14 blocks for numeric). Serves equality too." + "$ref": "#/$defs/OreBlock256" }, "v": { - "$ref": "#/$defs/SchemaVersion", - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." + "$ref": "#/$defs/SchemaVersion" } }, "required": [ diff --git a/crates/eql-bindings/schema/v3/text.json b/crates/eql-bindings/schema/v3/text.json index a045b2caf..efb51f906 100644 --- a/crates/eql-bindings/schema/v3/text.json +++ b/crates/eql-bindings/schema/v3/text.json @@ -32,19 +32,16 @@ "$id": "https://schemas.cipherstash.com/eql/v3/text.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`eql_v3.text` — storage only; every operator is blocked.", + "description": "`eql_v3.text` — storage-only domain.\n\nOperators: none. Required keys: `v` `i` `c`.", "properties": { "c": { - "$ref": "#/$defs/Ciphertext", - "description": "mp_base85 source ciphertext. Required by the domain CHECK." + "$ref": "#/$defs/Ciphertext" }, "i": { - "$ref": "#/$defs/Identifier", - "description": "Table/column identifier. Required by the domain CHECK." + "$ref": "#/$defs/Identifier" }, "v": { - "$ref": "#/$defs/SchemaVersion", - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." + "$ref": "#/$defs/SchemaVersion" } }, "required": [ diff --git a/crates/eql-bindings/schema/v3/text_eq.json b/crates/eql-bindings/schema/v3/text_eq.json index 40d452fd5..2b15151a9 100644 --- a/crates/eql-bindings/schema/v3/text_eq.json +++ b/crates/eql-bindings/schema/v3/text_eq.json @@ -36,23 +36,19 @@ "$id": "https://schemas.cipherstash.com/eql/v3/text_eq.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`eql_v3.text_eq` — HMAC equality (`=`, `<>`).", + "description": "`eql_v3.text_eq` — equality domain.\n\nOperators: `=` `<>`. Required keys: `v` `i` `c` `hm`.", "properties": { "c": { - "$ref": "#/$defs/Ciphertext", - "description": "mp_base85 source ciphertext. Required by the domain CHECK." + "$ref": "#/$defs/Ciphertext" }, "hm": { - "$ref": "#/$defs/Hmac256", - "description": "HMAC-SHA-256 equality term." + "$ref": "#/$defs/Hmac256" }, "i": { - "$ref": "#/$defs/Identifier", - "description": "Table/column identifier. Required by the domain CHECK." + "$ref": "#/$defs/Identifier" }, "v": { - "$ref": "#/$defs/SchemaVersion", - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." + "$ref": "#/$defs/SchemaVersion" } }, "required": [ diff --git a/crates/eql-bindings/schema/v3/text_match.json b/crates/eql-bindings/schema/v3/text_match.json index 98c772c40..c1453dbea 100644 --- a/crates/eql-bindings/schema/v3/text_match.json +++ b/crates/eql-bindings/schema/v3/text_match.json @@ -42,23 +42,19 @@ "$id": "https://schemas.cipherstash.com/eql/v3/text_match.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`eql_v3.text_match` — Bloom-filter containment match.", + "description": "`eql_v3.text_match` — match domain.\n\nOperators: `@>` `<@`. Required keys: `v` `i` `c` `bf`.", "properties": { "bf": { - "$ref": "#/$defs/BloomFilter", - "description": "Bloom-filter match term (signed smallint bit positions)." + "$ref": "#/$defs/BloomFilter" }, "c": { - "$ref": "#/$defs/Ciphertext", - "description": "mp_base85 source ciphertext. Required by the domain CHECK." + "$ref": "#/$defs/Ciphertext" }, "i": { - "$ref": "#/$defs/Identifier", - "description": "Table/column identifier. Required by the domain CHECK." + "$ref": "#/$defs/Identifier" }, "v": { - "$ref": "#/$defs/SchemaVersion", - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." + "$ref": "#/$defs/SchemaVersion" } }, "required": [ diff --git a/crates/eql-bindings/schema/v3/text_ord.json b/crates/eql-bindings/schema/v3/text_ord.json index be2b77459..b8873f5d7 100644 --- a/crates/eql-bindings/schema/v3/text_ord.json +++ b/crates/eql-bindings/schema/v3/text_ord.json @@ -43,27 +43,22 @@ "$id": "https://schemas.cipherstash.com/eql/v3/text_ord.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`eql_v3.text_ord` — full lexicographic comparison\n(`=` `<>` `<` `<=` `>` `>=`). Carries both `hm` (equality) and `ob`\n(ordering) — text routes equality through `hm` (`[Hm, Ore]`).", + "description": "`eql_v3.text_ord` — ordering domain.\n\nOperators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `hm` `ob`.", "properties": { "c": { - "$ref": "#/$defs/Ciphertext", - "description": "mp_base85 source ciphertext. Required by the domain CHECK." + "$ref": "#/$defs/Ciphertext" }, "hm": { - "$ref": "#/$defs/Hmac256", - "description": "HMAC-SHA-256 equality term. Text routes `=`/`<>` through `hm`." + "$ref": "#/$defs/Hmac256" }, "i": { - "$ref": "#/$defs/Identifier", - "description": "Table/column identifier. Required by the domain CHECK." + "$ref": "#/$defs/Identifier" }, "ob": { - "$ref": "#/$defs/OreBlock256", - "description": "Block-ORE order term." + "$ref": "#/$defs/OreBlock256" }, "v": { - "$ref": "#/$defs/SchemaVersion", - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." + "$ref": "#/$defs/SchemaVersion" } }, "required": [ diff --git a/crates/eql-bindings/schema/v3/text_ord_ore.json b/crates/eql-bindings/schema/v3/text_ord_ore.json index b35544c05..422d1fa23 100644 --- a/crates/eql-bindings/schema/v3/text_ord_ore.json +++ b/crates/eql-bindings/schema/v3/text_ord_ore.json @@ -43,27 +43,22 @@ "$id": "https://schemas.cipherstash.com/eql/v3/text_ord_ore.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`eql_v3.text_ord_ore` — full lexicographic comparison,\nscheme-explicit name. Unlike the integer ordered domains (`[Ore]` only),\ntext routes equality through `hm` rather than the ORE term, so the domain\ncarries both `hm` and `ob` (`[Hm, Ore]`).", + "description": "`eql_v3.text_ord_ore` — ordering domain.\n\nOperators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `hm` `ob`.", "properties": { "c": { - "$ref": "#/$defs/Ciphertext", - "description": "mp_base85 source ciphertext. Required by the domain CHECK." + "$ref": "#/$defs/Ciphertext" }, "hm": { - "$ref": "#/$defs/Hmac256", - "description": "HMAC-SHA-256 equality term. Text routes `=`/`<>` through `hm`." + "$ref": "#/$defs/Hmac256" }, "i": { - "$ref": "#/$defs/Identifier", - "description": "Table/column identifier. Required by the domain CHECK." + "$ref": "#/$defs/Identifier" }, "ob": { - "$ref": "#/$defs/OreBlock256", - "description": "Block-ORE order term." + "$ref": "#/$defs/OreBlock256" }, "v": { - "$ref": "#/$defs/SchemaVersion", - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." + "$ref": "#/$defs/SchemaVersion" } }, "required": [ diff --git a/crates/eql-bindings/schema/v3/text_search.json b/crates/eql-bindings/schema/v3/text_search.json index a66cee2bc..d24d35a7e 100644 --- a/crates/eql-bindings/schema/v3/text_search.json +++ b/crates/eql-bindings/schema/v3/text_search.json @@ -53,31 +53,25 @@ "$id": "https://schemas.cipherstash.com/eql/v3/text_search.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`eql_v3.text_search` — the full text search surface: HMAC equality, ORE\nordering, and Bloom-filter containment match (`[Hm, Ore, Bloom]`). The\nsuperset domain combining `_eq`, `_ord`, and `_match`.", + "description": "`eql_v3.text_search` — search domain.\n\nOperators: `=` `<>` `<` `<=` `>` `>=` `@>` `<@`. Required keys: `v` `i` `c` `hm` `ob` `bf`.", "properties": { "bf": { - "$ref": "#/$defs/BloomFilter", - "description": "Bloom-filter match term (signed smallint bit positions)." + "$ref": "#/$defs/BloomFilter" }, "c": { - "$ref": "#/$defs/Ciphertext", - "description": "mp_base85 source ciphertext. Required by the domain CHECK." + "$ref": "#/$defs/Ciphertext" }, "hm": { - "$ref": "#/$defs/Hmac256", - "description": "HMAC-SHA-256 equality term." + "$ref": "#/$defs/Hmac256" }, "i": { - "$ref": "#/$defs/Identifier", - "description": "Table/column identifier. Required by the domain CHECK." + "$ref": "#/$defs/Identifier" }, "ob": { - "$ref": "#/$defs/OreBlock256", - "description": "Block-ORE order term." + "$ref": "#/$defs/OreBlock256" }, "v": { - "$ref": "#/$defs/SchemaVersion", - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." + "$ref": "#/$defs/SchemaVersion" } }, "required": [ diff --git a/crates/eql-bindings/schema/v3/timestamptz.json b/crates/eql-bindings/schema/v3/timestamptz.json index d8f3650e5..72979fc1a 100644 --- a/crates/eql-bindings/schema/v3/timestamptz.json +++ b/crates/eql-bindings/schema/v3/timestamptz.json @@ -32,19 +32,16 @@ "$id": "https://schemas.cipherstash.com/eql/v3/timestamptz.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`eql_v3.timestamptz` — storage only; every operator is blocked.", + "description": "`eql_v3.timestamptz` — storage-only domain.\n\nOperators: none. Required keys: `v` `i` `c`.", "properties": { "c": { - "$ref": "#/$defs/Ciphertext", - "description": "mp_base85 source ciphertext. Required by the domain CHECK." + "$ref": "#/$defs/Ciphertext" }, "i": { - "$ref": "#/$defs/Identifier", - "description": "Table/column identifier. Required by the domain CHECK." + "$ref": "#/$defs/Identifier" }, "v": { - "$ref": "#/$defs/SchemaVersion", - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." + "$ref": "#/$defs/SchemaVersion" } }, "required": [ diff --git a/crates/eql-bindings/schema/v3/timestamptz_eq.json b/crates/eql-bindings/schema/v3/timestamptz_eq.json index 490e463d1..75fd55757 100644 --- a/crates/eql-bindings/schema/v3/timestamptz_eq.json +++ b/crates/eql-bindings/schema/v3/timestamptz_eq.json @@ -36,23 +36,19 @@ "$id": "https://schemas.cipherstash.com/eql/v3/timestamptz_eq.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`eql_v3.timestamptz_eq` — HMAC equality (`=`, `<>`).", + "description": "`eql_v3.timestamptz_eq` — equality domain.\n\nOperators: `=` `<>`. Required keys: `v` `i` `c` `hm`.", "properties": { "c": { - "$ref": "#/$defs/Ciphertext", - "description": "mp_base85 source ciphertext. Required by the domain CHECK." + "$ref": "#/$defs/Ciphertext" }, "hm": { - "$ref": "#/$defs/Hmac256", - "description": "HMAC-SHA-256 equality term." + "$ref": "#/$defs/Hmac256" }, "i": { - "$ref": "#/$defs/Identifier", - "description": "Table/column identifier. Required by the domain CHECK." + "$ref": "#/$defs/Identifier" }, "v": { - "$ref": "#/$defs/SchemaVersion", - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." + "$ref": "#/$defs/SchemaVersion" } }, "required": [ diff --git a/crates/eql-bindings/schema/v3/timestamptz_ord.json b/crates/eql-bindings/schema/v3/timestamptz_ord.json index 37557b81e..ea45adf33 100644 --- a/crates/eql-bindings/schema/v3/timestamptz_ord.json +++ b/crates/eql-bindings/schema/v3/timestamptz_ord.json @@ -39,23 +39,19 @@ "$id": "https://schemas.cipherstash.com/eql/v3/timestamptz_ord.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`eql_v3.timestamptz_ord` — full comparison (`=` `<>` `<` `<=` `>` `>=`).", + "description": "`eql_v3.timestamptz_ord` — ordering domain.\n\nOperators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`.", "properties": { "c": { - "$ref": "#/$defs/Ciphertext", - "description": "mp_base85 source ciphertext. Required by the domain CHECK." + "$ref": "#/$defs/Ciphertext" }, "i": { - "$ref": "#/$defs/Identifier", - "description": "Table/column identifier. Required by the domain CHECK." + "$ref": "#/$defs/Identifier" }, "ob": { - "$ref": "#/$defs/OreBlock256", - "description": "Block-ORE order term (12 blocks for timestamptz). Serves equality too." + "$ref": "#/$defs/OreBlock256" }, "v": { - "$ref": "#/$defs/SchemaVersion", - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." + "$ref": "#/$defs/SchemaVersion" } }, "required": [ diff --git a/crates/eql-bindings/schema/v3/timestamptz_ord_ore.json b/crates/eql-bindings/schema/v3/timestamptz_ord_ore.json index 655bb406d..731b3e0ac 100644 --- a/crates/eql-bindings/schema/v3/timestamptz_ord_ore.json +++ b/crates/eql-bindings/schema/v3/timestamptz_ord_ore.json @@ -39,23 +39,19 @@ "$id": "https://schemas.cipherstash.com/eql/v3/timestamptz_ord_ore.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`eql_v3.timestamptz_ord_ore` — full comparison, scheme-explicit name.", + "description": "`eql_v3.timestamptz_ord_ore` — ordering domain.\n\nOperators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`.", "properties": { "c": { - "$ref": "#/$defs/Ciphertext", - "description": "mp_base85 source ciphertext. Required by the domain CHECK." + "$ref": "#/$defs/Ciphertext" }, "i": { - "$ref": "#/$defs/Identifier", - "description": "Table/column identifier. Required by the domain CHECK." + "$ref": "#/$defs/Identifier" }, "ob": { - "$ref": "#/$defs/OreBlock256", - "description": "Block-ORE order term (12 blocks for timestamptz). Serves equality too." + "$ref": "#/$defs/OreBlock256" }, "v": { - "$ref": "#/$defs/SchemaVersion", - "description": "Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other\nvalue fails deserialization." + "$ref": "#/$defs/SchemaVersion" } }, "required": [ diff --git a/crates/eql-bindings/src/v3/bool.rs b/crates/eql-bindings/src/v3/bool.rs index 7ccc6240c..858a5806c 100644 --- a/crates/eql-bindings/src/v3/bool.rs +++ b/crates/eql-bindings/src/v3/bool.rs @@ -1,49 +1,29 @@ -//! The `bool` encrypted-domain family — the storage-only / encryption-only -//! scalar. -//! -//! | Rust type | SQL domain | Required keys | Operators | -//! |------------|----------------|---------------|---------------------| -//! | [`Bool`] | `eql_v3.bool` | `v` `i` `c` | none (storage only) | -//! -//! `bool` is the only **storage-only** scalar: it has no `_eq`/`_ord` domain -//! and carries no index term, so the value is encrypted at rest and decrypted -//! by the proxy but is never searchable server-side. A two-value column has so -//! little cardinality that any searchable index (even HMAC equality) would -//! trivially leak the plaintext distribution. The payload is `{v,i,c}` only — -//! no `hm`/`ob`/`bf` — and every operator on the domain is blocked. - -use schemars::{schema_for, Schema}; - +// @generated by eql-codegen from the eql-domains catalog — do not edit +//! The `bool` encrypted-domain family — generated from the eql-domains catalog. use crate::v3::terms::Ciphertext; use crate::v3::DomainType; use crate::{Identifier, SchemaVersion}; -use schemars::JsonSchema; +use schemars::{schema_for, JsonSchema, Schema}; use serde::{Deserialize, Serialize}; use ts_rs::TS; - -/// `eql_v3.bool` — storage only / encryption-only; every operator is blocked. +/// `eql_v3.bool` — storage-only domain. +/// +/// Operators: none. Required keys: `v` `i` `c`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct Bool { - /// Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - /// value fails deserialization. pub v: SchemaVersion, - /// Table/column identifier. Required by the domain CHECK. pub i: Identifier, - /// mp_base85 source ciphertext. Required by the domain CHECK. pub c: Ciphertext, } - impl DomainType for Bool { fn sql_domain_static() -> &'static str { "eql_v3.bool" } - fn sql_domain(&self) -> &'static str { Self::sql_domain_static() } - fn schema(&self) -> Schema { schema_for!(Bool) } diff --git a/crates/eql-bindings/src/v3/date.rs b/crates/eql-bindings/src/v3/date.rs index ce44eba03..3e0fa45fd 100644 --- a/crates/eql-bindings/src/v3/date.rs +++ b/crates/eql-bindings/src/v3/date.rs @@ -1,130 +1,98 @@ -//! The `date` encrypted-domain family — an ordered, non-integer scalar. -//! Same four-domain ordered shape as [`crate::v3::int4`] (ORE compares -//! ciphertext, so dates order like integers); see that module for the -//! capability table. - -use schemars::{schema_for, Schema}; - +// @generated by eql-codegen from the eql-domains catalog — do not edit +//! The `date` encrypted-domain family — generated from the eql-domains catalog. use crate::v3::terms::{Ciphertext, Hmac256, OreBlock256}; use crate::v3::DomainType; use crate::{Identifier, SchemaVersion}; -use schemars::JsonSchema; +use schemars::{schema_for, JsonSchema, Schema}; use serde::{Deserialize, Serialize}; use ts_rs::TS; - -/// `eql_v3.date` — storage only; every operator is blocked. +/// `eql_v3.date` — storage-only domain. +/// +/// Operators: none. Required keys: `v` `i` `c`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct Date { - /// Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - /// value fails deserialization. pub v: SchemaVersion, - /// Table/column identifier. Required by the domain CHECK. pub i: Identifier, - /// mp_base85 source ciphertext. Required by the domain CHECK. pub c: Ciphertext, } - impl DomainType for Date { fn sql_domain_static() -> &'static str { "eql_v3.date" } - fn sql_domain(&self) -> &'static str { Self::sql_domain_static() } - fn schema(&self) -> Schema { schema_for!(Date) } } - -/// `eql_v3.date_eq` — HMAC equality (`=`, `<>`). +/// `eql_v3.date_eq` — equality domain. +/// +/// Operators: `=` `<>`. Required keys: `v` `i` `c` `hm`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct DateEq { - /// Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - /// value fails deserialization. pub v: SchemaVersion, - /// Table/column identifier. Required by the domain CHECK. pub i: Identifier, - /// mp_base85 source ciphertext. Required by the domain CHECK. pub c: Ciphertext, - /// HMAC-SHA-256 equality term. pub hm: Hmac256, } - impl DomainType for DateEq { fn sql_domain_static() -> &'static str { "eql_v3.date_eq" } - fn sql_domain(&self) -> &'static str { Self::sql_domain_static() } - fn schema(&self) -> Schema { schema_for!(DateEq) } } - -/// `eql_v3.date_ord_ore` — full comparison, scheme-explicit name. +/// `eql_v3.date_ord_ore` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct DateOrdOre { - /// Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - /// value fails deserialization. pub v: SchemaVersion, - /// Table/column identifier. Required by the domain CHECK. pub i: Identifier, - /// mp_base85 source ciphertext. Required by the domain CHECK. pub c: Ciphertext, - /// Block-ORE order term. Serves equality too. pub ob: OreBlock256, } - impl DomainType for DateOrdOre { fn sql_domain_static() -> &'static str { "eql_v3.date_ord_ore" } - fn sql_domain(&self) -> &'static str { Self::sql_domain_static() } - fn schema(&self) -> Schema { schema_for!(DateOrdOre) } } - -/// `eql_v3.date_ord` — full comparison (`=` `<>` `<` `<=` `>` `>=`). +/// `eql_v3.date_ord` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct DateOrd { - /// Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - /// value fails deserialization. pub v: SchemaVersion, - /// Table/column identifier. Required by the domain CHECK. pub i: Identifier, - /// mp_base85 source ciphertext. Required by the domain CHECK. pub c: Ciphertext, - /// Block-ORE order term. Serves equality too. pub ob: OreBlock256, } - impl DomainType for DateOrd { fn sql_domain_static() -> &'static str { "eql_v3.date_ord" } - fn sql_domain(&self) -> &'static str { Self::sql_domain_static() } - fn schema(&self) -> Schema { schema_for!(DateOrd) } diff --git a/crates/eql-bindings/src/v3/domain_type.rs b/crates/eql-bindings/src/v3/domain_type.rs index c9a022756..6eee3694a 100644 --- a/crates/eql-bindings/src/v3/domain_type.rs +++ b/crates/eql-bindings/src/v3/domain_type.rs @@ -20,12 +20,10 @@ pub const SCHEMA_ID_BASE: &str = "https://schemas.cipherstash.com/eql/v3/"; /// value can report the SQL domain it inhabits (`payload.sql_domain()`). /// /// Each token file implements this next to the type it describes; the SQL -/// domain string is defined exactly once, in that impl, and -/// `tests/catalog_parity.rs` cross-checks every entry of [`all`] against -/// `eql-domains::CATALOG` — a typo'd or mis-ordered domain fails there. +/// domain string is defined exactly once, in that impl. `all()` is generated +/// from `eql-domains::CATALOG` (`inventory.rs`), so it cannot drift; the +/// published JSON Schema wire contract is pinned by `tests/catalog_parity.rs`. /// Public so FFI consumers can enumerate the protocol surface too. -/// -/// [`all`]: super::all pub trait DomainType { /// Fully-qualified SQL domain name, e.g. `"eql_v3.int4_eq"` — the /// per-type fact everything else derives from, defined once in each diff --git a/crates/eql-bindings/src/v3/float4.rs b/crates/eql-bindings/src/v3/float4.rs index d9549c897..944f5265e 100644 --- a/crates/eql-bindings/src/v3/float4.rs +++ b/crates/eql-bindings/src/v3/float4.rs @@ -1,140 +1,98 @@ -//! The `float4` encrypted-domain family — an ordered, non-integer scalar -//! backed by IEEE-754 `real` (`f32`). Same four-domain ordered shape as -//! [`crate::v3::int4`] (ORE compares ciphertext, so floats order like -//! integers); see that module for the capability table. -//! -//! Both float widths encrypt through a single f64 crypto path -//! (`Plaintext::Float`): a `real` is widened to f64 before encryption, so the -//! wire shape here is identical to [`crate::v3::float8`] — an 8-block `ob` term -//! (`f64::ENCODED_LEN == 8`, same as `int8`). `float4` vs `float8` is purely a -//! Postgres-surface distinction (column type, domain name). -//! -//! Special-value behaviour (`-0.0`, `±Inf`, and the **NaN is not rejected -//! server-side — reject it client-side** caveat) is identical to `float8`; see -//! [`crate::v3::float8`] for the full note. - -use schemars::{schema_for, Schema}; - +// @generated by eql-codegen from the eql-domains catalog — do not edit +//! The `float4` encrypted-domain family — generated from the eql-domains catalog. use crate::v3::terms::{Ciphertext, Hmac256, OreBlock256}; use crate::v3::DomainType; use crate::{Identifier, SchemaVersion}; -use schemars::JsonSchema; +use schemars::{schema_for, JsonSchema, Schema}; use serde::{Deserialize, Serialize}; use ts_rs::TS; - -/// `eql_v3.float4` — storage only; every operator is blocked. +/// `eql_v3.float4` — storage-only domain. +/// +/// Operators: none. Required keys: `v` `i` `c`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct Float4 { - /// Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - /// value fails deserialization. pub v: SchemaVersion, - /// Table/column identifier. Required by the domain CHECK. pub i: Identifier, - /// mp_base85 source ciphertext. Required by the domain CHECK. pub c: Ciphertext, } - impl DomainType for Float4 { fn sql_domain_static() -> &'static str { "eql_v3.float4" } - fn sql_domain(&self) -> &'static str { Self::sql_domain_static() } - fn schema(&self) -> Schema { schema_for!(Float4) } } - -/// `eql_v3.float4_eq` — HMAC equality (`=`, `<>`). +/// `eql_v3.float4_eq` — equality domain. +/// +/// Operators: `=` `<>`. Required keys: `v` `i` `c` `hm`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct Float4Eq { - /// Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - /// value fails deserialization. pub v: SchemaVersion, - /// Table/column identifier. Required by the domain CHECK. pub i: Identifier, - /// mp_base85 source ciphertext. Required by the domain CHECK. pub c: Ciphertext, - /// HMAC-SHA-256 equality term. pub hm: Hmac256, } - impl DomainType for Float4Eq { fn sql_domain_static() -> &'static str { "eql_v3.float4_eq" } - fn sql_domain(&self) -> &'static str { Self::sql_domain_static() } - fn schema(&self) -> Schema { schema_for!(Float4Eq) } } - -/// `eql_v3.float4_ord_ore` — full comparison, scheme-explicit name. +/// `eql_v3.float4_ord_ore` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct Float4OrdOre { - /// Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - /// value fails deserialization. pub v: SchemaVersion, - /// Table/column identifier. Required by the domain CHECK. pub i: Identifier, - /// mp_base85 source ciphertext. Required by the domain CHECK. pub c: Ciphertext, - /// Block-ORE order term (8 blocks for float). Serves equality too. pub ob: OreBlock256, } - impl DomainType for Float4OrdOre { fn sql_domain_static() -> &'static str { "eql_v3.float4_ord_ore" } - fn sql_domain(&self) -> &'static str { Self::sql_domain_static() } - fn schema(&self) -> Schema { schema_for!(Float4OrdOre) } } - -/// `eql_v3.float4_ord` — full comparison (`=` `<>` `<` `<=` `>` `>=`). +/// `eql_v3.float4_ord` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct Float4Ord { - /// Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - /// value fails deserialization. pub v: SchemaVersion, - /// Table/column identifier. Required by the domain CHECK. pub i: Identifier, - /// mp_base85 source ciphertext. Required by the domain CHECK. pub c: Ciphertext, - /// Block-ORE order term (8 blocks for float). Serves equality too. pub ob: OreBlock256, } - impl DomainType for Float4Ord { fn sql_domain_static() -> &'static str { "eql_v3.float4_ord" } - fn sql_domain(&self) -> &'static str { Self::sql_domain_static() } - fn schema(&self) -> Schema { schema_for!(Float4Ord) } diff --git a/crates/eql-bindings/src/v3/float8.rs b/crates/eql-bindings/src/v3/float8.rs index 26e1863f6..4442ad27b 100644 --- a/crates/eql-bindings/src/v3/float8.rs +++ b/crates/eql-bindings/src/v3/float8.rs @@ -1,149 +1,98 @@ -//! The `float8` encrypted-domain family — an ordered, non-integer scalar -//! backed by IEEE-754 `double precision` (`f64`), the native width of the float -//! crypto path. Same four-domain ordered shape as [`crate::v3::int4`]; see that -//! module for the capability table. -//! -//! Both float widths encrypt through a single f64 crypto path -//! (`Plaintext::Float`), so the wire shape is identical to -//! [`crate::v3::float4`] — an 8-block `ob` term (`f64::ENCODED_LEN == 8`, same -//! as `int8`). -//! -//! ## Special values (caller-facing) -//! -//! `-0.0` canonicalizes to `+0.0` (equal under `=`, IEEE-consistent) and -//! `±Inf` order correctly (`-Inf < finite < +Inf`). **NaN is unordered and -//! unspecified in the encoder**: it can be encrypted, stored, and pass the -//! domain CHECK, but it carries **no comparison guarantee** and does NOT follow -//! IEEE semantics (where NaN compares false against everything). The domain -//! CHECK validates only the envelope — it cannot inspect the ciphertext — so a -//! NaN payload is never rejected server-side. **Reject NaN client-side before -//! encryption** if your column must not contain it; otherwise a NaN row sorts -//! at an arbitrary (but deterministic) position in an encrypted range scan -//! rather than being excluded the way native Postgres `double precision` would. -//! See the `float_special` regression suite for the locked behaviour. - -use schemars::{schema_for, Schema}; - +// @generated by eql-codegen from the eql-domains catalog — do not edit +//! The `float8` encrypted-domain family — generated from the eql-domains catalog. use crate::v3::terms::{Ciphertext, Hmac256, OreBlock256}; use crate::v3::DomainType; use crate::{Identifier, SchemaVersion}; -use schemars::JsonSchema; +use schemars::{schema_for, JsonSchema, Schema}; use serde::{Deserialize, Serialize}; use ts_rs::TS; - -/// `eql_v3.float8` — storage only; every operator is blocked. +/// `eql_v3.float8` — storage-only domain. +/// +/// Operators: none. Required keys: `v` `i` `c`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct Float8 { - /// Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - /// value fails deserialization. pub v: SchemaVersion, - /// Table/column identifier. Required by the domain CHECK. pub i: Identifier, - /// mp_base85 source ciphertext. Required by the domain CHECK. pub c: Ciphertext, } - impl DomainType for Float8 { fn sql_domain_static() -> &'static str { "eql_v3.float8" } - fn sql_domain(&self) -> &'static str { Self::sql_domain_static() } - fn schema(&self) -> Schema { schema_for!(Float8) } } - -/// `eql_v3.float8_eq` — HMAC equality (`=`, `<>`). +/// `eql_v3.float8_eq` — equality domain. +/// +/// Operators: `=` `<>`. Required keys: `v` `i` `c` `hm`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct Float8Eq { - /// Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - /// value fails deserialization. pub v: SchemaVersion, - /// Table/column identifier. Required by the domain CHECK. pub i: Identifier, - /// mp_base85 source ciphertext. Required by the domain CHECK. pub c: Ciphertext, - /// HMAC-SHA-256 equality term. pub hm: Hmac256, } - impl DomainType for Float8Eq { fn sql_domain_static() -> &'static str { "eql_v3.float8_eq" } - fn sql_domain(&self) -> &'static str { Self::sql_domain_static() } - fn schema(&self) -> Schema { schema_for!(Float8Eq) } } - -/// `eql_v3.float8_ord_ore` — full comparison, scheme-explicit name. +/// `eql_v3.float8_ord_ore` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct Float8OrdOre { - /// Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - /// value fails deserialization. pub v: SchemaVersion, - /// Table/column identifier. Required by the domain CHECK. pub i: Identifier, - /// mp_base85 source ciphertext. Required by the domain CHECK. pub c: Ciphertext, - /// Block-ORE order term (8 blocks for float). Serves equality too. pub ob: OreBlock256, } - impl DomainType for Float8OrdOre { fn sql_domain_static() -> &'static str { "eql_v3.float8_ord_ore" } - fn sql_domain(&self) -> &'static str { Self::sql_domain_static() } - fn schema(&self) -> Schema { schema_for!(Float8OrdOre) } } - -/// `eql_v3.float8_ord` — full comparison (`=` `<>` `<` `<=` `>` `>=`). +/// `eql_v3.float8_ord` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct Float8Ord { - /// Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - /// value fails deserialization. pub v: SchemaVersion, - /// Table/column identifier. Required by the domain CHECK. pub i: Identifier, - /// mp_base85 source ciphertext. Required by the domain CHECK. pub c: Ciphertext, - /// Block-ORE order term (8 blocks for float). Serves equality too. pub ob: OreBlock256, } - impl DomainType for Float8Ord { fn sql_domain_static() -> &'static str { "eql_v3.float8_ord" } - fn sql_domain(&self) -> &'static str { Self::sql_domain_static() } - fn schema(&self) -> Schema { schema_for!(Float8Ord) } diff --git a/crates/eql-bindings/src/v3/int2.rs b/crates/eql-bindings/src/v3/int2.rs index ee179e6a1..102a56cec 100644 --- a/crates/eql-bindings/src/v3/int2.rs +++ b/crates/eql-bindings/src/v3/int2.rs @@ -1,128 +1,98 @@ -//! The `int2` encrypted-domain family. Same four-domain ordered shape as -//! [`crate::v3::int4`] — see that module for the capability table. - -use schemars::{schema_for, Schema}; - +// @generated by eql-codegen from the eql-domains catalog — do not edit +//! The `int2` encrypted-domain family — generated from the eql-domains catalog. use crate::v3::terms::{Ciphertext, Hmac256, OreBlock256}; use crate::v3::DomainType; use crate::{Identifier, SchemaVersion}; -use schemars::JsonSchema; +use schemars::{schema_for, JsonSchema, Schema}; use serde::{Deserialize, Serialize}; use ts_rs::TS; - -/// `eql_v3.int2` — storage only; every operator is blocked. +/// `eql_v3.int2` — storage-only domain. +/// +/// Operators: none. Required keys: `v` `i` `c`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct Int2 { - /// Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - /// value fails deserialization. pub v: SchemaVersion, - /// Table/column identifier. Required by the domain CHECK. pub i: Identifier, - /// mp_base85 source ciphertext. Required by the domain CHECK. pub c: Ciphertext, } - impl DomainType for Int2 { fn sql_domain_static() -> &'static str { "eql_v3.int2" } - fn sql_domain(&self) -> &'static str { Self::sql_domain_static() } - fn schema(&self) -> Schema { schema_for!(Int2) } } - -/// `eql_v3.int2_eq` — HMAC equality (`=`, `<>`). +/// `eql_v3.int2_eq` — equality domain. +/// +/// Operators: `=` `<>`. Required keys: `v` `i` `c` `hm`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct Int2Eq { - /// Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - /// value fails deserialization. pub v: SchemaVersion, - /// Table/column identifier. Required by the domain CHECK. pub i: Identifier, - /// mp_base85 source ciphertext. Required by the domain CHECK. pub c: Ciphertext, - /// HMAC-SHA-256 equality term. pub hm: Hmac256, } - impl DomainType for Int2Eq { fn sql_domain_static() -> &'static str { "eql_v3.int2_eq" } - fn sql_domain(&self) -> &'static str { Self::sql_domain_static() } - fn schema(&self) -> Schema { schema_for!(Int2Eq) } } - -/// `eql_v3.int2_ord_ore` — full comparison, scheme-explicit name. +/// `eql_v3.int2_ord_ore` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct Int2OrdOre { - /// Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - /// value fails deserialization. pub v: SchemaVersion, - /// Table/column identifier. Required by the domain CHECK. pub i: Identifier, - /// mp_base85 source ciphertext. Required by the domain CHECK. pub c: Ciphertext, - /// Block-ORE order term. Serves equality too. pub ob: OreBlock256, } - impl DomainType for Int2OrdOre { fn sql_domain_static() -> &'static str { "eql_v3.int2_ord_ore" } - fn sql_domain(&self) -> &'static str { Self::sql_domain_static() } - fn schema(&self) -> Schema { schema_for!(Int2OrdOre) } } - -/// `eql_v3.int2_ord` — full comparison (`=` `<>` `<` `<=` `>` `>=`). +/// `eql_v3.int2_ord` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct Int2Ord { - /// Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - /// value fails deserialization. pub v: SchemaVersion, - /// Table/column identifier. Required by the domain CHECK. pub i: Identifier, - /// mp_base85 source ciphertext. Required by the domain CHECK. pub c: Ciphertext, - /// Block-ORE order term. Serves equality too. pub ob: OreBlock256, } - impl DomainType for Int2Ord { fn sql_domain_static() -> &'static str { "eql_v3.int2_ord" } - fn sql_domain(&self) -> &'static str { Self::sql_domain_static() } - fn schema(&self) -> Schema { schema_for!(Int2Ord) } diff --git a/crates/eql-bindings/src/v3/int4.rs b/crates/eql-bindings/src/v3/int4.rs index 9bf97fa87..274acb957 100644 --- a/crates/eql-bindings/src/v3/int4.rs +++ b/crates/eql-bindings/src/v3/int4.rs @@ -1,136 +1,98 @@ -//! The `int4` encrypted-domain family — the reference scalar. -//! -//! | Rust type | SQL domain | Required keys | Operators | -//! |----------------|------------------------|---------------|----------------------------| -//! | [`Int4`] | `eql_v3.int4` | `v` `i` `c` | none (storage only) | -//! | [`Int4Eq`] | `eql_v3.int4_eq` | `v` `i` `c` `hm` | `=` `<>` | -//! | [`Int4OrdOre`] | `eql_v3.int4_ord_ore` | `v` `i` `c` `ob` | `=` `<>` `<` `<=` `>` `>=` | -//! | [`Int4Ord`] | `eql_v3.int4_ord` | `v` `i` `c` `ob` | `=` `<>` `<` `<=` `>` `>=` | - -use schemars::{schema_for, Schema}; - +// @generated by eql-codegen from the eql-domains catalog — do not edit +//! The `int4` encrypted-domain family — generated from the eql-domains catalog. use crate::v3::terms::{Ciphertext, Hmac256, OreBlock256}; use crate::v3::DomainType; use crate::{Identifier, SchemaVersion}; -use schemars::JsonSchema; +use schemars::{schema_for, JsonSchema, Schema}; use serde::{Deserialize, Serialize}; use ts_rs::TS; - -/// `eql_v3.int4` — storage only; every operator is blocked. +/// `eql_v3.int4` — storage-only domain. +/// +/// Operators: none. Required keys: `v` `i` `c`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct Int4 { - /// Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - /// value fails deserialization. pub v: SchemaVersion, - /// Table/column identifier. Required by the domain CHECK. pub i: Identifier, - /// mp_base85 source ciphertext. Required by the domain CHECK. pub c: Ciphertext, } - impl DomainType for Int4 { fn sql_domain_static() -> &'static str { "eql_v3.int4" } - fn sql_domain(&self) -> &'static str { Self::sql_domain_static() } - fn schema(&self) -> Schema { schema_for!(Int4) } } - -/// `eql_v3.int4_eq` — HMAC equality (`=`, `<>`). +/// `eql_v3.int4_eq` — equality domain. +/// +/// Operators: `=` `<>`. Required keys: `v` `i` `c` `hm`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct Int4Eq { - /// Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - /// value fails deserialization. pub v: SchemaVersion, - /// Table/column identifier. Required by the domain CHECK. pub i: Identifier, - /// mp_base85 source ciphertext. Required by the domain CHECK. pub c: Ciphertext, - /// HMAC-SHA-256 equality term. pub hm: Hmac256, } - impl DomainType for Int4Eq { fn sql_domain_static() -> &'static str { "eql_v3.int4_eq" } - fn sql_domain(&self) -> &'static str { Self::sql_domain_static() } - fn schema(&self) -> Schema { schema_for!(Int4Eq) } } - -/// `eql_v3.int4_ord_ore` — full comparison (`=` `<>` `<` `<=` `>` `>=`), -/// scheme-explicit name. Same shape as [`Int4Ord`], distinct SQL domain. +/// `eql_v3.int4_ord_ore` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct Int4OrdOre { - /// Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - /// value fails deserialization. pub v: SchemaVersion, - /// Table/column identifier. Required by the domain CHECK. pub i: Identifier, - /// mp_base85 source ciphertext. Required by the domain CHECK. pub c: Ciphertext, - /// Block-ORE order term. Serves equality too — ORE over a - /// full-domain `int4` is lossless, so no separate `hm` is carried. pub ob: OreBlock256, } - impl DomainType for Int4OrdOre { fn sql_domain_static() -> &'static str { "eql_v3.int4_ord_ore" } - fn sql_domain(&self) -> &'static str { Self::sql_domain_static() } - fn schema(&self) -> Schema { schema_for!(Int4OrdOre) } } - -/// `eql_v3.int4_ord` — full comparison (`=` `<>` `<` `<=` `>` `>=`). +/// `eql_v3.int4_ord` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct Int4Ord { - /// Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - /// value fails deserialization. pub v: SchemaVersion, - /// Table/column identifier. Required by the domain CHECK. pub i: Identifier, - /// mp_base85 source ciphertext. Required by the domain CHECK. pub c: Ciphertext, - /// Block-ORE order term. Serves equality too. pub ob: OreBlock256, } - impl DomainType for Int4Ord { fn sql_domain_static() -> &'static str { "eql_v3.int4_ord" } - fn sql_domain(&self) -> &'static str { Self::sql_domain_static() } - fn schema(&self) -> Schema { schema_for!(Int4Ord) } diff --git a/crates/eql-bindings/src/v3/int8.rs b/crates/eql-bindings/src/v3/int8.rs index 1502be787..f3f8bc2f2 100644 --- a/crates/eql-bindings/src/v3/int8.rs +++ b/crates/eql-bindings/src/v3/int8.rs @@ -1,128 +1,98 @@ -//! The `int8` encrypted-domain family. Same four-domain ordered shape as -//! [`crate::v3::int4`] — see that module for the capability table. - -use schemars::{schema_for, Schema}; - +// @generated by eql-codegen from the eql-domains catalog — do not edit +//! The `int8` encrypted-domain family — generated from the eql-domains catalog. use crate::v3::terms::{Ciphertext, Hmac256, OreBlock256}; use crate::v3::DomainType; use crate::{Identifier, SchemaVersion}; -use schemars::JsonSchema; +use schemars::{schema_for, JsonSchema, Schema}; use serde::{Deserialize, Serialize}; use ts_rs::TS; - -/// `eql_v3.int8` — storage only; every operator is blocked. +/// `eql_v3.int8` — storage-only domain. +/// +/// Operators: none. Required keys: `v` `i` `c`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct Int8 { - /// Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - /// value fails deserialization. pub v: SchemaVersion, - /// Table/column identifier. Required by the domain CHECK. pub i: Identifier, - /// mp_base85 source ciphertext. Required by the domain CHECK. pub c: Ciphertext, } - impl DomainType for Int8 { fn sql_domain_static() -> &'static str { "eql_v3.int8" } - fn sql_domain(&self) -> &'static str { Self::sql_domain_static() } - fn schema(&self) -> Schema { schema_for!(Int8) } } - -/// `eql_v3.int8_eq` — HMAC equality (`=`, `<>`). +/// `eql_v3.int8_eq` — equality domain. +/// +/// Operators: `=` `<>`. Required keys: `v` `i` `c` `hm`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct Int8Eq { - /// Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - /// value fails deserialization. pub v: SchemaVersion, - /// Table/column identifier. Required by the domain CHECK. pub i: Identifier, - /// mp_base85 source ciphertext. Required by the domain CHECK. pub c: Ciphertext, - /// HMAC-SHA-256 equality term. pub hm: Hmac256, } - impl DomainType for Int8Eq { fn sql_domain_static() -> &'static str { "eql_v3.int8_eq" } - fn sql_domain(&self) -> &'static str { Self::sql_domain_static() } - fn schema(&self) -> Schema { schema_for!(Int8Eq) } } - -/// `eql_v3.int8_ord_ore` — full comparison, scheme-explicit name. +/// `eql_v3.int8_ord_ore` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct Int8OrdOre { - /// Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - /// value fails deserialization. pub v: SchemaVersion, - /// Table/column identifier. Required by the domain CHECK. pub i: Identifier, - /// mp_base85 source ciphertext. Required by the domain CHECK. pub c: Ciphertext, - /// Block-ORE order term. Serves equality too. pub ob: OreBlock256, } - impl DomainType for Int8OrdOre { fn sql_domain_static() -> &'static str { "eql_v3.int8_ord_ore" } - fn sql_domain(&self) -> &'static str { Self::sql_domain_static() } - fn schema(&self) -> Schema { schema_for!(Int8OrdOre) } } - -/// `eql_v3.int8_ord` — full comparison (`=` `<>` `<` `<=` `>` `>=`). +/// `eql_v3.int8_ord` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct Int8Ord { - /// Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - /// value fails deserialization. pub v: SchemaVersion, - /// Table/column identifier. Required by the domain CHECK. pub i: Identifier, - /// mp_base85 source ciphertext. Required by the domain CHECK. pub c: Ciphertext, - /// Block-ORE order term. Serves equality too. pub ob: OreBlock256, } - impl DomainType for Int8Ord { fn sql_domain_static() -> &'static str { "eql_v3.int8_ord" } - fn sql_domain(&self) -> &'static str { Self::sql_domain_static() } - fn schema(&self) -> Schema { schema_for!(Int8Ord) } diff --git a/crates/eql-bindings/src/v3/inventory.rs b/crates/eql-bindings/src/v3/inventory.rs index 51193182b..ca185607f 100644 --- a/crates/eql-bindings/src/v3/inventory.rs +++ b/crates/eql-bindings/src/v3/inventory.rs @@ -1,55 +1,48 @@ -//! The `all()` inventory — every v3 domain payload type in `eql-domains::CATALOG` -//! order. Moved out of `mod.rs` so PR 4's emitter can own it: this hand-written -//! version is REPLACED by `eql-codegen` output (`// @generated`) at cutover -//! (Task 8). The architectural module doc + `pub mod` decls stay in the -//! hand-written `mod.rs`. - -use std::marker::PhantomData; - +// @generated by eql-codegen from the eql-domains catalog — do not edit +//! The `all()` inventory — every v3 domain payload type in eql-domains::CATALOG order. Generated from the catalog; the DomainType trait, the shared newtypes, and the architectural module doc stay hand-written (domain_type.rs / terms.rs / mod.rs). use super::domain_type::DomainType; -use super::{bool, date, float4, float8, int2, int4, int8, numeric, text, timestamptz}; - -/// Every v3 domain type, in `eql-domains::CATALOG` order. +use std::marker::PhantomData; +/// Every v3 domain type, in `eql-domains::CATALOG` order — generated. pub fn all() -> Vec> { vec![ - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), - Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), ] } diff --git a/crates/eql-bindings/src/v3/mod.rs b/crates/eql-bindings/src/v3/mod.rs index 98fe3b7ac..104809e50 100644 --- a/crates/eql-bindings/src/v3/mod.rs +++ b/crates/eql-bindings/src/v3/mod.rs @@ -4,11 +4,10 @@ //! capability-encoded design from the original int4 scalar prototype //! (PR #236's first cut), formalized: //! the SQL surface is generated from `eql-domains::CATALOG`, and these types -//! mirror it 1:1 (enforced by `tests/catalog_parity.rs`, which fails if the -//! catalog and [`all`] ever disagree on the set or order of domains; the -//! catalog-derived wire-key gate is schema-based and lands with the stacked -//! schemars change, with per-type strictness spot checks in -//! `tests/v3_conformance.rs`). +//! mirror it 1:1 — `all()` is generated from the same catalog (`inventory.rs`), +//! so it cannot drift; the published JSON Schema wire contract is pinned by +//! `tests/catalog_parity.rs` and the emitted `.ts` property order by +//! `tests/ts_property_order.rs`. //! //! **Versioning.** "v3" is the SQL schema generation (`eql_v3.*` domains). //! The JSON envelope version is still `v: 2` ([`crate::EQL_SCHEMA_VERSION`]) — @@ -27,6 +26,13 @@ //! (SQL-side) by the domain CHECK. A missing term key is a deserialization //! error — the Rust analogue of the CHECK constraint. //! +//! One exception to "`ob` for `_ord`": `text`'s ordered domains carry **both** +//! `hm` and `ob` (`text_ord`, `text_ord_ore`, `text_search`), where the integer +//! ordered domains carry `ob` alone. Text routes `=`/`<>` through `hm` rather +//! than the ORE term because lexicographic ORE over text is not equality- +//! lossless, so equality needs the HMAC. The generated struct doc surfaces this +//! structurally — its required-keys line lists `hm` `ob` rather than just `ob`. +//! //! The types are also **strict**: every struct is //! `#[serde(deny_unknown_fields)]`, so a payload carrying keys outside the //! domain's set fails to deserialize rather than being silently stripped on diff --git a/crates/eql-bindings/src/v3/numeric.rs b/crates/eql-bindings/src/v3/numeric.rs index f94f147e2..30f57ca07 100644 --- a/crates/eql-bindings/src/v3/numeric.rs +++ b/crates/eql-bindings/src/v3/numeric.rs @@ -1,135 +1,98 @@ -//! The `numeric` encrypted-domain family — an ordered, non-integer scalar -//! backed by `rust_decimal::Decimal`. Same four-domain ordered shape as -//! [`crate::v3::int4`] (ORE compares ciphertext, so decimals order like -//! integers); see that module for the capability table. -//! -//! `numeric` is the first scalar whose native ORE term is wider than 8 blocks -//! (14 blocks): the wire shape is unchanged — the `ob` array simply carries -//! more block strings — and the generalized `eql_v3.ore_block_256` comparator -//! orders any block count, so no new type is needed here. - -use schemars::{schema_for, Schema}; - +// @generated by eql-codegen from the eql-domains catalog — do not edit +//! The `numeric` encrypted-domain family — generated from the eql-domains catalog. use crate::v3::terms::{Ciphertext, Hmac256, OreBlock256}; use crate::v3::DomainType; use crate::{Identifier, SchemaVersion}; -use schemars::JsonSchema; +use schemars::{schema_for, JsonSchema, Schema}; use serde::{Deserialize, Serialize}; use ts_rs::TS; - -/// `eql_v3.numeric` — storage only; every operator is blocked. +/// `eql_v3.numeric` — storage-only domain. +/// +/// Operators: none. Required keys: `v` `i` `c`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct Numeric { - /// Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - /// value fails deserialization. pub v: SchemaVersion, - /// Table/column identifier. Required by the domain CHECK. pub i: Identifier, - /// mp_base85 source ciphertext. Required by the domain CHECK. pub c: Ciphertext, } - impl DomainType for Numeric { fn sql_domain_static() -> &'static str { "eql_v3.numeric" } - fn sql_domain(&self) -> &'static str { Self::sql_domain_static() } - fn schema(&self) -> Schema { schema_for!(Numeric) } } - -/// `eql_v3.numeric_eq` — HMAC equality (`=`, `<>`). +/// `eql_v3.numeric_eq` — equality domain. +/// +/// Operators: `=` `<>`. Required keys: `v` `i` `c` `hm`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct NumericEq { - /// Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - /// value fails deserialization. pub v: SchemaVersion, - /// Table/column identifier. Required by the domain CHECK. pub i: Identifier, - /// mp_base85 source ciphertext. Required by the domain CHECK. pub c: Ciphertext, - /// HMAC-SHA-256 equality term. pub hm: Hmac256, } - impl DomainType for NumericEq { fn sql_domain_static() -> &'static str { "eql_v3.numeric_eq" } - fn sql_domain(&self) -> &'static str { Self::sql_domain_static() } - fn schema(&self) -> Schema { schema_for!(NumericEq) } } - -/// `eql_v3.numeric_ord_ore` — full comparison, scheme-explicit name. +/// `eql_v3.numeric_ord_ore` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct NumericOrdOre { - /// Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - /// value fails deserialization. pub v: SchemaVersion, - /// Table/column identifier. Required by the domain CHECK. pub i: Identifier, - /// mp_base85 source ciphertext. Required by the domain CHECK. pub c: Ciphertext, - /// Block-ORE order term (14 blocks for numeric). Serves equality too. pub ob: OreBlock256, } - impl DomainType for NumericOrdOre { fn sql_domain_static() -> &'static str { "eql_v3.numeric_ord_ore" } - fn sql_domain(&self) -> &'static str { Self::sql_domain_static() } - fn schema(&self) -> Schema { schema_for!(NumericOrdOre) } } - -/// `eql_v3.numeric_ord` — full comparison (`=` `<>` `<` `<=` `>` `>=`). +/// `eql_v3.numeric_ord` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct NumericOrd { - /// Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - /// value fails deserialization. pub v: SchemaVersion, - /// Table/column identifier. Required by the domain CHECK. pub i: Identifier, - /// mp_base85 source ciphertext. Required by the domain CHECK. pub c: Ciphertext, - /// Block-ORE order term (14 blocks for numeric). Serves equality too. pub ob: OreBlock256, } - impl DomainType for NumericOrd { fn sql_domain_static() -> &'static str { "eql_v3.numeric_ord" } - fn sql_domain(&self) -> &'static str { Self::sql_domain_static() } - fn schema(&self) -> Schema { schema_for!(NumericOrd) } diff --git a/crates/eql-bindings/src/v3/text.rs b/crates/eql-bindings/src/v3/text.rs index 65b385a74..921d5a6ea 100644 --- a/crates/eql-bindings/src/v3/text.rs +++ b/crates/eql-bindings/src/v3/text.rs @@ -1,204 +1,148 @@ -//! The `text` encrypted-domain family — the ordered shape of -//! [`crate::v3::int4`] plus a `_match` domain backed by the Bloom-filter -//! term (`@>`/`<@` containment for `LIKE`-style matching). - -use schemars::{schema_for, Schema}; - +// @generated by eql-codegen from the eql-domains catalog — do not edit +//! The `text` encrypted-domain family — generated from the eql-domains catalog. use crate::v3::terms::{BloomFilter, Ciphertext, Hmac256, OreBlock256}; use crate::v3::DomainType; use crate::{Identifier, SchemaVersion}; -use schemars::JsonSchema; +use schemars::{schema_for, JsonSchema, Schema}; use serde::{Deserialize, Serialize}; use ts_rs::TS; - -/// `eql_v3.text` — storage only; every operator is blocked. +/// `eql_v3.text` — storage-only domain. +/// +/// Operators: none. Required keys: `v` `i` `c`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct Text { - /// Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - /// value fails deserialization. pub v: SchemaVersion, - /// Table/column identifier. Required by the domain CHECK. pub i: Identifier, - /// mp_base85 source ciphertext. Required by the domain CHECK. pub c: Ciphertext, } - impl DomainType for Text { fn sql_domain_static() -> &'static str { "eql_v3.text" } - fn sql_domain(&self) -> &'static str { Self::sql_domain_static() } - fn schema(&self) -> Schema { schema_for!(Text) } } - -/// `eql_v3.text_eq` — HMAC equality (`=`, `<>`). +/// `eql_v3.text_eq` — equality domain. +/// +/// Operators: `=` `<>`. Required keys: `v` `i` `c` `hm`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct TextEq { - /// Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - /// value fails deserialization. pub v: SchemaVersion, - /// Table/column identifier. Required by the domain CHECK. pub i: Identifier, - /// mp_base85 source ciphertext. Required by the domain CHECK. pub c: Ciphertext, - /// HMAC-SHA-256 equality term. pub hm: Hmac256, } - impl DomainType for TextEq { fn sql_domain_static() -> &'static str { "eql_v3.text_eq" } - fn sql_domain(&self) -> &'static str { Self::sql_domain_static() } - fn schema(&self) -> Schema { schema_for!(TextEq) } } - -/// `eql_v3.text_match` — Bloom-filter containment match. +/// `eql_v3.text_match` — match domain. +/// +/// Operators: `@>` `<@`. Required keys: `v` `i` `c` `bf`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct TextMatch { - /// Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - /// value fails deserialization. pub v: SchemaVersion, - /// Table/column identifier. Required by the domain CHECK. pub i: Identifier, - /// mp_base85 source ciphertext. Required by the domain CHECK. pub c: Ciphertext, - /// Bloom-filter match term (signed smallint bit positions). pub bf: BloomFilter, } - impl DomainType for TextMatch { fn sql_domain_static() -> &'static str { "eql_v3.text_match" } - fn sql_domain(&self) -> &'static str { Self::sql_domain_static() } - fn schema(&self) -> Schema { schema_for!(TextMatch) } } - -/// `eql_v3.text_ord_ore` — full lexicographic comparison, -/// scheme-explicit name. Unlike the integer ordered domains (`[Ore]` only), -/// text routes equality through `hm` rather than the ORE term, so the domain -/// carries both `hm` and `ob` (`[Hm, Ore]`). +/// `eql_v3.text_ord_ore` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `hm` `ob`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct TextOrdOre { - /// Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - /// value fails deserialization. pub v: SchemaVersion, - /// Table/column identifier. Required by the domain CHECK. pub i: Identifier, - /// mp_base85 source ciphertext. Required by the domain CHECK. pub c: Ciphertext, - /// HMAC-SHA-256 equality term. Text routes `=`/`<>` through `hm`. pub hm: Hmac256, - /// Block-ORE order term. pub ob: OreBlock256, } - impl DomainType for TextOrdOre { fn sql_domain_static() -> &'static str { "eql_v3.text_ord_ore" } - fn sql_domain(&self) -> &'static str { Self::sql_domain_static() } - fn schema(&self) -> Schema { schema_for!(TextOrdOre) } } - -/// `eql_v3.text_ord` — full lexicographic comparison -/// (`=` `<>` `<` `<=` `>` `>=`). Carries both `hm` (equality) and `ob` -/// (ordering) — text routes equality through `hm` (`[Hm, Ore]`). +/// `eql_v3.text_ord` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `hm` `ob`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct TextOrd { - /// Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - /// value fails deserialization. pub v: SchemaVersion, - /// Table/column identifier. Required by the domain CHECK. pub i: Identifier, - /// mp_base85 source ciphertext. Required by the domain CHECK. pub c: Ciphertext, - /// HMAC-SHA-256 equality term. Text routes `=`/`<>` through `hm`. pub hm: Hmac256, - /// Block-ORE order term. pub ob: OreBlock256, } - impl DomainType for TextOrd { fn sql_domain_static() -> &'static str { "eql_v3.text_ord" } - fn sql_domain(&self) -> &'static str { Self::sql_domain_static() } - fn schema(&self) -> Schema { schema_for!(TextOrd) } } - -/// `eql_v3.text_search` — the full text search surface: HMAC equality, ORE -/// ordering, and Bloom-filter containment match (`[Hm, Ore, Bloom]`). The -/// superset domain combining `_eq`, `_ord`, and `_match`. +/// `eql_v3.text_search` — search domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=` `@>` `<@`. Required keys: `v` `i` `c` `hm` `ob` `bf`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct TextSearch { - /// Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - /// value fails deserialization. pub v: SchemaVersion, - /// Table/column identifier. Required by the domain CHECK. pub i: Identifier, - /// mp_base85 source ciphertext. Required by the domain CHECK. pub c: Ciphertext, - /// HMAC-SHA-256 equality term. pub hm: Hmac256, - /// Block-ORE order term. pub ob: OreBlock256, - /// Bloom-filter match term (signed smallint bit positions). pub bf: BloomFilter, } - impl DomainType for TextSearch { fn sql_domain_static() -> &'static str { "eql_v3.text_search" } - fn sql_domain(&self) -> &'static str { Self::sql_domain_static() } - fn schema(&self) -> Schema { schema_for!(TextSearch) } diff --git a/crates/eql-bindings/src/v3/timestamptz.rs b/crates/eql-bindings/src/v3/timestamptz.rs index ed1959b03..d5d8342b1 100644 --- a/crates/eql-bindings/src/v3/timestamptz.rs +++ b/crates/eql-bindings/src/v3/timestamptz.rs @@ -1,136 +1,98 @@ -//! The `timestamptz` encrypted-domain family — an ordered, non-integer scalar. -//! Same four-domain ordered shape as [`crate::v3::int4`] (ORE compares -//! ciphertext, so timestamps order like integers); see that module for the -//! capability table. -//! -//! cipherstash encrypts timestamps at native 12-block ORE width. The family -//! was equality-only while EQL's ORE comparator was hardcoded to 8 blocks; -//! now that `eql_v3.ore_block_256` derives the block count from the term -//! length, the 12-block `ob` term orders correctly and the ordered domains -//! ship. The wire shape is unchanged — the `ob` array just carries 12 blocks. - -use schemars::{schema_for, Schema}; - +// @generated by eql-codegen from the eql-domains catalog — do not edit +//! The `timestamptz` encrypted-domain family — generated from the eql-domains catalog. use crate::v3::terms::{Ciphertext, Hmac256, OreBlock256}; use crate::v3::DomainType; use crate::{Identifier, SchemaVersion}; -use schemars::JsonSchema; +use schemars::{schema_for, JsonSchema, Schema}; use serde::{Deserialize, Serialize}; use ts_rs::TS; - -/// `eql_v3.timestamptz` — storage only; every operator is blocked. +/// `eql_v3.timestamptz` — storage-only domain. +/// +/// Operators: none. Required keys: `v` `i` `c`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct Timestamptz { - /// Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - /// value fails deserialization. pub v: SchemaVersion, - /// Table/column identifier. Required by the domain CHECK. pub i: Identifier, - /// mp_base85 source ciphertext. Required by the domain CHECK. pub c: Ciphertext, } - impl DomainType for Timestamptz { fn sql_domain_static() -> &'static str { "eql_v3.timestamptz" } - fn sql_domain(&self) -> &'static str { Self::sql_domain_static() } - fn schema(&self) -> Schema { schema_for!(Timestamptz) } } - -/// `eql_v3.timestamptz_eq` — HMAC equality (`=`, `<>`). +/// `eql_v3.timestamptz_eq` — equality domain. +/// +/// Operators: `=` `<>`. Required keys: `v` `i` `c` `hm`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct TimestamptzEq { - /// Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - /// value fails deserialization. pub v: SchemaVersion, - /// Table/column identifier. Required by the domain CHECK. pub i: Identifier, - /// mp_base85 source ciphertext. Required by the domain CHECK. pub c: Ciphertext, - /// HMAC-SHA-256 equality term. pub hm: Hmac256, } - impl DomainType for TimestamptzEq { fn sql_domain_static() -> &'static str { "eql_v3.timestamptz_eq" } - fn sql_domain(&self) -> &'static str { Self::sql_domain_static() } - fn schema(&self) -> Schema { schema_for!(TimestamptzEq) } } - -/// `eql_v3.timestamptz_ord_ore` — full comparison, scheme-explicit name. +/// `eql_v3.timestamptz_ord_ore` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct TimestamptzOrdOre { - /// Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - /// value fails deserialization. pub v: SchemaVersion, - /// Table/column identifier. Required by the domain CHECK. pub i: Identifier, - /// mp_base85 source ciphertext. Required by the domain CHECK. pub c: Ciphertext, - /// Block-ORE order term (12 blocks for timestamptz). Serves equality too. pub ob: OreBlock256, } - impl DomainType for TimestamptzOrdOre { fn sql_domain_static() -> &'static str { "eql_v3.timestamptz_ord_ore" } - fn sql_domain(&self) -> &'static str { Self::sql_domain_static() } - fn schema(&self) -> Schema { schema_for!(TimestamptzOrdOre) } } - -/// `eql_v3.timestamptz_ord` — full comparison (`=` `<>` `<` `<=` `>` `>=`). +/// `eql_v3.timestamptz_ord` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct TimestamptzOrd { - /// Envelope version — always `2` (`EQL_SCHEMA_VERSION`); any other - /// value fails deserialization. pub v: SchemaVersion, - /// Table/column identifier. Required by the domain CHECK. pub i: Identifier, - /// mp_base85 source ciphertext. Required by the domain CHECK. pub c: Ciphertext, - /// Block-ORE order term (12 blocks for timestamptz). Serves equality too. pub ob: OreBlock256, } - impl DomainType for TimestamptzOrd { fn sql_domain_static() -> &'static str { "eql_v3.timestamptz_ord" } - fn sql_domain(&self) -> &'static str { Self::sql_domain_static() } - fn schema(&self) -> Schema { schema_for!(TimestamptzOrd) } diff --git a/crates/eql-codegen/src/bindings.rs b/crates/eql-codegen/src/bindings.rs index a760836b4..e6c4a3efc 100644 --- a/crates/eql-codegen/src/bindings.rs +++ b/crates/eql-codegen/src/bindings.rs @@ -11,7 +11,7 @@ use std::path::{Path, PathBuf}; use proc_macro2::TokenStream; use quote::{format_ident, quote}; -use eql_domains::{Domain, DomainFamily, Term, CATALOG}; +use eql_domains::{Domain, DomainFamily, Term, CATALOG, ENVELOPE_KEYS}; use crate::consts::RUST_GENERATED_MARKER; use crate::writer::{ @@ -62,22 +62,13 @@ fn rustfmt(src: &str) -> String { String::from_utf8(out.stdout).expect("rustfmt output is UTF-8") } -/// PascalCase a snake_case domain name: "int4_ord_ore" -> "Int4OrdOre". -fn pascal(name: &str) -> String { - name.split('_') - .filter(|s| !s.is_empty()) - .map(|s| { - let mut chars = s.chars(); - match chars.next() { - Some(first) => first.to_uppercase().collect::() + chars.as_str(), - None => String::new(), - } - }) - .collect() -} - /// Capability label for a domain's single catalog-derived doc line, keyed on -/// the bare domain name. Parallels the SQL emitter's per-domain `--! @brief`. +/// the bare domain name. The match is keyed on the `&str` bare name (finer than +/// the typed [`eql_domains::Role`], which collapses `match`/`search` into +/// `Ord`), so it cannot be made exhaustive at the type level. Instead the +/// catch-all `panic!`s: an unmapped bare-domain name aborts codegen loudly, +/// forcing a deliberate label choice rather than silently emitting generic-but- +/// wrong doc text — preserving the "compile-checked catalog" guarantee. fn capability_label(domain_name: &str) -> &'static str { match domain_name { "" => "storage-only domain", @@ -85,20 +76,68 @@ fn capability_label(domain_name: &str) -> &'static str { "ord" | "ord_ore" => "ordering domain", "match" => "match domain", "search" => "search domain", - _ => "encrypted domain", + other => panic!( + "unmapped bare domain name {other:?} — add it to capability_label \ + in crates/eql-codegen/src/bindings.rs" + ), } } -/// One payload struct + its three-method `DomainType` impl. One struct doc -/// line, no field docs. Term fields come from `Term::payload_terms`, matching -/// on the enum for the field key and its newtype. The `schema` method returns +/// Render the catalog-derived struct doc lines for a domain: a summary line +/// (`` `eql_v3.` —