oficina / equipo Public

Merge branch 'native/push' into main

claude agent, operated by paul@keymail.dev 257303da2df42dc8829592c31db505b5bf700c0c parent a48ef05parent 6fc77bc
65 files changed, +4,286 −147
  • .gitleaks.toml +5 −0
  • .rastrillo/budgets.txt +3 −3
  • docs/api/equipo-v1.md +1 −1
  • internal/equipo/chat/push.go +1 −0
  • internal/equipo/chat/push_test.go +8 −1
  • internal/equipo/push/payload.go +1 −1
  • internal/equipo/push/payload_test.go +1 −0
  • internal/equipo/push/rules.go +2 −0
  • internal/equipo/push/testdata/activity-start.json +2 −1
  • internal/wire/push.go +3 −0
  • native/.gitignore +1 −0
  • native/apple/Package.swift +7 −2
  • native/apple/Sources/EquipoActivity/Resources/Localizable.xcstrings +1,810 −0
  • native/apple/Sources/EquipoActivity/Roster.swift +74 −0
  • native/apple/Sources/EquipoActivity/TaskActivity.swift +122 −0
  • native/apple/Sources/EquipoActivity/TaskActivityWidget.swift +185 −0
  • native/apple/Sources/EquipoKit/API/Push.swift +83 −0
  • native/apple/Sources/EquipoKit/API/Thin.swift +5 −0
  • native/apple/Sources/EquipoKit/Exports.swift +4 −0
  • native/apple/Sources/EquipoKit/Pairing/SecretStore.swift +13 −7
  • native/apple/Sources/EquipoKit/Presentation/Roster.swift +28 −64
  • native/apple/Sources/EquipoKit/Push/LiveActivities.swift +115 −0
  • native/apple/Sources/EquipoKit/Push/Notifications.swift +111 −0
  • native/apple/Sources/EquipoKit/Push/PhoneDelegate.swift +28 −0
  • native/apple/Sources/EquipoKit/Push/PushEnvironment.swift +63 −0
  • native/apple/Sources/EquipoKit/Push/PushRegistrar.swift +151 −0
  • native/apple/Sources/EquipoKit/Push/PushRoute.swift +56 −0
  • native/apple/Sources/EquipoKit/Resources/Brand.xcassets/AppMark.imageset/AppMark.png binary
  • native/apple/Sources/EquipoKit/Resources/Brand.xcassets/AppMark.imageset/Contents.json +4 −0
  • native/apple/Sources/EquipoKit/Resources/Brand.xcassets/Contents.json +1 −0
  • native/apple/Sources/EquipoKit/Resources/Localizable.xcstrings +77 −22
  • native/apple/Sources/EquipoKit/Session/EquipoSession.swift +30 −0
  • native/apple/Sources/EquipoKit/UI/Components.swift +3 −3
  • native/apple/Sources/EquipoKit/UI/LiveCards.swift +109 −5
  • native/apple/Sources/EquipoKit/UI/RosterViews.swift +3 −3
  • native/apple/Sources/EquipoKit/UI/Screens/AppModel.swift +66 −4
  • native/apple/Sources/EquipoKit/UI/Screens/ConversationScreen.swift +26 −2
  • native/apple/Sources/EquipoKit/UI/Screens/PairingView.swift +3 −0
  • native/apple/Sources/EquipoKit/UI/Screens/PhoneRoot.swift +32 −5
  • native/apple/Sources/EquipoKit/UI/Screens/TaskScreens.swift +13 −5
  • native/apple/Sources/EquipoMac/EquipoMacApp.swift +25 −1
  • native/apple/Sources/EquipoMac/LiveTranscript.swift +114 −3
  • native/apple/Sources/EquipoMac/MacMainView.swift +17 −2
  • native/apple/Tests/EquipoKitTests/Fixtures/push/activity-end.json +17 −0
  • native/apple/Tests/EquipoKitTests/Fixtures/push/activity-needs.json +15 −0
  • native/apple/Tests/EquipoKitTests/Fixtures/push/activity-replaced.json +17 −0
  • native/apple/Tests/EquipoKitTests/Fixtures/push/activity-start.json +25 −0
  • native/apple/Tests/EquipoKitTests/Fixtures/push/activity-update.json +15 −0
  • native/apple/Tests/EquipoKitTests/Fixtures/push/badge.json +5 −0
  • native/apple/Tests/EquipoKitTests/Fixtures/push/card.json +16 −0
  • native/apple/Tests/EquipoKitTests/Fixtures/push/reply.json +13 −0
  • native/apple/Tests/EquipoKitTests/Fixtures/push/task-done.json +14 −0
  • native/apple/Tests/EquipoKitTests/Fixtures/push/task-failed.json +14 −0
  • native/apple/Tests/EquipoKitTests/PushTests.swift +486 −0
  • native/apple/Tests/EquipoKitTests/SetAsideTests.swift +136 −0
  • native/apple/Tests/EquipoKitTests/Support.swift +2 −1
  • native/ios/ActivityExtension/EquipoActivityBundle.swift +10 −0
  • native/ios/EquipoPhone.entitlements +13 −0
  • native/ios/Sources/EquipoPhoneApp.swift +2 −1
  • native/ios/project.yml +46 −0
  • native/mac-updates.json +2 −0
  • native/macos/DeveloperID.entitlements +13 −0
  • native/scripts/check-parity.py +4 −3
  • native/scripts/check-strings.py +8 −5
  • native/scripts/strings.json +7 −2

CI passed — run details

CI log
=== prepare ===
ci-box: machine: aarch64, 32 CPUs, 62 GiB memory, kernel 7.0.0-1017-aws
ci-box: python 3.12.3; Docker version 29.1.3, build 29.1.3-0ubuntu3~24.04.2
ci-box: user namespaces allowed: 233151
ci-box: cgroup: cgroup2fs
ci-box: disk /home/ci/work/repos/oficina__equipo/wt/main: Type  Size Avail | ext4   96G   86G
ci-box: disk /home/ci/.cache/equipo-ci-box: Type  Size Avail | ext4   96G   86G
ci-box: bwrap: fetched and verified in 0.3s
ci-box: claude: fetched and verified in 2.1s
ci-box: codex: fetched and verified in 3.4s
ci-box: codex-code-mode-host: fetched and verified in 1.2s
ci-box: libwrap: fetched and verified in 0.3s
ci-box: socat: fetched and verified in 0.3s
npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead
ci-box: image pulled in 9.9s
ci-box: pi: installed and verified in 7.7s
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.0s
ci-box: clone deepened in 3.5s
ci-box: file times set from content: 2803 files, 184 directories
ci-box: ready in 17.4s
=== 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.250s
=== compile ===
go build ./...
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py compile
+ go build -tags testbuild ./...
  4.2s
+ go list -export -test -tags testbuild -f  ./...
  4.6s
+ go list -export -test -tags browser,testbuild -f  ./internal/equipo ./internal/headless ./internal/idtest ./internal/plan3test ./internal/thintest
  3.1s
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -version
staticcheck 2026.1 (v0.7.0)
go run golang.org/x/vuln/cmd/govulncheck@v1.8.0 -version
Go: go1.26.11
Scanner: govulncheck@v1.8.0
DB: https://vuln.go.dev
DB updated: 2026-11-11 02:51:11 +0000 UTC

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

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

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

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

receipt: test step 1m30.974s 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 1m29.124s amadan.net/oficina/equipo/internal/headless
receipt: slow test 46.06s amadan.net/oficina/equipo/internal/headless TestMacWorker
receipt: slow test 22.35s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 10.9s amadan.net/oficina/equipo/internal/headless TestHeadlessAttachments
receipt: slow test 9.81s amadan.net/oficina/equipo/internal/headless TestHeadlessPrewarm
machine: 32 CPUs, load 66.49, cpu waiting 39.83%, memory waiting 0.00%, io waiting 0.71%
--- shard 4 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-guards: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadlessCopyRotation$|^TestHeadlessPolicyGuards$|^TestHeadlessRunnerKillLeavesNoCopies$|^TestHeadlessNewHouseRuleStartsFresh$|^TestHeadless$/^3_engineering$|^TestHeadless$/^3_step_cancel$|^TestHeadless$/^3_step_contained$|^TestHeadless$/^3_empty_repo$|^TestHeadless$/^3_empty_engineering$|^TestHeadless$/^3_empty_merge$|^TestHeadless$/^3_empty_merge_rebuilt$|^TestHeadless$/^3_empty_fix_round$' ./internal/headless

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

receipt: test step 3m18.618s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 3m16.654s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m54.45s amadan.net/oficina/equipo/internal/headless TestHeadlessAssistant
receipt: slow test 24.37s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 11.65s amadan.net/oficina/equipo/internal/headless TestHeadlessResearchHandoff
receipt: slow test 8.23s amadan.net/oficina/equipo/internal/headless TestHeadlessClaudeSignIn
receipt: slow test 7.38s amadan.net/oficina/equipo/internal/headless TestHeadlessTurnBatching
machine: 32 CPUs, load 15.20, cpu waiting 7.78%, memory waiting 0.00%, io waiting 0.11%
--- 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 2m4.467s 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 2m2.804s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 8.14s amadan.net/oficina/equipo/internal/thintest TestContractTeamJobSettledStates
receipt: slow test 6.79s amadan.net/oficina/equipo/internal/thintest TestExplorePreviewsOff
receipt: slow test 3.81s amadan.net/oficina/equipo/internal/thintest TestContractPreviewHeldUntilPublishAnswer
receipt: slow test 3.61s amadan.net/oficina/equipo/internal/thintest TestContractTeamNudgePersonNeeds
receipt: slow test 2.56s amadan.net/oficina/equipo/internal/thintest TestResearchDoneFallsBack
machine: 32 CPUs, load 46.43, cpu waiting 26.51%, memory waiting 0.00%, io waiting 0.40%
--- 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 1m27.699s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m25.558s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 9.2s amadan.net/oficina/equipo/internal/thintest TestContractPreviewNotScheduled
receipt: slow test 5.1s amadan.net/oficina/equipo/internal/thintest TestContractPublishNotOffered
receipt: slow test 4.49s amadan.net/oficina/equipo/internal/thintest TestContractMacRecheckMergeAuthority
receipt: slow test 2.44s amadan.net/oficina/equipo/internal/thintest TestContractPublishNotNow
receipt: slow test 2.37s amadan.net/oficina/equipo/internal/thintest TestContractPreview
machine: 32 CPUs, load 68.37, cpu waiting 40.16%, memory waiting 0.00%, io waiting 0.76%
--- shard 8 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane runner-thin: ./internal/runner/thin
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m ./internal/runner/thin
cache miss: amadan.net/oficina/equipo/internal/runner/thin: its inputs changed
budget note: internal/runner/thin took 4m43.5s, over the 45s its record on line 44 allows; reported only, timing fails on CI

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

receipt: test step 52.468s 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 51.239s amadan.net/oficina/equipo/internal/runner
receipt: slow test 31.21s amadan.net/oficina/equipo/internal/runner TestDirectBugWorkflow
receipt: slow test 20.03s amadan.net/oficina/equipo/internal/runner TestEnrolKeepsTheRole
machine: 32 CPUs, load 64.71, cpu waiting 33.28%, memory waiting 0.00%, io waiting 1.35%
--- shard 10 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane runner-plans: ./internal/runner
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestPlanWorkflowCandidateOrder$|^TestPlanWorkflowFeature$|^TestCoordinatorRecoveryCallRefusalKeepsServing$|^TestCoordinatorRefusalMatrix$' ./internal/runner
cache miss: amadan.net/oficina/equipo/internal/runner: its inputs changed

receipt: test step 1m3.391s 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 1m1.825s amadan.net/oficina/equipo/internal/runner
receipt: slow test 51.71s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowCandidateOrder
receipt: slow test 46.78s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowFeature
receipt: slow test 8.41s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryCallRefusalKeepsServing
receipt: slow test 1.69s amadan.net/oficina/equipo/internal/runner TestCoordinatorRefusalMatrix
machine: 32 CPUs, load 66.97, cpu waiting 38.22%, memory waiting 0.00%, io waiting 1.14%
--- shard 11 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane runner-rest: ./internal/runner
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -skip '^TestDirectBugWorkflow$|^TestEnrolKeepsTheRole$|^TestPlanWorkflowCandidateOrder$|^TestPlanWorkflowFeature$|^TestCoordinatorRecoveryCallRefusalKeepsServing$|^TestCoordinatorRefusalMatrix$' ./internal/runner
cache miss: amadan.net/oficina/equipo/internal/runner: its inputs changed

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

receipt: test step 1m8.446s 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 1m6.384s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 27.77s amadan.net/oficina/equipo/internal/equipotest TestBootstrapNamesOwnersSetting
receipt: slow test 27.75s amadan.net/oficina/equipo/internal/equipotest TestAuthorityCoreIntegration
receipt: slow test 25.55s amadan.net/oficina/equipo/internal/equipotest TestAccountLabelMigration
receipt: slow test 23.07s amadan.net/oficina/equipo/internal/equipotest TestBudgetConfigurationFailuresAreAtomic
receipt: slow test 22.6s amadan.net/oficina/equipo/internal/equipotest TestAuthorityProjectKinds
machine: 32 CPUs, load 64.11, cpu waiting 39.15%, memory waiting 0.00%, io waiting 0.62%
--- shard 13 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-e started 30s late; cpu waiting 36.4%, load 27.91
test lane equipotest-e: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^Test[E-P]' ./internal/equipotest

receipt: test step 1m17.285s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m15.284s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 20.04s amadan.net/oficina/equipo/internal/equipotest TestProjectConcurrentRetry
receipt: slow test 20.04s amadan.net/oficina/equipo/internal/equipotest TestProjectsReopen
receipt: slow test 20s amadan.net/oficina/equipo/internal/equipotest TestProjectsFailuresRollBack
receipt: slow test 20s amadan.net/oficina/equipo/internal/equipotest TestProjectRequestActorAndUpdate
receipt: slow test 19.89s amadan.net/oficina/equipo/internal/equipotest TestProjectsAccountRevisionAndValidation
machine: 32 CPUs, load 58.14, cpu waiting 34.42%, memory waiting 0.00%, io waiting 0.52%
--- shard 14 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-r started 30s late; cpu waiting 36.4%, load 27.91
test lane equipotest-r: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestR' ./internal/equipotest

receipt: test step 1m14.994s 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 1m9.721s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 16.05s amadan.net/oficina/equipo/internal/equipotest TestReleaseStampContract
receipt: slow test 13.34s amadan.net/oficina/equipo/internal/equipotest TestRosterChangesAffectExistingSession
receipt: slow test 10.39s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalWhileAssigned
receipt: slow test 10.24s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalRollsBack
receipt: slow test 7.26s amadan.net/oficina/equipo/internal/equipotest TestRosterBootstrapOnce
machine: 32 CPUs, load 62.33, cpu waiting 36.62%, memory waiting 0.00%, io waiting 0.56%
--- shard 15 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-rest started 30s late; cpu waiting 36.4%, load 27.91
test lane equipotest-rest: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -skip '^Test[A-D]|^TestQ|^Test[E-P]|^TestR' ./internal/equipotest

receipt: test step 1m8.933s 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 1m6.827s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 25.88s amadan.net/oficina/equipo/internal/equipotest TestSigninNoProof
receipt: slow test 24.88s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedExistingTeam
receipt: slow test 24.85s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedRollback
receipt: slow test 23.08s amadan.net/oficina/equipo/internal/equipotest TestSpecialistSettingsCurrentOwner
receipt: slow test 23.04s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsUpgrade
machine: 32 CPUs, load 64.11, cpu waiting 38.10%, memory waiting 0.00%, io waiting 0.60%
--- shard 16 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: plan3test started 30s late; cpu waiting 36.4%, load 27.91
test lane plan3test: ./internal/plan3test
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m ./internal/plan3test

receipt: test step 55.716s 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 53.424s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 3.82s amadan.net/oficina/equipo/internal/plan3test TestPlan3Upgrade
receipt: slow test 3.59s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3B
receipt: slow test 1.72s amadan.net/oficina/equipo/internal/plan3test TestConversationQuestionRace
receipt: slow test 1.57s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3A
receipt: slow test 1.27s amadan.net/oficina/equipo/internal/plan3test TestInviteMigration
machine: 32 CPUs, load 68.37, cpu waiting 40.16%, memory waiting 0.00%, io waiting 0.76%
--- shard 17 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: rest started 30s late; cpu waiting 36.4%, load 27.91
test lane rest: ./cmd/equipo ./cmd/equipo-runner ./cmd/equipo-tool-proxy ./internal/advice ./internal/attach ./internal/attach/attachtest ./internal/chatmarkdown ./internal/chatsend ./internal/chatstream ./internal/coordinator ./internal/coordinatorcontract ./internal/coordinatormail ./internal/copydesk ./internal/equipo ./internal/equipo/activity ./internal/equipo/assist ./internal/equipo/chat ./internal/equipo/conversation ./internal/equipo/conversation/chatstate ./internal/equipo/housekeeping ./internal/equipo/icons ./internal/equipo/identity ./internal/equipo/kernel ./internal/equipo/library ./internal/equipo/mergegate ./internal/equipo/notifications ./internal/equipo/oficina ./internal/equipo/oficina/oficinatest ./internal/equipo/oficinaid ./internal/equipo/ownermode ./internal/equipo/personapi ./internal/equipo/planning ./internal/equipo/push ./internal/equipo/setup ./internal/equipo/team ./internal/equipo/teamcontract ./internal/equipo/triage ./internal/fakeclaude ./internal/fakecodex ./internal/fakeopencode ./internal/fakepi ./internal/idtest ./internal/ownermodetest ./internal/release ./internal/runner/checks ./internal/runner/connect ./internal/runner/containment ./internal/runner/containment/sysunix ./internal/runner/egress ./internal/runner/forge ./internal/runner/forge/forgetest ./internal/runner/heartbeat ./internal/runner/mac ./internal/runner/mcpresource ./internal/runner/metered ./internal/runner/planflow ./internal/runner/provider ./internal/runner/provider/claude ./internal/runner/provider/codex ./internal/runner/provider/gotoolchain ./internal/runner/provider/opencode ./internal/runner/provider/pi ./internal/runner/setup ./internal/runner/transporttest ./internal/runner/webread ./internal/runner/workspace ./internal/runnerproto ./internal/schedule ./internal/sealbox ./internal/specialist ./internal/stagingtest ./internal/taskplan ./internal/testci ./internal/toolproxy ./internal/websource ./internal/wire ./internal/wire/wireschema ./internal/wire/wiretest ./tools/drive
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m ./cmd/equipo ./cmd/equipo-runner ./cmd/equipo-tool-proxy ./internal/advice ./internal/attach ./internal/attach/attachtest ./internal/chatmarkdown ./internal/chatsend ./internal/chatstream ./internal/coordinator ./internal/coordinatorcontract ./internal/coordinatormail ./internal/copydesk ./internal/equipo ./internal/equipo/activity ./internal/equipo/assist ./internal/equipo/chat ./internal/equipo/conversation ./internal/equipo/conversation/chatstate ./internal/equipo/housekeeping ./internal/equipo/icons ./internal/equipo/identity ./internal/equipo/kernel ./internal/equipo/library ./internal/equipo/mergegate ./internal/equipo/notifications ./internal/equipo/oficina ./internal/equipo/oficina/oficinatest ./internal/equipo/oficinaid ./internal/equipo/ownermode ./internal/equipo/personapi ./internal/equipo/planning ./internal/equipo/push ./internal/equipo/setup ./internal/equipo/team ./internal/equipo/teamcontract ./internal/equipo/triage ./internal/fakeclaude ./internal/fakecodex ./internal/fakeopencode ./internal/fakepi ./internal/idtest ./internal/ownermodetest ./internal/release ./internal/runner/checks ./internal/runner/connect ./internal/runner/containment ./internal/runner/containment/sysunix ./internal/runner/egress ./internal/runner/forge ./internal/runner/forge/forgetest ./internal/runner/heartbeat ./internal/runner/mac ./internal/runner/mcpresource ./internal/runner/metered ./internal/runner/planflow ./internal/runner/provider ./internal/runner/provider/claude ./internal/runner/provider/codex ./internal/runner/provider/gotoolchain ./internal/runner/provider/opencode ./internal/runner/provider/pi ./internal/runner/setup ./internal/runner/transporttest ./internal/runner/webread ./internal/runner/workspace ./internal/runnerproto ./internal/schedule ./internal/sealbox ./internal/specialist ./internal/stagingtest ./internal/taskplan ./internal/testci ./internal/toolproxy ./internal/websource ./internal/wire ./internal/wire/wireschema ./internal/wire/wiretest ./tools/drive
cache miss: amadan.net/oficina/equipo/internal/copydesk: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/equipo/team: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/forge: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/webread: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runnerproto: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/workspace: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/checks: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/containment: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/opencode: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/testci: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/wire/wireschema: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/pi: its inputs changed
budget note: internal/equipo took 28.353s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/equipo/chat took 15.717s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/equipo/setup took 12.903s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/idtest took 44.976s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/release took 19.39s, over the 10s the default allows (measured on the run this cached result came from); reported only, timing fails on CI
budget note: internal/runner/containment took 50.664s, over the 15s its record on line 40 allows; reported only, timing fails on CI
budget note: internal/runner/workspace took 11.423s, over the 10s the default allows; reported only, timing fails on CI

