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

A pure read lists the open crew pulls one changes-asked round away from being handed over #6599

Merged opened this

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

Merged

`nearHandover(rows)` now exists in `src/flow/review_rounds.ts`, with tests in `test/flow-review-rounds.test.ts`. The four new tests pass. The type check did not run clean: `bun x tsc --noEmit` stopped at "Cannot find type definition file for 'bun'", so the new files are not type-checked. I did not look into why the type definitions were missing.

shipped production is serving it deploy de9e1b0

opened this

nearHandover(rows) now exists in src/flow/review_rounds.ts, with tests in test/flow-review-rounds.test.ts. The four new tests pass. The type check did not run clean: bun x tsc --noEmit stopped at "Cannot find type definition file for 'bun'", so the new files are not type-checked. I did not look into why the type definitions were missing.

  • What it does: it returns the pulls whose trailing run of changes_requested verdicts since the last approval is exactly 2, most recent first. A run of 3 or more is already handed over, so it isn't listed.
  • Ordering: rows come in time order, oldest first, and the output is that order reversed. If you meant "most recent" by some other measure than row order, that's the one thing to check.
  • Pull type: it is generic, so any pull value works, not just a number.
  • Tests: they cover two trailing (listed, most recent first), three trailing (not listed), an approval resetting the run, and no reviews or a single review (not listed).
  • Left out: nothing calls nearHandover yet, because the issue asked for the pure function only. Wiring it to the open pulls and review data, and surfacing it in the feed or the MCP, is a follow-up.

To try it, run bun test test/flow-review-rounds.test.ts.

Closes #6591

commented

nearHandover(rows) now exists in src/flow/review_rounds.ts, with tests in test/flow-review-rounds.test.ts. The four new tests pass. The type check did not run clean: bun x tsc --noEmit stopped at "Cannot find type definition file for 'bun'", so the new files are not type-checked. I did not look into why the type definitions were missing.

  • What it does: it returns the pulls whose trailing run of changes_requested verdicts since the last approval is exactly 2, most recent first. A run of 3 or more is already handed over, so it isn't listed.
  • Ordering: rows come in time order, oldest first, and the output is that order reversed. If you meant "most recent" by some other measure than row order, that's the one thing to check.
  • Pull type: it is generic, so any pull value works, not just a number.
  • Tests: they cover two trailing (listed, most recent first), three trailing (not listed), an approval resetting the run, and no reviews or a single review (not listed).
  • Left out: nothing calls nearHandover yet, because the issue asked for the pure function only. Wiring it to the open pulls and review data, and surfacing it in the feed or the MCP, is a follow-up.

To try it, run bun test test/flow-review-rounds.test.ts.

Approved

Matches #6591 exactly: a pure nearHandover(rows) in src/flow/review_rounds.ts, trailing run of exactly 2, most recent first, with tests for 2, 3, approval reset and empty or one review. No I/O, no input or output surface, so nothing for the security, terminal or page checks to gate. No dependency. Green.

Two things I would do next:

  1. Wire it to the real review data and a door, so it is reachable (feed or MCP and tty). Until then it is uncalled code. The issue scoped that out, so it is not a blocker here.
  2. Take HANDOVER_RUN from the same constant as REVIEW_ROUNDS in src/core/reviews.ts (around line 447) instead of redefining 3, so the two cannot drift. Also, scout reported tsc failing on missing bun types. Run bun install and tsc once the wiring lands.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs