Skip to content

chore(scripts): make onboarding reset/restore build-kind aware - #384

Closed
pnewsam wants to merge 1 commit into
stagingfrom
paul/build-kind-aware-onboarding-scripts
Closed

chore(scripts): make onboarding reset/restore build-kind aware#384
pnewsam wants to merge 1 commit into
stagingfrom
paul/build-kind-aware-onboarding-scripts

Conversation

@pnewsam

@pnewsam pnewsam commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Split out from #383.

Problem

Since ENG-324, each build kind keeps its state (incl. the SQLite DB) in a separate home. The reset-onboarding.sh / restore-onboarding.sh scripts only touched ~/.cowork (prod), so resetting onboarding while testing a dev/preview build left that build's real DB untouched.

Fix

Made both scripts build-kind aware. They now:

  • take a build-kind argument (default dev) and target the matching config home,
  • back up/restore the whole config home (the .env now lives inside it),
  • neutralize the legacy ~/.anton migration sources so they can't silently re-seed a "fresh" home.
./scripts/reset-onboarding.sh            # ~/.cowork-dev (default)
./scripts/reset-onboarding.sh preview    # ~/.cowork-preview
./scripts/reset-onboarding.sh prod       # ~/.cowork

QA

  1. ./scripts/reset-onboarding.sh (dev) → confirm ~/.cowork-dev state is cleared while ~/.cowork (prod) is untouched
  2. npm run dev, accept terms → reach the "LOADING WORLD" setup screen (fresh onboarding)
  3. ./scripts/restore-onboarding.sh to restore

Notes

  • Base is staging: the build-kind isolation these scripts depend on lives on staging, not main.
  • Shell-script-only change; no runtime code touched.

🤖 Generated with Claude Code

Since ENG-324, each build kind keeps its state in a separate config home
so builds never share a SQLite DB (~/.cowork-dev, ~/.cowork-preview,
~/.cowork-stable, ~/.cowork for prod). The reset/restore scripts only ever
touched ~/.cowork (prod), so resetting onboarding while testing a dev or
preview build left the DB that build actually reads untouched.

- Accept a build-kind argument (default: dev) and target the matching home.
- Back up/restore the whole config home (DB, .env, state.json, projects,
  data vault) — the .env now lives inside the home, not ~/.anton.
- Move aside the legacy ~/.anton/.env and ~/.anton/cowork/state.json so
  migrateLegacyHome() can't silently re-seed credentials/provider choice
  into the fresh home and defeat the reset.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@pnewsam

pnewsam commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #385, which folds these build-kind-aware onboarding scripts into the broader developer-platform channel work (canonical channel model, stable→staging rename, preview→staging API fix, complete per-channel data isolation). Closing in favor of #385.

@pnewsam pnewsam closed this Jul 10, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant