Repository navigation
Commit 663b940
protocol 3.4: argument references and init: StateRef; VGI leaves the call-state slot
Argument references (vgi docs/large-values-3.4.md §2, §5, §5a):
- vgi/arguments_ref.py: resolve_bind_call / resolve_request_arguments /
resolved_arguments. Every worker method that receives a bind call (bind,
projection, cardinality, plan, statistics, dynamic-to-string, init, and the
table-buffering init read back from storage) resolves
arguments_location at its entry through ctx.resolve_argument_ref (vgi-rpc
opens the sealed ref, checks size/sha256, goes through the object cache
single-flight, verifies the bytes). User code gets a bind call whose
arguments holds the resolved value (fleet workers reading
bind_call.arguments keep working) and which still serializes as the bytes
the client sent (with_resolved_arguments), so the reference, never the
value, goes back on the wire, into stream state and into table-buffering
storage. The require_arguments() stopgaps are gone; framework readers use
resolved_arguments().
- Refusals: invalid_arguments_ref and arguments_ref_integrity pass through
from vgi-rpc; arguments_ref_missing (NOT_FOUND) carries the exact message
"this prepared statement's large argument has expired; prepare it again";
invalid_bind_request is BindRequest's own (2c).
- VGI-Arguments-Ref-Bytes (default 4194304, VGI_ARGUMENTS_REF_BYTES) is sent
on every response by vgi serve and the fixture HTTP server whenever they
vend upload URLs and their storage is an ObjectStore.
- Split-token fingerprint: a location (also after resolution) contributes
0x01 || u64le(size) || sha256, never the sealed ref; inline arguments
0x00 || u64le(len) || IPC bytes (was repr()).
init: StateRef (§6):
- VgiCallState, _VgiCallStateHolder, CALL_STATE_TYPE and bind_call_state are
gone, and init() no longer passes Stream(call_state=...). Scalar,
producer and table-in-out states carry one serialized field, init: a
vgi-rpc StateRef to VgiStreamInit(init_call, init_response), created with
ctx.state_ref() in the init handler only; later turns copy it.
- rehydrate() has no call context, so it only records the worker; the turn's
entry (process / produce / exchange / on_cancel) resolves the ref with
ctx.resolve, resolves the arguments, then rebuilds the transient fields.
Pipe streams are built already resolved and never resolve per turn.
- The output schema is carried once: when the stream's output schema (in
vgi-rpc's call token) equals the init output schema, the init's copy is
left out and restored from the turn's output collector.
- The attach plaintext is still re-derived per turn from the sealed envelope;
the stale VgiCallState access-log note went with the class (vgi-rpc's
access log records state sizes only).
serve: token_ttl=21600 and cursor_rule="error" (the cursor rule is now a
hard cursor_too_large error, as the spec asks once the port is done).
Tests: tests/test_arguments_ref.py drives vgi serve against the fake vendor
the way the extension does: header and switch, a 12-turn producer and three
split streams on one referenced argument (one vendor GET each, init stays
inline), tampered / mis-sized refs, a deleted object with a cold cache (the
prepared-statement message), raw-preserving re-encode and the fingerprint.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>1 parent 779dc67 commit 663b940
20 files changed
Lines changed: 983 additions & 219 deletions
File tree
- tests
- catalog
- vgi
- _test_fixtures
- schema_reconcile
- writable
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
| 334 | + | |
| 335 | + | |
334 | 336 | | |
335 | 337 | | |
336 | 338 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
37 | | - | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
57 | | - | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
| 228 | + | |
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | | - | |
| 241 | + | |
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
100 | | - | |
| 101 | + | |
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
89 | | - | |
| 90 | + | |
90 | 91 | | |
91 | 92 | | |
92 | | - | |
| 93 | + | |
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
| |||
145 | 146 | | |
146 | 147 | | |
147 | 148 | | |
148 | | - | |
| 149 | + | |
149 | 150 | | |
150 | 151 | | |
151 | 152 | | |
| |||
0 commit comments