audit-tools 0.56.1 → 0.57.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -22
- package/dist/audit/cli/args.d.ts +0 -1
- package/dist/audit/cli/args.d.ts.map +1 -1
- package/dist/audit/cli/args.js +0 -14
- package/dist/audit/cli/args.js.map +1 -1
- package/dist/audit/cli/auditStep.d.ts +0 -59
- package/dist/audit/cli/auditStep.d.ts.map +1 -1
- package/dist/audit/cli/auditStep.js +2 -136
- package/dist/audit/cli/auditStep.js.map +1 -1
- package/dist/audit/cli/cleanup.d.ts.map +1 -1
- package/dist/audit/cli/cleanup.js +4 -1
- package/dist/audit/cli/cleanup.js.map +1 -1
- package/dist/audit/cli/confirmIntentStep.d.ts.map +1 -1
- package/dist/audit/cli/confirmIntentStep.js +16 -31
- package/dist/audit/cli/confirmIntentStep.js.map +1 -1
- package/dist/audit/cli/dispatch/hostHandoff.d.ts +414 -1
- package/dist/audit/cli/dispatch/hostHandoff.d.ts.map +1 -1
- package/dist/audit/cli/dispatch/hostHandoff.js +223 -1
- package/dist/audit/cli/dispatch/hostHandoff.js.map +1 -1
- package/dist/audit/cli/dispatch/questionReviewAcceptance.d.ts +254 -0
- package/dist/audit/cli/dispatch/questionReviewAcceptance.d.ts.map +1 -0
- package/dist/audit/cli/dispatch/questionReviewAcceptance.js +181 -0
- package/dist/audit/cli/dispatch/questionReviewAcceptance.js.map +1 -0
- package/dist/audit/cli/functionalPreflight.d.ts +4 -4
- package/dist/audit/cli/laneSubmissions.d.ts +4 -4
- package/dist/audit/cli/nextStepCommand.d.ts +3 -20
- package/dist/audit/cli/nextStepCommand.d.ts.map +1 -1
- package/dist/audit/cli/nextStepCommand.js +39 -133
- package/dist/audit/cli/nextStepCommand.js.map +1 -1
- package/dist/audit/cli/nextStepHelpers.d.ts +10 -72
- package/dist/audit/cli/nextStepHelpers.d.ts.map +1 -1
- package/dist/audit/cli/nextStepHelpers.js +95 -363
- package/dist/audit/cli/nextStepHelpers.js.map +1 -1
- package/dist/audit/cli/prompts.d.ts +0 -2
- package/dist/audit/cli/prompts.d.ts.map +1 -1
- package/dist/audit/cli/prompts.js +3 -14
- package/dist/audit/cli/prompts.js.map +1 -1
- package/dist/audit/cli/questionReviewCycle.d.ts +239 -0
- package/dist/audit/cli/questionReviewCycle.d.ts.map +1 -0
- package/dist/audit/cli/questionReviewCycle.js +55 -0
- package/dist/audit/cli/questionReviewCycle.js.map +1 -0
- package/dist/audit/cli/questionReviewSession.d.ts +7 -0
- package/dist/audit/cli/questionReviewSession.d.ts.map +1 -0
- package/dist/audit/cli/questionReviewSession.js +46 -0
- package/dist/audit/cli/questionReviewSession.js.map +1 -0
- package/dist/audit/cli/questionWorkloadBindings.d.ts +7 -0
- package/dist/audit/cli/questionWorkloadBindings.d.ts.map +1 -0
- package/dist/audit/cli/questionWorkloadBindings.js +66 -0
- package/dist/audit/cli/questionWorkloadBindings.js.map +1 -0
- package/dist/audit/cli/resynthesizeCommand.d.ts +1 -0
- package/dist/audit/cli/resynthesizeCommand.d.ts.map +1 -1
- package/dist/audit/cli/resynthesizeCommand.js +52 -51
- package/dist/audit/cli/resynthesizeCommand.js.map +1 -1
- package/dist/audit/cli/sampleRunCommand.d.ts +565 -160
- package/dist/audit/cli/sampleRunCommand.d.ts.map +1 -1
- package/dist/audit/cli/sampleRunCommand.js +66 -152
- package/dist/audit/cli/sampleRunCommand.js.map +1 -1
- package/dist/audit/cli/statusCommand.d.ts.map +1 -1
- package/dist/audit/cli/statusCommand.js +20 -14
- package/dist/audit/cli/statusCommand.js.map +1 -1
- package/dist/audit/cli/steps.d.ts +10 -10
- package/dist/audit/cli/submitCommand.d.ts +11 -6
- package/dist/audit/cli/submitCommand.d.ts.map +1 -1
- package/dist/audit/cli/submitCommand.js +91 -24
- package/dist/audit/cli/submitCommand.js.map +1 -1
- package/dist/audit/cli.d.ts.map +1 -1
- package/dist/audit/cli.js +6 -17
- package/dist/audit/cli.js.map +1 -1
- package/dist/audit/contracts/findingContractPrompt.d.ts +4 -4
- package/dist/audit/contracts/workerSchemas.d.ts +69 -68
- package/dist/audit/contracts/workerSchemas.d.ts.map +1 -1
- package/dist/audit/contracts/workerSchemas.js +8 -1
- package/dist/audit/contracts/workerSchemas.js.map +1 -1
- package/dist/audit/contracts/wrapperResponse.d.ts +13 -13
- package/dist/audit/contracts/wrapperResponse.d.ts.map +1 -1
- package/dist/audit/contracts/wrapperResponse.js +0 -1
- package/dist/audit/contracts/wrapperResponse.js.map +1 -1
- package/dist/audit/extractors/designAssessment.js +2 -2
- package/dist/audit/extractors/designAssessment.js.map +1 -1
- package/dist/audit/io/artifacts.d.ts +31 -9
- package/dist/audit/io/artifacts.d.ts.map +1 -1
- package/dist/audit/io/artifacts.js +197 -31
- package/dist/audit/io/artifacts.js.map +1 -1
- package/dist/audit/io/rollover.d.ts.map +1 -1
- package/dist/audit/io/rollover.js +7 -16
- package/dist/audit/io/rollover.js.map +1 -1
- package/dist/audit/io/runSnapshot.d.ts +1 -1
- package/dist/audit/io/runSnapshot.js +1 -1
- package/dist/audit/orchestrator/architectureDiscovery.d.ts +9 -10
- package/dist/audit/orchestrator/architectureDiscovery.d.ts.map +1 -1
- package/dist/audit/orchestrator/architectureDiscovery.js +95 -13
- package/dist/audit/orchestrator/architectureDiscovery.js.map +1 -1
- package/dist/audit/orchestrator/charterPacketArchive.d.ts +3 -0
- package/dist/audit/orchestrator/charterPacketArchive.d.ts.map +1 -1
- package/dist/audit/orchestrator/charterPacketArchive.js +31 -2
- package/dist/audit/orchestrator/charterPacketArchive.js.map +1 -1
- package/dist/audit/orchestrator/dependencyMap.d.ts +2 -8
- package/dist/audit/orchestrator/dependencyMap.d.ts.map +1 -1
- package/dist/audit/orchestrator/dependencyMap.js +10 -105
- package/dist/audit/orchestrator/dependencyMap.js.map +1 -1
- package/dist/audit/orchestrator/dependencySlices.d.ts +2 -3
- package/dist/audit/orchestrator/dependencySlices.d.ts.map +1 -1
- package/dist/audit/orchestrator/dependencySlices.js +2 -35
- package/dist/audit/orchestrator/dependencySlices.js.map +1 -1
- package/dist/audit/orchestrator/designReviewPrompt.d.ts.map +1 -1
- package/dist/audit/orchestrator/designReviewPrompt.js +24 -14
- package/dist/audit/orchestrator/designReviewPrompt.js.map +1 -1
- package/dist/audit/orchestrator/executorRunners.d.ts +1 -1
- package/dist/audit/orchestrator/executorRunners.d.ts.map +1 -1
- package/dist/audit/orchestrator/executorRunners.js +14 -21
- package/dist/audit/orchestrator/executorRunners.js.map +1 -1
- package/dist/audit/orchestrator/executors.d.ts.map +1 -1
- package/dist/audit/orchestrator/executors.js +1 -131
- package/dist/audit/orchestrator/executors.js.map +1 -1
- package/dist/audit/orchestrator/flowPlanning.d.ts +1 -1
- package/dist/audit/orchestrator/flowPlanning.js +1 -1
- package/dist/audit/orchestrator/ingestionExecutors.d.ts.map +1 -1
- package/dist/audit/orchestrator/ingestionExecutors.js +19 -12
- package/dist/audit/orchestrator/ingestionExecutors.js.map +1 -1
- package/dist/audit/orchestrator/intentCheckpointExecutor.d.ts +2 -2
- package/dist/audit/orchestrator/intentCheckpointExecutor.d.ts.map +1 -1
- package/dist/audit/orchestrator/intentCheckpointExecutor.js +37 -36
- package/dist/audit/orchestrator/intentCheckpointExecutor.js.map +1 -1
- package/dist/audit/orchestrator/lensSelection.d.ts +6 -37
- package/dist/audit/orchestrator/lensSelection.d.ts.map +1 -1
- package/dist/audit/orchestrator/lensSelection.js +42 -68
- package/dist/audit/orchestrator/lensSelection.js.map +1 -1
- package/dist/audit/orchestrator/nextStep.d.ts.map +1 -1
- package/dist/audit/orchestrator/nextStep.js +1 -4
- package/dist/audit/orchestrator/nextStep.js.map +1 -1
- package/dist/audit/orchestrator/questionEvidence.d.ts +67 -0
- package/dist/audit/orchestrator/questionEvidence.d.ts.map +1 -0
- package/dist/audit/orchestrator/questionEvidence.js +177 -0
- package/dist/audit/orchestrator/questionEvidence.js.map +1 -0
- package/dist/audit/orchestrator/questionPlanExecutor.d.ts +10 -0
- package/dist/audit/orchestrator/questionPlanExecutor.d.ts.map +1 -0
- package/dist/audit/orchestrator/questionPlanExecutor.js +23 -0
- package/dist/audit/orchestrator/questionPlanExecutor.js.map +1 -0
- package/dist/audit/orchestrator/questionPlanning.d.ts +48 -0
- package/dist/audit/orchestrator/questionPlanning.d.ts.map +1 -0
- package/dist/audit/orchestrator/questionPlanning.js +326 -0
- package/dist/audit/orchestrator/questionPlanning.js.map +1 -0
- package/dist/audit/orchestrator/reviewLensPlaybooks.d.ts +11 -0
- package/dist/audit/orchestrator/reviewLensPlaybooks.d.ts.map +1 -0
- package/dist/audit/orchestrator/reviewLensPlaybooks.js +11 -0
- package/dist/audit/orchestrator/reviewLensPlaybooks.js.map +1 -0
- package/dist/audit/orchestrator/runtimeValidation.d.ts.map +1 -1
- package/dist/audit/orchestrator/runtimeValidation.js +14 -0
- package/dist/audit/orchestrator/runtimeValidation.js.map +1 -1
- package/dist/audit/orchestrator/runtimeValidationUpdate.d.ts +1 -1
- package/dist/audit/orchestrator/runtimeValidationUpdate.d.ts.map +1 -1
- package/dist/audit/orchestrator/runtimeValidationUpdate.js +13 -4
- package/dist/audit/orchestrator/runtimeValidationUpdate.js.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/conflict.js +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/conflict.js.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/index.js +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/index.js.map +1 -1
- package/dist/audit/orchestrator/state.d.ts.map +1 -1
- package/dist/audit/orchestrator/state.js +8 -60
- package/dist/audit/orchestrator/state.js.map +1 -1
- package/dist/audit/orchestrator/synthesisExecutors.d.ts +15 -1
- package/dist/audit/orchestrator/synthesisExecutors.d.ts.map +1 -1
- package/dist/audit/orchestrator/synthesisExecutors.js +76 -25
- package/dist/audit/orchestrator/synthesisExecutors.js.map +1 -1
- package/dist/audit/orchestrator/systemicChallengeExecutor.d.ts.map +1 -1
- package/dist/audit/orchestrator/systemicChallengeExecutor.js +11 -6
- package/dist/audit/orchestrator/systemicChallengeExecutor.js.map +1 -1
- package/dist/audit/orchestrator/taskAffinityGraph.d.ts +4 -4
- package/dist/audit/reporting/questionReport.d.ts +27 -0
- package/dist/audit/reporting/questionReport.d.ts.map +1 -0
- package/dist/audit/reporting/questionReport.js +183 -0
- package/dist/audit/reporting/questionReport.js.map +1 -0
- package/dist/audit/reporting/synthesis.d.ts +10 -1
- package/dist/audit/reporting/synthesis.d.ts.map +1 -1
- package/dist/audit/reporting/synthesis.js +161 -24
- package/dist/audit/reporting/synthesis.js.map +1 -1
- package/dist/audit/reporting/synthesisNarrativePrompt.d.ts +4 -1
- package/dist/audit/reporting/synthesisNarrativePrompt.d.ts.map +1 -1
- package/dist/audit/reporting/synthesisNarrativePrompt.js +5 -1
- package/dist/audit/reporting/synthesisNarrativePrompt.js.map +1 -1
- package/dist/audit/supervisor/operatorHandoff.d.ts +2 -3
- package/dist/audit/supervisor/operatorHandoff.d.ts.map +1 -1
- package/dist/audit/supervisor/operatorHandoff.js +3 -18
- package/dist/audit/supervisor/operatorHandoff.js.map +1 -1
- package/dist/audit/systemic/aggregateMetricsDigest.d.ts.map +1 -1
- package/dist/audit/systemic/aggregateMetricsDigest.js +0 -2
- package/dist/audit/systemic/aggregateMetricsDigest.js.map +1 -1
- package/dist/audit/types/artifactMetadata.d.ts +1 -2
- package/dist/audit/types/artifactMetadata.d.ts.map +1 -1
- package/dist/audit/types/auditState.d.ts +6 -6
- package/dist/audit/types/conceptualAdjudication.d.ts +708 -50
- package/dist/audit/types/conceptualAdjudication.d.ts.map +1 -1
- package/dist/audit/types/conceptualAdjudication.js +2 -0
- package/dist/audit/types/conceptualAdjudication.js.map +1 -1
- package/dist/audit/types/runtimeValidation.d.ts +58 -6
- package/dist/audit/types/runtimeValidation.d.ts.map +1 -1
- package/dist/audit/types/runtimeValidation.js +8 -0
- package/dist/audit/types/runtimeValidation.js.map +1 -1
- package/dist/audit/types.d.ts +539 -22
- package/dist/audit/types.d.ts.map +1 -1
- package/dist/audit/validation/auditResults.d.ts +1 -1
- package/dist/audit/validation/auditResults.js +1 -1
- package/dist/audit/validation/ingestIssueCodes.d.ts.map +1 -1
- package/dist/audit/validation/ingestIssueCodes.js +0 -1
- package/dist/audit/validation/ingestIssueCodes.js.map +1 -1
- package/dist/remediate/contractPipeline/executionPlan.d.ts +679 -52
- package/dist/remediate/contractPipeline/executionPlan.d.ts.map +1 -1
- package/dist/remediate/contractPipeline/executionPlan.js +23 -0
- package/dist/remediate/contractPipeline/executionPlan.js.map +1 -1
- package/dist/remediate/findingFilter.d.ts.map +1 -1
- package/dist/remediate/findingFilter.js +6 -2
- package/dist/remediate/findingFilter.js.map +1 -1
- package/dist/remediate/intake.d.ts +4 -4
- package/dist/remediate/phases/close.d.ts.map +1 -1
- package/dist/remediate/phases/close.js +15 -5
- package/dist/remediate/phases/close.js.map +1 -1
- package/dist/remediate/phases/closeVerifyAnalyzerLeads.d.ts +5 -0
- package/dist/remediate/phases/closeVerifyAnalyzerLeads.d.ts.map +1 -1
- package/dist/remediate/phases/closeVerifyAnalyzerLeads.js +37 -8
- package/dist/remediate/phases/closeVerifyAnalyzerLeads.js.map +1 -1
- package/dist/remediate/state/types.d.ts +619 -26
- package/dist/remediate/state/types.d.ts.map +1 -1
- package/dist/remediate/state/types.js +2 -1
- package/dist/remediate/state/types.js.map +1 -1
- package/dist/remediate/steps/contractPipeline.d.ts.map +1 -1
- package/dist/remediate/steps/contractPipeline.js +2 -0
- package/dist/remediate/steps/contractPipeline.js.map +1 -1
- package/dist/remediate/steps/contractPipelinePrompts.d.ts.map +1 -1
- package/dist/remediate/steps/contractPipelinePrompts.js +2 -0
- package/dist/remediate/steps/contractPipelinePrompts.js.map +1 -1
- package/dist/remediate/steps/dispatch/contractConformanceReview.d.ts +3 -3
- package/dist/remediate/steps/intakeResolver.d.ts.map +1 -1
- package/dist/remediate/steps/intakeResolver.js +31 -6
- package/dist/remediate/steps/intakeResolver.js.map +1 -1
- package/dist/remediate/steps/nextStep.d.ts.map +1 -1
- package/dist/remediate/steps/nextStep.js +31 -40
- package/dist/remediate/steps/nextStep.js.map +1 -1
- package/dist/remediate/steps/prompts.d.ts.map +1 -1
- package/dist/remediate/steps/prompts.js +3 -0
- package/dist/remediate/steps/prompts.js.map +1 -1
- package/dist/shared/analyzers/types.d.ts +18 -18
- package/dist/shared/contentKey.d.ts +1 -1
- package/dist/shared/contentKey.js +1 -1
- package/dist/shared/decompose/charterClarification.d.ts +4 -4
- package/dist/shared/decompose/charterExtraction.d.ts +30 -30
- package/dist/shared/decompose/contentCoherence.d.ts +1 -1
- package/dist/shared/decompose/contentCoherence.js +1 -1
- package/dist/shared/decompose/systemicChallenge.d.ts +629 -18
- package/dist/shared/decompose/systemicChallenge.d.ts.map +1 -1
- package/dist/shared/engine/obligationEngine.d.ts +2 -2
- package/dist/shared/index.d.ts +2 -0
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +2 -0
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/io/stepContractWriter.js +1 -1
- package/dist/shared/io/stepContractWriter.js.map +1 -1
- package/dist/shared/loopCorePaths.d.ts.map +1 -1
- package/dist/shared/loopCorePaths.js +5 -2
- package/dist/shared/loopCorePaths.js.map +1 -1
- package/dist/shared/mcp/submitServer.d.ts +1 -0
- package/dist/shared/mcp/submitServer.d.ts.map +1 -1
- package/dist/shared/mcp/submitServer.js +1 -1
- package/dist/shared/mcp/submitServer.js.map +1 -1
- package/dist/shared/submission/hostResultOutcomes.js +1 -1
- package/dist/shared/submission/hostResultOutcomes.js.map +1 -1
- package/dist/shared/tooling/exec.js +1 -1
- package/dist/shared/tooling/exec.js.map +1 -1
- package/dist/shared/types/charter.d.ts +38 -38
- package/dist/shared/types/contractPropertyShapes.d.ts.map +1 -1
- package/dist/shared/types/contractPropertyShapes.js +7 -0
- package/dist/shared/types/contractPropertyShapes.js.map +1 -1
- package/dist/shared/types/executionPlan.d.ts +88 -12
- package/dist/shared/types/executionPlan.d.ts.map +1 -1
- package/dist/shared/types/executionPlan.js +1 -0
- package/dist/shared/types/executionPlan.js.map +1 -1
- package/dist/shared/types/finding.d.ts +1721 -56
- package/dist/shared/types/finding.d.ts.map +1 -1
- package/dist/shared/types/finding.js +7 -10
- package/dist/shared/types/finding.js.map +1 -1
- package/dist/shared/types/findingVocabulary.d.ts +8 -0
- package/dist/shared/types/findingVocabulary.d.ts.map +1 -0
- package/dist/shared/types/findingVocabulary.js +13 -0
- package/dist/shared/types/findingVocabulary.js.map +1 -0
- package/dist/shared/types/intentCheckpoint.d.ts +8 -3
- package/dist/shared/types/intentCheckpoint.d.ts.map +1 -1
- package/dist/shared/types/intentCheckpoint.js +4 -3
- package/dist/shared/types/intentCheckpoint.js.map +1 -1
- package/dist/shared/types/questionReviewReport.d.ts +9912 -0
- package/dist/shared/types/questionReviewReport.d.ts.map +1 -0
- package/dist/shared/types/questionReviewReport.js +185 -0
- package/dist/shared/types/questionReviewReport.js.map +1 -0
- package/dist/shared/types/remediationOutcome.d.ts +1379 -148
- package/dist/shared/types/remediationOutcome.d.ts.map +1 -1
- package/dist/shared/types/remediationOutcome.js +5 -0
- package/dist/shared/types/remediationOutcome.js.map +1 -1
- package/dist/shared/types/reviewIndependence.d.ts +24 -24
- package/dist/shared/types/reviewQuestion.d.ts +4359 -0
- package/dist/shared/types/reviewQuestion.d.ts.map +1 -0
- package/dist/shared/types/reviewQuestion.js +182 -0
- package/dist/shared/types/reviewQuestion.js.map +1 -0
- package/dist/shared/types/stepContract.js +1 -1
- package/dist/shared/types/stepContract.js.map +1 -1
- package/dist/shared/validation/designFindingGrounding.js +1 -1
- package/dist/shared/validation/designFindingGrounding.js.map +1 -1
- package/dist/shared/validation/findingsReport.d.ts.map +1 -1
- package/dist/shared/validation/findingsReport.js +19 -4
- package/dist/shared/validation/findingsReport.js.map +1 -1
- package/docs/audit-pkg/contracts.md +27 -56
- package/docs/audit-pkg/operator-guide.md +31 -17
- package/docs/audit-pkg/product.md +17 -23
- package/package.json +1 -1
- package/schemas/audit-code-v1alpha1.schema.json +0 -1
- package/schemas/review_submission.schema.json +514 -0
- package/scripts/postinstall.mjs +16 -9
- package/skills/audit-code/audit-code.prompt.md +7 -5
- package/wrapper/audit-code-wrapper-lib.mjs +1 -5
- package/wrapper/installer-verb-help.mjs +1 -1
- package/dist/audit/cli/explainTaskCommand.d.ts +0 -4
- package/dist/audit/cli/explainTaskCommand.d.ts.map +0 -1
- package/dist/audit/cli/explainTaskCommand.js +0 -45
- package/dist/audit/cli/explainTaskCommand.js.map +0 -1
- package/dist/audit/cli/ingestResultsCommand.d.ts +0 -2
- package/dist/audit/cli/ingestResultsCommand.d.ts.map +0 -1
- package/dist/audit/cli/ingestResultsCommand.js +0 -42
- package/dist/audit/cli/ingestResultsCommand.js.map +0 -1
- package/dist/audit/cli/requeueCommand.d.ts +0 -2
- package/dist/audit/cli/requeueCommand.d.ts.map +0 -1
- package/dist/audit/cli/requeueCommand.js +0 -12
- package/dist/audit/cli/requeueCommand.js.map +0 -1
- package/dist/audit/cli/semanticReviewStep.d.ts +0 -41
- package/dist/audit/cli/semanticReviewStep.d.ts.map +0 -1
- package/dist/audit/cli/semanticReviewStep.js +0 -185
- package/dist/audit/cli/semanticReviewStep.js.map +0 -1
- package/dist/audit/cli/unacceptResultsCommand.d.ts +0 -19
- package/dist/audit/cli/unacceptResultsCommand.d.ts.map +0 -1
- package/dist/audit/cli/unacceptResultsCommand.js +0 -52
- package/dist/audit/cli/unacceptResultsCommand.js.map +0 -1
- package/dist/audit/cli/updateRuntimeValidationCommand.d.ts +0 -2
- package/dist/audit/cli/updateRuntimeValidationCommand.d.ts.map +0 -1
- package/dist/audit/cli/updateRuntimeValidationCommand.js +0 -18
- package/dist/audit/cli/updateRuntimeValidationCommand.js.map +0 -1
- package/dist/audit/cli/validateResultsCommand.d.ts +0 -13
- package/dist/audit/cli/validateResultsCommand.d.ts.map +0 -1
- package/dist/audit/cli/validateResultsCommand.js +0 -87
- package/dist/audit/cli/validateResultsCommand.js.map +0 -1
- package/dist/audit/cli/workerResult.d.ts +0 -2
- package/dist/audit/cli/workerResult.d.ts.map +0 -1
- package/dist/audit/cli/workerResult.js +0 -6
- package/dist/audit/cli/workerResult.js.map +0 -1
- package/dist/audit/orchestrator/coverageElementBaseline.d.ts +0 -54
- package/dist/audit/orchestrator/coverageElementBaseline.d.ts.map +0 -1
- package/dist/audit/orchestrator/coverageElementBaseline.js +0 -136
- package/dist/audit/orchestrator/coverageElementBaseline.js.map +0 -1
- package/dist/audit/orchestrator/planning.d.ts +0 -5
- package/dist/audit/orchestrator/planning.d.ts.map +0 -1
- package/dist/audit/orchestrator/planning.js +0 -79
- package/dist/audit/orchestrator/planning.js.map +0 -1
- package/dist/audit/orchestrator/planningExecutors.d.ts +0 -21
- package/dist/audit/orchestrator/planningExecutors.d.ts.map +0 -1
- package/dist/audit/orchestrator/planningExecutors.js +0 -273
- package/dist/audit/orchestrator/planningExecutors.js.map +0 -1
- package/dist/audit/orchestrator/taskBuilder.d.ts +0 -62
- package/dist/audit/orchestrator/taskBuilder.d.ts.map +0 -1
- package/dist/audit/orchestrator/taskBuilder.js +0 -412
- package/dist/audit/orchestrator/taskBuilder.js.map +0 -1
- package/dist/audit/orchestrator/trivialAudit.d.ts +0 -21
- package/dist/audit/orchestrator/trivialAudit.d.ts.map +0 -1
- package/dist/audit/orchestrator/trivialAudit.js +0 -80
- package/dist/audit/orchestrator/trivialAudit.js.map +0 -1
|
@@ -0,0 +1,183 @@
|
|
|
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 pending = new Map(claims.map(claim => [questionClaimKey(claim.answerId, claim.source.finding_id), claim]));
|
|
100
|
+
if (pending.size !== claims.length)
|
|
101
|
+
throw new Error("Duplicate finding claim within an accepted submission.");
|
|
102
|
+
const groups = [];
|
|
103
|
+
const groupedKeys = new Set();
|
|
104
|
+
for (const decision of decisions) {
|
|
105
|
+
const keys = uniqueSorted(decision.sources.map(source => questionClaimKey(source.answer_id, source.finding_id)));
|
|
106
|
+
const historical = decision.sources.map(({ answer_id, finding_id }) => accepted.get(answer_id)?.submission.answer.findings.filter(source => source.finding_id === finding_id) ?? []);
|
|
107
|
+
if (keys.length < 2 || keys.length !== decision.sources.length ||
|
|
108
|
+
historical.some(rows => rows.length !== 1 || rows[0].kind !== historical[0]?.[0]?.kind)) {
|
|
109
|
+
throw new Error(`Consolidation ${decision.decision_id} must name distinct available claims of one kind.`);
|
|
110
|
+
}
|
|
111
|
+
if (keys.some(key => groupedKeys.has(key))) {
|
|
112
|
+
throw new Error(`Consolidation ${decision.decision_id} overlaps a current decision.`);
|
|
113
|
+
}
|
|
114
|
+
const rows = keys.flatMap(key => pending.get(key) ?? []);
|
|
115
|
+
// The decision is historical even after its sources cease to be current.
|
|
116
|
+
// Do not hide current independent findings behind an obsolete repair.
|
|
117
|
+
if (rows.length !== keys.length || rows.some(row => !row.actionable))
|
|
118
|
+
continue;
|
|
119
|
+
for (const key of keys)
|
|
120
|
+
groupedKeys.add(key);
|
|
121
|
+
groups.push(rows);
|
|
122
|
+
for (const key of keys)
|
|
123
|
+
pending.delete(key);
|
|
124
|
+
}
|
|
125
|
+
groups.push(...[...pending.entries()].sort(([a], [b]) => compareCodeUnits(a, b)).map(([, claim]) => [claim]));
|
|
126
|
+
return groups.map(rows => {
|
|
127
|
+
const canonical_finding_id = canonicalQuestionFindingId(rows.map(row => questionClaimKey(row.answerId, row.source.finding_id)));
|
|
128
|
+
return { answerIds: rows.map(row => row.answerId), row: {
|
|
129
|
+
canonical_finding_id, kind: rows[0].source.kind, actionable: rows.every(row => row.actionable),
|
|
130
|
+
question_ids: uniqueSorted(rows.map(row => row.source.question_id)),
|
|
131
|
+
sources: rows.map(row => row.source),
|
|
132
|
+
} };
|
|
133
|
+
}).sort((a, b) => compareCodeUnits(a.row.canonical_finding_id, b.row.canonical_finding_id));
|
|
134
|
+
}
|
|
135
|
+
/** Deterministic projection only: never update an accepted answer or infer a review from runtime output. */
|
|
136
|
+
export function buildQuestionAuditFindingsReport(input) {
|
|
137
|
+
const acceptedById = new Map();
|
|
138
|
+
for (const row of input.accepted) {
|
|
139
|
+
const id = row.submission.submission_id;
|
|
140
|
+
const prior = acceptedById.get(id);
|
|
141
|
+
if (prior && stableStringify(prior.submission) !== stableStringify(row.submission)) {
|
|
142
|
+
throw new Error(`Conflicting content for accepted submission ${id}.`);
|
|
143
|
+
}
|
|
144
|
+
if (!prior)
|
|
145
|
+
acceptedById.set(id, row);
|
|
146
|
+
}
|
|
147
|
+
const accepted = [...acceptedById.values()].sort((a, b) => compareCodeUnits(a.submission.submission_id, b.submission.submission_id));
|
|
148
|
+
const adjudications = [...input.adjudications ?? []];
|
|
149
|
+
const evidence = new Map(input.evidence.map(record => [record.evidence_id, record]));
|
|
150
|
+
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)));
|
|
151
|
+
const consolidations = [...input.consolidations ?? []];
|
|
152
|
+
const groups = groupClaims(projected.flatMap(item => item.claims), consolidations, acceptedById);
|
|
153
|
+
const questions = projected.map(({ row }) => ({
|
|
154
|
+
...row, finding_ids: groups.filter(group => group.row.question_ids.includes(row.question_id)).map(group => group.row.canonical_finding_id),
|
|
155
|
+
}));
|
|
156
|
+
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)));
|
|
157
|
+
const work = buildWorkBlockPartition({ findings });
|
|
158
|
+
const counts = (key) => Object.fromEntries(uniqueSorted(findings.map(finding => finding[key])).map(value => [value, findings.filter(finding => finding[key] === value).length]));
|
|
159
|
+
const unmapped = input.plan.inventory.some(item => item.scope === "in_scope" &&
|
|
160
|
+
!input.plan.questions.some(question => question.inventory_item_ids.includes(item.inventory_item_id)));
|
|
161
|
+
const completion = questions.length === 0 || unmapped || input.plan.omissions.length > 0 ||
|
|
162
|
+
questions.some(row => row.state !== "clean" && row.state !== "findings") ? "incomplete" : "complete";
|
|
163
|
+
const question_review = {
|
|
164
|
+
schema_version: REVIEW_QUESTION_CONTRACT_VERSION, snapshot_id: input.plan.snapshot_id,
|
|
165
|
+
completion, questions, findings: groups.map(({ row }) => row), consolidations, adjudications, accepted,
|
|
166
|
+
inventory: input.plan.inventory, omissions: input.plan.omissions, lens_decisions: input.plan.lens_decisions,
|
|
167
|
+
evidence: [...input.evidence],
|
|
168
|
+
};
|
|
169
|
+
const currentAnswerIds = new Set(questions.flatMap(row => row.accepted_answer_ids));
|
|
170
|
+
return {
|
|
171
|
+
contract_version: QUESTION_AUDIT_FINDINGS_CONTRACT_VERSION, audit_read: input.auditRead, question_review,
|
|
172
|
+
findings, coherence_trace: work.coherence_trace, work_blocks: work.blocks, work_block_seams: work.seams,
|
|
173
|
+
summary: {
|
|
174
|
+
finding_count: findings.length, work_block_count: work.blocks.length,
|
|
175
|
+
severity_breakdown: counts("severity"), lens_breakdown: counts("lens"),
|
|
176
|
+
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,
|
|
177
|
+
excluded_file_count: new Set(input.plan.inventory.filter(item => item.scope === "excluded")
|
|
178
|
+
.flatMap(item => item.source_refs.map(ref => ref.path))).size,
|
|
179
|
+
runtime_validation_status_breakdown: {},
|
|
180
|
+
},
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
//# 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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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
|
|
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,O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AAS,qBAAqB,EAAE,CAAC;IAC7D;;;OAGG;IACH,sBAAsB,CAAC,EAAE,SAAS,uBAAuB,EAAE,CAAC;CAC7D;AA+TD,wBAAgB,kCAAkC,CAChD,MAAM,EAAE,qBAAqB,EAC7B,YAAY,EAAE,4BAA4B,GAAG,SAAS,GACrD,OAAO,CAOT;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
|
-
".
|
|
596
|
-
|
|
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
|
-
|
|
742
|
-
|
|
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
|
-
//
|
|
758
|
-
//
|
|
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
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
882
|
+
return {
|
|
883
|
+
...adjudication,
|
|
884
|
+
final_finding_shares: resolvedFinalFindingShares,
|
|
885
|
+
candidate_dispositions: resolvedCandidateDispositions,
|
|
886
|
+
};
|
|
853
887
|
}
|
|
854
|
-
function renderConceptualAttributionSection(report,
|
|
855
|
-
if (!
|
|
888
|
+
function renderConceptualAttributionSection(report, accepted, idSource) {
|
|
889
|
+
if (!accepted)
|
|
856
890
|
return [];
|
|
857
|
-
canonicalizeConceptualAttributionIds(report,
|
|
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(
|
|
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
|