oficina / equipo Public

equipo: migration 0115, storage for data specialists and Design

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

What changed:
- internal/equipo/migrations/0115_specialist_storage.sql (and appended
  to schema.sql), additive only, no backfill:
  - chat_specialists.project_id text NOT NULL DEFAULT "" ("" is the
    team, so every existing row stays the team's), and two partial
    unique indexes, chat_specialist_open (profile, project_id) WHERE
    state = 'proposed' and chat_specialist_active (profile, project_id)
    WHERE state = 'active': one open proposal and one active row per
    profile and scope (task 15). Today that rule lived in code only
    (proposeSpecialist, answerSpecialist); the existing non-unique
    chat_specialist_profile index stays. Existing data already holds at
    most one of each per profile, so the indexes build on it.
  - chat_tasks.maker_specialist_id text NOT NULL DEFAULT "" ("" is
    Engineering) and chat_tasks.design_runs integer NOT NULL DEFAULT 0.
  - chat_steps.specialist_id, specialist_revision, specialist_project,
    specialist_caps (JSON list), defaults "" / 0 (no data specialist),
    with index chat_step_specialist for revoke-by-specialist (task 16).
  - chat_task_files.source text NOT NULL DEFAULT "research" (existing
    rows and writers that leave it unset stay Research; "render" is a
    Design capture), option and tree_digest, both DEFAULT "".
- Models: specialistRecord.ProjectID (with the index tags),
  taskRecord.MakerSpecialistID and DesignRuns, stepRecord's four
  Specialist* binding fields, taskFileRecord.Source/Option/TreeDigest
  and the taskFileResearch/taskFileRender constants. Tags follow the
  repo's NOT NULL DEFAULT convention (default:'' for "", default:0,
  default:research). Team records; no scope.Owned anywhere.

Ruling (controller): design_runs lives on chat_tasks, not chat_steps
as the plan's task 14 list has it. Task 17 counts Design attempts
(first runs, retries, fix rounds) since the person last acted on the
task, "stored on the task": a task-level counter.

Tests:
  CGO_ENABLED=0 go test ./internal/equipo/ -run 'TestSpecialistStorageMigrationKeepsMeaning|TestSpecialistScopeUniqueness|^TestMigrationModels$|TestConversationMigrationSnapshot'
  CGO_ENABLED=0 go test ./internal/equipo/chat/ -run TestSpecialistStorageRoundTrip
  also: the whole internal/equipo/chat package; internal/equipo -run
  'Specialist|Research|Migration|Schema|Snapshot'; internal/thintest
  -run 'Specialist|Research'; scripts/runner-dead-references.py; vet;
  the darwin/arm64 runner build.

RED: no migration 0115; sp_team ("" active) refused: table
chat_specialists has no column named project_id; the chat test failed
to build (unknown field ProjectID, MakerSpecialistID, DesignRuns,
SpecialistID, ..., Source; undefined taskFileRender).

GREEN: ok for each command above.

Mutations (each restored, then green again):
- chat_specialist_active dropped from 0115: TestSpecialistScopeUniqueness
  failed (sp_team2: a second active row in scope "") and
  TestMigrationModels failed (models and migrations disagree).
- chat_specialist_open dropped: the same two failed (sp_team_open2).
- the active index on profile alone: TestSpecialistScopeUniqueness
  failed (sp_p1 refused: UNIQUE constraint failed:
  chat_specialists.profile).
- source DEFAULT "" instead of "research": KeepsMeaning failed (old
  file source "", want research) and TestMigrationModels failed.
- project_id nullable without default: KeepsMeaning failed (old row
  NULL, want "") and TestMigrationModels failed.
- the model's default:research dropped: TestSpecialistStorageRoundTrip
  failed (unset Source "") and TestMigrationModels failed.
- the project_id half of the model's active-index tag dropped: SURVIVED
  TestMigrationModels (the rastrillo dump compares the index by name,
  not its columns); the round-trip test gained a scope check on the
  Models-built store and then failed (duplicated key not allowed).
- the model's open-index tags dropped: the round-trip test failed
  (sp_p1_open2 accepted) and TestMigrationModels failed (DROP INDEX
  chat_specialist_open).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 656540319af3e84b8c48f9e2f45bc9c6616889c0 parent 6cc538b
7 files changed, +275 −2
  • internal/equipo/chat/research_results.go +12 −0
  • internal/equipo/chat/specialist_storage_test.go +69 −0
  • internal/equipo/chat/specialists.go +6 −2
  • internal/equipo/chat/tasks.go +14 −0
  • internal/equipo/migrations/0115_specialist_storage.sql +26 −0
  • internal/equipo/migrations/schema.sql +27 −0
  • internal/equipo/specialist_storage_migration_test.go +121 −0

CI failed — run details

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

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

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

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

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

receipt: test step 1m22.665s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m20.125s amadan.net/oficina/equipo/internal/headless
receipt: slow test 40.54s amadan.net/oficina/equipo/internal/headless TestMacWorker
receipt: slow test 21.38s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 9.18s amadan.net/oficina/equipo/internal/headless TestHeadlessPrewarm
receipt: slow test 9.02s amadan.net/oficina/equipo/internal/headless TestHeadlessAttachments
machine: 32 CPUs, load 72.90, cpu waiting 46.82%, memory waiting 0.00%, io waiting 0.43%
--- 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 1m40.773s 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 1m38.188s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m7.97s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 9.39s amadan.net/oficina/equipo/internal/headless TestHeadlessRunnerKillLeavesNoCopies
receipt: slow test 8.57s amadan.net/oficina/equipo/internal/headless TestHeadlessCopyRotation
receipt: slow test 7.33s amadan.net/oficina/equipo/internal/headless TestHeadlessPolicyGuards
receipt: slow test 4.91s amadan.net/oficina/equipo/internal/headless TestHeadlessNewHouseRuleStartsFresh
machine: 32 CPUs, load 68.79, cpu waiting 43.49%, memory waiting 0.00%, io waiting 0.32%
--- 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 3m4.563s 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 3m2.087s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m45.06s amadan.net/oficina/equipo/internal/headless TestHeadlessAssistant
receipt: slow test 20.35s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 9.3s amadan.net/oficina/equipo/internal/headless TestHeadlessResearchHandoff
receipt: slow test 7.23s amadan.net/oficina/equipo/internal/headless TestHeadlessAssistantAttachments
receipt: slow test 6.8s amadan.net/oficina/equipo/internal/headless TestHeadlessTurnBatching
machine: 32 CPUs, load 25.18, cpu waiting 11.37%, memory waiting 0.00%, io waiting 0.07%
--- shard 6 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane thintest: ./internal/thintest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^Test([^C]|C[^o]|Co[^n]|Con[^t])|^TestContract(Assistant|Outcome|Team|Handoff|HostAllowlist|HostIsPerPerson|Look|Use[A-Z]|RemoteCall|LanesRunAtOnce|NoMergeQuestionWhenGateMerges|PreviewHeldUntilPublishAnswer|PreviewNotHeldBelow19|PublishNeedsOwnerAnswer)' ./internal/thintest

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

