Generated from cat-harness/sdlc/processes/bean-drain.bpmn by gen-processes-viz.ts — do not edit here. All processes · cat-harness processes

Drain the beans

Process_BeanDrain · strict · 7 step(s)

Draining open beans with several agents at once, as part of the SDLC: build one queue grouped by owner, then take a bean, open it, work it, close it, and take the next — refilling from the deepest queue when a drainer’s list runs dry, until nothing drainable is left.

You are in this process when you are asked to drain beans, when you spawn drainers, or when you pull from a shared queue next to other agents. Each bean still goes through the ordinary OPEN and CLOSE (Process_BeanOpen, Process_BeanClose); what the drain adds is the queue around them, and the rule that a bean another agent holds is skipped, not worked. The queue is advisory: it says who should take a bean, and only OPEN’s claim says who did.

BPMN diagram: Drain the beans

How it connects

Lanes — who acts

lanerolewhat it does here
Queue keepersession-coordinatorHolds the queue file and nothing else: builds it from every bean copy, grouped by owner with what was left out and why, and refills a drainer whose list runs dry. It never claims — a queue entry says who should take a bean, and only the drainer’s OPEN says who did. One agent can hold this lane and the drainer lane at once.
Drainerauthoring-agentTakes beans from its own list one at a time and runs each through OPEN, the work and CLOSE before it takes the next. Its only bean writes are the ones OPEN and CLOSE make; a bean OPEN finds is someone else’s is marked skip on the queue and left alone. It asks for a refill rather than picking from another owner’s list.

Steps

Every one of the 7 step(s) is documented.

steplaneskill / sub-processwhat it does
Build the queue, grouped by owner
Drain_BuildQueue
Queue keeperbean-coordinationRead every bean copy, not only the one this checkout mounts; where copies disagree the newest updated_at wins and the disagreement is listed. Leave out goals and epics, blocked beans, closed or draft ones, owner-held or parked ones, and beans the drainers cannot reach — each with its reason, so nothing vanishes silently. Group the rest by owner in priority order, mark beans other agents hold as skip, and write one shared queue file. The drain-queue Tool (bean n7x7) builds this; until it is defined, the step is the skill’s.
Take the next bean
Drain_TakeNext
Drainerbean-coordinationThe highest-priority bean on this drainer’s list that is not marked skip. Taking it is not claiming it: the queue is advisory, so the bean still goes through OPEN’s check before any work, including reading code for it.
Open the bean
Drain_Open
Drainercalls Open the bean
bean-coordination
Process_BeanOpen on the bean just taken: check it, find out whose it is, and claim it — or leave it alone when another agent holds it. OPEN’s check is where the drain’s claim check runs (the bean-claim-check Tool, bean n7x7): recent commits on every bean copy and any open PR naming the bean, before the claim. The gateway after this reads which end OPEN reached.
Mark it skip on the queue
Drain_Skip
Drainerbean-coordinationRecord on the queue file that the bean is held elsewhere, and by whom, so no other drainer takes it next. The bean itself is not touched: closing or noting on someone else’s bean is how a sibling loses work it had not finished reporting.
Work the bean (PR at the first commit)
Drain_Work
Drainercontinual-progressWork only the bean OPEN claimed. Open the PR at the first commit with Closes-bean: <id> in its body — the open PR is the claim every other agent can see without the bean branch — and add its link to the bean on every copy. A cause found inside the bean that is separate work becomes a new bean, checked and claimed in its own right. A bean that waits on the owner is asked through ask-the-person, keeps its claim while the question is open, and goes to CLOSE as blocked if it will wait long.
Close the bean
Drain_Close
Drainercalls Close the bean
todo-manager
Process_BeanClose on the bean just worked: complete and archive it on evidence, scrap it with its reasons, or record its blocker and hand it back to todo. On every bean copy. More of the drain follows, so on the drain’s own bean the engine notes rather than resolves (see the process comment); then the drainer takes the next bean.
Refill from the deepest queue
Drain_Refill
Queue keeperidle-backlogRefresh the queue file from every bean copy — beans closed, claimed or unblocked since it was built change it — and move beans from the deepest owner’s list to the drainer that ran dry. The drain-queue Tool (bean n7x7) rebuilds the queue; until it is defined, the step is the skill’s.

Decisions

Every one of the 3 decision(s) is documented.

decisionwhat decides itbranches
A bean left on your list?
Drain_More
Read off the drainer’s own list in the queue file. yes takes the next bean in priority order. list empty asks the queue keeper for a refill — never a bean from another owner’s list. Reached after the queue is built and after each bean is closed or skipped.yes → Take the next bean
list empty → Refill from the deepest queue
Bean claimed?
Drain_Claimed
Reads which end Process_BeanOpen reached. claimed: the bean is in progress under this drainer and is worked next. not yours: another agent or a human holds it, nothing was written to it, and the drainer marks it skip and moves on rather than stopping the drain.claimed → Work the bean (PR at the first commit)
not yours → Mark it skip on the queue
Anything left to drain?
Drain_Refilled
Answered by the refreshed queue. refilled: the drainer’s list has beans again, and it takes the next one straight away. queue empty: every drainable bean is closed, held by another agent, or left out with its reason, and the drain ends.refilled → Take the next bean
queue empty → Queue drained

folio-assistant — code under the Apache License 2.0, documentation under CC BY 3.0. Generated schema and API references are rebuilt from source on every push to main.

deployed dev