From a01df0047e6abb2685f1970acaf678efec6f8ce4 Mon Sep 17 00:00:00 2001 From: Nathan Rover Date: Mon, 9 Nov 2026 09:35:51 -0500 Subject: [PATCH 1/6] Batch D1 reads within explicit per-page limits --- packages/storage-cloudflare-d1/README.md | 46 +- .../storage-cloudflare-d1/src/index.test.ts | 793 +++++++++++++++++- packages/storage-cloudflare-d1/src/index.ts | 134 ++- test/d1-public-types.ts | 5 + 4 files changed, 964 insertions(+), 14 deletions(-) diff --git a/packages/storage-cloudflare-d1/README.md b/packages/storage-cloudflare-d1/README.md index fb8cfef..9ce7893 100644 --- a/packages/storage-cloudflare-d1/README.md +++ b/packages/storage-cloudflare-d1/README.md @@ -78,6 +78,47 @@ 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 + +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: + +```ts +const store = createCloudflareD1Store({ + database: env.DB, + readBatchSize: 512, +}); +``` + +`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. +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. + +Only calls that actually reach storage concurrently can coalesce. Finish +asynchronous key preparation before starting a parallel read wave if the +caller needs predictable batching. Sequential awaited calls remain separate. +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 +ordering guarantees: retain version checks and current-state fences. A new +read after an awaited write still reads the direct primary binding. + +Cloudflare counts a `batch()` as one query against the invocation query +limit, while statement constraints and row-based usage still apply. A larger +batch reduces binding calls, not rows read or serialization work. Choose the +size for the application's bounded record sizes and concurrent callers; +512 arbitrary large records can exceed platform memory or result limits. +Measure complete request budgets, including authentication and final fences, +before relying on a Free-plan profile. See [D1 limits](https://developers.cloudflare.com/d1/platform/limits/). + ## Versions and deletes Versions are opaque strings backed by monotonically increasing SQLite integer @@ -115,8 +156,9 @@ required by `@pegma/storage-core`. A transaction carries at most 100 actions, the same limit the Azure Tables adapter enforces, so an action list either works on both adapters or is refused by both with a `StorageError`. The limit is checked before any -statement is sent. Each action costs one to three statements in the batch, and -every statement counts against the Worker invocation's D1 query budget. +statement is sent. Each action costs one to three statements in the batch. +Cloudflare counts the batch as one query against the invocation query budget; +individual statement constraints and row-based usage still apply. ## License diff --git a/packages/storage-cloudflare-d1/src/index.test.ts b/packages/storage-cloudflare-d1/src/index.test.ts index 123414a..2167857 100644 --- a/packages/storage-cloudflare-d1/src/index.test.ts +++ b/packages/storage-cloudflare-d1/src/index.test.ts @@ -1,6 +1,10 @@ import { env } from "cloudflare:workers"; import { conformanceCases } from "@pegma/storage-core/conformance"; -import { defineCollection, type CollectionStore } from "@pegma/storage-core"; +import { + defineCollection, + StorageError, + type CollectionStore, +} from "@pegma/storage-core"; import { beforeAll, beforeEach, describe, expect, it } from "vitest"; import { @@ -54,8 +58,11 @@ const widgets = defineCollection({ }, }); -function freshStore() { - return createCloudflareD1Store({ database: env.DB }); +function freshStore(readBatchSize?: number) { + return createCloudflareD1Store({ + database: env.DB, + ...(readBatchSize === undefined ? {} : { readBatchSize }), + }); } function collection(): CollectionStore { @@ -82,6 +89,125 @@ function wrappedDatabase( }; } +interface ReadBatchHooks { + readonly beforeSchemaBatch?: (call: number) => void | Promise; + readonly beforeReadBatch?: (call: number) => void | Promise; + readonly afterReadBatch?: ( + call: number, + results: CloudflareD1Result[], + ) => CloudflareD1Result[] | Promise[]>; +} + +/** Observe the real binding; faults change only its transport/result boundary. */ +function observedDatabase(hooks: ReadBatchHooks = {}) { + const originals = new WeakMap< + CloudflareD1PreparedStatement, + { statement: D1PreparedStatement; sql: string } + >(); + const readBatchSizes: number[] = []; + let preparations = 0; + let directKeyReads = 0; + let schemaBatches = 0; + let activeReadBatches = 0; + let maximumReadBatches = 0; + const keyed = (sql: string) => + sql.trimStart().startsWith("SELECT") && + sql.includes("WHERE partition_key = ? AND row_key = ?"); + const wrap = ( + original: D1PreparedStatement, + sql: string, + ): CloudflareD1PreparedStatement => { + const counted = new Proxy(original, { + get(target, property) { + if (property === "bind") + return (...values: unknown[]) => wrap(target.bind(...values), sql); + const method = Reflect.get(target, property, target); + if (property === "first" || property === "all" || property === "run") { + return (...args: unknown[]) => { + if (keyed(sql)) directKeyReads += 1; + return Reflect.apply(method, target, args); + }; + } + return typeof method === "function" ? method.bind(target) : method; + }, + }); + originals.set(counted, { statement: original, sql }); + return counted; + }; + const database: CloudflareD1Database = { + prepare(sql) { + preparations += 1; + return wrap(env.DB.prepare(sql), sql); + }, + async batch(statements: CloudflareD1PreparedStatement[]) { + const actual = statements.map((statement) => originals.get(statement)); + if (actual.some((item) => item === undefined)) + throw new Error("Unobserved prepared statement."); + const read = actual.every((item) => keyed(item!.sql)); + if (!read) { + if (actual[0]?.sql.trimStart().startsWith("CREATE")) { + schemaBatches += 1; + await hooks.beforeSchemaBatch?.(schemaBatches); + } + return env.DB.batch(actual.map((item) => item!.statement)); + } + readBatchSizes.push(statements.length); + const call = readBatchSizes.length; + activeReadBatches += 1; + maximumReadBatches = Math.max(maximumReadBatches, activeReadBatches); + try { + await hooks.beforeReadBatch?.(call); + const results = await env.DB.batch( + actual.map((item) => item!.statement), + ); + return ( + hooks.afterReadBatch === undefined + ? results + : await hooks.afterReadBatch(call, results) + ) as CloudflareD1Result[]; + } finally { + activeReadBatches -= 1; + } + }, + withSession() { + throw new Error("The adapter must use the direct primary binding."); + }, + }; + return { + database, + readBatchSizes, + preparations: () => preparations, + directKeyReads: () => directKeyReads, + schemaBatches: () => schemaBatches, + maximumReadBatches: () => maximumReadBatches, + }; +} + +function barrier() { + let release = () => {}; + const ready = new Promise((resolve) => { + release = resolve; + }); + return { ready, release }; +} + +async function bounded(promise: Promise): Promise { + let timer: ReturnType | undefined; + try { + return await Promise.race([ + promise, + new Promise((_resolve, reject) => { + timer = setTimeout( + () => reject(new Error("D1 test barrier or waiter did not settle.")), + 5_000, + ); + }), + ]); + } finally { + if (timer !== undefined) clearTimeout(timer); + } +} + beforeAll(async () => { await collection().get({ partition: "tools", id: "initialize-schema" }); }); @@ -94,13 +220,666 @@ beforeEach(async () => { }); describe("createCloudflareD1Store", () => { - for (const testCase of conformanceCases) { - it(testCase.name, async () => { - await testCase.run(freshStore); - }); + for (const readBatchSize of [undefined, 512]) { + describe( + readBatchSize === undefined + ? "default direct reads" + : "opt-in batched reads", + () => { + for (const testCase of conformanceCases) { + it(testCase.name, async () => { + await testCase.run(() => freshStore(readBatchSize)); + }); + } + }, + ); } }); +describe("D1 opt-in keyed read batching", () => { + it.each([ + 0, + -1, + 1.5, + 513, + Number.NaN, + Number.POSITIVE_INFINITY, + Number.NEGATIVE_INFINITY, + Number.MAX_SAFE_INTEGER + 1, + "2", + null, + true, + ])( + "rejects invalid readBatchSize %s with the shared StorageError before I/O", + (readBatchSize) => { + const observed = observedDatabase(); + expect(() => + createCloudflareD1Store({ + database: observed.database, + readBatchSize: readBatchSize as number, + }), + ).toThrow(StorageError); + expect(observed.preparations()).toBe(0); + expect(observed.schemaBatches()).toBe(0); + expect(observed.readBatchSizes).toEqual([]); + }, + ); + + it.each([undefined, 1])( + "retains the direct first path for readBatchSize %s", + async (readBatchSize) => { + await collection().put(widget("direct")); + const observed = observedDatabase(); + const records = createCloudflareD1Store({ + database: observed.database, + createSchemaIfMissing: false, + ...(readBatchSize === undefined ? {} : { readBatchSize }), + }).collection(widgets); + expect( + await Promise.all([ + records.get({ partition: "tools", id: "direct" }), + records.getVersioned({ partition: "tools", id: "direct" }), + records.get({ partition: "tools", id: "absent" }), + ]), + ).toEqual([ + widget("direct"), + { value: widget("direct"), version: "1" }, + null, + ]); + expect(observed.directKeyReads()).toBe(3); + expect(observed.readBatchSizes).toEqual([]); + expect(observed.schemaBatches()).toBe(0); + }, + ); + + it("aligns mixed reads across collections, missing rows, tombstones and exact 64-bit versions", async () => { + const otherWidgets = { ...widgets, name: "d1_batched_other_widgets" }; + const seed = freshStore(); + await seed.collection(widgets).put(widget("same", "first collection")); + await seed.collection(widgets).put(widget("second")); + await seed.collection(widgets).put(widget("removed")); + await seed + .collection(widgets) + .delete({ partition: "tools", id: "removed" }); + await seed.collection(otherWidgets).put(widget("same", "other collection")); + await env.DB.prepare( + "UPDATE RECORDS SET version = ? WHERE partition_key = ? AND row_key = ?", + ) + .bind("9007199254740993", "d1_targeted_widgets:tools", "same") + .run(); + const observed = observedDatabase(); + const store = createCloudflareD1Store({ + database: observed.database, + createSchemaIfMissing: false, + readBatchSize: 3, + }); + const records = store.collection(widgets); + const others = store.collection(otherWidgets); + expect( + await bounded( + Promise.all([ + records.get({ partition: "tools", id: "same" }), + others.getVersioned({ partition: "tools", id: "same" }), + records.getVersioned({ partition: "tools", id: "absent" }), + records.getVersioned({ partition: "tools", id: "removed" }), + records.get({ partition: "tools", id: "second" }), + others.get({ partition: "tools", id: "absent" }), + records.getVersioned({ partition: "tools", id: "same" }), + records.get({ partition: "tools", id: "same" }), + ]), + ), + ).toEqual([ + widget("same", "first collection"), + { value: widget("same", "other collection"), version: "1" }, + null, + null, + widget("second"), + null, + { + value: widget("same", "first collection"), + version: "9007199254740993", + }, + widget("same", "first collection"), + ]); + expect(observed.readBatchSizes).toEqual([3, 3, 2]); + expect(observed.directKeyReads()).toBe(0); + expect(observed.maximumReadBatches()).toBe(1); + }); + + it("bounds an actual 1,025-read wave to 512, 512 and one statement", async () => { + const observed = observedDatabase(); + const records = createCloudflareD1Store({ + database: observed.database, + createSchemaIfMissing: false, + readBatchSize: 512, + }).collection(widgets); + const values = await bounded( + Promise.all( + Array.from({ length: 1_025 }, (_, index) => + index % 2 === 0 + ? records.get({ partition: "tools", id: `missing-${index}` }) + : records.getVersioned({ + partition: "tools", + id: `missing-${index}`, + }), + ), + ), + ); + expect(values).toEqual(Array.from({ length: 1_025 }, () => null)); + expect(observed.readBatchSizes).toEqual([512, 512, 1]); + expect(observed.maximumReadBatches()).toBe(1); + expect(observed.directKeyReads()).toBe(0); + }); + + it("keeps one read batch in flight as more calls arrive", async () => { + const entered = barrier(); + const release = barrier(); + const observed = observedDatabase({ + beforeReadBatch: async (call) => { + if (call === 1) { + entered.release(); + await release.ready; + } + }, + }); + const records = createCloudflareD1Store({ + database: observed.database, + createSchemaIfMissing: false, + readBatchSize: 2, + }).collection(widgets); + const initial = Promise.all( + Array.from({ length: 5 }, (_, index) => + records.get({ partition: "tools", id: `initial-${index}` }), + ), + ); + let later: Promise<(Widget | null)[]> | undefined; + try { + await bounded( + Promise.race([ + entered.ready, + initial.then(() => { + throw new Error("Reads completed before the batch barrier."); + }), + ]), + ); + later = Promise.all( + Array.from({ length: 3 }, (_, index) => + records.get({ partition: "tools", id: `later-${index}` }), + ), + ); + await Promise.resolve(); + await Promise.resolve(); + expect(observed.readBatchSizes).toEqual([2]); + expect(observed.maximumReadBatches()).toBe(1); + } finally { + release.release(); + await bounded(Promise.all([initial, later])); + } + expect(observed.readBatchSizes).toEqual([2, 2, 2, 2]); + expect(observed.maximumReadBatches()).toBe(1); + }); + + it("isolates queues between Stores sharing the same real binding", async () => { + await collection().put(widget("separate")); + const entered = barrier(); + const release = barrier(); + const observed = observedDatabase({ + beforeReadBatch: async (call) => { + if (call === 1) { + entered.release(); + await release.ready; + } + }, + }); + const options = { + database: observed.database, + createSchemaIfMissing: false, + readBatchSize: 4, + }; + const first = createCloudflareD1Store(options) + .collection(widgets) + .get({ partition: "tools", id: "separate" }); + try { + await bounded( + Promise.race([ + entered.ready, + first.then(() => { + throw new Error("Read completed before the Store barrier."); + }), + ]), + ); + expect( + await bounded( + createCloudflareD1Store(options) + .collection(widgets) + .get({ partition: "tools", id: "separate" }), + ), + ).toEqual(widget("separate")); + expect(observed.readBatchSizes).toEqual([1, 1]); + expect(observed.maximumReadBatches()).toBe(2); + } finally { + release.release(); + await bounded(first); + } + }); + + it("completes underfilled queues and never caches a missing, changed or recreated row", async () => { + const observed = observedDatabase(); + const records = createCloudflareD1Store({ + database: observed.database, + createSchemaIfMissing: false, + readBatchSize: 512, + }).collection(widgets); + const key = { partition: "tools", id: "fresh" }; + expect(await bounded(records.get(key))).toBeNull(); + await records.put(widget("fresh", "written")); + const first = await bounded(records.getVersioned(key)); + expect(first?.value).toEqual(widget("fresh", "written")); + await records.put(widget("fresh", "changed")); + expect(await bounded(records.get(key))).toEqual(widget("fresh", "changed")); + expect(await records.delete(key)).toBe(true); + expect(await bounded(records.get(key))).toBeNull(); + await records.put(widget("fresh", "recreated")); + const recreated = await bounded(records.getVersioned(key)); + expect(recreated?.value).toEqual(widget("fresh", "recreated")); + expect(recreated?.version).not.toBe(first?.version); + expect( + await records.putIfUnchanged(widget("fresh", "stale"), first!.version), + ).toBe(false); + expect(await records.deleteIfUnchanged(key, first!.version)).toBe(false); + expect(await bounded(records.get(key))).toEqual( + widget("fresh", "recreated"), + ); + expect(observed.readBatchSizes).toEqual([1, 1, 1, 1, 1, 1]); + }); + + it("copies each caller's physical key before asynchronous admission", async () => { + await collection().put(widget("original")); + await collection().put(widget("other")); + const observed = observedDatabase(); + const records = createCloudflareD1Store({ + database: observed.database, + createSchemaIfMissing: false, + readBatchSize: 4, + }).collection(widgets); + const firstKey = { partition: "tools", id: "original" }; + const secondKey = { partition: "tools", id: "other" }; + const first = records.get(firstKey); + const second = records.getVersioned(secondKey); + firstKey.id = "other"; + secondKey.partition = "changed-after-call"; + secondKey.id = "missing"; + expect(await bounded(Promise.all([first, second]))).toEqual([ + widget("original"), + { value: widget("other"), version: "1" }, + ]); + expect(observed.readBatchSizes).toEqual([2]); + }); + + it("does not serialize writes, transactions or internal update reads behind a paused public read", async () => { + await collection().put(widget("concurrent", "before")); + const entered = barrier(); + const release = barrier(); + const observed = observedDatabase({ + beforeReadBatch: async (call) => { + if (call === 1) { + entered.release(); + await release.ready; + } + }, + }); + const records = createCloudflareD1Store({ + database: observed.database, + createSchemaIfMissing: false, + readBatchSize: 4, + }).collection(widgets); + const reading = records.get({ partition: "tools", id: "concurrent" }); + try { + await bounded( + Promise.race([ + entered.ready, + reading.then(() => { + throw new Error("Read completed before the write barrier."); + }), + ]), + ); + await bounded(records.put(widget("concurrent", "put"))); + expect( + await bounded( + records.transact("tools", [ + { action: "put", value: widget("transaction", "committed") }, + ]), + ), + ).toEqual({ committed: true }); + expect( + await bounded( + records.update( + { partition: "tools", id: "concurrent" }, + (current) => ({ + action: "write", + value: widget("concurrent", `${current!.label}-updated`), + }), + ), + ), + ).toMatchObject({ + written: true, + attempts: 1, + value: widget("concurrent", "put-updated"), + }); + expect(observed.directKeyReads()).toBe(1); + expect(observed.readBatchSizes).toEqual([1]); + expect( + await collection().get({ partition: "tools", id: "transaction" }), + ).toEqual(widget("transaction", "committed")); + } finally { + release.release(); + await bounded(reading); + } + expect(await reading).toEqual(widget("concurrent", "put-updated")); + }); + + it.each(["codec", "json"] as const)( + "decodes duplicate reads independently and confines a %s failure to its own caller", + async (fault) => { + await collection().put(widget("duplicate")); + interface MutableWidget { + group: string; + id: string; + label: string; + } + const mutable = defineCollection({ + ...widgets, + codec: { + encode: (value) => ({ ...value }), + decode: (value) => value as unknown as MutableWidget, + }, + }); + const broken = { + ...mutable, + codec: { + ...mutable.codec, + decode: ( + value: Parameters[0], + ): MutableWidget => { + if (fault === "codec") + throw new Error("Synthetic decoder failure."); + return mutable.codec.decode(value); + }, + }, + }; + const observed = observedDatabase({ + afterReadBatch: (call, results) => { + if (fault !== "json" || call !== 1) return results; + // Keep the backend row shape valid, but corrupt only one caller's JSON. + return results.map((result, index) => + index !== 0 + ? result + : { + ...result, + results: [ + { + ...(result.results[0] as Record), + record_json: "{", + }, + ], + }, + ); + }, + }); + const store = createCloudflareD1Store({ + database: observed.database, + createSchemaIfMissing: false, + readBatchSize: 8, + }); + const records = store.collection(mutable); + const key = { partition: "tools", id: "duplicate" }; + const [failure, first, versioned, second] = await bounded( + Promise.allSettled([ + store.collection(broken).get(key), + records.get(key), + records.getVersioned(key), + records.get(key), + ] as const), + ); + expect(failure.status).toBe("rejected"); + if (failure.status === "rejected") { + if (fault === "codec") + expect(failure.reason).toEqual( + new Error("Synthetic decoder failure."), + ); + else expect(failure.reason).toBeInstanceOf(SyntaxError); + } + if ( + first.status !== "fulfilled" || + versioned.status !== "fulfilled" || + second.status !== "fulfilled" || + first.value === null || + versioned.value === null || + second.value === null + ) + throw new Error("Independent readers did not settle successfully."); + expect(first.value).not.toBe(second.value); + expect(first.value).not.toBe(versioned.value.value); + first.value.label = "caller mutation"; + expect(second.value).toEqual(widget("duplicate")); + expect(versioned.value).toEqual({ + value: widget("duplicate"), + version: "1", + }); + expect(observed.readBatchSizes).toEqual([4]); + expect(await bounded(records.get(key))).toEqual(widget("duplicate")); + }, + ); + + it("settles a rejected real read batch, drains later queued chunks and recovers without fallback calls", async () => { + await collection().put(widget("available")); + const observed = observedDatabase({ + afterReadBatch: (call, results) => { + if (call === 1) throw new Error("Synthetic read transport failure."); + return results; + }, + }); + const records = createCloudflareD1Store({ + database: observed.database, + createSchemaIfMissing: false, + readBatchSize: 2, + }).collection(widgets); + const results = await bounded( + Promise.allSettled( + Array.from({ length: 5 }, () => + records.get({ partition: "tools", id: "available" }), + ), + ), + ); + expect(results.map((result) => result.status)).toEqual([ + "rejected", + "rejected", + "fulfilled", + "fulfilled", + "fulfilled", + ]); + for (const result of results.slice(0, 2)) + if (result.status === "rejected") + expect(result.reason).toEqual( + new Error("Synthetic read transport failure."), + ); + for (const result of results.slice(2)) + if (result.status === "fulfilled") + expect(result.value).toEqual(widget("available")); + expect( + await bounded(records.get({ partition: "tools", id: "available" })), + ).toEqual(widget("available")); + expect(observed.readBatchSizes).toEqual([2, 2, 1, 1]); + expect(observed.directKeyReads()).toBe(0); + expect(observed.maximumReadBatches()).toBe(1); + }); + + it.each([ + "short", + "extra", + "sparse", + "null-slot", + "rows-not-array", + "extra-row", + "null-row", + "empty-version", + "numeric-version", + "invalid-deleted", + "invalid-json-field", + ] as const)( + "rejects %s results from the real backend rather than treating them as missing records", + async (fault) => { + await collection().put(widget("shape")); + const observed = observedDatabase({ + afterReadBatch: (call, results) => { + if (call !== 1) return results; + if (fault === "short") return results.slice(1); + if (fault === "extra") return [...results, results[0]!]; + if (fault === "sparse") + return new Array>(results.length); + return results.map((result) => { + if (fault === "null-slot") return null; + if (fault === "rows-not-array") return { ...result, results: null }; + if (fault === "extra-row") + return { + ...result, + results: [...result.results, result.results[0]], + }; + if (fault === "null-row") return { ...result, results: [null] }; + const row = result.results[0] as Record; + const fields = + fault === "empty-version" + ? { version: "" } + : fault === "numeric-version" + ? { version: 1 } + : fault === "invalid-deleted" + ? { deleted: 2 } + : { record_json: 7 }; + return { ...result, results: [{ ...row, ...fields }] }; + }) as CloudflareD1Result[]; + }, + }); + const records = createCloudflareD1Store({ + database: observed.database, + createSchemaIfMissing: false, + readBatchSize: 4, + }).collection(widgets); + const results = await bounded( + Promise.allSettled([ + records.get({ partition: "tools", id: "shape" }), + records.getVersioned({ partition: "tools", id: "shape" }), + ]), + ); + expect(results.map((result) => result.status)).toEqual([ + "rejected", + "rejected", + ]); + for (const result of results) + if (result.status === "rejected") + expect(result.reason).toBeInstanceOf(StorageError); + expect( + await bounded(records.get({ partition: "tools", id: "shape" })), + ).toEqual(widget("shape")); + expect(observed.readBatchSizes).toEqual([2, 1]); + expect(observed.directKeyReads()).toBe(0); + }, + ); + + it("settles every concurrent reader after a schema failure and retries real initialization before recovery", async () => { + await collection().put(widget("schema-ready")); + const observed = observedDatabase({ + beforeSchemaBatch: (call) => { + if (call === 1) throw new Error("Synthetic schema outage."); + }, + }); + const records = createCloudflareD1Store({ + database: observed.database, + readBatchSize: 4, + }).collection(widgets); + const failed = await bounded( + Promise.allSettled([ + records.get({ partition: "tools", id: "schema-ready" }), + records.getVersioned({ partition: "tools", id: "schema-ready" }), + ]), + ); + expect(failed.map((result) => result.status)).toEqual([ + "rejected", + "rejected", + ]); + for (const result of failed) + if (result.status === "rejected") + expect(result.reason).toEqual(new Error("Synthetic schema outage.")); + expect(observed.schemaBatches()).toBe(1); + expect(observed.readBatchSizes).toEqual([]); + expect( + await bounded( + Promise.all([ + records.get({ partition: "tools", id: "schema-ready" }), + records.getVersioned({ partition: "tools", id: "schema-ready" }), + ]), + ), + ).toEqual([ + widget("schema-ready"), + { value: widget("schema-ready"), version: "1" }, + ]); + expect(observed.schemaBatches()).toBe(2); + expect(observed.readBatchSizes).toEqual([2]); + }); + + it("keeps update retry reads and insert-conflict fallback reads direct with batching enabled", async () => { + const observed = observedDatabase(); + const records = createCloudflareD1Store({ + database: observed.database, + createSchemaIfMissing: false, + readBatchSize: 4, + }).collection(widgets); + const entered = barrier(); + const release = barrier(); + const key = { partition: "tools", id: "batched-aba" }; + let attempts = 0; + const updating = records.update(key, async (current) => { + attempts += 1; + expect(current).toBeNull(); + if (attempts === 1) { + entered.release(); + await release.ready; + } + return { action: "write", value: widget("batched-aba", "updated") }; + }); + try { + await bounded( + Promise.race([ + entered.ready, + updating.then(() => { + throw new Error("Update completed before its real OCC barrier."); + }), + ]), + ); + await collection().put(widget("batched-aba", "intervening")); + await collection().delete(key); + } finally { + release.release(); + await bounded(updating); + } + expect(await updating).toMatchObject({ + written: true, + attempts: 2, + value: widget("batched-aba", "updated"), + }); + expect(observed.directKeyReads()).toBe(2); + expect(observed.readBatchSizes).toEqual([]); + expect( + await records.insertIfAbsent(widget("batched-aba", "refused")), + ).toEqual({ inserted: false, value: widget("batched-aba", "updated") }); + expect(observed.directKeyReads()).toBe(3); + expect(observed.readBatchSizes).toEqual([]); + expect(await bounded(records.get(key))).toEqual( + widget("batched-aba", "updated"), + ); + expect(observed.readBatchSizes).toEqual([1]); + }); +}); + describe("D1 schema initialization", () => { it("is shared by stores over the same direct binding", async () => { let schemaBatches = 0; diff --git a/packages/storage-cloudflare-d1/src/index.ts b/packages/storage-cloudflare-d1/src/index.ts index 2243aa4..7f086b6 100644 --- a/packages/storage-cloudflare-d1/src/index.ts +++ b/packages/storage-cloudflare-d1/src/index.ts @@ -29,9 +29,9 @@ const D1_ERROR_PREFIX = "D1_ERROR: "; * Largest transaction this adapter submits, matching the Azure adapter's * entity-group limit so the same action list is accepted or refused by both. * - * D1 documents no batch statement count, but every statement inside a batch - * counts against the Worker invocation's D1 query budget, and a guarded action - * costs up to three. Rejecting an oversized list here keeps the failure a + * D1 counts a batch as one query against the invocation budget, while each + * guarded action costs up to three statements. Rejecting an oversized list + * here preserves the Azure adapter's action bound and keeps the failure a * `StorageError` naming the cause rather than an opaque backend error. */ const MAX_TRANSACTION_ACTIONS = 100; @@ -306,6 +306,56 @@ export interface CloudflareD1StoreOptions { * application's binding should not run DDL. */ readonly createSchemaIfMissing?: boolean; + + /** + * Coalesce concurrent public get/getVersioned calls into read-only batches. + * Defaults to 1, retaining direct keyed reads. Must be an integer from 1 + * through 512. Larger values suit bounded small records, not arbitrary rows. + * + * Opt-in queues belong to this Store instance: construct it per request. + * No values are cached, and writes/internal optimistic reads are unchanged. + */ + readonly readBatchSize?: number; +} + +interface PendingRead { + readonly partition: string; + readonly id: string; + readonly resolve: (row: PhysicalRow | null) => void; + readonly reject: (reason: unknown) => void; +} + +function batchRows( + results: CloudflareD1Result[], + expected: number, +): (PhysicalRow | null)[] { + if (!Array.isArray(results) || results.length !== expected) { + throw new StorageError("D1 returned an invalid keyed-read batch."); + } + return Array.from(results, (result) => { + if ( + result === null || + typeof result !== "object" || + !Array.isArray(result.results) || + result.results.length > 1 + ) { + throw new StorageError("D1 returned an invalid keyed-read result."); + } + if (result.results.length === 0) return null; + const row = result.results[0]; + if ( + row === undefined || + row === null || + typeof row !== "object" || + typeof row.version !== "string" || + row.version.length === 0 || + (row.deleted !== 0 && row.deleted !== 1) || + (row.record_json !== null && typeof row.record_json !== "string") + ) { + throw new StorageError("D1 returned an invalid keyed-read row."); + } + return row; + }); } function parseRecord(json: string): StoredRecord { @@ -421,6 +471,20 @@ export function createCloudflareD1Store( ): Store { const { database } = options; const createSchemaIfMissing = options.createSchemaIfMissing ?? true; + const readBatchSize = + options.readBatchSize === undefined ? 1 : options.readBatchSize; + if ( + !Number.isSafeInteger(readBatchSize) || + readBatchSize < 1 || + readBatchSize > 512 + ) { + throw new StorageError( + "Read batch size must be an integer from 1 through 512.", + ); + } + const pendingReads: PendingRead[] = []; + let readBatchScheduled = false; + let readBatchRunning = false; function ensureSchema(): Promise { if (!createSchemaIfMissing) { @@ -459,6 +523,56 @@ export function createCloudflareD1Store( return pending; } + function scheduleReadBatch(): void { + if (readBatchScheduled || readBatchRunning || pendingReads.length === 0) { + return; + } + readBatchScheduled = true; + queueMicrotask(() => { + readBatchScheduled = false; + // Every batch failure settles its callers below. Their read promises + // retain the work; there is no detached timer or background cache. + void drainReadBatches(); + }); + } + + async function drainReadBatches(): Promise { + if (readBatchRunning) return; + readBatchRunning = true; + try { + while (pendingReads.length > 0) { + const jobs = pendingReads.splice(0, readBatchSize); + try { + const results = await database.batch( + jobs.map((job) => + database.prepare(SELECT_ONE).bind(job.partition, job.id), + ), + ); + const rows = batchRows(results, jobs.length); + for (const [index, job] of jobs.entries()) { + job.resolve(rows[index]!); + } + } catch (error) { + for (const job of jobs) job.reject(error); + } + } + } finally { + readBatchRunning = false; + scheduleReadBatch(); + } + } + + async function queuedRead( + partition: string, + id: string, + ): Promise { + await ensureSchema(); + return new Promise((resolve, reject) => { + pendingReads.push({ partition, id, resolve, reject }); + scheduleReadBatch(); + }); + } + return { collection(definition: CollectionDefinition): CollectionStore { const { codec, name } = definition; @@ -491,6 +605,16 @@ export function createCloudflareD1Store( : { record_json: row.record_json, version: row.version }; } + async function readForGet(key: EntityKey): Promise { + const row = + readBatchSize === 1 + ? await readPhysical(key) + : await queuedRead(partitionKey(key.partition), key.id); + return row === null || row.deleted === 1 || row.record_json === null + ? null + : { record_json: row.record_json, version: row.version }; + } + function decodeRow(row: RecordRow): VersionedRecord { return { value: codec.decode(parseRecord(row.record_json)), @@ -528,14 +652,14 @@ export function createCloudflareD1Store( return { async get(key) { - const row = await read(key); + const row = await readForGet(key); return row === null ? null : codec.decode(parseRecord(row.record_json)); }, async getVersioned(key) { - const row = await read(key); + const row = await readForGet(key); return row === null ? null : decodeRow(row); }, diff --git a/test/d1-public-types.ts b/test/d1-public-types.ts index 43b4016..c409520 100644 --- a/test/d1-public-types.ts +++ b/test/d1-public-types.ts @@ -7,6 +7,11 @@ declare const directBinding: CloudflareD1Database; declare const session: Omit; createCloudflareD1Store({ database: directBinding }); +createCloudflareD1Store({ database: directBinding, readBatchSize: 512 }); + +// The provider option is numeric; bounds are checked before runtime I/O. +// @ts-expect-error Read batch size is not a string option. +createCloudflareD1Store({ database: directBinding, readBatchSize: "512" }); // A session must not be accepted accidentally: it may read from replicas. // @ts-expect-error A D1 session has no withSession discriminator. From d4695f740038ef8edf1ed67b96e8ec43677381a1 Mon Sep 17 00:00:00 2001 From: Nathan Rover Date: Mon, 9 Nov 2026 13:57:48 -0500 Subject: [PATCH 2/6] [host01] Isolate historical release fixtures for D1 reuse --- ...e-reuse-policy-historical-three-entry.json | 54 ++++ tests/release-packages.test.ts | 17 +- tests/release-registry.test.ts | 237 +++++++++++++----- 3 files changed, 246 insertions(+), 62 deletions(-) create mode 100644 tests/fixtures/release-reuse-policy-historical-three-entry.json diff --git a/tests/fixtures/release-reuse-policy-historical-three-entry.json b/tests/fixtures/release-reuse-policy-historical-three-entry.json new file mode 100644 index 0000000..84fa450 --- /dev/null +++ b/tests/fixtures/release-reuse-policy-historical-three-entry.json @@ -0,0 +1,54 @@ +{ + "schemaVersion": 1, + "repository": "pegma-dev/storage-core", + "repositoryId": "1312519623", + "ownerId": "309286193", + "builder": "https://github.com/actions/runner/github-hosted", + "packages": [ + { + "name": "@pegma/storage-core", + "version": "0.4.0", + "directory": "storage-core", + "tarballUrl": "https://registry.npmjs.org/@pegma/storage-core/-/storage-core-0.4.0.tgz", + "size": 24625, + "sha256": "8fe21519d16f3c94f43c9477714ea08afa9b72fb4a2f0bf0b4c1b1905096a8cf", + "integrity": "sha512-aWbRhhis4Qs4TvH1Sb+OCI0a0ddOyV+6pm6HhPs+XPlaP86mTaV7OlwkIIPqk5Hw45t//tNaqfaggUeOc7rIGA==", + "shasum": "ba65320d15291c1093b320fbc9ae6a70c04913fb", + "sourceCommit": "647702464ec60ee688c8d16aea5922b0b1b600fc", + "sourceTag": "v0.4.0", + "workflowPath": ".github/workflows/publish.yml", + "originalRunId": 30334062325, + "originalRunAttempt": 1 + }, + { + "name": "@pegma/storage-azure-tables", + "version": "0.4.0", + "directory": "storage-azure-tables", + "tarballUrl": "https://registry.npmjs.org/@pegma/storage-azure-tables/-/storage-azure-tables-0.4.0.tgz", + "size": 10534, + "sha256": "bbe26f50cc60d2f45334bbd3d3455ffff7a541b84485123dfe8925e74be46a60", + "integrity": "sha512-cHVrLyQRf8qu2d83fgO7spPxKxAZlOOfvEi/t38S6l3SD2678khJvUMcvAHm/rAQ8BlReDWd6WSnIZuQiI3A1Q==", + "shasum": "2b7f788759274905e7d395305c2988973eaf3e81", + "sourceCommit": "647702464ec60ee688c8d16aea5922b0b1b600fc", + "sourceTag": "v0.4.0", + "workflowPath": ".github/workflows/publish.yml", + "originalRunId": 30334062325, + "originalRunAttempt": 1 + }, + { + "name": "@pegma/storage-cloudflare-d1", + "version": "0.4.1", + "directory": "storage-cloudflare-d1", + "tarballUrl": "https://registry.npmjs.org/@pegma/storage-cloudflare-d1/-/storage-cloudflare-d1-0.4.1.tgz", + "size": 11967, + "sha256": "5e354776b5260d7c0342389daaeb91856022d7375d599708219d8f43786c3301", + "integrity": "sha512-nVH+ppAWi3QwyEX8QVkPOLXNjtblO0jDnnGqCHpbZZzPvFQAVyd/1Bhxg8JdsuOD/UWGktJ26asAKzpNjRol0w==", + "shasum": "888f77cf8bd2e3cdd96904da3c3fe77989202021", + "sourceCommit": "68798f74d2f1a545a35a4e3fc3c2225543c9dcf7", + "sourceTag": "v0.4.1", + "workflowPath": ".github/workflows/publish.yml", + "originalRunId": 30504107513, + "originalRunAttempt": 1 + } + ] +} diff --git a/tests/release-packages.test.ts b/tests/release-packages.test.ts index 87fa5cd..5b92ada 100644 --- a/tests/release-packages.test.ts +++ b/tests/release-packages.test.ts @@ -593,8 +593,11 @@ async function preparedSchema2() { ); const gitCommit = run(git, ["rev-parse", "HEAD"], root); const { policy, sha256: registryPolicySha256 } = await loadReusePolicy(); + const selectedName = "@pegma/storage-dynamodb"; const packages: PreparedRecord[] = []; for (const entry of policy.packages) { + // A current reuse policy can also contain the source-selected package. + if (entry.name === selectedName) continue; const bytes = readFileSync( new URL( `./fixtures/release-registry/${entry.directory}-${entry.version}.tgz`, @@ -638,7 +641,7 @@ async function preparedSchema2() { const tarball = `pegma-storage-dynamodb-${version}.tgz`; writeFileSync(join(output, tarball), bytes); packages.push({ - name: "@pegma/storage-dynamodb", + name: selectedName, version, directory: "storage-dynamodb", tarball, @@ -840,6 +843,18 @@ describe("selected-source schema2 archives", () => { expectedManifestSha256, }); expect(actual).toEqual(f.manifest); + expect(f.manifest.packages.map(({ name }) => name)).toEqual( + RELEASE_PACKAGES.map(({ name }) => name), + ); + expect(f.manifest.registryPolicySha256).toBe( + createHash("sha256") + .update( + readFileSync( + new URL("../scripts/release-reuse-policy.json", import.meta.url), + ), + ) + .digest("hex"), + ); expect(f.manifest.packages.map(({ publish }) => publish)).toEqual([ false, false, diff --git a/tests/release-registry.test.ts b/tests/release-registry.test.ts index 2bb4e6e..72f3cb1 100644 --- a/tests/release-registry.test.ts +++ b/tests/release-registry.test.ts @@ -17,6 +17,7 @@ import { } from "node:fs"; import { tmpdir } from "node:os"; import { basename, dirname, join, relative, resolve } from "node:path"; +import { pathToFileURL } from "node:url"; import { gzipSync } from "node:zlib"; import { describe, expect, it, vi } from "vitest"; import { @@ -26,15 +27,11 @@ import { downloadRegistryArtifact, inspectReleaseTarball, isolatedVerificationEnvironment, - loadReusePolicy, - preflightRegistry, registryReuseOrigin, - runPublicConsumer, verifyProvenanceAudit, verifyPublishingJobs, verifyReusedPackages, validateReusePolicy, - verifyRegistryRelease, } from "../scripts/release-registry-verify.mjs"; import type { PreparedManifest, @@ -82,6 +79,46 @@ const digest = ( encoding: "hex" | "base64" = "hex", ) => createHash(algorithm).update(bytes).digest(encoding); +const historicalPolicyFile = new URL( + "./fixtures/release-reuse-policy-historical-three-entry.json", + import.meta.url, +); +const historicalReleases = [ + { + name: "@pegma/storage-core", + version: "0.4.0", + directory: "storage-core", + bundle: "core040-slsa.json", + }, + { + name: "@pegma/storage-azure-tables", + version: "0.4.0", + directory: "storage-azure-tables", + bundle: "azure040-slsa.json", + }, + { + name: "@pegma/storage-cloudflare-d1", + version: "0.4.1", + directory: "storage-cloudflare-d1", + bundle: "d1041-slsa.json", + }, +] as const; + +/** Retained literal policy for the genuine old archives/bundles below. Future + * live policy additions are not evidence for these historical test inputs. */ +function historicalPolicyFixture() { + const bytes = readFileSync(historicalPolicyFile); + const sha256 = digest(bytes); + expect(sha256).toBe( + "ca417c9e1db17cd80f2af1257a93fbaa27b7d73c03b3712cacbca227546744b4", + ); + const policy = validateReusePolicy(JSON.parse(bytes.toString("utf8"))); + expect( + policy.packages.map(({ name, version }) => ({ name, version })), + ).toEqual(historicalReleases.map(({ name, version }) => ({ name, version }))); + return { policy, sha256, bytes }; +} + function packageJson() { return { name: "@pegma/storage-dynamodb", @@ -190,8 +227,13 @@ interface BundleFixture { } async function provenanceFixture() { - const { policy } = await loadReusePolicy(); - const entry = policy.packages[0]!; + const { policy } = historicalPolicyFixture(); + const entry = policy.packages.find( + ({ name, version }) => + name === "@pegma/storage-core" && version === "0.4.0", + ); + if (entry === undefined) + throw new Error("Missing historical Core 0.4.0 pin."); const record = { ...entry, origin: registryReuseOrigin(entry), @@ -236,21 +278,20 @@ function changeClaim(bundle: BundleFixture, path: string[], value: unknown) { } async function historicalWriterFixture() { - const { policy } = await loadReusePolicy(); - const bundleFiles = [ - "core040-slsa.json", - "azure040-slsa.json", - "d1041-slsa.json", - ]; - const records = policy.packages.map((entry) => ({ - ...entry, - origin: registryReuseOrigin(entry), - publish: false, - tarball: `${entry.name.slice(1).replace("/", "-")}-${entry.version}.tgz`, - ...inspectReleaseTarball( - fixture(`${entry.directory}-${entry.version}.tgz`), - ), - })); + const { policy, bytes: policyBytes } = historicalPolicyFixture(); + const records = historicalReleases.map(({ name, version, directory }) => { + const entry = policy.packages.find( + (candidate) => candidate.name === name && candidate.version === version, + ); + if (entry === undefined) throw new Error("Missing historical release pin."); + return { + ...entry, + origin: registryReuseOrigin(entry), + publish: false, + tarball: `${name.slice(1).replace("/", "-")}-${version}.tgz`, + ...inspectReleaseTarball(fixture(`${directory}-${version}.tgz`)), + }; + }); // A scripted trusted npm-output boundary, NOT a claim that this test ran // ECDSA/Sigstore. Every nested signed bundle is the genuine public fixture. const audit = { @@ -262,7 +303,7 @@ async function historicalWriterFixture() { location: `node_modules/${record.name}`, registry: REGISTRY, attestationBundles: [ - JSON.parse(fixture(bundleFiles[index]!).toString("utf8")), + JSON.parse(fixture(historicalReleases[index]!.bundle).toString("utf8")), ], })), }; @@ -322,12 +363,12 @@ async function historicalWriterFixture() { ? Response.json(response) : new Response(null, { status: 404 }); }); - return { records, audit, facts, responses, fetch }; + return { records, audit, facts, responses, fetch, policyBytes }; } -describe("registry reuse source policy", () => { - it("accepts only a unique canonical inventory subset without inventing a future runtime pin", async () => { - const { policy } = await loadReusePolicy(); +describe("historical three-entry registry reuse source policy", () => { + it("accepts only a unique canonical historical inventory subset without inventing a future runtime pin", () => { + const { policy } = historicalPolicyFixture(); expect(validateReusePolicy({ ...policy, packages: [] }).packages).toEqual( [], ); @@ -360,8 +401,8 @@ describe("registry reuse source policy", () => { ).toBe(false); }); - it("pins the original literal archives and their original publishing sources", async () => { - const { policy, sha256 } = await loadReusePolicy(); + it("pins the original literal archives and their original publishing sources", () => { + const { policy, sha256 } = historicalPolicyFixture(); expect(sha256).toMatch(/^[a-f0-9]{64}$/u); expect(policy.repository).toBe("pegma-dev/storage-core"); expect( @@ -1171,6 +1212,61 @@ async function pipelineFixture() { join(root, "packages", directory, file), ); } + // This is an explicitly historical unsigned source fixture, not a future + // runtime archive. Keep its version matrix separate from the live workspace. + const versions: Record = { + ...Object.fromEntries( + historicalReleases.map(({ name, version }) => [name, version]), + ), + "@pegma/storage-dynamodb": "0.4.3", + }; + for (const directory of [ + "storage-core", + "storage-azure-tables", + "storage-cloudflare-d1", + "storage-dynamodb", + ]) { + const path = join(root, "packages", directory, "package.json"); + const metadata = JSON.parse(readFileSync(path, "utf8")); + const version = versions[metadata.name]; + if (version === undefined) throw new Error("Unexpected fixture package."); + metadata.version = version; + writeFileSync(path, JSON.stringify(metadata)); + } + const rootManifestPath = join(root, "package.json"); + const rootManifest = JSON.parse(readFileSync(rootManifestPath, "utf8")); + const previousD1 = + rootManifest.devDependencies["@pegma/storage-cloudflare-d1"]; + if (typeof previousD1 !== "string") + throw new Error("Missing fixture workspace dependency."); + rootManifest.devDependencies["@pegma/storage-cloudflare-d1"] = + "workspace:0.4.1"; + writeFileSync(rootManifestPath, JSON.stringify(rootManifest)); + const lockPath = join(root, "pnpm-lock.yaml"); + writeFileSync( + lockPath, + readFileSync(lockPath, "utf8").replaceAll( + "specifier: " + previousD1, + "specifier: workspace:0.4.1", + ), + ); + // Execute byte-identical CURRENT validators at a fixture-owned module URL. + // Their import.meta-relative policy is the retained three-entry input; no + // validation body, filesystem read, or digest is replaced by a test stub. + const scripts = join(root, "scripts"); + mkdirSync(scripts); + for (const name of ["release-packages.mjs", "release-registry-verify.mjs"]) { + const original = new URL(`../scripts/${name}`, import.meta.url); + const destination = join(scripts, name); + copyFileSync(original, destination); + expect(digest(readFileSync(destination))).toBe( + digest(readFileSync(original)), + ); + } + copyFileSync( + historicalPolicyFile, + join(scripts, "release-reuse-policy.json"), + ); const git = process.platform === "win32" ? "git.exe" : "git"; const gitRun = (args: string[]) => execFileSync(git, args, { cwd: root, encoding: "utf8" }).trim(); @@ -1488,8 +1584,27 @@ async function pipelineFixture() { }; }, }; + // Bind controlled process tools on the first load too: a native module cache + // must never preserve real npm execution for these orchestration fixtures. + const registry: typeof import("../scripts/release-registry-verify.mjs") = + await (async () => { + vi.resetModules(); + vi.doMock("node:child_process", async (importOriginal) => ({ + ...(await importOriginal()), + spawnSync: command, + })); + try { + return await import( + pathToFileURL(join(scripts, "release-registry-verify.mjs")).href + ); + } finally { + vi.doUnmock("node:child_process"); + vi.resetModules(); + } + })(); return { root, + registry, records, tarballs, historical, @@ -1650,7 +1765,10 @@ async function controlledPrepare( })); vi.stubGlobal("fetch", f.seams.fetch); try { - const { prepareRelease } = await import("../scripts/release-packages.mjs"); + const { prepareRelease }: typeof import("../scripts/release-packages.mjs") = + await import( + pathToFileURL(join(f.root, "scripts", "release-packages.mjs")).href + ); const metadata = JSON.parse( readFileSync( join(f.root, "packages", "storage-dynamodb", "package.json"), @@ -1673,9 +1791,9 @@ async function controlledPrepare( } } -/** Execute the actual workflow SEAL with the real strict manifest reader. - * The temp re-export changes only module location, never validation behavior. - * No upload action, npm audit, SDK runtime or registry qualification is claimed. */ +/** Execute the actual workflow SEAL with the byte-identical current strict + * reader and explicit historical policy copied by pipelineFixture. No upload + * action, npm audit, SDK runtime or registry qualification is claimed. */ function actualInventorySeal( f: Awaited>, prepared: { manifestPath: string; manifest: PreparedManifest }, @@ -1696,18 +1814,13 @@ function actualInventorySeal( join(directory, name), ); const scripts = join(f.root, "scripts"); - mkdirSync(scripts, { recursive: true }); - const actualReader = new URL( - "../scripts/release-packages.mjs", - import.meta.url, - ).href; + for (const name of ["release-packages.mjs", "release-registry-verify.mjs"]) + expect(digest(readFileSync(join(scripts, name)))).toBe( + digest(readFileSync(new URL(`../scripts/${name}`, import.meta.url))), + ); writeFileSync( - join(scripts, "release-packages.mjs"), - `export {verifyPreparedManifest} from ${JSON.stringify(actualReader)};\n`, - ); - copyFileSync( - new URL("../scripts/release-reuse-policy.json", import.meta.url), join(scripts, "release-reuse-policy.json"), + f.historical.policyBytes, ); change?.(directory, scripts); const workflow = readFileSync( @@ -1785,9 +1898,7 @@ async function actualInlinePublisher( "", ); expect(body).not.toMatch(/^import /mu); - const policy = readFileSync( - new URL("../scripts/release-reuse-policy.json", import.meta.url), - ); + const policy = f.historical.policyBytes; const env: NodeJS.ProcessEnv = { PATH: process.env.PATH, SYSTEMROOT: process.env.SystemRoot, @@ -1904,7 +2015,7 @@ describe("controlled real release orchestration (not release qualification)", () "-m", "fictional all-selected source", ]); - // Only future-shaped preparation is exercised. No future Core runtime or + // Only synthetic all-selected preparation is exercised. No Core runtime or // public-consumer compatibility is claimed by these unsigned archives. const prepared = await controlledPrepare(f, undefined, true); expect(prepared.manifest.packages.map(({ publish }) => publish)).toEqual([ @@ -1943,9 +2054,7 @@ describe("controlled real release orchestration (not release qualification)", () expect(sealed.outputs).toEqual({ manifest_digest: digest(readFileSync(prepared.manifestPath)), policy_digest: prepared.manifest.registryPolicySha256, - policy_base64: readFileSync( - new URL("../scripts/release-reuse-policy.json", import.meta.url), - ).toString("base64"), + policy_base64: f.historical.policyBytes.toString("base64"), reuse_required: "false", }); } finally { @@ -1961,7 +2070,7 @@ describe("controlled real release orchestration (not release qualification)", () mkdirSync(output); const eventsBefore = f.consumerEvents.length; const result = await withoutExplicitNpm(() => - runPublicConsumer(prepared.manifest, { output }, f.seams), + f.registry.runPublicConsumer(prepared.manifest, { output }, f.seams), ); expect(f.consumerEvents.slice(eventsBefore)).toEqual([ "aws-metadata", @@ -2094,7 +2203,11 @@ describe("controlled real release orchestration (not release qualification)", () const callsBefore = f.calls.length; await withoutExplicitNpm(async () => { await expect( - runPublicConsumer(prepared.manifest, { output }, f.seams), + f.registry.runPublicConsumer( + prepared.manifest, + { output }, + f.seams, + ), ).rejects.toThrow(error); }); const beforeInstall = @@ -2203,7 +2316,7 @@ describe("controlled real release orchestration (not release qualification)", () runAttempt: 2, }; const preflight = await withoutExplicitNpm(() => - preflightRegistry(prepared.manifest, options, f.seams), + f.registry.preflightRegistry(prepared.manifest, options, f.seams), ); expect(preflight.decisions).toEqual( prepared.manifest.packages.map(({ name, version, publish }) => ({ @@ -2215,7 +2328,7 @@ describe("controlled real release orchestration (not release qualification)", () const callsBefore = f.calls.length; await withoutExplicitNpm(async () => { await expect( - verifyRegistryRelease( + f.registry.verifyRegistryRelease( prepared.manifest, { ...options, output: join(f.root, "postflight-proof") }, f.seams, @@ -2240,9 +2353,7 @@ describe("controlled real release orchestration (not release qualification)", () expect(sealed.outputs).toEqual({ manifest_digest: digest(readFileSync(prepared.manifestPath)), policy_digest: prepared.manifest.registryPolicySha256, - policy_base64: readFileSync( - new URL("../scripts/release-reuse-policy.json", import.meta.url), - ).toString("base64"), + policy_base64: f.historical.policyBytes.toString("base64"), reuse_required: "true", }); for (const fault of [ @@ -2294,7 +2405,7 @@ describe("controlled real release orchestration (not release qualification)", () : fault === "source-identity" ? "prepared manifest does not match the current approved checkout" : fault === "policy-drift" - ? "Release inventory changed during sealing" + ? "registry reuse policy digest differs" : fault === "tar-bytes" ? "prepared artifact is not the original regular file" : "release output inventory does not match the package manifest", @@ -2316,7 +2427,7 @@ describe("controlled real release orchestration (not release qualification)", () const callsBefore = f.calls.length; const consumerInputsBefore = f.state.consumerDependencies.length; const result = await withoutExplicitNpm(() => - verifyRegistryRelease( + f.registry.verifyRegistryRelease( prepared.manifest, { root: f.root, @@ -2438,7 +2549,7 @@ describe("controlled real release orchestration (not release qualification)", () const callsBefore = f.calls.length; await withoutExplicitNpm(async () => { await expect( - verifyRegistryRelease( + f.registry.verifyRegistryRelease( prepared.manifest, { root: f.root, @@ -2509,7 +2620,11 @@ describe("controlled real release orchestration (not release qualification)", () const output = join(f.root, "preflight-" + fault); await withoutExplicitNpm(async () => { await expect( - preflightRegistry(prepared.manifest, { ...base, output }, f.seams), + f.registry.preflightRegistry( + prepared.manifest, + { ...base, output }, + f.seams, + ), ).rejects.toThrow(); }); expect(existsSync(join(output, "preflight.json"))).toBe(false); @@ -2526,7 +2641,7 @@ describe("controlled real release orchestration (not release qualification)", () const prepared = await controlledPrepare(f); const output = join(f.root, "publisher-preflight"); await withoutExplicitNpm(() => - preflightRegistry( + f.registry.preflightRegistry( prepared.manifest, { root: f.root, From 39a3d337b0af12ad4ed9a669317dbdb89173f94d Mon Sep 17 00:00:00 2001 From: Nathan Rover Date: Mon, 9 Nov 2026 15:11:33 -0500 Subject: [PATCH 3/6] [host01] Prepare D1 0.4.6 with qualified registry reuse --- AGENTS.md | 11 +- README.md | 7 + docs/AWS_ADAPTER.md | 19 +- docs/RELEASING.md | 53 +- package.json | 2 +- packages/storage-cloudflare-d1/README.md | 17 +- packages/storage-cloudflare-d1/package.json | 2 +- packages/storage-dynamodb/README.md | 9 +- pnpm-lock.yaml | 2 +- scripts/release-reuse-policy.json | 15 + .../dynamodb045-original-jobs.json | 836 ++++++++++++++++++ .../dynamodb045-original-run.json | 218 +++++ .../release-registry/dynamodb045-slsa.json | 73 ++ .../storage-dynamodb-0.4.5.tgz | Bin 0 -> 14618 bytes tests/release-packages.test.ts | 125 ++- tests/release-registry.test.ts | 209 +++++ 16 files changed, 1549 insertions(+), 49 deletions(-) create mode 100644 tests/fixtures/release-registry/dynamodb045-original-jobs.json create mode 100644 tests/fixtures/release-registry/dynamodb045-original-run.json create mode 100644 tests/fixtures/release-registry/dynamodb045-slsa.json create mode 100644 tests/fixtures/release-registry/storage-dynamodb-0.4.5.tgz diff --git a/AGENTS.md b/AGENTS.md index 4608265..7c9bf66 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -100,10 +100,13 @@ The `v0.4.3` attempt failed its npm-version check before preparation. The `v0.4.4` attempt completed preparation and smoke checks, then failed the 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 the unpublished first trusted -AWS runtime candidate (see `docs/AWS_ADAPTER.md` and `docs/RELEASING.md`). -The later D1 feature is planned as `0.4.6`. Do not claim runtime release before -its actual registry qualification. The port offers keyed access, +`@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`. +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, optimistic concurrency through `update`, version-conditional `putIfUnchanged` and `deleteIfUnchanged`, partition reads, bounded authoritative cross-partition scans, and `transact`. diff --git a/README.md b/README.md index 0d942ab..eaf08cf 100644 --- a/README.md +++ b/README.md @@ -219,6 +219,13 @@ 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 +[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 +[package README](packages/storage-cloudflare-d1/README.md). This candidate does +not establish a released adapter or live Workers Free host acceptance. + The in-memory store is not only for tests. It enforces the same concurrency rules as a real backend, so an assembled application runs correctly before anyone has configured a database. diff --git a/docs/AWS_ADAPTER.md b/docs/AWS_ADAPTER.md index 6a29896..4a415b9 100644 --- a/docs/AWS_ADAPTER.md +++ b/docs/AWS_ADAPTER.md @@ -4,15 +4,16 @@ The runtime adapter is implemented in this repository. It qualifies when every conformance case passes against **Amazon DynamoDB Local** and the release gates -are satisfied. `@pegma/storage-dynamodb@0.4.5` is the unpublished first trusted -runtime candidate. Version `0.4.2` was published as a separately reviewed, +are satisfied. [`@pegma/storage-dynamodb@0.4.5`](https://github.com/pegma-dev/storage-core/releases/tag/v0.4.5) +is now the qualified first trusted runtime. Version `0.4.2` was published as a separately reviewed, metadata-only registration archive: it contains no runtime, exports, scripts or dependencies, is not an SDK, and must never be a host input. The `v0.4.3` release attempt failed its npm-version check before preparation, producing no runtime archive. The `v0.4.4` attempt completed preparation and smoke checks, then failed the preflight CLI entry with a module cycle (exit 13). Neither published a runtime. Keep both signed tags immutable and retain the failed releases. -Runtime qualification remains pending. +The later `0.4.5` runtime completed registry and public-consumer qualification; +actual host adoption remains a separate acceptance step. Decided 2026-09-11. This is the assignment record for Storage Core's third real adapter — read `AGENTS.md` first; its hard rules govern everything here. @@ -81,12 +82,12 @@ Node 22 + 24. ## Versioning and publish The port is unchanged, so `@pegma/storage-core` stays at `0.4.0` and the runtime -candidate pins it exactly. `0.4.2` is registration-only metadata under `bootstrap`, -not a usable adapter release. The first trusted runtime candidate is `0.4.5`; -its publication requires the reviewed signed-source and trusted-publisher flow. +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 later D1 feature is planned as `0.4.6`, after -its own review. +`v0.4.4` must never be reused. The separate D1 `0.4.6` 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 @@ -94,7 +95,7 @@ packs only selected source packages and retains the independently pinned exact original registry archives for unselected packages. Only the minimal publish job receives OIDC authority. See [RELEASING.md](RELEASING.md) for the separate registration exception and runtime release procedure. Published metadata -registration does not qualify a runtime, which remains unpublished. +registration alone does not qualify a runtime. ## What it unblocks diff --git a/docs/RELEASING.md b/docs/RELEASING.md index 7c1ff42..2b15625 100644 --- a/docs/RELEASING.md +++ b/docs/RELEASING.md @@ -7,28 +7,38 @@ 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.2` is -published registration-only metadata, and `0.4.5` is the unpublished first trusted -runtime candidate. The `v0.4.3` release attempt failed its npm-version check +Core and Azure are published at `0.4.0`; D1 at `0.4.1`. 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. +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` attempt completed preparation and smoke checks, then its direct preflight CLI failed with a top-level-await module-entry cycle (exit 13), before publication. Retain that signed tag, prepared artifacts and failed release as well. -Registration is not adapter code, conformance -evidence or a production dependency; runtime qualification remains pending. - -Unversioned Core/Azure/D1 changes in current source are **not** the code published -at those versions. Schema 2 deliberately selects source artifacts by the new tag -version and reuses original registry archives for the others. It never rebuilds -those old versions or labels their old provenance as the new source. Hosts retain +Registration is not adapter code, conformance evidence or a production dependency. + +The [qualified DynamoDB `0.4.5` release](https://github.com/pegma-dev/storage-core/releases/tag/v0.4.5) +binds signed source +[`a5a5d0bfe6355df89c049fcec3148845c5124735`](https://github.com/pegma-dev/storage-core/commit/a5a5d0bfe6355df89c049fcec3148845c5124735). +[Recovery attempt 2](https://github.com/pegma-dev/storage-core/actions/runs/42679292292/attempts/2) +reused the original prepared artifact and made no new npm uploads. The accepted write +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 +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. +Never label historical provenance as the new D1 source. Hosts retain the genuine Core `0.4.0` runtime, including StorageError/ConcurrencyError identity; 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. First trusted DynamoDB is now planned as `v0.4.5`; the -separate later D1 feature is planned as `0.4.6`, after rebase and its own review. +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. 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) @@ -65,12 +75,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. -Verify trusted publishing and package/account restrictions again for the fresh -runtime candidate. After the corrected source passes full gates and merges, -create and verify its signed annotated `v0.4.5` tag on `origin/main`; create its +For the D1 `0.4.6` 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 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.5` artifact +Never manually publish the real `0.4.6` 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. @@ -163,6 +173,17 @@ 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 +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 +resolution. Copy the existing full D1 suite, changing only its adapter import to +the bare package, and run all 141 cases against real Miniflare plus the +[public type fixture](../test/d1-public-types.ts) on Node 22 and 24 using the +[D1 test configuration](../vitest.d1.config.ts). Retain the lockfile, archive and +suite hashes, and constructor-resolution evidence. This packed proof remains +pending; source-suite passes do not satisfy it or establish live Free acceptance. + ## Preflight and minimal publish A separate unprivileged whole-set preflight verifies exact canonical registry diff --git a/package.json b/package.json index 6506c52..6d825d5 100644 --- a/package.json +++ b/package.json @@ -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.1", + "@pegma/storage-cloudflare-d1": "workspace:0.4.6", "@types/node": "^26.1.1", "azurite": "^3.36.0", "prettier": "^3.9.6", diff --git a/packages/storage-cloudflare-d1/README.md b/packages/storage-cloudflare-d1/README.md index 9ce7893..d9b238e 100644 --- a/packages/storage-cloudflare-d1/README.md +++ b/packages/storage-cloudflare-d1/README.md @@ -3,6 +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. + It stores every collection in one D1 database and one `RECORDS` data table. The physical partition key is `:` and the row key is the record id. All values are passed through prepared statements. @@ -111,13 +116,17 @@ 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. -Cloudflare counts a `batch()` as one query against the invocation query -limit, while statement constraints and row-based usage still apply. A larger -batch reduces binding calls, not rows read or serialization work. Choose the +Cloudflare's [current D1 limits](https://developers.cloudflare.com/d1/platform/limits/) +allow 50 queries per Free Worker invocation; one `db.batch()` counts as one +query against that limit, not one per statement. The limit of 100 bound +parameters applies to each individual query, not the whole batch. The adapter's +512-statement tuning ceiling is not a Cloudflare batch-size limit. +Statement constraints and row-based usage still apply. A larger batch reduces +binding calls, not rows read or serialization work. Choose the size for the application's bounded record sizes and concurrent callers; 512 arbitrary large records can exceed platform memory or result limits. Measure complete request budgets, including authentication and final fences, -before relying on a Free-plan profile. See [D1 limits](https://developers.cloudflare.com/d1/platform/limits/). +before relying on a Free-plan profile. ## Versions and deletes diff --git a/packages/storage-cloudflare-d1/package.json b/packages/storage-cloudflare-d1/package.json index 076078f..f4ad426 100644 --- a/packages/storage-cloudflare-d1/package.json +++ b/packages/storage-cloudflare-d1/package.json @@ -1,6 +1,6 @@ { "name": "@pegma/storage-cloudflare-d1", - "version": "0.4.1", + "version": "0.4.6", "description": "Cloudflare D1 adapter for @pegma/storage-core.", "license": "MIT", "type": "module", diff --git a/packages/storage-dynamodb/README.md b/packages/storage-dynamodb/README.md index 5fbcbc5..3bccbcc 100644 --- a/packages/storage-dynamodb/README.md +++ b/packages/storage-dynamodb/README.md @@ -3,16 +3,17 @@ Amazon DynamoDB adapter for [`@pegma/storage-core`](https://www.npmjs.com/package/@pegma/storage-core). -Source `0.4.5` is the unpublished first trusted runtime candidate and pins -released Core `0.4.0`. Version `0.4.2` was published as registration-only metadata, +[`0.4.5` is the qualified trusted runtime](https://github.com/pegma-dev/storage-core/releases/tag/v0.4.5) +and pins released Core `0.4.0`. Version `0.4.2` was published as registration-only metadata, with no runtime exports/scripts/dependencies; it is not this adapter or a host dependency. The `v0.4.3` release attempt failed its npm-version check before preparation, producing no runtime archive. The `v0.4.4` attempt completed preparation and smoke checks, then failed the preflight CLI entry with a module cycle (exit 13). Neither published a runtime. Both signed tags remain immutable; retain their releases as failed attempts. -Source merge and metadata registration do not establish runtime publication, -registry provenance or host acceptance. See the +The `0.4.5` release completed exact-byte, signature/provenance, source and public +consumer verification; this does not establish a host's production acceptance. +Source merge and metadata registration alone do not qualify a runtime. See the [release policy](https://github.com/pegma-dev/storage-core/blob/main/docs/RELEASING.md). It stores every collection in one DynamoDB table. The hash key is the diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 619c640..4f31ed4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,7 +15,7 @@ importers: specifier: ^5.20260727.1 version: 5.20260727.1 '@pegma/storage-cloudflare-d1': - specifier: workspace:0.4.1 + specifier: workspace:0.4.6 version: link:packages/storage-cloudflare-d1 '@types/node': specifier: ^26.1.1 diff --git a/scripts/release-reuse-policy.json b/scripts/release-reuse-policy.json index 84fa450..7796178 100644 --- a/scripts/release-reuse-policy.json +++ b/scripts/release-reuse-policy.json @@ -49,6 +49,21 @@ "workflowPath": ".github/workflows/publish.yml", "originalRunId": 30504107513, "originalRunAttempt": 1 + }, + { + "name": "@pegma/storage-dynamodb", + "version": "0.4.5", + "directory": "storage-dynamodb", + "tarballUrl": "https://registry.npmjs.org/@pegma/storage-dynamodb/-/storage-dynamodb-0.4.5.tgz", + "size": 14618, + "sha256": "5bb9cbc12540dc5c3a805181ebf8c2de28d75c0bf0d0180eb0712d4a97ec05be", + "integrity": "sha512-+uQK88D0QRYyKxti24zwW72zJj63abIi6Wzi0jK7FKQBC5b34r1K29BJ+x5Qe2VX3xn6nQVnPbZevBhBKIWnQg==", + "shasum": "b105595d10a38c0a8b7d0f6317031ef85e9073d0", + "sourceCommit": "a5a5d0bfe6355df89c049fcec3148845c5124735", + "sourceTag": "v0.4.5", + "workflowPath": ".github/workflows/publish.yml", + "originalRunId": 42679292292, + "originalRunAttempt": 1 } ] } diff --git a/tests/fixtures/release-registry/dynamodb045-original-jobs.json b/tests/fixtures/release-registry/dynamodb045-original-jobs.json new file mode 100644 index 0000000..f2281a1 --- /dev/null +++ b/tests/fixtures/release-registry/dynamodb045-original-jobs.json @@ -0,0 +1,836 @@ +{ + "total_count": 8, + "jobs": [ + { + "id": 129369152320, + "run_id": 42679292292, + "workflow_name": "Publish", + "head_branch": "v0.4.5", + "run_url": "https://api.github.com/repos/pegma-dev/storage-core/actions/runs/42679292292", + "run_attempt": 1, + "node_id": "CR_kwDOTjt1x88AAAAeHwCbQA", + "head_sha": "a5a5d0bfe6355df89c049fcec3148845c5124735", + "url": "https://api.github.com/repos/pegma-dev/storage-core/actions/jobs/129369152320", + "html_url": "https://github.com/pegma-dev/storage-core/actions/runs/42679292292/job/129369152320", + "status": "completed", + "conclusion": "success", + "created_at": "2026-11-09T19:01:11Z", + "started_at": "2026-11-09T19:01:14Z", + "completed_at": "2026-11-09T19:01:18Z", + "name": "identity", + "steps": [ + { + "name": "Set up job", + "status": "completed", + "conclusion": "success", + "number": 1, + "started_at": "2026-11-09T19:01:14Z", + "completed_at": "2026-11-09T19:01:15Z" + }, + { + "name": "Verify the release tag", + "status": "completed", + "conclusion": "success", + "number": 2, + "started_at": "2026-11-09T19:01:15Z", + "completed_at": "2026-11-09T19:01:16Z" + }, + { + "name": "Complete job", + "status": "completed", + "conclusion": "success", + "number": 3, + "started_at": "2026-11-09T19:01:16Z", + "completed_at": "2026-11-09T19:01:16Z" + } + ], + "check_run_url": "https://api.github.com/repos/pegma-dev/storage-core/check-runs/129369152320", + "labels": ["ubuntu-latest"], + "runner_id": 1000004211, + "runner_name": "GitHub Actions 1000004211", + "runner_group_id": 0, + "runner_group_name": "GitHub Actions" + }, + { + "id": 129369226701, + "run_id": 42679292292, + "workflow_name": "Publish", + "head_branch": "v0.4.5", + "run_url": "https://api.github.com/repos/pegma-dev/storage-core/actions/runs/42679292292", + "run_attempt": 1, + "node_id": "CR_kwDOTjt1x88AAAAeHwG9zQ", + "head_sha": "a5a5d0bfe6355df89c049fcec3148845c5124735", + "url": "https://api.github.com/repos/pegma-dev/storage-core/actions/jobs/129369226701", + "html_url": "https://github.com/pegma-dev/storage-core/actions/runs/42679292292/job/129369226701", + "status": "completed", + "conclusion": "success", + "created_at": "2026-11-09T19:01:19Z", + "started_at": "2026-11-09T19:01:21Z", + "completed_at": "2026-11-09T19:02:34Z", + "name": "Node.js 24", + "steps": [ + { + "name": "Set up job", + "status": "completed", + "conclusion": "success", + "number": 1, + "started_at": "2026-11-09T19:01:22Z", + "completed_at": "2026-11-09T19:01:23Z" + }, + { + "name": "Check out the exact release commit", + "status": "completed", + "conclusion": "success", + "number": 2, + "started_at": "2026-11-09T19:01:23Z", + "completed_at": "2026-11-09T19:01:24Z" + }, + { + "name": "Set up Node.js", + "status": "completed", + "conclusion": "success", + "number": 3, + "started_at": "2026-11-09T19:01:24Z", + "completed_at": "2026-11-09T19:01:24Z" + }, + { + "name": "Set up Java for DynamoDB Local", + "status": "completed", + "conclusion": "success", + "number": 4, + "started_at": "2026-11-09T19:01:24Z", + "completed_at": "2026-11-09T19:01:24Z" + }, + { + "name": "Enable Corepack", + "status": "completed", + "conclusion": "success", + "number": 5, + "started_at": "2026-11-09T19:01:24Z", + "completed_at": "2026-11-09T19:01:25Z" + }, + { + "name": "Install dependencies", + "status": "completed", + "conclusion": "success", + "number": 6, + "started_at": "2026-11-09T19:01:25Z", + "completed_at": "2026-11-09T19:01:30Z" + }, + { + "name": "Check formatting", + "status": "completed", + "conclusion": "success", + "number": 7, + "started_at": "2026-11-09T19:01:30Z", + "completed_at": "2026-11-09T19:01:32Z" + }, + { + "name": "Check types", + "status": "completed", + "conclusion": "success", + "number": 8, + "started_at": "2026-11-09T19:01:32Z", + "completed_at": "2026-11-09T19:01:33Z" + }, + { + "name": "Run tests", + "status": "completed", + "conclusion": "success", + "number": 9, + "started_at": "2026-11-09T19:01:33Z", + "completed_at": "2026-11-09T19:02:31Z" + }, + { + "name": "Check release metadata", + "status": "completed", + "conclusion": "success", + "number": 10, + "started_at": "2026-11-09T19:02:31Z", + "completed_at": "2026-11-09T19:02:32Z" + }, + { + "name": "Post Set up Java for DynamoDB Local", + "status": "completed", + "conclusion": "success", + "number": 18, + "started_at": "2026-11-09T19:02:32Z", + "completed_at": "2026-11-09T19:02:32Z" + }, + { + "name": "Post Set up Node.js", + "status": "completed", + "conclusion": "success", + "number": 19, + "started_at": "2026-11-09T19:02:32Z", + "completed_at": "2026-11-09T19:02:32Z" + }, + { + "name": "Post Check out the exact release commit", + "status": "completed", + "conclusion": "success", + "number": 20, + "started_at": "2026-11-09T19:02:32Z", + "completed_at": "2026-11-09T19:02:32Z" + }, + { + "name": "Complete job", + "status": "completed", + "conclusion": "success", + "number": 21, + "started_at": "2026-11-09T19:02:32Z", + "completed_at": "2026-11-09T19:02:32Z" + } + ], + "check_run_url": "https://api.github.com/repos/pegma-dev/storage-core/check-runs/129369226701", + "labels": ["ubuntu-latest"], + "runner_id": 1000004212, + "runner_name": "GitHub Actions 1000004212", + "runner_group_id": 0, + "runner_group_name": "GitHub Actions" + }, + { + "id": 129369227040, + "run_id": 42679292292, + "workflow_name": "Publish", + "head_branch": "v0.4.5", + "run_url": "https://api.github.com/repos/pegma-dev/storage-core/actions/runs/42679292292", + "run_attempt": 1, + "node_id": "CR_kwDOTjt1x88AAAAeHwG_IA", + "head_sha": "a5a5d0bfe6355df89c049fcec3148845c5124735", + "url": "https://api.github.com/repos/pegma-dev/storage-core/actions/jobs/129369227040", + "html_url": "https://github.com/pegma-dev/storage-core/actions/runs/42679292292/job/129369227040", + "status": "completed", + "conclusion": "success", + "created_at": "2026-11-09T19:01:19Z", + "started_at": "2026-11-09T19:01:21Z", + "completed_at": "2026-11-09T19:02:39Z", + "name": "Node.js 22", + "steps": [ + { + "name": "Set up job", + "status": "completed", + "conclusion": "success", + "number": 1, + "started_at": "2026-11-09T19:01:22Z", + "completed_at": "2026-11-09T19:01:23Z" + }, + { + "name": "Check out the exact release commit", + "status": "completed", + "conclusion": "success", + "number": 2, + "started_at": "2026-11-09T19:01:23Z", + "completed_at": "2026-11-09T19:01:25Z" + }, + { + "name": "Set up Node.js", + "status": "completed", + "conclusion": "success", + "number": 3, + "started_at": "2026-11-09T19:01:25Z", + "completed_at": "2026-11-09T19:01:25Z" + }, + { + "name": "Set up Java for DynamoDB Local", + "status": "completed", + "conclusion": "success", + "number": 4, + "started_at": "2026-11-09T19:01:25Z", + "completed_at": "2026-11-09T19:01:25Z" + }, + { + "name": "Enable Corepack", + "status": "completed", + "conclusion": "success", + "number": 5, + "started_at": "2026-11-09T19:01:25Z", + "completed_at": "2026-11-09T19:01:25Z" + }, + { + "name": "Install dependencies", + "status": "completed", + "conclusion": "success", + "number": 6, + "started_at": "2026-11-09T19:01:25Z", + "completed_at": "2026-11-09T19:01:31Z" + }, + { + "name": "Check formatting", + "status": "completed", + "conclusion": "success", + "number": 7, + "started_at": "2026-11-09T19:01:31Z", + "completed_at": "2026-11-09T19:01:34Z" + }, + { + "name": "Check types", + "status": "completed", + "conclusion": "success", + "number": 8, + "started_at": "2026-11-09T19:01:34Z", + "completed_at": "2026-11-09T19:01:35Z" + }, + { + "name": "Run tests", + "status": "completed", + "conclusion": "success", + "number": 9, + "started_at": "2026-11-09T19:01:35Z", + "completed_at": "2026-11-09T19:02:35Z" + }, + { + "name": "Check release metadata", + "status": "completed", + "conclusion": "success", + "number": 10, + "started_at": "2026-11-09T19:02:35Z", + "completed_at": "2026-11-09T19:02:35Z" + }, + { + "name": "Post Set up Java for DynamoDB Local", + "status": "completed", + "conclusion": "success", + "number": 18, + "started_at": "2026-11-09T19:02:35Z", + "completed_at": "2026-11-09T19:02:35Z" + }, + { + "name": "Post Set up Node.js", + "status": "completed", + "conclusion": "success", + "number": 19, + "started_at": "2026-11-09T19:02:35Z", + "completed_at": "2026-11-09T19:02:35Z" + }, + { + "name": "Post Check out the exact release commit", + "status": "completed", + "conclusion": "success", + "number": 20, + "started_at": "2026-11-09T19:02:35Z", + "completed_at": "2026-11-09T19:02:35Z" + }, + { + "name": "Complete job", + "status": "completed", + "conclusion": "success", + "number": 21, + "started_at": "2026-11-09T19:02:35Z", + "completed_at": "2026-11-09T19:02:36Z" + } + ], + "check_run_url": "https://api.github.com/repos/pegma-dev/storage-core/check-runs/129369227040", + "labels": ["ubuntu-latest"], + "runner_id": 1000004213, + "runner_name": "GitHub Actions 1000004213", + "runner_group_id": 0, + "runner_group_name": "GitHub Actions" + }, + { + "id": 129369992918, + "run_id": 42679292292, + "workflow_name": "Publish", + "head_branch": "v0.4.5", + "run_url": "https://api.github.com/repos/pegma-dev/storage-core/actions/runs/42679292292", + "run_attempt": 1, + "node_id": "CR_kwDOTjt1x88AAAAeHw1u1g", + "head_sha": "a5a5d0bfe6355df89c049fcec3148845c5124735", + "url": "https://api.github.com/repos/pegma-dev/storage-core/actions/jobs/129369992918", + "html_url": "https://github.com/pegma-dev/storage-core/actions/runs/42679292292/job/129369992918", + "status": "completed", + "conclusion": "success", + "created_at": "2026-11-09T19:02:39Z", + "started_at": "2026-11-09T19:02:42Z", + "completed_at": "2026-11-09T19:03:07Z", + "name": "prepare", + "steps": [ + { + "name": "Set up job", + "status": "completed", + "conclusion": "success", + "number": 1, + "started_at": "2026-11-09T19:02:43Z", + "completed_at": "2026-11-09T19:02:43Z" + }, + { + "name": "Check out the exact release commit", + "status": "completed", + "conclusion": "success", + "number": 2, + "started_at": "2026-11-09T19:02:44Z", + "completed_at": "2026-11-09T19:02:45Z" + }, + { + "name": "Configure checkout tag verification", + "status": "completed", + "conclusion": "success", + "number": 3, + "started_at": "2026-11-09T19:02:45Z", + "completed_at": "2026-11-09T19:02:45Z" + }, + { + "name": "Set up Node.js", + "status": "completed", + "conclusion": "success", + "number": 4, + "started_at": "2026-11-09T19:02:45Z", + "completed_at": "2026-11-09T19:02:49Z" + }, + { + "name": "Bootstrap the reviewed npm CLI", + "status": "completed", + "conclusion": "success", + "number": 5, + "started_at": "2026-11-09T19:02:49Z", + "completed_at": "2026-11-09T19:02:50Z" + }, + { + "name": "Check the npm version", + "status": "completed", + "conclusion": "success", + "number": 6, + "started_at": "2026-11-09T19:02:50Z", + "completed_at": "2026-11-09T19:02:50Z" + }, + { + "name": "Enable Corepack", + "status": "completed", + "conclusion": "success", + "number": 7, + "started_at": "2026-11-09T19:02:50Z", + "completed_at": "2026-11-09T19:02:50Z" + }, + { + "name": "Install dependencies", + "status": "completed", + "conclusion": "success", + "number": 8, + "started_at": "2026-11-09T19:02:50Z", + "completed_at": "2026-11-09T19:02:55Z" + }, + { + "name": "Pack the release files", + "status": "completed", + "conclusion": "success", + "number": 9, + "started_at": "2026-11-09T19:02:55Z", + "completed_at": "2026-11-09T19:03:03Z" + }, + { + "name": "Seal the release inventory", + "status": "completed", + "conclusion": "success", + "number": 10, + "started_at": "2026-11-09T19:03:03Z", + "completed_at": "2026-11-09T19:03:03Z" + }, + { + "name": "Upload the prepared release", + "status": "completed", + "conclusion": "success", + "number": 11, + "started_at": "2026-11-09T19:03:03Z", + "completed_at": "2026-11-09T19:03:04Z" + }, + { + "name": "Retain genuine registry reuse proof", + "status": "completed", + "conclusion": "success", + "number": 12, + "started_at": "2026-11-09T19:03:04Z", + "completed_at": "2026-11-09T19:03:05Z" + }, + { + "name": "Record original artifact identity", + "status": "completed", + "conclusion": "success", + "number": 13, + "started_at": "2026-11-09T19:03:05Z", + "completed_at": "2026-11-09T19:03:05Z" + }, + { + "name": "Post Set up Node.js", + "status": "completed", + "conclusion": "success", + "number": 25, + "started_at": "2026-11-09T19:03:05Z", + "completed_at": "2026-11-09T19:03:05Z" + }, + { + "name": "Post Check out the exact release commit", + "status": "completed", + "conclusion": "success", + "number": 26, + "started_at": "2026-11-09T19:03:05Z", + "completed_at": "2026-11-09T19:03:05Z" + }, + { + "name": "Complete job", + "status": "completed", + "conclusion": "success", + "number": 27, + "started_at": "2026-11-09T19:03:05Z", + "completed_at": "2026-11-09T19:03:05Z" + } + ], + "check_run_url": "https://api.github.com/repos/pegma-dev/storage-core/check-runs/129369992918", + "labels": ["ubuntu-latest"], + "runner_id": 1000004214, + "runner_name": "GitHub Actions 1000004214", + "runner_group_id": 0, + "runner_group_name": "GitHub Actions" + }, + { + "id": 129370261175, + "run_id": 42679292292, + "workflow_name": "Publish", + "head_branch": "v0.4.5", + "run_url": "https://api.github.com/repos/pegma-dev/storage-core/actions/runs/42679292292", + "run_attempt": 1, + "node_id": "CR_kwDOTjt1x88AAAAeHxGGtw", + "head_sha": "a5a5d0bfe6355df89c049fcec3148845c5124735", + "url": "https://api.github.com/repos/pegma-dev/storage-core/actions/jobs/129370261175", + "html_url": "https://github.com/pegma-dev/storage-core/actions/runs/42679292292/job/129370261175", + "status": "completed", + "conclusion": "success", + "created_at": "2026-11-09T19:03:08Z", + "started_at": "2026-11-09T19:03:10Z", + "completed_at": "2026-11-09T19:03:31Z", + "name": "smoke", + "steps": [ + { + "name": "Set up job", + "status": "completed", + "conclusion": "success", + "number": 1, + "started_at": "2026-11-09T19:03:11Z", + "completed_at": "2026-11-09T19:03:12Z" + }, + { + "name": "Check out the exact release commit", + "status": "completed", + "conclusion": "success", + "number": 2, + "started_at": "2026-11-09T19:03:12Z", + "completed_at": "2026-11-09T19:03:13Z" + }, + { + "name": "Set up Node.js", + "status": "completed", + "conclusion": "success", + "number": 3, + "started_at": "2026-11-09T19:03:13Z", + "completed_at": "2026-11-09T19:03:17Z" + }, + { + "name": "Set up Java for DynamoDB Local", + "status": "completed", + "conclusion": "success", + "number": 4, + "started_at": "2026-11-09T19:03:17Z", + "completed_at": "2026-11-09T19:03:17Z" + }, + { + "name": "Download the prepared release copy", + "status": "completed", + "conclusion": "success", + "number": 5, + "started_at": "2026-11-09T19:03:17Z", + "completed_at": "2026-11-09T19:03:18Z" + }, + { + "name": "Smoke-test the prepared release copy", + "status": "completed", + "conclusion": "success", + "number": 6, + "started_at": "2026-11-09T19:03:18Z", + "completed_at": "2026-11-09T19:03:28Z" + }, + { + "name": "Retain public consumer proof", + "status": "completed", + "conclusion": "success", + "number": 7, + "started_at": "2026-11-09T19:03:28Z", + "completed_at": "2026-11-09T19:03:29Z" + }, + { + "name": "Post Set up Java for DynamoDB Local", + "status": "completed", + "conclusion": "success", + "number": 12, + "started_at": "2026-11-09T19:03:29Z", + "completed_at": "2026-11-09T19:03:29Z" + }, + { + "name": "Post Set up Node.js", + "status": "completed", + "conclusion": "success", + "number": 13, + "started_at": "2026-11-09T19:03:29Z", + "completed_at": "2026-11-09T19:03:29Z" + }, + { + "name": "Post Check out the exact release commit", + "status": "completed", + "conclusion": "success", + "number": 14, + "started_at": "2026-11-09T19:03:29Z", + "completed_at": "2026-11-09T19:03:30Z" + }, + { + "name": "Complete job", + "status": "completed", + "conclusion": "success", + "number": 15, + "started_at": "2026-11-09T19:03:30Z", + "completed_at": "2026-11-09T19:03:30Z" + } + ], + "check_run_url": "https://api.github.com/repos/pegma-dev/storage-core/check-runs/129370261175", + "labels": ["ubuntu-latest"], + "runner_id": 1000004215, + "runner_name": "GitHub Actions 1000004215", + "runner_group_id": 0, + "runner_group_name": "GitHub Actions" + }, + { + "id": 129370497187, + "run_id": 42679292292, + "workflow_name": "Publish", + "head_branch": "v0.4.5", + "run_url": "https://api.github.com/repos/pegma-dev/storage-core/actions/runs/42679292292", + "run_attempt": 1, + "node_id": "CR_kwDOTjt1x88AAAAeHxUgow", + "head_sha": "a5a5d0bfe6355df89c049fcec3148845c5124735", + "url": "https://api.github.com/repos/pegma-dev/storage-core/actions/jobs/129370497187", + "html_url": "https://github.com/pegma-dev/storage-core/actions/runs/42679292292/job/129370497187", + "status": "completed", + "conclusion": "success", + "created_at": "2026-11-09T19:03:33Z", + "started_at": "2026-11-09T19:03:36Z", + "completed_at": "2026-11-09T19:03:56Z", + "name": "preflight", + "steps": [ + { + "name": "Set up job", + "status": "completed", + "conclusion": "success", + "number": 1, + "started_at": "2026-11-09T19:03:37Z", + "completed_at": "2026-11-09T19:03:38Z" + }, + { + "name": "Check out the exact release commit", + "status": "completed", + "conclusion": "success", + "number": 2, + "started_at": "2026-11-09T19:03:38Z", + "completed_at": "2026-11-09T19:03:39Z" + }, + { + "name": "Set up Node.js", + "status": "completed", + "conclusion": "success", + "number": 3, + "started_at": "2026-11-09T19:03:39Z", + "completed_at": "2026-11-09T19:03:44Z" + }, + { + "name": "Download the original prepared release", + "status": "completed", + "conclusion": "success", + "number": 4, + "started_at": "2026-11-09T19:03:44Z", + "completed_at": "2026-11-09T19:03:45Z" + }, + { + "name": "Verify registry preflight", + "status": "completed", + "conclusion": "success", + "number": 5, + "started_at": "2026-11-09T19:03:45Z", + "completed_at": "2026-11-09T19:03:53Z" + }, + { + "name": "Seal registry preflight", + "status": "completed", + "conclusion": "success", + "number": 6, + "started_at": "2026-11-09T19:03:53Z", + "completed_at": "2026-11-09T19:03:53Z" + }, + { + "name": "Retain registry preflight", + "status": "completed", + "conclusion": "success", + "number": 7, + "started_at": "2026-11-09T19:03:53Z", + "completed_at": "2026-11-09T19:03:54Z" + }, + { + "name": "Post Set up Node.js", + "status": "completed", + "conclusion": "success", + "number": 13, + "started_at": "2026-11-09T19:03:54Z", + "completed_at": "2026-11-09T19:03:54Z" + }, + { + "name": "Post Check out the exact release commit", + "status": "completed", + "conclusion": "success", + "number": 14, + "started_at": "2026-11-09T19:03:54Z", + "completed_at": "2026-11-09T19:03:55Z" + }, + { + "name": "Complete job", + "status": "completed", + "conclusion": "success", + "number": 15, + "started_at": "2026-11-09T19:03:55Z", + "completed_at": "2026-11-09T19:03:55Z" + } + ], + "check_run_url": "https://api.github.com/repos/pegma-dev/storage-core/check-runs/129370497187", + "labels": ["ubuntu-latest"], + "runner_id": 1000004216, + "runner_name": "GitHub Actions 1000004216", + "runner_group_id": 0, + "runner_group_name": "GitHub Actions" + }, + { + "id": 129370713574, + "run_id": 42679292292, + "workflow_name": "Publish", + "head_branch": "v0.4.5", + "run_url": "https://api.github.com/repos/pegma-dev/storage-core/actions/runs/42679292292", + "run_attempt": 1, + "node_id": "CR_kwDOTjt1x88AAAAeHxht5g", + "head_sha": "a5a5d0bfe6355df89c049fcec3148845c5124735", + "url": "https://api.github.com/repos/pegma-dev/storage-core/actions/jobs/129370713574", + "html_url": "https://github.com/pegma-dev/storage-core/actions/runs/42679292292/job/129370713574", + "status": "completed", + "conclusion": "failure", + "created_at": "2026-11-09T19:03:57Z", + "started_at": "2026-11-09T19:15:46Z", + "completed_at": "2026-11-09T19:16:36Z", + "name": "publish", + "steps": [ + { + "name": "Set up job", + "status": "completed", + "conclusion": "success", + "number": 1, + "started_at": "2026-11-09T19:15:47Z", + "completed_at": "2026-11-09T19:15:47Z" + }, + { + "name": "Verify the release tag", + "status": "completed", + "conclusion": "success", + "number": 2, + "started_at": "2026-11-09T19:15:47Z", + "completed_at": "2026-11-09T19:15:48Z" + }, + { + "name": "Set up Node.js", + "status": "completed", + "conclusion": "success", + "number": 3, + "started_at": "2026-11-09T19:15:48Z", + "completed_at": "2026-11-09T19:15:52Z" + }, + { + "name": "Bootstrap the reviewed npm CLI", + "status": "completed", + "conclusion": "success", + "number": 4, + "started_at": "2026-11-09T19:15:52Z", + "completed_at": "2026-11-09T19:15:53Z" + }, + { + "name": "Check the npm version", + "status": "completed", + "conclusion": "success", + "number": 5, + "started_at": "2026-11-09T19:15:53Z", + "completed_at": "2026-11-09T19:15:53Z" + }, + { + "name": "Download the prepared release", + "status": "completed", + "conclusion": "success", + "number": 6, + "started_at": "2026-11-09T19:15:53Z", + "completed_at": "2026-11-09T19:15:54Z" + }, + { + "name": "Download sealed registry preflight", + "status": "completed", + "conclusion": "success", + "number": 7, + "started_at": "2026-11-09T19:15:54Z", + "completed_at": "2026-11-09T19:15:55Z" + }, + { + "name": "Verify and publish the prepared release", + "status": "completed", + "conclusion": "failure", + "number": 8, + "started_at": "2026-11-09T19:15:55Z", + "completed_at": "2026-11-09T19:16:34Z" + }, + { + "name": "Post Set up Node.js", + "status": "completed", + "conclusion": "skipped", + "number": 16, + "started_at": "2026-11-09T19:16:34Z", + "completed_at": "2026-11-09T19:16:34Z" + }, + { + "name": "Complete job", + "status": "completed", + "conclusion": "success", + "number": 17, + "started_at": "2026-11-09T19:16:34Z", + "completed_at": "2026-11-09T19:16:34Z" + } + ], + "check_run_url": "https://api.github.com/repos/pegma-dev/storage-core/check-runs/129370713574", + "labels": ["ubuntu-latest"], + "runner_id": 1000004217, + "runner_name": "GitHub Actions 1000004217", + "runner_group_id": 0, + "runner_group_name": "GitHub Actions" + }, + { + "id": 129377933848, + "run_id": 42679292292, + "workflow_name": "Publish", + "head_branch": "v0.4.5", + "run_url": "https://api.github.com/repos/pegma-dev/storage-core/actions/runs/42679292292", + "run_attempt": 1, + "node_id": "CR_kwDOTjt1x88AAAAeH4aaGA", + "head_sha": "a5a5d0bfe6355df89c049fcec3148845c5124735", + "url": "https://api.github.com/repos/pegma-dev/storage-core/actions/jobs/129377933848", + "html_url": "https://github.com/pegma-dev/storage-core/actions/runs/42679292292/job/129377933848", + "status": "completed", + "conclusion": "skipped", + "created_at": "2026-11-09T19:16:37Z", + "started_at": "2026-11-09T19:16:37Z", + "completed_at": "2026-11-09T19:16:36Z", + "name": "verify", + "steps": [], + "check_run_url": "https://api.github.com/repos/pegma-dev/storage-core/check-runs/129377933848", + "labels": ["ubuntu-latest"], + "runner_id": null, + "runner_name": null, + "runner_group_id": null, + "runner_group_name": null + } + ] +} diff --git a/tests/fixtures/release-registry/dynamodb045-original-run.json b/tests/fixtures/release-registry/dynamodb045-original-run.json new file mode 100644 index 0000000..49bd73e --- /dev/null +++ b/tests/fixtures/release-registry/dynamodb045-original-run.json @@ -0,0 +1,218 @@ +{ + "id": 42679292292, + "name": "Publish", + "node_id": "WFR_kwLOTjt1x88AAAAJ7-JRhA", + "head_branch": "v0.4.5", + "head_sha": "a5a5d0bfe6355df89c049fcec3148845c5124735", + "path": ".github/workflows/publish.yml", + "display_title": "Storage DynamoDB 0.4.5 - publication in progress", + "run_number": 13, + "event": "release", + "status": "completed", + "conclusion": "success", + "workflow_id": 320599636, + "check_suite_id": 115594959842, + "check_suite_node_id": "CS_kwDOTjt1x88AAAAa6f8b4g", + "url": "https://api.github.com/repos/pegma-dev/storage-core/actions/runs/42679292292", + "html_url": "https://github.com/pegma-dev/storage-core/actions/runs/42679292292", + "pull_requests": [], + "created_at": "2026-11-09T19:01:10Z", + "updated_at": "2026-11-09T19:33:05Z", + "actor": { + "login": "FlyOverCoderKY", + "id": 2440101, + "node_id": "MDQ6VXNlcjI0NDAxMDE=", + "avatar_url": "https://avatars.githubusercontent.com/u/2440101?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/FlyOverCoderKY", + "html_url": "https://github.com/FlyOverCoderKY", + "followers_url": "https://api.github.com/users/FlyOverCoderKY/followers", + "following_url": "https://api.github.com/users/FlyOverCoderKY/following{/other_user}", + "gists_url": "https://api.github.com/users/FlyOverCoderKY/gists{/gist_id}", + "starred_url": "https://api.github.com/users/FlyOverCoderKY/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/FlyOverCoderKY/subscriptions", + "organizations_url": "https://api.github.com/users/FlyOverCoderKY/orgs", + "repos_url": "https://api.github.com/users/FlyOverCoderKY/repos", + "events_url": "https://api.github.com/users/FlyOverCoderKY/events{/privacy}", + "received_events_url": "https://api.github.com/users/FlyOverCoderKY/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false + }, + "run_attempt": 2, + "referenced_workflows": [], + "run_started_at": "2026-11-09T19:24:25Z", + "triggering_actor": { + "login": "FlyOverCoderKY", + "id": 2440101, + "node_id": "MDQ6VXNlcjI0NDAxMDE=", + "avatar_url": "https://avatars.githubusercontent.com/u/2440101?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/FlyOverCoderKY", + "html_url": "https://github.com/FlyOverCoderKY", + "followers_url": "https://api.github.com/users/FlyOverCoderKY/followers", + "following_url": "https://api.github.com/users/FlyOverCoderKY/following{/other_user}", + "gists_url": "https://api.github.com/users/FlyOverCoderKY/gists{/gist_id}", + "starred_url": "https://api.github.com/users/FlyOverCoderKY/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/FlyOverCoderKY/subscriptions", + "organizations_url": "https://api.github.com/users/FlyOverCoderKY/orgs", + "repos_url": "https://api.github.com/users/FlyOverCoderKY/repos", + "events_url": "https://api.github.com/users/FlyOverCoderKY/events{/privacy}", + "received_events_url": "https://api.github.com/users/FlyOverCoderKY/received_events", + "type": "User", + "user_view_type": "public", + "site_admin": false + }, + "jobs_url": "https://api.github.com/repos/pegma-dev/storage-core/actions/runs/42679292292/jobs", + "logs_url": "https://api.github.com/repos/pegma-dev/storage-core/actions/runs/42679292292/logs", + "check_suite_url": "https://api.github.com/repos/pegma-dev/storage-core/check-suites/115594959842", + "artifacts_url": "https://api.github.com/repos/pegma-dev/storage-core/actions/runs/42679292292/artifacts", + "cancel_url": "https://api.github.com/repos/pegma-dev/storage-core/actions/runs/42679292292/cancel", + "rerun_url": "https://api.github.com/repos/pegma-dev/storage-core/actions/runs/42679292292/rerun", + "previous_attempt_url": "https://api.github.com/repos/pegma-dev/storage-core/actions/runs/42679292292/attempts/1", + "workflow_url": "https://api.github.com/repos/pegma-dev/storage-core/actions/workflows/320599636", + "head_commit": { + "id": "a5a5d0bfe6355df89c049fcec3148845c5124735", + "tree_id": "2cc7aad8941f0fe9edc1918c9c5b4a86c9584c23", + "message": "[host01] Fix registry verifier CLI module initialization (#11)\n\n* Fix host01 registry verifier CLI initialization cycle\n\n* Preserve CLI diagnostics and validate invocation before I/O", + "timestamp": "2026-11-09T18:52:39Z", + "author": { "name": "Fly Over Coder", "email": "NRover@gmail.com" }, + "committer": { "name": "GitHub", "email": "noreply@github.com" } + }, + "repository": { + "id": 1312519623, + "node_id": "R_kgDOTjt1xw", + "name": "storage-core", + "full_name": "pegma-dev/storage-core", + "private": false, + "owner": { + "login": "pegma-dev", + "id": 309286193, + "node_id": "O_kgDOEm9VMQ", + "avatar_url": "https://avatars.githubusercontent.com/u/309286193?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/pegma-dev", + "html_url": "https://github.com/pegma-dev", + "followers_url": "https://api.github.com/users/pegma-dev/followers", + "following_url": "https://api.github.com/users/pegma-dev/following{/other_user}", + "gists_url": "https://api.github.com/users/pegma-dev/gists{/gist_id}", + "starred_url": "https://api.github.com/users/pegma-dev/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/pegma-dev/subscriptions", + "organizations_url": "https://api.github.com/users/pegma-dev/orgs", + "repos_url": "https://api.github.com/users/pegma-dev/repos", + "events_url": "https://api.github.com/users/pegma-dev/events{/privacy}", + "received_events_url": "https://api.github.com/users/pegma-dev/received_events", + "type": "Organization", + "user_view_type": "public", + "site_admin": false + }, + "html_url": "https://github.com/pegma-dev/storage-core", + "description": "Schema-agnostic persistence for Pegma components: declared collections, optimistic concurrency, and a conformance suite.", + "fork": false, + "url": "https://api.github.com/repos/pegma-dev/storage-core", + "forks_url": "https://api.github.com/repos/pegma-dev/storage-core/forks", + "keys_url": "https://api.github.com/repos/pegma-dev/storage-core/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/pegma-dev/storage-core/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/pegma-dev/storage-core/teams", + "hooks_url": "https://api.github.com/repos/pegma-dev/storage-core/hooks", + "issue_events_url": "https://api.github.com/repos/pegma-dev/storage-core/issues/events{/number}", + "events_url": "https://api.github.com/repos/pegma-dev/storage-core/events", + "assignees_url": "https://api.github.com/repos/pegma-dev/storage-core/assignees{/user}", + "branches_url": "https://api.github.com/repos/pegma-dev/storage-core/branches{/branch}", + "tags_url": "https://api.github.com/repos/pegma-dev/storage-core/tags", + "blobs_url": "https://api.github.com/repos/pegma-dev/storage-core/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/pegma-dev/storage-core/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/pegma-dev/storage-core/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/pegma-dev/storage-core/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/pegma-dev/storage-core/statuses/{sha}", + "languages_url": "https://api.github.com/repos/pegma-dev/storage-core/languages", + "stargazers_url": "https://api.github.com/repos/pegma-dev/storage-core/stargazers", + "contributors_url": "https://api.github.com/repos/pegma-dev/storage-core/contributors", + "subscribers_url": "https://api.github.com/repos/pegma-dev/storage-core/subscribers", + "subscription_url": "https://api.github.com/repos/pegma-dev/storage-core/subscription", + "commits_url": "https://api.github.com/repos/pegma-dev/storage-core/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/pegma-dev/storage-core/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/pegma-dev/storage-core/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/pegma-dev/storage-core/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/pegma-dev/storage-core/contents/{+path}", + "compare_url": "https://api.github.com/repos/pegma-dev/storage-core/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/pegma-dev/storage-core/merges", + "archive_url": "https://api.github.com/repos/pegma-dev/storage-core/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/pegma-dev/storage-core/downloads", + "issues_url": "https://api.github.com/repos/pegma-dev/storage-core/issues{/number}", + "pulls_url": "https://api.github.com/repos/pegma-dev/storage-core/pulls{/number}", + "milestones_url": "https://api.github.com/repos/pegma-dev/storage-core/milestones{/number}", + "notifications_url": "https://api.github.com/repos/pegma-dev/storage-core/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/pegma-dev/storage-core/labels{/name}", + "releases_url": "https://api.github.com/repos/pegma-dev/storage-core/releases{/id}", + "deployments_url": "https://api.github.com/repos/pegma-dev/storage-core/deployments" + }, + "head_repository": { + "id": 1312519623, + "node_id": "R_kgDOTjt1xw", + "name": "storage-core", + "full_name": "pegma-dev/storage-core", + "private": false, + "owner": { + "login": "pegma-dev", + "id": 309286193, + "node_id": "O_kgDOEm9VMQ", + "avatar_url": "https://avatars.githubusercontent.com/u/309286193?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/pegma-dev", + "html_url": "https://github.com/pegma-dev", + "followers_url": "https://api.github.com/users/pegma-dev/followers", + "following_url": "https://api.github.com/users/pegma-dev/following{/other_user}", + "gists_url": "https://api.github.com/users/pegma-dev/gists{/gist_id}", + "starred_url": "https://api.github.com/users/pegma-dev/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/pegma-dev/subscriptions", + "organizations_url": "https://api.github.com/users/pegma-dev/orgs", + "repos_url": "https://api.github.com/users/pegma-dev/repos", + "events_url": "https://api.github.com/users/pegma-dev/events{/privacy}", + "received_events_url": "https://api.github.com/users/pegma-dev/received_events", + "type": "Organization", + "user_view_type": "public", + "site_admin": false + }, + "html_url": "https://github.com/pegma-dev/storage-core", + "description": "Schema-agnostic persistence for Pegma components: declared collections, optimistic concurrency, and a conformance suite.", + "fork": false, + "url": "https://api.github.com/repos/pegma-dev/storage-core", + "forks_url": "https://api.github.com/repos/pegma-dev/storage-core/forks", + "keys_url": "https://api.github.com/repos/pegma-dev/storage-core/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/pegma-dev/storage-core/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/pegma-dev/storage-core/teams", + "hooks_url": "https://api.github.com/repos/pegma-dev/storage-core/hooks", + "issue_events_url": "https://api.github.com/repos/pegma-dev/storage-core/issues/events{/number}", + "events_url": "https://api.github.com/repos/pegma-dev/storage-core/events", + "assignees_url": "https://api.github.com/repos/pegma-dev/storage-core/assignees{/user}", + "branches_url": "https://api.github.com/repos/pegma-dev/storage-core/branches{/branch}", + "tags_url": "https://api.github.com/repos/pegma-dev/storage-core/tags", + "blobs_url": "https://api.github.com/repos/pegma-dev/storage-core/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/pegma-dev/storage-core/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/pegma-dev/storage-core/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/pegma-dev/storage-core/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/pegma-dev/storage-core/statuses/{sha}", + "languages_url": "https://api.github.com/repos/pegma-dev/storage-core/languages", + "stargazers_url": "https://api.github.com/repos/pegma-dev/storage-core/stargazers", + "contributors_url": "https://api.github.com/repos/pegma-dev/storage-core/contributors", + "subscribers_url": "https://api.github.com/repos/pegma-dev/storage-core/subscribers", + "subscription_url": "https://api.github.com/repos/pegma-dev/storage-core/subscription", + "commits_url": "https://api.github.com/repos/pegma-dev/storage-core/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/pegma-dev/storage-core/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/pegma-dev/storage-core/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/pegma-dev/storage-core/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/pegma-dev/storage-core/contents/{+path}", + "compare_url": "https://api.github.com/repos/pegma-dev/storage-core/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/pegma-dev/storage-core/merges", + "archive_url": "https://api.github.com/repos/pegma-dev/storage-core/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/pegma-dev/storage-core/downloads", + "issues_url": "https://api.github.com/repos/pegma-dev/storage-core/issues{/number}", + "pulls_url": "https://api.github.com/repos/pegma-dev/storage-core/pulls{/number}", + "milestones_url": "https://api.github.com/repos/pegma-dev/storage-core/milestones{/number}", + "notifications_url": "https://api.github.com/repos/pegma-dev/storage-core/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/pegma-dev/storage-core/labels{/name}", + "releases_url": "https://api.github.com/repos/pegma-dev/storage-core/releases{/id}", + "deployments_url": "https://api.github.com/repos/pegma-dev/storage-core/deployments" + } +} diff --git a/tests/fixtures/release-registry/dynamodb045-slsa.json b/tests/fixtures/release-registry/dynamodb045-slsa.json new file mode 100644 index 0000000..081f1b0 --- /dev/null +++ b/tests/fixtures/release-registry/dynamodb045-slsa.json @@ -0,0 +1,73 @@ +{ + "predicateType": "https://slsa.dev/provenance/v1", + "bundle": { + "mediaType": "application/vnd.dev.sigstore.bundle.v0.3+json", + "verificationMaterial": { + "certificate": { + "rawBytes": "MIIHJzCCBq2gAwIBAgIUA5VN7cqkz9bL5rex20PvreRMFYYwCgYIKoZIzj0EAwMwNzEVMBMGA1UEChMMc2lnc3RvcmUuZGV2MR4wHAYDVQQDExVzaWdzdG9yZS1pbnRlcm1lZGlhdGUwHhcNMjYxMTA5MTkxNTU4WhcNMjYxMTA5MTkyNTU4WjAAMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE+GFfpZlq1o4y6iXSSwueqog0WV1iFenVHbQrYOtw/bInWiDDl8ZT7PtXB+Xk12zRZYIqVhUHxpBo/v5r/jjTjaOCBcwwggXIMA4GA1UdDwEB/wQEAwIHgDATBgNVHSUEDDAKBggrBgEFBQcDAzAfBgNVHSMEGDAWgBTf0+nPViQRlvmo2OkoVaLGLhhkPzBmBgNVHREBAf8EXDBahlhodHRwczovL2dpdGh1Yi5jb20vcGVnbWEtZGV2L3N0b3JhZ2UtY29yZS8uZ2l0aHViL3dvcmtmbG93cy9wdWJsaXNoLnltbEByZ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3RvcmFnZS1jb3JlLy5naXRodWIvd29ya2Zsb3dzL3B1Ymxpc2gueW1sQHJlZnMvdGFncy92MC40LjUwOAYKKwYBBAGDvzABEwQqDChhNWE1ZDBiZmU2MzU1ZGY4OWMwNDlmY2VjMzE0ODg0NWM1MTI0NzM1MBcGCisGAQQBg78wARQECQwHcmVsZWFzZTBdBgorBgEEAYO/MAEVBE8MTWh0dHBzOi8vZ2l0aHViLmNvbS9wZWdtYS1kZXYvc3RvcmFnZS1jb3JlL2FjdGlvbnMvcnVucy80MjY3OTI5MjI5Mi9hdHRlbXB0cy8xMBYGCisGAQQBg78wARYECAwGcHVibGljMBsGCisGAQQBg78wARcEDQwLbnBtLXB1Ymxpc2gwWAYKKwYBBAGDvzABGARKDEhyZXBvOnBlZ21hLWRldkAzMDkyODYxOTMvc3RvcmFnZS1jb3JlQDEzMTI1MTk2MjM6ZW52aXJvbm1lbnQ6bnBtLXB1Ymxpc2gwgYkGCisGAQQB1nkCBAIEewR5AHcAdQDdPTBqxscRMmMZHhyZZzcCokpeuN48rf+HinKALynujgAAAaHBvR0RAAAEAwBGMEQCIBXnAtmEV8osRP8vbORyURNIwD+ChNv1sa3jhcdpDoP9AiBzoMKBwqAdbjM+Y63cI5yCzgUkxfWGUJB+fK/IaP7bBTAKBggqhkjOPQQDAwNoADBlAjAhjgCz3lboNdCuEAhrJjqHNyRTbtfvY52XD6Z7iTALfx2DTxi6p16mG7Zdfr81KwYCMQDfyHbmDEhj2z3Dsk8xXvKh1mZd5Ql7eNyEQEIXAqyzVrH2K/QBdx0BWlhkZwzAEwo=" + }, + "tlogEntries": [ + { + "logIndex": "3768594534", + "logId": { + "keyId": "wNI9atQGlz+VWfO6LRygH4QUfY/8W4RFwiT5i5WRgB0=" + }, + "kindVersion": { + "kind": "dsse", + "version": "0.0.1" + }, + "integratedTime": "1794251760", + "inclusionPromise": { + "signedEntryTimestamp": "MEYCIQDIujMOrq8VACCs9jvr8F6N4v+kwTdHJE6lCB9jCl3URAIhAIi/b8Nw4wp1Y36B0vgo37RgMuOXrt6WOij5WFeqSdWX" + }, + "inclusionProof": { + "logIndex": "3646690272", + "rootHash": "Z91PqASAwzfveDIAJgbTP8uznUfHZxpOMLp7mldF08U=", + "treeSize": "3646690415", + "hashes": [ + "c6Rn3ltHoAIECeq1V/yxbvt/lUXrj24eZgdSTf0NltI=", + "L6OBIFXo7dYNxZkHhKDKblcIf98i8bY3lXEKgwXeWcs=", + "zHSTtkEyblx9Y73zkiqDs3auJk3wWQOdqYm2upNFffg=", + "WvR2fP5xJ8v84zbuJT5fWwqQBtq46+QYKNuNEqkkeBE=", + "nnt1/0uS34Y+hNt5Wg9XpytBMSarX7W+ZyehnITXYu8=", + "sppNYqEivv1jR7s5rka3S7Yl1G6E6+IeUjAWTmaQ1Yc=", + "MkVN/+YZA6BBZG99Lf4N2ZeVQp+Q/gXzwMvThXUxLFM=", + "8Ke1jHuUSG6yeNynPaKwSfZjAd22u5EjRgTdOkhPdyI=", + "JPY/7cd5KgKUnhMA1ktuNBDVJssh/98tDVOBkT/RShg=", + "l89xh/aO2R3VFA9UjWann9JJj/razI7PEmYbwvwHAfg=", + "2b3/rfJgC1uLYviXsooia7BfEU0pioSFGXg69bUMBsw=", + "a0bNTjPvIbYH9/Lx4AhjGNPDfR/vofIvwvjVQHYS9u0=", + "msFm9WLMb9GJpgabmzuVlPemXawshg2TyjsIFeb5Pk0=", + "s7GTJsc4+4t9K+AiGiuAbBOZJS5qNf6TIXe9ZJzAe5w=", + "AsOEFPuN+npMt00/MLmA47utZEHz4azSfQa3vn6Ofc4=", + "F/vr7iFf9/B0Zxk+m8ZLFEUbZfYBBAHeo+rn6Nw0SIg=", + "AJMq9E4GYZ3BMh9NfW55EiIGiUt2ipXY2yAzLMwxIac=", + "XPex1okR3Qf1VhXr/LVSojah9cB4R1RgvK/mRrmdWLY=", + "SlixnS34BhAO+yRI2FaGPSOh9V6JSVNPfLl1bHxrcQY=", + "1DaDKzrCNNBhmSdY5vFjz+N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IjoiMzA5Mjg2MTkzIn19LCJyZXNvbHZlZERlcGVuZGVuY2llcyI6W3sidXJpIjoiZ2l0K2h0dHBzOi8vZ2l0aHViLmNvbS9wZWdtYS1kZXYvc3RvcmFnZS1jb3JlQHJlZnMvdGFncy92MC40LjUiLCJkaWdlc3QiOnsiZ2l0Q29tbWl0IjoiYTVhNWQwYmZlNjM1NWRmODljMDQ5ZmNlYzMxNDg4NDVjNTEyNDczNSJ9fV19LCJydW5EZXRhaWxzIjp7ImJ1aWxkZXIiOnsiaWQiOiJodHRwczovL2dpdGh1Yi5jb20vYWN0aW9ucy9ydW5uZXIvZ2l0aHViLWhvc3RlZCJ9LCJtZXRhZGF0YSI6eyJpbnZvY2F0aW9uSWQiOiJodHRwczovL2dpdGh1Yi5jb20vcGVnbWEtZGV2L3N0b3JhZ2UtY29yZS9hY3Rpb25zL3J1bnMvNDI2NzkyOTIyOTIvYXR0ZW1wdHMvMSJ9fX19", + "payloadType": "application/vnd.in-toto+json", + "signatures": [ + { + "sig": "MEYCIQDCl9sePCMR3Q3EZ5mjo6JXgESZcdx6oDzfbg31ygQbuQIhAM5OQUi25Ax5mhzR9aIIapOddpxDfhrv94nLXNRp2UB4", + "keyid": "" + } + ] + } + }, + "signedAccessSignatureUrl": "" +} diff --git a/tests/fixtures/release-registry/storage-dynamodb-0.4.5.tgz b/tests/fixtures/release-registry/storage-dynamodb-0.4.5.tgz new file mode 100644 index 0000000000000000000000000000000000000000..5349d1827c4b6291355bbe4dc8c45055cd550b96 GIT binary patch literal 14618 zcmV+#IpxM5iwFP!00002|LuM2cH2hMV1DB%dYGIE<vWF$op1h(pUut9C)?Yk?D^*A=EKb=56L%=9zWUK+IsS2bDMm#xwZN5$z$@( z<~Lv9XU0-D`DSzTGc0m*bCYEM|3!X|x@Y7t@My%SWjXP5kp!c0O6uMkdARxT3F*-^ zNa%hX`ZQ{g!$ZfiPH8d;7z^Tv1dNPnLN69%l(R+lF(tLW=uun4Nqp*tRuB<*Cts0ykd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lxrp18M)gY7K;x0_qBqu1H)gs}NO(Zn% zIze0m{pr|~{%IIYf|OGqFqp^;-Lf*weq+3d9Oaipj z0kvp;#Eh1ViFziT#}fS(0qMk~R)KwTr;Ku{$+^y`!l46L|!=afoKv6^19FIvjfaA z;Fgl3tTpjiUYpz`uV!u-3E!8Wu|3@pS&qa~6;RpMdSibTkXUt5IQ6+HZe6ZzEjXg(qYh5$U|R5b#xk8kQB zzoOEz{y6HMy{R8|oz8K;vqt{U|0WMNA3lK_yMu)8$Dt1<&f%eB{k7u%#{GX^@c!5B zttXp>`@gmxe!c(ii~MBKB)I?cQ=(DWe`yd3FXP;`c<`JAQA(2`@LDeTbTZ}Im0!%c z@!$c!1N8y1Nf^)9LkQ`aAvY1`1Y;wfgIrB0${;sn4PleR|7j9X){x_&*np7JjHU5J z+3R&B^zuS@ttq;0So}6^*T*!0jFjbZw`;<$v`H~`%Vf+nh~y-)o1;a(*cc7p%%{dB zK){vjOm0h{0i?$jxWgsK^XW8<7hsgCkPXwu)ZJ8gI)(6;W<;NjsT@j=D`VKJZiFh< zDniTba!`RwEqusQFpCRlba-&AA`%x2MG#jQd`;5kfjNx$!5#7@eoKOI=(LK_%^)0+ zLAW#)5wVOuF)o((ewIYwNFf5J6Xtybarw3NY06`1D$bAv471JWRAWTx1PmESDt`Js z%M?6DE20=k1kufnGZDSSiC7iOl!X1B?~sc)1}%>F$-|Dz-G(^A^?!vybjbzG4R??c zaAWhD7Qv1klgC1gM~Ey*b#lavwpnUJs`DdS#0{A(tcbC}U?pKTA&N>OZDeVr&C+-f z7ULr2OH6#vNW@116YI(if#q=!>1Y8o)gj8zUBt6=XSJXxj3wftVgqgs=<&>t8PhX! zKQI&z_mF!>qq4{r43-Z~$&eIxaRWx?fW=GT$1FxA<3J)x<;9aA8o^LkZW#F7aF?rI z9)aS?u_TU0A { expect(manifests.map(({ name, version }) => ({ name, version }))).toEqual([ { name: "@pegma/storage-core", version: "0.4.0" }, { name: "@pegma/storage-azure-tables", version: "0.4.0" }, - { name: "@pegma/storage-cloudflare-d1", version: "0.4.1" }, + { name: "@pegma/storage-cloudflare-d1", version: "0.4.6" }, { name: "@pegma/storage-dynamodb", version: "0.4.5" }, ]); for (const adapter of manifests.slice(1)) { @@ -577,7 +577,10 @@ function sourceArchive(metadata: Record): Buffer { return gzipSync(Buffer.concat([...chunks, Buffer.alloc(1024)])); } -async function preparedSchema2() { +async function preparedSchema2( + selectedDirectory: + "storage-dynamodb" | "storage-cloudflare-d1" = "storage-dynamodb", +) { const root = mkdtempSync(join(tmpdir(), "storage-schema2-")); const output = join(root, "prepared"); mkdirSync(output); @@ -593,7 +596,11 @@ async function preparedSchema2() { ); const gitCommit = run(git, ["rev-parse", "HEAD"], root); const { policy, sha256: registryPolicySha256 } = await loadReusePolicy(); - const selectedName = "@pegma/storage-dynamodb"; + const selected = RELEASE_PACKAGES.find( + ({ directory }) => directory === selectedDirectory, + ); + if (!selected) throw new Error("The selected fixture package was not found."); + const selectedName = selected.name; const packages: PreparedRecord[] = []; for (const entry of policy.packages) { // A current reuse policy can also contain the source-selected package. @@ -624,26 +631,30 @@ async function preparedSchema2() { } const metadata = JSON.parse( readFileSync( - new URL("../packages/storage-dynamodb/package.json", import.meta.url), + new URL( + `../packages/${selected.directory}/package.json`, + import.meta.url, + ), "utf8", ), ) as Record; - const sourceDirectory = join(root, "packages", "storage-dynamodb"); + const sourceDirectory = join(root, "packages", selected.directory); mkdirSync(sourceDirectory, { recursive: true }); writeFileSync( join(sourceDirectory, "package.json"), JSON.stringify(metadata), ); + // Selected bytes are unsigned parser data, not a published SDK or crypto proof. const bytes = sourceArchive(metadata), inspected = inspectReleaseTarball(bytes); const version = inspected.package.version; const releaseTag = `v${version}`; - const tarball = `pegma-storage-dynamodb-${version}.tgz`; + const tarball = `${selectedName.slice(1).replace("/", "-")}-${version}.tgz`; writeFileSync(join(output, tarball), bytes); packages.push({ name: selectedName, version, - directory: "storage-dynamodb", + directory: selected.directory, tarball, size: bytes.length, shasum: createHash("sha1").update(bytes).digest("hex"), @@ -657,16 +668,26 @@ async function preparedSchema2() { repository: "pegma-dev/storage-core", gitCommit, releaseTag, - directory: "storage-dynamodb", + directory: selected.directory, }, }); + if (packages.length !== RELEASE_PACKAGES.length) + throw new Error( + "The fixture requires one source and three genuine originals.", + ); + const orderedPackages = RELEASE_PACKAGES.map(({ name }) => { + const matching = packages.filter((record) => record.name === name); + if (matching.length !== 1) + throw new Error(`The fixture requires exactly one record for ${name}.`); + return matching[0]!; + }); const manifest: PreparedManifest = { schemaVersion: 2, repository: "pegma-dev/storage-core", gitCommit, releaseTag, registryPolicySha256, - packages, + packages: orderedPackages, }; const manifestPath = join(output, "package-manifest.json"); const save = () => @@ -869,6 +890,92 @@ describe("selected-source schema2 archives", () => { } }); + it("verifies the unsigned D1 source candidate with genuine Core040 Azure040 and Dynamo045 originals", async () => { + const f = await preparedSchema2("storage-cloudflare-d1"); + try { + const expectedManifestSha256 = createHash("sha256") + .update(readFileSync(f.manifestPath)) + .digest("hex"); + const actual = await verifyPreparedManifest(f.manifestPath, { + root: f.root, + expectedReleaseCommit: f.manifest.gitCommit, + expectedManifestSha256, + }); + expect(actual).toEqual(f.manifest); + expect( + actual.packages.map(({ name, version, publish }) => ({ + name, + version, + publish, + })), + ).toEqual([ + { name: "@pegma/storage-core", version: "0.4.0", publish: false }, + { + name: "@pegma/storage-azure-tables", + version: "0.4.0", + publish: false, + }, + { + name: "@pegma/storage-cloudflare-d1", + version: "0.4.6", + publish: true, + }, + { name: "@pegma/storage-dynamodb", version: "0.4.5", publish: false }, + ]); + expect(actual.registryPolicySha256).toBe( + createHash("sha256") + .update( + readFileSync( + new URL("../scripts/release-reuse-policy.json", import.meta.url), + ), + ) + .digest("hex"), + ); + expect(actual.packages[2]!.origin.kind).toBe("source"); + const original = actual.packages[3]!; + expect(original.origin.kind).toBe("registryReuse"); + expect(readFileSync(join(f.output, original.tarball))).toEqual( + readFileSync( + new URL( + "./fixtures/release-registry/storage-dynamodb-0.4.5.tgz", + import.meta.url, + ), + ), + ); + } finally { + rmSync(f.root, { recursive: true, force: true }); + } + }); + + it("rejects changed selected D1 exports and a Dynamo045 origin relabeled to the source candidate", async () => { + const f = await preparedSchema2("storage-cloudflare-d1"); + try { + const selected = f.manifest.packages[2]!; + const originalMetadata = structuredClone(selected.package); + selected.package = { + ...originalMetadata, + exports: { ".": "./private.js" }, + }; + f.save(); + await expect( + verifyPreparedManifest(f.manifestPath, { root: f.root }), + ).rejects.toThrow(/source/u); + selected.package = originalMetadata; + + const original = f.manifest.packages[3]!; + original.origin = { + ...original.origin, + sourceTag: f.manifest.releaseTag, + }; + f.save(); + await expect( + verifyPreparedManifest(f.manifestPath, { root: f.root }), + ).rejects.toThrow(/registry reuse origin/u); + } finally { + rmSync(f.root, { recursive: true, force: true }); + } + }); + it("rejects independent artifact-digest, current-source and policy swaps", async () => { const f = await preparedSchema2(); try { diff --git a/tests/release-registry.test.ts b/tests/release-registry.test.ts index 72f3cb1..05f0e55 100644 --- a/tests/release-registry.test.ts +++ b/tests/release-registry.test.ts @@ -27,6 +27,7 @@ import { downloadRegistryArtifact, inspectReleaseTarball, isolatedVerificationEnvironment, + loadReusePolicy, registryReuseOrigin, verifyProvenanceAudit, verifyPublishingJobs, @@ -366,6 +367,84 @@ async function historicalWriterFixture() { return { records, audit, facts, responses, fetch, policyBytes }; } +async function modernWriterFixture() { + const historical = await historicalWriterFixture(); + const { policy } = await loadReusePolicy(); + const releases = [ + ...historicalReleases, + { + name: "@pegma/storage-dynamodb", + version: "0.4.5", + directory: "storage-dynamodb", + bundle: "dynamodb045-slsa.json", + }, + ]; + expect( + policy.packages.map(({ name, version }) => ({ name, version })), + ).toEqual(releases.map(({ name, version }) => ({ name, version }))); + const records = releases.map(({ name, version, directory }) => { + const entry = policy.packages.find( + (candidate) => candidate.name === name && candidate.version === version, + ); + if (entry === undefined) throw new Error("Missing qualified reuse pin."); + const bytes = fixture(`${directory}-${version}.tgz`); + expect(bytes.length).toBe(entry.size); + expect(digest(bytes)).toBe(entry.sha256); + expect(`sha512-${digest(bytes, "sha512", "base64")}`).toBe(entry.integrity); + const inspected = inspectReleaseTarball(bytes); + expect(inspected.package.name).toBe(name); + expect(inspected.package.version).toBe(version); + return { + ...entry, + origin: registryReuseOrigin(entry), + publish: false, + tarball: `${name.slice(1).replace("/", "-")}-${version}.tgz`, + ...inspected, + }; + }); + // Genuine captured bundles behind the scripted trusted-audit boundary only. + // These unit tests do not execute npm or authenticate ECDSA/Sigstore; the + // separate qualified 0.4.5 release retains that actual cryptographic proof. + const audit = { + invalid: [], + missing: [], + verified: records.map((record, index) => ({ + name: record.name, + version: record.version, + location: `node_modules/${record.name}`, + registry: REGISTRY, + attestationBundles: [ + JSON.parse(fixture(releases[index]!.bundle).toString("utf8")), + ], + })), + }; + // All four origins are registryReuse. No future D1 source/writer identity is + // manufactured by the otherwise-unused source identity argument. + const facts = verifyProvenanceAudit(audit, records, identity, policy); + const runUrl = + "https://api.github.com/repos/pegma-dev/storage-core/actions/runs/42679292292"; + const jobsUrl = `${runUrl}/attempts/1/jobs?per_page=100`; + // Literal API responses retained by the actual qualified release verifier: + // latest run metadata is attempt 2, while its authenticated writer is in 1. + const runBytes = fixture("dynamodb045-original-run.json"); + const jobsBytes = fixture("dynamodb045-original-jobs.json"); + const run = JSON.parse(runBytes.toString("utf8")) as Record; + const page = JSON.parse(jobsBytes.toString("utf8")) as Record< + string, + unknown + >; + const responses = new Map(historical.responses); + responses.set(runUrl, run); + responses.set(jobsUrl, page); + const fetch = vi.fn(async (url: string | URL | Request) => { + const response = responses.get(String(url)); + return response + ? Response.json(response) + : new Response(null, { status: 404 }); + }); + return { records, audit, facts, policy, run, page, runUrl, jobsUrl, fetch }; +} + describe("historical three-entry registry reuse source policy", () => { it("accepts only a unique canonical historical inventory subset without inventing a future runtime pin", () => { const { policy } = historicalPolicyFixture(); @@ -846,6 +925,136 @@ describe("all authenticated historical writer observations", () => { ); }); +describe("qualified modern 0.4.5 reuse writer observations", () => { + it.each([ + { + scope: "Dynamo045 alone", + names: ["@pegma/storage-dynamodb"], + ids: [129370713574], + }, + { + scope: "all four qualified roots", + names: historicalReleases + .map(({ name }) => String(name)) + .concat("@pegma/storage-dynamodb"), + ids: [90195221537, 90750106220, 129370713574], + }, + { + scope: "the three unselected roots for a D1 source release", + names: [ + "@pegma/storage-core", + "@pegma/storage-azure-tables", + "@pegma/storage-dynamodb", + ], + ids: [90195221537, 129370713574], + }, + ])("authenticates the original groups for $scope", async ({ names, ids }) => { + const f = await modernWriterFixture(); + const facts = f.facts.filter(({ name }) => names.includes(name)); + const modern = facts.find(({ name }) => name === "@pegma/storage-dynamodb"); + if (modern === undefined) + throw new Error("Missing modern provenance fact."); + expect(modern).toMatchObject({ + version: "0.4.5", + sourceCommit: "a5a5d0bfe6355df89c049fcec3148845c5124735", + sourceTag: "v0.4.5", + runId: 42679292292, + attempt: 1, + }); + expect(f.run).toMatchObject({ + id: 42679292292, + head_sha: "a5a5d0bfe6355df89c049fcec3148845c5124735", + head_branch: "v0.4.5", + run_attempt: 2, + conclusion: "success", + }); + const jobs = await verifyPublishingJobs(facts, { fetch: f.fetch }); + expect(jobs.map(({ id }) => id).sort((a, b) => a - b)).toEqual(ids); + expect(jobs.flatMap(({ packages }) => packages).sort()).toEqual( + [...names].sort(), + ); + const writer = jobs.find(({ id }) => id === 129370713574); + expect(writer).toMatchObject({ + runId: 42679292292, + attempt: 1, + conclusion: "failure", + packages: ["@pegma/storage-dynamodb"], + stepName: "Verify and publish the prepared release", + stepStartedAt: "2026-11-09T19:15:55Z", + stepCompletedAt: "2026-11-09T19:16:34Z", + }); + expect(Date.parse(modern.certificate.validFrom)).toBe( + Date.parse("2026-11-09T19:15:58Z"), + ); + expect(Date.parse(modern.certificate.validTo)).toBe( + Date.parse("2026-11-09T19:25:58Z"), + ); + expect(jobs.map(({ id }) => id)).not.toContain(129382605514); + expect(f.fetch).toHaveBeenCalledTimes(ids.length * 2); + const requests = f.fetch.mock.calls.map(([url]) => String(url)); + expect(requests).toContain(f.runUrl); + expect(requests).toContain(f.jobsUrl); + expect(requests.some((url) => url.includes("/attempts/2/"))).toBe(false); + }); + + it("cannot rebind genuine attempt-one provenance to the successful recovery attempt", async () => { + const f = await modernWriterFixture(); + const record = f.records.find( + ({ name }) => name === "@pegma/storage-dynamodb", + ); + if (record === undefined) throw new Error("Missing modern archive."); + const rebound = { + ...record, + origin: { ...record.origin, originalRunAttempt: 2 }, + }; + expect(() => + verifyProvenanceAudit(f.audit, [rebound], identity, f.policy), + ).toThrow(/authenticated original registry invocation differs/u); + expect(f.fetch).not.toHaveBeenCalled(); + }); + + it.each(["recovery-job", "legacy-step", "certificate-window"] as const)( + "refuses a modern %s substitution instead of crediting the recovery", + async (fault) => { + const f = await modernWriterFixture(); + const job = (f.page.jobs as Array>).find( + (candidate) => candidate.name === "publish", + ); + if (job === undefined) + throw new Error("Missing original modern publisher."); + const step = (job.steps as Array>).find( + (candidate) => + candidate.name === "Verify and publish the prepared release", + ); + if (step === undefined) + throw new Error("Missing original publishing step."); + // Deliberately tampered responses for negative cases, not new API facts. + if (fault === "recovery-job") { + job.id = 129382605514; + job.run_attempt = 2; + } else if (fault === "legacy-step") { + step.name = "Publish verified prepared tarballs"; + } else { + job.started_at = step.started_at = "2020-01-01T00:00:00Z"; + job.completed_at = step.completed_at = "2020-01-01T00:01:00Z"; + } + await expect( + verifyPublishingJobs( + f.facts.filter(({ name }) => name === "@pegma/storage-dynamodb"), + { fetch: f.fetch }, + ), + ).rejects.toThrow( + fault === "certificate-window" + ? /certificate does not overlap/u + : fault === "legacy-step" + ? /original publishing step/u + : /original publisher job/u, + ); + expect(f.fetch).toHaveBeenCalledTimes(2); + }, + ); +}); + describe("publishing authority", () => { function environment(): NodeJS.ProcessEnv { return { From 0b7f5e470d68b936db835a37f22b25f7828a0ae4 Mon Sep 17 00:00:00 2001 From: Nathan Rover Date: Mon, 9 Nov 2026 15:53:54 -0500 Subject: [PATCH 4/6] [host01] Address D1 review findings and pin complete packed acceptance --- docs/RELEASING.md | 15 ++++-- packages/storage-cloudflare-d1/README.md | 4 ++ packages/storage-cloudflare-d1/src/index.ts | 24 ++++++--- tests/fixtures/release-registry/README.md | 57 +++++++++++++++++++-- 4 files changed, 84 insertions(+), 16 deletions(-) diff --git a/docs/RELEASING.md b/docs/RELEASING.md index 2b15625..86dae99 100644 --- a/docs/RELEASING.md +++ b/docs/RELEASING.md @@ -178,11 +178,16 @@ 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 resolution. Copy the existing full D1 suite, changing only its adapter import to -the bare package, and run all 141 cases against real Miniflare plus the -[public type fixture](../test/d1-public-types.ts) on Node 22 and 24 using the -[D1 test configuration](../vitest.d1.config.ts). Retain the lockfile, archive and -suite hashes, and constructor-resolution evidence. This packed proof remains -pending; source-suite passes do not satisfy it or establish live Free acceptance. +the bare package. Run every conformance case exported by published Core `0.4.0` +in both default and `readBatchSize: 512` modes and all adapter-specific cases +against real Miniflare on Node 22 and 24, with no skips, using the +[D1 test configuration](../vitest.d1.config.ts). Typecheck the +[public type fixture](../test/d1-public-types.ts) on both lanes. +Record actual case counts, the lockfile, archive and complete suite/input hashes, +and constructor-resolution evidence. Published Core's case count can differ from +the workspace suite; require the full suite from pinned inputs, not a fixed +workspace count. Source-suite +passes do not satisfy this separate packed gate or establish live Free acceptance. ## Preflight and minimal publish diff --git a/packages/storage-cloudflare-d1/README.md b/packages/storage-cloudflare-d1/README.md index d9b238e..8882e1f 100644 --- a/packages/storage-cloudflare-d1/README.md +++ b/packages/storage-cloudflare-d1/README.md @@ -104,6 +104,10 @@ 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. + Only calls that actually reach storage concurrently can coalesce. Finish asynchronous key preparation before starting a parallel read wave if the caller needs predictable batching. Sequential awaited calls remain separate. diff --git a/packages/storage-cloudflare-d1/src/index.ts b/packages/storage-cloudflare-d1/src/index.ts index 7f086b6..a99d964 100644 --- a/packages/storage-cloudflare-d1/src/index.ts +++ b/packages/storage-cloudflare-d1/src/index.ts @@ -312,7 +312,9 @@ export interface CloudflareD1StoreOptions { * Defaults to 1, retaining direct keyed reads. Must be an integer from 1 * through 512. Larger values suit bounded small records, not arbitrary rows. * - * Opt-in queues belong to this Store instance: construct it per request. + * This limits each physical batch, not the total pending queue. Opt-in + * queues belong to this Store instance and have no size limit. Callers must + * bound concurrent read waves and construct the Store per request. * No values are cached, and writes/internal optimistic reads are unchanged. */ readonly readBatchSize?: number; @@ -325,6 +327,18 @@ interface PendingRead { readonly reject: (reason: unknown) => void; } +function recordRow(row: PhysicalRow | null): RecordRow | null { + return row === null || row.deleted === 1 || row.record_json === null + ? null + : { record_json: row.record_json, version: row.version }; +} + +/** + * Batch results are positional: validate every slot and row before assigning + * any result to its caller. These runtime shape checks are opt-in only. + * Direct first() keeps its existing typed-binding behavior; + * SELECT_ONE's cast and the STRICT schema enforce these row types in real D1. + */ function batchRows( results: CloudflareD1Result[], expected: number, @@ -600,9 +614,7 @@ export function createCloudflareD1Store( async function read(key: EntityKey): Promise { const row = await readPhysical(key); - return row === null || row.deleted === 1 || row.record_json === null - ? null - : { record_json: row.record_json, version: row.version }; + return recordRow(row); } async function readForGet(key: EntityKey): Promise { @@ -610,9 +622,7 @@ export function createCloudflareD1Store( readBatchSize === 1 ? await readPhysical(key) : await queuedRead(partitionKey(key.partition), key.id); - return row === null || row.deleted === 1 || row.record_json === null - ? null - : { record_json: row.record_json, version: row.version }; + return recordRow(row); } function decodeRow(row: RecordRow): VersionedRecord { diff --git a/tests/fixtures/release-registry/README.md b/tests/fixtures/release-registry/README.md index c1d904a..53af90f 100644 --- a/tests/fixtures/release-registry/README.md +++ b/tests/fixtures/release-registry/README.md @@ -1,14 +1,15 @@ # Public registry parser fixtures -These immutable public MIT package archives were downloaded from the official npm registry. They are parser and archive test inputs, not a claim that unit tests authenticate their signatures. +These immutable public MIT package archives match the official npm registry. They are parser and archive test inputs, not a claim that unit tests authenticate their signatures. | File | Source URL | SHA256 | | ------------------------------- | ----------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | | storage-core-0.4.0.tgz | https://registry.npmjs.org/@pegma/storage-core/-/storage-core-0.4.0.tgz | 8fe21519d16f3c94f43c9477714ea08afa9b72fb4a2f0bf0b4c1b1905096a8cf | | storage-azure-tables-0.4.0.tgz | https://registry.npmjs.org/@pegma/storage-azure-tables/-/storage-azure-tables-0.4.0.tgz | bbe26f50cc60d2f45334bbd3d3455ffff7a541b84485123dfe8925e74be46a60 | | storage-cloudflare-d1-0.4.1.tgz | https://registry.npmjs.org/@pegma/storage-cloudflare-d1/-/storage-cloudflare-d1-0.4.1.tgz | 5e354776b5260d7c0342389daaeb91856022d7375d599708219d8f43786c3301 | +| storage-dynamodb-0.4.5.tgz | https://registry.npmjs.org/@pegma/storage-dynamodb/-/storage-dynamodb-0.4.5.tgz | 5bb9cbc12540dc5c3a805181ebf8c2de28d75c0bf0d0180eb0712d4a97ec05be | -Each archive includes its original package LICENSE. The three archives total 47126 bytes. +Each archive includes its original package LICENSE. The original three archives total 47126 bytes. DynamoDB 0.4.5 adds 14618 bytes, bringing the four Pegma archives to 61744 bytes. `core040-slsa.json` retains only the genuine public SLSA attestation entry from https://registry.npmjs.org/-/npm/v1/attestations/@pegma%2fstorage-core@0.4.0 (observed 2026-11-09). The original complete response SHA256 was 14a3b4cf38d4df36f50566af0fa59665f69ec36e67e22b6a4f85feab273c5c3a. No authentication headers, tokens or local paths are included. Tests explicitly stub the already-verified npm audit envelope when exercising the pure claim validator. Actual ECDSA/Sigstore authentication must still run through the unprivileged release verifier using the pinned official npm tool. @@ -21,6 +22,54 @@ Additional genuine SLSA parser fixtures (only the unique SLSA entry is retained) Signed base64 payload, certificate and transparency values are preserved unchanged. No auth headers, tokens or local paths are included. Controlled orchestration tests can present these genuine entries as scripted npm audit output to exercise downstream decisions, but that scripted command output is not an actual cryptographic verification or release qualification. The separate real Linux npm audit and public consumer gates remain mandatory. +## Qualified DynamoDB 0.4.5 fixtures + +The [0.4.5 release](https://github.com/pegma-dev/storage-core/releases/tag/v0.4.5) +retains the original prepared archives, manifest and registry-verification proof. +`storage-dynamodb-0.4.5.tgz` is a literal copy of the qualified canonical archive, +not an archive rebuilt for these tests. Its source is commit +[`a5a5d0bfe6355df89c049fcec3148845c5124735`](https://github.com/pegma-dev/storage-core/commit/a5a5d0bfe6355df89c049fcec3148845c5124735), +under signed tag `v0.4.5` (tag object +`fc5fb301fde6cb167a6f1c4c8dd59de3187c5f69`). The +[original manifest](https://github.com/pegma-dev/storage-core/releases/download/v0.4.5/package-manifest.json) +has SHA256 `57ae54d4e354b9f6e1ea851ca8ed73f213306b75afa322001339762798470dc5` +and came from original Actions artifact `13700564736`. The release also retains +[registry verification](https://github.com/pegma-dev/storage-core/releases/download/v0.4.5/registry-verification.json) +and [SHA256SUMS](https://github.com/pegma-dev/storage-core/releases/download/v0.4.5/SHA256SUMS). + +| Fixture | Public source | Current fixture file SHA256 | +| ------------------------------ | --------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | +| storage-dynamodb-0.4.5.tgz | https://registry.npmjs.org/@pegma/storage-dynamodb/-/storage-dynamodb-0.4.5.tgz | 5bb9cbc12540dc5c3a805181ebf8c2de28d75c0bf0d0180eb0712d4a97ec05be | +| dynamodb045-slsa.json | https://registry.npmjs.org/-/npm/v1/attestations/@pegma%2fstorage-dynamodb@0.4.5 | 521d74aa9b4e1762432d99ad2f1c7b5c7fa2c140ed160ba983c1a8cc133d286a | +| dynamodb045-original-run.json | https://api.github.com/repos/pegma-dev/storage-core/actions/runs/42679292292 | e7d1262d38e7c7d2ca587d35dbc2f16625f6851dd576196376f7b00dc159f9c8 | +| dynamodb045-original-jobs.json | https://api.github.com/repos/pegma-dev/storage-core/actions/runs/42679292292/attempts/1/jobs?per_page=100 | 592ce8c17ce55c17a6abc2a6487524b88ddb3bc55195b0ef1397da72bc068173 | + +`dynamodb045-slsa.json` retains the complete unique SLSA-v1 bundle object from +the actual npm 11.18.0 signature/attestation audit used for release qualification. +Its signed base64 payload, certificate, signatures, transparency entries and +timestamps are unchanged; the transparency-log index is `3768594534`. The JSON +fixtures preserve the captured objects semantically. Their formatting need not +match the original HTTP or audit serialization: the hashes above identify the +current fixture files, not the original wire responses. + +The actual original writer was run `42679292292`, **attempt 1**, job +[`129370713574`](https://github.com/pegma-dev/storage-core/actions/runs/42679292292/job/129370713574), +step `Verify and publish the prepared release`. npm accepted its write before +the bounded registry-visibility check failed. Its genuine provenance and +certificate/transparency evidence bind that accepted write to attempt 1, despite +the job's final failure. The [successful recovery attempt 2](https://github.com/pegma-dev/storage-core/actions/runs/42679292292/attempts/2) +reused the original preparation and verified all four packages with four skips +and zero new uploads; the reuse policy credits the original attempt-1 write. +The run-metadata fixture was captured after recovery and reports +attempt 2/success. The separate jobs fixture is explicitly the attempt-1 jobs +response and retains the failed physical writer. + +These genuine fixtures exercise parser, source-identity and original-writer +checks. Scripted npm output and controlled orchestration tests still do not +perform ECDSA/Sigstore verification or establish a new release, host, provider or +client qualification. Real cryptographic and consumer/backend gates remain +separate from the unit fixtures. + ## Reviewed AWS consumer root archive `aws-client-dynamodb-3.1130.0.tgz` is the genuine 249176-byte public archive from @@ -29,8 +78,8 @@ Its SHA256 is `b0f2cf96a293592e70a4b0cee40d0ef387c10b0cdc541b0c3fd99a8d4b753335` and SHA512 SRI is `sha512-yPEc9TWLY1McM6xA9wlxA9rM0ZeS8RAeyi1t7rdHPNxq0TpyCDn6z651ccRJ1RrMU4k2aiVzNCaBYUZA4aaA/w==`. The exact version and SRI match the preexisting reviewed `pnpm-lock.yaml`. -The vendor archive retains its own Apache-2.0 license; the three Pegma MIT -archives and their total above are unchanged. +The vendor archive retains its own Apache-2.0 license; the original three Pegma +MIT archives and their 47126-byte total remain unchanged. Tests supply these unchanged vendor bytes through the existing fetch seam to exercise the real consumer admission and refusal paths. Scripted npm installs From 3fffe5555af5fb948139fbbf74466658912915de Mon Sep 17 00:00:00 2001 From: Nathan Rover Date: Mon, 9 Nov 2026 15:56:54 -0500 Subject: [PATCH 5/6] [host01] Pin fixture provenance to canonical public response --- tests/fixtures/release-registry/README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/fixtures/release-registry/README.md b/tests/fixtures/release-registry/README.md index 53af90f..b5d90fe 100644 --- a/tests/fixtures/release-registry/README.md +++ b/tests/fixtures/release-registry/README.md @@ -45,11 +45,13 @@ and [SHA256SUMS](https://github.com/pegma-dev/storage-core/releases/download/v0. | dynamodb045-original-jobs.json | https://api.github.com/repos/pegma-dev/storage-core/actions/runs/42679292292/attempts/1/jobs?per_page=100 | 592ce8c17ce55c17a6abc2a6487524b88ddb3bc55195b0ef1397da72bc068173 | `dynamodb045-slsa.json` retains the complete unique SLSA-v1 bundle object from -the actual npm 11.18.0 signature/attestation audit used for release qualification. +the canonical official npm attestation response, observed 2026-11-09. The complete +response has SHA256 `b99dff0c372781bda547ab9c4a925a15a3b8bfad50c2d8472f2aaad21c537063`. +This is the release provenance authenticated by npm 11.18.0 during qualification. Its signed base64 payload, certificate, signatures, transparency entries and timestamps are unchanged; the transparency-log index is `3768594534`. The JSON -fixtures preserve the captured objects semantically. Their formatting need not -match the original HTTP or audit serialization: the hashes above identify the +fixtures preserve the public response objects semantically. Their formatting need not +match the original HTTP serialization: the hashes above identify the current fixture files, not the original wire responses. The actual original writer was run `42679292292`, **attempt 1**, job From da9744b6723a7b9c81ecf931aa7078c1b3f6627c Mon Sep 17 00:00:00 2001 From: Nathan Rover Date: Mon, 9 Nov 2026 16:04:20 -0500 Subject: [PATCH 6/6] [host01] Correct historical D1 batch accounting evidence --- docs/securityscan.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/securityscan.md b/docs/securityscan.md index 57e9da8..70bce24 100644 --- a/docs/securityscan.md +++ b/docs/securityscan.md @@ -91,7 +91,12 @@ the end. Severity scale: Critical / High / Medium / Low / Informational. larger batch than the caller wrote. Corrected 2026-07-29: D1 publishes no per-batch statement or SQL-size limit, as originally claimed here. The limit that actually binds is per Worker invocation — 1000 queries on Workers Paid, - 50 on Free — and every statement inside a batch counts against it. + 50 on Free. **Accounting correction 2026-11-09:** the July note incorrectly + counted each statement inside a batch against that budget. The current + [Cloudflare D1 limits](https://developers.cloudflare.com/d1/platform/limits/) + count one `db.batch()` call as one query against the invocation limit. + Individual statements retain their own SQL limits. The adapter's 100-action + transaction cap is a parity/robustness bound, not a platform batch limit. - **Exploitability:** Not attacker-reachable on its own; a host application would have to pass an oversized action list. The outcome is a thrown D1 error, not corruption — D1 batches are atomic. It is a robustness/parity @@ -103,9 +108,9 @@ the end. Severity scale: Critical / High / Medium / Low / Informational. - ✅ Resolved 2026-07-29 — the D1 adapter refuses more than 100 actions with a `StorageError` from the action count alone, before deriving keys, preparing statements, or touching the database, matching the Azure adapter's limit so - one action list is accepted or refused by both. The query-budget correction - noted in the evidence is recorded in the adapter comment and the package - README. + one action list is accepted or refused by both. The current query-budget + accounting is documented in the November correction above, the adapter + comment and the package README. ### 4. D1 transaction rejection inferred by substring match on error text