audit-tools 0.50.21 → 0.51.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/audit/cli/auditStep.d.ts +1 -1
- package/dist/audit/cli/charterExtractionPrompt.d.ts.map +1 -1
- package/dist/audit/cli/charterExtractionPrompt.js +14 -1
- package/dist/audit/cli/charterExtractionPrompt.js.map +1 -1
- package/dist/audit/cli/cleanup.d.ts +0 -1
- package/dist/audit/cli/cleanup.d.ts.map +1 -1
- package/dist/audit/cli/cleanup.js +32 -20
- package/dist/audit/cli/cleanup.js.map +1 -1
- package/dist/audit/cli/conceptualDispatch.d.ts.map +1 -1
- package/dist/audit/cli/conceptualDispatch.js +30 -5
- package/dist/audit/cli/conceptualDispatch.js.map +1 -1
- package/dist/audit/cli/dispatch/hostHandoff.d.ts +2 -0
- package/dist/audit/cli/dispatch/hostHandoff.d.ts.map +1 -1
- package/dist/audit/cli/dispatch/hostHandoff.js +48 -20
- package/dist/audit/cli/dispatch/hostHandoff.js.map +1 -1
- package/dist/audit/cli/fanoutLanes.d.ts +7 -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/forceSynthesisCommand.d.ts.map +1 -1
- package/dist/audit/cli/forceSynthesisCommand.js +2 -14
- 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 +3 -13
- package/dist/audit/cli/intakeCommand.js.map +1 -1
- package/dist/audit/cli/laneSubmissions.d.ts +42 -57
- package/dist/audit/cli/laneSubmissions.d.ts.map +1 -1
- package/dist/audit/cli/laneSubmissions.js +116 -82
- package/dist/audit/cli/laneSubmissions.js.map +1 -1
- package/dist/audit/cli/nextStepCommand.d.ts.map +1 -1
- package/dist/audit/cli/nextStepCommand.js +132 -99
- package/dist/audit/cli/nextStepCommand.js.map +1 -1
- package/dist/audit/cli/nextStepHelpers.d.ts.map +1 -1
- package/dist/audit/cli/nextStepHelpers.js +39 -46
- package/dist/audit/cli/nextStepHelpers.js.map +1 -1
- package/dist/audit/cli/resynthesizeCommand.d.ts.map +1 -1
- package/dist/audit/cli/resynthesizeCommand.js +5 -2
- package/dist/audit/cli/resynthesizeCommand.js.map +1 -1
- package/dist/audit/cli/sampleRunCommand.d.ts +3 -2
- package/dist/audit/cli/sampleRunCommand.d.ts.map +1 -1
- package/dist/audit/cli/stepScaffold.d.ts +21 -0
- package/dist/audit/cli/stepScaffold.d.ts.map +1 -0
- package/dist/audit/cli/stepScaffold.js +50 -0
- package/dist/audit/cli/stepScaffold.js.map +1 -0
- package/dist/audit/cli/steps.d.ts +6 -6
- package/dist/audit/cli/synthesizeCommand.d.ts.map +1 -1
- package/dist/audit/cli/synthesizeCommand.js +2 -14
- package/dist/audit/cli/synthesizeCommand.js.map +1 -1
- package/dist/audit/contracts/workerSchemas.d.ts +8 -8
- package/dist/audit/contracts/workerSchemas.d.ts.map +1 -1
- package/dist/audit/contracts/workerSchemas.js +12 -6
- package/dist/audit/contracts/workerSchemas.js.map +1 -1
- package/dist/audit/contracts/wrapperResponse.d.ts +7 -7
- package/dist/audit/contracts/wrapperResponse.d.ts.map +1 -1
- package/dist/audit/contracts/wrapperResponse.js +9 -1
- package/dist/audit/contracts/wrapperResponse.js.map +1 -1
- package/dist/audit/extractors/analyzers/merge.d.ts.map +1 -1
- package/dist/audit/extractors/analyzers/merge.js +2 -7
- package/dist/audit/extractors/analyzers/merge.js.map +1 -1
- package/dist/audit/extractors/commentDecomposition.d.ts +28 -0
- package/dist/audit/extractors/commentDecomposition.d.ts.map +1 -1
- package/dist/audit/extractors/commentDecomposition.js +151 -22
- package/dist/audit/extractors/commentDecomposition.js.map +1 -1
- package/dist/audit/extractors/graph.d.ts +1 -1
- package/dist/audit/extractors/graph.d.ts.map +1 -1
- package/dist/audit/extractors/graph.js +2 -6
- package/dist/audit/extractors/graph.js.map +1 -1
- package/dist/audit/extractors/graphManifestEdges/cargo.d.ts.map +1 -1
- package/dist/audit/extractors/graphManifestEdges/cargo.js +4 -4
- package/dist/audit/extractors/graphManifestEdges/cargo.js.map +1 -1
- package/dist/audit/extractors/graphManifestEdges/pnpm.d.ts.map +1 -1
- package/dist/audit/extractors/graphManifestEdges/pnpm.js +3 -3
- package/dist/audit/extractors/graphManifestEdges/pnpm.js.map +1 -1
- package/dist/audit/extractors/graphManifestEdges/pyproject.d.ts.map +1 -1
- package/dist/audit/extractors/graphManifestEdges/pyproject.js +3 -2
- package/dist/audit/extractors/graphManifestEdges/pyproject.js.map +1 -1
- package/dist/audit/extractors/graphManifestEdges/toml.d.ts +0 -6
- package/dist/audit/extractors/graphManifestEdges/toml.d.ts.map +1 -1
- package/dist/audit/extractors/graphManifestEdges/toml.js +0 -13
- package/dist/audit/extractors/graphManifestEdges/toml.js.map +1 -1
- package/dist/audit/extractors/graphManifestEdges/workspace.d.ts +9 -0
- package/dist/audit/extractors/graphManifestEdges/workspace.d.ts.map +1 -1
- package/dist/audit/extractors/graphManifestEdges/workspace.js +16 -0
- package/dist/audit/extractors/graphManifestEdges/workspace.js.map +1 -1
- package/dist/audit/extractors/graphManifestEdges/yaml.d.ts +0 -2
- package/dist/audit/extractors/graphManifestEdges/yaml.d.ts.map +1 -1
- package/dist/audit/extractors/graphManifestEdges/yaml.js +0 -9
- package/dist/audit/extractors/graphManifestEdges/yaml.js.map +1 -1
- package/dist/audit/extractors/graphSignals.d.ts.map +1 -1
- package/dist/audit/extractors/graphSignals.js +16 -2
- package/dist/audit/extractors/graphSignals.js.map +1 -1
- package/dist/audit/io/artifacts.d.ts +19 -0
- package/dist/audit/io/artifacts.d.ts.map +1 -1
- package/dist/audit/io/artifacts.js +44 -2
- package/dist/audit/io/artifacts.js.map +1 -1
- package/dist/audit/orchestrator/advance.d.ts +0 -22
- package/dist/audit/orchestrator/advance.d.ts.map +1 -1
- package/dist/audit/orchestrator/advance.js +1 -43
- package/dist/audit/orchestrator/advance.js.map +1 -1
- package/dist/audit/orchestrator/charterDeltaExecutor.d.ts.map +1 -1
- package/dist/audit/orchestrator/charterDeltaExecutor.js +14 -0
- package/dist/audit/orchestrator/charterDeltaExecutor.js.map +1 -1
- package/dist/audit/orchestrator/charterExtractionExecutor.d.ts +16 -6
- package/dist/audit/orchestrator/charterExtractionExecutor.d.ts.map +1 -1
- package/dist/audit/orchestrator/charterExtractionExecutor.js +127 -9
- package/dist/audit/orchestrator/charterExtractionExecutor.js.map +1 -1
- package/dist/audit/orchestrator/charterPacketArchive.d.ts +51 -0
- package/dist/audit/orchestrator/charterPacketArchive.d.ts.map +1 -0
- package/dist/audit/orchestrator/charterPacketArchive.js +173 -0
- package/dist/audit/orchestrator/charterPacketArchive.js.map +1 -0
- package/dist/audit/orchestrator/charterPackets.d.ts +31 -13
- package/dist/audit/orchestrator/charterPackets.d.ts.map +1 -1
- package/dist/audit/orchestrator/charterPackets.js +299 -96
- package/dist/audit/orchestrator/charterPackets.js.map +1 -1
- package/dist/audit/orchestrator/designReviewPrompt.d.ts +20 -4
- package/dist/audit/orchestrator/designReviewPrompt.d.ts.map +1 -1
- package/dist/audit/orchestrator/designReviewPrompt.js +89 -12
- package/dist/audit/orchestrator/designReviewPrompt.js.map +1 -1
- package/dist/audit/orchestrator/edgeReasoning.d.ts.map +1 -1
- package/dist/audit/orchestrator/edgeReasoning.js +4 -9
- package/dist/audit/orchestrator/edgeReasoning.js.map +1 -1
- package/dist/audit/orchestrator/executorRunners.d.ts.map +1 -1
- package/dist/audit/orchestrator/executorRunners.js +17 -1
- package/dist/audit/orchestrator/executorRunners.js.map +1 -1
- package/dist/audit/orchestrator/graphEnrichmentExecutor.d.ts.map +1 -1
- package/dist/audit/orchestrator/graphEnrichmentExecutor.js +8 -1
- package/dist/audit/orchestrator/graphEnrichmentExecutor.js.map +1 -1
- package/dist/audit/orchestrator/intentCheckpointGate.d.ts.map +1 -1
- package/dist/audit/orchestrator/intentCheckpointGate.js +11 -2
- package/dist/audit/orchestrator/intentCheckpointGate.js.map +1 -1
- package/dist/audit/orchestrator/lineCounts.d.ts +44 -0
- package/dist/audit/orchestrator/lineCounts.d.ts.map +1 -0
- package/dist/audit/orchestrator/lineCounts.js +61 -0
- package/dist/audit/orchestrator/lineCounts.js.map +1 -0
- package/dist/audit/orchestrator/obligationDerive.d.ts +35 -0
- package/dist/audit/orchestrator/obligationDerive.d.ts.map +1 -0
- package/dist/audit/orchestrator/obligationDerive.js +50 -0
- package/dist/audit/orchestrator/obligationDerive.js.map +1 -0
- package/dist/audit/orchestrator/reviewPacketMetrics.d.ts.map +1 -1
- package/dist/audit/orchestrator/reviewPacketMetrics.js +3 -2
- package/dist/audit/orchestrator/reviewPacketMetrics.js.map +1 -1
- package/dist/audit/orchestrator/reviewPacketShared.d.ts +0 -2
- package/dist/audit/orchestrator/reviewPacketShared.d.ts.map +1 -1
- package/dist/audit/orchestrator/reviewPacketShared.js +0 -4
- package/dist/audit/orchestrator/reviewPacketShared.js.map +1 -1
- package/dist/audit/orchestrator/reviewPackets.d.ts.map +1 -1
- package/dist/audit/orchestrator/reviewPackets.js +3 -2
- package/dist/audit/orchestrator/reviewPackets.js.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/conflict.d.ts.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/conflict.js +3 -2
- package/dist/audit/orchestrator/selectiveDeepening/conflict.js.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/findingFollowup.d.ts.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/findingFollowup.js +3 -2
- package/dist/audit/orchestrator/selectiveDeepening/findingFollowup.js.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/highRiskClean.d.ts.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/highRiskClean.js +3 -2
- package/dist/audit/orchestrator/selectiveDeepening/highRiskClean.js.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/lensVerification.d.ts.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/lensVerification.js +4 -3
- package/dist/audit/orchestrator/selectiveDeepening/lensVerification.js.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/runtimeValidation.d.ts.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/runtimeValidation.js +2 -1
- package/dist/audit/orchestrator/selectiveDeepening/runtimeValidation.js.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/shared.d.ts +0 -2
- package/dist/audit/orchestrator/selectiveDeepening/shared.d.ts.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/shared.js +0 -27
- package/dist/audit/orchestrator/selectiveDeepening/shared.js.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/stewardFollowup.d.ts.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/stewardFollowup.js +10 -1
- package/dist/audit/orchestrator/selectiveDeepening/stewardFollowup.js.map +1 -1
- package/dist/audit/orchestrator/state.d.ts.map +1 -1
- package/dist/audit/orchestrator/state.js +21 -14
- package/dist/audit/orchestrator/state.js.map +1 -1
- package/dist/audit/orchestrator/synthesisExecutors.d.ts +8 -0
- package/dist/audit/orchestrator/synthesisExecutors.d.ts.map +1 -1
- package/dist/audit/orchestrator/synthesisExecutors.js +10 -0
- package/dist/audit/orchestrator/synthesisExecutors.js.map +1 -1
- package/dist/audit/reporting/synthesis.d.ts +42 -2
- package/dist/audit/reporting/synthesis.d.ts.map +1 -1
- package/dist/audit/reporting/synthesis.js +264 -12
- package/dist/audit/reporting/synthesis.js.map +1 -1
- package/dist/audit/supervisor/operatorHandoff.d.ts.map +1 -1
- package/dist/audit/supervisor/operatorHandoff.js +14 -6
- package/dist/audit/supervisor/operatorHandoff.js.map +1 -1
- package/dist/audit/systemic/secondOrderAdversaryPrompt.d.ts.map +1 -1
- package/dist/audit/systemic/secondOrderAdversaryPrompt.js +14 -0
- package/dist/audit/systemic/secondOrderAdversaryPrompt.js.map +1 -1
- package/dist/audit/types/analyzerCapability.d.ts +35 -11
- package/dist/audit/types/analyzerCapability.d.ts.map +1 -1
- package/dist/audit/types/analyzerCapability.js +83 -5
- package/dist/audit/types/analyzerCapability.js.map +1 -1
- package/dist/audit/types/auditState.d.ts +8 -8
- package/dist/audit/types/charterRegister.d.ts +33 -3
- package/dist/audit/types/charterRegister.d.ts.map +1 -1
- package/dist/audit/types/charterRegister.js +11 -1
- package/dist/audit/types/charterRegister.js.map +1 -1
- package/dist/audit/types/conceptualAdjudication.d.ts +395 -16
- package/dist/audit/types/conceptualAdjudication.d.ts.map +1 -1
- package/dist/audit/types/conceptualAdjudication.js +109 -5
- package/dist/audit/types/conceptualAdjudication.js.map +1 -1
- package/dist/audit/types/designAssessment.d.ts +1 -1
- package/dist/audit/types/designAssessment.d.ts.map +1 -1
- package/dist/audit/types.d.ts +9 -4
- package/dist/audit/types.d.ts.map +1 -1
- package/dist/remediate/droppedFindingsRecord.d.ts +13 -0
- package/dist/remediate/droppedFindingsRecord.d.ts.map +1 -0
- package/dist/remediate/droppedFindingsRecord.js +113 -0
- package/dist/remediate/droppedFindingsRecord.js.map +1 -0
- package/dist/remediate/intake.d.ts +17 -0
- package/dist/remediate/intake.d.ts.map +1 -1
- package/dist/remediate/intake.js +23 -0
- package/dist/remediate/intake.js.map +1 -1
- package/dist/remediate/intent/intentOrdering.d.ts.map +1 -1
- package/dist/remediate/intent/intentOrdering.js +29 -1
- package/dist/remediate/intent/intentOrdering.js.map +1 -1
- package/dist/remediate/phases/close.d.ts +1 -1
- package/dist/remediate/phases/close.d.ts.map +1 -1
- package/dist/remediate/phases/close.js +68 -6
- package/dist/remediate/phases/close.js.map +1 -1
- package/dist/remediate/phases/grounding.d.ts +12 -4
- package/dist/remediate/phases/grounding.d.ts.map +1 -1
- package/dist/remediate/phases/grounding.js +23 -60
- package/dist/remediate/phases/grounding.js.map +1 -1
- package/dist/remediate/state/types.d.ts +17 -6
- package/dist/remediate/state/types.d.ts.map +1 -1
- package/dist/remediate/state/types.js +3 -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 +10 -4
- package/dist/remediate/steps/contractPipeline.js.map +1 -1
- package/dist/remediate/steps/contractPipelinePrompts.d.ts +10 -2
- package/dist/remediate/steps/contractPipelinePrompts.d.ts.map +1 -1
- package/dist/remediate/steps/contractPipelinePrompts.js +56 -12
- package/dist/remediate/steps/contractPipelinePrompts.js.map +1 -1
- package/dist/remediate/steps/dispatch/hostHandoff.d.ts.map +1 -1
- package/dist/remediate/steps/dispatch/hostHandoff.js +277 -146
- package/dist/remediate/steps/dispatch/hostHandoff.js.map +1 -1
- package/dist/remediate/steps/nextStep.d.ts.map +1 -1
- package/dist/remediate/steps/nextStep.js +253 -75
- package/dist/remediate/steps/nextStep.js.map +1 -1
- package/dist/remediate/steps/prompts.d.ts +14 -0
- package/dist/remediate/steps/prompts.d.ts.map +1 -1
- package/dist/remediate/steps/prompts.js +52 -4
- package/dist/remediate/steps/prompts.js.map +1 -1
- package/dist/remediate/steps/types.d.ts +1 -1
- package/dist/remediate/steps/types.d.ts.map +1 -1
- package/dist/remediate/steps/types.js.map +1 -1
- package/dist/remediate/validation/contractPipelineGates.d.ts +0 -34
- package/dist/remediate/validation/contractPipelineGates.d.ts.map +1 -1
- package/dist/remediate/validation/contractPipelineGates.js +181 -143
- package/dist/remediate/validation/contractPipelineGates.js.map +1 -1
- package/dist/shared/agentReflections.d.ts +44 -3
- package/dist/shared/agentReflections.d.ts.map +1 -1
- package/dist/shared/agentReflections.js +63 -4
- package/dist/shared/agentReflections.js.map +1 -1
- package/dist/shared/analyzers/acquisitionEngine.d.ts +20 -1
- package/dist/shared/analyzers/acquisitionEngine.d.ts.map +1 -1
- package/dist/shared/analyzers/acquisitionEngine.js +17 -3
- package/dist/shared/analyzers/acquisitionEngine.js.map +1 -1
- package/dist/shared/analyzers/candidates.d.ts.map +1 -1
- package/dist/shared/analyzers/candidates.js +13 -4
- package/dist/shared/analyzers/candidates.js.map +1 -1
- package/dist/shared/analyzers/types.d.ts +17 -6
- package/dist/shared/analyzers/types.d.ts.map +1 -1
- package/dist/shared/analyzers/types.js +6 -15
- package/dist/shared/analyzers/types.js.map +1 -1
- package/dist/shared/decompose/systemicChallenge.d.ts +116 -9
- package/dist/shared/decompose/systemicChallenge.d.ts.map +1 -1
- package/dist/shared/decompose/systemicChallenge.js +32 -1
- package/dist/shared/decompose/systemicChallenge.js.map +1 -1
- package/dist/shared/engine/obligationEngine.d.ts +23 -6
- package/dist/shared/engine/obligationEngine.d.ts.map +1 -1
- package/dist/shared/engine/obligationEngine.js +38 -3
- package/dist/shared/engine/obligationEngine.js.map +1 -1
- package/dist/shared/findings/dedupe.d.ts +10 -0
- package/dist/shared/findings/dedupe.d.ts.map +1 -1
- package/dist/shared/findings/dedupe.js +15 -0
- package/dist/shared/findings/dedupe.js.map +1 -1
- package/dist/shared/friction/triage.d.ts.map +1 -1
- package/dist/shared/friction/triage.js +5 -1
- package/dist/shared/friction/triage.js.map +1 -1
- package/dist/shared/git.d.ts +6 -0
- package/dist/shared/git.d.ts.map +1 -1
- package/dist/shared/git.js +8 -0
- package/dist/shared/git.js.map +1 -1
- package/dist/shared/graph/edgeConfidence.d.ts +12 -0
- package/dist/shared/graph/edgeConfidence.d.ts.map +1 -0
- package/dist/shared/graph/edgeConfidence.js +15 -0
- package/dist/shared/graph/edgeConfidence.js.map +1 -0
- package/dist/shared/index.d.ts +26 -9
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +20 -8
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/loopCorePaths.d.ts.map +1 -1
- package/dist/shared/loopCorePaths.js +4 -0
- package/dist/shared/loopCorePaths.js.map +1 -1
- package/dist/shared/measurement/measuredOutcome.d.ts +61 -0
- package/dist/shared/measurement/measuredOutcome.d.ts.map +1 -0
- package/dist/shared/measurement/measuredOutcome.js +109 -0
- package/dist/shared/measurement/measuredOutcome.js.map +1 -0
- package/dist/shared/reporting/findingDisplay.d.ts +14 -2
- package/dist/shared/reporting/findingDisplay.d.ts.map +1 -1
- package/dist/shared/reporting/findingDisplay.js +29 -2
- package/dist/shared/reporting/findingDisplay.js.map +1 -1
- package/dist/shared/reporting/lensCoverage.d.ts +70 -0
- package/dist/shared/reporting/lensCoverage.d.ts.map +1 -0
- package/dist/shared/reporting/lensCoverage.js +108 -0
- package/dist/shared/reporting/lensCoverage.js.map +1 -0
- package/dist/shared/submission/hostResultOutcomes.d.ts +42 -0
- package/dist/shared/submission/hostResultOutcomes.d.ts.map +1 -0
- package/dist/shared/submission/hostResultOutcomes.js +129 -0
- package/dist/shared/submission/hostResultOutcomes.js.map +1 -0
- package/dist/shared/submission/ingestionChecks.d.ts +146 -0
- package/dist/shared/submission/ingestionChecks.d.ts.map +1 -0
- package/dist/shared/submission/ingestionChecks.js +157 -0
- package/dist/shared/submission/ingestionChecks.js.map +1 -0
- package/dist/shared/submission/submissionClassifier.d.ts +8 -0
- package/dist/shared/submission/submissionClassifier.d.ts.map +1 -1
- package/dist/shared/submission/submissionClassifier.js.map +1 -1
- package/dist/shared/submission/submissionLedger.d.ts +24 -1
- package/dist/shared/submission/submissionLedger.d.ts.map +1 -1
- package/dist/shared/submission/submissionLedger.js +61 -0
- package/dist/shared/submission/submissionLedger.js.map +1 -1
- package/dist/shared/submission/submissionScan.d.ts +2 -0
- package/dist/shared/submission/submissionScan.d.ts.map +1 -1
- package/dist/shared/submission/submissionScan.js +4 -0
- package/dist/shared/submission/submissionScan.js.map +1 -1
- package/dist/shared/tooling/projectFacts.d.ts +71 -0
- package/dist/shared/tooling/projectFacts.d.ts.map +1 -0
- package/dist/shared/tooling/projectFacts.js +153 -0
- package/dist/shared/tooling/projectFacts.js.map +1 -0
- package/dist/shared/tooling/projectTestAdmission.d.ts +5 -15
- package/dist/shared/tooling/projectTestAdmission.d.ts.map +1 -1
- package/dist/shared/tooling/projectTestAdmission.js +14 -5
- package/dist/shared/tooling/projectTestAdmission.js.map +1 -1
- package/dist/shared/types/charterPacket.d.ts +156 -0
- package/dist/shared/types/charterPacket.d.ts.map +1 -0
- package/dist/shared/types/charterPacket.js +9 -0
- package/dist/shared/types/charterPacket.js.map +1 -0
- package/dist/shared/types/closingActions.d.ts +16 -0
- package/dist/shared/types/closingActions.d.ts.map +1 -0
- package/dist/shared/types/closingActions.js +25 -0
- package/dist/shared/types/closingActions.js.map +1 -0
- package/dist/shared/types/finding.d.ts +275 -40
- package/dist/shared/types/finding.d.ts.map +1 -1
- package/dist/shared/types/finding.js +87 -0
- package/dist/shared/types/finding.js.map +1 -1
- package/dist/shared/types/intentCheckpoint.d.ts +50 -0
- package/dist/shared/types/intentCheckpoint.d.ts.map +1 -1
- package/dist/shared/types/intentCheckpoint.js +31 -0
- package/dist/shared/types/intentCheckpoint.js.map +1 -1
- package/dist/shared/validation/citationGrounding.d.ts +115 -0
- package/dist/shared/validation/citationGrounding.d.ts.map +1 -0
- package/dist/shared/validation/citationGrounding.js +347 -0
- package/dist/shared/validation/citationGrounding.js.map +1 -0
- package/dist/shared/validation/findingsReport.d.ts.map +1 -1
- package/dist/shared/validation/findingsReport.js +62 -0
- package/dist/shared/validation/findingsReport.js.map +1 -1
- package/docs/audit-pkg/contracts.md +34 -12
- package/docs/audit-pkg/operator-guide.md +10 -7
- package/package.json +3 -2
- package/schemas/audit-code-v1alpha1.schema.json +2 -1
- package/skills/audit-code/audit-code.prompt.md +5 -3
- package/dist/remediate/state/closingActions.d.ts +0 -3
- package/dist/remediate/state/closingActions.d.ts.map +0 -1
- package/dist/remediate/state/closingActions.js +0 -10
- package/dist/remediate/state/closingActions.js.map +0 -1
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ONE declared list of checks result ingestion performs before it accepts a
|
|
3
|
+
* host result — the source `docs/audit-pkg/contracts.md`'s check block is
|
|
4
|
+
* RENDERED from (`scripts/shared/generate-ingestion-checks.mjs`).
|
|
5
|
+
*
|
|
6
|
+
* WHY THIS EXISTS. The check set used to be written out by hand in three docs
|
|
7
|
+
* (the contracts page, the operator guide, the concurrent-runs design), and the
|
|
8
|
+
* three lists disagreed: only one named the result path, only one the strict
|
|
9
|
+
* result schema, only one the workload version. Nothing reconciled them, so
|
|
10
|
+
* whoever added a check added it to whichever doc they had open. Owner decision
|
|
11
|
+
* 2026-09-05 (nightly item l1-4): derive the list from the validator itself.
|
|
12
|
+
*
|
|
13
|
+
* The registry is LOAD-BEARING, not a fourth prose copy: every refusal a draw's
|
|
14
|
+
* ingestion emits cites one of these ids (`refuse(check, detail)`,
|
|
15
|
+
* `invalidResult(check, reason)`, a `check:` on an issue), the id type below
|
|
16
|
+
* refuses an unregistered citation at compile time, and
|
|
17
|
+
* `tests/shared/ingestion-checks-drift.test.ts` extracts the citations
|
|
18
|
+
* structurally and pins them against the declared `draws` in both directions —
|
|
19
|
+
* a row nothing cites is dead, and a citation nothing declares is an
|
|
20
|
+
* undocumented check.
|
|
21
|
+
*
|
|
22
|
+
* `cited_by` says WHERE the citation lives. The shared submission scan
|
|
23
|
+
* (`submissionScan.ts`) owns the path, read and duplicate checks for both
|
|
24
|
+
* draws; everything else is cited from the draw's own host-handoff module. Row
|
|
25
|
+
* order is the render order: envelope and binding first, then per-draw content
|
|
26
|
+
* checks, then corroboration, then the ledger.
|
|
27
|
+
*
|
|
28
|
+
* Keep every field a plain literal: the generator reads this file as TEXT
|
|
29
|
+
* through the TypeScript compiler API (no build, no import), and refuses a
|
|
30
|
+
* value it cannot read rather than rendering without it.
|
|
31
|
+
*/
|
|
32
|
+
export const INGESTION_DRAWS = [
|
|
33
|
+
{ id: "audit", source: "src/audit/cli/dispatch/hostHandoff.ts" },
|
|
34
|
+
{ id: "remediate", source: "src/remediate/steps/dispatch/hostHandoff.ts" },
|
|
35
|
+
];
|
|
36
|
+
/** Where the shared-cited checks live. */
|
|
37
|
+
export const INGESTION_SHARED_SOURCE = "src/shared/submission/submissionScan.ts";
|
|
38
|
+
export const INGESTION_CHECKS = [
|
|
39
|
+
{
|
|
40
|
+
id: "result_path",
|
|
41
|
+
verifies: "The submission is read only from the tool-derived bound path (`<run dir>/<sha256(work item id)>.json`) inside the run's artifacts directory; a result written anywhere else is never consulted.",
|
|
42
|
+
draws: ["audit", "remediate"],
|
|
43
|
+
cited_by: "shared",
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: "result_json",
|
|
47
|
+
verifies: "The bytes at the bound path parse as JSON.",
|
|
48
|
+
draws: ["audit", "remediate"],
|
|
49
|
+
cited_by: "shared",
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
id: "result_envelope",
|
|
53
|
+
verifies: "The top-level key set is exactly the draw's result contract and `contract_version` is the version the workload was issued under.",
|
|
54
|
+
draws: ["audit", "remediate"],
|
|
55
|
+
cited_by: "draw",
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: "identity_binding",
|
|
59
|
+
verifies: "`run_id` is the run that emitted the workload, `work_item_id` is the work item the result was read for, and `prompt_sha256` is the digest of the prompt that work item was issued with — an answer to another run, item or a stale prompt is refused.",
|
|
60
|
+
draws: ["audit", "remediate"],
|
|
61
|
+
cited_by: "draw",
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: "workload_binding",
|
|
65
|
+
verifies: "The persisted workload, result map and task bindings still derive from this run (versions, bound paths, prompt digests, scopes); a result cannot be accepted against a binding the tool cannot re-derive.",
|
|
66
|
+
draws: ["audit", "remediate"],
|
|
67
|
+
cited_by: "draw",
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
id: "file_coverage",
|
|
71
|
+
verifies: "`file_coverage` names exactly the assigned files, each fully reviewed, with `total_lines` equal to the line count bound at dispatch.",
|
|
72
|
+
draws: ["audit"],
|
|
73
|
+
cited_by: "draw",
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
id: "findings_contract",
|
|
77
|
+
verifies: "Every finding satisfies the audit finding contract (lens, ids, evidence shape).",
|
|
78
|
+
draws: ["audit"],
|
|
79
|
+
cited_by: "draw",
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
id: "result_schema",
|
|
83
|
+
verifies: "The bound result converts to the persisted `AuditResult` schema (`schemas/audit_result.schema.json`).",
|
|
84
|
+
draws: ["audit"],
|
|
85
|
+
cited_by: "draw",
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
id: "result_validation",
|
|
89
|
+
verifies: "The per-result content rules hold before acceptance (evidence present, line spans inside the file, line counts matching disk); warnings ride an advisory channel and never refuse.",
|
|
90
|
+
draws: ["audit"],
|
|
91
|
+
cited_by: "draw",
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
id: "outcome_shape",
|
|
95
|
+
verifies: "A decision result's `outcome` carries exactly the fields its status requires (`resolved_no_change` evidence, `blocked` failure reason, `needs_clarification` question).",
|
|
96
|
+
draws: ["remediate"],
|
|
97
|
+
cited_by: "draw",
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
id: "write_scope",
|
|
101
|
+
verifies: "`changed_files` is non-empty, sorted, unique and normalized, lies within the prompt-bound `allowed_files`, and equals the files the landed commit actually changed.",
|
|
102
|
+
draws: ["remediate"],
|
|
103
|
+
cited_by: "draw",
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
id: "commit_evidence",
|
|
107
|
+
verifies: "`commit_evidence` binds the workload baseline to a distinct landed commit; both exist, the baseline is an ancestor of the landed commit (waived only under a genuinely orphaned baseline in recovery), and the landed commit is reachable from HEAD.",
|
|
108
|
+
draws: ["remediate"],
|
|
109
|
+
cited_by: "draw",
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
id: "test_evidence",
|
|
113
|
+
verifies: "`test_evidence` carries exactly one passed entry per required test echoing the bound command, and the tool's own mechanical rerun of those tests passes.",
|
|
114
|
+
draws: ["remediate"],
|
|
115
|
+
cited_by: "draw",
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
id: "obligation_evidence",
|
|
119
|
+
verifies: "`obligation_evidence` cites non-empty evidence for every prompt-bound obligation, none twice, and none the work item does not bind.",
|
|
120
|
+
draws: ["remediate"],
|
|
121
|
+
cited_by: "draw",
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
id: "worktree_evidence",
|
|
125
|
+
verifies: "`worktree_evidence` binds the workload baseline and the same changed-file list, and no landed file overlaps dirt that pre-dated the run.",
|
|
126
|
+
draws: ["remediate"],
|
|
127
|
+
cited_by: "draw",
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
id: "landing_attestation",
|
|
131
|
+
verifies: "`acceptance` and `merge` both attest a completed landing.",
|
|
132
|
+
draws: ["remediate"],
|
|
133
|
+
cited_by: "draw",
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
id: "no_change_corroboration",
|
|
137
|
+
verifies: "A `resolved_no_change` claim is corroborated against git and the persisted write-scope binding; attestation-only acceptance is refused.",
|
|
138
|
+
draws: ["remediate"],
|
|
139
|
+
cited_by: "draw",
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
id: "duplicate_result",
|
|
143
|
+
verifies: "`result_id` has not already been accepted this run: a byte-identical replay is a no-op, a different body under an accepted id is refused.",
|
|
144
|
+
draws: ["audit", "remediate"],
|
|
145
|
+
cited_by: "shared",
|
|
146
|
+
},
|
|
147
|
+
];
|
|
148
|
+
/** The ids a draw declares, in registry order — draw-cited and shared-cited alike. */
|
|
149
|
+
export function ingestionCheckIdsFor(draw) {
|
|
150
|
+
return INGESTION_CHECKS.filter((check) => check.draws.includes(draw)).map((check) => check.id);
|
|
151
|
+
}
|
|
152
|
+
/** The ids whose citation lives in the given place, in registry order. */
|
|
153
|
+
export function ingestionCheckIdsCitedBy(citedBy, draw) {
|
|
154
|
+
return INGESTION_CHECKS.filter((check) => check.cited_by === citedBy &&
|
|
155
|
+
(draw === undefined || check.draws.includes(draw))).map((check) => check.id);
|
|
156
|
+
}
|
|
157
|
+
//# sourceMappingURL=ingestionChecks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ingestionChecks.js","sourceRoot":"","sources":["../../../src/shared/submission/ingestionChecks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,uCAAuC,EAAE;IAChE,EAAE,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,6CAA6C,EAAE;CAClE,CAAC;AAIX,0CAA0C;AAC1C,MAAM,CAAC,MAAM,uBAAuB,GAAG,yCAAyC,CAAC;AAWjF,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B;QACE,EAAE,EAAE,aAAa;QACjB,QAAQ,EACN,iMAAiM;QACnM,KAAK,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC;QAC7B,QAAQ,EAAE,QAAQ;KACnB;IACD;QACE,EAAE,EAAE,aAAa;QACjB,QAAQ,EAAE,4CAA4C;QACtD,KAAK,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC;QAC7B,QAAQ,EAAE,QAAQ;KACnB;IACD;QACE,EAAE,EAAE,iBAAiB;QACrB,QAAQ,EACN,kIAAkI;QACpI,KAAK,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC;QAC7B,QAAQ,EAAE,MAAM;KACjB;IACD;QACE,EAAE,EAAE,kBAAkB;QACtB,QAAQ,EACN,uPAAuP;QACzP,KAAK,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC;QAC7B,QAAQ,EAAE,MAAM;KACjB;IACD;QACE,EAAE,EAAE,kBAAkB;QACtB,QAAQ,EACN,2MAA2M;QAC7M,KAAK,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC;QAC7B,QAAQ,EAAE,MAAM;KACjB;IACD;QACE,EAAE,EAAE,eAAe;QACnB,QAAQ,EACN,sIAAsI;QAC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D;QACrE,KAAK,EAAE,CAAC,WAAW,CAAC;QACpB,QAAQ,EAAE,MAAM;KACjB;IACD;QACE,EAAE,EAAE,yBAAyB;QAC7B,QAAQ,EACN,yIAAyI;QAC3I,KAAK,EAAE,CAAC,WAAW,CAAC;QACpB,QAAQ,EAAE,MAAM;KACjB;IACD;QACE,EAAE,EAAE,kBAAkB;QACtB,QAAQ,EACN,2IAA2I;QAC7I,KAAK,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC;QAC7B,QAAQ,EAAE,QAAQ;KACnB;CAC2C,CAAC;AAI/C,sFAAsF;AACtF,MAAM,UAAU,oBAAoB,CAAC,IAAmB;IACtD,OAAO,gBAAgB,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CACtC,KAAK,CAAC,KAAkC,CAAC,QAAQ,CAAC,IAAI,CAAC,CACzD,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAC7B,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,wBAAwB,CACtC,OAAmC,EACnC,IAAoB;IAEpB,OAAO,gBAAgB,CAAC,MAAM,CAC5B,CAAC,KAAK,EAAE,EAAE,CACR,KAAK,CAAC,QAAQ,KAAK,OAAO;QAC1B,CAAC,IAAI,KAAK,SAAS,IAAK,KAAK,CAAC,KAAkC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CACnF,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAC7B,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { IngestionCheckId } from "./ingestionChecks.js";
|
|
1
2
|
export declare const SUBMISSION_ISSUE_CODES: readonly ["submission_missing", "submission_malformed", "submission_contract_invalid", "submission_rejected", "duplicate_submission_id"];
|
|
2
3
|
export type SubmissionIssueCode = (typeof SUBMISSION_ISSUE_CODES)[number];
|
|
3
4
|
/**
|
|
@@ -15,6 +16,13 @@ export type SubmissionIssueCode = (typeof SUBMISSION_ISSUE_CODES)[number];
|
|
|
15
16
|
export interface SubmissionIssue<TCode extends string = SubmissionIssueCode> {
|
|
16
17
|
readonly code: TCode;
|
|
17
18
|
readonly message: string;
|
|
19
|
+
/**
|
|
20
|
+
* The registered ingestion check this issue failed
|
|
21
|
+
* (`INGESTION_CHECKS`, ./ingestionChecks.ts) — the structured twin of the
|
|
22
|
+
* category the message opens with, so a host repairing the result does not
|
|
23
|
+
* have to parse prose to learn which check to fix.
|
|
24
|
+
*/
|
|
25
|
+
readonly check?: IngestionCheckId;
|
|
18
26
|
readonly submission_id?: string;
|
|
19
27
|
readonly submission_path?: string;
|
|
20
28
|
readonly work_item_id?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"submissionClassifier.d.ts","sourceRoot":"","sources":["../../../src/shared/submission/submissionClassifier.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"submissionClassifier.d.ts","sourceRoot":"","sources":["../../../src/shared/submission/submissionClassifier.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,eAAO,MAAM,sBAAsB,0IAWzB,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1E;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,eAAe,CAAC,KAAK,SAAS,MAAM,GAAG,mBAAmB;IACzE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,gBAAgB,CAAC;IAClC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,gFAAgF;AAChF,MAAM,MAAM,qBAAqB,GAC7B;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;CAAE,GAC5B;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACvD;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC;AAExD;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAC1C,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,qBAAqB,CAAC,CAqBhC;AAED,+EAA+E;AAC/E,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;CACjC;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,qBAAqB,EAC9B,OAAO,EAAE,qBAAqB,GAC7B,eAAe,GAAG,IAAI,CAkBxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"submissionClassifier.js","sourceRoot":"","sources":["../../../src/shared/submission/submissionClassifier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"submissionClassifier.js","sourceRoot":"","sources":["../../../src/shared/submission/submissionClassifier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,wCAAwC;IACxC,oBAAoB;IACpB,0DAA0D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,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC/B,OAAO;YACL,IAAI,EAAE,oBAAoB;YAC1B,OAAO,EAAE,SAAS,OAAO,CAAC,IAAI,uCAAuC;YACrE,GAAG,QAAQ;SACZ,CAAC;IACJ,CAAC;IACD,OAAO;QACL,IAAI,EAAE,sBAAsB;QAC5B,OAAO,EAAE,SAAS,OAAO,CAAC,IAAI,wCAAwC,OAAO,CAAC,MAAM,EAAE;QACtF,GAAG,QAAQ;KACZ,CAAC;AACJ,CAAC"}
|
|
@@ -1,7 +1,17 @@
|
|
|
1
|
+
import type { MeasuredOutcome } from "../measurement/measuredOutcome.js";
|
|
1
2
|
import type { SubmissionIssueCode } from "./submissionClassifier.js";
|
|
2
3
|
export declare const SUBMISSION_LEDGER_EVENT_CONTRACT_VERSION: "submission-ledger-event/v1alpha1";
|
|
3
|
-
export declare const SUBMISSION_EVENT_KINDS: readonly ["expected", "accepted", "rejected", "recovered_by_hand", "accepted_via_recovery", "removed_by_operator"];
|
|
4
|
+
export declare const SUBMISSION_EVENT_KINDS: readonly ["expected", "accepted", "rejected", "recovered_by_hand", "accepted_via_recovery", "removed_by_operator", "dispatched", "lane_outcome"];
|
|
4
5
|
export type SubmissionEventKind = (typeof SUBMISSION_EVENT_KINDS)[number];
|
|
6
|
+
/** The kinds {@link isIngestEvent} admits, in declaration order. */
|
|
7
|
+
export declare const INGEST_EVENT_KINDS: readonly SubmissionEventKind[];
|
|
8
|
+
/**
|
|
9
|
+
* True when this kind records the tool having ingested something. The ONE home
|
|
10
|
+
* for "which events change a submission's trailing state": every
|
|
11
|
+
* last-event-per-submission reader asks it here rather than re-spelling an
|
|
12
|
+
* exclusion list that the next new kind would fall through.
|
|
13
|
+
*/
|
|
14
|
+
export declare function isIngestEvent(kind: SubmissionEventKind): boolean;
|
|
5
15
|
/**
|
|
6
16
|
* One ledger event. Generic over the DRAW's issue-code vocabulary: the base
|
|
7
17
|
* parameterization carries the shared submission codes, and a draw extending
|
|
@@ -17,6 +27,19 @@ export interface SubmissionLedgerEvent<TIssueCode extends string = SubmissionIss
|
|
|
17
27
|
readonly kind: SubmissionEventKind;
|
|
18
28
|
readonly issue_code?: TIssueCode;
|
|
19
29
|
readonly message?: string;
|
|
30
|
+
/**
|
|
31
|
+
* What a `lane_outcome` row observed at the bound path. Absent on every other
|
|
32
|
+
* kind — an ingest event's decision is its `kind`.
|
|
33
|
+
*/
|
|
34
|
+
readonly outcome?: MeasuredOutcome;
|
|
35
|
+
/**
|
|
36
|
+
* The ROUND a `dispatched` (and its matching `lane_outcome`) row belongs to,
|
|
37
|
+
* when the emitter has one. Carried as DATA rather than parsed back out of a
|
|
38
|
+
* lane id, so a delivery rate is reported per round and a superseded round's
|
|
39
|
+
* lanes never drag the current round's rate down. Absent for lane families
|
|
40
|
+
* with no round of their own.
|
|
41
|
+
*/
|
|
42
|
+
readonly round_id?: string;
|
|
20
43
|
/** ISO-8601. A faithful event record is allowed to say when. */
|
|
21
44
|
readonly recorded_at: string;
|
|
22
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"submissionLedger.d.ts","sourceRoot":"","sources":["../../../src/shared/submission/submissionLedger.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE,eAAO,MAAM,wCAAwC,EACnD,kCAA2C,CAAC;AAE9C,eAAO,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"submissionLedger.d.ts","sourceRoot":"","sources":["../../../src/shared/submission/submissionLedger.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE,eAAO,MAAM,wCAAwC,EACnD,kCAA2C,CAAC;AAE9C,eAAO,MAAM,sBAAsB,kJAkDzB,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO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vD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,0BAA0B,CAAC;CAC7C;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,oBAAoB,GAAG,SAAS,qBAAqB,EAAE,GAAG;IACpE,QAAQ,CAAC,MAAM,EAAE,SAAS,qBAAqB,EAAE,CAAC;IAClD,QAAQ,CAAC,OAAO,EAAE,SAAS,oBAAoB,EAAE,CAAC;CACnD,CAAC;AAqBF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,oBAAoB,CACxC,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,oBAAoB,CAAC,CA4C/B"}
|
|
@@ -48,7 +48,68 @@ export const SUBMISSION_EVENT_KINDS = [
|
|
|
48
48
|
* is: a second event after a recorded withdrawal.
|
|
49
49
|
*/
|
|
50
50
|
"removed_by_operator",
|
|
51
|
+
/**
|
|
52
|
+
* The tool WROTE this lane's prompt and declared its bound path — the lane
|
|
53
|
+
* was dispatched.
|
|
54
|
+
*
|
|
55
|
+
* Deliberately disjoint from `expected`. *Expecting* an artifact is a claim
|
|
56
|
+
* the tool will be owed something and will re-ask until it arrives;
|
|
57
|
+
* *dispatching* is a fact about the past. The perspective lanes of a deep
|
|
58
|
+
* conceptual pass are un-expected by design (P25: the tool never reads their
|
|
59
|
+
* findings, so an expectation against one could never be satisfied or
|
|
60
|
+
* dropped and accumulated as a permanent, false shortfall) — and were
|
|
61
|
+
* therefore invisible, so a lane that exited 0 having written nothing left no
|
|
62
|
+
* trace in any artifact. A dispatch row can never become a shortfall:
|
|
63
|
+
* shortfall is a diff over the expected SET, a path that never reads ledger
|
|
64
|
+
* events.
|
|
65
|
+
*/
|
|
66
|
+
"dispatched",
|
|
67
|
+
/**
|
|
68
|
+
* What a dispatched lane actually delivered, observed once at the fold that
|
|
69
|
+
* ingests its round's terminal submission. Carries `outcome`. A `dispatched`
|
|
70
|
+
* row with no terminal row at all is the record of a lane that never
|
|
71
|
+
* delivered — the absence IS the statement — so nothing here ever mints a
|
|
72
|
+
* terminal row nobody observed.
|
|
73
|
+
*/
|
|
74
|
+
"lane_outcome",
|
|
51
75
|
];
|
|
76
|
+
/**
|
|
77
|
+
* Which kinds mean "the TOOL ingested this submission and decided about it".
|
|
78
|
+
*
|
|
79
|
+
* Exhaustive by construction, so a new kind must be classified rather than
|
|
80
|
+
* defaulting into either answer. This exists because several readers asked the
|
|
81
|
+
* question as `kind !== "expected"` — a partition that silently absorbed every
|
|
82
|
+
* future kind. Under it, a `dispatched` row appended when a refused lane is
|
|
83
|
+
* re-materialized would have become that submission's trailing event, deleting
|
|
84
|
+
* the refusal from `lastRefusals` (so a host whose submission was received and
|
|
85
|
+
* REJECTED is told it "submitted nothing") and making the report claim the
|
|
86
|
+
* refusal "was later accepted or re-landed by hand" when nothing had been.
|
|
87
|
+
*/
|
|
88
|
+
const EVENT_KIND_IS_INGEST = {
|
|
89
|
+
// A declaration, not an ingest.
|
|
90
|
+
expected: false,
|
|
91
|
+
// Facts about dispatch and delivery; the tool consumed nothing.
|
|
92
|
+
dispatched: false,
|
|
93
|
+
lane_outcome: false,
|
|
94
|
+
accepted: true,
|
|
95
|
+
rejected: true,
|
|
96
|
+
recovered_by_hand: true,
|
|
97
|
+
accepted_via_recovery: true,
|
|
98
|
+
// A withdrawal is a decision ABOUT an ingested submission, and it ends a
|
|
99
|
+
// refusal's trailing state exactly as an acceptance does.
|
|
100
|
+
removed_by_operator: true,
|
|
101
|
+
};
|
|
102
|
+
/** The kinds {@link isIngestEvent} admits, in declaration order. */
|
|
103
|
+
export const INGEST_EVENT_KINDS = SUBMISSION_EVENT_KINDS.filter((kind) => EVENT_KIND_IS_INGEST[kind]);
|
|
104
|
+
/**
|
|
105
|
+
* True when this kind records the tool having ingested something. The ONE home
|
|
106
|
+
* for "which events change a submission's trailing state": every
|
|
107
|
+
* last-event-per-submission reader asks it here rather than re-spelling an
|
|
108
|
+
* exclusion list that the next new kind would fall through.
|
|
109
|
+
*/
|
|
110
|
+
export function isIngestEvent(kind) {
|
|
111
|
+
return EVENT_KIND_IS_INGEST[kind];
|
|
112
|
+
}
|
|
52
113
|
/** `<artifactsDir>/submissions/submission-ledger.jsonl`. */
|
|
53
114
|
export function submissionLedgerPath(artifactsDir) {
|
|
54
115
|
return join(submissionsDir(artifactsDir), "submission-ledger.jsonl");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"submissionLedger.js","sourceRoot":"","sources":["../../../src/shared/submission/submissionLedger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"submissionLedger.js","sourceRoot":"","sources":["../../../src/shared/submission/submissionLedger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAI1D,MAAM,CA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AAC,QAAQ,CAAC,EAAE,CAAC;QAC3C,UAAU,IAAI,CAAC,CAAC;QAChB,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QACvC,IAAI,MAA6B,CAAC;QAClC,IAAI,CAAC;YACH,MAAM,KAAK,GAAY,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACxC,yEAAyE;YACzE,wEAAwE;YACxE,sEAAsE;YACtE,uEAAuE;YACvE,+CAA+C;YAC/C,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;gBACxE,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC;gBACzD,SAAS;YACX,CAAC;YACD,MAAM,GAAG,KAA8B,CAAC;QAC1C,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC;YACzD,SAAS;QACX,CAAC;QACD,MAAM,KAAK,GAAG,8BAA8B,CAC1C,MAAM,EACN,wCAAwC,CACzC,CAAC;QACF,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,yBAAyB,EAAE,CAAC,CAAC;YACtE,SAAS;QACX,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;IACD,OAAO,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACrC,CAAC"}
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
* fresh per-call set and consumes at parse. This scan only CHECKS.
|
|
27
27
|
*/
|
|
28
28
|
import { type SubmissionIssue } from "./submissionClassifier.js";
|
|
29
|
+
import type { IngestionCheckId } from "./ingestionChecks.js";
|
|
29
30
|
/**
|
|
30
31
|
* The domain parser's answer, normalized. `detail` is handed straight to the
|
|
31
32
|
* draw's `contractInvalid` renderer — the scan never composes refusal prose of
|
|
@@ -36,6 +37,7 @@ export type SubmissionParse<TParsed> = {
|
|
|
36
37
|
readonly parsed: TParsed;
|
|
37
38
|
} | {
|
|
38
39
|
readonly ok: false;
|
|
40
|
+
readonly check: IngestionCheckId;
|
|
39
41
|
readonly detail: string;
|
|
40
42
|
};
|
|
41
43
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"submissionScan.d.ts","sourceRoot":"","sources":["../../../src/shared/submission/submissionScan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAIH,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"submissionScan.d.ts","sourceRoot":"","sources":["../../../src/shared/submission/submissionScan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAIH,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D;;;;GAIG;AACH,MAAM,MAAM,eAAe,CAAC,OAAO,IAC/B;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GAC/C;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtF;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,wCAAwC;IACxC,QAAQ,CAAC,OAAO,EAAE,MAAM,MAAM,CAAC;IAC/B,qEAAqE;IACrE,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 +51,7 @@ export async function scanBoundSubmission(params) {
|
|
|
51
51
|
ok: false,
|
|
52
52
|
issue: {
|
|
53
53
|
code: "submission_missing",
|
|
54
|
+
check: "result_path",
|
|
54
55
|
message: params.messages.missing(),
|
|
55
56
|
...locators,
|
|
56
57
|
},
|
|
@@ -61,6 +62,7 @@ export async function scanBoundSubmission(params) {
|
|
|
61
62
|
ok: false,
|
|
62
63
|
issue: {
|
|
63
64
|
code: "submission_malformed",
|
|
65
|
+
check: "result_json",
|
|
64
66
|
message: params.messages.malformed(read.detail),
|
|
65
67
|
...locators,
|
|
66
68
|
},
|
|
@@ -72,6 +74,7 @@ export async function scanBoundSubmission(params) {
|
|
|
72
74
|
ok: false,
|
|
73
75
|
issue: {
|
|
74
76
|
code: "submission_contract_invalid",
|
|
77
|
+
check: parsed.check,
|
|
75
78
|
message: params.messages.contractInvalid(parsed.detail),
|
|
76
79
|
...locators,
|
|
77
80
|
},
|
|
@@ -83,6 +86,7 @@ export async function scanBoundSubmission(params) {
|
|
|
83
86
|
ok: false,
|
|
84
87
|
issue: {
|
|
85
88
|
code: "duplicate_submission_id",
|
|
89
|
+
check: "duplicate_result",
|
|
86
90
|
message: params.messages.duplicate(resultId),
|
|
87
91
|
...locators,
|
|
88
92
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"submissionScan.js","sourceRoot":"","sources":["../../../src/shared/submission/submissionScan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,2EAA2E;AAC3E,2EAA2E;AAC3E,gEAAgE;AAChE,OAAO,EACL,sBAAsB,GAEvB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"submissionScan.js","sourceRoot":"","sources":["../../../src/shared/submission/submissionScan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,2EAA2E;A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AAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACxC,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO;YACL,EAAE,EAAE,KAAK;YACT,KAAK,EAAE;gBACL,IAAI,EAAE,6BAA6B;gBACnC,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC;gBACvD,GAAG,QAAQ;aACZ;SACF,CAAC;IACJ,CAAC;IACD,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAChD,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC1B,OAAO;YACL,EAAE,EAAE,KAAK;YACT,KAAK,EAAE;gBACL,IAAI,EAAE,yBAAyB;gBAC/B,KAAK,EAAE,kBAAkB;gBACzB,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC;gBAC5C,GAAG,QAAQ;aACZ;SACF,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;AAC7C,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { type ClosingAction } from "../types/closingActions.js";
|
|
2
|
+
import { type ProjectCommands } from "./testCommand.js";
|
|
3
|
+
/**
|
|
4
|
+
* Deterministic project facts a remediation run detects at intake (owner
|
|
5
|
+
* decision 92b0e2dd7cfdc06d, 2026-08-31): the project type and the closing
|
|
6
|
+
* actions the repository's shape makes APPROPRIATE. These are candidates the
|
|
7
|
+
* tool PRESENTS at the intent checkpoint; the user always chooses. Nothing
|
|
8
|
+
* here selects a closing action, and no caller may treat the first candidate
|
|
9
|
+
* as a default — an unchosen action is `none`.
|
|
10
|
+
*
|
|
11
|
+
* Signals are recorded so the presentation can say WHY a candidate is offered
|
|
12
|
+
* ("a remote named origin exists", "package.json is private"). Remote NAMES
|
|
13
|
+
* only, never URLs: a remote URL may carry a token.
|
|
14
|
+
*/
|
|
15
|
+
export interface ProjectSignals {
|
|
16
|
+
/** `root` is inside a git working tree. */
|
|
17
|
+
git_repo: boolean;
|
|
18
|
+
/** Configured git remote names (never URLs). Empty when not a repo. */
|
|
19
|
+
remotes: string[];
|
|
20
|
+
/** Manifest files present at the root, repo-relative. */
|
|
21
|
+
manifests: string[];
|
|
22
|
+
/** package.json `private`; null when there is no package.json. */
|
|
23
|
+
package_private: boolean | null;
|
|
24
|
+
/** package.json carries a name and a version and is not private. */
|
|
25
|
+
package_publishable: boolean;
|
|
26
|
+
/** npm scripts whose name starts with `release` or `publish`. */
|
|
27
|
+
release_scripts: string[];
|
|
28
|
+
/** CI configuration present at the root, repo-relative. */
|
|
29
|
+
ci_config: string[];
|
|
30
|
+
}
|
|
31
|
+
export interface ProjectFacts {
|
|
32
|
+
/**
|
|
33
|
+
* Ecosystem label derived from the manifests present — `node`, `python`,
|
|
34
|
+
* `go`, `rust`, a `+`-joined mix of those in that order, or `unknown`.
|
|
35
|
+
*/
|
|
36
|
+
project_type: string;
|
|
37
|
+
/**
|
|
38
|
+
* The closing actions the detected facts make appropriate, in
|
|
39
|
+
* `CLOSING_ACTIONS` order. `none` and `custom` are always present: doing
|
|
40
|
+
* nothing and running an operator command are appropriate for every repo.
|
|
41
|
+
*/
|
|
42
|
+
candidate_closing_actions: ClosingAction[];
|
|
43
|
+
/** One line per candidate saying which fact offers it. */
|
|
44
|
+
candidate_rationale: Partial<Record<ClosingAction, string>>;
|
|
45
|
+
signals: ProjectSignals;
|
|
46
|
+
/** Test / e2e / build / lint argv discovered from the manifests. */
|
|
47
|
+
commands: ProjectCommands;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Derive the candidate closing actions from the signals. Pure, so the rule is
|
|
51
|
+
* testable without a filesystem; `detectProjectFacts` is the only production
|
|
52
|
+
* caller.
|
|
53
|
+
*/
|
|
54
|
+
export declare function candidateClosingActions(signals: ProjectSignals): {
|
|
55
|
+
candidates: ClosingAction[];
|
|
56
|
+
rationale: Partial<Record<ClosingAction, string>>;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Detect the project facts for `root`. Deterministic and degrade-to-empty:
|
|
60
|
+
* a missing manifest, an unreadable one, or an absent git binary narrows the
|
|
61
|
+
* facts; it never throws.
|
|
62
|
+
*/
|
|
63
|
+
export declare function detectProjectFacts(root: string): Promise<ProjectFacts>;
|
|
64
|
+
/**
|
|
65
|
+
* The facts a run has when nothing was detected — an unknown type and only
|
|
66
|
+
* the two actions appropriate for every repository. Planning falls back to
|
|
67
|
+
* this when no persisted facts exist; it never detects on its own, because
|
|
68
|
+
* detection spawns git and planning is backend-independent by contract.
|
|
69
|
+
*/
|
|
70
|
+
export declare function neutralProjectFacts(): ProjectFacts;
|
|
71
|
+
//# sourceMappingURL=projectFacts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projectFacts.d.ts","sourceRoot":"","sources":["../../../src/shared/tooling/projectFacts.ts"],"names":[],"mappings":"AAGA,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAA2B,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEjF;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,cAAc;IAC7B,2CAA2C;IAC3C,QAAQ,EAAE,OAAO,CAAC;IAClB,uEAAuE;IACvE,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,yDAAyD;IACzD,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,kEAAkE;IAClE,eAAe,EAAE,OAAO,GAAG,IAAI,CAAC;IAChC,oEAAoE;IACpE,mBAAmB,EAAE,OAAO,CAAC;IAC7B,iEAAiE;IACjE,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,2DAA2D;IAC3D,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,yBAAyB,EAAE,aAAa,EAAE,CAAC;IAC3C,0DAA0D;IAC1D,mBAAmB,EAAE,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,CAAC;IAC5D,OAAO,EAAE,cAAc,CAAC;IACxB,oEAAoE;IACpE,QAAQ,EAAE,eAAe,CAAC;CAC3B;AAwDD;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,cAAc,GACtB;IAAE,UAAU,EAAE,aAAa,EAAE,CAAC;IAAC,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,CAAA;CAAE,CA+BpF;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CA8B5E;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,YAAY,CAkBlD"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { gitRemotes, isGitRepo } from "../git.js";
|
|
4
|
+
import { CLOSING_ACTIONS } from "../types/closingActions.js";
|
|
5
|
+
import { discoverProjectCommands } from "./testCommand.js";
|
|
6
|
+
const MANIFESTS = [
|
|
7
|
+
{ file: "package.json", ecosystem: "node" },
|
|
8
|
+
{ file: "pyproject.toml", ecosystem: "python" },
|
|
9
|
+
{ file: "setup.py", ecosystem: "python" },
|
|
10
|
+
{ file: "pytest.ini", ecosystem: "python" },
|
|
11
|
+
{ file: "go.mod", ecosystem: "go" },
|
|
12
|
+
{ file: "Cargo.toml", ecosystem: "rust" },
|
|
13
|
+
];
|
|
14
|
+
const ECOSYSTEM_ORDER = ["node", "python", "go", "rust"];
|
|
15
|
+
const CI_CONFIG = [
|
|
16
|
+
".github/workflows",
|
|
17
|
+
".gitlab-ci.yml",
|
|
18
|
+
"azure-pipelines.yml",
|
|
19
|
+
"Jenkinsfile",
|
|
20
|
+
".circleci/config.yml",
|
|
21
|
+
"bitbucket-pipelines.yml",
|
|
22
|
+
];
|
|
23
|
+
/** The manifests that mark a package as publishable to a registry by shape alone. */
|
|
24
|
+
const PUBLISHABLE_MANIFESTS = new Set(["pyproject.toml", "Cargo.toml"]);
|
|
25
|
+
function readPackageJson(root) {
|
|
26
|
+
const path = join(root, "package.json");
|
|
27
|
+
if (!existsSync(path))
|
|
28
|
+
return null;
|
|
29
|
+
try {
|
|
30
|
+
const parsed = JSON.parse(readFileSync(path, "utf8"));
|
|
31
|
+
return parsed !== null && typeof parsed === "object" && !Array.isArray(parsed)
|
|
32
|
+
? parsed
|
|
33
|
+
: null;
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
// A malformed manifest degrades to "no manifest facts", never a throw —
|
|
37
|
+
// detection must not fail an intake.
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function releaseScripts(pkg) {
|
|
42
|
+
const scripts = pkg?.scripts;
|
|
43
|
+
if (scripts === null || typeof scripts !== "object")
|
|
44
|
+
return [];
|
|
45
|
+
return Object.keys(scripts)
|
|
46
|
+
.filter((name) => /^(release|publish)/.test(name))
|
|
47
|
+
.sort();
|
|
48
|
+
}
|
|
49
|
+
function projectTypeFrom(manifests) {
|
|
50
|
+
const present = new Set(MANIFESTS.filter((m) => manifests.includes(m.file)).map((m) => m.ecosystem));
|
|
51
|
+
const ordered = ECOSYSTEM_ORDER.filter((e) => present.has(e));
|
|
52
|
+
return ordered.length === 0 ? "unknown" : ordered.join("+");
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Derive the candidate closing actions from the signals. Pure, so the rule is
|
|
56
|
+
* testable without a filesystem; `detectProjectFacts` is the only production
|
|
57
|
+
* caller.
|
|
58
|
+
*/
|
|
59
|
+
export function candidateClosingActions(signals) {
|
|
60
|
+
const rationale = {};
|
|
61
|
+
const offered = new Set(["none", "custom"]);
|
|
62
|
+
rationale.none = "do nothing after the fixes land in the working tree";
|
|
63
|
+
rationale.custom = "run an operator-supplied command; attach it when the close phase asks for confirmation";
|
|
64
|
+
if (signals.git_repo) {
|
|
65
|
+
offered.add("commit");
|
|
66
|
+
rationale.commit = "the root is a git working tree";
|
|
67
|
+
offered.add("tag");
|
|
68
|
+
rationale.tag = "the root is a git working tree";
|
|
69
|
+
if (signals.remotes.length > 0) {
|
|
70
|
+
const named = signals.remotes.join(", ");
|
|
71
|
+
offered.add("push");
|
|
72
|
+
rationale.push = `a git remote exists (${named})`;
|
|
73
|
+
offered.add("open-pr");
|
|
74
|
+
rationale["open-pr"] = `a git remote exists (${named})`;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
const publishableManifest = signals.manifests.find((m) => PUBLISHABLE_MANIFESTS.has(m));
|
|
78
|
+
if (signals.package_publishable) {
|
|
79
|
+
offered.add("publish");
|
|
80
|
+
rationale.publish = "package.json carries a name and a version and is not private";
|
|
81
|
+
}
|
|
82
|
+
else if (publishableManifest) {
|
|
83
|
+
offered.add("publish");
|
|
84
|
+
rationale.publish = `${publishableManifest} is present`;
|
|
85
|
+
}
|
|
86
|
+
else if (signals.release_scripts.length > 0) {
|
|
87
|
+
offered.add("publish");
|
|
88
|
+
rationale.publish = `release scripts exist (${signals.release_scripts.join(", ")})`;
|
|
89
|
+
}
|
|
90
|
+
const candidates = CLOSING_ACTIONS.filter((action) => offered.has(action));
|
|
91
|
+
return { candidates, rationale };
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Detect the project facts for `root`. Deterministic and degrade-to-empty:
|
|
95
|
+
* a missing manifest, an unreadable one, or an absent git binary narrows the
|
|
96
|
+
* facts; it never throws.
|
|
97
|
+
*/
|
|
98
|
+
export async function detectProjectFacts(root) {
|
|
99
|
+
const manifests = MANIFESTS.map((m) => m.file).filter((file) => existsSync(join(root, file)));
|
|
100
|
+
const pkg = readPackageJson(root);
|
|
101
|
+
const packagePrivate = pkg === null ? null : pkg.private === true;
|
|
102
|
+
const packagePublishable = pkg !== null &&
|
|
103
|
+
packagePrivate === false &&
|
|
104
|
+
typeof pkg.name === "string" &&
|
|
105
|
+
pkg.name.length > 0 &&
|
|
106
|
+
typeof pkg.version === "string" &&
|
|
107
|
+
pkg.version.length > 0;
|
|
108
|
+
const gitRepo = await isGitRepo(root);
|
|
109
|
+
const remotes = gitRepo ? await gitRemotes(root) : [];
|
|
110
|
+
const signals = {
|
|
111
|
+
git_repo: gitRepo,
|
|
112
|
+
remotes,
|
|
113
|
+
manifests,
|
|
114
|
+
package_private: packagePrivate,
|
|
115
|
+
package_publishable: packagePublishable,
|
|
116
|
+
release_scripts: releaseScripts(pkg),
|
|
117
|
+
ci_config: CI_CONFIG.filter((entry) => existsSync(join(root, entry))),
|
|
118
|
+
};
|
|
119
|
+
const { candidates, rationale } = candidateClosingActions(signals);
|
|
120
|
+
return {
|
|
121
|
+
project_type: projectTypeFrom(manifests),
|
|
122
|
+
candidate_closing_actions: candidates,
|
|
123
|
+
candidate_rationale: rationale,
|
|
124
|
+
signals,
|
|
125
|
+
commands: discoverProjectCommands(root),
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* The facts a run has when nothing was detected — an unknown type and only
|
|
130
|
+
* the two actions appropriate for every repository. Planning falls back to
|
|
131
|
+
* this when no persisted facts exist; it never detects on its own, because
|
|
132
|
+
* detection spawns git and planning is backend-independent by contract.
|
|
133
|
+
*/
|
|
134
|
+
export function neutralProjectFacts() {
|
|
135
|
+
const signals = {
|
|
136
|
+
git_repo: false,
|
|
137
|
+
remotes: [],
|
|
138
|
+
manifests: [],
|
|
139
|
+
package_private: null,
|
|
140
|
+
package_publishable: false,
|
|
141
|
+
release_scripts: [],
|
|
142
|
+
ci_config: [],
|
|
143
|
+
};
|
|
144
|
+
const { candidates, rationale } = candidateClosingActions(signals);
|
|
145
|
+
return {
|
|
146
|
+
project_type: "unknown",
|
|
147
|
+
candidate_closing_actions: candidates,
|
|
148
|
+
candidate_rationale: rationale,
|
|
149
|
+
signals,
|
|
150
|
+
commands: {},
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=projectFacts.js.map
|