audit-tools 0.51.7 → 0.51.9

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 (665) hide show
  1. package/dist/audit/clarification/blastRadius.d.ts +17 -16
  2. package/dist/audit/clarification/blastRadius.d.ts.map +1 -1
  3. package/dist/audit/clarification/blastRadius.js +48 -44
  4. package/dist/audit/clarification/blastRadius.js.map +1 -1
  5. package/dist/audit/clarification/dials.d.ts +4 -4
  6. package/dist/audit/clarification/dials.d.ts.map +1 -1
  7. package/dist/audit/clarification/dials.js +1 -0
  8. package/dist/audit/clarification/dials.js.map +1 -1
  9. package/dist/audit/clarification/partition.d.ts +12 -21
  10. package/dist/audit/clarification/partition.d.ts.map +1 -1
  11. package/dist/audit/clarification/partition.js +52 -59
  12. package/dist/audit/clarification/partition.js.map +1 -1
  13. package/dist/audit/clarification/riskGate.d.ts +2 -2
  14. package/dist/audit/clarification/riskGate.d.ts.map +1 -1
  15. package/dist/audit/clarification/riskGate.js +1 -0
  16. package/dist/audit/clarification/riskGate.js.map +1 -1
  17. package/dist/audit/clarification/voiQueue.d.ts +3 -3
  18. package/dist/audit/clarification/voiQueue.d.ts.map +1 -1
  19. package/dist/audit/clarification/voiQueue.js +1 -0
  20. package/dist/audit/clarification/voiQueue.js.map +1 -1
  21. package/dist/audit/cli/auditStep.d.ts +14 -2
  22. package/dist/audit/cli/auditStep.d.ts.map +1 -1
  23. package/dist/audit/cli/auditStep.js +13 -5
  24. package/dist/audit/cli/auditStep.js.map +1 -1
  25. package/dist/audit/cli/charterClarificationPrompt.d.ts +6 -9
  26. package/dist/audit/cli/charterClarificationPrompt.d.ts.map +1 -1
  27. package/dist/audit/cli/charterClarificationPrompt.js +35 -47
  28. package/dist/audit/cli/charterClarificationPrompt.js.map +1 -1
  29. package/dist/audit/cli/charterComparisonPrompt.d.ts +14 -0
  30. package/dist/audit/cli/charterComparisonPrompt.d.ts.map +1 -0
  31. package/dist/audit/cli/charterComparisonPrompt.js +111 -0
  32. package/dist/audit/cli/charterComparisonPrompt.js.map +1 -0
  33. package/dist/audit/cli/charterExtractionPrompt.d.ts +14 -17
  34. package/dist/audit/cli/charterExtractionPrompt.d.ts.map +1 -1
  35. package/dist/audit/cli/charterExtractionPrompt.js +81 -104
  36. package/dist/audit/cli/charterExtractionPrompt.js.map +1 -1
  37. package/dist/audit/cli/charterFidelityPrompt.d.ts +14 -0
  38. package/dist/audit/cli/charterFidelityPrompt.d.ts.map +1 -0
  39. package/dist/audit/cli/charterFidelityPrompt.js +58 -0
  40. package/dist/audit/cli/charterFidelityPrompt.js.map +1 -0
  41. package/dist/audit/cli/conceptualDispatch.d.ts +39 -6
  42. package/dist/audit/cli/conceptualDispatch.d.ts.map +1 -1
  43. package/dist/audit/cli/conceptualDispatch.js +59 -12
  44. package/dist/audit/cli/conceptualDispatch.js.map +1 -1
  45. package/dist/audit/cli/confirmIntentStep.d.ts.map +1 -1
  46. package/dist/audit/cli/confirmIntentStep.js +46 -2
  47. package/dist/audit/cli/confirmIntentStep.js.map +1 -1
  48. package/dist/audit/cli/dispatch/hostHandoff.d.ts +18 -6
  49. package/dist/audit/cli/dispatch/hostHandoff.d.ts.map +1 -1
  50. package/dist/audit/cli/dispatch/hostHandoff.js +525 -67
  51. package/dist/audit/cli/dispatch/hostHandoff.js.map +1 -1
  52. package/dist/audit/cli/fanoutLanes.d.ts +24 -0
  53. package/dist/audit/cli/fanoutLanes.d.ts.map +1 -1
  54. package/dist/audit/cli/fanoutLanes.js +9 -1
  55. package/dist/audit/cli/fanoutLanes.js.map +1 -1
  56. package/dist/audit/cli/foldTransaction.d.ts.map +1 -1
  57. package/dist/audit/cli/foldTransaction.js +14 -3
  58. package/dist/audit/cli/foldTransaction.js.map +1 -1
  59. package/dist/audit/cli/forceSynthesisCommand.d.ts.map +1 -1
  60. package/dist/audit/cli/forceSynthesisCommand.js +4 -1
  61. package/dist/audit/cli/forceSynthesisCommand.js.map +1 -1
  62. package/dist/audit/cli/intakeCommand.d.ts.map +1 -1
  63. package/dist/audit/cli/intakeCommand.js +1 -0
  64. package/dist/audit/cli/intakeCommand.js.map +1 -1
  65. package/dist/audit/cli/laneSubmissions.d.ts +18 -12
  66. package/dist/audit/cli/laneSubmissions.d.ts.map +1 -1
  67. package/dist/audit/cli/laneSubmissions.js +40 -4
  68. package/dist/audit/cli/laneSubmissions.js.map +1 -1
  69. package/dist/audit/cli/laneValidators.d.ts.map +1 -1
  70. package/dist/audit/cli/laneValidators.js +14 -14
  71. package/dist/audit/cli/laneValidators.js.map +1 -1
  72. package/dist/audit/cli/nextStepCommand.d.ts +7 -0
  73. package/dist/audit/cli/nextStepCommand.d.ts.map +1 -1
  74. package/dist/audit/cli/nextStepCommand.js +206 -31
  75. package/dist/audit/cli/nextStepCommand.js.map +1 -1
  76. package/dist/audit/cli/nextStepHelpers.d.ts +92 -28
  77. package/dist/audit/cli/nextStepHelpers.d.ts.map +1 -1
  78. package/dist/audit/cli/nextStepHelpers.js +363 -126
  79. package/dist/audit/cli/nextStepHelpers.js.map +1 -1
  80. package/dist/audit/cli/prompts.d.ts +10 -0
  81. package/dist/audit/cli/prompts.d.ts.map +1 -1
  82. package/dist/audit/cli/prompts.js +3 -1
  83. package/dist/audit/cli/prompts.js.map +1 -1
  84. package/dist/audit/cli/reviewRun.d.ts +12 -0
  85. package/dist/audit/cli/reviewRun.d.ts.map +1 -1
  86. package/dist/audit/cli/reviewRun.js +242 -29
  87. package/dist/audit/cli/reviewRun.js.map +1 -1
  88. package/dist/audit/cli/sampleRunCommand.d.ts +12 -4
  89. package/dist/audit/cli/sampleRunCommand.d.ts.map +1 -1
  90. package/dist/audit/cli/semanticReviewStep.d.ts +9 -0
  91. package/dist/audit/cli/semanticReviewStep.d.ts.map +1 -1
  92. package/dist/audit/cli/semanticReviewStep.js +71 -30
  93. package/dist/audit/cli/semanticReviewStep.js.map +1 -1
  94. package/dist/audit/cli/statusCommand.d.ts.map +1 -1
  95. package/dist/audit/cli/statusCommand.js +29 -66
  96. package/dist/audit/cli/statusCommand.js.map +1 -1
  97. package/dist/audit/cli/stepScaffold.d.ts +43 -2
  98. package/dist/audit/cli/stepScaffold.d.ts.map +1 -1
  99. package/dist/audit/cli/stepScaffold.js +24 -10
  100. package/dist/audit/cli/stepScaffold.js.map +1 -1
  101. package/dist/audit/cli/steps.d.ts +52 -29
  102. package/dist/audit/cli/steps.d.ts.map +1 -1
  103. package/dist/audit/cli/steps.js +44 -14
  104. package/dist/audit/cli/steps.js.map +1 -1
  105. package/dist/audit/cli/synthesizeCommand.d.ts.map +1 -1
  106. package/dist/audit/cli/synthesizeCommand.js +4 -1
  107. package/dist/audit/cli/synthesizeCommand.js.map +1 -1
  108. package/dist/audit/contracts/workerSchemas.d.ts +65 -16
  109. package/dist/audit/contracts/workerSchemas.d.ts.map +1 -1
  110. package/dist/audit/contracts/workerSchemas.js +89 -8
  111. package/dist/audit/contracts/workerSchemas.js.map +1 -1
  112. package/dist/audit/contracts/wrapperResponse.d.ts +14 -21
  113. package/dist/audit/contracts/wrapperResponse.d.ts.map +1 -1
  114. package/dist/audit/contracts/wrapperResponse.js +0 -1
  115. package/dist/audit/contracts/wrapperResponse.js.map +1 -1
  116. package/dist/audit/decompose/findings.d.ts.map +1 -1
  117. package/dist/audit/decompose/findings.js +10 -2
  118. package/dist/audit/decompose/findings.js.map +1 -1
  119. package/dist/audit/extractors/designAssessment.d.ts.map +1 -1
  120. package/dist/audit/extractors/designAssessment.js +13 -4
  121. package/dist/audit/extractors/designAssessment.js.map +1 -1
  122. package/dist/audit/extractors/disposition.d.ts.map +1 -1
  123. package/dist/audit/extractors/disposition.js +17 -5
  124. package/dist/audit/extractors/disposition.js.map +1 -1
  125. package/dist/audit/extractors/graph.d.ts +1 -1
  126. package/dist/audit/extractors/graph.js +1 -1
  127. package/dist/audit/extractors/graphRoutes.d.ts.map +1 -1
  128. package/dist/audit/extractors/graphRoutes.js +224 -17
  129. package/dist/audit/extractors/graphRoutes.js.map +1 -1
  130. package/dist/audit/extractors/leadLineage.d.ts +10 -0
  131. package/dist/audit/extractors/leadLineage.d.ts.map +1 -0
  132. package/dist/audit/extractors/leadLineage.js +44 -0
  133. package/dist/audit/extractors/leadLineage.js.map +1 -0
  134. package/dist/audit/io/artifacts.d.ts.map +1 -1
  135. package/dist/audit/io/artifacts.js +25 -8
  136. package/dist/audit/io/artifacts.js.map +1 -1
  137. package/dist/audit/io/runArtifacts.d.ts +76 -1
  138. package/dist/audit/io/runArtifacts.d.ts.map +1 -1
  139. package/dist/audit/io/runArtifacts.js +113 -20
  140. package/dist/audit/io/runArtifacts.js.map +1 -1
  141. package/dist/audit/io/toolingManifest.d.ts +15 -0
  142. package/dist/audit/io/toolingManifest.d.ts.map +1 -1
  143. package/dist/audit/io/toolingManifest.js +158 -11
  144. package/dist/audit/io/toolingManifest.js.map +1 -1
  145. package/dist/audit/orchestrator/advance.d.ts.map +1 -1
  146. package/dist/audit/orchestrator/advance.js +30 -4
  147. package/dist/audit/orchestrator/advance.js.map +1 -1
  148. package/dist/audit/orchestrator/advanceTypes.d.ts +28 -5
  149. package/dist/audit/orchestrator/advanceTypes.d.ts.map +1 -1
  150. package/dist/audit/orchestrator/artifactMetadata.d.ts.map +1 -1
  151. package/dist/audit/orchestrator/artifactMetadata.js +39 -1
  152. package/dist/audit/orchestrator/artifactMetadata.js.map +1 -1
  153. package/dist/audit/orchestrator/auditTaskUtils.d.ts.map +1 -1
  154. package/dist/audit/orchestrator/auditTaskUtils.js +4 -1
  155. package/dist/audit/orchestrator/auditTaskUtils.js.map +1 -1
  156. package/dist/audit/orchestrator/charterClarificationExecutor.d.ts +11 -17
  157. package/dist/audit/orchestrator/charterClarificationExecutor.d.ts.map +1 -1
  158. package/dist/audit/orchestrator/charterClarificationExecutor.js +61 -93
  159. package/dist/audit/orchestrator/charterClarificationExecutor.js.map +1 -1
  160. package/dist/audit/orchestrator/charterComparisonExecutor.d.ts +24 -0
  161. package/dist/audit/orchestrator/charterComparisonExecutor.d.ts.map +1 -0
  162. package/dist/audit/orchestrator/charterComparisonExecutor.js +110 -0
  163. package/dist/audit/orchestrator/charterComparisonExecutor.js.map +1 -0
  164. package/dist/audit/orchestrator/charterExtractionExecutor.d.ts +34 -20
  165. package/dist/audit/orchestrator/charterExtractionExecutor.d.ts.map +1 -1
  166. package/dist/audit/orchestrator/charterExtractionExecutor.js +80 -106
  167. package/dist/audit/orchestrator/charterExtractionExecutor.js.map +1 -1
  168. package/dist/audit/orchestrator/charterFidelityExecutor.d.ts +20 -0
  169. package/dist/audit/orchestrator/charterFidelityExecutor.d.ts.map +1 -0
  170. package/dist/audit/orchestrator/charterFidelityExecutor.js +76 -0
  171. package/dist/audit/orchestrator/charterFidelityExecutor.js.map +1 -0
  172. package/dist/audit/orchestrator/charterFidelityPacket.d.ts +7 -0
  173. package/dist/audit/orchestrator/charterFidelityPacket.d.ts.map +1 -0
  174. package/dist/audit/orchestrator/charterFidelityPacket.js +68 -0
  175. package/dist/audit/orchestrator/charterFidelityPacket.js.map +1 -0
  176. package/dist/audit/orchestrator/dependencyMap.d.ts.map +1 -1
  177. package/dist/audit/orchestrator/dependencyMap.js +9 -8
  178. package/dist/audit/orchestrator/dependencyMap.js.map +1 -1
  179. package/dist/audit/orchestrator/dependencySlices.d.ts.map +1 -1
  180. package/dist/audit/orchestrator/dependencySlices.js +7 -6
  181. package/dist/audit/orchestrator/dependencySlices.js.map +1 -1
  182. package/dist/audit/orchestrator/designReviewProjection.d.ts.map +1 -1
  183. package/dist/audit/orchestrator/designReviewProjection.js +7 -0
  184. package/dist/audit/orchestrator/designReviewProjection.js.map +1 -1
  185. package/dist/audit/orchestrator/designReviewPrompt.d.ts.map +1 -1
  186. package/dist/audit/orchestrator/designReviewPrompt.js +58 -19
  187. package/dist/audit/orchestrator/designReviewPrompt.js.map +1 -1
  188. package/dist/audit/orchestrator/executorRunners.d.ts.map +1 -1
  189. package/dist/audit/orchestrator/executorRunners.js +6 -2
  190. package/dist/audit/orchestrator/executorRunners.js.map +1 -1
  191. package/dist/audit/orchestrator/executors.d.ts.map +1 -1
  192. package/dist/audit/orchestrator/executors.js +22 -8
  193. package/dist/audit/orchestrator/executors.js.map +1 -1
  194. package/dist/audit/orchestrator/hostInputPause.js +1 -0
  195. package/dist/audit/orchestrator/hostInputPause.js.map +1 -1
  196. package/dist/audit/orchestrator/intentCheckpointExecutor.d.ts +40 -0
  197. package/dist/audit/orchestrator/intentCheckpointExecutor.d.ts.map +1 -1
  198. package/dist/audit/orchestrator/intentCheckpointExecutor.js +32 -2
  199. package/dist/audit/orchestrator/intentCheckpointExecutor.js.map +1 -1
  200. package/dist/audit/orchestrator/intentCheckpointGate.d.ts +5 -3
  201. package/dist/audit/orchestrator/intentCheckpointGate.d.ts.map +1 -1
  202. package/dist/audit/orchestrator/intentCheckpointGate.js +34 -5
  203. package/dist/audit/orchestrator/intentCheckpointGate.js.map +1 -1
  204. package/dist/audit/orchestrator/intentEquivalenceExecutor.d.ts +2 -2
  205. package/dist/audit/orchestrator/intentInterpreter.d.ts +1 -1
  206. package/dist/audit/orchestrator/intentInterpreter.js +1 -1
  207. package/dist/audit/orchestrator/nextStep.d.ts.map +1 -1
  208. package/dist/audit/orchestrator/nextStep.js +3 -1
  209. package/dist/audit/orchestrator/nextStep.js.map +1 -1
  210. package/dist/audit/orchestrator/obligationPolicy.d.ts +2 -1
  211. package/dist/audit/orchestrator/obligationPolicy.d.ts.map +1 -1
  212. package/dist/audit/orchestrator/obligationPolicy.js +19 -7
  213. package/dist/audit/orchestrator/obligationPolicy.js.map +1 -1
  214. package/dist/audit/orchestrator/partitionTaskGraph.d.ts.map +1 -1
  215. package/dist/audit/orchestrator/partitionTaskGraph.js +1 -0
  216. package/dist/audit/orchestrator/partitionTaskGraph.js.map +1 -1
  217. package/dist/audit/orchestrator/resultIngestion.d.ts.map +1 -1
  218. package/dist/audit/orchestrator/resultIngestion.js +3 -1
  219. package/dist/audit/orchestrator/resultIngestion.js.map +1 -1
  220. package/dist/audit/orchestrator/runtimeCommand.d.ts +72 -0
  221. package/dist/audit/orchestrator/runtimeCommand.d.ts.map +1 -1
  222. package/dist/audit/orchestrator/runtimeCommand.js +177 -20
  223. package/dist/audit/orchestrator/runtimeCommand.js.map +1 -1
  224. package/dist/audit/orchestrator/scopeIndexBaseline.d.ts +56 -0
  225. package/dist/audit/orchestrator/scopeIndexBaseline.d.ts.map +1 -0
  226. package/dist/audit/orchestrator/scopeIndexBaseline.js +114 -0
  227. package/dist/audit/orchestrator/scopeIndexBaseline.js.map +1 -0
  228. package/dist/audit/orchestrator/staleness.d.ts +70 -1
  229. package/dist/audit/orchestrator/staleness.d.ts.map +1 -1
  230. package/dist/audit/orchestrator/staleness.js +171 -21
  231. package/dist/audit/orchestrator/staleness.js.map +1 -1
  232. package/dist/audit/orchestrator/state.d.ts.map +1 -1
  233. package/dist/audit/orchestrator/state.js +49 -25
  234. package/dist/audit/orchestrator/state.js.map +1 -1
  235. package/dist/audit/orchestrator/structureExecutors.d.ts.map +1 -1
  236. package/dist/audit/orchestrator/structureExecutors.js +7 -5
  237. package/dist/audit/orchestrator/structureExecutors.js.map +1 -1
  238. package/dist/audit/orchestrator/syntaxResolutionExecutor.d.ts.map +1 -1
  239. package/dist/audit/orchestrator/syntaxResolutionExecutor.js +1 -0
  240. package/dist/audit/orchestrator/syntaxResolutionExecutor.js.map +1 -1
  241. package/dist/audit/orchestrator/systemicChallengeExecutor.d.ts +13 -2
  242. package/dist/audit/orchestrator/systemicChallengeExecutor.d.ts.map +1 -1
  243. package/dist/audit/orchestrator/systemicChallengeExecutor.js +166 -12
  244. package/dist/audit/orchestrator/systemicChallengeExecutor.js.map +1 -1
  245. package/dist/audit/reporting/mergeFindings.d.ts.map +1 -1
  246. package/dist/audit/reporting/mergeFindings.js +6 -5
  247. package/dist/audit/reporting/mergeFindings.js.map +1 -1
  248. package/dist/audit/reporting/synthesis.d.ts +117 -0
  249. package/dist/audit/reporting/synthesis.d.ts.map +1 -1
  250. package/dist/audit/reporting/synthesis.js +277 -10
  251. package/dist/audit/reporting/synthesis.js.map +1 -1
  252. package/dist/audit/supervisor/operatorHandoff.d.ts +0 -2
  253. package/dist/audit/supervisor/operatorHandoff.d.ts.map +1 -1
  254. package/dist/audit/supervisor/operatorHandoff.js +0 -3
  255. package/dist/audit/supervisor/operatorHandoff.js.map +1 -1
  256. package/dist/audit/systemic/coveredThemes.d.ts +28 -0
  257. package/dist/audit/systemic/coveredThemes.d.ts.map +1 -0
  258. package/dist/audit/systemic/coveredThemes.js +52 -0
  259. package/dist/audit/systemic/coveredThemes.js.map +1 -0
  260. package/dist/audit/systemic/reviewFileMap.d.ts +81 -0
  261. package/dist/audit/systemic/reviewFileMap.d.ts.map +1 -0
  262. package/dist/audit/systemic/reviewFileMap.js +169 -0
  263. package/dist/audit/systemic/reviewFileMap.js.map +1 -0
  264. package/dist/audit/systemic/secondOrderAdversaryPrompt.d.ts.map +1 -1
  265. package/dist/audit/systemic/secondOrderAdversaryPrompt.js +149 -26
  266. package/dist/audit/systemic/secondOrderAdversaryPrompt.js.map +1 -1
  267. package/dist/audit/systemic/systemicChallengeLoop.d.ts +44 -4
  268. package/dist/audit/systemic/systemicChallengeLoop.d.ts.map +1 -1
  269. package/dist/audit/systemic/systemicChallengeLoop.js +114 -10
  270. package/dist/audit/systemic/systemicChallengeLoop.js.map +1 -1
  271. package/dist/audit/types/auditState.d.ts +6 -6
  272. package/dist/audit/types/charterClarification.d.ts +9 -4
  273. package/dist/audit/types/charterClarification.d.ts.map +1 -1
  274. package/dist/audit/types/charterRegister.d.ts +48 -93
  275. package/dist/audit/types/charterRegister.d.ts.map +1 -1
  276. package/dist/audit/types/charterRegister.js +15 -26
  277. package/dist/audit/types/charterRegister.js.map +1 -1
  278. package/dist/audit/types/conceptualAdjudication.d.ts +88 -18
  279. package/dist/audit/types/conceptualAdjudication.d.ts.map +1 -1
  280. package/dist/audit/types/conceptualAdjudication.js +77 -16
  281. package/dist/audit/types/conceptualAdjudication.js.map +1 -1
  282. package/dist/audit/types/designAssessment.d.ts +8 -6
  283. package/dist/audit/types/designAssessment.d.ts.map +1 -1
  284. package/dist/audit/types/reviewPlanning.d.ts +2 -2
  285. package/dist/audit/types/systemicChallenge.d.ts +43 -7
  286. package/dist/audit/types/systemicChallenge.d.ts.map +1 -1
  287. package/dist/audit/types.d.ts +71 -10
  288. package/dist/audit/types.d.ts.map +1 -1
  289. package/dist/audit/types.js +23 -2
  290. package/dist/audit/types.js.map +1 -1
  291. package/dist/audit/validation/auditResults.d.ts +30 -0
  292. package/dist/audit/validation/auditResults.d.ts.map +1 -1
  293. package/dist/audit/validation/auditResults.js +50 -8
  294. package/dist/audit/validation/auditResults.js.map +1 -1
  295. package/dist/audit/validation/ingestIssueCodes.d.ts +1 -1
  296. package/dist/audit/validation/ingestIssueCodes.d.ts.map +1 -1
  297. package/dist/audit/validation/ingestIssueCodes.js +14 -0
  298. package/dist/audit/validation/ingestIssueCodes.js.map +1 -1
  299. package/dist/remediate/contractPipeline/artifactStore.d.ts +97 -2
  300. package/dist/remediate/contractPipeline/artifactStore.d.ts.map +1 -1
  301. package/dist/remediate/contractPipeline/artifactStore.js +163 -9
  302. package/dist/remediate/contractPipeline/artifactStore.js.map +1 -1
  303. package/dist/remediate/contractPipeline/changeClassification.d.ts.map +1 -1
  304. package/dist/remediate/contractPipeline/changeClassification.js +93 -3
  305. package/dist/remediate/contractPipeline/changeClassification.js.map +1 -1
  306. package/dist/remediate/contractPipeline/cyclicSeamResolution.d.ts.map +1 -1
  307. package/dist/remediate/contractPipeline/cyclicSeamResolution.js +31 -0
  308. package/dist/remediate/contractPipeline/cyclicSeamResolution.js.map +1 -1
  309. package/dist/remediate/contractPipeline/derive.d.ts +0 -14
  310. package/dist/remediate/contractPipeline/derive.d.ts.map +1 -1
  311. package/dist/remediate/contractPipeline/derive.js +52 -24
  312. package/dist/remediate/contractPipeline/derive.js.map +1 -1
  313. package/dist/remediate/contractPipeline/finalizedContractFields.d.ts +50 -0
  314. package/dist/remediate/contractPipeline/finalizedContractFields.d.ts.map +1 -0
  315. package/dist/remediate/contractPipeline/finalizedContractFields.js +77 -0
  316. package/dist/remediate/contractPipeline/finalizedContractFields.js.map +1 -0
  317. package/dist/remediate/contractPipeline/idRegistry.d.ts +85 -0
  318. package/dist/remediate/contractPipeline/idRegistry.d.ts.map +1 -1
  319. package/dist/remediate/contractPipeline/idRegistry.js +147 -0
  320. package/dist/remediate/contractPipeline/idRegistry.js.map +1 -1
  321. package/dist/remediate/contractPipeline/phaseCut.d.ts +13 -16
  322. package/dist/remediate/contractPipeline/phaseCut.d.ts.map +1 -1
  323. package/dist/remediate/contractPipeline/phaseCut.js +15 -30
  324. package/dist/remediate/contractPipeline/phaseCut.js.map +1 -1
  325. package/dist/remediate/contractPipeline/reviewSnapshot.d.ts +20 -1
  326. package/dist/remediate/contractPipeline/reviewSnapshot.d.ts.map +1 -1
  327. package/dist/remediate/contractPipeline/reviewSnapshot.js +23 -7
  328. package/dist/remediate/contractPipeline/reviewSnapshot.js.map +1 -1
  329. package/dist/remediate/contractPipeline/semanticProjection.d.ts +17 -0
  330. package/dist/remediate/contractPipeline/semanticProjection.d.ts.map +1 -1
  331. package/dist/remediate/contractPipeline/semanticProjection.js +6 -9
  332. package/dist/remediate/contractPipeline/semanticProjection.js.map +1 -1
  333. package/dist/remediate/contractPipeline/sketchSource.d.ts +183 -0
  334. package/dist/remediate/contractPipeline/sketchSource.d.ts.map +1 -0
  335. package/dist/remediate/contractPipeline/sketchSource.js +255 -0
  336. package/dist/remediate/contractPipeline/sketchSource.js.map +1 -0
  337. package/dist/remediate/findingFilter.d.ts.map +1 -1
  338. package/dist/remediate/findingFilter.js +1 -0
  339. package/dist/remediate/findingFilter.js.map +1 -1
  340. package/dist/remediate/index.d.ts +81 -0
  341. package/dist/remediate/index.d.ts.map +1 -1
  342. package/dist/remediate/index.js +162 -53
  343. package/dist/remediate/index.js.map +1 -1
  344. package/dist/remediate/intake.d.ts +43 -0
  345. package/dist/remediate/intake.d.ts.map +1 -1
  346. package/dist/remediate/intake.js +82 -13
  347. package/dist/remediate/intake.js.map +1 -1
  348. package/dist/remediate/phases/close.d.ts +33 -2
  349. package/dist/remediate/phases/close.d.ts.map +1 -1
  350. package/dist/remediate/phases/close.js +227 -13
  351. package/dist/remediate/phases/close.js.map +1 -1
  352. package/dist/remediate/phases/closeVerifyHeadEvidence.d.ts +154 -0
  353. package/dist/remediate/phases/closeVerifyHeadEvidence.d.ts.map +1 -0
  354. package/dist/remediate/phases/closeVerifyHeadEvidence.js +242 -0
  355. package/dist/remediate/phases/closeVerifyHeadEvidence.js.map +1 -0
  356. package/dist/remediate/state/runStatus.d.ts +35 -0
  357. package/dist/remediate/state/runStatus.d.ts.map +1 -0
  358. package/dist/remediate/state/runStatus.js +46 -0
  359. package/dist/remediate/state/runStatus.js.map +1 -0
  360. package/dist/remediate/state/store.d.ts +52 -2
  361. package/dist/remediate/state/store.d.ts.map +1 -1
  362. package/dist/remediate/state/store.js +124 -21
  363. package/dist/remediate/state/store.js.map +1 -1
  364. package/dist/remediate/state/types.d.ts +83 -13
  365. package/dist/remediate/state/types.d.ts.map +1 -1
  366. package/dist/remediate/steps/contractPipeline.d.ts +65 -1
  367. package/dist/remediate/steps/contractPipeline.d.ts.map +1 -1
  368. package/dist/remediate/steps/contractPipeline.js +302 -85
  369. package/dist/remediate/steps/contractPipeline.js.map +1 -1
  370. package/dist/remediate/steps/contractPipelinePrompts.d.ts.map +1 -1
  371. package/dist/remediate/steps/contractPipelinePrompts.js +58 -21
  372. package/dist/remediate/steps/contractPipelinePrompts.js.map +1 -1
  373. package/dist/remediate/steps/dispatch/hostHandoff.d.ts +87 -2
  374. package/dist/remediate/steps/dispatch/hostHandoff.d.ts.map +1 -1
  375. package/dist/remediate/steps/dispatch/hostHandoff.js +344 -44
  376. package/dist/remediate/steps/dispatch/hostHandoff.js.map +1 -1
  377. package/dist/remediate/steps/finalGate.d.ts +109 -5
  378. package/dist/remediate/steps/finalGate.d.ts.map +1 -1
  379. package/dist/remediate/steps/finalGate.js +135 -27
  380. package/dist/remediate/steps/finalGate.js.map +1 -1
  381. package/dist/remediate/steps/gateCommands.d.ts +167 -0
  382. package/dist/remediate/steps/gateCommands.d.ts.map +1 -1
  383. package/dist/remediate/steps/gateCommands.js +428 -1
  384. package/dist/remediate/steps/gateCommands.js.map +1 -1
  385. package/dist/remediate/steps/intakeResolver.d.ts +2 -13
  386. package/dist/remediate/steps/intakeResolver.d.ts.map +1 -1
  387. package/dist/remediate/steps/intakeResolver.js +22 -4
  388. package/dist/remediate/steps/intakeResolver.js.map +1 -1
  389. package/dist/remediate/steps/nextStep.d.ts +44 -40
  390. package/dist/remediate/steps/nextStep.d.ts.map +1 -1
  391. package/dist/remediate/steps/nextStep.js +501 -106
  392. package/dist/remediate/steps/nextStep.js.map +1 -1
  393. package/dist/remediate/steps/stepWriter.d.ts +1 -1
  394. package/dist/remediate/steps/stepWriter.d.ts.map +1 -1
  395. package/dist/remediate/steps/stepWriter.js +1 -0
  396. package/dist/remediate/steps/stepWriter.js.map +1 -1
  397. package/dist/remediate/steps/types.d.ts +32 -1
  398. package/dist/remediate/steps/types.d.ts.map +1 -1
  399. package/dist/remediate/steps/types.js +1 -0
  400. package/dist/remediate/steps/types.js.map +1 -1
  401. package/dist/remediate/types/options.d.ts +8 -0
  402. package/dist/remediate/types/options.d.ts.map +1 -1
  403. package/dist/remediate/utils/fileIntegrity.d.ts +8 -0
  404. package/dist/remediate/utils/fileIntegrity.d.ts.map +1 -1
  405. package/dist/remediate/utils/fileIntegrity.js +12 -1
  406. package/dist/remediate/utils/fileIntegrity.js.map +1 -1
  407. package/dist/remediate/validation/artifacts.d.ts +1 -1
  408. package/dist/remediate/validation/artifacts.d.ts.map +1 -1
  409. package/dist/remediate/validation/artifacts.js +19 -2
  410. package/dist/remediate/validation/artifacts.js.map +1 -1
  411. package/dist/remediate/validation/contractPipeline.d.ts.map +1 -1
  412. package/dist/remediate/validation/contractPipeline.js +26 -39
  413. package/dist/remediate/validation/contractPipeline.js.map +1 -1
  414. package/dist/remediate/validation/contractPipelineGates.d.ts +18 -1
  415. package/dist/remediate/validation/contractPipelineGates.d.ts.map +1 -1
  416. package/dist/remediate/validation/contractPipelineGates.js +33 -5
  417. package/dist/remediate/validation/contractPipelineGates.js.map +1 -1
  418. package/dist/shared/analyzers/acquisitionEngine.d.ts +83 -5
  419. package/dist/shared/analyzers/acquisitionEngine.d.ts.map +1 -1
  420. package/dist/shared/analyzers/acquisitionEngine.js +46 -14
  421. package/dist/shared/analyzers/acquisitionEngine.js.map +1 -1
  422. package/dist/shared/analyzers/binaryAcquisition.d.ts +35 -2
  423. package/dist/shared/analyzers/binaryAcquisition.d.ts.map +1 -1
  424. package/dist/shared/analyzers/binaryAcquisition.js +5 -5
  425. package/dist/shared/analyzers/binaryAcquisition.js.map +1 -1
  426. package/dist/shared/analyzers/candidates.d.ts.map +1 -1
  427. package/dist/shared/analyzers/candidates.js +1 -0
  428. package/dist/shared/analyzers/candidates.js.map +1 -1
  429. package/dist/shared/analyzers/clippy.d.ts +9 -1
  430. package/dist/shared/analyzers/clippy.d.ts.map +1 -1
  431. package/dist/shared/analyzers/clippy.js +10 -2
  432. package/dist/shared/analyzers/clippy.js.map +1 -1
  433. package/dist/shared/analyzers/normalizeExternal.d.ts.map +1 -1
  434. package/dist/shared/analyzers/normalizeExternal.js +1 -0
  435. package/dist/shared/analyzers/normalizeExternal.js.map +1 -1
  436. package/dist/shared/analyzers/rubocop.d.ts +7 -1
  437. package/dist/shared/analyzers/rubocop.d.ts.map +1 -1
  438. package/dist/shared/analyzers/rubocop.js +8 -2
  439. package/dist/shared/analyzers/rubocop.js.map +1 -1
  440. package/dist/shared/analyzers/types.d.ts +24 -24
  441. package/dist/shared/analyzers/types.d.ts.map +1 -1
  442. package/dist/shared/analyzers/types.js +15 -0
  443. package/dist/shared/analyzers/types.js.map +1 -1
  444. package/dist/shared/artifactFreshness.d.ts.map +1 -1
  445. package/dist/shared/artifactFreshness.js +42 -7
  446. package/dist/shared/artifactFreshness.js.map +1 -1
  447. package/dist/shared/chunkByBudget.d.ts.map +1 -1
  448. package/dist/shared/chunkByBudget.js.map +1 -1
  449. package/dist/shared/continuityScore.d.ts.map +1 -1
  450. package/dist/shared/continuityScore.js +12 -4
  451. package/dist/shared/continuityScore.js.map +1 -1
  452. package/dist/shared/decompose/charterClarification.d.ts +49 -45
  453. package/dist/shared/decompose/charterClarification.d.ts.map +1 -1
  454. package/dist/shared/decompose/charterClarification.js +50 -57
  455. package/dist/shared/decompose/charterClarification.js.map +1 -1
  456. package/dist/shared/decompose/charterExtraction.d.ts +616 -342
  457. package/dist/shared/decompose/charterExtraction.d.ts.map +1 -1
  458. package/dist/shared/decompose/charterExtraction.js +590 -488
  459. package/dist/shared/decompose/charterExtraction.js.map +1 -1
  460. package/dist/shared/decompose/contentCoherence.d.ts +36 -2
  461. package/dist/shared/decompose/contentCoherence.d.ts.map +1 -1
  462. package/dist/shared/decompose/contentCoherence.js +45 -5
  463. package/dist/shared/decompose/contentCoherence.js.map +1 -1
  464. package/dist/shared/decompose/modularity.d.ts +98 -1
  465. package/dist/shared/decompose/modularity.d.ts.map +1 -1
  466. package/dist/shared/decompose/modularity.js +89 -8
  467. package/dist/shared/decompose/modularity.js.map +1 -1
  468. package/dist/shared/decompose/systemicChallenge.d.ts +111 -0
  469. package/dist/shared/decompose/systemicChallenge.d.ts.map +1 -1
  470. package/dist/shared/decompose/systemicChallenge.js +28 -0
  471. package/dist/shared/decompose/systemicChallenge.js.map +1 -1
  472. package/dist/shared/engine/obligationEngine.d.ts +2 -2
  473. package/dist/shared/engine/obligationEngine.d.ts.map +1 -1
  474. package/dist/shared/engine/obligationEngine.js +8 -2
  475. package/dist/shared/engine/obligationEngine.js.map +1 -1
  476. package/dist/shared/findingSimilarity.d.ts +8 -0
  477. package/dist/shared/findingSimilarity.d.ts.map +1 -1
  478. package/dist/shared/findingSimilarity.js +10 -3
  479. package/dist/shared/findingSimilarity.js.map +1 -1
  480. package/dist/shared/findings/dedupe.d.ts +15 -0
  481. package/dist/shared/findings/dedupe.d.ts.map +1 -1
  482. package/dist/shared/findings/dedupe.js +137 -1
  483. package/dist/shared/findings/dedupe.js.map +1 -1
  484. package/dist/shared/friction/frictionRecord.d.ts.map +1 -1
  485. package/dist/shared/friction/frictionRecord.js +14 -1
  486. package/dist/shared/friction/frictionRecord.js.map +1 -1
  487. package/dist/shared/friction/triage.d.ts +4 -0
  488. package/dist/shared/friction/triage.d.ts.map +1 -1
  489. package/dist/shared/friction/triage.js +41 -29
  490. package/dist/shared/friction/triage.js.map +1 -1
  491. package/dist/shared/git.d.ts +14 -0
  492. package/dist/shared/git.d.ts.map +1 -1
  493. package/dist/shared/git.js +22 -0
  494. package/dist/shared/git.js.map +1 -1
  495. package/dist/shared/index.d.ts +42 -38
  496. package/dist/shared/index.d.ts.map +1 -1
  497. package/dist/shared/index.js +35 -23
  498. package/dist/shared/index.js.map +1 -1
  499. package/dist/shared/intent/clauseBoundaries.d.ts +75 -0
  500. package/dist/shared/intent/clauseBoundaries.d.ts.map +1 -0
  501. package/dist/shared/intent/clauseBoundaries.js +134 -0
  502. package/dist/shared/intent/clauseBoundaries.js.map +1 -0
  503. package/dist/shared/intent/clauseInterpreter.d.ts +11 -5
  504. package/dist/shared/intent/clauseInterpreter.d.ts.map +1 -1
  505. package/dist/shared/intent/clauseInterpreter.js +16 -41
  506. package/dist/shared/intent/clauseInterpreter.js.map +1 -1
  507. package/dist/shared/intent/freeFormIntentInterpreter.d.ts +11 -0
  508. package/dist/shared/intent/freeFormIntentInterpreter.d.ts.map +1 -1
  509. package/dist/shared/intent/freeFormIntentInterpreter.js +31 -17
  510. package/dist/shared/intent/freeFormIntentInterpreter.js.map +1 -1
  511. package/dist/shared/io/fileLock.d.ts.map +1 -1
  512. package/dist/shared/io/fileLock.js +18 -6
  513. package/dist/shared/io/fileLock.js.map +1 -1
  514. package/dist/shared/io/frictionCapture.d.ts +25 -5
  515. package/dist/shared/io/frictionCapture.d.ts.map +1 -1
  516. package/dist/shared/io/frictionCapture.js +30 -9
  517. package/dist/shared/io/frictionCapture.js.map +1 -1
  518. package/dist/shared/io/schemaVersion.d.ts +4 -3
  519. package/dist/shared/io/schemaVersion.d.ts.map +1 -1
  520. package/dist/shared/io/schemaVersion.js +27 -4
  521. package/dist/shared/io/schemaVersion.js.map +1 -1
  522. package/dist/shared/io/stepContractWriter.d.ts +38 -4
  523. package/dist/shared/io/stepContractWriter.d.ts.map +1 -1
  524. package/dist/shared/io/stepContractWriter.js +59 -1
  525. package/dist/shared/io/stepContractWriter.js.map +1 -1
  526. package/dist/shared/loopCorePaths.d.ts.map +1 -1
  527. package/dist/shared/loopCorePaths.js +8 -0
  528. package/dist/shared/loopCorePaths.js.map +1 -1
  529. package/dist/shared/opencodePermissions.d.ts +27 -3
  530. package/dist/shared/opencodePermissions.d.ts.map +1 -1
  531. package/dist/shared/opencodePermissions.js +77 -26
  532. package/dist/shared/opencodePermissions.js.map +1 -1
  533. package/dist/shared/prompts.d.ts +12 -1
  534. package/dist/shared/prompts.d.ts.map +1 -1
  535. package/dist/shared/prompts.js +11 -1
  536. package/dist/shared/prompts.js.map +1 -1
  537. package/dist/shared/reReview/projectionDiff.d.ts +13 -0
  538. package/dist/shared/reReview/projectionDiff.d.ts.map +1 -1
  539. package/dist/shared/reReview/projectionDiff.js +1 -1
  540. package/dist/shared/reReview/projectionDiff.js.map +1 -1
  541. package/dist/shared/reporting/findingDisplay.d.ts +7 -0
  542. package/dist/shared/reporting/findingDisplay.d.ts.map +1 -1
  543. package/dist/shared/reporting/findingDisplay.js +8 -1
  544. package/dist/shared/reporting/findingDisplay.js.map +1 -1
  545. package/dist/shared/steps/stepEmissionScaffold.d.ts +15 -3
  546. package/dist/shared/steps/stepEmissionScaffold.d.ts.map +1 -1
  547. package/dist/shared/steps/stepEmissionScaffold.js +8 -6
  548. package/dist/shared/steps/stepEmissionScaffold.js.map +1 -1
  549. package/dist/shared/submission/hostHandoffCore.d.ts +37 -12
  550. package/dist/shared/submission/hostHandoffCore.d.ts.map +1 -1
  551. package/dist/shared/submission/hostHandoffCore.js +81 -18
  552. package/dist/shared/submission/hostHandoffCore.js.map +1 -1
  553. package/dist/shared/submission/hostResultOutcomes.d.ts +70 -1
  554. package/dist/shared/submission/hostResultOutcomes.d.ts.map +1 -1
  555. package/dist/shared/submission/hostResultOutcomes.js +66 -1
  556. package/dist/shared/submission/hostResultOutcomes.js.map +1 -1
  557. package/dist/shared/submission/submissionLedger.d.ts +86 -1
  558. package/dist/shared/submission/submissionLedger.d.ts.map +1 -1
  559. package/dist/shared/submission/submissionLedger.js +108 -0
  560. package/dist/shared/submission/submissionLedger.js.map +1 -1
  561. package/dist/shared/submission/submissionScan.d.ts.map +1 -1
  562. package/dist/shared/submission/submissionScan.js +1 -0
  563. package/dist/shared/submission/submissionScan.js.map +1 -1
  564. package/dist/shared/tooling/analyzerDeps.d.ts +14 -0
  565. package/dist/shared/tooling/analyzerDeps.d.ts.map +1 -1
  566. package/dist/shared/tooling/analyzerDeps.js +23 -0
  567. package/dist/shared/tooling/analyzerDeps.js.map +1 -1
  568. package/dist/shared/tooling/commandShape.d.ts +35 -1
  569. package/dist/shared/tooling/commandShape.d.ts.map +1 -1
  570. package/dist/shared/tooling/commandShape.js +66 -4
  571. package/dist/shared/tooling/commandShape.js.map +1 -1
  572. package/dist/shared/tooling/exec.d.ts +62 -4
  573. package/dist/shared/tooling/exec.d.ts.map +1 -1
  574. package/dist/shared/tooling/exec.js +127 -8
  575. package/dist/shared/tooling/exec.js.map +1 -1
  576. package/dist/shared/types/charter.d.ts +674 -156
  577. package/dist/shared/types/charter.d.ts.map +1 -1
  578. package/dist/shared/types/charter.js +172 -118
  579. package/dist/shared/types/charter.js.map +1 -1
  580. package/dist/shared/types/closingActions.d.ts +25 -0
  581. package/dist/shared/types/closingActions.d.ts.map +1 -1
  582. package/dist/shared/types/closingActions.js +26 -0
  583. package/dist/shared/types/closingActions.js.map +1 -1
  584. package/dist/shared/types/contractPipeline/obligations.d.ts +63 -2
  585. package/dist/shared/types/contractPipeline/obligations.d.ts.map +1 -1
  586. package/dist/shared/types/contractPipeline/obligations.js +51 -0
  587. package/dist/shared/types/contractPipeline/obligations.js.map +1 -1
  588. package/dist/shared/types/contractPipeline.d.ts +1 -0
  589. package/dist/shared/types/contractPipeline.d.ts.map +1 -1
  590. package/dist/shared/types/contractPipeline.js +1 -0
  591. package/dist/shared/types/contractPipeline.js.map +1 -1
  592. package/dist/shared/types/contractPropertyShapes.d.ts +34 -0
  593. package/dist/shared/types/contractPropertyShapes.d.ts.map +1 -0
  594. package/dist/shared/types/contractPropertyShapes.js +255 -0
  595. package/dist/shared/types/contractPropertyShapes.js.map +1 -0
  596. package/dist/shared/types/finding.d.ts +376 -18
  597. package/dist/shared/types/finding.d.ts.map +1 -1
  598. package/dist/shared/types/finding.js +111 -0
  599. package/dist/shared/types/finding.js.map +1 -1
  600. package/dist/shared/types/intentCheckpoint.d.ts +214 -2
  601. package/dist/shared/types/intentCheckpoint.d.ts.map +1 -1
  602. package/dist/shared/types/intentCheckpoint.js +273 -0
  603. package/dist/shared/types/intentCheckpoint.js.map +1 -1
  604. package/dist/shared/types/intentInterpretation.d.ts +1 -1
  605. package/dist/shared/types/intentInterpretation.js +1 -1
  606. package/dist/shared/types/remediationOutcome.d.ts +294 -30
  607. package/dist/shared/types/remediationOutcome.d.ts.map +1 -1
  608. package/dist/shared/types/remediationOutcome.js +96 -7
  609. package/dist/shared/types/remediationOutcome.js.map +1 -1
  610. package/dist/shared/types/stepContract.d.ts +47 -0
  611. package/dist/shared/types/stepContract.d.ts.map +1 -1
  612. package/dist/shared/types/stepContract.js +113 -0
  613. package/dist/shared/types/stepContract.js.map +1 -1
  614. package/dist/shared/validation/charterGate.d.ts +13 -28
  615. package/dist/shared/validation/charterGate.d.ts.map +1 -1
  616. package/dist/shared/validation/charterGate.js +13 -35
  617. package/dist/shared/validation/charterGate.js.map +1 -1
  618. package/dist/shared/validation/contractConstructionSites.d.ts +116 -0
  619. package/dist/shared/validation/contractConstructionSites.d.ts.map +1 -0
  620. package/dist/shared/validation/contractConstructionSites.js +277 -0
  621. package/dist/shared/validation/contractConstructionSites.js.map +1 -0
  622. package/dist/shared/validation/designFindingGrounding.d.ts +33 -4
  623. package/dist/shared/validation/designFindingGrounding.d.ts.map +1 -1
  624. package/dist/shared/validation/designFindingGrounding.js +40 -6
  625. package/dist/shared/validation/designFindingGrounding.js.map +1 -1
  626. package/dist/shared/validation/findingGrounding.d.ts.map +1 -1
  627. package/dist/shared/validation/findingGrounding.js +11 -1
  628. package/dist/shared/validation/findingGrounding.js.map +1 -1
  629. package/dist/shared/validation/findingsReport.d.ts.map +1 -1
  630. package/dist/shared/validation/findingsReport.js +5 -0
  631. package/dist/shared/validation/findingsReport.js.map +1 -1
  632. package/docs/audit-pkg/contracts.md +8 -2
  633. package/opencode.json +29 -29
  634. package/package.json +16 -3
  635. package/schemas/audit-code-v1alpha1.schema.json +0 -4
  636. package/scripts/audit/postinstall.mjs +81 -96
  637. package/scripts/remediate/postinstall.mjs +43 -83
  638. package/scripts/shared/host-asset-plan.mjs +176 -0
  639. package/scripts/shared/install-host-assets.mjs +44 -1
  640. package/scripts/shared/primitives.mjs +89 -0
  641. package/skills/audit-code/SKILL.md +4 -4
  642. package/skills/audit-code/audit-code.prompt.md +14 -10
  643. package/skills/remediate-code/SKILL.md +9 -5
  644. package/skills/remediate-code/remediate-code.prompt.md +11 -4
  645. package/wrapper/audit-code-wrapper-build.mjs +6 -3
  646. package/dist/audit/cli/charterDeltaPrompt.d.ts +0 -18
  647. package/dist/audit/cli/charterDeltaPrompt.d.ts.map +0 -1
  648. package/dist/audit/cli/charterDeltaPrompt.js +0 -150
  649. package/dist/audit/cli/charterDeltaPrompt.js.map +0 -1
  650. package/dist/audit/orchestrator/charterDeltaExecutor.d.ts +0 -24
  651. package/dist/audit/orchestrator/charterDeltaExecutor.d.ts.map +0 -1
  652. package/dist/audit/orchestrator/charterDeltaExecutor.js +0 -128
  653. package/dist/audit/orchestrator/charterDeltaExecutor.js.map +0 -1
  654. package/dist/audit/supervisor/runLedger.d.ts +0 -3
  655. package/dist/audit/supervisor/runLedger.d.ts.map +0 -1
  656. package/dist/audit/supervisor/runLedger.js +0 -69
  657. package/dist/audit/supervisor/runLedger.js.map +0 -1
  658. package/dist/shared/types/executionRecord.d.ts +0 -58
  659. package/dist/shared/types/executionRecord.d.ts.map +0 -1
  660. package/dist/shared/types/executionRecord.js +0 -26
  661. package/dist/shared/types/executionRecord.js.map +0 -1
  662. package/dist/shared/types/runLedger.d.ts +0 -17
  663. package/dist/shared/types/runLedger.d.ts.map +0 -1
  664. package/dist/shared/types/runLedger.js +0 -7
  665. package/dist/shared/types/runLedger.js.map +0 -1
@@ -0,0 +1,154 @@
1
+ import type { Evidence } from "../../shared/types/remediationOutcome.js";
2
+ import type { Finding, PerFindingDisposition, RemediationItemState } from "../state/types.js";
3
+ /**
4
+ * CDC-25/CDC-26 (INV-ISC-EVIDENCE-EMITTED) — the PRODUCER for the two
5
+ * evidence-bearing terminal dispositions. `verified_already_fixed` and
6
+ * `refuted` are reachable from a real run ONLY through
7
+ * `RemediationItemState.disposition_override`, and the writer
8
+ * (`buildRemediationOutcomesReport` in `close.ts`) refuses that override unless
9
+ * the item also carries a complete `evidence` triple and the module stamp that
10
+ * recorded it. Nothing wrote those three fields, so both dispositions were
11
+ * dead letters: the only route from a determination to run state was a human
12
+ * transcribing a markdown document no code reads.
13
+ *
14
+ * This leg is that producer, and it is a REAL determination rather than a
15
+ * record of one: it re-reads the finding's own CITED location at TWO refs and
16
+ * decides from what it read. The triple it records names the file and the line
17
+ * it actually read (that is the whole content of INV-ISC-EVIDENCE-EMITTED — the
18
+ * recorded triple must name what was read), so a triple naming a location this
19
+ * leg never opened cannot be produced here.
20
+ *
21
+ * ── WHY TWO READS, NEVER ONE ────────────────────────────────────────────────
22
+ * Let B be the commit the AUDIT read when it produced the finding, and HEAD the
23
+ * commit the fix has landed on by the time this leg runs (close.ts executes the
24
+ * closing action BEFORE its verify legs, so HEAD contains the remediation
25
+ * result — the same point `verifyAnalyzerLeads` and the combined-test leg
26
+ * read). A read at HEAD ALONE cannot support either verdict:
27
+ *
28
+ * span at B | span at HEAD | result
29
+ * ----------|--------------|------------------------------------------
30
+ * present | absent | `verified_already_fixed` — the code the audit
31
+ * | | read is gone; the fix landed.
32
+ * absent | (any) | `refuted` — the audit read a location that
33
+ * | | never showed the span it quoted.
34
+ * present | present | WITHHELD — the cited code still stands, so
35
+ * | | this leg makes no determination at all.
36
+ * B unknown/unreadable | WITHHELD, with the reason.
37
+ *
38
+ * The single-read form this leg used to carry was WRONG in both directions, and
39
+ * the two errors were mirror images. It called "span still present at HEAD"
40
+ * `refuted` on the stated ground that "the cited location never showed the
41
+ * defect" — an inference no read at HEAD can make. A span still standing proves
42
+ * only that the code the finding quoted is still there; if the defect was real
43
+ * when the audit read it, it is still real. Symmetrically it called "span absent
44
+ * at HEAD" `verified_already_fixed`, when an absent span has TWO causes: the
45
+ * code changed after the audit read it (the fix landed), or the span was never
46
+ * in the file (a misquote — the `refuted` case). B is what tells them apart, so
47
+ * without B neither verdict is reachable and every candidate is withheld.
48
+ *
49
+ * ── WHERE B COMES FROM, AND WHY IT IS USUALLY UNKNOWN ───────────────────────
50
+ * B must be a commit the AUDIT itself recorded. A remediation-side commit is
51
+ * NOT B: code can change between the audit and the remediation run, so a span
52
+ * absent at the remediation's own start could be a fix made in between rather
53
+ * than a misquote — the very confusion this leg exists to avoid. The obvious
54
+ * candidate, the host-handoff `baseline_commit`, is exactly that remediation-
55
+ * side value and is therefore refused here BY NAME.
56
+ *
57
+ * The audit-side search (the findings contract and `Finding` schema, the report
58
+ * intake path, `intake.ts`, `plan.ts`) finds no recorded upstream commit: the
59
+ * `Finding` fields are the quote grounding (`quoted_text`), the plan-time
60
+ * content hash (`hash_at_plan_time`, stamped by the REMEDIATOR at plan time),
61
+ * the evidence lane, the verification status and the analyzer provenance —
62
+ * none of which is a rev. `audit-findings.json`'s only envelope fields are
63
+ * `contract_version` and the derived `summary`. The audit artifacts that DO
64
+ * carry a rev (`artifact_metadata.git_history_baseline.head`) are internal
65
+ * staleness caches and are never promoted into the deliverable the remediator
66
+ * consumes. So at the time this leg was written B was UNKNOWN on every real
67
+ * run, and every candidate resolved to WITHHELD.
68
+ *
69
+ * The resolution is NOT to invent a B and not to keep the false single-read
70
+ * rule: it is to make B an OPTIONAL INPUT with a RESOLVER SEAM, so the rule
71
+ * above is the shipped rule and a later packet that stamps the audit's rev only
72
+ * has to supply the value. `HeadEvidenceOverrides.findingBase` is that seam.
73
+ * Absent means "no B was supplied"; a caller that supplies one gets the
74
+ * two-read determination, and any B that does not resolve to a real commit in
75
+ * this repo is refused as unknown rather than read.
76
+ *
77
+ * PROVENANCE IS STRUCTURAL. Only `resolved_no_change` items are considered: the
78
+ * host has already asserted "I changed nothing because nothing needed
79
+ * changing", so this leg CONFIRMS or leaves that assertion standing — it can
80
+ * never manufacture a disposition for an item nobody resolved. The outcome is
81
+ * then still subject to the writer's own backstop, which refuses a triple whose
82
+ * mechanism contradicts the disposition (`mechanismContradictsOutcome`) or that
83
+ * arrives incomplete; a mechanism/disposition pair is reachable here only
84
+ * because the branch above chose both together.
85
+ *
86
+ * It is a close-gate VERIFY leg, never a `CLOSING_ACTIONS` entry: it runs
87
+ * beside `verifyAnalyzerLeads`, dispatches no host work, and a run with no
88
+ * qualifying item is a no-op.
89
+ */
90
+ /**
91
+ * The commit the AUDIT read when it produced the findings — the `B` of the
92
+ * two-read rule above. Production passes none: nothing in the audit contract
93
+ * records one (see the module header), so a real run resolves to WITHHELD
94
+ * rather than to a fabricated verdict.
95
+ */
96
+ export interface FindingBase {
97
+ /** Full commit id the audit read. Resolved against the repo before use. */
98
+ commit: string;
99
+ }
100
+ export interface HeadEvidenceOverrides {
101
+ /**
102
+ * Test-injectable source; production callers pass none. Reads one file's
103
+ * content at a ref — the seam BOTH of the leg's reads go through, so a test
104
+ * can drive the two-read rule without a second commit on disk.
105
+ */
106
+ readAtRef?: (root: string, ref: string, file: string) => Promise<string | undefined>;
107
+ /**
108
+ * The audit-read commit `B`, when a caller has one. Absent (the production
109
+ * default) means B is unknown and no candidate can be determined.
110
+ */
111
+ findingBase?: FindingBase;
112
+ }
113
+ /**
114
+ * One candidate item's fate. A withheld record deliberately carries no
115
+ * `disposition`/`evidence`: it is the statement that NEITHER was determined,
116
+ * and giving it a triple would be giving it the very shape this whole leg
117
+ * exists to keep meaningful.
118
+ */
119
+ export type HeadEvidenceRecord = {
120
+ finding_id: string;
121
+ determined: true;
122
+ disposition: PerFindingDisposition;
123
+ evidence: Evidence;
124
+ } | {
125
+ finding_id: string;
126
+ determined: false;
127
+ /** Why an item that qualified was NOT determined — recorded, never silent. */
128
+ reason: string;
129
+ };
130
+ export interface HeadEvidenceOutcome {
131
+ /** False when no item was a candidate (leg is a no-op). */
132
+ ran: boolean;
133
+ /** The commit this leg's HEAD reads were made against; null when HEAD did not resolve. */
134
+ head: string | null;
135
+ /** The audit-read commit `B`, when one was supplied AND resolved; null otherwise. */
136
+ base: string | null;
137
+ /** Per finding_id, the triple + disposition this leg RECORDED onto the item. */
138
+ recorded: Record<string, HeadEvidenceRecord>;
139
+ /** Candidate items the leg declined to determine, with the reason. */
140
+ withheld: HeadEvidenceRecord[];
141
+ }
142
+ /** The module stamp carried into `recorded_by_module` (the ATTRIBUTION ROUND-TRIP). */
143
+ export declare const HEAD_EVIDENCE_MODULE = "closeVerifyHeadEvidence";
144
+ export declare function verifyHeadEvidenceAgainstFindings(params: {
145
+ state: {
146
+ plan?: {
147
+ findings?: Finding[];
148
+ } | undefined;
149
+ items?: Record<string, RemediationItemState> | undefined;
150
+ };
151
+ root: string;
152
+ overrides?: HeadEvidenceOverrides;
153
+ }): Promise<HeadEvidenceOutcome>;
154
+ //# sourceMappingURL=closeVerifyHeadEvidence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"closeVerify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AAC;IAC7C,sEAAsE;IACtE,QAAQ,EAAE,kBAAkB,EAAE,CAAC;CAChC;AAUD,uFAAuF;AACvF,eAAO,MAAM,oBAAoB,4BAA4B,CAAC;AAuL9D,wBAAsB,iCAAiC,CAAC,MAAM,EAAE;IAC9D,KAAK,EAAE;QAAE,IAAI,CAAC,EAAE;YAAE,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAA;SAAE,GAAG,SAAS,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAAG,SAAS,CAAA;KAAE,CAAC;IACjH,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,qBAAqB,CAAC;CACnC,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAyF/B"}
@@ -0,0 +1,242 @@
1
+ import { enumerateTrackedFilePaths, fileContentAtRef, gitRefExists, headCommit, isBareBasename, normalizeForMatch, quoteMatches, resolveBasenameToTrackedPath, stripEmittedLinePrefix, toPosixPath, } from "audit-tools/shared";
2
+ const NO_OP = {
3
+ ran: false,
4
+ head: null,
5
+ base: null,
6
+ recorded: {},
7
+ withheld: [],
8
+ };
9
+ /** The module stamp carried into `recorded_by_module` (the ATTRIBUTION ROUND-TRIP). */
10
+ export const HEAD_EVIDENCE_MODULE = "closeVerifyHeadEvidence";
11
+ /**
12
+ * How wide an emitted `NNN| ` line prefix this leg will strip when asking
13
+ * whether a quote is absent. The emitter's own widths are per-delivery, and no
14
+ * delivery manifest reaches close — so rather than guess one width, the leg
15
+ * strips the widest prefix the emitted form can carry. That direction is the
16
+ * safe one: over-stripping can only turn a "present" into a withheld record,
17
+ * never an absent into a false `verified_already_fixed`.
18
+ */
19
+ const PREFIX_WIDTH_MAX = 8;
20
+ /** Which cited anchor this leg will read, or `undefined` when none carries a quoted span. */
21
+ function anchorFor(finding) {
22
+ for (const location of finding.affected_files ?? []) {
23
+ const quoted = location.quoted_text;
24
+ if (typeof quoted === "string" && quoted.trim().length > 0) {
25
+ return { path: location.path, quoted };
26
+ }
27
+ }
28
+ return undefined;
29
+ }
30
+ /** The cited 1-based line the triple names, or `""` when the finding cites no line. */
31
+ function citedLineLabel(finding) {
32
+ for (const location of finding.affected_files ?? []) {
33
+ if (location.line_start === undefined)
34
+ continue;
35
+ const end = location.line_end ?? location.line_start;
36
+ return end === location.line_start ? `${location.line_start}` : `${location.line_start}-${end}`;
37
+ }
38
+ return "";
39
+ }
40
+ /**
41
+ * Resolve a cited path to the repo-relative path it names, or `undefined` when
42
+ * nothing is there. A bare basename resolves against the tracked corpus exactly
43
+ * as the grounding pass resolves it (INV-B3-3), so a nested `advance.ts` is not
44
+ * false-negatived into looking like a phantom path.
45
+ */
46
+ function resolveCitedFile(cited, corpus) {
47
+ const trimmed = cited.trim();
48
+ if (trimmed.length === 0)
49
+ return undefined;
50
+ if (!isBareBasename(trimmed))
51
+ return toPosixPath(trimmed);
52
+ return resolveBasenameToTrackedPath(trimmed, corpus);
53
+ }
54
+ /**
55
+ * Whether a quoted span is present in `content` — the ONE predicate both reads
56
+ * go through, so B and HEAD cannot disagree about what "present" means, and
57
+ * neither can drift from the grounding pass whose identical test admitted the
58
+ * finding (S7 tier-1).
59
+ *
60
+ * The emitted-`NNN| `-prefix branch strips the QUOTE, not the content, exactly
61
+ * as `checkCitations` does (`quoteMatches(content, stripEmittedLinePrefix(quote,
62
+ * width))`) — the prefix is attached to the span the worker was shown, so it
63
+ * rides the quote. Stripping the CONTENT instead is not the same operation and
64
+ * is silently wrong: it de-prefixes the file's other lines rather than the
65
+ * quote's, so a quote that was genuinely recoverable reads as absent.
66
+ *
67
+ * The ambiguity is applied to BOTH reads, not only to HEAD: a quote the emitted
68
+ * prefix was not stripped from reads as ABSENT under the raw test even when the
69
+ * code is right there, so admitting that shape on one side and not the other
70
+ * would let the prefix alone manufacture a verdict.
71
+ */
72
+ function spanPresence(content, quoted) {
73
+ if (normalizeForMatch(quoted).length === 0) {
74
+ return { kind: "withheld", reason: "the cited quoted_text span is empty after normalization" };
75
+ }
76
+ if (quoteMatches(content, quoted))
77
+ return { kind: "present" };
78
+ if (quoteMatches(content, stripEmittedLinePrefix(quoted, PREFIX_WIDTH_MAX))) {
79
+ return { kind: "ambiguous" };
80
+ }
81
+ return { kind: "absent" };
82
+ }
83
+ /**
84
+ * Determine one item from its finding's own cited anchor, read at BOTH B and
85
+ * HEAD. Returns the disposition + triple, or a reason why no determination was
86
+ * possible.
87
+ */
88
+ async function determine(params) {
89
+ const { root, head, base, corpus, finding, readAtRef } = params;
90
+ const anchor = anchorFor(finding);
91
+ if (!anchor) {
92
+ // Too little evidence to decide. Stated, never guessed at: this is the
93
+ // per-file lane's normal shape (it carries an `evidence` array, not
94
+ // `quoted_text` spans), so the leg must decline rather than infer a defect
95
+ // claim out of prose the finding never bound to a location.
96
+ return { withheld: "the finding carries no verbatim quoted_text span on any cited location" };
97
+ }
98
+ const file = resolveCitedFile(anchor.path, corpus);
99
+ if (!file) {
100
+ return { withheld: `cited path '${anchor.path}' does not resolve to a tracked file` };
101
+ }
102
+ const shortHead = head.slice(0, 12);
103
+ const baseContent = await readAtRef(root, base, file);
104
+ if (baseContent === undefined) {
105
+ return { withheld: `'${file}' is not a readable file at the audit-read commit ${base.slice(0, 12)}` };
106
+ }
107
+ const basePresence = spanPresence(baseContent, anchor.quoted);
108
+ if (basePresence.kind === "withheld")
109
+ return { withheld: basePresence.reason };
110
+ if (basePresence.kind === "ambiguous") {
111
+ return {
112
+ withheld: "the cited span matches at the audit-read commit only after stripping an emitted line prefix, so its presence there cannot be established",
113
+ };
114
+ }
115
+ const line = citedLineLabel(finding);
116
+ if (basePresence.kind === "present") {
117
+ const headContent = await readAtRef(root, head, file);
118
+ if (headContent === undefined) {
119
+ return { withheld: `'${file}' is not a readable file at HEAD` };
120
+ }
121
+ const headPresence = spanPresence(headContent, anchor.quoted);
122
+ if (headPresence.kind === "withheld")
123
+ return { withheld: headPresence.reason };
124
+ if (headPresence.kind === "ambiguous") {
125
+ return {
126
+ withheld: "the cited span matches at HEAD only after stripping an emitted line prefix, so its absence there cannot be established",
127
+ };
128
+ }
129
+ if (headPresence.kind === "present") {
130
+ // The code the finding quoted still stands at both reads. That is not a
131
+ // refutation: a span still present proves only that the code is still
132
+ // there — if the defect was real at B, it is still real at HEAD. This leg
133
+ // makes no claim about the English of the finding, so it declines.
134
+ return {
135
+ withheld: `the cited span is present both at the audit-read commit ${base.slice(0, 12)} and at HEAD ${shortHead}, ` +
136
+ "so this leg cannot tell a still-standing defect from a finding the code never showed",
137
+ };
138
+ }
139
+ return {
140
+ disposition: "verified_already_fixed",
141
+ evidence: {
142
+ file,
143
+ line,
144
+ mechanism: "read_at_head_verification",
145
+ mechanism_detail: `read '${file}' at the audit-read commit ${base.slice(0, 12)} and at HEAD ${shortHead}: ` +
146
+ "the cited span the finding quotes was present there and is no longer present, so the defect it cites was fixed by the time of the HEAD read",
147
+ },
148
+ };
149
+ }
150
+ // Absent at B, whatever HEAD says: the cited location never showed the quoted
151
+ // span, so the finding's own citation cannot evidence the defect it claims.
152
+ // HEAD is not read at all here — its state cannot change this verdict, and a
153
+ // read we do not need is a read whose result we would have to ignore.
154
+ return {
155
+ disposition: "refuted",
156
+ evidence: {
157
+ file,
158
+ line,
159
+ mechanism: "read_at_head_refutation",
160
+ mechanism_detail: `read '${file}' at the audit-read commit ${base.slice(0, 12)}: the cited span the finding quotes ` +
161
+ "is not present there, so the cited location never showed the defect the finding claims",
162
+ },
163
+ };
164
+ }
165
+ export async function verifyHeadEvidenceAgainstFindings(params) {
166
+ const { state, root, overrides } = params;
167
+ const findingsById = new Map((state.plan?.findings ?? []).map((finding) => [finding.id, finding]));
168
+ // Provenance first: only a `resolved_no_change` item is a candidate, because
169
+ // only there has the host asserted a no-change resolution for this leg to
170
+ // confirm. An item that already carries an override is left alone — a
171
+ // determination someone else recorded is not this leg's to overwrite.
172
+ const candidates = [];
173
+ for (const item of Object.values(state.items ?? {})) {
174
+ if (item.status !== "resolved_no_change")
175
+ continue;
176
+ if (item.disposition_override !== undefined)
177
+ continue;
178
+ const finding = findingsById.get(item.finding_id);
179
+ if (!finding)
180
+ continue;
181
+ candidates.push({ item, finding });
182
+ }
183
+ if (candidates.length === 0)
184
+ return NO_OP;
185
+ const withholdAll = (head, reason) => ({
186
+ ran: true,
187
+ head,
188
+ base: null,
189
+ recorded: {},
190
+ withheld: candidates.map(({ finding }) => ({
191
+ finding_id: finding.id,
192
+ determined: false,
193
+ reason,
194
+ })),
195
+ });
196
+ // No resolvable HEAD means no read-at-HEAD determination exists to record, so
197
+ // the leg refuses to run rather than record a triple it cannot stand behind.
198
+ const head = await headCommit(root);
199
+ if (head === null) {
200
+ return withholdAll(null, "no resolvable HEAD — a read-at-HEAD determination cannot be made");
201
+ }
202
+ // B is an INPUT, never a guess, and it is verified before it is read: a
203
+ // supplied commit that does not resolve in THIS repo is not a read the leg can
204
+ // honestly attribute a triple to, so it is refused as unknown rather than
205
+ // handed to `git show`. `gitRefExists` is what distinguishes "the caller gave
206
+ // us a B this repo does not have" from "the caller gave us none" — both end in
207
+ // the same withhold, but only one of them is a caller error worth naming.
208
+ const base = overrides?.findingBase?.commit;
209
+ if (base === undefined) {
210
+ return withholdAll(head, "no audit-read commit is recorded for these findings, so neither a verification nor a refutation can be determined");
211
+ }
212
+ if (!(await gitRefExists(root, base))) {
213
+ return withholdAll(head, `the supplied audit-read commit '${base}' does not resolve to a commit in this repository`);
214
+ }
215
+ const corpus = await enumerateTrackedFilePaths(root);
216
+ const readAtRef = overrides?.readAtRef ??
217
+ ((readRoot, ref, file) => fileContentAtRef(readRoot, ref, file));
218
+ const recorded = {};
219
+ const withheld = [];
220
+ for (const { item, finding } of candidates) {
221
+ const verdict = await determine({ root, head, base, corpus, finding, readAtRef });
222
+ if ("withheld" in verdict) {
223
+ withheld.push({
224
+ finding_id: finding.id,
225
+ determined: false,
226
+ reason: verdict.withheld,
227
+ });
228
+ continue;
229
+ }
230
+ item.disposition_override = verdict.disposition;
231
+ item.evidence = verdict.evidence;
232
+ item.recorded_by_module = HEAD_EVIDENCE_MODULE;
233
+ recorded[finding.id] = {
234
+ finding_id: finding.id,
235
+ determined: true,
236
+ disposition: verdict.disposition,
237
+ evidence: verdict.evidence,
238
+ };
239
+ }
240
+ return { ran: true, head, base, recorded, withheld };
241
+ }
242
+ //# sourceMappingURL=closeVerifyHeadEvidence.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"closeVerifyHeadEvidence.js","sourceRoot":"","sources":["../../../src/remediate/phases/closeVerifyHeadEvidence.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,4BAA4B,EAC5B,sBAAsB,EACtB,WAAW,GACZ,MAAM,oBAAoB,CAAC;AAsJ5B,MAAM,KAAK,GAAwB;IACjC,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;IACV,QAAQ,EAAE,EAAE;IACZ,QAAQ,EAAE,EAAE;CACb,CAAC;AAEF,uFAAuF;AACvF,MAAM,CAAC,MAAM,oBAAoB,GAAG,yBAAyB,CAAC;AAE9D;;;;;;;GAOG;AACH,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAE3B,6FAA6F;AAC7F,SAAS,SAAS,CAAC,OAAgB;IACjC,KAAK,MAAM,QAAQ,IAAI,OAAO,CAAC,cAAc,IAAI,EAAE,EAAE,CAAC;QACpD,MAAM,MAAM,GAAG,QAAQ,CAAC,WAAW,CAAC;QACpC,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC3D,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC;QACzC,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,uFAAuF;AACvF,SAAS,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AyB,EAAE,CAAC;IAC1C,KAAK,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,UAAU,EAAE,CAAC;QAC3C,MAAM,OAAO,GAAG,MAAM,SAAS,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC;QAClF,IAAI,UAAU,IAAI,OAAO,EAAE,CAAC;YAC1B,QAAQ,CAAC,IAAI,CAAC;gBACZ,UAAU,EAAE,OAAO,CAAC,EAAE;gBACtB,UAAU,EAAE,KAAK;gBACjB,MAAM,EAAE,OAAO,CAAC,QAAQ;aACzB,CAAC,CAAC;YACH,SAAS;QACX,CAAC;QACD,IAAI,CAAC,oBAAoB,GAAG,OAAO,CAAC,WAAW,CAAC;QAChD,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QACjC,IAAI,CAAC,kBAAkB,GAAG,oBAAoB,CAAC;QAC/C,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG;YACrB,UAAU,EAAE,OAAO,CAAC,EAAE;YACtB,UAAU,EAAE,IAAI;YAChB,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,QAAQ,EAAE,OAAO,CAAC,QAAQ;SAC3B,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;AACvD,CAAC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * The single authority for the `RemediationState` RUN status lifecycle.
3
+ *
4
+ * `RemediationState.status` is the canonical coarse phase of a remediation run;
5
+ * the load gate (`validateState` in `./store.ts`) admits exactly these values
6
+ * and the run-status invariant test asserts against this array. Nothing outside
7
+ * this module may re-enumerate them.
8
+ *
9
+ * Why this module exists. The vocabulary used to exist in three unlinked
10
+ * copies: the inline union on `RemediationState.status`, the module-private
11
+ * accepted-status Set the load gate rejects unknown states with, and a third
12
+ * literal written inside the test. Nothing joined them, so the load gate
13
+ * and the type could drift apart with no red build — and the assertion
14
+ * ("`documenting` is not a status") was a tautology over a literal the test
15
+ * itself wrote, so a `documenting` status reintroduced into the type would have
16
+ * passed it silently. The array below is the ONE declaration; the type, the
17
+ * load gate and the test all derive from it. [[write-only-data-looks-authoritative]]
18
+ *
19
+ * Deliberately mirrors `ITEM_STATUSES` in `./itemStatus.ts` (a `const` tuple
20
+ * plus a derived union type) so the two halves of remediation state read the
21
+ * same way.
22
+ */
23
+ /**
24
+ * Every status a remediation RUN can hold, in lifecycle order.
25
+ *
26
+ * `documenting` is deliberately absent: the document phase was dissolved, and
27
+ * planning transitions DIRECTLY to implementing. Adding it back is a red — see
28
+ * the run-status invariant test, which reads this array rather than restating
29
+ * it.
30
+ */
31
+ export declare const REMEDIATION_RUN_STATUSES: readonly ["pending", "planning", "waiting_for_clarification", "implementing", "triage", "waiting_for_triage", "closing", "complete"];
32
+ export type RemediationRunStatus = (typeof REMEDIATION_RUN_STATUSES)[number];
33
+ /** Runtime membership test for the load gate — derived, never re-listed. */
34
+ export declare function isRemediationRunStatus(value: unknown): value is RemediationRunStatus;
35
+ //# sourceMappingURL=runStatus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runStatus.d.ts","sourceRoot":"","sources":["../../../src/remediate/state/runStatus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,sIAS3B,CAAC;AAEX,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7E,4EAA4E;AAC5E,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,oBAAoB,CAKpF"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * The single authority for the `RemediationState` RUN status lifecycle.
3
+ *
4
+ * `RemediationState.status` is the canonical coarse phase of a remediation run;
5
+ * the load gate (`validateState` in `./store.ts`) admits exactly these values
6
+ * and the run-status invariant test asserts against this array. Nothing outside
7
+ * this module may re-enumerate them.
8
+ *
9
+ * Why this module exists. The vocabulary used to exist in three unlinked
10
+ * copies: the inline union on `RemediationState.status`, the module-private
11
+ * accepted-status Set the load gate rejects unknown states with, and a third
12
+ * literal written inside the test. Nothing joined them, so the load gate
13
+ * and the type could drift apart with no red build — and the assertion
14
+ * ("`documenting` is not a status") was a tautology over a literal the test
15
+ * itself wrote, so a `documenting` status reintroduced into the type would have
16
+ * passed it silently. The array below is the ONE declaration; the type, the
17
+ * load gate and the test all derive from it. [[write-only-data-looks-authoritative]]
18
+ *
19
+ * Deliberately mirrors `ITEM_STATUSES` in `./itemStatus.ts` (a `const` tuple
20
+ * plus a derived union type) so the two halves of remediation state read the
21
+ * same way.
22
+ */
23
+ /**
24
+ * Every status a remediation RUN can hold, in lifecycle order.
25
+ *
26
+ * `documenting` is deliberately absent: the document phase was dissolved, and
27
+ * planning transitions DIRECTLY to implementing. Adding it back is a red — see
28
+ * the run-status invariant test, which reads this array rather than restating
29
+ * it.
30
+ */
31
+ export const REMEDIATION_RUN_STATUSES = [
32
+ "pending",
33
+ "planning",
34
+ "waiting_for_clarification",
35
+ "implementing",
36
+ "triage",
37
+ "waiting_for_triage",
38
+ "closing",
39
+ "complete",
40
+ ];
41
+ /** Runtime membership test for the load gate — derived, never re-listed. */
42
+ export function isRemediationRunStatus(value) {
43
+ return (typeof value === "string" &&
44
+ REMEDIATION_RUN_STATUSES.includes(value));
45
+ }
46
+ //# sourceMappingURL=runStatus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runStatus.js","sourceRoot":"","sources":["../../../src/remediate/state/runStatus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,SAAS;IACT,UAAU;IACV,2BAA2B;IAC3B,cAAc;IACd,QAAQ;IACR,oBAAoB;IACpB,SAAS;IACT,UAAU;CACF,CAAC;AAIX,4EAA4E;AAC5E,MAAM,UAAU,sBAAsB,CAAC,KAAc;IACnD,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACxB,wBAA8C,CAAC,QAAQ,CAAC,KAAK,CAAC,CAChE,CAAC;AACJ,CAAC"}
@@ -1,6 +1,47 @@
1
+ import { SKIP_WRITE } from "audit-tools/shared";
1
2
  import { RemediationPlan, RemediationItemState, ClarificationRequest, ClosingPlan, CoverageLedger, RemediationHostHandoffRecord } from "./types.js";
