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
@@ -0,0 +1,186 @@
1
+ // sites-pinned: tests/audit/question-report.test.ts, tests/audit/question-review-acceptance.test.ts
2
+ import { compareCodeUnits, stableStringify, uniqueSorted } from "audit-tools/shared";
3
+ import { REVIEW_QUESTION_CONTRACT_VERSION, } from "../../shared/types/reviewQuestion.js";
4
+ import { QUESTION_AUDIT_FINDINGS_CONTRACT_VERSION, canonicalQuestionFindingId, projectCanonicalQuestionFinding, questionClaimKey, questionPartHasSupport, } from "../../shared/types/questionReviewReport.js";
5
+ import { buildWorkBlockPartition } from "./workBlocks.js";
6
+ import { projectQuestionReview } from "../cli/dispatch/questionReviewAcceptance.js";
7
+ export function projectQuestionForReport(question, history, adjudications, evidence, dependencies) {
8
+ const { current: live, stale } = projectQuestionReview(question, history, dependencies?.slice());
9
+ const ids = new Set(live.map(({ submission }) => submission.submission_id));
10
+ const decisions = adjudications.filter(decision => decision.question_id === question.question_id &&
11
+ decision.revision_id === question.revision_id && decision.snapshot_id === question.snapshot_id &&
12
+ decision.submission_ids.every(id => ids.has(id)));
13
+ // Decisions apply only to the submissions actually adjudicated. A later
14
+ // independent answer can disagree even following an earlier resolution.
15
+ const inactive = new Set();
16
+ for (const decision of decisions) {
17
+ if (decision.decision !== "resolved" || !decision.selected_submission_ids.length ||
18
+ !decision.selected_submission_ids.every(id => decision.submission_ids.includes(id)))
19
+ continue;
20
+ for (const id of decision.submission_ids) {
21
+ if (decision.selected_submission_ids.includes(id))
22
+ inactive.delete(id);
23
+ else
24
+ inactive.add(id);
25
+ }
26
+ }
27
+ const effective = live.filter(({ submission }) => !inactive.has(submission.submission_id));
28
+ const conflicts = [];
29
+ const parts = question.requested_parts.map(({ part_id, expectation }) => {
30
+ const answers = effective.flatMap(({ submission }) => submission.answer.parts.filter(part => part.part_id === part_id).map(part => {
31
+ return { part, answerId: submission.submission_id, outcome: questionPartHasSupport(submission.answer, part, evidence) ? part.outcome : "inconclusive" };
32
+ }));
33
+ const answerIds = uniqueSorted(answers.map(answer => answer.answerId));
34
+ const dispute = [...decisions].reverse().find(decision => decision.submission_ids.filter(id => answerIds.includes(id)).length >= 2)?.decision === "disputed";
35
+ const findings = answers.some(answer => answer.outcome === "findings");
36
+ const clean = answers.some(answer => answer.outcome === "clean");
37
+ const gap = answers.some(answer => answer.outcome === "inconclusive");
38
+ let state;
39
+ if (dispute || (findings && clean)) {
40
+ state = "conflicted";
41
+ conflicts.push({ part_id, answer_ids: answerIds });
42
+ }
43
+ else if (gap)
44
+ state = "inconclusive";
45
+ else if (findings)
46
+ state = "findings";
47
+ else if (clean)
48
+ state = "clean";
49
+ else if (stale.some(answer => answer.submission.answer.parts.some(part => part.part_id === part_id)))
50
+ state = "stale";
51
+ else
52
+ state = "unreviewed";
53
+ return {
54
+ part_id, expectation, state, accepted_answer_ids: answerIds,
55
+ observation_ids: uniqueSorted(answers.flatMap(({ part }) => part.observation_ids)),
56
+ reasons: uniqueSorted(answers.flatMap(({ part }) => part.reason ? [part.reason] : [])),
57
+ };
58
+ });
59
+ const state = conflicts.length ? "conflicted"
60
+ : question.plan_status === "blocked" ? "blocked"
61
+ : question.plan_status === "deferred" ? "deferred"
62
+ : parts.some(part => part.state === "stale") ? "stale"
63
+ : parts.every(part => part.state === "unreviewed") ? "unreviewed"
64
+ : parts.some(part => part.state === "inconclusive" || part.state === "unreviewed") ? "inconclusive"
65
+ : parts.some(part => part.state === "findings") ? "findings" : "clean";
66
+ const active = question.plan_status !== "blocked" && question.plan_status !== "deferred" && conflicts.length === 0;
67
+ const claims = history.flatMap(({ submission }) => {
68
+ const counts = new Map();
69
+ for (const finding of submission.answer.findings)
70
+ counts.set(finding.finding_id, (counts.get(finding.finding_id) ?? 0) + 1);
71
+ // Old rejected-by-today's-rules data still belongs in the accepted history.
72
+ // Ambiguous identities cannot name a projected claim.
73
+ const displayed = new Set();
74
+ return submission.answer.findings.filter(source => {
75
+ if (displayed.has(source.finding_id))
76
+ return false;
77
+ displayed.add(source.finding_id);
78
+ return true;
79
+ }).map(source => ({
80
+ answerId: submission.submission_id, source,
81
+ actionable: counts.get(source.finding_id) === 1 && active && ids.has(submission.submission_id) && !inactive.has(submission.submission_id) &&
82
+ source.kind === "confirmed_defect" && source.source_refs.length > 0 &&
83
+ effective.some(answer => answer.submission.submission_id === submission.submission_id &&
84
+ answer.submission.answer.parts.some(part => part.outcome === "findings" &&
85
+ questionPartHasSupport(answer.submission.answer, part, evidence, source.observation_ids ?? []))),
86
+ }));
87
+ });
88
+ return {
89
+ row: {
90
+ question_id: question.question_id, revision_id: question.revision_id, lens: question.lens,
91
+ inventory_item_ids: question.inventory_item_ids, expected_outcome: question.expected_outcome,
92
+ plan_status: question.plan_status, ...(question.plan_reason === undefined ? {} : { plan_reason: question.plan_reason }),
93
+ state, parts, accepted_answer_ids: uniqueSorted([...ids]), conflicts, finding_ids: [],
94
+ },
95
+ claims,
96
+ };
97
+ }
98
+ function groupClaims(claims, decisions, accepted) {
99
+ const currentClaims = new Map(claims.map(claim => [questionClaimKey(claim.answerId, claim.source.finding_id), claim]));
100
+ const pending = new Map(currentClaims);
101
+ if (pending.size !== claims.length)
102
+ throw new Error("Duplicate finding claim within an accepted submission.");
103
+ const groups = [];
104
+ const groupedKeys = new Set();
105
+ for (const decision of decisions) {
106
+ const keys = uniqueSorted(decision.sources.map(source => questionClaimKey(source.answer_id, source.finding_id)));
107
+ const historical = decision.sources.map(({ answer_id, finding_id }) => accepted.get(answer_id)?.submission.answer.findings.filter(source => source.finding_id === finding_id) ?? []);
108
+ if (keys.length < 2 || keys.length !== decision.sources.length ||
109
+ historical.some(rows => rows.length !== 1 || rows[0].kind !== historical[0]?.[0]?.kind)) {
110
+ throw new Error(`Consolidation ${decision.decision_id} must name distinct available claims of one kind.`);
111
+ }
112
+ // Check currency independently of grouping: the claims already consumed by
113
+ // an applicable decision can still make a later overlapping one invalid.
114
+ const rows = keys.flatMap(key => currentClaims.get(key) ?? []);
115
+ // Old decisions remain history without consuming surviving individual claims.
116
+ if (rows.length !== keys.length || rows.some(row => !row.actionable))
117
+ continue;
118
+ if (keys.some(key => groupedKeys.has(key))) {
119
+ throw new Error(`Consolidation ${decision.decision_id} overlaps a current decision.`);
120
+ }
121
+ for (const key of keys)
122
+ groupedKeys.add(key);
123
+ groups.push(rows);
124
+ for (const key of keys)
125
+ pending.delete(key);
126
+ }
127
+ groups.push(...[...pending.entries()].sort(([a], [b]) => compareCodeUnits(a, b)).map(([, claim]) => [claim]));
128
+ return groups.map(rows => {
129
+ const canonical_finding_id = canonicalQuestionFindingId(rows.map(row => questionClaimKey(row.answerId, row.source.finding_id)));
130
+ return { answerIds: rows.map(row => row.answerId), row: {
131
+ canonical_finding_id, kind: rows[0].source.kind, actionable: rows.every(row => row.actionable),
132
+ question_ids: uniqueSorted(rows.map(row => row.source.question_id)),
133
+ sources: rows.map(row => row.source),
134
+ } };
135
+ }).sort((a, b) => compareCodeUnits(a.row.canonical_finding_id, b.row.canonical_finding_id));
136
+ }
137
+ /** Deterministic projection only: never update an accepted answer or infer a review from runtime output. */
138
+ export function buildQuestionAuditFindingsReport(input) {
139
+ const acceptedById = new Map();
140
+ for (const row of input.accepted) {
141
+ const id = row.submission.submission_id;
142
+ const prior = acceptedById.get(id);
143
+ if (prior && stableStringify(prior.submission) !== stableStringify(row.submission)) {
144
+ throw new Error(`Conflicting content for accepted submission ${id}.`);
145
+ }
146
+ if (!prior)
147
+ acceptedById.set(id, row);
148
+ }
149
+ const accepted = [...acceptedById.values()].sort((a, b) => compareCodeUnits(a.submission.submission_id, b.submission.submission_id));
150
+ const adjudications = [...input.adjudications ?? []];
151
+ const evidence = new Map(input.evidence.map(record => [record.evidence_id, record]));
152
+ const projected = input.plan.questions.map(question => projectQuestionForReport(question, accepted.filter(row => row.submission.question_id === question.question_id), adjudications, evidence, input.dependenciesByQuestion.get(question.question_id)));
153
+ const consolidations = [...input.consolidations ?? []];
154
+ const groups = groupClaims(projected.flatMap(item => item.claims), consolidations, acceptedById);
155
+ const questions = projected.map(({ row }) => ({
156
+ ...row, finding_ids: groups.filter(group => group.row.question_ids.includes(row.question_id)).map(group => group.row.canonical_finding_id),
157
+ }));
158
+ const findings = groups.filter(group => group.row.actionable).map(({ row, answerIds }) => projectCanonicalQuestionFinding(row, questions.find(question => question.question_id === row.sources[0].question_id).lens, answerIds.map(id => acceptedById.get(id).submission)));
159
+ const work = buildWorkBlockPartition({ findings });
160
+ const counts = (key) => Object.fromEntries(uniqueSorted(findings.map(finding => finding[key])).map(value => [value, findings.filter(finding => finding[key] === value).length]));
161
+ const unmapped = input.plan.inventory.some(item => item.scope === "in_scope" &&
162
+ !input.plan.questions.some(question => question.inventory_item_ids.includes(item.inventory_item_id)));
163
+ const completion = questions.length === 0 || unmapped || input.plan.omissions.length > 0 ||
164
+ questions.some(row => row.state !== "clean" && row.state !== "findings") ? "incomplete" : "complete";
165
+ const question_review = {
166
+ schema_version: REVIEW_QUESTION_CONTRACT_VERSION, snapshot_id: input.plan.snapshot_id,
167
+ completion, questions, findings: groups.map(({ row }) => row), consolidations, adjudications, accepted,
168
+ ...(input.reopens?.length ? { reopens: [...input.reopens] } : {}),
169
+ inventory: input.plan.inventory, omissions: input.plan.omissions, lens_decisions: input.plan.lens_decisions,
170
+ evidence: [...input.evidence],
171
+ };
172
+ const currentAnswerIds = new Set(questions.flatMap(row => row.accepted_answer_ids));
173
+ return {
174
+ contract_version: QUESTION_AUDIT_FINDINGS_CONTRACT_VERSION, audit_read: input.auditRead, question_review,
175
+ findings, coherence_trace: work.coherence_trace, work_blocks: work.blocks, work_block_seams: work.seams,
176
+ summary: {
177
+ finding_count: findings.length, work_block_count: work.blocks.length,
178
+ severity_breakdown: counts("severity"), lens_breakdown: counts("lens"),
179
+ audited_file_count: new Set(accepted.filter(answer => currentAnswerIds.has(answer.submission.submission_id)).flatMap(answer => answer.submission.inspected_sources.map(ref => ref.path))).size,
180
+ excluded_file_count: new Set(input.plan.inventory.filter(item => item.scope === "excluded")
181
+ .flatMap(item => item.source_refs.map(ref => ref.path))).size,
182
+ runtime_validation_status_breakdown: {},
183
+ },
184
+ };
185
+ }
186
+ //# sourceMappingURL=questionReport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"questionReport.js","sourceRoot":"","sources":["../../../src/audit/reporting/questionReport.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAErF,OAAO,EACL,gCAAgC,GAGjC,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,wCAAwC,EACxC,0BAA0B,EAAE,+BAA+B,EAAE,gBAAgB,EAAE,sBAAsB,GAEtG,MAAM,4CAA4C,CAAC;A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E,UAAU,EAAE,KAAK,CAAC,SAAS,EAAE,eAAe;QACxG,QAAQ,EAAE,eAAe,EAAE,IAAI,CAAC,eAAe,EAAE,WAAW,EAAE,IAAI,CAAC,MAAM,EAAE,gBAAgB,EAAE,IAAI,CAAC,KAAK;QACvG,OAAO,EAAE;YACP,aAAa,EAAE,QAAQ,CAAC,MAAM,EAAE,gBAAgB,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM;YACpE,kBAAkB,EAAE,MAAM,CAAC,UAAU,CAAC,EAAE,cAAc,EAAE,MAAM,CAAC,MAAM,CAAC;YACtE,kBAAkB,EAAE,IAAI,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CACnD,gBAAgB,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAC9D,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,iBAAiB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CACnE,CAAC,CAAC,IAAI;YACP,mBAAmB,EAAE,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,KAAK,UAAU,CAAC;iBACxF,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI;YAC/D,mCAAmC,EAAE,EAAE;SACxC;KACF,CAAC;AACJ,CAAC"}
@@ -14,6 +14,7 @@ import type { AuditFindingsReport, AuditRead, ContentCoherenceTrace, CriticalFlo
14
14
  import { type AgentReflection, type LensCoverageEntry } from "audit-tools/shared";
15
15
  import type { RuntimeValidationReport, RuntimeValidationTaskManifest } from "../types/runtimeValidation.js";
16
16
  import { type WorkBlock } from "./workBlocks.js";
17
+ import { type QuestionReviewReport } from "../../shared/types/questionReviewReport.js";
17
18
  /**
18
19
  * Contract version stamped onto the canonical `audit-findings.json`.
19
20
  * Single-sourced from `audit-tools/shared` so the auditor's output and the
@@ -28,6 +29,7 @@ export declare const AUDIT_FINDINGS_CONTRACT_VERSION: "audit-tools/audit-finding
28
29
  * produces the base report and the narrative-enriched report.
29
30
  */
30
31
  export interface RenderableAuditReport {
32
+ question_review?: QuestionReviewReport;
31
33
  summary: AuditReportSummary;
32
34
  findings: SharedFinding[];
33
35
  work_blocks: WorkBlock[];
@@ -163,6 +165,10 @@ export declare function buildAuditReportModel(params: {
163
165
  designAssessment?: DesignAssessment;
164
166
  /** Existing accepted review snapshots bind the reviewed lenses and unit scope. */
165
167
  designReviewSnapshots?: DesignReviewSnapshotBundle;
168
+ architectureSourceSample?: {
169
+ status: NonNullable<LensCoverageEntry["source_sample"]>;
170
+ taskId?: string;
171
+ };
166
172
  structureDecomposition?: StructureDecomposition;
167
173
  charterRegister?: CharterRegister;
168
174
  systemicChallenge?: SystemicChallengeRegister;
@@ -222,6 +228,8 @@ export interface RenderAuditReportOptions {
222
228
  reflections?: AgentReflection[];
223
229
  /** Deep conceptual judge provenance and semantic attribution record. */
224
230
  conceptual_adjudication?: ConceptualReviewAdjudication;
231
+ /** Report identity map reconstructed after JSON reload, when needed. */
232
+ conceptual_attribution_id_source?: RenderableAuditReport;
225
233
  /**
226
234
  * The accepted intent checkpoint; its `excluded_scope` is surfaced in an
227
235
  * "Excluded / Out-of-Scope" section so omissions are explicit in the report.
@@ -255,7 +263,8 @@ export interface RenderAuditReportOptions {
255
263
  */
256
264
  charter_packet_archive?: readonly CharterPacketArchiveRow[];
257
265
  }
258
- export declare function canonicalizeConceptualAttributionIds(report: RenderableAuditReport, adjudication: ConceptualReviewAdjudication, idSource?: RenderableAuditReport): void;
266
+ export declare function conceptualAttributionNeedsIdSource(report: RenderableAuditReport, adjudication: ConceptualReviewAdjudication | undefined): boolean;
267
+ export declare function canonicalizeConceptualAttributionIds(report: RenderableAuditReport, adjudication: ConceptualReviewAdjudication, idSource?: RenderableAuditReport): ConceptualReviewAdjudication;
259
268
  /**
260
269
  * Re-escape the C0 control characters a report must never carry as raw bytes.
261
270
  *
@@ -1 +1 @@
1
- {"version":3,"file":"synthesis.d.ts","sourceRoot":"","sources":["../../../src/audit/reporting/synthesis.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACtF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,KAAK,EACV,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAC1F,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AACvF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AACvF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,KAAK,EACV,mBAAmB,EACnB,SAAS,EACT,qBAAqB,EACrB,oBAAoB,EACpB,OAAO,IAAI,aAAa,EACxB,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,aAAa,EACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAaL,KAAK,eAAe,EACpB,KA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T;AAED,wBAAgB,oCAAoC,CAClD,MAAM,EAAE,qBAAqB,EAC7B,YAAY,EAAE,4BAA4B,EAC1C,QAAQ,GAAE,qBAA8B,GACvC,4BAA4B,CAmK9B;AAuDD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAQhE;AAED,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,qBAAqB,EAC7B,OAAO,GAAE,wBAA6B,GACrC,MAAM,CAqRR;AA6FD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,mBAAmB,GAC1B,mBAAmB,CAuDrB"}
@@ -5,6 +5,7 @@ import { buildWorkBlockPartition } from "./workBlocks.js";
5
5
  import { mergeFindings } from "./mergeFindings.js";
6
6
  import { selectCurrentResults } from "../orchestrator/ledger.js";
7
7
  import { assignStableFindingIds } from "./findingIdentity.js";
8
+ import { QUESTION_AUDIT_FINDINGS_CONTRACT_VERSION, QuestionAuditFindingsReportSchema, } from "../../shared/types/questionReviewReport.js";
8
9
  const CONCEPTUAL_ATTRIBUTION_IDS = Symbol("conceptual-attribution-ids");
9
10
  const CONCEPTUAL_ID_MARKER_PREFIX = "\u0000audit-tools:conceptual-final-id:";
10
11
  /**
@@ -322,7 +323,7 @@ export function buildAuditReportModel(params) {
322
323
  // Per-file results credit only their own lens. A design pass credits the
323
324
  // lenses in its accepted snapshot only if its reviewed scope was nonempty.
324
325
  // This is exercised-lens evidence, not a claim of full per-file coverage.
325
- const exercisedLenses = exercisedReviewLenses(currentResults, params.designAssessment, params.designReviewSnapshots);
326
+ const exercisedLenses = exercisedReviewLenses(currentResults.filter((result) => result.task_id !== params.architectureSourceSample?.taskId), params.designAssessment, params.designReviewSnapshots);
326
327
  const selectedLenses = resolveIntentLensSelection(params.intentCheckpoint?.lens_selection);
327
328
  // Count grounding over ALL findings (incl. quarantined-refuted) so the `refuted`
328
329
  // tally reflects findings dropped from the admitted set.
@@ -345,7 +346,9 @@ export function buildAuditReportModel(params) {
345
346
  selectedLenses,
346
347
  findings,
347
348
  exercisedLenses,
348
- }),
349
+ }).map((entry) => entry.lens === "architecture" && params.architectureSourceSample !== undefined
350
+ ? { ...entry, source_sample: params.architectureSourceSample.status }
351
+ : entry),
349
352
  }),
350
353
  audited_file_count: coverage.audited_file_count,
351
354
  excluded_file_count: coverage.excluded_file_count,
@@ -498,7 +501,7 @@ export function applyNarrative(report, narrative) {
498
501
  * produced findings, or no selection was made — renders nothing.
499
502
  */
500
503
  function renderUnexercisedLensLine(coverage) {
501
- const unexercised = (coverage ?? []).filter((entry) => entry.selected && entry.outcome !== "findings");
504
+ const unexercised = (coverage ?? []).filter((entry) => entry.selected && entry.outcome !== "findings" && entry.source_sample === undefined);
502
505
  if (unexercised.length === 0)
503
506
  return [];
504
507
  const byOutcome = new Map();
@@ -514,6 +517,21 @@ function renderUnexercisedLensLine(coverage) {
514
517
  .map(([outcome, lenses]) => `${outcome === "not_run" ? "no qualifying inspection" : "reviewed, no findings"}: ${lenses.join(", ")}`);
515
518
  return [`- Selected lenses without findings: ${parts.join("; ")}`];
516
519
  }
520
+ function renderArchitectureSourceSample(coverage) {
521
+ const entry = coverage?.find((item) => item.lens === "architecture");
522
+ switch (entry?.source_sample) {
523
+ case "not_planned":
524
+ return ["- Architecture source sample: no cross-component workflow sample was planned."];
525
+ case "planned_not_run":
526
+ return ["- Architecture source sample: planned, but no current qualifying result."];
527
+ case "reviewed_no_findings":
528
+ return ["- Architecture source sample: reviewed one bounded workflow with no findings; not a whole-repository inspection."];
529
+ case "reviewed_with_findings":
530
+ return ["- Architecture source sample: reviewed one bounded workflow and reported findings; not a whole-repository inspection."];
531
+ default:
532
+ return [];
533
+ }
534
+ }
517
535
  /**
518
536
  * Name every finding the tool re-graded, with the severity it claimed — the
519
537
  * report-level statement that a severity in the breakdown was MOVED rather than
@@ -565,7 +583,7 @@ function renderAnalyzerDegradationLines(record) {
565
583
  * "complete" indistinguishable from "not measured", which is the exact
566
584
  * false-green this block exists to close. A run with no charter layer says so.
567
585
  */
568
- function renderCharterCoverageSection(coverage, archive) {
586
+ function renderCharterCoverageSection(coverage, archive, reportVerifiedRetention = false) {
569
587
  // Its OWN top-level section, not a sub-head of "Process Feedback": coverage is
570
588
  // a delivery measurement about the tool's inputs, not feedback about the host —
571
589
  // and nesting it there would force that heading to render on every report,
@@ -592,8 +610,16 @@ function renderCharterCoverageSection(coverage, archive) {
592
610
  unarchived
593
611
  .map((row) => `\`${row.kind}\` (${row.reason ?? "unstated reason"})`)
594
612
  .join(", ") +
595
- ". The lane-asset copy was left in place rather than deleted, so the " +
596
- "evidence still exists — but it is not in the run's archive.");
613
+ ". No verified archive is available for these records.");
614
+ }
615
+ if (reportVerifiedRetention) {
616
+ const retained = archive.filter(row => row.archived);
617
+ if (!retained.length)
618
+ lines.push("", "No verified charter packet retention record is available.");
619
+ else
620
+ for (const row of retained)
621
+ lines.push("", "- Verified retained packet: " + row.kind +
622
+ " (" + row.byte_length + " bytes; SHA-256 " + row.sha256 + ").");
597
623
  }
598
624
  lines.push("");
599
625
  return lines;
@@ -738,11 +764,21 @@ function renderSubmissionDriftSection(events) {
738
764
  function pushFindingBlock(finding, lines) {
739
765
  lines.push(...renderFindingBlockLines(finding));
740
766
  }
741
- export function canonicalizeConceptualAttributionIds(report, adjudication, idSource = report) {
742
- const canonicalIds = new Set([
767
+ function reportFindingIds(report) {
768
+ return new Set([
743
769
  ...report.findings.map((finding) => finding.id),
744
770
  ...(report.quarantined_findings ?? []).map((finding) => finding.id),
745
771
  ]);
772
+ }
773
+ export function conceptualAttributionNeedsIdSource(report, adjudication) {
774
+ if (!adjudication)
775
+ return false;
776
+ const ids = reportFindingIds(report);
777
+ return adjudication.final_finding_shares.some((share) => !ids.has(share.final_finding_id)) ||
778
+ adjudication.candidate_dispositions.some((disposition) => disposition.target_final_finding_ids.some((id) => !ids.has(id)));
779
+ }
780
+ export function canonicalizeConceptualAttributionIds(report, adjudication, idSource = report) {
781
+ const canonicalIds = reportFindingIds(report);
746
782
  const idMap = idSource[CONCEPTUAL_ATTRIBUTION_IDS];
747
783
  const resolve = (id) => {
748
784
  if (canonicalIds.has(id))
@@ -754,10 +790,8 @@ export function canonicalizeConceptualAttributionIds(report, adjudication, idSou
754
790
  throw new Error(`Conceptual attribution refused: final finding id "${id}" does not resolve ` +
755
791
  "to a canonical finding in audit-findings.json.");
756
792
  };
757
- // Canonicalize the carried adjudication itself, not only the markdown text.
758
- // The fold persists every carried core artifact, so subsequent narrative and
759
- // resynthesis renders reload canonical targets rather than reviving the
760
- // judge-local ids that existed before the synthesis boundary.
793
+ // Translate judge-local IDs only for this report. Accepted adjudication
794
+ // is a premise of systemic review, not a synthesis output.
761
795
  const sharesByCanonicalId = new Map();
762
796
  for (const share of adjudication.final_finding_shares) {
763
797
  const sourceFinalFindingId = share.final_finding_id;
@@ -845,16 +879,16 @@ export function canonicalizeConceptualAttributionIds(report, adjudication, idSou
845
879
  ...new Set(disposition.target_final_finding_ids.map(resolve)),
846
880
  ],
847
881
  }));
848
- // Commit both reference-bearing arrays only after every share and target has
849
- // resolved. A late unknown disposition target cannot leave half-canonical
850
- // attribution in the caller's carried bundle.
851
- adjudication.final_finding_shares = resolvedFinalFindingShares;
852
- adjudication.candidate_dispositions = resolvedCandidateDispositions;
882
+ return {
883
+ ...adjudication,
884
+ final_finding_shares: resolvedFinalFindingShares,
885
+ candidate_dispositions: resolvedCandidateDispositions,
886
+ };
853
887
  }
854
- function renderConceptualAttributionSection(report, adjudication) {
855
- if (!adjudication)
888
+ function renderConceptualAttributionSection(report, accepted, idSource) {
889
+ if (!accepted)
856
890
  return [];
857
- canonicalizeConceptualAttributionIds(report, adjudication);
891
+ const adjudication = canonicalizeConceptualAttributionIds(report, accepted, idSource);
858
892
  const contributors = new Map(adjudication.contributors.map((contributor) => [
859
893
  contributor.contributor_id,
860
894
  contributor,
@@ -932,6 +966,8 @@ export function escapeControlCharacters(markdown) {
932
966
  }).join("");
933
967
  }
934
968
  export function renderAuditReportMarkdown(report, options = {}) {
969
+ if (report.question_review !== undefined)
970
+ return renderQuestionReport(report, report.question_review, options);
935
971
  const lines = [
936
972
  AUDITOR_REPORT_MARKER,
937
973
  "# Audit Report",
@@ -976,7 +1012,7 @@ export function renderAuditReportMarkdown(report, options = {}) {
976
1012
  // findings has no key in a `countBy`, so it used to be invisible. Named
977
1013
  // here rather than in *Audit Limitations* (owner working assumption) — terse
978
1014
  // and always in front of the reader, beside the counts it qualifies.
979
- ...renderUnexercisedLensLine(report.summary.lens_coverage), ...(report.summary.grounding_status_breakdown &&
1015
+ ...renderUnexercisedLensLine(report.summary.lens_coverage), ...renderArchitectureSourceSample(report.summary.lens_coverage), ...(report.summary.grounding_status_breakdown &&
980
1016
  Object.keys(report.summary.grounding_status_breakdown).length > 0
981
1017
  ? [
982
1018
  `- Grounding (S7): ${formatCountList(report.summary.grounding_status_breakdown)}` +
@@ -1088,13 +1124,12 @@ export function renderAuditReportMarkdown(report, options = {}) {
1088
1124
  ...renderLaneDeliverySection(ledgerEvents),
1089
1125
  ...renderSubmissionDriftSection(ledgerEvents),
1090
1126
  ];
1091
- lines.push(...renderConceptualAttributionSection(report, options.conceptual_adjudication));
1127
+ lines.push(...renderConceptualAttributionSection(report, options.conceptual_adjudication, options.conceptual_attribution_id_source));
1092
1128
  const reflections = options.reflections ?? [];
1093
1129
  // Structural capability limitations are report limitations, not process
1094
1130
  // feedback. Keep the machine contract untouched: this only partitions the
1095
1131
  // human-readable render.
1096
- const capabilityLimitations = reflections.filter((reflection) => reflection.task_id === "audit-capability-preflight" &&
1097
- (reflection.severity === "high" || reflection.severity === "critical"));
1132
+ const capabilityLimitations = reflections.filter(isCapabilityLimitationReflection);
1098
1133
  const processFeedback = reflections.filter((reflection) => !capabilityLimitations.includes(reflection));
1099
1134
  // *Audit Limitations* states what this run could NOT do. It has two sources
1100
1135
  // now, and the section is CREATED by either — it used to be the process-
@@ -1148,6 +1183,105 @@ export function renderAuditReportMarkdown(report, options = {}) {
1148
1183
  // reach `audit-report.md` raw, whatever field it arrived in.
1149
1184
  return escapeControlCharacters(lines.join("\n"));
1150
1185
  }
1186
+ function isCapabilityLimitationReflection(reflection) {
1187
+ return reflection.task_id === "audit-capability-preflight" &&
1188
+ (reflection.severity === "high" || reflection.severity === "critical");
1189
+ }
1190
+ function renderQuestionReport(report, review, options) {
1191
+ const reflections = options.reflections ?? [];
1192
+ const lines = [
1193
+ AUDITOR_REPORT_MARKER, "# Audit Report", "",
1194
+ `Coverage: **${review.completion}**. Snapshot: ${review.snapshot_id}.`,
1195
+ `Actionable confirmed defects: ${report.findings.length}. Repair work blocks: ${report.work_blocks.length}.`,
1196
+ ];
1197
+ if (report.executive_summary?.trim() || report.themes?.length || report.top_risks?.length) {
1198
+ lines.push("", "## Narrative (does not change coverage or findings)", "");
1199
+ if (report.executive_summary?.trim())
1200
+ lines.push(report.executive_summary.trim());
1201
+ for (const theme of report.themes ?? []) {
1202
+ lines.push(`- ${theme.title}: ${theme.root_cause} [${theme.finding_ids.join(", ")}]`);
1203
+ }
1204
+ for (const risk of report.top_risks ?? [])
1205
+ lines.push(`- Risk: ${risk}`);
1206
+ }
1207
+ lines.push("", "## Lens coverage", "");
1208
+ for (const lens of review.lens_decisions) {
1209
+ const questions = review.questions.filter(row => row.lens === lens.lens);
1210
+ const counts = Object.entries(countBy(questions, question => question.state))
1211
+ .sort(([a], [b]) => compareCodeUnits(a, b))
1212
+ .map(([state, count]) => `${state}: ${count}`).join(", ");
1213
+ lines.push(`- ${lens.lens}: ${lens.decision}. ${lens.reason}${counts ? ` (${counts})` : ""}`);
1214
+ }
1215
+ lines.push("", "## Questions and review limits", "");
1216
+ for (const row of review.questions) {
1217
+ lines.push(`### ${row.question_id} (${row.lens}): ${row.state}`, "", row.expected_outcome);
1218
+ if (row.plan_reason)
1219
+ lines.push(`- Planning: ${row.plan_status}: ${row.plan_reason}`);
1220
+ for (const part of row.parts) {
1221
+ lines.push(`- ${part.part_id}: **${part.state}**. ${part.expectation}`);
1222
+ for (const reason of part.reasons)
1223
+ lines.push(` - ${reason}`);
1224
+ }
1225
+ for (const conflict of row.conflicts) {
1226
+ lines.push(`- Unresolved disagreement on ${conflict.part_id}: ${conflict.answer_ids.join(", ")}.`);
1227
+ }
1228
+ for (const answer of review.accepted.filter(record => record.submission.question_id === row.question_id)) {
1229
+ const submission = answer.submission;
1230
+ const current = row.accepted_answer_ids.includes(submission.submission_id);
1231
+ lines.push(`- ${current ? "Accepted" : "Historical"} answer ${submission.submission_id}`);
1232
+ for (const limit of submission.limitations)
1233
+ lines.push(` - Limitation: ${limit}`);
1234
+ for (const observation of submission.answer.observations) {
1235
+ const refs = observation.evidence_refs.map(ref => ref.observation_id
1236
+ ? `${ref.evidence_id}/${ref.observation_id}` : ref.evidence_id);
1237
+ lines.push(` - ${observation.kind} (${observation.part_id}): ${observation.statement}${refs.length ? ` [evidence: ${refs.join(", ")}]` : ""}`);
1238
+ }
1239
+ }
1240
+ for (const decision of review.adjudications.filter(decision => decision.question_id === row.question_id)) {
1241
+ lines.push(`- Recorded decision ${decision.adjudication_id} (${decision.decision}, ${decision.reviewer}): ${decision.rationale}`);
1242
+ }
1243
+ lines.push("");
1244
+ }
1245
+ lines.push("## Scope and omissions", "");
1246
+ for (const item of review.inventory) {
1247
+ if (item.scope !== "in_scope")
1248
+ lines.push(`- ${item.title}: ${item.scope}. ${item.scope_reason ?? ""}`);
1249
+ else if (!review.questions.some(q => q.inventory_item_ids.includes(item.inventory_item_id))) {
1250
+ lines.push(`- ${item.title}: in scope, no question planned.`);
1251
+ }
1252
+ }
1253
+ for (const omission of review.omissions)
1254
+ lines.push(`- ${omission.surface_id}: ${omission.reason}`);
1255
+ lines.push("", "## Findings and leads", "");
1256
+ for (const group of review.findings) {
1257
+ const finding = report.findings.find(row => row.id === group.canonical_finding_id);
1258
+ lines.push(`- ${group.canonical_finding_id}: ${group.kind} (${finding ? `actionable; ${finding.severity}` : "not actionable"}).`);
1259
+ for (const source of group.sources) {
1260
+ lines.push(` - ${source.finding_id} on ${source.question_id}: ${source.claim}. ${source.consequence}`);
1261
+ lines.push(` - Next step: ${source.next_step}`);
1262
+ if (source.verification.length)
1263
+ lines.push(` - Verification: ${source.verification.map(v => v.obligation_id).join(", ")}.`);
1264
+ }
1265
+ }
1266
+ lines.push("", "## Evidence", "");
1267
+ for (const evidence of review.evidence) {
1268
+ const execution = evidence.execution;
1269
+ lines.push(`- ${evidence.evidence_id}: ${evidence.status} (${evidence.kind}). ${evidence.description}`);
1270
+ if (execution)
1271
+ lines.push(execution.executed
1272
+ ? ` - Executed: ${execution.tool} ${execution.tool_version}${execution.elapsed_ms === undefined ? "" : ` (${execution.elapsed_ms} ms observed)`}.`
1273
+ : ` - Not executed: ${execution.tool} ${execution.tool_version}.`);
1274
+ }
1275
+ const limitations = reflections.filter(isCapabilityLimitationReflection);
1276
+ const limitationLines = renderProcessFeedbackSection(limitations);
1277
+ if (limitationLines.length > 0)
1278
+ limitationLines[0] = "## Audit Limitations";
1279
+ lines.push("", ...limitationLines, ...renderProcessFeedbackSection(reflections.filter(reflection => !isCapabilityLimitationReflection(reflection))));
1280
+ if (options.charter_evidence_coverage !== undefined || options.charter_packet_archive !== undefined) {
1281
+ lines.push("", ...renderCharterCoverageSection(options.charter_evidence_coverage ?? [], options.charter_packet_archive ?? [], true));
1282
+ }
1283
+ return escapeControlCharacters(lines.join("\n").trimEnd() + "\n");
1284
+ }
1151
1285
  /**
1152
1286
  * Re-derive the summary fields that can be computed from the existing findings
1153
1287
  * and work_blocks, bump the contract_version to the current constant, and leave
@@ -1169,6 +1303,9 @@ export function renderAuditReportMarkdown(report, options = {}) {
1169
1303
  * the pruned `.audit-tools/audit` working-bundle intermediates.
1170
1304
  */
1171
1305
  export function normalizeExistingFindingsReport(report) {
1306
+ if (report.contract_version === QUESTION_AUDIT_FINDINGS_CONTRACT_VERSION) {
1307
+ return QuestionAuditFindingsReportSchema.parse(report);
1308
+ }
1172
1309
  const findings = applyCriticalEvidenceBar(report.findings);
1173
1310
  // Counts read the SAME array the bar produced, not the input: a downgrade
1174
1311
  // moves a finding between severity buckets, so a breakdown derived from the