audit-tools 0.51.7 → 0.51.10
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
|
@@ -10,9 +10,11 @@ import { quoteForShellInterpreterCmd, stripAuditToolsControlEnv, } from "audit-t
|
|
|
10
10
|
// exec.ts helpers so the safe-character set stays unified.
|
|
11
11
|
// Wrapper-only control-variable stripping is owned by the shared execution
|
|
12
12
|
// substrate so runtime validation never inherits driver lifecycle authority.
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
//
|
|
13
|
+
// What `stripAuditToolsControlEnv` removes is exactly ONE variable —
|
|
14
|
+
// `AUDIT_TOOLS_CALLER_CWD`, the wrapper's one-hop caller-cwd stamp, which a child
|
|
15
|
+
// must not read as its own location. It does NOT clear the host session's
|
|
16
|
+
// CLAUDECODE / CLAUDE_CODE_* variables: a runtime-validation command inherits
|
|
17
|
+
// them like any other child (this comment used to claim otherwise).
|
|
16
18
|
/**
|
|
17
19
|
* The bounded wait every runtime-validation command runs under.
|
|
18
20
|
*
|
|
@@ -28,6 +30,170 @@ export const RUNTIME_COMMAND_TIMEOUT_MS = 10 * 60 * 1_000;
|
|
|
28
30
|
* child may ignore; without the escalation the "bound" would be advisory.
|
|
29
31
|
*/
|
|
30
32
|
const KILL_ESCALATION_GRACE_MS = 2_000;
|
|
33
|
+
/**
|
|
34
|
+
* How many trailing lines a command's evidence can ever show. The number is
|
|
35
|
+
* stated once because the BUFFER is sized from it: the accumulator keeps only
|
|
36
|
+
* what a reader can see, so the two cannot disagree about how much is kept.
|
|
37
|
+
*/
|
|
38
|
+
export const EVIDENCE_TAIL_LINES = 10;
|
|
39
|
+
/**
|
|
40
|
+
* Character ceiling on the retained tail. The line budget alone does not bound
|
|
41
|
+
* a command whose output is one enormous line (a `--json` dump, a minified
|
|
42
|
+
* bundle, a progress bar with no newline): only the character cap does.
|
|
43
|
+
*/
|
|
44
|
+
export const EVIDENCE_TAIL_MAX_CHARS = 64 * 1024;
|
|
45
|
+
/**
|
|
46
|
+
* Character ceiling on a SINGLE retained line, so the tail budget cannot be
|
|
47
|
+
* spent by one line and leave the evidence empty of anything readable.
|
|
48
|
+
*/
|
|
49
|
+
export const EVIDENCE_TAIL_MAX_LINE_CHARS = 8 * 1024;
|
|
50
|
+
/**
|
|
51
|
+
* A bounded tail of a child's output: the last {@link EVIDENCE_TAIL_LINES}
|
|
52
|
+
* lines, plus the counts needed to describe what was dropped.
|
|
53
|
+
*
|
|
54
|
+
* This exists because the runner used to accumulate `stdout += String(chunk)`
|
|
55
|
+
* for the WHOLE stream and slice the last ten lines only at the end — so the
|
|
56
|
+
* memory a validation command could cost was whatever the command chose to
|
|
57
|
+
* print, and a sufficiently chatty one aborted the whole `advanceAudit` drain
|
|
58
|
+
* with a string-length `RangeError` from inside the runner. A drain that dies
|
|
59
|
+
* of its own evidence buffer is the bound-in-name-only failure this module
|
|
60
|
+
* already refuses for time, so the same rule is applied to bytes: keep the
|
|
61
|
+
* evidence contract's window, count the rest.
|
|
62
|
+
*
|
|
63
|
+
* The counts are what make the bound honest rather than lossy — the marker
|
|
64
|
+
* still reports the TRUE total line count of the full stream, so a reader
|
|
65
|
+
* cannot mistake ten retained lines for ten produced ones.
|
|
66
|
+
*/
|
|
67
|
+
export class BoundedOutputTail {
|
|
68
|
+
/**
|
|
69
|
+
* Segments between newlines. The LAST element is the in-progress line, so the
|
|
70
|
+
* array never needs a separate partial-line buffer. Invariant: after every
|
|
71
|
+
* push, `segments.length <= EVIDENCE_TAIL_LINES + 1` and every segment is at
|
|
72
|
+
* most {@link EVIDENCE_TAIL_MAX_LINE_CHARS} characters.
|
|
73
|
+
*/
|
|
74
|
+
segments = [""];
|
|
75
|
+
/** Lines dropped off the front — newlines this tail no longer represents. */
|
|
76
|
+
droppedLines = 0;
|
|
77
|
+
/** Characters clipped from the head of a retained line (giant-line case). */
|
|
78
|
+
clippedChars = 0;
|
|
79
|
+
push(chunk) {
|
|
80
|
+
if (chunk.length === 0)
|
|
81
|
+
return;
|
|
82
|
+
const parts = chunk.split("\n");
|
|
83
|
+
const last = this.segments.length - 1;
|
|
84
|
+
this.segments[last] += parts[0];
|
|
85
|
+
for (let index = 1; index < parts.length; index += 1) {
|
|
86
|
+
this.segments.push(parts[index]);
|
|
87
|
+
}
|
|
88
|
+
this.trim();
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Enforce both ceilings, in the order that keeps each one decidable: the line
|
|
92
|
+
* window first (cutting at a newline, never mid-line, so a retained line is a
|
|
93
|
+
* LINE rather than a fragment), then the per-line cap, then the total.
|
|
94
|
+
*
|
|
95
|
+
* The per-line cap applies to EVERY retained segment, the live one included.
|
|
96
|
+
* Clipping only the head was not a bound on the tail at all: a chunk that
|
|
97
|
+
* extends the in-progress line is appended to the LAST segment, so a command
|
|
98
|
+
* printing one newline-free blast had it buffered whole — and it was not even
|
|
99
|
+
* droppable, because the front-drop below never removes the live segment —
|
|
100
|
+
* until the next push happened to arrive and re-run this.
|
|
101
|
+
*/
|
|
102
|
+
trim() {
|
|
103
|
+
const excess = this.segments.length - (EVIDENCE_TAIL_LINES + 1);
|
|
104
|
+
if (excess > 0) {
|
|
105
|
+
this.segments.splice(0, excess);
|
|
106
|
+
// Each dropped segment was terminated by a newline this tail no longer
|
|
107
|
+
// holds, so exactly that many lines left the front.
|
|
108
|
+
this.droppedLines += excess;
|
|
109
|
+
}
|
|
110
|
+
this.segments = this.segments.map((segment) => {
|
|
111
|
+
if (segment.length <= EVIDENCE_TAIL_MAX_LINE_CHARS)
|
|
112
|
+
return segment;
|
|
113
|
+
const cut = segment.length - EVIDENCE_TAIL_MAX_LINE_CHARS;
|
|
114
|
+
this.clippedChars += cut;
|
|
115
|
+
return segment.slice(cut);
|
|
116
|
+
});
|
|
117
|
+
// A tail of many max-length lines still has to fit the character budget:
|
|
118
|
+
// drop whole leading lines until it does. What is measured is the length
|
|
119
|
+
// `read()` will actually join — segments PLUS the separators between them —
|
|
120
|
+
// because the ceiling is on the retained text, and a bound that excluded
|
|
121
|
+
// the separators would be a bound on something nobody reads.
|
|
122
|
+
let total = this.retainedLength();
|
|
123
|
+
while (total > EVIDENCE_TAIL_MAX_CHARS && this.segments.length > 1) {
|
|
124
|
+
const dropped = this.segments.shift();
|
|
125
|
+
total -= dropped.length + 1;
|
|
126
|
+
this.droppedLines += 1;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
/** The character length of what {@link read} will return. */
|
|
130
|
+
retainedLength() {
|
|
131
|
+
let total = 0;
|
|
132
|
+
for (const segment of this.segments) {
|
|
133
|
+
total += segment.length;
|
|
134
|
+
}
|
|
135
|
+
return total + Math.max(0, this.segments.length - 1);
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* The retained text and the true totals of the stream it came from. A trailing
|
|
139
|
+
* empty segment is the artifact of output ending in a newline, not a line.
|
|
140
|
+
*/
|
|
141
|
+
read() {
|
|
142
|
+
const segments = [...this.segments];
|
|
143
|
+
if (segments.length > 1 && segments[segments.length - 1] === "") {
|
|
144
|
+
segments.pop();
|
|
145
|
+
}
|
|
146
|
+
if (segments.length === 1 && segments[0] === "") {
|
|
147
|
+
return { text: "", totalLines: 0, clippedChars: this.clippedChars };
|
|
148
|
+
}
|
|
149
|
+
return {
|
|
150
|
+
text: segments.join("\n"),
|
|
151
|
+
totalLines: this.droppedLines + segments.length,
|
|
152
|
+
clippedChars: this.clippedChars,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* The evidence array for a finished (or failed) command, from the two bounded
|
|
158
|
+
* tails. Kept as one function because both the `error` and the `close` handler
|
|
159
|
+
* build it, and two copies drifting is how a failure path starts reporting a
|
|
160
|
+
* different window than the success path.
|
|
161
|
+
*
|
|
162
|
+
* The TOTAL is the sum of the two tails' own counts, never a count taken over
|
|
163
|
+
* the composed text. Composing first and counting the result means counting a
|
|
164
|
+
* STRING, and every string operation that touches it is a chance to change what
|
|
165
|
+
* the number means: the previous version called `.trim()` on the composition,
|
|
166
|
+
* which deletes a whitespace-only line at either boundary — so a stream whose
|
|
167
|
+
* first line was blank reported one line fewer than it printed, in the very
|
|
168
|
+
* marker whose only job is to state the true count. Each tail already knows how
|
|
169
|
+
* many lines IT held ({@link BoundedOutputTail.read}), and the two streams meet
|
|
170
|
+
* at exactly one boundary, so their sum is the composed count with nothing to
|
|
171
|
+
* trim and nothing to get wrong.
|
|
172
|
+
*/
|
|
173
|
+
function commandEvidence(stdout, stderr) {
|
|
174
|
+
const out = stdout.read();
|
|
175
|
+
const err = stderr.read();
|
|
176
|
+
// The separator belongs BETWEEN two non-empty tails and nowhere else: an
|
|
177
|
+
// absent stream contributes no line, and a leading or trailing empty string
|
|
178
|
+
// in the composition would otherwise be a line the command never printed.
|
|
179
|
+
const lines = [out.text, err.text]
|
|
180
|
+
.filter((text) => text.length > 0)
|
|
181
|
+
.flatMap((text) => text.split(/\r?\n/));
|
|
182
|
+
const totalLines = out.totalLines + err.totalLines;
|
|
183
|
+
const shown = lines.slice(-EVIDENCE_TAIL_LINES);
|
|
184
|
+
if (totalLines <= shown.length && out.clippedChars === 0 && err.clippedChars === 0) {
|
|
185
|
+
return lines;
|
|
186
|
+
}
|
|
187
|
+
const clipped = out.clippedChars + err.clippedChars;
|
|
188
|
+
return [
|
|
189
|
+
`[... truncated: showing last ${shown.length} of ${totalLines} lines` +
|
|
190
|
+
(clipped > 0
|
|
191
|
+
? `, ${clipped} character(s) clipped from the retained text`
|
|
192
|
+
: "") +
|
|
193
|
+
" ...]",
|
|
194
|
+
...shown,
|
|
195
|
+
];
|
|
196
|
+
}
|
|
31
197
|
/**
|
|
32
198
|
* Terminate a timed-out child, INCLUDING anything it spawned.
|
|
33
199
|
*
|
|
@@ -77,13 +243,15 @@ export async function runCommand(command, cwd, timeoutMs = RUNTIME_COMMAND_TIMEO
|
|
|
77
243
|
stdio: ["ignore", "pipe", "pipe"],
|
|
78
244
|
windowsHide: true,
|
|
79
245
|
});
|
|
80
|
-
|
|
81
|
-
|
|
246
|
+
// Bounded from the first byte: the accumulator keeps only the evidence
|
|
247
|
+
// window, so no command can make this runner's memory its own choice.
|
|
248
|
+
const stdout = new BoundedOutputTail();
|
|
249
|
+
const stderr = new BoundedOutputTail();
|
|
82
250
|
child.stdout.on("data", (chunk) => {
|
|
83
|
-
stdout
|
|
251
|
+
stdout.push(String(chunk));
|
|
84
252
|
});
|
|
85
253
|
child.stderr.on("data", (chunk) => {
|
|
86
|
-
stderr
|
|
254
|
+
stderr.push(String(chunk));
|
|
87
255
|
});
|
|
88
256
|
let exitCode = null;
|
|
89
257
|
let exitSignal = null;
|
|
@@ -119,16 +287,10 @@ export async function runCommand(command, cwd, timeoutMs = RUNTIME_COMMAND_TIMEO
|
|
|
119
287
|
};
|
|
120
288
|
child.on("error", (error) => {
|
|
121
289
|
clearTimers();
|
|
122
|
-
const output = `${stdout}\n${stderr}`.trim();
|
|
123
|
-
const lines = output.length > 0 ? output.split(/\r?\n/) : [];
|
|
124
|
-
const truncated = lines.length > 10;
|
|
125
|
-
const evidence = truncated
|
|
126
|
-
? [`[... truncated: showing last 10 of ${lines.length} lines ...]`, ...lines.slice(-10)]
|
|
127
|
-
: lines;
|
|
128
290
|
resolve({
|
|
129
291
|
status: "inconclusive",
|
|
130
292
|
summary: `Failed to execute ${displayCommand}: ${error.message}`,
|
|
131
|
-
evidence,
|
|
293
|
+
evidence: commandEvidence(stdout, stderr),
|
|
132
294
|
});
|
|
133
295
|
});
|
|
134
296
|
child.on("exit", (code, signal) => {
|
|
@@ -137,12 +299,7 @@ export async function runCommand(command, cwd, timeoutMs = RUNTIME_COMMAND_TIMEO
|
|
|
137
299
|
});
|
|
138
300
|
child.on("close", () => {
|
|
139
301
|
clearTimers();
|
|
140
|
-
const
|
|
141
|
-
const lines = output.length > 0 ? output.split(/\r?\n/) : [];
|
|
142
|
-
const truncated = lines.length > 10;
|
|
143
|
-
const evidence = truncated
|
|
144
|
-
? [`[... truncated: showing last 10 of ${lines.length} lines ...]`, ...lines.slice(-10)]
|
|
145
|
-
: lines;
|
|
302
|
+
const evidence = commandEvidence(stdout, stderr);
|
|
146
303
|
const succeeded = exitCode === 0 && !timedOut;
|
|
147
304
|
let summary;
|
|
148
305
|
if (timedOut) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtimeCommand.js","sourceRoot":"","sources":["../../../src/audit/orchestrator/runtimeCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EACL,2BAA2B,EAC3B,yBAAyB,GAC1B,MAAM,oBAAoB,CAAC;AAE5B,6EAA6E;AAC7E,0EAA0E;AAC1E,+EAA+E;AAC/E,6EAA6E;AAC7E,iBAAiB;AACjB,EAAE;AACF,8EAA8E;AAC9E,2DAA2D;AAE3D,2EAA2E;AAC3E,6EAA6E;AAC7E,
|
|
1
|
+
{"version":3,"file":"runtimeCommand.js","sourceRoot":"","sources":["../../../src/audit/orchestrator/runtimeCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EACL,2BAA2B,EAC3B,yBAAyB,GAC1B,MAAM,oBAAoB,CAAC;AAE5B,6EAA6E;AAC7E,0EAA0E;AAC1E,+EAA+E;AAC/E,6EAA6E;AAC7E,iBAAiB;AACjB,EAAE;AACF,8EAA8E;AAC9E,2DAA2D;AAE3D,2EAA2E;AAC3E,6EAA6E;AAC7E,qEAAqE;AACrE,kFAAkF;AAClF,0EAA0E;AAC1E,8EAA8E;AAC9E,oEAAoE;AAEpE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC;AAE1D;;;GAGG;AACH,MAAM,wBAAwB,GAAG,KAAK,CAAC;AAEvC;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAEtC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,CAAC;IACF,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { RepoManifest } from "../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Probe the live git index for the audited candidate set and return a stable
|
|
4
|
+
* content key over the tracked intersection, or `null` when git cannot be read
|
|
5
|
+
* (no root, not a work tree, git absent, non-zero exit, spawn failure). Never
|
|
6
|
+
* throws — this runs inside the advance fold, where a bad manifest must degrade
|
|
7
|
+
* and not take down the run.
|
|
8
|
+
*
|
|
9
|
+
* Sorted and separator-normalized before hashing, so the key is derived from
|
|
10
|
+
* the tracked SET and never from `ls-files` output order.
|
|
11
|
+
*/
|
|
12
|
+
export declare function probeScopeIndexKey(root: string, candidatePaths: readonly string[]): Promise<string | null>;
|
|
13
|
+
/**
|
|
14
|
+
* A fold's probe cache: the last probe's inputs and its answer.
|
|
15
|
+
*
|
|
16
|
+
* `runSingleAdvanceStep` probes on EVERY dispatch, and a fold dispatches up to
|
|
17
|
+
* `MAX_DRAIN_STEPS` times — a `git` spawn per obligation execution over a value
|
|
18
|
+
* that cannot move underneath it. The fold creates ONE of these and every git
|
|
19
|
+
* probe it makes shares it (`runSingleAdvanceStep` directly, and the
|
|
20
|
+
* submission-polling gates through `runAuditStepUnlocked`), so a `next-step`
|
|
21
|
+
* call spawns `git` once instead of once per obligation.
|
|
22
|
+
*
|
|
23
|
+
* The cache is HELD, not looked up, and the key is the point: it names the
|
|
24
|
+
* probe's WHOLE input — the repo root and the candidate path set — so a probe
|
|
25
|
+
* whose inputs differ cannot replay a stale entry. A step that re-derives the
|
|
26
|
+
* manifest (the auto-fix phase writes into the audited tree, moving `files[]`)
|
|
27
|
+
* mints a different key and re-probes, which is why the re-read the reviewer
|
|
28
|
+
* asked to keep survives: only an identical question is answered from cache.
|
|
29
|
+
* Nothing inside a fold moves the INDEX itself — no deterministic executor
|
|
30
|
+
* stages or unstages, the two directions the rule reads, and the fold is
|
|
31
|
+
* in-process, so no host is running `git add` underneath it.
|
|
32
|
+
*
|
|
33
|
+
* A caller that passes no memo (every bare `advanceAudit`, and the CLI claim
|
|
34
|
+
* path) simply re-probes every time: the cache is an optimization a fold opts
|
|
35
|
+
* into, never a correctness dependency.
|
|
36
|
+
*/
|
|
37
|
+
export interface ScopeIndexMemo {
|
|
38
|
+
/** The last probe's input key — absent until the first probe. */
|
|
39
|
+
key?: string;
|
|
40
|
+
/** That probe's answer. `null` is a real answer (git unreadable), so the
|
|
41
|
+
* presence of `key` — never the truthiness of `value` — is the cache test. */
|
|
42
|
+
value?: string | null;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* {@link probeScopeIndexKey}, memoized against `memo` when one is supplied.
|
|
46
|
+
* Behaves identically to the bare probe; a caller with no memo re-probes.
|
|
47
|
+
*/
|
|
48
|
+
export declare function probeScopeIndexKeyCached(memo: ScopeIndexMemo | undefined, root: string, candidatePaths: readonly string[]): Promise<string | null>;
|
|
49
|
+
/**
|
|
50
|
+
* Return a copy of the manifest carrying the probed index key. `null` (git
|
|
51
|
+
* unreadable) leaves the manifest untouched rather than stamping a sentinel —
|
|
52
|
+
* a sentinel would be a claim about the index that the probe could not make,
|
|
53
|
+
* and it would hash differently from the unprobed manifest for no reason.
|
|
54
|
+
*/
|
|
55
|
+
export declare function withScopeIndexKey(repoManifest: RepoManifest | undefined, key: string | null): RepoManifest | undefined;
|
|
56
|
+
//# sourceMappingURL=scopeIndexBaseline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scopeIndexBaseline.d.ts","sourceRoot":"","sources":["../../../src/audit/orchestrator/scopeIndexBaseline.ts"],"names":[],"mappings":"AAsDA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD;;;;;;;;;GASG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,SAAS,MAAM,EAAE,GAChC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA0BxB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,WAAW,cAAc;IAC7B,iEAAiE;IACjE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;mFAC+E;IAC/E,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED;;;GAGG;AACH,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,cAAc,GAAG,SAAS,EAChC,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,SAAS,MAAM,EAAE,GAChC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CASxB;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,YAAY,GAAG,SAAS,EACtC,GAAG,EAAE,MAAM,GAAG,IAAI,GACjB,YAAY,GAAG,SAAS,CAG1B"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The live git-index probe behind `repo_manifest.json`'s `scope_index_key`.
|
|
3
|
+
*
|
|
4
|
+
* WHY THIS EXISTS. `buildFileDisposition`'s untracked scope rule reads the git
|
|
5
|
+
* INDEX: the tracked set (`git ls-files`) decides which candidates are in scope.
|
|
6
|
+
* But `file_disposition.json`'s only declared upstream was `repo_manifest.json`,
|
|
7
|
+
* and a manifest is a pure WORKTREE read — its per-file hashes do not move when
|
|
8
|
+
* a file is merely staged (`git add`) or unstaged (`git rm --cached`) with its
|
|
9
|
+
* content untouched. So an index-only change re-staled nothing, the persisted
|
|
10
|
+
* disposition kept the old classification, and a file committed mid-run never
|
|
11
|
+
* entered scope on the next audit until some unrelated content edit churned the
|
|
12
|
+
* manifest.
|
|
13
|
+
*
|
|
14
|
+
* THE FIX IS DAG-NATIVE, not a freshness check: the index state becomes part of
|
|
15
|
+
* `repo_manifest.json`'s CONTENT. `repo_manifest.json` is already
|
|
16
|
+
* `file_disposition.json`'s declared upstream, so an index move now propagates
|
|
17
|
+
* through the existing edge with no new artifact, no new edge, and no change to
|
|
18
|
+
* the constitutional `spec/audit/dependency-map.md`.
|
|
19
|
+
*
|
|
20
|
+
* HOW A LIVE PROBE REACHES THE METADATA. A plain artifact's recorded content
|
|
21
|
+
* hash only moves when something RE-DERIVES it, and nothing re-derives it until
|
|
22
|
+
* it is stale — the chicken-and-egg this probe breaks by riding the mechanism
|
|
23
|
+
* `tooling_manifest.json` already uses: `advanceAudit` re-probes it from live
|
|
24
|
+
* state on every fold and lists it in the always-updated set, so
|
|
25
|
+
* `computeArtifactMetadata` restamps it from live content. Unchanged content
|
|
26
|
+
* keeps its revision (no churn); a moved index bumps it, and
|
|
27
|
+
* `file_disposition.json` goes stale exactly once.
|
|
28
|
+
*
|
|
29
|
+
* READ-SET DIRECTION. The probe is restricted to the manifest's own candidate
|
|
30
|
+
* paths — exactly the set the untracked rule classifies. An `ls-files` entry
|
|
31
|
+
* outside that set (an unrelated file staged elsewhere) cannot change the
|
|
32
|
+
* disposition, and hashing it would churn the whole downstream DAG for nothing.
|
|
33
|
+
* Absent root / absent git / a failed spawn yields `null`, which the caller
|
|
34
|
+
* leaves unset: the manifest then carries no index claim at all, and the
|
|
35
|
+
* pre-existing content-only behaviour is preserved verbatim.
|
|
36
|
+
*
|
|
37
|
+
* RECURSION IS PART OF THE ATOMIC PAIR, not a tuning knob. The rule this probe
|
|
38
|
+
* tracks (`buildFileDisposition`'s untracked classification) reads the index
|
|
39
|
+
* with `--recurse-submodules`, and so does the citation-grounding corpus
|
|
40
|
+
* (`enumerateTrackedFilePaths`) — the flag is ONE decision shared by all three,
|
|
41
|
+
* because "tracked" must mean one thing everywhere or a finding grounds against
|
|
42
|
+
* a file the disposition excluded. A probe without the flag returns a stable,
|
|
43
|
+
* plausible key that simply cannot see a move INSIDE a submodule: the gitlink
|
|
44
|
+
* line is unchanged, the parent's own entries are unchanged, so
|
|
45
|
+
* `scope_index_key` holds still while the recursive tracked set moves — and the
|
|
46
|
+
* stale `file_disposition.json` this probe exists to catch is carried forward
|
|
47
|
+
* silently, for exactly the repos that have first-party submodules.
|
|
48
|
+
*/
|
|
49
|
+
import { hashContent, runTrackedAsync, TRACKED_CHILD_DEADLINE_MS, normalizeRepoPath, } from "audit-tools/shared";
|
|
50
|
+
import { toPosixPath } from "audit-tools/shared";
|
|
51
|
+
/**
|
|
52
|
+
* Probe the live git index for the audited candidate set and return a stable
|
|
53
|
+
* content key over the tracked intersection, or `null` when git cannot be read
|
|
54
|
+
* (no root, not a work tree, git absent, non-zero exit, spawn failure). Never
|
|
55
|
+
* throws — this runs inside the advance fold, where a bad manifest must degrade
|
|
56
|
+
* and not take down the run.
|
|
57
|
+
*
|
|
58
|
+
* Sorted and separator-normalized before hashing, so the key is derived from
|
|
59
|
+
* the tracked SET and never from `ls-files` output order.
|
|
60
|
+
*/
|
|
61
|
+
export async function probeScopeIndexKey(root, candidatePaths) {
|
|
62
|
+
if (candidatePaths.length === 0)
|
|
63
|
+
return null;
|
|
64
|
+
let result;
|
|
65
|
+
try {
|
|
66
|
+
result = await runTrackedAsync(["git", "ls-files", "-z", "--recurse-submodules"], {
|
|
67
|
+
cwd: root,
|
|
68
|
+
encoding: "utf8",
|
|
69
|
+
maxBuffer: 256 * 1024 * 1024,
|
|
70
|
+
timeout: TRACKED_CHILD_DEADLINE_MS,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
if (result.error || result.status !== 0)
|
|
77
|
+
return null;
|
|
78
|
+
const tracked = new Set((result.stdout ?? "")
|
|
79
|
+
.split("\0")
|
|
80
|
+
.filter((path) => path.length > 0)
|
|
81
|
+
.map(normalizeRepoPath));
|
|
82
|
+
const trackedCandidates = candidatePaths
|
|
83
|
+
.map((path) => normalizeRepoPath(toPosixPath(path)))
|
|
84
|
+
.filter((path) => tracked.has(path))
|
|
85
|
+
.sort();
|
|
86
|
+
return hashContent(trackedCandidates.join("\n"));
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* {@link probeScopeIndexKey}, memoized against `memo` when one is supplied.
|
|
90
|
+
* Behaves identically to the bare probe; a caller with no memo re-probes.
|
|
91
|
+
*/
|
|
92
|
+
export async function probeScopeIndexKeyCached(memo, root, candidatePaths) {
|
|
93
|
+
const key = `${root}\0${candidatePaths.join("\n")}`;
|
|
94
|
+
if (memo && memo.key === key)
|
|
95
|
+
return memo.value ?? null;
|
|
96
|
+
const value = await probeScopeIndexKey(root, candidatePaths);
|
|
97
|
+
if (memo) {
|
|
98
|
+
memo.key = key;
|
|
99
|
+
memo.value = value;
|
|
100
|
+
}
|
|
101
|
+
return value;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Return a copy of the manifest carrying the probed index key. `null` (git
|
|
105
|
+
* unreadable) leaves the manifest untouched rather than stamping a sentinel —
|
|
106
|
+
* a sentinel would be a claim about the index that the probe could not make,
|
|
107
|
+
* and it would hash differently from the unprobed manifest for no reason.
|
|
108
|
+
*/
|
|
109
|
+
export function withScopeIndexKey(repoManifest, key) {
|
|
110
|
+
if (!repoManifest || key === null)
|
|
111
|
+
return repoManifest;
|
|
112
|
+
return { ...repoManifest, scope_index_key: key };
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=scopeIndexBaseline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scopeIndexBaseline.js","sourceRoot":"","sources":["../../../src/audit/orchestrator/scopeIndexBaseline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,OAAO,EACL,WAAW,EACX,eAAe,EACf,yBAAyB,EACzB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,IAAY,EACZ,cAAiC;IAE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AI,CAAC,EAAE,CAAC;IACpD,IAAI,IAAI,IAAI,IAAI,CAAC,GAAG,KAAK,GAAG;QAAE,OAAO,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC;IACxD,MAAM,KAAK,GAAG,MAAM,kBAAkB,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IAC7D,IAAI,IAAI,EAAE,CAAC;QACT,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAC/B,YAAsC,EACtC,GAAkB;IAElB,IAAI,CAAC,YAAY,IAAI,GAAG,KAAK,IAAI;QAAE,OAAO,YAAY,CAAC;IACvD,OAAO,EAAE,GAAG,YAAY,EAAE,eAAe,EAAE,GAAG,EAAE,CAAC;AACnD,CAAC"}
|
|
@@ -16,12 +16,49 @@ import type { ArtifactBundle } from "../io/artifacts.js";
|
|
|
16
16
|
* stale set (`deriveAuditState`, the drain boundary) keeps its `Set<string>`
|
|
17
17
|
* type and behaviour unchanged, so the deferred channel can never be dropped by
|
|
18
18
|
* a caller "forgetting" a second return value.
|
|
19
|
+
*
|
|
20
|
+
* THE CARRY IS A FIELD OF THE VALUE, so it lives exactly as long as the value.
|
|
21
|
+
* A consumer that rebuilds, forwards or re-types the set into a fresh object
|
|
22
|
+
* holds a value without it, whatever that consumer's `instanceof` says.
|
|
23
|
+
*
|
|
24
|
+
* The residual is real and is NOT papered over. `Set.prototype.union` builds a
|
|
25
|
+
* PLAIN `Set` — measured, not assumed. It consults neither the receiver's
|
|
26
|
+
* constructor nor `Set[Symbol.species]` (the property exists and is
|
|
27
|
+
* configurable, and is ignored), and the subclass constructor is never invoked,
|
|
28
|
+
* so NOTHING inside this class can reach the copy. `structuredClone` likewise
|
|
29
|
+
* rebuilds a plain `Set` and has no hook at all. Both results are still
|
|
30
|
+
* iterable, still `instanceof`-false, and so still type-acceptable to every
|
|
31
|
+
* consumer — the silently-DISCARDED deferral this class was introduced to make
|
|
32
|
+
* impossible, one derivation away.
|
|
33
|
+
*
|
|
34
|
+
* So the contract is stated LOUDLY at the read instead: {@link deferredArtifactsOf}
|
|
35
|
+
* returns the carried set for a {@link StaleArtifactSet} and `undefined` for
|
|
36
|
+
* everything else — which is distinguishable from "this one deferred nothing"
|
|
37
|
+
* (an EMPTY set on a `StaleArtifactSet`). A caller that unions or clones a stale
|
|
38
|
+
* set therefore gets `undefined` — an explicit "I lost the deferrals", not an
|
|
39
|
+
* empty set that reads as "nothing was deferred". The ONLY carry that survives a
|
|
40
|
+
* derivation is the constructor's: a `StaleArtifactSet` built FROM another one
|
|
41
|
+
* describes the same computation, so it inherits the source's carry (see the
|
|
42
|
+
* constructor). Nothing else does — neither derivation is a staleness result.
|
|
19
43
|
*/
|
|
20
44
|
export declare class StaleArtifactSet extends Set<string> {
|
|
21
45
|
/** Downstreams held behind a slice projection this call — always disjoint from the stale set. */
|
|
22
46
|
readonly deferred: ReadonlySet<string>;
|
|
23
47
|
constructor(stale?: Iterable<string>, deferred?: Iterable<string>);
|
|
24
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* The deferred downstreams a stale set carries, `undefined` when the argument
|
|
51
|
+
* is not a staleness result at all. A `StaleArtifactSet` that deferred nothing
|
|
52
|
+
* reports an empty set — never `undefined`, so "deferred nothing" and "was
|
|
53
|
+
* never a staleness result" stay distinguishable.
|
|
54
|
+
*
|
|
55
|
+
* The `instanceof` test here is EXACT, not a widening: only a
|
|
56
|
+
* `StaleArtifactSet` has a carry, and its constructor is the only thing that
|
|
57
|
+
* puts the deferrals back on a DERIVED value. A plain `Set` — from `union`,
|
|
58
|
+
* `structuredClone`, or `new Set(...)` — is simply not a staleness result, so
|
|
59
|
+
* answering `undefined` for it is the honest answer, not a lost lookup.
|
|
60
|
+
*/
|
|
61
|
+
export declare function deferredArtifactsOf(stale: ReadonlySet<string> | Iterable<string>): ReadonlySet<string> | undefined;
|
|
25
62
|
/** Options controlling the staleness pass's observability side effect. */
|
|
26
63
|
export interface StalenessOptions {
|
|
27
64
|
/**
|
|
@@ -39,7 +76,39 @@ export interface StalenessOptions {
|
|
|
39
76
|
* emits, while the intra-call repeats (the observed 28×/~15× spam) collapse.
|
|
40
77
|
*/
|
|
41
78
|
export declare function resetStalenessDedup(): void;
|
|
42
|
-
|
|
79
|
+
/**
|
|
80
|
+
* The recovery a stale set describes, when it describes one — or `undefined`
|
|
81
|
+
* for the ordinary case of staling work that had not been done yet.
|
|
82
|
+
*
|
|
83
|
+
* WHY THIS EXISTS AT ALL (the 2026-07-16 self-audit dogfood entry): fixing this
|
|
84
|
+
* tool WHILE it audits a tree changes the audited tree, the dependency DAG
|
|
85
|
+
* correctly marks the planning chain stale, and the run restarts from
|
|
86
|
+
* `charter_extraction`. The cascade is RIGHT — the planning was derived from a
|
|
87
|
+
* tree that no longer exists — and it is deliberately NOT narrowed here. The
|
|
88
|
+
* defect was that a large, expensive, correct action happened SILENTLY, so an
|
|
89
|
+
* operator could not tell it from a wedge and would eventually be trained to
|
|
90
|
+
* defeat it. The DAG stays truth; the explanation is added.
|
|
91
|
+
*
|
|
92
|
+
* "Expensive" is what makes this a recovery rather than routine planning: a
|
|
93
|
+
* stale artifact that ALREADY HAS A BODY is prior work being redone. One that
|
|
94
|
+
* was never written is simply the next thing to do, and announcing it would
|
|
95
|
+
* make the signal fire constantly — which is the same as not having it. So the
|
|
96
|
+
* trigger is: this set reaches at least one artifact that already exists.
|
|
97
|
+
*
|
|
98
|
+
* The CAUSES are the upstreams that moved. A stale artifact with tracked
|
|
99
|
+
* dependencies attributes to whichever of them is itself absent-or-stale (the
|
|
100
|
+
* head of the cascade); a stale artifact with none is its own cause — for the
|
|
101
|
+
* dogfood case that is `repo_manifest.json`, the artifact that actually
|
|
102
|
+
* noticed the tool's source change.
|
|
103
|
+
*/
|
|
104
|
+
export interface StalenessRecovery {
|
|
105
|
+
/** The upstream artifact(s) whose change triggered this cascade, sorted. */
|
|
106
|
+
caused_by: string[];
|
|
107
|
+
/** How many artifacts are being re-derived, including the causes. */
|
|
108
|
+
rederiving: number;
|
|
109
|
+
}
|
|
110
|
+
export declare function describeStalenessRecovery(stale: ReadonlySet<string>, bundle: ArtifactBundle): StalenessRecovery | undefined;
|
|
111
|
+
export declare function emitStalenessRecord(stale: Set<string>, reason?: string, bundle?: ArtifactBundle): void;
|
|
43
112
|
/**
|
|
44
113
|
* True exactly when `computeStaleArtifacts` would take the metadata-schema
|
|
45
114
|
* migration degrade path (an old-shape manifest that must not be trusted to
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"staleness.d.ts","sourceRoot":"","sources":["../../../src/audit/orchestrator/staleness.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AA6BzD
|
|
1
|
+
{"version":3,"file":"staleness.d.ts","sourceRoot":"","sources":["../../../src/audit/orchestrator/staleness.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AA6BzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,qBAAa,gBAAiB,SAAQ,GAAG,CAAC,MAAM,CAAC;IAC/C,iGAAiG;IACjG,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;gBAE3B,KAAK,GAAE,QAAQ,CAAC,MAAM,CAAM,EAAE,QAAQ,GAAE,QAAQ,CAAC,MAAM,CAAM;CAe1E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,GAC5C,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,CAEjC;AA4FD,0EAA0E;AAC1E,MAAM,WAAW,gBAAgB;IAC/B;;;;;;OAMG;IACH,IA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