# Projects up front: G12 Amadan slice

Branch: `projects/up-front`. Base: `3ef3ec85`. This report belongs to the
commit containing it; the final SHA and Linux CI verdict are reported after
push. The controller will assign the code review against that fixed SHA.
No merge, deployment, main push or GitHub integration is included.

## What a person sees

The Projects page has a filter, Your projects with personal stars first,
and Available to add grouped under Amadan. Rows show the repository key,
forge, description and existing activity. Owners can add reachable projects
and edit a project's title, description and shared names. Learned names are
private to the person who answered a placement card. Existing task, star,
activity and quiet-project presentation remains available.

Every Coordinator dispatch, including retries and job-thread Coordinator
turns, receives a fresh block of up to 30 projects, starred then recently
active. Its JSON rows quote and label bounded, redacted metadata; repository
names and descriptions cannot determine placement. PersonText remains the
person's original words.

Exact trusted names, owner-set titles and repository identities share one
code resolver for find, stars and task placement. An unknown or ambiguous
name raises one placement card with code-built reachable active projects,
starred first. Repeated find calls reuse the open card. A person's answer
learns the phrase only if it appeared in their composer message, only for
them, and replaces their previous meaning of that phrase. Repository-only
matches remain quoted reference data. With no active reachable project to
choose, the tool refuses instead of inventing a choice. Explicit repository
keys outside the allowlist keep the existing access-request flow.

## Device follow-up

- GET /api/v1/projects retains items, allowed and home, and adds connections
  and can_add. Project rows add starred, names, personal_names, title_source,
  description_source, forge and connection_id. The connection is amadan;
  its state reflects the stored primary-runner hello, not live connectivity.
- PUT /api/v1/projects/{id}/star accepts {"starred":true/false}, checks current
  membership, changes only that person's star and returns the project. It
  needs no revision or idempotency key; repeating the value is safe.
- PUT /api/v1/projects/{id}/details accepts revision, title, description and
  names, for current team owners only. A stale revision returns 409
  idempotency_conflict. Limits are title 120 bytes, description 500 bytes,
  and 12 names of 120 bytes each, with valid UTF-8 and no newline or NUL.
- SendMessage gains optional project_id on POST /api/v1/messages. Returned
  messages and history retain it. The project must be active and reachable.
  Unknown is 404; unreachable is 422 repo_not_allowed; reuse of an
  idempotency key with a different project is 409 idempotency_conflict.
  Selected-project messages get separate turns and bind task writes.
- The Assistant send rejects project_id. SendJob rejects it too, but has no
  device API route. Its web form does not bind the field.
- docs/api/equipo-v1.md and the OpenAPI document describe the additions.
  Existing native fixtures still pass. Native screens and project chips
  are the controller's follow-up work, not implemented in this server slice.

Migration 0100 is additive: project metadata provenance and description,
message project_id, and chat_project_names. Names have project/person/name
keys; an empty person is a team name. Project writes use the transaction
handle, current roster and audit. Personal metadata is stripped from shared
project events.

## Tests and guard mutations

Tests were written first. Initial failures included undefined metadata and
wire APIs, a missing ProjectID in the returned message, missing Available to
add/filter UI, and a repeated ambiguity after answering. The last added
contract exposed repository-supplied names deciding find before any project
was added, plus an unquoted catalog description. Both paths are now guarded.

The mutation evidence is in
[2026-11-22-projects-up-front-mutations.md](2026-11-22-projects-up-front-mutations.md).
Each used a temporary Go overlay with Go 1.26.11 and CGO_ENABLED=0, observed
the intended assertion fail, then removed the overlay. The 24 mutations:
owner, roster-edit, revision, private-name, repository-title, ambiguity,
remembered-choice, ask-once, typed-name, selected-reach, selected-active,
replay-project, placement-bind, block-limit, block-redaction, block-quote,
star-roster, event-private, empty-projects-resolution, catalog-redaction,
owner-add, owner-restore, repository-case, fake-reference-steering.
The add-owner mutation first passed because the public Store entry point
already checks the owner. The final contract calls the internal helper to
exercise its added guard independently. The first typed-name attempt did not compile because it made a variable
unused; that was not counted. Its corrected overlay failed the intended
assertion, as recorded.

Existing envelope tests still assert the original exact text after a helper
validates and removes the appended JSON project block. New dispatch contracts
assert the block is actually present and updates after owner metadata edits.
Existing explicit access tests now use repository keys; unknown product
names exercise placement in the new contracts. No hosted-CI, merge or forge
behavior was changed.

Required local gates use GOTOOLCHAIN=go1.26.11 CGO_ENABLED=0 and pinned gofmt:

- make fmt-check gitleaks: pass; gitleaks scanned 1089 commits with no leaks.
- make budget migration-check copy-release-check lanes-check: pass.
- go test ./internal/equipo ./internal/equipo/chat ./internal/thintest
  ./internal/wire/... -count=1: equipo 41.181s, wire 0.411s and wireschema
  0.711s pass. The final chat/thintest rerun passes in 2.625s/154.717s.
- go test ./internal/plan3test -run 'TestPersonAPI|TestPlan3Release' -count=1:
  pass, 20.232 seconds. TestPlan3Release passed again in 5.646s after the
  final reviewed API text was copied into the inventory.
- python3 native/scripts/check-fixtures.py: seven fixtures pass.
- git diff --check: pass.

Size budgets were raised only to measured values: equipo 22027 source,
chat 32946 source, wire 6814 source, plan3test 11893 test, thintest 33513 test
lines. Reasons are on the corresponding budget rows. Linux CI remains the
release gate; the requested macOS scope does not include the known
internal/toolproxy vet/staticcheck limitations or a full make test.

## Copy and API clarification record

All 13 new runtime keys were initially marked pending with copy-status.py.
Per the controller's explicit delegation instruction, Luna's exact verdicts
were then applied with COPY ACCEPTED BY DELEGATION (Luna, 2026-11-22), matching
main's agent-access precedent. Engineering did not invoke copy-status.py
accept. The exact acceptedProjects allowlist includes only these 13 keys and
the reviewed API section; other rows retain their existing status.

The new keys and short strings are:

- projects.amadan: Amadan
- projects.yours: Your projects
- projects.can_add: Available to add
- projects.add_reachable: Add project
- projects.names: Names people use
- projects.names_hint: Separate names with commas. These names are shared with the team.
- projects.details: Project details
- projects.title: Title
- projects.description: Description
- projects.save: Save details
- projects.context: the reviewed project-block instruction, exactly in copy.go.
- projects.found: Amadan project %s. Quoted project metadata: %s
- projects.selected: The person selected project %s for this request. Use that repository without asking where it goes.

No additional runtime copy keys were added after Luna's review. The evidence
[2026-11-22-projects-up-front-copy.md](2026-11-22-projects-up-front-copy.md)
contains brief.md, result.md, brief2.md and result2.md verbatim.

The API section matched brief2.md exactly before applying result2.md. Fields,
paths, status codes and limits agree with the implementation. Exactly five
factual clarifications were applied to Luna's revised section:

1. Defined primary runner as the newest enrolled primary not revoked or
   marked for removal, with execution requiring an active team owner;
   defined hello as its stored repository and capability report.
2. Scoped owner to this Equipo team.
3. Named POST /api/v1/assistant/messages and the job-thread Store operation's
   web route POST /jobs/{id}/messages; stated there is no device job route.
   The Store rejects project_id; the web form does not bind that field.
4. Defined repository keys as amadan.net/owner/name, also accepted as owner/name.
5. Changed All writes to All project writes described here for the roster
   sentence.

## Decisions and follow-up

No product decision is requested. Native Projects screens and the removable
composer chip can follow this wire contract. The controller assigns code
review after a green fixed SHA. Paul lands the branch.

## First Linux CI run and corrections

1251de8e failed four check shards: headless scenarios, two browser suites,
and staticcheck. The fake Coordinator treated the appended project block
as fixture commands and a second message. That changed exact creation
commands and appended text after a markdown closing fence. A new failing
fake process contract reproduced both steering and reply corruption. The
fake now excludes reference data from its fixture-command parser and
message count, while retaining the full prompt in its transcript. The
contract passes; breaking that exclusion fails it again.

Headless index/access scenarios now name explicit repositories, matching
the product-name versus repository-key distinction already covered by the
chat and thin-client contracts. Staticcheck found the old filterAbove
constant unused because filtering is now always available; it was removed.
This reduced equipo's measured source budget to 22027. No runtime copy was
added or changed.

The webread timeout failed once under load, passed its CI retry, and was not
a failing shard. It was left unchanged. On macOS, the affected headless and
browser compile stops at the documented internal/toolproxy unix.O_PATH
limitation, so the next Linux CI run verifies those paths. Local fakeclaude
passes (0.339s), the affected equipo contracts pass (3.026s), and formatting,
budget, copy-release and lane checks pass. The post-commit reference scan
and push are repeated for the correction commit.


## Independent review follow-up

Fable reviewed 1251de8e; these fixes build on 62e1977e. No GitHub implementation, merge or deployment.

- P1.1: `add_project` and `record_task` return an owner-required tool result when a member cannot create or restore a project. Store.Apply frame regressions prove the runner remains valid. Status no longer advertises `can_add` to a member.
- P1.2: Dispatch and tools release a selected project that was removed or became unreachable. A durable, single Coordinator notice records the release. The original `project_id` stays in history and the idempotency comparison. Runner contract tests cover removal and changed hello while another reply is active, retaining that reply and dispatching later turns. A released selection never silently rebinds when reachability returns.
- P2.3: An unknown task passes the selected-project placement check so `start_task` can return its ordinary refusal.
- P2.4: Unknown-name placement from `find` requires a person turn and an explicit work request naming a project. Move-in, explore and feature searches use discovery behavior without a placement card.
- P2.5: Named cards cap repository candidates at five and labels at 80 bytes, with a sixth another-project action when needed. Stars lead, then name similarity and recent activity. Another-project keeps the same card open for a typed exact name or repository; no turn is sent until it resolves.
- P2.6: A unique trusted match wins over a personal name. Learned names resolve zero or multiple trusted matches. Device `DELETE /api/v1/projects/{id}/names` and the web project page remove only the authenticated person's learned name.
- P2.7: Added direct regressions for all eight listed surviving guards and deliberately mutated each. Detailed failing assertions are in the mutations evidence file.
- P3 name learning: The person must have used the literal name in naming/placement language; names have at least three characters, stopwords and ordinary feature phrases are excluded, source capitalization or explicit quotation is required, and a model's partial proper name is rejected. Unicode matching preserves source text.
- P3 trailing comma: Blank trimmed entries in the names input are ignored.
- P3 provenance: Title and description retain their own provenance. A names-only edit cannot bless unchanged repository text. Additive migration 0101 copies existing provenance into separate fields.
- P3 stars: Project events build a view for each recipient, and snapshots use the authenticated viewer, including their star and private names.

The API docs and generated OpenAPI include the private-name removal body and route. All seven native fixture shapes still match. The another-project answer returns the updated open card and zero-value message/turn fields; native clients should render the updated card and wait for a valid text answer.

The six runtime strings are exactly Luna's approved text: `projects.owner_add`, `projects.selection_lost`, `projects.other`, `projects.name_question`, `projects.personal_names`, `projects.forget_name`. No additional runtime keys were added. They were marked pending with copy-status, then received only the controller-authorized Luna markers and exact acceptedProjects entries. `copy-status.py accept` was not invoked.

Luna's API revision and its six factual clarifications are recorded verbatim in the copy evidence. The two ownership checks use the same current team-owner role; matching Amadan connection/forge values are intentional; reachability uses one stored hello; displayed-value comparison uses the server's current project view; person and move-in turns are defined; and only the original requested name is saved after a valid final choice. No behavior was added to resolve the copy flags.

An existing thintest fixture had relied on saving an unchanged repository title to bless it. It now adds an explicit owner-set team name instead, consistent with P3. The full run's other packages passed before this fixture adjustment.

Size caps were raised only to rastrillo's measured values: equipo 22041, chat 33211, wire 6819 source lines; thintest 33631 test lines. Each budget entry gives the corresponding implementation or regression reason.


Final focused checks also cover the persisted text-entry card, the person's literal typed name in history, Unicode source matching, whole proper names, common stopwords, and a new project event revision when removing a private name. Repeating removal leaves the revision unchanged. The final mutation series contains 37 killed mutations, including all eight Fable listed; every mutant was restored before the final suites.


Final local gates: pinned gofmt/fmt-check, migration-check, copy-release-check, lanes-check, measured size budget, TestPersonAPI and all seven native fixtures passed. The full package suites and gitleaks are recorded after completion in the final controller message, together with the committed SHA, post-commit reference scan, push-helper outcome and Linux CI verdict.


The final full Equipo suite passed in 88.108s and chat in 13.665s under concurrent local load. TestPlan3Release passed in 18.359s; TestPersonAPI in 31.252s. Gitleaks scanned 1091 commits with no leaks. Thintest and the final wire suites finish before commit.


The final combined run passed wire (0.571s) and wireschema (1.144s). Thintest's project regressions passed, but its existing TestContractTransferTooLarge hit a 45-second send_pack deadline under concurrent host load. The isolated retry passed in 5.310s without code changes; a fresh full thintest run follows. No timeout or test expectation was weakened.


The fresh full thintest suite passed in 225.975s. A final boundary regression proved that a trailing blank must not consume one of the 12 names: blank filtering now precedes the limit, while 13 real names still fail. Its limit guard was also mutated and killed. The final chat suite and focused project device/web contracts run after that adjustment; CI verifies the committed tree on Linux.


Final adjustment verification passed: full chat suite 23.290s; focused project device/web and Coordinator-star contracts 11.031s. Formatting and the final measured budget passed. Final chat cap is 33211 source lines. There are no outstanding copy or product decisions. Commit, reference scan, helper push and Linux CI results are reported with the fixed SHA.


## Linux CI on 0dba1b74

Preparation, copy review and compilation passed. 28 of 29 check shards passed, including the full Equipo/chat/thintest suites, staticcheck, vet, budgets, migrations, native/API checks, gitleaks and reference scan. Headless `TestHeadless/2_find` failed twice because its earlier 62e fixture queried `oficina/sample` but still expected `calls itself Woodstar`. The catalog correctly returned `calls itself sample` for that query. With the reviewed discovery behavior restored, the fixture now queries `Woodstar` again; its quoted-reference, code-read and no-placement-question assertions remain. No production behavior or copy changed. This fixture is Linux-only because the Mac build stops at `internal/toolproxy`'s `unix.O_PATH`; the following Linux CI run is its runtime gate.
