audit-tools 0.52.5 → 0.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (347) hide show
  1. package/dist/audit/cli/auditStep.d.ts +1 -1
  2. package/dist/audit/cli/dispatch/hostHandoff.d.ts +2 -0
  3. package/dist/audit/cli/dispatch/hostHandoff.d.ts.map +1 -1
  4. package/dist/audit/cli/dispatch/hostHandoff.js +1 -1
  5. package/dist/audit/cli/dispatch/hostHandoff.js.map +1 -1
  6. package/dist/audit/cli/dispatch/packetFilter.d.ts +1 -1
  7. package/dist/audit/cli/dispatch/packetFilter.d.ts.map +1 -1
  8. package/dist/audit/cli/dispatch/packetFilter.js +1 -1
  9. package/dist/audit/cli/dispatch/packetFilter.js.map +1 -1
  10. package/dist/audit/cli/nextStepCommand.d.ts.map +1 -1
  11. package/dist/audit/cli/nextStepCommand.js +42 -20
  12. package/dist/audit/cli/nextStepCommand.js.map +1 -1
  13. package/dist/audit/cli/nextStepHelpers.d.ts +3 -3
  14. package/dist/audit/cli/nextStepHelpers.d.ts.map +1 -1
  15. package/dist/audit/cli/nextStepHelpers.js +50 -75
  16. package/dist/audit/cli/nextStepHelpers.js.map +1 -1
  17. package/dist/audit/cli/prompts.d.ts +1 -2
  18. package/dist/audit/cli/prompts.d.ts.map +1 -1
  19. package/dist/audit/cli/prompts.js +2 -12
  20. package/dist/audit/cli/prompts.js.map +1 -1
  21. package/dist/audit/cli/sampleRunCommand.d.ts +2 -2
  22. package/dist/audit/cli/semanticReviewStep.d.ts +11 -2
  23. package/dist/audit/cli/semanticReviewStep.d.ts.map +1 -1
  24. package/dist/audit/cli/semanticReviewStep.js +14 -10
  25. package/dist/audit/cli/semanticReviewStep.js.map +1 -1
  26. package/dist/audit/contracts/workerSchemas.d.ts +14 -14
  27. package/dist/audit/contracts/wrapperResponse.d.ts +6 -6
  28. package/dist/audit/extractors/graphRoutes.d.ts.map +1 -1
  29. package/dist/audit/extractors/graphRoutes.js +1 -3
  30. package/dist/audit/extractors/graphRoutes.js.map +1 -1
  31. package/dist/audit/io/artifacts.d.ts.map +1 -1
  32. package/dist/audit/io/artifacts.js +2 -3
  33. package/dist/audit/io/artifacts.js.map +1 -1
  34. package/dist/audit/orchestrator/architectureDiscovery.d.ts +11 -0
  35. package/dist/audit/orchestrator/architectureDiscovery.d.ts.map +1 -0
  36. package/dist/audit/orchestrator/architectureDiscovery.js +174 -0
  37. package/dist/audit/orchestrator/architectureDiscovery.js.map +1 -0
  38. package/dist/audit/orchestrator/designReviewProjection.d.ts +2 -6
  39. package/dist/audit/orchestrator/designReviewProjection.d.ts.map +1 -1
  40. package/dist/audit/orchestrator/designReviewProjection.js +2 -6
  41. package/dist/audit/orchestrator/designReviewProjection.js.map +1 -1
  42. package/dist/audit/orchestrator/designReviewSnapshot.d.ts +2 -3
  43. package/dist/audit/orchestrator/designReviewSnapshot.d.ts.map +1 -1
  44. package/dist/audit/orchestrator/designReviewSnapshot.js +2 -3
  45. package/dist/audit/orchestrator/designReviewSnapshot.js.map +1 -1
  46. package/dist/audit/orchestrator/executorRunners.d.ts.map +1 -1
  47. package/dist/audit/orchestrator/executorRunners.js +1 -22
  48. package/dist/audit/orchestrator/executorRunners.js.map +1 -1
  49. package/dist/audit/orchestrator/executors.d.ts.map +1 -1
  50. package/dist/audit/orchestrator/executors.js +1 -13
  51. package/dist/audit/orchestrator/executors.js.map +1 -1
  52. package/dist/audit/orchestrator/nextStep.d.ts +2 -28
  53. package/dist/audit/orchestrator/nextStep.d.ts.map +1 -1
  54. package/dist/audit/orchestrator/nextStep.js +5 -37
  55. package/dist/audit/orchestrator/nextStep.js.map +1 -1
  56. package/dist/audit/orchestrator/obligationDerive.d.ts +2 -3
  57. package/dist/audit/orchestrator/obligationDerive.d.ts.map +1 -1
  58. package/dist/audit/orchestrator/obligationDerive.js +2 -3
  59. package/dist/audit/orchestrator/obligationDerive.js.map +1 -1
  60. package/dist/audit/orchestrator/pendingTasks.d.ts +2 -0
  61. package/dist/audit/orchestrator/pendingTasks.d.ts.map +1 -1
  62. package/dist/audit/orchestrator/pendingTasks.js +5 -1
  63. package/dist/audit/orchestrator/pendingTasks.js.map +1 -1
  64. package/dist/audit/orchestrator/planningExecutors.d.ts.map +1 -1
  65. package/dist/audit/orchestrator/planningExecutors.js +9 -0
  66. package/dist/audit/orchestrator/planningExecutors.js.map +1 -1
  67. package/dist/audit/orchestrator/requeueCommand.d.ts +1 -1
  68. package/dist/audit/orchestrator/resultBaseline.d.ts +5 -5
  69. package/dist/audit/orchestrator/resultBaseline.d.ts.map +1 -1
  70. package/dist/audit/orchestrator/resultBaseline.js +24 -47
  71. package/dist/audit/orchestrator/resultBaseline.js.map +1 -1
  72. package/dist/audit/orchestrator/selectiveDeepening/findingFollowup.d.ts.map +1 -1
  73. package/dist/audit/orchestrator/selectiveDeepening/findingFollowup.js +2 -0
  74. package/dist/audit/orchestrator/selectiveDeepening/findingFollowup.js.map +1 -1
  75. package/dist/audit/orchestrator/state.d.ts.map +1 -1
  76. package/dist/audit/orchestrator/state.js +2 -0
  77. package/dist/audit/orchestrator/state.js.map +1 -1
  78. package/dist/audit/orchestrator/synthesisExecutors.d.ts.map +1 -1
  79. package/dist/audit/orchestrator/synthesisExecutors.js +3 -0
  80. package/dist/audit/orchestrator/synthesisExecutors.js.map +1 -1
  81. package/dist/audit/types/auditState.d.ts +6 -6
  82. package/dist/audit/types/flowCoverage.d.ts +6 -6
  83. package/dist/audit/types.d.ts +12 -12
  84. package/dist/remediate/contractPipeline/executionPlan.d.ts +1908 -0
  85. package/dist/remediate/contractPipeline/executionPlan.d.ts.map +1 -0
  86. package/dist/remediate/contractPipeline/executionPlan.js +467 -0
  87. package/dist/remediate/contractPipeline/executionPlan.js.map +1 -0
  88. package/dist/remediate/contractPipeline/runtimePlanAuthority.d.ts +12 -0
  89. package/dist/remediate/contractPipeline/runtimePlanAuthority.d.ts.map +1 -0
  90. package/dist/remediate/contractPipeline/runtimePlanAuthority.js +41 -0
  91. package/dist/remediate/contractPipeline/runtimePlanAuthority.js.map +1 -0
  92. package/dist/remediate/dedup/crossLensDedup.d.ts +3 -16
  93. package/dist/remediate/dedup/crossLensDedup.d.ts.map +1 -1
  94. package/dist/remediate/dedup/crossLensDedup.js +2 -32
  95. package/dist/remediate/dedup/crossLensDedup.js.map +1 -1
  96. package/dist/remediate/index.d.ts +2 -19
  97. package/dist/remediate/index.d.ts.map +1 -1
  98. package/dist/remediate/index.js +22 -138
  99. package/dist/remediate/index.js.map +1 -1
  100. package/dist/remediate/intake.d.ts +10 -10
  101. package/dist/remediate/intent/intentOrdering.d.ts +6 -8
  102. package/dist/remediate/intent/intentOrdering.d.ts.map +1 -1
  103. package/dist/remediate/intent/intentOrdering.js +24 -47
  104. package/dist/remediate/intent/intentOrdering.js.map +1 -1
  105. package/dist/remediate/phases/close.d.ts +25 -17
  106. package/dist/remediate/phases/close.d.ts.map +1 -1
  107. package/dist/remediate/phases/close.js +278 -218
  108. package/dist/remediate/phases/close.js.map +1 -1
  109. package/dist/remediate/phases/closeAcceptance.d.ts +42 -0
  110. package/dist/remediate/phases/closeAcceptance.d.ts.map +1 -0
  111. package/dist/remediate/phases/closeAcceptance.js +66 -0
  112. package/dist/remediate/phases/closeAcceptance.js.map +1 -0
  113. package/dist/remediate/phases/closeReviewProvenance.d.ts +1 -1
  114. package/dist/remediate/phases/closeReviewProvenance.d.ts.map +1 -1
  115. package/dist/remediate/phases/closeReviewProvenance.js +9 -8
  116. package/dist/remediate/phases/closeReviewProvenance.js.map +1 -1
  117. package/dist/remediate/phases/closeVerifyAnalyzerLeads.d.ts.map +1 -1
  118. package/dist/remediate/phases/closeVerifyAnalyzerLeads.js +11 -9
  119. package/dist/remediate/phases/closeVerifyAnalyzerLeads.js.map +1 -1
  120. package/dist/remediate/phases/closeVerifyHeadEvidence.d.ts +21 -86
  121. package/dist/remediate/phases/closeVerifyHeadEvidence.d.ts.map +1 -1
  122. package/dist/remediate/phases/closeVerifyHeadEvidence.js +30 -19
  123. package/dist/remediate/phases/closeVerifyHeadEvidence.js.map +1 -1
  124. package/dist/remediate/phases/plan.d.ts +3 -60
  125. package/dist/remediate/phases/plan.d.ts.map +1 -1
  126. package/dist/remediate/phases/plan.js +3 -227
  127. package/dist/remediate/phases/plan.js.map +1 -1
  128. package/dist/remediate/phases/triage.d.ts.map +1 -1
  129. package/dist/remediate/phases/triage.js +19 -30
  130. package/dist/remediate/phases/triage.js.map +1 -1
  131. package/dist/remediate/riskSignal.d.ts +9 -43
  132. package/dist/remediate/riskSignal.d.ts.map +1 -1
  133. package/dist/remediate/riskSignal.js +7 -28
  134. package/dist/remediate/riskSignal.js.map +1 -1
  135. package/dist/remediate/state/disposition.d.ts +2 -1
  136. package/dist/remediate/state/disposition.d.ts.map +1 -1
  137. package/dist/remediate/state/disposition.js +37 -1
  138. package/dist/remediate/state/disposition.js.map +1 -1
  139. package/dist/remediate/state/runIdentity.d.ts +2 -13
  140. package/dist/remediate/state/runIdentity.d.ts.map +1 -1
  141. package/dist/remediate/state/runIdentity.js +3 -13
  142. package/dist/remediate/state/runIdentity.js.map +1 -1
  143. package/dist/remediate/state/store.d.ts +12 -36
  144. package/dist/remediate/state/store.d.ts.map +1 -1
  145. package/dist/remediate/state/store.js +58 -150
  146. package/dist/remediate/state/store.js.map +1 -1
  147. package/dist/remediate/state/types.d.ts +406 -504
  148. package/dist/remediate/state/types.d.ts.map +1 -1
  149. package/dist/remediate/state/types.js +24 -104
  150. package/dist/remediate/state/types.js.map +1 -1
  151. package/dist/remediate/steps/contractPipeline.d.ts +7 -661
  152. package/dist/remediate/steps/contractPipeline.d.ts.map +1 -1
  153. package/dist/remediate/steps/contractPipeline.js +259 -3854
  154. package/dist/remediate/steps/contractPipeline.js.map +1 -1
  155. package/dist/remediate/steps/contractPipelinePrompts.d.ts +20 -142
  156. package/dist/remediate/steps/contractPipelinePrompts.d.ts.map +1 -1
  157. package/dist/remediate/steps/contractPipelinePrompts.js +48 -581
  158. package/dist/remediate/steps/contractPipelinePrompts.js.map +1 -1
  159. package/dist/remediate/steps/dispatch/contractConformanceReview.d.ts +4 -1
  160. package/dist/remediate/steps/dispatch/contractConformanceReview.d.ts.map +1 -1
  161. package/dist/remediate/steps/dispatch/contractConformanceReview.js +6 -3
  162. package/dist/remediate/steps/dispatch/contractConformanceReview.js.map +1 -1
  163. package/dist/remediate/steps/dispatch/hostContracts.d.ts +1 -1
  164. package/dist/remediate/steps/dispatch/hostContracts.d.ts.map +1 -1
  165. package/dist/remediate/steps/dispatch/hostHandoff.d.ts +4 -21
  166. package/dist/remediate/steps/dispatch/hostHandoff.d.ts.map +1 -1
  167. package/dist/remediate/steps/dispatch/hostHandoff.js +161 -383
  168. package/dist/remediate/steps/dispatch/hostHandoff.js.map +1 -1
  169. package/dist/remediate/steps/finalGate.d.ts +34 -0
  170. package/dist/remediate/steps/finalGate.d.ts.map +1 -1
  171. package/dist/remediate/steps/finalGate.js +44 -4
  172. package/dist/remediate/steps/finalGate.js.map +1 -1
  173. package/dist/remediate/steps/frictionCloseout.d.ts +1 -30
  174. package/dist/remediate/steps/frictionCloseout.d.ts.map +1 -1
  175. package/dist/remediate/steps/frictionCloseout.js +6 -99
  176. package/dist/remediate/steps/frictionCloseout.js.map +1 -1
  177. package/dist/remediate/steps/nextStep.d.ts +2 -15
  178. package/dist/remediate/steps/nextStep.d.ts.map +1 -1
  179. package/dist/remediate/steps/nextStep.js +255 -1028
  180. package/dist/remediate/steps/nextStep.js.map +1 -1
  181. package/dist/remediate/steps/prompts.js +12 -12
  182. package/dist/remediate/steps/prompts.js.map +1 -1
  183. package/dist/remediate/steps/stepUtils.d.ts +1 -1
  184. package/dist/remediate/steps/stepUtils.d.ts.map +1 -1
  185. package/dist/remediate/steps/types.d.ts +1 -1
  186. package/dist/remediate/steps/types.d.ts.map +1 -1
  187. package/dist/remediate/steps/types.js +1 -1
  188. package/dist/remediate/steps/types.js.map +1 -1
  189. package/dist/remediate/types/options.d.ts +9 -0
  190. package/dist/remediate/types/options.d.ts.map +1 -1
  191. package/dist/remediate/validation/artifacts.d.ts.map +1 -1
  192. package/dist/remediate/validation/artifacts.js +10 -56
  193. package/dist/remediate/validation/artifacts.js.map +1 -1
  194. package/dist/remediate/validation/remediationState.d.ts +2 -2
  195. package/dist/remediate/validation/remediationState.d.ts.map +1 -1
  196. package/dist/remediate/validation/remediationState.js +17 -77
  197. package/dist/remediate/validation/remediationState.js.map +1 -1
  198. package/dist/remediate/validation/verificationReport.d.ts +3 -0
  199. package/dist/remediate/validation/verificationReport.d.ts.map +1 -0
  200. package/dist/remediate/validation/verificationReport.js +28 -0
  201. package/dist/remediate/validation/verificationReport.js.map +1 -0
  202. package/dist/shared/analyzers/types.d.ts +10 -10
  203. package/dist/shared/engine/obligationEngine.d.ts +2 -2
  204. package/dist/shared/friction/triage.d.ts +7 -28
  205. package/dist/shared/friction/triage.d.ts.map +1 -1
  206. package/dist/shared/friction/triage.js +7 -28
  207. package/dist/shared/friction/triage.js.map +1 -1
  208. package/dist/shared/graph/orderedReachability.js +1 -1
  209. package/dist/shared/graph/orderedReachability.js.map +1 -1
  210. package/dist/shared/index.d.ts +5 -6
  211. package/dist/shared/index.d.ts.map +1 -1
  212. package/dist/shared/index.js +3 -4
  213. package/dist/shared/index.js.map +1 -1
  214. package/dist/shared/loopCorePaths.d.ts.map +1 -1
  215. package/dist/shared/loopCorePaths.js +6 -0
  216. package/dist/shared/loopCorePaths.js.map +1 -1
  217. package/dist/shared/prompts.d.ts +1 -2
  218. package/dist/shared/prompts.d.ts.map +1 -1
  219. package/dist/shared/prompts.js +1 -2
  220. package/dist/shared/prompts.js.map +1 -1
  221. package/dist/shared/reReview/projectionDiff.d.ts.map +1 -1
  222. package/dist/shared/reReview/projectionDiff.js +6 -14
  223. package/dist/shared/reReview/projectionDiff.js.map +1 -1
  224. package/dist/shared/types/executionPlan.d.ts +416 -0
  225. package/dist/shared/types/executionPlan.d.ts.map +1 -0
  226. package/dist/shared/types/executionPlan.js +132 -0
  227. package/dist/shared/types/executionPlan.js.map +1 -0
  228. package/dist/shared/types/remediationOutcome.d.ts +1378 -12
  229. package/dist/shared/types/remediationOutcome.d.ts.map +1 -1
  230. package/dist/shared/types/remediationOutcome.js +29 -1
  231. package/dist/shared/types/remediationOutcome.js.map +1 -1
  232. package/dist/shared/types/{contractPipeline/verification.d.ts → verificationReport.d.ts} +9 -37
  233. package/dist/shared/types/verificationReport.d.ts.map +1 -0
  234. package/dist/shared/types/verificationReport.js +4 -0
  235. package/dist/shared/types/verificationReport.js.map +1 -0
  236. package/dist/shared/validation/findingGrounding.d.ts +3 -5
  237. package/dist/shared/validation/findingGrounding.d.ts.map +1 -1
  238. package/dist/shared/validation/findingGrounding.js +4 -7
  239. package/dist/shared/validation/findingGrounding.js.map +1 -1
  240. package/package.json +1 -1
  241. package/dist/remediate/contractPipeline/artifactNames.d.ts +0 -8
  242. package/dist/remediate/contractPipeline/artifactNames.d.ts.map +0 -1
  243. package/dist/remediate/contractPipeline/artifactNames.js +0 -28
  244. package/dist/remediate/contractPipeline/artifactNames.js.map +0 -1
  245. package/dist/remediate/contractPipeline/artifactStore.d.ts +0 -219
  246. package/dist/remediate/contractPipeline/artifactStore.d.ts.map +0 -1
  247. package/dist/remediate/contractPipeline/artifactStore.js +0 -436
  248. package/dist/remediate/contractPipeline/artifactStore.js.map +0 -1
  249. package/dist/remediate/contractPipeline/changeClassification.d.ts +0 -130
  250. package/dist/remediate/contractPipeline/changeClassification.d.ts.map +0 -1
  251. package/dist/remediate/contractPipeline/changeClassification.js +0 -446
  252. package/dist/remediate/contractPipeline/changeClassification.js.map +0 -1
  253. package/dist/remediate/contractPipeline/contractReviewBinding.d.ts +0 -28
  254. package/dist/remediate/contractPipeline/contractReviewBinding.d.ts.map +0 -1
  255. package/dist/remediate/contractPipeline/contractReviewBinding.js +0 -75
  256. package/dist/remediate/contractPipeline/contractReviewBinding.js.map +0 -1
  257. package/dist/remediate/contractPipeline/counterexampleFingerprint.d.ts +0 -27
  258. package/dist/remediate/contractPipeline/counterexampleFingerprint.d.ts.map +0 -1
  259. package/dist/remediate/contractPipeline/counterexampleFingerprint.js +0 -37
  260. package/dist/remediate/contractPipeline/counterexampleFingerprint.js.map +0 -1
  261. package/dist/remediate/contractPipeline/cyclicSeamResolution.d.ts +0 -131
  262. package/dist/remediate/contractPipeline/cyclicSeamResolution.d.ts.map +0 -1
  263. package/dist/remediate/contractPipeline/cyclicSeamResolution.js +0 -257
  264. package/dist/remediate/contractPipeline/cyclicSeamResolution.js.map +0 -1
  265. package/dist/remediate/contractPipeline/derive.d.ts +0 -173
  266. package/dist/remediate/contractPipeline/derive.d.ts.map +0 -1
  267. package/dist/remediate/contractPipeline/derive.js +0 -477
  268. package/dist/remediate/contractPipeline/derive.js.map +0 -1
  269. package/dist/remediate/contractPipeline/finalizedContractFields.d.ts +0 -50
  270. package/dist/remediate/contractPipeline/finalizedContractFields.d.ts.map +0 -1
  271. package/dist/remediate/contractPipeline/finalizedContractFields.js +0 -77
  272. package/dist/remediate/contractPipeline/finalizedContractFields.js.map +0 -1
  273. package/dist/remediate/contractPipeline/idRegistry.d.ts +0 -144
  274. package/dist/remediate/contractPipeline/idRegistry.d.ts.map +0 -1
  275. package/dist/remediate/contractPipeline/idRegistry.js +0 -214
  276. package/dist/remediate/contractPipeline/idRegistry.js.map +0 -1
  277. package/dist/remediate/contractPipeline/obligationKinds.d.ts +0 -27
  278. package/dist/remediate/contractPipeline/obligationKinds.d.ts.map +0 -1
  279. package/dist/remediate/contractPipeline/obligationKinds.js +0 -18
  280. package/dist/remediate/contractPipeline/obligationKinds.js.map +0 -1
  281. package/dist/remediate/contractPipeline/phaseCut.d.ts +0 -125
  282. package/dist/remediate/contractPipeline/phaseCut.d.ts.map +0 -1
  283. package/dist/remediate/contractPipeline/phaseCut.js +0 -339
  284. package/dist/remediate/contractPipeline/phaseCut.js.map +0 -1
  285. package/dist/remediate/contractPipeline/phaseCutArtifact.d.ts +0 -31
  286. package/dist/remediate/contractPipeline/phaseCutArtifact.d.ts.map +0 -1
  287. package/dist/remediate/contractPipeline/phaseCutArtifact.js +0 -48
  288. package/dist/remediate/contractPipeline/phaseCutArtifact.js.map +0 -1
  289. package/dist/remediate/contractPipeline/repairState.d.ts +0 -110
  290. package/dist/remediate/contractPipeline/repairState.d.ts.map +0 -1
  291. package/dist/remediate/contractPipeline/repairState.js +0 -185
  292. package/dist/remediate/contractPipeline/repairState.js.map +0 -1
  293. package/dist/remediate/contractPipeline/reviewSnapshot.d.ts +0 -79
  294. package/dist/remediate/contractPipeline/reviewSnapshot.d.ts.map +0 -1
  295. package/dist/remediate/contractPipeline/reviewSnapshot.js +0 -140
  296. package/dist/remediate/contractPipeline/reviewSnapshot.js.map +0 -1
  297. package/dist/remediate/contractPipeline/semanticProjection.d.ts +0 -64
  298. package/dist/remediate/contractPipeline/semanticProjection.d.ts.map +0 -1
  299. package/dist/remediate/contractPipeline/semanticProjection.js +0 -136
  300. package/dist/remediate/contractPipeline/semanticProjection.js.map +0 -1
  301. package/dist/remediate/contractPipeline/sketchSource.d.ts +0 -194
  302. package/dist/remediate/contractPipeline/sketchSource.d.ts.map +0 -1
  303. package/dist/remediate/contractPipeline/sketchSource.js +0 -262
  304. package/dist/remediate/contractPipeline/sketchSource.js.map +0 -1
  305. package/dist/remediate/contractPipeline/testPlanCarry.d.ts +0 -17
  306. package/dist/remediate/contractPipeline/testPlanCarry.d.ts.map +0 -1
  307. package/dist/remediate/contractPipeline/testPlanCarry.js +0 -72
  308. package/dist/remediate/contractPipeline/testPlanCarry.js.map +0 -1
  309. package/dist/remediate/steps/dispatch/marshal.d.ts +0 -7
  310. package/dist/remediate/steps/dispatch/marshal.d.ts.map +0 -1
  311. package/dist/remediate/steps/dispatch/marshal.js +0 -11
  312. package/dist/remediate/steps/dispatch/marshal.js.map +0 -1
  313. package/dist/remediate/validation/contractPipeline.d.ts +0 -35
  314. package/dist/remediate/validation/contractPipeline.d.ts.map +0 -1
  315. package/dist/remediate/validation/contractPipeline.js +0 -613
  316. package/dist/remediate/validation/contractPipeline.js.map +0 -1
  317. package/dist/remediate/validation/contractPipelineGates.d.ts +0 -272
  318. package/dist/remediate/validation/contractPipelineGates.d.ts.map +0 -1
  319. package/dist/remediate/validation/contractPipelineGates.js +0 -1397
  320. package/dist/remediate/validation/contractPipelineGates.js.map +0 -1
  321. package/dist/shared/types/contractPipeline/design.d.ts +0 -79
  322. package/dist/shared/types/contractPipeline/design.d.ts.map +0 -1
  323. package/dist/shared/types/contractPipeline/design.js +0 -16
  324. package/dist/shared/types/contractPipeline/design.js.map +0 -1
  325. package/dist/shared/types/contractPipeline/goal.d.ts +0 -41
  326. package/dist/shared/types/contractPipeline/goal.d.ts.map +0 -1
  327. package/dist/shared/types/contractPipeline/goal.js +0 -10
  328. package/dist/shared/types/contractPipeline/goal.js.map +0 -1
  329. package/dist/shared/types/contractPipeline/implementation.d.ts +0 -118
  330. package/dist/shared/types/contractPipeline/implementation.d.ts.map +0 -1
  331. package/dist/shared/types/contractPipeline/implementation.js +0 -13
  332. package/dist/shared/types/contractPipeline/implementation.js.map +0 -1
  333. package/dist/shared/types/contractPipeline/obligations.d.ts +0 -283
  334. package/dist/shared/types/contractPipeline/obligations.d.ts.map +0 -1
  335. package/dist/shared/types/contractPipeline/obligations.js +0 -84
  336. package/dist/shared/types/contractPipeline/obligations.js.map +0 -1
  337. package/dist/shared/types/contractPipeline/verification.d.ts.map +0 -1
  338. package/dist/shared/types/contractPipeline/verification.js +0 -10
  339. package/dist/shared/types/contractPipeline/verification.js.map +0 -1
  340. package/dist/shared/types/contractPipeline.d.ts +0 -48
  341. package/dist/shared/types/contractPipeline.d.ts.map +0 -1
  342. package/dist/shared/types/contractPipeline.js +0 -32
  343. package/dist/shared/types/contractPipeline.js.map +0 -1
  344. package/dist/shared/types/obligationLedger.d.ts +0 -39
  345. package/dist/shared/types/obligationLedger.d.ts.map +0 -1
  346. package/dist/shared/types/obligationLedger.js +0 -49
  347. package/dist/shared/types/obligationLedger.js.map +0 -1
