Skip to content

voice-line: point the ledger at D1 via d1-gateway (#16852) — DO NOT MERGE until the gateway token arrangement lands - #16878

Open
developing-today-fleet[bot] wants to merge 3 commits into
mainfrom
archer/16852-voice-line-flip
Open

developing-today-fleet[bot] wants to merge 3 commits into
mainfrom
archer/16852-voice-line-flip

Conversation

@developing-today-fleet

@developing-today-fleet developing-today-fleet Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

What this is

The #16852 voice-line-ledger flip, prepared under the #14866 Cloudflare migration programme (Drew's proceed order, 2026-11-29). The change is exactly one line in each of three files: the ledger client's TURSO_URL moves from the Turso database to the d1-gateway route for the D1 namesake —

  • pm-stack/voice-line-worker/wrangler.toml (the [vars] value)
  • pm-stack/voice-line-worker/cloudflare.config.ts (the text binding)
  • pm-stack/voice-line-worker/ci/deployment-config.check.mjs (the deployment contract assertion)

https://voice-line-ledger-dezren39.aws-us-east-1.turso.io → https://d1-gateway.developing-today.workers.dev/db/voice-line-ledger

No ledger code changes: the d1-gateway serves the Turso pipeline protocol over D1 (the #15611 pattern).

State of the migration (evidence on #16852)

  • D1 schema created with the Worker's own ensureSchema definitions (kickoff, 2026-11-29).
  • Row copy DONE and verified 2026-11-29 (delta_to_d1.py from the laptop seat): sessions 3 rows, status_snapshots 1 row; D1 read-back via the cf CLI matches the Turso source counts exactly.
  • The d1-gateway is live and routes voice-line-ledger; an unknown token is refused (Unauthorized), as expected pre-arrangement.

DO NOT MERGE / DEPLOY until the token arrangement lands

The gateway accepts a client token only when its SHA-256 is listed for the database in pkgs/d1-gateway/worker/wrangler.jsonc (TOKEN_SHA256), and the voice-line-ledger list is currently empty. The voice-line Worker's current TURSO_TOKEN is not retrievable from any seat (Worker/GitHub-environment secret, write-only), so its hash cannot be computed from here. Deploying this URL change before the arrangement would break ledger writes.

Completion sequence, in order:

  1. Set a fresh voice-line-ledger Turso token as the Worker's TURSO_TOKEN secret, escrowed in the fleet secrets broker by name (turso.voice-line-ledger-token), and add its SHA-256 to TOKEN_SHA256["voice-line-ledger"] in the gateway config; the gateway deploy workflow ships that on merge.
  2. Refresh-at-flip: re-run delta_to_d1.py (the Worker keeps writing to Turso until the promote).
  3. Merge this PR, dispatch the voice-line upload workflow, then the promote workflow — both environments require an independent reviewer's approval by design (prevent_self_review), so the deploy steps are Drew-approved in GitHub.
  4. Verify live: a real call's session row read back from D1 via cf d1 query; then retire the Turso database and record final counts on small live Turso stores to D1: voice-line-ledger and notes-submissions (#14866) #16852.

Rollback at any point before step 3: the Turso database is untouched by every step above; after a promote, rollback is promoting the previous version.

Refs #16852, #14866. Prepared by Archer, 2026-11-29.


Get evidence
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@coderabbitai

coderabbitai Bot commented Nov 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b7448540-f998-4feb-bcd8-5b576b46dc81

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants