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

Flow: the week's budget as pipes I can see and turn, and the system does exactly that #8712

Parked opened this in answer to
Closed without merging

/flow now draws the week's budget as pipes, with a valve per repository that the dispatcher obeys on the next tick. I have not seen it rendered. I couldn't take screenshots here, so the 30-second cold read has no screenshots yet.

Notes

stopped parked by the crew deploy 230f659

opened this

/flow now draws the week's budget as pipes, with a valve per repository that the dispatcher obeys on the next tick. I have not seen it rendered. I couldn't take screenshots here, so the 30-second cold read has no screenshots yet. I swapped /flow into app.looks so the forge's own looks of this pull should show it. bun x tsc --noEmit, bun scripts/gate.ts, bun scripts/design-lint.ts and the tests that cover the change pass. The forge runs the full check on push.

What changed

  • The page: /flow is for forge admins and is linked from Boards. Sources (your notes, planner, builders, reviews) run through a valve per repository to shipped. Line width is the last 7 days of real spend. A bare /flow used to redirect to /boards; /flow?… still does, so old drill links keep working.
  • A valve: it is one stored number per repository, 0 shut, 1–99 a share of the week's agent starts, 100 open. A repository with no valve is open. Dragging the slider and releasing posts /flow/valve.
  • The rule: it lives in src/flow/valve.ts as plain data in and out. pump in src/crew/dispatch.ts runs the queue through it after the team dials, and the page's preview uses the same call.
    • Shut: its queued runs wait, and the run log says why.
    • A share: runs start in turn up to that share, rounded up, then yield to other repositories but still start if no other work wants the slot. A share is a ceiling in turn, not a quota.
    • Resumed runs: a run carrying on after a pause is never held.
  • Who can turn one: only a forge admin who is a person. An agent, whatever it was granted, is told not_found, and the POST is same-origin checked. Each turn is kept and announced as valve.turned.
  • Before and after: each valve says what the next tick will do from the current queue. After a turn it says who turned it, from what to what, and how many runs have started since.
  • Suggestions: an admin viewing a repository page is counted per day. With at least 10 looks, and a share of them 10 or more points from the valve, the valve shows "would match N%" with a one-tap button. The server works the level out again on accept, and looks never move a valve.
  • MCP: a new tool valves reads the pipes, and repo plus level plans a turn (dryRun defaults to true). Applying needs an admin-scope token held by a person.
  • Tests and docs: test/flow-valves.test.ts covers determinism, the page, the POST, refusals, suggestions and query plans. The feature is described in docs/features/flow-valves.md, and the new CSS classes are named in docs/design/areas/flow-valves.md. One migration, pinned.

Changes to existing tests and config

  • app.looks is capped at 24 by the manifest. I swapped /pipeline out for /flow, and /pipeline is now listed as not-a-page in test/forge-looks.test.ts.
  • test/flow-pipeline.test.ts now checks the redirect on /flow?out=approved, since bare /flow is the page.
  • valves is added to the tool lists in test/mcp.test.ts and test/conversation-confirm.test.ts.

Not done

  • Hunters are not a source. They don't spend as agent runs, so the pipes show your notes, planner, builders and reviews.
  • No drag-time preview. Words change as you drag; the numbers update on release.
  • No API or terminal screen for valves, only the page and the MCP tool.
  • No dispatcher-level test that pump obeys the gate. It is a three-line call, and the gate is tested against real queued runs.

To try it: sign in as a forge admin, open Boards → Flow, drag a repository's valve to 0 and release, and see its queued runs held.

🤖 Generated with Claude Code

Closes #8698

3 earlier comments
commented

/flow now draws the week's budget as pipes, with a valve per repository that the dispatcher obeys on the next tick. I have not seen it rendered. I couldn't take screenshots here, so the 30-second cold read has no screenshots yet. I swapped /flow into app.looks so the forge's own looks of this pull should show it. bun x tsc --noEmit, bun scripts/gate.ts, bun scripts/design-lint.ts and the tests that cover the change pass. The forge runs the full check on push.

