The triage pipeline (intake → triage → handle)

Three stages sort items that land in _content/inbox/ into per-category buckets. Each stage is its own command, run directly:

A category is a landmark whose destinations list carries a for: [triage] entry; that entry names the handler procedure for the bucket.

Jobs are a separate path

Two sorting mechanisms process items that land in _content/inbox/. Don't confuse a job (a card in _bookkeeping/jobs/ that tells the reactor to do a unit of work) with a triaged item (an inbox item routed to a category to await its handler) — they're different things that happen to share the word "intake":

Confidence levels

The triage agent assigns exactly one of three levels to each item (never a numeric score, and never a "wrong"/"unknown" level):

Writing a handler procedure

bbx handle invokes a category's handler procedure once per bucket, passing the bucket's items through the TRIAGE_ITEMS environment variable — one box-relative path per line. It's set in the process env and forwarded into the procedure's shell steps, so a handler reads its work from there rather than scanning a directory:

# In a shell step of the handler procedure:
printf '%s\n' "$TRIAGE_ITEMS" | while IFS= read -r item; do
  process "$item"
done

Split on newlines and quote "$item" — paths may contain spaces. When the handler finishes, it moves each item out of the bucket (bbx mv to its destination, or bbx rm to trash); the bucket is empty when done.

bbx handle reports its worst bucket: exit 1 if a handler procedure failed, exit 3 if one finished its work but its review reached no verdict (one Inconclusive: handle <category> — … line on stderr), exit 0 only when everything that ran was judged.