audit-tools 0.56.2 → 0.57.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -22
- package/dist/audit/cli/args.d.ts +0 -1
- package/dist/audit/cli/args.d.ts.map +1 -1
- package/dist/audit/cli/args.js +0 -14
- package/dist/audit/cli/args.js.map +1 -1
- package/dist/audit/cli/auditStep.d.ts +0 -59
- package/dist/audit/cli/auditStep.d.ts.map +1 -1
- package/dist/audit/cli/auditStep.js +2 -136
- package/dist/audit/cli/auditStep.js.map +1 -1
- package/dist/audit/cli/cleanup.d.ts.map +1 -1
- package/dist/audit/cli/cleanup.js +4 -1
- package/dist/audit/cli/cleanup.js.map +1 -1
- package/dist/audit/cli/confirmIntentStep.d.ts.map +1 -1
- package/dist/audit/cli/confirmIntentStep.js +16 -31
- package/dist/audit/cli/confirmIntentStep.js.map +1 -1
- package/dist/audit/cli/dispatch/hostHandoff.d.ts +414 -1
- package/dist/audit/cli/dispatch/hostHandoff.d.ts.map +1 -1
- package/dist/audit/cli/dispatch/hostHandoff.js +223 -1
- package/dist/audit/cli/dispatch/hostHandoff.js.map +1 -1
- package/dist/audit/cli/dispatch/questionReviewAcceptance.d.ts +254 -0
- package/dist/audit/cli/dispatch/questionReviewAcceptance.d.ts.map +1 -0
- package/dist/audit/cli/dispatch/questionReviewAcceptance.js +181 -0
- package/dist/audit/cli/dispatch/questionReviewAcceptance.js.map +1 -0
- package/dist/audit/cli/functionalPreflight.d.ts +4 -4
- package/dist/audit/cli/laneSubmissions.d.ts +4 -4
- package/dist/audit/cli/nextStepCommand.d.ts +3 -20
- package/dist/audit/cli/nextStepCommand.d.ts.map +1 -1
- package/dist/audit/cli/nextStepCommand.js +39 -133
- package/dist/audit/cli/nextStepCommand.js.map +1 -1
- package/dist/audit/cli/nextStepHelpers.d.ts +10 -72
- package/dist/audit/cli/nextStepHelpers.d.ts.map +1 -1
- package/dist/audit/cli/nextStepHelpers.js +95 -363
- package/dist/audit/cli/nextStepHelpers.js.map +1 -1
- package/dist/audit/cli/prompts.d.ts +0 -2
- package/dist/audit/cli/prompts.d.ts.map +1 -1
- package/dist/audit/cli/prompts.js +3 -14
- package/dist/audit/cli/prompts.js.map +1 -1
- package/dist/audit/cli/questionReviewCycle.d.ts +239 -0
- package/dist/audit/cli/questionReviewCycle.d.ts.map +1 -0
- package/dist/audit/cli/questionReviewCycle.js +55 -0
- package/dist/audit/cli/questionReviewCycle.js.map +1 -0
- package/dist/audit/cli/questionReviewSession.d.ts +7 -0
- package/dist/audit/cli/questionReviewSession.d.ts.map +1 -0
- package/dist/audit/cli/questionReviewSession.js +46 -0
- package/dist/audit/cli/questionReviewSession.js.map +1 -0
- package/dist/audit/cli/questionWorkloadBindings.d.ts +7 -0
- package/dist/audit/cli/questionWorkloadBindings.d.ts.map +1 -0
- package/dist/audit/cli/questionWorkloadBindings.js +66 -0
- package/dist/audit/cli/questionWorkloadBindings.js.map +1 -0
- package/dist/audit/cli/resynthesizeCommand.d.ts +1 -0
- package/dist/audit/cli/resynthesizeCommand.d.ts.map +1 -1
- package/dist/audit/cli/resynthesizeCommand.js +52 -51
- package/dist/audit/cli/resynthesizeCommand.js.map +1 -1
- package/dist/audit/cli/sampleRunCommand.d.ts +565 -160
- package/dist/audit/cli/sampleRunCommand.d.ts.map +1 -1
- package/dist/audit/cli/sampleRunCommand.js +66 -152
- package/dist/audit/cli/sampleRunCommand.js.map +1 -1
- package/dist/audit/cli/statusCommand.d.ts.map +1 -1
- package/dist/audit/cli/statusCommand.js +20 -14
- package/dist/audit/cli/statusCommand.js.map +1 -1
- package/dist/audit/cli/steps.d.ts +10 -10
- package/dist/audit/cli/submitCommand.d.ts +11 -6
- package/dist/audit/cli/submitCommand.d.ts.map +1 -1
- package/dist/audit/cli/submitCommand.js +91 -24
- package/dist/audit/cli/submitCommand.js.map +1 -1
- package/dist/audit/cli.d.ts.map +1 -1
- package/dist/audit/cli.js +6 -17
- package/dist/audit/cli.js.map +1 -1
- package/dist/audit/contracts/findingContractPrompt.d.ts +4 -4
- package/dist/audit/contracts/workerSchemas.d.ts +69 -68
- package/dist/audit/contracts/workerSchemas.d.ts.map +1 -1
- package/dist/audit/contracts/workerSchemas.js +8 -1
- package/dist/audit/contracts/workerSchemas.js.map +1 -1
- package/dist/audit/contracts/wrapperResponse.d.ts +13 -13
- package/dist/audit/contracts/wrapperResponse.d.ts.map +1 -1
- package/dist/audit/contracts/wrapperResponse.js +0 -1
- package/dist/audit/contracts/wrapperResponse.js.map +1 -1
- package/dist/audit/extractors/designAssessment.js +2 -2
- package/dist/audit/extractors/designAssessment.js.map +1 -1
- package/dist/audit/io/artifacts.d.ts +31 -9
- package/dist/audit/io/artifacts.d.ts.map +1 -1
- package/dist/audit/io/artifacts.js +197 -31
- package/dist/audit/io/artifacts.js.map +1 -1
- package/dist/audit/io/rollover.d.ts.map +1 -1
- package/dist/audit/io/rollover.js +7 -16
- package/dist/audit/io/rollover.js.map +1 -1
- package/dist/audit/io/runSnapshot.d.ts +1 -1
- package/dist/audit/io/runSnapshot.js +1 -1
- package/dist/audit/orchestrator/architectureDiscovery.d.ts +9 -10
- package/dist/audit/orchestrator/architectureDiscovery.d.ts.map +1 -1
- package/dist/audit/orchestrator/architectureDiscovery.js +95 -13
- package/dist/audit/orchestrator/architectureDiscovery.js.map +1 -1
- package/dist/audit/orchestrator/charterPacketArchive.d.ts +3 -0
- package/dist/audit/orchestrator/charterPacketArchive.d.ts.map +1 -1
- package/dist/audit/orchestrator/charterPacketArchive.js +31 -2
- package/dist/audit/orchestrator/charterPacketArchive.js.map +1 -1
- package/dist/audit/orchestrator/dependencyMap.d.ts +2 -8
- package/dist/audit/orchestrator/dependencyMap.d.ts.map +1 -1
- package/dist/audit/orchestrator/dependencyMap.js +10 -105
- package/dist/audit/orchestrator/dependencyMap.js.map +1 -1
- package/dist/audit/orchestrator/dependencySlices.d.ts +2 -3
- package/dist/audit/orchestrator/dependencySlices.d.ts.map +1 -1
- package/dist/audit/orchestrator/dependencySlices.js +2 -35
- package/dist/audit/orchestrator/dependencySlices.js.map +1 -1
- package/dist/audit/orchestrator/designReviewPrompt.d.ts.map +1 -1
- package/dist/audit/orchestrator/designReviewPrompt.js +24 -14
- package/dist/audit/orchestrator/designReviewPrompt.js.map +1 -1
- package/dist/audit/orchestrator/executorRunners.d.ts +1 -1
- package/dist/audit/orchestrator/executorRunners.d.ts.map +1 -1
- package/dist/audit/orchestrator/executorRunners.js +14 -21
- package/dist/audit/orchestrator/executorRunners.js.map +1 -1
- package/dist/audit/orchestrator/executors.d.ts.map +1 -1
- package/dist/audit/orchestrator/executors.js +1 -131
- package/dist/audit/orchestrator/executors.js.map +1 -1
- package/dist/audit/orchestrator/flowPlanning.d.ts +1 -1
- package/dist/audit/orchestrator/flowPlanning.js +1 -1
- package/dist/audit/orchestrator/ingestionExecutors.d.ts.map +1 -1
- package/dist/audit/orchestrator/ingestionExecutors.js +19 -12
- package/dist/audit/orchestrator/ingestionExecutors.js.map +1 -1
- package/dist/audit/orchestrator/intentCheckpointExecutor.d.ts +2 -2
- package/dist/audit/orchestrator/intentCheckpointExecutor.d.ts.map +1 -1
- package/dist/audit/orchestrator/intentCheckpointExecutor.js +37 -36
- package/dist/audit/orchestrator/intentCheckpointExecutor.js.map +1 -1
- package/dist/audit/orchestrator/lensSelection.d.ts +6 -37
- package/dist/audit/orchestrator/lensSelection.d.ts.map +1 -1
- package/dist/audit/orchestrator/lensSelection.js +42 -68
- package/dist/audit/orchestrator/lensSelection.js.map +1 -1
- package/dist/audit/orchestrator/nextStep.d.ts.map +1 -1
- package/dist/audit/orchestrator/nextStep.js +1 -4
- package/dist/audit/orchestrator/nextStep.js.map +1 -1
- package/dist/audit/orchestrator/questionEvidence.d.ts +67 -0
- package/dist/audit/orchestrator/questionEvidence.d.ts.map +1 -0
- package/dist/audit/orchestrator/questionEvidence.js +177 -0
- package/dist/audit/orchestrator/questionEvidence.js.map +1 -0
- package/dist/audit/orchestrator/questionPlanExecutor.d.ts +10 -0
- package/dist/audit/orchestrator/questionPlanExecutor.d.ts.map +1 -0
- package/dist/audit/orchestrator/questionPlanExecutor.js +23 -0
- package/dist/audit/orchestrator/questionPlanExecutor.js.map +1 -0
- package/dist/audit/orchestrator/questionPlanning.d.ts +48 -0
- package/dist/audit/orchestrator/questionPlanning.d.ts.map +1 -0
- package/dist/audit/orchestrator/questionPlanning.js +326 -0
- package/dist/audit/orchestrator/questionPlanning.js.map +1 -0
- package/dist/audit/orchestrator/reviewLensPlaybooks.d.ts +11 -0
- package/dist/audit/orchestrator/reviewLensPlaybooks.d.ts.map +1 -0
- package/dist/audit/orchestrator/reviewLensPlaybooks.js +11 -0
- package/dist/audit/orchestrator/reviewLensPlaybooks.js.map +1 -0
- package/dist/audit/orchestrator/runtimeValidation.d.ts.map +1 -1
- package/dist/audit/orchestrator/runtimeValidation.js +14 -0
- package/dist/audit/orchestrator/runtimeValidation.js.map +1 -1
- package/dist/audit/orchestrator/runtimeValidationUpdate.d.ts +1 -1
- package/dist/audit/orchestrator/runtimeValidationUpdate.d.ts.map +1 -1
- package/dist/audit/orchestrator/runtimeValidationUpdate.js +13 -4
- package/dist/audit/orchestrator/runtimeValidationUpdate.js.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/conflict.js +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/conflict.js.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/index.js +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/index.js.map +1 -1
- package/dist/audit/orchestrator/state.d.ts.map +1 -1
- package/dist/audit/orchestrator/state.js +8 -60
- package/dist/audit/orchestrator/state.js.map +1 -1
- package/dist/audit/orchestrator/synthesisExecutors.d.ts +15 -1
- package/dist/audit/orchestrator/synthesisExecutors.d.ts.map +1 -1
- package/dist/audit/orchestrator/synthesisExecutors.js +76 -25
- package/dist/audit/orchestrator/synthesisExecutors.js.map +1 -1
- package/dist/audit/orchestrator/systemicChallengeExecutor.d.ts.map +1 -1
- package/dist/audit/orchestrator/systemicChallengeExecutor.js +11 -6
- package/dist/audit/orchestrator/systemicChallengeExecutor.js.map +1 -1
- package/dist/audit/orchestrator/taskAffinityGraph.d.ts +4 -4
- package/dist/audit/reporting/questionReport.d.ts +27 -0
- package/dist/audit/reporting/questionReport.d.ts.map +1 -0
- package/dist/audit/reporting/questionReport.js +183 -0
- package/dist/audit/reporting/questionReport.js.map +1 -0
- package/dist/audit/reporting/synthesis.d.ts +10 -1
- package/dist/audit/reporting/synthesis.d.ts.map +1 -1
- package/dist/audit/reporting/synthesis.js +161 -24
- package/dist/audit/reporting/synthesis.js.map +1 -1
- package/dist/audit/reporting/synthesisNarrativePrompt.d.ts +4 -1
- package/dist/audit/reporting/synthesisNarrativePrompt.d.ts.map +1 -1
- package/dist/audit/reporting/synthesisNarrativePrompt.js +5 -1
- package/dist/audit/reporting/synthesisNarrativePrompt.js.map +1 -1
- package/dist/audit/supervisor/operatorHandoff.d.ts +2 -3
- package/dist/audit/supervisor/operatorHandoff.d.ts.map +1 -1
- package/dist/audit/supervisor/operatorHandoff.js +3 -18
- package/dist/audit/supervisor/operatorHandoff.js.map +1 -1
- package/dist/audit/systemic/aggregateMetricsDigest.d.ts.map +1 -1
- package/dist/audit/systemic/aggregateMetricsDigest.js +0 -2
- package/dist/audit/systemic/aggregateMetricsDigest.js.map +1 -1
- package/dist/audit/types/artifactMetadata.d.ts +1 -2
- package/dist/audit/types/artifactMetadata.d.ts.map +1 -1
- package/dist/audit/types/auditState.d.ts +6 -6
- package/dist/audit/types/conceptualAdjudication.d.ts +708 -50
- package/dist/audit/types/conceptualAdjudication.d.ts.map +1 -1
- package/dist/audit/types/conceptualAdjudication.js +2 -0
- package/dist/audit/types/conceptualAdjudication.js.map +1 -1
- package/dist/audit/types/runtimeValidation.d.ts +58 -6
- package/dist/audit/types/runtimeValidation.d.ts.map +1 -1
- package/dist/audit/types/runtimeValidation.js +8 -0
- package/dist/audit/types/runtimeValidation.js.map +1 -1
- package/dist/audit/types.d.ts +539 -22
- package/dist/audit/types.d.ts.map +1 -1
- package/dist/audit/validation/auditResults.d.ts +1 -1
- package/dist/audit/validation/auditResults.js +1 -1
- package/dist/audit/validation/ingestIssueCodes.d.ts.map +1 -1
- package/dist/audit/validation/ingestIssueCodes.js +0 -1
- package/dist/audit/validation/ingestIssueCodes.js.map +1 -1
- package/dist/remediate/contractPipeline/executionPlan.d.ts +679 -52
- package/dist/remediate/contractPipeline/executionPlan.d.ts.map +1 -1
- package/dist/remediate/contractPipeline/executionPlan.js +23 -0
- package/dist/remediate/contractPipeline/executionPlan.js.map +1 -1
- package/dist/remediate/findingFilter.d.ts.map +1 -1
- package/dist/remediate/findingFilter.js +6 -2
- package/dist/remediate/findingFilter.js.map +1 -1
- package/dist/remediate/intake.d.ts +4 -4
- package/dist/remediate/phases/close.d.ts.map +1 -1
- package/dist/remediate/phases/close.js +15 -5
- package/dist/remediate/phases/close.js.map +1 -1
- package/dist/remediate/phases/closeVerifyAnalyzerLeads.d.ts +5 -0
- package/dist/remediate/phases/closeVerifyAnalyzerLeads.d.ts.map +1 -1
- package/dist/remediate/phases/closeVerifyAnalyzerLeads.js +37 -8
- package/dist/remediate/phases/closeVerifyAnalyzerLeads.js.map +1 -1
- package/dist/remediate/state/types.d.ts +619 -26
- package/dist/remediate/state/types.d.ts.map +1 -1
- package/dist/remediate/state/types.js +2 -1
- package/dist/remediate/state/types.js.map +1 -1
- package/dist/remediate/steps/contractPipeline.d.ts.map +1 -1
- package/dist/remediate/steps/contractPipeline.js +2 -0
- package/dist/remediate/steps/contractPipeline.js.map +1 -1
- package/dist/remediate/steps/contractPipelinePrompts.d.ts.map +1 -1
- package/dist/remediate/steps/contractPipelinePrompts.js +2 -0
- package/dist/remediate/steps/contractPipelinePrompts.js.map +1 -1
- package/dist/remediate/steps/dispatch/contractConformanceReview.d.ts +3 -3
- package/dist/remediate/steps/intakeResolver.d.ts.map +1 -1
- package/dist/remediate/steps/intakeResolver.js +31 -6
- package/dist/remediate/steps/intakeResolver.js.map +1 -1
- package/dist/remediate/steps/nextStep.d.ts.map +1 -1
- package/dist/remediate/steps/nextStep.js +31 -40
- package/dist/remediate/steps/nextStep.js.map +1 -1
- package/dist/remediate/steps/prompts.d.ts.map +1 -1
- package/dist/remediate/steps/prompts.js +3 -0
- package/dist/remediate/steps/prompts.js.map +1 -1
- package/dist/shared/analyzers/types.d.ts +18 -18
- package/dist/shared/contentKey.d.ts +1 -1
- package/dist/shared/contentKey.js +1 -1
- package/dist/shared/decompose/charterClarification.d.ts +4 -4
- package/dist/shared/decompose/charterExtraction.d.ts +30 -30
- package/dist/shared/decompose/contentCoherence.d.ts +1 -1
- package/dist/shared/decompose/contentCoherence.js +1 -1
- package/dist/shared/decompose/systemicChallenge.d.ts +629 -18
- package/dist/shared/decompose/systemicChallenge.d.ts.map +1 -1
- package/dist/shared/engine/obligationEngine.d.ts +2 -2
- package/dist/shared/index.d.ts +2 -0
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +2 -0
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/io/stepContractWriter.js +1 -1
- package/dist/shared/io/stepContractWriter.js.map +1 -1
- package/dist/shared/loopCorePaths.d.ts.map +1 -1
- package/dist/shared/loopCorePaths.js +5 -2
- package/dist/shared/loopCorePaths.js.map +1 -1
- package/dist/shared/mcp/submitServer.d.ts +1 -0
- package/dist/shared/mcp/submitServer.d.ts.map +1 -1
- package/dist/shared/mcp/submitServer.js +1 -1
- package/dist/shared/mcp/submitServer.js.map +1 -1
- package/dist/shared/submission/hostResultOutcomes.js +1 -1
- package/dist/shared/submission/hostResultOutcomes.js.map +1 -1
- package/dist/shared/tooling/exec.js +1 -1
- package/dist/shared/tooling/exec.js.map +1 -1
- package/dist/shared/types/charter.d.ts +38 -38
- package/dist/shared/types/contractPropertyShapes.d.ts.map +1 -1
- package/dist/shared/types/contractPropertyShapes.js +7 -0
- package/dist/shared/types/contractPropertyShapes.js.map +1 -1
- package/dist/shared/types/executionPlan.d.ts +88 -12
- package/dist/shared/types/executionPlan.d.ts.map +1 -1
- package/dist/shared/types/executionPlan.js +1 -0
- package/dist/shared/types/executionPlan.js.map +1 -1
- package/dist/shared/types/finding.d.ts +1721 -56
- package/dist/shared/types/finding.d.ts.map +1 -1
- package/dist/shared/types/finding.js +7 -10
- package/dist/shared/types/finding.js.map +1 -1
- package/dist/shared/types/findingVocabulary.d.ts +8 -0
- package/dist/shared/types/findingVocabulary.d.ts.map +1 -0
- package/dist/shared/types/findingVocabulary.js +13 -0
- package/dist/shared/types/findingVocabulary.js.map +1 -0
- package/dist/shared/types/intentCheckpoint.d.ts +8 -3
- package/dist/shared/types/intentCheckpoint.d.ts.map +1 -1
- package/dist/shared/types/intentCheckpoint.js +4 -3
- package/dist/shared/types/intentCheckpoint.js.map +1 -1
- package/dist/shared/types/questionReviewReport.d.ts +9912 -0
- package/dist/shared/types/questionReviewReport.d.ts.map +1 -0
- package/dist/shared/types/questionReviewReport.js +185 -0
- package/dist/shared/types/questionReviewReport.js.map +1 -0
- package/dist/shared/types/remediationOutcome.d.ts +1379 -148
- package/dist/shared/types/remediationOutcome.d.ts.map +1 -1
- package/dist/shared/types/remediationOutcome.js +5 -0
- package/dist/shared/types/remediationOutcome.js.map +1 -1
- package/dist/shared/types/reviewIndependence.d.ts +24 -24
- package/dist/shared/types/reviewQuestion.d.ts +4359 -0
- package/dist/shared/types/reviewQuestion.d.ts.map +1 -0
- package/dist/shared/types/reviewQuestion.js +182 -0
- package/dist/shared/types/reviewQuestion.js.map +1 -0
- package/dist/shared/types/stepContract.js +1 -1
- package/dist/shared/types/stepContract.js.map +1 -1
- package/dist/shared/validation/designFindingGrounding.js +1 -1
- package/dist/shared/validation/designFindingGrounding.js.map +1 -1
- package/dist/shared/validation/findingsReport.d.ts.map +1 -1
- package/dist/shared/validation/findingsReport.js +19 -4
- package/dist/shared/validation/findingsReport.js.map +1 -1
- package/docs/audit-pkg/contracts.md +27 -56
- package/docs/audit-pkg/operator-guide.md +31 -17
- package/docs/audit-pkg/product.md +17 -23
- package/package.json +1 -1
- package/schemas/audit-code-v1alpha1.schema.json +0 -1
- package/schemas/review_submission.schema.json +514 -0
- package/skills/audit-code/audit-code.prompt.md +7 -5
- package/wrapper/audit-code-wrapper-lib.mjs +1 -5
- package/wrapper/installer-verb-help.mjs +1 -1
- package/dist/audit/cli/explainTaskCommand.d.ts +0 -4
- package/dist/audit/cli/explainTaskCommand.d.ts.map +0 -1
- package/dist/audit/cli/explainTaskCommand.js +0 -45
- package/dist/audit/cli/explainTaskCommand.js.map +0 -1
- package/dist/audit/cli/ingestResultsCommand.d.ts +0 -2
- package/dist/audit/cli/ingestResultsCommand.d.ts.map +0 -1
- package/dist/audit/cli/ingestResultsCommand.js +0 -42
- package/dist/audit/cli/ingestResultsCommand.js.map +0 -1
- package/dist/audit/cli/requeueCommand.d.ts +0 -2
- package/dist/audit/cli/requeueCommand.d.ts.map +0 -1
- package/dist/audit/cli/requeueCommand.js +0 -12
- package/dist/audit/cli/requeueCommand.js.map +0 -1
- package/dist/audit/cli/semanticReviewStep.d.ts +0 -41
- package/dist/audit/cli/semanticReviewStep.d.ts.map +0 -1
- package/dist/audit/cli/semanticReviewStep.js +0 -185
- package/dist/audit/cli/semanticReviewStep.js.map +0 -1
- package/dist/audit/cli/unacceptResultsCommand.d.ts +0 -19
- package/dist/audit/cli/unacceptResultsCommand.d.ts.map +0 -1
- package/dist/audit/cli/unacceptResultsCommand.js +0 -52
- package/dist/audit/cli/unacceptResultsCommand.js.map +0 -1
- package/dist/audit/cli/updateRuntimeValidationCommand.d.ts +0 -2
- package/dist/audit/cli/updateRuntimeValidationCommand.d.ts.map +0 -1
- package/dist/audit/cli/updateRuntimeValidationCommand.js +0 -18
- package/dist/audit/cli/updateRuntimeValidationCommand.js.map +0 -1
- package/dist/audit/cli/validateResultsCommand.d.ts +0 -13
- package/dist/audit/cli/validateResultsCommand.d.ts.map +0 -1
- package/dist/audit/cli/validateResultsCommand.js +0 -87
- package/dist/audit/cli/validateResultsCommand.js.map +0 -1
- package/dist/audit/cli/workerResult.d.ts +0 -2
- package/dist/audit/cli/workerResult.d.ts.map +0 -1
- package/dist/audit/cli/workerResult.js +0 -6
- package/dist/audit/cli/workerResult.js.map +0 -1
- package/dist/audit/orchestrator/coverageElementBaseline.d.ts +0 -54
- package/dist/audit/orchestrator/coverageElementBaseline.d.ts.map +0 -1
- package/dist/audit/orchestrator/coverageElementBaseline.js +0 -136
- package/dist/audit/orchestrator/coverageElementBaseline.js.map +0 -1
- package/dist/audit/orchestrator/planning.d.ts +0 -5
- package/dist/audit/orchestrator/planning.d.ts.map +0 -1
- package/dist/audit/orchestrator/planning.js +0 -79
- package/dist/audit/orchestrator/planning.js.map +0 -1
- package/dist/audit/orchestrator/planningExecutors.d.ts +0 -21
- package/dist/audit/orchestrator/planningExecutors.d.ts.map +0 -1
- package/dist/audit/orchestrator/planningExecutors.js +0 -273
- package/dist/audit/orchestrator/planningExecutors.js.map +0 -1
- package/dist/audit/orchestrator/taskBuilder.d.ts +0 -62
- package/dist/audit/orchestrator/taskBuilder.d.ts.map +0 -1
- package/dist/audit/orchestrator/taskBuilder.js +0 -412
- package/dist/audit/orchestrator/taskBuilder.js.map +0 -1
- package/dist/audit/orchestrator/trivialAudit.d.ts +0 -21
- package/dist/audit/orchestrator/trivialAudit.d.ts.map +0 -1
- package/dist/audit/orchestrator/trivialAudit.js +0 -80
- package/dist/audit/orchestrator/trivialAudit.js.map +0 -1
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { deriveQuestionCycleUnlocked } from "./questionReviewCycle.js";
|
|
2
|
+
import { publishAuditQuestionWorkload } from "./dispatch/hostHandoff.js";
|
|
1
3
|
import { preservesSourceIndexes } from "../orchestrator/executorRunners.js";
|
|
2
4
|
import { designReviewInputRevision } from "../orchestrator/designReviewProjection.js";
|
|
3
5
|
import { decodeAuditReviewSubmission, readAuditReviewSubmission, currentAuditReviewInputRevision, auditLaneReviewRequirement } from "./reviewSubmission.js";
|
|
@@ -13,9 +15,10 @@ import { AnalyzerRunConsentDecisionSchema, readRunConsentUnlocked, updateRunCons
|
|
|
13
15
|
import { mkdir, readFile, unlink } from "node:fs/promises";
|
|
14
16
|
import { join, relative } from "node:path";
|
|
15
17
|
import { AUDIT_FINDINGS_FILENAME, auditFindingsPath, promotedAuditFindingsPath, advance, ANALYZER_SETTINGS, describeStoppedFold, RunLogger, hashContent, isFileMissingError, isJsonParseError, isRecord, readJsonFile, readSubmissionIngestHistory, readTrailingSubmissionRefusals, persistAnalyzerSettings, writeJsonFile, writeTextFile, } from "audit-tools/shared";
|
|
16
|
-
import { loadArtifactBundle, promoteFinalAuditReport, } from "../io/artifacts.js";
|
|
18
|
+
import { loadArtifactBundle, promoteFinalAuditReport, hasCurrentQuestionReport, hasWorkingQuestionReportMarker, isWorkingDirFullyPromoted, } from "../io/artifacts.js";
|
|
17
19
|
import { ensureRunSourceRoot, removeRunSnapshot, resolveRunSince } from "../io/runSnapshot.js";
|
|
18
20
|
import { markRunEnded } from "../io/rollover.js";
|
|
21
|
+
import { readQuestionReviewRunId } from "./questionReviewSession.js";
|
|
19
22
|
import { auditReportPath, groundDesignFindings, laneAssetsDir, promotedAuditReportPath, } from "audit-tools/shared";
|
|
20
23
|
import { charterExtractionKindsForCeiling } from "./charterExtractionPrompt.js";
|
|
21
24
|
import { archiveCharterPackets } from "../orchestrator/charterPacketArchive.js";
|
|
@@ -28,8 +31,7 @@ import { commitFold, createFoldTransaction, markSubmissionApplied, describeQuara
|
|
|
28
31
|
import { charterClarificationOmits, charterComparisonOmits, charterFidelityOmits, charterExtractionOmits, intentEquivalenceOmits, synthesisNarrativeOmits, systemicChallengeOmits, } from "../orchestrator/obligationPolicy.js";
|
|
29
32
|
import { computeArtifactMetadata, computeArtifactStateSignature } from "../orchestrator/artifactMetadata.js";
|
|
30
33
|
import { decideNextStep, PRIORITY, } from "../orchestrator/nextStep.js";
|
|
31
|
-
import {
|
|
32
|
-
import { resolveCharterCeiling } from "../orchestrator/charterExtractionExecutor.js";
|
|
34
|
+
import { ceilingRequestsCharters, resolveCharterCeiling } from "../orchestrator/charterExtractionExecutor.js";
|
|
33
35
|
import { systemicChallengeSchemaForBundle } from "../orchestrator/systemicChallengeExecutor.js";
|
|
34
36
|
import { deriveObligationState } from "../orchestrator/obligationDerive.js";
|
|
35
37
|
import { deriveAuditState } from "../orchestrator/state.js";
|
|
@@ -37,16 +39,13 @@ import { checkFileIntegrity } from "../orchestrator/fileIntegrity.js";
|
|
|
37
39
|
import { graphEnrichmentUnresolvedAnalyzers, graphEnrichmentLowConfidenceEdges, pendingAnalyzerConsent, } from "../orchestrator/hostInputPause.js";
|
|
38
40
|
import { runAuditStepUnlocked } from "./auditStep.js";
|
|
39
41
|
import { withArtifactTreeHold } from "../../shared/io/artifactTreeHold.js";
|
|
40
|
-
import { writeHandoffOnly,
|
|
42
|
+
import { writeHandoffOnly, } from "./reviewRun.js";
|
|
41
43
|
import { sizeIndexFromManifest } from "../orchestrator/reviewPackets.js";
|
|
42
|
-
import {
|
|
44
|
+
import { reviewSourceScope } from "../orchestrator/questionPlanning.js";
|
|
43
45
|
import { buildLineIndex } from "./lineIndex.js";
|
|
44
46
|
import { errorMessage } from "../../shared/io/json.js";
|
|
45
|
-
import {
|
|
46
|
-
import { auditIngestRemedy, } from "../validation/ingestIssueCodes.js";
|
|
47
|
-
import { buildCharterPacketManifest, carriedCharterLane, materializeCharterPacket, } from "../orchestrator/charterPackets.js";
|
|
47
|
+
import { buildCharterPacketManifest, carriedCharterLane, charterPacketReadSet, materializeCharterPacket, } from "../orchestrator/charterPackets.js";
|
|
48
48
|
import { CHARTER_EXTRACTION_MERGED_FILENAME, AUDIT_GATE_SUBMISSION_SCOPE, GATE_LANES, charterExtractionCoverageFilename, charterExtractionLane, charterExtractionPacketFilename, closeDispatchedLaneOutcomes, laneSubmissionPath, laneSubmissionId, recordLaneOutcome, systemicChallengeLane, } from "./laneSubmissions.js";
|
|
49
|
-
import { recordHostResultOutcomes, renderIngestReportLines } from "audit-tools/shared";
|
|
50
49
|
/**
|
|
51
50
|
* Read a lane's submission from the TOOL-COMPUTED path its emission bound —
|
|
52
51
|
* never a name a host could type. `ok` when the file exists and parses;
|
|
@@ -120,7 +119,7 @@ export function requireSourceRoot(params) {
|
|
|
120
119
|
* could disagree with the table it describes.
|
|
121
120
|
*/
|
|
122
121
|
const NEXT_STEP_RETURN_KIND_TABLE = {
|
|
123
|
-
|
|
122
|
+
question_review: true,
|
|
124
123
|
design_review_parallel: true,
|
|
125
124
|
design_review_contract: true,
|
|
126
125
|
design_review_conceptual: true,
|
|
@@ -165,6 +164,8 @@ async function promoteCompletedReport(root, artifactsDir) {
|
|
|
165
164
|
// run's report and this run's render sat only under `.audit-tools/audit/`.
|
|
166
165
|
// Identity, not existence: promoted content must equal the in-place render.
|
|
167
166
|
const inPlacePath = auditReportPath(artifactsDir);
|
|
167
|
+
if (!(await hasCurrentQuestionReport(artifactsDir)))
|
|
168
|
+
return inPlacePath;
|
|
168
169
|
const [promotedText, inPlaceText] = await Promise.all([
|
|
169
170
|
readFile(promotedPath, "utf8").catch(() => null),
|
|
170
171
|
readFile(inPlacePath, "utf8").catch(() => null),
|
|
@@ -185,12 +186,14 @@ async function promoteCompletedReport(root, artifactsDir) {
|
|
|
185
186
|
]);
|
|
186
187
|
const findingsCurrent = inPlaceFindings === null || (promotedFindings !== null && inPlaceFindings.equals(promotedFindings));
|
|
187
188
|
let findingsArchived = true;
|
|
188
|
-
if (!alreadyPromoted || !findingsCurrent) {
|
|
189
|
+
if (!alreadyPromoted || !findingsCurrent || !(await isWorkingDirFullyPromoted(artifactsDir))) {
|
|
189
190
|
const promoted = await promoteFinalAuditReport({ artifactsDir });
|
|
190
191
|
if (!promoted.promoted)
|
|
191
192
|
return inPlacePath;
|
|
192
193
|
findingsArchived = !(promoted.unarchived ?? []).some((member) => member.startsWith(AUDIT_FINDINGS_FILENAME));
|
|
193
194
|
}
|
|
195
|
+
if (!findingsArchived || !(await isWorkingDirFullyPromoted(artifactsDir)))
|
|
196
|
+
return inPlacePath;
|
|
194
197
|
// A presented, promoted report ENDS the run, whatever its status (a rendered
|
|
195
198
|
// report on a stopped fold included — re-reading the same frozen snapshot
|
|
196
199
|
// would only stop it again): its snapshot goes, and the marker lets the next
|
|
@@ -226,7 +229,16 @@ export async function buildTerminalStep(params, bundle, state, blockedReason) {
|
|
|
226
229
|
if (!reportRendered) {
|
|
227
230
|
return { kind: "blocked", state, bundle, reason: blockedReason };
|
|
228
231
|
}
|
|
229
|
-
const
|
|
232
|
+
const questionRun = bundle.review_plan !== undefined ||
|
|
233
|
+
Boolean(await readQuestionReviewRunId(params.artifactsDir, { includeEnded: true })) ||
|
|
234
|
+
await hasWorkingQuestionReportMarker(params.artifactsDir);
|
|
235
|
+
const finalReportPath = questionRun
|
|
236
|
+
? await withArtifactTreeHold(params.artifactsDir, undefined, () => promoteCompletedReport(params.root, params.artifactsDir))
|
|
237
|
+
: await promoteCompletedReport(params.root, params.artifactsDir);
|
|
238
|
+
if (questionRun && finalReportPath === auditReportPath(params.artifactsDir)) {
|
|
239
|
+
return { kind: "blocked", state, bundle,
|
|
240
|
+
reason: "The current question report and its custody records could not be verified and promoted. Restore the matching question plan, accepted answers and report or resolve the reported archive issue, then run next-step again. The working audit was kept." };
|
|
241
|
+
}
|
|
230
242
|
return {
|
|
231
243
|
kind: "complete",
|
|
232
244
|
state,
|
|
@@ -1602,117 +1614,20 @@ export async function checkFinalizationCycle(ctx) {
|
|
|
1602
1614
|
"obligations are erroneously invalidating each other.",
|
|
1603
1615
|
};
|
|
1604
1616
|
}
|
|
1617
|
+
// ── advance engine binding ────────────────────────────────────────────────────
|
|
1605
1618
|
/**
|
|
1606
|
-
*
|
|
1607
|
-
*
|
|
1608
|
-
*
|
|
1609
|
-
*
|
|
1610
|
-
*
|
|
1611
|
-
*
|
|
1612
|
-
*
|
|
1613
|
-
* emission. That is not hypothetical: it is what a shallow spread of the
|
|
1614
|
-
* constant did, and it turned the once-only property into once-per-emission.
|
|
1619
|
+
* Per-call execution dependencies threaded to every audit obligation executor.
|
|
1620
|
+
* Mirrors remediate-code's `RemediateCtx`: the shared engine stays agnostic;
|
|
1621
|
+
* audit-code picks its own `Ctx`. The refs carry the fold-local mutable state the
|
|
1622
|
+
* hand-rolled `for` loop kept in closures — the analyzer settings a decisions
|
|
1623
|
+
* file can update mid-fold, the last progress summary surfaced in the terminal
|
|
1624
|
+
* block, and the cycle-guard bookkeeping (transition counter + the no-progress /
|
|
1625
|
+
* finalization-cycle sets the two guards mutate).
|
|
1615
1626
|
*/
|
|
1616
|
-
function emptyFoldAdvisories() {
|
|
1617
|
-
return { ingestIssues: [], validationWarnings: [] };
|
|
1618
|
-
}
|
|
1619
|
-
/** `<artifactsDir>/steps/pending-advisories.json` — the drainable prompt carry. */
|
|
1620
|
-
function pendingAdvisoriesPath(artifactsDir) {
|
|
1621
|
-
return join(artifactsDir, "steps", "pending-advisories.json");
|
|
1622
|
-
}
|
|
1623
1627
|
/** The progress marker a filesystem-watching host reads (see `executeAndRecord`). */
|
|
1624
1628
|
function deterministicProgressPath(artifactsDir) {
|
|
1625
1629
|
return join(artifactsDir, "steps", "deterministic-progress.json");
|
|
1626
1630
|
}
|
|
1627
|
-
/**
|
|
1628
|
-
* Read the persisted carry. Lenient by design: an absent or unreadable file is
|
|
1629
|
-
* an empty carry, because this is a PROMPT convenience over a ledger that
|
|
1630
|
-
* remains authoritative — a bookkeeping file must never be able to fail the
|
|
1631
|
-
* call it decorates. Shape-checked rather than schema-parsed for the same
|
|
1632
|
-
* reason: unrecognized entries are dropped, never thrown on.
|
|
1633
|
-
*/
|
|
1634
|
-
async function readPendingAdvisories(artifactsDir) {
|
|
1635
|
-
let raw;
|
|
1636
|
-
try {
|
|
1637
|
-
raw = JSON.parse(await readFile(pendingAdvisoriesPath(artifactsDir), "utf8"));
|
|
1638
|
-
}
|
|
1639
|
-
catch {
|
|
1640
|
-
return emptyFoldAdvisories();
|
|
1641
|
-
}
|
|
1642
|
-
if (!isRecord(raw))
|
|
1643
|
-
return emptyFoldAdvisories();
|
|
1644
|
-
const take = (value) => (Array.isArray(value) ? value : []);
|
|
1645
|
-
return {
|
|
1646
|
-
ingestIssues: take(raw.ingestIssues),
|
|
1647
|
-
validationWarnings: take(raw.validationWarnings),
|
|
1648
|
-
};
|
|
1649
|
-
}
|
|
1650
|
-
/**
|
|
1651
|
-
* Persist the carry, or DELETE it when empty. Deleting rather than writing an
|
|
1652
|
-
* empty object is what keeps presence a signal: a later fold reads "nothing
|
|
1653
|
-
* pending" from absence, and no reader has to distinguish `[]` from "not yet
|
|
1654
|
-
* written".
|
|
1655
|
-
*/
|
|
1656
|
-
async function writePendingAdvisories(artifactsDir, advisories) {
|
|
1657
|
-
const path = pendingAdvisoriesPath(artifactsDir);
|
|
1658
|
-
if (advisoriesEmpty(advisories)) {
|
|
1659
|
-
try {
|
|
1660
|
-
await unlink(path);
|
|
1661
|
-
}
|
|
1662
|
-
catch (error) {
|
|
1663
|
-
if (!isFileMissingError(error))
|
|
1664
|
-
throw error;
|
|
1665
|
-
}
|
|
1666
|
-
return;
|
|
1667
|
-
}
|
|
1668
|
-
await writeJsonFile(path, advisories);
|
|
1669
|
-
}
|
|
1670
|
-
/**
|
|
1671
|
-
* Append one fold iteration's advisories to the pending carry. Dedupe by
|
|
1672
|
-
* identity signature keeps an issue the SAME ingest re-classifies on a later
|
|
1673
|
-
* iteration (it will, while the submission stays broken) from rendering twice;
|
|
1674
|
-
* the consuming drain ({@link takeFoldAdvisories}) is the once-per-emit half.
|
|
1675
|
-
*/
|
|
1676
|
-
function mergeFoldAdvisoriesInto(carried, fresh) {
|
|
1677
|
-
appendUnseen(carried.ingestIssues, fresh.issues);
|
|
1678
|
-
appendUnseen(carried.validationWarnings, fresh.validationWarnings);
|
|
1679
|
-
}
|
|
1680
|
-
/** Append each advisory whose signature is not already in `target`, in order. */
|
|
1681
|
-
function appendUnseen(target, incoming) {
|
|
1682
|
-
const seen = new Set(target.map(advisorySignature));
|
|
1683
|
-
for (const advisory of incoming) {
|
|
1684
|
-
const signature = advisorySignature(advisory);
|
|
1685
|
-
if (seen.has(signature))
|
|
1686
|
-
continue;
|
|
1687
|
-
seen.add(signature);
|
|
1688
|
-
target.push(advisory);
|
|
1689
|
-
}
|
|
1690
|
-
}
|
|
1691
|
-
function advisoriesEmpty(advisories) {
|
|
1692
|
-
return advisories.ingestIssues.length === 0 && advisories.validationWarnings.length === 0;
|
|
1693
|
-
}
|
|
1694
|
-
/**
|
|
1695
|
-
* Drain the carry: what the NEXT emission must state, now consumed. Clears the
|
|
1696
|
-
* in-memory ref AND the persisted copy TOGETHER, so the once-only property holds
|
|
1697
|
-
* across a call boundary exactly as it does within one call — a ref cleared
|
|
1698
|
-
* without the file would re-state on the next call, and a file left behind after
|
|
1699
|
-
* a render would do the same.
|
|
1700
|
-
*/
|
|
1701
|
-
async function takeFoldAdvisories(artifactsDir, ref) {
|
|
1702
|
-
const taken = {
|
|
1703
|
-
ingestIssues: ref.value.ingestIssues,
|
|
1704
|
-
validationWarnings: ref.value.validationWarnings,
|
|
1705
|
-
};
|
|
1706
|
-
ref.value = emptyFoldAdvisories();
|
|
1707
|
-
await writePendingAdvisories(artifactsDir, emptyFoldAdvisories());
|
|
1708
|
-
return taken;
|
|
1709
|
-
}
|
|
1710
|
-
/** Content identity of one advisory, across both channels. */
|
|
1711
|
-
function advisorySignature(advisory) {
|
|
1712
|
-
const workItemId = "work_item_id" in advisory ? (advisory.work_item_id ?? "") : "";
|
|
1713
|
-
const code = "code" in advisory ? advisory.code : "warning";
|
|
1714
|
-
return `${code}|${workItemId}|${advisory.message}`;
|
|
1715
|
-
}
|
|
1716
1631
|
/**
|
|
1717
1632
|
* A deterministic-executor `emit` of a blocked step — the `!progress_made`
|
|
1718
1633
|
* dead-end the hand loop returned directly from `executeAndRecord`.
|
|
@@ -1927,206 +1842,60 @@ async function runDesignReviewObligation(bundle, ctx) {
|
|
|
1927
1842
|
}
|
|
1928
1843
|
return { kind: "transition", state: branch.bundle };
|
|
1929
1844
|
}
|
|
1930
|
-
/**
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
let rawIngestIssues = [];
|
|
1939
|
-
let validationWarnings = [];
|
|
1940
|
-
if (currentRun) {
|
|
1941
|
-
let acceptedResults = [];
|
|
1942
|
-
let completedIds = [];
|
|
1943
|
-
// The line index is built HERE (once per fold) rather than inside the ingest
|
|
1944
|
-
// so the accept decision sees the same disk truth `runAuditStep`'s batch gate
|
|
1945
|
-
// validates against; the audit-task manifest comes from the same bundle.
|
|
1946
|
-
const lineIndexForIngest = bundle.repo_manifest
|
|
1947
|
-
? await buildLineIndex(requireSourceRoot(ctx.params), bundle.repo_manifest)
|
|
1948
|
-
: undefined;
|
|
1949
|
-
// The set replayed below. The ingest validates those entries again against
|
|
1950
|
-
// this same tree, so the batch gate cannot refuse what it is handed.
|
|
1951
|
-
const pendingIds = new Set(buildPendingAuditTasks(bundle).map((task) => task.task_id));
|
|
1952
|
-
try {
|
|
1953
|
-
const ingested = await ingestAuditHostResults({
|
|
1954
|
-
root: ctx.params.root,
|
|
1955
|
-
sourceRoot: requireSourceRoot(ctx.params),
|
|
1956
|
-
artifactsDir: ctx.params.artifactsDir,
|
|
1957
|
-
runId: currentRun.run_id,
|
|
1958
|
-
auditTasks: bundle.audit_tasks ?? [],
|
|
1959
|
-
lineIndex: lineIndexForIngest,
|
|
1960
|
-
pendingTaskIds: pendingIds,
|
|
1961
|
-
});
|
|
1962
|
-
acceptedResults = ingested.accepted_results;
|
|
1963
|
-
ingestIssues = ingested.issues;
|
|
1964
|
-
rawIngestIssues = ingested.raw_issues;
|
|
1965
|
-
validationWarnings = ingested.validation_warnings;
|
|
1966
|
-
completedIds = ingested.completed_work_item_ids;
|
|
1967
|
-
}
|
|
1968
|
-
catch (error) {
|
|
1969
|
-
// No handoff exists on the first visit, or prepare was interrupted before
|
|
1970
|
-
// all binding artifacts landed. Re-preparing below restores it exactly:
|
|
1971
|
-
// the prepare writes the workload, result map and binding set together,
|
|
1972
|
-
// so a partial trio is overwritten whole.
|
|
1973
|
-
//
|
|
1974
|
-
// A STALE binding set is deliberately NOT in this class and must not be
|
|
1975
|
-
// added to it: the ingest already classifies it and returns an issue
|
|
1976
|
-
// WITHOUT throwing (see `StaleAuditHostTaskBindingsError`), precisely so
|
|
1977
|
-
// the fold reaches the re-prepare below instead of aborting here. An
|
|
1978
|
-
// error that arrives at this line was not classified by the ingest, and
|
|
1979
|
-
// swallowing it would turn an unreadable handoff into a silent one.
|
|
1980
|
-
if (!isFileMissingError(error))
|
|
1981
|
-
throw error;
|
|
1982
|
-
}
|
|
1983
|
-
// The ingest CLASSIFIES every failed read — a submission that never
|
|
1984
|
-
// arrived, unreadable bytes (an EACCES or a directory at the bound path
|
|
1985
|
-
// reads as malformed WITH the OS detail in its message), a body that fails
|
|
1986
|
-
// the contract, a replayed result id. Those classifications used to die in
|
|
1987
|
-
// the caller that computed them; they now land on the ledger and, below,
|
|
1988
|
-
// in the re-emitted step the host actually reads. The completed set rides
|
|
1989
|
-
// along so a repaired item closes its own record.
|
|
1990
|
-
await recordHostResultOutcomes(ctx.params.artifactsDir, currentRun.run_id, {
|
|
1991
|
-
issues: rawIngestIssues,
|
|
1992
|
-
acceptedIds: completedIds,
|
|
1993
|
-
});
|
|
1994
|
-
// Even a refused-only arrival must be visible on the next host step.
|
|
1995
|
-
mergeFoldAdvisoriesInto(ctx.foldAdvisoriesRef.value, { issues: ingestIssues, validationWarnings });
|
|
1996
|
-
await writePendingAdvisories(ctx.params.artifactsDir, ctx.foldAdvisoriesRef.value);
|
|
1997
|
-
const pendingAccepted = acceptedResults.filter((result) => pendingIds.has(result.task_id));
|
|
1998
|
-
if (pendingAccepted.length > 0) {
|
|
1999
|
-
// Forced, lock-free, against the CARRIED bundle: the fold owns the one
|
|
2000
|
-
// hold and the one persist.
|
|
2001
|
-
const ingested = await runAuditStepUnlocked({
|
|
2002
|
-
root: ctx.params.root,
|
|
2003
|
-
sourceRoot: requireSourceRoot(ctx.params),
|
|
2004
|
-
artifactsDir: ctx.params.artifactsDir,
|
|
2005
|
-
preferredExecutor: "result_ingestion_executor",
|
|
2006
|
-
auditResultsData: [...pendingAccepted],
|
|
2007
|
-
}, bundle);
|
|
2008
|
-
return ingested.updated_bundle;
|
|
2009
|
-
}
|
|
1845
|
+
/** Raw fallback errors may quote submitted text, paths, or schema values. */
|
|
1846
|
+
function questionResultCorrection(reason) {
|
|
1847
|
+
if (reason === "Result assignment differs from its destination" ||
|
|
1848
|
+
reason === "Review submission does not match the current issued assignment, question revision and snapshot") {
|
|
1849
|
+
return "Binding mismatch. Copy the assignment, question, revision, and snapshot IDs from the current workload.";
|
|
1850
|
+
}
|
|
1851
|
+
if (reason.startsWith("Source is outside this assignment:")) {
|
|
1852
|
+
return "Source is outside the assignment. Use only source admitted in the current binding.";
|
|
2010
1853
|
}
|
|
2011
|
-
|
|
1854
|
+
if (reason.startsWith("Source span is outside the issued file:")) {
|
|
1855
|
+
return "Source lines are outside the issued file. Check the span against the frozen source.";
|
|
1856
|
+
}
|
|
1857
|
+
if (reason.startsWith("Evidence was not issued for this assignment:") ||
|
|
1858
|
+
reason.startsWith("Observation links unavailable or unissued evidence:")) {
|
|
1859
|
+
return "Evidence is unavailable or unissued for this assignment. Check the current evidence and observation IDs.";
|
|
1860
|
+
}
|
|
1861
|
+
if (reason === "Conflicting reuse of an accepted review submission ID") {
|
|
1862
|
+
return "Submission ID already used for different content. Replay only the exact accepted answer under that ID.";
|
|
1863
|
+
}
|
|
1864
|
+
if (reason.startsWith("Unknown or duplicate requested part:") ||
|
|
1865
|
+
reason.startsWith("Review part has unsupported observation links:")) {
|
|
1866
|
+
return "Requested part or observation links are invalid. Check the parts and links against the current binding.";
|
|
1867
|
+
}
|
|
1868
|
+
return "Could not accept the result. Check that it is readable JSON and meets the current answer contract.";
|
|
2012
1869
|
}
|
|
2013
1870
|
async function runHostDelegationObligation(bundle, ctx) {
|
|
2014
|
-
const
|
|
2015
|
-
const
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
}
|
|
2019
|
-
if (!
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
const
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
state,
|
|
2034
|
-
obligationId: decision.selected_obligation,
|
|
1871
|
+
const sourceRoot = requireSourceRoot(ctx.params);
|
|
1872
|
+
const cycle = await deriveQuestionCycleUnlocked({
|
|
1873
|
+
root: ctx.params.root, sourceRoot, artifactsDir: ctx.params.artifactsDir, bundle,
|
|
1874
|
+
});
|
|
1875
|
+
const carried = { ...bundle, question_cycle: cycle };
|
|
1876
|
+
if (bundle.audit_findings !== undefined && !(await hasCurrentQuestionReport(ctx.params.artifactsDir))) {
|
|
1877
|
+
// A new accepted answer may not change plan membership or source revision.
|
|
1878
|
+
// Re-synthesize rather than repeatedly presenting a no-longer-current pair.
|
|
1879
|
+
delete carried.audit_findings;
|
|
1880
|
+
delete carried.audit_report;
|
|
1881
|
+
delete carried.synthesis_narrative;
|
|
1882
|
+
}
|
|
1883
|
+
if (cycle.pending.length === 0)
|
|
1884
|
+
return { kind: "transition", state: carried };
|
|
1885
|
+
const pendingIds = new Set(cycle.pending.map(({ assignment }) => assignment.assignment_id));
|
|
1886
|
+
const rejections = cycle.issues.filter(issue => pendingIds.has(issue.assignment_id)).slice(0, 8)
|
|
1887
|
+
.map(issue => ({ assignmentId: issue.assignment_id, guidance: questionResultCorrection(issue.reason) }));
|
|
1888
|
+
const published = await publishAuditQuestionWorkload({
|
|
1889
|
+
root: ctx.params.root, sourceRoot, artifactsDir: ctx.params.artifactsDir, runId: cycle.runId, bindings: cycle.pending,
|
|
2035
1890
|
});
|
|
2036
|
-
// What THIS ingest saw. Deliberately NOT drained here: the carried advisories
|
|
2037
|
-
// are taken at the fold's single emission boundary (`runDeterministicForNextStep`),
|
|
2038
|
-
// which every emitted step kind passes through — draining at this obligation
|
|
2039
|
-
// would state them only for a semantic-review emission and silently drop them
|
|
2040
|
-
// the moment the run's next step happened to be a different kind
|
|
2041
|
-
// (design_review_conceptual, charter_*, synthesis_narrative…).
|
|
2042
1891
|
return {
|
|
2043
1892
|
kind: "emit",
|
|
2044
|
-
step: {
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
},
|
|
2049
|
-
// The pause's blocked core state — the fold's single commit persists it
|
|
2050
|
-
// (the locking variant's own write was the other half of the split).
|
|
2051
|
-
state: review.bundle,
|
|
1893
|
+
step: { kind: "question_review", state: deriveAuditState(carried, { emitStaleness: false }), bundle: carried,
|
|
1894
|
+
runId: cycle.runId, workloadPath: published.workload_path, pendingCount: cycle.pending.length,
|
|
1895
|
+
rejectedCount: cycle.issues.length, rejections },
|
|
1896
|
+
state: carried,
|
|
2052
1897
|
};
|
|
2053
1898
|
}
|
|
2054
|
-
/**
|
|
2055
|
-
* State the fold's carried advisories on the step about to be emitted, and
|
|
2056
|
-
* DRAIN them.
|
|
2057
|
-
*
|
|
2058
|
-
* THE single emission-boundary drain. It lives here, not at any one obligation,
|
|
2059
|
-
* because the property is "stated on exactly one emitted step, whichever call
|
|
2060
|
-
* and whichever step kind emits it": a carry produced by a call-ending
|
|
2061
|
-
* transition must survive to a later fold, and that fold's step may be ANY
|
|
2062
|
-
* kind. Hanging the drain off the semantic-review obligation made it correct
|
|
2063
|
-
* only for as long as the next step happened to be a semantic review.
|
|
2064
|
-
*
|
|
2065
|
-
* Advisories are only ever RENDERED by the semantic-review step today (the
|
|
2066
|
-
* other kinds carry no advisory channel), so a carry drained onto one of them
|
|
2067
|
-
* still reaches the operator — as a stated line in this step's prompt — rather
|
|
2068
|
-
* than being lost. A step with nothing carried is returned untouched.
|
|
2069
|
-
*/
|
|
2070
|
-
async function withFoldAdvisories(step, ctx) {
|
|
2071
|
-
const carried = await takeFoldAdvisories(ctx.params.artifactsDir, ctx.foldAdvisoriesRef);
|
|
2072
|
-
if (advisoriesEmpty(carried))
|
|
2073
|
-
return step;
|
|
2074
|
-
if (step.kind !== "semantic_review") {
|
|
2075
|
-
return {
|
|
2076
|
-
...step,
|
|
2077
|
-
// An architecture step that carries a ready-inspection run names that
|
|
2078
|
-
// run's workload in its own task, above the carried report (the
|
|
2079
|
-
// `withReadyInspection` section); the pending items are in it.
|
|
2080
|
-
advisoryNotice: renderCarriedAdvisoryLines(carried, step.inspectionRun !== undefined && step.kind !== "blocked"
|
|
2081
|
-
? "named_above"
|
|
2082
|
-
: "next_call"),
|
|
2083
|
-
};
|
|
2084
|
-
}
|
|
2085
|
-
return {
|
|
2086
|
-
...step,
|
|
2087
|
-
ingestIssues: [...(step.ingestIssues ?? []), ...carried.ingestIssues],
|
|
2088
|
-
validationWarnings: [
|
|
2089
|
-
...(step.validationWarnings ?? []),
|
|
2090
|
-
...carried.validationWarnings,
|
|
2091
|
-
],
|
|
2092
|
-
};
|
|
2093
|
-
}
|
|
2094
|
-
/**
|
|
2095
|
-
* The advisory lines a step that carries no advisory CHANNEL still states. A
|
|
2096
|
-
* carried advisory is never dropped on the floor because the run happened to
|
|
2097
|
-
* move on to a different step kind — it is rendered as text, in the same
|
|
2098
|
-
* wording the semantic-review step's own sections use.
|
|
2099
|
-
*
|
|
2100
|
-
* "The same wording" is now MECHANICAL: both callers render through the one
|
|
2101
|
-
* {@link renderIngestReportLines}. This function used to hand-copy the split,
|
|
2102
|
-
* the bullet format and the headings, and the copy had already gone stale
|
|
2103
|
-
* against the section it claimed to match.
|
|
2104
|
-
*
|
|
2105
|
-
* The report rides a step of another kind and follows its whole task, so the
|
|
2106
|
-
* workload is `named_above` when that task names a ready-inspection workload,
|
|
2107
|
-
* and `next_call` otherwise.
|
|
2108
|
-
*/
|
|
2109
|
-
function renderCarriedAdvisoryLines(carried, workload) {
|
|
2110
|
-
return renderIngestReportLines({
|
|
2111
|
-
issues: carried.ingestIssues,
|
|
2112
|
-
remedy: auditIngestRemedy,
|
|
2113
|
-
workload,
|
|
2114
|
-
advisories: carried.validationWarnings,
|
|
2115
|
-
});
|
|
2116
|
-
}
|
|
2117
|
-
/** Emit the no-executor blocked step (the hand loop's `!selected_executor` arm). */
|
|
2118
|
-
async function emitNoExecutorBlocked(bundle, ctx, decision) {
|
|
2119
|
-
const state = decision.state;
|
|
2120
|
-
const reason = ctx.lastSummaryRef.value || decision.reason;
|
|
2121
|
-
await writeHandoffOnly({
|
|
2122
|
-
root: ctx.params.root,
|
|
2123
|
-
artifactsDir: ctx.params.artifactsDir,
|
|
2124
|
-
bundle,
|
|
2125
|
-
audit_state: state,
|
|
2126
|
-
progress_summary: reason,
|
|
2127
|
-
});
|
|
2128
|
-
return { kind: "emit", step: { kind: "blocked", state, bundle, reason }, state: bundle };
|
|
2129
|
-
}
|
|
2130
1899
|
/**
|
|
2131
1900
|
* Wrap each obligation so the fold's CURRENT carried bundle is always
|
|
2132
1901
|
* observable on the ctx — the commit-on-throw path persists it, and a throw
|
|
@@ -2223,11 +1992,6 @@ export async function runDeterministicForNextStep(params) {
|
|
|
2223
1992
|
heartbeat.stop();
|
|
2224
1993
|
}
|
|
2225
1994
|
}
|
|
2226
|
-
const ARCHITECTURE_WORK_STEPS = new Set([
|
|
2227
|
-
"charter_extraction", "charter_comparison", "charter_fidelity",
|
|
2228
|
-
"design_review_parallel", "design_review_contract", "design_review_conceptual",
|
|
2229
|
-
"charter_clarification", "systemic_challenge",
|
|
2230
|
-
]);
|
|
2231
1995
|
async function runDeterministicFold(params, heartbeat) {
|
|
2232
1996
|
// THE fold's one git-index probe cache (`ScopeIndexMemo`). It is created here
|
|
2233
1997
|
// and held on `params` — the object every dispatch path already shares, the
|
|
@@ -2242,7 +2006,6 @@ async function runDeterministicFold(params, heartbeat) {
|
|
|
2242
2006
|
analyzersRef,
|
|
2243
2007
|
lastSummaryRef: { value: "" },
|
|
2244
2008
|
heartbeat,
|
|
2245
|
-
foldAdvisoriesRef: { value: emptyFoldAdvisories() },
|
|
2246
2009
|
dispatchOrdinalRef: { value: 0 },
|
|
2247
2010
|
dispatchedSignatures: new Set(),
|
|
2248
2011
|
seenStateSignatures: new Set(),
|
|
@@ -2269,7 +2032,6 @@ async function runDeterministicFold(params, heartbeat) {
|
|
|
2269
2032
|
// `finally` below runs on the throw path too, still under the hold.
|
|
2270
2033
|
const holdStartMs = Date.now();
|
|
2271
2034
|
let chargedExecutions;
|
|
2272
|
-
let ingestionExecutions = 0;
|
|
2273
2035
|
let intakeExecutions = 0;
|
|
2274
2036
|
await recoverStagedSubmissions(params.artifactsDir);
|
|
2275
2037
|
const previousConsent = await readRunConsentUnlocked(params.root, params.artifactsDir);
|
|
@@ -2288,26 +2050,26 @@ async function runDeterministicFold(params, heartbeat) {
|
|
|
2288
2050
|
if (params.externalAcquisition?.enabled)
|
|
2289
2051
|
applyRunConsent(params.externalAcquisition, consent);
|
|
2290
2052
|
params.autoFix = { enabled: consent.auto_fix, dryRun: consent.dry_run };
|
|
2291
|
-
// The PERSISTED carry, read back under the hold. A transition that ENDED
|
|
2292
|
-
// an earlier call left its advisories on disk for the next emission to
|
|
2293
|
-
// state, and that emission may be this call's — the ctx ref starts empty
|
|
2294
|
-
// per call, so without this read the durable half would be write-only and
|
|
2295
|
-
// the advisories would still die at the call boundary. Seeding the ref
|
|
2296
|
-
// (rather than merging at the emit site) keeps ONE drain point, so the
|
|
2297
|
-
// once-only property is the same one the in-call path already relies on.
|
|
2298
|
-
ctx.foldAdvisoriesRef.value = await readPendingAdvisories(params.artifactsDir);
|
|
2299
2053
|
let startBundle = await loadArtifactBundle(params.artifactsDir);
|
|
2300
2054
|
if (consent.auto_fix && !previousConsent.auto_fix && !consent.dry_run) {
|
|
2301
2055
|
delete startBundle.auto_fixes_applied;
|
|
2302
2056
|
}
|
|
2303
2057
|
ctx.currentBundleRef.value = startBundle;
|
|
2304
2058
|
try {
|
|
2305
|
-
//
|
|
2306
|
-
//
|
|
2059
|
+
// Check the same frozen read set that the active review stage uses.
|
|
2060
|
+
// Before question planning, deep charter lanes also bind admitted source.
|
|
2307
2061
|
if (startBundle.audit_state?.status !== "complete" && startBundle.repo_manifest) {
|
|
2308
|
-
|
|
2309
|
-
if (
|
|
2310
|
-
const
|
|
2062
|
+
let admittedFiles = [];
|
|
2063
|
+
if (startBundle.review_plan) {
|
|
2064
|
+
const scope = reviewSourceScope(startBundle);
|
|
2065
|
+
admittedFiles = [...new Set([...scope.allowedSourcePaths, ...scope.allowedContractPaths])];
|
|
2066
|
+
}
|
|
2067
|
+
else if (ceilingRequestsCharters(resolveCharterCeiling(startBundle.intent_checkpoint))) {
|
|
2068
|
+
const { memberPaths, docPaths } = charterPacketReadSet(startBundle);
|
|
2069
|
+
admittedFiles = [...memberPaths, ...docPaths];
|
|
2070
|
+
}
|
|
2071
|
+
if (admittedFiles.length > 0) {
|
|
2072
|
+
const integrity = await checkFileIntegrity(requireSourceRoot(params), startBundle.repo_manifest, admittedFiles);
|
|
2311
2073
|
if (!integrity.is_clean) {
|
|
2312
2074
|
process.stderr.write(`[audit-code] nextStep: integrity check - ${integrity.changed_files.length} changed, ` +
|
|
2313
2075
|
`${integrity.missing_files.length} missing, ${integrity.io_errors.length} io-error(s); re-running intake.\n`);
|
|
@@ -2322,32 +2084,14 @@ async function runDeterministicFold(params, heartbeat) {
|
|
|
2322
2084
|
}
|
|
2323
2085
|
}
|
|
2324
2086
|
}
|
|
2325
|
-
if (startBundle.audit_tasks && startBundle.audit_state?.status !== "complete" &&
|
|
2326
|
-
deriveAuditState(startBundle, { emitStaleness: false }).obligations.find((obligation) => obligation.id === "planning_artifacts")?.state === "satisfied") {
|
|
2327
|
-
const beforeIngest = startBundle;
|
|
2328
|
-
startBundle = await ingestAvailableInspectionResults(startBundle, ctx);
|
|
2329
|
-
ingestionExecutions = startBundle === beforeIngest ? 0 : 1;
|
|
2330
|
-
ctx.currentBundleRef.value = startBundle;
|
|
2331
|
-
}
|
|
2332
2087
|
const engineOutcome = await advance({
|
|
2333
2088
|
priority: PRIORITY,
|
|
2334
2089
|
obligations: trackFoldBundle(buildAuditObligations()),
|
|
2335
2090
|
}, startBundle, ctx, {
|
|
2336
2091
|
maxTransitions: engineMaxTransitions(),
|
|
2337
|
-
maxExecutions: MAX_DRAIN_STEPS -
|
|
2092
|
+
maxExecutions: MAX_DRAIN_STEPS - intakeExecutions,
|
|
2338
2093
|
});
|
|
2339
|
-
chargedExecutions = engineOutcome.executions +
|
|
2340
|
-
if (engineOutcome.step && engineOutcome.step.kind !== "terminal_intent" && ARCHITECTURE_WORK_STEPS.has(engineOutcome.step.kind) &&
|
|
2341
|
-
buildPendingAuditTasks(engineOutcome.state).length > 0) {
|
|
2342
|
-
const inspection = await ensureSemanticReviewRunUnlocked({
|
|
2343
|
-
root: params.root, sourceRoot: requireSourceRoot(params), artifactsDir: params.artifactsDir,
|
|
2344
|
-
bundle: engineOutcome.state,
|
|
2345
|
-
state: deriveAuditState(engineOutcome.state, { emitStaleness: false }),
|
|
2346
|
-
obligationId: "audit_tasks_completed",
|
|
2347
|
-
emittedStepKind: engineOutcome.step.kind,
|
|
2348
|
-
});
|
|
2349
|
-
engineOutcome.step = { ...engineOutcome.step, inspectionRun: inspection.activeReviewRun };
|
|
2350
|
-
}
|
|
2094
|
+
chargedExecutions = engineOutcome.executions + intakeExecutions;
|
|
2351
2095
|
await assertOwnership();
|
|
2352
2096
|
await commitFold(params.artifactsDir, engineOutcome.state, ctx.tx);
|
|
2353
2097
|
return engineOutcome;
|
|
@@ -2409,7 +2153,7 @@ async function runDeterministicFold(params, heartbeat) {
|
|
|
2409
2153
|
// conversion below promotes — the carry has nowhere left to be stated, and
|
|
2410
2154
|
// the run is over.
|
|
2411
2155
|
if (outcome.step && outcome.step.kind !== "terminal_intent") {
|
|
2412
|
-
return
|
|
2156
|
+
return outcome.step;
|
|
2413
2157
|
}
|
|
2414
2158
|
if (outcome.step) {
|
|
2415
2159
|
// Guard terminals convert POST-commit, POST-hold: buildTerminalStep can
|
|
@@ -2440,16 +2184,6 @@ async function runDeterministicFold(params, heartbeat) {
|
|
|
2440
2184
|
// budget makes unreachable in practice — a backstop firing IS the anomaly).
|
|
2441
2185
|
const stalled = describeStoppedFold(outcome);
|
|
2442
2186
|
if (stalled) {
|
|
2443
|
-
// The engine's bound is its runaway backstop, and audit deliberately
|
|
2444
|
-
// supplies no stateSignature (cycle detection lives in ctx-level guards with
|
|
2445
|
-
// tolerance windows). A cause those guards miss — observed 2026-07-30: an
|
|
2446
|
-
// errored rolling packet left `audit_tasks_completed` actionable while its
|
|
2447
|
-
// error-shaped result files made the pending frontier look answered — used
|
|
2448
|
-
// to CRASH next-step with exit 1, where the same class of stall
|
|
2449
|
-
// (no_capable_pool) gets a graceful resumable pause. The engine now REPORTS
|
|
2450
|
-
// the non-convergence instead of throwing it, so the pause is built from the
|
|
2451
|
-
// outcome's own fields — no error message is parsed to learn either that the
|
|
2452
|
-
// bound fired or which obligation was spinning.
|
|
2453
2187
|
const bundle = await loadArtifactBundle(params.artifactsDir);
|
|
2454
2188
|
const decision = decideNextStep(bundle);
|
|
2455
2189
|
return {
|
|
@@ -2458,9 +2192,7 @@ async function runDeterministicFold(params, heartbeat) {
|
|
|
2458
2192
|
bundle,
|
|
2459
2193
|
reason: `The deterministic fold ${stalled.cause} — an obligation is re-selecting without clearing its own ` +
|
|
2460
2194
|
`actionable state (${stalled.spinning}). ` +
|
|
2461
|
-
"The run is paused
|
|
2462
|
-
"result files whose tasks never completed (delete them to re-dispatch those tasks), or hand " +
|
|
2463
|
-
"results in with `audit-code ingest-results --results <file>`; then re-run next-step.",
|
|
2195
|
+
"The run is paused. Inspect its current question workload and recorded errors, then re-run next-step.",
|
|
2464
2196
|
};
|
|
2465
2197
|
}
|
|
2466
2198
|
// No actionable obligation: the fold reached completion (e.g. synthesis flipped
|