- The app's runtime database lives under Electron
userData, not under the git worktree. Do not assume the default profile when working across branches. - Use
task worktree:profile:pathto get this branch's isolated profile path. It resolves to.task/user-data/<current-branch>by default. - Use
task worktree:upto start the app against that isolated profile. - Use
task worktree:profile:clean FORCE=1to delete this branch's isolated profile after quitting the app. - Use
task db:worktree:copy FROM=defaultto copysessions.dbfrom the platform default profile into this branch profile. PassFROM=branch:<name>to copy from another branch profile, including branch names with/. Use an absolute path,./relative/path,~/path, orFROM=path:<path>for explicit filesystem paths. PassFORCE=1if the target DB already exists. - Use
task db:worktree:doctorafter copying or when local task runs fail. It compares the targetsessions.dbschema version and schema ID against the current checkout'ssrc/main/sessions/schema-manifest.json. - If the app was launched with
AGB_USER_DATA_DIR, runtask agent:runwith the sameAGB_USER_DATA_DIR. The local task runner reads<userData>/local-task-server.json; pointing the CLI at a different profile will miss the running app even ifsessions.dbis valid. - Quit the app before copying or cleaning profile files. SQLite WAL files and Electron runtime files can be open while the app is running.
DB_SCHEMA_VERSIONgates migrations at runtime.src/main/sessions/schema-manifest.jsontracks the expected fresh schema ID for CI/main drift detection.- Run
task db:schema:checkafter touchingSessionDbmigrations. - Run
task db:schema:updateonly after an intentional schema change.