Skip to content

v2: a declined export's payload is absent in all four bindings; batches.md's unconsumed and payload notes, measured - #620

Merged
EricAndrechek merged 2 commits into
v2from
v2-export-declined
Oct 11, 2026
Merged

EricAndrechek merged 2 commits into
v2from
v2-export-declined

Conversation

@EricAndrechek

Copy link
Copy Markdown
Member

What

When chs_preview_batch declines an asked-for export, the v2 library still returns a non-NULL, zero-length out_export buffer. Only the document's export_declined tells declined from emitted-but-empty. The documented contract says a declined export's payload is absent; Go and Python returned an empty payload instead.

  • measured on the published v2 dev build 20261011.105019, in Go and Python: a batch rejected by a CHECK, asked to export JSONCompactEachRow, gave the raw buffer len=0 (non-NULL) and a payload of length 0 (Go Payload != nil, Python b""), with export_declined set. An accepted zero-row export gave the same empty payload with export_declined empty, so the two were indistinguishable by payload.
  • inferred from the code, not run (TypeScript and Rust have no local build here): both passed the buffer through unchanged as well.

Fix (identical in all four)

The payload and spans are absent (Go nil, Python None, TypeScript undefined, Rust None) whenever the document's export_declined (or export_declined_b64) is non-empty, whatever the buffer. They are present, possibly empty, only for an export that ran. The decision never reads the buffer's length; the library buffer is freed as before.

  • Go: decode_batch.go (production path) and decode.go (decodeBatchGeneric); the equivalence reference follows.
  • Python: _decode.py. TypeScript: documents.ts. Rust: decode.rs.

Tests

A unit test per binding, fed a declined document with a zero-length (and a non-empty) buffer, expecting absence, and an accepted zero-row export expecting present-and-empty. Go also adds two declined documents to the old-versus-new decoder equivalence set. No stub-level case: the ABI stub's batch documents are fixed and none declines an export with a zero-length buffer, so that needs a new stub variant, left out of this change.

Docs

docs/guides/batches.md: the unconsumed note for a malformed UUID now states the measured answer in place of "unverified", and the payload note states that bindings and raw-ABI callers decide "declined" from export_declined. docs/reference/bindings-v1.md payload row, and each binding's CHANGELOG (### Fixed).

TypeScript and Rust run in CI only.

🤖 Generated with Claude Code

…es.md's unconsumed and payload notes, measured

The library returns a non-NULL, zero-length out_export buffer for a declined
export, so Go and Python reported a declined export as present-but-empty
(measured on build 20261011.105019). Each binding now decides from the
document's export_declined, never the buffer's length: the payload and the
spans are absent whenever export_declined is non-empty. batches.md replaces
the unverified unconsumed note with the measured answer and states the
raw-ABI rule.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@EricAndrechek
EricAndrechek merged commit f37cf40 into v2 Oct 11, 2026
54 checks passed
@EricAndrechek
EricAndrechek deleted the v2-export-declined branch October 11, 2026 16:17
EricAndrechek added a commit that referenced this pull request Oct 11, 2026
The next dev release: a declined export's payload is absent in all four
bindings, decided from export_declined (#620); the v2 spec states NULL
out_export on a declined export, the pre-init and post-shutdown refusals, and
chs_preview_row's exactly-one-row rule (#621, #622; prose, the fingerprint is
unchanged); the filter enforcement gate lifted again for 11 pairs and a
CREATE-level divergence registered (#617); a test-timing fix and failure text
in the stub census (#618). It pairs with artifact build 20261011.105019 at
fingerprint d60a681e. The same eight files as the 2.0.0-dev.7 bump.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant