diff --git a/CHANGELOG.md b/CHANGELOG.md index 58e9158..9d3c800 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,8 +16,8 @@ Harness spec 3.8.0: reports from scheduled runs, HTML pages in answers, which pe attention"), or never. `[SILENT]` is retired. On a linked computer the CLI offers `report_write` to a scheduled run's model and hands the report back with the run's answer. - **Harness spec 3.8.0: HTML pages in answers** (`harness/pages.md`), experimental and off unless - the server switches it on: a reply may carry a complete page in an `html-view` block, shown in - a sealed frame by the web UI and Desktop. A terminal shows a note in its place — *This answer + the server switches it on: a reply may carry a complete page in an `html-view` block — static: + HTML, CSS and inline SVG, no script — shown in a sealed frame by the web UI and Desktop. A terminal shows a note in its place — *This answer has a page: title* — and keeps the page as a file (`/pages`). A terminal's own model is never offered pages. - **`/reports`**: the reports your schedules filed, read from your LLeMbas server — unread first, diff --git a/harness/README.md b/harness/README.md index cc0a25a..faecda0 100644 --- a/harness/README.md +++ b/harness/README.md @@ -98,7 +98,11 @@ Written ahead of the implementations; the CLI carries it in the same round. - **HTML pages in answers** (`pages.md`, `prompts/blocks/html-pages.md`, `loop.json` `pages`, `models/schema.json` `html_pages`) — experimental, off unless switched on. The reply stays Markdown; the model may add a complete, self-contained page in a fence whose info string is - `html-view` and a title. Offered only when the instance's switch, the model's flag and the + `html-view` and a title. **A page is static everywhere** — HTML, CSS and inline SVG; no script, + no event handlers, no ``/``/``, frames, media or forms, no address but + `#fragment` and an inline `data:image/…`; a client rebuilds it from the allow-list + (`loop.json` `pages.static`) and shows it in a frame with scripts off, or shows the note. + Offered only when the instance's switch, the model's flag and the chat's switch are all on (a scheduled run: instance and model); never to a subagent, the phone assistant or an agent chat. A reader that cannot show a page sees *This answer has a page: title*; anything that reads a reply as text sees `[page: title]`. A switch changed mid-chat is diff --git a/harness/conformance/pages.json b/harness/conformance/pages.json index 42b4092..6ea5fb7 100644 --- a/harness/conformance/pages.json +++ b/harness/conformance/pages.json @@ -1,5 +1,5 @@ { - "about": "HTML pages in answers (pages.md, spec 3.8.0). `show` says what is asked. `fence`: a reply's `text` — expect `pages`, each closed `html-view` block in order with its `title` and its `html` (the lines between the fences, joined by newlines), and `projection`, the reply with every page replaced by its `[page: title]` line. `note`: a page's `title` — expect what a client that cannot render shows. `offered`: the `instance` switch, the `model`'s flag (absent: false), the `chat` switch, and `where` (absent: a chat; `scheduled`: a schedule's run on the server, which has no chat switch; `subagent`, `phone_assistant`, `agent_chat`) — expect whether the block is in the prompt. `note_line`: the chat's switch `change`d to `on` or `off` after the prompt was made — expect the session note's `line`. LLeMbas: services/pages.py; CLI: src/prototype/fence.ts.", + "about": "HTML pages in answers (pages.md, spec 3.8.0). `show` says what is asked. `fence`: a reply's `text` — expect `pages`, each closed `html-view` block in order with its `title` and its `html` (the lines between the fences, joined by newlines), and `projection`, the reply with every page replaced by its `[page: title]` line. `note`: a page's `title` — expect what a client that cannot render shows. `offered`: the `instance` switch, the `model`'s flag (absent: false), the `chat` switch, and `where` (absent: a chat; `scheduled`: a schedule's run on the server, which has no chat switch; `subagent`, `phone_assistant`, `agent_chat`) — expect whether the block is in the prompt. `note_line`: the chat's switch `change`d to `on` or `off` after the prompt was made — expect the session note's `line`. `static`: a page's `html` — expect `static` true, or false with `why`: what makes it not static, each once, in the order first met — `element:` (not in pages.static.elements), `attribute:` (not in pages.static.attributes, nor a kept prefix), `address:` (an address other than #fragment or an inline data: image of a listed type), `css:import`, `css:url` (a url() that is neither) — names in lower case. It says what the rule is; a client still rebuilds the document with a real parser (pages.md §6). LLeMbas: services/pages.py; CLI: src/prototype/fence.ts.", "cases": [ { "about": "A page with a title.", @@ -281,6 +281,139 @@ "expect": { "line": "HTML pages are now off for this chat: write no more `html-view` blocks." } + }, + { + "about": "A static page: text, a table, a style element with the variables, inline SVG.", + "show": "static", + "html": "Sales

