oficina / equipo Public

Clone
git clone https://amadan.net/oficina/equipo

Plain git — no account needed to clone.

Download

Download this file

1# Dynamic specialists: Design, reviewers, taste and a page renderer
2
3Status: 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
5built. Astra rounds 1 and 2: NOT READY (13, then 5 findings, all folded
6in). Round 3: NOT READY on one item, the workspace snapshot, fixed in 3.1
7by pausing the step while it is copied (section 3). A scoped Astra check
8of that fix alone: CLEAN. Paul's rulings on section 6 are in section 7.
9
10Paul, 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
12prompts? e.g. I want to ask it about a Patrix design overhaul, which feels
13like it should go to a design specialist." Then: "each specialist should
14self-improve over time as it learns my taste. Option A sounds good."
15
16Option A: more profiles on the closed menu, led by a Design specialist that
17makes things; read-only reviewer profiles; a taste notebook per person; and
18a 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
53The menu stays closed and in code. A profile fixes capabilities, tools,
54sandbox, native-tool policy and a prompt pack (an embedded file whose
55digest 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
57already denies. A golden test pins each profile.
58
59A specialist is a row: profile, name, brief, and a new project scope (one
60project, or the whole team; migration adds `project_id`, "" meaning the
61team). The coordinator picks the profile and writes name and brief from the
62person's request; it never sets capabilities or tools. Changing brief or
63scope is a new card and a new tap. One open proposal and one active row per
64profile per scope; a project's own row wins over a team-wide one.
65
66New capabilities: `branch.edit` (edit the task's branch and submit a
67candidate, as Engineering does; never merge, push the default branch,
68preview, publish, or touch settings, places or grants), `branch.read`
69(read base and candidate) and `page.render` (section 3). `web.research`
70stays 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
83step kind (`engineering`) and gains `specialist_id` on the task and the
84step. Placement, candidate reporting, fix rounds, retries and Try again
85reuse the task's maker, and the change task Build this creates inherits
86it, 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
88placement only on a runner whose renderer is healthy. The pack is a design
89discipline in the spirit of the impeccable skill: direction before pixels,
90a real type and spacing system, state first, every viewport checked, and
91the project's `DESIGN.md` from the trusted base as quoted project context.
92It 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
95the specialist id, revision, project and capabilities when dispatched.
96Every privileged effect checks them again in its own transaction
97(`grantFor`, generalising `researchGrant`): the runner's start
98authorization, each `render_page` call, and `AuthorizePublication` before
99a branch push. A mismatch refuses. Grant use is audited at dispatch (new).
100Revoking any specialist cancels its queued and running steps, as
101`cancelResearch` does today, and withdraws their pending publications; the
102task waits and the coordinator offers Engineering in its place.
103
104**Routing.** `status` lists active specialists (id, profile, name, brief,
105scope). `start_task` gains an optional `specialist` (default Engineering).
106House rule: visual design, layout, themes and mockups go to Design; with no
107Design specialist active the coordinator calls `propose_specialist` and
108says 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
110its pages in a browser with no network. It can't merge, publish or add
111anyone."). Add, in its transaction, queues one coordinator continuation
112turn tied to the proposing turn (idempotent per card). That turn carries an
113instance-written line ("Paul added Design for Patrix"), labelled as
114Equipo's record and never the person's words, and works from the person's
115original message. The coordinator then records the task and starts it with
116Design.
117
118**Reviewers never replace Review.** Checks, Review and the owner's merge
119tap stay the only path to a merge. In slice 4, a Design-made candidate
120gets Design review when one is active, and the coordinator may add Security
121or Accessibility review. A blocking finding is a fix round for the maker
122under `MaxFixRounds`; the owner can mark a finding "Not a problem".
123
124## 2. Taste memory
125
126Each person has a notebook per discipline (design, security,
127accessibility). Design and Design review share the design notebook. A note
128covers one project or all of the person's projects. A step reads only the
129task creator's notebook: their team-wide notes and that project's. Only the
130person can see their notes.
131
132**What teaches it.** Only the person's own signals, each recorded by the
133instance from authenticated records, never from a specialist's say-so:
134
1351. *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".
1402. *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.
1443. *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
149Copy's existing notes stay Copy's; slice 5 shows them on the same kind of
150page.
151
152**What never teaches it.** Model text on its own, repository content,
153rendered pages, web pages, Research findings and other people's signals.
154
155**Lessons** (slice 5). A specialist may draft a short lesson from choices
156and edits with `suggest_note`. It is model text, so it is kept only on the
157person's tap, and stays labelled as Design's words, kept or edited by the
158person, with any edit recorded beside the original. Model origin is never
159erased.
160
161**Shown, corrected, forgotten.** The specialist's page (`/team/{id}`)
162leads with state ("Design knows 12 things about your taste."). Each note
163shows its words, its source, date and scope, with Edit, scope, and
164Forget; "Forget everything" clears the notebook. Every write, edit and
165forget has an audit row (actor, note id, source kind; never the text). A
166removed 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
170the prompt, project notes first and then newest; the page says when some
171do not fit. Recent choices add at most 10 facts. The brief records the
172notebook revision it used, and a forget bumps it. The start authorization
173compares the two: a queued or deferred step with a stale brief is refused
174and dispatched again with a rebuilt one, and a step whose saved session
175predates a forget starts a fresh session instead of resuming. A forgotten
176note reaches no step that has not started; one already running finishes
177with what it was given. For Security and Accessibility, notes change
178emphasis and format but never waive a finding: one the person accepted
179before 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
185specialist looks at pages in a browser with no network, in that scope.
186Engineering does not get the tool in v1 (open question 4).
187
188**Contract.** Input: `tree` (`base` or `work`); up to 6 `pages`, each a
189site path, a viewport from a fixed set (phone 390x844, tablet 834x1194,
190desktop 1440x900) and `full_page`; and `compare`, which renders both
191trees. Each capture is written as a PNG, re-encoded by the runner (at most
1922 MB, full pages capped at 10,000 px), to a read-only `/render/` mount the
193model reads with its own file tool; the tool's text reply lists them. With
194each: 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
197ratio and a diff image. All text is page content: quoted, labelled,
198bounded, 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
201most 12) go to the instance as task files (`chat_task_files`), bound to
202the task, attempt and tree digest, and show on the task page and the
203direction card through the existing authenticated task-file route.
204
205**What it renders.** The site is the directory `release/preview.json`
206names, exported from git objects with `exportPreview`'s rules (clean
207paths, regular files, its caps), then scanned by the preview's pinned
208gitleaks before any render. `base` is the task's base commit and renders
209only if it has that file. `work` is a snapshot of the step's workspace
210made by the runner in its own git directory: a private index, hooks off,
211no filters or attribute drivers, links stored and never followed, written
212to a tree object and never to the branch. No write can reach the workspace
213while 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
215copy, at most 10 seconds, then resumes them, and refuses with `busy` if it
216cannot. A render is always of one consistent, immutable tree. The plan
217picks the pause mechanism; it must never freeze a cgroup that systemd
218spawns into. Slice 3 adds running apps: `.equipo/render.json` on the
219trusted base names a build, a serve command listening on `$PORT`, an
220optional seed and the pages to check, run in the offline checks sandbox.
221Renders are evidence for the specialist and the person, never merge
222evidence.
223
224**Sandbox.** `equipo-runner render` runs under its own bubblewrap launch
225policy (not the fetcher's, which shares the network): every namespace
226unshared, loopback the only interface, the pinned browser tree and the
227exported site read only, a tmpfs for scratch, no home, environment,
228credentials, runner state or inherited descriptors beyond the browser's
229pipe. It serves the site on 127.0.0.1 inside the namespace and drives the
230browser over `--remote-debugging-pipe`. The browser's own sandbox stays on;
231a host that cannot nest it reports the renderer missing and never falls
232back to `--no-sandbox`. Tests prove direct IPs, redirects, other loopback
233ports and descriptors reach nothing. Limits per call: 60 seconds, 2 GiB,
234one render at a time per runner; per step 20 calls and 60 captures.
235
236**Pin and provisioning, as gitleaks.** `internal/release/renderer.json`
237pins the packages of `scripts/ci-chromium.json` (written by the same
238script, so CI and runners move together). The instance release builds one
239renderer tree and a manifest; the manifest's SHA-256 is linked into the
240matching runner, as `gitleaksSHA256` is. `install-v1.sh`, `upgrade-thin.sh`
241and both cutover scripts install the tree beside the runner on Linux and
242refuse one whose manifest or files differ. `verify-installed` checks the
243files against the linked digest and renders a fixture page. The runner
244reports `ToolHealth.Renderer` (ok, missing, mismatch, unpinned), `status`
245shows it, and the coordinator treats a bad renderer as "the runner needs
246updating", never as a reason to retry.
247
248**Mac runners.** Not in v1: a Mac runner reports no renderer and its
249install does not require one, and Design work goes to a Linux runner. A
250Mac 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
2771. **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.
2912. **Taste notebook (M).** Their words and choices, the specialist's page,
292 Edit and Forget, prompt feeding, the fresh-session rule.
2933. **Running-app renders (M).** `.equipo/render.json`, so Design sees real
294 Patrix pages, with before and after.
2954. **Reviewer profiles (M).** The three review profiles,
296 `submit_specialist_review`, blocking findings as fix rounds.
2975. **Lessons and edits (S).** `suggest_note`, Suggestions, pusher-verified
298 edits, Copy's notes on the same kind of page.
299
300Each slice adds a protocol and additive migrations. Card and page strings
301go into `copy.go`, marked pending for copy review.
302
303## 6. Open questions for Paul
304
3051. **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.
3082. **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.
3123. **The design discipline.** *Recommend:* our own pack drawing on
313 impeccable's method, after checking its licence, which you review once.
3144. **Engineering seeing pages.** *Recommend:* later, behind a per-project
315 setting you switch on, once Design has used the renderer for a while.
3165. **Whose taste on a shared project.** *Recommend:* the task creator's
317 only; a later "make this a project rule" for owners.
3186. **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
324Paul accepted every recommendation in section 6:
325
3261. Slice 1 shows static mockups, not live Patrix pages; slice 3 brings
327 real pages.
3282. 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.
3313. The design discipline is our own pack drawing on impeccable's method,
332 after checking its licence, and Paul reviews it once.
3334. Engineering gets `render_page` later, behind a per-project setting he
334 switches on, once Design has used the renderer for a while.
3355. On a shared project, only the task creator's taste is used; a later
336 "make this a project rule" is for owners.
3376. Paul types his known rules on Design's page once himself; agent-written
338 summaries of them would be kept as agent words.
339