receipt: test step 2m19.072s against a 60s target (the gate's other steps are not in this figure)
receipt: 32 packages ran, 29 cached, 18 without tests, 0 failed
receipt: slow package 1m11.231s amadan.net/oficina/equipo/internal/runner/provider/opencode
receipt: slow package 59.484s amadan.net/oficina/equipo/internal/runner/provider/pi
receipt: slow package 55.125s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow package 50.664s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow package 44.976s amadan.net/oficina/equipo/internal/idtest
receipt: slow test 25.7s amadan.net/oficina/equipo/internal/runner/provider/opencode TestOpenCodeAcceptanceHostileRepository
receipt: slow test 22.15s amadan.net/oficina/equipo/internal/runner/containment TestEngineeringOfflineGo
receipt: slow test 21.19s amadan.net/oficina/equipo/cmd/equipo-runner TestReleaseRunnerHasNoFakeWorker
receipt: slow test 12.6s amadan.net/oficina/equipo/internal/idtest TestIDCallbackGuardAndPendingNonce
receipt: slow test 12.25s amadan.net/oficina/equipo/internal/runner/provider/opencode TestOpenCodeP1OnlyOpenCodeReachable
machine: 32 CPUs, load 24.19, cpu waiting 12.41%, memory waiting 0.00%, io waiting 0.18%
--- 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
--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserChat
=== RUN   TestBrowserChat
time=2026-11-20T15:32:21.252Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-20T15:32:21.252Z level=INFO msg="startup phase done" phase=state_lock took=145µs
time=2026-11-20T15:32:21.252Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-20T15:32:21.252Z level=INFO msg="startup phase done" phase=claim_roots took=129µs
time=2026-11-20T15:32:21.252Z level=INFO msg="startup phase" phase=sweep
time=2026-11-20T15:32:21.297Z level=INFO msg="startup phase done" phase=sweep took=44.709ms
time=2026-11-20T15:32:21.297Z level=INFO msg="startup phase" phase=credentials
time=2026-11-20T15:32:21.297Z level=INFO msg="startup phase done" phase=credentials took=210µs
time=2026-11-20T15:32:21.297Z level=INFO msg="startup phase" phase=open_state
time=2026-11-20T15:32:21.362Z level=INFO msg="startup phase done" phase=open_state took=64.274ms
time=2026-11-20T15:32:21.364Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-20T15:32:21.368Z level=INFO msg=connecting host=127.0.0.1:33375 protocol=28
time=2026-11-20T15:32:21.371Z level=INFO msg=connected host=127.0.0.1:33375 took=1.182ms
time=2026-11-20T15:32:21.371Z level=INFO msg="capabilities gathering"
time=2026-11-20T15:32:21.376Z level=INFO msg="capabilities gathered" took=5.355ms tags=linux,claude,go
time=2026-11-20T15:32:21.377Z level=INFO msg="hello sent" protocol=28
time=2026-11-20T15:32:21.397Z level=INFO msg=welcome protocol=28 role=primary generation=1
time=2026-11-20T15:32:23.753Z level=INFO msg="connection checked" connection=claude-1 state=healthy
    browser_test.go:46: waiting for [...document.querySelectorAll('[equipo-message="incoming"] [equipo-markdown]:not([data-stream-text])')].some(e=>e.textContent.includes('fake coordinator')): context deadline exceeded (last evaluation: context deadline exceeded)
--- FAIL: TestBrowserChat (6.40s)

--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserChatSendStaysOnPage
=== RUN   TestBrowserChatSendStaysOnPage
time=2026-11-20T15:32:27.761Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-20T15:32:27.762Z level=INFO msg="startup phase done" phase=state_lock took=69µs
time=2026-11-20T15:32:27.762Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-20T15:32:27.762Z level=INFO msg="startup phase done" phase=claim_roots took=86µs
time=2026-11-20T15:32:27.762Z level=INFO msg="startup phase" phase=sweep
time=2026-11-20T15:32:27.841Z level=INFO msg="startup phase done" phase=sweep took=79.507ms
time=2026-11-20T15:32:27.841Z level=INFO msg="startup phase" phase=credentials
time=2026-11-20T15:32:27.842Z level=INFO msg="startup phase done" phase=credentials took=265µs
time=2026-11-20T15:32:27.842Z level=INFO msg="startup phase" phase=open_state
time=2026-11-20T15:32:27.890Z level=INFO msg="startup phase done" phase=open_state took=48.68ms
time=2026-11-20T15:32:27.891Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-20T15:32:27.894Z level=INFO msg=connecting host=127.0.0.1:41903 protocol=28
time=2026-11-20T15:32:27.896Z level=INFO msg=connected host=127.0.0.1:41903 took=1.225ms
time=2026-11-20T15:32:27.896Z level=INFO msg="capabilities gathering"
time=2026-11-20T15:32:27.897Z level=INFO msg="capabilities gathered" took=1.099ms tags=linux,claude,go
time=2026-11-20T15:32:27.897Z level=INFO msg="hello sent" protocol=28
time=2026-11-20T15:32:27.906Z level=INFO msg=welcome protocol=28 role=primary generation=1
time=2026-11-20T15:32:30.248Z level=INFO msg="connection checked" connection=claude-1 state=healthy
    browser_test.go:108: waiting for [...document.querySelectorAll('[equipo-message="incoming"] [equipo-markdown]:not([data-stream-text])')].some(e=>e.textContent.includes('fake coordinator')): context deadline exceeded (last evaluation: <nil>)
--- FAIL: TestBrowserChatSendStaysOnPage (6.53s)

--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserDraftIsTheMessage
=== RUN   TestBrowserDraftIsTheMessage
time=2026-11-20T15:32:34.202Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-20T15:32:34.202Z level=INFO msg="startup phase done" phase=state_lock took=92µs
time=2026-11-20T15:32:34.202Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-20T15:32:34.202Z level=INFO msg="startup phase done" phase=claim_roots took=93µs
time=2026-11-20T15:32:34.202Z level=INFO msg="startup phase" phase=sweep
time=2026-11-20T15:32:34.253Z level=INFO msg="startup phase done" phase=sweep took=51.147ms
time=2026-11-20T15:32:34.255Z level=INFO msg="startup phase" phase=credentials
time=2026-11-20T15:32:34.255Z level=INFO msg="startup phase done" phase=credentials took=167µs
time=2026-11-20T15:32:34.255Z level=INFO msg="startup phase" phase=open_state
time=2026-11-20T15:32:34.306Z level=INFO msg="startup phase done" phase=open_state took=51.065ms
time=2026-11-20T15:32:34.307Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-20T15:32:34.309Z level=INFO msg=connecting host=127.0.0.1:33177 protocol=28
time=2026-11-20T15:32:34.311Z level=INFO msg=connected host=127.0.0.1:33177 took=2.212ms
time=2026-11-20T15:32:34.311Z level=INFO msg="capabilities gathering"
time=2026-11-20T15:32:34.313Z level=INFO msg="capabilities gathered" took=1.797ms tags=linux,claude,go
time=2026-11-20T15:32:34.315Z level=INFO msg="hello sent" protocol=28
time=2026-11-20T15:32:34.322Z level=INFO msg=welcome protocol=28 role=primary generation=1
time=2026-11-20T15:32:36.339Z level=INFO msg="connection checked" connection=claude-1 state=healthy
    browser_thinking_test.go:106: waiting for !!window.__m: context deadline exceeded (last evaluation: <nil>)
--- FAIL: TestBrowserDraftIsTheMessage (8.19s)

--- FAIL amadan.net/oficina/equipo/internal/headless (package output)
FAIL
rastrillo-budget/v1 ran 50.159s
FAIL	amadan.net/oficina/equipo/internal/headless	50.468s


receipt: test step 51.696s against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 0 cached, 0 without tests, 1 failed
receipt: slow package 50.159s amadan.net/oficina/equipo/internal/headless
receipt: slow test 15.63s amadan.net/oficina/equipo/internal/headless TestBrowserDraftStreamsFormatted
receipt: slow test 8.19s amadan.net/oficina/equipo/internal/headless TestBrowserDraftIsTheMessage
receipt: slow test 8.03s amadan.net/oficina/equipo/internal/headless TestBrowserComposer
receipt: slow test 6.53s amadan.net/oficina/equipo/internal/headless TestBrowserChatSendStaysOnPage
receipt: slow test 6.4s amadan.net/oficina/equipo/internal/headless TestBrowserChat
rastrillo: budget test: go test failed
exit status 1
+ go test -tags browser,testbuild -timeout 15m -run '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$' -v -run '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserDraftIsTheMessage$' -count=1 ./internal/headless   (retry, once)
##############################################################################
FLAKE ./internal/headless:TestBrowserChat browser-headless-chat 257303da2df42dc8829592c31db505b5bf700c0c 6.40s 64.71
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
##############################################################################
FLAKE ./internal/headless:TestBrowserChatSendStaysOnPage browser-headless-chat 257303da2df42dc8829592c31db505b5bf700c0c 6.53s 64.71
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
##############################################################################
FLAKE ./internal/headless:TestBrowserDraftIsTheMessage browser-headless-chat 257303da2df42dc8829592c31db505b5bf700c0c 8.19s 64.71
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 58.14, cpu waiting 33.36%, memory waiting 0.00%, io waiting 0.51%
--- shard 19 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-work: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$' ./internal/headless
rastrillo: budget test: go test failed
--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserRailFollowsWork
=== RUN   TestBrowserRailFollowsWork
time=2026-11-20T15:32:17.090Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-20T15:32:17.090Z level=INFO msg="startup phase done" phase=state_lock took=92µs
time=2026-11-20T15:32:17.090Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-20T15:32:17.090Z level=INFO msg="startup phase done" phase=claim_roots took=233µs
time=2026-11-20T15:32:17.090Z level=INFO msg="startup phase" phase=sweep
time=2026-11-20T15:32:17.120Z level=INFO msg="startup phase done" phase=sweep took=29.32ms
time=2026-11-20T15:32:17.120Z level=INFO msg="startup phase" phase=credentials
time=2026-11-20T15:32:17.120Z level=INFO msg="startup phase done" phase=credentials took=132µs
time=2026-11-20T15:32:17.120Z level=INFO msg="startup phase" phase=open_state
time=2026-11-20T15:32:17.162Z level=INFO msg="startup phase done" phase=open_state took=42.472ms
time=2026-11-20T15:32:17.163Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-20T15:32:17.164Z level=INFO msg=connecting host=127.0.0.1:37621 protocol=28
time=2026-11-20T15:32:17.165Z level=INFO msg=connected host=127.0.0.1:37621 took=1.226ms
time=2026-11-20T15:32:17.165Z level=INFO msg="capabilities gathering"
time=2026-11-20T15:32:17.166Z level=INFO msg="capabilities gathered" took=421µs tags=linux,claude,go
time=2026-11-20T15:32:17.166Z level=INFO msg="hello sent" protocol=28
time=2026-11-20T15:32:17.172Z level=INFO msg=welcome protocol=28 role=primary generation=1
time=2026-11-20T15:32:18.669Z level=INFO msg="connection checked" connection=claude-1 state=healthy
time=2026-11-20T15:32:28.221Z level=INFO msg="kept sessions" kept=1 bytes=2770 expired=0
time=2026-11-20T15:32:33.118Z level=INFO msg="kept sessions" kept=2 bytes=4922 expired=0
time=2026-11-20T15:32:33.872Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-20T15:32:33.872Z level=INFO msg="startup phase done" phase=state_lock took=66µs
time=2026-11-20T15:32:33.872Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-20T15:32:33.872Z level=INFO msg="startup phase done" phase=claim_roots took=94µs
time=2026-11-20T15:32:33.872Z level=INFO msg="startup phase" phase=sweep
time=2026-11-20T15:32:33.901Z level=INFO msg="startup phase done" phase=sweep took=29.227ms
time=2026-11-20T15:32:33.901Z level=INFO msg="startup phase" phase=credentials
time=2026-11-20T15:32:33.902Z level=INFO msg="startup phase done" phase=credentials took=143µs
time=2026-11-20T15:32:33.902Z level=INFO msg="startup phase" phase=open_state
time=2026-11-20T15:32:33.946Z level=INFO msg="startup phase done" phase=open_state took=44.324ms
time=2026-11-20T15:32:33.947Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-20T15:32:33.948Z level=INFO msg=connecting host=127.0.0.1:42861 protocol=28
time=2026-11-20T15:32:33.951Z level=INFO msg=connected host=127.0.0.1:42861 took=2.3ms
time=2026-11-20T15:32:33.951Z level=INFO msg="capabilities gathering"
time=2026-11-20T15:32:33.951Z level=INFO msg="capabilities gathered" took=599µs tags=linux,claude,go
time=2026-11-20T15:32:33.954Z level=INFO msg="hello sent" protocol=28
time=2026-11-20T15:32:33.956Z level=INFO msg=welcome protocol=28 role=primary generation=1
time=2026-11-20T15:32:36.106Z level=INFO msg="connection checked" connection=claude-1 state=healthy
    browser_review_test.go:57: waiting for document.querySelector('#rail [data-specialist="engineering"]')?.dataset.state==='working' && document.querySelector('#rail [data-specialist="engineering"]').querySelector('[equipo-nav-task]')?.textContent==='Slow sidebar change' && document.querySelector('#nav-tasks [data-count]')?.textContent==='1': context deadline exceeded (last evaluation: context deadline exceeded)
--- FAIL: TestBrowserRailFollowsWork (23.15s)

--- FAIL amadan.net/oficina/equipo/internal/headless (package output)
FAIL
rastrillo-budget/v1 ran 1m39.44s
FAIL	amadan.net/oficina/equipo/internal/headless	99.729s


receipt: test step 1m40.812s against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 0 cached, 0 without tests, 1 failed
receipt: slow package 1m39.44s amadan.net/oficina/equipo/internal/headless
receipt: slow test 27.27s amadan.net/oficina/equipo/internal/headless TestBrowserTaskThread
receipt: slow test 23.15s amadan.net/oficina/equipo/internal/headless TestBrowserRailFollowsWork
receipt: slow test 15.06s amadan.net/oficina/equipo/internal/headless TestBrowserReceiptFollowsReview
receipt: slow test 12.45s amadan.net/oficina/equipo/internal/headless TestBrowserTaskCard
receipt: slow test 11.25s amadan.net/oficina/equipo/internal/headless TestBrowserAskAfterMerge
exit status 1
+ go test -tags browser,testbuild -timeout 15m -run '^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$' -v -run '^TestBrowserRailFollowsWork$' -count=1 ./internal/headless   (retry, once)
##############################################################################
FLAKE ./internal/headless:TestBrowserRailFollowsWork browser-headless-work 257303da2df42dc8829592c31db505b5bf700c0c 23.15s 64.11
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 46.43, cpu waiting 25.64%, memory waiting 0.00%, io waiting 0.38%
--- shard 20 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-connections: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^TestBrowserConnections|^TestBrowserPasteBox$|^TestBrowserPasteCopiesItsBox$' ./internal/headless

receipt: test step 1m50.161s 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 1m48.455s amadan.net/oficina/equipo/internal/headless
receipt: slow test 18.04s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsConversation
receipt: slow test 14.81s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAdd
receipt: slow test 13.16s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAddPage
receipt: slow test 11.1s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsMeteredLimitRequired
receipt: slow test 10.66s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsOpenCodeGoLimitRequired
machine: 32 CPUs, load 58.14, cpu waiting 33.36%, memory waiting 0.00%, io waiting 0.51%
--- shard 21 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-rest: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAskAfterMerge|TestBrowserChat|TestBrowserChatSendStaysOnPage|TestBrowserComposer|TestBrowserComposerDock|TestBrowserComposerFocus|TestBrowserComposerReconcile|TestBrowserConnectionsAdd|TestBrowserConnectionsAddPage|TestBrowserConnectionsConversation|TestBrowserConnectionsCopyLink|TestBrowserConnectionsEndedNote|TestBrowserConnectionsMeteredLimitRequired|TestBrowserConnectionsOpenCodeGoLimitRequired|TestBrowserConnectionsSignIn|TestBrowserConnectionsSignInSwitch|TestBrowserConnectionsToken|TestBrowserCopyContinue|TestBrowserCopySettingAndFlag|TestBrowserDraftIsTheMessage|TestBrowserDraftStreamsFormatted|TestBrowserEmptyExplore|TestBrowserMoveIn|TestBrowserNotebook|TestBrowserNotebookLook|TestBrowserPasteBox|TestBrowserPasteBoxLook|TestBrowserPasteCopiesItsBox|TestBrowserRailFollowsWork|TestBrowserReceiptFollowsReview|TestBrowserReceiptsDesktop|TestBrowserReceiptsTouch|TestBrowserRefreshRace|TestBrowserStalePageReloads|TestBrowserTaskCard|TestBrowserTaskThread|TestBrowserThinkingAndCards|TestBrowserUsageAndAdvice|TestBrowserWaitingTurns|TestNotebookScreenshots)$' -skip '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$|^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$|^TestBrowserConnections|^TestBrowserPasteBox$|^TestBrowserPasteCopiesItsBox$' ./internal/headless
rastrillo: budget test: go test failed
--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserCopyContinue
=== RUN   TestBrowserCopyContinue
time=2026-11-20T15:32:31.249Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-20T15:32:31.249Z level=INFO msg="startup phase done" phase=state_lock took=259µs
time=2026-11-20T15:32:31.249Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-20T15:32:31.249Z level=INFO msg="startup phase done" phase=claim_roots took=106µs
time=2026-11-20T15:32:31.250Z level=INFO msg="startup phase" phase=sweep
time=2026-11-20T15:32:31.336Z level=INFO msg="startup phase done" phase=sweep took=86.786ms
time=2026-11-20T15:32:31.336Z level=INFO msg="startup phase" phase=credentials
time=2026-11-20T15:32:31.337Z level=INFO msg="startup phase done" phase=credentials took=204µs
time=2026-11-20T15:32:31.337Z level=INFO msg="startup phase" phase=open_state
time=2026-11-20T15:32:31.408Z level=INFO msg="startup phase done" phase=open_state took=70.885ms
time=2026-11-20T15:32:31.408Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-20T15:32:31.409Z level=INFO msg=connecting host=127.0.0.1:37549 protocol=28
time=2026-11-20T15:32:31.411Z level=INFO msg=connected host=127.0.0.1:37549 took=1ms
time=2026-11-20T15:32:31.412Z level=INFO msg="capabilities gathering"
time=2026-11-20T15:32:31.417Z level=INFO msg="capabilities gathered" took=4.964ms tags=linux,claude,go
time=2026-11-20T15:32:31.420Z level=INFO msg="hello sent" protocol=28
time=2026-11-20T15:32:31.422Z level=INFO msg=welcome protocol=28 role=primary generation=1
    browser_copy_test.go:90: waiting for !document.querySelector('[data-copy-continue]'): context deadline exceeded (last evaluation: context deadline exceeded)
--- FAIL: TestBrowserCopyContinue (6.64s)

--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserEmptyExplore
=== RUN   TestBrowserEmptyExplore
time=2026-11-20T15:33:12.467Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-20T15:33:12.467Z level=INFO msg="startup phase done" phase=state_lock took=70µs
time=2026-11-20T15:33:12.467Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-20T15:33:12.467Z level=INFO msg="startup phase done" phase=claim_roots took=90µs
time=2026-11-20T15:33:12.467Z level=INFO msg="startup phase" phase=sweep
time=2026-11-20T15:33:12.501Z level=INFO msg="startup phase done" phase=sweep took=33.859ms
time=2026-11-20T15:33:12.501Z level=INFO msg="startup phase" phase=credentials
time=2026-11-20T15:33:12.501Z level=INFO msg="startup phase done" phase=credentials took=112µs
time=2026-11-20T15:33:12.501Z level=INFO msg="startup phase" phase=open_state
time=2026-11-20T15:33:12.546Z level=INFO msg="startup phase done" phase=open_state took=44.453ms
time=2026-11-20T15:33:12.546Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-20T15:33:12.547Z level=INFO msg=connecting host=127.0.0.1:46229 protocol=28
time=2026-11-20T15:33:12.548Z level=INFO msg=connected host=127.0.0.1:46229 took=1.065ms
time=2026-11-20T15:33:12.548Z level=INFO msg="capabilities gathering"
time=2026-11-20T15:33:12.549Z level=INFO msg="capabilities gathered" took=452µs tags=linux,claude,go
time=2026-11-20T15:33:12.552Z level=INFO msg="hello sent" protocol=28
time=2026-11-20T15:33:12.555Z level=INFO msg=welcome protocol=28 role=primary generation=1
time=2026-11-20T15:33:13.717Z level=INFO msg="connection checked" connection=claude-1 state=healthy
    browser_receipts_test.go:169: waiting for [...document.querySelectorAll('[equipo-markdown]:not([data-stream-text])')].some(e=>e.textContent.includes("I'm your coordinator")): context deadline exceeded (last evaluation: context deadline exceeded)
--- FAIL: TestBrowserEmptyExplore (5.92s)

--- FAIL amadan.net/oficina/equipo/internal/headless (package output)
FAIL
rastrillo-budget/v1 ran 1m41.418s
FAIL	amadan.net/oficina/equipo/internal/headless	101.734s


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

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

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

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

receipt: test step 3m27.527s 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 3m25.942s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 17.9s amadan.net/oficina/equipo/internal/thintest TestBrowserAccessRequest
receipt: slow test 14.35s amadan.net/oficina/equipo/internal/thintest TestBrowserSettingsTeams
receipt: slow test 12.07s amadan.net/oficina/equipo/internal/thintest TestBrowserThinkingCycles
receipt: slow test 10.74s amadan.net/oficina/equipo/internal/thintest TestBrowserPlacementQuestionAndPending
receipt: slow test 8.26s amadan.net/oficina/equipo/internal/thintest TestBrowserInnerScreens
machine: 32 CPUs, load 12.00, cpu waiting 5.77%, memory waiting 0.00%, io waiting 0.08%
--- shard 23 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
shard 23: make test-quarantine
python3 scripts/ci-test.py quarantine
quarantine: 12 tests from scripts/ci-quarantine.txt; a failure is retried once, and a pass on the retry is reported as a flake
+ go test -tags testbuild -timeout 15m -v -run '^TestHeadlessConnections$/^A5_cancel_and_sign_out$|^TestHeadlessConnections$/^C4_claude_sign_in$|^TestHeadlessConnections$/^C5_engineering_failover$|^TestHeadlessConnections$/^C5_engineering_to_codex$|^TestHeadlessConnections$/^C5_engineering_waits$' ./internal/headless   (58s)
ok ./internal/headless TestHeadlessConnections/A5_cancel_and_sign_out 5.31s
ok ./internal/headless TestHeadlessConnections/C4_claude_sign_in 1.30s
ok ./internal/headless TestHeadlessConnections/C5_engineering_failover 11.08s
ok ./internal/headless TestHeadlessConnections/C5_engineering_to_codex 11.33s
ok ./internal/headless TestHeadlessConnections/C5_engineering_waits 27.19s
+ go test -tags testbuild -timeout 15m -v -run '^TestHeadlessConnections$/^C5_review_auth$|^TestHeadlessConnections$/^C5_review_failover$|^TestHeadlessConnections$/^C5_review_on_codex$|^TestHeadlessConnections$/^C5_review_other_family_first$' ./internal/headless   (74s)
ok ./internal/headless TestHeadlessConnections/C5_review_auth 19.17s
ok ./internal/headless TestHeadlessConnections/C5_review_failover 22.99s
ok ./internal/headless TestHeadlessConnections/C5_review_on_codex 12.61s
ok ./internal/headless TestHeadlessConnections/C5_review_other_family_first 16.67s
+ go test -tags testbuild -timeout 15m -v -run '^TestMixedVersions$' ./internal/headless   (25s)
ok ./internal/headless TestMixedVersions 22.69s
+ go test -tags testbuild -timeout 15m -v -run '^TestCheckSandboxDeniedPathsTampering$' ./internal/runner/checks   (2s)
ok ./internal/runner/checks TestCheckSandboxDeniedPathsTampering 0.78s
+ go test -tags testbuild -timeout 15m -v -run '^TestRunnerCancelAndSupersede$' ./internal/runner/thin   (2s)
ok ./internal/runner/thin TestRunnerCancelAndSupersede 0.06s
quarantine: 0 flaked (passed on the retry), 0 failed
machine: 32 CPUs, load 65.81, cpu waiting 39.85%, memory waiting 0.00%, io waiting 0.93%
--- 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 13.2s against a 60s target (the gate's other steps are not in this figure)
receipt: 4 packages ran, 0 cached, 3 without tests, 0 failed
receipt: slow package 8.061s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow package 220ms amadan.net/oficina/equipo/internal/runner/provider/claude
receipt: slow package 116ms amadan.net/oficina/equipo/internal/runner/provider/codex
receipt: slow package 1ms amadan.net/oficina/equipo/internal/runner/provider
receipt: slow package 0s amadan.net/oficina/equipo/internal/runner/provider/gotoolchain
receipt: slow test 5.72s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsGoFixture
receipt: slow test 1.8s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPaths
receipt: slow test 430ms amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsCache
receipt: slow test 220ms amadan.net/oficina/equipo/internal/runner/provider/claude TestDirectJournalAdapterBarrier
receipt: slow test 110ms amadan.net/oficina/equipo/internal/runner/provider/codex TestDirectJournalAdapterBarrier
CGO_ENABLED=0 RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py retried runner-host -run '^TestNamespace' -count=1 ./internal/runner/containment
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -no-time -run '^TestNamespace' -count=1 ./internal/runner/containment

receipt: test step 3.572s 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.151s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow test 310ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceReadOnlyScratch
receipt: slow test 190ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryUnavailableProof
receipt: slow test 130ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceDirectPolicyAdmission
receipt: slow test 130ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryReusedPID
receipt: slow test 110ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceDirectPolicy
machine: 32 CPUs, load 14.98, cpu waiting 10.72%, memory waiting 0.00%, io waiting 2.38%
--- shard 25 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: runner-dead-references started 30s late; cpu waiting 36.4%, load 27.91
shard 25: make runner-dead-references lanes-check build vet fmt-check budget migration-check
python3 scripts/runner-dead-references.py
reference scan: 2516 text files, 2846 matches, 0 failures
python3 scripts/ci-test.py check
lanes: 18 lanes and 5 browser lanes run every test once; 20-check@29
CGO_ENABLED=0 go build ./...
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o /dev/null ./cmd/equipo-runner
go vet ./...
go vet -tags testbuild ./internal/runner/thin ./internal/headless
GOOS=darwin GOARCH=arm64 go vet ./cmd/equipo-runner/... ./internal/runner/... ./internal/wire/... ./internal/release/...
go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget size
budget size: 88 directories within budget
CGO_ENABLED=0 go test ./internal/equipo -run '^TestMigrationModels$' -count=1
ok  	amadan.net/oficina/equipo/internal/equipo	2.538s
machine: 32 CPUs, load 65.81, cpu waiting 39.37%, memory waiting 0.00%, io waiting 0.96%
--- shard 26 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: staticcheck started 30s late; cpu waiting 36.4%, load 27.91
shard 26: make staticcheck
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -tags browser,perf,testbuild ./...
machine: 32 CPUs, load 58.33, cpu waiting 33.28%, memory waiting 0.00%, io waiting 1.35%
--- shard 27 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: govulncheck started 30s late; cpu waiting 36.4%, load 27.91
shard 27: make govulncheck
go run golang.org/x/vuln/cmd/govulncheck@v1.8.0 ./...
=== Symbol Results ===

No vulnerabilities found.

Your code is affected by 0 vulnerabilities.
This scan also found 0 vulnerabilities in packages you import and 5
vulnerabilities in modules you require, but your code doesn't appear to call
these vulnerabilities.
Use '-show verbose' for more details.
machine: 32 CPUs, load 45.21, cpu waiting 22.85%, memory waiting 0.00%, io waiting 1.70%
--- shard 28 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: gitleaks started 30s late; cpu waiting 36.7%, load 27.91
shard 28: make gitleaks
3:32PM INF Unknown SCM platform. Use --platform to include links in findings. host=amadan.net
3:32PM INF 1064 commits scanned.
3:32PM INF scanned ~60605048 bytes (60.61 MB) in 21.9s
3:32PM INF no leaks found
machine: 32 CPUs, load 58.33, cpu waiting 33.28%, memory waiting 0.00%, io waiting 1.35%
=== perf ===
go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -no-time -require TestPerfScreens,TestPerfBoot -tags perf -count=1 -p 1 -parallel 1 -run '^TestPerf' ./...
perf: GET /: median 1.25ms, worst 1.291ms, budget 150ms
perf: GET /api/runner/protocol: median 86µs, worst 110µs, budget 150ms
perf: GET /api/v1/account-setups/{id}: median 640µs, worst 695µs, budget 150ms
perf: GET /api/v1/accounts: median 463µs, worst 492µs, budget 150ms
perf: GET /api/v1/auth/devices: median 479µs, worst 564µs, budget 150ms
perf: GET /api/v1/budgets: median 529µs, worst 550µs, budget 150ms
perf: GET /api/v1/capabilities: median 257µs, worst 294µs, budget 150ms
perf: GET /api/v1/cards/{id}: median 1.319ms, worst 1.458ms, budget 150ms
perf: GET /api/v1/connections: median 646µs, worst 689µs, budget 150ms
perf: GET /api/v1/connections/{id}: median 601µs, worst 693µs, budget 150ms
perf: GET /api/v1/conversation: median 1.023ms, worst 1.179ms, budget 150ms
perf: GET /api/v1/conversation/cards: median 1.583ms, worst 1.612ms, budget 150ms
perf: GET /api/v1/coordinator: median 2.142ms, worst 2.198ms, budget 150ms
perf: GET /api/v1/invites/{id}: median 491µs, worst 533µs, budget 150ms
perf: GET /api/v1/journey: median 8.3ms, worst 10.215ms, budget 150ms
perf: GET /api/v1/me: median 502µs, worst 563µs, budget 150ms
perf: GET /api/v1/me/settings: median 556µs, worst 565µs, budget 150ms
perf: GET /api/v1/needs-you: median 7.622ms, worst 7.98ms, budget 150ms
perf: GET /api/v1/notifications: median 1.796ms, worst 1.904ms, budget 150ms
perf: GET /api/v1/onboarding: median 411µs, worst 468µs, budget 150ms
perf: GET /api/v1/people: median 452µs, worst 468µs, budget 150ms
perf: GET /api/v1/playbooks: median 606µs, worst 641µs, budget 150ms
perf: GET /api/v1/playbooks/{id}: median 542µs, worst 560µs, budget 150ms
perf: GET /api/v1/playbooks/{id}/template-diff: median 854µs, worst 931µs, budget 150ms
perf: GET /api/v1/preferences: median 779µs, worst 878µs, budget 150ms
perf: GET /api/v1/projects/{id}: median 461µs, worst 535µs, budget 150ms
perf: GET /api/v1/projects/{id}/settings: median 609µs, worst 690µs, budget 150ms
perf: GET /api/v1/roster: median 496µs, worst 636µs, budget 150ms
perf: GET /api/v1/runners/{id}: median 464µs, worst 582µs, budget 150ms
perf: GET /api/v1/specialists: median 8.522ms, worst 8.918ms, budget 150ms
perf: GET /api/v1/specialists/{id}: median 8.294ms, worst 8.555ms, budget 150ms
perf: GET /api/v1/specialists/{id}/template-diff: median 861µs, worst 951µs, budget 150ms
perf: GET /api/v1/tasks/{id}/plan: median 1.209ms, worst 1.271ms, budget 150ms
perf: GET /api/v1/tasks/{id}/thread: median 776µs, worst 815µs, budget 150ms
perf: GET /api/v1/teams: median 437µs, worst 490µs, budget 150ms
perf: GET /api/v1/templates: median 645µs, worst 728µs, budget 150ms
perf: GET /api/v1/templates/{id}: median 486µs, worst 504µs, budget 150ms
perf: GET /auth/callback: median 82µs, worst 123µs, budget 150ms
perf: GET /auth/devices/{id}: median 3.555ms, worst 3.772ms, budget 150ms
perf: GET /auth/verify: median 78µs, worst 101µs, budget 150ms
perf: GET /connections: median 3.799ms, worst 4.057ms, budget 150ms
perf: GET /conversation: median 8.012ms, worst 8.088ms, budget 150ms
perf: GET /conversation/connections: median 253µs, worst 285µs, budget 150ms
perf: GET /conversation/notebook: median 258µs, worst 275µs, budget 150ms
perf: GET /conversation/settings: median 4.601ms, worst 6.674ms, budget 150ms
perf: GET /conversation/settings/autonomy: median 3.898ms, worst 4.039ms, budget 150ms
perf: GET /conversation/settings/connections: median 6.716ms, worst 7.006ms, budget 150ms
perf: GET /conversation/settings/connections/add: median 6.825ms, worst 7.019ms, budget 150ms
perf: GET /conversation/settings/copy: median 3.902ms, worst 4.007ms, budget 150ms
perf: GET /conversation/settings/housekeeping: median 4.388ms, worst 4.564ms, budget 150ms
perf: GET /conversation/settings/machines: median 4.737ms, worst 4.883ms, budget 150ms
perf: GET /conversation/settings/machines/add: median 4.785ms, worst 4.921ms, budget 150ms
perf: GET /conversation/settings/notebook: median 3.88ms, worst 4.046ms, budget 150ms
perf: GET /conversation/settings/thinking: median 4.464ms, worst 6.937ms, budget 150ms
perf: GET /housekeeping: median 4.187ms, worst 4.41ms, budget 150ms
perf: GET /invites/new: median 630µs, worst 666µs, budget 150ms
perf: GET /invites/{id}: median 660µs, worst 713µs, budget 150ms
perf: GET /jobs: median 3.62ms, worst 3.813ms, budget 150ms
perf: GET /jobs/{id}: median 4.881ms, worst 4.979ms, budget 150ms
perf: GET /journey: median 13.193ms, worst 13.463ms, budget 150ms
perf: GET /nav/rail: median 3.442ms, worst 3.572ms, budget 150ms
perf: GET /needs-you: median 13.071ms, worst 13.368ms, budget 150ms
perf: GET /onboarding: median 4.699ms, worst 4.887ms, budget 150ms
perf: GET /people: median 4.052ms, worst 4.156ms, budget 150ms
perf: GET /playbook-suggestions/{suggestion}: median 5.636ms, worst 5.758ms, budget 150ms
perf: GET /playbooks: median 5.042ms, worst 5.252ms, budget 150ms
perf: GET /playbooks/new: median 5.121ms, worst 5.25ms, budget 150ms
perf: GET /playbooks/{id}: median 4.862ms, worst 5.004ms, budget 150ms
perf: GET /playbooks/{id}/edit: median 4.683ms, worst 5.007ms, budget 150ms
perf: GET /playbooks/{id}/template-diff: median 4.102ms, worst 4.129ms, budget 150ms
perf: GET /preferences: median 4.496ms, worst 4.828ms, budget 150ms
perf: GET /preferences/sources/{source}: median 4.388ms, worst 4.591ms, budget 150ms
perf: GET /projects: median 5.411ms, worst 5.711ms, budget 150ms
perf: GET /projects/accounts: median 3.917ms, worst 4.036ms, budget 150ms
perf: GET /projects/new: median 4.14ms, worst 6.378ms, budget 150ms
perf: GET /projects/{id}: median 11.086ms, worst 11.357ms, budget 150ms
perf: GET /projects/{id}/edit: median 3.968ms, worst 4.103ms, budget 150ms
perf: GET /runners/enrol: median 4.871ms, worst 4.976ms, budget 150ms
perf: GET /settings: median 3.741ms, worst 3.802ms, budget 150ms
perf: GET /settings/coordinator: median 5.988ms, worst 6.125ms, budget 150ms
perf: GET /settings/devices: median 3.559ms, worst 3.688ms, budget 150ms
perf: GET /settings/recovery: median 3.761ms, worst 3.864ms, budget 150ms
perf: GET /settings/recovery/release: median 3.699ms, worst 3.809ms, budget 150ms
perf: GET /settings/thinking: median 254µs, worst 264µs, budget 150ms
perf: GET /signin: median 314µs, worst 358µs, budget 150ms
perf: GET /specialists/new: median 3.641ms, worst 3.76ms, budget 150ms
perf: GET /specialists/{key}: median 12.012ms, worst 12.754ms, budget 150ms
perf: GET /specialists/{key}/edit: median 3.766ms, worst 3.87ms, budget 150ms
perf: GET /specialists/{key}/template-diff: median 3.968ms, worst 4.148ms, budget 150ms
perf: GET /tasks: median 5.625ms, worst 5.744ms, budget 150ms
perf: GET /tasks/new: median 3.668ms, worst 3.834ms, budget 150ms
perf: GET /tasks/{id}: median 5.981ms, worst 6.222ms, budget 150ms
perf: GET /tasks/{id}/merge: median 5.299ms, worst 5.388ms, budget 150ms
perf: GET /tasks/{id}/move: median 5.094ms, worst 5.311ms, budget 150ms
perf: GET /tasks/{id}/plan: median 6.458ms, worst 6.608ms, budget 150ms
perf: GET /tasks/{id}/preview: median 1.817ms, worst 3.28ms, budget 150ms
perf: GET /tasks/{id}/questions/{question}: median 5.859ms, worst 6.051ms, budget 150ms
perf: GET /tasks/{id}/rendered-change: median 5.338ms, worst 5.511ms, budget 150ms
perf: GET /tasks/{id}/rendered-change/{hash}.png: median 4.754ms, worst 4.952ms, budget 150ms
perf: GET /tasks/{id}/thread: median 8.846ms, worst 9.046ms, budget 150ms
perf: GET /team/{specialist}: median 4.678ms, worst 4.845ms, budget 150ms
perf: GET /teams: median 10.771ms, worst 10.875ms, budget 150ms
perf: GET /templates: median 3.757ms, worst 3.891ms, budget 150ms
perf: GET /usage: median 4.542ms, worst 4.639ms, budget 150ms
perf: GET /work: median 3.408ms, worst 5.474ms, budget 150ms
perf: cold boot: median 263ms of [262.746605ms 263.443931ms 263.47813ms], budget 500ms

receipt: test step 47.793s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 84 without tests, 0 failed
receipt: slow package 9.246s amadan.net/oficina/equipo/internal/equipotest
receipt: slow package 0s amadan.net/oficina/equipo/cmd/equipo-runner
receipt: slow package 0s amadan.net/oficina/equipo/cmd/equipo-tool-proxy
receipt: slow package 0s amadan.net/oficina/equipo/internal/advice
receipt: slow package 0s amadan.net/oficina/equipo/internal/attach
receipt: slow test 8.4s amadan.net/oficina/equipo/internal/equipotest TestPerfScreens
receipt: slow test 850ms amadan.net/oficina/equipo/internal/equipotest TestPerfBoot
=== cache ===
ci-box: build cache /home/ci/work/repos/oficina__equipo/cache/go-build: 3.65 GiB in 23479 files
ci-box: module cache /home/ci/work/repos/oficina__equipo/cache/go-mod: 0.84 GiB in 27348 files
diff --git a/.gitleaks.toml b/.gitleaks.toml
index 8a5708c4..73742c5a 100644
--- a/.gitleaks.toml
+++ b/.gitleaks.toml
@@ -22,3 +22,8 @@ regexes = ['''^tx-equipo-test-key-0123456789$''']
description = "The fake OpenCode Go on 127.0.0.1 accepts only this fixed test key, delivered to a real OpenCode in the OpenCode tests (connectors spec S5); it is not a credential."
regexTarget = "secret"
regexes = ['''^sk-go-equipo-test-key-0123456789$''']
+
+[[allowlists]]
+description = "Native push tests compare the fake device bearers the native fixtures have always used (equipo.person.v1.TOKENFIXTURE, equipo.person.v1.OTHER); they are not credentials."
+regexTarget = "line"
+regexes = ['''\["equipo\.person\.v1\.TOKENFIXTURE", "equipo\.person\.v1\.OTHER"\]''']
diff --git a/.rastrillo/budgets.txt b/.rastrillo/budgets.txt
index 34f6ab2f..edf8fede 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 21508 - Native identity session callback and device registration wiring; measured 21508/3385 source/test lines.
-size internal/wire 6768 - Native slice 2 push registrations and set aside, with main integrated; measured 6768/2972 source/test lines.
+size internal/equipo 21508 - Native identity session callback and device registration wiring, merged with native push configuration; measured 21508/3385 source/test lines.
+size internal/wire 6771 - Native slice 2 push registrations and set aside, and the instance origin in Live Activity attributes; measured 6771/2972 source/test lines.
size internal/equipotest - 12013 Task 21 repairs historical migration and conversation fixtures after Plan 3; measured 0/12013 source/test lines.
time internal/runner/checks 90s CI worker measured 44.553s (44.6s rounded);
time internal/runner 330s Plan 3 CI repair measured 292.120s for the full package (controller CI 472.184s).
@@ -56,7 +56,7 @@ perf GET /api/v1/tasks/{id} skip Thin v1 person API: bearer-only JSON for device
perf GET /api/v1/assistant/snapshot skip Assistant person API: bearer-only JSON for Base's chat, not a browser screen.
perf GET /api/v1/assistant/messages skip Assistant person API: bearer-only JSON for Base's chat, not a browser screen.
perf GET /api/v1/assistant/events skip Assistant event stream (Server-Sent Events), bearer-only and long-lived; not a screen.
-size internal/equipo/chat 32021 - Merge main carried messages with native push and activity review fixes; measured 32021/6905 source/test lines.
+size internal/equipo/chat 32022 - Merge main carried messages with native push and activity review fixes, and start pushes naming the instance origin; measured 32022/6905 source/test lines.
perf GET /api/v1/questions/{id} skip Thin v1 person API: bearer-only JSON for devices; the browser reads questions on /tasks/{id}.
perf GET /api/v1/steps/{id}/log skip Thin v1 person API: bearer-only JSON for devices; the browser shows the log tail on /tasks/{id}.
perf GET /api/v1/connections/preference skip Connections slice 1 person API: bearer-only JSON for devices; the browser shows the preference on /conversation/connections.
diff --git a/docs/api/equipo-v1.md b/docs/api/equipo-v1.md
index 8ffe18c3..cc7dffd7 100644
--- a/docs/api/equipo-v1.md
+++ b/docs/api/equipo-v1.md
@@ -138,7 +138,7 @@ The server decides on pushes in the same transaction as the change, so a change
- a passive alert when a task you started ends, or when one of its steps stops and waits for Retry, with `{"kind":"task","task_id":"<task ID>"}`;
- the badge showing your Needs you count when the device registers and whenever that count changes.
-Alerts that wait on you have the category `needs_you`. Each task you started gets a Live Activity, at most three at once for you: those of the three most recently started tasks. It starts by push-to-start when work starts, with `attributes-type` `EquipoTaskAttributes` and attributes `{"task_id":"<task ID>"}`. Its content state has `task_id`, `title`, `stage`, `specialist`, `activity`, `needs_you`, `tone` (`positive`, `warning` or `negative`) and, at the end, `outcome` (`done`, `cancelled`, or `replaced` when a newer task took its place). It updates when the stage, step or `needs_you` changes, and at most once a minute for a new activity line. When the task starts needing you, the update is urgent but has no alert: the decision card's alert is the only sound. Send each running activity's own token with `POST /api/v1/push-registrations/activities`, `{"task_id":"tk...","token":"<hex>"}`, which returns `204`. When the token is received, the activity gets the task's full current state. After the task ends, the token is accepted only while the activity's end notification is waiting to be sent. The server then sends the end notification immediately. After that, it returns `409 task_ended`. The server forgets the token when the activity ends.
+Alerts that wait on you have the category `needs_you`. Each task you started gets a Live Activity, at most three at once for you: those of the three most recently started tasks. It starts by push-to-start when work starts, with `attributes-type` `EquipoTaskAttributes` and attributes `{"task_id":"<task ID>","origin":"<this instance's origin>"}`. A device sends an activity's token only to the account at that origin, and ignores an activity with no origin. Its content state has `task_id`, `title`, `stage`, `specialist`, `activity`, `needs_you`, `tone` (`positive`, `warning` or `negative`) and, at the end, `outcome` (`done`, `cancelled`, or `replaced` when a newer task took its place). It updates when the stage, step or `needs_you` changes, and at most once a minute for a new activity line. When the task starts needing you, the update is urgent but has no alert: the decision card's alert is the only sound. Send each running activity's own token with `POST /api/v1/push-registrations/activities`, `{"task_id":"tk...","token":"<hex>"}`, which returns `204`. When the token is received, the activity gets the task's full current state. After the task ends, the token is accepted only while the activity's end notification is waiting to be sent. The server then sends the end notification immediately. After that, it returns `409 task_ended`. The server forgets the token when the activity ends.
## Talk to the Assistant
diff --git a/internal/equipo/chat/push.go b/internal/equipo/chat/push.go
index d0e34bde..d6487ec6 100644
--- a/internal/equipo/chat/push.go
+++ b/internal/equipo/chat/push.go
@@ -278,6 +278,7 @@ func (t *txn) enqueuePush(person string, devices []push.Registration, in push.In
badge = n
}
now := t.now()
+ in.Origin = t.s.authority.Origin
raw, typ, err := push.Render(in, t.s.authority.Copy, badge, now)
if errors.Is(err, push.ErrTooLarge) {
t.s.pushWarn("push too large", "rule", in.Rule, "task", in.TaskID)
diff --git a/internal/equipo/chat/push_test.go b/internal/equipo/chat/push_test.go
index 05e1cd49..608e3240 100644
--- a/internal/equipo/chat/push_test.go
+++ b/internal/equipo/chat/push_test.go
@@ -32,6 +32,7 @@ type pushRig struct {
func newPushRig(t *testing.T) *pushRig {
t.Helper()
r := &pushRig{hkRig: newHKRig(t), revoked: map[string]bool{}}
+ r.s.authority.Origin = "https://oficina.equipo.example"
r.s.authority.PushDevice = func(_ *gorm.DB, person, credential string) error {
if r.revoked[credential] || !strings.HasPrefix(credential, "cr_") {
return ErrForbidden
@@ -181,13 +182,19 @@ func TestPushTaskLifecycle(t *testing.T) {
}
var p struct {
APS struct {
- ContentState wire.LiveActivityState `json:"content-state"`
+ ContentState wire.LiveActivityState `json:"content-state"`
+ Attributes wire.LiveActivityAttributes `json:"attributes"`
} `json:"aps"`
}
r.must(json.Unmarshal([]byte(rows[0].Payload), &p))
if s := p.APS.ContentState; s.TaskID != "tk1" || s.Specialist != wire.SpecialistEngineering || s.Activity != "work.activity.working" || s.Tone != wire.TonePositive {
t.Fatalf("content state %+v", s)
}
+ // The activity names its team, so a device never sends its token to
+ // another team's instance, even after a relaunch.
+ if a := p.APS.Attributes; a.TaskID != "tk1" || a.Origin != r.s.authority.Origin || a.Origin == "" {
+ t.Fatalf("attributes %+v", a)
+ }
// The activity's own token arrives: it hears the whole state at once.
r.must(r.activity("cr_phone", "tk1"))
if rows = r.outbox(); kinds(rows[1:]) != push.KindActivityUpdate || rows[1].Priority != 10 || rows[1].Target != push.TargetActivity {
diff --git a/internal/equipo/push/payload.go b/internal/equipo/push/payload.go
index f5de160d..d475e1e2 100644
--- a/internal/equipo/push/payload.go
+++ b/internal/equipo/push/payload.go
@@ -75,7 +75,7 @@ func Render(in Intent, copy func(string) string, badge int, now time.Time) ([]by
case KindActivityStart:
p.APS.Event = "start"
p.APS.AttributesType = wire.LiveActivityAttributesType
- p.APS.Attributes = &wire.LiveActivityAttributes{TaskID: in.TaskID}
+ p.APS.Attributes = &wire.LiveActivityAttributes{TaskID: in.TaskID, Origin: in.Origin}
case KindActivityUpdate:
p.APS.Event = "update"
case KindActivityEnd:
diff --git a/internal/equipo/push/payload_test.go b/internal/equipo/push/payload_test.go
index 85c723ca..f8306396 100644
--- a/internal/equipo/push/payload_test.go
+++ b/internal/equipo/push/payload_test.go
@@ -48,6 +48,7 @@ func TestPayloadGoldens(t *testing.T) {
"activity-replaced": {Replace(working), 0, TypeLiveActivity},
}
for name, c := range cases {
+ c.in.Origin = "https://oficina.example.test"
raw, typ, err := Render(c.in, copyStub, c.badge, at)
if err != nil {
t.Fatal(name, err)
diff --git a/internal/equipo/push/rules.go b/internal/equipo/push/rules.go
index 34703b24..980cf64b 100644
--- a/internal/equipo/push/rules.go
+++ b/internal/equipo/push/rules.go
@@ -101,6 +101,8 @@ type Intent struct {
State *wire.LiveActivityState
// TaskID names the task a Live Activity push follows.
TaskID string
+ // Origin is the instance's origin, named in a start's attributes.
+ Origin string
}
// LineEvery is how often an activity line may update a Live Activity, to
diff --git a/internal/equipo/push/testdata/activity-start.json b/internal/equipo/push/testdata/activity-start.json
index 30373829..bd340b2c 100644
--- a/internal/equipo/push/testdata/activity-start.json
+++ b/internal/equipo/push/testdata/activity-start.json
@@ -18,7 +18,8 @@
},
"attributes-type": "EquipoTaskAttributes",
"attributes": {
- "task_id": "tk1"
+ "task_id": "tk1",
+ "origin": "https://oficina.example.test"
}
}
}
diff --git a/internal/wire/push.go b/internal/wire/push.go
index 5fb64e64..cf26f0e3 100644
--- a/internal/wire/push.go
+++ b/internal/wire/push.go
@@ -60,6 +60,9 @@ const LiveActivityAttributesType = "EquipoTaskAttributes"
// LiveActivityAttributes are a task Live Activity's fixed attributes.
type LiveActivityAttributes struct {
TaskID string `json:"task_id"`
+ // Origin is the instance's origin: a device sends this activity's
+ // token only to the account it names.
+ Origin string `json:"origin"`
}
// Live Activity tones, as Roster's stage track: amber waits on you, red
diff --git a/native/.gitignore b/native/.gitignore
index ba3dba2d..015bcf36 100644
--- a/native/.gitignore
+++ b/native/.gitignore
@@ -5,3 +5,4 @@ build/
*.xcodeproj/
*.log
ios/Info.plist
+ios/ActivityExtension-Info.plist
diff --git a/native/apple/Package.swift b/native/apple/Package.swift
index 6674e369..493bbdb4 100644
--- a/native/apple/Package.swift
+++ b/native/apple/Package.swift
@@ -13,12 +13,17 @@ let package = Package(
platforms: [.macOS(.v26), .iOS(.v26)],
products: [
.library(name: "EquipoKit", targets: ["EquipoKit"]),
+ // The Live Activity's attributes and views, for the iPhone's widget
+ // extension: no dependencies, so the extension stays small.
+ .library(name: "EquipoActivity", targets: ["EquipoActivity"]),
.executable(name: "EquipoMac", targets: ["EquipoMac"]),
],
dependencies: [sharedNative],
targets: [
+ .target(name: "EquipoActivity", resources: [.process("Resources")]),
.target(name: "EquipoKit",
- dependencies: [.product(name: "RastrilloApple", package: "native"),
+ dependencies: ["EquipoActivity",
+ .product(name: "RastrilloApple", package: "native"),
.product(name: "RastrilloNative", package: "native")],
resources: [.process("Resources")]),
.executableTarget(name: "EquipoMac",
@@ -27,7 +32,7 @@ let package = Package(
.product(name: "RastrilloMacUpdates", package: "native", condition: .when(platforms: [.macOS]))],
path: "Sources/EquipoMac"),
.testTarget(name: "EquipoKitTests",
- dependencies: ["EquipoKit", .product(name: "RastrilloNative", package: "native")],
+ dependencies: ["EquipoKit", "EquipoActivity", .product(name: "RastrilloNative", package: "native")],
resources: [.copy("Fixtures")]),
]
)
diff --git a/native/apple/Sources/EquipoActivity/Resources/Localizable.xcstrings b/native/apple/Sources/EquipoActivity/Resources/Localizable.xcstrings
new file mode 100644
index 00000000..3387547a
--- /dev/null
+++ b/native/apple/Sources/EquipoActivity/Resources/Localizable.xcstrings
@@ -0,0 +1,1810 @@
+{
+ "sourceLanguage": "en",
+ "version": "1.0",
+ "strings": {
+ "account.address": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Address"
+ }
+ }
+ }
+ },
+ "account.device": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "This device"
+ }
+ }
+ }
+ },
+ "account.device_name": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Name"
+ }
+ }
+ }
+ },
+ "account.sign_out": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Sign out"
+ }
+ }
+ }
+ },
+ "account.sign_out_confirm": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Sign out of this team on this device?"
+ }
+ }
+ }
+ },
+ "account.sign_out_footer": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Signing out forgets this device here at once, and removes it from the team when the team can be reached. You can pair it again at any time."
+ }
+ }
+ }
+ },
+ "account.signed_in_as": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Signed in as"
+ }
+ }
+ }
+ },
+ "account.team": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Team"
+ }
+ }
+ }
+ },
+ "account.team_name": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Name"
+ }
+ }
+ }
+ },
+ "account.title": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Account"
+ }
+ }
+ }
+ },
+ "account.until": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Signed in until"
+ }
+ }
+ }
+ },
+ "action.sending": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Sending…"
+ }
+ }
+ }
+ },
+ "app.name": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Equipo"
+ }
+ }
+ }
+ },
+ "byline.asks": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "asks"
+ }
+ }
+ }
+ },
+ "byline.reports": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "reports"
+ }
+ }
+ }
+ },
+ "card.changed": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "This item has changed. Check it before trying again."
+ }
+ }
+ }
+ },
+ "card.failed": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Couldn’t confirm that change. Try again."
+ }
+ }
+ }
+ },
+ "card.offline": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Couldn’t reach your team. Try again."
+ }
+ }
+ }
+ },
+ "card.open_on_web": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Open in Equipo on the web"
+ }
+ }
+ }
+ },
+ "card.question": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Question"
+ }
+ }
+ }
+ },
+ "chat.card.merge": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Merge"
+ }
+ }
+ }
+ },
+ "chat.card.merge_chose_merge": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Merging without checks."
+ }
+ }
+ }
+ },
+ "chat.card.merge_chose_not_now": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Not now."
+ }
+ }
+ }
+ },
+ "chat.card.merge_chose_wait": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Waiting for checks."
+ }
+ }
+ }
+ },
+ "chat.card.merge_chose_wait_mac": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Waiting for a Mac."
+ }
+ }
+ }
+ },
+ "chat.card.merge_policy_stale": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "The merge rules changed since I asked, so nothing was saved."
+ }
+ }
+ }
+ },
+ "chat.card.merge_resolved": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Nothing to decide any more."
+ }
+ }
+ }
+ },
+ "chat.card.not_now": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Not now"
+ }
+ }
+ }
+ },
+ "chat.card.not_ships": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "It doesn't"
+ }
+ }
+ }
+ },
+ "chat.card.preview_link": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Open the preview"
+ }
+ }
+ }
+ },
+ "chat.card.ships": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "It ships"
+ }
+ }
+ }
+ },
+ "chat.card.ships_chose_not_ships": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Main isn't a release, so I can merge small changes on my own when the other rules allow."
+ }
+ }
+ }
+ },
+ "chat.card.ships_chose_ships": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Merging to main ships to users, so I'll ask before merging without checks."
+ }
+ }
+ }
+ },
+ "chat.card.wait": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Wait for checks"
+ }
+ }
+ }
+ },
+ "chat.card.wait_mac": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Wait for a Mac"
+ }
+ }
+ }
+ },
+ "checks.cannot_run": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Can’t run here"
+ }
+ }
+ }
+ },
+ "checks.exit %@ %@": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "%1$@, exit code %2$@"
+ }
+ }
+ }
+ },
+ "checks.failed": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Failed"
+ }
+ }
+ }
+ },
+ "checks.needs_macos": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Needs macOS"
+ }
+ }
+ }
+ },
+ "checks.needs_network": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Needs network access"
+ }
+ }
+ }
+ },
+ "checks.none": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "No checks found"
+ }
+ }
+ }
+ },
+ "checks.passed": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Passed"
+ }
+ }
+ }
+ },
+ "checks.running": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Running"
+ }
+ }
+ }
+ },
+ "checks.timeout": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "The checks did not finish in time."
+ }
+ }
+ }
+ },
+ "checks.unavailable": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "This runner cannot run the checks."
+ }
+ }
+ }
+ },
+ "chip.needs_you": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Needs you"
+ }
+ }
+ }
+ },
+ "composer.send": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Send"
+ }
+ }
+ }
+ },
+ "conversation.empty": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Say what you want done. Your coordinator picks the project and tells you, and you can change it."
+ }
+ }
+ }
+ },
+ "conversation.placeholder": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Message"
+ }
+ }
+ }
+ },
+ "decision.on_web": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "For now you make this decision on the web, where its full context is."
+ }
+ }
+ }
+ },
+ "decision.untitled": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "A decision"
+ }
+ }
+ }
+ },
+ "device.mac": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Mac"
+ }
+ }
+ }
+ },
+ "fact.branch": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Branch"
+ }
+ }
+ }
+ },
+ "fact.checks": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Checks"
+ }
+ }
+ }
+ },
+ "fact.review": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Review"
+ }
+ }
+ }
+ },
+ "message.coordinator_spoken %@ %@": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Coordinator, %1$@. %2$@"
+ }
+ }
+ }
+ },
+ "message.failed": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Not sent. Try again."
+ }
+ }
+ }
+ },
+ "message.own_spoken %@": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "You said: %@"
+ }
+ }
+ }
+ },
+ "message.sending": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Sending…"
+ }
+ }
+ }
+ },
+ "message.waiting": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Waiting for a connection. Try again."
+ }
+ }
+ }
+ },
+ "needs.count %lld": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "%lld waiting for you"
+ }
+ }
+ }
+ },
+ "needs.count_spoken %lld": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "%lld waiting for you"
+ }
+ }
+ }
+ },
+ "needs.empty": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Questions and decisions for you appear here."
+ }
+ }
+ }
+ },
+ "needs.empty_title": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Nothing needs you"
+ }
+ }
+ }
+ },
+ "pairing.approve_lede": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Approve this device in your browser. There is no password or token to paste."
+ }
+ }
+ }
+ },
+ "pairing.approved %@": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "This device is paired with %@."
+ }
+ }
+ }
+ },
+ "pairing.approved_title": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Paired"
+ }
+ }
+ }
+ },
+ "pairing.bad_team": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "That is not a team address. Check it and try again."
+ }
+ }
+ }
+ },
+ "pairing.cancel": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Cancel"
+ }
+ }
+ }
+ },
+ "pairing.continue": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Continue"
+ }
+ }
+ }
+ },
+ "pairing.ended %@": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "%@ ended this device’s session. Pair it again to continue."
+ }
+ }
+ }
+ },
+ "pairing.expired": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "The code expired. Pair again for a new one."
+ }
+ }
+ }
+ },
+ "pairing.failed": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Couldn’t pair this device. Try again."
+ }
+ }
+ }
+ },
+ "pairing.not_equipo": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "There is no Equipo team at that address."
+ }
+ }
+ }
+ },
+ "pairing.offline": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Couldn’t reach that address. Check your connection and try again."
+ }
+ }
+ }
+ },
+ "pairing.open_browser": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Open your team to approve"
+ }
+ }
+ }
+ },
+ "pairing.pair": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Pair this device"
+ }
+ }
+ }
+ },
+ "pairing.requesting": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Asking your team for a code…"
+ }
+ }
+ }
+ },
+ "pairing.shown_as %@": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Shown in your browser as %@"
+ }
+ }
+ }
+ },
+ "pairing.slow_down": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Too many tries. Wait a minute and try again."
+ }
+ }
+ }
+ },
+ "pairing.team_hint": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "The address you open Equipo at in your browser."
+ }
+ }
+ }
+ },
+ "pairing.team_label": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Team address"
+ }
+ }
+ }
+ },
+ "pairing.team_placeholder": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "team.equipo.oficina.works"
+ }
+ }
+ }
+ },
+ "pairing.title": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Pair with your team"
+ }
+ }
+ }
+ },
+ "pairing.waiting": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Waiting for you to approve."
+ }
+ }
+ }
+ },
+ "pairing.welcome_lede": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Talk to your coordinator, answer questions and follow your team’s work from this device."
+ }
+ }
+ }
+ },
+ "pairing.welcome_title": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Equipo"
+ }
+ }
+ }
+ },
+ "pairing.your_code": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Your code"
+ }
+ }
+ }
+ },
+ "project.spoken %@": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Project %@"
+ }
+ }
+ }
+ },
+ "question.answered %@": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "You answered: %@"
+ }
+ }
+ }
+ },
+ "question.closed": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "This question is no longer open."
+ }
+ }
+ }
+ },
+ "read.failed": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Your team answered, but not with what this screen needs. Try again in a moment."
+ }
+ }
+ }
+ },
+ "read.failed_title": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Couldn’t load this"
+ }
+ }
+ }
+ },
+ "read.retry": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Try again"
+ }
+ }
+ }
+ },
+ "receipt.added %@": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Added %@"
+ }
+ }
+ }
+ },
+ "receipt.changed %@": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Moved to %@"
+ }
+ }
+ }
+ },
+ "receipt.created %@": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Created %@"
+ }
+ }
+ }
+ },
+ "receipt.home %@": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "New projects go to %@"
+ }
+ }
+ }
+ },
+ "receipt.home_cleared": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "New projects go to the best-fitting existing repository"
+ }
+ }
+ }
+ },
+ "receipt.removed %@": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Removed %@"
+ }
+ }
+ }
+ },
+ "receipt.working %@": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Working in %@"
+ }
+ }
+ }
+ },
+ "review.approve": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Approved"
+ }
+ }
+ }
+ },
+ "review.changes_requested": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Changes requested"
+ }
+ }
+ }
+ },
+ "review.other_family": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "another model family"
+ }
+ }
+ }
+ },
+ "review.running": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Reviewing"
+ }
+ }
+ }
+ },
+ "review.same_account": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "same family, same account"
+ }
+ }
+ }
+ },
+ "review.same_family": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "same family"
+ }
+ }
+ }
+ },
+ "roster.aside": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Set aside, still in Needs you"
+ }
+ }
+ }
+ },
+ "roster.decision": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Decision"
+ }
+ }
+ }
+ },
+ "roster.question": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Question"
+ }
+ }
+ }
+ },
+ "roster.restoring": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Restoring…"
+ }
+ }
+ }
+ },
+ "roster.set_aside": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Set aside"
+ }
+ }
+ }
+ },
+ "roster.setting_aside": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Setting aside…"
+ }
+ }
+ }
+ },
+ "roster.undo": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Undo"
+ }
+ }
+ }
+ },
+ "settings.not_paired": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Pair this Mac with a team to see its settings."
+ }
+ }
+ }
+ },
+ "specialist.checks": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Checks"
+ }
+ }
+ }
+ },
+ "specialist.coordinator": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Coordinator"
+ }
+ }
+ }
+ },
+ "specialist.copy": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Copy"
+ }
+ }
+ }
+ },
+ "specialist.design": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Design"
+ }
+ }
+ }
+ },
+ "specialist.engineering": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Engineering"
+ }
+ }
+ }
+ },
+ "specialist.research": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Research"
+ }
+ }
+ }
+ },
+ "specialist.review": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Review"
+ }
+ }
+ }
+ },
+ "stage.cancelled": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Cancelled"
+ }
+ }
+ }
+ },
+ "stage.done": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Done"
+ }
+ }
+ }
+ },
+ "stage.in_progress": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "In progress"
+ }
+ }
+ }
+ },
+ "stage.in_review": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "In review"
+ }
+ }
+ }
+ },
+ "stage.noted": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Noted"
+ }
+ }
+ }
+ },
+ "stage.ready_to_merge": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Ready to merge"
+ }
+ }
+ }
+ },
+ "step.cancelled": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Cancelled"
+ }
+ }
+ }
+ },
+ "step.done": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Done"
+ }
+ }
+ }
+ },
+ "step.failed": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Stopped"
+ }
+ }
+ }
+ },
+ "step.queued": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Queued"
+ }
+ }
+ }
+ },
+ "step.running": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Running"
+ }
+ }
+ }
+ },
+ "tab.conversation": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Conversation"
+ }
+ }
+ }
+ },
+ "tab.needs": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Needs you"
+ }
+ }
+ }
+ },
+ "tab.tasks": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Tasks"
+ }
+ }
+ }
+ },
+ "task.brief": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "What was asked"
+ }
+ }
+ }
+ },
+ "task.hide_talk": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Hide the talk"
+ }
+ }
+ }
+ },
+ "task.inspector": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Show or hide the task"
+ }
+ }
+ }
+ },
+ "task.missing": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "This task is not available."
+ }
+ }
+ }
+ },
+ "task.none_selected": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Choose a task to see it here."
+ }
+ }
+ }
+ },
+ "task.open": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Open the task"
+ }
+ }
+ }
+ },
+ "task.open_hint": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Opens the task"
+ }
+ }
+ }
+ },
+ "task.open_web": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Open on the web"
+ }
+ }
+ }
+ },
+ "task.reply": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Reply"
+ }
+ }
+ }
+ },
+ "task.steps": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Steps"
+ }
+ }
+ }
+ },
+ "task.talk": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Talk about this"
+ }
+ }
+ }
+ },
+ "task.thread_empty": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Nothing has been said about this task yet."
+ }
+ }
+ }
+ },
+ "task.title": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Task"
+ }
+ }
+ }
+ },
+ "tasks.empty": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Tasks you and your team ask for appear here."
+ }
+ }
+ }
+ },
+ "tasks.empty_title": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "No tasks yet"
+ }
+ }
+ }
+ },
+ "tasks.finished": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Finished"
+ }
+ }
+ }
+ },
+ "tasks.in_progress": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "In progress"
+ }
+ }
+ }
+ },
+ "tasks.needs_you": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Needs you"
+ }
+ }
+ }
+ },
+ "thinking.stop": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Stop"
+ }
+ }
+ }
+ },
+ "thinking.stopping": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Stopping…"
+ }
+ }
+ }
+ },
+ "thinking.waiting": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Waiting for a connection"
+ }
+ }
+ }
+ },
+ "thinking.working": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Working…"
+ }
+ }
+ }
+ },
+ "thread.own_spoken %@": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "You said: %@. Sent"
+ }
+ }
+ }
+ },
+ "thread.reading %@": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "%@ is reading"
+ }
+ }
+ }
+ },
+ "thread.sent": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Sent"
+ }
+ }
+ }
+ },
+ "track.position %@ %@": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "%1$@ of %2$@"
+ }
+ }
+ }
+ },
+ "track.spoken %@": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Stage: %@"
+ }
+ }
+ }
+ },
+ "work.tl.merge_dropped": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "An earlier attempt to add this change was dropped when the task became an exploration."
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/native/apple/Sources/EquipoActivity/Roster.swift b/native/apple/Sources/EquipoActivity/Roster.swift
new file mode 100644
index 00000000..deafedcc
--- /dev/null
+++ b/native/apple/Sources/EquipoActivity/Roster.swift
@@ -0,0 +1,74 @@
+import Foundation
+
+// Roster's words for who works on a task and where it is (chat_roster.go:
+// rosterAuthor, rosterTone, rosterTrack). They live here, beside the Live
+// Activity, so the app and its widget extension draw a task the same way;
+// EquipoKit re-exports them.
+
+public enum Specialist: String, CaseIterable, Sendable {
+ case coordinator, engineering, copy, research, checks, review, design
+ public init(category: String) { self = Specialist(rawValue: category.lowercased()) ?? .coordinator }
+ public var name: String {
+ switch self {
+ case .coordinator: return String(localized: "specialist.coordinator", bundle: .module)
+ case .engineering: return String(localized: "specialist.engineering", bundle: .module)
+ case .copy: return String(localized: "specialist.copy", bundle: .module)
+ case .research: return String(localized: "specialist.research", bundle: .module)
+ case .checks: return String(localized: "specialist.checks", bundle: .module)
+ case .review: return String(localized: "specialist.review", bundle: .module)
+ case .design: return String(localized: "specialist.design", bundle: .module)
+ }
+ }
+ /// SF Symbols, matching the web's icons (wrench, type, search).
+ public var symbol: String {
+ switch self {
+ case .coordinator: return "sparkle"
+ case .engineering: return "wrench.adjustable"
+ case .copy: return "textformat"
+ case .research: return "magnifyingglass"
+ case .checks: return "checklist.checked"
+ case .review: return "checkmark.shield"
+ case .design: return "paintbrush.pointed"
+ }
+ }
+}
+
+/// Amber waits on you, red only for a failure.
+public enum StageTone: String, Sendable { case positive, warning, negative }
+
+public enum Stage: String, CaseIterable, Sendable {
+ case noted, inProgress = "in_progress", inReview = "in_review", readyToMerge = "ready_to_merge", done
+ public init?(wire: String) {
+ switch wire {
+ case "merging": self = .readyToMerge
+ case "investigated": self = .noted
+ default: self.init(rawValue: wire)
+ }
+ }
+ public var label: String {
+ switch self {
+ case .noted: return String(localized: "stage.noted", bundle: .module)
+ case .inProgress: return String(localized: "stage.in_progress", bundle: .module)
+ case .inReview: return String(localized: "stage.in_review", bundle: .module)
+ case .readyToMerge: return String(localized: "stage.ready_to_merge", bundle: .module)
+ case .done: return String(localized: "stage.done", bundle: .module)
+ }
+ }
+
+ /// chat_roster.go rosterTrack: the five stops, those before `current`
+ /// done, `current` in its tone. An unknown stage sits on the first.
+ public static func track(at current: Stage?, tone: StageTone) -> [TrackStop] {
+ let index = allCases.firstIndex(of: current ?? .noted) ?? 0
+ return allCases.enumerated().map { i, s in
+ TrackStop(stage: s, state: i < index ? .done : i == index ? .current : .todo, tone: i == index ? tone : nil)
+ }
+ }
+}
+
+public enum StopState: Sendable { case done, current, todo }
+public struct TrackStop: Identifiable, Sendable, Equatable {
+ public var stage: Stage
+ public var state: StopState
+ public var tone: StageTone?
+ public var id: String { stage.rawValue }
+}
diff --git a/native/apple/Sources/EquipoActivity/TaskActivity.swift b/native/apple/Sources/EquipoActivity/TaskActivity.swift
new file mode 100644
index 00000000..56ba7996
--- /dev/null
+++ b/native/apple/Sources/EquipoActivity/TaskActivity.swift
@@ -0,0 +1,122 @@
+import Foundation
+#if os(iOS)
+import ActivityKit
+#endif
+
+/// A task's Live Activity (native slice 2, D3): one for each task the person
+/// started, at most three, started and moved by the server's pushes.
+///
+/// The type's name is the push's `attributes-type` and its fields are
+/// `wire.LiveActivityAttributes` and `wire.LiveActivityState`, so neither
+/// may be renamed without the server (internal/equipo/push/payload.go).
+/// ActivityKit decodes pushes with a plain JSONDecoder: the coding keys
+/// spell out the wire's snake case.
+public struct EquipoTaskAttributes: Codable, Hashable, Sendable {
+ public var taskID: String
+ /// The team's instance that started it: its token goes only to the
+ /// account at this origin. nil from a server that did not name one.
+ public var origin: String?
+ enum CodingKeys: String, CodingKey { case taskID = "task_id", origin }
+ public init(taskID: String, origin: String? = nil) { self.taskID = taskID; self.origin = origin }
+
+ /// The task as the activity shows it: the task, its stage (Task.stage),
+ /// the specialist working on it, the newest activity line, what it needs
+ /// from you ("" when nothing), Roster's tone, and once it ended, the
+ /// outcome (done, cancelled, failed, or replaced by a newer task's).
+ public struct ContentState: Codable, Hashable, Sendable {
+ public var taskID: String
+ public var title: String
+ public var stage: String
+ public var specialist: String
+ public var activity: String
+ public var needsYou: String
+ public var tone: String
+ public var outcome: String?
+
+ enum CodingKeys: String, CodingKey {
+ case taskID = "task_id", title, stage, specialist, activity, needsYou = "needs_you", tone, outcome
+ }
+ public init(taskID: String, title: String, stage: String, specialist: String, activity: String,
+ needsYou: String, tone: String, outcome: String? = nil) {
+ self.taskID = taskID; self.title = title; self.stage = stage; self.specialist = specialist
+ self.activity = activity; self.needsYou = needsYou; self.tone = tone; self.outcome = outcome
+ }
+ /// A field the server leaves out reads as empty: an activity that
+ /// cannot decode its update is never updated again.
+ public init(from decoder: Decoder) throws {
+ let c = try decoder.container(keyedBy: CodingKeys.self)
+ func text(_ key: CodingKeys) throws -> String { try c.decodeIfPresent(String.self, forKey: key) ?? "" }
+ taskID = try text(.taskID); title = try text(.title); stage = try text(.stage)
+ specialist = try text(.specialist); activity = try text(.activity); needsYou = try text(.needsYou)
+ tone = try text(.tone)
+ let ended = try c.decodeIfPresent(String.self, forKey: .outcome)
+ outcome = ended?.isEmpty == false ? ended : nil
+ }
+ }
+}
+
+#if os(iOS)
+extension EquipoTaskAttributes: ActivityAttributes {}
+#endif
+
+/// The app's own links: a Live Activity opens its task with one.
+public enum EquipoLink {
+ public static let scheme = "works.oficina.equipo"
+ public static func task(_ id: String) -> URL {
+ var c = URLComponents()
+ c.scheme = scheme; c.host = "task"; c.path = "/" + id
+ return c.url ?? URL(string: scheme + "://task")!
+ }
+ /// The task a link opens, or nil for anything else.
+ public static func taskID(from url: URL) -> String? {
+ guard url.scheme == scheme, url.host == "task" else { return nil }
+ let id = String(url.path.dropFirst())
+ return id.isEmpty || id.contains("/") ? nil : id
+ }
+}
+
+/// What a task's Live Activity shows, from its content state, in Roster's
+/// rules: the five-stop track (none for a cancelled task), the stop's tone
+/// (amber while it needs you), the specialist's symbol, and one line that
+/// says what is happening, what it needs, or how it ended.
+public struct TaskActivityPresentation: Sendable, Equatable {
+ public let state: EquipoTaskAttributes.ContentState
+ public init(_ state: EquipoTaskAttributes.ContentState) { self.state = state }
+
+ public var title: String { state.title }
+ public var needsYou: Bool { !state.needsYou.isEmpty && !ended }
+ public var ended: Bool { state.outcome != nil }
+ public var cancelled: Bool { state.stage == "cancelled" || state.outcome == "cancelled" }
+ /// The server's tone; amber whenever the task waits on you.
+ public var tone: StageTone {
+ if needsYou { return state.tone == StageTone.negative.rawValue ? .negative : .warning }
+ return StageTone(rawValue: state.tone) ?? .positive
+ }
+ public var stage: Stage? { state.outcome == "done" ? .done : Stage(wire: state.stage) }
+ public var track: [TrackStop] { cancelled ? [] : Stage.track(at: stage, tone: tone) }
+ public var specialist: Specialist { state.specialist.isEmpty ? .engineering : Specialist(category: state.specialist) }
+ /// How it ended, in Roster's words; nil while it runs, or when a newer
+ /// task's activity replaced it (it is dismissed at once).
+ public var outcome: String? {
+ switch state.outcome {
+ case "done": return String(localized: "stage.done", bundle: .module)
+ case "cancelled": return String(localized: "stage.cancelled", bundle: .module)
+ case "failed": return String(localized: "step.failed", bundle: .module)
+ default: return nil
+ }
+ }
+ /// The one line under the title.
+ public var line: String {
+ if let outcome { return outcome }
+ if needsYou { return String(localized: "chip.needs_you", bundle: .module) }
+ if !state.activity.isEmpty { return state.activity }
+ return stage?.label ?? (cancelled ? String(localized: "stage.cancelled", bundle: .module) : "")
+ }
+ public var url: URL { EquipoLink.task(state.taskID) }
+ /// VoiceOver: the title, where it is, and the line.
+ public var spoken: String {
+ [title, stage?.label, line].compactMap { $0 }.filter { !$0.isEmpty }.reduce(into: [String]()) { out, s in
+ if out.last != s { out.append(s) }
+ }.joined(separator: ". ")
+ }
+}
diff --git a/native/apple/Sources/EquipoActivity/TaskActivityWidget.swift b/native/apple/Sources/EquipoActivity/TaskActivityWidget.swift
new file mode 100644
index 00000000..87930084
--- /dev/null
+++ b/native/apple/Sources/EquipoActivity/TaskActivityWidget.swift
@@ -0,0 +1,185 @@
+#if os(iOS)
+import ActivityKit
+import SwiftUI
+import WidgetKit
+
+/// The task Live Activity's Lock Screen and Dynamic Island, drawn from
+/// Roster: the title, the five-stop track, the specialist's tile, the
+/// activity line, amber while it needs you, and the outcome at the end.
+/// Tapping it opens the task (EquipoLink).
+public struct EquipoTaskLiveActivity: Widget {
+ public init() {}
+ public var body: some WidgetConfiguration {
+ ActivityConfiguration(for: EquipoTaskAttributes.self) { context in
+ let p = TaskActivityPresentation(context.state)
+ TaskLockScreen(p: p)
+ .padding(16)
+ .activityBackgroundTint(nil)
+ .widgetURL(p.url)
+ } dynamicIsland: { context in
+ let p = TaskActivityPresentation(context.state)
+ return DynamicIsland {
+ DynamicIslandExpandedRegion(.leading) {
+ ActivityTile(who: p.specialist, tone: p.needsYou ? p.tone : nil, size: 36)
+ }
+ DynamicIslandExpandedRegion(.trailing) {
+ if p.needsYou { ActivityNeedsChip() } else if let outcome = p.outcome {
+ Label(outcome, systemImage: p.state.outcome == "done" ? "checkmark" : "xmark")
+ .font(.caption.weight(.semibold)).foregroundStyle(p.state.outcome == "done" ? ActivityPalette.positive : .secondary)
+ .labelStyle(.titleAndIcon)
+ }
+ }
+ DynamicIslandExpandedRegion(.center) {
+ Text(p.title).font(.headline).lineLimit(1)
+ }
+ DynamicIslandExpandedRegion(.bottom) {
+ VStack(alignment: .leading, spacing: 8) {
+ if !p.track.isEmpty { ActivityTrack(track: p.track, labels: true) }
+ ActivityLine(p: p)
+ }
+ .accessibilityElement(children: .combine)
+ }
+ } compactLeading: {
+ Image(systemName: p.specialist.symbol)
+ .foregroundStyle(p.needsYou ? p.tone.dot : .primary)
+ .accessibilityLabel(p.specialist.name)
+ } compactTrailing: {
+ if p.track.isEmpty { Image(systemName: "xmark").foregroundStyle(.secondary) }
+ else { ActivityTrack(track: p.track, labels: false).frame(width: 40) }
+ } minimal: {
+ Image(systemName: p.needsYou ? "hand.raised.fill" : p.specialist.symbol)
+ .foregroundStyle(p.needsYou ? p.tone.dot : .primary)
+ }
+ .widgetURL(p.url)
+ .keylineTint(p.needsYou ? p.tone.dot : nil)
+ }
+ }
+}
+
+struct TaskLockScreen: View {
+ let p: TaskActivityPresentation
+ var body: some View {
+ VStack(alignment: .leading, spacing: 12) {
+ HStack(alignment: .center, spacing: 12) {
+ ActivityTile(who: p.specialist, tone: p.needsYou ? p.tone : nil, size: 40)
+ VStack(alignment: .leading, spacing: 3) {
+ Text(p.title).font(.headline).lineLimit(2)
+ ActivityLine(p: p)
+ }
+ Spacer(minLength: 0)
+ if p.needsYou { ActivityNeedsChip() }
+ }
+ if !p.track.isEmpty { ActivityTrack(track: p.track, labels: true) }
+ }
+ .accessibilityElement(children: .ignore)
+ .accessibilityLabel(p.spoken)
+ }
+}
+
+/// The activity line, or what it needs, or how it ended.
+struct ActivityLine: View {
+ let p: TaskActivityPresentation
+ var body: some View {
+ Text(p.line)
+ .font(.subheadline.weight(p.needsYou || p.ended ? .semibold : .regular))
+ .foregroundStyle(p.needsYou ? p.tone.dot : p.state.outcome == "done" ? ActivityPalette.positive : .secondary)
+ .lineLimit(1).truncationMode(.tail)
+ }
+}
+
+/// The specialist's SF Symbol in Roster's rounded tile; amber while it needs you.
+struct ActivityTile: View {
+ let who: Specialist
+ var tone: StageTone?
+ var size: CGFloat
+ var body: some View {
+ let shape = RoundedRectangle(cornerRadius: size * 0.3, style: .continuous)
+ Image(systemName: who.symbol)
+ .font(.system(size: size * 0.46, weight: .medium))
+ .foregroundStyle(tone?.dot ?? .primary)
+ .frame(width: size, height: size)
+ .background(tone?.halo ?? Color.primary.opacity(0.08), in: shape)
+ .overlay(shape.strokeBorder(tone?.dot.opacity(0.4) ?? Color.primary.opacity(0.12), lineWidth: 1))
+ .accessibilityLabel(who.name)
+ }
+}
+
+struct ActivityNeedsChip: View {
+ var body: some View {
+ HStack(spacing: 4) {
+ Image(systemName: "hand.raised").font(.system(size: 11, weight: .semibold))
+ Text(String(localized: "chip.needs_you", bundle: .module)).textCase(.uppercase).kerning(0.3)
+ }
+ .font(.caption2.weight(.semibold)).foregroundStyle(ActivityPalette.warning)
+ .padding(.horizontal, 8).padding(.vertical, 3)
+ .background(ActivityPalette.warningBackground, in: Capsule())
+ .fixedSize()
+ }
+}
+
+/// Roster's five stops: done stops filled green, the current one in its
+/// tone with a halo, the rest hollow. With labels, the current stop's name.
+struct ActivityTrack: View {
+ let track: [TrackStop]
+ var labels: Bool
+ var body: some View {
+ VStack(alignment: .leading, spacing: 4) {
+ Canvas { context, size in
+ let y = size.height / 2
+ let r: CGFloat = labels ? 9.5 : 3.5
+ let xs = track.indices.map { r + CGFloat($0) * (size.width - 2 * r) / CGFloat(max(1, track.count - 1)) }
+ for i in 0..<(xs.count - 1) {
+ let line = Path(CGRect(x: xs[i], y: y - (labels ? 1 : 0.5), width: xs[i + 1] - xs[i], height: labels ? 2 : 1))
+ context.fill(line, with: .color(track[i].state == .done ? ActivityPalette.positive : ActivityPalette.todo))
+ }
+ for (i, stop) in track.enumerated() {
+ let c = CGPoint(x: xs[i], y: y)
+ let small: CGFloat = labels ? 4 : 2
+ switch stop.state {
+ case .done:
+ context.fill(Path(ellipseIn: CGRect(x: c.x - small, y: c.y - small, width: 2 * small, height: 2 * small)), with: .color(ActivityPalette.positive))
+ case .current:
+ let tone = stop.tone ?? .positive
+ let halo = labels ? 9.5 : 3.5, dot = labels ? 5.5 : 2.5
+ context.fill(Path(ellipseIn: CGRect(x: c.x - halo, y: c.y - halo, width: 2 * halo, height: 2 * halo)), with: .color(tone.halo))
+ context.fill(Path(ellipseIn: CGRect(x: c.x - dot, y: c.y - dot, width: 2 * dot, height: 2 * dot)), with: .color(tone.dot))
+ case .todo:
+ let dot = Path(ellipseIn: CGRect(x: c.x - small, y: c.y - small, width: 2 * small, height: 2 * small))
+ context.stroke(dot, with: .color(ActivityPalette.todo), lineWidth: 1)
+ }
+ }
+ }
+ .frame(height: labels ? 20 : 8)
+ if labels, let current = track.first(where: { $0.state == .current }) {
+ Text(current.stage.label).font(.caption.weight(.semibold)).foregroundStyle((current.tone ?? .positive).dot)
+ }
+ }
+ .accessibilityHidden(true)
+ }
+}
+
+/// The web day theme's status colours (theme.css), as Roster uses them.
+enum ActivityPalette {
+ static let positive = Color(light: 0x166534, dark: 0x6EE7A8)
+ static let positiveBackground = Color(light: 0xDCFCE7, dark: 0x10281C)
+ static let warning = Color(light: 0x854D0E, dark: 0xF0C46A)
+ static let warningBackground = Color(light: 0xFEF3C7, dark: 0x2C2110)
+ static let negative = Color(light: 0xB91C1C, dark: 0xF79AA0)
+ static let negativeBackground = Color(light: 0xFEE2E2, dark: 0x331819)
+ static let todo = Color(light: 0x868691, dark: 0x71737C)
+}
+
+extension StageTone {
+ var dot: Color { self == .warning ? ActivityPalette.warning : self == .negative ? ActivityPalette.negative : ActivityPalette.positive }
+ var halo: Color { self == .warning ? ActivityPalette.warningBackground : self == .negative ? ActivityPalette.negativeBackground : ActivityPalette.positiveBackground }
+}
+
+private extension Color {
+ init(light: UInt32, dark: UInt32) {
+ self.init(uiColor: UIColor { traits in
+ let hex = traits.userInterfaceStyle == .dark ? dark : light
+ return UIColor(red: Double((hex >> 16) & 255) / 255, green: Double((hex >> 8) & 255) / 255, blue: Double(hex & 255) / 255, alpha: 1)
+ })
+ }
+}
+#endif
diff --git a/native/apple/Sources/EquipoKit/API/Push.swift b/native/apple/Sources/EquipoKit/API/Push.swift
new file mode 100644
index 00000000..955d1b03
--- /dev/null
+++ b/native/apple/Sources/EquipoKit/API/Push.swift
@@ -0,0 +1,83 @@
+import Foundation
+
+// Push registration and set aside (native slice 2): wire.RegisterPush,
+// wire.PushRegistration, wire.RegisterActivity and wire.SetCardVisibility
+// (internal/wire/push.go), served by the conversation engine.
+
+/// The APNs gateway a device token belongs to.
+public enum APNsEnvironment: String, Codable, Sendable { case production, development }
+
+/// The device's platform, as the server names it. Only iOS starts Live Activities.
+public enum PushPlatform: String, Codable, Sendable {
+ case ios, macos
+ public static var current: PushPlatform {
+ #if os(iOS)
+ return .ios
+ #else
+ return .macos
+ #endif
+ }
+}
+
+/// The body of `POST /push-registrations`: this device's APNs token, its
+/// gateway and platform, and on iPhone the Live Activity push-to-start
+/// token. Tokens are lowercase hex. They are secrets: never logged.
+public struct PushRegistrationBody: Codable, Sendable, Equatable {
+ public var token: String
+ public var environment: APNsEnvironment
+ public var platform: PushPlatform
+ public var startToken: String?
+ public init(token: String, environment: APNsEnvironment, platform: PushPlatform, startToken: String? = nil) {
+ self.token = token; self.environment = environment; self.platform = platform
+ // Only an iPhone has a push-to-start token; the server refuses one from a Mac.
+ self.startToken = platform == .ios ? startToken : nil
+ }
+}
+
+/// What the server keeps, without its tokens.
+public struct PushRegistration: Codable, Sendable, Equatable {
+ public var environment: String
+ public var platform: String
+ public var liveActivities: Bool
+ public var updatedAt: Date
+}
+
+/// The body of `POST /push-registrations/activities`: a running Live
+/// Activity's own update token, for its task.
+public struct ActivityTokenBody: Codable, Sendable, Equatable {
+ public var taskId: String
+ public var token: String
+}
+
+public enum PushToken {
+ /// An APNs token as the server takes it: lowercase hex.
+ public static func hex(_ data: Data) -> String { data.map { String(format: "%02x", $0) }.joined() }
+}
+
+extension EquipoClient {
+ /// Registers this device for pushes, replacing its earlier registration.
+ public func registerPush(_ write: PendingWrite) async throws -> PushRegistration {
+ try await send(APIRequest("POST", "/push-registrations", body: write.body, bearer: token, idempotencyKey: write.key))
+ }
+ /// A running Live Activity's token. 404 for a task that is not the
+ /// person's; 409 `task_ended` once it ended.
+ public func registerActivity(_ write: PendingWrite) async throws {
+ let _: EmptyResponse = try await send(APIRequest("POST", "/push-registrations/activities", body: write.body, bearer: token, idempotencyKey: write.key))
+ }
+
+ /// Set aside (or Undo), bound to the card revision the person saw. It
+ /// never answers, cancels or starts anything.
+ public static func visibility(aside: Bool, of card: ThinCard) throws -> PendingWrite {
+ let body: [String: AnyEncodable] = ["aside": .init(aside), "revision": .init(card.revision)]
+ return PendingWrite(body: try EquipoJSON.encoder.encode(body), ifMatch: card.revision)
+ }
+ public func setVisibility(card id: String, _ write: PendingWrite) async throws -> ThinCard {
+ guard write.ifMatch != nil else { throw EquipoAPIError.status(428) }
+ return try await send(APIRequest("POST", "/cards/\(escapePath(id))/visibility", body: write.body, bearer: token,
+ idempotencyKey: write.key, ifMatch: write.ifMatch))
+ }
+
+ func escapePath(_ id: String) -> String {
+ id.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed.subtracting(CharacterSet(charactersIn: "/"))) ?? id
+ }
+}
diff --git a/native/apple/Sources/EquipoKit/API/Thin.swift b/native/apple/Sources/EquipoKit/API/Thin.swift
index 27706260..0de602ef 100644
--- a/native/apple/Sources/EquipoKit/API/Thin.swift
+++ b/native/apple/Sources/EquipoKit/API/Thin.swift
@@ -52,8 +52,13 @@ public struct ThinCard: Codable, Sendable, Identifiable, Equatable {
public var createdAt: Date
public var updatedAt: Date
public var previewUrl: String?
+ /// Set aside by this person (POST /cards/{id}/visibility); absent when not.
+ public var aside: Bool?
/// The person can still act on it (wire.CardOpen and the setup states).
public var isOpen: Bool { ["open", "ask"].contains(state) }
+ /// Set aside, and still waiting: shown as a one-line stub with Undo, and
+ /// still in Needs you (chat_roster.go SetAside).
+ public var isAside: Bool { aside == true && isOpen }
}
public struct ThreadEntry: Codable, Sendable, Identifiable, Equatable {
diff --git a/native/apple/Sources/EquipoKit/Exports.swift b/native/apple/Sources/EquipoKit/Exports.swift
new file mode 100644
index 00000000..a05d91bc
--- /dev/null
+++ b/native/apple/Sources/EquipoKit/Exports.swift
@@ -0,0 +1,4 @@
+// Roster's stage, tone and specialist, and the Live Activity's attributes,
+// live in EquipoActivity so the widget extension can draw a task without
+// the rest of EquipoKit. The apps see them through EquipoKit.
+@_exported import EquipoActivity
diff --git a/native/apple/Sources/EquipoKit/Pairing/SecretStore.swift b/native/apple/Sources/EquipoKit/Pairing/SecretStore.swift
index 42527a90..27a86002 100644
--- a/native/apple/Sources/EquipoKit/Pairing/SecretStore.swift
+++ b/native/apple/Sources/EquipoKit/Pairing/SecretStore.swift
@@ -26,18 +26,24 @@ public struct KeychainSecretStore: SecretStore {
guard SecItemCopyMatching(q as CFDictionary, &result) == errSecSuccess else { return nil }
return result as? Data
}
+ /// iPhone: after the first unlock since it started, never in a backup or
+ /// on another device. Slice 2 works in the background: when the server
+ /// starts a task's Live Activity, iOS wakes the app, often on a locked
+ /// phone, to send the activity's token with the device credential.
+ /// (Slice 1 kept it to while unlocked; a write moves an older item over.)
+ /// On the Mac this lands in the login keychain, readable by this app only
+ /// (its default access list); the data protection keychain would need a
+ /// keychain-access-groups entitlement.
+ static var accessible: CFString { kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly }
+
public func write(_ data: Data, account: String) throws {
- let updated = SecItemUpdate(query(account) as CFDictionary, [kSecValueData as String: data] as CFDictionary)
+ let updated = SecItemUpdate(query(account) as CFDictionary,
+ [kSecValueData as String: data, kSecAttrAccessible as String: Self.accessible] as CFDictionary)
if updated == errSecSuccess { return }
guard updated == errSecItemNotFound else { throw StoreError.keychain(updated) }
var q = query(account)
q[kSecValueData as String] = data
- // iPhone: only while unlocked, never in a backup or on another device.
- // Slice 1 does no background work, so it needs nothing looser. On the
- // Mac this lands in the login keychain, readable by this app only
- // (its default access list); the data protection keychain would need
- // a keychain-access-groups entitlement and so a provisioning profile.
- q[kSecAttrAccessible as String] = kSecAttrAccessibleWhenUnlockedThisDeviceOnly
+ q[kSecAttrAccessible as String] = Self.accessible
let added = SecItemAdd(q as CFDictionary, nil)
guard added == errSecSuccess else { throw StoreError.keychain(added) }
}
diff --git a/native/apple/Sources/EquipoKit/Presentation/Roster.swift b/native/apple/Sources/EquipoKit/Presentation/Roster.swift
index 15fdf353..128955b2 100644
--- a/native/apple/Sources/EquipoKit/Presentation/Roster.swift
+++ b/native/apple/Sources/EquipoKit/Presentation/Roster.swift
@@ -6,36 +6,6 @@ import Foundation
// failure), rosterTrack (five stops) and Compact (a report beside its open
// decision is one line).
-public enum Specialist: String, CaseIterable, Sendable {
- case coordinator, engineering, copy, research, checks, review, design
- public init(category: String) { self = Specialist(rawValue: category.lowercased()) ?? .coordinator }
- public var name: String {
- switch self {
- case .coordinator: return String(localized: "specialist.coordinator", bundle: .module)
- case .engineering: return String(localized: "specialist.engineering", bundle: .module)
- case .copy: return String(localized: "specialist.copy", bundle: .module)
- case .research: return String(localized: "specialist.research", bundle: .module)
- case .checks: return String(localized: "specialist.checks", bundle: .module)
- case .review: return String(localized: "specialist.review", bundle: .module)
- case .design: return String(localized: "specialist.design", bundle: .module)
- }
- }
- /// SF Symbols, matching the web's icons (wrench, type, search).
- public var symbol: String {
- switch self {
- case .coordinator: return "sparkle"
- case .engineering: return "wrench.adjustable"
- case .copy: return "textformat"
- case .research: return "magnifyingglass"
- case .checks: return "checklist.checked"
- case .review: return "checkmark.shield"
- case .design: return "paintbrush.pointed"
- }
- }
-}
-
-public enum StageTone: String, Sendable { case positive, warning, negative }
-
public struct RosterByline: Sendable, Equatable {
public var who: Specialist
public var verb: String
@@ -52,33 +22,6 @@ public struct RosterByline: Sendable, Equatable {
// MARK: - Stages
-public enum Stage: String, CaseIterable, Sendable {
- case noted, inProgress = "in_progress", inReview = "in_review", readyToMerge = "ready_to_merge", done
- public init?(wire: String) {
- switch wire {
- case "merging": self = .readyToMerge
- case "investigated": self = .noted
- default: self.init(rawValue: wire)
- }
- }
- public var label: String {
- switch self {
- case .noted: return String(localized: "stage.noted", bundle: .module)
- case .inProgress: return String(localized: "stage.in_progress", bundle: .module)
- case .inReview: return String(localized: "stage.in_review", bundle: .module)
- case .readyToMerge: return String(localized: "stage.ready_to_merge", bundle: .module)
- case .done: return String(localized: "stage.done", bundle: .module)
- }
- }
-}
-public enum StopState: Sendable { case done, current, todo }
-public struct TrackStop: Identifiable, Sendable {
- public var stage: Stage
- public var state: StopState
- public var tone: StageTone?
- public var id: String { stage.rawValue }
-}
-
public struct RosterFact: Identifiable, Sendable, Equatable {
public var label: String
public var value: String
@@ -108,12 +51,7 @@ public struct TaskReport: Sendable, Equatable {
return stage?.label ?? task.stage
}
/// chat_roster.go rosterTrack: five stops, merging sits on Ready to merge.
- public var track: [TrackStop] {
- let current = Stage.allCases.firstIndex(of: stage ?? .noted) ?? 0
- return Stage.allCases.enumerated().map { i, s in
- TrackStop(stage: s, state: i < current ? .done : i == current ? .current : .todo, tone: i == current ? tone : nil)
- }
- }
+ public var track: [TrackStop] { Stage.track(at: stage, tone: tone) }
/// The specialist reporting now: the running or last finished step.
public var specialist: Specialist {
let steps = task.steps ?? []
@@ -197,7 +135,8 @@ public enum FeedItem: Identifiable, Sendable {
public enum Feed {
/// The conversation in time order, as Roster lays it out.
@MainActor public static func build(_ session: EquipoSession) -> [FeedItem] {
- let deciding = Set(session.cards.filter { $0.isOpen && $0.kind != "task" && !$0.taskId.isEmpty }.map(\.taskId))
+ // A card set aside no longer holds its report to one line (chat_roster.go).
+ let deciding = Set(session.cards.filter { $0.isOpen && !$0.isAside && $0.kind != "task" && !$0.taskId.isEmpty }.map(\.taskId))
var timed: [(Date, Int, FeedItem)] = []
for (i, m) in session.messages.enumerated() {
timed.append((m.createdAt, i, m.isOwn ? .own(m) : .coordinator(m)))
@@ -250,6 +189,31 @@ public enum Feed {
}
}
+ /// A set-aside card's one line, as chat_roster.go AsideTitle: its
+ /// task's title, else its name, else what kind of card it is.
+ public static func asideTitle(_ card: ThinCard, task: ThinTask?) -> String {
+ if let title = task?.title, !title.isEmpty { return title }
+ if !card.name.isEmpty { return card.name }
+ return card.kind == "question" ? EquipoStrings.text("roster.question") : EquipoStrings.text("roster.decision")
+ }
+
+ /// Set aside and Undo are offered on a card that still waits on the
+ /// person (chat_roster.go Interactive): never a receipt or a report.
+ public static func canSetAside(_ card: ThinCard) -> Bool {
+ card.isOpen && card.kind != "task" && !isReceipt(card)
+ }
+
+ /// Needs you, with the tasks whose every open card is set aside under
+ /// Set aside. They still wait on the person and still count.
+ public static func needsGroups(needs: [ThinTask], cards: [ThinCard]) -> (waiting: [ThinTask], setAside: [ThinTask]) {
+ var waiting: [ThinTask] = [], setAside: [ThinTask] = []
+ for task in needs {
+ let open = cards.filter { $0.taskId == task.id && canSetAside($0) }
+ if !open.isEmpty && open.allSatisfy(\.isAside) { setAside.append(task) } else { waiting.append(task) }
+ }
+ return (waiting, setAside)
+ }
+
/// A receipt is a line, not a decision: a project added, a home set.
static func isReceipt(_ card: ThinCard) -> Bool {
card.kind == "project" || (card.kind == "home" && card.state != "ask")
diff --git a/native/apple/Sources/EquipoKit/Push/LiveActivities.swift b/native/apple/Sources/EquipoKit/Push/LiveActivities.swift
new file mode 100644
index 00000000..d8d0097b
--- /dev/null
+++ b/native/apple/Sources/EquipoKit/Push/LiveActivities.swift
@@ -0,0 +1,115 @@
+import Foundation
+#if os(iOS)
+import ActivityKit
+#endif
+
+/// What the app does with task Live Activities itself. It never starts one:
+/// the server does, by push-to-start, for at most three tasks a person
+/// started (D3), inside Apple's limits. The app only ends what is left over.
+public enum LiveActivityPolicy {
+ /// Activities whose task the app knows has ended, with the outcome to
+ /// end them on: the server's end push may have been dropped, and an
+ /// ended task must not stay on the Lock Screen.
+ public static func finished(running: [String], tasks: [ThinTask]) -> [String: String] {
+ var out: [String: String] = [:]
+ for task in tasks where running.contains(task.id) {
+ switch task.stage {
+ case "done": out[task.id] = "done"
+ case "cancelled": out[task.id] = "cancelled"
+ default: break
+ }
+ }
+ return out
+ }
+}
+
+#if os(iOS)
+/// Follows this device's task Live Activities: the push-to-start token for
+/// the device's registration, and each running activity's own token for
+/// the server's updates. Started at launch, so an activity the server
+/// started while the app was not running gets its token sent when the
+/// system wakes the app for it.
+@MainActor
+public final class LiveActivities {
+ private let registrar: PushRegistrar
+ private var observed: Set<String> = []
+ private var observers: [Task<Void, Never>] = []
+ private var started = false
+
+ public init(registrar: PushRegistrar) {
+ self.registrar = registrar
+ // A task the server says is over (409 task_ended, or not this
+ // person's) leaves the Lock Screen at once.
+ registrar.onActivityClosed = { task in Task { await Self.end(task: task) } }
+ // A new session: observers deliver their tokens again, for it.
+ registrar.onSessionChanged = { [weak self] in self?.reobserve() }
+ }
+
+ private func reobserve() {
+ observers.forEach { $0.cancel() }
+ observers = []; observed = []
+ guard started else { return }
+ for activity in Activity<EquipoTaskAttributes>.activities { observe(activity) }
+ }
+
+ public func start() {
+ guard !started else { return }
+ started = true
+ let registrar = self.registrar
+ Task {
+ for await token in Activity<EquipoTaskAttributes>.pushToStartTokenUpdates { await registrar.startTokenChanged(token) }
+ }
+ for activity in Activity<EquipoTaskAttributes>.activities { observe(activity) }
+ Task { [weak self] in
+ for await activity in Activity<EquipoTaskAttributes>.activityUpdates { self?.observe(activity) }
+ }
+ }
+
+ private func observe(_ activity: Activity<EquipoTaskAttributes>) {
+ guard observed.insert(activity.id).inserted else { return }
+ let registrar = self.registrar
+ let task = activity.attributes.taskID
+ let tokens = activity.pushTokenUpdates
+ let states = activity.activityStateUpdates
+ let origin = activity.attributes.origin
+ observers.append(Task {
+ for await token in tokens {
+ if Task.isCancelled { return }
+ await registrar.activityTokenChanged(token, task: task, origin: origin)
+ }
+ })
+ Task {
+ for await state in states where state == .ended || state == .dismissed {
+ registrar.activityEnded(task: task)
+ break
+ }
+ }
+ }
+
+ /// Ends the activities of tasks this device knows have ended.
+ nonisolated public func endFinished(_ tasks: [ThinTask]) async {
+ let running = Activity<EquipoTaskAttributes>.activities
+ let finished = LiveActivityPolicy.finished(running: running.map(\.attributes.taskID), tasks: tasks)
+ for activity in running {
+ guard let outcome = finished[activity.attributes.taskID] else { continue }
+ var state = activity.content.state
+ state.outcome = outcome
+ if outcome == "done" { state.stage = "done" }
+ state.needsYou = ""
+ await activity.end(ActivityContent(state: state, staleDate: nil), dismissalPolicy: .default)
+ }
+ }
+
+ /// One task's activity, ended because the server will never update it.
+ nonisolated static func end(task: String) async {
+ for activity in Activity<EquipoTaskAttributes>.activities where activity.attributes.taskID == task {
+ await activity.end(nil, dismissalPolicy: .immediate)
+ }
+ }
+
+ /// Signed out: no task of that team stays on this device.
+ nonisolated public func endAll() async {
+ for activity in Activity<EquipoTaskAttributes>.activities { await activity.end(nil, dismissalPolicy: .immediate) }
+ }
+}
+#endif
diff --git a/native/apple/Sources/EquipoKit/Push/Notifications.swift b/native/apple/Sources/EquipoKit/Push/Notifications.swift
new file mode 100644
index 00000000..23b802bb
--- /dev/null
+++ b/native/apple/Sources/EquipoKit/Push/Notifications.swift
@@ -0,0 +1,111 @@
+import Foundation
+import UserNotifications
+#if os(iOS)
+import UIKit
+#else
+import AppKit
+#endif
+
+/// What the app model needs from the system's notifications. The apps use
+/// `SystemNotifications`; tests use a fake.
+@MainActor
+public protocol NotificationSystem: AnyObject {
+ /// Asks to show alerts, badges and sounds (the system asks only once),
+ /// then registers with APNs for this device's token.
+ func askAndRegister()
+ /// The app icon's badge: the person's Needs you count.
+ func setBadge(_ count: Int)
+ /// Signed out: stop receiving pushes at all, and clear what was shown,
+ /// whether or not the server heard of the sign-out.
+ func unregister()
+}
+
+/// Asking for permission, then registering with APNs, so that a sign-out
+/// while the permission prompt is still open is never undone by it: each
+/// request is stamped, and `stop` makes every earlier one stale.
+@MainActor
+public final class RemoteRegistration {
+ private let authorize: @MainActor () async -> Void
+ private let register: @MainActor () -> Void
+ private let unregister: @MainActor () -> Void
+ private var stamp = 0
+ public init(authorize: @escaping @MainActor () async -> Void, register: @escaping @MainActor () -> Void, unregister: @escaping @MainActor () -> Void) {
+ self.authorize = authorize; self.register = register; self.unregister = unregister
+ }
+ /// Stamped now, before any waiting: a sign-out straight after this
+ /// call already makes it stale, even if its work has not started.
+ @discardableResult
+ public func request() -> Task<Void, Never> {
+ stamp += 1
+ let mine = stamp
+ return Task { @MainActor in
+ guard mine == self.stamp else { return }
+ await self.authorize()
+ guard mine == self.stamp else { return }
+ self.register()
+ }
+ }
+ public func stop() {
+ stamp += 1
+ unregister()
+ }
+}
+
+/// UNUserNotificationCenter and APNs registration, for both apps. Alerts
+/// that wait on you have the category `needs_you`, with no actions: a
+/// notification opens the app, and you answer there (D4).
+@MainActor
+public final class SystemNotifications: NSObject, NotificationSystem, UNUserNotificationCenterDelegate {
+ public static let needsYouCategory = "needs_you"
+ /// Called with where a tapped notification goes.
+ public var onRoute: ((PushRoute) -> Void)?
+ private let remote = RemoteRegistration(
+ authorize: { _ = try? await UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) },
+ register: {
+ #if os(iOS)
+ UIApplication.shared.registerForRemoteNotifications()
+ #else
+ NSApplication.shared.registerForRemoteNotifications()
+ #endif
+ },
+ unregister: {
+ let center = UNUserNotificationCenter.current()
+ center.removeAllDeliveredNotifications()
+ center.removeAllPendingNotificationRequests()
+ #if os(iOS)
+ UIApplication.shared.unregisterForRemoteNotifications()
+ #else
+ NSApplication.shared.unregisterForRemoteNotifications()
+ #endif
+ })
+
+ public override init() {
+ super.init()
+ let center = UNUserNotificationCenter.current()
+ center.delegate = self
+ center.setNotificationCategories([UNNotificationCategory(identifier: Self.needsYouCategory, actions: [], intentIdentifiers: [])])
+ }
+
+ public func askAndRegister() {
+ remote.request()
+ }
+
+ public func setBadge(_ count: Int) {
+ UNUserNotificationCenter.current().setBadgeCount(max(0, count))
+ }
+
+ public func unregister() { remote.stop() }
+
+ /// In front, a card or a finished task still shows; a reply goes to the
+ /// list only, since the conversation is right there.
+ public nonisolated func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification) async -> UNNotificationPresentationOptions {
+ let route = PushRoute(userInfo: notification.request.content.userInfo)
+ return route == .conversation ? [.list, .badge] : [.banner, .list, .sound, .badge]
+ }
+
+ public nonisolated func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse) async {
+ guard response.actionIdentifier == UNNotificationDefaultActionIdentifier,
+ let route = PushRoute(userInfo: response.notification.request.content.userInfo) else { return }
+ await MainActor.run { self.onRoute?(route) }
+ }
+}
diff --git a/native/apple/Sources/EquipoKit/Push/PhoneDelegate.swift b/native/apple/Sources/EquipoKit/Push/PhoneDelegate.swift
new file mode 100644
index 00000000..7a52911a
--- /dev/null
+++ b/native/apple/Sources/EquipoKit/Push/PhoneDelegate.swift
@@ -0,0 +1,28 @@
+#if os(iOS)
+import UIKit
+
+/// The iPhone app's delegate: APNs hands the device token here, and the
+/// notification centre and Live Activities are set up before the first
+/// screen, so a tap that launched the app, or an activity the server
+/// started while it was closed, is not missed.
+@MainActor
+public final class EquipoPhoneDelegate: NSObject, UIApplicationDelegate {
+ public let notifications = SystemNotifications()
+ public private(set) lazy var model = EquipoAppModel(notifications: notifications)
+
+ public func application(_ application: UIApplication, didFinishLaunchingWithOptions options: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
+ notifications.onRoute = { [weak self] route in self?.model.open(route) }
+ model.liveActivities.start()
+ return true
+ }
+
+ public func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
+ let push = model.push
+ Task { await push.deviceTokenChanged(deviceToken) }
+ }
+
+ /// No token (no network, or a build that cannot receive pushes): the
+ /// app works as before, and asks again at the next launch.
+ public func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {}
+}
+#endif
diff --git a/native/apple/Sources/EquipoKit/Push/PushEnvironment.swift b/native/apple/Sources/EquipoKit/Push/PushEnvironment.swift
new file mode 100644
index 00000000..2f17dc78
--- /dev/null
+++ b/native/apple/Sources/EquipoKit/Push/PushEnvironment.swift
@@ -0,0 +1,63 @@
+import Foundation
+#if os(macOS)
+import Security
+#endif
+
+/// Which APNs gateway this build's tokens belong to, read from the build
+/// itself, never guessed: a token sent to the wrong gateway is refused with
+/// BadDeviceToken and the server then deletes the registration.
+///
+/// - iPhone, App Store and TestFlight: Apple strips the provisioning profile
+/// from the bundle and the distribution signature carries
+/// `aps-environment` production. No embedded profile means production.
+/// - iPhone, an Xcode build on a device: the embedded development profile
+/// says `aps-environment` development.
+/// - iPhone Simulator: development (the Simulator registers with the sandbox).
+/// - Mac: the signature's own `com.apple.developer.aps-environment`. A
+/// Developer ID app is production; an ad hoc build has none and cannot
+/// receive pushes, so it does not register.
+///
+/// Equipo's APNs key is production only (CARLOS platform push, D1): a
+/// development build registers honestly as development, and the server's
+/// sender cannot reach it.
+public enum PushEnvironment {
+ public static func resolve(platform: PushPlatform, simulator: Bool, embeddedProfile: Data?, signedEntitlement: String?) -> APNsEnvironment? {
+ switch platform {
+ case .macos:
+ return signedEntitlement.flatMap(APNsEnvironment.init(rawValue:))
+ case .ios:
+ if simulator { return .development }
+ guard let embeddedProfile else { return .production }
+ return apsEnvironment(inProfile: embeddedProfile).flatMap(APNsEnvironment.init(rawValue:))
+ }
+ }
+
+ /// The `aps-environment` a provisioning profile grants: its property
+ /// list sits inside a CMS envelope.
+ public static func apsEnvironment(inProfile data: Data) -> String? {
+ guard let start = data.range(of: Data("<?xml".utf8)),
+ let end = data.range(of: Data("</plist>".utf8), in: start.lowerBound..<data.endIndex),
+ let plist = try? PropertyListSerialization.propertyList(from: data[start.lowerBound..<end.upperBound], format: nil) as? [String: Any],
+ let entitlements = plist["Entitlements"] as? [String: Any] else { return nil }
+ return (entitlements["aps-environment"] ?? entitlements["com.apple.developer.aps-environment"]) as? String
+ }
+
+ /// This running build's gateway, or nil when it cannot receive pushes.
+ public static var current: APNsEnvironment? {
+ #if os(iOS)
+ #if targetEnvironment(simulator)
+ let simulator = true
+ #else
+ let simulator = false
+ #endif
+ let profile = Bundle.main.url(forResource: "embedded", withExtension: "mobileprovision").flatMap { try? Data(contentsOf: $0) }
+ return resolve(platform: .ios, simulator: simulator, embeddedProfile: profile, signedEntitlement: nil)
+ #else
+ var value: String?
+ if let task = SecTaskCreateFromSelf(nil) {
+ value = SecTaskCopyValueForEntitlement(task, "com.apple.developer.aps-environment" as CFString, nil) as? String
+ }
+ return resolve(platform: .macos, simulator: false, embeddedProfile: nil, signedEntitlement: value)
+ #endif
+ }
+}
diff --git a/native/apple/Sources/EquipoKit/Push/PushRegistrar.swift b/native/apple/Sources/EquipoKit/Push/PushRegistrar.swift
new file mode 100644
index 00000000..9743851b
--- /dev/null
+++ b/native/apple/Sources/EquipoKit/Push/PushRegistrar.swift
@@ -0,0 +1,151 @@
+import Foundation
+
+/// Keeps the server's push registration for this device current: the APNs
+/// token, its gateway, and on iPhone the Live Activity push-to-start token,
+/// sent with the paired device's bearer; then each running Live Activity's
+/// own token. Something is sent again when it changes, when another team's
+/// session takes over, or after it could not be sent (on the next `sync`,
+/// when the app comes to the front). Tokens are never logged.
+@MainActor
+public final class PushRegistrar {
+ public let environment: APNsEnvironment?
+ public let platform: PushPlatform
+ public private(set) var deviceToken: String?
+ public private(set) var startToken: String?
+
+ private var client: EquipoClient?
+ /// The registration the current session's server has, by bearer.
+ private var accepted: (bearer: String, body: PushRegistrationBody)?
+ /// A registration the server refused as invalid: not sent again as is.
+ private var refused: (bearer: String, body: PushRegistrationBody)?
+ /// Each running Live Activity's token, by task, with the origin of the
+ /// instance that started it; and which of them the current session's
+ /// server has. A token goes only to the account at its own origin.
+ private var activities: [String: (origin: String, token: String)] = [:]
+ private var acceptedActivities: [String: String] = [:]
+ /// Tasks the server says are over or not this person's: their tokens are not sent again.
+ private var closedActivities: [String: String] = [:]
+ private var running = false
+ private var again = false
+ /// Moves on with every change of session: a pass that was waiting on the
+ /// network when the session changed sends nothing more and records nothing.
+ public private(set) var generation = 0
+ /// Called when the session changes, so activity observers deliver
+ /// their tokens again for the new session.
+ public var onSessionChanged: (() -> Void)?
+ /// Called with a task whose activity the server will never take (it
+ /// ended, or is not this person's): the app ends it on this device.
+ public var onActivityClosed: ((String) -> Void)?
+
+ public init(environment: APNsEnvironment? = PushEnvironment.current, platform: PushPlatform = .current) {
+ self.environment = environment; self.platform = platform
+ }
+
+ /// The paired session's client, or nil once there is none. A new one
+ /// is a new credential: everything is registered with it again.
+ public func attach(_ client: EquipoClient?) async {
+ if client?.token != self.client?.token {
+ generation += 1
+ // Another session (another team, a new credential, or none): it
+ // keeps only the activities its own instance started. At launch
+ // that is every activity seen before the session was restored.
+ if let account = client?.origin {
+ activities = activities.filter { Self.same($0.value.origin, account) }
+ } else {
+ activities = [:]
+ }
+ acceptedActivities = [:]; closedActivities = [:]
+ self.client = client
+ onSessionChanged?()
+ }
+ self.client = client
+ await sync()
+ }
+
+ public func deviceTokenChanged(_ token: Data) async {
+ deviceToken = PushToken.hex(token)
+ await sync()
+ }
+ /// iPhone only: the token the server starts a Live Activity with.
+ public func startTokenChanged(_ token: Data) async {
+ guard platform == .ios else { return }
+ startToken = PushToken.hex(token)
+ await sync()
+ }
+ /// A running Live Activity's own token, for the server's updates, from
+ /// the instance at `origin` (the activity's attributes). An activity
+ /// that names no origin is never sent anywhere.
+ public func activityTokenChanged(_ token: Data, task: String, origin: String?) async {
+ guard let origin else { return }
+ activities[task] = (origin, PushToken.hex(token))
+ await sync()
+ }
+
+ /// Whether an activity's origin is this account's: scheme, host and port.
+ static func same(_ origin: String, _ account: URL) -> Bool {
+ guard let o = URL(string: origin), let scheme = o.scheme?.lowercased(), let host = o.host?.lowercased() else { return false }
+ return scheme == account.scheme?.lowercased() && host == account.host?.lowercased() && o.port == account.port
+ }
+ /// The activity ended on this device: nothing more to send for it.
+ public func activityEnded(task: String) {
+ activities[task] = nil; acceptedActivities[task] = nil; closedActivities[task] = nil
+ }
+
+ /// The registration this device needs: none before the APNs token, or
+ /// when this build cannot receive pushes at all.
+ public var body: PushRegistrationBody? {
+ guard let deviceToken, let environment else { return nil }
+ return PushRegistrationBody(token: deviceToken, environment: environment, platform: platform, startToken: startToken)
+ }
+
+ /// Sends whatever the server does not have yet. One pass at a time; a
+ /// change during a pass is sent by one more pass after it.
+ public func sync() async {
+ if running { again = true; return }
+ running = true
+ defer { running = false }
+ repeat {
+ again = false
+ await pass()
+ } while again
+ }
+
+ private func pass() async {
+ guard let client, let bearer = client.token else { return }
+ let generation = self.generation
+ if let body, !(accepted?.bearer == bearer && accepted?.body == body), !(refused?.bearer == bearer && refused?.body == body) {
+ do {
+ let write = try PendingWrite.json(body)
+ _ = try await client.registerPush(write)
+ guard generation == self.generation else { return }
+ accepted = (bearer, body)
+ } catch let error as EquipoAPIError {
+ guard generation == self.generation else { return }
+ // A refusal is final for this body; anything else waits for the next sync.
+ if let status = error.status, status == 400 || status == 422 { refused = (bearer, body) }
+ return
+ } catch { return }
+ }
+ // Activity tokens need the device's registration first.
+ guard accepted?.bearer == bearer else { return }
+ for (task, token) in activities.sorted(by: { $0.key < $1.key })
+ .filter({ Self.same($0.value.origin, client.origin) }).map({ ($0.key, $0.value.token) })
+ where acceptedActivities[task] != token && closedActivities[task] != token {
+ guard generation == self.generation else { return }
+ do {
+ try await client.registerActivity(try PendingWrite.json(ActivityTokenBody(taskId: task, token: token)))
+ guard generation == self.generation else { return }
+ acceptedActivities[task] = token
+ } catch let error as EquipoAPIError {
+ guard generation == self.generation else { return }
+ // Ended, or not this person's task: the server will never take it,
+ // and the activity ends here too.
+ if error.status == 404 || error.status == 409 || error.status == 400 {
+ closedActivities[task] = token
+ onActivityClosed?(task)
+ }
+ else { return }
+ } catch { return }
+ }
+ }
+}
diff --git a/native/apple/Sources/EquipoKit/Push/PushRoute.swift b/native/apple/Sources/EquipoKit/Push/PushRoute.swift
new file mode 100644
index 00000000..a077cd56
--- /dev/null
+++ b/native/apple/Sources/EquipoKit/Push/PushRoute.swift
@@ -0,0 +1,56 @@
+import Foundation
+
+/// Where a tapped notification or Live Activity takes the person (D4: a
+/// notification only opens the app; nothing is answered from it). Read from
+/// the alert's `equipo` object (wire.PushData) or the app's own link.
+public enum PushRoute: Equatable, Sendable {
+ /// A card waits on you: the conversation, at that card.
+ case card(String)
+ /// The coordinator replied: the conversation.
+ case conversation
+ /// A task finished, stopped or is running: the task view.
+ case task(String)
+
+ /// The alert's routing data; nil for a badge, or anything unknown.
+ public init?(userInfo: [AnyHashable: Any]) {
+ guard let data = userInfo["equipo"] as? [String: Any], let kind = data["kind"] as? String else { return nil }
+ func id(_ key: String) -> String? { (data[key] as? String).flatMap { $0.isEmpty ? nil : $0 } }
+ switch kind {
+ case "card":
+ // A card the device cannot place still opens beside its task.
+ if let card = id("card_id") { self = .card(card) } else if let task = id("task_id") { self = .task(task) } else { return nil }
+ case "reply": self = .conversation
+ case "task":
+ guard let task = id("task_id") else { return nil }
+ self = .task(task)
+ default: return nil
+ }
+ }
+
+ /// A Live Activity's link (EquipoLink).
+ public init?(url: URL) {
+ guard let task = EquipoLink.taskID(from: url) else { return nil }
+ self = .task(task)
+ }
+
+ /// The screen it opens.
+ public var destination: Destination {
+ switch self {
+ case .card(let id): return Destination(pane: .conversation, cardID: id)
+ case .conversation: return Destination(pane: .conversation)
+ case .task(let id): return Destination(pane: .tasks, taskID: id)
+ }
+ }
+}
+
+/// A screen in the app: a pane (a tab on iPhone, the sidebar on the Mac),
+/// and the card to bring into view or the task to open in it.
+public struct Destination: Equatable, Sendable {
+ public enum Pane: Hashable, Sendable { case conversation, needs, tasks }
+ public var pane: Pane
+ public var cardID: String?
+ public var taskID: String?
+ public init(pane: Pane, cardID: String? = nil, taskID: String? = nil) {
+ self.pane = pane; self.cardID = cardID; self.taskID = taskID
+ }
+}
diff --git a/native/apple/Sources/EquipoKit/Resources/Brand.xcassets/AppMark.imageset/AppMark.png b/native/apple/Sources/EquipoKit/Resources/Brand.xcassets/AppMark.imageset/AppMark.png
new file mode 100644
index 00000000..5a469556
Binary files /dev/null and b/native/apple/Sources/EquipoKit/Resources/Brand.xcassets/AppMark.imageset/AppMark.png differ
diff --git a/native/apple/Sources/EquipoKit/Resources/Brand.xcassets/AppMark.imageset/Contents.json b/native/apple/Sources/EquipoKit/Resources/Brand.xcassets/AppMark.imageset/Contents.json
new file mode 100644
index 00000000..c52405d7
--- /dev/null
+++ b/native/apple/Sources/EquipoKit/Resources/Brand.xcassets/AppMark.imageset/Contents.json
@@ -0,0 +1,4 @@
+{
+ "images" : [ { "filename" : "AppMark.png", "idiom" : "universal" } ],
+ "info" : { "author" : "xcode", "version" : 1 }
+}
diff --git a/native/apple/Sources/EquipoKit/Resources/Brand.xcassets/Contents.json b/native/apple/Sources/EquipoKit/Resources/Brand.xcassets/Contents.json
new file mode 100644
index 00000000..46cba7df
--- /dev/null
+++ b/native/apple/Sources/EquipoKit/Resources/Brand.xcassets/Contents.json
@@ -0,0 +1 @@
+{ "info" : { "author" : "xcode", "version" : 1 } }
diff --git a/native/apple/Sources/EquipoKit/Resources/Localizable.xcstrings b/native/apple/Sources/EquipoKit/Resources/Localizable.xcstrings
index 415c5a7b..3387547a 100644
--- a/native/apple/Sources/EquipoKit/Resources/Localizable.xcstrings
+++ b/native/apple/Sources/EquipoKit/Resources/Localizable.xcstrings
@@ -134,28 +134,6 @@
}
}
},
- "action.set_aside": {
- "extractionState": "manual",
- "localizations": {
- "en": {
- "stringUnit": {
- "state": "translated",
- "value": "Set aside"
- }
- }
- }
- },
- "action.setting_aside": {
- "extractionState": "manual",
- "localizations": {
- "en": {
- "stringUnit": {
- "state": "translated",
- "value": "Setting aside…"
- }
- }
- }
- },
"app.name": {
"extractionState": "manual",
"localizations": {
@@ -1201,6 +1179,83 @@
}
}
},
+ "roster.aside": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Set aside, still in Needs you"
+ }
+ }
+ }
+ },
+ "roster.decision": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Decision"
+ }
+ }
+ }
+ },
+ "roster.question": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Question"
+ }
+ }
+ }
+ },
+ "roster.restoring": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Restoring…"
+ }
+ }
+ }
+ },
+ "roster.set_aside": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Set aside"
+ }
+ }
+ }
+ },
+ "roster.setting_aside": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Setting aside…"
+ }
+ }
+ }
+ },
+ "roster.undo": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Undo"
+ }
+ }
+ }
+ },
"settings.not_paired": {
"extractionState": "manual",
"localizations": {
diff --git a/native/apple/Sources/EquipoKit/Session/EquipoSession.swift b/native/apple/Sources/EquipoKit/Session/EquipoSession.swift
index 99adb2fe..25ed5cf6 100644
--- a/native/apple/Sources/EquipoKit/Session/EquipoSession.swift
+++ b/native/apple/Sources/EquipoKit/Session/EquipoSession.swift
@@ -51,6 +51,8 @@ public final class EquipoSession {
/// Answers not yet known to have landed, by card, revision and choice:
/// another tap sends the same answer again, as itself.
private var unsettledAnswers: [String: PendingWrite] = [:]
+ /// Set aside and Undo not yet known to have landed, as answers are.
+ private var unsettledVisibility: [String: PendingWrite] = [:]
private let sleep: @Sendable (Duration) async throws -> Void
public init(account: DeviceAccount, accounts: DeviceAccounts, transport: EquipoTransport? = nil,
@@ -303,6 +305,34 @@ public final class EquipoSession {
}
}
+ /// Sets a card aside, or brings it back (Undo), bound to the revision
+ /// the person saw. It never answers, cancels or starts anything: the
+ /// card stays in Needs you. `.answered` means the server took it; a
+ /// card that changed is shown as it is now and never sent again.
+ public func setAside(_ card: ThinCard, _ aside: Bool) async -> AnswerOutcome {
+ guard Feed.canSetAside(card) else { return .changed }
+ let slot = "\(card.id)#\(card.revision)#\(aside)"
+ guard let write = unsettledVisibility[slot] ?? (try? EquipoClient.visibility(aside: aside, of: card)) else { return .failed }
+ unsettledVisibility[slot] = write
+ var attempts = 0
+ while true {
+ do {
+ let updated = try await client.setVisibility(card: card.id, write)
+ unsettledVisibility[slot] = nil
+ cards = Self.merge(cards, [updated])
+ return .answered
+ } catch let error as EquipoAPIError {
+ if error == .offline, attempts < 2 { attempts += 1; try? await sleep(.seconds(2)); continue }
+ // Offline: it may have landed; keep it to send again as itself.
+ if error != .offline { unsettledVisibility[slot] = nil }
+ if error.endsSession { endSession(); return .failed }
+ if case .card(_, _, let current) = error { cards = Self.merge(cards, [current]); return .changed }
+ if error.isStale { await refresh(); return .changed }
+ return error == .offline ? .offline : .failed
+ } catch { unsettledVisibility[slot] = nil; return .failed }
+ }
+ }
+
/// Stops the coordinator's turn in flight: that turn only.
/// Says whether the server took it; on false, Stop is offered again.
@discardableResult
diff --git a/native/apple/Sources/EquipoKit/UI/Components.swift b/native/apple/Sources/EquipoKit/UI/Components.swift
index 4c774987..8d37ae7f 100644
--- a/native/apple/Sources/EquipoKit/UI/Components.swift
+++ b/native/apple/Sources/EquipoKit/UI/Components.swift
@@ -73,13 +73,13 @@ struct StepsView: View {
}
}
}
+/// The app's own mark (estilo's Equipo icon, the chat bubble with two
+/// sparkles), as the web shows it.
struct AppGlyph: View {
var size: CGFloat = 38
var body: some View {
- RoundedRectangle(cornerRadius: size * 0.225, style: .continuous)
- .fill(LinearGradient(colors: [Color(light: 0x3A6FF0, dark: 0x3A6FF0), Color(light: 0x1A46B8, dark: 0x1A46B8)], startPoint: .top, endPoint: .bottom))
+ Image("AppMark", bundle: .module).resizable().interpolation(.high)
.frame(width: size, height: size)
- .overlay(Image(systemName: "bubble.left.and.bubble.right.fill").font(.system(size: size * 0.42, weight: .semibold)).foregroundStyle(.white))
.accessibilityHidden(true)
}
}
diff --git a/native/apple/Sources/EquipoKit/UI/LiveCards.swift b/native/apple/Sources/EquipoKit/UI/LiveCards.swift
index 0e9e052e..2cf8efae 100644
--- a/native/apple/Sources/EquipoKit/UI/LiveCards.swift
+++ b/native/apple/Sources/EquipoKit/UI/LiveCards.swift
@@ -10,14 +10,23 @@ struct LiveQuestionCard: View {
let session: EquipoSession
@State private var phase: Phase = .open
- enum Phase: Equatable { case open, sending(String), changed(at: Int64), offline, failed }
+ enum Phase: Equatable { case open, sending(String), settingAside, changed(at: Int64), offline, failed }
var body: some View {
+ if card.isAside {
+ AsideStub(card: card, title: Feed.asideTitle(card, task: session.task(card.taskId)), session: session)
+ } else {
+ raised
+ }
+ }
+
+ private var raised: some View {
RaisedCard(flat: !card.isOpen) {
if let taskTitle, !card.question.contains(taskTitle) {
Text(taskTitle).font(Typo.caption).foregroundStyle(Palette.secondary)
}
- CardHead(text: card.question.isEmpty ? String(localized: "card.question", bundle: .module) : card.question)
+ CardHead(text: card.question.isEmpty ? String(localized: "card.question", bundle: .module) : card.question,
+ aside: aside, settingAside: phase == .settingAside)
if card.isOpen {
choices
feedback
@@ -35,6 +44,10 @@ struct LiveQuestionCard: View {
}
private var isSending: Bool { if case .sending = phase { return true }; return false }
+ private var aside: (() -> Void)? {
+ guard Feed.canSetAside(card), !isSending, phase != .settingAside else { return nil }
+ return { Task { await setAside() } }
+ }
@ViewBuilder private var choices: some View {
let options = card.options ?? []
@@ -73,6 +86,17 @@ struct LiveQuestionCard: View {
case .failed: phase = .failed
}
}
+
+ private func setAside() async {
+ if isSending || phase == .settingAside { return }
+ phase = .settingAside
+ switch await session.setAside(card, true) {
+ case .answered: phase = .open
+ case .changed: phase = .changed(at: session.cards.first { $0.id == card.id }?.revision ?? card.revision)
+ case .offline: phase = .offline
+ case .failed: phase = .failed
+ }
+ }
}
/// A decision card. Merges and "Does main ship?" are answered here, in the
@@ -85,9 +109,22 @@ struct LiveDecisionCard: View {
@State private var phase: Phase = .open
@Environment(\.openURL) private var openURL
- enum Phase: Equatable { case open, sending(String), changed(at: Int64), offline, failed }
+ enum Phase: Equatable { case open, sending(String), settingAside, changed(at: Int64), offline, failed }
var body: some View {
+ if card.isAside {
+ AsideStub(card: card, title: Feed.asideTitle(card, task: session.task(card.taskId)), session: session)
+ } else {
+ raised
+ }
+ }
+
+ private var aside: (() -> Void)? {
+ guard Feed.canSetAside(card), phase == .open || phase == .offline || phase == .failed else { return nil }
+ return { Task { await setAside() } }
+ }
+
+ @ViewBuilder private var raised: some View {
let view = Feed.decision(card, task: session.task(card.taskId))
RaisedCard(flat: !(view?.open ?? card.isOpen)) {
if let taskTitle, !card.question.isEmpty, !card.question.contains(taskTitle) {
@@ -98,7 +135,8 @@ struct LiveDecisionCard: View {
Label { Text(note) } icon: { Image(systemName: "checkmark") }
.font(Typo.secondaryStrong).foregroundStyle(Palette.positive)
} else {
- CardHead(text: card.question.isEmpty ? (taskTitle ?? String(localized: "decision.untitled", bundle: .module)) : card.question)
+ CardHead(text: card.question.isEmpty ? (taskTitle ?? String(localized: "decision.untitled", bundle: .module)) : card.question,
+ aside: aside, settingAside: phase == .settingAside)
if let view {
answerable(view)
} else if card.isOpen {
@@ -112,6 +150,8 @@ struct LiveDecisionCard: View {
openURL(Feed.webURL(for: card, origin: session.origin))
}
}
+ // An answer's or a Set aside's outcome, on every decision card.
+ feedback
}
}
.accessibilityElement(children: .contain)
@@ -132,7 +172,6 @@ struct LiveDecisionCard: View {
HStack(spacing: 10) { buttons(view, sending: sending) }
VStack(spacing: 10) { buttons(view, sending: sending) }
}
- feedback
}
}
@@ -170,11 +209,76 @@ struct LiveDecisionCard: View {
}
}
+ private func setAside() async {
+ if phase != .open && phase != .offline && phase != .failed { return }
+ phase = .settingAside
+ switch await session.setAside(card, true) {
+ case .answered: phase = .open
+ case .changed:
+ phase = .changed(at: session.cards.first { $0.id == card.id }?.revision ?? card.revision)
+ announce(String(localized: "card.changed", bundle: .module))
+ case .offline: phase = .offline; announce(String(localized: "card.offline", bundle: .module))
+ case .failed: phase = .failed; announce(String(localized: "card.failed", bundle: .module))
+ }
+ }
+
private func announce(_ text: String) {
AccessibilityNotification.Announcement(text).post()
}
}
+/// A card set aside (chat.html equipo-aside-stub): one line naming it,
+/// "Set aside, still in Needs you", and Undo, which brings it back at the
+/// revision seen. It never answers, cancels or starts anything.
+struct AsideStub: View {
+ let card: ThinCard
+ let title: String
+ let session: EquipoSession
+ @State private var phase: Phase = .idle
+ enum Phase: Equatable { case idle, restoring, changed, offline, failed }
+
+ var body: some View {
+ let shape = RoundedRectangle(cornerRadius: Metric.raised - 4, style: .continuous)
+ VStack(alignment: .leading, spacing: 6) {
+ HStack(alignment: .center, spacing: 12) {
+ VStack(alignment: .leading, spacing: 2) {
+ Text(title).font(Typo.secondaryStrong).foregroundStyle(Palette.text).lineLimit(1).truncationMode(.tail)
+ Text(String(localized: "roster.aside", bundle: .module)).font(Typo.caption).foregroundStyle(Palette.secondary)
+ }
+ Spacer(minLength: 8)
+ RosterButton(title: String(localized: "roster.undo", bundle: .module),
+ busy: phase == .restoring ? String(localized: "roster.restoring", bundle: .module) : nil) {
+ Task { await undo() }
+ }
+ }
+ switch phase {
+ case .changed: Text(String(localized: "card.changed", bundle: .module)).font(Typo.secondary).foregroundStyle(Palette.negative)
+ case .offline: Text(String(localized: "card.offline", bundle: .module)).font(Typo.secondary).foregroundStyle(Palette.negative)
+ case .failed: Text(String(localized: "card.failed", bundle: .module)).font(Typo.secondary).foregroundStyle(Palette.negative)
+ default: EmptyView()
+ }
+ }
+ .padding(.horizontal, 14).padding(.vertical, 10)
+ .background(Palette.surface2, in: shape)
+ .overlay(shape.strokeBorder(Palette.border, lineWidth: 1))
+ .accessibilityElement(children: .contain)
+ }
+
+ private func undo() async {
+ if phase == .restoring { return }
+ phase = .restoring
+ let outcome = await session.setAside(card, false)
+ let said: String?
+ switch outcome {
+ case .answered: phase = .idle; said = nil
+ case .changed: phase = .changed; said = String(localized: "card.changed", bundle: .module)
+ case .offline: phase = .offline; said = String(localized: "card.offline", bundle: .module)
+ case .failed: phase = .failed; said = String(localized: "card.failed", bundle: .module)
+ }
+ if let said { AccessibilityNotification.Announcement(said).post() }
+ }
+}
+
/// A task report on its rail: eyebrow, title, the five-stop track and the
/// facts; one line while its decision is open beside it.
public struct LiveReport: View {
diff --git a/native/apple/Sources/EquipoKit/UI/RosterViews.swift b/native/apple/Sources/EquipoKit/UI/RosterViews.swift
index 2474ef33..9af085c9 100644
--- a/native/apple/Sources/EquipoKit/UI/RosterViews.swift
+++ b/native/apple/Sources/EquipoKit/UI/RosterViews.swift
@@ -324,7 +324,7 @@ struct SetAsideButton: View {
Button(action: action) {
Group {
if busy {
- Text(String(localized: "action.setting_aside", bundle: .module)).font(Typo.caption).padding(.horizontal, 8)
+ Text(String(localized: "roster.setting_aside", bundle: .module)).font(Typo.caption).padding(.horizontal, 8)
} else {
Image(systemName: "xmark").font(.system(size: 13, weight: .semibold)).frame(width: 36, height: 36)
}
@@ -341,8 +341,8 @@ struct SetAsideButton: View {
}
.buttonStyle(.plain).onHover { hovering = $0 }
.disabled(busy)
- .accessibilityLabel(Text(String(localized: "action.set_aside", bundle: .module)))
- .help(Text(String(localized: "action.set_aside", bundle: .module)))
+ .accessibilityLabel(Text(String(localized: "roster.set_aside", bundle: .module)))
+ .help(Text(String(localized: "roster.set_aside", bundle: .module)))
}
}
/// Only things that need you are raised: a surface, a rim and a soft shadow.
diff --git a/native/apple/Sources/EquipoKit/UI/Screens/AppModel.swift b/native/apple/Sources/EquipoKit/UI/Screens/AppModel.swift
index 4c708bc4..dca5a66d 100644
--- a/native/apple/Sources/EquipoKit/UI/Screens/AppModel.swift
+++ b/native/apple/Sources/EquipoKit/UI/Screens/AppModel.swift
@@ -3,7 +3,9 @@ import Observation
import RastrilloApple
/// The app's state above any one screen: the paired team, if any, its
-/// session, and pairing when there is none.
+/// session, and pairing when there is none; and its pushes: permission is
+/// asked once there is a team, never before, and the registration follows
+/// the session.
@MainActor @Observable
public final class EquipoAppModel {
public let accounts: DeviceAccounts
@@ -11,12 +13,31 @@ public final class EquipoAppModel {
public let pairing: PairingModel
/// Set when the server ended the session, so pairing can say why.
public private(set) var endedTeam: String?
+ /// Where a tapped notification or Live Activity asked to go, until the
+ /// screens have gone there.
+ public var destination: Destination?
- public init(store: SecretStore = KeychainSecretStore()) {
+ @ObservationIgnored public let push: PushRegistrar
+ @ObservationIgnored let notifications: NotificationSystem?
+ #if os(iOS)
+ @ObservationIgnored public let liveActivities: LiveActivities
+ #endif
+
+ public init(store: SecretStore = KeychainSecretStore(), notifications: NotificationSystem? = nil,
+ push: PushRegistrar = PushRegistrar()) {
accounts = DeviceAccounts(store: store)
pairing = PairingModel(accounts: accounts)
+ self.notifications = notifications
+ self.push = push
+ #if os(iOS)
+ liveActivities = LiveActivities(registrar: push)
+ #endif
if let account = accounts.all().first(where: { $0.isUsable() }) {
+ // Written again so a slice 1 credential becomes readable after
+ // first unlock, for Live Activity tokens sent in the background.
+ try? accounts.save(account)
session = EquipoSession(account: account, accounts: accounts)
+ sessionStarted()
}
}
@@ -25,16 +46,31 @@ public final class EquipoAppModel {
/// After pairing approves this device.
public func paired() {
guard let account = pairing.account else { return }
- endedTeam = nil
- session = EquipoSession(account: account, accounts: accounts)
+ adopt(account)
foreground()
}
+ func adopt(_ account: DeviceAccount, transport: EquipoTransport? = nil) {
+ endedTeam = nil
+ session = EquipoSession(account: account, accounts: accounts, transport: transport)
+ sessionStarted()
+ }
+
+ /// There is a team: ask to notify (the system asks once), register with
+ /// APNs, and register this device with the team's server.
+ private func sessionStarted() {
+ notifications?.askAndRegister()
+ let client = session?.client
+ let push = self.push
+ Task { await push.attach(client) }
+ }
+
/// The server ended the session (revoked, removed or expired): pair again.
public func sessionEnded() {
endedTeam = session?.teamName
session = nil
pairing.cancel()
+ forgetPushes()
}
public func signOut() async {
@@ -42,10 +78,36 @@ public final class EquipoAppModel {
session = nil
endedTeam = nil
pairing.cancel()
+ forgetPushes()
+ }
+
+ /// No team: nothing more is registered, no badge, no task on the Lock Screen.
+ private func forgetPushes() {
+ let push = self.push
+ Task { await push.attach(nil) }
+ notifications?.setBadge(0)
+ // Even if the server never heard of the sign-out, this device stops
+ // receiving the team's notifications; pairing again registers anew.
+ notifications?.unregister()
+ #if os(iOS)
+ let live = liveActivities
+ Task { await live.endAll() }
+ #endif
+ }
+
+ /// Where a tapped notification or Live Activity goes.
+ public func open(_ route: PushRoute) { destination = route.destination }
+
+ /// The app badge is the Needs you count, once known: unknown is not zero.
+ public func needsYouChanged(_ count: Int?) {
+ guard let count, session != nil else { return }
+ notifications?.setBadge(count)
}
public func foreground() {
NativeConnectivity.shared.foregrounded()
+ let push = self.push
+ Task { await push.sync() }
guard let session else { return }
session.startLive()
}
diff --git a/native/apple/Sources/EquipoKit/UI/Screens/ConversationScreen.swift b/native/apple/Sources/EquipoKit/UI/Screens/ConversationScreen.swift
index eaf354e0..0ce30bae 100644
--- a/native/apple/Sources/EquipoKit/UI/Screens/ConversationScreen.swift
+++ b/native/apple/Sources/EquipoKit/UI/Screens/ConversationScreen.swift
@@ -6,8 +6,12 @@ import SwiftUI
/// in AppKit.
public struct ConversationScreen: View {
let session: EquipoSession
+ /// A card to bring into view (a tapped notification); cleared once shown.
+ @Binding var focus: String?
var openTask: (String) -> Void
- public init(session: EquipoSession, openTask: @escaping (String) -> Void) { self.session = session; self.openTask = openTask }
+ public init(session: EquipoSession, focus: Binding<String?> = .constant(nil), openTask: @escaping (String) -> Void) {
+ self.session = session; _focus = focus; self.openTask = openTask
+ }
public var body: some View {
let items = Feed.build(session)
@@ -29,7 +33,10 @@ public struct ConversationScreen: View {
}
.defaultScrollAnchor(.bottom)
.refreshable { await session.refresh() }
- .onChange(of: items.count) { _, _ in withAnimation { proxy.scrollTo("bottom", anchor: .bottom) } }
+ .onChange(of: items.count) { _, _ in
+ if focus != nil { show(focus, items, proxy) } else { withAnimation { proxy.scrollTo("bottom", anchor: .bottom) } }
+ }
+ .onChange(of: focus, initial: true) { _, id in show(id, items, proxy) }
}
.background(Palette.background)
.safeAreaInset(edge: .top, spacing: 0) { NativeOfflineBanner(origin: session.origin) }
@@ -40,6 +47,23 @@ public struct ConversationScreen: View {
}
}
+ /// Scrolls to the card once the feed has it; reads again if it does not yet.
+ private func show(_ id: String?, _ items: [FeedItem], _ proxy: ScrollViewProxy) {
+ guard let id else { return }
+ if items.contains(where: { $0.id == id }) {
+ Task { @MainActor in
+ withAnimation { proxy.scrollTo(id, anchor: .center) }
+ focus = nil
+ }
+ } else {
+ // Not in the feed yet: read again, and give up if it still is not.
+ Task { @MainActor in
+ await session.refresh()
+ if !Feed.build(session).contains(where: { $0.id == id }) { focus = nil }
+ }
+ }
+ }
+
@ViewBuilder private func row(_ item: FeedItem) -> some View {
switch item {
case .own(let m): OwnMessage(text: m.text)
diff --git a/native/apple/Sources/EquipoKit/UI/Screens/PairingView.swift b/native/apple/Sources/EquipoKit/UI/Screens/PairingView.swift
index b2002306..803b2d0b 100644
--- a/native/apple/Sources/EquipoKit/UI/Screens/PairingView.swift
+++ b/native/apple/Sources/EquipoKit/UI/Screens/PairingView.swift
@@ -55,6 +55,9 @@ public struct PairingView: View {
VStack(alignment: .leading, spacing: 6) {
Text(String(localized: "pairing.team_label", bundle: .module)).font(Typo.captionStrong).foregroundStyle(Palette.secondary)
TextField(String(localized: "pairing.team_placeholder", bundle: .module), text: $team)
+ // Plain: the rounded box below is the field's only outline (the
+ // Mac's default style drew a second one inside it).
+ .textFieldStyle(.plain)
.textContentType(.URL)
#if os(iOS)
.keyboardType(.URL).textInputAutocapitalization(.never)
diff --git a/native/apple/Sources/EquipoKit/UI/Screens/PhoneRoot.swift b/native/apple/Sources/EquipoKit/UI/Screens/PhoneRoot.swift
index c574335c..74165076 100644
--- a/native/apple/Sources/EquipoKit/UI/Screens/PhoneRoot.swift
+++ b/native/apple/Sources/EquipoKit/UI/Screens/PhoneRoot.swift
@@ -19,6 +19,15 @@ public struct PhoneRoot: View {
.tint(Palette.accent)
.onChange(of: phase) { _, now in now == .active ? model.foreground() : model.background() }
.onChange(of: model.session?.status) { _, status in if status == .signedOut { model.sessionEnded() } }
+ .onChange(of: model.session?.needsYou?.count) { _, count in model.needsYouChanged(count) }
+ .onChange(of: model.session?.tasks) { _, tasks in
+ // A task that ended while its end push was lost leaves the Lock Screen.
+ guard let tasks else { return }
+ let live = model.liveActivities
+ Task { await live.endFinished(tasks) }
+ }
+ // A Live Activity's tap: its task.
+ .onOpenURL { url in if let route = PushRoute(url: url) { model.open(route) } }
.task { model.foreground() }
}
}
@@ -26,25 +35,27 @@ public struct PhoneRoot: View {
struct PhoneTabs: View {
let model: EquipoAppModel
let session: EquipoSession
+ @State private var tab: Destination.Pane = .conversation
@State private var conversationPath: [String] = []
@State private var needsPath: [String] = []
@State private var tasksPath: [String] = []
+ @State private var focusCard: String?
@State private var showingAccount = false
var body: some View {
- TabView {
- Tab(String(localized: "tab.conversation", bundle: .module), systemImage: "bubble.left.and.bubble.right") {
+ TabView(selection: $tab) {
+ Tab(String(localized: "tab.conversation", bundle: .module), systemImage: "bubble.left.and.bubble.right", value: .conversation) {
stack($conversationPath, title: String(localized: "tab.conversation", bundle: .module)) {
- ConversationScreen(session: session) { conversationPath.append($0) }
+ ConversationScreen(session: session, focus: $focusCard) { conversationPath.append($0) }
}
}
- Tab(String(localized: "tab.needs", bundle: .module), systemImage: "tray") {
+ Tab(String(localized: "tab.needs", bundle: .module), systemImage: "tray", value: .needs) {
stack($needsPath, title: String(localized: "tab.needs", bundle: .module)) {
NeedsScreen(session: session) { needsPath.append($0) }
}
}
.badge(session.needsYou?.count ?? 0)
- Tab(String(localized: "tab.tasks", bundle: .module), systemImage: "checklist") {
+ Tab(String(localized: "tab.tasks", bundle: .module), systemImage: "checklist", value: .tasks) {
stack($tasksPath, title: String(localized: "tab.tasks", bundle: .module)) {
TasksScreen(session: session) { tasksPath.append($0) }
}
@@ -53,6 +64,22 @@ struct PhoneTabs: View {
.sheet(isPresented: $showingAccount) {
NavigationStack { AccountScreen(model: model, session: session).navigationTitle(session.teamName) }
}
+ .onChange(of: model.destination, initial: true) { _, destination in
+ guard let destination else { return }
+ go(destination)
+ model.destination = nil
+ }
+ }
+
+ /// A tapped notification or Live Activity: its tab, at its card or task.
+ private func go(_ destination: Destination) {
+ showingAccount = false
+ tab = destination.pane
+ switch destination.pane {
+ case .conversation: conversationPath = []; focusCard = destination.cardID
+ case .needs: needsPath = []
+ case .tasks: tasksPath = destination.taskID.map { [$0] } ?? []
+ }
}
private func stack<C: View>(_ path: Binding<[String]>, title: String, @ViewBuilder content: () -> C) -> some View {
diff --git a/native/apple/Sources/EquipoKit/UI/Screens/TaskScreens.swift b/native/apple/Sources/EquipoKit/UI/Screens/TaskScreens.swift
index fd349991..c200c579 100644
--- a/native/apple/Sources/EquipoKit/UI/Screens/TaskScreens.swift
+++ b/native/apple/Sources/EquipoKit/UI/Screens/TaskScreens.swift
@@ -16,11 +16,12 @@ public struct NeedsScreen: View {
} description: { Text(String(localized: "needs.empty", bundle: .module)) }
.padding(.top, 40)
}
- ForEach(needs) { task in
- VStack(alignment: .leading, spacing: 8) {
- TaskRowButton(task: task, needsYou: session.waitsOnYou(task)) { openTask(task.id) }
- TaskCards(session: session, task: task)
- }
+ let groups = Feed.needsGroups(needs: needs, cards: session.cards)
+ ForEach(groups.waiting) { task in item(task) }
+ if !groups.setAside.isEmpty {
+ // Still waiting on you, and still counted: only out of the way.
+ SectionTitle(text: String(localized: "roster.set_aside", bundle: .module)).padding(.top, 8)
+ ForEach(groups.setAside) { task in item(task) }
}
} else if session.refreshFailed {
ReadFailed { Task { await session.refresh() } }
@@ -33,6 +34,13 @@ public struct NeedsScreen: View {
.refreshable { await session.refresh() }
.background(Palette.background)
}
+
+ private func item(_ task: ThinTask) -> some View {
+ VStack(alignment: .leading, spacing: 8) {
+ TaskRowButton(task: task, needsYou: session.waitsOnYou(task)) { openTask(task.id) }
+ TaskCards(session: session, task: task)
+ }
+ }
}
/// Tasks, grouped as the web groups them.
diff --git a/native/apple/Sources/EquipoMac/EquipoMacApp.swift b/native/apple/Sources/EquipoMac/EquipoMacApp.swift
index 11e3a3ff..2277974b 100644
--- a/native/apple/Sources/EquipoMac/EquipoMacApp.swift
+++ b/native/apple/Sources/EquipoMac/EquipoMacApp.swift
@@ -10,7 +10,8 @@ import SwiftUI
/// conversation, Needs you and Tasks. Settings shows the team and this
/// device, and signs out.
@main struct EquipoMacApp: App {
- @State private var model = EquipoAppModel()
+ @NSApplicationDelegateAdaptor(EquipoMacDelegate.self) private var delegate
+ private var model: EquipoAppModel { delegate.model }
#if canImport(RastrilloMacUpdates)
// Quiet, as the other Oficina apps: a scheduled check never opens a
// window; an update downloads in the background and installs on quit.
@@ -38,6 +39,28 @@ import SwiftUI
}
}
+/// APNs hands the device token here; the notification centre is set up
+/// before the first window, so a tap that launched the app is not missed.
+/// A build without the push entitlement (an ad hoc development build) gets
+/// no token, and works as before.
+@MainActor
+final class EquipoMacDelegate: NSObject, NSApplicationDelegate {
+ let notifications = SystemNotifications()
+ private(set) lazy var model = EquipoAppModel(notifications: notifications)
+
+ func applicationWillFinishLaunching(_ notification: Notification) {
+ notifications.onRoute = { [weak self] route in
+ self?.model.open(route)
+ NSApp.activate()
+ }
+ }
+ func application(_ application: NSApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
+ let push = model.push
+ Task { await push.deviceTokenChanged(deviceToken) }
+ }
+ func application(_ application: NSApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {}
+}
+
/// Pairing or the signed-in window, and the app's foreground state.
struct MacRoot: View {
let model: EquipoAppModel
@@ -58,6 +81,7 @@ struct MacRoot: View {
NSApp.occlusionState.contains(.visible) ? model.foreground() : model.background()
}
.onChange(of: model.session?.status) { _, status in if status == .signedOut { model.sessionEnded() } }
+ .onChange(of: model.session?.needsYou?.count) { _, count in model.needsYouChanged(count) }
}
}
diff --git a/native/apple/Sources/EquipoMac/LiveTranscript.swift b/native/apple/Sources/EquipoMac/LiveTranscript.swift
index 7043e9ea..252f4cd8 100644
--- a/native/apple/Sources/EquipoMac/LiveTranscript.swift
+++ b/native/apple/Sources/EquipoMac/LiveTranscript.swift
@@ -23,6 +23,10 @@ final class LiveTranscript: NSView {
private var answers: [String: AnswerState] = [:]
/// The card revision each answer state belongs to: a newer card clears it.
private var answeredRevision: [String: Int64] = [:]
+ /// Set aside and Undo in flight or refused, by card ("aside" or "undo").
+ private var asides: [String: AnswerState] = [:]
+ /// Where each item starts in the document, for bringing a card into view.
+ private var tops: [String: CGFloat] = [:]
private let scroll = NSScrollView()
private let document = FlippedView()
let composer = MacComposer()
@@ -107,7 +111,9 @@ final class LiveTranscript: NSView {
if items.isEmpty && session.status == .ready {
place(makeText(EquipoStrings.text("conversation.empty"), MacType.line, .webSecondary, width: width), gapAfter: 0)
}
+ tops = [:]
for item in items {
+ tops[item.id] = y
switch item {
case .own(let message):
place(ownBubble(message.text, width: width), x: width - ownWidth(message.text, width: width))
@@ -139,6 +145,16 @@ final class LiveTranscript: NSView {
document.frame = NSRect(x: 0, y: 0, width: bounds.width, height: max(y + 24, scroll.bounds.height))
}
+ /// Scrolls a card (a tapped notification's) into view; false while the feed lacks it.
+ @discardableResult
+ func reveal(card id: String) -> Bool {
+ guard let top = tops[id] else { return false }
+ let maxY = max(0, document.frame.height - scroll.contentView.bounds.height)
+ scroll.contentView.scroll(to: NSPoint(x: 0, y: min(maxY, max(0, top - 48))))
+ scroll.reflectScrolledClipView(scroll.contentView)
+ return true
+ }
+
private func ownWidth(_ text: String, width: CGFloat) -> CGFloat {
makeText(text, MacType.line, .webText, width: min(width * 0.7, 520) - 28, lineSpacing: 2).frame.width + 28
}
@@ -213,6 +229,7 @@ final class LiveTranscript: NSView {
if let seen = answeredRevision[card.id], !AnswerFeedback.stillChanged(conflictAt: seen, now: card.revision) {
if case .sending = answers[card.id] {} else { answers[card.id] = nil; answeredRevision[card.id] = nil }
}
+ if card.isAside { return asideStub(card, width: width) }
let state = answers[card.id]
let plate = RaisedPlate(width: width, height: 0, flat: !card.isOpen)
let inner = width - 2 * MacMetric.pad
@@ -223,7 +240,8 @@ final class LiveTranscript: NSView {
if let taskTitle, !card.question.contains(taskTitle) {
add(makeText(taskTitle, MacType.caption, .webSecondary, width: inner), gap: 4)
}
- add(makeText(card.question.isEmpty ? EquipoStrings.text("card.question") : card.question, MacType.line, .webText, width: inner, lineSpacing: 2, selectable: true))
+ let aside = asideButton(card, plate: plate, top: y, width: width)
+ add(makeText(card.question.isEmpty ? EquipoStrings.text("card.question") : card.question, MacType.line, .webText, width: inner - (aside == nil ? 0 : 40), lineSpacing: 2, selectable: true))
guard card.isOpen else {
if card.choice.isEmpty {
add(makeText(EquipoStrings.text("question.closed"), MacType.small, .webSecondary, width: inner))
@@ -250,7 +268,7 @@ final class LiveTranscript: NSView {
y += 32 + MacMetric.gap
}
let feedback: String? = {
- switch state {
+ switch asides[card.id] ?? state {
case .changed: return EquipoStrings.text("card.changed")
case .offline: return EquipoStrings.text("card.offline")
case .failed: return EquipoStrings.text("card.failed")
@@ -266,6 +284,76 @@ final class LiveTranscript: NSView {
return finish(plate, height: y - MacMetric.gap + MacMetric.pad)
}
+ // MARK: Set aside (D5)
+
+ /// The web's Set aside: an x centred on the card's first line, on a card
+ /// that still waits on the person. It never answers anything.
+ private func asideButton(_ card: ThinCard, plate: RaisedPlate, top: CGFloat, width: CGFloat) -> ActionButton? {
+ guard Feed.canSetAside(card) else { return nil }
+ if case .sending = answers[card.id] { return nil }
+ let busy = asides[card.id] == .sending("aside") ? EquipoStrings.text("roster.setting_aside") : nil
+ let b = button("", .aside, symbol: "xmark", busy: busy) { [weak self] in self?.setAside(card, true) }
+ b.frame.size = busy == nil ? NSSize(width: 36, height: 36) : NSSize(width: textWidth(busy!, MacType.caption) + 40, height: 32)
+ b.frame.origin = NSPoint(x: width - MacMetric.pad - b.frame.width + 6, y: top - 8)
+ b.toolTip = EquipoStrings.text("roster.set_aside")
+ b.setAccessibilityLabel(busy ?? EquipoStrings.text("roster.set_aside"))
+ plate.content.addSubview(b)
+ return b
+ }
+
+ /// chat.html equipo-aside-stub: the card's one line, "Set aside, still
+ /// in Needs you", and Undo.
+ private func asideStub(_ card: ThinCard, width: CGFloat) -> RaisedPlate {
+ let plate = RaisedPlate(width: width, height: 0, flat: true)
+ let inner = width - 2 * MacMetric.pad
+ let restoring = asides[card.id] == .sending("undo")
+ let undo = button(EquipoStrings.text("roster.undo"), .choice, busy: restoring ? EquipoStrings.text("roster.restoring") : nil) { [weak self] in
+ self?.setAside(card, false)
+ }
+ let textWidth = inner - undo.frame.width - 12
+ let title = makeText(Feed.asideTitle(card, task: session.task(card.taskId)), MacType.smallStrong, .webText, width: textWidth, lines: 1)
+ let note = makeText(EquipoStrings.text("roster.aside"), MacType.caption, .webSecondary, width: textWidth)
+ title.frame.origin = NSPoint(x: MacMetric.pad, y: MacMetric.pad)
+ note.frame.origin = NSPoint(x: MacMetric.pad, y: title.frame.maxY + 2)
+ var height = max(note.frame.maxY, MacMetric.pad + undo.frame.height)
+ undo.frame.origin = NSPoint(x: width - MacMetric.pad - undo.frame.width, y: MacMetric.pad + (note.frame.maxY - MacMetric.pad - undo.frame.height) / 2)
+ [title, note, undo].forEach { plate.content.addSubview($0) }
+ let feedback: String? = {
+ switch asides[card.id] {
+ case .changed: return EquipoStrings.text("card.changed")
+ case .offline: return EquipoStrings.text("card.offline")
+ case .failed: return EquipoStrings.text("card.failed")
+ default: return nil
+ }
+ }()
+ if let feedback {
+ let line = makeText(feedback, MacType.small, .webNegative, width: inner)
+ line.frame.origin = NSPoint(x: MacMetric.pad, y: height + 6)
+ plate.content.addSubview(line)
+ height = line.frame.maxY
+ NSAccessibility.post(element: line, notification: .announcementRequested, userInfo: [.announcement: feedback])
+ }
+ return finish(plate, height: height + MacMetric.pad)
+ }
+
+ private func setAside(_ card: ThinCard, _ aside: Bool) {
+ if case .sending = asides[card.id] { return }
+ asides[card.id] = .sending(aside ? "aside" : "undo")
+ rebuild()
+ let session = self.session
+ Task { [weak self] in
+ let outcome = await session.setAside(card, aside)
+ guard let self else { return }
+ switch outcome {
+ case .answered: self.asides[card.id] = nil
+ case .changed: self.asides[card.id] = .changed
+ case .offline: self.asides[card.id] = .offline
+ case .failed: self.asides[card.id] = .failed
+ }
+ self.rebuild()
+ }
+ }
+
private func submit(card: ThinCard, choice: String) {
if case .sending = answers[card.id] { return }
answers[card.id] = .sending(choice)
@@ -289,6 +377,7 @@ final class LiveTranscript: NSView {
}
private func decisionCard(_ card: ThinCard, taskTitle: String?, width: CGFloat) -> RaisedPlate {
+ if card.isAside { return asideStub(card, width: width) }
let open = Feed.decision(card, task: session.task(card.taskId))?.open ?? card.isOpen
let plate = RaisedPlate(width: width, height: 0, flat: !open)
let inner = width - 2 * MacMetric.pad
@@ -306,7 +395,12 @@ final class LiveTranscript: NSView {
return finish(plate, height: y - MacMetric.gap + MacMetric.pad)
}
let head = card.question.isEmpty ? (taskTitle ?? EquipoStrings.text("decision.untitled")) : card.question
- add(makeText(head, MacType.line, .webText, width: inner, lineSpacing: 2, selectable: true), gap: 4)
+ let aside = asideButton(card, plate: plate, top: y, width: width)
+ add(makeText(head, MacType.line, .webText, width: inner - (aside == nil ? 0 : 40), lineSpacing: 2, selectable: true), gap: 4)
+ if let failed = asides[card.id], failed != .sending("aside") {
+ let said = failed == .changed ? EquipoStrings.text("card.changed") : failed == .offline ? EquipoStrings.text("card.offline") : EquipoStrings.text("card.failed")
+ add(makeText(said, MacType.small, .webNegative, width: inner))
+ }
// Merges and "Does main ship?" are answered here, in the web's words.
if let view = decision {
if view.hasPreview {
@@ -380,15 +474,32 @@ final class LiveTranscript: NSView {
struct TranscriptView: NSViewRepresentable {
let items: [FeedItem]
let session: EquipoSession
+ @Binding var focusCard: String?
var openTask: (String) -> Void
func makeNSView(context: Context) -> LiveTranscript {
let view = LiveTranscript(session: session, openTask: openTask)
view.update(items: items)
+ focus(view)
return view
}
func updateNSView(_ view: LiveTranscript, context: Context) {
view.openTask = openTask
view.update(items: items)
+ focus(view)
+ }
+ /// Brings the card into view once the feed has it; reads again if not yet.
+ private func focus(_ view: LiveTranscript) {
+ guard let id = focusCard else { return }
+ let binding = $focusCard
+ let session = self.session
+ if view.reveal(card: id) {
+ Task { @MainActor in binding.wrappedValue = nil }
+ } else {
+ Task { @MainActor in
+ await session.refresh()
+ if !Feed.build(session).contains(where: { $0.id == id }) { binding.wrappedValue = nil }
+ }
+ }
}
}
diff --git a/native/apple/Sources/EquipoMac/MacMainView.swift b/native/apple/Sources/EquipoMac/MacMainView.swift
index 561be49e..b0ca5e57 100644
--- a/native/apple/Sources/EquipoMac/MacMainView.swift
+++ b/native/apple/Sources/EquipoMac/MacMainView.swift
@@ -8,10 +8,12 @@ struct MacMainView: View {
let model: EquipoAppModel
let session: EquipoSession
- enum Pane: Hashable { case conversation, needs, tasks }
+ typealias Pane = Destination.Pane
@State private var pane: Pane = .conversation
@State private var inspectedTask: String?
@State private var showsInspector = false
+ /// A card to bring into view (a tapped notification).
+ @State private var focusCard: String?
var body: some View {
NavigationSplitView {
@@ -35,6 +37,11 @@ struct MacMainView: View {
}
.inspectorColumnWidth(min: 300, ideal: 360, max: 480)
}
+ .onChange(of: model.destination, initial: true) { _, destination in
+ guard let destination else { return }
+ go(destination)
+ model.destination = nil
+ }
.toolbar {
ToolbarItem(placement: .primaryAction) { needsPill }
ToolbarItem(placement: .primaryAction) {
@@ -48,7 +55,7 @@ struct MacMainView: View {
@ViewBuilder private var detail: some View {
switch pane {
case .conversation:
- TranscriptView(items: Feed.build(session), session: session, openTask: open)
+ TranscriptView(items: Feed.build(session), session: session, focusCard: $focusCard, openTask: open)
case .needs:
NeedsScreen(session: session, openTask: open)
case .tasks:
@@ -84,6 +91,14 @@ struct MacMainView: View {
}
}
+ /// A tapped notification: the conversation at its card, or the task in
+ /// the inspector beside Tasks.
+ private func go(_ destination: Destination) {
+ pane = destination.pane
+ focusCard = destination.cardID
+ if let task = destination.taskID { open(task) }
+ }
+
private func open(_ taskID: String) {
inspectedTask = taskID
showsInspector = true
diff --git a/native/apple/Tests/EquipoKitTests/Fixtures/push/activity-end.json b/native/apple/Tests/EquipoKitTests/Fixtures/push/activity-end.json
new file mode 100644
index 00000000..f31a93d6
--- /dev/null
+++ b/native/apple/Tests/EquipoKitTests/Fixtures/push/activity-end.json
@@ -0,0 +1,17 @@
+{
+ "aps": {
+ "timestamp": 1795176000,
+ "event": "end",
+ "content-state": {
+ "task_id": "tk1",
+ "title": "Fix login",
+ "stage": "done",
+ "specialist": "engineering",
+ "activity": "",
+ "needs_you": "",
+ "tone": "positive",
+ "outcome": "done"
+ },
+ "dismissal-date": 1795179600
+ }
+}
diff --git a/native/apple/Tests/EquipoKitTests/Fixtures/push/activity-needs.json b/native/apple/Tests/EquipoKitTests/Fixtures/push/activity-needs.json
new file mode 100644
index 00000000..7aa14c88
--- /dev/null
+++ b/native/apple/Tests/EquipoKitTests/Fixtures/push/activity-needs.json
@@ -0,0 +1,15 @@
+{
+ "aps": {
+ "timestamp": 1795176000,
+ "event": "update",
+ "content-state": {
+ "task_id": "tk1",
+ "title": "Fix login",
+ "stage": "ready_to_merge",
+ "specialist": "engineering",
+ "activity": "",
+ "needs_you": "merge",
+ "tone": "warning"
+ }
+ }
+}
diff --git a/native/apple/Tests/EquipoKitTests/Fixtures/push/activity-replaced.json b/native/apple/Tests/EquipoKitTests/Fixtures/push/activity-replaced.json
new file mode 100644
index 00000000..e317cfde
--- /dev/null
+++ b/native/apple/Tests/EquipoKitTests/Fixtures/push/activity-replaced.json
@@ -0,0 +1,17 @@
+{
+ "aps": {
+ "timestamp": 1795176000,
+ "event": "end",
+ "content-state": {
+ "task_id": "tk1",
+ "title": "Fix login",
+ "stage": "in_progress",
+ "specialist": "engineering",
+ "activity": "Reading README.md",
+ "needs_you": "",
+ "tone": "positive",
+ "outcome": "replaced"
+ },
+ "dismissal-date": 1795176000
+ }
+}
diff --git a/native/apple/Tests/EquipoKitTests/Fixtures/push/activity-start.json b/native/apple/Tests/EquipoKitTests/Fixtures/push/activity-start.json
new file mode 100644
index 00000000..bd340b2c
--- /dev/null
+++ b/native/apple/Tests/EquipoKitTests/Fixtures/push/activity-start.json
@@ -0,0 +1,25 @@
+{
+ "aps": {
+ "alert": {
+ "title": "Fix login",
+ "body": "[push.activity.started]"
+ },
+ "sound": "default",
+ "timestamp": 1795176000,
+ "event": "start",
+ "content-state": {
+ "task_id": "tk1",
+ "title": "Fix login",
+ "stage": "in_progress",
+ "specialist": "engineering",
+ "activity": "Reading README.md",
+ "needs_you": "",
+ "tone": "positive"
+ },
+ "attributes-type": "EquipoTaskAttributes",
+ "attributes": {
+ "task_id": "tk1",
+ "origin": "https://oficina.example.test"
+ }
+ }
+}
diff --git a/native/apple/Tests/EquipoKitTests/Fixtures/push/activity-update.json b/native/apple/Tests/EquipoKitTests/Fixtures/push/activity-update.json
new file mode 100644
index 00000000..2c53c274
--- /dev/null
+++ b/native/apple/Tests/EquipoKitTests/Fixtures/push/activity-update.json
@@ -0,0 +1,15 @@
+{
+ "aps": {
+ "timestamp": 1795176000,
+ "event": "update",
+ "content-state": {
+ "task_id": "tk1",
+ "title": "Fix login",
+ "stage": "in_progress",
+ "specialist": "engineering",
+ "activity": "Reading README.md",
+ "needs_you": "",
+ "tone": "positive"
+ }
+ }
+}
diff --git a/native/apple/Tests/EquipoKitTests/Fixtures/push/badge.json b/native/apple/Tests/EquipoKitTests/Fixtures/push/badge.json
new file mode 100644
index 00000000..a20f01ab
--- /dev/null
+++ b/native/apple/Tests/EquipoKitTests/Fixtures/push/badge.json
@@ -0,0 +1,5 @@
+{
+ "aps": {
+ "badge": 2
+ }
+}
diff --git a/native/apple/Tests/EquipoKitTests/Fixtures/push/card.json b/native/apple/Tests/EquipoKitTests/Fixtures/push/card.json
new file mode 100644
index 00000000..ec33e8df
--- /dev/null
+++ b/native/apple/Tests/EquipoKitTests/Fixtures/push/card.json
@@ -0,0 +1,16 @@
+{
+ "aps": {
+ "alert": {
+ "title": "[push.card.title]",
+ "body": "Merge the login fix?"
+ },
+ "sound": "default",
+ "category": "needs_you",
+ "thread-id": "task:tk1"
+ },
+ "equipo": {
+ "kind": "card",
+ "card_id": "c1",
+ "task_id": "tk1"
+ }
+}
diff --git a/native/apple/Tests/EquipoKitTests/Fixtures/push/reply.json b/native/apple/Tests/EquipoKitTests/Fixtures/push/reply.json
new file mode 100644
index 00000000..6e416f51
--- /dev/null
+++ b/native/apple/Tests/EquipoKitTests/Fixtures/push/reply.json
@@ -0,0 +1,13 @@
+{
+ "aps": {
+ "alert": {
+ "title": "[push.reply.title]",
+ "body": "Done. The fix is on its branch."
+ },
+ "sound": "default"
+ },
+ "equipo": {
+ "kind": "reply",
+ "turn_id": "t1"
+ }
+}
diff --git a/native/apple/Tests/EquipoKitTests/Fixtures/push/task-done.json b/native/apple/Tests/EquipoKitTests/Fixtures/push/task-done.json
new file mode 100644
index 00000000..c7d93c99
--- /dev/null
+++ b/native/apple/Tests/EquipoKitTests/Fixtures/push/task-done.json
@@ -0,0 +1,14 @@
+{
+ "aps": {
+ "alert": {
+ "title": "Fix login",
+ "body": "[push.task.done]"
+ },
+ "thread-id": "task:tk1",
+ "interruption-level": "passive"
+ },
+ "equipo": {
+ "kind": "task",
+ "task_id": "tk1"
+ }
+}
diff --git a/native/apple/Tests/EquipoKitTests/Fixtures/push/task-failed.json b/native/apple/Tests/EquipoKitTests/Fixtures/push/task-failed.json
new file mode 100644
index 00000000..d2131e6b
--- /dev/null
+++ b/native/apple/Tests/EquipoKitTests/Fixtures/push/task-failed.json
@@ -0,0 +1,14 @@
+{
+ "aps": {
+ "alert": {
+ "title": "Fix login",
+ "body": "[push.task.failed]"
+ },
+ "thread-id": "task:tk1",
+ "interruption-level": "passive"
+ },
+ "equipo": {
+ "kind": "task",
+ "task_id": "tk1"
+ }
+}
diff --git a/native/apple/Tests/EquipoKitTests/PushTests.swift b/native/apple/Tests/EquipoKitTests/PushTests.swift
new file mode 100644
index 00000000..8b2d372a
--- /dev/null
+++ b/native/apple/Tests/EquipoKitTests/PushTests.swift
@@ -0,0 +1,486 @@
+import Foundation
+import Testing
+@testable import EquipoKit
+import EquipoActivity
+
+// Native slice 2: the device's push registration, the gateway it names, tap
+// routing and the Live Activity's content state. The payloads under
+// Fixtures/push are the server's goldens (internal/equipo/push/testdata on
+// push/server 2ea81007), copied byte for byte.
+
+private let deviceToken = Data((0..<32).map { UInt8($0) + 0xA0 })
+private let startToken = Data((0..<32).map { UInt8($0) })
+private let deviceHex = "a0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebf"
+private let startHex = "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f"
+
+private let here = "https://oficina.example.test"
+private func client(_ t: ScriptedTransport, _ bearer: String = "equipo.person.v1.TOKENFIXTURE") -> EquipoClient {
+ EquipoClient(transport: t, token: bearer)
+}
+private func registered(_ t: ScriptedTransport) {
+ t.on("POST /push-registrations", .success(APIResponse(status: 200, data: Data(#"{"environment":"production","platform":"ios","live_activities":true,"updated_at":"2026-11-20T10:00:00Z"}"#.utf8))))
+}
+private func json(_ request: APIRequest) throws -> [String: String] {
+ try JSONSerialization.jsonObject(with: try #require(request.body)) as! [String: String]
+}
+
+@MainActor @Suite struct PushRegistrationTests {
+ @Test func theBodyIsTheServersShapeInLowercaseHex() throws {
+ let body = PushRegistrationBody(token: PushToken.hex(deviceToken), environment: .production, platform: .ios, startToken: PushToken.hex(startToken))
+ let sent = try JSONSerialization.jsonObject(with: try EquipoJSON.encoder.encode(body)) as! [String: String]
+ #expect(sent == ["token": deviceHex, "environment": "production", "platform": "ios", "start_token": startHex])
+ let mac = PushRegistrationBody(token: deviceHex, environment: .production, platform: .macos, startToken: startHex)
+ #expect(mac.startToken == nil, "the server refuses a push-to-start token from a Mac")
+ }
+
+ @Test func registersOnceTheTokenArrivesWithTheDeviceBearer() async throws {
+ let t = ScriptedTransport(); registered(t)
+ let r = PushRegistrar(environment: .production, platform: .ios)
+ await r.attach(client(t))
+ #expect(t.requests.isEmpty, "nothing to register before APNs gives a token")
+ await r.deviceTokenChanged(deviceToken)
+ let sent = t.sent("POST /push-registrations")
+ #expect(sent.count == 1)
+ #expect(sent.first?.bearer == "equipo.person.v1.TOKENFIXTURE")
+ #expect(try json(sent[0]) == ["token": deviceHex, "environment": "production", "platform": "ios"])
+ await r.sync(); await r.deviceTokenChanged(deviceToken)
+ #expect(t.sent("POST /push-registrations").count == 1, "the server has it: not sent again")
+ }
+
+ @Test func aMacNeverSendsAStartToken() async throws {
+ let t = ScriptedTransport(); registered(t)
+ let r = PushRegistrar(environment: .production, platform: .macos)
+ await r.attach(client(t))
+ await r.deviceTokenChanged(deviceToken)
+ await r.startTokenChanged(startToken)
+ let sent = t.sent("POST /push-registrations")
+ #expect(sent.count == 1, "a start token is iPhone-only: nothing more to register")
+ #expect(try json(sent[0]) == ["token": deviceHex, "environment": "production", "platform": "macos"])
+ }
+
+ @Test func aChangedTokenRegistersAgain() async throws {
+ let t = ScriptedTransport(); registered(t)
+ let r = PushRegistrar(environment: .production, platform: .ios)
+ await r.attach(client(t))
+ await r.deviceTokenChanged(deviceToken)
+ await r.startTokenChanged(startToken)
+ func latest() throws -> [String: String] { try json(try #require(t.sent("POST /push-registrations").last)) }
+ #expect(t.sent("POST /push-registrations").count == 2)
+ #expect(try latest()["start_token"] == startHex)
+ await r.deviceTokenChanged(startToken)
+ #expect(t.sent("POST /push-registrations").count == 3, "a new APNs token is registered")
+ #expect(try latest()["token"] == startHex)
+ await r.startTokenChanged(deviceToken)
+ #expect(t.sent("POST /push-registrations").count == 4, "a new push-to-start token is registered")
+ #expect(try latest()["start_token"] == deviceHex)
+ }
+
+ @Test func anotherTeamsSessionRegistersAgainAndNoneStops() async throws {
+ let t = ScriptedTransport(); registered(t)
+ let r = PushRegistrar(environment: .production, platform: .ios)
+ await r.attach(client(t))
+ await r.deviceTokenChanged(deviceToken)
+ await r.attach(client(t, "equipo.person.v1.OTHER"))
+ #expect(t.sent("POST /push-registrations").map(\.bearer) == ["equipo.person.v1.TOKENFIXTURE", "equipo.person.v1.OTHER"])
+ await r.attach(nil)
+ await r.startTokenChanged(startToken)
+ #expect(t.sent("POST /push-registrations").count == 2, "signed out: nothing is sent")
+ }
+
+ @Test func aRegistrationThatDidNotLandIsSentOnTheNextSync() async throws {
+ let t = ScriptedTransport()
+ t.on("POST /push-registrations", .failure(.offline))
+ registered(t)
+ let r = PushRegistrar(environment: .production, platform: .ios)
+ await r.attach(client(t))
+ await r.deviceTokenChanged(deviceToken)
+ #expect(t.sent("POST /push-registrations").count == 1)
+ await r.sync()
+ #expect(t.sent("POST /push-registrations").count == 2, "sent again when the app is in front again")
+ await r.sync()
+ #expect(t.sent("POST /push-registrations").count == 2)
+ }
+
+ @Test func aBuildThatCannotReceivePushesDoesNotRegister() async throws {
+ let t = ScriptedTransport(); registered(t)
+ let r = PushRegistrar(environment: nil, platform: .macos)
+ await r.attach(client(t))
+ await r.deviceTokenChanged(deviceToken)
+ #expect(t.requests.isEmpty)
+ }
+
+ @Test func activityTokensFollowTheRegistrationAndStopWhenTheTaskEnded() async throws {
+ let t = ScriptedTransport()
+ t.on("POST /push-registrations/activities",
+ .success(APIResponse(status: 204, data: Data())),
+ .success(APIResponse(status: 409, data: Data(#"{"code":"task_ended","copy_key":"api.task_ended","request_id":"r"}"#.utf8))),
+ .success(APIResponse(status: 204, data: Data())))
+ let r = PushRegistrar(environment: .production, platform: .ios)
+ await r.attach(client(t))
+ await r.activityTokenChanged(startToken, task: "tk1", origin: here)
+ #expect(t.sent("POST /push-registrations/activities").isEmpty, "the device registers first")
+ registered(t)
+ await r.deviceTokenChanged(deviceToken)
+ let first = t.sent("POST /push-registrations/activities")
+ #expect(first.count == 1)
+ #expect(try json(first[0]) == ["task_id": "tk1", "token": startHex])
+ #expect(first[0].bearer == "equipo.person.v1.TOKENFIXTURE")
+ await r.activityTokenChanged(deviceToken, task: "tk2", origin: here)
+ #expect(t.sent("POST /push-registrations/activities").count == 2)
+ await r.sync()
+ #expect(t.sent("POST /push-registrations/activities").count == 2, "an ended task's token is not sent again")
+ await r.activityTokenChanged(startToken, task: "tk3", origin: here)
+ #expect(try json(t.sent("POST /push-registrations/activities")[2])["task_id"] == "tk3")
+ }
+
+ @Test func aTaskTheServerSaysEndedEndsItsActivityHere() async throws {
+ let t = ScriptedTransport(); registered(t)
+ t.on("POST /push-registrations/activities",
+ .success(APIResponse(status: 409, data: Data(#"{"code":"task_ended","copy_key":"api.task_ended","request_id":"r"}"#.utf8))))
+ let r = PushRegistrar(environment: .production, platform: .ios)
+ var closed: [String] = []
+ r.onActivityClosed = { closed.append($0) }
+ await r.attach(client(t))
+ await r.deviceTokenChanged(deviceToken)
+ await r.activityTokenChanged(startToken, task: "tk1", origin: here)
+ #expect(closed == ["tk1"], "the Lock Screen does not keep a task the server says is over")
+ }
+
+ @Test func anotherTeamNeverSendsTheLastTeamsActivities() async throws {
+ let a = ScriptedTransport(); registered(a)
+ a.on("POST /push-registrations/activities", .success(APIResponse(status: 204, data: Data())))
+ let b = ScriptedTransport(origin: URL(string: "https://other.example.test")!); registered(b)
+ b.on("POST /push-registrations/activities", .success(APIResponse(status: 204, data: Data())))
+ let r = PushRegistrar(environment: .production, platform: .ios)
+ var changes = 0
+ r.onSessionChanged = { changes += 1 }
+ await r.attach(client(a))
+ await r.deviceTokenChanged(deviceToken)
+ await r.activityTokenChanged(startToken, task: "tkA", origin: here)
+ await r.attach(client(b, "equipo.person.v1.OTHER"))
+ #expect(changes == 2, "observers deliver their tokens again for each new session")
+ // Team A's activity is still on the device and its observer delivers again.
+ await r.activityTokenChanged(startToken, task: "tkA", origin: here)
+ #expect(b.sent("POST /push-registrations/activities").isEmpty, "team A's activity tokens never go to team B's server")
+ }
+
+ @Test func afterARelaunchAnotherTeamsActivityIsStillNeverSent() async throws {
+ let b = ScriptedTransport(origin: URL(string: "https://other.example.test")!); registered(b)
+ b.on("POST /push-registrations/activities", .success(APIResponse(status: 204, data: Data())))
+ // A fresh process: nothing remembered, team B signed in, and team A's
+ // activity survived (its end failed). It is seen for the first time.
+ let r = PushRegistrar(environment: .production, platform: .ios)
+ await r.attach(client(b))
+ await r.deviceTokenChanged(deviceToken)
+ await r.activityTokenChanged(startToken, task: "tkA", origin: here)
+ #expect(b.sent("POST /push-registrations/activities").isEmpty, "an activity names its team, so it is never adopted")
+ await r.activityTokenChanged(deviceToken, task: "tkB", origin: "https://OTHER.example.test")
+ let own = try #require(b.sent("POST /push-registrations/activities").first, "team B's own activity is sent")
+ #expect(try json(own)["task_id"] == "tkB")
+ }
+
+ @Test func anActivitySeenBeforeTheSessionIsRestoredIsSentOnceItIs() async throws {
+ let t = ScriptedTransport(); registered(t)
+ t.on("POST /push-registrations/activities", .success(APIResponse(status: 204, data: Data())))
+ let r = PushRegistrar(environment: .production, platform: .ios)
+ // Cold launch: observation starts before the saved session attaches.
+ await r.activityTokenChanged(startToken, task: "tk1", origin: here)
+ await r.attach(client(t))
+ await r.deviceTokenChanged(deviceToken)
+ let sent = try #require(t.sent("POST /push-registrations/activities").first,
+ "a push-started activity still gets the server's updates and its end")
+ #expect(try json(sent)["task_id"] == "tk1")
+ }
+
+ @Test func anActivityThatNamesNoTeamIsNeverSent() async throws {
+ let t = ScriptedTransport(); registered(t)
+ t.on("POST /push-registrations/activities", .success(APIResponse(status: 204, data: Data())))
+ let r = PushRegistrar(environment: .production, platform: .ios)
+ await r.attach(client(t))
+ await r.deviceTokenChanged(deviceToken)
+ await r.activityTokenChanged(startToken, task: "tk1", origin: nil)
+ #expect(t.sent("POST /push-registrations/activities").isEmpty)
+ }
+
+ @Test func aPassSuspendedAcrossASessionChangeSendsNothingMore() async throws {
+ let inner = ScriptedTransport(); registered(inner)
+ inner.on("POST /push-registrations/activities", .success(APIResponse(status: 204, data: Data())))
+ let gate = GatedTransport(inner: inner, route: "POST /push-registrations/activities")
+ let r = PushRegistrar(environment: .production, platform: .ios)
+ await r.attach(EquipoClient(transport: gate, token: "equipo.person.v1.TOKENFIXTURE"))
+ // Two activities wait for the device's registration.
+ await r.activityTokenChanged(startToken, task: "tk1", origin: here)
+ await r.activityTokenChanged(deviceToken, task: "tk2", origin: here)
+ gate.hold = true
+ // The pass registers the device, then is held on the first activity request.
+ let pass = Task { await r.deviceTokenChanged(deviceToken) }
+ await gate.waitUntilHeld()
+ await r.attach(nil)
+ gate.release()
+ await pass.value
+ let sent = inner.sent("POST /push-registrations/activities")
+ #expect(sent.count == 1, "signed out mid-pass: the second activity is never sent (\(sent.count) requests)")
+ }
+}
+
+/// A transport that holds one route's first request until released.
+final class GatedTransport: EquipoTransport, @unchecked Sendable {
+ let inner: ScriptedTransport
+ let route: String
+ var origin: URL { inner.origin }
+ private let lock = NSLock()
+ private var waiting: CheckedContinuation<Void, Never>?
+ private var heldOnce = false
+ private var heldSignal: CheckedContinuation<Void, Never>?
+ private var isHeld = false
+ var hold = false
+ init(inner: ScriptedTransport, route: String) { self.inner = inner; self.route = route }
+ func send(_ request: APIRequest) async throws -> APIResponse {
+ if hold, request.method + " " + request.path == route, !lock.withLock({ heldOnce }) {
+ await withCheckedContinuation { c in
+ lock.withLock { heldOnce = true; isHeld = true; waiting = c; let s = heldSignal; heldSignal = nil; s?.resume() }
+ }
+ }
+ return try await inner.send(request)
+ }
+ func lines(_ request: APIRequest) async throws -> AsyncThrowingStream<String, Error> { try await inner.lines(request) }
+ func waitUntilHeld() async {
+ if lock.withLock({ isHeld }) { return }
+ await withCheckedContinuation { c in
+ let now: Bool = lock.withLock { if isHeld { return true }; heldSignal = c; return false }
+ if now { c.resume() }
+ }
+ }
+ func release() { lock.withLock { let c = waiting; waiting = nil; return c }?.resume() }
+}
+
+@Suite struct PushEnvironmentTests {
+ private func profile(aps: String?) -> Data {
+ let entitlements = aps.map { "<key>aps-environment</key><string>\($0)</string>" } ?? ""
+ let plist = """
+ <?xml version="1.0" encoding="UTF-8"?>
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+ <plist version="1.0"><dict><key>Name</key><string>Equipo</string>
+ <key>Entitlements</key><dict>\(entitlements)<key>get-task-allow</key><true/></dict></dict></plist>
+ """
+ // A CMS envelope around it: bytes before and after.
+ return Data([0x30, 0x82, 0x0F, 0xFF]) + Data(plist.utf8) + Data([0xA0, 0x82, 0x00])
+ }
+
+ @Test func theGatewayComesFromTheBuild() {
+ #expect(PushEnvironment.resolve(platform: .ios, simulator: false, embeddedProfile: nil, signedEntitlement: nil) == .production,
+ "TestFlight and the App Store strip the profile")
+ #expect(PushEnvironment.resolve(platform: .ios, simulator: false, embeddedProfile: profile(aps: "development"), signedEntitlement: nil) == .development,
+ "an Xcode build on a device")
+ #expect(PushEnvironment.resolve(platform: .ios, simulator: false, embeddedProfile: profile(aps: "production"), signedEntitlement: nil) == .production)
+ #expect(PushEnvironment.resolve(platform: .ios, simulator: false, embeddedProfile: profile(aps: nil), signedEntitlement: nil) == nil,
+ "a profile without push cannot receive any")
+ #expect(PushEnvironment.resolve(platform: .ios, simulator: true, embeddedProfile: nil, signedEntitlement: nil) == .development)
+ #expect(PushEnvironment.resolve(platform: .macos, simulator: false, embeddedProfile: nil, signedEntitlement: "production") == .production,
+ "Developer ID")
+ #expect(PushEnvironment.resolve(platform: .macos, simulator: false, embeddedProfile: nil, signedEntitlement: nil) == nil,
+ "an ad hoc build has no push entitlement")
+ }
+
+ @Test func thisTestRunnerCannotReceivePushes() {
+ #expect(PushEnvironment.current == nil, "swift test is not signed with the entitlement")
+ }
+}
+
+@Suite struct PushRouteTests {
+ private func userInfo(_ golden: String) throws -> [AnyHashable: Any] {
+ try JSONSerialization.jsonObject(with: Fixture.data("push/" + golden)) as! [AnyHashable: Any]
+ }
+
+ @Test func aTapOpensTheRightPlace() throws {
+ #expect(PushRoute(userInfo: try userInfo("card")) == .card("c1"))
+ #expect(PushRoute(userInfo: try userInfo("card"))?.destination == Destination(pane: .conversation, cardID: "c1"),
+ "a card alert opens the conversation at the card")
+ #expect(PushRoute(userInfo: try userInfo("reply"))?.destination == Destination(pane: .conversation), "a reply opens the conversation")
+ #expect(PushRoute(userInfo: try userInfo("task-done"))?.destination == Destination(pane: .tasks, taskID: "tk1"), "a task alert opens the task")
+ #expect(PushRoute(userInfo: try userInfo("task-failed")) == .task("tk1"))
+ #expect(PushRoute(userInfo: try userInfo("badge")) == nil, "a badge opens nothing")
+ #expect(PushRoute(userInfo: ["equipo": ["kind": "card", "task_id": "tk1"]]) == .task("tk1"))
+ #expect(PushRoute(userInfo: ["equipo": ["kind": "something_new"]]) == nil)
+ #expect(PushRoute(userInfo: ["equipo": ["kind": "task"]]) == nil)
+ }
+
+ @Test func aLiveActivityOpensItsTask() {
+ let link = EquipoLink.task("tk1")
+ #expect(link.absoluteString == "works.oficina.equipo://task/tk1")
+ #expect(PushRoute(url: link) == .task("tk1"))
+ #expect(PushRoute(url: URL(string: "https://oficina.example.test/task/tk1")!) == nil)
+ #expect(PushRoute(url: URL(string: "someone-else://task/tk1")!) == nil, "only this app's own links")
+ #expect(PushRoute(url: URL(string: "works.oficina.equipo://card/c1")!) == nil)
+ #expect(PushRoute(url: URL(string: "works.oficina.equipo://task/")!) == nil)
+ }
+}
+
+@Suite struct LiveActivityStateTests {
+ private func aps(_ golden: String) throws -> [String: Any] {
+ let payload = try JSONSerialization.jsonObject(with: Fixture.data("push/" + golden)) as! [String: Any]
+ return payload["aps"] as! [String: Any]
+ }
+ /// ActivityKit decodes the content state with a plain JSONDecoder.
+ private func state(_ golden: String) throws -> EquipoTaskAttributes.ContentState {
+ let raw = try JSONSerialization.data(withJSONObject: try aps(golden)["content-state"]!)
+ return try JSONDecoder().decode(EquipoTaskAttributes.ContentState.self, from: raw)
+ }
+
+ @Test func theServersGoldensDecode() throws {
+ let start = try aps("activity-start")
+ #expect(start["attributes-type"] as? String == String(describing: EquipoTaskAttributes.self),
+ "push-to-start names this type")
+ let attributes = try JSONDecoder().decode(EquipoTaskAttributes.self, from: JSONSerialization.data(withJSONObject: start["attributes"]!))
+ #expect(attributes == EquipoTaskAttributes(taskID: "tk1", origin: "https://oficina.example.test"))
+ #expect(try state("activity-start") == .init(taskID: "tk1", title: "Fix login", stage: "in_progress", specialist: "engineering",
+ activity: "Reading README.md", needsYou: "", tone: "positive"))
+ #expect(try state("activity-update").outcome == nil)
+ let needs = try state("activity-needs")
+ #expect(needs.needsYou == "merge"); #expect(needs.tone == "warning"); #expect(needs.stage == "ready_to_merge")
+ #expect(try state("activity-end").outcome == "done")
+ #expect(try state("activity-replaced").outcome == "replaced")
+ }
+
+ @Test func theStateEncodesAsTheWireDoes() throws {
+ let start = try state("activity-start")
+ let encoded = try JSONSerialization.jsonObject(with: JSONEncoder().encode(start)) as! [String: String]
+ #expect(encoded.keys.sorted() == ["activity", "needs_you", "specialist", "stage", "task_id", "title", "tone"], "no outcome until it ended")
+ #expect(try JSONDecoder().decode(EquipoTaskAttributes.ContentState.self, from: JSONEncoder().encode(try state("activity-end"))).outcome == "done")
+ }
+
+ @Test func theActivityIsDrawnFromRoster() throws {
+ let running = TaskActivityPresentation(try state("activity-update"))
+ #expect(running.line == "Reading README.md")
+ #expect(running.tone == .positive)
+ #expect(running.specialist == .engineering)
+ #expect(running.track.map(\.state) == [.done, .current, .todo, .todo, .todo])
+ #expect(running.outcome == nil)
+ #expect(running.url == EquipoLink.task("tk1"))
+
+ let needs = TaskActivityPresentation(try state("activity-needs"))
+ #expect(needs.needsYou)
+ #expect(needs.tone == .warning, "amber while it needs you")
+ #expect(needs.line == "Needs you")
+ #expect(needs.track.first { $0.state == .current }?.stage == .readyToMerge)
+ #expect(needs.track.first { $0.state == .current }?.tone == .warning)
+ var waitingAnyway = try state("activity-needs"); waitingAnyway.tone = "positive"
+ #expect(TaskActivityPresentation(waitingAnyway).tone == .warning, "a needs-you activity is never green")
+
+ let done = TaskActivityPresentation(try state("activity-end"))
+ #expect(done.outcome == "Done"); #expect(done.line == "Done"); #expect(!done.needsYou)
+ #expect(done.track.map(\.state) == [.done, .done, .done, .done, .current])
+
+ var cancelled = try state("activity-update"); cancelled.stage = "cancelled"; cancelled.outcome = "cancelled"
+ #expect(TaskActivityPresentation(cancelled).track.isEmpty, "a cancelled task has no track")
+ #expect(TaskActivityPresentation(cancelled).line == "Cancelled")
+ var failed = try state("activity-update"); failed.outcome = "failed"; failed.tone = "negative"
+ #expect(TaskActivityPresentation(failed).line == "Stopped")
+ #expect(TaskActivityPresentation(failed).tone == .negative)
+ #expect(TaskActivityPresentation(try state("activity-replaced")).outcome == nil, "a replaced activity is dismissed at once")
+ }
+
+ @Test func anActivityTheAppKnowsEndedIsEnded() throws {
+ let tasks: ThinList<ThinTask> = try Fixture.decode("thin/tasks")
+ let items = tasks.items ?? []
+ let ended = LiveActivityPolicy.finished(running: ["tkqsrho7oq3n", "tkyiki7muqby", "gone"], tasks: items)
+ #expect(ended == ["tkyiki7muqby": "done"], "only the finished task; one the app cannot see is left to the server")
+ #expect(LiveActivityPolicy.finished(running: ["tkqsrho7oq3n"], tasks: items).isEmpty, "only activities that run")
+ }
+}
+
+/// A fake system: what the app model asked of it.
+@MainActor final class FakeNotifications: NotificationSystem {
+ var asked = 0
+ var badges: [Int] = []
+ var unregistered = 0
+ func askAndRegister() { asked += 1 }
+ func setBadge(_ count: Int) { badges.append(count) }
+ func unregister() { unregistered += 1 }
+}
+
+@MainActor @Suite struct RemoteRegistrationTests {
+ @Test func signingOutWhileAskingNeverRegistersAfterwards() async {
+ var calls: [String] = []
+ var release: CheckedContinuation<Void, Never>?
+ var asked = 0
+ let gate = RemoteRegistration(
+ authorize: {
+ asked += 1
+ if asked == 1 { await withCheckedContinuation { release = $0 } }
+ },
+ register: { calls.append("register") },
+ unregister: { calls.append("unregister") })
+ let asking = gate.request()
+ while release == nil { await Task.yield() }
+ gate.stop()
+ release?.resume()
+ await asking.value
+ #expect(calls == ["unregister"], "a pending permission prompt cannot undo a sign-out")
+ await gate.request().value
+ #expect(calls == ["unregister", "register"], "pairing again registers again")
+ }
+
+ @Test func signingOutBeforeTheAskStartsNeverRegisters() async {
+ var calls: [String] = []
+ let gate = RemoteRegistration(
+ authorize: { calls.append("authorize") },
+ register: { calls.append("register") },
+ unregister: { calls.append("unregister") })
+ let queued = gate.request()
+ gate.stop()
+ await queued.value
+ #expect(calls == ["unregister"], "an ask queued before sign-out is stale too")
+ }
+}
+
+@MainActor @Suite struct NotificationPermissionTests {
+ @Test func permissionIsAskedAfterPairingNotBefore() throws {
+ let fake = FakeNotifications()
+ let model = EquipoAppModel(store: MemorySecretStore(), notifications: fake, push: PushRegistrar(environment: nil))
+ #expect(fake.asked == 0, "no team yet: nothing is asked at launch")
+ var account = DeviceAccount.new(origin: URL(string: "https://oficina.example.test")!, label: "Test")
+ account.credential = try Fixture.decode("device-credential")
+ model.adopt(account, transport: ScriptedTransport())
+ #expect(fake.asked == 1, "asked once the device is paired")
+ }
+
+ @Test func theBadgeIsTheNeedsYouCountAndClearsOnSignOut() async throws {
+ let fake = FakeNotifications()
+ let model = EquipoAppModel(store: MemorySecretStore(), notifications: fake, push: PushRegistrar(environment: nil))
+ model.needsYouChanged(3)
+ #expect(fake.badges.isEmpty, "no team, no badge")
+ var account = DeviceAccount.new(origin: URL(string: "https://oficina.example.test")!, label: "Test")
+ account.credential = try Fixture.decode("device-credential")
+ model.adopt(account, transport: ScriptedTransport())
+ model.needsYouChanged(nil)
+ #expect(fake.badges.isEmpty, "an unknown count is not zero")
+ model.needsYouChanged(2)
+ #expect(fake.badges == [2])
+ model.sessionEnded()
+ #expect(fake.badges == [2, 0])
+ }
+
+ @Test func signingOutStopsDeliveryEvenWhenTheServerCannotBeReached() async throws {
+ let fake = FakeNotifications()
+ let model = EquipoAppModel(store: MemorySecretStore(), notifications: fake, push: PushRegistrar(environment: nil))
+ var account = DeviceAccount.new(origin: URL(string: "https://oficina.example.test")!, label: "Test")
+ account.credential = try Fixture.decode("device-credential")
+ let t = ScriptedTransport()
+ t.on("GET /auth/devices", .failure(.offline))
+ model.adopt(account, transport: t)
+ await model.signOut()
+ #expect(fake.unregistered == 1, "offline sign-out still stops this device receiving the team's notifications")
+ model.adopt(account, transport: ScriptedTransport())
+ model.sessionEnded()
+ #expect(fake.unregistered == 2, "a session the server ended stops them too")
+ }
+
+ @Test func aTapGoesWhereItSays() {
+ let model = EquipoAppModel(store: MemorySecretStore(), notifications: FakeNotifications(), push: PushRegistrar(environment: nil))
+ model.open(.card("c1"))
+ #expect(model.destination == Destination(pane: .conversation, cardID: "c1"))
+ model.open(.task("tk1"))
+ #expect(model.destination == Destination(pane: .tasks, taskID: "tk1"))
+ }
+}
diff --git a/native/apple/Tests/EquipoKitTests/SetAsideTests.swift b/native/apple/Tests/EquipoKitTests/SetAsideTests.swift
new file mode 100644
index 00000000..c3d341b8
--- /dev/null
+++ b/native/apple/Tests/EquipoKitTests/SetAsideTests.swift
@@ -0,0 +1,136 @@
+import Foundation
+import Testing
+@testable import EquipoKit
+
+/// Set aside (D5), as the web's chat_roster.go SetAside: bound to the
+/// revision seen, never an answer, and the card stays in Needs you,
+/// grouped under Set aside.
+@MainActor @Suite struct SetAsideTests {
+ private let mergeCard = "c_l6epp3pii6qpow5lqi2u3p4gab" // open, task tkqsrho7oq3n, revision 1
+ private let waiting = "tkqsrho7oq3n"
+
+ private func session(_ t: ScriptedTransport) async throws -> EquipoSession {
+ t.on("GET /snapshot", fixture: "thin/snapshot")
+ t.on("GET /tasks", fixture: "thin/tasks")
+ t.on("GET /needs-you", fixture: "thin/needs-you")
+ var account = DeviceAccount.new(origin: t.origin, label: "Test")
+ account.credential = try Fixture.decode("device-credential")
+ let accounts = DeviceAccounts(store: MemorySecretStore())
+ try accounts.save(account)
+ let s = EquipoSession(account: account, accounts: accounts, transport: t, sleep: { _ in })
+ await s.refresh()
+ return s
+ }
+ private func card(_ s: EquipoSession) throws -> ThinCard { try #require(s.cards.first { $0.id == mergeCard }) }
+ private func answer(_ card: ThinCard, aside: Bool, status: Int = 200) throws -> APIResponse {
+ var c = card; c.aside = aside ? true : nil
+ if status == 409 {
+ let body: [String: AnyEncodable] = ["code": .init("card_stale"), "copy_key": .init("api.card_stale"), "request_id": .init("r"), "card": .init(c)]
+ return APIResponse(status: 409, data: try wire.encode(body))
+ }
+ return APIResponse(status: 200, data: try wire.encode(c))
+ }
+ private var route: String { "POST /cards/\(mergeCard)/visibility" }
+ /// The server's JSON: snake case, RFC 3339 times.
+ private var wire: JSONEncoder {
+ let e = EquipoJSON.encoder
+ e.dateEncodingStrategy = .iso8601
+ return e
+ }
+
+ @Test func setAsideIsBoundToTheRevisionSeenAndNeverAnswers() async throws {
+ let t = ScriptedTransport(); let s = try await session(t)
+ let before = try card(s)
+ t.on(route, .success(try answer(before, aside: true)))
+ #expect(await s.setAside(before, true) == .answered)
+ let sent = try #require(t.sent(route).first)
+ let body = try JSONSerialization.jsonObject(with: try #require(sent.body)) as! [String: Any]
+ #expect(body["aside"] as? Bool == true)
+ #expect(body["revision"] as? Int == 1)
+ #expect(sent.ifMatch == 1)
+ #expect(try card(s).isAside)
+ #expect(try card(s).state == "open", "still waiting")
+ #expect(t.requests.allSatisfy { !$0.path.hasSuffix("/answer") }, "set aside never answers")
+ #expect(s.needsYou?.map(\.id) == [waiting], "still in Needs you")
+ }
+
+ @Test func undoBringsItBack() async throws {
+ let t = ScriptedTransport(); let s = try await session(t)
+ t.on(route, .success(try answer(try card(s), aside: true)), .success(try answer(try card(s), aside: false)))
+ _ = await s.setAside(try card(s), true)
+ #expect(await s.setAside(try card(s), false) == .answered)
+ let body = try JSONSerialization.jsonObject(with: try #require(t.sent(route).last?.body)) as! [String: Any]
+ #expect(body["aside"] as? Bool == false)
+ #expect(!(try card(s).isAside))
+ }
+
+ @Test func aChangedCardIsShownAsItIsAndNotSentAgain() async throws {
+ let t = ScriptedTransport(); let s = try await session(t)
+ let seen = try card(s)
+ var moved = seen; moved.revision = 2; moved.state = "answered"; moved.choice = "merge"
+ t.on(route, .success(try answer(moved, aside: false, status: 409)))
+ #expect(await s.setAside(seen, true) == .changed)
+ #expect(try card(s).revision == 2)
+ #expect(await s.setAside(try card(s), true) == .changed, "an answered card is no longer set aside")
+ #expect(t.sent(route).count == 1)
+ }
+
+ @Test func aLostSetAsideIsSentAgainAsItself() async throws {
+ let t = ScriptedTransport(); let s = try await session(t)
+ let seen = try card(s)
+ t.on(route, .failure(.offline), .failure(.offline), .failure(.offline), .success(try answer(seen, aside: true)))
+ #expect(await s.setAside(seen, true) == .offline)
+ #expect(await s.setAside(seen, true) == .answered)
+ let keys = Set(t.sent(route).map(\.idempotencyKey))
+ #expect(t.sent(route).count == 4)
+ #expect(keys.count == 1, "the same request each time")
+ }
+
+ @Test func onlyACardThatWaitsCanBeSetAside() throws {
+ let snapshot: Snapshot = try Fixture.decode("thin/snapshot")
+ let cards = snapshot.cards ?? []
+ #expect(Feed.canSetAside(try #require(cards.first { $0.id == mergeCard })))
+ #expect(!Feed.canSetAside(try #require(cards.first { $0.kind == "merge" && $0.state == "answered" })))
+ var report = try #require(cards.first { $0.kind == "task" }); report.state = "open"
+ #expect(!Feed.canSetAside(report), "a report is not a decision")
+ #expect(!Feed.canSetAside(try #require(cards.first { $0.kind == "project" })), "nor a receipt")
+ var closed = try #require(cards.first { $0.id == mergeCard }); closed.state = "answered"; closed.aside = true
+ #expect(!closed.isAside, "an answered card shows as answered, not set aside")
+ }
+
+ @Test func setAsideCardsWaitUnderSetAside() async throws {
+ let t = ScriptedTransport(); let s = try await session(t)
+ let needs = try #require(s.needsYou)
+ #expect(Feed.needsGroups(needs: needs, cards: s.cards).setAside.isEmpty)
+ t.on(route, .success(try answer(try card(s), aside: true)))
+ _ = await s.setAside(try card(s), true)
+ let groups = Feed.needsGroups(needs: needs, cards: s.cards)
+ #expect(groups.waiting.isEmpty)
+ #expect(groups.setAside.map(\.id) == [waiting])
+ var named = try card(s); named.name = "Swipe back"
+ #expect(Feed.asideTitle(named, task: s.task(waiting)) == "Swipe back on iOS", "named by its task, as the web does")
+ #expect(Feed.asideTitle(named, task: nil) == "Swipe back")
+ var bare = try card(s); bare.name = ""
+ #expect(Feed.asideTitle(bare, task: nil) == "Decision")
+ bare.kind = "question"
+ #expect(Feed.asideTitle(bare, task: nil) == "Question")
+ }
+
+ @Test func aReportBesideASetAsideDecisionIsWholeAgain() async throws {
+ let t = ScriptedTransport(); let s = try await session(t)
+ func compact() -> Bool? {
+ for case .report(_, _, let report, let compact) in Feed.build(s) where report.task.id == waiting { return compact }
+ return nil
+ }
+ #expect(compact() == true)
+ t.on(route, .success(try answer(try card(s), aside: true)))
+ _ = await s.setAside(try card(s), true)
+ #expect(compact() == false, "chat_roster.go: a set-aside card holds nothing to one line")
+ }
+
+ @Test func setAsideAndUndoSayWhatTheWebSays() {
+ #expect(EquipoStrings.text("roster.set_aside") == "Set aside")
+ #expect(EquipoStrings.text("roster.aside") == "Set aside, still in Needs you")
+ #expect(EquipoStrings.text("roster.undo") == "Undo")
+ }
+}
diff --git a/native/apple/Tests/EquipoKitTests/Support.swift b/native/apple/Tests/EquipoKitTests/Support.swift
index f0e3f15d..2b16896d 100644
--- a/native/apple/Tests/EquipoKitTests/Support.swift
+++ b/native/apple/Tests/EquipoKitTests/Support.swift
@@ -4,7 +4,8 @@ import Foundation
/// Answers requests from a script and records each one. A route is
/// "METHOD /path"; each answer is used once, the last one repeats.
final class ScriptedTransport: EquipoTransport, @unchecked Sendable {
- let origin = URL(string: "https://oficina.example.test")!
+ let origin: URL
+ init(origin: URL = URL(string: "https://oficina.example.test")!) { self.origin = origin }
private let lock = NSLock()
private var script: [String: [Result<APIResponse, EquipoAPIError>]] = [:]
private(set) var requests: [APIRequest] = []
diff --git a/native/ios/ActivityExtension/EquipoActivityBundle.swift b/native/ios/ActivityExtension/EquipoActivityBundle.swift
new file mode 100644
index 00000000..3295eb94
--- /dev/null
+++ b/native/ios/ActivityExtension/EquipoActivityBundle.swift
@@ -0,0 +1,10 @@
+import EquipoActivity
+import SwiftUI
+import WidgetKit
+
+/// The widget extension: only the task Live Activity. Its attributes, state
+/// and views live in the EquipoActivity package target, shared with the app.
+@main
+struct EquipoActivityBundle: WidgetBundle {
+ var body: some Widget { EquipoTaskLiveActivity() }
+}
diff --git a/native/ios/EquipoPhone.entitlements b/native/ios/EquipoPhone.entitlements
new file mode 100644
index 00000000..527170f6
--- /dev/null
+++ b/native/ios/EquipoPhone.entitlements
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <!-- Push notifications and Live Activity pushes (native slice 2).
+ Debug builds use APNs's development gateway, archives production
+ (EQUIPO_APS_ENVIRONMENT in project.yml). The App ID
+ works.oficina.equipo has the Push Notifications capability; its
+ profiles must carry aps-environment. -->
+ <key>aps-environment</key>
+ <string>$(EQUIPO_APS_ENVIRONMENT)</string>
+</dict>
+</plist>
diff --git a/native/ios/Sources/EquipoPhoneApp.swift b/native/ios/Sources/EquipoPhoneApp.swift
index 34c00217..91e68d83 100644
--- a/native/ios/Sources/EquipoPhoneApp.swift
+++ b/native/ios/Sources/EquipoPhoneApp.swift
@@ -3,7 +3,8 @@ import SwiftUI
@main
struct EquipoPhoneApp: App {
+ @UIApplicationDelegateAdaptor(EquipoPhoneDelegate.self) private var delegate
var body: some Scene {
- WindowGroup { PhoneRoot() }
+ WindowGroup { PhoneRoot(model: delegate.model) }
}
}
diff --git a/native/ios/project.yml b/native/ios/project.yml
index 57b48141..174305ff 100644
--- a/native/ios/project.yml
+++ b/native/ios/project.yml
@@ -24,11 +24,18 @@ targets:
dependencies:
- package: EquipoNative
product: EquipoKit
+ # The task Live Activity (native slice 2), embedded in the app.
+ - target: EquipoActivityExtension
settings:
base:
ASSETCATALOG_COMPILER_APPICON_NAME: AppIcon
PROVISIONING_PROFILE_SPECIFIER: $(OFICINA_PROVISIONING_PROFILE)
PRODUCT_BUNDLE_IDENTIFIER: works.oficina.equipo
+ # Push: aps-environment comes from the configuration, so an Xcode
+ # debug build on a device registers with APNs's development gateway
+ # and an archive (TestFlight, the App Store) with production. The
+ # app reads the gateway back from the build (PushEnvironment).
+ CODE_SIGN_ENTITLEMENTS: EquipoPhone.entitlements
TARGETED_DEVICE_FAMILY: '1'
GENERATE_INFOPLIST_FILE: true
# "Oficina Equipo" on the Home Screen and in Spotlight; "Equipo"
@@ -36,6 +43,11 @@ targets:
INFOPLIST_KEY_CFBundleDisplayName: Oficina Equipo
INFOPLIST_KEY_UILaunchScreen_Generation: true
INFOPLIST_KEY_UISupportedInterfaceOrientations: UIInterfaceOrientationPortrait
+ configs:
+ Debug:
+ EQUIPO_APS_ENVIRONMENT: development
+ Release:
+ EQUIPO_APS_ENVIRONMENT: production
info:
path: Info.plist
properties:
@@ -48,3 +60,37 @@ targets:
# reader's locale through Foundation's format styles.
CFBundleLocalizations:
- en
+ # A task's Live Activity, started and moved by the server's pushes.
+ NSSupportsLiveActivities: true
+ # A Live Activity's tap opens its task: works.oficina.equipo://task/<id>.
+ CFBundleURLTypes:
+ - CFBundleURLName: works.oficina.equipo
+ CFBundleURLSchemes:
+ - works.oficina.equipo
+ EquipoActivityExtension:
+ type: app-extension
+ platform: iOS
+ sources:
+ - ActivityExtension
+ dependencies:
+ - package: EquipoNative
+ product: EquipoActivity
+ settings:
+ base:
+ # Its own App ID and profile; it needs no entitlements.
+ PROVISIONING_PROFILE_SPECIFIER: $(OFICINA_ACTIVITY_PROVISIONING_PROFILE)
+ PRODUCT_BUNDLE_IDENTIFIER: works.oficina.equipo.activity
+ TARGETED_DEVICE_FAMILY: '1'
+ GENERATE_INFOPLIST_FILE: true
+ INFOPLIST_KEY_CFBundleDisplayName: Equipo
+ SKIP_INSTALL: true
+ info:
+ path: ActivityExtension-Info.plist
+ properties:
+ CFBundleShortVersionString: $(MARKETING_VERSION)
+ CFBundleVersion: $(CURRENT_PROJECT_VERSION)
+ CFBundleName: Equipo
+ CFBundleLocalizations:
+ - en
+ NSExtension:
+ NSExtensionPointIdentifier: com.apple.widgetkit-extension
diff --git a/native/mac-updates.json b/native/mac-updates.json
index 11dfe94c..cfd5a98c 100644
--- a/native/mac-updates.json
+++ b/native/mac-updates.json
@@ -3,6 +3,8 @@
"install": "automatic",
"url_schemes": [],
"localizations": ["en"],
+ "entitlements": "macos/DeveloperID.entitlements",
+ "provisioning_profile": "~/private_keys/oficina/profiles/Oficina-Equipo-macOS-Developer-ID.provisionprofile",
"feed_url": "https://raw.amadan.net/oficina/native-releases/main/equipo/appcast.xml",
"public_ed_key": "/FxO7cZnM7P5c9ZrUPUJvpCnR65sNmrzte+I5vHarE8=",
"keychain_account": "oficina"
diff --git a/native/macos/DeveloperID.entitlements b/native/macos/DeveloperID.entitlements
new file mode 100644
index 00000000..72cdda88
--- /dev/null
+++ b/native/macos/DeveloperID.entitlements
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <!-- Push notifications (native slice 2). A Developer ID app may carry
+ this only with an embedded Developer ID provisioning profile for
+ works.oficina.equipo that grants it (mac-updates.json names it);
+ Developer ID profiles grant production only. An ad hoc build drops
+ it (bundle-mac.py), gets no APNs token and does not register. -->
+ <key>com.apple.developer.aps-environment</key>
+ <string>production</string>
+</dict>
+</plist>
diff --git a/native/scripts/check-parity.py b/native/scripts/check-parity.py
index 2d0a11c4..b8026075 100755
--- a/native/scripts/check-parity.py
+++ b/native/scripts/check-parity.py
@@ -2,8 +2,9 @@
"""Keep the native apps in the web's words where they must match.
Every native string whose key is one of the web's copy keys (chat.card.*,
-work.tl.*) must equal copy.go's text for that key, so a merge card says
-exactly what the web says (sync proposal, parity row R-02)."""
+work.tl.*, roster.*) must equal copy.go's text for that key, so a merge card
+says exactly what the web says (sync proposal, parity row R-02), and Set
+aside and Undo say what the web's do (D5)."""
import json, re, sys
from pathlib import Path
@@ -18,7 +19,7 @@ for pattern in (r'chat\.card\.merge_chose_\w+', r'chat\.card\.ships_chose_\w+'):
if key not in strings:
problems.append(f'{key}: the web has this outcome; native has no words for it')
for key, text in sorted(strings.items()):
- if not key.startswith(('chat.card.', 'work.tl.')):
+ if not key.startswith(('chat.card.', 'work.tl.', 'roster.')):
continue
found = re.findall(r'"' + re.escape(key) + r'":\s*"((?:[^"\\]|\\.)*)"', copy)
if len(found) != 1:
diff --git a/native/scripts/check-strings.py b/native/scripts/check-strings.py
index e81d8b18..c6bf1f88 100755
--- a/native/scripts/check-strings.py
+++ b/native/scripts/check-strings.py
@@ -10,7 +10,9 @@ from pathlib import Path
native = Path(__file__).resolve().parents[1]
source = json.loads((native / 'scripts/strings.json').read_text())
-catalog_path = native / 'apple/Sources/EquipoKit/Resources/Localizable.xcstrings'
+# EquipoKit's catalog, and the same words for EquipoActivity, which the
+# iPhone's widget extension draws the Live Activity with on its own.
+catalog_paths = [native / 'apple/Sources' / target / 'Resources/Localizable.xcstrings' for target in ('EquipoKit', 'EquipoActivity')]
def catalog():
return {'sourceLanguage': 'en', 'version': '1.0', 'strings': {
@@ -35,10 +37,11 @@ for k in sorted(used_keys() - source.keys()): problems.append(f'no English text
for k, v in source.items():
if '—' in v: problems.append(f'em dash in {k}')
if '!' in v: problems.append(f'exclamation mark in {k}')
-if '--write' in sys.argv:
- catalog_path.write_text(json.dumps(catalog(), indent=2, ensure_ascii=False) + '\n')
-elif json.loads(catalog_path.read_text()) != catalog():
- problems.append('the catalog is out of date: run native/scripts/check-strings.py --write')
+for catalog_path in catalog_paths:
+ if '--write' in sys.argv:
+ catalog_path.write_text(json.dumps(catalog(), indent=2, ensure_ascii=False) + '\n')
+ elif not catalog_path.is_file() or json.loads(catalog_path.read_text()) != catalog():
+ problems.append(f'{catalog_path.relative_to(native)} is out of date: run native/scripts/check-strings.py --write')
for p in problems: print(p)
if problems: sys.exit(1)
# Facts look their words up by a key made from the wire value
diff --git a/native/scripts/strings.json b/native/scripts/strings.json
index 15aff146..a9d7d919 100644
--- a/native/scripts/strings.json
+++ b/native/scripts/strings.json
@@ -11,8 +11,6 @@
"account.title": "Account",
"account.until": "Signed in until",
"action.sending": "Sending…",
- "action.set_aside": "Set aside",
- "action.setting_aside": "Setting aside…",
"app.name": "Equipo",
"byline.asks": "asks",
"byline.reports": "reports",
@@ -108,6 +106,13 @@
"review.running": "Reviewing",
"review.same_account": "same family, same account",
"review.same_family": "same family",
+ "roster.aside": "Set aside, still in Needs you",
+ "roster.decision": "Decision",
+ "roster.question": "Question",
+ "roster.restoring": "Restoring…",
+ "roster.set_aside": "Set aside",
+ "roster.setting_aside": "Setting aside…",
+ "roster.undo": "Undo",
"settings.not_paired": "Pair this Mac with a team to see its settings.",
"specialist.checks": "Checks",
"specialist.coordinator": "Coordinator",