receipt: test step 2m0.587s 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.827s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 9.66s amadan.net/oficina/equipo/internal/thintest TestContractRetryPreviewUnverifiedMerge
receipt: slow test 9.12s amadan.net/oficina/equipo/internal/thintest TestContractPreviewNotScheduled
receipt: slow test 4.97s amadan.net/oficina/equipo/internal/thintest TestContractPublishNotOffered
receipt: slow test 4.58s amadan.net/oficina/equipo/internal/thintest TestContractMacRecheckMergeAuthority
receipt: slow test 3.03s amadan.net/oficina/equipo/internal/thintest TestContractPausedJob
machine: 32 CPUs, load 54.37, cpu waiting 32.19%, memory waiting 0.00%, io waiting 0.22%
--- 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
rastrillo: budget test: go test failed
--- FAIL amadan.net/oficina/equipo/internal/runner/thin TestSnapshotRefusesASelfResumingWriter
=== RUN   TestSnapshotRefusesASelfResumingWriter
    worksnap_adversary_linux_test.go:232: 0 of 5 copies saw the page change; 0 refused busy
    worksnap_adversary_linux_test.go:234: the self-resuming writer never wrote during a copy: the test proves nothing
--- FAIL: TestSnapshotRefusesASelfResumingWriter (0.77s)

--- FAIL amadan.net/oficina/equipo/internal/runner/thin (package output)
FAIL
rastrillo-budget/v1 ran 5m24.096s
FAIL	amadan.net/oficina/equipo/internal/runner/thin	324.189s


receipt: test step 5m25.768s 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 5m24.096s amadan.net/oficina/equipo/internal/runner/thin
receipt: slow test 37.07s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeAnsweredByAnotherModel
receipt: slow test 36.93s amadan.net/oficina/equipo/internal/runner/thin TestModelsEngineeringProbesThenRunsTheStrongest
receipt: slow test 36.88s amadan.net/oficina/equipo/internal/runner/thin TestModelsUnhealthyRetriedOnDemand
receipt: slow test 18.51s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeRunsInsideTheAdmission
receipt: slow test 10.1s amadan.net/oficina/equipo/internal/runner/thin TestTimeoutKeepsNothingForAnOlderInstance
exit status 1
+ go test -tags testbuild -timeout 15m -v -run '^TestSnapshotRefusesASelfResumingWriter$' -count=1 ./internal/runner/thin   (retry, once)
FAILED TWICE ./internal/runner/thin:TestSnapshotRefusesASelfResumingWriter runner-thin
=== RUN   TestSnapshotRefusesASelfResumingWriter
    worksnap_adversary_linux_test.go:232: 0 of 5 copies saw the page change; 0 refused busy
    worksnap_adversary_linux_test.go:234: the self-resuming writer never wrote during a copy: the test proves nothing
--- FAIL: TestSnapshotRefusesASelfResumingWriter (0.77s)
FAIL
rastrillo-budget/v1 ran 775ms
FAIL	amadan.net/oficina/equipo/internal/runner/thin	0.787s
FAIL
machine: 32 CPUs, load 4.36, cpu waiting 1.06%, memory waiting 0.00%, io waiting 0.01%
make: *** [Makefile:113: ci-shard] Error 1

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

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

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

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

receipt: test step 1m12.815s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m10.605s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 31.03s amadan.net/oficina/equipo/internal/equipotest TestBootstrapNamesOwnersSetting
receipt: slow test 30.9s amadan.net/oficina/equipo/internal/equipotest TestAuthorityCoreIntegration
receipt: slow test 28.62s amadan.net/oficina/equipo/internal/equipotest TestAccountLabelMigration
receipt: slow test 25.42s amadan.net/oficina/equipo/internal/equipotest TestAuthorityGrantReferences
receipt: slow test 25.38s amadan.net/oficina/equipo/internal/equipotest TestAuthorityFailureIsNotRevocation
machine: 32 CPUs, load 65.20, cpu waiting 42.59%, memory waiting 0.00%, io waiting 0.30%
--- 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 39.5%, load 21.79
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 2m17.156s 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 2m14.978s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 20.97s amadan.net/oficina/equipo/internal/equipotest TestProjectWritesRequireCurrentOwner
receipt: slow test 20.97s amadan.net/oficina/equipo/internal/equipotest TestProjectsFailuresRollBack
receipt: slow test 20.94s amadan.net/oficina/equipo/internal/equipotest TestProjectConcurrentRetry
receipt: slow test 20.93s amadan.net/oficina/equipo/internal/equipotest TestProjectRejectsUnsafeBinding
receipt: slow test 20.91s amadan.net/oficina/equipo/internal/equipotest TestProjectsReopen
machine: 32 CPUs, load 33.08, cpu waiting 15.34%, memory waiting 0.00%, io waiting 0.10%
--- shard 14 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-r started 30s late; cpu waiting 39.5%, load 21.79
test lane equipotest-r: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestR' ./internal/equipotest
budget note: internal/equipotest took 5m34.478s, over the 5m0s its record on line 15 allows; reported only, timing fails on CI

receipt: test step 5m40.248s 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 5m34.478s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 4m41.58s amadan.net/oficina/equipo/internal/equipotest TestReleaseStampContract
receipt: slow test 13.22s amadan.net/oficina/equipo/internal/equipotest TestRosterChangesAffectExistingSession
receipt: slow test 10.16s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalWhileAssigned
receipt: slow test 10.14s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalRollsBack
receipt: slow test 7.07s amadan.net/oficina/equipo/internal/equipotest TestRosterBootstrapOnce
machine: 32 CPUs, load 3.17, cpu waiting 0.50%, memory waiting 0.00%, io waiting 0.00%
--- shard 15 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-rest started 30s late; cpu waiting 39.5%, load 21.79
test lane equipotest-rest: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -skip '^Test[A-D]|^TestQ|^Test[E-P]|^TestR' ./internal/equipotest

receipt: test step 1m11.032s 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.927s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 27.62s amadan.net/oficina/equipo/internal/equipotest TestSigninNoProof
receipt: slow test 27.28s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedExistingTeam
receipt: slow test 27.25s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedRollback
receipt: slow test 25.19s amadan.net/oficina/equipo/internal/equipotest TestSigninBackgroundSweep
receipt: slow test 25.15s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsUpgrade
machine: 32 CPUs, load 68.79, cpu waiting 43.49%, memory waiting 0.00%, io waiting 0.32%
--- shard 16 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: plan3test started 30s late; cpu waiting 39.5%, load 21.79
test lane plan3test: ./internal/plan3test
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m ./internal/plan3test
--- FAIL amadan.net/oficina/equipo/internal/plan3test TestPlan3ReleaseBoundaries
=== RUN   TestPlan3ReleaseBoundaries
--- FAIL: TestPlan3ReleaseBoundaries (0.33s)

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

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


receipt: test step 58.091s 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 55.983s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 4.14s amadan.net/oficina/equipo/internal/plan3test TestPlan3Upgrade
receipt: slow test 3.7s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3B
receipt: slow test 1.75s amadan.net/oficina/equipo/internal/plan3test TestConversationQuestionRace
receipt: slow test 1.64s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3A
receipt: slow test 1.46s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorMessageSourcesUpgrade
rastrillo: budget test: go test failed
exit status 1
+ go test -tags testbuild -timeout 15m -v -run '^TestPlan3ReleaseBoundaries$/^inventory$' -count=1 ./internal/plan3test   (retry, once)
FAILED TWICE ./internal/plan3test:TestPlan3ReleaseBoundaries/inventory plan3test
=== RUN   TestPlan3ReleaseBoundaries
=== RUN   TestPlan3ReleaseBoundaries/inventory
    plan3_release_test.go:22: entry has no copy review status or applicable acceptance chat.specialist.capability.branch.edit
