Skip to content

feat(desktop): ship without accounts by default - #76

Merged
siracusa5 merged 1 commit into
mainfrom
c/disable-accounts-supabase
Jul 30, 2026
Merged

feat(desktop): ship without accounts by default#76
siracusa5 merged 1 commit into
mainfrom
c/disable-accounts-supabase

Conversation

@siracusa5

Copy link
Copy Markdown
Collaborator

Stacked on #75 — targets that branch, and GitHub will retarget it to main when #75 merges. Review #75 first.

Summary

Packaged builds no longer contain sign-in. CC_ACCOUNTS=1 brings it back. Nothing is deleted — all auth and settings-sync code, migrations and tests remain and still run in CI. Only the packaging default changed.

The hosted project had zero rows in user_settings, so this strands nobody.

Why

The account system works. The problem is what it can legally carry. scrubSettings replaces command, args, path, dir, anything holding an absolute path, and anything secret-shaped with markers before upload. So what actually crosses machines is a preference blob and a set of profile shapes with holes in them, which you re-point by hand on the second Mac.

That's a thin return for:

  • 2,171 lines of auth + sync code and tests
  • two SQL migrations, a schema, RLS policies, an account-deletion RPC
  • a hosted Postgres holding user rows in a product whose claim is that context stays on your machine
  • the only open release gate in the repo

It was also the single thing making "your data stays local" need an asterisk. For a local-first product, no account required is the stronger trust signal.

The stated justification was a hook for entitlements. Packs shipped as a free preview with payments dormant behind paymentsLive — nothing is being entitled. And when sync is genuinely wanted, the better version rides git-core.mjs/git-sync.mjs against the user's own repo: infrastructure this project already owns and maintains for team sync, with no hosted service and no asterisk.

Mechanics

Change Why
generate-supabase-config.mjs writes {"accounts":"disabled"} unless CC_ACCOUNTS=1 No credentials needed to build. The file is still written — electron-builder treats a missing extraResources source as a build failure, and "off" should be a state the app reads, not infers from absence.
loadSupabaseConfig treats that marker as authoritative over userData and env The marker describes the artifact users downloaded. A stale VITE_SUPABASE_* in someone's shell must not quietly switch sign-in back on in a shipped build. npm run dev never generates a packaged config, so dev still resolves from env.
Renderer hides the Account pane instead of showing it empty An Account tab that opens onto "sign-in isn't configured" advertises a feature the build doesn't have. Availability rides existing static launch metadata, so the pane is absent on first paint rather than appearing and then emptying.
Release workflow stops passing Supabase secrets Nothing consumes them.

Closes the #44 gate

By not shipping the thing that needed validating. docs/release-gates.md moves #44 to ## Closed: — which also unblocks the release guard added in #75 — and keeps the record of what shipped unvalidated, plus the three manual checks, which come due again on any CC_ACCOUNTS=1 build.

Test plan

  • engine npm test — exit 0
  • console — 126 tests, tsc --noEmit clean, build + build:live
  • desktop — 37 tests (auth and settings-sync suites unchanged and still passing), test:navigation, test:cli-status, npm run smokeSMOKE OK
  • site — npm run build + install-page verification
  • npm run supabase:config with no env → {"accounts":"disabled"}, exit 0
  • New coverage: disabled-by-default, env cannot re-enable a disabled build, CC_ACCOUNTS=1 still rejects missing/secret/non-HTTPS credentials, Account pane hidden when accounts are off
  • Release-gate guard now passes (no ## Open: section remains)
  • check-dco.sh — 5 commits signed off

Reversing this

CC_ACCOUNTS=1 SUPABASE_URL=… SUPABASE_ANON_KEY=… npm run dist, then clear the acceptance checks in docs/release-gates.md before distributing.

🤖 Generated with Claude Code

@siracusa5

Copy link
Copy Markdown
Collaborator Author

Note on the empty checks list: ci.yml triggers only on pull_request: branches: [main], and this PR targets c/context-cake-next-steps-bbef54. So no CI runs here yet — that is structural, not a failure.

Once #75 merges and this retargets to main, the full suite runs automatically. Everything was verified locally in the meantime:

  • engine npm test exit 0
  • console 126 tests + typecheck + build + build:live
  • desktop 37 tests + navigation + cli-status + SMOKE OK
  • site build + install-page verification

@siracusa5
siracusa5 changed the base branch from c/context-cake-next-steps-bbef54 to main July 30, 2026 06:13
Packaged builds no longer contain sign-in. `CC_ACCOUNTS=1` brings it back;
nothing is deleted.

The hosted account system works. The problem is what it can legally carry.
`scrubSettings` replaces `command`, `args`, `path`, `dir`, anything holding
an absolute path and anything secret-shaped with markers before upload, so
what actually crosses machines is a preference blob and a set of profile
shapes with holes in them that you re-point by hand on the second Mac.

That is a thin return for a hosted Postgres holding user rows in a product
whose claim is that context stays on your machine — and it was the only
thing making that claim need an asterisk. The stated justification was a
hook for entitlements; Packs shipped as a free preview with payments
dormant behind paymentsLive, so nothing is being entitled yet. When sync is
wanted for real, the better version rides git-core.mjs/git-sync.mjs against
the user's own repo, which is infrastructure this project already owns.

The hosted project had zero rows in user_settings, so disabling stranded
nobody.

Mechanics:

  - generate-supabase-config.mjs writes {"accounts":"disabled"} unless
    CC_ACCOUNTS=1, and needs no credentials to do it. The file is still
    written because electron-builder treats a missing extraResources source
    as a build failure, and because "off" should be a state the app reads
    rather than infers from an absent file.
  - loadSupabaseConfig treats that marker as authoritative over both
    userData and the environment. The marker describes the artifact users
    downloaded, so a stale VITE_SUPABASE_* in someone's shell must not
    quietly switch sign-in back on. `npm run dev` never generates a packaged
    config, so development still resolves from env.
  - The renderer hides the Account pane rather than showing it empty. An
    Account tab that opens onto "sign-in isn't configured" advertises a
    feature the build does not have. Availability rides the existing static
    launch metadata so the pane is absent on first paint.
  - The release workflow stops passing Supabase secrets.

This closes the #44 gate by not shipping the thing that needed validating.
The three manual acceptance checks stay written down in
docs/release-gates.md and come due again on any CC_ACCOUNTS=1 build.

All auth and settings-sync code, migrations and tests remain and still run
in CI. Only the packaging default changed.

Signed-off-by: John Siracusa <siracusa5@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
@siracusa5
siracusa5 force-pushed the c/disable-accounts-supabase branch from ee125f4 to 6a83002 Compare July 30, 2026 06:18
@siracusa5
siracusa5 merged commit 255974d into main Jul 30, 2026
8 checks passed
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.

1 participant