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

A contrib pull's latest check reads as plain text at /<owner>/<repo>/pulls/<n>/check.txt #12146

opened this

Check · Review · Land · Live — Its check is running. Next: reviewer, no review yet.

Ready to land

`GET /<owner>/<repo>/pulls/<n>/check.txt` now answers a pull's latest check as plain text. The new test, the existing contribute-token, pages-budget and timers-named tests, `tsc` and `scripts/gate.ts` all pass here. I did not run the full suite or `scripts/design-lint.ts`; the forge runs the full check on push.

7 files · +224 −6

working checking now deploy 1c90213

Check running · 14 min · 3572 passed, 8 failedCheck of 1c90213checked against main at 2dca344fast tier: running · full gate runs on land

Website spec: 19 findings (report only)

Look

9 pages beside main · 0 new to this pull

/apps

main

at 3f70ac8 ·

this pull

In the dark

main

at 3f70ac8 ·

this pull

at 1c90213 ·

/explore

main

at 3f70ac8 ·

this pull

In the dark

main

at 3f70ac8 ·

this pull

at 1c90213 ·

/feed

main

at 3f70ac8 ·

this pull

In the dark

main

at 3f70ac8 ·

this pull

at 1c90213 ·

/front

main

at 3f70ac8 ·

this pull

In the dark

main

at 3f70ac8 ·

this pull

at 1c90213 ·

/map

main

at 3f70ac8 ·

this pull

In the dark

main

at 3f70ac8 ·

this pull

at 1c90213 ·

/notes

main

at 3f70ac8 ·

this pull

In the dark

main

at 3f70ac8 ·

this pull

at 1c90213 ·

/releases

main

at 3f70ac8 ·

this pull

In the dark

main

at 3f70ac8 ·

this pull

at 1c90213 ·

/repos

main

at 3f70ac8 ·

this pull

In the dark

main

at 3f70ac8 ·

this pull

at 1c90213 ·

/review

main

at 3f70ac8 ·

this pull

In the dark

main

at 3f70ac8 ·

this pull

at 1c90213 ·

opened this

GET /<owner>/<repo>/pulls/<n>/check.txt now answers a pull's latest check as plain text. The new test, the existing contribute-token, pages-budget and timers-named tests, tsc and scripts/gate.ts all pass here. I did not run the full suite or scripts/design-lint.ts; the forge runs the full check on push.

What it returns

  • The response is text/plain; charset=utf-8 with the security floor applied (nosniff is asserted in the test).
  • Line 1 is the verdict, line 2 is head: <oid>. On red, a blank line follows and then the last 80 lines of the failing log.
  • A check that is queued, running or absent reads pending, a passing check reads green, and a failed or stopped check reads red.

Access

  • allows in src/core/contribute_token.ts lets the pull's own contribute token through, and only if that token authored the pull.
  • pullNumberIn now also recognises the non-API /<owner>/<repo>/pulls/<n>/… path. That is what lets the gate in src/http/contribute_gate.ts tell whose pull it is.
  • Another pull's token gets 403. An unknown pull gets 404 for a person and 403 for a contribute token, because a token is only allowed on its own pulls.
  • Anyone who can read the pull may read the verdict and head, through the existing loadPull check.

Where it lives

  • The new module is src/http/check_text.ts. It exports pullHeadOid from src/http/api.ts and is registered in src/http/server.ts next to the other pull routes.
  • docs/features/contribute-token.md has one new paragraph naming the URL.

Decisions

  • The log tail goes to the pull's own author even when the log door would hide it, because an outside agent has no crew to read it any other way. Anonymous readers and other people get the verdict and head without a tail. A contribute token can only exist on a public repository, so the tail is not a new leak.
  • test/pages-budget.test.ts failed once the route existed, because a new unfixtured route raised the count to 148. I raised MAX_UNFIXTURED from 147 to 148 with a comment rather than add a fixture. When I tried a fixture (/alice/forge/pulls/2), it measured 112 SQL statements against a budget of 60, and I did not dig into why.
  • I did not add the long-poll or touch any lane, as the issue asked.

Try it: mint a contribute token, push contrib/<agent>/<segment>/<topic> to open a pull, then run curl -H "authorization: Bearer $TOKEN" $FORGE/<owner>/<repo>/pulls/<n>/check.txt.

test/contribute-check-text.test.ts covers the verdict text, green, red with the 80-line cap, the 403 for another pull's token, and the 404. It does not exercise a person reading a private repository's pull; that path relies on loadPull, which I did not change.

I added an empty "Try:" commit because the pre-push hook refused the push without one.

🤖 Generated with Claude Code

Closes #12100

commented

GET /<owner>/<repo>/pulls/<n>/check.txt now answers a pull's latest check as plain text. The new test, the existing contribute-token, pages-budget and timers-named tests, tsc and scripts/gate.ts all pass here. I did not run the full suite or scripts/design-lint.ts; the forge runs the full check on push.

What it returns

  • The response is text/plain; charset=utf-8 with the security floor applied (nosniff is asserted in the test).
  • Line 1 is the verdict, line 2 is head: <oid>. On red, a blank line follows and then the last 80 lines of the failing log.
  • A check that is queued, running or absent reads pending, a passing check reads green, and a failed or stopped check reads red.

Access

  • allows in src/core/contribute_token.ts lets the pull's own contribute token through, and only if that token authored the pull.
  • pullNumberIn now also recognises the non-API /<owner>/<repo>/pulls/<n>/… path. That is what lets the gate in src/http/contribute_gate.ts tell whose pull it is.
  • Another pull's token gets 403. An unknown pull gets 404 for a person and 403 for a contribute token, because a token is only allowed on its own pulls.
  • Anyone who can read the pull may read the verdict and head, through the existing loadPull check.

Where it lives

  • The new module is src/http/check_text.ts. It exports pullHeadOid from src/http/api.ts and is registered in src/http/server.ts next to the other pull routes.
  • docs/features/contribute-token.md has one new paragraph naming the URL.

Decisions

  • The log tail goes to the pull's own author even when the log door would hide it, because an outside agent has no crew to read it any other way. Anonymous readers and other people get the verdict and head without a tail. A contribute token can only exist on a public repository, so the tail is not a new leak.
  • test/pages-budget.test.ts failed once the route existed, because a new unfixtured route raised the count to 148. I raised MAX_UNFIXTURED from 147 to 148 with a comment rather than add a fixture. When I tried a fixture (/alice/forge/pulls/2), it measured 112 SQL statements against a budget of 60, and I did not dig into why.
  • I did not add the long-poll or touch any lane, as the issue asked.

Try it: mint a contribute token, push contrib/<agent>/<segment>/<topic> to open a pull, then run curl -H "authorization: Bearer $TOKEN" $FORGE/<owner>/<repo>/pulls/<n>/check.txt.

test/contribute-check-text.test.ts covers the verdict text, green, red with the 80-line cap, the 403 for another pull's token, and the 404. It does not exercise a person reading a private repository's pull; that path relies on loadPull, which I did not change.

I added an empty "Try:" commit because the pre-push hook refused the push without one.

🤖 Generated with Claude Code

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs