@hypequery/protocol-conformance 0.0.0-canary-20260722115402

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +40 -0
  3. package/dist/adapters/generators.d.ts +13 -0
  4. package/dist/adapters/generators.d.ts.map +1 -0
  5. package/dist/adapters/generators.js +366 -0
  6. package/dist/adapters/reference.d.ts +6 -0
  7. package/dist/adapters/reference.d.ts.map +1 -0
  8. package/dist/adapters/reference.js +172 -0
  9. package/dist/adapters/stdio.d.ts +17 -0
  10. package/dist/adapters/stdio.d.ts.map +1 -0
  11. package/dist/adapters/stdio.js +80 -0
  12. package/dist/bin/conformance.d.ts +3 -0
  13. package/dist/bin/conformance.d.ts.map +1 -0
  14. package/dist/bin/conformance.js +84 -0
  15. package/dist/bin/reference-adapter.d.ts +3 -0
  16. package/dist/bin/reference-adapter.d.ts.map +1 -0
  17. package/dist/bin/reference-adapter.js +16 -0
  18. package/dist/compare.d.ts +3 -0
  19. package/dist/compare.d.ts.map +1 -0
  20. package/dist/compare.js +125 -0
  21. package/dist/fs.d.ts +11 -0
  22. package/dist/fs.d.ts.map +1 -0
  23. package/dist/fs.js +36 -0
  24. package/dist/index.d.ts +11 -0
  25. package/dist/index.d.ts.map +1 -0
  26. package/dist/index.js +9 -0
  27. package/dist/manifest.d.ts +13 -0
  28. package/dist/manifest.d.ts.map +1 -0
  29. package/dist/manifest.js +118 -0
  30. package/dist/report.d.ts +4 -0
  31. package/dist/report.d.ts.map +1 -0
  32. package/dist/report.js +23 -0
  33. package/dist/runner.d.ts +12 -0
  34. package/dist/runner.d.ts.map +1 -0
  35. package/dist/runner.js +197 -0
  36. package/dist/types.d.ts +84 -0
  37. package/dist/types.d.ts.map +1 -0
  38. package/dist/types.js +5 -0
  39. package/fixtures/deployment-bundles-v1/README.md +61 -0
  40. package/fixtures/deployment-bundles-v1/identity.json +7 -0
  41. package/fixtures/deployment-bundles-v1/rejections.json +11 -0
  42. package/fixtures/deployment-bundles-v1/success.json +23 -0
  43. package/fixtures/deployment-releases-v1/README.md +36 -0
  44. package/fixtures/deployment-releases-v1/identity.json +7 -0
  45. package/fixtures/deployment-releases-v1/rejections.json +8 -0
  46. package/fixtures/deployment-releases-v1/success.json +14 -0
  47. package/fixtures/deployments-v1/README.md +77 -0
  48. package/fixtures/deployments-v1/identity.json +7 -0
  49. package/fixtures/deployments-v1/rejections.json +12 -0
  50. package/fixtures/deployments-v1/success.json +81 -0
  51. package/fixtures/expressions-v1/README.md +25 -0
  52. package/fixtures/expressions-v1/rejections.json +17 -0
  53. package/fixtures/expressions-v1/success.json +47 -0
  54. package/fixtures/fuzz-seeds-v1/README.md +29 -0
  55. package/fixtures/fuzz-seeds-v1/sql-expressions.json +32 -0
  56. package/fixtures/fuzz-seeds-v1/structured-values.json +32 -0
  57. package/fixtures/fuzz-seeds-v1/value-sources.json +191 -0
  58. package/fixtures/identifiers-v1/README.md +15 -0
  59. package/fixtures/identifiers-v1/rejections.json +58 -0
  60. package/fixtures/identifiers-v1/success.json +26 -0
  61. package/fixtures/manifest.json +117 -0
  62. package/fixtures/query-diagnostics-v1/README.md +49 -0
  63. package/fixtures/query-diagnostics-v1/rejections.json +13 -0
  64. package/fixtures/query-diagnostics-v1/success.json +27 -0
  65. package/fixtures/query-events-v1/README.md +60 -0
  66. package/fixtures/query-events-v1/rejections.json +18 -0
  67. package/fixtures/query-events-v1/success.json +40 -0
  68. package/fixtures/query-implementations-v1/README.md +33 -0
  69. package/fixtures/query-implementations-v1/rejections.json +80 -0
  70. package/fixtures/query-implementations-v1/success.json +96 -0
  71. package/fixtures/query-schemas-v1/README.md +25 -0
  72. package/fixtures/query-schemas-v1/rejections.json +15 -0
  73. package/fixtures/query-schemas-v1/success.json +17 -0
  74. package/fixtures/sql-portability-v1/README.md +15 -0
  75. package/fixtures/sql-portability-v1/non-portable.json +146 -0
  76. package/fixtures/sql-portability-v1/portable.json +346 -0
  77. package/fixtures/tagged-values-v1/README.md +44 -0
  78. package/fixtures/tagged-values-v1/rejections.json +298 -0
  79. package/fixtures/tagged-values-v1/success.json +262 -0
  80. package/package.json +52 -0
