Prove portable SQLite claim and BLOB behavior - #48
Merged
Conversation
kcsfelty
force-pushed
the
agent/search-contract-sqlite-conformance
branch
from
July 21, 2026 23:05
bb7b8a4 to
8013e2a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
UPDATE ... RETURNING: concurrent submissions produce exactly one winning claimant, and a revision-only stale probe produces zero rows/changesreadSqliteBytes()helper because Node returnsUint8Arraywhile workerd D1 returns a JSON-compatible byte array; reject sparse and malformed byte arraysEvidence
npm run check(165 tests, coverage 96.24% statements / 91.94% branches / 97.74% functions / 96.24% lines; build, bundled workerd, packed consumer, license and readiness gates pass)npm run conformance(490/490 applicable W3C SPARQL 1.1 cases)Strongest counterargument
The new helper expands the production API for what could remain an application-local conversion. The runtime evidence shows the row shapes genuinely differ, however, and leaving normalization to each consumer would undermine the shared adapter contract. The helper is deliberately only a dense, validated, copying byte conversion; it contains no domain behavior.
Production API impact
One additive root export:
readSqliteBytes(value): Uint8Array. No existing behavior or type changed.CI notes
The first W3C run passed its 490/490 summary and then failed the second EARL pass on a transient upstream manifest fetch; a fresh run is pending. The audit gate independently began failing on a newly published high-severity
sharp/libvips advisory in dev-only Miniflare/Wrangler. Latest upstream Miniflare still pins vulnerablesharp@0.34.5; this PR does not force an unsupported major override or conceal that advisory.