--- FAIL: TestPlan3ReleaseBoundaries (0.02s)
    --- FAIL: TestPlan3ReleaseBoundaries/inventory (0.02s)
FAIL
rastrillo-budget/v1 ran 16ms
FAIL	amadan.net/oficina/equipo/internal/plan3test	0.215s
FAIL
machine: 32 CPUs, load 69.79, cpu waiting 46.09%, memory waiting 0.00%, io waiting 0.39%
make: *** [Makefile:113: ci-shard] Error 1

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

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

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

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

--- FAIL amadan.net/oficina/equipo/internal/runner/provider/codex TestCodexAsyncQuestionAnswer
=== RUN   TestCodexAsyncQuestionAnswer
--- FAIL: TestCodexAsyncQuestionAnswer (0.21s)

--- FAIL amadan.net/oficina/equipo/internal/runner/provider/codex TestCodexAsyncQuestionAnswer/schema
=== RUN   TestCodexAsyncQuestionAnswer/schema
    answers_test.go:103: answer not transmitted <nil>
--- FAIL: TestCodexAsyncQuestionAnswer/schema (0.10s)

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

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

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

budget note: internal/equipo took 2m38.986s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/equipo/chat took 27.1s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/equipo/github took 38.122s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/equipo/setup took 13.109s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/idtest took 2m0.351s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/release took 50.282s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/runner/containment took 1m6.145s, over the 15s its record on line 40 allows; reported only, timing fails on CI
budget note: internal/runner/forge took 28.302s, over the 20s its record on line 35 allows; reported only, timing fails on CI
budget note: internal/runner/provider/claude/realcli took 14.168s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/runner/provider/pi took 1m19.639s, over the 1m0s its record on line 27 allows; reported only, timing fails on CI
budget note: internal/runner/render took 1m29.242s, over the 10s the default allows; reported only, timing fails on CI

receipt: test step 2m44.583s against a 60s target (the gate's other steps are not in this figure)
receipt: 51 packages ran, 18 cached, 17 without tests, 3 failed
receipt: slow package 2m38.986s amadan.net/oficina/equipo/internal/equipo
receipt: slow package 2m0.351s amadan.net/oficina/equipo/internal/idtest
receipt: slow package 1m29.242s amadan.net/oficina/equipo/internal/runner/render
receipt: slow package 1m19.639s amadan.net/oficina/equipo/internal/runner/provider/pi
receipt: slow package 1m7.514s amadan.net/oficina/equipo/internal/runner/provider/opencode
receipt: slow test 57.8s amadan.net/oficina/equipo/internal/idtest TestDoorRemembersOficinaID
receipt: slow test 50.31s amadan.net/oficina/equipo/internal/runner/render TestLaunchNeverClaimsAnUnprovenEnd
receipt: slow test 49.9s amadan.net/oficina/equipo/internal/idtest TestDoorStepUpIsLocal
receipt: slow test 49.14s amadan.net/oficina/equipo/internal/idtest TestDoorOficinaSettingsUnreadableIsNoLoop
receipt: slow test 49.06s amadan.net/oficina/equipo/internal/idtest TestDoorForgetsOficinaIDForARefusedSession
rastrillo: budget test: go test failed
exit status 1
+ go test -tags testbuild -timeout 15m -v -run '^TestHoldLeavesNothingStopped$|^TestHoldStopsANamespaceJoiner$|^TestHoldStopsAReparentedDaemon$' -count=1 ./internal/runner/pause   (retry, once)
FAILED TWICE ./internal/runner/pause:TestHoldLeavesNothingStopped rest
FAILED TWICE ./internal/runner/pause:TestHoldStopsANamespaceJoiner rest
FAILED TWICE ./internal/runner/pause:TestHoldStopsAReparentedDaemon rest
=== RUN   TestHoldLeavesNothingStopped
--- PASS: TestHoldLeavesNothingStopped (0.01s)
=== RUN   TestHoldStopsANamespaceJoiner
--- PASS: TestHoldStopsANamespaceJoiner (0.32s)
=== RUN   TestHoldStopsAReparentedDaemon
    pause_linux_test.go:603: daemon made no progress in 2s
    pause_linux_test.go:69: sandbox stderr: 
--- FAIL: TestHoldStopsAReparentedDaemon (2.31s)
FAIL
FAIL	amadan.net/oficina/equipo/internal/runner/pause	2.649s
FAIL
+ go test -tags testbuild -timeout 15m -v -run '^TestCodexAsyncQuestionAnswer$/^schema$' -count=1 ./internal/runner/provider/codex   (retry, once)
##############################################################################
FLAKE ./internal/runner/provider/codex:TestCodexAsyncQuestionAnswer/schema rest 656540319af3e84b8c48f9e2f45bc9c6616889c0 0.10s 21.99
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
+ go test -tags testbuild -timeout 15m -v -run '^TestBudgetRecordsAreShort$' -count=1 ./internal/testci   (retry, once)
FAILED TWICE ./internal/testci:TestBudgetRecordsAreShort rest
=== RUN   TestBudgetRecordsAreShort
    budgets_file_test.go:37: .rastrillo/budgets.txt:41: reason is 325 bytes, over 200
    budgets_file_test.go:37: .rastrillo/budgets.txt:59: reason is 224 bytes, over 200
    budgets_file_test.go:37: .rastrillo/budgets.txt:74: reason is 249 bytes, over 200
--- FAIL: TestBudgetRecordsAreShort (0.00s)
FAIL
rastrillo-budget/v1 ran 0s
FAIL	amadan.net/oficina/equipo/internal/testci	0.004s
FAIL
machine: 32 CPUs, load 20.55, cpu waiting 9.00%, memory waiting 0.00%, io waiting 0.05%
make: *** [Makefile:113: ci-shard] Error 1

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

receipt: test step 1m27.472s 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 1m25.555s amadan.net/oficina/equipo/internal/headless
receipt: slow test 39.15s amadan.net/oficina/equipo/internal/headless TestBrowserDraftIsTheMessage
receipt: slow test 14.97s amadan.net/oficina/equipo/internal/headless TestBrowserDraftStreamsFormatted
receipt: slow test 10.82s amadan.net/oficina/equipo/internal/headless TestBrowserChat
receipt: slow test 7.5s amadan.net/oficina/equipo/internal/headless TestBrowserComposer
receipt: slow test 7.09s amadan.net/oficina/equipo/internal/headless TestBrowserChatSendStaysOnPage
machine: 32 CPUs, load 69.79, cpu waiting 46.09%, memory waiting 0.00%, io waiting 0.39%
--- shard 19 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-work: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$' ./internal/headless

receipt: test step 1m38.196s 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.37s amadan.net/oficina/equipo/internal/headless
receipt: slow test 29.55s amadan.net/oficina/equipo/internal/headless TestBrowserRailFollowsWork
receipt: slow test 23.61s amadan.net/oficina/equipo/internal/headless TestBrowserTaskThread
receipt: slow test 13.59s amadan.net/oficina/equipo/internal/headless TestBrowserReceiptFollowsReview
receipt: slow test 11.12s amadan.net/oficina/equipo/internal/headless TestBrowserTaskCard
receipt: slow test 9.64s amadan.net/oficina/equipo/internal/headless TestBrowserAskAfterMerge
machine: 32 CPUs, load 68.79, cpu waiting 44.12%, memory waiting 0.00%, io waiting 0.33%
--- shard 20 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-connections: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^TestBrowserConnections|^TestBrowserPasteBox$|^TestBrowserPasteCopiesItsBox$' ./internal/headless

receipt: test step 1m56.561s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m54.497s amadan.net/oficina/equipo/internal/headless
receipt: slow test 15.08s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsConversation
receipt: slow test 13.35s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAddPage
receipt: slow test 12.81s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAdd
receipt: slow test 11.39s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsMeteredLimitRequired
receipt: slow test 11.27s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsSignInEmail
machine: 32 CPUs, load 54.37, cpu waiting 34.26%, memory waiting 0.00%, io waiting 0.24%
--- shard 21 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-rest: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAskAfterMerge|TestBrowserCardAnswerSettlesAtBottom|TestBrowserChat|TestBrowserChatSendStaysOnPage|TestBrowserComposer|TestBrowserComposerDock|TestBrowserComposerFocus|TestBrowserComposerReconcile|TestBrowserConnectionsAdd|TestBrowserConnectionsAddPage|TestBrowserConnectionsConversation|TestBrowserConnectionsCopyLink|TestBrowserConnectionsEndedNote|TestBrowserConnectionsMeteredLimitRequired|TestBrowserConnectionsOpenCodeGoLimitRequired|TestBrowserConnectionsSignIn|TestBrowserConnectionsSignInEmail|TestBrowserConnectionsSignInSwitch|TestBrowserConnectionsToken|TestBrowserCopyContinue|TestBrowserCopySettingAndFlag|TestBrowserDraftIsTheMessage|TestBrowserDraftStreamsFormatted|TestBrowserEmptyExplore|TestBrowserMoveIn|TestBrowserNotebook|TestBrowserNotebookLook|TestBrowserPasteBox|TestBrowserPasteBoxLook|TestBrowserPasteCopiesItsBox|TestBrowserRailFollowsWork|TestBrowserReceiptFollowsReview|TestBrowserReceiptsDesktop|TestBrowserReceiptsTouch|TestBrowserRefreshRace|TestBrowserStalePageReloads|TestBrowserTaskCard|TestBrowserTaskThread|TestBrowserThinkingAndCards|TestBrowserUsageAndAdvice|TestBrowserWaitingTurns|TestNotebookScreenshots)$' -skip '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$|^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$|^TestBrowserConnections|^TestBrowserPasteBox$|^TestBrowserPasteCopiesItsBox$' ./internal/headless
rastrillo: budget test: go test failed
--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserCopyContinue
=== RUN   TestBrowserCopyContinue
time=2026-11-28T22:57:34.764Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-28T22:57:34.764Z level=INFO msg="startup phase done" phase=state_lock took=65µs
time=2026-11-28T22:57:34.764Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-28T22:57:34.764Z level=INFO msg="startup phase done" phase=claim_roots took=93µs
time=2026-11-28T22:57:34.764Z level=INFO msg="startup phase" phase=sweep
time=2026-11-28T22:57:34.828Z level=INFO msg="startup phase done" phase=sweep took=64.18ms
time=2026-11-28T22:57:34.832Z level=INFO msg="startup phase" phase=credentials
time=2026-11-28T22:57:34.832Z level=INFO msg="startup phase done" phase=credentials took=158µs
time=2026-11-28T22:57:34.832Z level=INFO msg="startup phase" phase=open_state
time=2026-11-28T22:57:34.896Z level=INFO msg="startup phase done" phase=open_state took=63.571ms
time=2026-11-28T22:57:34.896Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-28T22:57:34.896Z level=INFO msg=connecting host=127.0.0.1:33933 protocol=36
time=2026-11-28T22:57:34.899Z level=INFO msg=connected host=127.0.0.1:33933 took=2.777ms
time=2026-11-28T22:57:34.900Z level=INFO msg="capabilities gathering"
time=2026-11-28T22:57:34.900Z level=INFO msg="capabilities gathered" took=891µs tags=linux,claude,go
time=2026-11-28T22:57:34.901Z level=INFO msg="hello sent" protocol=36
time=2026-11-28T22:57:34.909Z 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: <nil>)
--- FAIL: TestBrowserCopyContinue (6.71s)

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


