audit-tools 0.56.2 → 0.57.1

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 (374) hide show
  1. package/README.md +24 -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 +7 -139
  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 +459 -1
  17. package/dist/audit/cli/dispatch/hostHandoff.d.ts.map +1 -1
  18. package/dist/audit/cli/dispatch/hostHandoff.js +312 -1
  19. package/dist/audit/cli/dispatch/hostHandoff.js.map +1 -1
  20. package/dist/audit/cli/dispatch/packetFilter.d.ts +1 -1
  21. package/dist/audit/cli/dispatch/questionReviewAcceptance.d.ts +254 -0
  22. package/dist/audit/cli/dispatch/questionReviewAcceptance.d.ts.map +1 -0
  23. package/dist/audit/cli/dispatch/questionReviewAcceptance.js +183 -0
  24. package/dist/audit/cli/dispatch/questionReviewAcceptance.js.map +1 -0
  25. package/dist/audit/cli/foldTransaction.d.ts +1 -1
  26. package/dist/audit/cli/foldTransaction.d.ts.map +1 -1
  27. package/dist/audit/cli/foldTransaction.js +3 -2
  28. package/dist/audit/cli/foldTransaction.js.map +1 -1
  29. package/dist/audit/cli/functionalPreflight.d.ts +4 -4
  30. package/dist/audit/cli/laneSubmissions.d.ts +4 -4
  31. package/dist/audit/cli/nextStepCommand.d.ts +3 -20
  32. package/dist/audit/cli/nextStepCommand.d.ts.map +1 -1
  33. package/dist/audit/cli/nextStepCommand.js +64 -141
  34. package/dist/audit/cli/nextStepCommand.js.map +1 -1
  35. package/dist/audit/cli/nextStepHelpers.d.ts +10 -72
  36. package/dist/audit/cli/nextStepHelpers.d.ts.map +1 -1
  37. package/dist/audit/cli/nextStepHelpers.js +115 -375
  38. package/dist/audit/cli/nextStepHelpers.js.map +1 -1
  39. package/dist/audit/cli/prompts.d.ts +0 -2
  40. package/dist/audit/cli/prompts.d.ts.map +1 -1
  41. package/dist/audit/cli/prompts.js +3 -14
  42. package/dist/audit/cli/prompts.js.map +1 -1
  43. package/dist/audit/cli/questionReviewCycle.d.ts +281 -0
  44. package/dist/audit/cli/questionReviewCycle.d.ts.map +1 -0
  45. package/dist/audit/cli/questionReviewCycle.js +87 -0
  46. package/dist/audit/cli/questionReviewCycle.js.map +1 -0
  47. package/dist/audit/cli/questionReviewSession.d.ts +21 -0
  48. package/dist/audit/cli/questionReviewSession.d.ts.map +1 -0
  49. package/dist/audit/cli/questionReviewSession.js +111 -0
  50. package/dist/audit/cli/questionReviewSession.js.map +1 -0
  51. package/dist/audit/cli/questionWorkloadBindings.d.ts +7 -0
  52. package/dist/audit/cli/questionWorkloadBindings.d.ts.map +1 -0
  53. package/dist/audit/cli/questionWorkloadBindings.js +68 -0
  54. package/dist/audit/cli/questionWorkloadBindings.js.map +1 -0
  55. package/dist/audit/cli/resynthesizeCommand.d.ts +1 -0
  56. package/dist/audit/cli/resynthesizeCommand.d.ts.map +1 -1
  57. package/dist/audit/cli/resynthesizeCommand.js +52 -51
  58. package/dist/audit/cli/resynthesizeCommand.js.map +1 -1
  59. package/dist/audit/cli/sampleRunCommand.d.ts +600 -159
  60. package/dist/audit/cli/sampleRunCommand.d.ts.map +1 -1
  61. package/dist/audit/cli/sampleRunCommand.js +66 -152
  62. package/dist/audit/cli/sampleRunCommand.js.map +1 -1
  63. package/dist/audit/cli/statusCommand.d.ts.map +1 -1
  64. package/dist/audit/cli/statusCommand.js +20 -14
  65. package/dist/audit/cli/statusCommand.js.map +1 -1
  66. package/dist/audit/cli/steps.d.ts +10 -10
  67. package/dist/audit/cli/submitCommand.d.ts +13 -6
  68. package/dist/audit/cli/submitCommand.d.ts.map +1 -1
  69. package/dist/audit/cli/submitCommand.js +121 -24
  70. package/dist/audit/cli/submitCommand.js.map +1 -1
  71. package/dist/audit/cli.d.ts.map +1 -1
  72. package/dist/audit/cli.js +7 -17
  73. package/dist/audit/cli.js.map +1 -1
  74. package/dist/audit/contracts/findingContractPrompt.d.ts +4 -4
  75. package/dist/audit/contracts/workerSchemas.d.ts +83 -82
  76. package/dist/audit/contracts/workerSchemas.d.ts.map +1 -1
  77. package/dist/audit/contracts/workerSchemas.js +8 -1
  78. package/dist/audit/contracts/workerSchemas.js.map +1 -1
  79. package/dist/audit/contracts/wrapperResponse.d.ts +13 -13
  80. package/dist/audit/contracts/wrapperResponse.d.ts.map +1 -1
  81. package/dist/audit/contracts/wrapperResponse.js +0 -1
  82. package/dist/audit/contracts/wrapperResponse.js.map +1 -1
  83. package/dist/audit/extractors/designAssessment.js +2 -2
  84. package/dist/audit/extractors/designAssessment.js.map +1 -1
  85. package/dist/audit/io/artifacts.d.ts +37 -10
  86. package/dist/audit/io/artifacts.d.ts.map +1 -1
  87. package/dist/audit/io/artifacts.js +217 -33
  88. package/dist/audit/io/artifacts.js.map +1 -1
  89. package/dist/audit/io/rollover.d.ts.map +1 -1
  90. package/dist/audit/io/rollover.js +7 -16
  91. package/dist/audit/io/rollover.js.map +1 -1
  92. package/dist/audit/io/runSnapshot.d.ts +1 -1
  93. package/dist/audit/io/runSnapshot.js +1 -1
  94. package/dist/audit/orchestrator/architectureDiscovery.d.ts +9 -10
  95. package/dist/audit/orchestrator/architectureDiscovery.d.ts.map +1 -1
  96. package/dist/audit/orchestrator/architectureDiscovery.js +95 -13
  97. package/dist/audit/orchestrator/architectureDiscovery.js.map +1 -1
  98. package/dist/audit/orchestrator/charterPacketArchive.d.ts +3 -0
  99. package/dist/audit/orchestrator/charterPacketArchive.d.ts.map +1 -1
  100. package/dist/audit/orchestrator/charterPacketArchive.js +31 -2
  101. package/dist/audit/orchestrator/charterPacketArchive.js.map +1 -1
  102. package/dist/audit/orchestrator/dependencyMap.d.ts +2 -8
  103. package/dist/audit/orchestrator/dependencyMap.d.ts.map +1 -1
  104. package/dist/audit/orchestrator/dependencyMap.js +10 -105
  105. package/dist/audit/orchestrator/dependencyMap.js.map +1 -1
  106. package/dist/audit/orchestrator/dependencySlices.d.ts +2 -3
  107. package/dist/audit/orchestrator/dependencySlices.d.ts.map +1 -1
  108. package/dist/audit/orchestrator/dependencySlices.js +2 -35
  109. package/dist/audit/orchestrator/dependencySlices.js.map +1 -1
  110. package/dist/audit/orchestrator/designReviewPrompt.d.ts.map +1 -1
  111. package/dist/audit/orchestrator/designReviewPrompt.js +24 -14
  112. package/dist/audit/orchestrator/designReviewPrompt.js.map +1 -1
  113. package/dist/audit/orchestrator/executorRunners.d.ts +1 -1
  114. package/dist/audit/orchestrator/executorRunners.d.ts.map +1 -1
  115. package/dist/audit/orchestrator/executorRunners.js +14 -21
  116. package/dist/audit/orchestrator/executorRunners.js.map +1 -1
  117. package/dist/audit/orchestrator/executors.d.ts.map +1 -1
  118. package/dist/audit/orchestrator/executors.js +1 -131
  119. package/dist/audit/orchestrator/executors.js.map +1 -1
  120. package/dist/audit/orchestrator/flowPlanning.d.ts +1 -1
  121. package/dist/audit/orchestrator/flowPlanning.js +1 -1
  122. package/dist/audit/orchestrator/ingestionExecutors.d.ts.map +1 -1
  123. package/dist/audit/orchestrator/ingestionExecutors.js +19 -12
  124. package/dist/audit/orchestrator/ingestionExecutors.js.map +1 -1
  125. package/dist/audit/orchestrator/intentCheckpointExecutor.d.ts +2 -2
  126. package/dist/audit/orchestrator/intentCheckpointExecutor.d.ts.map +1 -1
  127. package/dist/audit/orchestrator/intentCheckpointExecutor.js +37 -36
  128. package/dist/audit/orchestrator/intentCheckpointExecutor.js.map +1 -1
  129. package/dist/audit/orchestrator/lensSelection.d.ts +6 -37
  130. package/dist/audit/orchestrator/lensSelection.d.ts.map +1 -1
  131. package/dist/audit/orchestrator/lensSelection.js +42 -68
  132. package/dist/audit/orchestrator/lensSelection.js.map +1 -1
  133. package/dist/audit/orchestrator/nextStep.d.ts.map +1 -1
  134. package/dist/audit/orchestrator/nextStep.js +1 -4
  135. package/dist/audit/orchestrator/nextStep.js.map +1 -1
  136. package/dist/audit/orchestrator/questionEvidence.d.ts +67 -0
  137. package/dist/audit/orchestrator/questionEvidence.d.ts.map +1 -0
  138. package/dist/audit/orchestrator/questionEvidence.js +177 -0
  139. package/dist/audit/orchestrator/questionEvidence.js.map +1 -0
  140. package/dist/audit/orchestrator/questionPlanExecutor.d.ts +10 -0
  141. package/dist/audit/orchestrator/questionPlanExecutor.d.ts.map +1 -0
  142. package/dist/audit/orchestrator/questionPlanExecutor.js +23 -0
  143. package/dist/audit/orchestrator/questionPlanExecutor.js.map +1 -0
  144. package/dist/audit/orchestrator/questionPlanning.d.ts +48 -0
  145. package/dist/audit/orchestrator/questionPlanning.d.ts.map +1 -0
  146. package/dist/audit/orchestrator/questionPlanning.js +326 -0
  147. package/dist/audit/orchestrator/questionPlanning.js.map +1 -0
  148. package/dist/audit/orchestrator/requeueCommand.d.ts +1 -1
  149. package/dist/audit/orchestrator/reviewLensPlaybooks.d.ts +11 -0
  150. package/dist/audit/orchestrator/reviewLensPlaybooks.d.ts.map +1 -0
  151. package/dist/audit/orchestrator/reviewLensPlaybooks.js +11 -0
  152. package/dist/audit/orchestrator/reviewLensPlaybooks.js.map +1 -0
  153. package/dist/audit/orchestrator/runtimeValidation.d.ts.map +1 -1
  154. package/dist/audit/orchestrator/runtimeValidation.js +14 -0
  155. package/dist/audit/orchestrator/runtimeValidation.js.map +1 -1
  156. package/dist/audit/orchestrator/runtimeValidationUpdate.d.ts +1 -1
  157. package/dist/audit/orchestrator/runtimeValidationUpdate.d.ts.map +1 -1
  158. package/dist/audit/orchestrator/runtimeValidationUpdate.js +13 -4
  159. package/dist/audit/orchestrator/runtimeValidationUpdate.js.map +1 -1
  160. package/dist/audit/orchestrator/selectiveDeepening/conflict.js +1 -1
  161. package/dist/audit/orchestrator/selectiveDeepening/conflict.js.map +1 -1
  162. package/dist/audit/orchestrator/selectiveDeepening/index.js +1 -1
  163. package/dist/audit/orchestrator/selectiveDeepening/index.js.map +1 -1
  164. package/dist/audit/orchestrator/state.d.ts.map +1 -1
  165. package/dist/audit/orchestrator/state.js +8 -60
  166. package/dist/audit/orchestrator/state.js.map +1 -1
  167. package/dist/audit/orchestrator/synthesisExecutors.d.ts +15 -1
  168. package/dist/audit/orchestrator/synthesisExecutors.d.ts.map +1 -1
  169. package/dist/audit/orchestrator/synthesisExecutors.js +76 -25
  170. package/dist/audit/orchestrator/synthesisExecutors.js.map +1 -1
  171. package/dist/audit/orchestrator/systemicChallengeExecutor.d.ts.map +1 -1
  172. package/dist/audit/orchestrator/systemicChallengeExecutor.js +11 -6
  173. package/dist/audit/orchestrator/systemicChallengeExecutor.js.map +1 -1
  174. package/dist/audit/orchestrator/taskAffinityGraph.d.ts +4 -4
  175. package/dist/audit/reporting/questionReport.d.ts +28 -0
  176. package/dist/audit/reporting/questionReport.d.ts.map +1 -0
  177. package/dist/audit/reporting/questionReport.js +186 -0
  178. package/dist/audit/reporting/questionReport.js.map +1 -0
  179. package/dist/audit/reporting/synthesis.d.ts +10 -1
  180. package/dist/audit/reporting/synthesis.d.ts.map +1 -1
  181. package/dist/audit/reporting/synthesis.js +161 -24
  182. package/dist/audit/reporting/synthesis.js.map +1 -1
  183. package/dist/audit/reporting/synthesisNarrativePrompt.d.ts +4 -1
  184. package/dist/audit/reporting/synthesisNarrativePrompt.d.ts.map +1 -1
  185. package/dist/audit/reporting/synthesisNarrativePrompt.js +5 -1
  186. package/dist/audit/reporting/synthesisNarrativePrompt.js.map +1 -1
  187. package/dist/audit/supervisor/operatorHandoff.d.ts +2 -3
  188. package/dist/audit/supervisor/operatorHandoff.d.ts.map +1 -1
  189. package/dist/audit/supervisor/operatorHandoff.js +3 -18
  190. package/dist/audit/supervisor/operatorHandoff.js.map +1 -1
  191. package/dist/audit/systemic/aggregateMetricsDigest.d.ts.map +1 -1
  192. package/dist/audit/systemic/aggregateMetricsDigest.js +0 -2
  193. package/dist/audit/systemic/aggregateMetricsDigest.js.map +1 -1
  194. package/dist/audit/types/artifactMetadata.d.ts +1 -2
  195. package/dist/audit/types/artifactMetadata.d.ts.map +1 -1
  196. package/dist/audit/types/auditState.d.ts +6 -6
  197. package/dist/audit/types/conceptualAdjudication.d.ts +708 -50
  198. package/dist/audit/types/conceptualAdjudication.d.ts.map +1 -1
  199. package/dist/audit/types/conceptualAdjudication.js +2 -0
  200. package/dist/audit/types/conceptualAdjudication.js.map +1 -1
  201. package/dist/audit/types/runtimeValidation.d.ts +58 -6
  202. package/dist/audit/types/runtimeValidation.d.ts.map +1 -1
  203. package/dist/audit/types/runtimeValidation.js +8 -0
  204. package/dist/audit/types/runtimeValidation.js.map +1 -1
  205. package/dist/audit/types.d.ts +551 -34
  206. package/dist/audit/types.d.ts.map +1 -1
  207. package/dist/audit/validation/auditResults.d.ts +1 -1
  208. package/dist/audit/validation/auditResults.js +1 -1
  209. package/dist/audit/validation/ingestIssueCodes.d.ts.map +1 -1
  210. package/dist/audit/validation/ingestIssueCodes.js +0 -1
  211. package/dist/audit/validation/ingestIssueCodes.js.map +1 -1
  212. package/dist/remediate/contractPipeline/executionPlan.d.ts +679 -52
  213. package/dist/remediate/contractPipeline/executionPlan.d.ts.map +1 -1
  214. package/dist/remediate/contractPipeline/executionPlan.js +23 -0
  215. package/dist/remediate/contractPipeline/executionPlan.js.map +1 -1
  216. package/dist/remediate/findingFilter.d.ts.map +1 -1
  217. package/dist/remediate/findingFilter.js +6 -2
  218. package/dist/remediate/findingFilter.js.map +1 -1
  219. package/dist/remediate/intake.d.ts +4 -4
  220. package/dist/remediate/phases/close.d.ts.map +1 -1
  221. package/dist/remediate/phases/close.js +15 -5
  222. package/dist/remediate/phases/close.js.map +1 -1
  223. package/dist/remediate/phases/closeVerifyAnalyzerLeads.d.ts +5 -0
  224. package/dist/remediate/phases/closeVerifyAnalyzerLeads.d.ts.map +1 -1
  225. package/dist/remediate/phases/closeVerifyAnalyzerLeads.js +37 -8
  226. package/dist/remediate/phases/closeVerifyAnalyzerLeads.js.map +1 -1
  227. package/dist/remediate/state/types.d.ts +619 -26
  228. package/dist/remediate/state/types.d.ts.map +1 -1
  229. package/dist/remediate/state/types.js +2 -1
  230. package/dist/remediate/state/types.js.map +1 -1
  231. package/dist/remediate/steps/contractPipeline.d.ts.map +1 -1
  232. package/dist/remediate/steps/contractPipeline.js +2 -0
  233. package/dist/remediate/steps/contractPipeline.js.map +1 -1
  234. package/dist/remediate/steps/contractPipelinePrompts.d.ts.map +1 -1
  235. package/dist/remediate/steps/contractPipelinePrompts.js +2 -0
  236. package/dist/remediate/steps/contractPipelinePrompts.js.map +1 -1
  237. package/dist/remediate/steps/dispatch/contractConformanceReview.d.ts +3 -3
  238. package/dist/remediate/steps/intakeResolver.d.ts.map +1 -1
  239. package/dist/remediate/steps/intakeResolver.js +31 -6
  240. package/dist/remediate/steps/intakeResolver.js.map +1 -1
  241. package/dist/remediate/steps/nextStep.d.ts.map +1 -1
  242. package/dist/remediate/steps/nextStep.js +47 -44
  243. package/dist/remediate/steps/nextStep.js.map +1 -1
  244. package/dist/remediate/steps/prompts.d.ts.map +1 -1
  245. package/dist/remediate/steps/prompts.js +3 -0
  246. package/dist/remediate/steps/prompts.js.map +1 -1
  247. package/dist/shared/analyzers/types.d.ts +18 -18
  248. package/dist/shared/contentKey.d.ts +1 -1
  249. package/dist/shared/contentKey.js +1 -1
  250. package/dist/shared/decompose/charterClarification.d.ts +4 -4
  251. package/dist/shared/decompose/charterExtraction.d.ts +31 -31
  252. package/dist/shared/decompose/contentCoherence.d.ts +1 -1
  253. package/dist/shared/decompose/contentCoherence.js +1 -1
  254. package/dist/shared/decompose/systemicChallenge.d.ts +629 -18
  255. package/dist/shared/decompose/systemicChallenge.d.ts.map +1 -1
  256. package/dist/shared/engine/obligationEngine.d.ts +2 -2
  257. package/dist/shared/index.d.ts +2 -0
  258. package/dist/shared/index.d.ts.map +1 -1
  259. package/dist/shared/index.js +2 -0
  260. package/dist/shared/index.js.map +1 -1
  261. package/dist/shared/io/stepContractWriter.js +1 -1
  262. package/dist/shared/io/stepContractWriter.js.map +1 -1
  263. package/dist/shared/loopCorePaths.d.ts.map +1 -1
  264. package/dist/shared/loopCorePaths.js +5 -2
  265. package/dist/shared/loopCorePaths.js.map +1 -1
  266. package/dist/shared/mcp/submitServer.d.ts +1 -0
  267. package/dist/shared/mcp/submitServer.d.ts.map +1 -1
  268. package/dist/shared/mcp/submitServer.js +1 -1
  269. package/dist/shared/mcp/submitServer.js.map +1 -1
  270. package/dist/shared/submission/hostResultOutcomes.js +1 -1
  271. package/dist/shared/submission/hostResultOutcomes.js.map +1 -1
  272. package/dist/shared/tooling/exec.js +1 -1
  273. package/dist/shared/tooling/exec.js.map +1 -1
  274. package/dist/shared/types/charter.d.ts +38 -38
  275. package/dist/shared/types/contractPropertyShapes.d.ts.map +1 -1
  276. package/dist/shared/types/contractPropertyShapes.js +7 -0
  277. package/dist/shared/types/contractPropertyShapes.js.map +1 -1
  278. package/dist/shared/types/executionPlan.d.ts +88 -12
  279. package/dist/shared/types/executionPlan.d.ts.map +1 -1
  280. package/dist/shared/types/executionPlan.js +1 -0
  281. package/dist/shared/types/executionPlan.js.map +1 -1
  282. package/dist/shared/types/finding.d.ts +1721 -56
  283. package/dist/shared/types/finding.d.ts.map +1 -1
  284. package/dist/shared/types/finding.js +7 -10
  285. package/dist/shared/types/finding.js.map +1 -1
  286. package/dist/shared/types/findingVocabulary.d.ts +8 -0
  287. package/dist/shared/types/findingVocabulary.d.ts.map +1 -0
  288. package/dist/shared/types/findingVocabulary.js +13 -0
  289. package/dist/shared/types/findingVocabulary.js.map +1 -0
  290. package/dist/shared/types/intentCheckpoint.d.ts +8 -3
  291. package/dist/shared/types/intentCheckpoint.d.ts.map +1 -1
  292. package/dist/shared/types/intentCheckpoint.js +4 -3
  293. package/dist/shared/types/intentCheckpoint.js.map +1 -1
  294. package/dist/shared/types/questionReviewReport.d.ts +10574 -0
  295. package/dist/shared/types/questionReviewReport.d.ts.map +1 -0
  296. package/dist/shared/types/questionReviewReport.js +186 -0
  297. package/dist/shared/types/questionReviewReport.js.map +1 -0
  298. package/dist/shared/types/remediationOutcome.d.ts +1379 -148
  299. package/dist/shared/types/remediationOutcome.d.ts.map +1 -1
  300. package/dist/shared/types/remediationOutcome.js +5 -0
  301. package/dist/shared/types/remediationOutcome.js.map +1 -1
  302. package/dist/shared/types/reviewIndependence.d.ts +24 -24
  303. package/dist/shared/types/reviewQuestion.d.ts +4710 -0
  304. package/dist/shared/types/reviewQuestion.d.ts.map +1 -0
  305. package/dist/shared/types/reviewQuestion.js +216 -0
  306. package/dist/shared/types/reviewQuestion.js.map +1 -0
  307. package/dist/shared/types/stepContract.js +1 -1
  308. package/dist/shared/types/stepContract.js.map +1 -1
  309. package/dist/shared/validation/designFindingGrounding.js +1 -1
  310. package/dist/shared/validation/designFindingGrounding.js.map +1 -1
  311. package/dist/shared/validation/findingsReport.d.ts.map +1 -1
  312. package/dist/shared/validation/findingsReport.js +19 -4
  313. package/dist/shared/validation/findingsReport.js.map +1 -1
  314. package/docs/audit-pkg/contracts.md +27 -56
  315. package/docs/audit-pkg/operator-guide.md +31 -17
  316. package/docs/audit-pkg/product.md +17 -23
  317. package/package.json +1 -1
  318. package/schemas/audit-code-v1alpha1.schema.json +0 -1
  319. package/schemas/review_submission.schema.json +514 -0
  320. package/skills/audit-code/audit-code.prompt.md +7 -5
  321. package/wrapper/audit-code-wrapper-lib.mjs +1 -5
  322. package/wrapper/installer-verb-help.mjs +1 -1
  323. package/dist/audit/cli/explainTaskCommand.d.ts +0 -4
  324. package/dist/audit/cli/explainTaskCommand.d.ts.map +0 -1
  325. package/dist/audit/cli/explainTaskCommand.js +0 -45
  326. package/dist/audit/cli/explainTaskCommand.js.map +0 -1
  327. package/dist/audit/cli/ingestResultsCommand.d.ts +0 -2
  328. package/dist/audit/cli/ingestResultsCommand.d.ts.map +0 -1
  329. package/dist/audit/cli/ingestResultsCommand.js +0 -42
  330. package/dist/audit/cli/ingestResultsCommand.js.map +0 -1
  331. package/dist/audit/cli/requeueCommand.d.ts +0 -2
  332. package/dist/audit/cli/requeueCommand.d.ts.map +0 -1
  333. package/dist/audit/cli/requeueCommand.js +0 -12
  334. package/dist/audit/cli/requeueCommand.js.map +0 -1
  335. package/dist/audit/cli/semanticReviewStep.d.ts +0 -41
  336. package/dist/audit/cli/semanticReviewStep.d.ts.map +0 -1
  337. package/dist/audit/cli/semanticReviewStep.js +0 -185
  338. package/dist/audit/cli/semanticReviewStep.js.map +0 -1
  339. package/dist/audit/cli/unacceptResultsCommand.d.ts +0 -19
  340. package/dist/audit/cli/unacceptResultsCommand.d.ts.map +0 -1
  341. package/dist/audit/cli/unacceptResultsCommand.js +0 -52
  342. package/dist/audit/cli/unacceptResultsCommand.js.map +0 -1
  343. package/dist/audit/cli/updateRuntimeValidationCommand.d.ts +0 -2
  344. package/dist/audit/cli/updateRuntimeValidationCommand.d.ts.map +0 -1
  345. package/dist/audit/cli/updateRuntimeValidationCommand.js +0 -18
  346. package/dist/audit/cli/updateRuntimeValidationCommand.js.map +0 -1
  347. package/dist/audit/cli/validateResultsCommand.d.ts +0 -13
  348. package/dist/audit/cli/validateResultsCommand.d.ts.map +0 -1
  349. package/dist/audit/cli/validateResultsCommand.js +0 -87
  350. package/dist/audit/cli/validateResultsCommand.js.map +0 -1
  351. package/dist/audit/cli/workerResult.d.ts +0 -2
  352. package/dist/audit/cli/workerResult.d.ts.map +0 -1
  353. package/dist/audit/cli/workerResult.js +0 -6
  354. package/dist/audit/cli/workerResult.js.map +0 -1
  355. package/dist/audit/orchestrator/coverageElementBaseline.d.ts +0 -54
  356. package/dist/audit/orchestrator/coverageElementBaseline.d.ts.map +0 -1
  357. package/dist/audit/orchestrator/coverageElementBaseline.js +0 -136
  358. package/dist/audit/orchestrator/coverageElementBaseline.js.map +0 -1
  359. package/dist/audit/orchestrator/planning.d.ts +0 -5
  360. package/dist/audit/orchestrator/planning.d.ts.map +0 -1
  361. package/dist/audit/orchestrator/planning.js +0 -79
  362. package/dist/audit/orchestrator/planning.js.map +0 -1
  363. package/dist/audit/orchestrator/planningExecutors.d.ts +0 -21
  364. package/dist/audit/orchestrator/planningExecutors.d.ts.map +0 -1
  365. package/dist/audit/orchestrator/planningExecutors.js +0 -273
  366. package/dist/audit/orchestrator/planningExecutors.js.map +0 -1
  367. package/dist/audit/orchestrator/taskBuilder.d.ts +0 -62
  368. package/dist/audit/orchestrator/taskBuilder.d.ts.map +0 -1
  369. package/dist/audit/orchestrator/taskBuilder.js +0 -412
  370. package/dist/audit/orchestrator/taskBuilder.js.map +0 -1
  371. package/dist/audit/orchestrator/trivialAudit.d.ts +0 -21
  372. package/dist/audit/orchestrator/trivialAudit.d.ts.map +0 -1
  373. package/dist/audit/orchestrator/trivialAudit.js +0 -80
  374. package/dist/audit/orchestrator/trivialAudit.js.map +0 -1
@@ -1,412 +0,0 @@
1
- import { chunkByBudget, compareCodeUnits, hashContent, stableStringify } from "audit-tools/shared";
2
- import { claimFlowReviewBlocks } from "./flowPlanning.js";
3
- import { isTrivialAuditPath } from "./trivialAudit.js";
4
- import { LENS_ORDER, SENSITIVE_LENSES, priorityRank } from "./auditTaskUtils.js";
5
- import { isTestPath, normalizeExtractorPath, } from "../extractors/pathPatterns.js";
6
- import { isUnmeasuredLineCount } from "../cli/lineIndex.js";
7
- import { getExternalSignalPaths } from "./requeueUtils.js";
8
- function taskPriority(hasExternalSignal, lens, isCriticalFlow = false, intentBoostLenses) {
9
- let base;
10
- if (isCriticalFlow) {
11
- base =
12
- lens === "security" || lens === "reliability" || lens === "correctness"
13
- ? "high"
14
- : "medium";
15
- }
16
- else if (hasExternalSignal && SENSITIVE_LENSES.has(lens)) {
17
- base = "high";
18
- }
19
- else if (hasExternalSignal) {
20
- base = "medium";
21
- }
22
- else {
23
- base = lens === "security" || lens === "data_integrity" ? "medium" : "low";
24
- }
25
- // Apply intent_priority_boost: elevate one tier, never above 'high'.
26
- if (intentBoostLenses && intentBoostLenses.has(lens)) {
27
- if (base === "low")
28
- return "medium";
29
- if (base === "medium")
30
- return "high";
31
- // already "high" — no change
32
- }
33
- return base;
34
- }
35
- const DEFAULT_FILE_SPLIT_THRESHOLD = 5000;
36
- const DEFAULT_MAX_TASK_LINES = 3000;
37
- const DEFAULT_MAX_TASK_FILES = 0;
38
- const DEFAULT_TINY_TEST_FILE_LINES = 250;
39
- const TINY_TEST_UNIT_ID = "tests-tiny-files";
40
- /**
41
- * The file's size when it is genuinely KNOWN, `undefined` when the index carried
42
- * no key for it or carried the unmeasured sentinel. Every size CLASSIFICATION in
43
- * this module reads through here, so "unmeasured" can never decay into a number
44
- * a comparison happens to accept.
45
- */
46
- function measuredLinesOf(unitLineIndex, path) {
47
- const value = unitLineIndex[path];
48
- return isUnmeasuredLineCount(value) ? undefined : value;
49
- }
50
- /**
51
- * The file's size for BUDGET ARITHMETIC, where an unknown size contributes
52
- * nothing. Distinct from {@link measuredLinesOf} on purpose: the sentinel is
53
- * `NaN`, and letting it into a running total poisons the sum, after which every
54
- * `cost > budget` comparison is false and the greedy chunker silently stops
55
- * splitting. Zero is the right answer for "adds no known weight", and it is a
56
- * budgeting answer only — it never reaches a triviality verdict.
57
- */
58
- function budgetLinesOf(unitLineIndex, path) {
59
- return measuredLinesOf(unitLineIndex, path) ?? 0;
60
- }
61
- // Split a flat list of file paths into review-task-sized chunks, bounded by both
62
- // an aggregate line budget and a max file count. Thin adapter over the shared
63
- // `chunkByBudget` greedy chunker (extracted alongside chunkPacketTasks in
64
- // reviewPackets.ts — previously byte-identical loop shapes); the two trivial-bypass
65
- // shortcuts (empty input, both budgets disabled) are kept as-is since they are
66
- // cheap and avoid ever invoking the generic loop for the common unbounded case.
67
- function chunkByTaskBudget(filePaths, unitLineIndex, limits) {
68
- const { maxTaskLines, maxTaskFiles } = limits;
69
- if (filePaths.length === 0) {
70
- return [];
71
- }
72
- if (maxTaskLines <= 0 && maxTaskFiles <= 0) {
73
- return [filePaths];
74
- }
75
- return chunkByBudget(filePaths, {
76
- budget: maxTaskLines > 0 ? maxTaskLines : Number.POSITIVE_INFINITY,
77
- maxItems: maxTaskFiles > 0 ? maxTaskFiles : undefined,
78
- costOf: (candidate) => candidate.reduce((sum, path) => sum + budgetLinesOf(unitLineIndex, path), 0),
79
- });
80
- }
81
- // Emit one or more audit tasks for a scope/lens. Normal-sized files are grouped
82
- // into budget-bounded chunks; files over `fileSplitThreshold` get their own
83
- // isolated task. Hoisted to module scope: the per-call mutable accumulators
84
- // (`tasks`, `seen`) and budget config are now explicit parameters instead of
85
- // captured closure state.
86
- function addTaskBlock(params, context) {
87
- const { tasks, seen, unitLineIndex, fileSplitThreshold, budgetLimits, unmeasuredPaths } = context;
88
- // Tags for one emitted task. `unmeasured_line_count` is the explicit LEAD an
89
- // unmeasured `unitLineIndex` entry earns (see `buildPendingByLens`): the file
90
- // is still reviewed, but the task says out loud that its size was never
91
- // measured, so a downstream consumer can tell "unmeasured" from "measured and
92
- // small".
93
- const tagsFor = (chunk, extra) => {
94
- const lead = chunk.some((path) => unmeasuredPaths.has(path))
95
- ? ["unmeasured_line_count"]
96
- : [];
97
- const merged = [...new Set([...params.tags, ...extra, ...lead])];
98
- return merged.length > 0 ? merged : undefined;
99
- };
100
- const oversizedFiles = fileSplitThreshold > 0
101
- ? params.filePaths.filter((path) => budgetLinesOf(unitLineIndex, path) > fileSplitThreshold)
102
- : [];
103
- const oversizedSet = new Set(oversizedFiles);
104
- const normalFiles = params.filePaths.filter((path) => !oversizedSet.has(path));
105
- // A TASK ID NAMES EXACTLY ONE FILE SET, IN EVERY PLAN. Every re-plan re-chunks
106
- // the files still pending, and accepted results are re-validated against the
107
- // CURRENT tasks each time the run moves on (`executeAdvance`, src/audit/cli/auditStep.ts):
108
- // an id that is gone is a tolerated orphan, but an id that survives naming OTHER
109
- // files fails validation — once it stopped the run; now it is withdrawn and the
110
- // item re-reviewed, still wasted work. So a chunk id is derived from the
111
- // chunk's own sorted file set, never from its position (`part-N`) or from the
112
- // scope alone — the 2026-10-05 dogfood run stopped on 306 such reused ids.
113
- const normalChunks = chunkByTaskBudget(normalFiles, unitLineIndex, budgetLimits);
114
- for (const chunk of normalChunks) {
115
- const splitKind = normalChunks.length > 1 ? "budget" : "none";
116
- const fileSetDigest = hashContent(stableStringify([...chunk].sort((a, b) => compareCodeUnits(a, b))), { length: 12 });
117
- const taskId = `${params.scopeId}:${params.lens}:set-${fileSetDigest}`;
118
- if (!seen.has(taskId)) {
119
- seen.add(taskId);
120
- tasks.push({
121
- task_id: taskId,
122
- unit_id: params.unitId,
123
- pass_id: params.passId,
124
- lens: params.lens,
125
- file_paths: chunk,
126
- rationale: params.rationale(chunk, splitKind),
127
- priority: params.priority,
128
- tags: tagsFor(chunk, splitKind === "budget" ? ["line_budget_split"] : []),
129
- });
130
- }
131
- }
132
- for (const filePath of oversizedFiles) {
133
- const taskId = `${params.scopeId}:${params.lens}:${filePath}`;
134
- if (seen.has(taskId)) {
135
- continue;
136
- }
137
- seen.add(taskId);
138
- tasks.push({
139
- task_id: taskId,
140
- unit_id: params.unitId,
141
- pass_id: params.passId,
142
- lens: params.lens,
143
- file_paths: [filePath],
144
- rationale: params.rationale([filePath], "large_file"),
145
- priority: params.priority,
146
- tags: tagsFor([filePath], ["large_file"]),
147
- });
148
- }
149
- }
150
- function withSignalTag(baseTags, hasExternalSignal) {
151
- return hasExternalSignal ? [...baseTags, "external_analyzer_signal"] : baseTags;
152
- }
153
- // Tags this builder decides for a whole block or chunk, never for one file. A
154
- // re-plan chunks a different pending set, so these tags never say who owns a file.
155
- const GROUP_DERIVED_TAGS = new Set([
156
- "external_analyzer_signal",
157
- "unmeasured_line_count",
158
- "line_budget_split",
159
- ]);
160
- /**
161
- * Who owns one lens:path in a plan, from the facts this builder decides per file:
162
- * the unit, the pass, and the per-file tags (flow membership, `large_file`).
163
- * Flow membership is per file because the flow claim runs over the eligible
164
- * set. Priority and the group-derived tags follow the chunk, so they are left
165
- * out; {@link taskLeadsAreCurrent} checks them against the task's own files.
166
- */
167
- export function fileAssignmentKey(task) {
168
- return stableStringify({
169
- unit_id: task.unit_id,
170
- pass_id: task.pass_id,
171
- tags: (task.tags ?? []).filter((tag) => !GROUP_DERIVED_TAGS.has(tag)).sort(compareCodeUnits),
172
- });
173
- }
174
- /**
175
- * True when a published task's chunk-level facts still hold under the current
176
- * plan inputs:
177
- * - it carries the external analyzer signal when one of its own files earns it;
178
- * - its priority is the one this builder gives its tags under the current intent
179
- * boost (priority gates selective deepening, so a stale one is wrong work).
180
- * A signal that a sibling chunk of its block earned may stay on the task: a
181
- * published task cannot tell a sibling's signal from a signal that is gone.
182
- * The unmeasured lead needs no check: a task with an unmeasured file is never
183
- * counted as published (`readPublishedAuditTaskIds` needs a measured count).
184
- */
185
- export function taskLeadsAreCurrent(task, externalPaths, intentPriorityBoost) {
186
- const tags = new Set(task.tags ?? []);
187
- const signalTag = tags.has("external_analyzer_signal");
188
- if (!signalTag && task.file_paths.some((path) => externalPaths.has(path)))
189
- return false;
190
- const boost = intentPriorityBoost && intentPriorityBoost.length > 0 ? new Set(intentPriorityBoost) : undefined;
191
- return task.priority === taskPriority(signalTag, task.lens, tags.has("critical_flow"), boost);
192
- }
193
- /**
194
- * Resolve option defaults and build the map of pending (file path → lens)
195
- * pairs from the coverage matrix, filtering out excluded files, completed
196
- * lenses, lens-filter violations, and trivial audit paths.
197
- *
198
- * AN UNMEASURED LINE COUNT IS NOT A ZERO LINE COUNT. This resolved size as
199
- * `unitLineIndex[file.path] ?? 0` and handed it to `isTrivialAuditPath`, whose
200
- * `lineCount === 0` branch then classified the file trivial and `continue`d past
201
- * it. Unlike `autoCompleteTrivialCoverage`, which marks a trivial file `excluded`
202
- * in the coverage matrix, this loop leaves the record untouched: the file got no
203
- * task, kept its non-empty `required_lenses`, and stayed reported outstanding
204
- * forever — a silent permanent coverage hole indistinguishable from "still
205
- * queued".
206
- *
207
- * The size question is now answered in ONE place — `isTrivialAuditPath` reads
208
- * through the shared `isUnmeasuredLineCount` predicate — so this loop does NOT
209
- * gate the triviality call on measuredness: a file that is trivial by NAME stays
210
- * trivial when nobody could measure it. What the unmeasured signal buys is the
211
- * LEAD: a surviving unmeasured path is collected into `unmeasuredPaths`, and
212
- * every task carrying it is tagged `unmeasured_line_count`.
213
- *
214
- * This is the SECOND of the two sites that decide the fate of an unmeasured
215
- * file, and the later one. `autoCompleteTrivialCoverage` runs first
216
- * (planningExecutors.ts) and excludes from the coverage matrix; leniency here
217
- * alone would be unreachable, because the `audit_status === "excluded"` guard
218
- * above would already have skipped the file. Both sites are fixed together.
219
- */
220
- function buildPendingByLens(coverageMatrix, unitLineIndex, externalPaths, options) {
221
- const allowed = new Set(options.limit_lenses ?? []);
222
- const pendingByLens = new Map();
223
- // The same set before completions are removed: what the plan reviews in total.
224
- const eligibleByLens = new Map();
225
- const unmeasuredPaths = new Set();
226
- for (const file of coverageMatrix.files) {
227
- if (file.audit_status === "excluded") {
228
- continue;
229
- }
230
- const unmeasured = isUnmeasuredLineCount(unitLineIndex[file.path]);
231
- for (const lens of file.required_lenses) {
232
- if (options.enforceLensFilter && !allowed.has(lens)) {
233
- continue;
234
- }
235
- if (isTrivialAuditPath(file.path, unitLineIndex[file.path], externalPaths.has(file.path))) {
236
- continue;
237
- }
238
- const eligible = eligibleByLens.get(lens) ?? new Set();
239
- eligible.add(file.path);
240
- eligibleByLens.set(lens, eligible);
241
- if (file.completed_lenses.includes(lens)) {
242
- continue;
243
- }
244
- if (unmeasured) {
245
- unmeasuredPaths.add(file.path);
246
- }
247
- const pending = pendingByLens.get(lens) ?? new Set();
248
- pending.add(file.path);
249
- pendingByLens.set(lens, pending);
250
- }
251
- }
252
- return { pendingByLens, eligibleByLens, unmeasuredPaths };
253
- }
254
- /**
255
- * Group remainder (non-flow) pending paths by lens+unit into review blocks,
256
- * skipping paths already assigned to a flow block.
257
- */
258
- function buildRemainderBlocks(pendingByLens, assigned, coverageByPath, unitLineIndex, externalPaths, tinyTestFileLines) {
259
- const groupedRemainders = new Map();
260
- for (const lens of LENS_ORDER) {
261
- const pendingPaths = pendingByLens.get(lens);
262
- if (!pendingPaths || pendingPaths.size === 0) {
263
- continue;
264
- }
265
- for (const path of [...pendingPaths].sort((a, b) => compareCodeUnits(a, b))) {
266
- if (assigned.has(`${lens}:${path}`)) {
267
- continue;
268
- }
269
- // An UNMEASURED file is not known-small, so it is never batched as a tiny
270
- // test: `measuredLinesOf` yields undefined and the comparison is skipped.
271
- const lineCount = measuredLinesOf(unitLineIndex, path);
272
- const isTinyTestReview = tinyTestFileLines > 0 &&
273
- lineCount !== undefined &&
274
- lineCount <= tinyTestFileLines &&
275
- isTestPath(normalizeExtractorPath(path)) &&
276
- !externalPaths.has(path);
277
- const record = coverageByPath.get(path);
278
- const unitId = isTinyTestReview
279
- ? TINY_TEST_UNIT_ID
280
- : record?.unit_ids[0] ?? `review:${path.replace(/[^a-zA-Z0-9_-]/g, "-")}`;
281
- const key = `${lens}|${unitId}`;
282
- const current = groupedRemainders.get(key) ?? {
283
- lens,
284
- unitId,
285
- filePaths: [],
286
- };
287
- current.filePaths.push(path);
288
- groupedRemainders.set(key, current);
289
- }
290
- }
291
- return [...groupedRemainders.values()].sort((a, b) => {
292
- const lensDelta = LENS_ORDER.indexOf(a.lens) - LENS_ORDER.indexOf(b.lens);
293
- if (lensDelta !== 0)
294
- return lensDelta;
295
- return compareCodeUnits(a.unitId, b.unitId);
296
- });
297
- }
298
- export function buildChunkedAuditTasks(coverageMatrix, unitLineIndex, options = {}) {
299
- const fileSplitThreshold = options.file_split_threshold ?? DEFAULT_FILE_SPLIT_THRESHOLD;
300
- const maxTaskLines = options.max_task_lines ?? DEFAULT_MAX_TASK_LINES;
301
- const maxTaskFiles = options.max_task_files ?? DEFAULT_MAX_TASK_FILES;
302
- const tinyTestFileLines = options.tiny_test_file_lines ?? DEFAULT_TINY_TEST_FILE_LINES;
303
- const allowed = new Set(options.limit_lenses ?? []);
304
- const enforceLensFilter = allowed.size > 0;
305
- const externalPaths = getExternalSignalPaths(options.external_analyzer_results);
306
- // Phase 1: resolve pending work by lens.
307
- const { pendingByLens, eligibleByLens, unmeasuredPaths } = buildPendingByLens(coverageMatrix, unitLineIndex, externalPaths, {
308
- limit_lenses: options.limit_lenses,
309
- enforceLensFilter,
310
- tinyTestFileLines,
311
- });
312
- const intentBoostSet = options.intent_priority_boost && options.intent_priority_boost.length > 0
313
- ? new Set(options.intent_priority_boost)
314
- : undefined;
315
- const tasks = [];
316
- const seen = new Set();
317
- const budgetLimits = { maxTaskLines, maxTaskFiles };
318
- const taskBlockContext = {
319
- tasks,
320
- seen,
321
- unitLineIndex,
322
- fileSplitThreshold,
323
- budgetLimits,
324
- unmeasuredPaths,
325
- };
326
- // Phase 2: claim critical-flow review blocks first (highest priority).
327
- //
328
- // ONE KEY SPACE, SATISFIED BY CONSTRUCTION — NOT BY RE-KEYING HERE.
329
- // `claimFlowReviewBlocks` declares that every path it joins on is already in
330
- // one key space. It is, and this call site is where that reading is recorded:
331
- //
332
- // - Coverage paths, line-index keys and critical-flow paths all descend from
333
- // the SAME repo manifest, which `fsIntake` emits posix-normal. They are one
334
- // key space at the source; re-normalizing copies of them here would create a
335
- // SECOND one, since the persisted coverage matrix, the persisted line index
336
- // and result ingestion (`applyFileCoverage`) all stay keyed on the original
337
- // strings — a divergence with no live route to close.
338
- // - The one genuinely FOREIGN path surface is a worker-supplied string copied
339
- // into a followup task's `file_paths`. That never enters here; it enters at
340
- // validation, where `validateAuditResults` normalizes both sides of the
341
- // coverage join tolerantly. That is where the key-space fix belongs and
342
- // where it is pinned.
343
- //
344
- // THE CLAIM CONTRACT IS THE ONLY CHANNEL (`artifact:flow-claim-contract`).
345
- // `claimFlowReviewBlocks` writes nothing back through its arguments, so the
346
- // post-claim state must be read off the RETURN value: `claim.assigned` holds
347
- // the claim keys, and the remainder phase skips every one of them. Reading the
348
- // pre-claim arguments instead re-emits every flow-claimed path as a remainder
349
- // task — the same lens:path reviewed twice.
350
- //
351
- // FLOW OWNERSHIP IS DECIDED OVER THE ELIGIBLE SET, NOT THE PENDING SET. The
352
- // claim gives a file shared by two flows to the flow with more paths, so a
353
- // claim over the pending set moves that file to another flow as work
354
- // completes. A re-plan then renames the file's task, and a host result bound
355
- // to the published id is lost. Each block keeps only its pending paths.
356
- const claim = options.critical_flows
357
- ? claimFlowReviewBlocks(options.critical_flows, eligibleByLens, new Set())
358
- : undefined;
359
- const flowBlocks = (claim?.blocks ?? [])
360
- .map((block) => ({
361
- ...block,
362
- file_paths: block.file_paths.filter((path) => pendingByLens.get(block.lens)?.has(path)),
363
- }))
364
- .filter((block) => block.file_paths.length > 0);
365
- const remainingPending = pendingByLens;
366
- const assigned = claim?.assigned ?? new Set();
367
- for (const block of flowBlocks) {
368
- const hasExternalSignal = block.file_paths.some((path) => externalPaths.has(path));
369
- addTaskBlock({
370
- scopeId: `flow:${block.flow_id}`,
371
- unitId: `flow:${block.flow_id}`,
372
- passId: `flow-pass:${block.lens}`,
373
- lens: block.lens,
374
- filePaths: block.file_paths,
375
- priority: taskPriority(hasExternalSignal, block.lens, true, intentBoostSet),
376
- tags: withSignalTag(["critical_flow", `critical_flow:${block.flow_id}`], hasExternalSignal),
377
- rationale: (filePaths, splitKind) => splitKind === "large_file"
378
- ? `Audit ${filePaths[0]} (large file from critical flow ${block.flow_id}) under the ${block.lens} lens.${hasExternalSignal ? " External analyzer signals raise priority." : ""}`
379
- : splitKind === "budget"
380
- ? `Audit part of critical flow ${block.flow_id} (${filePaths.length} file${filePaths.length === 1 ? "" : "s"}) under the ${block.lens} lens.${hasExternalSignal ? " External analyzer signals raise priority." : ""}`
381
- : `Audit critical flow ${block.flow_id} (${filePaths.length} file${filePaths.length === 1 ? "" : "s"}) under the ${block.lens} lens.${hasExternalSignal ? " External analyzer signals raise priority." : ""}`,
382
- }, taskBlockContext);
383
- }
384
- // Phase 3: group and emit remainder tasks (files not assigned to a flow block).
385
- const coverageByPath = new Map(coverageMatrix.files.map((file) => [file.path, file]));
386
- const remainderBlocks = buildRemainderBlocks(remainingPending, assigned, coverageByPath, unitLineIndex, externalPaths, tinyTestFileLines);
387
- for (const block of remainderBlocks) {
388
- const hasExternalSignal = block.filePaths.some((path) => externalPaths.has(path));
389
- addTaskBlock({
390
- scopeId: block.unitId,
391
- unitId: block.unitId,
392
- passId: `pass:${block.lens}`,
393
- lens: block.lens,
394
- filePaths: block.filePaths,
395
- priority: taskPriority(hasExternalSignal, block.lens, false, intentBoostSet),
396
- tags: withSignalTag([], hasExternalSignal),
397
- rationale: (filePaths, splitKind) => splitKind === "large_file"
398
- ? `Audit ${filePaths[0]} (large file split from ${block.unitId}) under the ${block.lens} lens.${hasExternalSignal ? " External analyzer signals raise priority." : ""}`
399
- : splitKind === "budget"
400
- ? `Audit part of ${block.unitId} (${filePaths.length} file${filePaths.length === 1 ? "" : "s"}) under the ${block.lens} lens.${hasExternalSignal ? " External analyzer signals raise priority." : ""}`
401
- : `Audit ${block.unitId} (${filePaths.length} file${filePaths.length === 1 ? "" : "s"}) under the ${block.lens} lens.${hasExternalSignal ? " External analyzer signals raise priority." : ""}`,
402
- }, taskBlockContext);
403
- }
404
- // Phase 4: sort by priority descending, then stable by task_id.
405
- return tasks.sort((a, b) => {
406
- const priorityDelta = priorityRank(b.priority) - priorityRank(a.priority);
407
- if (priorityDelta !== 0)
408
- return priorityDelta;
409
- return compareCodeUnits(a.task_id, b.task_id);
410
- });
411
- }
412
- //# sourceMappingURL=taskBuilder.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"taskBuilder.js","sourceRoot":"","sources":["../../../src/aud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,MAAM,KAAK,SAAS,CAAC,MAAM,QAAQ,SAAS,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,eAAe,KAAK,CAAC,IAAI,SAAS,iBAAiB,CAAC,CAAC,CAAC,4CAA4C,CAAC,CAAC,CAAC,EAAE,EAAE;oBACtM,CAAC,CAAC,SAAS,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,MAAM,QAAQ,SAAS,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,eAAe,KAAK,CAAC,IAAI,SAAS,iBAAiB,CAAC,CAAC,CAAC,4CAA4C,CAAC,CAAC,CAAC,EAAE,EAAE;SACrM,EAAE,gBAAgB,CAAC,CAAC;IACvB,CAAC;IAED,gEAAgE;IAChE,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACzB,MAAM,aAAa,GAAG,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;QAC1E,IAAI,aAAa,KAAK,CAAC;YAAE,OAAO,aAAa,CAAC;QAC9C,OAAO,gBAAgB,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,21 +0,0 @@
1
- import type { CoverageMatrix } from "../types.js";
2
- import type { ExternalAnalyzerResults } from "audit-tools/shared";
3
- /**
4
- * AN UNMEASURED SIZE IS NOT A SIZE OF ZERO (DAT-3c07c004).
5
- *
6
- * `lineCount` is whatever the line index yielded for `path`, which is one of
7
- * THREE things, not two: a genuine count, the {@link UNMEASURED_LINE_COUNT}
8
- * sentinel `buildLineIndex` emits when the file could not be read, or `undefined`
9
- * for a key the index never carried. The last two are resolved through the ONE
10
- * shared predicate `isUnmeasuredLineCount` — never a local `?? 0`, which is
11
- * exactly the coercion that made a file nobody could measure indistinguishable
12
- * from a file genuinely containing nothing, and got it excluded from all audit
13
- * coverage without a trace.
14
- *
15
- * When the size is unmeasured only the SIZE-BASED rules are withheld; the
16
- * PATH-BASED rule still applies, because a `.gitignore` is trivial on the
17
- * strength of its name whether or not anyone managed to count its lines.
18
- */
19
- export declare function isTrivialAuditPath(path: string, lineCount: number | undefined, hasExternalSignal?: boolean): boolean;
20
- export declare function autoCompleteTrivialCoverage(coverage: CoverageMatrix, lineIndex: Record<string, number>, externalAnalyzerResults?: ExternalAnalyzerResults[]): string[];
21
- //# sourceMappingURL=trivialAudit.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"trivialAudit.d.ts","sourceRoot":"","sources":["../../../src/audit/orchestrator/trivialAudit.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAYlE;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,iBAAiB,UAAQ,GACxB,OAAO,CA8BT;AAED,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,cAAc,EACxB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACjC,uBAAuB,CAAC,EAAE,uBAAuB,EAAE,GAClD,MAAM,EAAE,CAwCV"}
@@ -1,80 +0,0 @@
1
- import { toPosixPath } from "audit-tools/shared";
2
- import { isUnmeasuredLineCount } from "../cli/lineIndex.js";
3
- const TRIVIAL_DOTFILES = new Set([".gitignore", ".gitattributes"]);
4
- function basename(path) {
5
- const normalized = toPosixPath(path);
6
- const parts = normalized.split("/");
7
- return parts[parts.length - 1] ?? normalized;
8
- }
9
- /**
10
- * AN UNMEASURED SIZE IS NOT A SIZE OF ZERO (DAT-3c07c004).
11
- *
12
- * `lineCount` is whatever the line index yielded for `path`, which is one of
13
- * THREE things, not two: a genuine count, the {@link UNMEASURED_LINE_COUNT}
14
- * sentinel `buildLineIndex` emits when the file could not be read, or `undefined`
15
- * for a key the index never carried. The last two are resolved through the ONE
16
- * shared predicate `isUnmeasuredLineCount` — never a local `?? 0`, which is
17
- * exactly the coercion that made a file nobody could measure indistinguishable
18
- * from a file genuinely containing nothing, and got it excluded from all audit
19
- * coverage without a trace.
20
- *
21
- * When the size is unmeasured only the SIZE-BASED rules are withheld; the
22
- * PATH-BASED rule still applies, because a `.gitignore` is trivial on the
23
- * strength of its name whether or not anyone managed to count its lines.
24
- */
25
- export function isTrivialAuditPath(path, lineCount, hasExternalSignal = false) {
26
- if (hasExternalSignal) {
27
- return false;
28
- }
29
- const measured = isUnmeasuredLineCount(lineCount) ? undefined : lineCount;
30
- if (measured === 0) {
31
- return true;
32
- }
33
- const name = basename(path).toLowerCase();
34
- if (TRIVIAL_DOTFILES.has(name)) {
35
- return true;
36
- }
37
- if (measured === undefined) {
38
- return false;
39
- }
40
- // Empty package markers and docstring-only __init__.py files create a lot of
41
- // audit churn without adding meaningful coverage signal.
42
- if (name === "__init__.py" && measured <= 3) {
43
- return true;
44
- }
45
- if (measured <= 1) {
46
- return true;
47
- }
48
- return false;
49
- }
50
- export function autoCompleteTrivialCoverage(coverage, lineIndex, externalAnalyzerResults) {
51
- const externalPaths = new Set((externalAnalyzerResults ?? [])
52
- .flatMap((tool) => tool.results ?? [])
53
- .map((item) => item.path));
54
- const skipped = [];
55
- for (const file of coverage.files) {
56
- if (file.audit_status === "excluded") {
57
- continue;
58
- }
59
- // No `?? 0` — an unmeasured file must be SKIPPED here (left un-excluded) so
60
- // it flows on to `buildPendingByLens` and earns a real, `unmeasured_line_count`
61
- // tagged task. This is the site that actually decided the file's fate: it runs
62
- // BEFORE `buildChunkedAuditTasks` (planningExecutors.ts), so a file excluded
63
- // here never reaches the task builder at all, and any leniency added downstream
64
- // is unreachable. A file that is trivial by NAME is still excluded.
65
- if (!isTrivialAuditPath(file.path, lineIndex[file.path], externalPaths.has(file.path))) {
66
- continue;
67
- }
68
- if (file.required_lenses.length === 0) {
69
- continue;
70
- }
71
- file.completed_lenses = [];
72
- file.required_lenses = [];
73
- file.audit_status = "excluded";
74
- file.classification_status = "excluded_trivial";
75
- file.unit_ids = [];
76
- skipped.push(file.path);
77
- }
78
- return skipped.sort();
79
- }
80
- //# sourceMappingURL=trivialAudit.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"trivialAudit.js","sourceRoot":"","sources":["../../../src/audit/orchestrator/trivialAudit.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAC,CAAC;AAEnE,SAAS,QAAQ,CAAC,IAAY;IAC5B,MAAM,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IACrC,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACpC,OAAO,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,UAAU,CAAC;AAC/C,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,kBAAkB,CAChC,IAAY,EACZ,SAA6B,EAC7B,iBAAiB,GAAG,KAAK;IAEzB,IAAI,iBAAiB,EAAE,CAAC;QACtB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,QAAQ,GAAG,qBAAqB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;IAE1E,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;QACnB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,C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