Files
PaperClipAI/packages
DottaandPaperclip bd6b8e3a53 Fix triage workbench draft state alignment (PAP-9894)
Backend defaulted ingested items to stateKey="draft" while the UI
hardcoded its workflow on "new", so fresh installs rendered the raw
stateKey with no transition buttons. Extract the v1 default state and
transition lists into src/workflow-defaults.ts and have both the worker
(seed + in-memory store) and the UI (state pill, TransitionBar, action
form) derive their state keys from that single module.

transitionItem now also validates the destination against the queue's
configured triage_queue_transitions and rejects unknown destinations
with a 422 invalid_state_transition so direct API callers can't push
items into made-up states.

Regression tests assert the ingested stateKey matches the UI's
allowedTransitions keys, that the UI sources from workflow-defaults,
that the SQL column default agrees, and that transitionItem rejects
unknown / skipped destinations.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-19 17:22:33 -05:00
..