ex-workflow 1.2.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +46 -0
- package/README.md +147 -13
- package/dist/adapters/index.cjs +1 -1
- package/dist/adapters/index.d.cts +1 -1
- package/dist/adapters/index.d.ts +1 -1
- package/dist/adapters/index.mjs +1 -1
- package/dist/{budget-Gckmqj74.d.ts → budget-BuQ9GWsg.d.ts} +1 -1
- package/dist/{budget-Bm839Qw0.d.cts → budget-DDqQQIgp.d.cts} +1 -1
- package/dist/{chunk-LIATP6LY.mjs → chunk-3QUIRAXO.mjs} +2 -2
- package/dist/{chunk-LIATP6LY.mjs.map → chunk-3QUIRAXO.mjs.map} +1 -1
- package/dist/chunk-3RJ4RNPG.cjs +2 -0
- package/dist/chunk-3RJ4RNPG.cjs.map +1 -0
- package/dist/chunk-66BO7JFR.cjs +2 -0
- package/dist/chunk-66BO7JFR.cjs.map +1 -0
- package/dist/chunk-6PFJYRM7.cjs +2 -0
- package/dist/chunk-6PFJYRM7.cjs.map +1 -0
- package/dist/chunk-76ITDJDM.cjs +2 -0
- package/dist/{chunk-QAENYYU6.cjs.map → chunk-76ITDJDM.cjs.map} +1 -1
- package/dist/chunk-AWFR3Q4M.mjs +2 -0
- package/dist/{chunk-32NVJV5C.mjs.map → chunk-AWFR3Q4M.mjs.map} +1 -1
- package/dist/chunk-BD665RYK.mjs +2 -0
- package/dist/chunk-BD665RYK.mjs.map +1 -0
- package/dist/chunk-BGKXIRGS.mjs +2 -0
- package/dist/chunk-BGKXIRGS.mjs.map +1 -0
- package/dist/chunk-BNKKOAMP.mjs +2 -0
- package/dist/{chunk-OZAYOPLB.mjs.map → chunk-BNKKOAMP.mjs.map} +1 -1
- package/dist/{chunk-IIEKK2S3.cjs → chunk-CPM2SPDX.cjs} +2 -2
- package/dist/{chunk-IIEKK2S3.cjs.map → chunk-CPM2SPDX.cjs.map} +1 -1
- package/dist/chunk-DVFTTBCT.cjs +3 -0
- package/dist/chunk-DVFTTBCT.cjs.map +1 -0
- package/dist/{chunk-U3RU5LOF.cjs → chunk-G6QELJRL.cjs} +2 -2
- package/dist/{chunk-U3RU5LOF.cjs.map → chunk-G6QELJRL.cjs.map} +1 -1
- package/dist/{chunk-6D6FL3XK.mjs → chunk-HXEJP6KF.mjs} +2 -2
- package/dist/{chunk-6D6FL3XK.mjs.map → chunk-HXEJP6KF.mjs.map} +1 -1
- package/dist/chunk-ILNSTPPV.mjs +2 -0
- package/dist/chunk-ILNSTPPV.mjs.map +1 -0
- package/dist/{chunk-RXY434DX.cjs → chunk-KA6DVHO5.cjs} +4 -4
- package/dist/{chunk-RXY434DX.cjs.map → chunk-KA6DVHO5.cjs.map} +1 -1
- package/dist/chunk-KLOSFZFK.cjs +2 -0
- package/dist/chunk-KLOSFZFK.cjs.map +1 -0
- package/dist/chunk-LQJPLXFR.cjs +2 -0
- package/dist/chunk-LQJPLXFR.cjs.map +1 -0
- package/dist/chunk-MUQ4FKVH.mjs +2 -0
- package/dist/chunk-MUQ4FKVH.mjs.map +1 -0
- package/dist/chunk-N2NANHRW.mjs +2 -0
- package/dist/{chunk-4HG6A3SF.mjs.map → chunk-N2NANHRW.mjs.map} +1 -1
- package/dist/chunk-NNQ3RHDP.mjs +2 -0
- package/dist/chunk-NNQ3RHDP.mjs.map +1 -0
- package/dist/chunk-OAJ4KV4F.mjs +2 -0
- package/dist/{chunk-BYPFTO7P.mjs.map → chunk-OAJ4KV4F.mjs.map} +1 -1
- package/dist/chunk-OFFQTZEY.cjs +2 -0
- package/dist/chunk-OFFQTZEY.cjs.map +1 -0
- package/dist/{chunk-3GKYL6VB.mjs → chunk-ONVAUZOD.mjs} +3 -3
- package/dist/{chunk-3GKYL6VB.mjs.map → chunk-ONVAUZOD.mjs.map} +1 -1
- package/dist/chunk-QJMOCISZ.mjs +3 -0
- package/dist/chunk-QJMOCISZ.mjs.map +1 -0
- package/dist/chunk-QKW26EV2.mjs +2 -0
- package/dist/chunk-QKW26EV2.mjs.map +1 -0
- package/dist/{chunk-W2P27645.cjs → chunk-RMXEQ5HN.cjs} +2 -2
- package/dist/{chunk-W2P27645.cjs.map → chunk-RMXEQ5HN.cjs.map} +1 -1
- package/dist/chunk-TBLIZIWH.cjs +2 -0
- package/dist/chunk-TBLIZIWH.cjs.map +1 -0
- package/dist/chunk-U23IRPFF.cjs +2 -0
- package/dist/{chunk-SFYUJQYW.cjs.map → chunk-U23IRPFF.cjs.map} +1 -1
- package/dist/chunk-WM3JM3H7.mjs +2 -0
- package/dist/chunk-WM3JM3H7.mjs.map +1 -0
- package/dist/chunk-WU5JELOM.mjs +2 -0
- package/dist/chunk-WU5JELOM.mjs.map +1 -0
- package/dist/chunk-YNYIHJOC.mjs +2 -0
- package/dist/chunk-YNYIHJOC.mjs.map +1 -0
- package/dist/chunk-YRXFEM3F.cjs +2 -0
- package/dist/chunk-YRXFEM3F.cjs.map +1 -0
- package/dist/{chunk-K4VSMIJZ.cjs → chunk-ZDT2BZGU.cjs} +2 -2
- package/dist/{chunk-K4VSMIJZ.cjs.map → chunk-ZDT2BZGU.cjs.map} +1 -1
- package/dist/{chunk-OVR5CK3R.cjs → chunk-ZK3V66NC.cjs} +2 -2
- package/dist/{chunk-OVR5CK3R.cjs.map → chunk-ZK3V66NC.cjs.map} +1 -1
- package/dist/cli/bin.cjs +1 -1
- package/dist/cli/bin.cjs.map +1 -1
- package/dist/cli/bin.mjs +1 -1
- package/dist/cli/bin.mjs.map +1 -1
- package/dist/cli/index.cjs +1 -1
- package/dist/cli/index.mjs +1 -1
- package/dist/experimentation/index.cjs +1 -1
- package/dist/experimentation/index.d.cts +2 -2
- package/dist/experimentation/index.d.ts +2 -2
- package/dist/experimentation/index.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -12
- package/dist/index.d.ts +15 -12
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/investigation/index.cjs +1 -1
- package/dist/investigation/index.d.cts +2 -2
- package/dist/investigation/index.d.ts +2 -2
- package/dist/investigation/index.mjs +1 -1
- package/dist/kanban/index.cjs +1 -1
- package/dist/kanban/index.d.cts +1 -1
- package/dist/kanban/index.d.ts +1 -1
- package/dist/kanban/index.mjs +1 -1
- package/dist/policies/index.cjs +2 -0
- package/dist/policies/index.cjs.map +1 -0
- package/dist/policies/index.d.cts +202 -0
- package/dist/policies/index.d.ts +202 -0
- package/dist/policies/index.mjs +2 -0
- package/dist/policies/index.mjs.map +1 -0
- package/dist/registry/index.cjs +1 -1
- package/dist/registry/index.d.cts +1 -1
- package/dist/registry/index.d.ts +1 -1
- package/dist/registry/index.mjs +1 -1
- package/dist/schema/index.cjs +1 -1
- package/dist/schema/index.mjs +1 -1
- package/dist/scrum/index.cjs +1 -1
- package/dist/scrum/index.d.cts +3 -3
- package/dist/scrum/index.d.ts +3 -3
- package/dist/scrum/index.mjs +1 -1
- package/dist/{types-DjePDfms.d.cts → types-DLOtndDY.d.cts} +61 -1
- package/dist/{types-DjePDfms.d.ts → types-DLOtndDY.d.ts} +61 -1
- package/dist/types.d.cts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/waterfall/index.cjs +1 -1
- package/dist/waterfall/index.d.cts +1 -1
- package/dist/waterfall/index.d.ts +1 -1
- package/dist/waterfall/index.mjs +1 -1
- package/package.json +14 -1
- package/dist/chunk-32NVJV5C.mjs +0 -2
- package/dist/chunk-3O5MPAJT.cjs +0 -2
- package/dist/chunk-3O5MPAJT.cjs.map +0 -1
- package/dist/chunk-43GLYYA2.cjs +0 -3
- package/dist/chunk-43GLYYA2.cjs.map +0 -1
- package/dist/chunk-4HG6A3SF.mjs +0 -2
- package/dist/chunk-7EF47R2J.mjs +0 -2
- package/dist/chunk-7EF47R2J.mjs.map +0 -1
- package/dist/chunk-BD76VFI4.mjs +0 -3
- package/dist/chunk-BD76VFI4.mjs.map +0 -1
- package/dist/chunk-BHAEPYRJ.cjs +0 -2
- package/dist/chunk-BHAEPYRJ.cjs.map +0 -1
- package/dist/chunk-BYPFTO7P.mjs +0 -2
- package/dist/chunk-FDZB73PH.mjs +0 -2
- package/dist/chunk-FDZB73PH.mjs.map +0 -1
- package/dist/chunk-JNLWI4JM.mjs +0 -2
- package/dist/chunk-JNLWI4JM.mjs.map +0 -1
- package/dist/chunk-LCN4UNYK.cjs +0 -2
- package/dist/chunk-LCN4UNYK.cjs.map +0 -1
- package/dist/chunk-MB465DI4.mjs +0 -2
- package/dist/chunk-MB465DI4.mjs.map +0 -1
- package/dist/chunk-OZAYOPLB.mjs +0 -2
- package/dist/chunk-QAENYYU6.cjs +0 -2
- package/dist/chunk-SFYUJQYW.cjs +0 -2
- package/dist/chunk-UUWDQVIJ.mjs +0 -2
- package/dist/chunk-UUWDQVIJ.mjs.map +0 -1
- package/dist/chunk-VXOZIP77.cjs +0 -2
- package/dist/chunk-VXOZIP77.cjs.map +0 -1
- package/dist/chunk-WPVL27G4.mjs +0 -2
- package/dist/chunk-WPVL27G4.mjs.map +0 -1
- package/dist/chunk-Z43GUETW.cjs +0 -2
- package/dist/chunk-Z43GUETW.cjs.map +0 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import {b}from'./chunk-YS6CXERQ.mjs';var l={Accounting:{type:"object",properties:{item:{type:"string"},role:{type:"string"},model:{type:"string"},tokensIn:{type:"number"},tokensOut:{type:"number"},durationMs:{type:"number"},startedAt:{type:"string"},endedAt:{type:"string"},estimate:{type:"boolean"}},required:["item","role","model","tokensIn","tokensOut","durationMs","startedAt","endedAt"],additionalProperties:false},Baseline:{type:"object",properties:{phase:{type:"string"},version:{type:"number"},at:{type:"string"},approvedBy:{type:"array",items:{type:"string"}},itemSnapshot:{type:"object",additionalProperties:{$ref:"#/definitions/WorkItem"}}},required:["phase","version","at","approvedBy","itemSnapshot"],additionalProperties:false},BeliefUpdate:{type:"object",properties:{result:{type:"string"},assessments:{type:"array",items:{type:"object",properties:{hypothesis:{type:"string"},assessment:{type:"string",enum:["supported","refuted","uncertain"]},reason:{type:"string"}},required:["hypothesis","assessment","reason"],additionalProperties:false}}},required:["result","assessments"],additionalProperties:false},Blocker:{type:"object",properties:{id:{type:"string"},reason:{type:"string"},owner:{type:"string"},raisedAt:{type:"string"},clearedAt:{type:"string"}},required:["id","reason","owner","raisedAt"],additionalProperties:false},Budget:{type:"object",properties:{tokens:{type:"number"},turns:{type:"number"},wallclockMs:{type:"number"}},additionalProperties:false},Capability:{type:"string",enum:["order-backlog","define-acceptance","facilitate","deliver","review","verify","approve-gate","manage-flow","control-change","escalate"]},ClassOfService:{type:"string",enum:["expedite","fixed-date","standard","intangible"]},Event:{type:"object",properties:{seq:{type:"number"},at:{type:"string"},type:{type:"string"},by:{type:"string"},payload:{}},required:["seq","at","type","by","payload"],additionalProperties:false},Evidence:{type:"object",properties:{kind:{type:"string"},ref:{type:"string"},by:{type:"string"},at:{type:"string"},data:{type:"object",additionalProperties:{}}},required:["kind","ref","by","at"],additionalProperties:false},Experiment:{type:"object",properties:{id:{type:"string"},procedureRef:{type:"string"},predictions:{type:"array",items:{type:"object",properties:{hypothesis:{type:"string"},prediction:{type:"string"}},required:["hypothesis","prediction"],additionalProperties:false}},replayOf:{type:"string"}},required:["id","procedureRef","predictions"],additionalProperties:false},ExperimentCandidate:{type:"object",properties:{id:{type:"string"},item:{type:"string"},author:{type:"string"},status:{type:"string",enum:["pending","ready","running","submitted","validated","failed","timed-out","cancelled"]},workspace:{type:"string"},sha:{type:"string"},score:{type:"number"},spent:{$ref:"#/definitions/Spent"},validation:{type:"object",properties:{sha:{type:"string"},harness:{type:"string"},by:{type:"string"},passed:{type:"boolean"},reproducible:{type:"boolean"},evidence:{type:"string"}},required:["sha","harness","by","passed","reproducible","evidence"],additionalProperties:false},reason:{type:"string"},command:{type:"string"},log:{type:"string"},terminalLog:{type:"string"}},required:["id","item","author","status","spent"],additionalProperties:false},ExperimentationState:{type:"object",properties:{status:{type:"string",enum:["running","selected","integrating","integrated","stopped"]},baseSha:{type:"string"},harness:{type:"string"},candidates:{type:"object",additionalProperties:{$ref:"#/definitions/ExperimentCandidate"}},selected:{type:"string"},reason:{type:"string"},integration:{type:"object",properties:{selectedSha:{type:"string"},targetSha:{type:"string"},sha:{type:"string"},by:{type:"string"},validation:{type:"object",properties:{by:{type:"string"},sha:{type:"string"},harness:{type:"string"},evidence:{type:"string"},passed:{type:"boolean"}},required:["by","sha","harness","evidence","passed"],additionalProperties:false}},required:["selectedSha","targetSha","sha","by"],additionalProperties:false},released:{type:"array",items:{type:"string"}},overhead:{$ref:"#/definitions/Spent"}},required:["status","baseSha","harness","candidates","released","overhead"],additionalProperties:false},Gate:{type:"object",properties:{id:{type:"string"},requires:{type:"array",items:{$ref:"#/definitions/GateRequirement"}},evidence:{type:"array",items:{type:"string"}},onFail:{anyOf:[{type:"object",properties:{action:{type:"string",const:"block"}},required:["action"],additionalProperties:false},{type:"object",properties:{action:{type:"string",const:"return-to"},stage:{type:"string"}},required:["action","stage"],additionalProperties:false}]}},required:["id","requires","evidence","onFail"],additionalProperties:false},GateRequirement:{anyOf:[{type:"string",const:"human"},{type:"object",properties:{capability:{type:"string"}},required:["capability"],additionalProperties:false}]},Handoff:{type:"object",properties:{item:{type:"string"},role:{type:"string"},produced:{type:"array",items:{type:"object",properties:{kind:{type:"string"},ref:{type:"string"}},required:["kind","ref"],additionalProperties:false}},notes:{type:"string"},do_not:{type:"array",items:{type:"string"}},open_questions:{type:"array",items:{type:"string"}},verdict:{$ref:"#/definitions/Verdict"},follow_ups:{type:"array",items:{$ref:"#/definitions/NewItem"}},lessons:{type:"array",items:{type:"object",properties:{text:{type:"string"},scope:{type:"string",enum:["policy","skill","memory","spec","review"]}},required:["text","scope"],additionalProperties:false}}},required:["item","role","produced","notes","do_not","open_questions"],additionalProperties:false},Hypothesis:{type:"object",properties:{id:{type:"string"},claim:{type:"string"},falsifiedBy:{type:"string"}},required:["id","claim","falsifiedBy"],additionalProperties:false},ImpactAnalysis:{type:"object",properties:{summary:{type:"string"},reopen:{type:"array",items:{type:"string"}},weight:{type:"number"}},required:["summary","reopen","weight"],additionalProperties:false},InvestigationConclusion:{type:"object",properties:{outcome:{type:"string",enum:["resolved","inconclusive"]},summary:{type:"string"},supportedHypothesis:{type:"string"},evidenceRefs:{type:"array",items:{type:"string"}},by:{type:"string"}},required:["outcome","summary","evidenceRefs","by"],additionalProperties:false},InvestigationRound:{type:"object",properties:{hypotheses:{type:"array",items:{$ref:"#/definitions/Hypothesis"}},experiment:{$ref:"#/definitions/Experiment"},item:{type:"string"},by:{type:"string"},result:{$ref:"#/definitions/Observation"},update:{$ref:"#/definitions/BeliefUpdate"}},required:["hypotheses","experiment","item","by"],additionalProperties:false},InvestigationState:{type:"object",properties:{item:{type:"string"},phase:{type:"string",enum:["hypotheses","preregister","observe","update-belief","conclusion","review","closed"]},hypotheses:{type:"array",items:{$ref:"#/definitions/Hypothesis"}},singleHypothesisRationale:{type:"string"},rounds:{type:"array",items:{$ref:"#/definitions/InvestigationRound"}},conclusion:{$ref:"#/definitions/InvestigationConclusion"},outcome:{type:"string",enum:["resolved","inconclusive","stopped"]},stopReason:{type:"string"},contributors:{type:"array",items:{type:"string"}},reviewHistory:{type:"array",items:{type:"object",properties:{by:{type:"string"},reason:{type:"string"},approve:{type:"boolean"},next:{type:"string",enum:["round","conclusion"]},replayRefs:{type:"array",items:{type:"string"}}},required:["by","reason","approve","replayRefs"],additionalProperties:false}},review:{type:"object",properties:{by:{type:"string"},reason:{type:"string"},replayRefs:{type:"array",items:{type:"string"}}},required:["by","reason","replayRefs"],additionalProperties:false}},required:["item","phase","hypotheses","rounds","contributors"],additionalProperties:false},ItemPatch:{type:"object",properties:{type:{$ref:"#/definitions/ItemType"},title:{type:"string"},description:{type:"string"},dependsOn:{type:"array",items:{type:"string"}},priority:{type:"number"},weight:{type:"number"},deadline:{type:"string"},classOfService:{$ref:"#/definitions/ClassOfService"},role:{type:"string"},parent:{type:"string"},acceptance:{type:"array",items:{type:"string"}},iteration:{type:"string"},traces:{type:"array",items:{type:"string"}},tags:{type:"array",items:{type:"string"}},affects:{type:"array",items:{type:"string"}},phase:{type:"string"},impactAnalysis:{$ref:"#/definitions/ImpactAnalysis"}},additionalProperties:false},ItemStatus:{type:"string",enum:["todo","in_progress","blocked","review","awaiting_human","done","dropped"]},ItemType:{type:"string",enum:["epic","story","task","bug","change-request","deliverable","question"]},Iteration:{type:"object",properties:{id:{type:"string"},goal:{type:"string"},budget:{$ref:"#/definitions/Budget"},spent:{$ref:"#/definitions/Spent"},startedAt:{type:"string"},endedAt:{type:"string"},committed:{type:"array",items:{type:"string"}},carryover:{type:"array",items:{type:"string"}},outcome:{type:"string",enum:["completed","cancelled"]},closing:{type:"boolean"}},required:["id","goal","budget","spent","startedAt","committed","carryover"],additionalProperties:false},Lesson:{type:"object",properties:{id:{type:"string"},at:{type:"string"},text:{type:"string"},scope:{type:"string",enum:["policy","skill","memory","spec","review"]},status:{type:"string",enum:["raised","adopted","dismissed"]},from:{type:"string"},item:{type:"string"},suggestedChange:{$ref:"#/definitions/LessonChange"}},required:["id","at","text","scope","status"],additionalProperties:false},LessonChange:{anyOf:[{type:"object",properties:{kind:{type:"string",const:"agreement"},text:{type:"string"},replaces:{type:"string"}},required:["kind","text"],additionalProperties:false},{type:"object",properties:{kind:{type:"string",const:"dod"},policy:{$ref:"#/definitions/Policy"}},required:["kind","policy"],additionalProperties:false},{type:"object",properties:{kind:{type:"string",const:"backlog"},item:{$ref:"#/definitions/NewItem"}},required:["kind","item"],additionalProperties:false},{type:"object",properties:{kind:{type:"string",const:"skill"},note:{type:"string"}},required:["kind","note"],additionalProperties:false}]},MethodologyName:{type:"string",enum:["scrum","kanban","waterfall","investigation","experimentation"]},ModelTier:{type:"string",enum:["small","medium","large"]},NewItem:{type:"object",additionalProperties:false,properties:{stage:{type:"string"},type:{$ref:"#/definitions/ItemType"},description:{type:"string"},dependsOn:{type:"array",items:{type:"string"}},priority:{type:"number"},weight:{type:"number"},deadline:{type:"string"},classOfService:{$ref:"#/definitions/ClassOfService"},role:{type:"string"},parent:{type:"string"},acceptance:{type:"array",items:{type:"string"}},iteration:{type:"string"},traces:{type:"array",items:{type:"string"}},tags:{type:"array",items:{type:"string"}},affects:{type:"array",items:{type:"string"}},phase:{type:"string"},impactAnalysis:{$ref:"#/definitions/ImpactAnalysis"},id:{type:"string"},title:{type:"string"}},required:["id","title"]},Observation:{type:"object",properties:{id:{type:"string"},valid:{type:"boolean"},summary:{type:"string"},provenanceRefs:{type:"array",items:{type:"string"}}},required:["id","valid","summary","provenanceRefs"],additionalProperties:false},PendingHuman:{type:"object",properties:{id:{type:"string"},kind:{type:"string",enum:["gate","decision"]},item:{type:"string"},gate:{type:"string"},question:{type:"string"},raisedAt:{type:"string"}},required:["id","kind","question","raisedAt"],additionalProperties:false},Phase:{type:"object",properties:{id:{type:"string"},name:{type:"string"},deliverables:{type:"array",items:{type:"string"}},gate:{$ref:"#/definitions/Gate"},status:{type:"string",enum:["pending","open","baselined","reopened"]},budget:{$ref:"#/definitions/Budget"},produced:{type:"array",items:{$ref:"#/definitions/Produced"}}},required:["id","name","deliverables","gate","status"],additionalProperties:false},Policy:{anyOf:[{type:"object",properties:{kind:{type:"string",const:"evidence"},evidenceKind:{type:"string"}},required:["kind","evidenceKind"],additionalProperties:false},{type:"object",properties:{kind:{type:"string",const:"acceptance-written"}},required:["kind"],additionalProperties:false},{type:"object",properties:{kind:{type:"string",const:"estimate-present"}},required:["kind"],additionalProperties:false},{type:"object",properties:{kind:{type:"string",const:"no-open-blockers"}},required:["kind"],additionalProperties:false},{type:"object",properties:{kind:{type:"string",const:"dependencies-done"}},required:["kind"],additionalProperties:false},{type:"object",properties:{kind:{type:"string",const:"custom"},id:{type:"string"},description:{type:"string"}},required:["kind","id","description"],additionalProperties:false}]},Produced:{type:"object",properties:{kind:{type:"string"},ref:{type:"string"},by:{type:"string"},at:{type:"string"}},required:["kind","ref","by","at"],additionalProperties:false},Role:{type:"object",properties:{id:{type:"string"},name:{type:"string"},modelTier:{$ref:"#/definitions/ModelTier"},resourceClass:{type:"string"},maxConcurrent:{type:"number"},capabilities:{type:"array",items:{$ref:"#/definitions/Capability"}},canApprove:{type:"array",items:{type:"string"}},inputs:{type:"array",items:{type:"string"}},outputs:{type:"array",items:{type:"string"}},do_not:{type:"array",items:{type:"string"}},constraints:{type:"array",items:{type:"string"}}},required:["id","name","modelTier","capabilities","canApprove","inputs","outputs","do_not"],additionalProperties:false},Spent:{type:"object",properties:{tokens:{type:"number"},turns:{type:"number"},wallclockMs:{type:"number"}},required:["tokens","turns","wallclockMs"],additionalProperties:false},Stage:{type:"object",properties:{id:{type:"string"},name:{type:"string"},wipLimit:{type:"number"},entryPolicy:{type:"array",items:{$ref:"#/definitions/Policy"}},exitPolicy:{type:"array",items:{$ref:"#/definitions/Policy"}},gate:{$ref:"#/definitions/Gate"},commitmentPoint:{type:"boolean"},deliveryPoint:{type:"boolean"},review:{type:"boolean"}},required:["id","name","entryPolicy","exitPolicy"],additionalProperties:false},Transition:{type:"object",properties:{from:{type:"object",properties:{stage:{type:"string"},status:{$ref:"#/definitions/ItemStatus"}},required:["stage","status"],additionalProperties:false},to:{type:"object",properties:{stage:{type:"string"},status:{$ref:"#/definitions/ItemStatus"}},required:["stage","status"],additionalProperties:false},at:{type:"string"},by:{type:"string"}},required:["from","to","at","by"],additionalProperties:false},Verdict:{type:"string",enum:["done","blocked","needs-review","rework","escalate"]},WorkItem:{type:"object",properties:{id:{type:"string"},type:{$ref:"#/definitions/ItemType"},title:{type:"string"},description:{type:"string"},dependsOn:{type:"array",items:{type:"string"}},priority:{type:"number"},weight:{type:"number"},deadline:{type:"string"},classOfService:{$ref:"#/definitions/ClassOfService"},stage:{type:"string"},status:{$ref:"#/definitions/ItemStatus"},role:{type:"string"},parent:{type:"string"},acceptance:{type:"array",items:{type:"string"}},evidence:{type:"array",items:{$ref:"#/definitions/Evidence"}},blockers:{type:"array",items:{$ref:"#/definitions/Blocker"}},transitions:{type:"array",items:{$ref:"#/definitions/Transition"}},iteration:{type:"string"},traces:{type:"array",items:{type:"string"}},tags:{type:"array",items:{type:"string"}},affects:{type:"array",items:{type:"string"}},phase:{type:"string"},impactAnalysis:{$ref:"#/definitions/ImpactAnalysis"}},required:["id","type","title","dependsOn","stage","status","acceptance","evidence","blockers","transitions"],additionalProperties:false},WorkflowExt:{type:"object",properties:{investigation:{$ref:"#/definitions/InvestigationState"},experimentation:{$ref:"#/definitions/ExperimentationState"}},additionalProperties:{}},WorkflowState:{type:"object",properties:{version:{type:"number",const:1},methodology:{$ref:"#/definitions/MethodologyName"},config:{},investigation:{$ref:"#/definitions/InvestigationState",deprecated:true},experimentation:{$ref:"#/definitions/ExperimentationState",deprecated:true},ext:{$ref:"#/definitions/WorkflowExt"},items:{type:"object",additionalProperties:{$ref:"#/definitions/WorkItem"}},stages:{type:"array",items:{$ref:"#/definitions/Stage"}},roles:{type:"object",additionalProperties:{$ref:"#/definitions/Role"}},iterations:{type:"array",items:{$ref:"#/definitions/Iteration"}},phases:{type:"array",items:{$ref:"#/definitions/Phase"}},baseline:{$ref:"#/definitions/Baseline"},baselines:{type:"array",items:{$ref:"#/definitions/Baseline"}},events:{type:"array",items:{$ref:"#/definitions/Event"}},accounting:{type:"array",items:{$ref:"#/definitions/Accounting"}},pending:{type:"array",items:{$ref:"#/definitions/PendingHuman"}},lessons:{type:"array",items:{$ref:"#/definitions/Lesson"}},agreements:{type:"array",items:{type:"string"}}},required:["version","methodology","config","items","stages","roles","iterations","events","accounting","pending","lessons","agreements"],additionalProperties:false}},h={Budget:{type:"object",properties:{tokens:{type:"number"},turns:{type:"number"},wallclockMs:{type:"number"}},additionalProperties:false},EstimateMode:{type:"string",enum:["per-weight","per-call"]},Policy:{anyOf:[{type:"object",properties:{kind:{type:"string",const:"evidence"},evidenceKind:{type:"string"}},required:["kind","evidenceKind"],additionalProperties:false},{type:"object",properties:{kind:{type:"string",const:"acceptance-written"}},required:["kind"],additionalProperties:false},{type:"object",properties:{kind:{type:"string",const:"estimate-present"}},required:["kind"],additionalProperties:false},{type:"object",properties:{kind:{type:"string",const:"no-open-blockers"}},required:["kind"],additionalProperties:false},{type:"object",properties:{kind:{type:"string",const:"dependencies-done"}},required:["kind"],additionalProperties:false},{type:"object",properties:{kind:{type:"string",const:"custom"},id:{type:"string"},description:{type:"string"}},required:["kind","id","description"],additionalProperties:false}]},ScrumConfig:{type:"object",properties:{sprintBudget:{$ref:"#/definitions/Budget"},productGoal:{type:"string"},definitionOfDone:{type:"array",items:{$ref:"#/definitions/Policy"}},refinementSharePct:{type:"number"},allowMidSprintAdd:{type:"string",enum:["never","po-only","any"]},inProgressWipLimit:{type:"number"},autoClose:{type:"boolean"},estimateMode:{$ref:"#/definitions/EstimateMode"},fallbackTokensPerWeight:{type:"number"}},required:["sprintBudget","productGoal","definitionOfDone","refinementSharePct","allowMidSprintAdd"],additionalProperties:false}},P={ClassConfig:{type:"object",properties:{wipBypass:{type:"number"},sle:{$ref:"#/definitions/ServiceLevel"}},additionalProperties:false},KanbanColumn:{type:"object",properties:{id:{type:"string"},name:{type:"string"},wipLimit:{type:"number"},policies:{type:"array",items:{$ref:"#/definitions/Policy"}},commitmentPoint:{type:"boolean"},deliveryPoint:{type:"boolean"},review:{type:"boolean"}},required:["id","name","policies"],additionalProperties:false},KanbanConfig:{type:"object",properties:{columns:{type:"array",items:{$ref:"#/definitions/KanbanColumn"}},classesOfService:{type:"object",properties:{expedite:{$ref:"#/definitions/ClassConfig"},"fixed-date":{$ref:"#/definitions/ClassConfig"},standard:{$ref:"#/definitions/ClassConfig"},intangible:{$ref:"#/definitions/ClassConfig"}},additionalProperties:false},fairness:{type:"object",properties:{aging:{type:"boolean"},maxDeferralRounds:{type:"number"}},required:["aging","maxDeferralRounds"],additionalProperties:false},cadences:{type:"object",properties:{replenishment:{type:"object",properties:{everyTurns:{type:"number"}},additionalProperties:false},"delivery-planning":{type:"object",properties:{everyTurns:{type:"number"}},additionalProperties:false},"service-delivery-review":{type:"object",properties:{everyTurns:{type:"number"}},additionalProperties:false},"operations-review":{type:"object",properties:{everyTurns:{type:"number"}},additionalProperties:false},"risk-review":{type:"object",properties:{everyTurns:{type:"number"}},additionalProperties:false},"strategy-review":{type:"object",properties:{everyTurns:{type:"number"}},additionalProperties:false}},additionalProperties:false},throughputWindowMs:{type:"number"},maxExpedite:{type:"number"}},required:["columns","classesOfService","fairness","cadences","throughputWindowMs","maxExpedite"],additionalProperties:false},Policy:{anyOf:[{type:"object",properties:{kind:{type:"string",const:"evidence"},evidenceKind:{type:"string"}},required:["kind","evidenceKind"],additionalProperties:false},{type:"object",properties:{kind:{type:"string",const:"acceptance-written"}},required:["kind"],additionalProperties:false},{type:"object",properties:{kind:{type:"string",const:"estimate-present"}},required:["kind"],additionalProperties:false},{type:"object",properties:{kind:{type:"string",const:"no-open-blockers"}},required:["kind"],additionalProperties:false},{type:"object",properties:{kind:{type:"string",const:"dependencies-done"}},required:["kind"],additionalProperties:false},{type:"object",properties:{kind:{type:"string",const:"custom"},id:{type:"string"},description:{type:"string"}},required:["kind","id","description"],additionalProperties:false}]},ServiceLevel:{type:"object",properties:{percentile:{type:"number"},targetMs:{type:"number"}},required:["percentile","targetMs"],additionalProperties:false}},k={Budget:{type:"object",properties:{tokens:{type:"number"},turns:{type:"number"},wallclockMs:{type:"number"}},additionalProperties:false},Gate:{type:"object",properties:{id:{type:"string"},requires:{type:"array",items:{$ref:"#/definitions/GateRequirement"}},evidence:{type:"array",items:{type:"string"}},onFail:{anyOf:[{type:"object",properties:{action:{type:"string",const:"block"}},required:["action"],additionalProperties:false},{type:"object",properties:{action:{type:"string",const:"return-to"},stage:{type:"string"}},required:["action","stage"],additionalProperties:false}]}},required:["id","requires","evidence","onFail"],additionalProperties:false},GateRequirement:{anyOf:[{type:"string",const:"human"},{type:"object",properties:{capability:{type:"string"}},required:["capability"],additionalProperties:false}]},WaterfallConfig:{type:"object",properties:{phases:{type:"array",items:{$ref:"#/definitions/WaterfallPhaseConfig"}},changeControl:{type:"object",properties:{requiresImpactAnalysis:{type:"boolean"},approvers:{type:"array",items:{$ref:"#/definitions/GateRequirement"}}},required:["requiresImpactAnalysis","approvers"],additionalProperties:false},traceability:{type:"object",properties:{from:{type:"string"},to:{type:"array",items:{type:"string"}}},required:["from","to"],additionalProperties:false},humanGates:{anyOf:[{type:"string",const:"all"},{type:"array",items:{type:"string"}}]},fallbackTokensPerWeight:{type:"number"}},required:["phases","changeControl","traceability","humanGates"],additionalProperties:false},WaterfallPhaseConfig:{type:"object",properties:{id:{type:"string"},name:{type:"string"},deliverables:{type:"array",items:{type:"string"}},gate:{$ref:"#/definitions/Gate"},budget:{$ref:"#/definitions/Budget"},deliverBy:{type:"string"}},required:["id","name","deliverables","gate"],additionalProperties:false}},$={Budget:{type:"object",properties:{tokens:{type:"number"},turns:{type:"number"},wallclockMs:{type:"number"}},additionalProperties:false},InvestigationConfig:{type:"object",properties:{question:{type:"string"},maxRounds:{type:"number"},budget:{$ref:"#/definitions/Budget"}},required:["question","maxRounds","budget"],additionalProperties:false}},j={Budget:{type:"object",properties:{tokens:{type:"number"},turns:{type:"number"},wallclockMs:{type:"number"}},additionalProperties:false},ExperimentationConfig:{type:"object",properties:{objective:{type:"string"},direction:{type:"string",enum:["minimize","maximize"]},tieBreak:{type:"string",const:"candidate-id"},concurrencyCap:{type:"number"},maxCandidates:{type:"number"},candidateBudget:{$ref:"#/definitions/Budget"},totalBudget:{$ref:"#/definitions/Budget"}},required:["objective","direction","tieBreak","concurrencyCap","maxCandidates","candidateBudget","totalBudget"],additionalProperties:false}};var S="#/definitions/";function m(e){return e===null?"null":Array.isArray(e)?"array":typeof e}function w(e,t){return e==="integer"?typeof t=="number"&&Number.isInteger(t):m(t)===e}function p(e){let t=JSON.stringify(e);return t===void 0?String(e):t.length>60?`${t.slice(0,57)}...`:t}function q(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function v(e,t){return JSON.stringify(e)===JSON.stringify(t)}function d(e,t,s,n,i){return {path:e===""?"/":e,keyword:t,message:s,expected:n,found:i}}function O(e,t){e.startsWith(S)||b("invalid-input",`schema $ref ${JSON.stringify(e)} is not #/definitions/<name>`,"regenerate the schema with pnpm schema:gen");let s=e.slice(S.length),n=t.definitions&&Object.hasOwn(t.definitions,s)?t.definitions[s]:void 0;return n||b("invalid-input",`schema $ref ${JSON.stringify(e)} names no definition`,"regenerate the schema with pnpm schema:gen"),n}function x(e,t){let s=t===""?"/":t;return e.reduce((n,i)=>n+(i.keyword==="type"&&i.path===s?1e3:i.keyword==="const"?100:1),0)}function E(e){let t=e[0]?.filter(s=>s.keyword==="const")??[];for(let s of t){let n=e.map(r=>r.find(o=>o.keyword==="const"&&o.path===s.path));if(n.some(r=>r===void 0))continue;let i=[...new Set(n.map(r=>r?.expected))].join(" | ");return {path:s.path,keyword:"enum",message:`expected one of ${i}`,expected:i,found:s.found}}}function I(e,t){return f(e,t,e,"")}function f(e,t,s,n){if(e.$ref!==void 0)return f(O(e.$ref,s),t,s,n);let i=[];if(e.type!==void 0){let r=Array.isArray(e.type)?e.type:[e.type];if(!r.some(o=>w(o,t))){let o=r.join(" | ");return [d(n,"type",`expected ${o}, got ${m(t)}`,o,p(t))]}}if(e.const!==void 0&&!v(t,e.const)&&i.push(d(n,"const",`expected ${p(e.const)}`,p(e.const),p(t))),e.enum!==void 0&&!e.enum.some(r=>v(r,t))){let r=e.enum.map(p).join(" | ");i.push(d(n,"enum",`expected one of ${r}`,r,p(t)));}if(typeof t=="number"&&(e.minimum!==void 0&&t<e.minimum&&i.push(d(n,"minimum",`expected >= ${e.minimum}`,`>= ${e.minimum}`,p(t))),e.maximum!==void 0&&t>e.maximum&&i.push(d(n,"maximum",`expected <= ${e.maximum}`,`<= ${e.maximum}`,p(t)))),typeof t=="string"&&(e.minLength!==void 0&&t.length<e.minLength&&i.push(d(n,"minLength",`expected at least ${e.minLength} characters`,`length >= ${e.minLength}`,p(t))),e.pattern!==void 0&&!new RegExp(e.pattern,"u").test(t)&&i.push(d(n,"pattern",`expected to match /${e.pattern}/`,`/${e.pattern}/`,p(t)))),Array.isArray(t)&&e.items!==void 0){let r=e.items;t.forEach((o,c)=>i.push(...f(r,o,s,`${n}/${c}`)));}if(m(t)==="object"){let r=t;for(let[o,c]of Object.entries(r)){let g=e.properties&&Object.hasOwn(e.properties,o)?e.properties[o]:void 0,y=`${n}/${q(o)}`;if(g)i.push(...f(g,c,s,y));else if(e.additionalProperties===false){let b=Object.keys(e.properties??{}).join(", ");i.push(d(y,"additionalProperties",`unknown property ${JSON.stringify(o)}`,b?`one of ${b}`:"no properties",o));}else typeof e.additionalProperties=="object"&&i.push(...f(e.additionalProperties,c,s,y));}for(let o of e.required??[])Object.hasOwn(r,o)||i.push(d(`${n}/${q(o)}`,"required",`missing required property ${JSON.stringify(o)}`,"present","absent"));}if(e.anyOf!==void 0){let r,o=[];for(let g of e.anyOf){let y=f(g,t,s,n);if(y.length===0){r=[];break}o.push(y),(r===void 0||x(y,n)<x(r,n))&&(r=y);}let c=r&&r.length>0?E(o):void 0;c?i.push(c):r&&i.push(...r);}return i}function C(e,t,s){let n=I(e,t),i=n[0];if(!i)return;let r=n.length>1?` (+${n.length-1} more)`:"";b("invalid-input",`${s} does not match its schema: ${i.path} ${i.message}${r}`,`fix ${s} at ${i.path}: expected ${i.expected}, found ${i.found}`);}var N="http://json-schema.org/draft-07/schema#";function a(e,t){return {$schema:N,$ref:`#/definitions/${e}`,definitions:t}}var J=a("WorkflowState",l),M=a("Role",l),_=a("NewItem",l),D=a("ItemPatch",l),F=a("Handoff",l),L=a("ScrumConfig",h),W=a("KanbanConfig",P),G=a("WaterfallConfig",k),K=a("InvestigationConfig",$),H=a("ExperimentationConfig",j);
|
|
2
|
+
export{I as a,C as b,N as c,J as d,M as e,_ as f,D as g,F as h,L as i,W as j,G as k,K as l,H as m};//# sourceMappingURL=chunk-QJMOCISZ.mjs.map
|
|
3
|
+
//# sourceMappingURL=chunk-QJMOCISZ.mjs.map
|
|
@@ -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","INVESTIGATION_DEFINITIONS","EXPERIMENTATION_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","investigationConfigSchema","experimentationConfigSchema"],"mappings":"qCAIO,IAAMA,CAAAA,CAA+C,CAC1D,UAAA,CAAY,CACV,KAAM,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,QAAS,CACP,IAAA,CAAM,QACR,CAAA,CACA,SAAU,CACR,IAAA,CAAM,SACR,CACF,EACA,QAAA,CAAU,CACR,MAAA,CACA,MAAA,CACA,QACA,UAAA,CACA,WAAA,CACA,YAAA,CACA,WAAA,CACA,SACF,CAAA,CACA,oBAAA,CAAsB,KACxB,CAAA,CACA,SAAU,CACR,IAAA,CAAM,QAAA,CACN,UAAA,CAAY,CACV,KAAA,CAAO,CACL,IAAA,CAAM,QACR,CAAA,CACA,OAAA,C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oE,CAAAA,CAAoBP,CAAAA,CAAS,cAAe5D,CAAiB,CAAA,CAC7DoE,CAAAA,CAAqBR,CAAAA,CAAS,eAAgB3D,CAAkB,CAAA,CAChEoE,CAAAA,CAAwBT,CAAAA,CAAS,kBAAmB1D,CAAqB,CAAA,CACzEoE,CAAAA,CAA4BV,CAAAA,CAAS,sBAAuBzD,CAAyB,CAAA,CACrFoE,CAAAA,CAA8BX,CAAAA,CACzC,wBACAxD,CACF","file":"chunk-QJMOCISZ.mjs","sourcesContent":["// GENERATED by scripts/gen-schema.mjs from src/core/types.ts and methodology config.ts files.\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 BeliefUpdate: {\n type: \"object\",\n properties: {\n result: {\n type: \"string\",\n },\n assessments: {\n type: \"array\",\n items: {\n type: \"object\",\n properties: {\n hypothesis: {\n type: \"string\",\n },\n assessment: {\n type: \"string\",\n enum: [\"supported\", \"refuted\", \"uncertain\"],\n },\n reason: {\n type: \"string\",\n },\n },\n required: [\"hypothesis\", \"assessment\", \"reason\"],\n additionalProperties: false,\n },\n },\n },\n required: [\"result\", \"assessments\"],\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 data: {\n type: \"object\",\n additionalProperties: {},\n },\n },\n required: [\"kind\", \"ref\", \"by\", \"at\"],\n additionalProperties: false,\n },\n Experiment: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n },\n procedureRef: {\n type: \"string\",\n },\n predictions: {\n type: \"array\",\n items: {\n type: \"object\",\n properties: {\n hypothesis: {\n type: \"string\",\n },\n prediction: {\n type: \"string\",\n },\n },\n required: [\"hypothesis\", \"prediction\"],\n additionalProperties: false,\n },\n },\n replayOf: {\n type: \"string\",\n },\n },\n required: [\"id\", \"procedureRef\", \"predictions\"],\n additionalProperties: false,\n },\n ExperimentCandidate: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n },\n item: {\n type: \"string\",\n },\n author: {\n type: \"string\",\n },\n status: {\n type: \"string\",\n enum: [\n \"pending\",\n \"ready\",\n \"running\",\n \"submitted\",\n \"validated\",\n \"failed\",\n \"timed-out\",\n \"cancelled\",\n ],\n },\n workspace: {\n type: \"string\",\n },\n sha: {\n type: \"string\",\n },\n score: {\n type: \"number\",\n },\n spent: {\n $ref: \"#/definitions/Spent\",\n },\n validation: {\n type: \"object\",\n properties: {\n sha: {\n type: \"string\",\n },\n harness: {\n type: \"string\",\n },\n by: {\n type: \"string\",\n },\n passed: {\n type: \"boolean\",\n },\n reproducible: {\n type: \"boolean\",\n },\n evidence: {\n type: \"string\",\n },\n },\n required: [\"sha\", \"harness\", \"by\", \"passed\", \"reproducible\", \"evidence\"],\n additionalProperties: false,\n },\n reason: {\n type: \"string\",\n },\n command: {\n type: \"string\",\n },\n log: {\n type: \"string\",\n },\n terminalLog: {\n type: \"string\",\n },\n },\n required: [\"id\", \"item\", \"author\", \"status\", \"spent\"],\n additionalProperties: false,\n },\n ExperimentationState: {\n type: \"object\",\n properties: {\n status: {\n type: \"string\",\n enum: [\"running\", \"selected\", \"integrating\", \"integrated\", \"stopped\"],\n },\n baseSha: {\n type: \"string\",\n },\n harness: {\n type: \"string\",\n },\n candidates: {\n type: \"object\",\n additionalProperties: {\n $ref: \"#/definitions/ExperimentCandidate\",\n },\n },\n selected: {\n type: \"string\",\n },\n reason: {\n type: \"string\",\n },\n integration: {\n type: \"object\",\n properties: {\n selectedSha: {\n type: \"string\",\n },\n targetSha: {\n type: \"string\",\n },\n sha: {\n type: \"string\",\n },\n by: {\n type: \"string\",\n },\n validation: {\n type: \"object\",\n properties: {\n by: {\n type: \"string\",\n },\n sha: {\n type: \"string\",\n },\n harness: {\n type: \"string\",\n },\n evidence: {\n type: \"string\",\n },\n passed: {\n type: \"boolean\",\n },\n },\n required: [\"by\", \"sha\", \"harness\", \"evidence\", \"passed\"],\n additionalProperties: false,\n },\n },\n required: [\"selectedSha\", \"targetSha\", \"sha\", \"by\"],\n additionalProperties: false,\n },\n released: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n overhead: {\n $ref: \"#/definitions/Spent\",\n },\n },\n required: [\"status\", \"baseSha\", \"harness\", \"candidates\", \"released\", \"overhead\"],\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 Hypothesis: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n },\n claim: {\n type: \"string\",\n },\n falsifiedBy: {\n type: \"string\",\n },\n },\n required: [\"id\", \"claim\", \"falsifiedBy\"],\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 InvestigationConclusion: {\n type: \"object\",\n properties: {\n outcome: {\n type: \"string\",\n enum: [\"resolved\", \"inconclusive\"],\n },\n summary: {\n type: \"string\",\n },\n supportedHypothesis: {\n type: \"string\",\n },\n evidenceRefs: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n by: {\n type: \"string\",\n },\n },\n required: [\"outcome\", \"summary\", \"evidenceRefs\", \"by\"],\n additionalProperties: false,\n },\n InvestigationRound: {\n type: \"object\",\n properties: {\n hypotheses: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/Hypothesis\",\n },\n },\n experiment: {\n $ref: \"#/definitions/Experiment\",\n },\n item: {\n type: \"string\",\n },\n by: {\n type: \"string\",\n },\n result: {\n $ref: \"#/definitions/Observation\",\n },\n update: {\n $ref: \"#/definitions/BeliefUpdate\",\n },\n },\n required: [\"hypotheses\", \"experiment\", \"item\", \"by\"],\n additionalProperties: false,\n },\n InvestigationState: {\n type: \"object\",\n properties: {\n item: {\n type: \"string\",\n },\n phase: {\n type: \"string\",\n enum: [\n \"hypotheses\",\n \"preregister\",\n \"observe\",\n \"update-belief\",\n \"conclusion\",\n \"review\",\n \"closed\",\n ],\n },\n hypotheses: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/Hypothesis\",\n },\n },\n singleHypothesisRationale: {\n type: \"string\",\n },\n rounds: {\n type: \"array\",\n items: {\n $ref: \"#/definitions/InvestigationRound\",\n },\n },\n conclusion: {\n $ref: \"#/definitions/InvestigationConclusion\",\n },\n outcome: {\n type: \"string\",\n enum: [\"resolved\", \"inconclusive\", \"stopped\"],\n },\n stopReason: {\n type: \"string\",\n },\n contributors: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n reviewHistory: {\n type: \"array\",\n items: {\n type: \"object\",\n properties: {\n by: {\n type: \"string\",\n },\n reason: {\n type: \"string\",\n },\n approve: {\n type: \"boolean\",\n },\n next: {\n type: \"string\",\n enum: [\"round\", \"conclusion\"],\n },\n replayRefs: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n },\n required: [\"by\", \"reason\", \"approve\", \"replayRefs\"],\n additionalProperties: false,\n },\n },\n review: {\n type: \"object\",\n properties: {\n by: {\n type: \"string\",\n },\n reason: {\n type: \"string\",\n },\n replayRefs: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n },\n required: [\"by\", \"reason\", \"replayRefs\"],\n additionalProperties: false,\n },\n },\n required: [\"item\", \"phase\", \"hypotheses\", \"rounds\", \"contributors\"],\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\", \"investigation\", \"experimentation\"],\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 Observation: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n },\n valid: {\n type: \"boolean\",\n },\n summary: {\n type: \"string\",\n },\n provenanceRefs: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n },\n required: [\"id\", \"valid\", \"summary\", \"provenanceRefs\"],\n additionalProperties: false,\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 WorkflowExt: {\n type: \"object\",\n properties: {\n investigation: {\n $ref: \"#/definitions/InvestigationState\",\n },\n experimentation: {\n $ref: \"#/definitions/ExperimentationState\",\n },\n },\n additionalProperties: {},\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 investigation: {\n $ref: \"#/definitions/InvestigationState\",\n deprecated: true,\n },\n experimentation: {\n $ref: \"#/definitions/ExperimentationState\",\n deprecated: true,\n },\n ext: {\n $ref: \"#/definitions/WorkflowExt\",\n },\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\nexport const INVESTIGATION_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 InvestigationConfig: {\n type: \"object\",\n properties: {\n question: {\n type: \"string\",\n },\n maxRounds: {\n type: \"number\",\n },\n budget: {\n $ref: \"#/definitions/Budget\",\n },\n },\n required: [\"question\", \"maxRounds\", \"budget\"],\n additionalProperties: false,\n },\n};\n\nexport const EXPERIMENTATION_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 ExperimentationConfig: {\n type: \"object\",\n properties: {\n objective: {\n type: \"string\",\n },\n direction: {\n type: \"string\",\n enum: [\"minimize\", \"maximize\"],\n },\n tieBreak: {\n type: \"string\",\n const: \"candidate-id\",\n },\n concurrencyCap: {\n type: \"number\",\n },\n maxCandidates: {\n type: \"number\",\n },\n candidateBudget: {\n $ref: \"#/definitions/Budget\",\n },\n totalBudget: {\n $ref: \"#/definitions/Budget\",\n },\n },\n required: [\n \"objective\",\n \"direction\",\n \"tieBreak\",\n \"concurrencyCap\",\n \"maxCandidates\",\n \"candidateBudget\",\n \"totalBudget\",\n ],\n additionalProperties: false,\n },\n};\n","import { fail } from \"../core/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 INVESTIGATION_DEFINITIONS,\n EXPERIMENTATION_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);\nexport const investigationConfigSchema = document(\"InvestigationConfig\", INVESTIGATION_DEFINITIONS);\nexport const experimentationConfigSchema = document(\n \"ExperimentationConfig\",\n EXPERIMENTATION_DEFINITIONS,\n);\n\nexport { validate, assertValid } from \"./validate.ts\";\nexport type { JsonSchema, JsonSchemaDocument, SchemaError } from \"./types.ts\";\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a}from'./chunk-C4ISBUZR.mjs';import {a as a$1}from'./chunk-WU5JELOM.mjs';import {l,z,D as D$1,F,E as E$1,s,V,A,H}from'./chunk-NNQ3RHDP.mjs';import {b as b$1,c}from'./chunk-YS6CXERQ.mjs';function $(e,n){let i=D$1(e),o=i.transitions.get(n.id)??[],t=n.transitions,c=F(i,n.id,o),d=c===void 0||o.length!==t.length?t:t.slice(t.length-c),r=new Set;for(let s of d)s.to.status==="in_progress"&&r.add(s.by);for(let s of [n.role,H(e,n)])s!==void 0&&r.add(s);return [...r]}var v=a(["low","medium","high","critical"]),G=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),R=(e,n)=>Object.hasOwn(e,n)?e[n]:void 0,Y=new WeakSet;function I(e,n){if(typeof e=="object"&&e!==null&&Y.has(e))return e;let i=(a,p)=>b$1("invalid-input",`${n} options: ${a}`,p),o=(a,p,m)=>{for(let y of Object.keys(a))p.includes(y)||i(`unknown key "${y}" in ${m}`,`use only: ${p.join(", ")}`);},t=(a,p)=>{if(a==="human")return a;let m=G(a)?R(a,"capability"):void 0;return (typeof m!="string"||m.trim()===""||Object.keys(a).length!==1)&&i(`${p} must be "human" or { capability: <name> }`,'e.g. ["human"] or [{ "capability": "review" }]'),{capability:m}};G(e)||i("must be an object",'pass { "gates": ["code-review"] }');let c$1=e;o(c$1,["gates","table"],"options");let d=R(c$1,"gates");Array.isArray(d)||i("gates must be an array of gate ids",'e.g. "gates": ["code-review"]');let r=d.map(a=>(c(a,"risk gate id"),a)),s=R(c$1,"table"),u;if(s!==void 0){G(s)||i("table must be an object keyed by risk level",`levels: ${v.join(", ")}`);let a=s;o(a,v,"table"),u={};let p=[];for(let m of v){let y=R(a,m);G(y)||i(`table is missing level "${m}"`,`give every level a row, e.g. "${m}": { "requires": [] }`);let h=y;o(h,["requires","evidence"],`table.${m}`);let l=R(h,"requires");Array.isArray(l)||i(`table.${m}.requires must be an array`,'e.g. "requires": ["human"]');let g=R(h,"evidence");g!==void 0&&(!Array.isArray(g)||!g.every(k=>typeof k=="string"&&k.trim()!==""))&&i(`table.${m}.evidence must be an array of evidence kinds`,'e.g. "evidence": ["sbom"]');let w=l.map((k,oe)=>t(k,`table.${m}.requires[${oe}]`)),O=g===void 0?void 0:[...g],V=[...w.map(k=>JSON.stringify(k)),...(O??[]).map(k=>`evidence ${JSON.stringify(k)}`)],J=p.filter(k=>!V.includes(k));J.length&&i(`table.${m} must include everything the level below it adds (missing ${J.join(", ")})`,"a stricter level only adds: copy the lower level's requires and evidence into it"),p=V,u[m]={requires:w,...O===void 0?{}:{evidence:O}};}}let f=a(u?{gates:r,table:u}:{gates:r});return Y.add(f),f}var re=a({low:{requires:[]},medium:{requires:[]},high:{requires:["human"]},critical:{requires:["human"]}}),se=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function ae(e){return se(e)&&v.includes(e.level)&&Array.isArray(e.factors)&&e.factors.every(n=>typeof n=="string")&&(e.subject===void 0||typeof e.subject=="string")}function ce(e,n,i,o=$(e,n)){return l(e,i,"verify")?a$1(i,o).length?"not-independent":void 0:"invalid"}function Z(e,n,i,o){let t=I(o,"riskEscalation");if(!t.gates.includes(i.id))return;let c,d="missing",r,s;for(let a of z(e,n)){if(a.kind!=="risk-assessment")continue;let p=ae(a.data)?ce(e,n,a.by,s??=$(e,n)):"invalid";if(p){c||(d=p,r=a);continue}let m=a.data.level;(!c||v.indexOf(m)>=v.indexOf(c))&&(c=m,d="assessed",r=a);}let u=c??"critical",f=(t.table??re)[u];return {requires:f.requires.map(a=>a==="human"?a:{capability:a.capability}),evidence:[...f.evidence??[]],reason:{level:u,why:d,assessment:r?.ref??null,by:r?.by??null}}}var N=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),C=e=>typeof e=="string"&&e.trim()!=="",W=(e,n)=>Object.keys(e).find(i=>!n.includes(i));function ue(e){return e<32||e>=127&&e<=159||e===1564||e===8206||e===8207||e>=8234&&e<=8238||e>=8294&&e<=8297}function de(e){let n=typeof e!="string"?"not a string":e.length>4096?"longer than 4096 characters":[...e].some(o=>ue(o.codePointAt(0)))?"has a control or bidirectional formatting character":e!==e.trim()?"has leading or trailing whitespace":e!==e.normalize("NFC")?"is not Unicode NFC":e.includes("\\")||/^[A-Za-z]:/.test(e)||!e.split("/").every(o=>o!==""&&o!=="."&&o!=="..")?"is not relative with / separators and no empty, . or .. segment":void 0;return n?`${JSON.stringify(typeof e=="string"&&e.length>80?`${e.slice(0,80)}\u2026`:e)} is not a repository-relative POSIX path (${n})`:void 0}function L(e){if(!N(e))return "data must be an object";let n=W(e,["revision","assumptions"]);if(n)return `unknown key "${n}"`;if(!C(e.revision))return "revision must be a non-empty string";let i=e.assumptions;if(!Array.isArray(i))return "assumptions must be an array";for(let[o,t]of i.entries()){let c=`assumptions[${o}]`;if(!N(t))return `${c} must be an object`;let d=W(t,["claim","required","source"]);if(d)return `unknown key "${d}" in ${c}`;if(!C(t.claim))return `${c}.claim must be a non-empty string`;if(t.required!==void 0&&typeof t.required!="boolean")return `${c}.required must be a boolean`;let r=t.source;if(r===void 0)continue;if(!N(r))return `${c}.source must be an object`;let s=W(r,["path","lines","hash"]);if(s)return `unknown key "${s}" in ${c}.source`;let u=de(r.path);if(u)return `${c}.source.path ${u}`;if(!C(r.hash))return `${c}.source.hash must be a non-empty string`;let f=r.lines;if(f!==void 0&&!(Array.isArray(f)&&f.length===2&&Number.isInteger(f[0])&&Number.isInteger(f[1])&&1<=f[0]&&f[0]<=f[1]))return `${c}.source.lines must be two integers [from, to] with 1 <= from <= to`}}function ee(e,n,i){return typeof n!="string"||n!=="human"&&!Object.hasOwn(e.roles,n)?`${JSON.stringify(n)} is neither human nor a registered role`:i.includes(n)?`"${n}" worked on the item`:void 0}var ne=e=>e.assumptions.some(n=>n.source),Q=({source:e,...n})=>e?{...n,source:{...e,...e.lines?{lines:[...e.lines]}:{}}}:n;function E(e,n){let i=D$1(e),o=i.evidence.get(n.id)??[],t=n.evidence,c=F(i,n.id,o),d=c===void 0?t.length:Math.min(c,t.length),r,s=u=>{let f=t[u];if(f.kind!=="context-snapshot"||L(f.data)!==void 0)return;let a=f.data;return !ne(a)||ee(e,f.by,r??=$(e,n))?void 0:a};for(let u=t.length-1;u>=t.length-d;u--){let f=t[u],a=s(u);if(!a)continue;let p=new Set;for(let l=t.length-1;l>=t.length-d;l--){let g=t[l];if(l!==u&&g.kind==="context-snapshot"&&L(g.data)===void 0)for(let w of g.data.assumptions)w.required&&p.add(w.claim);}let m=a.assumptions.map(l=>p.has(l.claim)?{...Q(l),required:true}:Q(l));for(let l of p)a.assumptions.some(g=>g.claim===l)||m.push({claim:l,required:true});let y=o[u+o.length-t.length]??-1,h=[];for(let l of new Set(a.assumptions.map(g=>g.source?.path))){let g=l===void 0?void 0:i.changed.get(l),w=g?E$1(g,y,O=>O[0]):0;g&&w<g.length&&h.push([g[w][0],g[w][1],l]);}return h.sort((l,g)=>l[0]-g[0]||l[1]-g[1]),{revision:a.revision,assumptions:m,snapshot:f.ref,by:f.by,stale:h.map(l=>l[2]),unverified:m.filter(l=>!l.source).map(l=>l.claim)}}}var D=["item","revision","assumptions","ref","by","now"],b=(e,n)=>b$1("invalid-input",`context snapshot: ${e}`,n);function Ee(e,n,i){N(i)||b("input must be an object",`pass { ${D.join(", ")} }`);let o=W(i,D);o&&b(`unknown key "${o}"`,`use only: ${D.join(", ")}`);let{item:t,revision:c,assumptions:d,ref:r,by:s$1,now:u}=i;typeof t!="string"&&b("item must be an item id",'e.g. "item": "CART-12"');let f=s(e,t),a={revision:c,assumptions:d},p=L(a);p&&b(p,'e.g. { "revision": "4f2c1e0", "assumptions": [{ "claim": "totals are cents", "source": { "path": "src/cart.ts", "hash": "\u2026" } }] }'),C(r)||b("ref must be a non-empty string",'name the snapshot artifact, e.g. "ctx/CART-12.json"'),C(s$1)||b("by must name who recorded it",'e.g. "by": "scout"');let m=ee(e,s$1,$(e,f));m&&b(`${m} and may not record its context`,"record as human or a registered role that did not work on the item"),ne(a)||b("a snapshot needs at least one assumption with a source (nothing was verified)",'cite what was checked, e.g. "source": { "path": "src/cart.ts", "hash": "\u2026" }'),u!==void 0&&typeof u!="string"&&b("now must be an ISO timestamp string","omit now to use the clock");let y=JSON.parse(JSON.stringify(a));return V(e,n,{type:"context.snapshot",by:s$1,payload:{item:t,ref:r,...y}},h=>A(h,t,{kind:"context-snapshot",ref:r,by:s$1,data:y},u))}var fe="policy:custom:context-grounded",P="record a fresh one with recordContextSnapshot";function te(e,n){let i=[],o=(s,u)=>i.push({rule:fe,severity:"error",item:n.id,message:s,fix:u}),t=E(e,n);if(!t)return o(`item "${n.id}" has no qualifying context snapshot (none since its last rework is valid, cites a source and was recorded by human or a registered role that did not work on it)`,`have an independent role or a human verify the context and ${P}`),i;let c=`context snapshot "${t.snapshot}" of "${n.id}"`;t.stale.length&&o(`${c} is stale: ${t.stale.join(", ")} changed since`,`re-verify the claims and ${P}`);let r=t.assumptions.filter(s=>s.required).filter(s=>!s.source).map(s=>s.claim);return r.length&&o(`${c} has unverified required assumption(s): ${r.join(" | ")}`,`cite a source { path, hash } for each and ${P}`),i}var le=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function _e(e,n){let i=I(n,"withRiskGate"),o=e.escalateGate;return {...e,escalateGate(t,c,d){let r=Z(t,c,d,i),s=o?.call(e,t,c,d);return !s||!r?s??r:{requires:[...s.requires,...r.requires],evidence:[...s.evidence,...r.evidence],reason:{...s.reason,...r.reason}}}}}var T="context-grounded",me={kind:"custom",id:T,description:"grounded in a fresh, verified context snapshot"},M=(e,n)=>b$1("invalid-input",`withContextGrounding options: ${e}`,n);function ie(e,n){let i=e[n];return i===void 0&&n==="exit"?[]:(Array.isArray(i)||M(`${n} must be an array of stage ids`,`e.g. "${n}": ["dev"]`),i.map(o=>(c(o,`context-grounded ${n} stage id`),o)))}function ze(e,n){le(n)||M("must be an object",'pass { "entry": ["dev"] }');let i=n;for(let d of Object.keys(i))d!=="entry"&&d!=="exit"&&M(`unknown key "${d}"`,"use only: entry, exit");let o=ie(i,"entry"),t=ie(i,"exit"),c=(d,r)=>r&&!d.some(s=>s.kind==="custom"&&s.id===T)?[...d,me]:d;return {...ge(e),defaultStages(d){let r=e.defaultStages(d);for(let u of [...o,...t])r.some(f=>f.id===u)||b$1("invalid-input",`withContextGrounding: unknown stage "${u}"`,`stages: ${r.map(f=>f.id).join(", ")}`);let s=pe(e.name,r);for(let[u,f]of [["entry",o],["exit",t]])for(let a of f)s[u].includes(a)&&b$1("invalid-input",`withContextGrounding: the ${e.name} ceremony that moves items ${u==="entry"?"into":"out of"} "${a}" checks its ${u} policies without the grounding hook`,`ground a later stage instead, e.g. ${u} ["${r.find(p=>!s.entry.includes(p.id)&&!s.exit.includes(p.id)&&p.id!==r[0].id)?.id??"dev"}"]`);return r.map(u=>({...u,entryPolicy:c(u.entryPolicy,o.includes(u.id)),exitPolicy:c(u.exitPolicy,t.includes(u.id))}))}}}function pe(e,n){return e==="kanban"?{entry:[],exit:n[0]?[n[0].id]:[]}:e==="scrum"?{entry:[],exit:["backlog"]}:e==="experimentation"?{entry:["building"],exit:[]}:{entry:[],exit:[]}}function ge(e){let{customPolicy:n,briefContext:i}=e;return {...e,customPolicy(o,t,c){return c.id===T?te(o,t):n?.call(e,o,t,c)},briefContext(o,t){return E(o,t)??i?.call(e,o,t)}}}export{v as a,re as b,ce as c,Z as d,de as e,E as f,Ee as g,te as h,_e as i,ze as j,ge as k};//# sourceMappingURL=chunk-QKW26EV2.mjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-QKW26EV2.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common/workers.ts","../src/common/risk/options.ts","../src/common/risk/escalation.ts","../src/common/context/snapshot.ts","../src/common/context/policy.ts","../src/interface/policies.ts"],"names":["workersOf","state","item","index","eventIndex","at","all","after","sinceRework","ts","out","t","w","authorOf","RISK_LEVELS","deepFreeze","isObj","x","own","o","k","validated","riskOptions","options","who","bad","what","fix","fail","closed","keys","requirement","q","c","gs","gates","g","assertId","raw","table","below","level","row","rw","rq","ev","requires","i","evidence","here","missing","DEFAULT_RISK_TABLE","isRiskData","data","f","assessorIssue","by","workers","canDo","independenceConflicts","riskEscalation","gate","opts","why","pick","e","freshEvidence","issue","l","resolved","nonEmpty","extra","hidden","repoPathIssue","path","ch","seg","snapshotIssue","list","a","ka","src","ks","pathIssue","recorderIssue","sourced","d","copyOf","source","rest","contextOf","fresh","qualifying","carried","j","assumptions","claim","pos","hits","firstAfter","b","h","KEYS","recordContextSnapshot","methodology","input","id","revision","ref","now","getItem","copy","applyAction","s","addEvidence","RULE","RECORD","contextGroundedViolations","v","message","ctx","of","unverified","withRiskGate","inner","prior","GROUNDED","groundedPolicy","badGrounding","stageIds","key","ids","withContextGrounding","entry","exit","add","on","p","withGroundingHooks","config","stages","st","checked","ceremonyChecked","name","customPolicy","briefContext","policy"],"mappings":"kMAeO,SAASA,CAAAA,CAAUC,CAAAA,CAA8BC,CAAAA,CAA0B,CAChF,IA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zC,CAAAA,CAAavG,CAAAA,CAAOC,CAAAA,CAAMiJ,CAAM,CACzD,CAAA,CACA,YAAA,CAAalJ,CAAAA,CAAOC,CAAAA,CAAM,CACxB,OAAOwF,CAAAA,CAAUzF,EAAOC,CAAI,CAAA,EAAKgJ,CAAAA,EAAc,IAAA,CAAK1C,CAAAA,CAAavG,CAAAA,CAAOC,CAAI,CAC9E,CACF,CACF","file":"chunk-QKW26EV2.mjs","sourcesContent":["// Who worked on an item (design spec section 27, F1 G1-1): the independence checks of the\n// risk-adaptive gate and the context-grounded policy compare an assessor or a snapshot's recorder\n// against every one of them, not only the last author.\nimport { authorOf } from \"../core/authors.ts\";\nimport type { WorkItem, WorkflowState } from \"../core/types.ts\";\nimport { eventIndex, sinceRework } from \"../core/event-index.ts\";\n\n/**\n * The roles that worked on `item`: the `by` of each dispatch (a transition into `in_progress`)\n * since the item's last `item.rework` event (or since creation), in order, then its assigned\n * `role` and its author by the 1.3 rule (`authorOf`), each once. The rework boundary is found by\n * matching `item.transitions` to the events that appended them (`item.transition`, and the\n * `blocker.*` events that carry a `transition`) from the end; when those events are not exactly as\n * many as the transitions, every transition counts (fail closed: more workers, never fewer).\n */\nexport function workersOf(state: WorkflowState<string>, item: WorkItem): string[] {\n const index = eventIndex(state);\n const at = index.transitions.get(item.id) ?? [];\n const all = item.transitions;\n const after = sinceRework(index, item.id, at);\n const ts = after === undefined || at.length !== all.length ? all : all.slice(all.length - after);\n const out = new Set<string>();\n for (const t of ts) if (t.to.status === \"in_progress\") out.add(t.by);\n for (const w of [item.role, authorOf(state, item)]) if (w !== undefined) out.add(w);\n return [...out];\n}\n","// Validation of the risk-adaptive gate options (design spec section 27, #35; F1 G1-4, G1-6): one\n// validator for `withRiskGate` (once, at wrap time) and `riskEscalation` (per call, unless given the\n// frozen options the validator itself returned), so both refuse the same input with invalid-input.\nimport { assertId, fail } from \"../../core/errors.ts\";\nimport type { GateRequirement } from \"../../core/types.ts\";\nimport { deepFreeze } from \"../deep-freeze.ts\";\nimport type { RiskGateOptions, RiskLevel, RiskTable } from \"./escalation.ts\";\n\n/** The levels, least strict first. */\nexport const RISK_LEVELS: readonly RiskLevel[] = /* @__PURE__ */ deepFreeze([\n \"low\",\n \"medium\",\n \"high\",\n \"critical\",\n]);\n\nconst isObj = (x: unknown): x is Record<string, unknown> =>\n typeof x === \"object\" && x !== null && !Array.isArray(x);\n/** `o[k]` only when `o` has it as an own property (G5-5, as `compareRuns` reads its input). */\nconst own = (o: Record<string, unknown>, k: string): unknown =>\n Object.hasOwn(o, k) ? o[k] : undefined;\nconst validated = new WeakSet<object>();\n\n/**\n * `options` validated and copied (deeply frozen), so later changes by the caller do not leak in.\n * Refuses `invalid-input`, prefixed with `who`, for: a non-object or an unknown key; `gates` not an\n * array of valid ids; a `table` that is not an object keyed by exactly the four levels, a row with\n * an unknown key, a requirement that is neither `\"human\"` nor `{ capability: <non-empty string> }`,\n * an evidence kind that is not a non-empty string; and a row that does not include every\n * requirement and evidence kind of the level below it (a stricter level only adds, G1-4).\n * Every key is read as an own property: an inherited one counts as absent (G5-5).\n */\nexport function riskOptions(options: unknown, who: string): Required<RiskGateOptions> {\n if (typeof options === \"object\" && options !== null && validated.has(options))\n return options as Required<RiskGateOptions>;\n const bad = (what: string, fix: string): never =>\n fail(\"invalid-input\", `${who} options: ${what}`, fix);\n const closed = (o: Record<string, unknown>, keys: readonly string[], at: string): void => {\n for (const k of Object.keys(o))\n if (!keys.includes(k)) bad(`unknown key \"${k}\" in ${at}`, `use only: ${keys.join(\", \")}`);\n };\n const requirement = (q: unknown, at: string): GateRequirement => {\n if (q === \"human\") return q;\n const c = isObj(q) ? own(q, \"capability\") : undefined;\n if (typeof c !== \"string\" || c.trim() === \"\" || Object.keys(q as object).length !== 1)\n bad(\n `${at} must be \"human\" or { capability: <name> }`,\n 'e.g. [\"human\"] or [{ \"capability\": \"review\" }]',\n );\n return { capability: c as string };\n };\n if (!isObj(options)) bad(\"must be an object\", 'pass { \"gates\": [\"code-review\"] }');\n const o = options as Record<string, unknown>;\n closed(o, [\"gates\", \"table\"], \"options\");\n const gs = own(o, \"gates\");\n if (!Array.isArray(gs))\n bad(\"gates must be an array of gate ids\", 'e.g. \"gates\": [\"code-review\"]');\n const gates = (gs as unknown[]).map((g) => {\n assertId(g, \"risk gate id\");\n return g as string;\n });\n const raw = own(o, \"table\");\n let table: RiskTable | undefined;\n if (raw !== undefined) {\n if (!isObj(raw))\n bad(\"table must be an object keyed by risk level\", `levels: ${RISK_LEVELS.join(\", \")}`);\n const t = raw as Record<string, unknown>;\n closed(t, RISK_LEVELS, \"table\");\n table = {} as RiskTable;\n let below: string[] = [];\n for (const level of RISK_LEVELS) {\n const row = own(t, level);\n if (!isObj(row))\n bad(\n `table is missing level \"${level}\"`,\n `give every level a row, e.g. \"${level}\": { \"requires\": [] }`,\n );\n const rw = row as Record<string, unknown>;\n closed(rw, [\"requires\", \"evidence\"], `table.${level}`);\n const rq = own(rw, \"requires\");\n if (!Array.isArray(rq))\n bad(`table.${level}.requires must be an array`, 'e.g. \"requires\": [\"human\"]');\n const ev = own(rw, \"evidence\");\n if (\n ev !== undefined &&\n (!Array.isArray(ev) || !ev.every((k) => typeof k === \"string\" && k.trim() !== \"\"))\n )\n bad(\n `table.${level}.evidence must be an array of evidence kinds`,\n 'e.g. \"evidence\": [\"sbom\"]',\n );\n const requires = (rq as unknown[]).map((q, i) =>\n requirement(q, `table.${level}.requires[${i}]`),\n );\n const evidence = ev === undefined ? undefined : [...(ev as string[])];\n // each level includes everything the level below it adds; requirements and evidence kinds\n // are separate sets (G5-4: evidence \"human\" is not the requirement \"human\")\n const here = [\n ...requires.map((x) => JSON.stringify(x)),\n ...(evidence ?? []).map((k) => `evidence ${JSON.stringify(k)}`),\n ];\n const missing = below.filter((x) => !here.includes(x));\n if (missing.length)\n bad(\n `table.${level} must include everything the level below it adds (missing ${missing.join(\", \")})`,\n \"a stricter level only adds: copy the lower level's requires and evidence into it\",\n );\n below = here;\n table[level] = { requires, ...(evidence === undefined ? {} : { evidence }) };\n }\n }\n const out = deepFreeze(table ? { gates, table } : ({ gates } as Required<RiskGateOptions>));\n validated.add(out);\n return out;\n}\n","// Risk-adaptive gate (design spec section 27, #35): the level of the strictest fresh, valid and\n// independent `risk-assessment` evidence picks a row of a table of what the gate additionally needs.\nimport { canDo } from \"../../core/roles/guards.ts\";\nimport { freshEvidence } from \"../../core/items/evidence.ts\";\nimport type {\n Evidence,\n Gate,\n GateEscalation,\n GateRequirement,\n WorkItem,\n WorkflowState,\n} from \"../../core/types.ts\";\nimport { deepFreeze } from \"../deep-freeze.ts\";\nimport { independenceConflicts } from \"../independence.ts\";\nimport { workersOf } from \"../workers.ts\";\nimport { RISK_LEVELS, riskOptions } from \"./options.ts\";\n\nexport type RiskLevel = \"low\" | \"medium\" | \"high\" | \"critical\";\n/** `data` of a `risk-assessment` evidence entry. */\nexport interface RiskAssessmentData {\n level: RiskLevel;\n /** Free strings naming what drives the risk, e.g. `ci-cd`, `prod-infra`, `secrets`, `blast-radius`, `irreversible`. */\n factors: string[];\n /** The item SHA or ref that was assessed. */\n subject?: string;\n}\n/** What each level ADDS to the static gate. */\nexport type RiskTable = Record<RiskLevel, { requires: GateRequirement[]; evidence?: string[] }>;\nexport interface RiskGateOptions {\n /** Ids of the gates the policy applies to; every other gate stays static. */\n gates: string[];\n /** Default `DEFAULT_RISK_TABLE`. */\n table?: RiskTable;\n}\n\nexport { RISK_LEVELS };\n\n/** `low` and `medium` add nothing; `high` and `critical` add a human approval. Deeply frozen. */\nexport const DEFAULT_RISK_TABLE: RiskTable = /* @__PURE__ */ deepFreeze({\n low: { requires: [] },\n medium: { requires: [] },\n high: { requires: [\"human\"] },\n critical: { requires: [\"human\"] },\n});\n\nconst isObj = (x: unknown): x is Record<string, unknown> =>\n typeof x === \"object\" && x !== null && !Array.isArray(x);\n\n/** True when `data` is a well-formed `RiskAssessmentData`. */\nexport function isRiskData(data: unknown): data is RiskAssessmentData {\n return (\n isObj(data) &&\n RISK_LEVELS.includes(data[\"level\"] as RiskLevel) &&\n Array.isArray(data[\"factors\"]) &&\n data[\"factors\"].every((f) => typeof f === \"string\") &&\n (data[\"subject\"] === undefined || typeof data[\"subject\"] === \"string\")\n );\n}\n\n/**\n * Why `by` may not assess `item`: `invalid` when it is neither `human` nor a role with capability\n * `verify`, `not-independent` when it worked on the item (`workersOf`: every role that dispatched\n * it since its last rework, its assigned role, its author); `undefined` when it may. `workers`\n * defaults to `workersOf(state, item)`; pass it to check several assessors against one state.\n */\nexport function assessorIssue(\n state: WorkflowState<string>,\n item: WorkItem,\n by: string,\n workers: readonly string[] = workersOf(state, item),\n): \"invalid\" | \"not-independent\" | undefined {\n if (!canDo(state, by, \"verify\")) return \"invalid\";\n return independenceConflicts(by, workers).length ? \"not-independent\" : undefined;\n}\n\n/**\n * The escalation of `gate` for `item` under `options` (the `escalateGate` hook `withRiskGate`\n * installs): `undefined` for a gate not in `options.gates`, else the table row of the resolved\n * level. The resolved level is the strictest fresh (post-rework) valid assessment, so a later,\n * lower assessment never relaxes an earlier one; with none it is `critical`, and `reason.why` says\n * whether assessments were `missing`, `invalid` or `not-independent` (the latest rejected one).\n * Invalid options fail `invalid-input` as in `withRiskGate`, never a `TypeError`. Pure: no clock,\n * no randomness; the same state gives the same answer.\n */\nexport function riskEscalation(\n state: WorkflowState<string>,\n item: WorkItem,\n gate: Gate,\n options: RiskGateOptions,\n): GateEscalation | undefined {\n // validated here unless these are the frozen options withRiskGate validated (G1-6)\n const opts = riskOptions(options, \"riskEscalation\");\n if (!opts.gates.includes(gate.id)) return undefined;\n let level: RiskLevel | undefined;\n let why = \"missing\";\n let pick: Evidence | undefined;\n let workers: string[] | undefined;\n for (const e of freshEvidence(state, item)) {\n if (e.kind !== \"risk-assessment\") continue;\n const issue = isRiskData(e.data)\n ? assessorIssue(state, item, e.by, (workers ??= workersOf(state, item)))\n : \"invalid\";\n if (issue) {\n if (!level) {\n why = issue;\n pick = e;\n }\n continue;\n }\n const l = (e.data as unknown as RiskAssessmentData).level;\n if (!level || RISK_LEVELS.indexOf(l) >= RISK_LEVELS.indexOf(level)) {\n level = l;\n why = \"assessed\";\n pick = e;\n }\n }\n const resolved = level ?? \"critical\";\n const row = (opts.table ?? DEFAULT_RISK_TABLE)[resolved];\n return {\n requires: row.requires.map((q) => (q === \"human\" ? q : { capability: q.capability })),\n evidence: [...(row.evidence ?? [])],\n reason: { level: resolved, why, assessment: pick?.ref ?? null, by: pick?.by ?? null },\n };\n}\n","// Context snapshots (design spec section 27, #36): what a scout verified about the repository\n// before an item is worked, as evidence `context-snapshot`, and whether a later `repo.changed`\n// event made it stale. Event order decides, never timestamps (principle 5); no file is read.\nimport { fail } from \"../../core/errors.ts\";\nimport { addEvidence } from \"../../core/items/evidence.ts\";\nimport { getItem } from \"../../core/items/record.ts\";\nimport { applyAction } from \"../../core/methodology.ts\";\nimport type {\n ApplyResult,\n BriefContext,\n ContextAssumption,\n ContextSnapshotData,\n Methodology,\n WorkItem,\n WorkflowState,\n} from \"../../core/types.ts\";\nimport { eventIndex, firstAfter, sinceRework } from \"../../core/event-index.ts\";\nimport { workersOf } from \"../workers.ts\";\n\nexport interface ContextSnapshotInput {\n item: string;\n /** The repository revision the snapshot was taken at. */\n revision: string;\n assumptions: ContextAssumption[];\n /** The host's snapshot artifact. */\n ref: string;\n /** Who recorded it: `human` or a registered role that did not work on the item. */\n by: string;\n now?: string;\n}\n\nconst isObj = (x: unknown): x is Record<string, unknown> =>\n typeof x === \"object\" && x !== null && !Array.isArray(x);\nconst nonEmpty = (x: unknown): x is string => typeof x === \"string\" && x.trim() !== \"\";\nconst extra = (o: Record<string, unknown>, keys: string[]) =>\n Object.keys(o).find((k) => !keys.includes(k));\n\n/** True for a C0 or C1 control character or a bidirectional formatting character. */\nfunction hidden(c: number): boolean {\n return (\n c < 0x20 ||\n (c >= 0x7f && c <= 0x9f) ||\n c === 0x61c ||\n c === 0x200e ||\n c === 0x200f ||\n (c >= 0x202a && c <= 0x202e) ||\n (c >= 0x2066 && c <= 0x2069)\n );\n}\n\n/**\n * Why `path` is not a repository-relative POSIX path as Git lists it, or `undefined` when it is:\n * no leading `/`, `./` or drive letter, `/` separators only, no empty, `.` or `..` segment, at most\n * 4096 characters, Unicode NFC, no control or bidirectional formatting character and no leading or\n * trailing whitespace (F1 G2-8, G4-4). Paths are compared exactly (case included), so the recorders\n * accept one spelling per file.\n */\nexport function repoPathIssue(path: unknown): string | undefined {\n const why =\n typeof path !== \"string\"\n ? \"not a string\"\n : path.length > 4096\n ? \"longer than 4096 characters\"\n : [...path].some((ch) => hidden(ch.codePointAt(0)!))\n ? \"has a control or bidirectional formatting character\"\n : path !== path.trim()\n ? \"has leading or trailing whitespace\"\n : path !== path.normalize(\"NFC\")\n ? \"is not Unicode NFC\"\n : path.includes(\"\\\\\") ||\n /^[A-Za-z]:/.test(path) ||\n !path.split(\"/\").every((seg) => seg !== \"\" && seg !== \".\" && seg !== \"..\")\n ? \"is not relative with / separators and no empty, . or .. segment\"\n : undefined;\n if (!why) return undefined;\n const shown = JSON.stringify(\n typeof path === \"string\" && path.length > 80 ? `${path.slice(0, 80)}…` : path,\n );\n return `${shown} is not a repository-relative POSIX path (${why})`;\n}\n\n/** Why `data` is not a well-formed `ContextSnapshotData` (closed objects), or `undefined`. */\nfunction snapshotIssue(data: unknown): string | undefined {\n if (!isObj(data)) return \"data must be an object\";\n const k = extra(data, [\"revision\", \"assumptions\"]);\n if (k) return `unknown key \"${k}\"`;\n if (!nonEmpty(data[\"revision\"])) return \"revision must be a non-empty string\";\n const list = data[\"assumptions\"];\n if (!Array.isArray(list)) return \"assumptions must be an array\";\n for (const [i, a] of list.entries()) {\n const at = `assumptions[${i}]`;\n if (!isObj(a)) return `${at} must be an object`;\n const ka = extra(a, [\"claim\", \"required\", \"source\"]);\n if (ka) return `unknown key \"${ka}\" in ${at}`;\n if (!nonEmpty(a[\"claim\"])) return `${at}.claim must be a non-empty string`;\n if (a[\"required\"] !== undefined && typeof a[\"required\"] !== \"boolean\")\n return `${at}.required must be a boolean`;\n const src = a[\"source\"];\n if (src === undefined) continue;\n if (!isObj(src)) return `${at}.source must be an object`;\n const ks = extra(src, [\"path\", \"lines\", \"hash\"]);\n if (ks) return `unknown key \"${ks}\" in ${at}.source`;\n const pathIssue = repoPathIssue(src[\"path\"]);\n if (pathIssue) return `${at}.source.path ${pathIssue}`;\n if (!nonEmpty(src[\"hash\"])) return `${at}.source.hash must be a non-empty string`;\n const l = src[\"lines\"];\n if (\n l !== undefined &&\n !(\n Array.isArray(l) &&\n l.length === 2 &&\n Number.isInteger(l[0]) &&\n Number.isInteger(l[1]) &&\n 1 <= l[0] &&\n l[0] <= l[1]\n )\n )\n return `${at}.source.lines must be two integers [from, to] with 1 <= from <= to`;\n }\n return undefined;\n}\n\n/**\n * Why `by` may not ground an item whose workers are `workers` (design spec section 27, F1 G1-2,\n * G2-2): it is neither `human` nor a registered role, or it worked on the item; else `undefined`.\n */\nfunction recorderIssue(\n state: WorkflowState<string>,\n by: unknown,\n workers: readonly string[],\n): string | undefined {\n if (typeof by !== \"string\" || (by !== \"human\" && !Object.hasOwn(state.roles, by)))\n return `${JSON.stringify(by)} is neither human nor a registered role`;\n return workers.includes(by) ? `\"${by}\" worked on the item` : undefined;\n}\nconst sourced = (d: ContextSnapshotData): boolean => d.assumptions.some((a) => a.source);\n/** A copy of a validated assumption (closed object: claim, required, source { path, lines, hash }). */\nconst copyOf = ({ source, ...rest }: ContextAssumption): ContextAssumption =>\n source\n ? {\n ...rest,\n source: {\n ...source,\n ...(source.lines ? { lines: [...source.lines] as [number, number] } : {}),\n },\n }\n : rest;\n\n/**\n * The item's current context (design spec section 27, #36): its latest fresh (post-rework)\n * qualifying `context-snapshot` evidence (valid data with at least one sourced assumption,\n * recorded by `human` or a registered role that did not work on the item, `workersOf`), with\n * `stale` the cited source paths a later `repo.changed` event listed (exact match, in event order)\n * and `unverified` the claims with no source; `undefined` when there is none. The `required`\n * claims of every other valid fresh snapshot (earlier or later, whoever recorded it) carry (spec 28, #49): reported\n * `required: true` when the latest has the claim, appended as `{ claim, required: true }` (no\n * source, so unverified) when it lacks it; claims compare by exact text. The answer is a\n * copy. Each evidence entry is located at its own `item.evidence` event, matched from the end as\n * `freshEvidence` does; an entry with no event counts as older than every event.\n */\nexport function contextOf(state: WorkflowState<string>, item: WorkItem): BriefContext | undefined {\n // one indexed pass over the log per state, not per item (F1 G3-2, G3-3, G3-4)\n const index = eventIndex(state);\n const at = index.evidence.get(item.id) ?? [];\n const all = item.evidence;\n const after = sinceRework(index, item.id, at);\n const fresh = after === undefined ? all.length : Math.min(after, all.length);\n let workers: string[] | undefined;\n // the data of entry k when it is a qualifying snapshot; one that does not qualify is ignored, so\n // it cannot supersede one that does (G2-1)\n const qualifying = (k: number): ContextSnapshotData | undefined => {\n const e = all[k]!;\n if (e.kind !== \"context-snapshot\" || snapshotIssue(e.data) !== undefined) return undefined;\n const data = e.data as unknown as ContextSnapshotData;\n return !sourced(data) || recorderIssue(state, e.by, (workers ??= workersOf(state, item)))\n ? undefined\n : data;\n };\n for (let k = all.length - 1; k >= all.length - fresh; k--) {\n const e = all[k]!;\n const data = qualifying(k);\n if (!data) continue;\n // the required claims of every other valid fresh snapshot (earlier or later) carry, whoever recorded\n // it: independence decides who may verify a claim, not which claims are required (spec 28,\n // #49, gate G1-3)\n const carried = new Set<string>();\n for (let j = all.length - 1; j >= all.length - fresh; j--) {\n const d = all[j]!;\n if (j === k) continue;\n if (d.kind === \"context-snapshot\" && snapshotIssue(d.data) === undefined)\n for (const a of (d.data as unknown as ContextSnapshotData).assumptions)\n if (a.required) carried.add(a.claim);\n }\n const assumptions = data.assumptions.map((a) =>\n carried.has(a.claim) ? { ...copyOf(a), required: true } : copyOf(a),\n );\n for (const claim of carried)\n if (!data.assumptions.some((a) => a.claim === claim))\n assumptions.push({ claim, required: true });\n // each cited path's first repo.changed after the snapshot's own event, in event order\n const pos = at[k + at.length - all.length] ?? -1;\n const hits: [number, number, string][] = [];\n for (const path of new Set(data.assumptions.map((a) => a.source?.path))) {\n const list = path === undefined ? undefined : index.changed.get(path);\n const f = list ? firstAfter(list, pos, (x) => x[0]) : 0;\n if (list && f < list.length) hits.push([list[f]![0], list[f]![1], path!]);\n }\n // oxlint-disable-next-line unicorn/no-array-sort -- a fresh local array; toSorted needs Node 20\n hits.sort((a, b) => a[0] - b[0] || a[1] - b[1]);\n return {\n revision: data.revision,\n // copies: a caller (a brief, a host) changing the answer must not change the state (G2-9)\n assumptions,\n snapshot: e.ref,\n by: e.by,\n stale: hits.map((h) => h[2]),\n unverified: assumptions.filter((a) => !a.source).map((a) => a.claim),\n };\n }\n return undefined;\n}\n\nconst KEYS = [\"item\", \"revision\", \"assumptions\", \"ref\", \"by\", \"now\"];\nconst bad = (what: string, fix: string): never =>\n fail(\"invalid-input\", `context snapshot: ${what}`, fix);\n\n/**\n * Records a context snapshot of an item as evidence `context-snapshot` with `data: { revision,\n * assumptions }` (design spec section 27, #36), through `applyAction` (action `context.snapshot`)\n * so the methodology's rules see it. Refuses `invalid-input` for an unknown key, an empty revision,\n * claim or ref, a source with a path that is not repository-relative POSIX or an empty hash,\n * `lines` that are not two integers `1 <= from <= to`, no assumption with a source, and a `by`\n * that is neither `human` nor a registered role or that worked on the item. The input is copied.\n */\nexport function recordContextSnapshot<N extends string>(\n state: WorkflowState<N>,\n methodology: Methodology<unknown, N>,\n input: ContextSnapshotInput,\n): ApplyResult<N> {\n if (!isObj(input)) bad(\"input must be an object\", `pass { ${KEYS.join(\", \")} }`);\n const k = extra(input as unknown as Record<string, unknown>, KEYS);\n if (k) bad(`unknown key \"${k}\"`, `use only: ${KEYS.join(\", \")}`);\n const { item: id, revision, assumptions, ref, by, now } = input;\n if (typeof id !== \"string\") bad(\"item must be an item id\", 'e.g. \"item\": \"CART-12\"');\n const item = getItem(state, id);\n const data = { revision, assumptions } as unknown as Record<string, unknown>;\n const issue = snapshotIssue(data);\n if (issue)\n bad(\n issue,\n 'e.g. { \"revision\": \"4f2c1e0\", \"assumptions\": [{ \"claim\": \"totals are cents\", \"source\": { \"path\": \"src/cart.ts\", \"hash\": \"…\" } }] }',\n );\n if (!nonEmpty(ref))\n bad(\"ref must be a non-empty string\", 'name the snapshot artifact, e.g. \"ctx/CART-12.json\"');\n if (!nonEmpty(by)) bad(\"by must name who recorded it\", 'e.g. \"by\": \"scout\"');\n const who = recorderIssue(state, by, workersOf(state, item));\n if (who)\n bad(\n `${who} and may not record its context`,\n \"record as human or a registered role that did not work on the item\",\n );\n if (!sourced(data as unknown as ContextSnapshotData))\n bad(\n \"a snapshot needs at least one assumption with a source (nothing was verified)\",\n 'cite what was checked, e.g. \"source\": { \"path\": \"src/cart.ts\", \"hash\": \"…\" }',\n );\n if (now !== undefined && typeof now !== \"string\")\n bad(\"now must be an ISO timestamp string\", \"omit now to use the clock\");\n // validated plain data, copied so no reference to the caller's arrays is kept\n const copy = JSON.parse(JSON.stringify(data)) as Record<string, unknown>;\n return applyAction(\n state,\n methodology,\n { type: \"context.snapshot\", by, payload: { item: id, ref, ...copy } },\n (s) => addEvidence(s, id, { kind: \"context-snapshot\", ref, by, data: copy }, now),\n );\n}\n","// The context-grounded entry policy (design spec section 27, #36): an item may enter a stage only\n// with a fresh, verified context snapshot that a human or a registered role other than its workers\n// recorded (contextOf counts only such a snapshot).\nimport type { Violation, WorkItem, WorkflowState } from \"../../core/types.ts\";\nimport { contextOf } from \"./snapshot.ts\";\n\nconst RULE = \"policy:custom:context-grounded\";\nconst RECORD = \"record a fresh one with recordContextSnapshot\";\n\n/**\n * Violations of the custom policy `context-grounded` for `item` (rule\n * `policy:custom:context-grounded`, the 1.2 rule id of a custom policy): no qualifying fresh\n * context snapshot (`contextOf`: valid, at least one sourced assumption, recorded by `human` or a\n * registered role that did not work on the item); a stale one (names the changed paths); a\n * `required` assumption without a source (names the claims). Empty when the item is grounded.\n * Pure: the same state gives the same answer.\n */\nexport function contextGroundedViolations(\n state: WorkflowState<string>,\n item: WorkItem,\n): Violation[] {\n const out: Violation[] = [];\n const v = (message: string, fix: string) =>\n out.push({ rule: RULE, severity: \"error\", item: item.id, message, fix });\n const ctx = contextOf(state, item);\n if (!ctx) {\n v(\n `item \"${item.id}\" has no qualifying context snapshot (none since its last rework is valid, cites a source and was recorded by human or a registered role that did not work on it)`,\n `have an independent role or a human verify the context and ${RECORD}`,\n );\n return out;\n }\n const of = `context snapshot \"${ctx.snapshot}\" of \"${item.id}\"`;\n if (ctx.stale.length)\n v(\n `${of} is stale: ${ctx.stale.join(\", \")} changed since`,\n `re-verify the claims and ${RECORD}`,\n );\n const required = ctx.assumptions.filter((a) => a.required);\n const unverified = required.filter((a) => !a.source).map((a) => a.claim);\n if (unverified.length)\n v(\n `${of} has unverified required assumption(s): ${unverified.join(\" | \")}`,\n `cite a source { path, hash } for each and ${RECORD}`,\n );\n return out;\n}\n","// Wrappers that turn any methodology into one carrying a policy (design spec section 27). The\n// wrapped methodology keeps every other member, its name included, so registerMethodology accepts it.\nimport { assertId, fail } from \"../core/errors.ts\";\nimport type { Methodology, Policy } from \"../core/types.ts\";\nimport { contextGroundedViolations } from \"../common/context/policy.ts\";\nimport { contextOf } from \"../common/context/snapshot.ts\";\nimport { riskEscalation, type RiskGateOptions } from \"../common/risk/escalation.ts\";\nimport { riskOptions } from \"../common/risk/options.ts\";\n\nconst isObj = (x: unknown): x is Record<string, unknown> =>\n typeof x === \"object\" && x !== null && !Array.isArray(x);\n\n/**\n * `methodology` with the risk-adaptive gate policy (design spec section 27, #35): for each gate in\n * `options.gates`, `complete()` adds the requirements of the row of `options.table` (default\n * `DEFAULT_RISK_TABLE`) that the item's strictest fresh, valid, independent risk assessment picks,\n * `critical` when there is none. An `escalateGate` the methodology already has is kept: both widen\n * the gate. Invalid options fail `invalid-input` here, once.\n */\nexport function withRiskGate<C, N extends string>(\n methodology: Methodology<C, N>,\n options: RiskGateOptions,\n): Methodology<C, N> {\n const opts = riskOptions(options, \"withRiskGate\");\n const inner = methodology.escalateGate;\n return {\n ...methodology,\n escalateGate(state, item, gate) {\n const own = riskEscalation(state, item, gate, opts);\n const prior = inner?.call(methodology, state, item, gate);\n if (!prior || !own) return prior ?? own;\n return {\n requires: [...prior.requires, ...own.requires],\n evidence: [...prior.evidence, ...own.evidence],\n reason: { ...prior.reason, ...own.reason },\n };\n },\n };\n}\n\nexport interface ContextGroundingOptions {\n /** Stage ids whose entry policies gain the custom policy `context-grounded`. */\n entry: string[];\n /** Stage ids whose exit policies gain it. */\n exit?: string[];\n}\n\nconst GROUNDED = \"context-grounded\";\nconst groundedPolicy: Policy = {\n kind: \"custom\",\n id: GROUNDED,\n description: \"grounded in a fresh, verified context snapshot\",\n};\nconst badGrounding = (what: string, fix: string): never =>\n fail(\"invalid-input\", `withContextGrounding options: ${what}`, fix);\n\nfunction stageIds(o: Record<string, unknown>, key: \"entry\" | \"exit\"): string[] {\n const ids = o[key];\n if (ids === undefined && key === \"exit\") return [];\n if (!Array.isArray(ids))\n badGrounding(`${key} must be an array of stage ids`, `e.g. \"${key}\": [\"dev\"]`);\n return (ids as unknown[]).map((id) => {\n assertId(id, `context-grounded ${key} stage id`);\n return id as string;\n });\n}\n\n/**\n * `methodology` with the context-grounded policy (design spec section 27, #36): `defaultStages`\n * adds the custom policy `context-grounded` to the entry policies of the `entry` stages and the\n * exit policies of the `exit` stages (an unknown stage id fails `invalid-input` there), and\n * `plan()`/`complete()` answer it with `contextGroundedViolations`; `synthesizeBrief` carries\n * `contextOf` as `Brief.context`. Hooks the methodology already has answer every other policy id\n * and a brief with no snapshot. Invalid options fail `invalid-input` here, once.\n */\nexport function withContextGrounding<C, N extends string>(\n methodology: Methodology<C, N>,\n options: ContextGroundingOptions,\n): Methodology<C, N> {\n if (!isObj(options)) badGrounding(\"must be an object\", 'pass { \"entry\": [\"dev\"] }');\n const o = options as unknown as Record<string, unknown>;\n for (const k of Object.keys(o))\n if (k !== \"entry\" && k !== \"exit\") badGrounding(`unknown key \"${k}\"`, \"use only: entry, exit\");\n const entry = stageIds(o, \"entry\");\n const exit = stageIds(o, \"exit\");\n const add = (list: Policy[], on: boolean): Policy[] =>\n on && !list.some((p) => p.kind === \"custom\" && p.id === GROUNDED)\n ? [...list, groundedPolicy]\n : list;\n return {\n ...withGroundingHooks(methodology),\n defaultStages(config) {\n const stages = methodology.defaultStages(config);\n for (const id of [...entry, ...exit])\n if (!stages.some((st) => st.id === id))\n fail(\n \"invalid-input\",\n `withContextGrounding: unknown stage \"${id}\"`,\n `stages: ${stages.map((st) => st.id).join(\", \")}`,\n );\n // a built-in ceremony checks these policies without the hook, so the policy could never pass\n // there (spec 28, G2 finding 2): refuse them here, once\n const checked = ceremonyChecked(methodology.name, stages);\n for (const [key, ids] of [\n [\"entry\", entry],\n [\"exit\", exit],\n ] as const)\n for (const id of ids)\n if (checked[key].includes(id))\n fail(\n \"invalid-input\",\n `withContextGrounding: the ${methodology.name} ceremony that moves items ${key === \"entry\" ? \"into\" : \"out of\"} \"${id}\" checks its ${key} policies without the grounding hook`,\n `ground a later stage instead, e.g. ${key} [\"${stages.find((st) => !checked.entry.includes(st.id) && !checked.exit.includes(st.id) && st.id !== stages[0]!.id)?.id ?? \"dev\"}\"]`,\n );\n return stages.map((st) => ({\n ...st,\n entryPolicy: add(st.entryPolicy, entry.includes(st.id)),\n exitPolicy: add(st.exitPolicy, exit.includes(st.id)),\n }));\n },\n };\n}\n\n/** Stage policies a built-in methodology's ceremonies check with `assertPolicies` (spec 28). */\nfunction ceremonyChecked(\n name: string,\n stages: readonly { id: string }[],\n): { entry: string[]; exit: string[] } {\n if (name === \"kanban\") return { entry: [], exit: stages[0] ? [stages[0].id] : [] };\n if (name === \"scrum\") return { entry: [], exit: [\"backlog\"] };\n if (name === \"experimentation\") return { entry: [\"building\"], exit: [] };\n return { entry: [], exit: [] };\n}\n\n/**\n * `methodology` with the hooks that answer the custom policy `context-grounded` (spec 28, #47):\n * `customPolicy` with `contextGroundedViolations`, `briefContext` with `contextOf`; hooks the\n * methodology already has answer every other policy id and a brief with no snapshot. Stages are\n * untouched. `withContextGrounding` builds on it, and the CLI wraps every methodology with it so a\n * state the SDK grounded is judged by its snapshots there too. Not exported from an entry point.\n */\nexport function withGroundingHooks<C, N extends string>(\n methodology: Methodology<C, N>,\n): Methodology<C, N> {\n const { customPolicy, briefContext } = methodology;\n return {\n ...methodology,\n customPolicy(state, item, policy) {\n return policy.id === GROUNDED\n ? contextGroundedViolations(state, item)\n : customPolicy?.call(methodology, state, item, policy);\n },\n briefContext(state, item) {\n return contextOf(state, item) ?? briefContext?.call(methodology, state, item);\n },\n };\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
'use strict';var chunkZK3V66NC_cjs=require('./chunk-ZK3V66NC.cjs'),chunkTBLIZIWH_cjs=require('./chunk-TBLIZIWH.cjs'),chunkOSHBJIYD_cjs=require('./chunk-OSHBJIYD.cjs');var L=["policy","skill","memory","spec","review"],v={retro:"review in a fresh worker",phaseRetrospective:"qa reads the srs"},w=n=>typeof n=="object"&&n!==null&&!Array.isArray(n);function x(n,o,d){let g=o.lessons??[];(!Array.isArray(g)||!g.every(s=>w(s)&&typeof s.text=="string"&&s.text.trim()!==""&&L.includes(s.scope)))&&chunkOSHBJIYD_cjs.b("invalid-input",`${d}.lessons entries need a text and a scope`,`scope is one of: ${L.join(", ")}`);let l=g,t=["human",...Object.keys(n.roles)];for(let s of l)s.from!==void 0&&(typeof s.from!="string"||!t.includes(s.from))&&chunkOSHBJIYD_cjs.b("invalid-input",`lesson from ${JSON.stringify(s.from)} is not a role`,`from is "human" or one of the roles: ${Object.keys(n.roles).join(", ")||"(none)"}`),s.item!==void 0&&(typeof s.item!="string"&&chunkOSHBJIYD_cjs.b("invalid-input","lesson item must be an item id","name an item with addItem first"),chunkTBLIZIWH_cjs.s(n,s.item));let f=o.adopt??[],a=o.dismiss??[];(!Array.isArray(f)||!f.every(s=>w(s)&&typeof s.id=="string")||!Array.isArray(a)||!a.every(s=>typeof s=="string"))&&chunkOSHBJIYD_cjs.b("invalid-input",`${d}.adopt must be [{ id, suggestedChange? }] and dismiss a string[]`,'e.g. { "adopt": [{ "id": "L1" }], "dismiss": ["L2"] }');let m=[...f.map(s=>s.id),...a],p=m.find((s,i)=>m.indexOf(s)!==i);p!==void 0&&chunkOSHBJIYD_cjs.b("invalid-input",`lesson "${p}" is referenced more than once`,"adopt or dismiss each lesson once");for(let s of m){let i=n.lessons.find(c=>c.id===s);i||chunkOSHBJIYD_cjs.b("invalid-input",`no lesson "${s}"`,`raised lessons: ${n.lessons.filter(c=>c.status==="raised").map(c=>c.id).join(", ")||"(none)"}`),i.status!=="raised"&&chunkOSHBJIYD_cjs.b("invalid-input",`lesson "${s}" is already ${i.status}`,"only raised lessons can be adopted or dismissed");}let e=o.retire??[];return (!Array.isArray(e)||!e.every(s=>typeof s=="string")||e.some((s,i)=>e.indexOf(s)!==i))&&chunkOSHBJIYD_cjs.b("invalid-input",`${d}.retire must be a list of distinct agreement texts`,`e.g. { "retire": ["${v[d]??"review in a fresh worker"}"] }; each agreement once`),{lessons:l,adopt:f,dismiss:a,retire:e}}function N(n,o,d,g,l){let t=n,f=[],a=[],m=[],p=e=>{e&&(e.kind==="agreement"?(t=chunkZK3V66NC_cjs.a(t,e,d,g),m.push(e.text)):l&&(t=l(t,e)??t));};for(let e of o.lessons){let s=`L${t.lessons.length+1}`,i={id:s,at:g,text:e.text,scope:e.scope,status:"adopted",from:e.from??d};e.item!==void 0&&(i.item=e.item),e.suggestedChange&&(i.suggestedChange=e.suggestedChange),t={...t,lessons:[...t.lessons,i]},f.push(s),a.push(s),p(e.suggestedChange);}for(let e of o.adopt)t={...t,lessons:t.lessons.map(s=>s.id===e.id?{...s,status:"adopted",...e.suggestedChange?{suggestedChange:e.suggestedChange}:{}}:s)},a.push(e.id),p(e.suggestedChange??t.lessons.find(s=>s.id===e.id)?.suggestedChange);for(let e of o.dismiss)t={...t,lessons:t.lessons.map(s=>s.id===e?{...s,status:"dismissed"}:s)};for(let e of o.retire)t=chunkZK3V66NC_cjs.b(t,e,d,g);return {state:t,created:f,adopted:a,dismissed:o.dismiss,agreements:m,retired:o.retire}}exports.a=x;exports.b=N;//# sourceMappingURL=chunk-RMXEQ5HN.cjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-RMXEQ5HN.cjs.map
|