Merge branch 'native/projects' into main
47 files changed,
+3,524
−73
.rastrillo/budgets.txt+4 −4docs/api/equipo-v1.md+4 −1docs/api/equipo-v1.openapi.json+8 −0docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md+20 −0internal/equipo/api_copy_scan_test.go+69 −0internal/equipo/api_copy_test.go+247 −0internal/equipo/chat/project_native_review_test.go+51 −0internal/equipo/chat/projects.go+6 −1internal/equipo/copy.go+20 −0internal/plan3test/plan3_release_test.go+3 −1internal/wire/api.go+14 −12internal/wire/wiretest/testdata/api/projects.json+1 −1native/API-COPY-REVIEW.md+129 −0native/PROJECTS-REPORT.md+342 −0native/apple/Sources/EquipoActivity/Resources/Localizable.xcstrings+484 −0native/apple/Sources/EquipoKit/API/Client.swift+7 −4native/apple/Sources/EquipoKit/API/Projects.swift+44 −0native/apple/Sources/EquipoKit/API/Thin.swift+14 −0native/apple/Sources/EquipoKit/Presentation/Roster.swift+8 −3native/apple/Sources/EquipoKit/Projects/ProjectCatalog.swift+165 −0native/apple/Sources/EquipoKit/Projects/QuestionAnswerDraft.swift+13 −0native/apple/Sources/EquipoKit/Push/PushRoute.swift+1 −1native/apple/Sources/EquipoKit/Resources/Localizable.xcstrings+484 −0native/apple/Sources/EquipoKit/Session/EquipoSession.swift+73 −16native/apple/Sources/EquipoKit/UI/LiveCards.swift+23 −5native/apple/Sources/EquipoKit/UI/RosterViews.swift+39 −0native/apple/Sources/EquipoKit/UI/Screens/ConversationScreen.swift+10 −3native/apple/Sources/EquipoKit/UI/Screens/PhoneRoot.swift+20 −0native/apple/Sources/EquipoKit/UI/Screens/ProjectsScreen.swift+152 −0native/apple/Sources/EquipoMac/LiveTranscript.swift+73 −6native/apple/Sources/EquipoMac/MacMainView.swift+15 −1native/apple/Sources/EquipoMac/QuestionAnswerField.swift+32 −0native/apple/Tests/EquipoKitTests/Fixtures/project-card.json+17 −0native/apple/Tests/EquipoKitTests/Fixtures/project-invalid.json+5 −0native/apple/Tests/EquipoKitTests/Fixtures/project-list.json+125 −0native/apple/Tests/EquipoKitTests/Fixtures/project-typed-answer.json+42 −0native/apple/Tests/EquipoKitTests/Fixtures/thin/projects.json+1 −0native/apple/Tests/EquipoKitTests/MarkdownStreamTests.swift+4 −1native/apple/Tests/EquipoKitTests/ProjectsAccessibilityTests.swift+58 −0native/apple/Tests/EquipoKitTests/ProjectsFinalReviewTests.swift+49 −0native/apple/Tests/EquipoKitTests/ProjectsMacQuestionTests.swift+42 −0native/apple/Tests/EquipoKitTests/ProjectsReviewTests.swift+149 −0native/apple/Tests/EquipoKitTests/ProjectsTests.swift+385 −0native/scripts/check-fixtures.py+1 −0native/scripts/check-parity.py+2 −2native/scripts/strings.json+55 −11scripts/runner-reference-allowlist.json+14 −0
CI failed — run details
CI log
=== prepare ===
ci-box: machine: aarch64, 32 CPUs, 62 GiB memory, kernel 7.0.0-1017-aws
ci-box: python 3.12.3; Docker version 29.1.3, build 29.1.3-0ubuntu3~24.04.2
ci-box: user namespaces allowed: 233151
ci-box: cgroup: cgroup2fs
ci-box: disk /home/ci/work/repos/oficina__equipo/wt/main: Type Size Avail | ext4 96G 86G
ci-box: disk /home/ci/.cache/equipo-ci-box: Type Size Avail | ext4 96G 86G
ci-box: bwrap: fetched and verified in 0.3s
ci-box: claude: fetched and verified in 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.3s
npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead
ci-box: image pulled in 9.8s
ci-box: pi: installed and verified in 7.5s
ci-box: opencode: installed and verified in 2.3s
ci-box: chromium 156.0.8078.79-1~deb13u1: 76 packages fetched, verified and unpacked in 8.8s
ci-box: clone deepened in 3.8s
ci-box: file times set from content: 2933 files, 191 directories
ci-box: ready in 17.3s
=== 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.145s
=== compile ===
go build ./...
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py compile
+ go build -tags testbuild ./...
4.2s
+ go list -export -test -tags testbuild -f ./...
4.6s
+ go list -export -test -tags browser,testbuild -f ./internal/equipo ./internal/headless ./internal/idtest ./internal/plan3test ./internal/thintest
3.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
receipt: test step 1m17.957s 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.847s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m15.85s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 66.29, cpu waiting 39.84%, memory waiting 0.00%, io waiting 0.80%
--- shard 1 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-review: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadless$/^4_review$|^TestHeadless$/^2b_access$|^TestHeadless$/^runner_crash$|^TestHeadless$/^2b_first_message$|^TestHeadless$/^4_checks_honest$|^TestHeadless$/^7_stream_resume$|^TestHeadless$/^2b_notebook$|^TestHeadless$/^2b_move_in$|^TestHeadless$/^2b_desk_failure$|^TestHeadless$/^cancel$' ./internal/headless
receipt: test step 1m16.311s 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 1m14.397s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m14.4s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 66.29, cpu waiting 39.84%, memory waiting 0.00%, io waiting 0.80%
--- shard 2 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-connections: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadlessConnections$|^TestHeadlessTokenPasteEndToEnd$|^TestHeadlessTokenConnection$' ./internal/headless
receipt: test step 1m17.71s 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.594s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m6.35s amadan.net/oficina/equipo/internal/headless TestHeadlessConnections
receipt: slow test 4.95s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenPasteEndToEnd
receipt: slow test 4.28s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenConnection
machine: 32 CPUs, load 66.29, cpu waiting 39.84%, memory waiting 0.00%, io waiting 0.80%
--- shard 3 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-mac: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestMacWorker$|^TestHeadlessAttachments$|^TestHeadlessPrewarm$|^TestHeadless$/^1_first_token$|^TestHeadless$/^6_quick_messages$|^TestHeadless$/^8_instance_restart$|^TestHeadless$/^3_runner_offline$' ./internal/headless
receipt: test step 1m13.872s 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 1m11.904s amadan.net/oficina/equipo/internal/headless
receipt: slow test 35.65s amadan.net/oficina/equipo/internal/headless TestMacWorker
receipt: slow test 18.94s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 8.84s amadan.net/oficina/equipo/internal/headless TestHeadlessPrewarm
receipt: slow test 8.47s amadan.net/oficina/equipo/internal/headless TestHeadlessAttachments
machine: 32 CPUs, load 66.29, cpu waiting 39.59%, memory waiting 0.00%, io waiting 0.86%
--- shard 4 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-guards: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadlessCopyRotation$|^TestHeadlessPolicyGuards$|^TestHeadlessRunnerKillLeavesNoCopies$|^TestHeadlessNewHouseRuleStartsFresh$|^TestHeadless$/^3_engineering$|^TestHeadless$/^3_step_cancel$|^TestHeadless$/^3_step_contained$|^TestHeadless$/^3_step_refused$|^TestHeadless$/^3_empty_repo$|^TestHeadless$/^3_empty_engineering$|^TestHeadless$/^3_empty_merge$|^TestHeadless$/^3_empty_merge_rebuilt$|^TestHeadless$/^3_empty_fix_round$' ./internal/headless
receipt: test step 1m32.576s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m30.705s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m1.72s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 9.16s amadan.net/oficina/equipo/internal/headless TestHeadlessRunnerKillLeavesNoCopies
receipt: slow test 7.97s amadan.net/oficina/equipo/internal/headless TestHeadlessCopyRotation
receipt: slow test 7.02s amadan.net/oficina/equipo/internal/headless TestHeadlessPolicyGuards
receipt: slow test 4.82s amadan.net/oficina/equipo/internal/headless TestHeadlessNewHouseRuleStartsFresh
machine: 32 CPUs, load 63.30, cpu waiting 38.85%, memory waiting 0.00%, io waiting 0.61%
--- shard 5 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-rest: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -skip '^TestHeadless$/^4c_rebase$|^TestHeadless$/^4b_ask$|^TestHeadless$/^4c_checks_card$|^TestHeadless$/^4_step_crash$|^TestHeadless$/^4_review$|^TestHeadless$/^2b_access$|^TestHeadless$/^runner_crash$|^TestHeadless$/^2b_first_message$|^TestHeadless$/^4_checks_honest$|^TestHeadless$/^7_stream_resume$|^TestHeadless$/^2b_notebook$|^TestHeadless$/^2b_move_in$|^TestHeadless$/^2b_desk_failure$|^TestHeadless$/^cancel$|^TestHeadlessConnections$|^TestHeadlessTokenPasteEndToEnd$|^TestHeadlessTokenConnection$|^TestMacWorker$|^TestHeadlessAttachments$|^TestHeadlessPrewarm$|^TestHeadless$/^1_first_token$|^TestHeadless$/^6_quick_messages$|^TestHeadless$/^8_instance_restart$|^TestHeadless$/^3_runner_offline$|^TestHeadlessCopyRotation$|^TestHeadlessPolicyGuards$|^TestHeadlessRunnerKillLeavesNoCopies$|^TestHeadlessNewHouseRuleStartsFresh$|^TestHeadless$/^3_engineering$|^TestHeadless$/^3_step_cancel$|^TestHeadless$/^3_step_contained$|^TestHeadless$/^3_step_refused$|^TestHeadless$/^3_empty_repo$|^TestHeadless$/^3_empty_engineering$|^TestHeadless$/^3_empty_merge$|^TestHeadless$/^3_empty_merge_rebuilt$|^TestHeadless$/^3_empty_fix_round$' ./internal/headless
receipt: test step 2m41.549s 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 2m39.478s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m34.94s amadan.net/oficina/equipo/internal/headless TestHeadlessAssistant
receipt: slow test 18.1s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 8.48s amadan.net/oficina/equipo/internal/headless TestHeadlessResearchHandoff
receipt: slow test 6.56s amadan.net/oficina/equipo/internal/headless TestHeadlessTurnBatching
receipt: slow test 6.43s amadan.net/oficina/equipo/internal/headless TestHeadlessBatchAfterRefusedReply
machine: 32 CPUs, load 26.04, cpu waiting 13.65%, memory waiting 0.00%, io waiting 0.19%
--- 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 2m10.697s 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 2m8.771s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 8.22s amadan.net/oficina/equipo/internal/thintest TestContractTeamJobSettledStates
receipt: slow test 6.71s amadan.net/oficina/equipo/internal/thintest TestExplorePreviewsOff
receipt: slow test 4.59s amadan.net/oficina/equipo/internal/thintest TestContractTeamNudgePersonNeeds
receipt: slow test 3.89s amadan.net/oficina/equipo/internal/thintest TestContractPreviewHeldUntilPublishAnswer
receipt: slow test 3.35s amadan.net/oficina/equipo/internal/thintest TestContractTeamUpdatePersonNeeds
machine: 32 CPUs, load 39.31, cpu waiting 22.36%, memory waiting 0.00%, io waiting 0.32%
--- 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 1m29.049s 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 1m26.959s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 9.09s amadan.net/oficina/equipo/internal/thintest TestContractPreviewNotScheduled
receipt: slow test 5.11s amadan.net/oficina/equipo/internal/thintest TestContractPublishNotOffered
receipt: slow test 4.5s amadan.net/oficina/equipo/internal/thintest TestContractMacRecheckMergeAuthority
receipt: slow test 2.37s amadan.net/oficina/equipo/internal/thintest TestContractPreview
receipt: slow test 2.35s amadan.net/oficina/equipo/internal/thintest TestContractPublishNameTaken
machine: 32 CPUs, load 63.30, cpu waiting 39.08%, memory waiting 0.00%, io waiting 0.65%
--- shard 8 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane runner-thin: ./internal/runner/thin
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m ./internal/runner/thin
budget note: internal/runner/thin took 4m43.623s, over the 45s its record on line 44 allows; reported only, timing fails on CI
receipt: test step 4m49.125s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 4m43.623s amadan.net/oficina/equipo/internal/runner/thin
receipt: slow test 36.98s amadan.net/oficina/equipo/internal/runner/thin TestModelsEngineeringProbesThenRunsTheStrongest
receipt: slow test 36.97s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeAnsweredByAnotherModel
receipt: slow test 36.76s amadan.net/oficina/equipo/internal/runner/thin TestModelsUnhealthyRetriedOnDemand
receipt: slow test 18.47s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeRunsInsideTheAdmission
receipt: slow test 7.02s amadan.net/oficina/equipo/internal/runner/thin TestOpenCodeStepsRealOpenCode
machine: 32 CPUs, load 3.81, cpu waiting 1.56%, 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
receipt: test step 51.64s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 50.645s amadan.net/oficina/equipo/internal/runner
receipt: slow test 30.61s amadan.net/oficina/equipo/internal/runner TestDirectBugWorkflow
receipt: slow test 20.03s amadan.net/oficina/equipo/internal/runner TestEnrolKeepsTheRole
machine: 32 CPUs, load 50.68, cpu waiting 33.85%, memory waiting 0.00%, io waiting 1.24%
--- shard 10 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane runner-plans: ./internal/runner
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestPlanWorkflowCandidateOrder$|^TestPlanWorkflowFeature$|^TestCoordinatorRecoveryCallRefusalKeepsServing$|^TestCoordinatorRefusalMatrix$' ./internal/runner
receipt: test step 1m0.89s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 59.702s amadan.net/oficina/equipo/internal/runner
receipt: slow test 49.63s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowCandidateOrder
receipt: slow test 47.37s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowFeature
receipt: slow test 8.43s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryCallRefusalKeepsServing
receipt: slow test 1.62s amadan.net/oficina/equipo/internal/runner TestCoordinatorRefusalMatrix
machine: 32 CPUs, load 58.99, cpu waiting 39.03%, memory waiting 0.00%, io waiting 1.05%
--- shard 11 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane runner-rest: ./internal/runner
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -skip '^TestDirectBugWorkflow$|^TestEnrolKeepsTheRole$|^TestPlanWorkflowCandidateOrder$|^TestPlanWorkflowFeature$|^TestCoordinatorRecoveryCallRefusalKeepsServing$|^TestCoordinatorRefusalMatrix$' ./internal/runner
receipt: test step 36.062s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 35.253s amadan.net/oficina/equipo/internal/runner
receipt: slow test 5.15s amadan.net/oficina/equipo/internal/runner TestDirectFaultIsolation
receipt: slow test 3.53s amadan.net/oficina/equipo/internal/runner TestClaimRefusalsBackOff
receipt: slow test 3.13s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryRefusedKeepsServing
receipt: slow test 2.51s amadan.net/oficina/equipo/internal/runner TestToolVerbUnderFakeHarness
receipt: slow test 1.61s amadan.net/oficina/equipo/internal/runner TestReportPostsRetryExactRequest
machine: 32 CPUs, load 33.32, cpu waiting 23.10%, memory waiting 0.00%, io waiting 1.57%
--- 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 40.4%, load 24.21
test lane equipotest-a: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^Test[A-D]|^TestQ' ./internal/equipotest
receipt: test step 1m7.962s 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 1m5.864s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 27.42s amadan.net/oficina/equipo/internal/equipotest TestAuthorityCoreIntegration
receipt: slow test 27.26s amadan.net/oficina/equipo/internal/equipotest TestBootstrapNamesOwnersSetting
receipt: slow test 25.29s amadan.net/oficina/equipo/internal/equipotest TestAccountLabelMigration
receipt: slow test 22.36s amadan.net/oficina/equipo/internal/equipotest TestBudgetConfigurationFailuresAreAtomic
receipt: slow test 22.26s amadan.net/oficina/equipo/internal/equipotest TestAccountLabelDuplicates
machine: 32 CPUs, load 58.17, cpu waiting 36.88%, memory waiting 0.00%, io waiting 0.55%
--- 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 40.4%, load 24.21
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 1m16.642s 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 1m14.645s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 19.55s amadan.net/oficina/equipo/internal/equipotest TestProjectsReopen
receipt: slow test 19.48s amadan.net/oficina/equipo/internal/equipotest TestProjectBindingUniqueness
receipt: slow test 19.46s amadan.net/oficina/equipo/internal/equipotest TestProjectsFailuresRollBack
receipt: slow test 19.42s amadan.net/oficina/equipo/internal/equipotest TestProjectRetryAndRevision
receipt: slow test 19.42s amadan.net/oficina/equipo/internal/equipotest TestProjectRejectsUnsafeBinding
machine: 32 CPUs, load 54.32, cpu waiting 32.86%, memory waiting 0.00%, io waiting 0.48%
--- 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 40.4%, load 24.21
test lane equipotest-r: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestR' ./internal/equipotest
receipt: test step 1m13.855s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m8.611s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 15.29s amadan.net/oficina/equipo/internal/equipotest TestReleaseStampContract
receipt: slow test 13.38s amadan.net/oficina/equipo/internal/equipotest TestRosterChangesAffectExistingSession
receipt: slow test 10.31s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalWhileAssigned
receipt: slow test 10.28s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalRollsBack
receipt: slow test 7.22s amadan.net/oficina/equipo/internal/equipotest TestRosterBootstrapOnce
machine: 32 CPUs, load 54.32, cpu waiting 33.93%, memory waiting 0.00%, io waiting 0.50%
--- 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 40.4%, load 24.21
test lane equipotest-rest: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -skip '^Test[A-D]|^TestQ|^Test[E-P]|^TestR' ./internal/equipotest
receipt: test step 1m8.623s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m6.493s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 25.01s amadan.net/oficina/equipo/internal/equipotest TestSigninNoProof
receipt: slow test 24.41s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedExistingTeam
receipt: slow test 24.37s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedRollback
receipt: slow test 22.58s amadan.net/oficina/equipo/internal/equipotest TestSpecialistSettings
receipt: slow test 22.58s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedAuditRollback
machine: 32 CPUs, load 58.17, cpu waiting 36.88%, memory waiting 0.00%, io waiting 0.55%
--- 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 40.4%, load 24.21
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 54.127s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 51.665s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 3.65s amadan.net/oficina/equipo/internal/plan3test TestPlan3Upgrade
receipt: slow test 3.53s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3B
receipt: slow test 1.66s amadan.net/oficina/equipo/internal/plan3test TestConversationQuestionRace
receipt: slow test 1.52s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3A
receipt: slow test 1.24s amadan.net/oficina/equipo/internal/plan3test TestPersonAPIMigrationUpgrade
machine: 32 CPUs, load 63.76, cpu waiting 38.57%, memory waiting 0.00%, io waiting 0.70%
--- 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 41.2%, load 24.21
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/door ./internal/equipo/housekeeping ./internal/equipo/icons ./internal/equipo/identity ./internal/equipo/kernel ./internal/equipo/library ./internal/equipo/mergegate ./internal/equipo/notifications ./internal/equipo/oficina ./internal/equipo/oficina/oficinatest ./internal/equipo/oficinaid ./internal/equipo/ownermode ./internal/equipo/personapi ./internal/equipo/planning ./internal/equipo/push ./internal/equipo/setup ./internal/equipo/team ./internal/equipo/teamcontract ./internal/equipo/triage ./internal/fakeclaude ./internal/fakecodex ./internal/fakeopencode ./internal/fakepi ./internal/idtest ./internal/ownermodetest ./internal/release ./internal/runner/checks ./internal/runner/connect ./internal/runner/containment ./internal/runner/containment/sysunix ./internal/runner/egress ./internal/runner/forge ./internal/runner/forge/forgetest ./internal/runner/heartbeat ./internal/runner/mac ./internal/runner/mcpresource ./internal/runner/metered ./internal/runner/planflow ./internal/runner/provider ./internal/runner/provider/claude ./internal/runner/provider/claude/realcli ./internal/runner/provider/codex ./internal/runner/provider/gotoolchain ./internal/runner/provider/opencode ./internal/runner/provider/pi ./internal/runner/setup ./internal/runner/transporttest ./internal/runner/webread ./internal/runner/workspace ./internal/runnerproto ./internal/schedule ./internal/sealbox ./internal/specialist ./internal/stagingtest ./internal/taskplan ./internal/testci ./internal/toolproxy ./internal/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/door ./internal/equipo/housekeeping ./internal/equipo/icons ./internal/equipo/identity ./internal/equipo/kernel ./internal/equipo/library ./internal/equipo/mergegate ./internal/equipo/notifications ./internal/equipo/oficina ./internal/equipo/oficina/oficinatest ./internal/equipo/oficinaid ./internal/equipo/ownermode ./internal/equipo/personapi ./internal/equipo/planning ./internal/equipo/push ./internal/equipo/setup ./internal/equipo/team ./internal/equipo/teamcontract ./internal/equipo/triage ./internal/fakeclaude ./internal/fakecodex ./internal/fakeopencode ./internal/fakepi ./internal/idtest ./internal/ownermodetest ./internal/release ./internal/runner/checks ./internal/runner/connect ./internal/runner/containment ./internal/runner/containment/sysunix ./internal/runner/egress ./internal/runner/forge ./internal/runner/forge/forgetest ./internal/runner/heartbeat ./internal/runner/mac ./internal/runner/mcpresource ./internal/runner/metered ./internal/runner/planflow ./internal/runner/provider ./internal/runner/provider/claude ./internal/runner/provider/claude/realcli ./internal/runner/provider/codex ./internal/runner/provider/gotoolchain ./internal/runner/provider/opencode ./internal/runner/provider/pi ./internal/runner/setup ./internal/runner/transporttest ./internal/runner/webread ./internal/runner/workspace ./internal/runnerproto ./internal/schedule ./internal/sealbox ./internal/specialist ./internal/stagingtest ./internal/taskplan ./internal/testci ./internal/toolproxy ./internal/websource ./internal/wire ./internal/wire/wireschema ./internal/wire/wiretest ./tools/drive
cache miss: amadan.net/oficina/equipo/internal/chatmarkdown: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/copydesk: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/equipo/team: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/forge: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/claude/realcli: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/webread: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runnerproto: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/workspace: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/checks: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/containment: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/opencode: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/testci: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/pi: its inputs changed
--- FAIL amadan.net/oficina/equipo/internal/runner/checks TestDependencyStage
=== RUN TestDependencyStage
testing.go:1464: TempDir RemoveAll cleanup: unlinkat /tmp/TestDependencyStage3124386265: directory not empty
--- FAIL: TestDependencyStage (0.05s)
--- FAIL amadan.net/oficina/equipo/internal/runner/checks (package output)
FAIL
rastrillo-budget/v1 ran 52.709s
FAIL amadan.net/oficina/equipo/internal/runner/checks 52.789s
budget note: internal/equipo took 53.517s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/equipo/chat took 20.419s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/idtest took 1m52.021s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/release took 36.558s, 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 47.23s, over the 15s its record on line 40 allows; reported only, timing fails on CI
budget note: internal/runner/forge took 20.184s, over the 20s its record on line 35 allows; reported only, timing fails on CI
budget note: internal/runner/provider/claude/realcli took 14.879s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/runner/workspace took 13.923s, over the 10s the default allows; reported only, timing fails on CI
receipt: test step 2m15.367s against a 60s target (the gate's other steps are not in this figure)
receipt: 25 packages ran, 37 cached, 18 without tests, 1 failed
receipt: slow package 1m52.021s amadan.net/oficina/equipo/internal/idtest
receipt: slow package 1m6.905s amadan.net/oficina/equipo/internal/runner/provider/opencode
receipt: slow package 57.037s amadan.net/oficina/equipo/internal/runner/provider/pi
receipt: slow package 53.517s amadan.net/oficina/equipo/internal/equipo
receipt: slow package 52.709s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow test 53.71s amadan.net/oficina/equipo/internal/idtest TestDoorRemembersOficinaID
receipt: slow test 45.5s amadan.net/oficina/equipo/internal/idtest TestDoorOficinaSettingsUnreadableIsNoLoop
receipt: slow test 45.43s amadan.net/oficina/equipo/internal/idtest TestDoorStepUpIsLocal
receipt: slow test 45.3s amadan.net/oficina/equipo/internal/idtest TestDoorForgetsOficinaIDForARefusedSession
receipt: slow test 45.02s amadan.net/oficina/equipo/internal/idtest TestDoorNeverJudgesANativeSession
rastrillo: budget test: go test failed
exit status 1
+ go test -tags testbuild -timeout 15m -v -run '^TestDependencyStage$' -count=1 ./internal/runner/checks (retry, once)
FAILED TWICE ./internal/runner/checks:TestDependencyStage rest
=== RUN TestDependencyStage
testing.go:1464: TempDir RemoveAll cleanup: unlinkat /tmp/TestDependencyStage3000331328: directory not empty
--- FAIL: TestDependencyStage (0.03s)
FAIL
rastrillo-budget/v1 ran 34ms
FAIL amadan.net/oficina/equipo/internal/runner/checks 0.038s
FAIL
machine: 32 CPUs, load 24.12, cpu waiting 12.77%, memory waiting 0.00%, io waiting 0.18%
make: *** [Makefile:113: ci-shard] Error 1
amadan: step check shard 17 of 29 failed: exit status 2
--- shard 18 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-chat: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$' ./internal/headless
receipt: test step 1m26.05s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m24.371s amadan.net/oficina/equipo/internal/headless
receipt: slow test 39.22s amadan.net/oficina/equipo/internal/headless TestBrowserDraftIsTheMessage
receipt: slow test 14.7s amadan.net/oficina/equipo/internal/headless TestBrowserDraftStreamsFormatted
receipt: slow test 10.44s amadan.net/oficina/equipo/internal/headless TestBrowserChat
receipt: slow test 7.14s amadan.net/oficina/equipo/internal/headless TestBrowserComposer
receipt: slow test 7.08s amadan.net/oficina/equipo/internal/headless TestBrowserChatSendStaysOnPage
machine: 32 CPUs, load 63.30, cpu waiting 38.82%, memory waiting 0.00%, io waiting 0.68%
--- shard 19 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-work: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$' ./internal/headless
receipt: test step 1m30.004s 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.202s amadan.net/oficina/equipo/internal/headless
receipt: slow test 27.56s amadan.net/oficina/equipo/internal/headless TestBrowserRailFollowsWork
receipt: slow test 20.66s amadan.net/oficina/equipo/internal/headless TestBrowserTaskThread
receipt: slow test 13.18s amadan.net/oficina/equipo/internal/headless TestBrowserReceiptFollowsReview
receipt: slow test 9.21s amadan.net/oficina/equipo/internal/headless TestBrowserAskAfterMerge
receipt: slow test 9.07s amadan.net/oficina/equipo/internal/headless TestBrowserTaskCard
machine: 32 CPUs, load 63.30, cpu waiting 39.08%, memory waiting 0.00%, io waiting 0.63%
--- shard 20 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-connections: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^TestBrowserConnections|^TestBrowserPasteBox$|^TestBrowserPasteCopiesItsBox$' ./internal/headless
receipt: test step 1m42.187s 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 1m40.599s amadan.net/oficina/equipo/internal/headless
receipt: slow test 14.15s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsConversation
receipt: slow test 13.56s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAddPage
receipt: slow test 12.71s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAdd
receipt: slow test 11.35s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsMeteredLimitRequired
receipt: slow test 10.63s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsOpenCodeGoLimitRequired
machine: 32 CPUs, load 54.32, cpu waiting 33.93%, memory waiting 0.00%, io waiting 0.50%
--- 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
--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserCopyContinue
=== RUN TestBrowserCopyContinue
time=2026-11-23T16:49:59.711Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-23T16:49:59.711Z level=INFO msg="startup phase done" phase=state_lock took=75µs
time=2026-11-23T16:49:59.711Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-23T16:49:59.711Z level=INFO msg="startup phase done" phase=claim_roots took=97µs
time=2026-11-23T16:49:59.711Z level=INFO msg="startup phase" phase=sweep
time=2026-11-23T16:49:59.756Z level=INFO msg="startup phase done" phase=sweep took=44.566ms
time=2026-11-23T16:49:59.759Z level=INFO msg="startup phase" phase=credentials
time=2026-11-23T16:49:59.759Z level=INFO msg="startup phase done" phase=credentials took=373µs
time=2026-11-23T16:49:59.759Z level=INFO msg="startup phase" phase=open_state
time=2026-11-23T16:49:59.812Z level=INFO msg="startup phase done" phase=open_state took=53.152ms
time=2026-11-23T16:49:59.813Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-23T16:49:59.817Z level=INFO msg=connecting host=127.0.0.1:33733 protocol=28
time=2026-11-23T16:49:59.819Z level=INFO msg=connected host=127.0.0.1:33733 took=1.382ms
time=2026-11-23T16:49:59.819Z level=INFO msg="capabilities gathering"
time=2026-11-23T16:49:59.820Z level=INFO msg="capabilities gathered" took=589µs tags=linux,claude,go
time=2026-11-23T16:49:59.823Z level=INFO msg="hello sent" protocol=28
time=2026-11-23T16:49:59.833Z 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.41s)
--- FAIL amadan.net/oficina/equipo/internal/headless (package output)
FAIL
rastrillo-budget/v1 ran 1m32.016s
FAIL amadan.net/oficina/equipo/internal/headless 92.213s
receipt: test step 1m33.552s 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 1m32.016s amadan.net/oficina/equipo/internal/headless
receipt: slow test 14.67s amadan.net/oficina/equipo/internal/headless TestBrowserThinkingAndCards
receipt: slow test 11.24s amadan.net/oficina/equipo/internal/headless TestBrowserStalePageReloads
receipt: slow test 10.87s amadan.net/oficina/equipo/internal/headless TestBrowserWaitingTurns
receipt: slow test 9.51s amadan.net/oficina/equipo/internal/headless TestBrowserMoveIn
receipt: slow test 7.43s amadan.net/oficina/equipo/internal/headless TestBrowserNotebookLook
rastrillo: budget test: go test failed
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$' -count=1 ./internal/headless (retry, once)
##############################################################################
FLAKE ./internal/headless:TestBrowserCopyContinue browser-headless-rest 00d09aa725636e7923a3c0688a869db54b7254b4 6.41s 60.71
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 58.17, cpu waiting 36.88%, memory waiting 0.00%, io waiting 0.55%
--- shard 22 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-rest: ./internal/equipo
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserPreviewBlocksNavigation)$' ./internal/equipo
receipt: test step 2.285s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 620ms amadan.net/oficina/equipo/internal/equipo
receipt: slow test 620ms 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|TestBrowserSmartDoor)$' ./internal/idtest
budget note: internal/idtest took 10.837s, over the 10s the default allows; reported only, timing fails on CI
receipt: test step 12.306s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 10.837s amadan.net/oficina/equipo/internal/idtest
receipt: slow test 8.51s amadan.net/oficina/equipo/internal/idtest TestBrowserSmartDoor
receipt: slow test 2.32s amadan.net/oficina/equipo/internal/idtest TestBrowserOficinaIDDoor
browser lane browser-rest: ./internal/plan3test
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestTeamsHierarchyBrowser)$' ./internal/plan3test
receipt: test step 3.627s 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.101s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 2.1s amadan.net/oficina/equipo/internal/plan3test TestTeamsHierarchyBrowser
browser lane browser-rest: ./internal/thintest
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAccessEmojiByline|TestBrowserAccessFinalOutcomes|TestBrowserAccessRequest|TestBrowserAccessReview|TestBrowserActivitySubjects|TestBrowserAutonomySettings|TestBrowserCoordinatorQueue|TestBrowserEmptyConversation|TestBrowserEndedNoteStaysGone|TestBrowserHousekeeping|TestBrowserInnerGallery|TestBrowserInnerScreens|TestBrowserInstantThinking|TestBrowserInstantThinkingQueued|TestBrowserMachines|TestBrowserPhoneIndex|TestBrowserPlacementQuestionAndPending|TestBrowserProjectPlacement|TestBrowserProjectsList|TestBrowserReportActionFeedback|TestBrowserReportNextSteps|TestBrowserReportThread|TestBrowserRhythm|TestBrowserRollup|TestBrowserRosterAlignment|TestBrowserRosterDecisionStates|TestBrowserRosterQuietDay|TestBrowserRosterReports|TestBrowserRosterSetAside|TestBrowserRosterSubchat|TestBrowserRosterThinking|TestBrowserRosterVisual|TestBrowserSettingsHousekeepingGroups|TestBrowserSettingsMenu|TestBrowserSettingsRail|TestBrowserSettingsSaveBar|TestBrowserSettingsShots|TestBrowserSettingsStayOnPage|TestBrowserSettingsTeams|TestBrowserShipsButtons|TestBrowserSpecialistRows|TestBrowserSpendFollowsAnswers|TestBrowserTaskRows|TestBrowserTeamPanel|TestBrowserThinkingCycles|TestBrowserThinkingLinesClear|TestBrowserThinkingSteady|TestBrowserThinkingWords|TestBrowserTokenRowEmail|TestBrowserTrackPulse|TestBrowserTrackStarCentre|TestBrowserTryAgain)$' ./internal/thintest
receipt: test step 3m31.387s 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 3m29.789s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 23.39s amadan.net/oficina/equipo/internal/thintest TestBrowserAccessRequest
receipt: slow test 14.39s amadan.net/oficina/equipo/internal/thintest TestBrowserSettingsTeams
receipt: slow test 12.01s amadan.net/oficina/equipo/internal/thintest TestBrowserThinkingCycles
receipt: slow test 10.53s amadan.net/oficina/equipo/internal/thintest TestBrowserPlacementQuestionAndPending
receipt: slow test 8.8s amadan.net/oficina/equipo/internal/thintest TestBrowserRhythm
machine: 32 CPUs, load 8.87, cpu waiting 4.25%, memory waiting 0.00%, io waiting 0.05%
--- 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 4.64s
ok ./internal/headless TestHeadlessConnections/C4_claude_sign_in 1.23s
ok ./internal/headless TestHeadlessConnections/C5_engineering_failover 8.47s
ok ./internal/headless TestHeadlessConnections/C5_engineering_to_codex 8.69s
ok ./internal/headless TestHeadlessConnections/C5_engineering_waits 26.88s
+ 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 (55s)
ok ./internal/headless TestHeadlessConnections/C5_review_auth 12.29s
ok ./internal/headless TestHeadlessConnections/C5_review_failover 11.43s
ok ./internal/headless TestHeadlessConnections/C5_review_on_codex 10.28s
ok ./internal/headless TestHeadlessConnections/C5_review_other_family_first 19.09s
+ go test -tags testbuild -timeout 15m -v -run '^TestMixedVersions$' ./internal/headless (21s)
ok ./internal/headless TestMixedVersions 18.54s
+ go test -tags testbuild -timeout 15m -v -run '^TestCheckSandboxDeniedPathsTampering$' ./internal/runner/checks (2s)
ok ./internal/runner/checks TestCheckSandboxDeniedPathsTampering 0.80s
+ go test -tags testbuild -timeout 15m -v -run '^TestRunnerCancelAndSupersede$' ./internal/runner/thin (2s)
ok ./internal/runner/thin TestRunnerCancelAndSupersede 0.05s
quarantine: 0 flaked (passed on the retry), 0 failed
machine: 32 CPUs, load 58.47, cpu waiting 38.01%, memory waiting 0.00%, io waiting 1.12%
--- shard 24 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
shard 24: make runner-host
python3 scripts/runner-prerequisites.py
CGO_ENABLED=0 RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py retried runner-host -run 'TestDirect|TestProvider|TestCheckSandbox' -count=1 ./internal/runner/provider/... ./internal/runner/checks
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -no-time -run 'TestDirect|TestProvider|TestCheckSandbox' -count=1 ./internal/runner/provider/... ./internal/runner/checks
receipt: test step 13.899s against a 60s target (the gate's other steps are not in this figure)
receipt: 4 packages ran, 0 cached, 4 without tests, 0 failed
receipt: slow package 8.254s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow package 211ms amadan.net/oficina/equipo/internal/runner/provider/claude
receipt: slow package 86ms 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/claude/realcli
receipt: slow test 5.8s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsGoFixture
receipt: slow test 1.83s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPaths
receipt: slow test 470ms amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsCache
receipt: slow test 210ms amadan.net/oficina/equipo/internal/runner/provider/claude TestDirectJournalAdapterBarrier
receipt: slow test 140ms 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.634s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 3.243s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow test 320ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceReadOnlyScratch
receipt: slow test 240ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryUnavailableProof
receipt: slow test 140ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryCleansScratch
receipt: slow test 120ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceDirectPolicyAdmission
receipt: slow test 110ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryReusedPID
machine: 32 CPUs, load 14.02, cpu waiting 12.03%, memory waiting 0.00%, io waiting 2.12%
--- 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 41.2%, load 24.21
shard 25: make runner-dead-references lanes-check build vet fmt-check spacing budget migration-check
python3 scripts/runner-dead-references.py
reference scan: 2646 text files, 3210 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 tool fiesta spacing -skip tokens.css internal/equipo/static
go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget size
budget size: 90 directories within budget
CGO_ENABLED=0 go test ./internal/equipo -run '^TestMigrationModels$' -count=1
ok amadan.net/oficina/equipo/internal/equipo 2.490s
machine: 32 CPUs, load 66.29, cpu waiting 39.83%, memory waiting 0.00%, io waiting 0.83%
--- 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 41.2%, load 24.21
shard 26: make staticcheck
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -tags browser,perf,testbuild ./...
machine: 32 CPUs, load 58.47, cpu waiting 35.43%, memory waiting 0.00%, io waiting 1.20%
--- 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 40.4%, load 24.21
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 3
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 40.66, cpu waiting 24.73%, memory waiting 0.00%, io waiting 1.52%
--- 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 41.2%, load 24.21
shard 28: make gitleaks
[90m4:49PM[0m [32mINF[0m [1mUnknown SCM platform. Use --platform to include links in findings.[0m [36mhost=[0mamadan.net
[90m4:50PM[0m [32mINF[0m [1m1117 commits scanned.[0m
[90m4:50PM[0m [32mINF[0m [1mscanned ~64823612 bytes (64.82 MB) in 24.9s[0m
[90m4:50PM[0m [32mINF[0m [1mno leaks found[0m
machine: 32 CPUs, load 58.47, cpu waiting 36.79%, memory waiting 0.00%, io waiting 1.16%
amadan: job failed at step check shard 17 of 29 — its output is above, not at the tail of this log
diff --git a/.rastrillo/budgets.txt b/.rastrillo/budgets.txt| index e13d3323..28b7d3e4 100644 |
| --- a/.rastrillo/budgets.txt |
| +++ b/.rastrillo/budgets.txt |
| @@ -14,8 +14,8 @@ perf GET /* skip Unknown private paths render 404; this fallback contains no scr |
| time internal/equipo/team 60s Plan 3 loaded CI measured 45.985s; niced serial reruns measured 18.079s and 22.031s. Keep migration, recovery, accounting and concurrency assertions; 60s leaves 30 percent headroom above loaded CI. |
| time internal/equipotest 300s Final fix package rerun measured 187.035s (review 172.4s); 300s gives 60 percent headroom for HTTP, sandbox, authority and final regression coverage. |
| -size internal/equipo 22081 - Engineering stop reasons: no further changes to a candidate, and refused tool requests; measured 22081 source lines. |
| -size internal/wire 6826 - The tools_refused step reason beside no_changes; measured 6826 source lines. |
| +size internal/equipo 22101 - Reviewed native Projects and API copy plus Engineering stop reasons; measured 22101 source lines. |
| +size internal/wire 6828 - Project cursor, typed placement marker and Engineering stop reasons; measured 6828 source lines. |
| size internal/equipotest - 12017 Task 21 repairs historical migration and conversation fixtures after Plan 3, and the Rastrillo upgrade contract comparing served assets with what Assets serves; measured 0/12017 source/test lines. |
| time internal/runner/checks 90s CI worker measured 44.553s (44.6s rounded); |
| time internal/runner 330s Plan 3 CI repair measured 292.120s for the full package (controller CI 472.184s). |
| @@ -30,7 +30,7 @@ size internal/runner/provider 5715 - Fable follow-up: base and diagnostic gates, |
| time internal/plan3test 300s Initial cap for combined browser and runner acceptance; measure at both usable stops. |
| -size internal/plan3test - 11896 Paul-approved Engineering stop reason copy inventory acceptance; measured 11896 test lines. |
| +size internal/plan3test - 11898 Reviewed API, native Projects and Engineering stop reason acceptance lists; measured 11898 test lines. |
| time internal/runner/forge 20s Plan 3 CI repair measured 10.527s for the full package (controller CI 10.407s). |
| time internal/runner/provider 15s Plan 3 CI repair measured 10.346s for the full package (controller CI 10.709s); |
| @@ -56,7 +56,7 @@ perf GET /api/v1/tasks/{id} skip Thin v1 person API: bearer-only JSON for device |
| perf GET /api/v1/assistant/snapshot skip Assistant person API: bearer-only JSON for Base's chat, not a browser screen. |
| perf GET /api/v1/assistant/messages skip Assistant person API: bearer-only JSON for Base's chat, not a browser screen. |
| perf GET /api/v1/assistant/events skip Assistant event stream (Server-Sent Events), bearer-only and long-lived; not a screen. |
| -size internal/equipo/chat 33340 8282 Project card handling, old-runner pass-through and second-option identity regression; measured 33340/8282 source/test lines. |
| +size internal/equipo/chat 33345 8333 Project cursor and typed-card marker with native review regression; measured 33345/8333 source/test lines. |
| perf GET /api/v1/questions/{id} skip Thin v1 person API: bearer-only JSON for devices; the browser reads questions on /tasks/{id}. |
| perf GET /api/v1/steps/{id}/log skip Thin v1 person API: bearer-only JSON for devices; the browser shows the log tail on /tasks/{id}. |
| perf GET /api/v1/connections/preference skip Connections slice 1 person API: bearer-only JSON for devices; the browser shows the preference on /conversation/connections. |
diff --git a/docs/api/equipo-v1.md b/docs/api/equipo-v1.md| index 660239d8..576241c8 100644 |
| --- a/docs/api/equipo-v1.md |
| +++ b/docs/api/equipo-v1.md |
| @@ -186,6 +186,9 @@ The origin is `https://` and a host name with no path, or `http://` on loopback |
| ## Projects and starting a request |
| +`GET /api/v1/projects` includes `cursor`, the event sequence read in the same transaction as its items. Ignore project events at or below that cursor, including viewer-only events with the same shared revision and events for projects absent from the list. |
| + |
| + |
| `GET /api/v1/projects` retains `items`, `allowed` and `home`. It also returns `connections` and `can_add` for repositories reachable by your primary runner that are not active projects. Your primary runner is your newest enrolled primary runner that has not been revoked or marked for removal. Execution currently requires the requesting person to be an active owner of this Equipo team. This is the same team-owner role that `can_add` checks. Execution also requires a usable primary runner. In this release, the connection is `amadan`, with forge `amadan`. The matching connection ID and forge value are intentional. Its title is `Amadan`, its state is `connected` or `unavailable`, and `can_add` indicates whether you are an owner of this Equipo team. Reachability comes from the stored latest runner hello. This is that runner's repository and capability report, not a live connectivity check. Each available entry has `repo`, `name`, `title`, `description`, `description_source`, `forge` and `connection_id`. The legacy `allowed` list remains the complete allowlist, including projects already added. Only an owner can add a project using the existing `POST /api/v1/projects` with `{ "repo": "oficina/home" }`. |
| Project items are ordered with your stars first, followed by recent team activity. They gain `starred` (absent means false), `names` (owner-set team names), `personal_names` (only your learned names), `title_source`, `description_source`, `forge` and `connection_id`. The snapshot and project events also include your star and your private names. Empty optional arrays may be absent. Sources are `owner` or `repository`. Repository text is for display and search only. It is never authoritative for placement. Existing clients can ignore the added fields. |
| @@ -200,7 +203,7 @@ Project items are ordered with your stars first, followed by recent team activit |
| For a plain conversation, the server resolves exact trusted names: owner-set team names, titles set by an owner, and repository keys (`amadan.net/owner/name`, also accepted as `owner/name`). When no owner-set title exists, the repository basename also matches. A unique trusted match takes priority over a learned personal name. A personal name can resolve a name with no trusted match or with several trusted matches. An unknown or ambiguous name opens a placement card only in a person turn whose request asks for work in a named project. A person turn responds to a person's message. A move-in turn is the Coordinator's initial setup work. Discovery searches, move-in turns and explore turns do not open that card. |
| -The card offers up to five reachable projects and, when more are available, "Choose another project." Starred projects come first. Name similarity and recent activity order the remaining choices. Each option is at most 80 bytes. Answer through `POST /api/v1/cards/{id}/answer`. Choosing another project keeps the card open, increments its revision and replaces the options with a text field. That response has the updated `card`; its `message` and `turn` are empty, and no turn starts. Submit the new revision and a project name or repository as `choice`. An unresolved or ambiguous name returns 422 `invalid_input`, leaving the card open. An open typed placement card can also take a composer message in that same conversation as its answer, including device `POST /api/v1/messages`. The whole message must resolve to one available project using the resolver above, or be that name in one of these short phrases: "It should go in <name>", "Put it in <name>" or "Use <name>", optionally ending with " please". Matching ignores case. A valid answer closes the card and resumes the original request, keeping the person's complete words in history. A composer message passes through an open card unless it clearly names one available project as described above. Messages with `project_id` or attachments always follow normal send behavior. Cards that are set aside, answered or closed never consume composer messages. An open card never causes a composer message to return 422. Retries preserve the original message and outcome. Other conversations are unaffected. |
| +The card offers up to five reachable projects and, when more are available, "Choose another project." Starred projects come first. Name similarity and recent activity order the remaining choices. Each option is at most 80 bytes. Answer through `POST /api/v1/cards/{id}/answer`. The server marks the typed placement card with `placement_by_name: true`, including after a remember-name opt-out. Ordinary questions without options do not carry this marker. Choosing another project keeps the card open, increments its revision and replaces the options with a text field. That response has the updated `card`; its `message` and `turn` are empty, and no turn starts. Submit the new revision and a project name or repository as `choice`. An unresolved or ambiguous name returns 422 `invalid_input`, leaving the card open. An open typed placement card can also take a composer message in that same conversation as its answer, including device `POST /api/v1/messages`. The whole message must resolve to one available project using the resolver above, or be that name in one of these short phrases: "It should go in <name>", "Put it in <name>" or "Use <name>", optionally ending with " please". Matching ignores case. A valid answer closes the card and resumes the original request, keeping the person's complete words in history. A composer message passes through an open card unless it clearly names one available project as described above. Messages with `project_id` or attachments always follow normal send behavior. Cards that are set aside, answered or closed never consume composer messages. An open card never causes a composer message to return 422. Retries preserve the original message and outcome. Other conversations are unaffected. |
| A named placement card includes optional `remember_name`, the suggested private name. The web card shows a checked "Remember '<name>' for this project" box and an editable name. Card answers accept optional `remember_name`: only an explicit nonempty string confirms a name. An empty string or omission skips learning. The field is honoured only on a card that already carries a suggestion. The web sends the name explicitly when the box is checked. Clients without the control do not learn a name on a plain tap. The model may suggest the prefilled name, but only the person's final project answer with explicit `remember_name` learns it. Choosing another project preserves an edited suggestion or removes it after an opt-out. Learning waits for the later valid answer, which must also send the name explicitly. Composer answers skip learning. Names are trimmed and stored in lowercase for that person only. They must contain at least three Unicode characters, be at most 120 bytes, be valid UTF-8, and contain no newline or NUL. Stopwords and feature phrases are not learned. An ineligible name skips learning without refusing the project choice. Capitalisation and sentence shape do not determine learning. A repository key outside the allowlist retains the existing access-request flow. |
diff --git a/docs/api/equipo-v1.openapi.json b/docs/api/equipo-v1.openapi.json| index fd7745e7..63803336 100644 |
| --- a/docs/api/equipo-v1.openapi.json |
| +++ b/docs/api/equipo-v1.openapi.json |
| @@ -18667,6 +18667,9 @@ |
| }, |
| "aside": { |
| "type": "boolean" |
| + }, |
| + "placement_by_name": { |
| + "type": "boolean" |
| } |
| }, |
| "required": [ |
| @@ -20830,9 +20833,14 @@ |
| }, |
| "home": { |
| "type": "string" |
| + }, |
| + "cursor": { |
| + "type": "integer", |
| + "format": "int64" |
| } |
| }, |
| "required": [ |
| + "cursor", |
| "items", |
| "allowed", |
| "home" |
diff --git a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md| index e25c910f..724dd0b8 100644 |
| --- a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md |
| +++ b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md |
| @@ -6821,6 +6821,26 @@ records remain unchanged. |
| | `projects.name_to_remember` | Name to remember | (project card names, 2026-11-23; Luna, codex gpt-5.6-luna, house rules) | COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) | |
| | `projects.use_title` | Use the repository title for this project | (project card names, 2026-11-23; Luna, codex gpt-5.6-luna, house rules) | COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) | |
| | `projects.carried_selection` | Equipo's note for the preceding request only: the person selected project %s. | (project card names review fixes, 2026-11-23; Luna, codex gpt-5.6-luna, house rules) | COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) | |
| +| `api.repo_not_allowed` | Your runner can't reach this project's repository. Make sure the repository is available, then try again. | Copy specialist | COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) | |
| +| `api.card_answered` | This card has already been answered. Check the conversation for what happened. | Copy specialist | COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) | |
| +| `api.card_stale` | This item has changed. Check it before trying again. | Copy specialist | COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) | |
| +| `api.confirmation_required` | Confirm the spending limit and check both budget amounts before continuing. | Copy specialist | COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) | |
| +| `api.coordinator_busy` | Your coordinator is working. Wait for its reply, then try again. | Copy specialist | COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) | |
| +| `api.hold_bar` | This work is on hold because of a spending limit or unconfirmed spend. Check the hold, then raise the limit or check provider spend before resuming. | Copy specialist | COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) | |
| +| `api.idempotency_conflict` | The latest details are different. Refresh, check them, then try again. | Copy specialist | COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) | |
| +| `api.models_not_allowed` | Choose at least one model that this connection can use. | Copy specialist | COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) | |
| +| `api.not_active` | This specialist is no longer active. No action is needed. | Copy specialist | COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) | |
| +| `api.not_askable` | This work no longer has a session you can ask about. Ask in the main conversation. | Copy specialist | COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) | |
| +| `api.not_mergeable` | This task cannot be merged now. Check its latest status. | Copy specialist | COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) | |
| +| `api.not_retryable` | This work cannot be retried now. Check its latest status. | Copy specialist | COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) | |
| +| `api.question_ended` | This question has ended. Check the result in the task. | Copy specialist | COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) | |
| +| `api.runner_offline` | Your runner is offline. Reconnect it, then try again. | Copy specialist | COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) | |
| +| `api.task_busy` | This task is still working. Wait for it to finish, then try again. | Copy specialist | COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) | |
| +| `api.task_ended` | This task has ended. Check its result. | Copy specialist | COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) | |
| +| `api.task_merging` | This task is merging. Wait for it to finish. | Copy specialist | COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) | |
| +| `api.turn_ended` | This reply has ended. | Copy specialist | COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) | |
| +| `projects.new_request` | New request | Copy specialist | COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) | |
| +| `projects.remove_selection` | Remove project | Copy specialist | COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) | |
| | `work.reason.no_further_changes` | it made no further changes to the candidate | Task page: fills "Engineering stopped: %s" when an Engineering step ended no_changes and an earlier round already pushed a candidate (stop reasons, 2026-11-23) | Runtime; COPY APPROVED (Paul, 2026-11-23, copy-review eavqvil43jg2zs3wxx3kxp3bpm, unchanged) | |
| | `work.reason.tools_refused` | Equipo refused the commands it needed to run | Task page: fills "Engineering stopped: %s" when an Engineering step committed nothing after Equipo refused tool requests it made (stop reasons, 2026-11-23) | Runtime; COPY APPROVED (Paul, 2026-11-23, copy-review eavqvil43jg2zs3wxx3kxp3bpm, unchanged) | |
diff --git a/internal/equipo/api_copy_scan_test.go b/internal/equipo/api_copy_scan_test.go| new file mode 100644 |
| index 00000000..e4424654 |
| --- /dev/null |
| +++ b/internal/equipo/api_copy_scan_test.go |
| @@ -0,0 +1,69 @@ |
| +package equipo |
| + |
| +import ( |
| + "os" |
| + "path/filepath" |
| + "testing" |
| +) |
| + |
| +func TestAPIErrorCopyScanEscapes(t *testing.T) { |
| + for _, tc := range []struct{ name, file, source, key string }{ |
| + {"variable", "chat/handler.go", `package chat; func f(){ code := "missing_variable"; WriteError(w,r,400,code,nil) }`, "api.missing_variable"}, |
| + {"wiring", "chat_wiring.go", `package equipo; func f(){ personapi.WriteError(w,r,400,"missing_wiring",nil) }`, "api.missing_wiring"}, |
| + {"literal", "newpackage/handler.go", `package newpackage; func f(){ writeJSON(w,400,Error{CopyKey:"api.missing_literal"}) }`, "api.missing_literal"}, |
| + {"alias", "newpackage/handler.go", `package newpackage; const reason = "missing_alias"; func f(){ first := reason; code := first; WriteError(w,r,400,code,nil) }`, "api.missing_alias"}, |
| + {"copy-variable", "newpackage/handler.go", `package newpackage; func f(){ key := "api.missing_key"; writeJSON(w,400,Error{CopyKey:key}) }`, "api.missing_key"}, |
| + {"raw-map", "newpackage/handler.go", `package newpackage; func f(){ writeJSON(w,400,map[string]any{"copy_key":"api.missing_map"}) }`, "api.missing_map"}, |
| + {"raw-map-variable", "newpackage/handler.go", `package newpackage; func f(){ key := "api.missing_map_variable"; writeJSON(w,400,map[string]any{"copy_key":key}) }`, "api.missing_map_variable"}, |
| + {"raw-map-key-constant", "newpackage/handler.go", `package newpackage; const field = "copy_key"; func f(){ writeJSON(w,400,map[string]any{field:"api.missing_map_constant"}) }`, "api.missing_map_constant"}, |
| + {"branches", "newpackage/handler.go", `package newpackage; func f(){ code := "invalid_input"; if bad { code = "missing_branch" }; WriteError(w,r,400,code,nil) }`, "api.missing_branch"}, |
| + } { |
| + t.Run(tc.name, func(t *testing.T) { |
| + dir := t.TempDir() |
| + file := filepath.Join(dir, tc.file) |
| + if err := os.MkdirAll(filepath.Dir(file), 0700); err != nil { |
| + t.Fatal(err) |
| + } |
| + if err := os.WriteFile(file, []byte(tc.source), 0600); err != nil { |
| + t.Fatal(err) |
| + } |
| + keys, err := scanAPIErrorCopy(dir) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if !keys[tc.key] { |
| + t.Fatalf("missed %s", tc.key) |
| + } |
| + }) |
| + } |
| +} |
| + |
| +func TestAPIErrorCopyScanRejectsUnresolvedAndIgnoresToolResults(t *testing.T) { |
| + dir := t.TempDir() |
| + file := filepath.Join(dir, "tools.go") |
| + write := func(source string) { |
| + t.Helper() |
| + if err := os.WriteFile(file, []byte(source), 0600); err != nil { |
| + t.Fatal(err) |
| + } |
| + } |
| + write(`package chat; func f(){code:="provider_error";return toolResult{code:code}}`) |
| + keys, err := scanAPIErrorCopy(dir) |
| + if err != nil || len(keys) != 0 { |
| + t.Fatalf("tool result became HTTP error: %v %v", keys, err) |
| + } |
| + write(`package chat; func f(){code:=dynamic(); WriteError(w,r,400,code,nil)}`) |
| + if _, err := scanAPIErrorCopy(dir); err == nil { |
| + t.Fatal("unknown dynamic error path escaped guard") |
| + } |
| +} |
| + |
| +func TestAPIErrorCopyScanRejectsDynamicRawMap(t *testing.T) { |
| + dir := t.TempDir() |
| + if err := os.WriteFile(filepath.Join(dir, "handler.go"), []byte(`package handler; func f(){ writeJSON(w,400,map[string]any{"copy_key":dynamic()}) }`), 0600); err != nil { |
| + t.Fatal(err) |
| + } |
| + if _, err := scanAPIErrorCopy(dir); err == nil { |
| + t.Fatal("dynamic raw-map copy key escaped the guard") |
| + } |
| +} |
diff --git a/internal/equipo/api_copy_test.go b/internal/equipo/api_copy_test.go| new file mode 100644 |
| index 00000000..955a640a |
| --- /dev/null |
| +++ b/internal/equipo/api_copy_test.go |
| @@ -0,0 +1,247 @@ |
| +package equipo |
| + |
| +import ( |
| + "fmt" |
| + "go/ast" |
| + "go/importer" |
| + "go/parser" |
| + "go/token" |
| + "go/types" |
| + "io/fs" |
| + "path/filepath" |
| + "strconv" |
| + "strings" |
| + "testing" |
| +) |
| + |
| +func TestAPIErrorCopyKeys(t *testing.T) { |
| + keys, err := scanAPIErrorCopy("..") |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + for key := range keys { |
| + if copyText(key) == "" || copyText(key) == key { |
| + t.Errorf("API returns copy_key %s without text", key) |
| + } |
| + } |
| +} |
| + |
| +// Scan all internal packages, including wiring outside chat and personapi. |
| +// Follow string assignments to API error sinks, not unrelated tool-result codes. |
| +// Unknown expressions fail closed so a new helper needs explicit analysis. |
| +func scanAPIErrorCopy(root string) (map[string]bool, error) { |
| + keys := map[string]bool{} |
| + fset := token.NewFileSet() |
| + imports := importer.Default() |
| + err := filepath.WalkDir(root, func(path string, entry fs.DirEntry, walkErr error) error { |
| + if walkErr != nil { |
| + return walkErr |
| + } |
| + if entry.IsDir() || !strings.HasSuffix(path, ".go") || strings.HasSuffix(path, "_test.go") { |
| + return nil |
| + } |
| + file, err := parser.ParseFile(fset, path, nil, parser.SkipObjectResolution) |
| + if err != nil { |
| + return err |
| + } |
| + // Only error-writing files need lexical bindings. Other declarations in |
| + // this single file may be unresolved; unknown sink values still fail below. |
| + hasSink := false |
| + ast.Inspect(file, func(n ast.Node) bool { |
| + if call, ok := n.(*ast.CallExpr); ok && callName(call.Fun) == "WriteError" { |
| + hasSink = true |
| + } |
| + if id, ok := n.(*ast.Ident); ok && id.Name == "CopyKey" { |
| + hasSink = true |
| + } |
| + if literal, ok := n.(*ast.BasicLit); ok && literal.Kind == token.STRING { |
| + value, _ := strconv.Unquote(literal.Value) |
| + if value == "copy_key" { |
| + hasSink = true |
| + } |
| + } |
| + return true |
| + }) |
| + if !hasSink { |
| + return nil |
| + } |
| + info := &types.Info{Defs: map[*ast.Ident]types.Object{}, Uses: map[*ast.Ident]types.Object{}} |
| + config := types.Config{Importer: imports, Error: func(error) {}} |
| + _, _ = config.Check(file.Name.Name, fset, []*ast.File{file}, info) |
| + object := func(id *ast.Ident) types.Object { |
| + if value := info.Defs[id]; value != nil { |
| + return value |
| + } |
| + return info.Uses[id] |
| + } |
| + assignments := map[types.Object][]ast.Expr{} |
| + bind := func(id *ast.Ident, expr ast.Expr) { |
| + if object(id) != nil { |
| + assignments[object(id)] = append(assignments[object(id)], expr) |
| + } |
| + } |
| + ast.Inspect(file, func(n ast.Node) bool { |
| + switch v := n.(type) { |
| + case *ast.AssignStmt: |
| + if len(v.Lhs) == len(v.Rhs) { |
| + for i, lhs := range v.Lhs { |
| + if id, ok := lhs.(*ast.Ident); ok { |
| + bind(id, v.Rhs[i]) |
| + } |
| + } |
| + } |
| + case *ast.ValueSpec: |
| + if len(v.Names) == len(v.Values) { |
| + for i, id := range v.Names { |
| + bind(id, v.Values[i]) |
| + } |
| + } |
| + } |
| + return true |
| + }) |
| + var values func(ast.Expr, map[types.Object]bool) ([]string, error) |
| + values = func(expr ast.Expr, seen map[types.Object]bool) ([]string, error) { |
| + switch v := expr.(type) { |
| + case *ast.BasicLit: |
| + if v.Kind == token.STRING { |
| + s, e := strconv.Unquote(v.Value) |
| + return []string{s}, e |
| + } |
| + case *ast.ParenExpr: |
| + return values(v.X, seen) |
| + case *ast.Ident: |
| + if object(v) != nil && !seen[object(v)] && len(assignments[object(v)]) > 0 { |
| + seen[object(v)] = true |
| + defer delete(seen, object(v)) |
| + var out []string |
| + for _, expr := range assignments[object(v)] { |
| + parts, e := values(expr, seen) |
| + if e != nil { |
| + return nil, e |
| + } |
| + out = append(out, parts...) |
| + } |
| + return out, nil |
| + } |
| + case *ast.BinaryExpr: |
| + if v.Op == token.ADD { |
| + left, e := values(v.X, seen) |
| + if e != nil { |
| + return nil, e |
| + } |
| + right, e := values(v.Y, seen) |
| + if e != nil { |
| + return nil, e |
| + } |
| + var out []string |
| + for _, a := range left { |
| + for _, b := range right { |
| + out = append(out, a+b) |
| + } |
| + } |
| + return out, nil |
| + } |
| + } |
| + return nil, fmt.Errorf("unresolved API error expression at %s", fset.Position(expr.Pos())) |
| + } |
| + var failure error |
| + ast.Inspect(file, func(n ast.Node) bool { |
| + if failure != nil { |
| + return false |
| + } |
| + if call, ok := n.(*ast.CallExpr); ok && callName(call.Fun) == "WriteError" { |
| + if len(call.Args) != 5 { |
| + failure = fmt.Errorf("unrecognised WriteError at %s", fset.Position(call.Pos())) |
| + return false |
| + } |
| + codes, e := values(call.Args[3], map[types.Object]bool{}) |
| + if e != nil { |
| + failure = e |
| + return false |
| + } |
| + for _, code := range codes { |
| + if code == "subscription_expired" { |
| + keys["notifications."+code] = true |
| + } else { |
| + keys["api."+code] = true |
| + } |
| + // These are the additional scopes of personapi.errorCopyKey. Their |
| + // dispatch is exercised by the person API's error response tests. |
| + if code == "cursor_expired" { |
| + keys["notifications."+code] = true |
| + } |
| + if code == "invalid_input" || code == "forbidden" || code == "revision_conflict" { |
| + keys["roster."+code] = true |
| + keys["budgets."+code] = true |
| + } |
| + } |
| + } |
| + if literal, ok := n.(*ast.CompositeLit); ok { |
| + hasCode := false |
| + for _, element := range literal.Elts { |
| + if kv, ok := element.(*ast.KeyValueExpr); ok { |
| + if id, ok := kv.Key.(*ast.Ident); ok && id.Name == "Code" { |
| + hasCode = true |
| + } |
| + } |
| + } |
| + for _, element := range literal.Elts { |
| + kv, ok := element.(*ast.KeyValueExpr) |
| + if !ok { |
| + continue |
| + } |
| + id, namedField := kv.Key.(*ast.Ident) |
| + structCopyKey := namedField && id.Name == "CopyKey" |
| + rawMapCopyKey := false |
| + if names, err := values(kv.Key, map[types.Object]bool{}); err == nil { |
| + for _, name := range names { |
| + if name == "copy_key" { |
| + rawMapCopyKey = true |
| + } |
| + } |
| + } |
| + if !structCopyKey && !rawMapCopyKey { |
| + continue |
| + } |
| + // WriteError's computed copy key is covered through every call above. |
| + if call, ok := kv.Value.(*ast.CallExpr); ok && callName(call.Fun) == "errorCopyKey" { |
| + continue |
| + } |
| + apiLiteral := false |
| + ast.Inspect(kv.Value, func(n ast.Node) bool { |
| + if s, ok := n.(*ast.BasicLit); ok && s.Kind == token.STRING { |
| + v, _ := strconv.Unquote(s.Value) |
| + apiLiteral = apiLiteral || strings.HasPrefix(v, "api.") |
| + } |
| + return true |
| + }) |
| + errorType := strings.HasSuffix(callName(literal.Type), "Error") || strings.HasSuffix(callName(literal.Type), "Conflict") |
| + if !hasCode && !apiLiteral && !errorType && !rawMapCopyKey { |
| + continue |
| + } |
| + texts, e := values(kv.Value, map[types.Object]bool{}) |
| + if e != nil { |
| + failure = e |
| + return false |
| + } |
| + for _, text := range texts { |
| + keys[text] = true |
| + } |
| + } |
| + } |
| + return true |
| + }) |
| + return failure |
| + }) |
| + return keys, err |
| +} |
| + |
| +func callName(expr ast.Expr) string { |
| + switch v := expr.(type) { |
| + case *ast.Ident: |
| + return v.Name |
| + case *ast.SelectorExpr: |
| + return v.Sel.Name |
| + } |
| + return "" |
| +} |
diff --git a/internal/equipo/chat/project_native_review_test.go b/internal/equipo/chat/project_native_review_test.go| new file mode 100644 |
| index 00000000..a0ecba15 |
| --- /dev/null |
| +++ b/internal/equipo/chat/project_native_review_test.go |
| @@ -0,0 +1,51 @@ |
| +package chat |
| + |
| +import ( |
| + "context" |
| + "encoding/json" |
| + "testing" |
| + |
| + "amadan.net/oficina/equipo/internal/wire" |
| +) |
| + |
| +func TestProjectListCursorAndTypedMarker(t *testing.T) { |
| + r := placementRig(t) |
| + ctx := context.Background() |
| + data, _ := json.Marshal(placementData{ByName: true}) |
| + c := cardRecord{ID: "c_typed", Person: hkOwner, Kind: wire.CardQuestion, State: wire.CardOpen, Options: "[]", Placement: string(data), Revision: 1} |
| + err := r.s.tx(ctx, func(tx *txn) error { |
| + typed, err := tx.cardView(c) |
| + if err != nil { |
| + return err |
| + } |
| + if !typed.PlacementByName { |
| + t.Error("typed placement must have a marker even after opting out") |
| + } |
| + c.Placement = "" |
| + ordinary, err := tx.cardView(c) |
| + if ordinary.PlacementByName { |
| + t.Error("ordinary question has project marker") |
| + } |
| + if err != nil { |
| + return err |
| + } |
| + return tx.event("", hkOwner, wire.EventProject, "project", "p_event", 1, "", "", 0, wire.Project{}) |
| + }) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if _, _, err := r.s.AddProject(ctx, hkOwner, "oficina/new"); err != nil { |
| + t.Fatal(err) |
| + } |
| + list, err := r.s.Projects(ctx, hkOwner) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + cursor, err := r.s.Cursor(ctx) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if cursor == 0 || list.Cursor != cursor { |
| + t.Fatalf("list cursor = %d, events = %d", list.Cursor, cursor) |
| + } |
| +} |
diff --git a/internal/equipo/chat/projects.go b/internal/equipo/chat/projects.go| index 8066d7ca..b2f8e834 100644 |
| --- a/internal/equipo/chat/projects.go |
| +++ b/internal/equipo/chat/projects.go |
| @@ -285,6 +285,7 @@ func (t *txn) cardView(c cardRecord) (wire.Card, error) { |
| return v, err |
| } |
| v.RememberName = data.RequestedName |
| + v.PlacementByName = data.ByName |
| } |
| if c.Access != "" { |
| if err := json.Unmarshal([]byte(c.Access), &v.Access); err != nil { |
| @@ -577,7 +578,11 @@ func (s *Store) Projects(ctx context.Context, person string) (out wire.ProjectLi |
| if err != nil { |
| return err |
| } |
| - return t.projectListExtras(person, h, &out) |
| + if err := t.projectListExtras(person, h, &out); err != nil { |
| + return err |
| + } |
| + out.Cursor, err = maxEvent(t.db) |
| + return err |
| }) |
| return out, err |
| } |
diff --git a/internal/equipo/copy.go b/internal/equipo/copy.go| index 090e9444..b5a1e9f9 100644 |
| --- a/internal/equipo/copy.go |
| +++ b/internal/equipo/copy.go |
| @@ -70,8 +70,28 @@ const BootLog = "Equipo could not start." |
| // COPY APPROVED BY DELEGATION (Luna pass, 2026-11-01, house rules). |
| var pageCopy = map[string]string{ |
| + "api.repo_not_allowed": "Your runner can't reach this project's repository. Make sure the repository is available, then try again.", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) |
| + "api.card_answered": "This card has already been answered. Check the conversation for what happened.", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) |
| + "api.card_stale": "This item has changed. Check it before trying again.", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) |
| + "api.confirmation_required": "Confirm the spending limit and check both budget amounts before continuing.", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) |
| + "api.coordinator_busy": "Your coordinator is working. Wait for its reply, then try again.", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) |
| + "api.hold_bar": "This work is on hold because of a spending limit or unconfirmed spend. Check the hold, then raise the limit or check provider spend before resuming.", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) |
| + "api.idempotency_conflict": "The latest details are different. Refresh, check them, then try again.", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) |
| + "api.models_not_allowed": "Choose at least one model that this connection can use.", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) |
| + "api.not_active": "This specialist is no longer active. No action is needed.", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) |
| + "api.not_askable": "This work no longer has a session you can ask about. Ask in the main conversation.", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) |
| + "api.not_mergeable": "This task cannot be merged now. Check its latest status.", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) |
| + "api.not_retryable": "This work cannot be retried now. Check its latest status.", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) |
| + "api.question_ended": "This question has ended. Check the result in the task.", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) |
| + "api.runner_offline": "Your runner is offline. Reconnect it, then try again.", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) |
| + "api.task_busy": "This task is still working. Wait for it to finish, then try again.", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) |
| + "api.task_ended": "This task has ended. Check its result.", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) |
| + "api.task_merging": "This task is merging. Wait for it to finish.", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) |
| + "api.turn_ended": "This reply has ended.", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) |
| "projects.amadan": "Amadan", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-22) |
| "projects.yours": "Your projects", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-22) |
| + "projects.new_request": "New request", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) |
| + "projects.remove_selection": "Remove project", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) |
| "projects.can_add": "Available to add", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-22) |
| "projects.add_reachable": "Add project", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-22) |
| "projects.names": "Names people use", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-22) |
diff --git a/internal/plan3test/plan3_release_test.go b/internal/plan3test/plan3_release_test.go| index 849f3f51..c6788077 100644 |
| --- a/internal/plan3test/plan3_release_test.go |
| +++ b/internal/plan3test/plan3_release_test.go |
| @@ -196,11 +196,13 @@ func plan3CopyInventory(t *testing.T) { |
| acceptedPush := slices.Contains([]string{"copyLoggedPushPublic", "copyCarlosPushUnavailable", "copyPushBoth", "push.card.title", "push.card.body", "push.reply.title", "push.task.done", "push.task.cancelled", "push.task.failed", "push.activity.started", "docs/api/equipo-v1.md / Talk to your Coordinator from a device: set aside", "docs/api/equipo-v1.md / Receive pushes on a device"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Luna, 2026-11-20)") |
| // Paul, 2026-11-20: Luna's verdicts are the agent-access copy review. |
| // Paul, 2026-11-22: Luna verdicts and the controller clarification are this slice's review. |
| + acceptedAPIErrors := slices.Contains([]string{"api.repo_not_allowed", "api.card_answered", "api.card_stale", "api.confirmation_required", "api.coordinator_busy", "api.hold_bar", "api.idempotency_conflict", "api.models_not_allowed", "api.not_active", "api.not_askable", "api.not_mergeable", "api.not_retryable", "api.question_ended", "api.runner_offline", "api.task_busy", "api.task_ended", "api.task_merging", "api.turn_ended"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23)") |
| + acceptedNativeProjects := slices.Contains([]string{"projects.new_request", "projects.remove_selection"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23)") |
| acceptedCardNames := slices.Contains([]string{"projects.carried_selection", "projects.remember_name", "projects.name_to_remember", "projects.use_title", "docs/api/equipo-v1.md / Projects and starting a request"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23)") |
| acceptedProjects := slices.Contains([]string{"projects.amadan", "projects.yours", "projects.can_add", "projects.add_reachable", "projects.names", "projects.names_hint", "projects.details", "projects.title", "projects.description", "projects.save", "projects.context", "projects.found", "projects.selected", "projects.owner_add", "projects.selection_lost", "projects.other", "projects.name_question", "projects.personal_names", "projects.forget_name", "docs/api/equipo-v1.md / Projects and starting a request"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Luna, 2026-11-22)") |
| acceptedAgentAccess := slices.Contains([]string{"copyAgentConfig", "copyAgentForbidden", "copyAgentNotFound", "copyAgentUnavailable", "copyAgentTooLarge", "copyAgentInvalid", "copyAgentMedia", "copyAgentUnauthenticated", "agent.equipo_projects_list", "agent.equipo_tasks_list", "agent.equipo_task_get", "agent.equipo_needs_you", "docs/api/equipo-v1.md / Delegated read-only operations"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Luna, 2026-11-20)") |
| acceptedCopy := strings.TrimSuffix(cells[3], " |") == "COPY ACCEPTED BY DELEGATION (Copy, record-bound) sha256:"+copydesk.Hash(rows[key]) |
| - if !acceptedInjection && !acceptedMail && !acceptedPush && !acceptedAgentAccess && !acceptedProjects && !acceptedCardNames && !acceptedAccess && !acceptedPlacementEdges && !acceptedPlacement && !acceptedReportActions && !acceptedRoster && !acceptedCopy && !strings.Contains(cells[3], "COPY REVIEW REQUIRED") && !acceptedAll && !acceptedGuide && !acceptedRound2 && !acceptedStarter && !acceptedDelegation && !approvedPublish && !approvedAssistant && !approvedJobs && !approvedOficina && !approvedFailedReplies && !approvedStopReasons { |
| + if !acceptedAPIErrors && !acceptedNativeProjects && !acceptedInjection && !acceptedMail && !acceptedPush && !acceptedAgentAccess && !acceptedProjects && !acceptedCardNames && !acceptedAccess && !acceptedPlacementEdges && !acceptedPlacement && !acceptedReportActions && !acceptedRoster && !acceptedCopy && !strings.Contains(cells[3], "COPY REVIEW REQUIRED") && !acceptedAll && !acceptedGuide && !acceptedRound2 && !acceptedStarter && !acceptedDelegation && !approvedPublish && !approvedAssistant && !approvedJobs && !approvedOficina && !approvedFailedReplies && !approvedStopReasons { |
| t.Fatal("entry has no copy review status or applicable acceptance", key) |
| } |
| } |
diff --git a/internal/wire/api.go b/internal/wire/api.go| index 21835453..0f5ebb02 100644 |
| --- a/internal/wire/api.go |
| +++ b/internal/wire/api.go |
| @@ -336,6 +336,7 @@ type Project struct { |
| // ProjectList is GET /api/v1/projects. Allowed is the person's |
| // runner-advertised allowlist: the repositories add may take. |
| type ProjectList struct { |
| + Cursor int64 `json:"cursor"` |
| Connections []ProjectConnection `json:"connections,omitempty"` |
| CanAdd []ReachableProject `json:"can_add,omitempty"` |
| Items []Project `json:"items"` |
| @@ -354,18 +355,19 @@ type AddProject struct { |
| // Card is something in the conversation the person can act on: a project |
| // the coordinator added (Remove) or a question (answer). |
| type Card struct { |
| - RememberName string `json:"remember_name,omitempty"` |
| - Access *AccessRequest `json:"access,omitempty"` |
| - ID string `json:"id"` |
| - Revision int64 `json:"revision"` |
| - Kind string `json:"kind"` |
| - State string `json:"state"` |
| - TurnID string `json:"turn_id"` |
| - ProjectID string `json:"project_id"` |
| - Name string `json:"name"` |
| - Question string `json:"question"` |
| - Options []string `json:"options"` |
| - Choice string `json:"choice"` |
| + PlacementByName bool `json:"placement_by_name,omitempty"` |
| + RememberName string `json:"remember_name,omitempty"` |
| + Access *AccessRequest `json:"access,omitempty"` |
| + ID string `json:"id"` |
| + Revision int64 `json:"revision"` |
| + Kind string `json:"kind"` |
| + State string `json:"state"` |
| + TurnID string `json:"turn_id"` |
| + ProjectID string `json:"project_id"` |
| + Name string `json:"name"` |
| + Question string `json:"question"` |
| + Options []string `json:"options"` |
| + Choice string `json:"choice"` |
| // TaskID names the task a task card reports. |
| TaskID string `json:"task_id"` |
| CreatedAt time.Time `json:"created_at"` |
diff --git a/internal/wire/wiretest/testdata/api/projects.json b/internal/wire/wiretest/testdata/api/projects.json| index c7e21dfb..73708e83 100644 |
| --- a/internal/wire/wiretest/testdata/api/projects.json |
| +++ b/internal/wire/wiretest/testdata/api/projects.json |
| @@ -1 +1 @@ |
| -{"connections":[{"id":"amadan","forge":"amadan","title":"Amadan","state":"connected","can_add":true}],"can_add":[{"repo":"amadan.net/oficina/equipo","name":"oficina/equipo","title":"Equipo","description":"","description_source":"repository","forge":"amadan","connection_id":"amadan"}],"items":[{"title_source":"repository","description_source":"repository","forge":"amadan","connection_id":"amadan","id":"p_0001","revision":1,"repo":"amadan.net/oficina/sample","name":"oficina/sample","title":"Sample","attachments":[{"kind":"repo","ref":"amadan.net/oficina/sample","name":"oficina/sample","default_branch":"main","head_sha":"3333333333333333333333333333333333333333","head_subject":"Swipe from the edge goes back","head_at":"2026-11-07T09:30:00Z"}],"state":"active","added_by":"owner@example.com","created_at":"2026-11-06T10:00:00Z","updated_at":"2026-11-06T10:00:01Z","description":"A sample app for Equipo tests.","stack":["Go"],"checks":{"here":true,"gate":"make ci","reason":""},"people":[{"address":"owner@example.com","name":"Owner","initials":"O"}]}],"allowed":["amadan.net/oficina/equipo","amadan.net/oficina/sample"],"home":"oficina"} |
| +{"cursor":0,"connections":[{"id":"amadan","forge":"amadan","title":"Amadan","state":"connected","can_add":true}],"can_add":[{"repo":"amadan.net/oficina/equipo","name":"oficina/equipo","title":"Equipo","description":"","description_source":"repository","forge":"amadan","connection_id":"amadan"}],"items":[{"title_source":"repository","description_source":"repository","forge":"amadan","connection_id":"amadan","id":"p_0001","revision":1,"repo":"amadan.net/oficina/sample","name":"oficina/sample","title":"Sample","attachments":[{"kind":"repo","ref":"amadan.net/oficina/sample","name":"oficina/sample","default_branch":"main","head_sha":"3333333333333333333333333333333333333333","head_subject":"Swipe from the edge goes back","head_at":"2026-11-07T09:30:00Z"}],"state":"active","added_by":"owner@example.com","created_at":"2026-11-06T10:00:00Z","updated_at":"2026-11-06T10:00:01Z","description":"A sample app for Equipo tests.","stack":["Go"],"checks":{"here":true,"gate":"make ci","reason":""},"people":[{"address":"owner@example.com","name":"Owner","initials":"O"}]}],"allowed":["amadan.net/oficina/equipo","amadan.net/oficina/sample"],"home":"oficina"} |
diff --git a/native/API-COPY-REVIEW.md b/native/API-COPY-REVIEW.md| new file mode 100644 |
| index 00000000..d1a79870 |
| --- /dev/null |
| +++ b/native/API-COPY-REVIEW.md |
| @@ -0,0 +1,129 @@ |
| +# API error copy review, 2026-11-23 |
| + |
| +The Projects device API exposed `api.repo_not_allowed` without text. The new |
| +source guard then found 17 further HTTP error keys without text. Paul delegated |
| +these reviews to Luna; the controller supplied the verdicts below and directed |
| +their exact application. All 18 keys were marked pending with copy-status.py |
| +before recording Luna's markers and the accepted inventory entries. Native |
| +imports the same strings and checks parity. |
| + |
| +The first scan also found `provider_error` in Assistant tool output. It is not |
| +an HTTP copy key. The guard scans error-producing paths and has no exceptions |
| +for missing copy. It also covers scoped notification, roster and budget errors. |
| + |
| +Validation: TestAPIErrorCopyKeys failed on the omissions first. Removing |
| +api.repo_not_allowed and introducing a new HTTP error without text each made |
| +the guard fail; both mutations were restored. The affected Go package, release |
| +copy inventory, vet, staticcheck, formatting and module checks pass. A broader |
| +onboarding acceptance test fails with provider_uncertain on this branch and |
| +unchanged main 198ce406; it is unrelated to copy. |
| + |
| + |
| +## Luna brief 9 |
| + |
| +# Copy review brief: Equipo error string (2026-11-23) |
| + |
| +Paul delegates copy review to you; your edits will be applied as approved copy. |
| +Context: Equipo's apps and web show this error when a person sends a request |
| +with a project selected, but the project's repository is not reachable by their |
| +runner (it's not in the runner's current allowlist; for example access was |
| +removed or the repository is offline). The message stays visible with a Retry |
| +action. A different, already-approved notice covers a project removed while a |
| +request is in progress. |
| + |
| +## String (id fixed, text yours) |
| +- `api.repo_not_allowed`: Draft: `Equipo can't reach this project.` |
| + |
| +## House rules (Paul's, binding) |
| +No em dashes, no exclamation marks. Plain words, short, sentence case. Say what |
| +happened and what to do. Don't change facts; flag what looks wrong. |
| + |
| +## Output |
| +1. Table: `id | current | new (or "unchanged") | why`. |
| +2. Flagged rows. |
| +3. Counts. |
| + |
| + |
| +## Luna result 9 |
| + |
| +| id | current | new (or "unchanged") | why | |
| +|---|---|---|---| |
| +| `api.repo_not_allowed` | Equipo can't reach this project. | Your runner can't reach this project's repository. Make sure the repository is available, then try again. | Explains what happened and gives a clear next step. | |
| + |
| +Flagged rows: |
| + |
| +- `api.repo_not_allowed`: The draft does not tell the person what to do. It also refers to the project rather than its repository. |
| + |
| +Counts: 1 reviewed, 1 changed, 0 unchanged, 1 flagged. |
| + |
| + |
| +## Luna brief 10 |
| + |
| +# Copy review brief: Equipo API error messages (2026-11-23) |
| + |
| +Paul delegates copy review to you; your edits will be applied as approved copy. |
| +Equipo is Oficina's team app; a Coordinator agent works with specialists on |
| +tasks in code projects. These errors are shown to a person in the web app and |
| +the iPhone and Mac apps when an action is refused. Today they show as bare keys, |
| +so these will be the first words people see. Each row: key, draft, when it |
| +happens, and what the person can do next. |
| + |
| +- `api.card_answered`: "This card has already been answered. Check the conversation for what happened." Answering a card that's already completed. Next: read the card/conversation. |
| +- `api.card_stale`: "This item has changed. Check it before trying again." Answering an open card with an out-of-date version. Next: look at the updated card, then answer. (Same words as an existing native string.) |
| +- `api.confirmation_required`: "Confirm the spending limit and check both budget amounts before continuing." Adding a metered (paid) model key without the required confirmations. Next: complete them. (Exact existing web text.) |
| +- `api.coordinator_busy`: "Your coordinator is working. Wait for its reply, then try again." Resetting notes or moving a task while the Coordinator is mid-reply. Next: wait. |
| +- `api.hold_bar`: "This work is waiting on a spending limit or an unknown spend. Check the hold before continuing." "Run now" on work held by a budget limit or by spend that couldn't be confirmed. Next: check the hold; raise the budget or check provider spend, then Resume. |
| +- `api.idempotency_conflict`: "This request changed. Check the latest details before trying again." A repeated request with different content, or the thing changed since you loaded it. Next: refresh, check, submit again on purpose. |
| +- `api.models_not_allowed`: "Choose at least one model available to this connection." Saving a connection's models with none, or one this key can't use. Next: pick from the available list. |
| +- `api.not_active`: "This specialist is no longer active." Revoking a specialist that already stopped. Next: nothing needed. |
| +- `api.not_askable`: "This work no longer has a session you can ask about." Asking a question about work whose session isn't kept any more. Next: ask in the main conversation. |
| +- `api.not_mergeable`: "This task cannot be merged now. Check its latest status." Merging a task that isn't ready or fails a merge requirement. Next: look at the task. |
| +- `api.not_retryable`: "This work cannot be retried now. Check its latest status." Retrying when nothing failed that can be retried. Next: look at the latest status. |
| +- `api.question_ended`: "This question has ended. Check its answer in the task." Cancelling a question that already finished (it may have been answered, failed or cancelled). Next: look at the result. |
| +- `api.runner_offline`: "Your runner is offline. Reconnect it, then try again." Actions needing the person's runner (their machine that runs agents) while it's offline. Next: reconnect it. |
| +- `api.task_busy`: "This task is still working. Wait for it to finish, then try again." Changing a task while its steps or a question are still running. Next: wait. |
| +- `api.task_ended`: "This task has ended. Check its result." Changing a task that's done or cancelled. Next: look at the result; start a new request if needed. |
| +- `api.task_merging`: "This task is merging. Wait for it to finish." Changing a task while its merge is under way. Next: wait. |
| +- `api.turn_ended`: "Your coordinator has finished this reply." Stopping a reply that already ended (finished, failed or cancelled). Next: read the reply; nothing to stop. (Alternative: "This reply has ended.") |
| + |
| +## House rules (Paul's, binding) |
| +No em dashes, no exclamation marks. Plain words, short, sentence case. Say what |
| +happened and what to do. Consistent voice across the set. Don't change facts; |
| +flag what looks wrong. |
| + |
| +## Output |
| +1. Table: `id | current | new (or "unchanged") | why`. |
| +2. Flagged rows. |
| +3. Counts. |
| + |
| + |
| +## Luna result 10 |
| + |
| +| id | current | new (or "unchanged") | why | |
| +|---|---|---|---| |
| +| `api.card_answered` | “This card has already been answered. Check the conversation for what happened.” | unchanged | Clear and actionable. | |
| +| `api.card_stale` | “This item has changed. Check it before trying again.” | unchanged | Preserve exact existing native string. | |
| +| `api.confirmation_required` | “Confirm the spending limit and check both budget amounts before continuing.” | unchanged | Preserve exact existing web text. | |
| +| `api.coordinator_busy` | “Your coordinator is working. Wait for its reply, then try again.” | unchanged | Clear and direct. | |
| +| `api.hold_bar` | “This work is waiting on a spending limit or an unknown spend. Check the hold before continuing.” | “This work is on hold because of a spending limit or unconfirmed spend. Check the hold, then raise the limit or check provider spend before resuming.” | Clarifies the state and next action. | |
| +| `api.idempotency_conflict` | “This request changed. Check the latest details before trying again.” | “The latest details are different. Refresh, check them, then try again.” | Covers both changed requests and changed items. | |
| +| `api.models_not_allowed` | “Choose at least one model available to this connection.” | “Choose at least one model that this connection can use.” | More natural and specific. | |
| +| `api.not_active` | “This specialist is no longer active.” | “This specialist is no longer active. No action is needed.” | States the required next step. | |
| +| `api.not_askable` | “This work no longer has a session you can ask about.” | “This work no longer has a session you can ask about. Ask in the main conversation.” | Adds the available alternative. | |
| +| `api.not_mergeable` | “This task cannot be merged now. Check its latest status.” | unchanged | Clear and actionable. | |
| +| `api.not_retryable` | “This work cannot be retried now. Check its latest status.” | unchanged | Clear and actionable. | |
| +| `api.question_ended` | “This question has ended. Check its answer in the task.” | “This question has ended. Check the result in the task.” | The question may have failed or been cancelled, so it may not have an answer. | |
| +| `api.runner_offline` | “Your runner is offline. Reconnect it, then try again.” | unchanged | Clear and actionable. | |
| +| `api.task_busy` | “This task is still working. Wait for it to finish, then try again.” | unchanged | Clear and actionable. | |
| +| `api.task_ended` | “This task has ended. Check its result.” | unchanged | Clear and actionable. | |
| +| `api.task_merging` | “This task is merging. Wait for it to finish.” | unchanged | Clear and actionable. | |
| +| `api.turn_ended` | “Your coordinator has finished this reply.” | “This reply has ended.” | Applies to finished, failed, and cancelled replies. | |
| + |
| +Flagged rows: |
| + |
| +- `api.hold_bar`: “unknown spend” is unclear to people. I changed it to “unconfirmed spend.” |
| +- `api.idempotency_conflict`: “This request changed” is ambiguous because either the request or the underlying item may have changed. |
| +- `api.question_ended`: “Check its answer” is not always accurate because the question may have failed or been cancelled. |
| +- `api.turn_ended`: “finished” can imply success, but the reply may have failed or been cancelled. |
| + |
| +Counts: 17 rows reviewed, 7 changed, 10 unchanged, 4 flagged. |
diff --git a/native/PROJECTS-REPORT.md b/native/PROJECTS-REPORT.md| new file mode 100644 |
| index 00000000..9fa95e2c |
| --- /dev/null |
| +++ b/native/PROJECTS-REPORT.md |
| @@ -0,0 +1,342 @@ |
| +# Native Projects, 2026-11-23 |
| + |
| +Branch: native/projects, based on main 198ce406. Implements G11 of the approved |
| +GitHub connector spec using the existing device Projects API. Owner editing |
| +uses the engine project page's revision-bearing web form, as approved by the |
| +controller for this round. |
| + |
| +## What a person sees |
| + |
| +- iPhone: Projects is a fourth tab. Your projects retain server order, with a |
| + star button, title, repository source and wrapping description. Tapping a row |
| + pushes its details. Available to add appears only with the owner capability. |
| +- Mac: Projects is a sidebar item. The list stays in the middle and the chosen |
| + project's details appear beside it; tasks open in the existing inspector. |
| +- Both show Amadan's reported connection state. Details show team names and |
| + your personal names, each with Remove this name. Owners have Edit project, |
| + which opens the web page containing the current revision's form. |
| +- New request opens Conversation with a removable project chip. Removing the |
| + chip leaves an ordinary message; sending includes project_id in the retained |
| + retry body. A refused send remains visible with Retry. Known server errors show their copy; an ordinary offline or unrecognised failure uses the existing send status. A project 404 clears the project and Retry sends a new operation without project_id. Released selections show the server's coordinator notice |
| + while the actual reply keeps streaming in a separate stable row. |
| +- Named placement cards show a checked Remember control and editable name. |
| + Answers explicitly send the edited name or the empty string when unchecked. |
| + Choose another project keeps the card open at its new revision and shows a |
| + text field. A 422 stays inline and leaves that card open. |
| + |
| +## State and validation |
| + |
| +ProjectCatalog preserves server ordering, corrects optimistic stars with the |
| +server response and applies viewer fields by event sequence even when shared |
| +revisions are equal. A generation protects reads overtaken by writes/events; |
| +reconnect snapshots carry viewer fields too. Catalog flows retain the signed-in |
| +session lifetime. The native feed now reads reply_id so an intermediate project |
| +notice neither suppresses deltas nor shares the completed reply's identity. |
| +The Mac retains a placement card's hosting view and remeasures only that row. |
| + |
| +Four new API response fixtures (catalog, card, typed answer and invalid-input |
| +error) are checked against OpenAPI. ScriptedTransport covers routes, bodies, |
| +bearers, optimistic state, corrections, personal names, lifecycle, event order, |
| +write/read races, project request retries, explicit opt-out, typed-card revision |
| +changes and inline refusals. The existing streaming test now sets the actual |
| +server reply_id when completing its synthetic turn. |
| + |
| +Validation completed: |
| + |
| +- native/scripts/check-native.sh: passed. 184 tests in 21 suites; one existing |
| + known Oficina renewal issue, permissionRefusalDuringHomeOutageKeepsTheKitSession. |
| + Mac and unsigned iOS Simulator builds passed. Strings, parity, fixtures, |
| + sign-in checks and the reference scan passed. Existing Markdown comparison: |
| + 3,586 goldens plus 32,000 seeded inputs, zero mismatches. |
| +- Go: internal/equipo tests, TestPlan3ReleaseBoundaries, TestNativeFixtures, |
| + vet, staticcheck v0.7.0, fmt-check and go mod tidy -diff passed. |
| +- A wider internal/plan3test run failed TestCoordinatorAcceptance3B/onboarding_to_plan |
| + with provider_uncertain. The same isolated test fails on unchanged main |
| + 198ce406 in the release checkout, recorded in go-onboarding-main.log. |
| +- Host layout checks cover 390 and 760 point widths and accessibility3 type. |
| + The narrow standard-type capture shows the full project summary, removable |
| + chip, wrapping question, checked remember control, editable name and typed |
| + answer field. These are shared SwiftUI host captures, not physical-device |
| + screenshots. Local captures are in ignored native/build/project-screenshots. |
| + |
| +Tests were written first. Initial failures and subsequent mutation logs are |
| +under ignored native/build/logs. Every mutation below failed its targeted |
| +regression and was restored before the gate: |
| + |
| +- owner-capability |
| +- server-order |
| +- viewer-sequence |
| +- stale-list |
| +- optimistic-star |
| +- star-rollback |
| +- personal-name-delete |
| +- departed-read |
| +- message-project: serializer omission only; this did not exercise the task-thread guard or composer chip clearing. |
| +- explicit-opt-out: serializer omission of an empty name only; this did not exercise the checkbox action. |
| +- card-revision |
| +- server-inline-notice |
| +- notice-keeps-stream |
| +- notice-row-identity |
| +- mac-card-host |
| +- snapshot-viewer-fields |
| +- snapshot-write-generation |
| +- project-event-decoding |
| +- owner-web-form |
| +- API copy omission |
| +- New HTTP error without copy |
| + |
| +## Copy |
| + |
| +Twenty genuinely new canonical strings have Luna's delegated review: the two |
| +Projects controls below and 18 API errors. The API copy repair is kept in its |
| +own commit; native/API-COPY-REVIEW.md contains the exact briefs and verdicts. |
| +provider_error was a tool-result code, not an HTTP copy key, and was excluded |
| +by correcting scan scope rather than adding an omission exception. |
| + |
| +All newly imported native entries (web %s becomes Swift %@ with parity checking): |
| + |
| +- `api.card_answered`: This card has already been answered. Check the conversation for what happened. |
| +- `api.card_stale`: This item has changed. Check it before trying again. |
| +- `api.confirmation_required`: Confirm the spending limit and check both budget amounts before continuing. |
| +- `api.coordinator_busy`: Your coordinator is working. Wait for its reply, then try again. |
| +- `api.hold_bar`: This work is on hold because of a spending limit or unconfirmed spend. Check the hold, then raise the limit or check provider spend before resuming. |
| +- `api.idempotency_conflict`: The latest details are different. Refresh, check them, then try again. |
| +- `api.invalid_input`: Check the request fields and try again. |
| +- `api.models_not_allowed`: Choose at least one model that this connection can use. |
| +- `api.not_active`: This specialist is no longer active. No action is needed. |
| +- `api.not_askable`: This work no longer has a session you can ask about. Ask in the main conversation. |
| +- `api.not_found`: This item is not available. |
| +- `api.not_mergeable`: This task cannot be merged now. Check its latest status. |
| +- `api.not_retryable`: This work cannot be retried now. Check its latest status. |
| +- `api.question_ended`: This question has ended. Check the result in the task. |
| +- `api.repo_not_allowed`: Your runner can't reach this project's repository. Make sure the repository is available, then try again. |
| +- `api.runner_offline`: Your runner is offline. Reconnect it, then try again. |
| +- `api.task_busy`: This task is still working. Wait for it to finish, then try again. |
| +- `api.task_ended`: This task has ended. Check its result. |
| +- `api.task_merging`: This task is merging. Wait for it to finish. |
| +- `api.turn_ended`: This reply has ended. |
| +- `chat.card.answer`: Answer |
| +- `chat.connections.connected`: %@ connected |
| +- `counts.unavailable`: Unavailable |
| +- `nav.projects`: Projects |
| +- `projects.add_reachable`: Add project |
| +- `projects.can_add`: Available to add |
| +- `projects.description`: Description |
| +- `projects.details`: Project details |
| +- `projects.edit`: Edit project |
| +- `projects.empty`: No projects yet. |
| +- `projects.forget_name`: Remove this name |
| +- `projects.name_question`: Which project should this go in? Type the project name or repository. |
| +- `projects.name_to_remember`: Name to remember |
| +- `projects.names`: Names people use |
| +- `projects.new_request`: New request |
| +- `projects.other`: Choose another project |
| +- `projects.personal_names`: Your names for this project |
| +- `projects.remember_name`: Remember '%@' for this project |
| +- `projects.remove_selection`: Remove project |
| +- `projects.selection_lost`: The selected project is no longer available. This request will continue without a project. |
| +- `projects.title`: Title |
| +- `projects.yours`: Your projects |
| +- `work.star.add`: Star %@ |
| +- `work.star.remove`: Unstar %@ |
| + |
| +## Luna brief for Projects controls |
| + |
| +# Copy review brief: Equipo native Projects, new strings (2026-11-23) |
| + |
| +Paul delegates copy review to you; your edits will be applied as approved copy. |
| +Context: Equipo's iPhone and Mac apps get a Projects screen (code repositories). |
| +From a project you can start a request; the message composer then shows a small |
| +removable "chip" naming the project, so the request goes to that project. |
| + |
| +## Strings (ids fixed, text yours) |
| +- `projects.new_request`: button on a project, opens the composer with that project selected. Draft: `New request` |
| +- `projects.remove_selection`: accessibility label of the small x on the project chip in the composer, removing the project from this message. Draft: `Remove project selection` |
| + |
| +## House rules (Paul's, binding) |
| +No em dashes, no exclamation marks. Plain words, short, sentence case. Say what |
| +it does. Don't change facts; flag what looks wrong. |
| + |
| +## Output |
| +1. Table: `id | current | new (or "unchanged") | why`. |
| +2. Flagged rows: `id | problem`. |
| +3. Counts. |
| + |
| +## Luna result for Projects controls |
| + |
| +| id | current | new | why | |
| +|---|---|---|---| |
| +| `projects.new_request` | New request | unchanged | Short, clear button label | |
| +| `projects.remove_selection` | Remove project selection | Remove project | More direct and matches the action | |
| + |
| +Flagged rows: |
| + |
| +| id | problem | |
| +|---|---| |
| +| `projects.remove_selection` | “Selection” is abstract. The action removes the project from the message, not just a selection state. | |
| + |
| +Counts: 2 reviewed, 1 changed, 1 unchanged, 1 flagged. |
| + |
| +## CI size accounting |
| + |
| +CI at 0277df46 caught the existing exact size exemptions: canonical copy grew |
| +by 20 source lines (18 reviewed API errors and two Projects labels), and the |
| +review acceptance lists grew by two test lines. Updated only those measured |
| +limits to 22,074 and 11,896, with specific reasons in .rastrillo/budgets.txt. |
| +Copy must remain in copy.go under the repository contract. No test or behavior |
| +was removed. The original limits fail the size gate; the measured limits pass |
| +make budget and TestBudgetRecordsAreShort. All native code is unchanged from |
| +the passing native gate. |
| + |
| + |
| +## Review fixes after e7419bf8 |
| + |
| +No strings were added or changed in this follow-up. The separate API copy |
| +commit contains **18** strings, not 19; the two Projects controls make 20 new |
| +canonical strings across the original branch. |
| + |
| +- **Question routing:** the server now exposes its existing `placementData.ByName` |
| + marker as optional `placement_by_name`. An opted-out typed card can have no |
| + `remember_name`, so that suggestion alone cannot identify it. SwiftUI uses |
| + the marker for the field label. Ordinary questions use Answer and remain on |
| + the Mac AppKit card, now with an Answer field and button. |
| +- **Send failure notices:** only a known server copy key produces an extra |
| + notice. Offline and unrecognised 500 errors retain the existing waiting or |
| + failed send status, with and without a project. |
| +- **Actual actions:** both composers use the tested selection-consuming action; |
| + the phone closure and Mac onSend are checked. Question controls use the tested |
| + per-card answer draft, which sends an explicit empty name when unticked. |
| + The session's task-thread guard is tested at the transport request. |
| +- **Removed projects:** a dropped list item or removal event clears the composer |
| + chip with the accepted selection-lost notice. A definitive 404 clears the |
| + outgoing project's association; Retry creates a fresh idempotency key and |
| + omits project_id. A 422 retains its original project and retry body. |
| +- **Star refusal:** rollback restores only that project's star field, even if |
| + another project or metadata event arrived during the write. New names and |
| + revisions survive the rollback. |
| +- **Card revisions:** edits and the remember choice belong to the card identity |
| + in the session. The Mac host uses the card ID, not its revision, as identity. |
| +- **List/event ordering:** the server reads a new required list cursor in the |
| + same transaction as the project items. Native rejects events and snapshots |
| + older than that watermark, including events for absent projects. Wire, |
| + OpenAPI, documentation and fixtures describe the additive fields. |
| +- **Copy guard:** AST traversal covers all internal packages, including wiring. |
| + go/types resolves lexical bindings; assignments and concatenations are |
| + followed to WriteError and error-body CopyKey fields. Unknown dynamic values |
| + fail the guard. Tests cover variable codes, wiring, literal and variable |
| + CopyKey bodies, aliases, branches, and the unrelated tool-result false positive. |
| +- **Mac composer:** the chip is hosted above the composer and reserves zero |
| + height when absent. Selection changes are explicit representable inputs. |
| +- **Roster styling:** project actions use RosterButton. The remember checkbox |
| + and typed fields use Roster controls, system text sizes and the existing |
| + palette. No system prominent button or rounded-border field remains there. |
| + |
| +Review regressions were added before implementation. New API seams initially |
| +failed compilation; the extra variable-CopyKey test failed with a missed key. |
| +All deliberately broken guards below failed their targeted tests and were |
| +restored. Commands: `swift test --package-path native/apple --filter <test>` |
| +and `GOTOOLCHAIN=go1.26.11 CGO_ENABLED=0 go test <package> -run <test> -count=1`. |
| +The scripts and complete failure logs are under ignored native/build/logs: |
| + |
| +- question-marker; phone-question-label; mac-question-routing |
| +- send-fallback (offline, 500, known key, each with/without a project) |
| +- actual-opt-out; composer-clear-both (both platform tests fail); task-thread-project |
| +- selection-removal (list and event); gone-project-retry |
| +- star-intervening-event (same and different project); revision-resets-draft |
| +- list-watermark (older viewer event, snapshot and absent-project replay) |
| +- chip-placement; roster-control |
| +- copy-variable; copy-wiring; copy-literal; copy-variable-body; server-marker; server-cursor |
| + |
| +The earlier mutation names above have been corrected: those two initial tests |
| +covered serializers. They did not prove that a control passed the right value. |
| + |
| +The interface remains the existing Projects tab on iPhone and sidebar item on |
| +Mac. At phone width, the project title, description, remember label and fields |
| +wrap with Dynamic Type. On Mac the project chip is immediately above the input; |
| +ordinary Answer cards use AppKit and placement cards retain their SwiftUI host. |
| +No physical-device screenshot is claimed. |
| + |
| + |
| +Follow-up validation: native/scripts/check-native.sh passed with 194 tests in |
| +22 suites and the same known Oficina renewal issue. Mac and unsigned iOS |
| +Simulator builds passed; 217 strings and 72 parity entries are unchanged. |
| +All 20 review mutations were caught (14 Swift, six Go), including both actual |
| +composer paths. Go package tests for equipo, chat, personapi and wire, the |
| +person API/device contracts, release boundaries and native fixtures passed. |
| +Vet, staticcheck v0.7.0, fmt-check, module tidiness and size budgets passed. |
| +The typed marker and list cursor add five chat source lines and two wire source |
| +lines; their 51-line server regression is accounted for in measured budgets. |
| +The 390-point normal-size SwiftUI host capture was inspected. Accessibility |
| +sizes were checked for layout; those hidden-host images did not render reliably. |
| + |
| +## Main merge and final P3 follow-up |
| + |
| +Merged origin/main a697cde9 into native/projects after Fable approved a37ce08a. |
| +The three conflicted files were resolved as follows: |
| + |
| +- `.rastrillo/budgets.txt`: combined the native Projects/API copy and new |
| + Engineering stop-reason additions. Combined measured caps are 22101 source |
| + lines for equipo, 6828 for wire, and 11898 test lines for plan3test. |
| +- `docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md`: retained both appended |
| + acceptance inventories, including all native/API strings and main's two |
| + Engineering stop-reason strings, with their existing review markers. |
| +- `internal/plan3test/plan3_release_test.go`: retained the native/API acceptance |
| + predicates and main's approvedStopReasons predicate in the release guard. |
| + |
| +The merge's copy-release regression and size gate pass. Main's stop-reason |
| +implementation, tests and CI lane changes were retained by the automatic merge. |
| + |
| +P3 selection notice: the next composer send consumes the selection and its |
| +notice together, including an ordinary send that goes offline. The regression |
| +`nextComposerSendClearsReleasedSelectionNotice` failed before the fix, passed |
| +after it, and failed again when notice clearing was deliberately removed. |
| +Both existing platform composer tests also pass. |
| + |
| +P3 404 scope: only a decoded Equipo not_found/api.not_found 404 for a |
| +conversation body with a nonempty project_id releases the project. Native |
| +conversation sends reference no other resource; task-thread sends are excluded. |
| +A seven-case regression covers genuine project loss, other codes, foreign copy |
| +keys, plain HTTP 404s, another status, no project, and task threads. It failed |
| +first, passed after the fix, and caught separate code and copy-key mutations. |
| +Unrelated failures retain the original retry body and key. |
| + |
| +P3 ordinary Mac question: QuestionAnswerField stores every text edit in the |
| +card's existing draft. Return and the Answer button share its submit action. |
| +The regression types through the actual field delegate, changes the transcript |
| +width to replace the row, checks the restored text, and sends Return through |
| +the replacement field's delegate. It verifies the answer text and revision on |
| +the transport. The initial implementation failed all four boundaries; live |
| +edit and Return mutations each fail after the fix. |
| + |
| +P3 raw-map copy guard: the scan now recognises a copy_key field in a raw map, |
| +including a constant map key and a variable copy value. Dynamic values fail |
| +closed instead of escaping review. Three missing-key cases and a dynamic-value |
| +case failed first and pass now. Disabling raw-map recognition makes all four |
| +regressions fail. The existing variable, wiring, typed-body and tool-result |
| +scope regressions remain green. |
| + |
| +P3 checkbox accessibility: the custom visual control now supplies an explicit |
| +native Toggle accessibility representation, bound to the same value, without |
| +the selected-button trait. A shared-source guard failed before the change and |
| +passes afterward; substituting a Button representation makes it fail again. |
| +The Mac runtime regression checks checkbox role, accepted label, checked value, |
| +activation and unchecked value. Mac already inherited checkbox semantics from |
| +the outer Toggle before this change, so that runtime test was green initially; |
| +the source guard pins the explicit representation used on both platforms. |
| +No new copy was introduced. |
| + |
| +Validation for the five final P3s: |
| + |
| +- `swift test --package-path native/apple --filter ProjectsAccessibilityTests` |
| + and the targeted notice, 404, Mac draft and API-copy tests pass. Seven |
| + deliberate mutations were caught: notice clear, 404 code, 404 copy key, |
| + live Mac edit, Return submit, raw-map recognition and toggle representation. |
| +- `native/scripts/check-native.sh` passes: 199 tests in 24 suites, the existing |
| + known Oficina renewal issue, both app builds, 11 API fixtures, 3,586 Markdown |
| + goldens, 32,000 differential inputs, 217 strings and 72 parity entries. |
| +- Pinned Go 1.26.11 with CGO disabled: equipo, chat, personapi and wire tests, |
| + the API/release contracts and merged runner stop-reason regressions pass. |
| + Formatting, size budgets, Linux-target vet, scoped staticcheck v0.7.0, |
| + lane coverage and the copy-release gate pass. |
| +- The unrestricted Mac Go invocation cannot build headless: toolproxy uses |
| + Linux's unix.O_PATH. Linux-target vet passes; Linux CI is the headless gate. |
diff --git a/native/apple/Sources/EquipoActivity/Resources/Localizable.xcstrings b/native/apple/Sources/EquipoActivity/Resources/Localizable.xcstrings| index 15fb2b7d..eead16e0 100644 |
| --- a/native/apple/Sources/EquipoActivity/Resources/Localizable.xcstrings |
| +++ b/native/apple/Sources/EquipoActivity/Resources/Localizable.xcstrings |
| @@ -134,6 +134,226 @@ |
| } |
| } |
| }, |
| + "api.card_answered": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "This card has already been answered. Check the conversation for what happened." |
| + } |
| + } |
| + } |
| + }, |
| + "api.card_stale": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "This item has changed. Check it before trying again." |
| + } |
| + } |
| + } |
| + }, |
| + "api.confirmation_required": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Confirm the spending limit and check both budget amounts before continuing." |
| + } |
| + } |
| + } |
| + }, |
| + "api.coordinator_busy": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Your coordinator is working. Wait for its reply, then try again." |
| + } |
| + } |
| + } |
| + }, |
| + "api.hold_bar": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "This work is on hold because of a spending limit or unconfirmed spend. Check the hold, then raise the limit or check provider spend before resuming." |
| + } |
| + } |
| + } |
| + }, |
| + "api.idempotency_conflict": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "The latest details are different. Refresh, check them, then try again." |
| + } |
| + } |
| + } |
| + }, |
| + "api.invalid_input": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Check the request fields and try again." |
| + } |
| + } |
| + } |
| + }, |
| + "api.models_not_allowed": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Choose at least one model that this connection can use." |
| + } |
| + } |
| + } |
| + }, |
| + "api.not_active": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "This specialist is no longer active. No action is needed." |
| + } |
| + } |
| + } |
| + }, |
| + "api.not_askable": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "This work no longer has a session you can ask about. Ask in the main conversation." |
| + } |
| + } |
| + } |
| + }, |
| + "api.not_found": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "This item is not available." |
| + } |
| + } |
| + } |
| + }, |
| + "api.not_mergeable": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "This task cannot be merged now. Check its latest status." |
| + } |
| + } |
| + } |
| + }, |
| + "api.not_retryable": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "This work cannot be retried now. Check its latest status." |
| + } |
| + } |
| + } |
| + }, |
| + "api.question_ended": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "This question has ended. Check the result in the task." |
| + } |
| + } |
| + } |
| + }, |
| + "api.repo_not_allowed": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Your runner can't reach this project's repository. Make sure the repository is available, then try again." |
| + } |
| + } |
| + } |
| + }, |
| + "api.runner_offline": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Your runner is offline. Reconnect it, then try again." |
| + } |
| + } |
| + } |
| + }, |
| + "api.task_busy": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "This task is still working. Wait for it to finish, then try again." |
| + } |
| + } |
| + } |
| + }, |
| + "api.task_ended": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "This task has ended. Check its result." |
| + } |
| + } |
| + } |
| + }, |
| + "api.task_merging": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "This task is merging. Wait for it to finish." |
| + } |
| + } |
| + } |
| + }, |
| + "api.turn_ended": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "This reply has ended." |
| + } |
| + } |
| + } |
| + }, |
| "app.name": { |
| "extractionState": "manual", |
| "localizations": { |
| @@ -222,6 +442,17 @@ |
| } |
| } |
| }, |
| + "chat.card.answer": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Answer" |
| + } |
| + } |
| + } |
| + }, |
| "chat.card.merge": { |
| "extractionState": "manual", |
| "localizations": { |
| @@ -387,6 +618,17 @@ |
| } |
| } |
| }, |
| + "chat.connections.connected": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "%@ connected" |
| + } |
| + } |
| + } |
| + }, |
| "chat.paste.command": { |
| "extractionState": "manual", |
| "localizations": { |
| @@ -596,6 +838,17 @@ |
| } |
| } |
| }, |
| + "counts.unavailable": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Unavailable" |
| + } |
| + } |
| + } |
| + }, |
| "decision.on_web": { |
| "extractionState": "manual", |
| "localizations": { |
| @@ -706,6 +959,17 @@ |
| } |
| } |
| }, |
| + "nav.projects": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Projects" |
| + } |
| + } |
| + } |
| + }, |
| "needs.count %lld": { |
| "extractionState": "manual", |
| "localizations": { |
| @@ -1080,6 +1344,204 @@ |
| } |
| } |
| }, |
| + "projects.add_reachable": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Add project" |
| + } |
| + } |
| + } |
| + }, |
| + "projects.can_add": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Available to add" |
| + } |
| + } |
| + } |
| + }, |
| + "projects.description": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Description" |
| + } |
| + } |
| + } |
| + }, |
| + "projects.details": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Project details" |
| + } |
| + } |
| + } |
| + }, |
| + "projects.edit": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Edit project" |
| + } |
| + } |
| + } |
| + }, |
| + "projects.empty": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "No projects yet." |
| + } |
| + } |
| + } |
| + }, |
| + "projects.forget_name": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Remove this name" |
| + } |
| + } |
| + } |
| + }, |
| + "projects.name_question": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Which project should this go in? Type the project name or repository." |
| + } |
| + } |
| + } |
| + }, |
| + "projects.name_to_remember": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Name to remember" |
| + } |
| + } |
| + } |
| + }, |
| + "projects.names": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Names people use" |
| + } |
| + } |
| + } |
| + }, |
| + "projects.new_request": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "New request" |
| + } |
| + } |
| + } |
| + }, |
| + "projects.other": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Choose another project" |
| + } |
| + } |
| + } |
| + }, |
| + "projects.personal_names": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Your names for this project" |
| + } |
| + } |
| + } |
| + }, |
| + "projects.remember_name": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Remember '%@' for this project" |
| + } |
| + } |
| + } |
| + }, |
| + "projects.remove_selection": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Remove project" |
| + } |
| + } |
| + } |
| + }, |
| + "projects.selection_lost": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "The selected project is no longer available. This request will continue without a project." |
| + } |
| + } |
| + } |
| + }, |
| + "projects.title": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Title" |
| + } |
| + } |
| + } |
| + }, |
| + "projects.yours": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Your projects" |
| + } |
| + } |
| + } |
| + }, |
| "question.answered %@": { |
| "extractionState": "manual", |
| "localizations": { |
| @@ -1894,6 +2356,28 @@ |
| } |
| } |
| }, |
| + "work.star.add": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Star %@" |
| + } |
| + } |
| + } |
| + }, |
| + "work.star.remove": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Unstar %@" |
| + } |
| + } |
| + } |
| + }, |
| "work.tl.merge_dropped": { |
| "extractionState": "manual", |
| "localizations": { |
diff --git a/native/apple/Sources/EquipoKit/API/Client.swift b/native/apple/Sources/EquipoKit/API/Client.swift| index 827cda86..49d0ec0b 100644 |
| --- a/native/apple/Sources/EquipoKit/API/Client.swift |
| +++ b/native/apple/Sources/EquipoKit/API/Client.swift |
| @@ -35,7 +35,7 @@ public struct EquipoClient: Sendable { |
| public func tasks() async throws -> ThinList<ThinTask> { try await get("/tasks") } |
| public func needsYou() async throws -> ThinList<ThinTask> { try await get("/needs-you") } |
| public func task(_ id: String) async throws -> ThinTask { try await get("/tasks/\(escape(id))") } |
| - public func projects() async throws -> ThinList<ThinProject> { try await get("/projects") } |
| + public func projects() async throws -> ProjectList { try await get("/projects") } |
| public func devices() async throws -> Page<Device> { try await get("/auth/devices") } |
| /// The conversation's events after `cursor`, as Server-Sent Event lines. |
| @@ -46,9 +46,11 @@ public struct EquipoClient: Sendable { |
| // MARK: Writes. Each takes a PendingWrite so a retry is the same request. |
| /// A message; the engine takes its key in the body as well as the header. |
| - public static func message(_ text: String) throws -> PendingWrite { |
| + public static func message(_ text: String, projectID: String? = nil) throws -> PendingWrite { |
| let key = UUID().uuidString.lowercased() |
| - return PendingWrite(body: try EquipoJSON.encoder.encode(["text": text, "idempotency_key": key]), key: key) |
| + var body = ["text": text, "idempotency_key": key] |
| + if let projectID { body["project_id"] = projectID } |
| + return PendingWrite(body: try EquipoJSON.encoder.encode(body), key: key) |
| } |
| public func send(_ write: PendingWrite) async throws -> Sent { try await post("/messages", write) } |
| public func postThread(task taskID: String, _ write: PendingWrite) async throws -> ThreadEntry { |
| @@ -56,9 +58,10 @@ public struct EquipoClient: Sendable { |
| } |
| /// An answer to a card, bound to the card revision the person saw. |
| - public static func answer(_ choice: String, note: String? = nil, to card: ThinCard) throws -> PendingWrite { |
| + public static func answer(_ choice: String, note: String? = nil, rememberName: String? = nil, to card: ThinCard) throws -> PendingWrite { |
| var body: [String: AnyEncodable] = ["choice": .init(choice), "revision": .init(card.revision)] |
| if let note, !note.isEmpty { body["note"] = .init(note) } |
| + if let rememberName { body["remember_name"] = .init(rememberName) } |
| return PendingWrite(body: try EquipoJSON.encoder.encode(body), ifMatch: card.revision) |
| } |
| public func answer(card id: String, _ write: PendingWrite) async throws -> Answered { |
diff --git a/native/apple/Sources/EquipoKit/API/Projects.swift b/native/apple/Sources/EquipoKit/API/Projects.swift| new file mode 100644 |
| index 00000000..c2cd040f |
| --- /dev/null |
| +++ b/native/apple/Sources/EquipoKit/API/Projects.swift |
| @@ -0,0 +1,44 @@ |
| +import Foundation |
| + |
| +public struct ProjectList: Codable, Sendable { |
| + public var cursor: Int64? = nil |
| + public var items: [ThinProject]? |
| + public var connections: [ProjectConnection]? |
| + public var canAdd: [ReachableProject]? |
| + public var allowed: [String]? |
| + public var home: String? |
| +} |
| + |
| +public struct ProjectConnection: Codable, Sendable, Identifiable, Equatable { |
| + public var id: String |
| + public var forge: String |
| + public var title: String |
| + public var state: String |
| + public var canAdd: Bool |
| +} |
| + |
| +public struct ReachableProject: Codable, Sendable, Identifiable, Equatable { |
| + public var repo: String |
| + public var name: String |
| + public var title: String |
| + public var description: String |
| + public var descriptionSource: String |
| + public var forge: String |
| + public var connectionId: String |
| + public var id: String { repo } |
| +} |
| + |
| +extension EquipoClient { |
| + public func setStar(_ id: String, _ starred: Bool) async throws -> ThinProject { |
| + try await send(APIRequest("PUT", projectPath(id) + "/star", body: try EquipoJSON.encoder.encode(["starred": starred]), bearer: token)) |
| + } |
| + public func addProject(_ repo: String) async throws -> ThinProject { |
| + try await send(APIRequest("POST", "/projects", body: try EquipoJSON.encoder.encode(["repo": repo]), bearer: token)) |
| + } |
| + public func forgetName(_ name: String, projectID: String) async throws { |
| + let _: EmptyResponse = try await send(APIRequest("DELETE", projectPath(projectID) + "/names", body: try EquipoJSON.encoder.encode(["name": name]), bearer: token)) |
| + } |
| + private func projectPath(_ id: String) -> String { |
| + "/projects/" + (id.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed.subtracting(CharacterSet(charactersIn: "/?#"))) ?? "") |
| + } |
| +} |
diff --git a/native/apple/Sources/EquipoKit/API/Thin.swift b/native/apple/Sources/EquipoKit/API/Thin.swift| index 581adfa5..0a3a3559 100644 |
| --- a/native/apple/Sources/EquipoKit/API/Thin.swift |
| +++ b/native/apple/Sources/EquipoKit/API/Thin.swift |
| @@ -16,6 +16,7 @@ public struct ThinMe: Codable, Sendable, Equatable { |
| } |
| public struct ThinMessage: Codable, Sendable, Identifiable, Equatable { |
| + public var projectId: String? = nil |
| public var id: String |
| public var revision: Int64 |
| public var role: String |
| @@ -26,6 +27,7 @@ public struct ThinMessage: Codable, Sendable, Identifiable, Equatable { |
| } |
| public struct ThinTurn: Codable, Sendable, Identifiable, Equatable { |
| + public var replyId: String? = nil |
| public var attempt: Int64? = nil |
| public var id: String |
| public var revision: Int64 |
| @@ -39,6 +41,10 @@ public struct ThinTurn: Codable, Sendable, Identifiable, Equatable { |
| } |
| public struct ThinCard: Codable, Sendable, Identifiable, Equatable { |
| + public var rememberName: String? = nil |
| + public var placementByName: Bool? = nil |
| + public var isTypedProjectChoice: Bool { placementByName == true } |
| + public var answerFieldKey: String { isTypedProjectChoice ? "projects.other" : "chat.card.answer" } |
| public var id: String |
| public var revision: Int64 |
| public var kind: String |
| @@ -112,6 +118,14 @@ public struct ThinTask: Codable, Sendable, Identifiable, Equatable { |
| } |
| public struct ThinProject: Codable, Sendable, Identifiable, Equatable { |
| + public var description: String? = nil |
| + public var starred: Bool? = nil |
| + public var names: [String]? = nil |
| + public var personalNames: [String]? = nil |
| + public var titleSource: String? = nil |
| + public var descriptionSource: String? = nil |
| + public var forge: String? = nil |
| + public var connectionId: String? = nil |
| public var id: String |
| public var revision: Int64 |
| public var repo: String |
diff --git a/native/apple/Sources/EquipoKit/Presentation/Roster.swift b/native/apple/Sources/EquipoKit/Presentation/Roster.swift| index 9e969c80..1c9b3141 100644 |
| --- a/native/apple/Sources/EquipoKit/Presentation/Roster.swift |
| +++ b/native/apple/Sources/EquipoKit/Presentation/Roster.swift |
| @@ -111,13 +111,14 @@ public enum FeedItem: Identifiable, Sendable, Equatable { |
| case draft(ThinTurn, text: String) |
| public var reply: TranscriptReply? { |
| switch self { |
| - case .coordinator(let message): return TranscriptReply(text: message.text, date: message.createdAt, draft: false) |
| + case .coordinator(let message), .notice(let message): return TranscriptReply(text: message.text, date: message.createdAt, draft: false) |
| case .draft(let turn, let text): return TranscriptReply(text: text, date: turn.createdAt, draft: true) |
| default: return nil |
| } |
| } |
| case own(ThinMessage) |
| case coordinator(ThinMessage) |
| + case notice(ThinMessage) |
| case outgoing(EquipoSession.Outgoing) |
| /// A task the conversation reports on; compact while its decision is open. |
| case report(ThinCard, RosterByline, TaskReport, compact: Bool) |
| @@ -132,7 +133,7 @@ public enum FeedItem: Identifiable, Sendable, Equatable { |
| public var id: String { |
| switch self { |
| - case .own(let m): return m.id |
| + case .own(let m), .notice(let m): return m.id |
| case .coordinator(let m): return m.turnId.isEmpty ? m.id : "reply-" + m.turnId |
| case .draft(let t, _): return "reply-" + t.id |
| case .outgoing(let o): return "outgoing-" + o.id |
| @@ -149,7 +150,11 @@ public enum Feed { |
| 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))) |
| + let item: FeedItem |
| + if m.isOwn { item = .own(m) } |
| + else if let turn = session.turns.first(where: { $0.id == m.turnId }), let replyID = turn.replyId, replyID != m.id { item = .notice(m) } |
| + else { item = .coordinator(m) } |
| + timed.append((m.createdAt, i, item)) |
| } |
| for (i, card) in session.cards.enumerated() { |
| let project = session.project(card.projectId)?.displayName |
diff --git a/native/apple/Sources/EquipoKit/Projects/ProjectCatalog.swift b/native/apple/Sources/EquipoKit/Projects/ProjectCatalog.swift| new file mode 100644 |
| index 00000000..b683be5f |
| --- /dev/null |
| +++ b/native/apple/Sources/EquipoKit/Projects/ProjectCatalog.swift |
| @@ -0,0 +1,165 @@ |
| +import Foundation |
| +import Observation |
| + |
| +/// The list's order belongs to the server. Viewer fields have an event |
| +/// sequence of their own: shared revisions alone cannot order personal names. |
| +@MainActor @Observable public final class ProjectCatalog { |
| + public private(set) var projects: [String: ThinProject] = [:] |
| + private var order: [String] = [] |
| + public private(set) var connections: [ProjectConnection] = [] |
| + private var reachable: [ReachableProject] = [] |
| + public private(set) var loaded = false |
| + public private(set) var notice: String? |
| + public private(set) var pending: Set<String> = [] |
| + public var selection: ThinProject? { didSet { if selection != nil { selectionNotice = nil } } } |
| + public private(set) var selectionNotice: String? |
| + private var listSequence: Int64 = -1 |
| + var client: EquipoClient |
| + let lifetime: SignInLifetime |
| + private var sequence: [String: Int64] = [:] |
| + private var generation = 0 |
| + var snapshotGeneration: Int { generation } |
| + private var reading = false |
| + private var readAgain = false |
| + |
| + init(client: EquipoClient, lifetime: SignInLifetime) { self.client = client; self.lifetime = lifetime } |
| + /// The engine's owner form is on the project page, with its current revision. |
| + public func detailsURL(_ project: ThinProject) -> URL { |
| + client.origin.appendingPathComponent("projects").appendingPathComponent(project.id) |
| + } |
| + public var items: [ThinProject] { order.compactMap { projects[$0] }.filter { $0.state == "active" } } |
| + public var available: [ReachableProject] { |
| + reachable.filter { repo in connections.contains { $0.id == repo.connectionId && $0.canAdd } } |
| + } |
| + |
| + /// The next composer send consumes both its project and any released-selection notice. |
| + func takeSelection() -> String? { |
| + let id = selection?.id |
| + selection = nil |
| + selectionNotice = nil |
| + return id |
| + } |
| + |
| + public func refresh() async { |
| + guard lifetime.isActive else { return } |
| + if reading { readAgain = true; return } |
| + reading = true |
| + defer { reading = false } |
| + repeat { |
| + readAgain = false |
| + let started = generation |
| + do { |
| + let list = try await client.projects() |
| + guard lifetime.isActive else { return } |
| + // A write or streamed viewer update overtook this read. Read |
| + // again; do not restore a personal name or an old star meanwhile. |
| + guard started == generation else { readAgain = true; continue } |
| + let values = list.items ?? [] |
| + listSequence = max(listSequence, list.cursor ?? -1) |
| + order = values.map(\.id) |
| + for p in values where p.revision >= (projects[p.id]?.revision ?? -1) { projects[p.id] = p } |
| + let ids = Set(order) |
| + projects = projects.filter { ids.contains($0.key) } |
| + connections = list.connections ?? []; reachable = list.canAdd ?? [] |
| + loaded = true; notice = nil |
| + reconcileSelection() |
| + } catch { |
| + guard lifetime.isActive else { return } |
| + notice = ProjectNotice.text(error) |
| + } |
| + } while readAgain && lifetime.isActive && !Task.isCancelled |
| + } |
| + |
| + func applySnapshot(_ values: [ThinProject], cursor: Int64, generation expected: Int? = nil) { |
| + guard lifetime.isActive, cursor >= listSequence, expected == nil || expected == generation else { return } |
| + for p in values where cursor >= (sequence[p.id] ?? -1) && p.revision >= (projects[p.id]?.revision ?? -1) { |
| + projects[p.id] = p |
| + sequence[p.id] = cursor |
| + } |
| + generation += 1 |
| + } |
| + func applyEvent(_ project: ThinProject, cursor: Int64) { |
| + guard lifetime.isActive, cursor > max(listSequence, sequence[project.id] ?? -1), |
| + project.revision >= (projects[project.id]?.revision ?? -1) else { return } |
| + sequence[project.id] = cursor |
| + generation += 1 |
| + projects[project.id] = project |
| + reconcileSelection() |
| + } |
| + |
| + private func reconcileSelection() { |
| + guard let selected = selection else { return } |
| + if projects[selected.id]?.state != "active" { releaseSelection(selected.id) } |
| + } |
| + func releaseSelection(_ id: String) { |
| + if selection?.id == id { selection = nil } |
| + selectionNotice = EquipoStrings.text("projects.selection_lost") |
| + } |
| + |
| + public func setStar(_ project: ThinProject, _ starred: Bool) async { |
| + guard lifetime.isActive, pending.insert(project.id).inserted else { return } |
| + generation += 1 |
| + let started = generation |
| + let old = projects[project.id] |
| + projects[project.id]?.starred = starred |
| + defer { pending.remove(project.id) } |
| + do { |
| + let answer = try await client.setStar(project.id, starred) |
| + guard lifetime.isActive else { return } |
| + if started == generation { projects[project.id] = answer } |
| + generation += 1 |
| + notice = nil |
| + // Restore the server's ordering after the optimistic toggle. |
| + await refresh() |
| + } catch { |
| + guard lifetime.isActive else { return } |
| + projects[project.id]?.starred = old?.starred |
| + notice = ProjectNotice.text(error) |
| + } |
| + } |
| + public func forgetName(_ name: String, in project: ThinProject) async { |
| + guard lifetime.isActive, pending.insert(project.id).inserted else { return } |
| + generation += 1 |
| + let started = generation |
| + defer { pending.remove(project.id) } |
| + do { |
| + try await client.forgetName(name, projectID: project.id) |
| + guard lifetime.isActive else { return } |
| + if started == generation { |
| + let remaining = (projects[project.id]?.personalNames ?? []).filter { $0.caseInsensitiveCompare(name) != .orderedSame } |
| + projects[project.id]?.personalNames = remaining |
| + } |
| + generation += 1 |
| + notice = nil |
| + } catch { if lifetime.isActive { notice = ProjectNotice.text(error) } } |
| + } |
| + public func add(_ repo: ReachableProject) async { |
| + guard lifetime.isActive, available.contains(repo), pending.insert(repo.id).inserted else { return } |
| + generation += 1 |
| + defer { pending.remove(repo.id) } |
| + do { |
| + _ = try await client.addProject(repo.repo) |
| + guard lifetime.isActive else { return } |
| + await refresh() |
| + } catch { if lifetime.isActive { notice = ProjectNotice.text(error) } } |
| + } |
| +} |
| + |
| +/// Error copy keys are data, never arbitrary format strings. Resolve only |
| +/// catalog entries we know; otherwise retain the existing native failure copy. |
| +public enum ProjectNotice { |
| + public static func text(_ error: Error) -> String { |
| + knownText(error) ?? EquipoStrings.text(error as? EquipoAPIError == .offline ? "card.offline" : "card.failed") |
| + } |
| + public static func knownText(_ error: Error) -> String? { |
| + if case EquipoAPIError.server(_, let body) = error, |
| + ["api.not_found", "api.invalid_input", "api.repo_not_allowed", "api.forbidden", "api.idempotency_conflict", |
| + "api.card_answered", "api.card_stale", "api.confirmation_required", "api.coordinator_busy", "api.hold_bar", |
| + "api.models_not_allowed", "api.not_active", "api.not_askable", "api.not_mergeable", "api.not_retryable", |
| + "api.question_ended", "api.runner_offline", "api.task_busy", "api.task_ended", "api.task_merging", "api.turn_ended"].contains(body.copyKey) { |
| + let text = EquipoStrings.text(String.LocalizationValue(body.copyKey)) |
| + if text != body.copyKey { return text } |
| + } |
| + return nil |
| + } |
| +} |
diff --git a/native/apple/Sources/EquipoKit/Projects/QuestionAnswerDraft.swift b/native/apple/Sources/EquipoKit/Projects/QuestionAnswerDraft.swift| new file mode 100644 |
| index 00000000..e32275df |
| --- /dev/null |
| +++ b/native/apple/Sources/EquipoKit/Projects/QuestionAnswerDraft.swift |
| @@ -0,0 +1,13 @@ |
| +import Foundation |
| +import Observation |
| + |
| +/// The person's edits belong to a card, including when its revision changes. |
| +@MainActor @Observable public final class QuestionAnswerDraft { |
| + public var name: String |
| + public var remembers = true |
| + public var typedChoice = "" |
| + init(card: ThinCard) { name = card.rememberName ?? "" } |
| + public func submit(_ choice: String, card: ThinCard, session: EquipoSession) async -> EquipoSession.AnswerOutcome { |
| + await session.answer(card, choice: choice, rememberName: card.rememberName == nil ? nil : (remembers ? name : "")) |
| + } |
| +} |
diff --git a/native/apple/Sources/EquipoKit/Push/PushRoute.swift b/native/apple/Sources/EquipoKit/Push/PushRoute.swift| index a077cd56..892abc5e 100644 |
| --- a/native/apple/Sources/EquipoKit/Push/PushRoute.swift |
| +++ b/native/apple/Sources/EquipoKit/Push/PushRoute.swift |
| @@ -46,7 +46,7 @@ public enum PushRoute: Equatable, Sendable { |
| /// 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 enum Pane: Hashable, Sendable { case conversation, needs, tasks, projects } |
| public var pane: Pane |
| public var cardID: String? |
| public var taskID: String? |
diff --git a/native/apple/Sources/EquipoKit/Resources/Localizable.xcstrings b/native/apple/Sources/EquipoKit/Resources/Localizable.xcstrings| index 15fb2b7d..eead16e0 100644 |
| --- a/native/apple/Sources/EquipoKit/Resources/Localizable.xcstrings |
| +++ b/native/apple/Sources/EquipoKit/Resources/Localizable.xcstrings |
| @@ -134,6 +134,226 @@ |
| } |
| } |
| }, |
| + "api.card_answered": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "This card has already been answered. Check the conversation for what happened." |
| + } |
| + } |
| + } |
| + }, |
| + "api.card_stale": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "This item has changed. Check it before trying again." |
| + } |
| + } |
| + } |
| + }, |
| + "api.confirmation_required": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Confirm the spending limit and check both budget amounts before continuing." |
| + } |
| + } |
| + } |
| + }, |
| + "api.coordinator_busy": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Your coordinator is working. Wait for its reply, then try again." |
| + } |
| + } |
| + } |
| + }, |
| + "api.hold_bar": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "This work is on hold because of a spending limit or unconfirmed spend. Check the hold, then raise the limit or check provider spend before resuming." |
| + } |
| + } |
| + } |
| + }, |
| + "api.idempotency_conflict": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "The latest details are different. Refresh, check them, then try again." |
| + } |
| + } |
| + } |
| + }, |
| + "api.invalid_input": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Check the request fields and try again." |
| + } |
| + } |
| + } |
| + }, |
| + "api.models_not_allowed": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Choose at least one model that this connection can use." |
| + } |
| + } |
| + } |
| + }, |
| + "api.not_active": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "This specialist is no longer active. No action is needed." |
| + } |
| + } |
| + } |
| + }, |
| + "api.not_askable": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "This work no longer has a session you can ask about. Ask in the main conversation." |
| + } |
| + } |
| + } |
| + }, |
| + "api.not_found": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "This item is not available." |
| + } |
| + } |
| + } |
| + }, |
| + "api.not_mergeable": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "This task cannot be merged now. Check its latest status." |
| + } |
| + } |
| + } |
| + }, |
| + "api.not_retryable": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "This work cannot be retried now. Check its latest status." |
| + } |
| + } |
| + } |
| + }, |
| + "api.question_ended": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "This question has ended. Check the result in the task." |
| + } |
| + } |
| + } |
| + }, |
| + "api.repo_not_allowed": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Your runner can't reach this project's repository. Make sure the repository is available, then try again." |
| + } |
| + } |
| + } |
| + }, |
| + "api.runner_offline": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Your runner is offline. Reconnect it, then try again." |
| + } |
| + } |
| + } |
| + }, |
| + "api.task_busy": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "This task is still working. Wait for it to finish, then try again." |
| + } |
| + } |
| + } |
| + }, |
| + "api.task_ended": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "This task has ended. Check its result." |
| + } |
| + } |
| + } |
| + }, |
| + "api.task_merging": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "This task is merging. Wait for it to finish." |
| + } |
| + } |
| + } |
| + }, |
| + "api.turn_ended": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "This reply has ended." |
| + } |
| + } |
| + } |
| + }, |
| "app.name": { |
| "extractionState": "manual", |
| "localizations": { |
| @@ -222,6 +442,17 @@ |
| } |
| } |
| }, |
| + "chat.card.answer": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Answer" |
| + } |
| + } |
| + } |
| + }, |
| "chat.card.merge": { |
| "extractionState": "manual", |
| "localizations": { |
| @@ -387,6 +618,17 @@ |
| } |
| } |
| }, |
| + "chat.connections.connected": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "%@ connected" |
| + } |
| + } |
| + } |
| + }, |
| "chat.paste.command": { |
| "extractionState": "manual", |
| "localizations": { |
| @@ -596,6 +838,17 @@ |
| } |
| } |
| }, |
| + "counts.unavailable": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Unavailable" |
| + } |
| + } |
| + } |
| + }, |
| "decision.on_web": { |
| "extractionState": "manual", |
| "localizations": { |
| @@ -706,6 +959,17 @@ |
| } |
| } |
| }, |
| + "nav.projects": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Projects" |
| + } |
| + } |
| + } |
| + }, |
| "needs.count %lld": { |
| "extractionState": "manual", |
| "localizations": { |
| @@ -1080,6 +1344,204 @@ |
| } |
| } |
| }, |
| + "projects.add_reachable": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Add project" |
| + } |
| + } |
| + } |
| + }, |
| + "projects.can_add": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Available to add" |
| + } |
| + } |
| + } |
| + }, |
| + "projects.description": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Description" |
| + } |
| + } |
| + } |
| + }, |
| + "projects.details": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Project details" |
| + } |
| + } |
| + } |
| + }, |
| + "projects.edit": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Edit project" |
| + } |
| + } |
| + } |
| + }, |
| + "projects.empty": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "No projects yet." |
| + } |
| + } |
| + } |
| + }, |
| + "projects.forget_name": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Remove this name" |
| + } |
| + } |
| + } |
| + }, |
| + "projects.name_question": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Which project should this go in? Type the project name or repository." |
| + } |
| + } |
| + } |
| + }, |
| + "projects.name_to_remember": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Name to remember" |
| + } |
| + } |
| + } |
| + }, |
| + "projects.names": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Names people use" |
| + } |
| + } |
| + } |
| + }, |
| + "projects.new_request": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "New request" |
| + } |
| + } |
| + } |
| + }, |
| + "projects.other": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Choose another project" |
| + } |
| + } |
| + } |
| + }, |
| + "projects.personal_names": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Your names for this project" |
| + } |
| + } |
| + } |
| + }, |
| + "projects.remember_name": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Remember '%@' for this project" |
| + } |
| + } |
| + } |
| + }, |
| + "projects.remove_selection": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Remove project" |
| + } |
| + } |
| + } |
| + }, |
| + "projects.selection_lost": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "The selected project is no longer available. This request will continue without a project." |
| + } |
| + } |
| + } |
| + }, |
| + "projects.title": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Title" |
| + } |
| + } |
| + } |
| + }, |
| + "projects.yours": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Your projects" |
| + } |
| + } |
| + } |
| + }, |
| "question.answered %@": { |
| "extractionState": "manual", |
| "localizations": { |
| @@ -1894,6 +2356,28 @@ |
| } |
| } |
| }, |
| + "work.star.add": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Star %@" |
| + } |
| + } |
| + } |
| + }, |
| + "work.star.remove": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Unstar %@" |
| + } |
| + } |
| + } |
| + }, |
| "work.tl.merge_dropped": { |
| "extractionState": "manual", |
| "localizations": { |
diff --git a/native/apple/Sources/EquipoKit/Session/EquipoSession.swift b/native/apple/Sources/EquipoKit/Session/EquipoSession.swift| index 6c0413ca..10411967 100644 |
| --- a/native/apple/Sources/EquipoKit/Session/EquipoSession.swift |
| +++ b/native/apple/Sources/EquipoKit/Session/EquipoSession.swift |
| @@ -18,14 +18,23 @@ public final class EquipoSession { |
| public let id: String |
| public let text: String |
| public let taskID: String? |
| + public var notice: String? = nil |
| + public var projectName: String? = nil |
| public var state: State |
| - let write: PendingWrite |
| + var write: PendingWrite |
| + var goneProject = false |
| } |
| /// A departing session can never become current again, even if a read |
| /// or credential renewal ignores cancellation and completes later. |
| public let lifetime: SignInLifetime |
| public let markdown = MarkdownTranscript() |
| + private var questionDrafts: [String: QuestionAnswerDraft] = [:] |
| + public func questionDraft(for card: ThinCard) -> QuestionAnswerDraft { |
| + if let draft = questionDrafts[card.id] { return draft } |
| + let draft = QuestionAnswerDraft(card: card); questionDrafts[card.id] = draft |
| + return draft |
| + } |
| var isInvalidated: Bool { !lifetime.isActive } |
| public private(set) var status: Status = .loading |
| public private(set) var account: DeviceAccount |
| @@ -37,7 +46,9 @@ public final class EquipoSession { |
| public private(set) var tasks: [ThinTask] = [] |
| /// nil until loaded: an unknown count is not zero. |
| public private(set) var needsYou: [ThinTask]? |
| - public private(set) var projects: [String: ThinProject] = [:] |
| + public let projectCatalog: ProjectCatalog |
| + public var projects: [String: ThinProject] { projectCatalog.projects } |
| + public private(set) var answerNotices: [String: String] = [:] |
| /// The latest activity of each live turn, from the event stream. |
| public private(set) var activity: [String: ThinActivity] = [:] |
| public private(set) var outgoing: [Outgoing] = [] |
| @@ -71,7 +82,9 @@ public final class EquipoSession { |
| self.lifetime = lifetime |
| let transport = transport ?? URLSessionTransport(origin: account.origin) |
| self.revocationTransport = transport |
| - self.client = EquipoClient(transport: LifetimeTransport(inner: transport, lifetime: lifetime), token: account.credential?.token) |
| + let client = EquipoClient(transport: LifetimeTransport(inner: transport, lifetime: lifetime), token: account.credential?.token) |
| + self.client = client |
| + projectCatalog = ProjectCatalog(client: client, lifetime: lifetime) |
| if !account.isUsable() { status = .signedOut } |
| } |
| @@ -96,13 +109,14 @@ public final class EquipoSession { |
| private func refreshPass() async { |
| guard !isInvalidated else { return } |
| let client = self.client |
| + let projectGeneration = projectCatalog.snapshotGeneration |
| do { |
| async let snapshotRead = client.snapshot() |
| async let taskRead = client.tasks() |
| async let needsRead = client.needsYou() |
| let (snapshot, taskList, needsList) = try await (snapshotRead, taskRead, needsRead) |
| guard !isInvalidated else { return } |
| - apply(snapshot) |
| + apply(snapshot, projectGeneration: projectGeneration) |
| tasks = taskList.items ?? [] |
| needsYou = needsList.items ?? [] |
| status = .ready |
| @@ -123,18 +137,18 @@ public final class EquipoSession { |
| } |
| } |
| - func apply(_ snapshot: Snapshot) { |
| + func apply(_ snapshot: Snapshot, projectGeneration: Int? = nil) { |
| guard !isInvalidated else { return } |
| me = snapshot.me |
| messages = Self.merge(messages, snapshot.messages ?? []) |
| turns = Self.merge(turns, snapshot.turns ?? []) |
| cards = Self.merge(cards, snapshot.cards ?? []) |
| - projects = Dictionary((snapshot.projects ?? []).map { ($0.id, $0) }, uniquingKeysWith: { a, _ in a }) |
| + projectCatalog.applySnapshot(snapshot.projects ?? [], cursor: snapshot.cursor, generation: projectGeneration) |
| cursor = max(cursor, snapshot.cursor) |
| let liveIDs = Set(turns.filter(\.isLive).map(\.id)) |
| activity = activity.filter { liveIDs.contains($0.key) } |
| stopping.formIntersection(liveIDs) |
| - let replied = Set(messages.filter { !$0.isOwn }.map(\.turnId)) |
| + let replied = Set(messages.filter { isFinalReply($0) }.map(\.turnId)) |
| drafts = drafts.filter { id, draft in |
| guard !replied.contains(id) else { return false } |
| // A read already in flight can predate the first delta. Keep it |
| @@ -149,6 +163,12 @@ public final class EquipoSession { |
| } |
| } |
| + private func isFinalReply(_ message: ThinMessage) -> Bool { |
| + guard !message.isOwn else { return false } |
| + guard let replyID = turns.first(where: { $0.id == message.turnId })?.replyId else { return true } |
| + return replyID == message.id |
| + } |
| + |
| /// Reconciles by ID; the newer revision wins. |
| static func merge<T: Identifiable & Sendable>(_ old: [T], _ new: [T]) -> [T] where T.ID == String, T: Revisioned { |
| var byID = Dictionary(old.map { ($0.id, $0) }, uniquingKeysWith: { a, _ in a }) |
| @@ -196,6 +216,11 @@ public final class EquipoSession { |
| let json = Data(line.dropFirst(5).trimmingCharacters(in: .whitespaces).utf8) |
| guard let event = try? EquipoJSON.decoder.decode(EventEnvelope.self, from: json) else { return } |
| if let c = event.cursor { cursor = max(cursor, c) } |
| + if event.resource == "project", let project = event.project, let sequence = event.cursor { |
| + projectCatalog.applyEvent(project, cursor: sequence) |
| + Task { await projectCatalog.refresh() } |
| + return |
| + } |
| if event.type == "activity" { |
| if event.resource == "turn", let data = event.activity { activity[data.turnId] = data } |
| return |
| @@ -204,7 +229,7 @@ public final class EquipoSession { |
| if event.type == "delta" { |
| guard event.resource == "turn", let delta = event.delta, let attempt = event.attempt, |
| attempt > 0, delta.offset >= 0, !delta.text.isEmpty, |
| - !messages.contains(where: { !$0.isOwn && $0.turnId == delta.turnId }) else { return } |
| + !messages.contains(where: { isFinalReply($0) && $0.turnId == delta.turnId }) else { return } |
| if let turn = turns.first(where: { $0.id == delta.turnId }), |
| !turn.isLive || attempt < (turn.attempt ?? 0) { return } |
| let old = drafts[delta.turnId] |
| @@ -250,6 +275,7 @@ public final class EquipoSession { |
| var type: String |
| var resource: String |
| var activity: ThinActivity? |
| + var project: ThinProject? |
| var attempt: Int64? |
| var delta: ReplyDelta? |
| struct ReplyDelta: Decodable { var turnId: String; var offset: Int; var text: String } |
| @@ -260,6 +286,7 @@ public final class EquipoSession { |
| type = try c.decode(String.self, forKey: .type) |
| resource = try c.decodeIfPresent(String.self, forKey: .resource) ?? "" |
| attempt = try c.decodeIfPresent(Int64.self, forKey: .attempt) |
| + project = resource == "project" ? try? c.decode(ThinProject.self, forKey: .data) : nil |
| delta = type == "delta" && resource == "turn" ? try? c.decode(ReplyDelta.self, forKey: .data) : nil |
| activity = type == "activity" && resource == "turn" ? try? c.decode(ThinActivity.self, forKey: .data) : nil |
| } |
| @@ -276,15 +303,27 @@ public final class EquipoSession { |
| // MARK: Sending |
| - public func send(_ text: String, inThreadOf taskID: String? = nil) async { |
| + public func sendFromComposer(_ text: String) -> Task<Void, Never> { |
| + let projectID = projectCatalog.takeSelection() |
| + return Task { await send(text, projectID: projectID) } |
| + } |
| + |
| + public func send(_ text: String, inThreadOf taskID: String? = nil, projectID: String? = nil) async { |
| let text = text.trimmingCharacters(in: .whitespacesAndNewlines) |
| - guard lifetime.isActive, !text.isEmpty, let write = try? EquipoClient.message(text) else { return } |
| - outgoing.append(Outgoing(id: write.key, text: text, taskID: taskID, state: .sending, write: write)) |
| + guard lifetime.isActive, !text.isEmpty, let write = try? EquipoClient.message(text, projectID: taskID == nil ? projectID : nil) else { return } |
| + outgoing.append(Outgoing(id: write.key, text: text, taskID: taskID, projectName: taskID == nil ? projectID.flatMap { projects[$0]?.displayName } : nil, state: .sending, write: write)) |
| await deliver(write.key) |
| } |
| /// Sends one outgoing message again, as itself. |
| - public func retry(_ id: String) async { await deliver(id) } |
| + public func retry(_ id: String) async { |
| + if let i = outgoing.firstIndex(where: { $0.id == id }), outgoing[i].goneProject { |
| + // A definitive 404 rejected this send. A changed body is a new operation. |
| + guard let write = try? EquipoClient.message(outgoing[i].text) else { return } |
| + outgoing[i].write = write; outgoing[i].projectName = nil; outgoing[i].goneProject = false |
| + } |
| + await deliver(id) |
| + } |
| private func deliver(_ id: String) async { |
| guard lifetime.isActive, let index = outgoing.firstIndex(where: { $0.id == id }) else { return } |
| @@ -310,7 +349,21 @@ public final class EquipoSession { |
| } catch let error as EquipoAPIError { |
| guard lifetime.isActive else { return } |
| if error.endsSession { endSession(); return } |
| - if let i = outgoing.firstIndex(where: { $0.id == id }) { outgoing[i].state = error == .offline ? .waiting : .failed } |
| + if let i = outgoing.firstIndex(where: { $0.id == id }) { |
| + outgoing[i].state = error == .offline ? .waiting : .failed |
| + outgoing[i].notice = ProjectNotice.knownText(error) |
| + // This native conversation body references only one resource: its selected project. |
| + // A proxy 404, another API code, or a missing task is not evidence about that project. |
| + if case .server(404, let body) = error, body.code == "not_found", body.copyKey == "api.not_found", |
| + item.taskID == nil, |
| + let fields = try? JSONSerialization.jsonObject(with: item.write.body) as? [String: String], |
| + let project = fields["project_id"], !project.isEmpty { |
| + outgoing[i].goneProject = true |
| + outgoing[i].projectName = nil |
| + outgoing[i].notice = EquipoStrings.text("projects.selection_lost") |
| + projectCatalog.releaseSelection(project) |
| + } |
| + } |
| } catch { |
| guard lifetime.isActive else { return } |
| // Cancelled on the way: it may yet be sent, as itself. |
| @@ -330,11 +383,12 @@ public final class EquipoSession { |
| /// Answers a card as the person saw it, bound to that revision. A lost |
| /// answer is retried as itself; a stale one is never sent again. |
| - public func answer(_ card: ThinCard, choice: String, note: String? = nil) async -> AnswerOutcome { |
| + public func answer(_ card: ThinCard, choice: String, note: String? = nil, rememberName: String? = nil) async -> AnswerOutcome { |
| guard lifetime.isActive else { return .failed } |
| guard card.isOpen else { return .changed } |
| - let slot = "\(card.id)#\(card.revision)#\(choice)#\(note ?? "")" |
| - guard let write = unsettledAnswers[slot] ?? (try? EquipoClient.answer(choice, note: note, to: card)) else { return .failed } |
| + let slot = "\(card.id)#\(card.revision)#\(choice)#\(note ?? "")#\(rememberName ?? "")" |
| + answerNotices[card.id] = nil |
| + guard let write = unsettledAnswers[slot] ?? (try? EquipoClient.answer(choice, note: note, rememberName: rememberName, to: card)) else { return .failed } |
| unsettledAnswers[slot] = write |
| var attempts = 0 |
| while true { |
| @@ -354,6 +408,7 @@ public final class EquipoSession { |
| 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 } |
| + answerNotices[card.id] = ProjectNotice.text(error) |
| return error == .offline ? .offline : .failed |
| } catch { unsettledAnswers[slot] = nil; return .failed } |
| } |
| @@ -386,6 +441,7 @@ public final class EquipoSession { |
| 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 } |
| + answerNotices[card.id] = ProjectNotice.text(error) |
| return error == .offline ? .offline : .failed |
| } catch { unsettledVisibility[slot] = nil; return .failed } |
| } |
| @@ -411,6 +467,7 @@ public final class EquipoSession { |
| self.account = account |
| revocationTransport = transport |
| client = EquipoClient(transport: LifetimeTransport(inner: transport, lifetime: lifetime), token: account.credential?.token) |
| + projectCatalog.client = client |
| if status == .signedOut { status = .loading } |
| } |
diff --git a/native/apple/Sources/EquipoKit/UI/LiveCards.swift b/native/apple/Sources/EquipoKit/UI/LiveCards.swift| index 2cf8efae..8e88acb4 100644 |
| --- a/native/apple/Sources/EquipoKit/UI/LiveCards.swift |
| +++ b/native/apple/Sources/EquipoKit/UI/LiveCards.swift |
| @@ -4,15 +4,21 @@ import SwiftUI |
| /// the revision the person saw. A card that changed underneath is shown as |
| /// it is now and never answered on the person's behalf. Words of their own |
| /// go in the composer, as a message. |
| -struct LiveQuestionCard: View { |
| +public struct LiveQuestionCard: View { |
| let card: ThinCard |
| let taskTitle: String? |
| let session: EquipoSession |
| @State private var phase: Phase = .open |
| + @Bindable private var draft: QuestionAnswerDraft |
| + |
| + public init(card: ThinCard, taskTitle: String?, session: EquipoSession) { |
| + self.card = card; self.taskTitle = taskTitle; self.session = session |
| + draft = session.questionDraft(for: card) |
| + } |
| enum Phase: Equatable { case open, sending(String), settingAside, changed(at: Int64), offline, failed } |
| - var body: some View { |
| + public var body: some View { |
| if card.isAside { |
| AsideStub(card: card, title: Feed.asideTitle(card, task: session.task(card.taskId)), session: session) |
| } else { |
| @@ -28,6 +34,11 @@ struct LiveQuestionCard: View { |
| CardHead(text: card.question.isEmpty ? String(localized: "card.question", bundle: .module) : card.question, |
| aside: aside, settingAside: phase == .settingAside) |
| if card.isOpen { |
| + if card.rememberName != nil { |
| + RosterCheck(title: String(format: EquipoStrings.text("projects.remember_name"), draft.name), isOn: $draft.remembers).disabled(isSending) |
| + RosterField(title: EquipoStrings.text("projects.name_to_remember"), text: $draft.name) |
| + .disabled(!draft.remembers || isSending) |
| + } |
| choices |
| feedback |
| } else if !card.choice.isEmpty { |
| @@ -51,7 +62,13 @@ struct LiveQuestionCard: View { |
| @ViewBuilder private var choices: some View { |
| let options = card.options ?? [] |
| - if !options.isEmpty { |
| + if options.isEmpty { |
| + RosterField(title: EquipoStrings.text(String.LocalizationValue(card.answerFieldKey)), text: $draft.typedChoice).onSubmit { Task { await submit(draft.typedChoice) } } |
| + .disabled(isSending) |
| + RosterButton(title: EquipoStrings.text("chat.card.answer"), primary: true, expanded: false) { |
| + Task { await submit(draft.typedChoice) } |
| + }.disabled(isSending || draft.typedChoice.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty) |
| + } else { |
| ViewThatFits(in: .horizontal) { |
| HStack(spacing: 10) { optionButtons(options) } |
| VStack(spacing: 10) { optionButtons(options) } |
| @@ -72,14 +89,15 @@ struct LiveQuestionCard: View { |
| 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) |
| + case .failed: Text(session.answerNotices[card.id] ?? String(localized: "card.failed", bundle: .module)).font(Typo.secondary).foregroundStyle(Palette.negative) |
| default: EmptyView() |
| } |
| } |
| private func submit(_ choice: String) async { |
| + guard !isSending, !choice.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty else { return } |
| phase = .sending(choice) |
| - switch await session.answer(card, choice: choice) { |
| + switch await draft.submit(choice, card: card, session: session) { |
| case .answered: phase = .open |
| case .changed: phase = .changed(at: session.cards.first { $0.id == card.id }?.revision ?? card.revision) |
| case .offline: phase = .offline |
diff --git a/native/apple/Sources/EquipoKit/UI/RosterViews.swift b/native/apple/Sources/EquipoKit/UI/RosterViews.swift| index 43c7b66b..f8b2a553 100644 |
| --- a/native/apple/Sources/EquipoKit/UI/RosterViews.swift |
| +++ b/native/apple/Sources/EquipoKit/UI/RosterViews.swift |
| @@ -603,3 +603,42 @@ struct FlowLayout: Layout { |
| } |
| } |
| + |
| +/// Roster's input surface, with a persistent accessible name. |
| +struct RosterField: View { |
| + let title: String |
| + @Binding var text: String |
| + var body: some View { |
| + TextField("", text: $text, prompt: Text(title).foregroundStyle(Palette.placeholder)) |
| + .textFieldStyle(.plain).font(Typo.body).foregroundStyle(Palette.controlText) |
| + .padding(12).frame(minHeight: 44) |
| + .background(Palette.surface2, in: RoundedRectangle(cornerRadius: 10)) |
| + .overlay(RoundedRectangle(cornerRadius: 10).stroke(Palette.border, lineWidth: 1)) |
| + .accessibilityLabel(title) |
| + } |
| +} |
| + |
| +struct RosterCheck: View { |
| + let title: String |
| + @Binding var isOn: Bool |
| + var body: some View { |
| + Toggle(isOn: $isOn) { Text(title).font(Typo.secondary).foregroundStyle(Palette.text) } |
| + .toggleStyle(RosterCheckStyle()) |
| + } |
| +} |
| + |
| +private struct RosterCheckStyle: ToggleStyle { |
| + func makeBody(configuration: Configuration) -> some View { |
| + Button { configuration.isOn.toggle() } label: { |
| + HStack(alignment: .firstTextBaseline, spacing: 10) { |
| + Image(systemName: configuration.isOn ? "checkmark.square.fill" : "square") |
| + .foregroundStyle(configuration.isOn ? Palette.accent : Palette.secondary) |
| + configuration.label |
| + }.frame(minHeight: 44, alignment: .leading).contentShape(Rectangle()) |
| + }.buttonStyle(.plain) |
| + .accessibilityRepresentation { |
| + Toggle(isOn: configuration.$isOn) { configuration.label } |
| + .toggleStyle(.automatic) |
| + } |
| + } |
| +} |
diff --git a/native/apple/Sources/EquipoKit/UI/Screens/ConversationScreen.swift b/native/apple/Sources/EquipoKit/UI/Screens/ConversationScreen.swift| index 81ca60a3..a3a87311 100644 |
| --- a/native/apple/Sources/EquipoKit/UI/Screens/ConversationScreen.swift |
| +++ b/native/apple/Sources/EquipoKit/UI/Screens/ConversationScreen.swift |
| @@ -41,12 +41,17 @@ public struct ConversationScreen: View { |
| .background(Palette.background) |
| .safeAreaInset(edge: .top, spacing: 0) { NativeOfflineBanner(origin: session.origin) } |
| .safeAreaInset(edge: .bottom, spacing: 0) { |
| - Composer(placeholder: String(localized: "conversation.placeholder", bundle: .module)) { text in |
| - Task { await session.send(text) } |
| + VStack(spacing: 0) { |
| + ProjectSelectionChip(catalog: session.projectCatalog) |
| + Composer(placeholder: String(localized: "conversation.placeholder", bundle: .module)) { text in |
| + _ = sendFromComposer(text) |
| + } |
| } |
| } |
| } |
| + func sendFromComposer(_ text: String) -> Task<Void, Never> { session.sendFromComposer(text) } |
| + |
| /// 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 } |
| @@ -69,7 +74,7 @@ public struct ConversationScreen: View { |
| CoordinatorMessage(reply: reply, messageID: item.id, origin: session.origin, transcript: session.markdown, openTask: openTask) |
| } else { |
| switch item { |
| - case .draft, .coordinator: EmptyView() |
| + case .draft, .coordinator, .notice: EmptyView() |
| case .own(let m): OwnMessage(text: m.text) |
| case .outgoing(let o): OutgoingMessage(item: o) { Task { await session.retry(o.id) } } |
| case .report(_, let byline, let report, let compact): |
| @@ -102,7 +107,9 @@ struct OutgoingMessage: View { |
| var retry: () -> Void |
| var body: some View { |
| VStack(alignment: .trailing, spacing: 4) { |
| + if let project = item.projectName { ProjectChip(name: project) } |
| OwnMessage(text: item.text).opacity(item.state == .sending ? 0.7 : 1) |
| + if let notice = item.notice { Text(notice).font(Typo.secondary).foregroundStyle(Palette.negative) } |
| switch item.state { |
| case .sending: Text(String(localized: "message.sending", bundle: .module)).font(Typo.caption).foregroundStyle(Palette.faint) |
| case .waiting: |
diff --git a/native/apple/Sources/EquipoKit/UI/Screens/PhoneRoot.swift b/native/apple/Sources/EquipoKit/UI/Screens/PhoneRoot.swift| index 06a9919d..e15da3ad 100644 |
| --- a/native/apple/Sources/EquipoKit/UI/Screens/PhoneRoot.swift |
| +++ b/native/apple/Sources/EquipoKit/UI/Screens/PhoneRoot.swift |
| @@ -43,6 +43,8 @@ struct PhoneTabs: View { |
| @State private var conversationPath: [String] = [] |
| @State private var needsPath: [String] = [] |
| @State private var tasksPath: [String] = [] |
| + @State private var projectsPath: [ProjectRoute] = [] |
| + private enum ProjectRoute: Hashable { case project(String), task(String) } |
| @State private var focusCard: String? |
| @State private var showingAccount = false |
| @@ -59,6 +61,23 @@ struct PhoneTabs: View { |
| } |
| } |
| .badge(session.needsYou?.count ?? 0) |
| + Tab(String(localized: "nav.projects", bundle: .module), systemImage: "folder", value: .projects) { |
| + NavigationStack(path: $projectsPath) { |
| + ProjectsScreen(session: session) { projectsPath.append(.project($0)) } |
| + .navigationTitle(String(localized: "nav.projects", bundle: .module)) |
| + .navigationBarTitleDisplayMode(.inline) |
| + .navigationDestination(for: ProjectRoute.self) { route in |
| + switch route { |
| + case .project(let id): |
| + ProjectDetailScreen(session: session, projectID: id) { project in |
| + session.projectCatalog.selection = project |
| + conversationPath = []; tab = .conversation |
| + } openTask: { projectsPath.append(.task($0)) } |
| + case .task(let id): TaskScreen(session: session, taskID: id) |
| + } |
| + } |
| + } |
| + } |
| 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) } |
| @@ -82,6 +101,7 @@ struct PhoneTabs: View { |
| switch destination.pane { |
| case .conversation: conversationPath = []; focusCard = destination.cardID |
| case .needs: needsPath = [] |
| + case .projects: projectsPath = [] |
| case .tasks: tasksPath = destination.taskID.map { [$0] } ?? [] |
| } |
| } |
diff --git a/native/apple/Sources/EquipoKit/UI/Screens/ProjectsScreen.swift b/native/apple/Sources/EquipoKit/UI/Screens/ProjectsScreen.swift| new file mode 100644 |
| index 00000000..cb15e534 |
| --- /dev/null |
| +++ b/native/apple/Sources/EquipoKit/UI/Screens/ProjectsScreen.swift |
| @@ -0,0 +1,152 @@ |
| +import SwiftUI |
| + |
| +public struct ProjectsScreen: View { |
| + let session: EquipoSession |
| + @Environment(\.scenePhase) private var phase |
| + let openProject: (String) -> Void |
| + public init(session: EquipoSession, openProject: @escaping (String) -> Void) { |
| + self.session = session; self.openProject = openProject |
| + } |
| + public var body: some View { |
| + let catalog = session.projectCatalog |
| + List { |
| + ForEach(catalog.connections) { connection in |
| + HStack { |
| + Text(connection.title).font(Typo.secondaryStrong) |
| + Spacer() |
| + Text(connection.state == "connected" |
| + ? String(format: EquipoStrings.text("chat.connections.connected"), connection.title) |
| + : EquipoStrings.text("counts.unavailable")) |
| + .font(Typo.caption).foregroundStyle(Palette.secondary) |
| + } |
| + } |
| + if let notice = catalog.notice { |
| + Text(notice).font(Typo.secondary).foregroundStyle(Palette.negative) |
| + RosterButton(title: EquipoStrings.text("read.retry"), primary: false, expanded: false) { Task { await catalog.refresh() } } |
| + } |
| + Section(EquipoStrings.text("projects.yours")) { |
| + ForEach(catalog.items) { project in |
| + HStack(alignment: .top, spacing: 12) { |
| + Button { openProject(project.id) } label: { ProjectSummary(project: project) } |
| + .buttonStyle(.plain).frame(maxWidth: .infinity, alignment: .leading) |
| + ProjectStar(project: project, catalog: catalog) |
| + } |
| + } |
| + if catalog.loaded && catalog.items.isEmpty { Text(EquipoStrings.text("projects.empty")).foregroundStyle(Palette.secondary) } |
| + if !catalog.loaded && catalog.notice == nil { ProgressView() } |
| + } |
| + if !catalog.available.isEmpty { |
| + Section(EquipoStrings.text("projects.can_add")) { |
| + ForEach(catalog.available) { repo in |
| + VStack(alignment: .leading, spacing: 8) { |
| + Text(repo.title.isEmpty ? repo.name : repo.title).font(Typo.secondaryStrong) |
| + Text(repo.repo).font(Typo.caption).foregroundStyle(Palette.secondary) |
| + if !repo.description.isEmpty { Text(repo.description).font(Typo.secondary) } |
| + RosterButton(title: EquipoStrings.text("projects.add_reachable"), primary: true, expanded: false) { Task { await catalog.add(repo) } } |
| + .disabled(catalog.pending.contains(repo.id)) |
| + } |
| + } |
| + } |
| + } |
| + } |
| + .scrollContentBackground(.hidden).background(Palette.background) |
| + .task { await catalog.refresh() } |
| + .onChange(of: phase) { _, phase in if phase == .active { Task { await catalog.refresh() } } } |
| + .refreshable { await catalog.refresh() } |
| + } |
| +} |
| + |
| +struct ProjectSummary: View { |
| + let project: ThinProject |
| + var body: some View { |
| + VStack(alignment: .leading, spacing: 5) { |
| + Text(project.displayName).font(Typo.secondaryStrong).foregroundStyle(Palette.text) |
| + Text(project.repo).font(Typo.caption).foregroundStyle(Palette.secondary) |
| + if let description = project.description, !description.isEmpty { |
| + Text(description).font(Typo.secondary).foregroundStyle(Palette.secondary) |
| + } |
| + } |
| + .frame(maxWidth: .infinity, alignment: .leading).contentShape(Rectangle()) |
| + } |
| +} |
| + |
| +struct ProjectStar: View { |
| + let project: ThinProject |
| + let catalog: ProjectCatalog |
| + var body: some View { |
| + Button { Task { await catalog.setStar(project, project.starred != true) } } label: { |
| + Image(systemName: project.starred == true ? "star.fill" : "star") |
| + .foregroundStyle(project.starred == true ? Palette.accent : Palette.secondary) |
| + .frame(minWidth: 44, minHeight: 44) |
| + } |
| + .buttonStyle(.plain).disabled(catalog.pending.contains(project.id)) |
| + .accessibilityLabel(String(format: EquipoStrings.text(project.starred == true ? "work.star.remove" : "work.star.add"), project.displayName)) |
| + } |
| +} |
| + |
| +public struct ProjectDetailScreen: View { |
| + let session: EquipoSession |
| + let projectID: String |
| + let newRequest: (ThinProject) -> Void |
| + let openTask: (String) -> Void |
| + public init(session: EquipoSession, projectID: String, newRequest: @escaping (ThinProject) -> Void, openTask: @escaping (String) -> Void) { |
| + self.session = session; self.projectID = projectID; self.newRequest = newRequest; self.openTask = openTask |
| + } |
| + public var body: some View { |
| + let catalog = session.projectCatalog |
| + ScrollView { |
| + VStack(alignment: .leading, spacing: 20) { |
| + if let project = catalog.projects[projectID], project.state == "active" { |
| + HStack(alignment: .top) { ProjectSummary(project: project); ProjectStar(project: project, catalog: catalog) } |
| + RosterButton(title: EquipoStrings.text("projects.new_request"), primary: true, expanded: false) { newRequest(project) } |
| + if let notice = catalog.notice { Text(notice).foregroundStyle(Palette.negative) } |
| + if let names = project.names, !names.isEmpty { |
| + SectionTitle(text: EquipoStrings.text("projects.names")) |
| + ForEach(names, id: \.self) { Text($0).font(Typo.body) } |
| + } |
| + if let names = project.personalNames, !names.isEmpty { |
| + SectionTitle(text: EquipoStrings.text("projects.personal_names")) |
| + ForEach(names, id: \.self) { name in |
| + VStack(alignment: .leading, spacing: 4) { |
| + Text(name).font(Typo.body) |
| + RosterButton(title: EquipoStrings.text("projects.forget_name"), primary: false, expanded: false) { Task { await catalog.forgetName(name, in: project) } } |
| + .disabled(catalog.pending.contains(project.id)) |
| + .accessibilityValue(name) |
| + } |
| + } |
| + } |
| + if session.me?.role == "owner" { |
| + Link(EquipoStrings.text("projects.edit"), destination: catalog.detailsURL(project)) |
| + } |
| + ForEach(session.tasks.filter { $0.projectId == project.id }) { task in |
| + TaskRowButton(task: task, needsYou: session.waitsOnYou(task)) { openTask(task.id) } |
| + } |
| + } else { Text(EquipoStrings.text("api.not_found")).foregroundStyle(Palette.secondary) } |
| + } |
| + .padding(16).frame(maxWidth: 760, alignment: .leading).frame(maxWidth: .infinity) |
| + } |
| + .background(Palette.background) |
| + .refreshable { await catalog.refresh() } |
| + } |
| +} |
| + |
| +/// The selection belongs to the next composer message, and never to a task thread. |
| +public struct ProjectSelectionChip: View { |
| + let catalog: ProjectCatalog |
| + public init(catalog: ProjectCatalog) { self.catalog = catalog } |
| + public var body: some View { |
| + if let notice = catalog.selectionNotice { |
| + Text(notice).font(Typo.secondary).foregroundStyle(Palette.secondary).padding(.horizontal, 16) |
| + } |
| + if let project = catalog.selection { |
| + HStack(spacing: 8) { |
| + Image(systemName: "folder") |
| + Text(project.displayName).font(Typo.secondaryStrong) |
| + Button { catalog.selection = nil } label: { Image(systemName: "xmark").frame(minWidth: 44, minHeight: 44) } |
| + .buttonStyle(.plain).accessibilityLabel(EquipoStrings.text("projects.remove_selection")) |
| + } |
| + .padding(.leading, 12).background(Palette.surface2, in: Capsule()).padding(.horizontal, 16) |
| + .frame(maxWidth: .infinity, alignment: .leading) |
| + } |
| + } |
| +} |
diff --git a/native/apple/Sources/EquipoMac/LiveTranscript.swift b/native/apple/Sources/EquipoMac/LiveTranscript.swift| index 6f47c2ce..a228dbdb 100644 |
| --- a/native/apple/Sources/EquipoMac/LiveTranscript.swift |
| +++ b/native/apple/Sources/EquipoMac/LiveTranscript.swift |
| @@ -32,6 +32,10 @@ final class LiveTranscript: NSView { |
| let composer = MacComposer() |
| // Keep each reply's SwiftUI host across delta and completion rebuilds. |
| // In particular, closing a fence keeps its scroll position and Copy state. |
| + private var questionHosts: [String: NSHostingView<QuestionCardHost>] = [:] |
| + var hostedQuestionIDs: Set<String> { Set(questionHosts.keys) } |
| + private let selectionHost: NSHostingView<ProjectSelectionChip> |
| + var selectionFrame: NSRect { selectionHost.frame } |
| private var replyHosts: [String: NSHostingView<MarkdownReplyHost>] = [:] |
| private struct RowRevision: Equatable { |
| let item: FeedItem |
| @@ -56,6 +60,7 @@ final class LiveTranscript: NSView { |
| init(session: EquipoSession, openTask: @escaping (String) -> Void) { |
| self.session = session |
| + selectionHost = NSHostingView(rootView: ProjectSelectionChip(catalog: session.projectCatalog)) |
| self.openTask = openTask |
| super.init(frame: .zero) |
| scroll.documentView = document |
| @@ -64,11 +69,13 @@ final class LiveTranscript: NSView { |
| scroll.automaticallyAdjustsContentInsets = false |
| addSubview(scroll) |
| addSubview(composer) |
| + addSubview(selectionHost) |
| composer.onHeightChange = { [weak self] in self?.needsLayout = true } |
| composer.onSend = { [weak self] text in |
| guard let self else { return } |
| let session = self.session |
| - Task { await session.send(text) } |
| + _ = session.sendFromComposer(text) |
| + self.needsLayout = true |
| } |
| setAccessibilityLabel(EquipoStrings.text("tab.conversation")) |
| } |
| @@ -77,6 +84,7 @@ final class LiveTranscript: NSView { |
| func update(items: [FeedItem]) { |
| let wasAtBottom = isAtBottom |
| self.items = items |
| + needsLayout = true |
| session.markdown.retainMessages(Set(items.filter { $0.reply != nil }.map(\.id)), origin: session.origin) |
| rebuild() |
| if wasAtBottom || !hasScrolledOnce { scrollToBottom(); hasScrolledOnce = !items.isEmpty } |
| @@ -101,7 +109,10 @@ final class LiveTranscript: NSView { |
| let height = composer.desiredHeight |
| let column = self.column |
| composer.frame = NSRect(x: column.x, y: bounds.height - height - 18, width: column.width, height: height) |
| - scroll.frame = NSRect(x: 0, y: 0, width: bounds.width, height: composer.frame.minY - 12) |
| + selectionHost.frame.size.width = column.width |
| + let chipHeight = session.projectCatalog.selection == nil && session.projectCatalog.selectionNotice == nil ? 0 : ceil(selectionHost.fittingSize.height) |
| + selectionHost.frame = NSRect(x: column.x, y: composer.frame.minY - chipHeight, width: column.width, height: chipHeight) |
| + scroll.frame = NSRect(x: 0, y: 0, width: bounds.width, height: selectionHost.frame.minY - 12) |
| if laidOutWidth != bounds.width { |
| let wasAtBottom = isAtBottom |
| laidOutWidth = bounds.width |
| @@ -119,6 +130,7 @@ final class LiveTranscript: NSView { |
| for id in Array(rows.keys) where !ids.contains(id) { |
| rows.removeValue(forKey: id)?.view.removeFromSuperview() |
| replyHosts.removeValue(forKey: id) |
| + questionHosts.removeValue(forKey: id) |
| } |
| let column = self.column |
| var y: CGFloat = 24 |
| @@ -189,11 +201,15 @@ final class LiveTranscript: NSView { |
| switch item { |
| case .own(let message): |
| place(ownBubble(message.text, width: width), x: width - ownWidth(message.text, width: width)) |
| - case .coordinator, .draft: break |
| + case .coordinator, .draft, .notice: break |
| case .outgoing(let outgoing): |
| + if let project = outgoing.projectName { place(makeText(project, MacType.caption, .webSecondary, width: width), gapAfter: 4) } |
| let bubble = ownBubble(outgoing.text, width: width) |
| bubble.alphaValue = outgoing.state == .sending ? 0.6 : 1 |
| place(bubble, x: width - bubble.frame.width, gapAfter: 4) |
| + if let notice = outgoing.notice { |
| + place(makeText(notice, MacType.small, .webNegative, width: width)) |
| + } |
| let status = outgoingStatus(outgoing) |
| place(status, x: width - status.frame.width) |
| case .report(_, let byline, let report, let compact): |
| @@ -201,7 +217,22 @@ final class LiveTranscript: NSView { |
| place(hosted(LiveReport(report: report, compact: compact, wide: true) { [weak self] in self?.openTask(report.task.id) }, width: width), gapAfter: 24) |
| case .question(let card, let byline): |
| place(bylineView(byline, width: width), gapAfter: MacMetric.bylineGap) |
| - placeCard(questionCard(card, taskTitle: session.task(card.taskId)?.title, width: content)) |
| + if card.rememberName != nil || card.isTypedProjectChoice { |
| + let root = QuestionCardHost(card: card, taskTitle: session.task(card.taskId)?.title, session: session, width: content) { [weak self] in |
| + Task { @MainActor [weak self] in |
| + await Task.yield() |
| + guard let self, let host = self.questionHosts[card.id] else { return } |
| + self.resizeHost(host) |
| + } |
| + } |
| + let host = questionHosts[card.id] ?? NSHostingView(rootView: root) |
| + host.rootView = root |
| + host.frame.size = NSSize(width: content, height: ceil(host.fittingSize.height)) |
| + questionHosts[card.id] = host |
| + place(host, x: MacMetric.gutter, gapAfter: 24) |
| + } else { |
| + placeCard(questionCard(card, taskTitle: session.task(card.taskId)?.title, width: content)) |
| + } |
| case .decision(let card, let byline): |
| place(bylineView(byline, width: width), gapAfter: MacMetric.bylineGap) |
| placeCard(decisionCard(card, taskTitle: session.task(card.taskId)?.title, width: content)) |
| @@ -288,7 +319,12 @@ final class LiveTranscript: NSView { |
| } |
| private func resizeReply(_ id: String) { |
| - guard let host = replyHosts[id], let row = host.superview, row.superview === document else { return } |
| + guard let host = replyHosts[id] else { return } |
| + resizeHost(host) |
| + } |
| + |
| + private func resizeHost(_ host: NSView) { |
| + guard let row = host.superview, row.superview === document else { return } |
| let height = ceil(host.fittingSize.height) |
| let delta = height - host.frame.height |
| guard abs(delta) > 0.5 else { return } |
| @@ -354,7 +390,21 @@ final class LiveTranscript: NSView { |
| } |
| let sending: String? = { if case .sending(let id) = state { return id }; return nil }() |
| let options = card.options ?? [] |
| - if !options.isEmpty { |
| + if options.isEmpty { |
| + let field = QuestionAnswerField(draft: session.questionDraft(for: card)) { [weak self] choice in |
| + self?.submit(card: card, choice: choice) |
| + } |
| + field.placeholderString = EquipoStrings.text("chat.card.answer") |
| + field.setAccessibilityLabel(EquipoStrings.text("chat.card.answer")) |
| + field.font = MacType.line; field.textColor = .webText |
| + field.frame.size = NSSize(width: inner, height: 32) |
| + field.isEnabled = sending == nil |
| + add(field) |
| + let answer = button(EquipoStrings.text("chat.card.answer"), .primary) { [weak field] in |
| + field?.submit() |
| + } |
| + answer.frame.size = NSSize(width: inner, height: 32); add(answer) |
| + } else { |
| let gap: CGFloat = 10 |
| let w = floor((inner - gap * CGFloat(options.count - 1)) / CGFloat(options.count)) |
| for (index, option) in options.enumerated() { |
| @@ -574,6 +624,8 @@ final class LiveTranscript: NSView { |
| /// The AppKit transcript in the SwiftUI window. The feed is built in the |
| /// SwiftUI body, so any change to the session it reads updates it here. |
| struct TranscriptView: NSViewRepresentable { |
| + let projectSelectionID: String? |
| + let projectSelectionNotice: String? |
| let items: [FeedItem] |
| let session: EquipoSession |
| @Binding var focusCard: String? |
| @@ -619,3 +671,18 @@ private struct MarkdownReplyHost: View { |
| .frame(width: width, alignment: .leading) |
| } |
| } |
| + |
| +private struct QuestionCardHost: View { |
| + let card: ThinCard |
| + let taskTitle: String? |
| + let session: EquipoSession |
| + let width: CGFloat |
| + let onHeightChange: () -> Void |
| + var body: some View { |
| + LiveQuestionCard(card: card, taskTitle: taskTitle, session: session) |
| + .id(card.id) |
| + .frame(width: width, alignment: .leading) |
| + .fixedSize(horizontal: false, vertical: true) |
| + .onGeometryChange(for: CGFloat.self) { $0.size.height } action: { _ in onHeightChange() } |
| + } |
| +} |
diff --git a/native/apple/Sources/EquipoMac/MacMainView.swift b/native/apple/Sources/EquipoMac/MacMainView.swift| index b0ca5e57..2d974e44 100644 |
| --- a/native/apple/Sources/EquipoMac/MacMainView.swift |
| +++ b/native/apple/Sources/EquipoMac/MacMainView.swift |
| @@ -11,6 +11,7 @@ struct MacMainView: View { |
| typealias Pane = Destination.Pane |
| @State private var pane: Pane = .conversation |
| @State private var inspectedTask: String? |
| + @State private var inspectedProject: String? |
| @State private var showsInspector = false |
| /// A card to bring into view (a tapped notification). |
| @State private var focusCard: String? |
| @@ -21,6 +22,7 @@ struct MacMainView: View { |
| Label(EquipoStrings.text("tab.conversation"), systemImage: "bubble.left.and.bubble.right").tag(Pane.conversation) |
| needsRow.tag(Pane.needs) |
| Label(EquipoStrings.text("tab.tasks"), systemImage: "checklist").tag(Pane.tasks) |
| + Label(EquipoStrings.text("nav.projects"), systemImage: "folder").tag(Pane.projects) |
| } |
| .listStyle(.sidebar) |
| .navigationSplitViewColumnWidth(min: 200, ideal: 220, max: 280) |
| @@ -55,7 +57,18 @@ struct MacMainView: View { |
| @ViewBuilder private var detail: some View { |
| switch pane { |
| case .conversation: |
| - TranscriptView(items: Feed.build(session), session: session, focusCard: $focusCard, openTask: open) |
| + TranscriptView(projectSelectionID: session.projectCatalog.selection?.id, projectSelectionNotice: session.projectCatalog.selectionNotice, items: Feed.build(session), session: session, focusCard: $focusCard, openTask: open) |
| + case .projects: |
| + HStack(spacing: 0) { |
| + ProjectsScreen(session: session) { inspectedProject = $0 } |
| + .frame(minWidth: 260, idealWidth: 340, maxWidth: 420) |
| + Divider() |
| + if let id = inspectedProject { |
| + ProjectDetailScreen(session: session, projectID: id) { project in |
| + session.projectCatalog.selection = project; pane = .conversation |
| + } openTask: { open($0) } |
| + } else { Color.clear.frame(maxWidth: .infinity) } |
| + } |
| case .needs: |
| NeedsScreen(session: session, openTask: open) |
| case .tasks: |
| @@ -88,6 +101,7 @@ struct MacMainView: View { |
| case .conversation: return EquipoStrings.text("tab.conversation") |
| case .needs: return EquipoStrings.text("tab.needs") |
| case .tasks: return EquipoStrings.text("tab.tasks") |
| + case .projects: return EquipoStrings.text("nav.projects") |
| } |
| } |
diff --git a/native/apple/Sources/EquipoMac/QuestionAnswerField.swift b/native/apple/Sources/EquipoMac/QuestionAnswerField.swift| new file mode 100644 |
| index 00000000..5edfba82 |
| --- /dev/null |
| +++ b/native/apple/Sources/EquipoMac/QuestionAnswerField.swift |
| @@ -0,0 +1,32 @@ |
| +import AppKit |
| +import EquipoKit |
| + |
| +/// The text belongs to the card, so replacing a row never discards an edit. |
| +@MainActor final class QuestionAnswerField: NSTextField, NSTextFieldDelegate { |
| + private let draft: QuestionAnswerDraft |
| + private let onSubmit: (String) -> Void |
| + |
| + init(draft: QuestionAnswerDraft, onSubmit: @escaping (String) -> Void) { |
| + self.draft = draft; self.onSubmit = onSubmit |
| + super.init(frame: .zero) |
| + stringValue = draft.typedChoice |
| + delegate = self |
| + } |
| + required init?(coder: NSCoder) { fatalError() } |
| + |
| + func controlTextDidChange(_ notification: Notification) { |
| + draft.typedChoice = stringValue |
| + } |
| + func control(_ control: NSControl, textView: NSTextView, doCommandBy selector: Selector) -> Bool { |
| + guard selector == #selector(NSResponder.insertNewline(_:)) else { return false } |
| + submit() |
| + return true |
| + } |
| + func submit() { |
| + guard isEnabled else { return } |
| + let text = stringValue.trimmingCharacters(in: .whitespacesAndNewlines) |
| + guard !text.isEmpty else { return } |
| + draft.typedChoice = stringValue |
| + onSubmit(text) |
| + } |
| +} |
diff --git a/native/apple/Tests/EquipoKitTests/Fixtures/project-card.json b/native/apple/Tests/EquipoKitTests/Fixtures/project-card.json| new file mode 100644 |
| index 00000000..72e7c798 |
| --- /dev/null |
| +++ b/native/apple/Tests/EquipoKitTests/Fixtures/project-card.json |
| @@ -0,0 +1,17 @@ |
| +{ |
| + "choice": "", |
| + "created_at": "2026-11-17T11:59:59.93041Z", |
| + "id": "c_project", |
| + "kind": "question", |
| + "name": "oficina/sample", |
| + "options": [], |
| + "project_id": "p_dogiihcx5hlvgbhrrs7tq3eebr", |
| + "question": "Which project should this go in? Type the project name or repository.", |
| + "revision": 1, |
| + "state": "open", |
| + "task_id": "", |
| + "turn_id": "t_qx3y2mwzyh5b7isafhjc6y4l4z", |
| + "updated_at": "2026-11-17T11:59:59.93041Z", |
| + "remember_name": "my reader", |
| + "placement_by_name": true |
| +} |
diff --git a/native/apple/Tests/EquipoKitTests/Fixtures/project-invalid.json b/native/apple/Tests/EquipoKitTests/Fixtures/project-invalid.json| new file mode 100644 |
| index 00000000..b5f5b431 |
| --- /dev/null |
| +++ b/native/apple/Tests/EquipoKitTests/Fixtures/project-invalid.json |
| @@ -0,0 +1,5 @@ |
| +{ |
| + "code": "invalid_input", |
| + "copy_key": "api.invalid_input", |
| + "request_id": "fixture" |
| +} |
diff --git a/native/apple/Tests/EquipoKitTests/Fixtures/project-list.json b/native/apple/Tests/EquipoKitTests/Fixtures/project-list.json| new file mode 100644 |
| index 00000000..0cb059ae |
| --- /dev/null |
| +++ b/native/apple/Tests/EquipoKitTests/Fixtures/project-list.json |
| @@ -0,0 +1,125 @@ |
| +{ |
| + "items": [ |
| + { |
| + "added_by": "owner@example.com", |
| + "attachments": [ |
| + { |
| + "default_branch": "main", |
| + "head_at": null, |
| + "head_sha": "9999999999999999999999999999999999999999", |
| + "head_subject": "Trim the compose sheet", |
| + "kind": "repo", |
| + "name": "oficina/sample", |
| + "ref": "amadan.net/oficina/sample" |
| + } |
| + ], |
| + "checks": { |
| + "gate": "make ci", |
| + "here": true, |
| + "reason": "" |
| + }, |
| + "created_at": "2026-11-18T20:37:44.538005Z", |
| + "description": "Woodstar is a reading app.", |
| + "id": "p_star", |
| + "name": "oficina/sample", |
| + "people": [ |
| + { |
| + "address": "owner@example.com", |
| + "initials": "O", |
| + "name": "Owner" |
| + } |
| + ], |
| + "repo": "amadan.net/oficina/sample", |
| + "revision": 1, |
| + "stack": [ |
| + "Go" |
| + ], |
| + "state": "active", |
| + "title": "Woodstar", |
| + "updated_at": "2026-11-18T20:37:44.538005Z", |
| + "starred": true, |
| + "names": [ |
| + "Reading" |
| + ], |
| + "personal_names": [ |
| + "my reader" |
| + ], |
| + "forge": "amadan", |
| + "connection_id": "amadan", |
| + "title_source": "owner", |
| + "description_source": "repository" |
| + }, |
| + { |
| + "added_by": "owner@example.com", |
| + "attachments": [ |
| + { |
| + "default_branch": "main", |
| + "head_at": null, |
| + "head_sha": "9999999999999999999999999999999999999999", |
| + "head_subject": "Trim the compose sheet", |
| + "kind": "repo", |
| + "name": "oficina/sample", |
| + "ref": "amadan.net/oficina/sample" |
| + } |
| + ], |
| + "checks": { |
| + "gate": "make ci", |
| + "here": true, |
| + "reason": "" |
| + }, |
| + "created_at": "2026-11-18T20:37:44.538005Z", |
| + "description": "Woodstar is a reading app.", |
| + "id": "p_recent", |
| + "name": "oficina/sample", |
| + "people": [ |
| + { |
| + "address": "owner@example.com", |
| + "initials": "O", |
| + "name": "Owner" |
| + } |
| + ], |
| + "repo": "amadan.net/oficina/sample", |
| + "revision": 1, |
| + "stack": [ |
| + "Go" |
| + ], |
| + "state": "active", |
| + "title": "Recent", |
| + "updated_at": "2026-11-18T20:37:44.538005Z", |
| + "starred": false, |
| + "names": [ |
| + "Reading" |
| + ], |
| + "forge": "amadan", |
| + "connection_id": "amadan", |
| + "title_source": "owner", |
| + "description_source": "repository" |
| + } |
| + ], |
| + "allowed": [ |
| + "amadan.net/oficina/sample", |
| + "amadan.net/oficina/notes" |
| + ], |
| + "home": "", |
| + "connections": [ |
| + { |
| + "id": "amadan", |
| + "forge": "amadan", |
| + "title": "Amadan", |
| + "state": "connected", |
| + "can_add": true |
| + } |
| + ], |
| + "can_add": [ |
| + { |
| + "repo": "amadan.net/oficina/notes", |
| + "name": "oficina/notes", |
| + "title": "Notes", |
| + "description": "Notes for the team.", |
| + "description_source": "repository", |
| + "forge": "amadan", |
| + "connection_id": "amadan" |
| + } |
| + ], |
| + "cursor": 0 |
| +} |
diff --git a/native/apple/Tests/EquipoKitTests/Fixtures/project-typed-answer.json b/native/apple/Tests/EquipoKitTests/Fixtures/project-typed-answer.json| new file mode 100644 |
| index 00000000..a4908e29 |
| --- /dev/null |
| +++ b/native/apple/Tests/EquipoKitTests/Fixtures/project-typed-answer.json |
| @@ -0,0 +1,42 @@ |
| +{ |
| + "card": { |
| + "choice": "", |
| + "created_at": "2026-11-17T11:59:59.93041Z", |
| + "id": "c_project", |
| + "kind": "question", |
| + "name": "oficina/sample", |
| + "options": [], |
| + "project_id": "p_dogiihcx5hlvgbhrrs7tq3eebr", |
| + "question": "Which project should this go in? Type the project name or repository.", |
| + "revision": 2, |
| + "state": "open", |
| + "task_id": "", |
| + "turn_id": "t_qx3y2mwzyh5b7isafhjc6y4l4z", |
| + "updated_at": "2026-11-17T11:59:59.93041Z", |
| + "remember_name": "edited reader", |
| + "placement_by_name": true |
| + }, |
| + "message": { |
| + "created_at": "0001-01-01T00:00:00Z", |
| + "id": "", |
| + "revision": 0, |
| + "role": "", |
| + "switched": null, |
| + "text": "", |
| + "turn_id": "" |
| + }, |
| + "turn": { |
| + "attempt": 0, |
| + "connection": "", |
| + "created_at": "0001-01-01T00:00:00Z", |
| + "id": "", |
| + "kind": "", |
| + "message_ids": null, |
| + "reason": "", |
| + "reply_id": "", |
| + "revision": 0, |
| + "state": "", |
| + "timing": null, |
| + "updated_at": "0001-01-01T00:00:00Z" |
| + } |
| +} |
diff --git a/native/apple/Tests/EquipoKitTests/Fixtures/thin/projects.json b/native/apple/Tests/EquipoKitTests/Fixtures/thin/projects.json| index aa9990c8..8d24a178 100644 |
| --- a/native/apple/Tests/EquipoKitTests/Fixtures/thin/projects.json |
| +++ b/native/apple/Tests/EquipoKitTests/Fixtures/thin/projects.json |
| @@ -3,6 +3,7 @@ |
| "amadan.net/oficina/equipo", |
| "amadan.net/oficina/sample" |
| ], |
| + "cursor": 64, |
| "home": "", |
| "items": [ |
| { |
diff --git a/native/apple/Tests/EquipoKitTests/MarkdownStreamTests.swift b/native/apple/Tests/EquipoKitTests/MarkdownStreamTests.swift| index 1d4383ea..7b264404 100644 |
| --- a/native/apple/Tests/EquipoKitTests/MarkdownStreamTests.swift |
| +++ b/native/apple/Tests/EquipoKitTests/MarkdownStreamTests.swift |
| @@ -10,7 +10,7 @@ import Testing |
| let session = EquipoSession(account: account, accounts: accounts, transport: transport) |
| var snapshot: Snapshot = try Fixture.decode("thin/snapshot") |
| var turn = try #require(snapshot.turns?.first) |
| - turn.state = "running"; turn.attempt = 1 |
| + turn.state = "running"; turn.attempt = 1; turn.replyId = "" |
| snapshot.turns = [turn]; snapshot.messages = [] |
| session.apply(snapshot) |
| return (session, snapshot, turn.id) |
| @@ -46,6 +46,9 @@ import Testing |
| var snapshot = original |
| let message = ThinMessage(id: "m-finished", revision: 100, role: "coordinator", text: "```sh\nls\n```\n", turnId: id, createdAt: Date()) |
| snapshot.messages = [message] |
| + snapshot.turns?[0].replyId = message.id |
| + snapshot.turns?[0].state = "replied" |
| + snapshot.turns?[0].revision += 1 |
| session.apply(snapshot) |
| #expect(session.drafts[id] == nil) |
| let finished = try #require(Feed.build(session).first { $0.reply != nil }) |
diff --git a/native/apple/Tests/EquipoKitTests/ProjectsAccessibilityTests.swift b/native/apple/Tests/EquipoKitTests/ProjectsAccessibilityTests.swift| new file mode 100644 |
| index 00000000..5a9740ae |
| --- /dev/null |
| +++ b/native/apple/Tests/EquipoKitTests/ProjectsAccessibilityTests.swift |
| @@ -0,0 +1,58 @@ |
| +#if os(macOS) |
| +import AppKit |
| +import Observation |
| +import SwiftUI |
| +import Testing |
| +@testable import EquipoKit |
| + |
| +@MainActor @Observable private final class RememberValue { var checked = true } |
| + |
| +@MainActor @Suite(.serialized) struct ProjectsAccessibilityTests { |
| + @Test func customCheckboxUsesNativeAccessibilityRepresentationOnBothPlatforms() throws { |
| + let source = URL(fileURLWithPath: #filePath).deletingLastPathComponent().deletingLastPathComponent().deletingLastPathComponent().appendingPathComponent("Sources/EquipoKit/UI/RosterViews.swift") |
| + let text = try String(contentsOf: source, encoding: .utf8) |
| + let style = try #require(text.components(separatedBy: "private struct RosterCheckStyle:").last) |
| + #expect(style.contains(".accessibilityRepresentation")) |
| + #expect(style.contains("Toggle(isOn: configuration.$isOn)")) |
| + #expect(!style.contains(".isSelected")) |
| + } |
| + @Test func rememberControlExposesToggleRoleValueAndAction() async throws { |
| + let value = RememberValue() |
| + let title = String(format: EquipoStrings.text("projects.remember_name"), "my project") |
| + let host = NSHostingView(rootView: RosterCheck(title: title, isOn: Binding(get: { value.checked }, set: { value.checked = $0 })).environment(\.accessibilityEnabled, true)) |
| + host.frame = NSRect(x: 0, y: 0, width: 500, height: 80) |
| + let window = NSWindow(contentRect: host.frame, styleMask: [.borderless], backing: .buffered, defer: false) |
| + window.contentView = host |
| + defer { window.orderOut(nil); window.contentView = nil } |
| + window.orderBack(nil) |
| + host.layoutSubtreeIfNeeded() |
| + try await Task.sleep(for: .milliseconds(30)) |
| + // SwiftUI exposes Objective-C accessibility objects without declaring |
| + // conformance to AppKit's full Swift protocol. Query its public selectors. |
| + func attribute(_ object: NSObject, _ name: String) -> Any? { |
| + let selector = NSSelectorFromString(name) |
| + guard object.responds(to: selector) else { return nil } |
| + return object.perform(selector)?.takeUnretainedValue() |
| + } |
| + func elements(_ element: NSObject, depth: Int = 0) -> [NSObject] { |
| + guard depth < 20 else { return [] } |
| + return [element] + ((attribute(element, "accessibilityChildren") as? [NSObject]) ?? []).flatMap { elements($0, depth: depth + 1) } |
| + } |
| + func checkbox() throws -> NSObject { |
| + let all = elements(host) |
| + return try #require(all.first { ["AXCheckBox", "AXSwitch"].contains(attribute($0, "accessibilityRole") as? String ?? "") }, "Roles: \(all.map { attribute($0, "accessibilityRole") as? String ?? "nil" })") |
| + } |
| + let control = try checkbox() |
| + #expect(attribute(control, "accessibilityLabel") as? String == title || attribute(control, "accessibilityTitle") as? String == title) |
| + #expect((attribute(control, "accessibilityValue") as? NSNumber)?.boolValue == true) |
| + let selector = NSSelectorFromString("accessibilityPerformPress") |
| + #expect(control.responds(to: selector)) |
| + let press = unsafeBitCast(control.method(for: selector), to: (@convention(c) (AnyObject, Selector) -> Bool).self) |
| + #expect(press(control, selector)) |
| + #expect(!value.checked) |
| + host.layoutSubtreeIfNeeded() |
| + try await Task.sleep(for: .milliseconds(30)) |
| + #expect((attribute(try checkbox(), "accessibilityValue") as? NSNumber)?.boolValue == false) |
| + } |
| +} |
| +#endif |
diff --git a/native/apple/Tests/EquipoKitTests/ProjectsFinalReviewTests.swift b/native/apple/Tests/EquipoKitTests/ProjectsFinalReviewTests.swift| new file mode 100644 |
| index 00000000..20cb3a5b |
| --- /dev/null |
| +++ b/native/apple/Tests/EquipoKitTests/ProjectsFinalReviewTests.swift |
| @@ -0,0 +1,49 @@ |
| +import Foundation |
| +import Testing |
| +@testable import EquipoKit |
| +#if os(macOS) |
| +import AppKit |
| +import SwiftUI |
| +@testable import EquipoMac |
| +#endif |
| + |
| +extension ProjectsReviewTests { |
| + @Test func nextComposerSendClearsReleasedSelectionNotice() async throws { |
| + let t = ScriptedTransport(); let s = try session(t) |
| + t.on("POST /messages", .failure(.offline)) |
| + s.projectCatalog.releaseSelection("gone") |
| + #expect(s.projectCatalog.selectionNotice != nil) |
| + await s.sendFromComposer("An ordinary request").value |
| + #expect(s.projectCatalog.selectionNotice == nil) |
| + #expect(try body(#require(t.sent("POST /messages").first))["project_id"] == nil) |
| + #expect(s.outgoing.first?.state == .waiting) |
| + } |
| +} |
| + |
| +extension ProjectsReviewTests { |
| + @Test func onlyEquipoProjectNotFoundReleasesTheRetrySelection() async throws { |
| + let cases: [(Int, String?, String?, String?, String?, Bool)] = [ |
| + (404, "not_found", "api.not_found", "p_star", nil, true), |
| + (404, "route_missing", "api.not_found", "p_star", nil, false), |
| + (404, "not_found", "proxy.not_found", "p_star", nil, false), |
| + (404, nil, nil, "p_star", nil, false), |
| + (500, "not_found", "api.not_found", "p_star", nil, false), |
| + (404, "not_found", "api.not_found", nil, nil, false), |
| + (404, "not_found", "api.not_found", "p_star", "tk1", false), |
| + ] |
| + for (status, code, key, project, task, releases) in cases { |
| + let t = ScriptedTransport(); let s = try session(t) |
| + let route = task.map { "POST /tasks/\($0)/thread" } ?? "POST /messages" |
| + let data = code.map { Data("{\"code\":\"\($0)\",\"copy_key\":\"\(key!)\",\"request_id\":\"r\"}".utf8) } ?? Data("Not found".utf8) |
| + t.on(route, .success(APIResponse(status: status, data: data))) |
| + await s.send("Fix it", inThreadOf: task, projectID: project) |
| + let outgoing = try #require(s.outgoing.first) |
| + #expect(outgoing.goneProject == releases, "status=\(status), code=\(code ?? "none"), key=\(key ?? "none"), task=\(task ?? "none")") |
| + #expect((s.projectCatalog.selectionNotice != nil) == releases) |
| + await s.retry(outgoing.id) |
| + let sent = t.sent(route) |
| + #expect(sent.count == 2) |
| + #expect((sent[0].body == sent[1].body) == !releases) |
| + } |
| + } |
| +} |
diff --git a/native/apple/Tests/EquipoKitTests/ProjectsMacQuestionTests.swift b/native/apple/Tests/EquipoKitTests/ProjectsMacQuestionTests.swift| new file mode 100644 |
| index 00000000..0d258c37 |
| --- /dev/null |
| +++ b/native/apple/Tests/EquipoKitTests/ProjectsMacQuestionTests.swift |
| @@ -0,0 +1,42 @@ |
| +#if os(macOS) |
| +import AppKit |
| +import SwiftUI |
| +import Testing |
| +@testable import EquipoKit |
| +@testable import EquipoMac |
| + |
| +@MainActor @Suite(.serialized) struct ProjectsMacQuestionTests { |
| + @Test func ordinaryQuestionKeepsLiveDraftAcrossResizeAndReturnSubmits() async throws { |
| + let t = ScriptedTransport(); let s = try ProjectsReviewTests().session(t) |
| + var card: ThinCard = try Fixture.decode("project-card") |
| + card.placementByName = nil; card.rememberName = nil |
| + let byline = RosterByline(who: .coordinator, verb: "asks", project: nil, time: nil) |
| + t.on("POST /cards/\(card.id)/answer", fixture: "project-invalid", status: 422) |
| + let view = LiveTranscript(session: s, openTask: { _ in }) |
| + view.frame = NSRect(x: 0, y: 0, width: 700, height: 800) |
| + let window = NSWindow(contentRect: view.frame, styleMask: [.borderless], backing: .buffered, defer: false) |
| + window.contentView = view |
| + defer { window.contentView = nil } |
| + view.update(items: [.question(card, byline)]); view.layout() |
| + func fields(_ v: NSView) -> [NSTextField] { (v as? NSTextField).map { [$0] } ?? v.subviews.flatMap(fields) } |
| + func answerField() throws -> NSTextField { |
| + try #require(fields(view).first { $0.isEditable && $0.placeholderString == EquipoStrings.text("chat.card.answer") }) |
| + } |
| + let first = try answerField() |
| + first.stringValue = "The answer I am still writing" |
| + first.delegate?.controlTextDidChange?(Notification(name: NSControl.textDidChangeNotification, object: first)) |
| + #expect(s.questionDraft(for: card).typedChoice == first.stringValue) |
| + view.frame.size.width = 500; view.layout() |
| + let rebuilt = try answerField() |
| + #expect(rebuilt !== first, "exercise an actual row rebuild") |
| + #expect(rebuilt.stringValue == "The answer I am still writing") |
| + let handled = rebuilt.delegate?.control?(rebuilt, textView: NSTextView(), doCommandBy: #selector(NSResponder.insertNewline(_:))) |
| + #expect(handled == true) |
| + for _ in 0..<200 where t.sent("POST /cards/\(card.id)/answer").isEmpty { await Task.yield() } |
| + let request = try #require(t.sent("POST /cards/\(card.id)/answer").first) |
| + let fields = try #require(JSONSerialization.jsonObject(with: request.body!) as? [String: Any]) |
| + #expect(fields["choice"] as? String == "The answer I am still writing") |
| + #expect(fields["revision"] as? Int64 == card.revision) |
| + } |
| +} |
| +#endif |
diff --git a/native/apple/Tests/EquipoKitTests/ProjectsReviewTests.swift b/native/apple/Tests/EquipoKitTests/ProjectsReviewTests.swift| new file mode 100644 |
| index 00000000..82a44d2c |
| --- /dev/null |
| +++ b/native/apple/Tests/EquipoKitTests/ProjectsReviewTests.swift |
| @@ -0,0 +1,149 @@ |
| +import Foundation |
| +import Testing |
| +@testable import EquipoKit |
| +#if os(macOS) |
| +import AppKit |
| +import SwiftUI |
| +@testable import EquipoMac |
| +#endif |
| + |
| +@MainActor @Suite(.serialized) struct ProjectsReviewTests { |
| + func session(_ t: ScriptedTransport) throws -> EquipoSession { |
| + var account = DeviceAccount.new(origin: t.origin, label: "Test") |
| + account.credential = try Fixture.decode("device-credential") |
| + return EquipoSession(account: account, accounts: DeviceAccounts(store: MemorySecretStore()), transport: t) |
| + } |
| + func body(_ request: APIRequest) throws -> [String: String] { |
| + try #require(JSONSerialization.jsonObject(with: request.body!) as? [String: String]) |
| + } |
| + @Test func messageFailuresOnlyShowKnownServerCopy() async throws { |
| + for project in [nil, "p_star"] as [String?] { |
| + for failure in [0, 500, 422] { |
| + let t = ScriptedTransport(); let s = try session(t) |
| + if failure == 0 { t.on("POST /messages", .failure(.offline)) } |
| + else { t.on("POST /messages", .success(APIResponse(status: failure, data: Data("{\"code\":\"refused\",\"copy_key\":\"\(failure == 422 ? "api.repo_not_allowed" : "unrecognised")\",\"request_id\":\"r\"}".utf8)))) } |
| + await s.send("Fix it", projectID: project) |
| + #expect(s.outgoing.first?.notice == (failure == 422 ? EquipoStrings.text("api.repo_not_allowed") : nil)) |
| + } |
| + } |
| + } |
| + @Test func taskThreadNeverCarriesProject() async throws { |
| + let t = ScriptedTransport(); let s = try session(t) |
| + await s.send("More detail", inThreadOf: "tk1", projectID: "p_star") |
| + let request = try #require(t.requests.first { $0.method == "POST" }) |
| + #expect(try body(request)["project_id"] == nil) |
| + #expect(s.outgoing.first?.projectName == nil) |
| + } |
| + @Test func removedSelectionClearsFromListAndEvent() async throws { |
| + for event in [false, true] { |
| + let t = ScriptedTransport(); let s = try session(t) |
| + t.on("GET /projects", fixture: "project-list"); await s.projectCatalog.refresh() |
| + var p = try #require(s.projectCatalog.items.first); s.projectCatalog.selection = p |
| + if event { p.state = "removed"; p.revision += 1; s.projectCatalog.applyEvent(p, cursor: 100) } |
| + else { t.replace("GET /projects", with: .success(APIResponse(status: 200, data: Data("{\"items\":[],\"cursor\":100}".utf8)))); await s.projectCatalog.refresh() } |
| + #expect(s.projectCatalog.selection == nil) |
| + #expect(s.projectCatalog.selectionNotice == EquipoStrings.text("projects.selection_lost")) |
| + } |
| + } |
| + @Test func listCursorRejectsOlderViewerEventsAndResurrection() async throws { |
| + let t = ScriptedTransport(); let s = try session(t) |
| + var json = try #require(JSONSerialization.jsonObject(with: Fixture.data("project-list")) as? [String: Any]) |
| + json["cursor"] = 100 |
| + t.on("GET /projects", .success(APIResponse(status: 200, data: try JSONSerialization.data(withJSONObject: json)))) |
| + await s.projectCatalog.refresh() |
| + var p = try #require(s.projectCatalog.items.first); p.personalNames = ["stale"] |
| + s.projectCatalog.applyEvent(p, cursor: 99) |
| + s.projectCatalog.applySnapshot([p], cursor: 99) |
| + #expect(s.projectCatalog.projects[p.id]?.personalNames != ["stale"]) |
| + p.id = "removed_project"; s.projectCatalog.applyEvent(p, cursor: 99) |
| + #expect(s.projectCatalog.projects[p.id] == nil) |
| + } |
| + @Test func questionMarkerAndRememberChoiceSurviveRevision() async throws { |
| + let t = ScriptedTransport(); let s = try session(t) |
| + var card: ThinCard = try Fixture.decode("project-card") |
| + #expect(card.isTypedProjectChoice) |
| + #expect(card.answerFieldKey == "projects.other") |
| + let draft = s.questionDraft(for: card) |
| + draft.remembers = false; draft.name = "my edited name" |
| + card.revision += 1 |
| + #expect(s.questionDraft(for: card) === draft) |
| + #expect(!draft.remembers && draft.name == "my edited name") |
| + _ = await draft.submit("a repo", card: card, session: s) |
| + let request = try #require(t.sent("POST /cards/\(card.id)/answer").first) |
| + let fields = try #require(JSONSerialization.jsonObject(with: request.body!) as? [String: Any]) |
| + #expect(fields["remember_name"] as? String == "") |
| + #expect(fields["revision"] as? Int64 == card.revision) |
| + card.placementByName = nil; card.rememberName = nil |
| + #expect(!card.isTypedProjectChoice) |
| + #expect(card.answerFieldKey == "chat.card.answer") |
| + } |
| + @Test func phoneComposerConsumesSelection() async throws { |
| + let t = ScriptedTransport(); let s = try session(t) |
| + let list: ProjectList = try Fixture.decode("project-list") |
| + s.projectCatalog.selection = list.items?.first |
| + let screen = ConversationScreen(session: s, openTask: { _ in }) |
| + let send = screen.sendFromComposer("Hello") |
| + #expect(s.projectCatalog.selection == nil) |
| + await send.value |
| + #expect(try body(#require(t.sent("POST /messages").first))["project_id"] == "p_star") |
| + } |
| +#if os(macOS) |
| + @Test func macComposerConsumesSelectionAndChipIsAboveIt() async throws { |
| + let t = ScriptedTransport(); let s = try session(t) |
| + let list: ProjectList = try Fixture.decode("project-list") |
| + let view = LiveTranscript(session: s, openTask: { _ in }) |
| + view.frame = NSRect(x: 0, y: 0, width: 700, height: 800) |
| + s.projectCatalog.selection = list.items?.first |
| + view.layout() |
| + #expect(view.selectionFrame.maxY <= view.composer.frame.minY) |
| + #expect(view.selectionFrame.height > 0) |
| + view.composer.onSend?("Hello") |
| + #expect(s.projectCatalog.selection == nil) |
| + for _ in 0..<200 where t.sent("POST /messages").isEmpty { await Task.yield() } |
| + #expect(try body(#require(t.sent("POST /messages").first))["project_id"] == "p_star") |
| + view.layout() |
| + #expect(view.selectionFrame.height == 0) |
| + } |
| + @Test func ordinaryQuestionStaysAppKitButPlacementUsesSwiftUI() throws { |
| + let s = try session(ScriptedTransport()) |
| + var card: ThinCard = try Fixture.decode("project-card") |
| + let view = LiveTranscript(session: s, openTask: { _ in }) |
| + view.frame = NSRect(x: 0, y: 0, width: 700, height: 800) |
| + let byline = RosterByline(who: .coordinator, verb: "asks", project: nil, time: nil) |
| + view.update(items: [.question(card, byline)]) |
| + #expect(view.hostedQuestionIDs == [card.id]) |
| + card.id = "ordinary"; card.placementByName = nil; card.rememberName = nil |
| + view.update(items: [.question(card, byline)]) |
| + #expect(view.hostedQuestionIDs.isEmpty) |
| + func fields(_ v: NSView) -> [NSTextField] { (v as? NSTextField).map { [$0] } ?? v.subviews.flatMap(fields) } |
| + #expect(fields(view).contains { $0.isEditable && $0.placeholderString == EquipoStrings.text("chat.card.answer") }) |
| + } |
| +#endif |
| +} |
| + |
| +extension ProjectsReviewTests { |
| + @Test func phoneAndMacControlsUseTestedActionsAndRosterTheme() throws { |
| + let sources = URL(fileURLWithPath: #filePath).deletingLastPathComponent().deletingLastPathComponent().deletingLastPathComponent().appendingPathComponent("Sources") |
| + func source(_ path: String) throws -> String { try String(contentsOf: sources.appendingPathComponent(path), encoding: .utf8) } |
| + let card = try source("EquipoKit/UI/LiveCards.swift") |
| + #expect(card.contains("draft.submit(choice, card: card, session: session)")) |
| + #expect(card.contains("card.answerFieldKey")) |
| + #expect(card.contains("$draft.remembers")) |
| + #expect(!card.contains("remembers = true")) |
| + #expect(!card.contains(".roundedBorder")) |
| + #expect(card.contains("RosterField(")) |
| + #expect(card.contains("RosterCheck(")) |
| + let phone = try source("EquipoKit/UI/Screens/ConversationScreen.swift") |
| + #expect(phone.contains("_ = sendFromComposer(text)")) |
| + let mac = try source("EquipoMac/LiveTranscript.swift") |
| + #expect(mac.contains("_ = session.sendFromComposer(text)")) |
| + #expect(mac.contains(".id(card.id)")) |
| + #expect(!mac.contains(".id(card.revision)")) |
| + let projects = try source("EquipoKit/UI/Screens/ProjectsScreen.swift") |
| + #expect(!projects.contains(".borderedProminent")) |
| + for key in ["projects.new_request", "projects.add_reachable", "projects.forget_name"] { |
| + #expect(projects.contains("RosterButton(title: EquipoStrings.text(\"\(key)\")")) |
| + } |
| + #expect(!(try source("EquipoMac/MacMainView.swift")).contains("ProjectSelectionChip(")) |
| + } |
| +} |
diff --git a/native/apple/Tests/EquipoKitTests/ProjectsTests.swift b/native/apple/Tests/EquipoKitTests/ProjectsTests.swift| new file mode 100644 |
| index 00000000..eb860276 |
| --- /dev/null |
| +++ b/native/apple/Tests/EquipoKitTests/ProjectsTests.swift |
| @@ -0,0 +1,385 @@ |
| +import Foundation |
| +import Testing |
| +@testable import EquipoKit |
| + |
| +@MainActor @Suite(.serialized) struct ProjectsTests { |
| + func catalog(_ t: ScriptedTransport) -> ProjectCatalog { |
| + ProjectCatalog(client: EquipoClient(transport: t, token: "fixture"), lifetime: SignInLifetime()) |
| + } |
| + func list() throws -> ProjectList { try Fixture.decode("project-list") } |
| + func response<T: Encodable>(_ value: T) throws -> Result<APIResponse, EquipoAPIError> { |
| + .success(APIResponse(status: 200, data: try EquipoJSON.encoder.encode(value))) |
| + } |
| + |
| + @Test func listKeepsServerOrderAndOwnerAvailability() async throws { |
| + let t = ScriptedTransport(); t.on("GET /projects", fixture: "project-list") |
| + let c = catalog(t); await c.refresh() |
| + #expect(c.items.map(\.id) == ["p_star", "p_recent"]) |
| + #expect(c.items[0].starred == true) |
| + #expect(c.items[1].personalNames == nil) |
| + #expect(c.available.count == 1) |
| + #expect(c.connections.first?.state == "connected") |
| + var member = try list(); member.connections?[0].canAdd = false |
| + t.replace("GET /projects", with: try response(member)); await c.refresh() |
| + #expect(c.available.isEmpty, "owner capability gates Add even if a response carries repositories") |
| + } |
| + |
| + @Test func sameRevisionPersonalEventsFollowSequenceNotSharedRevision() throws { |
| + let c = catalog(ScriptedTransport()); let p = try #require(list().items?.first) |
| + c.applySnapshot([p], cursor: 10) |
| + var removed = p; removed.personalNames = nil |
| + c.applyEvent(removed, cursor: 12) |
| + c.applyEvent(p, cursor: 11) |
| + c.applySnapshot([p], cursor: 10) |
| + #expect(c.projects[p.id]?.personalNames == nil) |
| + #expect(c.projects[p.id]?.names == ["Reading"]) |
| + c.applyEvent(p, cursor: 13) |
| + #expect(c.projects[p.id]?.personalNames == ["my reader"]) |
| + var older = removed; older.revision -= 1 |
| + c.applyEvent(older, cursor: 14) |
| + #expect(c.projects[p.id]?.revision == p.revision) |
| + c.applySnapshot([removed], cursor: 15) |
| + #expect(c.projects[p.id]?.personalNames == nil, "a fresh snapshot after a reconnect carries viewer fields too") |
| + c.applyEvent(p, cursor: 14) |
| + #expect(c.projects[p.id]?.personalNames == nil, "a snapshot cursor also rejects older replayed viewer events") |
| + } |
| + |
| + @Test func starUsesPutAndResponseCorrectsOptimism() async throws { |
| + let t = ScriptedTransport(); t.on("GET /projects", fixture: "project-list") |
| + let c = catalog(t); await c.refresh() |
| + let p = try #require(c.items.first) |
| + t.on("PUT /projects/\(p.id)/star", try response(p)) |
| + await c.setStar(p, false) |
| + #expect(c.projects[p.id]?.starred == true) |
| + let request = try #require(t.sent("PUT /projects/\(p.id)/star").first) |
| + #expect(try JSONSerialization.jsonObject(with: request.body!) as? [String: Bool] == ["starred": false]) |
| + #expect(request.bearer == "fixture") |
| + } |
| + |
| + @Test func removeOnlyPersonalNameAndAddRepository() async throws { |
| + let t = ScriptedTransport(); t.on("GET /projects", fixture: "project-list") |
| + let c = catalog(t); await c.refresh() |
| + let p = try #require(c.items.first) |
| + t.on("DELETE /projects/\(p.id)/names", .success(APIResponse(status: 204, data: Data()))) |
| + await c.forgetName("my reader", in: p) |
| + #expect(c.projects[p.id]?.personalNames == []) |
| + #expect(c.projects[p.id]?.names == p.names) |
| + #expect(c.projects[p.id]?.revision == p.revision) |
| + t.on("POST /projects", try response(p)) |
| + await c.add(try #require(c.available.first)) |
| + let request = try #require(t.sent("POST /projects").first) |
| + #expect(try JSONSerialization.jsonObject(with: request.body!) as? [String: String] == ["repo": "amadan.net/oficina/notes"]) |
| + } |
| + |
| + @Test func messageSelectionAndExplicitRememberArePartOfRetryBody() throws { |
| + let write = try EquipoClient.message("Fix it", projectID: "p_star") |
| + let body = try #require(JSONSerialization.jsonObject(with: write.body) as? [String: String]) |
| + #expect(body["project_id"] == "p_star") |
| + #expect(body["idempotency_key"] == write.key) |
| + let card: ThinCard = try Fixture.decode("project-card") |
| + for name in ["edited name", ""] { |
| + let answer = try EquipoClient.answer("Woodstar", rememberName: name, to: card) |
| + let fields = try #require(JSONSerialization.jsonObject(with: answer.body) as? [String: Any]) |
| + #expect(fields["remember_name"] as? String == name) |
| + #expect(fields["revision"] as? Int64 == card.revision) |
| + } |
| + } |
| + |
| + @Test func typed422KeepsCardAndServerNotice() async throws { |
| + let t = ScriptedTransport() |
| + var account = DeviceAccount.new(origin: t.origin, label: "Test") |
| + account.credential = try Fixture.decode("device-credential") |
| + let s = EquipoSession(account: account, accounts: DeviceAccounts(store: MemorySecretStore()), transport: t) |
| + let card: ThinCard = try Fixture.decode("project-card") |
| + var snapshot: Snapshot = try Fixture.decode("thin/snapshot") |
| + snapshot.cards = [card]; s.apply(snapshot) |
| + t.on("POST /cards/\(card.id)/answer", fixture: "project-invalid", status: 422) |
| + #expect(await s.answer(card, choice: "unknown", rememberName: "") == .failed) |
| + #expect(s.answerNotices[card.id] == "Check the request fields and try again.") |
| + #expect(s.cards.first { $0.id == card.id } == card, "422 leaves the exact card open") |
| + #expect(t.sent("POST /cards/\(card.id)/answer").count == 1) |
| + } |
| +} |
| + |
| +private actor ProjectHeldTransport: EquipoTransport { |
| + nonisolated let origin = URL(string: "https://projects.example.test")! |
| + let base: ScriptedTransport |
| + let route: String |
| + var continuation: CheckedContinuation<Void, Never>? |
| + var held = false |
| + var used = false |
| + init(_ base: ScriptedTransport, route: String) { self.base = base; self.route = route } |
| + func send(_ request: APIRequest) async throws -> APIResponse { |
| + let answer = try await base.send(request) |
| + if !used && request.method + " " + request.path == route { |
| + used = true; held = true |
| + await withCheckedContinuation { continuation = $0 } |
| + } |
| + return answer |
| + } |
| + func release() { continuation?.resume(); continuation = nil } |
| + func wait() async { while !held { await Task.yield() } } |
| + func lines(_ request: APIRequest) async throws -> AsyncThrowingStream<String, Error> { try await base.lines(request) } |
| +} |
| + |
| +extension ProjectsTests { |
| + @Test func lateListCannotRestoreViewerNames() async throws { |
| + let t = ScriptedTransport(); t.on("GET /projects", fixture: "project-list") |
| + let transport = ProjectHeldTransport(t, route: "GET /projects") |
| + let c = ProjectCatalog(client: EquipoClient(transport: transport, token: "fixture"), lifetime: SignInLifetime()) |
| + let read = Task { await c.refresh() }; await transport.wait() |
| + var updated = try list(); updated.items?[0].personalNames = nil |
| + let removed = try #require(updated.items?.first) |
| + c.applyEvent(removed, cursor: 100) |
| + t.replace("GET /projects", with: try response(updated)) |
| + await transport.release(); await read.value |
| + #expect(c.projects[removed.id]?.personalNames == nil) |
| + #expect(t.sent("GET /projects").count == 2, "the stale response triggers one fresh read") |
| + } |
| + @Test func optimisticStarRollsBackRefusalAndDepartedReadsCannotPublish() async throws { |
| + let t = ScriptedTransport(); t.on("GET /projects", fixture: "project-list") |
| + let c = catalog(t); await c.refresh() |
| + let p = try #require(c.items.first) |
| + t.on("PUT /projects/\(p.id)/star", .failure(.offline)) |
| + let transport = ProjectHeldTransport(t, route: "GET /projects") |
| + let departed = ProjectCatalog(client: EquipoClient(transport: transport, token: "fixture"), lifetime: SignInLifetime()) |
| + let read = Task { await departed.refresh() }; await transport.wait() |
| + departed.lifetime.end(); await transport.release(); await read.value |
| + #expect(!departed.loaded && departed.items.isEmpty) |
| + await c.setStar(p, false) |
| + #expect(c.projects[p.id]?.starred == p.starred) |
| + #expect(c.notice == "Couldn’t reach your team. Try again.") |
| + } |
| + @Test func starIsOptimisticWhileServerIsHeld() async throws { |
| + let t = ScriptedTransport(); t.on("GET /projects", fixture: "project-list") |
| + let p = try #require(list().items?.first) |
| + t.on("PUT /projects/\(p.id)/star", try response(p)) |
| + let transport = ProjectHeldTransport(t, route: "PUT /projects/\(p.id)/star") |
| + let c = ProjectCatalog(client: EquipoClient(transport: transport, token: "fixture"), lifetime: SignInLifetime()) |
| + await c.refresh() |
| + let write = Task { await c.setStar(p, false) }; await transport.wait() |
| + #expect(c.projects[p.id]?.starred == false) |
| + #expect(c.pending.contains(p.id)) |
| + await transport.release(); await write.value |
| + #expect(c.projects[p.id]?.starred == true) |
| + } |
| + @Test func failedProjectSendKeepsItsNoticeAndRetrySelection() async throws { |
| + for (status, code) in [(404, "not_found"), (422, "repo_not_allowed")] { |
| + let t = ScriptedTransport() |
| + var account = DeviceAccount.new(origin: t.origin, label: "Test") |
| + account.credential = try Fixture.decode("device-credential") |
| + let s = EquipoSession(account: account, accounts: DeviceAccounts(store: MemorySecretStore()), transport: t) |
| + let data = Data("{\"code\":\"\(code)\",\"copy_key\":\"api.\(code)\",\"request_id\":\"fixture\"}".utf8) |
| + t.on("POST /messages", .success(APIResponse(status: status, data: data))) |
| + await s.send("Fix this", projectID: "p_star") |
| + let outgoing = try #require(s.outgoing.first) |
| + #expect(outgoing.state == .failed) |
| + #expect(outgoing.notice == (status == 404 ? EquipoStrings.text("projects.selection_lost") : EquipoStrings.text(String.LocalizationValue("api." + code)))) |
| + await s.retry(outgoing.id) |
| + let requests = t.sent("POST /messages") |
| + #expect(requests.count == 2) |
| + #expect((requests[0].body == requests[1].body) == (status != 404)) |
| + let retry = try #require(JSONSerialization.jsonObject(with: requests[1].body!) as? [String: String]) |
| + #expect(retry["project_id"] == (status == 404 ? nil : "p_star")) |
| + #expect((retry["idempotency_key"] == outgoing.id) == (status != 404)) |
| + let fields = try #require(JSONSerialization.jsonObject(with: requests[0].body!) as? [String: String]) |
| + #expect(fields["project_id"] == "p_star") |
| + } |
| + } |
| +} |
| + |
| +#if os(macOS) |
| +import AppKit |
| +import SwiftUI |
| +@testable import EquipoMac |
| + |
| +extension ProjectsTests { |
| + @Test func macPlacementCardHasAResizableHostAndRetainsItDuringFeedUpdates() async throws { |
| + let t = ScriptedTransport() |
| + var account = DeviceAccount.new(origin: t.origin, label: "Test") |
| + account.credential = try Fixture.decode("device-credential") |
| + let session = EquipoSession(account: account, accounts: DeviceAccounts(store: MemorySecretStore()), transport: t) |
| + var card: ThinCard = try Fixture.decode("project-card") |
| + let byline = RosterByline(who: .coordinator, verb: "asks", project: nil, time: nil) |
| + let view = LiveTranscript(session: session, openTask: { _ in }) |
| + view.frame = NSRect(x: 0, y: 0, width: 600, height: 800) |
| + let window = NSWindow(contentRect: view.frame, styleMask: [.borderless], backing: .buffered, defer: false) |
| + window.contentView = view |
| + defer { window.contentView = nil } |
| + view.update(items: [.question(card, byline)]) |
| + view.layoutSubtreeIfNeeded() |
| + let document = try #require(view.subviews.compactMap { $0 as? NSScrollView }.first?.documentView) |
| + let row = try #require(document.subviews.first) |
| + let host = try #require(row.subviews.first { String(reflecting: type(of: $0)).contains("QuestionCardHost") }) |
| + let height = row.frame.height |
| + #expect(height > 150) |
| + card.revision += 1 |
| + card.question = String(repeating: "Which project should this go in? ", count: 25) |
| + view.update(items: [.question(card, byline)]) |
| + view.layoutSubtreeIfNeeded() |
| + try await Task.sleep(for: .milliseconds(100)) |
| + #expect(host.superview === row) |
| + #expect(row.frame.height > height) |
| + #expect(host.frame.maxY < row.frame.height) |
| + } |
| +} |
| +#endif |
| + |
| +extension ProjectsTests { |
| + @Test func releasedSelectionNoticeDoesNotHideStreamingReplyOrShareItsIdentity() async throws { |
| + let t = ScriptedTransport() |
| + var account = DeviceAccount.new(origin: t.origin, label: "Test") |
| + account.credential = try Fixture.decode("device-credential") |
| + let session = EquipoSession(account: account, accounts: DeviceAccounts(store: MemorySecretStore()), transport: t) |
| + var snapshot: Snapshot = try Fixture.decode("thin/snapshot") |
| + let turn = try #require(snapshot.turns?.first { $0.isLive }) |
| + var notice = try #require(snapshot.messages?.first) |
| + notice.id = "selection-notice"; notice.role = "coordinator"; notice.turnId = turn.id |
| + notice.text = EquipoStrings.text("projects.selection_lost") |
| + session.apply(snapshot) |
| + await session.handle("data: {\"type\":\"delta\",\"resource\":\"turn\",\"attempt\":1,\"data\":{\"turn_id\":\"\(turn.id)\",\"offset\":0,\"text\":\"Working\"}}") |
| + snapshot.messages?.append(notice); session.apply(snapshot) |
| + #expect(session.drafts[turn.id]?.text == "Working") |
| + await session.handle("data: {\"type\":\"delta\",\"resource\":\"turn\",\"attempt\":1,\"data\":{\"turn_id\":\"\(turn.id)\",\"offset\":7,\"text\":\" on it\"}}") |
| + #expect(session.drafts[turn.id]?.text == "Working on it") |
| + var reply = notice; reply.id = "finished-reply"; reply.text = "I found a project." |
| + snapshot.messages?.append(reply) |
| + let index = try #require(snapshot.turns?.firstIndex { $0.id == turn.id }) |
| + snapshot.turns?[index].state = "replied" |
| + snapshot.turns?[index].replyId = reply.id |
| + session.apply(snapshot) |
| + let feed = Feed.build(session) |
| + #expect(feed.contains { $0.reply?.text == notice.text }) |
| + #expect(feed.contains { $0.reply?.text == reply.text }) |
| + #expect(Set(feed.map(\.id)).count == feed.count) |
| + #expect(session.drafts[turn.id] == nil) |
| + } |
| +} |
| + |
| +extension ProjectsTests { |
| + @Test func chooseAnotherKeepsOpenCardWithNewRevisionAndNoTurn() async throws { |
| + let t = ScriptedTransport() |
| + var account = DeviceAccount.new(origin: t.origin, label: "Test") |
| + account.credential = try Fixture.decode("device-credential") |
| + let session = EquipoSession(account: account, accounts: DeviceAccounts(store: MemorySecretStore()), transport: t) |
| + var card: ThinCard = try Fixture.decode("project-card") |
| + card.options = ["Woodstar", "Choose another project"] |
| + t.on("POST /cards/\(card.id)/answer", fixture: "project-typed-answer") |
| + #expect(await session.answer(card, choice: "Choose another project", rememberName: "edited reader") == .answered) |
| + let updated = try #require(session.cards.first) |
| + #expect(updated.isOpen && (updated.options ?? []).isEmpty) |
| + #expect(updated.revision == card.revision + 1) |
| + #expect(updated.rememberName == "edited reader") |
| + #expect(session.turns.isEmpty) |
| + t.replace("POST /cards/\(card.id)/answer", with: .success(APIResponse(status: 422, data: Fixture.data("project-invalid")))) |
| + _ = await session.answer(updated, choice: "no match", rememberName: "") |
| + let fields = try #require(JSONSerialization.jsonObject(with: t.sent("POST /cards/\(card.id)/answer").last!.body!) as? [String: Any]) |
| + #expect(fields["revision"] as? Int64 == updated.revision) |
| + #expect(fields["choice"] as? String == "no match") |
| + #expect(fields["remember_name"] as? String == "") |
| + #expect(session.cards.first == updated) |
| + } |
| +} |
| + |
| +extension ProjectsTests { |
| + @Test func aReadStartedBeforeNameRemovalCannotRestoreItBeforeTheEventArrives() async throws { |
| + let t = ScriptedTransport(); t.on("GET /projects", fixture: "project-list") |
| + let c = catalog(t); await c.refresh() |
| + let p = try #require(c.items.first) |
| + let started = c.snapshotGeneration |
| + t.on("DELETE /projects/\(p.id)/names", .success(APIResponse(status: 204, data: Data()))) |
| + await c.forgetName("my reader", in: p) |
| + c.applySnapshot([p], cursor: 100, generation: started) |
| + #expect(c.projects[p.id]?.personalNames == []) |
| + } |
| + @Test func sessionDecodesSameRevisionProjectEventsInSequence() async throws { |
| + let t = ScriptedTransport() |
| + var account = DeviceAccount.new(origin: t.origin, label: "Test") |
| + account.credential = try Fixture.decode("device-credential") |
| + let session = EquipoSession(account: account, accounts: DeviceAccounts(store: MemorySecretStore()), transport: t) |
| + let p = try #require(list().items?.first) |
| + session.projectCatalog.applySnapshot([p], cursor: 10) |
| + var removed = p; removed.personalNames = nil |
| + func event(_ p: ThinProject, _ cursor: Int) throws -> String { |
| + let data = try JSONSerialization.jsonObject(with: EquipoJSON.encoder.encode(p)) |
| + return "data: " + String(decoding: try JSONSerialization.data(withJSONObject: ["cursor": cursor, "type": "project", "resource": "project", "data": data]), as: UTF8.self) |
| + } |
| + await session.handle(try event(removed, 12)) |
| + await session.handle(try event(p, 11)) |
| + #expect(session.projects[p.id]?.personalNames == nil) |
| + #expect(session.projects[p.id]?.names == p.names) |
| + #expect(session.cursor == 12) |
| + } |
| +} |
| + |
| +#if os(macOS) |
| +extension ProjectsTests { |
| + @Test func projectViewsFitPhoneWidthAndAccessibilityType() async throws { |
| + let t = ScriptedTransport(); t.on("GET /projects", fixture: "project-list") |
| + var account = DeviceAccount.new(origin: t.origin, label: "Test") |
| + account.credential = try Fixture.decode("device-credential") |
| + let s = EquipoSession(account: account, accounts: DeviceAccounts(store: MemorySecretStore()), transport: t) |
| + s.apply(try Fixture.decode("thin/snapshot")); await s.projectCatalog.refresh() |
| + s.projectCatalog.selection = try #require(s.projectCatalog.items.first) |
| + let card: ThinCard = try Fixture.decode("project-card") |
| + for width in [390.0, 760.0] { |
| + for type in [DynamicTypeSize.large, .accessibility3] { |
| + let view = VStack(alignment: .leading, spacing: 20) { |
| + ProjectSummary(project: s.projectCatalog.items[0]) |
| + ProjectSelectionChip(catalog: s.projectCatalog) |
| + LiveQuestionCard(card: card, taskTitle: nil, session: s) |
| + }.padding(16).frame(width: width).environment(\.dynamicTypeSize, type) |
| + .environment(\.colorScheme, .light).background(.white) |
| + let host = NSHostingView(rootView: view) |
| + host.frame.size = host.fittingSize |
| + let window = NSWindow(contentRect: host.frame, styleMask: [.borderless], backing: .buffered, defer: false) |
| + window.contentView = host |
| + host.layoutSubtreeIfNeeded() |
| + try await Task.sleep(for: .milliseconds(30)) |
| + host.displayIfNeeded() |
| + #expect(abs(host.frame.width - width) < 1) |
| + #expect(host.frame.height > 250 && host.frame.height < 2400) |
| + if let directory = ProcessInfo.processInfo.environment["EQUIPO_PROJECT_SCREENSHOTS"] { |
| + let bitmap = try #require(host.bitmapImageRepForCachingDisplay(in: host.bounds)) |
| + host.cacheDisplay(in: host.bounds, to: bitmap) |
| + let file = URL(filePath: directory).appendingPathComponent("projects-\(Int(width))-\(type).png") |
| + try FileManager.default.createDirectory(at: file.deletingLastPathComponent(), withIntermediateDirectories: true) |
| + try bitmap.representation(using: .png, properties: [:])?.write(to: file) |
| + } |
| + window.contentView = nil |
| + } |
| + } |
| + } |
| +} |
| +#endif |
| + |
| +extension ProjectsTests { |
| + @Test func ownerEditOpensTheEngineProjectPageContainingTheRevisionForm() throws { |
| + let c = catalog(ScriptedTransport()) |
| + let project = try #require(list().items?.first) |
| + #expect(c.detailsURL(project).absoluteString == "https://oficina.example.test/projects/p_star") |
| + } |
| +} |
| + |
| +extension ProjectsTests { |
| + @Test func refusedStarRollsBackOnlyItsFieldDespiteInterveningEvents() async throws { |
| + for sameProject in [false, true] { |
| + let t = ScriptedTransport(); t.on("GET /projects", fixture: "project-list") |
| + let p = try #require(list().items?.first) |
| + t.on("PUT /projects/\(p.id)/star", .success(APIResponse(status: 500, data: Data("{\"code\":\"unavailable\",\"copy_key\":\"api.unavailable\",\"request_id\":\"r\"}".utf8)))) |
| + let transport = ProjectHeldTransport(t, route: "PUT /projects/\(p.id)/star") |
| + let c = ProjectCatalog(client: EquipoClient(transport: transport, token: "fixture"), lifetime: SignInLifetime()) |
| + await c.refresh() |
| + let write = Task { await c.setStar(p, false) }; await transport.wait() |
| + var event = sameProject ? p : try #require(list().items?.last) |
| + event.personalNames = ["a new name"]; event.revision += 1 |
| + // A metadata event can carry the optimistic value on a concurrent server update. |
| + if sameProject { event.starred = false } |
| + c.applyEvent(event, cursor: 20) |
| + await transport.release(); await write.value |
| + #expect(c.projects[p.id]?.starred == p.starred) |
| + #expect(c.projects[event.id]?.personalNames == ["a new name"]) |
| + #expect(c.projects[event.id]?.revision == event.revision) |
| + } |
| + } |
| +} |
diff --git a/native/scripts/check-fixtures.py b/native/scripts/check-fixtures.py| index 60604185..3b71e856 100755 |
| --- a/native/scripts/check-fixtures.py |
| +++ b/native/scripts/check-fixtures.py |
| @@ -18,6 +18,7 @@ root = Path(__file__).resolve().parents[2] |
| spec = json.loads((root / 'docs/api/equipo-v1.openapi.json').read_text()) |
| fixtures = root / 'native/apple/Tests/EquipoKitTests/Fixtures' |
| contracts = { |
| + 'project-typed-answer': 'Answered', 'project-list': 'ProjectList', 'project-card': 'Card', 'project-invalid': 'Error', |
| 'me': 'PersonAPIMe', 'ack': 'Ack', 'device-challenge': 'PersonDeviceChallenge', |
| 'device-credential': 'PersonCredential', 'devices': 'DevicePage', |
| 'error-revision-conflict': 'Error', 'error-pending': 'Error', |
diff --git a/native/scripts/check-parity.py b/native/scripts/check-parity.py| index 1a45bf4a..ffeb96ef 100755 |
| --- a/native/scripts/check-parity.py |
| +++ b/native/scripts/check-parity.py |
| @@ -19,12 +19,12 @@ 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.', 'chat.paste.', 'work.tl.', 'roster.')): |
| + if not key.startswith(('chat.card.', 'chat.paste.', 'work.tl.', 'roster.', 'projects.', 'work.star.', 'api.', 'nav.projects', 'chat.connections.connected', 'counts.unavailable')): |
| continue |
| found = re.findall(r'"' + re.escape(key) + r'":\s*"((?:[^"\\]|\\.)*)"', copy) |
| if len(found) != 1: |
| problems.append(f'{key}: found {len(found)} times in copy.go, expected once'); continue |
| - web = json.loads('"' + found[0] + '"') |
| + web = json.loads('"' + found[0] + '"').replace('%s', '%@') |
| checked += 1 |
| if web != text: |
| problems.append(f'{key}: native says {text!r}, the web says {web!r}') |
diff --git a/native/scripts/strings.json b/native/scripts/strings.json| index 64939a4f..7be7e067 100644 |
| --- a/native/scripts/strings.json |
| +++ b/native/scripts/strings.json |
| @@ -11,6 +11,26 @@ |
| "account.title": "Account", |
| "account.until": "Signed in until", |
| "action.sending": "Sending…", |
| + "api.card_answered": "This card has already been answered. Check the conversation for what happened.", |
| + "api.card_stale": "This item has changed. Check it before trying again.", |
| + "api.confirmation_required": "Confirm the spending limit and check both budget amounts before continuing.", |
| + "api.coordinator_busy": "Your coordinator is working. Wait for its reply, then try again.", |
| + "api.hold_bar": "This work is on hold because of a spending limit or unconfirmed spend. Check the hold, then raise the limit or check provider spend before resuming.", |
| + "api.idempotency_conflict": "The latest details are different. Refresh, check them, then try again.", |
| + "api.invalid_input": "Check the request fields and try again.", |
| + "api.models_not_allowed": "Choose at least one model that this connection can use.", |
| + "api.not_active": "This specialist is no longer active. No action is needed.", |
| + "api.not_askable": "This work no longer has a session you can ask about. Ask in the main conversation.", |
| + "api.not_found": "This item is not available.", |
| + "api.not_mergeable": "This task cannot be merged now. Check its latest status.", |
| + "api.not_retryable": "This work cannot be retried now. Check its latest status.", |
| + "api.question_ended": "This question has ended. Check the result in the task.", |
| + "api.repo_not_allowed": "Your runner can't reach this project's repository. Make sure the repository is available, then try again.", |
| + "api.runner_offline": "Your runner is offline. Reconnect it, then try again.", |
| + "api.task_busy": "This task is still working. Wait for it to finish, then try again.", |
| + "api.task_ended": "This task has ended. Check its result.", |
| + "api.task_merging": "This task is merging. Wait for it to finish.", |
| + "api.turn_ended": "This reply has ended.", |
| "app.name": "Equipo", |
| "byline.asks": "asks", |
| "byline.reports": "reports", |
| @@ -19,6 +39,7 @@ |
| "card.offline": "Couldn’t reach your team. Try again.", |
| "card.open_on_web": "Open in Equipo on the web", |
| "card.question": "Question", |
| + "chat.card.answer": "Answer", |
| "chat.card.merge": "Merge", |
| "chat.card.merge_chose_merge": "Merging without checks.", |
| "chat.card.merge_chose_not_now": "Not now.", |
| @@ -34,6 +55,12 @@ |
| "chat.card.ships_chose_ships": "Merging to main ships to users, so I'll ask before merging without checks.", |
| "chat.card.wait": "Wait for checks", |
| "chat.card.wait_mac": "Wait for a Mac", |
| + "chat.connections.connected": "%@ connected", |
| + "chat.paste.command": "Command", |
| + "chat.paste.copied": "Copied", |
| + "chat.paste.copy": "Copy", |
| + "chat.paste.prompt": "Prompt", |
| + "chat.paste.text": "Text", |
| "checks.cannot_run": "Can’t run here", |
| "checks.exit %@ %@": "%1$@, exit code %2$@", |
| "checks.failed": "Failed", |
| @@ -48,6 +75,7 @@ |
| "composer.send": "Send", |
| "conversation.empty": "Say what you want done. Your coordinator picks the project and tells you, and you can change it.", |
| "conversation.placeholder": "Message", |
| + "counts.unavailable": "Unavailable", |
| "decision.on_web": "For now you make this decision on the web, where its full context is.", |
| "decision.untitled": "A decision", |
| "device.mac": "Mac", |
| @@ -58,10 +86,16 @@ |
| "message.own_spoken %@": "You said: %@", |
| "message.sending": "Sending…", |
| "message.waiting": "Waiting for a connection. Try again.", |
| + "nav.projects": "Projects", |
| "needs.count %lld": "%lld waiting for you", |
| "needs.count_spoken %lld": "%lld waiting for you", |
| "needs.empty": "Questions and decisions for you appear here.", |
| "needs.empty_title": "Nothing needs you", |
| + "oficina.connecting": "Connecting to your team", |
| + "oficina.current_team": "Current team", |
| + "oficina.device_failed": "Could not connect to this team.", |
| + "oficina.retry": "Connect again", |
| + "oficina.sign_in": "Sign in with Oficina ID", |
| "pairing.approve_lede": "Approve this device in your browser. There is no password or token to paste.", |
| "pairing.approved %@": "This device is paired with %@.", |
| "pairing.approved_title": "Paired", |
| @@ -87,6 +121,24 @@ |
| "pairing.welcome_title": "Equipo", |
| "pairing.your_code": "Your code", |
| "project.spoken %@": "Project %@", |
| + "projects.add_reachable": "Add project", |
| + "projects.can_add": "Available to add", |
| + "projects.description": "Description", |
| + "projects.details": "Project details", |
| + "projects.edit": "Edit project", |
| + "projects.empty": "No projects yet.", |
| + "projects.forget_name": "Remove this name", |
| + "projects.name_question": "Which project should this go in? Type the project name or repository.", |
| + "projects.name_to_remember": "Name to remember", |
| + "projects.names": "Names people use", |
| + "projects.new_request": "New request", |
| + "projects.other": "Choose another project", |
| + "projects.personal_names": "Your names for this project", |
| + "projects.remember_name": "Remember '%@' for this project", |
| + "projects.remove_selection": "Remove project", |
| + "projects.selection_lost": "The selected project is no longer available. This request will continue without a project.", |
| + "projects.title": "Title", |
| + "projects.yours": "Your projects", |
| "question.answered %@": "You answered: %@", |
| "question.closed": "This question is no longer open.", |
| "read.failed": "Your team answered, but not with what this screen needs. Try again in a moment.", |
| @@ -161,15 +213,7 @@ |
| "thread.sent": "Sent", |
| "track.position %@ %@": "%1$@ of %2$@", |
| "track.spoken %@": "Stage: %@", |
| - "work.tl.merge_dropped": "An earlier attempt to add this change was dropped when the task became an exploration.", |
| - "oficina.device_failed": "Could not connect to this team.", |
| - "oficina.sign_in": "Sign in with Oficina ID", |
| - "oficina.retry": "Connect again", |
| - "oficina.connecting": "Connecting to your team", |
| - "oficina.current_team": "Current team", |
| - "chat.paste.copy": "Copy", |
| - "chat.paste.copied": "Copied", |
| - "chat.paste.prompt": "Prompt", |
| - "chat.paste.text": "Text", |
| - "chat.paste.command": "Command" |
| + "work.star.add": "Star %@", |
| + "work.star.remove": "Unstar %@", |
| + "work.tl.merge_dropped": "An earlier attempt to add this change was dropped when the task became an exploration." |
| } |
diff --git a/scripts/runner-reference-allowlist.json b/scripts/runner-reference-allowlist.json| index ae534103..567be78f 100644 |
| --- a/scripts/runner-reference-allowlist.json |
| +++ b/scripts/runner-reference-allowlist.json |
| @@ -18254,5 +18254,19 @@ |
| "match": "Node", |
| "count": 1, |
| "reason": "Markdown syntax tree nodes in native rendering and web parity fixtures; no external runtime." |
| + }, |
| + { |
| + "path": "internal/equipo/api_copy_test.go", |
| + "line_sha256": "469749cabd0dfcbaf26ba724860992bb46b9b52b94efd42022a3064fffa2ae1d", |
| + "match": "Node", |
| + "count": 3, |
| + "reason": "Go AST traversal type for the API error copy guard." |
| + }, |
| + { |
| + "path": "internal/equipo/api_copy_test.go", |
| + "line_sha256": "4f2302a30396487a1f1414f2ecd5297abc68bbe2fc305812d072b646c42b2009", |
| + "match": "Node", |
| + "count": 1, |
| + "reason": "Go AST traversal type for the API error copy guard." |
| } |
| ] |