native: push notifications, a task Live Activity and Set aside (slice 2)
iPhone and Mac register for pushes once paired, with the gateway read from the build, and re-register when a token or the session changes. Taps open the card, the conversation or the task; the badge is the Needs you count. On iPhone, a widget extension draws a task's Live Activity from Roster (EquipoActivity, shared with the app), and the app sends each running activity's token. Set aside and Undo on cards, in the web's words, with Needs you grouping set-aside tasks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
49 files changed,
+3,939
−135
native/.gitignore+1 −0native/apple/Package.swift+7 −2native/apple/Sources/EquipoActivity/Resources/Localizable.xcstrings+1,810 −0native/apple/Sources/EquipoActivity/Roster.swift+74 −0native/apple/Sources/EquipoActivity/TaskActivity.swift+119 −0native/apple/Sources/EquipoActivity/TaskActivityWidget.swift+185 −0native/apple/Sources/EquipoKit/API/Push.swift+83 −0native/apple/Sources/EquipoKit/API/Thin.swift+5 −0native/apple/Sources/EquipoKit/Exports.swift+4 −0native/apple/Sources/EquipoKit/Pairing/SecretStore.swift+13 −7native/apple/Sources/EquipoKit/Presentation/Roster.swift+28 −64native/apple/Sources/EquipoKit/Push/LiveActivities.swift+87 −0native/apple/Sources/EquipoKit/Push/Notifications.swift+63 −0native/apple/Sources/EquipoKit/Push/PhoneDelegate.swift+28 −0native/apple/Sources/EquipoKit/Push/PushEnvironment.swift+63 −0native/apple/Sources/EquipoKit/Push/PushRegistrar.swift+108 −0native/apple/Sources/EquipoKit/Push/PushRoute.swift+56 −0native/apple/Sources/EquipoKit/Resources/Localizable.xcstrings+77 −22native/apple/Sources/EquipoKit/Session/EquipoSession.swift+30 −0native/apple/Sources/EquipoKit/UI/LiveCards.swift+107 −4native/apple/Sources/EquipoKit/UI/RosterViews.swift+3 −3native/apple/Sources/EquipoKit/UI/Screens/AppModel.swift+63 −4native/apple/Sources/EquipoKit/UI/Screens/ConversationScreen.swift+26 −2native/apple/Sources/EquipoKit/UI/Screens/PhoneRoot.swift+32 −5native/apple/Sources/EquipoKit/UI/Screens/TaskScreens.swift+13 −5native/apple/Sources/EquipoMac/EquipoMacApp.swift+25 −1native/apple/Sources/EquipoMac/LiveTranscript.swift+114 −3native/apple/Sources/EquipoMac/MacMainView.swift+17 −2native/apple/Tests/EquipoKitTests/Fixtures/push/activity-end.json+17 −0native/apple/Tests/EquipoKitTests/Fixtures/push/activity-needs.json+20 −0native/apple/Tests/EquipoKitTests/Fixtures/push/activity-replaced.json+17 −0native/apple/Tests/EquipoKitTests/Fixtures/push/activity-start.json+24 −0native/apple/Tests/EquipoKitTests/Fixtures/push/activity-update.json+15 −0native/apple/Tests/EquipoKitTests/Fixtures/push/badge.json+5 −0native/apple/Tests/EquipoKitTests/Fixtures/push/card.json+16 −0native/apple/Tests/EquipoKitTests/Fixtures/push/reply.json+13 −0native/apple/Tests/EquipoKitTests/Fixtures/push/task-done.json+14 −0native/apple/Tests/EquipoKitTests/Fixtures/push/task-failed.json+14 −0native/apple/Tests/EquipoKitTests/PushTests.swift+302 −0native/apple/Tests/EquipoKitTests/SetAsideTests.swift+136 −0native/ios/ActivityExtension/EquipoActivityBundle.swift+10 −0native/ios/EquipoPhone.entitlements+13 −0native/ios/Sources/EquipoPhoneApp.swift+2 −1native/ios/project.yml+46 −0native/mac-updates.json+2 −0native/macos/DeveloperID.entitlements+13 −0native/scripts/check-parity.py+4 −3native/scripts/check-strings.py+8 −5native/scripts/strings.json+7 −2
CI failed — run details
CI log
=== prepare ===
ci-box: machine: aarch64, 32 CPUs, 62 GiB memory, kernel 7.0.0-1017-aws
ci-box: python 3.12.3; Docker version 29.1.3, build 29.1.3-0ubuntu3~24.04.2
ci-box: user namespaces allowed: 233151
ci-box: cgroup: cgroup2fs
ci-box: disk /home/ci/work/repos/oficina__equipo/wt/native__push: Type Size Avail | ext4 96G 87G
ci-box: disk /home/ci/.cache/equipo-ci-box: Type Size Avail | ext4 96G 87G
ci-box: bwrap: fetched and verified in 0.3s
ci-box: claude: fetched and verified in 1.4s
ci-box: codex: fetched and verified in 3.4s
ci-box: codex-code-mode-host: fetched and verified in 1.3s
ci-box: libwrap: fetched and verified in 0.3s
ci-box: socat: fetched and verified in 0.4s
npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead
ci-box: image pulled in 10.0s
ci-box: pi: installed and verified in 7.6s
ci-box: opencode: installed and verified in 2.0s
ci-box: chromium 156.0.8078.79-1~deb13u1: 76 packages fetched, verified and unpacked in 8.7s
ci-box: clone deepened in 3.1s
ci-box: file times set from content: 2753 files, 180 directories
ci-box: ready in 16.5s
=== copy ===
EQUIPO_RELEASE_COPY_CHECK=1 CGO_ENABLED=0 go test ./internal/equipotest -run '^TestReleaseCopyReviewed$' -count=1
ok amadan.net/oficina/equipo/internal/equipotest 0.240s
=== compile ===
go build ./...
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py compile
+ go build -tags testbuild ./...
1.0s
+ go list -export -test -tags testbuild -f ./...
0.6s
+ go list -export -test -tags browser,testbuild -f ./internal/equipo ./internal/headless ./internal/idtest ./internal/plan3test ./internal/thintest
0.2s
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -version
staticcheck 2026.1 (v0.7.0)
go run golang.org/x/vuln/cmd/govulncheck@v1.8.0 -version
Go: go1.26.11
Scanner: govulncheck@v1.8.0
DB: https://vuln.go.dev
DB updated: 2026-11-11 02:51:11 +0000 UTC
go run github.com/zricethezav/gitleaks/v8@v8.30.1 version
version is set by build process
=== check ===
--- shard 0 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-work: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadless$/^4c_rebase$|^TestHeadless$/^4b_ask$|^TestHeadless$/^4c_checks_card$|^TestHeadless$/^4_step_crash$' ./internal/headless
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed
rastrillo: budget test: go test failed
--- FAIL amadan.net/oficina/equipo/internal/headless TestHeadless
=== RUN TestHeadless
--- FAIL: TestHeadless (70.85s)
--- FAIL amadan.net/oficina/equipo/internal/headless TestHeadless/4c_rebase
=== RUN TestHeadless/4c_rebase
time=2026-11-20T08:42:25.794Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-20T08:42:25.794Z level=INFO msg="startup phase done" phase=state_lock took=70µs
time=2026-11-20T08:42:25.794Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-20T08:42:25.794Z level=INFO msg="startup phase done" phase=claim_roots took=82µs
time=2026-11-20T08:42:25.794Z level=INFO msg="startup phase" phase=sweep
time=2026-11-20T08:42:25.820Z level=INFO msg="startup phase done" phase=sweep took=25.281ms
time=2026-11-20T08:42:25.820Z level=INFO msg="startup phase" phase=credentials
time=2026-11-20T08:42:25.820Z level=INFO msg="startup phase done" phase=credentials took=213µs
time=2026-11-20T08:42:25.820Z level=INFO msg="startup phase" phase=open_state
time=2026-11-20T08:42:25.860Z level=INFO msg="startup phase done" phase=open_state took=40.35ms
time=2026-11-20T08:42:25.861Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-20T08:42:25.862Z level=INFO msg=connecting host=127.0.0.1:38221 protocol=28
time=2026-11-20T08:42:25.863Z level=INFO msg=connected host=127.0.0.1:38221 took=930µs
time=2026-11-20T08:42:25.863Z level=INFO msg="capabilities gathering"
time=2026-11-20T08:42:25.863Z level=INFO msg="capabilities gathered" took=399µs tags=linux,claude,go
time=2026-11-20T08:42:25.864Z level=INFO msg="hello sent" protocol=28
time=2026-11-20T08:42:25.871Z level=INFO msg=welcome protocol=28 role=primary generation=1
time=2026-11-20T08:42:26.718Z level=INFO msg="connection checked" connection=claude-1 state=healthy
time=2026-11-20T08:42:30.848Z level=INFO msg="kept sessions" kept=1 bytes=2824 expired=0
time=2026-11-20T08:42:36.409Z level=INFO msg="kept sessions" kept=2 bytes=5030 expired=0
merge_test.go:245: steps [engineering:done checks:passed review:approve merge:merge_conflict engineering:queued], want [engineering:done checks:passed review:approve merge:merge_conflict engineering:done checks:passed review:approve merge:done] (in_progress )
time=2026-11-20T08:42:36.482Z level=WARN msg="step clone" err=*exec.ExitError
--- FAIL: TestHeadless/4c_rebase (11.09s)
--- FAIL amadan.net/oficina/equipo/internal/headless (package output)
FAIL
rastrillo-budget/v1 ran 1m10.851s
FAIL amadan.net/oficina/equipo/internal/headless 71.189s
receipt: test step 1m12.361s 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 1m10.851s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m10.85s amadan.net/oficina/equipo/internal/headless TestHeadless
exit status 1
+ go test -tags testbuild -timeout 15m -run '^TestHeadless$/^4c_rebase$|^TestHeadless$/^4b_ask$|^TestHeadless$/^4c_checks_card$|^TestHeadless$/^4_step_crash$' -v -run '^TestHeadless$/^4c_rebase$' -count=1 ./internal/headless (retry, once)
##############################################################################
FLAKE ./internal/headless:TestHeadless/4c_rebase headless-work 0f5f95599308fceab01ff1527f21d2d5b892891c 11.09s 34.73
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 30.99, cpu waiting 17.87%, memory waiting 0.00%, io waiting 0.47%
--- shard 1 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-review: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadless$/^4_review$|^TestHeadless$/^2b_access$|^TestHeadless$/^runner_crash$|^TestHeadless$/^2b_first_message$|^TestHeadless$/^4_checks_honest$|^TestHeadless$/^7_stream_resume$|^TestHeadless$/^2b_notebook$|^TestHeadless$/^2b_move_in$|^TestHeadless$/^2b_desk_failure$|^TestHeadless$/^cancel$' ./internal/headless
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed
receipt: test step 1m20.731s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m19.2s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m19.2s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 34.43, cpu waiting 20.81%, memory waiting 0.00%, io waiting 0.58%
--- shard 2 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-connections: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadlessConnections$|^TestHeadlessTokenPasteEndToEnd$|^TestHeadlessTokenConnection$' ./internal/headless
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed
receipt: test step 1m21.955s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m19.902s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m9.57s amadan.net/oficina/equipo/internal/headless TestHeadlessConnections
receipt: slow test 5.71s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenPasteEndToEnd
receipt: slow test 4.63s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenConnection
machine: 32 CPUs, load 34.43, cpu waiting 20.46%, memory waiting 0.00%, io waiting 0.56%
--- shard 3 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-mac: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestMacWorker$|^TestHeadlessAttachments$|^TestHeadlessPrewarm$|^TestHeadless$/^1_first_token$|^TestHeadless$/^6_quick_messages$|^TestHeadless$/^8_instance_restart$|^TestHeadless$/^3_runner_offline$' ./internal/headless
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed
receipt: test step 1m17.216s 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.682s amadan.net/oficina/equipo/internal/headless
receipt: slow test 36.13s amadan.net/oficina/equipo/internal/headless TestMacWorker
receipt: slow test 19.96s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 10.12s amadan.net/oficina/equipo/internal/headless TestHeadlessAttachments
receipt: slow test 9.47s amadan.net/oficina/equipo/internal/headless TestHeadlessPrewarm
machine: 32 CPUs, load 34.43, cpu waiting 21.05%, memory waiting 0.00%, io waiting 0.60%
--- shard 4 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-guards: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadlessCopyRotation$|^TestHeadlessPolicyGuards$|^TestHeadlessRunnerKillLeavesNoCopies$|^TestHeadlessNewHouseRuleStartsFresh$|^TestHeadless$/^3_engineering$|^TestHeadless$/^3_step_cancel$|^TestHeadless$/^3_step_contained$|^TestHeadless$/^3_empty_repo$|^TestHeadless$/^3_empty_engineering$|^TestHeadless$/^3_empty_merge$|^TestHeadless$/^3_empty_merge_rebuilt$|^TestHeadless$/^3_empty_fix_round$' ./internal/headless
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed
receipt: test step 1m34.348s 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.731s amadan.net/oficina/equipo/internal/headless
receipt: slow test 58.01s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 10.79s amadan.net/oficina/equipo/internal/headless TestHeadlessRunnerKillLeavesNoCopies
receipt: slow test 9.65s amadan.net/oficina/equipo/internal/headless TestHeadlessCopyRotation
receipt: slow test 8.55s amadan.net/oficina/equipo/internal/headless TestHeadlessPolicyGuards
receipt: slow test 5.72s amadan.net/oficina/equipo/internal/headless TestHeadlessNewHouseRuleStartsFresh
machine: 32 CPUs, load 30.99, cpu waiting 17.32%, memory waiting 0.00%, io waiting 0.46%
--- shard 5 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-rest: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -skip '^TestHeadless$/^4c_rebase$|^TestHeadless$/^4b_ask$|^TestHeadless$/^4c_checks_card$|^TestHeadless$/^4_step_crash$|^TestHeadless$/^4_review$|^TestHeadless$/^2b_access$|^TestHeadless$/^runner_crash$|^TestHeadless$/^2b_first_message$|^TestHeadless$/^4_checks_honest$|^TestHeadless$/^7_stream_resume$|^TestHeadless$/^2b_notebook$|^TestHeadless$/^2b_move_in$|^TestHeadless$/^2b_desk_failure$|^TestHeadless$/^cancel$|^TestHeadlessConnections$|^TestHeadlessTokenPasteEndToEnd$|^TestHeadlessTokenConnection$|^TestMacWorker$|^TestHeadlessAttachments$|^TestHeadlessPrewarm$|^TestHeadless$/^1_first_token$|^TestHeadless$/^6_quick_messages$|^TestHeadless$/^8_instance_restart$|^TestHeadless$/^3_runner_offline$|^TestHeadlessCopyRotation$|^TestHeadlessPolicyGuards$|^TestHeadlessRunnerKillLeavesNoCopies$|^TestHeadlessNewHouseRuleStartsFresh$|^TestHeadless$/^3_engineering$|^TestHeadless$/^3_step_cancel$|^TestHeadless$/^3_step_contained$|^TestHeadless$/^3_empty_repo$|^TestHeadless$/^3_empty_engineering$|^TestHeadless$/^3_empty_merge$|^TestHeadless$/^3_empty_merge_rebuilt$|^TestHeadless$/^3_empty_fix_round$' ./internal/headless
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed
receipt: test step 3m4.143s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 3m2.095s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m41.85s amadan.net/oficina/equipo/internal/headless TestHeadlessAssistant
receipt: slow test 23.41s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 11.19s amadan.net/oficina/equipo/internal/headless TestHeadlessResearchHandoff
receipt: slow test 7.96s amadan.net/oficina/equipo/internal/headless TestHeadlessClaudeSignIn
receipt: slow test 7.24s amadan.net/oficina/equipo/internal/headless TestHeadlessTurnBatching
machine: 32 CPUs, load 9.27, cpu waiting 3.90%, memory waiting 0.00%, io waiting 0.09%
--- 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 373ms against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 1m55.436s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 7.74s amadan.net/oficina/equipo/internal/thintest TestContractTeamJobSettledStates
receipt: slow test 6.72s amadan.net/oficina/equipo/internal/thintest TestExplorePreviewsOff
receipt: slow test 3.66s amadan.net/oficina/equipo/internal/thintest TestContractPreviewHeldUntilPublishAnswer
receipt: slow test 3.42s amadan.net/oficina/equipo/internal/thintest TestContractTeamNudgePersonNeeds
receipt: slow test 2.42s amadan.net/oficina/equipo/internal/thintest TestResearchDoneFallsBack
machine: 32 CPUs, load 1.35, cpu waiting 0.88%, memory waiting 0.00%, io waiting 2.15%
--- 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 317ms against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 1m21.593s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 9.09s amadan.net/oficina/equipo/internal/thintest TestContractPreviewNotScheduled
receipt: slow test 5s amadan.net/oficina/equipo/internal/thintest TestContractPublishNotOffered
receipt: slow test 4.35s amadan.net/oficina/equipo/internal/thintest TestContractMacRecheckMergeAuthority
receipt: slow test 2.35s amadan.net/oficina/equipo/internal/thintest TestContractPublishNameTaken
receipt: slow test 2.34s amadan.net/oficina/equipo/internal/thintest TestContractPreview
machine: 32 CPUs, load 1.35, cpu waiting 0.00%, memory waiting 0.00%, io waiting 2.13%
--- 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 4m26.694s, over the 45s its record on line 44 allows; reported only, timing fails on CI
receipt: test step 4m39.691s 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 4m26.694s amadan.net/oficina/equipo/internal/runner/thin
receipt: slow test 36.92s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeAnsweredByAnotherModel
receipt: slow test 36.89s amadan.net/oficina/equipo/internal/runner/thin TestModelsEngineeringProbesThenRunsTheStrongest
receipt: slow test 36.76s amadan.net/oficina/equipo/internal/runner/thin TestModelsUnhealthyRetriedOnDemand
receipt: slow test 18.44s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeRunsInsideTheAdmission
receipt: slow test 6.8s amadan.net/oficina/equipo/internal/runner/thin TestOpenCodeStepsRealOpenCode
machine: 32 CPUs, load 2.59, cpu waiting 0.78%, 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 47.053s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 45.977s amadan.net/oficina/equipo/internal/runner
receipt: slow test 25.95s amadan.net/oficina/equipo/internal/runner TestDirectBugWorkflow
receipt: slow test 20.02s amadan.net/oficina/equipo/internal/runner TestEnrolKeepsTheRole
machine: 32 CPUs, load 30.92, cpu waiting 20.23%, memory waiting 0.00%, io waiting 1.00%
--- shard 10 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane runner-plans: ./internal/runner
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestPlanWorkflowCandidateOrder$|^TestPlanWorkflowFeature$|^TestCoordinatorRecoveryCallRefusalKeepsServing$|^TestCoordinatorRefusalMatrix$' ./internal/runner
cache miss: amadan.net/oficina/equipo/internal/runner: its inputs changed
receipt: test step 46.113s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 44.266s amadan.net/oficina/equipo/internal/runner
receipt: slow test 34.34s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowCandidateOrder
receipt: slow test 30.49s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowFeature
receipt: slow test 8.39s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryCallRefusalKeepsServing
receipt: slow test 1.52s amadan.net/oficina/equipo/internal/runner TestCoordinatorRefusalMatrix
machine: 32 CPUs, load 30.83, cpu waiting 20.31%, memory waiting 0.00%, io waiting 1.03%
--- shard 11 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane runner-rest: ./internal/runner
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -skip '^TestDirectBugWorkflow$|^TestEnrolKeepsTheRole$|^TestPlanWorkflowCandidateOrder$|^TestPlanWorkflowFeature$|^TestCoordinatorRecoveryCallRefusalKeepsServing$|^TestCoordinatorRefusalMatrix$' ./internal/runner
cache miss: amadan.net/oficina/equipo/internal/runner: its inputs changed
receipt: test step 34.805s 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 33.96s amadan.net/oficina/equipo/internal/runner
receipt: slow test 5.12s amadan.net/oficina/equipo/internal/runner TestDirectFaultIsolation
receipt: slow test 3.33s amadan.net/oficina/equipo/internal/runner TestClaimRefusalsBackOff
receipt: slow test 3.11s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryRefusedKeepsServing
receipt: slow test 2.04s amadan.net/oficina/equipo/internal/runner TestToolVerbUnderFakeHarness
receipt: slow test 1.61s amadan.net/oficina/equipo/internal/runner TestReportPostsRetryExactRequest
machine: 32 CPUs, load 26.38, cpu waiting 13.80%, memory waiting 0.00%, io waiting 1.26%
--- 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 27.8%, load 18.41
test lane equipotest-a: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^Test[A-D]|^TestQ' ./internal/equipotest
cache miss: amadan.net/oficina/equipo/internal/equipotest: its inputs changed
receipt: test step 1m4.611s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m2.757s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 27.46s amadan.net/oficina/equipo/internal/equipotest TestAuthorityCoreIntegration
receipt: slow test 27.36s amadan.net/oficina/equipo/internal/equipotest TestBootstrapNamesOwnersSetting
receipt: slow test 25.43s amadan.net/oficina/equipo/internal/equipotest TestAccountLabelMigration
receipt: slow test 22.99s amadan.net/oficina/equipo/internal/equipotest TestBudgetConfigurationFailuresAreAtomic
receipt: slow test 22.79s amadan.net/oficina/equipo/internal/equipotest TestAuthorityRejectsMismatchedTarget
machine: 32 CPUs, load 30.99, cpu waiting 16.78%, memory waiting 0.00%, io waiting 0.44%
--- 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 27.8%, load 18.41
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 439ms against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 1m12.003s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 19.04s amadan.net/oficina/equipo/internal/equipotest TestProjectWritesRequireCurrentOwner
receipt: slow test 19.02s amadan.net/oficina/equipo/internal/equipotest TestProjectsFailuresRollBack
receipt: slow test 18.97s amadan.net/oficina/equipo/internal/equipotest TestProjectsAccountRevisionAndValidation
receipt: slow test 18.97s amadan.net/oficina/equipo/internal/equipotest TestProjectRequestActorAndUpdate
receipt: slow test 18.92s amadan.net/oficina/equipo/internal/equipotest TestProjectRetryAndRevision
machine: 32 CPUs, load 18.41, cpu waiting 11.20%, memory waiting 0.00%, io waiting 1.35%
--- shard 14 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-r started 30s late; cpu waiting 27.8%, load 18.41
test lane equipotest-r: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestR' ./internal/equipotest
cache miss: amadan.net/oficina/equipo/internal/equipotest: its inputs changed
receipt: test step 1m14.276s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m2.932s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 14.72s amadan.net/oficina/equipo/internal/equipotest TestReleaseStampContract
receipt: slow test 12.69s amadan.net/oficina/equipo/internal/equipotest TestRosterChangesAffectExistingSession
receipt: slow test 9.69s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalWhileAssigned
receipt: slow test 9.67s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalRollsBack
receipt: slow test 6.6s amadan.net/oficina/equipo/internal/equipotest TestRosterAuditFailureRollsBack
machine: 32 CPUs, load 26.61, cpu waiting 14.72%, memory waiting 0.00%, io waiting 0.39%
--- 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 27.8%, load 18.41
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 433ms against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 1m5.204s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 24.23s amadan.net/oficina/equipo/internal/equipotest TestSigninNoProof
receipt: slow test 23.74s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedExistingTeam
receipt: slow test 23.61s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedRollback
receipt: slow test 21.96s amadan.net/oficina/equipo/internal/equipotest TestSpecialistSettingsCurrentOwner
receipt: slow test 21.92s amadan.net/oficina/equipo/internal/equipotest TestSigninBackgroundSweep
machine: 32 CPUs, load 18.41, cpu waiting 11.20%, memory waiting 0.00%, io waiting 1.35%
--- 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 27.8%, load 18.41
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 612ms against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 48.507s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 3.47s amadan.net/oficina/equipo/internal/plan3test TestPlan3Upgrade
receipt: slow test 3.46s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3B
receipt: slow test 1.52s amadan.net/oficina/equipo/internal/plan3test TestConversationQuestionRace
receipt: slow test 1.4s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3A
receipt: slow test 1.22s amadan.net/oficina/equipo/internal/plan3test TestPlanMigrationUpgrade
machine: 32 CPUs, load 18.41, cpu waiting 11.20%, memory waiting 0.00%, io waiting 1.35%
--- 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 27.8%, load 18.41
test lane rest: ./cmd/equipo ./cmd/equipo-runner ./cmd/equipo-tool-proxy ./internal/advice ./internal/attach ./internal/attach/attachtest ./internal/chatmarkdown ./internal/chatsend ./internal/chatstream ./internal/coordinator ./internal/coordinatorcontract ./internal/coordinatormail ./internal/copydesk ./internal/equipo ./internal/equipo/activity ./internal/equipo/assist ./internal/equipo/chat ./internal/equipo/conversation ./internal/equipo/conversation/chatstate ./internal/equipo/housekeeping ./internal/equipo/icons ./internal/equipo/identity ./internal/equipo/kernel ./internal/equipo/library ./internal/equipo/mergegate ./internal/equipo/notifications ./internal/equipo/oficina ./internal/equipo/oficina/oficinatest ./internal/equipo/oficinaid ./internal/equipo/ownermode ./internal/equipo/personapi ./internal/equipo/planning ./internal/equipo/setup ./internal/equipo/team ./internal/equipo/teamcontract ./internal/equipo/triage ./internal/fakeclaude ./internal/fakecodex ./internal/fakeopencode ./internal/fakepi ./internal/idtest ./internal/ownermodetest ./internal/release ./internal/runner/checks ./internal/runner/connect ./internal/runner/containment ./internal/runner/containment/sysunix ./internal/runner/egress ./internal/runner/forge ./internal/runner/forge/forgetest ./internal/runner/heartbeat ./internal/runner/mac ./internal/runner/mcpresource ./internal/runner/metered ./internal/runner/planflow ./internal/runner/provider ./internal/runner/provider/claude ./internal/runner/provider/codex ./internal/runner/provider/gotoolchain ./internal/runner/provider/opencode ./internal/runner/provider/pi ./internal/runner/setup ./internal/runner/transporttest ./internal/runner/webread ./internal/runner/workspace ./internal/runnerproto ./internal/schedule ./internal/sealbox ./internal/specialist ./internal/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/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/runner/webread: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/copydesk: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/opencode: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/forge: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/equipo/team: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/claude: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/workspace: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/codex: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/checks: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/containment: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/pi: its inputs changed
budget note: internal/equipo took 19.269s, over the 10s the default allows (measured on the run this cached result came from); reported only, timing fails on CI
budget note: internal/equipo/chat took 13.726s, over the 10s the default allows (measured on the run this cached result came from); reported only, timing fails on CI
budget note: internal/idtest took 38.1s, over the 10s the default allows (measured on the run this cached result came from); reported only, timing fails on CI
budget note: internal/release took 18.73s, 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 38.651s, over the 15s its record on line 40 allows; reported only, timing fails on CI
receipt: test step 2m14.928s against a 60s target (the gate's other steps are not in this figure)
receipt: 11 packages ran, 49 cached, 18 without tests, 0 failed
receipt: slow package 52.162s amadan.net/oficina/equipo/internal/runner/provider/opencode
receipt: slow package 51.385s amadan.net/oficina/equipo/internal/runner/provider/pi
receipt: slow package 38.651s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow package 38.1s amadan.net/oficina/equipo/internal/idtest
receipt: slow package 35.809s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow test 20.96s amadan.net/oficina/equipo/internal/runner/provider/opencode TestOpenCodeAcceptanceHostileRepository
receipt: slow test 15.14s amadan.net/oficina/equipo/internal/runner/containment TestEngineeringOfflineGo
receipt: slow test 10.58s amadan.net/oficina/equipo/internal/idtest TestIDCallbackGuardAndPendingNonce
receipt: slow test 9.5s amadan.net/oficina/equipo/cmd/equipo-runner TestReleaseRunnerHasNoFakeWorker
receipt: slow test 9.21s amadan.net/oficina/equipo/internal/runner/containment TestEngineeringMissingModuleCache
machine: 32 CPUs, load 12.43, cpu waiting 5.26%, memory waiting 0.00%, io waiting 0.13%
--- shard 18 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-chat: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$' ./internal/headless
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed
receipt: test step 1m21.21s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m19.88s amadan.net/oficina/equipo/internal/headless
receipt: slow test 37.04s amadan.net/oficina/equipo/internal/headless TestBrowserDraftIsTheMessage
receipt: slow test 15.13s amadan.net/oficina/equipo/internal/headless TestBrowserDraftStreamsFormatted
receipt: slow test 10.33s amadan.net/oficina/equipo/internal/headless TestBrowserChat
receipt: slow test 7.62s amadan.net/oficina/equipo/internal/headless TestBrowserComposer
receipt: slow test 5.39s amadan.net/oficina/equipo/internal/headless TestBrowserChatSendStaysOnPage
machine: 32 CPUs, load 34.08, cpu waiting 20.46%, memory waiting 0.00%, io waiting 0.56%
--- 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
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed
receipt: test step 1m29.943s 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 1m28.392s amadan.net/oficina/equipo/internal/headless
receipt: slow test 25.33s amadan.net/oficina/equipo/internal/headless TestBrowserRailFollowsWork
receipt: slow test 21.77s amadan.net/oficina/equipo/internal/headless TestBrowserTaskThread
receipt: slow test 13.82s amadan.net/oficina/equipo/internal/headless TestBrowserReceiptFollowsReview
receipt: slow test 9.98s amadan.net/oficina/equipo/internal/headless TestBrowserAskAfterMerge
receipt: slow test 7.88s amadan.net/oficina/equipo/internal/headless TestBrowserTaskCard
machine: 32 CPUs, load 32.47, cpu waiting 17.87%, memory waiting 0.00%, io waiting 0.47%
--- shard 20 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-connections: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^TestBrowserConnections|^TestBrowserPasteBox$|^TestBrowserPasteCopiesItsBox$' ./internal/headless
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed
receipt: test step 1m39.141s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m37.608s amadan.net/oficina/equipo/internal/headless
receipt: slow test 13.57s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsConversation
receipt: slow test 12.94s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAddPage
receipt: slow test 12.83s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAdd
receipt: slow test 10.25s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsMeteredLimitRequired
receipt: slow test 10.16s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsOpenCodeGoLimitRequired
machine: 32 CPUs, load 28.75, cpu waiting 15.70%, memory waiting 0.00%, io waiting 0.41%
--- 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-20T08:42:02.522Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-20T08:42:02.522Z level=INFO msg="startup phase done" phase=state_lock took=226µs
time=2026-11-20T08:42:02.522Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-20T08:42:02.523Z level=INFO msg="startup phase done" phase=claim_roots took=191µs
time=2026-11-20T08:42:02.523Z level=INFO msg="startup phase" phase=sweep
time=2026-11-20T08:42:02.553Z level=INFO msg="startup phase done" phase=sweep took=30.752ms
time=2026-11-20T08:42:02.554Z level=INFO msg="startup phase" phase=credentials
time=2026-11-20T08:42:02.555Z level=INFO msg="startup phase done" phase=credentials took=298µs
time=2026-11-20T08:42:02.555Z level=INFO msg="startup phase" phase=open_state
time=2026-11-20T08:42:02.596Z level=INFO msg="startup phase done" phase=open_state took=41.571ms
time=2026-11-20T08:42:02.597Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-20T08:42:02.599Z level=INFO msg=connecting host=127.0.0.1:45251 protocol=28
time=2026-11-20T08:42:02.601Z level=INFO msg=connected host=127.0.0.1:45251 took=1.834ms
time=2026-11-20T08:42:02.601Z level=INFO msg="capabilities gathering"
time=2026-11-20T08:42:02.601Z level=INFO msg="capabilities gathered" took=500µs tags=linux,claude,go
time=2026-11-20T08:42:02.605Z level=INFO msg="hello sent" protocol=28
time=2026-11-20T08:42:02.608Z 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: <nil>)
--- FAIL: TestBrowserCopyContinue (6.16s)
--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserEmptyExplore
=== RUN TestBrowserEmptyExplore
time=2026-11-20T08:42:36.547Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-20T08:42:36.547Z level=INFO msg="startup phase done" phase=state_lock took=66µs
time=2026-11-20T08:42:36.547Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-20T08:42:36.547Z level=INFO msg="startup phase done" phase=claim_roots took=94µs
time=2026-11-20T08:42:36.547Z level=INFO msg="startup phase" phase=sweep
time=2026-11-20T08:42:36.573Z level=INFO msg="startup phase done" phase=sweep took=26.195ms
time=2026-11-20T08:42:36.573Z level=INFO msg="startup phase" phase=credentials
time=2026-11-20T08:42:36.573Z level=INFO msg="startup phase done" phase=credentials took=95µs
time=2026-11-20T08:42:36.573Z level=INFO msg="startup phase" phase=open_state
time=2026-11-20T08:42:36.612Z level=INFO msg="startup phase done" phase=open_state took=38.382ms
time=2026-11-20T08:42:36.612Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-20T08:42:36.613Z level=INFO msg=connecting host=127.0.0.1:39261 protocol=28
time=2026-11-20T08:42:36.614Z level=INFO msg=connected host=127.0.0.1:39261 took=841µs
time=2026-11-20T08:42:36.614Z level=INFO msg="capabilities gathering"
time=2026-11-20T08:42:36.614Z level=INFO msg="capabilities gathered" took=365µs tags=linux,claude,go
time=2026-11-20T08:42:36.615Z level=INFO msg="hello sent" protocol=28
time=2026-11-20T08:42:36.619Z level=INFO msg=welcome protocol=28 role=primary generation=1
time=2026-11-20T08:42:37.590Z 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: <nil>)
--- FAIL: TestBrowserEmptyExplore (5.77s)
--- FAIL amadan.net/oficina/equipo/internal/headless (package output)
FAIL
rastrillo-budget/v1 ran 1m28.651s
FAIL amadan.net/oficina/equipo/internal/headless 88.949s
receipt: test step 1m30.071s 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 1m28.651s amadan.net/oficina/equipo/internal/headless
receipt: slow test 14.84s amadan.net/oficina/equipo/internal/headless TestBrowserThinkingAndCards
receipt: slow test 10.85s amadan.net/oficina/equipo/internal/headless TestBrowserWaitingTurns
receipt: slow test 10.27s amadan.net/oficina/equipo/internal/headless TestBrowserStalePageReloads
receipt: slow test 10.18s amadan.net/oficina/equipo/internal/headless TestBrowserMoveIn
receipt: slow test 7.99s 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 0f5f95599308fceab01ff1527f21d2d5b892891c 6.16s 32.47
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
##############################################################################
FLAKE ./internal/headless:TestBrowserEmptyExplore browser-headless-rest 0f5f95599308fceab01ff1527f21d2d5b892891c 5.77s 32.47
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 28.75, cpu waiting 15.22%, memory waiting 0.00%, io waiting 0.40%
--- 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 336ms against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 507ms amadan.net/oficina/equipo/internal/equipo
receipt: slow test 510ms 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 224ms against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 1.676s amadan.net/oficina/equipo/internal/idtest
receipt: slow test 1.68s 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 205ms against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 1.883s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 1.88s 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|TestBrowserThinkingWords|TestBrowserTokenRowEmail|TestBrowserTrackStarCentre)$' ./internal/thintest
receipt: test step 259ms against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 3m0.772s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 17.28s amadan.net/oficina/equipo/internal/thintest TestBrowserAccessRequest
receipt: slow test 14.33s amadan.net/oficina/equipo/internal/thintest TestBrowserSettingsTeams
receipt: slow test 10.45s amadan.net/oficina/equipo/internal/thintest TestBrowserPlacementQuestionAndPending
receipt: slow test 9.06s amadan.net/oficina/equipo/internal/thintest TestBrowserThinkingCycles
receipt: slow test 7.9s amadan.net/oficina/equipo/internal/thintest TestBrowserInnerScreens
machine: 32 CPUs, load 3.64, cpu waiting 0.88%, memory waiting 0.00%, io waiting 2.15%
--- shard 23 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
shard 23: make test-quarantine
python3 scripts/ci-test.py quarantine
quarantine: 12 tests from scripts/ci-quarantine.txt; a failure is retried once, and a pass on the retry is reported as a flake
+ go test -tags testbuild -timeout 15m -v -run '^TestHeadlessConnections$/^A5_cancel_and_sign_out$|^TestHeadlessConnections$/^C4_claude_sign_in$|^TestHeadlessConnections$/^C5_engineering_failover$|^TestHeadlessConnections$/^C5_engineering_to_codex$|^TestHeadlessConnections$/^C5_engineering_waits$' ./internal/headless (52s)
ok ./internal/headless TestHeadlessConnections/A5_cancel_and_sign_out 5.26s
ok ./internal/headless TestHeadlessConnections/C4_claude_sign_in 1.36s
ok ./internal/headless TestHeadlessConnections/C5_engineering_failover 9.38s
ok ./internal/headless TestHeadlessConnections/C5_engineering_to_codex 9.88s
ok ./internal/headless TestHeadlessConnections/C5_engineering_waits 24.84s
+ 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 (61s)
ok ./internal/headless TestHeadlessConnections/C5_review_auth 22.84s
ok ./internal/headless TestHeadlessConnections/C5_review_failover 12.46s
ok ./internal/headless TestHeadlessConnections/C5_review_on_codex 11.00s
ok ./internal/headless TestHeadlessConnections/C5_review_other_family_first 13.14s
+ go test -tags testbuild -timeout 15m -v -run '^TestMixedVersions$' ./internal/headless (22s)
ok ./internal/headless TestMixedVersions 19.94s
+ go test -tags testbuild -timeout 15m -v -run '^TestCheckSandboxDeniedPathsTampering$' ./internal/runner/checks (2s)
ok ./internal/runner/checks TestCheckSandboxDeniedPathsTampering 0.80s
+ go test -tags testbuild -timeout 15m -v -run '^TestRunnerCancelAndSupersede$' ./internal/runner/thin (1s)
ok ./internal/runner/thin TestRunnerCancelAndSupersede 0.05s
quarantine: 0 flaked (passed on the retry), 0 failed
machine: 32 CPUs, load 36.37, cpu waiting 21.68%, memory waiting 0.00%, io waiting 0.79%
--- shard 24 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
shard 24: make runner-host
python3 scripts/runner-prerequisites.py
CGO_ENABLED=0 RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py retried runner-host -run 'TestDirect|TestProvider|TestCheckSandbox' -count=1 ./internal/runner/provider/... ./internal/runner/checks
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -no-time -run 'TestDirect|TestProvider|TestCheckSandbox' -count=1 ./internal/runner/provider/... ./internal/runner/checks
receipt: test step 8.118s against a 60s target (the gate's other steps are not in this figure)
receipt: 4 packages ran, 0 cached, 3 without tests, 0 failed
receipt: slow package 7.078s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow package 152ms amadan.net/oficina/equipo/internal/runner/provider/claude
receipt: slow package 65ms amadan.net/oficina/equipo/internal/runner/provider/codex
receipt: slow package 3ms amadan.net/oficina/equipo/internal/runner/provider
receipt: slow package 0s amadan.net/oficina/equipo/internal/runner/provider/gotoolchain
receipt: slow test 5.1s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsGoFixture
receipt: slow test 1.63s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPaths
receipt: slow test 270ms amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsCache
receipt: slow test 150ms amadan.net/oficina/equipo/internal/runner/provider/claude TestDirectJournalAdapterBarrier
receipt: slow test 80ms amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxToolchain
CGO_ENABLED=0 RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py retried runner-host -run '^TestNamespace' -count=1 ./internal/runner/containment
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -no-time -run '^TestNamespace' -count=1 ./internal/runner/containment
receipt: test step 3.113s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 2.764s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow test 250ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceReadOnlyScratch
receipt: slow test 200ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryUnavailableProof
receipt: slow test 120ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceDirectPolicyAdmission
receipt: slow test 100ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceReapsOrphans
receipt: slow test 100ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryCleansScratch
machine: 32 CPUs, load 11.81, cpu waiting 4.39%, memory waiting 0.00%, io waiting 1.82%
--- 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 27.8%, load 18.41
shard 25: make runner-dead-references lanes-check build vet fmt-check budget migration-check
python3 scripts/runner-dead-references.py
reference scan: 2467 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: 87 directories within budget
CGO_ENABLED=0 go test ./internal/equipo -run '^TestMigrationModels$' -count=1
ok amadan.net/oficina/equipo/internal/equipo 2.404s
machine: 32 CPUs, load 30.83, cpu waiting 20.31%, memory waiting 0.00%, io waiting 1.03%
--- 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 27.8%, load 18.41
shard 26: make staticcheck
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -tags browser,perf,testbuild ./...
machine: 32 CPUs, load 26.38, cpu waiting 13.80%, memory waiting 0.00%, io waiting 1.26%
--- 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 27.8%, load 18.41
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 26.38, cpu waiting 15.08%, memory waiting 0.00%, io waiting 1.22%
--- shard 28 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: gitleaks started 30s late; cpu waiting 27.8%, load 18.41
shard 28: make gitleaks
[90m8:41AM[0m [32mINF[0m [1mUnknown SCM platform. Use --platform to include links in findings.[0m [36mhost=[0mamadan.net
[90m8:42AM[0m [32mINF[0m [1m1032 commits scanned.[0m
[90m8:42AM[0m [32mINF[0m [1mscanned ~60165828 bytes (60.17 MB) in 12.8s[0m
[90m8:42AM[0m [33mWRN[0m [1mleaks found: 1[0m
exit status 1
make[1]: *** [Makefile:205: gitleaks] Error 1
machine: 32 CPUs, load 30.83, cpu waiting 19.13%, memory waiting 0.00%, io waiting 1.10%
make: *** [Makefile:113: ci-shard] Error 2
amadan: step check shard 28 of 29 failed: exit status 2
amadan: job failed at step check shard 28 of 29 — its output is above, not at the tail of this log
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..9c44de32 |
| --- /dev/null |
| +++ b/native/apple/Sources/EquipoActivity/TaskActivity.swift |
| @@ -0,0 +1,119 @@ |
| +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 |
| + enum CodingKeys: String, CodingKey { case taskID = "task_id" } |
| + public init(taskID: String) { self.taskID = taskID } |
| + |
| + /// 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..91a595db |
| --- /dev/null |
| +++ b/native/apple/Sources/EquipoKit/Push/LiveActivities.swift |
| @@ -0,0 +1,87 @@ |
| +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 started = false |
| + |
| + public init(registrar: PushRegistrar) { self.registrar = registrar } |
| + |
| + 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 |
| + Task { for await token in tokens { await registrar.activityTokenChanged(token, task: task) } } |
| + 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) |
| + } |
| + } |
| + |
| + /// 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..e7aad16d |
| --- /dev/null |
| +++ b/native/apple/Sources/EquipoKit/Push/Notifications.swift |
| @@ -0,0 +1,63 @@ |
| +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) |
| +} |
| + |
| +/// 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)? |
| + |
| + public override init() { |
| + super.init() |
| + let center = UNUserNotificationCenter.current() |
| + center.delegate = self |
| + center.setNotificationCategories([UNNotificationCategory(identifier: Self.needsYouCategory, actions: [], intentIdentifiers: [])]) |
| + } |
| + |
| + public func askAndRegister() { |
| + Task { |
| + _ = try? await UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) |
| + #if os(iOS) |
| + UIApplication.shared.registerForRemoteNotifications() |
| + #else |
| + NSApplication.shared.registerForRemoteNotifications() |
| + #endif |
| + } |
| + } |
| + |
| + public func setBadge(_ count: Int) { |
| + UNUserNotificationCenter.current().setBadgeCount(max(0, count)) |
| + } |
| + |
| + /// 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..bedc5f03 |
| --- /dev/null |
| +++ b/native/apple/Sources/EquipoKit/Push/PushRegistrar.swift |
| @@ -0,0 +1,108 @@ |
| +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, and which of them the |
| + /// current session's server has. |
| + private var activities: [String: 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 |
| + |
| + 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 { acceptedActivities = [:]; closedActivities = [:] } |
| + 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. |
| + public func activityTokenChanged(_ token: Data, task: String) async { |
| + activities[task] = PushToken.hex(token) |
| + await sync() |
| + } |
| + /// 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 } |
| + 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) |
| + if client.token == self.client?.token { accepted = (bearer, body) } |
| + } catch let error as EquipoAPIError { |
| + // 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 }) |
| + where acceptedActivities[task] != token && closedActivities[task] != token { |
| + do { |
| + try await client.registerActivity(try PendingWrite.json(ActivityTokenBody(taskId: task, token: token))) |
| + acceptedActivities[task] = token |
| + } catch let error as EquipoAPIError { |
| + // Ended, or not this person's task: the server will never take it. |
| + if error.status == 404 || error.status == 409 || error.status == 400 { closedActivities[task] = token } |
| + 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/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/LiveCards.swift b/native/apple/Sources/EquipoKit/UI/LiveCards.swift| index 0e9e052e..3a13224a 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 { |
| @@ -170,11 +208,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..81ea459d 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,33 @@ 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) |
| + #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/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..51922596 |
| --- /dev/null |
| +++ b/native/apple/Tests/EquipoKitTests/Fixtures/push/activity-needs.json |
| @@ -0,0 +1,20 @@ |
| +{ |
| + "aps": { |
| + "alert": { |
| + "title": "Fix login", |
| + "body": "[push.activity.needs_you]" |
| + }, |
| + "sound": "default", |
| + "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..30373829 |
| --- /dev/null |
| +++ b/native/apple/Tests/EquipoKitTests/Fixtures/push/activity-start.json |
| @@ -0,0 +1,24 @@ |
| +{ |
| + "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" |
| + } |
| + } |
| +} |
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..e66279df |
| --- /dev/null |
| +++ b/native/apple/Tests/EquipoKitTests/PushTests.swift |
| @@ -0,0 +1,302 @@ |
| +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 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 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") |
| + #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") |
| + #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") |
| + #expect(try json(t.sent("POST /push-registrations/activities")[2])["task_id"] == "tk3") |
| + } |
| +} |
| + |
| +@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")) |
| + #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] = [] |
| + func askAndRegister() { asked += 1 } |
| + func setBadge(_ count: Int) { badges.append(count) } |
| +} |
| + |
| +@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 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/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", |