@hypequery/protocol-conformance 0.11.1 → 0.12.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/dist/adapters/generators.d.ts +0 -1
- package/dist/adapters/generators.d.ts.map +1 -1
- package/dist/adapters/generators.js +0 -112
- package/dist/adapters/reference.d.ts +1 -1
- package/dist/adapters/reference.d.ts.map +1 -1
- package/dist/adapters/reference.js +6 -6
- package/fixtures/deployments-v2/README.md +15 -0
- package/fixtures/deployments-v2/identity.json +7 -0
- package/fixtures/deployments-v2/rejections.json +874 -0
- package/fixtures/deployments-v2/success.json +67 -0
- package/fixtures/fuzz-seeds-v1/structured-values.json +3 -3
- package/fixtures/manifest.json +4 -4
- package/fixtures/query-implementations-v1/rejections.json +445 -6
- package/fixtures/query-implementations-v1/success.json +88 -12
- package/fixtures/query-schemas-v1/README.md +2 -0
- package/fixtures/query-schemas-v1/rejections.json +224 -13
- package/fixtures/sql-portability-v1/README.md +2 -0
- package/fixtures/sql-portability-v1/non-portable.json +121 -0
- package/fixtures/tagged-values-v1/rejections.json +18 -0
- package/package.json +2 -2
- package/fixtures/deployments-v1/README.md +0 -11
- package/fixtures/deployments-v1/identity.json +0 -12
- package/fixtures/deployments-v1/rejections.json +0 -18
- package/fixtures/deployments-v1/success.json +0 -139
|
@@ -6,8 +6,12 @@
|
|
|
6
6
|
"kind": "sql-expression",
|
|
7
7
|
"dialect": "clickhouse",
|
|
8
8
|
"sql": "toDate(pickup_datetime)",
|
|
9
|
-
"output": {
|
|
10
|
-
|
|
9
|
+
"output": {
|
|
10
|
+
"kind": "string"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": [
|
|
13
|
+
"pickup_datetime"
|
|
14
|
+
]
|
|
11
15
|
}
|
|
12
16
|
},
|
|
13
17
|
{
|
|
@@ -17,8 +21,12 @@
|
|
|
17
21
|
"kind": "sql-expression",
|
|
18
22
|
"dialect": "clickhouse",
|
|
19
23
|
"sql": "quantileExact(0.95)(trip_distance)",
|
|
20
|
-
"output": {
|
|
21
|
-
|
|
24
|
+
"output": {
|
|
25
|
+
"kind": "number"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": [
|
|
28
|
+
"trip_distance"
|
|
29
|
+
]
|
|
22
30
|
}
|
|
23
31
|
},
|
|
24
32
|
{
|
|
@@ -29,8 +37,13 @@
|
|
|
29
37
|
"query": {
|
|
30
38
|
"kind": "dataset",
|
|
31
39
|
"dataset": "trips",
|
|
32
|
-
"dimensions": [
|
|
33
|
-
|
|
40
|
+
"dimensions": [
|
|
41
|
+
"pickup_date"
|
|
42
|
+
],
|
|
43
|
+
"measures": [
|
|
44
|
+
"count",
|
|
45
|
+
"total_revenue"
|
|
46
|
+
],
|
|
34
47
|
"limit": 100
|
|
35
48
|
}
|
|
36
49
|
}
|
|
@@ -46,12 +59,19 @@
|
|
|
46
59
|
"parameters": [
|
|
47
60
|
{
|
|
48
61
|
"name": "from",
|
|
49
|
-
"source": {
|
|
62
|
+
"source": {
|
|
63
|
+
"kind": "input",
|
|
64
|
+
"path": "range.from"
|
|
65
|
+
},
|
|
50
66
|
"clickHouseType": "Date"
|
|
51
67
|
}
|
|
52
68
|
],
|
|
53
|
-
"readSources": [
|
|
54
|
-
|
|
69
|
+
"readSources": [
|
|
70
|
+
"analytics.trips"
|
|
71
|
+
],
|
|
72
|
+
"tenant": {
|
|
73
|
+
"kind": "not-required"
|
|
74
|
+
}
|
|
55
75
|
}
|
|
56
76
|
},
|
|
57
77
|
{
|
|
@@ -65,12 +85,19 @@
|
|
|
65
85
|
"parameters": [
|
|
66
86
|
{
|
|
67
87
|
"name": "tenantId",
|
|
68
|
-
"source": {
|
|
88
|
+
"source": {
|
|
89
|
+
"kind": "tenant"
|
|
90
|
+
},
|
|
69
91
|
"clickHouseType": "UUID"
|
|
70
92
|
}
|
|
71
93
|
],
|
|
72
|
-
"readSources": [
|
|
73
|
-
|
|
94
|
+
"readSources": [
|
|
95
|
+
"trips"
|
|
96
|
+
],
|
|
97
|
+
"tenant": {
|
|
98
|
+
"kind": "required",
|
|
99
|
+
"parameter": "tenantId"
|
|
100
|
+
}
|
|
74
101
|
}
|
|
75
102
|
},
|
|
76
103
|
{
|
|
@@ -92,5 +119,54 @@
|
|
|
92
119
|
"artifactSha256": "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789",
|
|
93
120
|
"entrypoint": "queries.customer_revenue"
|
|
94
121
|
}
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"id": "compiled-sql-formatted-statement",
|
|
125
|
+
"surface": "query-implementation",
|
|
126
|
+
"value": {
|
|
127
|
+
"kind": "compiled-sql",
|
|
128
|
+
"dialect": "clickhouse",
|
|
129
|
+
"operation": "select",
|
|
130
|
+
"statement": "SELECT 1\n FROM trips\n\tWHERE a = 1",
|
|
131
|
+
"parameters": [],
|
|
132
|
+
"readSources": [],
|
|
133
|
+
"tenant": {
|
|
134
|
+
"kind": "not-required"
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"id": "compiled-sql-tenant-required",
|
|
140
|
+
"surface": "query-implementation",
|
|
141
|
+
"value": {
|
|
142
|
+
"kind": "compiled-sql",
|
|
143
|
+
"dialect": "clickhouse",
|
|
144
|
+
"operation": "select",
|
|
145
|
+
"statement": "SELECT 1",
|
|
146
|
+
"parameters": [
|
|
147
|
+
{
|
|
148
|
+
"name": "tenantId",
|
|
149
|
+
"source": {
|
|
150
|
+
"kind": "tenant"
|
|
151
|
+
},
|
|
152
|
+
"clickHouseType": "UUID"
|
|
153
|
+
}
|
|
154
|
+
],
|
|
155
|
+
"readSources": [],
|
|
156
|
+
"tenant": {
|
|
157
|
+
"kind": "required",
|
|
158
|
+
"parameter": "tenantId"
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"id": "runtime-reference-dotted-entrypoint",
|
|
164
|
+
"surface": "query-implementation",
|
|
165
|
+
"value": {
|
|
166
|
+
"kind": "runtime-reference",
|
|
167
|
+
"runtime": "node",
|
|
168
|
+
"artifactSha256": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
|
|
169
|
+
"entrypoint": "queries.reports.customer_revenue"
|
|
170
|
+
}
|
|
95
171
|
}
|
|
96
172
|
]
|
|
@@ -4,4 +4,6 @@ These RFC 0004 fixtures cover the declarative Serve/Zod schema features that can
|
|
|
4
4
|
|
|
5
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.
|
|
6
6
|
|
|
7
|
+
Acceptance of RFC 0004 extended the rejection corpus to pin the constraint rules the accepted text now freezes: `void` rejecting a `default` as an unknown field, a `default` its own schema would reject, an untagged composite default, empty `enum.values`, a single-variant `union`, repeated `required` names, a missing `unknownProperties`, and the numeric and collection bound rules.
|
|
8
|
+
|
|
7
9
|
Every rejection contains exactly one literal value or deterministic generator.
|
|
@@ -1,15 +1,226 @@
|
|
|
1
1
|
[
|
|
2
|
-
{
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
{
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
{
|
|
3
|
+
"id": "not-object",
|
|
4
|
+
"value": null,
|
|
5
|
+
"error": "HQ_SCHEMA_TYPE"
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"id": "unknown-field",
|
|
9
|
+
"value": {
|
|
10
|
+
"kind": "string",
|
|
11
|
+
"format": "uuid"
|
|
12
|
+
},
|
|
13
|
+
"error": "HQ_SCHEMA_UNKNOWN_FIELD"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"id": "unknown-kind",
|
|
17
|
+
"value": {
|
|
18
|
+
"kind": "function"
|
|
19
|
+
},
|
|
20
|
+
"error": "HQ_SCHEMA_UNKNOWN_KIND"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"id": "invalid-property-identifier",
|
|
24
|
+
"value": {
|
|
25
|
+
"kind": "object",
|
|
26
|
+
"properties": {
|
|
27
|
+
"bad-name": {
|
|
28
|
+
"kind": "string"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"required": [],
|
|
32
|
+
"unknownProperties": "reject"
|
|
33
|
+
},
|
|
34
|
+
"error": "HQ_SCHEMA_INVALID_IDENTIFIER"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"id": "invalid-raw-default",
|
|
38
|
+
"value": {
|
|
39
|
+
"kind": "object",
|
|
40
|
+
"properties": {},
|
|
41
|
+
"required": [],
|
|
42
|
+
"unknownProperties": "strip",
|
|
43
|
+
"default": {}
|
|
44
|
+
},
|
|
45
|
+
"error": "HQ_SCHEMA_INVALID_VALUE"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"id": "reversed-bounds",
|
|
49
|
+
"value": {
|
|
50
|
+
"kind": "integer",
|
|
51
|
+
"minimum": 10,
|
|
52
|
+
"maximum": 1
|
|
53
|
+
},
|
|
54
|
+
"error": "HQ_SCHEMA_INVALID_CONSTRAINT"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"id": "required-name-not-declared",
|
|
58
|
+
"value": {
|
|
59
|
+
"kind": "object",
|
|
60
|
+
"properties": {},
|
|
61
|
+
"required": [
|
|
62
|
+
"missing"
|
|
63
|
+
],
|
|
64
|
+
"unknownProperties": "reject"
|
|
65
|
+
},
|
|
66
|
+
"error": "HQ_SCHEMA_INVALID_REQUIRED"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"id": "duplicate-enum",
|
|
70
|
+
"value": {
|
|
71
|
+
"kind": "enum",
|
|
72
|
+
"values": [
|
|
73
|
+
"same",
|
|
74
|
+
"same"
|
|
75
|
+
]
|
|
76
|
+
},
|
|
77
|
+
"error": "HQ_SCHEMA_DUPLICATE_VALUE"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"id": "void-default",
|
|
81
|
+
"value": {
|
|
82
|
+
"kind": "void",
|
|
83
|
+
"default": null
|
|
84
|
+
},
|
|
85
|
+
"error": "HQ_SCHEMA_UNKNOWN_FIELD"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"id": "default-rejected-by-own-schema",
|
|
89
|
+
"value": {
|
|
90
|
+
"kind": "integer",
|
|
91
|
+
"default": 1.5
|
|
92
|
+
},
|
|
93
|
+
"error": "HQ_SCHEMA_INVALID_VALUE"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"id": "raw-array-default",
|
|
97
|
+
"value": {
|
|
98
|
+
"kind": "array",
|
|
99
|
+
"items": {
|
|
100
|
+
"kind": "string"
|
|
101
|
+
},
|
|
102
|
+
"default": [
|
|
103
|
+
"a"
|
|
104
|
+
]
|
|
105
|
+
},
|
|
106
|
+
"error": "HQ_SCHEMA_INVALID_VALUE"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"id": "empty-enum",
|
|
110
|
+
"value": {
|
|
111
|
+
"kind": "enum",
|
|
112
|
+
"values": []
|
|
113
|
+
},
|
|
114
|
+
"error": "HQ_SCHEMA_INVALID_CONSTRAINT"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"id": "single-variant-union",
|
|
118
|
+
"value": {
|
|
119
|
+
"kind": "union",
|
|
120
|
+
"variants": [
|
|
121
|
+
{
|
|
122
|
+
"kind": "string"
|
|
123
|
+
}
|
|
124
|
+
]
|
|
125
|
+
},
|
|
126
|
+
"error": "HQ_SCHEMA_INVALID_CONSTRAINT"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"id": "duplicate-required",
|
|
130
|
+
"value": {
|
|
131
|
+
"kind": "object",
|
|
132
|
+
"properties": {
|
|
133
|
+
"a": {
|
|
134
|
+
"kind": "any"
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"required": [
|
|
138
|
+
"a",
|
|
139
|
+
"a"
|
|
140
|
+
],
|
|
141
|
+
"unknownProperties": "reject"
|
|
142
|
+
},
|
|
143
|
+
"error": "HQ_SCHEMA_INVALID_REQUIRED"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"id": "missing-unknown-properties",
|
|
147
|
+
"value": {
|
|
148
|
+
"kind": "object",
|
|
149
|
+
"properties": {},
|
|
150
|
+
"required": []
|
|
151
|
+
},
|
|
152
|
+
"error": "HQ_SCHEMA_TYPE"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"id": "inclusive-and-exclusive-bound",
|
|
156
|
+
"value": {
|
|
157
|
+
"kind": "number",
|
|
158
|
+
"minimum": 1,
|
|
159
|
+
"exclusiveMinimum": 2
|
|
160
|
+
},
|
|
161
|
+
"error": "HQ_SCHEMA_INVALID_CONSTRAINT"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"id": "empty-exclusive-range",
|
|
165
|
+
"value": {
|
|
166
|
+
"kind": "number",
|
|
167
|
+
"exclusiveMinimum": 1,
|
|
168
|
+
"maximum": 1
|
|
169
|
+
},
|
|
170
|
+
"error": "HQ_SCHEMA_INVALID_CONSTRAINT"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"id": "non-integral-integer-bound",
|
|
174
|
+
"value": {
|
|
175
|
+
"kind": "integer",
|
|
176
|
+
"minimum": 1.5
|
|
177
|
+
},
|
|
178
|
+
"error": "HQ_SCHEMA_INVALID_CONSTRAINT"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"id": "negative-collection-bound",
|
|
182
|
+
"value": {
|
|
183
|
+
"kind": "string",
|
|
184
|
+
"minLength": -1
|
|
185
|
+
},
|
|
186
|
+
"error": "HQ_SCHEMA_INVALID_CONSTRAINT"
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"id": "too-deep",
|
|
190
|
+
"generator": {
|
|
191
|
+
"type": "nested-array",
|
|
192
|
+
"depth": 17
|
|
193
|
+
},
|
|
194
|
+
"error": "HQ_SCHEMA_TOO_DEEP"
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"id": "too-many-nodes",
|
|
198
|
+
"generator": {
|
|
199
|
+
"type": "union-tree"
|
|
200
|
+
},
|
|
201
|
+
"error": "HQ_SCHEMA_TOO_MANY_NODES"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"id": "too-many-items",
|
|
205
|
+
"generator": {
|
|
206
|
+
"type": "enum-values",
|
|
207
|
+
"count": 101
|
|
208
|
+
},
|
|
209
|
+
"error": "HQ_SCHEMA_TOO_MANY_ITEMS"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"id": "description-too-large",
|
|
213
|
+
"generator": {
|
|
214
|
+
"type": "description",
|
|
215
|
+
"bytes": 4097
|
|
216
|
+
},
|
|
217
|
+
"error": "HQ_SCHEMA_TOO_LARGE"
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"id": "unsafe-accessor",
|
|
221
|
+
"generator": {
|
|
222
|
+
"type": "unsafe-accessor"
|
|
223
|
+
},
|
|
224
|
+
"error": "HQ_SCHEMA_UNSAFE_OBJECT"
|
|
225
|
+
}
|
|
15
226
|
]
|
|
@@ -3,4 +3,6 @@
|
|
|
3
3
|
- `portable.json` maps accepted SQL expression fragments to RFC 0003 expression trees and sorted dependencies.
|
|
4
4
|
- `non-portable.json` maps unsupported input to the first issue code and source offset.
|
|
5
5
|
|
|
6
|
+
Source offsets are zero-based and counted in UTF-16 code units, so a character outside the Basic Multilingual Plane (such as an emoji) advances every later offset by two. This is the unit JavaScript strings and most editors use; implementations whose native strings index by code point must convert.
|
|
7
|
+
|
|
6
8
|
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.
|
|
@@ -142,5 +142,126 @@
|
|
|
142
142
|
"sql": "x IN (1, 2, )",
|
|
143
143
|
"code": "HQ_SQL_PORT_SYNTAX",
|
|
144
144
|
"start": 10
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"id": "astral-offset-after-string-literal",
|
|
148
|
+
"sql": "name = '\ud83d\ude00' AND ;",
|
|
149
|
+
"code": "HQ_SQL_PORT_UNSUPPORTED_SYNTAX",
|
|
150
|
+
"start": 16
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"id": "astral-offset-unterminated-string",
|
|
154
|
+
"sql": "'\ud83d\ude00' = 'x",
|
|
155
|
+
"code": "HQ_SQL_PORT_SYNTAX",
|
|
156
|
+
"start": 7
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"id": "astral-unexpected-character",
|
|
160
|
+
"sql": "a + \ud83d\ude00",
|
|
161
|
+
"code": "HQ_SQL_PORT_UNSUPPORTED_SYNTAX",
|
|
162
|
+
"start": 4
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"id": "astral-offset-unsupported-function",
|
|
166
|
+
"sql": "coalesce(name, '\ud83d\ude00\ud83d\ude00') = lower(name)",
|
|
167
|
+
"code": "HQ_SQL_PORT_UNSUPPORTED_FUNCTION",
|
|
168
|
+
"start": 25
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"id": "like-column-pattern",
|
|
172
|
+
"sql": "name LIKE pattern",
|
|
173
|
+
"code": "HQ_SQL_PORT_UNSUPPORTED_SYNTAX",
|
|
174
|
+
"start": 5
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"id": "like-numeric-pattern",
|
|
178
|
+
"sql": "name LIKE 1",
|
|
179
|
+
"code": "HQ_SQL_PORT_UNSUPPORTED_SYNTAX",
|
|
180
|
+
"start": 5
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"id": "additive-chain-too-deep",
|
|
184
|
+
"sqlRepeat": {
|
|
185
|
+
"prefix": "a",
|
|
186
|
+
"value": " + a",
|
|
187
|
+
"suffix": "",
|
|
188
|
+
"count": 16
|
|
189
|
+
},
|
|
190
|
+
"code": "HQ_SQL_PORT_TOO_COMPLEX",
|
|
191
|
+
"start": 62
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"id": "multiplicative-chain-too-deep",
|
|
195
|
+
"sqlRepeat": {
|
|
196
|
+
"prefix": "a",
|
|
197
|
+
"value": " * a",
|
|
198
|
+
"suffix": "",
|
|
199
|
+
"count": 16
|
|
200
|
+
},
|
|
201
|
+
"code": "HQ_SQL_PORT_TOO_COMPLEX",
|
|
202
|
+
"start": 62
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"id": "or-operands-over-limit",
|
|
206
|
+
"sqlRepeat": {
|
|
207
|
+
"prefix": "a",
|
|
208
|
+
"value": " OR a",
|
|
209
|
+
"suffix": "",
|
|
210
|
+
"count": 100
|
|
211
|
+
},
|
|
212
|
+
"code": "HQ_SQL_PORT_TOO_COMPLEX",
|
|
213
|
+
"start": 497
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"id": "and-operands-over-limit",
|
|
217
|
+
"sqlRepeat": {
|
|
218
|
+
"prefix": "a = 1",
|
|
219
|
+
"value": " AND a = 1",
|
|
220
|
+
"suffix": "",
|
|
221
|
+
"count": 100
|
|
222
|
+
},
|
|
223
|
+
"code": "HQ_SQL_PORT_TOO_COMPLEX",
|
|
224
|
+
"start": 996
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"id": "negative-in-list-over-node-limit",
|
|
228
|
+
"sqlRepeat": {
|
|
229
|
+
"prefix": "a IN (-1",
|
|
230
|
+
"value": ", -1",
|
|
231
|
+
"suffix": ")",
|
|
232
|
+
"count": 1000
|
|
233
|
+
},
|
|
234
|
+
"code": "HQ_SQL_PORT_TOO_COMPLEX",
|
|
235
|
+
"start": 4003
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"id": "string-control-character",
|
|
239
|
+
"sql": "name = 'a\u0001b'",
|
|
240
|
+
"code": "HQ_SQL_PORT_UNSUPPORTED_LITERAL",
|
|
241
|
+
"start": 9
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"id": "string-delete-character",
|
|
245
|
+
"sql": "name = 'a\u007fb'",
|
|
246
|
+
"code": "HQ_SQL_PORT_UNSUPPORTED_LITERAL",
|
|
247
|
+
"start": 9
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"id": "string-c1-control-character",
|
|
251
|
+
"sql": "name = '\u0085'",
|
|
252
|
+
"code": "HQ_SQL_PORT_UNSUPPORTED_LITERAL",
|
|
253
|
+
"start": 8
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"id": "string-lone-high-surrogate",
|
|
257
|
+
"sql": "name = '\ud800'",
|
|
258
|
+
"code": "HQ_SQL_PORT_UNSUPPORTED_LITERAL",
|
|
259
|
+
"start": 8
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"id": "string-lone-low-surrogate",
|
|
263
|
+
"sql": "name = 'a\udc00'",
|
|
264
|
+
"code": "HQ_SQL_PORT_UNSUPPORTED_LITERAL",
|
|
265
|
+
"start": 9
|
|
145
266
|
}
|
|
146
267
|
]
|
|
@@ -331,6 +331,24 @@
|
|
|
331
331
|
"value": "before\u000bafter",
|
|
332
332
|
"error": "HQ_VALUE_CONTROL_CHARACTER"
|
|
333
333
|
},
|
|
334
|
+
{
|
|
335
|
+
"id": "model-trailing-lone-high-surrogate",
|
|
336
|
+
"phase": "model",
|
|
337
|
+
"value": "\ud800",
|
|
338
|
+
"error": "HQ_VALUE_INVALID_UNICODE"
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
"id": "model-suffix-lone-high-surrogate",
|
|
342
|
+
"phase": "model",
|
|
343
|
+
"value": "before\ud800",
|
|
344
|
+
"error": "HQ_VALUE_INVALID_UNICODE"
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
"id": "model-lone-low-surrogate",
|
|
348
|
+
"phase": "model",
|
|
349
|
+
"value": "\udc00after",
|
|
350
|
+
"error": "HQ_VALUE_INVALID_UNICODE"
|
|
351
|
+
},
|
|
334
352
|
{
|
|
335
353
|
"id": "value-unsafe-accessor",
|
|
336
354
|
"phase": "model",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hypequery/protocol-conformance",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "Cross-language conformance runner for the Hypequery analytics security protocol",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"hypequery",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"README.md"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@hypequery/protocol": "^0.
|
|
34
|
+
"@hypequery/protocol": "^0.15.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/node": "^22.5.0",
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
# Deployment contract v1 fixtures
|
|
2
|
-
|
|
3
|
-
These fixtures exercise RFC 0006 deployment envelopes containing datasets, named queries, endpoint policy, and runtime artifact references.
|
|
4
|
-
|
|
5
|
-
- `success.json` contains accepted language-neutral deployments.
|
|
6
|
-
- `rejections.json` pins generated invalid inputs and stable error codes.
|
|
7
|
-
- `identity.json` pins canonical bytes and deployment identities.
|
|
8
|
-
|
|
9
|
-
Coverage includes closed fields, versions, identifiers, relationship queryability, missing runtime artifacts, ambiguous routes, collection limits, source limits, and unsafe accessors.
|
|
10
|
-
|
|
11
|
-
Semantic metadata (`examples`, `synonyms`, `format`, `unit`, `currency`, `timezone`, `sensitivity`) plus dataset `description`, `owner`, `freshness`, and `defaults` are covered by the `dataset-with-semantic-metadata` success case and by rejections for an unsupported sensitivity, a non-ISO currency, empty defaults, a default dimension that is not groupable, a default grain without a time field, and a synonym list above the 100-item semantic-metadata ceiling.
|
|
@@ -1,12 +0,0 @@
|
|
|
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
|
-
{
|
|
8
|
-
"id": "dataset-with-semantic-metadata",
|
|
9
|
-
"canonical": "{\"artifacts\":[],\"datasets\":[{\"defaults\":{\"dimensions\":[\"status\"],\"timeGrain\":\"day\"},\"description\":\"Completed customer orders.\",\"dimensions\":[{\"examples\":[\"paid\",\"refunded\"],\"filterable\":true,\"groupable\":true,\"name\":\"status\",\"sensitivity\":\"public\",\"source\":{\"column\":\"status\",\"kind\":\"column\"},\"synonyms\":[\"state\"],\"type\":\"string\"}],\"filters\":[{\"examples\":[\"paid\"],\"field\":\"status\",\"name\":\"status\",\"operators\":[\"eq\",\"neq\"]}],\"freshness\":{\"maxAgeSeconds\":3600},\"measures\":[{\"aggregation\":\"sum\",\"currency\":\"USD\",\"field\":\"amount\",\"filters\":[],\"format\":\"0,0.00\",\"name\":\"revenue\",\"sensitivity\":\"confidential\",\"unit\":\"currency\"}],\"metrics\":[],\"name\":\"orders\",\"owner\":\"revenue-team\",\"relationships\":[],\"sensitivity\":\"internal\",\"source\":\"analytics.orders\",\"synonyms\":[\"purchases\",\"sales\"],\"tenant\":{\"field\":\"tenant_id\",\"kind\":\"required\"},\"timeField\":\"created_at\",\"timezone\":\"UTC\"}],\"kind\":\"hypequery-deployment\",\"queries\":[],\"version\":1}",
|
|
10
|
-
"sha256": "c5c349d90561634fa773753d0bccddfb8af60925f09bb0c9310af8fae3762ca9"
|
|
11
|
-
}
|
|
12
|
-
]
|
|
@@ -1,18 +0,0 @@
|
|
|
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": "invalid-sensitivity", "generator": { "type": "invalid-sensitivity" }, "error": "HQ_DEPLOYMENT_INVALID_VALUE" },
|
|
10
|
-
{ "id": "invalid-currency", "generator": { "type": "invalid-currency" }, "error": "HQ_DEPLOYMENT_INVALID_VALUE" },
|
|
11
|
-
{ "id": "empty-defaults", "generator": { "type": "empty-defaults" }, "error": "HQ_DEPLOYMENT_INVALID_VALUE" },
|
|
12
|
-
{ "id": "default-dimension-not-groupable", "generator": { "type": "default-dimension-not-groupable" }, "error": "HQ_DEPLOYMENT_INVALID_REFERENCE" },
|
|
13
|
-
{ "id": "default-grain-without-time-field", "generator": { "type": "default-grain-without-time-field" }, "error": "HQ_DEPLOYMENT_INVALID_REFERENCE" },
|
|
14
|
-
{ "id": "too-many-datasets", "generator": { "type": "too-many-datasets" }, "error": "HQ_DEPLOYMENT_TOO_MANY_ITEMS" },
|
|
15
|
-
{ "id": "too-many-synonyms", "generator": { "type": "too-many-synonyms" }, "error": "HQ_DEPLOYMENT_TOO_MANY_ITEMS" },
|
|
16
|
-
{ "id": "source-too-large", "generator": { "type": "source-too-large" }, "error": "HQ_DEPLOYMENT_TOO_LARGE" },
|
|
17
|
-
{ "id": "unsafe-accessor", "generator": { "type": "unsafe-accessor" }, "error": "HQ_DEPLOYMENT_UNSAFE_OBJECT" }
|
|
18
|
-
]
|