import{Hn as e}from"./DIQmuJJZ.js";import{t}from"./CxlOpib82.js";var n=[`research`,`consensus`,`architecture_decision`,`specification`,`decomposition`,`implementation`,`validation`,`testing`,`release`,`contribution`,`cancelled`],r={research:1,consensus:2,architecture_decision:3,specification:4,decomposition:5,implementation:6,validation:7,testing:8,release:9,contribution:10,cancelled:11},i=new Set([`contribution`,`cancelled`]);function a(e){return!!e&&i.has(e)}function o(e){return n.includes(e)}function s(r){if(!o(r))throw new t(e.VALIDATION_ERROR,`Invalid pipeline stage: "${r}". Valid stages: ${n.join(`, `)}`,{fix:`Use one of: ${n.join(`, `)}`})}function c(e){let{explicitStage:t,taskType:n,parentTask:r}=e;return t&&o(t)?t:r?.pipelineStage&&o(r.pipelineStage)?r.pipelineStage:n===`epic`?`research`:`implementation`}function l(e){return o(e)?r[e]:-1}function u(e,t){let n=l(e),r=l(t);return n===-1||r===-1?!0:r>=n}function d(i,a){if(s(a),i&&!u(i,a)){let o=l(i),s=l(a);throw new t(e.VALIDATION_ERROR,`Pipeline stage transition rejected: cannot move backward from "${i}" (order ${o}) to "${a}" (order ${s}). Tasks can only move forward through pipeline stages.`,{fix:`Specify a stage at or after "${i}". Valid forward stages: ${n.filter(e=>r[e]>=o).join(`, `)}`})}}export{a,s as c,u as i,d as l,i as n,o,l as r,c as s,n as t};