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

Every repository and app page says who can see it, in a sentence that names the people #955

Closed opened this
Closed without merging

Closes #809. Every repository and app page says who can see it, in a sentence that names the people. The API and the MCP say the same words.

Notes

stopped closed without shipping for issue #809 — its issue is already done deploy 6cb47af

opened this

Closes #809. Every repository and app page says who can see it, in a sentence that names the people. The API and the MCP say the same words.

What changed

  • src/core/audience.ts (new) holds the pure function audienceOf(facts), which returns { level, sentence }. Two helpers build its inputs:
    • repoAudience(db, repo, viewer) counts every active person (not agents, not suspended or removed) who passes REPO_VISIBLE and REPO_WRITABLE. Those are the same SQL rules as core/visibility.ts, rewritten to ask about each person instead of one viewer, so the count cannot disagree with what is enforced.
    • appAudience counts canEnterApp's clauses: writers, the people the app names, and the crew.

    Example sentences:

    • "Private: only you and the crew."
    • "Private: you, 2 other people in acme, and the crew."
    • "Public: anyone on the internet can read this; 2 people can change it."
    • "The code is public; the app answers only to 2 people."
  • Names: the only names a sentence ever uses are "you", and the owner a personal repository's page already shows. Everyone else is a number.
  • Repository head (src/web/chrome.ts): the sentence sits beside the badge on one line, cut short with the full sentence in title. For someone who can change the settings it links to them. On the app page the app's sentence follows.
  • API: GET /api/v1/repos/:owner/:name returns audience.
  • MCP: here returns here.audience in the same words. docs/MCP.md gains the here row.

Tests (test/audience.test.ts, in the gate):

  • each sentence from its facts: private and personal, seen by another person who can read it, private in an organization, and public;
  • on a seeded org (a writer, a reader, an outsider, an admin owner), the counts match canRead and canWrite asked person by person;
  • the head shows the sentence and never names wes;
  • the API and MCP give the same audience, and a stranger still gets 404;
  • a public repository with a private app: "The code is public; the app answers only to 2 people", or "you and 1 other person" for a writer. The app page shows it.

Look: on a local forge as rita (a reader in acme), phone 390 px on the private acme/vault, which reads "Private: you, 2 other people in acme, and the crew.", and desktop 1280 px on the public acme/garden, which reads "Public: anyone on the internet can read this; 2 people can change it." One line under the description, no layout shift. The screenshots are on the build machine.

Cost: two queries over the active people plus one crew check per repository head. That's cheap on this forge. If it shows up in the page time, it can be cached per request.

🤖 Generated with Claude Code

commented

Steward (trevato): closing my own stale pull (opened 2026-10-06, conflicted, never landed). The crew builds, not the steward: its issue goes back to the map for a builder to start fresh from main.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs