diff --git a/CLAUDE.md b/CLAUDE.md index 0935c03..47e23b1 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -114,16 +114,27 @@ board from a TOML board file. Design: `docs/superpowers/specs/2026-11-24-board-r fake clock. `cli.py` is the I/O loop around it. - **Tests:** change the scheduler test-first. Test runner-mode skill changes with subagents on toy boards, as above. -**Web UI.** `web/` is a local, read-only app started with `deno task web`: a Deno server (`web/server.ts`, helpers in -`web/lib/`) and a plain ES-module browser app with vendored Cytoscape (`web/public/`, no build step). Design: -`docs/superpowers/specs/2026-11-26-web-ui-design.md`. +**Web UI.** `web/` is a local app started with `deno task web`, read-only except for the board writes below: a Deno +server (`web/server.ts`, helpers in `web/lib/`) and a plain ES-module browser app with vendored Cytoscape +(`web/public/`, no build step). Design: `docs/superpowers/specs/2026-11-26-web-ui-design.md`; the writes and run +controls: `docs/superpowers/specs/2026-11-26-web-ui-hints-intents-design.md`. - **Data:** the server talks only to the `web-api` Edge Function (`supabase/functions/web-api/index.ts`, routes in - `_shared/web-api.ts`), never to Postgres. It adds the token from `.env` and forwards only an allow-list of GET routes - (`/api/scopes`, `boards`, `graph`, `memories`, `memories/:id`), so the token never reaches the browser. It binds to - `127.0.0.1` and checks `Host`. -- **web-api:** read-only routes on `PgMemoryStore` as the caller, with the embedder built lazily so only text search - loads it. Browse and ranked search from here do not count as an access. There is no history route. + `_shared/web-api.ts`), never to Postgres. It adds the token from `.env` and forwards only an allow-list: GET routes + (`/api/scopes`, `boards`, `graph`, `memories`, `memories/:id`) and four POST routes (`hints`, `intents`, `amendments`, + `boards/control`), so the token never reaches the browser. It binds to `127.0.0.1` and checks `Host`. A POST must be + JSON, at most 16 KiB, and same-origin (`Sec-Fetch-Site`, or `Origin` when that is absent), else 403, and gets a 30 s + timeout (`web/lib/proxy.ts`). +- **web-api:** read routes on `PgMemoryStore` as the caller, with the embedder built lazily so only text search loads + it. Browse and ranked search from here do not count as an access. There is no history route. +- **Writes:** `POST /hints`, `/intents`, `/amendments` and `/boards/control` run as the caller through `store`, `relate` + and `update`; the browser sends only text and ids. `_shared/board-writes.ts` holds the skill's templates (kept in step + with `skills/blackboard`: the lead recognises a person's intent by the `Why: added by` prefix, and a test pins it), + the `Max intents:` rewrite and the state transitions. Newlines in text are folded so no field forges a template line. + A failed link deletes the memory just stored. Pause is `state:paused` on the goal; the runner stays board-blind and + checks a paused board every 2 minutes. Amendments are guarded only by a rule (workers never write them; the lead + honours a `From:` naming a person); a bot member that the database stops writing `kind:amendment`, `kind:goal` or + `kind:rules` is a follow-up. Changing `web-api` needs a hosted redeploy, with the person's consent. - **Worker logs:** `/logs//