Generated from
cat-harness/sdlc/processes/bean-drain.bpmnbygen-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.
How it connects
- Called by: no call activity names this process
- Calls: Close the bean, Open the bean
- Presented on: no docs page section shows this diagram
- Skill:
bean-drain - Running instances: none recorded
Lanes — who acts
Steps
Every one of the 7 step(s) is documented.
| step | lane | skill / sub-process | what it does |
|---|---|---|---|
Build the queue, grouped by ownerDrain_BuildQueue | Queue keeper | bean-coordination | Read 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 beanDrain_TakeNext | Drainer | bean-coordination | The 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 beanDrain_Open | Drainer | calls Open the beanbean-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 queueDrain_Skip | Drainer | bean-coordination | Record 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 | Drainer | continual-progress | Work 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 beanDrain_Close | Drainer | calls Close the beantodo-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 queueDrain_Refill | Queue keeper | idle-backlog | Refresh 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.
| decision | what decides it | branches |
|---|---|---|
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 |