audit-tools 0.55.20 → 0.56.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.
- package/dist/audit/cli/auditStep.d.ts.map +1 -1
- package/dist/audit/cli/auditStep.js +6 -8
- package/dist/audit/cli/auditStep.js.map +1 -1
- package/dist/audit/cli/charterExtractionPrompt.d.ts +2 -4
- package/dist/audit/cli/charterExtractionPrompt.d.ts.map +1 -1
- package/dist/audit/cli/charterExtractionPrompt.js +15 -0
- package/dist/audit/cli/charterExtractionPrompt.js.map +1 -1
- package/dist/audit/cli/cleanup.js +2 -2
- package/dist/audit/cli/cleanup.js.map +1 -1
- package/dist/audit/cli/cleanupCommand.d.ts.map +1 -1
- package/dist/audit/cli/cleanupCommand.js +11 -10
- package/dist/audit/cli/cleanupCommand.js.map +1 -1
- package/dist/audit/cli/conceptualDispatch.d.ts.map +1 -1
- package/dist/audit/cli/conceptualDispatch.js +26 -20
- package/dist/audit/cli/conceptualDispatch.js.map +1 -1
- package/dist/audit/cli/confirmIntentStep.d.ts.map +1 -1
- package/dist/audit/cli/confirmIntentStep.js +3 -5
- package/dist/audit/cli/confirmIntentStep.js.map +1 -1
- package/dist/audit/cli/dispatch/hostHandoff.d.ts.map +1 -1
- package/dist/audit/cli/dispatch/hostHandoff.js +46 -68
- package/dist/audit/cli/dispatch/hostHandoff.js.map +1 -1
- package/dist/audit/cli/explainTaskCommand.d.ts.map +1 -1
- package/dist/audit/cli/explainTaskCommand.js +3 -2
- package/dist/audit/cli/explainTaskCommand.js.map +1 -1
- package/dist/audit/cli/fanoutLanes.d.ts.map +1 -1
- package/dist/audit/cli/fanoutLanes.js +7 -6
- package/dist/audit/cli/fanoutLanes.js.map +1 -1
- package/dist/audit/cli/laneSubmissions.d.ts +0 -13
- package/dist/audit/cli/laneSubmissions.d.ts.map +1 -1
- package/dist/audit/cli/laneSubmissions.js +28 -19
- package/dist/audit/cli/laneSubmissions.js.map +1 -1
- package/dist/audit/cli/laneValidators.d.ts +7 -1
- package/dist/audit/cli/laneValidators.d.ts.map +1 -1
- package/dist/audit/cli/laneValidators.js +15 -10
- package/dist/audit/cli/laneValidators.js.map +1 -1
- package/dist/audit/cli/lineIndex.d.ts.map +1 -1
- package/dist/audit/cli/lineIndex.js +4 -3
- package/dist/audit/cli/lineIndex.js.map +1 -1
- package/dist/audit/cli/nextStepCommand.d.ts.map +1 -1
- package/dist/audit/cli/nextStepCommand.js +6 -7
- package/dist/audit/cli/nextStepCommand.js.map +1 -1
- package/dist/audit/cli/nextStepHelpers.d.ts +29 -17
- package/dist/audit/cli/nextStepHelpers.d.ts.map +1 -1
- package/dist/audit/cli/nextStepHelpers.js +75 -130
- package/dist/audit/cli/nextStepHelpers.js.map +1 -1
- package/dist/audit/cli/recoverSubmissionCommand.d.ts.map +1 -1
- package/dist/audit/cli/recoverSubmissionCommand.js +5 -4
- package/dist/audit/cli/recoverSubmissionCommand.js.map +1 -1
- package/dist/audit/cli/resynthesizeCommand.d.ts.map +1 -1
- package/dist/audit/cli/resynthesizeCommand.js +3 -1
- package/dist/audit/cli/resynthesizeCommand.js.map +1 -1
- package/dist/audit/cli/reviewRun.d.ts +0 -6
- package/dist/audit/cli/reviewRun.d.ts.map +1 -1
- package/dist/audit/cli/reviewRun.js +11 -18
- package/dist/audit/cli/reviewRun.js.map +1 -1
- package/dist/audit/cli/reviewSubmission.d.ts.map +1 -1
- package/dist/audit/cli/reviewSubmission.js +16 -8
- package/dist/audit/cli/reviewSubmission.js.map +1 -1
- package/dist/audit/cli/semanticReviewStep.d.ts +5 -5
- package/dist/audit/cli/semanticReviewStep.d.ts.map +1 -1
- package/dist/audit/cli/semanticReviewStep.js +5 -0
- package/dist/audit/cli/semanticReviewStep.js.map +1 -1
- package/dist/audit/cli/statusCommand.d.ts.map +1 -1
- package/dist/audit/cli/statusCommand.js +3 -2
- package/dist/audit/cli/statusCommand.js.map +1 -1
- package/dist/audit/cli/steps.d.ts +11 -11
- package/dist/audit/cli/steps.d.ts.map +1 -1
- package/dist/audit/cli/steps.js +11 -11
- package/dist/audit/cli/steps.js.map +1 -1
- package/dist/audit/cli/submitCommand.d.ts.map +1 -1
- package/dist/audit/cli/submitCommand.js +9 -4
- package/dist/audit/cli/submitCommand.js.map +1 -1
- package/dist/audit/cli/submitGateResult.d.ts.map +1 -1
- package/dist/audit/cli/submitGateResult.js +2 -1
- package/dist/audit/cli/submitGateResult.js.map +1 -1
- package/dist/audit/cli/unacceptResultsCommand.d.ts +3 -2
- package/dist/audit/cli/unacceptResultsCommand.d.ts.map +1 -1
- package/dist/audit/cli/unacceptResultsCommand.js +8 -6
- package/dist/audit/cli/unacceptResultsCommand.js.map +1 -1
- package/dist/audit/cli/validateResultsCommand.d.ts.map +1 -1
- package/dist/audit/cli/validateResultsCommand.js +5 -4
- package/dist/audit/cli/validateResultsCommand.js.map +1 -1
- package/dist/audit/cli.d.ts +0 -2
- package/dist/audit/cli.d.ts.map +1 -1
- package/dist/audit/cli.js +2 -2
- package/dist/audit/cli.js.map +1 -1
- package/dist/audit/decompose/buildStructureDecomposition.d.ts.map +1 -1
- package/dist/audit/decompose/buildStructureDecomposition.js +5 -5
- package/dist/audit/decompose/buildStructureDecomposition.js.map +1 -1
- package/dist/audit/extractors/analyzers/merge.d.ts.map +1 -1
- package/dist/audit/extractors/analyzers/merge.js +4 -11
- package/dist/audit/extractors/analyzers/merge.js.map +1 -1
- package/dist/audit/extractors/analyzers/typescript.d.ts.map +1 -1
- package/dist/audit/extractors/analyzers/typescript.js +3 -14
- package/dist/audit/extractors/analyzers/typescript.js.map +1 -1
- package/dist/audit/extractors/browserExtension.d.ts.map +1 -1
- package/dist/audit/extractors/browserExtension.js +3 -2
- package/dist/audit/extractors/browserExtension.js.map +1 -1
- package/dist/audit/extractors/commentDecomposition.d.ts +1 -1
- package/dist/audit/extractors/commentDecomposition.d.ts.map +1 -1
- package/dist/audit/extractors/commentDecomposition.js +16 -33
- package/dist/audit/extractors/commentDecomposition.js.map +1 -1
- package/dist/audit/extractors/dataStateCoupling.d.ts +4 -0
- package/dist/audit/extractors/dataStateCoupling.d.ts.map +1 -1
- package/dist/audit/extractors/dataStateCoupling.js +26 -12
- package/dist/audit/extractors/dataStateCoupling.js.map +1 -1
- package/dist/audit/extractors/designAssessment.js +1 -1
- package/dist/audit/extractors/designAssessment.js.map +1 -1
- package/dist/audit/extractors/disposition.d.ts.map +1 -1
- package/dist/audit/extractors/disposition.js +24 -40
- package/dist/audit/extractors/disposition.js.map +1 -1
- package/dist/audit/extractors/docsDigest.js +1 -1
- package/dist/audit/extractors/docsDigest.js.map +1 -1
- package/dist/audit/extractors/flows.d.ts.map +1 -1
- package/dist/audit/extractors/flows.js +23 -19
- package/dist/audit/extractors/flows.js.map +1 -1
- package/dist/audit/extractors/fsIntake.d.ts.map +1 -1
- package/dist/audit/extractors/fsIntake.js +8 -5
- package/dist/audit/extractors/fsIntake.js.map +1 -1
- package/dist/audit/extractors/gitHistory.d.ts +6 -6
- package/dist/audit/extractors/gitHistory.d.ts.map +1 -1
- package/dist/audit/extractors/gitHistory.js +6 -6
- package/dist/audit/extractors/gitHistory.js.map +1 -1
- package/dist/audit/extractors/graph.d.ts +3 -1
- package/dist/audit/extractors/graph.d.ts.map +1 -1
- package/dist/audit/extractors/graph.js +15 -17
- package/dist/audit/extractors/graph.js.map +1 -1
- package/dist/audit/extractors/graphManifestEdges/packageJson.d.ts.map +1 -1
- package/dist/audit/extractors/graphManifestEdges/packageJson.js +23 -40
- package/dist/audit/extractors/graphManifestEdges/packageJson.js.map +1 -1
- package/dist/audit/extractors/graphPathUtils.d.ts +9 -0
- package/dist/audit/extractors/graphPathUtils.d.ts.map +1 -1
- package/dist/audit/extractors/graphPathUtils.js +35 -16
- package/dist/audit/extractors/graphPathUtils.js.map +1 -1
- package/dist/audit/extractors/graphRoutes.d.ts.map +1 -1
- package/dist/audit/extractors/graphRoutes.js +3 -7
- package/dist/audit/extractors/graphRoutes.js.map +1 -1
- package/dist/audit/extractors/graphSignals.d.ts.map +1 -1
- package/dist/audit/extractors/graphSignals.js +40 -29
- package/dist/audit/extractors/graphSignals.js.map +1 -1
- package/dist/audit/extractors/graphSuites.d.ts.map +1 -1
- package/dist/audit/extractors/graphSuites.js +4 -7
- package/dist/audit/extractors/graphSuites.js.map +1 -1
- package/dist/audit/extractors/graphTestSources.d.ts.map +1 -1
- package/dist/audit/extractors/graphTestSources.js +3 -10
- package/dist/audit/extractors/graphTestSources.js.map +1 -1
- package/dist/audit/extractors/pathPatterns.d.ts +4 -2
- package/dist/audit/extractors/pathPatterns.d.ts.map +1 -1
- package/dist/audit/extractors/pathPatterns.js +13 -21
- package/dist/audit/extractors/pathPatterns.js.map +1 -1
- package/dist/audit/extractors/risk.d.ts.map +1 -1
- package/dist/audit/extractors/risk.js +7 -7
- package/dist/audit/extractors/risk.js.map +1 -1
- package/dist/audit/extractors/surfaces.d.ts.map +1 -1
- package/dist/audit/extractors/surfaces.js +3 -9
- package/dist/audit/extractors/surfaces.js.map +1 -1
- package/dist/audit/io/artifacts.d.ts +1 -3
- package/dist/audit/io/artifacts.d.ts.map +1 -1
- package/dist/audit/io/artifacts.js +9 -9
- 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 +0 -1
- package/dist/audit/io/rollover.js.map +1 -1
- package/dist/audit/io/runArtifacts.d.ts +30 -2
- package/dist/audit/io/runArtifacts.d.ts.map +1 -1
- package/dist/audit/io/runArtifacts.js +23 -23
- package/dist/audit/io/runArtifacts.js.map +1 -1
- package/dist/audit/io/runSnapshot.js +2 -2
- package/dist/audit/io/runSnapshot.js.map +1 -1
- package/dist/audit/io/toolingManifest.d.ts.map +1 -1
- package/dist/audit/io/toolingManifest.js +7 -9
- package/dist/audit/io/toolingManifest.js.map +1 -1
- package/dist/audit/orchestrator/advance.d.ts +6 -0
- package/dist/audit/orchestrator/advance.d.ts.map +1 -1
- package/dist/audit/orchestrator/advance.js +70 -95
- package/dist/audit/orchestrator/advance.js.map +1 -1
- package/dist/audit/orchestrator/architectureDiscovery.d.ts +6 -2
- package/dist/audit/orchestrator/architectureDiscovery.d.ts.map +1 -1
- package/dist/audit/orchestrator/architectureDiscovery.js +19 -14
- package/dist/audit/orchestrator/architectureDiscovery.js.map +1 -1
- package/dist/audit/orchestrator/artifactMetadata.d.ts.map +1 -1
- package/dist/audit/orchestrator/artifactMetadata.js +12 -15
- package/dist/audit/orchestrator/artifactMetadata.js.map +1 -1
- package/dist/audit/orchestrator/auditTaskUtils.d.ts +13 -0
- package/dist/audit/orchestrator/auditTaskUtils.d.ts.map +1 -1
- package/dist/audit/orchestrator/auditTaskUtils.js +10 -3
- package/dist/audit/orchestrator/auditTaskUtils.js.map +1 -1
- package/dist/audit/orchestrator/autoFixExecutor.d.ts.map +1 -1
- package/dist/audit/orchestrator/autoFixExecutor.js +2 -8
- package/dist/audit/orchestrator/autoFixExecutor.js.map +1 -1
- package/dist/audit/orchestrator/charterClarificationExecutor.d.ts +4 -2
- package/dist/audit/orchestrator/charterClarificationExecutor.d.ts.map +1 -1
- package/dist/audit/orchestrator/charterClarificationExecutor.js +12 -20
- package/dist/audit/orchestrator/charterClarificationExecutor.js.map +1 -1
- package/dist/audit/orchestrator/charterComparisonExecutor.d.ts.map +1 -1
- package/dist/audit/orchestrator/charterComparisonExecutor.js +5 -9
- package/dist/audit/orchestrator/charterComparisonExecutor.js.map +1 -1
- package/dist/audit/orchestrator/charterExtractionExecutor.d.ts +5 -0
- package/dist/audit/orchestrator/charterExtractionExecutor.d.ts.map +1 -1
- package/dist/audit/orchestrator/charterExtractionExecutor.js +10 -5
- package/dist/audit/orchestrator/charterExtractionExecutor.js.map +1 -1
- package/dist/audit/orchestrator/charterFidelityPacket.d.ts.map +1 -1
- package/dist/audit/orchestrator/charterFidelityPacket.js +1 -2
- package/dist/audit/orchestrator/charterFidelityPacket.js.map +1 -1
- package/dist/audit/orchestrator/charterPacketArchive.d.ts.map +1 -1
- package/dist/audit/orchestrator/charterPacketArchive.js +11 -7
- package/dist/audit/orchestrator/charterPacketArchive.js.map +1 -1
- package/dist/audit/orchestrator/charterPackets.d.ts.map +1 -1
- package/dist/audit/orchestrator/charterPackets.js +30 -69
- package/dist/audit/orchestrator/charterPackets.js.map +1 -1
- package/dist/audit/orchestrator/dependencyMap.d.ts +0 -1
- package/dist/audit/orchestrator/dependencyMap.d.ts.map +1 -1
- package/dist/audit/orchestrator/dependencyMap.js +0 -7
- package/dist/audit/orchestrator/dependencyMap.js.map +1 -1
- package/dist/audit/orchestrator/dependencySlices.d.ts +20 -0
- package/dist/audit/orchestrator/dependencySlices.d.ts.map +1 -1
- package/dist/audit/orchestrator/dependencySlices.js +20 -20
- package/dist/audit/orchestrator/dependencySlices.js.map +1 -1
- package/dist/audit/orchestrator/designReviewProjection.d.ts +1 -3
- package/dist/audit/orchestrator/designReviewProjection.d.ts.map +1 -1
- package/dist/audit/orchestrator/designReviewProjection.js +8 -2
- package/dist/audit/orchestrator/designReviewProjection.js.map +1 -1
- package/dist/audit/orchestrator/designReviewPrompt.d.ts +2 -11
- package/dist/audit/orchestrator/designReviewPrompt.d.ts.map +1 -1
- package/dist/audit/orchestrator/designReviewPrompt.js +10 -25
- package/dist/audit/orchestrator/designReviewPrompt.js.map +1 -1
- package/dist/audit/orchestrator/designReviewSnapshot.d.ts.map +1 -1
- package/dist/audit/orchestrator/designReviewSnapshot.js +1 -2
- package/dist/audit/orchestrator/designReviewSnapshot.js.map +1 -1
- package/dist/audit/orchestrator/designReviewTask.d.ts.map +1 -1
- package/dist/audit/orchestrator/designReviewTask.js +2 -2
- package/dist/audit/orchestrator/designReviewTask.js.map +1 -1
- package/dist/audit/orchestrator/edgeReasoning.d.ts.map +1 -1
- package/dist/audit/orchestrator/edgeReasoning.js +1 -3
- package/dist/audit/orchestrator/edgeReasoning.js.map +1 -1
- package/dist/audit/orchestrator/executorResult.d.ts +3 -32
- package/dist/audit/orchestrator/executorResult.d.ts.map +1 -1
- package/dist/audit/orchestrator/executorRunners.d.ts.map +1 -1
- package/dist/audit/orchestrator/executorRunners.js +33 -43
- package/dist/audit/orchestrator/executorRunners.js.map +1 -1
- package/dist/audit/orchestrator/executors.d.ts +34 -0
- package/dist/audit/orchestrator/executors.d.ts.map +1 -1
- package/dist/audit/orchestrator/executors.js +19 -4
- package/dist/audit/orchestrator/executors.js.map +1 -1
- package/dist/audit/orchestrator/fileIntegrity.d.ts.map +1 -1
- package/dist/audit/orchestrator/fileIntegrity.js +4 -3
- package/dist/audit/orchestrator/fileIntegrity.js.map +1 -1
- package/dist/audit/orchestrator/flowPlanning.d.ts.map +1 -1
- package/dist/audit/orchestrator/flowPlanning.js +2 -2
- package/dist/audit/orchestrator/flowPlanning.js.map +1 -1
- package/dist/audit/orchestrator/flowRequeue.d.ts.map +1 -1
- package/dist/audit/orchestrator/flowRequeue.js +2 -3
- package/dist/audit/orchestrator/flowRequeue.js.map +1 -1
- package/dist/audit/orchestrator/graphEnrichmentExecutor.d.ts.map +1 -1
- package/dist/audit/orchestrator/graphEnrichmentExecutor.js +5 -18
- package/dist/audit/orchestrator/graphEnrichmentExecutor.js.map +1 -1
- package/dist/audit/orchestrator/hostInputPause.d.ts +4 -20
- package/dist/audit/orchestrator/hostInputPause.d.ts.map +1 -1
- package/dist/audit/orchestrator/hostInputPause.js +4 -3
- package/dist/audit/orchestrator/hostInputPause.js.map +1 -1
- package/dist/audit/orchestrator/ingestionExecutors.d.ts.map +1 -1
- package/dist/audit/orchestrator/ingestionExecutors.js +5 -17
- package/dist/audit/orchestrator/ingestionExecutors.js.map +1 -1
- package/dist/audit/orchestrator/intentCheckpointExecutor.d.ts +1 -2
- package/dist/audit/orchestrator/intentCheckpointExecutor.d.ts.map +1 -1
- package/dist/audit/orchestrator/intentCheckpointExecutor.js +42 -53
- package/dist/audit/orchestrator/intentCheckpointExecutor.js.map +1 -1
- package/dist/audit/orchestrator/intentCheckpointGate.d.ts +1 -1
- package/dist/audit/orchestrator/intentCheckpointGate.d.ts.map +1 -1
- package/dist/audit/orchestrator/intentCheckpointGate.js +12 -8
- package/dist/audit/orchestrator/intentCheckpointGate.js.map +1 -1
- package/dist/audit/orchestrator/intentEquivalenceExecutor.d.ts.map +1 -1
- package/dist/audit/orchestrator/intentEquivalenceExecutor.js +13 -22
- package/dist/audit/orchestrator/intentEquivalenceExecutor.js.map +1 -1
- package/dist/audit/orchestrator/lineCounts.d.ts +2 -0
- package/dist/audit/orchestrator/lineCounts.d.ts.map +1 -1
- package/dist/audit/orchestrator/lineCounts.js +4 -0
- package/dist/audit/orchestrator/lineCounts.js.map +1 -1
- package/dist/audit/orchestrator/obligationPolicy.d.ts.map +1 -1
- package/dist/audit/orchestrator/obligationPolicy.js +46 -48
- package/dist/audit/orchestrator/obligationPolicy.js.map +1 -1
- package/dist/audit/orchestrator/pendingTasks.d.ts.map +1 -1
- package/dist/audit/orchestrator/pendingTasks.js +4 -3
- package/dist/audit/orchestrator/pendingTasks.js.map +1 -1
- package/dist/audit/orchestrator/planningExecutors.d.ts.map +1 -1
- package/dist/audit/orchestrator/planningExecutors.js +5 -1
- package/dist/audit/orchestrator/planningExecutors.js.map +1 -1
- package/dist/audit/orchestrator/requeue.d.ts.map +1 -1
- package/dist/audit/orchestrator/requeue.js +2 -2
- package/dist/audit/orchestrator/requeue.js.map +1 -1
- package/dist/audit/orchestrator/requeueCommand.d.ts.map +1 -1
- package/dist/audit/orchestrator/requeueCommand.js +13 -21
- package/dist/audit/orchestrator/requeueCommand.js.map +1 -1
- package/dist/audit/orchestrator/resultIngestion.d.ts.map +1 -1
- package/dist/audit/orchestrator/resultIngestion.js +3 -4
- package/dist/audit/orchestrator/resultIngestion.js.map +1 -1
- package/dist/audit/orchestrator/reviewPacketGraphContext.js +1 -1
- package/dist/audit/orchestrator/reviewPacketGraphContext.js.map +1 -1
- package/dist/audit/orchestrator/reviewPacketGraphEdges.d.ts +2 -8
- package/dist/audit/orchestrator/reviewPacketGraphEdges.d.ts.map +1 -1
- package/dist/audit/orchestrator/reviewPacketGraphEdges.js +6 -38
- package/dist/audit/orchestrator/reviewPacketGraphEdges.js.map +1 -1
- package/dist/audit/orchestrator/reviewPacketMetrics.d.ts.map +1 -1
- package/dist/audit/orchestrator/reviewPacketMetrics.js +7 -68
- package/dist/audit/orchestrator/reviewPacketMetrics.js.map +1 -1
- package/dist/audit/orchestrator/reviewPacketShared.d.ts +0 -2
- package/dist/audit/orchestrator/reviewPacketShared.d.ts.map +1 -1
- package/dist/audit/orchestrator/reviewPacketShared.js.map +1 -1
- package/dist/audit/orchestrator/reviewPacketSizing.d.ts +1 -3
- package/dist/audit/orchestrator/reviewPacketSizing.d.ts.map +1 -1
- package/dist/audit/orchestrator/reviewPacketSizing.js +3 -13
- package/dist/audit/orchestrator/reviewPacketSizing.js.map +1 -1
- package/dist/audit/orchestrator/reviewPackets.d.ts +7 -8
- package/dist/audit/orchestrator/reviewPackets.d.ts.map +1 -1
- package/dist/audit/orchestrator/reviewPackets.js +17 -32
- package/dist/audit/orchestrator/reviewPackets.js.map +1 -1
- package/dist/audit/orchestrator/runtimeValidation.js +2 -2
- package/dist/audit/orchestrator/runtimeValidation.js.map +1 -1
- package/dist/audit/orchestrator/scope.d.ts.map +1 -1
- package/dist/audit/orchestrator/scope.js +3 -2
- package/dist/audit/orchestrator/scope.js.map +1 -1
- package/dist/audit/orchestrator/scopeIndexBaseline.d.ts.map +1 -1
- package/dist/audit/orchestrator/scopeIndexBaseline.js +1 -2
- package/dist/audit/orchestrator/scopeIndexBaseline.js.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/conflict.d.ts.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/conflict.js +2 -2
- package/dist/audit/orchestrator/selectiveDeepening/conflict.js.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/findingFollowup.d.ts +3 -5
- package/dist/audit/orchestrator/selectiveDeepening/findingFollowup.d.ts.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/findingFollowup.js +8 -6
- package/dist/audit/orchestrator/selectiveDeepening/findingFollowup.js.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/highRiskClean.d.ts.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/highRiskClean.js +15 -11
- package/dist/audit/orchestrator/selectiveDeepening/highRiskClean.js.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/index.d.ts +3 -3
- package/dist/audit/orchestrator/selectiveDeepening/index.d.ts.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/index.js +50 -77
- package/dist/audit/orchestrator/selectiveDeepening/index.js.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/lensVerification.d.ts.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/lensVerification.js +27 -18
- package/dist/audit/orchestrator/selectiveDeepening/lensVerification.js.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/runtimeValidation.d.ts +1 -2
- package/dist/audit/orchestrator/selectiveDeepening/runtimeValidation.d.ts.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/runtimeValidation.js +6 -3
- package/dist/audit/orchestrator/selectiveDeepening/runtimeValidation.js.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/shared.d.ts +12 -9
- package/dist/audit/orchestrator/selectiveDeepening/shared.d.ts.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/shared.js +15 -35
- package/dist/audit/orchestrator/selectiveDeepening/shared.js.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/stewardFollowup.d.ts.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/stewardFollowup.js +9 -16
- package/dist/audit/orchestrator/selectiveDeepening/stewardFollowup.js.map +1 -1
- package/dist/audit/orchestrator/staleness.d.ts.map +1 -1
- package/dist/audit/orchestrator/staleness.js +40 -36
- package/dist/audit/orchestrator/staleness.js.map +1 -1
- package/dist/audit/orchestrator/state.d.ts.map +1 -1
- package/dist/audit/orchestrator/state.js +16 -17
- package/dist/audit/orchestrator/state.js.map +1 -1
- package/dist/audit/orchestrator/structureExecutors.d.ts.map +1 -1
- package/dist/audit/orchestrator/structureExecutors.js +5 -4
- package/dist/audit/orchestrator/structureExecutors.js.map +1 -1
- package/dist/audit/orchestrator/taskAffinityGraph.d.ts.map +1 -1
- package/dist/audit/orchestrator/taskAffinityGraph.js +19 -15
- package/dist/audit/orchestrator/taskAffinityGraph.js.map +1 -1
- package/dist/audit/orchestrator/taskBuilder.d.ts.map +1 -1
- package/dist/audit/orchestrator/taskBuilder.js +2 -3
- package/dist/audit/orchestrator/taskBuilder.js.map +1 -1
- package/dist/audit/orchestrator/trivialAudit.d.ts.map +1 -1
- package/dist/audit/orchestrator/trivialAudit.js +2 -1
- package/dist/audit/orchestrator/trivialAudit.js.map +1 -1
- package/dist/audit/reporting/mergeFindings.d.ts.map +1 -1
- package/dist/audit/reporting/mergeFindings.js +6 -4
- package/dist/audit/reporting/mergeFindings.js.map +1 -1
- package/dist/audit/reporting/synthesis.d.ts.map +1 -1
- package/dist/audit/reporting/synthesis.js +5 -10
- package/dist/audit/reporting/synthesis.js.map +1 -1
- package/dist/audit/reporting/workBlocks.d.ts +0 -1
- package/dist/audit/reporting/workBlocks.d.ts.map +1 -1
- package/dist/audit/reporting/workBlocks.js +8 -15
- package/dist/audit/reporting/workBlocks.js.map +1 -1
- package/dist/audit/systemic/reviewFileMap.js +2 -2
- package/dist/audit/systemic/reviewFileMap.js.map +1 -1
- package/dist/audit/systemic/secondOrderAdversaryPrompt.d.ts.map +1 -1
- package/dist/audit/systemic/secondOrderAdversaryPrompt.js +2 -2
- package/dist/audit/systemic/secondOrderAdversaryPrompt.js.map +1 -1
- package/dist/audit/systemic/systemicChallengeLoop.js +3 -3
- package/dist/audit/systemic/systemicChallengeLoop.js.map +1 -1
- package/dist/audit/types/reviewPlanning.d.ts +10 -8
- package/dist/audit/types/reviewPlanning.d.ts.map +1 -1
- package/dist/audit/types/reviewPlanning.js +3 -1
- package/dist/audit/types/reviewPlanning.js.map +1 -1
- package/dist/remediate/contractPipeline/executionPlan.d.ts +3 -0
- package/dist/remediate/contractPipeline/executionPlan.d.ts.map +1 -1
- package/dist/remediate/contractPipeline/executionPlan.js +27 -22
- package/dist/remediate/contractPipeline/executionPlan.js.map +1 -1
- package/dist/remediate/contractPipeline/runtimePlanAuthority.d.ts +1 -0
- package/dist/remediate/contractPipeline/runtimePlanAuthority.d.ts.map +1 -1
- package/dist/remediate/contractPipeline/runtimePlanAuthority.js +4 -3
- package/dist/remediate/contractPipeline/runtimePlanAuthority.js.map +1 -1
- package/dist/remediate/dedup/crossLensDedup.d.ts +0 -2
- package/dist/remediate/dedup/crossLensDedup.d.ts.map +1 -1
- package/dist/remediate/dedup/crossLensDedup.js +1 -4
- package/dist/remediate/dedup/crossLensDedup.js.map +1 -1
- package/dist/remediate/droppedFindingsRecord.d.ts.map +1 -1
- package/dist/remediate/droppedFindingsRecord.js +3 -1
- package/dist/remediate/droppedFindingsRecord.js.map +1 -1
- package/dist/remediate/index.d.ts +2 -3
- package/dist/remediate/index.d.ts.map +1 -1
- package/dist/remediate/index.js +51 -27
- package/dist/remediate/index.js.map +1 -1
- package/dist/remediate/intake.d.ts +9 -8
- package/dist/remediate/intake.d.ts.map +1 -1
- package/dist/remediate/intake.js +9 -5
- package/dist/remediate/intake.js.map +1 -1
- package/dist/remediate/intakeSelection.js +3 -3
- package/dist/remediate/intakeSelection.js.map +1 -1
- package/dist/remediate/intent/intentOrdering.d.ts +10 -9
- package/dist/remediate/intent/intentOrdering.d.ts.map +1 -1
- package/dist/remediate/intent/intentOrdering.js +10 -9
- package/dist/remediate/intent/intentOrdering.js.map +1 -1
- package/dist/remediate/intent/intentPersistence.d.ts +1 -0
- package/dist/remediate/intent/intentPersistence.d.ts.map +1 -1
- package/dist/remediate/intent/intentPersistence.js +18 -10
- package/dist/remediate/intent/intentPersistence.js.map +1 -1
- package/dist/remediate/phases/close.d.ts +16 -15
- package/dist/remediate/phases/close.d.ts.map +1 -1
- package/dist/remediate/phases/close.js +172 -163
- package/dist/remediate/phases/close.js.map +1 -1
- package/dist/remediate/phases/closeVerifyAnalyzerLeads.js +1 -1
- package/dist/remediate/phases/closeVerifyAnalyzerLeads.js.map +1 -1
- package/dist/remediate/phases/closeVerifyHeadEvidence.d.ts.map +1 -1
- package/dist/remediate/phases/closeVerifyHeadEvidence.js +11 -11
- package/dist/remediate/phases/closeVerifyHeadEvidence.js.map +1 -1
- package/dist/remediate/phases/closeVerifyLandingGates.d.ts +6 -0
- package/dist/remediate/phases/closeVerifyLandingGates.d.ts.map +1 -1
- package/dist/remediate/phases/closeVerifyLandingGates.js +10 -6
- package/dist/remediate/phases/closeVerifyLandingGates.js.map +1 -1
- package/dist/remediate/phases/grounding.d.ts +1 -1
- package/dist/remediate/phases/grounding.d.ts.map +1 -1
- package/dist/remediate/phases/triage.d.ts.map +1 -1
- package/dist/remediate/phases/triage.js +19 -25
- package/dist/remediate/phases/triage.js.map +1 -1
- package/dist/remediate/phases/triageConformance.d.ts.map +1 -1
- package/dist/remediate/phases/triageConformance.js +11 -15
- package/dist/remediate/phases/triageConformance.js.map +1 -1
- package/dist/remediate/review/autonomousGate.d.ts +5 -5
- package/dist/remediate/review/autonomousGate.d.ts.map +1 -1
- package/dist/remediate/review/autonomousGate.js +5 -0
- package/dist/remediate/review/autonomousGate.js.map +1 -1
- package/dist/remediate/review/reviewGate.d.ts.map +1 -1
- package/dist/remediate/review/reviewGate.js +12 -11
- package/dist/remediate/review/reviewGate.js.map +1 -1
- package/dist/remediate/riskSignal.d.ts +0 -1
- package/dist/remediate/riskSignal.d.ts.map +1 -1
- package/dist/remediate/riskSignal.js.map +1 -1
- package/dist/remediate/state/decisionConsumption.d.ts +2 -0
- package/dist/remediate/state/decisionConsumption.d.ts.map +1 -1
- package/dist/remediate/state/decisionConsumption.js +12 -10
- package/dist/remediate/state/decisionConsumption.js.map +1 -1
- package/dist/remediate/state/itemStatus.d.ts +3 -3
- package/dist/remediate/state/itemStatus.js +5 -5
- package/dist/remediate/state/store.d.ts +4 -3
- package/dist/remediate/state/store.d.ts.map +1 -1
- package/dist/remediate/state/store.js +11 -24
- package/dist/remediate/state/store.js.map +1 -1
- package/dist/remediate/state/types.d.ts +2 -2
- package/dist/remediate/state/types.d.ts.map +1 -1
- package/dist/remediate/state/types.js +12 -14
- package/dist/remediate/state/types.js.map +1 -1
- package/dist/remediate/steps/clarificationResolution.d.ts.map +1 -1
- package/dist/remediate/steps/clarificationResolution.js +4 -2
- package/dist/remediate/steps/clarificationResolution.js.map +1 -1
- package/dist/remediate/steps/contractPipeline.d.ts.map +1 -1
- package/dist/remediate/steps/contractPipeline.js +26 -23
- package/dist/remediate/steps/contractPipeline.js.map +1 -1
- package/dist/remediate/steps/contractPipelinePrompts.d.ts +1 -1
- package/dist/remediate/steps/contractPipelinePrompts.d.ts.map +1 -1
- package/dist/remediate/steps/contractPipelinePrompts.js +3 -2
- package/dist/remediate/steps/contractPipelinePrompts.js.map +1 -1
- package/dist/remediate/steps/dispatch/contractConformanceReview.d.ts +8 -3
- package/dist/remediate/steps/dispatch/contractConformanceReview.d.ts.map +1 -1
- package/dist/remediate/steps/dispatch/contractConformanceReview.js +15 -12
- package/dist/remediate/steps/dispatch/contractConformanceReview.js.map +1 -1
- package/dist/remediate/steps/dispatch/hostContracts.d.ts +2 -0
- package/dist/remediate/steps/dispatch/hostContracts.d.ts.map +1 -1
- package/dist/remediate/steps/dispatch/hostContracts.js +6 -3
- package/dist/remediate/steps/dispatch/hostContracts.js.map +1 -1
- package/dist/remediate/steps/dispatch/hostCorroboration.d.ts +11 -12
- package/dist/remediate/steps/dispatch/hostCorroboration.d.ts.map +1 -1
- package/dist/remediate/steps/dispatch/hostCorroboration.js +13 -6
- package/dist/remediate/steps/dispatch/hostCorroboration.js.map +1 -1
- package/dist/remediate/steps/dispatch/hostHandoff.d.ts +5 -7
- package/dist/remediate/steps/dispatch/hostHandoff.d.ts.map +1 -1
- package/dist/remediate/steps/dispatch/hostHandoff.js +162 -265
- package/dist/remediate/steps/dispatch/hostHandoff.js.map +1 -1
- package/dist/remediate/steps/dispatch/requiredTests.d.ts +18 -0
- package/dist/remediate/steps/dispatch/requiredTests.d.ts.map +1 -1
- package/dist/remediate/steps/dispatch/requiredTests.js +9 -11
- package/dist/remediate/steps/dispatch/requiredTests.js.map +1 -1
- package/dist/remediate/steps/finalGate.d.ts +1 -1
- package/dist/remediate/steps/finalGate.d.ts.map +1 -1
- package/dist/remediate/steps/finalGate.js +12 -12
- package/dist/remediate/steps/finalGate.js.map +1 -1
- package/dist/remediate/steps/frictionCloseout.d.ts.map +1 -1
- package/dist/remediate/steps/frictionCloseout.js +0 -1
- package/dist/remediate/steps/frictionCloseout.js.map +1 -1
- package/dist/remediate/steps/gateCommands.d.ts +5 -10
- package/dist/remediate/steps/gateCommands.d.ts.map +1 -1
- package/dist/remediate/steps/gateCommands.js +8 -12
- package/dist/remediate/steps/gateCommands.js.map +1 -1
- package/dist/remediate/steps/intakeResolver.d.ts +5 -7
- package/dist/remediate/steps/intakeResolver.d.ts.map +1 -1
- package/dist/remediate/steps/intakeResolver.js +30 -33
- package/dist/remediate/steps/intakeResolver.js.map +1 -1
- package/dist/remediate/steps/nextStep.d.ts +1 -1
- package/dist/remediate/steps/nextStep.d.ts.map +1 -1
- package/dist/remediate/steps/nextStep.js +134 -158
- package/dist/remediate/steps/nextStep.js.map +1 -1
- package/dist/remediate/steps/prompts.d.ts +4 -30
- package/dist/remediate/steps/prompts.d.ts.map +1 -1
- package/dist/remediate/steps/prompts.js +5 -114
- package/dist/remediate/steps/prompts.js.map +1 -1
- package/dist/remediate/steps/recoverIngest.d.ts +5 -13
- package/dist/remediate/steps/recoverIngest.d.ts.map +1 -1
- package/dist/remediate/steps/recoverIngest.js +20 -26
- package/dist/remediate/steps/recoverIngest.js.map +1 -1
- package/dist/remediate/steps/stepWriter.d.ts +5 -4
- package/dist/remediate/steps/stepWriter.d.ts.map +1 -1
- package/dist/remediate/steps/stepWriter.js +8 -5
- package/dist/remediate/steps/stepWriter.js.map +1 -1
- package/dist/remediate/steps/submitGateResult.d.ts +0 -5
- package/dist/remediate/steps/submitGateResult.d.ts.map +1 -1
- package/dist/remediate/steps/submitGateResult.js +8 -8
- package/dist/remediate/steps/submitGateResult.js.map +1 -1
- package/dist/remediate/steps/types.d.ts +1 -1
- package/dist/remediate/steps/types.d.ts.map +1 -1
- package/dist/remediate/steps/types.js +0 -1
- package/dist/remediate/steps/types.js.map +1 -1
- package/dist/remediate/validation/artifacts.d.ts.map +1 -1
- package/dist/remediate/validation/artifacts.js +11 -9
- package/dist/remediate/validation/artifacts.js.map +1 -1
- package/dist/remediate/validation/remediationState.d.ts +0 -2
- package/dist/remediate/validation/remediationState.d.ts.map +1 -1
- package/dist/remediate/validation/remediationState.js +9 -46
- package/dist/remediate/validation/remediationState.js.map +1 -1
- package/dist/shared/accessMemory.d.ts +3 -9
- package/dist/shared/accessMemory.d.ts.map +1 -1
- package/dist/shared/accessMemory.js +2 -4
- package/dist/shared/accessMemory.js.map +1 -1
- package/dist/shared/affinityArtifacts.d.ts.map +1 -1
- package/dist/shared/affinityArtifacts.js +5 -7
- package/dist/shared/affinityArtifacts.js.map +1 -1
- package/dist/shared/agentReflections.d.ts.map +1 -1
- package/dist/shared/agentReflections.js +11 -14
- package/dist/shared/agentReflections.js.map +1 -1
- package/dist/shared/analyzers/binaryAcquisition.d.ts.map +1 -1
- package/dist/shared/analyzers/binaryAcquisition.js +2 -1
- package/dist/shared/analyzers/binaryAcquisition.js.map +1 -1
- package/dist/shared/analyzers/candidates.js +1 -1
- package/dist/shared/analyzers/candidates.js.map +1 -1
- package/dist/shared/analyzers/clippy.d.ts +2 -25
- package/dist/shared/analyzers/clippy.d.ts.map +1 -1
- package/dist/shared/analyzers/clippy.js +1 -17
- package/dist/shared/analyzers/clippy.js.map +1 -1
- package/dist/shared/analyzers/normalizeExternal.d.ts +0 -15
- package/dist/shared/analyzers/normalizeExternal.d.ts.map +1 -1
- package/dist/shared/analyzers/normalizeExternal.js +2 -1
- package/dist/shared/analyzers/normalizeExternal.js.map +1 -1
- package/dist/shared/analyzers/rubocop.d.ts +1 -19
- package/dist/shared/analyzers/rubocop.d.ts.map +1 -1
- package/dist/shared/analyzers/rubocop.js +0 -23
- package/dist/shared/analyzers/rubocop.js.map +1 -1
- package/dist/shared/artifactFreshness.d.ts.map +1 -1
- package/dist/shared/artifactFreshness.js +4 -6
- package/dist/shared/artifactFreshness.js.map +1 -1
- package/dist/shared/chunkByBudget.d.ts +1 -24
- package/dist/shared/chunkByBudget.d.ts.map +1 -1
- package/dist/shared/chunkByBudget.js +2 -13
- package/dist/shared/chunkByBudget.js.map +1 -1
- package/dist/shared/compareCodeUnits.d.ts +2 -0
- package/dist/shared/compareCodeUnits.d.ts.map +1 -1
- package/dist/shared/compareCodeUnits.js +5 -0
- package/dist/shared/compareCodeUnits.js.map +1 -1
- package/dist/shared/contentKey.d.ts.map +1 -1
- package/dist/shared/contentKey.js +3 -1
- package/dist/shared/contentKey.js.map +1 -1
- package/dist/shared/countBy.d.ts.map +1 -1
- package/dist/shared/countBy.js +4 -3
- package/dist/shared/countBy.js.map +1 -1
- package/dist/shared/decompose/charterExtraction.d.ts.map +1 -1
- package/dist/shared/decompose/charterExtraction.js +11 -20
- package/dist/shared/decompose/charterExtraction.js.map +1 -1
- package/dist/shared/decompose/consensus.d.ts.map +1 -1
- package/dist/shared/decompose/consensus.js +4 -12
- package/dist/shared/decompose/consensus.js.map +1 -1
- package/dist/shared/decompose/contentCoherence.d.ts.map +1 -1
- package/dist/shared/decompose/contentCoherence.js +12 -15
- package/dist/shared/decompose/contentCoherence.js.map +1 -1
- package/dist/shared/decompose/modularity.d.ts.map +1 -1
- package/dist/shared/decompose/modularity.js +7 -19
- package/dist/shared/decompose/modularity.js.map +1 -1
- package/dist/shared/decompose/systemicChallenge.d.ts +8 -0
- package/dist/shared/decompose/systemicChallenge.d.ts.map +1 -1
- package/dist/shared/decompose/systemicChallenge.js +8 -8
- package/dist/shared/decompose/systemicChallenge.js.map +1 -1
- package/dist/shared/findingIdentitySignature.d.ts +6 -1
- package/dist/shared/findingIdentitySignature.d.ts.map +1 -1
- package/dist/shared/findingIdentitySignature.js +8 -6
- package/dist/shared/findingIdentitySignature.js.map +1 -1
- package/dist/shared/findingSimilarity.d.ts.map +1 -1
- package/dist/shared/findingSimilarity.js +9 -14
- package/dist/shared/findingSimilarity.js.map +1 -1
- package/dist/shared/findings/dedupe.d.ts.map +1 -1
- package/dist/shared/findings/dedupe.js +1 -10
- package/dist/shared/findings/dedupe.js.map +1 -1
- package/dist/shared/friction/captureFrictionEvent.d.ts +1 -1
- package/dist/shared/friction/captureFrictionEvent.d.ts.map +1 -1
- package/dist/shared/friction/frictionRecord.d.ts.map +1 -1
- package/dist/shared/friction/frictionRecord.js +3 -2
- package/dist/shared/friction/frictionRecord.js.map +1 -1
- package/dist/shared/friction/stepBoundaryCapture.d.ts +1 -2
- package/dist/shared/friction/stepBoundaryCapture.d.ts.map +1 -1
- package/dist/shared/friction/stepBoundaryCapture.js.map +1 -1
- package/dist/shared/friction/triage.d.ts.map +1 -1
- package/dist/shared/friction/triage.js +4 -3
- package/dist/shared/friction/triage.js.map +1 -1
- package/dist/shared/git.d.ts +2 -10
- package/dist/shared/git.d.ts.map +1 -1
- package/dist/shared/git.js +6 -17
- package/dist/shared/git.js.map +1 -1
- package/dist/shared/graph/graphPaths.d.ts +2 -5
- package/dist/shared/graph/graphPaths.d.ts.map +1 -1
- package/dist/shared/graph/graphPaths.js +5 -6
- package/dist/shared/graph/graphPaths.js.map +1 -1
- package/dist/shared/index.d.ts +41 -61
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +25 -7
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/intent/pathScope.d.ts +5 -0
- package/dist/shared/intent/pathScope.d.ts.map +1 -1
- package/dist/shared/intent/pathScope.js +17 -8
- package/dist/shared/intent/pathScope.js.map +1 -1
- package/dist/shared/io/auditToolsPaths.d.ts +9 -16
- package/dist/shared/io/auditToolsPaths.d.ts.map +1 -1
- package/dist/shared/io/auditToolsPaths.js +9 -18
- package/dist/shared/io/auditToolsPaths.js.map +1 -1
- package/dist/shared/io/frictionCapture.d.ts.map +1 -1
- package/dist/shared/io/frictionCapture.js +3 -2
- package/dist/shared/io/frictionCapture.js.map +1 -1
- package/dist/shared/io/stepContractWriter.d.ts.map +1 -1
- package/dist/shared/io/stepContractWriter.js +10 -8
- package/dist/shared/io/stepContractWriter.js.map +1 -1
- package/dist/shared/mcp/submitServer.d.ts.map +1 -1
- package/dist/shared/mcp/submitServer.js +21 -29
- package/dist/shared/mcp/submitServer.js.map +1 -1
- package/dist/shared/observability/rootLogObservations.d.ts.map +1 -1
- package/dist/shared/observability/rootLogObservations.js +3 -2
- package/dist/shared/observability/rootLogObservations.js.map +1 -1
- package/dist/shared/parsing/toml.d.ts.map +1 -1
- package/dist/shared/parsing/toml.js +3 -4
- package/dist/shared/parsing/toml.js.map +1 -1
- package/dist/shared/reporting/auditDeliverable.d.ts.map +1 -1
- package/dist/shared/reporting/auditDeliverable.js +6 -15
- package/dist/shared/reporting/auditDeliverable.js.map +1 -1
- package/dist/shared/reporting/lensCoverage.d.ts.map +1 -1
- package/dist/shared/reporting/lensCoverage.js +4 -5
- package/dist/shared/reporting/lensCoverage.js.map +1 -1
- package/dist/shared/reporting/markdown.d.ts +3 -0
- package/dist/shared/reporting/markdown.d.ts.map +1 -0
- package/dist/shared/reporting/markdown.js +6 -0
- package/dist/shared/reporting/markdown.js.map +1 -0
- package/dist/shared/sessionConfig.d.ts.map +1 -1
- package/dist/shared/sessionConfig.js +3 -7
- package/dist/shared/sessionConfig.js.map +1 -1
- package/dist/shared/submission/handRecovery.d.ts.map +1 -1
- package/dist/shared/submission/handRecovery.js +3 -2
- package/dist/shared/submission/handRecovery.js.map +1 -1
- package/dist/shared/submission/hostResultOutcomes.d.ts +1 -1
- package/dist/shared/submission/hostResultOutcomes.js +2 -2
- package/dist/shared/submission/hostResultOutcomes.js.map +1 -1
- package/dist/shared/submission/submissionClassifier.d.ts.map +1 -1
- package/dist/shared/submission/submissionClassifier.js +4 -3
- package/dist/shared/submission/submissionClassifier.js.map +1 -1
- package/dist/shared/submission/submissionIdentity.d.ts.map +1 -1
- package/dist/shared/submission/submissionIdentity.js +3 -1
- package/dist/shared/submission/submissionIdentity.js.map +1 -1
- package/dist/shared/submission/submissionLedger.d.ts +1 -0
- package/dist/shared/submission/submissionLedger.d.ts.map +1 -1
- package/dist/shared/submission/submissionLedger.js +9 -5
- package/dist/shared/submission/submissionLedger.js.map +1 -1
- package/dist/shared/tooling/allowlistedExec.d.ts.map +1 -1
- package/dist/shared/tooling/allowlistedExec.js +35 -67
- package/dist/shared/tooling/allowlistedExec.js.map +1 -1
- package/dist/shared/tooling/analyzerDeps.d.ts.map +1 -1
- package/dist/shared/tooling/analyzerDeps.js +2 -1
- package/dist/shared/tooling/analyzerDeps.js.map +1 -1
- package/dist/shared/tooling/exec.d.ts +1 -1
- package/dist/shared/tooling/exec.d.ts.map +1 -1
- package/dist/shared/tooling/exec.js +3 -2
- package/dist/shared/tooling/exec.js.map +1 -1
- package/dist/shared/tooling/landingGates.d.ts +3 -3
- package/dist/shared/tooling/landingGates.js +3 -3
- package/dist/shared/tooling/ownedProcessLifecycle.d.ts +0 -1
- package/dist/shared/tooling/ownedProcessLifecycle.d.ts.map +1 -1
- package/dist/shared/tooling/ownedProcessLifecycle.js +1 -1
- package/dist/shared/tooling/ownedProcessLifecycle.js.map +1 -1
- package/dist/shared/tooling/projectTestAdmission.d.ts +7 -12
- package/dist/shared/tooling/projectTestAdmission.d.ts.map +1 -1
- package/dist/shared/tooling/projectTestAdmission.js.map +1 -1
- package/dist/shared/tooling/testCommand.d.ts +0 -14
- package/dist/shared/tooling/testCommand.d.ts.map +1 -1
- package/dist/shared/tooling/testCommand.js +2 -3
- package/dist/shared/tooling/testCommand.js.map +1 -1
- package/dist/shared/tooling/windowsOwnedJob.d.ts +2 -1
- package/dist/shared/tooling/windowsOwnedJob.d.ts.map +1 -1
- package/dist/shared/types/accessMemory.d.ts +3 -19
- package/dist/shared/types/accessMemory.d.ts.map +1 -1
- package/dist/shared/types/accessMemory.js +3 -19
- package/dist/shared/types/accessMemory.js.map +1 -1
- package/dist/shared/types/intentCheckpoint.d.ts.map +1 -1
- package/dist/shared/types/intentCheckpoint.js +2 -1
- package/dist/shared/types/intentCheckpoint.js.map +1 -1
- package/dist/shared/types/lens.d.ts +5 -0
- package/dist/shared/types/lens.d.ts.map +1 -1
- package/dist/shared/types/lens.js +13 -0
- package/dist/shared/types/lens.js.map +1 -1
- package/dist/shared/types/remediationOutcome.d.ts +10 -0
- package/dist/shared/types/remediationOutcome.d.ts.map +1 -1
- package/dist/shared/types/remediationOutcome.js +3 -0
- package/dist/shared/types/remediationOutcome.js.map +1 -1
- package/dist/shared/validation/contractConstructionSites.d.ts.map +1 -1
- package/dist/shared/validation/contractConstructionSites.js +2 -1
- package/dist/shared/validation/contractConstructionSites.js.map +1 -1
- package/dist/shared/validation/findingGrounding.d.ts +2 -1
- package/dist/shared/validation/findingGrounding.d.ts.map +1 -1
- package/dist/shared/validation/findingGrounding.js +9 -5
- package/dist/shared/validation/findingGrounding.js.map +1 -1
- package/dist/shared/validation/findingsReport.d.ts +6 -0
- package/dist/shared/validation/findingsReport.d.ts.map +1 -1
- package/dist/shared/validation/findingsReport.js +29 -19
- package/dist/shared/validation/findingsReport.js.map +1 -1
- package/docs/audit-pkg/contracts.md +73 -6
- package/docs/audit-pkg/operator-guide.md +10 -2
- package/docs/audit-pkg/product.md +1 -1
- package/package.json +1 -3
- package/remediate-code.mjs +13 -5
- package/scripts/audit/postinstall.mjs +6 -21
- package/scripts/remediate/postinstall.mjs +2 -17
- package/scripts/shared/install-host-assets.mjs +11 -3
- package/scripts/shared/primitives.mjs +14 -3
- package/wrapper/audit-code-wrapper-build.mjs +21 -18
- package/wrapper/audit-code-wrapper-install-hosts.mjs +6 -120
- package/wrapper/audit-code-wrapper-lib.mjs +28 -42
- package/wrapper/audit-code-wrapper-opencode.mjs +11 -24
- package/wrapper/installer-verb-help.mjs +21 -8
- package/wrapper/remediate-code-wrapper-install-hosts.mjs +15 -130
- package/wrapper/remediate-code-wrapper-opencode.mjs +11 -24
- package/wrapper/repo-root.mjs +2 -2
- package/wrapper/shared-install-hosts.mjs +119 -0
- package/wrapper/shared-project-opencode.mjs +22 -0
- package/dist/audit/io/runArtifactTypes.d.ts +0 -8
- package/dist/audit/io/runArtifactTypes.d.ts.map +0 -1
- package/dist/audit/io/runArtifactTypes.js +0 -2
- package/dist/audit/io/runArtifactTypes.js.map +0 -1
- package/dist/audit/orchestrator/accessMemory.d.ts +0 -35
- package/dist/audit/orchestrator/accessMemory.d.ts.map +0 -1
- package/dist/audit/orchestrator/accessMemory.js +0 -54
- package/dist/audit/orchestrator/accessMemory.js.map +0 -1
- package/dist/audit/orchestrator/reviewPacketGraph.d.ts +0 -4
- package/dist/audit/orchestrator/reviewPacketGraph.d.ts.map +0 -1
- package/dist/audit/orchestrator/reviewPacketGraph.js +0 -7
- package/dist/audit/orchestrator/reviewPacketGraph.js.map +0 -1
- package/dist/shared/continuityScore.d.ts +0 -13
- package/dist/shared/continuityScore.d.ts.map +0 -1
- package/dist/shared/continuityScore.js +0 -164
- package/dist/shared/continuityScore.js.map +0 -1
- package/dist/shared/graph/directedCycles.d.ts +0 -61
- package/dist/shared/graph/directedCycles.d.ts.map +0 -1
- package/dist/shared/graph/directedCycles.js +0 -190
- package/dist/shared/graph/directedCycles.js.map +0 -1
- package/dist/shared/io/pathIdentity.d.ts +0 -26
- package/dist/shared/io/pathIdentity.d.ts.map +0 -1
- package/dist/shared/io/pathIdentity.js +0 -50
- package/dist/shared/io/pathIdentity.js.map +0 -1
|
@@ -6,13 +6,14 @@ import { contentSha256 } from "../../shared/submission/hostHandoffCore.js";
|
|
|
6
6
|
import { AcceptedConformanceReviewSchema, ContractReviewOutcomeSchema } from "../../shared/types/reviewIndependence.js";
|
|
7
7
|
import { archiveConformanceSubjects, assertSuccessfulConformance } from "./triageConformance.js";
|
|
8
8
|
import { readContractReviewOutcomes } from "./closeReviewProvenance.js";
|
|
9
|
-
import {
|
|
9
|
+
import { extname, isAbsolute, join, relative } from "node:path";
|
|
10
10
|
import { readFileSync, existsSync } from "node:fs";
|
|
11
|
-
import { AGENT_FEEDBACK_FILENAME, normalizeRepoPath, parseReflectionsNdjson, readOptionalJsonFile, readOptionalTextFile, renderProcessFeedbackSection, reportDiscardedReflections, stagedAndUntracked, writeJsonFile, writeTextFile, RemediationOutcomeStatusSchema, REMEDIATION_OUTCOMES_CONTRACT_VERSION, countBy, commandLeavesDeclaredShape, parseCommandString, runTrackedAsync, compareCodeUnits, runAdmittedProjectTestCommand, runAdmittedProjectE2eCommand, readSubmissionLedger, assertValidRemediationOutcomesReport, } from "audit-tools/shared";
|
|
11
|
+
import { AGENT_FEEDBACK_FILENAME, normalizeRepoPath, parseReflectionsNdjson, readOptionalJsonFile, readOptionalTextFile, renderProcessFeedbackSection, reportDiscardedReflections, stagedAndUntracked, writeJsonFile, writeTextFile, RemediationOutcomeStatusSchema, REMEDIATION_OUTCOMES_CONTRACT_VERSION, countBy, commandLeavesDeclaredShape, parseCommandString, runTrackedAsync, compareCodeUnits, runAdmittedProjectTestCommand, runAdmittedProjectE2eCommand, readSubmissionLedger, assertValidRemediationOutcomesReport, archiveFrictionRecords, normalizeRepoRelPath, outputDirFor, toPosixPath, uniqueSorted, REMEDIATION_OUTCOMES_FILENAME, REMEDIATION_REPORT_FILENAME, } from "audit-tools/shared";
|
|
12
|
+
import { errorMessage } from "../../shared/io/json.js";
|
|
12
13
|
import { CONTRACT_PIPELINE_VERIFICATION_REPORT_VERSION } from "audit-tools/shared";
|
|
13
14
|
import { FAILURE_OUTPUT_TAIL_CHARS } from "./constants.js";
|
|
14
15
|
import { verifyAnalyzerLeads } from "./closeVerifyAnalyzerLeads.js";
|
|
15
|
-
import { verifyLandingGates, } from "./closeVerifyLandingGates.js";
|
|
16
|
+
import { admittedFailureOutput, verifyLandingGates, } from "./closeVerifyLandingGates.js";
|
|
16
17
|
import { bindSourceVerification, verifyHeadEvidenceAgainstFindings, } from "./closeVerifyHeadEvidence.js";
|
|
17
18
|
import { intakePaths, readSourceManifest } from "../intake.js";
|
|
18
19
|
import { isAuditFindingsReport } from "./plan.js";
|
|
@@ -33,6 +34,12 @@ import { runCloseAcceptance } from "./closeAcceptance.js";
|
|
|
33
34
|
const OUTCOME_KEYS = [
|
|
34
35
|
...RemediationOutcomeStatusSchema.options,
|
|
35
36
|
];
|
|
37
|
+
/** Source and request outcomes that leave the run unfinished. */
|
|
38
|
+
const UNFINISHED_OUTCOMES = new Set(["blocked", "pending", "deferred"]);
|
|
39
|
+
/** An item status that needs no more work: verified complete, or skipped. */
|
|
40
|
+
function isSettledStatus(status) {
|
|
41
|
+
return isVerifiedCompleteStatus(status) || isSkipStatus(status);
|
|
42
|
+
}
|
|
36
43
|
/**
|
|
37
44
|
* Retry-oriented final status per outcome (see RemediationOutcomeFinalStatus).
|
|
38
45
|
* `verified_already_fixed` (CDC-25) joins `resolved`/`verified_no_change`
|
|
@@ -96,9 +103,11 @@ export async function readRunRecoveryFacts(artifactsDir, state) {
|
|
|
96
103
|
try {
|
|
97
104
|
ledger = await readSubmissionLedger(artifactsDir);
|
|
98
105
|
}
|
|
99
|
-
catch {
|
|
100
|
-
return { ...NO_RECOVERY };
|
|
106
|
+
catch (error) {
|
|
107
|
+
return { ...NO_RECOVERY, read_error: errorMessage(error) };
|
|
101
108
|
}
|
|
109
|
+
if (ledger.read_error !== undefined)
|
|
110
|
+
return { ...NO_RECOVERY, read_error: ledger.read_error };
|
|
102
111
|
const marksFor = (kind) => ledger
|
|
103
112
|
.filter((event) => event.kind === kind && (runId === undefined || event.run_id === runId))
|
|
104
113
|
.map((event) => ({
|
|
@@ -118,11 +127,7 @@ export async function readRunRecoveryFacts(artifactsDir, state) {
|
|
|
118
127
|
dropped_lines: ledger.dropped.length,
|
|
119
128
|
};
|
|
120
129
|
}
|
|
121
|
-
/**
|
|
122
|
-
* Phase 7B — capture one outcome per finding (lens, affected file types, how it
|
|
123
|
-
* landed, rework count, closing status). Surface only: the auditor does not
|
|
124
|
-
* consume this automatically.
|
|
125
|
-
*/
|
|
130
|
+
/** The reason a closing action of `none` committed nothing, or that an action failed; otherwise undefined. */
|
|
126
131
|
function closingStatusReason(closingResult) {
|
|
127
132
|
if (closingResult.status === "skipped" && closingResult.action === "none") {
|
|
128
133
|
return "closing action is 'none' — no commit/push/publish configured";
|
|
@@ -222,6 +227,11 @@ function reportHeadEvidence(outcome, runLogger) {
|
|
|
222
227
|
});
|
|
223
228
|
}
|
|
224
229
|
}
|
|
230
|
+
/**
|
|
231
|
+
* Phase 7B — capture one outcome per finding (lens, affected file types, how it
|
|
232
|
+
* landed, rework count, closing status). Surface only: the auditor does not
|
|
233
|
+
* consume this automatically.
|
|
234
|
+
*/
|
|
225
235
|
export function buildRemediationOutcomesReport(state, closingResult,
|
|
226
236
|
// Defaults to ABSENT so every existing caller keeps compiling AND keeps
|
|
227
237
|
// telling the truth: a caller that supplies no gate outcome is a run with no
|
|
@@ -243,7 +253,7 @@ recovery = NO_RECOVERY, contractReviews = []) {
|
|
|
243
253
|
rework_count: item?.rework_count ?? 0,
|
|
244
254
|
...(item?.host_landed_commit ? { landed_commit: item.host_landed_commit } : {}),
|
|
245
255
|
...(item?.host_landed_files ? { landed_files: [...item.host_landed_files] } : {}),
|
|
246
|
-
...(item?.failure_reason ? { reason: item.failure_reason } : !item ? { reason: "No execution state was recorded for this reviewed unit." } : !
|
|
256
|
+
...(item?.failure_reason ? { reason: item.failure_reason } : !item ? { reason: "No execution state was recorded for this reviewed unit." } : !isSettledStatus(item.status) ? { reason: `Execution unit remains ${item.status}.` } : {}),
|
|
247
257
|
...(item?.conformance_review ? { conformance_review: AcceptedConformanceReviewSchema.parse(item.conformance_review) } : {}),
|
|
248
258
|
...(item?.started_at ? { started_at: item.started_at } : {}),
|
|
249
259
|
...(item?.completed_at ? { completed_at: item.completed_at } : {}),
|
|
@@ -254,7 +264,7 @@ recovery = NO_RECOVERY, contractReviews = []) {
|
|
|
254
264
|
if (state.plan?.request || requestDisposition) {
|
|
255
265
|
const units = state.plan?.units ?? [];
|
|
256
266
|
const items = units.map(unit => state.items?.[unit.id]);
|
|
257
|
-
const settled = items.length > 0 && items.every(item => item && (
|
|
267
|
+
const settled = items.length > 0 && items.every(item => item && isSettledStatus(item.status));
|
|
258
268
|
const skipped = items.filter(item => item && isSkipStatus(item.status));
|
|
259
269
|
const status = requestDisposition?.status ??
|
|
260
270
|
(items.some(item => !item || isUnsuccessfulEndStatus(item.status)) ? "blocked" :
|
|
@@ -283,7 +293,7 @@ recovery = NO_RECOVERY, contractReviews = []) {
|
|
|
283
293
|
const linked = units.map(unit => state.items?.[unit.id]);
|
|
284
294
|
const coverage = state.plan_coverage?.entries.find(entry => entry.finding_id === finding.id);
|
|
285
295
|
const coverageDrop = coverage && DROP_REASON_BY_DISPOSITION[coverage.disposition];
|
|
286
|
-
const settledWithOwnerSkip = linked.length > 0 && linked.every(item => item && (
|
|
296
|
+
const settledWithOwnerSkip = linked.length > 0 && linked.every(item => item && isSettledStatus(item.status)) && linked.some(item => item && isSkipStatus(item.status));
|
|
287
297
|
const unitOwnerDisposition = settledWithOwnerSkip ? {
|
|
288
298
|
status: linked.every(item => item?.status === "deemed_inappropriate") ? "declined" : "ignored",
|
|
289
299
|
reason: linked.filter(item => item && isSkipStatus(item.status)).map(item => item.failure_reason ?? "Owner declined this execution unit").join("; "),
|
|
@@ -378,11 +388,9 @@ recovery = NO_RECOVERY, contractReviews = []) {
|
|
|
378
388
|
}
|
|
379
389
|
}
|
|
380
390
|
}
|
|
381
|
-
const fileExts = [
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
.filter((ext) => ext.length > 0)),
|
|
385
|
-
].sort();
|
|
391
|
+
const fileExts = uniqueSorted((finding?.affected_files ?? [])
|
|
392
|
+
.map((file) => extname(file.path).toLowerCase())
|
|
393
|
+
.filter((ext) => ext.length > 0));
|
|
386
394
|
const durationMs = durationBetweenMs(item.started_at, item.completed_at);
|
|
387
395
|
const isSuccessfulOutcome = outcome === "resolved" ||
|
|
388
396
|
outcome === "verified_no_change" ||
|
|
@@ -719,8 +727,8 @@ function resolveEditSurfaceManifest(state) {
|
|
|
719
727
|
* tool output rather than swept out by the blanket `.audit-tools/` exclude.
|
|
720
728
|
*/
|
|
721
729
|
function toolDeliverablePaths(options) {
|
|
722
|
-
const outputDir =
|
|
723
|
-
return [
|
|
730
|
+
const outputDir = outputDirFor(options.artifactsDir);
|
|
731
|
+
return [REMEDIATION_REPORT_FILENAME, REMEDIATION_OUTCOMES_FILENAME].map((name) => toPosixPath(relative(options.root, join(outputDir, name))));
|
|
724
732
|
}
|
|
725
733
|
/**
|
|
726
734
|
* INVARIANT (V2 fix): remediation close must never commit files the run
|
|
@@ -816,7 +824,7 @@ export async function collectStagingFiles(root, manifest, deliverables = []) {
|
|
|
816
824
|
* lowercased `normalizeRepoPath` remains the fold-fallback tier.
|
|
817
825
|
*/
|
|
818
826
|
function repoPathExactKey(path) {
|
|
819
|
-
return path.trim()
|
|
827
|
+
return normalizeRepoRelPath(path.trim());
|
|
820
828
|
}
|
|
821
829
|
/**
|
|
822
830
|
* Generate a commit message derived from item summaries and finding titles.
|
|
@@ -1055,9 +1063,7 @@ export async function runCombinedTestSuite(state, options) {
|
|
|
1055
1063
|
if (!state.plan?.test_command) {
|
|
1056
1064
|
return { ran: false, passed: true, duration_ms: 0, output: "" };
|
|
1057
1065
|
}
|
|
1058
|
-
const suiteName =
|
|
1059
|
-
? state.plan.test_command.join(" ")
|
|
1060
|
-
: state.plan.test_command;
|
|
1066
|
+
const suiteName = state.plan.test_command;
|
|
1061
1067
|
if (commandLeavesDeclaredShape(suiteName)) {
|
|
1062
1068
|
return {
|
|
1063
1069
|
ran: false,
|
|
@@ -1082,12 +1088,7 @@ export async function runCombinedTestSuite(state, options) {
|
|
|
1082
1088
|
exit_code: admitted.exit_code,
|
|
1083
1089
|
suite_name: suiteName,
|
|
1084
1090
|
duration_ms: Date.now() - startedAt,
|
|
1085
|
-
output: passed
|
|
1086
|
-
? ""
|
|
1087
|
-
: (admitted.spawn_error ?? admitted.output).trim().slice(-FAILURE_OUTPUT_TAIL_CHARS) ||
|
|
1088
|
-
(admitted.timed_out
|
|
1089
|
-
? `default test command timed out after ${CLOSING_CHILD_DEADLINE_MS}ms`
|
|
1090
|
-
: "default test command failed without output"),
|
|
1091
|
+
output: passed ? "" : admittedFailureOutput(admitted, "default test command", CLOSING_CHILD_DEADLINE_MS),
|
|
1091
1092
|
};
|
|
1092
1093
|
}
|
|
1093
1094
|
// argv, never a shell string: the shape gate admits only single invocations,
|
|
@@ -1102,10 +1103,14 @@ export async function runCombinedTestSuite(state, options) {
|
|
|
1102
1103
|
if (result.status === 0) {
|
|
1103
1104
|
return { ran: true, passed: true, exit_code: result.status, suite_name: suiteName, duration_ms: durationMs, output: "" };
|
|
1104
1105
|
}
|
|
1105
|
-
const output = (
|
|
1106
|
+
const output = combinedOutputTail(result);
|
|
1107
|
+
return { ran: true, passed: false, exit_code: result.status, suite_name: suiteName, duration_ms: durationMs, output };
|
|
1108
|
+
}
|
|
1109
|
+
/** The tail of a tracked run's stdout then stderr, cut to `FAILURE_OUTPUT_TAIL_CHARS`. */
|
|
1110
|
+
function combinedOutputTail(result) {
|
|
1111
|
+
return ((result.stdout?.toString() ?? "") + (result.stderr?.toString() ?? ""))
|
|
1106
1112
|
.trim()
|
|
1107
1113
|
.slice(-FAILURE_OUTPUT_TAIL_CHARS);
|
|
1108
|
-
return { ran: true, passed: false, exit_code: result.status, suite_name: suiteName, duration_ms: durationMs, output };
|
|
1109
1114
|
}
|
|
1110
1115
|
/**
|
|
1111
1116
|
* Parse test output to extract implicated file paths. Looks for common test
|
|
@@ -1118,14 +1123,11 @@ function extractImplicatedPaths(testOutput) {
|
|
|
1118
1123
|
const pathPattern = /(?:FAIL\s+|at\s+\S+\s+\(|●\s+)?([^\s()]+\.[a-z]{1,6})(?::\d+)?/g;
|
|
1119
1124
|
let match;
|
|
1120
1125
|
while ((match = pathPattern.exec(testOutput)) !== null) {
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
if (
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
!normalizeRepoPath(normalized).startsWith("node_modules/")) {
|
|
1127
|
-
paths.add(normalized);
|
|
1128
|
-
}
|
|
1126
|
+
// The capture always ends in `.<ext>`, so every candidate looks like a file.
|
|
1127
|
+
const normalized = safeAttributionPath(match[1]);
|
|
1128
|
+
if (normalized &&
|
|
1129
|
+
!normalizeRepoPath(normalized).startsWith("node_modules/")) {
|
|
1130
|
+
paths.add(normalized);
|
|
1129
1131
|
}
|
|
1130
1132
|
}
|
|
1131
1133
|
return [...paths];
|
|
@@ -1137,10 +1139,7 @@ function extractImplicatedPaths(testOutput) {
|
|
|
1137
1139
|
* of being collapsed into a different block's declared scope.
|
|
1138
1140
|
*/
|
|
1139
1141
|
function safeAttributionPath(path) {
|
|
1140
|
-
const
|
|
1141
|
-
const withoutLeadingDot = normalized.startsWith("./")
|
|
1142
|
-
? normalized.slice(2)
|
|
1143
|
-
: normalized;
|
|
1142
|
+
const withoutLeadingDot = normalizeRepoRelPath(path.trim());
|
|
1144
1143
|
return withoutLeadingDot
|
|
1145
1144
|
.split("/")
|
|
1146
1145
|
.some((segment) => segment === "." || segment === "..")
|
|
@@ -1171,20 +1170,20 @@ function touchedPathMatchesImplicated(tf, ip) {
|
|
|
1171
1170
|
return a.endsWith(`/${b}`) || b.endsWith(`/${a}`);
|
|
1172
1171
|
}
|
|
1173
1172
|
/**
|
|
1174
|
-
* On a combined-test failure, selectively re-block items whose
|
|
1173
|
+
* On a combined-test failure, selectively re-block items whose allowed files
|
|
1175
1174
|
* overlap with the failing tests' implicated paths. When attribution is
|
|
1176
1175
|
* ambiguous (no overlap found), falls back to re-blocking all resolved items.
|
|
1177
1176
|
* Returns whether any item was blocked — the caller transitions back to triage.
|
|
1178
1177
|
*
|
|
1179
|
-
* The surface is read from the item's
|
|
1180
|
-
*
|
|
1181
|
-
*
|
|
1178
|
+
* The surface is read from the item's execution unit (`unit.allowed_files` on
|
|
1179
|
+
* the plan), which is the same scope the host binds an implementer to. It
|
|
1180
|
+
* previously read a per-item `item_spec.touched_files`;
|
|
1182
1181
|
* nothing in production ever wrote an item_spec, so that expression was always
|
|
1183
1182
|
* `[]`, attribution could never succeed, and the ambiguity fallback re-blocked
|
|
1184
|
-
* EVERY resolved item on any combined-suite failure. Reading the
|
|
1183
|
+
* EVERY resolved item on any combined-suite failure. Reading the unit is what
|
|
1185
1184
|
* makes the attribution arm reachable at all.
|
|
1186
1185
|
*/
|
|
1187
|
-
export function blockResolvedItemsOnCombinedFailure(state, testOutput) {
|
|
1186
|
+
export function blockResolvedItemsOnCombinedFailure(state, testOutput, suite = "Combined test suite") {
|
|
1188
1187
|
const resolvedItems = Object.values(state.items ?? {}).filter((i) => isVerifiedCompleteStatus(i.status));
|
|
1189
1188
|
if (resolvedItems.length === 0)
|
|
1190
1189
|
return false;
|
|
@@ -1209,7 +1208,7 @@ export function blockResolvedItemsOnCombinedFailure(state, testOutput) {
|
|
|
1209
1208
|
for (const item of toBlock) {
|
|
1210
1209
|
item.status = "blocked";
|
|
1211
1210
|
item.completed_at = now;
|
|
1212
|
-
item.failure_reason =
|
|
1211
|
+
item.failure_reason = `${suite} failed after remediation. ${attributionNote}${testOutput ? `\n\nTest output:\n${testOutput}` : ""}`;
|
|
1213
1212
|
}
|
|
1214
1213
|
return true;
|
|
1215
1214
|
}
|
|
@@ -1246,12 +1245,7 @@ async function runE2eTests(state, options) {
|
|
|
1246
1245
|
return {
|
|
1247
1246
|
ran: true,
|
|
1248
1247
|
passed,
|
|
1249
|
-
output: passed
|
|
1250
|
-
? ""
|
|
1251
|
-
: (admitted.spawn_error ?? admitted.output).trim().slice(-FAILURE_OUTPUT_TAIL_CHARS) ||
|
|
1252
|
-
(admitted.timed_out
|
|
1253
|
-
? `default e2e command timed out after ${CLOSING_CHILD_DEADLINE_MS}ms`
|
|
1254
|
-
: "default e2e command failed without output"),
|
|
1248
|
+
output: passed ? "" : admittedFailureOutput(admitted, "default e2e command", CLOSING_CHILD_DEADLINE_MS),
|
|
1255
1249
|
};
|
|
1256
1250
|
}
|
|
1257
1251
|
const e2eResult = await runTrackedAsync(parseCommandString(state.plan.e2e_command), {
|
|
@@ -1261,10 +1255,7 @@ async function runE2eTests(state, options) {
|
|
|
1261
1255
|
});
|
|
1262
1256
|
const e2ePassed = e2eResult.status === 0;
|
|
1263
1257
|
if (!e2ePassed) {
|
|
1264
|
-
const e2eOutput = (
|
|
1265
|
-
(e2eResult.stderr?.toString() ?? ""))
|
|
1266
|
-
.trim()
|
|
1267
|
-
.slice(-FAILURE_OUTPUT_TAIL_CHARS);
|
|
1258
|
+
const e2eOutput = combinedOutputTail(e2eResult);
|
|
1268
1259
|
console.warn("End-to-end tests failed after remediation. Transitioning to triage.");
|
|
1269
1260
|
return { ran: true, passed: false, output: e2eOutput };
|
|
1270
1261
|
}
|
|
@@ -1273,10 +1264,9 @@ async function runE2eTests(state, options) {
|
|
|
1273
1264
|
}
|
|
1274
1265
|
/**
|
|
1275
1266
|
* Partition the terminal items into the report's resolved / verified-no-change
|
|
1276
|
-
* / inappropriate / ignored buckets,
|
|
1277
|
-
* evidence from its `verify_code_against_documentation` result file when present.
|
|
1267
|
+
* / inappropriate / ignored buckets, using the evidence accepted with each unit.
|
|
1278
1268
|
*/
|
|
1279
|
-
function collectReportEntries(state
|
|
1269
|
+
function collectReportEntries(state) {
|
|
1280
1270
|
const entries = {
|
|
1281
1271
|
resolved: [],
|
|
1282
1272
|
verifiedNoChange: [],
|
|
@@ -1288,23 +1278,10 @@ function collectReportEntries(state, options) {
|
|
|
1288
1278
|
if (isVerifiedCompleteStatus(item.status)) {
|
|
1289
1279
|
const unit = state.plan?.units.find((u) => u.id === item.unit_id);
|
|
1290
1280
|
const title = unit?.title ?? item.unit_id;
|
|
1291
|
-
let verificationEvidence = item.host_result_evidence;
|
|
1292
|
-
const verificationResultPath = join(options.artifactsDir, `result_${item.unit_id}_verify_code_against_documentation.json`);
|
|
1293
|
-
if (existsSync(verificationResultPath)) {
|
|
1294
|
-
try {
|
|
1295
|
-
const verRes = JSON.parse(readFileSync(verificationResultPath, "utf8"));
|
|
1296
|
-
if (Array.isArray(verRes.reason) && verRes.reason.length > 0) {
|
|
1297
|
-
verificationEvidence = verRes.reason;
|
|
1298
|
-
}
|
|
1299
|
-
}
|
|
1300
|
-
catch (error) {
|
|
1301
|
-
console.warn(`Failed to parse verification result ${verificationResultPath}.`, error);
|
|
1302
|
-
}
|
|
1303
|
-
}
|
|
1304
1281
|
const entry = {
|
|
1305
1282
|
unit_id: item.unit_id,
|
|
1306
1283
|
summary: title,
|
|
1307
|
-
verification_evidence:
|
|
1284
|
+
verification_evidence: item.host_result_evidence,
|
|
1308
1285
|
};
|
|
1309
1286
|
if (item.status === "resolved_no_change") {
|
|
1310
1287
|
entries.verifiedNoChange.push(entry);
|
|
@@ -1334,6 +1311,14 @@ function collectReportEntries(state, options) {
|
|
|
1334
1311
|
}
|
|
1335
1312
|
return entries;
|
|
1336
1313
|
}
|
|
1314
|
+
/** One resolved or verified-no-change line of the report, with its verification lines. */
|
|
1315
|
+
function renderResolvedEntry(entry) {
|
|
1316
|
+
let text = `- **${entry.unit_id}**: ${entry.summary}\n`;
|
|
1317
|
+
for (const check of entry.verification_evidence ?? []) {
|
|
1318
|
+
text += ` - *Verification*: ${check}\n`;
|
|
1319
|
+
}
|
|
1320
|
+
return text;
|
|
1321
|
+
}
|
|
1337
1322
|
/**
|
|
1338
1323
|
* Render `remediation-report.md` from the partitioned entries, closing action,
|
|
1339
1324
|
* e2e result, and per-finding outcomes. Pure string builder (no I/O).
|
|
@@ -1351,10 +1336,10 @@ export function buildRemediationReportMarkdown(state, entries, closingResult, e2
|
|
|
1351
1336
|
const completedUnits = executionUnits.filter(unit => unit.status === "resolved" || unit.status === "resolved_no_change").length;
|
|
1352
1337
|
const skippedUnits = executionUnits.filter(unit => unit.status === "ignored" || unit.status === "deemed_inappropriate").length;
|
|
1353
1338
|
reportContent += `## Execution units\n\n${executionUnits.length} unit(s): ${completedUnits} verified complete, ${skippedUnits} skipped, ${executionUnits.length - completedUnits - skippedUnits} unfinished.\n\n`;
|
|
1354
|
-
for (const unit of
|
|
1339
|
+
for (const unit of executionUnits) {
|
|
1355
1340
|
reportContent += `- **${unit.unit_id}** ${unit.title}: ${unit.status}${unit.reason ? ` — ${unit.reason}` : ""}\n`;
|
|
1356
1341
|
}
|
|
1357
|
-
if (!
|
|
1342
|
+
if (!executionUnits.length)
|
|
1358
1343
|
reportContent += "No execution units were required.\n";
|
|
1359
1344
|
reportContent += "\n";
|
|
1360
1345
|
// Host results are accepted only after the claimed commit is mechanically
|
|
@@ -1380,25 +1365,13 @@ export function buildRemediationReportMarkdown(state, entries, closingResult, e2
|
|
|
1380
1365
|
reportContent += `None.\n`;
|
|
1381
1366
|
}
|
|
1382
1367
|
else {
|
|
1383
|
-
for (const entry of entries.resolved)
|
|
1384
|
-
reportContent +=
|
|
1385
|
-
if (entry.verification_evidence) {
|
|
1386
|
-
for (const check of entry.verification_evidence) {
|
|
1387
|
-
reportContent += ` - *Verification*: ${check}\n`;
|
|
1388
|
-
}
|
|
1389
|
-
}
|
|
1390
|
-
}
|
|
1368
|
+
for (const entry of entries.resolved)
|
|
1369
|
+
reportContent += renderResolvedEntry(entry);
|
|
1391
1370
|
}
|
|
1392
1371
|
if (entries.verifiedNoChange.length > 0) {
|
|
1393
1372
|
reportContent += `\n## Verified Already Correct (no changes made)\n\n`;
|
|
1394
|
-
for (const entry of entries.verifiedNoChange)
|
|
1395
|
-
reportContent +=
|
|
1396
|
-
if (entry.verification_evidence) {
|
|
1397
|
-
for (const check of entry.verification_evidence) {
|
|
1398
|
-
reportContent += ` - *Verification*: ${check}\n`;
|
|
1399
|
-
}
|
|
1400
|
-
}
|
|
1401
|
-
}
|
|
1373
|
+
for (const entry of entries.verifiedNoChange)
|
|
1374
|
+
reportContent += renderResolvedEntry(entry);
|
|
1402
1375
|
}
|
|
1403
1376
|
if (entries.inappropriate.length > 0) {
|
|
1404
1377
|
reportContent += `\n## Deemed Inappropriate\n\n`;
|
|
@@ -1412,7 +1385,8 @@ export function buildRemediationReportMarkdown(state, entries, closingResult, e2
|
|
|
1412
1385
|
reportContent += `- **${entry.unit_id}**: ${entry.rationale}\n`;
|
|
1413
1386
|
}
|
|
1414
1387
|
}
|
|
1415
|
-
const
|
|
1388
|
+
const coverageEntries = state.plan_coverage?.entries ?? [];
|
|
1389
|
+
const skippedByCheckpoint = coverageEntries.filter((e) => e.disposition === "dropped_by_checkpoint");
|
|
1416
1390
|
if (skippedByCheckpoint.length > 0) {
|
|
1417
1391
|
reportContent += `\n## Skipped by Intent Checkpoint\n\n`;
|
|
1418
1392
|
reportContent += `${skippedByCheckpoint.length} finding(s) were excluded from remediation by the intent checkpoint (severity/lens/package/theme filters or excluded scope):\n`;
|
|
@@ -1420,7 +1394,7 @@ export function buildRemediationReportMarkdown(state, entries, closingResult, e2
|
|
|
1420
1394
|
reportContent += `- **${entry.finding_id}**${entry.title ? `: ${entry.title}` : ""}\n`;
|
|
1421
1395
|
}
|
|
1422
1396
|
}
|
|
1423
|
-
const droppedByGrounding =
|
|
1397
|
+
const droppedByGrounding = coverageEntries.filter((e) => e.disposition === "dropped_phantom_paths");
|
|
1424
1398
|
if (droppedByGrounding.length > 0) {
|
|
1425
1399
|
reportContent += `\n## Dropped by Grounding\n\n`;
|
|
1426
1400
|
reportContent += `${droppedByGrounding.length} extracted finding(s) were dropped because every cited path was phantom (does not exist in this repository):\n`;
|
|
@@ -1429,7 +1403,7 @@ export function buildRemediationReportMarkdown(state, entries, closingResult, e2
|
|
|
1429
1403
|
reportContent += `- **${entry.finding_id}**${entry.title ? `: ${entry.title}` : ""}${phantoms ? ` (cited: ${phantoms})` : ""}\n`;
|
|
1430
1404
|
}
|
|
1431
1405
|
}
|
|
1432
|
-
const ungroundedEvidence =
|
|
1406
|
+
const ungroundedEvidence = coverageEntries.filter((e) => e.disposition === "planned" && e.evidence_grounded === false);
|
|
1433
1407
|
if (ungroundedEvidence.length > 0) {
|
|
1434
1408
|
reportContent += `\n## Ungrounded Evidence\n\n`;
|
|
1435
1409
|
reportContent += `${ungroundedEvidence.length} planned finding(s) carried no evidence citing a real repo path and were downgraded to low confidence:\n`;
|
|
@@ -1504,10 +1478,13 @@ export function buildRemediationReportMarkdown(state, entries, closingResult, e2
|
|
|
1504
1478
|
...outcomesReport.recovery.accepted_via_recovery,
|
|
1505
1479
|
...outcomesReport.recovery.recovered_by_hand,
|
|
1506
1480
|
];
|
|
1507
|
-
if (
|
|
1481
|
+
if (outcomesReport.recovery.read_error !== undefined) {
|
|
1482
|
+
reportContent += `Recovery report incomplete. The submission ledger could not be read: ${outcomesReport.recovery.read_error}\nRepair the ledger and run next-step to retry reporting.\n`;
|
|
1483
|
+
}
|
|
1484
|
+
else if (marks.length === 0 && outcomesReport.recovery.dropped_lines === 0) {
|
|
1508
1485
|
reportContent += `None — no submission was readmitted; every accepted submission passed the normal lane's checks.\n`;
|
|
1509
1486
|
}
|
|
1510
|
-
else {
|
|
1487
|
+
else if (marks.length > 0) {
|
|
1511
1488
|
reportContent += `${marks.length} submission(s) were READMITTED after the normal lane did not accept them. Findings fixed through a recovered submission are less corroborated than the rest of this run's:\n\n`;
|
|
1512
1489
|
for (const mark of marks) {
|
|
1513
1490
|
reportContent += `- \`${mark.submission_id}\` (lane \`${mark.lane}\`): ${recoveryLabel(mark.kind)}${mark.issue_code ? ` — \`${mark.issue_code}\`` : ""}\n`;
|
|
@@ -1521,7 +1498,12 @@ export function buildRemediationReportMarkdown(state, entries, closingResult, e2
|
|
|
1521
1498
|
}
|
|
1522
1499
|
const o = outcomesReport.by_outcome;
|
|
1523
1500
|
reportContent += `\n## Remediation Outcomes\n\n`;
|
|
1524
|
-
|
|
1501
|
+
const labels = {
|
|
1502
|
+
resolved: "resolved", verified_no_change: "verified already correct", inappropriate: "deemed inappropriate",
|
|
1503
|
+
ignored: "ignored", blocked: "blocked", pending: "pending", deferred: "deferred",
|
|
1504
|
+
verified_already_fixed: "verified already fixed", refuted: "refuted",
|
|
1505
|
+
};
|
|
1506
|
+
reportContent += `Of ${outcomesReport.total} finding(s): ${OUTCOME_KEYS.map(key => `${o[key]} ${labels[key]}`).join(", ")}.\n`;
|
|
1525
1507
|
const lensNames = Object.keys(outcomesReport.by_lens).sort();
|
|
1526
1508
|
if (lensNames.length > 0) {
|
|
1527
1509
|
reportContent += `\nBy lens:\n`;
|
|
@@ -1600,11 +1582,10 @@ export async function cleanupTempBranchesAndArtifacts(options, completeState, co
|
|
|
1600
1582
|
// a failed final-state persist means a restart resumes from the PRE-close
|
|
1601
1583
|
// state and re-runs closing actions (re-commit/re-push) with no operator
|
|
1602
1584
|
// clue why. Surface it on the console and in the structured run log.
|
|
1603
|
-
// kind:"error"
|
|
1604
|
-
//
|
|
1605
|
-
//
|
|
1606
|
-
|
|
1607
|
-
const reason = error instanceof Error ? error.message : String(error);
|
|
1585
|
+
// kind:"error": this is a run-level diagnostic (the final-state persist
|
|
1586
|
+
// itself failed), never a per-finding outcome, so it does not use the
|
|
1587
|
+
// "outcome" kind.
|
|
1588
|
+
const reason = errorMessage(error);
|
|
1608
1589
|
console.warn(`Failed to persist the final remediation state — a resumed run may re-execute closing actions: ${reason}`);
|
|
1609
1590
|
runLogger?.event({
|
|
1610
1591
|
phase: "close",
|
|
@@ -1633,16 +1614,17 @@ export async function cleanupTempBranchesAndArtifacts(options, completeState, co
|
|
|
1633
1614
|
// classification (see closingActionCompleted): success, or the skipped
|
|
1634
1615
|
// action=none no-op — never a skipped non-none close.
|
|
1635
1616
|
const closingCompleted = closingActionCompleted(closingResult);
|
|
1636
|
-
const unresolvedSources = sourceOutcomes.outcomes.some(outcome =>
|
|
1637
|
-
const unresolvedRequest = sourceOutcomes.request_outcome &&
|
|
1617
|
+
const unresolvedSources = sourceOutcomes.outcomes.some(outcome => UNFINISHED_OUTCOMES.has(outcome.outcome));
|
|
1618
|
+
const unresolvedRequest = sourceOutcomes.request_outcome && UNFINISHED_OUTCOMES.has(sourceOutcomes.request_outcome.status);
|
|
1638
1619
|
const unresolvedUnits = (completeState.plan?.units ?? []).some(unit => {
|
|
1639
1620
|
const item = completeState.items?.[unit.id];
|
|
1640
|
-
return !item ||
|
|
1621
|
+
return !item || !isSettledStatus(item.status);
|
|
1641
1622
|
});
|
|
1642
1623
|
const fullyGreen = combinedTest.passed &&
|
|
1643
1624
|
e2eResult.passed &&
|
|
1644
1625
|
landingGates.passed &&
|
|
1645
1626
|
closingCompleted &&
|
|
1627
|
+
sourceOutcomes.recovery.read_error === undefined &&
|
|
1646
1628
|
!anyBlocked &&
|
|
1647
1629
|
!unresolvedSources &&
|
|
1648
1630
|
!unresolvedRequest &&
|
|
@@ -1653,7 +1635,7 @@ export async function cleanupTempBranchesAndArtifacts(options, completeState, co
|
|
|
1653
1635
|
kind: "artifact_write",
|
|
1654
1636
|
obligation: "closing",
|
|
1655
1637
|
artifact: options.artifactsDir,
|
|
1656
|
-
note: `Artifacts directory preserved for diagnosis (combinedTest.passed=${combinedTest.passed}, e2e.passed=${e2eResult.passed}, landingGates.passed=${landingGates.passed}, closing=${closingResult.status}, closingAction=${closingResult.action}, anyBlocked=${anyBlocked}, unresolvedSources=${unresolvedSources}, unresolvedUnits=${unresolvedUnits})`,
|
|
1638
|
+
note: `Artifacts directory preserved for diagnosis (combinedTest.passed=${combinedTest.passed}, e2e.passed=${e2eResult.passed}, landingGates.passed=${landingGates.passed}, closing=${closingResult.status}, closingAction=${closingResult.action}, anyBlocked=${anyBlocked}, unresolvedSources=${unresolvedSources}, unresolvedRequest=${Boolean(unresolvedRequest)}, unresolvedUnits=${unresolvedUnits}, recoveryReadError=${sourceOutcomes.recovery.read_error ?? "none"})`,
|
|
1657
1639
|
});
|
|
1658
1640
|
return {};
|
|
1659
1641
|
}
|
|
@@ -1672,7 +1654,6 @@ export async function cleanupTempBranchesAndArtifacts(options, completeState, co
|
|
|
1672
1654
|
// non-green close already preserves it — so the answer is to KEEP the
|
|
1673
1655
|
// directory and say why, not to abort a close that has already written its
|
|
1674
1656
|
// report.
|
|
1675
|
-
const { archiveFrictionRecords, outputDirFor } = await import("audit-tools/shared");
|
|
1676
1657
|
let archiveFailure = "friction archive listing failed";
|
|
1677
1658
|
try {
|
|
1678
1659
|
await archiveFrictionRecords({
|
|
@@ -1684,7 +1665,7 @@ export async function cleanupTempBranchesAndArtifacts(options, completeState, co
|
|
|
1684
1665
|
await archiveConformanceSubjects(options.artifactsDir, outputDirFor(options.artifactsDir));
|
|
1685
1666
|
}
|
|
1686
1667
|
catch (error) {
|
|
1687
|
-
const reason =
|
|
1668
|
+
const reason = errorMessage(error);
|
|
1688
1669
|
console.warn("Close-out evidence could not be archived, so the artifacts " +
|
|
1689
1670
|
"directory is kept rather than deleted: " +
|
|
1690
1671
|
reason);
|
|
@@ -1702,7 +1683,7 @@ export async function cleanupTempBranchesAndArtifacts(options, completeState, co
|
|
|
1702
1683
|
await rm(options.artifactsDir, { recursive: true, force: true });
|
|
1703
1684
|
}
|
|
1704
1685
|
catch (error) {
|
|
1705
|
-
const reason =
|
|
1686
|
+
const reason = errorMessage(error);
|
|
1706
1687
|
console.warn("Failed to clean up artifacts directory — manual removal may be needed.");
|
|
1707
1688
|
runLogger?.event({
|
|
1708
1689
|
phase: "close",
|
|
@@ -1716,16 +1697,10 @@ export async function cleanupTempBranchesAndArtifacts(options, completeState, co
|
|
|
1716
1697
|
return {};
|
|
1717
1698
|
}
|
|
1718
1699
|
/**
|
|
1719
|
-
*
|
|
1720
|
-
*
|
|
1721
|
-
* - combined test suite result (task kind)
|
|
1722
|
-
* - each item's verification evidence from result files (file kind)
|
|
1723
|
-
* - closing action outcome (command kind)
|
|
1724
|
-
*
|
|
1725
|
-
* Overall status is "passed" when combined tests passed and all resolved
|
|
1726
|
-
* items have at least one passing trace. "failed" otherwise.
|
|
1700
|
+
* Project accepted unit evidence onto the reviewed requirements and commands.
|
|
1701
|
+
* Each source finding includes its linked unit traces and its own recorded disposition.
|
|
1727
1702
|
*/
|
|
1728
|
-
export function buildVerificationReport(state,
|
|
1703
|
+
export function buildVerificationReport(state, _options, closingResult, combinedTest, createdAt = new Date().toISOString()) {
|
|
1729
1704
|
const units = (state.plan?.units ?? []).map(unit => {
|
|
1730
1705
|
const item = state.items?.[unit.id];
|
|
1731
1706
|
const passed = !!item && isVerifiedCompleteStatus(item.status) && combinedTest.passed;
|
|
@@ -1745,15 +1720,6 @@ export function buildVerificationReport(state, options, closingResult, combinedT
|
|
|
1745
1720
|
trace_id: `${unit.id}:command:${i}`, kind: "command", label: command,
|
|
1746
1721
|
evidence: [...(item?.host_result_evidence ?? [])], status: passed ? "passed" : "failed",
|
|
1747
1722
|
});
|
|
1748
|
-
const verificationResultPath = join(options.artifactsDir, `result_${unit.id}_verify_code_against_documentation.json`);
|
|
1749
|
-
if (existsSync(verificationResultPath)) {
|
|
1750
|
-
try {
|
|
1751
|
-
const result = JSON.parse(readFileSync(verificationResultPath, "utf8"));
|
|
1752
|
-
const evidence = Array.isArray(result.reason) ? result.reason.filter((v) => typeof v === "string") : [];
|
|
1753
|
-
traces.push({ trace_id: `${unit.id}:verify-doc`, kind: "file", label: "verify_code_against_documentation", evidence, status: evidence.length ? "passed" : "failed" });
|
|
1754
|
-
}
|
|
1755
|
-
catch { /* malformed optional evidence cannot establish a passing trace */ }
|
|
1756
|
-
}
|
|
1757
1723
|
if (closingResult.action !== "none")
|
|
1758
1724
|
traces.push({
|
|
1759
1725
|
trace_id: `${unit.id}:closing`, kind: "command", label: `closing action: ${closingResult.action}`,
|
|
@@ -1773,9 +1739,9 @@ export function buildVerificationReport(state, options, closingResult, combinedT
|
|
|
1773
1739
|
...(outcome.reason ? [{ trace_id: `${outcome.finding_id}:source-disposition`, kind: "task", label: outcome.outcome, evidence: [outcome.reason], status: "failed" }] : []),
|
|
1774
1740
|
],
|
|
1775
1741
|
overall_status: outcome.outcome === "ignored" || outcome.outcome === "inappropriate" ? "skipped"
|
|
1776
|
-
:
|
|
1742
|
+
: UNFINISHED_OUTCOMES.has(outcome.outcome) ? "failed" : "passed",
|
|
1777
1743
|
}));
|
|
1778
|
-
const requestUnfinished = outcomeReport.request_outcome &&
|
|
1744
|
+
const requestUnfinished = outcomeReport.request_outcome && UNFINISHED_OUTCOMES.has(outcomeReport.request_outcome.status);
|
|
1779
1745
|
const overallPassed = !requestUnfinished && combinedTest.passed && closingActionCompleted(closingResult) &&
|
|
1780
1746
|
units.every(unit => unit.overall_status !== "failed") && findings.every(finding => finding.overall_status !== "failed");
|
|
1781
1747
|
return {
|
|
@@ -1783,7 +1749,7 @@ export function buildVerificationReport(state, options, closingResult, combinedT
|
|
|
1783
1749
|
...(state.plan?.goal_id ? { goal_id: state.plan.goal_id } : {}),
|
|
1784
1750
|
findings, units,
|
|
1785
1751
|
overall_status: overallPassed ? "passed" : "failed",
|
|
1786
|
-
created_at:
|
|
1752
|
+
created_at: createdAt,
|
|
1787
1753
|
};
|
|
1788
1754
|
}
|
|
1789
1755
|
// sites-pinned: tests/remediate/close-plan-authority.test.ts
|
|
@@ -1799,6 +1765,11 @@ async function assertClosingPlanAuthority(state, options) {
|
|
|
1799
1765
|
throw new RemediationPlanAuthorityError(issues.join("; "));
|
|
1800
1766
|
}
|
|
1801
1767
|
export async function runClosePhase(state, options, runLogger) {
|
|
1768
|
+
const resumed = await retryIncompleteCloseReport(state, options, runLogger);
|
|
1769
|
+
if (resumed)
|
|
1770
|
+
return resumed;
|
|
1771
|
+
if (state.status === "complete")
|
|
1772
|
+
return state;
|
|
1802
1773
|
admitRemediationDirtyBaseline(state);
|
|
1803
1774
|
console.log("Running Close Phase...");
|
|
1804
1775
|
if (!state.plan || !state.items || !state.closing_plan) {
|
|
@@ -1815,9 +1786,9 @@ export async function runClosePhase(state, options, runLogger) {
|
|
|
1815
1786
|
// runLogger is actually wired, so it changes nothing for a caller that
|
|
1816
1787
|
// doesn't ask for it.
|
|
1817
1788
|
{
|
|
1818
|
-
const
|
|
1789
|
+
const unitIds = new Set((state.plan.units ?? []).map((unit) => unit.id));
|
|
1819
1790
|
const itemIds = new Set(Object.keys(state.items));
|
|
1820
|
-
const uncounted = [...
|
|
1791
|
+
const uncounted = [...unitIds].filter((id) => !itemIds.has(id));
|
|
1821
1792
|
if (uncounted.length > 0) {
|
|
1822
1793
|
runLogger?.event({
|
|
1823
1794
|
phase: "close",
|
|
@@ -1941,7 +1912,7 @@ export async function runClosePhase(state, options, runLogger) {
|
|
|
1941
1912
|
const e2eResult = await runE2eTests(state, options);
|
|
1942
1913
|
if (!e2eResult.passed) {
|
|
1943
1914
|
console.log("End-to-end tests failed. Transitioning back to triage.");
|
|
1944
|
-
if (blockResolvedItemsOnCombinedFailure(state, e2eResult.output)) {
|
|
1915
|
+
if (blockResolvedItemsOnCombinedFailure(state, e2eResult.output, "End-to-end tests")) {
|
|
1945
1916
|
runLogger?.event({
|
|
1946
1917
|
phase: "close",
|
|
1947
1918
|
kind: "state",
|
|
@@ -1998,21 +1969,55 @@ export async function runClosePhase(state, options, runLogger) {
|
|
|
1998
1969
|
// reporting success.
|
|
1999
1970
|
console.log(`Executing closing action: ${state.closing_plan.action}`);
|
|
2000
1971
|
const closingResult = await executeClosingAction(state, options);
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
//
|
|
2005
|
-
//
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
1972
|
+
const context = {
|
|
1973
|
+
combinedTest, e2eResult, landingGates, contractReviews, endedAt: new Date().toISOString(),
|
|
1974
|
+
};
|
|
1975
|
+
// Persist the irreversible action's result and the facts needed to report it in
|
|
1976
|
+
// one atomic rename, before attempting any ledger read or report write.
|
|
1977
|
+
await writeJsonFile(join(options.artifactsDir, CLOSING_RESULT_FILENAME), {
|
|
1978
|
+
...closingResult,
|
|
1979
|
+
pending_report: { verified_state: state, context, sha256: contentSha256([closingResult, state, context]) },
|
|
1980
|
+
});
|
|
1981
|
+
return reportRecordedClose(state, options, closingResult, context, runLogger, false);
|
|
1982
|
+
}
|
|
1983
|
+
// sites-pinned: tests/remediate/phase-close.test.ts
|
|
1984
|
+
const CLOSING_RESULT_FILENAME = "remediation-closing-result.json";
|
|
1985
|
+
/** Resume after the authorized action, including when a report write failed before state became complete. */
|
|
1986
|
+
export async function retryIncompleteCloseReport(state, options, runLogger) {
|
|
1987
|
+
const saved = await readOptionalJsonFile(join(options.artifactsDir, CLOSING_RESULT_FILENAME));
|
|
1988
|
+
if (!saved || !("pending_report" in saved))
|
|
1989
|
+
return;
|
|
1990
|
+
const { pending_report: retry, ...closingResult } = saved;
|
|
1991
|
+
const verified = retry?.verified_state;
|
|
1992
|
+
if (!retry || !verified?.plan || !state.plan || (state.status !== "complete" && state.status !== "closing") ||
|
|
1993
|
+
verified.plan.plan_id !== state.plan.plan_id || verified.started_at !== state.started_at ||
|
|
1994
|
+
verified.plan.review_revision_sha256 !== state.plan.review_revision_sha256 ||
|
|
1995
|
+
verified.closing_plan?.action !== state.closing_plan?.action) {
|
|
1996
|
+
throw new Error("Saved reporting retry does not match this remediation run and closing plan.");
|
|
1997
|
+
}
|
|
1998
|
+
if (retry.sha256 !== contentSha256([closingResult, verified, retry.context])) {
|
|
1999
|
+
throw new Error("Saved closing result or reporting inputs changed. Cannot retry reporting.");
|
|
2000
|
+
}
|
|
2001
|
+
return reportRecordedClose(verified, options, closingResult, retry.context, runLogger, true);
|
|
2002
|
+
}
|
|
2003
|
+
async function reportRecordedClose(state, options, closingResult, context, runLogger, reportingRetry) {
|
|
2015
2004
|
const recovery = await readRunRecoveryFacts(options.artifactsDir, state);
|
|
2005
|
+
const completed = await finishCloseReport(state, options, closingResult, context, recovery, runLogger, reportingRetry);
|
|
2006
|
+
const resultPath = join(options.artifactsDir, CLOSING_RESULT_FILENAME);
|
|
2007
|
+
if (recovery.read_error === undefined && existsSync(resultPath)) {
|
|
2008
|
+
// A preserved run can still have its old closing state if the final state write failed.
|
|
2009
|
+
// Keep the action receipt available until a restart will see a completed state.
|
|
2010
|
+
const { StateStore } = await import("../state/store.js");
|
|
2011
|
+
const persisted = await new StateStore(options.artifactsDir).loadState();
|
|
2012
|
+
if (persisted?.status === "complete") {
|
|
2013
|
+
await writeJsonFile(resultPath, closingResult);
|
|
2014
|
+
}
|
|
2015
|
+
}
|
|
2016
|
+
return completed;
|
|
2017
|
+
}
|
|
2018
|
+
async function finishCloseReport(state, options, closingResult, { combinedTest, e2eResult, landingGates, contractReviews, endedAt }, recovery, runLogger, reportingRetry = false) {
|
|
2019
|
+
// 5. Generate remediation-report.md and remediation-outcomes.json
|
|
2020
|
+
const entries = collectReportEntries(state);
|
|
2016
2021
|
// Hydrate original coverage-only sources before ANY outcome or verification
|
|
2017
2022
|
// projection. Reading them after building outcomes silently loses excluded
|
|
2018
2023
|
// originals from the otherwise self-contained source report.
|
|
@@ -2026,7 +2031,7 @@ export async function runClosePhase(state, options, runLogger) {
|
|
|
2026
2031
|
// at close would be a duplicate — and `kind: "outcome"` at close means "one
|
|
2027
2032
|
// per finding", which a run-level line would quietly break.
|
|
2028
2033
|
// One run-log line per outcome, plus a summary line for the artifact write.
|
|
2029
|
-
for (const outcome of outcomesReport.outcomes) {
|
|
2034
|
+
for (const outcome of reportingRetry ? [] : outcomesReport.outcomes) {
|
|
2030
2035
|
runLogger?.event({
|
|
2031
2036
|
phase: "close",
|
|
2032
2037
|
kind: "outcome",
|
|
@@ -2034,7 +2039,6 @@ export async function runClosePhase(state, options, runLogger) {
|
|
|
2034
2039
|
note: `${outcome.finding_id} [${outcome.lens}] → ${outcome.outcome} (rework ${outcome.rework_count})`,
|
|
2035
2040
|
});
|
|
2036
2041
|
}
|
|
2037
|
-
const endedAt = new Date().toISOString();
|
|
2038
2042
|
// Workers may have appended opt-in reflections during document/implement
|
|
2039
2043
|
// dispatch; parse leniently (malformed lines skipped) and surface them in the
|
|
2040
2044
|
// report. Workers own the file — it is read-only here.
|
|
@@ -2042,7 +2046,8 @@ export async function runClosePhase(state, options, runLogger) {
|
|
|
2042
2046
|
const closeFeedback = feedbackText
|
|
2043
2047
|
? parseReflectionsNdjson(feedbackText)
|
|
2044
2048
|
: { reflections: [], discarded: [] };
|
|
2045
|
-
|
|
2049
|
+
if (!reportingRetry)
|
|
2050
|
+
reportDiscardedReflections(closeFeedback.discarded, "remediate-code");
|
|
2046
2051
|
const reportContent = buildRemediationReportMarkdown(state, entries, closingResult, e2eResult.ran ? e2eResult.passed : undefined, outcomesReport, combinedTest, closeFeedback.reflections, landingGates);
|
|
2047
2052
|
const outcomesFile = {
|
|
2048
2053
|
...outcomesReport,
|
|
@@ -2057,7 +2062,7 @@ export async function runClosePhase(state, options, runLogger) {
|
|
|
2057
2062
|
},
|
|
2058
2063
|
...(e2eResult.ran ? { e2e_result: { passed: e2eResult.passed } } : {}),
|
|
2059
2064
|
closing_result: {
|
|
2060
|
-
action:
|
|
2065
|
+
action: closingResult.action,
|
|
2061
2066
|
status: closingResult.status,
|
|
2062
2067
|
commands: closingResult.commands,
|
|
2063
2068
|
// Untouched-user-dirt set collectStagingFiles left alone (never staged) —
|
|
@@ -2076,17 +2081,21 @@ export async function runClosePhase(state, options, runLogger) {
|
|
|
2076
2081
|
// here, BEFORE the write, so a refusal leaves none of the four artifacts
|
|
2077
2082
|
// written for a consumer to find much later.
|
|
2078
2083
|
assertValidRemediationOutcomesReport(outcomesFile);
|
|
2079
|
-
const outputDir =
|
|
2080
|
-
//
|
|
2081
|
-
const verificationReport = buildVerificationReport(state, options, closingResult, combinedTest);
|
|
2084
|
+
const outputDir = outputDirFor(options.artifactsDir);
|
|
2085
|
+
// 6. Write verification_report.json for the contract pipeline closing phase.
|
|
2086
|
+
const verificationReport = buildVerificationReport(state, options, closingResult, combinedTest, endedAt);
|
|
2082
2087
|
const verificationReportPath = join(outputDir, "verification_report.json");
|
|
2083
2088
|
const completeState = { ...state, status: "complete" };
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2089
|
+
// Keep the phase lock until every in-flight write settles, including on a reporting retry.
|
|
2090
|
+
const writes = await Promise.allSettled([
|
|
2091
|
+
writeTextFile(join(outputDir, REMEDIATION_REPORT_FILENAME), reportContent),
|
|
2092
|
+
writeJsonFile(join(outputDir, REMEDIATION_OUTCOMES_FILENAME), outcomesFile),
|
|
2087
2093
|
writeJsonFile(verificationReportPath, verificationReport),
|
|
2088
2094
|
writeJsonFile(join(outputDir, "remediation-state.complete.json"), completeState),
|
|
2089
2095
|
]);
|
|
2096
|
+
const failure = writes.find(write => write.status === "rejected");
|
|
2097
|
+
if (failure)
|
|
2098
|
+
throw failure.reason;
|
|
2090
2099
|
runLogger?.event({
|
|
2091
2100
|
phase: "close",
|
|
2092
2101
|
kind: "artifact_write",
|
|
@@ -2109,7 +2118,7 @@ export async function runClosePhase(state, options, runLogger) {
|
|
|
2109
2118
|
note: "complete remediation state preserved for retry/recovery",
|
|
2110
2119
|
});
|
|
2111
2120
|
console.log("Remediation report generated.");
|
|
2112
|
-
//
|
|
2121
|
+
// 7. Persist the final state, then delete the artifacts directory (only when fully green).
|
|
2113
2122
|
await cleanupTempBranchesAndArtifacts(options, completeState, combinedTest, e2eResult, closingResult, runLogger, landingGates, outcomesReport);
|
|
2114
2123
|
return completeState;
|
|
2115
2124
|
}
|