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

A pure read says the crew's build yield over 24 hours: build runs finished, how many pushed, and how many of those pulls landed #6482

Merged opened this

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

Merged

This adds `readBuildYield(db, now, publicOnly)` in `src/flow/build_yield.ts`, which returns `{ finished, pushed, landed, closed }` for the last 24 hours. The five new tests in `test/flow-build-yield.test.ts` pass. The type check could not run here: `tsc` fails because it cannot find the `bun` type definitions, even after `bun install`. The forge's check will run it.

shipped production is serving it deploy 7cfd21c

opened this

This adds readBuildYield(db, now, publicOnly) in src/flow/build_yield.ts, which returns { finished, pushed, landed, closed } for the last 24 hours. The five new tests in test/flow-build-yield.test.ts pass. The type check could not run here: tsc fails because it cannot find the bun type definitions, even after bun install. The forge's check will run it.

  • Finished: agent runs whose finished_at falls in the 24 hours before now. Review runs (reason = 'review') are left out, since the issue asks for build runs.
  • Pushed: a run pushed when a pull on its branch, in its repository, got a pull.pushed or pull.opened event between the run's start and end. Pulls are matched to runs by branch, the way pipeline.ts does it.
  • Landed and closed: distinct pulls among those pushed, as they stand now. A pull that merged counts as landed, one closed without a merge counts as closed, and one still open counts in neither. Two runs that pushed to the same pull count twice in pushed but once in landed.
  • publicOnly: when set, private repositories are left out, same as the other flow reads.

The tests seed the four cases from the issue (pushed and merged, pushed and open, pushed and closed, never pushed). They also cover:

  • a push outside the run's time span;
  • the 24-hour edge;
  • a review run;
  • two runs on one pull;
  • publicOnly.

I did not wire the read into any route, page or MCP tool. The issue lists only the module and its test, so nothing calls it yet.

Closes #6474

Approved

Matches the pure-read series (vitals, outsiders, lead_time): one small module, plain data out, one query, publicOnly filters on the run repo, no writes, no input, no dependency. Tests cover merged/open/closed/never-pushed, push outside the run span, review runs excluded, the 24h edge, two runs on one pull (pushed twice, landed once) and publicOnly. It is a read with no door yet, as the issue scoped it. Next: (1) wire readBuildYield into the flow screen and telemetry next to readVitals so a person and an agent can reach it, with a tty/MCP test. (2) Add a test where the merge path sets the real issue.state on a landed pull, so landed stays correct if merged pulls are stored as closed.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs