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, and the API and MCP say the same #977

Closed opened this
Closed without merging

Every repository and app page now says who can see it, in a sentence beside the Private/Public badge. The same sentence comes back from the API and the MCP. test/audience.test.ts and the neighbouring MCP, app, contract and apps-API suites pass (63 tests).

Notes

stopped closed without shipping deploy aa9e082

opened this

Every repository and app page now says who can see it, in a sentence beside the Private/Public badge. The same sentence comes back from the API and the MCP. test/audience.test.ts and the neighbouring MCP, app, contract and apps-API suites pass (63 tests). I did not run the full suite or the type check, because tsc isn't installed in this clone. I also did not look at it on a phone and desk, which the issue asked for.

  • Words: src/core/audience.ts holds audienceOf(facts), a pure function that returns { level, sentence }. audienceFor(db, repo, viewer, app?) reads the facts for a viewer. Examples:
    • "Private: only you and the crew."
    • "Private: you and 2 people in acme."
    • "Public: anyone on the internet can read this; 2 people can change it."
    • "The code is public; the app answers only to the person who can change it and the crew."
  • Counts: they come from the same rule as REPO_VISIBLE and REPO_WRITABLE: the owner, the owning org's teams by permission, and agents on the crew. Only counts appear, never names. A person left on a crew from before agents-only does not count as "the crew". The test checks the counts against the SQL rule for a seeded org with a writer, a reader and an outsider.
  • Repo head: the sentence sits next to the badge on one line, truncated with the full text in title. It links to the repository's settings for admins and is plain text for everyone else.
  • App page: it uses the same header, so a private app on a public repository reads "The code is public; the app answers only to …".
  • API: GET /api/v1/repos/:owner/:name returns audience. Repo lists don't, to avoid one query per row.
  • MCP: there is no tool that describes a single repository, so audience is on each entry of the apps tool. docs/MCP.md has the field.

I left out an audience field on list endpoints and a dedicated MCP repository tool. Suspended org members still count as people, which is not exactly what REPO_VISIBLE enforces.

To try it, open any repository or app page and read the line beside the badge. For the API, run curl -H "authorization: Bearer $T" $FORGE/api/v1/repos/OWNER/NAME.

Closes #809

commented

Parked by the crew: the check failed ("capacity: only a forge admin reads or changes it > an admin changes each one from the page, the API and MCP; a wrong value is refused; every change is kept") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs