| 1 | # Native Projects, 2026-11-23 |
| 2 | |
| 3 | Branch: native/projects, based on main 198ce406. Implements G11 of the approved |
| 4 | GitHub connector spec using the existing device Projects API. Owner editing |
| 5 | uses the engine project page's revision-bearing web form, as approved by the |
| 6 | controller for this round. |
| 7 | |
| 8 | ## What a person sees |
| 9 | |
| 10 | - iPhone: Projects is a fourth tab. Your projects retain server order, with a |
| 11 | star button, title, repository source and wrapping description. Tapping a row |
| 12 | pushes its details. Available to add appears only with the owner capability. |
| 13 | - Mac: Projects is a sidebar item. The list stays in the middle and the chosen |
| 14 | project's details appear beside it; tasks open in the existing inspector. |
| 15 | - Both show Amadan's reported connection state. Details show team names and |
| 16 | your personal names, each with Remove this name. Owners have Edit project, |
| 17 | which opens the web page containing the current revision's form. |
| 18 | - New request opens Conversation with a removable project chip. Removing the |
| 19 | chip leaves an ordinary message; sending includes project_id in the retained |
| 20 | 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 |
| 21 | while the actual reply keeps streaming in a separate stable row. |
| 22 | - Named placement cards show a checked Remember control and editable name. |
| 23 | Answers explicitly send the edited name or the empty string when unchecked. |
| 24 | Choose another project keeps the card open at its new revision and shows a |
| 25 | text field. A 422 stays inline and leaves that card open. |
| 26 | |
| 27 | ## State and validation |
| 28 | |
| 29 | ProjectCatalog preserves server ordering, corrects optimistic stars with the |
| 30 | server response and applies viewer fields by event sequence even when shared |
| 31 | revisions are equal. A generation protects reads overtaken by writes/events; |
| 32 | reconnect snapshots carry viewer fields too. Catalog flows retain the signed-in |
| 33 | session lifetime. The native feed now reads reply_id so an intermediate project |
| 34 | notice neither suppresses deltas nor shares the completed reply's identity. |
| 35 | The Mac retains a placement card's hosting view and remeasures only that row. |
| 36 | |
| 37 | Four new API response fixtures (catalog, card, typed answer and invalid-input |
| 38 | error) are checked against OpenAPI. ScriptedTransport covers routes, bodies, |
| 39 | bearers, optimistic state, corrections, personal names, lifecycle, event order, |
| 40 | write/read races, project request retries, explicit opt-out, typed-card revision |
| 41 | changes and inline refusals. The existing streaming test now sets the actual |
| 42 | server reply_id when completing its synthetic turn. |
| 43 | |
| 44 | Validation completed: |
| 45 | |
| 46 | - native/scripts/check-native.sh: passed. 184 tests in 21 suites; one existing |
| 47 | known Oficina renewal issue, permissionRefusalDuringHomeOutageKeepsTheKitSession. |
| 48 | Mac and unsigned iOS Simulator builds passed. Strings, parity, fixtures, |
| 49 | sign-in checks and the reference scan passed. Existing Markdown comparison: |
| 50 | 3,586 goldens plus 32,000 seeded inputs, zero mismatches. |
| 51 | - Go: internal/equipo tests, TestPlan3ReleaseBoundaries, TestNativeFixtures, |
| 52 | vet, staticcheck v0.7.0, fmt-check and go mod tidy -diff passed. |
| 53 | - A wider internal/plan3test run failed TestCoordinatorAcceptance3B/onboarding_to_plan |
| 54 | with provider_uncertain. The same isolated test fails on unchanged main |
| 55 | 198ce406 in the release checkout, recorded in go-onboarding-main.log. |
| 56 | - Host layout checks cover 390 and 760 point widths and accessibility3 type. |
| 57 | The narrow standard-type capture shows the full project summary, removable |
| 58 | chip, wrapping question, checked remember control, editable name and typed |
| 59 | answer field. These are shared SwiftUI host captures, not physical-device |
| 60 | screenshots. Local captures are in ignored native/build/project-screenshots. |
| 61 | |
| 62 | Tests were written first. Initial failures and subsequent mutation logs are |
| 63 | under ignored native/build/logs. Every mutation below failed its targeted |
| 64 | regression and was restored before the gate: |
| 65 | |
| 66 | - owner-capability |
| 67 | - server-order |
| 68 | - viewer-sequence |
| 69 | - stale-list |
| 70 | - optimistic-star |
| 71 | - star-rollback |
| 72 | - personal-name-delete |
| 73 | - departed-read |
| 74 | - message-project: serializer omission only; this did not exercise the task-thread guard or composer chip clearing. |
| 75 | - explicit-opt-out: serializer omission of an empty name only; this did not exercise the checkbox action. |
| 76 | - card-revision |
| 77 | - server-inline-notice |
| 78 | - notice-keeps-stream |
| 79 | - notice-row-identity |
| 80 | - mac-card-host |
| 81 | - snapshot-viewer-fields |
| 82 | - snapshot-write-generation |
| 83 | - project-event-decoding |
| 84 | - owner-web-form |
| 85 | - API copy omission |
| 86 | - New HTTP error without copy |
| 87 | |
| 88 | ## Copy |
| 89 | |
| 90 | Twenty genuinely new canonical strings have Luna's delegated review: the two |
| 91 | Projects controls below and 18 API errors. The API copy repair is kept in its |
| 92 | own commit; native/API-COPY-REVIEW.md contains the exact briefs and verdicts. |
| 93 | provider_error was a tool-result code, not an HTTP copy key, and was excluded |
| 94 | by correcting scan scope rather than adding an omission exception. |
| 95 | |
| 96 | All newly imported native entries (web %s becomes Swift %@ with parity checking): |
| 97 | |
| 98 | - `api.card_answered`: This card has already been answered. Check the conversation for what happened. |
| 99 | - `api.card_stale`: This item has changed. Check it before trying again. |
| 100 | - `api.confirmation_required`: Confirm the spending limit and check both budget amounts before continuing. |
| 101 | - `api.coordinator_busy`: Your coordinator is working. Wait for its reply, then try again. |
| 102 | - `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. |
| 103 | - `api.idempotency_conflict`: The latest details are different. Refresh, check them, then try again. |
| 104 | - `api.invalid_input`: Check the request fields and try again. |
| 105 | - `api.models_not_allowed`: Choose at least one model that this connection can use. |
| 106 | - `api.not_active`: This specialist is no longer active. No action is needed. |
| 107 | - `api.not_askable`: This work no longer has a session you can ask about. Ask in the main conversation. |
| 108 | - `api.not_found`: This item is not available. |
| 109 | - `api.not_mergeable`: This task cannot be merged now. Check its latest status. |
| 110 | - `api.not_retryable`: This work cannot be retried now. Check its latest status. |
| 111 | - `api.question_ended`: This question has ended. Check the result in the task. |
| 112 | - `api.repo_not_allowed`: Your runner can't reach this project's repository. Make sure the repository is available, then try again. |
| 113 | - `api.runner_offline`: Your runner is offline. Reconnect it, then try again. |
| 114 | - `api.task_busy`: This task is still working. Wait for it to finish, then try again. |
| 115 | - `api.task_ended`: This task has ended. Check its result. |
| 116 | - `api.task_merging`: This task is merging. Wait for it to finish. |
| 117 | - `api.turn_ended`: This reply has ended. |
| 118 | - `chat.card.answer`: Answer |
| 119 | - `chat.connections.connected`: %@ connected |
| 120 | - `counts.unavailable`: Unavailable |
| 121 | - `nav.projects`: Projects |
| 122 | - `projects.add_reachable`: Add project |
| 123 | - `projects.can_add`: Available to add |
| 124 | - `projects.description`: Description |
| 125 | - `projects.details`: Project details |
| 126 | - `projects.edit`: Edit project |
| 127 | - `projects.empty`: No projects yet. |
| 128 | - `projects.forget_name`: Remove this name |
| 129 | - `projects.name_question`: Which project should this go in? Type the project name or repository. |
| 130 | - `projects.name_to_remember`: Name to remember |
| 131 | - `projects.names`: Names people use |
| 132 | - `projects.new_request`: New request |
| 133 | - `projects.other`: Choose another project |
| 134 | - `projects.personal_names`: Your names for this project |
| 135 | - `projects.remember_name`: Remember '%@' for this project |
| 136 | - `projects.remove_selection`: Remove project |
| 137 | - `projects.selection_lost`: The selected project is no longer available. This request will continue without a project. |
| 138 | - `projects.title`: Title |
| 139 | - `projects.yours`: Your projects |
| 140 | - `work.star.add`: Star %@ |
| 141 | - `work.star.remove`: Unstar %@ |
| 142 | |
| 143 | ## Luna brief for Projects controls |
| 144 | |
| 145 | # Copy review brief: Equipo native Projects, new strings (2026-11-23) |
| 146 | |
| 147 | Paul delegates copy review to you; your edits will be applied as approved copy. |
| 148 | Context: Equipo's iPhone and Mac apps get a Projects screen (code repositories). |
| 149 | From a project you can start a request; the message composer then shows a small |
| 150 | removable "chip" naming the project, so the request goes to that project. |
| 151 | |
| 152 | ## Strings (ids fixed, text yours) |
| 153 | - `projects.new_request`: button on a project, opens the composer with that project selected. Draft: `New request` |
| 154 | - `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` |
| 155 | |
| 156 | ## House rules (Paul's, binding) |
| 157 | No em dashes, no exclamation marks. Plain words, short, sentence case. Say what |
| 158 | it does. Don't change facts; flag what looks wrong. |
| 159 | |
| 160 | ## Output |
| 161 | 1. Table: `id | current | new (or "unchanged") | why`. |
| 162 | 2. Flagged rows: `id | problem`. |
| 163 | 3. Counts. |
| 164 | |
| 165 | ## Luna result for Projects controls |
| 166 | |
| 167 | | id | current | new | why | |
| 168 | |---|---|---|---| |
| 169 | | `projects.new_request` | New request | unchanged | Short, clear button label | |
| 170 | | `projects.remove_selection` | Remove project selection | Remove project | More direct and matches the action | |
| 171 | |
| 172 | Flagged rows: |
| 173 | |
| 174 | | id | problem | |
| 175 | |---|---| |
| 176 | | `projects.remove_selection` | “Selection” is abstract. The action removes the project from the message, not just a selection state. | |
| 177 | |
| 178 | Counts: 2 reviewed, 1 changed, 1 unchanged, 1 flagged. |
| 179 | |
| 180 | ## CI size accounting |
| 181 | |
| 182 | CI at 0277df46 caught the existing exact size exemptions: canonical copy grew |
| 183 | by 20 source lines (18 reviewed API errors and two Projects labels), and the |
| 184 | review acceptance lists grew by two test lines. Updated only those measured |
| 185 | limits to 22,074 and 11,896, with specific reasons in .rastrillo/budgets.txt. |
| 186 | Copy must remain in copy.go under the repository contract. No test or behavior |
| 187 | was removed. The original limits fail the size gate; the measured limits pass |
| 188 | make budget and TestBudgetRecordsAreShort. All native code is unchanged from |
| 189 | the passing native gate. |
| 190 | |
| 191 | |
| 192 | ## Review fixes after e7419bf8 |
| 193 | |
| 194 | No strings were added or changed in this follow-up. The separate API copy |
| 195 | commit contains **18** strings, not 19; the two Projects controls make 20 new |
| 196 | canonical strings across the original branch. |
| 197 | |
| 198 | - **Question routing:** the server now exposes its existing `placementData.ByName` |
| 199 | marker as optional `placement_by_name`. An opted-out typed card can have no |
| 200 | `remember_name`, so that suggestion alone cannot identify it. SwiftUI uses |
| 201 | the marker for the field label. Ordinary questions use Answer and remain on |
| 202 | the Mac AppKit card, now with an Answer field and button. |
| 203 | - **Send failure notices:** only a known server copy key produces an extra |
| 204 | notice. Offline and unrecognised 500 errors retain the existing waiting or |
| 205 | failed send status, with and without a project. |
| 206 | - **Actual actions:** both composers use the tested selection-consuming action; |
| 207 | the phone closure and Mac onSend are checked. Question controls use the tested |
| 208 | per-card answer draft, which sends an explicit empty name when unticked. |
| 209 | The session's task-thread guard is tested at the transport request. |
| 210 | - **Removed projects:** a dropped list item or removal event clears the composer |
| 211 | chip with the accepted selection-lost notice. A definitive 404 clears the |
| 212 | outgoing project's association; Retry creates a fresh idempotency key and |
| 213 | omits project_id. A 422 retains its original project and retry body. |
| 214 | - **Star refusal:** rollback restores only that project's star field, even if |
| 215 | another project or metadata event arrived during the write. New names and |
| 216 | revisions survive the rollback. |
| 217 | - **Card revisions:** edits and the remember choice belong to the card identity |
| 218 | in the session. The Mac host uses the card ID, not its revision, as identity. |
| 219 | - **List/event ordering:** the server reads a new required list cursor in the |
| 220 | same transaction as the project items. Native rejects events and snapshots |
| 221 | older than that watermark, including events for absent projects. Wire, |
| 222 | OpenAPI, documentation and fixtures describe the additive fields. |
| 223 | - **Copy guard:** AST traversal covers all internal packages, including wiring. |
| 224 | go/types resolves lexical bindings; assignments and concatenations are |
| 225 | followed to WriteError and error-body CopyKey fields. Unknown dynamic values |
| 226 | fail the guard. Tests cover variable codes, wiring, literal and variable |
| 227 | CopyKey bodies, aliases, branches, and the unrelated tool-result false positive. |
| 228 | - **Mac composer:** the chip is hosted above the composer and reserves zero |
| 229 | height when absent. Selection changes are explicit representable inputs. |
| 230 | - **Roster styling:** project actions use RosterButton. The remember checkbox |
| 231 | and typed fields use Roster controls, system text sizes and the existing |
| 232 | palette. No system prominent button or rounded-border field remains there. |
| 233 | |
| 234 | Review regressions were added before implementation. New API seams initially |
| 235 | failed compilation; the extra variable-CopyKey test failed with a missed key. |
| 236 | All deliberately broken guards below failed their targeted tests and were |
| 237 | restored. Commands: `swift test --package-path native/apple --filter <test>` |
| 238 | and `GOTOOLCHAIN=go1.26.11 CGO_ENABLED=0 go test <package> -run <test> -count=1`. |
| 239 | The scripts and complete failure logs are under ignored native/build/logs: |
| 240 | |
| 241 | - question-marker; phone-question-label; mac-question-routing |
| 242 | - send-fallback (offline, 500, known key, each with/without a project) |
| 243 | - actual-opt-out; composer-clear-both (both platform tests fail); task-thread-project |
| 244 | - selection-removal (list and event); gone-project-retry |
| 245 | - star-intervening-event (same and different project); revision-resets-draft |
| 246 | - list-watermark (older viewer event, snapshot and absent-project replay) |
| 247 | - chip-placement; roster-control |
| 248 | - copy-variable; copy-wiring; copy-literal; copy-variable-body; server-marker; server-cursor |
| 249 | |
| 250 | The earlier mutation names above have been corrected: those two initial tests |
| 251 | covered serializers. They did not prove that a control passed the right value. |
| 252 | |
| 253 | The interface remains the existing Projects tab on iPhone and sidebar item on |
| 254 | Mac. At phone width, the project title, description, remember label and fields |
| 255 | wrap with Dynamic Type. On Mac the project chip is immediately above the input; |
| 256 | ordinary Answer cards use AppKit and placement cards retain their SwiftUI host. |
| 257 | No physical-device screenshot is claimed. |
| 258 | |
| 259 | |
| 260 | Follow-up validation: native/scripts/check-native.sh passed with 194 tests in |
| 261 | 22 suites and the same known Oficina renewal issue. Mac and unsigned iOS |
| 262 | Simulator builds passed; 217 strings and 72 parity entries are unchanged. |
| 263 | All 20 review mutations were caught (14 Swift, six Go), including both actual |
| 264 | composer paths. Go package tests for equipo, chat, personapi and wire, the |
| 265 | person API/device contracts, release boundaries and native fixtures passed. |
| 266 | Vet, staticcheck v0.7.0, fmt-check, module tidiness and size budgets passed. |
| 267 | The typed marker and list cursor add five chat source lines and two wire source |
| 268 | lines; their 51-line server regression is accounted for in measured budgets. |
| 269 | The 390-point normal-size SwiftUI host capture was inspected. Accessibility |
| 270 | sizes were checked for layout; those hidden-host images did not render reliably. |
| 271 | |
| 272 | ## Main merge and final P3 follow-up |
| 273 | |
| 274 | Merged origin/main a697cde9 into native/projects after Fable approved a37ce08a. |
| 275 | The three conflicted files were resolved as follows: |
| 276 | |
| 277 | - `.rastrillo/budgets.txt`: combined the native Projects/API copy and new |
| 278 | Engineering stop-reason additions. Combined measured caps are 22101 source |
| 279 | lines for equipo, 6828 for wire, and 11898 test lines for plan3test. |
| 280 | - `docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md`: retained both appended |
| 281 | acceptance inventories, including all native/API strings and main's two |
| 282 | Engineering stop-reason strings, with their existing review markers. |
| 283 | - `internal/plan3test/plan3_release_test.go`: retained the native/API acceptance |
| 284 | predicates and main's approvedStopReasons predicate in the release guard. |
| 285 | |
| 286 | The merge's copy-release regression and size gate pass. Main's stop-reason |
| 287 | implementation, tests and CI lane changes were retained by the automatic merge. |
| 288 | |
| 289 | P3 selection notice: the next composer send consumes the selection and its |
| 290 | notice together, including an ordinary send that goes offline. The regression |
| 291 | `nextComposerSendClearsReleasedSelectionNotice` failed before the fix, passed |
| 292 | after it, and failed again when notice clearing was deliberately removed. |
| 293 | Both existing platform composer tests also pass. |
| 294 | |
| 295 | P3 404 scope: only a decoded Equipo not_found/api.not_found 404 for a |
| 296 | conversation body with a nonempty project_id releases the project. Native |
| 297 | conversation sends reference no other resource; task-thread sends are excluded. |
| 298 | A seven-case regression covers genuine project loss, other codes, foreign copy |
| 299 | keys, plain HTTP 404s, another status, no project, and task threads. It failed |
| 300 | first, passed after the fix, and caught separate code and copy-key mutations. |
| 301 | Unrelated failures retain the original retry body and key. |
| 302 | |
| 303 | P3 ordinary Mac question: QuestionAnswerField stores every text edit in the |
| 304 | card's existing draft. Return and the Answer button share its submit action. |
| 305 | The regression types through the actual field delegate, changes the transcript |
| 306 | width to replace the row, checks the restored text, and sends Return through |
| 307 | the replacement field's delegate. It verifies the answer text and revision on |
| 308 | the transport. The initial implementation failed all four boundaries; live |
| 309 | edit and Return mutations each fail after the fix. |
| 310 | |
| 311 | P3 raw-map copy guard: the scan now recognises a copy_key field in a raw map, |
| 312 | including a constant map key and a variable copy value. Dynamic values fail |
| 313 | closed instead of escaping review. Three missing-key cases and a dynamic-value |
| 314 | case failed first and pass now. Disabling raw-map recognition makes all four |
| 315 | regressions fail. The existing variable, wiring, typed-body and tool-result |
| 316 | scope regressions remain green. |
| 317 | |
| 318 | P3 checkbox accessibility: the custom visual control now supplies an explicit |
| 319 | native Toggle accessibility representation, bound to the same value, without |
| 320 | the selected-button trait. A shared-source guard failed before the change and |
| 321 | passes afterward; substituting a Button representation makes it fail again. |
| 322 | The Mac runtime regression checks checkbox role, accepted label, checked value, |
| 323 | activation and unchecked value. Mac already inherited checkbox semantics from |
| 324 | the outer Toggle before this change, so that runtime test was green initially; |
| 325 | the source guard pins the explicit representation used on both platforms. |
| 326 | No new copy was introduced. |
| 327 | |
| 328 | Validation for the five final P3s: |
| 329 | |
| 330 | - `swift test --package-path native/apple --filter ProjectsAccessibilityTests` |
| 331 | and the targeted notice, 404, Mac draft and API-copy tests pass. Seven |
| 332 | deliberate mutations were caught: notice clear, 404 code, 404 copy key, |
| 333 | live Mac edit, Return submit, raw-map recognition and toggle representation. |
| 334 | - `native/scripts/check-native.sh` passes: 199 tests in 24 suites, the existing |
| 335 | known Oficina renewal issue, both app builds, 11 API fixtures, 3,586 Markdown |
| 336 | goldens, 32,000 differential inputs, 217 strings and 72 parity entries. |
| 337 | - Pinned Go 1.26.11 with CGO disabled: equipo, chat, personapi and wire tests, |
| 338 | the API/release contracts and merged runner stop-reason regressions pass. |
| 339 | Formatting, size budgets, Linux-target vet, scoped staticcheck v0.7.0, |
| 340 | lane coverage and the copy-release gate pass. |
| 341 | - The unrestricted Mac Go invocation cannot build headless: toolproxy uses |
| 342 | Linux's unix.O_PATH. Linux-target vet passes; Linux CI is the headless gate. |
| 343 | |