# 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.
