oficina / equipo Public
Dynamic specialists slice 1: a Design specialist that shows its work
Spec: docs/superpowers/specs/2026-11-28-dynamic-specialists.md (rev 3.2, approved, Paul's rulings in its section 7). Build branch specialists-slice-1 from design-dynamic-specialists with current main merged. Two halves on one branch: 1a the renderer and a static render_page; 1b design-v1 with scope, routing and screenshots. Revision 3.1: Astra plan rounds 1 (NOT READY, 11 findings), 2 and 3 (READY AFTER FIXES, 1 finding each) are folded in.
Finish line (after a release, Paul's): Paul asks the coordinator for a Patrix design overhaul. A card proposes "Design for Patrix"; he taps Add; the coordinator records an explore task and starts it with Design; Design writes up to four mockup options under mockups/<task>/ on the task's branch, renders them, and the task page and direction card show the screenshots. He taps Build this with a note naming the option he wants.
Not in slice 1: taste notes, reviewer profiles, running-app renders, .equipo/render.json, fonts, Mac and Linux arm64 renderers, Engineering using render_page, suggest_note, a continuation after a team-wide Add.
Facts the plan rests on (main 55e192cf)
- Protocol is 35 (
ProtocolChangeDiffs); the next migration is 0115. Whoever lands second renumbers. Authorize(internal/equipo/chat/runners.go:595) is every lease's start and purpose check;authorizeResearchsits there.AuthorizePublication(transfers.go:283) confirms a worker commit's push.startTask(tasks.go:1017) refuses a task that has any step.researchGrantfinds the one activeresearch-v1row;cancelResearchcancels every Research step and is the only revocation path.- The thin runner commits and pushes Engineering's work itself; its
submit_candidateandask_personare fixed-text tools (thin/mcp.go:219). Provider profiles fix an exact tool list (provider/actions.go:91, with the oldsubmit_render), Claude's launcher accepts only those (claude/launcher.go:140), and native file permissions are per specialist (claude/answers.go:249).specialistRun.researchbinds kept images read only at/research. - Engineering runs under bubblewrap with
--unshare-pidand--new-session(provider/policy.go:686). Processes inside may start nested namespaces (Claude's own Bash sandbox), all descendants of the sandbox's first process. exportPreview(thin/preview.go:236) exportsrelease/preview.json's output from git objects;scanPreviewruns the pinned gitleaks over an export.gitleaksSHA256is linked by ldflags (Makefile:290).build-instance-release.shembeds a fixed asset list, and the asset reader caps a file at 128 MiB (install_assets.go:77).scripts/ci-chromium.jsonpinschromium-headless-shell156.0.8078.79-1~deb13u1 and only what a Debian image lacks: essential packages such aslibc6come from the CI image (ci-chromium-pin.py:117).- Research uploads are staged and marked kept only after the final report validates them (
research_results.go:244,:547); the task-file route serves only kept, complete files. - Turn kinds are person,
move_in,exploreandhousekeeping;propose_specialistruns only in a live person turn. - The direction card's answers are Build, Try again (with a note) and Drop; Build creates a change task (
explore.go:281).
Rules for every task
Tests first: write the failing test, run it, see it fail for the right reason. Then the code. Then a mutation check for each guard: break the guard, see its test fail, restore it. The commit body records the test command, the failure seen, and each mutation and its result. Targeted go test ./pkg/... -run TestX while working; make ci once at the end. CGO_ENABLED=0, Go caches at their defaults, scratch in on-disk $TMPDIR, servers on 127.0.0.1. New strings go into copy.go marked pending. Migrations are additive.
Half 1a: the renderer (Linux amd64 only)
- Spike first, on docs-t1. Build a throwaway tree from the full runtime closure (task 2's list, including the loader and libc) and run the headless shell, its own sandbox on, inside a bubblewrap launch shaped like task 5 with no host
/usr. It must render a fixture page. If Chromium's sandbox cannot start there, stop and report: the spec forbids--no-sandbox, and that is Paul's call. Record the result and the exact bubblewrap arguments in the commit. - Pin the full closure.
scripts/ci-chromium-pin.pyalso writesinternal/release/renderer.jsonfor amd64: the browser packages ofci-chromium.jsonat the same versions plus every essential package they need (no pruning of the base), so the tree runs with nothing from the host. A test fails when a browser package or version differs between the two files. Nothing at runtime downloads anything. - Tree and manifest (release build).
scripts/build-renderer-tree.pyfetches the pinned debs (sha256 checked), unpacks them into one tree, and writesMANIFEST: one sorted line per entry,file <path> <sha256> <mode>,link <path> <target>ordir <path>. Links must be relative and resolve inside the tree. A deterministic gziprenderer.tar.gzholds both. The Makefile links the manifest's sha256 into the runner asrelease.rendererSHA256; the release manifest's Linux target gainsRendererSHA256. Tests: same inputs give the same bytes; a bad deb hash, an escaping or absolute link fails; no pin linked meansunpinned. - Verify.
release.VerifyRenderer(dir, pin):MANIFEST's sha256 is the pin; every entry exists with that type, hash and mode; links as listed; nothing extra; nothing group or world writable. Tests: tampered byte, extra file, missing file, link retargeted, mode widened, manifest swapped with a matching tree. Astra reviews this task. - Sandbox launch. Package
internal/runner/render,launch_linux.go, with the spike's arguments:--unshare-all(never--share-net),--die-with-parent,--new-session,--clearenv,--cap-drop ALL; the verified tree read only as the root's/usrand loader paths, the export read only at/site,/outread-write, a tmpfs/tmp, a fresh/proc, a minimal/dev; no home, runner state or credentials; every inherited descriptor closed except the browser and status pipes. Inside,equipo-runner render-sandboxserves/siteon 127.0.0.1 and starts the browser with--remote-debugging-pipeand--host-resolver-rulesmapping every other host to not found. Tests (Linux, skipped without bubblewrap): from inside, a public IP, the host's tailnet address and a listener the test opens on the host's 127.0.0.1 are unreachable; a parent descriptor is not visible; the environment is empty;/siteis read only; an external redirect is reported, not followed. Astra reviews this task. - Browser driver. A small CDP client over the pipe (stdlib only). Per page: viewport (phone 390x844, tablet 834x1194, desktop 1440x900), navigate, wait for load then network idle (at most 5 s), capture (full page clipped at 10,000 px), console errors (20), failed loads (30: external blocked, not found, font), same-site anchors answering 404 (30), the accessibility tree outlined to 8 KiB, the title. Output: a JSON report and PNGs in
/out. 60 s and 2 GiB per call, killed on overrun. Fixture sites: console error, CDN script, web font, broken link, a very tall page, a script that never ends (timeout), a page that kills the renderer (crashed). - Release delivery, install and verify-installed.
build-instance-release.shembedsrenderer.tar.gz(amd64); the asset reader allows that one name up to 384 MiB and the usual 128 MiB for the rest. Install assets serve it on Linux.setup/install.go,install-v1.sh,upgrade-thin.sh,cutover-thin.shandcutover-finish-thin.shunpack it to<runner dir>/renderer/<first 12 of pin>/through a temporary directory and a rename, verify it, render the fixture page with tasks 5 and 6, and refuse on any failure.verify-installeddoes the same check and fixture render. Mac and arm64 installs neither need nor check one. Old trees are removed by name. Tests: asscanner_install_test.goandverify_installed_test.go, plus one install from a release built by the real script into$TMPDIR(Linux, skipped without bubblewrap). - Health. The runner reports
ToolHealth.Rendereron Linux amd64:okonly whenVerifyRendererpasses and a fixture render has succeeded with this tree since the runner started;missing,mismatchorunpinnedotherwise. It rechecks the files before each render. Mac and arm64 send nothing.statussays a bad renderer needs the runner updated, not another try. Tests: each state; a tree that verifies but cannot render is notok. - Workspace snapshot. For
tree: workthe runner pauses the step, then does everything inside the pause: it reads the workspace'srelease/preview.jsonwithreadPreviewConfig's rules and copies the output directory into a runner-private stage byexportStatic's rules, opening every path withopenat2andRESOLVE_BENEATH | RESOLVE_NO_SYMLINKSfrom the workspace root, regular files only, caps applied. The pause: SIGSTOP to every descendant of the step sandbox's first process (which covers nested namespaces), rescanning until every one reads stopped in/proc/<pid>/statand no new one appears; then the copy; then SIGCONT to all on every exit path, panics included. The 10-second bound covers stopping and copying; past it the runner resumes and refuses withbusy. No git index is used and nothing is written to the workspace or branch, a simplification of the spec's private index with the same guarantees. No cgroup is frozen. Tests: a writer that appends a counter every millisecond, from a nested namespace too, makes no progress between pause and resume; a link at any depth is not followed; files outside the output are not copied; SIGCONT after an injected panic and after the bound; mutation: skip one descendant and the writer test fails. Astra reviews this task. render_page(runner side, no profile yet). Strict input (tree, up to 6pagesof path, viewport,full_page, andcompare).baseexports the task's base commit withexportPreview(no_sitewithoutrelease/preview.json);workuses task 9.scanPreviewruns over every export first: a finding refuses withsecrets, an unusable scanner withscanner(two codes the spec did not list; both refuse before any render). One render at a time per runner; per step 20 calls and 60 captures (too_many), counted in the step's state so a restart keeps them. Each PNG is decoded and re-encoded by the runner (downscaled until at most 2 MB).comparepairs the trees' captures with a changed-pixel ratio and a diff PNG. Captures go to the step's render directory. The text reply lists captures and reports, every page string quoted under a "from the rendered page" label, bounded, control characters stripped. Tests: each code, bounds, the label, a hostile PNG re-encoded.
Checkpoint: half 1a ends green on its own (go test of the touched packages) and is pushed before 1b starts.
Half 1b: Design
- Wire, protocol 36 (
ProtocolDesign).DispatchCommandgainsSpecialistID,SpecialistRevision,SpecialistProject,ProfileandCapabilities;LeasePurposeRender; the final report'sOptions[{name, captures [{id, sha256, treedigest}]}] (at most 4 options, 12 captures); a `renderfilechunk frame (asresearchfile);AnswerCard.Noteon Build;Specialist.Project;proposespecialist'sproject`. Encode refuses a dispatch with a specialist id, and a render lease check, below 36. Tests: round trips, refusals below 36, bounds. - Menu and pack.
design-v1: capabilitiesbranch.editandpage.render, toolsrender_page,submit_candidate,ask_person, aPackdigest.web.researchstays exclusive.Describewords for the two capabilities. The packinternal/specialist/packs/design-v1.mdis our own discipline drawing on impeccable's method (its licence checked and recorded in the commit), plus reading the project'sDESIGN.mdas quoted context and the mockup layout (mockups/<task>/, one page per option,release/preview.jsonnaming the folder). Paul reviews the pack once (task 21). - Executable policy for Design. A
designaction profile inprovider/actions.gowith exactlyrender_page,submit_candidateandask_person(nosubmit_render); Claude's launcher and allowlist accept it; native file permissions add read-only access to/renderand nothing else beyond Engineering's. The golden test of task 12 also pins this policy. Tests: a real Claude launch with a fake model (as the step tests do) lists exactly those tools and reads a capture from/render; a write there is refused; Engineering's policy is unchanged. - Storage, migration 0115.
chat_specialists.project_id("" team);chat_tasks.maker_specialist_id;chat_steps.specialist_id,specialist_revision,specialist_project,specialist_caps,design_runs(see task 17);chat_task_files.source(researchorrender),optionandtree_digest. Models, schema, migration check. Team records, neverscope.Owned. - Proposal, scope and continuation.
propose_specialisttakesdesign-v1and an optionalproject(a project the person already has; "" is the team). One open proposal and one active row per profile and scope. A Not now on that profile and scope in the last 7 days refuses (an owner can still add from the team page). The card shows name, scope and each capability's words. A project-scoped Add, in its transaction, queues one turn of a new kindspecialist_addedin the proposing turn's lane, keyed by the card (a second Add or a retry queues nothing). Its opening carries the instance's record ("Paul added Design for Patrix") under Equipo's label and quotes the person's message from the proposing turn under the person's label. That turn is bound to the card:record_taskonly in the card's project (noadd_project,create_projector implicit add),start_taskonly for a task this turn recorded and only with the card's specialist, whose grantgrantForstill finds; every other mutation is refused. A team-wide Add queues nothing (the coordinator's reply says it was added). Tests: member can't add; stale revision; double tap; decline window; the labels; the bound tools called with another project, another task, another specialist, and after a revoke. Astra reviews this task. - Grants for every specialist.
grantFor(profile, project)generalisesresearchGrant: the active row for that profile and project, else the team row; grants exactly the profile's capabilities, unrevoked, at its revision, given by its approver, an owner now. Research resolves against the task's project the same way. Dispatch writes the step's full binding (id, revision, project, capabilities) and appends aspecialist.usedaudit row.Authorizerefuses a step whose binding no longer equalsgrantForfor its task's project (start andLeasePurposeRender);authorizePublicationdoes the same before a push.RevokeSpecialistcancels the steps bound to that specialist only (Research ones as today, maker ones as an ordinary cancel) and withdraws their pending publications. Tests: revoke between dispatch and start, between two renders, between commit and push; approver demoted; profile missing from the menu; project row over team row; revoking one project's Design leaves another's running. Astra reviews this task. - Routing, the autonomy limit and recovery.
statuslists active specialists (id, profile, name, brief, scope) andrunner.tools.renderer.start_tasktakes an optionalspecialistid: active, grant usable, scope the task's project or the team, profile a maker. The task recordsmaker_specialist_id; fix rounds, retries, Try again and the task Build this creates use it (the step kind staysengineering). Placement sends a Design step only to a runner at 36 with the rendererokand a Claude connection, else it waits withdesign_runner. Limit: the task counts Design attempts (first runs, retries, fix rounds) since the person last acted on it (a message in its thread or an answer on its cards), stored on the task; the fourth is not dispatched and the step is held for the person through the existing held-step card. Recovery: after a revoke, once every attempt of the task's Design steps is terminal and has its termination proof (Terminated, whatever its state, done included) and the task is notbusy(explore.go:175), the task's creator gets one card, "Design was removed. Hand this task to Engineering?"; their tap, checked against both again in its transaction, clears the maker and queues Engineering. Coordinator surface as places did: schemas and descriptions, the Claude allowlist,provider.ConverseTools,MutationKinds, the opening's sentence and a newhouseRule. Tests: each refusal; Try again keeps Design; Build's task inherits it; the fourth attempt held; the counter reset by a message; a terminal attempt (cancelled or done) without its termination proof blocks the recovery card and the tap, and allows them once the proof arrives. - The Design step (runner). A dispatch with profile
design-v1runs Engineering's step with task 13's policy, the pack and brief as the prompt,/renderbound read only, and the tools live:render_page(each call first aLeasePurposeRendercheck),submit_candidate(records options; the runner still commits and pushes at the end),ask_person(as today). Before the final report, the named captures go up asrender_filechunks. Claude only. Tests: a refused render lease stops rendering and says why; uploads are bound to the attempt. - Captures, task page and direction card (instance). As Research: chunks for the step's current attempt are staged, never served; the final report's options, capture ids, hashes and tree digests are validated against the staged files, the PNG fully decoded within bounds, and the binding checked with
grantForin that transaction; only then are the files kept. The task page shows kept captures by option; the direction card shows them too. With more than one option, Build needs a note (the person's words, at mostMaxDirectionNote) that goes into the new task's brief quoted as theirs. Web UI: day theme, token colours, attribute grammar, scriptless forms, no split screen, no coloured left-border accents. Native: check how direction cards render; a multi-option Build without a note is refused as a card conflict telling them to open it on the web. Tests: revoke during upload, a foreign capture id, an incomplete upload, a PNG that passes its signature but not decoding, Build with and without a note. - End to end. A thintest contract: a primary at 36 with the renderer
ok(a fake renderer) and a Claude connection. The person asks for a Patrix design overhaul; the fake coordinator proposesdesign-v1for Patrix; the owner taps Add; the continuation records an explore task and starts it with Design; the dispatch carries the binding; the fake model renders, writes options and submits; captures are kept; the task page and direction card show them; Build with a note creates the change task with Design as maker. Refusals: revoke mid-step, runner at 35, renderer notok, member tap, decline window. - Copy. See below.
Copy
New strings (the Design card, capability and scope words, the continuation's record line, design_runner, the held limit, the recovery card, the Build note prompt and refusal, gallery labels, renderer status words) go into copy.go marked pending and into /home/paulca/.cache/specialists-1-copy.json as copy-review entries, with the evidence file docs/superpowers/plans/2026-11-28-dynamic-specialists-slice-1-copy.md, as places slice 1 did. Luna reviews them all and its text is applied; the cards and the pack go to Paul. The builder never marks copy accepted: acceptance happens only through the repository's own copy flow, and the pending-copy gate stays red until then.
Reviews and the round limit
Astra (gpt-6-astra, effort high, read-only) reviews this plan, tasks 4, 5, 9, 15 and 16 as they finish, and the whole branch at the end. Each review gets at most three rounds. After a third round's findings are fixed, the fix is recorded here and not reviewed again; a finding that needs a product decision goes to Paul.
Verification and handoff
make ci once at the end, after the branch review. Push specialists-slice-1; no merge, release or deploy. The controller report lists the commits, the mutation checks, Astra's verdicts, the copy file and what happens after release: an agent-run upgrade (whose verify-installed renders the fixture page on the production runner), then Paul asks for the Patrix design overhaul and taps Add.
Astra plan round 1: NOT READY (11 findings, all taken)
Full closure pinned and the spike moved first (1); the pause covers every descendant, is verified, and holds the config read and rooted copy (2); a Design executable policy (3); release delivery with a size bound and a real-build install test (4); the continuation bound to the card (5); the full binding stored and cancellation by specialist (6); a recovery card (7); staged captures validated by the final report (8); the three-attempt limit (9); ok needs a fixture render and verify-installed renders one (10); no delegated acceptance by the builder (11).
Astra plan round 2: READY AFTER FIXES (1 finding, taken)
Recovery waits for the task to be not busy, so a cancelled Design attempt must have its termination proof before Engineering can start, checked again at the tap.
Astra plan round 3: READY AFTER FIXES (1 finding, taken; round limit)
A Design attempt that completed (not only one cancelled) also needs its termination proof before the recovery card or its tap. Fixed in task 17 and not reviewed again.
Build notes (2026-11-29)
Built on specialists-slice-1 from design-dynamic-specialists with main 8bd40ed1 merged. Protocol 36; migrations 0115 to 0118.
- Task 1 gate: PASS. Chromium's own sandbox runs inside the render sandbox on docs-t1 with nothing from the host's
/usr(commit 79b79d7c records the arguments and the 98 packages). - Astra task reviews (round limit three): task 4 READY at round 2; tasks 5, 9, 15 and 16 READY at round 3. Whole branch: NOT READY (7 Important, 2 Minor), then NOT READY (2 open), then READY at round 3.
- Task 9 ruling: the pause is defence in depth, not a boundary against a hostile process inside the step (it already chooses what the work tree renders). No seccomp in slice 1; after the copy, while still paused, every copied path is checked again and any change refuses with
busy. - Copy: Luna reviewed all 27 strings (6 changed). Everything stays COPY REVIEW PENDING; the cards and the Design pack wait for Paul (
2026-11-28-dynamic-specialists-slice-1-copy.md). make cionce, then fixes for its three findings of ours; still red on pending copy (by design) and onTestBrowserGitHubManifestCSP, which fails the same way at the branch base on docs-t1.- Not built here: the Swift changes were not compiled (no Xcode on docs-t1); native screenshots on the task page; a team page Add.
Merge with main (2026-11-30)
Main cfe54cfc merged (b320a698). Main took protocol 36 (lookups) and 37 (Mac Engineering, slice F) and migrations 0115-0117 and 0120, so Design is now protocol 38 (ProtocolDesign, the current protocol) and its migrations are 0121-0124. Read 38 for 36 and 0121-0124 for 0115-0118 above. A Mac worker refuses a specialist-bound dispatch; a Design task on a Mac-only project would wait on the renderer (untested). Copy: Paul’s 15 strings and the pack approved unchanged, Luna's 12 accepted by delegation (see the copy file).