@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.
- package/LICENSE +201 -0
- package/README.md +40 -0
- package/dist/adapters/generators.d.ts +13 -0
- package/dist/adapters/generators.d.ts.map +1 -0
- package/dist/adapters/generators.js +366 -0
- package/dist/adapters/reference.d.ts +6 -0
- package/dist/adapters/reference.d.ts.map +1 -0
- package/dist/adapters/reference.js +172 -0
- package/dist/adapters/stdio.d.ts +17 -0
- package/dist/adapters/stdio.d.ts.map +1 -0
- package/dist/adapters/stdio.js +80 -0
- package/dist/bin/conformance.d.ts +3 -0
- package/dist/bin/conformance.d.ts.map +1 -0
- package/dist/bin/conformance.js +84 -0
- package/dist/bin/reference-adapter.d.ts +3 -0
- package/dist/bin/reference-adapter.d.ts.map +1 -0
- package/dist/bin/reference-adapter.js +16 -0
- package/dist/compare.d.ts +3 -0
- package/dist/compare.d.ts.map +1 -0
- package/dist/compare.js +125 -0
- package/dist/fs.d.ts +11 -0
- package/dist/fs.d.ts.map +1 -0
- package/dist/fs.js +36 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/manifest.d.ts +13 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.js +118 -0
- package/dist/report.d.ts +4 -0
- package/dist/report.d.ts.map +1 -0
- package/dist/report.js +23 -0
- package/dist/runner.d.ts +12 -0
- package/dist/runner.d.ts.map +1 -0
- package/dist/runner.js +197 -0
- package/dist/types.d.ts +84 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/fixtures/deployment-bundles-v1/README.md +61 -0
- package/fixtures/deployment-bundles-v1/identity.json +7 -0
- package/fixtures/deployment-bundles-v1/rejections.json +11 -0
- package/fixtures/deployment-bundles-v1/success.json +23 -0
- package/fixtures/deployment-releases-v1/README.md +36 -0
- package/fixtures/deployment-releases-v1/identity.json +7 -0
- package/fixtures/deployment-releases-v1/rejections.json +8 -0
- package/fixtures/deployment-releases-v1/success.json +14 -0
- package/fixtures/deployments-v1/README.md +77 -0
- package/fixtures/deployments-v1/identity.json +7 -0
- package/fixtures/deployments-v1/rejections.json +12 -0
- package/fixtures/deployments-v1/success.json +81 -0
- package/fixtures/expressions-v1/README.md +25 -0
- package/fixtures/expressions-v1/rejections.json +17 -0
- package/fixtures/expressions-v1/success.json +47 -0
- package/fixtures/fuzz-seeds-v1/README.md +29 -0
- package/fixtures/fuzz-seeds-v1/sql-expressions.json +32 -0
- package/fixtures/fuzz-seeds-v1/structured-values.json +32 -0
- package/fixtures/fuzz-seeds-v1/value-sources.json +191 -0
- package/fixtures/identifiers-v1/README.md +15 -0
- package/fixtures/identifiers-v1/rejections.json +58 -0
- package/fixtures/identifiers-v1/success.json +26 -0
- package/fixtures/manifest.json +117 -0
- package/fixtures/query-diagnostics-v1/README.md +49 -0
- package/fixtures/query-diagnostics-v1/rejections.json +13 -0
- package/fixtures/query-diagnostics-v1/success.json +27 -0
- package/fixtures/query-events-v1/README.md +60 -0
- package/fixtures/query-events-v1/rejections.json +18 -0
- package/fixtures/query-events-v1/success.json +40 -0
- package/fixtures/query-implementations-v1/README.md +33 -0
- package/fixtures/query-implementations-v1/rejections.json +80 -0
- package/fixtures/query-implementations-v1/success.json +96 -0
- package/fixtures/query-schemas-v1/README.md +25 -0
- package/fixtures/query-schemas-v1/rejections.json +15 -0
- package/fixtures/query-schemas-v1/success.json +17 -0
- package/fixtures/sql-portability-v1/README.md +15 -0
- package/fixtures/sql-portability-v1/non-portable.json +146 -0
- package/fixtures/sql-portability-v1/portable.json +346 -0
- package/fixtures/tagged-values-v1/README.md +44 -0
- package/fixtures/tagged-values-v1/rejections.json +298 -0
- package/fixtures/tagged-values-v1/success.json +262 -0
- package/package.json +52 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "non-string",
|
|
4
|
+
"mode": "simple",
|
|
5
|
+
"value": 42,
|
|
6
|
+
"error": "HQ_IDENTIFIER_TYPE"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"id": "empty",
|
|
10
|
+
"mode": "simple",
|
|
11
|
+
"value": "",
|
|
12
|
+
"error": "HQ_IDENTIFIER_EMPTY"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"id": "segment-bytes-129",
|
|
16
|
+
"mode": "simple",
|
|
17
|
+
"generator": {
|
|
18
|
+
"type": "repeat-string",
|
|
19
|
+
"value": "a",
|
|
20
|
+
"count": 129
|
|
21
|
+
},
|
|
22
|
+
"error": "HQ_IDENTIFIER_TOO_LONG"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"id": "leading-digit",
|
|
26
|
+
"mode": "simple",
|
|
27
|
+
"value": "1orders",
|
|
28
|
+
"error": "HQ_IDENTIFIER_INVALID_FORMAT"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"id": "unicode-letter",
|
|
32
|
+
"mode": "simple",
|
|
33
|
+
"value": "café",
|
|
34
|
+
"error": "HQ_IDENTIFIER_INVALID_FORMAT"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"id": "reserved-protocol-prefix",
|
|
38
|
+
"mode": "simple",
|
|
39
|
+
"value": "__HypequeryInternal",
|
|
40
|
+
"error": "HQ_IDENTIFIER_RESERVED"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"id": "qualified-empty-segment",
|
|
44
|
+
"mode": "qualified",
|
|
45
|
+
"value": "orders..country",
|
|
46
|
+
"error": "HQ_IDENTIFIER_INVALID_FORMAT"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"id": "qualified-segments-9",
|
|
50
|
+
"mode": "qualified",
|
|
51
|
+
"generator": {
|
|
52
|
+
"type": "qualified-segments",
|
|
53
|
+
"segment": "a",
|
|
54
|
+
"count": 9
|
|
55
|
+
},
|
|
56
|
+
"error": "HQ_IDENTIFIER_TOO_MANY_SEGMENTS"
|
|
57
|
+
}
|
|
58
|
+
]
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "simple-lowercase",
|
|
4
|
+
"mode": "simple",
|
|
5
|
+
"value": "orders",
|
|
6
|
+
"segments": ["orders"]
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"id": "simple-leading-underscore",
|
|
10
|
+
"mode": "simple",
|
|
11
|
+
"value": "_tenant_id",
|
|
12
|
+
"segments": ["_tenant_id"]
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"id": "simple-case-preserved",
|
|
16
|
+
"mode": "simple",
|
|
17
|
+
"value": "RevenueByDay",
|
|
18
|
+
"segments": ["RevenueByDay"]
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"id": "qualified-relationship-field",
|
|
22
|
+
"mode": "qualified",
|
|
23
|
+
"value": "orders.customer.country",
|
|
24
|
+
"segments": ["orders", "customer", "country"]
|
|
25
|
+
}
|
|
26
|
+
]
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
{
|
|
2
|
+
"kind": "hypequery-conformance-manifest",
|
|
3
|
+
"version": 1,
|
|
4
|
+
"families": [
|
|
5
|
+
{
|
|
6
|
+
"name": "tagged-values-v1",
|
|
7
|
+
"rfc": "0001",
|
|
8
|
+
"codePrefixes": ["HQ_VALUE_"],
|
|
9
|
+
"files": [
|
|
10
|
+
{ "path": "tagged-values-v1/success.json", "role": "success" },
|
|
11
|
+
{ "path": "tagged-values-v1/rejections.json", "role": "rejection" }
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "identifiers-v1",
|
|
16
|
+
"rfc": "0002",
|
|
17
|
+
"codePrefixes": ["HQ_IDENTIFIER_"],
|
|
18
|
+
"files": [
|
|
19
|
+
{ "path": "identifiers-v1/success.json", "role": "success" },
|
|
20
|
+
{ "path": "identifiers-v1/rejections.json", "role": "rejection" }
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"name": "expressions-v1",
|
|
25
|
+
"rfc": "0003",
|
|
26
|
+
"codePrefixes": ["HQ_EXPRESSION_"],
|
|
27
|
+
"files": [
|
|
28
|
+
{
|
|
29
|
+
"path": "expressions-v1/success.json",
|
|
30
|
+
"role": "success",
|
|
31
|
+
"sections": ["/expressions", "/queries"]
|
|
32
|
+
},
|
|
33
|
+
{ "path": "expressions-v1/rejections.json", "role": "rejection" }
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"name": "query-schemas-v1",
|
|
38
|
+
"rfc": "0004",
|
|
39
|
+
"codePrefixes": ["HQ_SCHEMA_"],
|
|
40
|
+
"files": [
|
|
41
|
+
{ "path": "query-schemas-v1/success.json", "role": "success" },
|
|
42
|
+
{ "path": "query-schemas-v1/rejections.json", "role": "rejection" }
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "query-implementations-v1",
|
|
47
|
+
"rfc": "0005",
|
|
48
|
+
"codePrefixes": ["HQ_QUERY_IMPLEMENTATION_"],
|
|
49
|
+
"files": [
|
|
50
|
+
{ "path": "query-implementations-v1/success.json", "role": "success" },
|
|
51
|
+
{ "path": "query-implementations-v1/rejections.json", "role": "rejection" }
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"name": "deployments-v1",
|
|
56
|
+
"rfc": "0006",
|
|
57
|
+
"codePrefixes": ["HQ_DEPLOYMENT_"],
|
|
58
|
+
"files": [
|
|
59
|
+
{ "path": "deployments-v1/success.json", "role": "success" },
|
|
60
|
+
{ "path": "deployments-v1/rejections.json", "role": "rejection" },
|
|
61
|
+
{ "path": "deployments-v1/identity.json", "role": "identity" }
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"name": "deployment-bundles-v1",
|
|
66
|
+
"rfc": "0007",
|
|
67
|
+
"codePrefixes": ["HQ_BUNDLE_"],
|
|
68
|
+
"files": [
|
|
69
|
+
{ "path": "deployment-bundles-v1/success.json", "role": "success" },
|
|
70
|
+
{ "path": "deployment-bundles-v1/rejections.json", "role": "rejection" },
|
|
71
|
+
{ "path": "deployment-bundles-v1/identity.json", "role": "identity" }
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"name": "deployment-releases-v1",
|
|
76
|
+
"rfc": "0008",
|
|
77
|
+
"codePrefixes": ["HQ_RELEASE_"],
|
|
78
|
+
"files": [
|
|
79
|
+
{ "path": "deployment-releases-v1/success.json", "role": "success" },
|
|
80
|
+
{ "path": "deployment-releases-v1/rejections.json", "role": "rejection" },
|
|
81
|
+
{ "path": "deployment-releases-v1/identity.json", "role": "identity" }
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"name": "query-events-v1",
|
|
86
|
+
"rfc": "0011",
|
|
87
|
+
"codePrefixes": ["HQ_EVENT_"],
|
|
88
|
+
"files": [
|
|
89
|
+
{ "path": "query-events-v1/success.json", "role": "success" },
|
|
90
|
+
{ "path": "query-events-v1/rejections.json", "role": "rejection" }
|
|
91
|
+
]
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"name": "query-diagnostics-v1",
|
|
95
|
+
"rfc": "0011",
|
|
96
|
+
"codePrefixes": ["HQ_DIAGNOSTICS_"],
|
|
97
|
+
"files": [
|
|
98
|
+
{ "path": "query-diagnostics-v1/success.json", "role": "success" },
|
|
99
|
+
{ "path": "query-diagnostics-v1/rejections.json", "role": "rejection" }
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"name": "sql-portability-v1",
|
|
104
|
+
"rfc": "0003",
|
|
105
|
+
"codePrefixes": ["HQ_SQL_PORT_"],
|
|
106
|
+
"files": [
|
|
107
|
+
{ "path": "sql-portability-v1/portable.json", "role": "portable" },
|
|
108
|
+
{ "path": "sql-portability-v1/non-portable.json", "role": "non-portable" }
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
"fuzz": [
|
|
113
|
+
{ "path": "fuzz-seeds-v1/value-sources.json", "family": "tagged-values-v1" },
|
|
114
|
+
{ "path": "fuzz-seeds-v1/structured-values.json" },
|
|
115
|
+
{ "path": "fuzz-seeds-v1/sql-expressions.json", "family": "sql-portability-v1" }
|
|
116
|
+
]
|
|
117
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Query diagnostics v1 fixtures
|
|
2
|
+
|
|
3
|
+
- `success.json` contains complete diagnostics projections accepted by the v1
|
|
4
|
+
validator.
|
|
5
|
+
- `rejections.json` maps generated invalid inputs to stable failure codes.
|
|
6
|
+
|
|
7
|
+
These fixtures exercise RFC 0011. The diagnostics projection is privileged
|
|
8
|
+
(RFC 0009): it may carry the non-executable RFC 0010 debug form
|
|
9
|
+
(`debugQuery`), terminal reason, attempt count, runtime identity, and a safe
|
|
10
|
+
message. Rejections prove result rows (`unknown-result-field`) and
|
|
11
|
+
credentials (`unknown-credentials-field`) have no representable field, and
|
|
12
|
+
that `newer-version` fails closed for older consumers. Note that
|
|
13
|
+
`full-diagnostics.debugQuery` uses the deliberately non-executable
|
|
14
|
+
placeholder syntax of RFC 0010 and carries no parameter values.
|
|
15
|
+
|
|
16
|
+
## Generated rejection semantics
|
|
17
|
+
|
|
18
|
+
Every rejection is a deterministic transform of this pinned base projection
|
|
19
|
+
(RFC 0012):
|
|
20
|
+
|
|
21
|
+
```json
|
|
22
|
+
{
|
|
23
|
+
"kind": "hypequery-query-diagnostics",
|
|
24
|
+
"version": 1,
|
|
25
|
+
"eventId": "0000000000000000000000000000000000000000000000000000000000000000",
|
|
26
|
+
"queryId": "1111111111111111111111111111111111111111111111111111111111111111",
|
|
27
|
+
"terminalReason": "completed",
|
|
28
|
+
"attempts": 1
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Generator types expand as follows:
|
|
33
|
+
|
|
34
|
+
- `wrong-root-type`: an empty array instead of an object;
|
|
35
|
+
- `missing-required-field`: the base without `attempts`;
|
|
36
|
+
- `unknown-result-field`: the base plus `"rows": [[1, 2]]`;
|
|
37
|
+
- `unknown-credentials-field`: the base plus `"password": "hunter2"`;
|
|
38
|
+
- `newer-version`: the base with `"version": 2`;
|
|
39
|
+
- `malformed-query-id`: the base with `"queryId": "bad"`;
|
|
40
|
+
- `unknown-terminal-reason`: the base with `"terminalReason": "exploded"`;
|
|
41
|
+
- `zero-attempts`: the base with `"attempts": 0`;
|
|
42
|
+
- `control-character-message`: the base plus a `safeMessage` of `bad`,
|
|
43
|
+
U+0007 (BEL), then `message`;
|
|
44
|
+
- `oversized-debug-query`: the base plus a `debugQuery` of 4097 repetitions
|
|
45
|
+
of `x`;
|
|
46
|
+
- `unsafe-accessor`: the base with `kind` served by an enumerable computed
|
|
47
|
+
accessor returning `"hypequery-query-diagnostics"` instead of a plain
|
|
48
|
+
data property. Host-model conditional (RFC 0012): implementations whose
|
|
49
|
+
input model cannot express computed accessors skip this case.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
[
|
|
2
|
+
{ "id": "wrong-root-type", "generator": { "type": "wrong-root-type" }, "error": "HQ_DIAGNOSTICS_TYPE" },
|
|
3
|
+
{ "id": "missing-required-field", "generator": { "type": "missing-required-field" }, "error": "HQ_DIAGNOSTICS_TYPE" },
|
|
4
|
+
{ "id": "unknown-result-field", "generator": { "type": "unknown-result-field" }, "error": "HQ_DIAGNOSTICS_UNKNOWN_FIELD" },
|
|
5
|
+
{ "id": "unknown-credentials-field", "generator": { "type": "unknown-credentials-field" }, "error": "HQ_DIAGNOSTICS_UNKNOWN_FIELD" },
|
|
6
|
+
{ "id": "newer-version", "generator": { "type": "newer-version" }, "error": "HQ_DIAGNOSTICS_INVALID_VERSION" },
|
|
7
|
+
{ "id": "malformed-query-id", "generator": { "type": "malformed-query-id" }, "error": "HQ_DIAGNOSTICS_INVALID_VALUE" },
|
|
8
|
+
{ "id": "unknown-terminal-reason", "generator": { "type": "unknown-terminal-reason" }, "error": "HQ_DIAGNOSTICS_INVALID_VALUE" },
|
|
9
|
+
{ "id": "zero-attempts", "generator": { "type": "zero-attempts" }, "error": "HQ_DIAGNOSTICS_INVALID_VALUE" },
|
|
10
|
+
{ "id": "control-character-message", "generator": { "type": "control-character-message" }, "error": "HQ_DIAGNOSTICS_INVALID_VALUE" },
|
|
11
|
+
{ "id": "oversized-debug-query", "generator": { "type": "oversized-debug-query" }, "error": "HQ_DIAGNOSTICS_TOO_LARGE" },
|
|
12
|
+
{ "id": "unsafe-accessor", "generator": { "type": "unsafe-accessor" }, "error": "HQ_DIAGNOSTICS_UNSAFE_OBJECT" }
|
|
13
|
+
]
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "minimal-diagnostics",
|
|
4
|
+
"value": {
|
|
5
|
+
"kind": "hypequery-query-diagnostics",
|
|
6
|
+
"version": 1,
|
|
7
|
+
"eventId": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
|
|
8
|
+
"queryId": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
|
|
9
|
+
"terminalReason": "completed",
|
|
10
|
+
"attempts": 1
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"id": "full-diagnostics",
|
|
15
|
+
"value": {
|
|
16
|
+
"kind": "hypequery-query-diagnostics",
|
|
17
|
+
"version": 1,
|
|
18
|
+
"eventId": "fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210",
|
|
19
|
+
"queryId": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
|
|
20
|
+
"terminalReason": "deadline-exceeded",
|
|
21
|
+
"attempts": 3,
|
|
22
|
+
"runtimeIdentity": "dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd",
|
|
23
|
+
"debugQuery": "SELECT sum(revenue) FROM orders WHERE tenant_id = {tenant_fingerprint:String} AND day >= {start_date:Date}",
|
|
24
|
+
"safeMessage": "The query exceeded its execution deadline."
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
]
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Query event v1 fixtures
|
|
2
|
+
|
|
3
|
+
- `success.json` contains complete events accepted by the v1 validator.
|
|
4
|
+
- `rejections.json` maps generated invalid inputs to stable failure codes.
|
|
5
|
+
|
|
6
|
+
These fixtures exercise RFC 0011. Rejections include payloads attempting to
|
|
7
|
+
carry SQL text (`unknown-sql-field`), parameter values
|
|
8
|
+
(`unknown-parameters-field`), and a raw tenant identifier
|
|
9
|
+
(`unknown-raw-tenant-field`): the default event has no field that can accept
|
|
10
|
+
them, so each fails closed as an unknown field. `newer-version` proves an
|
|
11
|
+
older consumer rejects an unknown version cleanly; consumers may skip such
|
|
12
|
+
records without failing an event stream.
|
|
13
|
+
|
|
14
|
+
## Generated rejection semantics
|
|
15
|
+
|
|
16
|
+
Every rejection is a deterministic transform of this pinned base event
|
|
17
|
+
(RFC 0012):
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"kind": "hypequery-query-event",
|
|
22
|
+
"version": 1,
|
|
23
|
+
"eventId": "0000000000000000000000000000000000000000000000000000000000000000",
|
|
24
|
+
"occurredAt": "2026-07-20T12:34:56.789Z",
|
|
25
|
+
"target": { "project": "project_1", "environment": "production" },
|
|
26
|
+
"queryName": "daily_revenue",
|
|
27
|
+
"operation": "query",
|
|
28
|
+
"outcome": "success",
|
|
29
|
+
"durationMs": 182
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Generator types expand as follows:
|
|
34
|
+
|
|
35
|
+
- `wrong-root-type`: an empty array instead of an object;
|
|
36
|
+
- `missing-required-field`: the base without `durationMs`;
|
|
37
|
+
- `unknown-sql-field`: the base plus `"sql": "SELECT 1"`;
|
|
38
|
+
- `unknown-parameters-field`: the base plus
|
|
39
|
+
`"parameters": { "start": "2026-01-01" }`;
|
|
40
|
+
- `unknown-raw-tenant-field`: the base plus `"tenantId": "acme"`;
|
|
41
|
+
- `newer-version`: the base with `"version": 2`;
|
|
42
|
+
- `malformed-event-id`: the base with `"eventId": "bad"`;
|
|
43
|
+
- `invalid-occurred-at`: the base with
|
|
44
|
+
`"occurredAt": "2026-13-40T99:99:99Z"`;
|
|
45
|
+
- `failure-without-category`: the base with `"outcome": "failure"` and no
|
|
46
|
+
`errorCategory`;
|
|
47
|
+
- `success-with-category`: the base plus `"errorCategory": "internal"`
|
|
48
|
+
while `outcome` stays `"success"`;
|
|
49
|
+
- `unknown-error-category`: the base with `"outcome": "failure"` plus
|
|
50
|
+
`"errorCategory": "exploded"`;
|
|
51
|
+
- `negative-duration`: the base with `"durationMs": -1`;
|
|
52
|
+
- `invalid-target`: the base with
|
|
53
|
+
`"target": { "project": "has space", "environment": "production" }`;
|
|
54
|
+
- `invalid-query-name`: the base with `"queryName": "not an identifier"`;
|
|
55
|
+
- `oversized-correlation-id`: the base plus a `correlationId` of 2049
|
|
56
|
+
repetitions of `x`;
|
|
57
|
+
- `unsafe-accessor`: the base with `kind` served by an enumerable computed
|
|
58
|
+
accessor returning `"hypequery-query-event"` instead of a plain data
|
|
59
|
+
property. Host-model conditional (RFC 0012): implementations whose input
|
|
60
|
+
model cannot express computed accessors skip this case.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
[
|
|
2
|
+
{ "id": "wrong-root-type", "generator": { "type": "wrong-root-type" }, "error": "HQ_EVENT_TYPE" },
|
|
3
|
+
{ "id": "missing-required-field", "generator": { "type": "missing-required-field" }, "error": "HQ_EVENT_TYPE" },
|
|
4
|
+
{ "id": "unknown-sql-field", "generator": { "type": "unknown-sql-field" }, "error": "HQ_EVENT_UNKNOWN_FIELD" },
|
|
5
|
+
{ "id": "unknown-parameters-field", "generator": { "type": "unknown-parameters-field" }, "error": "HQ_EVENT_UNKNOWN_FIELD" },
|
|
6
|
+
{ "id": "unknown-raw-tenant-field", "generator": { "type": "unknown-raw-tenant-field" }, "error": "HQ_EVENT_UNKNOWN_FIELD" },
|
|
7
|
+
{ "id": "newer-version", "generator": { "type": "newer-version" }, "error": "HQ_EVENT_INVALID_VERSION" },
|
|
8
|
+
{ "id": "malformed-event-id", "generator": { "type": "malformed-event-id" }, "error": "HQ_EVENT_INVALID_VALUE" },
|
|
9
|
+
{ "id": "invalid-occurred-at", "generator": { "type": "invalid-occurred-at" }, "error": "HQ_EVENT_INVALID_VALUE" },
|
|
10
|
+
{ "id": "failure-without-category", "generator": { "type": "failure-without-category" }, "error": "HQ_EVENT_INVALID_VALUE" },
|
|
11
|
+
{ "id": "success-with-category", "generator": { "type": "success-with-category" }, "error": "HQ_EVENT_INVALID_VALUE" },
|
|
12
|
+
{ "id": "unknown-error-category", "generator": { "type": "unknown-error-category" }, "error": "HQ_EVENT_INVALID_VALUE" },
|
|
13
|
+
{ "id": "negative-duration", "generator": { "type": "negative-duration" }, "error": "HQ_EVENT_INVALID_VALUE" },
|
|
14
|
+
{ "id": "invalid-target", "generator": { "type": "invalid-target" }, "error": "HQ_EVENT_INVALID_VALUE" },
|
|
15
|
+
{ "id": "invalid-query-name", "generator": { "type": "invalid-query-name" }, "error": "HQ_EVENT_INVALID_VALUE" },
|
|
16
|
+
{ "id": "oversized-correlation-id", "generator": { "type": "oversized-correlation-id" }, "error": "HQ_EVENT_TOO_LARGE" },
|
|
17
|
+
{ "id": "unsafe-accessor", "generator": { "type": "unsafe-accessor" }, "error": "HQ_EVENT_UNSAFE_OBJECT" }
|
|
18
|
+
]
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "minimal-success-event",
|
|
4
|
+
"value": {
|
|
5
|
+
"kind": "hypequery-query-event",
|
|
6
|
+
"version": 1,
|
|
7
|
+
"eventId": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
|
|
8
|
+
"occurredAt": "2026-07-20T12:34:56.789Z",
|
|
9
|
+
"target": {
|
|
10
|
+
"project": "prj_acme-analytics",
|
|
11
|
+
"environment": "production"
|
|
12
|
+
},
|
|
13
|
+
"queryName": "daily_revenue",
|
|
14
|
+
"operation": "query",
|
|
15
|
+
"outcome": "success",
|
|
16
|
+
"durationMs": 182
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"id": "full-failure-event",
|
|
21
|
+
"value": {
|
|
22
|
+
"kind": "hypequery-query-event",
|
|
23
|
+
"version": 1,
|
|
24
|
+
"eventId": "fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210",
|
|
25
|
+
"occurredAt": "2026-07-20T23:59:59Z",
|
|
26
|
+
"target": {
|
|
27
|
+
"project": "prj_acme-analytics",
|
|
28
|
+
"environment": "staging"
|
|
29
|
+
},
|
|
30
|
+
"queryName": "analytics.weekly_active_users",
|
|
31
|
+
"operation": "insert",
|
|
32
|
+
"outcome": "failure",
|
|
33
|
+
"errorCategory": "deadline-exceeded",
|
|
34
|
+
"durationMs": 30000,
|
|
35
|
+
"rowCount": 4200,
|
|
36
|
+
"tenantFingerprint": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
37
|
+
"correlationId": "checkout-deploy-2026-07-20T21:00Z"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
]
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Query implementation extension 1 fixtures
|
|
2
|
+
|
|
3
|
+
`success.json` contains trusted SQL expressions and all three closed named-query
|
|
4
|
+
implementation kinds. `rejections.json` maps invalid artifacts to stable RFC
|
|
5
|
+
0005 failure codes. Generator entries create values that JSON cannot represent
|
|
6
|
+
concisely or safely.
|
|
7
|
+
|
|
8
|
+
These fixtures validate artifact structure only. They do not assert that SQL is
|
|
9
|
+
valid ClickHouse SQL or authorize it for execution; the trusted ClickHouse
|
|
10
|
+
adapter performs those checks.
|
|
11
|
+
|
|
12
|
+
## Generated rejection semantics
|
|
13
|
+
|
|
14
|
+
Rejection entries carry a `surface` (`sql-expression` or `implementation`)
|
|
15
|
+
selecting the validated artifact kind, exactly one of `value` or
|
|
16
|
+
`generator`, and the required stable `error` code. Generator types expand as
|
|
17
|
+
follows (RFC 0012):
|
|
18
|
+
|
|
19
|
+
- `parameters`: a compiled SQL implementation
|
|
20
|
+
`{ "kind": "compiled-sql", "dialect": "clickhouse", "operation":
|
|
21
|
+
"select", "statement": "SELECT 1", "parameters": [...], "readSources":
|
|
22
|
+
[], "tenant": { "kind": "not-required" } }` whose parameters are `count`
|
|
23
|
+
entries `{ "name": "param<i>", "source": { "kind": "input", "path":
|
|
24
|
+
"param<i>" }, "clickHouseType": "String" }` for `i` from 0 to
|
|
25
|
+
`count - 1`;
|
|
26
|
+
- `sql-expression`: `{ "kind": "sql-expression", "dialect": "clickhouse",
|
|
27
|
+
"sql": ..., "output": { "kind": "string" }, "dependencies": [] }` with a
|
|
28
|
+
`sql` of `bytes` repetitions of `a`;
|
|
29
|
+
- `unsafe-accessor`: an object with `kind` served by an enumerable computed
|
|
30
|
+
accessor returning `"semantic-plan"` instead of a plain data property,
|
|
31
|
+
and no other properties. Host-model conditional (RFC 0012):
|
|
32
|
+
implementations whose input model cannot express computed accessors skip
|
|
33
|
+
this case.
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "implementation-not-object",
|
|
4
|
+
"surface": "query-implementation",
|
|
5
|
+
"value": null,
|
|
6
|
+
"error": "HQ_QUERY_IMPLEMENTATION_TYPE"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"id": "implementation-extra-field",
|
|
10
|
+
"surface": "query-implementation",
|
|
11
|
+
"value": {
|
|
12
|
+
"kind": "runtime-reference",
|
|
13
|
+
"runtime": "node",
|
|
14
|
+
"artifactSha256": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
|
|
15
|
+
"entrypoint": "queries.run",
|
|
16
|
+
"path": "./queries.js"
|
|
17
|
+
},
|
|
18
|
+
"error": "HQ_QUERY_IMPLEMENTATION_UNKNOWN_FIELD"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"id": "implementation-unknown-kind",
|
|
22
|
+
"surface": "query-implementation",
|
|
23
|
+
"value": { "kind": "raw-sql" },
|
|
24
|
+
"error": "HQ_QUERY_IMPLEMENTATION_UNKNOWN_KIND"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"id": "runtime-invalid-entrypoint",
|
|
28
|
+
"surface": "query-implementation",
|
|
29
|
+
"value": {
|
|
30
|
+
"kind": "runtime-reference",
|
|
31
|
+
"runtime": "node",
|
|
32
|
+
"artifactSha256": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
|
|
33
|
+
"entrypoint": "queries/customerRevenue"
|
|
34
|
+
},
|
|
35
|
+
"error": "HQ_QUERY_IMPLEMENTATION_INVALID_IDENTIFIER"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"id": "runtime-uppercase-digest",
|
|
39
|
+
"surface": "query-implementation",
|
|
40
|
+
"value": {
|
|
41
|
+
"kind": "runtime-reference",
|
|
42
|
+
"runtime": "node",
|
|
43
|
+
"artifactSha256": "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF",
|
|
44
|
+
"entrypoint": "queries.run"
|
|
45
|
+
},
|
|
46
|
+
"error": "HQ_QUERY_IMPLEMENTATION_INVALID_VALUE"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"id": "compiled-sql-missing-tenant-parameter",
|
|
50
|
+
"surface": "query-implementation",
|
|
51
|
+
"value": {
|
|
52
|
+
"kind": "compiled-sql",
|
|
53
|
+
"dialect": "clickhouse",
|
|
54
|
+
"operation": "select",
|
|
55
|
+
"statement": "SELECT * FROM trips WHERE tenant_id = {tenantId:UUID}",
|
|
56
|
+
"parameters": [],
|
|
57
|
+
"readSources": ["trips"],
|
|
58
|
+
"tenant": { "kind": "required", "parameter": "tenantId" }
|
|
59
|
+
},
|
|
60
|
+
"error": "HQ_QUERY_IMPLEMENTATION_INVALID_REFERENCE"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"id": "compiled-sql-too-many-parameters",
|
|
64
|
+
"surface": "query-implementation",
|
|
65
|
+
"generator": { "type": "parameters", "count": 101 },
|
|
66
|
+
"error": "HQ_QUERY_IMPLEMENTATION_TOO_MANY_ITEMS"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"id": "sql-expression-too-large",
|
|
70
|
+
"surface": "sql-expression",
|
|
71
|
+
"generator": { "type": "sql-expression", "bytes": 65537 },
|
|
72
|
+
"error": "HQ_QUERY_IMPLEMENTATION_TOO_LARGE"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"id": "implementation-accessor",
|
|
76
|
+
"surface": "query-implementation",
|
|
77
|
+
"generator": { "type": "unsafe-accessor" },
|
|
78
|
+
"error": "HQ_QUERY_IMPLEMENTATION_UNSAFE_OBJECT"
|
|
79
|
+
}
|
|
80
|
+
]
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "sql-dimension-expression",
|
|
4
|
+
"surface": "sql-expression",
|
|
5
|
+
"value": {
|
|
6
|
+
"kind": "sql-expression",
|
|
7
|
+
"dialect": "clickhouse",
|
|
8
|
+
"sql": "toDate(pickup_datetime)",
|
|
9
|
+
"output": { "kind": "string" },
|
|
10
|
+
"dependencies": ["pickup_datetime"]
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"id": "sql-measure-expression",
|
|
15
|
+
"surface": "sql-expression",
|
|
16
|
+
"value": {
|
|
17
|
+
"kind": "sql-expression",
|
|
18
|
+
"dialect": "clickhouse",
|
|
19
|
+
"sql": "quantileExact(0.95)(trip_distance)",
|
|
20
|
+
"output": { "kind": "number" },
|
|
21
|
+
"dependencies": ["trip_distance"]
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"id": "fixed-semantic-plan",
|
|
26
|
+
"surface": "query-implementation",
|
|
27
|
+
"value": {
|
|
28
|
+
"kind": "semantic-plan",
|
|
29
|
+
"query": {
|
|
30
|
+
"kind": "dataset",
|
|
31
|
+
"dataset": "trips",
|
|
32
|
+
"dimensions": ["pickup_date"],
|
|
33
|
+
"measures": ["count", "total_revenue"],
|
|
34
|
+
"limit": 100
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"id": "compiled-sql-input-parameters",
|
|
40
|
+
"surface": "query-implementation",
|
|
41
|
+
"value": {
|
|
42
|
+
"kind": "compiled-sql",
|
|
43
|
+
"dialect": "clickhouse",
|
|
44
|
+
"operation": "select",
|
|
45
|
+
"statement": "SELECT pickup_date, count() AS count FROM trips WHERE pickup_date >= {from:Date} GROUP BY pickup_date",
|
|
46
|
+
"parameters": [
|
|
47
|
+
{
|
|
48
|
+
"name": "from",
|
|
49
|
+
"source": { "kind": "input", "path": "range.from" },
|
|
50
|
+
"clickHouseType": "Date"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"readSources": ["analytics.trips"],
|
|
54
|
+
"tenant": { "kind": "not-required" }
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"id": "compiled-sql-required-tenant",
|
|
59
|
+
"surface": "query-implementation",
|
|
60
|
+
"value": {
|
|
61
|
+
"kind": "compiled-sql",
|
|
62
|
+
"dialect": "clickhouse",
|
|
63
|
+
"operation": "select",
|
|
64
|
+
"statement": "SELECT sum(total_amount) AS revenue FROM trips WHERE tenant_id = {tenantId:UUID}",
|
|
65
|
+
"parameters": [
|
|
66
|
+
{
|
|
67
|
+
"name": "tenantId",
|
|
68
|
+
"source": { "kind": "tenant" },
|
|
69
|
+
"clickHouseType": "UUID"
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
"readSources": ["trips"],
|
|
73
|
+
"tenant": { "kind": "required", "parameter": "tenantId" }
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"id": "node-runtime-reference",
|
|
78
|
+
"surface": "query-implementation",
|
|
79
|
+
"value": {
|
|
80
|
+
"kind": "runtime-reference",
|
|
81
|
+
"runtime": "node",
|
|
82
|
+
"artifactSha256": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
|
|
83
|
+
"entrypoint": "queries.customerRevenue"
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"id": "python-runtime-reference",
|
|
88
|
+
"surface": "query-implementation",
|
|
89
|
+
"value": {
|
|
90
|
+
"kind": "runtime-reference",
|
|
91
|
+
"runtime": "python",
|
|
92
|
+
"artifactSha256": "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789",
|
|
93
|
+
"entrypoint": "queries.customer_revenue"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
]
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Portable query schema fixtures, version 1
|
|
2
|
+
|
|
3
|
+
These fixtures accompany RFC 0004. Success fixtures cover every schema kind
|
|
4
|
+
and every currently portable Serve/Zod feature. Rejection fixtures cover every
|
|
5
|
+
stable failure code; generators describe oversized or unsafe inputs that
|
|
6
|
+
cannot be represented directly in JSON.
|
|
7
|
+
|
|
8
|
+
## Generated rejection semantics
|
|
9
|
+
|
|
10
|
+
Rejection entries carry exactly one of `value` or `generator` and the
|
|
11
|
+
required stable `error` code. Generator types expand as follows (RFC 0012):
|
|
12
|
+
|
|
13
|
+
- `nested-array`: wraps `{ "kind": "any" }` in
|
|
14
|
+
`{ "kind": "array", "items": ... }` `depth` times;
|
|
15
|
+
- `union-tree`: one `{ "kind": "union", "variants": [...] }` node whose
|
|
16
|
+
variants are 10 union nodes, each with 100 `{ "kind": "any" }` variants
|
|
17
|
+
(1011 nodes total);
|
|
18
|
+
- `enum-values`: `{ "kind": "enum", "values": [...] }` with `count` values
|
|
19
|
+
`v0` through `v<count - 1>`;
|
|
20
|
+
- `description`: `{ "kind": "string", "description": ... }` with a
|
|
21
|
+
description of `bytes` repetitions of `a`;
|
|
22
|
+
- `unsafe-accessor`: an object with `kind` served by an enumerable computed
|
|
23
|
+
accessor returning `"string"` instead of a plain data property, and no
|
|
24
|
+
other properties. Host-model conditional (RFC 0012): implementations
|
|
25
|
+
whose input model cannot express computed accessors skip this case.
|