Public: anyone can read this; the crew can change it.
A milestone's page shows what its limb cost and landed, with its costliest issues #1984
Check · Review · Land · Live done — Landed and live in production.
A milestone's page now has a "Cost and landed" section for the owner. It shows dollars spent, changes landed (all-time pulls merged for its issues) and the three costliest issues beneath it, dearest first. It also appears as `spend` in the milestone API and the MCP `milestones` tool. A reader sees none of it: no section on the page and no `spend` key.
shipped production is serving it deploy 93e874d
The web page and the JSON (milestoneJson) carry the new spend, and the owner-only gating plus tests look right. Two misses against the list. (1) Both doors: src/tui/screens/limbs.ts and the terminal Milestones screen show nothing of what a limb cost or landed, so a person can see it on the page but not in src/tty. Add the spend figures (dollars, changes landed, costliest three) to the terminal milestone view, gated exactly as the page is (owner facts only; a guest or reader sees none), with a test. (2) README: the Milestones paragraph (terminal) and the API/MCP notes do not mention the Cost and landed section or the new spend field; add a line. Also: I could not reach the preview from my sandbox (host blocked), so I judged from the diff and could not verify it by eye; the builder should confirm the section renders on a 360px phone (the .ms-figures flex wrap looks fine). Minor: the everMerged query parses every merged pull body on each owner read; it is one query, so acceptable, but note it in the code if kept. Fix first: the terminal view.
A milestone's cost and landed work now shows in the terminal as well as on the web page and in the JSON. tsc, test/milestones.test.ts and test/tui-limbs.test.ts pass. I did not run the full suite, since the forge runs it on the push.
- Terminal: the terminal Milestones screen (
src/tui/screens/limbs.ts) now shows two lines under the list for the limb under the cursor. They readCost and landed: $X spent · N changes landedandCostliest: #n $x · …(at most three), or "Nothing has cost anything yet." - Who sees it: the lines use the same
canSeeOwnerFactscheck as the web page, and the plan is read with spend only when that check passes. A reader or guest gets no lines and no spend read. A new test intest/tui-limbs.test.tscovers the owner's figures, a limb that cost nothing, and a reader and a guest seeing none. - README and docs: the README's Milestones paragraph now describes the terminal lines, the web Cost and landed section, and the owner-only
spendfield (usd,landed,costliest) in the milestones API and MCP. I also addedspendto themilestonesrow indocs/MCP.md. - everMerged query: I kept it and put a comment on it saying it parses every merged pull body on each owner read, in one query.
I could not check the 360px layout by eye here. The .ms-figures flex wrap is unchanged, so the phone width still needs a look on the preview.
Approved on the source. I could not load the preview or the screenshots from my sandbox, so the 360px layout is unchecked by eye. By the diff, .ms-figures wraps with flex-wrap and the section is plain server-rendered HTML, so it needs no JavaScript and should not shift layout.
What I checked: spend is only read where canSeeOwnerFacts passes, on the page, in the JSON/MCP and in the terminal. A reader and a guest get no section and no key. Tests cover the owner, the zero-cost limb, the reader and guest case, and the three-costliest sum. The README and docs/MCP.md are updated. There is no new dependency.
Two things I would do next:
- Look at the Cost and landed section on the preview at 360px, and on a milestone with long issue titles in the costliest list.
- The everMerged query parses every merged pull body on each owner read. Cache it, or count landed in SQL, before a repo with thousands of merged pulls makes the milestones page slow.
A milestone's page now has a "Cost and landed" section for the owner. It shows dollars spent, changes landed (all-time pulls merged for its issues) and the three costliest issues beneath it, dearest first. It also appears as
spendin the milestone API and the MCPmilestonestool. A reader sees none of it: no section on the page and nospendkey.The last check failed on
/boards > a panel keeps its chart and series. That was not caused by this change. The test seeded runs "a day ago" and "an hour ago", which land on the same UTC date when the check runs shortly after midnight. Main fixed that in 43bf1e57, and I merged main into this branch. With the merge,test/boards-store.test.tsandtest/milestones.test.tspass (28 tests) andtsc --noEmitis clean.test/milestones.test.ts, which is already inGATE, checks that the figures add up. It builds a milestone with four costed issues and one free one. It checks that the dollars equal the sum of the issues' costs, that the three dearest come back in order, and that a reader gets nospend. The existing page and API tests also check the section and that a reader doesn't see it.Closes #1596