audit-tools 0.51.7 → 0.51.9
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/clarification/blastRadius.d.ts +17 -16
- package/dist/audit/clarification/blastRadius.d.ts.map +1 -1
- package/dist/audit/clarification/blastRadius.js +48 -44
- package/dist/audit/clarification/blastRadius.js.map +1 -1
- package/dist/audit/clarification/dials.d.ts +4 -4
- package/dist/audit/clarification/dials.d.ts.map +1 -1
- package/dist/audit/clarification/dials.js +1 -0
- package/dist/audit/clarification/dials.js.map +1 -1
- package/dist/audit/clarification/partition.d.ts +12 -21
- package/dist/audit/clarification/partition.d.ts.map +1 -1
- package/dist/audit/clarification/partition.js +52 -59
- package/dist/audit/clarification/partition.js.map +1 -1
- package/dist/audit/clarification/riskGate.d.ts +2 -2
- package/dist/audit/clarification/riskGate.d.ts.map +1 -1
- package/dist/audit/clarification/riskGate.js +1 -0
- package/dist/audit/clarification/riskGate.js.map +1 -1
- package/dist/audit/clarification/voiQueue.d.ts +3 -3
- package/dist/audit/clarification/voiQueue.d.ts.map +1 -1
- package/dist/audit/clarification/voiQueue.js +1 -0
- package/dist/audit/clarification/voiQueue.js.map +1 -1
- package/dist/audit/cli/auditStep.d.ts +14 -2
- package/dist/audit/cli/auditStep.d.ts.map +1 -1
- package/dist/audit/cli/auditStep.js +13 -5
- package/dist/audit/cli/auditStep.js.map +1 -1
- package/dist/audit/cli/charterClarificationPrompt.d.ts +6 -9
- package/dist/audit/cli/charterClarificationPrompt.d.ts.map +1 -1
- package/dist/audit/cli/charterClarificationPrompt.js +35 -47
- package/dist/audit/cli/charterClarificationPrompt.js.map +1 -1
- package/dist/audit/cli/charterComparisonPrompt.d.ts +14 -0
- package/dist/audit/cli/charterComparisonPrompt.d.ts.map +1 -0
- package/dist/audit/cli/charterComparisonPrompt.js +111 -0
- package/dist/audit/cli/charterComparisonPrompt.js.map +1 -0
- package/dist/audit/cli/charterExtractionPrompt.d.ts +14 -17
- package/dist/audit/cli/charterExtractionPrompt.d.ts.map +1 -1
- package/dist/audit/cli/charterExtractionPrompt.js +81 -104
- package/dist/audit/cli/charterExtractionPrompt.js.map +1 -1
- package/dist/audit/cli/charterFidelityPrompt.d.ts +14 -0
- package/dist/audit/cli/charterFidelityPrompt.d.ts.map +1 -0
- package/dist/audit/cli/charterFidelityPrompt.js +58 -0
- package/dist/audit/cli/charterFidelityPrompt.js.map +1 -0
- package/dist/audit/cli/conceptualDispatch.d.ts +39 -6
- package/dist/audit/cli/conceptualDispatch.d.ts.map +1 -1
- package/dist/audit/cli/conceptualDispatch.js +59 -12
- 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 +46 -2
- package/dist/audit/cli/confirmIntentStep.js.map +1 -1
- package/dist/audit/cli/dispatch/hostHandoff.d.ts +18 -6
- package/dist/audit/cli/dispatch/hostHandoff.d.ts.map +1 -1
- package/dist/audit/cli/dispatch/hostHandoff.js +525 -67
- package/dist/audit/cli/dispatch/hostHandoff.js.map +1 -1
- package/dist/audit/cli/fanoutLanes.d.ts +24 -0
- package/dist/audit/cli/fanoutLanes.d.ts.map +1 -1
- package/dist/audit/cli/fanoutLanes.js +9 -1
- package/dist/audit/cli/fanoutLanes.js.map +1 -1
- package/dist/audit/cli/foldTransaction.d.ts.map +1 -1
- package/dist/audit/cli/foldTransaction.js +14 -3
- package/dist/audit/cli/foldTransaction.js.map +1 -1
- package/dist/audit/cli/forceSynthesisCommand.d.ts.map +1 -1
- package/dist/audit/cli/forceSynthesisCommand.js +4 -1
- package/dist/audit/cli/forceSynthesisCommand.js.map +1 -1
- package/dist/audit/cli/intakeCommand.d.ts.map +1 -1
- package/dist/audit/cli/intakeCommand.js +1 -0
- package/dist/audit/cli/intakeCommand.js.map +1 -1
- package/dist/audit/cli/laneSubmissions.d.ts +18 -12
- package/dist/audit/cli/laneSubmissions.d.ts.map +1 -1
- package/dist/audit/cli/laneSubmissions.js +40 -4
- package/dist/audit/cli/laneSubmissions.js.map +1 -1
- package/dist/audit/cli/laneValidators.d.ts.map +1 -1
- package/dist/audit/cli/laneValidators.js +14 -14
- package/dist/audit/cli/laneValidators.js.map +1 -1
- package/dist/audit/cli/nextStepCommand.d.ts +7 -0
- package/dist/audit/cli/nextStepCommand.d.ts.map +1 -1
- package/dist/audit/cli/nextStepCommand.js +206 -31
- package/dist/audit/cli/nextStepCommand.js.map +1 -1
- package/dist/audit/cli/nextStepHelpers.d.ts +92 -28
- package/dist/audit/cli/nextStepHelpers.d.ts.map +1 -1
- package/dist/audit/cli/nextStepHelpers.js +363 -126
- package/dist/audit/cli/nextStepHelpers.js.map +1 -1
- package/dist/audit/cli/prompts.d.ts +10 -0
- package/dist/audit/cli/prompts.d.ts.map +1 -1
- package/dist/audit/cli/prompts.js +3 -1
- package/dist/audit/cli/prompts.js.map +1 -1
- package/dist/audit/cli/reviewRun.d.ts +12 -0
- package/dist/audit/cli/reviewRun.d.ts.map +1 -1
- package/dist/audit/cli/reviewRun.js +242 -29
- package/dist/audit/cli/reviewRun.js.map +1 -1
- package/dist/audit/cli/sampleRunCommand.d.ts +12 -4
- package/dist/audit/cli/sampleRunCommand.d.ts.map +1 -1
- package/dist/audit/cli/semanticReviewStep.d.ts +9 -0
- package/dist/audit/cli/semanticReviewStep.d.ts.map +1 -1
- package/dist/audit/cli/semanticReviewStep.js +71 -30
- 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 +29 -66
- package/dist/audit/cli/statusCommand.js.map +1 -1
- package/dist/audit/cli/stepScaffold.d.ts +43 -2
- package/dist/audit/cli/stepScaffold.d.ts.map +1 -1
- package/dist/audit/cli/stepScaffold.js +24 -10
- package/dist/audit/cli/stepScaffold.js.map +1 -1
- package/dist/audit/cli/steps.d.ts +52 -29
- package/dist/audit/cli/steps.d.ts.map +1 -1
- package/dist/audit/cli/steps.js +44 -14
- package/dist/audit/cli/steps.js.map +1 -1
- package/dist/audit/cli/synthesizeCommand.d.ts.map +1 -1
- package/dist/audit/cli/synthesizeCommand.js +4 -1
- package/dist/audit/cli/synthesizeCommand.js.map +1 -1
- package/dist/audit/contracts/workerSchemas.d.ts +65 -16
- package/dist/audit/contracts/workerSchemas.d.ts.map +1 -1
- package/dist/audit/contracts/workerSchemas.js +89 -8
- package/dist/audit/contracts/workerSchemas.js.map +1 -1
- package/dist/audit/contracts/wrapperResponse.d.ts +14 -21
- package/dist/audit/contracts/wrapperResponse.d.ts.map +1 -1
- package/dist/audit/contracts/wrapperResponse.js +0 -1
- package/dist/audit/contracts/wrapperResponse.js.map +1 -1
- package/dist/audit/decompose/findings.d.ts.map +1 -1
- package/dist/audit/decompose/findings.js +10 -2
- package/dist/audit/decompose/findings.js.map +1 -1
- package/dist/audit/extractors/designAssessment.d.ts.map +1 -1
- package/dist/audit/extractors/designAssessment.js +13 -4
- 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 +17 -5
- package/dist/audit/extractors/disposition.js.map +1 -1
- package/dist/audit/extractors/graph.d.ts +1 -1
- package/dist/audit/extractors/graph.js +1 -1
- package/dist/audit/extractors/graphRoutes.d.ts.map +1 -1
- package/dist/audit/extractors/graphRoutes.js +224 -17
- package/dist/audit/extractors/graphRoutes.js.map +1 -1
- package/dist/audit/extractors/leadLineage.d.ts +10 -0
- package/dist/audit/extractors/leadLineage.d.ts.map +1 -0
- package/dist/audit/extractors/leadLineage.js +44 -0
- package/dist/audit/extractors/leadLineage.js.map +1 -0
- package/dist/audit/io/artifacts.d.ts.map +1 -1
- package/dist/audit/io/artifacts.js +25 -8
- package/dist/audit/io/artifacts.js.map +1 -1
- package/dist/audit/io/runArtifacts.d.ts +76 -1
- package/dist/audit/io/runArtifacts.d.ts.map +1 -1
- package/dist/audit/io/runArtifacts.js +113 -20
- package/dist/audit/io/runArtifacts.js.map +1 -1
- package/dist/audit/io/toolingManifest.d.ts +15 -0
- package/dist/audit/io/toolingManifest.d.ts.map +1 -1
- package/dist/audit/io/toolingManifest.js +158 -11
- package/dist/audit/io/toolingManifest.js.map +1 -1
- package/dist/audit/orchestrator/advance.d.ts.map +1 -1
- package/dist/audit/orchestrator/advance.js +30 -4
- package/dist/audit/orchestrator/advance.js.map +1 -1
- package/dist/audit/orchestrator/advanceTypes.d.ts +28 -5
- package/dist/audit/orchestrator/advanceTypes.d.ts.map +1 -1
- package/dist/audit/orchestrator/artifactMetadata.d.ts.map +1 -1
- package/dist/audit/orchestrator/artifactMetadata.js +39 -1
- package/dist/audit/orchestrator/artifactMetadata.js.map +1 -1
- package/dist/audit/orchestrator/auditTaskUtils.d.ts.map +1 -1
- package/dist/audit/orchestrator/auditTaskUtils.js +4 -1
- package/dist/audit/orchestrator/auditTaskUtils.js.map +1 -1
- package/dist/audit/orchestrator/charterClarificationExecutor.d.ts +11 -17
- package/dist/audit/orchestrator/charterClarificationExecutor.d.ts.map +1 -1
- package/dist/audit/orchestrator/charterClarificationExecutor.js +61 -93
- package/dist/audit/orchestrator/charterClarificationExecutor.js.map +1 -1
- package/dist/audit/orchestrator/charterComparisonExecutor.d.ts +24 -0
- package/dist/audit/orchestrator/charterComparisonExecutor.d.ts.map +1 -0
- package/dist/audit/orchestrator/charterComparisonExecutor.js +110 -0
- package/dist/audit/orchestrator/charterComparisonExecutor.js.map +1 -0
- package/dist/audit/orchestrator/charterExtractionExecutor.d.ts +34 -20
- package/dist/audit/orchestrator/charterExtractionExecutor.d.ts.map +1 -1
- package/dist/audit/orchestrator/charterExtractionExecutor.js +80 -106
- package/dist/audit/orchestrator/charterExtractionExecutor.js.map +1 -1
- package/dist/audit/orchestrator/charterFidelityExecutor.d.ts +20 -0
- package/dist/audit/orchestrator/charterFidelityExecutor.d.ts.map +1 -0
- package/dist/audit/orchestrator/charterFidelityExecutor.js +76 -0
- package/dist/audit/orchestrator/charterFidelityExecutor.js.map +1 -0
- package/dist/audit/orchestrator/charterFidelityPacket.d.ts +7 -0
- package/dist/audit/orchestrator/charterFidelityPacket.d.ts.map +1 -0
- package/dist/audit/orchestrator/charterFidelityPacket.js +68 -0
- package/dist/audit/orchestrator/charterFidelityPacket.js.map +1 -0
- package/dist/audit/orchestrator/dependencyMap.d.ts.map +1 -1
- package/dist/audit/orchestrator/dependencyMap.js +9 -8
- package/dist/audit/orchestrator/dependencyMap.js.map +1 -1
- package/dist/audit/orchestrator/dependencySlices.d.ts.map +1 -1
- package/dist/audit/orchestrator/dependencySlices.js +7 -6
- package/dist/audit/orchestrator/dependencySlices.js.map +1 -1
- package/dist/audit/orchestrator/designReviewProjection.d.ts.map +1 -1
- package/dist/audit/orchestrator/designReviewProjection.js +7 -0
- package/dist/audit/orchestrator/designReviewProjection.js.map +1 -1
- package/dist/audit/orchestrator/designReviewPrompt.d.ts.map +1 -1
- package/dist/audit/orchestrator/designReviewPrompt.js +58 -19
- package/dist/audit/orchestrator/designReviewPrompt.js.map +1 -1
- package/dist/audit/orchestrator/executorRunners.d.ts.map +1 -1
- package/dist/audit/orchestrator/executorRunners.js +6 -2
- package/dist/audit/orchestrator/executorRunners.js.map +1 -1
- package/dist/audit/orchestrator/executors.d.ts.map +1 -1
- package/dist/audit/orchestrator/executors.js +22 -8
- package/dist/audit/orchestrator/executors.js.map +1 -1
- package/dist/audit/orchestrator/hostInputPause.js +1 -0
- package/dist/audit/orchestrator/hostInputPause.js.map +1 -1
- package/dist/audit/orchestrator/intentCheckpointExecutor.d.ts +40 -0
- package/dist/audit/orchestrator/intentCheckpointExecutor.d.ts.map +1 -1
- package/dist/audit/orchestrator/intentCheckpointExecutor.js +32 -2
- package/dist/audit/orchestrator/intentCheckpointExecutor.js.map +1 -1
- package/dist/audit/orchestrator/intentCheckpointGate.d.ts +5 -3
- package/dist/audit/orchestrator/intentCheckpointGate.d.ts.map +1 -1
- package/dist/audit/orchestrator/intentCheckpointGate.js +34 -5
- package/dist/audit/orchestrator/intentCheckpointGate.js.map +1 -1
- package/dist/audit/orchestrator/intentEquivalenceExecutor.d.ts +2 -2
- package/dist/audit/orchestrator/intentInterpreter.d.ts +1 -1
- package/dist/audit/orchestrator/intentInterpreter.js +1 -1
- package/dist/audit/orchestrator/nextStep.d.ts.map +1 -1
- package/dist/audit/orchestrator/nextStep.js +3 -1
- package/dist/audit/orchestrator/nextStep.js.map +1 -1
- package/dist/audit/orchestrator/obligationPolicy.d.ts +2 -1
- package/dist/audit/orchestrator/obligationPolicy.d.ts.map +1 -1
- package/dist/audit/orchestrator/obligationPolicy.js +19 -7
- package/dist/audit/orchestrator/obligationPolicy.js.map +1 -1
- package/dist/audit/orchestrator/partitionTaskGraph.d.ts.map +1 -1
- package/dist/audit/orchestrator/partitionTaskGraph.js +1 -0
- package/dist/audit/orchestrator/partitionTaskGraph.js.map +1 -1
- package/dist/audit/orchestrator/resultIngestion.d.ts.map +1 -1
- package/dist/audit/orchestrator/resultIngestion.js +3 -1
- package/dist/audit/orchestrator/resultIngestion.js.map +1 -1
- package/dist/audit/orchestrator/runtimeCommand.d.ts +72 -0
- package/dist/audit/orchestrator/runtimeCommand.d.ts.map +1 -1
- package/dist/audit/orchestrator/runtimeCommand.js +177 -20
- package/dist/audit/orchestrator/runtimeCommand.js.map +1 -1
- package/dist/audit/orchestrator/scopeIndexBaseline.d.ts +56 -0
- package/dist/audit/orchestrator/scopeIndexBaseline.d.ts.map +1 -0
- package/dist/audit/orchestrator/scopeIndexBaseline.js +114 -0
- package/dist/audit/orchestrator/scopeIndexBaseline.js.map +1 -0
- package/dist/audit/orchestrator/staleness.d.ts +70 -1
- package/dist/audit/orchestrator/staleness.d.ts.map +1 -1
- package/dist/audit/orchestrator/staleness.js +171 -21
- 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 +49 -25
- 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 +7 -5
- package/dist/audit/orchestrator/structureExecutors.js.map +1 -1
- package/dist/audit/orchestrator/syntaxResolutionExecutor.d.ts.map +1 -1
- package/dist/audit/orchestrator/syntaxResolutionExecutor.js +1 -0
- package/dist/audit/orchestrator/syntaxResolutionExecutor.js.map +1 -1
- package/dist/audit/orchestrator/systemicChallengeExecutor.d.ts +13 -2
- package/dist/audit/orchestrator/systemicChallengeExecutor.d.ts.map +1 -1
- package/dist/audit/orchestrator/systemicChallengeExecutor.js +166 -12
- package/dist/audit/orchestrator/systemicChallengeExecutor.js.map +1 -1
- package/dist/audit/reporting/mergeFindings.d.ts.map +1 -1
- package/dist/audit/reporting/mergeFindings.js +6 -5
- package/dist/audit/reporting/mergeFindings.js.map +1 -1
- package/dist/audit/reporting/synthesis.d.ts +117 -0
- package/dist/audit/reporting/synthesis.d.ts.map +1 -1
- package/dist/audit/reporting/synthesis.js +277 -10
- package/dist/audit/reporting/synthesis.js.map +1 -1
- package/dist/audit/supervisor/operatorHandoff.d.ts +0 -2
- package/dist/audit/supervisor/operatorHandoff.d.ts.map +1 -1
- package/dist/audit/supervisor/operatorHandoff.js +0 -3
- package/dist/audit/supervisor/operatorHandoff.js.map +1 -1
- package/dist/audit/systemic/coveredThemes.d.ts +28 -0
- package/dist/audit/systemic/coveredThemes.d.ts.map +1 -0
- package/dist/audit/systemic/coveredThemes.js +52 -0
- package/dist/audit/systemic/coveredThemes.js.map +1 -0
- package/dist/audit/systemic/reviewFileMap.d.ts +81 -0
- package/dist/audit/systemic/reviewFileMap.d.ts.map +1 -0
- package/dist/audit/systemic/reviewFileMap.js +169 -0
- package/dist/audit/systemic/reviewFileMap.js.map +1 -0
- package/dist/audit/systemic/secondOrderAdversaryPrompt.d.ts.map +1 -1
- package/dist/audit/systemic/secondOrderAdversaryPrompt.js +149 -26
- package/dist/audit/systemic/secondOrderAdversaryPrompt.js.map +1 -1
- package/dist/audit/systemic/systemicChallengeLoop.d.ts +44 -4
- package/dist/audit/systemic/systemicChallengeLoop.d.ts.map +1 -1
- package/dist/audit/systemic/systemicChallengeLoop.js +114 -10
- package/dist/audit/systemic/systemicChallengeLoop.js.map +1 -1
- package/dist/audit/types/auditState.d.ts +6 -6
- package/dist/audit/types/charterClarification.d.ts +9 -4
- package/dist/audit/types/charterClarification.d.ts.map +1 -1
- package/dist/audit/types/charterRegister.d.ts +48 -93
- package/dist/audit/types/charterRegister.d.ts.map +1 -1
- package/dist/audit/types/charterRegister.js +15 -26
- package/dist/audit/types/charterRegister.js.map +1 -1
- package/dist/audit/types/conceptualAdjudication.d.ts +88 -18
- package/dist/audit/types/conceptualAdjudication.d.ts.map +1 -1
- package/dist/audit/types/conceptualAdjudication.js +77 -16
- package/dist/audit/types/conceptualAdjudication.js.map +1 -1
- package/dist/audit/types/designAssessment.d.ts +8 -6
- package/dist/audit/types/designAssessment.d.ts.map +1 -1
- package/dist/audit/types/reviewPlanning.d.ts +2 -2
- package/dist/audit/types/systemicChallenge.d.ts +43 -7
- package/dist/audit/types/systemicChallenge.d.ts.map +1 -1
- package/dist/audit/types.d.ts +71 -10
- package/dist/audit/types.d.ts.map +1 -1
- package/dist/audit/types.js +23 -2
- package/dist/audit/types.js.map +1 -1
- package/dist/audit/validation/auditResults.d.ts +30 -0
- package/dist/audit/validation/auditResults.d.ts.map +1 -1
- package/dist/audit/validation/auditResults.js +50 -8
- package/dist/audit/validation/auditResults.js.map +1 -1
- package/dist/audit/validation/ingestIssueCodes.d.ts +1 -1
- package/dist/audit/validation/ingestIssueCodes.d.ts.map +1 -1
- package/dist/audit/validation/ingestIssueCodes.js +14 -0
- package/dist/audit/validation/ingestIssueCodes.js.map +1 -1
- package/dist/remediate/contractPipeline/artifactStore.d.ts +97 -2
- package/dist/remediate/contractPipeline/artifactStore.d.ts.map +1 -1
- package/dist/remediate/contractPipeline/artifactStore.js +163 -9
- package/dist/remediate/contractPipeline/artifactStore.js.map +1 -1
- package/dist/remediate/contractPipeline/changeClassification.d.ts.map +1 -1
- package/dist/remediate/contractPipeline/changeClassification.js +93 -3
- package/dist/remediate/contractPipeline/changeClassification.js.map +1 -1
- package/dist/remediate/contractPipeline/cyclicSeamResolution.d.ts.map +1 -1
- package/dist/remediate/contractPipeline/cyclicSeamResolution.js +31 -0
- package/dist/remediate/contractPipeline/cyclicSeamResolution.js.map +1 -1
- package/dist/remediate/contractPipeline/derive.d.ts +0 -14
- package/dist/remediate/contractPipeline/derive.d.ts.map +1 -1
- package/dist/remediate/contractPipeline/derive.js +52 -24
- package/dist/remediate/contractPipeline/derive.js.map +1 -1
- package/dist/remediate/contractPipeline/finalizedContractFields.d.ts +50 -0
- package/dist/remediate/contractPipeline/finalizedContractFields.d.ts.map +1 -0
- package/dist/remediate/contractPipeline/finalizedContractFields.js +77 -0
- package/dist/remediate/contractPipeline/finalizedContractFields.js.map +1 -0
- package/dist/remediate/contractPipeline/idRegistry.d.ts +85 -0
- package/dist/remediate/contractPipeline/idRegistry.d.ts.map +1 -1
- package/dist/remediate/contractPipeline/idRegistry.js +147 -0
- package/dist/remediate/contractPipeline/idRegistry.js.map +1 -1
- package/dist/remediate/contractPipeline/phaseCut.d.ts +13 -16
- package/dist/remediate/contractPipeline/phaseCut.d.ts.map +1 -1
- package/dist/remediate/contractPipeline/phaseCut.js +15 -30
- package/dist/remediate/contractPipeline/phaseCut.js.map +1 -1
- package/dist/remediate/contractPipeline/reviewSnapshot.d.ts +20 -1
- package/dist/remediate/contractPipeline/reviewSnapshot.d.ts.map +1 -1
- package/dist/remediate/contractPipeline/reviewSnapshot.js +23 -7
- package/dist/remediate/contractPipeline/reviewSnapshot.js.map +1 -1
- package/dist/remediate/contractPipeline/semanticProjection.d.ts +17 -0
- package/dist/remediate/contractPipeline/semanticProjection.d.ts.map +1 -1
- package/dist/remediate/contractPipeline/semanticProjection.js +6 -9
- package/dist/remediate/contractPipeline/semanticProjection.js.map +1 -1
- package/dist/remediate/contractPipeline/sketchSource.d.ts +183 -0
- package/dist/remediate/contractPipeline/sketchSource.d.ts.map +1 -0
- package/dist/remediate/contractPipeline/sketchSource.js +255 -0
- package/dist/remediate/contractPipeline/sketchSource.js.map +1 -0
- package/dist/remediate/findingFilter.d.ts.map +1 -1
- package/dist/remediate/findingFilter.js +1 -0
- package/dist/remediate/findingFilter.js.map +1 -1
- package/dist/remediate/index.d.ts +81 -0
- package/dist/remediate/index.d.ts.map +1 -1
- package/dist/remediate/index.js +162 -53
- package/dist/remediate/index.js.map +1 -1
- package/dist/remediate/intake.d.ts +43 -0
- package/dist/remediate/intake.d.ts.map +1 -1
- package/dist/remediate/intake.js +82 -13
- package/dist/remediate/intake.js.map +1 -1
- package/dist/remediate/phases/close.d.ts +33 -2
- package/dist/remediate/phases/close.d.ts.map +1 -1
- package/dist/remediate/phases/close.js +227 -13
- package/dist/remediate/phases/close.js.map +1 -1
- package/dist/remediate/phases/closeVerifyHeadEvidence.d.ts +154 -0
- package/dist/remediate/phases/closeVerifyHeadEvidence.d.ts.map +1 -0
- package/dist/remediate/phases/closeVerifyHeadEvidence.js +242 -0
- package/dist/remediate/phases/closeVerifyHeadEvidence.js.map +1 -0
- package/dist/remediate/state/runStatus.d.ts +35 -0
- package/dist/remediate/state/runStatus.d.ts.map +1 -0
- package/dist/remediate/state/runStatus.js +46 -0
- package/dist/remediate/state/runStatus.js.map +1 -0
- package/dist/remediate/state/store.d.ts +52 -2
- package/dist/remediate/state/store.d.ts.map +1 -1
- package/dist/remediate/state/store.js +124 -21
- package/dist/remediate/state/store.js.map +1 -1
- package/dist/remediate/state/types.d.ts +83 -13
- package/dist/remediate/state/types.d.ts.map +1 -1
- package/dist/remediate/steps/contractPipeline.d.ts +65 -1
- package/dist/remediate/steps/contractPipeline.d.ts.map +1 -1
- package/dist/remediate/steps/contractPipeline.js +302 -85
- package/dist/remediate/steps/contractPipeline.js.map +1 -1
- package/dist/remediate/steps/contractPipelinePrompts.d.ts.map +1 -1
- package/dist/remediate/steps/contractPipelinePrompts.js +58 -21
- package/dist/remediate/steps/contractPipelinePrompts.js.map +1 -1
- package/dist/remediate/steps/dispatch/hostHandoff.d.ts +87 -2
- package/dist/remediate/steps/dispatch/hostHandoff.d.ts.map +1 -1
- package/dist/remediate/steps/dispatch/hostHandoff.js +344 -44
- package/dist/remediate/steps/dispatch/hostHandoff.js.map +1 -1
- package/dist/remediate/steps/finalGate.d.ts +109 -5
- package/dist/remediate/steps/finalGate.d.ts.map +1 -1
- package/dist/remediate/steps/finalGate.js +135 -27
- package/dist/remediate/steps/finalGate.js.map +1 -1
- package/dist/remediate/steps/gateCommands.d.ts +167 -0
- package/dist/remediate/steps/gateCommands.d.ts.map +1 -1
- package/dist/remediate/steps/gateCommands.js +428 -1
- package/dist/remediate/steps/gateCommands.js.map +1 -1
- package/dist/remediate/steps/intakeResolver.d.ts +2 -13
- package/dist/remediate/steps/intakeResolver.d.ts.map +1 -1
- package/dist/remediate/steps/intakeResolver.js +22 -4
- package/dist/remediate/steps/intakeResolver.js.map +1 -1
- package/dist/remediate/steps/nextStep.d.ts +44 -40
- package/dist/remediate/steps/nextStep.d.ts.map +1 -1
- package/dist/remediate/steps/nextStep.js +501 -106
- package/dist/remediate/steps/nextStep.js.map +1 -1
- package/dist/remediate/steps/stepWriter.d.ts +1 -1
- package/dist/remediate/steps/stepWriter.d.ts.map +1 -1
- package/dist/remediate/steps/stepWriter.js +1 -0
- package/dist/remediate/steps/stepWriter.js.map +1 -1
- package/dist/remediate/steps/types.d.ts +32 -1
- package/dist/remediate/steps/types.d.ts.map +1 -1
- package/dist/remediate/steps/types.js +1 -0
- package/dist/remediate/steps/types.js.map +1 -1
- package/dist/remediate/types/options.d.ts +8 -0
- package/dist/remediate/types/options.d.ts.map +1 -1
- package/dist/remediate/utils/fileIntegrity.d.ts +8 -0
- package/dist/remediate/utils/fileIntegrity.d.ts.map +1 -1
- package/dist/remediate/utils/fileIntegrity.js +12 -1
- package/dist/remediate/utils/fileIntegrity.js.map +1 -1
- package/dist/remediate/validation/artifacts.d.ts +1 -1
- package/dist/remediate/validation/artifacts.d.ts.map +1 -1
- package/dist/remediate/validation/artifacts.js +19 -2
- package/dist/remediate/validation/artifacts.js.map +1 -1
- package/dist/remediate/validation/contractPipeline.d.ts.map +1 -1
- package/dist/remediate/validation/contractPipeline.js +26 -39
- package/dist/remediate/validation/contractPipeline.js.map +1 -1
- package/dist/remediate/validation/contractPipelineGates.d.ts +18 -1
- package/dist/remediate/validation/contractPipelineGates.d.ts.map +1 -1
- package/dist/remediate/validation/contractPipelineGates.js +33 -5
- package/dist/remediate/validation/contractPipelineGates.js.map +1 -1
- package/dist/shared/analyzers/acquisitionEngine.d.ts +83 -5
- package/dist/shared/analyzers/acquisitionEngine.d.ts.map +1 -1
- package/dist/shared/analyzers/acquisitionEngine.js +46 -14
- package/dist/shared/analyzers/acquisitionEngine.js.map +1 -1
- package/dist/shared/analyzers/binaryAcquisition.d.ts +35 -2
- package/dist/shared/analyzers/binaryAcquisition.d.ts.map +1 -1
- package/dist/shared/analyzers/binaryAcquisition.js +5 -5
- package/dist/shared/analyzers/binaryAcquisition.js.map +1 -1
- package/dist/shared/analyzers/candidates.d.ts.map +1 -1
- package/dist/shared/analyzers/candidates.js +1 -0
- package/dist/shared/analyzers/candidates.js.map +1 -1
- package/dist/shared/analyzers/clippy.d.ts +9 -1
- package/dist/shared/analyzers/clippy.d.ts.map +1 -1
- package/dist/shared/analyzers/clippy.js +10 -2
- package/dist/shared/analyzers/clippy.js.map +1 -1
- package/dist/shared/analyzers/normalizeExternal.d.ts.map +1 -1
- package/dist/shared/analyzers/normalizeExternal.js +1 -0
- package/dist/shared/analyzers/normalizeExternal.js.map +1 -1
- package/dist/shared/analyzers/rubocop.d.ts +7 -1
- package/dist/shared/analyzers/rubocop.d.ts.map +1 -1
- package/dist/shared/analyzers/rubocop.js +8 -2
- package/dist/shared/analyzers/rubocop.js.map +1 -1
- package/dist/shared/analyzers/types.d.ts +24 -24
- package/dist/shared/analyzers/types.d.ts.map +1 -1
- package/dist/shared/analyzers/types.js +15 -0
- package/dist/shared/analyzers/types.js.map +1 -1
- package/dist/shared/artifactFreshness.d.ts.map +1 -1
- package/dist/shared/artifactFreshness.js +42 -7
- package/dist/shared/artifactFreshness.js.map +1 -1
- package/dist/shared/chunkByBudget.d.ts.map +1 -1
- package/dist/shared/chunkByBudget.js.map +1 -1
- package/dist/shared/continuityScore.d.ts.map +1 -1
- package/dist/shared/continuityScore.js +12 -4
- package/dist/shared/continuityScore.js.map +1 -1
- package/dist/shared/decompose/charterClarification.d.ts +49 -45
- package/dist/shared/decompose/charterClarification.d.ts.map +1 -1
- package/dist/shared/decompose/charterClarification.js +50 -57
- package/dist/shared/decompose/charterClarification.js.map +1 -1
- package/dist/shared/decompose/charterExtraction.d.ts +616 -342
- package/dist/shared/decompose/charterExtraction.d.ts.map +1 -1
- package/dist/shared/decompose/charterExtraction.js +590 -488
- package/dist/shared/decompose/charterExtraction.js.map +1 -1
- package/dist/shared/decompose/contentCoherence.d.ts +36 -2
- package/dist/shared/decompose/contentCoherence.d.ts.map +1 -1
- package/dist/shared/decompose/contentCoherence.js +45 -5
- package/dist/shared/decompose/contentCoherence.js.map +1 -1
- package/dist/shared/decompose/modularity.d.ts +98 -1
- package/dist/shared/decompose/modularity.d.ts.map +1 -1
- package/dist/shared/decompose/modularity.js +89 -8
- package/dist/shared/decompose/modularity.js.map +1 -1
- package/dist/shared/decompose/systemicChallenge.d.ts +111 -0
- package/dist/shared/decompose/systemicChallenge.d.ts.map +1 -1
- package/dist/shared/decompose/systemicChallenge.js +28 -0
- package/dist/shared/decompose/systemicChallenge.js.map +1 -1
- package/dist/shared/engine/obligationEngine.d.ts +2 -2
- package/dist/shared/engine/obligationEngine.d.ts.map +1 -1
- package/dist/shared/engine/obligationEngine.js +8 -2
- package/dist/shared/engine/obligationEngine.js.map +1 -1
- package/dist/shared/findingSimilarity.d.ts +8 -0
- package/dist/shared/findingSimilarity.d.ts.map +1 -1
- package/dist/shared/findingSimilarity.js +10 -3
- package/dist/shared/findingSimilarity.js.map +1 -1
- package/dist/shared/findings/dedupe.d.ts +15 -0
- package/dist/shared/findings/dedupe.d.ts.map +1 -1
- package/dist/shared/findings/dedupe.js +137 -1
- package/dist/shared/findings/dedupe.js.map +1 -1
- package/dist/shared/friction/frictionRecord.d.ts.map +1 -1
- package/dist/shared/friction/frictionRecord.js +14 -1
- package/dist/shared/friction/frictionRecord.js.map +1 -1
- package/dist/shared/friction/triage.d.ts +4 -0
- package/dist/shared/friction/triage.d.ts.map +1 -1
- package/dist/shared/friction/triage.js +41 -29
- package/dist/shared/friction/triage.js.map +1 -1
- package/dist/shared/git.d.ts +14 -0
- package/dist/shared/git.d.ts.map +1 -1
- package/dist/shared/git.js +22 -0
- package/dist/shared/git.js.map +1 -1
- package/dist/shared/index.d.ts +42 -38
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +35 -23
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/intent/clauseBoundaries.d.ts +75 -0
- package/dist/shared/intent/clauseBoundaries.d.ts.map +1 -0
- package/dist/shared/intent/clauseBoundaries.js +134 -0
- package/dist/shared/intent/clauseBoundaries.js.map +1 -0
- package/dist/shared/intent/clauseInterpreter.d.ts +11 -5
- package/dist/shared/intent/clauseInterpreter.d.ts.map +1 -1
- package/dist/shared/intent/clauseInterpreter.js +16 -41
- package/dist/shared/intent/clauseInterpreter.js.map +1 -1
- package/dist/shared/intent/freeFormIntentInterpreter.d.ts +11 -0
- package/dist/shared/intent/freeFormIntentInterpreter.d.ts.map +1 -1
- package/dist/shared/intent/freeFormIntentInterpreter.js +31 -17
- package/dist/shared/intent/freeFormIntentInterpreter.js.map +1 -1
- package/dist/shared/io/fileLock.d.ts.map +1 -1
- package/dist/shared/io/fileLock.js +18 -6
- package/dist/shared/io/fileLock.js.map +1 -1
- package/dist/shared/io/frictionCapture.d.ts +25 -5
- package/dist/shared/io/frictionCapture.d.ts.map +1 -1
- package/dist/shared/io/frictionCapture.js +30 -9
- package/dist/shared/io/frictionCapture.js.map +1 -1
- package/dist/shared/io/schemaVersion.d.ts +4 -3
- package/dist/shared/io/schemaVersion.d.ts.map +1 -1
- package/dist/shared/io/schemaVersion.js +27 -4
- package/dist/shared/io/schemaVersion.js.map +1 -1
- package/dist/shared/io/stepContractWriter.d.ts +38 -4
- package/dist/shared/io/stepContractWriter.d.ts.map +1 -1
- package/dist/shared/io/stepContractWriter.js +59 -1
- package/dist/shared/io/stepContractWriter.js.map +1 -1
- package/dist/shared/loopCorePaths.d.ts.map +1 -1
- package/dist/shared/loopCorePaths.js +8 -0
- package/dist/shared/loopCorePaths.js.map +1 -1
- package/dist/shared/opencodePermissions.d.ts +27 -3
- package/dist/shared/opencodePermissions.d.ts.map +1 -1
- package/dist/shared/opencodePermissions.js +77 -26
- package/dist/shared/opencodePermissions.js.map +1 -1
- package/dist/shared/prompts.d.ts +12 -1
- package/dist/shared/prompts.d.ts.map +1 -1
- package/dist/shared/prompts.js +11 -1
- package/dist/shared/prompts.js.map +1 -1
- package/dist/shared/reReview/projectionDiff.d.ts +13 -0
- package/dist/shared/reReview/projectionDiff.d.ts.map +1 -1
- package/dist/shared/reReview/projectionDiff.js +1 -1
- package/dist/shared/reReview/projectionDiff.js.map +1 -1
- package/dist/shared/reporting/findingDisplay.d.ts +7 -0
- package/dist/shared/reporting/findingDisplay.d.ts.map +1 -1
- package/dist/shared/reporting/findingDisplay.js +8 -1
- package/dist/shared/reporting/findingDisplay.js.map +1 -1
- package/dist/shared/steps/stepEmissionScaffold.d.ts +15 -3
- package/dist/shared/steps/stepEmissionScaffold.d.ts.map +1 -1
- package/dist/shared/steps/stepEmissionScaffold.js +8 -6
- package/dist/shared/steps/stepEmissionScaffold.js.map +1 -1
- package/dist/shared/submission/hostHandoffCore.d.ts +37 -12
- package/dist/shared/submission/hostHandoffCore.d.ts.map +1 -1
- package/dist/shared/submission/hostHandoffCore.js +81 -18
- package/dist/shared/submission/hostHandoffCore.js.map +1 -1
- package/dist/shared/submission/hostResultOutcomes.d.ts +70 -1
- package/dist/shared/submission/hostResultOutcomes.d.ts.map +1 -1
- package/dist/shared/submission/hostResultOutcomes.js +66 -1
- package/dist/shared/submission/hostResultOutcomes.js.map +1 -1
- package/dist/shared/submission/submissionLedger.d.ts +86 -1
- package/dist/shared/submission/submissionLedger.d.ts.map +1 -1
- package/dist/shared/submission/submissionLedger.js +108 -0
- package/dist/shared/submission/submissionLedger.js.map +1 -1
- package/dist/shared/submission/submissionScan.d.ts.map +1 -1
- package/dist/shared/submission/submissionScan.js +1 -0
- package/dist/shared/submission/submissionScan.js.map +1 -1
- package/dist/shared/tooling/analyzerDeps.d.ts +14 -0
- package/dist/shared/tooling/analyzerDeps.d.ts.map +1 -1
- package/dist/shared/tooling/analyzerDeps.js +23 -0
- package/dist/shared/tooling/analyzerDeps.js.map +1 -1
- package/dist/shared/tooling/commandShape.d.ts +35 -1
- package/dist/shared/tooling/commandShape.d.ts.map +1 -1
- package/dist/shared/tooling/commandShape.js +66 -4
- package/dist/shared/tooling/commandShape.js.map +1 -1
- package/dist/shared/tooling/exec.d.ts +62 -4
- package/dist/shared/tooling/exec.d.ts.map +1 -1
- package/dist/shared/tooling/exec.js +127 -8
- package/dist/shared/tooling/exec.js.map +1 -1
- package/dist/shared/types/charter.d.ts +674 -156
- package/dist/shared/types/charter.d.ts.map +1 -1
- package/dist/shared/types/charter.js +172 -118
- package/dist/shared/types/charter.js.map +1 -1
- package/dist/shared/types/closingActions.d.ts +25 -0
- package/dist/shared/types/closingActions.d.ts.map +1 -1
- package/dist/shared/types/closingActions.js +26 -0
- package/dist/shared/types/closingActions.js.map +1 -1
- package/dist/shared/types/contractPipeline/obligations.d.ts +63 -2
- package/dist/shared/types/contractPipeline/obligations.d.ts.map +1 -1
- package/dist/shared/types/contractPipeline/obligations.js +51 -0
- package/dist/shared/types/contractPipeline/obligations.js.map +1 -1
- package/dist/shared/types/contractPipeline.d.ts +1 -0
- package/dist/shared/types/contractPipeline.d.ts.map +1 -1
- package/dist/shared/types/contractPipeline.js +1 -0
- package/dist/shared/types/contractPipeline.js.map +1 -1
- package/dist/shared/types/contractPropertyShapes.d.ts +34 -0
- package/dist/shared/types/contractPropertyShapes.d.ts.map +1 -0
- package/dist/shared/types/contractPropertyShapes.js +255 -0
- package/dist/shared/types/contractPropertyShapes.js.map +1 -0
- package/dist/shared/types/finding.d.ts +376 -18
- package/dist/shared/types/finding.d.ts.map +1 -1
- package/dist/shared/types/finding.js +111 -0
- package/dist/shared/types/finding.js.map +1 -1
- package/dist/shared/types/intentCheckpoint.d.ts +214 -2
- package/dist/shared/types/intentCheckpoint.d.ts.map +1 -1
- package/dist/shared/types/intentCheckpoint.js +273 -0
- package/dist/shared/types/intentCheckpoint.js.map +1 -1
- package/dist/shared/types/intentInterpretation.d.ts +1 -1
- package/dist/shared/types/intentInterpretation.js +1 -1
- package/dist/shared/types/remediationOutcome.d.ts +294 -30
- package/dist/shared/types/remediationOutcome.d.ts.map +1 -1
- package/dist/shared/types/remediationOutcome.js +96 -7
- package/dist/shared/types/remediationOutcome.js.map +1 -1
- package/dist/shared/types/stepContract.d.ts +47 -0
- package/dist/shared/types/stepContract.d.ts.map +1 -1
- package/dist/shared/types/stepContract.js +113 -0
- package/dist/shared/types/stepContract.js.map +1 -1
- package/dist/shared/validation/charterGate.d.ts +13 -28
- package/dist/shared/validation/charterGate.d.ts.map +1 -1
- package/dist/shared/validation/charterGate.js +13 -35
- package/dist/shared/validation/charterGate.js.map +1 -1
- package/dist/shared/validation/contractConstructionSites.d.ts +116 -0
- package/dist/shared/validation/contractConstructionSites.d.ts.map +1 -0
- package/dist/shared/validation/contractConstructionSites.js +277 -0
- package/dist/shared/validation/contractConstructionSites.js.map +1 -0
- package/dist/shared/validation/designFindingGrounding.d.ts +33 -4
- package/dist/shared/validation/designFindingGrounding.d.ts.map +1 -1
- package/dist/shared/validation/designFindingGrounding.js +40 -6
- package/dist/shared/validation/designFindingGrounding.js.map +1 -1
- package/dist/shared/validation/findingGrounding.d.ts.map +1 -1
- package/dist/shared/validation/findingGrounding.js +11 -1
- package/dist/shared/validation/findingGrounding.js.map +1 -1
- package/dist/shared/validation/findingsReport.d.ts.map +1 -1
- package/dist/shared/validation/findingsReport.js +5 -0
- package/dist/shared/validation/findingsReport.js.map +1 -1
- package/docs/audit-pkg/contracts.md +8 -2
- package/opencode.json +29 -29
- package/package.json +16 -3
- package/schemas/audit-code-v1alpha1.schema.json +0 -4
- package/scripts/audit/postinstall.mjs +81 -96
- package/scripts/remediate/postinstall.mjs +43 -83
- package/scripts/shared/host-asset-plan.mjs +176 -0
- package/scripts/shared/install-host-assets.mjs +44 -1
- package/scripts/shared/primitives.mjs +89 -0
- package/skills/audit-code/SKILL.md +4 -4
- package/skills/audit-code/audit-code.prompt.md +14 -10
- package/skills/remediate-code/SKILL.md +9 -5
- package/skills/remediate-code/remediate-code.prompt.md +11 -4
- package/wrapper/audit-code-wrapper-build.mjs +6 -3
- package/dist/audit/cli/charterDeltaPrompt.d.ts +0 -18
- package/dist/audit/cli/charterDeltaPrompt.d.ts.map +0 -1
- package/dist/audit/cli/charterDeltaPrompt.js +0 -150
- package/dist/audit/cli/charterDeltaPrompt.js.map +0 -1
- package/dist/audit/orchestrator/charterDeltaExecutor.d.ts +0 -24
- package/dist/audit/orchestrator/charterDeltaExecutor.d.ts.map +0 -1
- package/dist/audit/orchestrator/charterDeltaExecutor.js +0 -128
- package/dist/audit/orchestrator/charterDeltaExecutor.js.map +0 -1
- package/dist/audit/supervisor/runLedger.d.ts +0 -3
- package/dist/audit/supervisor/runLedger.d.ts.map +0 -1
- package/dist/audit/supervisor/runLedger.js +0 -69
- package/dist/audit/supervisor/runLedger.js.map +0 -1
- package/dist/shared/types/executionRecord.d.ts +0 -58
- package/dist/shared/types/executionRecord.d.ts.map +0 -1
- package/dist/shared/types/executionRecord.js +0 -26
- package/dist/shared/types/executionRecord.js.map +0 -1
- package/dist/shared/types/runLedger.d.ts +0 -17
- package/dist/shared/types/runLedger.d.ts.map +0 -1
- package/dist/shared/types/runLedger.js +0 -7
- package/dist/shared/types/runLedger.js.map +0 -1
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import type { Evidence } from "../../shared/types/remediationOutcome.js";
|
|
2
|
+
import type { Finding, PerFindingDisposition, RemediationItemState } from "../state/types.js";
|
|
3
|
+
/**
|
|
4
|
+
* CDC-25/CDC-26 (INV-ISC-EVIDENCE-EMITTED) — the PRODUCER for the two
|
|
5
|
+
* evidence-bearing terminal dispositions. `verified_already_fixed` and
|
|
6
|
+
* `refuted` are reachable from a real run ONLY through
|
|
7
|
+
* `RemediationItemState.disposition_override`, and the writer
|
|
8
|
+
* (`buildRemediationOutcomesReport` in `close.ts`) refuses that override unless
|
|
9
|
+
* the item also carries a complete `evidence` triple and the module stamp that
|
|
10
|
+
* recorded it. Nothing wrote those three fields, so both dispositions were
|
|
11
|
+
* dead letters: the only route from a determination to run state was a human
|
|
12
|
+
* transcribing a markdown document no code reads.
|
|
13
|
+
*
|
|
14
|
+
* This leg is that producer, and it is a REAL determination rather than a
|
|
15
|
+
* record of one: it re-reads the finding's own CITED location at TWO refs and
|
|
16
|
+
* decides from what it read. The triple it records names the file and the line
|
|
17
|
+
* it actually read (that is the whole content of INV-ISC-EVIDENCE-EMITTED — the
|
|
18
|
+
* recorded triple must name what was read), so a triple naming a location this
|
|
19
|
+
* leg never opened cannot be produced here.
|
|
20
|
+
*
|
|
21
|
+
* ── WHY TWO READS, NEVER ONE ────────────────────────────────────────────────
|
|
22
|
+
* Let B be the commit the AUDIT read when it produced the finding, and HEAD the
|
|
23
|
+
* commit the fix has landed on by the time this leg runs (close.ts executes the
|
|
24
|
+
* closing action BEFORE its verify legs, so HEAD contains the remediation
|
|
25
|
+
* result — the same point `verifyAnalyzerLeads` and the combined-test leg
|
|
26
|
+
* read). A read at HEAD ALONE cannot support either verdict:
|
|
27
|
+
*
|
|
28
|
+
* span at B | span at HEAD | result
|
|
29
|
+
* ----------|--------------|------------------------------------------
|
|
30
|
+
* present | absent | `verified_already_fixed` — the code the audit
|
|
31
|
+
* | | read is gone; the fix landed.
|
|
32
|
+
* absent | (any) | `refuted` — the audit read a location that
|
|
33
|
+
* | | never showed the span it quoted.
|
|
34
|
+
* present | present | WITHHELD — the cited code still stands, so
|
|
35
|
+
* | | this leg makes no determination at all.
|
|
36
|
+
* B unknown/unreadable | WITHHELD, with the reason.
|
|
37
|
+
*
|
|
38
|
+
* The single-read form this leg used to carry was WRONG in both directions, and
|
|
39
|
+
* the two errors were mirror images. It called "span still present at HEAD"
|
|
40
|
+
* `refuted` on the stated ground that "the cited location never showed the
|
|
41
|
+
* defect" — an inference no read at HEAD can make. A span still standing proves
|
|
42
|
+
* only that the code the finding quoted is still there; if the defect was real
|
|
43
|
+
* when the audit read it, it is still real. Symmetrically it called "span absent
|
|
44
|
+
* at HEAD" `verified_already_fixed`, when an absent span has TWO causes: the
|
|
45
|
+
* code changed after the audit read it (the fix landed), or the span was never
|
|
46
|
+
* in the file (a misquote — the `refuted` case). B is what tells them apart, so
|
|
47
|
+
* without B neither verdict is reachable and every candidate is withheld.
|
|
48
|
+
*
|
|
49
|
+
* ── WHERE B COMES FROM, AND WHY IT IS USUALLY UNKNOWN ───────────────────────
|
|
50
|
+
* B must be a commit the AUDIT itself recorded. A remediation-side commit is
|
|
51
|
+
* NOT B: code can change between the audit and the remediation run, so a span
|
|
52
|
+
* absent at the remediation's own start could be a fix made in between rather
|
|
53
|
+
* than a misquote — the very confusion this leg exists to avoid. The obvious
|
|
54
|
+
* candidate, the host-handoff `baseline_commit`, is exactly that remediation-
|
|
55
|
+
* side value and is therefore refused here BY NAME.
|
|
56
|
+
*
|
|
57
|
+
* The audit-side search (the findings contract and `Finding` schema, the report
|
|
58
|
+
* intake path, `intake.ts`, `plan.ts`) finds no recorded upstream commit: the
|
|
59
|
+
* `Finding` fields are the quote grounding (`quoted_text`), the plan-time
|
|
60
|
+
* content hash (`hash_at_plan_time`, stamped by the REMEDIATOR at plan time),
|
|
61
|
+
* the evidence lane, the verification status and the analyzer provenance —
|
|
62
|
+
* none of which is a rev. `audit-findings.json`'s only envelope fields are
|
|
63
|
+
* `contract_version` and the derived `summary`. The audit artifacts that DO
|
|
64
|
+
* carry a rev (`artifact_metadata.git_history_baseline.head`) are internal
|
|
65
|
+
* staleness caches and are never promoted into the deliverable the remediator
|
|
66
|
+
* consumes. So at the time this leg was written B was UNKNOWN on every real
|
|
67
|
+
* run, and every candidate resolved to WITHHELD.
|
|
68
|
+
*
|
|
69
|
+
* The resolution is NOT to invent a B and not to keep the false single-read
|
|
70
|
+
* rule: it is to make B an OPTIONAL INPUT with a RESOLVER SEAM, so the rule
|
|
71
|
+
* above is the shipped rule and a later packet that stamps the audit's rev only
|
|
72
|
+
* has to supply the value. `HeadEvidenceOverrides.findingBase` is that seam.
|
|
73
|
+
* Absent means "no B was supplied"; a caller that supplies one gets the
|
|
74
|
+
* two-read determination, and any B that does not resolve to a real commit in
|
|
75
|
+
* this repo is refused as unknown rather than read.
|
|
76
|
+
*
|
|
77
|
+
* PROVENANCE IS STRUCTURAL. Only `resolved_no_change` items are considered: the
|
|
78
|
+
* host has already asserted "I changed nothing because nothing needed
|
|
79
|
+
* changing", so this leg CONFIRMS or leaves that assertion standing — it can
|
|
80
|
+
* never manufacture a disposition for an item nobody resolved. The outcome is
|
|
81
|
+
* then still subject to the writer's own backstop, which refuses a triple whose
|
|
82
|
+
* mechanism contradicts the disposition (`mechanismContradictsOutcome`) or that
|
|
83
|
+
* arrives incomplete; a mechanism/disposition pair is reachable here only
|
|
84
|
+
* because the branch above chose both together.
|
|
85
|
+
*
|
|
86
|
+
* It is a close-gate VERIFY leg, never a `CLOSING_ACTIONS` entry: it runs
|
|
87
|
+
* beside `verifyAnalyzerLeads`, dispatches no host work, and a run with no
|
|
88
|
+
* qualifying item is a no-op.
|
|
89
|
+
*/
|
|
90
|
+
/**
|
|
91
|
+
* The commit the AUDIT read when it produced the findings — the `B` of the
|
|
92
|
+
* two-read rule above. Production passes none: nothing in the audit contract
|
|
93
|
+
* records one (see the module header), so a real run resolves to WITHHELD
|
|
94
|
+
* rather than to a fabricated verdict.
|
|
95
|
+
*/
|
|
96
|
+
export interface FindingBase {
|
|
97
|
+
/** Full commit id the audit read. Resolved against the repo before use. */
|
|
98
|
+
commit: string;
|
|
99
|
+
}
|
|
100
|
+
export interface HeadEvidenceOverrides {
|
|
101
|
+
/**
|
|
102
|
+
* Test-injectable source; production callers pass none. Reads one file's
|
|
103
|
+
* content at a ref — the seam BOTH of the leg's reads go through, so a test
|
|
104
|
+
* can drive the two-read rule without a second commit on disk.
|
|
105
|
+
*/
|
|
106
|
+
readAtRef?: (root: string, ref: string, file: string) => Promise<string | undefined>;
|
|
107
|
+
/**
|
|
108
|
+
* The audit-read commit `B`, when a caller has one. Absent (the production
|
|
109
|
+
* default) means B is unknown and no candidate can be determined.
|
|
110
|
+
*/
|
|
111
|
+
findingBase?: FindingBase;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* One candidate item's fate. A withheld record deliberately carries no
|
|
115
|
+
* `disposition`/`evidence`: it is the statement that NEITHER was determined,
|
|
116
|
+
* and giving it a triple would be giving it the very shape this whole leg
|
|
117
|
+
* exists to keep meaningful.
|
|
118
|
+
*/
|
|
119
|
+
export type HeadEvidenceRecord = {
|
|
120
|
+
finding_id: string;
|
|
121
|
+
determined: true;
|
|
122
|
+
disposition: PerFindingDisposition;
|
|
123
|
+
evidence: Evidence;
|
|
124
|
+
} | {
|
|
125
|
+
finding_id: string;
|
|
126
|
+
determined: false;
|
|
127
|
+
/** Why an item that qualified was NOT determined — recorded, never silent. */
|
|
128
|
+
reason: string;
|
|
129
|
+
};
|
|
130
|
+
export interface HeadEvidenceOutcome {
|
|
131
|
+
/** False when no item was a candidate (leg is a no-op). */
|
|
132
|
+
ran: boolean;
|
|
133
|
+
/** The commit this leg's HEAD reads were made against; null when HEAD did not resolve. */
|
|
134
|
+
head: string | null;
|
|
135
|
+
/** The audit-read commit `B`, when one was supplied AND resolved; null otherwise. */
|
|
136
|
+
base: string | null;
|
|
137
|
+
/** Per finding_id, the triple + disposition this leg RECORDED onto the item. */
|
|
138
|
+
recorded: Record<string, HeadEvidenceRecord>;
|
|
139
|
+
/** Candidate items the leg declined to determine, with the reason. */
|
|
140
|
+
withheld: HeadEvidenceRecord[];
|
|
141
|
+
}
|
|
142
|
+
/** The module stamp carried into `recorded_by_module` (the ATTRIBUTION ROUND-TRIP). */
|
|
143
|
+
export declare const HEAD_EVIDENCE_MODULE = "closeVerifyHeadEvidence";
|
|
144
|
+
export declare function verifyHeadEvidenceAgainstFindings(params: {
|
|
145
|
+
state: {
|
|
146
|
+
plan?: {
|
|
147
|
+
findings?: Finding[];
|
|
148
|
+
} | undefined;
|
|
149
|
+
items?: Record<string, RemediationItemState> | undefined;
|
|
150
|
+
};
|
|
151
|
+
root: string;
|
|
152
|
+
overrides?: HeadEvidenceOverrides;
|
|
153
|
+
}): Promise<HeadEvidenceOutcome>;
|
|
154
|
+
//# sourceMappingURL=closeVerifyHeadEvidence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"closeVerifyHeadEvidence.d.ts","sourceRoot":"","sources":["../../../src/remediate/phases/closeVerifyHeadEvidence.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,KAAK,EAAE,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsFG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,2EAA2E;IAC3E,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IAC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yF/B"}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { enumerateTrackedFilePaths, fileContentAtRef, gitRefExists, headCommit, isBareBasename, normalizeForMatch, quoteMatches, resolveBasenameToTrackedPath, stripEmittedLinePrefix, toPosixPath, } from "audit-tools/shared";
|
|
2
|
+
const NO_OP = {
|
|
3
|
+
ran: false,
|
|
4
|
+
head: null,
|
|
5
|
+
base: null,
|
|
6
|
+
recorded: {},
|
|
7
|
+
withheld: [],
|
|
8
|
+
};
|
|
9
|
+
/** The module stamp carried into `recorded_by_module` (the ATTRIBUTION ROUND-TRIP). */
|
|
10
|
+
export const HEAD_EVIDENCE_MODULE = "closeVerifyHeadEvidence";
|
|
11
|
+
/**
|
|
12
|
+
* How wide an emitted `NNN| ` line prefix this leg will strip when asking
|
|
13
|
+
* whether a quote is absent. The emitter's own widths are per-delivery, and no
|
|
14
|
+
* delivery manifest reaches close — so rather than guess one width, the leg
|
|
15
|
+
* strips the widest prefix the emitted form can carry. That direction is the
|
|
16
|
+
* safe one: over-stripping can only turn a "present" into a withheld record,
|
|
17
|
+
* never an absent into a false `verified_already_fixed`.
|
|
18
|
+
*/
|
|
19
|
+
const PREFIX_WIDTH_MAX = 8;
|
|
20
|
+
/** Which cited anchor this leg will read, or `undefined` when none carries a quoted span. */
|
|
21
|
+
function anchorFor(finding) {
|
|
22
|
+
for (const location of finding.affected_files ?? []) {
|
|
23
|
+
const quoted = location.quoted_text;
|
|
24
|
+
if (typeof quoted === "string" && quoted.trim().length > 0) {
|
|
25
|
+
return { path: location.path, quoted };
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
/** The cited 1-based line the triple names, or `""` when the finding cites no line. */
|
|
31
|
+
function citedLineLabel(finding) {
|
|
32
|
+
for (const location of finding.affected_files ?? []) {
|
|
33
|
+
if (location.line_start === undefined)
|
|
34
|
+
continue;
|
|
35
|
+
const end = location.line_end ?? location.line_start;
|
|
36
|
+
return end === location.line_start ? `${location.line_start}` : `${location.line_start}-${end}`;
|
|
37
|
+
}
|
|
38
|
+
return "";
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Resolve a cited path to the repo-relative path it names, or `undefined` when
|
|
42
|
+
* nothing is there. A bare basename resolves against the tracked corpus exactly
|
|
43
|
+
* as the grounding pass resolves it (INV-B3-3), so a nested `advance.ts` is not
|
|
44
|
+
* false-negatived into looking like a phantom path.
|
|
45
|
+
*/
|
|
46
|
+
function resolveCitedFile(cited, corpus) {
|
|
47
|
+
const trimmed = cited.trim();
|
|
48
|
+
if (trimmed.length === 0)
|
|
49
|
+
return undefined;
|
|
50
|
+
if (!isBareBasename(trimmed))
|
|
51
|
+
return toPosixPath(trimmed);
|
|
52
|
+
return resolveBasenameToTrackedPath(trimmed, corpus);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Whether a quoted span is present in `content` — the ONE predicate both reads
|
|
56
|
+
* go through, so B and HEAD cannot disagree about what "present" means, and
|
|
57
|
+
* neither can drift from the grounding pass whose identical test admitted the
|
|
58
|
+
* finding (S7 tier-1).
|
|
59
|
+
*
|
|
60
|
+
* The emitted-`NNN| `-prefix branch strips the QUOTE, not the content, exactly
|
|
61
|
+
* as `checkCitations` does (`quoteMatches(content, stripEmittedLinePrefix(quote,
|
|
62
|
+
* width))`) — the prefix is attached to the span the worker was shown, so it
|
|
63
|
+
* rides the quote. Stripping the CONTENT instead is not the same operation and
|
|
64
|
+
* is silently wrong: it de-prefixes the file's other lines rather than the
|
|
65
|
+
* quote's, so a quote that was genuinely recoverable reads as absent.
|
|
66
|
+
*
|
|
67
|
+
* The ambiguity is applied to BOTH reads, not only to HEAD: a quote the emitted
|
|
68
|
+
* prefix was not stripped from reads as ABSENT under the raw test even when the
|
|
69
|
+
* code is right there, so admitting that shape on one side and not the other
|
|
70
|
+
* would let the prefix alone manufacture a verdict.
|
|
71
|
+
*/
|
|
72
|
+
function spanPresence(content, quoted) {
|
|
73
|
+
if (normalizeForMatch(quoted).length === 0) {
|
|
74
|
+
return { kind: "withheld", reason: "the cited quoted_text span is empty after normalization" };
|
|
75
|
+
}
|
|
76
|
+
if (quoteMatches(content, quoted))
|
|
77
|
+
return { kind: "present" };
|
|
78
|
+
if (quoteMatches(content, stripEmittedLinePrefix(quoted, PREFIX_WIDTH_MAX))) {
|
|
79
|
+
return { kind: "ambiguous" };
|
|
80
|
+
}
|
|
81
|
+
return { kind: "absent" };
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Determine one item from its finding's own cited anchor, read at BOTH B and
|
|
85
|
+
* HEAD. Returns the disposition + triple, or a reason why no determination was
|
|
86
|
+
* possible.
|
|
87
|
+
*/
|
|
88
|
+
async function determine(params) {
|
|
89
|
+
const { root, head, base, corpus, finding, readAtRef } = params;
|
|
90
|
+
const anchor = anchorFor(finding);
|
|
91
|
+
if (!anchor) {
|
|
92
|
+
// Too little evidence to decide. Stated, never guessed at: this is the
|
|
93
|
+
// per-file lane's normal shape (it carries an `evidence` array, not
|
|
94
|
+
// `quoted_text` spans), so the leg must decline rather than infer a defect
|
|
95
|
+
// claim out of prose the finding never bound to a location.
|
|
96
|
+
return { withheld: "the finding carries no verbatim quoted_text span on any cited location" };
|
|
97
|
+
}
|
|
98
|
+
const file = resolveCitedFile(anchor.path, corpus);
|
|
99
|
+
if (!file) {
|
|
100
|
+
return { withheld: `cited path '${anchor.path}' does not resolve to a tracked file` };
|
|
101
|
+
}
|
|
102
|
+
const shortHead = head.slice(0, 12);
|
|
103
|
+
const baseContent = await readAtRef(root, base, file);
|
|
104
|
+
if (baseContent === undefined) {
|
|
105
|
+
return { withheld: `'${file}' is not a readable file at the audit-read commit ${base.slice(0, 12)}` };
|
|
106
|
+
}
|
|
107
|
+
const basePresence = spanPresence(baseContent, anchor.quoted);
|
|
108
|
+
if (basePresence.kind === "withheld")
|
|
109
|
+
return { withheld: basePresence.reason };
|
|
110
|
+
if (basePresence.kind === "ambiguous") {
|
|
111
|
+
return {
|
|
112
|
+
withheld: "the cited span matches at the audit-read commit only after stripping an emitted line prefix, so its presence there cannot be established",
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
const line = citedLineLabel(finding);
|
|
116
|
+
if (basePresence.kind === "present") {
|
|
117
|
+
const headContent = await readAtRef(root, head, file);
|
|
118
|
+
if (headContent === undefined) {
|
|
119
|
+
return { withheld: `'${file}' is not a readable file at HEAD` };
|
|
120
|
+
}
|
|
121
|
+
const headPresence = spanPresence(headContent, anchor.quoted);
|
|
122
|
+
if (headPresence.kind === "withheld")
|
|
123
|
+
return { withheld: headPresence.reason };
|
|
124
|
+
if (headPresence.kind === "ambiguous") {
|
|
125
|
+
return {
|
|
126
|
+
withheld: "the cited span matches at HEAD only after stripping an emitted line prefix, so its absence there cannot be established",
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
if (headPresence.kind === "present") {
|
|
130
|
+
// The code the finding quoted still stands at both reads. That is not a
|
|
131
|
+
// refutation: a span still present proves only that the code is still
|
|
132
|
+
// there — if the defect was real at B, it is still real at HEAD. This leg
|
|
133
|
+
// makes no claim about the English of the finding, so it declines.
|
|
134
|
+
return {
|
|
135
|
+
withheld: `the cited span is present both at the audit-read commit ${base.slice(0, 12)} and at HEAD ${shortHead}, ` +
|
|
136
|
+
"so this leg cannot tell a still-standing defect from a finding the code never showed",
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
return {
|
|
140
|
+
disposition: "verified_already_fixed",
|
|
141
|
+
evidence: {
|
|
142
|
+
file,
|
|
143
|
+
line,
|
|
144
|
+
mechanism: "read_at_head_verification",
|
|
145
|
+
mechanism_detail: `read '${file}' at the audit-read commit ${base.slice(0, 12)} and at HEAD ${shortHead}: ` +
|
|
146
|
+
"the cited span the finding quotes was present there and is no longer present, so the defect it cites was fixed by the time of the HEAD read",
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
// Absent at B, whatever HEAD says: the cited location never showed the quoted
|
|
151
|
+
// span, so the finding's own citation cannot evidence the defect it claims.
|
|
152
|
+
// HEAD is not read at all here — its state cannot change this verdict, and a
|
|
153
|
+
// read we do not need is a read whose result we would have to ignore.
|
|
154
|
+
return {
|
|
155
|
+
disposition: "refuted",
|
|
156
|
+
evidence: {
|
|
157
|
+
file,
|
|
158
|
+
line,
|
|
159
|
+
mechanism: "read_at_head_refutation",
|
|
160
|
+
mechanism_detail: `read '${file}' at the audit-read commit ${base.slice(0, 12)}: the cited span the finding quotes ` +
|
|
161
|
+
"is not present there, so the cited location never showed the defect the finding claims",
|
|
162
|
+
},
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
export async function verifyHeadEvidenceAgainstFindings(params) {
|
|
166
|
+
const { state, root, overrides } = params;
|
|
167
|
+
const findingsById = new Map((state.plan?.findings ?? []).map((finding) => [finding.id, finding]));
|
|
168
|
+
// Provenance first: only a `resolved_no_change` item is a candidate, because
|
|
169
|
+
// only there has the host asserted a no-change resolution for this leg to
|
|
170
|
+
// confirm. An item that already carries an override is left alone — a
|
|
171
|
+
// determination someone else recorded is not this leg's to overwrite.
|
|
172
|
+
const candidates = [];
|
|
173
|
+
for (const item of Object.values(state.items ?? {})) {
|
|
174
|
+
if (item.status !== "resolved_no_change")
|
|
175
|
+
continue;
|
|
176
|
+
if (item.disposition_override !== undefined)
|
|
177
|
+
continue;
|
|
178
|
+
const finding = findingsById.get(item.finding_id);
|
|
179
|
+
if (!finding)
|
|
180
|
+
continue;
|
|
181
|
+
candidates.push({ item, finding });
|
|
182
|
+
}
|
|
183
|
+
if (candidates.length === 0)
|
|
184
|
+
return NO_OP;
|
|
185
|
+
const withholdAll = (head, reason) => ({
|
|
186
|
+
ran: true,
|
|
187
|
+
head,
|
|
188
|
+
base: null,
|
|
189
|
+
recorded: {},
|
|
190
|
+
withheld: candidates.map(({ finding }) => ({
|
|
191
|
+
finding_id: finding.id,
|
|
192
|
+
determined: false,
|
|
193
|
+
reason,
|
|
194
|
+
})),
|
|
195
|
+
});
|
|
196
|
+
// No resolvable HEAD means no read-at-HEAD determination exists to record, so
|
|
197
|
+
// the leg refuses to run rather than record a triple it cannot stand behind.
|
|
198
|
+
const head = await headCommit(root);
|
|
199
|
+
if (head === null) {
|
|
200
|
+
return withholdAll(null, "no resolvable HEAD — a read-at-HEAD determination cannot be made");
|
|
201
|
+
}
|
|
202
|
+
// B is an INPUT, never a guess, and it is verified before it is read: a
|
|
203
|
+
// supplied commit that does not resolve in THIS repo is not a read the leg can
|
|
204
|
+
// honestly attribute a triple to, so it is refused as unknown rather than
|
|
205
|
+
// handed to `git show`. `gitRefExists` is what distinguishes "the caller gave
|
|
206
|
+
// us a B this repo does not have" from "the caller gave us none" — both end in
|
|
207
|
+
// the same withhold, but only one of them is a caller error worth naming.
|
|
208
|
+
const base = overrides?.findingBase?.commit;
|
|
209
|
+
if (base === undefined) {
|
|
210
|
+
return withholdAll(head, "no audit-read commit is recorded for these findings, so neither a verification nor a refutation can be determined");
|
|
211
|
+
}
|
|
212
|
+
if (!(await gitRefExists(root, base))) {
|
|
213
|
+
return withholdAll(head, `the supplied audit-read commit '${base}' does not resolve to a commit in this repository`);
|
|
214
|
+
}
|
|
215
|
+
const corpus = await enumerateTrackedFilePaths(root);
|
|
216
|
+
const readAtRef = overrides?.readAtRef ??
|
|
217
|
+
((readRoot, ref, file) => fileContentAtRef(readRoot, ref, file));
|
|
218
|
+
const recorded = {};
|
|
219
|
+
const withheld = [];
|
|
220
|
+
for (const { item, finding } of candidates) {
|
|
221
|
+
const verdict = await determine({ root, head, base, corpus, finding, readAtRef });
|
|
222
|
+
if ("withheld" in verdict) {
|
|
223
|
+
withheld.push({
|
|
224
|
+
finding_id: finding.id,
|
|
225
|
+
determined: false,
|
|
226
|
+
reason: verdict.withheld,
|
|
227
|
+
});
|
|
228
|
+
continue;
|
|
229
|
+
}
|
|
230
|
+
item.disposition_override = verdict.disposition;
|
|
231
|
+
item.evidence = verdict.evidence;
|
|
232
|
+
item.recorded_by_module = HEAD_EVIDENCE_MODULE;
|
|
233
|
+
recorded[finding.id] = {
|
|
234
|
+
finding_id: finding.id,
|
|
235
|
+
determined: true,
|
|
236
|
+
disposition: verdict.disposition,
|
|
237
|
+
evidence: verdict.evidence,
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
return { ran: true, head, base, recorded, withheld };
|
|
241
|
+
}
|
|
242
|
+
//# sourceMappingURL=closeVerifyHeadEvidence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"closeVerifyHeadEvidence.js","sourceRoot":"","sources":["../../../src/remediate/phases/closeVerifyHeadEvidence.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,4BAA4B,EAC5B,sBAAsB,EACtB,WAAW,GACZ,MAAM,oBAAoB,CAAC;AAsJ5B,MAAM,KAAK,GAAwB;IACjC,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;IACV,QAAQ,EAAE,EAAE;IACZ,QAAQ,EAAE,EAAE;CACb,CAAC;AAEF,uFAAuF;AACvF,MAAM,CAAC,MAAM,oBAAoB,GAAG,yBAAyB,CAAC;AAE9D;;;;;;;GAOG;AACH,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAE3B,6FAA6F;AAC7F,SAAS,SAAS,CAAC,OAAgB;IACjC,KAAK,MAAM,QAAQ,IAAI,OAAO,CAAC,cAAc,IAAI,EAAE,EAAE,CAAC;QACpD,MAAM,MAAM,GAAG,QAAQ,CAAC,WAAW,CAAC;QACpC,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC3D,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC;QACzC,CAAC;IACH,CA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C;IAE3C,MAAM,QAAQ,GAAuC,EAAE,CAAC;IACxD,MAAM,QAAQ,GAAyB,EAAE,CAAC;IAC1C,KAAK,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,UAAU,EAAE,CAAC;QAC3C,MAAM,OAAO,GAAG,MAAM,SAAS,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC;QAClF,IAAI,UAAU,IAAI,OAAO,EAAE,CAAC;YAC1B,QAAQ,CAAC,IAAI,CAAC;gBACZ,UAAU,EAAE,OAAO,CAAC,EAAE;gBACtB,UAAU,EAAE,KAAK;gBACjB,MAAM,EAAE,OAAO,CAAC,QAAQ;aACzB,CAAC,CAAC;YACH,SAAS;QACX,CAAC;QACD,IAAI,CAAC,oBAAoB,GAAG,OAAO,CAAC,WAAW,CAAC;QAChD,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QACjC,IAAI,CAAC,kBAAkB,GAAG,oBAAoB,CAAC;QAC/C,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG;YACrB,UAAU,EAAE,OAAO,CAAC,EAAE;YACtB,UAAU,EAAE,IAAI;YAChB,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,QAAQ,EAAE,OAAO,CAAC,QAAQ;SAC3B,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;AACvD,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The single authority for the `RemediationState` RUN status lifecycle.
|
|
3
|
+
*
|
|
4
|
+
* `RemediationState.status` is the canonical coarse phase of a remediation run;
|
|
5
|
+
* the load gate (`validateState` in `./store.ts`) admits exactly these values
|
|
6
|
+
* and the run-status invariant test asserts against this array. Nothing outside
|
|
7
|
+
* this module may re-enumerate them.
|
|
8
|
+
*
|
|
9
|
+
* Why this module exists. The vocabulary used to exist in three unlinked
|
|
10
|
+
* copies: the inline union on `RemediationState.status`, the module-private
|
|
11
|
+
* accepted-status Set the load gate rejects unknown states with, and a third
|
|
12
|
+
* literal written inside the test. Nothing joined them, so the load gate
|
|
13
|
+
* and the type could drift apart with no red build — and the assertion
|
|
14
|
+
* ("`documenting` is not a status") was a tautology over a literal the test
|
|
15
|
+
* itself wrote, so a `documenting` status reintroduced into the type would have
|
|
16
|
+
* passed it silently. The array below is the ONE declaration; the type, the
|
|
17
|
+
* load gate and the test all derive from it. [[write-only-data-looks-authoritative]]
|
|
18
|
+
*
|
|
19
|
+
* Deliberately mirrors `ITEM_STATUSES` in `./itemStatus.ts` (a `const` tuple
|
|
20
|
+
* plus a derived union type) so the two halves of remediation state read the
|
|
21
|
+
* same way.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Every status a remediation RUN can hold, in lifecycle order.
|
|
25
|
+
*
|
|
26
|
+
* `documenting` is deliberately absent: the document phase was dissolved, and
|
|
27
|
+
* planning transitions DIRECTLY to implementing. Adding it back is a red — see
|
|
28
|
+
* the run-status invariant test, which reads this array rather than restating
|
|
29
|
+
* it.
|
|
30
|
+
*/
|
|
31
|
+
export declare const REMEDIATION_RUN_STATUSES: readonly ["pending", "planning", "waiting_for_clarification", "implementing", "triage", "waiting_for_triage", "closing", "complete"];
|
|
32
|
+
export type RemediationRunStatus = (typeof REMEDIATION_RUN_STATUSES)[number];
|
|
33
|
+
/** Runtime membership test for the load gate — derived, never re-listed. */
|
|
34
|
+
export declare function isRemediationRunStatus(value: unknown): value is RemediationRunStatus;
|
|
35
|
+
//# sourceMappingURL=runStatus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runStatus.d.ts","sourceRoot":"","sources":["../../../src/remediate/state/runStatus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,sIAS3B,CAAC;AAEX,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7E,4EAA4E;AAC5E,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,oBAAoB,CAKpF"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The single authority for the `RemediationState` RUN status lifecycle.
|
|
3
|
+
*
|
|
4
|
+
* `RemediationState.status` is the canonical coarse phase of a remediation run;
|
|
5
|
+
* the load gate (`validateState` in `./store.ts`) admits exactly these values
|
|
6
|
+
* and the run-status invariant test asserts against this array. Nothing outside
|
|
7
|
+
* this module may re-enumerate them.
|
|
8
|
+
*
|
|
9
|
+
* Why this module exists. The vocabulary used to exist in three unlinked
|
|
10
|
+
* copies: the inline union on `RemediationState.status`, the module-private
|
|
11
|
+
* accepted-status Set the load gate rejects unknown states with, and a third
|
|
12
|
+
* literal written inside the test. Nothing joined them, so the load gate
|
|
13
|
+
* and the type could drift apart with no red build — and the assertion
|
|
14
|
+
* ("`documenting` is not a status") was a tautology over a literal the test
|
|
15
|
+
* itself wrote, so a `documenting` status reintroduced into the type would have
|
|
16
|
+
* passed it silently. The array below is the ONE declaration; the type, the
|
|
17
|
+
* load gate and the test all derive from it. [[write-only-data-looks-authoritative]]
|
|
18
|
+
*
|
|
19
|
+
* Deliberately mirrors `ITEM_STATUSES` in `./itemStatus.ts` (a `const` tuple
|
|
20
|
+
* plus a derived union type) so the two halves of remediation state read the
|
|
21
|
+
* same way.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Every status a remediation RUN can hold, in lifecycle order.
|
|
25
|
+
*
|
|
26
|
+
* `documenting` is deliberately absent: the document phase was dissolved, and
|
|
27
|
+
* planning transitions DIRECTLY to implementing. Adding it back is a red — see
|
|
28
|
+
* the run-status invariant test, which reads this array rather than restating
|
|
29
|
+
* it.
|
|
30
|
+
*/
|
|
31
|
+
export const REMEDIATION_RUN_STATUSES = [
|
|
32
|
+
"pending",
|
|
33
|
+
"planning",
|
|
34
|
+
"waiting_for_clarification",
|
|
35
|
+
"implementing",
|
|
36
|
+
"triage",
|
|
37
|
+
"waiting_for_triage",
|
|
38
|
+
"closing",
|
|
39
|
+
"complete",
|
|
40
|
+
];
|
|
41
|
+
/** Runtime membership test for the load gate — derived, never re-listed. */
|
|
42
|
+
export function isRemediationRunStatus(value) {
|
|
43
|
+
return (typeof value === "string" &&
|
|
44
|
+
REMEDIATION_RUN_STATUSES.includes(value));
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=runStatus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runStatus.js","sourceRoot":"","sources":["../../../src/remediate/state/runStatus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,SAAS;IACT,UAAU;IACV,2BAA2B;IAC3B,cAAc;IACd,QAAQ;IACR,oBAAoB;IACpB,SAAS;IACT,UAAU;CACF,CAAC;AAIX,4EAA4E;AAC5E,MAAM,UAAU,sBAAsB,CAAC,KAAc;IACnD,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACxB,wBAA8C,CAAC,QAAQ,CAAC,KAAK,CAAC,CAChE,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,47 @@
|
|
|
1
|
+
import { SKIP_WRITE } from "audit-tools/shared";
|
|
1
2
|
import { RemediationPlan, RemediationItemState, ClarificationRequest, ClosingPlan, CoverageLedger, RemediationHostHandoffRecord } from "./types.js";
|
|
3
|
+
import { type RemediationRunStatus } from "./runStatus.js";
|
|
4
|
+
/**
|
|
5
|
+
* The schema version stamped on every persisted `state.json`.
|
|
6
|
+
*
|
|
7
|
+
* The VALUE is unchanged from the literal three modules already spelled out
|
|
8
|
+
* (the host-handoff parser, the state-shaping helper in `nextStep.ts`, and the
|
|
9
|
+
* test fixtures). What changes is that it is now ONE declaration that the store
|
|
10
|
+
* actually writes and reads back, rather than a constant a reader FABRICATED
|
|
11
|
+
* onto the loaded value to satisfy its own parser — see `parseCurrentState`'s
|
|
12
|
+
* call site in `steps/dispatch/hostHandoff.ts`. An identity that the reader
|
|
13
|
+
* supplies itself is not a check; it is the check's answer written in advance.
|
|
14
|
+
*
|
|
15
|
+
* A run's state is COSTLY / AUTHORED state in the sense
|
|
16
|
+
* `audit-tools/shared/io/schemaVersion.ts` names: it records work an operator
|
|
17
|
+
* or a host has already done, and it cannot be rebuilt from anything else on
|
|
18
|
+
* disk. That module's policy is therefore THROW on a mismatch — silently
|
|
19
|
+
* discarding a state would read as "this run never started" and destroy the
|
|
20
|
+
* plan, the item ledger and every recorded acceptance with it.
|
|
21
|
+
*
|
|
22
|
+
* ABSENT IS NOT A MISMATCH, and the distinction is deliberate here rather than
|
|
23
|
+
* inherited. Every run already in flight when this field was introduced has a
|
|
24
|
+
* `state.json` with no `contract_version`; treating its absence as a mismatch
|
|
25
|
+
* would refuse to load exactly the runs this field exists to protect. An
|
|
26
|
+
* unstamped state is read under the CURRENT version's semantics (it was written
|
|
27
|
+
* by a release whose shape this one still admits — that is what makes the field
|
|
28
|
+
* safe to add), and the next write stamps it. A stamped-but-DIFFERENT version
|
|
29
|
+
* is the case that throws, because at that point the file positively claims
|
|
30
|
+
* another release's semantics rather than merely predating the field.
|
|
31
|
+
*
|
|
32
|
+
* Same asymmetry as `intent_checkpoint` (absent ⇒ nothing to check; present
|
|
33
|
+
* and different ⇒ refuse loudly), inverted for a version that is newly added
|
|
34
|
+
* rather than newly REQUIRED.
|
|
35
|
+
*/
|
|
36
|
+
export declare const REMEDIATION_STATE_CONTRACT_VERSION: "remediate-code-state/v1alpha1";
|
|
2
37
|
export interface RemediationState {
|
|
3
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Schema version of this persisted state. Optional on the TYPE because a
|
|
40
|
+
* state written before the field existed is a legal input; see
|
|
41
|
+
* {@link REMEDIATION_STATE_CONTRACT_VERSION} for how it reads.
|
|
42
|
+
*/
|
|
43
|
+
contract_version?: typeof REMEDIATION_STATE_CONTRACT_VERSION;
|
|
44
|
+
status: RemediationRunStatus;
|
|
4
45
|
plan?: RemediationPlan;
|
|
5
46
|
items?: Record<string, RemediationItemState>;
|
|
6
47
|
clarifications?: ClarificationRequest[];
|
|
@@ -86,8 +127,17 @@ export declare class StateStore {
|
|
|
86
127
|
* current state (or null), passes it to `fn`, and writes the returned state
|
|
87
128
|
* before releasing the lock. No other holder can interleave between the load
|
|
88
129
|
* and the save. INV-remediate-state-02 + INV-remediate-state-03.
|
|
130
|
+
*
|
|
131
|
+
* Returning the shared `SKIP_WRITE` sentinel from `fn` is the no-op: the write
|
|
132
|
+
* is skipped and this resolves with the state that was READ. The skip decision
|
|
133
|
+
* is taken inside the SAME held lock as the write it avoids, so it cannot race
|
|
134
|
+
* a concurrent writer. Whole-run verbs that routinely change nothing — the
|
|
135
|
+
* `recover-ingest` retry loop is the live one — otherwise replace `state.json`
|
|
136
|
+
* with byte-identical content on every pass, which makes "did anything
|
|
137
|
+
* change?" unanswerable from the file and rewrites an artifact other readers
|
|
138
|
+
* treat as the run's ground truth.
|
|
89
139
|
*/
|
|
90
|
-
mutate(fn: (current: RemediationState | null) => Promise<RemediationState>): Promise<RemediationState>;
|
|
140
|
+
mutate(fn: (current: RemediationState | null) => Promise<RemediationState | typeof SKIP_WRITE>): Promise<RemediationState>;
|
|
91
141
|
/**
|
|
92
142
|
* Save state.json unconditionally (no TOCTOU protection, no read — so a
|
|
93
143
|
* corrupt on-disk state never blocks recovery). Prefer `mutate` for
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/remediate/state/store.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["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