oficina / equipo Public

Add delegated read-only agent access

Expose bounded project, task, and Needs you reads through the existing person-authorised paths, with current Home binding and roster checks.
Co-Authored-By: Codex GPT-6-Astra <noreply@openai.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 5846f5cbf2f5fbd77663cc5691bea1d35aee9fcf parent 257303d
14 files changed, +1,083 −7
  • .rastrillo/budgets.txt +1 −1
  • docs/api/agent-access.md +111 −0
  • docs/api/equipo-v1.md +5 −0
  • docs/superpowers/plans/2026-11-20-equipo-agent-access-evidence.md +127 −0
  • docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md +12 −0
  • go.mod +11 −1
  • go.sum +26 −4
  • internal/equipo/agent_access.go +286 −0
  • internal/equipo/agent_access_test.go +467 −0
  • internal/equipo/app.go +9 −0
  • internal/equipo/chat_wiring.go +5 −0
  • internal/equipo/config.go +6 −1
  • internal/equipo/copy.go +16 −0
  • internal/equipo/oficinaid/http.go +1 −0

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/agent-access__read-only: Type  Size Avail | ext4   96G   85G
ci-box: disk /home/ci/.cache/equipo-ci-box: Type  Size Avail | ext4   96G   85G
ci-box: bwrap: fetched and verified in 0.3s
ci-box: image pulled in 9.7s
ci-box: claude: fetched and verified in 15.5s
ci-box: codex: fetched and verified in 4.3s
ci-box: codex-code-mode-host: fetched and verified in 1.5s
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 7.2s
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 9.1s
ci-box: clone deepened in 3.3s
ci-box: file times set from content: 2807 files, 184 directories
ci-box: ready in 28.7s
=== copy ===
EQUIPO_RELEASE_COPY_CHECK=1 CGO_ENABLED=0 go test ./internal/equipotest -run '^TestReleaseCopyReviewed$' -count=1
go: downloading amadan.net/oficina/agent-access.git v0.0.0-20261024232549-8ed8ba826000
go: downloading github.com/sqids/sqids-go v0.4.1
go: downloading github.com/santhosh-tekuri/jsonschema/v6 v6.0.3
go: downloading github.com/modelcontextprotocol/go-sdk v1.7.0
go: downloading golang.org/x/time v0.15.0
go: downloading github.com/yosida95/uritemplate/v3 v3.0.2
go: downloading golang.org/x/oauth2 v0.35.0
go: downloading github.com/google/jsonschema-go v0.4.3
go: downloading github.com/segmentio/encoding v0.5.4
go: downloading github.com/segmentio/asm v1.1.3
ok  	amadan.net/oficina/equipo/internal/equipotest	0.251s
=== compile ===
go build ./...
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py compile
+ go build -tags testbuild ./...
  4.0s
+ go list -export -test -tags testbuild -f  ./...
  3.9s
+ go list -export -test -tags browser,testbuild -f  ./internal/equipo ./internal/headless ./internal/idtest ./internal/plan3test ./internal/thintest
  3.0s
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-11 02:51:11 +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 1m29.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 1m27.555s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m27.55s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 59.88, cpu waiting 36.71%, memory waiting 0.00%, io waiting 0.38%
--- 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 1m32.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 1m30.156s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m30.16s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 58.69, cpu waiting 36.62%, memory waiting 0.00%, io waiting 0.37%
--- 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 1m33.998s 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 1m32.134s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m20.62s amadan.net/oficina/equipo/internal/headless TestHeadlessConnections
receipt: slow test 6.23s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenPasteEndToEnd
receipt: slow test 5.29s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenConnection
machine: 32 CPUs, load 58.69, cpu waiting 35.93%, memory waiting 0.00%, io waiting 0.34%
--- shard 3 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-mac: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestMacWorker$|^TestHeadlessAttachments$|^TestHeadlessPrewarm$|^TestHeadless$/^1_first_token$|^TestHeadless$/^6_quick_messages$|^TestHeadless$/^8_instance_restart$|^TestHeadless$/^3_runner_offline$' ./internal/headless

receipt: test step 1m28.897s 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 1m27.009s amadan.net/oficina/equipo/internal/headless
receipt: slow test 44.13s amadan.net/oficina/equipo/internal/headless TestMacWorker
receipt: slow test 22.34s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 10.78s amadan.net/oficina/equipo/internal/headless TestHeadlessAttachments
receipt: slow test 9.76s amadan.net/oficina/equipo/internal/headless TestHeadlessPrewarm
machine: 32 CPUs, load 59.88, cpu waiting 36.71%, memory waiting 0.00%, io waiting 0.38%
--- 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_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 1m46.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 1m44.314s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m7.02s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 11.76s amadan.net/oficina/equipo/internal/headless TestHeadlessRunnerKillLeavesNoCopies
receipt: slow test 10.3s amadan.net/oficina/equipo/internal/headless TestHeadlessCopyRotation
receipt: slow test 9.19s amadan.net/oficina/equipo/internal/headless TestHeadlessPolicyGuards
receipt: slow test 6.05s amadan.net/oficina/equipo/internal/headless TestHeadlessNewHouseRuleStartsFresh
machine: 32 CPUs, load 51.22, cpu waiting 31.31%, memory waiting 0.00%, io waiting 0.29%
--- 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_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 3m17.755s 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 3m16.011s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m52.95s amadan.net/oficina/equipo/internal/headless TestHeadlessAssistant
receipt: slow test 24.32s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 11.84s amadan.net/oficina/equipo/internal/headless TestHeadlessResearchHandoff
receipt: slow test 8.16s amadan.net/oficina/equipo/internal/headless TestHeadlessClaudeSignIn
receipt: slow test 7.44s amadan.net/oficina/equipo/internal/headless TestHeadlessTurnBatching
machine: 32 CPUs, load 13.06, cpu waiting 6.65%, memory waiting 0.00%, io waiting 0.05%
--- 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 2m1.991s 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 2m0.423s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 7.9s amadan.net/oficina/equipo/internal/thintest TestContractTeamJobSettledStates
receipt: slow test 6.74s amadan.net/oficina/equipo/internal/thintest TestExplorePreviewsOff
receipt: slow test 4.82s amadan.net/oficina/equipo/internal/thintest TestContractPreviewHeldUntilPublishAnswer
receipt: slow test 4.51s amadan.net/oficina/equipo/internal/thintest TestContractTeamNudgePersonNeeds
receipt: slow test 2.42s amadan.net/oficina/equipo/internal/thintest TestResearchDoneFallsBack
machine: 32 CPUs, load 38.42, cpu waiting 23.35%, memory waiting 0.00%, io waiting 0.21%
--- 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 1m23.577s 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.132s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 9.03s amadan.net/oficina/equipo/internal/thintest TestContractPreviewNotScheduled
receipt: slow test 5.03s amadan.net/oficina/equipo/internal/thintest TestContractPublishNotOffered
receipt: slow test 4.45s amadan.net/oficina/equipo/internal/thintest TestContractMacRecheckMergeAuthority
receipt: slow test 2.36s amadan.net/oficina/equipo/internal/thintest TestContractPublishNameTaken
receipt: slow test 2.35s amadan.net/oficina/equipo/internal/thintest TestContractPreview
machine: 32 CPUs, load 55.69, cpu waiting 36.14%, memory waiting 0.00%, io waiting 0.41%
--- 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
cache miss: amadan.net/oficina/equipo/internal/runner/thin: its inputs changed
budget note: internal/runner/thin took 4m36.506s, over the 45s its record on line 44 allows; reported only, timing fails on CI

receipt: test step 4m49.606s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 4m36.506s amadan.net/oficina/equipo/internal/runner/thin
receipt: slow test 36.97s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeAnsweredByAnotherModel
receipt: slow test 36.95s amadan.net/oficina/equipo/internal/runner/thin TestModelsEngineeringProbesThenRunsTheStrongest
receipt: slow test 36.79s amadan.net/oficina/equipo/internal/runner/thin TestModelsUnhealthyRetriedOnDemand
receipt: slow test 18.47s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeRunsInsideTheAdmission
receipt: slow test 6.85s amadan.net/oficina/equipo/internal/runner/thin TestOpenCodeStepsRealOpenCode
machine: 32 CPUs, load 3.45, cpu waiting 1.48%, memory waiting 0.00%, io waiting 0.00%
--- 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
cache miss: amadan.net/oficina/equipo/internal/runner: its inputs changed

receipt: test step 49.296s 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 48.078s amadan.net/oficina/equipo/internal/runner
receipt: slow test 28.05s amadan.net/oficina/equipo/internal/runner TestDirectBugWorkflow
receipt: slow test 20.03s amadan.net/oficina/equipo/internal/runner TestEnrolKeepsTheRole
machine: 32 CPUs, load 47.86, cpu waiting 28.95%, memory waiting 0.00%, io waiting 0.75%
--- 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
cache miss: amadan.net/oficina/equipo/internal/runner: its inputs changed

receipt: test step 56.969s 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.995s amadan.net/oficina/equipo/internal/runner
receipt: slow test 44.93s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowCandidateOrder
receipt: slow test 39.81s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowFeature
receipt: slow test 8.4s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryCallRefusalKeepsServing
receipt: slow test 1.64s amadan.net/oficina/equipo/internal/runner TestCoordinatorRefusalMatrix
machine: 32 CPUs, load 51.55, cpu waiting 32.58%, memory waiting 0.00%, io waiting 0.66%
--- 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
cache miss: amadan.net/oficina/equipo/internal/runner: its inputs changed

receipt: test step 35.476s 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 34.438s amadan.net/oficina/equipo/internal/runner
receipt: slow test 5.11s amadan.net/oficina/equipo/internal/runner TestDirectFaultIsolation
receipt: slow test 3.33s amadan.net/oficina/equipo/internal/runner TestClaimRefusalsBackOff
receipt: slow test 3.13s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryRefusedKeepsServing
receipt: slow test 2.47s amadan.net/oficina/equipo/internal/runner TestToolVerbUnderFakeHarness
receipt: slow test 1.61s amadan.net/oficina/equipo/internal/runner TestReportPostsRetryExactRequest
machine: 32 CPUs, load 33.61, cpu waiting 18.00%, memory waiting 0.00%, io waiting 0.95%
--- 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 35.8%, load 28.00
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 1m6.174s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m4.393s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 27.01s amadan.net/oficina/equipo/internal/equipotest TestAuthorityCoreIntegration
receipt: slow test 26.91s amadan.net/oficina/equipo/internal/equipotest TestBootstrapNamesOwnersSetting
receipt: slow test 24.9s amadan.net/oficina/equipo/internal/equipotest TestAccountLabelMigration
receipt: slow test 22.03s amadan.net/oficina/equipo/internal/equipotest TestAuthoritySnapshotChanges
receipt: slow test 22.03s amadan.net/oficina/equipo/internal/equipotest TestBudgetConfiguration
machine: 32 CPUs, load 58.69, cpu waiting 35.93%, memory waiting 0.00%, io waiting 0.34%
--- shard 13 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-e started 30s late; cpu waiting 35.5%, load 28.00
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 1m14.675s 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 1m12.819s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 18.97s amadan.net/oficina/equipo/internal/equipotest TestProjectWritesRequireCurrentOwner
receipt: slow test 18.97s amadan.net/oficina/equipo/internal/equipotest TestProjectsFailuresRollBack
receipt: slow test 18.92s amadan.net/oficina/equipo/internal/equipotest TestProjectRejectsUnsafeBinding
receipt: slow test 18.83s amadan.net/oficina/equipo/internal/equipotest TestProjectsReopen
receipt: slow test 18.83s amadan.net/oficina/equipo/internal/equipotest TestProjectRetryAndRevision
machine: 32 CPUs, load 51.22, cpu waiting 31.31%, memory waiting 0.00%, io waiting 0.29%
--- 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 35.8%, load 28.00
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

receipt: test step 1m12.326s 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.624s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 15.39s amadan.net/oficina/equipo/internal/equipotest TestReleaseStampContract
receipt: slow test 13.11s amadan.net/oficina/equipo/internal/equipotest TestRosterChangesAffectExistingSession
receipt: slow test 10.03s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalWhileAssigned
receipt: slow test 10.01s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalRollsBack
receipt: slow test 7.03s amadan.net/oficina/equipo/internal/equipotest TestRosterBootstrapOnce
machine: 32 CPUs, load 51.22, cpu waiting 32.31%, memory waiting 0.00%, io waiting 0.30%
--- 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 35.8%, load 28.00
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 1m7.265s 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 1m5.659s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 24.89s amadan.net/oficina/equipo/internal/equipotest TestSigninNoProof
receipt: slow test 24.01s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedExistingTeam
receipt: slow test 23.94s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedRollback
receipt: slow test 22.15s amadan.net/oficina/equipo/internal/equipotest TestSigninCSRF
receipt: slow test 22.11s amadan.net/oficina/equipo/internal/equipotest TestSpecialistSettingsCurrentOwner
machine: 32 CPUs, load 54.63, cpu waiting 35.31%, memory waiting 0.00%, io waiting 0.33%
--- 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 35.5%, load 28.00
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
rastrillo: budget test: go test failed
--- FAIL amadan.net/oficina/equipo/internal/plan3test TestPlan3ReleaseBoundaries
=== RUN   TestPlan3ReleaseBoundaries
--- FAIL: TestPlan3ReleaseBoundaries (0.32s)

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

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


receipt: test step 52.665s 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 50.708s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 3.63s amadan.net/oficina/equipo/internal/plan3test TestPlan3Upgrade
receipt: slow test 3.48s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3B
receipt: slow test 1.51s amadan.net/oficina/equipo/internal/plan3test TestConversationQuestionRace
receipt: slow test 1.5s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3A
receipt: slow test 1.26s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorMessageSourcesUpgrade
exit status 1
+ go test -tags testbuild -timeout 15m -v -run '^TestPlan3ReleaseBoundaries$/^inventory$' -count=1 ./internal/plan3test   (retry, once)
FAILED TWICE ./internal/plan3test:TestPlan3ReleaseBoundaries/inventory plan3test
=== RUN   TestPlan3ReleaseBoundaries
=== RUN   TestPlan3ReleaseBoundaries/inventory
    plan3_release_test.go:22: entry has no copy review status or applicable acceptance copyAgentConfig
--- FAIL: TestPlan3ReleaseBoundaries (0.02s)
    --- FAIL: TestPlan3ReleaseBoundaries/inventory (0.02s)
FAIL
rastrillo-budget/v1 ran 23ms
FAIL	amadan.net/oficina/equipo/internal/plan3test	0.333s
FAIL
machine: 32 CPUs, load 55.69, cpu waiting 36.14%, memory waiting 0.00%, io waiting 0.41%
make: *** [Makefile:113: ci-shard] Error 1

amadan: step check shard 16 of 29 failed: exit status 2
--- shard 17 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: rest started 30s late; cpu waiting 35.5%, load 28.00
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/equipo ./internal/equipo/activity ./internal/equipo/assist ./internal/equipo/chat ./internal/equipo/conversation ./internal/equipo/conversation/chatstate ./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/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/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/planflow ./internal/runner/provider ./internal/runner/provider/claude ./internal/runner/provider/codex ./internal/runner/provider/gotoolchain ./internal/runner/provider/opencode ./internal/runner/provider/pi ./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/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/equipo ./internal/equipo/activity ./internal/equipo/assist ./internal/equipo/chat ./internal/equipo/conversation ./internal/equipo/conversation/chatstate ./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/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/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/planflow ./internal/runner/provider ./internal/runner/provider/claude ./internal/runner/provider/codex ./internal/runner/provider/gotoolchain ./internal/runner/provider/opencode ./internal/runner/provider/pi ./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/wireschema ./internal/wire/wiretest ./tools/drive
cache miss: amadan.net/oficina/equipo/internal/runner/webread: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/testci: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/opencode: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/copydesk: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/equipo/team: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/forge: 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
cache miss: amadan.net/oficina/equipo/internal/runner/checks: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/containment: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/pi: its inputs changed
--- FAIL amadan.net/oficina/equipo/internal/runner/provider/codex TestCodexEmptyHomeReplay
=== RUN   TestCodexEmptyHomeReplay
--- FAIL: TestCodexEmptyHomeReplay (8.05s)

--- FAIL amadan.net/oficina/equipo/internal/runner/provider/codex TestCodexEmptyHomeReplay/coordinate
=== RUN   TestCodexEmptyHomeReplay/coordinate
    runtime_replay_test.go:142: real coordinate Open: codex_preflight_probe: provider_identity_mismatch
    runtime_replay_test.go:189: runtime: tmp/arg0-linux d---------
    runtime_replay_test.go:189: runtime: tmp/arg0-linux/codex-arg0PiLUCz d---------
    runtime_replay_test.go:189: runtime: tmp/arg0-linux/codex-arg0PiLUCz/.lock ----------
    runtime_replay_test.go:189: runtime: tmp/arg0-linux/codex-arg0PiLUCz/apply_patch L---------
    runtime_replay_test.go:189: runtime: tmp/arg0-linux/codex-arg0PiLUCz/applypatch L---------
    runtime_replay_test.go:189: runtime: tmp/arg0-linux/codex-arg0PiLUCz/codex-linux-sandbox L---------
    runtime_replay_test.go:194: real runtime tree rejected: provider_account_containment: runtime_codex_arg0
--- FAIL: TestCodexEmptyHomeReplay/coordinate (3.25s)

--- FAIL amadan.net/oficina/equipo/internal/runner/provider/codex (package output)
FAIL
rastrillo-budget/v1 ran 16.444s
FAIL	amadan.net/oficina/equipo/internal/runner/provider/codex	17.313s

--- FAIL amadan.net/oficina/equipo/internal/runner/webread TestTimeouts
=== RUN   TestTimeouts
    fetch_test.go:537: s1: {Source:s1 Origin:paul Parent: URL:https://shop.example.com/slow-body Hops:[{URL:https://shop.example.com/slow-body Address:151.101.1.1 Status:200}] Address:151.101.1.1 Status:200 Type:text/plain Bytes:5 SHA256:2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824 Millis:301 Reason: File:s001.txt}
--- FAIL: TestTimeouts (0.61s)

--- FAIL amadan.net/oficina/equipo/internal/runner/webread (package output)
FAIL
rastrillo-budget/v1 ran 1.248s
FAIL	amadan.net/oficina/equipo/internal/runner/webread	1.262s

budget note: internal/equipo took 39.231s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/equipo/chat took 15.717s, 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 10.562s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/idtest took 41.099s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/release took 19.39s, over the 10s the default allows (measured on the run this cached result came from); reported only, timing fails on CI
budget note: internal/runner/containment took 48.642s, over the 15s its record on line 40 allows; reported only, timing fails on CI

receipt: test step 2m31.064s against a 60s target (the gate's other steps are not in this figure)
receipt: 18 packages ran, 41 cached, 18 without tests, 2 failed
receipt: slow package 1m5.47s amadan.net/oficina/equipo/internal/runner/provider/opencode
receipt: slow package 52.724s amadan.net/oficina/equipo/internal/runner/provider/pi
receipt: slow package 50.915s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow package 48.642s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow package 41.099s amadan.net/oficina/equipo/internal/idtest
receipt: slow test 26.19s amadan.net/oficina/equipo/internal/runner/provider/opencode TestOpenCodeAcceptanceHostileRepository
receipt: slow test 21.41s amadan.net/oficina/equipo/internal/runner/containment TestEngineeringOfflineGo
receipt: slow test 16.06s amadan.net/oficina/equipo/cmd/equipo-runner TestReleaseRunnerHasNoFakeWorker
receipt: slow test 11.98s amadan.net/oficina/equipo/internal/idtest TestIDCallbackGuardAndPendingNonce
receipt: slow test 11.29s amadan.net/oficina/equipo/internal/runner/containment TestEngineeringMissingModuleCache
rastrillo: budget test: go test failed
exit status 1
+ go test -tags testbuild -timeout 15m -v -run '^TestCodexEmptyHomeReplay$/^coordinate$' -count=1 ./internal/runner/provider/codex   (retry, once)
##############################################################################
FLAKE ./internal/runner/provider/codex:TestCodexEmptyHomeReplay/coordinate rest 5846f5cbf2f5fbd77663cc5691bea1d35aee9fcf 3.25s 16.38
##############################################################################
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 '^TestTimeouts$' -count=1 ./internal/runner/webread   (retry, once)
##############################################################################
FLAKE ./internal/runner/webread:TestTimeouts rest 5846f5cbf2f5fbd77663cc5691bea1d35aee9fcf 0.61s 16.38
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 15.15, cpu waiting 8.12%, memory waiting 0.00%, io waiting 0.06%
--- 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
rastrillo: budget test: go test failed
--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserChatSendStaysOnPage
=== RUN   TestBrowserChatSendStaysOnPage
time=2026-11-20T19:57:49.248Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-20T19:57:49.248Z level=INFO msg="startup phase done" phase=state_lock took=61µs
time=2026-11-20T19:57:49.248Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-20T19:57:49.248Z level=INFO msg="startup phase done" phase=claim_roots took=83µs
time=2026-11-20T19:57:49.248Z level=INFO msg="startup phase" phase=sweep
time=2026-11-20T19:57:49.280Z level=INFO msg="startup phase done" phase=sweep took=31.931ms
time=2026-11-20T19:57:49.280Z level=INFO msg="startup phase" phase=credentials
time=2026-11-20T19:57:49.280Z level=INFO msg="startup phase done" phase=credentials took=101µs
time=2026-11-20T19:57:49.280Z level=INFO msg="startup phase" phase=open_state
time=2026-11-20T19:57:49.337Z level=INFO msg="startup phase done" phase=open_state took=57.08ms
time=2026-11-20T19:57:49.338Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-20T19:57:49.339Z level=INFO msg=connecting host=127.0.0.1:40863 protocol=28
time=2026-11-20T19:57:49.342Z level=INFO msg=connected host=127.0.0.1:40863 took=1.153ms
time=2026-11-20T19:57:49.342Z level=INFO msg="capabilities gathering"
time=2026-11-20T19:57:49.344Z level=INFO msg="capabilities gathered" took=2.377ms tags=linux,claude,go
time=2026-11-20T19:57:49.347Z level=INFO msg="hello sent" protocol=28
time=2026-11-20T19:57:49.350Z level=INFO msg=welcome protocol=28 role=primary generation=1
time=2026-11-20T19:57:51.424Z level=INFO msg="connection checked" connection=claude-1 state=healthy
    browser_test.go:108: waiting for [...document.querySelectorAll('[equipo-message="incoming"] [equipo-markdown]:not([data-stream-text])')].some(e=>e.textContent.includes('fake coordinator')): context deadline exceeded (last evaluation: context deadline exceeded)
--- FAIL: TestBrowserChatSendStaysOnPage (6.39s)

--- FAIL amadan.net/oficina/equipo/internal/headless (package output)
FAIL
rastrillo-budget/v1 ran 1m24.628s
FAIL	amadan.net/oficina/equipo/internal/headless	84.987s


receipt: test step 1m26.269s 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 1m24.628s amadan.net/oficina/equipo/internal/headless
receipt: slow test 38.91s amadan.net/oficina/equipo/internal/headless TestBrowserDraftIsTheMessage
receipt: slow test 15.48s amadan.net/oficina/equipo/internal/headless TestBrowserDraftStreamsFormatted
receipt: slow test 11.1s amadan.net/oficina/equipo/internal/headless TestBrowserChat
receipt: slow test 8.06s amadan.net/oficina/equipo/internal/headless TestBrowserComposer
receipt: slow test 6.39s amadan.net/oficina/equipo/internal/headless TestBrowserChatSendStaysOnPage
exit status 1
+ go test -tags browser,testbuild -timeout 15m -run '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$' -v -run '^TestBrowserChatSendStaysOnPage$' -count=1 ./internal/headless   (retry, once)
##############################################################################
FLAKE ./internal/headless:TestBrowserChatSendStaysOnPage browser-headless-chat 5846f5cbf2f5fbd77663cc5691bea1d35aee9fcf 6.39s 59.88
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 58.69, cpu waiting 35.93%, memory waiting 0.00%, io waiting 0.34%
--- 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
rastrillo: budget test: go test failed
--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserRailFollowsWork
=== RUN   TestBrowserRailFollowsWork
time=2026-11-20T19:57:34.325Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-20T19:57:34.325Z level=INFO msg="startup phase done" phase=state_lock took=129µs
time=2026-11-20T19:57:34.325Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-20T19:57:34.326Z level=INFO msg="startup phase done" phase=claim_roots took=78µs
time=2026-11-20T19:57:34.326Z level=INFO msg="startup phase" phase=sweep
time=2026-11-20T19:57:34.355Z level=INFO msg="startup phase done" phase=sweep took=29.965ms
time=2026-11-20T19:57:34.356Z level=INFO msg="startup phase" phase=credentials
time=2026-11-20T19:57:34.356Z level=INFO msg="startup phase done" phase=credentials took=126µs
time=2026-11-20T19:57:34.356Z level=INFO msg="startup phase" phase=open_state
time=2026-11-20T19:57:34.399Z level=INFO msg="startup phase done" phase=open_state took=43.694ms
time=2026-11-20T19:57:34.400Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-20T19:57:34.401Z level=INFO msg=connecting host=127.0.0.1:42621 protocol=28
time=2026-11-20T19:57:34.402Z level=INFO msg=connected host=127.0.0.1:42621 took=984µs
time=2026-11-20T19:57:34.402Z level=INFO msg="capabilities gathering"
time=2026-11-20T19:57:34.402Z level=INFO msg="capabilities gathered" took=400µs tags=linux,claude,go
time=2026-11-20T19:57:34.403Z level=INFO msg="hello sent" protocol=28
time=2026-11-20T19:57:34.411Z level=INFO msg=welcome protocol=28 role=primary generation=1
time=2026-11-20T19:57:35.684Z level=INFO msg="connection checked" connection=claude-1 state=healthy
time=2026-11-20T19:57:44.702Z level=INFO msg="kept sessions" kept=1 bytes=2770 expired=0
time=2026-11-20T19:57:49.331Z level=INFO msg="kept sessions" kept=2 bytes=4922 expired=0
time=2026-11-20T19:57:50.152Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-20T19:57:50.152Z level=INFO msg="startup phase done" phase=state_lock took=159µs
time=2026-11-20T19:57:50.152Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-20T19:57:50.153Z level=INFO msg="startup phase done" phase=claim_roots took=269µs
time=2026-11-20T19:57:50.153Z level=INFO msg="startup phase" phase=sweep
time=2026-11-20T19:57:50.215Z level=INFO msg="startup phase done" phase=sweep took=61.116ms
time=2026-11-20T19:57:50.215Z level=INFO msg="startup phase" phase=credentials
time=2026-11-20T19:57:50.215Z level=INFO msg="startup phase done" phase=credentials took=203µs
time=2026-11-20T19:57:50.216Z level=INFO msg="startup phase" phase=open_state
time=2026-11-20T19:57:50.289Z level=INFO msg="startup phase done" phase=open_state took=72.732ms
time=2026-11-20T19:57:50.289Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-20T19:57:50.290Z level=INFO msg=connecting host=127.0.0.1:38357 protocol=28
time=2026-11-20T19:57:50.293Z level=INFO msg=connected host=127.0.0.1:38357 took=3.135ms
time=2026-11-20T19:57:50.293Z level=INFO msg="capabilities gathering"
time=2026-11-20T19:57:50.294Z level=INFO msg="capabilities gathered" took=750µs tags=linux,claude,go
time=2026-11-20T19:57:50.295Z level=INFO msg="hello sent" protocol=28
time=2026-11-20T19:57:50.300Z level=INFO msg=welcome protocol=28 role=primary generation=1
time=2026-11-20T19:57:52.409Z level=INFO msg="connection checked" connection=claude-1 state=healthy
    browser_review_test.go:57: waiting for document.querySelector('#rail [data-specialist="engineering"]')?.dataset.state==='working' && document.querySelector('#rail [data-specialist="engineering"]').querySelector('[equipo-nav-task]')?.textContent==='Slow sidebar change' && document.querySelector('#nav-tasks [data-count]')?.textContent==='1': context deadline exceeded (last evaluation: <nil>)
--- FAIL: TestBrowserRailFollowsWork (22.24s)

--- FAIL amadan.net/oficina/equipo/internal/headless (package output)
FAIL
rastrillo-budget/v1 ran 1m36.194s
FAIL	amadan.net/oficina/equipo/internal/headless	96.542s


receipt: test step 1m37.923s 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 1m36.194s amadan.net/oficina/equipo/internal/headless
receipt: slow test 27.3s amadan.net/oficina/equipo/internal/headless TestBrowserTaskThread
receipt: slow test 22.24s amadan.net/oficina/equipo/internal/headless TestBrowserRailFollowsWork
receipt: slow test 14.73s amadan.net/oficina/equipo/internal/headless TestBrowserReceiptFollowsReview
receipt: slow test 11.47s amadan.net/oficina/equipo/internal/headless TestBrowserAskAfterMerge
receipt: slow test 10.28s amadan.net/oficina/equipo/internal/headless TestBrowserTaskCard
exit status 1
+ go test -tags browser,testbuild -timeout 15m -run '^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$' -v -run '^TestBrowserRailFollowsWork$' -count=1 ./internal/headless   (retry, once)
##############################################################################
FLAKE ./internal/headless:TestBrowserRailFollowsWork browser-headless-work 5846f5cbf2f5fbd77663cc5691bea1d35aee9fcf 22.24s 54.63
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 38.42, cpu waiting 24.11%, memory waiting 0.00%, io waiting 0.22%
--- 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 1m46.796s 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 1m45.039s amadan.net/oficina/equipo/internal/headless
receipt: slow test 17s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsConversation
receipt: slow test 13.74s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAdd
receipt: slow test 13.17s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAddPage
receipt: slow test 10.73s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsMeteredLimitRequired
receipt: slow test 10.54s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsOpenCodeGoLimitRequired
machine: 32 CPUs, load 47.43, cpu waiting 30.32%, memory waiting 0.00%, io waiting 0.28%
--- 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|TestBrowserChat|TestBrowserChatSendStaysOnPage|TestBrowserComposer|TestBrowserComposerDock|TestBrowserComposerFocus|TestBrowserComposerReconcile|TestBrowserConnectionsAdd|TestBrowserConnectionsAddPage|TestBrowserConnectionsConversation|TestBrowserConnectionsCopyLink|TestBrowserConnectionsEndedNote|TestBrowserConnectionsMeteredLimitRequired|TestBrowserConnectionsOpenCodeGoLimitRequired|TestBrowserConnectionsSignIn|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 TestBrowserCopyContinue
=== RUN   TestBrowserCopyContinue
time=2026-11-20T19:57:48.923Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-20T19:57:48.923Z level=INFO msg="startup phase done" phase=state_lock took=258µs
time=2026-11-20T19:57:48.923Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-20T19:57:48.924Z level=INFO msg="startup phase done" phase=claim_roots took=175µs
time=2026-11-20T19:57:48.924Z level=INFO msg="startup phase" phase=sweep
time=2026-11-20T19:57:48.967Z level=INFO msg="startup phase done" phase=sweep took=43.784ms
time=2026-11-20T19:57:48.968Z level=INFO msg="startup phase" phase=credentials
time=2026-11-20T19:57:48.968Z level=INFO msg="startup phase done" phase=credentials took=151µs
time=2026-11-20T19:57:48.968Z level=INFO msg="startup phase" phase=open_state
time=2026-11-20T19:57:49.015Z level=INFO msg="startup phase done" phase=open_state took=46.821ms
time=2026-11-20T19:57:49.015Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-20T19:57:49.016Z level=INFO msg=connecting host=127.0.0.1:42205 protocol=28
time=2026-11-20T19:57:49.017Z level=INFO msg=connected host=127.0.0.1:42205 took=980µs
time=2026-11-20T19:57:49.017Z level=INFO msg="capabilities gathering"
time=2026-11-20T19:57:49.017Z level=INFO msg="capabilities gathered" took=428µs tags=linux,claude,go
time=2026-11-20T19:57:49.018Z level=INFO msg="hello sent" protocol=28
time=2026-11-20T19:57:49.024Z level=INFO msg=welcome protocol=28 role=primary generation=1
    browser_copy_test.go:90: waiting for !document.querySelector('[data-copy-continue]'): context deadline exceeded (last evaluation: <nil>)
--- FAIL: TestBrowserCopyContinue (6.54s)

--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserEmptyExplore
=== RUN   TestBrowserEmptyExplore
rastrillo: budget test: go test failed
time=2026-11-20T19:58:27.774Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-20T19:58:27.774Z level=INFO msg="startup phase done" phase=state_lock took=95µs
time=2026-11-20T19:58:27.774Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-20T19:58:27.774Z level=INFO msg="startup phase done" phase=claim_roots took=88µs
time=2026-11-20T19:58:27.774Z level=INFO msg="startup phase" phase=sweep
time=2026-11-20T19:58:27.805Z level=INFO msg="startup phase done" phase=sweep took=31.443ms
time=2026-11-20T19:58:27.805Z level=INFO msg="startup phase" phase=credentials
time=2026-11-20T19:58:27.805Z level=INFO msg="startup phase done" phase=credentials took=100µs
time=2026-11-20T19:58:27.805Z level=INFO msg="startup phase" phase=open_state
time=2026-11-20T19:58:27.849Z level=INFO msg="startup phase done" phase=open_state took=43.577ms
time=2026-11-20T19:58:27.850Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-20T19:58:27.851Z level=INFO msg=connecting host=127.0.0.1:45797 protocol=28
time=2026-11-20T19:58:27.853Z level=INFO msg=connected host=127.0.0.1:45797 took=2.236ms
time=2026-11-20T19:58:27.853Z level=INFO msg="capabilities gathering"
time=2026-11-20T19:58:27.854Z level=INFO msg="capabilities gathered" took=1.094ms tags=linux,claude,go
time=2026-11-20T19:58:27.856Z level=INFO msg="hello sent" protocol=28
time=2026-11-20T19:58:27.860Z level=INFO msg=welcome protocol=28 role=primary generation=1
time=2026-11-20T19:58:28.989Z 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 (5.93s)

--- FAIL amadan.net/oficina/equipo/internal/headless (package output)
FAIL
rastrillo-budget/v1 ran 1m37.678s
FAIL	amadan.net/oficina/equipo/internal/headless	98.027s


receipt: test step 1m39.168s 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 1m37.678s amadan.net/oficina/equipo/internal/headless
receipt: slow test 15.37s amadan.net/oficina/equipo/internal/headless TestBrowserThinkingAndCards
receipt: slow test 12.5s amadan.net/oficina/equipo/internal/headless TestBrowserWaitingTurns
receipt: slow test 11.26s amadan.net/oficina/equipo/internal/headless TestBrowserStalePageReloads
receipt: slow test 11.01s amadan.net/oficina/equipo/internal/headless TestBrowserMoveIn
receipt: slow test 8.15s amadan.net/oficina/equipo/internal/headless TestBrowserRefreshRace
exit status 1
+ go test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAskAfterMerge|TestBrowserChat|TestBrowserChatSendStaysOnPage|TestBrowserComposer|TestBrowserComposerDock|TestBrowserComposerFocus|TestBrowserComposerReconcile|TestBrowserConnectionsAdd|TestBrowserConnectionsAddPage|TestBrowserConnectionsConversation|TestBrowserConnectionsCopyLink|TestBrowserConnectionsEndedNote|TestBrowserConnectionsMeteredLimitRequired|TestBrowserConnectionsOpenCodeGoLimitRequired|TestBrowserConnectionsSignIn|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$' -count=1 ./internal/headless   (retry, once)
##############################################################################
FLAKE ./internal/headless:TestBrowserCopyContinue browser-headless-rest 5846f5cbf2f5fbd77663cc5691bea1d35aee9fcf 6.54s 54.63
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
##############################################################################
FLAKE ./internal/headless:TestBrowserEmptyExplore browser-headless-rest 5846f5cbf2f5fbd77663cc5691bea1d35aee9fcf 5.93s 54.63
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 44.68, cpu waiting 28.40%, memory waiting 0.00%, io waiting 0.26%
--- 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)$' ./internal/equipo

receipt: test step 1.947s 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 561ms amadan.net/oficina/equipo/internal/equipo
receipt: slow test 560ms amadan.net/oficina/equipo/internal/equipo TestBrowserPreviewBlocksNavigation
browser lane browser-rest: ./internal/idtest
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserOficinaIDDoor)$' ./internal/idtest

receipt: test step 2.993s 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 1.677s amadan.net/oficina/equipo/internal/idtest
receipt: slow test 1.68s 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 3.381s 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 1.933s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 1.93s 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|TestBrowserHousekeeping|TestBrowserInnerGallery|TestBrowserInnerScreens|TestBrowserInstantThinking|TestBrowserInstantThinkingQueued|TestBrowserMachines|TestBrowserPhoneIndex|TestBrowserPlacementQuestionAndPending|TestBrowserProjectPlacement|TestBrowserProjectsList|TestBrowserReportActionFeedback|TestBrowserReportNextSteps|TestBrowserReportThread|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)$' ./internal/thintest

receipt: test step 3m20.568s 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 3m19.014s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 17.33s amadan.net/oficina/equipo/internal/thintest TestBrowserAccessRequest
receipt: slow test 14.31s amadan.net/oficina/equipo/internal/thintest TestBrowserSettingsTeams
receipt: slow test 12.04s amadan.net/oficina/equipo/internal/thintest TestBrowserThinkingCycles
receipt: slow test 10.51s amadan.net/oficina/equipo/internal/thintest TestBrowserPlacementQuestionAndPending
receipt: slow test 7.84s amadan.net/oficina/equipo/internal/thintest TestBrowserInnerScreens
machine: 32 CPUs, load 11.13, cpu waiting 5.44%, memory waiting 0.00%, io waiting 0.04%
--- 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   (57s)
ok ./internal/headless TestHeadlessConnections/A5_cancel_and_sign_out 5.56s
ok ./internal/headless TestHeadlessConnections/C4_claude_sign_in 1.55s
ok ./internal/headless TestHeadlessConnections/C5_engineering_failover 10.50s
ok ./internal/headless TestHeadlessConnections/C5_engineering_to_codex 11.10s
ok ./internal/headless TestHeadlessConnections/C5_engineering_waits 26.23s
+ 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   (71s)
ok ./internal/headless TestHeadlessConnections/C5_review_auth 17.45s
ok ./internal/headless TestHeadlessConnections/C5_review_failover 23.10s
ok ./internal/headless TestHeadlessConnections/C5_review_on_codex 12.36s
ok ./internal/headless TestHeadlessConnections/C5_review_other_family_first 15.54s
+ go test -tags testbuild -timeout 15m -v -run '^TestMixedVersions$' ./internal/headless   (24s)
ok ./internal/headless TestMixedVersions 21.99s
+ go test -tags testbuild -timeout 15m -v -run '^TestCheckSandboxDeniedPathsTampering$' ./internal/runner/checks   (2s)
ok ./internal/runner/checks TestCheckSandboxDeniedPathsTampering 0.77s
+ go test -tags testbuild -timeout 15m -v -run '^TestRunnerCancelAndSupersede$' ./internal/runner/thin   (1s)
ok ./internal/runner/thin TestRunnerCancelAndSupersede 0.06s
quarantine: 0 flaked (passed on the retry), 0 failed
machine: 32 CPUs, load 52.84, cpu waiting 35.02%, memory waiting 0.00%, io waiting 0.52%
--- 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 11.6s against a 60s target (the gate's other steps are not in this figure)
receipt: 4 packages ran, 0 cached, 3 without tests, 0 failed
receipt: slow package 7.592s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow package 210ms amadan.net/oficina/equipo/internal/runner/provider/claude
receipt: slow package 153ms amadan.net/oficina/equipo/internal/runner/provider/codex
receipt: slow package 2ms amadan.net/oficina/equipo/internal/runner/provider
receipt: slow package 0s amadan.net/oficina/equipo/internal/runner/provider/gotoolchain
receipt: slow test 5.29s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsGoFixture
receipt: slow test 1.81s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPaths
receipt: slow test 370ms amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsCache
receipt: slow test 210ms amadan.net/oficina/equipo/internal/runner/provider/claude TestDirectJournalAdapterBarrier
receipt: slow test 150ms 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 3.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.935s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow test 260ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceReadOnlyScratch
receipt: slow test 170ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryUnavailableProof
receipt: slow test 120ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceReapsOrphans
receipt: slow test 120ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceDirectPolicyAdmission
receipt: slow test 110ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryMalformedRecord
machine: 32 CPUs, load 21.25, cpu waiting 7.51%, memory waiting 0.00%, io waiting 1.33%
--- 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 35.5%, load 28.00
shard 25: make runner-dead-references lanes-check build vet fmt-check budget migration-check
python3 scripts/runner-dead-references.py
reference scan: 2520 text files, 2846 matches, 0 failures
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 run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget size
budget size: 88 directories within budget
CGO_ENABLED=0 go test ./internal/equipo -run '^TestMigrationModels$' -count=1
ok  	amadan.net/oficina/equipo/internal/equipo	2.500s
machine: 32 CPUs, load 52.84, cpu waiting 34.79%, memory waiting 0.00%, io waiting 0.54%
--- 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 35.5%, load 28.00
shard 26: make staticcheck
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -tags browser,perf,testbuild ./...
machine: 32 CPUs, load 47.86, cpu waiting 27.56%, memory waiting 0.00%, io waiting 0.78%
--- 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 35.5%, load 28.00
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 0 vulnerabilities in packages you import and 5
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 37.96, cpu waiting 21.22%, memory waiting 0.00%, io waiting 0.89%
--- 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 35.5%, load 28.00
shard 28: make gitleaks
7:57PM INF Unknown SCM platform. Use --platform to include links in findings. host=amadan.net
7:57PM INF 1065 commits scanned.
7:57PM INF scanned ~60652167 bytes (60.65 MB) in 20.9s
7:57PM INF no leaks found
machine: 32 CPUs, load 47.86, cpu waiting 30.10%, memory waiting 0.00%, io waiting 0.73%

amadan: job failed at step check shard 16 of 29 — its output is above, not at the tail of this log
diff --git a/.rastrillo/budgets.txt b/.rastrillo/budgets.txt
index edf8fede..7d16f98e 100644
--- a/.rastrillo/budgets.txt
+++ b/.rastrillo/budgets.txt
@@ -14,7 +14,7 @@ perf GET /* skip Unknown private paths render 404; this fallback contains no scr
time internal/equipo/team 60s Plan 3 loaded CI measured 45.985s; niced serial reruns measured 18.079s and 22.031s. Keep migration, recovery, accounting and concurrency assertions; 60s leaves 30 percent headroom above loaded CI.
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 21508 - Native identity session callback and device registration wiring, merged with native push configuration; measured 21508/3385 source/test lines.
+size internal/equipo 21829 - Read-only agent registry, Home identity and roster rechecks, and routing beside the native identity wiring; measured 21829 source lines with rastrillo budget size.
size internal/wire 6771 - Native slice 2 push registrations and set aside, and the instance origin in Live Activity attributes; measured 6771/2972 source/test lines.
size internal/equipotest - 12013 Task 21 repairs historical migration and conversation fixtures after Plan 3; measured 0/12013 source/test lines.
time internal/runner/checks 90s CI worker measured 44.553s (44.6s rounded);
diff --git a/docs/api/agent-access.md b/docs/api/agent-access.md
new file mode 100644
index 00000000..d2041feb
--- /dev/null
+++ b/docs/api/agent-access.md
@@ -0,0 +1,111 @@
+# Read-only agent access
+
+This interface uses Oficina Connect delegated credentials. It exposes no
+conversation posting, task changes, merge, or other write operation.
+Model-written text is never treated as the person's words.
+
+## Configuration
+
+Set `EQUIPO_AGENT_ISSUER` (normally `https://connect.oficina.works`) and
+`EQUIPO_AGENT_TEAM` together. The team is the existing Home directory team's
+canonical SQID, encoded from one positive team ID with Home's default Sqids
+codec. It is not a team label, hostname, or Equipo's local database ID.
+Both absent leaves the existing API authentication unchanged. Partial or
+malformed values refuse startup. Equipo currently has no separate Home team
+mode; this setting binds its one existing local team to the directory team.
+
+Agent access requires valid `EQUIPO_HOME_ISSUER`,
+`EQUIPO_HOME_CONSUMER_ID`, `EQUIPO_HOME_KEYS_BASE64`, and
+`EQUIPO_HOME_DEK_BASE64`, plus the normal instance configuration. Preserve
+existing identity keys and local account links. Configuration does not
+create accounts, link people, or add roster members.
+
+`GET /auth/start` is an alias for the existing Home sign-in entry point,
+`GET /auth/home`. Both directly redirect to the configured Home issuer's
+`/authorize` URL. Health and version endpoints are unchanged.
+
+## Authentication and discovery
+
+`GET /api/v1/operations` takes no arguments. Send
+`Authorization: Bearer <delegated credential>`. Device credentials and
+browser cookies do not grant agent access. These routes run ahead of the
+device and session middleware.
+
+Every call uses `agent-access` revision `8ed8ba826000` and its
+`NewRemoteVerifier(agentIssuer, equipoOrigin+"/api/v1", homeIssuer)`.
+The verifier calls the issuer's `POST /api/v1/credential`, forwarding the
+bearer and `{"resource":"<equipoOrigin>/api/v1"}`. It checks the returned
+resource and identity issuer and requires a subject and grant. There is no
+local credential cache or offline fallback.
+
+Equipo resolves that Home subject through its existing authenticated local
+identity binding and checks the current roster. An absent, removed, or
+unlinked person is refused. Invocation resolves the link again inside the
+application read transaction and checks the current roster/session epoch.
+Lookup failures deny access. A role change takes effect through these
+existing read paths; all active roster roles can read shared team work.
+
+Missing or invalid credentials return 401, `Cache-Control: no-store`,
+`Content-Type: application/json`, exactly one `WWW-Authenticate: Bearer`,
+and only this envelope (the nonempty message may vary):
+
+```json
+{"error":{"code":"unauthenticated","message":"Connect to Oficina first."}}
+```
+
+A valid linked person gets `{"operations":[...]}`. Each descriptor includes
+its name, description, scope, read-only/idempotent flags, and JSON input and
+output schemas. Only operations allowed for this exact team and
+`equipo:read` scope appear. Other teams or scopes get an empty list.
+
+## Invocation
+
+`POST /api/v1/operations/{name}` accepts `Content-Type: application/json`
+and the same delegated bearer. The body is the operation's arguments,
+including the exact `team` SQID. Unknown fields, duplicate JSON field names,
+invalid JSON, missing required arguments, and out-of-range limits are
+rejected by the shared registry. Input is capped at 2 MiB.
+
+| Operation | Arguments besides `team` | Output |
+| --- | --- | --- |
+| `equipo_projects_list` | Optional `limit`, integer 1 to 100, default 100 | `{"items":[Project],"truncated":boolean}` |
+| `equipo_tasks_list` | Optional `limit`, integer 1 to 100, default 100 | `{"items":[Task],"truncated":boolean}` |
+| `equipo_task_get` | Required `id`, nonempty string, at most 128 characters | `{"task":Task}` |
+| `equipo_needs_you` | Optional `limit`, integer 1 to 100, default 100 | `{"items":[Task],"truncated":boolean}` |
+
+All four descriptors set `read_only` and `idempotent` to true and
+`destructive` to false. The returned Project and Task objects are the
+current thin device API's data, documented in [Equipo v1](equipo-v1.md).
+Projects include ID, title, repository, state, revision, and current
+metadata. Tasks include ID, project, title, brief, stage, revision,
+creator, steps, findings, thread, questions, and current decision fields.
+The output schemas guarantee IDs, titles, revisions, and the enclosing
+shape; additional device fields are preserved. No prose is generated.
+
+Projects use the existing `Chat.Projects` read and omit the device API's
+repository-add allowlist and home namespace. Task listing uses `Chat.Tasks`,
+including its test-person visibility filter. Task get uses `Chat.Task`.
+Needs you uses `Chat.NeedsYou`, which selects the calling person's recent
+nonterminal tasks whose decision field is nonempty.
+
+Lists preserve the existing device ordering. Each response contains at
+most 100 items, and invocation output is capped at 1 MiB. Oversized output
+returns `too_large` with no partial data. `truncated` is conservative:
+it is true when the requested limit cuts a list or completeness cannot be
+established. Task listing already reads at most the latest 100 tasks.
+Needs you already scans at most 100 recent nonterminal tasks before
+filtering, so its `truncated` is always true, including an empty result.
+An empty result is not proof that there is no older work waiting. There is
+no cursor or all-history promise in this first interface.
+
+Example arguments:
+
+```json
+{"team":"<Home team SQID>","limit":20}
+```
+
+Errors use the same `error.code` / `error.message` envelope: 403 for denied
+local access or a different submitted team, 404 for an unavailable
+operation or task, 413 for size limits, 415 for other media types, 422 for
+invalid arguments, and 503 when verification or reading is unavailable.
+All responses from the agent handler have `Cache-Control: no-store`.
diff --git a/docs/api/equipo-v1.md b/docs/api/equipo-v1.md
index cc7dffd7..33e06f21 100644
--- a/docs/api/equipo-v1.md
+++ b/docs/api/equipo-v1.md
@@ -183,3 +183,8 @@ Tell Equipo where your Base operations live with `PUT /api/v1/assistant/host`:
```
The origin is `https://` and a host name with no path, or `http://` on loopback only. It must be on the instance's `EQUIPO_ASSISTANT_HOSTS` list, or the answer is `403 host_not_allowed`. The token is 20 to 512 visible ASCII characters, with no spaces. The answer is `200` with `origin` and `revision`; the token is never given back. A second `PUT` replaces the first.
+
+## Delegated read-only operations
+
+Oficina Connect credentials use the separate [agent-access interface](agent-access.md).
+It lists projects and tasks, reads one task, and reads Needs you.
diff --git a/docs/superpowers/plans/2026-11-20-equipo-agent-access-evidence.md b/docs/superpowers/plans/2026-11-20-equipo-agent-access-evidence.md
new file mode 100644
index 00000000..c2495841
--- /dev/null
+++ b/docs/superpowers/plans/2026-11-20-equipo-agent-access-evidence.md
@@ -0,0 +1,127 @@
+# Read-only agent access evidence, 2026-11-20
+
+Scope: Paul's read-only approval relayed by the native-app controller.
+Branch: `agent-access/read-only`, based on `origin/main` at `257303da`.
+No merge, deployment, live config, or live data write is authorised or done.
+
+## Contract and implementation
+
+Read Alta's `origin/main:docs/equipo-adoption.md`, including the separate
+Equipo contract; Docs' `7de2d40:internal/docs/agent_access.go`; and the pinned
+agent-access library. Pin `v0.0.0-20261024232549-8ed8ba826000`.
+Home's default Sqids codec validates a canonical, positive directory team ID.
+Equipo has no separate Home team mode to reconcile.
+
+The four operations use the same thin store reads as the current device API:
+`Projects`, `Tasks`, `Task`, and `NeedsYou`. No `scope.Owned`, conversation
+write, or task write is used. Linkstore authenticates the existing Home/local
+account binding. Each read checks that binding again in its own transaction,
+and the existing person guard checks current roster membership and session
+epoch. Remote verification happens on every HTTP request, with no cache.
+
+See [the API contract](../../api/agent-access.md) for arguments, outputs,
+limits, authentication, and the conservative Needs you completeness flag.
+`/auth/start` aliases the existing Home sign-in handler for Alta's direct
+redirect check. Health/version code is unchanged.
+
+## Test-first and restored guards
+
+The first `GOTOOLCHAIN=go1.26.11 CGO_ENABLED=0 go test ./internal/equipo
+-run '^TestAgent' -count=1` failed to compile before implementation, naming
+missing agent configuration fields and handler. The first draft fixture also
+needed correction to use Linkstore.Adopt and a configured test mail sender.
+The implemented contract then passed.
+
+The mutation runner changed one guard at a time, ran the listed test with
+`GOTOOLCHAIN=go1.26.11 CGO_ENABLED=0 go test ./internal/equipo -run
+'^<test>$' -count=1`, and restored the original source in a `finally` block.
+No mutation remains. Every final mutation failed a behavioral test, not the
+compiler.
+
+| Deliberately broken guard | Test | Result |
+| --- | --- | --- |
+| partial-config | `TestAgentConfig` | FAIL as required; restored |
+| sqid-config | `TestAgentConfig` | FAIL as required; restored |
+| decoded-home | `TestAgentDisabledAndDirectConfig` | FAIL as required; restored |
+| route-order | `TestAgentRoutesBeforeDeviceAuth` | FAIL as required; restored |
+| cache-control | `TestAgentRoutesBeforeDeviceAuth` | FAIL as required; restored |
+| bearer-challenge | `TestAgentRoutesBeforeDeviceAuth` | FAIL as required; restored |
+| duplicate-bearer | `TestAgentAuthenticationAndMedia` | FAIL as required; restored |
+| team-discovery | `TestAgentReadContract` | FAIL as required; restored |
+| exact-team | `TestAgentReadContract` | FAIL as required; restored |
+| input-schema | `TestAgentReadContract` | FAIL as required; restored |
+| result-bytes | `TestAgentReadDataAndBounds` | FAIL as required; restored |
+| result-count | `TestAgentReadDataAndBounds` | FAIL as required; restored |
+| identity-recheck | `TestAgentReadRechecksIdentity` | FAIL as required; restored |
+| epoch-recheck | `TestAgentReadRechecksIdentity` | FAIL as required; restored |
+| readonly-descriptor | `TestAgentReadContract` | FAIL as required; restored |
+| home-start | `TestAgentRoutesBeforeDeviceAuth` | FAIL as required; restored |
+| media-type | `TestAgentAuthenticationAndMedia` | FAIL as required; restored |
+| needs-person | `TestAgentReadDataAndBounds` | FAIL as required; restored |
+
+The first Needs you mutation survived because the one-item test could hide
+an extra person's task. Added a full-list assertion requiring the caller's
+waiting task and excluding the other person's task. Repeating the mutation
+then failed. The final complete package run passed after restoration.
+
+Additional contracts exercise the real RemoteVerifier against a loopback TLS
+server: exact POST, resource and bearer forwarding; changed audience or Home
+issuer; missing subject/grant; revoked credentials; service failure; and seven
+requests causing seven verifier calls. Populated task data matches the device
+read exactly. Successful invocations of all four read operations
+leave SQLite `total_changes()` unchanged. Tests cover missing and duplicate
+bearers, wrong media, write/unknown paths, team/scope filtering, unknown input
+fields, duplicate JSON names, input size, list count, and output byte size.
+Revocation tests change membership, epoch, Home link, and account binding after
+preparation; storage lookup failures also deny every read.
+
+## Local gates
+
+Environment: macOS, `GOTOOLCHAIN=go1.26.11 CGO_ENABLED=0`.
+Formatting used `PATH="$(GOTOOLCHAIN=go1.26.11 go env GOROOT)/bin:$PATH"`.
+
+| Command | Result |
+| --- | --- |
+| `make fmt-check` | PASS |
+| `make gitleaks` | PASS; 1064 commits, no leaks |
+| `make budget` | Initial FAIL at 21829 source lines; raised only `internal/equipo` from 21508 to measured 21829 with reason, then PASS, 88 directories |
+| `make migration-check` | PASS; `TestMigrationModels` |
+| `make lanes-check` | PASS; 18 normal and 5 browser lanes, every test once |
+| `make copy-release-check` | PASS, with pending-marker limitation below |
+| `go test ./internal/equipo ./internal/equipo/oficinaid ./internal/equipo/personapi -count=1` | PASS; 16.181s / 3.587s / 1.460s |
+| `go test ./internal/plan3test -run TestPersonAPI -count=1` | PASS; 7.068s |
+| `git diff --check` | PASS |
+
+The full macOS `make test`, `make vet`, and `make staticcheck` are not the
+controller's gate because of the documented Linux-only toolproxy/runner and
+browser constraints. Targeted vet/staticcheck results and Linux CI follow
+below. No timing budget was raised.
+
+## Copy review remains required
+
+All twelve new descriptions/errors live in `internal/equipo/copy.go` and were
+marked pending using `python3 scripts/copy-status.py pending` with bounded JSON
+containing this worktree and the twelve keys. The tool also updated the
+controller report inventory. No acceptance marker was written.
+
+The existing `TestReleaseCopyReviewed` checks `COPY REVIEW REQUIRED` only,
+while the current bookkeeping tool emits `COPY REVIEW PENDING`. Consequently
+`make copy-release-check` passes without approving these new strings.
+`copy-status.py verify` is the stricter bookkeeping check. This work does not
+change the existing release gate. Copy review and a separate correction of
+that marker mismatch are still needed before release.
+
+## Commit and CI
+
+The first commit is followed by `python3 scripts/runner-dead-references.py`,
+which scans committed files. Push uses the controller-provided ephemeral-token
+script, with no token printed. The final report records the branch SHA and
+Linux CI verdict; no main push, merge, or deployment occurs.
+
+Targeted `go vet ./internal/equipo ./internal/equipo/oficinaid` and
+`go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 ./internal/equipo
+./internal/equipo/oficinaid`: PASS. `copy-status.py verify` returned
+`{"version":1,"valid":false}`, confirming the twelve entries remain pending.
+
+Post-commit `python3 scripts/runner-dead-references.py`: PASS, 2520 text
+files, 2846 matches, zero failures. Repeated after the evidence amendment.
diff --git a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md
index 6d9a935e..5d874053 100644
--- a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md
+++ b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md
@@ -6770,6 +6770,18 @@ records remain unchanged.
| `conversation.start.project` | Ask about a project | Copy specialist | COPY ACCEPTED BY DELEGATION (Astra, 2026-11-20) |
| `conversation.start.project_draft` | What’s the latest on | Copy specialist | COPY ACCEPTED BY DELEGATION (Astra, 2026-11-20) |
| `work.track.working` | (work underway) | Copy specialist | COPY ACCEPTED BY DELEGATION (Astra, 2026-11-20) |
+| `copyAgentConfig` | Configure agent access with a Home identity, an HTTPS issuer, and a Home team SQID. | Copy specialist | COPY REVIEW PENDING |
+| `copyAgentForbidden` | This connection cannot read this team's work. | Copy specialist | COPY REVIEW PENDING |
+| `copyAgentNotFound` | This operation or task is unavailable. | Copy specialist | COPY REVIEW PENDING |
+| `copyAgentUnavailable` | Equipo could not read the current access or work. | Copy specialist | COPY REVIEW PENDING |
+| `copyAgentTooLarge` | This result exceeds 1 MiB. Ask for fewer items. | Copy specialist | COPY REVIEW PENDING |
+| `copyAgentInvalid` | Send valid operation arguments. | Copy specialist | COPY REVIEW PENDING |
+| `copyAgentMedia` | Send application/json. | Copy specialist | COPY REVIEW PENDING |
+| `copyAgentUnauthenticated` | Connect to Oficina first. | Copy specialist | COPY REVIEW PENDING |
+| `agent.equipo_projects_list` | List the team's current projects. | Copy specialist | COPY REVIEW PENDING |
+| `agent.equipo_tasks_list` | List the team's recent tasks. | Copy specialist | COPY REVIEW PENDING |
+| `agent.equipo_task_get` | Read one task and its current details. | Copy specialist | COPY REVIEW PENDING |
+| `agent.equipo_needs_you` | Read recent tasks waiting for this person. | Copy specialist | COPY REVIEW PENDING |
## Task 21
diff --git a/go.mod b/go.mod
index 3008842c..68fe9f87 100644
--- a/go.mod
+++ b/go.mod
@@ -16,8 +16,10 @@ require (
require github.com/coder/websocket v1.8.15
require (
+ amadan.net/oficina/agent-access.git v0.0.0-20261024232549-8ed8ba826000
amadan.net/oficina/home/connect v0.0.0-20261114000742-e9829fda431e
amadan.net/oficina/home/handoff v0.0.0-20261114110939-e03a01a1881c
+ github.com/sqids/sqids-go v0.4.1
golang.org/x/crypto v0.53.0
)
@@ -39,6 +41,7 @@ require (
github.com/fatih/semgroup v1.2.0 // indirect
github.com/fsnotify/fsnotify v1.8.0 // indirect
github.com/gitleaks/go-gitdiff v0.9.1 // indirect
+ github.com/google/jsonschema-go v0.4.3 // indirect
github.com/h2non/filetype v1.1.3 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
@@ -58,6 +61,7 @@ require (
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
+ github.com/modelcontextprotocol/go-sdk v1.7.0 // indirect
github.com/muesli/reflow v0.2.1-0.20210115123740-9e1d0d53df68 // indirect
github.com/muesli/termenv v0.15.1 // indirect
github.com/nwaples/rardecode/v2 v2.1.0 // indirect
@@ -67,6 +71,9 @@ require (
github.com/rs/zerolog v1.33.0 // indirect
github.com/sagikazarmark/locafero v0.7.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
+ github.com/santhosh-tekuri/jsonschema/v6 v6.0.3 // indirect
+ github.com/segmentio/asm v1.1.3 // indirect
+ github.com/segmentio/encoding v0.5.4 // indirect
github.com/shopspring/decimal v1.4.0 // indirect
github.com/sorairolake/lzip-go v0.3.5 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
@@ -81,9 +88,12 @@ require (
github.com/ulikunitz/xz v0.5.12 // indirect
github.com/wasilibs/go-re2 v1.9.0 // indirect
github.com/wasilibs/wazero-helpers v0.0.0-20240620070341-3dff1577cd52 // indirect
+ github.com/yosida95/uritemplate/v3 v3.0.2 // indirect
go.uber.org/multierr v1.11.0 // indirect
go4.org v0.0.0-20230225012048-214862532bf5 // indirect
golang.org/x/exp v0.0.0-20250218142911-aa4b98e5adaa // indirect
+ golang.org/x/oauth2 v0.35.0 // indirect
+ golang.org/x/time v0.15.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
@@ -92,7 +102,7 @@ require (
amadan.net/rastrillo/rastrillo/money v0.1.0 // indirect
github.com/BurntSushi/toml v1.6.0 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
- github.com/go-json-experiment/json v0.0.0-20260820222146-c27c302e5fc3 // indirect
+ github.com/go-json-experiment/json v0.0.0-20260820222146-c27c302e5fc3
github.com/google/uuid v1.6.0 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
diff --git a/go.sum b/go.sum
index 63132d3a..5aed7780 100644
--- a/go.sum
+++ b/go.sum
@@ -1,9 +1,9 @@
+amadan.net/oficina/agent-access.git v0.0.0-20261024232549-8ed8ba826000 h1:L07nc+dmLI7c1PBkSkbnrjOK5f8p6OBbA/yTxznxCAw=
+amadan.net/oficina/agent-access.git v0.0.0-20261024232549-8ed8ba826000/go.mod h1:Ph9PIa3VE1IEaUzZiQH6D+IQ6HThWWGfVr0ecMMgrFA=
amadan.net/oficina/estilo.git v0.0.0-20261025200559-260f98c42e2d h1:p9+01xRdBD7s1viTINgQ6XoDD5ghOxYubD7FNcjhBTw=
amadan.net/oficina/estilo.git v0.0.0-20261025200559-260f98c42e2d/go.mod h1:4u0jNBtIdMLOsJyrScfqoEuYDJF7BBM3qM9YWbzt6aw=
amadan.net/oficina/home/connect v0.0.0-20261114000742-e9829fda431e h1:7Yl4BgKcmocF1ZlnkaGXoBoxBH9oCBxnl+0nTJXAKaY=
amadan.net/oficina/home/connect v0.0.0-20261114000742-e9829fda431e/go.mod h1:7tsJ//7X4o5QkD068WoUGVDxj/e3ygZ2adF+PHhvBxE=
-amadan.net/oficina/home/handoff v0.0.0-20261114000742-e9829fda431e h1:ce4x6+UxI/uKeGZrLfaPm6FyDAgqcSinl+8HBUw9dsI=
-amadan.net/oficina/home/handoff v0.0.0-20261114000742-e9829fda431e/go.mod h1:YISpzFJ+iMgrM0rUL032OSzsAQbP4/nozvXLCCOcn1k=
amadan.net/oficina/home/handoff v0.0.0-20261114110939-e03a01a1881c h1:KxjjyIlEu3hY1G6l26IrI2PRcogOscpTeydRgNzimbA=
amadan.net/oficina/home/handoff v0.0.0-20261114110939-e03a01a1881c/go.mod h1:YISpzFJ+iMgrM0rUL032OSzsAQbP4/nozvXLCCOcn1k=
amadan.net/rastrillo/rastrillo v0.30.3 h1:PEZ/Og0ZF9OjIaqwYCxrRLXis1K3MRTA2lDaseeIP1s=
@@ -72,6 +72,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/dlclark/regexp2 v1.11.0 h1:G/nrcoOa7ZXlpoa/91N3X7mM3r8eIlMBBJZvsz/mxKI=
+github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707 h1:2tV76y6Q9BB+NEBasnqvs7e49aEBFI8ejC89PSnWH+4=
github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707/go.mod h1:qssHWj60/X5sZFNxpG4HBPDHVqxNm4DfnCKgrbZOT+s=
github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY=
@@ -96,6 +98,8 @@ github.com/go-json-experiment/json v0.0.0-20260820222146-c27c302e5fc3/go.mod h1:
github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc=
github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
+github.com/golang-jwt/jwt/v5 v5.3.1 h1:kYf81DTWFe7t+1VvL7eS+jKFVWaUnK9cB1qbwn63YCY=
+github.com/golang-jwt/jwt/v5 v5.3.1/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
@@ -115,8 +119,10 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
-github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
+github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
+github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
+github.com/google/jsonschema-go v0.4.3 h1:/DBOLZTfDow7pe2GmaJNhltueGTtDKICi8V8p+DQPd0=
+github.com/google/jsonschema-go v0.4.3/go.mod h1:r5quNTdLOYEz95Ru18zA0ydNbBuYoo9tgaYcxEYhJVE=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
@@ -198,6 +204,8 @@ github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyua
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
+github.com/modelcontextprotocol/go-sdk v1.7.0 h1:yqjY2dsbKAC0LSuWZVBMrHgiG8ukXv6NRo0JiALay44=
+github.com/modelcontextprotocol/go-sdk v1.7.0/go.mod h1:dL7u98E/zjJTGzEq+j30jQ8K2k1mb6LeAH4inEcSGts=
github.com/muesli/reflow v0.2.1-0.20210115123740-9e1d0d53df68 h1:y1p/ycavWjGT9FnmSjdbWUlLGvcxrY0Rw3ATltrxOhk=
github.com/muesli/reflow v0.2.1-0.20210115123740-9e1d0d53df68/go.mod h1:Xk+z4oIWdQqJzsxyjgl3P22oYZnHdZ8FFTHAQQt5BMQ=
github.com/muesli/termenv v0.11.1-0.20220204035834-5ac8409525e0/go.mod h1:Bd5NYQ7pd+SrtBSrSNoBBmXlcY8+Xj4BMJgh8qcZrvs=
@@ -233,6 +241,12 @@ github.com/sagikazarmark/locafero v0.7.0 h1:5MqpDsTGNDhY8sGp0Aowyf0qKsPrhewaLSsF
github.com/sagikazarmark/locafero v0.7.0/go.mod h1:2za3Cg5rMaTMoG/2Ulr9AwtFaIppKXTRYnozin4aB5k=
github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE=
github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ=
+github.com/santhosh-tekuri/jsonschema/v6 v6.0.3 h1:1EYB5IzjZawrrnELUi78f9fPu57HuXjmddZPjrls/28=
+github.com/santhosh-tekuri/jsonschema/v6 v6.0.3/go.mod h1:JXeL+ps8p7/KNMjDQk3TCwPpBy0wYklyWTfbkIzdIFU=
+github.com/segmentio/asm v1.1.3 h1:WM03sfUOENvvKexOLp+pCqgb/WDjsi7EK8gIsICtzhc=
+github.com/segmentio/asm v1.1.3/go.mod h1:Ld3L4ZXGNcSLRg4JBsZ3//1+f/TjYl0Mzen/DQy1EJg=
+github.com/segmentio/encoding v0.5.4 h1:OW1VRern8Nw6ITAtwSZ7Idrl3MXCFwXHPgqESYfvNt0=
+github.com/segmentio/encoding v0.5.4/go.mod h1:HS1ZKa3kSN32ZHVZ7ZLPLXWvOVIiZtyJnO1gPH1sKt0=
github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k=
github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME=
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e h1:MRM5ITcdelLK2j1vwZ3Je0FKVCfqOLp5zO6trqMLYs0=
@@ -251,6 +265,8 @@ github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o=
github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI=
github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg=
+github.com/sqids/sqids-go v0.4.1 h1:eQKYzmAZbLlRwHeHYPF35QhgxwZHLnlmVj9AkIj/rrw=
+github.com/sqids/sqids-go v0.4.1/go.mod h1:EMwHuPQgSNFS0A49jESTfIQS+066XQTVhukrzEPScl8=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
@@ -275,6 +291,8 @@ github.com/wasilibs/wazero-helpers v0.0.0-20240620070341-3dff1577cd52 h1:OvLBa8S
github.com/wasilibs/wazero-helpers v0.0.0-20240620070341-3dff1577cd52/go.mod h1:jMeV4Vpbi8osrE/pKUxRZkVaA0EX7NZN0A9/oRzgpgY=
github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU=
github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E=
+github.com/yosida95/uritemplate/v3 v3.0.2 h1:Ed3Oyj9yrmi9087+NczuL5BwkIc4wvTb5zIM+UJPGz4=
+github.com/yosida95/uritemplate/v3 v3.0.2/go.mod h1:ILOh0sOhIJR3+L/8afwt/kE++YT040gmv5BQTMR2HP4=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/yuin/goldmark v1.8.6 h1:d0VcaP1sx9GkFVkoW+KtggpGi2KZ965i14b0+bDQST4=
github.com/yuin/goldmark v1.8.6/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg=
@@ -346,6 +364,8 @@ golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4Iltr
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
+golang.org/x/oauth2 v0.35.0 h1:Mv2mzuHuZuY2+bkyWXIHMfhNdJAdwW3FuWeCPYN5GVQ=
+golang.org/x/oauth2 v0.35.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -392,6 +412,8 @@ golang.org/x/text v0.39.0 h1:UbZz4pLOvn600D6Oh6GGEI6VAmndrEBLv8/6BEXzyus=
golang.org/x/text v0.39.0/go.mod h1:3UwRclnC2g0TU9x8PZiyfOajCd1zaUNHF9cvqcQZ+ZM=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
+golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U=
+golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
diff --git a/internal/equipo/agent_access.go b/internal/equipo/agent_access.go
new file mode 100644
index 00000000..3de913ea
--- /dev/null
+++ b/internal/equipo/agent_access.go
@@ -0,0 +1,286 @@
+package equipo
+
+import (
+ "context"
+ "encoding/base64"
+ "encoding/json"
+ "errors"
+ "io"
+ "math"
+ "mime"
+ "net/http"
+ "strings"
+
+ access "amadan.net/oficina/agent-access.git"
+ "amadan.net/oficina/equipo/internal/equipo/chat"
+ "amadan.net/oficina/equipo/internal/equipo/oficinaid"
+ "amadan.net/oficina/equipo/internal/equipo/personapi"
+ "amadan.net/oficina/equipo/internal/wire"
+ "amadan.net/oficina/home/connect"
+ "github.com/sqids/sqids-go"
+ "gorm.io/gorm"
+ "gorm.io/plugin/dbresolver"
+)
+
+func validatedAgentConfig(cfg Config) (*access.RemoteVerifier, error) {
+ if cfg.AgentIssuer == "" && cfg.AgentTeam == "" {
+ return nil, nil
+ }
+ //lint:ignore ST1005 User-facing errors preserve the sentences in copy.go.
+ fail := func() (*access.RemoteVerifier, error) { return nil, errors.New(copyAgentConfig) }
+ if cfg.Home == nil || cfg.AgentIssuer == "" || len(cfg.AgentTeam) == 0 || len(cfg.AgentTeam) > 64 {
+ return fail()
+ }
+ codec, err := sqids.New()
+ if err != nil {
+ return fail()
+ }
+ ids := codec.Decode(cfg.AgentTeam)
+ if len(ids) != 1 || ids[0] == 0 || ids[0] > math.MaxInt64 {
+ return fail()
+ }
+ canonical, err := codec.Encode(ids)
+ if err != nil || canonical != cfg.AgentTeam {
+ return fail()
+ }
+ // Revalidate even hand-built Config values at router construction.
+ keys := map[string]string{}
+ for k, v := range cfg.Home.Keys {
+ keys[k] = base64.StdEncoding.EncodeToString(v)
+ }
+ manifest, err := json.Marshal(keys)
+ if err != nil {
+ return fail()
+ }
+ _, err = connect.DecodeCredentials(&connect.Credentials{Issuer: cfg.Home.Issuer, ConsumerID: cfg.Home.ConsumerID, KeysBase64: base64.StdEncoding.EncodeToString(manifest), DEKBase64: base64.StdEncoding.EncodeToString(cfg.Home.DEK)}, cfg.Origin)
+ if err != nil {
+ return fail()
+ }
+ verifier, err := access.NewRemoteVerifier(cfg.AgentIssuer, cfg.Origin+"/api/v1", cfg.Home.Issuer)
+ if err != nil {
+ return fail()
+ }
+ return verifier, nil
+}
+
+type equipoAgent struct {
+ store *Store
+ home *oficinaid.Store
+ team string
+}
+type agentIdentityKey struct{}
+type agentIdentity struct {
+ home *oficinaid.Store
+ subject, address string
+}
+
+// Re-resolve the authenticated Home link inside the same transaction as
+// every application read. An unlink or replaced local account denies access.
+func (id agentIdentity) current(ctx context.Context, tx *gorm.DB) error {
+ _, address, err := id.home.Links.ResolveOn(ctx, tx.Statement.ConnPool, id.home.Config.Issuer, id.subject)
+ if err != nil || address != id.address {
+ return ErrForbidden
+ }
+ return nil
+}
+func (a *equipoAgent) prepare(ctx context.Context, p access.Principal) (context.Context, string, error) {
+ var address string
+ var epoch int64
+ err := a.store.db.G.WithContext(ctx).Clauses(dbresolver.Write).Transaction(func(tx *gorm.DB) error {
+ _, v, e := a.home.Links.ResolveOn(ctx, tx.Statement.ConnPool, a.home.Config.Issuer, p.Subject)
+ if e != nil {
+ return ErrForbidden
+ }
+ address = v
+ m, e := currentRunnerMember(tx, address)
+ if e != nil {
+ return e
+ }
+ epoch = m.SessionEpoch
+ return nil
+ })
+ if err != nil {
+ return ctx, "", agentFailure(err)
+ }
+ ctx = context.WithValue(ctx, agentIdentityKey{}, agentIdentity{a.home, p.Subject, address})
+ return personapi.WithVerifiedPrincipal(ctx, personapi.PersonPrincipal{Address: address, SessionEpoch: epoch}), address, nil
+}
+
+const agentResultLimit = 1 << 20
+const agentItemSchema = `{"type":"object","required":["id","title","revision"],"properties":{"id":{"type":"string"},"title":{"type":"string"},"revision":{"type":"integer"}},"additionalProperties":true}`
+const agentListSchema = `{"type":"object","required":["items","truncated"],"additionalProperties":false,"properties":{"items":{"type":"array","maxItems":100,"items":` + agentItemSchema + `},"truncated":{"type":"boolean"}}}`
+
+type agentInput struct {
+ Team string `json:"team"`
+ ID string `json:"id"`
+ Limit int `json:"limit"`
+}
+type agentPage[T any] struct {
+ Items []T `json:"items"`
+ Truncated bool `json:"truncated"`
+}
+
+func agentBound[T any](items []T, limit int, sourceLimited bool) agentPage[T] {
+ if limit == 0 {
+ limit = 100
+ }
+ truncated := len(items) > limit || sourceLimited
+ if len(items) > limit {
+ items = items[:limit]
+ }
+ if items == nil {
+ items = []T{}
+ }
+ return agentPage[T]{items, truncated}
+}
+func (a *equipoAgent) registry() (*access.Registry, error) {
+ var ops []access.Operation
+ for _, name := range []string{"equipo_projects_list", "equipo_tasks_list", "equipo_task_get", "equipo_needs_you"} {
+ props := `,"limit":{"type":"integer","minimum":1,"maximum":100}`
+ required := `"team"`
+ output := agentListSchema
+ if name == "equipo_task_get" {
+ props = `,"id":{"type":"string","minLength":1,"maxLength":128}`
+ required += `,"id"`
+ output = `{"type":"object","required":["task"],"additionalProperties":false,"properties":{"task":` + agentItemSchema + `}}`
+ }
+ ops = append(ops, access.Operation{Name: name, Description: copyText("agent." + name), Scope: "equipo:read", ReadOnly: true, Idempotent: true,
+ Input: json.RawMessage(`{"type":"object","additionalProperties":false,"required":[` + required + `],"properties":{"team":{"type":"string","minLength":1,"maxLength":64}` + props + `}}`), Output: json.RawMessage(output),
+ Available: func(p access.Principal) bool { return p.Allows(a.team, "equipo:read") },
+ Invoke: func(ctx context.Context, p access.Principal, raw json.RawMessage) (any, error) {
+ var in agentInput
+ if err := json.Unmarshal(raw, &in); err != nil {
+ return nil, access.Fail("invalid", copyAgentInvalid)
+ }
+ if in.Team != a.team {
+ return nil, access.Fail("forbidden", copyAgentForbidden)
+ }
+ ctx, person, err := a.prepare(ctx, p)
+ if err != nil {
+ return nil, err
+ }
+ result, err := a.read(ctx, person, name, in)
+ if err != nil {
+ return nil, agentFailure(err)
+ }
+ body, err := json.Marshal(result)
+ if err != nil {
+ return nil, err
+ }
+ if len(body) > agentResultLimit {
+ return nil, access.Fail("too_large", copyAgentTooLarge)
+ }
+ return result, nil
+ },
+ })
+ }
+ return access.NewRegistry(ops...)
+}
+func (a *equipoAgent) read(ctx context.Context, person, name string, in agentInput) (any, error) {
+ c := a.store.Chat()
+ switch name {
+ case "equipo_projects_list":
+ v, e := c.Projects(ctx, person)
+ return agentBound(v.Items, in.Limit, false), e
+ case "equipo_tasks_list":
+ v, e := c.Tasks(ctx, person)
+ return agentBound(v.Items, in.Limit, len(v.Items) >= wire.MaxTaskList), e
+ case "equipo_needs_you":
+ v, e := c.NeedsYou(ctx, person)
+ return agentBound(v.Items, in.Limit, true), e
+ case "equipo_task_get":
+ v, e := c.Task(ctx, person, in.ID)
+ return map[string]any{"task": v}, e
+ }
+ return nil, ErrNotFound
+}
+func agentFailure(err error) error {
+ switch {
+ case errors.Is(err, ErrForbidden), errors.Is(err, chat.ErrForbidden):
+ return access.Fail("forbidden", copyAgentForbidden)
+ case errors.Is(err, ErrNotFound), errors.Is(err, chat.ErrNotFound), errors.Is(err, gorm.ErrRecordNotFound):
+ return access.Fail("not_found", copyAgentNotFound)
+ default:
+ return access.Fail("unavailable", copyAgentUnavailable)
+ }
+}
+func agentWriteFailure(w http.ResponseWriter, err error) {
+ f := access.SafeFailure(err)
+ status := map[string]int{"unauthenticated": 401, "forbidden": 403, "not_found": 404, "invalid": 422, "too_large": 413, "unsupported_media_type": 415, "unavailable": 503}[f.Code]
+ if status == 0 {
+ status = 500
+ }
+ if status == 401 {
+ w.Header().Set("WWW-Authenticate", "Bearer")
+ }
+ w.Header().Set("Content-Type", "application/json")
+ w.WriteHeader(status)
+ _ = json.NewEncoder(w).Encode(map[string]any{"error": f})
+}
+func newEquipoAgent(store *Store, cfg Config, home *oficinaid.Store, verifier access.Verifier) (http.Handler, error) {
+ a := &equipoAgent{store, home, cfg.AgentTeam}
+ registry, err := a.registry()
+ if err != nil {
+ return nil, err
+ }
+ return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ w.Header().Set("Cache-Control", "no-store")
+ parts := strings.Fields(r.Header.Get("Authorization"))
+ if len(r.Header.Values("Authorization")) != 1 || len(parts) != 2 || !strings.EqualFold(parts[0], "Bearer") {
+ agentWriteFailure(w, access.Fail("unauthenticated", copyAgentUnauthenticated))
+ return
+ }
+ p, err := verifier.Verify(r.Context(), parts[1])
+ if err != nil {
+ agentWriteFailure(w, err)
+ return
+ }
+ if p.Subject == "" || p.Grant == "" {
+ agentWriteFailure(w, access.Fail("unauthenticated", copyAgentUnauthenticated))
+ return
+ }
+ ctx, _, err := a.prepare(r.Context(), p)
+ if err != nil {
+ agentWriteFailure(w, err)
+ return
+ }
+ var result any
+ if r.Method == "GET" && r.URL.Path == "/api/v1/operations" {
+ result = map[string]any{"operations": registry.List(p)}
+ } else {
+ name := strings.TrimPrefix(r.URL.Path, "/api/v1/operations/")
+ if r.Method != "POST" || !strings.HasPrefix(r.URL.Path, "/api/v1/operations/") || strings.Contains(name, "/") {
+ agentWriteFailure(w, access.Fail("not_found", copyAgentNotFound))
+ return
+ }
+ media, _, e := mime.ParseMediaType(r.Header.Get("Content-Type"))
+ if e != nil || media != "application/json" {
+ agentWriteFailure(w, access.Fail("unsupported_media_type", copyAgentMedia))
+ return
+ }
+ raw, e := io.ReadAll(io.LimitReader(r.Body, access.MaxPayload+1))
+ if e != nil {
+ agentWriteFailure(w, access.Fail("invalid", copyAgentInvalid))
+ return
+ }
+ result, err = registry.Call(ctx, p, name, raw)
+ if err != nil {
+ agentWriteFailure(w, err)
+ return
+ }
+ }
+ w.Header().Set("Content-Type", "application/json")
+ _ = json.NewEncoder(w).Encode(result)
+ }), nil
+}
+func agentRoutes(handler http.Handler) func(http.Handler) http.Handler {
+ return func(next http.Handler) http.Handler {
+ return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ if r.URL.Path == "/api/v1/operations" || strings.HasPrefix(r.URL.Path, "/api/v1/operations/") {
+ handler.ServeHTTP(w, r)
+ return
+ }
+ next.ServeHTTP(w, r)
+ })
+ }
+}
diff --git a/internal/equipo/agent_access_test.go b/internal/equipo/agent_access_test.go
new file mode 100644
index 00000000..dbab63b6
--- /dev/null
+++ b/internal/equipo/agent_access_test.go
@@ -0,0 +1,467 @@
+package equipo
+
+import (
+ "bytes"
+ "context"
+ "encoding/base64"
+ "encoding/json"
+ "errors"
+ "io"
+ "log/slog"
+ "net/http"
+ "net/http/httptest"
+ "reflect"
+ "strings"
+ "testing"
+
+ access "amadan.net/oficina/agent-access.git"
+ "amadan.net/oficina/equipo/internal/equipo/oficinaid"
+ "amadan.net/rastrillo/rastrillo/crypto"
+ "amadan.net/rastrillo/rastrillo/db"
+ "amadan.net/rastrillo/rastrillo/dbtest"
+ "github.com/sqids/sqids-go"
+)
+
+func agentEnv(t *testing.T) map[string]string {
+ t.Helper()
+ k, err := crypto.Generate()
+ if err != nil {
+ t.Fatal(err)
+ }
+ keys, _ := json.Marshal(map[string]string{"k": base64.StdEncoding.EncodeToString(k.SignPub())})
+ codec, _ := sqids.New()
+ team, _ := codec.Encode([]uint64{1})
+ return map[string]string{"EQUIPO_ORIGIN": "https://equipo.example", "EQUIPO_INSTANCE_KEY": "agent-test-key", "CARLOS_MAIL": "submit", "EQUIPO_OWNERS": "owner@example.com", "EQUIPO_HOME_ISSUER": "https://id.example", "EQUIPO_HOME_CONSUMER_ID": "equipo", "EQUIPO_HOME_KEYS_BASE64": base64.StdEncoding.EncodeToString(keys), "EQUIPO_HOME_DEK_BASE64": base64.StdEncoding.EncodeToString(bytes.Repeat([]byte{7}, 32)), "EQUIPO_AGENT_ISSUER": "https://connect.oficina.works", "EQUIPO_AGENT_TEAM": team}
+}
+func TestAgentConfig(t *testing.T) {
+ for _, kind := range []string{"valid", "disabled", "issuer-only", "team-only", "bad-issuer", "bad-team", "label", "no-home", "bad-home"} {
+ t.Run(kind, func(t *testing.T) {
+ env := agentEnv(t)
+ switch kind {
+ case "disabled":
+ delete(env, "EQUIPO_AGENT_ISSUER")
+ delete(env, "EQUIPO_AGENT_TEAM")
+ case "issuer-only":
+ delete(env, "EQUIPO_AGENT_TEAM")
+ case "team-only":
+ delete(env, "EQUIPO_AGENT_ISSUER")
+ case "bad-issuer":
+ env["EQUIPO_AGENT_ISSUER"] = "http://connect.oficina.works"
+ case "bad-team":
+ env["EQUIPO_AGENT_TEAM"] = " abc "
+ case "label":
+ env["EQUIPO_AGENT_TEAM"] = "oficina"
+ case "no-home":
+ for k := range env {
+ if strings.HasPrefix(k, "EQUIPO_HOME_") {
+ delete(env, k)
+ }
+ }
+ case "bad-home":
+ env["EQUIPO_HOME_DEK_BASE64"] = "bad"
+ }
+ cfg, err := LoadConfig(func(k string) string { return env[k] })
+ good := kind == "valid" || kind == "disabled"
+ if (err == nil) != good {
+ t.Fatalf("accepted=%v err=%v", err == nil, err)
+ }
+ if kind == "valid" && (cfg.AgentIssuer != env["EQUIPO_AGENT_ISSUER"] || cfg.AgentTeam != env["EQUIPO_AGENT_TEAM"]) {
+ t.Fatal("agent config not loaded")
+ }
+ })
+ }
+}
+func agentFixture(t *testing.T) (*Store, Config, *oficinaid.Store) {
+ t.Helper()
+ schema := dbtest.FromSet(BootSchema)
+ t.Cleanup(schema.Remove)
+ d, err := db.Open(schema.Path(t), slog.New(slog.NewTextHandler(io.Discard, nil)))
+ if err != nil {
+ t.Fatal(err)
+ }
+ t.Cleanup(func() { d.Close() })
+ env := agentEnv(t)
+ cfg, err := LoadConfig(func(k string) string { return env[k] })
+ if err != nil {
+ t.Fatal(err)
+ }
+ s := NewStore(d)
+ if err = s.Bootstrap(context.Background(), cfg.Owners); err != nil {
+ t.Fatal(err)
+ }
+ home, err := oficinaid.New(d.Writer(), cfg.Origin, cfg.Home)
+ if err != nil {
+ t.Fatal(err)
+ }
+ // Exercise the real link resolver, including its binding MAC.
+ var key string
+ if err = d.Writer().QueryRow("SELECT identity_key FROM members WHERE address=?", cfg.Owners[0]).Scan(&key); err != nil {
+ t.Fatal(err)
+ }
+ if _, err = d.Writer().Exec("INSERT INTO equipo_id_accounts(id,binding,member_key) VALUES(1,'test',?)", key); err != nil {
+ t.Fatal(err)
+ }
+ subject := "pr_aaaaaaaaaaaaaaaaaaaaaaaaaa"
+ // Linkstore authenticates the local binding, even for read-only resolution.
+ tx, err := d.Writer().Begin()
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer tx.Rollback()
+ if err = home.Links.Adopt(context.Background(), tx, cfg.Home.Issuer, subject, 1); err != nil {
+ t.Fatal(err)
+ }
+ if err = tx.Commit(); err != nil {
+ t.Fatal(err)
+ }
+ return s, cfg, home
+}
+func agentRequest(h http.Handler, method, path, body, token string) *httptest.ResponseRecorder {
+ r := httptest.NewRequest(method, "https://equipo.example"+path, strings.NewReader(body))
+ r.Header.Set("Content-Type", "application/json")
+ if token != "" {
+ r.Header.Set("Authorization", "Bearer "+token)
+ }
+ w := httptest.NewRecorder()
+ h.ServeHTTP(w, r)
+ return w
+}
+func TestAgentRoutesBeforeDeviceAuth(t *testing.T) {
+ s, cfg, _ := agentFixture(t)
+ // No request with a missing bearer should ever reach the remote issuer.
+ h, err := RouterWithStore(s.db, cfg, agentMail{}, nil, s)
+ if err != nil {
+ t.Fatal(err)
+ }
+ w := agentRequest(h, "GET", "/api/v1/operations", "", "")
+ if w.Code != 401 || w.Header().Get("Cache-Control") != "no-store" || w.Header().Get("Content-Type") != "application/json" {
+ t.Fatalf("%d %v %s", w.Code, w.Header(), w.Body)
+ }
+ if v := w.Header().Values("WWW-Authenticate"); len(v) != 1 || v[0] != "Bearer" {
+ t.Fatal(v)
+ }
+ start := agentRequest(h, "GET", "/auth/start", "", "")
+ if start.Code != 302 && start.Code != 303 {
+ t.Fatal("Home start", start.Code, start.Body)
+ }
+ if !strings.HasPrefix(start.Header().Get("Location"), cfg.Home.Issuer+"/authorize?") {
+ t.Fatal(start.Header())
+ }
+ var body map[string]json.RawMessage
+ if json.Unmarshal(w.Body.Bytes(), &body) != nil || len(body) != 1 {
+ t.Fatal(w.Body)
+ }
+ var failure map[string]string
+ if json.Unmarshal(body["error"], &failure) != nil || len(failure) != 2 || failure["code"] != "unauthenticated" || failure["message"] == "" {
+ t.Fatal(w.Body)
+ }
+}
+func TestAgentReadContract(t *testing.T) {
+ s, cfg, home := agentFixture(t)
+ p := access.Principal{Subject: "pr_aaaaaaaaaaaaaaaaaaaaaaaaaa", Grant: "grant", Teams: []string{cfg.AgentTeam, "other"}, Scopes: []string{"equipo:read"}}
+ verify := access.VerifyFunc(func(context.Context, string) (access.Principal, error) { return p, nil })
+ h, err := newEquipoAgent(s, cfg, home, verify)
+ if err != nil {
+ t.Fatal(err)
+ }
+ w := agentRequest(h, "GET", "/api/v1/operations", "", "valid")
+ var list struct {
+ Operations []access.Operation `json:"operations"`
+ }
+ if w.Code != 200 || json.Unmarshal(w.Body.Bytes(), &list) != nil || len(list.Operations) != 4 {
+ t.Fatalf("%d %s", w.Code, w.Body)
+ }
+ for _, op := range list.Operations {
+ if !op.ReadOnly || !op.Idempotent || op.Destructive || op.Scope != "equipo:read" {
+ t.Fatal(op)
+ }
+ }
+ for _, tc := range []struct {
+ name, body string
+ status int
+ }{
+ {"equipo_projects_list", `{"team":"` + cfg.AgentTeam + `"}`, 200},
+ {"equipo_tasks_list", `{"team":"` + cfg.AgentTeam + `"}`, 200},
+ {"equipo_needs_you", `{"team":"` + cfg.AgentTeam + `"}`, 200},
+ {"equipo_task_get", `{"team":"` + cfg.AgentTeam + `","id":"missing"}`, 404},
+ {"equipo_tasks_list", `{"team":"other"}`, 403},
+ {"equipo_tasks_list", `{"team":"` + cfg.AgentTeam + `","person":"someone"}`, 422},
+ {"equipo_tasks_list", `{"team":"` + cfg.AgentTeam + `","limit":101}`, 422},
+ {"equipo_tasks_list", `{"team":"` + cfg.AgentTeam + `","team":"other"}`, 422},
+ {"equipo_tasks_list", strings.Repeat(" ", access.MaxPayload+1), 413},
+ {"equipo_task_create", `{"team":"` + cfg.AgentTeam + `"}`, 404},
+ } {
+ t.Run(tc.name+tc.body[:min(len(tc.body), 50)], func(t *testing.T) {
+ w := agentRequest(h, "POST", "/api/v1/operations/"+tc.name, tc.body, "valid")
+ if w.Code != tc.status {
+ t.Fatalf("want %d got %d %s", tc.status, w.Code, w.Body)
+ }
+ })
+ }
+ p.Scopes = nil
+ w = agentRequest(h, "GET", "/api/v1/operations", "", "valid")
+ if w.Code != 200 || strings.TrimSpace(w.Body.String()) != `{"operations":[]}` {
+ t.Fatal(w.Code, w.Body)
+ }
+ p.Scopes = []string{"equipo:read"}
+ p.Teams = []string{"other"}
+ w = agentRequest(h, "GET", "/api/v1/operations", "", "valid")
+ if w.Code != 200 || strings.TrimSpace(w.Body.String()) != `{"operations":[]}` {
+ t.Fatal(w.Code, w.Body)
+ }
+ p.Teams = []string{cfg.AgentTeam}
+ for _, sql := range []string{"UPDATE members SET active=0", "UPDATE members SET active=1; DELETE FROM home_identity_links"} {
+ if _, err = s.db.Writer().Exec(sql); err != nil {
+ t.Fatal(err)
+ }
+ for _, path := range []string{"/api/v1/operations", "/api/v1/operations/equipo_tasks_list"} {
+ method := "GET"
+ if strings.HasSuffix(path, "list") {
+ method = "POST"
+ }
+ w = agentRequest(h, method, path, `{"team":"`+cfg.AgentTeam+`"}`, "valid")
+ if w.Code != 403 {
+ t.Fatal(w.Code, w.Body)
+ }
+ }
+ }
+}
+
+type agentMail struct{}
+
+func (agentMail) Send(context.Context, string, string, string) error { return nil }
+func (agentMail) Delivers() bool { return true }
+
+func TestAgentReadDataAndBounds(t *testing.T) {
+ s, cfg, home := agentFixture(t)
+ p := access.Principal{Subject: "pr_aaaaaaaaaaaaaaaaaaaaaaaaaa", Grant: "grant", Teams: []string{cfg.AgentTeam}, Scopes: []string{"equipo:read"}}
+ h, err := newEquipoAgent(s, cfg, home, access.VerifyFunc(func(context.Context, string) (access.Principal, error) { return p, nil }))
+ if err != nil {
+ t.Fatal(err)
+ }
+ for _, query := range []string{
+ `INSERT INTO chat_projects(id,repo,title,state,revision) VALUES('project','amadan.net/oficina/example','Example','active',1)`,
+ `INSERT INTO chat_tasks(id,project_id,title,brief,creator,stage,revision) VALUES('task','project','Read me','Details','owner@example.com','ready_to_merge',1)`,
+ `INSERT INTO chat_tasks(id,project_id,title,brief,creator,stage,revision) VALUES('other-task','project','Other task','Other details','other@example.com','ready_to_merge',1)`,
+ } {
+ if _, err = s.db.Writer().Exec(query); err != nil {
+ t.Fatal(err)
+ }
+ }
+ ctx, person, err := (&equipoAgent{s, home, cfg.AgentTeam}).prepare(context.Background(), p)
+ if err != nil {
+ t.Fatal(err)
+ }
+ expected, err := s.Chat().Task(ctx, person, "task")
+ if err != nil {
+ t.Fatal(err)
+ }
+ before := agentChanges(t, s)
+ w := agentRequest(h, "POST", "/api/v1/operations/equipo_task_get", `{"team":"`+cfg.AgentTeam+`","id":"task"}`, "valid")
+ raw, _ := json.Marshal(map[string]any{"task": expected})
+ var want, got any
+ _ = json.Unmarshal(raw, &want)
+ _ = json.Unmarshal(w.Body.Bytes(), &got)
+ if w.Code != 200 || !reflect.DeepEqual(want, got) {
+ t.Fatalf("device read mismatch: %d %s", w.Code, w.Body)
+ }
+ for _, name := range []string{"equipo_projects_list", "equipo_tasks_list", "equipo_needs_you"} {
+ w = agentRequest(h, "POST", "/api/v1/operations/"+name, `{"team":"`+cfg.AgentTeam+`","limit":1}`, "valid")
+ var page struct {
+ Items []json.RawMessage `json:"items"`
+ Truncated bool `json:"truncated"`
+ }
+ if w.Code != 200 || json.Unmarshal(w.Body.Bytes(), &page) != nil || len(page.Items) > 1 {
+ t.Fatal(w.Code, w.Body)
+ }
+ if name == "equipo_tasks_list" && (!page.Truncated || len(page.Items) != 1) {
+ t.Fatal(w.Body)
+ }
+ if name == "equipo_projects_list" && len(page.Items) != 1 {
+ t.Fatal(w.Body)
+ }
+ if name == "equipo_needs_you" && len(page.Items) != 1 {
+ t.Fatal("missing need", w.Body)
+ }
+ if name == "equipo_needs_you" && strings.Contains(w.Body.String(), "other-task") {
+ t.Fatal("read another person's needs")
+ }
+ }
+ w = agentRequest(h, "POST", "/api/v1/operations/equipo_needs_you", `{"team":"`+cfg.AgentTeam+`"}`, "valid")
+ if w.Code != 200 || strings.Contains(w.Body.String(), "other-task") || !strings.Contains(w.Body.String(), `"id":"task"`) {
+ t.Fatal("Needs you did not restrict to the caller", w.Code, w.Body)
+ }
+ if after := agentChanges(t, s); after != before {
+ t.Fatalf("read operations wrote data: %d -> %d", before, after)
+ }
+ if _, err = s.db.Writer().Exec("UPDATE chat_tasks SET brief=? WHERE id='task'", strings.Repeat("x", agentResultLimit+1)); err != nil {
+ t.Fatal(err)
+ }
+ w = agentRequest(h, "POST", "/api/v1/operations/equipo_task_get", `{"team":"`+cfg.AgentTeam+`","id":"task"}`, "valid")
+ if w.Code != 413 {
+ t.Fatal(w.Code, w.Body.Len())
+ }
+}
+func agentChanges(t *testing.T, s *Store) int64 {
+ t.Helper()
+ var n int64
+ if err := s.db.Writer().QueryRow("SELECT total_changes()").Scan(&n); err != nil {
+ t.Fatal(err)
+ }
+ return n
+}
+func TestAgentReadRechecksIdentity(t *testing.T) {
+ for _, change := range []string{"DELETE FROM home_identity_links", "UPDATE members SET active=0", "UPDATE members SET session_epoch=session_epoch+1", "UPDATE equipo_id_accounts SET member_key='replaced'", "DROP TABLE home_identity_links"} {
+ t.Run(change, func(t *testing.T) {
+ s, cfg, home := agentFixture(t)
+ p := access.Principal{Subject: "pr_aaaaaaaaaaaaaaaaaaaaaaaaaa", Grant: "grant", Teams: []string{cfg.AgentTeam}, Scopes: []string{"equipo:read"}}
+ a := &equipoAgent{s, home, cfg.AgentTeam}
+ ctx, person, err := a.prepare(context.Background(), p)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if _, err = s.db.Writer().Exec(change); err != nil {
+ t.Fatal(err)
+ }
+ for _, op := range []string{"equipo_projects_list", "equipo_tasks_list", "equipo_needs_you", "equipo_task_get"} {
+ if _, err = a.read(ctx, person, op, agentInput{ID: "missing"}); !errors.Is(err, ErrForbidden) {
+ t.Fatalf("%s: revoked read: %v", op, err)
+ }
+ }
+ })
+ }
+}
+func TestAgentRemoteVerifier(t *testing.T) {
+ s, cfg, home := agentFixture(t)
+ status := 200
+ resource := cfg.Origin + "/api/v1"
+ issuer := cfg.Home.Issuer
+ subject := "pr_aaaaaaaaaaaaaaaaaaaaaaaaaa"
+ grant := "grant"
+ calls := 0
+ server := httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ calls++
+ if r.Method != "POST" || r.URL.Path != "/api/v1/credential" || r.Header.Get("Authorization") != "Bearer delegated" {
+ t.Error("wrong credential request")
+ }
+ var in map[string]string
+ if json.NewDecoder(r.Body).Decode(&in) != nil || len(in) != 1 || in["resource"] != cfg.Origin+"/api/v1" {
+ t.Error("wrong audience request")
+ }
+ w.WriteHeader(status)
+ _ = json.NewEncoder(w).Encode(map[string]any{"resource": resource, "identity_issuer": issuer, "principal": access.Principal{Subject: subject, Grant: grant, Teams: []string{cfg.AgentTeam}, Scopes: []string{"equipo:read"}}})
+ }))
+ defer server.Close()
+ verifier, err := access.NewRemoteVerifier(server.URL, cfg.Origin+"/api/v1", cfg.Home.Issuer)
+ if err != nil {
+ t.Fatal(err)
+ }
+ verifier.Client = server.Client()
+ h, err := newEquipoAgent(s, cfg, home, verifier)
+ if err != nil {
+ t.Fatal(err)
+ }
+ for _, kind := range []string{"valid", "revoked", "audience", "issuer", "subject", "grant", "unavailable"} {
+ t.Run(kind, func(t *testing.T) {
+ status = 200
+ resource = cfg.Origin + "/api/v1"
+ issuer = cfg.Home.Issuer
+ subject = "pr_aaaaaaaaaaaaaaaaaaaaaaaaaa"
+ grant = "grant"
+ want := 503
+ switch kind {
+ case "valid":
+ want = 200
+ case "revoked":
+ status = 401
+ want = 401
+ case "audience":
+ resource = "https://other.example/api/v1"
+ case "issuer":
+ issuer = "https://other.example"
+ case "subject":
+ subject = ""
+ case "grant":
+ grant = ""
+ case "unavailable":
+ status = 503
+ }
+ w := agentRequest(h, "GET", "/api/v1/operations", "", "delegated")
+ if w.Code != want {
+ t.Fatal(w.Code, w.Body)
+ }
+ if want == 401 && (len(w.Header().Values("WWW-Authenticate")) != 1 || w.Header().Get("WWW-Authenticate") != "Bearer") {
+ t.Fatal(w.Header())
+ }
+ })
+ }
+ if calls != 7 {
+ t.Fatal("verification cached", calls)
+ }
+}
+
+func TestAgentAuthenticationAndMedia(t *testing.T) {
+ s, cfg, home := agentFixture(t)
+ calls := 0
+ h, err := newEquipoAgent(s, cfg, home, access.VerifyFunc(func(context.Context, string) (access.Principal, error) {
+ calls++
+ return access.Principal{Subject: "pr_aaaaaaaaaaaaaaaaaaaaaaaaaa", Grant: "grant", Teams: []string{cfg.AgentTeam}, Scopes: []string{"equipo:read"}}, nil
+ }))
+ if err != nil {
+ t.Fatal(err)
+ }
+ for _, headers := range [][]string{nil, {"Basic token"}, {"Bearer"}, {"Bearer a b"}, {"Bearer a", "Bearer b"}} {
+ r := httptest.NewRequest("GET", "https://equipo.example/api/v1/operations", nil)
+ for _, v := range headers {
+ r.Header.Add("Authorization", v)
+ }
+ w := httptest.NewRecorder()
+ h.ServeHTTP(w, r)
+ if w.Code != 401 || calls != 0 {
+ t.Fatal(w.Code, calls, w.Body)
+ }
+ }
+ r := httptest.NewRequest("POST", "https://equipo.example/api/v1/operations/equipo_tasks_list", strings.NewReader(`{"team":"`+cfg.AgentTeam+`"}`))
+ r.Header.Set("Authorization", "Bearer valid")
+ r.Header.Set("Content-Type", "text/plain")
+ w := httptest.NewRecorder()
+ h.ServeHTTP(w, r)
+ if w.Code != 415 {
+ t.Fatal(w.Code, w.Body)
+ }
+ for _, path := range []string{"/api/v1/operations", "/api/v1/operations/equipo_tasks_list/nested"} {
+ w = agentRequest(h, "DELETE", path, "", "valid")
+ if w.Code != 404 {
+ t.Fatal(w.Code, w.Body)
+ }
+ }
+}
+func TestAgentDisabledAndDirectConfig(t *testing.T) {
+ s, cfg, _ := agentFixture(t)
+ invalid := cfg
+ invalid.Home = nil
+ if _, err := validatedAgentConfig(invalid); err == nil {
+ t.Fatal("Home required")
+ }
+ invalid = cfg
+ home := *cfg.Home
+ home.DEK = nil
+ invalid.Home = &home
+ if _, err := validatedAgentConfig(invalid); err == nil {
+ t.Fatal("invalid decoded Home admitted")
+ }
+ cfg.AgentIssuer = ""
+ cfg.AgentTeam = ""
+ verifier, err := validatedAgentConfig(cfg)
+ if err != nil || verifier != nil {
+ t.Fatal("not disabled", err)
+ }
+ h, err := RouterWithStore(s.db, cfg, agentMail{}, nil, s)
+ if err != nil {
+ t.Fatal(err)
+ }
+ w := agentRequest(h, "GET", "/api/v1/operations", "", "")
+ if w.Code != 401 || w.Header().Get("WWW-Authenticate") == "Bearer" {
+ t.Fatal("disabled agent route replaced existing API", w.Code, w.Header(), w.Body)
+ }
+}
diff --git a/internal/equipo/app.go b/internal/equipo/app.go
index e25f6f45..961cb851 100644
--- a/internal/equipo/app.go
+++ b/internal/equipo/app.go
@@ -240,6 +240,15 @@ func RouterWithStore(d *db.DB, cfg Config, mailer mail.Sender, logger *slog.Logg
}
a.home = &oficinaid.HTTP{Store: storeID, Auth: authentication, Render: a.renderID}
}
+ if verifier, e := validatedAgentConfig(cfg); e != nil {
+ return nil, e
+ } else if verifier != nil {
+ handler, e := newEquipoAgent(store, cfg, a.home.Store, verifier)
+ if e != nil {
+ return nil, e
+ }
+ a.Use(agentRoutes(handler))
+ }
// The live hub served the old always-on pages; the conversation now
// follows the person event stream (chat-stream.js), so it stays off.
a.Use(a.live.Middleware)
diff --git a/internal/equipo/chat_wiring.go b/internal/equipo/chat_wiring.go
index f59bbf75..e3b98a36 100644
--- a/internal/equipo/chat_wiring.go
+++ b/internal/equipo/chat_wiring.go
@@ -121,6 +121,11 @@ func lowered(in []string) []string {
func (s *Store) DrainStreams() { s.Chat().Hub().Drain() }
func (s *Store) chatCurrentPerson(ctx context.Context, tx *gorm.DB) error {
+ if id, ok := ctx.Value(agentIdentityKey{}).(agentIdentity); ok {
+ if err := id.current(ctx, tx); err != nil {
+ return err
+ }
+ }
p, ok := personapi.PrincipalFrom(ctx)
if !ok || p.Address == "" {
return ErrForbidden
diff --git a/internal/equipo/config.go b/internal/equipo/config.go
index 6d42d7d4..a6f60157 100644
--- a/internal/equipo/config.go
+++ b/internal/equipo/config.go
@@ -13,6 +13,8 @@ import (
)
type Config struct {
+ AgentIssuer string
+ AgentTeam string
Home *connect.DecodedCredentials
RunnerReleaseDir string
ExecutionEnabled bool
@@ -52,7 +54,7 @@ type Config struct {
}
func LoadConfig(getenv func(string) string) (Config, error) {
- cfg := Config{RunnerReleaseDir: getenv("EQUIPO_RUNNER_RELEASE_DIR"),
+ cfg := Config{AgentIssuer: getenv("EQUIPO_AGENT_ISSUER"), AgentTeam: getenv("EQUIPO_AGENT_TEAM"), RunnerReleaseDir: getenv("EQUIPO_RUNNER_RELEASE_DIR"),
ExecutionEnabled: getenv("EQUIPO_EXECUTION_ENABLED") == "1",
ExecutionMarkerPath: getenv("EQUIPO_EXECUTION_MARKER_PATH"),
Origin: strings.TrimSpace(getenv("EQUIPO_ORIGIN")),
@@ -114,6 +116,9 @@ func LoadConfig(getenv func(string) string) (Config, error) {
}
func (cfg Config) validate() error {
+ if _, err := validatedAgentConfig(cfg); err != nil {
+ return err
+ }
if strings.TrimSpace(cfg.InstanceKey) == "" {
//lint:ignore ST1005 User-facing errors preserve the reviewed sentences in copy.go.
return errors.New(copyMissingKey)
diff --git a/internal/equipo/copy.go b/internal/equipo/copy.go
index 4c4d45a4..e89163a3 100644
--- a/internal/equipo/copy.go
+++ b/internal/equipo/copy.go
@@ -70,6 +70,11 @@ const BootLog = "Equipo could not start."
// COPY APPROVED BY DELEGATION (Luna pass, 2026-11-01, house rules).
var pageCopy = map[string]string{
+ "agent.equipo_projects_list": "List the team's current projects.", // COPY REVIEW PENDING
+ "agent.equipo_tasks_list": "List the team's recent tasks.", // COPY REVIEW PENDING
+ "agent.equipo_task_get": "Read one task and its current details.", // COPY REVIEW PENDING
+ "agent.equipo_needs_you": "Read recent tasks waiting for this person.", // COPY REVIEW PENDING
+
"work.reason.preview_headers": "the preview host needs an update before it can apply the required security headers", // COPY ACCEPTED BY DELEGATION (Astra, 2026-11-19)
"autonomy.auto_merge_sensitive": "Auto-merge sensitive changes", // COPY ACCEPTED BY DELEGATION (Astra, 2026-11-19)
"autonomy.auto_merge_sensitive_help": "Allow changes to sensitive files to merge when trusted checks pass.", // COPY ACCEPTED BY DELEGATION (Astra, 2026-11-19)
@@ -2805,3 +2810,14 @@ func RunnerSetupCopy(key string) string { return copyText(key) }
// COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context): onboarding.first_instructions
var copyOnboardingFirstInstructions = pageCopy["onboarding.first_instructions"]
+
+const (
+ copyAgentConfig = "Configure agent access with a Home identity, an HTTPS issuer, and a Home team SQID." // COPY REVIEW PENDING
+ copyAgentForbidden = "This connection cannot read this team's work." // COPY REVIEW PENDING
+ copyAgentNotFound = "This operation or task is unavailable." // COPY REVIEW PENDING
+ copyAgentUnavailable = "Equipo could not read the current access or work." // COPY REVIEW PENDING
+ copyAgentTooLarge = "This result exceeds 1 MiB. Ask for fewer items." // COPY REVIEW PENDING
+ copyAgentInvalid = "Send valid operation arguments." // COPY REVIEW PENDING
+ copyAgentMedia = "Send application/json." // COPY REVIEW PENDING
+ copyAgentUnauthenticated = "Connect to Oficina first." // COPY REVIEW PENDING
+)
diff --git a/internal/equipo/oficinaid/http.go b/internal/equipo/oficinaid/http.go
index 4ea4d256..80ad7edf 100644
--- a/internal/equipo/oficinaid/http.go
+++ b/internal/equipo/oficinaid/http.go
@@ -107,6 +107,7 @@ func (h *HTTP) guard(next http.HandlerFunc) http.HandlerFunc {
func (h *HTTP) Routes(r chi.Router) {
r.Post(NativePath, h.NativeExchange)
r.Get("/auth/home", h.guard(h.Start))
+ r.Get("/auth/start", h.guard(h.Start))
r.Handle("/auth/assertion", h.guard(h.Callback))
r.Get("/auth/finish", h.guard(h.Finish))
r.Get(settingsPath, h.guard(h.Settings))