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
|
@@ -1,14 +1,89 @@
|
|
|
1
|
+
// sites-pinned: tests/audit/host-handoff.test.ts
|
|
2
|
+
// (the steward-lane verification contract: the lane-aware prompt, the one
|
|
3
|
+
// optional envelope key, the refusal of that key on a lane whose contract never
|
|
4
|
+
// asked for it, the enforcement of every property the prompt states, and the
|
|
5
|
+
// task-bindings version bump whose refusal names the remedy)
|
|
1
6
|
import { mkdir } from "node:fs/promises";
|
|
2
7
|
import { join } from "node:path";
|
|
3
|
-
import { createMemoizedSourceReader, appendSubmissionEvent, SUBMISSION_LEDGER_EVENT_CONTRACT_VERSION, bindingIdentity, compareCodeUnits, contentSha256, firstDuplicateIdentity, hasExactKeys, hostHandoffResultPath, isFileMissingError, isRecord, isSha256, parseAllWorkloadItems, parseWorkloadEnvelope, promptSha256, enrichMissingSubmissionIssues, readTrailingSubmissionRefusals, readJsonFile, repoRelativePath, requireNonEmptyString, resolveContainedPath, resolveHostHandoffPaths, resultMapIdentity, scanBoundSubmission, siblingLockPath, sameStrings, stableStringify, verifyFindingGrounding, withFileLock, writeBlockedStepContract, writeJsonFile, } from "audit-tools/shared";
|
|
8
|
+
import { createMemoizedSourceReader, appendSubmissionEvent, SUBMISSION_LEDGER_EVENT_CONTRACT_VERSION, bindingIdentity, compareCodeUnits, contentSha256, firstDuplicateIdentity, hasExactKeys, hostHandoffResultPath, identityFailureDiagnostic, isFileMissingError, isRecord, isSha256, LaneDemandSchema, parseAllWorkloadItems, parseWorkloadEnvelope, promptSha256, enrichMissingSubmissionIssues, readTrailingSubmissionRefusals, readJsonFile, repoRelativePath, requireNonEmptyString, resolveContainedPath, resolveHostHandoffPaths, resultMapIdentity, scanBoundSubmission, siblingLockPath, sameStrings, stableStringify, verifyFindingGrounding, withFileLock, writeBlockedStepContract, writeJsonFile, } from "audit-tools/shared";
|
|
4
9
|
import { findingContractPromptLines } from "../../contracts/findingContractPrompt.js";
|
|
5
|
-
import { WorkerFindingSchema } from "../../contracts/workerSchemas.js";
|
|
10
|
+
import { WORKER_REFUSED_FINDING_VERDICTS, WorkerFindingSchema, } from "../../contracts/workerSchemas.js";
|
|
6
11
|
import { AuditResultSchema } from "../../types.js";
|
|
7
|
-
import { validateOneAuditResult, formatAuditResultIssues,
|
|
8
|
-
|
|
12
|
+
import { validateOneAuditResult, formatAuditResultIssues,
|
|
13
|
+
// THE ONE CONTAINMENT RULE, shared with the batch door: this boundary and
|
|
14
|
+
// `validateVerification` build their allowed set through the same function, so
|
|
15
|
+
// they cannot disagree about which `file_paths` entries are inside the packet.
|
|
16
|
+
verificationAllowedPaths, normalizeCoveragePath, } from "../../validation/auditResults.js";
|
|
17
|
+
import { reviewWaveClosedPath } from "../../io/runArtifacts.js";
|
|
18
|
+
// The lane token itself is single-sourced where the steward lane is minted:
|
|
19
|
+
// `LENS_VERIFICATION_TAG` (`orchestrator/selectiveDeepening/shared.ts`). Every
|
|
20
|
+
// reader compiles against that one declaration, so a rename moves them together
|
|
21
|
+
// rather than leaving two literals that agree only until one is edited — which
|
|
22
|
+
// is what a hand-copied literal here produced, twice (this boundary and the
|
|
23
|
+
// audit-results validator).
|
|
24
|
+
import { LENS_VERIFICATION_TAG, } from "../../orchestrator/selectiveDeepening/shared.js";
|
|
25
|
+
// v1alpha2 (the emitted-lane demand ranking): each work item's `metadata`
|
|
26
|
+
// carries the shared `demand` ranking (size / complexity / risk) beside its
|
|
27
|
+
// token estimate, in place of the retired `{complexity, risk}` pair whose
|
|
28
|
+
// `risk` was the task's coarsely bucketed dispatch PRIORITY rather than a
|
|
29
|
+
// likelihood×stakes estimate. A v1alpha1 document refuses closed as stale —
|
|
30
|
+
// re-prepare. Same one-cut precedent as the remediation twin's v1alpha2
|
|
31
|
+
// (`REMEDIATION_HOST_WORKLOAD_CONTRACT_VERSION`, commit ed033294): the shape
|
|
32
|
+
// changed, so the version names the shape that is actually on disk.
|
|
33
|
+
const WORKLOAD_CONTRACT_VERSION = "audit-host-workload/v1alpha2";
|
|
9
34
|
const RESULT_MAP_CONTRACT_VERSION = "audit-host-result-map/v1alpha1";
|
|
10
35
|
const RESULT_CONTRACT_VERSION = "audit-host-result/v1alpha1";
|
|
11
|
-
|
|
36
|
+
/**
|
|
37
|
+
* The result envelope's REQUIRED key set. Named rather than inlined because the
|
|
38
|
+
* parse and the refusal message both enumerate it, and the one OPTIONAL key
|
|
39
|
+
* (`verification`) is added to the expected set only when the submission
|
|
40
|
+
* actually carries it — so "exactly these keys, plus at most one optional
|
|
41
|
+
* field" is one statement instead of a second hand-maintained list.
|
|
42
|
+
*/
|
|
43
|
+
const AUDIT_RESULT_ENVELOPE_KEYS = [
|
|
44
|
+
"contract_version",
|
|
45
|
+
"file_coverage",
|
|
46
|
+
"findings",
|
|
47
|
+
"prompt_sha256",
|
|
48
|
+
"result_id",
|
|
49
|
+
"run_id",
|
|
50
|
+
"work_item_id",
|
|
51
|
+
];
|
|
52
|
+
/**
|
|
53
|
+
* v1alpha2 adds the per-item `tags` lane stamp. The version moves with the shape
|
|
54
|
+
* because a binding set is READ BACK at ingest, after the pause — a binding
|
|
55
|
+
* written by the previous code carries no `tags`, and the lane gate below reads
|
|
56
|
+
* that field, so under one version string the old set would be refused by a
|
|
57
|
+
* generic parse error on a run the host had already executed.
|
|
58
|
+
*
|
|
59
|
+
* Moving the version (rather than defaulting an absent `tags` to `[]`) makes
|
|
60
|
+
* that case FAIL CLOSED with a message that names what happens next:
|
|
61
|
+
* `parseTaskBindings` throws {@link StaleAuditHostTaskBindingsError}, the ingest
|
|
62
|
+
* returns it as a classified issue, and the fold walks on to re-prepare the
|
|
63
|
+
* whole workload under the current version. Defaulting was
|
|
64
|
+
* the other option and was rejected here because it would silently judge an
|
|
65
|
+
* old-shape item against the BASE per-file lane: that happens to be correct today
|
|
66
|
+
* only because the only lane with a divergent contract is the steward lane, which
|
|
67
|
+
* did not exist when the old binding was written — an argument that decays the
|
|
68
|
+
* moment a second lane diverges, and that would leave a mis-laned item reporting
|
|
69
|
+
* success.
|
|
70
|
+
*/
|
|
71
|
+
const TASK_BINDINGS_CONTRACT_VERSION = "audit-host-task-bindings/v1alpha2";
|
|
72
|
+
/**
|
|
73
|
+
* The remedy a version mismatch carries. The failure is recoverable, and the
|
|
74
|
+
* recoverable move is not guessable from the shape ("unexpected field" reads as
|
|
75
|
+
* a corrupt file, which invites an operator to hand-edit bindings).
|
|
76
|
+
*
|
|
77
|
+
* It names ONLY what the tool then does, because that is now all there is to do:
|
|
78
|
+
* the fold classifies a stale binding set ({@link StaleAuditHostTaskBindingsError})
|
|
79
|
+
* and continues to `prepareAuditHostHandoff`, which rewrites the whole set under
|
|
80
|
+
* the current version in the SAME `next-step` call that read it. So the host is
|
|
81
|
+
* not asked to do anything, and the sentence must not read as an instruction to
|
|
82
|
+
* re-run anything by hand.
|
|
83
|
+
*/
|
|
84
|
+
const TASK_BINDINGS_VERSION_REMEDY = "the same `next-step` re-prepares the workload under the current contract version " +
|
|
85
|
+
"and rewrites this bindings file; results already accepted are not re-ingested";
|
|
86
|
+
const REVIEW_WAVE_CLOSED_CONTRACT_VERSION = "audit-review-wave-closed/v1alpha1";
|
|
12
87
|
const ACCEPTED_RESULTS_CONTRACT_VERSION = "audit-host-accepted-results/v1alpha1";
|
|
13
88
|
/**
|
|
14
89
|
* The audit draw's boundary paths: the SHARED resolution (run-id grammar,
|
|
@@ -79,7 +154,10 @@ async function writeAcceptedResults(paths, ledger) {
|
|
|
79
154
|
* a divergence between them would have been silent on both sides.
|
|
80
155
|
*/
|
|
81
156
|
function resultPathFor(paths, workItemId) {
|
|
82
|
-
|
|
157
|
+
// `ResolvedBoundaryPaths` is a superset of the core's `HostHandoffPaths`, so
|
|
158
|
+
// the core shape passes through whole — no re-flattening step that could drop
|
|
159
|
+
// a field the shared rule later starts reading.
|
|
160
|
+
return hostHandoffResultPath(paths, workItemId);
|
|
83
161
|
}
|
|
84
162
|
function normalizeTask(task, root) {
|
|
85
163
|
if (!isRecord(task)) {
|
|
@@ -91,8 +169,10 @@ function normalizeTask(task, root) {
|
|
|
91
169
|
const lens = requireNonEmptyString(task.lens, `${taskId}.lens`);
|
|
92
170
|
const rationale = requireNonEmptyString(task.rationale, `${taskId}.rationale`);
|
|
93
171
|
const priority = requireNonEmptyString(task.priority, `${taskId}.priority`);
|
|
94
|
-
|
|
95
|
-
|
|
172
|
+
// The demand ranking is validated by the SHARED schema, so a draw cannot
|
|
173
|
+
// admit a rank the other draw would refuse — and so the closed vocabulary has
|
|
174
|
+
// exactly one author.
|
|
175
|
+
const demand = LaneDemandSchema.parse(task.demand);
|
|
96
176
|
if (!Number.isFinite(task.token_estimate) ||
|
|
97
177
|
task.token_estimate < 0 ||
|
|
98
178
|
!Number.isInteger(task.token_estimate)) {
|
|
@@ -134,11 +214,32 @@ function normalizeTask(task, root) {
|
|
|
134
214
|
file_line_counts: Object.fromEntries(Object.entries(normalizedLineCounts).sort(([left], [right]) => compareCodeUnits(left, right))),
|
|
135
215
|
rationale,
|
|
136
216
|
priority,
|
|
137
|
-
|
|
138
|
-
risk,
|
|
217
|
+
demand,
|
|
139
218
|
token_estimate: task.token_estimate,
|
|
219
|
+
// Sorted and deduplicated so two spellings of the same lane cannot produce
|
|
220
|
+
// two work items that differ only in tag order (the prompt digest is a
|
|
221
|
+
// content hash of this shape, and an incidentally-ordered array is a churn
|
|
222
|
+
// source — see the stable-order rule).
|
|
223
|
+
...(Array.isArray(task.tags)
|
|
224
|
+
? { tags: [...new Set(task.tags)].sort(compareCodeUnits) }
|
|
225
|
+
: {}),
|
|
140
226
|
};
|
|
141
227
|
}
|
|
228
|
+
/**
|
|
229
|
+
* The lane tag whose contract asks for `verification` metadata — the shared
|
|
230
|
+
* {@link LENS_VERIFICATION_TAG}, imported rather than spelled again.
|
|
231
|
+
*
|
|
232
|
+
* WHAT THE IMPORT BUYS, exactly: every reader in this package that gates on the
|
|
233
|
+
* lane compiles against ONE declaration, so a rename of the constant moves all
|
|
234
|
+
* of them together at build time. It buys nothing at RUNTIME — no test catches a
|
|
235
|
+
* rename of the constant's VALUE, because a test can only compare the constant
|
|
236
|
+
* to itself. That is the whole claim, and it is enough: the failure the import
|
|
237
|
+
* removes is the one where two spellings drift apart in a source tree, which is
|
|
238
|
+
* what a hand-copied literal produced here.
|
|
239
|
+
*/
|
|
240
|
+
function isVerificationLane(tags) {
|
|
241
|
+
return tags?.includes(LENS_VERIFICATION_TAG) ?? false;
|
|
242
|
+
}
|
|
142
243
|
function buildPrompt(task, resultPath) {
|
|
143
244
|
const assignment = stableStringify({
|
|
144
245
|
file_line_counts: task.file_line_counts,
|
|
@@ -150,18 +251,179 @@ function buildPrompt(task, resultPath) {
|
|
|
150
251
|
task_id: task.task_id,
|
|
151
252
|
unit_id: task.unit_id,
|
|
152
253
|
});
|
|
254
|
+
// LANE-AWARE, because the two lanes' contracts genuinely differ: the steward
|
|
255
|
+
// lane is INSTRUCTED (by its task rationale) to return verification metadata,
|
|
256
|
+
// and the base lane is not. Rendering one envelope sentence for both would
|
|
257
|
+
// either ask the base lane for a field its ingest discards, or tell the
|
|
258
|
+
// steward lane "exactly" a key set that refuses what its own instruction
|
|
259
|
+
// demands. The ask and the envelope are the same fact, so they are stated
|
|
260
|
+
// from the same predicate.
|
|
261
|
+
const verificationLane = isVerificationLane(task.tags);
|
|
153
262
|
return [
|
|
154
263
|
"Perform the bounded semantic audit work item below.",
|
|
155
264
|
"Review every listed file and return one JSON object at the bound result path.",
|
|
156
265
|
`Assignment: ${assignment}`,
|
|
157
|
-
|
|
266
|
+
verificationLane
|
|
267
|
+
? "Result contract: audit-host-result/v1alpha1 with exactly result_id, run_id, work_item_id, prompt_sha256, file_coverage, findings, and verification in addition to contract_version."
|
|
268
|
+
: "Result contract: audit-host-result/v1alpha1 with exactly result_id, run_id, work_item_id, prompt_sha256, file_coverage, and findings in addition to contract_version.",
|
|
158
269
|
"Each file_coverage entry must contain exactly path, reviewed_lines, and total_lines.",
|
|
159
270
|
// The finding contract is CARRIED, not referenced: it is rendered from the
|
|
160
271
|
// very schema ingestion enforces, so a host never has to remember or fetch it.
|
|
161
272
|
...findingContractPromptLines(),
|
|
162
273
|
"Do not supply a `grounding` field on any finding — grounding is computed by the tool at ingest by re-reading your cited quoted_text from disk, and a supplied one rejects the whole submission.",
|
|
274
|
+
...(verificationLane ? verificationContractPromptLines() : []),
|
|
163
275
|
].join("\n");
|
|
164
276
|
}
|
|
277
|
+
/**
|
|
278
|
+
* The `verification` contract rendered into a steward-lane work item's prompt.
|
|
279
|
+
*
|
|
280
|
+
* CARRIED for the same reason the finding contract is: the host cannot comply
|
|
281
|
+
* with a contract it is never shown, and this one is three-deep (booleans, three
|
|
282
|
+
* concern arrays, and an array of AuditTask-shaped follow-up suggestions whose
|
|
283
|
+
* `file_paths` must lie inside the packet boundary). Rendered from the schema
|
|
284
|
+
* ingestion enforces, so the prompt cannot describe a shape the parse refuses.
|
|
285
|
+
*/
|
|
286
|
+
function verificationContractPromptLines() {
|
|
287
|
+
return [
|
|
288
|
+
"This work item is a LENS STEWARD VERIFICATION task, so it also accepts an optional `verification` object.",
|
|
289
|
+
`verification, when present, must contain exactly ${VERIFICATION_CONTRACT_KEYS.join(", ")} — all six, with no extra key: verified and needs_followup are booleans, concerns, coverage_concerns and confidence_concerns are arrays of non-empty strings (a genuine "nothing to report" is an empty array, not an omitted field), and followup_tasks is an array of objects.`,
|
|
290
|
+
`Each verification.followup_tasks entry must contain exactly ${VERIFICATION_FOLLOWUP_KEYS.join(", ")} — all six, with no extra key: file_paths is a non-empty array of non-empty repo-relative strings, each naming a file within THIS work item's file_coverage or packet boundary; lens must be the lens of THIS task; task_id, unit_id, pass_id and rationale must be non-empty strings.`,
|
|
291
|
+
"Set needs_followup true only when followup_tasks is non-empty — a follow-up request with no bounded task is refused.",
|
|
292
|
+
];
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* The steward `verification` object's key set and its follow-up entry's key set,
|
|
296
|
+
* declared ONCE. Three statements read them — the prompt lines, the enforcement,
|
|
297
|
+
* and the refusal they share — because a second hand-maintained copy of a key
|
|
298
|
+
* list is exactly how a prompt and a parser drift apart, which is the defect
|
|
299
|
+
* class {@link verificationContractFailure} exists to close.
|
|
300
|
+
*/
|
|
301
|
+
const VERIFICATION_CONTRACT_KEYS = [
|
|
302
|
+
"verified",
|
|
303
|
+
"needs_followup",
|
|
304
|
+
"concerns",
|
|
305
|
+
"coverage_concerns",
|
|
306
|
+
"confidence_concerns",
|
|
307
|
+
"followup_tasks",
|
|
308
|
+
];
|
|
309
|
+
const VERIFICATION_FOLLOWUP_KEYS = [
|
|
310
|
+
"task_id",
|
|
311
|
+
"unit_id",
|
|
312
|
+
"pass_id",
|
|
313
|
+
"lens",
|
|
314
|
+
"file_paths",
|
|
315
|
+
"rationale",
|
|
316
|
+
];
|
|
317
|
+
/** The exact-key-set refusal, shared by the object and its entries. */
|
|
318
|
+
function exactKeysFailure(label, present, expected) {
|
|
319
|
+
const extra = present.filter((key) => !expected.includes(key));
|
|
320
|
+
const missing = expected.filter((key) => !present.includes(key));
|
|
321
|
+
if (extra.length === 0 && missing.length === 0)
|
|
322
|
+
return null;
|
|
323
|
+
const broken = [
|
|
324
|
+
...missing.map((key) => `missing ${key}`),
|
|
325
|
+
...extra.map((key) => `unexpected ${key}`),
|
|
326
|
+
];
|
|
327
|
+
return `${label} must contain exactly ${expected.join(", ")} (received: ${broken.join(", ")})`;
|
|
328
|
+
}
|
|
329
|
+
function isNonEmptyStringArray(value) {
|
|
330
|
+
return (Array.isArray(value) &&
|
|
331
|
+
value.every((entry) => typeof entry === "string" && entry.length > 0));
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* This door's inputs to the ONE containment rule
|
|
335
|
+
* ({@link verificationAllowedPaths}, `src/audit/validation/auditResults.ts`):
|
|
336
|
+
* the binding's file set (the work item's own boundary, persisted at prepare)
|
|
337
|
+
* plus the submitted envelope's coverage paths. No packet boundary here — the
|
|
338
|
+
* host door judges a single work item's own coverage, and the batch door is the
|
|
339
|
+
* one that sees siblings. Both build their set through the shared rule anyway,
|
|
340
|
+
* so a change to how a path is normalized or admitted reaches both.
|
|
341
|
+
*/
|
|
342
|
+
function verificationAllowedPathsForEnvelope(binding, envelope) {
|
|
343
|
+
return verificationAllowedPaths({
|
|
344
|
+
assignedPaths: Object.keys(binding.file_line_counts),
|
|
345
|
+
coveragePaths: Array.isArray(envelope.file_coverage)
|
|
346
|
+
? envelope.file_coverage.flatMap((entry) => isRecord(entry) && typeof entry.path === "string" ? [entry.path] : [])
|
|
347
|
+
: [],
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Every property the steward prompt CLAIMS about the `verification` object,
|
|
352
|
+
* enforced at the host-result boundary — a claim the prompt makes and the
|
|
353
|
+
* envelope does not back is the exact failure the project rule bans. Returns
|
|
354
|
+
* the first broken property's refusal detail, or `null` when the object
|
|
355
|
+
* satisfies every stated rule.
|
|
356
|
+
*
|
|
357
|
+
* The rules mirror {@link verificationContractPromptLines} one-for-one:
|
|
358
|
+
* 1. `verification` must contain exactly its six keys — no extra, no missing.
|
|
359
|
+
* 2. `needs_followup` true ⇒ `followup_tasks` present and non-empty.
|
|
360
|
+
* 3. each `followup_tasks` entry must contain exactly its six keys, its
|
|
361
|
+
* `lens` equal to the task's lens, and each `file_paths` string inside the
|
|
362
|
+
* packet boundary.
|
|
363
|
+
*
|
|
364
|
+
* Reused over the shared `AuditVerificationSchema` deliberately: that schema is
|
|
365
|
+
* NON-STRICT (its arrays are optional, it drops unknown keys) because the
|
|
366
|
+
* follow-up builder tolerates a partial object and the follow-up-task shape
|
|
367
|
+
* (`AuditTaskSchema`) is a superset of what the prompt names. The prompt is the
|
|
368
|
+
* stricter claim, so the stricter check lives HERE, at the door that reads the
|
|
369
|
+
* field, rather than tightening a schema other readers lean on.
|
|
370
|
+
*/
|
|
371
|
+
function verificationContractFailure(verification, binding, envelope) {
|
|
372
|
+
if (!isRecord(verification)) {
|
|
373
|
+
return `verification must be an object with exactly ${VERIFICATION_CONTRACT_KEYS.join(", ")}`;
|
|
374
|
+
}
|
|
375
|
+
const keysFailure = exactKeysFailure("verification", Object.keys(verification), VERIFICATION_CONTRACT_KEYS);
|
|
376
|
+
if (keysFailure !== null)
|
|
377
|
+
return keysFailure;
|
|
378
|
+
if (typeof verification.verified !== "boolean") {
|
|
379
|
+
return "verification.verified must be a boolean";
|
|
380
|
+
}
|
|
381
|
+
if (typeof verification.needs_followup !== "boolean") {
|
|
382
|
+
return "verification.needs_followup must be a boolean";
|
|
383
|
+
}
|
|
384
|
+
for (const field of ["concerns", "coverage_concerns", "confidence_concerns"]) {
|
|
385
|
+
if (!isNonEmptyStringArray(verification[field])) {
|
|
386
|
+
return `verification.${field} must be an array of non-empty strings`;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
const followup = verification.followup_tasks;
|
|
390
|
+
if (!Array.isArray(followup)) {
|
|
391
|
+
return "verification.followup_tasks must be an array of objects";
|
|
392
|
+
}
|
|
393
|
+
if (verification.needs_followup === true && followup.length === 0) {
|
|
394
|
+
return "needs_followup is true but followup_tasks is empty — a follow-up request with no bounded task is refused";
|
|
395
|
+
}
|
|
396
|
+
const allowed = verificationAllowedPathsForEnvelope(binding, envelope);
|
|
397
|
+
for (let index = 0; index < followup.length; index++) {
|
|
398
|
+
const label = `verification.followup_tasks[${index}]`;
|
|
399
|
+
const entry = followup[index];
|
|
400
|
+
if (!isRecord(entry)) {
|
|
401
|
+
return `${label} must be an object`;
|
|
402
|
+
}
|
|
403
|
+
const entryKeysFailure = exactKeysFailure(label, Object.keys(entry), VERIFICATION_FOLLOWUP_KEYS);
|
|
404
|
+
if (entryKeysFailure !== null)
|
|
405
|
+
return entryKeysFailure;
|
|
406
|
+
for (const field of ["task_id", "unit_id", "pass_id", "rationale"]) {
|
|
407
|
+
if (typeof entry[field] !== "string" || entry[field].length === 0) {
|
|
408
|
+
return `${label}.${field} must be a non-empty string`;
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
if (entry.lens !== binding.lens) {
|
|
412
|
+
return `${label}.lens must equal the task's lens ` +
|
|
413
|
+
`(expected '${binding.lens}', got '${String(entry.lens)}')`;
|
|
414
|
+
}
|
|
415
|
+
if (!isNonEmptyStringArray(entry.file_paths) || entry.file_paths.length === 0) {
|
|
416
|
+
return `${label}.file_paths must be a non-empty array of non-empty strings`;
|
|
417
|
+
}
|
|
418
|
+
for (const path of entry.file_paths) {
|
|
419
|
+
if (!allowed.has(normalizeCoveragePath(path))) {
|
|
420
|
+
return `${label}.file_paths references '${path}', ` +
|
|
421
|
+
"which is outside this work item's file_coverage or packet boundary";
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
return null;
|
|
426
|
+
}
|
|
165
427
|
function buildWorkItem(paths, task) {
|
|
166
428
|
const resultPath = resultPathFor(paths, task.task_id);
|
|
167
429
|
const promptText = buildPrompt(task, resultPath);
|
|
@@ -169,8 +431,7 @@ function buildWorkItem(paths, task) {
|
|
|
169
431
|
id: task.task_id,
|
|
170
432
|
lens: task.lens,
|
|
171
433
|
metadata: {
|
|
172
|
-
|
|
173
|
-
risk: task.risk,
|
|
434
|
+
demand: task.demand,
|
|
174
435
|
token_estimate: task.token_estimate,
|
|
175
436
|
},
|
|
176
437
|
prompt: {
|
|
@@ -273,30 +534,48 @@ export async function prepareAuditHostHandoff(params) {
|
|
|
273
534
|
pass_id: task.pass_id,
|
|
274
535
|
lens: task.lens,
|
|
275
536
|
file_line_counts: Object.fromEntries(item.scope.files.map((path) => [path, task.file_line_counts[path]])),
|
|
537
|
+
tags: [...(task.tags ?? [])],
|
|
276
538
|
};
|
|
277
539
|
}),
|
|
278
540
|
};
|
|
279
541
|
await mkdir(paths.resultDir, { recursive: true });
|
|
280
542
|
await writeJsonFile(paths.taskBindingsPath, taskBindings);
|
|
281
|
-
//
|
|
282
|
-
//
|
|
283
|
-
//
|
|
284
|
-
//
|
|
543
|
+
// Say out loud whether this wave has drained. The caller hands in the run's
|
|
544
|
+
// still-OWED partition, so an EMPTY one is the wave's own statement that every
|
|
545
|
+
// work item it published has been accepted — and that is the only evidence
|
|
546
|
+
// there is: from the review-run resolution, a fully-accepted wave and a wave
|
|
547
|
+
// with one lane still out look identical (both are "fewer pending than
|
|
548
|
+
// published"). The next wave's identity is derived from this, so it is written
|
|
549
|
+
// where the run itself lives and never inferred. A comment stating this does
|
|
550
|
+
// NOT survive; the marker is what does.
|
|
551
|
+
await writeJsonFile(reviewWaveClosedPath(params.artifactsDir, params.runId), {
|
|
552
|
+
contract_version: REVIEW_WAVE_CLOSED_CONTRACT_VERSION,
|
|
553
|
+
run_id: params.runId,
|
|
554
|
+
closed: allWorkItems.length === 0,
|
|
555
|
+
});
|
|
556
|
+
// What is PUBLISHED is every task this caller handed in. This boundary does
|
|
557
|
+
// not suppress work items the accepted ledger names, and deliberately so —
|
|
558
|
+
// the ledger records what ARRIVED, it never decides what is still OWED.
|
|
559
|
+
//
|
|
560
|
+
// A suppression filter used to sit here, keyed on the whole accepted set. It
|
|
561
|
+
// read as "do not re-ask for work already delivered", but the set it consulted
|
|
562
|
+
// was historical: a task that was accepted, re-planned, and is pending again
|
|
563
|
+
// stayed suppressed forever, so a re-opened item was silently invisible to
|
|
564
|
+
// replay — the one failure mode the ingest's own dedupe (fresh, per-binding,
|
|
565
|
+
// `bindingIdentity` over work item × prompt digest) already covers correctly.
|
|
566
|
+
// The ledger read and its paired rewrite still sit inside the one
|
|
567
|
+
// acquisition: a prepare that snapshotted before a concurrent ingest's
|
|
568
|
+
// additions must not replace them with its stale copy.
|
|
285
569
|
return withAcceptedResultsLock(paths, params.logger, async (accepted) => {
|
|
286
|
-
const acceptedBindings = new Set(accepted.entries.map(bindingIdentity));
|
|
287
|
-
const workItems = allWorkItems.filter((item) => !acceptedBindings.has(bindingIdentity({
|
|
288
|
-
work_item_id: item.id,
|
|
289
|
-
prompt_sha256: item.prompt.sha256,
|
|
290
|
-
})));
|
|
291
570
|
const workload = {
|
|
292
571
|
contract_version: WORKLOAD_CONTRACT_VERSION,
|
|
293
572
|
run_id: params.runId,
|
|
294
|
-
work_items:
|
|
573
|
+
work_items: allWorkItems,
|
|
295
574
|
};
|
|
296
575
|
const resultMap = {
|
|
297
576
|
contract_version: RESULT_MAP_CONTRACT_VERSION,
|
|
298
577
|
run_id: params.runId,
|
|
299
|
-
entries:
|
|
578
|
+
entries: allWorkItems.map((item) => ({
|
|
300
579
|
work_item_id: item.id,
|
|
301
580
|
prompt_sha256: item.prompt.sha256,
|
|
302
581
|
result_path: item.result_path,
|
|
@@ -327,9 +606,8 @@ function parseWorkItem(value) {
|
|
|
327
606
|
typeof value.lens !== "string" ||
|
|
328
607
|
typeof value.result_path !== "string" ||
|
|
329
608
|
!isRecord(value.metadata) ||
|
|
330
|
-
!hasExactKeys(value.metadata, ["
|
|
331
|
-
|
|
332
|
-
typeof value.metadata.risk !== "string" ||
|
|
609
|
+
!hasExactKeys(value.metadata, ["demand", "token_estimate"]) ||
|
|
610
|
+
!LaneDemandSchema.safeParse(value.metadata.demand).success ||
|
|
333
611
|
!Number.isInteger(value.metadata.token_estimate) ||
|
|
334
612
|
!isRecord(value.prompt) ||
|
|
335
613
|
!hasExactKeys(value.prompt, ["sha256", "text"]) ||
|
|
@@ -346,6 +624,78 @@ function parseWorkItem(value) {
|
|
|
346
624
|
}
|
|
347
625
|
return value;
|
|
348
626
|
}
|
|
627
|
+
/**
|
|
628
|
+
* A persisted workload this draw refuses as STALE — issued under a contract
|
|
629
|
+
* version this build no longer mints.
|
|
630
|
+
*
|
|
631
|
+
* A contract-version bump changes the work item's SHAPE (v1alpha1's
|
|
632
|
+
* `{complexity, risk}` metadata became v1alpha2's shared `demand` ranking), so
|
|
633
|
+
* the document on disk cannot be re-derived against the current builder and no
|
|
634
|
+
* submission can be accepted against it. The class is worth its own type
|
|
635
|
+
* because it has exactly ONE repair — re-prepare, which publishes a current
|
|
636
|
+
* workload — and a host holding a bound result path from the stale document
|
|
637
|
+
* must be told that rather than told its bytes are the wrong shape.
|
|
638
|
+
*
|
|
639
|
+
* Without this the whole class escaped as a bare `Invalid audit host work item`
|
|
640
|
+
* throw out of the fold: a message that named neither the version found, nor
|
|
641
|
+
* the version expected, nor the repair. The remediate twin took the same cut at
|
|
642
|
+
* its own v1alpha2 (`REMEDIATION_HOST_WORKLOAD_CONTRACT_VERSION`, ed033294),
|
|
643
|
+
* where a v1alpha1 document refuses closed the same way.
|
|
644
|
+
*/
|
|
645
|
+
class StaleAuditHostWorkloadError extends Error {
|
|
646
|
+
found_contract_version;
|
|
647
|
+
expected_contract_version;
|
|
648
|
+
/** The registered ingestion check the refusal is attributable to. */
|
|
649
|
+
check = "workload_binding";
|
|
650
|
+
/** The audit issue vocabulary's name for this class of refusal. */
|
|
651
|
+
code = "workload_stale";
|
|
652
|
+
constructor(found_contract_version, expected_contract_version) {
|
|
653
|
+
super("the persisted audit host workload is STALE: it was issued under contract " +
|
|
654
|
+
`version ${JSON.stringify(found_contract_version)}, but this build mints ` +
|
|
655
|
+
`${expected_contract_version}. A version bump changes the work item shape, so the ` +
|
|
656
|
+
"document cannot be re-derived and no submission can be accepted against it — " +
|
|
657
|
+
"re-prepare the handoff to publish a current workload.");
|
|
658
|
+
this.found_contract_version = found_contract_version;
|
|
659
|
+
this.expected_contract_version = expected_contract_version;
|
|
660
|
+
this.name = "StaleAuditHostWorkloadError";
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
/**
|
|
664
|
+
* A persisted binding set this build no longer mints — the task-binding twin of
|
|
665
|
+
* {@link StaleAuditHostWorkloadError}, and classified by the same rule.
|
|
666
|
+
*
|
|
667
|
+
* It exists as a CLASS and not as a plain throw because of what the fold does
|
|
668
|
+
* with an uncaught error: `runHostDelegationObligation` rethrows everything that
|
|
669
|
+
* is not ENOENT, and it ingests BEFORE the one path that re-prepares
|
|
670
|
+
* (`ensureSemanticReviewRunUnlocked` → `renderSemanticReviewStep` →
|
|
671
|
+
* `prepareAuditHostHandoff`, the ONLY writer of this file). A bare throw
|
|
672
|
+
* therefore aborted the fold before the re-prepare, the blocked-step backstop
|
|
673
|
+
* wrote a blocked step, and every later `next-step` failed identically with the
|
|
674
|
+
* bindings file still at the old version — a wedge produced by a file the tool
|
|
675
|
+
* had written itself.
|
|
676
|
+
*
|
|
677
|
+
* Classified, the ingest returns it as an ISSUE and the fold walks on to the
|
|
678
|
+
* re-prepare in the SAME call, which rewrites the whole set at the current
|
|
679
|
+
* version. The stale file is then read by nothing.
|
|
680
|
+
*/
|
|
681
|
+
class StaleAuditHostTaskBindingsError extends Error {
|
|
682
|
+
found_contract_version;
|
|
683
|
+
expected_contract_version;
|
|
684
|
+
/** The registered ingestion check the refusal is attributable to. */
|
|
685
|
+
check = "workload_binding";
|
|
686
|
+
/** The audit issue vocabulary's name for this class of refusal. */
|
|
687
|
+
code = "workload_stale";
|
|
688
|
+
constructor(found_contract_version, expected_contract_version) {
|
|
689
|
+
super("the persisted audit host task bindings are STALE: they were issued under " +
|
|
690
|
+
`contract version ${JSON.stringify(found_contract_version)}, but this build ` +
|
|
691
|
+
`mints ${expected_contract_version}. A version bump changes the binding SHAPE, ` +
|
|
692
|
+
"so the set cannot be re-derived and no submission bound against it can be " +
|
|
693
|
+
`accepted — ${TASK_BINDINGS_VERSION_REMEDY}.`);
|
|
694
|
+
this.found_contract_version = found_contract_version;
|
|
695
|
+
this.expected_contract_version = expected_contract_version;
|
|
696
|
+
this.name = "StaleAuditHostTaskBindingsError";
|
|
697
|
+
}
|
|
698
|
+
}
|
|
349
699
|
function parseWorkload(value, runId) {
|
|
350
700
|
// Envelope + all-items parsing is the CORE's scaffolding; the audit draw
|
|
351
701
|
// selects only its own contract version and item parser.
|
|
@@ -354,11 +704,21 @@ function parseWorkload(value, runId) {
|
|
|
354
704
|
runId,
|
|
355
705
|
});
|
|
356
706
|
if (!envelope.ok) {
|
|
357
|
-
|
|
707
|
+
// The core's envelope check is a conjunction, so it reports "wrong version",
|
|
708
|
+
// "wrong run" and "not a workload at all" identically. The STALE case is the
|
|
709
|
+
// one that must be separated — it is the one with a named repair — so the
|
|
710
|
+
// raw document's own version is read here, before the generic refusal, and
|
|
711
|
+
// any DIFFERENT version (present, but not ours) is classified as stale.
|
|
712
|
+
if (isRecord(value) &&
|
|
713
|
+
"contract_version" in value &&
|
|
714
|
+
value.contract_version !== WORKLOAD_CONTRACT_VERSION) {
|
|
715
|
+
throw new StaleAuditHostWorkloadError(value.contract_version, WORKLOAD_CONTRACT_VERSION);
|
|
716
|
+
}
|
|
717
|
+
throw bindingFailure("workload_binding", "Invalid audit host workload");
|
|
358
718
|
}
|
|
359
719
|
const workItems = parseAllWorkloadItems(envelope.rawItems, parseWorkItem);
|
|
360
720
|
if (workItems === null) {
|
|
361
|
-
throw
|
|
721
|
+
throw bindingFailure("workload_binding", "Invalid audit host work item");
|
|
362
722
|
}
|
|
363
723
|
return value;
|
|
364
724
|
}
|
|
@@ -389,6 +749,7 @@ function parseTaskBinding(value) {
|
|
|
389
749
|
"pass_id",
|
|
390
750
|
"prompt_sha256",
|
|
391
751
|
"result_path",
|
|
752
|
+
"tags",
|
|
392
753
|
"unit_id",
|
|
393
754
|
"work_item_id",
|
|
394
755
|
]) ||
|
|
@@ -398,6 +759,13 @@ function parseTaskBinding(value) {
|
|
|
398
759
|
typeof value.unit_id !== "string" ||
|
|
399
760
|
typeof value.pass_id !== "string" ||
|
|
400
761
|
typeof value.lens !== "string" ||
|
|
762
|
+
// REQUIRED, and refused as a VERSION problem rather than a shape problem —
|
|
763
|
+
// see parseTaskBindings. A binding without the lane stamp cannot be judged:
|
|
764
|
+
// the lane decides which result contract this item's prompt carried, so an
|
|
765
|
+
// absent stamp is not a field to default, it is an item whose contract is
|
|
766
|
+
// unknown.
|
|
767
|
+
!Array.isArray(value.tags) ||
|
|
768
|
+
!value.tags.every((entry) => typeof entry === "string") ||
|
|
401
769
|
!isRecord(value.file_line_counts) ||
|
|
402
770
|
!Object.values(value.file_line_counts).every((count) => Number.isInteger(count) && count >= 0)) {
|
|
403
771
|
return null;
|
|
@@ -407,11 +775,20 @@ function parseTaskBinding(value) {
|
|
|
407
775
|
function parseTaskBindings(value, runId) {
|
|
408
776
|
if (!isRecord(value) ||
|
|
409
777
|
!hasExactKeys(value, ["contract_version", "entries", "run_id"]) ||
|
|
410
|
-
value.contract_version !== TASK_BINDINGS_CONTRACT_VERSION ||
|
|
411
778
|
value.run_id !== runId ||
|
|
412
779
|
!Array.isArray(value.entries)) {
|
|
413
780
|
throw new Error("Invalid audit host task bindings");
|
|
414
781
|
}
|
|
782
|
+
// The VERSION is checked on its OWN, before the shape walk, so a binding set
|
|
783
|
+
// written under an older version is refused for THAT reason and carries the
|
|
784
|
+
// remedy. Folded into the predicate below it would be one more way to produce
|
|
785
|
+
// "Invalid audit host task bindings", which tells an operator nothing about
|
|
786
|
+
// what to do and reads as a corrupt file rather than a stale one. The class
|
|
787
|
+
// is what the ingest CLASSIFIES on (see `ingestAuditHostResults`) instead of
|
|
788
|
+
// letting the throw abort the fold before it re-prepares.
|
|
789
|
+
if (value.contract_version !== TASK_BINDINGS_CONTRACT_VERSION) {
|
|
790
|
+
throw new StaleAuditHostTaskBindingsError(value.contract_version, TASK_BINDINGS_CONTRACT_VERSION);
|
|
791
|
+
}
|
|
415
792
|
const bindings = new Map();
|
|
416
793
|
for (const rawEntry of value.entries) {
|
|
417
794
|
const entry = parseTaskBinding(rawEntry);
|
|
@@ -475,27 +852,27 @@ function issueLocation(prefix, path) {
|
|
|
475
852
|
function parseFindings(findings) {
|
|
476
853
|
const parsedFindings = [];
|
|
477
854
|
for (const [index, finding] of findings.entries()) {
|
|
478
|
-
//
|
|
479
|
-
//
|
|
480
|
-
//
|
|
481
|
-
//
|
|
482
|
-
//
|
|
483
|
-
//
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
}
|
|
855
|
+
// The TOOL-owned verdicts are REFUSED, never silently overwritten: the host
|
|
856
|
+
// must see that the field is not its to send, and a value the worker
|
|
857
|
+
// supplied for one of these is by construction a self-certification of the
|
|
858
|
+
// bit ingestion exists to compute. Stated ahead of the schema check because
|
|
859
|
+
// this message names the field as the WORKER's mistake; the strict schema
|
|
860
|
+
// would report it only as an unrecognized key.
|
|
861
|
+
//
|
|
862
|
+
// The list is the schema's own omit set (`WORKER_REFUSED_FINDING_VERDICTS`
|
|
863
|
+
// feeds both), so a verdict cannot be refused here and advertised there, or
|
|
864
|
+
// the reverse. `evidence_lane` is the load-bearing one: synthesis reads it
|
|
865
|
+
// to decide whether a `critical` was ever asked for an `evidence` array, so
|
|
866
|
+
// a supplied lane is a finding exempting ITSELF from the bar.
|
|
867
|
+
if (isRecord(finding)) {
|
|
868
|
+
for (const [verdict, reason] of Object.entries(WORKER_REFUSED_FINDING_VERDICTS)) {
|
|
869
|
+
if (verdict in finding) {
|
|
870
|
+
return {
|
|
871
|
+
ok: false,
|
|
872
|
+
detail: `findings[${index}].${verdict}: ${reason}`,
|
|
873
|
+
};
|
|
874
|
+
}
|
|
875
|
+
}
|
|
499
876
|
}
|
|
500
877
|
// The STRICT WORKER PROJECTION — the same contract the dispatch prompt
|
|
501
878
|
// renders (`findingContractPromptLines`). Parsing the lenient base schema
|
|
@@ -518,30 +895,54 @@ function parseFindings(findings) {
|
|
|
518
895
|
return { ok: true, findings: parsedFindings };
|
|
519
896
|
}
|
|
520
897
|
function parseHostResult(value, runId, item, binding) {
|
|
898
|
+
const hasVerification = isRecord(value) && Object.hasOwn(value, "verification");
|
|
521
899
|
if (!isRecord(value) ||
|
|
522
900
|
!hasExactKeys(value, [
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
"
|
|
529
|
-
"work_item_id",
|
|
901
|
+
...AUDIT_RESULT_ENVELOPE_KEYS,
|
|
902
|
+
// `verification` is the ONE optional key: required of no lane, asked of
|
|
903
|
+
// the steward lane, and refused when supplied to a lane whose contract
|
|
904
|
+
// never mentions it (see the lane check below). Every other key stays
|
|
905
|
+
// exact, so the envelope still admits nothing a host invents.
|
|
906
|
+
...(hasVerification ? ["verification"] : []),
|
|
530
907
|
]) ||
|
|
531
908
|
value.contract_version !== RESULT_CONTRACT_VERSION ||
|
|
532
909
|
typeof value.result_id !== "string" ||
|
|
533
910
|
value.result_id.length === 0) {
|
|
534
911
|
return refuse("result_envelope", `result envelope is not ${RESULT_CONTRACT_VERSION} with exactly contract_version, ` +
|
|
535
|
-
`result_id, run_id, work_item_id, prompt_sha256, file_coverage and findings`
|
|
912
|
+
`result_id, run_id, work_item_id, prompt_sha256, file_coverage and findings` +
|
|
913
|
+
`${hasVerification ? ", and at most one verification object" : ""}`);
|
|
536
914
|
}
|
|
537
|
-
|
|
538
|
-
|
|
915
|
+
// The identity walk is the CORE's, in the core's order AND in the core's
|
|
916
|
+
// words, so both draws report the same first-broken component, described the
|
|
917
|
+
// same way, for the same submission. Only the framing around it is this
|
|
918
|
+
// draw's. The per-component branches this replaced were a second vocabulary
|
|
919
|
+
// for the one classification — and they could not cover `result_id` at all,
|
|
920
|
+
// because the envelope check above already requires a non-empty one, so that
|
|
921
|
+
// component's failure had no branch and read as fully bound.
|
|
922
|
+
const identityFailure = identityFailureDiagnostic(value, {
|
|
923
|
+
runId,
|
|
924
|
+
workItemId: item.id,
|
|
925
|
+
promptSha256: item.prompt.sha256,
|
|
926
|
+
});
|
|
927
|
+
if (identityFailure !== null) {
|
|
928
|
+
return refuse("identity_binding", `identity binding: ${identityFailure}`);
|
|
539
929
|
}
|
|
540
|
-
|
|
541
|
-
|
|
930
|
+
// The lane gate. `verification` is admitted by the envelope so the steward
|
|
931
|
+
// lane can deliver what its own instruction asks for — but a base-lane work
|
|
932
|
+
// item's prompt never mentions it, so a submission carrying one is answering
|
|
933
|
+
// an ask that was never made. Refusing it HERE (rather than ignoring it) is
|
|
934
|
+
// what keeps the field from becoming a way to smuggle unattested metadata
|
|
935
|
+
// past a contract that does not describe it: `validateVerification` would
|
|
936
|
+
// merely WARN, and a warning on an accepted result is not a gate.
|
|
937
|
+
if (hasVerification && !isVerificationLane(binding.tags)) {
|
|
938
|
+
return refuse("result_envelope", "verification metadata was supplied for a work item whose contract does not request it; " +
|
|
939
|
+
"remove the field or submit it through a lens_verification work item");
|
|
542
940
|
}
|
|
543
|
-
if (
|
|
544
|
-
|
|
941
|
+
if (hasVerification) {
|
|
942
|
+
const verificationFailure = verificationContractFailure(value.verification, binding, value);
|
|
943
|
+
if (verificationFailure !== null) {
|
|
944
|
+
return refuse("result_envelope", verificationFailure);
|
|
945
|
+
}
|
|
545
946
|
}
|
|
546
947
|
if (!Array.isArray(value.file_coverage)) {
|
|
547
948
|
return refuse("file_coverage", "file coverage: file_coverage must be an array");
|
|
@@ -601,6 +1002,12 @@ function toAuditResult(result, binding) {
|
|
|
601
1002
|
const findings = result.findings.map((finding) => ({
|
|
602
1003
|
...finding,
|
|
603
1004
|
lens: finding.lens ?? binding.lens,
|
|
1005
|
+
// The LANE stamp, at the ingest that knows which contract the finding
|
|
1006
|
+
// arrived on — the per-file worker contract, since that is the only door
|
|
1007
|
+
// this module parses. Stamped rather than left absent so a reader never has
|
|
1008
|
+
// to decide whether an absent value is the per-file default or a finding
|
|
1009
|
+
// that predates the field (see `FindingEvidenceLaneSchema`).
|
|
1010
|
+
evidence_lane: "per-file-lane",
|
|
604
1011
|
}));
|
|
605
1012
|
const parsed = AuditResultSchema.safeParse({
|
|
606
1013
|
task_id: binding.work_item_id,
|
|
@@ -608,6 +1015,7 @@ function toAuditResult(result, binding) {
|
|
|
608
1015
|
pass_id: binding.pass_id,
|
|
609
1016
|
lens: binding.lens,
|
|
610
1017
|
file_coverage: result.file_coverage
|
|
1018
|
+
// construction-site: CoverageFileRecord
|
|
611
1019
|
.map((coverage) => ({
|
|
612
1020
|
path: coverage.path,
|
|
613
1021
|
total_lines: coverage.total_lines,
|
|
@@ -616,6 +1024,13 @@ function toAuditResult(result, binding) {
|
|
|
616
1024
|
findings,
|
|
617
1025
|
reviewed_clean: result.findings.length === 0,
|
|
618
1026
|
run_id: result.run_id,
|
|
1027
|
+
// Threaded through, not re-validated: `AuditResultSchema` declares
|
|
1028
|
+
// `verification` and the ONE validator (`validateVerification`, reached from
|
|
1029
|
+
// `validateAuditResults` at the caller) judges its interior. Validating it a
|
|
1030
|
+
// second time here would be a second rule that can drift from the first.
|
|
1031
|
+
...(result.verification === undefined
|
|
1032
|
+
? {}
|
|
1033
|
+
: { verification: result.verification }),
|
|
619
1034
|
});
|
|
620
1035
|
if (parsed.success)
|
|
621
1036
|
return { ok: true, auditResult: parsed.data };
|
|
@@ -648,9 +1063,50 @@ function auditScanMessages(workItemId) {
|
|
|
648
1063
|
export async function ingestAuditHostResults(params) {
|
|
649
1064
|
const paths = resolveBoundaryPaths(params);
|
|
650
1065
|
const accepted = await loadAcceptedResults(paths.acceptedLedgerPath, params.runId);
|
|
651
|
-
|
|
1066
|
+
// A STALE persisted document is refused as a CLASSIFIED ISSUE, never as a
|
|
1067
|
+
// throw. These are the refusals with a named repair — re-prepare, which this
|
|
1068
|
+
// fold performs on its way to the next emission — so they must reach the host
|
|
1069
|
+
// as rendered diagnostics rather than as unclassified stacks out of the fold.
|
|
1070
|
+
// Nothing is accepted: a document this build did not mint cannot be
|
|
1071
|
+
// re-derived, so no submission has a binding to be judged against.
|
|
1072
|
+
//
|
|
1073
|
+
// The BINDING SET is in this class for one more reason than the workload is:
|
|
1074
|
+
// on the fold, a throw here lands BEFORE the one path that re-prepares, so it
|
|
1075
|
+
// wedges the run rather than surfacing anything (see
|
|
1076
|
+
// {@link StaleAuditHostTaskBindingsError}). A result the host already wrote
|
|
1077
|
+
// under the old bindings is therefore REFUSED as stale — it is never accepted
|
|
1078
|
+
// against the new contract, because the new contract's binding is what the
|
|
1079
|
+
// re-prepare mints, and the item is re-published under it.
|
|
1080
|
+
const stale = (error) => ({
|
|
1081
|
+
accepted_count: 0,
|
|
1082
|
+
accepted_results: accepted.entries.map((entry) => entry.audit_result),
|
|
1083
|
+
accepted_results_path: paths.acceptedResultsPath,
|
|
1084
|
+
completed_work_item_ids: [
|
|
1085
|
+
...new Set(accepted.entries.map((entry) => entry.work_item_id)),
|
|
1086
|
+
].sort(compareCodeUnits),
|
|
1087
|
+
issues: [error],
|
|
1088
|
+
raw_issues: [error],
|
|
1089
|
+
validation_warnings: [],
|
|
1090
|
+
});
|
|
1091
|
+
let workload;
|
|
1092
|
+
try {
|
|
1093
|
+
workload = parseWorkload(await readJsonFile(paths.workloadPath), params.runId);
|
|
1094
|
+
}
|
|
1095
|
+
catch (error) {
|
|
1096
|
+
if (!(error instanceof StaleAuditHostWorkloadError))
|
|
1097
|
+
throw error;
|
|
1098
|
+
return stale(error);
|
|
1099
|
+
}
|
|
652
1100
|
const resultMap = parseResultMap(await readJsonFile(paths.resultMapPath), params.runId);
|
|
653
|
-
|
|
1101
|
+
let taskBindings;
|
|
1102
|
+
try {
|
|
1103
|
+
taskBindings = parseTaskBindings(await readJsonFile(paths.taskBindingsPath), params.runId);
|
|
1104
|
+
}
|
|
1105
|
+
catch (error) {
|
|
1106
|
+
if (!(error instanceof StaleAuditHostTaskBindingsError))
|
|
1107
|
+
throw error;
|
|
1108
|
+
return stale(error);
|
|
1109
|
+
}
|
|
654
1110
|
const items = validateHandoffBinding(paths, workload, resultMap, taskBindings);
|
|
655
1111
|
const acceptedBindings = new Set(accepted.entries.map(bindingIdentity));
|
|
656
1112
|
const resultIds = new Set(accepted.entries.map((entry) => entry.result_id));
|
|
@@ -757,6 +1213,8 @@ export async function ingestAuditHostResults(params) {
|
|
|
757
1213
|
finding.grounding = await verifyFindingGrounding(paths.root, finding, readSource);
|
|
758
1214
|
}
|
|
759
1215
|
resultIds.add(result.result_id);
|
|
1216
|
+
// construction-site: AuditResult
|
|
1217
|
+
// construction-site: Finding (the `findings` array; `lens` defaults from the enclosing contract, already spread in)
|
|
760
1218
|
additions.push({
|
|
761
1219
|
work_item_id: entry.work_item_id,
|
|
762
1220
|
prompt_sha256: entry.prompt_sha256,
|