| 1 | # Dynamic specialists: Design, reviewers, taste and a page renderer |
| 2 | |
| 3 | Status: 2026-11-28, revision 3.2, APPROVED by Paul. Drafted by Claude |
| 4 | (Opus 5.5) on `design-dynamic-specialists` from main 55e192cf. Nothing is |
| 5 | built. Astra rounds 1 and 2: NOT READY (13, then 5 findings, all folded |
| 6 | in). Round 3: NOT READY on one item, the workspace snapshot, fixed in 3.1 |
| 7 | by pausing the step while it is copied (section 3). A scoped Astra check |
| 8 | of that fix alone: CLEAN. Paul's rulings on section 6 are in section 7. |
| 9 | |
| 10 | Paul, 2026-11-28: "Where did we get to with allowing the coordinator to |
| 11 | 'hire' other specialists to build out a team according to the user's |
| 12 | prompts? e.g. I want to ask it about a Patrix design overhaul, which feels |
| 13 | like it should go to a design specialist." Then: "each specialist should |
| 14 | self-improve over time as it learns my taste. Option A sounds good." |
| 15 | |
| 16 | Option A: more profiles on the closed menu, led by a Design specialist that |
| 17 | makes things; read-only reviewer profiles; a taste notebook per person; and |
| 18 | a runner-side page renderer so Design and the reviewers can see pages. |
| 19 | |
| 20 | ## 0. What exists today |
| 21 | |
| 22 | - `propose_specialist` (`internal/equipo/chat/specialists.go`) works from |
| 23 | the person's own live turn, only for an owner, and raises a card with Add |
| 24 | and Not now. Only an owner's Add, in one transaction, makes the |
| 25 | specialist active, writes one grant per capability at its revision, and |
| 26 | appends an audit row (proposed, approved, declined, revoked; grant use is |
| 27 | not audited). Research binds each step to the grant and checks it again |
| 28 | before it starts (`researchGrant`, `research.go:719`). Revoking cancels |
| 29 | only Research steps. Add does not start any work by itself. |
| 30 | - The menu (`internal/specialist/menu.go`) is closed and holds one profile, |
| 31 | `research-v1`. A row sets name, brief and model preference; the profile |
| 32 | fixes the rest. One open proposal and one active specialist per profile. |
| 33 | There is no project scope. |
| 34 | - Copy learns only from the delegating owner's edits and imports |
| 35 | (`copy_notes.go`: 40 notes, 6 KiB in the prompt). The coordinator's |
| 36 | `write_note` keeps `source: person` only for a whole sentence of the |
| 37 | person's message in that turn. |
| 38 | - Candidate progression knows Engineering by name (`review.go:102`), and |
| 39 | an exploration's Try again starts another Engineering step |
| 40 | (`explore.go:242`). Explorations skip Checks and end at a direction card |
| 41 | (Build this, Try again with a note, Drop) for one candidate. |
| 42 | - No step can see a page. Engineering's sandbox mounts `/usr` read only, |
| 43 | so `/usr/bin/chromium` is visible on docs-t1, unpinned and unchecked. |
| 44 | `wire.ToolHealth.Renderer` is reserved and always empty. The thin |
| 45 | runner's `submit_render` is a stub left from the plan runner; this spec |
| 46 | does not reuse the name. `scripts/ci-chromium.json` pins Debian 13's |
| 47 | `chromium-headless-shell` 156 and its libraries for CI. |
| 48 | - Patrix is a Go server app with Go-template themes. Its Timeless fonts |
| 49 | are licensed and fetched by `make fonts`; without them it uses DM Sans. |
| 50 | |
| 51 | ## 1. Profiles as data |
| 52 | |
| 53 | The menu stays closed and in code. A profile fixes capabilities, tools, |
| 54 | sandbox, native-tool policy and a prompt pack (an embedded file whose |
| 55 | digest is part of the profile). Changing any of these means a new id |
| 56 | (`design-v2`); old grants do not carry over, because an unknown profile |
| 57 | already denies. A golden test pins each profile. |
| 58 | |
| 59 | A specialist is a row: profile, name, brief, and a new project scope (one |
| 60 | project, or the whole team; migration adds `project_id`, "" meaning the |
| 61 | team). The coordinator picks the profile and writes name and brief from the |
| 62 | person's request; it never sets capabilities or tools. Changing brief or |
| 63 | scope is a new card and a new tap. One open proposal and one active row per |
| 64 | profile per scope; a project's own row wins over a team-wide one. |
| 65 | |
| 66 | New capabilities: `branch.edit` (edit the task's branch and submit a |
| 67 | candidate, as Engineering does; never merge, push the default branch, |
| 68 | preview, publish, or touch settings, places or grants), `branch.read` |
| 69 | (read base and candidate) and `page.render` (section 3). `web.research` |
| 70 | stays exclusive, so it never meets `page.render`. |
| 71 | |
| 72 | | Profile | Slice | Capabilities | Tools | |
| 73 | |---|---|---|---| |
| 74 | | `design-v1` | 1 | branch.edit, page.render | render_page, submit_candidate, ask_person | |
| 75 | | `design-review-v1` | 4 | branch.read, page.render | render_page, submit_specialist_review | |
| 76 | | `accessibility-review-v1` | 4 | branch.read, page.render | render_page, submit_specialist_review | |
| 77 | | `security-review-v1` | 4 | branch.read | submit_specialist_review | |
| 78 | |
| 79 | `suggest_note` (section 2) arrives in slice 5 as new profile versions |
| 80 | (`design-v2` and the reviewers' v2), each needing a new Add. |
| 81 | |
| 82 | **Design is a maker on Engineering's machinery.** The step keeps the maker |
| 83 | step kind (`engineering`) and gains `specialist_id` on the task and the |
| 84 | step. Placement, candidate reporting, fix rounds, retries and Try again |
| 85 | reuse the task's maker, and the change task Build this creates inherits |
| 86 | it, so Design stays Design through the whole task. What differs: the |
| 87 | `design-v1` prompt pack, `render_page`, the taste notes in its brief, and |
| 88 | placement only on a runner whose renderer is healthy. The pack is a design |
| 89 | discipline in the spirit of the impeccable skill: direction before pixels, |
| 90 | a real type and spacing system, state first, every viewport checked, and |
| 91 | the project's `DESIGN.md` from the trusted base as quoted project context. |
| 92 | It is a reviewed file in the repository, never fetched at run time. |
| 93 | |
| 94 | **Every attempt is bound to its grant.** A maker or reviewer step records |
| 95 | the specialist id, revision, project and capabilities when dispatched. |
| 96 | Every privileged effect checks them again in its own transaction |
| 97 | (`grantFor`, generalising `researchGrant`): the runner's start |
| 98 | authorization, each `render_page` call, and `AuthorizePublication` before |
| 99 | a branch push. A mismatch refuses. Grant use is audited at dispatch (new). |
| 100 | Revoking any specialist cancels its queued and running steps, as |
| 101 | `cancelResearch` does today, and withdraws their pending publications; the |
| 102 | task waits and the coordinator offers Engineering in its place. |
| 103 | |
| 104 | **Routing.** `status` lists active specialists (id, profile, name, brief, |
| 105 | scope). `start_task` gains an optional `specialist` (default Engineering). |
| 106 | House rule: visual design, layout, themes and mockups go to Design; with no |
| 107 | Design specialist active the coordinator calls `propose_specialist` and |
| 108 | says in one line why. For a Patrix design overhaul that is one card |
| 109 | ("Design for Patrix: can change the design on a task's branch and look at |
| 110 | its pages in a browser with no network. It can't merge, publish or add |
| 111 | anyone."). Add, in its transaction, queues one coordinator continuation |
| 112 | turn tied to the proposing turn (idempotent per card). That turn carries an |
| 113 | instance-written line ("Paul added Design for Patrix"), labelled as |
| 114 | Equipo's record and never the person's words, and works from the person's |
| 115 | original message. The coordinator then records the task and starts it with |
| 116 | Design. |
| 117 | |
| 118 | **Reviewers never replace Review.** Checks, Review and the owner's merge |
| 119 | tap stay the only path to a merge. In slice 4, a Design-made candidate |
| 120 | gets Design review when one is active, and the coordinator may add Security |
| 121 | or Accessibility review. A blocking finding is a fix round for the maker |
| 122 | under `MaxFixRounds`; the owner can mark a finding "Not a problem". |
| 123 | |
| 124 | ## 2. Taste memory |
| 125 | |
| 126 | Each person has a notebook per discipline (design, security, |
| 127 | accessibility). Design and Design review share the design notebook. A note |
| 128 | covers one project or all of the person's projects. A step reads only the |
| 129 | task creator's notebook: their team-wide notes and that project's. Only the |
| 130 | person can see their notes. |
| 131 | |
| 132 | **What teaches it.** Only the person's own signals, each recorded by the |
| 133 | instance from authenticated records, never from a specialist's say-so: |
| 134 | |
| 135 | 1. *Their words.* A whole sentence of their own message, kept when the |
| 136 | coordinator calls `note_owner_words` in that person's live turn; the |
| 137 | instance matches the text against the person's stored messages of that |
| 138 | turn. Or a note they type on the specialist's page. Labelled "your |
| 139 | words". |
| 140 | 2. *Their choices.* Build this, Try again (with their note, quoted as |
| 141 | their words) or Drop on a direction card; merging or declining a Design |
| 142 | candidate; "Not a problem" on a finding. Stored as a structured fact: |
| 143 | task, choice, and the option's title quoted as Design's words. |
| 144 | 3. *Their edits* (slice 5). A push to the task branch whose pusher, as the |
| 145 | forge reports it, is the person; never the commit's author field. The |
| 146 | diff is shown to the maker in its next step as the owner's edit. It is |
| 147 | not a note. |
| 148 | |
| 149 | Copy's existing notes stay Copy's; slice 5 shows them on the same kind of |
| 150 | page. |
| 151 | |
| 152 | **What never teaches it.** Model text on its own, repository content, |
| 153 | rendered pages, web pages, Research findings and other people's signals. |
| 154 | |
| 155 | **Lessons** (slice 5). A specialist may draft a short lesson from choices |
| 156 | and edits with `suggest_note`. It is model text, so it is kept only on the |
| 157 | person's tap, and stays labelled as Design's words, kept or edited by the |
| 158 | person, with any edit recorded beside the original. Model origin is never |
| 159 | erased. |
| 160 | |
| 161 | **Shown, corrected, forgotten.** The specialist's page (`/team/{id}`) |
| 162 | leads with state ("Design knows 12 things about your taste."). Each note |
| 163 | shows its words, its source, date and scope, with Edit, scope, and |
| 164 | Forget; "Forget everything" clears the notebook. Every write, edit and |
| 165 | forget has an audit row (actor, note id, source kind; never the text). A |
| 166 | removed member's notes stop being used at once. |
| 167 | |
| 168 | **Fed to the prompt.** Each note is quoted under a label naming its source |
| 169 | (AGENTS.md rule 3). At most 60 active notes, 300 characters each, 6 KiB in |
| 170 | the prompt, project notes first and then newest; the page says when some |
| 171 | do not fit. Recent choices add at most 10 facts. The brief records the |
| 172 | notebook revision it used, and a forget bumps it. The start authorization |
| 173 | compares the two: a queued or deferred step with a stale brief is refused |
| 174 | and dispatched again with a rebuilt one, and a step whose saved session |
| 175 | predates a forget starts a fresh session instead of resuming. A forgotten |
| 176 | note reaches no step that has not started; one already running finishes |
| 177 | with what it was given. For Security and Accessibility, notes change |
| 178 | emphasis and format but never waive a finding: one the person accepted |
| 179 | before is still reported, grouped as "you accepted this before". |
| 180 | |
| 181 | ## 3. The page renderer |
| 182 | |
| 183 | `render_page` runs on the runner and is served only to profiles with |
| 184 | `page.render`. The owner's Add is the consent: the card says the |
| 185 | specialist looks at pages in a browser with no network, in that scope. |
| 186 | Engineering does not get the tool in v1 (open question 4). |
| 187 | |
| 188 | **Contract.** Input: `tree` (`base` or `work`); up to 6 `pages`, each a |
| 189 | site path, a viewport from a fixed set (phone 390x844, tablet 834x1194, |
| 190 | desktop 1440x900) and `full_page`; and `compare`, which renders both |
| 191 | trees. Each capture is written as a PNG, re-encoded by the runner (at most |
| 192 | 2 MB, full pages capped at 10,000 px), to a read-only `/render/` mount the |
| 193 | model reads with its own file tool; the tool's text reply lists them. With |
| 194 | each: the page title, console errors (20), failed loads (30, each |
| 195 | `external blocked`, `not found` or `font`), same-site links answering 404 |
| 196 | (30), an accessibility outline (8 KiB), and with `compare` a changed-pixel |
| 197 | ratio and a diff image. All text is page content: quoted, labelled, |
| 198 | bounded, control characters stripped. Errors are fixed codes: |
| 199 | `renderer_missing`, `renderer_mismatch`, `no_site`, `too_many`, `busy`, |
| 200 | `timeout`, `crashed`. Captures the maker names in `submit_candidate` (at |
| 201 | most 12) go to the instance as task files (`chat_task_files`), bound to |
| 202 | the task, attempt and tree digest, and show on the task page and the |
| 203 | direction card through the existing authenticated task-file route. |
| 204 | |
| 205 | **What it renders.** The site is the directory `release/preview.json` |
| 206 | names, exported from git objects with `exportPreview`'s rules (clean |
| 207 | paths, regular files, its caps), then scanned by the preview's pinned |
| 208 | gitleaks before any render. `base` is the task's base commit and renders |
| 209 | only if it has that file. `work` is a snapshot of the step's workspace |
| 210 | made by the runner in its own git directory: a private index, hooks off, |
| 211 | no filters or attribute drivers, links stored and never followed, written |
| 212 | to a tree object and never to the branch. No write can reach the workspace |
| 213 | while it is copied: the runner pauses every process of the step's sandbox |
| 214 | (the model's CLI is already waiting on the tool call) for the bounded |
| 215 | copy, at most 10 seconds, then resumes them, and refuses with `busy` if it |
| 216 | cannot. A render is always of one consistent, immutable tree. The plan |
| 217 | picks the pause mechanism; it must never freeze a cgroup that systemd |
| 218 | spawns into. Slice 3 adds running apps: `.equipo/render.json` on the |
| 219 | trusted base names a build, a serve command listening on `$PORT`, an |
| 220 | optional seed and the pages to check, run in the offline checks sandbox. |
| 221 | Renders are evidence for the specialist and the person, never merge |
| 222 | evidence. |
| 223 | |
| 224 | **Sandbox.** `equipo-runner render` runs under its own bubblewrap launch |
| 225 | policy (not the fetcher's, which shares the network): every namespace |
| 226 | unshared, loopback the only interface, the pinned browser tree and the |
| 227 | exported site read only, a tmpfs for scratch, no home, environment, |
| 228 | credentials, runner state or inherited descriptors beyond the browser's |
| 229 | pipe. It serves the site on 127.0.0.1 inside the namespace and drives the |
| 230 | browser over `--remote-debugging-pipe`. The browser's own sandbox stays on; |
| 231 | a host that cannot nest it reports the renderer missing and never falls |
| 232 | back to `--no-sandbox`. Tests prove direct IPs, redirects, other loopback |
| 233 | ports and descriptors reach nothing. Limits per call: 60 seconds, 2 GiB, |
| 234 | one render at a time per runner; per step 20 calls and 60 captures. |
| 235 | |
| 236 | **Pin and provisioning, as gitleaks.** `internal/release/renderer.json` |
| 237 | pins the packages of `scripts/ci-chromium.json` (written by the same |
| 238 | script, so CI and runners move together). The instance release builds one |
| 239 | renderer tree and a manifest; the manifest's SHA-256 is linked into the |
| 240 | matching runner, as `gitleaksSHA256` is. `install-v1.sh`, `upgrade-thin.sh` |
| 241 | and both cutover scripts install the tree beside the runner on Linux and |
| 242 | refuse one whose manifest or files differ. `verify-installed` checks the |
| 243 | files against the linked digest and renders a fixture page. The runner |
| 244 | reports `ToolHealth.Renderer` (ok, missing, mismatch, unpinned), `status` |
| 245 | shows it, and the coordinator treats a bad renderer as "the runner needs |
| 246 | updating", never as a reason to retry. |
| 247 | |
| 248 | **Mac runners.** Not in v1: a Mac runner reports no renderer and its |
| 249 | install does not require one, and Design work goes to a Linux runner. A |
| 250 | Mac renderer (Chrome for Testing's headless shell under a network-less |
| 251 | `sandbox-exec` profile) and native screens are later work. |
| 252 | |
| 253 | ## 4. Security and abuse |
| 254 | |
| 255 | - **No self-grant.** Only the person's own live turn proposes, only an |
| 256 | owner's tap adds, and no profile holds a tool that touches specialists, |
| 257 | grants, settings, places, merges or publishing. A specialist cannot |
| 258 | propose another. After Not now, the coordinator cannot propose that |
| 259 | profile and scope again for 7 days; an owner can still add it from the |
| 260 | team page. |
| 261 | - **Injection from pages.** A rendered page is repository content, and a |
| 262 | screenshot can carry instructions no filter removes. The defence is what |
| 263 | Design can do: edit one branch, with no network and no credential, and |
| 264 | everything it makes passes Checks or the direction card, Review and the |
| 265 | owner's tap. Page text enters prompts only quoted and labelled. Nothing a |
| 266 | page says can become a note, and a lesson a page may have shaped still |
| 267 | needs the person's Keep. |
| 268 | - **Budget.** Design turns count against the person's connections and the |
| 269 | housekeeping ledger like Engineering. Without a message from the person, |
| 270 | Design runs at most 3 steps per task. Render limits are in section 3. |
| 271 | - **Audit.** Specialist changes (today), grant use at dispatch, note |
| 272 | writes, edits and forgets, and each render's counts and timing on the |
| 273 | step. |
| 274 | |
| 275 | ## 5. Slices |
| 276 | |
| 277 | 1. **Design maker with static renders (L, built as 1a and 1b).** 1a: the |
| 278 | renderer tree, pin, install and verify, `ToolHealth.Renderer`, static |
| 279 | `render_page` with the workspace snapshot (M). 1b: project scope, |
| 280 | `design-v1` and its pack, grant binding and revocation for all |
| 281 | specialists, the Add continuation, `status` and `start_task` routing, |
| 282 | captures as task files (M). Design's mockups for an explore task live |
| 283 | under `mockups/<task>/` with `release/preview.json` naming it: one |
| 284 | candidate, each option (at most 4) its own page, named in |
| 285 | `submit_candidate`. When there is more than one, Build this takes a |
| 286 | note (the person's words) saying which, and Try again narrows as today. |
| 287 | No before shots, since there is no baseline yet. Witness on staging, |
| 288 | then production: Paul asks for a Patrix design overhaul, taps Add on |
| 289 | the Design card, and an explore task shows Design's options on a branch |
| 290 | with screenshots on the task page and the direction card. |
| 291 | 2. **Taste notebook (M).** Their words and choices, the specialist's page, |
| 292 | Edit and Forget, prompt feeding, the fresh-session rule. |
| 293 | 3. **Running-app renders (M).** `.equipo/render.json`, so Design sees real |
| 294 | Patrix pages, with before and after. |
| 295 | 4. **Reviewer profiles (M).** The three review profiles, |
| 296 | `submit_specialist_review`, blocking findings as fix rounds. |
| 297 | 5. **Lessons and edits (S).** `suggest_note`, Suggestions, pusher-verified |
| 298 | edits, Copy's notes on the same kind of page. |
| 299 | |
| 300 | Each slice adds a protocol and additive migrations. Card and page strings |
| 301 | go into `copy.go`, marked pending for copy review. |
| 302 | |
| 303 | ## 6. Open questions for Paul |
| 304 | |
| 305 | 1. **Slice 1 shows static mockups, not live Patrix pages.** *Recommend:* |
| 306 | accept; options are the right first step of an overhaul, and slice 3 |
| 307 | brings real pages. |
| 308 | 2. **Licensed fonts** like Timeless can't be fetched with no network. |
| 309 | *Recommend:* a read-only font folder per project on the runner, filled |
| 310 | once by the runner's owner, in slice 3; until then renders say the |
| 311 | font fell back. |
| 312 | 3. **The design discipline.** *Recommend:* our own pack drawing on |
| 313 | impeccable's method, after checking its licence, which you review once. |
| 314 | 4. **Engineering seeing pages.** *Recommend:* later, behind a per-project |
| 315 | setting you switch on, once Design has used the renderer for a while. |
| 316 | 5. **Whose taste on a shared project.** *Recommend:* the task creator's |
| 317 | only; a later "make this a project rule" for owners. |
| 318 | 6. **Your known rules** (no Bricolage Grotesque, no coloured left borders, |
| 319 | no em dashes). *Recommend:* type them yourself on Design's page once. |
| 320 | Agent-written summaries of them would be kept as agent words. |
| 321 | |
| 322 | ## 7. Paul's rulings (2026-11-28) |
| 323 | |
| 324 | Paul accepted every recommendation in section 6: |
| 325 | |
| 326 | 1. Slice 1 shows static mockups, not live Patrix pages; slice 3 brings |
| 327 | real pages. |
| 328 | 2. Licensed fonts such as Timeless: a read-only font folder per project on |
| 329 | the runner, filled once by the runner's owner, in slice 3. Until then |
| 330 | renders say the font fell back. |
| 331 | 3. The design discipline is our own pack drawing on impeccable's method, |
| 332 | after checking its licence, and Paul reviews it once. |
| 333 | 4. Engineering gets `render_page` later, behind a per-project setting he |
| 334 | switches on, once Design has used the renderer for a while. |
| 335 | 5. On a shared project, only the task creator's taste is used; a later |
| 336 | "make this a project rule" is for owners. |
| 337 | 6. Paul types his known rules on Design's page once himself; agent-written |
| 338 | summaries of them would be kept as agent words. |
| 339 | |