Skip to content

Latest commit

 

History

History
41 lines (26 loc) · 1.22 KB

File metadata and controls

41 lines (26 loc) · 1.22 KB

Queue Guide

The queue module is optional. Use the pure decide() core when you only need a verdict. Use the queue when you want the common persisted-review pattern: pending items, terminal auto decisions, human actions, and an append-only decision log.

Statuses

  • pending_review
  • auto_applied
  • auto_rejected
  • approved
  • rejected
  • edited
  • superseded

edited means a human edited the payload and approved that edited result.

Events

Every action is recorded as a DecisionEvent:

itemId, actor, action, fromStatus, toStatus, note?, at

Auto decisions record events with actor threshold by default. Human methods require an actor string from the caller.

Store Adapters

The package ships an in-memory store for tests, demos, and small local flows. Real apps should adapt their own persistence layer by implementing the Store interface/protocol.

The review queue is just:

query(status: [pending_review])

No UI is included. Apps build their own screens on top of pending() and query().

Callbacks

The queue can call onAutoApply, onAutoReject, onApprove, and onReject. Threshold does not perform app effects itself; callbacks are caller-supplied integration points.