mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-24 01:41:42 +02:00
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>