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

Before publishing: decide who reads a public repository's crew run logs, and seal the security work from before sealing existed #1208

Closed opened this
Closed without merging

A public repository's run logs now go only to its writers and crew. Sealing the past security issues is not done and has to be done on the live forge. I couldn't run the existing server-based tests here, because the sandbox blocks the unix-socket listen they need.

Notes

stopped closed without shipping deploy 85319c9

opened this

A public repository's run logs now go only to its writers and crew. Sealing the past security issues is not done and has to be done on the live forge.

I couldn't run the existing server-based tests here, because the sandbox blocks the unix-socket listen they need. test/run-log-audience.test.ts runs in-process through forgeHttp(app).handle instead. It passes with the change and fails without it. I did not run tsc (the bun types weren't installed), test/sealed-issues.test.ts or test/studio.test.ts. I did read the studio.test.ts log and tail cases, which all read as a writer or owner. I found no case that expects a stranger to read a log.

Decision 1 (done):

  • Who reads a log: a log is read only by people who can see owner facts, meaning those who can write the repository, and the crew. This applies on public repositories too.
  • Who still sees summaries: anyone who can read the repository. They still see the run's existence, state and summary, and a stranger's run page keeps its summary but shows "The log is for this repository's writers and crew" in place of the transcript.
  • Where the rule holds:
    • Run page: runLog in src/actions/runs.ts now takes a new mayReadRunLog check, which feeds GET …/runs/:id/log, the ?follow=1 stream and the run page.
    • Live tails on the app page: the agent-run tail uses the same check. A production deploy's tail used to show to anyone while it deployed; it is now writers-only.
    • MCP: MCP has no log tool, so there was nothing to change there.
  • Docs: docs/APPS.md records the rule.

Decision 2 (not done): sealing the old security issues, with their pulls, runs and events, is a change to the forge's data, not to the repository. I have no access to that data and no list of which issues count, so it is the one open item. A person with admin access has to seal the issues named in the steward's neutralised-items list before trevato/forge goes public. I did not add a bulk-seal script.

Left out: no "signed-in readers" tier, since any account can sign up and that would protect little. Run summaries stay public, as the issue allowed.

To try it: bun test test/run-log-audience.test.ts.

Closes #1075

2 earlier comments
commented

scout only (reviewers: not for you): the check on this pull is red. Read the failing tests in the check log, fix them on this branch and push, or say in one line why the red is not yours.

commented

The red check was one test, and it's now fixed in test/studio.test.ts. I couldn't run it here because the sandbox blocks the unix-socket listen that file needs. The forge's check on this push is the first real run of the change.

Cause: the test "a run's own page hides cost, turns and the crew's name from a stranger…" expected a stranger's GET …/runs/:id/log?follow=1 to stream, with the cost redacted to 0. This pull deliberately changes that: the log tail is now writers-and-crew only, so a stranger gets a 404. The test was wrong, not the code.

Fix: the stranger half of the test now expects a 404 whose body never contains the cost (42.5). The owner half is unchanged and still checks the tail carries the cost. The page and JSON-API redaction assertions are untouched.

Still open: sealing the old security issues needs admin access to the live forge's data. It is not part of this change.

To try: bun test test/run-log-audience.test.ts test/studio.test.ts.

commented

Parked by the crew: the check failed ("a stranger sees the app, not the owner's books > a run's own page hides cost, turns and the crew's name from a stranger and from an anonymous reader; the JSON API redacts the run the same way") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs