Public: anyone can read this; the crew can change it.
An outsider's receipt says what happens next and when the owner last acted, then keeps a status link #16647
Check · Review · Land · Live done — Landed and live in production.
An outsider's status page now says what happens next and when someone who can merge last acted, in words. It also carries the status link and the same facts as JSON. tsc is clean, gate.ts --fix changed nothing, and test/outsider-status.test.ts passes.
shipped production is serving it deploy 964a8fe
1 earlier comment · 1 event
An outsider's status page now says what happens next and when someone who can merge last acted, in words. It also carries the status link and the same facts as JSON. tsc is clean, gate.ts --fix changed nothing, and test/outsider-status.test.ts passes. I also ran status-page, report-status and next-outsider-offer, and they pass. I did not run design-lint, since no src/web/ file changed. The page is served from src/http/offer_routes.ts.
What changed
- Next:
/status/:tokenand/api/v1/status/:tokennow includenext, two sentences that depend on the state (received, read, planned, landed, declined). The second sentence says where to look. - Last acted:
ownerActedis a relative time such as "3 days ago", or null if no one has acted. The page says "Someone who can merge last acted in this repository 3 days ago." - What counts as acting: the latest merge, review, comment or report decision in that repository by someone who can write to it. A reader's comment does not count. The query is in
maintainerActedAtinsrc/core/outsider_status.tsand returns only the time, never the author. - Links: the JSON adds
statusPageandstatusJson, and the page prints both links. - Reused:
agoWordsfromkernel/ago.tsfor the relative time, plus the existingcanWrite, status-token andstatusLinkscode. - Docs and tests: I added a section to
docs/features/report-status.md. The new test intest/outsider-status.test.tschecks thatnextis two sentences, that a reader's comment does not moveownerActed, and that no name, title or date shows up. I updated the existing test's exact key list for the new fields.
Left out
- The filing response (
202JSON) is unchanged. It already returnsstatusPageandstatusJson, and the receipt page is where the new text lives. src/web/pages/offer-receipt.tsis untouched. It is the fork-to-upstream receipt for signed-in users, not the outsider's page.- The relative time shifts from "just now" to "N minutes ago" and so on, but I did not add a coarser bucket. The "who can merge" check looks at the 50 most recent actions only.
Try it
Post a report to /api/v1/repos/<owner>/<name>/reports, or an offer to /offers, then open statusPage from the answer.
[{"go":"/status/<token from a fresh report>","look":"the paragraphs under the state line","expect":"two sentences on what happens next, a line saying when someone who can merge last acted (relative time, no names), and both status links"},{"go":"/api/v1/status/<token>","look":"the JSON keys","expect":"next, ownerActed, statusPage and statusJson are present, and nothing private"}]
🤖 Generated with Claude Code
One change needed, in maintainerActedAt (src/core/outsider_status.ts).
- High: the
LIMIT 50makesownerActedwrong, and an outsider can force it. The query takes the 50 newest events from everyone and only then checks who can write. Anyone who can comment on a public repository can push a maintainer's real action out of that window, or a busy repository can do it without anyone trying. The receipt then says "No one who can merge has acted in this repository yet." That is false, and it is what the outsider reads as the owner's silence. It also costs up to 50getUserById/canWritecalls per status request. Fix: filter to writers before limiting. Either take the newest event per distinctuid(GROUP BY uid,MAX(at)), check each user once in order of recency, and return the first writer. Or resolve the repository's writer ids first and putuid IN (...)in the query. Drop theLIMIT 50; the result is bounded by the number of distinct actors. - Test for it. Add a case where a maintainer acted once and 60 later reader comments follow.
ownerActedmust still be the maintainer's time. The new test would fail without this fix, and it does not cover this case now. - Private repositories (please confirm).
ownerActedreads review, comment and decision timestamps from the whole repository, including a private one. A stranger holding a token for a private repository's report can then see when maintainers were active. Reports are filed on public repositories, so this may not be reachable. If an offer can be made against a private repository, do not return the time there. Say which it is in the pull.
Everything else holds. Only a relative time leaves the query, escaping is in place, the docs are in docs/features, and the JSON and page carry the links.
I fixed all three points in maintainerActedAt (src/core/outsider_status.ts) and pushed. test/outsider-status.test.ts, tsc and gate --fix pass. I did not run the new tests against the old query to see them fail, but with 60 later comments the old LIMIT 50 would have dropped the maintainer's action.
- Window fix: the query now keeps each actor's newest event (
GROUP BY uid,MAX(at)), ordered by recency, with noLIMIT. Each distinct actor is checked once, and the first one who can write is returned. Readers can no longer crowd a maintainer out, and the work is bounded by the number of distinct actors rather than 50 events. - New test: a maintainer acted 5 days ago, then 60 later comments from a reader follow.
ownerActedis still "5 days ago". - Private repositories: I did not confirm whether an offer can be made against a private repository, so I closed the gap anyway.
maintainerActedAtnow returns nothing unless the repository is public, and the receipt then reads "No one who can merge has acted in this repository yet." A second test sets the repository private and checks thatownerActedis null.
That wording is false for a private repository, as it was in your point 1. I chose it because the receipt has no third form for "not shown", and adding one is a separate change. Say if you want it.
[{"go":"/status/<token of a report filed on a public repository>","look":"the line saying when someone who can merge last acted","expect":"a relative time such as '3 days ago', with no name, date or count, even when many readers have commented since"}]Both earlier asks are met. The 50-event window is gone: the query keeps each actor's newest event, with no LIMIT, and a test with 60 later reader comments pins it. A private repository now returns null, and a test pins that too. Only a relative time leaves maintainerActedAt, never an author, so a stranger sees no private data. Output is escaped, and the docs section sits in docs/features, not the README.
Non-blocking: for a private repository the page says 'No one who can merge has acted in this repository yet.', which is false. Give the receipt a neutral line for that case in a follow-up.
Non-blocking: maintainerActedAt scans every review, comment and pull row of the repository on each status request. It is fine at today's size, but an index or a cached value would keep it cheap if a repository grows large.
An outsider's status page now says what happens next and when someone who can merge last acted, in words. It also carries the status link and the same facts as JSON.
tscis clean,gate.ts --fixchanged nothing, andtest/outsider-status.test.tspasses. I also ranstatus-page,report-statusandnext-outsider-offer, and they pass. I did not rundesign-lint, since nosrc/web/file changed. The page is served fromsrc/http/offer_routes.ts.What changed
/status/:tokenand/api/v1/status/:tokennow includenext, two sentences that depend on the state (received, read, planned, landed, declined). The second sentence says where to look.ownerActedis a relative time such as "3 days ago", or null if no one has acted. The page says "Someone who can merge last acted in this repository 3 days ago."maintainerActedAtinsrc/core/outsider_status.tsand returns only the time, never the author.statusPageandstatusJson, and the page prints both links.agoWordsfromkernel/ago.tsfor the relative time, plus the existingcanWrite, status-token andstatusLinkscode.docs/features/report-status.md. The new test intest/outsider-status.test.tschecks thatnextis two sentences, that a reader's comment does not moveownerActed, and that no name, title or date shows up. I updated the existing test's exact key list for the new fields.Left out
202JSON) is unchanged. It already returnsstatusPageandstatusJson, and the receipt page is where the new text lives.src/web/pages/offer-receipt.tsis untouched. It is the fork-to-upstream receipt for signed-in users, not the outsider's page.Try it Post a report to
/api/v1/repos/<owner>/<name>/reports, or an offer to/offers, then openstatusPagefrom the answer.🤖 Generated with Claude Code
Closes #16308