Skip to content
Source
Sign inSign up
pingdotgg/t3code

docs: seed worktrees with a copy of real userdata instead of banning it #4949

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/4949/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

AGENTS.md told agents to never touch ~/.t3/userdata, so worktree testing happened against empty or stale ~/.t3/dev data. An empty database is a bad test.

The rule is now "never write to it": reading and copying from the live install are explicitly fine, and the Test data section recommends snapshotting the real database into the worktree's .t3/userdata with VACUUM INTO (safe against a live source, verified against the running install on this box). The plain-cp caveats about -wal/-shm siblings and open servers remain for the offline path.

Written by Claude Fable 5 via Claude Code.

🤖 Generated with Claude Code


Note

Low Risk Documentation-only change to contributor agent rules; no runtime or security behavior in the product changes.

Overview Updates AGENTS.md so agents treat ~/.t3/userdata as read/copy OK, write forbidden, instead of broadly “don’t touch the live install.” Rule 2 now points readers to Test data for using real data safely.

The Test data section recommends seeding the worktree’s .t3/userdata from ~/.t3/userdata (preferred) or ~/.t3/dev, and adds a VACUUM INTO one-liner to snapshot SQLite while the live server still has the source open. The older “copy only from ~/.t3/dev, never userdata” guidance is removed; cp still requires closed sources and -wal/-shm siblings.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 28852a40b35047bc166add9f0e60dac5083d5695. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Seed worktree test data with copies of real userdata instead of banning it

Updates AGENTS.md to replace the blanket prohibition on using real user data in worktrees with a recommended workflow for copying it safely.

  • Clarifies that reading and copying from ~/.t3/userdata is allowed; only writing to the live install (starting a server against it, opening it read-write, or running cleanup) is prohibited.
  • Adds a step-by-step snapshot procedure using sqlite VACUUM INTO via bun to produce a consistent state.sqlite while the source database may still be open.
  • Notes that plain cp is only safe when no server has the source open, must include -wal and -shm, and that live file copies will be corrupt.
  • Clarifies that secrets/settings.json can optionally be copied in, and that symlinks must never be used.
Macroscope summarized 28852a4.
    1. Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro Plus

      Run ID: f7a82e93-fd31-415b-a626-d5d664c90c61

      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

      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
      Comment `@coderabbitai help` to get the list of available commands.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    3. Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

      Fix All in Cursor ❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot). Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 28852a40b35047bc166add9f0e60dac5083d5695. Configure [here](https://www.cursor.com/dashboard/bugbot).
      @@ -85,4 +85,12 @@
      8585
      8686 ## Test data
      8787
      88-An empty database is a bad test. Seed your worktree's `.t3` instead of pointing at live state:
      88+An empty database is a bad test. Seed your worktree's `.t3` with a copy of real data instead of pointing at live state:
      89+
      90+- Copy from `~/.t3/userdata` (the developer's real data, the most realistic test set) or `~/.t3/dev`. Worktree state lives at `<worktree>/.t3/userdata`.
      91+- Snapshot the database with `VACUUM INTO`, which is safe even while a server has the source open and yields one consistent file:
      92+
      93+ ```bash
      94+ mkdir -p .t3/userdata
      95+ rm -f .t3/userdata/state.sqlite* # VACUUM INTO refuses to overwrite
      96+ bun -e "new (require('bun:sqlite').Database)(process.env.HOME + '/.t3/userdata/state.sqlite', { readonly: true }).run(\"VACUUM INTO '.t3/userdata/state.sqlite'\")"
      cursor[bot](GitHub profile, opens in a new tab)commented

      Re-seed while dev server runs

      Medium Severity

      The snapshot recipe removes and recreates .t3/userdata/state.sqlite* in the worktree but does not say to stop the worktree’s own vp run dev first. Re-running it while that server still has the destination database open can race or leave a corrupt or inconsistent sandbox copy, unlike the plain-cp warning about an open source.

      Fix in Cursor Fix in Web
      Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 28852a40b35047bc166add9f0e60dac5083d5695. Configure [here](https://www.cursor.com/dashboard/bugbot).

Sign in to join this conversation.