Skip to content

Commit c76feaf

Browse files
rustyconoverclaude
andcommitted
protocol 3.4: nullable BindRequest.arguments, ArgumentsLocation, nested-binary corpus
Large-values spec (vgi docs/large-values-3.4.md §2-§3): - BindRequest.arguments is nullable; arguments_location (ArgumentsLocation{ref, size, sha256}) is appended as the last field. Exactly one must be set, else StatusError invalid_bind_request (INVALID_ARGUMENT, the spec message); a malformed size/sha256 is invalid_arguments_ref. - BindRequest keeps the bytes it was decoded from and re-encodes as them (raw preservation, rule 4), so every request embedding it as bind_call re-emits what the client sent. dataclasses.replace() drops them; with_resolved_arguments() keeps them for Phase 2b. - Framework readers go through require_arguments() (FAILED_PRECONDITION arguments_not_resolved until Phase 2b resolves references). - SHARED_CONTRACT_TYPES gains BindRequest, ArgumentsLocation, Copy*Context and the six bind_call-embedding requests; NESTED_BINARY_RECORDS names the records emitted as the raw-preserving wrapper (BindRequest only). - conformance/nested-binary/: non-canonical bind_call fixtures for the six embedding requests plus the null/both-null/both-set binds, generated by vgi.codegen.nested_binary_fixtures and distributed to every SDK by regen_generated.py, which now writes binary targets. - cpp_records marks the extension's raw bind_call fields. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 20c30c7 commit c76feaf

27 files changed

Lines changed: 990 additions & 31 deletions

‎.gitattributes‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@
33

44
# Use bd merge for beads JSONL files
55
.beads/issues.jsonl merge=beads
6+
7+
# The nested-binary conformance corpus is compared byte for byte (large-values
8+
# spec 3.4): never convert line endings in it.
9+
conformance/nested-binary/** -text
4.2 KB
Binary file not shown.
4.13 KB
Binary file not shown.
4.8 KB
Binary file not shown.
4.84 KB
Binary file not shown.
5.29 KB
Binary file not shown.
5.42 KB
Binary file not shown.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"record": "BindRequest",
3+
"source": "bind_call.bin",
4+
"value_encoding": "Each column by name, in column order. binary -> {'hex': lowercase hex}; utf8 and dictionary<int16, utf8> -> string; bool, int64 -> JSON scalar; list -> array; struct -> object; null -> null.",
5+
"fields": {
6+
"function_name": "nested_binary_fixture",
7+
"arguments": {
8+
"hex": "ffffffff200100001000000000000a000c000600050008000a000000000104000c00000008000800000004000800000004000000010000000400000058ffffff0000010d1c000000240000000400000003000000a00000004c000000140000000400000061726773000000004cffffff8cffffff00000102100000001c00000004000000000000000b0000006e616d65645f6c696d697400c8ffffff0000000120000000c0ffffff00000102100000002800000004000000000000000c000000706f736974696f6e616c5f310000000008000c0008000700080000000000000140000000100014000800060007000c00000010001000000000000105100000002400000004000000000000000c000000706f736974696f6e616c5f30000000000400040004000000ffffffff1801000014000000000000000c0016000600050008000c000c0000000003040018000000200000000000000000000a0018000c00040008000a0000009c00000010000000010000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000800000000000000070000000000000010000000000000000000000000000000100000000000000008000000000000001800000000000000000000000000000018000000000000000400000000000000000000000400000001000000000000000000000000000000010000000000000000000000000000000100000000000000000000000000000001000000000000000000000000000000000000000700000073656174746c65002a000000000000000700000000000000ffffffff00000000"
9+
},
10+
"function_type": "TABLE",
11+
"input_schema": null,
12+
"settings": {
13+
"hex": "ffffffffb00000001000000000000a000c000600050008000a000000000104000c00000008000800000004000800000004000000020000005000000004000000c8ffffff000001021000000020000000040000000000000007000000746872656164730008000c0008000700080000000000000140000000100014000800060007000c00000010001000000000000105100000002000000004000000000000000800000074696d657a6f6e65000000000400040004000000ffffffffc800000014000000000000000c0016000600050008000c000c0000000003040018000000180000000000000000000a0018000c00040008000a0000006c0000001000000001000000000000000000000005000000000000000000000000000000000000000000000000000000080000000000000008000000000000000300000000000000100000000000000000000000000000001000000000000000080000000000000000000000020000000100000000000000000000000000000001000000000000000000000000000000000000000300000055544300000000000400000000000000ffffffff00000000"
14+
},
15+
"secrets": null,
16+
"attach_opaque_data": {
17+
"hex": "007365616c65642d6174746163682d656e76656c6f7065ff"
18+
},
19+
"transaction_opaque_data": {
20+
"hex": "74786e2d37"
21+
},
22+
"resolved_secrets_provided": true,
23+
"at_unit": "VERSION",
24+
"at_value": "12",
25+
"copy_from": {
26+
"format": "csv",
27+
"file_path": "s3://bucket/input.csv",
28+
"expected_schema": {
29+
"hex": "ffffffffa80000001000000000000a000c000600050008000a000000000104000c00000008000800000004000800000004000000020000004c00000004000000ccffffff00000102100000001c0000000400000000000000010000006e00000008000c0008000700080000000000000140000000100014000800060007000c00000010001000000000000105100000001c00000004000000000000000400000063697479000000000400040004000000"
30+
}
31+
},
32+
"copy_to": null,
33+
"schema_path": [
34+
"main",
35+
"fixtures"
36+
],
37+
"argument_names": [
38+
"city",
39+
null,
40+
"limit"
41+
],
42+
"arguments_location": null
43+
}
44+
}
8.53 KB
Binary file not shown.
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
{
2+
"corpus": "nested-binary",
3+
"spec": "vgi docs/large-values-3.4.md \u00a73.3-\u00a73.4",
4+
"generator": "vgi.codegen.nested_binary_fixtures",
5+
"generator_version": "1",
6+
"noncanonical_because": "bind_call.bin carries schema-level custom metadata {\"vgi.conformance\": \"nested-binary: not what an encoder writes\"}",
7+
"bind_call": {
8+
"file": "bind_call.bin",
9+
"sha256": "f820e0bafe8e28c7b3423ff3cfaab198e46ed0a050087377c65359a66a85c4d1"
10+
},
11+
"embedding": [
12+
{
13+
"file": "init-noncanonical.arrow",
14+
"record": "InitRequest",
15+
"field": "bind_call",
16+
"field_bytes": "bind_call.bin",
17+
"field_expected": "expected.json",
18+
"sha256": "0be4237a9fd64c2b2ade1062fbb0838c62d85fa1d0d20de7c6c33c358ce689f9"
19+
},
20+
{
21+
"file": "cardinality-noncanonical.arrow",
22+
"record": "TableFunctionCardinalityRequest",
23+
"field": "bind_call",
24+
"field_bytes": "bind_call.bin",
25+
"field_expected": "expected.json",
26+
"sha256": "5ae585b3b5d8048656936acc79aca44384c2b0d446c62ca3863c2930cc007444"
27+
},
28+
{
29+
"file": "statistics-noncanonical.arrow",
30+
"record": "TableFunctionStatisticsRequest",
31+
"field": "bind_call",
32+
"field_bytes": "bind_call.bin",
33+
"field_expected": "expected.json",
34+
"sha256": "eb39522ec9eb9696f78e992fcfa794df9423f6851d84d8c1c7f06bc17fe07cef"
35+
},
36+
{
37+
"file": "dynamic-to-string-noncanonical.arrow",
38+
"record": "TableFunctionDynamicToStringRequest",
39+
"field": "bind_call",
40+
"field_bytes": "bind_call.bin",
41+
"field_expected": "expected.json",
42+
"sha256": "d05a4fcdfaeb18518e9771f61f4ee13889daaa5d4a28b5cef9f467efa3cc7b06"
43+
},
44+
{
45+
"file": "plan-noncanonical.arrow",
46+
"record": "TableFunctionPlanRequest",
47+
"field": "bind_call",
48+
"field_bytes": "bind_call.bin",
49+
"field_expected": "expected.json",
50+
"sha256": "0e51cbab0be674328e800d6ad081401cc36ab5a0b682876b67716a468ec24c81"
51+
},
52+
{
53+
"file": "projection-noncanonical.arrow",
54+
"record": "TableFunctionProjectionRequest",
55+
"field": "bind_call",
56+
"field_bytes": "bind_call.bin",
57+
"field_expected": "expected.json",
58+
"sha256": "7844b4cbe15b1096a855f2aa3c81d351629619b5a22361b27c02b9a0e7f7e2f2"
59+
}
60+
],
61+
"binds": [
62+
{
63+
"file": "bind-arguments-null.arrow",
64+
"record": "BindRequest",
65+
"valid": true,
66+
"arguments": null,
67+
"arguments_location": {
68+
"ref": {
69+
"hex": "017365616c65642d6172677265662d66726f6d2d7468652d75706c6f61642d6772616e74"
70+
},
71+
"size": 624,
72+
"sha256": "44b0e88d72b1bce9172983e9932bf3e71df09d0b502ea971c024a1015dcd8746"
73+
},
74+
"fields": {
75+
"function_name": "nested_binary_fixture",
76+
"arguments": null,
77+
"function_type": "TABLE",
78+
"input_schema": null,
79+
"settings": {
80+
"hex": "ffffffffb00000001000000000000a000c000600050008000a000000000104000c00000008000800000004000800000004000000020000005000000004000000c8ffffff000001021000000020000000040000000000000007000000746872656164730008000c0008000700080000000000000140000000100014000800060007000c00000010001000000000000105100000002000000004000000000000000800000074696d657a6f6e65000000000400040004000000ffffffffc800000014000000000000000c0016000600050008000c000c0000000003040018000000180000000000000000000a0018000c00040008000a0000006c0000001000000001000000000000000000000005000000000000000000000000000000000000000000000000000000080000000000000008000000000000000300000000000000100000000000000000000000000000001000000000000000080000000000000000000000020000000100000000000000000000000000000001000000000000000000000000000000000000000300000055544300000000000400000000000000ffffffff00000000"
81+
},
82+
"secrets": null,
83+
"attach_opaque_data": {
84+
"hex": "007365616c65642d6174746163682d656e76656c6f7065ff"
85+
},
86+
"transaction_opaque_data": {
87+
"hex": "74786e2d37"
88+
},
89+
"resolved_secrets_provided": true,
90+
"at_unit": "VERSION",
91+
"at_value": "12",
92+
"copy_from": {
93+
"format": "csv",
94+
"file_path": "s3://bucket/input.csv",
95+
"expected_schema": {
96+
"hex": "ffffffffa80000001000000000000a000c000600050008000a000000000104000c00000008000800000004000800000004000000020000004c00000004000000ccffffff00000102100000001c0000000400000000000000010000006e00000008000c0008000700080000000000000140000000100014000800060007000c00000010001000000000000105100000001c00000004000000000000000400000063697479000000000400040004000000"
97+
}
98+
},
99+
"copy_to": null,
100+
"schema_path": [
101+
"main",
102+
"fixtures"
103+
],
104+
"argument_names": [
105+
"city",
106+
null,
107+
"limit"
108+
],
109+
"arguments_location": {
110+
"ref": {
111+
"hex": "017365616c65642d6172677265662d66726f6d2d7468652d75706c6f61642d6772616e74"
112+
},
113+
"size": 624,
114+
"sha256": "44b0e88d72b1bce9172983e9932bf3e71df09d0b502ea971c024a1015dcd8746"
115+
}
116+
},
117+
"sha256": "74bd9859ade48a3c77386dd89e9d6b0f1775e2335b1d4b9985995715702aeb4e"
118+
},
119+
{
120+
"file": "bind-both-null.arrow",
121+
"record": "BindRequest",
122+
"valid": false,
123+
"error_kind": "invalid_bind_request",
124+
"error_code": "INVALID_ARGUMENT",
125+
"sha256": "a289d54c500201b22def4756c70a32550ef3881d98a6cdd2247c1627b86ec209"
126+
},
127+
{
128+
"file": "bind-both-set.arrow",
129+
"record": "BindRequest",
130+
"valid": false,
131+
"error_kind": "invalid_bind_request",
132+
"error_code": "INVALID_ARGUMENT",
133+
"sha256": "08b98f511c61448420c48ebeaa5315fc9cfc5aaf1f1c5cab11919b70176d1325"
134+
}
135+
],
136+
"error_message": "BindRequest must set exactly one of 'arguments' and 'arguments_location'"
137+
}

0 commit comments

Comments
 (0)