oficina / equipo Public

Lookups: Astra phase 3 round 2 fixes (2 P1, 4 P2)

- A lookup's rows, its audit and a reply carrying answers are written
  with SQL logging off, and a failed write is logged without its error.
- base_apps must hold both lists, every address readable, else the
  lookup fails (a fresh list fetched earlier stands while it may); the
  fake Base answers in Base's real shape.
- A replaced or ended connection drops its waiters, and an answer counts
  only from the runner's current connection.
- The guard says whether a request was written before it failed;
  searches that never went out (DNS, refused dials) use no quota.
- The 2-lookup cap is the whole turn's, across attempts.
- Typed addresses in the order typed, each address once (two pages on
  one host are two).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by paul@keymail.dev cfcf97981aad9c2053c841b53eff1b6d55740e7a parent 5edac79
14 files changed, +247 −58
  • .rastrillo/budgets.txt +2 −2
  • internal/equipo/chat/lookup.go +67 −32
  • internal/equipo/chat/lookup_live.go +14 −3
  • internal/equipo/chat/lookup_pack_test.go +28 −0
  • internal/equipo/chat/lookup_test.go +56 −1
  • internal/equipo/chat/lookup_view_test.go +11 −3
  • internal/equipo/chat/store.go +13 −0
  • internal/thintest/assistant_ops_contract_test.go +1 −1
  • internal/thintest/fakebase.go +1 −1
  • internal/thintest/lookup_e2e_test.go +4 −1
  • internal/websearch/backends.go +1 −4
  • internal/websearch/websearch_test.go +20 −0
  • internal/websource/guard/dial.go +22 −8
  • internal/websource/guard/guard.go +7 −2

CI cancelled — superseded by a newer push — 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/abilities-phase3: 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 1.2s
ci-box: codex: fetched and verified in 3.5s
ci-box: codex-code-mode-host: fetched and verified in 1.4s
ci-box: libwrap: fetched and verified in 0.3s
ci-box: socat: fetched and verified in 0.4s
npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead
ci-box: image pulled in 9.9s
ci-box: pi: installed and verified in 7.2s
ci-box: opencode: installed and verified in 2.0s
ci-box: chromium 156.0.8078.79-1~deb13u1: 76 packages fetched, verified and unpacked in 9.4s
ci-box: clone deepened in 4.3s
ci-box: file times set from content: 3361 files, 217 directories
ci-box: ready in 17.5s
=== 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.152s
=== compile ===
go build ./...
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py compile
+ go build -tags testbuild ./...
  4.7s
+ go list -export -test -tags testbuild -f  ./...
  4.5s
+ go list -export -test -tags browser,testbuild -f  ./internal/equipo ./internal/equipotest ./internal/headless ./internal/idtest ./internal/plan3test ./internal/thintest
  3.9s
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -version
staticcheck 2026.1 (v0.7.0)
go run golang.org/x/vuln/cmd/govulncheck@v1.8.0 -version
Go: go1.26.11
Scanner: govulncheck@v1.8.0
DB: https://vuln.go.dev
DB updated: 2026-11-24 15:56:00 +0000 UTC

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

receipt: test step 1m21.402s 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.122s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m19.12s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 64.47, cpu waiting 39.13%, memory waiting 0.00%, io waiting 0.39%
--- shard 1 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-review: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadless$/^4_review$|^TestHeadless$/^2b_access$|^TestHeadless$/^runner_crash$|^TestHeadless$/^2b_first_message$|^TestHeadless$/^4_checks_honest$|^TestHeadless$/^7_stream_resume$|^TestHeadless$/^2b_notebook$|^TestHeadless$/^2b_move_in$|^TestHeadless$/^2b_desk_failure$|^TestHeadless$/^cancel$' ./internal/headless

receipt: test step 1m21.295s 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.39s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m19.39s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 64.47, cpu waiting 38.99%, memory waiting 0.00%, io waiting 0.37%
--- shard 2 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-connections: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadlessConnections$|^TestHeadlessTokenPasteEndToEnd$|^TestHeadlessTokenConnection$' ./internal/headless

receipt: test step 1m21.709s 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.671s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m9.66s amadan.net/oficina/equipo/internal/headless TestHeadlessConnections
receipt: slow test 5.4s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenPasteEndToEnd
receipt: slow test 4.61s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenConnection
machine: 32 CPUs, load 64.47, cpu waiting 38.99%, memory waiting 0.00%, io waiting 0.37%
--- shard 3 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-mac: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestMacWorker$|^TestHeadlessAttachments$|^TestHeadlessPrewarm$|^TestHeadless$/^1_first_token$|^TestHeadless$/^6_quick_messages$|^TestHeadless$/^8_instance_restart$|^TestHeadless$/^3_runner_offline$' ./internal/headless

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

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

receipt: test step 3m0.453s 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 2m58.271s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m41.66s amadan.net/oficina/equipo/internal/headless TestHeadlessAssistant
receipt: slow test 20.5s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 9.24s amadan.net/oficina/equipo/internal/headless TestHeadlessResearchHandoff
receipt: slow test 7.25s amadan.net/oficina/equipo/internal/headless TestHeadlessAssistantAttachments
receipt: slow test 6.74s amadan.net/oficina/equipo/internal/headless TestHeadlessTurnBatching
machine: 32 CPUs, load 21.20, cpu waiting 10.64%, memory waiting 0.00%, io waiting 0.06%
--- 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 3m21.831s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 3m19.958s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 15.66s amadan.net/oficina/equipo/internal/thintest TestTasklessHoldResumes
receipt: slow test 10.71s amadan.net/oficina/equipo/internal/thintest TestContractTeamJobSettledStates
receipt: slow test 6.66s amadan.net/oficina/equipo/internal/thintest TestExplorePreviewsOff
receipt: slow test 5.45s amadan.net/oficina/equipo/internal/thintest TestNudgeResumesHeldJob
receipt: slow test 5.44s amadan.net/oficina/equipo/internal/thintest TestAbilityHoldResumes
machine: 32 CPUs, load 15.60, cpu waiting 7.38%, memory waiting 0.00%, io waiting 0.04%
--- shard 7 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane thintest-contract: ./internal/thintest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -skip '^Test([^C]|C[^o]|Co[^n]|Con[^t])|^TestContract(Assistant|Outcome|Team|Handoff|HostAllowlist|HostIsPerPerson|Look|Use[A-Z]|RemoteCall|LanesRunAtOnce|NoMergeQuestionWhenGateMerges|PreviewHeldUntilPublishAnswer|PreviewNotHeldBelow19|PublishNeedsOwnerAnswer)' ./internal/thintest

receipt: test step 1m59.976s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m57.608s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 9.58s amadan.net/oficina/equipo/internal/thintest TestContractRetryPreviewUnverifiedMerge
receipt: slow test 9.12s amadan.net/oficina/equipo/internal/thintest TestContractPreviewNotScheduled
receipt: slow test 5.01s amadan.net/oficina/equipo/internal/thintest TestContractPublishNotOffered
receipt: slow test 4.61s amadan.net/oficina/equipo/internal/thintest TestContractMacRecheckMergeAuthority
receipt: slow test 3.02s amadan.net/oficina/equipo/internal/thintest TestContractPausedJob
machine: 32 CPUs, load 49.06, cpu waiting 27.76%, memory waiting 0.00%, io waiting 0.19%
--- 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
budget note: internal/runner/thin took 5m15.481s, over the 45s its record on line 44 allows; reported only, timing fails on CI

receipt: test step 5m21.133s 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 5m15.481s amadan.net/oficina/equipo/internal/runner/thin
receipt: slow test 37.03s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeAnsweredByAnotherModel
receipt: slow test 36.89s amadan.net/oficina/equipo/internal/runner/thin TestModelsEngineeringProbesThenRunsTheStrongest
receipt: slow test 36.81s amadan.net/oficina/equipo/internal/runner/thin TestModelsUnhealthyRetriedOnDemand
receipt: slow test 18.48s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeRunsInsideTheAdmission
receipt: slow test 9.98s amadan.net/oficina/equipo/internal/runner/thin TestTimeoutKeepsNothingForAnOlderInstance
machine: 32 CPUs, load 2.82, cpu waiting 1.03%, memory waiting 0.00%, io waiting 0.00%
--- shard 9 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane runner-bug: ./internal/runner
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestDirectBugWorkflow$|^TestEnrolKeepsTheRole$' ./internal/runner
cache miss: amadan.net/oficina/equipo/internal/runner: its inputs changed

receipt: test step 50.489s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 49.236s amadan.net/oficina/equipo/internal/runner
receipt: slow test 29.21s amadan.net/oficina/equipo/internal/runner TestDirectBugWorkflow
receipt: slow test 20.03s amadan.net/oficina/equipo/internal/runner TestEnrolKeepsTheRole
machine: 32 CPUs, load 45.43, cpu waiting 30.75%, memory waiting 0.00%, io waiting 0.65%
--- 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 1m1.999s 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 59.911s amadan.net/oficina/equipo/internal/runner
receipt: slow test 49.89s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowCandidateOrder
receipt: slow test 44.95s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowFeature
receipt: slow test 8.4s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryCallRefusalKeepsServing
receipt: slow test 1.61s amadan.net/oficina/equipo/internal/runner TestCoordinatorRefusalMatrix
machine: 32 CPUs, load 55.31, cpu waiting 37.02%, memory waiting 0.00%, io waiting 0.53%
--- 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 41.982s 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 41.029s amadan.net/oficina/equipo/internal/runner
receipt: slow test 5.13s amadan.net/oficina/equipo/internal/runner TestDirectFaultIsolation
receipt: slow test 5.01s amadan.net/oficina/equipo/internal/runner TestEnrolCommitsTheCredentialLast
receipt: slow test 3.4s amadan.net/oficina/equipo/internal/runner TestClaimRefusalsBackOff
receipt: slow test 3.36s amadan.net/oficina/equipo/internal/runner TestToolVerbUnderFakeHarness
receipt: slow test 3.11s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryRefusedKeepsServing
machine: 32 CPUs, load 40.07, cpu waiting 24.81%, memory waiting 0.00%, io waiting 0.74%
--- 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 38.5%, load 23.76
test lane equipotest-a: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^Test[A-D]|^TestQ' ./internal/equipotest

receipt: test step 1m10.641s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m8.774s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 29.54s amadan.net/oficina/equipo/internal/equipotest TestAuthorityCoreIntegration
receipt: slow test 29.42s amadan.net/oficina/equipo/internal/equipotest TestBootstrapNamesOwnersSetting
receipt: slow test 27.13s amadan.net/oficina/equipo/internal/equipotest TestAccountLabelMigration
receipt: slow test 24.25s amadan.net/oficina/equipo/internal/equipotest TestBudgetConfigurationFailuresAreAtomic
receipt: slow test 24.22s amadan.net/oficina/equipo/internal/equipotest TestAccountLabelDuplicates
machine: 32 CPUs, load 60.99, cpu waiting 37.32%, memory waiting 0.00%, io waiting 0.27%
--- 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 38.5%, load 23.76
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 2m15.369s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 2m13.489s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 21.08s amadan.net/oficina/equipo/internal/equipotest TestProjectsFailuresRollBack
receipt: slow test 21.08s amadan.net/oficina/equipo/internal/equipotest TestProjectWritesRequireCurrentOwner
receipt: slow test 21.02s amadan.net/oficina/equipo/internal/equipotest TestProjectsReopen
receipt: slow test 21.01s amadan.net/oficina/equipo/internal/equipotest TestProjectsAccountRevisionAndValidation
receipt: slow test 20.99s amadan.net/oficina/equipo/internal/equipotest TestProjectsSharedAndGrouped
machine: 32 CPUs, load 27.94, cpu waiting 13.43%, memory waiting 0.00%, io waiting 0.08%
--- 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 38.5%, load 23.76
test lane equipotest-r: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestR' ./internal/equipotest

receipt: test step 1m18.735s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m12.853s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 16.24s amadan.net/oficina/equipo/internal/equipotest TestReleaseStampContract
receipt: slow test 13.91s amadan.net/oficina/equipo/internal/equipotest TestRosterChangesAffectExistingSession
receipt: slow test 10.81s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalWhileAssigned
receipt: slow test 10.75s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalRollsBack
receipt: slow test 7.77s amadan.net/oficina/equipo/internal/equipotest TestRosterAuditFailureRollsBack
machine: 32 CPUs, load 54.28, cpu waiting 33.26%, memory waiting 0.00%, io waiting 0.24%
--- 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 38.5%, load 23.76
test lane equipotest-rest: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -skip '^Test[A-D]|^TestQ|^Test[E-P]|^TestR' ./internal/equipotest

receipt: test step 1m10.263s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m8.333s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 26.39s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedExistingTeam
receipt: slow test 26.39s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedRollback
receipt: slow test 26.14s amadan.net/oficina/equipo/internal/equipotest TestSigninNoProof
receipt: slow test 24.28s amadan.net/oficina/equipo/internal/equipotest TestSigninCSRF
receipt: slow test 24.09s amadan.net/oficina/equipo/internal/equipotest TestSpecialistSettingsRollbackAndUnavailable
machine: 32 CPUs, load 57.78, cpu waiting 37.32%, memory waiting 0.00%, io waiting 0.27%
--- 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 38.5%, load 23.76
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 57.203s 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 55.26s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 3.97s amadan.net/oficina/equipo/internal/plan3test TestPlan3Upgrade
receipt: slow test 3.53s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3B
receipt: slow test 1.71s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3A
receipt: slow test 1.64s amadan.net/oficina/equipo/internal/plan3test TestConversationQuestionRace
receipt: slow test 1.45s amadan.net/oficina/equipo/internal/plan3test TestInviteMigration
machine: 32 CPUs, load 61.63, cpu waiting 38.56%, memory waiting 0.00%, io waiting 0.34%
--- 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 38.5%, load 23.76
test lane rest: ./cmd/equipo ./cmd/equipo-runner ./cmd/equipo-tool-proxy ./internal/advice ./internal/attach ./internal/attach/attachtest ./internal/chatmarkdown ./internal/chatsend ./internal/chatstream ./internal/coordinator ./internal/coordinatorcontract ./internal/coordinatormail ./internal/copydesk ./internal/diffscan ./internal/equipo ./internal/equipo/activity ./internal/equipo/assist ./internal/equipo/chat ./internal/equipo/conversation ./internal/equipo/conversation/chatstate ./internal/equipo/door ./internal/equipo/github ./internal/equipo/housekeeping ./internal/equipo/icons ./internal/equipo/identity ./internal/equipo/kernel ./internal/equipo/library ./internal/equipo/mergegate ./internal/equipo/notifications ./internal/equipo/oficina ./internal/equipo/oficina/oficinatest ./internal/equipo/oficinaid ./internal/equipo/ownermode ./internal/equipo/pause ./internal/equipo/personapi ./internal/equipo/planning ./internal/equipo/push ./internal/equipo/setup ./internal/equipo/team ./internal/equipo/teamcontract ./internal/equipo/triage ./internal/fakeclaude ./internal/fakecodex ./internal/fakeopencode ./internal/fakepi ./internal/idtest ./internal/ownermodetest ./internal/release ./internal/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/claude/realcli ./internal/runner/provider/codex ./internal/runner/provider/gotoolchain ./internal/runner/provider/opencode ./internal/runner/provider/pi ./internal/runner/setup ./internal/runner/transporttest ./internal/runner/webread ./internal/runner/workspace ./internal/runnerproto ./internal/schedule ./internal/sealbox ./internal/specialist ./internal/stagingtest ./internal/taskplan ./internal/testci ./internal/toolproxy ./internal/websearch ./internal/websearch/websearchtest ./internal/websource ./internal/websource/guard ./internal/wire ./internal/wire/forgekey ./internal/wire/wireschema ./internal/wire/wiretest ./tools/drive
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m ./cmd/equipo ./cmd/equipo-runner ./cmd/equipo-tool-proxy ./internal/advice ./internal/attach ./internal/attach/attachtest ./internal/chatmarkdown ./internal/chatsend ./internal/chatstream ./internal/coordinator ./internal/coordinatorcontract ./internal/coordinatormail ./internal/copydesk ./internal/diffscan ./internal/equipo ./internal/equipo/activity ./internal/equipo/assist ./internal/equipo/chat ./internal/equipo/conversation ./internal/equipo/conversation/chatstate ./internal/equipo/door ./internal/equipo/github ./internal/equipo/housekeeping ./internal/equipo/icons ./internal/equipo/identity ./internal/equipo/kernel ./internal/equipo/library ./internal/equipo/mergegate ./internal/equipo/notifications ./internal/equipo/oficina ./internal/equipo/oficina/oficinatest ./internal/equipo/oficinaid ./internal/equipo/ownermode ./internal/equipo/pause ./internal/equipo/personapi ./internal/equipo/planning ./internal/equipo/push ./internal/equipo/setup ./internal/equipo/team ./internal/equipo/teamcontract ./internal/equipo/triage ./internal/fakeclaude ./internal/fakecodex ./internal/fakeopencode ./internal/fakepi ./internal/idtest ./internal/ownermodetest ./internal/release ./internal/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/claude/realcli ./internal/runner/provider/codex ./internal/runner/provider/gotoolchain ./internal/runner/provider/opencode ./internal/runner/provider/pi ./internal/runner/setup ./internal/runner/transporttest ./internal/runner/webread ./internal/runner/workspace ./internal/runnerproto ./internal/schedule ./internal/sealbox ./internal/specialist ./internal/stagingtest ./internal/taskplan ./internal/testci ./internal/toolproxy ./internal/websearch ./internal/websearch/websearchtest ./internal/websource ./internal/websource/guard ./internal/wire ./internal/wire/forgekey ./internal/wire/wireschema ./internal/wire/wiretest ./tools/drive
cache miss: amadan.net/oficina/equipo/internal/runner/provider/claude/realcli: 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/forge: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/equipo/team: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/webread: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/checks: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runnerproto: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/workspace: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/testci: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/wire/wireschema: 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 2m27.462s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/equipo/chat took 30.925s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/equipo/github took 40.581s, over the 10s the default allows (measured on the run this cached result came from); reported only, timing fails on CI
budget note: internal/equipo/setup took 10.682s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/idtest took 1m54.759s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/release took 26.018s, 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 50.3s, over the 15s its record on line 40 allows; reported only, timing fails on CI
budget note: internal/runner/forge took 20.517s, over the 20s its record on line 35 allows; reported only, timing fails on CI
budget note: internal/runner/provider/claude/realcli took 14.388s, over the 10s the default allows; reported only, timing fails on CI

receipt: test step 2m34.241s against a 60s target (the gate's other steps are not in this figure)
receipt: 25 packages ran, 46 cached, 17 without tests, 0 failed
receipt: slow package 2m27.462s amadan.net/oficina/equipo/internal/equipo
receipt: slow package 1m54.759s amadan.net/oficina/equipo/internal/idtest
receipt: slow package 1m10.447s amadan.net/oficina/equipo/internal/runner/provider/opencode
receipt: slow package 56.223s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow package 53.699s amadan.net/oficina/equipo/internal/runner/provider/pi
receipt: slow test 55.33s amadan.net/oficina/equipo/internal/idtest TestDoorRemembersOficinaID
receipt: slow test 47.31s amadan.net/oficina/equipo/internal/idtest TestDoorStepUpIsLocal
receipt: slow test 47.25s amadan.net/oficina/equipo/internal/idtest TestDoorOficinaSettingsUnreadableIsNoLoop
receipt: slow test 46.21s amadan.net/oficina/equipo/internal/idtest TestDoorNeverJudgesANativeSession
receipt: slow test 46.12s amadan.net/oficina/equipo/internal/idtest TestDoorForgetsOficinaIDForARefusedSession
machine: 32 CPUs, load 21.20, cpu waiting 9.63%, memory waiting 0.00%, io waiting 0.06%
--- shard 18 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-chat: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$' ./internal/headless

receipt: test step 1m26.555s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m24.581s amadan.net/oficina/equipo/internal/headless
receipt: slow test 39.06s amadan.net/oficina/equipo/internal/headless TestBrowserDraftIsTheMessage
receipt: slow test 14.85s amadan.net/oficina/equipo/internal/headless TestBrowserDraftStreamsFormatted
receipt: slow test 10.6s amadan.net/oficina/equipo/internal/headless TestBrowserChat
receipt: slow test 7.59s amadan.net/oficina/equipo/internal/headless TestBrowserComposer
receipt: slow test 6.82s amadan.net/oficina/equipo/internal/headless TestBrowserChatSendStaysOnPage
machine: 32 CPUs, load 61.63, cpu waiting 38.56%, memory waiting 0.00%, io waiting 0.34%
--- shard 19 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-work: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$' ./internal/headless
rastrillo: budget test: go test failed
--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserRailFollowsWork
=== RUN   TestBrowserRailFollowsWork
time=2026-11-28T23:46:41.054Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-28T23:46:41.054Z level=INFO msg="startup phase done" phase=state_lock took=68µs
time=2026-11-28T23:46:41.054Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-28T23:46:41.054Z level=INFO msg="startup phase done" phase=claim_roots took=94µs
time=2026-11-28T23:46:41.054Z level=INFO msg="startup phase" phase=sweep
time=2026-11-28T23:46:41.098Z level=INFO msg="startup phase done" phase=sweep took=44.683ms
time=2026-11-28T23:46:41.099Z level=INFO msg="startup phase" phase=credentials
time=2026-11-28T23:46:41.099Z level=INFO msg="startup phase done" phase=credentials took=183µs
time=2026-11-28T23:46:41.099Z level=INFO msg="startup phase" phase=open_state
time=2026-11-28T23:46:41.145Z level=INFO msg="startup phase done" phase=open_state took=45.999ms
time=2026-11-28T23:46:41.145Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-28T23:46:41.147Z level=INFO msg=connecting host=127.0.0.1:43761 protocol=36
time=2026-11-28T23:46:41.148Z level=INFO msg=connected host=127.0.0.1:43761 took=1.283ms
time=2026-11-28T23:46:41.148Z level=INFO msg="capabilities gathering"
time=2026-11-28T23:46:41.149Z level=INFO msg="capabilities gathered" took=424µs tags=linux,claude,go
time=2026-11-28T23:46:41.149Z level=INFO msg="hello sent" protocol=36
time=2026-11-28T23:46:41.154Z level=INFO msg=welcome protocol=36 role=primary generation=1
time=2026-11-28T23:46:42.331Z level=INFO msg="connection checked" connection=claude-1 state=healthy
time=2026-11-28T23:46:48.780Z level=INFO msg="kept sessions" kept=1 bytes=2885 expired=0
time=2026-11-28T23:46:53.240Z level=INFO msg="kept sessions" kept=2 bytes=5037 expired=0
time=2026-11-28T23:46:54.316Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-28T23:46:54.316Z level=INFO msg="startup phase done" phase=state_lock took=66µs
time=2026-11-28T23:46:54.316Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-28T23:46:54.316Z level=INFO msg="startup phase done" phase=claim_roots took=85µs
time=2026-11-28T23:46:54.316Z level=INFO msg="startup phase" phase=sweep
time=2026-11-28T23:46:54.374Z level=INFO msg="startup phase done" phase=sweep took=58.383ms
time=2026-11-28T23:46:54.376Z level=INFO msg="startup phase" phase=credentials
time=2026-11-28T23:46:54.376Z level=INFO msg="startup phase done" phase=credentials took=179µs
time=2026-11-28T23:46:54.376Z level=INFO msg="startup phase" phase=open_state
time=2026-11-28T23:46:54.428Z level=INFO msg="startup phase done" phase=open_state took=52.218ms
time=2026-11-28T23:46:54.429Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-28T23:46:54.432Z level=INFO msg=connecting host=127.0.0.1:42877 protocol=36
time=2026-11-28T23:46:54.433Z level=INFO msg=connected host=127.0.0.1:42877 took=1.065ms
time=2026-11-28T23:46:54.433Z level=INFO msg="capabilities gathering"
time=2026-11-28T23:46:54.435Z level=INFO msg="capabilities gathered" took=1.997ms tags=linux,claude,go
time=2026-11-28T23:46:54.438Z level=INFO msg="hello sent" protocol=36
time=2026-11-28T23:46:54.442Z level=INFO msg=welcome protocol=36 role=primary generation=1
time=2026-11-28T23:46:56.593Z level=INFO msg="connection checked" connection=claude-1 state=healthy
    browser_review_test.go:57: waiting for document.querySelector('#rail [data-specialist="engineering"]')?.dataset.state==='working' && document.querySelector('#rail [data-specialist="engineering"]').querySelector('[equipo-nav-task]')?.textContent==='Slow sidebar change' && document.querySelector('#nav-tasks [data-count]')?.textContent==='1': context deadline exceeded (last evaluation: context deadline exceeded)
time=2026-11-28T23:47:00.579Z level=WARN msg="step account" err=cancelled
--- FAIL: TestBrowserRailFollowsWork (20.16s)

--- FAIL amadan.net/oficina/equipo/internal/headless (package output)
FAIL
rastrillo-budget/v1 ran 1m29.413s
FAIL	amadan.net/oficina/equipo/internal/headless	89.642s


receipt: test step 1m31.256s 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 1m29.413s amadan.net/oficina/equipo/internal/headless
receipt: slow test 24.92s amadan.net/oficina/equipo/internal/headless TestBrowserTaskThread
receipt: slow test 20.16s amadan.net/oficina/equipo/internal/headless TestBrowserRailFollowsWork
receipt: slow test 13.3s amadan.net/oficina/equipo/internal/headless TestBrowserReceiptFollowsReview
receipt: slow test 12.17s amadan.net/oficina/equipo/internal/headless TestBrowserTaskCard
receipt: slow test 9.97s amadan.net/oficina/equipo/internal/headless TestBrowserAskAfterMerge
exit status 1
+ go test -tags browser,testbuild -timeout 15m -run '^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$' -v -run '^TestBrowserRailFollowsWork$' -count=1 ./internal/headless   (retry, once)
##############################################################################
FLAKE ./internal/headless:TestBrowserRailFollowsWork browser-headless-work cfcf97981aad9c2053c841b53eff1b6d55740e7a 20.16s 62.38
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 50.89, cpu waiting 30.32%, memory waiting 0.00%, io waiting 0.21%
--- shard 20 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-connections: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^TestBrowserConnections|^TestBrowserPasteBox$|^TestBrowserPasteCopiesItsBox$' ./internal/headless

receipt: test step 1m55.533s 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 1m53.626s amadan.net/oficina/equipo/internal/headless
receipt: slow test 14.95s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsConversation
receipt: slow test 13.34s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAddPage
receipt: slow test 12.62s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAdd
receipt: slow test 11.47s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsSignInEmail
receipt: slow test 11.26s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsMeteredLimitRequired
machine: 32 CPUs, load 49.06, cpu waiting 29.40%, memory waiting 0.00%, io waiting 0.21%
--- shard 21 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-rest: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAskAfterMerge|TestBrowserCardAnswerSettlesAtBottom|TestBrowserChat|TestBrowserChatSendStaysOnPage|TestBrowserComposer|TestBrowserComposerDock|TestBrowserComposerFocus|TestBrowserComposerReconcile|TestBrowserConnectionsAdd|TestBrowserConnectionsAddPage|TestBrowserConnectionsConversation|TestBrowserConnectionsCopyLink|TestBrowserConnectionsEndedNote|TestBrowserConnectionsMeteredLimitRequired|TestBrowserConnectionsOpenCodeGoLimitRequired|TestBrowserConnectionsSignIn|TestBrowserConnectionsSignInEmail|TestBrowserConnectionsSignInSwitch|TestBrowserConnectionsToken|TestBrowserCopyContinue|TestBrowserCopySettingAndFlag|TestBrowserDraftIsTheMessage|TestBrowserDraftStreamsFormatted|TestBrowserEmptyExplore|TestBrowserMoveIn|TestBrowserNotebook|TestBrowserNotebookLook|TestBrowserPasteBox|TestBrowserPasteBoxLook|TestBrowserPasteCopiesItsBox|TestBrowserRailFollowsWork|TestBrowserReceiptFollowsReview|TestBrowserReceiptsDesktop|TestBrowserReceiptsTouch|TestBrowserRefreshRace|TestBrowserStalePageReloads|TestBrowserTaskCard|TestBrowserTaskThread|TestBrowserThinkingAndCards|TestBrowserUsageAndAdvice|TestBrowserWaitingTurns|TestNotebookScreenshots)$' -skip '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$|^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$|^TestBrowserConnections|^TestBrowserPasteBox$|^TestBrowserPasteCopiesItsBox$' ./internal/headless
rastrillo: budget test: go test failed
--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserCopyContinue
=== RUN   TestBrowserCopyContinue
time=2026-11-28T23:47:06.095Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-28T23:47:06.095Z level=INFO msg="startup phase done" phase=state_lock took=77µs
time=2026-11-28T23:47:06.095Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-28T23:47:06.096Z level=INFO msg="startup phase done" phase=claim_roots took=95µs
time=2026-11-28T23:47:06.096Z level=INFO msg="startup phase" phase=sweep
time=2026-11-28T23:47:06.143Z level=INFO msg="startup phase done" phase=sweep took=47.607ms
time=2026-11-28T23:47:06.143Z level=INFO msg="startup phase" phase=credentials
time=2026-11-28T23:47:06.143Z level=INFO msg="startup phase done" phase=credentials took=179µs
time=2026-11-28T23:47:06.143Z level=INFO msg="startup phase" phase=open_state
time=2026-11-28T23:47:06.198Z level=INFO msg="startup phase done" phase=open_state took=54.108ms
time=2026-11-28T23:47:06.198Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-28T23:47:06.200Z level=INFO msg=connecting host=127.0.0.1:42695 protocol=36
time=2026-11-28T23:47:06.204Z level=INFO msg=connected host=127.0.0.1:42695 took=3.883ms
time=2026-11-28T23:47:06.204Z level=INFO msg="capabilities gathering"
time=2026-11-28T23:47:06.205Z level=INFO msg="capabilities gathered" took=1.278ms tags=linux,claude,go
time=2026-11-28T23:47:06.206Z level=INFO msg="hello sent" protocol=36
time=2026-11-28T23:47:06.213Z level=INFO msg=welcome protocol=36 role=primary generation=1
    browser_copy_test.go:90: waiting for !document.querySelector('[data-copy-continue]'): context deadline exceeded (last evaluation: context deadline exceeded)
--- FAIL: TestBrowserCopyContinue (6.60s)

--- FAIL amadan.net/oficina/equipo/internal/headless (package output)
FAIL
rastrillo-budget/v1 ran 1m42.004s
FAIL	amadan.net/oficina/equipo/internal/headless	102.201s


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

receipt: test step 4.138s 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.463s amadan.net/oficina/equipo/internal/equipo
receipt: slow test 1.85s amadan.net/oficina/equipo/internal/equipo TestBrowserPreviewPassExchange
receipt: slow test 620ms amadan.net/oficina/equipo/internal/equipo TestBrowserPreviewBlocksNavigation
browser lane browser-rest: ./internal/equipotest
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserGitHubManifestCSP)$' ./internal/equipotest

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

receipt: test step 12.29s 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 10.779s amadan.net/oficina/equipo/internal/idtest
receipt: slow test 8.53s amadan.net/oficina/equipo/internal/idtest TestBrowserSmartDoor
receipt: slow test 2.24s amadan.net/oficina/equipo/internal/idtest TestBrowserOficinaIDDoor
browser lane browser-rest: ./internal/plan3test
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestTeamsHierarchyBrowser)$' ./internal/plan3test

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

receipt: test step 3m40.204s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 3m37.641s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 26.24s amadan.net/oficina/equipo/internal/thintest TestBrowserAccessRequest
receipt: slow test 14.44s amadan.net/oficina/equipo/internal/thintest TestBrowserSettingsTeams
receipt: slow test 12.04s amadan.net/oficina/equipo/internal/thintest TestBrowserThinkingCycles
receipt: slow test 10.78s amadan.net/oficina/equipo/internal/thintest TestBrowserPlacementQuestionAndPending
receipt: slow test 9.43s amadan.net/oficina/equipo/internal/thintest TestBrowserRhythm
machine: 32 CPUs, load 7.20, cpu waiting 3.31%, memory waiting 0.00%, io waiting 0.01%
--- shard 23 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
shard 23: make test-quarantine
python3 scripts/ci-test.py quarantine
quarantine: 12 tests from scripts/ci-quarantine.txt; a failure is retried once, and a pass on the retry is reported as a flake
+ go test -tags testbuild -timeout 15m -v -run '^TestHeadlessConnections$/^A5_cancel_and_sign_out$|^TestHeadlessConnections$/^C4_claude_sign_in$|^TestHeadlessConnections$/^C5_engineering_failover$|^TestHeadlessConnections$/^C5_engineering_to_codex$|^TestHeadlessConnections$/^C5_engineering_waits$' ./internal/headless   (54s)
ok ./internal/headless TestHeadlessConnections/A5_cancel_and_sign_out 4.57s
ok ./internal/headless TestHeadlessConnections/C4_claude_sign_in 1.38s
ok ./internal/headless TestHeadlessConnections/C5_engineering_failover 9.01s
ok ./internal/headless TestHeadlessConnections/C5_engineering_to_codex 9.10s
ok ./internal/headless TestHeadlessConnections/C5_engineering_waits 27.77s
+ 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   (58s)
ok ./internal/headless TestHeadlessConnections/C5_review_auth 13.49s
ok ./internal/headless TestHeadlessConnections/C5_review_failover 11.66s
ok ./internal/headless TestHeadlessConnections/C5_review_on_codex 10.36s
ok ./internal/headless TestHeadlessConnections/C5_review_other_family_first 20.08s
+ go test -tags testbuild -timeout 15m -v -run '^TestMixedVersions$' ./internal/headless   (21s)
ok ./internal/headless TestMixedVersions 18.49s
+ go test -tags testbuild -timeout 15m -v -run '^TestCheckSandboxDeniedPathsTampering$' ./internal/runner/checks   (2s)
ok ./internal/runner/checks TestCheckSandboxDeniedPathsTampering 0.80s
+ go test -tags testbuild -timeout 15m -v -run '^TestRunnerCancelAndSupersede$' ./internal/runner/thin   (2s)
ok ./internal/runner/thin TestRunnerCancelAndSupersede 0.05s
quarantine: 0 flaked (passed on the retry), 0 failed
machine: 32 CPUs, load 53.77, cpu waiting 36.45%, memory waiting 0.00%, io waiting 0.55%
--- shard 24 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
shard 24: make runner-host
python3 scripts/runner-prerequisites.py
CGO_ENABLED=0 RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py retried runner-host -run 'TestDirect|TestProvider|TestCheckSandbox' -count=1 ./internal/runner/provider/... ./internal/runner/checks
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -no-time -run 'TestDirect|TestProvider|TestCheckSandbox' -count=1 ./internal/runner/provider/... ./internal/runner/checks

receipt: test step 11.918s against a 60s target (the gate's other steps are not in this figure)
receipt: 4 packages ran, 0 cached, 4 without tests, 0 failed
receipt: slow package 7.401s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow package 183ms amadan.net/oficina/equipo/internal/runner/provider/claude
receipt: slow package 70ms 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/claude/realcli
receipt: slow test 5.28s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsGoFixture
receipt: slow test 1.72s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPaths
receipt: slow test 300ms amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsCache
receipt: slow test 180ms amadan.net/oficina/equipo/internal/runner/provider/claude TestDirectJournalAdapterBarrier
receipt: slow test 80ms amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxToolchain
CGO_ENABLED=0 RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py retried runner-host -run '^TestNamespace' -count=1 ./internal/runner/containment
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -no-time -run '^TestNamespace' -count=1 ./internal/runner/containment

receipt: test step 3.411s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 3.037s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow test 300ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceReadOnlyScratch
receipt: slow test 180ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryUnavailableProof
receipt: slow test 120ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceDirectPolicyAdmission
receipt: slow test 110ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceReapsOrphans
receipt: slow test 110ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryCleansScratch
machine: 32 CPUs, load 21.36, cpu waiting 8.26%, memory waiting 0.00%, io waiting 1.15%
--- 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 38.5%, load 23.76
shard 25: make runner-dead-references lanes-check build vet fmt-check spacing budget migration-check
python3 scripts/runner-dead-references.py
reference scan: 3073 text files, 3282 matches, 0 failures
python3 native/scripts/check-share.py
Share packaging, keychain-only boundary and reviewed copy verified
python3 scripts/ci-test.py check
lanes: 18 lanes and 5 browser lanes run every test once; 20-check@29
CGO_ENABLED=0 go build ./...
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o /dev/null ./cmd/equipo-runner
go vet ./...
go vet -tags testbuild ./internal/runner/thin ./internal/headless
GOOS=darwin GOARCH=arm64 go vet ./cmd/equipo-runner/... ./internal/runner/... ./internal/wire/... ./internal/release/...
go tool fiesta spacing -skip tokens.css internal/equipo/static
go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget size
budget size: 97 directories within budget
CGO_ENABLED=0 go test ./internal/equipo -run '^TestMigrationModels$' -count=1
ok  	amadan.net/oficina/equipo/internal/equipo	2.609s
machine: 32 CPUs, load 59.67, cpu waiting 38.55%, memory waiting 0.00%, io waiting 0.41%
--- 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 38.5%, load 23.76
shard 26: make staticcheck
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -tags browser,perf,testbuild ./...
machine: 32 CPUs, load 51.40, cpu waiting 33.53%, memory waiting 0.00%, io waiting 0.60%
--- 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 38.5%, load 23.76
shard 27: make govulncheck
go run golang.org/x/vuln/cmd/govulncheck@v1.8.0 ./...
=== Symbol Results ===

No vulnerabilities found.

Your code is affected by 0 vulnerabilities.
This scan also found 1 vulnerability in packages you import and 10
vulnerabilities in modules you require, but your code doesn't appear to call
these vulnerabilities.
Use '-show verbose' for more details.
machine: 32 CPUs, load 51.40, cpu waiting 33.53%, memory waiting 0.00%, io waiting 0.60%
--- 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 38.5%, load 25.94
shard 28: make gitleaks
11:46PM INF Unknown SCM platform. Use --platform to include links in findings. host=amadan.net
11:47PM INF 1301 commits scanned.
11:47PM INF scanned ~69340023 bytes (69.34 MB) in 25.2s
11:47PM INF no leaks found
machine: 32 CPUs, load 53.77, cpu waiting 34.69%, memory waiting 0.00%, io waiting 0.58%
=== 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' ./...

amadan: job cancelled — a newer push superseded it
diff --git a/.rastrillo/budgets.txt b/.rastrillo/budgets.txt
index 8cb8a169..8470572e 100644
--- a/.rastrillo/budgets.txt
+++ b/.rastrillo/budgets.txt
@@ -57,7 +57,7 @@ perf GET /api/v1/assistant/snapshot skip Assistant person API: bearer-only JSON
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.
perf GET /api/v1/assistant/abilities skip Assistant person API: bearer-only JSON for Base's Settings line, not a browser screen.
-size internal/equipo/chat 41200 14459 File facts/diffs, previews, merge authority, unfinished work, CI feedback, receipts, Assistant files, places, waiting cards, abilities, lookups; measured 41200/14459.
+size internal/equipo/chat 41259 14550 File facts/diffs, previews, merge authority, unfinished work, CI feedback, receipts, Assistant files, places, waiting cards, abilities, lookups; measured 41259/14550.
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.
@@ -72,7 +72,7 @@ perf GET /tasks/{id}/files/{file} skip Research kept images: the bytes of one im
perf GET /api/v1/runners skip Mac runners person API: bearer-only JSON for devices; the browser shows runners in the Team section.
time cmd/equipo-runner 60s TestReleaseRunnerHasNoFakeWorker builds the release runner and the thin package under testbuild (about 12s locally).
size internal/headless - 11873 Grant scenarios (#48); sign-in email at 1280 and 390; Assistant files end to end; the restart wait; the live site waits for a place; a card answer settles at the bottom; measured 11873 test lines.
-size internal/thintest - 38055 Protocol 31 contracts, 35 diffs, stuck tasks, no-access merges, held retries, unfinished work, free rounds, previews, Assistant files, places, abilities, lookups; measured 38055.
+size internal/thintest - 38058 Protocol 31 contracts, 35 diffs, stuck tasks, no-access merges, held retries, unfinished work, free rounds, previews, Assistant files, places, abilities, lookups; measured 38058.
perf GET /api/v1/projects/{id}/merge-policy skip Merge authority person API: bearer-only JSON for devices; the browser reads the policy on /projects/{id}.
perf GET /api/v1/usage skip Thin v1 person API: bearer-only JSON for devices; the browser reads usage through /usage.
diff --git a/internal/equipo/chat/lookup.go b/internal/equipo/chat/lookup.go
index d403367e..200ecb98 100644
--- a/internal/equipo/chat/lookup.go
+++ b/internal/equipo/chat/lookup.go
@@ -101,6 +101,7 @@ func (s *Store) webLookup(ctx context.Context, call toolCallRecord) (json.RawMes
var pack wire.LookupPack
var replay *lookupRecord
err := s.tx(ctx, func(t *txn) error {
+ t.db = quietDB(t.db)
var prior lookupRecord
if err := t.db.Where("call_id = ? AND person = ?", call.CallID, call.Person).Limit(1).Find(&prior).Error; err != nil || prior.ID != "" {
replay = &prior
@@ -110,14 +111,19 @@ func (s *Store) webLookup(ctx context.Context, call toolCallRecord) (json.RawMes
if err := t.db.Where("id = ? AND person = ?", call.TurnID, call.Person).First(&turn).Error; err != nil {
return err
}
- var inTurn, today int64
- if err := t.db.Model(&lookupRecord{}).Where("turn_id = ? AND attempt = ?", call.TurnID, call.Attempt).Count(&inTurn).Error; err != nil {
+ // The cap is the whole turn's, whatever its attempts; the order
+ // is the attempt's (the reply shows its final attempt's).
+ var inTurn, inAttempt, today int64
+ if err := t.db.Model(&lookupRecord{}).Where("turn_id = ?", call.TurnID).Count(&inTurn).Error; err != nil {
+ return err
+ }
+ if err := t.db.Model(&lookupRecord{}).Where("turn_id = ? AND attempt = ?", call.TurnID, call.Attempt).Count(&inAttempt).Error; err != nil {
return err
}
if err := t.db.Model(&lookupRecord{}).Where("person = ? AND created_at > ?", call.Person, t.now().Add(-24*time.Hour)).Count(&today).Error; err != nil {
return err
}
- run.row = lookupRecord{ID: newID("lk"), Person: call.Person, TurnID: call.TurnID, Attempt: call.Attempt, Seq: inTurn + 1, CallID: call.CallID, State: lookupRunning, CreatedAt: t.now()}
+ run.row = lookupRecord{ID: newID("lk"), Person: call.Person, TurnID: call.TurnID, Attempt: call.Attempt, Seq: inAttempt + 1, CallID: call.CallID, State: lookupRunning, CreatedAt: t.now()}
if inTurn >= lookupsPerTurn || today >= lookupsPerDay {
run.row.State, run.row.Code = lookupFailed, wire.CodeLookupLimit
return t.db.Create(&run.row).Error
@@ -277,27 +283,50 @@ func (r *lookupRun) do(ctx context.Context, pack wire.LookupPack) (answer string
var explicitAddr = regexp.MustCompile(`(?i)\b[a-z][a-z0-9+.-]{1,15}://[^\s<>"']+|\b(?:[a-z0-9-]+\.)+[a-z][a-z0-9-]*:\d{1,5}(?:/[^\s<>"']*)?|\b\d{1,3}(?:\.\d{1,3}){3}(?::\d{1,5})?(?:/[^\s<>"']*)?`)
// typedAddresses are the addresses in the person's message, at most 3,
-// in order: those typed with a scheme, a port or an IP address as typed
-// (https assumed when none), then the bare domains websource.Mentions
-// finds on other hosts.
+// in the order they were typed: those with a scheme, a port or an IP
+// address as typed (https assumed when none), and the bare ones
+// websource.Mentions finds, each address once.
func typedAddresses(text string) []string {
- var out []string
- hosts := map[string]bool{}
- for _, m := range explicitAddr.FindAllString(text, -1) {
- m = strings.TrimRight(m, ".,;:!?)]}'\"")
+ type hit struct {
+ at int
+ raw string
+ }
+ var hits []hit
+ var spans [][]int
+ for _, loc := range explicitAddr.FindAllStringIndex(text, -1) {
+ m := strings.TrimRight(text[loc[0]:loc[1]], ".,;:!?)]}'\"")
raw := m
if !strings.Contains(m, "://") {
raw = "https://" + m
}
- if u, err := url.Parse(raw); err == nil {
- hosts[strings.ToLower(u.Hostname())] = true
- }
- out = append(out, raw)
+ hits, spans = append(hits, hit{loc[0], raw}), append(spans, loc)
}
+ inside := func(i int) bool {
+ return slices.ContainsFunc(spans, func(sp []int) bool { return i >= sp[0] && i < sp[1] })
+ }
+ lower := strings.ToLower(text)
+ used := map[int]bool{}
for _, u := range websource.Mentions(text) {
- if !hosts[strings.ToLower(u.Host)] {
- hosts[strings.ToLower(u.Host)] = true
- out = append(out, u.String())
+ host := strings.ToLower(u.Host)
+ for off := 0; off < len(lower); {
+ i := strings.Index(lower[off:], host)
+ if i < 0 {
+ break
+ }
+ i += off
+ if !inside(i) && !used[i] {
+ used[i] = true
+ hits = append(hits, hit{i, u.String()})
+ break
+ }
+ off = i + 1
+ }
+ }
+ slices.SortStableFunc(hits, func(a, b hit) int { return a.at - b.at })
+ var out []string
+ for _, h := range hits {
+ if !slices.Contains(out, h.raw) {
+ out = append(out, h.raw)
}
}
return out[:min(len(out), lookupReads)]
@@ -436,6 +465,7 @@ func (r *lookupRun) finish(ctx context.Context, answer string, sources []wire.Lo
r.row.Code = wire.CodeNothingFound
}
err := r.s.tx(ctx, func(t *txn) error {
+ t.db = quietDB(t.db)
if err := t.db.Model(&lookupRecord{}).Where("id = ?", r.row.ID).Select("state", "queries", "reads", "answer", "sources", "code").Updates(&r.row).Error; err != nil {
return err
}
@@ -445,8 +475,9 @@ func (r *lookupRun) finish(ctx context.Context, answer string, sources []wire.Lo
return t.s.authority.Audit(t.db, r.call.Person, auditLookup, "queries="+strconv.Itoa(len(r.queries))+" reads="+strconv.Itoa(len(r.reads))+" domains="+strings.Join(r.domains, ",")+" code="+r.row.Code)
})
if err != nil {
+ // Never the error itself: it may quote what was being written.
if l := r.s.logger.Load(); l != nil {
- l.Warn("lookup not stored", "call", r.call.CallID, "err", err)
+ l.Warn("lookup not stored", "call", r.call.CallID)
}
r.row.State = lookupFailed
}
@@ -496,22 +527,26 @@ func (s *Store) baseAppOrigins(ctx context.Context, person string) ([]string, er
if err != nil {
return nil, err
}
+ // Both lists must be there (an empty one is fine) and every address
+ // readable: anything less is no list at all, and the lookup fails.
+ type app struct {
+ Address *string `json:"address"`
+ }
var apps struct {
- Installed []struct {
- Address string `json:"address"`
- } `json:"installed"`
- Oficina []struct {
- Address string `json:"address"`
- } `json:"oficina"`
- }
- if err := json.Unmarshal(raw, &apps); err != nil {
- return nil, err
+ Installed *[]app `json:"installed"`
+ Oficina *[]app `json:"oficina"`
+ }
+ if err := json.Unmarshal(raw, &apps); err != nil || apps.Installed == nil || apps.Oficina == nil {
+ return nil, errors.New("lookup: base_apps not understood")
}
- var hosts []string
- for _, a := range append(apps.Installed, apps.Oficina...) {
- u, err := url.Parse(strings.TrimSpace(a.Address))
- if err != nil || u.Hostname() == "" {
- continue
+ hosts := []string{}
+ for _, a := range append(append([]app{}, *apps.Installed...), *apps.Oficina...) {
+ if a.Address == nil {
+ return nil, errors.New("lookup: base_apps not understood")
+ }
+ u, err := url.Parse(strings.TrimSpace(*a.Address))
+ if err != nil || u.Hostname() == "" || u.Scheme != "https" && u.Scheme != "http" {
+ return nil, errors.New("lookup: base_apps not understood")
}
if h := strings.ToLower(u.Hostname()); !slices.Contains(hosts, h) {
hosts = append(hosts, h)
diff --git a/internal/equipo/chat/lookup_live.go b/internal/equipo/chat/lookup_live.go
index 09bbd04c..edaa9312 100644
--- a/internal/equipo/chat/lookup_live.go
+++ b/internal/equipo/chat/lookup_live.go
@@ -57,7 +57,7 @@ func (s *Store) attachLive(runner string, protocol int, send func(context.Contex
l.conns, l.waiters = map[string]*liveConn{}, map[string]*lookupWaiter{}
}
if old := l.conns[runner]; old != nil {
- close(old.done)
+ l.end(old)
}
l.conns[runner] = c
l.mu.Unlock()
@@ -66,11 +66,22 @@ func (s *Store) attachLive(runner string, protocol int, send func(context.Contex
defer l.mu.Unlock()
if l.conns[runner] == c {
delete(l.conns, runner)
- close(c.done)
+ l.end(c)
}
}
}
+// end ends c: its waiters go (their steps fail on done), so nothing that
+// comes on it later counts. l.mu is held.
+func (l *lookupLive) end(c *liveConn) {
+ for key, w := range l.waiters {
+ if w.conn == c {
+ delete(l.waiters, key)
+ }
+ }
+ close(c.done)
+}
+
// deliverLookup hands a lookup_result that came on connection c to the
// step waiting on it there; anything else (stale, from another
// connection, unasked) is dropped.
@@ -80,7 +91,7 @@ func (s *Store) deliverLookup(c *liveConn, r wire.LookupResult) {
defer l.mu.Unlock()
key := lookupKey(r.Lookup, r.Attempt, r.Nonce, r.Stage)
w := l.waiters[key]
- if w == nil || c == nil || w.conn != c {
+ if w == nil || c == nil || w.conn != c || l.conns[c.runner] != c {
return
}
delete(l.waiters, key)
diff --git a/internal/equipo/chat/lookup_pack_test.go b/internal/equipo/chat/lookup_pack_test.go
index f299bffb..872416e2 100644
--- a/internal/equipo/chat/lookup_pack_test.go
+++ b/internal/equipo/chat/lookup_pack_test.go
@@ -246,3 +246,31 @@ func TestPackNoZoneNoCity(t *testing.T) {
t.Errorf("pack %+v", p)
}
}
+
+// A connection replaced while its step waits: the step fails, and an
+// answer that comes on the old connection afterwards counts for nothing
+// (Astra phase 3 round 2, P2).
+func TestLookupStepConnectionReplaced(t *testing.T) {
+ h := newAbilitiesHarness(t)
+ sent := make(chan wire.LookupStep, 2)
+ send := func(_ context.Context, f wire.Frame) error {
+ body, err := f.Decode()
+ if err == nil {
+ sent <- *body.(*wire.LookupStep)
+ }
+ return err
+ }
+ old, _ := h.s.attachLive("RUNNER1", wire.ProtocolLookup, send)
+ done := make(chan wire.LookupResult, 1)
+ go func() {
+ r, _ := h.s.lookupStep(context.Background(), abPerson, wire.LookupStep{Lookup: "lk", Attempt: 1, Stage: wire.LookupStageQuery})
+ done <- r
+ }()
+ step := <-sent
+ _, detach := h.s.attachLive("RUNNER1", wire.ProtocolLookup, send)
+ defer detach()
+ h.s.deliverLookup(old, wire.LookupResult{Lookup: "lk", Attempt: 1, Nonce: step.Nonce, Stage: wire.LookupStageQuery, Queries: []string{"q"}})
+ if r := <-done; r.Code != wire.CodeLookupFailed || r.Queries != nil {
+ t.Errorf("result %+v", r)
+ }
+}
diff --git a/internal/equipo/chat/lookup_test.go b/internal/equipo/chat/lookup_test.go
index 0d004446..aa9c8dce 100644
--- a/internal/equipo/chat/lookup_test.go
+++ b/internal/equipo/chat/lookup_test.go
@@ -1,6 +1,7 @@
package chat
import (
+ "bytes"
"context"
"crypto/ecdsa"
"crypto/elliptic"
@@ -10,6 +11,7 @@ import (
"crypto/x509/pkix"
"encoding/json"
"errors"
+ "log"
"math/big"
"net/http"
"net/http/httptest"
@@ -24,6 +26,7 @@ import (
"amadan.net/oficina/equipo/internal/websearch/websearchtest"
"amadan.net/oficina/equipo/internal/websource/guard"
"amadan.net/oficina/equipo/internal/wire"
+ gormlogger "gorm.io/gorm/logger"
)
const pageSentinel = "SENTINEL-WEB-TEXT-991"
@@ -344,6 +347,11 @@ func TestLookupCaps(t *testing.T) {
t.Errorf("lookup %d: %v", i+1, err)
}
}
+ // The turn's next attempt has no more (round 2, P2).
+ call.CallID, call.Attempt = "cap-retry", 2
+ if _, err := r.lookup(call, `{}`); codeOf(err) != wire.CodeLookupLimit {
+ t.Errorf("a retry of the turn: %v", err)
+ }
r = newLookupRig(t)
for i := range 100 {
if err := r.h.s.db.G.Create(&lookupRecord{ID: "old" + itoa64(int64(i)), Person: abPerson, TurnID: "x", Attempt: 1, Seq: int64(i), CallID: "o" + itoa64(int64(i)), State: lookupShown, CreatedAt: r.h.now().Add(-time.Hour)}).Error; err != nil {
@@ -556,7 +564,54 @@ func TestTypedAddressesNotPages(t *testing.T) {
t.Errorf("%.60q: no refusal recorded: %s", words, row.Reads)
}
}
- if got := typedAddresses("See example.org:8080/x and www.met.ie please."); len(got) != 2 || got[0] != "https://example.org:8080/x" || got[1] != "https://www.met.ie/" {
+ if got := typedAddresses("See www.met.ie first, then example.org:8080/x please."); len(got) != 2 || got[0] != "https://www.met.ie/" || got[1] != "https://example.org:8080/x" {
t.Errorf("typed %v", got)
}
+ // Two pages on one host are two addresses (round 2, P2).
+ if got := typedAddresses("Compare example.org/a with example.org/b"); len(got) != 2 || got[0] == got[1] {
+ t.Errorf("one host's pages: %v", got)
+ }
+}
+
+// Nothing of a lookup reaches the SQL log, even at its most verbose: its
+// queries, addresses and answer are written with logging off (Astra
+// phase 3 round 2, P1).
+func TestLookupNotInSQLLog(t *testing.T) {
+ r := newLookupRig(t)
+ var buf bytes.Buffer
+ r.h.s.db.G.Logger = gormlogger.New(log.New(&buf, "", 0), gormlogger.Config{LogLevel: gormlogger.Info})
+ r.queries = []string{"dublin " + strings.ToLower(pageSentinel)}
+ r.search.Results[r.queries[0]] = []websearch.Result{{Title: "Met", URL: "https://www.met.ie/" + pageSentinel}}
+ r.answer = "Rain. " + pageSentinel
+ if _, err := r.lookup(r.ask("Weather?", wire.TurnPerson), `{}`); err != nil {
+ t.Fatal(err)
+ }
+ if strings.Contains(strings.ToLower(buf.String()), strings.ToLower(pageSentinel)) {
+ t.Errorf("the SQL log holds the lookup: %.300s", buf.String())
+ }
+ if !strings.Contains(buf.String(), "SELECT") {
+ t.Error("the log captured nothing: the test proves nothing")
+ }
+}
+
+// A base_apps answer that leaves anything out isn't an empty list: the
+// lookup fails, and a list fetched earlier stands only while it may
+// (Astra phase 3 round 2, P1).
+func TestDenyListMustBeWhole(t *testing.T) {
+ for _, apps := range []string{`{}`, `null`, `{"installed":[]}`, `{"installed":[],"oficina":[{"name":"Cal"}]}`, `{"installed":[{"address":"not a url"}],"oficina":[]}`} {
+ r := newLookupRig(t)
+ r.apps.apps = apps
+ r.search.Results["dublin weather"] = []websearch.Result{{Title: "Met", URL: "https://www.met.ie/dublin"}}
+ if _, err := r.lookup(r.ask("Weather?", wire.TurnPerson), `{}`); codeOf(err) != wire.CodeLookupFailed || len(r.web.requests()) != 0 {
+ t.Errorf("%s: %v, read %v", apps, err, r.web.requests())
+ }
+ }
+ r := newLookupRig(t)
+ if hosts, err := r.h.s.lookupDeny(context.Background(), abPerson); err != nil || len(hosts) != 2 {
+ t.Fatalf("%v %v", hosts, err)
+ }
+ r.apps.apps = `{}`
+ if hosts, err := r.h.s.lookupDeny(context.Background(), abPerson); err != nil || len(hosts) != 2 {
+ t.Errorf("a fresh list was replaced: %v %v", hosts, err)
+ }
}
diff --git a/internal/equipo/chat/lookup_view_test.go b/internal/equipo/chat/lookup_view_test.go
index 6c048eb7..eafe5365 100644
--- a/internal/equipo/chat/lookup_view_test.go
+++ b/internal/equipo/chat/lookup_view_test.go
@@ -30,9 +30,6 @@ func TestTwoLookupsOneReply(t *testing.T) {
r := newLookupRig(t)
r.search.Results["dublin weather"] = []websearch.Result{{Title: "Met", URL: "https://www.met.ie/dublin"}}
call := r.ask("Weather in Dublin and Cork?", wire.TurnPerson)
- if err := r.h.s.db.G.Create(&lookupRecord{ID: "early", Person: abPerson, TurnID: call.TurnID, Attempt: 0, Seq: 1, CallID: "early", State: lookupShown, Answer: "Old.", Sources: `[{"url":"https://www.met.ie/","title":"Met"}]`, CreatedAt: r.h.now()}).Error; err != nil {
- t.Fatal(err)
- }
for i, answer := range []string{"Dublin: rain.", "Cork: sun."} {
r.answer = answer
call.CallID = "two" + itoa64(int64(i))
@@ -44,6 +41,17 @@ func TestTwoLookupsOneReply(t *testing.T) {
if len(got) != 2 || got[0].Answer != "Dublin: rain." || got[1].Answer != "Cork: sun." || got[0].Sources[0].URL != "https://www.met.ie/dublin" {
t.Errorf("lookups %+v", got)
}
+ call = r.ask("Weather?", wire.TurnPerson)
+ if err := r.h.s.db.G.Create(&lookupRecord{ID: "early", Person: abPerson, TurnID: call.TurnID, Attempt: 0, Seq: 1, CallID: "early", State: lookupShown, Answer: "Old.", Sources: `[{"url":"https://www.met.ie/","title":"Met"}]`, CreatedAt: r.h.now()}).Error; err != nil {
+ t.Fatal(err)
+ }
+ r.answer = "New."
+ if _, err := r.lookup(call, `{}`); err != nil {
+ t.Fatal(err)
+ }
+ if got := r.replyTo(call).Lookups; len(got) != 1 || got[0].Answer != "New." {
+ t.Errorf("an earlier attempt's was shown: %+v", got)
+ }
}
func TestAnswerLinksStripped(t *testing.T) {
diff --git a/internal/equipo/chat/store.go b/internal/equipo/chat/store.go
index 9abbe0bc..b3cf66f5 100644
--- a/internal/equipo/chat/store.go
+++ b/internal/equipo/chat/store.go
@@ -290,9 +290,22 @@ func (t *txn) messageEvent(m messageRecord) error {
if err := withFiles(t.db, v); err != nil {
return err
}
+ if len(v[0].Lookups) > 0 {
+ // A reply carrying lookups' answers is written with SQL logging
+ // off: a slow or failed statement never prints them.
+ prior := t.db
+ t.db = quietDB(prior)
+ defer func() { t.db = prior }()
+ }
return t.event(m.Lane, m.Person, wire.EventMessage, "message", m.ID, m.Revision, m.TurnID, m.ID, 0, v[0])
}
+// quietDB is db with SQL logging off, for writes that hold a lookup's
+// queries, addresses or answer.
+func quietDB(db *gorm.DB) *gorm.DB {
+ return db.Session(&gorm.Session{Logger: logger.Discard, NewDB: false})
+}
+
func (t *txn) turnView(r turnRecord) (wire.Turn, error) {
ids := []string{}
if err := t.db.Model(&messageRecord{}).Where("turn_id = ? AND role = ?", r.ID, wire.RolePerson).Order("seq").Pluck("id", &ids).Error; err != nil {
diff --git a/internal/thintest/assistant_ops_contract_test.go b/internal/thintest/assistant_ops_contract_test.go
index 69184376..2a81ec5d 100644
--- a/internal/thintest/assistant_ops_contract_test.go
+++ b/internal/thintest/assistant_ops_contract_test.go
@@ -395,7 +395,7 @@ func TestContractLook(t *testing.T) {
}
res = o.use("u1", "base_apps", map[string]any{})
- if res.IsError || res.Text != `{"apps":[{"name":"Shop","url":"https://shop.example.com"}]}` || res.Replayed {
+ if res.IsError || res.Text != `{"installed":[{"id":"shop","name":"Shop","address":"https://shop.example.com"}],"store":[],"oficina":[]}` || res.Replayed {
t.Fatalf("use %+v", res)
}
if o.base.Calls("base_apps") != 1 || !slices.Equal(o.base.Inputs("base_apps"), []string{"{}"}) || !slices.Equal(o.base.Keys("base_apps"), []string{""}) {
diff --git a/internal/thintest/fakebase.go b/internal/thintest/fakebase.go
index 48a43dac..aae6589d 100644
--- a/internal/thintest/fakebase.go
+++ b/internal/thintest/fakebase.go
@@ -58,7 +58,7 @@ func StartFakeBase(t testing.TB) *FakeBase {
{Name: "base_people", Description: "List the people on the person's team.", Scope: "base.read", ReadOnly: true, Idempotent: true, App: "Base", Input: object},
{Name: "base_settings", Description: "Read the person's Base settings.", Scope: "base.read", ReadOnly: true, Idempotent: true, App: "Base", Input: object},
}
- f.output["base_apps"] = `{"apps":[{"name":"Shop","url":"https://shop.example.com"}]}`
+ f.output["base_apps"] = `{"installed":[{"id":"shop","name":"Shop","address":"https://shop.example.com"}],"store":[],"oficina":[]}`
f.output["base_people"] = `{"people":[{"name":"Owner"}]}`
f.output["base_settings"] = `{"settings":{"language":"en"}}`
l, err := net.Listen("tcp", "127.0.0.1:0")
diff --git a/internal/thintest/lookup_e2e_test.go b/internal/thintest/lookup_e2e_test.go
index 674805ac..37284f40 100644
--- a/internal/thintest/lookup_e2e_test.go
+++ b/internal/thintest/lookup_e2e_test.go
@@ -83,6 +83,9 @@ func newLookupE2E(t *testing.T, protocol int, draws bool) *lookupE2E {
if draws {
o.client.Capabilities = wire.CapLookupAnswers
}
+ if _, err := o.a.PutTimeZone(o.ctx, "Europe/Dublin"); err != nil {
+ t.Fatal(err)
+ }
if _, err := o.a.Snapshot(o.ctx); err != nil {
t.Fatal(err)
}
@@ -159,7 +162,7 @@ func TestWeatherDublinGetsForecast(t *testing.T) {
}
o.mu.Lock()
defer o.mu.Unlock()
- if len(o.steps) != 2 || o.steps[0].Pack.City == "" || o.steps[0].Pack.Earlier != nil || len(o.steps[1].Pages) != 1 {
+ if len(o.steps) != 2 || o.steps[0].Pack.City != "Dublin" || o.steps[0].Pack.Earlier != nil || len(o.steps[1].Pages) != 1 {
t.Errorf("steps %+v", o.steps)
}
}
diff --git a/internal/websearch/backends.go b/internal/websearch/backends.go
index 7d01b653..b4cad418 100644
--- a/internal/websearch/backends.go
+++ b/internal/websearch/backends.go
@@ -52,7 +52,7 @@ func (b *backend) Search(ctx context.Context, q string, n int) ([]Result, error)
if r.Rule == guard.RuleRedirect {
return nil, &Error{Backend: b.name, Class: ClassBadResponse}
}
- return nil, &Error{Backend: b.name, Class: ClassUnavailable, Unsent: preSend[r.Rule]}
+ return nil, &Error{Backend: b.name, Class: ClassUnavailable, Unsent: !r.Sent}
}
results, class := b.parse(res.Status, res.Body)
if class != "" {
@@ -61,9 +61,6 @@ func (b *backend) Search(ctx context.Context, q string, n int) ([]Result, error)
return clean(results, n), nil
}
-// preSend are the guard's rules that refuse before anything is sent.
-var preSend = map[string]bool{guard.RuleScheme: true, guard.RulePort: true, guard.RuleHost: true, guard.RuleIPLiteral: true, guard.RuleDenied: true, guard.RulePrivate: true, guard.RuleInventory: true, guard.RuleUnconfirmed: true, guard.RulePolicy: true, guard.RuleURL: true}
-
// statusClass is a non-200's class: 401 and 403 auth, 402 and 429 limit
// (out of credit, or too many), 5xx unavailable, else bad_response.
func statusClass(status int) string {
diff --git a/internal/websearch/websearch_test.go b/internal/websearch/websearch_test.go
index e183c03a..56d5de59 100644
--- a/internal/websearch/websearch_test.go
+++ b/internal/websearch/websearch_test.go
@@ -539,6 +539,26 @@ func TestUnsentSearchesRefunded(t *testing.T) {
if u.Used[websearch.Reservation{Backend: "kagi", Month: "2026-11"}] != 0 {
t.Errorf("an unsent request used quota: %v", u.Used)
}
+ // DNS failing, and a connection refused before anything is written:
+ // nothing went out, nothing is used (round 2, P2).
+ for name, broken := range map[string]func(*guard.Config){
+ "dns": func(g *guard.Config) {
+ g.Resolve = func(context.Context, string) ([]netip.Addr, error) { return nil, errors.New("no such host") }
+ },
+ "connect": func(g *guard.Config) {
+ g.TestDial = func(string) (string, *x509.CertPool) { return "127.0.0.1:1", v.roots }
+ },
+ } {
+ g := v.guard()
+ broken(&g)
+ s, err := websearch.NewKagi(sentinel, g)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if _, _, err := (websearch.Chain{Primary: s, Usage: u}).Search(context.Background(), "q", 8, nil); err == nil || u.Used[websearch.Reservation{Backend: "kagi", Month: "2026-11"}] != 0 {
+ t.Errorf("%s: %v, used %v", name, err, u.Used)
+ }
+ }
p, _, _ := fakes()
ctx, cancel := context.WithCancel(context.Background())
p.Hook = func(context.Context, string) error { cancel(); return context.Canceled }
diff --git a/internal/websource/guard/dial.go b/internal/websource/guard/dial.go
index 0f1ae8e5..181c59dc 100644
--- a/internal/websource/guard/dial.go
+++ b/internal/websource/guard/dial.go
@@ -10,9 +10,11 @@ import (
"io"
"net"
"net/http"
+ "net/http/httptrace"
"net/netip"
"net/url"
"strings"
+ "sync/atomic"
"syscall"
"amadan.net/oficina/equipo/internal/websource"
@@ -235,18 +237,23 @@ func (c *Client) send(ctx context.Context, method string, u url.URL, body []byte
if cr := c.cfg.Credential; cr != nil && cr.Header != "" && origin(u) == cr.Origin {
req.Header.Set(cr.Header, cr.Value)
}
+ var wrote atomic.Bool
+ req = req.WithContext(httptrace.WithClientTrace(req.Context(), &httptrace.ClientTrace{WroteRequest: func(httptrace.WroteRequestInfo) { wrote.Store(true) }}))
res, err := client.Do(req)
if err != nil {
var r Refusal
+ rule := RuleUnavailable
switch {
case errors.As(err, &r):
- return nil, c.refuse(r.Rule, host)
+ rule = r.Rule
case rctx.Err() != nil || errors.Is(err, context.DeadlineExceeded):
- return nil, c.refuse(RuleTimeout, host)
+ rule = RuleTimeout
}
// Never err itself: a *url.Error prints the URL, and a search's
// key may ride in its query.
- return nil, c.refuse(RuleUnavailable, host)
+ out := c.refuse(rule, host).(Refusal)
+ out.Sent = wrote.Load()
+ return nil, out
}
defer res.Body.Close()
resp := &Response{Status: res.StatusCode, Header: res.Header.Clone()}
@@ -254,13 +261,13 @@ func (c *Client) send(ctx context.Context, method string, u url.URL, body []byte
return resp, nil
}
if res.ContentLength > c.cfg.Limit {
- return nil, c.refuse(RuleTooLarge, host)
+ return nil, c.refuseSent(RuleTooLarge, host)
}
var rdr io.Reader = res.Body
if strings.EqualFold(res.Header.Get("Content-Encoding"), "gzip") {
gz, err := gzip.NewReader(res.Body)
if err != nil {
- return nil, c.refuse(RuleUnavailable, host)
+ return nil, c.refuseSent(RuleUnavailable, host)
}
defer gz.Close()
rdr = gz
@@ -268,17 +275,24 @@ func (c *Client) send(ctx context.Context, method string, u url.URL, body []byte
raw, err := io.ReadAll(io.LimitReader(rdr, c.cfg.Limit+1))
if err != nil {
if rctx.Err() != nil {
- return nil, c.refuse(RuleTimeout, host)
+ return nil, c.refuseSent(RuleTimeout, host)
}
- return nil, c.refuse(RuleUnavailable, host)
+ return nil, c.refuseSent(RuleUnavailable, host)
}
if int64(len(raw)) > c.cfg.Limit {
- return nil, c.refuse(RuleTooLarge, host)
+ return nil, c.refuseSent(RuleTooLarge, host)
}
resp.Body, resp.Type = raw, sniff(raw, res.Header.Get("Content-Type"))
return resp, nil
}
+// refuseSent is refuse for a request already sent: its answer failed.
+func (c *Client) refuseSent(rule, host string) error {
+ r := c.refuse(rule, host).(Refusal)
+ r.Sent = true
+ return r
+}
+
// origin is u's scheme and host.
func origin(u url.URL) string { return u.Scheme + "://" + strings.ToLower(u.Host) }
diff --git a/internal/websource/guard/guard.go b/internal/websource/guard/guard.go
index eae76ffd..dbf574ac 100644
--- a/internal/websource/guard/guard.go
+++ b/internal/websource/guard/guard.go
@@ -121,8 +121,13 @@ type Response struct {
}
// Refusal is why a request was not made, or not finished: a stable rule,
-// safe to log and to store. It never holds an address or a value.
-type Refusal struct{ Rule string }
+// safe to log and to store. It never holds an address or a value. Sent
+// says the request had been written to the connection before it failed;
+// false means nothing went out.
+type Refusal struct {
+ Rule string
+ Sent bool
+}
func (r Refusal) Error() string { return "guard: refused: " + r.Rule }