oficina / equipo Public

Specialists named as themselves: Design in the sidebar, not Engineering

A Design step runs on Engineering's step kind with a specialist binding,
and the UI named steps by kind, so Design showed as Engineering and never
got a sidebar row. Steps and tasks now carry a Maker {id, profile}, and
every surface names a step by its maker.

- Sidebar: every active specialist added to the team or project is its
  own row with its own drawer (GET /team/{id}).
- Named by maker: rail, drawer, task page, timeline, tasks list, report
  header, asks, Connections, Usage, Live Activity, native roster.
- Tests use the production shape (an Engineering-kind step bound to
  design-v1); Astra three rounds, all findings fixed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Squashed from specialist-labels into main.
claude agent, operated by paul@keymail.dev ea3022bd16a6fdb9ea9e36f2922611adca5547a8 parent 1755d03
31 files changed, +811 −82
  • .rastrillo/budgets.txt +4 −4
  • docs/api/equipo-v1.openapi.json +23 −0
  • internal/equipo/chat/push.go +7 −0
  • internal/equipo/chat/push_maker_test.go +33 −0
  • internal/equipo/chat/store.go +4 −0
  • internal/equipo/chat/tasks.go +62 −0
  • internal/equipo/chat/usage.go +37 −0
  • internal/equipo/chat_roster.go +13 −0
  • internal/equipo/connections_view.go +28 −14
  • internal/equipo/rail.go +29 −6
  • internal/equipo/research_views.go +1 −1
  • internal/equipo/static/ask-target.js +21 −5
  • internal/equipo/static/chat-stream.js +6 −0
  • internal/equipo/static/team-panel.js +8 −2
  • internal/equipo/team_maker_test.go +85 −0
  • internal/equipo/team_panel.go +66 −25
  • internal/equipo/templates/work_task.html +1 −1
  • internal/equipo/usage_page.go +3 −0
  • internal/equipo/work_pages.go +72 −4
  • internal/equipo/work_spend.go +1 −1
  • internal/equipo/work_views.go +8 −13
  • internal/thintest/design_labels_browser_test.go +60 −0
  • internal/thintest/design_labels_contract_test.go +140 −0
  • internal/wire/push.go +2 −1
  • internal/wire/tasks.go +28 −1
  • internal/wire/usage.go +2 −1
  • native/apple/Sources/EquipoKit/API/Thin.swift +23 −0
  • native/apple/Sources/EquipoKit/Presentation/Roster.swift +3 −1
  • native/apple/Sources/EquipoKit/UI/Components.swift +1 −1
  • native/apple/Sources/EquipoKit/UI/Screens/TodaySection.swift +1 −1
  • native/apple/Tests/EquipoKitTests/MakerTests.swift +39 −0

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/needs-you-ux: 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.0s
ci-box: codex: fetched and verified in 3.6s
ci-box: codex-code-mode-host: fetched and verified in 1.5s
ci-box: libwrap: fetched and verified in 0.4s
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 10.0s
ci-box: pi: installed and verified in 7.2s
ci-box: opencode: installed and verified in 2.3s
ci-box: chromium 156.0.8078.79-1~deb13u1: 76 packages fetched, verified and unpacked in 9.7s
ci-box: clone deepened in 4.6s
ci-box: file times set from content: 3757 files, 244 directories
ci-box: ready in 18.1s
=== copy ===
EQUIPO_RELEASE_COPY_CHECK=1 CGO_ENABLED=0 go test ./internal/equipotest -run '^TestReleaseCopyReviewed$' -count=1
ok  	amadan.net/oficina/equipo/internal/equipotest	0.239s
=== compile ===
go build ./...
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py compile
+ go build -tags testbuild ./...
  1.6s
+ go list -export -test -tags testbuild -f  ./...
  0.8s
+ go list -export -test -tags browser,testbuild -f  ./internal/equipo ./internal/equipotest ./internal/headless ./internal/idtest ./internal/plan3test ./internal/thintest
  0.3s
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
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed

amadan: job cancelled — a newer push superseded it
--- shard 1 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-review: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadless$/^4_review$|^TestHeadless$/^2b_access$|^TestHeadless$/^runner_crash$|^TestHeadless$/^2b_first_message$|^TestHeadless$/^4_checks_honest$|^TestHeadless$/^7_stream_resume$|^TestHeadless$/^2b_notebook$|^TestHeadless$/^2b_move_in$|^TestHeadless$/^2b_desk_failure$|^TestHeadless$/^cancel$' ./internal/headless
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed

amadan: job cancelled — a newer push superseded it
--- shard 2 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-connections: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadlessConnections$|^TestHeadlessTokenPasteEndToEnd$|^TestHeadlessTokenConnection$' ./internal/headless
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed

amadan: job cancelled — a newer push superseded it
--- shard 3 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-mac: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestMacWorker$|^TestHeadlessAttachments$|^TestHeadlessPrewarm$|^TestHeadless$/^1_first_token$|^TestHeadless$/^6_quick_messages$|^TestHeadless$/^8_instance_restart$|^TestHeadless$/^3_runner_offline$' ./internal/headless
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed

amadan: job cancelled — a newer push superseded it
--- 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
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed

amadan: job cancelled — a newer push superseded it
--- 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
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed

amadan: job cancelled — a newer push superseded it
--- 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 409ms against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 3m33.565s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 15.68s amadan.net/oficina/equipo/internal/thintest TestTasklessHoldResumes
receipt: slow test 11.69s amadan.net/oficina/equipo/internal/thintest TestContractTeamJobSettledStates
receipt: slow test 6.7s amadan.net/oficina/equipo/internal/thintest TestExplorePreviewsOff
receipt: slow test 5.47s amadan.net/oficina/equipo/internal/thintest TestResumeBeforeRefusalReported
receipt: slow test 5.44s amadan.net/oficina/equipo/internal/thintest TestAbilityHoldResumes
machine: 32 CPUs, load 6.71, cpu waiting 0.19%, memory waiting 0.00%, io waiting 2.05%
--- 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 564ms against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 2m27.806s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 9.64s amadan.net/oficina/equipo/internal/thintest TestContractRetryPreviewUnverifiedMerge
receipt: slow test 9.12s amadan.net/oficina/equipo/internal/thintest TestContractPreviewNotScheduled
receipt: slow test 5.04s amadan.net/oficina/equipo/internal/thintest TestContractMacRecheckMergeAuthority
receipt: slow test 4.94s amadan.net/oficina/equipo/internal/thintest TestContractPublishNotOffered
receipt: slow test 3.06s amadan.net/oficina/equipo/internal/thintest TestContractPausedJob
machine: 32 CPUs, load 6.71, cpu waiting 0.19%, memory waiting 0.00%, io waiting 2.05%
--- shard 8 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane runner-thin: ./internal/runner/thin
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m ./internal/runner/thin
cache miss: amadan.net/oficina/equipo/internal/runner/thin: its inputs changed

amadan: job cancelled — a newer push superseded it
--- 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

amadan: job cancelled — a newer push superseded it
--- 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

amadan: job cancelled — a newer push superseded it
--- 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

amadan: job cancelled — a newer push superseded it
--- shard 12 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard

amadan: job cancelled — a newer push superseded it
--- shard 13 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard

amadan: job cancelled — a newer push superseded it
--- shard 14 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard

amadan: job cancelled — a newer push superseded it
--- shard 15 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard

amadan: job cancelled — a newer push superseded it
--- shard 16 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard

amadan: job cancelled — a newer push superseded it
--- shard 17 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard

amadan: job cancelled — a newer push superseded it
--- shard 18 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-chat: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$' ./internal/headless
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed

amadan: job cancelled — a newer push superseded it
--- 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

amadan: job cancelled — a newer push superseded it
--- shard 20 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-connections: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^TestBrowserConnections|^TestBrowserPasteBox$|^TestBrowserPasteCopiesItsBox$' ./internal/headless
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed

amadan: job cancelled — a newer push superseded it
--- 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
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed

amadan: job cancelled — a newer push superseded it
--- 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 431ms against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 2.564s amadan.net/oficina/equipo/internal/equipo
receipt: slow test 1.95s amadan.net/oficina/equipo/internal/equipo TestBrowserPreviewPassExchange
receipt: slow test 610ms amadan.net/oficina/equipo/internal/equipo TestBrowserPreviewBlocksNavigation
browser lane browser-rest: ./internal/equipotest
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserGitHubManifestCSP)$' ./internal/equipotest

receipt: test step 318ms against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 6.486s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 6.49s 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.425s, over the 10s the default allows (measured on the run this cached result came from); reported only, timing fails on CI

receipt: test step 245ms against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 11.425s amadan.net/oficina/equipo/internal/idtest
receipt: slow test 9.17s amadan.net/oficina/equipo/internal/idtest TestBrowserSmartDoor
receipt: slow test 2.25s 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 221ms against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 2.827s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 2.83s amadan.net/oficina/equipo/internal/plan3test TestTeamsHierarchyBrowser
browser lane browser-rest: ./internal/thintest
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAccessEmojiByline|TestBrowserAccessFinalOutcomes|TestBrowserAccessRequest|TestBrowserAccessReview|TestBrowserActivitySubjects|TestBrowserAskMacOffline|TestBrowserAutonomySettings|TestBrowserCoordinatorQueue|TestBrowserDesignHandoffRenames|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 440ms against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 3m50.637s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 28.92s amadan.net/oficina/equipo/internal/thintest TestBrowserAccessRequest
receipt: slow test 14.4s amadan.net/oficina/equipo/internal/thintest TestBrowserSettingsTeams
receipt: slow test 12.09s amadan.net/oficina/equipo/internal/thintest TestBrowserThinkingCycles
receipt: slow test 10.99s amadan.net/oficina/equipo/internal/thintest TestBrowserPlacementQuestionAndPending
receipt: slow test 9.87s amadan.net/oficina/equipo/internal/thintest TestBrowserRhythm
machine: 32 CPUs, load 6.71, cpu waiting 1.53%, memory waiting 0.00%, io waiting 2.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

amadan: job cancelled — a newer push superseded it
--- shard 24 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
shard 24: make runner-host
python3 scripts/runner-prerequisites.py
CGO_ENABLED=0 RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py retried runner-host -run 'TestDirect|TestProvider|TestCheckSandbox' -count=1 ./internal/runner/provider/... ./internal/runner/checks
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -no-time -run 'TestDirect|TestProvider|TestCheckSandbox' -count=1 ./internal/runner/provider/... ./internal/runner/checks

