docs(13): follow-on scope proposal — CSP collision, unbuilt AIUI-02/05, nostr+zaps

Drafted during 13-15 device verification from what the operator actually hit:
the 13-09 CSP blocks wss:// relays and enrichment from the embed (real
regression, needs a broker-vs-widen decision), /api/tmdb and /api/web-search
are unimplemented on the node, AIUI-02 and AIUI-05 were declared but never
planned, and nostr polish + zaps were explicitly deferred by 13-CONTEXT.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
archipelago
2026-08-06 14:13:27 -04:00
co-authored by Claude Fable 5
parent 706c33acaf
commit c3277a8323
@@ -0,0 +1,107 @@
# Follow-on scope proposal — AIUI beyond Phase 13
Drafted 2026-08-06 during 13-15 on-device verification, from what the operator actually hit.
**Nothing here is scheduled.** It is the review input for deciding what becomes a phase.
---
## 1. What Phase 13 promised, and where it actually stands
| Req | Promise | State |
|---|---|---|
| AIUI-01 | Human-language node control | **Done**, verified on device 2026-08-06 |
| AIUI-03 | Content surfaces render live **node** data | **Code done**; operator's on-device pass outstanding |
| AIUI-04 | Sandbox, default-closed permissions, human confirmation | **Done**, verified on device |
| AIUI-02 | Conversational **settings** | **Never executed** — no plan in the phase covered it |
| AIUI-05 | Delivery/build path | **Pending** |
| AIUI-06 | Verified on device, mobile included | **In progress** (13-15) |
AIUI-02 and AIUI-05 are the honest surprise: they were declared in REQUIREMENTS.md and no plan
picked them up. They are phase-13 debt, not new scope.
---
## 2. The CSP collision (a real regression this phase caused)
13-09 shipped, deliberately, for the AIUI frame:
default-src 'self'; connect-src http://127.0.0.1:*/aiui/ blob: data:
That is a genuine security win — the iframe cannot exfiltrate to arbitrary hosts. It also means,
inside the embed:
- **Nostr does not work.** AIUI's own client opens `wss://` relay connections from the browser.
`connect-src` forbids them, so posts never load and the UI reports it as blocked.
- **Content enrichment does not work.** Poster/cover art and web-search lookups are outbound
calls to third parties from the frame.
Two directions, and they are a real decision, not a detail:
- **(a) Broker it node-side.** The frame keeps its tight CSP; the node gains explicit,
permissioned endpoints (a relay bridge; an enrichment proxy) that AIUI calls at same-origin.
Consistent with D-01/D-02 ("one assistant, many front doors") and with local-first: the node
decides what leaves, and the egress screen already exists to inspect it. More work.
- **(b) Widen the CSP** to allow `wss:` and named enrichment hosts. Cheap, and it hands the
frame back a direct path off-node — which is the thing the sandbox was built to prevent.
If chosen, it should be an explicit, documented reduction in the threat model, not a quiet
patch.
Recommendation: **(a)**, staged — relays first (that is what the operator wants), enrichment
second.
---
## 3. Endpoints AIUI expects and the node does not serve
Verified on archi-dev-box: both return the SPA's `index.html`, so AIUI parses HTML as JSON and
throws (`Unexpected token '<'`).
- `/api/tmdb/*` — poster/cover fallback (`useImageFallback.ts`)
- `/api/web-search` — web search (`useWebSearch.ts`); also `/api/rss-articles`
Each is a **new egress path**: the user's query text leaves the node to a third party. Gate them
behind the same posture as everything else — default off, owner-visible, screened. Related and
already captured: `todos/pending/2026-08-06-web-search-through-node-chat.md`.
---
## 4. Explicitly deferred in 13-CONTEXT.md, still wanted
The phase's own "Not in scope" line names these; they are not regressions, they are unbuilt:
- **Nostr integration polish** — including the darker per-post cards the operator asked for.
- **Wallet spends as chat-reachable actions** — **zaps live here.** A zap is a spend, so it
needs the confirm gate (built, 13-08) plus a wallet tool category that deliberately does not
exist yet. The gate makes this *safe to build now* in a way it was not before.
- Cross-node content distribution with payments.
---
## 5. Smaller items already logged (not phase-sized)
- `todos/pending/2026-08-06-routstr-funding-ux-in-aiui.md` — Routstr in the provider dropdown,
in-chat funding, a Settings modal. Operator plans a UX pass w/c 2026-08-10.
- Task: app health UX — show *Starting…* instead of *Unreachable* during warm-up (bit both LND
and bitcoind today).
- Task: gated-app iframe login (schemeful-same-site). Path-prefix proxying is **ruled out** by
the operator; the appgate has no TLS. Needs a decision between TLS on app ports vs. enforcing
one dashboard scheme.
- Residual: E-09 naive-user comprehension study for the confirmation dialogs.
- Residual: Routstr protocol unverified against a live provider (0/9 claims).
---
## 6. Proposed shape
**Phase A — "AIUI: finish what 13 declared" (small, mostly debt)**
AIUI-02 conversational settings; AIUI-05 delivery/build; close the E-09 residual.
**Phase B — "AIUI outbound: relays and enrichment, brokered" (the CSP decision)**
Node-side relay bridge so Nostr posts render in the embed; enrichment proxy for covers/search,
default-off and screened. Unblocks the content surfaces the operator expects to see.
**Phase C — "Nostr as a first-class surface, including zaps"**
Post cards and design polish; a wallet tool category behind the existing confirm gate; zaps as
the first deliberately-permissioned spend. Depends on B for relay data and on 13-08 for consent.
Sequencing note: B before C — zapping a post you cannot load is not a feature.