Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
docs: capture review lessons in CLAUDE.md + backup excludes comment
[._.]/ Adam Eivy717bf1ea898a
diff --git a/CLAUDE.md b/CLAUDE.mdindex b53365c059..22b5b1bb6a 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -157,6 +157,8 @@ When working **directly in the Claude Code TUI** with the user driving, edit the- Arrays/objects: gate on `Array.isArray(parsed?.field)` / `typeof parsed?.field === 'object'` before deciding to fall back to the original.- Keep server-side merges and the client's `pick` helpers mirrored — a one-sided change breaks the round-trip.- **Schema parity when adding fields.** When you add a field to a sanitizer, `createXxx`, or a payload shape, update the corresponding Zod schema (`server/lib/aiToolkit/validation.js` for toolkit shapes, `server/lib/validation.js` for PortOS routes) in the same change. Wire validation into POST and PUT (PUT can use `schema.partial()`); the PortOS convention is *all* inputs validated. Tolerate UI sentinels (`endpoint: ''` for CLI providers) with `z.preprocess(v => v === '' ? undefined : v, …)`. When a service migrates legacy keys on read, the schema must still accept the legacy shape so older clients don't 400 before the migration runs.+- **Silent vs. toasting API requests.** The `request()` helper in `client/src/services/apiCore.js` toasts errors by default. When a caller already owns its own error UI — either via `useAsyncAction` (which toasts on throw) or a `.catch(() => fallback)` that intentionally swallows the failure — pass `{ silent: true }` to the API helper so the toast only fires from one layer. Add an `options` parameter to new API wrappers so callers can opt into silent mode.+- **"Run Now" actions must gate on saved state, not the form input.** When a settings page has a companion "Run this now" button that triggers a server action reading server-side settings (not the local form values), the button must be gated on the *saved* value, not the in-memory input. Track a parallel `saved*` state for each setting the action depends on, update it on successful save, and use it for the action's enabled gate. Disable the action while the form is dirty *or* a save is in flight — a tooltip-only warning is missed on touch and produces surprising "I edited X and ran, but X didn't apply" bugs.## Tailwind Design Tokensdiff --git a/server/services/backup.js b/server/services/backup.jsindex 809195bf48..42f7f1bd04 100644--- a/server/services/backup.js+++ b/server/services/backup.js@@ -23,7 +23,11 @@ const STATE_PATH = join(PATHS.data, 'backup', 'state.json');// Paths under data/ that are always skipped on top of user-configured excludes.// Browser profile is a CDP cache that can grow to several GB; worktrees are-// throwaway agent checkouts of the main repo.+// throwaway agent checkouts of the main repo. When adding a new entry, ensure+// the path glob covers *every* on-disk location for that class of data —+// e.g. agent worktrees live under both cos/worktrees/ and+// cos/feature-agents/*/worktree/; cross-reference worktreeManager.js and+// agentLifecycle.js if introducing new worktree paths.export const DEFAULT_EXCLUDES = [{ path: 'browser-profile/', reason: 'Browser CDP profile — cache/cookies, can be several GB' },{ path: 'cos/worktrees/', reason: 'Ephemeral agent git worktrees — recreated on demand' },