Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,9 @@ preflight CLI entry with a module cycle (exit 13), before publication.
Keep both signed tags immutable and retain their releases as failed attempts.
`@pegma/storage-dynamodb@0.4.5` is now a
[qualified trusted runtime](https://github.com/pegma-dev/storage-core/releases/tag/v0.4.5),
retaining exact Core `0.4.0`. D1 `0.4.6` is the unpublished candidate for optional
concurrent keyed-read batching; its default remains `readBatchSize: 1`.
retaining exact Core `0.4.0`. Published D1 `0.4.6` provides opt-in keyed-read
batching. D1 `0.4.7` is the unpublished candidate adding whole-partition reads
to that queue; its default remains `readBatchSize: 1`.
Its own review, release qualification and host Free-plan acceptance remain
separate gates. See `docs/RELEASING.md` and the D1 package README.
The port offers keyed access,
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,10 @@ and what you decode is what the last writer decided.
| `@pegma/storage-cloudflare-d1` | available; passes the same conformance run |
| `@pegma/storage-dynamodb` | available; passes the same conformance run |

Published versions are Core `0.4.0`, Azure Tables `0.4.0`, D1 `0.4.1` and the
Published versions are Core `0.4.0`, Azure Tables `0.4.0`, D1 `0.4.6` and the
[qualified DynamoDB `0.4.5` runtime](https://github.com/pegma-dev/storage-core/releases/tag/v0.4.5).
D1 `0.4.6` remains an unpublished candidate for optional concurrent keyed-read
batching, with direct reads still the default; see its
D1 `0.4.7` is the unpublished candidate for optional concurrent keyed and
whole-partition read batching, with direct reads still the default; see its
[package README](packages/storage-cloudflare-d1/README.md). This candidate does
not establish a released adapter or live Workers Free host acceptance.

Expand Down
5 changes: 3 additions & 2 deletions docs/AWS_ADAPTER.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ runtime pins it exactly. `0.4.2` is registration-only metadata under `bootstrap`
not a usable adapter release. The qualified `0.4.5` runtime completed the reviewed
signed-source and trusted-publisher flow.
Existing repository-wide tags `v0.4.0`, `v0.4.1`, failed `v0.4.3` and failed
`v0.4.4` must never be reused. The separate D1 `0.4.6` candidate remains
unpublished and requires its own review and release qualification.
`v0.4.4` must never be reused. D1 `0.4.6` is published; the separate D1
`0.4.7` mixed-read batching candidate remains unpublished and requires its own
review and release qualification.

Unprivileged validation runs the full gates on Node 22 and 24 before preparation.
Preparation depends on that validation and signed-release identity checks; it
Expand Down
22 changes: 12 additions & 10 deletions docs/RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ below is an explicit first-package exception, not a runtime release path.

## Current versions and source ownership

Core and Azure are published at `0.4.0`; D1 at `0.4.1`. DynamoDB `0.4.5` is the
Core and Azure are published at `0.4.0`; D1 at `0.4.6`. DynamoDB `0.4.5` is the
qualified trusted runtime; `0.4.2` remains published registration-only metadata.
D1 `0.4.6` is the current unpublished candidate for optional concurrent keyed-read
batching. Its release and host request-budget acceptance remain separate gates.
D1 `0.4.7` is the current unpublished candidate for optional concurrent keyed and
whole-partition read batching. Its release and host request-budget acceptance
remain separate gates.
The `v0.4.3` release attempt failed its npm-version check
before preparation: no runtime archive was produced or published. Its signed
tag remains immutable; preserve the release as a failed attempt. The `v0.4.4`
Expand All @@ -27,7 +28,7 @@ reused the original prepared artifact and made no new npm uploads. The accepted
belongs to attempt 1, whose visibility check failed; final registry cryptographic,
source and isolated public-consumer verification completed during recovery.

For D1 `0.4.6`, schema 2 selects only the new D1 source artifact and must reuse
For D1 `0.4.7`, schema 2 selects only the new D1 source artifact and must reuse
the original qualified Core `0.4.0`, Azure `0.4.0` and DynamoDB `0.4.5` registry
archives. Unselected workspace builds are not substitutes for those bytes.
The reviewed reuse policy must bind their original source and writer identities.
Expand All @@ -37,8 +38,9 @@ no Core or host upgrade is implied.

Versions are independently assigned but release tags share a repository-wide
namespace. Never reuse or move a tag/version, including failed publication or
registration versions. DynamoDB `v0.4.5` is qualified; the next D1 release is
planned as `v0.4.6` and requires its own current-head review and release gates.
registration versions. DynamoDB `v0.4.5` and D1 `v0.4.6` are qualified; the next
D1 release is planned as `v0.4.7` and requires its own current-head review and
release gates.

A release run uses the workflow at its tagged commit, as documented in
[workflow triggers](https://docs.github.com/en/actions/concepts/workflows-and-actions/workflows#workflow-triggers)
Expand Down Expand Up @@ -75,12 +77,12 @@ record; never install it for a backend/host proof or describe it as the
latest runtime. Inspect actual registry bytes/dist-tags afterward. No GitHub
v0.4.2 release is needed.

For the D1 `0.4.6` candidate, verify trusted publishing and package/account
For the D1 `0.4.7` candidate, verify trusted publishing and package/account
restrictions again. After its reviewed source passes full gates and merges,
create and verify its signed annotated `v0.4.6` tag on `origin/main`; create its
create and verify its signed annotated `v0.4.7` tag on `origin/main`; create its
GitHub release only when this configuration is complete. Do not move or reuse
the signed `v0.4.3` or `v0.4.4` tags; retain their releases as failed attempts.
Never manually publish the real `0.4.6` artifact
Never manually publish the real `0.4.7` artifact
first: immutable bytes with missing trusted
provenance cannot later be repaired by a skip. Registration `0.4.2` remains immutable
and explicitly outside runtime qualification.
Expand Down Expand Up @@ -173,7 +175,7 @@ It imports public roots, executes published Core conformance against DynamoDB
Local, and proves real StorageError/ConcurrencyError identity with Core `0.4.0`.
The fixture is local synthetic backend evidence, not a deployed AWS claim.

For D1 `0.4.6`, that generic consumer proves only a D1 import; its DynamoDB
For D1 `0.4.7`, that generic consumer proves only a D1 import; its DynamoDB
conformance run does not exercise the D1 adapter. Before merge or publication,
owner acceptance additionally requires an isolated selected D1 tarball plus
genuine canonical registry Core `0.4.0`, with no aliases, overrides or workspace
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"devDependencies": {
"@cloudflare/vitest-pool-workers": "^0.18.8",
"@cloudflare/workers-types": "^5.20260727.1",
"@pegma/storage-cloudflare-d1": "workspace:0.4.6",
"@pegma/storage-cloudflare-d1": "workspace:0.4.7",
"@types/node": "^26.1.1",
"azurite": "^3.36.0",
"prettier": "^3.9.6",
Expand Down
27 changes: 15 additions & 12 deletions packages/storage-cloudflare-d1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
Cloudflare D1 adapter for
[`@pegma/storage-core`](https://www.npmjs.com/package/@pegma/storage-core).

The published release remains `0.4.1`. This source is the unpublished `0.4.6`
candidate for optional concurrent keyed-read batching and retains exact Core
`0.4.0`. Its review, registry qualification and complete host request-budget
acceptance remain pending; source tests alone do not establish live Free usage.
Published `0.4.6` provides optional concurrent keyed-read batching. This source
targets unpublished `0.4.7`, extending that queue to whole-partition reads while
retaining exact Core `0.4.0`. Its review, registry qualification and complete host
request-budget acceptance remain pending; source tests alone do not establish
live Free usage.

It stores every collection in one D1 database and one `RECORDS` data table.
The physical partition key is `<collection>:<partition>` and the row key is
Expand Down Expand Up @@ -83,11 +84,11 @@ Replicated or session-based reads are incompatible with this adapter. Even a
session that starts on the primary may use replicas for subsequent reads, so
the adapter deliberately does not use the Sessions API.

## Optional concurrent keyed-read batching
## Optional concurrent read batching

The default `readBatchSize: 1` retains direct keyed reads. To coalesce
concurrent public `get` and `getVersioned` calls, opt in when constructing a
Store inside the request:
The default `readBatchSize: 1` retains direct keyed and partition reads. To
coalesce concurrent public `get`, `getVersioned`, `list` and `listVersioned`
calls, opt in when constructing a Store inside the request:

```ts
const store = createCloudflareD1Store({
Expand All @@ -98,15 +99,17 @@ const store = createCloudflareD1Store({

`readBatchSize` must be a safe integer from 1 through 512. This is an adapter
tuning bound, not a Cloudflare batch-size limit. Calls queued together are
sent as at most that many prepared keyed statements in one real D1 batch.
sent as at most that many prepared read statements in one real D1 batch.
There is at most one read batch in flight per Store, and a partial batch runs
without waiting for more calls. Collection handles on that Store share the
queue; separate Store instances do not. Use a request-scoped Store rather
than sharing the queue across Worker requests.

`readBatchSize` bounds each D1 batch, not the total pending read requests.
The adapter has no total pending-queue cap. Callers must bound their concurrent
read waves and the Store's lifetime within the request.
read waves and the Store's lifetime within the request. Partition lists still
return every live row: the batch bound counts statements, not result rows or
bytes. Batching does not paginate or truncate a list.

Only calls that actually reach storage concurrently can coalesce. Finish
asynchronous key preparation before starting a parallel read wave if the
Expand All @@ -115,8 +118,8 @@ There is no caching or same-key deduplication, and each caller decodes its
own value. A batch failure rejects all reads in that batch; later calls can
recover without an automatic fallback to individual requests.

Writes, internal optimistic reads, partition lists, scans and transactions
keep their existing paths. Batching does not add snapshot or read/write
Writes, internal optimistic reads, scans and transactions keep their existing
paths. Batching does not add snapshot or read/write
ordering guarantees: retain version checks and current-state fences. A new
read after an awaited write still reads the direct primary binding.

Expand Down
2 changes: 1 addition & 1 deletion packages/storage-cloudflare-d1/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pegma/storage-cloudflare-d1",
"version": "0.4.6",
"version": "0.4.7",
"description": "Cloudflare D1 adapter for @pegma/storage-core.",
"license": "MIT",
"type": "module",
Expand Down
Loading
Loading