Public: anyone can read this; the crew can change it.
An agent reads a pull's looks: GET …/pulls/:number/looks and MCP `pull` carry each picture with its width, line and URL #8411
An agent can now read a pull's looks. GET /api/v1/repos/:owner/:name/pulls/:number/looks answers { items: [{ id, width, says, by, commit, url, at }] }, newest first. MCP pull carries the same list as looks, and its doc says so.
stopped parked by the crew deploy 5303d9e
3 earlier comments
An agent can now read a pull's looks. GET /api/v1/repos/:owner/:name/pulls/:number/looks answers { items: [{ id, width, says, by, commit, url, at }] }, newest first. MCP pull carries the same list as looks, and its doc says so.
The new tests and tsc pass, and scripts/gate.ts and design-lint are clean. In the 899 look/MCP/pull tests I ran, three real-Chromium capture tests in the look suite failed, because the sandbox denies loopback connections. They don't touch this change, and the forge's check will run them. I did not run the full suite, because scripts/fast.ts said the diff was too broad to name tests.
- What is listed: only the light looks of the pull's preview environment that have a picture, and only those the reader may fetch. This is the rule that serves the picture itself. I moved it out of
mayFetchLookinsrc/web/pages/looks.tsintomayFetchLookAs, which takes no request, so MCP and REST apply the same rule. The newsrc/web/pages/pull_looks.tsbuilds the list. - Who sees what: a person who can write the repository sees everything, including attached looks. A reader of a public repository sees
[]for a look that was attached, because attached looks are shown to writers only. A private repository answers 404 to someone who may not read it, and a pull with no app or no looks answersitems: []. url: it comes from the samelookUrlthe POST uses, and the test checks it matches.- Tests:
test/pull-looks.test.tscovers a look attached through the POST appearing in the GET and in MCPpull, the reader who may not fetch it getting[], the private-repository 404, and the no-app case. - Docs:
docs/MCP.mdno longer exists, andscripts/mcp-tools.tsnow only checkssrc/http/mcp/tools/index.ts(the live/llms.txtserves the docs). So I updated the "A look a person attaches" section ofdocs/APPS.mdinstead. - MCP size: no new tool was added, and
test/mcp-size.test.tspasses.
I did not list dark looks or thumbs a reader cannot fetch, and I added no pagination. A pull has only a handful of looks.
To try it, attach a look on an open pull with an app, then curl -H "authorization: Bearer $T" $FORGE_URL/api/v1/repos/OWNER/NAME/pulls/N/looks. Call the MCP pull tool for the same list.
An agent can now read a pull's looks with GET /api/v1/repos/:owner/:name/pulls/:number/looks or the MCP pull tool. The first push failed the check because the new route had no OpenAPI row. I added getApiV1ReposOwnerNamePullsNumberLooks.ts, regenerated routes/index.ts with bun scripts/openapi-routes.ts, and pushed.
tsc --noEmit is clean, and test/openapi-coverage.test.ts, test/openapi-routes.test.ts and test/pull-looks.test.ts pass (320 tests). I did not run the full suite or the gate script; the forge runs the full check on the push.
What the endpoint returns
- It answers
{ items }, newest first. Each item carriesid,width,says,by,commit,urlandat. - It lists only the pictures the reader may fetch, using the same rule that serves the picture. A pull with no app or no looks gets an empty list.
docs/APPS.mdis updated to match.
What I chose not to do
- The route file marks the endpoint
auth: false, the same as the pull's checks route. Access is decided per picture, so private pictures stay out for readers who may not fetch them.
To try it
- Fetch
/api/v1/repos/trevato/forge/pulls/8411/lookson the preview at https://lab--8411--forge-trevato-apps.open-platform.sh.
An agent can now read a pull's looks with GET /api/v1/repos/:owner/:name/pulls/:number/looks, or through the MCP pull tool. The latest check failure was a stale assertion in test/openapi-oa-pull-review.test.ts, and I've fixed it and pushed.
That test asserted that GET …/looks was undefined in the OpenAPI document. The previous fix described that route, so I changed the assertion to expect the GET row. The test was wrong, not the code. It passes alone and tsc --noEmit is clean. I did not rerun the full suite; the forge runs that on the push.
- What the endpoint returns:
{ items }, newest first, withid,width,says,by,commit,urlandatfor each look. It lists only the pictures the reader may fetch, using the same rule that serves the picture. A pull with no app or no looks gets an empty list. - Auth in the OpenAPI row: the row for the GET marks it
auth: false, as the pull's checks row does. Access is decided per picture, so private pictures stay out for readers who may not fetch them. - To try it: fetch
/api/v1/repos/trevato/forge/pulls/8411/lookson the preview at https://lab--8411--forge-trevato-apps.open-platform.sh.
Parked by the crew: the check stayed red through 2 automatic tries
An agent can now read a pull's looks.
GET /api/v1/repos/:owner/:name/pulls/:number/looksanswers{ items: [{ id, width, says, by, commit, url, at }] }, newest first. MCPpullcarries the same list aslooks, and its doc says so.The new tests and
tscpass, andscripts/gate.tsanddesign-lintare clean. In the 899 look/MCP/pull tests I ran, three real-Chromium capture tests in the look suite failed, because the sandbox denies loopback connections. They don't touch this change, and the forge's check will run them. I did not run the full suite, becausescripts/fast.tssaid the diff was too broad to name tests.mayFetchLookinsrc/web/pages/looks.tsintomayFetchLookAs, which takes no request, so MCP and REST apply the same rule. The newsrc/web/pages/pull_looks.tsbuilds the list.[]for a look that was attached, because attached looks are shown to writers only. A private repository answers 404 to someone who may not read it, and a pull with no app or no looks answersitems: [].url: it comes from the samelookUrlthe POST uses, and the test checks it matches.test/pull-looks.test.tscovers a look attached through the POST appearing in the GET and in MCPpull, the reader who may not fetch it getting[], the private-repository 404, and the no-app case.docs/MCP.mdno longer exists, andscripts/mcp-tools.tsnow only checkssrc/http/mcp/tools/index.ts(the live/llms.txtserves the docs). So I updated the "A look a person attaches" section ofdocs/APPS.mdinstead.test/mcp-size.test.tspasses.I did not list dark looks or thumbs a reader cannot fetch, and I added no pagination. A pull has only a handful of looks.
To try it, attach a look on an open pull with an app, then
curl -H "authorization: Bearer $T" $FORGE_URL/api/v1/repos/OWNER/NAME/pulls/N/looks. Call the MCPpulltool for the same list.Closes #7915