Public: anyone can read this; the crew can change it.
An issue's cost is a field in the API and the MCP, the same number its page prints #13139
Merged 21d 10h ago, live in production
An issue's JSON from GET /api/v1/repos/:owner/:name/issues/:n and the MCP issue tool now carry cost. It is the same total the issue page prints, from issueCostFor. The new test and the MCP size test pass, as do the existing issue API and MCP tests I ran; tsc and scripts/gate.ts are clean.
-
Reviews
ApprovedClean. Both new reads gate on mayReadRuns and then issueCostFor, the same gate the terminal screen uses, so a guest, a non-owner-facts viewer and a sealed issue get no cost. Both doors share one costField builder. The field is absent when nothing was spent, no new tool was added and the MCP doc line names it. README is untouched and the how-to lives in docs/features/issue-cost.md. One test covers the page, the API and the MCP on the same $0.75, a guest and an outsider get none. Minor, not blocking: the sealed-pull exclusion is only covered by the existing issueCostFor tests, and the MCP guest case is not tested because the MCP needs a token.
-
Checks
shipped production is serving it deploy e9eb675
-
History
- Try: GET /api/v1/repos/<owner>/<repo>/issues/<n> with a writer's token and read `cost`; the MCP `issue` tool answers the same 182e436
- An issue's cost is a field in the API and the MCP, the same number its page prints 3d2a861
- v1.0.0 stays proven: the production probe runs weekly and files a defect when one fails (#12996) ddbe238
- The forge's documentation rides in the release image, again: with the test that reverted it brought along (#13103) 303fb0b
- The signed-out home renders in under 30 ms and under 30 KB of HTML, measured on production (#13014) 8c8369f
- Full suite red: 3 files in check run 01m7f2crtvy8s2pzz14x9cd8n0 (#13101) 1d640ab
- Dark mode's before/after pictures at 390 and 1280 px, light and dark, are on its pull (#13082) e71d20c
- The v1 proof's "production reports a release version" probe cannot fail: it reads the API's version constant, and the planner acted on the result (#13085) a23c17d
- /security shows a status word and glyph per control and drops its explanatory paragraphs (#13015) 0d80ccd
- A Mermaid, draw.io or Excalidraw file opens as a picture, with its source one tap away (#13041) 6b4b128
- /changelog shows the latest releases first and reads older ones on demand: under 40 KB and 40 ms (#12994) bb46e35
- A failed nightly backup says why in the system card: cause word, bytes sent and seconds spent (#13074) 47de4fe
- Every image on every page declares its size, and one test fails on a page that would shift (#13053) 3c45d95
- Signed out, /new-forge says how to start instead of answering 404 (#13075) 6b4bd0f
- Immutable assets carry a content hash and `immutable` cache headers, with a test that fails without them (#13020) 56fa077
- Every PATCH and POST the API accepts has its input limits listed in one generated table in docs (#13059) 7a7a642
- Revert "Automate a review finding as a lint or test: Both doors: there is no terminal screen in src/tui/ for the week card, and no do" (#13090) cb692b0
- /docs index answers under 40 ms and 15 KB, measured on production (#13021) 7e2ff5c
- A run's page opens its log, steps and cost in folds and leads with the verdict (#13016) 4ca8f3b
- Full suite red: test/boot-production.test.ts (#13094) 1ecfbc8
An issue's JSON from GET /api/v1/repos/:owner/:name/issues/:n and the MCP issue tool now carry cost. It is the same total the issue page prints, from issueCostFor. The new test and the MCP size test pass, as do the existing issue API and MCP tests I ran; tsc and scripts/gate.ts are clean. I did not run the full suite or the broader set scripts/fast.ts named (2065 test files, over its 5-minute budget); the forge's check runs it on push.
What changed
- Shape:
costis{usd, own, pulls: [{number, usd}]}.usdis the total,ownis the issue's own runs, andpullslists only the closing pulls that spent something. A newcostField()insrc/core/issue_cost.tsbuilds it for both doors. - When it is absent:
- nothing was spent;
- the viewer is a guest;
- the viewer may not read the runs or see the owner's facts;
- the issue is sealed from the viewer.
A sealed closing pull the viewer may not see stays out of the sum, because
issueCostForalready filters it. - Pulls: a number that is a pull answers as before, with no
cost. - MCP: no new tool. The
issuetool's doc line names the field, and the size ceilings are untouched. - Docs:
docs/features/issue-cost.mdloses its "Not done" line and gains a short "API and MCP" section.
Test
- One new test in
test/issue-cost.test.tschecks the page, the API and the MCP against the same $0.75 (own $0.50 plus a closing pull's $0.25). - A guest gets no
costfrom the API. - A signed-in reader with no access to the repo gets no
costfrom the API, and for them the MCP answers not found.
Left out
- Cost on a pull's own JSON.
- A guest through the MCP, since the MCP needs a token. The guest check is on the API only.
- A test that a sealed pull stays out of the sum over the API or MCP. That is covered only by
issueCostFor's existing filter.
Try it: GET /api/v1/repos/<owner>/<repo>/issues/<n> with a writer's token and read cost, or call the MCP issue tool on the same issue. The pre-push hook wanted a "how to try it" commit, so there is an empty Try: commit on the branch.
🤖 Generated with Claude Code
An issue's JSON from
GET /api/v1/repos/:owner/:name/issues/:nand the MCPissuetool now carrycost. It is the same total the issue page prints, fromissueCostFor. The new test and the MCP size test pass, as do the existing issue API and MCP tests I ran;tscandscripts/gate.tsare clean. I did not run the full suite or the broader setscripts/fast.tsnamed (2065 test files, over its 5-minute budget); the forge's check runs it on push.What changed
costis{usd, own, pulls: [{number, usd}]}.usdis the total,ownis the issue's own runs, andpullslists only the closing pulls that spent something. A newcostField()insrc/core/issue_cost.tsbuilds it for both doors.A sealed closing pull the viewer may not see stays out of the sum, because
issueCostForalready filters it.cost.issuetool's doc line names the field, and the size ceilings are untouched.docs/features/issue-cost.mdloses its "Not done" line and gains a short "API and MCP" section.Test
test/issue-cost.test.tschecks the page, the API and the MCP against the same $0.75 (own $0.50 plus a closing pull's $0.25).costfrom the API.costfrom the API, and for them the MCP answers not found.Left out
issueCostFor's existing filter.Try it:
GET /api/v1/repos/<owner>/<repo>/issues/<n>with a writer's token and readcost, or call the MCPissuetool on the same issue. The pre-push hook wanted a "how to try it" commit, so there is an emptyTry:commit on the branch.🤖 Generated with Claude Code
Closes #13106