receipt: test step 1m46.053s against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 0 cached, 0 without tests, 1 failed
receipt: slow package 1m43.787s amadan.net/oficina/equipo/internal/headless
receipt: slow test 15.13s amadan.net/oficina/equipo/internal/headless TestBrowserThinkingAndCards
receipt: slow test 13.42s amadan.net/oficina/equipo/internal/headless TestBrowserWaitingTurns
receipt: slow test 11.32s amadan.net/oficina/equipo/internal/headless TestBrowserStalePageReloads
receipt: slow test 9.57s amadan.net/oficina/equipo/internal/headless TestBrowserMoveIn
receipt: slow test 7.48s amadan.net/oficina/equipo/internal/headless TestBrowserNotebookLook
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 656540319af3e84b8c48f9e2f45bc9c6616889c0 6.71s 65.20
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 61.02, cpu waiting 37.69%, memory waiting 0.00%, io waiting 0.27%
--- 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.775s 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.575s amadan.net/oficina/equipo/internal/equipo
receipt: slow test 1.98s amadan.net/oficina/equipo/internal/equipo TestBrowserPreviewPassExchange
receipt: slow test 590ms 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.988s 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.29s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 6.29s amadan.net/oficina/equipo/internal/equipotest TestBrowserGitHubManifestCSP
browser lane browser-rest: ./internal/idtest
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserOficinaIDDoor|TestBrowserSmartDoor)$' ./internal/idtest
budget note: internal/idtest took 11.081s, over the 10s the default allows; reported only, timing fails on CI

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

receipt: test step 4.012s 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.402s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 2.4s amadan.net/oficina/equipo/internal/plan3test TestTeamsHierarchyBrowser
browser lane browser-rest: ./internal/thintest
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAccessEmojiByline|TestBrowserAccessFinalOutcomes|TestBrowserAccessRequest|TestBrowserAccessReview|TestBrowserActivitySubjects|TestBrowserAutonomySettings|TestBrowserCoordinatorQueue|TestBrowserEmptyConversation|TestBrowserEndedNoteStaysGone|TestBrowserHousekeeping|TestBrowserInnerGallery|TestBrowserInnerScreens|TestBrowserInstantThinking|TestBrowserInstantThinkingQueued|TestBrowserMachines|TestBrowserPausedWork|TestBrowserPhoneIndex|TestBrowserPlacementQuestionAndPending|TestBrowserProjectPlacement|TestBrowserProjectsList|TestBrowserReportActionFeedback|TestBrowserReportNextSteps|TestBrowserReportThread|TestBrowserRhythm|TestBrowserRollup|TestBrowserRosterAlignment|TestBrowserRosterDecisionStates|TestBrowserRosterQuietDay|TestBrowserRosterReports|TestBrowserRosterSetAside|TestBrowserRosterSubchat|TestBrowserRosterThinking|TestBrowserRosterVisual|TestBrowserSettingsHousekeepingGroups|TestBrowserSettingsMenu|TestBrowserSettingsRail|TestBrowserSettingsSaveBar|TestBrowserSettingsShots|TestBrowserSettingsStayOnPage|TestBrowserSettingsTeams|TestBrowserShipsButtons|TestBrowserSpecialistRows|TestBrowserSpendFollowsAnswers|TestBrowserTaskRows|TestBrowserTeamPanel|TestBrowserThinkingCycles|TestBrowserThinkingLinesClear|TestBrowserThinkingSteady|TestBrowserThinkingWords|TestBrowserTokenRowEmail|TestBrowserTrackPulse|TestBrowserTrackStarCentre|TestBrowserTryAgain)$' ./internal/thintest

receipt: test step 3m39.644s 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 3m36.675s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 26.43s amadan.net/oficina/equipo/internal/thintest TestBrowserAccessRequest
receipt: slow test 14.41s amadan.net/oficina/equipo/internal/thintest TestBrowserSettingsTeams
receipt: slow test 12.07s amadan.net/oficina/equipo/internal/thintest TestBrowserThinkingCycles
receipt: slow test 10.65s amadan.net/oficina/equipo/internal/thintest TestBrowserPlacementQuestionAndPending
receipt: slow test 9.03s amadan.net/oficina/equipo/internal/thintest TestBrowserRhythm
machine: 32 CPUs, load 10.48, cpu waiting 3.78%, memory waiting 0.00%, io waiting 0.07%
--- shard 23 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
shard 23: make test-quarantine
python3 scripts/ci-test.py quarantine
quarantine: 12 tests from scripts/ci-quarantine.txt; a failure is retried once, and a pass on the retry is reported as a flake
+ go test -tags testbuild -timeout 15m -v -run '^TestHeadlessConnections$/^A5_cancel_and_sign_out$|^TestHeadlessConnections$/^C4_claude_sign_in$|^TestHeadlessConnections$/^C5_engineering_failover$|^TestHeadlessConnections$/^C5_engineering_to_codex$|^TestHeadlessConnections$/^C5_engineering_waits$' ./internal/headless   (53s)
ok ./internal/headless TestHeadlessConnections/A5_cancel_and_sign_out 4.62s
ok ./internal/headless TestHeadlessConnections/C4_claude_sign_in 1.22s
ok ./internal/headless TestHeadlessConnections/C5_engineering_failover 8.82s
ok ./internal/headless TestHeadlessConnections/C5_engineering_to_codex 9.08s
ok ./internal/headless TestHeadlessConnections/C5_engineering_waits 26.54s
+ 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   (75s)
ok ./internal/headless TestHeadlessConnections/C5_review_auth 25.62s
ok ./internal/headless TestHeadlessConnections/C5_review_failover 21.33s
ok ./internal/headless TestHeadlessConnections/C5_review_on_codex 10.41s
ok ./internal/headless TestHeadlessConnections/C5_review_other_family_first 15.55s
+ go test -tags testbuild -timeout 15m -v -run '^TestMixedVersions$' ./internal/headless   (22s)
ok ./internal/headless TestMixedVersions 19.72s
+ go test -tags testbuild -timeout 15m -v -run '^TestCheckSandboxDeniedPathsTampering$' ./internal/runner/checks   (2s)
ok ./internal/runner/checks TestCheckSandboxDeniedPathsTampering 0.85s
+ go test -tags testbuild -timeout 15m -v -run '^TestRunnerCancelAndSupersede$' ./internal/runner/thin   (2s)
ok ./internal/runner/thin TestRunnerCancelAndSupersede 0.05s
quarantine: 0 flaked (passed on the retry), 0 failed
machine: 32 CPUs, load 73.43, cpu waiting 46.31%, memory waiting 0.00%, io waiting 0.48%
--- shard 24 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
shard 24: make runner-host
python3 scripts/runner-prerequisites.py
CGO_ENABLED=0 RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py retried runner-host -run 'TestDirect|TestProvider|TestCheckSandbox' -count=1 ./internal/runner/provider/... ./internal/runner/checks
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -no-time -run 'TestDirect|TestProvider|TestCheckSandbox' -count=1 ./internal/runner/provider/... ./internal/runner/checks

receipt: test step 14.288s 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.741s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow package 172ms amadan.net/oficina/equipo/internal/runner/provider/claude
receipt: slow package 76ms amadan.net/oficina/equipo/internal/runner/provider/codex
receipt: slow package 2ms amadan.net/oficina/equipo/internal/runner/provider
receipt: slow package 0s amadan.net/oficina/equipo/internal/runner/provider/claude/realcli
receipt: slow test 5.51s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsGoFixture
receipt: slow test 1.74s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPaths
receipt: slow test 380ms amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsCache
receipt: slow test 170ms amadan.net/oficina/equipo/internal/runner/provider/claude TestDirectJournalAdapterBarrier
receipt: slow test 100ms amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxToolchain
CGO_ENABLED=0 RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py retried runner-host -run '^TestNamespace' -count=1 ./internal/runner/containment
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -no-time -run '^TestNamespace' -count=1 ./internal/runner/containment

receipt: test step 4.202s 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.208s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow test 320ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceReadOnlyScratch
receipt: slow test 200ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryUnavailableProof
receipt: slow test 130ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceDirectPolicyAdmission
receipt: slow test 120ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryCleansScratch
receipt: slow test 110ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceExitStatus
machine: 32 CPUs, load 16.70, cpu waiting 12.55%, memory waiting 0.00%, io waiting 1.27%
--- 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 39.5%, load 21.79
shard 25: make runner-dead-references lanes-check build vet fmt-check spacing budget migration-check
python3 scripts/runner-dead-references.py
reference scan: 3089 text files, 3332 matches, 0 failures
python3 native/scripts/check-share.py
Share packaging, keychain-only boundary and reviewed copy verified
python3 scripts/ci-test.py check
lanes: 18 lanes and 5 browser lanes run every test once; 20-check@29
CGO_ENABLED=0 go build ./...
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o /dev/null ./cmd/equipo-runner
go vet ./...
go vet -tags testbuild ./internal/runner/thin ./internal/headless
GOOS=darwin GOARCH=arm64 go vet ./cmd/equipo-runner/... ./internal/runner/... ./internal/wire/... ./internal/release/...
go tool fiesta spacing -skip tokens.css internal/equipo/static
go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget size
rastrillo: budget size: 3 problem(s)
exit status 1
internal/equipo/chat: 12019 test lines, over the 11950 its exemption (line 59) allows
internal/equipo/chat: 38017 source lines, over the 37987 its exemption (line 59) allows
internal/equipo: 23927 source lines, over the 23925 its exemption (line 17) allows
make[1]: *** [Makefile:75: budget] Error 1
machine: 32 CPUs, load 73.15, cpu waiting 46.71%, memory waiting 0.00%, io waiting 0.45%
make: *** [Makefile:113: ci-shard] Error 2

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

amadan: step check shard 26 of 29 failed: exit status 2
--- shard 27 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: govulncheck started 30s late; cpu waiting 39.5%, load 21.79
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 59.94, cpu waiting 37.89%, memory waiting 0.00%, io waiting 0.69%
--- shard 28 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: gitleaks started 30s late; cpu waiting 39.5%, load 21.79
shard 28: make gitleaks
10:57PM INF Unknown SCM platform. Use --platform to include links in findings. host=amadan.net
10:57PM INF 1286 commits scanned.
10:57PM INF scanned ~69590306 bytes (69.59 MB) in 29.2s
10:57PM INF no leaks found
machine: 32 CPUs, load 66.51, cpu waiting 40.28%, memory waiting 0.00%, io waiting 0.65%

amadan: job failed at step check shards 8, 16, 17, 25, 26 of 29 — its output is above, not at the tail of this log
diff --git a/internal/equipo/chat/research_results.go b/internal/equipo/chat/research_results.go
index 97069571..644565b5 100644
--- a/internal/equipo/chat/research_results.go
+++ b/internal/equipo/chat/research_results.go
@@ -90,10 +90,22 @@ type taskFileRecord struct {
Kept bool
CreatedAt time.Time
UpdatedAt time.Time
+ // Source is taskFileResearch (an image a Research attempt kept) or
+ // taskFileRender (a Design capture); Option is the Design option the
+ // capture shows and TreeDigest the tree it was rendered from.
+ Source string `gorm:"not null;default:research"`
+ Option string `gorm:"not null;default:''"`
+ TreeDigest string `gorm:"not null;default:''"`
}
func (taskFileRecord) TableName() string { return "chat_task_files" }
+// Task file sources (chat_task_files.source).
+const (
+ taskFileResearch = "research"
+ taskFileRender = "render"
+)
+
// taskFileDataRecord is one chunk of a task file's bytes, apart, so
// listing files never loads them.
type taskFileDataRecord struct {
diff --git a/internal/equipo/chat/specialist_storage_test.go b/internal/equipo/chat/specialist_storage_test.go
new file mode 100644
index 00000000..f9c0216c
--- /dev/null
+++ b/internal/equipo/chat/specialist_storage_test.go
@@ -0,0 +1,69 @@
+package chat
+
+import (
+ "testing"
+)
+
+// Migration 0115's columns round-trip through the records under the
+// names the migration gives them, and a record that leaves them unset
+// keeps today's meaning: the team's specialist, no maker, no binding, a
+// Research file.
+func TestSpecialistStorageRoundTrip(t *testing.T) {
+ r := newHKRig(t)
+ g := r.s.db.G
+ r.must(g.Create(&specialistRecord{ID: "sp_d", Profile: "design-v1", ProjectID: "p1", Name: "Design", State: "active", Revision: 2}).Error)
+ r.must(g.Create(&taskRecord{ID: "t_d", ProjectID: "p1", Title: "Overhaul", MakerSpecialistID: "sp_d", DesignRuns: 3}).Error)
+ r.must(g.Create(&stepRecord{ID: "s_d", TaskID: "t_d", Specialist: "engineering", SpecialistID: "sp_d", SpecialistRevision: 2, SpecialistProject: "p1", SpecialistCaps: `["branch.edit","page.render"]`}).Error)
+ r.must(g.Create(&taskFileRecord{ID: "f_d", TaskID: "t_d", StepID: "s_d", Attempt: 1, Source: taskFileRender, Option: "calm", TreeDigest: "sha256:abc"}).Error)
+
+ var sp specialistRecord
+ r.must(g.First(&sp, "id = ?", "sp_d").Error)
+ var task taskRecord
+ r.must(g.First(&task, "id = ?", "t_d").Error)
+ var step stepRecord
+ r.must(g.First(&step, "id = ?", "s_d").Error)
+ var file taskFileRecord
+ r.must(g.First(&file, "id = ?", "f_d").Error)
+ if sp.ProjectID != "p1" || task.MakerSpecialistID != "sp_d" || task.DesignRuns != 3 {
+ t.Fatalf("specialist %+v task maker %q runs %d", sp, task.MakerSpecialistID, task.DesignRuns)
+ }
+ if step.SpecialistID != "sp_d" || step.SpecialistRevision != 2 || step.SpecialistProject != "p1" || step.SpecialistCaps != `["branch.edit","page.render"]` {
+ t.Fatalf("step binding %q %d %q %q", step.SpecialistID, step.SpecialistRevision, step.SpecialistProject, step.SpecialistCaps)
+ }
+ if file.Source != taskFileRender || file.Option != "calm" || file.TreeDigest != "sha256:abc" {
+ t.Fatalf("file %q %q %q", file.Source, file.Option, file.TreeDigest)
+ }
+ var cols string
+ r.must(g.Raw(`SELECT s.project_id || '|' || t.maker_specialist_id || '|' || t.design_runs || '|' || st.specialist_id || '|' || st.specialist_revision || '|' || st.specialist_project || '|' || f.source || '|' || f."option" || '|' || f.tree_digest
+ FROM chat_specialists s, chat_tasks t, chat_steps st, chat_task_files f WHERE s.id = 'sp_d' AND t.id = 't_d' AND st.id = 's_d' AND f.id = 'f_d'`).Scan(&cols).Error)
+ if cols != "p1|sp_d|3|sp_d|2|p1|render|calm|sha256:abc" {
+ t.Fatalf("columns %q", cols)
+ }
+
+ // Unset: today's meaning.
+ r.must(g.Create(&specialistRecord{ID: "sp_r", Profile: "research-v1", Name: "Research", State: "active", Revision: 1}).Error)
+ r.must(g.Create(&taskFileRecord{ID: "f_r", TaskID: "t_d", StepID: "s_d", Attempt: 1, ImageID: "i1"}).Error)
+ var plain struct {
+ Project string
+ Source string
+ }
+ r.must(g.Raw(`SELECT (SELECT project_id FROM chat_specialists WHERE id = 'sp_r') AS project, (SELECT source FROM chat_task_files WHERE id = 'f_r') AS source`).Scan(&plain).Error)
+ if plain.Project != "" || plain.Source != taskFileResearch {
+ t.Fatalf("unset columns %+v", plain)
+ }
+
+ // The records' indexes hold the migration's scope rule too (stores
+ // built from Models): the team and p1 each one active design-v1 and
+ // one open proposal, never two.
+ r.must(g.Create(&specialistRecord{ID: "sp_team", Profile: "design-v1", Name: "Design", State: "active", Revision: 1}).Error)
+ r.must(g.Create(&specialistRecord{ID: "sp_p1_open", Profile: "design-v1", ProjectID: "p1", Name: "Design", State: "proposed", Revision: 1}).Error)
+ for _, dup := range []specialistRecord{
+ {ID: "sp_p1_2", Profile: "design-v1", ProjectID: "p1", State: "active"},
+ {ID: "sp_team_2", Profile: "design-v1", State: "active"},
+ {ID: "sp_p1_open2", Profile: "design-v1", ProjectID: "p1", State: "proposed"},
+ } {
+ if err := g.Create(&dup).Error; err == nil {
+ t.Fatalf("%s: a second %s design-v1 in scope %q", dup.ID, dup.State, dup.ProjectID)
+ }
+ }
+}
diff --git a/internal/equipo/chat/specialists.go b/internal/equipo/chat/specialists.go
index c233f77d..8dd96686 100644
--- a/internal/equipo/chat/specialists.go
+++ b/internal/equipo/chat/specialists.go
@@ -23,8 +23,12 @@ import (
// specialistRecord is one data-defined specialist. Only Name, Brief and
// ModelPreference come from the row; the profile fixes the rest.
type specialistRecord struct {
- ID string `gorm:"primaryKey"`
- Profile string `gorm:"index:chat_specialist_profile"`
+ ID string `gorm:"primaryKey"`
+ Profile string `gorm:"index:chat_specialist_profile;uniqueIndex:chat_specialist_open,priority:1,where:state = 'proposed';uniqueIndex:chat_specialist_active,priority:1,where:state = 'active'"`
+ // ProjectID is the specialist's scope: "" is the team, else one
+ // project. One open proposal and one active row per profile and
+ // scope (migration 0115).
+ ProjectID string `gorm:"not null;default:'';uniqueIndex:chat_specialist_open,priority:2,where:state = 'proposed';uniqueIndex:chat_specialist_active,priority:2,where:state = 'active'"`
Name string
Brief string
ModelPreference string
diff --git a/internal/equipo/chat/tasks.go b/internal/equipo/chat/tasks.go
index e51bfdba..7b183812 100644
--- a/internal/equipo/chat/tasks.go
+++ b/internal/equipo/chat/tasks.go
@@ -127,6 +127,13 @@ type taskRecord struct {
// job thread's, "" for the person's own (J4). Its cards are raised
// there; a job that only joins it changes nothing.
Lane string `gorm:"index:chat_task_lane"`
+ // MakerSpecialistID is the data specialist that makes the task's
+ // changes ("" is Engineering): fix rounds, retries, Try again and the
+ // task Build makes of it use it. DesignRuns counts its Design attempts
+ // (first runs, retries, fix rounds) since the person last acted on
+ // the task.
+ MakerSpecialistID string `gorm:"not null;default:''"`
+ DesignRuns int64 `gorm:"not null;default:0"`
}
func (taskRecord) TableName() string { return "chat_tasks" }
@@ -287,6 +294,13 @@ type stepRecord struct {
// HeldAt is when the runner first held the step without a break (nil
// while it is not held): advice's "waited a week".
HeldAt *time.Time
+ // The binding a data specialist's step was dispatched under: the
+ // specialist, its revision, its scope ("" the team) and its granted
+ // capabilities (JSON list). SpecialistID "" is no data specialist.
+ SpecialistID string `gorm:"not null;default:'';index:chat_step_specialist"`
+ SpecialistRevision int64 `gorm:"not null;default:0"`
+ SpecialistProject string `gorm:"not null;default:''"`
+ SpecialistCaps string `gorm:"not null;default:''"`
}
func (stepRecord) TableName() string { return "chat_steps" }
diff --git a/internal/equipo/migrations/0115_specialist_storage.sql b/internal/equipo/migrations/0115_specialist_storage.sql
new file mode 100644
index 00000000..6c8a6675
--- /dev/null
+++ b/internal/equipo/migrations/0115_specialist_storage.sql
@@ -0,0 +1,26 @@
+-- Dynamic specialists slice 1 (protocol 36): Design as a data specialist.
+-- Team records, the same for every member. Nothing an existing row holds
+-- changes meaning: a specialist from before is the team's (project_id ""),
+-- a task has no maker and no Design runs, a step is bound to no data
+-- specialist, and a task file is a Research one.
+ALTER TABLE chat_specialists ADD COLUMN project_id text NOT NULL DEFAULT "";
+-- One open proposal and one active row per profile and scope (the team,
+-- or one project); declined and revoked rows are history.
+CREATE UNIQUE INDEX chat_specialist_open ON chat_specialists(profile, project_id) WHERE state = 'proposed';
+CREATE UNIQUE INDEX chat_specialist_active ON chat_specialists(profile, project_id) WHERE state = 'active';
+-- The data specialist that makes the task's changes ("" is Engineering),
+-- and the Design attempts since the person last acted on the task.
+ALTER TABLE chat_tasks ADD COLUMN maker_specialist_id text NOT NULL DEFAULT "";
+ALTER TABLE chat_tasks ADD COLUMN design_runs integer NOT NULL DEFAULT 0;
+-- The binding a step was dispatched under: the specialist, its revision,
+-- its scope and its granted capabilities (JSON); "" is none.
+ALTER TABLE chat_steps ADD COLUMN specialist_id text NOT NULL DEFAULT "";
+ALTER TABLE chat_steps ADD COLUMN specialist_revision integer NOT NULL DEFAULT 0;
+ALTER TABLE chat_steps ADD COLUMN specialist_project text NOT NULL DEFAULT "";
+ALTER TABLE chat_steps ADD COLUMN specialist_caps text NOT NULL DEFAULT "";
+CREATE INDEX chat_step_specialist ON chat_steps(specialist_id);
+-- A task file is a Research image or a Design render (of one option, at
+-- one tree digest).
+ALTER TABLE chat_task_files ADD COLUMN source text NOT NULL DEFAULT "research";
+ALTER TABLE chat_task_files ADD COLUMN option text NOT NULL DEFAULT "";
+ALTER TABLE chat_task_files ADD COLUMN tree_digest text NOT NULL DEFAULT "";
diff --git a/internal/equipo/migrations/schema.sql b/internal/equipo/migrations/schema.sql
index a5e09fec..bb8cd47a 100644
--- a/internal/equipo/migrations/schema.sql
+++ b/internal/equipo/migrations/schema.sql
@@ -838,3 +838,30 @@ CREATE INDEX chat_diff_expiry ON chat_change_diffs(expires_at);
ALTER TABLE chat_steps ADD COLUMN change_diff_expires_at datetime;
ALTER TABLE chat_steps ADD COLUMN change_diff_attempt integer;
+
+-- Dynamic specialists slice 1 (protocol 36): Design as a data specialist.
+-- Team records, the same for every member. Nothing an existing row holds
+-- changes meaning: a specialist from before is the team's (project_id ""),
+-- a task has no maker and no Design runs, a step is bound to no data
+-- specialist, and a task file is a Research one.
+ALTER TABLE chat_specialists ADD COLUMN project_id text NOT NULL DEFAULT "";
+-- One open proposal and one active row per profile and scope (the team,
+-- or one project); declined and revoked rows are history.
+CREATE UNIQUE INDEX chat_specialist_open ON chat_specialists(profile, project_id) WHERE state = 'proposed';
+CREATE UNIQUE INDEX chat_specialist_active ON chat_specialists(profile, project_id) WHERE state = 'active';
+-- The data specialist that makes the task's changes ("" is Engineering),
+-- and the Design attempts since the person last acted on the task.
+ALTER TABLE chat_tasks ADD COLUMN maker_specialist_id text NOT NULL DEFAULT "";
+ALTER TABLE chat_tasks ADD COLUMN design_runs integer NOT NULL DEFAULT 0;
+-- The binding a step was dispatched under: the specialist, its revision,
+-- its scope and its granted capabilities (JSON); "" is none.
+ALTER TABLE chat_steps ADD COLUMN specialist_id text NOT NULL DEFAULT "";
+ALTER TABLE chat_steps ADD COLUMN specialist_revision integer NOT NULL DEFAULT 0;
+ALTER TABLE chat_steps ADD COLUMN specialist_project text NOT NULL DEFAULT "";
+ALTER TABLE chat_steps ADD COLUMN specialist_caps text NOT NULL DEFAULT "";
+CREATE INDEX chat_step_specialist ON chat_steps(specialist_id);
+-- A task file is a Research image or a Design render (of one option, at
+-- one tree digest).
+ALTER TABLE chat_task_files ADD COLUMN source text NOT NULL DEFAULT "research";
+ALTER TABLE chat_task_files ADD COLUMN option text NOT NULL DEFAULT "";
+ALTER TABLE chat_task_files ADD COLUMN tree_digest text NOT NULL DEFAULT "";
diff --git a/internal/equipo/specialist_storage_migration_test.go b/internal/equipo/specialist_storage_migration_test.go
new file mode 100644
index 00000000..6014930e
--- /dev/null
+++ b/internal/equipo/specialist_storage_migration_test.go
@@ -0,0 +1,121 @@
+package equipo
+
+import (
+ "context"
+ "database/sql"
+ "testing"
+
+ "amadan.net/rastrillo/rastrillo/migrate"
+)
+
+// Migration 0115 (dynamic specialists slice 1) adds the storage Design
+// needs and changes what no existing row means: a specialist from before
+// it is the team's (""), a task has no maker and no Design runs, a step
+// is bound to no data specialist, and a task file is a Research one.
+func TestSpecialistStorageMigrationKeepsMeaning(t *testing.T) {
+ ctx := context.Background()
+ var before []migrate.Migration
+ var storage migrate.Migration
+ for _, m := range Schema.All() {
+ if m.ID == "equipo/0115_specialist_storage" {
+ storage = m
+ break
+ }
+ before = append(before, m)
+ }
+ if storage.SQL == "" {
+ t.Fatal("no migration 0115")
+ }
+ d, err := migrate.Replay(ctx, before)
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer d.Close()
+ for _, q := range []string{
+ `INSERT INTO chat_specialists (id, profile, name, state, revision) VALUES ('sp_old', 'research-v1', 'Research', 'active', 2)`,
+ `INSERT INTO chat_tasks (id, project_id, title, revision) VALUES ('t_old', 'p1', 'Old', 1)`,
+ `INSERT INTO chat_steps (id, task_id, idx, specialist, state, attempt, research_grant, research_grant_revision) VALUES ('s_old', 't_old', 0, 'research', 'done', 1, 'g_old', 2)`,
+ `INSERT INTO chat_task_files (id, task_id, step_id, attempt, image_id, kept) VALUES ('f_old', 't_old', 's_old', 1, 'i1', 1)`,
+ } {
+ if _, err := d.ExecContext(ctx, q); err != nil {
+ t.Fatal(err)
+ }
+ }
+ if _, err := d.ExecContext(ctx, storage.SQL); err != nil {
+ t.Fatal(err)
+ }
+ for _, c := range []struct{ q, want string }{
+ {`SELECT project_id FROM chat_specialists WHERE id = 'sp_old'`, ""},
+ {`SELECT maker_specialist_id || '/' || design_runs FROM chat_tasks WHERE id = 't_old'`, "/0"},
+ {`SELECT specialist_id || '/' || specialist_revision || '/' || specialist_project || '/' || specialist_caps FROM chat_steps WHERE id = 's_old'`, "/0//"},
+ {`SELECT source || '/' || option || '/' || tree_digest FROM chat_task_files WHERE id = 'f_old'`, "research//"},
+ } {
+ var got sql.NullString
+ if err := d.QueryRowContext(ctx, c.q).Scan(&got); err != nil {
+ t.Fatalf("%s: %v", c.q, err)
+ }
+ if !got.Valid || got.String != c.want {
+ t.Fatalf("%s: %+v, want %q", c.q, got, c.want)
+ }
+ }
+ // A row written after 0115 without naming the columns means the same.
+ if _, err := d.ExecContext(ctx, `INSERT INTO chat_task_files (id, task_id, step_id, attempt, image_id) VALUES ('f_new', 't_old', 's_old', 1, 'i2')`); err != nil {
+ t.Fatal(err)
+ }
+ var source string
+ if err := d.QueryRowContext(ctx, `SELECT source FROM chat_task_files WHERE id = 'f_new'`).Scan(&source); err != nil || source != "research" {
+ t.Fatalf("new file source %q %v", source, err)
+ }
+}
+
+// One open proposal and one active row per profile and scope: the team
+// ("") and each project hold their own, and no scope holds two. Declined
+// and revoked rows are history and never conflict.
+func TestSpecialistScopeUniqueness(t *testing.T) {
+ ctx := context.Background()
+ d, err := migrate.Replay(ctx, Schema.All())
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer d.Close()
+ insert := func(id, project, state string) error {
+ _, err := d.ExecContext(ctx, `INSERT INTO chat_specialists (id, profile, project_id, name, state, revision) VALUES (?, 'design-v1', ?, 'Design', ?, 1)`, id, project, state)
+ return err
+ }
+ for _, ok := range []struct{ id, project, state string }{
+ {"sp_team", "", "active"},
+ {"sp_p1", "p1", "active"},
+ {"sp_p2", "p2", "active"},
+ {"sp_team_open", "", "proposed"},
+ {"sp_p1_open", "p1", "proposed"},
+ {"sp_p1_no", "p1", "declined"},
+ {"sp_p1_no2", "p1", "declined"},
+ {"sp_p1_gone", "p1", "revoked"},
+ {"sp_p1_gone2", "p1", "revoked"},
+ } {
+ if err := insert(ok.id, ok.project, ok.state); err != nil {
+ t.Fatalf("%s (%q %s) refused: %v", ok.id, ok.project, ok.state, err)
+ }
+ }
+ for _, bad := range []struct{ id, project, state string }{
+ {"sp_team2", "", "active"},
+ {"sp_p1_2", "p1", "active"},
+ {"sp_team_open2", "", "proposed"},
+ {"sp_p1_open2", "p1", "proposed"},
+ } {
+ if err := insert(bad.id, bad.project, bad.state); err == nil {
+ t.Fatalf("%s: a second %s row for design-v1 in scope %q", bad.id, bad.state, bad.project)
+ }
+ }
+ // Another profile in the same scope is its own.
+ if _, err := d.ExecContext(ctx, `INSERT INTO chat_specialists (id, profile, project_id, name, state, revision) VALUES ('sp_r', 'research-v1', 'p1', 'Research', 'active', 1)`); err != nil {
+ t.Fatalf("research-v1 beside design-v1 in p1: %v", err)
+ }
+ // A proposal Add makes active while the scope's active row is revoked.
+ if _, err := d.ExecContext(ctx, `UPDATE chat_specialists SET state = 'revoked' WHERE id = 'sp_p1'`); err != nil {
+ t.Fatal(err)
+ }
+ if _, err := d.ExecContext(ctx, `UPDATE chat_specialists SET state = 'active' WHERE id = 'sp_p1_open'`); err != nil {
+ t.Fatalf("activating p1's proposal after the revoke: %v", err)
+ }
+}