ex-workflow 0.3.0-stage → 0.6.0-stage

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/CHANGELOG.md +52 -1
  2. package/README.md +73 -30
  3. package/dist/adapters/index.cjs +1 -1
  4. package/dist/adapters/index.mjs +1 -1
  5. package/dist/{roles-BLBRKhUZ.d.ts → budget-Cx63FX2K.d.ts} +9 -2
  6. package/dist/{roles-aneKYJ3Z.d.cts → budget-JyNKxP5N.d.cts} +9 -2
  7. package/dist/{chunk-7HZXZF3L.cjs → chunk-2OVYXXNV.cjs} +2 -2
  8. package/dist/chunk-2OVYXXNV.cjs.map +1 -0
  9. package/dist/chunk-3CLDZCHN.cjs +2 -0
  10. package/dist/chunk-3CLDZCHN.cjs.map +1 -0
  11. package/dist/chunk-5TXYMLBF.mjs +3 -0
  12. package/dist/chunk-5TXYMLBF.mjs.map +1 -0
  13. package/dist/chunk-7CDGPTEJ.mjs +2 -0
  14. package/dist/chunk-7CDGPTEJ.mjs.map +1 -0
  15. package/dist/chunk-7IG6EQI4.mjs +6 -0
  16. package/dist/chunk-7IG6EQI4.mjs.map +1 -0
  17. package/dist/chunk-GT57PLUT.mjs +2 -0
  18. package/dist/chunk-GT57PLUT.mjs.map +1 -0
  19. package/dist/chunk-IHE5K4X3.mjs +2 -0
  20. package/dist/chunk-IHE5K4X3.mjs.map +1 -0
  21. package/dist/chunk-KF5VQH3M.mjs +2 -0
  22. package/dist/chunk-KF5VQH3M.mjs.map +1 -0
  23. package/dist/chunk-MH66G5KV.cjs +2 -0
  24. package/dist/chunk-MH66G5KV.cjs.map +1 -0
  25. package/dist/chunk-N3QB2S7R.cjs +2 -0
  26. package/dist/chunk-N3QB2S7R.cjs.map +1 -0
  27. package/dist/chunk-NA53TZE4.mjs +2 -0
  28. package/dist/chunk-NA53TZE4.mjs.map +1 -0
  29. package/dist/chunk-TEPK5Y36.mjs +2 -0
  30. package/dist/chunk-TEPK5Y36.mjs.map +1 -0
  31. package/dist/chunk-UBFIKDIP.cjs +2 -0
  32. package/dist/chunk-UBFIKDIP.cjs.map +1 -0
  33. package/dist/chunk-UUOMQMWT.cjs +2 -0
  34. package/dist/chunk-UUOMQMWT.cjs.map +1 -0
  35. package/dist/chunk-WOGK54HB.cjs +3 -0
  36. package/dist/chunk-WOGK54HB.cjs.map +1 -0
  37. package/dist/chunk-YRATJT7P.cjs +6 -0
  38. package/dist/chunk-YRATJT7P.cjs.map +1 -0
  39. package/dist/chunk-Z3PU6EBI.mjs +2 -0
  40. package/dist/chunk-Z3PU6EBI.mjs.map +1 -0
  41. package/dist/chunk-ZTE7LREB.cjs +2 -0
  42. package/dist/chunk-ZTE7LREB.cjs.map +1 -0
  43. package/dist/cli/bin.cjs +1 -1
  44. package/dist/cli/bin.cjs.map +1 -1
  45. package/dist/cli/bin.mjs +1 -1
  46. package/dist/cli/bin.mjs.map +1 -1
  47. package/dist/cli/index.cjs +1 -1
  48. package/dist/cli/index.mjs +1 -1
  49. package/dist/index.cjs +1 -1
  50. package/dist/index.cjs.map +1 -1
  51. package/dist/index.d.cts +36 -13
  52. package/dist/index.d.ts +36 -13
  53. package/dist/index.mjs +1 -1
  54. package/dist/index.mjs.map +1 -1
  55. package/dist/kanban/index.cjs +1 -1
  56. package/dist/kanban/index.mjs +1 -1
  57. package/dist/schema/index.cjs +2 -0
  58. package/dist/schema/index.cjs.map +1 -0
  59. package/dist/schema/index.d.cts +57 -0
  60. package/dist/schema/index.d.ts +57 -0
  61. package/dist/schema/index.mjs +2 -0
  62. package/dist/schema/index.mjs.map +1 -0
  63. package/dist/scrum/index.cjs +1 -1
  64. package/dist/scrum/index.d.cts +18 -3
  65. package/dist/scrum/index.d.ts +18 -3
  66. package/dist/scrum/index.mjs +1 -1
  67. package/dist/types.d.cts +32 -3
  68. package/dist/types.d.ts +32 -3
  69. package/dist/waterfall/index.cjs +1 -1
  70. package/dist/waterfall/index.d.cts +2 -0
  71. package/dist/waterfall/index.d.ts +2 -0
  72. package/dist/waterfall/index.mjs +1 -1
  73. package/package.json +18 -2
  74. package/dist/chunk-23P7C25E.cjs +0 -2
  75. package/dist/chunk-23P7C25E.cjs.map +0 -1
  76. package/dist/chunk-2IKIBB73.cjs +0 -2
  77. package/dist/chunk-2IKIBB73.cjs.map +0 -1
  78. package/dist/chunk-4A4TD4MH.cjs +0 -2
  79. package/dist/chunk-4A4TD4MH.cjs.map +0 -1
  80. package/dist/chunk-6R3YFUUV.cjs +0 -6
  81. package/dist/chunk-6R3YFUUV.cjs.map +0 -1
  82. package/dist/chunk-7HZXZF3L.cjs.map +0 -1
  83. package/dist/chunk-AUZIQPFT.cjs +0 -2
  84. package/dist/chunk-AUZIQPFT.cjs.map +0 -1
  85. package/dist/chunk-BJEOTG6P.mjs +0 -2
  86. package/dist/chunk-BJEOTG6P.mjs.map +0 -1
  87. package/dist/chunk-FLCYD2QF.mjs +0 -2
  88. package/dist/chunk-FLCYD2QF.mjs.map +0 -1
  89. package/dist/chunk-NN3XJUHP.cjs +0 -2
  90. package/dist/chunk-NN3XJUHP.cjs.map +0 -1
  91. package/dist/chunk-P4P4JTE5.mjs +0 -2
  92. package/dist/chunk-P4P4JTE5.mjs.map +0 -1
  93. package/dist/chunk-R27STIER.mjs +0 -2
  94. package/dist/chunk-R27STIER.mjs.map +0 -1
  95. package/dist/chunk-TMKCALFT.cjs +0 -2
  96. package/dist/chunk-TMKCALFT.cjs.map +0 -1
  97. package/dist/chunk-UOGNVWVO.mjs +0 -2
  98. package/dist/chunk-UOGNVWVO.mjs.map +0 -1
  99. package/dist/chunk-VGD4V5BA.mjs +0 -6
  100. package/dist/chunk-VGD4V5BA.mjs.map +0 -1
  101. package/dist/chunk-WOKNWJKU.mjs +0 -2
  102. package/dist/chunk-WOKNWJKU.mjs.map +0 -1
  103. package/dist/chunk-ZX4DAMTG.mjs +0 -2
  104. package/dist/chunk-ZX4DAMTG.mjs.map +0 -1
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkN3QB2S7R_cjs=require('./chunk-N3QB2S7R.cjs'),chunkZTE7LREB_cjs=require('./chunk-ZTE7LREB.cjs'),chunkS3BXVHO7_cjs=require('./chunk-S3BXVHO7.cjs'),exsorted=require('exsorted');var we=["todo","in_progress","blocked","review","awaiting_human","done","dropped"];function Se(i){let n=i.events.filter(o=>o.type==="sprint.closed"&&o.payload.reason!=="cancel");return n.length===0?null:n.reduce((o,r)=>o+r.payload.doneWeight,0)/n.length}function fe(i){let n=chunkZTE7LREB_cjs.P(i),o=Object.fromEntries(we.map(t=>[t,0])),r=[],y=0;for(let t of n?.committed??[]){let e=i.items[t];if(e){o[e.status]+=1,e.status!=="done"&&(y+=e.weight??0);for(let s of e.blockers)s.clearedAt||r.push({item:t,blocker:s.id,owner:s.owner,reason:s.reason});}}let p=n?.spent??{tokens:0,turns:0,wallclockMs:0},g=n?chunkZTE7LREB_cjs.M(n.budget,n.spent):{},h=Se(i),w="unknown";if(n&&h!==null&&n.budget.tokens){let t=(g.tokens??0)/n.budget.tokens;w=y<=h*t?"on-track":"at-risk";}let c=i.lessons.filter(t=>t.status==="raised").length;return {sprint:n?.id??null,goal:n?.goal??null,byStatus:o,blockers:r,spent:p,remaining:g,remainingWeight:y,raisedLessons:c,velocity:h,forecast:w}}function z(i){for(let n=i.iterations.length-1;n>=0;n--){let o=i.iterations[n];if(o.endedAt!==void 0)return o}}function H(i,n){return i.events.find(o=>o.type==="sprint.closed"&&o.payload.id===n)?.seq??Number.POSITIVE_INFINITY}function Ce(i){let n=new Set(z(i)?.carryover??[]),o=Object.values(i.items).filter(r=>r.stage==="backlog"&&r.status==="todo"&&r.type!=="question");return exsorted.timSort([...o],(r,y)=>{let p=n.has(r.id)?1:0,g=n.has(y.id)?1:0;return p!==g?g-p:(y.priority??0)-(r.priority??0)})}function me(i,n){let o=chunkZTE7LREB_cjs.u(i,n);(o.stage!=="backlog"||o.status!=="todo")&&chunkS3BXVHO7_cjs.b("invalid-input",`item "${n}" is not in the Product Backlog (${o.stage}/${o.status})`,"only backlog items can be committed",{items:[n]}),chunkZTE7LREB_cjs.E(i,o,chunkZTE7LREB_cjs.p(i,"backlog").exitPolicy,"enter the Sprint Backlog");}function ue(i,n,o,r,y){let p=i;for(let g of Object.values(i.items))g.type!=="question"||g.parent===void 0||!n.includes(g.parent)||g.status==="done"||g.status==="dropped"||((g.stage!=="sprint"||g.status!=="todo")&&(p=chunkZTE7LREB_cjs.x(p,g.id,{stage:"sprint",status:"todo"},r,y)),p=chunkZTE7LREB_cjs.s(p,g.id,h=>({...h,iteration:o})));return p}function U(i,n){return {...i,config:{...$(i),definitionOfDone:n},stages:i.stages.map(o=>o.id==="review"?{...o,exitPolicy:n}:o)}}function Pe(i,n){let o=$(i),r=[],y=[],p=chunkZTE7LREB_cjs.p(i,"backlog").exitPolicy,g=0;for(let h of Ce(i)){let w=chunkZTE7LREB_cjs.D(i,h,p);if(w.length>0){y.push({id:h.id,reason:"policy",detail:w.map(c=>c.message).join("; ")});continue}if(n.turns!==void 0&&r.length>=n.turns){y.push({id:h.id,reason:"budget",detail:"turns budget full"});continue}if(n.tokens!==void 0){let c=chunkZTE7LREB_cjs.O(i,h.weight,o.fallbackTokensPerWeight,o.estimateMode);if(g+c>n.tokens){y.push({id:h.id,reason:"budget",detail:`needs about ${c} tokens, ${n.tokens-g} left`});continue}g+=c;}r.push(h.id);}return {ids:r,skipped:y}}function X(i){let n=(t,e,s,l)=>chunkZTE7LREB_cjs.W(t,i(),{type:e,by:s.by,payload:s},a=>l(a,chunkZTE7LREB_cjs.a(s.now)));return {refine:(t,e)=>{chunkZTE7LREB_cjs.o(t,e.by,"define-acceptance","deliver");let s=e.items??[],l=e.split??[],a=e.reestimate??[];(!Array.isArray(a)||!a.every(f=>typeof f=="string"))&&chunkS3BXVHO7_cjs.b("invalid-input","refine.reestimate must be a list of item ids",'pass reestimate: ["A"]');let m=a;s.length===0&&l.length===0&&m.length===0&&chunkS3BXVHO7_cjs.b("invalid-input","refine needs items[], split[] or reestimate[]","pass at least one patch, split or reestimate");for(let f of m){let v=chunkZTE7LREB_cjs.u(t,f);(v.stage!=="backlog"||v.status!=="todo"||v.weight===void 0)&&chunkS3BXVHO7_cjs.b("invalid-input",`item "${f}" has no weight to confirm in the Product Backlog`,"refine it with a patch { weight } instead",{items:[f]});}return n(t,"ceremony.refine",e,(f,v)=>{for(let{id:d,patch:C}of s)f=chunkZTE7LREB_cjs.w(f,d,C,e.by,v);for(let d of m)f=chunkZTE7LREB_cjs.c(f,"item.reestimated",e.by,{id:d,weight:chunkZTE7LREB_cjs.u(f,d).weight},v);for(let d of l){chunkZTE7LREB_cjs.u(f,d.from);for(let C of d.into)f=chunkZTE7LREB_cjs.v(f,{...C,parent:d.from},e.by,v);f=chunkZTE7LREB_cjs.x(f,d.from,{status:"dropped"},e.by,v);}return chunkZTE7LREB_cjs.c(f,"ceremony.refine",e.by,{edited:s.map(d=>d.id),split:l.map(d=>({from:d.from,into:d.into.map(C=>C.id)})),reestimated:m},v)})},plan:(t,e)=>{chunkZTE7LREB_cjs.o(t,e.by,"facilitate");let s=e.goal;(typeof s!="string"||s.trim()==="")&&chunkS3BXVHO7_cjs.b("invalid-input","sprint planning needs a non-empty goal","state the Sprint Goal in one sentence");let l=$(t),a=e.budget??l.sprintBudget,m=e.items==="auto"?Pe(t,a):void 0,f=m?.skipped??[],v=m?m.ids:e.items;Array.isArray(v)||chunkS3BXVHO7_cjs.b("invalid-input",'sprint planning needs items: string[] or "auto"','pass ["A","B"] or "auto"'),v.length===0&&chunkS3BXVHO7_cjs.b("invalid-input",`no backlog items fit the sprint${f.length?`; skipped: ${f.map(d=>`${d.id} (${d.reason}: ${d.detail})`).join(", ")}`:""}`,"refine the backlog (acceptance + estimates) or raise the budget with exwf config set");for(let d of v)me(t,d);return n(t,"ceremony.plan",e,(d,C)=>{let M=`S${d.iterations.length+1}`,L=z(d),G=v.filter(P=>L?.carryover.includes(P)),u=[];for(let P of v){let x=_(chunkZTE7LREB_cjs.u(d,P),d);x&&u.push(P),d=chunkZTE7LREB_cjs.x(d,P,x?{stage:x,status:"review"}:{stage:"sprint",status:"todo"},e.by,C),d=chunkZTE7LREB_cjs.s(d,P,E=>({...E,iteration:M}));}d=ue(d,v,M,e.by,C);let W=v.reduce((P,x)=>P+(d.items[x]?.weight??0),0);return d={...d,iterations:[...d.iterations,{id:M,goal:s,budget:a,spent:{tokens:0,turns:0,wallclockMs:0},startedAt:C,committed:[...v],carryover:G}]},chunkZTE7LREB_cjs.c(d,"sprint.opened",e.by,{id:M,goal:s,committed:v,committedWeight:W,budget:a,skipped:f,resumed:u},C)})},commit:(t,e)=>{let s=chunkZTE7LREB_cjs.P(t);s||chunkS3BXVHO7_cjs.b("invalid-input","no open sprint to commit into","run the plan ceremony first");let l=e.items;(!Array.isArray(l)||l.length===0)&&chunkS3BXVHO7_cjs.b("invalid-input","commit needs items[]",'pass ["A"]');let a=new Set;for(let m of l)a.has(m)&&chunkS3BXVHO7_cjs.b("invalid-input",`item "${m}" appears twice in items[]`,"list each item once",{items:[m]}),a.add(m),chunkZTE7LREB_cjs.u(t,m),s.committed.includes(m)&&chunkS3BXVHO7_cjs.b("invalid-input",`item "${m}" is already committed to ${s.id}`,"nothing to do",{items:[m]}),me(t,m);return n(t,"ceremony.commit",e,(m,f)=>{let v=[];for(let d of l){let C=_(chunkZTE7LREB_cjs.u(m,d),m);C&&v.push(d),m=chunkZTE7LREB_cjs.x(m,d,C?{stage:C,status:"review"}:{stage:"sprint",status:"todo"},e.by,f),m=chunkZTE7LREB_cjs.s(m,d,M=>({...M,iteration:s.id}));}return m=ue(m,l,s.id,e.by,f),m={...m,iterations:m.iterations.map(d=>d.id===s.id?{...d,committed:[...d.committed,...l]}:d)},chunkZTE7LREB_cjs.c(m,"sprint.committed",e.by,{id:s.id,items:l,goalImpact:e.goalImpact??null,resumed:v},f)})},uncommit:(t,e)=>{chunkZTE7LREB_cjs.o(t,e.by,"order-backlog");let s=chunkZTE7LREB_cjs.P(t);s||chunkS3BXVHO7_cjs.b("invalid-input","no open sprint","nothing to uncommit from");let l=e.items;(!Array.isArray(l)||l.length===0)&&chunkS3BXVHO7_cjs.b("invalid-input","uncommit needs items[]",'pass ["A"]');for(let a of l)chunkZTE7LREB_cjs.u(t,a).status==="done"&&chunkS3BXVHO7_cjs.b("invalid-input",`item "${a}" is done`,"finished work cannot be uncommitted",{items:[a]});for(let a of l)s.committed.includes(a)||chunkS3BXVHO7_cjs.b("invalid-input",`item "${a}" is not committed to ${s.id}`,`committed: ${s.committed.join(", ")}`,{items:[a]});return n(t,"ceremony.uncommit",e,(a,m)=>{for(let f of l)a=chunkZTE7LREB_cjs.x(a,f,{stage:"backlog",status:"todo"},e.by,m),a=chunkZTE7LREB_cjs.t(a,f,["iteration","role"]);return a={...a,iterations:a.iterations.map(f=>f.id===s.id?{...f,committed:f.committed.filter(v=>!l.includes(v))}:f)},chunkZTE7LREB_cjs.c(a,"sprint.uncommitted",e.by,{id:s.id,items:l,reason:e.reason??""},m)})},daily:(t,e)=>n(t,"ceremony.daily",e,(s,l)=>chunkZTE7LREB_cjs.c(s,"daily",e.by,fe(s),l)),review:(t,e)=>{let s=chunkZTE7LREB_cjs.P(t);s||chunkS3BXVHO7_cjs.b("invalid-input","no open sprint to review","run the plan ceremony first");let l=chunkZTE7LREB_cjs.j(t,"sprint-review");e.by!=="human"&&!l.includes(e.by)&&chunkS3BXVHO7_cjs.b("gate-unmet",`"${e.by}" may not accept the Sprint Review`,`run review as "human" or as ${l.join(", ")||"a role with canApprove sprint-review"}`,{rule:"sprint-review"});let a=e.feedback??[];return n(t,"ceremony.review",e,(m,f)=>{for(let d of a)m=chunkZTE7LREB_cjs.v(m,{...d,stage:"backlog"},e.by,f);let v=s.committed.filter(d=>m.items[d]?.status==="done");return m=chunkZTE7LREB_cjs.c(m,"increment",e.by,{sprint:s.id,done:v,goalMet:e.goalMet===true,accepted:e.accepted===true,feedback:a.map(d=>d.id)},f),K(m,"review",f)})},retro:(t,e)=>{chunkZTE7LREB_cjs.o(t,e.by,"facilitate");let s=z(t);s||chunkS3BXVHO7_cjs.b("invalid-input","no closed sprint to retrospect","close the sprint (review or cancel) first"),chunkZTE7LREB_cjs.P(t)&&chunkS3BXVHO7_cjs.b("invalid-input","a sprint is still open","retro runs between sprints; review or cancel the open one");let l=H(t,s.id);t.events.some(u=>u.type==="retro"&&u.seq>l)&&chunkS3BXVHO7_cjs.b("invalid-input",`sprint ${s.id} already has a retrospective`,"plan the next sprint");let a=e.lessons??[],m=["human",...Object.keys(t.roles)];for(let u of a)u.from!==void 0&&(typeof u.from!="string"||!m.includes(u.from))&&chunkS3BXVHO7_cjs.b("invalid-input",`lesson from ${JSON.stringify(u.from)} is not a role`,`from is "human" or one of the roles: ${Object.keys(t.roles).join(", ")||"(none)"}`),u.item!==void 0&&(typeof u.item!="string"&&chunkS3BXVHO7_cjs.b("invalid-input","lesson item must be an item id","name an item with addItem first"),chunkZTE7LREB_cjs.u(t,u.item));let f=e.retire??[];(!Array.isArray(f)||!f.every(u=>typeof u=="string")||f.some((u,W)=>f.indexOf(u)!==W))&&chunkS3BXVHO7_cjs.b("invalid-input","retro.retire must be a list of distinct agreement texts",'e.g. { "retire": ["review in a fresh worker"] }; each agreement once');let v=f,d=e.adopt??[],C=e.dismiss??[],M=e.dodChanges,L=[...d.map(u=>u.id),...C],G=L.find((u,W)=>L.indexOf(u)!==W);G&&chunkS3BXVHO7_cjs.b("invalid-input",`lesson "${G}" is referenced more than once`,"adopt or dismiss each lesson once");for(let u of L){let W=t.lessons.find(P=>P.id===u);W||chunkS3BXVHO7_cjs.b("invalid-input",`no lesson "${u}"`,`raised lessons: ${t.lessons.filter(P=>P.status==="raised").map(P=>P.id).join(", ")||"(none)"}`),W.status!=="raised"&&chunkS3BXVHO7_cjs.b("invalid-input",`lesson "${u}" is already ${W.status}`,"only raised lessons can be adopted or dismissed");}return n(t,"ceremony.retro",e,(u,W)=>{let P=[],x=[],E=[],Q=false,ee=k=>{if(k)if(k.kind==="agreement")u=chunkN3QB2S7R_cjs.a(u,k,e.by,W),x.push(k.text);else if(k.kind==="dod"){let I=$(u).definitionOfDone;I.some(j=>JSON.stringify(j)===JSON.stringify(k.policy))||(Q=true,u=U(u,[...I,k.policy]));}else k.kind==="backlog"&&(u=chunkZTE7LREB_cjs.v(u,{...k.item,stage:"backlog",tags:[...k.item.tags??[],"retro"]},e.by,W),E.push(k.item.id));};for(let k of a){let I=`L${u.lessons.length+1}`,j={id:I,at:W,text:k.text,scope:k.scope,status:"adopted",from:k.from??e.by};k.item!==void 0&&(j.item=k.item),k.suggestedChange&&(j.suggestedChange=k.suggestedChange),u={...u,lessons:[...u.lessons,j]},P.push(I),ee(k.suggestedChange);}for(let k of d)u={...u,lessons:u.lessons.map(I=>I.id===k.id?{...I,status:"adopted",...k.suggestedChange?{suggestedChange:k.suggestedChange}:{}}:I)},P.push(k.id),ee(k.suggestedChange??u.lessons.find(I=>I.id===k.id)?.suggestedChange);for(let k of C)u={...u,lessons:u.lessons.map(I=>I.id===k?{...I,status:"dismissed"}:I)};for(let k of v)u=chunkN3QB2S7R_cjs.b(u,k,e.by,W);return M&&(Q=true,u=U(u,M)),chunkZTE7LREB_cjs.c(u,"retro",e.by,{sprint:s.id,adopted:P,dismissed:C,agreements:x,retired:v,dodChanged:Q,backlogAdded:E},W)})},cancel:(t,e)=>{chunkZTE7LREB_cjs.o(t,e.by,"order-backlog");let s=chunkZTE7LREB_cjs.P(t);return s||chunkS3BXVHO7_cjs.b("invalid-input","no open sprint to cancel","nothing to do"),n(t,"ceremony.cancel",e,(l,a)=>(l=chunkZTE7LREB_cjs.c(l,"sprint.cancelled",e.by,{id:s.id,reason:e.reason??""},a),K(l,"cancel",a)))}}}var We=new Set(["never","po-only","any"]);function pe(i){let n=i??{},o=n.sprintBudget;(!o||typeof o!="object"||o.tokens===void 0&&o.turns===void 0&&o.wallclockMs===void 0)&&chunkS3BXVHO7_cjs.b("config-invalid","scrum config.sprintBudget must define tokens, turns or wallclockMs",'e.g. { "sprintBudget": { "tokens": 400000, "turns": 60 } }'),(typeof n.productGoal!="string"||n.productGoal.trim()==="")&&chunkS3BXVHO7_cjs.b("config-invalid","scrum config.productGoal must be a non-empty string","state the Product Goal in one sentence"),Array.isArray(n.definitionOfDone)||chunkS3BXVHO7_cjs.b("config-invalid","scrum config.definitionOfDone must be a Policy[]",'e.g. [{ "kind": "evidence", "evidenceKind": "test-output" }]');let r=n.refinementSharePct??10;(typeof r!="number"||r<0||r>100)&&chunkS3BXVHO7_cjs.b("config-invalid","scrum config.refinementSharePct must be 0..100","omit it for the default 10");let y=n.allowMidSprintAdd??"po-only";(typeof y!="string"||!We.has(y))&&chunkS3BXVHO7_cjs.b("config-invalid",`scrum config.allowMidSprintAdd must be never | po-only | any (got ${JSON.stringify(y)})`,'use "po-only" unless you have a reason');let p=n.inProgressWipLimit;p!==void 0&&(typeof p!="number"||p<1)&&chunkS3BXVHO7_cjs.b("config-invalid","scrum config.inProgressWipLimit must be a positive number","omit it for no limit");let g=n.autoClose;g!==void 0&&typeof g!="boolean"&&chunkS3BXVHO7_cjs.b("config-invalid","scrum config.autoClose must be true or false","omit it for the default true");let h=n.estimateMode;h!==void 0&&h!=="per-weight"&&h!=="per-call"&&chunkS3BXVHO7_cjs.b("config-invalid",`scrum config.estimateMode must be per-weight | per-call (got ${JSON.stringify(h)})`,'use "per-weight" (the default) or "per-call"');let w=n.fallbackTokensPerWeight;w!==void 0&&(typeof w!="number"||!Number.isFinite(w)||w<=0)&&chunkS3BXVHO7_cjs.b("config-invalid","scrum config.fallbackTokensPerWeight must be a positive finite number","omit it for the default 20000");let c={sprintBudget:o,productGoal:n.productGoal,definitionOfDone:n.definitionOfDone,refinementSharePct:r,allowMidSprintAdd:y};return p!==void 0&&(c.inProgressWipLimit=p),g!==void 0&&(c.autoClose=g),h!==void 0&&(c.estimateMode=h),w!==void 0&&(c.fallbackTokensPerWeight=w),c}var B=(i,n)=>n===0?0:i/n;function ge(i){let n=i.events.filter(t=>t.type==="accounting.corrected"),o=i.events.filter(t=>t.type==="sprint.closed").map(t=>{let e=t.payload,s=n.filter(l=>l.seq>t.seq&&e.id!==void 0&&l.payload.iteration===e.id).reduce((l,a)=>l+a.payload.delta.tokens,0);return s===0?e:{...e,spent:{...e.spent,tokens:e.spent.tokens+s}}}),r=o.filter(t=>t.reason!=="cancel"),y=r.map(t=>t.doneWeight),p=r.reduce((t,e)=>t+e.doneWeight,0),g=r.reduce((t,e)=>t+e.committedWeight,0),h=i.events.filter(t=>t.type==="increment").map(t=>t.payload),w=o.filter(t=>t.budget.tokens!==void 0),c=r.reduce((t,e)=>t+e.spent.tokens,0);return {velocity:y,meanVelocity:B(y.reduce((t,e)=>t+e,0),y.length),burndown:i.events.filter(t=>t.type==="daily").map(t=>t.payload.remainingWeight),commitmentReliability:B(p,g),sprintGoalHitRate:B(h.filter(t=>t.goalMet).length,h.length),carryoverRatio:B(o.reduce((t,e)=>t+e.carryover.length,0),o.reduce((t,e)=>t+e.done.length+e.carryover.length,0)),budgetUtilisation:B(w.reduce((t,e)=>t+e.spent.tokens,0),w.reduce((t,e)=>t+(e.budget.tokens??0),0)),costPerPoint:B(c,p),current:Ie(i)}}function Ie(i){let n=chunkZTE7LREB_cjs.P(i),o=(n?.committed??[]).map(w=>i.items[w]).filter(w=>w!==void 0),r=w=>w.reduce((c,t)=>c+(t.weight??0),0),y=r(o),p=r(o.filter(w=>w.status==="done")),g=n?.spent.tokens??0,h=n?.budget.tokens??0;return {spentTokens:g,spentTurns:n?.spent.turns??0,budgetTokens:h,committedWeight:y,doneWeight:p,remainingWeight:y-p,costPerPoint:B(g,p),budgetUtilisation:B(g,h)}}function ye(){return [{id:"product-owner",name:"Product Owner",modelTier:"large",capabilities:["order-backlog","define-acceptance","escalate"],canApprove:["sprint-review"],inputs:["stakeholder-needs","product-goal"],outputs:["ordered-backlog","acceptance-criteria"],do_not:["do not implement items yourself"]},{id:"scrum-master",name:"Scrum Master",modelTier:"large",capabilities:["facilitate","escalate"],canApprove:[],inputs:["board","blockers"],outputs:["ceremony-records","lessons"],do_not:["do not reorder the Product Backlog","do not assign work; the planner pulls"]},{id:"developer",name:"Developer",modelTier:"small",capabilities:["deliver","review","verify"],canApprove:[],inputs:["brief"],outputs:["code","test-output"],do_not:["do not change acceptance criteria","do not touch items outside your brief"]}]}var R=(i,n,o,r,y)=>y?{rule:i,severity:n,item:y,message:o,fix:r}:{rule:i,severity:n,message:o,fix:r};function he(i){for(let n=i.iterations.length-1;n>=0;n--){let o=i.iterations[n];if(o.endedAt!==void 0)return o}}var Z=i=>i.kind==="evidence"?`evidence:${i.evidenceKind}`:i.kind==="custom"?`custom:${i.id}`:i.kind;function be(){return [{id:"one-open-sprint",severity:"error",check:(c,t)=>t.type==="ceremony.plan"&&chunkZTE7LREB_cjs.P(c)?[R("one-open-sprint","error",`sprint ${chunkZTE7LREB_cjs.P(c).id} is still open`,"review or cancel it before planning the next sprint")]:[]},{id:"retro-before-plan",severity:"error",check:(c,t)=>{if(t.type!=="ceremony.plan")return [];let e=he(c);if(!e)return [];let s=H(c,e.id);if(c.events.some(a=>a.type==="retro"&&a.seq>s))return [];let l=e.outcome==="cancelled"?"warning":"error";return [R("retro-before-plan",l,`sprint ${e.id} has no retrospective yet`,"run the retro ceremony first (lessons may be empty)")]}},{id:"sprint-budget-fixed",severity:"error",check:(c,t)=>{if(t.type!=="ceremony.plan")return [];let e=t.payload?.budget;return e===void 0||JSON.stringify(e)===JSON.stringify($(c).sprintBudget)?[]:[R("sprint-budget-fixed","error","sprint length is fixed by config.sprintBudget","change sprintBudget between sprints with changeConfig / exwf config set, not per plan")]}},{id:"sprint-closing",severity:"error",check:(c,t)=>{let e=chunkZTE7LREB_cjs.P(c);return t.type==="ceremony.commit"&&e?.closing?[R("sprint-closing","error",`sprint ${e.id} is closing: its budget is spent and no new work can start`,"run ceremony review or cancel first, then plan the next sprint")]:[]}},{id:"scrum-stage-ids",severity:"error",check:(c,t)=>{if(t.type!=="init")return [];let e=["backlog","sprint","review"].filter(s=>!c.stages.some(l=>l.id===s));return e.length&&chunkS3BXVHO7_cjs.b("config-invalid",`scrum stages lack the required id(s): ${e.join(", ")}`,"keep the stages backlog, sprint and review (omit stages to use the defaults), then run exwf init scrum again"),[]}},{id:"scope-protects-goal",severity:"error",check:(c,t)=>{if(t.type!=="ceremony.commit")return [];let e=$(c),s=t.payload??{};return e.allowMidSprintAdd==="never"?[R("scope-protects-goal","error","mid-sprint additions are disabled",'set allowMidSprintAdd to "po-only" or wait for the next sprint')]:e.allowMidSprintAdd==="po-only"&&!chunkZTE7LREB_cjs.n(c,t.by,"order-backlog")?[R("scope-protects-goal","error",`"${t.by}" may not add work mid-sprint`,"ask the Product Owner (order-backlog) to commit it")]:s.goalImpact!=="none"?[R("scope-protects-goal","error",`adding work with goalImpact "${s.goalImpact??"unset"}" endangers the Sprint Goal`,'only commit items with goalImpact: "none"; otherwise cancel and re-plan')]:[]}},{id:"po-orders-backlog",severity:"error",check:(c,t)=>t.type!=="ceremony.refine"||chunkZTE7LREB_cjs.n(c,t.by,"order-backlog")?[]:((t.payload??{}).items??[]).filter(s=>s.patch.priority!==void 0).map(s=>R("po-orders-backlog","error",`"${t.by}" may not change the priority of "${s.id}"`,"only the Product Owner orders the backlog; drop priority from the patch",s.id))},{id:"dod-not-weakened",severity:"error",check:(c,t)=>{if(t.type!=="ceremony.retro")return [];let e=t.payload??{};if(e.dodChanges===void 0)return [];if(chunkZTE7LREB_cjs.P(c))return [R("dod-not-weakened","error","Definition of Done cannot change while a sprint is open","close the sprint first; DoD changes apply to the next sprint")];if(!Array.isArray(e.dodChanges)||e.allowWeaken===true)return [];let s=e.dodChanges,l=new Set(s.map(Z)),a=$(c).definitionOfDone.filter(f=>!l.has(Z(f)));if(a.length===0)return [];let m=a.map(f=>Z(f).replace(":"," "));return [R("dod-not-weakened","error",`retro dodChanges drops ${a.length} Definition of Done policy(ies): ${m.join(", ")}`,'keep them in dodChanges (it replaces the whole list; suggestedChange { kind: "dod" } appends one), or pass allowWeaken: true to weaken the Definition of Done knowingly')]}},{id:"carryover-reestimated",severity:"error",check:(c,t)=>{if(t.type!=="ceremony.plan")return [];let e=t.payload?.items;if(!Array.isArray(e))return [];let s=he(c);if(!s)return [];let l=H(c,s.id);return e.filter(a=>s.carryover.includes(a)&&!(c.items[a]&&_(c.items[a],c)!==void 0)&&!c.events.some(m=>m.seq>l&&m.payload.id===a&&(m.type==="item.edited"&&m.payload.changed.includes("weight")||m.type==="item.reestimated"))).map(a=>R("carryover-reestimated","error",`carried-over item "${a}" was not re-estimated after ${s.id}`,"refine it with a new weight before committing",a))}}]}function ke(i){let n={id:"in_progress",name:"In progress",entryPolicy:[{kind:"dependencies-done"}],exitPolicy:[]};return i.inProgressWipLimit!==void 0&&(n.wipLimit=i.inProgressWipLimit),[{id:"backlog",name:"Product Backlog",entryPolicy:[],exitPolicy:[{kind:"acceptance-written"},{kind:"estimate-present"}]},{id:"sprint",name:"Sprint Backlog",entryPolicy:[],exitPolicy:[]},n,{id:"review",name:"Review",entryPolicy:[],exitPolicy:i.definitionOfDone,review:true},{id:"done",name:"Increment",entryPolicy:[],exitPolicy:[]}]}var Ae={backlog:"Product Backlog",item:"Product Backlog Item",stage:"Column",iteration:"Sprint",increment:"Increment",ceremony:"Scrum Event",gate:"Sprint Review"};function $(i){return i.config}function _(i,n){let o=i.transitions.at(-1);return !o||o.by!=="system"||o.to.stage!=="backlog"||o.to.status!=="todo"?void 0:n?n.stages.find(y=>y.id===o.from.stage)?.review||o.from.status==="review"?o.from.stage:void 0:o.from.status==="review"?o.from.stage:void 0}function Oe(i,n,o){let r=i,y=chunkZTE7LREB_cjs.u(r,n).blockers.filter(g=>!g.clearedAt);if(y.length){r=chunkZTE7LREB_cjs.s(r,n,g=>({...g,blockers:g.blockers.map(h=>h.clearedAt?h:{...h,clearedAt:o})}));for(let g of y)r=chunkZTE7LREB_cjs.c(r,"blocker.cleared","system",{id:n,blocker:g.id,reason:"sprint closed"},o);}for(let g of r.pending.filter(h=>h.item===n))r={...r,pending:r.pending.filter(h=>h.id!==g.id)},r=chunkZTE7LREB_cjs.c(r,"pending.dropped","system",{id:g.id,item:n,reason:"sprint closed"},o);let p=chunkZTE7LREB_cjs.u(r,n);return (p.stage!=="backlog"||p.status!=="todo")&&(r=chunkZTE7LREB_cjs.x(r,n,{stage:"backlog",status:"todo"},"system",o)),chunkZTE7LREB_cjs.t(r,n,p.type==="question"?["iteration"]:["iteration","role"])}function K(i,n,o){let r=chunkZTE7LREB_cjs.P(i);if(!r)return i;let y=r.committed.map(e=>chunkZTE7LREB_cjs.u(i,e)),p=y.filter(e=>e.status==="done").map(e=>e.id),g=y.filter(e=>e.status==="dropped").map(e=>e.id),h=y.filter(e=>e.status!=="done"&&e.status!=="dropped").map(e=>e.id),w=Object.values(i.items).filter(e=>e.type==="question"&&e.parent!==void 0&&h.includes(e.parent)&&e.status!=="done"&&e.status!=="dropped").map(e=>e.id),c=i;for(let e of [...h,...w])c=Oe(c,e,o);let t=e=>e.reduce((s,l)=>s+(i.items[l]?.weight??0),0);return c={...c,iterations:c.iterations.map(e=>{if(e.id!==r.id)return e;let{closing:s,...l}=e;return {...l,endedAt:o,outcome:n==="cancel"?"cancelled":"completed",carryover:h}})},chunkZTE7LREB_cjs.c(c,"sprint.closed","system",{id:r.id,reason:n,done:p,carryover:h,carriedQuestions:w,dropped:g,doneWeight:t(p),committedWeight:t(r.committed),spent:r.spent,budget:r.budget},o)}function $e(){return {name:"scrum",vocabulary:Ae,validateConfig:pe,defaultStages:ke,defaultRoles:ye,requiredCapabilities:["order-backlog","facilitate","deliver"],exclusiveCapabilities:["order-backlog"],plannerOptions(i){let n=$(i),o={schedulerMode:"level",dispatchStage:"in_progress"};return n.inProgressWipLimit!==void 0&&(o.concurrencyCap=n.inProgressWipLimit),n.estimateMode!==void 0&&(o.estimateMode=n.estimateMode),n.fallbackTokensPerWeight!==void 0&&(o.fallbackTokensPerWeight=n.fallbackTokensPerWeight),o},candidates(i){let n=chunkZTE7LREB_cjs.P(i);return !n||n.closing?[]:Object.values(i.items).filter(o=>o.iteration===n.id&&(o.status==="todo"||o.status==="review")&&(o.stage==="sprint"||o.stage==="review"))},invariants(i,n){let o=chunkZTE7LREB_cjs.P(i),r=$(i),y=o?chunkZTE7LREB_cjs.M(o.budget,o.spent):{};return [`Sprint Goal: ${o?.goal??"(no open sprint)"}; Product Goal: ${r.productGoal}`,`Budget remaining: ${JSON.stringify(y)}; stop and hand off when it is gone`,`Definition of Done: ${r.definitionOfDone.map(p=>p.kind==="evidence"?`evidence ${p.evidenceKind}`:p.kind).join(", ")||"(none)"}`,`Do not change the scope of "${n.id}" or its acceptance criteria; raise open_questions instead`]},ceremonies:X($e),rules:be(),metrics:i=>({...ge(i)}),report(i){let n=chunkZTE7LREB_cjs.P(i);return {closing:n?.closing===true,sprint:n?.id??null,reason:n?.closing?"budget":null,inFlight:n?Object.values(i.items).filter(o=>(o.iteration===n.id||n.committed.includes(o.id))&&o.status==="in_progress").map(o=>o.id):[]}},humanDefaults:{gates:["sprint-review"]},afterConfigChange(i){return U(i,$(i).definitionOfDone)},afterComplete(i,n,o){let r=chunkZTE7LREB_cjs.P(i);return !r||!r.closing&&!chunkZTE7LREB_cjs.N(r.budget,r.spent)?i:!Object.values(i.items).some(p=>(p.iteration===r.id||r.committed.includes(p.id))&&p.status==="in_progress")&&$(i).autoClose!==false?K(i,"budget",o):r.closing?i:chunkZTE7LREB_cjs.c({...i,iterations:i.iterations.map(p=>p.id===r.id?{...p,closing:true}:p)},"sprint.closing","system",{id:r.id},o)}}}exports.a=fe;exports.b=X;exports.c=pe;exports.d=ge;exports.e=ye;exports.f=be;exports.g=ke;exports.h=Ae;exports.i=$;exports.j=_;exports.k=K;exports.l=$e;//# sourceMappingURL=chunk-UUOMQMWT.cjs.map
2
+ //# sourceMappingURL=chunk-UUOMQMWT.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/scrum/ceremonies.ts","../src/scrum/config.ts","../src/scrum/metrics.ts","../src/scrum/roles.ts","../src/scrum/rules.ts","../src/scrum/stages.ts","../src/scrum/index.ts"],"names":["STATUSES","velocityOf","state","closed","e","sum","dailyReport","it","openIteration","byStatus","s","blockers","remainingWeight","id","item","b","spent","rem","remaining","velocity","forecast","share","raisedLessons","l","lastClosedIteration","i","closedSeq","backlogOrdered","carry","items","timSort","x","cx","cy","assertCommittable","getItem","fail","assertPolicies","stageOf","attachQuestions","parentIds","iterationId","by","now","q","moveItem","patchItem","setDod","policies","configOf","st","selectAuto","budget","cfg","ids","skipped","exit","tokens","unmet","evaluatePolicies","u","est","estimateTokens","scrumCeremonies","methodology","act","type","input","reduce","applyAction","nowOf","requireCap","split","reestimateRaw","reestimate","patch","editItem","appendEvent","sp","n","addItem","goal","auto","wanted","last","carryover","w","resumed","rs","resumeStageOf","committedWeight","seen","stripItemFields","c","approvers","approverIds","feedback","done","f","closeSprint","closedAt","newLessons","roleIds","retireRaw","retire","adopt","dismiss","dod","refs","a","dupe","r","ref","adopted","agreements","backlogAdded","dodChanged","applyChange","applyAgreement","cur","p","lesson","d","text","retireAgreement","ADD_MODES","validateScrumConfig","raw","add","wip","autoClose","mode","fallback","out","ratio","num","den","scrumMetrics","corrections","late","counted","doneWeight","increments","withTokens","tokensSpent","currentSprint","weight","list","spentTokens","budgetTokens","scrumRoles","v","rule","severity","message","fix","lastClosed","policyKey","scrumRules","seq","sev","missing","canDo","next","kept","removed","describe","scrumStages","config","inProgress","SCRUM_VOCABULARY","t","toBacklog","open","reason","committed","dropped","carriedQuestions","weightOf","_c","rest","scrum","po","left","_itemId","isExhausted"],"mappings":"oMAoCA,IAAMA,GAAyB,CAC7B,MAAA,CACA,aAAA,CACA,SAAA,CACA,QAAA,CACA,gBAAA,CACA,MAAA,CACA,SACF,EAeO,SAASC,EAAAA,CAAWC,CAAAA,CAAqC,CAC9D,IAAMC,CAAAA,CAASD,CAAAA,CAAM,MAAA,CAAO,OACzBE,CAAAA,EAAMA,CAAA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A,CAAAA,CAAE,EAAA,GAAOxB,CAAAA,CAAG,GAAK,CAAE,GAAGwB,CAAAA,CAAG,OAAA,CAAS,IAAK,CAAA,CAAIA,CAAE,CACxF,EACA,gBAAA,CACA,QAAA,CACA,CAAE,EAAA,CAAIxB,EAAG,EAAG,CAAA,CACZoC,CACF,CACF,CACF,CACF","file":"chunk-UUOMQMWT.cjs","sourcesContent":["import { timSort } from \"exsorted\";\nimport { estimateTokens, remaining } from \"../budget.ts\";\nimport { applyAgreement, retireAgreement } from \"../agreements.ts\";\nimport { fail } from \"../errors.ts\";\nimport {\n addItem,\n editItem,\n getItem,\n moveItem,\n patchItem,\n stageOf,\n stripItemFields,\n type ItemPatch,\n} from \"../items.ts\";\nimport { applyAction } from \"../methodology.ts\";\nimport { assertPolicies, evaluatePolicies } from \"../policies.ts\";\nimport { openIteration } from \"../planner.ts\";\nimport { approverIds, canDo, requireCap } from \"../roles.ts\";\nexport { canDo };\nimport { appendEvent, nowOf } from \"../state.ts\";\nimport type {\n Budget,\n Ceremony,\n CeremonyInput,\n ItemStatus,\n Iteration,\n Lesson,\n LessonChange,\n Methodology,\n NewItem,\n Policy,\n WorkItem,\n WorkflowState,\n} from \"../types.ts\";\nimport { closeSprint, configOf, resumeStageOf } from \"./index.ts\";\n\nconst STATUSES: ItemStatus[] = [\n \"todo\",\n \"in_progress\",\n \"blocked\",\n \"review\",\n \"awaiting_human\",\n \"done\",\n \"dropped\",\n];\n\nexport interface DailyReport {\n sprint: string | null;\n goal: string | null;\n byStatus: Record<ItemStatus, number>;\n blockers: Array<{ item: string; blocker: string; owner: string; reason: string }>;\n spent: Required<Budget>;\n remaining: Budget;\n remainingWeight: number;\n raisedLessons: number;\n velocity: number | null;\n forecast: \"on-track\" | \"at-risk\" | \"unknown\";\n}\n\nexport function velocityOf(state: WorkflowState): number | null {\n const closed = state.events.filter(\n (e) => e.type === \"sprint.closed\" && (e.payload as { reason: string }).reason !== \"cancel\",\n );\n if (closed.length === 0) return null;\n return (\n closed.reduce((sum, e) => sum + (e.payload as { doneWeight: number }).doneWeight, 0) /\n closed.length\n );\n}\n\nexport function dailyReport(state: WorkflowState): DailyReport {\n const it = openIteration(state);\n const byStatus = Object.fromEntries(STATUSES.map((s) => [s, 0])) as Record<ItemStatus, number>;\n const blockers: DailyReport[\"blockers\"] = [];\n let remainingWeight = 0;\n for (const id of it?.committed ?? []) {\n const item = state.items[id];\n if (!item) continue;\n byStatus[item.status] += 1;\n if (item.status !== \"done\") remainingWeight += item.weight ?? 0;\n for (const b of item.blockers)\n if (!b.clearedAt)\n blockers.push({ item: id, blocker: b.id, owner: b.owner, reason: b.reason });\n }\n const spent = it?.spent ?? { tokens: 0, turns: 0, wallclockMs: 0 };\n const rem = it ? remaining(it.budget, it.spent) : {};\n const velocity = velocityOf(state);\n let forecast: DailyReport[\"forecast\"] = \"unknown\";\n if (it && velocity !== null && it.budget.tokens) {\n const share = (rem.tokens ?? 0) / it.budget.tokens;\n forecast = remainingWeight <= velocity * share ? \"on-track\" : \"at-risk\";\n }\n const raisedLessons = state.lessons.filter((l) => l.status === \"raised\").length;\n return {\n sprint: it?.id ?? null,\n goal: it?.goal ?? null,\n byStatus,\n blockers,\n spent,\n remaining: rem,\n remainingWeight,\n raisedLessons,\n velocity,\n forecast,\n };\n}\n\nfunction lastClosedIteration(state: WorkflowState): Iteration | undefined {\n for (let i = state.iterations.length - 1; i >= 0; i--) {\n const it = state.iterations[i]!;\n if (it.endedAt !== undefined) return it;\n }\n return undefined;\n}\n\n/** Event seq of the sprint.closed event of `id`; infinity when it is missing, so nothing counts as \"after\" it. */\nexport function closedSeq(state: WorkflowState, id: string): number {\n return (\n state.events.find((e) => e.type === \"sprint.closed\" && (e.payload as { id: string }).id === id)\n ?.seq ?? Number.POSITIVE_INFINITY\n );\n}\n\nfunction backlogOrdered(state: WorkflowState): WorkItem[] {\n const carry = new Set(lastClosedIteration(state)?.carryover ?? []);\n const items = Object.values(state.items).filter(\n (i) => i.stage === \"backlog\" && i.status === \"todo\" && i.type !== \"question\",\n );\n return timSort([...items], (x, y) => {\n const cx = carry.has(x.id) ? 1 : 0;\n const cy = carry.has(y.id) ? 1 : 0;\n if (cx !== cy) return cy - cx;\n return (y.priority ?? 0) - (x.priority ?? 0);\n });\n}\n\n/** Throw unless the item sits in the Product Backlog and meets the backlog exit policy. */\nfunction assertCommittable(state: WorkflowState, id: string): void {\n const item = getItem(state, id);\n if (item.stage !== \"backlog\" || item.status !== \"todo\")\n fail(\n \"invalid-input\",\n `item \"${id}\" is not in the Product Backlog (${item.stage}/${item.status})`,\n \"only backlog items can be committed\",\n { items: [id] },\n );\n assertPolicies(state, item, stageOf(state, \"backlog\").exitPolicy, \"enter the Sprint Backlog\");\n}\n\n/** Open questions raised by the given parents travel with them into the sprint (they carry no weight). */\nfunction attachQuestions(\n state: WorkflowState,\n parentIds: string[],\n iterationId: string,\n by: string,\n now: string,\n): WorkflowState {\n let s = state;\n for (const q of Object.values(state.items)) {\n if (\n q.type !== \"question\" ||\n q.parent === undefined ||\n !parentIds.includes(q.parent) ||\n q.status === \"done\" ||\n q.status === \"dropped\"\n )\n continue;\n if (q.stage !== \"sprint\" || q.status !== \"todo\")\n s = moveItem(s, q.id, { stage: \"sprint\", status: \"todo\" }, by, now);\n s = patchItem(s, q.id, (it) => ({ ...it, iteration: iterationId }));\n }\n return s;\n}\n\n/** Set the Definition of Done in the config and on the review stage. */\nexport function setDod(state: WorkflowState, policies: Policy[]): WorkflowState {\n return {\n ...state,\n config: { ...configOf(state), definitionOfDone: policies },\n stages: state.stages.map((st) => (st.id === \"review\" ? { ...st, exitPolicy: policies } : st)),\n };\n}\n\ninterface Skipped {\n id: string;\n reason: \"policy\" | \"budget\";\n detail: string;\n}\n\nfunction selectAuto(state: WorkflowState, budget: Budget): { ids: string[]; skipped: Skipped[] } {\n const cfg = configOf(state);\n const ids: string[] = [];\n const skipped: Skipped[] = [];\n const exit = stageOf(state, \"backlog\").exitPolicy;\n let tokens = 0;\n for (const item of backlogOrdered(state)) {\n const unmet = evaluatePolicies(state, item, exit);\n if (unmet.length > 0) {\n skipped.push({\n id: item.id,\n reason: \"policy\",\n detail: unmet.map((u) => u.message).join(\"; \"),\n });\n continue;\n }\n if (budget.turns !== undefined && ids.length >= budget.turns) {\n skipped.push({ id: item.id, reason: \"budget\", detail: \"turns budget full\" });\n continue;\n }\n if (budget.tokens !== undefined) {\n const est = estimateTokens(state, item.weight, cfg.fallbackTokensPerWeight, cfg.estimateMode);\n if (tokens + est > budget.tokens) {\n skipped.push({\n id: item.id,\n reason: \"budget\",\n detail: `needs about ${est} tokens, ${budget.tokens - tokens} left`,\n });\n continue;\n }\n tokens += est;\n }\n ids.push(item.id);\n }\n return { ids, skipped };\n}\n\nexport function scrumCeremonies(methodology: () => Methodology): Record<string, Ceremony> {\n const act = (\n state: WorkflowState,\n type: string,\n input: CeremonyInput,\n reduce: (s: WorkflowState, now: string) => WorkflowState,\n ) =>\n applyAction(state, methodology(), { type, by: input.by, payload: input }, (s) =>\n reduce(s, nowOf(input.now)),\n );\n\n const refine: Ceremony = (state, input) => {\n requireCap(state, input.by, \"define-acceptance\", \"deliver\");\n const items = (input[\"items\"] ?? []) as Array<{ id: string; patch: ItemPatch }>;\n const split = (input[\"split\"] ?? []) as Array<{ from: string; into: NewItem[] }>;\n const reestimateRaw: unknown = input[\"reestimate\"] ?? [];\n if (!Array.isArray(reestimateRaw) || !reestimateRaw.every((x) => typeof x === \"string\"))\n fail(\n \"invalid-input\",\n \"refine.reestimate must be a list of item ids\",\n 'pass reestimate: [\"A\"]',\n );\n const reestimate = reestimateRaw as string[];\n if (items.length === 0 && split.length === 0 && reestimate.length === 0)\n fail(\n \"invalid-input\",\n \"refine needs items[], split[] or reestimate[]\",\n \"pass at least one patch, split or reestimate\",\n );\n for (const id of reestimate) {\n const it = getItem(state, id);\n if (it.stage !== \"backlog\" || it.status !== \"todo\" || it.weight === undefined)\n fail(\n \"invalid-input\",\n `item \"${id}\" has no weight to confirm in the Product Backlog`,\n \"refine it with a patch { weight } instead\",\n { items: [id] },\n );\n }\n return act(state, \"ceremony.refine\", input, (s, now) => {\n for (const { id, patch } of items) s = editItem(s, id, patch, input.by, now);\n for (const id of reestimate)\n s = appendEvent(\n s,\n \"item.reestimated\",\n input.by,\n { id, weight: getItem(s, id).weight },\n now,\n );\n for (const sp of split) {\n getItem(s, sp.from);\n for (const n of sp.into) s = addItem(s, { ...n, parent: sp.from }, input.by, now);\n s = moveItem(s, sp.from, { status: \"dropped\" }, input.by, now);\n }\n return appendEvent(\n s,\n \"ceremony.refine\",\n input.by,\n {\n edited: items.map((i) => i.id),\n split: split.map((x) => ({ from: x.from, into: x.into.map((n) => n.id) })),\n reestimated: reestimate,\n },\n now,\n );\n });\n };\n\n const plan: Ceremony = (state, input) => {\n requireCap(state, input.by, \"facilitate\");\n const goal = input[\"goal\"];\n if (typeof goal !== \"string\" || goal.trim() === \"\")\n fail(\n \"invalid-input\",\n \"sprint planning needs a non-empty goal\",\n \"state the Sprint Goal in one sentence\",\n );\n const cfg = configOf(state);\n const budget = (input[\"budget\"] as Budget | undefined) ?? cfg.sprintBudget;\n const auto = input[\"items\"] === \"auto\" ? selectAuto(state, budget) : undefined;\n const skipped = auto?.skipped ?? [];\n const wanted = auto ? auto.ids : (input[\"items\"] as string[] | undefined);\n if (!Array.isArray(wanted))\n fail(\n \"invalid-input\",\n 'sprint planning needs items: string[] or \"auto\"',\n 'pass [\"A\",\"B\"] or \"auto\"',\n );\n if (wanted.length === 0)\n fail(\n \"invalid-input\",\n `no backlog items fit the sprint${\n skipped.length\n ? `; skipped: ${skipped.map((x) => `${x.id} (${x.reason}: ${x.detail})`).join(\", \")}`\n : \"\"\n }`,\n \"refine the backlog (acceptance + estimates) or raise the budget with exwf config set\",\n );\n for (const id of wanted) assertCommittable(state, id);\n return act(state, \"ceremony.plan\", input, (s, now) => {\n const id = `S${s.iterations.length + 1}`;\n const last = lastClosedIteration(s);\n const carryover = wanted.filter((w) => last?.carryover.includes(w));\n const resumed: string[] = [];\n for (const w of wanted) {\n const rs = resumeStageOf(getItem(s, w), s);\n if (rs) resumed.push(w);\n s = moveItem(\n s,\n w,\n rs ? { stage: rs, status: \"review\" } : { stage: \"sprint\", status: \"todo\" },\n input.by,\n now,\n );\n s = patchItem(s, w, (it) => ({ ...it, iteration: id }));\n }\n s = attachQuestions(s, wanted, id, input.by, now);\n const committedWeight = wanted.reduce((sum, w) => sum + (s.items[w]?.weight ?? 0), 0);\n s = {\n ...s,\n iterations: [\n ...s.iterations,\n {\n id,\n goal,\n budget,\n spent: { tokens: 0, turns: 0, wallclockMs: 0 },\n startedAt: now,\n committed: [...wanted],\n carryover,\n },\n ],\n };\n return appendEvent(\n s,\n \"sprint.opened\",\n input.by,\n { id, goal, committed: wanted, committedWeight, budget, skipped, resumed },\n now,\n );\n });\n };\n\n const commit: Ceremony = (state, input) => {\n const it = openIteration(state);\n if (!it) fail(\"invalid-input\", \"no open sprint to commit into\", \"run the plan ceremony first\");\n const items = input[\"items\"] as string[] | undefined;\n if (!Array.isArray(items) || items.length === 0)\n fail(\"invalid-input\", \"commit needs items[]\", 'pass [\"A\"]');\n const seen = new Set<string>();\n for (const id of items) {\n if (seen.has(id))\n fail(\"invalid-input\", `item \"${id}\" appears twice in items[]`, \"list each item once\", {\n items: [id],\n });\n seen.add(id);\n getItem(state, id);\n if (it.committed.includes(id))\n fail(\"invalid-input\", `item \"${id}\" is already committed to ${it.id}`, \"nothing to do\", {\n items: [id],\n });\n assertCommittable(state, id);\n }\n return act(state, \"ceremony.commit\", input, (s, now) => {\n const resumed: string[] = [];\n for (const id of items) {\n const rs = resumeStageOf(getItem(s, id), s);\n if (rs) resumed.push(id);\n s = moveItem(\n s,\n id,\n rs ? { stage: rs, status: \"review\" } : { stage: \"sprint\", status: \"todo\" },\n input.by,\n now,\n );\n s = patchItem(s, id, (x) => ({ ...x, iteration: it.id }));\n }\n s = attachQuestions(s, items, it.id, input.by, now);\n s = {\n ...s,\n iterations: s.iterations.map((x) =>\n x.id === it.id ? { ...x, committed: [...x.committed, ...items] } : x,\n ),\n };\n return appendEvent(\n s,\n \"sprint.committed\",\n input.by,\n { id: it.id, items, goalImpact: input[\"goalImpact\"] ?? null, resumed },\n now,\n );\n });\n };\n\n const uncommit: Ceremony = (state, input) => {\n requireCap(state, input.by, \"order-backlog\");\n const it = openIteration(state);\n if (!it) fail(\"invalid-input\", \"no open sprint\", \"nothing to uncommit from\");\n const items = input[\"items\"] as string[] | undefined;\n if (!Array.isArray(items) || items.length === 0)\n fail(\"invalid-input\", \"uncommit needs items[]\", 'pass [\"A\"]');\n for (const id of items) {\n if (getItem(state, id).status === \"done\")\n fail(\"invalid-input\", `item \"${id}\" is done`, \"finished work cannot be uncommitted\", {\n items: [id],\n });\n }\n for (const id of items)\n if (!it.committed.includes(id))\n fail(\n \"invalid-input\",\n `item \"${id}\" is not committed to ${it.id}`,\n `committed: ${it.committed.join(\", \")}`,\n { items: [id] },\n );\n return act(state, \"ceremony.uncommit\", input, (s, now) => {\n for (const id of items) {\n s = moveItem(s, id, { stage: \"backlog\", status: \"todo\" }, input.by, now);\n s = stripItemFields(s, id, [\"iteration\", \"role\"]);\n }\n s = {\n ...s,\n iterations: s.iterations.map((x) =>\n x.id === it.id ? { ...x, committed: x.committed.filter((c) => !items.includes(c)) } : x,\n ),\n };\n return appendEvent(\n s,\n \"sprint.uncommitted\",\n input.by,\n { id: it.id, items, reason: input[\"reason\"] ?? \"\" },\n now,\n );\n });\n };\n\n const daily: Ceremony = (state, input) =>\n act(state, \"ceremony.daily\", input, (s, now) =>\n appendEvent(s, \"daily\", input.by, dailyReport(s), now),\n );\n\n const review: Ceremony = (state, input) => {\n const it = openIteration(state);\n if (!it) fail(\"invalid-input\", \"no open sprint to review\", \"run the plan ceremony first\");\n const approvers = approverIds(state, \"sprint-review\");\n if (input.by !== \"human\" && !approvers.includes(input.by)) {\n fail(\n \"gate-unmet\",\n `\"${input.by}\" may not accept the Sprint Review`,\n `run review as \"human\" or as ${approvers.join(\", \") || \"a role with canApprove sprint-review\"}`,\n { rule: \"sprint-review\" },\n );\n }\n const feedback = (input[\"feedback\"] ?? []) as NewItem[];\n return act(state, \"ceremony.review\", input, (s, now) => {\n for (const n of feedback) s = addItem(s, { ...n, stage: \"backlog\" }, input.by, now);\n const done = it.committed.filter((id) => s.items[id]?.status === \"done\");\n s = appendEvent(\n s,\n \"increment\",\n input.by,\n {\n sprint: it.id,\n done,\n goalMet: input[\"goalMet\"] === true,\n accepted: input[\"accepted\"] === true,\n feedback: feedback.map((f) => f.id),\n },\n now,\n );\n return closeSprint(s, \"review\", now);\n });\n };\n\n const retro: Ceremony = (state, input) => {\n requireCap(state, input.by, \"facilitate\");\n const last = lastClosedIteration(state);\n if (!last)\n fail(\n \"invalid-input\",\n \"no closed sprint to retrospect\",\n \"close the sprint (review or cancel) first\",\n );\n if (openIteration(state))\n fail(\n \"invalid-input\",\n \"a sprint is still open\",\n \"retro runs between sprints; review or cancel the open one\",\n );\n const closedAt = closedSeq(state, last.id);\n if (state.events.some((e) => e.type === \"retro\" && e.seq > closedAt))\n fail(\n \"invalid-input\",\n `sprint ${last.id} already has a retrospective`,\n \"plan the next sprint\",\n );\n const newLessons = (input[\"lessons\"] ?? []) as Array<{\n text: string;\n scope: Lesson[\"scope\"];\n from?: string;\n item?: string;\n suggestedChange?: LessonChange;\n }>;\n const roleIds = [\"human\", ...Object.keys(state.roles)];\n for (const l of newLessons) {\n if (l.from !== undefined && (typeof l.from !== \"string\" || !roleIds.includes(l.from)))\n fail(\n \"invalid-input\",\n `lesson from ${JSON.stringify(l.from)} is not a role`,\n `from is \"human\" or one of the roles: ${Object.keys(state.roles).join(\", \") || \"(none)\"}`,\n );\n if (l.item !== undefined) {\n if (typeof l.item !== \"string\")\n fail(\n \"invalid-input\",\n \"lesson item must be an item id\",\n \"name an item with addItem first\",\n );\n getItem(state, l.item);\n }\n }\n const retireRaw: unknown = input[\"retire\"] ?? [];\n if (\n !Array.isArray(retireRaw) ||\n !retireRaw.every((x) => typeof x === \"string\") ||\n retireRaw.some((x, i) => retireRaw.indexOf(x) !== i)\n )\n fail(\n \"invalid-input\",\n \"retro.retire must be a list of distinct agreement texts\",\n 'e.g. { \"retire\": [\"review in a fresh worker\"] }; each agreement once',\n );\n const retire = retireRaw as string[];\n const adopt = (input[\"adopt\"] ?? []) as Array<{ id: string; suggestedChange?: LessonChange }>;\n const dismiss = (input[\"dismiss\"] ?? []) as string[];\n const dod = input[\"dodChanges\"] as Policy[] | undefined;\n const refs = [...adopt.map((a) => a.id), ...dismiss];\n const dupe = refs.find((r, i) => refs.indexOf(r) !== i);\n if (dupe)\n fail(\n \"invalid-input\",\n `lesson \"${dupe}\" is referenced more than once`,\n \"adopt or dismiss each lesson once\",\n );\n for (const ref of refs) {\n const l = state.lessons.find((x) => x.id === ref);\n if (!l)\n fail(\n \"invalid-input\",\n `no lesson \"${ref}\"`,\n `raised lessons: ${\n state.lessons\n .filter((x) => x.status === \"raised\")\n .map((x) => x.id)\n .join(\", \") || \"(none)\"\n }`,\n );\n if (l.status !== \"raised\")\n fail(\n \"invalid-input\",\n `lesson \"${ref}\" is already ${l.status}`,\n \"only raised lessons can be adopted or dismissed\",\n );\n }\n return act(state, \"ceremony.retro\", input, (s, now) => {\n const adopted: string[] = [];\n const agreements: string[] = [];\n const backlogAdded: string[] = [];\n let dodChanged = false;\n const applyChange = (c: LessonChange | undefined) => {\n if (!c) return;\n if (c.kind === \"agreement\") {\n s = applyAgreement(s, c, input.by, now);\n agreements.push(c.text);\n } else if (c.kind === \"dod\") {\n const cur = configOf(s).definitionOfDone;\n if (!cur.some((p) => JSON.stringify(p) === JSON.stringify(c.policy))) {\n dodChanged = true;\n s = setDod(s, [...cur, c.policy]);\n }\n } else if (c.kind === \"backlog\") {\n s = addItem(\n s,\n { ...c.item, stage: \"backlog\", tags: [...(c.item.tags ?? []), \"retro\"] },\n input.by,\n now,\n );\n backlogAdded.push(c.item.id);\n }\n };\n for (const l of newLessons) {\n const id = `L${s.lessons.length + 1}`;\n const lesson: Lesson = {\n id,\n at: now,\n text: l.text,\n scope: l.scope,\n status: \"adopted\",\n from: l.from ?? input.by,\n };\n if (l.item !== undefined) lesson.item = l.item;\n if (l.suggestedChange) lesson.suggestedChange = l.suggestedChange;\n s = { ...s, lessons: [...s.lessons, lesson] };\n adopted.push(id);\n applyChange(l.suggestedChange);\n }\n for (const a of adopt) {\n s = {\n ...s,\n lessons: s.lessons.map((x) =>\n x.id === a.id\n ? {\n ...x,\n status: \"adopted\" as const,\n ...(a.suggestedChange ? { suggestedChange: a.suggestedChange } : {}),\n }\n : x,\n ),\n };\n adopted.push(a.id);\n applyChange(a.suggestedChange ?? s.lessons.find((x) => x.id === a.id)?.suggestedChange);\n }\n for (const d of dismiss)\n s = {\n ...s,\n lessons: s.lessons.map((x) => (x.id === d ? { ...x, status: \"dismissed\" as const } : x)),\n };\n for (const text of retire) s = retireAgreement(s, text, input.by, now);\n if (dod) {\n dodChanged = true;\n s = setDod(s, dod);\n }\n return appendEvent(\n s,\n \"retro\",\n input.by,\n {\n sprint: last.id,\n adopted,\n dismissed: dismiss,\n agreements,\n retired: retire,\n dodChanged,\n backlogAdded,\n },\n now,\n );\n });\n };\n\n const cancel: Ceremony = (state, input) => {\n requireCap(state, input.by, \"order-backlog\");\n const it = openIteration(state);\n if (!it) fail(\"invalid-input\", \"no open sprint to cancel\", \"nothing to do\");\n return act(state, \"ceremony.cancel\", input, (s, now) => {\n s = appendEvent(\n s,\n \"sprint.cancelled\",\n input.by,\n { id: it.id, reason: input[\"reason\"] ?? \"\" },\n now,\n );\n return closeSprint(s, \"cancel\", now);\n });\n };\n\n return { refine, plan, commit, uncommit, daily, review, retro, cancel };\n}\n","import type { EstimateMode } from \"../budget.ts\";\nimport { fail } from \"../errors.ts\";\nimport type { Budget, Policy } from \"../types.ts\";\n\nexport interface ScrumConfig {\n sprintBudget: Budget;\n productGoal: string;\n definitionOfDone: Policy[];\n refinementSharePct: number;\n allowMidSprintAdd: \"never\" | \"po-only\" | \"any\";\n inProgressWipLimit?: number;\n /** Close the sprint automatically when its budget is spent and nothing is in flight; default true. */\n autoClose?: boolean;\n /** How the planner and sprint planning price a candidate; default \"per-weight\". */\n estimateMode?: EstimateMode;\n /** Tokens per weight unit when no accounting history exists; default 20000. */\n fallbackTokensPerWeight?: number;\n}\n\nconst ADD_MODES = new Set([\"never\", \"po-only\", \"any\"]);\n\nexport function validateScrumConfig(raw: unknown): ScrumConfig {\n const c = (raw ?? {}) as Record<string, unknown>;\n const budget = c[\"sprintBudget\"] as Budget | undefined;\n if (\n !budget ||\n typeof budget !== \"object\" ||\n (budget.tokens === undefined && budget.turns === undefined && budget.wallclockMs === undefined)\n ) {\n fail(\n \"config-invalid\",\n \"scrum config.sprintBudget must define tokens, turns or wallclockMs\",\n 'e.g. { \"sprintBudget\": { \"tokens\": 400000, \"turns\": 60 } }',\n );\n }\n if (typeof c[\"productGoal\"] !== \"string\" || c[\"productGoal\"].trim() === \"\")\n fail(\n \"config-invalid\",\n \"scrum config.productGoal must be a non-empty string\",\n \"state the Product Goal in one sentence\",\n );\n if (!Array.isArray(c[\"definitionOfDone\"]))\n fail(\n \"config-invalid\",\n \"scrum config.definitionOfDone must be a Policy[]\",\n 'e.g. [{ \"kind\": \"evidence\", \"evidenceKind\": \"test-output\" }]',\n );\n const share = c[\"refinementSharePct\"] ?? 10;\n if (typeof share !== \"number\" || share < 0 || share > 100)\n fail(\n \"config-invalid\",\n \"scrum config.refinementSharePct must be 0..100\",\n \"omit it for the default 10\",\n );\n const add = c[\"allowMidSprintAdd\"] ?? \"po-only\";\n if (typeof add !== \"string\" || !ADD_MODES.has(add))\n fail(\n \"config-invalid\",\n `scrum config.allowMidSprintAdd must be never | po-only | any (got ${JSON.stringify(add)})`,\n 'use \"po-only\" unless you have a reason',\n );\n const wip = c[\"inProgressWipLimit\"];\n if (wip !== undefined && (typeof wip !== \"number\" || wip < 1))\n fail(\n \"config-invalid\",\n \"scrum config.inProgressWipLimit must be a positive number\",\n \"omit it for no limit\",\n );\n const autoClose = c[\"autoClose\"];\n if (autoClose !== undefined && typeof autoClose !== \"boolean\")\n fail(\n \"config-invalid\",\n \"scrum config.autoClose must be true or false\",\n \"omit it for the default true\",\n );\n const mode = c[\"estimateMode\"];\n if (mode !== undefined && mode !== \"per-weight\" && mode !== \"per-call\")\n fail(\n \"config-invalid\",\n `scrum config.estimateMode must be per-weight | per-call (got ${JSON.stringify(mode)})`,\n 'use \"per-weight\" (the default) or \"per-call\"',\n );\n const fallback = c[\"fallbackTokensPerWeight\"];\n if (\n fallback !== undefined &&\n (typeof fallback !== \"number\" || !Number.isFinite(fallback) || fallback <= 0)\n )\n fail(\n \"config-invalid\",\n \"scrum config.fallbackTokensPerWeight must be a positive finite number\",\n \"omit it for the default 20000\",\n );\n const out: ScrumConfig = {\n sprintBudget: budget,\n productGoal: c[\"productGoal\"],\n definitionOfDone: c[\"definitionOfDone\"] as Policy[],\n refinementSharePct: share,\n allowMidSprintAdd: add as ScrumConfig[\"allowMidSprintAdd\"],\n };\n if (wip !== undefined) out.inProgressWipLimit = wip as number;\n if (autoClose !== undefined) out.autoClose = autoClose as boolean;\n if (mode !== undefined) out.estimateMode = mode as EstimateMode;\n if (fallback !== undefined) out.fallbackTokensPerWeight = fallback as number;\n return out;\n}\n","import { openIteration } from \"../planner.ts\";\nimport type { Budget, WorkflowState } from \"../types.ts\";\n\ninterface Closed {\n id?: string;\n reason: string;\n done: string[];\n carryover: string[];\n doneWeight: number;\n committedWeight: number;\n spent: Required<Budget>;\n budget: Budget;\n}\n\nexport interface ScrumMetrics {\n velocity: number[];\n meanVelocity: number;\n burndown: number[];\n commitmentReliability: number;\n sprintGoalHitRate: number;\n carryoverRatio: number;\n budgetUtilisation: number;\n costPerPoint: number;\n /** The open sprint right now; all zeros when none is open. */\n current: Record<string, number>;\n}\n\nconst ratio = (num: number, den: number) => (den === 0 ? 0 : num / den);\n\nexport function scrumMetrics(state: WorkflowState): ScrumMetrics {\n const corrections = state.events.filter((e) => e.type === \"accounting.corrected\");\n const closed = state.events\n .filter((e) => e.type === \"sprint.closed\")\n .map((e) => {\n const c = e.payload as Closed;\n // corrections recorded after the close still belong to that sprint's spend\n const late = corrections\n .filter(\n (x) =>\n x.seq > e.seq &&\n c.id !== undefined &&\n (x.payload as { iteration: string | null }).iteration === c.id,\n )\n .reduce((sum, x) => sum + (x.payload as { delta: { tokens: number } }).delta.tokens, 0);\n return late === 0 ? c : { ...c, spent: { ...c.spent, tokens: c.spent.tokens + late } };\n });\n const counted = closed.filter((c) => c.reason !== \"cancel\");\n const velocity = counted.map((c) => c.doneWeight);\n const doneWeight = counted.reduce((s, c) => s + c.doneWeight, 0);\n const committedWeight = counted.reduce((s, c) => s + c.committedWeight, 0);\n const increments = state.events\n .filter((e) => e.type === \"increment\")\n .map((e) => e.payload as { goalMet: boolean });\n const withTokens = closed.filter((c) => c.budget.tokens !== undefined);\n const tokensSpent = counted.reduce((s, c) => s + c.spent.tokens, 0);\n return {\n velocity,\n meanVelocity: ratio(\n velocity.reduce((s, x) => s + x, 0),\n velocity.length,\n ),\n burndown: state.events\n .filter((e) => e.type === \"daily\")\n .map((e) => (e.payload as { remainingWeight: number }).remainingWeight),\n commitmentReliability: ratio(doneWeight, committedWeight),\n sprintGoalHitRate: ratio(increments.filter((i) => i.goalMet).length, increments.length),\n carryoverRatio: ratio(\n closed.reduce((s, c) => s + c.carryover.length, 0),\n closed.reduce((s, c) => s + c.done.length + c.carryover.length, 0),\n ),\n budgetUtilisation: ratio(\n withTokens.reduce((s, c) => s + c.spent.tokens, 0),\n withTokens.reduce((s, c) => s + (c.budget.tokens ?? 0), 0),\n ),\n costPerPoint: ratio(tokensSpent, doneWeight), // cost per delivered point over completed sprints\n current: currentSprint(state),\n };\n}\n\nfunction currentSprint(state: WorkflowState): Record<string, number> {\n const it = openIteration(state);\n const items = (it?.committed ?? []).map((id) => state.items[id]).filter((i) => i !== undefined);\n const weight = (list: typeof items) => list.reduce((sum, i) => sum + (i.weight ?? 0), 0);\n const committedWeight = weight(items);\n const doneWeight = weight(items.filter((i) => i.status === \"done\"));\n const spentTokens = it?.spent.tokens ?? 0;\n const budgetTokens = it?.budget.tokens ?? 0;\n return {\n spentTokens,\n spentTurns: it?.spent.turns ?? 0,\n budgetTokens,\n committedWeight,\n doneWeight,\n remainingWeight: committedWeight - doneWeight,\n costPerPoint: ratio(spentTokens, doneWeight),\n budgetUtilisation: ratio(spentTokens, budgetTokens),\n };\n}\n","import type { Role } from \"../types.ts\";\n\nexport function scrumRoles(): Role[] {\n return [\n {\n id: \"product-owner\",\n name: \"Product Owner\",\n modelTier: \"large\",\n capabilities: [\"order-backlog\", \"define-acceptance\", \"escalate\"],\n canApprove: [\"sprint-review\"],\n inputs: [\"stakeholder-needs\", \"product-goal\"],\n outputs: [\"ordered-backlog\", \"acceptance-criteria\"],\n do_not: [\"do not implement items yourself\"],\n },\n {\n id: \"scrum-master\",\n name: \"Scrum Master\",\n modelTier: \"large\",\n capabilities: [\"facilitate\", \"escalate\"],\n canApprove: [],\n inputs: [\"board\", \"blockers\"],\n outputs: [\"ceremony-records\", \"lessons\"],\n do_not: [\"do not reorder the Product Backlog\", \"do not assign work; the planner pulls\"],\n },\n {\n id: \"developer\",\n name: \"Developer\",\n modelTier: \"small\",\n capabilities: [\"deliver\", \"review\", \"verify\"],\n canApprove: [],\n inputs: [\"brief\"],\n outputs: [\"code\", \"test-output\"],\n do_not: [\"do not change acceptance criteria\", \"do not touch items outside your brief\"],\n },\n ];\n}\n","import { fail } from \"../errors.ts\";\nimport { openIteration } from \"../planner.ts\";\nimport type { Budget, Iteration, Policy, Rule, Violation, WorkflowState } from \"../types.ts\";\nimport type { ItemPatch } from \"../items.ts\";\nimport { canDo, closedSeq } from \"./ceremonies.ts\";\nimport { configOf, resumeStageOf } from \"./index.ts\";\n\nconst v = (\n rule: string,\n severity: Violation[\"severity\"],\n message: string,\n fix: string,\n item?: string,\n): Violation => (item ? { rule, severity, item, message, fix } : { rule, severity, message, fix });\n\nfunction lastClosed(state: WorkflowState): Iteration | undefined {\n for (let i = state.iterations.length - 1; i >= 0; i--) {\n const it = state.iterations[i]!;\n if (it.endedAt !== undefined) return it;\n }\n return undefined;\n}\n/** Canonical identity of a Definition of Done policy, independent of JSON key order. */\nconst policyKey = (p: Policy): string =>\n p.kind === \"evidence\"\n ? `evidence:${p.evidenceKind}`\n : p.kind === \"custom\"\n ? `custom:${p.id}`\n : p.kind;\n\nexport function scrumRules(): Rule[] {\n const oneOpen: Rule = {\n id: \"one-open-sprint\",\n severity: \"error\",\n check: (s, a) =>\n a.type === \"ceremony.plan\" && openIteration(s)\n ? [\n v(\n \"one-open-sprint\",\n \"error\",\n `sprint ${openIteration(s)!.id} is still open`,\n \"review or cancel it before planning the next sprint\",\n ),\n ]\n : [],\n };\n\n const retroFirst: Rule = {\n id: \"retro-before-plan\",\n severity: \"error\",\n check: (s, a) => {\n if (a.type !== \"ceremony.plan\") return [];\n const last = lastClosed(s);\n if (!last) return [];\n const seq = closedSeq(s, last.id);\n if (s.events.some((e) => e.type === \"retro\" && e.seq > seq)) return [];\n const sev = last.outcome === \"cancelled\" ? \"warning\" : \"error\";\n return [\n v(\n \"retro-before-plan\",\n sev,\n `sprint ${last.id} has no retrospective yet`,\n \"run the retro ceremony first (lessons may be empty)\",\n ),\n ];\n },\n };\n\n const budgetFixed: Rule = {\n id: \"sprint-budget-fixed\",\n severity: \"error\",\n check: (s, a) => {\n if (a.type !== \"ceremony.plan\") return [];\n const b = (a.payload as { budget?: Budget } | undefined)?.budget;\n if (b === undefined || JSON.stringify(b) === JSON.stringify(configOf(s).sprintBudget))\n return [];\n return [\n v(\n \"sprint-budget-fixed\",\n \"error\",\n \"sprint length is fixed by config.sprintBudget\",\n \"change sprintBudget between sprints with changeConfig / exwf config set, not per plan\",\n ),\n ];\n },\n };\n\n const scope: Rule = {\n id: \"scope-protects-goal\",\n severity: \"error\",\n check: (s, a) => {\n if (a.type !== \"ceremony.commit\") return [];\n const cfg = configOf(s);\n const p = (a.payload ?? {}) as { goalImpact?: string };\n if (cfg.allowMidSprintAdd === \"never\")\n return [\n v(\n \"scope-protects-goal\",\n \"error\",\n \"mid-sprint additions are disabled\",\n 'set allowMidSprintAdd to \"po-only\" or wait for the next sprint',\n ),\n ];\n if (cfg.allowMidSprintAdd === \"po-only\" && !canDo(s, a.by, \"order-backlog\"))\n return [\n v(\n \"scope-protects-goal\",\n \"error\",\n `\"${a.by}\" may not add work mid-sprint`,\n \"ask the Product Owner (order-backlog) to commit it\",\n ),\n ];\n if (p.goalImpact !== \"none\")\n return [\n v(\n \"scope-protects-goal\",\n \"error\",\n `adding work with goalImpact \"${p.goalImpact ?? \"unset\"}\" endangers the Sprint Goal`,\n 'only commit items with goalImpact: \"none\"; otherwise cancel and re-plan',\n ),\n ];\n return [];\n },\n };\n\n const closing: Rule = {\n id: \"sprint-closing\",\n severity: \"error\",\n check: (s, a) => {\n const it = openIteration(s);\n return a.type === \"ceremony.commit\" && it?.closing\n ? [\n v(\n \"sprint-closing\",\n \"error\",\n `sprint ${it.id} is closing: its budget is spent and no new work can start`,\n \"run ceremony review or cancel first, then plan the next sprint\",\n ),\n ]\n : [];\n },\n };\n\n const stageIds: Rule = {\n id: \"scrum-stage-ids\",\n severity: \"error\",\n check: (s, a) => {\n if (a.type !== \"init\") return [];\n const missing = [\"backlog\", \"sprint\", \"review\"].filter(\n (id) => !s.stages.some((st) => st.id === id),\n );\n if (missing.length)\n fail(\n \"config-invalid\",\n `scrum stages lack the required id(s): ${missing.join(\", \")}`,\n \"keep the stages backlog, sprint and review (omit stages to use the defaults), then run exwf init scrum again\",\n );\n return [];\n },\n };\n\n const poOrders: Rule = {\n id: \"po-orders-backlog\",\n severity: \"error\",\n check: (s, a) => {\n if (a.type !== \"ceremony.refine\" || canDo(s, a.by, \"order-backlog\")) return [];\n const items =\n ((a.payload ?? {}) as { items?: Array<{ id: string; patch: ItemPatch }> }).items ?? [];\n return items\n .filter((i) => i.patch.priority !== undefined)\n .map((i) =>\n v(\n \"po-orders-backlog\",\n \"error\",\n `\"${a.by}\" may not change the priority of \"${i.id}\"`,\n \"only the Product Owner orders the backlog; drop priority from the patch\",\n i.id,\n ),\n );\n },\n };\n\n const dod: Rule = {\n id: \"dod-not-weakened\",\n severity: \"error\",\n check: (s, a) => {\n if (a.type !== \"ceremony.retro\") return [];\n const p = (a.payload ?? {}) as { dodChanges?: unknown; allowWeaken?: boolean };\n if (p.dodChanges === undefined) return [];\n if (openIteration(s))\n return [\n v(\n \"dod-not-weakened\",\n \"error\",\n \"Definition of Done cannot change while a sprint is open\",\n \"close the sprint first; DoD changes apply to the next sprint\",\n ),\n ];\n if (!Array.isArray(p.dodChanges) || p.allowWeaken === true) return [];\n const next = p.dodChanges as Policy[];\n const kept = new Set(next.map(policyKey));\n const removed = configOf(s).definitionOfDone.filter((q) => !kept.has(policyKey(q)));\n if (removed.length === 0) return [];\n const describe = removed.map((q) => policyKey(q).replace(\":\", \" \"));\n return [\n v(\n \"dod-not-weakened\",\n \"error\",\n `retro dodChanges drops ${removed.length} Definition of Done policy(ies): ${describe.join(\", \")}`,\n 'keep them in dodChanges (it replaces the whole list; suggestedChange { kind: \"dod\" } appends one), or pass allowWeaken: true to weaken the Definition of Done knowingly',\n ),\n ];\n },\n };\n\n const carry: Rule = {\n id: \"carryover-reestimated\",\n severity: \"error\",\n check: (s, a) => {\n if (a.type !== \"ceremony.plan\") return [];\n const items = (a.payload as { items?: string[] | \"auto\" } | undefined)?.items;\n if (!Array.isArray(items)) return [];\n const last = lastClosed(s);\n if (!last) return [];\n const seq = closedSeq(s, last.id);\n return items\n .filter(\n (id) =>\n last.carryover.includes(id) &&\n !(s.items[id] && resumeStageOf(s.items[id], s) !== undefined) &&\n !s.events.some(\n (e) =>\n e.seq > seq &&\n (e.payload as { id: string }).id === id &&\n ((e.type === \"item.edited\" &&\n (e.payload as { changed: string[] }).changed.includes(\"weight\")) ||\n e.type === \"item.reestimated\"),\n ),\n )\n .map((id) =>\n v(\n \"carryover-reestimated\",\n \"error\",\n `carried-over item \"${id}\" was not re-estimated after ${last.id}`,\n \"refine it with a new weight before committing\",\n id,\n ),\n );\n },\n };\n\n return [oneOpen, retroFirst, budgetFixed, closing, stageIds, scope, poOrders, dod, carry];\n}\n","import type { Stage } from \"../types.ts\";\nimport type { ScrumConfig } from \"./config.ts\";\n\nexport function scrumStages(config: ScrumConfig): Stage[] {\n const inProgress: Stage = {\n id: \"in_progress\",\n name: \"In progress\",\n entryPolicy: [{ kind: \"dependencies-done\" }],\n exitPolicy: [],\n };\n if (config.inProgressWipLimit !== undefined) inProgress.wipLimit = config.inProgressWipLimit;\n return [\n {\n id: \"backlog\",\n name: \"Product Backlog\",\n entryPolicy: [],\n exitPolicy: [{ kind: \"acceptance-written\" }, { kind: \"estimate-present\" }],\n },\n { id: \"sprint\", name: \"Sprint Backlog\", entryPolicy: [], exitPolicy: [] },\n inProgress,\n {\n id: \"review\",\n name: \"Review\",\n entryPolicy: [],\n exitPolicy: config.definitionOfDone,\n review: true,\n },\n { id: \"done\", name: \"Increment\", entryPolicy: [], exitPolicy: [] },\n ];\n}\n","import { isExhausted, remaining } from \"../budget.ts\";\nimport { getItem, moveItem, patchItem, stripItemFields } from \"../items.ts\";\nimport { openIteration } from \"../planner.ts\";\nimport { appendEvent } from \"../state.ts\";\nimport type { CoreTerm, Methodology, PlannerOptions, WorkItem, WorkflowState } from \"../types.ts\";\nimport { scrumCeremonies, setDod } from \"./ceremonies.ts\";\nimport { validateScrumConfig, type ScrumConfig } from \"./config.ts\";\nimport { scrumMetrics, type ScrumMetrics } from \"./metrics.ts\";\nimport { scrumRoles } from \"./roles.ts\";\nimport { scrumRules } from \"./rules.ts\";\nimport { scrumStages } from \"./stages.ts\";\n\nexport { validateScrumConfig, scrumRoles, scrumRules, scrumStages, scrumMetrics };\nexport type { ScrumMetrics };\nexport type { ScrumConfig };\nexport { scrumCeremonies, dailyReport, canDo } from \"./ceremonies.ts\";\nexport type { DailyReport } from \"./ceremonies.ts\";\n\nexport const SCRUM_VOCABULARY: Record<CoreTerm, string> = {\n backlog: \"Product Backlog\",\n item: \"Product Backlog Item\",\n stage: \"Column\",\n iteration: \"Sprint\",\n increment: \"Increment\",\n ceremony: \"Scrum Event\",\n gate: \"Sprint Review\",\n};\n\n/** Advanced; used by ceremonies. */\nexport function configOf(state: WorkflowState): ScrumConfig {\n return state.config as ScrumConfig;\n}\n\n/**\n * The stage a carried-over item was returned from when it was in a review stage: it resumes there, not at the\n * sprint start. closeSprint releases blocked and awaiting_human items, so the stage (its `review` flag) is read from\n * the last system transition, not the status. Without `state` only a `review` status is recognised.\n */\nexport function resumeStageOf(item: WorkItem, state?: WorkflowState): string | undefined {\n const t = item.transitions.at(-1);\n if (!t || t.by !== \"system\" || t.to.stage !== \"backlog\" || t.to.status !== \"todo\")\n return undefined;\n if (!state) return t.from.status === \"review\" ? t.from.stage : undefined;\n const st = state.stages.find((x) => x.id === t.from.stage);\n return st?.review || t.from.status === \"review\" ? t.from.stage : undefined;\n}\n\n/** Send an item back to the backlog: clear its open blockers and pending decisions, strip iteration and role. */\nfunction toBacklog(state: WorkflowState, id: string, now: string): WorkflowState {\n let s = state;\n const open = getItem(s, id).blockers.filter((b) => !b.clearedAt);\n if (open.length) {\n s = patchItem(s, id, (it) => ({\n ...it,\n blockers: it.blockers.map((b) => (b.clearedAt ? b : { ...b, clearedAt: now })),\n }));\n for (const b of open)\n s = appendEvent(\n s,\n \"blocker.cleared\",\n \"system\",\n { id, blocker: b.id, reason: \"sprint closed\" },\n now,\n );\n }\n for (const p of s.pending.filter((x) => x.item === id)) {\n s = { ...s, pending: s.pending.filter((x) => x.id !== p.id) };\n s = appendEvent(\n s,\n \"pending.dropped\",\n \"system\",\n { id: p.id, item: id, reason: \"sprint closed\" },\n now,\n );\n }\n const cur = getItem(s, id);\n if (cur.stage !== \"backlog\" || cur.status !== \"todo\")\n s = moveItem(s, id, { stage: \"backlog\", status: \"todo\" }, \"system\", now);\n // a question keeps its role: only the escalation target can answer it\n return stripItemFields(s, id, cur.type === \"question\" ? [\"iteration\"] : [\"iteration\", \"role\"]);\n}\n\n/** Advanced; used by ceremonies. Closes the open sprint and returns unfinished work (and its open questions) to the backlog. */\nexport function closeSprint(\n state: WorkflowState,\n reason: \"budget\" | \"review\" | \"cancel\",\n now: string,\n): WorkflowState {\n const it = openIteration(state);\n if (!it) return state;\n const committed = it.committed.map((id) => getItem(state, id));\n const done = committed.filter((i) => i.status === \"done\").map((i) => i.id);\n const dropped = committed.filter((i) => i.status === \"dropped\").map((i) => i.id);\n const carryover = committed\n .filter((i) => i.status !== \"done\" && i.status !== \"dropped\")\n .map((i) => i.id);\n const carriedQuestions = Object.values(state.items)\n .filter(\n (i) =>\n i.type === \"question\" &&\n i.parent !== undefined &&\n carryover.includes(i.parent) &&\n i.status !== \"done\" &&\n i.status !== \"dropped\",\n )\n .map((i) => i.id);\n let s: WorkflowState = state;\n for (const id of [...carryover, ...carriedQuestions]) s = toBacklog(s, id, now);\n const weightOf = (ids: string[]) =>\n ids.reduce((sum, id) => sum + (state.items[id]?.weight ?? 0), 0);\n s = {\n ...s,\n iterations: s.iterations.map((x) => {\n if (x.id !== it.id) return x;\n const { closing: _c, ...rest } = x;\n return {\n ...rest,\n endedAt: now,\n outcome: reason === \"cancel\" ? \"cancelled\" : \"completed\",\n carryover,\n };\n }),\n };\n return appendEvent(\n s,\n \"sprint.closed\",\n \"system\",\n {\n id: it.id,\n reason,\n done,\n carryover,\n carriedQuestions,\n dropped,\n doneWeight: weightOf(done),\n committedWeight: weightOf(it.committed),\n spent: it.spent,\n budget: it.budget,\n },\n now,\n );\n}\n\nexport function scrum(): Methodology<ScrumConfig> {\n return {\n name: \"scrum\",\n vocabulary: SCRUM_VOCABULARY,\n validateConfig: validateScrumConfig,\n defaultStages: scrumStages,\n defaultRoles: scrumRoles,\n requiredCapabilities: [\"order-backlog\", \"facilitate\", \"deliver\"],\n exclusiveCapabilities: [\"order-backlog\"],\n plannerOptions(state): PlannerOptions {\n const cfg = configOf(state);\n const po: PlannerOptions = { schedulerMode: \"level\", dispatchStage: \"in_progress\" };\n if (cfg.inProgressWipLimit !== undefined) po.concurrencyCap = cfg.inProgressWipLimit;\n if (cfg.estimateMode !== undefined) po.estimateMode = cfg.estimateMode;\n if (cfg.fallbackTokensPerWeight !== undefined)\n po.fallbackTokensPerWeight = cfg.fallbackTokensPerWeight;\n return po;\n },\n candidates(state): WorkItem[] {\n const it = openIteration(state);\n if (!it || it.closing) return [];\n return Object.values(state.items).filter(\n (i) =>\n i.iteration === it.id &&\n (i.status === \"todo\" || i.status === \"review\") &&\n (i.stage === \"sprint\" || i.stage === \"review\"),\n );\n },\n invariants(state, item): string[] {\n const it = openIteration(state);\n const cfg = configOf(state);\n const left = it ? remaining(it.budget, it.spent) : {};\n return [\n `Sprint Goal: ${it?.goal ?? \"(no open sprint)\"}; Product Goal: ${cfg.productGoal}`,\n `Budget remaining: ${JSON.stringify(left)}; stop and hand off when it is gone`,\n `Definition of Done: ${cfg.definitionOfDone.map((p) => (p.kind === \"evidence\" ? `evidence ${p.evidenceKind}` : p.kind)).join(\", \") || \"(none)\"}`,\n `Do not change the scope of \"${item.id}\" or its acceptance criteria; raise open_questions instead`,\n ];\n },\n ceremonies: scrumCeremonies(scrum),\n rules: scrumRules(),\n metrics: (state) => ({ ...scrumMetrics(state) }),\n report(state) {\n const it = openIteration(state);\n return {\n closing: it?.closing === true,\n sprint: it?.id ?? null,\n reason: it?.closing ? \"budget\" : null,\n inFlight: it\n ? Object.values(state.items)\n .filter(\n (i) =>\n (i.iteration === it.id || it.committed.includes(i.id)) &&\n i.status === \"in_progress\",\n )\n .map((i) => i.id)\n : [],\n };\n },\n humanDefaults: { gates: [\"sprint-review\"] },\n afterConfigChange(state) {\n return setDod(state, configOf(state).definitionOfDone);\n },\n afterComplete(state, _itemId, now) {\n const it = openIteration(state);\n if (!it || (!it.closing && !isExhausted(it.budget, it.spent))) return state;\n const inFlight = Object.values(state.items).some(\n (i) => (i.iteration === it.id || it.committed.includes(i.id)) && i.status === \"in_progress\",\n );\n if (!inFlight && configOf(state).autoClose !== false)\n return closeSprint(state, \"budget\", now);\n if (it.closing) return state;\n return appendEvent(\n {\n ...state,\n iterations: state.iterations.map((x) => (x.id === it.id ? { ...x, closing: true } : x)),\n },\n \"sprint.closing\",\n \"system\",\n { id: it.id },\n now,\n );\n },\n };\n}\n"]}
@@ -0,0 +1,3 @@
1
+ 'use strict';var chunkS3BXVHO7_cjs=require('./chunk-S3BXVHO7.cjs');var f={Accounting:{type:"object",properties:{item:{type:"string"},role:{type:"string"},model:{type:"string"},tokensIn:{type:"number"},tokensOut:{type:"number"},durationMs:{type:"number"},startedAt:{type:"string"},endedAt:{type:"string"},estimate:{type:"boolean"}},required:["item","role","model","tokensIn","tokensOut","durationMs","startedAt","endedAt"],additionalProperties:false},Baseline:{type:"object",properties:{phase:{type:"string"},version:{type:"number"},at:{type:"string"},approvedBy:{type:"array",items:{type:"string"}},itemSnapshot:{type:"object",additionalProperties:{$ref:"#/definitions/WorkItem"}}},required:["phase","version","at","approvedBy","itemSnapshot"],additionalProperties:false},Blocker:{type:"object",properties:{id:{type:"string"},reason:{type:"string"},owner:{type:"string"},raisedAt:{type:"string"},clearedAt:{type:"string"}},required:["id","reason","owner","raisedAt"],additionalProperties:false},Budget:{type:"object",properties:{tokens:{type:"number"},turns:{type:"number"},wallclockMs:{type:"number"}},additionalProperties:false},Capability:{type:"string",enum:["order-backlog","define-acceptance","facilitate","deliver","review","verify","approve-gate","manage-flow","control-change","escalate"]},ClassOfService:{type:"string",enum:["expedite","fixed-date","standard","intangible"]},Event:{type:"object",properties:{seq:{type:"number"},at:{type:"string"},type:{type:"string"},by:{type:"string"},payload:{}},required:["seq","at","type","by","payload"],additionalProperties:false},Evidence:{type:"object",properties:{kind:{type:"string"},ref:{type:"string"},by:{type:"string"},at:{type:"string"}},required:["kind","ref","by","at"],additionalProperties:false},Gate:{type:"object",properties:{id:{type:"string"},requires:{type:"array",items:{$ref:"#/definitions/GateRequirement"}},evidence:{type:"array",items:{type:"string"}},onFail:{anyOf:[{type:"object",properties:{action:{type:"string",const:"block"}},required:["action"],additionalProperties:false},{type:"object",properties:{action:{type:"string",const:"return-to"},stage:{type:"string"}},required:["action","stage"],additionalProperties:false}]}},required:["id","requires","evidence","onFail"],additionalProperties:false},GateRequirement:{anyOf:[{type:"string",const:"human"},{type:"object",properties:{capability:{type:"string"}},required:["capability"],additionalProperties:false}]},Handoff:{type:"object",properties:{item:{type:"string"},role:{type:"string"},produced:{type:"array",items:{type:"object",properties:{kind:{type:"string"},ref:{type:"string"}},required:["kind","ref"],additionalProperties:false}},notes:{type:"string"},do_not:{type:"array",items:{type:"string"}},open_questions:{type:"array",items:{type:"string"}},verdict:{$ref:"#/definitions/Verdict"},follow_ups:{type:"array",items:{$ref:"#/definitions/NewItem"}},lessons:{type:"array",items:{type:"object",properties:{text:{type:"string"},scope:{type:"string",enum:["policy","skill","memory","spec","review"]}},required:["text","scope"],additionalProperties:false}}},required:["item","role","produced","notes","do_not","open_questions"],additionalProperties:false},ImpactAnalysis:{type:"object",properties:{summary:{type:"string"},reopen:{type:"array",items:{type:"string"}},weight:{type:"number"}},required:["summary","reopen","weight"],additionalProperties:false},ItemPatch:{type:"object",properties:{type:{$ref:"#/definitions/ItemType"},title:{type:"string"},description:{type:"string"},dependsOn:{type:"array",items:{type:"string"}},priority:{type:"number"},weight:{type:"number"},deadline:{type:"string"},classOfService:{$ref:"#/definitions/ClassOfService"},role:{type:"string"},parent:{type:"string"},acceptance:{type:"array",items:{type:"string"}},iteration:{type:"string"},traces:{type:"array",items:{type:"string"}},tags:{type:"array",items:{type:"string"}},affects:{type:"array",items:{type:"string"}},phase:{type:"string"},impactAnalysis:{$ref:"#/definitions/ImpactAnalysis"}},additionalProperties:false},ItemStatus:{type:"string",enum:["todo","in_progress","blocked","review","awaiting_human","done","dropped"]},ItemType:{type:"string",enum:["epic","story","task","bug","change-request","deliverable","question"]},Iteration:{type:"object",properties:{id:{type:"string"},goal:{type:"string"},budget:{$ref:"#/definitions/Budget"},spent:{$ref:"#/definitions/Spent"},startedAt:{type:"string"},endedAt:{type:"string"},committed:{type:"array",items:{type:"string"}},carryover:{type:"array",items:{type:"string"}},outcome:{type:"string",enum:["completed","cancelled"]},closing:{type:"boolean"}},required:["id","goal","budget","spent","startedAt","committed","carryover"],additionalProperties:false},Lesson:{type:"object",properties:{id:{type:"string"},at:{type:"string"},text:{type:"string"},scope:{type:"string",enum:["policy","skill","memory","spec","review"]},status:{type:"string",enum:["raised","adopted","dismissed"]},from:{type:"string"},item:{type:"string"},suggestedChange:{$ref:"#/definitions/LessonChange"}},required:["id","at","text","scope","status"],additionalProperties:false},LessonChange:{anyOf:[{type:"object",properties:{kind:{type:"string",const:"agreement"},text:{type:"string"},replaces:{type:"string"}},required:["kind","text"],additionalProperties:false},{type:"object",properties:{kind:{type:"string",const:"dod"},policy:{$ref:"#/definitions/Policy"}},required:["kind","policy"],additionalProperties:false},{type:"object",properties:{kind:{type:"string",const:"backlog"},item:{$ref:"#/definitions/NewItem"}},required:["kind","item"],additionalProperties:false},{type:"object",properties:{kind:{type:"string",const:"skill"},note:{type:"string"}},required:["kind","note"],additionalProperties:false}]},MethodologyName:{type:"string",enum:["scrum","kanban","waterfall"]},ModelTier:{type:"string",enum:["small","medium","large"]},NewItem:{type:"object",additionalProperties:false,properties:{stage:{type:"string"},type:{$ref:"#/definitions/ItemType"},description:{type:"string"},dependsOn:{type:"array",items:{type:"string"}},priority:{type:"number"},weight:{type:"number"},deadline:{type:"string"},classOfService:{$ref:"#/definitions/ClassOfService"},role:{type:"string"},parent:{type:"string"},acceptance:{type:"array",items:{type:"string"}},iteration:{type:"string"},traces:{type:"array",items:{type:"string"}},tags:{type:"array",items:{type:"string"}},affects:{type:"array",items:{type:"string"}},phase:{type:"string"},impactAnalysis:{$ref:"#/definitions/ImpactAnalysis"},id:{type:"string"},title:{type:"string"}},required:["id","title"]},PendingHuman:{type:"object",properties:{id:{type:"string"},kind:{type:"string",enum:["gate","decision"]},item:{type:"string"},gate:{type:"string"},question:{type:"string"},raisedAt:{type:"string"}},required:["id","kind","question","raisedAt"],additionalProperties:false},Phase:{type:"object",properties:{id:{type:"string"},name:{type:"string"},deliverables:{type:"array",items:{type:"string"}},gate:{$ref:"#/definitions/Gate"},status:{type:"string",enum:["pending","open","baselined","reopened"]},budget:{$ref:"#/definitions/Budget"},produced:{type:"array",items:{$ref:"#/definitions/Produced"}}},required:["id","name","deliverables","gate","status"],additionalProperties:false},Policy:{anyOf:[{type:"object",properties:{kind:{type:"string",const:"evidence"},evidenceKind:{type:"string"}},required:["kind","evidenceKind"],additionalProperties:false},{type:"object",properties:{kind:{type:"string",const:"acceptance-written"}},required:["kind"],additionalProperties:false},{type:"object",properties:{kind:{type:"string",const:"estimate-present"}},required:["kind"],additionalProperties:false},{type:"object",properties:{kind:{type:"string",const:"no-open-blockers"}},required:["kind"],additionalProperties:false},{type:"object",properties:{kind:{type:"string",const:"dependencies-done"}},required:["kind"],additionalProperties:false},{type:"object",properties:{kind:{type:"string",const:"custom"},id:{type:"string"},description:{type:"string"}},required:["kind","id","description"],additionalProperties:false}]},Produced:{type:"object",properties:{kind:{type:"string"},ref:{type:"string"},by:{type:"string"},at:{type:"string"}},required:["kind","ref","by","at"],additionalProperties:false},Role:{type:"object",properties:{id:{type:"string"},name:{type:"string"},modelTier:{$ref:"#/definitions/ModelTier"},resourceClass:{type:"string"},maxConcurrent:{type:"number"},capabilities:{type:"array",items:{$ref:"#/definitions/Capability"}},canApprove:{type:"array",items:{type:"string"}},inputs:{type:"array",items:{type:"string"}},outputs:{type:"array",items:{type:"string"}},do_not:{type:"array",items:{type:"string"}},constraints:{type:"array",items:{type:"string"}}},required:["id","name","modelTier","capabilities","canApprove","inputs","outputs","do_not"],additionalProperties:false},Spent:{type:"object",properties:{tokens:{type:"number"},turns:{type:"number"},wallclockMs:{type:"number"}},required:["tokens","turns","wallclockMs"],additionalProperties:false},Stage:{type:"object",properties:{id:{type:"string"},name:{type:"string"},wipLimit:{type:"number"},entryPolicy:{type:"array",items:{$ref:"#/definitions/Policy"}},exitPolicy:{type:"array",items:{$ref:"#/definitions/Policy"}},gate:{$ref:"#/definitions/Gate"},commitmentPoint:{type:"boolean"},deliveryPoint:{type:"boolean"},review:{type:"boolean"}},required:["id","name","entryPolicy","exitPolicy"],additionalProperties:false},Transition:{type:"object",properties:{from:{type:"object",properties:{stage:{type:"string"},status:{$ref:"#/definitions/ItemStatus"}},required:["stage","status"],additionalProperties:false},to:{type:"object",properties:{stage:{type:"string"},status:{$ref:"#/definitions/ItemStatus"}},required:["stage","status"],additionalProperties:false},at:{type:"string"},by:{type:"string"}},required:["from","to","at","by"],additionalProperties:false},Verdict:{type:"string",enum:["done","blocked","needs-review","rework","escalate"]},WorkItem:{type:"object",properties:{id:{type:"string"},type:{$ref:"#/definitions/ItemType"},title:{type:"string"},description:{type:"string"},dependsOn:{type:"array",items:{type:"string"}},priority:{type:"number"},weight:{type:"number"},deadline:{type:"string"},classOfService:{$ref:"#/definitions/ClassOfService"},stage:{type:"string"},status:{$ref:"#/definitions/ItemStatus"},role:{type:"string"},parent:{type:"string"},acceptance:{type:"array",items:{type:"string"}},evidence:{type:"array",items:{$ref:"#/definitions/Evidence"}},blockers:{type:"array",items:{$ref:"#/definitions/Blocker"}},transitions:{type:"array",items:{$ref:"#/definitions/Transition"}},iteration:{type:"string"},traces:{type:"array",items:{type:"string"}},tags:{type:"array",items:{type:"string"}},affects:{type:"array",items:{type:"string"}},phase:{type:"string"},impactAnalysis:{$ref:"#/definitions/ImpactAnalysis"}},required:["id","type","title","dependsOn","stage","status","acceptance","evidence","blockers","transitions"],additionalProperties:false},WorkflowState:{type:"object",properties:{version:{type:"number",const:1},methodology:{$ref:"#/definitions/MethodologyName"},config:{},items:{type:"object",additionalProperties:{$ref:"#/definitions/WorkItem"}},stages:{type:"array",items:{$ref:"#/definitions/Stage"}},roles:{type:"object",additionalProperties:{$ref:"#/definitions/Role"}},iterations:{type:"array",items:{$ref:"#/definitions/Iteration"}},phases:{type:"array",items:{$ref:"#/definitions/Phase"}},baseline:{$ref:"#/definitions/Baseline"},baselines:{type:"array",items:{$ref:"#/definitions/Baseline"}},events:{type:"array",items:{$ref:"#/definitions/Event"}},accounting:{type:"array",items:{$ref:"#/definitions/Accounting"}},pending:{type:"array",items:{$ref:"#/definitions/PendingHuman"}},lessons:{type:"array",items:{$ref:"#/definitions/Lesson"}},agreements:{type:"array",items:{type:"string"}}},required:["version","methodology","config","items","stages","roles","iterations","events","accounting","pending","lessons","agreements"],additionalProperties:false}},k={Budget:{type:"object",properties:{tokens:{type:"number"},turns:{type:"number"},wallclockMs:{type:"number"}},additionalProperties:false},EstimateMode:{type:"string",enum:["per-weight","per-call"]},Policy:{anyOf:[{type:"object",properties:{kind:{type:"string",const:"evidence"},evidenceKind:{type:"string"}},required:["kind","evidenceKind"],additionalProperties:false},{type:"object",properties:{kind:{type:"string",const:"acceptance-written"}},required:["kind"],additionalProperties:false},{type:"object",properties:{kind:{type:"string",const:"estimate-present"}},required:["kind"],additionalProperties:false},{type:"object",properties:{kind:{type:"string",const:"no-open-blockers"}},required:["kind"],additionalProperties:false},{type:"object",properties:{kind:{type:"string",const:"dependencies-done"}},required:["kind"],additionalProperties:false},{type:"object",properties:{kind:{type:"string",const:"custom"},id:{type:"string"},description:{type:"string"}},required:["kind","id","description"],additionalProperties:false}]},ScrumConfig:{type:"object",properties:{sprintBudget:{$ref:"#/definitions/Budget"},productGoal:{type:"string"},definitionOfDone:{type:"array",items:{$ref:"#/definitions/Policy"}},refinementSharePct:{type:"number"},allowMidSprintAdd:{type:"string",enum:["never","po-only","any"]},inProgressWipLimit:{type:"number"},autoClose:{type:"boolean"},estimateMode:{$ref:"#/definitions/EstimateMode"},fallbackTokensPerWeight:{type:"number"}},required:["sprintBudget","productGoal","definitionOfDone","refinementSharePct","allowMidSprintAdd"],additionalProperties:false}},P={ClassConfig:{type:"object",properties:{wipBypass:{type:"number"},sle:{$ref:"#/definitions/ServiceLevel"}},additionalProperties:false},KanbanColumn:{type:"object",properties:{id:{type:"string"},name:{type:"string"},wipLimit:{type:"number"},policies:{type:"array",items:{$ref:"#/definitions/Policy"}},commitmentPoint:{type:"boolean"},deliveryPoint:{type:"boolean"},review:{type:"boolean"}},required:["id","name","policies"],additionalProperties:false},KanbanConfig:{type:"object",properties:{columns:{type:"array",items:{$ref:"#/definitions/KanbanColumn"}},classesOfService:{type:"object",properties:{expedite:{$ref:"#/definitions/ClassConfig"},"fixed-date":{$ref:"#/definitions/ClassConfig"},standard:{$ref:"#/definitions/ClassConfig"},intangible:{$ref:"#/definitions/ClassConfig"}},additionalProperties:false},fairness:{type:"object",properties:{aging:{type:"boolean"},maxDeferralRounds:{type:"number"}},required:["aging","maxDeferralRounds"],additionalProperties:false},cadences:{type:"object",properties:{replenishment:{type:"object",properties:{everyTurns:{type:"number"}},additionalProperties:false},"delivery-planning":{type:"object",properties:{everyTurns:{type:"number"}},additionalProperties:false},"service-delivery-review":{type:"object",properties:{everyTurns:{type:"number"}},additionalProperties:false},"operations-review":{type:"object",properties:{everyTurns:{type:"number"}},additionalProperties:false},"risk-review":{type:"object",properties:{everyTurns:{type:"number"}},additionalProperties:false},"strategy-review":{type:"object",properties:{everyTurns:{type:"number"}},additionalProperties:false}},additionalProperties:false},throughputWindowMs:{type:"number"},maxExpedite:{type:"number"}},required:["columns","classesOfService","fairness","cadences","throughputWindowMs","maxExpedite"],additionalProperties:false},Policy:{anyOf:[{type:"object",properties:{kind:{type:"string",const:"evidence"},evidenceKind:{type:"string"}},required:["kind","evidenceKind"],additionalProperties:false},{type:"object",properties:{kind:{type:"string",const:"acceptance-written"}},required:["kind"],additionalProperties:false},{type:"object",properties:{kind:{type:"string",const:"estimate-present"}},required:["kind"],additionalProperties:false},{type:"object",properties:{kind:{type:"string",const:"no-open-blockers"}},required:["kind"],additionalProperties:false},{type:"object",properties:{kind:{type:"string",const:"dependencies-done"}},required:["kind"],additionalProperties:false},{type:"object",properties:{kind:{type:"string",const:"custom"},id:{type:"string"},description:{type:"string"}},required:["kind","id","description"],additionalProperties:false}]},ServiceLevel:{type:"object",properties:{percentile:{type:"number"},targetMs:{type:"number"}},required:["percentile","targetMs"],additionalProperties:false}},$={Budget:{type:"object",properties:{tokens:{type:"number"},turns:{type:"number"},wallclockMs:{type:"number"}},additionalProperties:false},Gate:{type:"object",properties:{id:{type:"string"},requires:{type:"array",items:{$ref:"#/definitions/GateRequirement"}},evidence:{type:"array",items:{type:"string"}},onFail:{anyOf:[{type:"object",properties:{action:{type:"string",const:"block"}},required:["action"],additionalProperties:false},{type:"object",properties:{action:{type:"string",const:"return-to"},stage:{type:"string"}},required:["action","stage"],additionalProperties:false}]}},required:["id","requires","evidence","onFail"],additionalProperties:false},GateRequirement:{anyOf:[{type:"string",const:"human"},{type:"object",properties:{capability:{type:"string"}},required:["capability"],additionalProperties:false}]},WaterfallConfig:{type:"object",properties:{phases:{type:"array",items:{$ref:"#/definitions/WaterfallPhaseConfig"}},changeControl:{type:"object",properties:{requiresImpactAnalysis:{type:"boolean"},approvers:{type:"array",items:{$ref:"#/definitions/GateRequirement"}}},required:["requiresImpactAnalysis","approvers"],additionalProperties:false},traceability:{type:"object",properties:{from:{type:"string"},to:{type:"array",items:{type:"string"}}},required:["from","to"],additionalProperties:false},humanGates:{anyOf:[{type:"string",const:"all"},{type:"array",items:{type:"string"}}]},fallbackTokensPerWeight:{type:"number"}},required:["phases","changeControl","traceability","humanGates"],additionalProperties:false},WaterfallPhaseConfig:{type:"object",properties:{id:{type:"string"},name:{type:"string"},deliverables:{type:"array",items:{type:"string"}},gate:{$ref:"#/definitions/Gate"},budget:{$ref:"#/definitions/Budget"},deliverBy:{type:"string"}},required:["id","name","deliverables","gate"],additionalProperties:false}};var j="#/definitions/";function u(e){return e===null?"null":Array.isArray(e)?"array":typeof e}function v(e,t){return e==="integer"?typeof t=="number"&&Number.isInteger(t):u(t)===e}function p(e){let t=JSON.stringify(e);return t===void 0?String(e):t.length>60?`${t.slice(0,57)}...`:t}function h(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function S(e,t){return JSON.stringify(e)===JSON.stringify(t)}function a(e,t,s,n,i){return {path:e===""?"/":e,keyword:t,message:s,expected:n,found:i}}function x(e,t){e.startsWith(j)||chunkS3BXVHO7_cjs.b("invalid-input",`schema $ref ${JSON.stringify(e)} is not #/definitions/<name>`,"regenerate the schema with pnpm schema:gen");let s=e.slice(j.length),n=t.definitions&&Object.hasOwn(t.definitions,s)?t.definitions[s]:void 0;return n||chunkS3BXVHO7_cjs.b("invalid-input",`schema $ref ${JSON.stringify(e)} names no definition`,"regenerate the schema with pnpm schema:gen"),n}function q(e,t){let s=t===""?"/":t;return e.reduce((n,i)=>n+(i.keyword==="type"&&i.path===s?1e3:i.keyword==="const"?100:1),0)}function O(e){let t=e[0]?.filter(s=>s.keyword==="const")??[];for(let s of t){let n=e.map(r=>r.find(o=>o.keyword==="const"&&o.path===s.path));if(n.some(r=>r===void 0))continue;let i=[...new Set(n.map(r=>r?.expected))].join(" | ");return {path:s.path,keyword:"enum",message:`expected one of ${i}`,expected:i,found:s.found}}}function w(e,t){return l(e,t,e,"")}function l(e,t,s,n){if(e.$ref!==void 0)return l(x(e.$ref,s),t,s,n);let i=[];if(e.type!==void 0){let r=Array.isArray(e.type)?e.type:[e.type];if(!r.some(o=>v(o,t))){let o=r.join(" | ");return [a(n,"type",`expected ${o}, got ${u(t)}`,o,p(t))]}}if(e.const!==void 0&&!S(t,e.const)&&i.push(a(n,"const",`expected ${p(e.const)}`,p(e.const),p(t))),e.enum!==void 0&&!e.enum.some(r=>S(r,t))){let r=e.enum.map(p).join(" | ");i.push(a(n,"enum",`expected one of ${r}`,r,p(t)));}if(typeof t=="number"&&(e.minimum!==void 0&&t<e.minimum&&i.push(a(n,"minimum",`expected >= ${e.minimum}`,`>= ${e.minimum}`,p(t))),e.maximum!==void 0&&t>e.maximum&&i.push(a(n,"maximum",`expected <= ${e.maximum}`,`<= ${e.maximum}`,p(t)))),typeof t=="string"&&(e.minLength!==void 0&&t.length<e.minLength&&i.push(a(n,"minLength",`expected at least ${e.minLength} characters`,`length >= ${e.minLength}`,p(t))),e.pattern!==void 0&&!new RegExp(e.pattern,"u").test(t)&&i.push(a(n,"pattern",`expected to match /${e.pattern}/`,`/${e.pattern}/`,p(t)))),Array.isArray(t)&&e.items!==void 0){let r=e.items;t.forEach((o,c)=>i.push(...l(r,o,s,`${n}/${c}`)));}if(u(t)==="object"){let r=t;for(let[o,c]of Object.entries(r)){let g=e.properties&&Object.hasOwn(e.properties,o)?e.properties[o]:void 0,d=`${n}/${h(o)}`;if(g)i.push(...l(g,c,s,d));else if(e.additionalProperties===false){let b=Object.keys(e.properties??{}).join(", ");i.push(a(d,"additionalProperties",`unknown property ${JSON.stringify(o)}`,b?`one of ${b}`:"no properties",o));}else typeof e.additionalProperties=="object"&&i.push(...l(e.additionalProperties,c,s,d));}for(let o of e.required??[])Object.hasOwn(r,o)||i.push(a(`${n}/${h(o)}`,"required",`missing required property ${JSON.stringify(o)}`,"present","absent"));}if(e.anyOf!==void 0){let r,o=[];for(let g of e.anyOf){let d=l(g,t,s,n);if(d.length===0){r=[];break}o.push(d),(r===void 0||q(d,n)<q(r,n))&&(r=d);}let c=r&&r.length>0?O(o):void 0;c?i.push(c):r&&i.push(...r);}return i}function I(e,t,s){let n=w(e,t),i=n[0];if(!i)return;let r=n.length>1?` (+${n.length-1} more)`:"";chunkS3BXVHO7_cjs.b("invalid-input",`${s} does not match its schema: ${i.path} ${i.message}${r}`,`fix ${s} at ${i.path}: expected ${i.expected}, found ${i.found}`);}var A="http://json-schema.org/draft-07/schema#";function y(e,t){return {$schema:A,$ref:`#/definitions/${e}`,definitions:t}}var J=y("WorkflowState",f),R=y("Role",f),M=y("NewItem",f),B=y("ItemPatch",f),L=y("Handoff",f),_=y("ScrumConfig",k),D=y("KanbanConfig",P),W=y("WaterfallConfig",$);
2
+ exports.a=w;exports.b=I;exports.c=A;exports.d=J;exports.e=R;exports.f=M;exports.g=B;exports.h=L;exports.i=_;exports.j=D;exports.k=W;//# sourceMappingURL=chunk-WOGK54HB.cjs.map
3
+ //# sourceMappingURL=chunk-WOGK54HB.cjs.map