audit-tools 0.56.1 → 0.57.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (369) hide show
  1. package/README.md +8 -22
  2. package/dist/audit/cli/args.d.ts +0 -1
  3. package/dist/audit/cli/args.d.ts.map +1 -1
  4. package/dist/audit/cli/args.js +0 -14
  5. package/dist/audit/cli/args.js.map +1 -1
  6. package/dist/audit/cli/auditStep.d.ts +0 -59
  7. package/dist/audit/cli/auditStep.d.ts.map +1 -1
  8. package/dist/audit/cli/auditStep.js +2 -136
  9. package/dist/audit/cli/auditStep.js.map +1 -1
  10. package/dist/audit/cli/cleanup.d.ts.map +1 -1
  11. package/dist/audit/cli/cleanup.js +4 -1
  12. package/dist/audit/cli/cleanup.js.map +1 -1
  13. package/dist/audit/cli/confirmIntentStep.d.ts.map +1 -1
  14. package/dist/audit/cli/confirmIntentStep.js +16 -31
  15. package/dist/audit/cli/confirmIntentStep.js.map +1 -1
  16. package/dist/audit/cli/dispatch/hostHandoff.d.ts +414 -1
  17. package/dist/audit/cli/dispatch/hostHandoff.d.ts.map +1 -1
  18. package/dist/audit/cli/dispatch/hostHandoff.js +223 -1
  19. package/dist/audit/cli/dispatch/hostHandoff.js.map +1 -1
  20. package/dist/audit/cli/dispatch/questionReviewAcceptance.d.ts +254 -0
  21. package/dist/audit/cli/dispatch/questionReviewAcceptance.d.ts.map +1 -0
  22. package/dist/audit/cli/dispatch/questionReviewAcceptance.js +181 -0
  23. package/dist/audit/cli/dispatch/questionReviewAcceptance.js.map +1 -0
  24. package/dist/audit/cli/functionalPreflight.d.ts +4 -4
  25. package/dist/audit/cli/laneSubmissions.d.ts +4 -4
  26. package/dist/audit/cli/nextStepCommand.d.ts +3 -20
  27. package/dist/audit/cli/nextStepCommand.d.ts.map +1 -1
  28. package/dist/audit/cli/nextStepCommand.js +39 -133
  29. package/dist/audit/cli/nextStepCommand.js.map +1 -1
  30. package/dist/audit/cli/nextStepHelpers.d.ts +10 -72
  31. package/dist/audit/cli/nextStepHelpers.d.ts.map +1 -1
  32. package/dist/audit/cli/nextStepHelpers.js +95 -363
  33. package/dist/audit/cli/nextStepHelpers.js.map +1 -1
  34. package/dist/audit/cli/prompts.d.ts +0 -2
  35. package/dist/audit/cli/prompts.d.ts.map +1 -1
  36. package/dist/audit/cli/prompts.js +3 -14
  37. package/dist/audit/cli/prompts.js.map +1 -1
  38. package/dist/audit/cli/questionReviewCycle.d.ts +239 -0
  39. package/dist/audit/cli/questionReviewCycle.d.ts.map +1 -0
  40. package/dist/audit/cli/questionReviewCycle.js +55 -0
  41. package/dist/audit/cli/questionReviewCycle.js.map +1 -0
  42. package/dist/audit/cli/questionReviewSession.d.ts +7 -0
  43. package/dist/audit/cli/questionReviewSession.d.ts.map +1 -0
  44. package/dist/audit/cli/questionReviewSession.js +46 -0
  45. package/dist/audit/cli/questionReviewSession.js.map +1 -0
  46. package/dist/audit/cli/questionWorkloadBindings.d.ts +7 -0
  47. package/dist/audit/cli/questionWorkloadBindings.d.ts.map +1 -0
  48. package/dist/audit/cli/questionWorkloadBindings.js +66 -0
  49. package/dist/audit/cli/questionWorkloadBindings.js.map +1 -0
  50. package/dist/audit/cli/resynthesizeCommand.d.ts +1 -0
  51. package/dist/audit/cli/resynthesizeCommand.d.ts.map +1 -1
  52. package/dist/audit/cli/resynthesizeCommand.js +52 -51
  53. package/dist/audit/cli/resynthesizeCommand.js.map +1 -1
  54. package/dist/audit/cli/sampleRunCommand.d.ts +565 -160
  55. package/dist/audit/cli/sampleRunCommand.d.ts.map +1 -1
  56. package/dist/audit/cli/sampleRunCommand.js +66 -152
  57. package/dist/audit/cli/sampleRunCommand.js.map +1 -1
  58. package/dist/audit/cli/statusCommand.d.ts.map +1 -1
  59. package/dist/audit/cli/statusCommand.js +20 -14
  60. package/dist/audit/cli/statusCommand.js.map +1 -1
  61. package/dist/audit/cli/steps.d.ts +10 -10
  62. package/dist/audit/cli/submitCommand.d.ts +11 -6
  63. package/dist/audit/cli/submitCommand.d.ts.map +1 -1
  64. package/dist/audit/cli/submitCommand.js +91 -24
  65. package/dist/audit/cli/submitCommand.js.map +1 -1
  66. package/dist/audit/cli.d.ts.map +1 -1
  67. package/dist/audit/cli.js +6 -17
  68. package/dist/audit/cli.js.map +1 -1
  69. package/dist/audit/contracts/findingContractPrompt.d.ts +4 -4
  70. package/dist/audit/contracts/workerSchemas.d.ts +69 -68
  71. package/dist/audit/contracts/workerSchemas.d.ts.map +1 -1
  72. package/dist/audit/contracts/workerSchemas.js +8 -1
  73. package/dist/audit/contracts/workerSchemas.js.map +1 -1
  74. package/dist/audit/contracts/wrapperResponse.d.ts +13 -13
  75. package/dist/audit/contracts/wrapperResponse.d.ts.map +1 -1
  76. package/dist/audit/contracts/wrapperResponse.js +0 -1
  77. package/dist/audit/contracts/wrapperResponse.js.map +1 -1
  78. package/dist/audit/extractors/designAssessment.js +2 -2
  79. package/dist/audit/extractors/designAssessment.js.map +1 -1
  80. package/dist/audit/io/artifacts.d.ts +31 -9
  81. package/dist/audit/io/artifacts.d.ts.map +1 -1
  82. package/dist/audit/io/artifacts.js +197 -31
  83. package/dist/audit/io/artifacts.js.map +1 -1
  84. package/dist/audit/io/rollover.d.ts.map +1 -1
  85. package/dist/audit/io/rollover.js +7 -16
  86. package/dist/audit/io/rollover.js.map +1 -1
  87. package/dist/audit/io/runSnapshot.d.ts +1 -1
  88. package/dist/audit/io/runSnapshot.js +1 -1
  89. package/dist/audit/orchestrator/architectureDiscovery.d.ts +9 -10
  90. package/dist/audit/orchestrator/architectureDiscovery.d.ts.map +1 -1
  91. package/dist/audit/orchestrator/architectureDiscovery.js +95 -13
  92. package/dist/audit/orchestrator/architectureDiscovery.js.map +1 -1
  93. package/dist/audit/orchestrator/charterPacketArchive.d.ts +3 -0
  94. package/dist/audit/orchestrator/charterPacketArchive.d.ts.map +1 -1
  95. package/dist/audit/orchestrator/charterPacketArchive.js +31 -2
  96. package/dist/audit/orchestrator/charterPacketArchive.js.map +1 -1
  97. package/dist/audit/orchestrator/dependencyMap.d.ts +2 -8
  98. package/dist/audit/orchestrator/dependencyMap.d.ts.map +1 -1
  99. package/dist/audit/orchestrator/dependencyMap.js +10 -105
  100. package/dist/audit/orchestrator/dependencyMap.js.map +1 -1
  101. package/dist/audit/orchestrator/dependencySlices.d.ts +2 -3
  102. package/dist/audit/orchestrator/dependencySlices.d.ts.map +1 -1
  103. package/dist/audit/orchestrator/dependencySlices.js +2 -35
  104. package/dist/audit/orchestrator/dependencySlices.js.map +1 -1
  105. package/dist/audit/orchestrator/designReviewPrompt.d.ts.map +1 -1
  106. package/dist/audit/orchestrator/designReviewPrompt.js +24 -14
  107. package/dist/audit/orchestrator/designReviewPrompt.js.map +1 -1
  108. package/dist/audit/orchestrator/executorRunners.d.ts +1 -1
  109. package/dist/audit/orchestrator/executorRunners.d.ts.map +1 -1
  110. package/dist/audit/orchestrator/executorRunners.js +14 -21
  111. package/dist/audit/orchestrator/executorRunners.js.map +1 -1
  112. package/dist/audit/orchestrator/executors.d.ts.map +1 -1
  113. package/dist/audit/orchestrator/executors.js +1 -131
  114. package/dist/audit/orchestrator/executors.js.map +1 -1
  115. package/dist/audit/orchestrator/flowPlanning.d.ts +1 -1
  116. package/dist/audit/orchestrator/flowPlanning.js +1 -1
  117. package/dist/audit/orchestrator/ingestionExecutors.d.ts.map +1 -1
  118. package/dist/audit/orchestrator/ingestionExecutors.js +19 -12
  119. package/dist/audit/orchestrator/ingestionExecutors.js.map +1 -1
  120. package/dist/audit/orchestrator/intentCheckpointExecutor.d.ts +2 -2
  121. package/dist/audit/orchestrator/intentCheckpointExecutor.d.ts.map +1 -1
  122. package/dist/audit/orchestrator/intentCheckpointExecutor.js +37 -36
  123. package/dist/audit/orchestrator/intentCheckpointExecutor.js.map +1 -1
  124. package/dist/audit/orchestrator/lensSelection.d.ts +6 -37
  125. package/dist/audit/orchestrator/lensSelection.d.ts.map +1 -1
  126. package/dist/audit/orchestrator/lensSelection.js +42 -68
  127. package/dist/audit/orchestrator/lensSelection.js.map +1 -1
  128. package/dist/audit/orchestrator/nextStep.d.ts.map +1 -1
  129. package/dist/audit/orchestrator/nextStep.js +1 -4
  130. package/dist/audit/orchestrator/nextStep.js.map +1 -1
  131. package/dist/audit/orchestrator/questionEvidence.d.ts +67 -0
  132. package/dist/audit/orchestrator/questionEvidence.d.ts.map +1 -0
  133. package/dist/audit/orchestrator/questionEvidence.js +177 -0
  134. package/dist/audit/orchestrator/questionEvidence.js.map +1 -0
  135. package/dist/audit/orchestrator/questionPlanExecutor.d.ts +10 -0
  136. package/dist/audit/orchestrator/questionPlanExecutor.d.ts.map +1 -0
  137. package/dist/audit/orchestrator/questionPlanExecutor.js +23 -0
  138. package/dist/audit/orchestrator/questionPlanExecutor.js.map +1 -0
  139. package/dist/audit/orchestrator/questionPlanning.d.ts +48 -0
  140. package/dist/audit/orchestrator/questionPlanning.d.ts.map +1 -0
  141. package/dist/audit/orchestrator/questionPlanning.js +326 -0
  142. package/dist/audit/orchestrator/questionPlanning.js.map +1 -0
  143. package/dist/audit/orchestrator/reviewLensPlaybooks.d.ts +11 -0
  144. package/dist/audit/orchestrator/reviewLensPlaybooks.d.ts.map +1 -0
  145. package/dist/audit/orchestrator/reviewLensPlaybooks.js +11 -0
  146. package/dist/audit/orchestrator/reviewLensPlaybooks.js.map +1 -0
  147. package/dist/audit/orchestrator/runtimeValidation.d.ts.map +1 -1
  148. package/dist/audit/orchestrator/runtimeValidation.js +14 -0
  149. package/dist/audit/orchestrator/runtimeValidation.js.map +1 -1
  150. package/dist/audit/orchestrator/runtimeValidationUpdate.d.ts +1 -1
  151. package/dist/audit/orchestrator/runtimeValidationUpdate.d.ts.map +1 -1
  152. package/dist/audit/orchestrator/runtimeValidationUpdate.js +13 -4
  153. package/dist/audit/orchestrator/runtimeValidationUpdate.js.map +1 -1
  154. package/dist/audit/orchestrator/selectiveDeepening/conflict.js +1 -1
  155. package/dist/audit/orchestrator/selectiveDeepening/conflict.js.map +1 -1
  156. package/dist/audit/orchestrator/selectiveDeepening/index.js +1 -1
  157. package/dist/audit/orchestrator/selectiveDeepening/index.js.map +1 -1
  158. package/dist/audit/orchestrator/state.d.ts.map +1 -1
  159. package/dist/audit/orchestrator/state.js +8 -60
  160. package/dist/audit/orchestrator/state.js.map +1 -1
  161. package/dist/audit/orchestrator/synthesisExecutors.d.ts +15 -1
  162. package/dist/audit/orchestrator/synthesisExecutors.d.ts.map +1 -1
  163. package/dist/audit/orchestrator/synthesisExecutors.js +76 -25
  164. package/dist/audit/orchestrator/synthesisExecutors.js.map +1 -1
  165. package/dist/audit/orchestrator/systemicChallengeExecutor.d.ts.map +1 -1
  166. package/dist/audit/orchestrator/systemicChallengeExecutor.js +11 -6
  167. package/dist/audit/orchestrator/systemicChallengeExecutor.js.map +1 -1
  168. package/dist/audit/orchestrator/taskAffinityGraph.d.ts +4 -4
  169. package/dist/audit/reporting/questionReport.d.ts +27 -0
  170. package/dist/audit/reporting/questionReport.d.ts.map +1 -0
  171. package/dist/audit/reporting/questionReport.js +183 -0
  172. package/dist/audit/reporting/questionReport.js.map +1 -0
  173. package/dist/audit/reporting/synthesis.d.ts +10 -1
  174. package/dist/audit/reporting/synthesis.d.ts.map +1 -1
  175. package/dist/audit/reporting/synthesis.js +161 -24
  176. package/dist/audit/reporting/synthesis.js.map +1 -1
  177. package/dist/audit/reporting/synthesisNarrativePrompt.d.ts +4 -1
  178. package/dist/audit/reporting/synthesisNarrativePrompt.d.ts.map +1 -1
  179. package/dist/audit/reporting/synthesisNarrativePrompt.js +5 -1
  180. package/dist/audit/reporting/synthesisNarrativePrompt.js.map +1 -1
  181. package/dist/audit/supervisor/operatorHandoff.d.ts +2 -3
  182. package/dist/audit/supervisor/operatorHandoff.d.ts.map +1 -1
  183. package/dist/audit/supervisor/operatorHandoff.js +3 -18
  184. package/dist/audit/supervisor/operatorHandoff.js.map +1 -1
  185. package/dist/audit/systemic/aggregateMetricsDigest.d.ts.map +1 -1
  186. package/dist/audit/systemic/aggregateMetricsDigest.js +0 -2
  187. package/dist/audit/systemic/aggregateMetricsDigest.js.map +1 -1
  188. package/dist/audit/types/artifactMetadata.d.ts +1 -2
  189. package/dist/audit/types/artifactMetadata.d.ts.map +1 -1
  190. package/dist/audit/types/auditState.d.ts +6 -6
  191. package/dist/audit/types/conceptualAdjudication.d.ts +708 -50
  192. package/dist/audit/types/conceptualAdjudication.d.ts.map +1 -1
  193. package/dist/audit/types/conceptualAdjudication.js +2 -0
  194. package/dist/audit/types/conceptualAdjudication.js.map +1 -1
  195. package/dist/audit/types/runtimeValidation.d.ts +58 -6
  196. package/dist/audit/types/runtimeValidation.d.ts.map +1 -1
  197. package/dist/audit/types/runtimeValidation.js +8 -0
  198. package/dist/audit/types/runtimeValidation.js.map +1 -1
  199. package/dist/audit/types.d.ts +539 -22
  200. package/dist/audit/types.d.ts.map +1 -1
  201. package/dist/audit/validation/auditResults.d.ts +1 -1
  202. package/dist/audit/validation/auditResults.js +1 -1
  203. package/dist/audit/validation/ingestIssueCodes.d.ts.map +1 -1
  204. package/dist/audit/validation/ingestIssueCodes.js +0 -1
  205. package/dist/audit/validation/ingestIssueCodes.js.map +1 -1
  206. package/dist/remediate/contractPipeline/executionPlan.d.ts +679 -52
  207. package/dist/remediate/contractPipeline/executionPlan.d.ts.map +1 -1
  208. package/dist/remediate/contractPipeline/executionPlan.js +23 -0
  209. package/dist/remediate/contractPipeline/executionPlan.js.map +1 -1
  210. package/dist/remediate/findingFilter.d.ts.map +1 -1
  211. package/dist/remediate/findingFilter.js +6 -2
  212. package/dist/remediate/findingFilter.js.map +1 -1
  213. package/dist/remediate/intake.d.ts +4 -4
  214. package/dist/remediate/phases/close.d.ts.map +1 -1
  215. package/dist/remediate/phases/close.js +15 -5
  216. package/dist/remediate/phases/close.js.map +1 -1
  217. package/dist/remediate/phases/closeVerifyAnalyzerLeads.d.ts +5 -0
  218. package/dist/remediate/phases/closeVerifyAnalyzerLeads.d.ts.map +1 -1
  219. package/dist/remediate/phases/closeVerifyAnalyzerLeads.js +37 -8
  220. package/dist/remediate/phases/closeVerifyAnalyzerLeads.js.map +1 -1
  221. package/dist/remediate/state/types.d.ts +619 -26
  222. package/dist/remediate/state/types.d.ts.map +1 -1
  223. package/dist/remediate/state/types.js +2 -1
  224. package/dist/remediate/state/types.js.map +1 -1
  225. package/dist/remediate/steps/contractPipeline.d.ts.map +1 -1
  226. package/dist/remediate/steps/contractPipeline.js +2 -0
  227. package/dist/remediate/steps/contractPipeline.js.map +1 -1
  228. package/dist/remediate/steps/contractPipelinePrompts.d.ts.map +1 -1
  229. package/dist/remediate/steps/contractPipelinePrompts.js +2 -0
  230. package/dist/remediate/steps/contractPipelinePrompts.js.map +1 -1
  231. package/dist/remediate/steps/dispatch/contractConformanceReview.d.ts +3 -3
  232. package/dist/remediate/steps/intakeResolver.d.ts.map +1 -1
  233. package/dist/remediate/steps/intakeResolver.js +31 -6
  234. package/dist/remediate/steps/intakeResolver.js.map +1 -1
  235. package/dist/remediate/steps/nextStep.d.ts.map +1 -1
  236. package/dist/remediate/steps/nextStep.js +31 -40
  237. package/dist/remediate/steps/nextStep.js.map +1 -1
  238. package/dist/remediate/steps/prompts.d.ts.map +1 -1
  239. package/dist/remediate/steps/prompts.js +3 -0
  240. package/dist/remediate/steps/prompts.js.map +1 -1
  241. package/dist/shared/analyzers/types.d.ts +18 -18
  242. package/dist/shared/contentKey.d.ts +1 -1
  243. package/dist/shared/contentKey.js +1 -1
  244. package/dist/shared/decompose/charterClarification.d.ts +4 -4
  245. package/dist/shared/decompose/charterExtraction.d.ts +30 -30
  246. package/dist/shared/decompose/contentCoherence.d.ts +1 -1
  247. package/dist/shared/decompose/contentCoherence.js +1 -1
  248. package/dist/shared/decompose/systemicChallenge.d.ts +629 -18
  249. package/dist/shared/decompose/systemicChallenge.d.ts.map +1 -1
  250. package/dist/shared/engine/obligationEngine.d.ts +2 -2
  251. package/dist/shared/index.d.ts +2 -0
  252. package/dist/shared/index.d.ts.map +1 -1
  253. package/dist/shared/index.js +2 -0
  254. package/dist/shared/index.js.map +1 -1
  255. package/dist/shared/io/stepContractWriter.js +1 -1
  256. package/dist/shared/io/stepContractWriter.js.map +1 -1
  257. package/dist/shared/loopCorePaths.d.ts.map +1 -1
  258. package/dist/shared/loopCorePaths.js +5 -2
  259. package/dist/shared/loopCorePaths.js.map +1 -1
  260. package/dist/shared/mcp/submitServer.d.ts +1 -0
  261. package/dist/shared/mcp/submitServer.d.ts.map +1 -1
  262. package/dist/shared/mcp/submitServer.js +1 -1
  263. package/dist/shared/mcp/submitServer.js.map +1 -1
  264. package/dist/shared/submission/hostResultOutcomes.js +1 -1
  265. package/dist/shared/submission/hostResultOutcomes.js.map +1 -1
  266. package/dist/shared/tooling/exec.js +1 -1
  267. package/dist/shared/tooling/exec.js.map +1 -1
  268. package/dist/shared/types/charter.d.ts +38 -38
  269. package/dist/shared/types/contractPropertyShapes.d.ts.map +1 -1
  270. package/dist/shared/types/contractPropertyShapes.js +7 -0
  271. package/dist/shared/types/contractPropertyShapes.js.map +1 -1
  272. package/dist/shared/types/executionPlan.d.ts +88 -12
  273. package/dist/shared/types/executionPlan.d.ts.map +1 -1
  274. package/dist/shared/types/executionPlan.js +1 -0
  275. package/dist/shared/types/executionPlan.js.map +1 -1
  276. package/dist/shared/types/finding.d.ts +1721 -56
  277. package/dist/shared/types/finding.d.ts.map +1 -1
  278. package/dist/shared/types/finding.js +7 -10
  279. package/dist/shared/types/finding.js.map +1 -1
  280. package/dist/shared/types/findingVocabulary.d.ts +8 -0
  281. package/dist/shared/types/findingVocabulary.d.ts.map +1 -0
  282. package/dist/shared/types/findingVocabulary.js +13 -0
  283. package/dist/shared/types/findingVocabulary.js.map +1 -0
  284. package/dist/shared/types/intentCheckpoint.d.ts +8 -3
  285. package/dist/shared/types/intentCheckpoint.d.ts.map +1 -1
  286. package/dist/shared/types/intentCheckpoint.js +4 -3
  287. package/dist/shared/types/intentCheckpoint.js.map +1 -1
  288. package/dist/shared/types/questionReviewReport.d.ts +9912 -0
  289. package/dist/shared/types/questionReviewReport.d.ts.map +1 -0
  290. package/dist/shared/types/questionReviewReport.js +185 -0
  291. package/dist/shared/types/questionReviewReport.js.map +1 -0
  292. package/dist/shared/types/remediationOutcome.d.ts +1379 -148
  293. package/dist/shared/types/remediationOutcome.d.ts.map +1 -1
  294. package/dist/shared/types/remediationOutcome.js +5 -0
  295. package/dist/shared/types/remediationOutcome.js.map +1 -1
  296. package/dist/shared/types/reviewIndependence.d.ts +24 -24
  297. package/dist/shared/types/reviewQuestion.d.ts +4359 -0
  298. package/dist/shared/types/reviewQuestion.d.ts.map +1 -0
  299. package/dist/shared/types/reviewQuestion.js +182 -0
  300. package/dist/shared/types/reviewQuestion.js.map +1 -0
  301. package/dist/shared/types/stepContract.js +1 -1
  302. package/dist/shared/types/stepContract.js.map +1 -1
  303. package/dist/shared/validation/designFindingGrounding.js +1 -1
  304. package/dist/shared/validation/designFindingGrounding.js.map +1 -1
  305. package/dist/shared/validation/findingsReport.d.ts.map +1 -1
  306. package/dist/shared/validation/findingsReport.js +19 -4
  307. package/dist/shared/validation/findingsReport.js.map +1 -1
  308. package/docs/audit-pkg/contracts.md +27 -56
  309. package/docs/audit-pkg/operator-guide.md +31 -17
  310. package/docs/audit-pkg/product.md +17 -23
  311. package/package.json +1 -1
  312. package/schemas/audit-code-v1alpha1.schema.json +0 -1
  313. package/schemas/review_submission.schema.json +514 -0
  314. package/scripts/postinstall.mjs +16 -9
  315. package/skills/audit-code/audit-code.prompt.md +7 -5
  316. package/wrapper/audit-code-wrapper-lib.mjs +1 -5
  317. package/wrapper/installer-verb-help.mjs +1 -1
  318. package/dist/audit/cli/explainTaskCommand.d.ts +0 -4
  319. package/dist/audit/cli/explainTaskCommand.d.ts.map +0 -1
  320. package/dist/audit/cli/explainTaskCommand.js +0 -45
  321. package/dist/audit/cli/explainTaskCommand.js.map +0 -1
  322. package/dist/audit/cli/ingestResultsCommand.d.ts +0 -2
  323. package/dist/audit/cli/ingestResultsCommand.d.ts.map +0 -1
  324. package/dist/audit/cli/ingestResultsCommand.js +0 -42
  325. package/dist/audit/cli/ingestResultsCommand.js.map +0 -1
  326. package/dist/audit/cli/requeueCommand.d.ts +0 -2
  327. package/dist/audit/cli/requeueCommand.d.ts.map +0 -1
  328. package/dist/audit/cli/requeueCommand.js +0 -12
  329. package/dist/audit/cli/requeueCommand.js.map +0 -1
  330. package/dist/audit/cli/semanticReviewStep.d.ts +0 -41
  331. package/dist/audit/cli/semanticReviewStep.d.ts.map +0 -1
  332. package/dist/audit/cli/semanticReviewStep.js +0 -185
  333. package/dist/audit/cli/semanticReviewStep.js.map +0 -1
  334. package/dist/audit/cli/unacceptResultsCommand.d.ts +0 -19
  335. package/dist/audit/cli/unacceptResultsCommand.d.ts.map +0 -1
  336. package/dist/audit/cli/unacceptResultsCommand.js +0 -52
  337. package/dist/audit/cli/unacceptResultsCommand.js.map +0 -1
  338. package/dist/audit/cli/updateRuntimeValidationCommand.d.ts +0 -2
  339. package/dist/audit/cli/updateRuntimeValidationCommand.d.ts.map +0 -1
  340. package/dist/audit/cli/updateRuntimeValidationCommand.js +0 -18
  341. package/dist/audit/cli/updateRuntimeValidationCommand.js.map +0 -1
  342. package/dist/audit/cli/validateResultsCommand.d.ts +0 -13
  343. package/dist/audit/cli/validateResultsCommand.d.ts.map +0 -1
  344. package/dist/audit/cli/validateResultsCommand.js +0 -87
  345. package/dist/audit/cli/validateResultsCommand.js.map +0 -1
  346. package/dist/audit/cli/workerResult.d.ts +0 -2
  347. package/dist/audit/cli/workerResult.d.ts.map +0 -1
  348. package/dist/audit/cli/workerResult.js +0 -6
  349. package/dist/audit/cli/workerResult.js.map +0 -1
  350. package/dist/audit/orchestrator/coverageElementBaseline.d.ts +0 -54
  351. package/dist/audit/orchestrator/coverageElementBaseline.d.ts.map +0 -1
  352. package/dist/audit/orchestrator/coverageElementBaseline.js +0 -136
  353. package/dist/audit/orchestrator/coverageElementBaseline.js.map +0 -1
  354. package/dist/audit/orchestrator/planning.d.ts +0 -5
  355. package/dist/audit/orchestrator/planning.d.ts.map +0 -1
  356. package/dist/audit/orchestrator/planning.js +0 -79
  357. package/dist/audit/orchestrator/planning.js.map +0 -1
  358. package/dist/audit/orchestrator/planningExecutors.d.ts +0 -21
  359. package/dist/audit/orchestrator/planningExecutors.d.ts.map +0 -1
  360. package/dist/audit/orchestrator/planningExecutors.js +0 -273
  361. package/dist/audit/orchestrator/planningExecutors.js.map +0 -1
  362. package/dist/audit/orchestrator/taskBuilder.d.ts +0 -62
  363. package/dist/audit/orchestrator/taskBuilder.d.ts.map +0 -1
  364. package/dist/audit/orchestrator/taskBuilder.js +0 -412
  365. package/dist/audit/orchestrator/taskBuilder.js.map +0 -1
  366. package/dist/audit/orchestrator/trivialAudit.d.ts +0 -21
  367. package/dist/audit/orchestrator/trivialAudit.d.ts.map +0 -1
  368. package/dist/audit/orchestrator/trivialAudit.js +0 -80
  369. package/dist/audit/orchestrator/trivialAudit.js.map +0 -1
@@ -1,2 +0,0 @@
1
- export declare function formatAuditResultValidationError(issues: ReturnType<typeof import("../validation/auditResults.js").validateAuditResults>): string;
2
- //# sourceMappingURL=workerResult.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"workerResult.d.ts","sourceRoot":"","sources":["../../../src/audit/cli/workerResult.ts"],"names":[],"mappings":"AAEA,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,UAAU,CAAC,cAAc,+BAA+B,EAAE,oBAAoB,CAAC,GACtF,MAAM,CAKR"}
@@ -1,6 +0,0 @@
1
- import { formatAuditResultIssues } from "../validation/auditResults.js";
2
- export function formatAuditResultValidationError(issues) {
3
- return (`audit-results validation failed with ${issues.length} error(s):\n` +
4
- formatAuditResultIssues(issues));
5
- }
6
- //# sourceMappingURL=workerResult.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"workerResult.js","sourceRoot":"","sources":["../../../src/audit/cli/workerResult.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAExE,MAAM,UAAU,gCAAgC,CAC9C,MAAuF;IAEvF,OAAO,CACL,wCAAwC,MAAM,CAAC,MAAM,cAAc;QACnE,uBAAuB,CAAC,MAAM,CAAC,CAChC,CAAC;AACJ,CAAC"}
@@ -1,54 +0,0 @@
1
- import type { ArtifactMetadataManifest } from "../types/artifactMetadata.js";
2
- import type { CoverageMatrix, CoverageFileRecord, RepoManifest } from "../types.js";
3
- /** Per-coverage-file baseline: file path → signature-sensitive content key. */
4
- export type CoverageElementBaselineStore = Record<string, string>;
5
- /**
6
- * The per-file content signal that determines whether a file's audit must be
7
- * redone: the repo-manifest content hash.
8
- * Returns a map keyed by repo-manifest path. Files absent from the manifest (no
9
- * signal) are simply omitted — a file with no signal gets no baseline and is
10
- * never preserved (fail-safe to re-audit).
11
- */
12
- export declare function coverageContentSignature(repoManifest: RepoManifest): Record<string, string>;
13
- /**
14
- * Derive the signature-SENSITIVE content key for one coverage file from its audit
15
- * inputs: the file's content signal, its required lenses, and its unit
16
- * membership. Any change to any input moves the key, forcing a re-audit; an
17
- * identical set of inputs reproduces the same key, enabling preservation. Lenses
18
- * and unit ids are sorted so ordering noise never moves the key.
19
- */
20
- export declare function deriveCoverageElementKey(file: CoverageFileRecord, contentSig: string | undefined): string;
21
- /**
22
- * Build the fresh per-element baseline store for a coverage matrix: a content key
23
- * for every file that carries audit work (not excluded). Excluded files are
24
- * omitted — they have no work to preserve. Pure.
25
- */
26
- export declare function recordCoverageElementBaselines(coverage: CoverageMatrix, contentSigByPath: Record<string, string>): CoverageElementBaselineStore;
27
- /** Read the carried-forward coverage-element baselines off the artifact metadata. */
28
- export declare function readCoverageElementBaselines(metadata: ArtifactMetadataManifest | undefined): CoverageElementBaselineStore | undefined;
29
- /**
30
- * Carry the executor's freshly-recorded coverage-element baselines onto the
31
- * bundle's artifact metadata so `computeArtifactMetadata` persists them (the same
32
- * carry-forward path `result_baselines` uses). Returns a new manifest; never
33
- * mutates the input. Stamps the F1 schema version when seeding a fresh manifest
34
- * so the CE-007 freshness gate recognizes the store on the next run.
35
- */
36
- export declare function withCoverageElementBaselines(metadata: ArtifactMetadataManifest | undefined, baselines: CoverageElementBaselineStore): ArtifactMetadataManifest;
37
- /**
38
- * Preserve prior completion for coverage files whose audit inputs are UNCHANGED
39
- * from the recorded baseline — content-addressed granular staleness. Mutates
40
- * `coverage` in place and returns the number of files preserved.
41
- *
42
- * A file is preserved iff: it still carries pending work (not excluded), a prior
43
- * baseline exists for its path, the freshly-computed live key EQUALS that
44
- * baseline, AND a prior coverage record exists for the path. The prior record's
45
- * `completed_lenses` / `audit_status` are carried verbatim — valid because the
46
- * content key includes `required_lenses`, so an unchanged key guarantees an
47
- * unchanged required-lens set (partial completion is preserved too, not only
48
- * fully-complete files).
49
- *
50
- * No baseline, a moved key, or a missing prior record all leave the file at its
51
- * freshly-built (pending) state — fail-safe to re-audit.
52
- */
53
- export declare function applyContentAddressedPreservation(coverage: CoverageMatrix, priorCoverage: CoverageMatrix | undefined, priorBaselines: CoverageElementBaselineStore | undefined, contentSigByPath: Record<string, string>): number;
54
- //# sourceMappingURL=coverageElementBaseline.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"coverageElementBaseline.d.ts","sourceRoot":"","sources":["../../../src/audit/orchestrator/coverageElementBaseline.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAE7E,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEpF,+EAA+E;AAC/E,MAAM,MAAM,4BAA4B,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAElE;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,YAAY,EAAE,YAAY,GACzB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAMxB;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,kBAAkB,EACxB,UAAU,EAAE,MAAM,GAAG,SAAS,GAC7B,MAAM,CASR;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,cAAc,EACxB,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACvC,4BAA4B,CAO9B;AAED,qFAAqF;AACrF,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,wBAAwB,GAAG,SAAS,GAC7C,4BAA4B,GAAG,SAAS,CAE1C;AAED;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,wBAAwB,GAAG,SAAS,EAC9C,SAAS,EAAE,4BAA4B,GACtC,wBAAwB,CAO1B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iCAAiC,CAC/C,QAAQ,EAAE,cAAc,EACxB,aAAa,EAAE,cAAc,GAAG,SAAS,EACzC,cAAc,EAAE,4BAA4B,GAAG,SAAS,EACxD,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACvC,MAAM,CAoBR"}
@@ -1,136 +0,0 @@
1
- // sites-pinned: tests/audit/coverage-element-baseline.test.ts
2
- /**
3
- * Content-addressed, GRANULAR staleness for the coverage matrix (T5 #12 — the
4
- * general DAG-model extension that pairs with the per-result baseline store in
5
- * `resultBaseline.ts`).
6
- *
7
- * Today `runPlanningExecutor` rebuilds the whole coverage matrix on every re-plan
8
- * and resets every in-scope file to `pending`, so a re-plan triggered by an
9
- * upstream change unrelated to a given file (e.g. an intent-checkpoint edit, a
10
- * unit reassignment elsewhere, a new external-analyzer result) re-audits files
11
- * whose own audit inputs never changed. This module keys staleness at the
12
- * granularity of the actual unit of work — ONE coverage file — so only files
13
- * whose audit inputs genuinely moved re-derive; the rest keep their prior
14
- * completion by construction.
15
- *
16
- * Mirrors the result-baseline design exactly:
17
- * - the per-element baseline (a content key per file path) lives OUTSIDE the
18
- * coverage artifact, in `artifact_metadata.coverage_element_baselines`, so
19
- * recording a baseline never mutates the coverage matrix;
20
- * - the comparison driver is a signature-SENSITIVE content key derived from the
21
- * file's audit inputs (its content signal + required lenses + unit membership);
22
- * - a file with no recorded baseline is never preserved (first plan establishes
23
- * the baseline; the run after a ship behaves exactly as before).
24
- *
25
- * Content-based reuse requires a manifest hash. File size alone cannot identify
26
- * source content; hashless files are omitted from baselines and never preserved.
27
- */
28
- import { hashContent, stableStringify } from "audit-tools/shared";
29
- import { METADATA_SCHEMA_VERSION } from "../types/artifactMetadata.js";
30
- /**
31
- * The per-file content signal that determines whether a file's audit must be
32
- * redone: the repo-manifest content hash.
33
- * Returns a map keyed by repo-manifest path. Files absent from the manifest (no
34
- * signal) are simply omitted — a file with no signal gets no baseline and is
35
- * never preserved (fail-safe to re-audit).
36
- */
37
- export function coverageContentSignature(repoManifest) {
38
- const sig = {};
39
- for (const file of repoManifest.files) {
40
- if (file.hash)
41
- sig[file.path] = file.hash;
42
- }
43
- return sig;
44
- }
45
- /**
46
- * Derive the signature-SENSITIVE content key for one coverage file from its audit
47
- * inputs: the file's content signal, its required lenses, and its unit
48
- * membership. Any change to any input moves the key, forcing a re-audit; an
49
- * identical set of inputs reproduces the same key, enabling preservation. Lenses
50
- * and unit ids are sorted so ordering noise never moves the key.
51
- */
52
- export function deriveCoverageElementKey(file, contentSig) {
53
- return hashContent(stableStringify({
54
- path: file.path,
55
- content_sig: contentSig ?? null,
56
- required_lenses: [...file.required_lenses].sort(),
57
- unit_ids: [...file.unit_ids].sort(),
58
- }));
59
- }
60
- /**
61
- * Build the fresh per-element baseline store for a coverage matrix: a content key
62
- * for every file that carries audit work (not excluded). Excluded files are
63
- * omitted — they have no work to preserve. Pure.
64
- */
65
- export function recordCoverageElementBaselines(coverage, contentSigByPath) {
66
- const store = {};
67
- for (const file of coverage.files) {
68
- if (file.audit_status === "excluded" || !contentSigByPath[file.path])
69
- continue;
70
- store[file.path] = deriveCoverageElementKey(file, contentSigByPath[file.path]);
71
- }
72
- return store;
73
- }
74
- /** Read the carried-forward coverage-element baselines off the artifact metadata. */
75
- export function readCoverageElementBaselines(metadata) {
76
- return metadata?.coverage_element_baselines;
77
- }
78
- /**
79
- * Carry the executor's freshly-recorded coverage-element baselines onto the
80
- * bundle's artifact metadata so `computeArtifactMetadata` persists them (the same
81
- * carry-forward path `result_baselines` uses). Returns a new manifest; never
82
- * mutates the input. Stamps the F1 schema version when seeding a fresh manifest
83
- * so the CE-007 freshness gate recognizes the store on the next run.
84
- */
85
- export function withCoverageElementBaselines(metadata, baselines) {
86
- return {
87
- metadata_schema_version: METADATA_SCHEMA_VERSION,
88
- artifacts: {},
89
- ...(metadata ?? {}),
90
- coverage_element_baselines: baselines,
91
- };
92
- }
93
- /**
94
- * Preserve prior completion for coverage files whose audit inputs are UNCHANGED
95
- * from the recorded baseline — content-addressed granular staleness. Mutates
96
- * `coverage` in place and returns the number of files preserved.
97
- *
98
- * A file is preserved iff: it still carries pending work (not excluded), a prior
99
- * baseline exists for its path, the freshly-computed live key EQUALS that
100
- * baseline, AND a prior coverage record exists for the path. The prior record's
101
- * `completed_lenses` / `audit_status` are carried verbatim — valid because the
102
- * content key includes `required_lenses`, so an unchanged key guarantees an
103
- * unchanged required-lens set (partial completion is preserved too, not only
104
- * fully-complete files).
105
- *
106
- * No baseline, a moved key, or a missing prior record all leave the file at its
107
- * freshly-built (pending) state — fail-safe to re-audit.
108
- */
109
- export function applyContentAddressedPreservation(coverage, priorCoverage, priorBaselines, contentSigByPath) {
110
- if (!priorBaselines || !priorCoverage)
111
- return 0;
112
- const priorByPath = new Map(priorCoverage.files.map((f) => [f.path, f]));
113
- let preserved = 0;
114
- for (const file of coverage.files) {
115
- if (file.audit_status === "excluded" || !contentSigByPath[file.path])
116
- continue;
117
- // Already complete (e.g. trivial-auto-complete or delta out-of-scope carry):
118
- // nothing to preserve.
119
- if (file.audit_status === "complete")
120
- continue;
121
- const baseline = priorBaselines[file.path];
122
- if (baseline === undefined)
123
- continue;
124
- const liveKey = deriveCoverageElementKey(file, contentSigByPath[file.path]);
125
- if (liveKey !== baseline)
126
- continue;
127
- const prior = priorByPath.get(file.path);
128
- if (!prior)
129
- continue;
130
- file.completed_lenses = [...prior.completed_lenses];
131
- file.audit_status = prior.audit_status;
132
- preserved += 1;
133
- }
134
- return preserved;
135
- }
136
- //# sourceMappingURL=coverageElementBaseline.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"coverageElementBaseline.js","sourceRoot":"","sources":["../../../src/audit/orchestrator/coverageElementBaseline.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAElE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAMvE;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CACtC,YAA0B;IAE1B,MAAM,GAAG,GAA2B,EAAE,CAAC;IACvC,KAAK,MAAM,IAAI,IAAI,YAAY,CAAC,KAAK,EAAE,CAAC;QACtC,IAAI,IAAI,CAAC,IAAI;YAAE,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC;IAC5C,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CACtC,IAAwB,EACxB,UAA8B;IAE9B,OAAO,WAAW,CAChB,eAAe,CAAC;QACd,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,WAAW,EAAE,UAAU,IAAI,IAAI;QAC/B,eAAe,EAAE,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,CAAC,IAAI,EAAE;QACjD,QAAQ,EAAE,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE;KACpC,CAAC,CACH,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,8BAA8B,CAC5C,QAAwB,EACxB,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AAI,CAAC,IAAI,CAAC;YAAE,SAAS;QAC/E,6EAA6E;QAC7E,uBAAuB;QACvB,IAAI,IAAI,CAAC,YAAY,KAAK,UAAU;YAAE,SAAS;QAC/C,MAAM,QAAQ,GAAG,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,QAAQ,KAAK,SAAS;YAAE,SAAS;QACrC,MAAM,OAAO,GAAG,wBAAwB,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC5E,IAAI,OAAO,KAAK,QAAQ;YAAE,SAAS;QACnC,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,KAAK;YAAE,SAAS;QACrB,IAAI,CAAC,gBAAgB,GAAG,CAAC,GAAG,KAAK,CAAC,gBAAgB,CAAC,CAAC;QACpD,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;QACvC,SAAS,IAAI,CAAC,CAAC;IACjB,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -1,5 +0,0 @@
1
- import type { CoverageMatrix, RepoManifest, UnitManifest } from "../types.js";
2
- import type { FileDisposition } from "audit-tools/shared";
3
- import type { ExternalAnalyzerResults } from "audit-tools/shared";
4
- export declare function initializeCoverageFromPlan(repoManifest: RepoManifest, unitManifest: UnitManifest, disposition: FileDisposition, externalAnalyzerResults?: ExternalAnalyzerResults[]): CoverageMatrix;
5
- //# sourceMappingURL=planning.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"planning.d.ts","sourceRoot":"","sources":["../../../src/audit/orchestrator/planning.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,cAAc,EAEd,YAAY,EACZ,YAAY,EACb,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAgElE,wBAAgB,0BAA0B,CACxC,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,eAAe,EAC5B,uBAAuB,CAAC,EAAE,uBAAuB,EAAE,GAClD,cAAc,CAwChB"}
@@ -1,79 +0,0 @@
1
- import { applyUnitCoverage, createCoverageMatrix, markExcludedPath, } from "../coverage.js";
2
- import { isAuditExcludedStatus } from "../extractors/disposition.js";
3
- import { hasBrowserExtensionManifestFile } from "../extractors/browserExtension.js";
4
- import { deriveRequiredLensesForPath } from "./unitBuilder.js";
5
- const CATEGORY_LENS_TABLE = [
6
- [["security", "secret"], ["security", "correctness"]],
7
- [["dependency", "vuln"], ["security", "config_deployment"]],
8
- [["tests", "coverage"], ["tests"]],
9
- [["data"], ["data_integrity", "correctness"]],
10
- [["reliability", "concurrency"], ["reliability", "correctness"]],
11
- [["maintainability", "lint", "style"], ["maintainability"]],
12
- ];
13
- function analyzerCategoryToLenses(category) {
14
- const normalized = category.toLowerCase();
15
- for (const [keywords, lenses] of CATEGORY_LENS_TABLE) {
16
- if (keywords.some((kw) => normalized.includes(kw))) {
17
- return lenses;
18
- }
19
- }
20
- return ["correctness"];
21
- }
22
- function applyAnalyzerCoverage(coverage, externalAnalyzerResults) {
23
- if (!externalAnalyzerResults || externalAnalyzerResults.length === 0) {
24
- return;
25
- }
26
- const coverageByPath = new Map(coverage.files.map((file) => [file.path, file]));
27
- const results = externalAnalyzerResults.flatMap((tool) => Array.isArray(tool.results) ? tool.results : []);
28
- for (const result of results) {
29
- if (!result ||
30
- typeof result.path !== "string" ||
31
- typeof result.category !== "string") {
32
- continue;
33
- }
34
- const record = coverageByPath.get(result.path);
35
- if (!record || record.audit_status === "excluded") {
36
- continue;
37
- }
38
- const extraLenses = analyzerCategoryToLenses(result.category);
39
- record.required_lenses = [
40
- ...new Set([...record.required_lenses, ...extraLenses]),
41
- ];
42
- if (record.classification_status === "unclassified") {
43
- record.classification_status = "classified";
44
- }
45
- }
46
- }
47
- export function initializeCoverageFromPlan(repoManifest, unitManifest, disposition, externalAnalyzerResults) {
48
- const coverage = createCoverageMatrix(repoManifest.files.map((file) => file.path));
49
- const isBrowserExtensionProject = hasBrowserExtensionManifestFile(repoManifest);
50
- const dispositionMap = new Map(disposition.files.map((item) => [item.path, item.status]));
51
- for (const file of repoManifest.files) {
52
- const status = dispositionMap.get(file.path);
53
- if (status && isAuditExcludedStatus(status)) {
54
- markExcludedPath(coverage, file.path, status);
55
- }
56
- }
57
- const unitIdsByPath = new Map();
58
- for (const unit of unitManifest.units) {
59
- for (const path of unit.files) {
60
- const existing = unitIdsByPath.get(path) ?? [];
61
- if (!existing.includes(unit.unit_id)) {
62
- existing.push(unit.unit_id);
63
- }
64
- unitIdsByPath.set(path, existing);
65
- }
66
- }
67
- for (const file of repoManifest.files) {
68
- const unitIds = unitIdsByPath.get(file.path) ?? [];
69
- const requiredLenses = deriveRequiredLensesForPath(file.path, {
70
- isBrowserExtensionProject,
71
- });
72
- for (const unitId of unitIds) {
73
- applyUnitCoverage(coverage, file.path, unitId, requiredLenses);
74
- }
75
- }
76
- applyAnalyzerCoverage(coverage, externalAnalyzerResults);
77
- return coverage;
78
- }
79
- //# sourceMappingURL=planning.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"planning.js","sourceRoot":"","sources":["../../../src/audit/orchestrator/planning.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AASxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAI/D,MAAM,mBAAmB,GAAkB;IACzC,CAAC,CAAC,UAAU,EAAE,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,aAAa,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ACH,CAAC;IAED,qBAAqB,CAAC,QAAQ,EAAE,uBAAuB,CAAC,CAAC;IACzD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -1,21 +0,0 @@
1
- import type { ArtifactBundle } from "../io/artifacts.js";
2
- import type { AuditScopeManifest } from "../types/auditScope.js";
3
- import type { ExecutorRunResult } from "./executorResult.js";
4
- import type { Lens } from "../types.js";
5
- /**
6
- * Interpret a free-form intent string into lenses to priority-boost.
7
- *
8
- * Single authority: this delegates to the shared clause-aware interpreter via
9
- * `interpretFreeFormIntentForAudit` (→ `audit-tools/shared` `interpretIntent`).
10
- * There is exactly one keyword/lens map in the codebase — the shared
11
- * `LENS_KEYWORD_MAP`. Lens boosts are derived from the `lens_weight` encoded
12
- * clauses; unencodable clauses are NOT silently dropped here — they are gated
13
- * upstream as blocking checkpoint questions (see `state.ts`
14
- * `intent_checkpoint_current` and `confirmIntentStep.ts`).
15
- *
16
- * Deterministic — no LLM call.
17
- * INV-S04: the verbatim intent string never appears in output fields.
18
- */
19
- export declare function interpretFreeFormIntent(text: string): Lens[];
20
- export declare function runPlanningExecutor(bundle: ArtifactBundle, root: string, lineIndex?: Record<string, number>, sizeIndex?: Record<string, number>, scope?: AuditScopeManifest, publishedTaskIds?: ReadonlySet<string>): Promise<ExecutorRunResult>;
21
- //# sourceMappingURL=planningExecutors.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"planningExecutors.d.ts","sourceRoot":"","sources":["../../../src/audit/orchestrator/planningExecutors.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAuCjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,KAAK,EAAa,IAAI,EAAE,MAAM,aAAa,CAAC;AASnD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,CAU5D;AAED,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,MAAM,EACZ,SAAS,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,EACtC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAClC,KAAK,CAAC,EAAE,kBAAkB,EAC1B,gBAAgB,GAAE,WAAW,CAAC,MAAM,CAAa,GAChD,OAAO,CAAC,iBAAiB,CAAC,CAgR5B"}
@@ -1,273 +0,0 @@
1
- // sites-pinned: tests/audit/audit-frontier.test.ts, tests/audit/runtime-validation-source.test.ts
2
- import { DEEPENING_TAG } from "./selectiveDeepening/shared.js";
3
- import { architectureDiscoveryTasks, isArchitectureDiscoveryTask } from "./architectureDiscovery.js";
4
- import { initializeCoverageFromPlan } from "./planning.js";
5
- import { applyIntentExclusionsToCoverage, applyScopeToCoverage, fullAuditScope, } from "./scope.js";
6
- import { buildFlowCoverage } from "./flowCoverage.js";
7
- import { buildRequeuePayload } from "./requeueCommand.js";
8
- import { buildRuntimeValidationTasks, discoverRuntimeValidationCommand, mergeCurrentRuntimeValidationReport, } from "./runtimeValidation.js";
9
- import { buildChunkedAuditTasks, fileAssignmentKey, taskLeadsAreCurrent, } from "./taskBuilder.js";
10
- import { getExternalSignalPaths } from "./requeueUtils.js";
11
- import { buildAuditPlanMetrics, sizeIndexFromManifest, } from "./reviewPackets.js";
12
- import { taskContentTokens } from "./reviewPacketSizing.js";
13
- import { computeRiskEstimate } from "./auditTaskUtils.js";
14
- import { buildTaskAffinityGraph } from "./taskAffinityGraph.js";
15
- import { resolveIntentLensSelection } from "./lensSelection.js";
16
- import { foldPendingRequeueTasks } from "./requeueFold.js";
17
- import { autoCompleteTrivialCoverage } from "./trivialAudit.js";
18
- import { applyContentAddressedPreservation, coverageContentSignature, readCoverageElementBaselines, recordCoverageElementBaselines, withCoverageElementBaselines, deriveCoverageElementKey, } from "./coverageElementBaseline.js";
19
- import { interpretFreeFormIntentForAudit } from "./intentInterpreter.js";
20
- import { canonicalizeAuditTasks } from "../../shared/affinityArtifacts.js";
21
- import { isSha256, pathMatchesPrefix } from "audit-tools/shared";
22
- import { derivePendingTaskPartition } from "./pendingTasks.js";
23
- // ---------------------------------------------------------------------------
24
- // Free-form intent interpreter (keyword → lens boost, deterministic, no LLM)
25
- // ---------------------------------------------------------------------------
26
- /**
27
- * Interpret a free-form intent string into lenses to priority-boost.
28
- *
29
- * Single authority: this delegates to the shared clause-aware interpreter via
30
- * `interpretFreeFormIntentForAudit` (→ `audit-tools/shared` `interpretIntent`).
31
- * There is exactly one keyword/lens map in the codebase — the shared
32
- * `LENS_KEYWORD_MAP`. Lens boosts are derived from the `lens_weight` encoded
33
- * clauses; unencodable clauses are NOT silently dropped here — they are gated
34
- * upstream as blocking checkpoint questions (see `state.ts`
35
- * `intent_checkpoint_current` and `confirmIntentStep.ts`).
36
- *
37
- * Deterministic — no LLM call.
38
- * INV-S04: the verbatim intent string never appears in output fields.
39
- */
40
- export function interpretFreeFormIntent(text) {
41
- if (!text || text.trim().length === 0)
42
- return [];
43
- const interpretation = interpretFreeFormIntentForAudit(text);
44
- const boosts = new Set();
45
- for (const clause of interpretation.encoded_clauses) {
46
- if (clause.kind === "lens_weight" && clause.lens) {
47
- boosts.add(clause.lens);
48
- }
49
- }
50
- return [...boosts];
51
- }
52
- export async function runPlanningExecutor(bundle, root, lineIndex = {}, sizeIndex, scope, publishedTaskIds = new Set()) {
53
- if (!bundle.repo_manifest) {
54
- throw new Error("Cannot run planning executor without repo_manifest");
55
- }
56
- const resolvedSizeIndex = sizeIndex ?? sizeIndexFromManifest(bundle.repo_manifest);
57
- if (!bundle.file_disposition ||
58
- !bundle.unit_manifest ||
59
- !bundle.surface_manifest ||
60
- !bundle.critical_flows ||
61
- !bundle.risk_register) {
62
- throw new Error("Cannot run planning executor without current structure artifacts");
63
- }
64
- const resolvedScope = scope ?? fullAuditScope();
65
- const externalAnalyzerResults = bundle.external_analyzer_results;
66
- // Apply disposition_overrides before coverage initialization so overridden
67
- // files never enter coverage at all (not just filtered after).
68
- // Use the shared normalized exact-or-directory-prefix matcher.
69
- const dispositionOverrides = bundle.intent_checkpoint?.disposition_overrides;
70
- let effectiveFileDisposition = bundle.file_disposition;
71
- if (dispositionOverrides && dispositionOverrides.length > 0) {
72
- effectiveFileDisposition = {
73
- ...bundle.file_disposition,
74
- files: bundle.file_disposition.files.map((f) => {
75
- for (const override of dispositionOverrides) {
76
- if (pathMatchesPrefix(f.path, override.path)) {
77
- return { ...f, status: override.status, reason: override.reason };
78
- }
79
- }
80
- return f;
81
- }),
82
- };
83
- }
84
- // Resolve effective lenses from lens_selection (mandatory lenses always
85
- // included; resolveIntentLensSelection enforces this invariant and is the same
86
- // resolution the ingestion draw's requeue fold reads).
87
- const effectiveLenses = resolveIntentLensSelection(bundle.intent_checkpoint?.lens_selection);
88
- const coverage = initializeCoverageFromPlan(bundle.repo_manifest, bundle.unit_manifest, effectiveFileDisposition, externalAnalyzerResults);
89
- const skippedTrivialPaths = autoCompleteTrivialCoverage(coverage, lineIndex, externalAnalyzerResults);
90
- // Delta scope: only seed + expanded files stay pending; the rest inherit prior
91
- // completion or are excluded from this run. Full scope is a no-op.
92
- applyScopeToCoverage(coverage, resolvedScope, bundle.coverage_matrix);
93
- // Layer the host-confirmed intent exclusions on top of disposition + scope so
94
- // user-pruned scope pollution never becomes an audit task.
95
- const intentExcludedPaths = applyIntentExclusionsToCoverage(coverage, bundle.intent_checkpoint?.excluded_scope);
96
- // T5 #12 content-addressed GRANULAR staleness: preserve prior completion for
97
- // files whose audit inputs (content signal + required lenses + unit membership)
98
- // are unchanged from the recorded baseline, so a re-plan triggered by an
99
- // unrelated upstream change doesn't re-audit files that didn't move. First plan
100
- // (no baseline) preserves nothing → identical to prior behavior. Then re-record
101
- // the per-element baselines for THIS coverage so the next re-plan can compare.
102
- const coverageContentSig = coverageContentSignature(bundle.repo_manifest);
103
- const preservedCount = applyContentAddressedPreservation(coverage, bundle.coverage_matrix, readCoverageElementBaselines(bundle.artifact_metadata), coverageContentSig);
104
- const refreshedCoverageBaselines = recordCoverageElementBaselines(coverage, coverageContentSig);
105
- const flowCoverage = buildFlowCoverage(bundle.critical_flows, coverage);
106
- const runtimeCommand = await discoverRuntimeValidationCommand(root);
107
- const runtimeValidationTasks = buildRuntimeValidationTasks({
108
- unitManifest: bundle.unit_manifest,
109
- criticalFlows: bundle.critical_flows,
110
- flowCoverage,
111
- command: runtimeCommand,
112
- });
113
- const runtimeValidationReport = runtimeValidationTasks.tasks.length > 0
114
- ? mergeCurrentRuntimeValidationReport(runtimeValidationTasks, bundle)
115
- : undefined;
116
- // Interpret free_form_intent into lens priority boosts via the single shared
117
- // clause-aware authority (deterministic, no LLM). Unencodable clauses are NOT
118
- // dropped here — they are gated upstream as a blocking checkpoint question
119
- // (state.ts intent_checkpoint_current), so by the time planning runs every
120
- // clause is either an encoded signal or an explicitly host-answered constraint.
121
- const freeFormIntent = bundle.intent_checkpoint?.free_form_intent ?? "";
122
- const intentBoostLenses = interpretFreeFormIntent(freeFormIntent);
123
- if (freeFormIntent.trim().length > 0) {
124
- const interpretation = interpretFreeFormIntentForAudit(freeFormIntent);
125
- // INV-S04: derived signal only — never the verbatim free_form_intent. Each
126
- // encoded clause's `detail` is a generated description, not the raw input.
127
- const encodedSignals = interpretation.encoded_clauses.map((c) => `${c.kind}${c.lens ? `:${c.lens}` : ""}`);
128
- process.stderr.write(JSON.stringify({
129
- kind: "intent_keyword_interpretation",
130
- boosted_lenses: intentBoostLenses,
131
- encoded_signals: encodedSignals,
132
- ts: new Date().toISOString(),
133
- }) + "\n");
134
- }
135
- const taskBuildOptions = {
136
- external_analyzer_results: externalAnalyzerResults,
137
- critical_flows: bundle.critical_flows,
138
- ...(effectiveLenses !== undefined ? { limit_lenses: effectiveLenses } : {}),
139
- ...(intentBoostLenses.length > 0 ? { intent_priority_boost: intentBoostLenses } : {}),
140
- };
141
- // Ask the existing flow-first builder who owns every current review subject,
142
- // including paths another result already covered, before reserving old work.
143
- // Ownership is compared per file (`fileAssignmentKey`): the chunks of this
144
- // all-pending build differ from the published ones, so a chunk-level fact
145
- // (priority, signal, split) would reject an unchanged published task.
146
- // `publishedTaskIds` is the one input of this plan that the dependency map does
147
- // not declare: it chooses which pending tasks keep their ids, never which
148
- // lens:path pairs are planned, so it adds no staleness edge.
149
- const assignmentTasks = buildChunkedAuditTasks({ ...coverage, files: coverage.files.map(file => file.audit_status === "excluded" ? file :
150
- { ...file, audit_status: "pending", completed_lenses: [] }) }, lineIndex, taskBuildOptions);
151
- const liveAssignments = new Map(assignmentTasks.flatMap(task => task.file_paths.map(path => [`${task.lens}:${path}`, fileAssignmentKey(task)])));
152
- const externalPaths = getExternalSignalPaths(externalAnalyzerResults);
153
- const liveCoverage = new Map(coverage.files.map(file => [file.path, file]));
154
- const oldBaselines = readCoverageElementBaselines(bundle.artifact_metadata);
155
- const partition = derivePendingTaskPartition(bundle);
156
- const preservedReviewTasks = partition.pendingTasks.filter(task => publishedTaskIds.has(task.task_id) &&
157
- !partition.staleResultTaskIds.has(task.task_id) && !task.tags?.includes(DEEPENING_TAG) && !isArchitectureDiscoveryTask(task) &&
158
- taskLeadsAreCurrent(task, externalPaths, intentBoostLenses) &&
159
- task.file_paths.every(path => {
160
- const file = liveCoverage.get(path);
161
- const source = coverageContentSig[path];
162
- return file && file.audit_status !== "excluded" && file.required_lenses.includes(task.lens) &&
163
- isSha256(source) && task.inputs?.[`source:${path}`] === source &&
164
- oldBaselines?.[path] === deriveCoverageElementKey(file, source) && liveAssignments.get(`${task.lens}:${path}`) === fileAssignmentKey(task);
165
- }));
166
- const reserved = new Set(preservedReviewTasks.flatMap(task => task.file_paths.map(path => `${task.lens}:${path}`)));
167
- const remainingCoverage = { ...coverage, files: coverage.files.map(file => ({ ...file,
168
- completed_lenses: [...new Set([...file.completed_lenses, ...file.required_lenses.filter(lens => reserved.has(`${lens}:${file.path}`))])] })) };
169
- const auditTasks = buildChunkedAuditTasks(remainingCoverage, lineIndex, taskBuildOptions);
170
- const taggedAuditTasks = auditTasks.map((task) => ({
171
- ...task,
172
- status: task.status ?? "pending",
173
- }));
174
- const requeuePayload = buildRequeuePayload(coverage, bundle.critical_flows, flowCoverage, externalAnalyzerResults);
175
- // Fold pending requeue tasks into the review set so mandatory coverage gaps
176
- // produce host work items — through the SHARED fold (`foldPendingRequeueTasks`),
177
- // whose dedupe is COVERAGE-based: a requeue task whose (path × lens) an
178
- // existing audit task already covers is a duplicate of planned work (the fresh
179
- // -plan requeue payload mirrors the whole pending set under different ids), so
180
- // only genuinely-uncovered gaps survive — and those ARE persisted below
181
- // (INV-PLAN-PERSIST-COMPLETE).
182
- const pendingRequeueTasks = foldPendingRequeueTasks({
183
- requeueTasks: requeuePayload.tasks,
184
- auditTasks: [...preservedReviewTasks, ...taggedAuditTasks],
185
- lineIndex,
186
- effectiveLenses,
187
- });
188
- // Freeze local estimates on every review task: a byte-based token estimate and
189
- // a deterministic risk seed. These persist as descriptive host-workload
190
- // metadata; the estimate-review step may later refine them.
191
- const sourceHashes = new Map(bundle.repo_manifest.files.map((file) => [file.path, file.hash ?? "unversioned"]));
192
- const freezeEstimates = (task) => ({
193
- ...task,
194
- inputs: { ...task.inputs, ...Object.fromEntries(task.file_paths.map((path) => [`source:${path}`, sourceHashes.get(path) ?? "unversioned"])) },
195
- token_estimate: task.token_estimate ??
196
- taskContentTokens(task, resolvedSizeIndex, lineIndex),
197
- risk_estimate: task.risk_estimate ?? computeRiskEstimate(task),
198
- });
199
- const enrichedAuditTasks = taggedAuditTasks.map(freezeEstimates);
200
- const allReviewTasks = canonicalizeAuditTasks([
201
- // Keep the original frozen subject, including its source snapshots and prompt rationale.
202
- ...preservedReviewTasks,
203
- ...enrichedAuditTasks,
204
- ...pendingRequeueTasks.map(freezeEstimates),
205
- // Reconciliation must not drop unrelated in-flight verification work.
206
- ...(bundle.audit_tasks ?? []).filter((task) => task.tags?.includes(DEEPENING_TAG) &&
207
- !isArchitectureDiscoveryTask(task) && task.file_paths.every((path) => {
208
- const file = liveCoverage.get(path);
209
- return file !== undefined && file.audit_status !== "excluded";
210
- })).map(freezeEstimates),
211
- ...architectureDiscoveryTasks({ ...bundle, coverage_matrix: coverage }, lineIndex).map(freezeEstimates),
212
- ]);
213
- // Persist frozen task nodes and their soft affinity edges; the host workload
214
- // later projects canonical coherence groups from this graph.
215
- const taskAffinityGraph = buildTaskAffinityGraph(allReviewTasks, {
216
- graphBundle: bundle.graph_bundle,
217
- });
218
- const auditPlanMetrics = buildAuditPlanMetrics(allReviewTasks, {
219
- affinityGraph: taskAffinityGraph,
220
- graphBundle: bundle.graph_bundle,
221
- lineIndex,
222
- sizeIndex: resolvedSizeIndex,
223
- });
224
- const scopeSummary = resolvedScope.mode === "delta"
225
- ? ` Delta scope since ${resolvedScope.since}: ${resolvedScope.seed_files.length} changed file(s) + ${resolvedScope.expanded_files.length} graph neighbour(s) queued; a full audit is advised before release.`
226
- : "";
227
- return {
228
- updated: {
229
- ...bundle,
230
- scope: resolvedScope,
231
- coverage_matrix: coverage,
232
- flow_coverage: flowCoverage,
233
- runtime_validation_tasks: runtimeValidationTasks,
234
- runtime_validation_report: runtimeValidationReport,
235
- // INV-PLAN-PERSIST-COMPLETE: the persisted review set is the whole merged
236
- // list. An omitted task would be a phantom described by the affinity graph
237
- // and metrics but absent from the emitted workload. Estimates on every
238
- // entry are frozen (INV-PLAN-FROZEN-ESTIMATES).
239
- audit_tasks: allReviewTasks,
240
- audit_plan_metrics: auditPlanMetrics,
241
- task_affinity_graph: taskAffinityGraph,
242
- requeue_tasks: requeuePayload.tasks,
243
- audit_report: undefined,
244
- artifact_metadata: withCoverageElementBaselines(bundle.artifact_metadata, refreshedCoverageBaselines),
245
- },
246
- artifacts_written: [
247
- "scope.json",
248
- "coverage_matrix.json",
249
- "flow_coverage.json",
250
- "runtime_validation_tasks.json",
251
- ...(runtimeValidationReport ? ["runtime_validation_report.json"] : []),
252
- "audit_tasks.json",
253
- "audit_plan_metrics.json",
254
- "task_affinity_graph.json",
255
- "requeue_tasks.json",
256
- ],
257
- progress_summary: `Built planning artifacts; generated ${taggedAuditTasks.length} review tasks and ${requeuePayload.task_count} requeue tasks.` +
258
- scopeSummary +
259
- (skippedTrivialPaths.length > 0
260
- ? ` Skipped ${skippedTrivialPaths.length} trivial path${skippedTrivialPaths.length === 1 ? "" : "s"} from semantic review.`
261
- : "") +
262
- (preservedCount > 0
263
- ? ` Preserved prior completion for ${preservedCount} unchanged file${preservedCount === 1 ? "" : "s"} (content-addressed staleness).`
264
- : "") +
265
- (intentExcludedPaths.length > 0
266
- ? ` Excluded ${intentExcludedPaths.length} path${intentExcludedPaths.length === 1 ? "" : "s"} per the intent checkpoint.`
267
- : "") +
268
- (runtimeCommand
269
- ? ` Runtime validation will use: ${runtimeCommand.join(" ")}.`
270
- : " No deterministic runtime validation command was discovered."),
271
- };
272
- }
273
- //# sourceMappingURL=planningExecutors.js.map