receipt: test step 8.827s 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.193s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow package 169ms amadan.net/oficina/equipo/internal/runner/provider/claude
receipt: slow package 69ms amadan.net/oficina/equipo/internal/runner/provider/codex
receipt: slow package 1ms amadan.net/oficina/equipo/internal/runner/provider
receipt: slow package 1ms amadan.net/oficina/equipo/internal/runner/provider/claude/realcli
receipt: slow test 5.16s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsGoFixture
receipt: slow test 1.65s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPaths
receipt: slow test 300ms amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsCache
receipt: slow test 170ms amadan.net/oficina/equipo/internal/runner/provider/claude TestDirectJournalAdapterBarrier
receipt: slow test 70ms amadan.net/oficina/equipo/internal/runner/provider/codex TestDirectJournalAdapterBarrier
CGO_ENABLED=0 EQUIPO_REQUIRE_USER_SESSION=1 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.415s 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.07s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow test 280ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceReadOnlyScratch
receipt: slow test 210ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryUnavailableProof
receipt: slow test 130ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceDirectPolicyAdmission
receipt: slow test 120ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceExitStatus
receipt: slow test 110ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryCleansScratch
machine: 32 CPUs, load 15.42, cpu waiting 5.41%, memory waiting 0.00%, io waiting 1.70%
--- shard 25 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard

amadan: job cancelled — a newer push superseded it
--- shard 26 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard

amadan: job cancelled — a newer push superseded it
--- shard 27 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard

amadan: job cancelled — a newer push superseded it
--- shard 28 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard

amadan: job cancelled — a newer push superseded it
diff --git a/.rastrillo/budgets.txt b/.rastrillo/budgets.txt
index df5f6f81..9297a277 100644
--- a/.rastrillo/budgets.txt
+++ b/.rastrillo/budgets.txt
@@ -14,8 +14,8 @@ perf GET /* skip Unknown private paths render 404; this fallback contains no scr
time internal/equipo/team 60s Plan 3 loaded CI measured 45.985s; niced serial reruns measured 18.079s and 22.031s. Keep migration, recovery, accounting and concurrency assertions; 60s leaves 30 percent headroom above loaded CI.
time internal/equipotest 300s Final fix package rerun measured 187.035s (review 172.4s); 300s gives 60 percent headroom for HTTP, sandbox, authority and final regression coverage.
-size internal/equipo 24735 - Preview, retry, merges, kept work, check-db, notifications, places, GitHub routes, installer, abilities, lookups, Mac waits, slice F codes, D1, probe details, Design's copy, /api/team; measured 24735.
-size internal/wire 9726 - Protocols 31 to 35 (facts, diffs, evidence, CI units, files, places), abilities, 36 lookups, 37 Mac Engineering, 38 Design, unproven and probe detail codes; measured 9726.
+size internal/equipo 24892 - Preview, retry, merges, kept work, check-db, notifications, places, GitHub routes, installer, abilities, lookups, Mac waits, slice F codes, D1, probe details, Design's copy, /api/team; measured 24892.
+size internal/wire 9755 - Protocols 31 to 35 (facts, diffs, evidence, CI units, files, places), abilities, 36 lookups, 37 Mac Engineering, 38 Design, unproven and probe detail codes; measured 9755.
size internal/equipotest - 12693 GitHub connect value search, lifecycle and sweep-log contracts; Task 21 migration fixtures, Rastrillo asset contract, renderer archive link; measured 0/12693 source/test lines.
time internal/runner/checks 90s CI worker measured 44.553s (44.6s rounded);
time internal/runner 330s Plan 3 CI repair measured 292.120s for the full package (controller CI 472.184s).
@@ -58,7 +58,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 45093 18782 File facts/diffs, previews, merges, unfinished work, CI, receipts, Assistant files, places, abilities, lookups, go-aheads, Mac work, D1, Design specialists, grants, captures; 45093/18782.
+size internal/equipo/chat 45203 18815 File facts/diffs, previews, merges, unfinished work, CI, receipts, Assistant files, places, abilities, lookups, go-aheads, Mac work, D1, Design specialists, grants, captures; 45203/18815.
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.
@@ -73,7 +73,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 - 13400 Grant scenarios (#48); sign-in email at 1280 and 390; Assistant files; restart wait; live site waits; card answer; scenario 7; Mac M9, mixed versions; 13400.
-size internal/thintest - 42650 Protocol 31 contracts, 35 diffs, stuck tasks, merges, retries, unfinished work, previews, places, abilities, lookups, go-aheads, Mac Engineering, conns, D1, held reports, Design end to end; 42650.
+size internal/thintest - 42850 Protocol 31 contracts, 35 diffs, stuck tasks, merges, retries, unfinished work, previews, places, abilities, lookups, go-aheads, Mac Engineering, conns, D1, held reports, Design end to end; 42850.
perf GET /api/v1/projects/{id}/merge-policy skip Merge authority person API: bearer-only JSON for devices; the browser reads the policy on /projects/{id}.
perf GET /api/v1/usage skip Thin v1 person API: bearer-only JSON for devices; the browser reads usage through /usage.
diff --git a/docs/api/equipo-v1.openapi.json b/docs/api/equipo-v1.openapi.json
index 3287f69e..a07656d5 100644
--- a/docs/api/equipo-v1.openapi.json
+++ b/docs/api/equipo-v1.openapi.json
@@ -22886,6 +22886,9 @@
"design": {
"$ref": "#/components/schemas/StepDesign"
},
+ "maker": {
+ "$ref": "#/components/schemas/Maker"
+ },
"hold": {
"$ref": "#/components/schemas/StepHold"
},
@@ -23573,6 +23576,9 @@
"explored_from": {
"$ref": "#/components/schemas/TaskRef"
},
+ "maker": {
+ "$ref": "#/components/schemas/Maker"
+ },
"built_as": {
"$ref": "#/components/schemas/TaskRef"
},
@@ -25294,6 +25300,23 @@
],
"type": "object",
"x-go-type": "wire.LookupSource"
+ },
+ "Maker": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "profile": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id",
+ "profile"
+ ],
+ "additionalProperties": false,
+ "x-go-type": "wire.Maker"
}
},
"responses": {
diff --git a/internal/equipo/chat/push.go b/internal/equipo/chat/push.go
index cbb3237b..483e703c 100644
--- a/internal/equipo/chat/push.go
+++ b/internal/equipo/chat/push.go
@@ -535,8 +535,15 @@ func pushTaskOf(v wire.Task, copy func(string) string) push.Task {
current = &steps[j]
}
}
+ // No step working or done (Design's first attempt failed or was
+ // cancelled): the task's maker, not the apps' Engineering default.
+ k.Specialist = v.Maker.Category()
if current != nil {
k.Specialist, k.StepID = current.Specialist, current.ID
+ if c := current.Maker.Category(); c != "" {
+ // Design works on Engineering's step kind, as itself.
+ k.Specialist = c
+ }
if current.State == wire.StepRunning {
k.Working = true
k.Activity = copy("work.activity.working")
diff --git a/internal/equipo/chat/push_maker_test.go b/internal/equipo/chat/push_maker_test.go
new file mode 100644
index 00000000..b656f7d3
--- /dev/null
+++ b/internal/equipo/chat/push_maker_test.go
@@ -0,0 +1,33 @@
+package chat
+
+import (
+ "testing"
+
+ "amadan.net/oficina/equipo/internal/wire"
+)
+
+// A task's Live Activity names the specialist working on it as itself:
+// an Engineering-kind step Design makes is "design" (the apps' category),
+// a plain Engineering step stays "engineering".
+func TestPushTaskNamesTheMaker(t *testing.T) {
+ copy := func(string) string { return "" }
+ design := wire.Task{ID: "tk1", Steps: []wire.Step{{ID: "s1", Specialist: wire.SpecialistEngineering, State: wire.StepRunning, Maker: &wire.Maker{ID: "sp1", Profile: "design-v1"}}}}
+ if got := pushTaskOf(design, copy); got.Specialist != "design" || got.StepID != "s1" {
+ t.Fatalf("Design's step: %+v", got)
+ }
+ plain := wire.Task{ID: "tk2", Steps: []wire.Step{{ID: "s2", Specialist: wire.SpecialistEngineering, State: wire.StepRunning}}}
+ if got := pushTaskOf(plain, copy); got.Specialist != wire.SpecialistEngineering {
+ t.Fatalf("Engineering's step: %+v", got)
+ }
+ // Design's first attempt failed: no step working or done.
+ failed := wire.Task{ID: "tk3", Maker: &wire.Maker{ID: "sp1", Profile: "design-v1"}, Steps: []wire.Step{{ID: "s3", Specialist: wire.SpecialistEngineering, State: wire.StepFailed, Maker: &wire.Maker{ID: "sp1", Profile: "design-v1"}}}}
+ if got := pushTaskOf(failed, copy); got.Specialist != "design" {
+ t.Fatalf("Design's failed first attempt: %+v", got)
+ }
+ if got := pushTaskOf(wire.Task{ID: "tk4"}, copy); got.Specialist != "" {
+ t.Fatalf("a task with no steps: %+v", got)
+ }
+ if (&wire.Maker{Profile: "research-v1"}).Category() != "research" || (*wire.Maker)(nil).Category() != "" {
+ t.Fatal("Category")
+ }
+}
diff --git a/internal/equipo/chat/store.go b/internal/equipo/chat/store.go
index 2abf798b..0e774aca 100644
--- a/internal/equipo/chat/store.go
+++ b/internal/equipo/chat/store.go
@@ -244,6 +244,10 @@ type txn struct {
// catalogs caches the runners' catalogs by repository.
viewer string
catalogs map[string]wire.RepoInfo
+ // makers caches specialists' profiles by id for the transaction (a
+ // specialist's profile never changes): every task view in a list
+ // reads each maker once (taskViewWith).
+ makers makerProfiles
// hk is the housekeeping principal while the loop acts: the shared
// store functions check it. failures are housekeeping failures to
// count once the transaction ends.
diff --git a/internal/equipo/chat/tasks.go b/internal/equipo/chat/tasks.go
index 0d89f2fa..85d20d8f 100644
--- a/internal/equipo/chat/tasks.go
+++ b/internal/equipo/chat/tasks.go
@@ -582,11 +582,18 @@ func (t *txn) taskViewWith(k taskRecord, options taskViewOptions) (wire.Task, er
if err := t.db.Where("task_id = ? AND coalesce(retired, 0) = 0", k.ID).Order("idx").Find(&steps).Error; err != nil {
return v, err
}
+ var err error
+ if v.Maker, err = t.maker(k.MakerSpecialistID); err != nil {
+ return v, err
+ }
for _, s := range steps {
sv := stepViewSwitched(s)
if options.changeFiles {
sv.ChangeFiles = stepChangeFilesView(s)
}
+ if sv.Maker, err = t.stepMaker(k, s); err != nil {
+ return v, err
+ }
t.stepWaitView(&sv, s)
sv.Paused = t.stepPaused(k, s)
if s.Specialist == wire.SpecialistResearch && (s.State == wire.StepDone || s.State == wire.StepFailed || s.State == wire.StepCancelled) {
@@ -617,6 +624,9 @@ func (t *txn) taskViewWith(k taskRecord, options taskViewOptions) (wire.Task, er
if options.changeFiles {
sv.ChangeFiles = stepChangeFilesView(st)
}
+ if sv.Maker, err = t.stepMaker(k, st); err != nil {
+ return v, err
+ }
v.EarlierSteps = append(v.EarlierSteps, sv)
}
pr := progressFor(k, steps)
@@ -860,8 +870,21 @@ func (t *txn) writeStep(s *stepRecord) error {
if err != nil {
return err
}
+ // The step's maker, as the task view has it: events and snapshots
+ // name a Design step the same way.
+ var k taskRecord
+ if s.SpecialistID == "" && s.Specialist == wire.SpecialistEngineering {
+ if err := t.db.Select("id", "maker_specialist_id").Where("id = ?", s.TaskID).Limit(1).Find(&k).Error; err != nil {
+ return err
+ }
+ }
+ maker, err := t.stepMaker(k, *s)
+ if err != nil {
+ return err
+ }
for _, m := range members {
sv := stepViewSwitched(*s)
+ sv.Maker = maker
t.stepWaitView(&sv, *s)
if err := t.event("", m, wire.EventStep, "step", s.ID, s.Revision, "", "", s.Attempt, sv); err != nil {
return err
@@ -2684,3 +2707,42 @@ func (t *txn) runTaskTool(r turnRecord, v *wire.ToolCall) (wire.ToolResult, erro
}
return refused("unknown_tool", toolUnknown), nil
}
+
+// makerProfiles caches specialists' profiles by id (txn.makers).
+type makerProfiles map[string]string
+
+// maker is the data-defined specialist id names, with its profile (nil
+// for "", or a specialist no longer on record).
+func (t *txn) maker(id string) (*wire.Maker, error) {
+ if id == "" {
+ return nil, nil
+ }
+ if t.makers == nil {
+ t.makers = makerProfiles{}
+ }
+ profile, ok := t.makers[id]
+ if !ok {
+ var sp specialistRecord
+ if err := t.db.Select("id", "profile").Where("id = ?", id).Limit(1).Find(&sp).Error; err != nil {
+ return nil, err
+ }
+ profile, t.makers[id] = sp.Profile, sp.Profile
+ }
+ if profile == "" {
+ return nil, nil
+ }
+ return &wire.Maker{ID: id, Profile: profile}, nil
+}
+
+// stepMaker is the data-defined specialist that makes step s: the one its
+// binding names, or, for an Engineering-kind step not yet bound (before
+// its dispatch), its task's maker.
+func (t *txn) stepMaker(k taskRecord, s stepRecord) (*wire.Maker, error) {
+ if s.SpecialistID != "" {
+ return t.maker(s.SpecialistID)
+ }
+ if s.Specialist == wire.SpecialistEngineering {
+ return t.maker(k.MakerSpecialistID)
+ }
+ return nil, nil
+}
diff --git a/internal/equipo/chat/usage.go b/internal/equipo/chat/usage.go
index 580ff0a2..19602054 100644
--- a/internal/equipo/chat/usage.go
+++ b/internal/equipo/chat/usage.go
@@ -99,6 +99,40 @@ func (s *Store) UsageTotals(ctx context.Context, person, period, by string) (out
}
}
}
+ // By role, a step a maker made (Design's, Engineering's kind)
+ // is the maker's: its profile, not Engineering.
+ makers := map[string]string{}
+ if by == wire.UsageByRole {
+ var ids []string
+ for _, r := range rows {
+ if r.Role == wire.SpecialistEngineering && r.StepID != "" {
+ ids = append(ids, r.StepID)
+ }
+ }
+ if len(ids) > 0 {
+ var bound []stepRecord
+ if err := tx.Select("id", "specialist_id").Where("id IN ? AND specialist_id <> ''", ids).Find(&bound).Error; err != nil {
+ return err
+ }
+ var sids []string
+ for _, st := range bound {
+ sids = append(sids, st.SpecialistID)
+ }
+ var sps []specialistRecord
+ if err := tx.Select("id", "profile").Where("id IN ?", sids).Find(&sps).Error; err != nil {
+ return err
+ }
+ profiles := map[string]string{}
+ for _, sp := range sps {
+ profiles[sp.ID] = sp.Profile
+ }
+ for _, st := range bound {
+ if p := profiles[st.SpecialistID]; p != "" {
+ makers[st.ID] = p
+ }
+ }
+ }
+ }
sums := map[string]*wire.UsageRow{}
for _, r := range rows {
if r.Overcount {
@@ -114,6 +148,9 @@ func (s *Store) UsageTotals(ctx context.Context, person, period, by string) (out
}
case wire.UsageByRole:
id, label = r.Role, r.Role
+ if p := makers[r.StepID]; p != "" && r.Role == wire.SpecialistEngineering {
+ id, label = p, p
+ }
case wire.UsageByTask:
if k, ok := tasks[r.TaskID]; ok {
id, label = k.ID, k.Title
diff --git a/internal/equipo/chat_roster.go b/internal/equipo/chat_roster.go
index 740f3b3a..1532672e 100644
--- a/internal/equipo/chat_roster.go
+++ b/internal/equipo/chat_roster.go
@@ -36,6 +36,19 @@ func (v *chatCard) rosterAuthor(tasks map[string]wire.Task) {
v.Author = specialistName(who)
v.AuthorIcon = map[string]string{wire.SpecialistEngineering: "wrench", wire.SpecialistResearch: "search", wire.SpecialistCopy: "type"}[who]
}
+ // A task a data-defined specialist makes (Design) reports as that
+ // specialist, not as Engineering, whose step kind it works on.
+ if who == wire.SpecialistEngineering {
+ t, ok := tasks[v.TaskID]
+ if !ok && v.Task != nil {
+ t, ok = v.Task.Task, true
+ }
+ if ok && t.Maker != nil {
+ if n := makerName(t.Maker.Profile); n != "" {
+ v.Author, v.AuthorIcon = n, makerIcon(t.Maker.Profile)
+ }
+ }
+ }
}
func (v chatCard) Interactive() bool {
diff --git a/internal/equipo/connections_view.go b/internal/equipo/connections_view.go
index 814b5c25..f3e0dff5 100644
--- a/internal/equipo/connections_view.go
+++ b/internal/equipo/connections_view.go
@@ -189,7 +189,7 @@ func connectionsPage(snap wire.Snapshot, today map[string]int64, prefer wire.Pre
v := modelsView{Offline: !snap.Runner.Online, Runner: runner, Cursor: snap.Cursor}
v.Prefer = preferControl(prefer)
primary := snap.Runner.ID
- live := liveRoles(snap)
+ coordinating, serving := liveRoles(snap)
coord := coordinatorOn(snap)
var held []wire.Connection
for _, c := range snap.Connections {
@@ -309,12 +309,10 @@ func connectionsPage(snap wire.Snapshot, today map[string]int64, prefer wire.Pre
}
default:
if c.LocalID == coord && onPrimary(c, primary) {
- row.Roles = append(row.Roles, connRole{Name: copyText("conversation.coordinator"), Live: live[key+"/coordinator"]})
+ row.Roles = append(row.Roles, connRole{Name: copyText("conversation.coordinator"), Live: coordinating[key]})
}
- for _, r := range []string{wire.SpecialistEngineering, wire.SpecialistReview} {
- if live[key+"/"+r] {
- row.Roles = append(row.Roles, connRole{Name: copyText("work.specialist." + r), Live: true})
- }
+ for _, name := range serving[key] {
+ row.Roles = append(row.Roles, connRole{Name: name, Live: true})
}
if len(row.Roles) == 0 {
row.RolesNote = copyText("chat.connections.roles.none")
@@ -398,23 +396,39 @@ func tokenFacts(row *connRow, c wire.Connection, now time.Time) {
row.Renew = c.ExpiresAt.Sub(now) < wire.TokenRenewal
}
-// liveRoles are the roles each connection runs now: a turn of the
-// person's running on it, a step running on it.
-func liveRoles(snap wire.Snapshot) map[string]bool {
- out := map[string]bool{}
+// liveRoles are the roles each connection (by key) runs now: the
+// coordinator, for a turn of the person's running on it, and the names
+// of the specialists whose Engineering or Review steps run on it (a
+// maker by its own name: Design, not Engineering), Engineering then
+// Review then makers by name.
+func liveRoles(snap wire.Snapshot) (coordinating map[string]bool, serving map[string][]string) {
+ coordinating, serving = map[string]bool{}, map[string][]string{}
for _, t := range snap.Turns {
if t.State == wire.TurnRunning && t.Connection != "" {
- out[t.Connection+"/coordinator"] = true
+ coordinating[t.Connection] = true
}
}
for _, k := range snap.Tasks {
for _, s := range k.Steps {
- if s.State == wire.StepRunning && s.Account != "" {
- out[chat.UsageKey(snap.Runner.ID, s.RunnerID, s.Account)+"/"+s.Specialist] = true
+ if s.State != wire.StepRunning || s.Account == "" || s.Specialist != wire.SpecialistEngineering && s.Specialist != wire.SpecialistReview {
+ continue
+ }
+ key := chat.UsageKey(snap.Runner.ID, s.RunnerID, s.Account)
+ if name := stepName(s); !slices.Contains(serving[key], name) {
+ serving[key] = append(serving[key], name)
}
}
}
- return out
+ rank := func(name string) int {
+ if r, ok := map[string]int{specialistName(wire.SpecialistEngineering): 1, specialistName(wire.SpecialistReview): 2}[name]; ok {
+ return r
+ }
+ return 3
+ }
+ for _, names := range serving {
+ slices.SortFunc(names, func(a, b string) int { return cmp.Or(cmp.Compare(rank(a), rank(b)), strings.Compare(a, b)) })
+ }
+ return coordinating, serving
}
// coordinatorOn is the connection the person's coordinator answered on
diff --git a/internal/equipo/rail.go b/internal/equipo/rail.go
index a5164114..67ebee3c 100644
--- a/internal/equipo/rail.go
+++ b/internal/equipo/rail.go
@@ -79,10 +79,13 @@ func (a *application) rail(ctx context.Context, person string) railView {
continue
}
n++
- if s := len(k.Steps); s > 0 {
- st := k.Steps[s-1]
- if st.State == wire.StepRunning {
- working[st.Specialist] = append(working[st.Specialist], k)
+ // Every specialist running a step of it (Research can run
+ // while Engineering's step waits after it), once each.
+ seen := map[string]bool{}
+ for i := len(k.Steps) - 1; i >= 0; i-- {
+ if st := k.Steps[i]; st.State == wire.StepRunning && !seen[stepKey(st)] {
+ seen[stepKey(st)] = true
+ working[stepKey(st)] = append(working[stepKey(st)], k)
}
}
}
@@ -110,11 +113,17 @@ func (a *application) rail(ctx context.Context, person string) railView {
if p, err := c.Projects(ctx, person); err == nil {
v.Projects = railCount{len(p.Items), true}
}
- for _, s := range specialistRail {
+ rows := specialistRail
+ // Every specialist added to the team or to a project (data-defined,
+ // such as Design) has its own row after the built-in ones.
+ if added, err := c.Specialists(ctx, person); err == nil {
+ rows = append(rows[:len(rows):len(rows)], addedRows(added.Items)...)
+ }
+ for _, s := range rows {
line := railSpecialist{Key: s.specialist, Icon: s.icon, CopyKey: s.copyKey}
if ks := working[s.specialist]; len(ks) > 0 {
k := ks[0]
- st := k.Steps[len(k.Steps)-1]
+ st := *keyStep(k, s.specialist, wire.StepRunning)
line.Task, line.Step = &k, &st
line.Now = copyText("work.activity.working")
if n := len(st.Activity); n > 0 {
@@ -143,3 +152,17 @@ func (a *application) railFragment(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/html; charset=utf-8")
buf.WriteTo(w)
}
+
+// addedRows are the sidebar rows of the active data-defined specialists,
+// oldest first: keyed by id, with their profile's name and icon.
+func addedRows(items []wire.Specialist) []struct{ specialist, icon, copyKey string } {
+ var out []struct{ specialist, icon, copyKey string }
+ for i := len(items) - 1; i >= 0; i-- {
+ sp := items[i]
+ if sp.State != wire.SpecialistActive || makerName(sp.Profile) == "" {
+ continue
+ }
+ out = append(out, struct{ specialist, icon, copyKey string }{sp.ID, makerIcon(sp.Profile), makerCopyKey(sp.Profile)})
+ }
+ return out
+}
diff --git a/internal/equipo/research_views.go b/internal/equipo/research_views.go
index b4c3cd8c..4fd5e06f 100644
--- a/internal/equipo/research_views.go
+++ b/internal/equipo/research_views.go
@@ -45,7 +45,7 @@ type researchImage struct {
// researchItem is a Research step's timeline entry. title is its name
// (with its attempt when there was more than one).
func researchItem(t wire.Task, s wire.Step, v taskLine, title string) timelineItem {
- name := specialistName(s.Specialist)
+ name := stepName(s)
it := timelineItem{Specialist: s.Specialist}
switch s.State {
case wire.StepQueued:
diff --git a/internal/equipo/static/ask-target.js b/internal/equipo/static/ask-target.js
index 2c6d37fa..c0dc1967 100644
--- a/internal/equipo/static/ask-target.js
+++ b/internal/equipo/static/ask-target.js
@@ -13,7 +13,9 @@
var label = line.querySelector("[data-ask-line]");
var change = line.querySelector("[data-ask-change]");
var sep = line.querySelector("[data-ask-sep]");
- var choices = (line.dataset.choices || "").split(",").filter(Boolean);
+ var choices;
+ function readChoices() { choices = (line.dataset.choices || "").split(",").filter(Boolean); }
+ readChoices();
var review = /\breview(?:er|ers|ed|ing|s)?\b/i;
function name(s) { return root.dataset["name" + s.charAt(0).toUpperCase() + s.slice(1)] || s; }
function current() {
@@ -22,14 +24,20 @@
return choices[0];
}
function show() {
- var who = name(current());
+ var c = current();
+ if (!c) return;
+ var who = name(c);
label.textContent = (root.dataset.askFormat || "%s").replace("%s", who);
input.placeholder = (root.dataset.askPlaceholder || "%s").replace("%s", who);
input.setAttribute("aria-label", input.placeholder);
}
- if (change && choices.length > 1) {
- change.hidden = false;
- if (sep) sep.hidden = false;
+ function offerChange() {
+ if (!change) return;
+ change.hidden = choices.length < 2;
+ if (sep) sep.hidden = change.hidden;
+ }
+ offerChange();
+ if (change) {
change.addEventListener("click", function () {
var at = choices.indexOf(current());
chosen.value = choices[(at + 1) % choices.length];
@@ -38,6 +46,14 @@
});
}
input.addEventListener("input", show);
+ // A refreshed thread (chat-stream.js) can name another maker or offer
+ // other choices: a choice no longer offered is dropped.
+ root.addEventListener("equipo:names", function () {
+ readChoices();
+ if (chosen.value && choices.indexOf(chosen.value) < 0) chosen.value = "";
+ offerChange();
+ show();
+ });
// After a question goes, the next one starts undecided again.
form.addEventListener("equipo:sent", function () { chosen.value = ""; show(); });
show();
diff --git a/internal/equipo/static/chat-stream.js b/internal/equipo/static/chat-stream.js
index c0099abf..8d2701da 100644
--- a/internal/equipo/static/chat-stream.js
+++ b/internal/equipo/static/chat-stream.js
@@ -824,6 +824,12 @@
var at = Number(page.dataset.cursor) || 0;
if (at < pageCursor) return;
pageCursor = at;
+ // The names a step's maker gives the thread follow it (Design's
+ // work handed to Engineering): ask-target.js re-reads them.
+ ["nameEngineering", "nameReview"].forEach(function (k) { if (page.dataset[k]) root.dataset[k] = page.dataset[k]; });
+ var askLine = document.querySelector("[equipo-ask-target]"), nextAsk = doc.querySelector("[equipo-ask-target]");
+ if (askLine && nextAsk) askLine.dataset.choices = nextAsk.dataset.choices || "";
+ root.dispatchEvent(new CustomEvent("equipo:names"));
var stale = at < shape;
if (stale) again = true;
// Keep live timers and activity lines across the re-render.
diff --git a/internal/equipo/static/team-panel.js b/internal/equipo/static/team-panel.js
index 9342f4f8..0f910b47 100644
--- a/internal/equipo/static/team-panel.js
+++ b/internal/equipo/static/team-panel.js
@@ -78,7 +78,11 @@
}
function load(url) {
return fetch(url, { credentials: "same-origin", headers: { "Accept": "text/html" } })
- .then(function (r) { if (!r.ok) throw new Error("team"); return r.text(); })
+ .then(function (r) {
+ if (r.status === 404) { var gone = new Error("team"); gone.gone = true; throw gone; }
+ if (!r.ok) throw new Error("team");
+ return r.text();
+ })
.then(function (body) {
var next = new DOMParser().parseFromString(body, "text/html").querySelector("[equipo-team]");
if (!next) throw new Error("team");
@@ -131,7 +135,9 @@
if (!href) return;
if (inflight) { again = true; return; }
var url = href;
- inflight = load(url).then(function (next) { if (href === url) place(next); }).catch(function () {}).finally(function () {
+ // A specialist no longer on the team (Design revoked) closes its
+ // drawer: its Ask form would reach whoever has the kind's steps now.
+ inflight = load(url).then(function (next) { if (href === url) place(next); }).catch(function (e) { if (e && e.gone && href === url) close(); }).finally(function () {
inflight = null;
if (again) { again = false; refresh(); }
});
diff --git a/internal/equipo/team_maker_test.go b/internal/equipo/team_maker_test.go
new file mode 100644
index 00000000..636118d6
--- /dev/null
+++ b/internal/equipo/team_maker_test.go
@@ -0,0 +1,85 @@
+package equipo
+
+import (
+ "testing"
+
+ "amadan.net/oficina/equipo/internal/wire"
+)
+
+// A task Design made and then handed to Engineering, whose later step is
+// the one an ask goes to: Engineering's drawer offers Ask, Design's does
+// not (the ask would reach Engineering's step); before the handoff,
+// Design's did and Engineering's did not. A running step is its maker's.
+func TestTeamAskFollowsTheNewestStep(t *testing.T) {
+ design := &wire.Maker{ID: "sp_design", Profile: "design-v1"}
+ made := wire.Step{ID: "s1", Specialist: wire.SpecialistEngineering, State: wire.StepDone, Askable: true, Maker: design}
+ review := wire.Step{ID: "s2", Specialist: wire.SpecialistReview, State: wire.StepDone, Askable: true}
+ later := wire.Step{ID: "s3", Specialist: wire.SpecialistEngineering, State: wire.StepDone, Askable: true}
+
+ before := wire.Task{Steps: []wire.Step{made, review}}
+ if kind, ok := finishedAskable(before, design.ID); !ok || kind != wire.SpecialistEngineering {
+ t.Fatalf("before the handoff, Design's drawer: %q %v", kind, ok)
+ }
+ if _, ok := finishedAskable(before, wire.SpecialistEngineering); ok {
+ t.Fatal("before the handoff, Engineering's drawer offers Ask on Design's work")
+ }
+ if kind, ok := finishedAskable(before, wire.SpecialistReview); !ok || kind != wire.SpecialistReview {
+ t.Fatalf("Review's drawer: %q %v", kind, ok)
+ }
+
+ after := wire.Task{Steps: []wire.Step{made, review, later}}
+ if _, ok := finishedAskable(after, design.ID); ok {
+ t.Fatal("after the handoff, Design's drawer offers Ask; it would reach Engineering's step")
+ }
+ if kind, ok := finishedAskable(after, wire.SpecialistEngineering); !ok || kind != wire.SpecialistEngineering {
+ t.Fatalf("after the handoff, Engineering's drawer: %q %v", kind, ok)
+ }
+
+ running := made
+ running.ID, running.State = "s4", wire.StepRunning
+ k := wire.Task{Steps: []wire.Step{later, running}}
+ if s := keyStep(k, design.ID, wire.StepRunning); s == nil || s.ID != "s4" {
+ t.Fatalf("Design's running step: %+v", s)
+ }
+ if s := keyStep(k, wire.SpecialistEngineering, wire.StepRunning); s != nil {
+ t.Fatalf("Engineering runs Design's step: %+v", s)
+ }
+ if stepName(running) != "Design" || stepName(later) != "Engineering" {
+ t.Fatalf("names: %q %q", stepName(running), stepName(later))
+ }
+}
+
+// A connection running Design's step serves Design, not Engineering
+// (Astra round 2); one running Design's and a plain Engineering step
+// serves both, Engineering first.
+func TestConnectionServesTheMaker(t *testing.T) {
+ design := wire.Step{ID: "s1", Specialist: wire.SpecialistEngineering, State: wire.StepRunning, Account: "claude-1", Maker: &wire.Maker{ID: "sp_design", Profile: "design-v1"}}
+ snap := screenshotSnapshot()
+ snap.Tasks = []wire.Task{{ID: "k1", Steps: []wire.Step{design}}}
+ roles := func(snap wire.Snapshot) []string {
+ var out []string
+ for _, r := range rowOf(t, connectionsPage(snap, nil, wire.Preferences{}, "", nil, screenshotNow), "c-claude").Roles {
+ out = append(out, r.Name)
+ }
+ return out
+ }
+ if got := roles(snap); len(got) != 1 || got[0] != "Design" {
+ t.Fatalf("Design's connection serves %v", got)
+ }
+ plain := wire.Step{ID: "s2", Specialist: wire.SpecialistEngineering, State: wire.StepRunning, Account: "claude-1"}
+ snap.Tasks = append(snap.Tasks, wire.Task{ID: "k2", Steps: []wire.Step{plain}})
+ if got := roles(snap); len(got) != 2 || got[0] != "Engineering" || got[1] != "Design" {
+ t.Fatalf("a connection running both serves %v", got)
+ }
+}
+
+// A moved task's earlier steps keep their questions' authors: Design's
+// answer stays Design's once the move retires its step (Astra round 3).
+func TestThreadNamesAnEarlierMaker(t *testing.T) {
+ design := wire.Step{ID: "s1", Specialist: wire.SpecialistEngineering, State: wire.StepDone, Maker: &wire.Maker{ID: "sp_design", Profile: "design-v1"}}
+ k := wire.Task{ID: "k1", EarlierSteps: []wire.Step{design}, Questions: []wire.Question{{ID: "q1", StepID: "s1", Specialist: wire.SpecialistEngineering, State: wire.QuestionAnswered, Text: "Why calm?", Answer: "Quieter."}}}
+ v := threadOf(k, "", 0)
+ if len(v.Items) != 1 || v.Items[0].Who != "Design" {
+ t.Fatalf("the moved task's answer: %+v", v.Items)
+ }
+}
diff --git a/internal/equipo/team_panel.go b/internal/equipo/team_panel.go
index 9af80e3e..96830177 100644
--- a/internal/equipo/team_panel.go
+++ b/internal/equipo/team_panel.go
@@ -76,17 +76,36 @@ func railEntry(key string) (struct{ specialist, icon, copyKey string }, bool) {
return struct{ specialist, icon, copyKey string }{}, false
}
-// teamPage is GET /team/{specialist}.
+// teamEntry is the sidebar row key names: a built-in specialist, or an
+// active data-defined one (its id).
+func (a *application) teamEntry(ctx context.Context, person, key string) (struct{ specialist, icon, copyKey string }, bool) {
+ if s, ok := railEntry(key); ok {
+ return s, true
+ }
+ added, err := a.store.Chat().Specialists(ctx, person)
+ if err != nil {
+ return struct{ specialist, icon, copyKey string }{}, false
+ }
+ for _, s := range addedRows(added.Items) {
+ if s.specialist == key {
+ return s, true
+ }
+ }
+ return struct{ specialist, icon, copyKey string }{}, false
+}
+
+// teamPage is GET /team/{specialist}: a built-in specialist's drawer, or
+// a data-defined one's by its id.
func (a *application) teamPage(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Cache-Control", "no-store")
- s, ok := railEntry(chi.URLParam(r, "specialist"))
+ ctx, address, ok := sessionContext(r)
if !ok {
- a.failure(w, r, ErrNotFound)
+ a.failure(w, r, ErrForbidden)
return
}
- ctx, address, ok := sessionContext(r)
+ s, ok := a.teamEntry(ctx, address, chi.URLParam(r, "specialist"))
if !ok {
- a.failure(w, r, ErrForbidden)
+ a.failure(w, r, ErrNotFound)
return
}
data, err := a.page(r, s.specialist)
@@ -106,7 +125,10 @@ func (a *application) teamPage(w http.ResponseWriter, r *http.Request) {
// teamPanel reads one specialist's drawer from the thin core.
func (a *application) teamPanel(ctx context.Context, person, key, icon, copyKey string) (teamPanel, error) {
c := a.store.Chat()
- p := teamPanel{Key: key, Icon: icon, CopyKey: copyKey, Name: specialistName(key)}
+ p := teamPanel{Key: key, Icon: icon, CopyKey: copyKey, Name: copyText(copyKey)}
+ if _, builtIn := railEntry(key); builtIn {
+ p.Name = specialistName(key)
+ }
tasks, err := c.Tasks(ctx, person)
if err != nil {
return p, err
@@ -117,16 +139,16 @@ func (a *application) teamPanel(ctx context.Context, person, key, icon, copyKey
if wire.FinalStage(k.Stage) || len(k.Steps) == 0 {
continue
}
- switch st := k.Steps[len(k.Steps)-1]; {
- case st.Specialist == key && st.State == wire.StepRunning:
+ switch {
+ case keyStep(k, key, wire.StepRunning) != nil:
running = append(running, k)
- case st.Specialist == key && st.State == wire.StepQueued:
+ case keyStep(k, key, wire.StepQueued) != nil:
p.Queue = append(p.Queue, k)
}
}
if len(running) > 0 {
k := running[0]
- st := k.Steps[len(k.Steps)-1]
+ st := *keyStep(k, key, wire.StepRunning)
p.Task, p.Step, p.More = &k, &st, len(running)-1
p.Stage = copyText("work.stage." + k.Stage)
for _, l := range st.Activity {
@@ -155,8 +177,8 @@ func (a *application) teamPanel(ctx context.Context, person, key, icon, copyKey
return p, err
}
p.Model, p.ModelPending = models[st.ID], models[st.ID] == ""
- if k.Creator == person && k.AskOpen && finishedAskable(k, key) {
- p.Ask = &teamAsk{TaskID: k.ID, Title: k.Title, Waits: true}
+ if kind, ok := finishedAskable(k, key); ok && k.Creator == person && k.AskOpen {
+ p.Ask = &teamAsk{TaskID: k.ID, Title: k.Title, Specialist: kind, Waits: true}
}
}
// What it finished lately, newest first, one line per task.
@@ -170,7 +192,7 @@ func (a *application) teamPanel(ctx context.Context, person, key, icon, copyKey
continue
}
for i := len(k.Steps) - 1; i >= 0; i-- {
- if st := k.Steps[i]; st.Specialist == key && wire.StepTerminal(st.State) && st.FinishedAt != nil {
+ if st := k.Steps[i]; stepKey(st) == key && wire.StepTerminal(st.State) && st.FinishedAt != nil {
finished = append(finished, done{k, st})
break
}
@@ -186,13 +208,15 @@ func (a *application) teamPanel(ctx context.Context, person, key, icon, copyKey
headline = map[string]string{wire.VerdictApprove: copyText("work.badge.approved"), wire.VerdictChanges: copyText("work.badge.changes")}[d.st.Verdict]
}
p.Recent = append(p.Recent, teamRecent{TaskID: d.k.ID, Title: d.k.Title, Project: d.k.Project, Headline: headline, At: *d.st.FinishedAt, Ago: ago(now, *d.st.FinishedAt)})
- if p.Task == nil && p.Ask == nil && d.k.Creator == person && d.k.AskOpen && finishedAskable(d.k, key) {
+ if kind, ok := finishedAskable(d.k, key); ok && p.Task == nil && p.Ask == nil && d.k.Creator == person && d.k.AskOpen {
k := d.k
- p.Ask = &teamAsk{TaskID: k.ID, Title: k.Title}
+ p.Ask = &teamAsk{TaskID: k.ID, Title: k.Title, Specialist: kind}
}
}
if p.Ask != nil {
- p.Ask.Specialist, p.Ask.Name, p.Ask.RequestID = key, p.Name, rand.Text()
+ // The question goes to the step kind it resumes (Design asks as
+ // Engineering's kind), named as the drawer's specialist.
+ p.Ask.Name, p.Ask.RequestID = p.Name, rand.Text()
for _, k := range tasks.Items {
if k.ID != p.Ask.TaskID {
continue
@@ -211,16 +235,33 @@ func (a *application) teamPanel(ctx context.Context, person, key, icon, copyKey
return p, nil
}
-// finishedAskable: the task has a finished step of this specialist whose
-// session the runner kept, which is what a question resumes.
-func finishedAskable(k wire.Task, key string) bool {
- if key != wire.SpecialistEngineering && key != wire.SpecialistReview {
- return false
+// finishedAskable: a question to this specialist would reach its own
+// step. A question goes to the newest finished, askable step of its kind
+// (Engineering or Review: chat.askTarget), so this specialist can be
+// asked only when that step is its own (by stepKey: Design's, not a later
+// Engineering's after a handoff); kind is the kind the question names.
+func finishedAskable(k wire.Task, key string) (kind string, ok bool) {
+ for _, want := range []string{wire.SpecialistEngineering, wire.SpecialistReview} {
+ for i := len(k.Steps) - 1; i >= 0; i-- {
+ if s := k.Steps[i]; s.Specialist == want && s.Askable && s.State == wire.StepDone {
+ if stepKey(s) == key {
+ return want, true
+ }
+ break
+ }
+ }
}
- for _, s := range k.Steps {
- if s.Specialist == key && s.Askable && s.State == wire.StepDone {
- return true
+ return "", false
+}
+
+// keyStep is the task's newest step of this specialist (by stepKey) in
+// state, or nil: a task can run one specialist's step while another's
+// waits after it (Research before a held Engineering step).
+func keyStep(k wire.Task, key, state string) *wire.Step {
+ for i := len(k.Steps) - 1; i >= 0; i-- {
+ if st := k.Steps[i]; stepKey(st) == key && st.State == state {
+ return &k.Steps[i]
}
}
- return false
+ return nil
}
diff --git a/internal/equipo/templates/work_task.html b/internal/equipo/templates/work_task.html
index 35893073..b2c84fcf 100644
--- a/internal/equipo/templates/work_task.html
+++ b/internal/equipo/templates/work_task.html
@@ -52,7 +52,7 @@
</div>
</details>
</section>
-{{$thread := $.Thin.Thread}}<section equipo-thread equipo-t-thread data-chat-stream data-task="{{.ID}}" data-thinking-set="{{$.ThinkingSet}}" data-thinking-words="{{$.ThinkingWords}}" data-cursor="{{$thread.Cursor}}" data-elapsed="{{copy "chat.elapsed"}}" data-thinking="{{copy "chat.activity.thinking"}}" data-ask-format="{{copy "work.ask.target"}}" data-ask-placeholder="{{copy "work.ask.placeholder"}}" data-name-engineering="{{copy "work.specialist.engineering"}}" data-name-review="{{copy "work.specialist.review"}}">
+{{$thread := $.Thin.Thread}}<section equipo-thread equipo-t-thread data-chat-stream data-task="{{.ID}}" data-thinking-set="{{$.ThinkingSet}}" data-thinking-words="{{$.ThinkingWords}}" data-cursor="{{$thread.Cursor}}" data-elapsed="{{copy "chat.elapsed"}}" data-thinking="{{copy "chat.activity.thinking"}}" data-ask-format="{{copy "work.ask.target"}}" data-ask-placeholder="{{copy "work.ask.placeholder"}}" data-name-engineering="{{with index $thread.Names "engineering"}}{{.}}{{else}}{{copy "work.specialist.engineering"}}{{end}}" data-name-review="{{with index $thread.Names "review"}}{{.}}{{else}}{{copy "work.specialist.review"}}{{end}}">
<h2>{{copy "work.thread"}}</h2>
<div data-work-region id="task-spend">{{with .StepSpend}}<ul equipo-spend aria-label="{{copy "work.spend_steps"}}" data-spend-steps>{{range .}}<li data-spend-step="{{.Step}}">{{.Line}}</li>{{end}}</ul>{{end}}</div>
<template equipo-own-template><li equipo-message="own" data-message=""><div equipo-message-meta><strong equipo-visually-hidden>{{$.Address}}</strong><time></time></div><div equipo-bubble><p equipo-message-body></p></div></li></template>
diff --git a/internal/equipo/usage_page.go b/internal/equipo/usage_page.go
index a96d2093..4fe92a2c 100644
--- a/internal/equipo/usage_page.go
+++ b/internal/equipo/usage_page.go
@@ -146,6 +146,9 @@ func usageLabel(by string, row wire.UsageRow, labels map[string]chat.ConnLabel)
if name := copyText("work.specialist." + row.ID); name != "" {
return name
}
+ if name := makerName(row.ID); name != "" {
+ return name
+ }
return row.ID
}
if row.ID == "" {
diff --git a/internal/equipo/work_pages.go b/internal/equipo/work_pages.go
index 044f46e7..967afc6f 100644
--- a/internal/equipo/work_pages.go
+++ b/internal/equipo/work_pages.go
@@ -100,6 +100,57 @@ func specialistName(s string) string {
return s
}
+// stepName names the specialist that makes step s: its maker (a
+// data-defined specialist such as Design, which works on Engineering's
+// step kind) by its profile's own name, else its kind's specialist.
+func stepName(s wire.Step) string {
+ if s.Maker != nil {
+ if n := makerName(s.Maker.Profile); n != "" {
+ return n
+ }
+ }
+ return specialistName(s.Specialist)
+}
+
+// stepKey is the sidebar key of the specialist that makes step s: its
+// maker's id, else its kind.
+func stepKey(s wire.Step) string {
+ if s.Maker != nil {
+ return s.Maker.ID
+ }
+ return s.Specialist
+}
+
+// makerName is a data-defined specialist profile's own name (Design).
+func makerName(profile string) string { return copyText(makerCopyKey(profile)) }
+
+func makerCopyKey(profile string) string { return "chat.specialist.profile." + profile }
+
+// makerIcon is a data-defined specialist profile's icon.
+func makerIcon(profile string) string {
+ switch profile {
+ case "research-v1":
+ return "search"
+ case "design-v1":
+ return "image"
+ }
+ return "star"
+}
+
+// taskStepName names who works on the task's step s: stepName, or the
+// task's maker for an Engineering-kind step it has not bound yet.
+func taskStepName(t wire.Task, s *wire.Step) string {
+ if s == nil {
+ if t.Maker != nil {
+ if n := makerName(t.Maker.Profile); n != "" {
+ return n
+ }
+ }
+ return specialistName(wire.SpecialistEngineering)
+ }
+ return stepName(*s)
+}
+
// checksLine is a checks result in words, honest about what did not run
// and about checks that ran outside the sandbox (sandbox none, a Mac
// worker whose probe P2 did not deny: Paul's ruling 2).
@@ -154,7 +205,7 @@ func taskLineOf(t wire.Task, viewer string) taskLine {
v.Pushed = fmt.Sprintf(copyText("work.pushed"), t.Branch, v.Short)
}
for _, s := range t.Steps {
- l := stepLine{Step: s, Line: fmt.Sprintf(copyText("work.step"), specialistName(s.Specialist), s.Attempt, copyText("work.step."+s.State))}
+ l := stepLine{Step: s, Line: fmt.Sprintf(copyText("work.step"), stepName(s), s.Attempt, copyText("work.step."+s.State))}
if s.Round > 0 && s.Specialist == wire.SpecialistEngineering && !s.Rebase {
l.Line += " (" + fmt.Sprintf(copyText("work.round"), s.Round) + ")"
}
@@ -464,6 +515,13 @@ func threadOf(t wire.Task, viewer string, cursor int64, models ...modelLookup) t
}
for _, q := range t.Questions {
who := specialistName(q.Specialist)
+ // A move retires a task's steps to EarlierSteps; their questions
+ // stay, still their makers'.
+ for _, st := range slices.Concat(t.EarlierSteps, t.Steps) {
+ if st.ID == q.StepID {
+ who = stepName(st)
+ }
+ }
it := threadItem{ID: q.ID, Text: q.Text, Author: q.Asker, Who: who, Own: q.Asker == viewer, At: q.CreatedAt}
switch q.State {
case wire.QuestionAnswered:
@@ -499,6 +557,13 @@ func threadOf(t wire.Task, viewer string, cursor int64, models ...modelLookup) t
v.Items = append(v.Items, it)
}
slices.SortStableFunc(v.Items, func(a, b threadItem) int { return a.At.Compare(b.At) })
+ // Who answers as each kind (the page and its stream name them): the
+ // newest such step's maker, Design on a task Design makes.
+ for _, s := range t.Steps {
+ if s.Specialist == wire.SpecialistEngineering || s.Specialist == wire.SpecialistReview {
+ v.Names[s.Specialist] = stepName(s)
+ }
+ }
// Asking follows the API: until the task ends, and for 14 days after
// it is done (merged work).
if t.Creator != viewer || !t.AskOpen {
@@ -506,9 +571,12 @@ func threadOf(t wire.Task, viewer string, cursor int64, models ...modelLookup) t
}
for _, sp := range []string{wire.SpecialistEngineering, wire.SpecialistReview} {
for _, s := range t.Steps {
- if s.Specialist == sp && s.Askable && s.State == wire.StepDone && !slices.Contains(v.Choices, sp) {
- v.Choices = append(v.Choices, sp)
- v.Names[sp] = specialistName(sp)
+ if s.Specialist == sp && s.Askable && s.State == wire.StepDone {
+ if !slices.Contains(v.Choices, sp) {
+ v.Choices = append(v.Choices, sp)
+ }
+ // Named by the newest such step's maker (Design).
+ v.Names[sp] = stepName(s)
}
}
}
diff --git a/internal/equipo/work_spend.go b/internal/equipo/work_spend.go
index c86b7b63..0936504f 100644
--- a/internal/equipo/work_spend.go
+++ b/internal/equipo/work_spend.go
@@ -30,7 +30,7 @@ func spendOf(t wire.Task, sp chat.TaskSpend) (total, note string, lines []spendL
if !ok {
continue
}
- name := specialistName(s.Specialist)
+ name := stepName(s)
if s.Round > 0 && s.Specialist == wire.SpecialistEngineering && !s.Rebase {
name += ", " + fmt.Sprintf(copyText("work.round"), s.Round)
}
diff --git a/internal/equipo/work_views.go b/internal/equipo/work_views.go
index 2b898a59..8b049cf2 100644
--- a/internal/equipo/work_views.go
+++ b/internal/equipo/work_views.go
@@ -540,7 +540,7 @@ func (v *taskLine) richOf(t wire.Task, viewer string, card *wire.Card, now time.
switch {
case running != nil:
since := running.StartedAt
- v.Chip = &chipLine{Text: fmt.Sprintf(copyText("work.chip.working"), specialistName(running.Specialist)), Live: true, Since: since}
+ v.Chip = &chipLine{Text: fmt.Sprintf(copyText("work.chip.working"), stepName(*running)), Live: true, Since: since}
if running.Specialist == wire.SpecialistMerge {
v.Chip.Text = copyText("work.chip.merging")
}
@@ -548,7 +548,7 @@ func (v *taskLine) richOf(t wire.Task, viewer string, card *wire.Card, now time.
since := t.Coordinator.Since
v.Chip = &chipLine{Text: copyText("work.chip.coordinator_" + t.Coordinator.Kind), Live: true, Since: &since}
case lastStep(t) != nil && lastStep(t).State == wire.StepQueued:
- v.Chip = &chipLine{Text: fmt.Sprintf(copyText("work.chip.waiting_for"), specialistName(lastStep(t).Specialist)), Icon: "clock"}
+ v.Chip = &chipLine{Text: fmt.Sprintf(copyText("work.chip.waiting_for"), stepName(*lastStep(t))), Icon: "clock"}
case waitsForMac(t):
// Approved, and checks need a Mac nobody connected yet: it waits
// on a Mac, not on the person (who may still merge without).
@@ -698,12 +698,7 @@ func decisionOf(t wire.Task, v taskLine) *decisionView {
}
return d
}
- who := func(s *wire.Step) string {
- if s == nil {
- return specialistName(wire.SpecialistEngineering)
- }
- return specialistName(s.Specialist)
- }
+ who := func(s *wire.Step) string { return taskStepName(t, s) }
switch t.NeedsYou {
case wire.NeedsHeld:
// The scheduler holds the step and asks (connectors spec §8):
@@ -959,9 +954,9 @@ func summaryOf(t wire.Task, v taskLine) string {
if reason == "" {
reason = copyText("work.reason.other")
}
- return fmt.Sprintf(copyText("work.summary.stopped"), specialistName(v.Stopped.Specialist), reason, waiter)
+ return fmt.Sprintf(copyText("work.summary.stopped"), stepName(*v.Stopped), reason, waiter)
case v.Running != nil:
- return fmt.Sprintf(copyText("work.summary.running"), specialistName(v.Running.Specialist), strings.ToLower(lastActivity(v.Running)))
+ return fmt.Sprintf(copyText("work.summary.running"), stepName(*v.Running), strings.ToLower(lastActivity(v.Running)))
case waitsForMac(t) && v.Mine:
return copyText("work.summary.waiting_mac")
case t.NeedsYou == wire.NeedsMerge && v.Card != nil || !v.Mine && t.Stage == wire.StageReadyToMerge && (t.Checks == wire.ChecksCannotRun || t.Checks == wire.ChecksNone):
@@ -977,7 +972,7 @@ func summaryOf(t wire.Task, v taskLine) string {
case t.Coordinator != nil:
return copyText("work.summary.looking")
case lastStep(t) != nil && lastStep(t).State == wire.StepQueued:
- return fmt.Sprintf(copyText("work.summary.queued"), specialistName(lastStep(t).Specialist))
+ return fmt.Sprintf(copyText("work.summary.queued"), stepName(*lastStep(t)))
case t.Stage == wire.StageInvestigated:
return copyText("work.summary.investigated")
case t.Stage == wire.StageNoted:
@@ -1135,7 +1130,7 @@ func timelineOf(t wire.Task, v taskLine) []timelineItem {
}
on := func(sha string) string { return fmt.Sprintf(copyText("work.tl.on_sha"), short(sha)) }
for _, s := range t.Steps {
- name := specialistName(s.Specialist)
+ name := stepName(s)
title := fmt.Sprintf(copyText("work.tl.attempt"), name, s.Attempt)
if s.Specialist == wire.SpecialistEngineering {
if s.Rebase {
@@ -1553,7 +1548,7 @@ func projectActivity(tasks []taskLine, now time.Time) []projectEvent {
if s.FinishedAt == nil {
continue
}
- ev := projectEvent{At: *s.FinishedAt, TaskID: t.ID, Title: t.Title, Who: specialistName(s.Specialist)}
+ ev := projectEvent{At: *s.FinishedAt, TaskID: t.ID, Title: t.Title, Who: stepName(s.Step)}
switch {
case s.State == wire.StepFailed:
ev.Format = "work.recent.stopped"
diff --git a/internal/thintest/design_labels_browser_test.go b/internal/thintest/design_labels_browser_test.go
new file mode 100644
index 00000000..a3097047
--- /dev/null
+++ b/internal/thintest/design_labels_browser_test.go
@@ -0,0 +1,60 @@
+//go:build browser
+
+package thintest
+
+import (
+ "testing"
+
+ "amadan.net/oficina/equipo/internal/wire"
+)
+
+// TestBrowserDesignHandoffRenames: a task page open while Design works
+// names Design; once Design's work is handed to Engineering (its
+// specialist revoked, the recovery card answered), the open page names
+// Engineering, without a reload: the names its ask line and thread use
+// follow the refreshed thread, so a question never says Design while it
+// reaches Engineering.
+func TestBrowserDesignHandoffRenames(t *testing.T) {
+ r := newToolRigSaying(t, wire.ProtocolCurrent, overhaulWords)
+ r.designOn(rendererHealth(t, nil))
+ sp, id := r.designAdded(r.proposeDesign("d-propose"))
+ d := r.designStarted(sp, id)
+ p := openInner(t, r.inst.URL, r.inst.SessionFor(t, Owner), 1280, 900, false, "light", "reduce")
+ defer p.stop()
+ p.open("/tasks/" + id)
+ // Design's drawer, open in a second window.
+ drawer := openInner(t, r.inst.URL, r.inst.SessionFor(t, Owner), 1280, 900, false, "light", "reduce")
+ defer drawer.stop()
+ drawer.open("/tasks")
+ drawer.check(`(()=>{document.querySelector('#nav-`+sp.ID+`').click();return true})()`, "open Design's drawer")
+ drawer.wait(`document.querySelector('dialog[equipo-drawer][open] #team-title')?.textContent==='Design'`, "Design's drawer")
+ names := `document.querySelector('[data-chat-stream]').dataset.nameEngineering`
+ p.check(names+`==='Design'`, "Design's task page does not name Design")
+
+ if _, err := r.client.RevokeSpecialist(r.ctx, sp.ID, sp.Revision); err != nil {
+ t.Fatal(err)
+ }
+ r.expect(wire.FrameCancelStep)
+ r.step("hr-end", wire.StepReport{TaskID: id, StepID: d.StepID, Attempt: d.Attempt, State: wire.StepCancelled, Reason: "cancelled", BaseSHA: baseX, Termination: true})
+ var card wire.Card
+ r.wait("recovery card", func(c *Conversation) bool {
+ for _, k := range c.Cards {
+ if k.Kind == wire.CardMakerRemoved && k.TaskID == id && k.State == wire.CardOpen {
+ card = k
+ }
+ }
+ return card.ID != ""
+ })
+ if _, err := r.client.Answer(r.ctx, card.ID, wire.ChoiceToEngineering, card.Revision); err != nil {
+ t.Fatal(err)
+ }
+ if e := r.nextDispatch(); e.TaskID != id || e.SpecialistID != "" {
+ t.Fatalf("handed to Engineering %+v", e)
+ }
+ p.wait(names+`==='Engineering'`, "the open page names Engineering")
+ p.check(`(()=>{const l=document.querySelector('[data-ask-line]');return !l || !l.textContent.includes('Design')})()`, "the ask line still says Design")
+ p.stayed("the handoff")
+ // Design is gone: its open drawer closes rather than keep an Ask form
+ // whose questions would reach Engineering.
+ drawer.wait(`!document.querySelector('dialog[equipo-drawer][open]')`, "Design's drawer to close")
+}
diff --git a/internal/thintest/design_labels_contract_test.go b/internal/thintest/design_labels_contract_test.go
new file mode 100644
index 00000000..b49c6792
--- /dev/null
+++ b/internal/thintest/design_labels_contract_test.go
@@ -0,0 +1,140 @@
+package thintest
+
+import (
+ "encoding/json"
+ "fmt"
+ "regexp"
+ "strings"
+ "testing"
+
+ "amadan.net/oficina/equipo/internal/specialist"
+ "amadan.net/oficina/equipo/internal/wire"
+)
+
+// TestContractDesignNamedAsItself is the production shape Paul found
+// (27d50e7f): Design added for Patrix, its task running as an
+// Engineering-kind step bound to design-v1. Everything that names the
+// step's specialist names Design: the step and the task carry their maker
+// in the person API; the sidebar has a Design row (its name, icon and
+// drawer) working on the task while Engineering's stays idle; Design's
+// drawer, the task page's step lines and chip, and the conversation's
+// report header say Design, never Engineering, for this work.
+func TestContractDesignNamedAsItself(t *testing.T) {
+ r := newToolRigSaying(t, wire.ProtocolCurrent, overhaulWords)
+ r.designOn(rendererHealth(t, nil))
+ sp, id := r.designAdded(r.proposeDesign("d-propose"))
+ d := r.designStarted(sp, id)
+
+ k := r.task(id)
+ eng := stepsOf(k, wire.SpecialistEngineering)[0]
+ if eng.Maker == nil || eng.Maker.ID != sp.ID || eng.Maker.Profile != specialist.ProfileDesign {
+ t.Fatalf("the step's maker %+v", eng.Maker)
+ }
+ if k.Maker == nil || k.Maker.ID != sp.ID || k.Maker.Profile != specialist.ProfileDesign {
+ t.Fatalf("the task's maker %+v", k.Maker)
+ }
+
+ // The step's events (what the stream and the apps' snapshots read)
+ // carry the maker too.
+ rows, err := r.inst.DB.Writer().Query("SELECT body FROM chat_events WHERE type = ? ORDER BY id", wire.EventStep)
+ if err != nil {
+ t.Fatal(err)
+ }
+ events := 0
+ for rows.Next() {
+ var body string
+ var e wire.Event
+ var st wire.Step
+ if err := rows.Scan(&body); err != nil || json.Unmarshal([]byte(body), &e) != nil || json.Unmarshal(e.Data, &st) != nil {
+ t.Fatalf("a step event %q: %v", body, err)
+ }
+ if st.ID != d.StepID {
+ continue
+ }
+ events++
+ if st.Maker == nil || st.Maker.ID != sp.ID || st.Maker.Profile != specialist.ProfileDesign {
+ t.Fatalf("a step event without its maker: %s", body)
+ }
+ }
+ rows.Close()
+ if events == 0 {
+ t.Fatal("no events for Design's step")
+ }
+
+ owner := r.inst.SessionFor(t, Owner)
+ rail := railOf(t, r.get(owner, "/tasks", 200))
+ row := regexp.MustCompile(`(?s)<a equipo-spec id="nav-` + regexp.QuoteMeta(sp.ID) + `".*?</a>`).FindString(rail)
+ for _, want := range []string{`href="/team/` + sp.ID + `"`, `data-state="working"`, `<span equipo-spec-name>Design</span>`, `<span equipo-nav-task>` + k.Title + `</span>`} {
+ if !strings.Contains(row, want) {
+ t.Fatalf("Design's row lacks %q: %q\nrail: %s", want, row, rail)
+ }
+ }
+ engRow := regexp.MustCompile(`(?s)<a equipo-spec id="nav-engineering".*?</a>`).FindString(rail)
+ if !strings.Contains(engRow, `data-state="idle"`) || strings.Contains(engRow, k.Title) {
+ t.Fatalf("Engineering's row shows Design's work: %s", engRow)
+ }
+
+ drawer := r.get(owner, "/team/"+sp.ID, 200)
+ for _, want := range []string{`data-team="` + sp.ID + `" data-state="working"`, `<h1 id="team-title">Design</h1>`, `href="/tasks/` + id + `"`} {
+ if !strings.Contains(drawer, want) {
+ t.Fatalf("Design's drawer lacks %q:\n%s", want, drawer)
+ }
+ }
+ if p := r.get(owner, "/team/engineering", 200); strings.Contains(p, `href="/tasks/`+id+`"`) {
+ t.Fatal("Engineering's drawer lists Design's task")
+ }
+
+ page := r.get(owner, "/tasks/"+id, 200)
+ for _, want := range []string{fmt.Sprintf("Design, attempt %d", eng.Attempt), "Design is on it now"} {
+ if !strings.Contains(page, want) {
+ t.Fatalf("the task page lacks %q", want)
+ }
+ }
+ for _, not := range []string{fmt.Sprintf("Engineering, attempt %d", eng.Attempt), "Engineering is on it now"} {
+ if strings.Contains(page, not) {
+ t.Fatalf("the task page says %q", not)
+ }
+ }
+ if list := r.get(owner, "/tasks", 200); !strings.Contains(list, "Design working") || strings.Contains(list, "Engineering working") {
+ t.Fatal("the task list's chip does not say Design is working")
+ }
+ // The task's report in the conversation is Design's.
+ conv := r.get(owner, "/conversation", 200)
+ authors := regexp.MustCompile(`<span equipo-roster-author><b>([^<]*)</b>`).FindAllStringSubmatch(conv, -1)
+ design := false
+ for _, a := range authors {
+ design = design || a[1] == "Design"
+ if a[1] == "Engineering" {
+ t.Fatalf("a report by Engineering in a conversation where only Design works: %v", authors)
+ }
+ }
+ if !design {
+ t.Fatalf("no report by Design: %v", authors)
+ }
+
+ // Once the step ends with a summary, its line in the task's steps is
+ // Design's too.
+ tokens := int64(1000)
+ r.step("ds-failed", wire.StepReport{TaskID: id, StepID: d.StepID, Attempt: d.Attempt, State: wire.StepFailed, Reason: "provider_failed", BaseSHA: baseX, Termination: true, Family: "claude", Account: "claude-a", Summary: "Stopped early.", LogTail: "provider failed", Usage: []wire.Usage{{Provider: wire.ProviderClaude, Connection: "claude-a", Model: "claude-opus-5-5", Attempt: d.Attempt, Outcome: wire.OutcomeFailed, Complete: true, InputTokens: &tokens, OutputTokens: &tokens}}})
+ page = r.get(owner, "/tasks/"+id, 200)
+ if !strings.Contains(page, fmt.Sprintf("Design, attempt %d: ", d.Attempt)) || strings.Contains(page, fmt.Sprintf("Engineering, attempt %d: ", d.Attempt)) {
+ t.Fatal("the ended step's line is not Design's")
+ }
+
+ // Its spend is Design's on Usage by role, not Engineering's.
+ raw, _ := r.fetch(r.client.Token, "/api/v1/usage?period=week&by=role", 200)
+ var totals wire.UsageTotals
+ if err := wire.Strict(raw, &totals); err != nil {
+ t.Fatal(err)
+ }
+ roles := map[string]int64{}
+ for _, row := range totals.Rows {
+ roles[row.ID] += row.Attempts
+ }
+ if roles[specialist.ProfileDesign] != 1 || roles[wire.SpecialistEngineering] != 0 {
+ t.Fatalf("usage by role %s", raw)
+ }
+ if usage := r.get(owner, "/usage?period=week&by=role", 200); !regexp.MustCompile(`<th[^>]*>Design</th>`).MatchString(usage) {
+ t.Fatal("Usage by role does not name Design")
+ }
+}
diff --git a/internal/wire/push.go b/internal/wire/push.go
index 7b91052a..7d07c3a9 100644
--- a/internal/wire/push.go
+++ b/internal/wire/push.go
@@ -91,7 +91,8 @@ const MaxLiveActivities = 3
// LiveActivityState is a task Live Activity's content state, the app's
// Codable ContentState: the task, its stage (Task.stage), the specialist
-// working on it (Step.specialist), the newest activity line, what it
+// working on it (Step.specialist, or its maker's category: design), the
+// newest activity line, what it
// needs from you (Task.needs_you, "" when nothing), the tone, and once it
// ended, the outcome.
type LiveActivityState struct {
diff --git a/internal/wire/tasks.go b/internal/wire/tasks.go
index 2508d8a0..85641614 100644
--- a/internal/wire/tasks.go
+++ b/internal/wire/tasks.go
@@ -347,6 +347,11 @@ type Step struct {
// Design: a done Design attempt's kept captures by option, on the
// task's read shape only.
Design *StepDesign `json:"design,omitempty"`
+ // Maker is the data-defined specialist that makes this step's work
+ // (Design is a maker on Engineering's step kind): the one its binding
+ // names, or, before its dispatch, its task's maker. Absent for a step
+ // its own kind's specialist makes. A step is named by its maker.
+ Maker *Maker `json:"maker,omitempty"`
// Hold is why the scheduler holds the step now (absent when it does
// not).
Hold *StepHold `json:"hold,omitempty"`
@@ -469,7 +474,10 @@ type Task struct {
// ExploredFrom is the exploration this change was built from; BuiltAs
// the change an exploration became.
ExploredFrom *TaskRef `json:"explored_from,omitempty"`
- BuiltAs *TaskRef `json:"built_as,omitempty"`
+ // Maker is the data-defined specialist that makes the task's work
+ // now (absent when Engineering does).
+ Maker *Maker `json:"maker,omitempty"`
+ BuiltAs *TaskRef `json:"built_as,omitempty"`
// Direction is what the direction card shows while an exploration
// waits for its person's choice.
Direction *TaskDirection `json:"direction,omitempty"`
@@ -1259,3 +1267,22 @@ const ReasonMergeCredential = "merge_credential"
// Nothing was sent; a later Merge may try again. An older instance records
// it as unknown.
const ReasonAmadanUnreachable = "amadan_unreachable"
+
+// Maker is a data-defined specialist that makes a task's work: its id
+// (GET /api/v1/specialists) and its profile (design-v1).
+type Maker struct {
+ ID string `json:"id"`
+ Profile string `json:"profile"`
+}
+
+// Category is the specialist a maker is, as the apps name one: its
+// profile without the version (design for design-v1).
+func (m *Maker) Category() string {
+ if m == nil {
+ return ""
+ }
+ if i := strings.LastIndex(m.Profile, "-v"); i > 0 {
+ return m.Profile[:i]
+ }
+ return m.Profile
+}
diff --git a/internal/wire/usage.go b/internal/wire/usage.go
index 37096bda..8ca04a4a 100644
--- a/internal/wire/usage.go
+++ b/internal/wire/usage.go
@@ -160,7 +160,8 @@ type UsageTotals struct {
}
// UsageRow is one grouping's sums. ID is the connection's, project's or
-// task's id or the role; Label the name the record carries. Partial: a
+// task's id or the role (a maker's step, Design's, is its profile:
+// design-v1); Label the name the record carries. Partial: a
// row lacked a figure, so the sums are at least these. Cost is the
// estimate from the price table where every row was priced (null
// otherwise), in Currency.
diff --git a/native/apple/Sources/EquipoKit/API/Thin.swift b/native/apple/Sources/EquipoKit/API/Thin.swift
index 89beca89..7698b8ac 100644
--- a/native/apple/Sources/EquipoKit/API/Thin.swift
+++ b/native/apple/Sources/EquipoKit/API/Thin.swift
@@ -82,6 +82,24 @@ public struct ThinStepHosted: Codable, Sendable, Equatable {
public var failed: [String]?
}
+/// A data-defined specialist that makes a task's work (wire.Maker).
+public struct ThinMaker: Codable, Sendable, Equatable {
+ public var id: String
+ public var profile: String
+ /// The specialist it is, as Specialist(category:) names one: its
+ /// profile without the version (design for design-v1).
+ public var category: String {
+ guard let range = profile.range(of: "-v", options: .backwards), range.lowerBound > profile.startIndex else { return profile }
+ return String(profile[..<range.lowerBound])
+ }
+}
+
+extension ThinStep {
+ /// Who makes this step, as Specialist(category:) names one: its maker
+ /// (Design), else its kind.
+ public var who: String { maker?.category ?? specialist }
+}
+
public struct ThinStep: Codable, Sendable, Identifiable, Equatable {
@ValidatedChangeFiles public var changeFiles: ThinChangeFiles? = nil
public var hosted: ThinStepHosted? = nil
@@ -112,6 +130,9 @@ public struct ThinStep: Codable, Sendable, Identifiable, Equatable {
public var checksSandbox: String? = nil
public var preview: ThinPreviewResult? = nil
public var research: ThinStepResearch? = nil
+ /// The data-defined specialist that makes this step (Design works on
+ /// Engineering's step kind); absent when the kind's own specialist does.
+ public var maker: ThinMaker? = nil
public var publish: ThinPublishResult? = nil
public var retriedBy: String? = nil
public var terminated: Bool? = nil
@@ -207,6 +228,8 @@ public struct ThinTask: Codable, Sendable, Identifiable, Equatable {
public var combined: [ThinTaskRef]? = nil
public var engineeringRunner: String? = nil
public var exploredFrom: ThinTaskRef? = nil
+ /// The data-defined specialist that makes the task's work now.
+ public var maker: ThinMaker? = nil
public var builtAs: ThinTaskRef? = nil
public var direction: ThinTaskDirection? = nil
public var previewUrl: String? = nil
diff --git a/native/apple/Sources/EquipoKit/Presentation/Roster.swift b/native/apple/Sources/EquipoKit/Presentation/Roster.swift
index f66b58f9..27a1e927 100644
--- a/native/apple/Sources/EquipoKit/Presentation/Roster.swift
+++ b/native/apple/Sources/EquipoKit/Presentation/Roster.swift
@@ -70,7 +70,9 @@ public struct TaskReport: Sendable, Equatable {
public var specialist: Specialist {
let steps = task.steps ?? []
let active = steps.last { $0.state == "running" || $0.state == "queued" } ?? steps.last { $0.state == "done" }
- return active.map { Specialist(category: $0.specialist) } ?? .engineering
+ // No running or finished step (the first attempt failed or was
+ // cancelled): the task's maker, then Engineering.
+ return active.map { Specialist(category: $0.who) } ?? task.maker.map { Specialist(category: $0.category) } ?? .engineering
}
/// chat_roster.go RosterChecks, RosterReview and their details, in the web's words.
public var facts: [RosterFact] {
diff --git a/native/apple/Sources/EquipoKit/UI/Components.swift b/native/apple/Sources/EquipoKit/UI/Components.swift
index 8afb3673..9c4e6124 100644
--- a/native/apple/Sources/EquipoKit/UI/Components.swift
+++ b/native/apple/Sources/EquipoKit/UI/Components.swift
@@ -47,7 +47,7 @@ struct StepsView: View {
VStack(alignment: .leading, spacing: 4) {
VStack(alignment: .leading, spacing: 4) {
HStack(alignment: .firstTextBaseline) {
- SpecialistLabel(category: step.specialist, tone: step.state == "queued" ? Palette.secondary : Palette.text)
+ SpecialistLabel(category: step.who, tone: step.state == "queued" ? Palette.secondary : Palette.text)
Spacer(minLength: 8)
Text(Self.label(step.state)).font(Typo.caption)
.foregroundStyle(step.state == "failed" ? Palette.negative : step.state == "done" ? Palette.positive : Palette.secondary)
diff --git a/native/apple/Sources/EquipoKit/UI/Screens/TodaySection.swift b/native/apple/Sources/EquipoKit/UI/Screens/TodaySection.swift
index 2d8d1438..63eee3b3 100644
--- a/native/apple/Sources/EquipoKit/UI/Screens/TodaySection.swift
+++ b/native/apple/Sources/EquipoKit/UI/Screens/TodaySection.swift
@@ -45,7 +45,7 @@ private struct TodayTaskRow: View {
if let pause = TaskPause(task, mine: false, now: now) { PauseLead(pause: pause) }
else if let step = NeedsToday.liveStep(task) {
VStack(alignment: .leading, spacing: 4) {
- Text(Specialist(category: step.specialist).name).font(Typo.captionStrong)
+ Text(Specialist(category: step.who).name).font(Typo.captionStrong)
if !step.headline.isEmpty { Text(step.headline).font(Typo.secondary).fixedSize(horizontal: false, vertical: true) }
}.foregroundStyle(Palette.secondary)
}
diff --git a/native/apple/Tests/EquipoKitTests/MakerTests.swift b/native/apple/Tests/EquipoKitTests/MakerTests.swift
new file mode 100644
index 00000000..69e8d1c1
--- /dev/null
+++ b/native/apple/Tests/EquipoKitTests/MakerTests.swift
@@ -0,0 +1,39 @@
+import Foundation
+import Testing
+@testable import EquipoActivity
+@testable import EquipoKit
+
+/// A step Design makes is Engineering's kind with a maker (wire.Maker):
+/// the apps name it Design, never Engineering; a plain step keeps its kind.
+@MainActor struct MakerTests {
+ static func step(maker: String) -> String {
+ """
+ {"id":"s1","specialist":"engineering","state":"running","reason":"","summary":"","headline":"","verdict":"","review_label":"","checks":"","gate":"","exit_code":null,"started_at":null,"finished_at":null\(maker)}
+ """
+ }
+
+ @Test func aDesignStepIsDesign() throws {
+ let step = try EquipoJSON.decoder.decode(ThinStep.self, from: Data(Self.step(maker: #","maker":{"id":"sp1","profile":"design-v1"}"#).utf8))
+ #expect(step.maker == ThinMaker(id: "sp1", profile: "design-v1"))
+ #expect(step.who == "design")
+ #expect(Specialist(category: step.who) == .design)
+ }
+
+ @Test func aPlainStepKeepsItsKind() throws {
+ let step = try EquipoJSON.decoder.decode(ThinStep.self, from: Data(Self.step(maker: "").utf8))
+ #expect(step.maker == nil)
+ #expect(Specialist(category: step.who) == .engineering)
+ #expect(ThinMaker(id: "sp2", profile: "research-v1").category == "research")
+ }
+
+ /// Design's first attempt failed: no running or finished step, so the
+ /// card names the task's maker, not Engineering.
+ @Test func aFailedFirstDesignAttemptIsStillDesign() throws {
+ let failed = Self.step(maker: #","maker":{"id":"sp1","profile":"design-v1"}"#).replacingOccurrences(of: #""state":"running""#, with: #""state":"failed""#)
+ let json = """
+ {"id":"tk1","revision":3,"project_id":"p_1","project":"Shop","title":"Overhaul the shop design","brief":"","stage":"in_progress","branch":"","url":"","candidate_sha":"","checks":"","checks_reason":"","verdict":"","review_label":"","needs_you":"","creator":"paul@example.com","created_at":"2026-11-24T09:00:00Z","updated_at":"2026-11-24T09:00:00Z","maker":{"id":"sp1","profile":"design-v1"},"steps":[\(failed)]}
+ """
+ let task = try EquipoJSON.decoder.decode(ThinTask.self, from: Data(json.utf8))
+ #expect(TaskReport(task, needsYou: false).specialist == .design)
+ }
+}