fix: restore D1 query-count collection#1975
Conversation
|
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-playground | e24b6c8 | Jul 12 2026, 11:03 AM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-demo-do | e24b6c8 | Jul 12 2026, 11:03 AM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-demo-cache | e24b6c8 | Jul 12 2026, 11:03 AM |
There was a problem hiding this comment.
This PR takes the right approach to two related problems: it restores real-D1 query-count collection by isolating Core's runtime bundle validation from the Node-only Sigstore verifier, and it hardens the harness with integrity guards. The changes are surgical, well-scoped, and consistent with the repo's conventions.
What I checked:
- The new
@emdash-cms/registry-verification/bundleexport is correctly wired inpackage.json, built separately asplatform: "neutral", and imported only by Core's marketplace code. Other consumers (plugin CLI) continue to use the full Node index entry, which is correct. bundle.tsitself references onlymodern-tarand plugin-types; the packed-output check guards againstcreateRequireand@sigstoreleaking into the bundle artifact.- The stream-end marker is now emitted after
flushRecorder(), so the integrity fence sits after the per-query log lines as intended. - The query-count harness fails closed on non-2xx responses, detects missing/duplicate stream-end markers, and verifies that recorded query-event counts match the snapshot's
dbCount. Hailing/search?q=staticnormalizes consistently between the route list and recorderurl.pathname. stopChild()switches from"exit"to"close"and still escalates toSIGKILLon timeout, which is a cleaner shutdown for piped processes.- Seed data contains the fixture slugs (
development,webdev,about,building-for-the-long-term), so the measured routes should return 200. - Changeset coverage is addressed via the existing
canonical-bundle-verification.mdchangeset on the integration branch.
No blocking issues or AGENTS.md violations found. The code is genuinely clean.
What does this PR do?
Restores the real-D1 query-count run after the bundled Sigstore verifier introduced Node-only code into Core's Worker path. Core now imports a dedicated runtime-neutral bundle-validation entry, while the query harness fails closed on non-2xx responses, missing or duplicate route-phase markers, truncated query logs, and empty measurements.
Supports #1908.
Type of change
Checklist
pnpm typecheckpassespnpm lintpassespnpm testpasses (or targeted tests for my change)pnpm formathas been runAI-generated code disclosure
Screenshots / test output
pnpm buildpnpm typecheckpnpm lint:jsonpnpm test:query-counts(5 tests)Try this PR
Open a fresh playground →
A full working EmDash site, deployed from this branch. Each visit gets its own session-scoped sandbox: no login needed and no shared state. Try the admin, edit content, hit the public site.
Tracks
feat/delegated-release-service-15-d1-query-guard. Updated automatically when the playground redeploys.