3
+ import { type RemediationRunStatus } from "./runStatus.js";
4
+ /**
5
+ * The schema version stamped on every persisted `state.json`.
6
+ *
7
+ * The VALUE is unchanged from the literal three modules already spelled out
8
+ * (the host-handoff parser, the state-shaping helper in `nextStep.ts`, and the
9
+ * test fixtures). What changes is that it is now ONE declaration that the store
10
+ * actually writes and reads back, rather than a constant a reader FABRICATED
11
+ * onto the loaded value to satisfy its own parser — see `parseCurrentState`'s
12
+ * call site in `steps/dispatch/hostHandoff.ts`. An identity that the reader
13
+ * supplies itself is not a check; it is the check's answer written in advance.
14
+ *
15
+ * A run's state is COSTLY / AUTHORED state in the sense
16
+ * `audit-tools/shared/io/schemaVersion.ts` names: it records work an operator
17
+ * or a host has already done, and it cannot be rebuilt from anything else on
18
+ * disk. That module's policy is therefore THROW on a mismatch — silently
19
+ * discarding a state would read as "this run never started" and destroy the
20
+ * plan, the item ledger and every recorded acceptance with it.
21
+ *
22
+ * ABSENT IS NOT A MISMATCH, and the distinction is deliberate here rather than
23
+ * inherited. Every run already in flight when this field was introduced has a
24
+ * `state.json` with no `contract_version`; treating its absence as a mismatch
25
+ * would refuse to load exactly the runs this field exists to protect. An
26
+ * unstamped state is read under the CURRENT version's semantics (it was written
27
+ * by a release whose shape this one still admits — that is what makes the field
28
+ * safe to add), and the next write stamps it. A stamped-but-DIFFERENT version
29
+ * is the case that throws, because at that point the file positively claims
30
+ * another release's semantics rather than merely predating the field.
31
+ *
32
+ * Same asymmetry as `intent_checkpoint` (absent ⇒ nothing to check; present
33
+ * and different ⇒ refuse loudly), inverted for a version that is newly added
34
+ * rather than newly REQUIRED.
35
+ */
36
+ export declare const REMEDIATION_STATE_CONTRACT_VERSION: "remediate-code-state/v1alpha1";
2
37
  export interface RemediationState {
3
- status: "pending" | "planning" | "waiting_for_clarification" | "implementing" | "triage" | "waiting_for_triage" | "closing" | "complete";
38
+ /**
39
+ * Schema version of this persisted state. Optional on the TYPE because a
40
+ * state written before the field existed is a legal input; see
41
+ * {@link REMEDIATION_STATE_CONTRACT_VERSION} for how it reads.
42
+ */
43
+ contract_version?: typeof REMEDIATION_STATE_CONTRACT_VERSION;
44
+ status: RemediationRunStatus;
4
45
  plan?: RemediationPlan;
5
46
  items?: Record<string, RemediationItemState>;
6
47
  clarifications?: ClarificationRequest[];
@@ -86,8 +127,17 @@ export declare class StateStore {
86
127
  * current state (or null), passes it to `fn`, and writes the returned state
87
128
  * before releasing the lock. No other holder can interleave between the load
88
129
  * and the save. INV-remediate-state-02 + INV-remediate-state-03.
130
+ *
131
+ * Returning the shared `SKIP_WRITE` sentinel from `fn` is the no-op: the write
132
+ * is skipped and this resolves with the state that was READ. The skip decision
133
+ * is taken inside the SAME held lock as the write it avoids, so it cannot race
134
+ * a concurrent writer. Whole-run verbs that routinely change nothing — the
135
+ * `recover-ingest` retry loop is the live one — otherwise replace `state.json`
136
+ * with byte-identical content on every pass, which makes "did anything
137
+ * change?" unanswerable from the file and rewrites an artifact other readers
138
+ * treat as the run's ground truth.
89
139
  */
90
- mutate(fn: (current: RemediationState | null) => Promise<RemediationState>): Promise<RemediationState>;
140
+ mutate(fn: (current: RemediationState | null) => Promise<RemediationState | typeof SKIP_WRITE>): Promise<RemediationState>;
91
141
  /**
92
142
  * Save state.json unconditionally (no TOCTOU protection, no read — so a
93
143
  * corrupt on-disk state never blocks recovery). Prefer `mutate` for
@@ -1 +1 @@
1
- {"version":3,"file":"store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