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
register the new safeStorage guard in CI's structural test selection (#5689)
[._.]/ Adam Eivy715467df8d01
diff --git a/client/src/AGENTS.md b/client/src/AGENTS.mdindex 6867e98bed..a311c8c221 100644--- a/client/src/AGENTS.md+++ b/client/src/AGENTS.md@@ -14,6 +14,7 @@ These apply to React/Vite client code. Universal constraints (functional program- **Alphabetical navigation** - sidebar nav items in `Layout.jsx` are alphabetically ordered after the Dashboard+OpenWorld top section and separator; children within collapsible sections are also alphabetical- **OpenWorld's internal names match the user-facing area.** The scene tree lives under `components/openworld/`, its pure helpers are `utils/openWorld*.js`, its hooks are `useOpenWorld*.js`, and its CSS scope is `.openworld-themed`. The legacy OpenWorld command ids remain deliberately frozen because they are opaque values persisted in ⌘K history. Keep the persisted `portos-city-settings` key unchanged when adding settings migrations.- **Space is an app-global hotkey** - the voice widget binds Space for push-to-talk. A surface that owns Space itself (a timed drill, a keyer, a transport control) must claim it with `useKeyCapture` (capture phase + `stopImmediatePropagation`), or the mic opens on every press. Conversely, a global single-key handler stands down when the browser is about to activate a focused button. All three global key paths — `useKeyCapture`, `useKeyboardShortcuts`, and the voice widget's own hotkey listener — decide that through the one shared `shouldIgnoreGlobalKey(event, opts)` predicate in `lib/a11yKeyboard.js`, so a new guard goes THERE, never at one caller (that drift is what let `useKeyCapture` swallow button activation, #4748). The corollary: a surface that OWNS a key spreads `noPointerFocusSurfaceProps` on its ROOT — a mouse click that parks focus on any button inside silently takes that key over, because the global handler correctly stands down for native activation. Put it on the root, not on each button, so controls added later are covered without anyone having to remember.+- **Web Storage goes through `lib/safeStorage.js`** - `localStorage`/`sessionStorage` **throw** rather than returning null in Safari private browsing, with cookies disabled, in a sandboxed iframe, and at quota — and in several of those the object still exists, so `typeof sessionStorage === 'undefined'` is not a guard and neither is `?.` (it only covers a null base, not a throwing `getItem`). Use `safeReadStorage` / `safeWriteStorage` / `safeRemoveStorage` and their `Json` and `*Session` variants. This is not a lost-preference nit: a raw read in a **render body** is a render-phase exception that unmounts the whole route, and a raw write in an effect kills the flow mid-session (#5689). Enforced tree-wide by `client/src/storageConventions.test.js`.- **Reactive UI updates** - after mutations (delete, create, update), update local state directly instead of refetching the entire list from the server. Use `setState(prev => prev.filter(...))` or similar patterns for immediate feedback## API errors and save gatingdiff --git a/scripts/ci-test-plan.js b/scripts/ci-test-plan.jsindex 8f24c41c5c..7b94391d2a 100644--- a/scripts/ci-test-plan.js+++ b/scripts/ci-test-plan.js@@ -257,14 +257,15 @@ const structuralTestsFor = (changedFiles, trackedSet) => {// Both `.js` and `.jsx`: the StrictMode mounted-ref bug the first guard covers// reached its widest blast radius through a plain-`.js` hook (`useAsyncAction`),// so a `.jsx`-only trigger would miss the case that matters most, and the- // responsive-grid and popover-clamp guards read class strings out of both- // extensions. None of these files has a source sibling or imports an app- // module, so nothing else selects them — without this entry they only ever- // run on a full suite.+ // responsive-grid, popover-clamp, and safe-storage guards read class strings+ // and storage accesses out of both extensions. None of these files has a source+ // sibling or imports an app module, so nothing else selects them — without this+ // entry they only ever run on a full suite.if (changedFiles.some((path) => /^client\/src\/.*\.jsx?$/.test(path))) {add('client/src/hooks/mountedRefConventions.test.js');add('client/src/popoverClampConventions.test.js');add('client/src/responsiveGridConventions.test.js');+ add('client/src/storageConventions.test.js');}return selected;diff --git a/scripts/repo-scan-guards.test.js b/scripts/repo-scan-guards.test.jsindex 6732eb78c1..8350a43d3a 100644--- a/scripts/repo-scan-guards.test.js+++ b/scripts/repo-scan-guards.test.js@@ -41,6 +41,7 @@ const STRUCTURALLY_SELECTED = new Map([['client/src/hooks/mountedRefConventions.test.js', 'structuralTestsFor: client/src/**.js(x)'],['client/src/popoverClampConventions.test.js', 'structuralTestsFor: client/src/**.js(x)'],['client/src/responsiveGridConventions.test.js', 'structuralTestsFor: client/src/**.js(x)'],+ ['client/src/storageConventions.test.js', 'structuralTestsFor: client/src/**.js(x)'],// `.ps1` is not in EXECUTABLE_RE, so touching one is an "unclassified changed// file" and forces the complete suite. The guard also rides the Windows// contract list.