What changed

  • The page: /flow is for forge admins and is linked from Boards. Sources (your notes, planner, builders, reviews) run through a valve per repository to shipped. Line width is the last 7 days of real spend. A bare /flow used to redirect to /boards; /flow?… still does, so old drill links keep working.
  • A valve: it is one stored number per repository, 0 shut, 1–99 a share of the week's agent starts, 100 open. A repository with no valve is open. Dragging the slider and releasing posts /flow/valve.
  • The rule: it lives in src/flow/valve.ts as plain data in and out. pump in src/crew/dispatch.ts runs the queue through it after the team dials, and the page's preview uses the same call.
    • Shut: its queued runs wait, and the run log says why.
    • A share: runs start in turn up to that share, rounded up, then yield to other repositories but still start if no other work wants the slot. A share is a ceiling in turn, not a quota.
    • Resumed runs: a run carrying on after a pause is never held.
  • Who can turn one: only a forge admin who is a person. An agent, whatever it was granted, is told not_found, and the POST is same-origin checked. Each turn is kept and announced as valve.turned.
  • Before and after: each valve says what the next tick will do from the current queue. After a turn it says who turned it, from what to what, and how many runs have started since.
  • Suggestions: an admin viewing a repository page is counted per day. With at least 10 looks, and a share of them 10 or more points from the valve, the valve shows "would match N%" with a one-tap button. The server works the level out again on accept, and looks never move a valve.
  • MCP: a new tool valves reads the pipes, and repo plus level plans a turn (dryRun defaults to true). Applying needs an admin-scope token held by a person.
  • Tests and docs: test/flow-valves.test.ts covers determinism, the page, the POST, refusals, suggestions and query plans. The feature is described in docs/features/flow-valves.md, and the new CSS classes are named in docs/design/areas/flow-valves.md. One migration, pinned.

Changes to existing tests and config

  • app.looks is capped at 24 by the manifest. I swapped /pipeline out for /flow, and /pipeline is now listed as not-a-page in test/forge-looks.test.ts.
  • test/flow-pipeline.test.ts now checks the redirect on /flow?out=approved, since bare /flow is the page.
  • valves is added to the tool lists in test/mcp.test.ts and test/conversation-confirm.test.ts.

Not done

  • Hunters are not a source. They don't spend as agent runs, so the pipes show your notes, planner, builders and reviews.
  • No drag-time preview. Words change as you drag; the numbers update on release.
  • No API or terminal screen for valves, only the page and the MCP tool.
  • No dispatcher-level test that pump obeys the gate. It is a three-line call, and the gate is tested against real queued runs.

To try it: sign in as a forge admin, open Boards → Flow, drag a repository's valve to 0 and release, and see its queued runs held.

🤖 Generated with Claude Code

commented

Pull #8712 failed its check on three tests, and I've pushed fixes for all three. I re-ran the affected test files, bun x tsc --noEmit and bun scripts/gate.ts locally; the forge's full check on this push is the real test.

  • MCP tool index: src/http/mcp/tools/index.ts was stale after I added the valves tool. I regenerated it with bun scripts/mcp-tools.ts.
  • Server-Timing sweep: bare /flow is now a page rather than a redirect. I removed it from the redirect list in test/server-timing-sweep.test.ts and made the page report session and render timings.
  • Asks-first list: I couldn't tell why this one failed in the check, since the log names only the test. It passed here after the index fix. I had already added valves to the list in test/conversation-confirm.test.ts, so I did not change anything else for it.

Everything else in the earlier pull description still stands.

🤖 Generated with Claude Code

commented

Two of the four failing tests are fixed and pushed. The other two, in test/stale_reds.test.ts, still fail, and I did not change them. Only the two fixed tests were re-run, and bun x tsc --noEmit and bun scripts/gate.ts came back clean. I did not re-run the whole suite, so I haven't seen the forge's check on this push.

What I fixed (commit 230f6592):

  • type floor > no declared font-size is under 12px: the pipe labels (.pipe-label and .pipe-repo in src/web/style/content.ts) used 11.5px, so I raised them to 12px.
  • GET /flow is a permanent redirect to /boards: /flow is now the pipes page, so the old test was wrong. I replaced it in test/system-telemetry.test.ts with a check that /flow answers 200 with no redirect for a signed-in owner.

What still fails:

  • a pull past its tries is parked and its issue is ready again: it expects parked and gets re-check queued.
  • the flow report counts stale reds and the keeper names them as a cause: it expects a count of 5 and gets 6.
  • Cause: both fail the same way on main when I run test/stale_reds.test.ts there (2 of its 7 tests fail), and my diff doesn't touch the stale-red code. I left them for a person to look at.
commented

Parked by the crew: the check stayed red through 2 automatic tries

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs