ex-workflow 0.4.0-stage → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/CHANGELOG.md +58 -2
  2. package/README.md +68 -32
  3. package/dist/adapters/index.cjs +1 -1
  4. package/dist/adapters/index.mjs +1 -1
  5. package/dist/{roles-BLBRKhUZ.d.ts → budget-Cx63FX2K.d.ts} +9 -2
  6. package/dist/{roles-aneKYJ3Z.d.cts → budget-JyNKxP5N.d.cts} +9 -2
  7. package/dist/chunk-3KFQPSRX.mjs +2 -0
  8. package/dist/chunk-3KFQPSRX.mjs.map +1 -0
  9. package/dist/chunk-5PHK72VM.cjs +2 -0
  10. package/dist/chunk-5PHK72VM.cjs.map +1 -0
  11. package/dist/chunk-5TXYMLBF.mjs +3 -0
  12. package/dist/chunk-5TXYMLBF.mjs.map +1 -0
  13. package/dist/chunk-7IG6EQI4.mjs +6 -0
  14. package/dist/chunk-7IG6EQI4.mjs.map +1 -0
  15. package/dist/chunk-CYXVGHQM.cjs +2 -0
  16. package/dist/chunk-CYXVGHQM.cjs.map +1 -0
  17. package/dist/chunk-FKTCGQYB.cjs +2 -0
  18. package/dist/chunk-FKTCGQYB.cjs.map +1 -0
  19. package/dist/chunk-HIHMBMB5.cjs +2 -0
  20. package/dist/chunk-HIHMBMB5.cjs.map +1 -0
  21. package/dist/chunk-MQWMQ4PD.mjs +2 -0
  22. package/dist/chunk-MQWMQ4PD.mjs.map +1 -0
  23. package/dist/chunk-QDMEM62U.mjs +2 -0
  24. package/dist/chunk-QDMEM62U.mjs.map +1 -0
  25. package/dist/chunk-U3OXAO67.mjs +2 -0
  26. package/dist/chunk-U3OXAO67.mjs.map +1 -0
  27. package/dist/chunk-UZQV73X7.mjs +2 -0
  28. package/dist/chunk-UZQV73X7.mjs.map +1 -0
  29. package/dist/chunk-VXH2FAKV.cjs +2 -0
  30. package/dist/chunk-VXH2FAKV.cjs.map +1 -0
  31. package/dist/chunk-WOGK54HB.cjs +3 -0
  32. package/dist/chunk-WOGK54HB.cjs.map +1 -0
  33. package/dist/chunk-XMO2RCXB.cjs +2 -0
  34. package/dist/chunk-XMO2RCXB.cjs.map +1 -0
  35. package/dist/chunk-YBHHICTZ.mjs +2 -0
  36. package/dist/chunk-YBHHICTZ.mjs.map +1 -0
  37. package/dist/chunk-YJN4JEJU.cjs +2 -0
  38. package/dist/chunk-YJN4JEJU.cjs.map +1 -0
  39. package/dist/chunk-YRATJT7P.cjs +6 -0
  40. package/dist/chunk-YRATJT7P.cjs.map +1 -0
  41. package/dist/chunk-Z2G7DGDF.mjs +2 -0
  42. package/dist/chunk-Z2G7DGDF.mjs.map +1 -0
  43. package/dist/cli/bin.cjs +1 -1
  44. package/dist/cli/bin.mjs +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 +35 -12
  50. package/dist/index.d.ts +35 -12
  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 +1 -1
  56. package/dist/schema/index.mjs +1 -1
  57. package/dist/scrum/index.cjs +1 -1
  58. package/dist/scrum/index.d.cts +18 -3
  59. package/dist/scrum/index.d.ts +18 -3
  60. package/dist/scrum/index.mjs +1 -1
  61. package/dist/types.d.cts +23 -1
  62. package/dist/types.d.ts +23 -1
  63. package/dist/waterfall/index.cjs +1 -1
  64. package/dist/waterfall/index.d.cts +4 -1
  65. package/dist/waterfall/index.d.ts +4 -1
  66. package/dist/waterfall/index.mjs +1 -1
  67. package/package.json +1 -1
  68. package/dist/chunk-36M6OVUJ.mjs +0 -2
  69. package/dist/chunk-36M6OVUJ.mjs.map +0 -1
  70. package/dist/chunk-7KF5K3L7.cjs +0 -2
  71. package/dist/chunk-7KF5K3L7.cjs.map +0 -1
  72. package/dist/chunk-CWBH7H52.cjs +0 -2
  73. package/dist/chunk-CWBH7H52.cjs.map +0 -1
  74. package/dist/chunk-DXC2RSN5.cjs +0 -3
  75. package/dist/chunk-DXC2RSN5.cjs.map +0 -1
  76. package/dist/chunk-GATJZYTB.mjs +0 -2
  77. package/dist/chunk-GATJZYTB.mjs.map +0 -1
  78. package/dist/chunk-GFH2FEZH.mjs +0 -2
  79. package/dist/chunk-GFH2FEZH.mjs.map +0 -1
  80. package/dist/chunk-HHC5EZ54.cjs +0 -2
  81. package/dist/chunk-HHC5EZ54.cjs.map +0 -1
  82. package/dist/chunk-KSKEFYY7.cjs +0 -2
  83. package/dist/chunk-KSKEFYY7.cjs.map +0 -1
  84. package/dist/chunk-KUUIAKEJ.cjs +0 -2
  85. package/dist/chunk-KUUIAKEJ.cjs.map +0 -1
  86. package/dist/chunk-L2ZN6HEL.mjs +0 -2
  87. package/dist/chunk-L2ZN6HEL.mjs.map +0 -1
  88. package/dist/chunk-NDORREWR.mjs +0 -2
  89. package/dist/chunk-NDORREWR.mjs.map +0 -1
  90. package/dist/chunk-NZ2DIDOD.mjs +0 -2
  91. package/dist/chunk-NZ2DIDOD.mjs.map +0 -1
  92. package/dist/chunk-OHSQ52DW.mjs +0 -6
  93. package/dist/chunk-OHSQ52DW.mjs.map +0 -1
  94. package/dist/chunk-RSKZVOYC.cjs +0 -6
  95. package/dist/chunk-RSKZVOYC.cjs.map +0 -1
  96. package/dist/chunk-S22CPYXJ.mjs +0 -3
  97. package/dist/chunk-S22CPYXJ.mjs.map +0 -1
  98. package/dist/chunk-SHAPFMVP.mjs +0 -2
  99. package/dist/chunk-SHAPFMVP.mjs.map +0 -1
  100. package/dist/chunk-SJRRQZ3R.cjs +0 -2
  101. package/dist/chunk-SJRRQZ3R.cjs.map +0 -1
  102. package/dist/chunk-UM5X2JHB.cjs +0 -2
  103. package/dist/chunk-UM5X2JHB.cjs.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","waterfallConfigSchema"],"mappings":"qCAIO,IAAMA,CAAAA,CAA+C,CAC1D,UAAA,CAAY,CACV,IAAA,CAAM,QAAA,CACN,UAAA,CAAY,CACV,IAAA,CAAM,CACJ,IAAA,CAAM,QACR,CAAA,CACA,IAAA,CAAM,CACJ,IAAA,CAAM,QACR,CAAA,CACA,KAAA,CAAO,CACL,IAAA,CAAM,QACR,CAAA,CACA,QAAA,CAAU,CACR,IAAA,CAAM,QACR,CAAA,CACA,SAAA,CAAW,CACT,IAAA,CAAM,QACR,CAAA,CACA,UAAA,CAAY,CACV,IAAA,CAAM,QACR,CAAA,CACA,SAAA,CAAW,CACT,IAAA,CAAM,QACR,CAAA,CACA,OAAA,CAAS,CACP,IAAA,CAAM,QACR,CAAA,CACA,QAAA,CAAU,CACR,IAAA,CAAM,SACR,CACF,CAAA,CACA,QAAA,CAAU,CACR,MAAA,CACA,MAAA,CACA,OAAA,CACA,UAAA,CACA,WAAA,CACA,aACA,WAAA,CACA,SACF,CAAA,CACA,oBAAA,CAAsB,KACxB,CAAA,CACA,QAAA,CAAU,CACR,IAAA,CAAM,QAAA,CACN,UAAA,CAAY,CACV,KAAA,CAAO,CACL,IAAA,CAAM,QACR,CAAA,CACA,OAAA,CAAS,CACP,IAAA,CAAM,QACR,CAAA,CACA,EAAA,CAAI,CACF,IAAA,CAAM,QACR,CAA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A,CAAiB3D,CAAgB,CAAA,CAEhE8D,CAAAA,CAAaH,CAAAA,CAAS,MAAA,CAAQ3D,CAAgB,CAAA,CAE9C+D,CAAAA,CAAgBJ,CAAAA,CAAS,SAAA,CAAW3D,CAAgB,CAAA,CAEpDgE,CAAAA,CAAkBL,CAAAA,CAAS,WAAA,CAAa3D,CAAgB,CAAA,CAExDiE,CAAAA,CAAgBN,CAAAA,CAAS,SAAA,CAAW3D,CAAgB,CAAA,CAEpDkE,CAAAA,CAAoBP,CAAAA,CAAS,aAAA,CAAe1D,CAAiB,CAAA,CAC7DkE,CAAAA,CAAqBR,CAAAA,CAAS,cAAA,CAAgBzD,CAAkB,CAAA,CAChEkE,CAAAA,CAAwBT,CAAAA,CAAS,iBAAA,CAAmBxD,CAAqB","file":"chunk-5TXYMLBF.mjs","sourcesContent":["// GENERATED by scripts/gen-schema.mjs from src/types.ts and src/{scrum,kanban,waterfall}/config.ts.\n// Do not edit. Run `pnpm schema:gen`; `pnpm schema:check` fails the build when this file is stale.\nimport type { JsonSchema } from \"./types.ts\";\n\nexport const CORE_DEFINITIONS: Record<string, JsonSchema> = {\n Accounting: {\n type: \"object\",\n properties: {\n item: {\n type: \"string\",\n },\n role: {\n type: \"string\",\n },\n model: {\n type: \"string\",\n },\n tokensIn: {\n type: \"number\",\n },\n tokensOut: {\n type: \"number\",\n },\n durationMs: {\n type: \"number\",\n },\n startedAt: {\n type: \"string\",\n },\n endedAt: {\n type: \"string\",\n },\n estimate: {\n type: \"boolean\",\n },\n },\n required: [\n \"item\",\n \"role\",\n \"model\",\n \"tokensIn\",\n \"tokensOut\",\n \"durationMs\",\n \"startedAt\",\n \"endedAt\",\n ],\n additionalProperties: false,\n },\n Baseline: {\n type: \"object\",\n properties: {\n phase: {\n type: \"string\",\n },\n version: {\n type: \"number\",\n },\n at: {\n type: \"string\",\n },\n approvedBy: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n itemSnapshot: {\n type: \"object\",\n additionalProperties: {\n $ref: \"#/definitions/WorkItem\",\n },\n },\n },\n required: [\"phase\", \"version\", \"at\", \"approvedBy\", \"itemSnapshot\"],\n additionalProperties: false,\n },\n Blocker: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n },\n reason: {\n type: \"string\",\n },\n owner: {\n type: \"string\",\n },\n raisedAt: {\n type: \"string\",\n },\n clearedAt: {\n type: \"string\",\n },\n },\n required: [\"id\", \"reason\", \"owner\", \"raisedAt\"],\n additionalProperties: false,\n },\n Budget: {\n type: \"object\",\n properties: {\n tokens: {\n type: \"number\",\n },\n turns: {\n type: \"number\",\n },\n wallclockMs: {\n type: \"number\",\n },\n },\n additionalProperties: false,\n },\n Capability: {\n type: \"string\",\n enum: [\n \"order-backlog\",\n \"define-acceptance\",\n \"facilitate\",\n \"deliver\",\n \"review\",\n \"verify\",\n \"approve-gate\",\n \"manage-flow\",\n \"control-change\",\n \"escalate\",\n ],\n },\n ClassOfService: {\n type: \"string\",\n enum: [\"expedite\", \"fixed-date\", \"standard\", \"intangible\"],\n },\n Event: {\n type: \"object\",\n properties: {\n seq: {\n type: \"number\",\n },\n at: {\n type: \"string\",\n },\n type: {\n type: \"string\",\n },\n by: {\n type: \"string\",\n },\n payload: {},\n },\n required: [\"seq\", \"at\", \"type\", \"by\", \"payload\"],\n additionalProperties: false,\n },\n Evidence: {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n },\n ref: {\n type: \"string\",\n },\n by: {\n type: \"string\",\n },\n at: {\n type: \"string\",\n },\n },\n required: [\"kind\", \"ref\", \"by\", \"at\"],\n additionalProperties: false,\n },\n Gate: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n },\n requires: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/GateRequirement\",\n },\n },\n evidence: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n onFail: {\n anyOf: [\n {\n type: \"object\",\n properties: {\n action: {\n type: \"string\",\n const: \"block\",\n },\n },\n required: [\"action\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n action: {\n type: \"string\",\n const: \"return-to\",\n },\n stage: {\n type: \"string\",\n },\n },\n required: [\"action\", \"stage\"],\n additionalProperties: false,\n },\n ],\n },\n },\n required: [\"id\", \"requires\", \"evidence\", \"onFail\"],\n additionalProperties: false,\n },\n GateRequirement: {\n anyOf: [\n {\n type: \"string\",\n const: \"human\",\n },\n {\n type: \"object\",\n properties: {\n capability: {\n type: \"string\",\n },\n },\n required: [\"capability\"],\n additionalProperties: false,\n },\n ],\n },\n Handoff: {\n type: \"object\",\n properties: {\n item: {\n type: \"string\",\n },\n role: {\n type: \"string\",\n },\n produced: {\n type: \"array\",\n items: {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n },\n ref: {\n type: \"string\",\n },\n },\n required: [\"kind\", \"ref\"],\n additionalProperties: false,\n },\n },\n notes: {\n type: \"string\",\n },\n do_not: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n open_questions: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n verdict: {\n $ref: \"#/definitions/Verdict\",\n },\n follow_ups: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/NewItem\",\n },\n },\n lessons: {\n type: \"array\",\n items: {\n type: \"object\",\n properties: {\n text: {\n type: \"string\",\n },\n scope: {\n type: \"string\",\n enum: [\"policy\", \"skill\", \"memory\", \"spec\", \"review\"],\n },\n },\n required: [\"text\", \"scope\"],\n additionalProperties: false,\n },\n },\n },\n required: [\"item\", \"role\", \"produced\", \"notes\", \"do_not\", \"open_questions\"],\n additionalProperties: false,\n },\n ImpactAnalysis: {\n type: \"object\",\n properties: {\n summary: {\n type: \"string\",\n },\n reopen: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n weight: {\n type: \"number\",\n },\n },\n required: [\"summary\", \"reopen\", \"weight\"],\n additionalProperties: false,\n },\n ItemPatch: {\n type: \"object\",\n properties: {\n type: {\n $ref: \"#/definitions/ItemType\",\n },\n title: {\n type: \"string\",\n },\n description: {\n type: \"string\",\n },\n dependsOn: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n priority: {\n type: \"number\",\n },\n weight: {\n type: \"number\",\n },\n deadline: {\n type: \"string\",\n },\n classOfService: {\n $ref: \"#/definitions/ClassOfService\",\n },\n role: {\n type: \"string\",\n },\n parent: {\n type: \"string\",\n },\n acceptance: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n iteration: {\n type: \"string\",\n },\n traces: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n tags: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n affects: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n phase: {\n type: \"string\",\n },\n impactAnalysis: {\n $ref: \"#/definitions/ImpactAnalysis\",\n },\n },\n additionalProperties: false,\n },\n ItemStatus: {\n type: \"string\",\n enum: [\"todo\", \"in_progress\", \"blocked\", \"review\", \"awaiting_human\", \"done\", \"dropped\"],\n },\n ItemType: {\n type: \"string\",\n enum: [\"epic\", \"story\", \"task\", \"bug\", \"change-request\", \"deliverable\", \"question\"],\n },\n Iteration: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n },\n goal: {\n type: \"string\",\n },\n budget: {\n $ref: \"#/definitions/Budget\",\n },\n spent: {\n $ref: \"#/definitions/Spent\",\n },\n startedAt: {\n type: \"string\",\n },\n endedAt: {\n type: \"string\",\n },\n committed: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n carryover: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n outcome: {\n type: \"string\",\n enum: [\"completed\", \"cancelled\"],\n },\n closing: {\n type: \"boolean\",\n },\n },\n required: [\"id\", \"goal\", \"budget\", \"spent\", \"startedAt\", \"committed\", \"carryover\"],\n additionalProperties: false,\n },\n Lesson: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n },\n at: {\n type: \"string\",\n },\n text: {\n type: \"string\",\n },\n scope: {\n type: \"string\",\n enum: [\"policy\", \"skill\", \"memory\", \"spec\", \"review\"],\n },\n status: {\n type: \"string\",\n enum: [\"raised\", \"adopted\", \"dismissed\"],\n },\n from: {\n type: \"string\",\n },\n item: {\n type: \"string\",\n },\n suggestedChange: {\n $ref: \"#/definitions/LessonChange\",\n },\n },\n required: [\"id\", \"at\", \"text\", \"scope\", \"status\"],\n additionalProperties: false,\n },\n LessonChange: {\n anyOf: [\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"agreement\",\n },\n text: {\n type: \"string\",\n },\n replaces: {\n type: \"string\",\n },\n },\n required: [\"kind\", \"text\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"dod\",\n },\n policy: {\n $ref: \"#/definitions/Policy\",\n },\n },\n required: [\"kind\", \"policy\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"backlog\",\n },\n item: {\n $ref: \"#/definitions/NewItem\",\n },\n },\n required: [\"kind\", \"item\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"skill\",\n },\n note: {\n type: \"string\",\n },\n },\n required: [\"kind\", \"note\"],\n additionalProperties: false,\n },\n ],\n },\n MethodologyName: {\n type: \"string\",\n enum: [\"scrum\", \"kanban\", \"waterfall\"],\n },\n ModelTier: {\n type: \"string\",\n enum: [\"small\", \"medium\", \"large\"],\n },\n NewItem: {\n type: \"object\",\n additionalProperties: false,\n properties: {\n stage: {\n type: \"string\",\n },\n type: {\n $ref: \"#/definitions/ItemType\",\n },\n description: {\n type: \"string\",\n },\n dependsOn: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n priority: {\n type: \"number\",\n },\n weight: {\n type: \"number\",\n },\n deadline: {\n type: \"string\",\n },\n classOfService: {\n $ref: \"#/definitions/ClassOfService\",\n },\n role: {\n type: \"string\",\n },\n parent: {\n type: \"string\",\n },\n acceptance: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n iteration: {\n type: \"string\",\n },\n traces: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n tags: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n affects: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n phase: {\n type: \"string\",\n },\n impactAnalysis: {\n $ref: \"#/definitions/ImpactAnalysis\",\n },\n id: {\n type: \"string\",\n },\n title: {\n type: \"string\",\n },\n },\n required: [\"id\", \"title\"],\n },\n PendingHuman: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n },\n kind: {\n type: \"string\",\n enum: [\"gate\", \"decision\"],\n },\n item: {\n type: \"string\",\n },\n gate: {\n type: \"string\",\n },\n question: {\n type: \"string\",\n },\n raisedAt: {\n type: \"string\",\n },\n },\n required: [\"id\", \"kind\", \"question\", \"raisedAt\"],\n additionalProperties: false,\n },\n Phase: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n },\n name: {\n type: \"string\",\n },\n deliverables: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n gate: {\n $ref: \"#/definitions/Gate\",\n },\n status: {\n type: \"string\",\n enum: [\"pending\", \"open\", \"baselined\", \"reopened\"],\n },\n budget: {\n $ref: \"#/definitions/Budget\",\n },\n produced: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/Produced\",\n },\n },\n },\n required: [\"id\", \"name\", \"deliverables\", \"gate\", \"status\"],\n additionalProperties: false,\n },\n Policy: {\n anyOf: [\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"evidence\",\n },\n evidenceKind: {\n type: \"string\",\n },\n },\n required: [\"kind\", \"evidenceKind\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"acceptance-written\",\n },\n },\n required: [\"kind\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"estimate-present\",\n },\n },\n required: [\"kind\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"no-open-blockers\",\n },\n },\n required: [\"kind\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"dependencies-done\",\n },\n },\n required: [\"kind\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"custom\",\n },\n id: {\n type: \"string\",\n },\n description: {\n type: \"string\",\n },\n },\n required: [\"kind\", \"id\", \"description\"],\n additionalProperties: false,\n },\n ],\n },\n Produced: {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n },\n ref: {\n type: \"string\",\n },\n by: {\n type: \"string\",\n },\n at: {\n type: \"string\",\n },\n },\n required: [\"kind\", \"ref\", \"by\", \"at\"],\n additionalProperties: false,\n },\n Role: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n },\n name: {\n type: \"string\",\n },\n modelTier: {\n $ref: \"#/definitions/ModelTier\",\n },\n resourceClass: {\n type: \"string\",\n },\n maxConcurrent: {\n type: \"number\",\n },\n capabilities: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/Capability\",\n },\n },\n canApprove: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n inputs: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n outputs: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n do_not: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n constraints: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n },\n required: [\n \"id\",\n \"name\",\n \"modelTier\",\n \"capabilities\",\n \"canApprove\",\n \"inputs\",\n \"outputs\",\n \"do_not\",\n ],\n additionalProperties: false,\n },\n Spent: {\n type: \"object\",\n properties: {\n tokens: {\n type: \"number\",\n },\n turns: {\n type: \"number\",\n },\n wallclockMs: {\n type: \"number\",\n },\n },\n required: [\"tokens\", \"turns\", \"wallclockMs\"],\n additionalProperties: false,\n },\n Stage: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n },\n name: {\n type: \"string\",\n },\n wipLimit: {\n type: \"number\",\n },\n entryPolicy: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/Policy\",\n },\n },\n exitPolicy: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/Policy\",\n },\n },\n gate: {\n $ref: \"#/definitions/Gate\",\n },\n commitmentPoint: {\n type: \"boolean\",\n },\n deliveryPoint: {\n type: \"boolean\",\n },\n review: {\n type: \"boolean\",\n },\n },\n required: [\"id\", \"name\", \"entryPolicy\", \"exitPolicy\"],\n additionalProperties: false,\n },\n Transition: {\n type: \"object\",\n properties: {\n from: {\n type: \"object\",\n properties: {\n stage: {\n type: \"string\",\n },\n status: {\n $ref: \"#/definitions/ItemStatus\",\n },\n },\n required: [\"stage\", \"status\"],\n additionalProperties: false,\n },\n to: {\n type: \"object\",\n properties: {\n stage: {\n type: \"string\",\n },\n status: {\n $ref: \"#/definitions/ItemStatus\",\n },\n },\n required: [\"stage\", \"status\"],\n additionalProperties: false,\n },\n at: {\n type: \"string\",\n },\n by: {\n type: \"string\",\n },\n },\n required: [\"from\", \"to\", \"at\", \"by\"],\n additionalProperties: false,\n },\n Verdict: {\n type: \"string\",\n enum: [\"done\", \"blocked\", \"needs-review\", \"rework\", \"escalate\"],\n },\n WorkItem: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n },\n type: {\n $ref: \"#/definitions/ItemType\",\n },\n title: {\n type: \"string\",\n },\n description: {\n type: \"string\",\n },\n dependsOn: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n priority: {\n type: \"number\",\n },\n weight: {\n type: \"number\",\n },\n deadline: {\n type: \"string\",\n },\n classOfService: {\n $ref: \"#/definitions/ClassOfService\",\n },\n stage: {\n type: \"string\",\n },\n status: {\n $ref: \"#/definitions/ItemStatus\",\n },\n role: {\n type: \"string\",\n },\n parent: {\n type: \"string\",\n },\n acceptance: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n evidence: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/Evidence\",\n },\n },\n blockers: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/Blocker\",\n },\n },\n transitions: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/Transition\",\n },\n },\n iteration: {\n type: \"string\",\n },\n traces: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n tags: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n affects: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n phase: {\n type: \"string\",\n },\n impactAnalysis: {\n $ref: \"#/definitions/ImpactAnalysis\",\n },\n },\n required: [\n \"id\",\n \"type\",\n \"title\",\n \"dependsOn\",\n \"stage\",\n \"status\",\n \"acceptance\",\n \"evidence\",\n \"blockers\",\n \"transitions\",\n ],\n additionalProperties: false,\n },\n WorkflowState: {\n type: \"object\",\n properties: {\n version: {\n type: \"number\",\n const: 1,\n },\n methodology: {\n $ref: \"#/definitions/MethodologyName\",\n },\n config: {},\n items: {\n type: \"object\",\n additionalProperties: {\n $ref: \"#/definitions/WorkItem\",\n },\n },\n stages: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/Stage\",\n },\n },\n roles: {\n type: \"object\",\n additionalProperties: {\n $ref: \"#/definitions/Role\",\n },\n },\n iterations: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/Iteration\",\n },\n },\n phases: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/Phase\",\n },\n },\n baseline: {\n $ref: \"#/definitions/Baseline\",\n },\n baselines: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/Baseline\",\n },\n },\n events: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/Event\",\n },\n },\n accounting: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/Accounting\",\n },\n },\n pending: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/PendingHuman\",\n },\n },\n lessons: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/Lesson\",\n },\n },\n agreements: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n },\n required: [\n \"version\",\n \"methodology\",\n \"config\",\n \"items\",\n \"stages\",\n \"roles\",\n \"iterations\",\n \"events\",\n \"accounting\",\n \"pending\",\n \"lessons\",\n \"agreements\",\n ],\n additionalProperties: false,\n },\n};\n\nexport const SCRUM_DEFINITIONS: Record<string, JsonSchema> = {\n Budget: {\n type: \"object\",\n properties: {\n tokens: {\n type: \"number\",\n },\n turns: {\n type: \"number\",\n },\n wallclockMs: {\n type: \"number\",\n },\n },\n additionalProperties: false,\n },\n EstimateMode: {\n type: \"string\",\n enum: [\"per-weight\", \"per-call\"],\n },\n Policy: {\n anyOf: [\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"evidence\",\n },\n evidenceKind: {\n type: \"string\",\n },\n },\n required: [\"kind\", \"evidenceKind\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"acceptance-written\",\n },\n },\n required: [\"kind\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"estimate-present\",\n },\n },\n required: [\"kind\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"no-open-blockers\",\n },\n },\n required: [\"kind\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"dependencies-done\",\n },\n },\n required: [\"kind\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"custom\",\n },\n id: {\n type: \"string\",\n },\n description: {\n type: \"string\",\n },\n },\n required: [\"kind\", \"id\", \"description\"],\n additionalProperties: false,\n },\n ],\n },\n ScrumConfig: {\n type: \"object\",\n properties: {\n sprintBudget: {\n $ref: \"#/definitions/Budget\",\n },\n productGoal: {\n type: \"string\",\n },\n definitionOfDone: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/Policy\",\n },\n },\n refinementSharePct: {\n type: \"number\",\n },\n allowMidSprintAdd: {\n type: \"string\",\n enum: [\"never\", \"po-only\", \"any\"],\n },\n inProgressWipLimit: {\n type: \"number\",\n },\n autoClose: {\n type: \"boolean\",\n },\n estimateMode: {\n $ref: \"#/definitions/EstimateMode\",\n },\n fallbackTokensPerWeight: {\n type: \"number\",\n },\n },\n required: [\n \"sprintBudget\",\n \"productGoal\",\n \"definitionOfDone\",\n \"refinementSharePct\",\n \"allowMidSprintAdd\",\n ],\n additionalProperties: false,\n },\n};\n\nexport const KANBAN_DEFINITIONS: Record<string, JsonSchema> = {\n ClassConfig: {\n type: \"object\",\n properties: {\n wipBypass: {\n type: \"number\",\n },\n sle: {\n $ref: \"#/definitions/ServiceLevel\",\n },\n },\n additionalProperties: false,\n },\n KanbanColumn: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n },\n name: {\n type: \"string\",\n },\n wipLimit: {\n type: \"number\",\n },\n policies: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/Policy\",\n },\n },\n commitmentPoint: {\n type: \"boolean\",\n },\n deliveryPoint: {\n type: \"boolean\",\n },\n review: {\n type: \"boolean\",\n },\n },\n required: [\"id\", \"name\", \"policies\"],\n additionalProperties: false,\n },\n KanbanConfig: {\n type: \"object\",\n properties: {\n columns: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/KanbanColumn\",\n },\n },\n classesOfService: {\n type: \"object\",\n properties: {\n expedite: {\n $ref: \"#/definitions/ClassConfig\",\n },\n \"fixed-date\": {\n $ref: \"#/definitions/ClassConfig\",\n },\n standard: {\n $ref: \"#/definitions/ClassConfig\",\n },\n intangible: {\n $ref: \"#/definitions/ClassConfig\",\n },\n },\n additionalProperties: false,\n },\n fairness: {\n type: \"object\",\n properties: {\n aging: {\n type: \"boolean\",\n },\n maxDeferralRounds: {\n type: \"number\",\n },\n },\n required: [\"aging\", \"maxDeferralRounds\"],\n additionalProperties: false,\n },\n cadences: {\n type: \"object\",\n properties: {\n replenishment: {\n type: \"object\",\n properties: {\n everyTurns: {\n type: \"number\",\n },\n },\n additionalProperties: false,\n },\n \"delivery-planning\": {\n type: \"object\",\n properties: {\n everyTurns: {\n type: \"number\",\n },\n },\n additionalProperties: false,\n },\n \"service-delivery-review\": {\n type: \"object\",\n properties: {\n everyTurns: {\n type: \"number\",\n },\n },\n additionalProperties: false,\n },\n \"operations-review\": {\n type: \"object\",\n properties: {\n everyTurns: {\n type: \"number\",\n },\n },\n additionalProperties: false,\n },\n \"risk-review\": {\n type: \"object\",\n properties: {\n everyTurns: {\n type: \"number\",\n },\n },\n additionalProperties: false,\n },\n \"strategy-review\": {\n type: \"object\",\n properties: {\n everyTurns: {\n type: \"number\",\n },\n },\n additionalProperties: false,\n },\n },\n additionalProperties: false,\n },\n throughputWindowMs: {\n type: \"number\",\n },\n maxExpedite: {\n type: \"number\",\n },\n },\n required: [\n \"columns\",\n \"classesOfService\",\n \"fairness\",\n \"cadences\",\n \"throughputWindowMs\",\n \"maxExpedite\",\n ],\n additionalProperties: false,\n },\n Policy: {\n anyOf: [\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"evidence\",\n },\n evidenceKind: {\n type: \"string\",\n },\n },\n required: [\"kind\", \"evidenceKind\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"acceptance-written\",\n },\n },\n required: [\"kind\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"estimate-present\",\n },\n },\n required: [\"kind\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"no-open-blockers\",\n },\n },\n required: [\"kind\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"dependencies-done\",\n },\n },\n required: [\"kind\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n kind: {\n type: \"string\",\n const: \"custom\",\n },\n id: {\n type: \"string\",\n },\n description: {\n type: \"string\",\n },\n },\n required: [\"kind\", \"id\", \"description\"],\n additionalProperties: false,\n },\n ],\n },\n ServiceLevel: {\n type: \"object\",\n properties: {\n percentile: {\n type: \"number\",\n },\n targetMs: {\n type: \"number\",\n },\n },\n required: [\"percentile\", \"targetMs\"],\n additionalProperties: false,\n },\n};\n\nexport const WATERFALL_DEFINITIONS: Record<string, JsonSchema> = {\n Budget: {\n type: \"object\",\n properties: {\n tokens: {\n type: \"number\",\n },\n turns: {\n type: \"number\",\n },\n wallclockMs: {\n type: \"number\",\n },\n },\n additionalProperties: false,\n },\n Gate: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n },\n requires: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/GateRequirement\",\n },\n },\n evidence: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n onFail: {\n anyOf: [\n {\n type: \"object\",\n properties: {\n action: {\n type: \"string\",\n const: \"block\",\n },\n },\n required: [\"action\"],\n additionalProperties: false,\n },\n {\n type: \"object\",\n properties: {\n action: {\n type: \"string\",\n const: \"return-to\",\n },\n stage: {\n type: \"string\",\n },\n },\n required: [\"action\", \"stage\"],\n additionalProperties: false,\n },\n ],\n },\n },\n required: [\"id\", \"requires\", \"evidence\", \"onFail\"],\n additionalProperties: false,\n },\n GateRequirement: {\n anyOf: [\n {\n type: \"string\",\n const: \"human\",\n },\n {\n type: \"object\",\n properties: {\n capability: {\n type: \"string\",\n },\n },\n required: [\"capability\"],\n additionalProperties: false,\n },\n ],\n },\n WaterfallConfig: {\n type: \"object\",\n properties: {\n phases: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/WaterfallPhaseConfig\",\n },\n },\n changeControl: {\n type: \"object\",\n properties: {\n requiresImpactAnalysis: {\n type: \"boolean\",\n },\n approvers: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/GateRequirement\",\n },\n },\n },\n required: [\"requiresImpactAnalysis\", \"approvers\"],\n additionalProperties: false,\n },\n traceability: {\n type: \"object\",\n properties: {\n from: {\n type: \"string\",\n },\n to: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n },\n required: [\"from\", \"to\"],\n additionalProperties: false,\n },\n humanGates: {\n anyOf: [\n {\n type: \"string\",\n const: \"all\",\n },\n {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n ],\n },\n fallbackTokensPerWeight: {\n type: \"number\",\n },\n },\n required: [\"phases\", \"changeControl\", \"traceability\", \"humanGates\"],\n additionalProperties: false,\n },\n WaterfallPhaseConfig: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n },\n name: {\n type: \"string\",\n },\n deliverables: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n gate: {\n $ref: \"#/definitions/Gate\",\n },\n budget: {\n $ref: \"#/definitions/Budget\",\n },\n deliverBy: {\n type: \"string\",\n },\n },\n required: [\"id\", \"name\", \"deliverables\", \"gate\"],\n additionalProperties: false,\n },\n};\n","import { fail } from \"../errors.ts\";\nimport type { JsonSchema, SchemaError } from \"./types.ts\";\n\nconst DEFS = \"#/definitions/\";\n\nfunction kindOf(v: unknown): string {\n if (v === null) return \"null\";\n if (Array.isArray(v)) return \"array\";\n return typeof v;\n}\nfunction isType(t: string, v: unknown): boolean {\n if (t === \"integer\") return typeof v === \"number\" && Number.isInteger(v);\n return kindOf(v) === t;\n}\nfunction show(v: unknown): string {\n const s = JSON.stringify(v);\n if (s === undefined) return String(v);\n return s.length > 60 ? `${s.slice(0, 57)}...` : s;\n}\n/** JSON-pointer escaping for one key. */\nfunction esc(key: string): string {\n return key.replace(/~/g, \"~0\").replace(/\\//g, \"~1\");\n}\nfunction same(a: unknown, b: unknown): boolean {\n return JSON.stringify(a) === JSON.stringify(b);\n}\nfunction err(\n path: string,\n keyword: string,\n message: string,\n expected: string,\n found: string,\n): SchemaError {\n return { path: path === \"\" ? \"/\" : path, keyword, message, expected, found };\n}\n\nfunction resolve(ref: string, root: JsonSchema): JsonSchema {\n if (!ref.startsWith(DEFS))\n fail(\n \"invalid-input\",\n `schema $ref ${JSON.stringify(ref)} is not #/definitions/<name>`,\n \"regenerate the schema with pnpm schema:gen\",\n );\n const name = ref.slice(DEFS.length);\n const def =\n root.definitions && Object.hasOwn(root.definitions, name) ? root.definitions[name] : undefined;\n if (!def)\n fail(\n \"invalid-input\",\n `schema $ref ${JSON.stringify(ref)} names no definition`,\n \"regenerate the schema with pnpm schema:gen\",\n );\n return def;\n}\n\n/**\n * Misfit of one anyOf branch (lower is a better fit): a `type` error at the branch's own path (the value is the\n * wrong kind entirely) weighs 1000, a `const` mismatch (a discriminator) 100, anything else 1.\n */\nfunction rank(errors: SchemaError[], branchPath: string): number {\n const own = branchPath === \"\" ? \"/\" : branchPath;\n return errors.reduce(\n (n, e) => n + (e.keyword === \"type\" && e.path === own ? 1000 : e.keyword === \"const\" ? 100 : 1),\n 0,\n );\n}\n\n/** When every failed branch has a `const` error at one pointer (the discriminator), report that once as an enum. */\nfunction collapse(branches: SchemaError[][]): SchemaError | undefined {\n const first = branches[0]?.filter((e) => e.keyword === \"const\") ?? [];\n for (const candidate of first) {\n const consts = branches.map((b) =>\n b.find((e) => e.keyword === \"const\" && e.path === candidate.path),\n );\n if (consts.some((c) => c === undefined)) continue;\n const expected = [...new Set(consts.map((c) => c?.expected))].join(\" | \");\n return {\n path: candidate.path,\n keyword: \"enum\",\n message: `expected one of ${expected}`,\n expected,\n found: candidate.found,\n };\n }\n return undefined;\n}\n\n/** Validate `value` against `schema` (a document: `$ref`s resolve against its `definitions`). Returns every error found. */\nexport function validate(schema: JsonSchema, value: unknown): SchemaError[] {\n return walk(schema, value, schema, \"\");\n}\n\nfunction walk(schema: JsonSchema, value: unknown, root: JsonSchema, path: string): SchemaError[] {\n if (schema.$ref !== undefined) return walk(resolve(schema.$ref, root), value, root, path);\n const out: SchemaError[] = [];\n if (schema.type !== undefined) {\n const types = Array.isArray(schema.type) ? schema.type : [schema.type];\n if (!types.some((t) => isType(t, value))) {\n const expected = types.join(\" | \");\n return [\n err(path, \"type\", `expected ${expected}, got ${kindOf(value)}`, expected, show(value)),\n ];\n }\n }\n if (schema.const !== undefined && !same(value, schema.const))\n out.push(err(path, \"const\", `expected ${show(schema.const)}`, show(schema.const), show(value)));\n if (schema.enum !== undefined && !schema.enum.some((e) => same(e, value))) {\n const expected = schema.enum.map(show).join(\" | \");\n out.push(err(path, \"enum\", `expected one of ${expected}`, expected, show(value)));\n }\n if (typeof value === \"number\") {\n if (schema.minimum !== undefined && value < schema.minimum)\n out.push(\n err(path, \"minimum\", `expected >= ${schema.minimum}`, `>= ${schema.minimum}`, show(value)),\n );\n if (schema.maximum !== undefined && value > schema.maximum)\n out.push(\n err(path, \"maximum\", `expected <= ${schema.maximum}`, `<= ${schema.maximum}`, show(value)),\n );\n }\n if (typeof value === \"string\") {\n if (schema.minLength !== undefined && value.length < schema.minLength)\n out.push(\n err(\n path,\n \"minLength\",\n `expected at least ${schema.minLength} characters`,\n `length >= ${schema.minLength}`,\n show(value),\n ),\n );\n if (schema.pattern !== undefined && !new RegExp(schema.pattern, \"u\").test(value))\n out.push(\n err(\n path,\n \"pattern\",\n `expected to match /${schema.pattern}/`,\n `/${schema.pattern}/`,\n show(value),\n ),\n );\n }\n if (Array.isArray(value) && schema.items !== undefined) {\n const items = schema.items;\n value.forEach((v, i) => out.push(...walk(items, v, root, `${path}/${i}`)));\n }\n if (kindOf(value) === \"object\") {\n const obj = value as Record<string, unknown>;\n for (const [key, v] of Object.entries(obj)) {\n const prop =\n schema.properties && Object.hasOwn(schema.properties, key)\n ? schema.properties[key]\n : undefined;\n const at = `${path}/${esc(key)}`;\n if (prop) out.push(...walk(prop, v, root, at));\n else if (schema.additionalProperties === false) {\n const known = Object.keys(schema.properties ?? {}).join(\", \");\n out.push(\n err(\n at,\n \"additionalProperties\",\n `unknown property ${JSON.stringify(key)}`,\n known ? `one of ${known}` : \"no properties\",\n key,\n ),\n );\n } else if (typeof schema.additionalProperties === \"object\")\n out.push(...walk(schema.additionalProperties, v, root, at));\n }\n for (const key of schema.required ?? [])\n if (!Object.hasOwn(obj, key))\n out.push(\n err(\n `${path}/${esc(key)}`,\n \"required\",\n `missing required property ${JSON.stringify(key)}`,\n \"present\",\n \"absent\",\n ),\n );\n }\n if (schema.anyOf !== undefined) {\n let best: SchemaError[] | undefined;\n const failed: SchemaError[][] = [];\n for (const branch of schema.anyOf) {\n const errors = walk(branch, value, root, path);\n if (errors.length === 0) {\n best = [];\n break;\n }\n failed.push(errors);\n if (best === undefined || rank(errors, path) < rank(best, path)) best = errors;\n }\n const merged = best && best.length > 0 ? collapse(failed) : undefined;\n if (merged) out.push(merged);\n else if (best) out.push(...best);\n }\n return out;\n}\n\n/** Throw WorkflowError(\"invalid-input\") describing the first problem when `value` does not match `schema`. */\nexport function assertValid(schema: JsonSchema, value: unknown, what: string): void {\n const errors = validate(schema, value);\n const first = errors[0];\n if (!first) return;\n const more = errors.length > 1 ? ` (+${errors.length - 1} more)` : \"\";\n fail(\n \"invalid-input\",\n `${what} does not match its schema: ${first.path} ${first.message}${more}`,\n `fix ${what} at ${first.path}: expected ${first.expected}, found ${first.found}`,\n );\n}\n","import {\n CORE_DEFINITIONS,\n KANBAN_DEFINITIONS,\n SCRUM_DEFINITIONS,\n WATERFALL_DEFINITIONS,\n} from \"./generated.ts\";\nimport type { JsonSchema, JsonSchemaDocument } from \"./types.ts\";\n\nexport const DRAFT_07 = \"http://json-schema.org/draft-07/schema#\";\n\nfunction document(name: string, definitions: Record<string, JsonSchema>): JsonSchemaDocument {\n return { $schema: DRAFT_07, $ref: `#/definitions/${name}`, definitions };\n}\n\n/** `.workflow/state.json` */\nexport const workflowStateSchema = document(\"WorkflowState\", CORE_DEFINITIONS);\n/** a role manifest (`.workflow/roles/*.json`, `exwf role add`) */\nexport const roleSchema = document(\"Role\", CORE_DEFINITIONS);\n/** `exwf add <item.json>` */\nexport const newItemSchema = document(\"NewItem\", CORE_DEFINITIONS);\n/** `exwf edit <id> <patch.json>` */\nexport const itemPatchSchema = document(\"ItemPatch\", CORE_DEFINITIONS);\n/** `exwf complete <id> <handoff.json>` */\nexport const handoffSchema = document(\"Handoff\", CORE_DEFINITIONS);\n/** `exwf init scrum --config` / the scrum-master policy.json */\nexport const scrumConfigSchema = document(\"ScrumConfig\", SCRUM_DEFINITIONS);\nexport const kanbanConfigSchema = document(\"KanbanConfig\", KANBAN_DEFINITIONS);\nexport const waterfallConfigSchema = document(\"WaterfallConfig\", WATERFALL_DEFINITIONS);\n\nexport { validate, assertValid } from \"./validate.ts\";\nexport type { JsonSchema, JsonSchemaDocument, SchemaError } from \"./types.ts\";\n"]}
@@ -0,0 +1,6 @@
1
+ import {b as b$1,d,e}from'./chunk-5TXYMLBF.mjs';import {b}from'./chunk-2FRRD6A3.mjs';import {mkdir,open,stat,unlink,readFile,readdir,writeFile,rename}from'fs/promises';import {randomBytes}from'crypto';import n from'path';var m=".workflow";function v(t){return n.join(t,m,"state.json")}async function y(t,e){let i=`${t}.tmp-${process.pid}-${randomBytes(4).toString("hex")}`;try{await mkdir(n.dirname(t),{recursive:!0}),await writeFile(i,e,"utf8"),await rename(i,t);}catch(r){await unlink(i).catch(()=>{}),b("invalid-input",`cannot write ${t}: ${r.message}`,"check the directory exists and is writable");}}async function T(t,e,i={}){let{retries:r=40,intervalMs:w=50,staleMs:u=6e4}=i,s=n.join(t,m,"state.lock");await mkdir(n.dirname(s),{recursive:true});let d=false;for(let f=0;!d;f++)try{let a=await open(s,"wx");await a.writeFile(`${process.pid} ${new Date().toISOString()}
2
+ `),await a.close(),d=!0;}catch(a){if(a.code!=="EEXIST")throw a;let o=await stat(s).catch(()=>{});if(o&&Date.now()-o.mtimeMs>u){let l=await stat(s).catch(()=>{});l&&l.ino===o.ino&&l.mtimeMs===o.mtimeMs&&await unlink(s).catch(()=>{});continue}f>=r&&b("invalid-input","another exwf command holds .workflow/state.lock","retry, or delete the file if no exwf process is running"),await new Promise(l=>setTimeout(l,w));}try{return await e()}finally{await unlink(s).catch(()=>{});}}async function B(t,e){let i=JSON.stringify(e,null,2)+`
3
+ `;b$1(d,JSON.parse(i),v(t)),await y(v(t),i);}async function F(t){let e$1=v(t),i;try{i=await readFile(e$1,"utf8");}catch{b("invalid-input",`no workflow state at ${e$1}`,"run `exwf init <scrum|kanban|waterfall> --config <file>` in this directory first");}let r;try{r=JSON.parse(i);}catch(f){b("invalid-input",`${e$1} is not valid JSON: ${f.message}`,"restore it from git or re-run exwf init");}(typeof r!="object"||r===null||Array.isArray(r))&&b("invalid-input",`${e$1} does not contain a workflow state object`,"restore it from git or re-run exwf init");let w=r;w.version!==1&&b("state-version",`${e$1} has schema version ${String(w.version)}; this ex-workflow reads version 1`,"upgrade ex-workflow, or run the migration this version documents in its changelog"),b$1(d,r,e$1);let u=n.join(t,m,"roles"),s=[];try{s=(await readdir(u)).filter(f=>f.endsWith(".json"));}catch{}let d$1={...w.roles};for(let f of s){let a=n.join(u,f),o;try{o=JSON.parse(await readFile(a,"utf8"));}catch(l){b("invalid-input",`role manifest ${a} is not valid JSON: ${l.message}`,"fix or delete that manifest");}b$1(e,o,`role manifest ${a}`),d$1[o.id]||(d$1[o.id]=o);}return {...w,roles:d$1}}function j(t,e){return n.resolve(e).startsWith(n.resolve(t,m)+n.sep)||b("invalid-input",`${e} resolves outside ${m}/`,"use a plain item id (letters, digits, - _ .)"),e}async function L(t,e){let i=j(t,n.join(t,m,"briefs",`${e.item.id}.json`));return await y(i,JSON.stringify(e,null,2)+`
4
+ `),i}async function A(t,e,i){let r=j(t,n.join(t,m,"handoffs",`${e.item}-${i}.json`));return await y(r,JSON.stringify(e,null,2)+`
5
+ `),r}export{m as a,v as b,T as c,B as d,F as e,L as f,A as g};//# sourceMappingURL=chunk-7IG6EQI4.mjs.map
6
+ //# sourceMappingURL=chunk-7IG6EQI4.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/adapters/file.ts"],"names":["WORKFLOW_DIR","statePath","root","path","writeAtomic","file","content","tmp","randomBytes","mkdir","writeFile","rename","e","unlink","fail","withStateLock","fn","opts","retries","intervalMs","staleMs","lock","held","attempt","fh","open","snap","stat","now","resolve","saveState","state","json","assertValid","workflowStateSchema","loadState","raw","readFile","parsed","rolesDir","manifests","readdir","roles","manifestPath","role","roleSchema","inWorkflowDir","saveBrief","brief","saveHandoff","handoff","seq"],"mappings":"6NAOO,IAAMA,EAAe,YAErB,SAASC,EAAUC,CAAAA,CAAsB,CAC9C,OAAOC,CAAAA,CAAK,KAAKD,CAAAA,CAAMF,CAAAA,CAAc,YAAY,CACnD,CAEA,eAAeI,CAAAA,CAAYC,CAAAA,CAAcC,CAAAA,CAAgC,CACvE,IAAMC,CAAAA,CAAM,CAAA,EAAGF,CAAI,CAAA,KAAA,EAAQ,OAAA,CAAQ,GAAG,CAAA,CAAA,EAAIG,WAAAA,CAAY,CAAC,CAAA,CAAE,SAAS,KAAK,CAAC,GACxE,GAAI,CACF,MAAMC,KAAAA,CAAMN,CAAAA,CAAK,OAAA,CAAQE,CAAI,EAAG,CAAE,SAAA,CAAW,EAAK,CAAC,CAAA,CACnD,MAAMK,SAAAA,CAAUH,CAAAA,CAAKD,EAAS,MAAM,CAAA,CACpC,MAAMK,MAAAA,CAAOJ,CAAAA,CAAKF,CAAI,EACxB,CAAA,MAASO,EAAG,CAEV,MAAMC,MAAAA,CAAON,CAAG,EAAE,KAAA,CAAM,IAAG,EAAY,CAAA,CACvCO,CAAAA,CACE,gBACA,CAAA,aAAA,EAAgBT,CAAI,CAAA,EAAA,EAAMO,CAAAA,CAAY,OAAO,CAAA,CAAA,CAC7C,4CACF,EACF,CACF,CASA,eAAsBG,CAAAA,CACpBb,CAAAA,CACAc,CAAAA,CACAC,CAAAA,CAAoB,EAAC,CACT,CACZ,GAAM,CAAE,OAAA,CAAAC,EAAU,EAAA,CAAI,UAAA,CAAAC,CAAAA,CAAa,EAAA,CAAI,QAAAC,CAAAA,CAAU,GAAO,EAAIH,CAAAA,CACtDI,CAAAA,CAAOlB,EAAK,IAAA,CAAKD,CAAAA,CAAMF,C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ile } from \"node:fs/promises\";\nimport { randomBytes } from \"node:crypto\";\nimport path from \"node:path\";\nimport { fail } from \"../errors.ts\";\nimport { assertValid, roleSchema, workflowStateSchema } from \"../schema/index.ts\";\nimport type { Brief, Handoff, Role, WorkflowState } from \"../types.ts\";\n\nexport const WORKFLOW_DIR = \".workflow\";\n\nexport function statePath(root: string): string {\n return path.join(root, WORKFLOW_DIR, \"state.json\");\n}\n\nasync function writeAtomic(file: string, content: string): Promise<void> {\n const tmp = `${file}.tmp-${process.pid}-${randomBytes(4).toString(\"hex\")}`;\n try {\n await mkdir(path.dirname(file), { recursive: true });\n await writeFile(tmp, content, \"utf8\");\n await rename(tmp, file);\n } catch (e) {\n // best effort: remove the temp file if it was created; ignore failure\n await unlink(tmp).catch(() => undefined);\n fail(\n \"invalid-input\",\n `cannot write ${file}: ${(e as Error).message}`,\n \"check the directory exists and is writable\",\n );\n }\n}\n\nexport interface LockOptions {\n retries?: number;\n intervalMs?: number;\n staleMs?: number;\n}\n\n/** Run `fn` while holding `.workflow/state.lock`, so concurrent exwf commands cannot lose each other's updates. */\nexport async function withStateLock<T>(\n root: string,\n fn: () => Promise<T>,\n opts: LockOptions = {},\n): Promise<T> {\n const { retries = 40, intervalMs = 50, staleMs = 60_000 } = opts;\n const lock = path.join(root, WORKFLOW_DIR, \"state.lock\");\n await mkdir(path.dirname(lock), { recursive: true });\n let held = false;\n for (let attempt = 0; !held; attempt++) {\n try {\n const fh = await open(lock, \"wx\");\n await fh.writeFile(`${process.pid} ${new Date().toISOString()}\\n`);\n await fh.close();\n held = true;\n } catch (e) {\n if ((e as NodeJS.ErrnoException).code !== \"EEXIST\") throw e;\n const snap = await stat(lock).catch(() => undefined);\n if (snap && Date.now() - snap.mtimeMs > staleMs) {\n // re-stat just before unlink: if another recoverer already replaced the lock, leave it alone\n const now = await stat(lock).catch(() => undefined);\n if (now && now.ino === snap.ino && now.mtimeMs === snap.mtimeMs)\n await unlink(lock).catch(() => undefined);\n continue;\n }\n if (attempt >= retries)\n fail(\n \"invalid-input\",\n \"another exwf command holds .workflow/state.lock\",\n \"retry, or delete the file if no exwf process is running\",\n );\n await new Promise((resolve) => setTimeout(resolve, intervalMs));\n }\n }\n try {\n return await fn();\n } finally {\n await unlink(lock).catch(() => undefined);\n }\n}\n\nexport async function saveState(root: string, state: WorkflowState): Promise<void> {\n const json = JSON.stringify(state, null, 2) + \"\\n\";\n assertValid(workflowStateSchema, JSON.parse(json), statePath(root));\n await writeAtomic(statePath(root), json);\n}\n\nexport async function loadState(root: string): Promise<WorkflowState> {\n const file = statePath(root);\n let raw: string;\n try {\n raw = await readFile(file, \"utf8\");\n } catch {\n fail(\n \"invalid-input\",\n `no workflow state at ${file}`,\n \"run `exwf init <scrum|kanban|waterfall> --config <file>` in this directory first\",\n );\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(raw);\n } catch (e) {\n fail(\n \"invalid-input\",\n `${file} is not valid JSON: ${(e as Error).message}`,\n \"restore it from git or re-run exwf init\",\n );\n }\n if (typeof parsed !== \"object\" || parsed === null || Array.isArray(parsed)) {\n fail(\n \"invalid-input\",\n `${file} does not contain a workflow state object`,\n \"restore it from git or re-run exwf init\",\n );\n }\n const state = parsed as WorkflowState;\n if (state.version !== 1)\n fail(\n \"state-version\",\n `${file} has schema version ${String(state.version)}; this ex-workflow reads version 1`,\n \"upgrade ex-workflow, or run the migration this version documents in its changelog\",\n );\n assertValid(workflowStateSchema, parsed, file);\n const rolesDir = path.join(root, WORKFLOW_DIR, \"roles\");\n let manifests: string[] = [];\n try {\n manifests = (await readdir(rolesDir)).filter((f) => f.endsWith(\".json\"));\n } catch {\n /* no extra roles */\n }\n const roles = { ...state.roles };\n for (const f of manifests) {\n const manifestPath = path.join(rolesDir, f);\n let role: Role;\n try {\n role = JSON.parse(await readFile(manifestPath, \"utf8\")) as Role;\n } catch (e) {\n fail(\n \"invalid-input\",\n `role manifest ${manifestPath} is not valid JSON: ${(e as Error).message}`,\n \"fix or delete that manifest\",\n );\n }\n assertValid(roleSchema, role, `role manifest ${manifestPath}`);\n if (!roles[role.id]) roles[role.id] = role;\n }\n return { ...state, roles };\n}\n\nfunction inWorkflowDir(root: string, file: string): string {\n if (!path.resolve(file).startsWith(path.resolve(root, WORKFLOW_DIR) + path.sep))\n fail(\n \"invalid-input\",\n `${file} resolves outside ${WORKFLOW_DIR}/`,\n \"use a plain item id (letters, digits, - _ .)\",\n );\n return file;\n}\n\nexport async function saveBrief(root: string, brief: Brief): Promise<string> {\n const file = inWorkflowDir(\n root,\n path.join(root, WORKFLOW_DIR, \"briefs\", `${brief.item.id}.json`),\n );\n await writeAtomic(file, JSON.stringify(brief, null, 2) + \"\\n\");\n return file;\n}\n\nexport async function saveHandoff(root: string, handoff: Handoff, seq: number): Promise<string> {\n const file = inWorkflowDir(\n root,\n path.join(root, WORKFLOW_DIR, \"handoffs\", `${handoff.item}-${seq}.json`),\n );\n await writeAtomic(file, JSON.stringify(handoff, null, 2) + \"\\n\");\n return file;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkVXH2FAKV_cjs=require('./chunk-VXH2FAKV.cjs'),chunkXMO2RCXB_cjs=require('./chunk-XMO2RCXB.cjs'),chunkS3BXVHO7_cjs=require('./chunk-S3BXVHO7.cjs'),exsorted=require('exsorted');var P=new Set(["in_progress","blocked","awaiting_human"]),E=new Set(["todo","in_progress","blocked","review","awaiting_human"]);function se(e){let t=e.stages[0];return t||chunkS3BXVHO7_cjs.b("config-invalid","kanban board has no columns","init with at least options, a commitment column and a delivery column"),t}function K(e){let t=e.stages.find(a=>a.commitmentPoint);return t||chunkS3BXVHO7_cjs.b("config-invalid","no column is the commitment point","set commitmentPoint: true on exactly one column"),t}function ee(e){let t=e.stages.find(a=>a.deliveryPoint);return t||chunkS3BXVHO7_cjs.b("config-invalid","no column is the delivery point","set deliveryPoint: true on the last column"),t}function X(e,t){return chunkXMO2RCXB_cjs.p(e,t),e.stages.findIndex(a=>a.id===t)}function D(e,t){let a=X(e,t.stage);return a>=X(e,K(e).id)&&a<X(e,ee(e).id)}function U(e){return Object.values(e.items).filter(t=>t.classOfService==="expedite"&&P.has(t.status)&&D(e,t)).map(t=>t.id)}function _(e){for(let t=e.transitions.length-1;t>=0;t--){let a=e.transitions[t];if(a.to.stage===e.stage&&a.from.stage!==e.stage)return a.at}}var Y=["replenishment","delivery-planning","service-delivery-review","operations-review","risk-review","strategy-review"],I=["expedite","fixed-date","standard","intangible"],te=864e5;function h(e){return e.config}var Pe=[{id:"options",name:"Options",policies:[{kind:"acceptance-written"}]},{id:"ready",name:"Ready",wipLimit:4,commitmentPoint:true,policies:[{kind:"dependencies-done"}]},{id:"dev",name:"Development",wipLimit:3,policies:[{kind:"evidence",evidenceKind:"test-output"}]},{id:"review",name:"Review",wipLimit:2,review:true,policies:[{kind:"no-open-blockers"}]},{id:"done",name:"Done",deliveryPoint:true,policies:[]}],B=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function q(e,t,a,s=1){if(e!==void 0)return (typeof e!="number"||!Number.isFinite(e)||e<s)&&chunkS3BXVHO7_cjs.b("config-invalid",`kanban config.${t} must be a number >= ${s} (got ${JSON.stringify(e)})`,a),e}var Me=["acceptance-written","estimate-present","no-open-blockers","dependencies-done"],ae=e=>typeof e=="string"&&e.trim()!=="";function ce(e,t){Array.isArray(e)||chunkS3BXVHO7_cjs.b("config-invalid",`kanban config.${t} must be an array of Policy objects`,'e.g. [{ "kind": "evidence", "evidenceKind": "test-output" }]');let a=[];return e.forEach((s,m)=>{let f=`kanban config.${t}[${m}]`;B(s)&&(s.kind==="evidence"?ae(s.evidenceKind):s.kind==="custom"?ae(s.id)&&ae(s.description):typeof s.kind=="string"&&Me.includes(s.kind))||chunkS3BXVHO7_cjs.b("config-invalid",`${f} must be a Policy`,`use a Policy such as { "kind": "evidence", "evidenceKind": "test-output" }, { "kind": "custom", "id": "x", "description": "..." } or one of: ${Me.join(", ")}`),a.push(s);}),a}function Ne(e,t){B(e)||chunkS3BXVHO7_cjs.b("config-invalid",`kanban config.columns[${t}] must be an object`,'e.g. { "id": "dev", "policies": [] }'),chunkS3BXVHO7_cjs.c(e.id,`kanban config.columns[${t}].id`);let a=e.id;Array.isArray(e.policies)||chunkS3BXVHO7_cjs.b("config-invalid",`kanban config.columns[${t}] ("${a}") needs policies: Policy[]`,'every column states its policies explicitly, e.g. [{ "kind": "acceptance-written" }]');let s={id:a,name:typeof e.name=="string"&&e.name.trim()!==""?e.name:a,policies:ce(e.policies,`columns[${t}].policies`)},m=q(e.wipLimit,`columns[${t}].wipLimit`,"omit wipLimit for no limit");m!==void 0&&(s.wipLimit=m);for(let f of ["commitmentPoint","deliveryPoint","review"])e[f]!==void 0&&(typeof e[f]!="boolean"&&chunkS3BXVHO7_cjs.b("config-invalid",`kanban config.columns[${t}].${f} must be a boolean`,`set ${f}: true or omit it`),e[f]&&(s[f]=true));return s}function H(e){let t=e??{};t.columns!==void 0&&!Array.isArray(t.columns)&&chunkS3BXVHO7_cjs.b("config-invalid","kanban config.columns must be an array of columns","omit columns for the default board (options, ready, dev, review, done)");let a=t.columns===void 0?Pe.map(o=>({...o})):t.columns.map(Ne),s=new Set;for(let o of a)s.has(o.id)&&chunkS3BXVHO7_cjs.b("config-invalid",`duplicate column id "${o.id}"`,"give every column a unique id"),s.add(o.id);let m={},f=t.classesOfService??{};B(f)||chunkS3BXVHO7_cjs.b("config-invalid","kanban config.classesOfService must be an object keyed by class",'e.g. { "expedite": { "wipBypass": 1 } }');for(let[o,c]of Object.entries(f)){I.includes(o)||chunkS3BXVHO7_cjs.b("config-invalid",`kanban config.classesOfService.${o} is not a class of service`,`use one of: ${I.join(", ")}`),B(c)||chunkS3BXVHO7_cjs.b("config-invalid",`kanban config.classesOfService.${o} must be an object`,'e.g. { "wipBypass": 1, "sle": { "percentile": 85, "targetMs": 604800000 } }');let d={},p=q(c.wipBypass,`classesOfService.${o}.wipBypass`,"omit it for the default 1",0);if(p!==void 0&&(d.wipBypass=p),c.sle!==void 0){let g=c.sle;(!B(g)||typeof g.percentile!="number"||g.percentile<0||g.percentile>100)&&chunkS3BXVHO7_cjs.b("config-invalid",`kanban config.classesOfService.${o}.sle.percentile must be 0..100`,'e.g. { "percentile": 85, "targetMs": 604800000 }');let k=q(g.targetMs,`classesOfService.${o}.sle.targetMs`,"state the service level target in milliseconds");k===void 0&&chunkS3BXVHO7_cjs.b("config-invalid",`kanban config.classesOfService.${o}.sle.targetMs is required`,"state the service level target in milliseconds"),d.sle={percentile:g.percentile,targetMs:k};}m[o]=d;}let y=t.fairness??{};(!B(y)||y.aging!==void 0&&typeof y.aging!="boolean")&&chunkS3BXVHO7_cjs.b("config-invalid","kanban config.fairness must be { aging: boolean, maxDeferralRounds?: number }","omit it for aging on");let l=q(y.maxDeferralRounds,"fairness.maxDeferralRounds","omit it for 5 rounds"),i={aging:y.aging===void 0?true:y.aging,maxDeferralRounds:l??5},r={},n=t.cadences??{};B(n)||chunkS3BXVHO7_cjs.b("config-invalid","kanban config.cadences must be an object keyed by cadence",'e.g. { "replenishment": { "everyTurns": 10 } }');for(let[o,c]of Object.entries(n)){Y.includes(o)||chunkS3BXVHO7_cjs.b("config-invalid",`kanban config.cadences.${o} is not a cadence`,`use one of: ${Y.join(", ")}`),B(c)||chunkS3BXVHO7_cjs.b("config-invalid",`kanban config.cadences.${o} must be an object`,'e.g. { "everyTurns": 10 }');let d=q(c.everyTurns,`cadences.${o}.everyTurns`,"omit it when the cadence is run by hand");r[o]=d===void 0?{}:{everyTurns:d};}return {columns:a,classesOfService:m,fairness:i,cadences:r,throughputWindowMs:q(t.throughputWindowMs,"throughputWindowMs","omit it for one week")??7*te,maxExpedite:q(t.maxExpedite,"maxExpedite","omit it for 1")??1}}function ne(e,t){return e.events.find(s=>s.type==="item.added"&&s.payload.id===t)?.at??e.events[0].at}function ie(e,t,a){return Date.parse(a)-Date.parse(_(t)??ne(e,t.id))}function qe(e,t){return e.stages.map(a=>{let s=Object.values(e.items).filter(l=>l.stage===a.id&&l.status!=="dropped"),m=exsorted.timSort(s.map(l=>({id:l.id,title:l.title,type:l.type,status:l.status,classOfService:l.classOfService??"standard",role:l.role??null,ageMs:ie(e,l,t),blocked:l.blockers.some(i=>!i.clearedAt),deadline:l.deadline??null})),(l,i)=>i.ageMs-l.ageMs||(l.id<i.id?-1:1)),f=m.filter(l=>P.has(l.status)).length,y=m.filter(l=>l.status==="todo"||l.status==="review").length;return {id:a.id,name:a.name,wipLimit:a.wipLimit??null,active:f,queued:y,overLimit:a.wipLimit!==void 0&&f>a.wipLimit,commitmentPoint:a.commitmentPoint===true,deliveryPoint:a.deliveryPoint===true,cards:m}})}var Ee=e=>`cadence.${e}`;function le(e){let t=h(e);return Y.map(a=>{let s=0,m=null;for(let l of e.events)l.type===Ee(a)&&(s=l.seq,m=l.at);let f=e.events.filter(l=>l.type==="item.completed"&&l.seq>s).length,y=t.cadences[a]?.everyTurns??null;return {cadence:a,everyTurns:y,lastAt:m,turnsSince:f,due:y!==null&&f>=y}})}var De=(e,t)=>Date.parse(t)-Date.parse(e),Ie=e=>e.transition??null;function re(e,t,a){let s=new Map,m=[],f=e[0]?.at??"1970-01-01T00:00:00.000Z",y=(i,r,n)=>{r===t&&i.committedAt===void 0&&(i.committedAt=n),r===a&&i.deliveredAt===void 0&&(i.deliveredAt=n);},l=(i,r,n)=>{i.since.status==="in_progress"&&(i.activeMs+=De(i.since.at,n)),i.since.status==="blocked"&&(i.blockedMs+=De(i.since.at,n)),i.since={status:r.status,at:n},r.stage!==i.stage&&(i.stays[i.stays.length-1].leftAt=n,i.stays.push({stage:r.stage,enteredAt:n}),y(i,r.stage,n)),i.stage=r.stage,i.status=r.status;};for(let i of e){f=i.at;let r=i.payload??{};switch(i.type){case "item.added":{let n=r.id,o=r.stage,c={id:n,type:typeof r.type=="string"?r.type:"task",stage:o,status:"todo",stays:[{stage:o,enteredAt:i.at}],classOfService:"standard",activeMs:0,blockedMs:0,since:{status:"todo",at:i.at}};y(c,o,i.at),s.set(n,c);break}case "item.transition":{let n=s.get(r.id);if(!n)break;l(n,r.to,i.at);break}case "cadence.replenishment":{let n=r.items??[];for(let o of n){let c=s.get(o.id);c&&(c.classOfService=o.classOfService,o.deadline?c.deadline=o.deadline:delete c.deadline);}break}case "blocker.raised":{m.push({item:r.id,blocker:r.blocker,raisedAt:i.at});let n=s.get(r.id),o=Ie(r);n&&o&&l(n,o.to,i.at);break}case "blocker.cleared":{let n=m.find(d=>d.item===r.id&&d.blocker===r.blocker&&d.clearedAt===void 0);n&&(n.clearedAt=i.at);let o=s.get(r.id),c=Ie(r);o&&c&&l(o,c.to,i.at);break}}}return {items:s,blockers:m,lastAt:f}}function V(e,t){if(e.length===0)return 0;let a=exsorted.timSort([...e],(m,f)=>m-f),s=Math.min(a.length,Math.max(1,Math.ceil(t/100*a.length)));return a[s-1]}var G=(e,t)=>Date.parse(t)-Date.parse(e),We=(e,t)=>t===0?0:e/t;function je(e){let t=e.stages.find(s=>s.commitmentPoint)?.id??"",a=e.stages.find(s=>s.deliveryPoint)?.id??"";return {commitment:t,delivery:a,ci:e.stages.findIndex(s=>s.id===t),di:e.stages.findIndex(s=>s.id===a)}}function Le(e){let t={};for(let a of e.items.values())for(let s of a.stays)s.leftAt!==void 0&&(t[s.stage]??=[]).push(G(s.enteredAt,s.leftAt));return t}function me(e){let t=je(e);return Le(re(e.events,t.commitment,t.delivery))}function Z(e){let t=h(e),a=je(e),s=re(e.events,a.commitment,a.delivery),m=[...s.items.values()],f=e.stages.map(u=>u.id),y=new Map(f.map((u,v)=>[u,v])),l=exsorted.timSort(m.filter(u=>u.type!=="question"&&u.committedAt!==void 0&&u.deliveredAt!==void 0),(u,v)=>Date.parse(u.deliveredAt)-Date.parse(v.deliveredAt)),i=l.map(u=>G(u.committedAt,u.deliveredAt)),r={};for(let[u,v]of Object.entries(Le(s)))r[u]=v.reduce((w,x)=>w+x,0)/v.length;let n=m.filter(u=>u.type!=="question"&&u.committedAt!==void 0).map(u=>Date.parse(u.committedAt)),o=[];if(n.length>0){let u=n.reduce((w,x)=>x<w?x:w,n[0]),v=Math.floor((Date.parse(s.lastAt)-u)/t.throughputWindowMs)+1;o=Array.from({length:v},()=>0);for(let w of l){let x=Math.floor((Date.parse(w.deliveredAt)-u)/t.throughputWindowMs);x>=0&&x<v&&(o[x]+=1);}}let c=Object.fromEntries(f.map(u=>[u,0])),d={};for(let u of m){if(!E.has(u.status))continue;Object.hasOwn(c,u.stage)&&(c[u.stage]+=1);let v=y.get(u.stage);v!==void 0&&v>=a.ci&&v<a.di&&(d[u.id]=G(u.stays[u.stays.length-1].enteredAt,s.lastAt));}let p=new Map;for(let u of m)for(let v of u.stays){let w=p.get(v.stage)??new Map;w.has(u.id)||w.set(u.id,v.enteredAt),p.set(v.stage,w);}let g=exsorted.timSort([...new Set(e.events.map(u=>u.at.slice(0,10)))],(u,v)=>u<v?-1:u>v?1:0),k={};for(let u of g)for(let v of f)k[`${u}:${v}`]=[...p.get(v)?.values()??[]].filter(w=>w.slice(0,10)<=u).length;let M={};for(let[u,v]of Object.entries(t.classesOfService)){if(!v?.sle)continue;let w=l.filter(x=>x.classOfService===u);w.length!==0&&(M[u]=w.filter(x=>G(x.committedAt,x.deliveredAt)<=v.sle.targetMs).length/w.length);}let C=s.blockers.reduce((u,v)=>u+G(v.raisedAt,v.clearedAt??s.lastAt),0);return {leadTimeMs:i,leadTimeP50:V(i,50),leadTimeP85:V(i,85),cycleTimeMsByColumn:r,throughput:o,wipByColumn:c,flowEfficiency:We(l.reduce((u,v)=>u+v.activeMs,0),i.reduce((u,v)=>u+v,0)),agingWipMs:d,cumulativeFlow:k,sleCompliance:M,blockerTimeMs:C,meanBlockerTimeMs:We(C,s.blockers.length)}}function fe(e,t){let a=Date.parse(t),s=me(e),m=[],f=[],y=Object.fromEntries(e.stages.map(i=>[i.id,0])),l=Object.fromEntries(e.stages.map(i=>[i.id,0]));for(let i of Object.values(e.items)){for(let r of i.blockers)r.clearedAt||m.push({item:i.id,blocker:r.id,owner:r.owner,reason:r.reason,ageMs:a-Date.parse(r.raisedAt)});if(P.has(i.status)?l[i.stage]=(l[i.stage]??0)+1:(i.status==="todo"||i.status==="review")&&(y[i.stage]=(y[i.stage]??0)+1),E.has(i.status)&&D(e,i)){let r=s[i.stage]??[],n=r.length?V(r,85):null,o=ie(e,i,t);f.push({item:i.id,column:i.stage,status:i.status,ageMs:o,p85Ms:n,overP85:n!==null&&o>n});}}return {blockers:m,agingWip:exsorted.timSort(f,(i,r)=>r.ageMs-i.ageMs||(i.item<r.item?-1:1)),queued:y,active:l}}function Fe(e,t){let a=K(e).id;return e.items[t].transitions.find(f=>f.to.stage===a&&f.from.stage!==a)?.at??ne(e,t)}function ue(e,t,a){let s=Date.parse(t),m=h(e),f=Z(e).leadTimeMs,y=m.classesOfService["fixed-date"]?.sle?.percentile??85,l=f.length?V(f,y):null,i=[],r=[];for(let n of Object.values(e.items)){for(let p of n.blockers){let g=p.clearedAt?0:s-Date.parse(p.raisedAt);!p.clearedAt&&g>a&&r.push({item:n.id,blocker:p.id,owner:p.owner,ageMs:g});}if(n.classOfService!=="fixed-date"||!n.deadline||!E.has(n.status)||!D(e,n))continue;let o=s-Date.parse(Fe(e,n.id)),c=l===null?null:Math.max(0,l-o),d=Date.parse(n.deadline)-s;i.push({item:n.id,deadline:n.deadline,timeLeftMs:d,projectedRemainingMs:c,atRisk:d<0||c!==null&&c>d});}return {fixedDate:i,staleBlockers:r,expediteActive:U(e)}}var F=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function pe(e,t,a){let s=t.items;(!Array.isArray(s)||s.length===0||!s.every(f=>typeof f=="string"))&&chunkS3BXVHO7_cjs.b("invalid-input",`${a} needs items: string[]`,'pass ["A", "B"]');let m=s.find((f,y)=>s.indexOf(f)!==y);m!==void 0&&chunkS3BXVHO7_cjs.b("invalid-input",`item "${m}" appears twice in items[]`,"list each item once",{items:[m]});for(let f of s)chunkXMO2RCXB_cjs.u(e,f);return s}function Je(e){return F(e)&&typeof e.percentile=="number"&&e.percentile>=0&&e.percentile<=100&&typeof e.targetMs=="number"&&Number.isFinite(e.targetMs)&&e.targetMs>0}function Ke(e,t){let{wipLimit:a,...s}=e;return t===null?s:{...s,wipLimit:t}}function ge(e){let t=(i,r,n,o)=>chunkXMO2RCXB_cjs.Y(i,e(),{type:r,by:n.by,payload:n},c=>o(c,chunkXMO2RCXB_cjs.a(n.now)));return {replenishment:(i,r)=>{chunkXMO2RCXB_cjs.o(i,r.by,"order-backlog","manage-flow");let n=pe(i,r,"replenishment"),o=K(i),c=se(i);for(let d of n)chunkXMO2RCXB_cjs.G(i,chunkXMO2RCXB_cjs.u(i,d),c.exitPolicy,`leave "${c.id}"`);return t(i,"ceremony.replenishment",r,(d,p)=>{for(let g of n)d=chunkXMO2RCXB_cjs.x(d,g,{stage:o.id,status:"todo"},r.by,p);return chunkXMO2RCXB_cjs.c(d,"cadence.replenishment",r.by,{column:o.id,items:n.map(g=>{let k=chunkXMO2RCXB_cjs.u(d,g);return {id:g,classOfService:k.classOfService??"standard",deadline:k.deadline??null}})},p)})},"delivery-planning":(i,r)=>{chunkXMO2RCXB_cjs.o(i,r.by,"facilitate","manage-flow");let n=pe(i,r,"delivery-planning"),o=ee(i),c=i.stages[i.stages.findIndex(d=>d.id===o.id)-1];for(let d of n){let p=chunkXMO2RCXB_cjs.u(i,d);p.stage!==c.id&&p.stage!==o.id&&chunkS3BXVHO7_cjs.b("invalid-input",`item "${d}" is in "${p.stage}", not ready for delivery`,`only cards in "${c.id}" or "${o.id}" can be planned for delivery`,{items:[d]});}return t(i,"ceremony.delivery-planning",r,(d,p)=>chunkXMO2RCXB_cjs.c(d,"cadence.delivery-planning",r.by,{items:n,window:typeof r.window=="string"?r.window:null,delivered:n.filter(g=>chunkXMO2RCXB_cjs.u(d,g).status==="done")},p))},"service-delivery-review":(i,r)=>{chunkXMO2RCXB_cjs.o(i,r.by,"manage-flow");let n=r.wip??{},o=r.policies??{},c=r.sle??{};(!F(n)||!F(o)||!F(c))&&chunkS3BXVHO7_cjs.b("invalid-input","service-delivery-review takes wip, policies and sle objects keyed by column or class",'e.g. { "wip": { "dev": 2 }, "policies": { "dev": [{ "kind": "no-open-blockers" }] }, "sle": { "standard": { "percentile": 85, "targetMs": 604800000 } } }');for(let[g,k]of Object.entries(n))chunkXMO2RCXB_cjs.p(i,g),k!==null&&(typeof k!="number"||!Number.isFinite(k)||k<1)&&chunkS3BXVHO7_cjs.b("invalid-input",`wip.${g} must be a positive number or null`,"null removes the limit");let d={};for(let[g,k]of Object.entries(o))chunkXMO2RCXB_cjs.p(i,g),d[g]=ce(k,`policies.${g}`);for(let[g,k]of Object.entries(c))I.includes(g)||chunkS3BXVHO7_cjs.b("invalid-input",`sle.${g} is not a class of service`,`use one of: ${I.join(", ")}`),k!==null&&!Je(k)&&chunkS3BXVHO7_cjs.b("invalid-input",`sle.${g} must be { percentile: 0..100, targetMs: > 0 } or null`,"null removes the service level");let p=chunkVXH2FAKV_cjs.a(i,r,"service-delivery-review");return t(i,"ceremony.service-delivery-review",r,(g,k)=>{let M=h(g),C=g.stages,u=M.columns,v={...M.classesOfService},w=[],x=[],we=[];for(let[S,O]of Object.entries(n)){let W=C.find(R=>R.id===S).wipLimit??null;W!==O&&(w.push({column:S,before:W,after:O}),C=C.map(R=>R.id===S?Ke(R,O):R),u=u.map(R=>R.id===S?Ke(R,O):R));}for(let[S,O]of Object.entries(d)){let W=C.find($=>$.id===S).exitPolicy;if(JSON.stringify(W)===JSON.stringify(O))continue;x.push({column:S,before:W,after:O});let R=C.findIndex($=>$.id===S),Q=C[R].commitmentPoint?C[R+1]?.id:void 0;C=C.map($=>$.id===S?{...$,exitPolicy:O}:$.id===Q?{...$,entryPolicy:O}:$),u=u.map($=>$.id===S?{...$,policies:O}:$);}for(let[S,O]of Object.entries(c)){let W=v[S]?.sle??null;if(JSON.stringify(W)===JSON.stringify(O))continue;we.push({classOfService:S,before:W,after:O});let{sle:R,...Q}=v[S]??{};v={...v,[S]:O===null?Q:{...Q,sle:O}};}g={...g,stages:C,config:{...M,columns:u,classesOfService:v}};let T=chunkVXH2FAKV_cjs.b(g,p,r.by,k);return chunkXMO2RCXB_cjs.c(T.state,"cadence.service-delivery-review",r.by,{wip:w,policies:x,sle:we,lessons:T.created,adopted:T.adopted.slice(T.created.length),dismissed:T.dismissed,agreements:T.agreements,retired:T.retired},k)})},"operations-review":(i,r)=>{chunkXMO2RCXB_cjs.o(i,r.by,"facilitate","manage-flow");let n=r.assign??[];(!Array.isArray(n)||!n.every(o=>F(o)&&typeof o.item=="string"&&typeof o.blocker=="string"))&&chunkS3BXVHO7_cjs.b("invalid-input","operations-review.assign must be [{ item, blocker, owner }]",'e.g. { "assign": [{ "item": "A", "blocker": "A-b1", "owner": "service-delivery-manager" }] }');for(let o of n){let c=chunkXMO2RCXB_cjs.u(i,o.item);c.blockers.some(d=>d.id===o.blocker&&!d.clearedAt)||chunkS3BXVHO7_cjs.b("invalid-input",`item "${o.item}" has no open blocker "${o.blocker}"`,`open blockers: ${c.blockers.filter(d=>!d.clearedAt).map(d=>d.id).join(", ")||"(none)"}`,{items:[o.item]});}return t(i,"ceremony.operations-review",r,(o,c)=>{for(let d of n){let p=chunkXMO2RCXB_cjs.u(o,d.item).blockers.find(g=>g.id===d.blocker).owner;o=chunkXMO2RCXB_cjs.s(o,d.item,g=>({...g,blockers:g.blockers.map(k=>k.id===d.blocker?{...k,owner:d.owner}:k)})),o=chunkXMO2RCXB_cjs.c(o,"blocker.reassigned",r.by,{id:d.item,blocker:d.blocker,from:p,to:d.owner},c);}return chunkXMO2RCXB_cjs.c(o,"cadence.operations-review",r.by,fe(o,c),c)})},"risk-review":(i,r)=>{chunkXMO2RCXB_cjs.o(i,r.by,"facilitate","manage-flow");let n=r.staleAfterMs??7*te;return (typeof n!="number"||!Number.isFinite(n)||n<0)&&chunkS3BXVHO7_cjs.b("invalid-input","risk-review.staleAfterMs must be a non-negative number of milliseconds","omit it for one week"),t(i,"ceremony.risk-review",r,(o,c)=>chunkXMO2RCXB_cjs.c(o,"cadence.risk-review",r.by,ue(o,c,n),c))},"strategy-review":(i,r)=>{chunkXMO2RCXB_cjs.o(i,r.by,"manage-flow");let n=h(i),o=r.classesOfService??{};F(o)||chunkS3BXVHO7_cjs.b("invalid-input","strategy-review.classesOfService must be an object keyed by class",'e.g. { "expedite": { "wipBypass": 2 }, "intangible": null }');let c={...n.classesOfService};for(let[p,g]of Object.entries(o))I.includes(p)||chunkS3BXVHO7_cjs.b("invalid-input",`classesOfService.${p} is not a class of service`,`use one of: ${I.join(", ")}`),g===null?delete c[p]:c[p]=g;let d=H({...n,classesOfService:c,maxExpedite:r.maxExpedite??n.maxExpedite});return t(i,"ceremony.strategy-review",r,(p,g)=>{let k=Object.fromEntries(I.map(M=>[M,0]));for(let M of Object.values(p.items))E.has(M.status)&&D(p,M)&&(k[M.classOfService??"standard"]+=1);return p={...p,config:{...h(p),classesOfService:d.classesOfService,maxExpedite:d.maxExpedite}},chunkXMO2RCXB_cjs.c(p,"cadence.strategy-review",r.by,{mix:k,before:{classesOfService:n.classesOfService,maxExpedite:n.maxExpedite},after:{classesOfService:d.classesOfService,maxExpedite:d.maxExpedite}},g)})}}}function ye(){return [{id:"service-request-manager",name:"Service Request Manager",modelTier:"large",capabilities:["order-backlog","define-acceptance","manage-flow","escalate"],canApprove:[],inputs:["stakeholder-requests","options"],outputs:["ordered-options","acceptance-criteria","classes-of-service"],do_not:["do not implement items yourself","do not push work past the commitment point outside replenishment"]},{id:"service-delivery-manager",name:"Service Delivery Manager",modelTier:"large",capabilities:["facilitate","manage-flow","escalate"],canApprove:[],inputs:["board","flow-metrics","blockers"],outputs:["cadence-records","wip-and-policy-changes","lessons"],do_not:["do not reorder the options","do not assign work; the planner pulls"]},{id:"worker",name:"Worker",modelTier:"small",capabilities:["deliver","review","verify"],canApprove:[],inputs:["brief"],outputs:["code","test-output"],do_not:["do not change acceptance criteria","do not pull more work while your card is open"]}]}var A=(e,t,a,s,m)=>m?{rule:e,severity:t,item:m,message:a,fix:s}:{rule:e,severity:t,message:a,fix:s},z=e=>e.payload??{},oe=e=>{let t=z(e).items;return Array.isArray(t)?t:[]},Ue=(e,t)=>Object.values(e.items).filter(a=>a.stage===t&&P.has(a.status)).length;function ve(){return [{id:"policy-explicit",severity:"error",check(l,i){let r=l.stages.find(n=>n.deliveryPoint)?.id;if(i.type==="init")return l.stages.filter(n=>n.id!==r&&n.exitPolicy.length===0).map(n=>A("policy-explicit","error",`column "${n.id}" has no explicit policy`,`give column "${n.id}" at least one policy, e.g. { "kind": "acceptance-written" }`));if(i.type==="ceremony.service-delivery-review"){let n=z(i).policies??{};return Object.entries(n).filter(([o,c])=>o!==r&&Array.isArray(c)&&c.length===0).map(([o])=>A("policy-explicit","error",`column "${o}" would be left without a policy`,"keep at least one policy per column; Kanban policies are explicit"))}return []}},{id:"commitment-point-once",severity:"error",check(l,i){if(i.type!=="init")return [];let r=[],n=l.stages.filter(c=>c.commitmentPoint),o=l.stages.filter(c=>c.deliveryPoint);if(n.length!==1&&r.push(A("commitment-point-once","error",`${n.length} columns are marked commitmentPoint (${n.map(c=>c.id).join(", ")||"none"})`,"mark exactly one column commitmentPoint: true")),o.length!==1&&r.push(A("commitment-point-once","error",`${o.length} columns are marked deliveryPoint (${o.map(c=>c.id).join(", ")||"none"})`,"mark exactly one column deliveryPoint: true")),n.length===1&&o.length===1){let c=l.stages.indexOf(n[0]),d=l.stages.indexOf(o[0]);d!==l.stages.length-1&&r.push(A("commitment-point-once","error",`delivery column "${o[0].id}" is not the last column`,"move the delivery column to the end; finished cards leave the board there")),c===0?r.push(A("commitment-point-once","error",`commitment column "${n[0].id}" is the first column`,"keep an Options column before the commitment point; replenishment pulls from it")):c>=d&&r.push(A("commitment-point-once","error",`commitment column "${n[0].id}" comes after the delivery column`,"order columns options \u2192 commitment \u2192 \u2026 \u2192 delivery"));}return r}},{id:"wip-respected",severity:"error",check(l,i){if(i.type==="ceremony.replenishment"){let r=l.stages.find(p=>p.commitmentPoint);if(!r||r.wipLimit===void 0)return [];let n=oe(i),o=Object.values(l.items).filter(p=>p.stage===r.id&&E.has(p.status)).length,c=n.some(p=>l.items[p]?.classOfService==="expedite")?h(l).classesOfService.expedite?.wipBypass??1:0,d=r.wipLimit+c;return o+n.length<=d?[]:[A("wip-respected","error",`column "${r.id}" holds ${o} card(s); pulling ${n.length} more exceeds its WIP limit of ${r.wipLimit}${c?` (+${c} expedite bypass)`:""}`,`pull at most ${Math.max(0,d-o)} card(s) now, or raise the limit in a service-delivery-review`)]}if(i.type==="ceremony.service-delivery-review"){let r=z(i).wip??{},n=[];for(let[o,c]of Object.entries(r)){if(typeof c!="number")continue;let d=Ue(l,o);d>c&&n.push(A("wip-respected","warning",`column "${o}" has ${d} active card(s), above the new limit of ${c}`,"nothing new is pulled into it until it drains; finish or move cards"));}return n}return []}},{id:"pull-not-push",severity:"error",check(l,i){if(i.type!=="ceremony.replenishment")return [];let r=l.stages[0],n=l.stages.find(d=>d.commitmentPoint);if(!r||!n)return [];let o=[],c=z(i).column;c!==void 0&&c!==n.id&&o.push(A("pull-not-push","error",`replenishment may only pull into the commitment column "${n.id}", not "${String(c)}"`,"drop column or set it to the commitment column; later columns are pulled by the planner"));for(let d of oe(i)){let p=l.items[d];p&&(p.stage!==r.id||p.status!=="todo")&&o.push(A("pull-not-push","error",`item "${d}" is ${p.status} in "${p.stage}", not an option`,`only todo cards in "${r.id}" can be pulled; cards already on the board flow by pull`,d));}return o}},{id:"blocker-has-owner",severity:"error",check(l,i){if(!i.type.startsWith("ceremony."))return [];let r=[];if(i.type==="ceremony.operations-review"){let n=z(i).assign??[];for(let o of n)(typeof o.owner!="string"||o.owner.trim()==="")&&r.push(A("blocker-has-owner","error",`blocker "${o.blocker}" on "${o.item}" would have no owner`,"name the role or person who clears it",o.item));}for(let n of Object.values(l.items))for(let o of n.blockers)!o.clearedAt&&o.owner.trim()===""&&r.push(A("blocker-has-owner","warning",`blocker "${o.id}" on "${n.id}" has no owner`,`assign one in operations-review: { "assign": [{ "item": "${n.id}", "blocker": "${o.id}", "owner": "<who>" }] }`,n.id));return r}},{id:"one-expedite",severity:"error",check(l,i){if(i.type!=="ceremony.replenishment")return [];let r=oe(i).filter(c=>l.items[c]?.classOfService==="expedite");if(r.length===0)return [];let n=Object.values(l.items).filter(c=>c.classOfService==="expedite"&&E.has(c.status)&&D(l,c)).map(c=>c.id),o=h(l).maxExpedite;return n.length+r.length<=o?[]:[A("one-expedite","error",`${n.length} expedite card(s) already on the board (${n.join(", ")||"none"}); pulling ${r.join(", ")} exceeds maxExpedite ${o}`,"deliver the current expedite first, reclassify the new card, or raise maxExpedite in a strategy-review")]}},{id:"fixed-date-needs-deadline",severity:"error",check(l,i){return i.type!=="ceremony.replenishment"?[]:oe(i).filter(r=>{let n=l.items[r];return n?.classOfService==="fixed-date"&&!(n.deadline&&Number.isFinite(Date.parse(n.deadline)))}).map(r=>A("fixed-date-needs-deadline","error",`fixed-date item "${r}" has no deadline`,`editItem("${r}", { deadline: "<ISO date>" }) before pulling it`,r))}}]}function be(e){let t=e.columns.map(m=>{let f={id:m.id,name:m.name,entryPolicy:[],exitPolicy:m.policies};return m.wipLimit!==void 0&&(f.wipLimit=m.wipLimit),m.commitmentPoint&&(f.commitmentPoint=true),m.deliveryPoint&&(f.deliveryPoint=true),m.review&&(f.review=true),f}),a=t.findIndex(m=>m.commitmentPoint),s=a>=0?t[a+1]:void 0;return s&&(s.entryPolicy=t[a].exitPolicy),t}var He={backlog:"Options",item:"Work Item",stage:"Column",iteration:"Cadence",increment:"Delivery",ceremony:"Cadence",gate:"Policy"},Ge={expedite:0,"fixed-date":1,standard:2,intangible:3},Be=e=>Ge[e.classOfService??"standard"]??2,ke=1e15,Ze=4e9,ze=(e,t,a)=>Math.min(a,Math.max(t,e));function Qe(e,t){let a=e.classOfService??"standard";if(e.type==="question")return 5*ke;if(a==="fixed-date"&&e.deadline!==void 0){let l=Date.parse(e.deadline);if(Number.isFinite(l))return 3*ke+1e10-Math.floor(l/1e3)}let s=t.aging?Math.floor(t.deferrals/t.maxDeferralRounds):0,m=ze(e.priority??0,-1e9,1e9)+s*Ze,f=t.aging&&t.deferrals>=t.maxDeferralRounds;return (a==="expedite"?4:a==="fixed-date"?3:a==="intangible"&&!f?1:2)*ke+m}function Te(e,t){let a=Be(e)-Be(t);if(a!==0)return a;let s=_(e),m=_(t),f=s===void 0?0:Date.parse(s),y=m===void 0?0:Date.parse(m);return f!==y?f-y:e.id<t.id?-1:e.id>t.id?1:0}function Xe(e){return e.map(t=>t.kind==="evidence"?`evidence ${t.evidenceKind}`:t.kind==="custom"?`${t.id}: ${t.description}`:t.kind).join(", ")||"(none)"}function et(){return {name:"kanban",vocabulary:He,validateConfig:H,defaultStages:be,defaultRoles:ye,requiredCapabilities:["manage-flow","deliver"],exclusiveCapabilities:[],plannerOptions(e){let t=h(e),a=K(e),s=e.stages[e.stages.findIndex(n=>n.id===a.id)+1],m=t.classesOfService.expedite?.wipBypass??1,f=[],y=[0],l=new Map;for(let n of e.events)f.push(Date.parse(n.at)),y.push(y[y.length-1]+(n.type==="planner.resolved"?1:0)),n.type==="item.added"&&l.set(n.payload.id,n.at);let i=n=>{let o=0,c=f.length;for(;o<c;){let d=o+c>>1;f[d]<=n?o=d+1:c=d;}return y[f.length]-y[o]},r={schedulerMode:"throughput",fairnessPolicy:t.fairness.aging?"aging":"none",deadlineStrategy:"earliest-first",dispatchStage:n=>n.stage===a.id&&s?s.id:void 0,priorityOf:n=>{let o=Date.parse(_(n)??l.get(n.id)??"");return Qe(n,{deferrals:i(Number.isFinite(o)?o:0),aging:t.fairness.aging,maxDeferralRounds:t.fairness.maxDeferralRounds})},tieBreaker:Te,wipCounts:[...P],wipLimitOf:(n,o)=>n.wipLimit===void 0?void 0:o.classOfService==="expedite"?n.wipLimit+m:n.wipLimit};return r.maxDeferralRounds=t.fairness.maxDeferralRounds,r},candidates(e){let t=Math.max(0,h(e).maxExpedite-U(e).length),a=Object.values(e.items).filter(m=>(m.status==="todo"||m.status==="review")&&D(e,m)),s=exsorted.timSort(a.filter(m=>m.classOfService==="expedite"),Te).slice(0,t);return a.filter(m=>m.classOfService!=="expedite"||s.includes(m))},invariants(e,t){let a=h(e),s=e.stages.find(l=>l.id===t.stage),m=t.classOfService??"standard",f=a.classesOfService[m]?.sle,y=Object.values(e.items).filter(l=>l.stage===s.id&&P.has(l.status)).length;return [`Column "${s.name}" exit policies: ${Xe(s.exitPolicy)}`,`Class of service: ${m}${t.deadline?`; deadline ${t.deadline}`:""}${f?`; service level p${f.percentile} <= ${f.targetMs} ms`:""}`,`WIP limit of "${s.name}": ${s.wipLimit??"none"} (active now: ${y}); finish this card before pulling another`,`Do not change the scope of "${t.id}" or its acceptance criteria; raise open_questions instead`]},ceremonies:ge(et),rules:ve(),metrics:e=>({...Z(e)}),humanDefaults:{gates:"none"},lockedConfigKeys:["columns","classesOfService"],report:e=>({cadencesDue:le(e)})}}exports.A=pe;exports.B=ge;exports.C=ye;exports.D=ve;exports.E=be;exports.F=He;exports.G=Qe;exports.H=Te;exports.I=et;exports.a=P;exports.b=E;exports.c=se;exports.d=K;exports.e=ee;exports.f=X;exports.g=D;exports.h=U;exports.i=_;exports.j=Y;exports.k=I;exports.l=te;exports.m=h;exports.n=Pe;exports.o=H;exports.p=ne;exports.q=ie;exports.r=qe;exports.s=Ee;exports.t=le;exports.u=re;exports.v=V;exports.w=me;exports.x=Z;exports.y=fe;exports.z=ue;//# sourceMappingURL=chunk-CYXVGHQM.cjs.map
2
+ //# sourceMappingURL=chunk-CYXVGHQM.cjs.map