Task Pipeline (β)
β is the ordered life of a unit of work. Every external caller that asks Colibri to “do something” ends up inside a β record. The pipeline’s job is to move that record through a state machine no one can skip, shortcut, or silently delete.
Phase 0 target: the 8-state finite-state machine. Authoritative ordering spec: ../../spec/s15-gsd-contract.md. Authoritative state-model spec: ../../spec/s03-state-model.md.
The Phase 0 FSM
INIT → GATHER → ANALYZE → PLAN → APPLY → VERIFY → DONE
(+ CANCELLED as a terminal)
Eight states. Seven forward transitions plus one terminal cancel. There is no “PAUSED” and no “RETRY” as first-class states — retries re-enter GATHER with a new attempt counter.
| State | What happens | Exit condition |
|---|---|---|
INIT |
Task accepted; id assigned; priority scored; parent/child links resolved | Required inputs materialize |
GATHER |
Context collected: repo state, prior decisions, skill set, dependencies | Context complete |
ANALYZE |
Problem framed; constraints enumerated; approach options generated | At least one approach chosen |
PLAN |
Chosen approach decomposed into an execution packet | Packet written and frozen |
APPLY |
Packet executed; source edits, tool calls, skill invocations | Packet steps all complete or first hard failure |
VERIFY |
Acceptance criteria checked; tests run; proofs generated | Pass/fail decision emitted |
DONE |
Writeback: task_update(status=done) + final thought_record + optional merkle_finalize |
Terminal |
CANCELLED |
Explicit abandon, with reason in a thought_record |
Terminal |
Transition rules
- No skipping.
ANALYZEcannot transition straight toAPPLY; the packet must exist. - Verification is not optional.
APPLYalways transitions toVERIFY, even if APPLY failed — verification records the failure. - Cancel is terminal and recorded. A cancelled task still writes a
thought_recorddescribing the reason. - Retries re-enter GATHER. A
VERIFYfailure that the engine classifies as transient re-entersGATHERwith the attempt counter bumped; a permanent failure goes toCANCELLEDwith reasonverify_permanent_fail.
Priority
Each task carries a two-axis priority: urgency (0–3) and importance (0–3). The pipeline’s scheduler is an Eisenhower matrix: urgent-and-important ahead of important-not-urgent ahead of urgent-not-important ahead of everything else. Tie-breakers: creation timestamp, then id.
Pool strategies
β dispatches work to skill pools. Five strategies are specified:
- Dedicated — one pool per skill family; no cross-assignment.
- Shared — one pool services several skills; assignment by capability tag.
- Priority-lane — high-priority tasks get a reserved slice of the pool.
- Fair-share — pool time divided proportionally by tenant or project.
- Spillover — a saturated pool overflows into a designated backup pool.
Phase 0 runs strategy 1 only. The others are specified because the schema must be stable enough to add them without a migration.
Writeback contract
Every completed task (whether DONE or CANCELLED) produces, in this order:
task_update(id=<task_id>, status=<done|cancelled>, progress=100)
thought_record(type=reflection, content=<writeback body>)
For proof-grade tasks (any task in the legitimacy axis or flagged proof_grade=true), the sequence extends:
audit_session_start(...)
... work happens ...
audit_verify_chain(...)
thought_record(type=reflection, ...) ← MUST come before merkle_finalize
merkle_finalize(...)
merkle_root(...)
The final thought_record MUST precede merkle_finalize; otherwise the reflection is not anchored and the proof does not cover the closing reasoning. See ../../agents/writeback-protocol.md.
Phase 0 enforcement level
Writeback is enforced at convention level in Phase 0: the runtime accepts a task closed without writeback but flags it via an orphan scan. Hard runtime block is a later-phase upgrade. This mirrors the donor AMS posture called out in ../../spec/s15-gsd-contract.md.
The 19-tool Phase 0 surface
Eight of the 19 Phase 0 tools per ADR-004 are β tools:
task_create, task_list, task_get, task_update, task_cancel, task_next_actions, task_link, task_unlink.
No task_delete — terminal states are immutable except through the decision-trail record. A task can be CANCELLED but not erased.
What β is not
- β is not a queue. A queue is an implementation detail inside
APPLY; the pipeline is a state machine around it. - β is not a scheduler. Task priority is scored, but when a scored task actually runs is the dispatch layer’s problem.
- β is not the proof store. The Merkle root lives in η; β records declare that a proof was requested, but they do not hold the bytes.
See also
skill-registry.md— ε, where the pools that β dispatches to are registereddecision-trail.md— ζ, where every state transition leaves a record../physics/laws/proof-store.md— η, where completed proof-grade tasks anchor their Merkle root../../spec/s15-gsd-contract.md— GSD contract (authoritative ordering)../../spec/s03-state-model.md— state model (authoritative transition rules)../../architecture/decisions/ADR-004-tool-surface.md— the 19-tool Phase 0 surface