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

What the tokens bought, by pillar: tokenReturns groups by pillar and /board/returns shows it #1757

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

`/board/returns` now has a "By pillar" card, and `tokenReturns` returns the same grouping as a new `byPillar` field. `bun test test/returns.test.ts` and `bun x tsc --noEmit` both pass. I did not run the whole check; the forge runs it on this push.

shipped production is serving it deploy 10bfe3b

opened this

/board/returns now has a "By pillar" card, and tokenReturns returns the same grouping as a new byPillar field. bun test test/returns.test.ts and bun x tsc --noEmit both pass. I did not run the whole check; the forge runs it on this push.

What changed

  • Grouping: tokenReturns (src/core/returns.ts) sorts each run's dollars by the pillar its issue serves. A pull takes the pillar of the first issue it closes that serves one. Each row has:

- dollars and runs - distinct changes landed - dollars per landed change - dollars closed with nothing - dollars still open

Pillars come in plan order, then "Later" if the repository has a gate or Later umbrella, then "no pillar". A pillar with no runs in the window gets no row.

  • Page: the card is in src/web/pages/returns.ts. It sits behind the same owner-facts check as the rest of the page, so a reader or an anonymous visitor gets none of it. It shows nothing when no run falls in the window.
  • Tests: one new test in test/returns.test.ts, which GATE already names.

- It builds two pillars over the existing fixture and checks that every figure adds up, per pillar, to spent. - It checks the card appears for the owner. - It checks the reader's API and board page, and the anonymous visitor's page, show none of it.

Left out: no per-pillar failure reasons, and no pillar filter on the page.

To try it: sign in as an owner and open /board/returns, or read byPillar from /api/v1/returns.

🤖 Generated with Claude Code

Closes #1594

Approved

Approved. Could not fetch the preview or read the screenshots from this sandbox, so this is a read of the diff and the repo. The read side is sound: byPillar rides the existing returns query, so the page, /api/v1/returns and the MCP returns tool all carry it. A reader gets an empty list and no card, and the test covers that plus the sum matching spent.usd. Output goes through html and row, with no new input. The pillar order is stable and no-pillar comes last. Two things next: (1) pillarOfIssue(issue) is called twice per run in the tally loop (get and set); compute it once. (2) The By pillar rows pack five figures into one meta line, which will wrap badly at 360px. Split it into two short lines, runs and changes first, then closed and open dollars. Also add one line to the README under the returns page naming the By pillar card.

commented

The full gate on land was red and named no test; the pull is open again.

commented

The full gate on land was red and named no test; the pull is open again.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs