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

/flow shows the merge queue against its targets: pull check p50 under 8 min, main's full check under 30 min, 60 landed an hour, 90% of queue gates green #17018

Merged opened this

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

Merged

/flow now shows the forge's own merge queue against the owner's four targets for the last 24 hours, with met or missed beside each. The same figures are in the admin JSON and in the terminal.

Notes

opened this

/flow now shows the forge's own merge queue against the owner's four targets for the last 24 hours, with met or missed beside each. The same figures are in the admin JSON and in the terminal.

What changed

  • src/flow/queue_targets.ts (new) works out the four figures for the forge's own repository: its source setting, or FORGE_REPO when that isn't set. Each figure is one indexed read from tables the forge already keeps (run, pull, queue_batch); there is no new table.
    • Pull check: median and p90, verify lanes left out. Target: median under 8 min.
    • Main's full check: median of checks on the default branch that belong to no pull. Target: under 30 min.
    • Landed an hour: pulls merged in each clock hour, median of the 24 hours. Target: 60 or more.
    • Queue gates green: share of judged merge-queue batches that were not red. Target: 90% or more.
  • A figure with nothing in the window says so ("no runs in the last 24 h") instead of showing 0. Sealed pulls' checks and landings don't count, and neither does any other repository.
  • Page: targetsFold in src/web/pages/flow.ts is the first fold, rendered on the server. Its summary reads "N of 4 met in the last 24 h", and it opens by itself when a target is missed. It reuses the .fl-stage rows, and a missed row is marked like the bottleneck. The note is in docs/design/areas/boards.md.
  • JSON: GET /api/v1/telemetry/flow carries queueTargets for the owner reader only.
  • Terminal: the Flow command prints the same lines, from src/tui/screens/flow_targets.ts. The how-to is docs/features/flow-targets.md.
  • I reused medianOf/percentileOf (flow/ship_time.ts), span (flow/pipeline.ts) and forgeSource. scripts/similar.ts found nothing like the new module.

What to look at

  • The gate's queue table, check_gate, records no verdict. So the "gates green" share comes from queue_batch, which has one verdict per batch the queue judged. Bisection re-checks are not counted there.
  • The two check figures count runs that started in the window, so the read can use the run_kind_started index.
  • The duplicate-function check says checkSeconds looks like forksSince (score 0.66). It's only a surface match, so I left it.

Not done

  • There is no history or trend: this is one 24-hour window.
  • An agent reader doesn't get the figures, even with a telemetry grant.

Checks run: bun x tsc --noEmit and bun scripts/design-lint.ts are clean, and bun scripts/gate.ts shows no failing rule. test/queue-targets.test.ts covers windows where every target is met, every one is missed, and the window is empty. It also checks that a sealed pull's or another repository's rows are not counted, and that the page, JSON and terminal say the same. I also ran the flow page, valves, page-budget, doors, hollow, unused-exports, pipeline-steps and terminal flow suites. In one of those runs a single test with no name hit its 5-second limit; a second run of the same suites failed nothing, so I took it as flaky. I didn't run the full suite, since scripts/fast.ts said it was too broad; the forge's check runs it.

[
  {"go": "/flow", "look": "the first fold, \"The merge queue against its targets\"", "expect": "a summary like \"N of 4 met in the last 24 h\", and four rows: Pull check, Main's full check, Landed an hour, Queue gates green, each ending with met or missed, or saying nothing ran", "ask": "Are the four figures readable at a glance next to their targets?"},
  {"go": "/api/v1/telemetry/flow", "look": "the queueTargets key", "expect": "{ repo, targets: [...] } with the same says strings the page shows"}
]

Try: sign in as a forge admin on the preview and open /flow. The first fold holds the targets, and the terminal's Flow command ends with the same lines.

🤖 Generated with Claude Code

Closes #17006

3 earlier comments
commented

/flow now shows the forge's own merge queue against the owner's four targets for the last 24 hours, with met or missed beside each. The same figures are in the admin JSON and in the terminal.

What changed

  • src/flow/queue_targets.ts (new) works out the four figures for the forge's own repository: its source setting, or FORGE_REPO when that isn't set. Each figure is one indexed read from tables the forge already keeps (run, pull, queue_batch); there is no new table.
    • Pull check: median and p90, verify lanes left out. Target: median under 8 min.
    • Main's full check: median of checks on the default branch that belong to no pull. Target: under 30 min.
    • Landed an hour: pulls merged in each clock hour, median of the 24 hours. Target: 60 or more.
    • Queue gates green: share of judged merge-queue batches that were not red. Target: 90% or more.
  • A figure with nothing in the window says so ("no runs in the last 24 h") instead of showing 0. Sealed pulls' checks and landings don't count, and neither does any other repository.
  • Page: targetsFold in src/web/pages/flow.ts is the first fold, rendered on the server. Its summary reads "N of 4 met in the last 24 h", and it opens by itself when a target is missed. It reuses the .fl-stage rows, and a missed row is marked like the bottleneck. The note is in docs/design/areas/boards.md.
  • JSON: GET /api/v1/telemetry/flow carries queueTargets for the owner reader only.
  • Terminal: the Flow command prints the same lines, from src/tui/screens/flow_targets.ts. The how-to is docs/features/flow-targets.md.
  • I reused medianOf/percentileOf (flow/ship_time.ts), span (flow/pipeline.ts) and forgeSource. scripts/similar.ts found nothing like the new module.

