Skip to content

refactor: remove the remaining Supabase code paths; Turso is the only remote store - #12156

Merged
dezren39 merged 2 commits into
mainfrom
claude/project-thread-tskyv1
Nov 21, 2026
Merged

dezren39 merged 2 commits into
mainfrom
claude/project-thread-tskyv1

Conversation

@dezren39

@dezren39 dezren39 commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Before: the Supabase project (muse-dev2) is deleted and every live service already runs on Turso, but the repo still carried code that could reach Supabase. That included a selectable supabase backend in the aggregator and the queue broker, a quota exporter for the deleted project, backup paths and options, a disabled mirror module, and Postgres-only helper scripts. Setting the wrong env var would point a service back at a host that no longer exists.

After: nothing in the repo can talk to Supabase, and Turso is the only remote store.

Owner's request: "fix all uses of supabase".

What changed

  • pm-aggregator
    • PM_AGG_STORE_BACKEND accepts only file or turso.
    • src/supabase.ts is deleted. The SQL helpers moved to src/sql-client.ts, and the remote stores are renamed for Turso. The SQL itself is unchanged.
    • Removed the Supabase usage-export overlay and scripts/migrate-stores-to-supabase.ts.
    • install.sh now writes PM_AGG_STORE_BACKEND=turso. It used to write supabase, which would have failed at startup.
  • pm-stack/supabase-export: removed, together with its CI step and test-registry entry.
  • fleet-queue
    • The queue broker is Turso-only. Leaving QUEUE_BROKER_BACKEND unset means turso; any other value exits 3. The deployed unit already sets turso.
    • Deleted supabase-exec.py.
  • Backups
    • Removed the laptop-backups supabase option, the disabled supabase-turso-coord-mirror module, the Supabase export in pm-dashboard-backup.sh (its opt-out is renamed PM_AGG_STORE_EXPORT), cold-store's backup-supabase, and agent-backup's Postgres-only scripts.
  • Comments: stale Supabase comments elsewhere are trimmed to describe current state.

Kept on purpose

  • The R2 bucket name supabase-backups, because live backups still write there. Renaming it is an infrastructure change.
  • Supabase as a plain vendor name in the aggregator's SaaS and charges data.
  • Dated docs, SQL migrations, and the job ids in prune_m1.sql's keep-list.
  • The supabase.muse-dev2.* entries in secrets/sops/common/bws.yaml. Removing them is a secrets change and is left for the owner.

Tests

Suite Command Before After
aggregator cd pm-stack/aggregator && bun test 2997 pass 2974 pass, 0 fail
aggregator typecheck bunx tsc --noEmit — clean
dispatch cd pm-stack/dispatch && bun test — 230 pass
fleet-queue / fleet-secrets cargo test -p fleet-queue -p fleet-secrets --all-features 447 / 29 445 / 29, all pass
cold-store-reaper pytest 206 pass 202 pass
agent-backup pytest — 2 pass
agent-backup test-backup.sh — PASS
  • Aggregator: the 23 fewer tests are exactly the removed Supabase-only tests, net of the ones added.
  • fleet-queue: the 2 fewer tests are the removed Supabase-only tests.
  • cold-store-reaper: 5 Supabase-only tests removed, 1 added.
  • nixos/home/*.test.sh: the manifest test now passes. The copy test still has the same 4 failures it had before this change; they come from running as root.
  • Other checks: bash -n and nix-instantiate --parse pass on every shell and Nix file touched.

Checked live

On the laptop, pm-aggregator and pm-dashboard-backup already run with PM_AGG_STORE_BACKEND=turso. The user journal shows no service reaching Supabase since the 2026-11-20 dispatch restart.


Generated by Claude Code


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

… remote store

The Supabase project (muse-dev2) is deleted and live services already run on
Turso. This removes what could still reach it:

- pm-aggregator: drop the `supabase` store backend and the Supabase
  Management-API client; shared SQL helpers move to src/sql-client.ts and the
  remote stores are named for Turso. Remove the Supabase usage-export overlay
  and the migrate-stores-to-supabase script. install.sh now writes
  PM_AGG_STORE_BACKEND=turso.
- Remove pm-stack/supabase-export (quota exporter for the deleted project) and
  its CI step and registry entry.
- fleet-queue: the queue broker is Turso-only; an unset QUEUE_BROKER_BACKEND
  means turso, any other value exits 3. Delete supabase-exec.py.
- Backups: drop the laptop-backups `supabase` option, the disabled
  supabase-turso-coord-mirror module, the Supabase export in
  pm-dashboard-backup, cold-store's backup-supabase, and agent-backup's
  Postgres-only scripts.
- Trim stale Supabase comments elsewhere to the current state.

Kept on purpose: the R2 bucket name `supabase-backups` (live backups write
there), vendor-name data in the aggregator, dated docs and SQL migrations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 57 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

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: af29e7ff-94bf-4baa-9286-fc0af3a20336
Commits

Reviewing files that changed from the base of the PR and between be65d89 and 4041b68.

Files selected for processing: 96

  • .github/test-suite-registry.json
  • .github/workflows/pm-stack-tests.yml
  • .opencode/opencode.jsonc
  • home/openclaw/workspace/FLEET.md
  • nixos/home/laptop-backups.nix
  • nixos/home/laptop-state-backup.md
  • nixos/home/pm-dashboard-backup-manifest.test.sh
  • nixos/home/pm-dashboard-backup.sh
  • nixos/home/supabase-turso-coord-mirror.nix
  • nixos/hosts/default.nix
  • nixos/services/pm-stack/default.nix
  • pkgs/agent-backup/README.md
  • pkgs/agent-backup/load_rows.py
  • pkgs/agent-backup/load_rows_pg.py
  • pkgs/agent-backup/run_sql.py
  • pkgs/agent-backup/run_sql_pg.py
  • pkgs/agent-backup/schema.sql
  • pkgs/agent-backup/schema2.sql
  • pkgs/agent-backup/turso_client.py
  • pkgs/cold-store-reaper/README.md
  • pkgs/cold-store-reaper/cold_store.py
  • pkgs/cold-store-reaper/scripts/nightly-backup.sh
  • pkgs/cold-store-reaper/tests/test_cold_store.py
  • pkgs/cold-store-reaper/tests/test_nightly_backup.py
  • pkgs/fleet/crates/fleet-queue/src/backoff.rs
  • pkgs/fleet/crates/fleet-queue/src/client.rs
  • pkgs/fleet/crates/fleet-queue/src/client/support.rs
  • pkgs/fleet/crates/fleet-queue/src/fallback.rs
  • pkgs/fleet/crates/fleet-queue/src/queue_broker.rs
  • pkgs/fleet/crates/fleet-queue/src/turso_queue.rs
  • pkgs/fleet/crates/fleet-queue/src/turso_queue/lifecycle.rs
  • pkgs/fleet/crates/fleet-queue/src/turso_queue/stacks_outbox.rs
  • pkgs/fleet/crates/fleet-secrets/src/lib.rs
  • pkgs/fleet/fleet-fetch.py
  • pkgs/fleet/supabase-exec.py
  • pkgs/github-ci/worker/README.md
  • pkgs/github-ci/worker/scripts/prune-ci-events.py
  • pkgs/github-ci/worker/src/index.ts
  • pkgs/github-ci/worker/wrangler.toml
  • pm-stack/aggregator/README.md
  • pm-stack/aggregator/install.sh
  • pm-stack/aggregator/scripts/collect-fleet-feed.ts
  • pm-stack/aggregator/scripts/gather-quota.ts
  • pm-stack/aggregator/scripts/generate-digest.ts
  • pm-stack/aggregator/scripts/migrate-stores-to-supabase.ts
  • pm-stack/aggregator/src/aa-last-good.ts
  • pm-stack/aggregator/src/aa.ts
  • pm-stack/aggregator/src/alerts.ts
  • pm-stack/aggregator/src/config.ts
  • pm-stack/aggregator/src/feed.ts
  • pm-stack/aggregator/src/model.ts
  • pm-stack/aggregator/src/orchestration-db.ts
  • pm-stack/aggregator/src/remote-stores.ts
  • pm-stack/aggregator/src/saas-extract.ts
  • pm-stack/aggregator/src/server.ts
  • pm-stack/aggregator/src/sources/live.ts
  • pm-stack/aggregator/src/sql-client.ts
  • pm-stack/aggregator/src/store-backend.ts
  • pm-stack/aggregator/src/supabase.ts
  • pm-stack/aggregator/src/turso-stores.ts
  • pm-stack/aggregator/test/aa-gate-5289.test.ts
  • pm-stack/aggregator/test/aa.test.ts
  • pm-stack/aggregator/test/alerts.test.ts
  • pm-stack/aggregator/test/attention-no-fixtures-1116.test.ts
  • pm-stack/aggregator/test/charges-feed-gate.test.ts
  • pm-stack/aggregator/test/cloudflare-export.test.ts
  • pm-stack/aggregator/test/feed-attention-filter-2427.test.ts
  • pm-stack/aggregator/test/gather-quota.test.ts
  • pm-stack/aggregator/test/live-usage-snapshots.test.ts
  • pm-stack/aggregator/test/notifications.test.ts
  • pm-stack/aggregator/test/orchestration-db.test.ts
  • pm-stack/aggregator/test/phase3-boundaries.test.ts
  • pm-stack/aggregator/test/saas-extract-surrogate-7743.test.ts
  • pm-stack/aggregator/test/saas-feed-gate.test.ts
  • pm-stack/aggregator/test/store-remote-backends.test.ts
  • pm-stack/aggregator/test/supabase-export.test.ts
  • pm-stack/aggregator/test/turso-stores.test.ts
  • pm-stack/dispatch/install.sh
  • pm-stack/dispatch/src/config.ts
  • pm-stack/dispatch/src/queue.ts
  • pm-stack/dispatch/test/config.test.ts
  • pm-stack/dispatch/test/dispatch_preexisting.test.ts
  • pm-stack/dispatch/test/server.test.ts
  • pm-stack/external-comms/README.md
  • pm-stack/external-comms/record-external-send
  • pm-stack/meta-exporter/meta-quota-export.test.mjs
  • pm-stack/shared-schema/README.md
  • pm-stack/shared-schema/test-migration.sh
  • pm-stack/shared-schema/test-orchestration-migration.sh
  • pm-stack/supabase-export/README.md
  • pm-stack/supabase-export/install-laptop.sh
  • pm-stack/supabase-export/supabase-quota-export.mjs
  • pm-stack/supabase-export/supabase-quota-export.service
  • pm-stack/supabase-export/supabase-quota-export.test.mjs
  • pm-stack/supabase-export/supabase-quota-export.timer
  • pm-stack/systemd/pm-dispatch.service
  • 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

@dezren39
dezren39 marked this pull request as ready for review November 21, 2026 04:22
@dezren39
dezren39 requested a review from a team as a code owner November 21, 2026 04:22
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T05:55:38.211494Z 4041b68 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: be0d2b9f34

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

# DB-backup class (DESIGN.md section 5): nightly dumps live unbundled under
# db-backups/<db>/, one subfolder per database.
BACKUP_DBS = ("supabase", "turso", "d1")
BACKUP_DBS = ("turso", "d1")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve access to historical backup families

On installations with existing db-backups/supabase/ filings in Google Drive, removing this family from BACKUP_DBS disables retrieval of those historical dumps: both the CLI parser and get_backup() reject the family before reading Drive. It also hides those backups from default listings and excludes them from nightly retention. Retiring Supabase ingestion does not require disabling access to already-created backups; retain the legacy family for retrieval and retention without restoring any Supabase connection code.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point. Removing supabase from BACKUP_DBS has two effects on the dumps already filed under db-backups/supabase/ in Drive:

  • the tool can no longer list or retrieve them;
  • nightly retention no longer prunes them.

Nothing is deleted. The files are still in Drive and can be fetched there directly.

This is marked optional, so I'm not pushing for it alone. If this PR gets another push, I'll add supabase back as a read-only legacy family covering list, get and prune, with no Supabase connection code.


Generated by Claude Code

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 4041b68. supabase is back as a read-only legacy family (LEGACY_BACKUP_DBS): list-backups, get-backup and prune-backups still see db-backups/supabase/ when it exists. put-backup rejects it, and ensure-folders finds the folder but never creates it. Two new tests cover a fresh install and an install with old dumps. The cold-store suite passes (204 tests).


Generated by Claude Code

Merge origin/main into the Supabase removal branch (one conflict in
collect-fleet-feed.ts: main's project-board code kept, AA wording moved
to Turso).

Supabase stays a read-only legacy backup family: list-backups,
get-backup and prune-backups still see db-backups/supabase/ where it
exists, so old dumps stay retrievable and under retention. Nothing new
is filed there and fresh installs never create the folder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dezren39
dezren39 merged commit 0cf3e6d into main Nov 21, 2026
2 checks passed
@dezren39
dezren39 deleted the claude/project-thread-tskyv1 branch November 21, 2026 06:02
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.

2 participants