ex-workflow 0.2.0-stage → 0.4.0-stage

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/CHANGELOG.md +20 -1
  2. package/README.md +54 -12
  3. package/dist/adapters/index.cjs +1 -1
  4. package/dist/adapters/index.mjs +1 -1
  5. package/dist/chunk-36M6OVUJ.mjs +2 -0
  6. package/dist/chunk-36M6OVUJ.mjs.map +1 -0
  7. package/dist/{chunk-472WEDPJ.cjs → chunk-7KF5K3L7.cjs} +2 -2
  8. package/dist/{chunk-472WEDPJ.cjs.map → chunk-7KF5K3L7.cjs.map} +1 -1
  9. package/dist/chunk-CWBH7H52.cjs +2 -0
  10. package/dist/chunk-CWBH7H52.cjs.map +1 -0
  11. package/dist/chunk-DXC2RSN5.cjs +3 -0
  12. package/dist/chunk-DXC2RSN5.cjs.map +1 -0
  13. package/dist/{chunk-XSXHEEJX.mjs → chunk-GATJZYTB.mjs} +2 -2
  14. package/dist/{chunk-XSXHEEJX.mjs.map → chunk-GATJZYTB.mjs.map} +1 -1
  15. package/dist/chunk-GFH2FEZH.mjs +2 -0
  16. package/dist/chunk-GFH2FEZH.mjs.map +1 -0
  17. package/dist/{chunk-DBR24RTX.cjs → chunk-HHC5EZ54.cjs} +2 -2
  18. package/dist/{chunk-DBR24RTX.cjs.map → chunk-HHC5EZ54.cjs.map} +1 -1
  19. package/dist/chunk-KSKEFYY7.cjs +2 -0
  20. package/dist/chunk-KSKEFYY7.cjs.map +1 -0
  21. package/dist/chunk-KUUIAKEJ.cjs +2 -0
  22. package/dist/chunk-KUUIAKEJ.cjs.map +1 -0
  23. package/dist/{chunk-IBRC36PE.mjs → chunk-L2ZN6HEL.mjs} +2 -2
  24. package/dist/{chunk-IBRC36PE.mjs.map → chunk-L2ZN6HEL.mjs.map} +1 -1
  25. package/dist/chunk-NDORREWR.mjs +2 -0
  26. package/dist/chunk-NDORREWR.mjs.map +1 -0
  27. package/dist/{chunk-VN2UYV2O.mjs → chunk-NZ2DIDOD.mjs} +2 -2
  28. package/dist/{chunk-VN2UYV2O.mjs.map → chunk-NZ2DIDOD.mjs.map} +1 -1
  29. package/dist/chunk-OHSQ52DW.mjs +6 -0
  30. package/dist/chunk-OHSQ52DW.mjs.map +1 -0
  31. package/dist/chunk-RSKZVOYC.cjs +6 -0
  32. package/dist/chunk-RSKZVOYC.cjs.map +1 -0
  33. package/dist/chunk-S22CPYXJ.mjs +3 -0
  34. package/dist/chunk-S22CPYXJ.mjs.map +1 -0
  35. package/dist/chunk-SHAPFMVP.mjs +2 -0
  36. package/dist/chunk-SHAPFMVP.mjs.map +1 -0
  37. package/dist/chunk-SJRRQZ3R.cjs +2 -0
  38. package/dist/chunk-SJRRQZ3R.cjs.map +1 -0
  39. package/dist/{chunk-D4HNETUL.cjs → chunk-UM5X2JHB.cjs} +2 -2
  40. package/dist/{chunk-D4HNETUL.cjs.map → chunk-UM5X2JHB.cjs.map} +1 -1
  41. package/dist/cli/bin.cjs +1 -1
  42. package/dist/cli/bin.cjs.map +1 -1
  43. package/dist/cli/bin.mjs +1 -1
  44. package/dist/cli/bin.mjs.map +1 -1
  45. package/dist/cli/index.cjs +1 -1
  46. package/dist/cli/index.mjs +1 -1
  47. package/dist/index.cjs +1 -1
  48. package/dist/index.cjs.map +1 -1
  49. package/dist/index.d.cts +8 -8
  50. package/dist/index.d.ts +8 -8
  51. package/dist/index.mjs +1 -1
  52. package/dist/index.mjs.map +1 -1
  53. package/dist/kanban/index.cjs +1 -1
  54. package/dist/kanban/index.mjs +1 -1
  55. package/dist/schema/index.cjs +2 -0
  56. package/dist/schema/index.cjs.map +1 -0
  57. package/dist/schema/index.d.cts +57 -0
  58. package/dist/schema/index.d.ts +57 -0
  59. package/dist/schema/index.mjs +2 -0
  60. package/dist/schema/index.mjs.map +1 -0
  61. package/dist/scrum/index.cjs +1 -1
  62. package/dist/scrum/index.mjs +1 -1
  63. package/dist/types.d.cts +38 -2
  64. package/dist/types.d.ts +38 -2
  65. package/dist/waterfall/index.cjs +2 -0
  66. package/dist/waterfall/index.cjs.map +1 -0
  67. package/dist/waterfall/index.d.cts +148 -0
  68. package/dist/waterfall/index.d.ts +148 -0
  69. package/dist/waterfall/index.mjs +2 -0
  70. package/dist/waterfall/index.mjs.map +1 -0
  71. package/package.json +31 -2
  72. package/dist/chunk-6R3YFUUV.cjs +0 -6
  73. package/dist/chunk-6R3YFUUV.cjs.map +0 -1
  74. package/dist/chunk-JDVE7DQR.cjs +0 -2
  75. package/dist/chunk-JDVE7DQR.cjs.map +0 -1
  76. package/dist/chunk-NQU5TH3A.mjs +0 -2
  77. package/dist/chunk-NQU5TH3A.mjs.map +0 -1
  78. package/dist/chunk-NRAPI3GV.cjs +0 -2
  79. package/dist/chunk-NRAPI3GV.cjs.map +0 -1
  80. package/dist/chunk-PD5FBDN7.mjs +0 -2
  81. package/dist/chunk-PD5FBDN7.mjs.map +0 -1
  82. package/dist/chunk-QDT35LXB.cjs +0 -2
  83. package/dist/chunk-QDT35LXB.cjs.map +0 -1
  84. package/dist/chunk-VGD4V5BA.mjs +0 -6
  85. package/dist/chunk-VGD4V5BA.mjs.map +0 -1
  86. package/dist/chunk-YJNDBKIG.mjs +0 -2
  87. package/dist/chunk-YJNDBKIG.mjs.map +0 -1
@@ -0,0 +1 @@
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","waterfall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,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-DXC2RSN5.cjs","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 },\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 },\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 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 },\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 },\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"]}
@@ -1,2 +1,2 @@
1
- import {p,u,o,E as E$1,M as M$1,a,c,s,x as x$1}from'./chunk-NQU5TH3A.mjs';import {b,c as c$1}from'./chunk-2FRRD6A3.mjs';import {timSort}from'exsorted';var M=new Set(["in_progress","blocked","awaiting_human"]),P=new Set(["todo","in_progress","blocked","review","awaiting_human"]);function oe(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 B(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 X(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 Q(e,t){return p(e,t),e.stages.findIndex(a=>a.id===t)}function E(e,t){let a=Q(e,t.stage);return a>=Q(e,B(e).id)&&a<Q(e,X(e).id)}function J(e){return Object.values(e.items).filter(t=>t.classOfService==="expedite"&&M.has(t.status)&&E(e,t)).map(t=>t.id)}function N(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 U=["replenishment","delivery-planning","service-delivery-review","operations-review","risk-review","strategy-review"],D=["expedite","fixed-date","standard","intangible"],ee=864e5;function x(e){return e.config}var Ce=[{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:[]}],K=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function _(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 Ae=["acceptance-written","estimate-present","no-open-blockers","dependencies-done"],se=e=>typeof e=="string"&&e.trim()!=="";function ae(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 u=`kanban config.${t}[${m}]`;K(s)&&(s.kind==="evidence"?se(s.evidenceKind):s.kind==="custom"?se(s.id)&&se(s.description):typeof s.kind=="string"&&Ae.includes(s.kind))||b("config-invalid",`${u} must be a Policy`,`use a Policy such as { "kind": "evidence", "evidenceKind": "test-output" }, { "kind": "custom", "id": "x", "description": "..." } or one of: ${Ae.join(", ")}`),a.push(s);}),a}function Le(e,t){K(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:ae(e.policies,`columns[${t}].policies`)},m=_(e.wipLimit,`columns[${t}].wipLimit`,"omit wipLimit for no limit");m!==void 0&&(s.wipLimit=m);for(let u of ["commitmentPoint","deliveryPoint","review"])e[u]!==void 0&&(typeof e[u]!="boolean"&&b("config-invalid",`kanban config.columns[${t}].${u} must be a boolean`,`set ${u}: true or omit it`),e[u]&&(s[u]=true));return s}function Y(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?Ce.map(r=>({...r})):t.columns.map(Le),s=new Set;for(let r of a)s.has(r.id)&&b("config-invalid",`duplicate column id "${r.id}"`,"give every column a unique id"),s.add(r.id);let m={},u=t.classesOfService??{};K(u)||b("config-invalid","kanban config.classesOfService must be an object keyed by class",'e.g. { "expedite": { "wipBypass": 1 } }');for(let[r,c]of Object.entries(u)){D.includes(r)||b("config-invalid",`kanban config.classesOfService.${r} is not a class of service`,`use one of: ${D.join(", ")}`),K(c)||b("config-invalid",`kanban config.classesOfService.${r} must be an object`,'e.g. { "wipBypass": 1, "sle": { "percentile": 85, "targetMs": 604800000 } }');let d={},f=_(c.wipBypass,`classesOfService.${r}.wipBypass`,"omit it for the default 1",0);if(f!==void 0&&(d.wipBypass=f),c.sle!==void 0){let y=c.sle;(!K(y)||typeof y.percentile!="number"||y.percentile<0||y.percentile>100)&&b("config-invalid",`kanban config.classesOfService.${r}.sle.percentile must be 0..100`,'e.g. { "percentile": 85, "targetMs": 604800000 }');let k=_(y.targetMs,`classesOfService.${r}.sle.targetMs`,"state the service level target in milliseconds");k===void 0&&b("config-invalid",`kanban config.classesOfService.${r}.sle.targetMs is required`,"state the service level target in milliseconds"),d.sle={percentile:y.percentile,targetMs:k};}m[r]=d;}let g=t.fairness??{};(!K(g)||g.aging!==void 0&&typeof g.aging!="boolean")&&b("config-invalid","kanban config.fairness must be { aging: boolean, maxDeferralRounds?: number }","omit it for aging on");let l=_(g.maxDeferralRounds,"fairness.maxDeferralRounds","omit it for 5 rounds"),i={aging:g.aging===void 0?true:g.aging,maxDeferralRounds:l??5},o={},n=t.cadences??{};K(n)||b("config-invalid","kanban config.cadences must be an object keyed by cadence",'e.g. { "replenishment": { "everyTurns": 10 } }');for(let[r,c]of Object.entries(n)){U.includes(r)||b("config-invalid",`kanban config.cadences.${r} is not a cadence`,`use one of: ${U.join(", ")}`),K(c)||b("config-invalid",`kanban config.cadences.${r} must be an object`,'e.g. { "everyTurns": 10 }');let d=_(c.everyTurns,`cadences.${r}.everyTurns`,"omit it when the cadence is run by hand");o[r]=d===void 0?{}:{everyTurns:d};}return {columns:a,classesOfService:m,fairness:i,cadences:o,throughputWindowMs:_(t.throughputWindowMs,"throughputWindowMs","omit it for one week")??7*ee,maxExpedite:_(t.maxExpedite,"maxExpedite","omit it for 1")??1}}function te(e,t){return e.events.find(s=>s.type==="item.added"&&s.payload.id===t)?.at??e.events[0].at}function ne(e,t,a){return Date.parse(a)-Date.parse(N(t)??te(e,t.id))}function Ke(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:ne(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)),u=m.filter(l=>M.has(l.status)).length,g=m.filter(l=>l.status==="todo"||l.status==="review").length;return {id:a.id,name:a.name,wipLimit:a.wipLimit??null,active:u,queued:g,overLimit:a.wipLimit!==void 0&&u>a.wipLimit,commitmentPoint:a.commitmentPoint===true,deliveryPoint:a.deliveryPoint===true,cards:m}})}var Re=e=>`cadence.${e}`;function ce(e){let t=x(e);return U.map(a=>{let s=0,m=null;for(let l of e.events)l.type===Re(a)&&(s=l.seq,m=l.at);let u=e.events.filter(l=>l.type==="item.completed"&&l.seq>s).length,g=t.cadences[a]?.everyTurns??null;return {cadence:a,everyTurns:g,lastAt:m,turnsSince:u,due:g!==null&&u>=g}})}var $e=(e,t)=>Date.parse(t)-Date.parse(e),Me=e=>e.transition??null;function ie(e,t,a){let s=new Map,m=[],u=e[0]?.at??"1970-01-01T00:00:00.000Z",g=(i,o,n)=>{o===t&&i.committedAt===void 0&&(i.committedAt=n),o===a&&i.deliveredAt===void 0&&(i.deliveredAt=n);},l=(i,o,n)=>{i.since.status==="in_progress"&&(i.activeMs+=$e(i.since.at,n)),i.since.status==="blocked"&&(i.blockedMs+=$e(i.since.at,n)),i.since={status:o.status,at:n},o.stage!==i.stage&&(i.stays[i.stays.length-1].leftAt=n,i.stays.push({stage:o.stage,enteredAt:n}),g(i,o.stage,n)),i.stage=o.stage,i.status=o.status;};for(let i of e){u=i.at;let o=i.payload??{};switch(i.type){case "item.added":{let n=o.id,r=o.stage,c={id:n,type:typeof o.type=="string"?o.type:"task",stage:r,status:"todo",stays:[{stage:r,enteredAt:i.at}],classOfService:"standard",activeMs:0,blockedMs:0,since:{status:"todo",at:i.at}};g(c,r,i.at),s.set(n,c);break}case "item.transition":{let n=s.get(o.id);if(!n)break;l(n,o.to,i.at);break}case "cadence.replenishment":{let n=o.items??[];for(let r of n){let c=s.get(r.id);c&&(c.classOfService=r.classOfService,r.deadline?c.deadline=r.deadline:delete c.deadline);}break}case "blocker.raised":{m.push({item:o.id,blocker:o.blocker,raisedAt:i.at});let n=s.get(o.id),r=Me(o);n&&r&&l(n,r.to,i.at);break}case "blocker.cleared":{let n=m.find(d=>d.item===o.id&&d.blocker===o.blocker&&d.clearedAt===void 0);n&&(n.clearedAt=i.at);let r=s.get(o.id),c=Me(o);r&&c&&l(r,c.to,i.at);break}}}return {items:s,blockers:m,lastAt:u}}function q(e,t){if(e.length===0)return 0;let a=timSort([...e],(m,u)=>m-u),s=Math.min(a.length,Math.max(1,Math.ceil(t/100*a.length)));return a[s-1]}var H=(e,t)=>Date.parse(t)-Date.parse(e),Pe=(e,t)=>t===0?0:e/t;function Ee(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 De(e){let t={};for(let a of e.items.values())for(let s of a.stays)s.leftAt!==void 0&&(t[s.stage]??=[]).push(H(s.enteredAt,s.leftAt));return t}function de(e){let t=Ee(e);return De(ie(e.events,t.commitment,t.delivery))}function G(e){let t=x(e),a=Ee(e),s=ie(e.events,a.commitment,a.delivery),m=[...s.items.values()],u=e.stages.map(p=>p.id),g=new Map(u.map((p,b)=>[p,b])),l=timSort(m.filter(p=>p.type!=="question"&&p.committedAt!==void 0&&p.deliveredAt!==void 0),(p,b)=>Date.parse(p.deliveredAt)-Date.parse(b.deliveredAt)),i=l.map(p=>H(p.committedAt,p.deliveredAt)),o={};for(let[p,b]of Object.entries(De(s)))o[p]=b.reduce((h,S)=>h+S,0)/b.length;let n=m.filter(p=>p.type!=="question"&&p.committedAt!==void 0).map(p=>Date.parse(p.committedAt)),r=[];if(n.length>0){let p=n.reduce((h,S)=>S<h?S:h,n[0]),b=Math.floor((Date.parse(s.lastAt)-p)/t.throughputWindowMs)+1;r=Array.from({length:b},()=>0);for(let h of l){let S=Math.floor((Date.parse(h.deliveredAt)-p)/t.throughputWindowMs);S>=0&&S<b&&(r[S]+=1);}}let c=Object.fromEntries(u.map(p=>[p,0])),d={};for(let p of m){if(!P.has(p.status))continue;Object.hasOwn(c,p.stage)&&(c[p.stage]+=1);let b=g.get(p.stage);b!==void 0&&b>=a.ci&&b<a.di&&(d[p.id]=H(p.stays[p.stays.length-1].enteredAt,s.lastAt));}let f=new Map;for(let p of m)for(let b of p.stays){let h=f.get(b.stage)??new Map;h.has(p.id)||h.set(p.id,b.enteredAt),f.set(b.stage,h);}let y=timSort([...new Set(e.events.map(p=>p.at.slice(0,10)))],(p,b)=>p<b?-1:p>b?1:0),k={};for(let p of y)for(let b of u)k[`${p}:${b}`]=[...f.get(b)?.values()??[]].filter(h=>h.slice(0,10)<=p).length;let w={};for(let[p,b]of Object.entries(t.classesOfService)){if(!b?.sle)continue;let h=l.filter(S=>S.classOfService===p);h.length!==0&&(w[p]=h.filter(S=>H(S.committedAt,S.deliveredAt)<=b.sle.targetMs).length/h.length);}let I=s.blockers.reduce((p,b)=>p+H(b.raisedAt,b.clearedAt??s.lastAt),0);return {leadTimeMs:i,leadTimeP50:q(i,50),leadTimeP85:q(i,85),cycleTimeMsByColumn:o,throughput:r,wipByColumn:c,flowEfficiency:Pe(l.reduce((p,b)=>p+b.activeMs,0),i.reduce((p,b)=>p+b,0)),agingWipMs:d,cumulativeFlow:k,sleCompliance:w,blockerTimeMs:I,meanBlockerTimeMs:Pe(I,s.blockers.length)}}function me(e,t){let a=Date.parse(t),s=de(e),m=[],u=[],g=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 o of i.blockers)o.clearedAt||m.push({item:i.id,blocker:o.id,owner:o.owner,reason:o.reason,ageMs:a-Date.parse(o.raisedAt)});if(M.has(i.status)?l[i.stage]=(l[i.stage]??0)+1:(i.status==="todo"||i.status==="review")&&(g[i.stage]=(g[i.stage]??0)+1),P.has(i.status)&&E(e,i)){let o=s[i.stage]??[],n=o.length?q(o,85):null,r=ne(e,i,t);u.push({item:i.id,column:i.stage,status:i.status,ageMs:r,p85Ms:n,overP85:n!==null&&r>n});}}return {blockers:m,agingWip:timSort(u,(i,o)=>o.ageMs-i.ageMs||(i.item<o.item?-1:1)),queued:g,active:l}}function Ne(e,t){let a=B(e).id;return e.items[t].transitions.find(u=>u.to.stage===a&&u.from.stage!==a)?.at??te(e,t)}function fe(e,t,a){let s=Date.parse(t),m=x(e),u=G(e).leadTimeMs,g=m.classesOfService["fixed-date"]?.sle?.percentile??85,l=u.length?q(u,g):null,i=[],o=[];for(let n of Object.values(e.items)){for(let f of n.blockers){let y=f.clearedAt?0:s-Date.parse(f.raisedAt);!f.clearedAt&&y>a&&o.push({item:n.id,blocker:f.id,owner:f.owner,ageMs:y});}if(n.classOfService!=="fixed-date"||!n.deadline||!P.has(n.status)||!E(e,n))continue;let r=s-Date.parse(Ne(e,n.id)),c=l===null?null:Math.max(0,l-r),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:o,expediteActive:J(e)}}var V=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function ue(e,t,a){let s=t.items;(!Array.isArray(s)||s.length===0||!s.every(u=>typeof u=="string"))&&b("invalid-input",`${a} needs items: string[]`,'pass ["A", "B"]');let m=s.find((u,g)=>s.indexOf(u)!==g);m!==void 0&&b("invalid-input",`item "${m}" appears twice in items[]`,"list each item once",{items:[m]});for(let u$1 of s)u(e,u$1);return s}function _e(e){return V(e)&&typeof e.percentile=="number"&&e.percentile>=0&&e.percentile<=100&&typeof e.targetMs=="number"&&Number.isFinite(e.targetMs)&&e.targetMs>0}function Ie(e,t){let{wipLimit:a,...s}=e;return t===null?s:{...s,wipLimit:t}}function pe(e){let t=(i,o,n,r)=>M$1(i,e(),{type:o,by:n.by,payload:n},c=>r(c,a(n.now)));return {replenishment:(i,o$1)=>{o(i,o$1.by,"order-backlog","manage-flow");let n=ue(i,o$1,"replenishment"),r=B(i),c$1=oe(i);for(let d of n)E$1(i,u(i,d),c$1.exitPolicy,`leave "${c$1.id}"`);return t(i,"ceremony.replenishment",o$1,(d,f)=>{for(let y of n)d=x$1(d,y,{stage:r.id,status:"todo"},o$1.by,f);return c(d,"cadence.replenishment",o$1.by,{column:r.id,items:n.map(y=>{let k=u(d,y);return {id:y,classOfService:k.classOfService??"standard",deadline:k.deadline??null}})},f)})},"delivery-planning":(i,o$1)=>{o(i,o$1.by,"facilitate","manage-flow");let n=ue(i,o$1,"delivery-planning"),r=X(i),c$1=i.stages[i.stages.findIndex(d=>d.id===r.id)-1];for(let d of n){let f=u(i,d);f.stage!==c$1.id&&f.stage!==r.id&&b("invalid-input",`item "${d}" is in "${f.stage}", not ready for delivery`,`only cards in "${c$1.id}" or "${r.id}" can be planned for delivery`,{items:[d]});}return t(i,"ceremony.delivery-planning",o$1,(d,f)=>c(d,"cadence.delivery-planning",o$1.by,{items:n,window:typeof o$1.window=="string"?o$1.window:null,delivered:n.filter(y=>u(d,y).status==="done")},f))},"service-delivery-review":(i,o$1)=>{o(i,o$1.by,"manage-flow");let n=o$1.wip??{},r=o$1.policies??{},c$1=o$1.sle??{};(!V(n)||!V(r)||!V(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[f,y]of Object.entries(n))p(i,f),y!==null&&(typeof y!="number"||!Number.isFinite(y)||y<1)&&b("invalid-input",`wip.${f} must be a positive number or null`,"null removes the limit");let d={};for(let[f,y]of Object.entries(r))p(i,f),d[f]=ae(y,`policies.${f}`);for(let[f,y]of Object.entries(c$1))D.includes(f)||b("invalid-input",`sle.${f} is not a class of service`,`use one of: ${D.join(", ")}`),y!==null&&!_e(y)&&b("invalid-input",`sle.${f} must be { percentile: 0..100, targetMs: > 0 } or null`,"null removes the service level");return t(i,"ceremony.service-delivery-review",o$1,(f,y)=>{let k=x(f),w=f.stages,I=k.columns,p={...k.classesOfService},b=[],h=[],S=[];for(let[O,A]of Object.entries(n)){let W=w.find(R=>R.id===O).wipLimit??null;W!==A&&(b.push({column:O,before:W,after:A}),w=w.map(R=>R.id===O?Ie(R,A):R),I=I.map(R=>R.id===O?Ie(R,A):R));}for(let[O,A]of Object.entries(d)){let W=w.find($=>$.id===O).exitPolicy;if(JSON.stringify(W)===JSON.stringify(A))continue;h.push({column:O,before:W,after:A});let R=w.findIndex($=>$.id===O),z=w[R].commitmentPoint?w[R+1]?.id:void 0;w=w.map($=>$.id===O?{...$,exitPolicy:A}:$.id===z?{...$,entryPolicy:A}:$),I=I.map($=>$.id===O?{...$,policies:A}:$);}for(let[O,A]of Object.entries(c$1)){let W=p[O]?.sle??null;if(JSON.stringify(W)===JSON.stringify(A))continue;S.push({classOfService:O,before:W,after:A});let{sle:R,...z}=p[O]??{};p={...p,[O]:A===null?z:{...z,sle:A}};}return f={...f,stages:w,config:{...k,columns:I,classesOfService:p}},c(f,"cadence.service-delivery-review",o$1.by,{wip:b,policies:h,sle:S},y)})},"operations-review":(i,o$1)=>{o(i,o$1.by,"facilitate","manage-flow");let n=o$1.assign??[];(!Array.isArray(n)||!n.every(r=>V(r)&&typeof r.item=="string"&&typeof r.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 r of n){let c=u(i,r.item);c.blockers.some(d=>d.id===r.blocker&&!d.clearedAt)||b("invalid-input",`item "${r.item}" has no open blocker "${r.blocker}"`,`open blockers: ${c.blockers.filter(d=>!d.clearedAt).map(d=>d.id).join(", ")||"(none)"}`,{items:[r.item]});}return t(i,"ceremony.operations-review",o$1,(r,c$1)=>{for(let d of n){let f=u(r,d.item).blockers.find(y=>y.id===d.blocker).owner;r=s(r,d.item,y=>({...y,blockers:y.blockers.map(k=>k.id===d.blocker?{...k,owner:d.owner}:k)})),r=c(r,"blocker.reassigned",o$1.by,{id:d.item,blocker:d.blocker,from:f,to:d.owner},c$1);}return c(r,"cadence.operations-review",o$1.by,me(r,c$1),c$1)})},"risk-review":(i,o$1)=>{o(i,o$1.by,"facilitate","manage-flow");let n=o$1.staleAfterMs??7*ee;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",o$1,(r,c$1)=>c(r,"cadence.risk-review",o$1.by,fe(r,c$1,n),c$1))},"strategy-review":(i,o$1)=>{o(i,o$1.by,"manage-flow");let n=x(i),r=o$1.classesOfService??{};V(r)||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[f,y]of Object.entries(r))D.includes(f)||b("invalid-input",`classesOfService.${f} is not a class of service`,`use one of: ${D.join(", ")}`),y===null?delete c$1[f]:c$1[f]=y;let d=Y({...n,classesOfService:c$1,maxExpedite:o$1.maxExpedite??n.maxExpedite});return t(i,"ceremony.strategy-review",o$1,(f,y)=>{let k=Object.fromEntries(D.map(w=>[w,0]));for(let w of Object.values(f.items))P.has(w.status)&&E(f,w)&&(k[w.classOfService??"standard"]+=1);return f={...f,config:{...x(f),classesOfService:d.classesOfService,maxExpedite:d.maxExpedite}},c(f,"cadence.strategy-review",o$1.by,{mix:k,before:{classesOfService:n.classesOfService,maxExpedite:n.maxExpedite},after:{classesOfService:d.classesOfService,maxExpedite:d.maxExpedite}},y)})}}}function ge(){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 C=(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??{},re=e=>{let t=Z(e).items;return Array.isArray(t)?t:[]},qe=(e,t)=>Object.values(e.items).filter(a=>a.stage===t&&M.has(a.status)).length;function ye(){return [{id:"policy-explicit",severity:"error",check(l,i){let o=l.stages.find(n=>n.deliveryPoint)?.id;if(i.type==="init")return l.stages.filter(n=>n.id!==o&&n.exitPolicy.length===0).map(n=>C("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(([r,c])=>r!==o&&Array.isArray(c)&&c.length===0).map(([r])=>C("policy-explicit","error",`column "${r}" 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 o=[],n=l.stages.filter(c=>c.commitmentPoint),r=l.stages.filter(c=>c.deliveryPoint);if(n.length!==1&&o.push(C("commitment-point-once","error",`${n.length} columns are marked commitmentPoint (${n.map(c=>c.id).join(", ")||"none"})`,"mark exactly one column commitmentPoint: true")),r.length!==1&&o.push(C("commitment-point-once","error",`${r.length} columns are marked deliveryPoint (${r.map(c=>c.id).join(", ")||"none"})`,"mark exactly one column deliveryPoint: true")),n.length===1&&r.length===1){let c=l.stages.indexOf(n[0]),d=l.stages.indexOf(r[0]);d!==l.stages.length-1&&o.push(C("commitment-point-once","error",`delivery column "${r[0].id}" is not the last column`,"move the delivery column to the end; finished cards leave the board there")),c===0?o.push(C("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&&o.push(C("commitment-point-once","error",`commitment column "${n[0].id}" comes after the delivery column`,"order columns options \u2192 commitment \u2192 \u2026 \u2192 delivery"));}return o}},{id:"wip-respected",severity:"error",check(l,i){if(i.type==="ceremony.replenishment"){let o=l.stages.find(f=>f.commitmentPoint);if(!o||o.wipLimit===void 0)return [];let n=re(i),r=Object.values(l.items).filter(f=>f.stage===o.id&&P.has(f.status)).length,c=n.some(f=>l.items[f]?.classOfService==="expedite")?x(l).classesOfService.expedite?.wipBypass??1:0,d=o.wipLimit+c;return r+n.length<=d?[]:[C("wip-respected","error",`column "${o.id}" holds ${r} card(s); pulling ${n.length} more exceeds its WIP limit of ${o.wipLimit}${c?` (+${c} expedite bypass)`:""}`,`pull at most ${Math.max(0,d-r)} card(s) now, or raise the limit in a service-delivery-review`)]}if(i.type==="ceremony.service-delivery-review"){let o=Z(i).wip??{},n=[];for(let[r,c]of Object.entries(o)){if(typeof c!="number")continue;let d=qe(l,r);d>c&&n.push(C("wip-respected","warning",`column "${r}" 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 o=l.stages[0],n=l.stages.find(d=>d.commitmentPoint);if(!o||!n)return [];let r=[],c=Z(i).column;c!==void 0&&c!==n.id&&r.push(C("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 re(i)){let f=l.items[d];f&&(f.stage!==o.id||f.status!=="todo")&&r.push(C("pull-not-push","error",`item "${d}" is ${f.status} in "${f.stage}", not an option`,`only todo cards in "${o.id}" can be pulled; cards already on the board flow by pull`,d));}return r}},{id:"blocker-has-owner",severity:"error",check(l,i){if(!i.type.startsWith("ceremony."))return [];let o=[];if(i.type==="ceremony.operations-review"){let n=Z(i).assign??[];for(let r of n)(typeof r.owner!="string"||r.owner.trim()==="")&&o.push(C("blocker-has-owner","error",`blocker "${r.blocker}" on "${r.item}" would have no owner`,"name the role or person who clears it",r.item));}for(let n of Object.values(l.items))for(let r of n.blockers)!r.clearedAt&&r.owner.trim()===""&&o.push(C("blocker-has-owner","warning",`blocker "${r.id}" on "${n.id}" has no owner`,`assign one in operations-review: { "assign": [{ "item": "${n.id}", "blocker": "${r.id}", "owner": "<who>" }] }`,n.id));return o}},{id:"one-expedite",severity:"error",check(l,i){if(i.type!=="ceremony.replenishment")return [];let o=re(i).filter(c=>l.items[c]?.classOfService==="expedite");if(o.length===0)return [];let n=Object.values(l.items).filter(c=>c.classOfService==="expedite"&&P.has(c.status)&&E(l,c)).map(c=>c.id),r=x(l).maxExpedite;return n.length+o.length<=r?[]:[C("one-expedite","error",`${n.length} expedite card(s) already on the board (${n.join(", ")||"none"}); pulling ${o.join(", ")} exceeds maxExpedite ${r}`,"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"?[]:re(i).filter(o=>{let n=l.items[o];return n?.classOfService==="fixed-date"&&!(n.deadline&&Number.isFinite(Date.parse(n.deadline)))}).map(o=>C("fixed-date-needs-deadline","error",`fixed-date item "${o}" has no deadline`,`editItem("${o}", { deadline: "<ISO date>" }) before pulling it`,o))}}]}function be(e){let t=e.columns.map(m=>{let u={id:m.id,name:m.name,entryPolicy:[],exitPolicy:m.policies};return m.wipLimit!==void 0&&(u.wipLimit=m.wipLimit),m.commitmentPoint&&(u.commitmentPoint=true),m.deliveryPoint&&(u.deliveryPoint=true),m.review&&(u.review=true),u}),a=t.findIndex(m=>m.commitmentPoint),s=a>=0?t[a+1]:void 0;return s&&(s.entryPolicy=t[a].exitPolicy),t}var Fe={backlog:"Options",item:"Work Item",stage:"Column",iteration:"Cadence",increment:"Delivery",ceremony:"Cadence",gate:"Policy"},Je={expedite:0,"fixed-date":1,standard:2,intangible:3},We=e=>Je[e.classOfService??"standard"]??2,ve=1e15,Ue=4e9,Ye=(e,t,a)=>Math.min(a,Math.max(t,e));function He(e,t){let a=e.classOfService??"standard";if(e.type==="question")return 5*ve;if(a==="fixed-date"&&e.deadline!==void 0){let l=Date.parse(e.deadline);if(Number.isFinite(l))return 3*ve+1e10-Math.floor(l/1e3)}let s=t.aging?Math.floor(t.deferrals/t.maxDeferralRounds):0,m=Ye(e.priority??0,-1e9,1e9)+s*Ue,u=t.aging&&t.deferrals>=t.maxDeferralRounds;return (a==="expedite"?4:a==="fixed-date"?3:a==="intangible"&&!u?1:2)*ve+m}function je(e,t){let a=We(e)-We(t);if(a!==0)return a;let s=N(e),m=N(t),u=s===void 0?0:Date.parse(s),g=m===void 0?0:Date.parse(m);return u!==g?u-g:e.id<t.id?-1:e.id>t.id?1:0}function Ge(e){return e.map(t=>t.kind==="evidence"?`evidence ${t.evidenceKind}`:t.kind==="custom"?`${t.id}: ${t.description}`:t.kind).join(", ")||"(none)"}function Ze(){return {name:"kanban",vocabulary:Fe,validateConfig:Y,defaultStages:be,defaultRoles:ge,requiredCapabilities:["manage-flow","deliver"],exclusiveCapabilities:[],plannerOptions(e){let t=x(e),a=B(e),s=e.stages[e.stages.findIndex(n=>n.id===a.id)+1],m=t.classesOfService.expedite?.wipBypass??1,u=[],g=[0],l=new Map;for(let n of e.events)u.push(Date.parse(n.at)),g.push(g[g.length-1]+(n.type==="planner.resolved"?1:0)),n.type==="item.added"&&l.set(n.payload.id,n.at);let i=n=>{let r=0,c=u.length;for(;r<c;){let d=r+c>>1;u[d]<=n?r=d+1:c=d;}return g[u.length]-g[r]},o={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 r=Date.parse(N(n)??l.get(n.id)??"");return He(n,{deferrals:i(Number.isFinite(r)?r:0),aging:t.fairness.aging,maxDeferralRounds:t.fairness.maxDeferralRounds})},tieBreaker:je,wipCounts:[...M],wipLimitOf:(n,r)=>n.wipLimit===void 0?void 0:r.classOfService==="expedite"?n.wipLimit+m:n.wipLimit};return o.maxDeferralRounds=t.fairness.maxDeferralRounds,o},candidates(e){let t=Math.max(0,x(e).maxExpedite-J(e).length),a=Object.values(e.items).filter(m=>(m.status==="todo"||m.status==="review")&&E(e,m)),s=timSort(a.filter(m=>m.classOfService==="expedite"),je).slice(0,t);return a.filter(m=>m.classOfService!=="expedite"||s.includes(m))},invariants(e,t){let a=x(e),s=e.stages.find(l=>l.id===t.stage),m=t.classOfService??"standard",u=a.classesOfService[m]?.sle,g=Object.values(e.items).filter(l=>l.stage===s.id&&M.has(l.status)).length;return [`Column "${s.name}" exit policies: ${Ge(s.exitPolicy)}`,`Class of service: ${m}${t.deadline?`; deadline ${t.deadline}`:""}${u?`; service level p${u.percentile} <= ${u.targetMs} ms`:""}`,`WIP limit of "${s.name}": ${s.wipLimit??"none"} (active now: ${g}); finish this card before pulling another`,`Do not change the scope of "${t.id}" or its acceptance criteria; raise open_questions instead`]},ceremonies:pe(Ze),rules:ye(),metrics:e=>({...G(e)}),humanDefaults:{gates:"none"},report:e=>({cadencesDue:ce(e)})}}export{ue as A,pe as B,ge as C,ye as D,be as E,Fe as F,He as G,je as H,Ze as I,M as a,P as b,oe as c,B as d,X as e,Q as f,E as g,J as h,N as i,U as j,D as k,ee as l,x as m,Ce as n,Y as o,te as p,ne as q,Ke as r,Re as s,ce as t,ie as u,q as v,de as w,G as x,me as y,fe as z};//# sourceMappingURL=chunk-XSXHEEJX.mjs.map
2
- //# sourceMappingURL=chunk-XSXHEEJX.mjs.map
1
+ import {p,u,o,E as E$1,M as M$1,a,c,s,x as x$1}from'./chunk-SHAPFMVP.mjs';import {b,c as c$1}from'./chunk-2FRRD6A3.mjs';import {timSort}from'exsorted';var M=new Set(["in_progress","blocked","awaiting_human"]),P=new Set(["todo","in_progress","blocked","review","awaiting_human"]);function oe(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 B(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 X(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 Q(e,t){return p(e,t),e.stages.findIndex(a=>a.id===t)}function E(e,t){let a=Q(e,t.stage);return a>=Q(e,B(e).id)&&a<Q(e,X(e).id)}function J(e){return Object.values(e.items).filter(t=>t.classOfService==="expedite"&&M.has(t.status)&&E(e,t)).map(t=>t.id)}function N(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 U=["replenishment","delivery-planning","service-delivery-review","operations-review","risk-review","strategy-review"],D=["expedite","fixed-date","standard","intangible"],ee=864e5;function x(e){return e.config}var Ce=[{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:[]}],K=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function _(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 Ae=["acceptance-written","estimate-present","no-open-blockers","dependencies-done"],se=e=>typeof e=="string"&&e.trim()!=="";function ae(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 u=`kanban config.${t}[${m}]`;K(s)&&(s.kind==="evidence"?se(s.evidenceKind):s.kind==="custom"?se(s.id)&&se(s.description):typeof s.kind=="string"&&Ae.includes(s.kind))||b("config-invalid",`${u} must be a Policy`,`use a Policy such as { "kind": "evidence", "evidenceKind": "test-output" }, { "kind": "custom", "id": "x", "description": "..." } or one of: ${Ae.join(", ")}`),a.push(s);}),a}function Le(e,t){K(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:ae(e.policies,`columns[${t}].policies`)},m=_(e.wipLimit,`columns[${t}].wipLimit`,"omit wipLimit for no limit");m!==void 0&&(s.wipLimit=m);for(let u of ["commitmentPoint","deliveryPoint","review"])e[u]!==void 0&&(typeof e[u]!="boolean"&&b("config-invalid",`kanban config.columns[${t}].${u} must be a boolean`,`set ${u}: true or omit it`),e[u]&&(s[u]=true));return s}function Y(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?Ce.map(r=>({...r})):t.columns.map(Le),s=new Set;for(let r of a)s.has(r.id)&&b("config-invalid",`duplicate column id "${r.id}"`,"give every column a unique id"),s.add(r.id);let m={},u=t.classesOfService??{};K(u)||b("config-invalid","kanban config.classesOfService must be an object keyed by class",'e.g. { "expedite": { "wipBypass": 1 } }');for(let[r,c]of Object.entries(u)){D.includes(r)||b("config-invalid",`kanban config.classesOfService.${r} is not a class of service`,`use one of: ${D.join(", ")}`),K(c)||b("config-invalid",`kanban config.classesOfService.${r} must be an object`,'e.g. { "wipBypass": 1, "sle": { "percentile": 85, "targetMs": 604800000 } }');let d={},f=_(c.wipBypass,`classesOfService.${r}.wipBypass`,"omit it for the default 1",0);if(f!==void 0&&(d.wipBypass=f),c.sle!==void 0){let y=c.sle;(!K(y)||typeof y.percentile!="number"||y.percentile<0||y.percentile>100)&&b("config-invalid",`kanban config.classesOfService.${r}.sle.percentile must be 0..100`,'e.g. { "percentile": 85, "targetMs": 604800000 }');let k=_(y.targetMs,`classesOfService.${r}.sle.targetMs`,"state the service level target in milliseconds");k===void 0&&b("config-invalid",`kanban config.classesOfService.${r}.sle.targetMs is required`,"state the service level target in milliseconds"),d.sle={percentile:y.percentile,targetMs:k};}m[r]=d;}let g=t.fairness??{};(!K(g)||g.aging!==void 0&&typeof g.aging!="boolean")&&b("config-invalid","kanban config.fairness must be { aging: boolean, maxDeferralRounds?: number }","omit it for aging on");let l=_(g.maxDeferralRounds,"fairness.maxDeferralRounds","omit it for 5 rounds"),i={aging:g.aging===void 0?true:g.aging,maxDeferralRounds:l??5},o={},n=t.cadences??{};K(n)||b("config-invalid","kanban config.cadences must be an object keyed by cadence",'e.g. { "replenishment": { "everyTurns": 10 } }');for(let[r,c]of Object.entries(n)){U.includes(r)||b("config-invalid",`kanban config.cadences.${r} is not a cadence`,`use one of: ${U.join(", ")}`),K(c)||b("config-invalid",`kanban config.cadences.${r} must be an object`,'e.g. { "everyTurns": 10 }');let d=_(c.everyTurns,`cadences.${r}.everyTurns`,"omit it when the cadence is run by hand");o[r]=d===void 0?{}:{everyTurns:d};}return {columns:a,classesOfService:m,fairness:i,cadences:o,throughputWindowMs:_(t.throughputWindowMs,"throughputWindowMs","omit it for one week")??7*ee,maxExpedite:_(t.maxExpedite,"maxExpedite","omit it for 1")??1}}function te(e,t){return e.events.find(s=>s.type==="item.added"&&s.payload.id===t)?.at??e.events[0].at}function ne(e,t,a){return Date.parse(a)-Date.parse(N(t)??te(e,t.id))}function Ke(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:ne(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)),u=m.filter(l=>M.has(l.status)).length,g=m.filter(l=>l.status==="todo"||l.status==="review").length;return {id:a.id,name:a.name,wipLimit:a.wipLimit??null,active:u,queued:g,overLimit:a.wipLimit!==void 0&&u>a.wipLimit,commitmentPoint:a.commitmentPoint===true,deliveryPoint:a.deliveryPoint===true,cards:m}})}var Re=e=>`cadence.${e}`;function ce(e){let t=x(e);return U.map(a=>{let s=0,m=null;for(let l of e.events)l.type===Re(a)&&(s=l.seq,m=l.at);let u=e.events.filter(l=>l.type==="item.completed"&&l.seq>s).length,g=t.cadences[a]?.everyTurns??null;return {cadence:a,everyTurns:g,lastAt:m,turnsSince:u,due:g!==null&&u>=g}})}var $e=(e,t)=>Date.parse(t)-Date.parse(e),Me=e=>e.transition??null;function ie(e,t,a){let s=new Map,m=[],u=e[0]?.at??"1970-01-01T00:00:00.000Z",g=(i,o,n)=>{o===t&&i.committedAt===void 0&&(i.committedAt=n),o===a&&i.deliveredAt===void 0&&(i.deliveredAt=n);},l=(i,o,n)=>{i.since.status==="in_progress"&&(i.activeMs+=$e(i.since.at,n)),i.since.status==="blocked"&&(i.blockedMs+=$e(i.since.at,n)),i.since={status:o.status,at:n},o.stage!==i.stage&&(i.stays[i.stays.length-1].leftAt=n,i.stays.push({stage:o.stage,enteredAt:n}),g(i,o.stage,n)),i.stage=o.stage,i.status=o.status;};for(let i of e){u=i.at;let o=i.payload??{};switch(i.type){case "item.added":{let n=o.id,r=o.stage,c={id:n,type:typeof o.type=="string"?o.type:"task",stage:r,status:"todo",stays:[{stage:r,enteredAt:i.at}],classOfService:"standard",activeMs:0,blockedMs:0,since:{status:"todo",at:i.at}};g(c,r,i.at),s.set(n,c);break}case "item.transition":{let n=s.get(o.id);if(!n)break;l(n,o.to,i.at);break}case "cadence.replenishment":{let n=o.items??[];for(let r of n){let c=s.get(r.id);c&&(c.classOfService=r.classOfService,r.deadline?c.deadline=r.deadline:delete c.deadline);}break}case "blocker.raised":{m.push({item:o.id,blocker:o.blocker,raisedAt:i.at});let n=s.get(o.id),r=Me(o);n&&r&&l(n,r.to,i.at);break}case "blocker.cleared":{let n=m.find(d=>d.item===o.id&&d.blocker===o.blocker&&d.clearedAt===void 0);n&&(n.clearedAt=i.at);let r=s.get(o.id),c=Me(o);r&&c&&l(r,c.to,i.at);break}}}return {items:s,blockers:m,lastAt:u}}function q(e,t){if(e.length===0)return 0;let a=timSort([...e],(m,u)=>m-u),s=Math.min(a.length,Math.max(1,Math.ceil(t/100*a.length)));return a[s-1]}var H=(e,t)=>Date.parse(t)-Date.parse(e),Pe=(e,t)=>t===0?0:e/t;function Ee(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 De(e){let t={};for(let a of e.items.values())for(let s of a.stays)s.leftAt!==void 0&&(t[s.stage]??=[]).push(H(s.enteredAt,s.leftAt));return t}function de(e){let t=Ee(e);return De(ie(e.events,t.commitment,t.delivery))}function G(e){let t=x(e),a=Ee(e),s=ie(e.events,a.commitment,a.delivery),m=[...s.items.values()],u=e.stages.map(p=>p.id),g=new Map(u.map((p,b)=>[p,b])),l=timSort(m.filter(p=>p.type!=="question"&&p.committedAt!==void 0&&p.deliveredAt!==void 0),(p,b)=>Date.parse(p.deliveredAt)-Date.parse(b.deliveredAt)),i=l.map(p=>H(p.committedAt,p.deliveredAt)),o={};for(let[p,b]of Object.entries(De(s)))o[p]=b.reduce((h,S)=>h+S,0)/b.length;let n=m.filter(p=>p.type!=="question"&&p.committedAt!==void 0).map(p=>Date.parse(p.committedAt)),r=[];if(n.length>0){let p=n.reduce((h,S)=>S<h?S:h,n[0]),b=Math.floor((Date.parse(s.lastAt)-p)/t.throughputWindowMs)+1;r=Array.from({length:b},()=>0);for(let h of l){let S=Math.floor((Date.parse(h.deliveredAt)-p)/t.throughputWindowMs);S>=0&&S<b&&(r[S]+=1);}}let c=Object.fromEntries(u.map(p=>[p,0])),d={};for(let p of m){if(!P.has(p.status))continue;Object.hasOwn(c,p.stage)&&(c[p.stage]+=1);let b=g.get(p.stage);b!==void 0&&b>=a.ci&&b<a.di&&(d[p.id]=H(p.stays[p.stays.length-1].enteredAt,s.lastAt));}let f=new Map;for(let p of m)for(let b of p.stays){let h=f.get(b.stage)??new Map;h.has(p.id)||h.set(p.id,b.enteredAt),f.set(b.stage,h);}let y=timSort([...new Set(e.events.map(p=>p.at.slice(0,10)))],(p,b)=>p<b?-1:p>b?1:0),k={};for(let p of y)for(let b of u)k[`${p}:${b}`]=[...f.get(b)?.values()??[]].filter(h=>h.slice(0,10)<=p).length;let w={};for(let[p,b]of Object.entries(t.classesOfService)){if(!b?.sle)continue;let h=l.filter(S=>S.classOfService===p);h.length!==0&&(w[p]=h.filter(S=>H(S.committedAt,S.deliveredAt)<=b.sle.targetMs).length/h.length);}let I=s.blockers.reduce((p,b)=>p+H(b.raisedAt,b.clearedAt??s.lastAt),0);return {leadTimeMs:i,leadTimeP50:q(i,50),leadTimeP85:q(i,85),cycleTimeMsByColumn:o,throughput:r,wipByColumn:c,flowEfficiency:Pe(l.reduce((p,b)=>p+b.activeMs,0),i.reduce((p,b)=>p+b,0)),agingWipMs:d,cumulativeFlow:k,sleCompliance:w,blockerTimeMs:I,meanBlockerTimeMs:Pe(I,s.blockers.length)}}function me(e,t){let a=Date.parse(t),s=de(e),m=[],u=[],g=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 o of i.blockers)o.clearedAt||m.push({item:i.id,blocker:o.id,owner:o.owner,reason:o.reason,ageMs:a-Date.parse(o.raisedAt)});if(M.has(i.status)?l[i.stage]=(l[i.stage]??0)+1:(i.status==="todo"||i.status==="review")&&(g[i.stage]=(g[i.stage]??0)+1),P.has(i.status)&&E(e,i)){let o=s[i.stage]??[],n=o.length?q(o,85):null,r=ne(e,i,t);u.push({item:i.id,column:i.stage,status:i.status,ageMs:r,p85Ms:n,overP85:n!==null&&r>n});}}return {blockers:m,agingWip:timSort(u,(i,o)=>o.ageMs-i.ageMs||(i.item<o.item?-1:1)),queued:g,active:l}}function Ne(e,t){let a=B(e).id;return e.items[t].transitions.find(u=>u.to.stage===a&&u.from.stage!==a)?.at??te(e,t)}function fe(e,t,a){let s=Date.parse(t),m=x(e),u=G(e).leadTimeMs,g=m.classesOfService["fixed-date"]?.sle?.percentile??85,l=u.length?q(u,g):null,i=[],o=[];for(let n of Object.values(e.items)){for(let f of n.blockers){let y=f.clearedAt?0:s-Date.parse(f.raisedAt);!f.clearedAt&&y>a&&o.push({item:n.id,blocker:f.id,owner:f.owner,ageMs:y});}if(n.classOfService!=="fixed-date"||!n.deadline||!P.has(n.status)||!E(e,n))continue;let r=s-Date.parse(Ne(e,n.id)),c=l===null?null:Math.max(0,l-r),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:o,expediteActive:J(e)}}var V=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function ue(e,t,a){let s=t.items;(!Array.isArray(s)||s.length===0||!s.every(u=>typeof u=="string"))&&b("invalid-input",`${a} needs items: string[]`,'pass ["A", "B"]');let m=s.find((u,g)=>s.indexOf(u)!==g);m!==void 0&&b("invalid-input",`item "${m}" appears twice in items[]`,"list each item once",{items:[m]});for(let u$1 of s)u(e,u$1);return s}function _e(e){return V(e)&&typeof e.percentile=="number"&&e.percentile>=0&&e.percentile<=100&&typeof e.targetMs=="number"&&Number.isFinite(e.targetMs)&&e.targetMs>0}function Ie(e,t){let{wipLimit:a,...s}=e;return t===null?s:{...s,wipLimit:t}}function pe(e){let t=(i,o,n,r)=>M$1(i,e(),{type:o,by:n.by,payload:n},c=>r(c,a(n.now)));return {replenishment:(i,o$1)=>{o(i,o$1.by,"order-backlog","manage-flow");let n=ue(i,o$1,"replenishment"),r=B(i),c$1=oe(i);for(let d of n)E$1(i,u(i,d),c$1.exitPolicy,`leave "${c$1.id}"`);return t(i,"ceremony.replenishment",o$1,(d,f)=>{for(let y of n)d=x$1(d,y,{stage:r.id,status:"todo"},o$1.by,f);return c(d,"cadence.replenishment",o$1.by,{column:r.id,items:n.map(y=>{let k=u(d,y);return {id:y,classOfService:k.classOfService??"standard",deadline:k.deadline??null}})},f)})},"delivery-planning":(i,o$1)=>{o(i,o$1.by,"facilitate","manage-flow");let n=ue(i,o$1,"delivery-planning"),r=X(i),c$1=i.stages[i.stages.findIndex(d=>d.id===r.id)-1];for(let d of n){let f=u(i,d);f.stage!==c$1.id&&f.stage!==r.id&&b("invalid-input",`item "${d}" is in "${f.stage}", not ready for delivery`,`only cards in "${c$1.id}" or "${r.id}" can be planned for delivery`,{items:[d]});}return t(i,"ceremony.delivery-planning",o$1,(d,f)=>c(d,"cadence.delivery-planning",o$1.by,{items:n,window:typeof o$1.window=="string"?o$1.window:null,delivered:n.filter(y=>u(d,y).status==="done")},f))},"service-delivery-review":(i,o$1)=>{o(i,o$1.by,"manage-flow");let n=o$1.wip??{},r=o$1.policies??{},c$1=o$1.sle??{};(!V(n)||!V(r)||!V(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[f,y]of Object.entries(n))p(i,f),y!==null&&(typeof y!="number"||!Number.isFinite(y)||y<1)&&b("invalid-input",`wip.${f} must be a positive number or null`,"null removes the limit");let d={};for(let[f,y]of Object.entries(r))p(i,f),d[f]=ae(y,`policies.${f}`);for(let[f,y]of Object.entries(c$1))D.includes(f)||b("invalid-input",`sle.${f} is not a class of service`,`use one of: ${D.join(", ")}`),y!==null&&!_e(y)&&b("invalid-input",`sle.${f} must be { percentile: 0..100, targetMs: > 0 } or null`,"null removes the service level");return t(i,"ceremony.service-delivery-review",o$1,(f,y)=>{let k=x(f),w=f.stages,I=k.columns,p={...k.classesOfService},b=[],h=[],S=[];for(let[O,A]of Object.entries(n)){let W=w.find(R=>R.id===O).wipLimit??null;W!==A&&(b.push({column:O,before:W,after:A}),w=w.map(R=>R.id===O?Ie(R,A):R),I=I.map(R=>R.id===O?Ie(R,A):R));}for(let[O,A]of Object.entries(d)){let W=w.find($=>$.id===O).exitPolicy;if(JSON.stringify(W)===JSON.stringify(A))continue;h.push({column:O,before:W,after:A});let R=w.findIndex($=>$.id===O),z=w[R].commitmentPoint?w[R+1]?.id:void 0;w=w.map($=>$.id===O?{...$,exitPolicy:A}:$.id===z?{...$,entryPolicy:A}:$),I=I.map($=>$.id===O?{...$,policies:A}:$);}for(let[O,A]of Object.entries(c$1)){let W=p[O]?.sle??null;if(JSON.stringify(W)===JSON.stringify(A))continue;S.push({classOfService:O,before:W,after:A});let{sle:R,...z}=p[O]??{};p={...p,[O]:A===null?z:{...z,sle:A}};}return f={...f,stages:w,config:{...k,columns:I,classesOfService:p}},c(f,"cadence.service-delivery-review",o$1.by,{wip:b,policies:h,sle:S},y)})},"operations-review":(i,o$1)=>{o(i,o$1.by,"facilitate","manage-flow");let n=o$1.assign??[];(!Array.isArray(n)||!n.every(r=>V(r)&&typeof r.item=="string"&&typeof r.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 r of n){let c=u(i,r.item);c.blockers.some(d=>d.id===r.blocker&&!d.clearedAt)||b("invalid-input",`item "${r.item}" has no open blocker "${r.blocker}"`,`open blockers: ${c.blockers.filter(d=>!d.clearedAt).map(d=>d.id).join(", ")||"(none)"}`,{items:[r.item]});}return t(i,"ceremony.operations-review",o$1,(r,c$1)=>{for(let d of n){let f=u(r,d.item).blockers.find(y=>y.id===d.blocker).owner;r=s(r,d.item,y=>({...y,blockers:y.blockers.map(k=>k.id===d.blocker?{...k,owner:d.owner}:k)})),r=c(r,"blocker.reassigned",o$1.by,{id:d.item,blocker:d.blocker,from:f,to:d.owner},c$1);}return c(r,"cadence.operations-review",o$1.by,me(r,c$1),c$1)})},"risk-review":(i,o$1)=>{o(i,o$1.by,"facilitate","manage-flow");let n=o$1.staleAfterMs??7*ee;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",o$1,(r,c$1)=>c(r,"cadence.risk-review",o$1.by,fe(r,c$1,n),c$1))},"strategy-review":(i,o$1)=>{o(i,o$1.by,"manage-flow");let n=x(i),r=o$1.classesOfService??{};V(r)||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[f,y]of Object.entries(r))D.includes(f)||b("invalid-input",`classesOfService.${f} is not a class of service`,`use one of: ${D.join(", ")}`),y===null?delete c$1[f]:c$1[f]=y;let d=Y({...n,classesOfService:c$1,maxExpedite:o$1.maxExpedite??n.maxExpedite});return t(i,"ceremony.strategy-review",o$1,(f,y)=>{let k=Object.fromEntries(D.map(w=>[w,0]));for(let w of Object.values(f.items))P.has(w.status)&&E(f,w)&&(k[w.classOfService??"standard"]+=1);return f={...f,config:{...x(f),classesOfService:d.classesOfService,maxExpedite:d.maxExpedite}},c(f,"cadence.strategy-review",o$1.by,{mix:k,before:{classesOfService:n.classesOfService,maxExpedite:n.maxExpedite},after:{classesOfService:d.classesOfService,maxExpedite:d.maxExpedite}},y)})}}}function ge(){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 C=(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??{},re=e=>{let t=Z(e).items;return Array.isArray(t)?t:[]},qe=(e,t)=>Object.values(e.items).filter(a=>a.stage===t&&M.has(a.status)).length;function ye(){return [{id:"policy-explicit",severity:"error",check(l,i){let o=l.stages.find(n=>n.deliveryPoint)?.id;if(i.type==="init")return l.stages.filter(n=>n.id!==o&&n.exitPolicy.length===0).map(n=>C("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(([r,c])=>r!==o&&Array.isArray(c)&&c.length===0).map(([r])=>C("policy-explicit","error",`column "${r}" 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 o=[],n=l.stages.filter(c=>c.commitmentPoint),r=l.stages.filter(c=>c.deliveryPoint);if(n.length!==1&&o.push(C("commitment-point-once","error",`${n.length} columns are marked commitmentPoint (${n.map(c=>c.id).join(", ")||"none"})`,"mark exactly one column commitmentPoint: true")),r.length!==1&&o.push(C("commitment-point-once","error",`${r.length} columns are marked deliveryPoint (${r.map(c=>c.id).join(", ")||"none"})`,"mark exactly one column deliveryPoint: true")),n.length===1&&r.length===1){let c=l.stages.indexOf(n[0]),d=l.stages.indexOf(r[0]);d!==l.stages.length-1&&o.push(C("commitment-point-once","error",`delivery column "${r[0].id}" is not the last column`,"move the delivery column to the end; finished cards leave the board there")),c===0?o.push(C("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&&o.push(C("commitment-point-once","error",`commitment column "${n[0].id}" comes after the delivery column`,"order columns options \u2192 commitment \u2192 \u2026 \u2192 delivery"));}return o}},{id:"wip-respected",severity:"error",check(l,i){if(i.type==="ceremony.replenishment"){let o=l.stages.find(f=>f.commitmentPoint);if(!o||o.wipLimit===void 0)return [];let n=re(i),r=Object.values(l.items).filter(f=>f.stage===o.id&&P.has(f.status)).length,c=n.some(f=>l.items[f]?.classOfService==="expedite")?x(l).classesOfService.expedite?.wipBypass??1:0,d=o.wipLimit+c;return r+n.length<=d?[]:[C("wip-respected","error",`column "${o.id}" holds ${r} card(s); pulling ${n.length} more exceeds its WIP limit of ${o.wipLimit}${c?` (+${c} expedite bypass)`:""}`,`pull at most ${Math.max(0,d-r)} card(s) now, or raise the limit in a service-delivery-review`)]}if(i.type==="ceremony.service-delivery-review"){let o=Z(i).wip??{},n=[];for(let[r,c]of Object.entries(o)){if(typeof c!="number")continue;let d=qe(l,r);d>c&&n.push(C("wip-respected","warning",`column "${r}" 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 o=l.stages[0],n=l.stages.find(d=>d.commitmentPoint);if(!o||!n)return [];let r=[],c=Z(i).column;c!==void 0&&c!==n.id&&r.push(C("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 re(i)){let f=l.items[d];f&&(f.stage!==o.id||f.status!=="todo")&&r.push(C("pull-not-push","error",`item "${d}" is ${f.status} in "${f.stage}", not an option`,`only todo cards in "${o.id}" can be pulled; cards already on the board flow by pull`,d));}return r}},{id:"blocker-has-owner",severity:"error",check(l,i){if(!i.type.startsWith("ceremony."))return [];let o=[];if(i.type==="ceremony.operations-review"){let n=Z(i).assign??[];for(let r of n)(typeof r.owner!="string"||r.owner.trim()==="")&&o.push(C("blocker-has-owner","error",`blocker "${r.blocker}" on "${r.item}" would have no owner`,"name the role or person who clears it",r.item));}for(let n of Object.values(l.items))for(let r of n.blockers)!r.clearedAt&&r.owner.trim()===""&&o.push(C("blocker-has-owner","warning",`blocker "${r.id}" on "${n.id}" has no owner`,`assign one in operations-review: { "assign": [{ "item": "${n.id}", "blocker": "${r.id}", "owner": "<who>" }] }`,n.id));return o}},{id:"one-expedite",severity:"error",check(l,i){if(i.type!=="ceremony.replenishment")return [];let o=re(i).filter(c=>l.items[c]?.classOfService==="expedite");if(o.length===0)return [];let n=Object.values(l.items).filter(c=>c.classOfService==="expedite"&&P.has(c.status)&&E(l,c)).map(c=>c.id),r=x(l).maxExpedite;return n.length+o.length<=r?[]:[C("one-expedite","error",`${n.length} expedite card(s) already on the board (${n.join(", ")||"none"}); pulling ${o.join(", ")} exceeds maxExpedite ${r}`,"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"?[]:re(i).filter(o=>{let n=l.items[o];return n?.classOfService==="fixed-date"&&!(n.deadline&&Number.isFinite(Date.parse(n.deadline)))}).map(o=>C("fixed-date-needs-deadline","error",`fixed-date item "${o}" has no deadline`,`editItem("${o}", { deadline: "<ISO date>" }) before pulling it`,o))}}]}function be(e){let t=e.columns.map(m=>{let u={id:m.id,name:m.name,entryPolicy:[],exitPolicy:m.policies};return m.wipLimit!==void 0&&(u.wipLimit=m.wipLimit),m.commitmentPoint&&(u.commitmentPoint=true),m.deliveryPoint&&(u.deliveryPoint=true),m.review&&(u.review=true),u}),a=t.findIndex(m=>m.commitmentPoint),s=a>=0?t[a+1]:void 0;return s&&(s.entryPolicy=t[a].exitPolicy),t}var Fe={backlog:"Options",item:"Work Item",stage:"Column",iteration:"Cadence",increment:"Delivery",ceremony:"Cadence",gate:"Policy"},Je={expedite:0,"fixed-date":1,standard:2,intangible:3},We=e=>Je[e.classOfService??"standard"]??2,ve=1e15,Ue=4e9,Ye=(e,t,a)=>Math.min(a,Math.max(t,e));function He(e,t){let a=e.classOfService??"standard";if(e.type==="question")return 5*ve;if(a==="fixed-date"&&e.deadline!==void 0){let l=Date.parse(e.deadline);if(Number.isFinite(l))return 3*ve+1e10-Math.floor(l/1e3)}let s=t.aging?Math.floor(t.deferrals/t.maxDeferralRounds):0,m=Ye(e.priority??0,-1e9,1e9)+s*Ue,u=t.aging&&t.deferrals>=t.maxDeferralRounds;return (a==="expedite"?4:a==="fixed-date"?3:a==="intangible"&&!u?1:2)*ve+m}function je(e,t){let a=We(e)-We(t);if(a!==0)return a;let s=N(e),m=N(t),u=s===void 0?0:Date.parse(s),g=m===void 0?0:Date.parse(m);return u!==g?u-g:e.id<t.id?-1:e.id>t.id?1:0}function Ge(e){return e.map(t=>t.kind==="evidence"?`evidence ${t.evidenceKind}`:t.kind==="custom"?`${t.id}: ${t.description}`:t.kind).join(", ")||"(none)"}function Ze(){return {name:"kanban",vocabulary:Fe,validateConfig:Y,defaultStages:be,defaultRoles:ge,requiredCapabilities:["manage-flow","deliver"],exclusiveCapabilities:[],plannerOptions(e){let t=x(e),a=B(e),s=e.stages[e.stages.findIndex(n=>n.id===a.id)+1],m=t.classesOfService.expedite?.wipBypass??1,u=[],g=[0],l=new Map;for(let n of e.events)u.push(Date.parse(n.at)),g.push(g[g.length-1]+(n.type==="planner.resolved"?1:0)),n.type==="item.added"&&l.set(n.payload.id,n.at);let i=n=>{let r=0,c=u.length;for(;r<c;){let d=r+c>>1;u[d]<=n?r=d+1:c=d;}return g[u.length]-g[r]},o={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 r=Date.parse(N(n)??l.get(n.id)??"");return He(n,{deferrals:i(Number.isFinite(r)?r:0),aging:t.fairness.aging,maxDeferralRounds:t.fairness.maxDeferralRounds})},tieBreaker:je,wipCounts:[...M],wipLimitOf:(n,r)=>n.wipLimit===void 0?void 0:r.classOfService==="expedite"?n.wipLimit+m:n.wipLimit};return o.maxDeferralRounds=t.fairness.maxDeferralRounds,o},candidates(e){let t=Math.max(0,x(e).maxExpedite-J(e).length),a=Object.values(e.items).filter(m=>(m.status==="todo"||m.status==="review")&&E(e,m)),s=timSort(a.filter(m=>m.classOfService==="expedite"),je).slice(0,t);return a.filter(m=>m.classOfService!=="expedite"||s.includes(m))},invariants(e,t){let a=x(e),s=e.stages.find(l=>l.id===t.stage),m=t.classOfService??"standard",u=a.classesOfService[m]?.sle,g=Object.values(e.items).filter(l=>l.stage===s.id&&M.has(l.status)).length;return [`Column "${s.name}" exit policies: ${Ge(s.exitPolicy)}`,`Class of service: ${m}${t.deadline?`; deadline ${t.deadline}`:""}${u?`; service level p${u.percentile} <= ${u.targetMs} ms`:""}`,`WIP limit of "${s.name}": ${s.wipLimit??"none"} (active now: ${g}); finish this card before pulling another`,`Do not change the scope of "${t.id}" or its acceptance criteria; raise open_questions instead`]},ceremonies:pe(Ze),rules:ye(),metrics:e=>({...G(e)}),humanDefaults:{gates:"none"},report:e=>({cadencesDue:ce(e)})}}export{ue as A,pe as B,ge as C,ye as D,be as E,Fe as F,He as G,je as H,Ze as I,M as a,P as b,oe as c,B as d,X as e,Q as f,E as g,J as h,N as i,U as j,D as k,ee as l,x as m,Ce as n,Y as o,te as p,ne as q,Ke as r,Re as s,ce as t,ie as u,q as v,de as w,G as x,me as y,fe as z};//# sourceMappingURL=chunk-GATJZYTB.mjs.map
2
+ //# sourceMappingURL=chunk-GATJZYTB.mjs.map