What to look at

  • The gate's queue table, check_gate, records no verdict. So the "gates green" share comes from queue_batch, which has one verdict per batch the queue judged. Bisection re-checks are not counted there.
  • The two check figures count runs that started in the window, so the read can use the run_kind_started index.
  • The duplicate-function check says checkSeconds looks like forksSince (score 0.66). It's only a surface match, so I left it.

Not done

  • There is no history or trend: this is one 24-hour window.
  • An agent reader doesn't get the figures, even with a telemetry grant.

Checks run: bun x tsc --noEmit and bun scripts/design-lint.ts are clean, and bun scripts/gate.ts shows no failing rule. test/queue-targets.test.ts covers windows where every target is met, every one is missed, and the window is empty. It also checks that a sealed pull's or another repository's rows are not counted, and that the page, JSON and terminal say the same. I also ran the flow page, valves, page-budget, doors, hollow, unused-exports, pipeline-steps and terminal flow suites. In one of those runs a single test with no name hit its 5-second limit; a second run of the same suites failed nothing, so I took it as flaky. I didn't run the full suite, since scripts/fast.ts said it was too broad; the forge's check runs it.

[
  {"go": "/flow", "look": "the first fold, \"The merge queue against its targets\"", "expect": "a summary like \"N of 4 met in the last 24 h\", and four rows: Pull check, Main's full check, Landed an hour, Queue gates green, each ending with met or missed, or saying nothing ran", "ask": "Are the four figures readable at a glance next to their targets?"},
  {"go": "/api/v1/telemetry/flow", "look": "the queueTargets key", "expect": "{ repo, targets: [...] } with the same says strings the page shows"}
]

Try: sign in as a forge admin on the preview and open /flow. The first fold holds the targets, and the terminal's Flow command ends with the same lines.

🤖 Generated with Claude Code

commented

<!-- look-pages acbb6961f7df --> Look pages for acbb696, from the gate:

  • look pages (named): this pull changes src/web/pages/flow.ts; a commit names /flow
commented

/flow now shows the forge's own merge queue against the owner's targets, measured over the last 24 hours. There are four figures:

  • Pull check: median under 8 min, with p90 shown beside it.
  • Main's full check: median under 30 min.
  • Landed: median of 60 or more pulls merged per hour.
  • Queue gates green: 90% or more of merge-queue batches not red.

Each figure says met or missed. A window with nothing in it says "nothing ran" rather than 0. Sealed pulls and other repositories are not counted. The fold opens when a target is missed. The owner's /api/v1/flow (queueTargets) and the terminal's flow screen show the same four lines, and docs/features/flow-targets.md explains how to read them.

The figures are read from tables the forge already keeps (run, pull, queue_batch), with no new table. The reading is kept for a minute, the same way src/flow/slots.ts keeps the crew's pace. Without that, /flow went from its 61-statement budget to 67 and failed test/pages-budget.test.ts. The budget stays at 61.

test/queue-targets.test.ts covers:

  • met, missed and empty windows
  • sealed pulls and other repositories left out
  • the page, API and terminal giving the same rows
  • the one-minute keep: a read 30 s later returns the kept figures, and a read 2 min later counts new checks.

Checks run: bun x tsc --noEmit and bun scripts/gate.ts --explain (0 fail) pass. I ran 105 test files (the flow, telemetry, page-budget and queue-targets tests) and all 644 tests passed. I did not run the set scripts/fast.ts named, because it was 3,830 files (about 322 minutes); the forge's check runs the full suite.

Not done: no history of the figures over time, and no settings for the targets. The numbers are fixed in QUEUE_TARGETS.

To try it: sign in as the owner, open /flow and look for "The merge queue against its targets".

[{"go":"/flow","look":"#flow-targets","expect":"A fold titled 'The merge queue against its targets' saying 'N of M met in the last 24 h', with four rows: Pull check, Main's full check, Landed an hour, Queue gates green, each with its target and met/missed (or 'no runs in the last 24 h')","ask":"Is a missed figure easy to spot?"}]

🤖 Generated with Claude Code

commented

<!-- look-pages a1ad427d8381 --> Look pages for a1ad427, from the gate:

  • look pages (named): this pull changes src/web/pages/flow.ts; a commit names /flow
Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs