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

A pure read counts the crew pulls handed to a person after three review rounds in the last 24 h, naming the newest three #6600

Merged opened this

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

Merged

I added `src/flow/handovers.ts`, which counts the pulls handed to a person in the last 24 h and names the newest three. It isn't called from anywhere yet, so nothing on `/flow` shows it. The type check is clean and the four new tests pass. I ran only those, not the full suite.

shipped production is serving it deploy 78f82e5

opened this

I added src/flow/handovers.ts, which counts the pulls handed to a person in the last 24 h and names the newest three. It isn't called from anywhere yet, so nothing on /flow shows it. The type check is clean and the four new tests pass. I ran only those, not the full suite.

  • handovers(rows, now) takes { pull, at }[] with at as an ISO time. It returns { count, newest }, where newest holds up to three pull numbers, newest hand-over first.
  • handoversSays gives one line, for example 4 pulls handed to a person after three review rounds in the last 24 h, newest #11, #13, #12. It returns "" when there are none.
  • Window edge: a note exactly 24 h old counts and one a millisecond older does not. Notes dated in the future or with an unreadable time are ignored.
  • Repeat hand-overs: a pull handed over twice counts once, at its latest note. The issue didn't say this, so it's my call.
  • Tests: test/flow-handovers.test.ts covers the window edge, ordering, a repeated pull and the empty case.

Left out: reading the notes from the database and showing the line on /flow. The issue asked only for the pure read.

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

Closes #6588

commented

I added src/flow/handovers.ts, which counts the pulls handed to a person in the last 24 h and names the newest three. It isn't called from anywhere yet, so nothing on /flow shows it. The type check is clean and the four new tests pass. I ran only those, not the full suite.

  • handovers(rows, now) takes { pull, at }[] with at as an ISO time. It returns { count, newest }, where newest holds up to three pull numbers, newest hand-over first.
  • handoversSays gives one line, for example 4 pulls handed to a person after three review rounds in the last 24 h, newest #11, #13, #12. It returns "" when there are none.
  • Window edge: a note exactly 24 h old counts and one a millisecond older does not. Notes dated in the future or with an unreadable time are ignored.
  • Repeat hand-overs: a pull handed over twice counts once, at its latest note. The issue didn't say this, so it's my call.
  • Tests: test/flow-handovers.test.ts covers the window edge, ordering, a repeated pull and the empty case.

Left out: reading the notes from the database and showing the line on /flow. The issue asked only for the pure read.

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

Approved

Approved. A pure, clock-injected module in the shape of its siblings under src/flow/. The window edge, future and unreadable times, once-per-pull counting, newest-three order and the empty case are each tested. The tie-break (higher pull number first) is deterministic. No input, output or security surface is touched, and it adds no dependency.

It is deliberately unreachable until wired, so nothing in the preview shows it. That fits the stated scope (a pure read). Two things to do next:

  1. Wire it into /flow: read the hand-over notes at the boundary, pass now, and render handoversSays inside the existing flow page. Include the same line in the terminal and the MCP flow read, so both doors show it, with a test through the page.
  2. Add a README line saying what the hand-over count means once it is visible.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs