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

The flow vitals carry gate minutes and the red-batch rate, and a rate over 30% is named as a miss #6775

Merged opened this

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

Merged

The flow vitals now carry gate minutes and the red-batch rate, and a rate over 30% is named as a miss. The type check passes, as do the flow, governor and `mcp-size` tests. I did not run the whole suite; the forge's check does that on the push.

shipped production is serving it deploy 4915f35

opened this

The flow vitals now carry gate minutes and the red-batch rate, and a rate over 30% is named as a miss. The type check passes, as do the flow, governor and mcp-size tests. I did not run the whole suite; the forge's check does that on the push.

What changed (src/flow/vitals.ts)

  • Vitals gains gateMinutes1h and pullCheckMinutes1h from readGateMinutes, and redBatchRate from readRedBatches. Both readers get the same publicOnly as the rest of the reading.
  • I added a fourth field, batches6h (batches finished in 6 h). The miss needs it for the "at least 3 batches" rule, and redBatchRate alone can't carry it.
  • vitalsMisses adds "N% of merge batches went red in 6 h" when the rate is over 0.3 and at least 3 batches finished. Exactly 0.3 is not a miss, and neither is a rate over 2 batches.
  • vitalsLine and vitalsWords both gain "gate N min, other checks N min in 1 h" and "N% of M batches red in 6 h". The rate part is left out when no batch finished. Home, the tick line, the terminal flow screen and the MCP flow tool all read from those two functions, so they all show the new fields. I added no tool, and mcp-size passes.

Tests

  • A new test in test/flow-vitals.test.ts covers the thresholds (0.3 and the minimum of 3) and the new words in both lines.
  • I updated the existing fixtures and expectations for the extra fields in test/flow-vitals.test.ts, test/flow-clog-prevent.test.ts and src/crew/governor.test.ts.

Left out

  • No home-specific styling for the new parts. They are plain text in the existing line.
  • No wording for a rate that is high but under 3 batches. It shows in the line but is not called a miss.

Try it

  • Run bun test test/flow-vitals.test.ts.
  • On a running app, the MCP flow tool shows the new fields.

Closes #6428

commented

The flow vitals now carry gate minutes and the red-batch rate, and a rate over 30% is named as a miss. The type check passes, as do the flow, governor and mcp-size tests. I did not run the whole suite; the forge's check does that on the push.

What changed (src/flow/vitals.ts)

  • Vitals gains gateMinutes1h and pullCheckMinutes1h from readGateMinutes, and redBatchRate from readRedBatches. Both readers get the same publicOnly as the rest of the reading.
  • I added a fourth field, batches6h (batches finished in 6 h). The miss needs it for the "at least 3 batches" rule, and redBatchRate alone can't carry it.
  • vitalsMisses adds "N% of merge batches went red in 6 h" when the rate is over 0.3 and at least 3 batches finished. Exactly 0.3 is not a miss, and neither is a rate over 2 batches.
  • vitalsLine and vitalsWords both gain "gate N min, other checks N min in 1 h" and "N% of M batches red in 6 h". The rate part is left out when no batch finished. Home, the tick line, the terminal flow screen and the MCP flow tool all read from those two functions, so they all show the new fields. I added no tool, and mcp-size passes.

Tests

  • A new test in test/flow-vitals.test.ts covers the thresholds (0.3 and the minimum of 3) and the new words in both lines.
  • I updated the existing fixtures and expectations for the extra fields in test/flow-vitals.test.ts, test/flow-clog-prevent.test.ts and src/crew/governor.test.ts.

Left out

  • No home-specific styling for the new parts. They are plain text in the existing line.
  • No wording for a rate that is high but under 3 batches. It shows in the line but is not called a miss.

Try it

  • Run bun test test/flow-vitals.test.ts.
  • On a running app, the MCP flow tool shows the new fields.
Approved

Approved. It does what #6428 asks: gate minutes and the red-batch rate are in the vitals and in both lines, and a rate over 30% across at least 3 batches is a miss. It reuses the existing readers with the same publicOnly, adds no dependency, and the threshold edges (0.3, 2 vs 3 batches, null) are tested. The words reach the home, tick, terminal and MCP doors through vitalsLine/vitalsWords. Next: (1) add a test that seeds queue_batch rows and checks readVitals fills batches6h and redBatchRate. Today only the empty case and hand-built Vitals are covered, so the wiring from the reader into the vitals is untested. (2) Say when the rate is high but under 3 batches, for example "(too few batches to call)", so a reader of the line does not wonder why a 100% rate is not flagged.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs