diff --git a/.changes/prototype/docs-ui-feedback-contract-and-prototype-prerequisites-3f9c2a71.md b/.changes/prototype/docs-ui-feedback-contract-and-prototype-prerequisites-3f9c2a71.md new file mode 100644 index 00000000000..1a92fbc9d06 --- /dev/null +++ b/.changes/prototype/docs-ui-feedback-contract-and-prototype-prerequisites-3f9c2a71.md @@ -0,0 +1,9 @@ +--- +bump: patch +--- + +### Fixed + +- **The notes host is offered only on a single-user machine.** `/prototype:explore-directions` now says why: the host hands its per-run token to any local process that asks the loopback port. +- **`playwright-cli` is declared as an optional prerequisite**, and the `node` row names note relocation, so `/harness-ops:prerequisites` reports what relocating a note needs and what happens without it. +- **The `ed-notes-tracer` eval's serve grader now requires `--page explore-directions.html`.** An `ensure-running` on the default page, which the scaffold never writes, no longer passes. diff --git a/docs/contracts/ui-feedback/README.md b/docs/contracts/ui-feedback/README.md index c9ea224cf0b..10037845a58 100644 --- a/docs/contracts/ui-feedback/README.md +++ b/docs/contracts/ui-feedback/README.md @@ -11,14 +11,16 @@ The canonical files live in `lib/ui-feedback/`: | Path | Holds | |---|---| -| `lib/ui-feedback/host.html` | The host page: a checked-in page the notes bridge serves. It frames the model-written page in a sandbox, shows the notes panel, validates every message from the frame, and sends notes to the session | +| `lib/ui-feedback/host.html` | The host page: a checked-in page the notes bridge serves. It frames the model-written page through `srcdoc` in a sandbox, shows the notes panel, validates every message from the frame, and sends notes to the session | | `lib/ui-feedback/proto-pin.js` | The frame helper, inlined into the framed page. It picks elements, text and regions, sets the controls through the controls runtime, holds the state-snapshot function, and talks to the host page only by `postMessage` | | `lib/ui-feedback/controls.js` | The controls runtime: the control-type registry. The framed page inlines it, and the host page loads the same file to render its Controls tab | | `lib/ui-feedback/note.schema.json` | The note contract | +| `lib/ui-feedback/note-model.mjs` | The host page's validator of notes and controls manifests, which the relocation script also uses. It reads every limit from the schema it is handed; `notes_bridge.py` holds the bridge's validator over the same subset | | `lib/ui-feedback/controls.schema.json` | The controls manifest contract: what a page may declare as a control, and the `snapshot` of control values a note carries | | `lib/ui-feedback/fixtures/` | Valid and invalid notes and manifests | | `lib/ui-feedback/relocate-note.mjs` | The relocation script: finds a note's element again in a fresh page and shoots it (see [Re-locating a note](#re-locating-a-note)) | | `lib/ui-feedback/notes_bridge.py`, `notes-bridge.sh` | The notes bridge app on the session bridge's loopback adapter, shaped like the view app ([`lib/session-bridge/README.md`](../../../lib/session-bridge/README.md#the-view-app), "The view app") | +| `lib/session-bridge/view_bridge.py` | The view app the notes bridge builds on: its hub, handler, token route, replies and idle expiry. Its copy sits beside each copy of `notes_bridge.py` | Each consumer takes generated copies through [`scripts/shared-copies.txt`](../../../scripts/shared-copies.txt) and `scripts/sync-shared-copies.sh`, whose `--check` and `--check-bump` modes are the sync gate @@ -102,7 +104,9 @@ the host page reach the frame only by message. - **Notes leave through the host page.** The host page frames the page with `sandbox="allow-scripts"` and never `allow-same-origin`, in the pattern of the planning shared page ([`plugins/planning/shared/README.md`](../../../plugins/planning/shared/README.md#prototype-page), - "Sandbox"). It checks each message's source frame and shape, then posts the note on the session + "Sandbox"). The bridge sends `X-Frame-Options: DENY` on every response, so the host page fetches + the page as text from `/api/page`, with the mockup policy put first, and frames it through + `srcdoc`. It checks each message's source frame and shape, then posts the note on the session bridge, whose Host, Origin and token checks are in [The loopback adapter](../../../lib/session-bridge/README.md#the-loopback-adapter). - **From `file://`, copy-out only.** A page opened from `file://` has no host page and no bridge: diff --git a/plugins/prototype/evals/ed-notes-tracer/graders/ensure-running.md b/plugins/prototype/evals/ed-notes-tracer/graders/ensure-running.md index ff770a29de5..d535a1090fc 100644 --- a/plugins/prototype/evals/ed-notes-tracer/graders/ensure-running.md +++ b/plugins/prototype/evals/ed-notes-tracer/graders/ensure-running.md @@ -1,7 +1,7 @@ --- type: tool_used tool: Bash -input_match: '"command":"(?:[^"\\]|\\.)*?notes-bridge\.sh(?:[^"\\]|\\.)*?--dir(?:[^"\\]|\\.)*?mockup-run(?:[^"\\]|\\.)*?ensure-running' +input_match: '"command":"(?:[^"\\]|\\.)*?notes-bridge\.sh(?:[^"\\]|\\.)*?--dir(?:[^"\\]|\\.)*?mockup-run(?:[^"\\]|\\.)*?ensure-running(?:[^"\\]|\\.)*?--page(?:=|\s+)(?:\\")?explore-directions\.html' min: 1 arm: both --- diff --git a/plugins/prototype/evals/ed-notes-tracer/samples/ensure-running.json b/plugins/prototype/evals/ed-notes-tracer/samples/ensure-running.json index 6676827626c..68cac66887c 100644 --- a/plugins/prototype/evals/ed-notes-tracer/samples/ensure-running.json +++ b/plugins/prototype/evals/ed-notes-tracer/samples/ensure-running.json @@ -2,11 +2,11 @@ "pass": [ { "answer": [{"tool": "Bash", "input": {"command": "bash \"/plugins/prototype/notes-bridge/notes-bridge.sh\" --dir \"mockup-run\" ensure-running --page explore-directions.html", "description": "x"}}], - "why": "relative run dir, quoted" + "why": "relative run dir, quoted, names the scaffold's page" }, { - "answer": [{"tool": "Bash", "input": {"command": "bash /p/notes-bridge/notes-bridge.sh --dir /work/space/mockup-run ensure-running", "description": "x"}}], - "why": "absolute run dir, default page" + "answer": [{"tool": "Bash", "input": {"command": "bash /p/notes-bridge/notes-bridge.sh --dir /work/space/mockup-run ensure-running --idle-seconds 900 --page=\"explore-directions.html\"", "description": "x"}}], + "why": "absolute run dir, --page= form with a quoted name after another option" } ], "fail": [ @@ -19,7 +19,15 @@ "why": "status only, never serves" }, { - "answer": [{"tool": "Bash", "input": {"command": "bash /p/notes-bridge/notes-bridge.sh --dir /tmp/other ensure-running", "description": "serve mockup-run"}}], + "answer": [{"tool": "Bash", "input": {"command": "bash /p/notes-bridge/notes-bridge.sh --dir /work/space/mockup-run ensure-running", "description": "x"}}], + "why": "default page.html, which the scaffold never writes, so the host frames nothing" + }, + { + "answer": [{"tool": "Bash", "input": {"command": "bash /p/notes-bridge/notes-bridge.sh --dir mockup-run ensure-running --page page.html", "description": "serve explore-directions.html"}}], + "why": "another page; the scaffold's page only in the description" + }, + { + "answer": [{"tool": "Bash", "input": {"command": "bash /p/notes-bridge/notes-bridge.sh --dir /tmp/other ensure-running --page explore-directions.html", "description": "serve mockup-run"}}], "why": "another directory; the run dir only in the description" } ] diff --git a/plugins/prototype/prerequisites.json b/plugins/prototype/prerequisites.json index 011e37ff053..99308562548 100644 --- a/plugins/prototype/prerequisites.json +++ b/plugins/prototype/prerequisites.json @@ -6,7 +6,7 @@ "need": "optional", "for": ["skill:explore-directions", "skill:pressure-test"], "detect": { "any": ["node"] }, - "degrade": "Without node, /prototype:explore-directions and /prototype:pressure-test cannot run the medium resolver: each says so in one line and keeps its shipped default, and pressure-test's audience routing still picks the shell.", + "degrade": "Without node, /prototype:explore-directions and /prototype:pressure-test cannot run the medium resolver: each says so in one line and keeps its shipped default, and pressure-test's audience routing still picks the shell. Without node, explore-directions also cannot write a note's relocation script, so it reads the mockup file to say whether a note's element is still there.", "install": { "docs": "https://nodejs.org/en/download", "brew": "node", @@ -44,6 +44,18 @@ "apt": "curl" }, "check": "/harness-ops:prerequisites" + }, + { + "id": "playwright-cli", + "kind": "cli", + "need": "optional", + "for": ["skill:explore-directions"], + "detect": { "any": ["playwright-cli"] }, + "degrade": "Without playwright-cli, /prototype:explore-directions cannot run a note's relocation script, so it takes no screenshot of the noted element and reads the mockup file to say whether the element is still there.", + "install": { + "npm": "npm install -g @playwright/cli" + }, + "check": "/harness-ops:prerequisites" } ] } diff --git a/plugins/prototype/skills/explore-directions/reference/feedback.md b/plugins/prototype/skills/explore-directions/reference/feedback.md index f3dc0c5ef94..f0fde3696ab 100644 --- a/plugins/prototype/skills/explore-directions/reference/feedback.md +++ b/plugins/prototype/skills/explore-directions/reference/feedback.md @@ -6,8 +6,10 @@ mockup through the notes host. The parts, their trust rules and the note contrac copies in `/notes-bridge/`. The `file://` page stays the default and keeps its copy-out terminator: opened from `file://`, no notes reach the session. -Only with the person at this machine and python3 and curl present; without them, say so in one -line and hand over the `file://` page as usual. +Only with the person at this machine, on a single-user machine, and python3 and curl present; +without them, say so in one line and hand over the `file://` page as usual. The notes host hands +its per-run token to any local process that asks the loopback port, so another OS user on the +machine could read it and post notes. 1. Serve the run directory the mockup is in, naming the page: