Triage

Status: current operational guide. The earlier design exploration, including superseded artifact shapes and unbuilt proposals, is preserved as triage design history.

The intake → triage → handle pipeline sorts items arriving in _content/inbox/. Each stage is observable in the filesystem and can be run independently.

Pipeline

  1. bbx intake prepares top-level inbox items, including filename normalization, then moves ready items through _content/inbox/intake/ to _content/inbox/staged/.
  2. bbx triage classifies each staged item from the box's triage destinations and moves it into _content/inbox/triaged/<category>/.
  3. bbx handle runs each category's procedure over that category's bucket. The procedure decides the item's final location or action.

These commands are not automatically chained by wakeup. Run the stage required for the work at hand; an item left between stages remains available to the next run.

Define a category

A triage category is a landmark card whose destinations frontmatter contains an entry with for: [triage]. That entry supplies the category rules and its handler procedure. Triage discovers these landmark entries across the box; it does not use a separate central registry.

destinations:
  - for: [triage]
    rules: Receipts and purchase confirmations.
    procedure:
      ref: /_config/procedures/file-receipts.procedure.card

The holding-bucket category name is derived from the landmark directory's last path segment, sanitized to safe filename characters. The box root uses root; later collisions gain a parent-directory prefix. It is not derived from the destination's card type. The older <triage-destination> and <navigation> XML shapes are not current.

Confidence and review

The triage agent assigns exactly one confidence level:

There is no numeric confidence score and no wrong level. Question batching, a generated decision tree, and automatic updates to category rules are not implemented.

Handler contract

bbx handle invokes a category's procedure once for its bucket. The current implementation attempts to put the box-relative item paths in the TRIAGE_ITEMS environment variable separated by NUL bytes. Environment variables cannot transport embedded NUL bytes, so this contract is currently broken for a live multi-item procedure invocation. Do not write a handler that depends on parsing this value until the runtime transport is fixed. This guide records the defect rather than presenting the intended shell recipe as usable.

A handler moves or removes every item it successfully finishes. Leaving an item in the bucket keeps it visible for a later run.

The command reports its worst bucket outcome:

Implementation owners