oficina / equipo Public

Merge branch 'assistant-resume-after-connect' into main

Merge assistant-resume-after-connect: carry on after connecting

When an Oficina connect card settles as connected, one Assistant turn
finishes the request that needed it; no person-visible message.
Astra reviewed (3 rounds); CI passed.
claude agent, operated by paul@keymail.dev 9f7e04a6150daf84b548aa10e153d10776e9d6d6 parent 0cee811parent 06a7917
14 files changed, +568 −17
  • .rastrillo/budgets.txt +3 −3
  • internal/equipo/chat/assistant_http.go +13 −0
  • internal/equipo/chat/assistant_tools.go +11 −5
  • internal/equipo/chat/connect.go +86 −3
  • internal/equipo/chat/http.go +4 −0
  • internal/equipo/chat/models.go +1 −1
  • internal/equipo/chat/tools.go +3 −0
  • internal/equipo/chat_wiring.go +1 −1
  • internal/equipo/migrations/0092_assistant_connect_turns.sql +5 −0
  • internal/equipo/migrations/schema.sql +2 −0
  • internal/equipo/oficina_connect.go +39 −3
  • internal/equipo/store.go +3 −1
  • internal/thintest/assistant_oficina_contract_test.go +3 −0
  • internal/thintest/assistant_oficina_resume_contract_test.go +394 −0

CI passed — 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/empty-state-no-box: Type  Size Avail | ext4   96G   86G
ci-box: disk /home/ci/.cache/equipo-ci-box: Type  Size Avail | ext4   96G   86G
ci-box: bwrap: fetched and verified in 0.3s
ci-box: claude: fetched and verified in 2.1s
ci-box: codex: fetched and verified in 3.4s
ci-box: codex-code-mode-host: fetched and verified in 1.3s
ci-box: libwrap: fetched and verified in 0.3s
ci-box: socat: fetched and verified in 0.3s
npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead
ci-box: image pulled in 9.7s
ci-box: pi: installed and verified in 7.5s
ci-box: opencode: installed and verified in 1.9s
ci-box: chromium 156.0.8078.79-1~deb13u1: 76 packages fetched, verified and unpacked in 8.6s
ci-box: clone deepened in 5.0s
ci-box: file times set from content: 2671 files, 173 directories
ci-box: ready in 19.1s
=== copy ===
EQUIPO_RELEASE_COPY_CHECK=1 CGO_ENABLED=0 go test ./internal/equipotest -run '^TestReleaseCopyReviewed$' -count=1
ok  	amadan.net/oficina/equipo/internal/equipotest	0.240s
=== compile ===
go build ./...
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py compile
+ go build -tags testbuild ./...
  1.0s
+ go list -export -test -tags testbuild -f  ./...
  0.5s
+ go list -export -test -tags browser,testbuild -f  ./internal/headless ./internal/idtest ./internal/plan3test ./internal/thintest
  0.2s
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
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed

receipt: test step 1m17.612s 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 1m16.132s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m16.13s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 36.40, cpu waiting 20.95%, memory waiting 0.00%, io waiting 1.98%
--- 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
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed

receipt: test step 1m19.753s 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 1m18.258s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m18.26s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 35.41, cpu waiting 20.82%, memory waiting 0.00%, io waiting 1.91%
--- 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
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed

receipt: test step 1m21.524s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m19.534s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m9.29s amadan.net/oficina/equipo/internal/headless TestHeadlessConnections
receipt: slow test 5.67s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenPasteEndToEnd
receipt: slow test 4.57s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenConnection
machine: 32 CPUs, load 35.41, cpu waiting 20.40%, memory waiting 0.00%, io waiting 1.85%
--- 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
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed

receipt: test step 1m16.964s 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 1m15.421s amadan.net/oficina/equipo/internal/headless
receipt: slow test 36.25s amadan.net/oficina/equipo/internal/headless TestMacWorker
receipt: slow test 19.66s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 10.09s amadan.net/oficina/equipo/internal/headless TestHeadlessAttachments
receipt: slow test 9.42s amadan.net/oficina/equipo/internal/headless TestHeadlessPrewarm
machine: 32 CPUs, load 36.40, cpu waiting 20.95%, memory waiting 0.00%, io waiting 1.98%
--- 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
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed

receipt: test step 1m33.882s 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.287s amadan.net/oficina/equipo/internal/headless
receipt: slow test 57.78s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 10.76s amadan.net/oficina/equipo/internal/headless TestHeadlessRunnerKillLeavesNoCopies
receipt: slow test 9.63s amadan.net/oficina/equipo/internal/headless TestHeadlessCopyRotation
receipt: slow test 8.44s amadan.net/oficina/equipo/internal/headless TestHeadlessPolicyGuards
receipt: slow test 5.67s amadan.net/oficina/equipo/internal/headless TestHeadlessNewHouseRuleStartsFresh
machine: 32 CPUs, load 31.62, cpu waiting 17.18%, memory waiting 0.00%, io waiting 1.51%
--- 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
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed

receipt: test step 3m1.541s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 2m59.67s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m43.94s amadan.net/oficina/equipo/internal/headless TestHeadlessAssistant
receipt: slow test 23.19s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 11.05s amadan.net/oficina/equipo/internal/headless TestHeadlessResearchHandoff
receipt: slow test 7.91s amadan.net/oficina/equipo/internal/headless TestHeadlessClaudeSignIn
receipt: slow test 7.21s amadan.net/oficina/equipo/internal/headless TestHeadlessTurnBatching
machine: 32 CPUs, load 9.08, cpu waiting 4.00%, memory waiting 0.00%, io waiting 0.34%
--- 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 356ms against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 2m0.258s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 7.7s amadan.net/oficina/equipo/internal/thintest TestContractTeamJobSettledStates
receipt: slow test 6.73s amadan.net/oficina/equipo/internal/thintest TestExplorePreviewsOff
receipt: slow test 4.38s amadan.net/oficina/equipo/internal/thintest TestContractTeamNudgePersonNeeds
receipt: slow test 3.66s amadan.net/oficina/equipo/internal/thintest TestContractPreviewHeldUntilPublishAnswer
receipt: slow test 2.43s amadan.net/oficina/equipo/internal/thintest TestResearchDoneFallsBack
machine: 32 CPUs, load 1.03, cpu waiting 0.16%, memory waiting 0.00%, io waiting 6.99%
--- 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 310ms against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 1m9.226s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 6.87s amadan.net/oficina/equipo/internal/thintest TestContractPreviewNotScheduled
receipt: slow test 3.74s amadan.net/oficina/equipo/internal/thintest TestContractMacRecheckMergeAuthority
receipt: slow test 2.34s amadan.net/oficina/equipo/internal/thintest TestContractPreview
receipt: slow test 2.12s amadan.net/oficina/equipo/internal/thintest TestContractHostedBindingRules
receipt: slow test 1.77s amadan.net/oficina/equipo/internal/thintest TestContractTokenConnection
machine: 32 CPUs, load 1.03, cpu waiting 0.16%, memory waiting 0.00%, io waiting 6.99%
--- 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 4m14.591s, over the 45s its record on line 44 allows; reported only, timing fails on CI

receipt: test step 4m27.079s 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 4m14.591s amadan.net/oficina/equipo/internal/runner/thin
receipt: slow test 36.74s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeAnsweredByAnotherModel
receipt: slow test 36.68s amadan.net/oficina/equipo/internal/runner/thin TestModelsEngineeringProbesThenRunsTheStrongest
receipt: slow test 36.62s amadan.net/oficina/equipo/internal/runner/thin TestModelsUnhealthyRetriedOnDemand
receipt: slow test 18.37s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeRunsInsideTheAdmission
receipt: slow test 6.64s amadan.net/oficina/equipo/internal/runner/thin TestOpenCodeStepsRealOpenCode
machine: 32 CPUs, load 2.69, cpu waiting 0.95%, memory waiting 0.00%, io waiting 0.07%
--- 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 46.841s 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 45.821s amadan.net/oficina/equipo/internal/runner
receipt: slow test 25.79s amadan.net/oficina/equipo/internal/runner TestDirectBugWorkflow
receipt: slow test 20.02s amadan.net/oficina/equipo/internal/runner TestEnrolKeepsTheRole
machine: 32 CPUs, load 31.33, cpu waiting 20.71%, memory waiting 0.00%, io waiting 3.26%
--- 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 46.794s 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 44.918s amadan.net/oficina/equipo/internal/runner
receipt: slow test 35.01s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowCandidateOrder
receipt: slow test 32.12s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowFeature
receipt: slow test 8.39s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryCallRefusalKeepsServing
receipt: slow test 1.51s amadan.net/oficina/equipo/internal/runner TestCoordinatorRefusalMatrix
machine: 32 CPUs, load 31.33, cpu waiting 20.71%, memory waiting 0.00%, io waiting 3.26%
--- 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 34.883s 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.025s amadan.net/oficina/equipo/internal/runner
receipt: slow test 5.12s amadan.net/oficina/equipo/internal/runner TestDirectFaultIsolation
receipt: slow test 3.46s amadan.net/oficina/equipo/internal/runner TestClaimRefusalsBackOff
receipt: slow test 3.11s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryRefusedKeepsServing
receipt: slow test 2.22s amadan.net/oficina/equipo/internal/runner TestToolVerbUnderFakeHarness
receipt: slow test 1.61s amadan.net/oficina/equipo/internal/runner TestReportPostsRetryExactRequest
machine: 32 CPUs, load 24.44, cpu waiting 14.69%, memory waiting 0.00%, io waiting 3.99%
--- 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 28.5%, load 19.43
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
cache miss: amadan.net/oficina/equipo/internal/equipotest: its inputs changed

receipt: test step 1m2.828s 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 1m0.832s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 25.32s amadan.net/oficina/equipo/internal/equipotest TestAuthorityCoreIntegration
receipt: slow test 25.2s amadan.net/oficina/equipo/internal/equipotest TestBootstrapNamesOwnersSetting
receipt: slow test 23.33s amadan.net/oficina/equipo/internal/equipotest TestAccountLabelMigration
receipt: slow test 21.15s amadan.net/oficina/equipo/internal/equipotest TestBudgetConfigurationFailuresAreAtomic
receipt: slow test 20.85s amadan.net/oficina/equipo/internal/equipotest TestAuthProductionConfig
machine: 32 CPUs, load 31.62, cpu waiting 17.18%, memory waiting 0.00%, io waiting 1.51%
--- 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 28.5%, load 19.43
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 511ms against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 1m10.964s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 18.41s amadan.net/oficina/equipo/internal/equipotest TestProjectConcurrentRetry
receipt: slow test 18.37s amadan.net/oficina/equipo/internal/equipotest TestProjectWritesRequireCurrentOwner
receipt: slow test 18.33s amadan.net/oficina/equipo/internal/equipotest TestProjectsReopen
receipt: slow test 18.33s amadan.net/oficina/equipo/internal/equipotest TestProjectBindingUniqueness
receipt: slow test 18.25s amadan.net/oficina/equipo/internal/equipotest TestProjectRetryAndRevision
machine: 32 CPUs, load 19.43, cpu waiting 11.57%, memory waiting 0.00%, io waiting 4.26%
--- 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 27.9%, load 19.43
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
cache miss: amadan.net/oficina/equipo/internal/equipotest: its inputs changed

receipt: test step 1m13.332s 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 1m2.195s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 14.86s amadan.net/oficina/equipo/internal/equipotest TestReleaseStampContract
receipt: slow test 12.29s amadan.net/oficina/equipo/internal/equipotest TestRosterChangesAffectExistingSession
receipt: slow test 9.24s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalWhileAssigned
receipt: slow test 9.19s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalRollsBack
receipt: slow test 6.16s amadan.net/oficina/equipo/internal/equipotest TestRosterBootstrapOnce
machine: 32 CPUs, load 29.57, cpu waiting 14.61%, memory waiting 0.00%, io waiting 1.28%
--- 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 28.5%, load 19.43
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 365ms against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 1m4.469s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 23.76s amadan.net/oficina/equipo/internal/equipotest TestSigninNoProof
receipt: slow test 22.8s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedExistingTeam
receipt: slow test 22.8s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedRollback
receipt: slow test 21.23s amadan.net/oficina/equipo/internal/equipotest TestSpecialistSettingsRollbackAndUnavailable
receipt: slow test 21.21s amadan.net/oficina/equipo/internal/equipotest TestSpecialistSettingsConcurrentRevision
machine: 32 CPUs, load 19.43, cpu waiting 11.57%, memory waiting 0.00%, io waiting 4.26%
--- 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 28.5%, load 19.43
test lane plan3test: ./internal/plan3test
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m ./internal/plan3test

receipt: test step 722ms against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 48.219s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 3.46s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3B
receipt: slow test 3.41s amadan.net/oficina/equipo/internal/plan3test TestPlan3Upgrade
receipt: slow test 1.43s amadan.net/oficina/equipo/internal/plan3test TestConversationQuestionRace
receipt: slow test 1.41s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3A
receipt: slow test 1.18s amadan.net/oficina/equipo/internal/plan3test TestPlanMigrationUpgrade
machine: 32 CPUs, load 19.43, cpu waiting 11.57%, memory waiting 0.00%, io waiting 4.26%
--- 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 28.5%, load 19.43
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/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/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/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/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/copydesk: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/opencode: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/forge: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/equipo/team: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/claude: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/workspace: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/codex: 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
budget note: internal/equipo took 17.559s, over the 10s the default allows (measured on the run this cached result came from); reported only, timing fails on CI
budget note: internal/idtest took 37.363s, 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 37.953s, over the 15s its record on line 40 allows; reported only, timing fails on CI

receipt: test step 2m14.29s against a 60s target (the gate's other steps are not in this figure)
receipt: 11 packages ran, 48 cached, 18 without tests, 0 failed
receipt: slow package 52.036s amadan.net/oficina/equipo/internal/runner/provider/opencode
receipt: slow package 51.552s amadan.net/oficina/equipo/internal/runner/provider/pi
receipt: slow package 37.953s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow package 37.363s amadan.net/oficina/equipo/internal/idtest
receipt: slow package 35.805s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow test 20.79s amadan.net/oficina/equipo/internal/runner/provider/opencode TestOpenCodeAcceptanceHostileRepository
receipt: slow test 14.74s amadan.net/oficina/equipo/internal/runner/containment TestEngineeringOfflineGo
receipt: slow test 13.41s amadan.net/oficina/equipo/cmd/equipo-runner TestReleaseRunnerHasNoFakeWorker
receipt: slow test 11.04s amadan.net/oficina/equipo/internal/idtest TestIDCallbackGuardAndPendingNonce
receipt: slow test 8.96s amadan.net/oficina/equipo/internal/runner/containment TestEngineeringMissingModuleCache
machine: 32 CPUs, load 11.47, cpu waiting 5.22%, memory waiting 0.00%, io waiting 0.45%
--- 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
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed

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

receipt: test step 1m29.152s 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.776s amadan.net/oficina/equipo/internal/headless
receipt: slow test 25.17s amadan.net/oficina/equipo/internal/headless TestBrowserRailFollowsWork
receipt: slow test 21.64s amadan.net/oficina/equipo/internal/headless TestBrowserTaskThread
receipt: slow test 14s amadan.net/oficina/equipo/internal/headless TestBrowserReceiptFollowsReview
receipt: slow test 9.81s amadan.net/oficina/equipo/internal/headless TestBrowserAskAfterMerge
receipt: slow test 7.69s amadan.net/oficina/equipo/internal/headless TestBrowserTaskCard
machine: 32 CPUs, load 33.33, cpu waiting 17.73%, memory waiting 0.00%, io waiting 1.56%
--- 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
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed

receipt: test step 1m38.591s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m37.011s amadan.net/oficina/equipo/internal/headless
receipt: slow test 13.38s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsConversation
receipt: slow test 12.79s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAddPage
receipt: slow test 12.67s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAdd
receipt: slow test 10.31s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsMeteredLimitRequired
receipt: slow test 10.11s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsOpenCodeGoLimitRequired
machine: 32 CPUs, load 29.57, cpu waiting 15.58%, memory waiting 0.00%, io waiting 1.37%
--- 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
rastrillo: budget test: go test failed
--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserCopyContinue
=== RUN   TestBrowserCopyContinue
time=2026-11-19T12:07:01.558Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-19T12:07:01.558Z level=INFO msg="startup phase done" phase=state_lock took=214µs
time=2026-11-19T12:07:01.558Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-19T12:07:01.558Z level=INFO msg="startup phase done" phase=claim_roots took=192µs
time=2026-11-19T12:07:01.558Z level=INFO msg="startup phase" phase=sweep
time=2026-11-19T12:07:01.595Z level=INFO msg="startup phase done" phase=sweep took=36.532ms
time=2026-11-19T12:07:01.595Z level=INFO msg="startup phase" phase=credentials
time=2026-11-19T12:07:01.595Z level=INFO msg="startup phase done" phase=credentials took=185µs
time=2026-11-19T12:07:01.595Z level=INFO msg="startup phase" phase=open_state
time=2026-11-19T12:07:01.639Z level=INFO msg="startup phase done" phase=open_state took=43.088ms
time=2026-11-19T12:07:01.639Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-19T12:07:01.641Z level=INFO msg=connecting host=127.0.0.1:41623 protocol=26
time=2026-11-19T12:07:01.642Z level=INFO msg=connected host=127.0.0.1:41623 took=839µs
time=2026-11-19T12:07:01.642Z level=INFO msg="capabilities gathering"
time=2026-11-19T12:07:01.643Z level=INFO msg="capabilities gathered" took=761µs tags=linux,claude,go
time=2026-11-19T12:07:01.643Z level=INFO msg="hello sent" protocol=26
time=2026-11-19T12:07:01.650Z level=INFO msg=welcome protocol=26 role=primary generation=1
    browser_copy_test.go:93: continue did not reach Checks: 0 <nil>
--- FAIL: TestBrowserCopyContinue (1.76s)

--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserEmptyExplore
=== RUN   TestBrowserEmptyExplore
time=2026-11-19T12:07:32.078Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-19T12:07:32.078Z level=INFO msg="startup phase done" phase=state_lock took=185µs
time=2026-11-19T12:07:32.078Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-19T12:07:32.078Z level=INFO msg="startup phase done" phase=claim_roots took=197µs
time=2026-11-19T12:07:32.078Z level=INFO msg="startup phase" phase=sweep
time=2026-11-19T12:07:32.107Z level=INFO msg="startup phase done" phase=sweep took=29.172ms
time=2026-11-19T12:07:32.107Z level=INFO msg="startup phase" phase=credentials
time=2026-11-19T12:07:32.107Z level=INFO msg="startup phase done" phase=credentials took=102µs
time=2026-11-19T12:07:32.107Z level=INFO msg="startup phase" phase=open_state
time=2026-11-19T12:07:32.147Z level=INFO msg="startup phase done" phase=open_state took=39.224ms
time=2026-11-19T12:07:32.147Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-19T12:07:32.148Z level=INFO msg=connecting host=127.0.0.1:36855 protocol=26
time=2026-11-19T12:07:32.149Z level=INFO msg=connected host=127.0.0.1:36855 took=915µs
time=2026-11-19T12:07:32.149Z level=INFO msg="capabilities gathering"
time=2026-11-19T12:07:32.150Z level=INFO msg="capabilities gathered" took=399µs tags=linux,claude,go
time=2026-11-19T12:07:32.151Z level=INFO msg="hello sent" protocol=26
time=2026-11-19T12:07:32.154Z level=INFO msg=welcome protocol=26 role=primary generation=1
time=2026-11-19T12:07:33.113Z 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.80s)

--- FAIL amadan.net/oficina/equipo/internal/headless (package output)
FAIL
rastrillo-budget/v1 ran 1m25.423s
FAIL	amadan.net/oficina/equipo/internal/headless	85.696s


receipt: test step 1m26.668s 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 1m25.423s amadan.net/oficina/equipo/internal/headless
receipt: slow test 15.04s amadan.net/oficina/equipo/internal/headless TestBrowserThinkingAndCards
receipt: slow test 10.95s amadan.net/oficina/equipo/internal/headless TestBrowserWaitingTurns
receipt: slow test 10.32s amadan.net/oficina/equipo/internal/headless TestBrowserMoveIn
receipt: slow test 10.31s amadan.net/oficina/equipo/internal/headless TestBrowserStalePageReloads
receipt: slow test 7.93s 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 9f7e04a6150daf84b548aa10e153d10776e9d6d6 1.76s 34.49
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
##############################################################################
FLAKE ./internal/headless:TestBrowserEmptyExplore browser-headless-rest 9f7e04a6150daf84b548aa10e153d10776e9d6d6 5.80s 34.49
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 29.57, cpu waiting 15.58%, memory waiting 0.00%, io waiting 1.37%
--- 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/idtest
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserOficinaIDDoor)$' ./internal/idtest

receipt: test step 269ms against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 1.571s amadan.net/oficina/equipo/internal/idtest
receipt: slow test 1.57s 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 255ms against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 1.833s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 1.83s 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|TestBrowserCoordinatorQueue|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|TestBrowserThinkingWords|TestBrowserTokenRowEmail|TestBrowserTrackStarCentre)$' ./internal/thintest

receipt: test step 280ms against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 2m55.941s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 16.93s amadan.net/oficina/equipo/internal/thintest TestBrowserAccessRequest
receipt: slow test 14.32s amadan.net/oficina/equipo/internal/thintest TestBrowserSettingsTeams
receipt: slow test 10.96s amadan.net/oficina/equipo/internal/thintest TestBrowserPlacementQuestionAndPending
receipt: slow test 9.01s amadan.net/oficina/equipo/internal/thintest TestBrowserThinkingCycles
receipt: slow test 8.28s amadan.net/oficina/equipo/internal/thintest TestBrowserInnerScreens
machine: 32 CPUs, load 1.03, cpu waiting 1.20%, memory waiting 0.00%, io waiting 6.79%
--- 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   (52s)
ok ./internal/headless TestHeadlessConnections/A5_cancel_and_sign_out 5.26s
ok ./internal/headless TestHeadlessConnections/C4_claude_sign_in 1.31s
ok ./internal/headless TestHeadlessConnections/C5_engineering_failover 9.12s
ok ./internal/headless TestHeadlessConnections/C5_engineering_to_codex 10.07s
ok ./internal/headless TestHeadlessConnections/C5_engineering_waits 24.75s
+ 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   (53s)
ok ./internal/headless TestHeadlessConnections/C5_review_auth 14.09s
ok ./internal/headless TestHeadlessConnections/C5_review_failover 12.54s
ok ./internal/headless TestHeadlessConnections/C5_review_on_codex 11.07s
ok ./internal/headless TestHeadlessConnections/C5_review_other_family_first 13.29s
+ go test -tags testbuild -timeout 15m -v -run '^TestMixedVersions$' ./internal/headless   (21s)
ok ./internal/headless TestMixedVersions 19.98s
+ go test -tags testbuild -timeout 15m -v -run '^TestCheckSandboxDeniedPathsTampering$' ./internal/runner/checks   (1s)
ok ./internal/runner/checks TestCheckSandboxDeniedPathsTampering 0.76s
+ go test -tags testbuild -timeout 15m -v -run '^TestRunnerCancelAndSupersede$' ./internal/runner/thin   (0s)
ok ./internal/runner/thin TestRunnerCancelAndSupersede 0.05s
quarantine: 0 flaked (passed on the retry), 0 failed
machine: 32 CPUs, load 34.97, cpu waiting 21.74%, memory waiting 0.00%, io waiting 2.85%
--- 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 8.197s 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.245s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow package 162ms amadan.net/oficina/equipo/internal/runner/provider/claude
receipt: slow package 79ms amadan.net/oficina/equipo/internal/runner/provider/codex
receipt: slow package 1ms amadan.net/oficina/equipo/internal/runner/provider
receipt: slow package 0s amadan.net/oficina/equipo/internal/runner/provider/gotoolchain
receipt: slow test 5.21s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsGoFixture
receipt: slow test 1.65s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPaths
receipt: slow test 290ms amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsCache
receipt: slow test 160ms amadan.net/oficina/equipo/internal/runner/provider/claude TestDirectJournalAdapterBarrier
receipt: slow test 80ms 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.024s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 2.675s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow test 280ms 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 TestNamespaceDirectPolicyAdmission
receipt: slow test 100ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryReusedPID
receipt: slow test 100ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryCleansScratch
machine: 32 CPUs, load 6.95, cpu waiting 4.64%, memory waiting 0.00%, io waiting 5.75%
--- 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 28.5%, load 19.43
shard 25: make runner-dead-references lanes-check build vet fmt-check budget migration-check
python3 scripts/runner-dead-references.py
reference scan: 2385 text files, 2744 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: 86 directories within budget
CGO_ENABLED=0 go test ./internal/equipo -run '^TestMigrationModels$' -count=1
ok  	amadan.net/oficina/equipo/internal/equipo	2.405s
machine: 32 CPUs, load 31.33, cpu waiting 20.33%, memory waiting 0.00%, io waiting 3.37%
--- 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 28.5%, load 19.43
shard 26: make staticcheck
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -tags browser,perf,testbuild ./...
machine: 32 CPUs, load 19.43, cpu waiting 13.12%, memory waiting 0.00%, io waiting 4.12%
--- 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 28.5%, load 19.43
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 24.44, cpu waiting 15.98%, memory waiting 0.00%, io waiting 3.85%
--- 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 27.9%, load 19.43
shard 28: make gitleaks
12:06PM INF Unknown SCM platform. Use --platform to include links in findings. host=amadan.net
12:07PM INF 994 commits scanned.
12:07PM INF scanned ~59458385 bytes (59.46 MB) in 13s
12:07PM INF no leaks found
machine: 32 CPUs, load 28.49, cpu waiting 19.56%, memory waiting 0.00%, io waiting 3.49%
=== perf ===
go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -no-time -require TestPerfScreens,TestPerfBoot -tags perf -count=1 -p 1 -parallel 1 -run '^TestPerf' ./...
perf: GET /: median 1.031ms, worst 1.108ms, budget 150ms
perf: GET /api/runner/protocol: median 73µs, worst 106µs, budget 150ms
perf: GET /api/v1/account-setups/{id}: median 575µs, worst 642µs, budget 150ms
perf: GET /api/v1/accounts: median 403µs, worst 423µs, budget 150ms
perf: GET /api/v1/auth/devices: median 447µs, worst 503µs, budget 150ms
perf: GET /api/v1/budgets: median 487µs, worst 548µs, budget 150ms
perf: GET /api/v1/capabilities: median 248µs, worst 275µs, budget 150ms
perf: GET /api/v1/cards/{id}: median 1.226ms, worst 1.276ms, budget 150ms
perf: GET /api/v1/connections: median 569µs, worst 607µs, budget 150ms
perf: GET /api/v1/connections/{id}: median 522µs, worst 556µs, budget 150ms
perf: GET /api/v1/conversation: median 924µs, worst 969µs, budget 150ms
perf: GET /api/v1/conversation/cards: median 1.445ms, worst 1.508ms, budget 150ms
perf: GET /api/v1/coordinator: median 1.925ms, worst 2.055ms, budget 150ms
perf: GET /api/v1/invites/{id}: median 460µs, worst 485µs, budget 150ms
perf: GET /api/v1/journey: median 7.889ms, worst 8.062ms, budget 150ms
perf: GET /api/v1/me: median 446µs, worst 486µs, budget 150ms
perf: GET /api/v1/me/settings: median 529µs, worst 580µs, budget 150ms
perf: GET /api/v1/needs-you: median 7.708ms, worst 9.8ms, budget 150ms
perf: GET /api/v1/notifications: median 1.634ms, worst 1.796ms, budget 150ms
perf: GET /api/v1/onboarding: median 408µs, worst 445µs, budget 150ms
perf: GET /api/v1/people: median 441µs, worst 468µs, budget 150ms
perf: GET /api/v1/playbooks: median 591µs, worst 615µs, budget 150ms
perf: GET /api/v1/playbooks/{id}: median 531µs, worst 567µs, budget 150ms
perf: GET /api/v1/playbooks/{id}/template-diff: median 848µs, worst 914µs, budget 150ms
perf: GET /api/v1/preferences: median 746µs, worst 767µs, budget 150ms
perf: GET /api/v1/projects/{id}: median 461µs, worst 509µs, budget 150ms
perf: GET /api/v1/projects/{id}/settings: median 569µs, worst 594µs, budget 150ms
perf: GET /api/v1/roster: median 453µs, worst 512µs, budget 150ms
perf: GET /api/v1/runners/{id}: median 427µs, worst 464µs, budget 150ms
perf: GET /api/v1/specialists: median 7.909ms, worst 7.985ms, budget 150ms
perf: GET /api/v1/specialists/{id}: median 7.741ms, worst 7.809ms, budget 150ms
perf: GET /api/v1/specialists/{id}/template-diff: median 821µs, worst 870µs, budget 150ms
perf: GET /api/v1/tasks/{id}/plan: median 1.059ms, worst 1.157ms, budget 150ms
perf: GET /api/v1/tasks/{id}/thread: median 701µs, worst 735µs, budget 150ms
perf: GET /api/v1/teams: median 412µs, worst 437µs, budget 150ms
perf: GET /api/v1/templates: median 571µs, worst 607µs, budget 150ms
perf: GET /api/v1/templates/{id}: median 416µs, worst 455µs, budget 150ms
perf: GET /auth/callback: median 72µs, worst 85µs, budget 150ms
perf: GET /auth/devices/{id}: median 2.992ms, worst 3.046ms, budget 150ms
perf: GET /auth/verify: median 84µs, worst 97µs, budget 150ms
perf: GET /connections: median 3.29ms, worst 3.334ms, budget 150ms
perf: GET /conversation: median 6.719ms, worst 6.987ms, budget 150ms
perf: GET /conversation/connections: median 232µs, worst 259µs, budget 150ms
perf: GET /conversation/notebook: median 240µs, worst 264µs, budget 150ms
perf: GET /conversation/settings: median 3.607ms, worst 3.72ms, budget 150ms
perf: GET /conversation/settings/connections: median 5.903ms, worst 8.242ms, budget 150ms
perf: GET /conversation/settings/connections/add: median 6.051ms, worst 6.172ms, budget 150ms
perf: GET /conversation/settings/copy: median 3.299ms, worst 3.407ms, budget 150ms
perf: GET /conversation/settings/housekeeping: median 3.752ms, worst 3.934ms, budget 150ms
perf: GET /conversation/settings/machines: median 4.078ms, worst 4.165ms, budget 150ms
perf: GET /conversation/settings/machines/add: median 4.018ms, worst 4.158ms, budget 150ms
perf: GET /conversation/settings/notebook: median 3.034ms, worst 3.141ms, budget 150ms
perf: GET /conversation/settings/thinking: median 3.651ms, worst 3.793ms, budget 150ms
perf: GET /housekeeping: median 3.422ms, worst 3.503ms, budget 150ms
perf: GET /invites/new: median 584µs, worst 615µs, budget 150ms
perf: GET /invites/{id}: median 614µs, worst 646µs, budget 150ms
perf: GET /jobs: median 3.254ms, worst 5.757ms, budget 150ms
perf: GET /jobs/{id}: median 4.258ms, worst 4.382ms, budget 150ms
perf: GET /journey: median 9.719ms, worst 9.845ms, budget 150ms
perf: GET /nav/rail: median 2.642ms, worst 2.73ms, budget 150ms
perf: GET /needs-you: median 9.44ms, worst 9.528ms, budget 150ms
perf: GET /onboarding: median 3.63ms, worst 3.692ms, budget 150ms
perf: GET /people: median 2.998ms, worst 3.074ms, budget 150ms
perf: GET /playbook-suggestions/{suggestion}: median 4.147ms, worst 4.282ms, budget 150ms
perf: GET /playbooks: median 3.859ms, worst 3.933ms, budget 150ms
perf: GET /playbooks/new: median 3.991ms, worst 4.324ms, budget 150ms
perf: GET /playbooks/{id}: median 4.338ms, worst 4.495ms, budget 150ms
perf: GET /playbooks/{id}/edit: median 4.344ms, worst 4.412ms, budget 150ms
perf: GET /playbooks/{id}/template-diff: median 3.487ms, worst 3.558ms, budget 150ms
perf: GET /preferences: median 3.91ms, worst 3.92ms, budget 150ms
perf: GET /preferences/sources/{source}: median 3.687ms, worst 3.804ms, budget 150ms
perf: GET /projects: median 4.693ms, worst 4.857ms, budget 150ms
perf: GET /projects/accounts: median 3.305ms, worst 3.38ms, budget 150ms
perf: GET /projects/new: median 3.283ms, worst 3.313ms, budget 150ms
perf: GET /projects/{id}: median 11.29ms, worst 14.554ms, budget 150ms
perf: GET /projects/{id}/edit: median 3.563ms, worst 3.631ms, budget 150ms
perf: GET /runners/enrol: median 4.113ms, worst 4.187ms, budget 150ms
perf: GET /settings: median 3.168ms, worst 3.242ms, budget 150ms
perf: GET /settings/coordinator: median 5.092ms, worst 5.278ms, budget 150ms
perf: GET /settings/devices: median 2.963ms, worst 3.087ms, budget 150ms
perf: GET /settings/recovery: median 3.072ms, worst 3.246ms, budget 150ms
perf: GET /settings/recovery/release: median 3.088ms, worst 3.246ms, budget 150ms
perf: GET /settings/thinking: median 237µs, worst 260µs, budget 150ms
perf: GET /signin: median 306µs, worst 358µs, budget 150ms
perf: GET /specialists/new: median 3.082ms, worst 3.187ms, budget 150ms
perf: GET /specialists/{key}: median 10.223ms, worst 10.44ms, budget 150ms
perf: GET /specialists/{key}/edit: median 3.365ms, worst 5.789ms, budget 150ms
perf: GET /specialists/{key}/template-diff: median 3.586ms, worst 3.706ms, budget 150ms
perf: GET /tasks: median 4.843ms, worst 5.049ms, budget 150ms
perf: GET /tasks/new: median 2.966ms, worst 3.02ms, budget 150ms
perf: GET /tasks/{id}: median 5.167ms, worst 5.314ms, budget 150ms
perf: GET /tasks/{id}/merge: median 4.46ms, worst 4.595ms, budget 150ms
perf: GET /tasks/{id}/move: median 4.18ms, worst 4.269ms, budget 150ms
perf: GET /tasks/{id}/plan: median 5.334ms, worst 5.442ms, budget 150ms
perf: GET /tasks/{id}/questions/{question}: median 4.806ms, worst 4.958ms, budget 150ms
perf: GET /tasks/{id}/rendered-change: median 4.429ms, worst 4.473ms, budget 150ms
perf: GET /tasks/{id}/rendered-change/{hash}.png: median 3.996ms, worst 6.627ms, budget 150ms
perf: GET /tasks/{id}/thread: median 7.664ms, worst 7.768ms, budget 150ms
perf: GET /team/{specialist}: median 3.913ms, worst 4.018ms, budget 150ms
perf: GET /teams: median 9.476ms, worst 9.608ms, budget 150ms
perf: GET /templates: median 3.1ms, worst 3.218ms, budget 150ms
perf: GET /usage: median 3.861ms, worst 3.931ms, budget 150ms
perf: GET /work: median 2.796ms, worst 2.848ms, budget 150ms
perf: cold boot: median 252ms of [250.652461ms 252.034929ms 253.174797ms], budget 500ms

receipt: test step 27.636s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 82 without tests, 0 failed
receipt: slow package 8.499s amadan.net/oficina/equipo/internal/equipotest
receipt: slow package 0s amadan.net/oficina/equipo/cmd/equipo-runner
receipt: slow package 0s amadan.net/oficina/equipo/cmd/equipo-tool-proxy
receipt: slow package 0s amadan.net/oficina/equipo/internal/advice
receipt: slow package 0s amadan.net/oficina/equipo/internal/attach
receipt: slow test 7.7s amadan.net/oficina/equipo/internal/equipotest TestPerfScreens
receipt: slow test 800ms amadan.net/oficina/equipo/internal/equipotest TestPerfBoot
=== cache ===
ci-box: build cache /home/ci/work/repos/oficina__equipo/cache/go-build: 2.72 GiB in 18187 files
ci-box: module cache /home/ci/work/repos/oficina__equipo/cache/go-mod: 0.84 GiB in 27329 files
diff --git a/.rastrillo/budgets.txt b/.rastrillo/budgets.txt
index 5997dd47..b2d9d11f 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 21165 - Shared web views; persisted approval navigation, visible access continuations and the CARLOS mail submission boot. Measured 21165 source lines.
+size internal/equipo 21203 - Shared web views; persisted approval navigation, visible access continuations, the CARLOS mail submission boot and Oficina catch-up. Measured 21203 source lines.
size internal/wire 6544 - Shared protocol types and the optional card approval-visit flag. Runner protocol stays 26; measured 6544 source lines.
size internal/equipotest - 13400 Task 21 repairs historical migration and conversation fixtures after Plan 3. Measured 13024 test lines; the 300s time ceiling is unchanged.
time internal/runner/checks 90s CI worker measured 44.553s (44.6s rounded);
@@ -56,7 +56,7 @@ perf GET /api/v1/tasks/{id} skip Thin v1 person API: bearer-only JSON for device
perf GET /api/v1/assistant/snapshot skip Assistant person API: bearer-only JSON for Base's chat, not a browser screen.
perf GET /api/v1/assistant/messages skip Assistant person API: bearer-only JSON for Base's chat, not a browser screen.
perf GET /api/v1/assistant/events skip Assistant event stream (Server-Sent Events), bearer-only and long-lived; not a screen.
-size internal/equipo/chat 30698 - Transactional access visit, reconnect catch-up and continuation presentation. Measured 30698 source lines.
+size internal/equipo/chat 30807 - Transactional access visit, reconnect catch-up, continuation presentation and the Assistant carrying on after a connect. Measured 30807 source lines.
perf GET /api/v1/questions/{id} skip Thin v1 person API: bearer-only JSON for devices; the browser reads questions on /tasks/{id}.
perf GET /api/v1/steps/{id}/log skip Thin v1 person API: bearer-only JSON for devices; the browser shows the log tail on /tasks/{id}.
perf GET /api/v1/connections/preference skip Connections slice 1 person API: bearer-only JSON for devices; the browser shows the preference on /conversation/connections.
@@ -71,7 +71,7 @@ perf GET /tasks/{id}/files/{file} skip Research kept images: the bytes of one im
perf GET /api/v1/runners skip Mac runners person API: bearer-only JSON for devices; the browser shows runners in the Team section.
time cmd/equipo-runner 60s TestReleaseRunnerHasNoFakeWorker builds the release runner and the thin package under testbuild (about 12s locally).
size internal/headless - 11198 End-to-end scenarios, including approved access through the real runner and server while git is blocked. Measured 11189 test lines.
-size internal/thintest - 31251 Shared instance/browser fixtures, access reload and resume, live queue and emoji byline guards, and the native apps' captured device fixtures. Measured 31251 test lines.
+size internal/thintest - 31648 Shared instance/browser fixtures, access reload and resume, queue and byline guards, native device fixtures, the Assistant carrying on after a connect. Measured 31648 test lines.
perf GET /api/v1/projects/{id}/merge-policy skip Merge authority person API: bearer-only JSON for devices; the browser reads the policy on /projects/{id}.
perf GET /api/v1/usage skip Thin v1 person API: bearer-only JSON for devices; the browser reads usage through /usage.
perf GET /api/v1/advice skip Thin v1 person API: bearer-only JSON for devices; the browser reads advice through /usage and /conversation.
diff --git a/internal/equipo/chat/assistant_http.go b/internal/equipo/chat/assistant_http.go
index c9ec1971..d9ca15bb 100644
--- a/internal/equipo/chat/assistant_http.go
+++ b/internal/equipo/chat/assistant_http.go
@@ -18,6 +18,7 @@ import (
func (h *HTTP) MountAssistant(r chi.Router) {
lane := h.Store.Lane(wire.LaneAssistant)
r.Get("/snapshot", h.bearer(func(w http.ResponseWriter, r *http.Request, p personapi.PersonPrincipal) {
+ h.oficinaCatchUp(r, p)
h.warmAssistant(r, p)
out, err := lane.Snapshot(r.Context(), p.Address)
if err != nil {
@@ -39,6 +40,7 @@ func (h *HTTP) MountAssistant(r chi.Router) {
h.assistantAnswer(w, r, p, lane)
}))
r.Get("/events", h.bearer(func(w http.ResponseWriter, r *http.Request, p personapi.PersonPrincipal) {
+ h.oficinaCatchUp(r, p)
h.warmAssistant(r, p)
h.stream(w, r, p, lane.lane, lane.Events)
}))
@@ -91,6 +93,17 @@ func (h *HTTP) oficinaConnect(w http.ResponseWriter, r *http.Request, p personap
writeJSON(w, 200, map[string]string{"url": url})
}
+// oficinaCatchUp settles what a failed settlement left open, before the
+// lane is read. The read never waits on it failing.
+func (h *HTTP) oficinaCatchUp(r *http.Request, p personapi.PersonPrincipal) {
+ if h.OficinaCatchUp == nil {
+ return
+ }
+ if err := h.OficinaCatchUp(r.Context(), p.Address); err != nil && h.Logger != nil {
+ h.Logger.Warn("oficina catch-up", "err", err)
+ }
+}
+
// warmAssistant asks the person's runner to warm their Assistant: Base
// read its snapshot or opened its stream, so they are about to use it.
// The read never waits on it failing.
diff --git a/internal/equipo/chat/assistant_tools.go b/internal/equipo/chat/assistant_tools.go
index 7fb66ae7..66d7b405 100644
--- a/internal/equipo/chat/assistant_tools.go
+++ b/internal/equipo/chat/assistant_tools.go
@@ -635,19 +635,25 @@ func (s *Store) runRemote(ctx context.Context, row toolCallRecord) (res wire.Too
return fitFrame(wire.ToolResult{Code: "used", Text: string(out)}), op.ReadOnly
}
-// asked: the call's turn is one the person started, or op is one of the
-// team's updateWrites in a team_update turn (which job it may touch is
-// the operation's own check).
+// asked: the call's turn is one the person started, or the turn queued
+// after they connected the Oficina apps (carryOn), which carries on
+// their request; or op
+// is one of the team's updateWrites in a team_update turn (which job it
+// may touch is the operation's own check).
func (s *Store) asked(ctx context.Context, row toolCallRecord, op assist.Operation) (bool, error) {
var kinds []string
+ var resumed int64
err := s.read(ctx, func(tx *gorm.DB) error {
- return tx.Model(&turnRecord{}).Where("id = ? AND person = ?", row.TurnID, row.Person).Pluck("coalesce(kind, '')", &kinds).Error
+ if err := tx.Model(&turnRecord{}).Where("id = ? AND person = ?", row.TurnID, row.Person).Pluck("coalesce(kind, '')", &kinds).Error; err != nil {
+ return err
+ }
+ return tx.Model(&connectTurnRecord{}).Where("turn_id = ? AND person = ? AND card_id IN (SELECT id FROM chat_cards WHERE person = ? AND kind = ? AND name = ?)", row.TurnID, row.Person, row.Person, wire.CardConnect, OficinaProvider).Count(&resumed).Error
})
if err != nil || len(kinds) != 1 {
return false, err
}
update := kinds[0] == wire.TurnTeamUpdate && op.Provider == teamProvider{}.Name() && slices.Contains(updateWrites, op.Name)
- return kinds[0] == wire.TurnPerson || update, nil
+ return kinds[0] == wire.TurnPerson || kinds[0] == wire.TurnTeamUpdate && resumed == 1 || update, nil
}
// opFailed is a provider's or the registry's failure as a result. An
diff --git a/internal/equipo/chat/connect.go b/internal/equipo/chat/connect.go
index 71013587..efae80f5 100644
--- a/internal/equipo/chat/connect.go
+++ b/internal/equipo/chat/connect.go
@@ -3,10 +3,18 @@ package chat
import (
"context"
"encoding/json"
+ "slices"
+ "time"
"amadan.net/oficina/equipo/internal/wire"
+ "gorm.io/gorm"
)
+// OficinaProvider is the Oficina apps' provider name. Only their
+// connect cards carry the person's request on once they connect
+// (carryOn): the note names them.
+const OficinaProvider = "oficina"
+
// ConnectCard is the Assistant card the instance raises when the person
// asked for something a provider does and has not connected it: the
// question and one link, to start connecting. Provider is kept on the
@@ -61,25 +69,100 @@ func (s *Store) RaiseConnect(ctx context.Context, person string, card ConnectCar
return open && err == nil, err
}
+// connectTurnRecord is the Assistant turn queued once the person
+// connected what a connect card asked for: one per card, the card's id
+// its key, and AskedTurn the person's turn that raised the card.
+type connectTurnRecord struct {
+ CardID string `gorm:"primaryKey"`
+ TurnID string `gorm:"uniqueIndex:chat_connect_turn"`
+ Person string
+ AskedTurn string
+ CreatedAt time.Time
+}
+
+func (connectTurnRecord) TableName() string { return "chat_connect_turns" }
+
// SettleConnect resolves the person's open connect cards for provider:
-// they connected it. A person no longer on the roster settles nothing.
+// they connected it. The Assistant then carries on by itself (ruling
+// 2026-11-19), for the Oficina apps only: one team_update turn in their Assistant lane, queued
+// behind any turn in flight, whose note (noteConnected) has it finish
+// the request that needed the provider. The newest card is the turn's
+// key, so a card settled again queues nothing more. A person no longer
+// on the roster settles nothing.
func (s *Store) SettleConnect(ctx context.Context, person, provider string) error {
+ return s.settleConnect(ctx, person, provider, nil)
+}
+
+// Connected reads, in the settling transaction, when the person's
+// current connection to a provider was last saved; ok is false when
+// they have none.
+type Connected func(tx *gorm.DB) (saved time.Time, ok bool, err error)
+
+// SettleConnectSince is SettleConnect bound to its evidence: in the same
+// transaction, the person's current connection (connected), and only
+// the cards raised by the time it was saved. A card raised after it, or
+// with no connection now, stays open.
+func (s *Store) SettleConnectSince(ctx context.Context, person, provider string, connected Connected) error {
+ return s.settleConnect(ctx, person, provider, connected)
+}
+
+func (s *Store) settleConnect(ctx context.Context, person, provider string, connected Connected) error {
return s.tx(ctx, func(t *txn) error {
if _, err := t.s.authority.Me(t.db, person); err != nil {
return err
}
var cards []cardRecord
- if err := t.db.Where("person = ? AND lane = ? AND kind = ? AND name = ? AND state = ?", person, wire.LaneAssistant, wire.CardConnect, provider, wire.CardOpen).Find(&cards).Error; err != nil {
+ if err := t.db.Where("person = ? AND lane = ? AND kind = ? AND name = ? AND state = ?", person, wire.LaneAssistant, wire.CardConnect, provider, wire.CardOpen).Order("created_at, id").Find(&cards).Error; err != nil {
return err
}
+ if connected != nil {
+ saved, ok, err := connected(t.db)
+ if err != nil || !ok {
+ return err
+ }
+ cards = slices.DeleteFunc(cards, func(c cardRecord) bool { return c.CreatedAt.After(saved) })
+ }
for _, c := range cards {
c.State = wire.CardResolved
if err := t.saveCard(&c); err != nil {
return err
}
}
- return nil
+ if len(cards) == 0 || provider != OficinaProvider {
+ return nil
+ }
+ return t.carryOn(cards[len(cards)-1])
+ })
+}
+
+// ConnectOpen says the person has an open connect card for provider.
+func (s *Store) ConnectOpen(ctx context.Context, person, provider string) (bool, error) {
+ var n int64
+ err := s.read(ctx, func(tx *gorm.DB) error {
+ return tx.Model(&cardRecord{}).Where("person = ? AND lane = ? AND kind = ? AND name = ? AND state = ?", person, wire.LaneAssistant, wire.CardConnect, provider, wire.CardOpen).Count(&n).Error
})
+ return n > 0, err
+}
+
+// carryOn queues the Assistant's turn after card was settled, once per
+// card.
+func (t *txn) carryOn(card cardRecord) error {
+ var n int64
+ if err := t.db.Model(&connectTurnRecord{}).Where("card_id = ?", card.ID).Count(&n).Error; err != nil || n > 0 {
+ return err
+ }
+ now := t.now()
+ r := turnRecord{ID: newID("t_"), Person: card.Person, State: wire.TurnQueued, Attempt: 1, Kind: wire.TurnTeamUpdate, Note: noteConnected, Revision: 1, CreatedAt: now, UpdatedAt: now, Lane: wire.LaneAssistant}
+ if err := t.db.Create(&r).Error; err != nil {
+ return err
+ }
+ if err := t.db.Create(&connectTurnRecord{CardID: card.ID, TurnID: r.ID, Person: card.Person, AskedTurn: card.TurnID, CreatedAt: now}).Error; err != nil {
+ return err
+ }
+ if err := t.turnEvent(r); err != nil {
+ return err
+ }
+ return t.dispatchNext(card.Person, wire.LaneAssistant)
}
// connectCardView fills a connect card's link.
diff --git a/internal/equipo/chat/http.go b/internal/equipo/chat/http.go
index 412d1b5e..05155197 100644
--- a/internal/equipo/chat/http.go
+++ b/internal/equipo/chat/http.go
@@ -42,6 +42,10 @@ type HTTP struct {
// expired, unavailable), or ErrForbidden when the consent was another
// person's.
OficinaFinish func(ctx context.Context, person, state, code string) (string, error)
+ // OficinaCatchUp settles an Oficina connect card left open for a
+ // person who is connected (a finish whose settlement failed), when
+ // Base reads the Assistant lane. Nil without oficina-connect.
+ OficinaCatchUp func(ctx context.Context, person string) error
}
// thinOr serves thin when it applies to the request, else the earlier
diff --git a/internal/equipo/chat/models.go b/internal/equipo/chat/models.go
index 85cb3597..b042c325 100644
--- a/internal/equipo/chat/models.go
+++ b/internal/equipo/chat/models.go
@@ -7,7 +7,7 @@ package chat
import "time"
// Models are the tables this package owns, for the migration check.
-var Models = []any{&cardVisibility{}, &cardThreadRecord{}, &copyAttemptRecord{}, &copyReviewRecord{}, &copyFeedbackRecord{}, &turnRecord{}, &messageRecord{}, &eventRecord{}, &commandRecord{}, &inboxRecord{}, &runnerSessionRecord{}, &projectRecord{}, &cardRecord{}, &toolCallRecord{}, &settingRecord{}, &coordinatorRecord{}, &notebookRecord{}, &taskRecord{}, &stepRecord{}, &entryRecord{}, &attachmentRecord{}, &starRecord{}, &questionRecord{}, &connectionRecord{}, &usageRecord{}, &distinctRecord{}, &hkRecord{}, &hkFailureRecord{}, &hkSettingsRecord{}, &fileRecord{}, &fileDataRecord{}, &transferRecord{}, &mergePolicyRecord{}, &mergeAuditRecord{}, &specialistRecord{}, &grantRecord{}, &specialistAuditRecord{}, &researchSourceRecord{}, &researchAddressRecord{}, &researchPrefixRecord{}, &researchInventoryRecord{}, &researchRecord{}, &researchFetchRecord{}, &taskFileRecord{}, &taskFileDataRecord{}, &releaseRecord{}, &adviceRecord{}, &assistantHostRecord{}, &handoffRecord{}, &handoffTurnRecord{}, &handoffTaskRecord{}, &handoffActionRecord{}}
+var Models = []any{&cardVisibility{}, &cardThreadRecord{}, &copyAttemptRecord{}, &copyReviewRecord{}, &copyFeedbackRecord{}, &turnRecord{}, &messageRecord{}, &eventRecord{}, &commandRecord{}, &inboxRecord{}, &runnerSessionRecord{}, &projectRecord{}, &cardRecord{}, &toolCallRecord{}, &settingRecord{}, &coordinatorRecord{}, &notebookRecord{}, &taskRecord{}, &stepRecord{}, &entryRecord{}, &attachmentRecord{}, &starRecord{}, &questionRecord{}, &connectionRecord{}, &usageRecord{}, &distinctRecord{}, &hkRecord{}, &hkFailureRecord{}, &hkSettingsRecord{}, &fileRecord{}, &fileDataRecord{}, &transferRecord{}, &mergePolicyRecord{}, &mergeAuditRecord{}, &specialistRecord{}, &grantRecord{}, &specialistAuditRecord{}, &researchSourceRecord{}, &researchAddressRecord{}, &researchPrefixRecord{}, &researchInventoryRecord{}, &researchRecord{}, &researchFetchRecord{}, &taskFileRecord{}, &taskFileDataRecord{}, &releaseRecord{}, &adviceRecord{}, &assistantHostRecord{}, &handoffRecord{}, &handoffTurnRecord{}, &handoffTaskRecord{}, &handoffActionRecord{}, &connectTurnRecord{}}
type turnRecord struct {
CreateRepo string
diff --git a/internal/equipo/chat/tools.go b/internal/equipo/chat/tools.go
index f687ab5d..b9aff70d 100644
--- a/internal/equipo/chat/tools.go
+++ b/internal/equipo/chat/tools.go
@@ -97,6 +97,9 @@ const (
noteOpenQuestion = "- Job %q (request %s): %q"
noteMoreQuestion = "1 more job has an open question not listed here: team_status lists every open request with its question, ten at a time (pass its next as after to read on)."
noteMoreQuestions = "%d more jobs have open questions not listed here: team_status lists every open request with its question, ten at a time (pass its next as after to read on)."
+ // noteConnected is the note of the turn queued once the person
+ // connected the apps a connect card asked for (carryOn).
+ noteConnected = "The person has just connected their Oficina apps. Now complete their most recent request that needed them, as they asked it in the conversation. If that request is already done or no longer applies, end your turn without writing anything, or reply in one short line."
)
// causeGoingLive: a job's merge or publish step failed (stopCause). Only
diff --git a/internal/equipo/chat_wiring.go b/internal/equipo/chat_wiring.go
index b3bbe889..278cf891 100644
--- a/internal/equipo/chat_wiring.go
+++ b/internal/equipo/chat_wiring.go
@@ -167,7 +167,7 @@ func (s *Store) chatHTTP(authenticate func(*http.Request) (personapi.PersonPrinc
return chat.RunnerPrincipal{RunnerID: p.RunnerID, Person: p.Person, CredentialID: p.CredentialID}, nil
}}
if s.oficina != nil {
- h.OficinaConnect, h.OficinaFinish = s.oficinaConnect, s.oficinaFinish
+ h.OficinaConnect, h.OficinaFinish, h.OficinaCatchUp = s.oficinaConnect, s.oficinaFinish, s.oficinaCatchUp
}
return h
}
diff --git a/internal/equipo/migrations/0092_assistant_connect_turns.sql b/internal/equipo/migrations/0092_assistant_connect_turns.sql
new file mode 100644
index 00000000..f620f09c
--- /dev/null
+++ b/internal/equipo/migrations/0092_assistant_connect_turns.sql
@@ -0,0 +1,5 @@
+-- The Assistant turn the instance queued once the person connected the
+-- apps their connect card asked for: one per card (its key), with the
+-- person's turn that raised the card, whose request it carries on.
+CREATE TABLE chat_connect_turns (card_id text PRIMARY KEY, turn_id text, person text, asked_turn text, created_at datetime);
+CREATE UNIQUE INDEX chat_connect_turn ON chat_connect_turns(turn_id);
diff --git a/internal/equipo/migrations/schema.sql b/internal/equipo/migrations/schema.sql
index 9201cbf0..ab46e06b 100644
--- a/internal/equipo/migrations/schema.sql
+++ b/internal/equipo/migrations/schema.sql
@@ -713,3 +713,5 @@ UPDATE chat_notebooks SET entries = (SELECT json_group_array(json(value)) FROM j
CREATE TABLE oficina_connections (person text PRIMARY KEY, refresh text, revision integer, created_at datetime, updated_at datetime);
ALTER TABLE chat_tasks ADD COLUMN move_abandoned numeric;
ALTER TABLE chat_cards ADD COLUMN access text;
+CREATE TABLE chat_connect_turns (card_id text PRIMARY KEY, turn_id text, person text, asked_turn text, created_at datetime);
+CREATE UNIQUE INDEX chat_connect_turn ON chat_connect_turns(turn_id);
diff --git a/internal/equipo/oficina_connect.go b/internal/equipo/oficina_connect.go
index bf9731b3..a2d7a3d1 100644
--- a/internal/equipo/oficina_connect.go
+++ b/internal/equipo/oficina_connect.go
@@ -24,7 +24,7 @@ import (
// person's browser takes to connect (the card's link, then connect's
// redirect back) and to disconnect.
const (
- oficinaProvider = "oficina"
+ oficinaProvider = chat.OficinaProvider
oficinaStartPath = "/oficina/connect/start"
oficinaCallbackPath = "/oficina/connect/callback"
oficinaDisconnectPath = "/oficina/connect/disconnect"
@@ -201,7 +201,9 @@ func (s *Store) oficinaFinish(ctx context.Context, person, state, code string) (
}
// oficinaFinished is a finished consent's status. Connected, the
-// person's lists are read afresh and their connect card settled.
+// person's lists are read afresh and their connect card settled; a
+// settlement that fails is caught up on their next read of the
+// Assistant lane (oficinaCatchUp).
func (s *Store) oficinaFinished(ctx context.Context, person string, err error) (string, error) {
switch {
case errors.Is(err, oficina.ErrNotYours):
@@ -214,12 +216,46 @@ func (s *Store) oficinaFinished(ctx context.Context, person string, err error) (
return "unavailable", nil
}
s.assist.Forget(person)
- if err := s.Chat().SettleConnect(ctx, person, oficinaProvider); err != nil {
+ if err := s.Chat().SettleConnectSince(ctx, person, oficinaProvider, oficinaConnected(person)); err != nil {
slog.Warn(copyOficinaCardFailed, "err", err)
}
return "connected", nil
}
+// oficinaCatchUp settles the person's Oficina connect card left open
+// while they are connected: a finish saved the connection and then
+// failed to settle it, and its state is used up. Settling queues the
+// one resume turn, as the finish would have. The connection is read in
+// the settling transaction, and only a card raised before it was saved
+// settles. With no open card it is one read.
+func (s *Store) oficinaCatchUp(ctx context.Context, person string) error {
+ person = normalizeAddress(person)
+ open, err := s.Chat().ConnectOpen(ctx, person, oficinaProvider)
+ if err != nil || !open {
+ return err
+ }
+ if s.oficinaPause != nil {
+ s.oficinaPause()
+ }
+ return s.Chat().SettleConnectSince(ctx, person, oficinaProvider, oficinaConnected(person))
+}
+
+// oficinaConnected reads person's connection in the settling
+// transaction: when it was last saved, if they have one.
+func oficinaConnected(person string) chat.Connected {
+ return func(tx *gorm.DB) (time.Time, bool, error) {
+ var r oficinaConnectionRecord
+ if err := tx.Where("person = ?", person).Limit(1).Find(&r).Error; err != nil || r.Person == "" || r.Refresh == "" {
+ return time.Time{}, false, err
+ }
+ return r.UpdatedAt, true, nil
+ }
+}
+
+// SetOficinaCatchUpPause runs pause inside oficinaCatchUp after it has
+// looked and before it settles: tests interleave other work there.
+func (s *Store) SetOficinaCatchUpPause(pause func()) { s.oficinaPause = pause }
+
// oficinaCallback is connect's redirect back. It needs no session and
// finishes nothing: it checks the state (Peek) and hands the state and
// code on to where the consent started, for the person to finish with
diff --git a/internal/equipo/store.go b/internal/equipo/store.go
index 5c12729b..f5d8e6fe 100644
--- a/internal/equipo/store.go
+++ b/internal/equipo/store.go
@@ -85,7 +85,9 @@ type Store struct {
// EQUIPO_OFICINA_CONNECT_ORIGIN is unset; assist the Assistant's
// registry, kept to forget a person's lists when they connect.
oficina *oficina.Connector
- assist *assist.Registry
+ // oficinaPause is a test's pause inside oficinaCatchUp.
+ oficinaPause func()
+ assist *assist.Registry
}
type StoreOption func(*Store)
diff --git a/internal/thintest/assistant_oficina_contract_test.go b/internal/thintest/assistant_oficina_contract_test.go
index c3c509fd..dae38219 100644
--- a/internal/thintest/assistant_oficina_contract_test.go
+++ b/internal/thintest/assistant_oficina_contract_test.go
@@ -495,4 +495,7 @@ func TestContractAssistantOficinaSettleChecksRoster(t *testing.T) {
if s := state(); s != wire.CardOpen {
t.Errorf("card %s", s)
}
+ if n := o.rows("SELECT count(*) FROM chat_turns WHERE person = ? AND kind = ?", "ana@example.com", wire.TurnTeamUpdate); n != 0 {
+ t.Errorf("%d turns queued for a removed member", n)
+ }
}
diff --git a/internal/thintest/assistant_oficina_resume_contract_test.go b/internal/thintest/assistant_oficina_resume_contract_test.go
new file mode 100644
index 00000000..bbcbe88c
--- /dev/null
+++ b/internal/thintest/assistant_oficina_resume_contract_test.go
@@ -0,0 +1,394 @@
+package thintest
+
+import (
+ "errors"
+ "net/http"
+ "net/url"
+ "slices"
+ "strings"
+ "sync"
+ "testing"
+
+ "amadan.net/oficina/equipo/internal/equipo/chat"
+ "amadan.net/oficina/equipo/internal/wire"
+)
+
+// resumeMarker is a phrase of the note the Assistant gets once the
+// person has connected their Oficina apps (the instance's noteConnected).
+const resumeMarker = "has just connected their Oficina apps"
+
+// resumes are the person's Assistant turns the instance queued itself
+// after a connect: team_update turns whose note is noteConnected.
+func (o *oficinaRig) resumes() int {
+ o.t.Helper()
+ return o.rows("SELECT count(*) FROM chat_turns WHERE kind = ? AND lane = ? AND note LIKE ?", wire.TurnTeamUpdate, wire.LaneAssistant, "%"+resumeMarker+"%")
+}
+
+// asked raises the connect card from a person turn for words and ends
+// that turn the way a model does when it needs the apps: with a reply.
+func (o *oficinaRig) asked(words string) (turn string) {
+ o.t.Helper()
+ turn = o.begin(words)
+ if res := o.tool("l-"+turn, wire.ToolLook, map[string]any{"query": "calendar"}); !strings.Contains(res.Text, "not connected") {
+ o.t.Fatalf("look: %+v", res)
+ }
+ (&teamRig{o.opsRig}).reply(turn)
+ return turn
+}
+
+// finish connects through Base and returns the finish's status, with
+// the state and code it used.
+func (o *oficinaRig) finish() (status, state, code string) {
+ o.t.Helper()
+ u, err := url.Parse(o.callback(o.base.Origin + "/ask"))
+ if err != nil {
+ o.t.Fatal(err)
+ }
+ state, code = u.Query().Get("oficina_state"), u.Query().Get("oficina_code")
+ status, err = o.a.OficinaFinish(o.ctx, state, code)
+ if err != nil {
+ o.t.Fatalf("finish: %v", err)
+ }
+ return status, state, code
+}
+
+// laneMessages are the Assistant lane's messages as Base reads them,
+// oldest first.
+func (o *oficinaRig) laneMessages() []wire.Message {
+ o.t.Helper()
+ page, err := o.a.Messages(o.ctx, "", 100)
+ if err != nil {
+ o.t.Fatal(err)
+ }
+ items := slices.Clone(page.Items)
+ slices.SortFunc(items, func(a, b wire.Message) int { return a.CreatedAt.Compare(b.CreatedAt) })
+ return items
+}
+
+// TestContractAssistantOficinaResumes (ruling 2026-11-19): once the
+// person connects, the Assistant carries on by itself. One team_update
+// turn is queued in their Assistant lane and dispatched, its note the
+// instance's, never words the person did not type; it may make the
+// write the person asked for; its reply is the only thing new in the
+// lane. A repeated finish, a connect with no card open, and the same
+// card settled again queue nothing more.
+func TestContractAssistantOficinaResumes(t *testing.T) {
+ o := newOficinaRig(t)
+ tr := &teamRig{o.opsRig}
+ words := "Put lunch with Ana in my calendar on Friday."
+ first := o.asked(words)
+ before := o.laneMessages()
+
+ status, state, code := o.finish()
+ if status != "connected" {
+ t.Fatalf("finish: %q", status)
+ }
+ u := tr.message(wire.LaneAssistant)
+ if u.Kind != wire.TurnTeamUpdate || u.TurnID == first || len(u.PersonText) != 0 || !strings.Contains(u.Text, resumeMarker) {
+ t.Fatalf("resume frame: %+v", u)
+ }
+ if !slices.ContainsFunc(u.Tail, func(m wire.TailMessage) bool { return m.Role == wire.RolePerson && m.Text == words }) {
+ t.Errorf("the request is not in the resume's tail: %+v", u.Tail)
+ }
+ if n := o.resumes(); n != 1 {
+ t.Fatalf("%d resume turns", n)
+ }
+ // The resume answers the person's own request: the write they asked
+ // for goes through.
+ tr.in(u.TurnID, func() {
+ if res := o.use("w1", "calendar_create_event", map[string]any{"title": "Lunch with Ana", "start_local": "2026-11-20T13:00"}); res.IsError || res.Code != "used" {
+ t.Fatalf("write in the resume: %+v", res)
+ }
+ })
+ reply := "Lunch with Ana is in your calendar for Friday."
+ if err := o.runner.Send(o.ctx, "r-resume", wire.FrameReply, wire.Reply{TurnID: u.TurnID, Attempt: 1, Text: reply}); err != nil {
+ t.Fatal(err)
+ }
+ o.until("resume replied", func() bool {
+ return o.rows("SELECT count(*) FROM chat_turns WHERE id = ? AND state = ?", u.TurnID, wire.TurnReplied) == 1
+ })
+ after := o.laneMessages()
+ if len(after) != len(before)+1 {
+ t.Fatalf("lane before %+v, after %+v", before, after)
+ }
+ if last := after[len(after)-1]; last.Role != wire.RoleAssistant || last.Text != reply || last.TurnID != u.TurnID {
+ t.Errorf("new in the lane: %+v", last)
+ }
+ if n := len(slices.DeleteFunc(after, func(m wire.Message) bool { return m.Role != wire.RolePerson })); n != 1 {
+ t.Errorf("%d person messages in the lane", n)
+ }
+
+ // A repeated finish: the state is used up, nothing more is queued.
+ if again, err := o.a.OficinaFinish(o.ctx, state, code); err != nil || again != "expired" {
+ t.Errorf("replayed finish: %q %v", again, err)
+ }
+ // Connecting again with no card open asks for nothing.
+ if again, _, _ := o.finish(); again != "connected" {
+ t.Errorf("second connect: %q", again)
+ }
+ // Two finishes that both found the card open settle it twice; the
+ // card's key lets only the first queue a turn.
+ card := o.connectCards()[0]
+ if _, err := o.inst.DB.Writer().Exec("UPDATE chat_cards SET state = ? WHERE id = ?", wire.CardOpen, card.ID); err != nil {
+ t.Fatal(err)
+ }
+ if err := o.inst.Store.Chat().SettleConnect(o.ctx, Owner, "oficina"); err != nil {
+ t.Fatalf("settled again: %v", err)
+ }
+ if n := o.resumes(); n != 1 {
+ t.Errorf("%d resume turns after replays", n)
+ }
+ if n := o.rows("SELECT count(*) FROM chat_turns WHERE lane = ? AND state IN (?, ?, ?)", wire.LaneAssistant, wire.TurnQueued, wire.TurnRunning, wire.TurnWaiting); n != 0 {
+ t.Errorf("%d Assistant turns in flight after replays", n)
+ }
+}
+
+// TestContractAssistantOficinaResumeWaits: a connect while the person's
+// Assistant turn still runs queues the resume behind it, as notes wait;
+// it is dispatched once that turn ends.
+func TestContractAssistantOficinaResumeWaits(t *testing.T) {
+ o := newOficinaRig(t)
+ tr := &teamRig{o.opsRig}
+ first := o.begin("Put lunch with Ana in my calendar on Friday.")
+ o.tool("l1", wire.ToolLook, map[string]any{"query": "calendar"})
+ if status, _, _ := o.finish(); status != "connected" {
+ t.Fatalf("finish: %q", status)
+ }
+ if n := o.resumes(); n != 1 {
+ t.Fatalf("%d resume turns", n)
+ }
+ if n := o.rows("SELECT count(*) FROM chat_turns WHERE kind = ? AND dispatched = ?", wire.TurnTeamUpdate, true); n != 0 {
+ t.Fatalf("the resume went while the person's turn ran")
+ }
+ tr.reply(first)
+ if u := tr.message(wire.LaneAssistant); u.Kind != wire.TurnTeamUpdate || !strings.Contains(u.Text, resumeMarker) {
+ t.Fatalf("after the turn ended: %+v", u)
+ }
+}
+
+// TestContractAssistantOficinaNoResumeUnlessConnected: a consent
+// refused, a finish connect could not complete and one that expired
+// queue nothing and leave the card open; the connect that works then
+// queues the one turn.
+func TestContractAssistantOficinaNoResumeUnlessConnected(t *testing.T) {
+ o := newOficinaRig(t)
+ ana := o.other("ana@example.com")
+ o.asked("Put lunch with Ana in my calendar on Friday.")
+
+ o.fake.Deny = true
+ if back := o.callback(o.base.Origin + "/ask"); back != o.base.Origin+"/ask?oficina=denied" {
+ t.Fatalf("denied: %q", back)
+ }
+ o.fake.Down = true
+ if status, _, _ := o.finish(); status != "unavailable" {
+ t.Fatalf("connect down: %q", status)
+ }
+ o.fake.Down = false
+ state, code := o.handBack(o.base.Origin + "/ask")
+ var s *ErrStatus
+ if _, err := ana.a.OficinaFinish(o.ctx, state, code); !errors.As(err, &s) || s.Status != http.StatusForbidden {
+ t.Fatalf("another person's finish: %v", err)
+ }
+ if status, err := o.a.OficinaFinish(o.ctx, state, code); err != nil || status != "expired" {
+ t.Fatalf("expired: %q %v", status, err)
+ }
+ if n := o.resumes(); n != 0 {
+ t.Fatalf("%d resume turns without a connection", n)
+ }
+ if cards := o.connectCards(); len(cards) != 1 || cards[0].State != wire.CardOpen {
+ t.Fatalf("cards: %+v", cards)
+ }
+
+ if status, _, _ := o.finish(); status != "connected" {
+ t.Fatalf("finish: %q", status)
+ }
+ if n := o.resumes(); n != 1 {
+ t.Errorf("%d resume turns once connected", n)
+ }
+}
+
+// TestContractAssistantOficinaResumeRecovers: a finish whose settlement
+// fails after the connection is saved still says connected, and a
+// replay is expired; the person's next snapshot settles the card left
+// open and queues the one resume turn, and the one after adds nothing.
+func TestContractAssistantOficinaResumeRecovers(t *testing.T) {
+ o := newOficinaRig(t)
+ tr := &teamRig{o.opsRig}
+ o.asked("Put lunch with Ana in my calendar on Friday.")
+ db := o.inst.DB.Writer()
+ if _, err := db.Exec("CREATE TRIGGER inject_settle BEFORE INSERT ON chat_connect_turns BEGIN SELECT RAISE(ABORT, 'injected'); END"); err != nil {
+ t.Fatal(err)
+ }
+ status, state, code := o.finish()
+ if status != "connected" {
+ t.Fatalf("finish: %q", status)
+ }
+ if n := o.resumes(); n != 0 {
+ t.Fatalf("%d resume turns through the injected failure", n)
+ }
+ if _, err := db.Exec("DROP TRIGGER inject_settle"); err != nil {
+ t.Fatal(err)
+ }
+ if again, err := o.a.OficinaFinish(o.ctx, state, code); err != nil || again != "expired" {
+ t.Fatalf("replayed finish: %q %v", again, err)
+ }
+ if n := o.rows("SELECT count(*) FROM chat_cards WHERE kind = ? AND state = ?", wire.CardConnect, wire.CardOpen); n != 1 {
+ t.Fatalf("%d open connect cards before the snapshot", n)
+ }
+ o.connectCards() // the person's next snapshot
+ if n := o.resumes(); n != 1 {
+ t.Fatalf("%d resume turns after the snapshot", n)
+ }
+ if cards := o.connectCards(); len(cards) != 1 || cards[0].State != wire.CardResolved {
+ t.Errorf("cards: %+v", cards)
+ }
+ if u := tr.message(wire.LaneAssistant); u.Kind != wire.TurnTeamUpdate || !strings.Contains(u.Text, resumeMarker) {
+ t.Fatalf("resume frame: %+v", u)
+ }
+ if n := o.resumes(); n != 1 {
+ t.Errorf("%d resume turns after another snapshot", n)
+ }
+}
+
+// TestContractAssistantOficinaResumeOnlyOficina: a connect card for
+// another provider settles with no turn queued, and a resume turn whose
+// card is not an Oficina one is granted no write.
+func TestContractAssistantOficinaResumeOnlyOficina(t *testing.T) {
+ o := newOficinaRig(t)
+ tr := &teamRig{o.opsRig}
+ c := o.inst.Store.Chat()
+ if open, err := c.RaiseConnect(o.ctx, Owner, chat.ConnectCard{Provider: "elsewhere", Question: "Connect", Link: wire.CardLink{Label: "Connect", URL: "https://elsewhere.example.com"}}); err != nil || !open {
+ t.Fatalf("raise: %v %v", open, err)
+ }
+ if err := c.SettleConnect(o.ctx, Owner, "elsewhere"); err != nil {
+ t.Fatal(err)
+ }
+ if n := o.rows("SELECT count(*) FROM chat_cards WHERE kind = ? AND name = ? AND state = ?", wire.CardConnect, "elsewhere", wire.CardResolved); n != 1 {
+ t.Fatalf("another provider's card not settled: %d", n)
+ }
+ if n := o.rows("SELECT count(*) FROM chat_turns WHERE kind = ?", wire.TurnTeamUpdate); n != 0 {
+ t.Fatalf("%d turns queued for another provider", n)
+ }
+
+ o.asked("Put lunch with Ana in my calendar on Friday.")
+ if status, _, _ := o.finish(); status != "connected" {
+ t.Fatalf("finish: %q", status)
+ }
+ u := tr.message(wire.LaneAssistant)
+ if _, err := o.inst.DB.Writer().Exec("UPDATE chat_cards SET name = ? WHERE kind = ? AND name = ?", "elsewhere", wire.CardConnect, "oficina"); err != nil {
+ t.Fatal(err)
+ }
+ tr.in(u.TurnID, func() {
+ if res := o.use("w1", "calendar_create_event", map[string]any{"title": "Lunch with Ana", "start_local": "2026-11-20T13:00"}); !res.IsError || res.Code != "not_asked" {
+ t.Fatalf("write for another provider's card: %+v", res)
+ }
+ })
+}
+
+// TestContractAssistantOficinaResumeConcurrent: settlements racing on
+// the same open card queue one turn, one grant record and one dispatch.
+func TestContractAssistantOficinaResumeConcurrent(t *testing.T) {
+ o := newOficinaRig(t)
+ o.asked("Put lunch with Ana in my calendar on Friday.")
+ c := o.inst.Store.Chat()
+ const n = 8
+ start := make(chan struct{})
+ errs := make(chan error, n)
+ var wg sync.WaitGroup
+ for range n {
+ wg.Add(1)
+ go func() {
+ defer wg.Done()
+ <-start
+ errs <- c.SettleConnect(o.ctx, Owner, "oficina")
+ }()
+ }
+ close(start)
+ wg.Wait()
+ close(errs)
+ for err := range errs {
+ if err != nil {
+ t.Errorf("settle: %v", err)
+ }
+ }
+ if got := o.resumes(); got != 1 {
+ t.Errorf("%d resume turns", got)
+ }
+ if got := o.rows("SELECT count(*) FROM chat_connect_turns"); got != 1 {
+ t.Errorf("%d grant records", got)
+ }
+ if got := o.rows("SELECT count(*) FROM runner_commands WHERE kind = ? AND body LIKE ?", wire.FrameMessage, "%"+resumeMarker+"%"); got != 1 {
+ t.Errorf("%d resume dispatches", got)
+ }
+}
+
+// TestContractAssistantOficinaResumeStaleEvidence: a lane read that
+// found the person connected and paused settles nothing on that stale
+// evidence. Meanwhile card A settles, the person disconnects and card B
+// is raised; once the read goes on, B stays open with no turn and no
+// grant, since no connection made after B was raised exists.
+func TestContractAssistantOficinaResumeStaleEvidence(t *testing.T) {
+ o := newOficinaRig(t)
+ o.asked("Put lunch with Ana in my calendar on Friday.")
+ db := o.inst.DB.Writer()
+ if _, err := db.Exec("CREATE TRIGGER inject_settle BEFORE INSERT ON chat_connect_turns BEGIN SELECT RAISE(ABORT, 'injected'); END"); err != nil {
+ t.Fatal(err)
+ }
+ if status, _, _ := o.finish(); status != "connected" {
+ t.Fatalf("finish: %q", status)
+ }
+ if _, err := db.Exec("DROP TRIGGER inject_settle"); err != nil {
+ t.Fatal(err)
+ }
+ c := o.inst.Store.Chat()
+ var once sync.Once
+ o.inst.Store.SetOficinaCatchUpPause(func() {
+ once.Do(func() {
+ if err := c.SettleConnect(o.ctx, Owner, "oficina"); err != nil {
+ t.Errorf("settle A: %v", err)
+ }
+ if status, _, page := o.browse(http.MethodPost, o.inst.URL+"/oficina/connect/disconnect"); status != http.StatusOK {
+ t.Errorf("disconnect: %d %s", status, page)
+ }
+ if open, err := c.RaiseConnect(o.ctx, Owner, chat.ConnectCard{Provider: "oficina", Question: "Connect your Oficina apps", Link: wire.CardLink{Label: "Connect", URL: o.base.Origin + "/ask/oficina/connect"}}); err != nil || !open {
+ t.Errorf("raise B: %v %v", open, err)
+ }
+ })
+ })
+ t.Cleanup(func() { o.inst.Store.SetOficinaCatchUpPause(nil) })
+ if _, err := o.a.Snapshot(o.ctx); err != nil {
+ t.Fatal(err)
+ }
+ if n := o.resumes(); n != 1 {
+ t.Errorf("%d resume turns, want only A's", n)
+ }
+ if n := o.rows("SELECT count(*) FROM chat_connect_turns"); n != 1 {
+ t.Errorf("%d grant records, want only A's", n)
+ }
+ if n := o.rows("SELECT count(*) FROM chat_cards WHERE kind = ? AND state = ?", wire.CardConnect, wire.CardOpen); n != 1 {
+ t.Errorf("%d open connect cards, want B", n)
+ }
+}
+
+// TestContractAssistantOficinaResumeCardAfterConnection: a connect card
+// raised after the person's connection was last saved is no evidence of
+// a connect for it: a lane read leaves it open, with no turn.
+func TestContractAssistantOficinaResumeCardAfterConnection(t *testing.T) {
+ o := newOficinaRig(t)
+ o.asked("Put lunch with Ana in my calendar on Friday.")
+ if status, _, _ := o.finish(); status != "connected" {
+ t.Fatalf("finish: %q", status)
+ }
+ if open, err := o.inst.Store.Chat().RaiseConnect(o.ctx, Owner, chat.ConnectCard{Provider: "oficina", Question: "Connect your Oficina apps", Link: wire.CardLink{Label: "Connect", URL: o.base.Origin + "/ask/oficina/connect"}}); err != nil || !open {
+ t.Fatalf("raise: %v %v", open, err)
+ }
+ if _, err := o.a.Snapshot(o.ctx); err != nil {
+ t.Fatal(err)
+ }
+ if n := o.resumes(); n != 1 {
+ t.Errorf("%d resume turns", n)
+ }
+ if n := o.rows("SELECT count(*) FROM chat_cards WHERE kind = ? AND state = ?", wire.CardConnect, wire.CardOpen); n != 1 {
+ t.Errorf("%d open connect cards", n)
+ }
+}