@hypequery/protocol-conformance 0.9.1 → 0.10.0
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/README.md +43 -27
- package/dist/adapters/generators.d.ts.map +1 -1
- package/dist/adapters/generators.js +14 -0
- package/dist/adapters/reference.d.ts +10 -1
- package/dist/adapters/reference.d.ts.map +1 -1
- package/dist/adapters/reference.js +52 -1
- package/dist/adapters/stdio.d.ts +3 -1
- package/dist/adapters/stdio.d.ts.map +1 -1
- package/dist/adapters/stdio.js +3 -0
- package/dist/bin/reference-adapter.js +2 -1
- package/dist/compare.js +10 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/report.d.ts.map +1 -1
- package/dist/report.js +4 -0
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +74 -8
- package/dist/types.d.ts +14 -0
- package/dist/types.d.ts.map +1 -1
- package/fixtures/cache-keys-v1/README.md +59 -0
- package/fixtures/cache-keys-v1/rejections.json +172 -0
- package/fixtures/cache-keys-v1/success.json +134 -0
- package/fixtures/deployment-bundles-v1/README.md +5 -57
- package/fixtures/deployment-releases-v1/README.md +6 -33
- package/fixtures/deployments-v1/README.md +5 -73
- package/fixtures/expressions-v1/README.md +4 -22
- package/fixtures/fuzz-seeds-v1/README.md +6 -26
- package/fixtures/identifiers-v1/README.md +4 -12
- package/fixtures/identifiers-v1/rejections.json +38 -0
- package/fixtures/identifiers-v1/success.json +18 -0
- package/fixtures/manifest.json +161 -39
- package/fixtures/query-diagnostics-v1/README.md +4 -45
- package/fixtures/query-events-v1/README.md +4 -56
- package/fixtures/query-implementations-v1/README.md +4 -30
- package/fixtures/query-schemas-v1/README.md +4 -22
- package/fixtures/sql-portability-v1/README.md +3 -12
- package/fixtures/tagged-values-v1/README.md +12 -1
- package/fixtures/tagged-values-v1/rejections.json +89 -0
- package/fixtures/tagged-values-v1/success.json +127 -0
- package/package.json +13 -5
package/fixtures/manifest.json
CHANGED
|
@@ -5,113 +5,235 @@
|
|
|
5
5
|
{
|
|
6
6
|
"name": "tagged-values-v1",
|
|
7
7
|
"rfc": "0001",
|
|
8
|
-
"codePrefixes": [
|
|
8
|
+
"codePrefixes": [
|
|
9
|
+
"HQ_VALUE_"
|
|
10
|
+
],
|
|
9
11
|
"files": [
|
|
10
|
-
{
|
|
11
|
-
|
|
12
|
+
{
|
|
13
|
+
"path": "tagged-values-v1/success.json",
|
|
14
|
+
"role": "success"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"path": "tagged-values-v1/rejections.json",
|
|
18
|
+
"role": "rejection"
|
|
19
|
+
}
|
|
12
20
|
]
|
|
13
21
|
},
|
|
14
22
|
{
|
|
15
23
|
"name": "identifiers-v1",
|
|
16
24
|
"rfc": "0002",
|
|
17
|
-
"codePrefixes": [
|
|
25
|
+
"codePrefixes": [
|
|
26
|
+
"HQ_IDENTIFIER_"
|
|
27
|
+
],
|
|
18
28
|
"files": [
|
|
19
|
-
{
|
|
20
|
-
|
|
29
|
+
{
|
|
30
|
+
"path": "identifiers-v1/success.json",
|
|
31
|
+
"role": "success"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"path": "identifiers-v1/rejections.json",
|
|
35
|
+
"role": "rejection"
|
|
36
|
+
}
|
|
21
37
|
]
|
|
22
38
|
},
|
|
23
39
|
{
|
|
24
40
|
"name": "expressions-v1",
|
|
25
41
|
"rfc": "0003",
|
|
26
|
-
"codePrefixes": [
|
|
42
|
+
"codePrefixes": [
|
|
43
|
+
"HQ_EXPRESSION_"
|
|
44
|
+
],
|
|
27
45
|
"files": [
|
|
28
46
|
{
|
|
29
47
|
"path": "expressions-v1/success.json",
|
|
30
48
|
"role": "success",
|
|
31
|
-
"sections": [
|
|
49
|
+
"sections": [
|
|
50
|
+
"/expressions",
|
|
51
|
+
"/queries"
|
|
52
|
+
]
|
|
32
53
|
},
|
|
33
|
-
{
|
|
54
|
+
{
|
|
55
|
+
"path": "expressions-v1/rejections.json",
|
|
56
|
+
"role": "rejection"
|
|
57
|
+
}
|
|
34
58
|
]
|
|
35
59
|
},
|
|
36
60
|
{
|
|
37
61
|
"name": "query-schemas-v1",
|
|
38
62
|
"rfc": "0004",
|
|
39
|
-
"codePrefixes": [
|
|
63
|
+
"codePrefixes": [
|
|
64
|
+
"HQ_SCHEMA_"
|
|
65
|
+
],
|
|
40
66
|
"files": [
|
|
41
|
-
{
|
|
42
|
-
|
|
67
|
+
{
|
|
68
|
+
"path": "query-schemas-v1/success.json",
|
|
69
|
+
"role": "success"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"path": "query-schemas-v1/rejections.json",
|
|
73
|
+
"role": "rejection"
|
|
74
|
+
}
|
|
43
75
|
]
|
|
44
76
|
},
|
|
45
77
|
{
|
|
46
78
|
"name": "query-implementations-v1",
|
|
47
79
|
"rfc": "0005",
|
|
48
|
-
"codePrefixes": [
|
|
80
|
+
"codePrefixes": [
|
|
81
|
+
"HQ_QUERY_IMPLEMENTATION_"
|
|
82
|
+
],
|
|
49
83
|
"files": [
|
|
50
|
-
{
|
|
51
|
-
|
|
84
|
+
{
|
|
85
|
+
"path": "query-implementations-v1/success.json",
|
|
86
|
+
"role": "success"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"path": "query-implementations-v1/rejections.json",
|
|
90
|
+
"role": "rejection"
|
|
91
|
+
}
|
|
52
92
|
]
|
|
53
93
|
},
|
|
54
94
|
{
|
|
55
95
|
"name": "deployments-v1",
|
|
56
96
|
"rfc": "0006",
|
|
57
|
-
"codePrefixes": [
|
|
97
|
+
"codePrefixes": [
|
|
98
|
+
"HQ_DEPLOYMENT_"
|
|
99
|
+
],
|
|
58
100
|
"files": [
|
|
59
|
-
{
|
|
60
|
-
|
|
61
|
-
|
|
101
|
+
{
|
|
102
|
+
"path": "deployments-v1/success.json",
|
|
103
|
+
"role": "success"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"path": "deployments-v1/rejections.json",
|
|
107
|
+
"role": "rejection"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"path": "deployments-v1/identity.json",
|
|
111
|
+
"role": "identity"
|
|
112
|
+
}
|
|
62
113
|
]
|
|
63
114
|
},
|
|
64
115
|
{
|
|
65
116
|
"name": "deployment-bundles-v1",
|
|
66
117
|
"rfc": "0007",
|
|
67
|
-
"codePrefixes": [
|
|
118
|
+
"codePrefixes": [
|
|
119
|
+
"HQ_BUNDLE_"
|
|
120
|
+
],
|
|
68
121
|
"files": [
|
|
69
|
-
{
|
|
70
|
-
|
|
71
|
-
|
|
122
|
+
{
|
|
123
|
+
"path": "deployment-bundles-v1/success.json",
|
|
124
|
+
"role": "success"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"path": "deployment-bundles-v1/rejections.json",
|
|
128
|
+
"role": "rejection"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"path": "deployment-bundles-v1/identity.json",
|
|
132
|
+
"role": "identity"
|
|
133
|
+
}
|
|
72
134
|
]
|
|
73
135
|
},
|
|
74
136
|
{
|
|
75
137
|
"name": "deployment-releases-v1",
|
|
76
138
|
"rfc": "0008",
|
|
77
|
-
"codePrefixes": [
|
|
139
|
+
"codePrefixes": [
|
|
140
|
+
"HQ_RELEASE_"
|
|
141
|
+
],
|
|
78
142
|
"files": [
|
|
79
|
-
{
|
|
80
|
-
|
|
81
|
-
|
|
143
|
+
{
|
|
144
|
+
"path": "deployment-releases-v1/success.json",
|
|
145
|
+
"role": "success"
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"path": "deployment-releases-v1/rejections.json",
|
|
149
|
+
"role": "rejection"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"path": "deployment-releases-v1/identity.json",
|
|
153
|
+
"role": "identity"
|
|
154
|
+
}
|
|
82
155
|
]
|
|
83
156
|
},
|
|
84
157
|
{
|
|
85
158
|
"name": "query-events-v1",
|
|
86
159
|
"rfc": "0011",
|
|
87
|
-
"codePrefixes": [
|
|
160
|
+
"codePrefixes": [
|
|
161
|
+
"HQ_EVENT_"
|
|
162
|
+
],
|
|
88
163
|
"files": [
|
|
89
|
-
{
|
|
90
|
-
|
|
164
|
+
{
|
|
165
|
+
"path": "query-events-v1/success.json",
|
|
166
|
+
"role": "success"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"path": "query-events-v1/rejections.json",
|
|
170
|
+
"role": "rejection"
|
|
171
|
+
}
|
|
91
172
|
]
|
|
92
173
|
},
|
|
93
174
|
{
|
|
94
175
|
"name": "query-diagnostics-v1",
|
|
95
176
|
"rfc": "0011",
|
|
96
|
-
"codePrefixes": [
|
|
177
|
+
"codePrefixes": [
|
|
178
|
+
"HQ_DIAGNOSTICS_"
|
|
179
|
+
],
|
|
97
180
|
"files": [
|
|
98
|
-
{
|
|
99
|
-
|
|
181
|
+
{
|
|
182
|
+
"path": "query-diagnostics-v1/success.json",
|
|
183
|
+
"role": "success"
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"path": "query-diagnostics-v1/rejections.json",
|
|
187
|
+
"role": "rejection"
|
|
188
|
+
}
|
|
100
189
|
]
|
|
101
190
|
},
|
|
102
191
|
{
|
|
103
192
|
"name": "sql-portability-v1",
|
|
104
193
|
"rfc": "0003",
|
|
105
|
-
"codePrefixes": [
|
|
194
|
+
"codePrefixes": [
|
|
195
|
+
"HQ_SQL_PORT_"
|
|
196
|
+
],
|
|
106
197
|
"files": [
|
|
107
|
-
{
|
|
108
|
-
|
|
198
|
+
{
|
|
199
|
+
"path": "sql-portability-v1/portable.json",
|
|
200
|
+
"role": "portable"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"path": "sql-portability-v1/non-portable.json",
|
|
204
|
+
"role": "non-portable"
|
|
205
|
+
}
|
|
206
|
+
]
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"name": "cache-keys-v1",
|
|
210
|
+
"rfc": "0013",
|
|
211
|
+
"codePrefixes": [
|
|
212
|
+
"HQ_CACHE_KEY_"
|
|
213
|
+
],
|
|
214
|
+
"files": [
|
|
215
|
+
{
|
|
216
|
+
"path": "cache-keys-v1/success.json",
|
|
217
|
+
"role": "success"
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"path": "cache-keys-v1/rejections.json",
|
|
221
|
+
"role": "rejection"
|
|
222
|
+
}
|
|
109
223
|
]
|
|
110
224
|
}
|
|
111
225
|
],
|
|
112
226
|
"fuzz": [
|
|
113
|
-
{
|
|
114
|
-
|
|
115
|
-
|
|
227
|
+
{
|
|
228
|
+
"path": "fuzz-seeds-v1/value-sources.json",
|
|
229
|
+
"family": "tagged-values-v1"
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"path": "fuzz-seeds-v1/structured-values.json"
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"path": "fuzz-seeds-v1/sql-expressions.json",
|
|
236
|
+
"family": "sql-portability-v1"
|
|
237
|
+
}
|
|
116
238
|
]
|
|
117
239
|
}
|
|
@@ -1,49 +1,8 @@
|
|
|
1
1
|
# Query diagnostics v1 fixtures
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
validator.
|
|
5
|
-
- `rejections.json` maps generated invalid inputs to stable failure codes.
|
|
3
|
+
These fixtures exercise the privileged diagnostics projection in RFC 0011.
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
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.
|
|
5
|
+
- `success.json` contains accepted diagnostic records.
|
|
6
|
+
- `rejections.json` maps invalid or generated records to stable failure codes.
|
|
15
7
|
|
|
16
|
-
|
|
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.
|
|
8
|
+
Coverage includes required fields, versions, IDs, terminal reasons, attempt counts, safe-message controls, debug-query limits, unknown result or credential fields, and unsafe accessors. Debug queries are deliberately non-executable and contain no parameter values.
|
|
@@ -1,60 +1,8 @@
|
|
|
1
1
|
# Query event v1 fixtures
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
- `rejections.json` maps generated invalid inputs to stable failure codes.
|
|
3
|
+
This RFC 0011 family pins bounded, non-sensitive analytics query events.
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
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.
|
|
5
|
+
- `success.json` contains accepted events.
|
|
6
|
+
- `rejections.json` maps invalid or generated events to stable codes.
|
|
13
7
|
|
|
14
|
-
|
|
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.
|
|
8
|
+
The default event cannot represent SQL, parameter values, or raw tenant IDs. Coverage also includes versions, event IDs, timestamps, outcomes, error categories, durations, targets, query names, correlation limits, and unsafe accessors.
|
|
@@ -1,33 +1,7 @@
|
|
|
1
|
-
# Query implementation
|
|
1
|
+
# Query implementation v1 fixtures
|
|
2
2
|
|
|
3
|
-
|
|
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.
|
|
3
|
+
This family covers RFC 0005 trusted SQL expressions and the closed named-query implementation kinds.
|
|
7
4
|
|
|
8
|
-
|
|
9
|
-
valid ClickHouse SQL or authorize it for execution; the trusted ClickHouse
|
|
10
|
-
adapter performs those checks.
|
|
5
|
+
`success.json` contains accepted structures. `rejections.json` selects either the SQL-expression or implementation surface and pins invalid values, bounded generators, and stable error codes.
|
|
11
6
|
|
|
12
|
-
|
|
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.
|
|
7
|
+
Structural validation does not prove SQL is valid or authorize execution. The trusted database adapter owns those checks.
|
|
@@ -1,25 +1,7 @@
|
|
|
1
|
-
# Portable query schema fixtures
|
|
1
|
+
# Portable query schema v1 fixtures
|
|
2
2
|
|
|
3
|
-
These
|
|
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.
|
|
3
|
+
These RFC 0004 fixtures cover the declarative Serve/Zod schema features that can travel between runtimes without executable transforms.
|
|
7
4
|
|
|
8
|
-
|
|
5
|
+
`success.json` exercises every portable schema kind. `rejections.json` pins stable errors for invalid values plus generated depth, width, description-size, and unsafe-accessor boundaries.
|
|
9
6
|
|
|
10
|
-
|
|
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.
|
|
7
|
+
Every rejection contains exactly one literal value or deterministic generator.
|
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
# SQL portability v1 fixtures
|
|
2
2
|
|
|
3
|
-
- `portable.json` maps SQL expression fragments
|
|
4
|
-
|
|
5
|
-
- `non-portable.json` maps inputs outside the subset to the first
|
|
6
|
-
incompatibility issue code and its start offset.
|
|
3
|
+
- `portable.json` maps accepted SQL expression fragments to RFC 0003 expression trees and sorted dependencies.
|
|
4
|
+
- `non-portable.json` maps unsupported input to the first issue code and source offset.
|
|
7
5
|
|
|
8
|
-
|
|
9
|
-
subset is deliberately small: qualified and backtick-quoted identifiers,
|
|
10
|
-
numeric/string/boolean/null literals, `+ - * /`, the comparison operators,
|
|
11
|
-
literal `IN`/`NOT IN` lists, `BETWEEN` with literal bounds, `LIKE`,
|
|
12
|
-
`AND`/`OR`/`NOT`, parentheses, and the RFC 0003 function allowlist
|
|
13
|
-
(`nullIfZero`, `coalesce`, `round`, `floor`, `ceil`). Statements, casts,
|
|
14
|
-
subqueries, lambdas, comments, unlisted functions, backslash escapes, and
|
|
15
|
-
non-literal `IN`/`BETWEEN` operands are non-portable by construction.
|
|
6
|
+
The portable subset covers identifiers, literals, arithmetic, comparisons, literal `IN` lists, literal `BETWEEN`, `LIKE`, boolean logic, parentheses, and the approved formula functions. Statements, subqueries, casts, lambdas, comments, unapproved functions, and dynamic list/range operands remain non-portable by construction.
|
|
@@ -34,11 +34,22 @@ Generators expand as follows:
|
|
|
34
34
|
- `array`: creates one tagged array containing `items` copies of `value`;
|
|
35
35
|
- `array-tree`: creates one tagged array containing `branches` tagged arrays,
|
|
36
36
|
each containing `itemsPerBranch` copies of `value`;
|
|
37
|
-
- `repeat-string`: concatenates `count` copies of the UTF-8 string `utf8
|
|
37
|
+
- `repeat-string`: concatenates `count` copies of the UTF-8 string `utf8`;
|
|
38
|
+
- `unsafe-accessor`: builds an object whose `$hypequery` member is served by a
|
|
39
|
+
computed accessor rather than a plain data property. Implementations whose
|
|
40
|
+
input model cannot express computed accessors respond `skipped`, and must
|
|
41
|
+
then declare their own hostile-object suite per RFC 0012.
|
|
38
42
|
|
|
39
43
|
`error` is the required stable failure code. `phase` identifies the earliest
|
|
40
44
|
stage that must reject the input. A consumer may reject earlier only when it
|
|
41
45
|
returns the same code and does not partially execute or hash the value.
|
|
42
46
|
|
|
47
|
+
## What these fixtures cannot express
|
|
48
|
+
|
|
49
|
+
Metadata integers are accepted by value, not by lexical form: `1`, `1.0`, and
|
|
50
|
+
`1e0` all denote `1` and all canonicalize to `1`. The manifest cannot carry
|
|
51
|
+
that distinction — writing `1.0` into a `value` field serializes back to `1` —
|
|
52
|
+
so per-language unit tests cover the coercion of an integral host float.
|
|
53
|
+
|
|
43
54
|
Fixture runners must not pass `sourceUtf8` through an ordinary JSON dictionary
|
|
44
55
|
parser before duplicate-key detection.
|
|
@@ -294,5 +294,94 @@
|
|
|
294
294
|
"count": 65537
|
|
295
295
|
},
|
|
296
296
|
"error": "HQ_VALUE_TOO_LARGE"
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
"id": "datetime64-nanoseconds-overflow",
|
|
300
|
+
"phase": "model",
|
|
301
|
+
"value": {
|
|
302
|
+
"$hypequery": {
|
|
303
|
+
"type": "datetime",
|
|
304
|
+
"version": 1,
|
|
305
|
+
"clickhouseType": "DateTime64",
|
|
306
|
+
"precision": 9,
|
|
307
|
+
"timezone": "UTC",
|
|
308
|
+
"value": "2262-04-11T23:47:16.854775808Z"
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
"error": "HQ_VALUE_OUT_OF_RANGE"
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
"id": "timezone-fixed-offset",
|
|
315
|
+
"phase": "model",
|
|
316
|
+
"value": {
|
|
317
|
+
"$hypequery": {
|
|
318
|
+
"type": "datetime",
|
|
319
|
+
"version": 1,
|
|
320
|
+
"clickhouseType": "DateTime",
|
|
321
|
+
"precision": 0,
|
|
322
|
+
"timezone": "+02:00",
|
|
323
|
+
"value": "2026-07-13T14:30:45Z"
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
"error": "HQ_VALUE_INVALID_FORMAT"
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
"id": "control-character-vertical-tab",
|
|
330
|
+
"phase": "model",
|
|
331
|
+
"value": "before\u000bafter",
|
|
332
|
+
"error": "HQ_VALUE_CONTROL_CHARACTER"
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
"id": "value-unsafe-accessor",
|
|
336
|
+
"phase": "model",
|
|
337
|
+
"generator": {
|
|
338
|
+
"type": "unsafe-accessor"
|
|
339
|
+
},
|
|
340
|
+
"error": "HQ_VALUE_UNSAFE_OBJECT"
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
"id": "timezone-offset-shaped",
|
|
344
|
+
"phase": "model",
|
|
345
|
+
"value": {
|
|
346
|
+
"$hypequery": {
|
|
347
|
+
"type": "datetime",
|
|
348
|
+
"version": 1,
|
|
349
|
+
"clickhouseType": "DateTime",
|
|
350
|
+
"precision": 0,
|
|
351
|
+
"timezone": "+0200",
|
|
352
|
+
"value": "2026-07-13T14:30:45Z"
|
|
353
|
+
}
|
|
354
|
+
},
|
|
355
|
+
"error": "HQ_VALUE_INVALID_FORMAT"
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
"id": "timezone-leading-underscore",
|
|
359
|
+
"phase": "model",
|
|
360
|
+
"value": {
|
|
361
|
+
"$hypequery": {
|
|
362
|
+
"type": "datetime",
|
|
363
|
+
"version": 1,
|
|
364
|
+
"clickhouseType": "DateTime",
|
|
365
|
+
"precision": 0,
|
|
366
|
+
"timezone": "_Foo/Bar",
|
|
367
|
+
"value": "2026-07-13T14:30:45Z"
|
|
368
|
+
}
|
|
369
|
+
},
|
|
370
|
+
"error": "HQ_VALUE_INVALID_FORMAT"
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
"id": "timezone-too-long",
|
|
374
|
+
"phase": "model",
|
|
375
|
+
"value": {
|
|
376
|
+
"$hypequery": {
|
|
377
|
+
"type": "datetime",
|
|
378
|
+
"version": 1,
|
|
379
|
+
"clickhouseType": "DateTime",
|
|
380
|
+
"precision": 0,
|
|
381
|
+
"timezone": "Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
382
|
+
"value": "2026-07-13T14:30:45Z"
|
|
383
|
+
}
|
|
384
|
+
},
|
|
385
|
+
"error": "HQ_VALUE_TOO_LARGE"
|
|
297
386
|
}
|
|
298
387
|
]
|