Sales

Month12
12", + "expect": { + "static": true + } + }, + { + "about": "A link within the page and an inline picture are the two addresses there are.", + "show": "static", + "html": "Totals

Totals

\"dot\"", + "expect": { + "static": true + } + }, + { + "about": "A script.", + "show": "static", + "html": "

x

", + "expect": { + "static": false, + "why": [ + "element:script" + ] + } + }, + { + "about": "An event handler.", + "show": "static", + "html": "

x

", + "expect": { + "static": false, + "why": [ + "attribute:onclick", + "attribute:onload" + ] + } + }, + { + "about": "A link element — a dns-prefetch needs no script at all.", + "show": "static", + "html": "

x

", + "expect": { + "static": false, + "why": [ + "element:link" + ] + } + }, + { + "about": "meta, base, frames, objects, media, canvas, forms.", + "show": "static", + "html": "
", + "expect": { + "static": false, + "why": [ + "element:meta", + "element:base", + "element:iframe", + "element:object", + "element:embed", + "element:video", + "element:audio", + "element:canvas", + "element:form", + "element:input", + "element:button" + ] + } + }, + { + "about": "An address that leaves the page.", + "show": "static", + "html": "out\"\"next", + "expect": { + "static": false, + "why": [ + "address:href", + "address:src" + ] + } + }, + { + "about": "A javascript: address, a protocol-relative one, a data: address that is not a picture, an SVG picture.", + "show": "static", + "html": "xyz\"\"", + "expect": { + "static": false, + "why": [ + "address:href", + "address:src" + ] + } + }, + { + "about": "CSS that would fetch: @import and url() to anywhere; url(#id) and an inline picture are fine.", + "show": "static", + "html": "

x

", + "expect": { + "static": false, + "why": [ + "css:import", + "css:url" + ] + } + }, + { + "about": "Elements and attributes nobody listed: dropped, whatever they are.", + "show": "static", + "html": "x

z

w

", + "expect": { + "static": false, + "why": [ + "element:marquee", + "element:template", + "element:foreignobject", + "attribute:contenteditable" + ] + } + }, + { + "about": "An xlink:href is not a listed attribute; a use that points outside is an address.", + "show": "static", + "html": "", + "expect": { + "static": false, + "why": [ + "attribute:xlink:href", + "address:href" + ] + } } ] } diff --git a/harness/loop.json b/harness/loop.json index d249410..1d7672b 100644 --- a/harness/loop.json +++ b/harness/loop.json @@ -444,7 +444,7 @@ "pace_per_second": 4 }, "scheduled": { - "about": "Spec 3.5.0 (acp.md *Scheduled work on a linked computer*): a schedule's run as an agent turn on a linked computer, and the watch command of monitor mode. `setting` is how the device's switch is shown; `modes` the modes a schedule may choose (`default_mode` when it chose none), lowered to remote.max_mode; `approval_wait_seconds` how long an approval in a scheduled turn waits (the schedule's wait, clamped); `sentinel` the word a reply says when there is nothing to tell; `monitor` the watch command's limits. conformance/scheduled.json, silent.json, monitor.json. Spec 3.8.0 (reports.md): `notify` — a schedule's notify-when: its `values`, the `default`, the `default_condition` of `when`, the instruction `texts` placed in the run's prompt ({{condition}} the person's words), what the tool answers (`result`), and the limits of the history line and of a summary made from an answer. `sentinel` is retired: told to no model, and a reply that still carries it leaves no report. conformance/reports.json.", + "about": "Spec 3.5.0 (acp.md *Scheduled work on a linked computer*): a schedule's run as an agent turn on a linked computer, and the watch command of monitor mode. `setting` is how the device's switch is shown; `modes` the modes a schedule may choose (`default_mode` when it chose none), lowered to remote.max_mode; `approval_wait_seconds` how long an approval in a scheduled turn waits (the schedule's wait, clamped); `sentinel` the word a reply says when there is nothing to tell; `monitor` the watch command's limits. conformance/scheduled.json, silent.json, monitor.json. Spec 3.8.0 (reports.md): `notify` — a schedule's notify-when: its `values`, the `default`, the `default_condition` of `when`, the instruction `texts` placed in the run's prompt ({{condition}} the person's words), what the tool answers (`result`), and the limits of the history line and of a summary made from an answer. `sentinel` is retired: told to no model, and a reply that still carries it leaves no report. conformance/reports.json. `notify.one_shot_default`: what the creator of a schedule that runs once may store when the person chose nothing.", "setting": { "key": "remote.scheduled", "label": "Accept scheduled work", @@ -492,6 +492,7 @@ "never" ], "default": "when", + "one_shot_default": "always", "default_condition": "something needs my attention", "labels": { "always": "Every run", @@ -801,7 +802,7 @@ } }, "pages": { - "about": "Spec 3.8.0 (pages.md): HTML pages in answers — experimental, off unless switched on. `fence`: the info word of a page's fenced block; `title_max` and `untitled` for its title; `variables`: the CSS variables the frame provides; `note` what a client that cannot render shows in a page's place and `where` what it may add; `projection` the one line a page is for anything that reads a reply as text; `never`: where pages are never offered, whatever the switches say. conformance/pages.json.", + "about": "Spec 3.8.0 (pages.md): HTML pages in answers — experimental, off unless switched on. `fence`: the info word of a page's fenced block; `title_max` and `untitled` for its title; `variables`: the CSS variables the frame provides; `note` what a client that cannot render shows in a page's place and `where` what it may add; `projection` the one line a page is for anything that reads a reply as text; `never`: where pages are never offered, whatever the switches say. conformance/pages.json. `static` (pages.md §6): a page is static everywhere — the `elements` and `attributes` a client keeps when it rebuilds the document (anything else is dropped; `aria-*` and `data-*` attributes are kept), the `addresses` an attribute or a CSS url() may hold, and the `image_types` of an inline data: image.", "fence": "html-view", "title_max": 80, "untitled": "Page", @@ -819,6 +820,178 @@ "subagent", "phone_assistant", "agent_chat" - ] + ], + "static": { + "elements": [ + "html", + "head", + "title", + "style", + "body", + "main", + "header", + "footer", + "section", + "article", + "aside", + "nav", + "div", + "span", + "p", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6", + "ul", + "ol", + "li", + "dl", + "dt", + "dd", + "table", + "caption", + "colgroup", + "col", + "thead", + "tbody", + "tfoot", + "tr", + "th", + "td", + "figure", + "figcaption", + "blockquote", + "pre", + "code", + "em", + "strong", + "b", + "i", + "u", + "s", + "small", + "sub", + "sup", + "mark", + "abbr", + "time", + "br", + "hr", + "a", + "img", + "details", + "summary", + "svg", + "g", + "defs", + "path", + "rect", + "circle", + "ellipse", + "line", + "polyline", + "polygon", + "text", + "tspan", + "desc", + "linearGradient", + "radialGradient", + "stop", + "clipPath", + "marker", + "symbol", + "use" + ], + "attributes": [ + "class", + "id", + "style", + "title", + "lang", + "dir", + "role", + "hidden", + "colspan", + "rowspan", + "scope", + "headers", + "span", + "href", + "src", + "alt", + "width", + "height", + "open", + "datetime", + "xmlns", + "viewBox", + "preserveAspectRatio", + "x", + "y", + "x1", + "y1", + "x2", + "y2", + "cx", + "cy", + "r", + "rx", + "ry", + "d", + "points", + "dx", + "dy", + "transform", + "fill", + "fill-opacity", + "fill-rule", + "stroke", + "stroke-width", + "stroke-opacity", + "stroke-dasharray", + "stroke-linecap", + "stroke-linejoin", + "opacity", + "font-family", + "font-size", + "font-weight", + "text-anchor", + "dominant-baseline", + "offset", + "stop-color", + "stop-opacity", + "gradientUnits", + "gradientTransform", + "clip-path", + "marker-start", + "marker-mid", + "marker-end", + "markerWidth", + "markerHeight", + "refX", + "refY", + "orient" + ], + "attribute_prefixes": [ + "aria-", + "data-" + ], + "address_attributes": [ + "href", + "src" + ], + "addresses": [ + "#fragment", + "data:image" + ], + "image_types": [ + "png", + "jpeg", + "gif", + "webp" + ] + } } } diff --git a/harness/pages.md b/harness/pages.md index 38e304f..29caf06 100644 --- a/harness/pages.md +++ b/harness/pages.md @@ -2,8 +2,9 @@ Spec 3.8.0. **Experimental, and off unless switched on.** A reply stays Markdown; where seeing answers better than reading, the model may add **a page** to it: a complete, self-contained HTML -document in a fenced block. A client that can, shows the page in a sealed frame at that place in -the reply; every other reader sees a one-line note. The prompt text is `prompts/blocks/html-pages.md`; +document in a fenced block — **static: HTML, CSS and inline SVG, no script** (§6). A client that +can, shows the page in a sealed frame at that place in the reply; every other reader sees a +one-line note. The prompt text is `prompts/blocks/html-pages.md`; the names and texts `loop.json` `pages`; the model flag `models/schema.json` `html_pages`; the cases `conformance/pages.json`. (It takes the place of the 1.x *prototypes*, which 2.0 removed: one kind of block instead of two, no panel, no network.) @@ -40,10 +41,10 @@ A page is a fenced code block whose info string begins with the word **`html-vie `prompts/blocks/html-pages.md`, as bullets of the system prompt when pages are offered (§4) — in short: the answer stays Markdown and must make sense without the page; a page is a complete -document in an `html-view` fence with a short title, one page per fence; everything is inline — -no external script, style, font or image, the frame has no network; charts are drawn with inline -SVG or a canvas script; colours come from the frame's variables so the page follows light and -dark; no forms that submit, no links that navigate. +document in an `html-view` fence with a short title, one page per fence; it is **static** — HTML, +CSS and inline SVG, nothing that runs and nothing loaded from anywhere; a chart is inline SVG the +model writes out, shapes and numbers it worked out itself; tables and layout are CSS; colours +come from the frame's variables so the page follows light and dark. **The frame's variables**, set on the page's root by the client that shows it, always used with a fallback (`pages.variables`): @@ -95,11 +96,45 @@ message: `context.note.pages_on` — with the block's text as `{{pages_text}}` is made; a change of those reaches a chat the same way, as the chat's switch going off or becoming available. -## 6. The frame +## 6. A page is static -What a rendering client must hold to (the server's and Desktop's own tests prove it; it is here -so that a third client does not weaken it): the page runs in a frame of its own origin with -scripts allowed and nothing else — no cookie, no storage of the app's, **no network** (no fetch, -no image, font, script or style from anywhere), no navigation of itself or its parent, no forms -that submit, no pop-ups. The client gives it the five variables and takes its height. A page -never reaches the app that shows it. +**Everywhere, in every client: HTML, CSS and inline SVG — nothing that runs, nothing that +reaches anywhere.** A frame with scripts on cannot be sealed by policy alone: a script can still +send data out (a WebRTC datagram to a server it chooses), and even without script a document can +make the browser look a name up (``, `preconnect`, `prefetch`). So the +rule is about the document, not only the frame around it (`loop.json` `pages.static`; +`conformance/pages.json`, `show: static`): + +- **No script of any kind**: no `