wire: protocol 36 (ProtocolDesign), the Design specialist's frames
Task 11 of dynamic specialists slice 1 (half 1b). Types, negotiation,
encode/decode bounds and tests only; tasks 15 to 19 add the behaviour.
What changed:
- wire: Protocol36 and ProtocolDesign; ProtocolCurrent is 36.
DispatchCommand gains SpecialistID, SpecialistRevision,
SpecialistProject, Profile and Capabilities (omitempty);
LeasePurposeRender ("page_render"); StepReport.Options
[{name, captures [{id, sha256, tree_digest}]}]; the render_file
frame (RenderFile, durable, as research_file); Specialist.Project
(always said, "" the team); AnswerCard.Note documented for Build.
- wire/design.go: ValidOptions (at most 4 options and 12 captures;
names a plain label of at most 60 bytes, said once case folded;
capture ids render_page's <call>-<base|work|diff>-<n>.png, said
once; sha256 and tree_digest 64 lower-case hex), ValidRenderFile
(exact chunk count and share, at most 2 MiB, strict base64),
ValidSpecialistBinding (none, or all of: sp_ id, revision >= 1,
p_ id or "", menu-shaped profile, 1 to 8 distinct capabilities),
ProjectProposal, and downgradeDesign: below 36 Encode refuses a
dispatch with any part of a binding, a page_render check, a
render_file chunk and propose_specialist with a project other than
""; it drops a report's options and a proposal's "" project.
- runner/thin: propose_specialist's schema takes an optional project;
a proposal for one project is answered on a link below 36, before
sending (bridge) and for a queued call (link), as places does.
- equipo/chat: propose_specialist strictly decodes project; one
project's id is refused (project_unsupported) until task 15, never
read as the team's. A direction card's Build may carry a note,
bounded as Try again's (MaxDirectionNote, no NUL, not blank); it is
not used yet (task 19).
- Protocol assertions in internal/wire tests moved to ProtocolDesign
and Spoken(99) == 36, as protocol 35 did; openapi Specialist gains
project; renderpage pins its capture names and bound to the wire's;
size exemptions updated to measured totals (thin was already over
at HEAD: 31067/26626).
Tests:
CGO_ENABLED=0 go test ./internal/wire/... ./internal/runner/renderpage/
CGO_ENABLED=0 go test ./internal/runner/thin/ -run 'TestProjectProposal|TestBridgeRefusesProjectProposal|TestProposeSpecialistOffersProject|Refused|Bridge|Link|Research|Stuck|Places|MCP'
CGO_ENABLED=0 go test ./internal/equipo/chat/ -run 'Specialist|Research|Explore|Direction|Answer'
CGO_ENABLED=0 go test ./internal/thintest/ -run 'Specialist|Mixed|Research|Explore|Places'
CGO_ENABLED=0 go test ./internal/plan3test/ -run '^TestPersonAPIDeviceContract$'
rastrillo budget size; runner-dead-references.py; darwin/arm64
build and vet of the runner gates.
RED:
- wire: build failed, unknown field SpecialistID in DispatchCommand,
undefined wire.DesignOption, wire.RenderFile.
- wire after the bump: 16 tests pinned to 35 failed (for example
TestProtocol30ToolHealth "stuck 30, current 36"); updated.
- plan3test: "schema Specialist differs from internal/wire".
- chat TestProposeSpecialistProject: one project's proposal answered
Code:invalid (strict decode refused the field).
- thin: build failed, undefined designRefused, toolProjectOld.
- thintest TestExploreBuildNote: "a note a NUL: <nil>" (Build ignored
the note).
- TestCapturesFitTheWire and TestProjectProposalUnencodableCallIsRetired
passed when first run (written after the code they pin); both are
covered by the mutations below.
GREEN: every command above passes.
Mutations (guard broken -> test that failed; each restored): 75
killed, none surviving (5 first tries that did not compile were redone
so they build):
- Encode: ProtocolCurrent back to 35 -> TestProtocol36Design; Encode
skips downgradeDesign; bound dispatch not refused; hasBinding
ignoring each of id, revision, project, profile, capabilities;
render lease not refused; render_file not refused; options not
dropped; project proposal not refused; "" project not dropped; null
read as the team; render_file not durable ->
TestEncodeBelowProtocol36RefusesDesign. render_file not decodable,
options not omitempty, Specialist.project omitempty ->
TestDesignRoundTrip.
- ValidOptions: option count, name validity, name once, case fold,
capture id shape, capture once, sha256, tree digest, captures total,
name length, double space, allowed runes, no apostrophe, both ends,
start only, end only, id pattern loosened, id unanchored ->
TestValidOptions.
- ValidRenderFile: task, step empty, step long, attempt, capture id,
sha256, size max, exact total, index low, index high, last share,
decoded length (removed; "at most"), strict base64 ->
TestValidRenderFile.
- ValidSpecialistBinding: id, revision, project, profile, capabilities
min, max, shape, once, no binding valid, a part only ->
TestValidSpecialistBinding.
- thin: protocol 0 untouched, 36 untouched, only project proposals ->
TestProjectProposalRefusedBelow36; bridge hook removed ->
TestBridgeRefusesProjectProposalOnAnOlderLink; link hook removed ->
TestProjectProposalUnencodableCallIsRetired; schema project removed
-> TestProposeSpecialistOffersProject.
- chat: project refusal removed, project not decoded ->
TestProposeSpecialistProject; Build note unbounded ->
TestExploreBuildNote; Build note required ->
TestExploreBuildThisOne.
- wire capture bound 1 MiB, page index capped at 5 ->
TestCapturesFitTheWire; openapi project removed ->
TestPersonAPIDeviceContract.
- First-round survivors (empty name, UTF-8, size < 1, encoded length
pre-check) were redundant with other guards: removed, documented;
size max, exact total and index bounds got isolating test cases.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
36 files changed,
+952
−29
.rastrillo/budgets.txt+4 −4docs/api/equipo-v1.openapi.json+4 −0internal/equipo/chat/explore.go+3 −1internal/equipo/chat/specialists.go+8 −0internal/equipo/chat/specialists_test.go+35 −0internal/runner/renderpage/wire_test.go+27 −0internal/runner/thin/bridge.go+3 −0internal/runner/thin/design_protocol.go+17 −0internal/runner/thin/design_protocol_test.go+118 −0internal/runner/thin/link.go+3 −0internal/runner/thin/mcp.go+1 −1internal/thintest/explore_contract_test.go+24 −0internal/wire/api.go+2 −1internal/wire/assistant_files_test.go+1 −1internal/wire/assistant_test.go+1 −1internal/wire/change_diffs_test.go+1 −1internal/wire/change_files_test.go+1 −1internal/wire/design.go+263 −0internal/wire/design_test.go+372 −0internal/wire/explore.go+1 −1internal/wire/frames.go+8 −1internal/wire/injection_test.go+2 −2internal/wire/mixed_protocol_test.go+1 −1internal/wire/models_test.go+1 −1internal/wire/opencode_test.go+1 −1internal/wire/pinned_release_test.go+1 −1internal/wire/places_test.go+1 −1internal/wire/publish_test.go+1 −1internal/wire/runners.go+24 −2internal/wire/runners_test.go+1 −1internal/wire/schedule_test.go+1 −1internal/wire/specialists.go+3 −1internal/wire/stuck_test.go+1 −1internal/wire/tasks.go+15 −0internal/wire/usage_test.go+1 −1internal/wire/warm_test.go+1 −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: image pulled in 9.6s
ci-box: claude: fetched and verified in 16.7s
ci-box: codex: fetched and verified in 4.6s
ci-box: codex-code-mode-host: fetched and verified in 1.4s
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: pi: installed and verified in 6.9s
ci-box: opencode: installed and verified in 2.3s
ci-box: chromium 156.0.8078.79-1~deb13u1: 76 packages fetched, verified and unpacked in 8.5s
ci-box: clone deepened in 4.8s
ci-box: file times set from content: 3371 files, 220 directories
ci-box: ready in 31.1s
=== 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 ./...
5.5s
+ go list -export -test -tags testbuild -f ./...
5.6s
+ go list -export -test -tags browser,testbuild -f ./internal/equipo ./internal/equipotest ./internal/headless ./internal/idtest ./internal/plan3test ./internal/thintest
3.6s
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 1m23.137s 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 1m20.676s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m20.68s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 75.27, cpu waiting 45.18%, memory waiting 0.00%, io waiting 0.44%
--- 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 1m22.512s 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 1m20.218s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m20.22s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 75.27, cpu waiting 45.18%, memory waiting 0.00%, io waiting 0.44%
--- 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 1m24.386s 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.088s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m11.66s amadan.net/oficina/equipo/internal/headless TestHeadlessConnections
receipt: slow test 5.56s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenPasteEndToEnd
receipt: slow test 4.87s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenConnection
machine: 32 CPUs, load 75.27, cpu waiting 45.08%, memory waiting 0.00%, io waiting 0.43%
--- 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
rastrillo: budget test: go test failed
--- FAIL amadan.net/oficina/equipo/internal/headless TestHeadless
=== RUN TestHeadless
--- FAIL: TestHeadless (57.11s)
--- FAIL amadan.net/oficina/equipo/internal/headless TestHeadless/1_first_token
=== RUN TestHeadless/1_first_token
time=2026-11-28T22:35:46.118Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-28T22:35:46.118Z level=INFO msg="startup phase done" phase=state_lock took=64µs
time=2026-11-28T22:35:46.118Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-28T22:35:46.118Z level=INFO msg="startup phase done" phase=claim_roots took=86µs
time=2026-11-28T22:35:46.118Z level=INFO msg="startup phase" phase=sweep
time=2026-11-28T22:35:46.165Z level=INFO msg="startup phase done" phase=sweep took=46.499ms
time=2026-11-28T22:35:46.165Z level=INFO msg="startup phase" phase=credentials
time=2026-11-28T22:35:46.165Z level=INFO msg="startup phase done" phase=credentials took=101µs
time=2026-11-28T22:35:46.165Z level=INFO msg="startup phase" phase=open_state
time=2026-11-28T22:35:46.216Z level=INFO msg="startup phase done" phase=open_state took=51.555ms
time=2026-11-28T22:35:46.217Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-28T22:35:46.218Z level=INFO msg=connecting host=127.0.0.1:38739 protocol=36
time=2026-11-28T22:35:46.221Z level=INFO msg=connected host=127.0.0.1:38739 took=3.047ms
time=2026-11-28T22:35:46.221Z level=INFO msg="capabilities gathering"
time=2026-11-28T22:35:46.223Z level=INFO msg="capabilities gathered" took=1.821ms tags=linux,claude,go
time=2026-11-28T22:35:46.223Z level=INFO msg="hello sent" protocol=36
time=2026-11-28T22:35:46.228Z level=INFO msg=welcome protocol=36 role=primary generation=1
time=2026-11-28T22:35:46.230Z level=WARN msg="ask probe" err=cancelled
time=2026-11-28T22:35:46.230Z level=WARN msg="step probe" err=cancelled
time=2026-11-28T22:35:46.231Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-28T22:35:46.231Z level=WARN msg="startup phase failed" phase=state_lock took=237µs err=provider_uncertain
env_test.go:297: runner exited: provider_uncertain
time=2026-11-28T22:35:46.233Z level=WARN msg=index repo=amadan.net/oficina/equipo err="signal: killed"
env_test.go:282: runner did not stop
--- FAIL: TestHeadless/1_first_token (45.57s)
--- FAIL amadan.net/oficina/equipo/internal/headless (package output)
FAIL
rastrillo-budget/v1 ran 1m55.159s
FAIL amadan.net/oficina/equipo/internal/headless 115.430s
receipt: test step 1m57.651s 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 1m55.159s amadan.net/oficina/equipo/internal/headless
receipt: slow test 57.11s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 40.04s amadan.net/oficina/equipo/internal/headless TestMacWorker
receipt: slow test 9.05s amadan.net/oficina/equipo/internal/headless TestHeadlessPrewarm
receipt: slow test 8.96s amadan.net/oficina/equipo/internal/headless TestHeadlessAttachments
exit status 1
+ go 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$' -v -run '^TestHeadless$/^1_first_token$' -count=1 ./internal/headless (retry, once)
##############################################################################
FLAKE ./internal/headless:TestHeadless/1_first_token headless-mac f4f8c8d455fca5d9214e0ee321238e9ef7343819 45.57s 56.12
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 53.79, cpu waiting 29.89%, memory waiting 0.00%, io waiting 0.22%
--- 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 1m38.89s 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 1m36.518s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m6.53s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 9.49s amadan.net/oficina/equipo/internal/headless TestHeadlessRunnerKillLeavesNoCopies
receipt: slow test 8.21s amadan.net/oficina/equipo/internal/headless TestHeadlessCopyRotation
receipt: slow test 7.37s amadan.net/oficina/equipo/internal/headless TestHeadlessPolicyGuards
receipt: slow test 4.91s amadan.net/oficina/equipo/internal/headless TestHeadlessNewHouseRuleStartsFresh
machine: 32 CPUs, load 69.47, cpu waiting 41.92%, memory waiting 0.00%, io waiting 0.34%
--- 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 3m1.958s 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 2m59.68s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m43.15s amadan.net/oficina/equipo/internal/headless TestHeadlessAssistant
receipt: slow test 20.29s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 9.22s amadan.net/oficina/equipo/internal/headless TestHeadlessResearchHandoff
receipt: slow test 7.03s amadan.net/oficina/equipo/internal/headless TestHeadlessAssistantAttachments
receipt: slow test 6.78s amadan.net/oficina/equipo/internal/headless TestHeadlessTurnBatching
machine: 32 CPUs, load 24.74, cpu waiting 11.18%, memory waiting 0.00%, io waiting 0.07%
--- 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 2m16.17s 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 2m13.714s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 10.02s amadan.net/oficina/equipo/internal/thintest TestContractTeamJobSettledStates
receipt: slow test 6.78s amadan.net/oficina/equipo/internal/thintest TestExplorePreviewsOff
receipt: slow test 4.04s amadan.net/oficina/equipo/internal/thintest TestContractTeamNudgePersonNeeds
receipt: slow test 3.94s amadan.net/oficina/equipo/internal/thintest TestContractPreviewHeldUntilPublishAnswer
receipt: slow test 2.83s amadan.net/oficina/equipo/internal/thintest TestContractTeamUpdatePersonNeeds
machine: 32 CPUs, load 44.25, cpu waiting 23.85%, memory waiting 0.00%, io waiting 0.17%
--- 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 1m59.422s 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 1m56.818s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 9.62s amadan.net/oficina/equipo/internal/thintest TestContractRetryPreviewUnverifiedMerge
receipt: slow test 9.15s amadan.net/oficina/equipo/internal/thintest TestContractPreviewNotScheduled
receipt: slow test 4.93s amadan.net/oficina/equipo/internal/thintest TestContractPublishNotOffered
receipt: slow test 4.58s amadan.net/oficina/equipo/internal/thintest TestContractMacRecheckMergeAuthority
receipt: slow test 2.99s amadan.net/oficina/equipo/internal/thintest TestContractPausedJob
machine: 32 CPUs, load 56.12, cpu waiting 31.43%, memory waiting 0.00%, io waiting 0.24%
--- 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 5m23.032s
FAIL amadan.net/oficina/equipo/internal/runner/thin 323.129s
receipt: test step 5m24.764s 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 5m23.032s amadan.net/oficina/equipo/internal/runner/thin
receipt: slow test 37.05s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeAnsweredByAnotherModel
receipt: slow test 36.96s amadan.net/oficina/equipo/internal/runner/thin TestModelsEngineeringProbesThenRunsTheStrongest
receipt: slow test 36.85s 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.06s 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 3.89, cpu waiting 1.01%, 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 50.566s 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 49.591s amadan.net/oficina/equipo/internal/runner
receipt: slow test 29.56s amadan.net/oficina/equipo/internal/runner TestDirectBugWorkflow
receipt: slow test 20.02s amadan.net/oficina/equipo/internal/runner TestEnrolKeepsTheRole
machine: 32 CPUs, load 52.02, cpu waiting 33.74%, memory waiting 0.00%, io waiting 0.76%
--- 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 1m4.337s 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 1m3.016s amadan.net/oficina/equipo/internal/runner
receipt: slow test 52.97s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowCandidateOrder
receipt: slow test 47.61s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowFeature
receipt: slow test 8.42s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryCallRefusalKeepsServing
receipt: slow test 1.6s amadan.net/oficina/equipo/internal/runner TestCoordinatorRefusalMatrix
machine: 32 CPUs, load 65.60, cpu waiting 41.86%, memory waiting 0.00%, io waiting 0.60%
--- 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 36.651s 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 35.691s amadan.net/oficina/equipo/internal/runner
receipt: slow test 5.12s amadan.net/oficina/equipo/internal/runner TestDirectFaultIsolation
receipt: slow test 3.28s amadan.net/oficina/equipo/internal/runner TestClaimRefusalsBackOff
receipt: slow test 3.24s amadan.net/oficina/equipo/internal/runner TestToolVerbUnderFakeHarness
receipt: slow test 3.12s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryRefusedKeepsServing
receipt: slow test 1.61s amadan.net/oficina/equipo/internal/runner TestReportPostsRetryExactRequest
machine: 32 CPUs, load 33.33, cpu waiting 22.19%, memory waiting 0.00%, io waiting 0.97%
--- 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 40.3%, load 25.08
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 1m9.911s 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 1m7.899s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 28.7s amadan.net/oficina/equipo/internal/equipotest TestAuthorityCoreIntegration
receipt: slow test 28.64s amadan.net/oficina/equipo/internal/equipotest TestBootstrapNamesOwnersSetting
receipt: slow test 26.38s amadan.net/oficina/equipo/internal/equipotest TestAccountLabelMigration
receipt: slow test 23.52s amadan.net/oficina/equipo/internal/equipotest TestBudgetConfigurationFailuresAreAtomic
receipt: slow test 23.35s amadan.net/oficina/equipo/internal/equipotest TestAccountConcurrentDuplicate
machine: 32 CPUs, load 66.55, cpu waiting 41.14%, memory waiting 0.00%, io waiting 0.32%
--- 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 40.3%, load 22.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 2m14.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 2m12.337s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 20.55s amadan.net/oficina/equipo/internal/equipotest TestProjectsFailuresRollBack
receipt: slow test 20.54s amadan.net/oficina/equipo/internal/equipotest TestProjectsReopen
receipt: slow test 20.53s amadan.net/oficina/equipo/internal/equipotest TestProjectWritesRequireCurrentOwner
receipt: slow test 20.49s amadan.net/oficina/equipo/internal/equipotest TestProjectKindsAndDefaultBranch
receipt: slow test 20.48s amadan.net/oficina/equipo/internal/equipotest TestProjectBindingUniqueness
machine: 32 CPUs, load 32.95, cpu waiting 15.09%, 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 40.3%, load 25.08
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.221s, over the 5m0s its record on line 15 allows; reported only, timing fails on CI
receipt: test step 5m40.966s 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.221s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 4m43.29s amadan.net/oficina/equipo/internal/equipotest TestReleaseStampContract
receipt: slow test 13.41s amadan.net/oficina/equipo/internal/equipotest TestRosterChangesAffectExistingSession
receipt: slow test 10.39s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalWhileAssigned
receipt: slow test 10.34s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalRollsBack
receipt: slow test 7.28s amadan.net/oficina/equipo/internal/equipotest TestRosterBootstrapOnce
machine: 32 CPUs, load 2.37, cpu waiting 0.46%, 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 40.3%, load 25.08
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 1m10.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 1m8.139s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 26.48s amadan.net/oficina/equipo/internal/equipotest TestSigninNoProof
receipt: slow test 26.03s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedExistingTeam
receipt: slow test 25.98s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedRollback
receipt: slow test 23.87s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedAuditRollback
receipt: slow test 23.75s amadan.net/oficina/equipo/internal/equipotest TestSpecialistSettingsConcurrentRevision
machine: 32 CPUs, load 66.55, cpu waiting 41.14%, memory waiting 0.00%, io waiting 0.32%
--- 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 40.3%, load 25.08
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
receipt: test step 56.853s 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 54.288s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 3.89s amadan.net/oficina/equipo/internal/plan3test TestPlan3Upgrade
receipt: slow test 3.53s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3B
receipt: slow test 1.78s amadan.net/oficina/equipo/internal/plan3test TestConversationQuestionRace
receipt: slow test 1.65s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3A
receipt: slow test 1.32s amadan.net/oficina/equipo/internal/plan3test TestPlanMigrationUpgrade
machine: 32 CPUs, load 72.12, cpu waiting 43.85%, memory waiting 0.00%, io waiting 0.40%
--- 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 40.3%, load 25.08
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/copydesk: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/forge: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/claude/realcli: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/webread: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runnerproto: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/workspace: 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.40s)
--- 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.40s)
--- FAIL amadan.net/oficina/equipo/internal/runner/pause TestPassForkAfterListing
=== RUN TestPassForkAfterListing
pause_linux_test.go:550: sandbox could not be paused in time
pause_linux_test.go:69: sandbox stderr:
--- FAIL: TestPassForkAfterListing (0.03s)
--- 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.34s)
--- FAIL amadan.net/oficina/equipo/internal/runner/pause (package output)
FAIL
FAIL amadan.net/oficina/equipo/internal/runner/pause 4.741s
--- FAIL amadan.net/oficina/equipo/internal/runner/provider/codex TestCodexAsyncQuestionAnswer
=== RUN TestCodexAsyncQuestionAnswer
--- FAIL: TestCodexAsyncQuestionAnswer (0.37s)
--- FAIL amadan.net/oficina/equipo/internal/runner/provider/codex TestCodexAsyncQuestionAnswer/schema
=== RUN TestCodexAsyncQuestionAnswer/schema
answers_test.go:103: answer not transmitted <nil>
--- FAIL: TestCodexAsyncQuestionAnswer/schema (0.24s)
--- FAIL amadan.net/oficina/equipo/internal/runner/provider/codex (package output)
FAIL
rastrillo-budget/v1 ran 23.456s
FAIL amadan.net/oficina/equipo/internal/runner/provider/codex 25.369s
--- 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.769s
FAIL amadan.net/oficina/equipo/internal/testci 1.779s
budget note: internal/equipo took 2m29.335s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/equipo/chat took 29.438s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/equipo/github took 40.581s, over the 10s the default allows (measured on the run this cached result came from); reported only, timing fails on CI
budget note: internal/equipo/setup took 12.29s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/idtest took 2m3.979s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/release took 47.284s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/runner/containment took 1m4.517s, over the 15s its record on line 40 allows; reported only, timing fails on CI
budget note: internal/runner/forge took 27.278s, over the 20s its record on line 35 allows; reported only, timing fails on CI
budget note: internal/runner/provider/claude/realcli took 15.602s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/runner/provider/pi took 1m22.37s, over the 1m0s its record on line 27 allows; reported only, timing fails on CI
budget note: internal/runner/render took 1m30.023s, over the 10s the default allows; reported only, timing fails on CI
receipt: test step 2m35.754s against a 60s target (the gate's other steps are not in this figure)
receipt: 42 packages ran, 27 cached, 17 without tests, 3 failed
receipt: slow package 2m29.335s amadan.net/oficina/equipo/internal/equipo
receipt: slow package 2m3.979s amadan.net/oficina/equipo/internal/idtest
receipt: slow package 1m30.023s amadan.net/oficina/equipo/internal/runner/render
receipt: slow package 1m22.37s amadan.net/oficina/equipo/internal/runner/provider/pi
receipt: slow package 1m8.818s amadan.net/oficina/equipo/internal/runner/provider/opencode
receipt: slow test 56.78s amadan.net/oficina/equipo/internal/idtest TestDoorRemembersOficinaID
receipt: slow test 50.32s amadan.net/oficina/equipo/internal/runner/render TestLaunchNeverClaimsAnUnprovenEnd
receipt: slow test 47.86s amadan.net/oficina/equipo/internal/idtest TestDoorOficinaSettingsUnreadableIsNoLoop
receipt: slow test 47.16s amadan.net/oficina/equipo/internal/idtest TestDoorStepUpIsLocal
receipt: slow test 46.67s 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$|^TestHoldStopsAReparentedDaemon$|^TestHoldStopsEveryWriter$|^TestPassForkAfterListing$' -count=1 ./internal/runner/pause (retry, once)
FAILED TWICE ./internal/runner/pause:TestHoldResumesAtTheBound rest
FAILED TWICE ./internal/runner/pause:TestHoldStopsAReparentedDaemon rest
FAILED TWICE ./internal/runner/pause:TestHoldStopsEveryWriter rest
FAILED TWICE ./internal/runner/pause:TestPassForkAfterListing rest
=== RUN TestHoldStopsEveryWriter
--- PASS: TestHoldStopsEveryWriter (0.32s)
=== RUN TestHoldResumesAtTheBound
--- PASS: TestHoldResumesAtTheBound (1.21s)
=== RUN TestPassForkAfterListing
--- PASS: TestPassForkAfterListing (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.163s
FAIL
+ go test -tags testbuild -timeout 15m -v -run '^TestCodexAsyncQuestionAnswer$/^schema$' -count=1 ./internal/runner/provider/codex (retry, once)
##############################################################################
FLAKE ./internal/runner/provider/codex:TestCodexAsyncQuestionAnswer/schema rest f4f8c8d455fca5d9214e0ee321238e9ef7343819 0.24s 23.00
##############################################################################
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 21.56, cpu waiting 9.47%, 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.697s 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.796s amadan.net/oficina/equipo/internal/headless
receipt: slow test 39.47s amadan.net/oficina/equipo/internal/headless TestBrowserDraftIsTheMessage
receipt: slow test 14.73s amadan.net/oficina/equipo/internal/headless TestBrowserDraftStreamsFormatted
receipt: slow test 10.57s amadan.net/oficina/equipo/internal/headless TestBrowserChat
receipt: slow test 7.5s amadan.net/oficina/equipo/internal/headless TestBrowserComposer
receipt: slow test 6.9s amadan.net/oficina/equipo/internal/headless TestBrowserChatSendStaysOnPage
machine: 32 CPUs, load 72.12, cpu waiting 43.85%, memory waiting 0.00%, io waiting 0.40%
--- 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 1m36.923s 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 1m34.976s amadan.net/oficina/equipo/internal/headless
receipt: slow test 30.58s amadan.net/oficina/equipo/internal/headless TestBrowserRailFollowsWork
receipt: slow test 22.94s amadan.net/oficina/equipo/internal/headless TestBrowserTaskThread
receipt: slow test 13.24s amadan.net/oficina/equipo/internal/headless TestBrowserReceiptFollowsReview
receipt: slow test 10.26s amadan.net/oficina/equipo/internal/headless TestBrowserTaskCard
receipt: slow test 9.29s amadan.net/oficina/equipo/internal/headless TestBrowserAskAfterMerge
machine: 32 CPUs, load 69.47, cpu waiting 41.92%, memory waiting 0.00%, io waiting 0.34%
--- 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 1m55.977s 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.179s amadan.net/oficina/equipo/internal/headless
receipt: slow test 14.95s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsConversation
receipt: slow test 13.39s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAddPage
receipt: slow test 12.98s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAdd
receipt: slow test 11.34s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsMeteredLimitRequired
receipt: slow test 11.26s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsSignInEmail
machine: 32 CPUs, load 56.12, cpu waiting 31.43%, memory waiting 0.00%, io waiting 0.24%
--- 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
--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserThinkingAndCards
=== RUN TestBrowserThinkingAndCards
time=2026-11-28T22:34:50.208Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-28T22:34:50.208Z level=INFO msg="startup phase done" phase=state_lock took=65µs
time=2026-11-28T22:34:50.208Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-28T22:34:50.208Z level=INFO msg="startup phase done" phase=claim_roots took=84µs
time=2026-11-28T22:34:50.208Z level=INFO msg="startup phase" phase=sweep
time=2026-11-28T22:34:50.246Z level=INFO msg="startup phase done" phase=sweep took=37.538ms
time=2026-11-28T22:34:50.246Z level=INFO msg="startup phase" phase=credentials
time=2026-11-28T22:34:50.246Z level=INFO msg="startup phase done" phase=credentials took=105µs
time=2026-11-28T22:34:50.246Z level=INFO msg="startup phase" phase=open_state
time=2026-11-28T22:34:50.288Z level=INFO msg="startup phase done" phase=open_state took=41.859ms
time=2026-11-28T22:34:50.288Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-28T22:34:50.290Z level=INFO msg=connecting host=127.0.0.1:41713 protocol=36
time=2026-11-28T22:34:50.291Z level=INFO msg=connected host=127.0.0.1:41713 took=1.072ms
time=2026-11-28T22:34:50.291Z level=INFO msg="capabilities gathering"
time=2026-11-28T22:34:50.291Z level=INFO msg="capabilities gathered" took=422µs tags=linux,claude,go
time=2026-11-28T22:34:50.292Z level=INFO msg="hello sent" protocol=36
time=2026-11-28T22:34:50.299Z level=INFO msg=welcome protocol=36 role=primary generation=1
time=2026-11-28T22:34:51.416Z level=INFO msg="connection checked" connection=claude-1 state=healthy
browser_cards_test.go:66: waiting for (()=>{const l=document.querySelector('[equipo-thinking] [equipo-activity]');return !!l && l.textContent==='Adding oficina/sample…'})(): context deadline exceeded (last evaluation: <nil>)
--- FAIL: TestBrowserThinkingAndCards (7.24s)
--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserCopyContinue
=== RUN TestBrowserCopyContinue
time=2026-11-28T22:35:24.860Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-28T22:35:24.860Z level=INFO msg="startup phase done" phase=state_lock took=152µs
time=2026-11-28T22:35:24.860Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-28T22:35:24.860Z level=INFO msg="startup phase done" phase=claim_roots took=127µs
time=2026-11-28T22:35:24.860Z level=INFO msg="startup phase" phase=sweep
time=2026-11-28T22:35:24.903Z level=INFO msg="startup phase done" phase=sweep took=42.88ms
time=2026-11-28T22:35:24.903Z level=INFO msg="startup phase" phase=credentials
time=2026-11-28T22:35:24.903Z level=INFO msg="startup phase done" phase=credentials took=162µs
time=2026-11-28T22:35:24.903Z level=INFO msg="startup phase" phase=open_state
time=2026-11-28T22:35:24.962Z level=INFO msg="startup phase done" phase=open_state took=58.248ms
time=2026-11-28T22:35:24.962Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-28T22:35:24.963Z level=INFO msg=connecting host=127.0.0.1:39893 protocol=36
time=2026-11-28T22:35:24.965Z level=INFO msg=connected host=127.0.0.1:39893 took=1.992ms
time=2026-11-28T22:35:24.965Z level=INFO msg="capabilities gathering"
time=2026-11-28T22:35:24.966Z level=INFO msg="capabilities gathered" took=614µs tags=linux,claude,go
time=2026-11-28T22:35:24.967Z level=INFO msg="hello sent" protocol=36
time=2026-11-28T22:35:24.975Z 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.52s)
--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserEmptyExplore
=== RUN TestBrowserEmptyExplore
time=2026-11-28T22:36:03.905Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-28T22:36:03.905Z level=INFO msg="startup phase done" phase=state_lock took=177µs
time=2026-11-28T22:36:03.905Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-28T22:36:03.905Z level=INFO msg="startup phase done" phase=claim_roots took=204µs
time=2026-11-28T22:36:03.905Z level=INFO msg="startup phase" phase=sweep
time=2026-11-28T22:36:03.946Z level=INFO msg="startup phase done" phase=sweep took=40.256ms
time=2026-11-28T22:36:03.946Z level=INFO msg="startup phase" phase=credentials
time=2026-11-28T22:36:03.946Z level=INFO msg="startup phase done" phase=credentials took=132µs
time=2026-11-28T22:36:03.946Z level=INFO msg="startup phase" phase=open_state
time=2026-11-28T22:36:03.989Z level=INFO msg="startup phase done" phase=open_state took=42.817ms
time=2026-11-28T22:36:03.990Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-28T22:36:03.990Z level=INFO msg=connecting host=127.0.0.1:38473 protocol=36
time=2026-11-28T22:36:03.993Z level=INFO msg=connected host=127.0.0.1:38473 took=1.976ms
time=2026-11-28T22:36:03.993Z level=INFO msg="capabilities gathering"
time=2026-11-28T22:36:03.993Z level=INFO msg="capabilities gathered" took=526µs tags=linux,claude,go
time=2026-11-28T22:36:03.997Z level=INFO msg="hello sent" protocol=36
time=2026-11-28T22:36:03.999Z level=INFO msg=welcome protocol=36 role=primary generation=1
time=2026-11-28T22:36:05.078Z level=INFO msg="connection checked" connection=claude-1 state=healthy
browser_receipts_test.go:169: waiting for [...document.querySelectorAll('[equipo-markdown]:not([data-stream-text])')].some(e=>e.textContent.includes("I'm your coordinator")): context deadline exceeded (last evaluation: context deadline exceeded)
--- FAIL: TestBrowserEmptyExplore (6.08s)
--- FAIL amadan.net/oficina/equipo/internal/headless (package output)
FAIL
rastrillo-budget/v1 ran 1m33.468s
FAIL amadan.net/oficina/equipo/internal/headless 93.716s
receipt: test step 1m35.375s 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 1m33.468s amadan.net/oficina/equipo/internal/headless
receipt: slow test 11.73s amadan.net/oficina/equipo/internal/headless TestBrowserStalePageReloads
receipt: slow test 10.66s amadan.net/oficina/equipo/internal/headless TestBrowserWaitingTurns
receipt: slow test 9.54s amadan.net/oficina/equipo/internal/headless TestBrowserMoveIn
receipt: slow test 7.54s amadan.net/oficina/equipo/internal/headless TestBrowserRefreshRace
receipt: slow test 7.47s amadan.net/oficina/equipo/internal/headless TestBrowserNotebookLook
rastrillo: budget test: go test failed
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$|^TestBrowserEmptyExplore$|^TestBrowserThinkingAndCards$' -count=1 ./internal/headless (retry, once)
##############################################################################
FLAKE ./internal/headless:TestBrowserCopyContinue browser-headless-rest f4f8c8d455fca5d9214e0ee321238e9ef7343819 6.52s 69.47
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
##############################################################################
FLAKE ./internal/headless:TestBrowserEmptyExplore browser-headless-rest f4f8c8d455fca5d9214e0ee321238e9ef7343819 6.08s 69.47
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
##############################################################################
FLAKE ./internal/headless:TestBrowserThinkingAndCards browser-headless-rest f4f8c8d455fca5d9214e0ee321238e9ef7343819 7.24s 69.47
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 53.79, cpu waiting 30.66%, memory waiting 0.00%, io waiting 0.23%
--- 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.284s 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.422s amadan.net/oficina/equipo/internal/equipo
receipt: slow test 1.82s amadan.net/oficina/equipo/internal/equipo TestBrowserPreviewPassExchange
receipt: slow test 610ms 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.024s 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.336s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 6.33s 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.004s, over the 10s the default allows; reported only, timing fails on CI
receipt: test step 12.551s 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.004s amadan.net/oficina/equipo/internal/idtest
receipt: slow test 8.73s amadan.net/oficina/equipo/internal/idtest TestBrowserSmartDoor
receipt: slow test 2.27s 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.063s 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.334s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 2.33s 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 3m38.44s 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 3m35.63s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 27.24s amadan.net/oficina/equipo/internal/thintest TestBrowserAccessRequest
receipt: slow test 14.4s amadan.net/oficina/equipo/internal/thintest TestBrowserSettingsTeams
receipt: slow test 12.09s amadan.net/oficina/equipo/internal/thintest TestBrowserThinkingCycles
receipt: slow test 10.64s amadan.net/oficina/equipo/internal/thintest TestBrowserPlacementQuestionAndPending
receipt: slow test 8.98s amadan.net/oficina/equipo/internal/thintest TestBrowserRhythm
machine: 32 CPUs, load 9.59, cpu waiting 3.72%, 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 (53s)
ok ./internal/headless TestHeadlessConnections/A5_cancel_and_sign_out 4.63s
ok ./internal/headless TestHeadlessConnections/C4_claude_sign_in 1.26s
ok ./internal/headless TestHeadlessConnections/C5_engineering_failover 8.75s
ok ./internal/headless TestHeadlessConnections/C5_engineering_to_codex 8.87s
ok ./internal/headless TestHeadlessConnections/C5_engineering_waits 27.45s
+ 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 (68s)
ok ./internal/headless TestHeadlessConnections/C5_review_auth 15.83s
ok ./internal/headless TestHeadlessConnections/C5_review_failover 14.02s
ok ./internal/headless TestHeadlessConnections/C5_review_on_codex 19.82s
ok ./internal/headless TestHeadlessConnections/C5_review_other_family_first 16.24s
+ go test -tags testbuild -timeout 15m -v -run '^TestMixedVersions$' ./internal/headless (21s)
ok ./internal/headless TestMixedVersions 18.66s
+ go test -tags testbuild -timeout 15m -v -run '^TestCheckSandboxDeniedPathsTampering$' ./internal/runner/checks (2s)
ok ./internal/runner/checks TestCheckSandboxDeniedPathsTampering 0.78s
+ 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 70.76, cpu waiting 43.64%, memory waiting 0.00%, io waiting 0.54%
--- 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 13.693s 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.767s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow package 232ms amadan.net/oficina/equipo/internal/runner/provider/claude
receipt: slow package 100ms amadan.net/oficina/equipo/internal/runner/provider/codex
receipt: slow package 1ms amadan.net/oficina/equipo/internal/runner/provider
receipt: slow package 1ms amadan.net/oficina/equipo/internal/runner/provider/opencode
receipt: slow test 5.51s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsGoFixture
receipt: slow test 1.78s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPaths
receipt: slow test 370ms amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsCache
receipt: slow test 230ms amadan.net/oficina/equipo/internal/runner/provider/claude TestDirectJournalAdapterBarrier
receipt: slow test 100ms amadan.net/oficina/equipo/internal/runner/provider/codex TestDirectJournalAdapterBarrier
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.146s 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.218s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow test 280ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceReadOnlyScratch
receipt: slow test 210ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryUnavailableProof
receipt: slow test 140ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceDirectPolicyAdmission
receipt: slow test 110ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceDirectPolicy
receipt: slow test 110ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryReusedPID
machine: 32 CPUs, load 13.31, cpu waiting 11.35%, memory waiting 0.00%, io waiting 1.31%
--- 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 40.4%, load 22.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: 3083 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
budget size: 98 directories within budget
CGO_ENABLED=0 go test ./internal/equipo -run '^TestMigrationModels$' -count=1
ok amadan.net/oficina/equipo/internal/equipo 2.562s
machine: 32 CPUs, load 75.27, cpu waiting 45.08%, memory waiting 0.00%, io waiting 0.43%
--- 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 40.3%, load 25.08
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 60.75, cpu waiting 39.19%, memory waiting 0.00%, io waiting 0.67%
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 40.3%, load 25.08
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 60.75, cpu waiting 36.62%, memory waiting 0.00%, io waiting 0.71%
--- 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 40.4%, load 22.57
shard 28: make gitleaks
[90m10:35PM[0m [32mINF[0m [1mUnknown SCM platform. Use --platform to include links in findings.[0m [36mhost=[0mamadan.net
[90m10:35PM[0m [32mINF[0m [1m1284 commits scanned.[0m
[90m10:35PM[0m [32mINF[0m [1mscanned ~69552599 bytes (69.55 MB) in 27.3s[0m
[90m10:35PM[0m [32mINF[0m [1mno leaks found[0m
machine: 32 CPUs, load 60.75, cpu waiting 37.88%, memory waiting 0.00%, io waiting 0.69%
amadan: job failed at step check shards 8, 17, 26 of 29 — its output is above, not at the tail of this log
diff --git a/.rastrillo/budgets.txt b/.rastrillo/budgets.txt| index 5ca637c3..2d7536d2 100644 |
| --- a/.rastrillo/budgets.txt |
| +++ b/.rastrillo/budgets.txt |
| @@ -15,7 +15,7 @@ time internal/equipo/team 60s Plan 3 loaded CI measured 45.985s; niced serial re |
| time internal/equipotest 300s Final fix package rerun measured 187.035s (review 172.4s); 300s gives 60 percent headroom for HTTP, sandbox, authority and final regression coverage. |
| size internal/equipo 23925 - Preview grants, retry/timeline, no-access merges, kept work, check-db copy, notification actions, places page and its superseded card, GitHub owner routes; measured 23925 source lines. |
| -size internal/wire 8171 - Protocol 31 facts, 32 unfinished work, task evidence, CI units, notification inputs, 33 Assistant files, 34 places, 35 diffs; measured 8171 source lines. |
| +size internal/wire 8481 - Protocol 31 facts, 32 unfinished work, task evidence, CI units, notification inputs, 33 Assistant files, 34 places, 35 diffs, 36 Design (binding, options, render_file); measured 8481 source lines. |
| size internal/equipotest - 12684 GitHub connect value search, lifecycle and sweep-log contracts; Task 21 migration fixtures, Rastrillo asset contract, renderer pin link; measured 0/12684 source/test lines. |
| time internal/runner/checks 90s CI worker measured 44.553s (44.6s rounded); |
| time internal/runner 330s Plan 3 CI repair measured 292.120s for the full package (controller CI 472.184s). |
| @@ -38,7 +38,7 @@ time internal/runner/provider 15s Plan 3 CI repair measured 10.346s for the full |
| perf GET /releases/* skip Verified runner release file downloads, not browser GET screens. |
| perf GET /install.sh skip Mac runners: the one-line bootstrap a terminal pipes to sh, not a browser screen. |
| time internal/runner/containment 15s Plan 3 loaded CI measured 10.817s; |
| -size internal/runner/thin 31047 26580 Protocol 31 facts, 35 diffs, merge credential, publication guards, kept work, CI units, 34 places publish, GitHub token scans, waiting cards in the Assistant opening, the page renderer health, the paused work snapshot and render_page's step (sites, counts); measured 31047/26580. |
| +size internal/runner/thin 31090 26744 Protocol 31 facts, 35 diffs, merge credential, publication guards, kept work, CI units, 34 places publish, GitHub token scans, waiting cards in the Assistant opening, the page renderer health, the paused work snapshot and render_page's step (sites, counts), 36 project proposals answered on older links; measured 31090/26744. |
| time internal/thintest 240s Thin contract and page tests, the Assistant's and the models' included, share one harness. Measured 202s on a shared 16 CPU box (2026-11-13); CI runs two lanes. |
| time internal/runner/mac 30s Mac runners (Darwin worker): real process groups killed after a grace and proven gone (SIGTERM, SIGKILL, the marker sweep), and the probes run end to end with fake srt and xcodebuild, P6 killing. |
| time internal/runner/thin 45s Thin v1 slice 4 review: real git repositories for the merge and squash checks, a stalled fetch, and a 16 MiB candidate streamed through the review diff and the checks pack (about 5s). |
| @@ -56,7 +56,7 @@ perf GET /api/v1/tasks/{id} skip Thin v1 person API: bearer-only JSON for device |
| perf GET /api/v1/assistant/snapshot skip Assistant person API: bearer-only JSON for Base's chat, not a browser screen. |
| perf GET /api/v1/assistant/messages skip Assistant person API: bearer-only JSON for Base's chat, not a browser screen. |
| perf GET /api/v1/assistant/events skip Assistant event stream (Server-Sent Events), bearer-only and long-lived; not a screen. |
| -size internal/equipo/chat 37977 11915 File facts/diffs, previews, merge authority, unfinished work, CI feedback, notification receipts, Assistant files, places and where their cards land, waiting cards; measured 37977/11915. |
| +size internal/equipo/chat 37987 11950 File facts/diffs, previews, merge authority, unfinished work, CI feedback, notification receipts, Assistant files, places and where their cards land, waiting cards, 36 proposal project and Build's note; measured 37987/11950. |
| perf GET /api/v1/questions/{id} skip Thin v1 person API: bearer-only JSON for devices; the browser reads questions on /tasks/{id}. |
| perf GET /api/v1/steps/{id}/log skip Thin v1 person API: bearer-only JSON for devices; the browser shows the log tail on /tasks/{id}. |
| perf GET /api/v1/connections/preference skip Connections slice 1 person API: bearer-only JSON for devices; the browser shows the preference on /conversation/connections. |
| @@ -71,7 +71,7 @@ perf GET /tasks/{id}/files/{file} skip Research kept images: the bytes of one im |
| perf GET /api/v1/runners skip Mac runners person API: bearer-only JSON for devices; the browser shows runners in the Team section. |
| time cmd/equipo-runner 60s TestReleaseRunnerHasNoFakeWorker builds the release runner and the thin package under testbuild (about 12s locally). |
| size internal/headless - 11873 Grant scenarios (#48); sign-in email at 1280 and 390; Assistant files end to end; the restart wait; the live site waits for a place; a card answer settles at the bottom; measured 11873 test lines. |
| -size internal/thintest - 36980 Protocol 31 contracts, 35 diffs, stuck tasks (the renderer health in status too), no-access merges, held retries, unfinished work, free rounds, previews, Assistant files, places and where their cards land; measured 36980 test lines. |
| +size internal/thintest - 37004 Protocol 31 contracts, 35 diffs, stuck tasks (the renderer health in status too), no-access merges, held retries, unfinished work, free rounds, previews, Assistant files, places and where their cards land, 36 Build's note; measured 37004 test lines. |
| perf GET /api/v1/projects/{id}/merge-policy skip Merge authority person API: bearer-only JSON for devices; the browser reads the policy on /projects/{id}. |
| perf GET /api/v1/usage skip Thin v1 person API: bearer-only JSON for devices; the browser reads usage through /usage. |
diff --git a/docs/api/equipo-v1.openapi.json b/docs/api/equipo-v1.openapi.json| index 49b1160e..cf9e4103 100644 |
| --- a/docs/api/equipo-v1.openapi.json |
| +++ b/docs/api/equipo-v1.openapi.json |
| @@ -22333,6 +22333,9 @@ |
| "profile": { |
| "type": "string" |
| }, |
| + "project": { |
| + "type": "string" |
| + }, |
| "name": { |
| "type": "string" |
| }, |
| @@ -22405,6 +22408,7 @@ |
| "id", |
| "revision", |
| "profile", |
| + "project", |
| "name", |
| "brief", |
| "model", |
diff --git a/internal/equipo/chat/explore.go b/internal/equipo/chat/explore.go| index 6a99c3dd..6286ab53 100644 |
| --- a/internal/equipo/chat/explore.go |
| +++ b/internal/equipo/chat/explore.go |
| @@ -201,7 +201,9 @@ func (t *txn) answerDirection(person string, c cardRecord, in wire.AnswerCard) ( |
| return wire.Card{}, wire.Card{}, ErrInvalid |
| } |
| note := "" |
| - if in.Choice == wire.ChoiceAgain { |
| + // Try again needs the person's note; Build this may carry one |
| + // (protocol 36: the option they want), bounded the same way. |
| + if in.Choice == wire.ChoiceAgain || in.Choice == wire.ChoiceBuild && in.Note != "" { |
| var ok bool |
| if note, ok = cleanText(in.Note, wire.MaxDirectionNote); !ok { |
| return wire.Card{}, wire.Card{}, ErrInvalid |
diff --git a/internal/equipo/chat/specialists.go b/internal/equipo/chat/specialists.go| index 2062bf7d..c233f77d 100644 |
| --- a/internal/equipo/chat/specialists.go |
| +++ b/internal/equipo/chat/specialists.go |
| @@ -106,6 +106,7 @@ const ( |
| toolSpecialistName = "Refused: name is 1 to 40 letters, digits, spaces, hyphens or apostrophes, starting with a letter or digit, and not a built-in specialist's name (Engineering, Review, Checks)." |
| toolSpecialistBrief = "Refused: brief is required, plain text, and at most 2,048 bytes." |
| toolSpecialistOutdated = "Equipo needs an update before it can research." |
| + toolSpecialistProject = "Refused: a specialist for one project is not available yet. Nothing was proposed." |
| ) |
| // toolProposeSpecialist runs propose_specialist for the person's turn |
| @@ -122,10 +123,17 @@ func (t *txn) toolProposeSpecialist(l Lease, r turnRecord, v *wire.ToolCall) (wi |
| Brief string `json:"brief"` |
| Capabilities []string `json:"capabilities"` |
| Tools []string `json:"tools"` |
| + // Project (protocol 36) is the scope: "" the team. One |
| + // project's scope is refused until scoped proposals land, never |
| + // read as the team's. |
| + Project string `json:"project"` |
| } |
| if wire.Strict(v.Args, &in) != nil { |
| return refused("invalid", toolBadInput), nil |
| } |
| + if in.Project != "" { |
| + return refused("project_unsupported", toolSpecialistProject), nil |
| + } |
| p, err := specialist.Validate(specialist.Proposal{Profile: in.Profile, Name: in.Name, Brief: in.Brief, Capabilities: in.Capabilities, Tools: in.Tools}) |
| switch { |
| case errors.Is(err, specialist.ErrUnknownProfile): |
diff --git a/internal/equipo/chat/specialists_test.go b/internal/equipo/chat/specialists_test.go| index 49038504..d2ae8164 100644 |
| --- a/internal/equipo/chat/specialists_test.go |
| +++ b/internal/equipo/chat/specialists_test.go |
| @@ -189,3 +189,38 @@ func TestProposeSpecialistNeedsAnOwner(t *testing.T) { |
| t.Fatalf("%d specialists", n) |
| } |
| } |
| + |
| +// TestProposeSpecialistProject: propose_specialist's project (protocol |
| +// 36) is part of its strict input. "" is the team, as before; one |
| +// project's id is refused until scoped proposals land, so a proposal |
| +// meant for one project never becomes the whole team's. A project that is |
| +// not a string is invalid input. |
| +func TestProposeSpecialistProject(t *testing.T) { |
| + r, _ := rosterRig(t) |
| + turn := turnRecord{ID: "t1", Person: hkMember, Kind: wire.TurnPerson} |
| + try := func(project string) wire.ToolResult { |
| + args := []byte(`{"profile":"research-v1","name":"Research","brief":"b","capabilities":["web.research"],"tools":["submit_findings","keep_image"],"project":` + project + `}`) |
| + call := &wire.ToolCall{CallID: "t1/1/u", TurnID: "t1", Attempt: 1, Name: wire.ToolProposeSpecialist, Args: args} |
| + var res wire.ToolResult |
| + r.must(r.tx(func(t *txn) error { |
| + var err error |
| + res, err = t.toolProposeSpecialist(Lease{Protocol: wire.ProtocolDesign}, turn, call) |
| + return err |
| + })) |
| + return res |
| + } |
| + count := func() int64 { |
| + var n int64 |
| + r.must(r.s.db.G.Model(&specialistRecord{}).Count(&n).Error) |
| + return n |
| + } |
| + if res := try(`"p_xyz567"`); !res.IsError || res.Code != "project_unsupported" || res.Text != toolSpecialistProject || count() != 0 { |
| + t.Fatalf("one project's proposal: %+v (%d rows)", res, count()) |
| + } |
| + if res := try(`1`); !res.IsError || res.Code != "invalid" || count() != 0 { |
| + t.Fatalf("a number for a project: %+v", res) |
| + } |
| + if res := try(`""`); res.IsError || res.Code != "proposed" || count() != 1 { |
| + t.Fatalf("the team's proposal: %+v", res) |
| + } |
| +} |
diff --git a/internal/runner/renderpage/wire_test.go b/internal/runner/renderpage/wire_test.go| new file mode 100644 |
| index 00000000..dbff4608 |
| --- /dev/null |
| +++ b/internal/runner/renderpage/wire_test.go |
| @@ -0,0 +1,27 @@ |
| +package renderpage |
| + |
| +import ( |
| + "fmt" |
| + "testing" |
| + |
| + "amadan.net/oficina/equipo/internal/runner/render" |
| + "amadan.net/oficina/equipo/internal/wire" |
| +) |
| + |
| +// TestCapturesFitTheWire: every capture a step can write has a name the |
| +// wire's capture id accepts and a size within its render_file bound, so a |
| +// Design step can name any of them in its options (protocol 36). |
| +func TestCapturesFitTheWire(t *testing.T) { |
| + if MaxCaptureBytes != wire.MaxCaptureBytes { |
| + t.Fatalf("capture bound %d, the wire's %d", MaxCaptureBytes, wire.MaxCaptureBytes) |
| + } |
| + for call := 1; call <= MaxCalls; call++ { |
| + for _, tree := range []string{TreeBase, TreeWork, "diff"} { |
| + for n := 1; n <= render.MaxPages; n++ { |
| + if id := fmt.Sprintf("%d-%s-%d.png", call, tree, n); !wire.ValidCaptureID(id) { |
| + t.Fatalf("the wire refuses %s", id) |
| + } |
| + } |
| + } |
| + } |
| +} |
diff --git a/internal/runner/thin/bridge.go b/internal/runner/thin/bridge.go| index a7ec6217..38d0908e 100644 |
| --- a/internal/runner/thin/bridge.go |
| +++ b/internal/runner/thin/bridge.go |
| @@ -759,6 +759,9 @@ func (b *bridge) roundTrip(ctx context.Context, call wire.ToolCall) wire.ToolRes |
| if res, no := placesRefused(call, b.spoken()); no { |
| return res |
| } |
| + if res, no := designRefused(call, b.spoken()); no { |
| + return res |
| + } |
| if res, refused := exploreRefused(call, b.spoken(), nil); refused { |
| // An instance below protocol 10 refuses it anyway (the kind is |
| // never dropped from an exploration); say why, here. |
diff --git a/internal/runner/thin/design_protocol.go b/internal/runner/thin/design_protocol.go| new file mode 100644 |
| index 00000000..342d9946 |
| --- /dev/null |
| +++ b/internal/runner/thin/design_protocol.go |
| @@ -0,0 +1,17 @@ |
| +package thin |
| + |
| +import "amadan.net/oficina/equipo/internal/wire" |
| + |
| +// toolProjectOld: the instance cannot take a proposal for one project yet |
| +// (below wire.ProtocolDesign). For the model; people never read it. |
| +const toolProjectOld = "Equipo needs an update before it can add a specialist for one project. Tell the person that in one line." |
| + |
| +// designRefused answers propose_specialist for one project here on a link |
| +// below protocol 36: Encode refuses the call, so it is never sent to an |
| +// older instance, which would read it as the whole team's. |
| +func designRefused(call wire.ToolCall, protocol int) (wire.ToolResult, bool) { |
| + if protocol == 0 || protocol >= wire.ProtocolDesign || !wire.ProjectProposal(&call) { |
| + return wire.ToolResult{}, false |
| + } |
| + return wire.ToolResult{CallID: call.CallID, IsError: true, Code: "project_unsupported", Text: toolProjectOld}, true |
| +} |
diff --git a/internal/runner/thin/design_protocol_test.go b/internal/runner/thin/design_protocol_test.go| new file mode 100644 |
| index 00000000..4723b4a3 |
| --- /dev/null |
| +++ b/internal/runner/thin/design_protocol_test.go |
| @@ -0,0 +1,118 @@ |
| +package thin |
| + |
| +import ( |
| + "context" |
| + "encoding/json" |
| + "testing" |
| + |
| + "amadan.net/oficina/equipo/internal/wire" |
| +) |
| + |
| +// TestProjectProposalRefusedBelow36: a propose_specialist call for one |
| +// project is answered here on a link below protocol 36, where Encode |
| +// would refuse it (an older instance has no scope); at 36, on an unknown |
| +// protocol, for the team ("" or no project) and for another tool it is |
| +// not touched. |
| +func TestProjectProposalRefusedBelow36(t *testing.T) { |
| + call := func(args string) wire.ToolCall { |
| + return wire.ToolCall{Name: wire.ToolProposeSpecialist, Args: json.RawMessage(args)} |
| + } |
| + scoped := call(`{"profile":"design-v1","project":"p_xyz567"}`) |
| + for name, c := range map[string]struct { |
| + call wire.ToolCall |
| + spoken int |
| + refused bool |
| + }{ |
| + "one project at 35": {scoped, wire.ProtocolChangeDiffs, true}, |
| + "one project at 13": {scoped, wire.ProtocolResearch, true}, |
| + "a null project at 35": {call(`{"project":null}`), wire.ProtocolChangeDiffs, true}, |
| + "one project at 36": {scoped, wire.ProtocolDesign, false}, |
| + "protocol unknown": {scoped, 0, false}, |
| + "the team at 35": {call(`{"profile":"research-v1","project":""}`), wire.ProtocolChangeDiffs, false}, |
| + "no project at 35": {call(`{"profile":"research-v1"}`), wire.ProtocolChangeDiffs, false}, |
| + "another tool at 35": {wire.ToolCall{Name: wire.ToolAskPerson, Args: json.RawMessage(`{"project":"p_1"}`)}, wire.ProtocolChangeDiffs, false}, |
| + } { |
| + res, refused := designRefused(c.call, c.spoken) |
| + if refused != c.refused || refused && (res.Code != "project_unsupported" || !res.IsError || res.Text != toolProjectOld) { |
| + t.Errorf("%s: %+v %t", name, res, refused) |
| + } |
| + } |
| +} |
| + |
| +// TestBridgeRefusesProjectProposalOnAnOlderLink: the bridge never sends a |
| +// proposal for one project on a link below 36; at 36 it goes to the |
| +// instance. |
| +func TestBridgeRefusesProjectProposalOnAnOlderLink(t *testing.T) { |
| + sent := 0 |
| + trip := func(context.Context, wire.ToolCall) wire.ToolResult { |
| + sent++ |
| + return wire.ToolResult{Code: "proposed", Text: "asked"} |
| + } |
| + call := wire.ToolCall{CallID: "t/1/u", TurnID: "t", Attempt: 1, Name: wire.ToolProposeSpecialist, Args: json.RawMessage(`{"profile":"design-v1","project":"p_xyz567"}`)} |
| + old := &bridge{speaks: wire.ProtocolChangeDiffs, trip: trip} |
| + if res := old.roundTrip(context.Background(), call); !res.IsError || res.Code != "project_unsupported" || sent != 0 { |
| + t.Fatalf("at 35: %+v, %d sent", res, sent) |
| + } |
| + current := &bridge{speaks: wire.ProtocolDesign, trip: trip} |
| + if res := current.roundTrip(context.Background(), call); res.IsError || sent != 1 { |
| + t.Fatalf("at 36: %+v, %d sent", res, sent) |
| + } |
| +} |
| + |
| +// TestProposeSpecialistOffersProject: the coordinator's propose_specialist |
| +// takes an optional project, a string. |
| +func TestProposeSpecialistOffersProject(t *testing.T) { |
| + for _, tool := range converseTools { |
| + m := tool.(map[string]any) |
| + if m["name"] != wire.ToolProposeSpecialist { |
| + continue |
| + } |
| + schema := m["inputSchema"].(map[string]any) |
| + if p, ok := schema["properties"].(map[string]any)["project"]; !ok || p.(map[string]string)["type"] != "string" { |
| + t.Fatalf("project: %v", schema["properties"]) |
| + } |
| + for _, r := range schema["required"].([]string) { |
| + if r == "project" { |
| + t.Fatal("project is required") |
| + } |
| + } |
| + return |
| + } |
| + t.Fatal("no propose_specialist") |
| +} |
| + |
| +// TestProjectProposalUnencodableCallIsRetired: a proposal for one project |
| +// queued for a link that turns out to speak 35 is answered at once and |
| +// leaves the outbox, so it never replays after an upgrade. |
| +func TestProjectProposalUnencodableCallIsRetired(t *testing.T) { |
| + ctx := context.Background() |
| + s, err := OpenState(ctx, t.TempDir()) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + defer s.Close() |
| + call := wire.ToolCall{CallID: "call", TurnID: "turn", Name: wire.ToolProposeSpecialist, Args: json.RawMessage(`{"profile":"design-v1","project":"p_xyz567"}`)} |
| + if err := s.SendToolCall(ctx, call); err != nil { |
| + t.Fatal(err) |
| + } |
| + frames, _, err := s.Unacked(ctx, 0) |
| + if err != nil || len(frames) != 1 { |
| + t.Fatal(err, frames) |
| + } |
| + l := &Link{State: s, proto: wire.ProtocolChangeDiffs} |
| + wait := l.waitTool(call.CallID) |
| + if err := l.send(ctx, nil, frames[0]); err != nil { |
| + t.Fatal(err) |
| + } |
| + select { |
| + case res := <-wait: |
| + if res.Code != "project_unsupported" { |
| + t.Fatal(res) |
| + } |
| + default: |
| + t.Fatal("no immediate unsupported result") |
| + } |
| + if frames, _, err = s.Unacked(ctx, 0); err != nil || len(frames) != 0 { |
| + t.Fatal("an old call can replay after an upgrade", frames, err) |
| + } |
| +} |
diff --git a/internal/runner/thin/link.go b/internal/runner/thin/link.go| index 5a2aab7b..635ef4e2 100644 |
| --- a/internal/runner/thin/link.go |
| +++ b/internal/runner/thin/link.go |
| @@ -492,6 +492,9 @@ func (l *Link) send(ctx context.Context, c *websocket.Conn, f wire.Frame) error |
| if !refused { |
| result, refused = placesRefused(*call, proto) |
| } |
| + if !refused { |
| + result, refused = designRefused(*call, proto) |
| + } |
| if refused { |
| if err := l.State.Acked(ctx, f.ID); err != nil { |
| return err |
diff --git a/internal/runner/thin/mcp.go b/internal/runner/thin/mcp.go| index aa4a2d9f..de687068 100644 |
| --- a/internal/runner/thin/mcp.go |
| +++ b/internal/runner/thin/mcp.go |
| @@ -203,7 +203,7 @@ var converseTools = []any{ |
| map[string]any{"name": "add_report", "description": "Add the person's new report of a problem that is already an open task (from record_task's similar list, or one you know) to that task, instead of recording a duplicate. text is what the person said. The person sees the task card.", "inputSchema": toolSchema(map[string]any{"task": str, "text": str}, "task", "text")}, |
| map[string]any{"name": "hold_merge", "description": "Stop Equipo merging this task on its own when you have a concrete reason it needs the person's look (reason: one plain sentence, shown on their merge card). It can only make Equipo more careful: the person's own Merge still merges. There is no tool to lift a hold.", "inputSchema": toolSchema(map[string]any{"task": str, "reason": str}, "task", "reason")}, |
| map[string]any{"name": "set_merge_policy", "description": "Record how Equipo merges a project, from what the person said (words: their sentence). mode is rules (merge on its own when every rule holds) or ask (ask before every merge); max_lines and max_files bound a merge without checks; main_ships is yes or no (does merging to main ship to users); add_sensitive adds path globs that always ask. A stricter change applies at once; a looser one waits for the person to tap Save on a card.", "inputSchema": toolSchema(map[string]any{"project": str, "words": str, "mode": str, "max_lines": map[string]any{"type": "integer"}, "max_files": map[string]any{"type": "integer"}, "main_ships": str, "add_sensitive": map[string]any{"type": "array", "items": str}}, "project", "words")}, |
| - map[string]any{"name": "propose_specialist", "description": "Ask the person to add a specialist to their team, from Equipo's fixed menu. Only when the person wants something researched on the public web. The one profile is research-v1: it reads public web pages Equipo fetches for a task and reports what they say; it never reaches repositories. Pass profile research-v1, a short name (for example Research), a brief of at most 2 KB on what it should look for, capabilities [\"web.research\"] and tools [\"submit_findings\", \"keep_image\"], exactly those. Nothing is added until an owner taps Add on the card it raises; do not ask again in your reply. If they tap Not now, propose it again only when they ask.", "inputSchema": toolSchema(map[string]any{"profile": map[string]any{"type": "string", "enum": []string{"research-v1"}}, "name": str, "brief": str, "capabilities": map[string]any{"type": "array", "items": str}, "tools": map[string]any{"type": "array", "items": str}}, "profile", "name", "brief", "capabilities", "tools")}, |
| + map[string]any{"name": "propose_specialist", "description": "Ask the person to add a specialist to their team, from Equipo's fixed menu. Only when the person wants something researched on the public web. The one profile is research-v1: it reads public web pages Equipo fetches for a task and reports what they say; it never reaches repositories. Pass profile research-v1, a short name (for example Research), a brief of at most 2 KB on what it should look for, capabilities [\"web.research\"] and tools [\"submit_findings\", \"keep_image\"], exactly those. Nothing is added until an owner taps Add on the card it raises; do not ask again in your reply. If they tap Not now, propose it again only when they ask.", "inputSchema": toolSchema(map[string]any{"profile": map[string]any{"type": "string", "enum": []string{"research-v1"}}, "name": str, "brief": str, "capabilities": map[string]any{"type": "array", "items": str}, "tools": map[string]any{"type": "array", "items": str}, "project": str}, "profile", "name", "brief", "capabilities", "tools")}, |
| map[string]any{"name": "research", "description": "Ask Research (once it is on the team; see propose_specialist) to read public web pages for one of the person's tasks. Use it when an exploration or change names an outside site, brand, API or docs, or the person asking (their business, their own site), and the work needs what those pages say. task is the task id; question (at most 1,000 bytes) is what to look for, for example colours, logo, fonts, opening hours and services; urls are pages you propose (https or http, no query string, a path of at most 100 characters, at most 10), or []. URLs and bare domains the person typed on the task are read without asking; your urls are shown to the person in full on a card and read only if they tap Allow, so propose only pages the task needs and never put anything from a repository in them. This only requests a run: Equipo starts it only at the task's start (call it before start_task) or after a review round, before Engineering's next round, and Engineering waits until Research ends. At most one run per start or round and 3 per task, and Equipo never retries a run for you. Research's findings reach Engineering and Review; do not wait for them in your reply.", "inputSchema": toolSchema(map[string]any{"task": str, "question": str, "urls": map[string]any{"type": "array", "items": str, "maxItems": 10}}, "task", "question", "urls")}, |
| map[string]any{"name": wire.ToolOfferRetry, "description": "When a task's merge failed and it waits at Ready to merge (read_task shows the failed merge step), put a card in front of the person asking whether to try the merge again. You cannot merge: only their tap merges, through Equipo's merge rules, and it is offered only when that tap could merge now. One card per task; do not ask again in your reply, and never say it is merged.", "inputSchema": toolSchema(map[string]any{"task": str}, "task")}, |
| map[string]any{"name": wire.ToolRetryStep, "description": "Run a task's preview, checks or review again, as the person's own Retry would (step: preview, checks or review). read_task's retry says for each whether it can run again now, and if not why, in a fixed reason; a refusal says it too. A failed step runs again as its next attempt. A preview also runs again when it ended unconfirmed or its link is gone, and on a done (merged) task as a new preview of the merged commit, the task staying done and merged. Only when another try could help: a preview that failed for its scanner (status runner.tools) needs the runner fixed first. Never a merge (use offer_retry: only the person's tap merges) and never Engineering's work. The task shows that you started it. Call it once per step.", "inputSchema": toolSchema(map[string]any{"task": str, "step": map[string]any{"type": "string", "enum": wire.RetryStepKinds}}, "task", "step")}, |
diff --git a/internal/thintest/explore_contract_test.go b/internal/thintest/explore_contract_test.go| index 03eeddb7..4eba740f 100644 |
| --- a/internal/thintest/explore_contract_test.go |
| +++ b/internal/thintest/explore_contract_test.go |
| @@ -186,6 +186,30 @@ func TestExploreBuildThisOne(t *testing.T) { |
| } |
| } |
| +// TestExploreBuildNote: Build this may carry the person's note (protocol |
| +// 36: the option they want), bounded as Try again's is: past |
| +// wire.MaxDirectionNote, with a NUL, or blank, it is refused and nothing |
| +// is built; within it, Build goes ahead. |
| +func TestExploreBuildNote(t *testing.T) { |
| + r := newToolRigAt(t, wire.ProtocolCurrent) |
| + id, card := r.toDirection("b", "Barber app mockups") |
| + for name, note := range map[string]string{"too long": strings.Repeat("a", wire.MaxDirectionNote+1), "a NUL": "The bold\x00 grid.", "blank": " "} { |
| + if _, err := r.client.AnswerNote(r.ctx, card.ID, wire.ChoiceBuild, note, card.Revision); Status(err) != 422 { |
| + t.Fatalf("a note %s: %v", name, err) |
| + } |
| + } |
| + if k := r.task(id); k.BuiltAs != nil || k.Stage == wire.StageDone { |
| + t.Fatalf("a refused note built %+v", k.BuiltAs) |
| + } |
| + if _, err := r.client.AnswerNote(r.ctx, card.ID, wire.ChoiceBuild, strings.Repeat("a", wire.MaxDirectionNote), card.Revision); err != nil { |
| + t.Fatal(err) |
| + } |
| + d := r.nextDispatch() |
| + if k := r.task(id); k.Stage != wire.StageDone || k.BuiltAs == nil || k.BuiltAs.ID != d.TaskID { |
| + t.Fatalf("Build with a note: %+v %+v", k.Stage, k.BuiltAs) |
| + } |
| +} |
| + |
| // TestExploreTryAgain: Try again needs the person's note and sends one |
| // more round with it (brief and resumed-session feedback); its new |
| // candidate is asked about afresh. |
diff --git a/internal/wire/api.go b/internal/wire/api.go| index 77c09cc8..80cdac7f 100644 |
| --- a/internal/wire/api.go |
| +++ b/internal/wire/api.go |
| @@ -411,7 +411,8 @@ type AnswerCard struct { |
| Choice string `json:"choice"` |
| Revision int64 `json:"revision"` |
| // Note is the person's words with an answer that takes them (a |
| - // direction card's Try again). |
| + // direction card's Try again, and its Build this naming the option |
| + // they want), at most MaxDirectionNote bytes. |
| Note string `json:"note,omitempty"` |
| } |
diff --git a/internal/wire/assistant_files_test.go b/internal/wire/assistant_files_test.go| index d16cd3fe..7acb8277 100644 |
| --- a/internal/wire/assistant_files_test.go |
| +++ b/internal/wire/assistant_files_test.go |
| @@ -16,7 +16,7 @@ import ( |
| // Assistant message with files is refused, earlier and earlier_more are |
| // dropped, and the Coordinator's and a job's frames go as they are. |
| func TestProtocol33AssistantFiles(t *testing.T) { |
| - if wire.Protocol33 != 33 || wire.ProtocolAssistantFiles != wire.Protocol33 || wire.ProtocolUnfinishedWork != wire.Protocol32 || wire.ProtocolCurrent != wire.ProtocolChangeDiffs || wire.Spoken(99) != 35 { |
| + if wire.Protocol33 != 33 || wire.ProtocolAssistantFiles != wire.Protocol33 || wire.ProtocolUnfinishedWork != wire.Protocol32 || wire.ProtocolCurrent != wire.ProtocolDesign || wire.Spoken(99) != 36 { |
| t.Fatalf("assistant files %d, current %d", wire.ProtocolAssistantFiles, wire.ProtocolCurrent) |
| } |
| if wire.RunnerKeepFiles != 14*24*time.Hour { |
diff --git a/internal/wire/assistant_test.go b/internal/wire/assistant_test.go| index 5835cc3c..ee3d73fd 100644 |
| --- a/internal/wire/assistant_test.go |
| +++ b/internal/wire/assistant_test.go |
| @@ -81,7 +81,7 @@ func TestAssistantCardJSON(t *testing.T) { |
| // A runner that speaks 24 or more is spoken to at 24, the warm |
| // protocol; glances came at 23 and jobs at 22. |
| func TestSpokenIs24(t *testing.T) { |
| - if wire.Spoken(99) != 35 || wire.ProtocolCurrent != wire.ProtocolChangeDiffs || wire.ProtocolWarm != wire.Protocol24 || wire.ProtocolGlance != wire.Protocol23 || wire.ProtocolJobs != wire.Protocol22 || wire.ProtocolCopy != wire.Protocol21 || wire.ProtocolUsageRefresh != wire.Protocol20 || wire.ProtocolAssistant != wire.Protocol19 { |
| + if wire.Spoken(99) != 36 || wire.ProtocolCurrent != wire.ProtocolDesign || wire.ProtocolWarm != wire.Protocol24 || wire.ProtocolGlance != wire.Protocol23 || wire.ProtocolJobs != wire.Protocol22 || wire.ProtocolCopy != wire.Protocol21 || wire.ProtocolUsageRefresh != wire.Protocol20 || wire.ProtocolAssistant != wire.Protocol19 { |
| t.Fatalf("spoken %d, current %d", wire.Spoken(99), wire.ProtocolCurrent) |
| } |
| } |
diff --git a/internal/wire/change_diffs_test.go b/internal/wire/change_diffs_test.go| index be98e166..953a57e7 100644 |
| --- a/internal/wire/change_diffs_test.go |
| +++ b/internal/wire/change_diffs_test.go |
| @@ -11,7 +11,7 @@ import ( |
| ) |
| func TestProtocol35ChangeDiffs(t *testing.T) { |
| - if wire.ProtocolChangeDiffs != 35 || wire.ProtocolCurrent != 35 { |
| + if wire.ProtocolChangeDiffs != 35 || wire.ProtocolCurrent != 36 { |
| t.Fatal("protocol") |
| } |
| f, err := wire.NewFrame("diff", wire.FrameChangeDiff, wire.ChangeDiffUpload{}) |
diff --git a/internal/wire/change_files_test.go b/internal/wire/change_files_test.go| index d4f39ae3..431d80e9 100644 |
| --- a/internal/wire/change_files_test.go |
| +++ b/internal/wire/change_files_test.go |
| @@ -11,7 +11,7 @@ import ( |
| ) |
| func TestProtocol31ChangeFiles(t *testing.T) { |
| - if wire.ProtocolChangeFiles != 31 || wire.ProtocolCurrent != 35 { |
| + if wire.ProtocolChangeFiles != 31 || wire.ProtocolCurrent != 36 { |
| t.Fatal("protocol not 31") |
| } |
| facts := &wire.ChangeFiles{Base: strings.Repeat("a", 40), SHA: strings.Repeat("b", 40), Files: 1, Additions: 1, Entries: []wire.ChangedFile{{Path: "a.txt", Status: "added", Additions: 1}}} |
diff --git a/internal/wire/design.go b/internal/wire/design.go| new file mode 100644 |
| index 00000000..e8073a45 |
| --- /dev/null |
| +++ b/internal/wire/design.go |
| @@ -0,0 +1,263 @@ |
| +package wire |
| + |
| +import ( |
| + "encoding/base64" |
| + "encoding/json" |
| + "fmt" |
| + "regexp" |
| + "strings" |
| + "unicode" |
| + "unicode/utf8" |
| +) |
| + |
| +// The Design specialist's wire (spec 2026-11-28-dynamic-specialists.md, |
| +// sections 1 and 3; ProtocolDesign): a maker step's specialist binding on |
| +// its dispatch, the page_render lease check, the captures a Design step |
| +// names in its report's options, and the render_file chunks that carry |
| +// them. Both ends validate with the functions here. |
| + |
| +// Bounds of a Design report and its captures. |
| +const ( |
| + // MaxDesignOptions and MaxDesignCaptures bound a report's options and |
| + // the captures named across all of them. |
| + MaxDesignOptions = 4 |
| + MaxDesignCaptures = 12 |
| + // MaxOptionName bounds an option's name, in bytes. |
| + MaxOptionName = 60 |
| + // MaxCaptureBytes is the most one capture holds (spec: re-encoded |
| + // to at most 2 MB); render_page writes none larger. |
| + MaxCaptureBytes = 2 << 20 |
| + // RenderFileChunk is one render_file frame's share of a capture, as |
| + // research_file's; MaxRenderFileChunks the most a capture needs. |
| + RenderFileChunk = ResearchFileChunk |
| + MaxRenderFileChunks = (MaxCaptureBytes + RenderFileChunk - 1) / RenderFileChunk |
| + // MaxBindingCapabilities bounds a binding's capabilities. |
| + MaxBindingCapabilities = 8 |
| +) |
| + |
| +// DesignOption is one mockup option of a Design step's candidate: the |
| +// name the person will use for it and the captures that show it. |
| +type DesignOption struct { |
| + Name string `json:"name"` |
| + Captures []DesignCapture `json:"captures"` |
| +} |
| + |
| +// DesignCapture is one capture an option names: its render_page file id |
| +// (the name under /render/), the SHA-256 of its PNG and the digest of the |
| +// exported tree it was rendered from (a diff carries work's). |
| +type DesignCapture struct { |
| + ID string `json:"id"` |
| + SHA256 string `json:"sha256"` |
| + TreeDigest string `json:"tree_digest"` |
| +} |
| + |
| +// RenderFile is one chunk of a named capture, runner to instance, sent |
| +// before the step's final report. Index counts from 0 to Total-1; SHA256 |
| +// and Size are the whole file's. |
| +type RenderFile struct { |
| + TaskID string `json:"task_id"` |
| + StepID string `json:"step_id"` |
| + Attempt int64 `json:"attempt"` |
| + CaptureID string `json:"capture_id"` |
| + Index int `json:"index"` |
| + Total int `json:"total"` |
| + Size int64 `json:"size"` |
| + SHA256 string `json:"sha256"` |
| + Data string `json:"data"` |
| +} |
| + |
| +var ( |
| + // captureID is render_page's file name: <call>-<tree>-<n>.png, call |
| + // and n from 1 with no leading zero (renderpage.Tool). |
| + captureID = regexp.MustCompile(`^([1-9][0-9]?)-(base|work|diff)-([1-9][0-9]?)\.png$`) |
| + // The instance's ids (newID): sp_ and p_ then lower-case base32. |
| + specialistID = regexp.MustCompile(`^sp_[a-z0-9]{1,40}$`) |
| + projectID = regexp.MustCompile(`^p_[a-z0-9]{1,40}$`) |
| + // A menu profile id (research-v1, design-review-v1) and capability |
| + // id (web.research, page.render). |
| + profileID = regexp.MustCompile(`^[a-z][a-z0-9]*(-[a-z0-9]+)*-v[1-9][0-9]{0,2}$`) |
| + capabilityID = regexp.MustCompile(`^[a-z]+(\.[a-z]+)+$`) |
| +) |
| + |
| +// ValidCaptureID is a render_page capture's file id. |
| +func ValidCaptureID(id string) bool { return captureID.MatchString(id) } |
| + |
| +// ValidOptions strictly bounds a Design report's options: at most |
| +// MaxDesignOptions, at most MaxDesignCaptures captures across them, each |
| +// option's name a plain label (validOptionName) said once (case folded), |
| +// each capture's id a capture id named once across all options, its |
| +// SHA-256 and tree digest lower-case hex SHA-256. An option may name no |
| +// capture; no options at all is valid. Whether the captures were staged |
| +// is the receiver's check. |
| +func ValidOptions(opts []DesignOption) error { |
| + if len(opts) > MaxDesignOptions { |
| + return fmt.Errorf("%w: %d options", ErrStrict, len(opts)) |
| + } |
| + names, ids := map[string]bool{}, map[string]bool{} |
| + for _, o := range opts { |
| + folded := strings.ToLower(o.Name) |
| + if !validOptionName(o.Name) || names[folded] { |
| + return fmt.Errorf("%w: option name %q", ErrStrict, o.Name) |
| + } |
| + names[folded] = true |
| + for _, c := range o.Captures { |
| + if !ValidCaptureID(c.ID) || ids[c.ID] || !ValidSHA256(c.SHA256) || !ValidSHA256(c.TreeDigest) { |
| + return fmt.Errorf("%w: capture %q", ErrStrict, c.ID) |
| + } |
| + ids[c.ID] = true |
| + } |
| + } |
| + if len(ids) > MaxDesignCaptures { |
| + return fmt.Errorf("%w: %d captures", ErrStrict, len(ids)) |
| + } |
| + return nil |
| +} |
| + |
| +// validOptionName: at most MaxOptionName bytes; letters, digits, spaces, |
| +// hyphens and apostrophes only (so valid UTF-8: a bad byte reads as |
| +// U+FFFD, not a letter); never two spaces together; starting and ending |
| +// with a letter or digit (so never empty). Nothing that reads as markup, |
| +// a path, a control or a format character. |
| +func validOptionName(s string) bool { |
| + if len(s) > MaxOptionName || strings.Contains(s, " ") { |
| + return false |
| + } |
| + for _, r := range s { |
| + if !word(r) && r != ' ' && r != '-' && r != '\'' { |
| + return false |
| + } |
| + } |
| + first, _ := utf8.DecodeRuneInString(s) |
| + last, _ := utf8.DecodeLastRuneInString(s) |
| + return word(first) && word(last) |
| +} |
| + |
| +func word(r rune) bool { return unicode.IsLetter(r) || unicode.IsDigit(r) } |
| + |
| +// ValidRenderFile bounds one render_file chunk: its task, step (at most |
| +// 128 bytes each) and attempt; a capture id; a whole file of at most |
| +// MaxCaptureBytes in exactly the chunks its size needs (so at least one |
| +// byte: an empty file has no chunk to be); and this chunk's data, strict |
| +// padded base64, exactly its share of the file. |
| +func ValidRenderFile(v RenderFile) bool { |
| + if v.TaskID == "" || len(v.TaskID) > 128 || v.StepID == "" || len(v.StepID) > 128 || v.Attempt < 1 || !ValidCaptureID(v.CaptureID) || !ValidSHA256(v.SHA256) { |
| + return false |
| + } |
| + if v.Size > MaxCaptureBytes || int64(v.Total) != (v.Size+RenderFileChunk-1)/RenderFileChunk || v.Index < 0 || v.Index >= v.Total { |
| + return false |
| + } |
| + share := int64(RenderFileChunk) |
| + if v.Index == v.Total-1 { |
| + share = v.Size - int64(v.Total-1)*RenderFileChunk |
| + } |
| + data, err := base64.StdEncoding.Strict().DecodeString(v.Data) |
| + return err == nil && int64(len(data)) == share |
| +} |
| + |
| +// ValidSpecialistBinding: a dispatch carries no specialist binding at all |
| +// (Engineering itself, and every other step), or a whole one: a |
| +// specialist id of the instance's shape, a revision from 1, a project id |
| +// or "" for the team, a profile id of the menu's shape and 1 to |
| +// MaxBindingCapabilities distinct capability ids. Whether the binding |
| +// is still granted is the instance's check. |
| +func ValidSpecialistBinding(d *DispatchCommand) bool { |
| + if !hasBinding(d) { |
| + return true |
| + } |
| + if !specialistID.MatchString(d.SpecialistID) || d.SpecialistRevision < 1 || d.SpecialistProject != "" && !projectID.MatchString(d.SpecialistProject) || len(d.Profile) > 40 || !profileID.MatchString(d.Profile) { |
| + return false |
| + } |
| + if len(d.Capabilities) < 1 || len(d.Capabilities) > MaxBindingCapabilities { |
| + return false |
| + } |
| + seen := map[string]bool{} |
| + for _, c := range d.Capabilities { |
| + if len(c) > 40 || !capabilityID.MatchString(c) || seen[c] { |
| + return false |
| + } |
| + seen[c] = true |
| + } |
| + return true |
| +} |
| + |
| +// hasBinding: any part of a specialist binding is set. |
| +func hasBinding(d *DispatchCommand) bool { |
| + return d.SpecialistID != "" || d.SpecialistRevision != 0 || d.SpecialistProject != "" || d.Profile != "" || len(d.Capabilities) > 0 |
| +} |
| + |
| +// downgradeDesign makes a frame speak a protocol below ProtocolDesign. A |
| +// dispatch with any part of a specialist binding is refused: an older |
| +// runner would run the step as plain Engineering, outside its grant. So |
| +// are a page_render check (an older instance would ack it as a start |
| +// authorization, without the grant check), a render_file chunk, and a |
| +// propose_specialist call for one project (an older instance has no |
| +// scope, so it would propose for the whole team); a proposal's empty |
| +// project, the team's, is dropped. A report's options are dropped. It |
| +// reports whether anything changed. |
| +func downgradeDesign(body any, protocol int) (bool, error) { |
| + switch v := body.(type) { |
| + case *DispatchCommand: |
| + if hasBinding(v) { |
| + return false, fmt.Errorf("%w: a specialist's dispatch at protocol %d", ErrProtocol, protocol) |
| + } |
| + case *LeaseCheck: |
| + if v.Purpose == LeasePurposeRender { |
| + return false, fmt.Errorf("%w: a render check at protocol %d", ErrProtocol, protocol) |
| + } |
| + case *RenderFile: |
| + return false, fmt.Errorf("%w: render_file at protocol %d", ErrProtocol, protocol) |
| + case *StepReport: |
| + if v.Options != nil { |
| + v.Options = nil |
| + return true, nil |
| + } |
| + case *ToolCall: |
| + return withoutTeamProject(v, protocol) |
| + } |
| + return false, nil |
| +} |
| + |
| +// ProjectProposal reports whether a call is propose_specialist for one |
| +// project: its project is anything but "" (the team's) or absent. The |
| +// runner answers such a call itself below ProtocolDesign. |
| +func ProjectProposal(v *ToolCall) bool { |
| + project, ok := proposalProject(v) |
| + return ok && string(project) != `""` |
| +} |
| + |
| +// proposalProject is a propose_specialist call's project as sent, and |
| +// whether it has one. |
| +func proposalProject(v *ToolCall) (json.RawMessage, bool) { |
| + if v.Name != ToolProposeSpecialist { |
| + return nil, false |
| + } |
| + var args map[string]json.RawMessage |
| + if json.Unmarshal(v.Args, &args) != nil { |
| + return nil, false |
| + } |
| + project, ok := args["project"] |
| + return project, ok |
| +} |
| + |
| +// withoutTeamProject drops propose_specialist's project when it is "" |
| +// (the team's, all an older instance knows) and refuses the call when it |
| +// names anything else. |
| +func withoutTeamProject(v *ToolCall, protocol int) (bool, error) { |
| + if _, ok := proposalProject(v); !ok { |
| + return false, nil |
| + } |
| + if ProjectProposal(v) { |
| + return false, fmt.Errorf("%w: a proposal for one project at protocol %d", ErrProtocol, protocol) |
| + } |
| + var args map[string]json.RawMessage |
| + if err := json.Unmarshal(v.Args, &args); err != nil { |
| + return false, err |
| + } |
| + delete(args, "project") |
| + raw, err := json.Marshal(args) |
| + if err != nil { |
| + return false, err |
| + } |
| + v.Args = raw |
| + return true, nil |
| +} |
diff --git a/internal/wire/design_test.go b/internal/wire/design_test.go| new file mode 100644 |
| index 00000000..06b31462 |
| --- /dev/null |
| +++ b/internal/wire/design_test.go |
| @@ -0,0 +1,372 @@ |
| +package wire_test |
| + |
| +import ( |
| + "bytes" |
| + "encoding/base64" |
| + "encoding/json" |
| + "errors" |
| + "fmt" |
| + "strings" |
| + "testing" |
| + |
| + "amadan.net/oficina/equipo/internal/wire" |
| +) |
| + |
| +// designDispatch is a Design step's dispatch as the instance sends it at |
| +// protocol 36: Engineering's step kind with the specialist's binding. |
| +func designDispatch() wire.DispatchCommand { |
| + return wire.DispatchCommand{Person: "owner@example.com", TaskID: "tk1", StepID: "s_1", Attempt: 1, Specialist: wire.SpecialistEngineering, Repo: "amadan.net/oficina/sample", Branch: "equipo/tk1-x", Findings: []wire.Finding{}, |
| + SpecialistID: "sp_abc234", SpecialistRevision: 2, SpecialistProject: "p_xyz567", Profile: "design-v1", Capabilities: []string{"branch.edit", "page.render"}} |
| +} |
| + |
| +func sum(c byte) string { return strings.Repeat(string(c), 64) } |
| + |
| +func designOptions() []wire.DesignOption { |
| + return []wire.DesignOption{ |
| + {Name: "Quiet editorial", Captures: []wire.DesignCapture{{ID: "1-work-1.png", SHA256: sum('a'), TreeDigest: sum('b')}, {ID: "1-work-2.png", SHA256: sum('c'), TreeDigest: sum('b')}}}, |
| + {Name: "Bold grid", Captures: []wire.DesignCapture{{ID: "2-work-1.png", SHA256: sum('d'), TreeDigest: sum('e')}, {ID: "2-diff-1.png", SHA256: sum('f'), TreeDigest: sum('e')}, {ID: "2-base-1.png", SHA256: sum('0'), TreeDigest: sum('1')}}}, |
| + } |
| +} |
| + |
| +func renderFile() wire.RenderFile { |
| + return wire.RenderFile{TaskID: "tk1", StepID: "s_1", Attempt: 1, CaptureID: "1-work-1.png", Index: 0, Total: 1, Size: 3, SHA256: sum('a'), Data: "YWJj"} |
| +} |
| + |
| +// TestProtocol36Design: protocol 36 is the Design specialist's and the |
| +// current one. |
| +func TestProtocol36Design(t *testing.T) { |
| + if wire.Protocol36 != 36 || wire.ProtocolDesign != wire.Protocol36 || wire.ProtocolCurrent != wire.ProtocolDesign || wire.Spoken(99) != 36 || wire.ProtocolChangeDiffs != 35 { |
| + t.Fatalf("design %d, current %d, spoken %d", wire.ProtocolDesign, wire.ProtocolCurrent, wire.Spoken(99)) |
| + } |
| +} |
| + |
| +// TestEncodeBelowProtocol36RefusesDesign: at 36 a bound dispatch, a |
| +// render lease check, a render_file chunk, a report's options and a |
| +// project-scoped proposal go out whole. Below it a dispatch carrying any |
| +// part of a specialist binding, a render check, a render_file chunk and |
| +// a proposal for one project are refused (an older runner would run a |
| +// Design step as plain Engineering, an older instance would grant a |
| +// render as a start, or a proposal for the whole team); a report loses |
| +// its options, and a proposal for the whole team its empty project. |
| +func TestEncodeBelowProtocol36RefusesDesign(t *testing.T) { |
| + dispatch, _ := wire.NewFrame("d", wire.FrameDispatch, designDispatch()) |
| + lease, _ := wire.NewFrame("l", wire.FrameLease, wire.LeaseCheck{Generation: 1, StepID: "s_1", Attempt: 1, Purpose: wire.LeasePurposeRender}) |
| + chunk, _ := wire.NewFrame("f", wire.FrameRenderFile, renderFile()) |
| + report, _ := wire.NewFrame("r", wire.FrameStep, wire.StepReport{TaskID: "tk1", StepID: "s_1", Attempt: 1, State: wire.StepDone, Findings: []wire.Finding{}, Options: designOptions()}) |
| + scoped, _ := wire.NewFrame("t", wire.FrameToolCall, wire.ToolCall{TurnID: "t", CallID: "c", Name: wire.ToolProposeSpecialist, Args: []byte(`{"profile":"design-v1","name":"Design","brief":"b","capabilities":[],"tools":[],"project":"p_xyz567"}`)}) |
| + team, _ := wire.NewFrame("t", wire.FrameToolCall, wire.ToolCall{TurnID: "t", CallID: "c", Name: wire.ToolProposeSpecialist, Args: []byte(`{"profile":"research-v1","name":"Research","brief":"b","capabilities":[],"tools":[],"project":""}`)}) |
| + for _, f := range []wire.Frame{dispatch, lease, chunk, report, scoped, team} { |
| + if same, err := wire.Encode(f, wire.ProtocolDesign); err != nil || !bytes.Equal(same.Data, f.Data) { |
| + t.Fatalf("%s changed at 36: %v", f.Type, err) |
| + } |
| + } |
| + if !chunk.Durable() { |
| + t.Fatal("render_file is not durable") |
| + } |
| + for _, f := range []wire.Frame{dispatch, lease, chunk, scoped} { |
| + for _, p := range []int{wire.ProtocolChangeDiffs, wire.ProtocolPlaces, wire.ProtocolResearch, wire.Protocol2} { |
| + if _, err := wire.Encode(f, p); !errors.Is(err, wire.ErrProtocol) { |
| + t.Fatalf("%s %s encoded at %d: %v", f.Type, f.Data, p, err) |
| + } |
| + } |
| + } |
| + // Each part of the binding alone makes it a Design dispatch. |
| + for name, mutate := range map[string]func(*wire.DispatchCommand){ |
| + "id": func(d *wire.DispatchCommand) { |
| + *d = wire.DispatchCommand{Specialist: d.Specialist, SpecialistID: "sp_abc234"} |
| + }, |
| + "revision": func(d *wire.DispatchCommand) { |
| + *d = wire.DispatchCommand{Specialist: d.Specialist, SpecialistRevision: 1} |
| + }, |
| + "project": func(d *wire.DispatchCommand) { |
| + *d = wire.DispatchCommand{Specialist: d.Specialist, SpecialistProject: "p_1"} |
| + }, |
| + "profile": func(d *wire.DispatchCommand) { |
| + *d = wire.DispatchCommand{Specialist: d.Specialist, Profile: "design-v1"} |
| + }, |
| + "capabilities": func(d *wire.DispatchCommand) { |
| + *d = wire.DispatchCommand{Specialist: d.Specialist, Capabilities: []string{"page.render"}} |
| + }, |
| + } { |
| + d := designDispatch() |
| + mutate(&d) |
| + f, _ := wire.NewFrame("d", wire.FrameDispatch, d) |
| + if _, err := wire.Encode(f, wire.ProtocolChangeDiffs); !errors.Is(err, wire.ErrProtocol) { |
| + t.Fatalf("a dispatch with only its %s at 35: %v", name, err) |
| + } |
| + } |
| + // Another lease purpose, and a dispatch without a binding, are as before. |
| + plainLease, _ := wire.NewFrame("l", wire.FrameLease, wire.LeaseCheck{Generation: 1, StepID: "s_1", Attempt: 1}) |
| + eng := designDispatch() |
| + eng.SpecialistID, eng.SpecialistRevision, eng.SpecialistProject, eng.Profile, eng.Capabilities = "", 0, "", "", nil |
| + plain, _ := wire.NewFrame("e", wire.FrameDispatch, eng) |
| + for _, f := range []wire.Frame{plainLease, plain} { |
| + if same, err := wire.Encode(f, wire.ProtocolChangeDiffs); err != nil || !bytes.Equal(same.Data, f.Data) { |
| + t.Fatalf("%s changed at 35: %s %v", f.Type, same.Data, err) |
| + } |
| + } |
| + got, err := wire.Encode(report, wire.ProtocolChangeDiffs) |
| + if err != nil || strings.Contains(string(got.Data), `"options"`) || !strings.Contains(string(got.Data), `"state":"done"`) { |
| + t.Fatalf("a report with options at 35: %s %v", got.Data, err) |
| + } |
| + got, err = wire.Encode(team, wire.ProtocolChangeDiffs) |
| + if err != nil || strings.Contains(string(got.Data), `project`) || !strings.Contains(string(got.Data), `research-v1`) { |
| + t.Fatalf("a team proposal at 35: %s %v", got.Data, err) |
| + } |
| + // A proposal without the key is untouched. |
| + bare, _ := wire.NewFrame("t", wire.FrameToolCall, wire.ToolCall{TurnID: "t", CallID: "c", Name: wire.ToolProposeSpecialist, Args: []byte(`{"profile":"research-v1","name":"Research","brief":"b","capabilities":[],"tools":[]}`)}) |
| + if same, err := wire.Encode(bare, wire.ProtocolChangeDiffs); err != nil || !bytes.Equal(same.Data, bare.Data) { |
| + t.Fatalf("a proposal without project changed at 35: %v", err) |
| + } |
| + // A project that is not a string is not read as the team's. |
| + odd, _ := wire.NewFrame("t", wire.FrameToolCall, wire.ToolCall{TurnID: "t", CallID: "c", Name: wire.ToolProposeSpecialist, Args: []byte(`{"profile":"research-v1","project":null}`)}) |
| + if _, err := wire.Encode(odd, wire.ProtocolChangeDiffs); !errors.Is(err, wire.ErrProtocol) { |
| + t.Fatalf("a null project at 35: %v", err) |
| + } |
| +} |
| + |
| +// TestDesignRoundTrip: each new frame and field survives the wire exactly |
| +// (strict decode on the far side), with the names the spec gives them. |
| +func TestDesignRoundTrip(t *testing.T) { |
| + for _, c := range []struct { |
| + kind string |
| + body any |
| + want []string |
| + }{ |
| + {wire.FrameDispatch, designDispatch(), []string{`"specialist_id":"sp_abc234"`, `"specialist_revision":2`, `"specialist_project":"p_xyz567"`, `"profile":"design-v1"`, `"capabilities":["branch.edit","page.render"]`}}, |
| + {wire.FrameLease, wire.LeaseCheck{Generation: 1, StepID: "s_1", Attempt: 1, Purpose: wire.LeasePurposeRender}, []string{`"purpose":"page_render"`}}, |
| + {wire.FrameRenderFile, renderFile(), []string{`"capture_id":"1-work-1.png"`, `"index":0`, `"total":1`, `"size":3`}}, |
| + {wire.FrameStep, wire.StepReport{TaskID: "tk1", StepID: "s_1", Attempt: 1, State: wire.StepDone, Findings: []wire.Finding{}, Options: designOptions()}, []string{`"options":[{"name":"Quiet editorial","captures":[{"id":"1-work-1.png","sha256":"` + sum('a') + `","tree_digest":"` + sum('b') + `"}`}}, |
| + } { |
| + f, err := wire.NewFrame("x", c.kind, c.body) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + raw, _ := json.Marshal(f) |
| + g, body, err := wire.ParseFrame(raw) |
| + if err != nil { |
| + t.Fatalf("%s: %v", c.kind, err) |
| + } |
| + again, _ := json.Marshal(body) |
| + if !bytes.Equal(again, g.Data) { |
| + t.Fatalf("%s did not round trip:\n%s\n%s", c.kind, again, g.Data) |
| + } |
| + for _, w := range c.want { |
| + if !strings.Contains(string(g.Data), w) { |
| + t.Fatalf("%s lacks %s: %s", c.kind, w, g.Data) |
| + } |
| + } |
| + } |
| + // Absent, the new fields are not on the wire at all. |
| + f, _ := wire.NewFrame("e", wire.FrameDispatch, wire.DispatchCommand{Findings: []wire.Finding{}}) |
| + r, _ := wire.NewFrame("r", wire.FrameStep, wire.StepReport{Findings: []wire.Finding{}}) |
| + for _, s := range []string{`specialist_`, `"profile"`, `"capabilities"`, `"options"`} { |
| + if strings.Contains(string(f.Data), s) || strings.Contains(string(r.Data), s) { |
| + t.Fatalf("an empty %s on the wire: %s %s", s, f.Data, r.Data) |
| + } |
| + } |
| + // A specialist's scope: its project, "" for the team, always said. |
| + raw, _ := json.Marshal(wire.Specialist{ID: "sp_1", Project: "p_xyz567"}) |
| + team, _ := json.Marshal(wire.Specialist{ID: "sp_1"}) |
| + if !strings.Contains(string(raw), `"project":"p_xyz567"`) || !strings.Contains(string(team), `"project":""`) { |
| + t.Fatalf("specialist scope: %s %s", raw, team) |
| + } |
| + var back wire.Specialist |
| + if err := wire.Strict(raw, &back); err != nil || back.Project != "p_xyz567" { |
| + t.Fatalf("specialist scope back: %+v %v", back, err) |
| + } |
| + // Build's note is the same field as Try again's. |
| + var answer wire.AnswerCard |
| + if err := wire.Strict([]byte(`{"choice":"build","revision":3,"note":"The bold grid."}`), &answer); err != nil || answer.Note != "The bold grid." || answer.Choice != wire.ChoiceBuild { |
| + t.Fatalf("build note: %+v %v", answer, err) |
| + } |
| +} |
| + |
| +// TestValidOptions bounds a Design report's options: at most 4, at most |
| +// 12 captures across them, each name a short plain label said once, each |
| +// capture a render_page file id said once, with SHA-256 and tree digests |
| +// of lower-case hex. No options is valid. |
| +func TestValidOptions(t *testing.T) { |
| + if err := wire.ValidOptions(designOptions()); err != nil { |
| + t.Fatalf("refused: %v", err) |
| + } |
| + if err := wire.ValidOptions(nil); err != nil { |
| + t.Fatalf("no options refused: %v", err) |
| + } |
| + if err := wire.ValidOptions([]wire.DesignOption{{Name: "Café 2 - l'été", Captures: []wire.DesignCapture{}}}); err != nil { |
| + t.Fatalf("a plain label without captures refused: %v", err) |
| + } |
| + if err := wire.ValidOptions([]wire.DesignOption{{Name: strings.Repeat("a", wire.MaxOptionName), Captures: []wire.DesignCapture{{ID: "20-base-6.png", SHA256: sum('a'), TreeDigest: sum('b')}}}}); err != nil { |
| + t.Fatalf("the longest name and a high id refused: %v", err) |
| + } |
| + five := []wire.DesignOption{} |
| + for _, n := range []string{"A", "B", "C", "D", "E"} { |
| + five = append(five, wire.DesignOption{Name: n, Captures: []wire.DesignCapture{}}) |
| + } |
| + // Thirteen distinct captures (calls 1 to 3, pages 1 to 6), over two |
| + // options: seven and six. |
| + thirteen := []wire.DesignOption{{Name: "A"}, {Name: "B"}} |
| + for i := range 13 { |
| + c := wire.DesignCapture{ID: fmt.Sprintf("%d-work-%d.png", i/6+1, i%6+1), SHA256: sum('a'), TreeDigest: sum('b')} |
| + thirteen[i%2].Captures = append(thirteen[i%2].Captures, c) |
| + } |
| + twelve := []wire.DesignOption{{Name: "A", Captures: thirteen[0].Captures}, {Name: "B", Captures: thirteen[1].Captures[:5]}} |
| + if err := wire.ValidOptions(twelve); err != nil { |
| + t.Fatalf("twelve captures refused: %v", err) |
| + } |
| + mutate := func(f func(o []wire.DesignOption)) []wire.DesignOption { |
| + o := designOptions() |
| + for i := range o { |
| + o[i].Captures = append([]wire.DesignCapture{}, o[i].Captures...) |
| + } |
| + f(o) |
| + return o |
| + } |
| + for name, bad := range map[string][]wire.DesignOption{ |
| + "five options": five, |
| + "thirteen captures": thirteen, |
| + "empty name": mutate(func(o []wire.DesignOption) { o[0].Name = "" }), |
| + "long name": mutate(func(o []wire.DesignOption) { o[0].Name = strings.Repeat("a", wire.MaxOptionName+1) }), |
| + "leading space": mutate(func(o []wire.DesignOption) { o[0].Name = " Bold" }), |
| + "trailing space": mutate(func(o []wire.DesignOption) { o[0].Name = "Bold " }), |
| + "two spaces": mutate(func(o []wire.DesignOption) { o[0].Name = "Bold grid" }), |
| + "leading hyphen": mutate(func(o []wire.DesignOption) { o[0].Name = "-Bold" }), |
| + "control": mutate(func(o []wire.DesignOption) { o[0].Name = "Bold\ngrid" }), |
| + "markup": mutate(func(o []wire.DesignOption) { o[0].Name = "<b>Bold</b>" }), |
| + "path": mutate(func(o []wire.DesignOption) { o[0].Name = "mockups/bold" }), |
| + "invalid utf-8": mutate(func(o []wire.DesignOption) { o[0].Name = "Bold\xff" }), |
| + "format character": mutate(func(o []wire.DesignOption) { o[0].Name = "Boldgrid" }), |
| + "same name": mutate(func(o []wire.DesignOption) { o[1].Name = "quiet EDITORIAL" }), |
| + "same capture": mutate(func(o []wire.DesignOption) { o[1].Captures[0].ID = "1-work-1.png" }), |
| + "same capture twice": mutate(func(o []wire.DesignOption) { o[0].Captures[1].ID = "1-work-1.png" }), |
| + "id with a path": mutate(func(o []wire.DesignOption) { o[0].Captures[0].ID = "/render/1-work-1.png" }), |
| + "id with a dot dot": mutate(func(o []wire.DesignOption) { o[0].Captures[0].ID = "../1-work-1.png" }), |
| + "id of another tree": mutate(func(o []wire.DesignOption) { o[0].Captures[0].ID = "1-head-1.png" }), |
| + "id call zero": mutate(func(o []wire.DesignOption) { o[0].Captures[0].ID = "0-work-1.png" }), |
| + "id leading zero": mutate(func(o []wire.DesignOption) { o[0].Captures[0].ID = "01-work-1.png" }), |
| + "id past the calls": mutate(func(o []wire.DesignOption) { o[0].Captures[0].ID = "100-work-1.png" }), |
| + "id page zero": mutate(func(o []wire.DesignOption) { o[0].Captures[0].ID = "1-work-0.png" }), |
| + "id not a png": mutate(func(o []wire.DesignOption) { o[0].Captures[0].ID = "1-work-1.jpg" }), |
| + "id upper case": mutate(func(o []wire.DesignOption) { o[0].Captures[0].ID = "1-WORK-1.png" }), |
| + "empty id": mutate(func(o []wire.DesignOption) { o[0].Captures[0].ID = "" }), |
| + "sha256 short": mutate(func(o []wire.DesignOption) { o[0].Captures[0].SHA256 = sum('a')[:63] }), |
| + "sha256 upper": mutate(func(o []wire.DesignOption) { o[0].Captures[0].SHA256 = strings.Repeat("A", 64) }), |
| + "sha256 empty": mutate(func(o []wire.DesignOption) { o[0].Captures[0].SHA256 = "" }), |
| + "tree digest sha1": mutate(func(o []wire.DesignOption) { o[0].Captures[0].TreeDigest = strings.Repeat("b", 40) }), |
| + "tree digest not hex": mutate(func(o []wire.DesignOption) { o[0].Captures[0].TreeDigest = strings.Repeat("g", 64) }), |
| + "tree digest empty": mutate(func(o []wire.DesignOption) { o[0].Captures[0].TreeDigest = "" }), |
| + "tree digest too long": mutate(func(o []wire.DesignOption) { o[0].Captures[0].TreeDigest = sum('b') + "b" }), |
| + } { |
| + if err := wire.ValidOptions(bad); !errors.Is(err, wire.ErrStrict) { |
| + t.Errorf("%s accepted: %v", name, err) |
| + } |
| + } |
| +} |
| + |
| +// TestValidRenderFile bounds one render_file chunk: its step, a capture |
| +// id of the render_page shape, a whole file of 1 byte to MaxCaptureBytes |
| +// in exactly as many chunks as its size needs, and this chunk's bytes |
| +// exactly its share, in strict base64. |
| +func TestValidRenderFile(t *testing.T) { |
| + if !wire.ValidRenderFile(renderFile()) { |
| + t.Fatal("refused a one-chunk file") |
| + } |
| + full := make([]byte, wire.RenderFileChunk) |
| + big := wire.RenderFile{TaskID: "tk1", StepID: "s_1", Attempt: 1, CaptureID: "3-diff-2.png", Index: 0, Total: wire.MaxRenderFileChunks, Size: wire.MaxCaptureBytes, SHA256: sum('a'), Data: base64.StdEncoding.EncodeToString(full)} |
| + if !wire.ValidRenderFile(big) { |
| + t.Fatal("refused the first chunk of the largest capture") |
| + } |
| + last := big |
| + last.Index = wire.MaxRenderFileChunks - 1 |
| + if !wire.ValidRenderFile(last) { |
| + t.Fatal("refused the last chunk of the largest capture") |
| + } |
| + if wire.MaxRenderFileChunks != 16 || wire.MaxCaptureBytes != 2<<20 || wire.RenderFileChunk != wire.ResearchFileChunk { |
| + t.Fatalf("bounds %d %d %d", wire.MaxRenderFileChunks, wire.MaxCaptureBytes, wire.RenderFileChunk) |
| + } |
| + mutate := func(f func(v *wire.RenderFile)) wire.RenderFile { v := renderFile(); f(&v); return v } |
| + for name, bad := range map[string]wire.RenderFile{ |
| + "no task": mutate(func(v *wire.RenderFile) { v.TaskID = "" }), |
| + "no step": mutate(func(v *wire.RenderFile) { v.StepID = "" }), |
| + "long step": mutate(func(v *wire.RenderFile) { v.StepID = strings.Repeat("s", 129) }), |
| + "attempt zero": mutate(func(v *wire.RenderFile) { v.Attempt = 0 }), |
| + "bad capture": mutate(func(v *wire.RenderFile) { v.CaptureID = "img1" }), |
| + "capture path": mutate(func(v *wire.RenderFile) { v.CaptureID = "../1-work-1.png" }), |
| + "sha256": mutate(func(v *wire.RenderFile) { v.SHA256 = "abc" }), |
| + "empty file": mutate(func(v *wire.RenderFile) { v.Size, v.Data = 0, "" }), |
| + "too large": mutate(func(v *wire.RenderFile) { v.Size, v.Total = wire.MaxCaptureBytes+1, wire.MaxRenderFileChunks+1 }), |
| + "total wrong": mutate(func(v *wire.RenderFile) { v.Total = 2 }), |
| + "total zero": mutate(func(v *wire.RenderFile) { v.Total = 0 }), |
| + "index negative": mutate(func(v *wire.RenderFile) { v.Index = -1 }), |
| + "index past": mutate(func(v *wire.RenderFile) { v.Index = 1 }), |
| + "short data": mutate(func(v *wire.RenderFile) { v.Data = "YWI=" }), |
| + "long data": mutate(func(v *wire.RenderFile) { v.Data = "YWJjZA==" }), |
| + "not base64": mutate(func(v *wire.RenderFile) { v.Data = "Y*Jj" }), |
| + "unpadded": mutate(func(v *wire.RenderFile) { v.Data, v.Size = "YWI", 2 }), |
| + "short middle": func() wire.RenderFile { v := big; v.Index = 1; v.Data = "YWJj"; return v }(), |
| + "long last": func() wire.RenderFile { |
| + v := last |
| + v.Data = base64.StdEncoding.EncodeToString(append(full, 0)) |
| + return v |
| + }(), |
| + "oversized encoded": func() wire.RenderFile { |
| + v := big |
| + v.Data = strings.Repeat("A", base64.StdEncoding.EncodedLen(wire.RenderFileChunk)+4) |
| + return v |
| + }(), |
| + // Each bound alone, everything else consistent with it. |
| + "too large, whole": func() wire.RenderFile { |
| + v := big |
| + v.Size, v.Total = wire.MaxCaptureBytes+1, wire.MaxRenderFileChunks+1 |
| + return v |
| + }(), |
| + "one chunk too many": func() wire.RenderFile { v := big; v.Size, v.Total = wire.RenderFileChunk+3, 3; return v }(), |
| + "index before first": func() wire.RenderFile { v := big; v.Index = -1; return v }(), |
| + "index after last": func() wire.RenderFile { v := big; v.Index = v.Total; return v }(), |
| + } { |
| + if wire.ValidRenderFile(bad) { |
| + t.Errorf("%s accepted", name) |
| + } |
| + } |
| +} |
| + |
| +// TestValidSpecialistBinding: a dispatch has no binding at all, or a |
| +// whole one: a specialist id, a revision, a project id or "" for the |
| +// team, a menu-shaped profile id and 1 to 8 distinct capability ids. |
| +func TestValidSpecialistBinding(t *testing.T) { |
| + good := designDispatch() |
| + if !wire.ValidSpecialistBinding(&good) { |
| + t.Fatal("refused a whole binding") |
| + } |
| + team := designDispatch() |
| + team.SpecialistProject = "" |
| + none := wire.DispatchCommand{Specialist: wire.SpecialistEngineering} |
| + if !wire.ValidSpecialistBinding(&team) || !wire.ValidSpecialistBinding(&none) { |
| + t.Fatal("refused a team binding or none") |
| + } |
| + for name, mutate := range map[string]func(*wire.DispatchCommand){ |
| + "no id": func(d *wire.DispatchCommand) { d.SpecialistID = "" }, |
| + "id shape": func(d *wire.DispatchCommand) { d.SpecialistID = "abc" }, |
| + "id upper": func(d *wire.DispatchCommand) { d.SpecialistID = "sp_ABC" }, |
| + "id long": func(d *wire.DispatchCommand) { d.SpecialistID = "sp_" + strings.Repeat("a", 41) }, |
| + "revision zero": func(d *wire.DispatchCommand) { d.SpecialistRevision = 0 }, |
| + "project shape": func(d *wire.DispatchCommand) { d.SpecialistProject = "patrix" }, |
| + "no profile": func(d *wire.DispatchCommand) { d.Profile = "" }, |
| + "profile shape": func(d *wire.DispatchCommand) { d.Profile = "Design" }, |
| + "no version": func(d *wire.DispatchCommand) { d.Profile = "design" }, |
| + "no capabilities": func(d *wire.DispatchCommand) { d.Capabilities = nil }, |
| + "capability": func(d *wire.DispatchCommand) { d.Capabilities = []string{"branch.edit", "Page Render"} }, |
| + "capability bare": func(d *wire.DispatchCommand) { d.Capabilities = []string{"render"} }, |
| + "twice": func(d *wire.DispatchCommand) { d.Capabilities = []string{"page.render", "page.render"} }, |
| + "nine": func(d *wire.DispatchCommand) { |
| + d.Capabilities = []string{"a.a", "a.b", "a.c", "a.d", "a.e", "a.f", "a.g", "a.h", "a.i"} |
| + }, |
| + "part only": func(d *wire.DispatchCommand) { *d = wire.DispatchCommand{Profile: "design-v1"} }, |
| + } { |
| + d := designDispatch() |
| + mutate(&d) |
| + if wire.ValidSpecialistBinding(&d) { |
| + t.Errorf("%s accepted", name) |
| + } |
| + } |
| +} |
diff --git a/internal/wire/explore.go b/internal/wire/explore.go| index bc4b1244..568160f4 100644 |
| --- a/internal/wire/explore.go |
| +++ b/internal/wire/explore.go |
| @@ -35,7 +35,7 @@ const ( |
| ChoiceDrop = "drop" |
| ) |
| -// MaxDirectionNote bounds Try again's note. |
| +// MaxDirectionNote bounds Try again's note and Build this's. |
| const MaxDirectionNote = 1000 |
| // TaskDirection is what the direction card shows: the candidate's |
diff --git a/internal/wire/frames.go b/internal/wire/frames.go| index 674739df..78ed1f4a 100644 |
| --- a/internal/wire/frames.go |
| +++ b/internal/wire/frames.go |
| @@ -67,7 +67,7 @@ type Frame struct { |
| // Durable reports whether a frame must be acked and resent until acked. |
| func (f Frame) Durable() bool { |
| switch f.Type { |
| - case FrameChangeDiff, FrameRequestAccess, FrameAccess, FrameMessage, FrameAttachment, FrameCancel, FrameReply, FrameTurn, FrameToolCall, FrameToolResult, FrameMoveIn, FrameNotebook, FrameReset, FrameDispatch, FrameCancelStep, FrameStep, FrameRecheck, FrameWatchMerge, FrameMerged, FrameAsk, FrameCancelAsk, FrameAnswer, FrameForgetTask, FrameBranch, FrameBlob, FrameSendPack, FramePublish, FramePublished, FrameConnect, FrameCancelConnect, FrameConnection, FrameUsage, FrameDisconnect, FramePreference, FrameSecret, FrameCheck, FrameModel, FrameModels, FrameBudget, FrameResumeSpend, FrameResearchFile, FrameRelease, FramePriority, FrameWarm: |
| + case FrameChangeDiff, FrameRequestAccess, FrameAccess, FrameMessage, FrameAttachment, FrameCancel, FrameReply, FrameTurn, FrameToolCall, FrameToolResult, FrameMoveIn, FrameNotebook, FrameReset, FrameDispatch, FrameCancelStep, FrameStep, FrameRecheck, FrameWatchMerge, FrameMerged, FrameAsk, FrameCancelAsk, FrameAnswer, FrameForgetTask, FrameBranch, FrameBlob, FrameSendPack, FramePublish, FramePublished, FrameConnect, FrameCancelConnect, FrameConnection, FrameUsage, FrameDisconnect, FramePreference, FrameSecret, FrameCheck, FrameModel, FrameModels, FrameBudget, FrameResumeSpend, FrameResearchFile, FrameRenderFile, FrameRelease, FramePriority, FrameWarm: |
| return true |
| } |
| return false |
| @@ -188,6 +188,8 @@ func (f Frame) Decode() (any, error) { |
| v = &ChangeDiffUpload{} |
| case FrameResearchFile: |
| v = &ResearchFile{} |
| + case FrameRenderFile: |
| + v = &RenderFile{} |
| case FrameRelease: |
| v = &ReleaseCommand{} |
| case FramePriority: |
| @@ -443,6 +445,11 @@ type LeaseCheck struct { |
| Destination string `json:"destination,omitempty"` |
| } |
| +// LeasePurposeRender is a LeaseCheck's Purpose right before each of a |
| +// Design step's render_page calls (ProtocolDesign): the instance checks |
| +// the step's specialist binding again and acks only while it holds. |
| +const LeasePurposeRender = "page_render" |
| + |
| // LeasePurposeMerge is a LeaseCheck's Purpose right before a hub merge |
| // request. |
| const LeasePurposeMerge = "merge_request" |
diff --git a/internal/wire/injection_test.go b/internal/wire/injection_test.go| index f6ff8397..aafd57d5 100644 |
| --- a/internal/wire/injection_test.go |
| +++ b/internal/wire/injection_test.go |
| @@ -7,10 +7,10 @@ import ( |
| ) |
| func TestInjectionProtocolDowngrade(t *testing.T) { |
| - if wire.ProtocolInjectionDefences != 28 || wire.ProtocolCurrent != 35 { |
| + if wire.ProtocolInjectionDefences != 28 || wire.ProtocolCurrent != 36 { |
| t.Fatal("injection guarantees require protocol 28") |
| } |
| - for version, want := range map[int]int{26: 26, 27: 27, 28: 28, 29: 29, 30: 30, 31: 31, 32: 32, 33: 33, 34: 34, 35: 35, 99: 35} { |
| + for version, want := range map[int]int{26: 26, 27: 27, 28: 28, 29: 29, 30: 30, 31: 31, 32: 32, 33: 33, 34: 34, 35: 35, 36: 36, 99: 36} { |
| if got := wire.Spoken(version); got != want { |
| t.Fatalf("negotiated %d as %d, want %d", version, got, want) |
| } |
diff --git a/internal/wire/mixed_protocol_test.go b/internal/wire/mixed_protocol_test.go| index 9b1745b4..6f9607e0 100644 |
| --- a/internal/wire/mixed_protocol_test.go |
| +++ b/internal/wire/mixed_protocol_test.go |
| @@ -15,7 +15,7 @@ import ( |
| // both go out whole; at 11 both are downgraded. The numbers are written |
| // out so that pointing ProtocolResearch back at 12 fails here. |
| func TestEncodeMixedMeteredAndResearch(t *testing.T) { |
| - if wire.ProtocolMetered != wire.Protocol12 || wire.ProtocolResearch != wire.Protocol13 || wire.ProtocolCurrent != wire.ProtocolChangeDiffs { |
| + if wire.ProtocolMetered != wire.Protocol12 || wire.ProtocolResearch != wire.Protocol13 || wire.ProtocolCurrent != wire.ProtocolDesign { |
| t.Fatalf("metered %d, research %d, current %d", wire.ProtocolMetered, wire.ProtocolResearch, wire.ProtocolCurrent) |
| } |
| metered := wire.HeldConnection{LocalID: "tensorx-1", Person: "p", Provider: wire.ProviderTensorX, Kind: wire.KindAPIKey, State: wire.ConnHealthy, Harness: wire.HarnessPi, Upstream: "https://api.tensorx.ai", Billing: wire.BillingMetered, Model: "z-ai/glm-5.3", Budget: &wire.Budget{Day: 1, Month: 2, Currency: "USD"}, Spend: &wire.Spend{Currency: "USD"}} |
diff --git a/internal/wire/models_test.go b/internal/wire/models_test.go| index 797653a0..f0a780b5 100644 |
| --- a/internal/wire/models_test.go |
| +++ b/internal/wire/models_test.go |
| @@ -94,7 +94,7 @@ func modelsFrames(t *testing.T) map[string]wire.Frame { |
| // protocol is checked because an older step in Encode's chain could |
| // undo a newer one (S5's bug). |
| func TestEncodeBelowProtocol18AgainstFrozenSchemas(t *testing.T) { |
| - if wire.ProtocolModels != wire.Protocol18 || wire.ProtocolCurrent != wire.ProtocolChangeDiffs { |
| + if wire.ProtocolModels != wire.Protocol18 || wire.ProtocolCurrent != wire.ProtocolDesign { |
| t.Fatalf("models %d, current %d", wire.ProtocolModels, wire.ProtocolCurrent) |
| } |
| fs := modelsFrames(t) |
diff --git a/internal/wire/opencode_test.go b/internal/wire/opencode_test.go| index d67e0442..e3c79938 100644 |
| --- a/internal/wire/opencode_test.go |
| +++ b/internal/wire/opencode_test.go |
| @@ -57,7 +57,7 @@ func providersIn(t *testing.T, raw []byte) (providers, harnesses []string) { |
| // leave hello and sync, its usage rows leave every report, and a connect |
| // or a report about one is refused. At 17 nothing changes. |
| func TestEncodeBelowProtocol17DropsOpenCode(t *testing.T) { |
| - if wire.ProtocolOpenCode != wire.Protocol17 || wire.ProtocolCurrent != wire.ProtocolChangeDiffs { |
| + if wire.ProtocolOpenCode != wire.Protocol17 || wire.ProtocolCurrent != wire.ProtocolDesign { |
| t.Fatalf("opencode %d, current %d", wire.ProtocolOpenCode, wire.ProtocolCurrent) |
| } |
| budget := &wire.Budget{Day: 1_000_000, Month: 10_000_000, Currency: "USD", Revision: 1} |
diff --git a/internal/wire/pinned_release_test.go b/internal/wire/pinned_release_test.go| index 994f5625..ab745b47 100644 |
| --- a/internal/wire/pinned_release_test.go |
| +++ b/internal/wire/pinned_release_test.go |
| @@ -13,7 +13,7 @@ import ( |
| // carrying a pinned release loses the release and its pin; an unpinned |
| // release is unchanged from protocol 14. |
| func TestEncodePinnedReleaseBelow29(t *testing.T) { |
| - if wire.ProtocolPinnedRelease != wire.Protocol29 || wire.ProtocolCurrent != wire.ProtocolChangeDiffs { |
| + if wire.ProtocolPinnedRelease != wire.Protocol29 || wire.ProtocolCurrent != wire.ProtocolDesign { |
| t.Fatalf("pinned %d, current %d", wire.ProtocolPinnedRelease, wire.ProtocolCurrent) |
| } |
| pinned, err := wire.NewFrame("f1", wire.FrameRelease, wire.ReleaseCommand{ID: "rl_1", Person: "p", TaskID: "tk1", StepID: "s1", StepRevision: 1, Connection: "claude-1"}) |
diff --git a/internal/wire/places_test.go b/internal/wire/places_test.go| index b9ce131b..b4708adc 100644 |
| --- a/internal/wire/places_test.go |
| +++ b/internal/wire/places_test.go |
| @@ -22,7 +22,7 @@ func placesHello() wire.Hello { |
| // refused: an older runner would deploy to its own fixed account, an |
| // older instance would decide a check without the destination. |
| func TestEncodeBelowProtocol31DropsPlaces(t *testing.T) { |
| - if wire.ProtocolPlaces != wire.Protocol34 || wire.ProtocolCurrent != wire.ProtocolChangeDiffs || wire.Spoken(99) != 35 { |
| + if wire.ProtocolPlaces != wire.Protocol34 || wire.ProtocolCurrent != wire.ProtocolDesign || wire.Spoken(99) != 36 { |
| t.Fatalf("places %d, current %d", wire.ProtocolPlaces, wire.ProtocolCurrent) |
| } |
| hello := placesHello() |
diff --git a/internal/wire/publish_test.go b/internal/wire/publish_test.go| index 2b4ae7b0..a7ceeea3 100644 |
| --- a/internal/wire/publish_test.go |
| +++ b/internal/wire/publish_test.go |
| @@ -17,7 +17,7 @@ import ( |
| // and a hello's sites capability are dropped, so nothing a protocol 15 |
| // peer decodes strictly carries them. |
| func TestEncodeBelowProtocol16DropsPublish(t *testing.T) { |
| - if wire.ProtocolPublish != wire.Protocol16 || wire.ProtocolCurrent != wire.ProtocolChangeDiffs { |
| + if wire.ProtocolPublish != wire.Protocol16 || wire.ProtocolCurrent != wire.ProtocolDesign { |
| t.Fatalf("publish %d, current %d", wire.ProtocolPublish, wire.ProtocolCurrent) |
| } |
| publish := wire.DispatchCommand{Person: "p", TaskID: "tk", StepID: "s", Attempt: 1, Specialist: wire.SpecialistPublish, Findings: []wire.Finding{}, CandidateSHA: strings.Repeat("e", 40), Publish: &wire.PublishDispatch{App: "site-sample", Into: "main"}} |
diff --git a/internal/wire/runners.go b/internal/wire/runners.go| index 50f45fca..6ea0d3d3 100644 |
| --- a/internal/wire/runners.go |
| +++ b/internal/wire/runners.go |
| @@ -61,6 +61,7 @@ const ( |
| Protocol33 = 33 |
| Protocol34 = 34 |
| Protocol35 = 35 |
| + Protocol36 = 36 |
| // ProtocolSpend is the first protocol with a fix round's Feedback and |
| // a usage row's Turns; Encode drops both below it. |
| ProtocolSpend = Protocol3 |
| @@ -226,7 +227,16 @@ const ( |
| // report's change_diffs and the change_diff_upload frame. Below it |
| // Encode drops the report's diffs and refuses the upload. |
| ProtocolChangeDiffs = Protocol35 |
| - ProtocolCurrent = ProtocolChangeDiffs |
| + // ProtocolDesign adds the Design specialist (spec |
| + // 2026-11-28-dynamic-specialists.md, slice 1): a dispatch's specialist |
| + // binding (id, revision, project, profile, capabilities), the |
| + // page_render lease check, the render_file chunk, a step report's |
| + // options and propose_specialist's project. Below it Encode refuses a |
| + // bound dispatch, a render check, a render_file chunk and a proposal |
| + // for one project, and drops a report's options and a proposal's empty |
| + // project (downgradeDesign). |
| + ProtocolDesign = Protocol36 |
| + ProtocolCurrent = ProtocolDesign |
| ) |
| // Runner roles. A person's first runner is the primary: the coordinator, |
| @@ -525,6 +535,9 @@ const ( |
| // FrameResearchFile (runner to instance, durable, protocol 13) carries |
| // one chunk of an image a Research step kept. |
| FrameResearchFile = "research_file" |
| + // FrameRenderFile (runner to instance, durable, ProtocolDesign) |
| + // carries one chunk of a capture a Design step named in its options. |
| + FrameRenderFile = "render_file" |
| ) |
| // TransferHeader binds a transfer to one attempt of one step. The |
| @@ -651,7 +664,9 @@ var ErrProtocol = errors.New("wire: frame not in this protocol") |
| // (downgradeAssistantFiles); below ProtocolPlaces the places fields are |
| // dropped and their frames refused (downgradePlaces); below |
| // ProtocolChangeDiffs a change_diff upload is refused and a step report's |
| -// change_diffs dropped. |
| +// change_diffs dropped; below ProtocolDesign a bound dispatch, a render |
| +// check, a render_file chunk and a proposal for one project are refused |
| +// and a report's options dropped (downgradeDesign). |
| func Encode(f Frame, protocol int) (Frame, error) { |
| if protocol >= ProtocolCurrent { |
| return f, nil |
| @@ -673,6 +688,13 @@ func Encode(f Frame, protocol int) (Frame, error) { |
| return Frame{}, ErrProtocol |
| } |
| changed := false |
| + if protocol < ProtocolDesign { |
| + dropped, err := downgradeDesign(body, protocol) |
| + if err != nil { |
| + return Frame{}, err |
| + } |
| + changed = dropped |
| + } |
| if protocol < ProtocolChangeDiffs { |
| switch v := body.(type) { |
| case *ChangeDiffUpload: |
diff --git a/internal/wire/runners_test.go b/internal/wire/runners_test.go| index 00a8ac9b..317a68f2 100644 |
| --- a/internal/wire/runners_test.go |
| +++ b/internal/wire/runners_test.go |
| @@ -413,7 +413,7 @@ func TestEncodeBelowProtocol9DropsPreviews(t *testing.T) { |
| if _, err := wire.Encode(d, wire.ProtocolPreview); err != nil { |
| t.Fatal(err) |
| } |
| - if wire.ProtocolCurrent != wire.ProtocolChangeDiffs || wire.ProtocolChangeDiffs != 35 || wire.ProtocolPlaces != 34 || wire.ProtocolAssistantFiles != 33 || wire.ProtocolStuckTasks != 30 || wire.ProtocolPinnedRelease != 29 || wire.ProtocolInjectionDefences != 28 || wire.ProtocolWarm != 24 || wire.ProtocolGlance != 23 || wire.ProtocolJobs != 22 || wire.ProtocolCopy != 21 || wire.ProtocolUsageRefresh != 20 || wire.ProtocolAssistant != 19 || wire.ProtocolModels != 18 || wire.ProtocolOpenCode != 17 || wire.ProtocolPublish != 16 || wire.ProtocolReadings != 15 || wire.ProtocolScheduler != 14 || wire.ProtocolResearch != 13 || wire.ProtocolMetered != 12 || wire.ProtocolPreviewHost != 11 || wire.ProtocolExplore != 10 || wire.ProtocolPreview != 9 { |
| + if wire.ProtocolCurrent != wire.ProtocolDesign || wire.ProtocolDesign != 36 || wire.ProtocolChangeDiffs != 35 || wire.ProtocolPlaces != 34 || wire.ProtocolAssistantFiles != 33 || wire.ProtocolStuckTasks != 30 || wire.ProtocolPinnedRelease != 29 || wire.ProtocolInjectionDefences != 28 || wire.ProtocolWarm != 24 || wire.ProtocolGlance != 23 || wire.ProtocolJobs != 22 || wire.ProtocolCopy != 21 || wire.ProtocolUsageRefresh != 20 || wire.ProtocolAssistant != 19 || wire.ProtocolModels != 18 || wire.ProtocolOpenCode != 17 || wire.ProtocolPublish != 16 || wire.ProtocolReadings != 15 || wire.ProtocolScheduler != 14 || wire.ProtocolResearch != 13 || wire.ProtocolMetered != 12 || wire.ProtocolPreviewHost != 11 || wire.ProtocolExplore != 10 || wire.ProtocolPreview != 9 { |
| t.Fatalf("current %d", wire.ProtocolCurrent) |
| } |
| } |
diff --git a/internal/wire/schedule_test.go b/internal/wire/schedule_test.go| index 1c3832e2..c0b1f260 100644 |
| --- a/internal/wire/schedule_test.go |
| +++ b/internal/wire/schedule_test.go |
| @@ -17,7 +17,7 @@ import ( |
| // refused anything that spends, never handed it), and a dispatch loses |
| // its priority, deadline and release; what 13 already had is unchanged. |
| func TestEncodeBelowProtocol14DropsScheduler(t *testing.T) { |
| - if wire.ProtocolScheduler != wire.Protocol14 || wire.ProtocolCurrent != wire.ProtocolChangeDiffs { |
| + if wire.ProtocolScheduler != wire.Protocol14 || wire.ProtocolCurrent != wire.ProtocolDesign { |
| t.Fatalf("scheduler %d, current %d", wire.ProtocolScheduler, wire.ProtocolCurrent) |
| } |
| by := time.Date(2026, 11, 20, 17, 0, 0, 0, time.UTC) |
diff --git a/internal/wire/specialists.go b/internal/wire/specialists.go| index 3d56702b..d367322a 100644 |
| --- a/internal/wire/specialists.go |
| +++ b/internal/wire/specialists.go |
| @@ -57,11 +57,13 @@ type SpecialistCapability struct { |
| // Specialist is one data-defined specialist, read only: GET |
| // /api/v1/specialists lists them. Capabilities and Tools are its |
| -// profile's; Approver is the owner whose Add granted them. |
| +// profile's; Approver is the owner whose Add granted them. Project is its |
| +// scope (ProtocolDesign): one project's id, or "" for the whole team. |
| type Specialist struct { |
| ID string `json:"id"` |
| Revision int64 `json:"revision"` |
| Profile string `json:"profile"` |
| + Project string `json:"project"` |
| Name string `json:"name"` |
| Brief string `json:"brief"` |
| Model string `json:"model"` |
diff --git a/internal/wire/stuck_test.go b/internal/wire/stuck_test.go| index b0790c7f..2a7e7ef9 100644 |
| --- a/internal/wire/stuck_test.go |
| +++ b/internal/wire/stuck_test.go |
| @@ -14,7 +14,7 @@ import ( |
| // Stuck tasks (protocol 30): a hello's tool health is a fixed state per |
| // pinned tool, never a path, and an older instance never hears it. |
| func TestProtocol30ToolHealth(t *testing.T) { |
| - if wire.ProtocolStuckTasks != wire.Protocol30 || wire.ProtocolCurrent != wire.ProtocolChangeDiffs || wire.Spoken(99) != 35 { |
| + if wire.ProtocolStuckTasks != wire.Protocol30 || wire.ProtocolCurrent != wire.ProtocolDesign || wire.Spoken(99) != 36 { |
| t.Fatalf("stuck %d, current %d", wire.ProtocolStuckTasks, wire.ProtocolCurrent) |
| } |
| caps := func(h *wire.ToolHealth) wire.Capabilities { |
diff --git a/internal/wire/tasks.go b/internal/wire/tasks.go| index 655a977d..37314c68 100644 |
| --- a/internal/wire/tasks.go |
| +++ b/internal/wire/tasks.go |
| @@ -757,6 +757,17 @@ type DispatchCommand struct { |
| // publish; CandidateSHA the merged commit). Encode refuses a publish |
| // dispatch below 16. |
| Publish *PublishDispatch `json:"publish,omitempty"` |
| + // ProtocolDesign: the specialist binding of a maker step made by a |
| + // data-defined specialist (Design is a maker on Engineering's step |
| + // kind): its id, the revision and project ("" the team) of its grant, |
| + // and its profile and capabilities, recorded when dispatched. All |
| + // empty for Engineering itself (ValidSpecialistBinding). Encode |
| + // refuses a dispatch carrying any of them below ProtocolDesign. |
| + SpecialistID string `json:"specialist_id,omitempty"` |
| + SpecialistRevision int64 `json:"specialist_revision,omitempty"` |
| + SpecialistProject string `json:"specialist_project,omitempty"` |
| + Profile string `json:"profile,omitempty"` |
| + Capabilities []string `json:"capabilities,omitempty"` |
| } |
| // WatchMergeCommand watches a task's branch for its candidate landing on |
| @@ -877,6 +888,10 @@ type StepReport struct { |
| // Protocol 16. Publish is a publish step's export and, once done, its |
| // outcome. |
| Publish *PublishResult `json:"publish,omitempty"` |
| + // ProtocolDesign. Options are a Design step's mockup options and the |
| + // captures it names for each (ValidOptions); their bytes travel |
| + // first, in render_file frames. Encode drops them below it. |
| + Options []DesignOption `json:"options,omitempty"` |
| } |
| // ReasonRunnerOutdated settles a preview step whose primary connected |
diff --git a/internal/wire/usage_test.go b/internal/wire/usage_test.go| index 2ef4ad2e..4026a092 100644 |
| --- a/internal/wire/usage_test.go |
| +++ b/internal/wire/usage_test.go |
| @@ -44,7 +44,7 @@ func headrooms(t *testing.T, raw []byte) []map[string]json.RawMessage { |
| // decodes strictly against the frozen protocol 14 headroom, and the |
| // caller's own values are untouched; at 15 nothing changes. |
| func TestEncodeBelowProtocol15DropsReadingTimes(t *testing.T) { |
| - if wire.ProtocolReadings != wire.Protocol15 || wire.ProtocolCurrent != wire.ProtocolChangeDiffs { |
| + if wire.ProtocolReadings != wire.Protocol15 || wire.ProtocolCurrent != wire.ProtocolDesign { |
| t.Fatalf("readings %d, current %d", wire.ProtocolReadings, wire.ProtocolCurrent) |
| } |
| at := time.Date(2026, 11, 12, 9, 58, 0, 0, time.UTC) |
diff --git a/internal/wire/warm_test.go b/internal/wire/warm_test.go| index 1801da18..7bcba9b0 100644 |
| --- a/internal/wire/warm_test.go |
| +++ b/internal/wire/warm_test.go |
| @@ -13,7 +13,7 @@ import ( |
| // other (durable, acked), and Encode refuses it below 24: an older |
| // runner's strict decoder would close the stream on it. |
| func TestEncodeWarmBelow24(t *testing.T) { |
| - if wire.ProtocolWarm != 24 || wire.ProtocolCurrent != wire.ProtocolChangeDiffs || wire.Spoken(99) != 35 { |
| + if wire.ProtocolWarm != 24 || wire.ProtocolCurrent != wire.ProtocolDesign || wire.Spoken(99) != 36 { |
| t.Fatalf("protocols %d %d", wire.ProtocolWarm, wire.ProtocolCurrent) |
| } |
| f, err := wire.NewFrame("c1", wire.FrameWarm, wire.WarmCommand{Person: "ana@example.com"}) |