Public: anyone can read this; the crew can change it.
A private repository answers every read route with the same 404 as a missing one, proven by one table-driven test #13553
Merged 18d 16h ago, live in production
On main, a private repository already gives the same answer as a missing one on every read route. So this pull only adds the test that proves it: test/private-404-parity.test.ts. No route needed fixing, and src/http/refusal.ts is unchanged.
-
Reviews
ApprovedTest-only pull: one new file, no UI, so nothing for a phone, keyboard or no-JS reader to meet. The walk is over the router tables, so new repo read routes are covered automatically. Both a stranger and a signed-in non-member are compared on status, headers and body, and a control test proves the comparison can see a difference. Single-purpose, no dependency, no dead code, README untouched. Two things I would do next: (1) add a stranger (no token) pass for the MCP tools, since only a non-member bearer is compared now, and cover the terminal (src/tui) read screens the same way, since the terminal is a door like the page; (2) cover the routes that take an owner but no repo name, and the origins browse routes once their rate-limit counter is filtered. Also tidy the
}/else ifline layout in the route loop. -
Checks
shipped production is serving it deploy 68f0754
-
History
- A private repository answers every read route as a missing one does, walked over the route tables and MCP tools (#13538) a2ec21d
- The signed-in feed's first read walks an index, not a scan, and answers inside a stated budget with Server-Timing (#13498) d3fe125
- /templates lists the templates and links each to making a forge from it (#13282) d48b67b
- The not-found and failed pages say one plain sentence and offer one action (#13027) 2e403c3
- Full suite red: test/billing-never-deletes.test.ts (#13380) 42b3af1
- An asset served under /assets/ with a content-hash name is cached for a year as immutable, and an unhashed one is not (#13478) 905fcf7
- A thrown error in any page renders one plain sentence and an id, never a stack or a path (#13416) 76dbdf5
- An .ics file opens as its events: title, start, end and place in a table, with every field shown as text (#13451) d071fe8
- /explore sorts by freshness as well as use, chosen by a plain link and kept in the URL (#13474) 64a30a3
- A talk conversation can be downloaded as one Markdown file (#13357) c0340b5
- A CSV file's table sorts by a column on tap, server-side, and keeps the header fixed (#13350) 4742a08
- Every Set-Cookie and every error response carries the security floor, proven by one table-driven test (#13470) 74b89af
- A maintenance duty files one issue when the nightly backup is older than 36 hours (#13349) 50af297
- An outsider's offered pull answers with a receipt number and the same words by API and MCP (#13468) 97c7af0
- The forge toolbar in a preview shows its pull number and links back to the pull in one tap (#13415) 5551306
- The forge's backup includes every app's Drop, and a restore test brings one dropped file back byte for byte (#13440) e9b8693
- A cancelled run ends every process it started, and a test proves none is left (#13341) 5df0d61
- An outsider's report answers with a receipt number and the same words by API and MCP (#13435) e7cd782
- A dropped file is always served as a download with nosniff, whatever its name or bytes (#13413) 088215c
- A maintenance duty lists merged pull branches older than seven days and offers to delete them in one tap (#13347) 0471f69
On main, a private repository already gives the same answer as a missing one on every read route. So this pull only adds the test that proves it: test/private-404-parity.test.ts. No route needed fixing, and src/http/refusal.ts is unchanged.
What the test covers:
- Routes: it walks
buildRouter()andbuildApiRouter()and takes every GET route under/:owner/:name…or/api/v1/repos/:owner/:name…, about 183. Any other parameters in the path get fixed values. - Requests: each route is requested for
alice/zqxhiddenrepoand foralice/zqxabsentrepo. The private one has a commit, an issue and amainbranch; the other was never created. Each pair is asked once as a stranger and once with a session cookie for a signed-in non-member. - MCP: every MCP tool not marked
writeswhose input takes arepois called with both names, using the non-member's bearer token. - What must match: status, headers and body, after swapping the one name for the other. The two names are the same length, so
Content-Lengthcan't tell them apart either. - What is left out: values that change on every request:
date, request id,server-timing,etag,content-lengthand the rate-limit counters. Timing is not compared, as the issue's Risks note allows. - Answers seen: for strangers, 165 routes answer 404, 12 answer 401 (they need sign-in before any repository lookup), 5 answer 301 and 1 answers 400. For the non-member, 177 answer 404. In every case the private and missing repository got the same answer.
Why it would fail on a leak: the route list comes from the tables themselves, so a read route added later is checked the day it's added. A control test checks the comparison can see a difference: the owner gets 200 for their repository and 404 for the missing one, and the MCP issues tool gives them different bodies for the two.
Checks I ran:
bun scripts/gate.ts --fix: rewrapped comments in the new file; that is committed.bun x tsc --noEmit: clean.bun test test/private-404-parity.test.ts: 5 pass.bun test test/mcp-size.test.ts: 9 pass.
Not covered: the /api/v1/user/origins/:id/browse/:owner/:name… routes, which read another forge rather than a repository here. They also showed false differences from the rate-limit counter before it was filtered out. Routes that take an owner but no repository name are not covered either.
I didn't record a plan on the issue with keep_plan, because that tool isn't available in this run.
🤖 Generated with Claude Code
On main, a private repository already gives the same answer as a missing one on every read route. So this pull only adds the test that proves it:
test/private-404-parity.test.ts. No route needed fixing, andsrc/http/refusal.tsis unchanged.What the test covers:
buildRouter()andbuildApiRouter()and takes every GET route under/:owner/:name…or/api/v1/repos/:owner/:name…, about 183. Any other parameters in the path get fixed values.alice/zqxhiddenrepoand foralice/zqxabsentrepo. The private one has a commit, an issue and amainbranch; the other was never created. Each pair is asked once as a stranger and once with a session cookie for a signed-in non-member.writeswhose input takes arepois called with both names, using the non-member's bearer token.Content-Lengthcan't tell them apart either.date, request id,server-timing,etag,content-lengthand the rate-limit counters. Timing is not compared, as the issue's Risks note allows.Why it would fail on a leak: the route list comes from the tables themselves, so a read route added later is checked the day it's added. A control test checks the comparison can see a difference: the owner gets 200 for their repository and 404 for the missing one, and the MCP
issuestool gives them different bodies for the two.Checks I ran:
bun scripts/gate.ts --fix: rewrapped comments in the new file; that is committed.bun x tsc --noEmit: clean.bun test test/private-404-parity.test.ts: 5 pass.bun test test/mcp-size.test.ts: 9 pass.Not covered: the
/api/v1/user/origins/:id/browse/:owner/:name…routes, which read another forge rather than a repository here. They also showed false differences from the rate-limit counter before it was filtered out. Routes that take an owner but no repository name are not covered either.I didn't record a plan on the issue with
keep_plan, because that tool isn't available in this run.🤖 Generated with Claude Code
Closes #13538