@@ -1,144 +0,0 @@
1
- /**
2
- * Single tool-owned authority for the contract-pipeline's id relationships
3
- * (S4 of the contract-authoring determinism design).
4
- *
5
- * Its block-id relationship caused the recurring "Unknown
6
- * finding_id" merge trap: the one-way bare-node-id to `CP-BLOCK-` block-id mint.
7
- * Before this module the prefix was constructed by inline string templates at
8
- * several sites (the DAG->plan promotion built it for both node block ids AND
9
- * dependency edges; the dispatch alias map built it again). With the node id and
10
- * prefix minted in exactly ONE place each, dispatch and merge consume the same
11
- * persisted identity without a reverse-mapping API.
12
- *
13
- * The block-id API is intentionally one-way: callers consume the persisted id
14
- * minted by `toBlockId` rather than reverse-mapping it.
15
- * It is a pure module — no IO, no model identity — so it is testable in
16
- * isolation and feeds the hash/staleness DAG cleanly.
17
- */
18
- /** The one prefix that marks a dispatch block id derived from a DAG node id. */
19
- export declare const CP_BLOCK_PREFIX = "CP-BLOCK-";
20
- /**
21
- * Mint the canonical bare node id for a DAG node, applying the deterministic
22
- * `CP-NNN` fallback when the planner-authored `node.id` is missing (the DAG is
23
- * parsed from an LLM envelope via an unchecked cast, so `id` can be absent at
24
- * runtime). This is the ONE place the fallback rule lives, so a node's finding
25
- * id, block id, `items`, and traceability key can never diverge.
26
- *
27
- * This closes a merge-trap: when `node.id` was missing, the finding id used this
28
- * fallback (`CP-001`) but the block id was built from the raw `node.id`
29
- * (`CP-BLOCK-undefined`), so the worker result landed in `unresolved`. Routing
30
- * every node-id site through `ensureNodeId` keeps the finding and block mints
31
- * aligned.
32
- */
33
- export declare function ensureNodeId(rawId: string | undefined, index: number): string;
34
- /**
35
- * Mint the block id for a bare DAG node id. This is the ONLY place the
36
- * `CP-BLOCK-` prefix is applied — every producer of a block id goes through here.
37
- */
38
- export declare function toBlockId(nodeId: string): string;
39
- /** The one prefix every derived obligation id carries. */
40
- export declare const OBLIGATION_PREFIX = "OBL-";
41
- /**
42
- * Lowercase-hyphenate a module name into the id fragment obligation ids encode.
43
- *
44
- * The ENCODER (`derive.ts`, minting `OBL-<slug>-…`) and the DECODERS (phase
45
- * resolution, write-scope inheritance) must agree exactly, or an obligation
46
- * resolves to no module and its node silently loses its phase and file scope.
47
- * They previously agreed by way of two identical implementations and a comment
48
- * saying they must stay in lockstep — a drift test made of memory. One
49
- * implementation, here with the rest of the id authority, cannot drift.
50
- */
51
- export declare function moduleSlug(name: string): string;
52
- /**
53
- * Mint a derived obligation id from a module name and a suffix — the ONLY place
54
- * the `OBL-<slug>-<suffix>` shape is applied, so the decoders above are matching
55
- * a format with a single author. Callers still pass the result through
56
- * `mintUniqueId` for collision disambiguation.
57
- */
58
- export declare function obligationId(moduleName: string, suffix: string): string;
59
- /**
60
- * The ONE exact join from a derived obligation id back to its module slug, or
61
- * `null` when the id carries no obligation prefix or its body is not
62
- * `<knownSlug>-<grammaticalSuffix>`.
63
- *
64
- * `knownSlugs` MUST be the module slugs in scope; the match is exact, so the
65
- * caller need not pre-sort them (the previous longest-first sort existed only
66
- * to arbitrate the prefix ambiguity this rule removes).
67
- */
68
- export declare function moduleSlugForObligationId(id: string, knownSlugs: ReadonlySet<string>): string | null;
69
- /**
70
- * The one shape a contract-pipeline `goal_id` may take.
71
- *
72
- * Why a grammar at all. `goal_id` is the identity JOINING fifteen artifacts —
73
- * `deriveFinalizedModuleContracts` carries it onto the finalized contracts,
74
- * `deriveObligationLedger` onto the ledger, `contract_goal_id` onto every
75
- * promoted finding, and `validateGoalIdConsistency` reds the run when two
76
- * artifacts disagree. It is the ONE id in this pipeline minted by the LLM
77
- * rather than by the tool (`goal_normalization` is its sole origin), and its
78
- * entire specification the model ever saw was the prompt placeholder
79
- * `<stable-identifier>`. So the format was whatever the model happened to emit:
80
- * observed values in this repo include `G1`, `GOAL-001`, `goal-abc`, `g`,
81
- * `goal-test`, and `goal-self-audit-2026-08-21-first-draw`.
82
- *
83
- * That matters because an unvalidated identity is not an identity. `goal_id`
84
- * becomes a path/plan-row join and a consistency key, and the entry's own
85
- * recorded incident is two artifacts authored in one run under `goal-test` and
86
- * `g` (audit finding MNT-4829db27-3) — a mismatch only the equality gate
87
- * catches, and only when both are present.
88
- *
89
- * The rule: a lowercase alphanumeric slug, hyphen-separated, starting with a
90
- * letter, between 1 and 64 characters. Deliberately PERMISSIVE about content —
91
- * a goal id is an opaque handle, and the model is free to name the goal
92
- * meaningfully — but STRICT about shape, so an empty string, a placeholder left
93
- * unsubstituted (`<stable-identifier>`), or a free-text sentence is refused on
94
- * the way in.
95
- *
96
- * A single-token id (`g`, `g1`, `auth`) is deliberately ADMITTED despite being
97
- * a poor name: the grammar's job is to refuse a non-identity, not to grade one,
98
- * and the alternative — requiring a hyphen — would retroactively invalidate ids
99
- * already persisted by real runs. The property the entry asks for is "minted by
100
- * the registry OR validated on the way in", and validation that rejects
101
- * everything already in the wild is a migration, not a validation.
102
- *
103
- * Kept here, beside the obligation/node/block mints, for the reason this
104
- * module's header gives: a grammar only one side knows is a drift test made of
105
- * memory. `derive.ts` validates on the way in; `validation/contractPipeline.ts`
106
- * and the consistency gate read the same predicate.
107
- */
108
- export declare const GOAL_ID_PATTERN: RegExp;
109
- /** The longest goal id the grammar admits. */
110
- export declare const GOAL_ID_MAX_LENGTH = 64;
111
- /**
112
- * Whether `value` is a well-formed goal id. The ONE home for the question; a
113
- * caller that re-spells the regex has forked the grammar.
114
- */
115
- export declare function isGoalId(value: unknown): value is string;
116
- /**
117
- * Coerce a host-supplied `goal_id` to a well-formed one, or return the empty
118
- * string when it cannot be repaired.
119
- *
120
- * Lowercases and slugifies rather than rejecting outright, because the LLM is
121
- * the producer and a near-miss (`Goal-001`, `goal_001`, `Goal 1`) is the
122
- * expected input shape — refusing it would strand the pipeline on a
123
- * formatting detail. What it will NOT do is invent an id from nothing: an
124
- * absent or placeholder value yields `""`, and every reader's existing
125
- * empty-string handling stays the signal that no goal id was established.
126
- * Deterministic: the same input always yields the same id.
127
- *
128
- * Case-folding is load-bearing, not cosmetic. `validateGoalIdConsistency`
129
- * compares ids for EXACT string equality and reds the run on any difference, so
130
- * under the previous verbatim read two shards that each wrote `Goal-1` and
131
- * `goal-1` for the same goal would fail the gate — and the failure would name a
132
- * mismatch where no disagreement exists. Folding on the way in makes the gate's
133
- * strict comparison mean what it says.
134
- *
135
- * The placeholder guard is not decoration. Slugifying alone would turn the
136
- * prompt's own placeholder `<stable-identifier>` into the well-formed-looking
137
- * `stable-identifier` — MANUFACTURING an identity out of a failure to
138
- * substitute one, which is strictly worse than the verbatim read it replaces
139
- * (that at least kept the angle brackets, so a human could see it). A value
140
- * that is not already slug-shaped once whitespace is trimmed is a value the
141
- * model did not mean as an id, so it yields `""` rather than a plausible slug.
142
- */
143
- export declare function coerceGoalId(value: unknown): string;
144
- //# sourceMappingURL=idRegistry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"idRegistry.d.ts","sourceRoot":"","sources":["../../../src/remediate/contractPipeline/idRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,gFAAgF;AAChF,eAAO,MAAM,eAAe,cAAc,CAAC;AAE3C;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,KAAK,EAAE,MAAM,GACZ,MAAM,CAER;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED,0DAA0D;AAC1D,eAAO,MAAM,iBAAiB,SAAS,CAAC;AAExC;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEvE;AA8BD;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACvC,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,GAC9B,MAAM,GAAG,IAAI,CAUf;AAID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,eAAO,MAAM,eAAe,QAAqC,CAAC;AAElE,8CAA8C;AAC9C,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAOxD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAgBnD"}
@@ -1,214 +0,0 @@
1
- /**
2
- * Single tool-owned authority for the contract-pipeline's id relationships
3
- * (S4 of the contract-authoring determinism design).
4
- *
5
- * Its block-id relationship caused the recurring "Unknown
6
- * finding_id" merge trap: the one-way bare-node-id to `CP-BLOCK-` block-id mint.
7
- * Before this module the prefix was constructed by inline string templates at
8
- * several sites (the DAG->plan promotion built it for both node block ids AND
9
- * dependency edges; the dispatch alias map built it again). With the node id and
10
- * prefix minted in exactly ONE place each, dispatch and merge consume the same
11
- * persisted identity without a reverse-mapping API.
12
- *
13
- * The block-id API is intentionally one-way: callers consume the persisted id
14
- * minted by `toBlockId` rather than reverse-mapping it.
15
- * It is a pure module — no IO, no model identity — so it is testable in
16
- * isolation and feeds the hash/staleness DAG cleanly.
17
- */
18
- /** The one prefix that marks a dispatch block id derived from a DAG node id. */
19
- export const CP_BLOCK_PREFIX = "CP-BLOCK-";
20
- /**
21
- * Mint the canonical bare node id for a DAG node, applying the deterministic
22
- * `CP-NNN` fallback when the planner-authored `node.id` is missing (the DAG is
23
- * parsed from an LLM envelope via an unchecked cast, so `id` can be absent at
24
- * runtime). This is the ONE place the fallback rule lives, so a node's finding
25
- * id, block id, `items`, and traceability key can never diverge.
26
- *
27
- * This closes a merge-trap: when `node.id` was missing, the finding id used this
28
- * fallback (`CP-001`) but the block id was built from the raw `node.id`
29
- * (`CP-BLOCK-undefined`), so the worker result landed in `unresolved`. Routing
30
- * every node-id site through `ensureNodeId` keeps the finding and block mints
31
- * aligned.
32
- */
33
- export function ensureNodeId(rawId, index) {
34
- return rawId ?? `CP-${String(index + 1).padStart(3, "0")}`;
35
- }
36
- /**
37
- * Mint the block id for a bare DAG node id. This is the ONLY place the
38
- * `CP-BLOCK-` prefix is applied — every producer of a block id goes through here.
39
- */
40
- export function toBlockId(nodeId) {
41
- return `${CP_BLOCK_PREFIX}${nodeId}`;
42
- }
43
- /** The one prefix every derived obligation id carries. */
44
- export const OBLIGATION_PREFIX = "OBL-";
45
- /**
46
- * Lowercase-hyphenate a module name into the id fragment obligation ids encode.
47
- *
48
- * The ENCODER (`derive.ts`, minting `OBL-<slug>-…`) and the DECODERS (phase
49
- * resolution, write-scope inheritance) must agree exactly, or an obligation
50
- * resolves to no module and its node silently loses its phase and file scope.
51
- * They previously agreed by way of two identical implementations and a comment
52
- * saying they must stay in lockstep — a drift test made of memory. One
53
- * implementation, here with the rest of the id authority, cannot drift.
54
- */
55
- export function moduleSlug(name) {
56
- return name.toLowerCase().replace(/[^a-z0-9]+/gu, "-").replace(/^-+|-+$/gu, "");
57
- }
58
- /**
59
- * Mint a derived obligation id from a module name and a suffix — the ONLY place
60
- * the `OBL-<slug>-<suffix>` shape is applied, so the decoders above are matching
61
- * a format with a single author. Callers still pass the result through
62
- * `mintUniqueId` for collision disambiguation.
63
- */
64
- export function obligationId(moduleName, suffix) {
65
- return `${OBLIGATION_PREFIX}${moduleSlug(moduleName) || "module"}-${suffix}`;
66
- }
67
- /**
68
- * The suffix GRAMMAR of a derived obligation id — the `…-<suffix>` half, and the
69
- * half that makes the id → module join exact rather than longest-prefix.
70
- *
71
- * Why it has to exist. The decoders (`phaseOrdinalForObligations`, the
72
- * promotion's module-contract attachment) recover a module from its obligation
73
- * ids by matching a slug against the id BODY. Two distinct module names can
74
- * collide there in one direction: `auth` and `auth-service` are different
75
- * modules, and `OBL-auth-service-contract` starts with `auth-`. Longest-slug-
76
- * first picks `auth-service` and happens to be right, but only because the
77
- * SLUG SET is what decides — a plan whose `auth-service` obligations were
78
- * emitted before the module registry knew that name would silently resolve them
79
- * to `auth`, and the node would take `auth`'s phase and file scope.
80
- *
81
- * The suffix is the tiebreak that removes the guess: once the grammar is
82
- * stripped, the remaining body must equal a known slug EXACTLY. A module name
83
- * is free-form prose, so it can contain `contract` or `inv-2`; what it cannot
84
- * do is make the exact-equality test pass for a DIFFERENT module, because the
85
- * candidate body is only ever the id minus its one grammatical suffix.
86
- *
87
- * Kept here, beside the mint, for the same reason `moduleSlug` is: a grammar
88
- * only the encoder knows is a drift test made of memory. `derive.ts` is the
89
- * encoder and imports `obligationId` from this module; the suffixed forms it
90
- * mints are `contract`, `inv-<n>`, and `fail-<n>`, and `mintUniqueId`
91
- * (`audit-tools/shared`) appends `-<n>` to disambiguate a collision.
92
- */
93
- const OBLIGATION_SUFFIX_PATTERN = /^(?:contract|inv-\d+|fail-\d+)(?:-\d+)?$/u;
94
- /**
95
- * The ONE exact join from a derived obligation id back to its module slug, or
96
- * `null` when the id carries no obligation prefix or its body is not
97
- * `<knownSlug>-<grammaticalSuffix>`.
98
- *
99
- * `knownSlugs` MUST be the module slugs in scope; the match is exact, so the
100
- * caller need not pre-sort them (the previous longest-first sort existed only
101
- * to arbitrate the prefix ambiguity this rule removes).
102
- */
103
- export function moduleSlugForObligationId(id, knownSlugs) {
104
- if (!id.startsWith(OBLIGATION_PREFIX))
105
- return null;
106
- const body = id.slice(OBLIGATION_PREFIX.length);
107
- for (let index = body.lastIndexOf("-"); index > 0; index = body.lastIndexOf("-", index - 1)) {
108
- const slug = body.slice(0, index);
109
- if (knownSlugs.has(slug) && OBLIGATION_SUFFIX_PATTERN.test(body.slice(index + 1))) {
110
- return slug;
111
- }
112
- }
113
- return null;
114
- }
115
- // ── The goal-id grammar ─────────────────────────────────────────────────────
116
- /**
117
- * The one shape a contract-pipeline `goal_id` may take.
118
- *
119
- * Why a grammar at all. `goal_id` is the identity JOINING fifteen artifacts —
120
- * `deriveFinalizedModuleContracts` carries it onto the finalized contracts,
121
- * `deriveObligationLedger` onto the ledger, `contract_goal_id` onto every
122
- * promoted finding, and `validateGoalIdConsistency` reds the run when two
123
- * artifacts disagree. It is the ONE id in this pipeline minted by the LLM
124
- * rather than by the tool (`goal_normalization` is its sole origin), and its
125
- * entire specification the model ever saw was the prompt placeholder
126
- * `<stable-identifier>`. So the format was whatever the model happened to emit:
127
- * observed values in this repo include `G1`, `GOAL-001`, `goal-abc`, `g`,
128
- * `goal-test`, and `goal-self-audit-2026-08-21-first-draw`.
129
- *
130
- * That matters because an unvalidated identity is not an identity. `goal_id`
131
- * becomes a path/plan-row join and a consistency key, and the entry's own
132
- * recorded incident is two artifacts authored in one run under `goal-test` and
133
- * `g` (audit finding MNT-4829db27-3) — a mismatch only the equality gate
134
- * catches, and only when both are present.
135
- *
136
- * The rule: a lowercase alphanumeric slug, hyphen-separated, starting with a
137
- * letter, between 1 and 64 characters. Deliberately PERMISSIVE about content —
138
- * a goal id is an opaque handle, and the model is free to name the goal
139
- * meaningfully — but STRICT about shape, so an empty string, a placeholder left
140
- * unsubstituted (`<stable-identifier>`), or a free-text sentence is refused on
141
- * the way in.
142
- *
143
- * A single-token id (`g`, `g1`, `auth`) is deliberately ADMITTED despite being
144
- * a poor name: the grammar's job is to refuse a non-identity, not to grade one,
145
- * and the alternative — requiring a hyphen — would retroactively invalidate ids
146
- * already persisted by real runs. The property the entry asks for is "minted by
147
- * the registry OR validated on the way in", and validation that rejects
148
- * everything already in the wild is a migration, not a validation.
149
- *
150
- * Kept here, beside the obligation/node/block mints, for the reason this
151
- * module's header gives: a grammar only one side knows is a drift test made of
152
- * memory. `derive.ts` validates on the way in; `validation/contractPipeline.ts`
153
- * and the consistency gate read the same predicate.
154
- */
155
- export const GOAL_ID_PATTERN = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u;
156
- /** The longest goal id the grammar admits. */
157
- export const GOAL_ID_MAX_LENGTH = 64;
158
- /**
159
- * Whether `value` is a well-formed goal id. The ONE home for the question; a
160
- * caller that re-spells the regex has forked the grammar.
161
- */
162
- export function isGoalId(value) {
163
- return (typeof value === "string" &&
164
- value.length > 0 &&
165
- value.length <= GOAL_ID_MAX_LENGTH &&
166
- GOAL_ID_PATTERN.test(value));
167
- }
168
- /**
169
- * Coerce a host-supplied `goal_id` to a well-formed one, or return the empty
170
- * string when it cannot be repaired.
171
- *
172
- * Lowercases and slugifies rather than rejecting outright, because the LLM is
173
- * the producer and a near-miss (`Goal-001`, `goal_001`, `Goal 1`) is the
174
- * expected input shape — refusing it would strand the pipeline on a
175
- * formatting detail. What it will NOT do is invent an id from nothing: an
176
- * absent or placeholder value yields `""`, and every reader's existing
177
- * empty-string handling stays the signal that no goal id was established.
178
- * Deterministic: the same input always yields the same id.
179
- *
180
- * Case-folding is load-bearing, not cosmetic. `validateGoalIdConsistency`
181
- * compares ids for EXACT string equality and reds the run on any difference, so
182
- * under the previous verbatim read two shards that each wrote `Goal-1` and
183
- * `goal-1` for the same goal would fail the gate — and the failure would name a
184
- * mismatch where no disagreement exists. Folding on the way in makes the gate's
185
- * strict comparison mean what it says.
186
- *
187
- * The placeholder guard is not decoration. Slugifying alone would turn the
188
- * prompt's own placeholder `<stable-identifier>` into the well-formed-looking
189
- * `stable-identifier` — MANUFACTURING an identity out of a failure to
190
- * substitute one, which is strictly worse than the verbatim read it replaces
191
- * (that at least kept the angle brackets, so a human could see it). A value
192
- * that is not already slug-shaped once whitespace is trimmed is a value the
193
- * model did not mean as an id, so it yields `""` rather than a plausible slug.
194
- */
195
- export function coerceGoalId(value) {
196
- if (typeof value !== "string")
197
- return "";
198
- const trimmed = value.trim();
199
- // Refuse anything carrying structure a goal id cannot have: angle brackets
200
- // (a template placeholder), whitespace runs between words (prose), or any
201
- // punctuation outside the hyphen/underscore separators we fold.
202
- if (/[<>{}[\]"'`/\\.,;:!?()@#$%^&*+=|~]/u.test(trimmed))
203
- return "";
204
- if (/\s/u.test(trimmed) && !/^[A-Za-z0-9]+(?:[\s_-]+[A-Za-z0-9]+)+$/u.test(trimmed)) {
205
- return "";
206
- }
207
- const slug = trimmed
208
- .toLowerCase()
209
- .replace(/[\s_]+/gu, "-")
210
- .replace(/-+/gu, "-")
211
- .replace(/^-+|-+$/gu, "");
212
- return isGoalId(slug) ? slug : "";
213
- }
214
- //# sourceMappingURL=idRegistry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"idRegistry.js","sourceRoot":"","sources":["../../../src/remediate/contractPipeline/idRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,gFAAgF;AAChF,MAAM,CAAC,MAAM,eAAe,GAAG,WAAW,CAAC;AAE3C;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,YAAY,CAC1B,KAAyB,EACzB,KAAa;IAEb,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;AAC7D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,MAAc;IACtC,OAAO,GAAG,eAAe,GAAG,MAAM,EAAE,CAAC;AACvC,CAAC;AAED,0DAA0D;AAC1D,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC;AAExC;;;;;;;;;GASG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;AAClF,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,UAAkB,EAAE,MAAc;IAC7D,OAAO,GAAG,iBAAiB,GAAG,UAAU,CAAC,UAAU,CAAC,IAAI,QAAQ,IAAI,MAAM,EAAE,CAAC;AAC/E,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,yBAAyB,GAAG,2CAA2C,CAAC;AAE9E;;;;;;;;GAQG;AACH,MAAM,UAAU,yBAAyB,CACvC,EAAU,EACV,UAA+B;IAE/B,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,iBAAiB,CAAC;QAAE,OAAO,IAAI,CAAC;IACnD,MAAM,IAAI,GAAG,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAChD,KAAK,IAAI,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,KAAK,GAAG,CAAC,CAAC,EAAE,CAAC;QAC5F,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;QAClC,IAAI,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,yBAAyB,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;YAClF,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,+EAA+E;AAE/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,kCAAkC,CAAC;AAElE,8CAA8C;AAC9C,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAErC;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAc;IACrC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,CAAC,MAAM,GAAG,CAAC;QAChB,KAAK,CAAC,MAAM,IAAI,kBAAkB;QAClC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAC5B,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,YAAY,CAAC,KAAc;IACzC,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,EAAE,CAAC;IACzC,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,2EAA2E;IAC3E,0EAA0E;IAC1E,gEAAgE;IAChE,IAAI,qCAAqC,CAAC,IAAI,CAAC,OAAO,CAAC;QAAE,OAAO,EAAE,CAAC;IACnE,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,yCAAyC,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QACpF,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,IAAI,GAAG,OAAO;SACjB,WAAW,EAAE;SACb,OAAO,CAAC,UAAU,EAAE,GAAG,CAAC;SACxB,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;SACpB,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;IAC5B,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;AACpC,CAAC"}
@@ -1,27 +0,0 @@
1
- /**
2
- * One vocabulary for contract-pipeline obligation kinds. Definition order
3
- * preserves the observable TESTABLE_OBLIGATION_KINDS iteration order; the
4
- * explicit priority rank preserves the load-bearing lens/severity order.
5
- */
6
- declare const OBLIGATION_KIND_DEFINITIONS: readonly [{
7
- readonly kind: "invariant";
8
- readonly testable: true;
9
- readonly priority: 3;
10
- }, {
11
- readonly kind: "behavioral";
12
- readonly testable: true;
13
- readonly priority: 2;
14
- }, {
15
- readonly kind: "structural";
16
- readonly testable: false;
17
- readonly priority: 1;
18
- }, {
19
- readonly kind: "test";
20
- readonly testable: false;
21
- readonly priority: 0;
22
- }];
23
- export type ObligationKind = (typeof OBLIGATION_KIND_DEFINITIONS)[number]["kind"];
24
- export declare const OBLIGATION_KIND_PRIORITY: readonly ObligationKind[];
25
- export declare const TESTABLE_OBLIGATION_KINDS: Set<string>;
26
- export {};
27
- //# sourceMappingURL=obligationKinds.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"obligationKinds.d.ts","sourceRoot":"","sources":["../../../src/remediate/contractPipeline/obligationKinds.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,QAAA,MAAM,2BAA2B;;;;;;;;;;;;;;;;EAKvB,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;AAElF,eAAO,MAAM,wBAAwB,EAAE,SAAS,cAAc,EAIpC,CAAC;AAE3B,eAAO,MAAM,yBAAyB,aAErC,CAAC"}
@@ -1,18 +0,0 @@
1
- /**
2
- * One vocabulary for contract-pipeline obligation kinds. Definition order
3
- * preserves the observable TESTABLE_OBLIGATION_KINDS iteration order; the
4
- * explicit priority rank preserves the load-bearing lens/severity order.
5
- */
6
- const OBLIGATION_KIND_DEFINITIONS = [
7
- { kind: "invariant", testable: true, priority: 3 },
8
- { kind: "behavioral", testable: true, priority: 2 },
9
- { kind: "structural", testable: false, priority: 1 },
10
- { kind: "test", testable: false, priority: 0 },
11
- ];
12
- export const OBLIGATION_KIND_PRIORITY = [
13
- ...OBLIGATION_KIND_DEFINITIONS,
14
- ]
15
- .sort((left, right) => left.priority - right.priority)
16
- .map(({ kind }) => kind);
17
- export const TESTABLE_OBLIGATION_KINDS = new Set(OBLIGATION_KIND_DEFINITIONS.filter(({ testable }) => testable).map(({ kind }) => kind));
18
- //# sourceMappingURL=obligationKinds.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"obligationKinds.js","sourceRoot":"","sources":["../../../src/remediate/contractPipeline/obligationKinds.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,2BAA2B,GAAG;IAClC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE;IAClD,EAAE,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE;IACnD,EAAE,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE;IACpD,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE;CACtC,CAAC;AAIX,MAAM,CAAC,MAAM,wBAAwB,GAA8B;IACjE,GAAG,2BAA2B;CAC/B;KACE,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;KACrD,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;AAE3B,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,GAAG,CAC9C,2BAA2B,CAAC,MAAM,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,CACvF,CAAC"}
@@ -1,125 +0,0 @@
1
- /**
2
- * Deterministic phase-cut derivation (remediator auto-phasing, T3).
3
- *
4
- * When `/remediate-code` is pointed at an arbitrary N-goal input (e.g. the whole
5
- * backlog), the independent conceptual-design critique used to reject the run as
6
- * "over-scoped" and the HOST had to manually re-scope to a phase at intake. That
7
- * is the tool's job, not the host's: given the module-dependency DAG (the
8
- * producer/consumer `artifact:<name>` token edges declared in the contracts'
9
- * inputs/outputs), the tool derives a foundations→consumers
10
- * phase cut MECHANICALLY — ordered tiers where every module sits one tier below
11
- * the modules that depend on it. The critique is then handed the derived cut, so
12
- * it assesses design quality WITHIN a mechanically dependency-ordered phasing
13
- * rather than rejecting breadth (over-scoping is already handled by construction).
14
- *
15
- * Pure + deterministic (no I/O, no Date/Math.random, stable ordering): the same
16
- * modules always yield the same cut. Cycle-safe — a dependency cycle cannot be
17
- * topologically tiered, so its members are placed together at the tier just past
18
- * their highest acyclic dependency (named-sorted, fail toward a LATER tier so a
19
- * cyclic module never front-runs a real foundation it transitively needs).
20
- */
21
- import { moduleSlugForObligationId } from "./idRegistry.js";
22
- /** One module + the names of the other modules it depends on (its foundations). */
23
- export interface PhaseCutModule {
24
- name: string;
25
- /** Names of modules this module needs in place first (directional: this → dep). */
26
- depends_on: string[];
27
- }
28
- /** One derived phase: an ordered tier of modules that may be authored together. */
29
- export interface PhaseCutPhase {
30
- /** 0-based tier ordinal; 0 = foundations. */
31
- ordinal: number;
32
- /** Stable human label for the tier. */
33
- name: string;
34
- /** Module names in this tier, sorted for determinism. */
35
- modules: string[];
36
- }
37
- /** The derived phase cut: ordered tiers covering every module exactly once. */
38
- export interface PhaseCut {
39
- phases: PhaseCutPhase[];
40
- /** True when a dependency cycle was detected (its members were tiered together). */
41
- has_cycle: boolean;
42
- /** Module name → 0-based phase ordinal (foundations = 0). The downstream key. */
43
- module_phase: Record<string, number>;
44
- }
45
- /**
46
- * Derive the ordered phase cut from a module-dependency DAG. Each module's tier is
47
- * the length of its longest dependency chain (foundations = 0). Edges to unknown
48
- * module names are ignored (a `needs` on a module not in scope is not a phase
49
- * constraint here). Returns one phase per occupied tier, covering every module.
50
- */
51
- export declare function derivePhaseCut(modules: PhaseCutModule[]): PhaseCut;
52
- /**
53
- * The id fragment obligation ids encode — re-exported from the id registry,
54
- * which owns both this and the mint that produces `OBL-<slug>-…`, so encoder and
55
- * decoder cannot drift. Kept exported here because this module is where the
56
- * node→phase decoders live and import it from.
57
- */
58
- export { moduleSlug } from "./idRegistry.js";
59
- /**
60
- * Resolve the phase ordinal for an implementation-DAG node from the obligation
61
- * ids it discharges. Every derived obligation id is `OBL-<moduleSlug>-<suffix>`,
62
- * so the owning module (hence phase) is recoverable by the EXACT join in
63
- * `idRegistry.moduleSlugForObligationId` — no lossy slug reversal, and no
64
- * longest-prefix guess (that rule resolved `OBL-auth-service-…` to `auth`
65
- * whenever `auth-service` was not in the slug set, silently handing the node
66
- * another module's phase and file scope). A node spanning modules in several
67
- * phases takes the MAX ordinal (fail-toward-later: it cannot land before the
68
- * latest module it touches is reachable). A node whose obligations match no
69
- * in-scope module slug — a counterexample-only node, or an obligation from a
70
- * module dropped from the cut — defaults to the LAST phase (integration), never
71
- * front-running a foundation.
72
- *
73
- * `slugToOrdinal` is the module-phase map re-keyed by `moduleSlug(name)`.
74
- */
75
- export declare function phaseOrdinalForObligations(obligationIds: readonly string[], slugToOrdinal: Map<string, number>, lastOrdinal: number): number;
76
- export { moduleSlugForObligationId };
77
- /** One producer→consumer pairing and the artifact token that links it. */
78
- interface ArtifactTokenEdge {
79
- /** The depending module — it consumes the artifact. */
80
- consumer: string;
81
- /** The module it depends on — it produces the artifact. */
82
- producer: string;
83
- /** The normalized artifact name from the `artifact:<name>` token. */
84
- artifact: string;
85
- }
86
- /**
87
- * Build {@link PhaseCutModule}s from finalized module contracts. A module's
88
- * `depends_on` derives from producer/consumer artifact-token matching over
89
- * `inputs`/`outputs` ALONE. Drafted `neighbor_needs` never enter this graph
90
- * (open-bugs.md:106): they are symmetric coordination prose whose directions
91
- * per-module drafting agents routinely invert, and unioning them in let prose
92
- * override every declared token edge — finalization drops the field instead.
93
- * A module that consumes from another is one tier ABOVE it. Tolerant of
94
- * malformed payloads: anything unparseable contributes no module/edge.
95
- */
96
- export declare function phaseCutModulesFromContracts(contractsPayload: unknown): PhaseCutModule[];
97
- /** One declared-graph cycle: its member modules and the token edges among them. */
98
- export interface ContractTokenCycle {
99
- /** Cycle members, in stable input order. */
100
- members: string[];
101
- /** The consumer→producer token edges between cycle members. */
102
- edges: ArtifactTokenEdge[];
103
- }
104
- /**
105
- * Detect cycles in the DECLARED module-dependency graph — the producer/consumer
106
- * `artifact:` token edges of a module-contracts payload (drafted or finalized;
107
- * finalization copies `inputs`/`outputs` verbatim, so the two graphs are equal).
108
- * A cycle here is a VALIDATION error at the contract boundary (open-bugs.md:106):
109
- * the phase cut must never be derived over a cyclic declared graph, because the
110
- * fail-toward-later tiering silently drops a back-edge and places token
111
- * consumers ahead of their producers. Members and their linking edges are
112
- * reported so the repair prompt can name exactly which tokens form each cycle.
113
- */
114
- export declare function detectContractTokenCycles(contractsPayload: unknown): ContractTokenCycle[];
115
- /**
116
- * Add Path-A seam-preparation edges to the contract-derived module DAG. The
117
- * decomposition gate has already guaranteed one preparer per required seam;
118
- * this projection makes every implementation module for either participating
119
- * work block depend on that preparer, yielding a seam-first phase followed by
120
- * parallel refactor modules.
121
- */
122
- export declare function applyWorkBlockSeamDependencies(modules: PhaseCutModule[], moduleDecompositionPayload: unknown, pathASeedPayload: unknown): PhaseCutModule[];
123
- /** Render the derived phase cut as a markdown section for the critique prompt. */
124
- export declare function renderPhaseCutSection(cut: PhaseCut): string;
125
- //# sourceMappingURL=phaseCut.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"phaseCut.d.ts","sourceRoot":"","sources":["../../../src/remediate/contractPipeline/phaseCut.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAI5D,mFAAmF;AACnF,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,mFAAmF;IACnF,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,mFAAmF;AACnF,MAAM,WAAW,aAAa;IAC5B,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,yDAAyD;IACzD,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,+EAA+E;AAC/E,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,oFAAoF;IACpF,SAAS,EAAE,OAAO,CAAC;IACnB,iFAAiF;IACjF,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC;AASD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,cAAc,EAAE,GAAG,QAAQ,CAiElE;AAED;;;;;GAKG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,0BAA0B,CACxC,aAAa,EAAE,SAAS,MAAM,EAAE,EAChC,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAClC,WAAW,EAAE,MAAM,GAClB,MAAM,CAWR;AAED,OAAO,EAAE,yBAAyB,EAAE,CAAC;AA+BrC,0EAA0E;AAC1E,UAAU,iBAAiB;IACzB,uDAAuD;IACvD,QAAQ,EAAE,MAAM,CAAC;IACjB,2DAA2D;IAC3D,QAAQ,EAAE,MAAM,CAAC;IACjB,qEAAqE;IACrE,QAAQ,EAAE,MAAM,CAAC;CAClB;AAiDD;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAAC,gBAAgB,EAAE,OAAO,GAAG,cAAc,EAAE,CAYxF;AAED,mFAAmF;AACnF,MAAM,WAAW,kBAAkB;IACjC,4CAA4C;IAC5C,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,+DAA+D;IAC/D,KAAK,EAAE,iBAAiB,EAAE,CAAC;CAC5B;AAED;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,CAAC,gBAAgB,EAAE,OAAO,GAAG,kBAAkB,EAAE,CAYzF;AAED;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,cAAc,EAAE,EACzB,0BAA0B,EAAE,OAAO,EACnC,gBAAgB,EAAE,OAAO,GACxB,cAAc,EAAE,CAiElB;AAED,kFAAkF;AAClF,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,QAAQ,GAAG,MAAM,CAmB3D"}