ex-workflow 1.0.1 → 1.1.0
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.
- package/CHANGELOG.md +4 -0
- package/README.md +78 -19
- package/dist/adapters/index.cjs +1 -1
- package/dist/adapters/index.d.cts +1 -1
- package/dist/adapters/index.d.ts +1 -1
- package/dist/adapters/index.mjs +1 -1
- package/dist/{budget-Cx63FX2K.d.ts → budget-Bd8KpGIr.d.ts} +1 -1
- package/dist/{budget-JyNKxP5N.d.cts → budget-CezCinPF.d.cts} +1 -1
- package/dist/chunk-6P3OKXSK.mjs +2 -0
- package/dist/chunk-6P3OKXSK.mjs.map +1 -0
- package/dist/{chunk-5PHK72VM.cjs → chunk-7FS6KWTG.cjs} +2 -2
- package/dist/{chunk-5PHK72VM.cjs.map → chunk-7FS6KWTG.cjs.map} +1 -1
- package/dist/chunk-APKA5FOU.cjs +2 -0
- package/dist/chunk-APKA5FOU.cjs.map +1 -0
- package/dist/chunk-ATCJ4IHP.mjs +2 -0
- package/dist/{chunk-Z2G7DGDF.mjs.map → chunk-ATCJ4IHP.mjs.map} +1 -1
- package/dist/chunk-C2IYMWE6.cjs +3 -0
- package/dist/chunk-C2IYMWE6.cjs.map +1 -0
- package/dist/chunk-EACZBAP3.cjs +2 -0
- package/dist/chunk-EACZBAP3.cjs.map +1 -0
- package/dist/chunk-EHBQBXWA.cjs +2 -0
- package/dist/{chunk-VXH2FAKV.cjs.map → chunk-EHBQBXWA.cjs.map} +1 -1
- package/dist/chunk-FQW2LETC.cjs +2 -0
- package/dist/chunk-FQW2LETC.cjs.map +1 -0
- package/dist/chunk-FTS75UIU.mjs +2 -0
- package/dist/{chunk-U3OXAO67.mjs.map → chunk-FTS75UIU.mjs.map} +1 -1
- package/dist/chunk-HCRVWMG4.cjs +2 -0
- package/dist/chunk-HCRVWMG4.cjs.map +1 -0
- package/dist/chunk-KLWZEXZU.mjs +3 -0
- package/dist/chunk-KLWZEXZU.mjs.map +1 -0
- package/dist/chunk-MW4HR7HC.mjs +2 -0
- package/dist/chunk-MW4HR7HC.mjs.map +1 -0
- package/dist/chunk-NDCQTRIV.mjs +2 -0
- package/dist/chunk-NDCQTRIV.mjs.map +1 -0
- package/dist/{chunk-7IG6EQI4.mjs → chunk-QZ6HD6DE.mjs} +3 -3
- package/dist/{chunk-7IG6EQI4.mjs.map → chunk-QZ6HD6DE.mjs.map} +1 -1
- package/dist/{chunk-HIHMBMB5.cjs → chunk-RL27372B.cjs} +2 -2
- package/dist/{chunk-HIHMBMB5.cjs.map → chunk-RL27372B.cjs.map} +1 -1
- package/dist/chunk-SP5MC7RR.mjs +2 -0
- package/dist/{chunk-QDMEM62U.mjs.map → chunk-SP5MC7RR.mjs.map} +1 -1
- package/dist/chunk-SYLO7FUL.mjs +2 -0
- package/dist/{chunk-3KFQPSRX.mjs.map → chunk-SYLO7FUL.mjs.map} +1 -1
- package/dist/chunk-T3V5UE34.mjs +2 -0
- package/dist/{chunk-UZQV73X7.mjs.map → chunk-T3V5UE34.mjs.map} +1 -1
- package/dist/{chunk-FKTCGQYB.cjs → chunk-TS66RAJR.cjs} +2 -2
- package/dist/{chunk-FKTCGQYB.cjs.map → chunk-TS66RAJR.cjs.map} +1 -1
- package/dist/{chunk-YRATJT7P.cjs → chunk-U23FUYPD.cjs} +4 -4
- package/dist/{chunk-YRATJT7P.cjs.map → chunk-U23FUYPD.cjs.map} +1 -1
- package/dist/{chunk-CYXVGHQM.cjs → chunk-YJQ5YJ7S.cjs} +2 -2
- package/dist/{chunk-CYXVGHQM.cjs.map → chunk-YJQ5YJ7S.cjs.map} +1 -1
- package/dist/chunk-YOS77GL3.mjs +2 -0
- package/dist/chunk-YOS77GL3.mjs.map +1 -0
- package/dist/chunk-YTG2MOD7.cjs +2 -0
- package/dist/chunk-YTG2MOD7.cjs.map +1 -0
- package/dist/chunk-YZJ6WFH4.mjs +2 -0
- package/dist/chunk-YZJ6WFH4.mjs.map +1 -0
- package/dist/cli/bin.cjs +1 -1
- package/dist/cli/bin.cjs.map +1 -1
- package/dist/cli/bin.mjs +1 -1
- package/dist/cli/bin.mjs.map +1 -1
- package/dist/cli/index.cjs +1 -1
- package/dist/cli/index.mjs +1 -1
- package/dist/experimentation/index.cjs +2 -0
- package/dist/experimentation/index.cjs.map +1 -0
- package/dist/experimentation/index.d.cts +28 -0
- package/dist/experimentation/index.d.ts +28 -0
- package/dist/experimentation/index.mjs +2 -0
- package/dist/experimentation/index.mjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/investigation/index.cjs +2 -0
- package/dist/investigation/index.cjs.map +1 -0
- package/dist/investigation/index.d.cts +13 -0
- package/dist/investigation/index.d.ts +13 -0
- package/dist/investigation/index.mjs +2 -0
- package/dist/investigation/index.mjs.map +1 -0
- package/dist/kanban/index.cjs +1 -1
- package/dist/kanban/index.d.cts +1 -1
- package/dist/kanban/index.d.ts +1 -1
- package/dist/kanban/index.mjs +1 -1
- package/dist/schema/index.cjs +1 -1
- package/dist/schema/index.d.cts +3 -1
- package/dist/schema/index.d.ts +3 -1
- package/dist/schema/index.mjs +1 -1
- package/dist/scrum/index.cjs +1 -1
- package/dist/scrum/index.d.cts +3 -3
- package/dist/scrum/index.d.ts +3 -3
- package/dist/scrum/index.mjs +1 -1
- package/dist/types-BScHXlRx.d.cts +509 -0
- package/dist/types-BScHXlRx.d.ts +509 -0
- package/dist/types.d.cts +1 -388
- package/dist/types.d.ts +1 -388
- package/dist/waterfall/index.cjs +1 -1
- package/dist/waterfall/index.d.cts +1 -1
- package/dist/waterfall/index.d.ts +1 -1
- package/dist/waterfall/index.mjs +1 -1
- package/package.json +43 -20
- package/dist/chunk-3KFQPSRX.mjs +0 -2
- package/dist/chunk-5TXYMLBF.mjs +0 -3
- package/dist/chunk-5TXYMLBF.mjs.map +0 -1
- package/dist/chunk-MQWMQ4PD.mjs +0 -2
- package/dist/chunk-MQWMQ4PD.mjs.map +0 -1
- package/dist/chunk-QDMEM62U.mjs +0 -2
- package/dist/chunk-U3OXAO67.mjs +0 -2
- package/dist/chunk-UZQV73X7.mjs +0 -2
- package/dist/chunk-VXH2FAKV.cjs +0 -2
- package/dist/chunk-WOGK54HB.cjs +0 -3
- package/dist/chunk-WOGK54HB.cjs.map +0 -1
- package/dist/chunk-XMO2RCXB.cjs +0 -2
- package/dist/chunk-XMO2RCXB.cjs.map +0 -1
- package/dist/chunk-YBHHICTZ.mjs +0 -2
- package/dist/chunk-YBHHICTZ.mjs.map +0 -1
- package/dist/chunk-YJN4JEJU.cjs +0 -2
- package/dist/chunk-YJN4JEJU.cjs.map +0 -1
- package/dist/chunk-Z2G7DGDF.mjs +0 -2
package/dist/chunk-5TXYMLBF.mjs
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import {b}from'./chunk-2FRRD6A3.mjs';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)||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||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)`:"";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
|
-
export{w as a,I as b,A as c,J as d,R as e,M as f,B as g,L as h,_ as i,D as j,W as k};//# sourceMappingURL=chunk-5TXYMLBF.mjs.map
|
|
3
|
-
//# sourceMappingURL=chunk-5TXYMLBF.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/schema/generated.ts","../src/schema/validate.ts","../src/schema/index.ts"],"names":["CORE_DEFINITIONS","SCRUM_DEFINITIONS","KANBAN_DEFINITIONS","WATERFALL_DEFINITIONS","DEFS","kindOf","v","isType","t","show","s","esc","key","same","a","b","err","path","keyword","message","expected","found","resolve","ref","root","fail","name","def","rank","errors","branchPath","own","e","collapse","branches","first","candidate","consts","c","validate","schema","value","walk","out","types","items","i","obj","prop","at","known","best","failed","branch","merged","assertValid","what","more","DRAFT_07","document","definitions","workflowStateSchema","roleSchema","newItemSchema","itemPatchSchema","handoffSchema","scrumConfigSchema","kanbanConfigSchema","waterfallConfigSchema"],"mappings":"qCAIO,IAAMA,CAAAA,CAA+C,CAC1D,UAAA,CAAY,CACV,IAAA,CAAM,QAAA,CACN,UAAA,CAAY,CACV,IAAA,CAAM,CACJ,IAAA,CAAM,QACR,CAAA,CACA,IAAA,CAAM,CACJ,IAAA,CAAM,QACR,CAAA,CACA,KAAA,CAAO,CACL,IAAA,CAAM,QACR,CAAA,CACA,QAAA,CAAU,CACR,IAAA,CAAM,QACR,CAAA,CACA,SAAA,CAAW,CACT,IAAA,CAAM,QACR,CAAA,CACA,UAAA,CAAY,CACV,IAAA,CAAM,QACR,CAAA,CACA,SAAA,CAAW,CACT,IAAA,CAAM,QACR,CAAA,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,IAAA,EAAOD,CAAI,CAAA,IAAA,EAAOrB,CAAAA,CAAM,IAAI,CAAA,WAAA,EAAcA,CAAAA,CAAM,QAAQ,CAAA,QAAA,EAAWA,CAAAA,CAAM,KAAK,CAAA,CAChF,EACF,CC3MO,IAAMuB,CAAAA,CAAW,0CAExB,SAASC,CAAAA,CAASjC,CAAAA,CAAckC,CAAAA,CAA6D,CAC3F,OAAO,CAAE,OAAA,CAASF,CAAAA,CAAU,IAAA,CAAM,CAAA,cAAA,EAAiBhC,CAAI,CAAA,CAAA,CAAI,WAAA,CAAAkC,CAAY,CACzE,CAGO,IAAMC,CAAAA,CAAsBF,CAAAA,CAAS,eAAA,CAAiB3D,CAAgB,CAAA,CAEhE8D,CAAAA,CAAaH,CAAAA,CAAS,MAAA,CAAQ3D,CAAgB,CAAA,CAE9C+D,CAAAA,CAAgBJ,CAAAA,CAAS,SAAA,CAAW3D,CAAgB,CAAA,CAEpDgE,CAAAA,CAAkBL,CAAAA,CAAS,WAAA,CAAa3D,CAAgB,CAAA,CAExDiE,CAAAA,CAAgBN,CAAAA,CAAS,SAAA,CAAW3D,CAAgB,CAAA,CAEpDkE,CAAAA,CAAoBP,CAAAA,CAAS,aAAA,CAAe1D,CAAiB,CAAA,CAC7DkE,CAAAA,CAAqBR,CAAAA,CAAS,cAAA,CAAgBzD,CAAkB,CAAA,CAChEkE,CAAAA,CAAwBT,CAAAA,CAAS,iBAAA,CAAmBxD,CAAqB","file":"chunk-5TXYMLBF.mjs","sourcesContent":["// GENERATED by scripts/gen-schema.mjs from src/types.ts and src/{scrum,kanban,waterfall}/config.ts.\n// Do not edit. Run `pnpm schema:gen`; `pnpm schema:check` fails the build when this file is stale.\nimport type { JsonSchema } from \"./types.ts\";\n\nexport const CORE_DEFINITIONS: Record<string, JsonSchema> = {\n Accounting: {\n type: \"object\",\n properties: {\n item: {\n type: \"string\",\n },\n role: {\n type: \"string\",\n },\n model: {\n type: \"string\",\n },\n tokensIn: {\n type: \"number\",\n },\n tokensOut: {\n type: \"number\",\n },\n durationMs: {\n type: \"number\",\n },\n startedAt: {\n type: \"string\",\n },\n endedAt: {\n type: \"string\",\n },\n estimate: {\n type: \"boolean\",\n },\n },\n required: [\n \"item\",\n \"role\",\n \"model\",\n \"tokensIn\",\n \"tokensOut\",\n \"durationMs\",\n \"startedAt\",\n \"endedAt\",\n ],\n additionalProperties: false,\n },\n Baseline: {\n type: \"object\",\n properties: {\n phase: {\n type: \"string\",\n },\n version: {\n type: \"number\",\n },\n at: {\n type: \"string\",\n },\n approvedBy: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n itemSnapshot: {\n type: \"object\",\n additionalProperties: {\n $ref: \"#/definitions/WorkItem\",\n },\n },\n },\n required: [\"phase\", \"version\", \"at\", \"approvedBy\", \"itemSnapshot\"],\n additionalProperties: false,\n },\n Blocker: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n },\n reason: {\n type: \"string\",\n },\n owner: {\n type: \"string\",\n },\n raisedAt: {\n type: \"string\",\n },\n clearedAt: {\n type: \"string\",\n },\n },\n required: [\"id\", \"reason\", \"owner\", \"raisedAt\"],\n additionalProperties: false,\n },\n Budget: {\n type: \"object\",\n properties: {\n tokens: {\n type: \"number\",\n },\n turns: {\n type: \"number\",\n },\n wallclockMs: {\n type: \"number\",\n },\n },\n additionalProperties: false,\n },\n Capability: {\n type: \"string\",\n enum: [\n \"order-backlog\",\n \"define-acceptance\",\n \"facilitate\",\n \"deliver\",\n \"review\",\n \"verify\",\n \"approve-gate\",\n \"manage-flow\",\n \"control-change\",\n \"escalate\",\n ],\n },\n ClassOfService: {\n type: \"string\",\n enum: [\"expedite\", \"fixed-date\", \"standard\", \"intangible\"],\n },\n Event: {\n type: \"object\",\n properties: {\n seq: {\n type: \"number\",\n },\n at: {\n type: \"string\",\n },\n type: {\n type: \"string\",\n },\n by: {\n type: \"string\",\n },\n payload: {},\n },\n required: [\"seq\", \"at\", \"type\", \"by\", \"payload\"],\n additionalProperties: false,\n },\n Evidence: {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n },\n ref: {\n type: \"string\",\n },\n by: {\n type: \"string\",\n },\n at: {\n type: \"string\",\n },\n },\n required: [\"kind\", \"ref\", \"by\", \"at\"],\n additionalProperties: false,\n },\n Gate: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n },\n requires: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/GateRequirement\",\n },\n },\n evidence: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n onFail: {\n anyOf: [\n {\n type: \"object\",\n properties: {\n action: {\n type: \"string\",\n const: \"block\",\n },\n },\n required: [\"action\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n action: {\n type: \"string\",\n const: \"return-to\",\n },\n stage: {\n type: \"string\",\n },\n },\n required: [\"action\", \"stage\"],\n additionalProperties: false,\n },\n ],\n },\n },\n required: [\"id\", \"requires\", \"evidence\", \"onFail\"],\n additionalProperties: false,\n },\n GateRequirement: {\n anyOf: [\n {\n type: \"string\",\n const: \"human\",\n },\n {\n type: \"object\",\n properties: {\n capability: {\n type: \"string\",\n },\n },\n required: [\"capability\"],\n additionalProperties: false,\n },\n ],\n },\n Handoff: {\n type: \"object\",\n properties: {\n item: {\n type: \"string\",\n },\n role: {\n type: \"string\",\n },\n produced: {\n type: \"array\",\n items: {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n },\n ref: {\n type: \"string\",\n },\n },\n required: [\"kind\", \"ref\"],\n additionalProperties: false,\n },\n },\n notes: {\n type: \"string\",\n },\n do_not: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n open_questions: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n verdict: {\n $ref: \"#/definitions/Verdict\",\n },\n follow_ups: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/NewItem\",\n },\n },\n lessons: {\n type: \"array\",\n items: {\n type: \"object\",\n properties: {\n text: {\n type: \"string\",\n },\n scope: {\n type: \"string\",\n enum: [\"policy\", \"skill\", \"memory\", \"spec\", \"review\"],\n },\n },\n required: [\"text\", \"scope\"],\n additionalProperties: false,\n },\n },\n },\n required: [\"item\", \"role\", \"produced\", \"notes\", \"do_not\", \"open_questions\"],\n additionalProperties: false,\n },\n ImpactAnalysis: {\n type: \"object\",\n properties: {\n summary: {\n type: \"string\",\n },\n reopen: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n weight: {\n type: \"number\",\n },\n },\n required: [\"summary\", \"reopen\", \"weight\"],\n additionalProperties: false,\n },\n ItemPatch: {\n type: \"object\",\n properties: {\n type: {\n $ref: \"#/definitions/ItemType\",\n },\n title: {\n type: \"string\",\n },\n description: {\n type: \"string\",\n },\n dependsOn: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n priority: {\n type: \"number\",\n },\n weight: {\n type: \"number\",\n },\n deadline: {\n type: \"string\",\n },\n classOfService: {\n $ref: \"#/definitions/ClassOfService\",\n },\n role: {\n type: \"string\",\n },\n parent: {\n type: \"string\",\n },\n acceptance: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n iteration: {\n type: \"string\",\n },\n traces: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n tags: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n affects: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n phase: {\n type: \"string\",\n },\n impactAnalysis: {\n $ref: \"#/definitions/ImpactAnalysis\",\n },\n },\n additionalProperties: false,\n },\n ItemStatus: {\n type: \"string\",\n enum: [\"todo\", \"in_progress\", \"blocked\", \"review\", \"awaiting_human\", \"done\", \"dropped\"],\n },\n ItemType: {\n type: \"string\",\n enum: [\"epic\", \"story\", \"task\", \"bug\", \"change-request\", \"deliverable\", \"question\"],\n },\n Iteration: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n },\n goal: {\n type: \"string\",\n },\n budget: {\n $ref: \"#/definitions/Budget\",\n },\n spent: {\n $ref: \"#/definitions/Spent\",\n },\n startedAt: {\n type: \"string\",\n },\n endedAt: {\n type: \"string\",\n },\n committed: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n carryover: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n outcome: {\n type: \"string\",\n enum: [\"completed\", \"cancelled\"],\n },\n closing: {\n type: \"boolean\",\n },\n },\n required: [\"id\", \"goal\", \"budget\", \"spent\", \"startedAt\", \"committed\", \"carryover\"],\n additionalProperties: false,\n },\n Lesson: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n },\n at: {\n type: \"string\",\n },\n text: {\n type: \"string\",\n },\n scope: {\n type: \"string\",\n enum: [\"policy\", \"skill\", \"memory\", \"spec\", \"review\"],\n },\n status: {\n type: \"string\",\n enum: [\"raised\", \"adopted\", \"dismissed\"],\n },\n from: {\n type: \"string\",\n },\n item: {\n type: \"string\",\n },\n suggestedChange: {\n $ref: \"#/definitions/LessonChange\",\n },\n },\n required: [\"id\", \"at\", \"text\", \"scope\", \"status\"],\n additionalProperties: false,\n },\n LessonChange: {\n anyOf: [\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"agreement\",\n },\n text: {\n type: \"string\",\n },\n replaces: {\n type: \"string\",\n },\n },\n required: [\"kind\", \"text\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"dod\",\n },\n policy: {\n $ref: \"#/definitions/Policy\",\n },\n },\n required: [\"kind\", \"policy\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"backlog\",\n },\n item: {\n $ref: \"#/definitions/NewItem\",\n },\n },\n required: [\"kind\", \"item\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"skill\",\n },\n note: {\n type: \"string\",\n },\n },\n required: [\"kind\", \"note\"],\n additionalProperties: false,\n },\n ],\n },\n MethodologyName: {\n type: \"string\",\n enum: [\"scrum\", \"kanban\", \"waterfall\"],\n },\n ModelTier: {\n type: \"string\",\n enum: [\"small\", \"medium\", \"large\"],\n },\n NewItem: {\n type: \"object\",\n additionalProperties: false,\n properties: {\n stage: {\n type: \"string\",\n },\n type: {\n $ref: \"#/definitions/ItemType\",\n },\n description: {\n type: \"string\",\n },\n dependsOn: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n priority: {\n type: \"number\",\n },\n weight: {\n type: \"number\",\n },\n deadline: {\n type: \"string\",\n },\n classOfService: {\n $ref: \"#/definitions/ClassOfService\",\n },\n role: {\n type: \"string\",\n },\n parent: {\n type: \"string\",\n },\n acceptance: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n iteration: {\n type: \"string\",\n },\n traces: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n tags: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n affects: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n phase: {\n type: \"string\",\n },\n impactAnalysis: {\n $ref: \"#/definitions/ImpactAnalysis\",\n },\n id: {\n type: \"string\",\n },\n title: {\n type: \"string\",\n },\n },\n required: [\"id\", \"title\"],\n },\n PendingHuman: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n },\n kind: {\n type: \"string\",\n enum: [\"gate\", \"decision\"],\n },\n item: {\n type: \"string\",\n },\n gate: {\n type: \"string\",\n },\n question: {\n type: \"string\",\n },\n raisedAt: {\n type: \"string\",\n },\n },\n required: [\"id\", \"kind\", \"question\", \"raisedAt\"],\n additionalProperties: false,\n },\n Phase: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n },\n name: {\n type: \"string\",\n },\n deliverables: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n gate: {\n $ref: \"#/definitions/Gate\",\n },\n status: {\n type: \"string\",\n enum: [\"pending\", \"open\", \"baselined\", \"reopened\"],\n },\n budget: {\n $ref: \"#/definitions/Budget\",\n },\n produced: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/Produced\",\n },\n },\n },\n required: [\"id\", \"name\", \"deliverables\", \"gate\", \"status\"],\n additionalProperties: false,\n },\n Policy: {\n anyOf: [\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"evidence\",\n },\n evidenceKind: {\n type: \"string\",\n },\n },\n required: [\"kind\", \"evidenceKind\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"acceptance-written\",\n },\n },\n required: [\"kind\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"estimate-present\",\n },\n },\n required: [\"kind\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"no-open-blockers\",\n },\n },\n required: [\"kind\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"dependencies-done\",\n },\n },\n required: [\"kind\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"custom\",\n },\n id: {\n type: \"string\",\n },\n description: {\n type: \"string\",\n },\n },\n required: [\"kind\", \"id\", \"description\"],\n additionalProperties: false,\n },\n ],\n },\n Produced: {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n },\n ref: {\n type: \"string\",\n },\n by: {\n type: \"string\",\n },\n at: {\n type: \"string\",\n },\n },\n required: [\"kind\", \"ref\", \"by\", \"at\"],\n additionalProperties: false,\n },\n Role: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n },\n name: {\n type: \"string\",\n },\n modelTier: {\n $ref: \"#/definitions/ModelTier\",\n },\n resourceClass: {\n type: \"string\",\n },\n maxConcurrent: {\n type: \"number\",\n },\n capabilities: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/Capability\",\n },\n },\n canApprove: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n inputs: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n outputs: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n do_not: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n constraints: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n },\n required: [\n \"id\",\n \"name\",\n \"modelTier\",\n \"capabilities\",\n \"canApprove\",\n \"inputs\",\n \"outputs\",\n \"do_not\",\n ],\n additionalProperties: false,\n },\n Spent: {\n type: \"object\",\n properties: {\n tokens: {\n type: \"number\",\n },\n turns: {\n type: \"number\",\n },\n wallclockMs: {\n type: \"number\",\n },\n },\n required: [\"tokens\", \"turns\", \"wallclockMs\"],\n additionalProperties: false,\n },\n Stage: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n },\n name: {\n type: \"string\",\n },\n wipLimit: {\n type: \"number\",\n },\n entryPolicy: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/Policy\",\n },\n },\n exitPolicy: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/Policy\",\n },\n },\n gate: {\n $ref: \"#/definitions/Gate\",\n },\n commitmentPoint: {\n type: \"boolean\",\n },\n deliveryPoint: {\n type: \"boolean\",\n },\n review: {\n type: \"boolean\",\n },\n },\n required: [\"id\", \"name\", \"entryPolicy\", \"exitPolicy\"],\n additionalProperties: false,\n },\n Transition: {\n type: \"object\",\n properties: {\n from: {\n type: \"object\",\n properties: {\n stage: {\n type: \"string\",\n },\n status: {\n $ref: \"#/definitions/ItemStatus\",\n },\n },\n required: [\"stage\", \"status\"],\n additionalProperties: false,\n },\n to: {\n type: \"object\",\n properties: {\n stage: {\n type: \"string\",\n },\n status: {\n $ref: \"#/definitions/ItemStatus\",\n },\n },\n required: [\"stage\", \"status\"],\n additionalProperties: false,\n },\n at: {\n type: \"string\",\n },\n by: {\n type: \"string\",\n },\n },\n required: [\"from\", \"to\", \"at\", \"by\"],\n additionalProperties: false,\n },\n Verdict: {\n type: \"string\",\n enum: [\"done\", \"blocked\", \"needs-review\", \"rework\", \"escalate\"],\n },\n WorkItem: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n },\n type: {\n $ref: \"#/definitions/ItemType\",\n },\n title: {\n type: \"string\",\n },\n description: {\n type: \"string\",\n },\n dependsOn: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n priority: {\n type: \"number\",\n },\n weight: {\n type: \"number\",\n },\n deadline: {\n type: \"string\",\n },\n classOfService: {\n $ref: \"#/definitions/ClassOfService\",\n },\n stage: {\n type: \"string\",\n },\n status: {\n $ref: \"#/definitions/ItemStatus\",\n },\n role: {\n type: \"string\",\n },\n parent: {\n type: \"string\",\n },\n acceptance: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n evidence: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/Evidence\",\n },\n },\n blockers: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/Blocker\",\n },\n },\n transitions: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/Transition\",\n },\n },\n iteration: {\n type: \"string\",\n },\n traces: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n tags: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n affects: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n phase: {\n type: \"string\",\n },\n impactAnalysis: {\n $ref: \"#/definitions/ImpactAnalysis\",\n },\n },\n required: [\n \"id\",\n \"type\",\n \"title\",\n \"dependsOn\",\n \"stage\",\n \"status\",\n \"acceptance\",\n \"evidence\",\n \"blockers\",\n \"transitions\",\n ],\n additionalProperties: false,\n },\n WorkflowState: {\n type: \"object\",\n properties: {\n version: {\n type: \"number\",\n const: 1,\n },\n methodology: {\n $ref: \"#/definitions/MethodologyName\",\n },\n config: {},\n items: {\n type: \"object\",\n additionalProperties: {\n $ref: \"#/definitions/WorkItem\",\n },\n },\n stages: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/Stage\",\n },\n },\n roles: {\n type: \"object\",\n additionalProperties: {\n $ref: \"#/definitions/Role\",\n },\n },\n iterations: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/Iteration\",\n },\n },\n phases: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/Phase\",\n },\n },\n baseline: {\n $ref: \"#/definitions/Baseline\",\n },\n baselines: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/Baseline\",\n },\n },\n events: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/Event\",\n },\n },\n accounting: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/Accounting\",\n },\n },\n pending: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/PendingHuman\",\n },\n },\n lessons: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/Lesson\",\n },\n },\n agreements: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n },\n required: [\n \"version\",\n \"methodology\",\n \"config\",\n \"items\",\n \"stages\",\n \"roles\",\n \"iterations\",\n \"events\",\n \"accounting\",\n \"pending\",\n \"lessons\",\n \"agreements\",\n ],\n additionalProperties: false,\n },\n};\n\nexport const SCRUM_DEFINITIONS: Record<string, JsonSchema> = {\n Budget: {\n type: \"object\",\n properties: {\n tokens: {\n type: \"number\",\n },\n turns: {\n type: \"number\",\n },\n wallclockMs: {\n type: \"number\",\n },\n },\n additionalProperties: false,\n },\n EstimateMode: {\n type: \"string\",\n enum: [\"per-weight\", \"per-call\"],\n },\n Policy: {\n anyOf: [\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"evidence\",\n },\n evidenceKind: {\n type: \"string\",\n },\n },\n required: [\"kind\", \"evidenceKind\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"acceptance-written\",\n },\n },\n required: [\"kind\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"estimate-present\",\n },\n },\n required: [\"kind\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"no-open-blockers\",\n },\n },\n required: [\"kind\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"dependencies-done\",\n },\n },\n required: [\"kind\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"custom\",\n },\n id: {\n type: \"string\",\n },\n description: {\n type: \"string\",\n },\n },\n required: [\"kind\", \"id\", \"description\"],\n additionalProperties: false,\n },\n ],\n },\n ScrumConfig: {\n type: \"object\",\n properties: {\n sprintBudget: {\n $ref: \"#/definitions/Budget\",\n },\n productGoal: {\n type: \"string\",\n },\n definitionOfDone: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/Policy\",\n },\n },\n refinementSharePct: {\n type: \"number\",\n },\n allowMidSprintAdd: {\n type: \"string\",\n enum: [\"never\", \"po-only\", \"any\"],\n },\n inProgressWipLimit: {\n type: \"number\",\n },\n autoClose: {\n type: \"boolean\",\n },\n estimateMode: {\n $ref: \"#/definitions/EstimateMode\",\n },\n fallbackTokensPerWeight: {\n type: \"number\",\n },\n },\n required: [\n \"sprintBudget\",\n \"productGoal\",\n \"definitionOfDone\",\n \"refinementSharePct\",\n \"allowMidSprintAdd\",\n ],\n additionalProperties: false,\n },\n};\n\nexport const KANBAN_DEFINITIONS: Record<string, JsonSchema> = {\n ClassConfig: {\n type: \"object\",\n properties: {\n wipBypass: {\n type: \"number\",\n },\n sle: {\n $ref: \"#/definitions/ServiceLevel\",\n },\n },\n additionalProperties: false,\n },\n KanbanColumn: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n },\n name: {\n type: \"string\",\n },\n wipLimit: {\n type: \"number\",\n },\n policies: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/Policy\",\n },\n },\n commitmentPoint: {\n type: \"boolean\",\n },\n deliveryPoint: {\n type: \"boolean\",\n },\n review: {\n type: \"boolean\",\n },\n },\n required: [\"id\", \"name\", \"policies\"],\n additionalProperties: false,\n },\n KanbanConfig: {\n type: \"object\",\n properties: {\n columns: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/KanbanColumn\",\n },\n },\n classesOfService: {\n type: \"object\",\n properties: {\n expedite: {\n $ref: \"#/definitions/ClassConfig\",\n },\n \"fixed-date\": {\n $ref: \"#/definitions/ClassConfig\",\n },\n standard: {\n $ref: \"#/definitions/ClassConfig\",\n },\n intangible: {\n $ref: \"#/definitions/ClassConfig\",\n },\n },\n additionalProperties: false,\n },\n fairness: {\n type: \"object\",\n properties: {\n aging: {\n type: \"boolean\",\n },\n maxDeferralRounds: {\n type: \"number\",\n },\n },\n required: [\"aging\", \"maxDeferralRounds\"],\n additionalProperties: false,\n },\n cadences: {\n type: \"object\",\n properties: {\n replenishment: {\n type: \"object\",\n properties: {\n everyTurns: {\n type: \"number\",\n },\n },\n additionalProperties: false,\n },\n \"delivery-planning\": {\n type: \"object\",\n properties: {\n everyTurns: {\n type: \"number\",\n },\n },\n additionalProperties: false,\n },\n \"service-delivery-review\": {\n type: \"object\",\n properties: {\n everyTurns: {\n type: \"number\",\n },\n },\n additionalProperties: false,\n },\n \"operations-review\": {\n type: \"object\",\n properties: {\n everyTurns: {\n type: \"number\",\n },\n },\n additionalProperties: false,\n },\n \"risk-review\": {\n type: \"object\",\n properties: {\n everyTurns: {\n type: \"number\",\n },\n },\n additionalProperties: false,\n },\n \"strategy-review\": {\n type: \"object\",\n properties: {\n everyTurns: {\n type: \"number\",\n },\n },\n additionalProperties: false,\n },\n },\n additionalProperties: false,\n },\n throughputWindowMs: {\n type: \"number\",\n },\n maxExpedite: {\n type: \"number\",\n },\n },\n required: [\n \"columns\",\n \"classesOfService\",\n \"fairness\",\n \"cadences\",\n \"throughputWindowMs\",\n \"maxExpedite\",\n ],\n additionalProperties: false,\n },\n Policy: {\n anyOf: [\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"evidence\",\n },\n evidenceKind: {\n type: \"string\",\n },\n },\n required: [\"kind\", \"evidenceKind\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"acceptance-written\",\n },\n },\n required: [\"kind\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"estimate-present\",\n },\n },\n required: [\"kind\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"no-open-blockers\",\n },\n },\n required: [\"kind\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"dependencies-done\",\n },\n },\n required: [\"kind\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"custom\",\n },\n id: {\n type: \"string\",\n },\n description: {\n type: \"string\",\n },\n },\n required: [\"kind\", \"id\", \"description\"],\n additionalProperties: false,\n },\n ],\n },\n ServiceLevel: {\n type: \"object\",\n properties: {\n percentile: {\n type: \"number\",\n },\n targetMs: {\n type: \"number\",\n },\n },\n required: [\"percentile\", \"targetMs\"],\n additionalProperties: false,\n },\n};\n\nexport const WATERFALL_DEFINITIONS: Record<string, JsonSchema> = {\n Budget: {\n type: \"object\",\n properties: {\n tokens: {\n type: \"number\",\n },\n turns: {\n type: \"number\",\n },\n wallclockMs: {\n type: \"number\",\n },\n },\n additionalProperties: false,\n },\n Gate: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n },\n requires: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/GateRequirement\",\n },\n },\n evidence: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n onFail: {\n anyOf: [\n {\n type: \"object\",\n properties: {\n action: {\n type: \"string\",\n const: \"block\",\n },\n },\n required: [\"action\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n action: {\n type: \"string\",\n const: \"return-to\",\n },\n stage: {\n type: \"string\",\n },\n },\n required: [\"action\", \"stage\"],\n additionalProperties: false,\n },\n ],\n },\n },\n required: [\"id\", \"requires\", \"evidence\", \"onFail\"],\n additionalProperties: false,\n },\n GateRequirement: {\n anyOf: [\n {\n type: \"string\",\n const: \"human\",\n },\n {\n type: \"object\",\n properties: {\n capability: {\n type: \"string\",\n },\n },\n required: [\"capability\"],\n additionalProperties: false,\n },\n ],\n },\n WaterfallConfig: {\n type: \"object\",\n properties: {\n phases: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/WaterfallPhaseConfig\",\n },\n },\n changeControl: {\n type: \"object\",\n properties: {\n requiresImpactAnalysis: {\n type: \"boolean\",\n },\n approvers: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/GateRequirement\",\n },\n },\n },\n required: [\"requiresImpactAnalysis\", \"approvers\"],\n additionalProperties: false,\n },\n traceability: {\n type: \"object\",\n properties: {\n from: {\n type: \"string\",\n },\n to: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n },\n required: [\"from\", \"to\"],\n additionalProperties: false,\n },\n humanGates: {\n anyOf: [\n {\n type: \"string\",\n const: \"all\",\n },\n {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n ],\n },\n fallbackTokensPerWeight: {\n type: \"number\",\n },\n },\n required: [\"phases\", \"changeControl\", \"traceability\", \"humanGates\"],\n additionalProperties: false,\n },\n WaterfallPhaseConfig: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n },\n name: {\n type: \"string\",\n },\n deliverables: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n gate: {\n $ref: \"#/definitions/Gate\",\n },\n budget: {\n $ref: \"#/definitions/Budget\",\n },\n deliverBy: {\n type: \"string\",\n },\n },\n required: [\"id\", \"name\", \"deliverables\", \"gate\"],\n additionalProperties: false,\n },\n};\n","import { fail } from \"../errors.ts\";\nimport type { JsonSchema, SchemaError } from \"./types.ts\";\n\nconst DEFS = \"#/definitions/\";\n\nfunction kindOf(v: unknown): string {\n if (v === null) return \"null\";\n if (Array.isArray(v)) return \"array\";\n return typeof v;\n}\nfunction isType(t: string, v: unknown): boolean {\n if (t === \"integer\") return typeof v === \"number\" && Number.isInteger(v);\n return kindOf(v) === t;\n}\nfunction show(v: unknown): string {\n const s = JSON.stringify(v);\n if (s === undefined) return String(v);\n return s.length > 60 ? `${s.slice(0, 57)}...` : s;\n}\n/** JSON-pointer escaping for one key. */\nfunction esc(key: string): string {\n return key.replace(/~/g, \"~0\").replace(/\\//g, \"~1\");\n}\nfunction same(a: unknown, b: unknown): boolean {\n return JSON.stringify(a) === JSON.stringify(b);\n}\nfunction err(\n path: string,\n keyword: string,\n message: string,\n expected: string,\n found: string,\n): SchemaError {\n return { path: path === \"\" ? \"/\" : path, keyword, message, expected, found };\n}\n\nfunction resolve(ref: string, root: JsonSchema): JsonSchema {\n if (!ref.startsWith(DEFS))\n fail(\n \"invalid-input\",\n `schema $ref ${JSON.stringify(ref)} is not #/definitions/<name>`,\n \"regenerate the schema with pnpm schema:gen\",\n );\n const name = ref.slice(DEFS.length);\n const def =\n root.definitions && Object.hasOwn(root.definitions, name) ? root.definitions[name] : undefined;\n if (!def)\n fail(\n \"invalid-input\",\n `schema $ref ${JSON.stringify(ref)} names no definition`,\n \"regenerate the schema with pnpm schema:gen\",\n );\n return def;\n}\n\n/**\n * Misfit of one anyOf branch (lower is a better fit): a `type` error at the branch's own path (the value is the\n * wrong kind entirely) weighs 1000, a `const` mismatch (a discriminator) 100, anything else 1.\n */\nfunction rank(errors: SchemaError[], branchPath: string): number {\n const own = branchPath === \"\" ? \"/\" : branchPath;\n return errors.reduce(\n (n, e) => n + (e.keyword === \"type\" && e.path === own ? 1000 : e.keyword === \"const\" ? 100 : 1),\n 0,\n );\n}\n\n/** When every failed branch has a `const` error at one pointer (the discriminator), report that once as an enum. */\nfunction collapse(branches: SchemaError[][]): SchemaError | undefined {\n const first = branches[0]?.filter((e) => e.keyword === \"const\") ?? [];\n for (const candidate of first) {\n const consts = branches.map((b) =>\n b.find((e) => e.keyword === \"const\" && e.path === candidate.path),\n );\n if (consts.some((c) => c === undefined)) continue;\n const expected = [...new Set(consts.map((c) => c?.expected))].join(\" | \");\n return {\n path: candidate.path,\n keyword: \"enum\",\n message: `expected one of ${expected}`,\n expected,\n found: candidate.found,\n };\n }\n return undefined;\n}\n\n/** Validate `value` against `schema` (a document: `$ref`s resolve against its `definitions`). Returns every error found. */\nexport function validate(schema: JsonSchema, value: unknown): SchemaError[] {\n return walk(schema, value, schema, \"\");\n}\n\nfunction walk(schema: JsonSchema, value: unknown, root: JsonSchema, path: string): SchemaError[] {\n if (schema.$ref !== undefined) return walk(resolve(schema.$ref, root), value, root, path);\n const out: SchemaError[] = [];\n if (schema.type !== undefined) {\n const types = Array.isArray(schema.type) ? schema.type : [schema.type];\n if (!types.some((t) => isType(t, value))) {\n const expected = types.join(\" | \");\n return [\n err(path, \"type\", `expected ${expected}, got ${kindOf(value)}`, expected, show(value)),\n ];\n }\n }\n if (schema.const !== undefined && !same(value, schema.const))\n out.push(err(path, \"const\", `expected ${show(schema.const)}`, show(schema.const), show(value)));\n if (schema.enum !== undefined && !schema.enum.some((e) => same(e, value))) {\n const expected = schema.enum.map(show).join(\" | \");\n out.push(err(path, \"enum\", `expected one of ${expected}`, expected, show(value)));\n }\n if (typeof value === \"number\") {\n if (schema.minimum !== undefined && value < schema.minimum)\n out.push(\n err(path, \"minimum\", `expected >= ${schema.minimum}`, `>= ${schema.minimum}`, show(value)),\n );\n if (schema.maximum !== undefined && value > schema.maximum)\n out.push(\n err(path, \"maximum\", `expected <= ${schema.maximum}`, `<= ${schema.maximum}`, show(value)),\n );\n }\n if (typeof value === \"string\") {\n if (schema.minLength !== undefined && value.length < schema.minLength)\n out.push(\n err(\n path,\n \"minLength\",\n `expected at least ${schema.minLength} characters`,\n `length >= ${schema.minLength}`,\n show(value),\n ),\n );\n if (schema.pattern !== undefined && !new RegExp(schema.pattern, \"u\").test(value))\n out.push(\n err(\n path,\n \"pattern\",\n `expected to match /${schema.pattern}/`,\n `/${schema.pattern}/`,\n show(value),\n ),\n );\n }\n if (Array.isArray(value) && schema.items !== undefined) {\n const items = schema.items;\n value.forEach((v, i) => out.push(...walk(items, v, root, `${path}/${i}`)));\n }\n if (kindOf(value) === \"object\") {\n const obj = value as Record<string, unknown>;\n for (const [key, v] of Object.entries(obj)) {\n const prop =\n schema.properties && Object.hasOwn(schema.properties, key)\n ? schema.properties[key]\n : undefined;\n const at = `${path}/${esc(key)}`;\n if (prop) out.push(...walk(prop, v, root, at));\n else if (schema.additionalProperties === false) {\n const known = Object.keys(schema.properties ?? {}).join(\", \");\n out.push(\n err(\n at,\n \"additionalProperties\",\n `unknown property ${JSON.stringify(key)}`,\n known ? `one of ${known}` : \"no properties\",\n key,\n ),\n );\n } else if (typeof schema.additionalProperties === \"object\")\n out.push(...walk(schema.additionalProperties, v, root, at));\n }\n for (const key of schema.required ?? [])\n if (!Object.hasOwn(obj, key))\n out.push(\n err(\n `${path}/${esc(key)}`,\n \"required\",\n `missing required property ${JSON.stringify(key)}`,\n \"present\",\n \"absent\",\n ),\n );\n }\n if (schema.anyOf !== undefined) {\n let best: SchemaError[] | undefined;\n const failed: SchemaError[][] = [];\n for (const branch of schema.anyOf) {\n const errors = walk(branch, value, root, path);\n if (errors.length === 0) {\n best = [];\n break;\n }\n failed.push(errors);\n if (best === undefined || rank(errors, path) < rank(best, path)) best = errors;\n }\n const merged = best && best.length > 0 ? collapse(failed) : undefined;\n if (merged) out.push(merged);\n else if (best) out.push(...best);\n }\n return out;\n}\n\n/** Throw WorkflowError(\"invalid-input\") describing the first problem when `value` does not match `schema`. */\nexport function assertValid(schema: JsonSchema, value: unknown, what: string): void {\n const errors = validate(schema, value);\n const first = errors[0];\n if (!first) return;\n const more = errors.length > 1 ? ` (+${errors.length - 1} more)` : \"\";\n fail(\n \"invalid-input\",\n `${what} does not match its schema: ${first.path} ${first.message}${more}`,\n `fix ${what} at ${first.path}: expected ${first.expected}, found ${first.found}`,\n );\n}\n","import {\n CORE_DEFINITIONS,\n KANBAN_DEFINITIONS,\n SCRUM_DEFINITIONS,\n WATERFALL_DEFINITIONS,\n} from \"./generated.ts\";\nimport type { JsonSchema, JsonSchemaDocument } from \"./types.ts\";\n\nexport const DRAFT_07 = \"http://json-schema.org/draft-07/schema#\";\n\nfunction document(name: string, definitions: Record<string, JsonSchema>): JsonSchemaDocument {\n return { $schema: DRAFT_07, $ref: `#/definitions/${name}`, definitions };\n}\n\n/** `.workflow/state.json` */\nexport const workflowStateSchema = document(\"WorkflowState\", CORE_DEFINITIONS);\n/** a role manifest (`.workflow/roles/*.json`, `exwf role add`) */\nexport const roleSchema = document(\"Role\", CORE_DEFINITIONS);\n/** `exwf add <item.json>` */\nexport const newItemSchema = document(\"NewItem\", CORE_DEFINITIONS);\n/** `exwf edit <id> <patch.json>` */\nexport const itemPatchSchema = document(\"ItemPatch\", CORE_DEFINITIONS);\n/** `exwf complete <id> <handoff.json>` */\nexport const handoffSchema = document(\"Handoff\", CORE_DEFINITIONS);\n/** `exwf init scrum --config` / the scrum-master policy.json */\nexport const scrumConfigSchema = document(\"ScrumConfig\", SCRUM_DEFINITIONS);\nexport const kanbanConfigSchema = document(\"KanbanConfig\", KANBAN_DEFINITIONS);\nexport const waterfallConfigSchema = document(\"WaterfallConfig\", WATERFALL_DEFINITIONS);\n\nexport { validate, assertValid } from \"./validate.ts\";\nexport type { JsonSchema, JsonSchemaDocument, SchemaError } from \"./types.ts\";\n"]}
|
package/dist/chunk-MQWMQ4PD.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {b as b$2,e as e$2,d as d$2,c as c$1}from'./chunk-Z2G7DGDF.mjs';import {l}from'./chunk-QDMEM62U.mjs';import {I}from'./chunk-UZQV73X7.mjs';import {N}from'./chunk-3KFQPSRX.mjs';import {f,X,d as d$1,R,L,u,Y,A,_,w as w$1,v,Z}from'./chunk-YBHHICTZ.mjs';import {c,e,d,g,f as f$1,b as b$3}from'./chunk-7IG6EQI4.mjs';import {b as b$1,e as e$1,h as h$1,g as g$1,f as f$2}from'./chunk-5TXYMLBF.mjs';import {b,a}from'./chunk-2FRRD6A3.mjs';import {stat,readFile}from'fs/promises';import w from'path';var $={scrum:l,kanban:I,waterfall:N},p=["exwf init <scrum|kanban|waterfall> --config <file> [--roles <file>]","exwf add <item.json> [--by who] exwf edit <id> <patch.json> [--by who]","exwf next [--max n] [--fallback-tokens-per-weight n]","exwf complete <id> <handoff.json> --tokens-in n --tokens-out n --duration-ms n --model m [--estimate] [--role r]","exwf account <item> [--line n] [--tokens-in n] [--tokens-out n] [--duration-ms n] [--model m] [--by who]","exwf ceremony <name> [input.json] [--by who]","exwf decide <pendingId> approve|reject [--by who] [--note text]","exwf config set <patch.json> [--by who] exwf unblock <item> [--blocker id] [--note text] [--by who]","exwf status | board | metrics | pending | lessons","exwf validate <action.json> exwf role add <manifest.json> | role list"],at=new Set(["estimate"]);function et(l){let t=[],u={};for(let a=0;a<l.length;a++){let v=l[a];if(v.startsWith("--")){let n=v.slice(2);if(at.has(n)){u[n]="true";continue}let m=l[a+1];(m===void 0||m.startsWith("--"))&&b("invalid-input",`--${n} needs a value`,`pass --${n} <text>`),u[n]=m,a++;}else t.push(v);}return {positional:t,flags:u}}async function x(l){try{return JSON.parse(await readFile(l,"utf8"))}catch(t){return b("invalid-input",`cannot read JSON from ${l}: ${t.message}`,"check the path and that the file is valid JSON")}}function h(l){let t=Object.hasOwn($,l.methodology)?$[l.methodology]:void 0;return t||b("config-invalid",`methodology "${l.methodology}" is not available in this build`,`available: ${Object.keys($).join(", ")}`),t()}function y(l,t){let u=Number(l[t]);return Number.isFinite(u)||b("invalid-input",`--${t} must be a number (got ${JSON.stringify(l[t])})`,`pass --${t} <n>`),u}var it=new Set(["init","add","edit","next","complete","account","ceremony","decide","unblock"]);async function St(l,t){try{let[u,a]=et(l).positional;return u!==void 0&&(it.has(u)||u==="role"&&a==="add"||u==="config"&&a==="set")?await c(t,()=>tt(l,t)):await tt(l,t)}catch(u){if(u instanceof a)return {exit:1,out:{ok:false,error:u.toJSON()}};throw u}}async function tt(l,t){let{positional:u$1,flags:a$1}=et(l),[v$1,...n]=u$1,m=a$1.by??"human",d$3=new Date().toISOString();switch(v$1){case "init":{let[e]=n,o=e&&Object.hasOwn($,e)?$[e]:void 0;if(!o||!a$1.config)return {exit:2,out:{ok:false,usage:p}};try{await stat(b$3(t)),b("invalid-input",`${b$3(t)} already exists`,"delete .workflow/state.json to start over");}catch(c){if(c instanceof a||c.code!=="ENOENT")throw c}let s=await x(w.resolve(t,a$1.config)),i=a$1.roles?await x(w.resolve(t,a$1.roles)):void 0;if(i!==void 0){Array.isArray(i)||b("invalid-input",`roles file ${a$1.roles} must contain an array of role manifests`,"wrap the manifests in [ ... ]");for(let c of i)b$1(e$1,c,`roles file ${a$1.roles}`);}let r=Z(i?{methodology:o(),config:s,roles:i,by:m,now:d$3}:{methodology:o(),config:s,by:m,now:d$3});return await d(t,r.state),{exit:0,out:{ok:true,warnings:r.warnings,state:{methodology:r.state.methodology,stages:r.state.stages.map(c=>c.id),roles:Object.keys(r.state.roles)}}}}case "add":{if(!n[0])return {exit:2,out:{ok:false,usage:p}};let e$1=await e(t),o=await x(w.resolve(t,n[0]));b$1(f$2,o,`item file ${n[0]}`);let s=Y(e$1,h(e$1),{type:"item.add",by:m,payload:{item:o}},i=>v(i,o,m,d$3));return await d(t,s.state),{exit:0,out:{ok:true,warnings:s.warnings,item:u(s.state,o.id)}}}case "edit":{if(!n[0]||!n[1])return {exit:2,out:{ok:false,usage:p}};let e$1=await e(t),o=n[0],s=await x(w.resolve(t,n[1]));b$1(g$1,s,`patch file ${n[1]}`);let i=Y(e$1,h(e$1),{type:"item.edit",by:m,payload:{id:o,patch:s}},r=>w$1(r,o,s,m,d$3));return await d(t,i.state),{exit:0,out:{ok:true,warnings:i.warnings,item:u(i.state,o)}}}case "next":{let e$1=await e(t),o={now:d$3};a$1.max&&(o.max=y(a$1,"max")),a$1["fallback-tokens-per-weight"]&&(o.fallbackTokensPerWeight=y(a$1,"fallback-tokens-per-weight"));let s=c$1(e$1,h(e$1),o);for(let i of s.briefs)await f$1(t,i);return await d(t,s.state),{exit:0,out:{ok:true,reason:s.reason??null,skipped:s.skipped,briefs:s.briefs}}}case "complete":{if(!n[0]||!n[1])return {exit:2,out:{ok:false,usage:p}};let e$1=await e(t),o=await x(w.resolve(t,n[1]));b$1(h$1,o,`handoff file ${n[1]}`),o.item!==n[0]&&b("handoff-invalid",`handoff.item "${o.item}" differs from the command's item "${n[0]}"`,"make them match");let s=a$1.role??o.role,i=y(a$1,"duration-ms"),r={item:n[0],role:s,model:a$1.model??"",tokensIn:y(a$1,"tokens-in"),tokensOut:y(a$1,"tokens-out"),durationMs:i,startedAt:new Date(Date.parse(d$3)-i).toISOString(),endedAt:d$3};a$1.estimate==="true"&&(r.estimate=true);let c=d$2(e$1,h(e$1),{...o,role:s},r,d$3);return await g(t,o,c.state.events.length),await d(t,c.state),{exit:0,out:{ok:true,warnings:c.warnings,item:u(c.state,n[0])}}}case "account":{if(!n[0])return {exit:2,out:{ok:false,usage:p}};let e$1=await e(t),o={};a$1["tokens-in"]!==void 0&&(o.tokensIn=y(a$1,"tokens-in")),a$1["tokens-out"]!==void 0&&(o.tokensOut=y(a$1,"tokens-out")),a$1["duration-ms"]!==void 0&&(o.durationMs=y(a$1,"duration-ms")),a$1.model!==void 0&&(o.model=a$1.model);let s=a$1.line!==void 0?y(a$1,"line"):void 0,i=e$2(e$1,n[0],o,a$1.by??"human",d$3,s);await d(t,i);let r=d$1(i),c=r.payload.line;return {exit:0,out:{ok:true,line:i.accounting.filter(A=>A.item===n[0])[c-1],event:r}}}case "ceremony":{if(!n[0])return {exit:2,out:{ok:false,usage:p}};let e$1=await e(t),o=h(e$1),s=Object.hasOwn(o.ceremonies,n[0])?o.ceremonies[n[0]]:void 0;s||b("unknown-ceremony",`"${n[0]}" is not a ${o.name} ceremony`,`available: ${Object.keys(o.ceremonies).join(", ")}`);let i=n[1]?await x(w.resolve(t,n[1])):{},r=s(e$1,{...i,by:m,now:d$3});return await d(t,r.state),{exit:0,out:{ok:true,warnings:r.warnings,lastEvent:d$1(r.state)}}}case "config":{if(n[0]!=="set"||!n[1])return {exit:2,out:{ok:false,usage:p}};let e$1=await e(t),o=await x(w.resolve(t,n[1])),s=_(e$1,h(e$1),o,m,d$3);return await d(t,s.state),{exit:0,out:{ok:true,warnings:s.warnings,changed:d$1(s.state).payload.changed,config:s.state.config}}}case "unblock":{if(!n[0])return {exit:2,out:{ok:false,usage:p}};let e$1=n[0],o=await e(t),s=u(o,e$1).blockers.filter(O=>!O.clearedAt).map(O=>O.id);s.length===0&&b("invalid-input",`item ${e$1} has no open blocker`,"nothing to clear; check exwf board");let i=a$1.blocker!==void 0?[a$1.blocker]:s,r=a$1.note,c=Y(o,h(o),{type:"blocker.clear",by:m,payload:{id:e$1,blockers:i,note:r??null}},O=>i.reduce((A$1,ot)=>A(A$1,e$1,ot,m,d$3,r),O));return await d(t,c.state),{exit:0,out:{ok:true,warnings:c.warnings,item:u(c.state,e$1)}}}case "decide":{if(!n[0]||n[1]!=="approve"&&n[1]!=="reject")return {exit:2,out:{ok:false,usage:p}};let e$1=await e(t),o=e$1.pending.find(i=>i.id===n[0]),s=L(e$1,n[0],n[1],m,a$1.note??"",d$3,h(e$1));return await d(t,s),{exit:0,out:{ok:true,item:o?.item?u(s,o.item):null}}}case "status":{let e$1=await e(t),o=h(e$1),s={todo:0,in_progress:0,blocked:0,review:0,awaiting_human:0,done:0,dropped:0};for(let i of Object.values(e$1.items))s[i.status]+=1;return {exit:0,out:{ok:true,methodology:e$1.methodology,openIteration:R(e$1)??null,counts:s,pending:e$1.pending,openQuestions:b$2(e$1),lastEvent:d$1(e$1),report:o.report?o.report(e$1):null}}}case "board":{let e$1=await e(t);return {exit:0,out:{ok:true,columns:e$1.stages.map(s=>({stage:s.id,wipLimit:s.wipLimit??null,items:Object.values(e$1.items).filter(i=>i.stage===s.id&&i.status!=="dropped").map(i=>({id:i.id,title:i.title,status:i.status,role:i.role??null,age:i.transitions.length?Date.parse(d$3)-Date.parse(i.transitions[i.transitions.length-1].at):null}))}))}}}case "metrics":{let e$1=await e(t);return {exit:0,out:{ok:true,metrics:h(e$1).metrics(e$1)}}}case "pending":return {exit:0,out:{ok:true,pending:(await e(t)).pending}};case "lessons":return {exit:0,out:{ok:true,lessons:(await e(t)).lessons}};case "validate":{if(!n[0])return {exit:2,out:{ok:false,usage:p}};let e$1=await e(t),o=await x(w.resolve(t,n[0]));return {exit:0,out:{ok:true,violations:X(e$1,h(e$1),o)}}}case "role":{let e$2=await e(t);if(n[0]==="list")return {exit:0,out:{ok:true,roles:Object.keys(e$2.roles),detail:e$2.roles}};if(n[0]==="add"&&n[1]){let o=await x(w.resolve(t,n[1]));b$1(e$1,o,`role manifest ${n[1]}`);let s=f(e$2,o,m,d$3);return await d(t,s),{exit:0,out:{ok:true,roles:Object.keys(s.roles)}}}return {exit:2,out:{ok:false,usage:p}}}default:return {exit:2,out:{ok:false,usage:p}}}}export{p as a,et as b,St as c};//# sourceMappingURL=chunk-MQWMQ4PD.mjs.map
|
|
2
|
-
//# sourceMappingURL=chunk-MQWMQ4PD.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/commands.ts"],"names":["METHODOLOGIES","scrum","kanban","waterfall","USAGE","BOOLEAN_FLAGS","parseArgs","argv","positional","flags","i","a","key","val","fail","readJson","file","readFile","e","methodologyOf","state","f","num","v","WRITERS","runCommand","cwd","cmd","sub","withStateLock","execute","WorkflowError","rest","by","now","name","stat","statePath","config","path","roles","r","assertValid","roleSchema","res","init","saveState","s","loadState","item","newItemSchema","applyAction","addItem","getItem","id","patch","itemPatchSchema","editItem","opts","next","b","saveBrief","handoff","handoffSchema","role","durationMs","acc","complete","saveHandoff","line","s2","correctAccounting","ev","lastEvent","idx","m","c","input","changeConfig","open","blockers","note","clearBlocker","entry","p","decide","counts","openIteration","openQuestions","st","action","validateAction","manifest","registerRole"],"mappings":"+eAyCA,IAAMA,CAAAA,CAAmD,CACvD,KAAA,CAAOC,CAAAA,CACP,OAAQC,CAAAA,CACR,SAAA,CAAWC,CACb,CA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CACL,IAAA,CAAM,CAAA,CACN,GAAA,CAAK,CACH,EAAA,CAAI,IAAA,CACJ,KAAA,CAAO,MAAA,CAAO,IAAA,CAAKZ,GAAAA,CAAM,KAAK,EAC9B,MAAA,CAAQA,GAAAA,CAAM,KAChB,CACF,CAAA,CACF,GAAIY,CAAAA,CAAK,CAAC,CAAA,GAAM,KAAA,EAASA,CAAAA,CAAK,CAAC,CAAA,CAAG,CAChC,IAAM4D,CAAAA,CAAW,MAAM7E,CAAAA,CAAewB,CAAAA,CAAK,OAAA,CAAQb,CAAAA,CAAKM,CAAAA,CAAK,CAAC,CAAC,CAAC,CAAA,CAChEU,GAAAA,CAAYC,GAAAA,CAAYiD,CAAAA,CAAU,CAAA,cAAA,EAAiB5D,EAAK,CAAC,CAAC,CAAA,CAAE,CAAA,CAC5D,IAAMsC,CAAAA,CAAKuB,CAAAA,CAAazE,GAAAA,CAAOwE,CAAAA,CAAU3D,CAAAA,CAAIC,GAAG,CAAA,CAChD,OAAA,MAAMY,CAAAA,CAAUpB,CAAAA,CAAK4C,CAAE,CAAA,CAChB,CAAE,IAAA,CAAM,CAAA,CAAG,GAAA,CAAK,CAAE,EAAA,CAAI,IAAA,CAAM,KAAA,CAAO,MAAA,CAAO,IAAA,CAAKA,CAAAA,CAAG,KAAK,CAAE,CAAE,CACpE,CACA,OAAO,CAAE,IAAA,CAAM,CAAA,CAAG,GAAA,CAAK,CAAE,EAAA,CAAI,KAAA,CAAO,KAAA,CAAOlE,CAAM,CAAE,CACrD,CACA,QACE,OAAO,CAAE,IAAA,CAAM,CAAA,CAAG,GAAA,CAAK,CAAE,EAAA,CAAI,KAAA,CAAO,KAAA,CAAOA,CAAM,CAAE,CACvD,CACF","file":"chunk-MQWMQ4PD.mjs","sourcesContent":["import { readFile, stat } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport {\n loadState,\n saveBrief,\n saveHandoff,\n saveState,\n statePath,\n withStateLock,\n} from \"../adapters/file.ts\";\nimport { next as planNext, openQuestions } from \"../brief.ts\";\nimport { complete } from \"../complete.ts\";\nimport { correctAccounting, type AccountingPatch } from \"../accounting.ts\";\nimport { WorkflowError, fail } from \"../errors.ts\";\nimport { decide } from \"../gates.ts\";\nimport { addItem, clearBlocker, editItem, getItem, type ItemPatch } from \"../items.ts\";\nimport { applyAction, changeConfig, init, validateAction } from \"../methodology.ts\";\nimport { openIteration, type PlanOptions } from \"../planner.ts\";\nimport { registerRole } from \"../roles.ts\";\nimport {\n assertValid,\n handoffSchema,\n itemPatchSchema,\n newItemSchema,\n roleSchema,\n} from \"../schema/index.ts\";\nimport { lastEvent } from \"../state.ts\";\nimport { scrum } from \"../scrum/index.ts\";\nimport { kanban } from \"../kanban/index.ts\";\nimport { waterfall } from \"../waterfall/index.ts\";\nimport type {\n Accounting,\n Action,\n Handoff,\n ItemStatus,\n Methodology,\n NewItem,\n Role,\n WorkflowState,\n} from \"../types.ts\";\n\nconst METHODOLOGIES: Record<string, () => Methodology> = {\n scrum: scrum as () => Methodology,\n kanban: kanban as () => Methodology,\n waterfall: waterfall as () => Methodology,\n};\n\nexport const USAGE = [\n \"exwf init <scrum|kanban|waterfall> --config <file> [--roles <file>]\",\n \"exwf add <item.json> [--by who] exwf edit <id> <patch.json> [--by who]\",\n \"exwf next [--max n] [--fallback-tokens-per-weight n]\",\n \"exwf complete <id> <handoff.json> --tokens-in n --tokens-out n --duration-ms n --model m [--estimate] [--role r]\",\n \"exwf account <item> [--line n] [--tokens-in n] [--tokens-out n] [--duration-ms n] [--model m] [--by who]\",\n \"exwf ceremony <name> [input.json] [--by who]\",\n \"exwf decide <pendingId> approve|reject [--by who] [--note text]\",\n \"exwf config set <patch.json> [--by who] exwf unblock <item> [--blocker id] [--note text] [--by who]\",\n \"exwf status | board | metrics | pending | lessons\",\n \"exwf validate <action.json> exwf role add <manifest.json> | role list\",\n];\n\nexport interface Parsed {\n positional: string[];\n flags: Record<string, string>;\n}\n/** Flags that take no value; every other flag needs one. */\nconst BOOLEAN_FLAGS = new Set([\"estimate\"]);\n\nexport function parseArgs(argv: string[]): Parsed {\n const positional: string[] = [];\n const flags: Record<string, string> = {};\n for (let i = 0; i < argv.length; i++) {\n const a = argv[i]!;\n if (a.startsWith(\"--\")) {\n const key = a.slice(2);\n if (BOOLEAN_FLAGS.has(key)) {\n flags[key] = \"true\";\n continue;\n }\n const val = argv[i + 1];\n if (val === undefined || val.startsWith(\"--\"))\n fail(\"invalid-input\", `--${key} needs a value`, `pass --${key} <text>`);\n flags[key] = val;\n i++;\n } else positional.push(a);\n }\n return { positional, flags };\n}\n\nasync function readJson<T>(file: string): Promise<T> {\n try {\n return JSON.parse(await readFile(file, \"utf8\")) as T;\n } catch (e) {\n return fail(\n \"invalid-input\",\n `cannot read JSON from ${file}: ${(e as Error).message}`,\n \"check the path and that the file is valid JSON\",\n );\n }\n}\n\nfunction methodologyOf(state: WorkflowState): Methodology {\n const f = Object.hasOwn(METHODOLOGIES, state.methodology)\n ? METHODOLOGIES[state.methodology]\n : undefined;\n if (!f)\n fail(\n \"config-invalid\",\n `methodology \"${state.methodology}\" is not available in this build`,\n `available: ${Object.keys(METHODOLOGIES).join(\", \")}`,\n );\n return f();\n}\n\nfunction num(flags: Record<string, string>, key: string): number {\n const v = Number(flags[key]);\n if (!Number.isFinite(v))\n fail(\n \"invalid-input\",\n `--${key} must be a number (got ${JSON.stringify(flags[key])})`,\n `pass --${key} <n>`,\n );\n return v;\n}\n\nexport interface CommandResult {\n exit: 0 | 1 | 2;\n out: unknown;\n}\n\n/** Commands that load, change and save the state: they run under .workflow/state.lock. */\nconst WRITERS = new Set([\n \"init\",\n \"add\",\n \"edit\",\n \"next\",\n \"complete\",\n \"account\",\n \"ceremony\",\n \"decide\",\n \"unblock\",\n]);\n\nexport async function runCommand(argv: string[], cwd: string): Promise<CommandResult> {\n try {\n const [cmd, sub] = parseArgs(argv).positional;\n const writes =\n cmd !== undefined &&\n (WRITERS.has(cmd) ||\n (cmd === \"role\" && sub === \"add\") ||\n (cmd === \"config\" && sub === \"set\"));\n return writes ? await withStateLock(cwd, () => execute(argv, cwd)) : await execute(argv, cwd);\n } catch (e) {\n if (e instanceof WorkflowError) return { exit: 1, out: { ok: false, error: e.toJSON() } };\n throw e;\n }\n}\n\nasync function execute(argv: string[], cwd: string): Promise<CommandResult> {\n const { positional, flags } = parseArgs(argv);\n const [cmd, ...rest] = positional;\n const by = flags[\"by\"] ?? \"human\";\n const now = new Date().toISOString();\n switch (cmd) {\n case \"init\": {\n const [name] = rest;\n const f = name && Object.hasOwn(METHODOLOGIES, name) ? METHODOLOGIES[name] : undefined;\n if (!f || !flags[\"config\"]) return { exit: 2, out: { ok: false, usage: USAGE } };\n try {\n await stat(statePath(cwd));\n fail(\n \"invalid-input\",\n `${statePath(cwd)} already exists`,\n \"delete .workflow/state.json to start over\",\n );\n } catch (e) {\n if (e instanceof WorkflowError) throw e;\n if ((e as NodeJS.ErrnoException).code !== \"ENOENT\") throw e;\n }\n const config = await readJson<unknown>(path.resolve(cwd, flags[\"config\"]));\n const roles = flags[\"roles\"]\n ? await readJson<Role[]>(path.resolve(cwd, flags[\"roles\"]))\n : undefined;\n if (roles !== undefined) {\n if (!Array.isArray(roles))\n fail(\n \"invalid-input\",\n `roles file ${flags[\"roles\"]} must contain an array of role manifests`,\n \"wrap the manifests in [ ... ]\",\n );\n for (const r of roles) assertValid(roleSchema, r, `roles file ${flags[\"roles\"]}`);\n }\n const res = init(\n roles\n ? { methodology: f(), config, roles, by, now }\n : { methodology: f(), config, by, now },\n );\n await saveState(cwd, res.state);\n return {\n exit: 0,\n out: {\n ok: true,\n warnings: res.warnings,\n state: {\n methodology: res.state.methodology,\n stages: res.state.stages.map((s) => s.id),\n roles: Object.keys(res.state.roles),\n },\n },\n };\n }\n case \"add\": {\n if (!rest[0]) return { exit: 2, out: { ok: false, usage: USAGE } };\n const state = await loadState(cwd);\n const item = await readJson<NewItem>(path.resolve(cwd, rest[0]));\n assertValid(newItemSchema, item, `item file ${rest[0]}`);\n const res = applyAction(\n state,\n methodologyOf(state),\n { type: \"item.add\", by, payload: { item } },\n (s) => addItem(s, item, by, now),\n );\n await saveState(cwd, res.state);\n return {\n exit: 0,\n out: {\n ok: true,\n warnings: res.warnings,\n item: getItem(res.state, item.id),\n },\n };\n }\n case \"edit\": {\n if (!rest[0] || !rest[1]) return { exit: 2, out: { ok: false, usage: USAGE } };\n const state = await loadState(cwd);\n const id = rest[0];\n const patch = await readJson<ItemPatch>(path.resolve(cwd, rest[1]));\n assertValid(itemPatchSchema, patch, `patch file ${rest[1]}`);\n const res = applyAction(\n state,\n methodologyOf(state),\n { type: \"item.edit\", by, payload: { id, patch } },\n (s) => editItem(s, id, patch, by, now),\n );\n await saveState(cwd, res.state);\n return {\n exit: 0,\n out: { ok: true, warnings: res.warnings, item: getItem(res.state, id) },\n };\n }\n case \"next\": {\n const state = await loadState(cwd);\n const opts: PlanOptions = { now };\n if (flags[\"max\"]) opts.max = num(flags, \"max\");\n if (flags[\"fallback-tokens-per-weight\"])\n opts.fallbackTokensPerWeight = num(flags, \"fallback-tokens-per-weight\");\n const res = planNext(state, methodologyOf(state), opts);\n // briefs first: a crash then leaves an orphan brief (overwritten next dispatch), never a dispatched item without one\n for (const b of res.briefs) await saveBrief(cwd, b);\n await saveState(cwd, res.state);\n return {\n exit: 0,\n out: {\n ok: true,\n reason: res.reason ?? null,\n skipped: res.skipped,\n briefs: res.briefs,\n },\n };\n }\n case \"complete\": {\n if (!rest[0] || !rest[1]) return { exit: 2, out: { ok: false, usage: USAGE } };\n const state = await loadState(cwd);\n const handoff = await readJson<Handoff>(path.resolve(cwd, rest[1]));\n assertValid(handoffSchema, handoff, `handoff file ${rest[1]}`);\n if (handoff.item !== rest[0])\n fail(\n \"handoff-invalid\",\n `handoff.item \"${handoff.item}\" differs from the command's item \"${rest[0]}\"`,\n \"make them match\",\n );\n const role = flags[\"role\"] ?? handoff.role;\n const durationMs = num(flags, \"duration-ms\");\n const acc: Accounting = {\n item: rest[0],\n role,\n model: flags[\"model\"] ?? \"\",\n tokensIn: num(flags, \"tokens-in\"),\n tokensOut: num(flags, \"tokens-out\"),\n durationMs,\n startedAt: new Date(Date.parse(now) - durationMs).toISOString(),\n endedAt: now,\n };\n if (flags[\"estimate\"] === \"true\") acc.estimate = true;\n const res = complete(state, methodologyOf(state), { ...handoff, role }, acc, now);\n // handoff first: a retry of the same command reproduces the same seq and overwrites an orphan\n await saveHandoff(cwd, handoff, res.state.events.length);\n await saveState(cwd, res.state);\n return {\n exit: 0,\n out: {\n ok: true,\n warnings: res.warnings,\n item: getItem(res.state, rest[0]),\n },\n };\n }\n case \"account\": {\n if (!rest[0]) return { exit: 2, out: { ok: false, usage: USAGE } };\n const state = await loadState(cwd);\n const patch: AccountingPatch = {};\n if (flags[\"tokens-in\"] !== undefined) patch.tokensIn = num(flags, \"tokens-in\");\n if (flags[\"tokens-out\"] !== undefined) patch.tokensOut = num(flags, \"tokens-out\");\n if (flags[\"duration-ms\"] !== undefined) patch.durationMs = num(flags, \"duration-ms\");\n if (flags[\"model\"] !== undefined) patch.model = flags[\"model\"];\n const line = flags[\"line\"] !== undefined ? num(flags, \"line\") : undefined;\n const s2 = correctAccounting(state, rest[0], patch, flags[\"by\"] ?? \"human\", now, line);\n await saveState(cwd, s2);\n const ev = lastEvent(s2)!;\n const idx = (ev.payload as { line: number }).line;\n const mine = s2.accounting.filter((a) => a.item === rest[0]);\n return { exit: 0, out: { ok: true, line: mine[idx - 1], event: ev } };\n }\n case \"ceremony\": {\n if (!rest[0]) return { exit: 2, out: { ok: false, usage: USAGE } };\n const state = await loadState(cwd);\n const m = methodologyOf(state);\n const c = Object.hasOwn(m.ceremonies, rest[0]) ? m.ceremonies[rest[0]] : undefined;\n if (!c)\n fail(\n \"unknown-ceremony\",\n `\"${rest[0]}\" is not a ${m.name} ceremony`,\n `available: ${Object.keys(m.ceremonies).join(\", \")}`,\n );\n const input = rest[1]\n ? await readJson<Record<string, unknown>>(path.resolve(cwd, rest[1]))\n : {};\n const res = c(state, { ...input, by, now });\n await saveState(cwd, res.state);\n return {\n exit: 0,\n out: {\n ok: true,\n warnings: res.warnings,\n lastEvent: lastEvent(res.state),\n },\n };\n }\n case \"config\": {\n if (rest[0] !== \"set\" || !rest[1]) return { exit: 2, out: { ok: false, usage: USAGE } };\n const state = await loadState(cwd);\n const patch = await readJson<Record<string, unknown>>(path.resolve(cwd, rest[1]));\n const res = changeConfig(state, methodologyOf(state), patch, by, now);\n await saveState(cwd, res.state);\n return {\n exit: 0,\n out: {\n ok: true,\n warnings: res.warnings,\n changed: (lastEvent(res.state)!.payload as { changed: string[] }).changed,\n config: res.state.config,\n },\n };\n }\n case \"unblock\": {\n if (!rest[0]) return { exit: 2, out: { ok: false, usage: USAGE } };\n const id = rest[0];\n const state = await loadState(cwd);\n const open = getItem(state, id)\n .blockers.filter((b) => !b.clearedAt)\n .map((b) => b.id);\n if (open.length === 0)\n fail(\n \"invalid-input\",\n `item ${id} has no open blocker`,\n \"nothing to clear; check exwf board\",\n );\n const blockers = flags[\"blocker\"] !== undefined ? [flags[\"blocker\"]] : open;\n const note = flags[\"note\"];\n const res = applyAction(\n state,\n methodologyOf(state),\n { type: \"blocker.clear\", by, payload: { id, blockers, note: note ?? null } },\n (s) => blockers.reduce((acc, b) => clearBlocker(acc, id, b, by, now, note), s),\n );\n await saveState(cwd, res.state);\n return { exit: 0, out: { ok: true, warnings: res.warnings, item: getItem(res.state, id) } };\n }\n case \"decide\": {\n if (!rest[0] || (rest[1] !== \"approve\" && rest[1] !== \"reject\"))\n return { exit: 2, out: { ok: false, usage: USAGE } };\n const state = await loadState(cwd);\n const entry = state.pending.find((p) => p.id === rest[0]);\n const s2 = decide(\n state,\n rest[0],\n rest[1],\n by,\n flags[\"note\"] ?? \"\",\n now,\n methodologyOf(state),\n );\n await saveState(cwd, s2);\n return {\n exit: 0,\n out: { ok: true, item: entry?.item ? getItem(s2, entry.item) : null },\n };\n }\n case \"status\": {\n const state = await loadState(cwd);\n const m = methodologyOf(state);\n const counts: Record<ItemStatus, number> = {\n todo: 0,\n in_progress: 0,\n blocked: 0,\n review: 0,\n awaiting_human: 0,\n done: 0,\n dropped: 0,\n };\n for (const i of Object.values(state.items)) counts[i.status] += 1;\n return {\n exit: 0,\n out: {\n ok: true,\n methodology: state.methodology,\n openIteration: openIteration(state) ?? null,\n counts,\n pending: state.pending,\n openQuestions: openQuestions(state),\n lastEvent: lastEvent(state),\n report: m.report ? m.report(state) : null,\n },\n };\n }\n case \"board\": {\n const state = await loadState(cwd);\n const columns = state.stages.map((st) => ({\n stage: st.id,\n wipLimit: st.wipLimit ?? null,\n items: Object.values(state.items)\n .filter((i) => i.stage === st.id && i.status !== \"dropped\")\n .map((i) => ({\n id: i.id,\n title: i.title,\n status: i.status,\n role: i.role ?? null,\n age: i.transitions.length\n ? Date.parse(now) - Date.parse(i.transitions[i.transitions.length - 1]!.at)\n : null,\n })),\n }));\n return { exit: 0, out: { ok: true, columns } };\n }\n case \"metrics\": {\n const state = await loadState(cwd);\n return {\n exit: 0,\n out: { ok: true, metrics: methodologyOf(state).metrics(state) },\n };\n }\n case \"pending\":\n return {\n exit: 0,\n out: { ok: true, pending: (await loadState(cwd)).pending },\n };\n case \"lessons\":\n return {\n exit: 0,\n out: { ok: true, lessons: (await loadState(cwd)).lessons },\n };\n case \"validate\": {\n if (!rest[0]) return { exit: 2, out: { ok: false, usage: USAGE } };\n const state = await loadState(cwd);\n const action = await readJson<Action>(path.resolve(cwd, rest[0]));\n return {\n exit: 0,\n out: {\n ok: true,\n violations: validateAction(state, methodologyOf(state), action),\n },\n };\n }\n case \"role\": {\n const state = await loadState(cwd);\n if (rest[0] === \"list\")\n return {\n exit: 0,\n out: {\n ok: true,\n roles: Object.keys(state.roles),\n detail: state.roles,\n },\n };\n if (rest[0] === \"add\" && rest[1]) {\n const manifest = await readJson<Role>(path.resolve(cwd, rest[1]));\n assertValid(roleSchema, manifest, `role manifest ${rest[1]}`);\n const s2 = registerRole(state, manifest, by, now);\n await saveState(cwd, s2);\n return { exit: 0, out: { ok: true, roles: Object.keys(s2.roles) } };\n }\n return { exit: 2, out: { ok: false, usage: USAGE } };\n }\n default:\n return { exit: 2, out: { ok: false, usage: USAGE } };\n }\n}\n"]}
|
package/dist/chunk-QDMEM62U.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a,b as b$1}from'./chunk-U3OXAO67.mjs';import {R,O,o,j as j$1,u,n,c,P,Y,a as a$1,v,x,t,s,w,G,p,F as F$1,Q}from'./chunk-YBHHICTZ.mjs';import {b}from'./chunk-2FRRD6A3.mjs';import {timSort}from'exsorted';var ye=["todo","in_progress","blocked","review","awaiting_human","done","dropped"];function be(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 ae(i){let n=R(i),o=Object.fromEntries(ye.map(t=>[t,0])),r=[],g=0;for(let t of n?.committed??[]){let e=i.items[t];if(e){o[e.status]+=1,e.status!=="done"&&(g+=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},f=n?O(n.budget,n.spent):{},y=be(i),k="unknown";if(n&&y!==null&&n.budget.tokens){let t=(f.tokens??0)/n.budget.tokens;k=g<=y*t?"on-track":"at-risk";}let d=i.lessons.filter(t=>t.status==="raised").length;return {sprint:n?.id??null,goal:n?.goal??null,byStatus:o,blockers:r,spent:p,remaining:f,remainingWeight:g,raisedLessons:d,velocity:y,forecast:k}}function U(i){for(let n=i.iterations.length-1;n>=0;n--){let o=i.iterations[n];if(o.endedAt!==void 0)return o}}function F(i,n){return i.events.find(o=>o.type==="sprint.closed"&&o.payload.id===n)?.seq??Number.POSITIVE_INFINITY}function he(i){let n=new Set(U(i)?.carryover??[]),o=Object.values(i.items).filter(r=>r.stage==="backlog"&&r.status==="todo"&&r.type!=="question");return timSort([...o],(r,g)=>{let p=n.has(r.id)?1:0,f=n.has(g.id)?1:0;return p!==f?f-p:(g.priority??0)-(r.priority??0)})}function re(i,n){let o=u(i,n);(o.stage!=="backlog"||o.status!=="todo")&&b("invalid-input",`item "${n}" is not in the Product Backlog (${o.stage}/${o.status})`,"only backlog items can be committed",{items:[n]}),G(i,o,p(i,"backlog").exitPolicy,"enter the Sprint Backlog");}function se(i,n,o,r,g){let p=i;for(let f of Object.values(i.items))f.type!=="question"||f.parent===void 0||!n.includes(f.parent)||f.status==="done"||f.status==="dropped"||((f.stage!=="sprint"||f.status!=="todo")&&(p=x(p,f.id,{stage:"sprint",status:"todo"},r,g)),p=s(p,f.id,y=>({...y,iteration:o})));return p}function N(i,n){return {...i,config:{...W(i),definitionOfDone:n},stages:i.stages.map(o=>o.id==="review"?{...o,exitPolicy:n}:o)}}function ke(i,n){let o=W(i),r=[],g=[],p$1=p(i,"backlog").exitPolicy,f=0;for(let y of he(i)){let k=F$1(i,y,p$1);if(k.length>0){g.push({id:y.id,reason:"policy",detail:k.map(d=>d.message).join("; ")});continue}if(n.turns!==void 0&&r.length>=n.turns){g.push({id:y.id,reason:"budget",detail:"turns budget full"});continue}if(n.tokens!==void 0){let d=Q(i,y.weight,o.fallbackTokensPerWeight,o.estimateMode);if(f+d>n.tokens){g.push({id:y.id,reason:"budget",detail:`needs about ${d} tokens, ${n.tokens-f} left`});continue}f+=d;}r.push(y.id);}return {ids:r,skipped:g}}function K(i){let n=(t,e,s,m)=>Y(t,i(),{type:e,by:s.by,payload:s},c=>m(c,a$1(s.now)));return {refine:(t,e)=>{o(t,e.by,"define-acceptance","deliver");let s=e.items??[],m=e.split??[],c$1=e.reestimate??[];(!Array.isArray(c$1)||!c$1.every(u=>typeof u=="string"))&&b("invalid-input","refine.reestimate must be a list of item ids",'pass reestimate: ["A"]');let l=c$1;s.length===0&&m.length===0&&l.length===0&&b("invalid-input","refine needs items[], split[] or reestimate[]","pass at least one patch, split or reestimate");for(let u$1 of l){let h=u(t,u$1);(h.stage!=="backlog"||h.status!=="todo"||h.weight===void 0)&&b("invalid-input",`item "${u$1}" has no weight to confirm in the Product Backlog`,"refine it with a patch { weight } instead",{items:[u$1]});}return n(t,"ceremony.refine",e,(u$1,h)=>{for(let{id:a,patch:w$1}of s)u$1=w(u$1,a,w$1,e.by,h);for(let a of l)u$1=c(u$1,"item.reestimated",e.by,{id:a,weight:u(u$1,a).weight},h);for(let a of m){u(u$1,a.from);for(let w of a.into)u$1=v(u$1,{...w,parent:a.from},e.by,h);u$1=x(u$1,a.from,{status:"dropped"},e.by,h);}return c(u$1,"ceremony.refine",e.by,{edited:s.map(a=>a.id),split:m.map(a=>({from:a.from,into:a.into.map(w=>w.id)})),reestimated:l},h)})},plan:(t,e)=>{o(t,e.by,"facilitate");let s$1=e.goal;(typeof s$1!="string"||s$1.trim()==="")&&b("invalid-input","sprint planning needs a non-empty goal","state the Sprint Goal in one sentence");let m=W(t),c$1=e.budget??m.sprintBudget,l=e.items==="auto"?ke(t,c$1):void 0,u$1=l?.skipped??[],h=l?l.ids:e.items;Array.isArray(h)||b("invalid-input",'sprint planning needs items: string[] or "auto"','pass ["A","B"] or "auto"'),h.length===0&&b("invalid-input",`no backlog items fit the sprint${u$1.length?`; skipped: ${u$1.map(a=>`${a.id} (${a.reason}: ${a.detail})`).join(", ")}`:""}`,"refine the backlog (acceptance + estimates) or raise the budget with exwf config set");for(let a of h)re(t,a);return n(t,"ceremony.plan",e,(a,w)=>{let C=`S${a.iterations.length+1}`,M=U(a),A=h.filter(O=>M?.carryover.includes(O)),B=[];for(let O of h){let T=j(u(a,O),a);T&&B.push(O),a=x(a,O,T?{stage:T,status:"review"}:{stage:"sprint",status:"todo"},e.by,w),a=s(a,O,fe=>({...fe,iteration:C}));}a=se(a,h,C,e.by,w);let J=h.reduce((O,T)=>O+(a.items[T]?.weight??0),0);return a={...a,iterations:[...a.iterations,{id:C,goal:s$1,budget:c$1,spent:{tokens:0,turns:0,wallclockMs:0},startedAt:w,committed:[...h],carryover:A}]},c(a,"sprint.opened",e.by,{id:C,goal:s$1,committed:h,committedWeight:J,budget:c$1,skipped:u$1,resumed:B},w)})},commit:(t,e)=>{let s$1=R(t);s$1||b("invalid-input","no open sprint to commit into","run the plan ceremony first");let m=e.items;(!Array.isArray(m)||m.length===0)&&b("invalid-input","commit needs items[]",'pass ["A"]');let c$1=new Set;for(let l of m)c$1.has(l)&&b("invalid-input",`item "${l}" appears twice in items[]`,"list each item once",{items:[l]}),c$1.add(l),u(t,l),s$1.committed.includes(l)&&b("invalid-input",`item "${l}" is already committed to ${s$1.id}`,"nothing to do",{items:[l]}),re(t,l);return n(t,"ceremony.commit",e,(l,u$1)=>{let h=[];for(let a of m){let w=j(u(l,a),l);w&&h.push(a),l=x(l,a,w?{stage:w,status:"review"}:{stage:"sprint",status:"todo"},e.by,u$1),l=s(l,a,C=>({...C,iteration:s$1.id}));}return l=se(l,m,s$1.id,e.by,u$1),l={...l,iterations:l.iterations.map(a=>a.id===s$1.id?{...a,committed:[...a.committed,...m]}:a)},c(l,"sprint.committed",e.by,{id:s$1.id,items:m,goalImpact:e.goalImpact??null,resumed:h},u$1)})},uncommit:(t$1,e)=>{o(t$1,e.by,"order-backlog");let s=R(t$1);s||b("invalid-input","no open sprint","nothing to uncommit from");let m=e.items;(!Array.isArray(m)||m.length===0)&&b("invalid-input","uncommit needs items[]",'pass ["A"]');for(let c of m)u(t$1,c).status==="done"&&b("invalid-input",`item "${c}" is done`,"finished work cannot be uncommitted",{items:[c]});for(let c of m)s.committed.includes(c)||b("invalid-input",`item "${c}" is not committed to ${s.id}`,`committed: ${s.committed.join(", ")}`,{items:[c]});return n(t$1,"ceremony.uncommit",e,(c$1,l)=>{for(let u of m)c$1=x(c$1,u,{stage:"backlog",status:"todo"},e.by,l),c$1=t(c$1,u,["iteration","role"]);return c$1={...c$1,iterations:c$1.iterations.map(u=>u.id===s.id?{...u,committed:u.committed.filter(h=>!m.includes(h))}:u)},c(c$1,"sprint.uncommitted",e.by,{id:s.id,items:m,reason:e.reason??""},l)})},daily:(t,e)=>n(t,"ceremony.daily",e,(s,m)=>c(s,"daily",e.by,ae(s),m)),review:(t,e)=>{let s=R(t);s||b("invalid-input","no open sprint to review","run the plan ceremony first");let m=j$1(t,"sprint-review");e.by!=="human"&&!m.includes(e.by)&&b("gate-unmet",`"${e.by}" may not accept the Sprint Review`,`run review as "human" or as ${m.join(", ")||"a role with canApprove sprint-review"}`,{rule:"sprint-review"});let c$1=e.feedback??[];return n(t,"ceremony.review",e,(l,u)=>{for(let a of c$1)l=v(l,{...a,stage:"backlog"},e.by,u);let h=s.committed.filter(a=>l.items[a]?.status==="done");return l=c(l,"increment",e.by,{sprint:s.id,done:h,goalMet:e.goalMet===true,accepted:e.accepted===true,feedback:c$1.map(a=>a.id)},u),E(l,"review",u)})},retro:(t,e)=>{o(t,e.by,"facilitate");let s=U(t);s||b("invalid-input","no closed sprint to retrospect","close the sprint (review or cancel) first"),R(t)&&b("invalid-input","a sprint is still open","retro runs between sprints; review or cancel the open one");let m=F(t,s.id);t.events.some(u=>u.type==="retro"&&u.seq>m)&&b("invalid-input",`sprint ${s.id} already has a retrospective`,"plan the next sprint");let c$1=a(t,e,"retro"),l=e.dodChanges;return n(t,"ceremony.retro",e,(u,h)=>{let a=[],w=false,C=b$1(u,c$1,e.by,h,(M,A)=>{if(A.kind==="dod"){let B=W(M).definitionOfDone;return B.some(J=>JSON.stringify(J)===JSON.stringify(A.policy))?M:(w=true,N(M,[...B,A.policy]))}return A.kind==="backlog"?(a.push(A.item.id),v(M,{...A.item,stage:"backlog",tags:[...A.item.tags??[],"retro"]},e.by,h)):M});return u=C.state,l&&(w=true,u=N(u,l)),c(u,"retro",e.by,{sprint:s.id,adopted:C.adopted,dismissed:C.dismissed,agreements:C.agreements,retired:C.retired,dodChanged:w,backlogAdded:a},h)})},cancel:(t,e)=>{o(t,e.by,"order-backlog");let s=R(t);return s||b("invalid-input","no open sprint to cancel","nothing to do"),n(t,"ceremony.cancel",e,(m,c$1)=>(m=c(m,"sprint.cancelled",e.by,{id:s.id,reason:e.reason??""},c$1),E(m,"cancel",c$1)))}}}var ve=new Set(["never","po-only","any"]);function ce(i){let n=i??{},o=n.sprintBudget;(!o||typeof o!="object"||o.tokens===void 0&&o.turns===void 0&&o.wallclockMs===void 0)&&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()==="")&&b("config-invalid","scrum config.productGoal must be a non-empty string","state the Product Goal in one sentence"),Array.isArray(n.definitionOfDone)||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)&&b("config-invalid","scrum config.refinementSharePct must be 0..100","omit it for the default 10");let g=n.allowMidSprintAdd??"po-only";(typeof g!="string"||!ve.has(g))&&b("config-invalid",`scrum config.allowMidSprintAdd must be never | po-only | any (got ${JSON.stringify(g)})`,'use "po-only" unless you have a reason');let p=n.inProgressWipLimit;p!==void 0&&(typeof p!="number"||p<1)&&b("config-invalid","scrum config.inProgressWipLimit must be a positive number","omit it for no limit");let f=n.autoClose;f!==void 0&&typeof f!="boolean"&&b("config-invalid","scrum config.autoClose must be true or false","omit it for the default true");let y=n.estimateMode;y!==void 0&&y!=="per-weight"&&y!=="per-call"&&b("config-invalid",`scrum config.estimateMode must be per-weight | per-call (got ${JSON.stringify(y)})`,'use "per-weight" (the default) or "per-call"');let k=n.fallbackTokensPerWeight;k!==void 0&&(typeof k!="number"||!Number.isFinite(k)||k<=0)&&b("config-invalid","scrum config.fallbackTokensPerWeight must be a positive finite number","omit it for the default 20000");let d={sprintBudget:o,productGoal:n.productGoal,definitionOfDone:n.definitionOfDone,refinementSharePct:r,allowMidSprintAdd:g};return p!==void 0&&(d.inProgressWipLimit=p),f!==void 0&&(d.autoClose=f),y!==void 0&&(d.estimateMode=y),k!==void 0&&(d.fallbackTokensPerWeight=k),d}var $=(i,n)=>n===0?0:i/n;function de(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(m=>m.seq>t.seq&&e.id!==void 0&&m.payload.iteration===e.id).reduce((m,c)=>m+c.payload.delta.tokens,0);return s===0?e:{...e,spent:{...e.spent,tokens:e.spent.tokens+s}}}),r=o.filter(t=>t.reason!=="cancel"),g=r.map(t=>t.doneWeight),p=r.reduce((t,e)=>t+e.doneWeight,0),f=r.reduce((t,e)=>t+e.committedWeight,0),y=i.events.filter(t=>t.type==="increment").map(t=>t.payload),k=o.filter(t=>t.budget.tokens!==void 0),d=r.reduce((t,e)=>t+e.spent.tokens,0);return {velocity:g,meanVelocity:$(g.reduce((t,e)=>t+e,0),g.length),burndown:i.events.filter(t=>t.type==="daily").map(t=>t.payload.remainingWeight),commitmentReliability:$(p,f),sprintGoalHitRate:$(y.filter(t=>t.goalMet).length,y.length),carryoverRatio:$(o.reduce((t,e)=>t+e.carryover.length,0),o.reduce((t,e)=>t+e.done.length+e.carryover.length,0)),budgetUtilisation:$(k.reduce((t,e)=>t+e.spent.tokens,0),k.reduce((t,e)=>t+(e.budget.tokens??0),0)),costPerPoint:$(d,p),current:we(i)}}function we(i){let n=R(i),o=(n?.committed??[]).map(k=>i.items[k]).filter(k=>k!==void 0),r=k=>k.reduce((d,t)=>d+(t.weight??0),0),g=r(o),p=r(o.filter(k=>k.status==="done")),f=n?.spent.tokens??0,y=n?.budget.tokens??0;return {spentTokens:f,spentTurns:n?.spent.turns??0,budgetTokens:y,committedWeight:g,doneWeight:p,remainingWeight:g-p,costPerPoint:$(f,p),budgetUtilisation:$(f,y)}}function le(){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 I=(i,n,o,r,g)=>g?{rule:i,severity:n,item:g,message:o,fix:r}:{rule:i,severity:n,message:o,fix:r};function me(i){for(let n=i.iterations.length-1;n>=0;n--){let o=i.iterations[n];if(o.endedAt!==void 0)return o}}var H=i=>i.kind==="evidence"?`evidence:${i.evidenceKind}`:i.kind==="custom"?`custom:${i.id}`:i.kind;function ue(){return [{id:"one-open-sprint",severity:"error",check:(d,t)=>t.type==="ceremony.plan"&&R(d)?[I("one-open-sprint","error",`sprint ${R(d).id} is still open`,"review or cancel it before planning the next sprint")]:[]},{id:"retro-before-plan",severity:"error",check:(d,t)=>{if(t.type!=="ceremony.plan")return [];let e=me(d);if(!e)return [];let s=F(d,e.id);if(d.events.some(c=>c.type==="retro"&&c.seq>s))return [];let m=e.outcome==="cancelled"?"warning":"error";return [I("retro-before-plan",m,`sprint ${e.id} has no retrospective yet`,"run the retro ceremony first (lessons may be empty)")]}},{id:"sprint-budget-fixed",severity:"error",check:(d,t)=>{if(t.type!=="ceremony.plan")return [];let e=t.payload?.budget;return e===void 0||JSON.stringify(e)===JSON.stringify(W(d).sprintBudget)?[]:[I("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:(d,t)=>{let e=R(d);return t.type==="ceremony.commit"&&e?.closing?[I("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:(d,t)=>{if(t.type!=="init")return [];let e=["backlog","sprint","review"].filter(s=>!d.stages.some(m=>m.id===s));return e.length&&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:(d,t)=>{if(t.type!=="ceremony.commit")return [];let e=W(d),s=t.payload??{};return e.allowMidSprintAdd==="never"?[I("scope-protects-goal","error","mid-sprint additions are disabled",'set allowMidSprintAdd to "po-only" or wait for the next sprint')]:e.allowMidSprintAdd==="po-only"&&!n(d,t.by,"order-backlog")?[I("scope-protects-goal","error",`"${t.by}" may not add work mid-sprint`,"ask the Product Owner (order-backlog) to commit it")]:s.goalImpact!=="none"?[I("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:(d,t)=>t.type!=="ceremony.refine"||n(d,t.by,"order-backlog")?[]:((t.payload??{}).items??[]).filter(s=>s.patch.priority!==void 0).map(s=>I("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:(d,t)=>{if(t.type!=="ceremony.retro")return [];let e=t.payload??{};if(e.dodChanges===void 0)return [];if(R(d))return [I("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,m=new Set(s.map(H)),c=W(d).definitionOfDone.filter(u=>!m.has(H(u)));if(c.length===0)return [];let l=c.map(u=>H(u).replace(":"," "));return [I("dod-not-weakened","error",`retro dodChanges drops ${c.length} Definition of Done policy(ies): ${l.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:(d,t)=>{if(t.type!=="ceremony.plan")return [];let e=t.payload?.items;if(!Array.isArray(e))return [];let s=me(d);if(!s)return [];let m=F(d,s.id);return e.filter(c=>s.carryover.includes(c)&&!(d.items[c]&&j(d.items[c],d)!==void 0)&&!d.events.some(l=>l.seq>m&&l.payload.id===c&&(l.type==="item.edited"&&l.payload.changed.includes("weight")||l.type==="item.reestimated"))).map(c=>I("carryover-reestimated","error",`carried-over item "${c}" was not re-estimated after ${s.id}`,"refine it with a new weight before committing",c))}}]}function pe(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 Se={backlog:"Product Backlog",item:"Product Backlog Item",stage:"Column",iteration:"Sprint",increment:"Increment",ceremony:"Scrum Event",gate:"Sprint Review"};function W(i){return i.config}function j(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(g=>g.id===o.from.stage)?.review||o.from.status==="review"?o.from.stage:void 0:o.from.status==="review"?o.from.stage:void 0}function Pe(i,n,o){let r=i,g=u(r,n).blockers.filter(f=>!f.clearedAt);if(g.length){r=s(r,n,f=>({...f,blockers:f.blockers.map(y=>y.clearedAt?y:{...y,clearedAt:o})}));for(let f of g)r=c(r,"blocker.cleared","system",{id:n,blocker:f.id,reason:"sprint closed"},o);}for(let f of r.pending.filter(y=>y.item===n))r={...r,pending:r.pending.filter(y=>y.id!==f.id)},r=c(r,"pending.dropped","system",{id:f.id,item:n,reason:"sprint closed"},o);let p=u(r,n);return (p.stage!=="backlog"||p.status!=="todo")&&(r=x(r,n,{stage:"backlog",status:"todo"},"system",o)),t(r,n,p.type==="question"?["iteration"]:["iteration","role"])}function E(i,n,o){let r=R(i);if(!r)return i;let g=r.committed.map(e=>u(i,e)),p=g.filter(e=>e.status==="done").map(e=>e.id),f=g.filter(e=>e.status==="dropped").map(e=>e.id),y=g.filter(e=>e.status!=="done"&&e.status!=="dropped").map(e=>e.id),k=Object.values(i.items).filter(e=>e.type==="question"&&e.parent!==void 0&&y.includes(e.parent)&&e.status!=="done"&&e.status!=="dropped").map(e=>e.id),d=i;for(let e of [...y,...k])d=Pe(d,e,o);let t=e=>e.reduce((s,m)=>s+(i.items[m]?.weight??0),0);return d={...d,iterations:d.iterations.map(e=>{if(e.id!==r.id)return e;let{closing:s,...m}=e;return {...m,endedAt:o,outcome:n==="cancel"?"cancelled":"completed",carryover:y}})},c(d,"sprint.closed","system",{id:r.id,reason:n,done:p,carryover:y,carriedQuestions:k,dropped:f,doneWeight:t(p),committedWeight:t(r.committed),spent:r.spent,budget:r.budget},o)}function We(){return {name:"scrum",vocabulary:Se,validateConfig:ce,defaultStages:pe,defaultRoles:le,requiredCapabilities:["order-backlog","facilitate","deliver"],exclusiveCapabilities:["order-backlog"],plannerOptions(i){let n=W(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=R(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=R(i),r=W(i),g=o?O(o.budget,o.spent):{};return [`Sprint Goal: ${o?.goal??"(no open sprint)"}; Product Goal: ${r.productGoal}`,`Budget remaining: ${JSON.stringify(g)}; 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:K(We),rules:ue(),metrics:i=>({...de(i)}),report(i){let n=R(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 N(i,W(i).definitionOfDone)},afterComplete(i,n,o){let r=R(i);return !r||!r.closing&&!P(r.budget,r.spent)?i:!Object.values(i.items).some(p=>(p.iteration===r.id||r.committed.includes(p.id))&&p.status==="in_progress")&&W(i).autoClose!==false?E(i,"budget",o):r.closing?i:c({...i,iterations:i.iterations.map(p=>p.id===r.id?{...p,closing:true}:p)},"sprint.closing","system",{id:r.id},o)}}}export{ae as a,K as b,ce as c,de as d,le as e,ue as f,pe as g,Se as h,W as i,j,E as k,We as l};//# sourceMappingURL=chunk-QDMEM62U.mjs.map
|
|
2
|
-
//# sourceMappingURL=chunk-QDMEM62U.mjs.map
|
package/dist/chunk-U3OXAO67.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {u,E,D}from'./chunk-YBHHICTZ.mjs';import {b}from'./chunk-2FRRD6A3.mjs';var L=["policy","skill","memory","spec","review"],v={retro:"review in a fresh worker",phaseRetrospective:"qa reads the srs"},w=n=>typeof n=="object"&&n!==null&&!Array.isArray(n);function $(n,i,d){let g=i.lessons??[];(!Array.isArray(g)||!g.every(s=>w(s)&&typeof s.text=="string"&&s.text.trim()!==""&&L.includes(s.scope)))&&b("invalid-input",`${d}.lessons entries need a text and a scope`,`scope is one of: ${L.join(", ")}`);let m=g,t=["human",...Object.keys(n.roles)];for(let s of m)s.from!==void 0&&(typeof s.from!="string"||!t.includes(s.from))&&b("invalid-input",`lesson from ${JSON.stringify(s.from)} is not a role`,`from is "human" or one of the roles: ${Object.keys(n.roles).join(", ")||"(none)"}`),s.item!==void 0&&(typeof s.item!="string"&&b("invalid-input","lesson item must be an item id","name an item with addItem first"),u(n,s.item));let f=i.adopt??[],a=i.dismiss??[];(!Array.isArray(f)||!f.every(s=>w(s)&&typeof s.id=="string")||!Array.isArray(a)||!a.every(s=>typeof s=="string"))&&b("invalid-input",`${d}.adopt must be [{ id, suggestedChange? }] and dismiss a string[]`,'e.g. { "adopt": [{ "id": "L1" }], "dismiss": ["L2"] }');let p=[...f.map(s=>s.id),...a],l=p.find((s,o)=>p.indexOf(s)!==o);l!==void 0&&b("invalid-input",`lesson "${l}" is referenced more than once`,"adopt or dismiss each lesson once");for(let s of p){let o=n.lessons.find(c=>c.id===s);o||b("invalid-input",`no lesson "${s}"`,`raised lessons: ${n.lessons.filter(c=>c.status==="raised").map(c=>c.id).join(", ")||"(none)"}`),o.status!=="raised"&&b("invalid-input",`lesson "${s}" is already ${o.status}`,"only raised lessons can be adopted or dismissed");}let e=i.retire??[];return (!Array.isArray(e)||!e.every(s=>typeof s=="string")||e.some((s,o)=>e.indexOf(s)!==o))&&b("invalid-input",`${d}.retire must be a list of distinct agreement texts`,`e.g. { "retire": ["${v[d]??"review in a fresh worker"}"] }; each agreement once`),{lessons:m,adopt:f,dismiss:a,retire:e}}function x(n,i,d,g,m){let t=n,f=[],a=[],p=[],l=e=>{e&&(e.kind==="agreement"?(t=D(t,e,d,g),p.push(e.text)):m&&(t=m(t,e)??t));};for(let e of i.lessons){let s=`L${t.lessons.length+1}`,o={id:s,at:g,text:e.text,scope:e.scope,status:"adopted",from:e.from??d};e.item!==void 0&&(o.item=e.item),e.suggestedChange&&(o.suggestedChange=e.suggestedChange),t={...t,lessons:[...t.lessons,o]},f.push(s),a.push(s),l(e.suggestedChange);}for(let e of i.adopt)t={...t,lessons:t.lessons.map(s=>s.id===e.id?{...s,status:"adopted",...e.suggestedChange?{suggestedChange:e.suggestedChange}:{}}:s)},a.push(e.id),l(e.suggestedChange??t.lessons.find(s=>s.id===e.id)?.suggestedChange);for(let e of i.dismiss)t={...t,lessons:t.lessons.map(s=>s.id===e?{...s,status:"dismissed"}:s)};for(let e of i.retire)t=E(t,e,d,g);return {state:t,created:f,adopted:a,dismissed:i.dismiss,agreements:p,retired:i.retire}}export{$ as a,x as b};//# sourceMappingURL=chunk-U3OXAO67.mjs.map
|
|
2
|
-
//# sourceMappingURL=chunk-U3OXAO67.mjs.map
|
package/dist/chunk-UZQV73X7.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a,b as b$1}from'./chunk-U3OXAO67.mjs';import {p,u,o,G as G$1,Y as Y$1,a as a$1,c,s,x}from'./chunk-YBHHICTZ.mjs';import {b,c as c$1}from'./chunk-2FRRD6A3.mjs';import {timSort}from'exsorted';var P=new Set(["in_progress","blocked","awaiting_human"]),E=new Set(["todo","in_progress","blocked","review","awaiting_human"]);function se(e){let t=e.stages[0];return t||b("config-invalid","kanban board has no columns","init with at least options, a commitment column and a delivery column"),t}function K(e){let t=e.stages.find(a=>a.commitmentPoint);return t||b("config-invalid","no column is the commitment point","set commitmentPoint: true on exactly one column"),t}function ee(e){let t=e.stages.find(a=>a.deliveryPoint);return t||b("config-invalid","no column is the delivery point","set deliveryPoint: true on the last column"),t}function X(e,t){return p(e,t),e.stages.findIndex(a=>a.id===t)}function D(e,t){let a=X(e,t.stage);return a>=X(e,K(e).id)&&a<X(e,ee(e).id)}function U(e){return Object.values(e.items).filter(t=>t.classOfService==="expedite"&&P.has(t.status)&&D(e,t)).map(t=>t.id)}function _(e){for(let t=e.transitions.length-1;t>=0;t--){let a=e.transitions[t];if(a.to.stage===e.stage&&a.from.stage!==e.stage)return a.at}}var Y=["replenishment","delivery-planning","service-delivery-review","operations-review","risk-review","strategy-review"],I=["expedite","fixed-date","standard","intangible"],te=864e5;function h(e){return e.config}var Pe=[{id:"options",name:"Options",policies:[{kind:"acceptance-written"}]},{id:"ready",name:"Ready",wipLimit:4,commitmentPoint:true,policies:[{kind:"dependencies-done"}]},{id:"dev",name:"Development",wipLimit:3,policies:[{kind:"evidence",evidenceKind:"test-output"}]},{id:"review",name:"Review",wipLimit:2,review:true,policies:[{kind:"no-open-blockers"}]},{id:"done",name:"Done",deliveryPoint:true,policies:[]}],B=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function q(e,t,a,s=1){if(e!==void 0)return (typeof e!="number"||!Number.isFinite(e)||e<s)&&b("config-invalid",`kanban config.${t} must be a number >= ${s} (got ${JSON.stringify(e)})`,a),e}var Me=["acceptance-written","estimate-present","no-open-blockers","dependencies-done"],ae=e=>typeof e=="string"&&e.trim()!=="";function ce(e,t){Array.isArray(e)||b("config-invalid",`kanban config.${t} must be an array of Policy objects`,'e.g. [{ "kind": "evidence", "evidenceKind": "test-output" }]');let a=[];return e.forEach((s,m)=>{let f=`kanban config.${t}[${m}]`;B(s)&&(s.kind==="evidence"?ae(s.evidenceKind):s.kind==="custom"?ae(s.id)&&ae(s.description):typeof s.kind=="string"&&Me.includes(s.kind))||b("config-invalid",`${f} must be a Policy`,`use a Policy such as { "kind": "evidence", "evidenceKind": "test-output" }, { "kind": "custom", "id": "x", "description": "..." } or one of: ${Me.join(", ")}`),a.push(s);}),a}function Ne(e,t){B(e)||b("config-invalid",`kanban config.columns[${t}] must be an object`,'e.g. { "id": "dev", "policies": [] }'),c$1(e.id,`kanban config.columns[${t}].id`);let a=e.id;Array.isArray(e.policies)||b("config-invalid",`kanban config.columns[${t}] ("${a}") needs policies: Policy[]`,'every column states its policies explicitly, e.g. [{ "kind": "acceptance-written" }]');let s={id:a,name:typeof e.name=="string"&&e.name.trim()!==""?e.name:a,policies:ce(e.policies,`columns[${t}].policies`)},m=q(e.wipLimit,`columns[${t}].wipLimit`,"omit wipLimit for no limit");m!==void 0&&(s.wipLimit=m);for(let f of ["commitmentPoint","deliveryPoint","review"])e[f]!==void 0&&(typeof e[f]!="boolean"&&b("config-invalid",`kanban config.columns[${t}].${f} must be a boolean`,`set ${f}: true or omit it`),e[f]&&(s[f]=true));return s}function H(e){let t=e??{};t.columns!==void 0&&!Array.isArray(t.columns)&&b("config-invalid","kanban config.columns must be an array of columns","omit columns for the default board (options, ready, dev, review, done)");let a=t.columns===void 0?Pe.map(o=>({...o})):t.columns.map(Ne),s=new Set;for(let o of a)s.has(o.id)&&b("config-invalid",`duplicate column id "${o.id}"`,"give every column a unique id"),s.add(o.id);let m={},f=t.classesOfService??{};B(f)||b("config-invalid","kanban config.classesOfService must be an object keyed by class",'e.g. { "expedite": { "wipBypass": 1 } }');for(let[o,c]of Object.entries(f)){I.includes(o)||b("config-invalid",`kanban config.classesOfService.${o} is not a class of service`,`use one of: ${I.join(", ")}`),B(c)||b("config-invalid",`kanban config.classesOfService.${o} must be an object`,'e.g. { "wipBypass": 1, "sle": { "percentile": 85, "targetMs": 604800000 } }');let d={},p=q(c.wipBypass,`classesOfService.${o}.wipBypass`,"omit it for the default 1",0);if(p!==void 0&&(d.wipBypass=p),c.sle!==void 0){let g=c.sle;(!B(g)||typeof g.percentile!="number"||g.percentile<0||g.percentile>100)&&b("config-invalid",`kanban config.classesOfService.${o}.sle.percentile must be 0..100`,'e.g. { "percentile": 85, "targetMs": 604800000 }');let k=q(g.targetMs,`classesOfService.${o}.sle.targetMs`,"state the service level target in milliseconds");k===void 0&&b("config-invalid",`kanban config.classesOfService.${o}.sle.targetMs is required`,"state the service level target in milliseconds"),d.sle={percentile:g.percentile,targetMs:k};}m[o]=d;}let y=t.fairness??{};(!B(y)||y.aging!==void 0&&typeof y.aging!="boolean")&&b("config-invalid","kanban config.fairness must be { aging: boolean, maxDeferralRounds?: number }","omit it for aging on");let l=q(y.maxDeferralRounds,"fairness.maxDeferralRounds","omit it for 5 rounds"),i={aging:y.aging===void 0?true:y.aging,maxDeferralRounds:l??5},r={},n=t.cadences??{};B(n)||b("config-invalid","kanban config.cadences must be an object keyed by cadence",'e.g. { "replenishment": { "everyTurns": 10 } }');for(let[o,c]of Object.entries(n)){Y.includes(o)||b("config-invalid",`kanban config.cadences.${o} is not a cadence`,`use one of: ${Y.join(", ")}`),B(c)||b("config-invalid",`kanban config.cadences.${o} must be an object`,'e.g. { "everyTurns": 10 }');let d=q(c.everyTurns,`cadences.${o}.everyTurns`,"omit it when the cadence is run by hand");r[o]=d===void 0?{}:{everyTurns:d};}return {columns:a,classesOfService:m,fairness:i,cadences:r,throughputWindowMs:q(t.throughputWindowMs,"throughputWindowMs","omit it for one week")??7*te,maxExpedite:q(t.maxExpedite,"maxExpedite","omit it for 1")??1}}function ne(e,t){return e.events.find(s=>s.type==="item.added"&&s.payload.id===t)?.at??e.events[0].at}function ie(e,t,a){return Date.parse(a)-Date.parse(_(t)??ne(e,t.id))}function qe(e,t){return e.stages.map(a=>{let s=Object.values(e.items).filter(l=>l.stage===a.id&&l.status!=="dropped"),m=timSort(s.map(l=>({id:l.id,title:l.title,type:l.type,status:l.status,classOfService:l.classOfService??"standard",role:l.role??null,ageMs:ie(e,l,t),blocked:l.blockers.some(i=>!i.clearedAt),deadline:l.deadline??null})),(l,i)=>i.ageMs-l.ageMs||(l.id<i.id?-1:1)),f=m.filter(l=>P.has(l.status)).length,y=m.filter(l=>l.status==="todo"||l.status==="review").length;return {id:a.id,name:a.name,wipLimit:a.wipLimit??null,active:f,queued:y,overLimit:a.wipLimit!==void 0&&f>a.wipLimit,commitmentPoint:a.commitmentPoint===true,deliveryPoint:a.deliveryPoint===true,cards:m}})}var Ee=e=>`cadence.${e}`;function le(e){let t=h(e);return Y.map(a=>{let s=0,m=null;for(let l of e.events)l.type===Ee(a)&&(s=l.seq,m=l.at);let f=e.events.filter(l=>l.type==="item.completed"&&l.seq>s).length,y=t.cadences[a]?.everyTurns??null;return {cadence:a,everyTurns:y,lastAt:m,turnsSince:f,due:y!==null&&f>=y}})}var De=(e,t)=>Date.parse(t)-Date.parse(e),Ie=e=>e.transition??null;function re(e,t,a){let s=new Map,m=[],f=e[0]?.at??"1970-01-01T00:00:00.000Z",y=(i,r,n)=>{r===t&&i.committedAt===void 0&&(i.committedAt=n),r===a&&i.deliveredAt===void 0&&(i.deliveredAt=n);},l=(i,r,n)=>{i.since.status==="in_progress"&&(i.activeMs+=De(i.since.at,n)),i.since.status==="blocked"&&(i.blockedMs+=De(i.since.at,n)),i.since={status:r.status,at:n},r.stage!==i.stage&&(i.stays[i.stays.length-1].leftAt=n,i.stays.push({stage:r.stage,enteredAt:n}),y(i,r.stage,n)),i.stage=r.stage,i.status=r.status;};for(let i of e){f=i.at;let r=i.payload??{};switch(i.type){case "item.added":{let n=r.id,o=r.stage,c={id:n,type:typeof r.type=="string"?r.type:"task",stage:o,status:"todo",stays:[{stage:o,enteredAt:i.at}],classOfService:"standard",activeMs:0,blockedMs:0,since:{status:"todo",at:i.at}};y(c,o,i.at),s.set(n,c);break}case "item.transition":{let n=s.get(r.id);if(!n)break;l(n,r.to,i.at);break}case "cadence.replenishment":{let n=r.items??[];for(let o of n){let c=s.get(o.id);c&&(c.classOfService=o.classOfService,o.deadline?c.deadline=o.deadline:delete c.deadline);}break}case "blocker.raised":{m.push({item:r.id,blocker:r.blocker,raisedAt:i.at});let n=s.get(r.id),o=Ie(r);n&&o&&l(n,o.to,i.at);break}case "blocker.cleared":{let n=m.find(d=>d.item===r.id&&d.blocker===r.blocker&&d.clearedAt===void 0);n&&(n.clearedAt=i.at);let o=s.get(r.id),c=Ie(r);o&&c&&l(o,c.to,i.at);break}}}return {items:s,blockers:m,lastAt:f}}function V(e,t){if(e.length===0)return 0;let a=timSort([...e],(m,f)=>m-f),s=Math.min(a.length,Math.max(1,Math.ceil(t/100*a.length)));return a[s-1]}var G=(e,t)=>Date.parse(t)-Date.parse(e),We=(e,t)=>t===0?0:e/t;function je(e){let t=e.stages.find(s=>s.commitmentPoint)?.id??"",a=e.stages.find(s=>s.deliveryPoint)?.id??"";return {commitment:t,delivery:a,ci:e.stages.findIndex(s=>s.id===t),di:e.stages.findIndex(s=>s.id===a)}}function Le(e){let t={};for(let a of e.items.values())for(let s of a.stays)s.leftAt!==void 0&&(t[s.stage]??=[]).push(G(s.enteredAt,s.leftAt));return t}function me(e){let t=je(e);return Le(re(e.events,t.commitment,t.delivery))}function Z(e){let t=h(e),a=je(e),s=re(e.events,a.commitment,a.delivery),m=[...s.items.values()],f=e.stages.map(u=>u.id),y=new Map(f.map((u,v)=>[u,v])),l=timSort(m.filter(u=>u.type!=="question"&&u.committedAt!==void 0&&u.deliveredAt!==void 0),(u,v)=>Date.parse(u.deliveredAt)-Date.parse(v.deliveredAt)),i=l.map(u=>G(u.committedAt,u.deliveredAt)),r={};for(let[u,v]of Object.entries(Le(s)))r[u]=v.reduce((w,x)=>w+x,0)/v.length;let n=m.filter(u=>u.type!=="question"&&u.committedAt!==void 0).map(u=>Date.parse(u.committedAt)),o=[];if(n.length>0){let u=n.reduce((w,x)=>x<w?x:w,n[0]),v=Math.floor((Date.parse(s.lastAt)-u)/t.throughputWindowMs)+1;o=Array.from({length:v},()=>0);for(let w of l){let x=Math.floor((Date.parse(w.deliveredAt)-u)/t.throughputWindowMs);x>=0&&x<v&&(o[x]+=1);}}let c=Object.fromEntries(f.map(u=>[u,0])),d={};for(let u of m){if(!E.has(u.status))continue;Object.hasOwn(c,u.stage)&&(c[u.stage]+=1);let v=y.get(u.stage);v!==void 0&&v>=a.ci&&v<a.di&&(d[u.id]=G(u.stays[u.stays.length-1].enteredAt,s.lastAt));}let p=new Map;for(let u of m)for(let v of u.stays){let w=p.get(v.stage)??new Map;w.has(u.id)||w.set(u.id,v.enteredAt),p.set(v.stage,w);}let g=timSort([...new Set(e.events.map(u=>u.at.slice(0,10)))],(u,v)=>u<v?-1:u>v?1:0),k={};for(let u of g)for(let v of f)k[`${u}:${v}`]=[...p.get(v)?.values()??[]].filter(w=>w.slice(0,10)<=u).length;let M={};for(let[u,v]of Object.entries(t.classesOfService)){if(!v?.sle)continue;let w=l.filter(x=>x.classOfService===u);w.length!==0&&(M[u]=w.filter(x=>G(x.committedAt,x.deliveredAt)<=v.sle.targetMs).length/w.length);}let C=s.blockers.reduce((u,v)=>u+G(v.raisedAt,v.clearedAt??s.lastAt),0);return {leadTimeMs:i,leadTimeP50:V(i,50),leadTimeP85:V(i,85),cycleTimeMsByColumn:r,throughput:o,wipByColumn:c,flowEfficiency:We(l.reduce((u,v)=>u+v.activeMs,0),i.reduce((u,v)=>u+v,0)),agingWipMs:d,cumulativeFlow:k,sleCompliance:M,blockerTimeMs:C,meanBlockerTimeMs:We(C,s.blockers.length)}}function fe(e,t){let a=Date.parse(t),s=me(e),m=[],f=[],y=Object.fromEntries(e.stages.map(i=>[i.id,0])),l=Object.fromEntries(e.stages.map(i=>[i.id,0]));for(let i of Object.values(e.items)){for(let r of i.blockers)r.clearedAt||m.push({item:i.id,blocker:r.id,owner:r.owner,reason:r.reason,ageMs:a-Date.parse(r.raisedAt)});if(P.has(i.status)?l[i.stage]=(l[i.stage]??0)+1:(i.status==="todo"||i.status==="review")&&(y[i.stage]=(y[i.stage]??0)+1),E.has(i.status)&&D(e,i)){let r=s[i.stage]??[],n=r.length?V(r,85):null,o=ie(e,i,t);f.push({item:i.id,column:i.stage,status:i.status,ageMs:o,p85Ms:n,overP85:n!==null&&o>n});}}return {blockers:m,agingWip:timSort(f,(i,r)=>r.ageMs-i.ageMs||(i.item<r.item?-1:1)),queued:y,active:l}}function Fe(e,t){let a=K(e).id;return e.items[t].transitions.find(f=>f.to.stage===a&&f.from.stage!==a)?.at??ne(e,t)}function ue(e,t,a){let s=Date.parse(t),m=h(e),f=Z(e).leadTimeMs,y=m.classesOfService["fixed-date"]?.sle?.percentile??85,l=f.length?V(f,y):null,i=[],r=[];for(let n of Object.values(e.items)){for(let p of n.blockers){let g=p.clearedAt?0:s-Date.parse(p.raisedAt);!p.clearedAt&&g>a&&r.push({item:n.id,blocker:p.id,owner:p.owner,ageMs:g});}if(n.classOfService!=="fixed-date"||!n.deadline||!E.has(n.status)||!D(e,n))continue;let o=s-Date.parse(Fe(e,n.id)),c=l===null?null:Math.max(0,l-o),d=Date.parse(n.deadline)-s;i.push({item:n.id,deadline:n.deadline,timeLeftMs:d,projectedRemainingMs:c,atRisk:d<0||c!==null&&c>d});}return {fixedDate:i,staleBlockers:r,expediteActive:U(e)}}var F=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function pe(e,t,a){let s=t.items;(!Array.isArray(s)||s.length===0||!s.every(f=>typeof f=="string"))&&b("invalid-input",`${a} needs items: string[]`,'pass ["A", "B"]');let m=s.find((f,y)=>s.indexOf(f)!==y);m!==void 0&&b("invalid-input",`item "${m}" appears twice in items[]`,"list each item once",{items:[m]});for(let f of s)u(e,f);return s}function Je(e){return F(e)&&typeof e.percentile=="number"&&e.percentile>=0&&e.percentile<=100&&typeof e.targetMs=="number"&&Number.isFinite(e.targetMs)&&e.targetMs>0}function Ke(e,t){let{wipLimit:a,...s}=e;return t===null?s:{...s,wipLimit:t}}function ge(e){let t=(i,r,n,o)=>Y$1(i,e(),{type:r,by:n.by,payload:n},c=>o(c,a$1(n.now)));return {replenishment:(i,r)=>{o(i,r.by,"order-backlog","manage-flow");let n=pe(i,r,"replenishment"),o$1=K(i),c$1=se(i);for(let d of n)G$1(i,u(i,d),c$1.exitPolicy,`leave "${c$1.id}"`);return t(i,"ceremony.replenishment",r,(d,p)=>{for(let g of n)d=x(d,g,{stage:o$1.id,status:"todo"},r.by,p);return c(d,"cadence.replenishment",r.by,{column:o$1.id,items:n.map(g=>{let k=u(d,g);return {id:g,classOfService:k.classOfService??"standard",deadline:k.deadline??null}})},p)})},"delivery-planning":(i,r)=>{o(i,r.by,"facilitate","manage-flow");let n=pe(i,r,"delivery-planning"),o$1=ee(i),c$1=i.stages[i.stages.findIndex(d=>d.id===o$1.id)-1];for(let d of n){let p=u(i,d);p.stage!==c$1.id&&p.stage!==o$1.id&&b("invalid-input",`item "${d}" is in "${p.stage}", not ready for delivery`,`only cards in "${c$1.id}" or "${o$1.id}" can be planned for delivery`,{items:[d]});}return t(i,"ceremony.delivery-planning",r,(d,p)=>c(d,"cadence.delivery-planning",r.by,{items:n,window:typeof r.window=="string"?r.window:null,delivered:n.filter(g=>u(d,g).status==="done")},p))},"service-delivery-review":(i,r)=>{o(i,r.by,"manage-flow");let n=r.wip??{},o$1=r.policies??{},c$1=r.sle??{};(!F(n)||!F(o$1)||!F(c$1))&&b("invalid-input","service-delivery-review takes wip, policies and sle objects keyed by column or class",'e.g. { "wip": { "dev": 2 }, "policies": { "dev": [{ "kind": "no-open-blockers" }] }, "sle": { "standard": { "percentile": 85, "targetMs": 604800000 } } }');for(let[g,k]of Object.entries(n))p(i,g),k!==null&&(typeof k!="number"||!Number.isFinite(k)||k<1)&&b("invalid-input",`wip.${g} must be a positive number or null`,"null removes the limit");let d={};for(let[g,k]of Object.entries(o$1))p(i,g),d[g]=ce(k,`policies.${g}`);for(let[g,k]of Object.entries(c$1))I.includes(g)||b("invalid-input",`sle.${g} is not a class of service`,`use one of: ${I.join(", ")}`),k!==null&&!Je(k)&&b("invalid-input",`sle.${g} must be { percentile: 0..100, targetMs: > 0 } or null`,"null removes the service level");let p$1=a(i,r,"service-delivery-review");return t(i,"ceremony.service-delivery-review",r,(g,k)=>{let M=h(g),C=g.stages,u=M.columns,v={...M.classesOfService},w=[],x=[],we=[];for(let[S,O]of Object.entries(n)){let W=C.find(R=>R.id===S).wipLimit??null;W!==O&&(w.push({column:S,before:W,after:O}),C=C.map(R=>R.id===S?Ke(R,O):R),u=u.map(R=>R.id===S?Ke(R,O):R));}for(let[S,O]of Object.entries(d)){let W=C.find($=>$.id===S).exitPolicy;if(JSON.stringify(W)===JSON.stringify(O))continue;x.push({column:S,before:W,after:O});let R=C.findIndex($=>$.id===S),Q=C[R].commitmentPoint?C[R+1]?.id:void 0;C=C.map($=>$.id===S?{...$,exitPolicy:O}:$.id===Q?{...$,entryPolicy:O}:$),u=u.map($=>$.id===S?{...$,policies:O}:$);}for(let[S,O]of Object.entries(c$1)){let W=v[S]?.sle??null;if(JSON.stringify(W)===JSON.stringify(O))continue;we.push({classOfService:S,before:W,after:O});let{sle:R,...Q}=v[S]??{};v={...v,[S]:O===null?Q:{...Q,sle:O}};}g={...g,stages:C,config:{...M,columns:u,classesOfService:v}};let T=b$1(g,p$1,r.by,k);return c(T.state,"cadence.service-delivery-review",r.by,{wip:w,policies:x,sle:we,lessons:T.created,adopted:T.adopted.slice(T.created.length),dismissed:T.dismissed,agreements:T.agreements,retired:T.retired},k)})},"operations-review":(i,r)=>{o(i,r.by,"facilitate","manage-flow");let n=r.assign??[];(!Array.isArray(n)||!n.every(o=>F(o)&&typeof o.item=="string"&&typeof o.blocker=="string"))&&b("invalid-input","operations-review.assign must be [{ item, blocker, owner }]",'e.g. { "assign": [{ "item": "A", "blocker": "A-b1", "owner": "service-delivery-manager" }] }');for(let o of n){let c=u(i,o.item);c.blockers.some(d=>d.id===o.blocker&&!d.clearedAt)||b("invalid-input",`item "${o.item}" has no open blocker "${o.blocker}"`,`open blockers: ${c.blockers.filter(d=>!d.clearedAt).map(d=>d.id).join(", ")||"(none)"}`,{items:[o.item]});}return t(i,"ceremony.operations-review",r,(o,c$1)=>{for(let d of n){let p=u(o,d.item).blockers.find(g=>g.id===d.blocker).owner;o=s(o,d.item,g=>({...g,blockers:g.blockers.map(k=>k.id===d.blocker?{...k,owner:d.owner}:k)})),o=c(o,"blocker.reassigned",r.by,{id:d.item,blocker:d.blocker,from:p,to:d.owner},c$1);}return c(o,"cadence.operations-review",r.by,fe(o,c$1),c$1)})},"risk-review":(i,r)=>{o(i,r.by,"facilitate","manage-flow");let n=r.staleAfterMs??7*te;return (typeof n!="number"||!Number.isFinite(n)||n<0)&&b("invalid-input","risk-review.staleAfterMs must be a non-negative number of milliseconds","omit it for one week"),t(i,"ceremony.risk-review",r,(o,c$1)=>c(o,"cadence.risk-review",r.by,ue(o,c$1,n),c$1))},"strategy-review":(i,r)=>{o(i,r.by,"manage-flow");let n=h(i),o$1=r.classesOfService??{};F(o$1)||b("invalid-input","strategy-review.classesOfService must be an object keyed by class",'e.g. { "expedite": { "wipBypass": 2 }, "intangible": null }');let c$1={...n.classesOfService};for(let[p,g]of Object.entries(o$1))I.includes(p)||b("invalid-input",`classesOfService.${p} is not a class of service`,`use one of: ${I.join(", ")}`),g===null?delete c$1[p]:c$1[p]=g;let d=H({...n,classesOfService:c$1,maxExpedite:r.maxExpedite??n.maxExpedite});return t(i,"ceremony.strategy-review",r,(p,g)=>{let k=Object.fromEntries(I.map(M=>[M,0]));for(let M of Object.values(p.items))E.has(M.status)&&D(p,M)&&(k[M.classOfService??"standard"]+=1);return p={...p,config:{...h(p),classesOfService:d.classesOfService,maxExpedite:d.maxExpedite}},c(p,"cadence.strategy-review",r.by,{mix:k,before:{classesOfService:n.classesOfService,maxExpedite:n.maxExpedite},after:{classesOfService:d.classesOfService,maxExpedite:d.maxExpedite}},g)})}}}function ye(){return [{id:"service-request-manager",name:"Service Request Manager",modelTier:"large",capabilities:["order-backlog","define-acceptance","manage-flow","escalate"],canApprove:[],inputs:["stakeholder-requests","options"],outputs:["ordered-options","acceptance-criteria","classes-of-service"],do_not:["do not implement items yourself","do not push work past the commitment point outside replenishment"]},{id:"service-delivery-manager",name:"Service Delivery Manager",modelTier:"large",capabilities:["facilitate","manage-flow","escalate"],canApprove:[],inputs:["board","flow-metrics","blockers"],outputs:["cadence-records","wip-and-policy-changes","lessons"],do_not:["do not reorder the options","do not assign work; the planner pulls"]},{id:"worker",name:"Worker",modelTier:"small",capabilities:["deliver","review","verify"],canApprove:[],inputs:["brief"],outputs:["code","test-output"],do_not:["do not change acceptance criteria","do not pull more work while your card is open"]}]}var A=(e,t,a,s,m)=>m?{rule:e,severity:t,item:m,message:a,fix:s}:{rule:e,severity:t,message:a,fix:s},z=e=>e.payload??{},oe=e=>{let t=z(e).items;return Array.isArray(t)?t:[]},Ue=(e,t)=>Object.values(e.items).filter(a=>a.stage===t&&P.has(a.status)).length;function ve(){return [{id:"policy-explicit",severity:"error",check(l,i){let r=l.stages.find(n=>n.deliveryPoint)?.id;if(i.type==="init")return l.stages.filter(n=>n.id!==r&&n.exitPolicy.length===0).map(n=>A("policy-explicit","error",`column "${n.id}" has no explicit policy`,`give column "${n.id}" at least one policy, e.g. { "kind": "acceptance-written" }`));if(i.type==="ceremony.service-delivery-review"){let n=z(i).policies??{};return Object.entries(n).filter(([o,c])=>o!==r&&Array.isArray(c)&&c.length===0).map(([o])=>A("policy-explicit","error",`column "${o}" would be left without a policy`,"keep at least one policy per column; Kanban policies are explicit"))}return []}},{id:"commitment-point-once",severity:"error",check(l,i){if(i.type!=="init")return [];let r=[],n=l.stages.filter(c=>c.commitmentPoint),o=l.stages.filter(c=>c.deliveryPoint);if(n.length!==1&&r.push(A("commitment-point-once","error",`${n.length} columns are marked commitmentPoint (${n.map(c=>c.id).join(", ")||"none"})`,"mark exactly one column commitmentPoint: true")),o.length!==1&&r.push(A("commitment-point-once","error",`${o.length} columns are marked deliveryPoint (${o.map(c=>c.id).join(", ")||"none"})`,"mark exactly one column deliveryPoint: true")),n.length===1&&o.length===1){let c=l.stages.indexOf(n[0]),d=l.stages.indexOf(o[0]);d!==l.stages.length-1&&r.push(A("commitment-point-once","error",`delivery column "${o[0].id}" is not the last column`,"move the delivery column to the end; finished cards leave the board there")),c===0?r.push(A("commitment-point-once","error",`commitment column "${n[0].id}" is the first column`,"keep an Options column before the commitment point; replenishment pulls from it")):c>=d&&r.push(A("commitment-point-once","error",`commitment column "${n[0].id}" comes after the delivery column`,"order columns options \u2192 commitment \u2192 \u2026 \u2192 delivery"));}return r}},{id:"wip-respected",severity:"error",check(l,i){if(i.type==="ceremony.replenishment"){let r=l.stages.find(p=>p.commitmentPoint);if(!r||r.wipLimit===void 0)return [];let n=oe(i),o=Object.values(l.items).filter(p=>p.stage===r.id&&E.has(p.status)).length,c=n.some(p=>l.items[p]?.classOfService==="expedite")?h(l).classesOfService.expedite?.wipBypass??1:0,d=r.wipLimit+c;return o+n.length<=d?[]:[A("wip-respected","error",`column "${r.id}" holds ${o} card(s); pulling ${n.length} more exceeds its WIP limit of ${r.wipLimit}${c?` (+${c} expedite bypass)`:""}`,`pull at most ${Math.max(0,d-o)} card(s) now, or raise the limit in a service-delivery-review`)]}if(i.type==="ceremony.service-delivery-review"){let r=z(i).wip??{},n=[];for(let[o,c]of Object.entries(r)){if(typeof c!="number")continue;let d=Ue(l,o);d>c&&n.push(A("wip-respected","warning",`column "${o}" has ${d} active card(s), above the new limit of ${c}`,"nothing new is pulled into it until it drains; finish or move cards"));}return n}return []}},{id:"pull-not-push",severity:"error",check(l,i){if(i.type!=="ceremony.replenishment")return [];let r=l.stages[0],n=l.stages.find(d=>d.commitmentPoint);if(!r||!n)return [];let o=[],c=z(i).column;c!==void 0&&c!==n.id&&o.push(A("pull-not-push","error",`replenishment may only pull into the commitment column "${n.id}", not "${String(c)}"`,"drop column or set it to the commitment column; later columns are pulled by the planner"));for(let d of oe(i)){let p=l.items[d];p&&(p.stage!==r.id||p.status!=="todo")&&o.push(A("pull-not-push","error",`item "${d}" is ${p.status} in "${p.stage}", not an option`,`only todo cards in "${r.id}" can be pulled; cards already on the board flow by pull`,d));}return o}},{id:"blocker-has-owner",severity:"error",check(l,i){if(!i.type.startsWith("ceremony."))return [];let r=[];if(i.type==="ceremony.operations-review"){let n=z(i).assign??[];for(let o of n)(typeof o.owner!="string"||o.owner.trim()==="")&&r.push(A("blocker-has-owner","error",`blocker "${o.blocker}" on "${o.item}" would have no owner`,"name the role or person who clears it",o.item));}for(let n of Object.values(l.items))for(let o of n.blockers)!o.clearedAt&&o.owner.trim()===""&&r.push(A("blocker-has-owner","warning",`blocker "${o.id}" on "${n.id}" has no owner`,`assign one in operations-review: { "assign": [{ "item": "${n.id}", "blocker": "${o.id}", "owner": "<who>" }] }`,n.id));return r}},{id:"one-expedite",severity:"error",check(l,i){if(i.type!=="ceremony.replenishment")return [];let r=oe(i).filter(c=>l.items[c]?.classOfService==="expedite");if(r.length===0)return [];let n=Object.values(l.items).filter(c=>c.classOfService==="expedite"&&E.has(c.status)&&D(l,c)).map(c=>c.id),o=h(l).maxExpedite;return n.length+r.length<=o?[]:[A("one-expedite","error",`${n.length} expedite card(s) already on the board (${n.join(", ")||"none"}); pulling ${r.join(", ")} exceeds maxExpedite ${o}`,"deliver the current expedite first, reclassify the new card, or raise maxExpedite in a strategy-review")]}},{id:"fixed-date-needs-deadline",severity:"error",check(l,i){return i.type!=="ceremony.replenishment"?[]:oe(i).filter(r=>{let n=l.items[r];return n?.classOfService==="fixed-date"&&!(n.deadline&&Number.isFinite(Date.parse(n.deadline)))}).map(r=>A("fixed-date-needs-deadline","error",`fixed-date item "${r}" has no deadline`,`editItem("${r}", { deadline: "<ISO date>" }) before pulling it`,r))}}]}function be(e){let t=e.columns.map(m=>{let f={id:m.id,name:m.name,entryPolicy:[],exitPolicy:m.policies};return m.wipLimit!==void 0&&(f.wipLimit=m.wipLimit),m.commitmentPoint&&(f.commitmentPoint=true),m.deliveryPoint&&(f.deliveryPoint=true),m.review&&(f.review=true),f}),a=t.findIndex(m=>m.commitmentPoint),s=a>=0?t[a+1]:void 0;return s&&(s.entryPolicy=t[a].exitPolicy),t}var He={backlog:"Options",item:"Work Item",stage:"Column",iteration:"Cadence",increment:"Delivery",ceremony:"Cadence",gate:"Policy"},Ge={expedite:0,"fixed-date":1,standard:2,intangible:3},Be=e=>Ge[e.classOfService??"standard"]??2,ke=1e15,Ze=4e9,ze=(e,t,a)=>Math.min(a,Math.max(t,e));function Qe(e,t){let a=e.classOfService??"standard";if(e.type==="question")return 5*ke;if(a==="fixed-date"&&e.deadline!==void 0){let l=Date.parse(e.deadline);if(Number.isFinite(l))return 3*ke+1e10-Math.floor(l/1e3)}let s=t.aging?Math.floor(t.deferrals/t.maxDeferralRounds):0,m=ze(e.priority??0,-1e9,1e9)+s*Ze,f=t.aging&&t.deferrals>=t.maxDeferralRounds;return (a==="expedite"?4:a==="fixed-date"?3:a==="intangible"&&!f?1:2)*ke+m}function Te(e,t){let a=Be(e)-Be(t);if(a!==0)return a;let s=_(e),m=_(t),f=s===void 0?0:Date.parse(s),y=m===void 0?0:Date.parse(m);return f!==y?f-y:e.id<t.id?-1:e.id>t.id?1:0}function Xe(e){return e.map(t=>t.kind==="evidence"?`evidence ${t.evidenceKind}`:t.kind==="custom"?`${t.id}: ${t.description}`:t.kind).join(", ")||"(none)"}function et(){return {name:"kanban",vocabulary:He,validateConfig:H,defaultStages:be,defaultRoles:ye,requiredCapabilities:["manage-flow","deliver"],exclusiveCapabilities:[],plannerOptions(e){let t=h(e),a=K(e),s=e.stages[e.stages.findIndex(n=>n.id===a.id)+1],m=t.classesOfService.expedite?.wipBypass??1,f=[],y=[0],l=new Map;for(let n of e.events)f.push(Date.parse(n.at)),y.push(y[y.length-1]+(n.type==="planner.resolved"?1:0)),n.type==="item.added"&&l.set(n.payload.id,n.at);let i=n=>{let o=0,c=f.length;for(;o<c;){let d=o+c>>1;f[d]<=n?o=d+1:c=d;}return y[f.length]-y[o]},r={schedulerMode:"throughput",fairnessPolicy:t.fairness.aging?"aging":"none",deadlineStrategy:"earliest-first",dispatchStage:n=>n.stage===a.id&&s?s.id:void 0,priorityOf:n=>{let o=Date.parse(_(n)??l.get(n.id)??"");return Qe(n,{deferrals:i(Number.isFinite(o)?o:0),aging:t.fairness.aging,maxDeferralRounds:t.fairness.maxDeferralRounds})},tieBreaker:Te,wipCounts:[...P],wipLimitOf:(n,o)=>n.wipLimit===void 0?void 0:o.classOfService==="expedite"?n.wipLimit+m:n.wipLimit};return r.maxDeferralRounds=t.fairness.maxDeferralRounds,r},candidates(e){let t=Math.max(0,h(e).maxExpedite-U(e).length),a=Object.values(e.items).filter(m=>(m.status==="todo"||m.status==="review")&&D(e,m)),s=timSort(a.filter(m=>m.classOfService==="expedite"),Te).slice(0,t);return a.filter(m=>m.classOfService!=="expedite"||s.includes(m))},invariants(e,t){let a=h(e),s=e.stages.find(l=>l.id===t.stage),m=t.classOfService??"standard",f=a.classesOfService[m]?.sle,y=Object.values(e.items).filter(l=>l.stage===s.id&&P.has(l.status)).length;return [`Column "${s.name}" exit policies: ${Xe(s.exitPolicy)}`,`Class of service: ${m}${t.deadline?`; deadline ${t.deadline}`:""}${f?`; service level p${f.percentile} <= ${f.targetMs} ms`:""}`,`WIP limit of "${s.name}": ${s.wipLimit??"none"} (active now: ${y}); finish this card before pulling another`,`Do not change the scope of "${t.id}" or its acceptance criteria; raise open_questions instead`]},ceremonies:ge(et),rules:ve(),metrics:e=>({...Z(e)}),humanDefaults:{gates:"none"},lockedConfigKeys:["columns","classesOfService"],report:e=>({cadencesDue:le(e)})}}export{pe as A,ge as B,ye as C,ve as D,be as E,He as F,Qe as G,Te as H,et as I,P as a,E as b,se as c,K as d,ee as e,X as f,D as g,U as h,_ as i,Y as j,I as k,te as l,h as m,Pe as n,H as o,ne as p,ie as q,qe as r,Ee as s,le as t,re as u,V as v,me as w,Z as x,fe as y,ue as z};//# sourceMappingURL=chunk-UZQV73X7.mjs.map
|
|
2
|
-
//# sourceMappingURL=chunk-UZQV73X7.mjs.map
|
package/dist/chunk-VXH2FAKV.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkXMO2RCXB_cjs=require('./chunk-XMO2RCXB.cjs'),chunkS3BXVHO7_cjs=require('./chunk-S3BXVHO7.cjs');var L=["policy","skill","memory","spec","review"],v={retro:"review in a fresh worker",phaseRetrospective:"qa reads the srs"},w=n=>typeof n=="object"&&n!==null&&!Array.isArray(n);function $(n,i,d){let g=i.lessons??[];(!Array.isArray(g)||!g.every(s=>w(s)&&typeof s.text=="string"&&s.text.trim()!==""&&L.includes(s.scope)))&&chunkS3BXVHO7_cjs.b("invalid-input",`${d}.lessons entries need a text and a scope`,`scope is one of: ${L.join(", ")}`);let m=g,t=["human",...Object.keys(n.roles)];for(let s of m)s.from!==void 0&&(typeof s.from!="string"||!t.includes(s.from))&&chunkS3BXVHO7_cjs.b("invalid-input",`lesson from ${JSON.stringify(s.from)} is not a role`,`from is "human" or one of the roles: ${Object.keys(n.roles).join(", ")||"(none)"}`),s.item!==void 0&&(typeof s.item!="string"&&chunkS3BXVHO7_cjs.b("invalid-input","lesson item must be an item id","name an item with addItem first"),chunkXMO2RCXB_cjs.u(n,s.item));let f=i.adopt??[],a=i.dismiss??[];(!Array.isArray(f)||!f.every(s=>w(s)&&typeof s.id=="string")||!Array.isArray(a)||!a.every(s=>typeof s=="string"))&&chunkS3BXVHO7_cjs.b("invalid-input",`${d}.adopt must be [{ id, suggestedChange? }] and dismiss a string[]`,'e.g. { "adopt": [{ "id": "L1" }], "dismiss": ["L2"] }');let p=[...f.map(s=>s.id),...a],l=p.find((s,o)=>p.indexOf(s)!==o);l!==void 0&&chunkS3BXVHO7_cjs.b("invalid-input",`lesson "${l}" is referenced more than once`,"adopt or dismiss each lesson once");for(let s of p){let o=n.lessons.find(c=>c.id===s);o||chunkS3BXVHO7_cjs.b("invalid-input",`no lesson "${s}"`,`raised lessons: ${n.lessons.filter(c=>c.status==="raised").map(c=>c.id).join(", ")||"(none)"}`),o.status!=="raised"&&chunkS3BXVHO7_cjs.b("invalid-input",`lesson "${s}" is already ${o.status}`,"only raised lessons can be adopted or dismissed");}let e=i.retire??[];return (!Array.isArray(e)||!e.every(s=>typeof s=="string")||e.some((s,o)=>e.indexOf(s)!==o))&&chunkS3BXVHO7_cjs.b("invalid-input",`${d}.retire must be a list of distinct agreement texts`,`e.g. { "retire": ["${v[d]??"review in a fresh worker"}"] }; each agreement once`),{lessons:m,adopt:f,dismiss:a,retire:e}}function x(n,i,d,g,m){let t=n,f=[],a=[],p=[],l=e=>{e&&(e.kind==="agreement"?(t=chunkXMO2RCXB_cjs.D(t,e,d,g),p.push(e.text)):m&&(t=m(t,e)??t));};for(let e of i.lessons){let s=`L${t.lessons.length+1}`,o={id:s,at:g,text:e.text,scope:e.scope,status:"adopted",from:e.from??d};e.item!==void 0&&(o.item=e.item),e.suggestedChange&&(o.suggestedChange=e.suggestedChange),t={...t,lessons:[...t.lessons,o]},f.push(s),a.push(s),l(e.suggestedChange);}for(let e of i.adopt)t={...t,lessons:t.lessons.map(s=>s.id===e.id?{...s,status:"adopted",...e.suggestedChange?{suggestedChange:e.suggestedChange}:{}}:s)},a.push(e.id),l(e.suggestedChange??t.lessons.find(s=>s.id===e.id)?.suggestedChange);for(let e of i.dismiss)t={...t,lessons:t.lessons.map(s=>s.id===e?{...s,status:"dismissed"}:s)};for(let e of i.retire)t=chunkXMO2RCXB_cjs.E(t,e,d,g);return {state:t,created:f,adopted:a,dismissed:i.dismiss,agreements:p,retired:i.retire}}exports.a=$;exports.b=x;//# sourceMappingURL=chunk-VXH2FAKV.cjs.map
|
|
2
|
-
//# sourceMappingURL=chunk-VXH2FAKV.cjs.map
|