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
@@ -19,9 +19,12 @@
19
19
  // INV-RS-10: the final completion gate is a TOOL-OWNED, NON-VACUOUS suite that
20
20
  // is INDEPENDENT of any `plan.test_command`. A run can only land green when this
21
21
  // suite passes; a vacuous/unset `plan.test_command` can never substitute for it.
22
- // The suite is executed through the env-scrubbing `runTracked`, which strips
23
- // CLAUDECODE / CLAUDE_CODE_* so the gate runs in a clean environment
24
- // regardless of the host session.
22
+ // The suite is executed through the env-scrubbing `runTracked` (the async twin),
23
+ // whose `stripAuditToolsControlEnv` drops exactly ONE variable —
24
+ // `AUDIT_TOOLS_CALLER_CWD`, the wrapper's one-hop caller-cwd stamp. It does NOT
25
+ // strip CLAUDECODE / CLAUDE_CODE_*, so the gate's environment is the host's; what
26
+ // the scrub guarantees is that a child cannot read the parent's location as its
27
+ // own, not that the child is session-free.
25
28
  //
26
29
  // Hard floor (always run, in order — single package, single-flight build — CE-001):
27
30
  // 1. npm run build (one tsc build for the whole package)
@@ -38,8 +41,12 @@
38
41
  // gate must converge deterministically, so they are surfaced for a separate
39
42
  // pass instead of being able to strand the run.
40
43
  import { join } from "node:path";
41
- import { writeJsonFile, runTracked } from "audit-tools/shared";
42
- import { isAuditToolsMonorepo, toolOwnedFinalGateCommands, } from "./gateCommands.js";
44
+ import { discardOnSchemaVersionMismatch, readOptionalJsonFile, writeJsonFile, runTrackedAsync, } from "audit-tools/shared";
45
+ // Deep import: the CDC-25-era exports of the shared outcome contract are not yet
46
+ // re-exported through the `audit-tools/shared` barrel (outside this work item's
47
+ // allowed_files) — the same note `close.ts` and `state/types.ts` carry.
48
+ import { carriesGateVerdict, } from "../../shared/types/remediationOutcome.js";
49
+ import { attributeGateRed, isAuditToolsMonorepo, toolOwnedFinalGateCommands, } from "./gateCommands.js";
43
50
  // `FinalGateCommandSpec`, `isAuditToolsMonorepo`, and `toolOwnedFinalGateCommands`
44
51
  // are single-sourced in the leaf module `gateCommands.ts` (so `dispatch.ts` can
45
52
  // derive the same pinned merged-base check without an import cycle). Imported
@@ -60,22 +67,32 @@ function outputTail(value) {
60
67
  ? text
61
68
  : `…${text.slice(text.length - GATE_OUTPUT_TAIL_LIMIT)}`;
62
69
  }
70
+ /**
71
+ * The runtime/packaging surface the hard floor does NOT gate (CE-002), declared
72
+ * as a residual for a separate pass. A CONSTANT rather than a literal built per
73
+ * run, because a verdict served from the cache has to carry the same declaration
74
+ * a fresh run would — the residual is a property of the floor, not of the
75
+ * evaluation that happened to observe it.
76
+ */
77
+ export const RUNTIME_RESIDUAL_DECLARATION = {
78
+ surface: "runtime/packaged-bin smokes (verify:release)",
79
+ commands: [
80
+ "npm run smoke:packaged-audit-code",
81
+ "npm run smoke:packaged-remediate-code",
82
+ ],
83
+ };
63
84
  /**
64
85
  * Run the tool-owned final gate (INV-RS-10). Each command runs through the
65
- * shared `runTracked`, which scrubs CLAUDECODE / CLAUDE_CODE_*.
86
+ * shared async `runTrackedAsync`, which scrubs the wrapper's
87
+ * `AUDIT_TOOLS_CALLER_CWD` stamp (and nothing else — see `finalGate.ts`'s file
88
+ * header; the host's session variables reach the child unchanged).
66
89
  * The first failing command short-circuits the floor (a broken build makes the
67
90
  * later layers meaningless). A `runner` may be injected for tests. When the
68
91
  * audit-tools suite does not apply (non-monorepo target), the gate is
69
92
  * `scoped_out` (does not block) rather than vacuously passing.
70
93
  */
71
94
  export async function runToolOwnedFinalGate(root, opts = {}) {
72
- const runtime_residual = {
73
- surface: "runtime/packaged-bin smokes (verify:release)",
74
- commands: [
75
- "npm run smoke:packaged-audit-code",
76
- "npm run smoke:packaged-remediate-code",
77
- ],
78
- };
95
+ const runtime_residual = RUNTIME_RESIDUAL_DECLARATION;
79
96
  const commands = toolOwnedFinalGateCommands(root);
80
97
  if (commands.length === 0) {
81
98
  // Audit-tools-specific suite does not apply here — declared scope, not a
@@ -92,24 +109,32 @@ export async function runToolOwnedFinalGate(root, opts = {}) {
92
109
  };
93
110
  }
94
111
  const runner = opts.runner ??
95
- ((argv, cwd, packageDir) => {
112
+ (async (argv, cwd, packageDir) => {
96
113
  const [command, ...args] = argv;
97
114
  // Package-scoped unit suites run with cwd at the package (no `npm -w`); the
98
115
  // monorepo-root build/check commands run at the repo root.
99
116
  const effectiveCwd = packageDir ? join(root, packageDir) : cwd;
100
- // runTracked strips CLAUDECODE / CLAUDE_CODE_* (INV-RS-10).
101
- const result = runTracked([command, ...args], {
117
+ // runTrackedAsync strips AUDIT_TOOLS_CALLER_CWD, the wrapper's one-hop
118
+ // caller-cwd stamp (INV-RS-10) — it does not clear the host session's
119
+ // own variables, and this comment used to claim it did.
120
+ //
121
+ // ASYNC, and this one is a liveness requirement rather than a style
122
+ // choice. The phase-boundary gate runs INLINE inside `advanceUnderPhaseLock`,
123
+ // with `<artifactsDir>/phase.lock` HELD, and the floor's unit leg is a whole
124
+ // vitest run — minutes. A synchronous child blocks the event loop for its
125
+ // entire duration, so the lock's `setInterval` mtime heartbeat cannot fire
126
+ // and a LIVE lock reads as stale to the next acquirer, which steals it out
127
+ // from under the run mid-gate (the CP-NODE-5 lock-hazard class; the same
128
+ // reason every closing spawn is awaited). Awaiting keeps the loop turning
129
+ // for the whole suite.
130
+ const result = await runTrackedAsync([command, ...args], {
102
131
  cwd: effectiveCwd,
103
- stdio: ["ignore", "pipe", "pipe"],
104
- // Declared bound (required by the sync twin): full suites legitimately
105
- // run minutes; one hour is a bound, not a budget. This runner executes
106
- // outside any held file lock, so the bound guards only against a child
107
- // that never exits.
132
+ // Declared bound: full suites legitimately run minutes; one hour is a
133
+ // bound, not a budget — it guards only against a child that never exits.
108
134
  timeout: 3_600_000,
109
135
  });
110
- // `runTracked` has always returned the captured streams; this used to read
111
- // `status` alone and discard them, which is why a red gate persisted
112
- // nothing an operator could read.
136
+ // The captured streams are returned, not just the status: a red gate that
137
+ // persisted nothing an operator could read was the defect this carries.
113
138
  return {
114
139
  status: result.status,
115
140
  stdout: result.stdout,
@@ -119,7 +144,9 @@ export async function runToolOwnedFinalGate(root, opts = {}) {
119
144
  const results = [];
120
145
  let passed = true;
121
146
  for (const spec of commands) {
122
- const { status, stdout, stderr } = runner(spec.argv, root, spec.package_dir);
147
+ // `await` is correct for an injected synchronous runner too — awaiting a
148
+ // non-promise yields the value unchanged — so a stub needs no migration.
149
+ const { status, stdout, stderr } = await runner(spec.argv, root, spec.package_dir);
123
150
  const cmdPassed = status === 0;
124
151
  const stdoutTail = cmdPassed ? undefined : outputTail(stdout);
125
152
  const stderrTail = cmdPassed ? undefined : outputTail(stderr);
@@ -147,6 +174,8 @@ export async function runToolOwnedFinalGate(root, opts = {}) {
147
174
  }
148
175
  const FINAL_GATE_STATE_FILENAME = "final-gate.json";
149
176
  const FINAL_GATE_OUTCOME_FILENAME = "final-gate-outcome.json";
177
+ const FINAL_GATE_VERDICT_FILENAME = "final-gate-verdict.json";
178
+ const FINAL_GATE_VERDICT_VERSION = "remediate-code-final-gate-verdict/v1alpha1";
150
179
  /**
151
180
  * Where the failing gate run is recorded, relative to the artifacts dir. The
152
181
  * step prompt carries this PATH and the failing command line — never the tail
@@ -165,6 +194,66 @@ export function finalGateRecordPath(artifactsDir) {
165
194
  export function finalGateOutcomePath(artifactsDir) {
166
195
  return join(artifactsDir, FINAL_GATE_OUTCOME_FILENAME);
167
196
  }
197
+ /**
198
+ * Where the {@link FinalGateVerdictRecord} lives. ONE file, overwritten: it
199
+ * describes the LAST evaluation, and a run has one boundary at a time. Never a
200
+ * history — an accumulating cache would grow a log nothing reads.
201
+ */
202
+ export function finalGateVerdictPath(artifactsDir) {
203
+ return join(artifactsDir, FINAL_GATE_VERDICT_FILENAME);
204
+ }
205
+ /**
206
+ * Read the cached verdict for `scope`, or `undefined` when there is none to
207
+ * serve: absent, unreadable, unparseable, written by a different record version,
208
+ * for a different scope, or about a different (or unknown) tree.
209
+ *
210
+ * Every one of those degrades to "run the floor", which is the safe direction —
211
+ * a cache miss costs a gate run, a false hit certifies a tree nobody checked.
212
+ * Never throws.
213
+ */
214
+ export async function readFinalGateVerdict(artifactsDir, scope, tree) {
215
+ if (tree === null)
216
+ return undefined;
217
+ const raw = await readOptionalJsonFile(finalGateVerdictPath(artifactsDir)).catch(() => undefined);
218
+ const record = discardOnSchemaVersionMismatch(raw, FINAL_GATE_VERDICT_VERSION);
219
+ if (record === undefined || record === null)
220
+ return undefined;
221
+ if (record.scope !== scope)
222
+ return undefined;
223
+ if (record.tree === null || record.tree !== tree)
224
+ return undefined;
225
+ if (!Array.isArray(record.results))
226
+ return undefined;
227
+ return record;
228
+ }
229
+ /**
230
+ * Record a gate verdict against the tree it was reached on. Overwrites.
231
+ *
232
+ * TWO ARTIFACTS, ONE ANSWER: the caller writes {@link writeFinalGateOutcomeRecord}
233
+ * from the same values, so the outcome artifact and this cache can never disagree
234
+ * about whether a floor ran and what it said.
235
+ */
236
+ export async function writeFinalGateVerdict(artifactsDir, verdict) {
237
+ const path = finalGateVerdictPath(artifactsDir);
238
+ const record = {
239
+ schema_version: FINAL_GATE_VERDICT_VERSION,
240
+ scope: verdict.scope,
241
+ tree: verdict.tree,
242
+ passed: verdict.passed,
243
+ scoped_out: verdict.scoped_out,
244
+ outcome: verdict.outcome,
245
+ results: verdict.results,
246
+ recorded_at: new Date().toISOString(),
247
+ };
248
+ try {
249
+ await writeJsonFile(path, record);
250
+ }
251
+ catch {
252
+ // Best-effort in the same direction the read is safe: a verdict that cannot
253
+ // be persisted costs the NEXT call a re-run, and never corrupts this one.
254
+ }
255
+ return path;
256
+ }
168
257
  /**
169
258
  * Record what a gate evaluation was. Overwrites: the file describes the CURRENT
170
259
  * gate state of the run, the same way {@link writeFinalGateRedRecord} does for a
@@ -176,7 +265,7 @@ export function finalGateOutcomePath(artifactsDir) {
176
265
  */
177
266
  export async function writeFinalGateOutcomeRecord(artifactsDir, outcome) {
178
267
  const path = finalGateOutcomePath(artifactsDir);
179
- const ran = outcome.outcome === "executed";
268
+ const ran = carriesGateVerdict(outcome.outcome);
180
269
  const record = {
181
270
  schema_version: "remediate-code-final-gate-outcome/v1alpha1",
182
271
  scope: outcome.scope,
@@ -193,9 +282,27 @@ export async function writeFinalGateOutcomeRecord(artifactsDir, outcome) {
193
282
  * Record the failing command of a red gate run. Overwrites: the file describes
194
283
  * the CURRENT reason the run is paused, and a repeat next-step that still finds
195
284
  * the suite red rewrites it rather than accumulating a history nothing reads.
285
+ *
286
+ * `root` and `state` are what attribution reads; both are optional so a caller
287
+ * that has no state (or a test asserting the record's shape alone) still gets a
288
+ * valid record, degraded to no attribution rather than a refusal. The tail that
289
+ * is SCANNED is the same tail that is PERSISTED — never the whole suite log,
290
+ * which the record deliberately does not carry.
196
291
  */
197
- export async function writeFinalGateRedRecord(artifactsDir, scope, failed) {
292
+ export async function writeFinalGateRedRecord(artifactsDir, scope, failed, attributionInput) {
198
293
  const path = finalGateRecordPath(artifactsDir);
294
+ let attribution;
295
+ if (attributionInput && failed) {
296
+ // Never let the diagnostic take down the gate: attribution is derived from
297
+ // git and the filesystem, and a red gate on a broken tree is exactly when
298
+ // those can misbehave. A failure to attribute is "no verdict", not a throw
299
+ // that replaces the red record with a crash.
300
+ attribution = await attributeGateRed({
301
+ root: attributionInput.root,
302
+ state: attributionInput.state,
303
+ output: `${failed.stdout_tail ?? ""}\n${failed.stderr_tail ?? ""}`,
304
+ }).catch(() => undefined);
305
+ }
199
306
  const record = {
200
307
  schema_version: "remediate-code-final-gate/v1alpha1",
201
308
  scope,
@@ -209,6 +316,7 @@ export async function writeFinalGateRedRecord(artifactsDir, scope, failed) {
209
316
  ...(failed?.stderr_tail === undefined
210
317
  ? {}
211
318
  : { stderr_tail: failed.stderr_tail }),
319
+ ...(attribution === undefined ? {} : { attribution }),
212
320
  };
213
321
  await writeJsonFile(path, record);
214
322
  return path;
@@ -1 +1 @@
1
- {"version":3,"file":"finalGate.js","sourceRoot":"","sources":["../../../src/remediate/steps/finalGate.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,+CAA+C;AAC/C,8EAA8E;AAC9E,EAAE;AACF,8EAA8E;AAC9E,gFAAgF;AAChF,8EAA8E;AAC9E,6EAA6E;AAC7E,8EAA8E;AAC9E,uEAAuE;AACvE,EAAE;AACF,wEAAwE;AACxE,+EAA+E;AAC/E,8EAA8E;AAC9E,+EAA+E;AAC/E,gFAAgF;AAChF,gDAAgD;AAChD,EAAE;AACF,+EAA+E;AAC/E,iFAAiF;AACjF,iFAAiF;AACjF,6EAA6E;AAC7E,qEAAqE;AACrE,kCAAkC;AAClC,EAAE;AACF,oFAAoF;AACpF,oFAAoF;AACpF,mEAAmE;AACnE,iFAAiF;AACjF,+BAA+B;AAC/B,sGAAsG;AACtG,0CAA0C;AAC1C,EAAE;AACF,oEAAoE;AACpE,+EAA+E;AAC/E,+EAA+E;AAC/E,iFAAiF;AACjF,4EAA4E;AAC5E,gDAAgD;AAEhD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAK/D,OAAO,EACL,oBAAoB,EACpB,0BAA0B,GAE3B,MAAM,mBAAmB,CAAC;AAE3B,mFAAmF;AACnF,gFAAgF;AAChF,8EAA8E;AAC9E,oFAAoF;AACpF,OAAO,EAAE,oBAAoB,EAAE,0BAA0B,E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AE,MAAM,CAAC,CAAC;IAClC,OAAO,IAAI,CAAC;AACd,CAAC"}
1
+ {"version":3,"file":"finalGate.js","sourceRoot":"","sources":["../../../src/remediate/steps/finalGate.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,+CAA+C;AAC/C,8EAA8E;AAC9E,EAAE;AACF,8EAA8E;AAC9E,gFAAgF;AAChF,8EAA8E;AAC9E,6EAA6E;AAC7E,8EAA8E;AAC9E,uEAAuE;AACvE,EAAE;AACF,wEAAwE;AACxE,+EAA+E;AAC/E,8EAA8E;AAC9E,+EAA+E;AAC/E,gFAAgF;AAChF,gDAAgD;AAChD,EAAE;AACF,+EAA+E;AAC/E,iFAAiF;AACjF,iFAAiF;AACjF,iFAAiF;AACjF,iEAAiE;AACjE,gFAAgF;AAChF,kFAAkF;AAClF,gFAAgF;AAChF,2CAA2C;AAC3C,EAAE;AACF,oFAAoF;AACpF,oFAAoF;AACpF,mEAAmE;AACnE,iFAAiF;AACjF,+BAA+B;AAC/B,sGAAsG;AACtG,0CAA0C;AAC1C,EAAE;AACF,oEAAoE;AACpE,+EAA+E;AAC/E,+EAA+E;AAC/E,iFAAiF;AACjF,4EAA4E;AAC5E,gDAAgD;AAEhD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EACL,8BAA8B,EAC9B,oBAAoB,EACpB,aAAa,EACb,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAC5B,iFAAiF;AACjF,gFAAgF;AAChF,wEAAwE;AACxE,OAAO,EACL,kBAAkB,GAEnB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,0BAA0B,GAI3B,MAAM,mBAAmB,CAAC;AAE3B,mFAAmF;AACnF,gFAAgF;AAChF,8EAA8E;AAC9E,oFAAoF;AACpF,OAAO,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,CAAC;AAiG5D;;;;;GAKG;AACH,MAAM,sBAAsB,GAAG,KAAK,CA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G,MAAM,gBAAgB,CAAC;YACnC,IAAI,EAAE,gBAAgB,CAAC,IAAI;YAC3B,KAAK,EAAE,gBAAgB,CAAC,KAAK;YAC7B,MAAM,EAAE,GAAG,MAAM,CAAC,WAAW,IAAI,EAAE,KAAK,MAAM,CAAC,WAAW,IAAI,EAAE,EAAE;SACnE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IAC5B,CAAC;IACD,MAAM,MAAM,GAAuB;QACjC,cAAc,EAAE,oCAAoC;QACpD,KAAK;QACL,WAAW,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACrC,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,wBAAwB;QAC1E,SAAS,EAAE,MAAM,EAAE,SAAS,IAAI,IAAI;QACpC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,IAAI;QAC5B,GAAG,CAAC,MAAM,EAAE,WAAW,KAAK,SAAS;YACnC,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,CAAC;QACxC,GAAG,CAAC,MAAM,EAAE,WAAW,KAAK,SAAS;YACnC,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,CAAC;QACxC,GAAG,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC;KACtD,CAAC;IACF,MAAM,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAClC,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -24,6 +24,173 @@ export interface FinalGateCommandSpec {
24
24
  * one). A tree that cannot run the suite is OUT of scope, not failing it.
25
25
  */
26
26
  export declare function isAuditToolsMonorepo(root: string): boolean;
27
+ /**
28
+ * The slice of remediation state red attribution reads. Declared structurally
29
+ * rather than imported so this leaf module keeps its position outside the state
30
+ * module's import graph — `dispatch.ts` and `nextStep.ts` both import it, and
31
+ * `nextStep.ts` owns the state type (the same reason the command spec lives
32
+ * here at all).
33
+ *
34
+ * `run_baseline_diff` is the one member that is NOT a persisted field: the gate
35
+ * derives it from `root` beside the state and hands it over on the same object,
36
+ * so there is exactly one shape flowing into {@link attributeGateRed} rather than
37
+ * a state argument and a loose path array that can drift apart.
38
+ */
39
+ export interface RemediationGateState {
40
+ /** The union of every landed host result's corroborated changed-file set. */
41
+ applied_edit_surface?: readonly string[];
42
+ /** Paths dirty at run start — pre-existing dirt the run cannot own. */
43
+ run_start_dirty?: readonly string[];
44
+ /** Paths dirty relative to the run-start baseline (derived at the gate). */
45
+ run_baseline_diff?: readonly string[];
46
+ }
47
+ /**
48
+ * How many failing paths a red record names. Bounded like the output tails
49
+ * beside it: this lands in a durable artifact a prompt POINTS AT, and a red on a
50
+ * badly broken tree can implicate hundreds of files. The COUNT is always
51
+ * recorded; only the sample is capped.
52
+ */
53
+ export declare const GATE_ATTRIBUTION_SAMPLE_LIMIT = 20;
54
+ /** The attribution verdict carried on a red gate record. */
55
+ export interface GateRedAttribution {
56
+ /**
57
+ * `run` — at least one failing path is one the run itself touched.
58
+ * `environment` — a non-empty failing set of NON-TEST paths, none of which the
59
+ * run touched: the dirt is not this run's doing. FAIL-CLOSED
60
+ * on the test-file case — see {@link isTestFilePath}: a red
61
+ * located in a test file names a path a run edits source and
62
+ * never touches, so it can never be the evidence that excuses
63
+ * the run.
64
+ * `unattributable` — no failing path could be harvested (the command failed
65
+ * before naming files), the run touched nothing, or every
66
+ * failing path is a test file with no overlap. Stated as its
67
+ * own value rather than folded into either side: "no evidence"
68
+ * is not "evidence of innocence", and the predecessor's whole
69
+ * failure was GUESSING which of the two an unattributable red
70
+ * was.
71
+ */
72
+ verdict: "run" | "environment" | "unattributable";
73
+ /** The run-touched paths the gate could derive, normalized and sorted. */
74
+ run_paths_considered: string[];
75
+ /** Failing paths that ARE in the run's touched set (capped, sorted). */
76
+ run_paths: string[];
77
+ /** Failing paths that are NOT (capped, sorted) — present when the verdict is `environment`. */
78
+ foreign_paths: string[];
79
+ /** How many failing paths were harvested in total, before the sample cap. */
80
+ failing_paths_count: number;
81
+ /** How the paths were read — the honest label for the derivation below. */
82
+ source: "diff-against-run-start-baseline" | "none";
83
+ }
84
+ /**
85
+ * Whether `path` is a TEST file — a file a suite RUNS rather than one the run
86
+ * was asked to WRITE.
87
+ *
88
+ * This is not a heuristic about importance; it is the boundary of the edit
89
+ * surface. A remediation run edits source, and a test file it did not edit
90
+ * cannot have been broken by it — but a suite that fails PRINTS the failing
91
+ * test file, so every red whose failure is located in a test names a path the
92
+ * run never touched. {@link attributeGateRed} intersects the printed paths with
93
+ * the run's touched set, so without this the intersection is empty and the
94
+ * verdict is `environment` — the fail-OPEN answer that tells the host to skip
95
+ * work it owes. A test red is therefore never `environment`.
96
+ *
97
+ * Language-neutral by construction: `*.test.*` / `*.spec.*` (JS/TS/Ruby/Python
98
+ * variants) and the `test` / `tests` / `__tests__` segment conventions. A
99
+ * language this misses degrades to the safe direction — an unrecognised test
100
+ * file is treated as source, so the red attributes to the RUN.
101
+ */
102
+ export declare function isTestFilePath(path: string): boolean;
103
+ /**
104
+ * The CONTENT identity of the working tree — what a gate verdict is valid for.
105
+ *
106
+ * The property it serves: a verdict is about a TREE, so re-running a 2–5 minute
107
+ * whole-repo floor against a tree that has not changed since the last verdict is
108
+ * pure waste (the backlog entry: "the phase-boundary repository gate re-runs on
109
+ * EVERY next-step at the boundary … it runs once per boundary and its verdict is
110
+ * cached against the tree hash"). Two runs over identical content against an
111
+ * identical environment cannot disagree, so the second one is redundant.
112
+ *
113
+ * DERIVED BY GIT, from the bytes, through a TEMPORARY index: `GIT_INDEX_FILE`
114
+ * points into the run's scratch, `git read-tree HEAD` seeds it, `git add -A`
115
+ * writes the working tree into it, and `git write-tree` returns ONE tree id.
116
+ * (Same plumbing as `scripts/shared/worktree-tree.mjs`, the repo's prior art for
117
+ * this identity — reproduced here rather than imported, because that module is a
118
+ * build-time script and this is shipped code.)
119
+ *
120
+ * WHY NOT A HAND-ROLLED DIGEST. The predecessor read each dirty path itself
121
+ * through `normalizeRepoPath` — a lower-casing COMPARISON key — so on a
122
+ * case-sensitive checkout two different contents of `src/auditStep.ts` hashed to
123
+ * the same id, and a git-quoted non-ASCII path was dropped outright on win32.
124
+ * Both are silent: the id still looks like an id, and a collision serves a
125
+ * verdict for a tree nobody judged. `git write-tree` cannot have either failure,
126
+ * because git never re-derives the path from a comparison key — it hashes the
127
+ * bytes it hashed before.
128
+ *
129
+ * TWO CARVE-OUTS, both because the gate would otherwise invalidate its own
130
+ * verdict the instant it was written:
131
+ * • IGNORED FILES stay out, by construction — `git add -A` honors .gitignore
132
+ * exactly as a commit would. `dist/` is a build OUTPUT the gate's own build
133
+ * leg rewrites, and `.audit-tools/` is this repo's ignored scratch, so
134
+ * keying on either makes every verdict one-shot.
135
+ * • {@link RUN_SCRATCH_PREFIX} is subtracted explicitly, for the case where
136
+ * the run's artifacts dir is NOT ignored in the target repository (an
137
+ * artifacts dir outside a repo whose .gitignore knows about it). Same reason
138
+ * red attribution exempts it: the step contract, the run log and state.json
139
+ * are rewritten by the very call that reaches the gate, so an un-exempted
140
+ * scratch would move the tree on every call and the cache could never hit.
141
+ *
142
+ * The residual that follows, stated where the cache is read as well: an
143
+ * out-of-tree change (a dependency install, an environment change) under
144
+ * unchanged content is NOT detected, and neither is a change confined to ignored
145
+ * files or to the run's own scratch.
146
+ *
147
+ * `null` is "cannot tell" — not a repository, no HEAD yet, or any step of the
148
+ * plumbing failing for any reason. A PARTIAL id is never returned: half an
149
+ * identity is worse than none, because it would still be a key. Callers must
150
+ * treat `null` as NO IDENTITY: never as a cache key, and never as a match.
151
+ * Never throws; a gate must not fail on the diagnostic it was deriving.
152
+ */
153
+ export declare function worktreeContentId(root: string): Promise<string | null>;
154
+ /**
155
+ * Attribute a red gate to the run or to the environment (the backlog entry:
156
+ * "a gate red is attributed to run-touched paths where possible, so foreign
157
+ * live-tree dirt reports as environment rather than as the run's failure").
158
+ *
159
+ * The gate itself stays whole-repo and non-mutating — this ADDS a verdict to the
160
+ * record and never changes what the run does with it. Nothing is re-opened, no
161
+ * item moves, and the pause is exactly as resumable as before.
162
+ *
163
+ * `run_start_dirty` is excluded from the run's own set on purpose: dirt that
164
+ * predates the run cannot be the run's edit. Same rule, same reason, as
165
+ * `resolveEditSurfaceManifest`. It is folded in here only to produce
166
+ * `run_paths_considered` when the edit surface is empty.
167
+ */
168
+ export declare function attributeGateRed(params: {
169
+ root: string;
170
+ state: RemediationGateState;
171
+ output: string;
172
+ }): Promise<GateRedAttribution>;
173
+ /**
174
+ * Whether a red may carry the "not this run's doing" directive.
175
+ *
176
+ * The ONE draw of that question, shared by the renderer and by anything asking
177
+ * the same thing, so the directive and the verdict that licenses it cannot be
178
+ * two separate hand-written lists. `environment` is the only verdict whose every
179
+ * failing path is a non-test file outside the run's surface; anything else —
180
+ * including `unattributable`, which is what a test red degrades to — carries no
181
+ * such claim.
182
+ */
183
+ export declare function carriesEnvironmentVerdict(attribution: GateRedAttribution | undefined): boolean;
184
+ /**
185
+ * Render the attribution verdict for the paused step's prompt.
186
+ *
187
+ * ALWAYS returns a block, including for `unattributable` — the three verdicts
188
+ * are three DIFFERENT things for the host to do (fix the run's work / confirm
189
+ * unrelated dirt / investigate with no path evidence at all), and a missing
190
+ * block would collapse the third into silence. Never the raw path lists in full:
191
+ * the record holds them, and the prompt names the record.
192
+ */
193
+ export declare function renderGateAttribution(attribution: GateRedAttribution | undefined): string;
27
194
  /**
28
195
  * The tool-owned final-gate command list (INV-RS-10) for the audit-tools
29
196
  * monorepo. Pure and deterministic so tests can assert: it is non-vacuous
@@ -1 +1 @@
1
- {"version":3,"file":"gateCommands.d.ts","sourceRoot":"","sources":["../../../src/remediate/steps/gateCommands.ts"],"names":[],"mappings":"AAYA,gDAAgD;AAChD,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,mFAAmF;IACnF,UAAU,EAAE,OAAO,CAAC;IACpB,iFAAiF;IACjF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gDAAgD;IAChD,KAAK,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;CACnC;AASD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAW1D;AAED;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB,EAAE,CAiD/E"}
1
+ {"version":3,"file":"gateCommands.d.ts","sourceRoot":"","sources":["../../../src/remediate/steps/gateCommands.ts"],"names":[],"mappings":"AAoBA,gDAAgD;AAChD,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,mFAAmF;IACnF,UAAU,EAAE,OAAO,CAAC;IACpB,iFAAiF;IACjF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gDAAgD;IAChD,KAAK,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;CACnC;AASD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAW1D;AA0BD;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,oBAAoB;IACnC,6EAA6E;IAC7E,oBAAoB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,uEAAuE;IACvE,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,4EAA4E;IAC5E,iBAAiB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC;AAED;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAEhD,4DAA4D;AAC5D,MAAM,WAAW,kBAAkB;IACjC;;;;;;;;;;;;;;;OAeG;IACH,OAAO,EAA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