fix: pin all app state under ~/.ao, never ~/Library (#369)
Electron's main process set app.setName(...) but never overrode userData, so Chromium runtime state (cache, cookies, local/session storage, crash dumps) defaulted to ~/Library/Application Support/<name>. Older dev builds also wrote the daemon DB there. Pin userData to ~/.ao/electron so the entire app footprint lives under the canonical AO home alongside the daemon data dir and running.json; sessionData and crashDumps derive from userData, so the single override reparents them all. Document the ~/.ao-only rule as a hard boundary in AGENTS.md and CLAUDE.md. Closes #368 Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
36ea5835e7
commit
2155c3cfaa
|
|
@ -86,6 +86,7 @@ For code entry points:
|
||||||
- Keep generated OpenAPI/API DTO drift in mind: controller response shapes live in `backend/internal/httpd/controllers/dto.go` and tests may assert CLI/HTTP wire compatibility.
|
- Keep generated OpenAPI/API DTO drift in mind: controller response shapes live in `backend/internal/httpd/controllers/dto.go` and tests may assert CLI/HTTP wire compatibility.
|
||||||
- Do not add network calls to tests unless the package already has an integration/e2e pattern for them. Prefer `httptest`, fakes, and injected dependencies.
|
- Do not add network calls to tests unless the package already has an integration/e2e pattern for them. Prefer `httptest`, fakes, and injected dependencies.
|
||||||
- Do not commit local run state, daemon data, temporary worktrees, build outputs, or credentials.
|
- Do not commit local run state, daemon data, temporary worktrees, build outputs, or credentials.
|
||||||
|
- All app state lives under `~/.ao` only. The daemon's data dir, `running.json`, worktrees, and the Electron supervisor's `userData` (Chromium cache, cookies, local/session storage, crash dumps) must resolve under `~/.ao` (overridable via `AO_DATA_DIR`/`AO_RUN_FILE`). Never write to or read from `~/Library/Application Support` or any other OS default app-data location. `main.ts` pins Electron's `userData` to `~/.ao/electron`; do not remove that override or rely on Electron's default path.
|
||||||
|
|
||||||
## API contract changes
|
## API contract changes
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,15 @@
|
||||||
|
|
||||||
Read and follow [`AGENTS.md`](AGENTS.md) for repository layout, commands, coding conventions, and hard rules.
|
Read and follow [`AGENTS.md`](AGENTS.md) for repository layout, commands, coding conventions, and hard rules.
|
||||||
|
|
||||||
|
## App state lives under `~/.ao` only
|
||||||
|
|
||||||
|
All app state, the daemon's data dir, `running.json`, worktrees, and the Electron
|
||||||
|
supervisor's `userData` (Chromium cache, cookies, local/session storage, crash
|
||||||
|
dumps), must resolve under `~/.ao` (overridable via `AO_DATA_DIR`/`AO_RUN_FILE`).
|
||||||
|
Never write to or read from `~/Library/Application Support` or any other OS-default
|
||||||
|
app-data location. `frontend/src/main.ts` pins Electron's `userData` to
|
||||||
|
`~/.ao/electron`; do not remove that override. See the hard rule in `AGENTS.md`.
|
||||||
|
|
||||||
## Design System
|
## Design System
|
||||||
|
|
||||||
Always read [`DESIGN.md`](DESIGN.md) before making any visual or UI decision —
|
Always read [`DESIGN.md`](DESIGN.md) before making any visual or UI decision —
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,14 @@ declare const MAIN_WINDOW_VITE_NAME: string;
|
||||||
// Must run before app ready so the About panel and default-menu role labels use it.
|
// Must run before app ready so the About panel and default-menu role labels use it.
|
||||||
app.setName("Agent Orchestrator");
|
app.setName("Agent Orchestrator");
|
||||||
|
|
||||||
|
// Pin ALL Electron-owned state (Chromium cache, cookies, local/session storage,
|
||||||
|
// crash dumps) under the canonical AO home at ~/.ao instead of Electron's macOS
|
||||||
|
// default ~/Library/Application Support/<name>. Keeps the app's entire footprint
|
||||||
|
// inside ~/.ao alongside the daemon's data dir and running.json. sessionData and
|
||||||
|
// crashDumps derive from userData, so this one override reparents them all.
|
||||||
|
// Must run before app ready.
|
||||||
|
app.setPath("userData", path.join(os.homedir(), ".ao", "electron"));
|
||||||
|
|
||||||
let mainWindow: BrowserWindow | null = null;
|
let mainWindow: BrowserWindow | null = null;
|
||||||
let daemonProcess: ChildProcessWithoutNullStreams | null = null;
|
let daemonProcess: ChildProcessWithoutNullStreams | null = null;
|
||||||
let daemonStoppingProcess: ChildProcessWithoutNullStreams | null = null;
|
let daemonStoppingProcess: ChildProcessWithoutNullStreams | null = null;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue