oficina / equipo Public

runner: Design's executable policy (design_step, /render read-only)

Task 13 of dynamic specialists slice 1 (half 1b).

What changed:
- internal/specialist/menu.go: Profile gains Policy {Action, Native,
  ReadOnly}. design-v1's is design_step, Engineering's six native tools
  and /render; research-v1's stays zero (its step is pinned in the
  runner's code). The task 12 golden pins it, and copies are deep.
- provider/actions.go: action profile design_step (role Design, submits
  submit_candidate) whose tools are exactly design-v1's: render_page,
  submit_candidate, ask_person, never submit_render. DesignTools,
  DesignMCPTools and DesignReadOnly read the menu. RenderReaderAction
  holds only for design_step. Policy.RenderReader. Launch.RenderDir. The
  legacy plan-workflow "design" action is unchanged.
- claude/launcher.go: the allowlist takes render_page only with
  design_step (AcceptsTools holds it to the three). For design_step,
  Write and Edit on /render are denied and the sandbox denies writes
  there. Engineering's policy is byte for byte unchanged.
- claude/answers.go: DesignPermission is Engineering's StepPermission
  plus Read, Glob and Grep under /render. A write there is refused
  ("/render is read-only"). With any policy other than design_step it
  is Engineering's. StepPermission passes no extra reads.
- containment/mounts.go: Launch.RenderDir is bound read-only at
  /render, for design_step only, with /research's checks (bindKept).
- thin: designTools (render_page stub, submit_candidate, ask_person),
  designCall and designRun; specialistRun.render goes to the launch.
  render_page is listed but refuses with a fixed text until task 18
  serves it.
- Codex and the metered harnesses refuse design_step already (pinned in
  a Codex test).

Tests:
  go test ./internal/specialist/
  go test ./internal/runner/provider/ -run 'TestDesign|TestEngineering'
  go test ./internal/runner/provider/claude/ -run 'TestDesign|TestEngineering'
  go test ./internal/runner/provider/codex/ -run TestDesignStepIsClaudeOnly
  go test ./internal/runner/containment/ -run 'Render'
  TMPDIR=/tmp/s1.X go test ./internal/runner/thin/ -run 'TestDesign|TestEngineeringStep'
TestDesignStepPolicyRealLaunch is a real Claude launch: the fake CLI
runs in bubblewrap, its init lists exactly Engineering's natives plus
the three tools, it copies /render/1-work-1.png into the workspace, a
Write there is denied by the callback, and a direct write gets EROFS.
TestEngineeringPolicyUnchanged compares Engineering's policy and
callback answers with testdata recorded at HEAD 6cc538be (re-recorded
with this change stashed: same bytes).

RED: the specialist golden did not build (no Profile.Policy); the
provider tests did not build (no DesignStepAction). With a placeholder
DesignPermission, claude's tests failed with provider_policy_rejected
(the allowlist refused render_page). The containment tests failed with
"render directory accepted" and FileNotFoundError: '/render'. The thin
tests did not build (no designRun).
GREEN: all of the above ok.

Mutations (each broken, failing test seen, restored):
- submit_render back in design_step's Tools: TestDesignActionProfile,
  TestDesignPolicyIsEngineeringsPlusRender, and the real launch
  (step init policy_rejected).
- /render writable in the callback: TestDesignPermission, and the real
  launch ("was allowed"). Writable bind: TestNamespaceRenderDirReadOnly,
  and the real launch ("worked"). No sandbox denyWrite, or no Write/Edit
  denials: TestDesignPolicyIsEngineeringsPlusRender.
- A path added: "/tmp" in the menu's ReadOnly broke TestMenuGolden;
  "/etc" in the callback broke TestDesignPermission; WebFetch added to
  the Design role broke TestDesignPolicyIsEngineeringsPlusRender.
- A tool dropped: ask_person off the menu broke TestMenuGolden and
  TestDesignActionProfile; off the thin list it broke
  TestDesignToolSurface and the real launch.
- Engineering: /render reads in StepPermission, or /render denials for
  implement, broke TestEngineeringPolicyUnchanged. render_page allowed
  outside design_step broke TestDesignPolicyRefusals.
- The containment gate removed: TestRenderDirRefusals and
  TestEngineeringStepNoRender. RenderReader for legacy "design":
  TestRenderDirRefusals. RenderDir not passed by engineer.run: the real
  launch (capture not read).

Cross gates: darwin/arm64 build of cmd/equipo-runner and the darwin vet
of the runner, wire and release packages pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 59eccd0b342aeb2eb091286963bf15f84e39e2e0 parent 6565403
17 files changed, +1,110 −26
  • internal/runner/containment/mounts.go +30 −8
  • internal/runner/containment/render_test.go +130 −0
  • internal/runner/provider/actions.go +50 −0
  • internal/runner/provider/claude/answers.go +45 −11
  • internal/runner/provider/claude/design_policy_test.go +291 −0
  • internal/runner/provider/claude/launcher.go +21 −2
  • internal/runner/provider/claude/testdata/engineering-permission.golden.txt +44 −0
  • internal/runner/provider/claude/testdata/engineering-policy.golden.json +57 −0
  • internal/runner/provider/codex/design_policy_test.go +21 −0
  • internal/runner/provider/design_action_test.go +81 −0
  • internal/runner/provider/policy.go +7 −0
  • internal/runner/provider/types.go +7 −3
  • internal/runner/thin/design_policy_test.go +236 −0
  • internal/runner/thin/engineer.go +5 −1
  • internal/runner/thin/mcp.go +37 −0
  • internal/specialist/design_test.go +22 −0
  • internal/specialist/menu.go +26 −1

CI failed — run details

CI log
=== prepare ===
ci-box: machine: aarch64, 32 CPUs, 62 GiB memory, kernel 7.0.0-1017-aws
ci-box: python 3.12.3; Docker version 29.1.3, build 29.1.3-0ubuntu3~24.04.2
ci-box: user namespaces allowed: 233151
ci-box: cgroup: cgroup2fs
ci-box: disk /home/ci/work/repos/oficina__equipo/wt/specialists-slice-1: Type  Size Avail | ext4   96G   84G
ci-box: disk /home/ci/.cache/equipo-ci-box: Type  Size Avail | ext4   96G   84G
ci-box: bwrap: fetched and verified in 0.3s
ci-box: claude: fetched and verified in 1.4s
ci-box: codex: fetched and verified in 3.4s
ci-box: codex-code-mode-host: fetched and verified in 1.3s
ci-box: libwrap: fetched and verified in 0.3s
ci-box: socat: fetched and verified in 0.3s
npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead
ci-box: image pulled in 9.7s
ci-box: pi: installed and verified in 7.4s
ci-box: opencode: installed and verified in 1.9s
ci-box: chromium 156.0.8078.79-1~deb13u1: 76 packages fetched, verified and unpacked in 8.7s
ci-box: clone deepened in 4.2s
ci-box: file times set from content: 3384 files, 221 directories
ci-box: ready in 17.3s
=== copy ===
EQUIPO_RELEASE_COPY_CHECK=1 CGO_ENABLED=0 go test ./internal/equipotest -run '^TestReleaseCopyReviewed$' -count=1
ok  	amadan.net/oficina/equipo/internal/equipotest	0.149s
=== compile ===
go build ./...
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py compile
+ go build -tags testbuild ./...
  6.3s
+ go list -export -test -tags testbuild -f  ./...
  5.9s
+ go list -export -test -tags browser,testbuild -f  ./internal/equipo ./internal/equipotest ./internal/headless ./internal/idtest ./internal/plan3test ./internal/thintest
  3.6s
rastrillo: budget size: 6 problem(s)
exit status 1
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -version
staticcheck 2026.1 (v0.7.0)
go run golang.org/x/vuln/cmd/govulncheck@v1.8.0 -version
Go: go1.26.11
Scanner: govulncheck@v1.8.0
DB: https://vuln.go.dev
DB updated: 2026-11-24 15:56:00 +0000 UTC

go run github.com/zricethezav/gitleaks/v8@v8.30.1 version
version is set by build process
=== check ===
--- shard 0 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-work: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadless$/^4c_rebase$|^TestHeadless$/^4b_ask$|^TestHeadless$/^4c_checks_card$|^TestHeadless$/^4_step_crash$' ./internal/headless

receipt: test step 1m24.02s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m21.071s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m21.07s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 72.94, cpu waiting 46.43%, memory waiting 0.00%, io waiting 0.48%
--- shard 1 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-review: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadless$/^4_review$|^TestHeadless$/^2b_access$|^TestHeadless$/^runner_crash$|^TestHeadless$/^2b_first_message$|^TestHeadless$/^4_checks_honest$|^TestHeadless$/^7_stream_resume$|^TestHeadless$/^2b_notebook$|^TestHeadless$/^2b_move_in$|^TestHeadless$/^2b_desk_failure$|^TestHeadless$/^cancel$' ./internal/headless

receipt: test step 1m25.827s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m22.81s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m22.81s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 72.94, cpu waiting 46.71%, memory waiting 0.00%, io waiting 0.46%
--- shard 2 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-connections: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadlessConnections$|^TestHeadlessTokenPasteEndToEnd$|^TestHeadlessTokenConnection$' ./internal/headless

receipt: test step 1m25.262s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m22.222s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m11.33s amadan.net/oficina/equipo/internal/headless TestHeadlessConnections
receipt: slow test 5.8s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenPasteEndToEnd
receipt: slow test 5.09s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenConnection
machine: 32 CPUs, load 72.94, cpu waiting 46.71%, memory waiting 0.00%, io waiting 0.46%
--- shard 3 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-mac: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestMacWorker$|^TestHeadlessAttachments$|^TestHeadlessPrewarm$|^TestHeadless$/^1_first_token$|^TestHeadless$/^6_quick_messages$|^TestHeadless$/^8_instance_restart$|^TestHeadless$/^3_runner_offline$' ./internal/headless

receipt: test step 1m22.514s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m19.931s amadan.net/oficina/equipo/internal/headless
receipt: slow test 40.33s amadan.net/oficina/equipo/internal/headless TestMacWorker
receipt: slow test 21.14s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 9.26s amadan.net/oficina/equipo/internal/headless TestHeadlessPrewarm
receipt: slow test 9.19s amadan.net/oficina/equipo/internal/headless TestHeadlessAttachments
machine: 32 CPUs, load 72.94, cpu waiting 46.43%, memory waiting 0.00%, io waiting 0.48%
--- shard 4 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-guards: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadlessCopyRotation$|^TestHeadlessPolicyGuards$|^TestHeadlessRunnerKillLeavesNoCopies$|^TestHeadlessNewHouseRuleStartsFresh$|^TestHeadless$/^3_engineering$|^TestHeadless$/^3_step_cancel$|^TestHeadless$/^3_step_contained$|^TestHeadless$/^3_step_refused$|^TestHeadless$/^3_empty_repo$|^TestHeadless$/^3_empty_engineering$|^TestHeadless$/^3_empty_merge$|^TestHeadless$/^3_empty_merge_rebuilt$|^TestHeadless$/^3_empty_fix_round$' ./internal/headless

receipt: test step 1m39.939s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m37.721s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m7.42s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 9.48s amadan.net/oficina/equipo/internal/headless TestHeadlessRunnerKillLeavesNoCopies
receipt: slow test 8.42s amadan.net/oficina/equipo/internal/headless TestHeadlessCopyRotation
receipt: slow test 7.46s amadan.net/oficina/equipo/internal/headless TestHeadlessPolicyGuards
receipt: slow test 4.94s amadan.net/oficina/equipo/internal/headless TestHeadlessNewHouseRuleStartsFresh
machine: 32 CPUs, load 68.58, cpu waiting 43.32%, memory waiting 0.00%, io waiting 0.35%
--- shard 5 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-rest: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -skip '^TestHeadless$/^4c_rebase$|^TestHeadless$/^4b_ask$|^TestHeadless$/^4c_checks_card$|^TestHeadless$/^4_step_crash$|^TestHeadless$/^4_review$|^TestHeadless$/^2b_access$|^TestHeadless$/^runner_crash$|^TestHeadless$/^2b_first_message$|^TestHeadless$/^4_checks_honest$|^TestHeadless$/^7_stream_resume$|^TestHeadless$/^2b_notebook$|^TestHeadless$/^2b_move_in$|^TestHeadless$/^2b_desk_failure$|^TestHeadless$/^cancel$|^TestHeadlessConnections$|^TestHeadlessTokenPasteEndToEnd$|^TestHeadlessTokenConnection$|^TestMacWorker$|^TestHeadlessAttachments$|^TestHeadlessPrewarm$|^TestHeadless$/^1_first_token$|^TestHeadless$/^6_quick_messages$|^TestHeadless$/^8_instance_restart$|^TestHeadless$/^3_runner_offline$|^TestHeadlessCopyRotation$|^TestHeadlessPolicyGuards$|^TestHeadlessRunnerKillLeavesNoCopies$|^TestHeadlessNewHouseRuleStartsFresh$|^TestHeadless$/^3_engineering$|^TestHeadless$/^3_step_cancel$|^TestHeadless$/^3_step_contained$|^TestHeadless$/^3_step_refused$|^TestHeadless$/^3_empty_repo$|^TestHeadless$/^3_empty_engineering$|^TestHeadless$/^3_empty_merge$|^TestHeadless$/^3_empty_merge_rebuilt$|^TestHeadless$/^3_empty_fix_round$' ./internal/headless

receipt: test step 3m3.946s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 3m1.972s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m44.25s amadan.net/oficina/equipo/internal/headless TestHeadlessAssistant
receipt: slow test 20.56s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 9.38s amadan.net/oficina/equipo/internal/headless TestHeadlessResearchHandoff
receipt: slow test 7.47s amadan.net/oficina/equipo/internal/headless TestHeadlessAssistantAttachments
receipt: slow test 6.75s amadan.net/oficina/equipo/internal/headless TestHeadlessTurnBatching
machine: 32 CPUs, load 23.72, cpu waiting 11.29%, memory waiting 0.00%, io waiting 0.08%
--- shard 6 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane thintest: ./internal/thintest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^Test([^C]|C[^o]|Co[^n]|Con[^t])|^TestContract(Assistant|Outcome|Team|Handoff|HostAllowlist|HostIsPerPerson|Look|Use[A-Z]|RemoteCall|LanesRunAtOnce|NoMergeQuestionWhenGateMerges|PreviewHeldUntilPublishAnswer|PreviewNotHeldBelow19|PublishNeedsOwnerAnswer)' ./internal/thintest

receipt: test step 2m18.765s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 2m16.838s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 10.14s amadan.net/oficina/equipo/internal/thintest TestContractTeamJobSettledStates
receipt: slow test 6.77s amadan.net/oficina/equipo/internal/thintest TestExplorePreviewsOff
receipt: slow test 5.15s amadan.net/oficina/equipo/internal/thintest TestContractTeamNudgePersonNeeds
receipt: slow test 3.9s amadan.net/oficina/equipo/internal/thintest TestContractPreviewHeldUntilPublishAnswer
receipt: slow test 2.79s amadan.net/oficina/equipo/internal/thintest TestContractTeamUpdatePersonNeeds
machine: 32 CPUs, load 42.94, cpu waiting 24.17%, memory waiting 0.00%, io waiting 0.18%
--- shard 7 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane thintest-contract: ./internal/thintest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -skip '^Test([^C]|C[^o]|Co[^n]|Con[^t])|^TestContract(Assistant|Outcome|Team|Handoff|HostAllowlist|HostIsPerPerson|Look|Use[A-Z]|RemoteCall|LanesRunAtOnce|NoMergeQuestionWhenGateMerges|PreviewHeldUntilPublishAnswer|PreviewNotHeldBelow19|PublishNeedsOwnerAnswer)' ./internal/thintest

receipt: test step 2m0.827s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m57.908s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 9.64s amadan.net/oficina/equipo/internal/thintest TestContractRetryPreviewUnverifiedMerge
receipt: slow test 9.15s amadan.net/oficina/equipo/internal/thintest TestContractPreviewNotScheduled
receipt: slow test 5s amadan.net/oficina/equipo/internal/thintest TestContractPublishNotOffered
receipt: slow test 4.58s amadan.net/oficina/equipo/internal/thintest TestContractMacRecheckMergeAuthority
receipt: slow test 3.02s amadan.net/oficina/equipo/internal/thintest TestContractPausedJob
machine: 32 CPUs, load 53.44, cpu waiting 32.06%, memory waiting 0.00%, io waiting 0.25%
--- shard 8 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane runner-thin: ./internal/runner/thin
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m ./internal/runner/thin
--- FAIL amadan.net/oficina/equipo/internal/runner/thin TestSnapshotRefusesASelfResumingWriter
=== RUN   TestSnapshotRefusesASelfResumingWriter
    worksnap_adversary_linux_test.go:232: 0 of 5 copies saw the page change; 0 refused busy
    worksnap_adversary_linux_test.go:234: the self-resuming writer never wrote during a copy: the test proves nothing
--- FAIL: TestSnapshotRefusesASelfResumingWriter (0.77s)

--- FAIL amadan.net/oficina/equipo/internal/runner/thin (package output)
FAIL
rastrillo-budget/v1 ran 5m22.18s
FAIL	amadan.net/oficina/equipo/internal/runner/thin	322.262s


receipt: test step 5m23.814s against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 0 cached, 0 without tests, 1 failed
receipt: slow package 5m22.18s amadan.net/oficina/equipo/internal/runner/thin
receipt: slow test 37.03s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeAnsweredByAnotherModel
receipt: slow test 36.91s amadan.net/oficina/equipo/internal/runner/thin TestModelsEngineeringProbesThenRunsTheStrongest
receipt: slow test 36.83s amadan.net/oficina/equipo/internal/runner/thin TestModelsUnhealthyRetriedOnDemand
receipt: slow test 18.5s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeRunsInsideTheAdmission
receipt: slow test 10.1s amadan.net/oficina/equipo/internal/runner/thin TestTimeoutKeepsNothingForAnOlderInstance
rastrillo: budget test: go test failed
exit status 1
+ go test -tags testbuild -timeout 15m -v -run '^TestSnapshotRefusesASelfResumingWriter$' -count=1 ./internal/runner/thin   (retry, once)
FAILED TWICE ./internal/runner/thin:TestSnapshotRefusesASelfResumingWriter runner-thin
=== RUN   TestSnapshotRefusesASelfResumingWriter
    worksnap_adversary_linux_test.go:232: 0 of 5 copies saw the page change; 0 refused busy
    worksnap_adversary_linux_test.go:234: the self-resuming writer never wrote during a copy: the test proves nothing
--- FAIL: TestSnapshotRefusesASelfResumingWriter (0.77s)
FAIL
rastrillo-budget/v1 ran 775ms
FAIL	amadan.net/oficina/equipo/internal/runner/thin	0.787s
FAIL
machine: 32 CPUs, load 4.08, cpu waiting 1.09%, memory waiting 0.00%, io waiting 0.00%
make: *** [Makefile:113: ci-shard] Error 1

amadan: step check shard 8 of 29 failed: exit status 2
--- shard 9 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane runner-bug: ./internal/runner
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestDirectBugWorkflow$|^TestEnrolKeepsTheRole$' ./internal/runner

receipt: test step 51.513s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 50.372s amadan.net/oficina/equipo/internal/runner
receipt: slow test 30.34s amadan.net/oficina/equipo/internal/runner TestDirectBugWorkflow
receipt: slow test 20.02s amadan.net/oficina/equipo/internal/runner TestEnrolKeepsTheRole
machine: 32 CPUs, load 65.01, cpu waiting 34.95%, memory waiting 0.00%, io waiting 0.82%
--- shard 10 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane runner-plans: ./internal/runner
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestPlanWorkflowCandidateOrder$|^TestPlanWorkflowFeature$|^TestCoordinatorRecoveryCallRefusalKeepsServing$|^TestCoordinatorRefusalMatrix$' ./internal/runner

receipt: test step 1m3.237s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m1.661s amadan.net/oficina/equipo/internal/runner
receipt: slow test 51.67s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowCandidateOrder
receipt: slow test 44.69s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowFeature
receipt: slow test 8.43s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryCallRefusalKeepsServing
receipt: slow test 1.54s amadan.net/oficina/equipo/internal/runner TestCoordinatorRefusalMatrix
machine: 32 CPUs, load 73.74, cpu waiting 41.97%, memory waiting 0.00%, io waiting 0.67%
--- shard 11 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane runner-rest: ./internal/runner
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -skip '^TestDirectBugWorkflow$|^TestEnrolKeepsTheRole$|^TestPlanWorkflowCandidateOrder$|^TestPlanWorkflowFeature$|^TestCoordinatorRecoveryCallRefusalKeepsServing$|^TestCoordinatorRefusalMatrix$' ./internal/runner

receipt: test step 37.174s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 36.153s amadan.net/oficina/equipo/internal/runner
receipt: slow test 5.14s amadan.net/oficina/equipo/internal/runner TestDirectFaultIsolation
receipt: slow test 3.54s amadan.net/oficina/equipo/internal/runner TestClaimRefusalsBackOff
receipt: slow test 3.5s amadan.net/oficina/equipo/internal/runner TestToolVerbUnderFakeHarness
receipt: slow test 3.14s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryRefusedKeepsServing
receipt: slow test 1.61s amadan.net/oficina/equipo/internal/runner TestReportPostsRetryExactRequest
machine: 32 CPUs, load 50.13, cpu waiting 23.18%, memory waiting 0.00%, io waiting 1.04%
--- shard 12 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-a started 30s late; cpu waiting 39.5%, load 34.57
test lane equipotest-a: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^Test[A-D]|^TestQ' ./internal/equipotest

receipt: test step 1m12.374s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m10.375s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 30.68s amadan.net/oficina/equipo/internal/equipotest TestAuthorityCoreIntegration
receipt: slow test 30.64s amadan.net/oficina/equipo/internal/equipotest TestBootstrapNamesOwnersSetting
receipt: slow test 28.26s amadan.net/oficina/equipo/internal/equipotest TestAccountLabelMigration
receipt: slow test 25.12s amadan.net/oficina/equipo/internal/equipotest TestAuthorityFailureIsNotRevocation
receipt: slow test 25.02s amadan.net/oficina/equipo/internal/equipotest TestAuthoritySnapshotChanges
machine: 32 CPUs, load 68.58, cpu waiting 42.46%, memory waiting 0.00%, io waiting 0.34%
--- shard 13 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-e started 30s late; cpu waiting 41.4%, load 34.57
test lane equipotest-e: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^Test[E-P]' ./internal/equipotest

receipt: test step 2m18.15s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 2m15.847s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 22.29s amadan.net/oficina/equipo/internal/equipotest TestProjectWritesRequireCurrentOwner
receipt: slow test 22.28s amadan.net/oficina/equipo/internal/equipotest TestProjectsFailuresRollBack
receipt: slow test 22.27s amadan.net/oficina/equipo/internal/equipotest TestProjectsAccountRevisionAndValidation
receipt: slow test 22.25s amadan.net/oficina/equipo/internal/equipotest TestProjectBindingUniqueness
receipt: slow test 22.24s amadan.net/oficina/equipo/internal/equipotest TestProjectRejectsUnsafeBinding
machine: 32 CPUs, load 29.16, cpu waiting 14.74%, memory waiting 0.00%, io waiting 0.10%
--- shard 14 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-r started 30s late; cpu waiting 41.4%, load 34.57
test lane equipotest-r: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestR' ./internal/equipotest
budget note: internal/equipotest took 5m35.795s, over the 5m0s its record on line 15 allows; reported only, timing fails on CI

receipt: test step 5m41.522s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 5m35.795s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 4m43.26s amadan.net/oficina/equipo/internal/equipotest TestReleaseStampContract
receipt: slow test 13.22s amadan.net/oficina/equipo/internal/equipotest TestRosterChangesAffectExistingSession
receipt: slow test 10.17s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalWhileAssigned
receipt: slow test 10.12s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalRollsBack
receipt: slow test 7.06s amadan.net/oficina/equipo/internal/equipotest TestRosterBootstrapOnce
machine: 32 CPUs, load 2.60, cpu waiting 0.48%, memory waiting 0.00%, io waiting 0.00%
--- shard 15 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-rest started 30s late; cpu waiting 39.5%, load 34.57
test lane equipotest-rest: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -skip '^Test[A-D]|^TestQ|^Test[E-P]|^TestR' ./internal/equipotest

receipt: test step 1m11.914s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m9.864s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 28.42s amadan.net/oficina/equipo/internal/equipotest TestSigninNoProof
receipt: slow test 27.45s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedExistingTeam
receipt: slow test 27.37s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedRollback
receipt: slow test 25.31s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsUpgrade
receipt: slow test 25.28s amadan.net/oficina/equipo/internal/equipotest TestSpecialistSettingsRollbackAndUnavailable
machine: 32 CPUs, load 68.58, cpu waiting 43.32%, memory waiting 0.00%, io waiting 0.35%
--- shard 16 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: plan3test started 30s late; cpu waiting 41.4%, load 34.57
test lane plan3test: ./internal/plan3test
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m ./internal/plan3test
--- FAIL amadan.net/oficina/equipo/internal/plan3test TestPlan3ReleaseBoundaries
=== RUN   TestPlan3ReleaseBoundaries
--- FAIL: TestPlan3ReleaseBoundaries (0.34s)

--- FAIL amadan.net/oficina/equipo/internal/plan3test TestPlan3ReleaseBoundaries/inventory
=== RUN   TestPlan3ReleaseBoundaries/inventory
    plan3_release_test.go:22: entry has no copy review status or applicable acceptance chat.specialist.capability.branch.edit
--- FAIL: TestPlan3ReleaseBoundaries/inventory (0.01s)

--- FAIL amadan.net/oficina/equipo/internal/plan3test (package output)
FAIL
rastrillo-budget/v1 ran 55.955s
FAIL	amadan.net/oficina/equipo/internal/plan3test	56.427s


receipt: test step 58.257s against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 0 cached, 0 without tests, 1 failed
rastrillo: budget test: go test failed
receipt: slow package 55.955s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 4.17s amadan.net/oficina/equipo/internal/plan3test TestPlan3Upgrade
receipt: slow test 3.59s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3B
receipt: slow test 1.79s amadan.net/oficina/equipo/internal/plan3test TestConversationQuestionRace
receipt: slow test 1.68s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3A
receipt: slow test 1.37s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorMessageSourcesUpgrade
exit status 1
+ go test -tags testbuild -timeout 15m -v -run '^TestPlan3ReleaseBoundaries$/^inventory$' -count=1 ./internal/plan3test   (retry, once)
FAILED TWICE ./internal/plan3test:TestPlan3ReleaseBoundaries/inventory plan3test
=== RUN   TestPlan3ReleaseBoundaries
=== RUN   TestPlan3ReleaseBoundaries/inventory
    plan3_release_test.go:22: entry has no copy review status or applicable acceptance chat.specialist.capability.branch.edit
--- FAIL: TestPlan3ReleaseBoundaries (0.02s)
    --- FAIL: TestPlan3ReleaseBoundaries/inventory (0.02s)
FAIL
rastrillo-budget/v1 ran 19ms
FAIL	amadan.net/oficina/equipo/internal/plan3test	0.215s
FAIL
machine: 32 CPUs, load 71.18, cpu waiting 45.71%, memory waiting 0.00%, io waiting 0.42%
make: *** [Makefile:113: ci-shard] Error 1

amadan: step check shard 16 of 29 failed: exit status 2
--- shard 17 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: rest started 30s late; cpu waiting 41.4%, load 34.57
test lane rest: ./cmd/equipo ./cmd/equipo-runner ./cmd/equipo-tool-proxy ./internal/advice ./internal/attach ./internal/attach/attachtest ./internal/chatmarkdown ./internal/chatsend ./internal/chatstream ./internal/coordinator ./internal/coordinatorcontract ./internal/coordinatormail ./internal/copydesk ./internal/diffscan ./internal/equipo ./internal/equipo/activity ./internal/equipo/assist ./internal/equipo/chat ./internal/equipo/conversation ./internal/equipo/conversation/chatstate ./internal/equipo/door ./internal/equipo/github ./internal/equipo/housekeeping ./internal/equipo/icons ./internal/equipo/identity ./internal/equipo/kernel ./internal/equipo/library ./internal/equipo/mergegate ./internal/equipo/notifications ./internal/equipo/oficina ./internal/equipo/oficina/oficinatest ./internal/equipo/oficinaid ./internal/equipo/ownermode ./internal/equipo/pause ./internal/equipo/personapi ./internal/equipo/planning ./internal/equipo/push ./internal/equipo/setup ./internal/equipo/team ./internal/equipo/teamcontract ./internal/equipo/triage ./internal/fakeclaude ./internal/fakecodex ./internal/fakeopencode ./internal/fakepi ./internal/idtest ./internal/ownermodetest ./internal/release ./internal/release/renderertest ./internal/runner/checks ./internal/runner/connect ./internal/runner/containment ./internal/runner/containment/sysunix ./internal/runner/egress ./internal/runner/forge ./internal/runner/forge/forgetest ./internal/runner/heartbeat ./internal/runner/mac ./internal/runner/mcpresource ./internal/runner/metered ./internal/runner/pause ./internal/runner/planflow ./internal/runner/provider ./internal/runner/provider/claude ./internal/runner/provider/claude/realcli ./internal/runner/provider/codex ./internal/runner/provider/gotoolchain ./internal/runner/provider/opencode ./internal/runner/provider/pi ./internal/runner/render ./internal/runner/renderpage ./internal/runner/setup ./internal/runner/transporttest ./internal/runner/webread ./internal/runner/workspace ./internal/runnerproto ./internal/schedule ./internal/sealbox ./internal/specialist ./internal/stagingtest ./internal/taskplan ./internal/testci ./internal/toolproxy ./internal/websource ./internal/wire ./internal/wire/forgekey ./internal/wire/wireschema ./internal/wire/wiretest ./tools/drive
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m ./cmd/equipo ./cmd/equipo-runner ./cmd/equipo-tool-proxy ./internal/advice ./internal/attach ./internal/attach/attachtest ./internal/chatmarkdown ./internal/chatsend ./internal/chatstream ./internal/coordinator ./internal/coordinatorcontract ./internal/coordinatormail ./internal/copydesk ./internal/diffscan ./internal/equipo ./internal/equipo/activity ./internal/equipo/assist ./internal/equipo/chat ./internal/equipo/conversation ./internal/equipo/conversation/chatstate ./internal/equipo/door ./internal/equipo/github ./internal/equipo/housekeeping ./internal/equipo/icons ./internal/equipo/identity ./internal/equipo/kernel ./internal/equipo/library ./internal/equipo/mergegate ./internal/equipo/notifications ./internal/equipo/oficina ./internal/equipo/oficina/oficinatest ./internal/equipo/oficinaid ./internal/equipo/ownermode ./internal/equipo/pause ./internal/equipo/personapi ./internal/equipo/planning ./internal/equipo/push ./internal/equipo/setup ./internal/equipo/team ./internal/equipo/teamcontract ./internal/equipo/triage ./internal/fakeclaude ./internal/fakecodex ./internal/fakeopencode ./internal/fakepi ./internal/idtest ./internal/ownermodetest ./internal/release ./internal/release/renderertest ./internal/runner/checks ./internal/runner/connect ./internal/runner/containment ./internal/runner/containment/sysunix ./internal/runner/egress ./internal/runner/forge ./internal/runner/forge/forgetest ./internal/runner/heartbeat ./internal/runner/mac ./internal/runner/mcpresource ./internal/runner/metered ./internal/runner/pause ./internal/runner/planflow ./internal/runner/provider ./internal/runner/provider/claude ./internal/runner/provider/claude/realcli ./internal/runner/provider/codex ./internal/runner/provider/gotoolchain ./internal/runner/provider/opencode ./internal/runner/provider/pi ./internal/runner/render ./internal/runner/renderpage ./internal/runner/setup ./internal/runner/transporttest ./internal/runner/webread ./internal/runner/workspace ./internal/runnerproto ./internal/schedule ./internal/sealbox ./internal/specialist ./internal/stagingtest ./internal/taskplan ./internal/testci ./internal/toolproxy ./internal/websource ./internal/wire ./internal/wire/forgekey ./internal/wire/wireschema ./internal/wire/wiretest ./tools/drive
cache miss: amadan.net/oficina/equipo/internal/chatmarkdown: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/copydesk: its inputs changed
--- FAIL amadan.net/oficina/equipo/internal/runner/pause TestHoldStopsEveryWriter
=== RUN   TestHoldStopsEveryWriter
    pause_linux_test.go:238: Hold: sandbox could not be paused in time (called false)
    pause_linux_test.go:69: sandbox stderr: 
--- FAIL: TestHoldStopsEveryWriter (0.17s)

--- FAIL amadan.net/oficina/equipo/internal/runner/pause TestHoldReturnsWorkError
=== RUN   TestHoldReturnsWorkError
    pause_linux_test.go:251: Hold: sandbox could not be paused in time
    pause_linux_test.go:69: sandbox stderr: 
--- FAIL: TestHoldReturnsWorkError (8.51s)

--- FAIL amadan.net/oficina/equipo/internal/runner/pause TestHoldResumesAtTheBound
=== RUN   TestHoldResumesAtTheBound
    pause_linux_test.go:298: writers not resumed at the bound while the work ran on: moved []
    pause_linux_test.go:69: sandbox stderr: 
--- FAIL: TestHoldResumesAtTheBound (0.86s)

--- FAIL amadan.net/oficina/equipo/internal/runner/pause TestHoldStopsANamespaceJoiner
=== RUN   TestHoldStopsANamespaceJoiner
    pause_linux_test.go:503: sandbox could not be paused in time
    pause_linux_test.go:69: sandbox stderr: 
--- FAIL: TestHoldStopsANamespaceJoiner (0.49s)

--- FAIL amadan.net/oficina/equipo/internal/runner/pause TestHoldStopsAReparentedDaemon
=== RUN   TestHoldStopsAReparentedDaemon
    pause_linux_test.go:603: daemon made no progress in 2s
    pause_linux_test.go:69: sandbox stderr: 
--- FAIL: TestHoldStopsAReparentedDaemon (2.36s)

--- FAIL amadan.net/oficina/equipo/internal/runner/pause (package output)
FAIL
FAIL	amadan.net/oficina/equipo/internal/runner/pause	13.822s

--- FAIL amadan.net/oficina/equipo/internal/runner/provider/claude TestClaudeInitPolicy
=== RUN   TestClaudeInitPolicy
--- FAIL: TestClaudeInitPolicy (1.61s)

--- FAIL amadan.net/oficina/equipo/internal/runner/provider/claude TestClaudeInitPolicy/permission
=== RUN   TestClaudeInitPolicy/permission
    launcher_test.go:793: claude_turn_uncertain
--- FAIL: TestClaudeInitPolicy/permission (0.27s)

--- FAIL amadan.net/oficina/equipo/internal/runner/provider/claude TestClaudeFailureDiagnostics
=== RUN   TestClaudeFailureDiagnostics
--- FAIL: TestClaudeFailureDiagnostics (1.00s)

--- FAIL amadan.net/oficina/equipo/internal/runner/provider/claude TestClaudeFailureDiagnostics/tools
=== RUN   TestClaudeFailureDiagnostics/tools
    live_turn_test.go:54: claude_turn_uncertain
--- FAIL: TestClaudeFailureDiagnostics/tools (0.14s)

--- FAIL amadan.net/oficina/equipo/internal/runner/provider/claude (package output)
FAIL
rastrillo-budget/v1 ran 35.171s
FAIL	amadan.net/oficina/equipo/internal/runner/provider/claude	36.327s

--- FAIL amadan.net/oficina/equipo/internal/testci TestBudgetRecordsAreShort
=== RUN   TestBudgetRecordsAreShort
    budgets_file_test.go:37: .rastrillo/budgets.txt:41: reason is 325 bytes, over 200
    budgets_file_test.go:37: .rastrillo/budgets.txt:59: reason is 224 bytes, over 200
    budgets_file_test.go:37: .rastrillo/budgets.txt:74: reason is 249 bytes, over 200
--- FAIL: TestBudgetRecordsAreShort (0.00s)

--- FAIL amadan.net/oficina/equipo/internal/testci (package output)
FAIL
rastrillo-budget/v1 ran 1.367s
FAIL	amadan.net/oficina/equipo/internal/testci	1.372s

budget note: internal/equipo took 2m37.856s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/equipo/chat took 29.667s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/equipo/github took 38.159s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/equipo/setup took 14.042s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/idtest took 1m59.667s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/release took 48.713s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/runner/containment took 1m5.374s, over the 15s its record on line 40 allows; reported only, timing fails on CI
budget note: internal/runner/forge took 26.753s, over the 20s its record on line 35 allows; reported only, timing fails on CI
budget note: internal/runner/provider/claude/realcli took 14.201s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/runner/provider/pi took 1m15.733s, over the 1m0s its record on line 27 allows; reported only, timing fails on CI
budget note: internal/runner/render took 1m29.254s, over the 10s the default allows; reported only, timing fails on CI

receipt: test step 2m43.973s against a 60s target (the gate's other steps are not in this figure)
receipt: 51 packages ran, 18 cached, 17 without tests, 3 failed
receipt: slow package 2m37.856s amadan.net/oficina/equipo/internal/equipo
receipt: slow package 1m59.667s amadan.net/oficina/equipo/internal/idtest
receipt: slow package 1m29.254s amadan.net/oficina/equipo/internal/runner/render
receipt: slow package 1m15.733s amadan.net/oficina/equipo/internal/runner/provider/pi
receipt: slow package 1m5.374s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow test 56.25s amadan.net/oficina/equipo/internal/idtest TestDoorRemembersOficinaID
receipt: slow test 50.33s amadan.net/oficina/equipo/internal/runner/render TestLaunchNeverClaimsAnUnprovenEnd
receipt: slow test 47.3s amadan.net/oficina/equipo/internal/idtest TestDoorOficinaSettingsUnreadableIsNoLoop
receipt: slow test 46.62s amadan.net/oficina/equipo/internal/idtest TestDoorNeverJudgesANativeSession
receipt: slow test 46.12s amadan.net/oficina/equipo/internal/idtest TestDoorForgetsOficinaIDForARefusedSession
rastrillo: budget test: go test failed
exit status 1
+ go test -tags testbuild -timeout 15m -v -run '^TestHoldResumesAtTheBound$|^TestHoldReturnsWorkError$|^TestHoldStopsANamespaceJoiner$|^TestHoldStopsAReparentedDaemon$|^TestHoldStopsEveryWriter$' -count=1 ./internal/runner/pause   (retry, once)
FAILED TWICE ./internal/runner/pause:TestHoldResumesAtTheBound rest
FAILED TWICE ./internal/runner/pause:TestHoldReturnsWorkError rest
FAILED TWICE ./internal/runner/pause:TestHoldStopsANamespaceJoiner rest
FAILED TWICE ./internal/runner/pause:TestHoldStopsAReparentedDaemon rest
FAILED TWICE ./internal/runner/pause:TestHoldStopsEveryWriter rest
=== RUN   TestHoldStopsEveryWriter
--- PASS: TestHoldStopsEveryWriter (0.32s)
=== RUN   TestHoldReturnsWorkError
--- PASS: TestHoldReturnsWorkError (0.02s)
=== RUN   TestHoldResumesAtTheBound
--- PASS: TestHoldResumesAtTheBound (1.21s)
=== RUN   TestHoldStopsANamespaceJoiner
--- PASS: TestHoldStopsANamespaceJoiner (0.32s)
=== RUN   TestHoldStopsAReparentedDaemon
    pause_linux_test.go:603: daemon made no progress in 2s
    pause_linux_test.go:69: sandbox stderr: 
--- FAIL: TestHoldStopsAReparentedDaemon (2.31s)
FAIL
FAIL	amadan.net/oficina/equipo/internal/runner/pause	4.179s
FAIL
+ go test -tags testbuild -timeout 15m -v -run '^TestClaudeFailureDiagnostics$/^tools$|^TestClaudeInitPolicy$/^permission$' -count=1 ./internal/runner/provider/claude   (retry, once)
##############################################################################
FLAKE ./internal/runner/provider/claude:TestClaudeFailureDiagnostics/tools rest 59eccd0b342aeb2eb091286963bf15f84e39e2e0 0.14s 20.54
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
##############################################################################
FLAKE ./internal/runner/provider/claude:TestClaudeInitPolicy/permission rest 59eccd0b342aeb2eb091286963bf15f84e39e2e0 0.27s 20.54
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
+ go test -tags testbuild -timeout 15m -v -run '^TestBudgetRecordsAreShort$' -count=1 ./internal/testci   (retry, once)
FAILED TWICE ./internal/testci:TestBudgetRecordsAreShort rest
=== RUN   TestBudgetRecordsAreShort
    budgets_file_test.go:37: .rastrillo/budgets.txt:41: reason is 325 bytes, over 200
    budgets_file_test.go:37: .rastrillo/budgets.txt:59: reason is 224 bytes, over 200
    budgets_file_test.go:37: .rastrillo/budgets.txt:74: reason is 249 bytes, over 200
--- FAIL: TestBudgetRecordsAreShort (0.00s)
FAIL
rastrillo-budget/v1 ran 0s
FAIL	amadan.net/oficina/equipo/internal/testci	0.004s
FAIL
machine: 32 CPUs, load 18.97, cpu waiting 8.65%, memory waiting 0.00%, io waiting 0.06%
make: *** [Makefile:113: ci-shard] Error 1

amadan: step check shard 17 of 29 failed: exit status 2
--- shard 18 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-chat: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$' ./internal/headless

receipt: test step 1m26.715s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m24.624s amadan.net/oficina/equipo/internal/headless
receipt: slow test 39.36s amadan.net/oficina/equipo/internal/headless TestBrowserDraftIsTheMessage
receipt: slow test 14.69s amadan.net/oficina/equipo/internal/headless TestBrowserDraftStreamsFormatted
receipt: slow test 10.5s amadan.net/oficina/equipo/internal/headless TestBrowserChat
receipt: slow test 7.3s amadan.net/oficina/equipo/internal/headless TestBrowserComposer
receipt: slow test 6.71s amadan.net/oficina/equipo/internal/headless TestBrowserChatSendStaysOnPage
machine: 32 CPUs, load 71.18, cpu waiting 46.17%, memory waiting 0.00%, io waiting 0.43%
--- shard 19 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-work: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$' ./internal/headless

receipt: test step 1m38.123s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m35.795s amadan.net/oficina/equipo/internal/headless
receipt: slow test 29.82s amadan.net/oficina/equipo/internal/headless TestBrowserRailFollowsWork
receipt: slow test 24.36s amadan.net/oficina/equipo/internal/headless TestBrowserTaskThread
receipt: slow test 13.52s amadan.net/oficina/equipo/internal/headless TestBrowserReceiptFollowsReview
receipt: slow test 9.91s amadan.net/oficina/equipo/internal/headless TestBrowserTaskCard
receipt: slow test 9.44s amadan.net/oficina/equipo/internal/headless TestBrowserAskAfterMerge
machine: 32 CPUs, load 68.58, cpu waiting 44.07%, memory waiting 0.00%, io waiting 0.36%
--- shard 20 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-connections: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^TestBrowserConnections|^TestBrowserPasteBox$|^TestBrowserPasteCopiesItsBox$' ./internal/headless

receipt: test step 1m56.369s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m54.473s amadan.net/oficina/equipo/internal/headless
receipt: slow test 14.61s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsConversation
receipt: slow test 13.29s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAddPage
receipt: slow test 13.03s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAdd
receipt: slow test 11.7s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsMeteredLimitRequired
receipt: slow test 11.35s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsSignInEmail
machine: 32 CPUs, load 53.44, cpu waiting 34.16%, memory waiting 0.00%, io waiting 0.27%
--- shard 21 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-rest: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAskAfterMerge|TestBrowserCardAnswerSettlesAtBottom|TestBrowserChat|TestBrowserChatSendStaysOnPage|TestBrowserComposer|TestBrowserComposerDock|TestBrowserComposerFocus|TestBrowserComposerReconcile|TestBrowserConnectionsAdd|TestBrowserConnectionsAddPage|TestBrowserConnectionsConversation|TestBrowserConnectionsCopyLink|TestBrowserConnectionsEndedNote|TestBrowserConnectionsMeteredLimitRequired|TestBrowserConnectionsOpenCodeGoLimitRequired|TestBrowserConnectionsSignIn|TestBrowserConnectionsSignInEmail|TestBrowserConnectionsSignInSwitch|TestBrowserConnectionsToken|TestBrowserCopyContinue|TestBrowserCopySettingAndFlag|TestBrowserDraftIsTheMessage|TestBrowserDraftStreamsFormatted|TestBrowserEmptyExplore|TestBrowserMoveIn|TestBrowserNotebook|TestBrowserNotebookLook|TestBrowserPasteBox|TestBrowserPasteBoxLook|TestBrowserPasteCopiesItsBox|TestBrowserRailFollowsWork|TestBrowserReceiptFollowsReview|TestBrowserReceiptsDesktop|TestBrowserReceiptsTouch|TestBrowserRefreshRace|TestBrowserStalePageReloads|TestBrowserTaskCard|TestBrowserTaskThread|TestBrowserThinkingAndCards|TestBrowserUsageAndAdvice|TestBrowserWaitingTurns|TestNotebookScreenshots)$' -skip '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$|^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$|^TestBrowserConnections|^TestBrowserPasteBox$|^TestBrowserPasteCopiesItsBox$' ./internal/headless
rastrillo: budget test: go test failed
--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserCopyContinue
=== RUN   TestBrowserCopyContinue
time=2026-11-28T23:15:11.506Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-28T23:15:11.506Z level=INFO msg="startup phase done" phase=state_lock took=264µs
time=2026-11-28T23:15:11.506Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-28T23:15:11.506Z level=INFO msg="startup phase done" phase=claim_roots took=195µs
time=2026-11-28T23:15:11.506Z level=INFO msg="startup phase" phase=sweep
time=2026-11-28T23:15:11.615Z level=INFO msg="startup phase done" phase=sweep took=108.545ms
time=2026-11-28T23:15:11.616Z level=INFO msg="startup phase" phase=credentials
time=2026-11-28T23:15:11.616Z level=INFO msg="startup phase done" phase=credentials took=471µs
time=2026-11-28T23:15:11.616Z level=INFO msg="startup phase" phase=open_state
time=2026-11-28T23:15:11.739Z level=INFO msg="startup phase done" phase=open_state took=122.333ms
time=2026-11-28T23:15:11.739Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-28T23:15:11.742Z level=INFO msg=connecting host=127.0.0.1:32981 protocol=36
time=2026-11-28T23:15:11.745Z level=INFO msg=connected host=127.0.0.1:32981 took=2.311ms
time=2026-11-28T23:15:11.745Z level=INFO msg="capabilities gathering"
time=2026-11-28T23:15:11.746Z level=INFO msg="capabilities gathered" took=627µs tags=linux,claude,go
time=2026-11-28T23:15:11.751Z level=INFO msg="hello sent" protocol=36
time=2026-11-28T23:15:11.759Z level=INFO msg=welcome protocol=36 role=primary generation=1
    browser_copy_test.go:90: waiting for !document.querySelector('[data-copy-continue]'): context deadline exceeded (last evaluation: context deadline exceeded)
--- FAIL: TestBrowserCopyContinue (6.79s)

--- FAIL amadan.net/oficina/equipo/internal/headless (package output)
FAIL
rastrillo-budget/v1 ran 1m43.17s
FAIL	amadan.net/oficina/equipo/internal/headless	103.375s


receipt: test step 1m44.697s against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 0 cached, 0 without tests, 1 failed
receipt: slow package 1m43.17s amadan.net/oficina/equipo/internal/headless
receipt: slow test 15.04s amadan.net/oficina/equipo/internal/headless TestBrowserThinkingAndCards
receipt: slow test 13.31s amadan.net/oficina/equipo/internal/headless TestBrowserWaitingTurns
receipt: slow test 10.91s amadan.net/oficina/equipo/internal/headless TestBrowserStalePageReloads
receipt: slow test 9.53s amadan.net/oficina/equipo/internal/headless TestBrowserMoveIn
receipt: slow test 7.59s amadan.net/oficina/equipo/internal/headless TestBrowserRefreshRace
exit status 1
+ go test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAskAfterMerge|TestBrowserCardAnswerSettlesAtBottom|TestBrowserChat|TestBrowserChatSendStaysOnPage|TestBrowserComposer|TestBrowserComposerDock|TestBrowserComposerFocus|TestBrowserComposerReconcile|TestBrowserConnectionsAdd|TestBrowserConnectionsAddPage|TestBrowserConnectionsConversation|TestBrowserConnectionsCopyLink|TestBrowserConnectionsEndedNote|TestBrowserConnectionsMeteredLimitRequired|TestBrowserConnectionsOpenCodeGoLimitRequired|TestBrowserConnectionsSignIn|TestBrowserConnectionsSignInEmail|TestBrowserConnectionsSignInSwitch|TestBrowserConnectionsToken|TestBrowserCopyContinue|TestBrowserCopySettingAndFlag|TestBrowserDraftIsTheMessage|TestBrowserDraftStreamsFormatted|TestBrowserEmptyExplore|TestBrowserMoveIn|TestBrowserNotebook|TestBrowserNotebookLook|TestBrowserPasteBox|TestBrowserPasteBoxLook|TestBrowserPasteCopiesItsBox|TestBrowserRailFollowsWork|TestBrowserReceiptFollowsReview|TestBrowserReceiptsDesktop|TestBrowserReceiptsTouch|TestBrowserRefreshRace|TestBrowserStalePageReloads|TestBrowserTaskCard|TestBrowserTaskThread|TestBrowserThinkingAndCards|TestBrowserUsageAndAdvice|TestBrowserWaitingTurns|TestNotebookScreenshots)$' -skip '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$|^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$|^TestBrowserConnections|^TestBrowserPasteBox$|^TestBrowserPasteCopiesItsBox$' -v -run '^TestBrowserCopyContinue$' -count=1 ./internal/headless   (retry, once)
##############################################################################
FLAKE ./internal/headless:TestBrowserCopyContinue browser-headless-rest 59eccd0b342aeb2eb091286963bf15f84e39e2e0 6.79s 60.54
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 60.54, cpu waiting 37.57%, memory waiting 0.00%, io waiting 0.29%
--- shard 22 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-rest: ./internal/equipo
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserPreviewBlocksNavigation|TestBrowserPreviewPassExchange)$' ./internal/equipo

receipt: test step 4.68s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 2.659s amadan.net/oficina/equipo/internal/equipo
receipt: slow test 1.95s amadan.net/oficina/equipo/internal/equipo TestBrowserPreviewPassExchange
receipt: slow test 710ms amadan.net/oficina/equipo/internal/equipo TestBrowserPreviewBlocksNavigation
browser lane browser-rest: ./internal/equipotest
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserGitHubManifestCSP)$' ./internal/equipotest

receipt: test step 8.114s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 6.46s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 6.46s amadan.net/oficina/equipo/internal/equipotest TestBrowserGitHubManifestCSP
browser lane browser-rest: ./internal/idtest
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserOficinaIDDoor|TestBrowserSmartDoor)$' ./internal/idtest
budget note: internal/idtest took 11.065s, over the 10s the default allows; reported only, timing fails on CI

receipt: test step 12.606s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 11.065s amadan.net/oficina/equipo/internal/idtest
receipt: slow test 8.92s amadan.net/oficina/equipo/internal/idtest TestBrowserSmartDoor
receipt: slow test 2.14s amadan.net/oficina/equipo/internal/idtest TestBrowserOficinaIDDoor
browser lane browser-rest: ./internal/plan3test
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestTeamsHierarchyBrowser)$' ./internal/plan3test

receipt: test step 4.03s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 2.429s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 2.43s amadan.net/oficina/equipo/internal/plan3test TestTeamsHierarchyBrowser
browser lane browser-rest: ./internal/thintest
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAccessEmojiByline|TestBrowserAccessFinalOutcomes|TestBrowserAccessRequest|TestBrowserAccessReview|TestBrowserActivitySubjects|TestBrowserAutonomySettings|TestBrowserCoordinatorQueue|TestBrowserEmptyConversation|TestBrowserEndedNoteStaysGone|TestBrowserHousekeeping|TestBrowserInnerGallery|TestBrowserInnerScreens|TestBrowserInstantThinking|TestBrowserInstantThinkingQueued|TestBrowserMachines|TestBrowserPausedWork|TestBrowserPhoneIndex|TestBrowserPlacementQuestionAndPending|TestBrowserProjectPlacement|TestBrowserProjectsList|TestBrowserReportActionFeedback|TestBrowserReportNextSteps|TestBrowserReportThread|TestBrowserRhythm|TestBrowserRollup|TestBrowserRosterAlignment|TestBrowserRosterDecisionStates|TestBrowserRosterQuietDay|TestBrowserRosterReports|TestBrowserRosterSetAside|TestBrowserRosterSubchat|TestBrowserRosterThinking|TestBrowserRosterVisual|TestBrowserSettingsHousekeepingGroups|TestBrowserSettingsMenu|TestBrowserSettingsRail|TestBrowserSettingsSaveBar|TestBrowserSettingsShots|TestBrowserSettingsStayOnPage|TestBrowserSettingsTeams|TestBrowserShipsButtons|TestBrowserSpecialistRows|TestBrowserSpendFollowsAnswers|TestBrowserTaskRows|TestBrowserTeamPanel|TestBrowserThinkingCycles|TestBrowserThinkingLinesClear|TestBrowserThinkingSteady|TestBrowserThinkingWords|TestBrowserTokenRowEmail|TestBrowserTrackPulse|TestBrowserTrackStarCentre|TestBrowserTryAgain)$' ./internal/thintest

receipt: test step 3m39.847s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 3m37.007s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 26.86s amadan.net/oficina/equipo/internal/thintest TestBrowserAccessRequest
receipt: slow test 14.41s amadan.net/oficina/equipo/internal/thintest TestBrowserSettingsTeams
receipt: slow test 12.07s amadan.net/oficina/equipo/internal/thintest TestBrowserThinkingCycles
receipt: slow test 10.75s amadan.net/oficina/equipo/internal/thintest TestBrowserPlacementQuestionAndPending
receipt: slow test 9.05s amadan.net/oficina/equipo/internal/thintest TestBrowserRhythm
machine: 32 CPUs, load 10.27, cpu waiting 3.76%, memory waiting 0.00%, io waiting 0.02%
--- shard 23 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
shard 23: make test-quarantine
python3 scripts/ci-test.py quarantine
quarantine: 12 tests from scripts/ci-quarantine.txt; a failure is retried once, and a pass on the retry is reported as a flake
+ go test -tags testbuild -timeout 15m -v -run '^TestHeadlessConnections$/^A5_cancel_and_sign_out$|^TestHeadlessConnections$/^C4_claude_sign_in$|^TestHeadlessConnections$/^C5_engineering_failover$|^TestHeadlessConnections$/^C5_engineering_to_codex$|^TestHeadlessConnections$/^C5_engineering_waits$' ./internal/headless   (54s)
ok ./internal/headless TestHeadlessConnections/A5_cancel_and_sign_out 4.82s
ok ./internal/headless TestHeadlessConnections/C4_claude_sign_in 1.41s
ok ./internal/headless TestHeadlessConnections/C5_engineering_failover 8.61s
ok ./internal/headless TestHeadlessConnections/C5_engineering_to_codex 8.61s
ok ./internal/headless TestHeadlessConnections/C5_engineering_waits 27.51s
+ go test -tags testbuild -timeout 15m -v -run '^TestHeadlessConnections$/^C5_review_auth$|^TestHeadlessConnections$/^C5_review_failover$|^TestHeadlessConnections$/^C5_review_on_codex$|^TestHeadlessConnections$/^C5_review_other_family_first$' ./internal/headless   (84s)
ok ./internal/headless TestHeadlessConnections/C5_review_auth 25.67s
ok ./internal/headless TestHeadlessConnections/C5_review_failover 21.89s
ok ./internal/headless TestHeadlessConnections/C5_review_on_codex 19.69s
ok ./internal/headless TestHeadlessConnections/C5_review_other_family_first 14.11s
+ go test -tags testbuild -timeout 15m -v -run '^TestMixedVersions$' ./internal/headless   (21s)
ok ./internal/headless TestMixedVersions 19.05s
+ go test -tags testbuild -timeout 15m -v -run '^TestCheckSandboxDeniedPathsTampering$' ./internal/runner/checks   (2s)
ok ./internal/runner/checks TestCheckSandboxDeniedPathsTampering 0.85s
+ go test -tags testbuild -timeout 15m -v -run '^TestRunnerCancelAndSupersede$' ./internal/runner/thin   (2s)
ok ./internal/runner/thin TestRunnerCancelAndSupersede 0.05s
quarantine: 0 flaked (passed on the retry), 0 failed
machine: 32 CPUs, load 72.94, cpu waiting 46.71%, memory waiting 0.00%, io waiting 0.46%
--- shard 24 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
shard 24: make runner-host
python3 scripts/runner-prerequisites.py
CGO_ENABLED=0 RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py retried runner-host -run 'TestDirect|TestProvider|TestCheckSandbox' -count=1 ./internal/runner/provider/... ./internal/runner/checks
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -no-time -run 'TestDirect|TestProvider|TestCheckSandbox' -count=1 ./internal/runner/provider/... ./internal/runner/checks

receipt: test step 14.194s against a 60s target (the gate's other steps are not in this figure)
receipt: 4 packages ran, 0 cached, 4 without tests, 0 failed
receipt: slow package 7.999s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow package 182ms amadan.net/oficina/equipo/internal/runner/provider/claude
receipt: slow package 62ms amadan.net/oficina/equipo/internal/runner/provider/codex
receipt: slow package 4ms amadan.net/oficina/equipo/internal/runner/provider
receipt: slow package 1ms amadan.net/oficina/equipo/internal/runner/provider/pi
receipt: slow test 5.85s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsGoFixture
receipt: slow test 1.65s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPaths
receipt: slow test 340ms amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsCache
receipt: slow test 180ms amadan.net/oficina/equipo/internal/runner/provider/claude TestDirectJournalAdapterBarrier
receipt: slow test 130ms amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxToolchain
CGO_ENABLED=0 RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py retried runner-host -run '^TestNamespace' -count=1 ./internal/runner/containment
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -no-time -run '^TestNamespace' -count=1 ./internal/runner/containment

receipt: test step 4.237s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 3.141s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow test 290ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceReadOnlyScratch
receipt: slow test 190ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryUnavailableProof
receipt: slow test 130ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceDirectPolicyAdmission
receipt: slow test 110ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryReusedPID
receipt: slow test 110ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryCleansScratch
machine: 32 CPUs, load 24.68, cpu waiting 13.01%, memory waiting 0.00%, io waiting 1.36%
--- shard 25 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: runner-dead-references started 30s late; cpu waiting 41.4%, load 34.57
shard 25: make runner-dead-references lanes-check build vet fmt-check spacing budget migration-check
python3 scripts/runner-dead-references.py
reference scan: 3096 text files, 3332 matches, 0 failures
python3 native/scripts/check-share.py
Share packaging, keychain-only boundary and reviewed copy verified
python3 scripts/ci-test.py check
lanes: 18 lanes and 5 browser lanes run every test once; 20-check@29
CGO_ENABLED=0 go build ./...
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o /dev/null ./cmd/equipo-runner
go vet ./...
go vet -tags testbuild ./internal/runner/thin ./internal/headless
GOOS=darwin GOARCH=arm64 go vet ./cmd/equipo-runner/... ./internal/runner/... ./internal/wire/... ./internal/release/...
go tool fiesta spacing -skip tokens.css internal/equipo/static
go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget size
rastrillo: budget size: 6 problem(s)
internal/equipo/chat: 12019 test lines, over the 11950 its exemption (line 59) allows
internal/equipo/chat: 38017 source lines, over the 37987 its exemption (line 59) allows
internal/equipo: 23927 source lines, over the 23925 its exemption (line 17) allows
internal/runner/provider: 5792 source lines, over the 5731 its exemption (line 29) allows
internal/runner/thin: 26980 test lines, over the 26744 its exemption (line 41) allows
internal/runner/thin: 31131 source lines, over the 31090 its exemption (line 41) allows
exit status 1
make[1]: *** [Makefile:75: budget] Error 1
machine: 32 CPUs, load 72.93, cpu waiting 46.18%, memory waiting 0.00%, io waiting 0.49%
make: *** [Makefile:113: ci-shard] Error 2

amadan: step check shard 25 of 29 failed: exit status 2
--- shard 26 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: staticcheck started 30s late; cpu waiting 41.4%, load 34.57
shard 26: make staticcheck
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -tags browser,perf,testbuild ./...
internal/runner/thin/render_page_test.go:210:48: error should be returned as the last argument (ST1008)
internal/wire/design_test.go:238:76: string literal contains the Unicode format character U+202E, consider using the '\u202e' escape sequence instead (ST1018)
exit status 1
make[1]: *** [Makefile:195: staticcheck] Error 1
machine: 32 CPUs, load 71.62, cpu waiting 40.89%, memory waiting 0.00%, io waiting 0.69%
make: *** [Makefile:113: ci-shard] Error 2

amadan: step check shard 26 of 29 failed: exit status 2
--- shard 27 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: govulncheck started 30s late; cpu waiting 41.4%, load 34.57
shard 27: make govulncheck
go run golang.org/x/vuln/cmd/govulncheck@v1.8.0 ./...
=== Symbol Results ===

No vulnerabilities found.

Your code is affected by 0 vulnerabilities.
This scan also found 1 vulnerability in packages you import and 10
vulnerabilities in modules you require, but your code doesn't appear to call
these vulnerabilities.
Use '-show verbose' for more details.
machine: 32 CPUs, load 69.41, cpu waiting 37.92%, memory waiting 0.00%, io waiting 0.77%
--- shard 28 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: gitleaks started 30s late; cpu waiting 39.5%, load 34.57
shard 28: make gitleaks
11:14PM INF Unknown SCM platform. Use --platform to include links in findings. host=amadan.net
11:15PM INF 1287 commits scanned.
11:15PM INF scanned ~69645638 bytes (69.65 MB) in 25.3s
11:15PM INF no leaks found
machine: 32 CPUs, load 69.41, cpu waiting 37.92%, memory waiting 0.00%, io waiting 0.77%

amadan: job failed at step check shards 8, 16, 17, 25, 26 of 29 — its output is above, not at the tail of this log
diff --git a/internal/runner/containment/mounts.go b/internal/runner/containment/mounts.go
index 862cae5b..c3128d7f 100644
--- a/internal/runner/containment/mounts.go
+++ b/internal/runner/containment/mounts.go
@@ -13,6 +13,7 @@ import (
"amadan.net/oficina/equipo/internal/runner/egress"
"amadan.net/oficina/equipo/internal/runner/provider"
"amadan.net/oficina/equipo/internal/runner/provider/gotoolchain"
+ "amadan.net/oficina/equipo/internal/specialist"
"golang.org/x/sys/unix"
)
@@ -263,6 +264,20 @@ func (m *Manager) mountPlan(l provider.Launch, dir string) (_ *mounts, err error
return nil, err
}
}
+ if l.RenderDir != "" {
+ // The step's render_page captures reach the Design step only,
+ // read-only: render_page writes them from outside.
+ if !l.Policy.RenderReader() {
+ return nil, fmt.Errorf("%w: render directory refused for this launch", errMount)
+ }
+ near := []string{l.Workspace, m.cfg.ScratchRoot, dir, l.Binding.Home, l.Binding.CredentialHome, l.Binding.RuntimeRoot}
+ if l.ToolSocket != "" {
+ near = append(near, filepath.Dir(l.ToolSocket))
+ }
+ if err = p.bindKept(l.RenderDir, near, specialist.RenderMount, "render"); err != nil {
+ return nil, err
+ }
+ }
targets := map[string]bool{}
for _, mount := range l.Policy.Mounts {
gateMount := l.Policy.CheckGateMount(mount)
@@ -505,17 +520,24 @@ func (p *mounts) bindEmpty(path string) error {
// link to a file elsewhere). It is checked and bound through one pinned
// descriptor, so a path swapped after the checks is not what is bound.
func (p *mounts) bindResearch(path string, near []string) error {
+ return p.bindKept(path, near, "/research", "research")
+}
+
+// bindKept binds a runner-made flat directory of regular files
+// read-only at target, as bindResearch describes; what names it in a
+// refusal.
+func (p *mounts) bindKept(path string, near []string, target, what string) error {
if !cleanAbsolute(path) {
return errMount
}
for _, other := range near {
if other != "" && overlaps(path, other) {
- return fmt.Errorf("%w: research directory overlaps another mount", errMount)
+ return fmt.Errorf("%w: %s directory overlaps another mount", errMount, what)
}
}
for _, root := range []string{"/proc", "/sys", "/run", "/dev", "/etc", "/usr"} {
if overlaps(path, root) {
- return fmt.Errorf("%w: research directory overlaps another mount", errMount)
+ return fmt.Errorf("%w: %s directory overlaps another mount", errMount, what)
}
}
f, err := pin(path)
@@ -526,27 +548,27 @@ func (p *mounts) bindResearch(path string, near []string) error {
var st unix.Stat_t
if err = unix.Fstat(fd, &st); err != nil || st.Mode&unix.S_IFMT != unix.S_IFDIR {
f.Close()
- return fmt.Errorf("%w: research directory is not a directory", errMount)
+ return fmt.Errorf("%w: %s directory is not a directory", errMount, what)
}
if st.Uid != uint32(os.Getuid()) {
f.Close()
- return fmt.Errorf("%w: research directory owner is not the runner", errMount)
+ return fmt.Errorf("%w: %s directory owner is not the runner", errMount, what)
}
if st.Mode&0o7777 != 0o700 {
f.Close()
- return fmt.Errorf("%w: research directory mode is not 0700", errMount)
+ return fmt.Errorf("%w: %s directory mode is not 0700", errMount, what)
}
entries, err := os.ReadDir(fmt.Sprintf("/proc/self/fd/%d", fd))
if err != nil {
f.Close()
- return fmt.Errorf("%w: research directory: %v", errMount, err)
+ return fmt.Errorf("%w: %s directory: %v", errMount, what, err)
}
for _, e := range entries {
var est unix.Stat_t
if unix.Fstatat(fd, e.Name(), &est, unix.AT_SYMLINK_NOFOLLOW) != nil || est.Mode&unix.S_IFMT != unix.S_IFREG || est.Nlink != 1 || est.Uid != uint32(os.Getuid()) {
f.Close()
- return fmt.Errorf("%w: research directory entry %q is not a single regular file", errMount, e.Name())
+ return fmt.Errorf("%w: %s directory entry %q is not a single regular file", errMount, what, e.Name())
}
}
- return p.bindPinned(f, path, "/research", true, true)
+ return p.bindPinned(f, path, target, true, true)
}
diff --git a/internal/runner/containment/render_test.go b/internal/runner/containment/render_test.go
new file mode 100644
index 00000000..9bc394df
--- /dev/null
+++ b/internal/runner/containment/render_test.go
@@ -0,0 +1,130 @@
+//go:build linux
+
+package containment
+
+import (
+ "errors"
+ "os"
+ "path/filepath"
+ "strings"
+ "syscall"
+ "testing"
+
+ "amadan.net/oficina/equipo/internal/runner/provider"
+)
+
+// renderDir makes a runner-style render directory: 0700, the runner's,
+// regular files only (the step's captures so far).
+func renderDir(t *testing.T) string {
+ t.Helper()
+ dir := filepath.Join(t.TempDir(), "render")
+ if err := os.Mkdir(dir, 0700); err != nil {
+ t.Fatal(err)
+ }
+ if err := os.WriteFile(filepath.Join(dir, "1-work-1.png"), []byte("capture bytes"), 0600); err != nil {
+ t.Fatal(err)
+ }
+ return dir
+}
+
+// The Design step sees its captures read-only at /render, including one
+// the runner writes after the launch (render_page runs outside the
+// namespace, into the same directory); nothing inside writes there.
+func TestNamespaceRenderDirReadOnly(t *testing.T) {
+ m, l := fixture(t)
+ l = withAction(t, m, l, provider.DesignStepAction)
+ l.RenderDir = renderDir(t)
+ script := `import os, sys
+print(sorted(os.listdir("/render")), open("/render/1-work-1.png").read())
+for path in ("/render/1-work-1.png", "/render/planted.png"):
+ try:
+ open(path, "a").write("x")
+ print("wrote", path)
+ except OSError as e:
+ print("refused", e.errno)
+print("research", os.path.exists("/research"))
+`
+ out := runPlanned(t, m, l, []string{"/usr/bin/python3", "-u", "-c", script}, "01234567890123456789012345678913")
+ want := "['1-work-1.png'] capture bytes\nrefused 30\nrefused 30\nresearch False\n"
+ if out != want {
+ t.Fatalf("/render inside the namespace:\n%s\nwant\n%s", out, want)
+ }
+ if raw, _ := os.ReadFile(filepath.Join(l.RenderDir, "1-work-1.png")); string(raw) != "capture bytes" {
+ t.Fatalf("capture changed: %q", raw)
+ }
+}
+
+// The /render bind is refused for any launch but the Design step's
+// (Engineering and the legacy design action above all), and for a
+// directory that is not the runner's own flat directory of regular
+// files apart from every other mount.
+func TestRenderDirRefusals(t *testing.T) {
+ m, base := fixture(t)
+ for _, c := range []struct {
+ name, reason string
+ setup func(t *testing.T, l *provider.Launch)
+ }{
+ {"engineering", "launch", func(t *testing.T, l *provider.Launch) { *l = withAction(t, m, *l, "implement") }},
+ {"legacy design", "launch", func(t *testing.T, l *provider.Launch) { *l = withAction(t, m, *l, "design") }},
+ {"review", "launch", func(t *testing.T, l *provider.Launch) { *l = withAction(t, m, *l, "inspect") }},
+ {"research step", "launch", func(t *testing.T, l *provider.Launch) { *l = withAction(t, m, *l, provider.ResearchStepAction) }},
+ {"coordinator", "launch", func(t *testing.T, l *provider.Launch) { *l = withAction(t, m, *l, "converse") }},
+ {"no action", "launch", func(t *testing.T, l *provider.Launch) { l.Policy.Manifest, l.Policy.ManifestHash = []byte(`{}`), "" }},
+ {"tampered manifest", "launch", func(t *testing.T, l *provider.Launch) { l.Policy.ManifestHash = provider.ManifestDigest([]byte(`{}`)) }},
+ {"with research images", "launch", func(t *testing.T, l *provider.Launch) { l.ResearchDir = researchDir(t) }},
+ {"symlinked directory", "", func(t *testing.T, l *provider.Launch) {
+ link := filepath.Join(t.TempDir(), "render")
+ os.Symlink(l.RenderDir, link)
+ l.RenderDir = link
+ }},
+ {"relative path", "", func(t *testing.T, l *provider.Launch) { l.RenderDir = "render" }},
+ {"group readable", "mode", func(t *testing.T, l *provider.Launch) { os.Chmod(l.RenderDir, 0750) }},
+ {"subdirectory", "entry", func(t *testing.T, l *provider.Launch) { os.Mkdir(filepath.Join(l.RenderDir, "nested"), 0700) }},
+ {"symlink entry", "entry", func(t *testing.T, l *provider.Launch) {
+ os.Symlink("/etc/hostname", filepath.Join(l.RenderDir, "2-work-1.png"))
+ }},
+ {"fifo entry", "entry", func(t *testing.T, l *provider.Launch) {
+ syscall.Mkfifo(filepath.Join(l.RenderDir, "2-work-1.png"), 0600)
+ }},
+ {"inside the workspace", "overlap", func(t *testing.T, l *provider.Launch) {
+ dir := filepath.Join(l.Workspace, "render")
+ os.Mkdir(dir, 0700)
+ l.RenderDir = dir
+ }},
+ {"is the workspace", "overlap", func(t *testing.T, l *provider.Launch) { l.RenderDir = l.Workspace }},
+ {"inside the scratch root", "overlap", func(t *testing.T, l *provider.Launch) {
+ dir := filepath.Join(m.cfg.ScratchRoot, "render")
+ os.Mkdir(dir, 0700)
+ l.RenderDir = dir
+ }},
+ } {
+ t.Run(c.name, func(t *testing.T) {
+ l := withAction(t, m, base, provider.DesignStepAction)
+ ws := filepath.Join(t.TempDir(), "workspace")
+ os.Mkdir(ws, 0700)
+ l.Workspace = ws
+ l.RenderDir = renderDir(t)
+ c.setup(t, &l)
+ plan, err := m.mountPlan(l, attemptDir(t, m))
+ if err == nil {
+ plan.close()
+ t.Fatal("render directory accepted")
+ }
+ if !errors.Is(err, errMount) || !strings.Contains(err.Error(), c.reason) {
+ t.Fatalf("refused for the wrong reason: %v (want %q)", err, c.reason)
+ }
+ })
+ }
+ // The Design step's launch with no render directory has no /render.
+ l := withAction(t, m, base, provider.DesignStepAction)
+ plan, err := m.mountPlan(l, attemptDir(t, m))
+ if err != nil {
+ t.Fatalf("design launch without captures: %v", err)
+ }
+ defer plan.close()
+ for _, arg := range plan.args {
+ if arg == "/render" {
+ t.Fatal("/render bound with no directory")
+ }
+ }
+}
diff --git a/internal/runner/provider/actions.go b/internal/runner/provider/actions.go
index d82b0e54..c0715c01 100644
--- a/internal/runner/provider/actions.go
+++ b/internal/runner/provider/actions.go
@@ -51,6 +51,12 @@ func Profile(action string) (ActionProfile, error) {
// two Equipo tools. Not the legacy "research" action above,
// which reads a workspace with Read, Glob, Grep and Bash.
p.Specialist, p.Submission = ResearchSpecialist, specialist.ToolSubmitFindings
+ case DesignStepAction:
+ // The Design step (design-v1, task 13): Engineering's step with
+ // exactly design-v1's three Equipo tools (render_page, not the
+ // old submit_render) and /render read-only. Not the plan
+ // workflow's legacy "design" action above.
+ p.Specialist, p.Submission = DesignSpecialist, specialist.ToolSubmitCandidate
case GlanceAction:
// The Assistant's instant first line: a small model writes one
// short line from the person's newest message. No tool at all,
@@ -88,6 +94,9 @@ func (p ActionProfile) Tools() []string {
if ResearchAction(p.Action) {
return ResearchTools()
}
+ if DesignAction(p.Action) {
+ return DesignTools()
+ }
tools := []string{p.Submission, "ask_person"}
if p.Render {
tools = append(tools, "submit_render")
@@ -170,6 +179,47 @@ func ResearchTools() []string {
return p.Tools
}
+// DesignStepAction is the Design step's launch action (profile
+// design-v1's Policy.Action). DesignSpecialist is its launch role, the
+// legacy design action's too: Engineering's native tools.
+const (
+ DesignStepAction = specialist.ActionDesignStep
+ DesignSpecialist = "Design"
+)
+
+// DesignAction reports whether an action runs the Design step.
+func DesignAction(action string) bool { return action == DesignStepAction }
+
+// DesignTools are the Design step's Equipo tools, exactly design-v1's.
+func DesignTools() []string {
+ p, ok := specialist.Lookup(specialist.ProfileDesign)
+ if !ok {
+ return nil
+ }
+ return p.Tools
+}
+
+// DesignReadOnly are the paths the Design step's native file tools may
+// read and never write beyond Engineering's, exactly design-v1's
+// (/render).
+func DesignReadOnly() []string {
+ p, ok := specialist.Lookup(specialist.ProfileDesign)
+ if !ok {
+ return nil
+ }
+ return p.Policy.ReadOnly
+}
+
+// DesignMCPTools are DesignTools as the CLI names them.
+func DesignMCPTools() []string {
+ p, _ := Profile(DesignStepAction)
+ return p.MCPTools()
+}
+
+// RenderReaderAction reports whether an action may see its step's
+// captures, read-only at /render: the Design step only.
+func RenderReaderAction(action string) bool { return DesignAction(action) }
+
// ResearchReaderAction reports whether an action may see a task's kept
// research images, read-only at /research: Engineering and Review only.
func ResearchReaderAction(action string) bool { return action == "implement" || action == "inspect" }
diff --git a/internal/runner/provider/claude/answers.go b/internal/runner/provider/claude/answers.go
index 0236c479..7cab678f 100644
--- a/internal/runner/provider/claude/answers.go
+++ b/internal/runner/provider/claude/answers.go
@@ -180,12 +180,14 @@ const (
refuseOutside = "this step can use files only under /workspace (and read /research)"
refuseProtected = "that path is protected: credentials, runtime files and links are never available"
refuseResearch = "/research is read-only: use Read, Glob and Grep there"
- refuseFields = "the request has a field this step does not accept"
- refuseSandbox = "commands run only inside the sandbox; dangerouslyDisableSandbox is not available"
- refusePerson = "this step's policy keeps shell commands for a person's approval, and nobody is asked during a step"
- refuseTool = "this tool is not available to this step"
- refuseReadOnly = "this step only reads: use Read, Glob and Grep under /workspace"
- refuseShell = "this step's policy does not keep commands in the sandbox, so it runs none"
+ // refuseReadOnlyRoot follows a read-only path (/render).
+ refuseReadOnlyRoot = " is read-only: use Read, Glob and Grep there"
+ refuseFields = "the request has a field this step does not accept"
+ refuseSandbox = "commands run only inside the sandbox; dangerouslyDisableSandbox is not available"
+ refusePerson = "this step's policy keeps shell commands for a person's approval, and nobody is asked during a step"
+ refuseTool = "this tool is not available to this step"
+ refuseReadOnly = "this step only reads: use Read, Glob and Grep under /workspace"
+ refuseShell = "this step's policy does not keep commands in the sandbox, so it runs none"
)
func refusal(rule string) json.RawMessage {
@@ -202,6 +204,25 @@ func refusal(rule string) json.RawMessage {
// (CLAUDE_CODE_SUBPROCESS_ENV_SCRUB). Everything else is denied with the
// rule that refused it. The result is the callback's JSON text.
func StepPermission(raw json.RawMessage, policy provider.Policy) json.RawMessage {
+ return stepPermission(raw, policy, nil)
+}
+
+// DesignPermission answers the Design step's permission callback:
+// Engineering's (StepPermission), and Read, Glob and Grep of the
+// design-v1 profile's read-only paths (/render, its captures); a write
+// there is refused. Handed any policy but the Design step's, it is
+// Engineering's callback and reads nothing more.
+func DesignPermission(raw json.RawMessage, policy provider.Policy) json.RawMessage {
+ var reads []string
+ if policy.RenderReader() {
+ reads = provider.DesignReadOnly()
+ }
+ return stepPermission(raw, policy, reads)
+}
+
+// stepPermission is StepPermission with reads, the paths beyond
+// Engineering's that the step's native file tools may read only.
+func stepPermission(raw json.RawMessage, policy provider.Policy, reads []string) json.RawMessage {
var q permissionRequest
d := json.NewDecoder(bytes.NewReader(raw))
d.DisallowUnknownFields()
@@ -212,7 +233,7 @@ func StepPermission(raw json.RawMessage, policy provider.Policy) json.RawMessage
if rule := sandboxedShell(q, policy); rule != "" {
return refusal(rule)
}
- } else if rule := stepPathRule(q, policy); rule != "" {
+ } else if rule := stepPathRule(q, policy, reads); rule != "" {
return refusal(rule)
}
out, err := permissionResult(q, provider.Answer{Behavior: "allow"}, policy)
@@ -223,8 +244,9 @@ func StepPermission(raw json.RawMessage, policy provider.Policy) json.RawMessage
}
// stepPathRule names the rule refusing a native file action in a step, or
-// "" when the action is inside the step's profile.
-func stepPathRule(q permissionRequest, policy provider.Policy) string {
+// "" when the action is inside the step's profile: reads are the paths
+// beyond Engineering's it may read only (none for Engineering).
+func stepPathRule(q permissionRequest, policy provider.Policy, reads []string) string {
if !slices.Contains([]string{"Read", "Write", "Edit", "Glob", "Grep"}, q.Tool) {
return refuseTool
}
@@ -251,6 +273,14 @@ func stepPathRule(q permissionRequest, policy provider.Policy) string {
case filepath.Clean(path) == "/research" || strings.HasPrefix(filepath.Clean(path), "/research/"):
return refuseResearch
}
+ for _, root := range reads {
+ if readNativePath(q, root) {
+ return ""
+ }
+ if clean := filepath.Clean(path); clean == root || strings.HasPrefix(clean, root+"/") {
+ return root + refuseReadOnlyRoot
+ }
+ }
return refuseOutside
}
@@ -422,7 +452,11 @@ func protectedNativePath(q permissionRequest, policy provider.Policy) bool {
// where containment binds a task's kept Research images read-only for
// Engineering and Review (a flat directory of regular files; nothing is
// there for any other launch). Writes there are never allowed.
-func researchNativePath(q permissionRequest) bool {
+func researchNativePath(q permissionRequest) bool { return readNativePath(q, "/research") }
+
+// readNativePath reports a Read, Glob or Grep whose path is root or
+// under it. Callers must first refuse protectedNativePath.
+func readNativePath(q permissionRequest, root string) bool {
if !slices.Contains([]string{"Read", "Glob", "Grep"}, q.Tool) {
return false
}
@@ -443,7 +477,7 @@ func researchNativePath(q permissionRequest) bool {
return false
}
path = filepath.Clean(path)
- return path == "/research" || strings.HasPrefix(path, "/research/")
+ return path == root || strings.HasPrefix(path, root+"/")
}
// workspaceNativePath reports a native file action whose path is inside
diff --git a/internal/runner/provider/claude/design_policy_test.go b/internal/runner/provider/claude/design_policy_test.go
new file mode 100644
index 00000000..96db1dff
--- /dev/null
+++ b/internal/runner/provider/claude/design_policy_test.go
@@ -0,0 +1,291 @@
+package claude
+
+import (
+ "context"
+ "encoding/json"
+ "os"
+ "reflect"
+ "slices"
+ "strings"
+ "testing"
+
+ "amadan.net/oficina/equipo/internal/runner/provider"
+ "amadan.net/oficina/equipo/internal/specialist"
+)
+
+// engineeringPermissionRequests are the native file and shell requests
+// whose answers pin Engineering's permission callback, /render's above
+// all (a path Engineering never reads).
+var engineeringPermissionRequests = []string{
+ `{"tool_name":"Read","input":{"file_path":"/workspace/README.md"}}`,
+ `{"tool_name":"Write","input":{"file_path":"/workspace/mockups/tk1/index.html","content":"<p>x</p>"}}`,
+ `{"tool_name":"Edit","input":{"file_path":"/workspace/README.md","old_string":"teh","new_string":"the"}}`,
+ `{"tool_name":"Glob","input":{"pattern":"*.md","path":"/workspace"}}`,
+ `{"tool_name":"Grep","input":{"pattern":"x","path":"/workspace"}}`,
+ `{"tool_name":"Read","input":{"file_path":"/research/img1-logo.png"}}`,
+ `{"tool_name":"Write","input":{"file_path":"/research/img9.png","content":"x"}}`,
+ `{"tool_name":"Read","input":{"file_path":"/render/1-work-1.png"}}`,
+ `{"tool_name":"Glob","input":{"pattern":"*.png","path":"/render"}}`,
+ `{"tool_name":"Grep","input":{"pattern":"x","path":"/render/"}}`,
+ `{"tool_name":"Write","input":{"file_path":"/render/planted.png","content":"x"}}`,
+ `{"tool_name":"Edit","input":{"file_path":"/render/1-work-1.png","old_string":"a","new_string":"b"}}`,
+ `{"tool_name":"Read","input":{"file_path":"/render/../etc/passwd"}}`,
+ `{"tool_name":"Read","input":{"file_path":"/renders/a.png"}}`,
+ `{"tool_name":"Read","input":{"file_path":"/etc/passwd"}}`,
+ `{"tool_name":"Read","input":{"file_path":"/tmp/a"}}`,
+ `{"tool_name":"Write","input":{"file_path":"/tool/equipo.sock","content":"x"}}`,
+ `{"tool_name":"Bash","input":{"command":"ls /render"}}`,
+ `{"tool_name":"Bash","input":{"command":"ls","dangerouslyDisableSandbox":true}}`,
+ `{"tool_name":"WebFetch","input":{"url":"https://example.com"}}`,
+ `{"tool_name":"mcp__equipo__render_page","input":{}}`,
+ `not json`,
+}
+
+// fixedBinding is a binding with fixed paths, so a policy's bytes are
+// the same on every run.
+var fixedBinding = provider.Binding{Provider: "claude", CredentialHome: "/private/account", Home: "/private/run", RuntimeRoot: "/private/runtime"}
+
+func policyGolden(t *testing.T, action, role string) []byte {
+ t.Helper()
+ p, err := provider.Profile(action)
+ if err != nil {
+ t.Fatal(err)
+ }
+ got, err := PolicyInputs(fixedBinding, provider.PolicyInputs{Action: action, Tools: p.MCPTools(), DeniedPaths: []string{"/private/state"}}, role, "claude-opus-5-5")
+ if err != nil {
+ t.Fatal(err)
+ }
+ raw, _ := json.MarshalIndent(map[string]any{"tools": got.Tools, "argv": got.Argv, "denied": got.DeniedPaths, "settings": string(got.Settings), "mcp": string(got.MCP), "thread": string(got.ThreadPolicy), "turn": string(got.TurnPolicy)}, "", " ")
+ return append(raw, '\n')
+}
+
+// TestEngineeringPolicyUnchanged: Engineering's Claude policy (tools,
+// argv, settings with every allow, ask and deny rule, the MCP and thread
+// policies) and its permission callback's answer to each request are
+// byte for byte what they were before Design (testdata, recorded at
+// 6cc538be).
+func TestEngineeringPolicyUnchanged(t *testing.T) {
+ want, err := os.ReadFile("testdata/engineering-policy.golden.json")
+ if err != nil {
+ t.Fatal(err)
+ }
+ if got := policyGolden(t, "implement", "Engineering"); string(got) != string(want) {
+ t.Fatalf("Engineering's policy changed:\n%s", got)
+ }
+ want, err = os.ReadFile("testdata/engineering-permission.golden.txt")
+ if err != nil {
+ t.Fatal(err)
+ }
+ f := fixtureFor(t, "Engineering")
+ var got strings.Builder
+ for _, q := range engineeringPermissionRequests {
+ got.WriteString(q + "\n" + string(StepPermission(json.RawMessage(q), f.launch.Policy)) + "\n")
+ }
+ if got.String() != string(want) {
+ t.Fatalf("Engineering's permission answers changed:\n%s", got.String())
+ }
+}
+
+// TestDesignPolicyIsEngineeringsPlusRender: the Design step's Claude
+// policy is Engineering's with exactly these differences: its Equipo
+// tools are design-v1's (render_page, submit_candidate, ask_person, no
+// submit_render), allowed without a prompt; its thread is the Design
+// role's; and /render is denied to every write (the sandbox's and
+// Write and Edit's), never to a read. Its native tools are design-v1's
+// Policy.Native, Engineering's.
+func TestDesignPolicyIsEngineeringsPlusRender(t *testing.T) {
+ menu, _ := specialist.Lookup(specialist.ProfileDesign)
+ p, err := provider.Profile(provider.DesignStepAction)
+ if err != nil {
+ t.Fatal(err)
+ }
+ got, err := PolicyInputs(fixedBinding, provider.PolicyInputs{Action: provider.DesignStepAction, Tools: p.MCPTools(), DeniedPaths: []string{"/private/state"}}, "Design", "claude-opus-5-5")
+ if err != nil {
+ t.Fatal(err)
+ }
+ wantTools := append(append(slices.Clone(menu.Policy.Native), "mcp__equipo__permission"), "mcp__equipo__render_page", "mcp__equipo__submit_candidate", "mcp__equipo__ask_person")
+ if !slices.Equal(got.Tools, wantTools) {
+ t.Fatalf("tools %q, want %q", got.Tools, wantTools)
+ }
+ eng, err := PolicyInputs(fixedBinding, provider.PolicyInputs{Action: "implement", Tools: mustProfile(t, "implement").MCPTools(), DeniedPaths: []string{"/private/state"}}, "Engineering", "claude-opus-5-5")
+ if err != nil {
+ t.Fatal(err)
+ }
+ if !slices.Equal(got.Tools[:len(menu.Policy.Native)], eng.Tools[:len(menu.Policy.Native)]) || !reflect.DeepEqual(got.Argv, eng.Argv) || !reflect.DeepEqual(got.DeniedPaths, eng.DeniedPaths) || string(got.MCP) != string(eng.MCP) || string(got.TurnPolicy) != string(eng.TurnPolicy) {
+ t.Fatalf("design differs from Engineering beyond its tools and /render:\n%q\n%q", got.Argv, eng.Argv)
+ }
+ if string(got.ThreadPolicy) != `{"specialist":"Design","model":"claude-opus-5-5","start":"session-id","resume":"resume"}` {
+ t.Fatalf("thread %s", got.ThreadPolicy)
+ }
+ // Engineering's settings with design's allow list and /render's
+ // write denials are design's settings, nothing else.
+ var want, have map[string]any
+ json.Unmarshal(eng.Settings, &want)
+ json.Unmarshal(got.Settings, &have)
+ perms := want["permissions"].(map[string]any)
+ perms["allow"] = []any{"mcp__equipo__render_page", "mcp__equipo__submit_candidate", "mcp__equipo__ask_person"}
+ deny := perms["deny"].([]any)
+ for _, read := range menu.Policy.ReadOnly {
+ for _, tool := range []string{"Write", "Edit"} {
+ deny = append(deny, tool+"(/"+read+")", tool+"(/"+read+"/**)")
+ }
+ fs := want["sandbox"].(map[string]any)["filesystem"].(map[string]any)
+ fs["denyWrite"] = append(fs["denyWrite"].([]any), read)
+ }
+ perms["deny"] = deny
+ if !reflect.DeepEqual(have, want) {
+ a, _ := json.Marshal(have)
+ b, _ := json.Marshal(want)
+ t.Fatalf("design settings\n%s\nwant\n%s", a, b)
+ }
+}
+
+func mustProfile(t *testing.T, action string) provider.ActionProfile {
+ t.Helper()
+ p, err := provider.Profile(action)
+ if err != nil {
+ t.Fatal(err)
+ }
+ return p
+}
+
+// TestDesignPolicyRefusals: the launcher's allowlist takes the design
+// action with exactly its three tools under the Design role, and refuses
+// the old submit_render, a missing or extra tool, another role, and
+// render_page anywhere else.
+func TestDesignPolicyRefusals(t *testing.T) {
+ tools := provider.DesignMCPTools()
+ for name, c := range map[string]struct {
+ action, role string
+ tools []string
+ }{
+ "the old submit_render": {provider.DesignStepAction, "Design", append(slices.Clone(tools), "mcp__equipo__submit_render")},
+ "no render_page": {provider.DesignStepAction, "Design", tools[1:]},
+ "another order": {provider.DesignStepAction, "Design", []string{tools[1], tools[0], tools[2]}},
+ "research's tools": {provider.DesignStepAction, "Design", []string{"mcp__equipo__submit_findings", "mcp__equipo__keep_image"}},
+ "a coordinator tool": {provider.DesignStepAction, "Design", append(slices.Clone(tools), "mcp__equipo__start_task")},
+ "as Engineering": {provider.DesignStepAction, "Engineering", tools},
+ "as Copy": {provider.DesignStepAction, "Copy", tools},
+ "render_page for implement": {"implement", "Engineering", append(mustProfile(t, "implement").MCPTools(), "mcp__equipo__render_page")},
+ "render_page for design": {"design", "Design", append(mustProfile(t, "design").MCPTools(), "mcp__equipo__render_page")},
+ "render_page with no action": {"", "Design", []string{"mcp__equipo__render_page"}},
+ } {
+ if _, err := PolicyInputs(fixedBinding, provider.PolicyInputs{Action: c.action, Tools: c.tools}, c.role, "model"); err == nil {
+ t.Errorf("%s accepted", name)
+ }
+ }
+}
+
+func designFixture(t *testing.T) *fixture {
+ t.Helper()
+ f := fixtureFor(t, "Engineering")
+ in := f.inputs
+ in.Action = provider.DesignStepAction
+ in.Tools = provider.DesignMCPTools()
+ in, err := PolicyInputs(f.lease.Binding(), in, provider.DesignSpecialist, f.launch.Selection.Model)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if f.launch.Policy, err = provider.BuildPolicy(f.lease.Binding(), in); err != nil {
+ t.Fatal(err)
+ }
+ f.inputs = in
+ return f
+}
+
+// TestDesignLaunch: the launcher re-derives the design policy from its
+// manifest and launches it (a real launch of the fake CLI, whose init
+// reports the manifest's tools); an init with the old submit_render, or
+// without render_page, is refused.
+func TestDesignLaunch(t *testing.T) {
+ f := designFixture(t)
+ if _, err := f.l.validatePolicy(f.lease.Binding(), f.launch.Policy); err != nil {
+ t.Fatalf("design policy refused: %v", err)
+ }
+ session, events := openFixture(t, f)
+ if err := f.l.StartTurn(context.Background(), session, provider.Turn{ID: "design-turn", AdmissionID: "design-admission", Prompt: "fixture"}); err != nil {
+ t.Fatal(err)
+ }
+ if ev := terminal(t, events); ev.Kind != "turn.completed" {
+ t.Fatalf("design launch: %+v", ev)
+ }
+ model := f.launch.Selection.Model
+ init := func(tools ...string) []byte {
+ raw, _ := json.Marshal(map[string]any{"claude_code_version": Version, "model": model, "permissionMode": "default", "tools": tools, "skills": []string{}, "plugins": []any{}, "mcp_servers": []any{map[string]string{"name": "equipo", "status": "connected"}}})
+ return raw
+ }
+ native := []string{"Bash", "Read", "Write", "Edit", "Glob", "Grep"}
+ if err := ValidateInit(f.launch.Policy, model, init(append(slices.Clone(native), provider.DesignMCPTools()...)...)); err != nil {
+ t.Fatalf("honest design init refused: %v", err)
+ }
+ for name, tools := range map[string][]string{
+ "submit_render": append(append(slices.Clone(native), provider.DesignMCPTools()...), "mcp__equipo__submit_render"),
+ "no render_page": append(slices.Clone(native), "mcp__equipo__submit_candidate", "mcp__equipo__ask_person"),
+ "WebFetch": append(append(slices.Clone(native), provider.DesignMCPTools()...), "WebFetch"),
+ } {
+ if ValidateInit(f.launch.Policy, model, init(tools...)) == nil {
+ t.Errorf("design init with %s accepted", name)
+ }
+ }
+}
+
+// TestDesignPermission: the Design step's callback reads /render (Read,
+// Glob, Grep) and writes nothing there; everything else is answered as
+// Engineering's callback answers it, byte for byte. Handed any policy
+// but the Design step's, it is Engineering's callback: /render is not
+// read.
+func TestDesignPermission(t *testing.T) {
+ f := designFixture(t)
+ eng := fixtureFor(t, "Engineering")
+ behavior := func(out json.RawMessage) (string, string) {
+ var v struct{ Behavior, Message string }
+ if json.Unmarshal(out, &v) != nil {
+ t.Fatalf("not JSON: %s", out)
+ }
+ return v.Behavior, v.Message
+ }
+ reads := map[string]bool{
+ `{"tool_name":"Read","input":{"file_path":"/render/1-work-1.png"}}`: true,
+ `{"tool_name":"Glob","input":{"pattern":"*.png","path":"/render"}}`: true,
+ `{"tool_name":"Grep","input":{"pattern":"x","path":"/render/"}}`: true,
+ }
+ writes := map[string]bool{
+ `{"tool_name":"Write","input":{"file_path":"/render/planted.png","content":"x"}}`: true,
+ `{"tool_name":"Edit","input":{"file_path":"/render/1-work-1.png","old_string":"a","new_string":"b"}}`: true,
+ }
+ for _, q := range engineeringPermissionRequests {
+ got := DesignPermission(json.RawMessage(q), f.launch.Policy)
+ b, m := behavior(got)
+ switch {
+ case reads[q]:
+ if b != "allow" {
+ t.Errorf("refused %s: %s", q, m)
+ }
+ case writes[q]:
+ if b != "deny" || !strings.Contains(m, "/render is read-only") {
+ t.Errorf("%s: %s %s", q, b, m)
+ }
+ default:
+ if want := StepPermission(json.RawMessage(q), eng.launch.Policy); string(got) != string(want) {
+ t.Errorf("%s: %s, Engineering's %s", q, got, want)
+ }
+ }
+ // With Engineering's policy it is Engineering's callback.
+ if got, want := DesignPermission(json.RawMessage(q), eng.launch.Policy), StepPermission(json.RawMessage(q), eng.launch.Policy); string(got) != string(want) {
+ t.Errorf("%s under Engineering's policy: %s, want %s", q, got, want)
+ }
+ }
+ for _, q := range []string{
+ `{"tool_name":"Read","input":{"file_path":"/render/../home/runner/.credentials.json"}}`,
+ `{"tool_name":"Read","input":{"file_path":"/render/../etc/passwd"}}`,
+ `{"tool_name":"Read","input":{"file_path":"/renderer/a.png"}}`,
+ `{"tool_name":"Read","input":{"file_path":"render/1-work-1.png"}}`,
+ `{"tool_name":"Glob","input":{"pattern":"../home/*","path":"/render"}}`,
+ `{"tool_name":"Write","input":{"file_path":"/render","content":"x"}}`,
+ `{"tool_name":"Read","input":{"file_path":"/render/a.png"},"extra":1}`,
+ } {
+ if b, _ := behavior(DesignPermission(json.RawMessage(q), f.launch.Policy)); b == "allow" {
+ t.Errorf("allowed %s", q)
+ }
+ }
+}
diff --git a/internal/runner/provider/claude/launcher.go b/internal/runner/provider/claude/launcher.go
index 116b6e7f..d04f72f3 100644
--- a/internal/runner/provider/claude/launcher.go
+++ b/internal/runner/provider/claude/launcher.go
@@ -154,7 +154,10 @@ func PolicyInputs(b provider.Binding, in provider.PolicyInputs, specialist, mode
assist := in.Action == "assist" && slices.Contains(assistMCP, tool)
answer := in.Action == "answer" && slices.Contains([]string{"mcp__equipo__git_log", "mcp__equipo__git_diff", "mcp__equipo__git_show"}, tool)
research := provider.ResearchAction(in.Action) && slices.Contains([]string{"mcp__equipo__submit_findings", "mcp__equipo__keep_image"}, tool)
- if in.Action != "coordinate" && !converse && !assist && !answer && !research && !slices.Contains([]string{"mcp__equipo__ask_person", "mcp__equipo__submit_candidate", "mcp__equipo__submit_review", "mcp__equipo__submit_reproduction", "mcp__equipo__submit_acceptance", "mcp__equipo__submit_answer", "mcp__equipo__submit_render"}, tool) {
+ // render_page only for the Design step (profile.AcceptsTools has
+ // already held it to exactly design-v1's three tools).
+ design := provider.DesignAction(in.Action) && slices.Contains(provider.DesignMCPTools(), tool)
+ if in.Action != "coordinate" && !converse && !assist && !answer && !research && !design && !slices.Contains([]string{"mcp__equipo__ask_person", "mcp__equipo__submit_candidate", "mcp__equipo__submit_review", "mcp__equipo__submit_reproduction", "mcp__equipo__submit_acceptance", "mcp__equipo__submit_answer", "mcp__equipo__submit_render"}, tool) {
return in, provider.ErrPolicy
}
tools = append(tools, tool)
@@ -174,6 +177,22 @@ func PolicyInputs(b provider.Binding, in provider.PolicyInputs, specialist, mode
nativeDenies = append(nativeDenies, tool+"(/"+path+")", tool+"(/"+path+"/**)")
}
}
+ // The Design step reads its captures at /render and writes nothing
+ // there: Write and Edit are denied it, as is every write in the
+ // sandbox (containment binds it read-only too). Reads are its
+ // callback's (DesignPermission).
+ var readOnly []string
+ if provider.DesignAction(in.Action) {
+ readOnly = provider.DesignReadOnly()
+ }
+ for _, path := range readOnly {
+ if !filepath.IsAbs(path) || filepath.Clean(path) != path || strings.ContainsAny(path, "*?[]()\n\r") {
+ return in, provider.ErrPolicy
+ }
+ for _, tool := range []string{"Write", "Edit"} {
+ nativeDenies = append(nativeDenies, tool+"(/"+path+")", tool+"(/"+path+"/**)")
+ }
+ }
allow := append([]string{}, in.Tools...)
// No shell command is reserved: ordinary sandboxed Bash commands run
// without a prompt, and no command's text is evidence of anything.
@@ -195,7 +214,7 @@ func PolicyInputs(b provider.Binding, in provider.PolicyInputs, specialist, mode
settings := map[string]any{
"env": map[string]string{"MCP_TOOL_TIMEOUT": "600000"},
"disableAllHooks": true, "enabledPlugins": map[string]any{"agents-md@builtin": false, "plugin-authoring@builtin": false}, "autoMemoryEnabled": false, "autoDreamEnabled": false,
- "sandbox": map[string]any{"enabled": true, "failIfUnavailable": true, "allowUnsandboxedCommands": false, "autoAllowBashIfSandboxed": true, "excludedCommands": []string{}, "filesystem": map[string]any{"denyRead": settingsDenied, "denyWrite": settingsDenied}, "network": map[string]any{"allowUnixSockets": []string{}}},
+ "sandbox": map[string]any{"enabled": true, "failIfUnavailable": true, "allowUnsandboxedCommands": false, "autoAllowBashIfSandboxed": true, "excludedCommands": []string{}, "filesystem": map[string]any{"denyRead": settingsDenied, "denyWrite": append(slices.Clone(settingsDenied), readOnly...)}, "network": map[string]any{"allowUnixSockets": []string{}}},
"permissions": map[string]any{"deny": nativeDenies, "allow": allow, "ask": ask},
}
if in.Action != "" {
diff --git a/internal/runner/provider/claude/testdata/engineering-permission.golden.txt b/internal/runner/provider/claude/testdata/engineering-permission.golden.txt
new file mode 100644
index 00000000..10d97c70
--- /dev/null
+++ b/internal/runner/provider/claude/testdata/engineering-permission.golden.txt
@@ -0,0 +1,44 @@
+{"tool_name":"Read","input":{"file_path":"/workspace/README.md"}}
+{"behavior":"allow","updatedInput":{"file_path":"/workspace/README.md"}}
+{"tool_name":"Write","input":{"file_path":"/workspace/mockups/tk1/index.html","content":"<p>x</p>"}}
+{"behavior":"allow","updatedInput":{"content":"\u003cp\u003ex\u003c/p\u003e","file_path":"/workspace/mockups/tk1/index.html"}}
+{"tool_name":"Edit","input":{"file_path":"/workspace/README.md","old_string":"teh","new_string":"the"}}
+{"behavior":"allow","updatedInput":{"file_path":"/workspace/README.md","new_string":"the","old_string":"teh"}}
+{"tool_name":"Glob","input":{"pattern":"*.md","path":"/workspace"}}
+{"behavior":"allow","updatedInput":{"path":"/workspace","pattern":"*.md"}}
+{"tool_name":"Grep","input":{"pattern":"x","path":"/workspace"}}
+{"behavior":"allow","updatedInput":{"path":"/workspace","pattern":"x"}}
+{"tool_name":"Read","input":{"file_path":"/research/img1-logo.png"}}
+{"behavior":"allow","updatedInput":{"file_path":"/research/img1-logo.png"}}
+{"tool_name":"Write","input":{"file_path":"/research/img9.png","content":"x"}}
+{"behavior":"deny","message":"provider_policy_rejected: /research is read-only: use Read, Glob and Grep there"}
+{"tool_name":"Read","input":{"file_path":"/render/1-work-1.png"}}
+{"behavior":"deny","message":"provider_policy_rejected: this step can use files only under /workspace (and read /research)"}
+{"tool_name":"Glob","input":{"pattern":"*.png","path":"/render"}}
+{"behavior":"deny","message":"provider_policy_rejected: this step can use files only under /workspace (and read /research)"}
+{"tool_name":"Grep","input":{"pattern":"x","path":"/render/"}}
+{"behavior":"deny","message":"provider_policy_rejected: this step can use files only under /workspace (and read /research)"}
+{"tool_name":"Write","input":{"file_path":"/render/planted.png","content":"x"}}
+{"behavior":"deny","message":"provider_policy_rejected: this step can use files only under /workspace (and read /research)"}
+{"tool_name":"Edit","input":{"file_path":"/render/1-work-1.png","old_string":"a","new_string":"b"}}
+{"behavior":"deny","message":"provider_policy_rejected: this step can use files only under /workspace (and read /research)"}
+{"tool_name":"Read","input":{"file_path":"/render/../etc/passwd"}}
+{"behavior":"deny","message":"provider_policy_rejected: this step can use files only under /workspace (and read /research)"}
+{"tool_name":"Read","input":{"file_path":"/renders/a.png"}}
+{"behavior":"deny","message":"provider_policy_rejected: this step can use files only under /workspace (and read /research)"}
+{"tool_name":"Read","input":{"file_path":"/etc/passwd"}}
+{"behavior":"deny","message":"provider_policy_rejected: this step can use files only under /workspace (and read /research)"}
+{"tool_name":"Read","input":{"file_path":"/tmp/a"}}
+{"behavior":"deny","message":"provider_policy_rejected: this step can use files only under /workspace (and read /research)"}
+{"tool_name":"Write","input":{"file_path":"/tool/equipo.sock","content":"x"}}
+{"behavior":"deny","message":"provider_policy_rejected: that path is protected: credentials, runtime files and links are never available"}
+{"tool_name":"Bash","input":{"command":"ls /render"}}
+{"behavior":"allow","updatedInput":{"command":"ls /render"}}
+{"tool_name":"Bash","input":{"command":"ls","dangerouslyDisableSandbox":true}}
+{"behavior":"deny","message":"provider_policy_rejected: commands run only inside the sandbox; dangerouslyDisableSandbox is not available"}
+{"tool_name":"WebFetch","input":{"url":"https://example.com"}}
+{"behavior":"deny","message":"provider_policy_rejected: this tool is not available to this step"}
+{"tool_name":"mcp__equipo__render_page","input":{}}
+{"behavior":"deny","message":"provider_policy_rejected: this tool is not available to this step"}
+not json
+{"behavior":"deny","message":"provider_policy_rejected: the request has a field this step does not accept"}
diff --git a/internal/runner/provider/claude/testdata/engineering-policy.golden.json b/internal/runner/provider/claude/testdata/engineering-policy.golden.json
new file mode 100644
index 00000000..e77f620f
--- /dev/null
+++ b/internal/runner/provider/claude/testdata/engineering-policy.golden.json
@@ -0,0 +1,57 @@
+{
+ "argv": [
+ "/opt/claude",
+ "-p",
+ "--verbose",
+ "--include-hook-events",
+ "--input-format",
+ "stream-json",
+ "--output-format",
+ "stream-json",
+ "--model",
+ "claude-opus-5-5",
+ "--setting-sources",
+ "",
+ "--disable-slash-commands",
+ "--strict-mcp-config",
+ "--mcp-config",
+ "/config/equipo-mcp.json",
+ "--settings",
+ "/config/equipo-settings.json",
+ "--permission-mode",
+ "manual",
+ "--permission-prompt-tool",
+ "mcp__equipo__permission",
+ "--tools",
+ "Bash,Read,Write,Edit,Glob,Grep"
+ ],
+ "denied": [
+ "/config",
+ "/dev/fd",
+ "/egress",
+ "/home/runner",
+ "/private/account",
+ "/private/run",
+ "/private/runtime",
+ "/private/state",
+ "/proc",
+ "/tool",
+ "/tool/equipo.sock"
+ ],
+ "mcp": "{\"mcpServers\":{\"equipo\":{\"type\":\"stdio\",\"command\":\"/opt/equipo-tool-proxy\",\"args\":[\"--socket\",\"/tool/equipo.sock\"]}}}",
+ "settings": "{\"autoDreamEnabled\":false,\"autoMemoryEnabled\":false,\"disableAllHooks\":true,\"enabledPlugins\":{\"agents-md@builtin\":false,\"plugin-authoring@builtin\":false},\"env\":{\"MCP_TOOL_TIMEOUT\":\"600000\"},\"permissions\":{\"allow\":[\"mcp__equipo__submit_candidate\",\"mcp__equipo__ask_person\",\"mcp__equipo__submit_render\"],\"ask\":[\"Read(//workspace/**)\",\"Write(//workspace/**)\",\"Edit(//workspace/**)\",\"Glob(//workspace/**)\",\"Grep(//workspace/**)\"],\"deny\":[\"Read(//config)\",\"Read(//config/**)\",\"Write(//config)\",\"Write(//config/**)\",\"Edit(//config)\",\"Edit(//config/**)\",\"Glob(//config)\",\"Glob(//config/**)\",\"Grep(//config)\",\"Grep(//config/**)\",\"Read(//dev/fd)\",\"Read(//dev/fd/**)\",\"Write(//dev/fd)\",\"Write(//dev/fd/**)\",\"Edit(//dev/fd)\",\"Edit(//dev/fd/**)\",\"Glob(//dev/fd)\",\"Glob(//dev/fd/**)\",\"Grep(//dev/fd)\",\"Grep(//dev/fd/**)\",\"Read(//egress)\",\"Read(//egress/**)\",\"Write(//egress)\",\"Write(//egress/**)\",\"Edit(//egress)\",\"Edit(//egress/**)\",\"Glob(//egress)\",\"Glob(//egress/**)\",\"Grep(//egress)\",\"Grep(//egress/**)\",\"Read(//home/runner)\",\"Read(//home/runner/**)\",\"Write(//home/runner)\",\"Write(//home/runner/**)\",\"Edit(//home/runner)\",\"Edit(//home/runner/**)\",\"Glob(//home/runner)\",\"Glob(//home/runner/**)\",\"Grep(//home/runner)\",\"Grep(//home/runner/**)\",\"Read(//private/account)\",\"Read(//private/account/**)\",\"Write(//private/account)\",\"Write(//private/account/**)\",\"Edit(//private/account)\",\"Edit(//private/account/**)\",\"Glob(//private/account)\",\"Glob(//private/account/**)\",\"Grep(//private/account)\",\"Grep(//private/account/**)\",\"Read(//private/run)\",\"Read(//private/run/**)\",\"Write(//private/run)\",\"Write(//private/run/**)\",\"Edit(//private/run)\",\"Edit(//private/run/**)\",\"Glob(//private/run)\",\"Glob(//private/run/**)\",\"Grep(//private/run)\",\"Grep(//private/run/**)\",\"Read(//private/runtime)\",\"Read(//private/runtime/**)\",\"Write(//private/runtime)\",\"Write(//private/runtime/**)\",\"Edit(//private/runtime)\",\"Edit(//private/runtime/**)\",\"Glob(//private/runtime)\",\"Glob(//private/runtime/**)\",\"Grep(//private/runtime)\",\"Grep(//private/runtime/**)\",\"Read(//private/state)\",\"Read(//private/state/**)\",\"Write(//private/state)\",\"Write(//private/state/**)\",\"Edit(//private/state)\",\"Edit(//private/state/**)\",\"Glob(//private/state)\",\"Glob(//private/state/**)\",\"Grep(//private/state)\",\"Grep(//private/state/**)\",\"Read(//proc)\",\"Read(//proc/**)\",\"Write(//proc)\",\"Write(//proc/**)\",\"Edit(//proc)\",\"Edit(//proc/**)\",\"Glob(//proc)\",\"Glob(//proc/**)\",\"Grep(//proc)\",\"Grep(//proc/**)\",\"Read(//tool)\",\"Read(//tool/**)\",\"Write(//tool)\",\"Write(//tool/**)\",\"Edit(//tool)\",\"Edit(//tool/**)\",\"Glob(//tool)\",\"Glob(//tool/**)\",\"Grep(//tool)\",\"Grep(//tool/**)\",\"Read(//tool/equipo.sock)\",\"Read(//tool/equipo.sock/**)\",\"Write(//tool/equipo.sock)\",\"Write(//tool/equipo.sock/**)\",\"Edit(//tool/equipo.sock)\",\"Edit(//tool/equipo.sock/**)\",\"Glob(//tool/equipo.sock)\",\"Glob(//tool/equipo.sock/**)\",\"Grep(//tool/equipo.sock)\",\"Grep(//tool/equipo.sock/**)\",\"Read(//home)\",\"Read(//home/**)\",\"Write(//home)\",\"Write(//home/**)\",\"Edit(//home)\",\"Edit(//home/**)\",\"Glob(//home)\",\"Glob(//home/**)\",\"Grep(//home)\",\"Grep(//home/**)\"]},\"sandbox\":{\"allowUnsandboxedCommands\":false,\"autoAllowBashIfSandboxed\":true,\"enabled\":true,\"excludedCommands\":[],\"failIfUnavailable\":true,\"filesystem\":{\"denyRead\":[\"/config\",\"/dev/fd\",\"/egress\",\"/home/runner\",\"/private/account\",\"/private/run\",\"/private/runtime\",\"/private/state\",\"/proc\",\"/tool\",\"/tool/equipo.sock\",\"/home\"],\"denyWrite\":[\"/config\",\"/dev/fd\",\"/egress\",\"/home/runner\",\"/private/account\",\"/private/run\",\"/private/runtime\",\"/private/state\",\"/proc\",\"/tool\",\"/tool/equipo.sock\",\"/home\"]},\"network\":{\"allowUnixSockets\":[]}}}",
+ "thread": "{\"specialist\":\"Engineering\",\"model\":\"claude-opus-5-5\",\"start\":\"session-id\",\"resume\":\"resume\"}",
+ "tools": [
+ "Bash",
+ "Read",
+ "Write",
+ "Edit",
+ "Glob",
+ "Grep",
+ "mcp__equipo__permission",
+ "mcp__equipo__submit_candidate",
+ "mcp__equipo__ask_person",
+ "mcp__equipo__submit_render"
+ ],
+ "turn": "{}"
+}
diff --git a/internal/runner/provider/codex/design_policy_test.go b/internal/runner/provider/codex/design_policy_test.go
new file mode 100644
index 00000000..928f24d5
--- /dev/null
+++ b/internal/runner/provider/codex/design_policy_test.go
@@ -0,0 +1,21 @@
+package codex
+
+import (
+ "testing"
+
+ "amadan.net/oficina/equipo/internal/runner/provider"
+)
+
+// TestDesignStepIsClaudeOnly: Codex has no policy for the Design step
+// (design-v1 runs on Claude only): its tools, render_page above all, are
+// refused, alone or beside any other action's.
+func TestDesignStepIsClaudeOnly(t *testing.T) {
+ b := provider.Binding{Provider: "codex", CredentialHome: "/private/account", Home: "/private/run", RuntimeRoot: "/private/runtime"}
+ if _, err := PolicyInputs(b, provider.PolicyInputs{Action: provider.DesignStepAction, Tools: provider.DesignMCPTools()}, "model"); err == nil {
+ t.Fatal("codex accepted the design step")
+ }
+ impl, _ := provider.Profile("implement")
+ if _, err := PolicyInputs(b, provider.PolicyInputs{Action: "implement", Tools: append(impl.MCPTools(), "mcp__equipo__render_page")}, "model"); err == nil {
+ t.Fatal("codex accepted render_page")
+ }
+}
diff --git a/internal/runner/provider/design_action_test.go b/internal/runner/provider/design_action_test.go
new file mode 100644
index 00000000..f744d167
--- /dev/null
+++ b/internal/runner/provider/design_action_test.go
@@ -0,0 +1,81 @@
+package provider
+
+import (
+ "errors"
+ "reflect"
+ "slices"
+ "testing"
+
+ "amadan.net/oficina/equipo/internal/specialist"
+)
+
+// TestDesignActionProfile: the Design step's action profile (design-v1's
+// Policy.Action) has exactly render_page, submit_candidate and
+// ask_person, design-v1's tools in its order, and never the old
+// submit_render; it is the Design role's, writes its workspace, and is
+// the only action that may read /render.
+func TestDesignActionProfile(t *testing.T) {
+ menu, ok := specialist.Lookup(specialist.ProfileDesign)
+ if !ok || menu.Policy.Action != DesignStepAction {
+ t.Fatalf("design-v1's action is %q, the runner's %q", menu.Policy.Action, DesignStepAction)
+ }
+ p, err := Profile(DesignStepAction)
+ if err != nil {
+ t.Fatal(err)
+ }
+ want := ActionProfile{Action: "design_step", Specialist: "Design", Submission: "submit_candidate"}
+ if p != want {
+ t.Fatalf("profile %+v, want %+v", p, want)
+ }
+ if got := p.Tools(); !slices.Equal(got, []string{"render_page", "submit_candidate", "ask_person"}) || !slices.Equal(got, menu.Tools) {
+ t.Fatalf("tools %v, design-v1 %v", got, menu.Tools)
+ }
+ if got := p.MCPTools(); !slices.Equal(got, []string{"mcp__equipo__render_page", "mcp__equipo__submit_candidate", "mcp__equipo__ask_person"}) {
+ t.Fatalf("MCP tools %v", got)
+ }
+ if !p.AcceptsTools(DesignMCPTools()) {
+ t.Fatal("its own tools refused")
+ }
+ for name, tools := range map[string][]string{
+ "the old submit_render": append(p.MCPTools(), "mcp__equipo__submit_render"),
+ "no render_page": {"mcp__equipo__submit_candidate", "mcp__equipo__ask_person"},
+ "Engineering's": {"mcp__equipo__submit_candidate", "mcp__equipo__ask_person", "mcp__equipo__submit_render"},
+ "research's": {"mcp__equipo__submit_findings", "mcp__equipo__keep_image"},
+ "none": {},
+ } {
+ if p.AcceptsTools(tools) {
+ t.Errorf("%s accepted", name)
+ }
+ }
+ // Only the Design step reads /render; nothing else, Engineering
+ // above all, and not the plan workflow's legacy design action.
+ for _, action := range []string{"implement", "design", "copy", "inspect", "review", "answer", "converse", "assist", "coordinate", ResearchStepAction, GlanceAction, ""} {
+ if RenderReaderAction(action) {
+ t.Errorf("%q reads /render", action)
+ }
+ }
+ if !RenderReaderAction(DesignStepAction) || !DesignAction(DesignStepAction) || DesignAction("design") || ResearchReaderAction(DesignStepAction) {
+ t.Fatal("the design step's reads")
+ }
+}
+
+// TestEngineeringActionUnchanged: Engineering's action profile and tool
+// list, as they were before Design (byte for byte), and the plan
+// workflow's legacy design action left as it was.
+func TestEngineeringActionUnchanged(t *testing.T) {
+ for action, want := range map[string]struct {
+ profile ActionProfile
+ tools []string
+ }{
+ "implement": {ActionProfile{Action: "implement", Specialist: "Engineering", Submission: "submit_candidate", Render: true}, []string{"submit_candidate", "ask_person", "submit_render"}},
+ "design": {ActionProfile{Action: "design", Specialist: "Design", Submission: "submit_candidate", Render: true}, []string{"submit_candidate", "ask_person", "submit_render"}},
+ } {
+ p, err := Profile(action)
+ if err != nil || p != want.profile || !reflect.DeepEqual(p.Tools(), want.tools) {
+ t.Fatalf("%s: %+v %v %v", action, p, p.Tools(), err)
+ }
+ }
+ if _, err := Profile("design-v1"); !errors.Is(err, ErrPolicy) {
+ t.Fatal("a profile id is not an action")
+ }
+}
diff --git a/internal/runner/provider/policy.go b/internal/runner/provider/policy.go
index 84c17255..02d5e32c 100644
--- a/internal/runner/provider/policy.go
+++ b/internal/runner/provider/policy.go
@@ -829,6 +829,13 @@ func (p Policy) ResearchReader() bool {
return p.ManifestHash != "" && digest(p.Manifest) == p.ManifestHash && json.Unmarshal(p.Manifest, &m) == nil && ResearchReaderAction(m.Action)
}
+// RenderReader reports whether the policy may have its step's captures
+// bound read-only at /render (the Design step only).
+func (p Policy) RenderReader() bool {
+ var m effectiveManifest
+ return p.ManifestHash != "" && digest(p.Manifest) == p.ManifestHash && json.Unmarshal(p.Manifest, &m) == nil && RenderReaderAction(m.Action)
+}
+
// validAuthHost accepts one lower-case DNS name: no scheme, port, path,
// wildcard or user.
func validAuthHost(host string) bool {
diff --git a/internal/runner/provider/types.go b/internal/runner/provider/types.go
index 0dac4eb7..beb90fb1 100644
--- a/internal/runner/provider/types.go
+++ b/internal/runner/provider/types.go
@@ -72,9 +72,13 @@ type Launch struct {
// images, bound read-only at /research through a pinned descriptor.
// Containment allows it on Engineering and Review launches only.
ResearchDir string `json:",omitempty"`
- Selection Selection
- Binding Binding
- Policy Policy
+ // RenderDir is a runner-made directory of the step's render_page
+ // captures, bound read-only at /render through a pinned descriptor.
+ // Containment allows it on the Design step's launch only.
+ RenderDir string `json:",omitempty"`
+ Selection Selection
+ Binding Binding
+ Policy Policy
}
// ID is the provider's session identity. AttemptKey remains local to Equipo,
diff --git a/internal/runner/thin/design_policy_test.go b/internal/runner/thin/design_policy_test.go
new file mode 100644
index 00000000..113e11f2
--- /dev/null
+++ b/internal/runner/thin/design_policy_test.go
@@ -0,0 +1,236 @@
+//go:build linux
+
+package thin
+
+import (
+ "bufio"
+ "context"
+ "crypto/sha256"
+ "encoding/hex"
+ "encoding/json"
+ "log/slog"
+ "os"
+ "path/filepath"
+ "slices"
+ "strings"
+ "testing"
+ "time"
+
+ "amadan.net/oficina/equipo/internal/fakeclaude"
+ "amadan.net/oficina/equipo/internal/runner"
+ "amadan.net/oficina/equipo/internal/runner/containment"
+ "amadan.net/oficina/equipo/internal/runner/provider"
+ "amadan.net/oficina/equipo/internal/runner/provider/claude"
+ "amadan.net/oficina/equipo/internal/runner/workspace"
+ "amadan.net/oficina/equipo/internal/specialist"
+ "amadan.net/oficina/equipo/internal/testci"
+ "amadan.net/oficina/equipo/internal/wire"
+)
+
+// claudeRig runs a real Claude launch: the fake CLI (this test binary
+// as "claude") in bubblewrap, on one subscription connection.
+type claudeRig struct {
+ t *testing.T
+ ctx context.Context
+ e *Engineer
+ conns *Conns
+ root string
+}
+
+func newClaudeRig(t *testing.T) *claudeRig {
+ t.Helper()
+ testci.Tools(t, "bwrap", "git")
+ if _, err := os.Stat("/usr/bin/bwrap"); err != nil {
+ testci.Absent(t, "bubblewrap is absent")
+ }
+ // A short root: the tool socket's path must fit a socket address.
+ root, err := os.MkdirTemp("", "ds-")
+ if err != nil {
+ t.Fatal(err)
+ }
+ t.Cleanup(func() { os.RemoveAll(root) })
+ for _, d := range []string{"state", "work", "scratch", "sessions", "bin"} {
+ if err := os.MkdirAll(filepath.Join(root, d), 0700); err != nil {
+ t.Fatal(err)
+ }
+ }
+ state, err := OpenState(context.Background(), filepath.Join(root, "state"))
+ if err != nil {
+ t.Fatal(err)
+ }
+ t.Cleanup(func() { state.Close() })
+ home := filepath.Join(root, "accounts", "claude-a")
+ os.MkdirAll(home, 0700)
+ identity := map[string]string{"account_id": connPerson, "home_id": "h-a", "provider_version": fakeclaude.Version}
+ raw, _ := json.Marshal(identity)
+ os.WriteFile(filepath.Join(home, provider.IdentityFile), raw, 0600)
+ raw, _ = json.Marshal(map[string]any{"oauthAccount": map[string]string{"emailAddress": connPerson}})
+ os.WriteFile(filepath.Join(home, ".claude.json"), raw, 0600)
+ if err := fakeclaude.WriteCredentials(home, time.Now().Add(8*time.Hour)); err != nil {
+ t.Fatal(err)
+ }
+ raw, _ = json.Marshal([]map[string]any{{"id": "claude-a", "local_id": "claude-a", "label": "claude-a", "person_id": connPerson, "provider": "claude", "family": "claude", "model": "claude-opus-5-5", "account_id": connPerson, "provider_home": home, "kind": "subscription", "expected_identity": identity}})
+ bindings := filepath.Join(root, "bindings.json")
+ os.WriteFile(bindings, raw, 0600)
+ bin := filepath.Join(root, "bin")
+ claudePath := copySelf(t, bin, "claude")
+ cli, _ := os.ReadFile(claudePath)
+ sum := sha256.Sum256(cli)
+ self, _ := os.Executable()
+ cfg := runner.Config{AccountBindingsPath: bindings, AmadanCredentialPath: filepath.Join(root, "amadan.json"), ClaudePath: claudePath, CodexPath: "/bin/true", StateDir: filepath.Join(root, "state"), WorkspaceRoot: filepath.Join(root, "work"), ScratchRoot: filepath.Join(root, "scratch"), GitPath: "/usr/bin/git", BwrapPath: "/usr/bin/bwrap", ToolProxyPath: copySelf(t, bin, "equipo-tool-proxy")}
+ m, err := containment.New(containment.Config{Binary: "/usr/bin/bwrap", RunnerBinary: self, ScratchRoot: cfg.ScratchRoot})
+ if err != nil {
+ testci.Absent(t, "namespaces are unavailable: "+err.Error())
+ }
+ conns := &Conns{Runner: cfg, State: state}
+ conns.Validated("claude-a")
+ ctx, cancel := context.WithCancel(context.Background())
+ t.Cleanup(cancel)
+ e := &Engineer{O: ClaudeOptions{Runner: cfg, Manager: m, State: state, SessionRoot: filepath.Join(root, "sessions"), Digest: hex.EncodeToString(sum[:]), LockWait: 5 * time.Second, Logger: slog.New(slog.NewTextHandler(testWriter{t}, nil))}, Owners: []string{connPerson}, MaxStep: 2 * time.Minute, Conns: conns, Host: "test"}
+ // The run's defaults, as Run sets them: Refresh runs the fake CLI's
+ // auth status in the source home.
+ e.O.defaults()
+ return &claudeRig{t: t, ctx: ctx, e: e, conns: conns, root: root}
+}
+
+// binding is the rig's one Claude connection.
+func (r *claudeRig) binding() runner.AccountBinding {
+ r.t.Helper()
+ bs, err := runner.LoadBindings(r.e.O.Runner.AccountBindingsPath)
+ if err != nil || len(bs) != 1 {
+ r.t.Fatalf("bindings %v %v", bs, err)
+ }
+ return bs[0]
+}
+
+// initTools are the tools the CLI reported in the run's system/init.
+func (r *claudeRig) initTools(row stepRow) []string {
+ r.t.Helper()
+ f, err := os.Open(filepath.Join(r.e.root(), stepKey(row), "log.jsonl"))
+ if err != nil {
+ r.t.Fatal(err)
+ }
+ defer f.Close()
+ scan := bufio.NewScanner(f)
+ scan.Buffer(make([]byte, 0, 64<<10), 4<<20)
+ for scan.Scan() {
+ var v struct {
+ Type, Subtype string
+ Tools []string
+ }
+ if json.Unmarshal(scan.Bytes(), &v) == nil && v.Type == "system" && v.Subtype == "init" {
+ return v.Tools
+ }
+ }
+ r.t.Fatal("no system/init in the step log")
+ return nil
+}
+
+// captureDir is a step's render directory as render_page leaves it:
+// the runner's, 0700, one capture in it.
+func captureDir(t *testing.T, root string) (string, []byte) {
+ t.Helper()
+ dir := filepath.Join(root, "render-tk1")
+ if err := os.Mkdir(dir, 0700); err != nil {
+ t.Fatal(err)
+ }
+ png := []byte("\x89PNG\r\n\x1a\nfixture capture")
+ if err := os.WriteFile(filepath.Join(dir, "1-work-1.png"), png, 0600); err != nil {
+ t.Fatal(err)
+ }
+ return dir, png
+}
+
+// TestDesignStepPolicyRealLaunch: a real Claude launch (the fake CLI in
+// bubblewrap) with the Design step's policy lists exactly Engineering's
+// native tools and render_page, submit_candidate and ask_person (no
+// submit_render); it reads a capture from /render and copies it into
+// the workspace; a write to /render is refused by the callback, and a
+// direct one by the read-only mount.
+func TestDesignStepPolicyRealLaunch(t *testing.T) {
+ r := newClaudeRig(t)
+ work := t.TempDir()
+ render, png := captureDir(t, r.root)
+ row := stepRow{DispatchCommand: wire.DispatchCommand{Person: connPerson, TaskID: "tk1", StepID: "ds1", Attempt: 1, Specialist: wire.SpecialistEngineering, Profile: specialist.ProfileDesign}}
+ spec := designRun(r.binding(), "[Equipo: engineering] copy:/render/1-work-1.png|mockups/tk1/capture.png escape:/render/planted.png rowrite:/render/forced.png")
+ spec.render = render
+ res := r.e.run(r.ctx, row, workspace.TaskTree{Dir: work}, spec)
+ if res.reason != "" || !res.terminated {
+ t.Fatalf("run %+v", res)
+ }
+ want := append([]string{"Bash", "Read", "Write", "Edit", "Glob", "Grep"}, "mcp__equipo__render_page", "mcp__equipo__submit_candidate", "mcp__equipo__ask_person")
+ if got := r.initTools(row); !slices.Equal(got, want) {
+ t.Fatalf("the CLI listed %q, want %q", got, want)
+ }
+ copied, err := os.ReadFile(filepath.Join(work, "mockups", "tk1", "capture.png"))
+ if err != nil || string(copied) != string(png) {
+ t.Fatalf("capture not read from /render: %q %v (%s)", copied, err, res.summary)
+ }
+ for _, said := range []string{"Copied /render/1-work-1.png to mockups/tk1/capture.png.", "Writing /render/forced.png failed (errno 30).", "Write to /render/planted.png was denied."} {
+ if !strings.Contains(res.summary, said) {
+ t.Fatalf("summary %q lacks %q", res.summary, said)
+ }
+ }
+ entries, _ := os.ReadDir(render)
+ if len(entries) != 1 || res.refused != 1 {
+ t.Fatalf("render directory %v, %d refused", entries, res.refused)
+ }
+}
+
+// TestEngineeringStepNoRender: Engineering's step, launched the same
+// way, lists its own tools (submit_render's stub, never render_page)
+// and cannot read /render: its callback refuses the path, and its
+// launch is refused a render directory outright.
+func TestEngineeringStepNoRender(t *testing.T) {
+ r := newClaudeRig(t)
+ work := t.TempDir()
+ render, _ := captureDir(t, r.root)
+ row := stepRow{DispatchCommand: wire.DispatchCommand{Person: connPerson, TaskID: "tk1", StepID: "en1", Attempt: 1, Specialist: wire.SpecialistEngineering}}
+ spec := specialistRun{action: "implement", binding: r.binding(), tools: stepTools, names: []string{"submit_candidate", "ask_person", "submit_render"}, permission: claude.StepPermission, call: func(context.Context, string, string, json.RawMessage) (string, bool) { return stepToolText, false }, prompt: "[Equipo: engineering] copy:/render/1-work-1.png|capture.png"}
+ res := r.e.run(r.ctx, row, workspace.TaskTree{Dir: work}, spec)
+ if res.reason != "" || !res.terminated {
+ t.Fatalf("run %+v", res)
+ }
+ want := []string{"Bash", "Read", "Write", "Edit", "Glob", "Grep", "mcp__equipo__submit_candidate", "mcp__equipo__ask_person", "mcp__equipo__submit_render"}
+ if got := r.initTools(row); !slices.Equal(got, want) {
+ t.Fatalf("the CLI listed %q, want %q", got, want)
+ }
+ if !strings.Contains(res.summary, "Read of /render/1-work-1.png was denied.") {
+ t.Fatalf("summary %q", res.summary)
+ }
+ spec.render = render
+ row.StepID = "en2"
+ if res = r.e.run(r.ctx, row, workspace.TaskTree{Dir: work}, spec); res.reason != "policy_rejected" {
+ t.Fatalf("Engineering launched with /render: %+v", res)
+ }
+}
+
+// TestDesignToolSurface: the Design step's MCP tools are design-v1's,
+// in its order; render_page refuses with its fixed text until the step
+// serves it, and submit_candidate and ask_person answer as
+// Engineering's.
+func TestDesignToolSurface(t *testing.T) {
+ var names []string
+ for _, tool := range designTools {
+ names = append(names, tool.(map[string]any)["name"].(string))
+ }
+ if !slices.Equal(names, provider.DesignTools()) || !slices.Equal(designToolNames, provider.DesignTools()) {
+ t.Fatalf("tools %v names %v, design-v1 %v", names, designToolNames, provider.DesignTools())
+ }
+ spec := designRun(runner.AccountBinding{}, "p")
+ if spec.action != provider.DesignStepAction || !slices.Equal(spec.names, designToolNames) {
+ t.Fatalf("run %+v", spec)
+ }
+ for name, want := range map[string]struct {
+ text string
+ isError bool
+ }{
+ "render_page": {renderPageStubText, true},
+ "submit_candidate": {stepToolText, false},
+ "ask_person": {stepToolText, false},
+ } {
+ if text, isError := spec.call(context.Background(), name, "u", json.RawMessage(`{}`)); text != want.text || isError != want.isError {
+ t.Errorf("%s: %q %v", name, text, isError)
+ }
+ }
+}
diff --git a/internal/runner/thin/engineer.go b/internal/runner/thin/engineer.go
index 0b7a3e55..038a2fc7 100644
--- a/internal/runner/thin/engineer.go
+++ b/internal/runner/thin/engineer.go
@@ -815,6 +815,10 @@ type specialistRun struct {
// research is the attempt's directory of kept Research images,
// bound read-only at /research ("": none).
research string
+ // render is the Design step's render directory, its render_page
+ // captures, bound read-only at /render ("": none). Containment
+ // refuses it to any other launch.
+ render string
// admit is the scheduler's admission of a metered attempt, written in
// the metered guard's transaction (nil: admitted already, or none).
admit admitFunc
@@ -1071,7 +1075,7 @@ func (e *Engineer) run(ctx context.Context, r stepRow, tree workspace.TaskTree,
if limit < minTurn {
return stepResult{reason: "account_unavailable", terminated: true}
}
- launch := provider.Launch{ToolSocket: tool.Path, AttemptKey: "step/" + stepKey(r) + "/" + uuid(), Workspace: tree.Dir, ResearchDir: spec.research, Selection: sel, Binding: binding, Policy: policy}
+ launch := provider.Launch{ToolSocket: tool.Path, AttemptKey: "step/" + stepKey(r) + "/" + uuid(), Workspace: tree.Dir, ResearchDir: spec.research, RenderDir: spec.render, Selection: sel, Binding: binding, Policy: policy}
pctx, kill := context.WithCancel(context.Background())
defer kill()
record := spec.record
diff --git a/internal/runner/thin/mcp.go b/internal/runner/thin/mcp.go
index de687068..bab334d1 100644
--- a/internal/runner/thin/mcp.go
+++ b/internal/runner/thin/mcp.go
@@ -13,6 +13,7 @@ import (
"sync"
"amadan.net/oficina/equipo/internal/runner/provider"
+ "amadan.net/oficina/equipo/internal/runner/provider/claude"
"amadan.net/oficina/equipo/internal/wire"
"amadan.net/oficina/equipo/internal/runner"
@@ -225,6 +226,42 @@ var stepTools = []any{
// stepToolText is the answer to any step tool.
const stepToolText = "Not needed in this step: Equipo commits and pushes your changes in /workspace when you finish. Carry on, and end with a short summary of what you changed and why."
+// designTools are the tools the design_step profile pins for a Design
+// step: exactly design-v1's (provider.DesignTools), render_page in place
+// of Engineering's submit_render stub. submit_candidate and ask_person
+// answer as Engineering's do. render_page is listed but not served yet:
+// the Design step (plan task 18) runs it live (renderpage.Tool.Call);
+// until then a call refuses with renderPageStubText.
+var designTools = []any{
+ map[string]any{"name": "render_page", "description": "Render pages of the task's site in a browser: tree base (the task's base commit) or work (your workspace now), or compare true to render both and diff them. Each capture is a PNG in /render/, read-only to you; open it with Read.", "inputSchema": toolSchema(map[string]any{"tree": map[string]any{"type": "string", "enum": []string{"base", "work", "both"}}, "pages": map[string]any{"type": "array", "minItems": 1, "maxItems": 6, "items": toolSchema(map[string]any{"path": str, "viewport": map[string]any{"type": "string", "enum": []string{"phone", "tablet", "desktop"}}, "full_page": map[string]string{"type": "boolean"}}, "path", "viewport")}, "compare": map[string]string{"type": "boolean"}}, "pages")},
+ stepTools[0],
+ stepTools[1],
+}
+
+// designToolNames are designTools' names, in order.
+var designToolNames = []string{"render_page", "submit_candidate", "ask_person"}
+
+// renderPageStubText is render_page's answer until the Design step
+// serves it.
+const renderPageStubText = "render_page is not available in this step yet. Carry on without renders, and say so in your summary."
+
+// designCall answers the Design step's tools: render_page refuses until
+// it is served, and the rest answer as Engineering's.
+func designCall(_ context.Context, name, _ string, _ json.RawMessage) (string, bool) {
+ if name == "render_page" {
+ return renderPageStubText, true
+ }
+ return stepToolText, false
+}
+
+// designRun is a Design step's run on binding b: the design_step policy
+// (design-v1's tools, Engineering's native tools and /render read-only,
+// claude.DesignPermission) with prompt. The caller sets render, the
+// step's capture directory.
+func designRun(b runner.AccountBinding, prompt string) specialistRun {
+ return specialistRun{action: provider.DesignStepAction, binding: b, tools: designTools, names: designToolNames, permission: claude.DesignPermission, call: designCall, prompt: prompt}
+}
+
// serveMCP answers JSON-RPC lines until the peer closes.
func serveMCP(ctx context.Context, c net.Conn, set toolSet, call ToolReplyFunc) {
r := bufio.NewReaderSize(c, maxToolFrame+1)
diff --git a/internal/specialist/design_test.go b/internal/specialist/design_test.go
index 9edf934a..8b0a3884 100644
--- a/internal/specialist/design_test.go
+++ b/internal/specialist/design_test.go
@@ -29,6 +29,14 @@ var golden = []Profile{
Capabilities: []string{"branch.edit", "page.render"},
Tools: []string{"render_page", "submit_candidate", "ask_person"},
Pack: "de40167d0d843f4f99ecc633b7022ac8631db74c74c98ed5fdbd4ea732d3334a",
+ // Task 13's executable policy: the runner's design_step action
+ // profile, Engineering's native tools, and /render read-only
+ // beyond Engineering's file permissions, nothing else.
+ Policy: Policy{
+ Action: "design_step",
+ Native: []string{"Bash", "Read", "Write", "Edit", "Glob", "Grep"},
+ ReadOnly: []string{"/render"},
+ },
},
}
@@ -192,3 +200,17 @@ func TestDescribeDesign(t *testing.T) {
}
}
}
+
+// TestPolicyIsACopy: Profiles and Lookup hand out copies of a profile's
+// executable policy, so a caller cannot widen the menu's.
+func TestPolicyIsACopy(t *testing.T) {
+ p, ok := Lookup(ProfileDesign)
+ if !ok {
+ t.Fatal("no design-v1")
+ }
+ p.Policy.Native[0], p.Policy.ReadOnly[0] = "WebFetch", "/"
+ again, _ := Lookup(ProfileDesign)
+ if !reflect.DeepEqual(again.Policy, golden[1].Policy) {
+ t.Fatalf("the menu's policy changed through a copy: %+v", again.Policy)
+ }
+}
diff --git a/internal/specialist/menu.go b/internal/specialist/menu.go
index 042b1db2..cf379f98 100644
--- a/internal/specialist/menu.go
+++ b/internal/specialist/menu.go
@@ -69,8 +69,31 @@ type Profile struct {
// the runner's code (research-v1). PackText serves the file only
// while its digest is this.
Pack string
+ // Policy is the executable policy a step of the profile runs
+ // under; the zero Policy for a profile whose step the runner's own
+ // code pins (research-v1, as its prompt).
+ Policy Policy
}
+// Policy is a profile's executable policy: Action, the runner's launch
+// action profile (provider.Profile), whose Equipo tools are exactly the
+// profile's Tools; Native, the CLI's native tools, in order; and
+// ReadOnly, the paths beyond Engineering's file permissions (/workspace,
+// and /research to read) that its native file tools may read and never
+// write. The runner's policy is tested against it.
+type Policy struct {
+ Action string
+ Native []string
+ ReadOnly []string
+}
+
+// ActionDesignStep is the runner's launch action for a design-v1 step,
+// and RenderMount where the step's captures are, read-only to it.
+const (
+ ActionDesignStep = "design_step"
+ RenderMount = "/render"
+)
+
// packs are the prompt packs, reviewed files in the repository, never
// fetched at run time. design-v1.md is our own design discipline,
// drawing on the method of the impeccable skill
@@ -81,7 +104,8 @@ var packs embed.FS
var menu = []Profile{
{ID: ProfileResearch, Capabilities: []string{CapabilityWebResearch}, Tools: []string{ToolSubmitFindings, ToolKeepImage}},
- {ID: ProfileDesign, Capabilities: []string{CapabilityBranchEdit, CapabilityPageRender}, Tools: []string{ToolRenderPage, ToolSubmitCandidate, ToolAskPerson}, Pack: "de40167d0d843f4f99ecc633b7022ac8631db74c74c98ed5fdbd4ea732d3334a"},
+ {ID: ProfileDesign, Capabilities: []string{CapabilityBranchEdit, CapabilityPageRender}, Tools: []string{ToolRenderPage, ToolSubmitCandidate, ToolAskPerson}, Pack: "de40167d0d843f4f99ecc633b7022ac8631db74c74c98ed5fdbd4ea732d3334a",
+ Policy: Policy{Action: ActionDesignStep, Native: []string{"Bash", "Read", "Write", "Edit", "Glob", "Grep"}, ReadOnly: []string{RenderMount}}},
}
func init() {
@@ -153,6 +177,7 @@ func Lookup(id string) (Profile, bool) {
func (p Profile) clone() Profile {
p.Capabilities, p.Tools = slices.Clone(p.Capabilities), slices.Clone(p.Tools)
+ p.Policy.Native, p.Policy.ReadOnly = slices.Clone(p.Policy.Native), slices.Clone(p.Policy.ReadOnly)
return p
}