audit-tools 0.52.4 → 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 (348) 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/remediate-code.mjs +16 -3
  242. package/dist/remediate/contractPipeline/artifactNames.d.ts +0 -8
  243. package/dist/remediate/contractPipeline/artifactNames.d.ts.map +0 -1
  244. package/dist/remediate/contractPipeline/artifactNames.js +0 -28
  245. package/dist/remediate/contractPipeline/artifactNames.js.map +0 -1
  246. package/dist/remediate/contractPipeline/artifactStore.d.ts +0 -219
  247. package/dist/remediate/contractPipeline/artifactStore.d.ts.map +0 -1
  248. package/dist/remediate/contractPipeline/artifactStore.js +0 -436
  249. package/dist/remediate/contractPipeline/artifactStore.js.map +0 -1
  250. package/dist/remediate/contractPipeline/changeClassification.d.ts +0 -130
  251. package/dist/remediate/contractPipeline/changeClassification.d.ts.map +0 -1
  252. package/dist/remediate/contractPipeline/changeClassification.js +0 -446
  253. package/dist/remediate/contractPipeline/changeClassification.js.map +0 -1
  254. package/dist/remediate/contractPipeline/contractReviewBinding.d.ts +0 -28
  255. package/dist/remediate/contractPipeline/contractReviewBinding.d.ts.map +0 -1
  256. package/dist/remediate/contractPipeline/contractReviewBinding.js +0 -75
  257. package/dist/remediate/contractPipeline/contractReviewBinding.js.map +0 -1
  258. package/dist/remediate/contractPipeline/counterexampleFingerprint.d.ts +0 -27
  259. package/dist/remediate/contractPipeline/counterexampleFingerprint.d.ts.map +0 -1
  260. package/dist/remediate/contractPipeline/counterexampleFingerprint.js +0 -37
  261. package/dist/remediate/contractPipeline/counterexampleFingerprint.js.map +0 -1
  262. package/dist/remediate/contractPipeline/cyclicSeamResolution.d.ts +0 -131
  263. package/dist/remediate/contractPipeline/cyclicSeamResolution.d.ts.map +0 -1
  264. package/dist/remediate/contractPipeline/cyclicSeamResolution.js +0 -257
  265. package/dist/remediate/contractPipeline/cyclicSeamResolution.js.map +0 -1
  266. package/dist/remediate/contractPipeline/derive.d.ts +0 -173
  267. package/dist/remediate/contractPipeline/derive.d.ts.map +0 -1
  268. package/dist/remediate/contractPipeline/derive.js +0 -477
  269. package/dist/remediate/contractPipeline/derive.js.map +0 -1
  270. package/dist/remediate/contractPipeline/finalizedContractFields.d.ts +0 -50
  271. package/dist/remediate/contractPipeline/finalizedContractFields.d.ts.map +0 -1
  272. package/dist/remediate/contractPipeline/finalizedContractFields.js +0 -77
  273. package/dist/remediate/contractPipeline/finalizedContractFields.js.map +0 -1
  274. package/dist/remediate/contractPipeline/idRegistry.d.ts +0 -144
  275. package/dist/remediate/contractPipeline/idRegistry.d.ts.map +0 -1
  276. package/dist/remediate/contractPipeline/idRegistry.js +0 -214
  277. package/dist/remediate/contractPipeline/idRegistry.js.map +0 -1
  278. package/dist/remediate/contractPipeline/obligationKinds.d.ts +0 -27
  279. package/dist/remediate/contractPipeline/obligationKinds.d.ts.map +0 -1
  280. package/dist/remediate/contractPipeline/obligationKinds.js +0 -18
  281. package/dist/remediate/contractPipeline/obligationKinds.js.map +0 -1
  282. package/dist/remediate/contractPipeline/phaseCut.d.ts +0 -125
  283. package/dist/remediate/contractPipeline/phaseCut.d.ts.map +0 -1
  284. package/dist/remediate/contractPipeline/phaseCut.js +0 -339
  285. package/dist/remediate/contractPipeline/phaseCut.js.map +0 -1
  286. package/dist/remediate/contractPipeline/phaseCutArtifact.d.ts +0 -31
  287. package/dist/remediate/contractPipeline/phaseCutArtifact.d.ts.map +0 -1
  288. package/dist/remediate/contractPipeline/phaseCutArtifact.js +0 -48
  289. package/dist/remediate/contractPipeline/phaseCutArtifact.js.map +0 -1
  290. package/dist/remediate/contractPipeline/repairState.d.ts +0 -110
  291. package/dist/remediate/contractPipeline/repairState.d.ts.map +0 -1
  292. package/dist/remediate/contractPipeline/repairState.js +0 -185
  293. package/dist/remediate/contractPipeline/repairState.js.map +0 -1
  294. package/dist/remediate/contractPipeline/reviewSnapshot.d.ts +0 -79
  295. package/dist/remediate/contractPipeline/reviewSnapshot.d.ts.map +0 -1
  296. package/dist/remediate/contractPipeline/reviewSnapshot.js +0 -140
  297. package/dist/remediate/contractPipeline/reviewSnapshot.js.map +0 -1
  298. package/dist/remediate/contractPipeline/semanticProjection.d.ts +0 -64
  299. package/dist/remediate/contractPipeline/semanticProjection.d.ts.map +0 -1
  300. package/dist/remediate/contractPipeline/semanticProjection.js +0 -136
  301. package/dist/remediate/contractPipeline/semanticProjection.js.map +0 -1
  302. package/dist/remediate/contractPipeline/sketchSource.d.ts +0 -194
  303. package/dist/remediate/contractPipeline/sketchSource.d.ts.map +0 -1
  304. package/dist/remediate/contractPipeline/sketchSource.js +0 -262
  305. package/dist/remediate/contractPipeline/sketchSource.js.map +0 -1
  306. package/dist/remediate/contractPipeline/testPlanCarry.d.ts +0 -17
  307. package/dist/remediate/contractPipeline/testPlanCarry.d.ts.map +0 -1
  308. package/dist/remediate/contractPipeline/testPlanCarry.js +0 -72
  309. package/dist/remediate/contractPipeline/testPlanCarry.js.map +0 -1
  310. package/dist/remediate/steps/dispatch/marshal.d.ts +0 -7
  311. package/dist/remediate/steps/dispatch/marshal.d.ts.map +0 -1
  312. package/dist/remediate/steps/dispatch/marshal.js +0 -11
  313. package/dist/remediate/steps/dispatch/marshal.js.map +0 -1
  314. package/dist/remediate/validation/contractPipeline.d.ts +0 -35
  315. package/dist/remediate/validation/contractPipeline.d.ts.map +0 -1
  316. package/dist/remediate/validation/contractPipeline.js +0 -613
  317. package/dist/remediate/validation/contractPipeline.js.map +0 -1
  318. package/dist/remediate/validation/contractPipelineGates.d.ts +0 -272
  319. package/dist/remediate/validation/contractPipelineGates.d.ts.map +0 -1
  320. package/dist/remediate/validation/contractPipelineGates.js +0 -1397
  321. package/dist/remediate/validation/contractPipelineGates.js.map +0 -1
  322. package/dist/shared/types/contractPipeline/design.d.ts +0 -79
  323. package/dist/shared/types/contractPipeline/design.d.ts.map +0 -1
  324. package/dist/shared/types/contractPipeline/design.js +0 -16
  325. package/dist/shared/types/contractPipeline/design.js.map +0 -1
  326. package/dist/shared/types/contractPipeline/goal.d.ts +0 -41
  327. package/dist/shared/types/contractPipeline/goal.d.ts.map +0 -1
  328. package/dist/shared/types/contractPipeline/goal.js +0 -10
  329. package/dist/shared/types/contractPipeline/goal.js.map +0 -1
  330. package/dist/shared/types/contractPipeline/implementation.d.ts +0 -118
  331. package/dist/shared/types/contractPipeline/implementation.d.ts.map +0 -1
  332. package/dist/shared/types/contractPipeline/implementation.js +0 -13
  333. package/dist/shared/types/contractPipeline/implementation.js.map +0 -1
  334. package/dist/shared/types/contractPipeline/obligations.d.ts +0 -283
  335. package/dist/shared/types/contractPipeline/obligations.d.ts.map +0 -1
  336. package/dist/shared/types/contractPipeline/obligations.js +0 -84
  337. package/dist/shared/types/contractPipeline/obligations.js.map +0 -1
  338. package/dist/shared/types/contractPipeline/verification.d.ts.map +0 -1
  339. package/dist/shared/types/contractPipeline/verification.js +0 -10
  340. package/dist/shared/types/contractPipeline/verification.js.map +0 -1
  341. package/dist/shared/types/contractPipeline.d.ts +0 -48
  342. package/dist/shared/types/contractPipeline.d.ts.map +0 -1
  343. package/dist/shared/types/contractPipeline.js +0 -32
  344. package/dist/shared/types/contractPipeline.js.map +0 -1
  345. package/dist/shared/types/obligationLedger.d.ts +0 -39
  346. package/dist/shared/types/obligationLedger.d.ts.map +0 -1
  347. package/dist/shared/types/obligationLedger.js +0 -49
  348. package/dist/shared/types/obligationLedger.js.map +0 -1
@@ -1,477 +0,0 @@
1
- /**
2
- * Deterministic derivers for contract-pipeline artifacts.
3
- *
4
- * S1 of the contract-authoring determinism design
5
- * (`spec/contract-authoring-determinism-design.md`): the contract pipeline
6
- * historically had the LLM author every structured artifact and the backend
7
- * only validate it afterward. For the artifacts whose *structure* is a pure
8
- * function of an upstream artifact, that is wasted generation and a weak-model
9
- * failure surface ("emit a large, schema-conforming, internally-consistent JSON
10
- * artifact from scratch with correct ids and cross-refs"). This module owns
11
- * those derivations so the tool produces the structure and the model is left
12
- * only the irreducible judgment.
13
- *
14
- * `deriveObligationLedger` is the flagship: the obligation ledger is a 1:1
15
- * restructuring of the finalized module contracts — every module invariant and
16
- * failure mode becomes an obligation, and every module gets a
17
- * contract-conformance obligation — so no judgment is lost by generating it in
18
- * code. Construction goes through the shared `buildObligationLedger` so the
19
- * cycle check, version stamp, and envelope stay single-sourced with the rest of
20
- * the codebase (the non-negotiable "derivers and validators share one source —
21
- * no parallel logic").
22
- */
23
- import { buildObligationLedger, isRecord, mintUniqueId, } from "audit-tools/shared";
24
- import { buildBaselineSymbolCorpus, classifyObligationChange, obligationScopeAnchors, readObligationChangeClassification, } from "./changeClassification.js";
25
- import { derivePhaseCut, phaseCutModulesFromContracts } from "./phaseCut.js";
26
- import { coerceGoalId, obligationId } from "./idRegistry.js";
27
- import { COPIED_MODULE_CONTRACT_FIELDS, DERIVED_MODULE_CONTRACT_FIELDS, } from "./finalizedContractFields.js";
28
- import { CP_FINALIZED_MODULE_CONTRACTS_VERSION } from "../validation/contractPipeline.js";
29
- import { isTestablePhaseObligation } from "../validation/contractPipelineGates.js";
30
- /**
31
- * Derive the obligation ledger deterministically from the finalized module
32
- * contracts. Pure function of its input (modulo the `created_at` stamp): the
33
- * same contracts always yield the same obligations in the same order, so the
34
- * artifact hash / staleness DAG stays well-behaved.
35
- *
36
- * Mapping (the inverse of the obligation-ledger consumers' expectations):
37
- * - one **structural** obligation per module ("implement this module per its
38
- * finalized contract") — guarantees the ledger is never empty and every
39
- * module has something the implementation DAG must cover, without inventing
40
- * a paired-test burden (structural is not a testable kind);
41
- * - one **invariant** obligation per declared module invariant (testable);
42
- * - one **behavioral** obligation per declared module failure mode (testable).
43
- *
44
- * `depends_on` is left empty: the validated module-contract shape declares no
45
- * inter-obligation ordering, so an honest derivation asserts none (and the
46
- * ledger is acyclic by construction — `buildObligationLedger` cannot throw).
47
- */
48
- export function deriveObligationLedger(finalizedModuleContracts, options = {}) {
49
- const finalized = readFinalizedContracts(finalizedModuleContracts);
50
- const usedIds = new Set();
51
- const obligations = [];
52
- // DC-5: baseline corpus of pre-existing symbols, built once from the declared
53
- // interface surface. A testable obligation that references a symbol in here is
54
- // classified a behavior CHANGE (deterministic FIRST pass); otherwise an
55
- // ADDITION. The verdict is recorded on each obligation so the paired-test gate
56
- // is driven by data, not by render-only prose (CE-013).
57
- const baselineSymbols = buildBaselineSymbolCorpus(finalizedModuleContracts);
58
- for (const mod of finalized.module_contracts) {
59
- // Contract-conformance obligation — represents the module even when it
60
- // declares no invariants/failure modes (structural kind → not testable).
61
- obligations.push({
62
- id: mintUniqueId(usedIds, obligationId(mod.name, "contract")),
63
- description: `Implement module "${mod.name}" per its finalized contract ` +
64
- `(inputs: ${fmtList(mod.inputs)} → outputs: ${fmtList(mod.outputs)}; ` +
65
- `validation boundary: ${mod.validation_boundary || "n/a"}).`,
66
- kind: "structural",
67
- depends_on: [],
68
- status: "pending",
69
- source: "design_spec",
70
- module: mod.name,
71
- });
72
- mod.invariants.forEach((invariant, i) => {
73
- obligations.push({
74
- id: mintUniqueId(usedIds, obligationId(mod.name, `inv-${i + 1}`)),
75
- description: invariant,
76
- kind: "invariant",
77
- depends_on: [],
78
- status: "pending",
79
- source: "design_spec",
80
- module: mod.name,
81
- change_classification: classifyObligationChange(invariant, baselineSymbols),
82
- });
83
- });
84
- mod.failure_modes.forEach((failureMode, j) => {
85
- obligations.push({
86
- id: mintUniqueId(usedIds, obligationId(mod.name, `fail-${j + 1}`)),
87
- description: `Handle failure mode: ${failureMode}`,
88
- kind: "behavioral",
89
- depends_on: [],
90
- status: "pending",
91
- source: "design_spec",
92
- module: mod.name,
93
- change_classification: classifyObligationChange(failureMode, baselineSymbols),
94
- });
95
- });
96
- }
97
- return buildObligationLedger({
98
- goal_id: finalized.goal_id,
99
- obligations,
100
- created_at: options.created_at,
101
- });
102
- }
103
- // ── Finalized module contracts (deterministic attach) ─────────────────────────
104
- //
105
- // `contract_finalization` is a mechanical merge, not fresh authoring: it takes
106
- // the drafted module contracts and the seam-reconciliation decisions and, per
107
- // module, carries the draft interface verbatim while attaching the
108
- // `agreed_interface` of every seam that touches the module as a `seam_adjustment`.
109
- // No source is re-read and no judgment is spent — the judgment already happened
110
- // upstream (the seam_reconciliation phase decided each mismatch's resolution).
111
- // Attaching each agreed interface verbatim guarantees the reconciliation-derivation
112
- // gate (INV-CO-12) passes, since its corpus is the union of every module's
113
- // inputs/outputs/invariants/side_effects/seam_adjustments/validation_boundary.
114
- //
115
- // `neighbor_needs` is DROPPED at finalization (open-bugs.md:106). It is the
116
- // drafting phase's seam-negotiation vocabulary — symmetric coordination prose
117
- // whose directions per-module agents routinely invert — and when it was
118
- // preserved and unioned into the dependency graph, prose overrode every
119
- // declared `artifact:<name>` token edge and manufactured cycles the
120
- // fail-toward-later tiering then mis-phased. Implementation ordering derives
121
- // from the producer/consumer token graph ALONE. A weaker draft that leaves
122
- // inputs/outputs token-free simply declares no ordering constraint; a seam
123
- // report referencing a module not in scope still surfaces at the downstream
124
- // design/reconciliation gate and routes to an LLM re-author of
125
- // `contract_finalization` — the only path that still needs judgment.
126
- /** The seam-reconciliation `agreed_interface`s that touch a given module name. */
127
- function seamAdjustmentsForModule(moduleName, seamReconciliationReport) {
128
- const mismatches = isRecord(seamReconciliationReport) && Array.isArray(seamReconciliationReport.mismatches)
129
- ? seamReconciliationReport.mismatches
130
- : [];
131
- const adjustments = [];
132
- for (const mismatch of mismatches) {
133
- if (!isRecord(mismatch))
134
- continue;
135
- if (mismatch.module_a !== moduleName && mismatch.module_b !== moduleName)
136
- continue;
137
- const resolution = isRecord(mismatch.resolution) ? mismatch.resolution : undefined;
138
- const agreed = resolution && typeof resolution.agreed_interface === "string"
139
- ? resolution.agreed_interface
140
- : "";
141
- if (agreed.length === 0)
142
- continue;
143
- const seamId = typeof mismatch.seam_id === "string" ? mismatch.seam_id : "";
144
- adjustments.push(seamId ? `${seamId}: ${agreed}` : agreed);
145
- }
146
- return adjustments;
147
- }
148
- /**
149
- * Derive `finalized_module_contracts` deterministically from the drafted
150
- * `module_contracts` and the `seam_reconciliation_report`. Pure function of its
151
- * inputs (modulo the `created_at` stamp): the same drafts + seam report always
152
- * yield the same finalized contracts in draft order, so the artifact hash /
153
- * staleness DAG stays well-behaved.
154
- *
155
- * Each finalized entry copies the draft's interface fields verbatim (already
156
- * validated `string[]` / string shapes, so no coercion is needed) and DROPS
157
- * `neighbor_needs` (ordering derives from the artifact-token graph alone), then
158
- * sets `seam_adjustments` to the `agreed_interface`(s) of the seams that touch
159
- * the module. A draft entry that is not an object is passed through unchanged
160
- * (the downstream validator reports it).
161
- */
162
- /**
163
- * The producer for each DERIVED module-contract field, keyed by the SAME union
164
- * the field list is drawn from — so adding a derived field to the vocabulary
165
- * without a producer here is a compile error rather than a field that silently
166
- * finalizes as `undefined` and then fails validation on every module.
167
- */
168
- const DERIVED_MODULE_CONTRACT_VALUES = {
169
- seam_adjustments: (moduleName, seamReconciliationReport) => seamAdjustmentsForModule(moduleName, seamReconciliationReport),
170
- };
171
- export function deriveFinalizedModuleContracts(draftedModuleContracts, seamReconciliationReport, options = {}) {
172
- // Validated on the way IN, never read verbatim. `goal_id` is the identity
173
- // joining every contract-pipeline artifact and the key the consistency gate
174
- // compares, and the LLM is its only producer — so the previous
175
- // `typeof === "string"` read admitted `""`, an unsubstituted
176
- // `<stable-identifier>` placeholder, and a free-text sentence alike, and the
177
- // join silently degraded to "no identity" instead of failing. The grammar
178
- // lives in the id registry beside the other mints; see `GOAL_ID_PATTERN`.
179
- const goalId = isRecord(draftedModuleContracts)
180
- ? coerceGoalId(draftedModuleContracts.goal_id)
181
- : "";
182
- const drafts = isRecord(draftedModuleContracts) && Array.isArray(draftedModuleContracts.module_contracts)
183
- ? draftedModuleContracts.module_contracts
184
- : [];
185
- const module_contracts = drafts.map((mod) => {
186
- if (!isRecord(mod) || typeof mod.name !== "string")
187
- return mod;
188
- // COPIED first, DERIVED second, both drawn from the ONE field vocabulary
189
- // (`finalizedContractFields.ts`). The literal this replaced was the third
190
- // hand-written copy of the shape; a field added here and missed in the
191
- // reader narrowed every downstream silently.
192
- const finalized = Object.fromEntries(COPIED_MODULE_CONTRACT_FIELDS.map((field) => [field, mod[field]]));
193
- for (const field of DERIVED_MODULE_CONTRACT_FIELDS) {
194
- finalized[field] = DERIVED_MODULE_CONTRACT_VALUES[field](mod.name, seamReconciliationReport);
195
- }
196
- return finalized;
197
- });
198
- return {
199
- contract_version: CP_FINALIZED_MODULE_CONTRACTS_VERSION,
200
- goal_id: goalId,
201
- module_contracts,
202
- created_at: options.created_at ?? new Date().toISOString(),
203
- };
204
- }
205
- // ── Scaffolds (S3): skeletons for the partially-derivable artifacts ────────────
206
- //
207
- // The test plan and implementation DAG have an irreducible judgment slot
208
- // (assertion text; node title/description/commands) so they cannot be derived
209
- // in full. Instead the tool derives their SKELETON — structure, ids, and
210
- // cross-references populated, only the judgment fields blank — and shows it to
211
- // the model so it fills just those slots and cannot drop, misname, or
212
- // mis-reference an obligation. These are NOT writable artifacts: the blank
213
- // fields fail validation by design (that is the point — the model must fill
214
- // them). They are rendered into the dispatch prompt as a pre-filled skeleton.
215
- /**
216
- * Shared obligation-membership predicates — the single source for which
217
- * obligations each downstream scaffold covers.
218
- *
219
- * `isTestablePhaseObligation` (imported above) is now single-sourced in
220
- * `../validation/contractPipelineGates.ts` (MNT-e10b9d9b: this file's former
221
- * local TESTABLE_KINDS set and that file's TESTABLE_OBLIGATION_KINDS were
222
- * "kept in parity by hand" and had already diverged — fail-open here,
223
- * fail-closed there, on an identical unrecognized-kind input). Re-exported
224
- * here so every existing importer of derive.js keeps working unchanged.
225
- *
226
- * `isDagPhaseObligation`: every obligation is covered by the implementation DAG,
227
- * so this is always true. It exists so both scaffolds derive their membership
228
- * from a named predicate rather than an inline ad-hoc filter.
229
- */
230
- export { isTestablePhaseObligation };
231
- export function isDagPhaseObligation(_kind) {
232
- return true;
233
- }
234
- /** A short, stable test name from an obligation description. */
235
- function scaffoldName(obligation) {
236
- const text = obligation.description.replace(/\s+/g, " ").trim();
237
- if (!text)
238
- return obligation.id;
239
- return text.length > 64 ? `${text.slice(0, 61)}...` : text;
240
- }
241
- function sameStringSet(a, b) {
242
- if (a.length !== b.length)
243
- return false;
244
- const setB = new Set(b);
245
- return a.every((x) => setB.has(x));
246
- }
247
- /**
248
- * Build the test-plan skeleton: one spec per *testable* (invariant/behavioral)
249
- * obligation, with `obligation_id`/`name`/`kind`/`scope_anchors` filled and
250
- * `assertions` left blank for the model. The model fills only the assertions
251
- * (each spec needs a paired positive + negative assertion per the OBL-CO-01
252
- * gate, and the negative must name one of `scope_anchors` per CE-006).
253
- *
254
- * C3 diff-carry: when `priorByObligation` carries a prior round's authored spec
255
- * for an obligation whose premise is UNCHANGED (same `name` + same
256
- * `scope_anchors`), its assertions are pre-filled instead of left blank, so an
257
- * unchanged obligation is not re-authored from scratch every repair round. A
258
- * changed premise (renamed/re-scoped obligation) carries nothing — the host
259
- * re-authors it (fail-safe toward re-author, never toward stale carry).
260
- */
261
- export function buildTestValidatorPlanScaffold(ledger, priorByObligation = {}) {
262
- const obligations = ledger?.obligations ?? [];
263
- return {
264
- test_specs: obligations
265
- .filter((o) => isTestablePhaseObligation(o.kind))
266
- .map((o) => {
267
- const name = scaffoldName(o);
268
- const scope_anchors = obligationScopeAnchors(o.id, o.description, readObligationChangeClassification(o));
269
- const prior = priorByObligation[o.id];
270
- const carried = prior &&
271
- prior.name === name &&
272
- sameStringSet(prior.scope_anchors, scope_anchors) &&
273
- prior.assertions.length > 0
274
- ? [...prior.assertions]
275
- : [];
276
- return {
277
- obligation_id: o.id,
278
- name,
279
- kind: o.kind === "invariant" ? "invariant" : "unit",
280
- scope_anchors,
281
- assertions: carried,
282
- };
283
- }),
284
- };
285
- }
286
- /**
287
- * Advisory-severity items from a conceptual_design_critique payload (defensive
288
- * read). Blocking items drive the design-repair loop and are consumed there;
289
- * advisory items survive past the critique gate and need a structural home in
290
- * the implementation DAG — this surfaces them so the skeleton can list them (B3).
291
- */
292
- export function advisoryCritiqueItems(critique) {
293
- const items = isRecord(critique) && Array.isArray(critique.items) ? critique.items : [];
294
- return items
295
- .filter((item) => isRecord(item))
296
- .filter((item) => item.severity === "advisory")
297
- .map((item) => ({
298
- id: typeof item.id === "string" ? item.id : "",
299
- description: typeof item.description === "string" ? item.description : "",
300
- }))
301
- .filter((item) => item.id.length > 0);
302
- }
303
- /** Accepted counterexample ids from a judge_report payload (defensive read). */
304
- export function acceptedCounterexampleIds(judgeReport) {
305
- const record = isRecord(judgeReport) ? judgeReport : {};
306
- const classifications = Array.isArray(record.classifications)
307
- ? record.classifications
308
- : [];
309
- const ids = [];
310
- for (const cls of classifications) {
311
- if (isRecord(cls) &&
312
- cls.classification === "accepted" &&
313
- typeof cls.counterexample_id === "string") {
314
- ids.push(cls.counterexample_id);
315
- }
316
- }
317
- return ids;
318
- }
319
- /**
320
- * Build the implementation-DAG skeleton: ONE node per finalized *module*
321
- * (grouping all that module's obligations), blank title/description/
322
- * targeted_commands for the model, and accepted counterexamples attached so
323
- * coverage holds by construction. Grouping by module means a 1-module change
324
- * derives 1 node instead of N obligation-nodes the host then has to merge (B2);
325
- * obligations with no module home (counterexample/critique-sourced) fall back
326
- * to one node each. Advisory: the model fills the blanks and may further
327
- * merge/split nodes as long as coverage is preserved.
328
- *
329
- * `depends_on` is DERIVED, not left for the host: when `finalizedContracts` is
330
- * supplied, each module node depends on the nodes of the modules it needs first
331
- * (producer/consumer `artifact:<name>` matching over `inputs`/`outputs` — the
332
- * same module-dependency DAG `phase_cut` uses). This
333
- * makes cross-node ordering tool-enforced instead of a thing the host must
334
- * remember to hand-add. Edges are oriented by phase ordinal so the result is
335
- * acyclic by construction: only an edge to a strictly-earlier-phase module is
336
- * kept, which drops the back-edge of any dependency cycle (fail-toward-later,
337
- * mirroring `derivePhaseCut`). The `edges` array stays empty — node `depends_on`
338
- * is the ordering the block promotion reads.
339
- */
340
- export function buildImplementationDagScaffold(ledger, acceptedCeIds, finalizedContracts) {
341
- const obligations = (ledger?.obligations ?? []).filter((o) => isDagPhaseObligation(o.kind));
342
- // Group by module in first-appearance order; obligations with no module key
343
- // on their own id (one node each, preserving coverage).
344
- const groups = [];
345
- const groupIndex = new Map();
346
- for (const o of obligations) {
347
- const key = o.module ? `module:${o.module}` : `obligation:${o.id}`;
348
- let idx = groupIndex.get(key);
349
- if (idx === undefined) {
350
- idx = groups.length;
351
- groupIndex.set(key, idx);
352
- groups.push({ key, obligations: [] });
353
- }
354
- groups[idx].obligations.push(o);
355
- }
356
- const nodes = groups.map((g, i) => {
357
- const ids = g.obligations.map((o) => o.id);
358
- return {
359
- id: `CP-NODE-${i + 1}`,
360
- title: "",
361
- description: "",
362
- satisfies_obligations: [...ids],
363
- addresses_counterexamples: [],
364
- addressed_critique_items: [],
365
- depends_on: [],
366
- verification_obligation_ids: [...ids],
367
- targeted_commands: [],
368
- status: "pending",
369
- };
370
- });
371
- applyModuleDependencyEdges(nodes, groups, finalizedContracts);
372
- if (acceptedCeIds.length > 0) {
373
- if (nodes.length === 0) {
374
- nodes.push({
375
- id: "CP-NODE-1",
376
- title: "",
377
- description: "",
378
- satisfies_obligations: [],
379
- addresses_counterexamples: [...acceptedCeIds],
380
- addressed_critique_items: [],
381
- depends_on: [],
382
- verification_obligation_ids: [],
383
- targeted_commands: [],
384
- status: "pending",
385
- });
386
- }
387
- else {
388
- nodes[0].addresses_counterexamples = [...acceptedCeIds];
389
- }
390
- }
391
- return { nodes, edges: [] };
392
- }
393
- /**
394
- * Fill each module node's `depends_on` from the finalized contracts'
395
- * module-dependency DAG (producer/consumer artifact tokens alone), the
396
- * SAME source `phase_cut` uses so the node ordering and the phase barrier agree.
397
- * Only a group keyed on a real module can be a dependency target (obligation- and
398
- * counterexample-only nodes have no module home). Edges are oriented by phase
399
- * ordinal — kept only when the dependency module sits in a strictly-earlier phase
400
- * — so a dependency cycle contributes no back-edge and the result is acyclic by
401
- * construction. No-op when contracts are absent (existing behaviour: no edges).
402
- */
403
- function applyModuleDependencyEdges(nodes, groups, finalizedContracts) {
404
- if (finalizedContracts === undefined || finalizedContracts === null)
405
- return;
406
- // module name → node id (1 node per module by construction).
407
- const moduleToNodeId = new Map();
408
- groups.forEach((g, i) => {
409
- if (g.key.startsWith("module:")) {
410
- moduleToNodeId.set(g.key.slice("module:".length), nodes[i].id);
411
- }
412
- });
413
- if (moduleToNodeId.size === 0)
414
- return;
415
- const phaseModules = phaseCutModulesFromContracts(finalizedContracts);
416
- const depsByModule = new Map(phaseModules.map((m) => [m.name, m.depends_on]));
417
- const phaseOf = derivePhaseCut(phaseModules).module_phase;
418
- const nodeById = new Map(nodes.map((n) => [n.id, n]));
419
- for (const [moduleName, nodeId] of moduleToNodeId) {
420
- const node = nodeById.get(nodeId);
421
- if (!node)
422
- continue;
423
- const deps = new Set();
424
- for (const depModule of depsByModule.get(moduleName) ?? []) {
425
- const depNodeId = moduleToNodeId.get(depModule);
426
- if (!depNodeId || depNodeId === nodeId)
427
- continue;
428
- if ((phaseOf[depModule] ?? 0) < (phaseOf[moduleName] ?? 0))
429
- deps.add(depNodeId);
430
- }
431
- node.depends_on = [...deps].sort();
432
- }
433
- }
434
- // ── Helpers ───────────────────────────────────────────────────────────────────
435
- function fmtList(items) {
436
- return items.length > 0 ? items.join(", ") : "none";
437
- }
438
- function strArray(value) {
439
- return Array.isArray(value)
440
- ? value.filter((v) => typeof v === "string")
441
- : [];
442
- }
443
- /**
444
- * The defensive coercion per COPIED field, keyed by the SAME union the field
445
- * list is drawn from — a field added to the vocabulary without a coercion here
446
- * is a compile error, not a field silently read as `undefined` at runtime.
447
- * `name` is the only non-array string; every other copied field is an array of
448
- * strings, with `validation_boundary` the one scalar outside `name`.
449
- */
450
- const COPIED_MODULE_CONTRACT_COERCIONS = {
451
- name: (raw) => (typeof raw.name === "string" ? raw.name : "module"),
452
- inputs: (raw) => strArray(raw.inputs),
453
- outputs: (raw) => strArray(raw.outputs),
454
- invariants: (raw) => strArray(raw.invariants),
455
- side_effects: (raw) => strArray(raw.side_effects),
456
- validation_boundary: (raw) => typeof raw.validation_boundary === "string" ? raw.validation_boundary : "",
457
- failure_modes: (raw) => strArray(raw.failure_modes),
458
- };
459
- /** Defensive read of the validated finalized-module-contracts payload. */
460
- function readFinalizedContracts(payload) {
461
- const record = isRecord(payload) ? payload : {};
462
- // Same validation as the mint above: this reader is the OTHER half of the
463
- // same join, so a value that could not be minted must not be read back as one.
464
- const goalId = coerceGoalId(record.goal_id);
465
- const rawModules = Array.isArray(record.module_contracts)
466
- ? record.module_contracts
467
- : [];
468
- const module_contracts = rawModules.map((m) => {
469
- const raw = isRecord(m) ? m : {};
470
- return Object.fromEntries(COPIED_MODULE_CONTRACT_FIELDS.map((field) => [
471
- field,
472
- COPIED_MODULE_CONTRACT_COERCIONS[field](raw),
473
- ]));
474
- });
475
- return { goal_id: goalId, module_contracts };
476
- }
477
- //# sourceMappingURL=derive.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"derive.js","sourceRoot":"","sources":["../../../src/remediate/contractPipeline/derive.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EACL,qBAAqB,EACrB,QAAQ,EACR,YAAY,GAGb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,sBAAsB,EACtB,kCAAkC,GACnC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,cAAc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AC7C,CAAC,CACmC,CAAC;IAC1C,CAAC,CAAC,CAAC;IACH,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC;AAC/C,CAAC"}
@@ -1,50 +0,0 @@
1
- /**
2
- * Fields finalization COPIES VERBATIM from the drafted module contract, in
3
- * canonical order. This is the load-bearing interface: `deriveObligationLedger`
4
- * derives the obligation set and test-plan premises from it, and
5
- * `buildBaselineSymbolCorpus` (`changeClassification.ts`) builds the
6
- * change-vs-addition corpus from the declared surface — `inputs`, `outputs`,
7
- * `side_effects`, `validation_boundary` — so a side_effects-only edit is
8
- * exactly as load-bearing as an interface edit.
9
- */
10
- export declare const COPIED_MODULE_CONTRACT_FIELDS: readonly ["name", "inputs", "outputs", "invariants", "side_effects", "validation_boundary", "failure_modes"];
11
- /**
12
- * Fields finalization DERIVES from the seam reconciliation report rather than
13
- * copying. Excluded from the staleness projection: a re-agreed seam is not a
14
- * change to the interface any downstream consumes.
15
- */
16
- export declare const DERIVED_MODULE_CONTRACT_FIELDS: readonly ["seam_adjustments"];
17
- /**
18
- * Every field a finalized module contract carries — copied first, derived
19
- * second. The finalizer builds exactly this key set, and the reader reads
20
- * exactly this key set; they are two draws over one list rather than two
21
- * lists that happen to agree.
22
- */
23
- export declare const FINALIZED_MODULE_CONTRACT_FIELDS: readonly string[];
24
- /**
25
- * The fields the staleness projection narrows a module entry to — the COPIED
26
- * set alone (see this module's header for why `seam_adjustments` is excluded).
27
- * Exported under the name `semanticProjection.ts` already used, so the
28
- * projection reads the shared vocabulary instead of owning a third copy.
29
- */
30
- export declare const DERIVABLE_MODULE_CONTRACT_FIELDS: readonly string[];
31
- /**
32
- * The runtime shape of a finalized module entry as the deterministic derivers
33
- * read it — `name` is required and always a string; the array fields are read
34
- * through a defensive `string[]` coercion; `validation_boundary` is a string.
35
- * `seam_adjustments` is deliberately absent: no deriver reads it.
36
- *
37
- * The field NAMES here are the compiler-checked twin of
38
- * {@link COPIED_MODULE_CONTRACT_FIELDS}; the `satisfies` clause below is what
39
- * keeps the two from drifting, which is the whole point of this module.
40
- */
41
- export interface DerivableModuleContract {
42
- name: string;
43
- inputs: string[];
44
- outputs: string[];
45
- invariants: string[];
46
- failure_modes: string[];
47
- side_effects: string[];
48
- validation_boundary: string;
49
- }
50
- //# sourceMappingURL=finalizedContractFields.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"finalizedContractFields.d.ts","sourceRoot":"","sources":["../../../src/remediate/contractPipeline/finalizedContractFields.ts"],"names":[],"mappings":"AA8BA;;;;;;;;GAQG;AACH,eAAO,MAAM,6BAA6B,8GAQhC,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,+BAAgC,CAAC;AAE5E;;;;;GAKG;AACH,eAAO,MAAM,gCAAgC,EAAE,SAAS,MAAM,EAGtC,CAAC;AAEzB;;;;;GAKG;AACH,eAAO,MAAM,gCAAgC,EAAE,SAAS,MAAM,EAE7D,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,mBAAmB,EAAE,MAAM,CAAC;CAC7B"}
@@ -1,77 +0,0 @@
1
- /**
2
- * The ONE field vocabulary of a module contract, at both layers.
3
- *
4
- * A module contract's shape was spelled out by hand in THREE places: the
5
- * finalizer's object literal (`derive.ts`, `deriveFinalizedModuleContracts`),
6
- * the defensive reader's field-by-field narrowing (`derive.ts`,
7
- * `readFinalizedContracts`), and the staleness projection's narrowing
8
- * (`semanticProjection.ts`, `DERIVABLE_MODULE_CONTRACT_FIELDS`). They had
9
- * already drifted — the finalizer wrote eight fields, the reader read seven,
10
- * and nothing made the difference (`seam_adjustments`, which finalization
11
- * DERIVES and no deterministic consumer reads) legible as intentional rather
12
- * than as a dropped field. A field added to the finalizer and forgotten in the
13
- * reader is a silent narrowing of everything downstream of the ledger.
14
- *
15
- * The vocabulary is therefore stated once, here, beside the finalizer that
16
- * writes it — with the two DISTINCTIONS the three copies were groping at made
17
- * explicit, because they are real:
18
- *
19
- * - {@link COPIED_MODULE_CONTRACT_FIELDS} are copied verbatim from the drafted
20
- * contract. They are the load-bearing interface, and they are what a
21
- * deterministic consumer may read.
22
- * - {@link DERIVED_MODULE_CONTRACT_FIELDS} are computed by finalization from
23
- * the seam reconciliation report. No deterministic consumer reads them, so
24
- * they are excluded from the staleness projection — a re-agreed seam
25
- * changes `seam_adjustments` without changing any obligation.
26
- *
27
- * Anything that must know a module contract's field set reads it from here.
28
- */
29
- import { compareCodeUnits } from "../../shared/compareCodeUnits.js";
30
- /**
31
- * Fields finalization COPIES VERBATIM from the drafted module contract, in
32
- * canonical order. This is the load-bearing interface: `deriveObligationLedger`
33
- * derives the obligation set and test-plan premises from it, and
34
- * `buildBaselineSymbolCorpus` (`changeClassification.ts`) builds the
35
- * change-vs-addition corpus from the declared surface — `inputs`, `outputs`,
36
- * `side_effects`, `validation_boundary` — so a side_effects-only edit is
37
- * exactly as load-bearing as an interface edit.
38
- */
39
- export const COPIED_MODULE_CONTRACT_FIELDS = [
40
- "name",
41
- "inputs",
42
- "outputs",
43
- "invariants",
44
- "side_effects",
45
- "validation_boundary",
46
- "failure_modes",
47
- ];
48
- /**
49
- * Fields finalization DERIVES from the seam reconciliation report rather than
50
- * copying. Excluded from the staleness projection: a re-agreed seam is not a
51
- * change to the interface any downstream consumes.
52
- */
53
- export const DERIVED_MODULE_CONTRACT_FIELDS = ["seam_adjustments"];
54
- /**
55
- * Every field a finalized module contract carries — copied first, derived
56
- * second. The finalizer builds exactly this key set, and the reader reads
57
- * exactly this key set; they are two draws over one list rather than two
58
- * lists that happen to agree.
59
- */
60
- export const FINALIZED_MODULE_CONTRACT_FIELDS = [
61
- ...COPIED_MODULE_CONTRACT_FIELDS,
62
- ...DERIVED_MODULE_CONTRACT_FIELDS,
63
- ].sort(compareCodeUnits);
64
- /**
65
- * The fields the staleness projection narrows a module entry to — the COPIED
66
- * set alone (see this module's header for why `seam_adjustments` is excluded).
67
- * Exported under the name `semanticProjection.ts` already used, so the
68
- * projection reads the shared vocabulary instead of owning a third copy.
69
- */
70
- export const DERIVABLE_MODULE_CONTRACT_FIELDS = [
71
- ...COPIED_MODULE_CONTRACT_FIELDS,
72
- ];
73
- const _everyListedFieldIsTyped = true;
74
- const _everyTypedFieldIsListed = true;
75
- void _everyListedFieldIsTyped;
76
- void _everyTypedFieldIsListed;
77
- //# sourceMappingURL=finalizedContractFields.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"finalizedContractFields.js","sourceRoot":"","sources":["../../../src/remediate/contractPipeline/finalizedContractFields.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,MAAM;IACN,QAAQ;IACR,SAAS;IACT,YAAY;IACZ,cAAc;IACd,qBAAqB;IACrB,eAAe;CACP,CAAC;AAEX;;;;GAIG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,kBAAkB,CAAU,CAAC;AAE5E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAsB;IACjE,GAAG,6BAA6B;IAChC,GAAG,8BAA8B;CAClC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;AAEzB;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAsB;IACjE,GAAG,6BAA6B;CACjC,CAAC;AAoCF,MAAM,wBAAwB,GAAmD,IAAI,CAAC;AACtF,MAAM,wBAAwB,GAAmD,IAAI,CAAC;AACtF,KAAK,wBAAwB,CAAC;AAC9B,KAAK,wBAAwB,CAAC"}