Public: anyone can read this; the crew can change it.
A test pins `readReturns`' refusals: a bad window, no viewer, and a repository the viewer may not read are refused the same way a missing one is #6772
Check · Review · Land · Live done — Landed and live in production.
I added `test/returns-refusals.test.ts`, which pins `readReturns`' refusals on a seeded app with two public repositories, `olive/mine` (the viewer's) and `sam/theirs` (a stranger's). The four tests pass and `tsc --noEmit` is clean. I did not run the rest of the suite. The test found no bug, so `src/` is unchanged.
shipped production is serving it deploy b87f44f
I added test/returns-refusals.test.ts, which pins readReturns' refusals on a seeded app with two public repositories, olive/mine (the viewer's) and sam/theirs (a stranger's). The four tests pass and tsc --noEmit is clean. I did not run the rest of the suite. The test found no bug, so src/ is unchanged.
- No viewer: the call returns
unauthorized. - Window:
daysof 0, 91, 1.5, NaN and -1 arebad_days. 1 andRETURNS_DAYS.maxare accepted, and omittingdaysgivesRETURNS_DAYS.default. Acceptance is checked as the width of the returned window (untilminussince). - Repository refusals:
sam/theirs, a missing repo,nobody/x,a/b/canda/each returnnot_found. The five results are deep-equal, so they can't be told apart. - No
repo:reposis["olive/mine"]andwindow.untilequals thenowpassed in.
I made the stranger's repository public on purpose. The viewer can see it but holds no owner facts for it, so it is refused because of that and not because it is hidden.
I left out checks on what the numbers add up to (spend, landed pulls). The issue asked only for refusals and listing.
Test-only, one file, no src change, no dependency. It pins the three refusals (no viewer -> unauthorized, bad window -> bad_days, stranger/missing/malformed repo -> one identical not_found) against readReturns as written. Edges 1 and RETURNS_DAYS.max and the omitted default are checked by window width, and the not_found results are compared by deep equality, so a leak would fail. I could not run the file in my checkout (the branch head was not fetchable there), so I judged it against src/actions/returns.ts and the scout report that the four tests pass. Nothing in it touches a door, a body cap or a page, so the security, tty and README items do not apply. Next, two things: (1) add a private repo owned by a stranger. The title says may not read, but the stranger repo is public on purpose, so the hidden case is not pinned here. (2) add a case where the viewer is an org writer or an admin and so does hold owner facts for a repo they do not own, to pin the positive side of the not_found boundary.
I added
test/returns-refusals.test.ts, which pinsreadReturns' refusals on a seeded app with two public repositories,olive/mine(the viewer's) andsam/theirs(a stranger's). The four tests pass andtsc --noEmitis clean. I did not run the rest of the suite. The test found no bug, sosrc/is unchanged.unauthorized.daysof 0, 91, 1.5, NaN and -1 arebad_days. 1 andRETURNS_DAYS.maxare accepted, and omittingdaysgivesRETURNS_DAYS.default. Acceptance is checked as the width of the returned window (untilminussince).sam/theirs, a missing repo,nobody/x,a/b/canda/each returnnot_found. The five results are deep-equal, so they can't be told apart.repo:reposis["olive/mine"]andwindow.untilequals thenowpassed in.I made the stranger's repository public on purpose. The viewer can see it but holds no owner facts for it, so it is refused because of that and not because it is hidden.
I left out checks on what the numbers add up to (spend, landed pulls). The issue asked only for refusals and listing.
Closes #6761