Public: anyone can read this; the crew can change it.

A repository can have contributors: they read it, enter its app and ask its crew, and the week's cap holds their runs #16357

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

The first half of working with others on an app (the owner: "i want to start working with others on apps... collaboration should feel native"): the role and the rules it is held to. The doors that grant it (Talk's invite, the one-use link, the terminal) follow in the next pull, stacked on this one.

Notes

shipped production is serving it deploy 3fede26

opened this

The first half of working with others on an app (the owner: "i want to start working with others on apps... collaboration should feel native"): the role and the rules it is held to. The doors that grant it (Talk's invite, the one-use link, the terminal) follow in the next pull, stacked on this one.

  • A contributor (repo_contributor, migration 20261124234131, additive; its rows go with the person or the repository; the same migration adds invite.repo_id for the link the next pull mints):
    • reads the repository: canRead, and REPO_VISIBLE so every listing agrees (readableRepoIds);
    • enters its app and previews: canEnterApp and enterableApps. A contributor never gets the app's terminal (named: false refuses them);
    • directs its crew: mayDirectCrew, and assignIssue lets them hand an issue to an agent on the crew and nothing else (no person, no unassigning), on the owner's allowance (their own run_crew is not read);
    • merges nothing, changes no setting, and sees no variable, webhook or other repository. Every check reads the row on the request, so taking someone off is at once.
  • Money: an outsider's run no longer passes the weekly cap; only writers' runs do. In crew/dispatch.ts a run is sent (past the week's cap) only when the person asking writes the repository, so a contributor's run and an outsider's (crewOutsiders) wait at the cap with the week's sentence, as the crew's own work does. Before, any person's own request passed it.
  • A new contributor hears it on the notice path (contributorLines in crew/notify.ts), once, with a link to their Talk on the app.

test/invite-contributors.test.ts, with a stand-in crew:

  • ben, made a contributor: reads, enters the app, never its terminal, directs the crew, is in the readable listing, and his notice line links his Talk;
  • ben walks every Talk tool with ten argument shapes, and nothing answers a marker planted in another private repository, an app variable's name or a webhook (the same walk as alice finds the repository's in six tools); the settings, hooks and variables pages show him neither;
  • dave, taken off: his next page is 404, he reads, directs and tells nothing;
  • money: ben's tell in his own request is not sent and waits at 95% of 90% with the week's sentence; an outsider's run (carol, a member, on a public repository with outsiders on) is not sent and waits at the cap while the owner's is sent. Both fail without the writers-only rule.

Try: on a public app with outsiders on and the crew past its weekly share, tell it a change from Talk as someone who cannot write: the run waits with the week's sentence, while the owner's own tell starts No door: the doors that grant the role (Talk and MCP invite, the /join link, the terminal's W) are the next pull, stacked on this one; this pull adds no tool, page or screen Direction: the owner's ask, collaboration on apps (Talk first, #10262), ahead of #6534

Co-Authored-By: Claude Fable 5 <[email protected]>

--- The owner, 2026-11-24: "i want to start working with others on apps. that should be encouraged… collaboration should feel native". Part A of two: the role and its rules, with no door; part B (the invite tool, the join link, the terminal screen) follows on top. One commit.

For the reviewer, since this changes who may read, enter and direct: please check each of canRead, REPO_VISIBLE, canEnterApp, enterableApps and mayDirectCrew against the tests, that a contributor never gets the app's terminal or anything outside the repository, and that a contributor's and an outsider's runs stay under the weekly cap.

🤖 Generated with Claude Code

3 earlier comments · 2 events
commented

Steward note: new head ccb42e85 with a stronger leak walk: the test first walks every Talk tool as the owner and requires two planted markers to appear (another private repository; the owner's subscription by name, which usage returns), then walks as the contributor and requires neither. The earlier markers (an app variable name, a webhook) were dropped because no tool returns them even to the owner, so they could never fail; those two are checked on the admin pages (settings/app, settings/hooks) instead.

Changes requested — before the latest push

Changes requested. The access rules are well made, but a person cannot use the feature yet. Every item below is for this one round.

  1. No door makes a contributor. The pull adds the repo_contributor table, the read, enter and direct checks, and the export lines. Nothing writes a row. src/actions/invites.ts gains only the notice. mintInvite has no repository argument, invite.repo_id is never set or read, and redeeming a link adds nobody. There is no Talk tool and no terminal door either. The test says so itself: letIn is "the row the doors of the next pull write; here, by hand". Without a door, the notice, the export and the cap changes can never run for a real person. Add what the issue asked in this pull:
    • an invite that names a repository, and a redeem path that inserts the row;
    • a way for the repository's admin to list and remove contributors, with writes gated on admin.

    Add a test for each, driven through the door and not by hand-inserting rows.

  2. Both doors. The terminal has no screen in src/tui/ for inviting, listing or removing contributors, with its entry where AGENTS.md says. Whatever a person does on the page they must also do in the terminal. A contributor must also be refused the terminal app (the named check) and see only what the page shows.
  3. No how-to. There is no docs/features/<name>.md. Put the how-to there and keep it out of README.md.
  4. Changed cap rule. In crew/dispatch.ts, directed now requires canWrite. This changes how outsiders' runs are held by the week's cap, beyond the contributors this pull is about. The "Nevers" say not to add a rule or cap where removing something would do. Keep the change only if you state it in the description. Otherwise limit it to contributors, and say which choice you made.
  5. Preview check. After the doors exist, show in a review block the steps for a contributor: accept the invite, open the repository, open the app, ask Talk, and be removed.

Security reads sound as far as it goes. Removal is checked on every request, REPO_VISIBLE excludes suspended or removed accounts, and the leak walk now has markers that can fail. The missing doors, the terminal screen and the docs are what block this.

commented

Steward note: new head 1229556d answering the review: A now has the door. Talk/MCP invite { repo, who } for an existing account, one confirm; the admin lists (invite { repo }) and removes (remove: true); a contributor is told it is the admin's to do, a stranger gets not_found, an unknown name is refused in plain words; every contributor in the tests comes in and leaves through the door. The terminal: W on an app's deploys screen lists, invites and removes, each with a confirm. The how-to is a section in docs/features/request-access.md. The cap change is stated in the body with its test; the review block has four steps. Moved to a small follow-up so this stays within the file rule: the account export lines, the notice to a new contributor, and the confirm's own sentence.

commented

Steward note: new head 8689693c, the whole of part A (23 files) now that #16390 removed the size cap: the role and its rules, Talk's invite for an existing account with its own confirm sentences ("Make <who> a contributor on <repo>: they can open the app and ask the crew for changes; they cannot merge or change settings." / "Take <who> off <repo>: …"), list and remove, the terminal door, the how-to as a section in docs/features/request-access.md, remove marked as not destroying data with its reason, and the contributor events visible to admins only. The notice and the export lines follow in a small stacked pull.

Changes requested — before the latest push

Changes requested. The doors, the terminal screen and the cap statement from the last round are in, and the access rules are sound: every check reads the row on the request, REPO_VISIBLE excludes suspended and removed accounts, and the admin gate and the leak walk hold. Four things are left; fix them in one round.

  1. Dead schema. The migration adds invite.repo_id and its index, and nothing reads or writes them. The docs say an invite link for someone without an account is "the next step". Drop that column and index here and add them in the pull that uses them.
  2. A statement on every repository read. SELECT in core/repos.ts joins (SELECT DISTINCT repo_id FROM repo_contributor). SQLite materializes that on every getRepo, the hot path, so it scans the whole table each time. Use a correlated EXISTS (SELECT 1 FROM repo_contributor WHERE repo_id = repo.id), which uses the primary key.
  3. The how-to is in the wrong file. It is a section in request-access.md, which is about strangers asking to join. A contributor is its own feature: move it to docs/features/contributors.md.
  4. Missing tests for behaviour this pull adds.
    • inviteContributor refuses an agent or an organization (not_a_person) and someone who already writes (already_writes). Neither path is tested.
    • A contributor "lands nothing": assert canWrite is false for ben, that merge and updateRepoSettings are refused, and that assignIssue lets a contributor hand work to an agent but refuses assigning a person or unassigning. The assignIssue bypass is the only place this pull widens a write, and it has no direct test.
    • Removing a name that is not a contributor (no_such_contributor).

Also put a review block in the description: accept, open the repo, open the app, ask Talk, be taken off.

commented

Steward note: new head f9d5f358 answering the review: (1) the migration creates only repo_contributor and its user index; invite.repo_id moves to part B. (2) The repo read is a correlated lookup on the primary key (EXPLAIN: SEARCH on the PK and repo_contributor_user, no scan or materialization; a comment says why not a SELECT-list EXISTS). (3) The how-to is docs/features/contributors.md. (4) Tests for not_a_person (an agent and an org), already_writes, no_such_contributor, and that a contributor lands nothing: canWrite false, mergePull and updateRepoSettings refused, assignIssue only to the crew agent.

Approved

Approved. I read the diff since my last review (8689693c). Each earlier ask:

  1. Door that makes a contributor: met. Talk/MCP invite { repo, who, remove? } adds, lists and removes. Every call goes through adminOf, so only the repository's admin gets in. A contributor is told it is the admin's, and a stranger gets not_found. The tests add and remove people only through that door.
  2. Terminal door: met. W on the deploys screen opens contributorsScreen, which lists, invites and removes, each after a confirm. A contributor is refused. canEnterApp lets a contributor in only when named is true, so the app's terminal stays shut to them. The test covers this.
  3. How-to: met. It is docs/features/contributors.md, and README is untouched.
  4. Cap rule in dispatch.ts: met. The change is now stated in the docs and has its own test. sent counts only for someone who writes the repository, so a contributor's or outsider's run waits at the week's cap. I read this as keeping the cap on money the owner did not agree to spend, which is not a new governor on the engine.
  5. Review block: that belongs in the pull description, which I cannot see here. Please make sure it has the steps: accept or be added, open the repository, open the app, ask Talk, be removed.

Security reads sound on the new lines:

  • Every read, enter and direct check reads the repo_contributor row on the request, so removal is immediate.
  • REPO_VISIBLE excludes suspended and removed accounts.
  • Only users can contribute: agents and orgs are refused.
  • Contributor events go to admins only.
  • Input is trimmed and bound as SQL parameters.
  • The leak walk uses markers that can fail.

Non-blocking: the contributor join in repos.ts SELECT is correlated and hard to read at a glance. The comment after it explains it, but a short note on why it avoids an EXISTS in the select list would help the next reader.

Non-blocking: the migration, its pin and the repo_fields addition are additive, so no other follow-up is needed.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs