|
| 1 | +--- |
| 2 | +title: "No user visibility into state — the app needs a State-Inspector surface" |
| 3 | +lede: "State lives in five places (per-remote Svelte runes singletons, localStorage keys, the WS-synced workspace frames, server-side stores, the canonical DB) and none of them are inspectable from inside the app. Non-technical users won't care — but the operator debugging a desync, and the agent verifying a flow, both need one surface that shows who currently believes what." |
| 4 | +date_created: 2026-07-24 |
| 5 | +date_modified: 2026-07-24 |
| 6 | +authors: |
| 7 | + - Michael Staton |
| 8 | +augmented_with: |
| 9 | + - Claude Code on Claude Fable 5 |
| 10 | +semantic_version: 0.0.0.1 |
| 11 | +flagged_up_tree: "ai-labs/context-v/issues/State-Inspector-As-A-Universal-Need-Across-Apps.md" |
| 12 | +tags: |
| 13 | + - Issue |
| 14 | + - Oversight |
| 15 | + - Usability |
| 16 | + - Augment-It |
| 17 | + - State-Inspector |
| 18 | + - Observability |
| 19 | + - Microfrontends |
| 20 | +status: Open · Jotted |
| 21 | +--- |
| 22 | + |
| 23 | +# No user visibility into state — needs a State-Inspector |
| 24 | + |
| 25 | +## The symptom |
| 26 | + |
| 27 | +There is no way, from inside the running app, to see what the app currently |
| 28 | +believes. When something looks wrong — a stale card, a flow that mounts the |
| 29 | +wrong remote, a search rail with no launch context — the only inspection |
| 30 | +tools are DevTools spelunking (per-remote, and federation scrubs |
| 31 | +cross-origin errors) and reading localStorage by hand. |
| 32 | + |
| 33 | +## Where state actually lives here (the inspector's table of contents) |
| 34 | + |
| 35 | +1. **Per-remote Svelte 5 runes singletons** — deliberately NOT shared |
| 36 | + across federation (no `shared` block): `activeFlow` + `layout` in the |
| 37 | + shell, `searchContext` in search-and-add, and a separate |
| 38 | + `@augment-it/workspace` singleton instance in EVERY remote, each |
| 39 | + converging via WS broadcasts rather than shared memory. When they |
| 40 | + desync, nothing shows which remote believes what. |
| 41 | +2. **localStorage keys** — the cross-remount contract: |
| 42 | + `augment-it:active-flow`, `augment-it:session-token`, |
| 43 | + `augment-it:active-record-set`, `augment-it:search-request`, |
| 44 | + `augment-it:org-workbench:active-org`, per-page sort prefs, per-set idx |
| 45 | + bookmarks, mapping caches. Undocumented as a set; no registry. |
| 46 | +3. **WS-session state** — what workspace-service currently holds for this |
| 47 | + connection (active client, didi identity, pinned flag). |
| 48 | +4. **Server-side stores** — row-store record sets/rows, response-store, |
| 49 | + prompt-store; visible only through whichever remote happens to render |
| 50 | + them. |
| 51 | +5. **The canonical layer** — SurrealDB; inspectable only via scripts/MCP. |
| 52 | + |
| 53 | +## Directions (jotted, not decided) |
| 54 | + |
| 55 | +- **A State-Inspector surface** — dev-mode panel or its own small remote: |
| 56 | + dumps (1) this remote's singleton snapshots, (2) all `augment-it:*` |
| 57 | + localStorage keys parsed, (3) the current WS session frame, (4) recent |
| 58 | + cross-remote CustomEvents (a ring buffer listener on `augment-it:*`). |
| 59 | + Read-only first; editing state comes much later, if ever. |
| 60 | +- **A localStorage key registry** — even just a doc/table with owner + |
| 61 | + shape per key would halve the spelunking. |
| 62 | +- **Event tap** — the `augment-it:*` window-event namespace is the app's |
| 63 | + nervous system and completely invisible; a 50-line listener that logs |
| 64 | + the last N events with payloads would have explained most historical |
| 65 | + "why didn't it refresh" mysteries. |
| 66 | +- Composes with [[Live-Not-Live-Indicator-Tooling-And-Cross-Service-Error-Surfacing]] — |
| 67 | + liveness answers "is it up," the inspector answers "what does it think"; |
| 68 | + they may share a surface. |
| 69 | + |
| 70 | +## Flagged up the tree |
| 71 | + |
| 72 | +This is not an augment-it quirk — every ai-labs app has the same hole with |
| 73 | +different state substrates. The universal framing lives at |
| 74 | +`ai-labs/context-v/issues/State-Inspector-As-A-Universal-Need-Across-Apps.md`; |
| 75 | +this file stays the augment-it-specific instance (the five-place inventory |
| 76 | +above is this app's). |
| 77 | + |
| 78 | +## Open questions |
| 79 | + |
| 80 | +- [ ] Dev-mode-only, or shipped-but-tucked-away (the didi chat could gate a |
| 81 | + `/state` verb)? |
| 82 | +- [ ] One inspector in the shell that asks each remote to self-report (a |
| 83 | + `augment-it:state-report` request/response event pair), vs per-remote |
| 84 | + panels? |
| 85 | +- [ ] Does the WS/event ring buffer belong in `@augment-it/workspace` so |
| 86 | + every remote gets it for free? |
0 commit comments