@@ -0,0 +1,77 @@
1
+ # Deployment contract v1 fixtures
2
+
3
+ - `success.json` contains complete contracts accepted by the v1 validator.
4
+ - `rejections.json` maps generated invalid inputs to stable failure codes.
5
+ - `identity.json` fixes the RFC 8785 canonical bytes and domain-separated
6
+ SHA-256 identity for matching success fixture ids.
7
+
8
+ These fixtures exercise RFC 0006 deployment envelopes. `success.json`
9
+ contains language-neutral accepted values. `rejections.json` identifies
10
+ deterministic generated inputs and the stable error code every conforming
11
+ implementation must return.
12
+
13
+ ## Generated rejection semantics
14
+
15
+ Every rejection is a deterministic transform of this pinned base deployment
16
+ (RFC 0012), where `dataset(name)` denotes:
17
+
18
+ ```json
19
+ {
20
+ "name": "<name>",
21
+ "source": "orders",
22
+ "tenant": { "kind": "not-required" },
23
+ "dimensions": [],
24
+ "measures": [],
25
+ "filters": [],
26
+ "metrics": [],
27
+ "relationships": []
28
+ }
29
+ ```
30
+
31
+ and the base is:
32
+
33
+ ```json
34
+ {
35
+ "kind": "hypequery-deployment",
36
+ "version": 1,
37
+ "datasets": [dataset("orders")],
38
+ "queries": [],
39
+ "artifacts": []
40
+ }
41
+ ```
42
+
43
+ Generator types expand as follows:
44
+
45
+ - `wrong-root-type`: an empty array instead of an object;
46
+ - `unknown-root-field`: the base plus `"extra": true`;
47
+ - `unsupported-version`: the base with `"version": 2`;
48
+ - `invalid-dataset-identifier`: the base with its only dataset replaced by
49
+ `dataset("bad-name")` (hyphens are not valid identifier characters);
50
+ - `invalid-relationship-queryability`: the base with its only dataset given
51
+ one relationship
52
+ `{ "name": "items", "kind": "hasMany", "target": "orders", "from": "id",
53
+ "to": "order_id", "queryable": true }` (a `hasMany` relationship must not
54
+ be queryable);
55
+ - `missing-runtime-artifact`: the base plus one named query `health` with
56
+ input `{ "kind": "any" }`, output `{ "kind": "any" }`, implementation
57
+ `{ "kind": "runtime-reference", "runtime": "node", "artifactSha256":
58
+ <64 zeros>, "entrypoint": "queries.health" }`, endpoint
59
+ `{ "access": { "kind": "public" }, "tenant": { "kind": "not-required" },
60
+ "method": "GET", "path": "/health" }`, and `"tags": []` — while
61
+ `artifacts` stays empty, so the referenced artifact does not exist;
62
+ - `ambiguous-query-route`: the base plus two named queries `first` and
63
+ `second`, each with input `{ "kind": "void" }`, output
64
+ `{ "kind": "void" }`, implementation `{ "kind": "semantic-plan",
65
+ "query": { "kind": "dataset", "dataset": "orders", "dimensions": [],
66
+ "measures": [], "filters": [], "orderBy": [] } }`, endpoint
67
+ `{ "access": { "kind": "public" }, "tenant": { "kind": "not-required" },
68
+ "method": "GET", "path": "/same" }`, and `"tags": []` — both share one
69
+ method and path;
70
+ - `too-many-datasets`: the base with 101 datasets `dataset("dataset_0")`
71
+ through `dataset("dataset_100")`;
72
+ - `source-too-large`: the base with its only dataset's `source` replaced by
73
+ 1025 repetitions of `a`;
74
+ - `unsafe-accessor`: the base with `kind` served by an enumerable computed
75
+ accessor returning `"hypequery-deployment"` instead of a plain data
76
+ property. Host-model conditional (RFC 0012): implementations whose input
77
+ model cannot express computed accessors skip this case.
@@ -0,0 +1,7 @@
1
+ [
2
+ {
3
+ "id": "dataset-and-runtime-query",
4
+ "canonical": "{\"artifacts\":[{\"artifactSha256\":\"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"runtime\":\"node\"}],\"datasets\":[{\"dimensions\":[{\"filterable\":true,\"groupable\":true,\"name\":\"status\",\"source\":{\"column\":\"status\",\"kind\":\"column\"},\"type\":\"string\"}],\"endpoint\":{\"access\":{\"kind\":\"authenticated\",\"roles\":[],\"scopes\":[\"read:orders\"]},\"maxLimit\":1000,\"path\":\"/api/analytics/datasets/orders/query\",\"tenant\":{\"column\":\"tenant_id\",\"kind\":\"required\",\"mode\":\"auto-inject\"}},\"filters\":[{\"field\":\"status\",\"name\":\"status\",\"operators\":[\"eq\",\"neq\"]}],\"limits\":{\"maxResultSize\":1000},\"measures\":[{\"aggregation\":\"sum\",\"field\":\"amount\",\"filters\":[],\"name\":\"revenue\"}],\"metrics\":[],\"name\":\"orders\",\"relationships\":[],\"source\":\"analytics.orders\",\"tenant\":{\"field\":\"tenant_id\",\"kind\":\"required\"},\"timeField\":\"created_at\"}],\"kind\":\"hypequery-deployment\",\"queries\":[{\"endpoint\":{\"access\":{\"kind\":\"public\"},\"method\":\"GET\",\"path\":\"/api/analytics/queries/health\",\"tenant\":{\"kind\":\"not-required\"}},\"implementation\":{\"artifactSha256\":\"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"entrypoint\":\"queries.health\",\"kind\":\"runtime-reference\",\"runtime\":\"node\"},\"input\":{\"kind\":\"any\"},\"name\":\"health\",\"output\":{\"kind\":\"object\",\"properties\":{\"ok\":{\"kind\":\"boolean\"}},\"required\":[\"ok\"],\"unknownProperties\":\"strip\"},\"tags\":[\"system\"]}],\"version\":1}",
5
+ "sha256": "1ec521ddeb1bf29205a2c0e2876b24b0eab49c0002825bc569071fbf6ad23e2d"
6
+ }
7
+ ]
@@ -0,0 +1,12 @@
1
+ [
2
+ { "id": "wrong-root-type", "generator": { "type": "wrong-root-type" }, "error": "HQ_DEPLOYMENT_TYPE" },
3
+ { "id": "unknown-root-field", "generator": { "type": "unknown-root-field" }, "error": "HQ_DEPLOYMENT_UNKNOWN_FIELD" },
4
+ { "id": "unsupported-version", "generator": { "type": "unsupported-version" }, "error": "HQ_DEPLOYMENT_INVALID_VERSION" },
5
+ { "id": "invalid-dataset-identifier", "generator": { "type": "invalid-dataset-identifier" }, "error": "HQ_DEPLOYMENT_INVALID_IDENTIFIER" },
6
+ { "id": "invalid-relationship-queryability", "generator": { "type": "invalid-relationship-queryability" }, "error": "HQ_DEPLOYMENT_INVALID_VALUE" },
7
+ { "id": "missing-runtime-artifact", "generator": { "type": "missing-runtime-artifact" }, "error": "HQ_DEPLOYMENT_INVALID_REFERENCE" },
8
+ { "id": "ambiguous-query-route", "generator": { "type": "ambiguous-query-route" }, "error": "HQ_DEPLOYMENT_INVALID_VALUE" },
9
+ { "id": "too-many-datasets", "generator": { "type": "too-many-datasets" }, "error": "HQ_DEPLOYMENT_TOO_MANY_ITEMS" },
10
+ { "id": "source-too-large", "generator": { "type": "source-too-large" }, "error": "HQ_DEPLOYMENT_TOO_LARGE" },
11
+ { "id": "unsafe-accessor", "generator": { "type": "unsafe-accessor" }, "error": "HQ_DEPLOYMENT_UNSAFE_OBJECT" }
12
+ ]
@@ -0,0 +1,81 @@
1
+ [
2
+ {
3
+ "id": "dataset-and-runtime-query",
4
+ "value": {
5
+ "kind": "hypequery-deployment",
6
+ "version": 1,
7
+ "datasets": [
8
+ {
9
+ "name": "orders",
10
+ "source": "analytics.orders",
11
+ "tenant": { "kind": "required", "field": "tenant_id" },
12
+ "timeField": "created_at",
13
+ "dimensions": [
14
+ {
15
+ "name": "status",
16
+ "type": "string",
17
+ "source": { "kind": "column", "column": "status" },
18
+ "filterable": true,
19
+ "groupable": true
20
+ }
21
+ ],
22
+ "measures": [
23
+ {
24
+ "name": "revenue",
25
+ "aggregation": "sum",
26
+ "field": "amount",
27
+ "filters": []
28
+ }
29
+ ],
30
+ "filters": [
31
+ {
32
+ "name": "status",
33
+ "field": "status",
34
+ "operators": ["eq", "neq"]
35
+ }
36
+ ],
37
+ "metrics": [],
38
+ "relationships": [],
39
+ "limits": { "maxResultSize": 1000 },
40
+ "endpoint": {
41
+ "access": { "kind": "authenticated", "roles": [], "scopes": ["read:orders"] },
42
+ "tenant": { "kind": "required", "mode": "auto-inject", "column": "tenant_id" },
43
+ "maxLimit": 1000,
44
+ "path": "/api/analytics/datasets/orders/query"
45
+ }
46
+ }
47
+ ],
48
+ "queries": [
49
+ {
50
+ "name": "health",
51
+ "input": { "kind": "any" },
52
+ "output": {
53
+ "kind": "object",
54
+ "properties": { "ok": { "kind": "boolean" } },
55
+ "required": ["ok"],
56
+ "unknownProperties": "strip"
57
+ },
58
+ "implementation": {
59
+ "kind": "runtime-reference",
60
+ "runtime": "node",
61
+ "artifactSha256": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
62
+ "entrypoint": "queries.health"
63
+ },
64
+ "endpoint": {
65
+ "access": { "kind": "public" },
66
+ "tenant": { "kind": "not-required" },
67
+ "method": "GET",
68
+ "path": "/api/analytics/queries/health"
69
+ },
70
+ "tags": ["system"]
71
+ }
72
+ ],
73
+ "artifacts": [
74
+ {
75
+ "runtime": "node",
76
+ "artifactSha256": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
77
+ }
78
+ ]
79
+ }
80
+ }
81
+ ]
@@ -0,0 +1,25 @@
1
+ # Portable expression fixtures, version 1
2
+
3
+ These fixtures accompany RFC 0003. `success.json` exercises every closed
4
+ operator registry and both semantic query envelopes. `rejections.json` covers
5
+ every stable failure code; generator entries describe inputs that are awkward
6
+ or unsafe to encode directly as JSON.
7
+
8
+ ## Generated rejection semantics
9
+
10
+ Rejection entries carry exactly one of `value` or `generator`, a `mode`
11
+ (`expression` or `query`) selecting the validated surface, and the required
12
+ stable `error` code. Generator types expand as follows (RFC 0012), where
13
+ `literal` denotes `{ "kind": "literal", "value": false }`:
14
+
15
+ - `nested-not`: wraps `literal` in
16
+ `{ "kind": "logical", "operator": "not", "operand": ... }` `depth` times;
17
+ - `logical-operands`: one
18
+ `{ "kind": "logical", "operator": "and", "operands": [...] }` node whose
19
+ operands are `count` copies of `literal`;
20
+ - `logical-tree`: one `and` node whose operands are 10 `and` nodes, each
21
+ with 100 copies of `literal` as operands (1011 nodes total);
22
+ - `unsafe-accessor`: `{ "kind": "reference" }` with `name` served by an
23
+ enumerable computed accessor returning `"orders"` instead of a plain data
24
+ property. Host-model conditional (RFC 0012): implementations whose input
25
+ model cannot express computed accessors skip this case.
@@ -0,0 +1,17 @@
1
+ [
2
+ { "id": "expression-not-object", "mode": "expression", "value": null, "error": "HQ_EXPRESSION_TYPE" },
3
+ { "id": "expression-unknown-field", "mode": "expression", "value": { "kind": "reference", "name": "orders", "extra": true }, "error": "HQ_EXPRESSION_UNKNOWN_FIELD" },
4
+ { "id": "expression-unknown-kind", "mode": "expression", "value": { "kind": "sql", "value": "select 1" }, "error": "HQ_EXPRESSION_UNKNOWN_KIND" },
5
+ { "id": "expression-invalid-identifier", "mode": "expression", "value": { "kind": "reference", "name": "customer..country" }, "error": "HQ_EXPRESSION_INVALID_IDENTIFIER" },
6
+ { "id": "expression-invalid-canonical-value", "mode": "expression", "value": { "kind": "literal", "value": [42] }, "error": "HQ_EXPRESSION_INVALID_VALUE" },
7
+ { "id": "expression-invalid-operator", "mode": "expression", "value": { "kind": "binary", "operator": "power", "left": { "kind": "literal", "value": 1.5 }, "right": { "kind": "literal", "value": 2.5 } }, "error": "HQ_EXPRESSION_INVALID_OPERATOR" },
8
+ { "id": "expression-invalid-arity", "mode": "expression", "value": { "kind": "call", "function": "floor", "args": [] }, "error": "HQ_EXPRESSION_INVALID_ARITY" },
9
+ { "id": "comparison-empty-in-list", "mode": "expression", "value": { "kind": "comparison", "operator": "in", "left": { "kind": "reference", "name": "status" }, "right": { "kind": "literal", "value": { "$hypequery": { "type": "array", "version": 1, "values": [] } } } }, "error": "HQ_EXPRESSION_INVALID_ARITY" },
10
+ { "id": "comparison-like-non-string", "mode": "expression", "value": { "kind": "comparison", "operator": "like", "left": { "kind": "reference", "name": "status" }, "right": { "kind": "literal", "value": 1.5 } }, "error": "HQ_EXPRESSION_INVALID_VALUE" },
11
+ { "id": "expression-invalid-aggregation", "mode": "expression", "value": { "kind": "aggregate", "aggregation": "percentile", "field": "amount", "level": 2.0 }, "error": "HQ_EXPRESSION_INVALID_AGGREGATION" },
12
+ { "id": "query-invalid-grain", "mode": "query", "value": { "kind": "dataset", "dataset": "orders", "by": "hour" }, "error": "HQ_EXPRESSION_INVALID_QUERY" },
13
+ { "id": "expression-too-deep", "mode": "expression", "generator": { "type": "nested-not", "depth": 17 }, "error": "HQ_EXPRESSION_TOO_DEEP" },
14
+ { "id": "expression-too-many-nodes", "mode": "expression", "generator": { "type": "logical-tree" }, "error": "HQ_EXPRESSION_TOO_MANY_NODES" },
15
+ { "id": "expression-too-many-items", "mode": "expression", "generator": { "type": "logical-operands", "count": 101 }, "error": "HQ_EXPRESSION_TOO_MANY_ITEMS" },
16
+ { "id": "expression-unsafe-accessor", "mode": "expression", "generator": { "type": "unsafe-accessor" }, "error": "HQ_EXPRESSION_UNSAFE_OBJECT" }
17
+ ]
@@ -0,0 +1,47 @@
1
+ {
2
+ "expressions": [
3
+ { "id": "reference-qualified", "value": { "kind": "reference", "name": "customer.country" } },
4
+ { "id": "literal-tagged-integers", "value": { "kind": "literal", "value": { "$hypequery": { "type": "array", "version": 1, "values": [{ "$hypequery": { "type": "integer", "version": 1, "bits": 64, "signed": false, "value": "42" } }] } } } },
5
+ { "id": "binary-add", "value": { "kind": "binary", "operator": "add", "left": { "kind": "reference", "name": "revenue" }, "right": { "kind": "literal", "value": 1.5 } } },
6
+ { "id": "binary-subtract", "value": { "kind": "binary", "operator": "subtract", "left": { "kind": "reference", "name": "revenue" }, "right": { "kind": "literal", "value": 1.5 } } },
7
+ { "id": "binary-multiply", "value": { "kind": "binary", "operator": "multiply", "left": { "kind": "reference", "name": "revenue" }, "right": { "kind": "literal", "value": 1.5 } } },
8
+ { "id": "binary-divide", "value": { "kind": "binary", "operator": "divide", "left": { "kind": "reference", "name": "revenue" }, "right": { "kind": "literal", "value": 1.5 } } },
9
+ { "id": "call-nullIfZero", "value": { "kind": "call", "function": "nullIfZero", "args": [{ "kind": "reference", "name": "orders" }] } },
10
+ { "id": "call-coalesce", "value": { "kind": "call", "function": "coalesce", "args": [{ "kind": "reference", "name": "revenue" }, { "kind": "literal", "value": 0.5 }] } },
11
+ { "id": "call-round", "value": { "kind": "call", "function": "round", "args": [{ "kind": "reference", "name": "revenue" }, { "kind": "literal", "value": 2.0 }] } },
12
+ { "id": "call-floor", "value": { "kind": "call", "function": "floor", "args": [{ "kind": "reference", "name": "revenue" }] } },
13
+ { "id": "call-ceil", "value": { "kind": "call", "function": "ceil", "args": [{ "kind": "reference", "name": "revenue" }] } },
14
+ { "id": "comparison-eq", "value": { "kind": "comparison", "operator": "eq", "left": { "kind": "reference", "name": "status" }, "right": { "kind": "literal", "value": "paid" } } },
15
+ { "id": "comparison-neq", "value": { "kind": "comparison", "operator": "neq", "left": { "kind": "reference", "name": "status" }, "right": { "kind": "literal", "value": "paid" } } },
16
+ { "id": "comparison-gt", "value": { "kind": "comparison", "operator": "gt", "left": { "kind": "reference", "name": "amount" }, "right": { "kind": "literal", "value": 10.5 } } },
17
+ { "id": "comparison-gte", "value": { "kind": "comparison", "operator": "gte", "left": { "kind": "reference", "name": "amount" }, "right": { "kind": "literal", "value": 10.5 } } },
18
+ { "id": "comparison-lt", "value": { "kind": "comparison", "operator": "lt", "left": { "kind": "reference", "name": "amount" }, "right": { "kind": "literal", "value": 10.5 } } },
19
+ { "id": "comparison-lte", "value": { "kind": "comparison", "operator": "lte", "left": { "kind": "reference", "name": "amount" }, "right": { "kind": "literal", "value": 10.5 } } },
20
+ { "id": "comparison-in", "value": { "kind": "comparison", "operator": "in", "left": { "kind": "reference", "name": "status" }, "right": { "kind": "literal", "value": { "$hypequery": { "type": "array", "version": 1, "values": ["paid", "open"] } } } } },
21
+ { "id": "comparison-notIn", "value": { "kind": "comparison", "operator": "notIn", "left": { "kind": "reference", "name": "status" }, "right": { "kind": "literal", "value": { "$hypequery": { "type": "array", "version": 1, "values": ["void"] } } } } },
22
+ { "id": "comparison-between", "value": { "kind": "comparison", "operator": "between", "left": { "kind": "reference", "name": "amount" }, "right": { "kind": "literal", "value": { "$hypequery": { "type": "tuple", "version": 1, "values": [1.5, 9.5] } } } } },
23
+ { "id": "comparison-like", "value": { "kind": "comparison", "operator": "like", "left": { "kind": "reference", "name": "status" }, "right": { "kind": "literal", "value": "paid%" } } },
24
+ { "id": "logical-and", "value": { "kind": "logical", "operator": "and", "operands": [{ "kind": "comparison", "operator": "eq", "left": { "kind": "reference", "name": "status" }, "right": { "kind": "literal", "value": "paid" } }, { "kind": "comparison", "operator": "gt", "left": { "kind": "reference", "name": "amount" }, "right": { "kind": "literal", "value": 0.5 } }] } },
25
+ { "id": "logical-or", "value": { "kind": "logical", "operator": "or", "operands": [{ "kind": "literal", "value": true }, { "kind": "literal", "value": false }] } },
26
+ { "id": "logical-not", "value": { "kind": "logical", "operator": "not", "operand": { "kind": "literal", "value": false } } },
27
+ { "id": "aggregate-sum-filtered", "value": { "kind": "aggregate", "aggregation": "sum", "field": "amount", "filters": [{ "kind": "comparison", "operator": "eq", "left": { "kind": "reference", "name": "status" }, "right": { "kind": "literal", "value": "paid" } }] } },
28
+ { "id": "aggregate-count", "value": { "kind": "aggregate", "aggregation": "count", "field": "id" } },
29
+ { "id": "aggregate-countDistinct", "value": { "kind": "aggregate", "aggregation": "countDistinct", "field": "customer_id" } },
30
+ { "id": "aggregate-avg", "value": { "kind": "aggregate", "aggregation": "avg", "field": "amount" } },
31
+ { "id": "aggregate-min", "value": { "kind": "aggregate", "aggregation": "min", "field": "amount" } },
32
+ { "id": "aggregate-max", "value": { "kind": "aggregate", "aggregation": "max", "field": "amount" } },
33
+ { "id": "aggregate-argMax", "value": { "kind": "aggregate", "aggregation": "argMax", "field": "status", "argField": "created_at" } },
34
+ { "id": "aggregate-argMin", "value": { "kind": "aggregate", "aggregation": "argMin", "field": "status", "argField": "created_at" } },
35
+ { "id": "aggregate-percentile", "value": { "kind": "aggregate", "aggregation": "percentile", "field": "amount", "level": 0.95 } },
36
+ { "id": "aggregate-median-normalized", "value": { "kind": "aggregate", "aggregation": "percentile", "field": "amount", "level": 0.5 } },
37
+ { "id": "aggregate-stddev", "value": { "kind": "aggregate", "aggregation": "stddev", "field": "amount" } },
38
+ { "id": "aggregate-variance", "value": { "kind": "aggregate", "aggregation": "variance", "field": "amount" } }
39
+ ],
40
+ "queries": [
41
+ { "id": "dataset-all-query-features", "value": { "kind": "dataset", "dataset": "orders", "dimensions": ["status", "customer.country"], "measures": ["revenue", "orders"], "filters": [{ "kind": "comparison", "operator": "eq", "left": { "kind": "reference", "name": "status" }, "right": { "kind": "literal", "value": "paid" } }], "orderBy": [{ "field": "customer.country", "direction": "asc" }, { "field": "revenue", "direction": "desc" }], "limit": 100, "offset": 0, "by": "quarter", "includeMeta": true } },
42
+ { "id": "metric-all-query-features", "value": { "kind": "metric", "dataset": "orders", "metric": "average_order_value", "dimensions": ["customer.country"], "filters": [], "orderBy": [{ "field": "period", "direction": "asc" }], "limit": 25, "offset": 50, "by": "week", "includeMeta": false } },
43
+ { "id": "grain-day", "value": { "kind": "dataset", "dataset": "orders", "by": "day" } },
44
+ { "id": "grain-month", "value": { "kind": "dataset", "dataset": "orders", "by": "month" } },
45
+ { "id": "grain-year", "value": { "kind": "dataset", "dataset": "orders", "by": "year", "limit": 0 } }
46
+ ]
47
+ }
@@ -0,0 +1,29 @@
1
+ # Fuzz seed corpus, version 1
2
+
3
+ Deterministic adversarial seeds replayed verbatim on every conformance run
4
+ (RFC 0012). A mutating fuzzer is out of scope; this corpus is the foundation
5
+ it would grow. Any input that later crashes an implementation must be
6
+ minimized and added here as a seed.
7
+
8
+ For every seed an implementation must, within the runner timeout, either
9
+ accept the input or reject it with a stable code matching
10
+ `^HQ_[A-Z0-9_]+$`. It must never crash, hang, or partially execute the
11
+ input, and must enforce documented limits before unbounded allocation.
12
+
13
+ ## Files
14
+
15
+ - `value-sources.json` targets the tagged-values-v1 decode and validation
16
+ path. Entries carry an `id` and exactly one of `sourceUtf8` (exact JSON
17
+ source for a duplicate-aware parser) or `generator` (expanded per the
18
+ tagged-values-v1 README).
19
+ - `structured-values.json` targets structural validators. Entries carry an
20
+ `id`, a `value`, and a `targets` array of family names; the seed is
21
+ replayed once per target family through that family's validate operation.
22
+ - `sql-expressions.json` targets the sql-portability-v1 compiler. Entries
23
+ carry an `id` and either `sql` (the exact source) or `sqlRepeat`
24
+ (`{ "value": ..., "count": ... }`, expanded by concatenating `count`
25
+ copies of `value`, optionally between `prefix` and `suffix`).
26
+
27
+ Seed ids are unique within one file. Seeds carry no expected code: any
28
+ stable rejection is conforming, and an implementation that accepts a seed
29
+ within its limits also conforms.
@@ -0,0 +1,32 @@
1
+ [
2
+ { "id": "empty", "sql": "" },
3
+ { "id": "whitespace-only", "sql": " " },
4
+ { "id": "unbalanced-open-paren", "sql": "((((revenue" },
5
+ { "id": "unbalanced-close-paren", "sql": "revenue))))" },
6
+ { "id": "trailing-operator", "sql": "revenue +" },
7
+ { "id": "leading-operator", "sql": "* revenue" },
8
+ { "id": "double-operator", "sql": "revenue + * cost" },
9
+ { "id": "empty-parens", "sql": "()" },
10
+ { "id": "bare-comma", "sql": "," },
11
+ { "id": "statement-select", "sql": "SELECT 1" },
12
+ { "id": "statement-with-semicolon", "sql": "revenue; DROP TABLE orders" },
13
+ { "id": "line-comment", "sql": "revenue -- comment" },
14
+ { "id": "block-comment", "sql": "revenue /* comment */" },
15
+ { "id": "nested-block-comment", "sql": "/* a /* b */ c */ revenue" },
16
+ { "id": "unlisted-function", "sql": "toStartOfDay(created_at)" },
17
+ { "id": "lambda", "sql": "arrayMap(x -> x + 1, items)" },
18
+ { "id": "subquery", "sql": "revenue IN (SELECT id FROM t)" },
19
+ { "id": "cast-double-colon", "sql": "revenue::Float64" },
20
+ { "id": "backslash-escape", "sql": "'a\\'b'" },
21
+ { "id": "unterminated-string", "sql": "'abc" },
22
+ { "id": "unterminated-backtick", "sql": "`col" },
23
+ { "id": "non-literal-in-list", "sql": "revenue IN (cost, margin)" },
24
+ { "id": "non-literal-between", "sql": "revenue BETWEEN cost AND margin" },
25
+ { "id": "unicode-operator", "sql": "revenue ≥ 10" },
26
+ { "id": "null-byte-literal", "sql": "revenue = 'a\\u0000b'" },
27
+ { "id": "deep-nested-parens", "sqlRepeat": { "prefix": "", "value": "(", "suffix": "revenue", "count": 512 } },
28
+ { "id": "deep-nested-not", "sqlRepeat": { "prefix": "", "value": "NOT ", "suffix": "revenue = 1", "count": 512 } },
29
+ { "id": "long-and-chain", "sqlRepeat": { "prefix": "revenue = 1", "value": " AND revenue = 1", "suffix": "", "count": 2000 } },
30
+ { "id": "long-identifier", "sqlRepeat": { "prefix": "", "value": "a", "suffix": "", "count": 100000 } },
31
+ { "id": "long-literal-list", "sqlRepeat": { "prefix": "revenue IN (", "value": "1,", "suffix": "1)", "count": 5000 } }
32
+ ]
@@ -0,0 +1,32 @@
1
+ [
2
+ { "id": "empty-object", "value": {}, "targets": ["expressions-v1", "query-schemas-v1", "query-events-v1", "query-diagnostics-v1", "query-implementations-v1", "deployments-v1"] },
3
+ { "id": "null-root", "value": null, "targets": ["expressions-v1", "query-schemas-v1", "query-events-v1", "query-diagnostics-v1"] },
4
+ { "id": "array-root", "value": [], "targets": ["expressions-v1", "query-schemas-v1", "query-events-v1", "query-diagnostics-v1", "deployments-v1"] },
5
+ { "id": "string-root", "value": "hello", "targets": ["expressions-v1", "query-schemas-v1", "query-events-v1"] },
6
+ { "id": "number-root", "value": 42, "targets": ["expressions-v1", "query-schemas-v1", "query-events-v1"] },
7
+ { "id": "unknown-kind", "value": { "kind": "no-such-kind" }, "targets": ["expressions-v1", "query-schemas-v1", "query-implementations-v1"] },
8
+ { "id": "kind-wrong-type", "value": { "kind": 5 }, "targets": ["expressions-v1", "query-schemas-v1", "query-implementations-v1"] },
9
+ { "id": "proto-pollution-key", "value": { "kind": "any", "__proto__": { "polluted": true } }, "targets": ["query-schemas-v1", "expressions-v1"] },
10
+ { "id": "constructor-key", "value": { "kind": "any", "constructor": { "prototype": {} } }, "targets": ["query-schemas-v1", "expressions-v1"] },
11
+ { "id": "prototype-key", "value": { "kind": "any", "prototype": {} }, "targets": ["query-schemas-v1"] },
12
+ { "id": "extra-unknown-field", "value": { "kind": "any", "surpriseField": true }, "targets": ["query-schemas-v1", "query-events-v1", "query-diagnostics-v1"] },
13
+ { "id": "deep-array-schema", "value": { "kind": "array", "items": { "kind": "array", "items": { "kind": "array", "items": { "kind": "array", "items": { "kind": "any" } } } } }, "targets": ["query-schemas-v1"] },
14
+ { "id": "reference-missing-name", "value": { "kind": "reference" }, "targets": ["expressions-v1"] },
15
+ { "id": "reference-empty-name", "value": { "kind": "reference", "name": "" }, "targets": ["expressions-v1"] },
16
+ { "id": "reference-injection-name", "value": { "kind": "reference", "name": "a`; DROP TABLE t; --" }, "targets": ["expressions-v1"] },
17
+ { "id": "reference-dotted-name", "value": { "kind": "reference", "name": "a.b.c.d.e.f.g.h.i.j" }, "targets": ["expressions-v1"] },
18
+ { "id": "literal-huge-number", "value": { "kind": "literal", "value": 1e308 }, "targets": ["expressions-v1"] },
19
+ { "id": "literal-object-value", "value": { "kind": "literal", "value": { "nested": true } }, "targets": ["expressions-v1"] },
20
+ { "id": "logical-empty-operands", "value": { "kind": "logical", "operator": "and", "operands": [] }, "targets": ["expressions-v1"] },
21
+ { "id": "logical-null-operand", "value": { "kind": "logical", "operator": "and", "operands": [null] }, "targets": ["expressions-v1"] },
22
+ { "id": "enum-duplicate-values", "value": { "kind": "enum", "values": ["a", "a", "a"] }, "targets": ["query-schemas-v1"] },
23
+ { "id": "enum-non-string-values", "value": { "kind": "enum", "values": [1, 2, 3] }, "targets": ["query-schemas-v1"] },
24
+ { "id": "object-required-not-array", "value": { "kind": "object", "properties": {}, "required": "id", "unknownProperties": "reject" }, "targets": ["query-schemas-v1"] },
25
+ { "id": "unicode-identifier-confusable", "value": { "kind": "reference", "name": "аdmin" }, "targets": ["expressions-v1"] },
26
+ { "id": "event-kind-only", "value": { "kind": "hypequery-query-event" }, "targets": ["query-events-v1"] },
27
+ { "id": "diagnostics-kind-only", "value": { "kind": "hypequery-query-diagnostics" }, "targets": ["query-diagnostics-v1"] },
28
+ { "id": "deployment-kind-only", "value": { "kind": "hypequery-deployment" }, "targets": ["deployments-v1"] },
29
+ { "id": "implementation-kind-only", "value": { "kind": "compiled-sql" }, "targets": ["query-implementations-v1"] },
30
+ { "id": "negative-version", "value": { "kind": "hypequery-query-event", "version": -1 }, "targets": ["query-events-v1"] },
31
+ { "id": "float-version", "value": { "kind": "hypequery-query-event", "version": 1.5 }, "targets": ["query-events-v1"] }
32
+ ]
@@ -0,0 +1,191 @@
1
+ [
2
+ {
3
+ "id": "empty-source",
4
+ "sourceUtf8": ""
5
+ },
6
+ {
7
+ "id": "whitespace-only",
8
+ "sourceUtf8": " \n\t "
9
+ },
10
+ {
11
+ "id": "unbalanced-array-open",
12
+ "sourceUtf8": "[[[["
13
+ },
14
+ {
15
+ "id": "unbalanced-object-open",
16
+ "sourceUtf8": "{\"a\":{\"b\":{"
17
+ },
18
+ {
19
+ "id": "unbalanced-close",
20
+ "sourceUtf8": "]}"
21
+ },
22
+ {
23
+ "id": "truncated-string",
24
+ "sourceUtf8": "\"abc"
25
+ },
26
+ {
27
+ "id": "truncated-escape",
28
+ "sourceUtf8": "\"ab\\"
29
+ },
30
+ {
31
+ "id": "truncated-unicode-escape",
32
+ "sourceUtf8": "\"\\u00"
33
+ },
34
+ {
35
+ "id": "lone-high-surrogate-escape",
36
+ "sourceUtf8": "\"\\ud800\""
37
+ },
38
+ {
39
+ "id": "lone-low-surrogate-escape",
40
+ "sourceUtf8": "\"\\udc00\""
41
+ },
42
+ {
43
+ "id": "swapped-surrogate-pair",
44
+ "sourceUtf8": "\"\\udc00\\ud800\""
45
+ },
46
+ {
47
+ "id": "bom-prefix",
48
+ "sourceUtf8": "{}"
49
+ },
50
+ {
51
+ "id": "bare-plus-number",
52
+ "sourceUtf8": "+1"
53
+ },
54
+ {
55
+ "id": "leading-zero-number",
56
+ "sourceUtf8": "01"
57
+ },
58
+ {
59
+ "id": "trailing-dot-number",
60
+ "sourceUtf8": "1."
61
+ },
62
+ {
63
+ "id": "hex-number",
64
+ "sourceUtf8": "0x10"
65
+ },
66
+ {
67
+ "id": "bare-nan",
68
+ "sourceUtf8": "NaN"
69
+ },
70
+ {
71
+ "id": "bare-infinity",
72
+ "sourceUtf8": "Infinity"
73
+ },
74
+ {
75
+ "id": "single-quoted-string",
76
+ "sourceUtf8": "'abc'"
77
+ },
78
+ {
79
+ "id": "trailing-comma-array",
80
+ "sourceUtf8": "[1,]"
81
+ },
82
+ {
83
+ "id": "trailing-comma-object",
84
+ "sourceUtf8": "{\"a\":1,}"
85
+ },
86
+ {
87
+ "id": "duplicate-key-triple",
88
+ "sourceUtf8": "{\"a\":1,\"a\":2,\"a\":3}"
89
+ },
90
+ {
91
+ "id": "duplicate-key-nested",
92
+ "sourceUtf8": "{\"o\":{\"k\":1,\"k\":2}}"
93
+ },
94
+ {
95
+ "id": "line-comment",
96
+ "sourceUtf8": "1 // comment"
97
+ },
98
+ {
99
+ "id": "block-comment",
100
+ "sourceUtf8": "/* c */ 1"
101
+ },
102
+ {
103
+ "id": "escaped-null-in-string",
104
+ "sourceUtf8": "\"a\\u0000b\""
105
+ },
106
+ {
107
+ "id": "raw-tab-in-string",
108
+ "sourceUtf8": "\"ab\tcd\""
109
+ },
110
+ {
111
+ "id": "proto-key",
112
+ "sourceUtf8": "{\"__proto__\":{\"polluted\":true}}"
113
+ },
114
+ {
115
+ "id": "constructor-key",
116
+ "sourceUtf8": "{\"constructor\":{\"prototype\":{}}}"
117
+ },
118
+ {
119
+ "id": "tag-lookalike-unknown",
120
+ "sourceUtf8": "{\"$hypequery\":\"no-such-tag\",\"value\":\"1\"}"
121
+ },
122
+ {
123
+ "id": "tag-lookalike-case",
124
+ "sourceUtf8": "{\"$HYPEQUERY\":\"int64\",\"value\":\"1\"}"
125
+ },
126
+ {
127
+ "id": "huge-exponent",
128
+ "sourceUtf8": "1e309"
129
+ },
130
+ {
131
+ "id": "negative-huge-exponent",
132
+ "sourceUtf8": "-1e309"
133
+ },
134
+ {
135
+ "id": "tiny-exponent",
136
+ "sourceUtf8": "1e-324"
137
+ },
138
+ {
139
+ "id": "mixed-normalization-keys",
140
+ "sourceUtf8": "{\"café\":1,\"café\":2}"
141
+ },
142
+ {
143
+ "id": "long-digit-run",
144
+ "generator": {
145
+ "type": "repeat-string",
146
+ "utf8": "9",
147
+ "count": 20000
148
+ }
149
+ },
150
+ {
151
+ "id": "deep-array-nesting",
152
+ "generator": {
153
+ "type": "nested-array",
154
+ "depth": 64,
155
+ "leaf": null
156
+ }
157
+ },
158
+ {
159
+ "id": "wide-array",
160
+ "generator": {
161
+ "type": "array",
162
+ "items": 5000,
163
+ "value": null
164
+ }
165
+ },
166
+ {
167
+ "id": "node-explosion-tree",
168
+ "generator": {
169
+ "type": "array-tree",
170
+ "branches": 64,
171
+ "itemsPerBranch": 512,
172
+ "value": null
173
+ }
174
+ },
175
+ {
176
+ "id": "oversized-string",
177
+ "generator": {
178
+ "type": "repeat-string",
179
+ "utf8": "a",
180
+ "count": 131072
181
+ }
182
+ },
183
+ {
184
+ "id": "multibyte-oversized-string",
185
+ "generator": {
186
+ "type": "repeat-string",
187
+ "utf8": "é",
188
+ "count": 65537
189
+ }
190
+ }
191
+ ]
@@ -0,0 +1,15 @@
1
+ # Portable identifier version 1 fixtures
2
+
3
+ These draft language-neutral fixtures accompany RFC 0002.
4
+
5
+ Success entries contain an `id`, a `mode` (`simple` or `qualified`), the exact
6
+ `value`, and the expected `segments`. Rejection entries contain exactly one of
7
+ `value` or `generator` and the required stable `error` code.
8
+
9
+ Generators expand as follows:
10
+
11
+ - `repeat-string`: concatenates `count` copies of `value`;
12
+ - `qualified-segments`: joins `count` copies of `segment` with `.`.
13
+
14
+ Fixture consumers must preserve accepted strings exactly. They must not trim,
15
+ case-fold, normalize, or reinterpret qualified identifiers as SQL names.