agentskeptic 0.1.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/LICENSE +21 -0
- package/README.md +342 -0
- package/dist/actionableFailure.d.ts +53 -0
- package/dist/actionableFailure.d.ts.map +1 -0
- package/dist/actionableFailure.js +424 -0
- package/dist/actionableFailure.js.map +1 -0
- package/dist/actionableFailure.partitionExhaustive.test.d.ts +2 -0
- package/dist/actionableFailure.partitionExhaustive.test.d.ts.map +1 -0
- package/dist/actionableFailure.partitionExhaustive.test.js +20 -0
- package/dist/actionableFailure.partitionExhaustive.test.js.map +1 -0
- package/dist/actionableFailure.remediationExhaustive.test.d.ts +2 -0
- package/dist/actionableFailure.remediationExhaustive.test.d.ts.map +1 -0
- package/dist/actionableFailure.remediationExhaustive.test.js +297 -0
- package/dist/actionableFailure.remediationExhaustive.test.js.map +1 -0
- package/dist/actionableFailure.test.d.ts +2 -0
- package/dist/actionableFailure.test.d.ts.map +1 -0
- package/dist/actionableFailure.test.js +211 -0
- package/dist/actionableFailure.test.js.map +1 -0
- package/dist/agentRunBundle.d.ts +24 -0
- package/dist/agentRunBundle.d.ts.map +1 -0
- package/dist/agentRunBundle.js +114 -0
- package/dist/agentRunBundle.js.map +1 -0
- package/dist/agentRunBundle.rollback.test.d.ts +2 -0
- package/dist/agentRunBundle.rollback.test.d.ts.map +1 -0
- package/dist/agentRunBundle.rollback.test.js +65 -0
- package/dist/agentRunBundle.rollback.test.js.map +1 -0
- package/dist/agentRunBundle.test.d.ts +2 -0
- package/dist/agentRunBundle.test.d.ts.map +1 -0
- package/dist/agentRunBundle.test.js +126 -0
- package/dist/agentRunBundle.test.js.map +1 -0
- package/dist/agentRunRecord.d.ts +82 -0
- package/dist/agentRunRecord.d.ts.map +1 -0
- package/dist/agentRunRecord.js +51 -0
- package/dist/agentRunRecord.js.map +1 -0
- package/dist/agentRunRecord.test.d.ts +2 -0
- package/dist/agentRunRecord.test.d.ts.map +1 -0
- package/dist/agentRunRecord.test.js +49 -0
- package/dist/agentRunRecord.test.js.map +1 -0
- package/dist/aggregate.d.ts +3 -0
- package/dist/aggregate.d.ts.map +1 -0
- package/dist/aggregate.js +36 -0
- package/dist/aggregate.js.map +1 -0
- package/dist/assurance/assurancePathArgs.d.ts +10 -0
- package/dist/assurance/assurancePathArgs.d.ts.map +1 -0
- package/dist/assurance/assurancePathArgs.js +54 -0
- package/dist/assurance/assurancePathArgs.js.map +1 -0
- package/dist/assurance/checkStale.d.ts +14 -0
- package/dist/assurance/checkStale.d.ts.map +1 -0
- package/dist/assurance/checkStale.js +48 -0
- package/dist/assurance/checkStale.js.map +1 -0
- package/dist/assurance/findRepoRoot.d.ts +6 -0
- package/dist/assurance/findRepoRoot.d.ts.map +1 -0
- package/dist/assurance/findRepoRoot.js +27 -0
- package/dist/assurance/findRepoRoot.js.map +1 -0
- package/dist/assurance/runAssurance.d.ts +24 -0
- package/dist/assurance/runAssurance.d.ts.map +1 -0
- package/dist/assurance/runAssurance.js +105 -0
- package/dist/assurance/runAssurance.js.map +1 -0
- package/dist/bundleSignatureCodes.d.ts +13 -0
- package/dist/bundleSignatureCodes.d.ts.map +1 -0
- package/dist/bundleSignatureCodes.js +12 -0
- package/dist/bundleSignatureCodes.js.map +1 -0
- package/dist/canonicalParams.d.ts +3 -0
- package/dist/canonicalParams.d.ts.map +1 -0
- package/dist/canonicalParams.js +16 -0
- package/dist/canonicalParams.js.map +1 -0
- package/dist/ciLock.d.ts +52 -0
- package/dist/ciLock.d.ts.map +1 -0
- package/dist/ciLock.js +117 -0
- package/dist/ciLock.js.map +1 -0
- package/dist/ciLockWorkflow.d.ts +4 -0
- package/dist/ciLockWorkflow.d.ts.map +1 -0
- package/dist/ciLockWorkflow.js +278 -0
- package/dist/ciLockWorkflow.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.failureExplanationInvariant.test.d.ts +2 -0
- package/dist/cli.failureExplanationInvariant.test.d.ts.map +1 -0
- package/dist/cli.failureExplanationInvariant.test.js +40 -0
- package/dist/cli.failureExplanationInvariant.test.js.map +1 -0
- package/dist/cli.js +998 -0
- package/dist/cli.js.map +1 -0
- package/dist/cliArgv.d.ts +40 -0
- package/dist/cliArgv.d.ts.map +1 -0
- package/dist/cliArgv.js +149 -0
- package/dist/cliArgv.js.map +1 -0
- package/dist/cliOperationalCodes.d.ts +65 -0
- package/dist/cliOperationalCodes.d.ts.map +1 -0
- package/dist/cliOperationalCodes.js +64 -0
- package/dist/cliOperationalCodes.js.map +1 -0
- package/dist/commercial/licensePreflight.d.ts +7 -0
- package/dist/commercial/licensePreflight.d.ts.map +1 -0
- package/dist/commercial/licensePreflight.js +95 -0
- package/dist/commercial/licensePreflight.js.map +1 -0
- package/dist/commercial/licensePreflight.test.d.ts +2 -0
- package/dist/commercial/licensePreflight.test.d.ts.map +1 -0
- package/dist/commercial/licensePreflight.test.js +123 -0
- package/dist/commercial/licensePreflight.test.js.map +1 -0
- package/dist/compare.acceptance.test.d.ts +2 -0
- package/dist/compare.acceptance.test.d.ts.map +1 -0
- package/dist/compare.acceptance.test.js +80 -0
- package/dist/compare.acceptance.test.js.map +1 -0
- package/dist/correctnessDefinition.d.ts +23 -0
- package/dist/correctnessDefinition.d.ts.map +1 -0
- package/dist/correctnessDefinition.docParity.test.d.ts +2 -0
- package/dist/correctnessDefinition.docParity.test.d.ts.map +1 -0
- package/dist/correctnessDefinition.docParity.test.js +22 -0
- package/dist/correctnessDefinition.docParity.test.js.map +1 -0
- package/dist/correctnessDefinition.js +283 -0
- package/dist/correctnessDefinition.js.map +1 -0
- package/dist/correctnessDefinitionTemplates.d.ts +70 -0
- package/dist/correctnessDefinitionTemplates.d.ts.map +1 -0
- package/dist/correctnessDefinitionTemplates.js +121 -0
- package/dist/correctnessDefinitionTemplates.js.map +1 -0
- package/dist/debug-ui/app.css +188 -0
- package/dist/debug-ui/app.js +245 -0
- package/dist/debug-ui/index.html +79 -0
- package/dist/debugCorpus.d.ts +68 -0
- package/dist/debugCorpus.d.ts.map +1 -0
- package/dist/debugCorpus.js +544 -0
- package/dist/debugCorpus.js.map +1 -0
- package/dist/debugCorpus.test.d.ts +2 -0
- package/dist/debugCorpus.test.d.ts.map +1 -0
- package/dist/debugCorpus.test.js +159 -0
- package/dist/debugCorpus.test.js.map +1 -0
- package/dist/debugFocus.d.ts +16 -0
- package/dist/debugFocus.d.ts.map +1 -0
- package/dist/debugFocus.js +51 -0
- package/dist/debugFocus.js.map +1 -0
- package/dist/debugFocus.test.d.ts +2 -0
- package/dist/debugFocus.test.d.ts.map +1 -0
- package/dist/debugFocus.test.js +43 -0
- package/dist/debugFocus.test.js.map +1 -0
- package/dist/debugPanels.d.ts +13 -0
- package/dist/debugPanels.d.ts.map +1 -0
- package/dist/debugPanels.js +113 -0
- package/dist/debugPanels.js.map +1 -0
- package/dist/debugPanels.test.d.ts +2 -0
- package/dist/debugPanels.test.d.ts.map +1 -0
- package/dist/debugPanels.test.js +204 -0
- package/dist/debugPanels.test.js.map +1 -0
- package/dist/debugPatterns.d.ts +47 -0
- package/dist/debugPatterns.d.ts.map +1 -0
- package/dist/debugPatterns.js +113 -0
- package/dist/debugPatterns.js.map +1 -0
- package/dist/debugPatterns.test.d.ts +2 -0
- package/dist/debugPatterns.test.d.ts.map +1 -0
- package/dist/debugPatterns.test.js +48 -0
- package/dist/debugPatterns.test.js.map +1 -0
- package/dist/debugRunFilters.d.ts +31 -0
- package/dist/debugRunFilters.d.ts.map +1 -0
- package/dist/debugRunFilters.js +118 -0
- package/dist/debugRunFilters.js.map +1 -0
- package/dist/debugRunFilters.test.d.ts +2 -0
- package/dist/debugRunFilters.test.d.ts.map +1 -0
- package/dist/debugRunFilters.test.js +78 -0
- package/dist/debugRunFilters.test.js.map +1 -0
- package/dist/debugRunIndex.d.ts +27 -0
- package/dist/debugRunIndex.d.ts.map +1 -0
- package/dist/debugRunIndex.js +58 -0
- package/dist/debugRunIndex.js.map +1 -0
- package/dist/debugServer.d.ts +19 -0
- package/dist/debugServer.d.ts.map +1 -0
- package/dist/debugServer.js +315 -0
- package/dist/debugServer.js.map +1 -0
- package/dist/debugServer.test.d.ts +2 -0
- package/dist/debugServer.test.d.ts.map +1 -0
- package/dist/debugServer.test.js +207 -0
- package/dist/debugServer.test.js.map +1 -0
- package/dist/discovery-payload-v1.json +75 -0
- package/dist/distributionFooter.d.ts +3 -0
- package/dist/distributionFooter.d.ts.map +1 -0
- package/dist/distributionFooter.js +3 -0
- package/dist/distributionFooter.js.map +1 -0
- package/dist/documentationCopyConsistency.test.d.ts +2 -0
- package/dist/documentationCopyConsistency.test.d.ts.map +1 -0
- package/dist/documentationCopyConsistency.test.js +94 -0
- package/dist/documentationCopyConsistency.test.js.map +1 -0
- package/dist/enforceCli.d.ts +4 -0
- package/dist/enforceCli.d.ts.map +1 -0
- package/dist/enforceCli.js +93 -0
- package/dist/enforceCli.js.map +1 -0
- package/dist/eventSequenceIntegrity.d.ts +7 -0
- package/dist/eventSequenceIntegrity.d.ts.map +1 -0
- package/dist/eventSequenceIntegrity.js +47 -0
- package/dist/eventSequenceIntegrity.js.map +1 -0
- package/dist/eventSequenceIntegrity.test.d.ts +2 -0
- package/dist/eventSequenceIntegrity.test.d.ts.map +1 -0
- package/dist/eventSequenceIntegrity.test.js +65 -0
- package/dist/eventSequenceIntegrity.test.js.map +1 -0
- package/dist/executionPathFindings.d.ts +15 -0
- package/dist/executionPathFindings.d.ts.map +1 -0
- package/dist/executionPathFindings.js +299 -0
- package/dist/executionPathFindings.js.map +1 -0
- package/dist/executionPathFindings.requirements.test.d.ts +2 -0
- package/dist/executionPathFindings.requirements.test.d.ts.map +1 -0
- package/dist/executionPathFindings.requirements.test.js +332 -0
- package/dist/executionPathFindings.requirements.test.js.map +1 -0
- package/dist/executionTrace.d.ts +13 -0
- package/dist/executionTrace.d.ts.map +1 -0
- package/dist/executionTrace.js +272 -0
- package/dist/executionTrace.js.map +1 -0
- package/dist/executionTrace.test.d.ts +2 -0
- package/dist/executionTrace.test.d.ts.map +1 -0
- package/dist/executionTrace.test.js +200 -0
- package/dist/executionTrace.test.js.map +1 -0
- package/dist/failureAnalysis.d.ts +8 -0
- package/dist/failureAnalysis.d.ts.map +1 -0
- package/dist/failureAnalysis.js +337 -0
- package/dist/failureAnalysis.js.map +1 -0
- package/dist/failureAnalysis.test.d.ts +2 -0
- package/dist/failureAnalysis.test.d.ts.map +1 -0
- package/dist/failureAnalysis.test.js +196 -0
- package/dist/failureAnalysis.test.js.map +1 -0
- package/dist/failureCatalog.d.ts +26 -0
- package/dist/failureCatalog.d.ts.map +1 -0
- package/dist/failureCatalog.js +51 -0
- package/dist/failureCatalog.js.map +1 -0
- package/dist/failureCatalog.test.d.ts +2 -0
- package/dist/failureCatalog.test.d.ts.map +1 -0
- package/dist/failureCatalog.test.js +25 -0
- package/dist/failureCatalog.test.js.map +1 -0
- package/dist/failureExplanation.d.ts +52 -0
- package/dist/failureExplanation.d.ts.map +1 -0
- package/dist/failureExplanation.failureAnalysisMock.test.d.ts +2 -0
- package/dist/failureExplanation.failureAnalysisMock.test.d.ts.map +1 -0
- package/dist/failureExplanation.failureAnalysisMock.test.js +200 -0
- package/dist/failureExplanation.failureAnalysisMock.test.js.map +1 -0
- package/dist/failureExplanation.golden.test.d.ts +2 -0
- package/dist/failureExplanation.golden.test.d.ts.map +1 -0
- package/dist/failureExplanation.golden.test.js +530 -0
- package/dist/failureExplanation.golden.test.js.map +1 -0
- package/dist/failureExplanation.js +389 -0
- package/dist/failureExplanation.js.map +1 -0
- package/dist/failureExplanationDocumentationParity.test.d.ts +2 -0
- package/dist/failureExplanationDocumentationParity.test.d.ts.map +1 -0
- package/dist/failureExplanationDocumentationParity.test.js +56 -0
- package/dist/failureExplanationDocumentationParity.test.js.map +1 -0
- package/dist/failureOriginCatalog.d.ts +30 -0
- package/dist/failureOriginCatalog.d.ts.map +1 -0
- package/dist/failureOriginCatalog.js +106 -0
- package/dist/failureOriginCatalog.js.map +1 -0
- package/dist/failureOriginCatalog.test.d.ts +2 -0
- package/dist/failureOriginCatalog.test.d.ts.map +1 -0
- package/dist/failureOriginCatalog.test.js +17 -0
- package/dist/failureOriginCatalog.test.js.map +1 -0
- package/dist/failureOriginSchemaEnum.test.d.ts +2 -0
- package/dist/failureOriginSchemaEnum.test.d.ts.map +1 -0
- package/dist/failureOriginSchemaEnum.test.js +21 -0
- package/dist/failureOriginSchemaEnum.test.js.map +1 -0
- package/dist/failureOriginSchemaParity.test.d.ts +2 -0
- package/dist/failureOriginSchemaParity.test.d.ts.map +1 -0
- package/dist/failureOriginSchemaParity.test.js +33 -0
- package/dist/failureOriginSchemaParity.test.js.map +1 -0
- package/dist/failureOriginTypes.d.ts +4 -0
- package/dist/failureOriginTypes.d.ts.map +1 -0
- package/dist/failureOriginTypes.generated.d.ts +4 -0
- package/dist/failureOriginTypes.generated.d.ts.map +1 -0
- package/dist/failureOriginTypes.generated.js +10 -0
- package/dist/failureOriginTypes.generated.js.map +1 -0
- package/dist/failureOriginTypes.js +3 -0
- package/dist/failureOriginTypes.js.map +1 -0
- package/dist/generated/commercialBuildFlags.d.ts +4 -0
- package/dist/generated/commercialBuildFlags.d.ts.map +1 -0
- package/dist/generated/commercialBuildFlags.js +5 -0
- package/dist/generated/commercialBuildFlags.js.map +1 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +34 -0
- package/dist/index.js.map +1 -0
- package/dist/jsonPointer.d.ts +3 -0
- package/dist/jsonPointer.d.ts.map +1 -0
- package/dist/jsonPointer.js +28 -0
- package/dist/jsonPointer.js.map +1 -0
- package/dist/jsonStableStringify.d.ts +3 -0
- package/dist/jsonStableStringify.d.ts.map +1 -0
- package/dist/jsonStableStringify.js +3 -0
- package/dist/jsonStableStringify.js.map +1 -0
- package/dist/loadEvents.d.ts +3 -0
- package/dist/loadEvents.d.ts.map +1 -0
- package/dist/loadEvents.eventFileAggregateCounts.test.d.ts +2 -0
- package/dist/loadEvents.eventFileAggregateCounts.test.d.ts.map +1 -0
- package/dist/loadEvents.eventFileAggregateCounts.test.js +18 -0
- package/dist/loadEvents.eventFileAggregateCounts.test.js.map +1 -0
- package/dist/loadEvents.js +85 -0
- package/dist/loadEvents.js.map +1 -0
- package/dist/multiEffectRollup.d.ts +43 -0
- package/dist/multiEffectRollup.d.ts.map +1 -0
- package/dist/multiEffectRollup.js +164 -0
- package/dist/multiEffectRollup.js.map +1 -0
- package/dist/multiEffectRollup.test.d.ts +2 -0
- package/dist/multiEffectRollup.test.d.ts.map +1 -0
- package/dist/multiEffectRollup.test.js +128 -0
- package/dist/multiEffectRollup.test.js.map +1 -0
- package/dist/noStepsMessage.d.ts +7 -0
- package/dist/noStepsMessage.d.ts.map +1 -0
- package/dist/noStepsMessage.js +12 -0
- package/dist/noStepsMessage.js.map +1 -0
- package/dist/noStepsMessage.test.d.ts +2 -0
- package/dist/noStepsMessage.test.d.ts.map +1 -0
- package/dist/noStepsMessage.test.js +15 -0
- package/dist/noStepsMessage.test.js.map +1 -0
- package/dist/operationalDisposition.d.ts +498 -0
- package/dist/operationalDisposition.d.ts.map +1 -0
- package/dist/operationalDisposition.js +490 -0
- package/dist/operationalDisposition.js.map +1 -0
- package/dist/operationalDispositionDerivation.test.d.ts +2 -0
- package/dist/operationalDispositionDerivation.test.d.ts.map +1 -0
- package/dist/operationalDispositionDerivation.test.js +19 -0
- package/dist/operationalDispositionDerivation.test.js.map +1 -0
- package/dist/operationalFailureDiagnosis.d.ts +3 -0
- package/dist/operationalFailureDiagnosis.d.ts.map +1 -0
- package/dist/operationalFailureDiagnosis.js +25 -0
- package/dist/operationalFailureDiagnosis.js.map +1 -0
- package/dist/pipeline.d.ts +38 -0
- package/dist/pipeline.d.ts.map +1 -0
- package/dist/pipeline.js +457 -0
- package/dist/pipeline.js.map +1 -0
- package/dist/planLogicalSteps.d.ts +16 -0
- package/dist/planLogicalSteps.d.ts.map +1 -0
- package/dist/planLogicalSteps.js +51 -0
- package/dist/planLogicalSteps.js.map +1 -0
- package/dist/planLogicalSteps.test.d.ts +2 -0
- package/dist/planLogicalSteps.test.d.ts.map +1 -0
- package/dist/planLogicalSteps.test.js +88 -0
- package/dist/planLogicalSteps.test.js.map +1 -0
- package/dist/planTransition.d.ts +88 -0
- package/dist/planTransition.d.ts.map +1 -0
- package/dist/planTransition.js +490 -0
- package/dist/planTransition.js.map +1 -0
- package/dist/planTransition.test.d.ts +2 -0
- package/dist/planTransition.test.d.ts.map +1 -0
- package/dist/planTransition.test.js +956 -0
- package/dist/planTransition.test.js.map +1 -0
- package/dist/planTransitionConstants.d.ts +3 -0
- package/dist/planTransitionConstants.d.ts.map +1 -0
- package/dist/planTransitionConstants.js +3 -0
- package/dist/planTransitionConstants.js.map +1 -0
- package/dist/planTransitionPathHarvest.d.ts +24 -0
- package/dist/planTransitionPathHarvest.d.ts.map +1 -0
- package/dist/planTransitionPathHarvest.js +273 -0
- package/dist/planTransitionPathHarvest.js.map +1 -0
- package/dist/planTransitionPathHarvest.test.d.ts +2 -0
- package/dist/planTransitionPathHarvest.test.d.ts.map +1 -0
- package/dist/planTransitionPathHarvest.test.js +232 -0
- package/dist/planTransitionPathHarvest.test.js.map +1 -0
- package/dist/prepareWorkflowEvents.d.ts +6 -0
- package/dist/prepareWorkflowEvents.d.ts.map +1 -0
- package/dist/prepareWorkflowEvents.js +8 -0
- package/dist/prepareWorkflowEvents.js.map +1 -0
- package/dist/publicDistribution.generated.d.ts +3 -0
- package/dist/publicDistribution.generated.d.ts.map +1 -0
- package/dist/publicDistribution.generated.js +9 -0
- package/dist/publicDistribution.generated.js.map +1 -0
- package/dist/quickVerify/atomicWrite.d.ts +6 -0
- package/dist/quickVerify/atomicWrite.d.ts.map +1 -0
- package/dist/quickVerify/atomicWrite.js +33 -0
- package/dist/quickVerify/atomicWrite.js.map +1 -0
- package/dist/quickVerify/buildQuickContractEventsNdjson.d.ts +14 -0
- package/dist/quickVerify/buildQuickContractEventsNdjson.d.ts.map +1 -0
- package/dist/quickVerify/buildQuickContractEventsNdjson.js +28 -0
- package/dist/quickVerify/buildQuickContractEventsNdjson.js.map +1 -0
- package/dist/quickVerify/canonicalJson.d.ts +5 -0
- package/dist/quickVerify/canonicalJson.d.ts.map +1 -0
- package/dist/quickVerify/canonicalJson.js +23 -0
- package/dist/quickVerify/canonicalJson.js.map +1 -0
- package/dist/quickVerify/decomposeUnits.d.ts +15 -0
- package/dist/quickVerify/decomposeUnits.d.ts.map +1 -0
- package/dist/quickVerify/decomposeUnits.js +50 -0
- package/dist/quickVerify/decomposeUnits.js.map +1 -0
- package/dist/quickVerify/exportTool.d.ts +6 -0
- package/dist/quickVerify/exportTool.d.ts.map +1 -0
- package/dist/quickVerify/exportTool.js +20 -0
- package/dist/quickVerify/exportTool.js.map +1 -0
- package/dist/quickVerify/forbiddenMutatingSql.d.ts +4 -0
- package/dist/quickVerify/forbiddenMutatingSql.d.ts.map +1 -0
- package/dist/quickVerify/forbiddenMutatingSql.js +6 -0
- package/dist/quickVerify/forbiddenMutatingSql.js.map +1 -0
- package/dist/quickVerify/formatQuickVerifyHumanReport.d.ts +17 -0
- package/dist/quickVerify/formatQuickVerifyHumanReport.d.ts.map +1 -0
- package/dist/quickVerify/formatQuickVerifyHumanReport.js +65 -0
- package/dist/quickVerify/formatQuickVerifyHumanReport.js.map +1 -0
- package/dist/quickVerify/formatQuickVerifyHumanReport.test.d.ts +2 -0
- package/dist/quickVerify/formatQuickVerifyHumanReport.test.d.ts.map +1 -0
- package/dist/quickVerify/formatQuickVerifyHumanReport.test.js +41 -0
- package/dist/quickVerify/formatQuickVerifyHumanReport.test.js.map +1 -0
- package/dist/quickVerify/ingest.d.ts +34 -0
- package/dist/quickVerify/ingest.d.ts.map +1 -0
- package/dist/quickVerify/ingest.js +327 -0
- package/dist/quickVerify/ingest.js.map +1 -0
- package/dist/quickVerify/noMutatingSqlInSources.test.d.ts +2 -0
- package/dist/quickVerify/noMutatingSqlInSources.test.d.ts.map +1 -0
- package/dist/quickVerify/noMutatingSqlInSources.test.js +34 -0
- package/dist/quickVerify/noMutatingSqlInSources.test.js.map +1 -0
- package/dist/quickVerify/postgresCatalog.d.ts +19 -0
- package/dist/quickVerify/postgresCatalog.d.ts.map +1 -0
- package/dist/quickVerify/postgresCatalog.js +107 -0
- package/dist/quickVerify/postgresCatalog.js.map +1 -0
- package/dist/quickVerify/quickVerifyHumanCopy.d.ts +9 -0
- package/dist/quickVerify/quickVerifyHumanCopy.d.ts.map +1 -0
- package/dist/quickVerify/quickVerifyHumanCopy.js +24 -0
- package/dist/quickVerify/quickVerifyHumanCopy.js.map +1 -0
- package/dist/quickVerify/quickVerifyProductTruth.d.ts +16 -0
- package/dist/quickVerify/quickVerifyProductTruth.d.ts.map +1 -0
- package/dist/quickVerify/quickVerifyProductTruth.js +19 -0
- package/dist/quickVerify/quickVerifyProductTruth.js.map +1 -0
- package/dist/quickVerify/quickVerifyScope.d.ts +12 -0
- package/dist/quickVerify/quickVerifyScope.d.ts.map +1 -0
- package/dist/quickVerify/quickVerifyScope.js +16 -0
- package/dist/quickVerify/quickVerifyScope.js.map +1 -0
- package/dist/quickVerify/relationalPlan.d.ts +10 -0
- package/dist/quickVerify/relationalPlan.d.ts.map +1 -0
- package/dist/quickVerify/relationalPlan.js +37 -0
- package/dist/quickVerify/relationalPlan.js.map +1 -0
- package/dist/quickVerify/rowUnit.d.ts +15 -0
- package/dist/quickVerify/rowUnit.d.ts.map +1 -0
- package/dist/quickVerify/rowUnit.js +132 -0
- package/dist/quickVerify/rowUnit.js.map +1 -0
- package/dist/quickVerify/runQuickVerify.d.ts +65 -0
- package/dist/quickVerify/runQuickVerify.d.ts.map +1 -0
- package/dist/quickVerify/runQuickVerify.js +320 -0
- package/dist/quickVerify/runQuickVerify.js.map +1 -0
- package/dist/quickVerify/schemaCatalogTypes.d.ts +22 -0
- package/dist/quickVerify/schemaCatalogTypes.d.ts.map +1 -0
- package/dist/quickVerify/schemaCatalogTypes.js +2 -0
- package/dist/quickVerify/schemaCatalogTypes.js.map +1 -0
- package/dist/quickVerify/sqliteCatalog.d.ts +13 -0
- package/dist/quickVerify/sqliteCatalog.d.ts.map +1 -0
- package/dist/quickVerify/sqliteCatalog.js +48 -0
- package/dist/quickVerify/sqliteCatalog.js.map +1 -0
- package/dist/quickVerify/tableScoring.d.ts +24 -0
- package/dist/quickVerify/tableScoring.d.ts.map +1 -0
- package/dist/quickVerify/tableScoring.js +156 -0
- package/dist/quickVerify/tableScoring.js.map +1 -0
- package/dist/quickVerify/thresholds.d.ts +11 -0
- package/dist/quickVerify/thresholds.d.ts.map +1 -0
- package/dist/quickVerify/thresholds.js +11 -0
- package/dist/quickVerify/thresholds.js.map +1 -0
- package/dist/quickVerify/verifyExecution.d.ts +15 -0
- package/dist/quickVerify/verifyExecution.d.ts.map +1 -0
- package/dist/quickVerify/verifyExecution.js +153 -0
- package/dist/quickVerify/verifyExecution.js.map +1 -0
- package/dist/reconciler.d.ts +25 -0
- package/dist/reconciler.d.ts.map +1 -0
- package/dist/reconciler.js +266 -0
- package/dist/reconciler.js.map +1 -0
- package/dist/reconciliationPresentation.d.ts +83 -0
- package/dist/reconciliationPresentation.d.ts.map +1 -0
- package/dist/reconciliationPresentation.js +195 -0
- package/dist/reconciliationPresentation.js.map +1 -0
- package/dist/registryValidation.d.ts +48 -0
- package/dist/registryValidation.d.ts.map +1 -0
- package/dist/registryValidation.js +254 -0
- package/dist/registryValidation.js.map +1 -0
- package/dist/registryValidation.test.d.ts +2 -0
- package/dist/registryValidation.test.d.ts.map +1 -0
- package/dist/registryValidation.test.js +186 -0
- package/dist/registryValidation.test.js.map +1 -0
- package/dist/relationalInvariant.d.ts +28 -0
- package/dist/relationalInvariant.d.ts.map +1 -0
- package/dist/relationalInvariant.existsSql.test.d.ts +2 -0
- package/dist/relationalInvariant.existsSql.test.d.ts.map +1 -0
- package/dist/relationalInvariant.existsSql.test.js +12 -0
- package/dist/relationalInvariant.existsSql.test.js.map +1 -0
- package/dist/relationalInvariant.js +347 -0
- package/dist/relationalInvariant.js.map +1 -0
- package/dist/relationalInvariant.test.d.ts +2 -0
- package/dist/relationalInvariant.test.d.ts.map +1 -0
- package/dist/relationalInvariant.test.js +32 -0
- package/dist/relationalInvariant.test.js.map +1 -0
- package/dist/remediationConsumptionGuard.test.d.ts +2 -0
- package/dist/remediationConsumptionGuard.test.d.ts.map +1 -0
- package/dist/remediationConsumptionGuard.test.js +80 -0
- package/dist/remediationConsumptionGuard.test.js.map +1 -0
- package/dist/remediationWireSurfaceGuard.test.d.ts +2 -0
- package/dist/remediationWireSurfaceGuard.test.d.ts.map +1 -0
- package/dist/remediationWireSurfaceGuard.test.js +39 -0
- package/dist/remediationWireSurfaceGuard.test.js.map +1 -0
- package/dist/resolveExpectation.d.ts +28 -0
- package/dist/resolveExpectation.d.ts.map +1 -0
- package/dist/resolveExpectation.js +654 -0
- package/dist/resolveExpectation.js.map +1 -0
- package/dist/resolveExpectation.test.d.ts +2 -0
- package/dist/resolveExpectation.test.d.ts.map +1 -0
- package/dist/resolveExpectation.test.js +434 -0
- package/dist/resolveExpectation.test.js.map +1 -0
- package/dist/resolveFailureCodes.d.ts +2 -0
- package/dist/resolveFailureCodes.d.ts.map +1 -0
- package/dist/resolveFailureCodes.js +7 -0
- package/dist/resolveFailureCodes.js.map +1 -0
- package/dist/runComparison.d.ts +168 -0
- package/dist/runComparison.d.ts.map +1 -0
- package/dist/runComparison.js +675 -0
- package/dist/runComparison.js.map +1 -0
- package/dist/runComparison.test.d.ts +2 -0
- package/dist/runComparison.test.d.ts.map +1 -0
- package/dist/runComparison.test.js +507 -0
- package/dist/runComparison.test.js.map +1 -0
- package/dist/runLevelDriftMessages.d.ts +4 -0
- package/dist/runLevelDriftMessages.d.ts.map +1 -0
- package/dist/runLevelDriftMessages.js +4 -0
- package/dist/runLevelDriftMessages.js.map +1 -0
- package/dist/schema-validation.test.d.ts +2 -0
- package/dist/schema-validation.test.d.ts.map +1 -0
- package/dist/schema-validation.test.js +531 -0
- package/dist/schema-validation.test.js.map +1 -0
- package/dist/schemaLoad.d.ts +5 -0
- package/dist/schemaLoad.d.ts.map +1 -0
- package/dist/schemaLoad.js +152 -0
- package/dist/schemaLoad.js.map +1 -0
- package/dist/shareReport/postPublicVerificationReport.d.ts +26 -0
- package/dist/shareReport/postPublicVerificationReport.d.ts.map +1 -0
- package/dist/shareReport/postPublicVerificationReport.js +38 -0
- package/dist/shareReport/postPublicVerificationReport.js.map +1 -0
- package/dist/slice6.compare.ac.test.d.ts +2 -0
- package/dist/slice6.compare.ac.test.d.ts.map +1 -0
- package/dist/slice6.compare.ac.test.js +81 -0
- package/dist/slice6.compare.ac.test.js.map +1 -0
- package/dist/sqlConnector.d.ts +15 -0
- package/dist/sqlConnector.d.ts.map +1 -0
- package/dist/sqlConnector.js +36 -0
- package/dist/sqlConnector.js.map +1 -0
- package/dist/sqlReadBackend.d.ts +19 -0
- package/dist/sqlReadBackend.d.ts.map +1 -0
- package/dist/sqlReadBackend.js +67 -0
- package/dist/sqlReadBackend.js.map +1 -0
- package/dist/standardVerifyWorkflowCli.d.ts +24 -0
- package/dist/standardVerifyWorkflowCli.d.ts.map +1 -0
- package/dist/standardVerifyWorkflowCli.js +95 -0
- package/dist/standardVerifyWorkflowCli.js.map +1 -0
- package/dist/taxonomyAuthority.test.d.ts +2 -0
- package/dist/taxonomyAuthority.test.d.ts.map +1 -0
- package/dist/taxonomyAuthority.test.js +44 -0
- package/dist/taxonomyAuthority.test.js.map +1 -0
- package/dist/toolsRegistryLoad.d.ts +7 -0
- package/dist/toolsRegistryLoad.d.ts.map +1 -0
- package/dist/toolsRegistryLoad.js +32 -0
- package/dist/toolsRegistryLoad.js.map +1 -0
- package/dist/truthLayerError.d.ts +8 -0
- package/dist/truthLayerError.d.ts.map +1 -0
- package/dist/truthLayerError.js +9 -0
- package/dist/truthLayerError.js.map +1 -0
- package/dist/types.d.ts +706 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +24 -0
- package/dist/types.js.map +1 -0
- package/dist/valueVerification.d.ts +12 -0
- package/dist/valueVerification.d.ts.map +1 -0
- package/dist/valueVerification.js +112 -0
- package/dist/valueVerification.js.map +1 -0
- package/dist/valueVerification.test.d.ts +2 -0
- package/dist/valueVerification.test.d.ts.map +1 -0
- package/dist/valueVerification.test.js +112 -0
- package/dist/valueVerification.test.js.map +1 -0
- package/dist/verificationAgainstSystemState.requirements.test.d.ts +2 -0
- package/dist/verificationAgainstSystemState.requirements.test.d.ts.map +1 -0
- package/dist/verificationAgainstSystemState.requirements.test.js +326 -0
- package/dist/verificationAgainstSystemState.requirements.test.js.map +1 -0
- package/dist/verificationDiagnostics.d.ts +21 -0
- package/dist/verificationDiagnostics.d.ts.map +1 -0
- package/dist/verificationDiagnostics.js +141 -0
- package/dist/verificationDiagnostics.js.map +1 -0
- package/dist/verificationDiagnostics.test.d.ts +2 -0
- package/dist/verificationDiagnostics.test.d.ts.map +1 -0
- package/dist/verificationDiagnostics.test.js +228 -0
- package/dist/verificationDiagnostics.test.js.map +1 -0
- package/dist/verificationPolicy.d.ts +33 -0
- package/dist/verificationPolicy.d.ts.map +1 -0
- package/dist/verificationPolicy.js +495 -0
- package/dist/verificationPolicy.js.map +1 -0
- package/dist/verificationPolicy.test.d.ts +2 -0
- package/dist/verificationPolicy.test.d.ts.map +1 -0
- package/dist/verificationPolicy.test.js +252 -0
- package/dist/verificationPolicy.test.js.map +1 -0
- package/dist/verificationRunContext.d.ts +10 -0
- package/dist/verificationRunContext.d.ts.map +1 -0
- package/dist/verificationRunContext.js +111 -0
- package/dist/verificationRunContext.js.map +1 -0
- package/dist/verificationUserPhrases.d.ts +22 -0
- package/dist/verificationUserPhrases.d.ts.map +1 -0
- package/dist/verificationUserPhrases.js +99 -0
- package/dist/verificationUserPhrases.js.map +1 -0
- package/dist/verificationUserPhrases.test.d.ts +2 -0
- package/dist/verificationUserPhrases.test.d.ts.map +1 -0
- package/dist/verificationUserPhrases.test.js +47 -0
- package/dist/verificationUserPhrases.test.js.map +1 -0
- package/dist/verifyRunBundleSignature.d.ts +14 -0
- package/dist/verifyRunBundleSignature.d.ts.map +1 -0
- package/dist/verifyRunBundleSignature.js +139 -0
- package/dist/verifyRunBundleSignature.js.map +1 -0
- package/dist/verifyRunBundleSignature.test.d.ts +2 -0
- package/dist/verifyRunBundleSignature.test.d.ts.map +1 -0
- package/dist/verifyRunBundleSignature.test.js +169 -0
- package/dist/verifyRunBundleSignature.test.js.map +1 -0
- package/dist/wireReasonCodes.d.ts +57 -0
- package/dist/wireReasonCodes.d.ts.map +1 -0
- package/dist/wireReasonCodes.js +57 -0
- package/dist/wireReasonCodes.js.map +1 -0
- package/dist/wireReasonEmittersGuard.test.d.ts +2 -0
- package/dist/wireReasonEmittersGuard.test.d.ts.map +1 -0
- package/dist/wireReasonEmittersGuard.test.js +36 -0
- package/dist/wireReasonEmittersGuard.test.js.map +1 -0
- package/dist/withWorkflowVerification.persistBundle.test.d.ts +2 -0
- package/dist/withWorkflowVerification.persistBundle.test.d.ts.map +1 -0
- package/dist/withWorkflowVerification.persistBundle.test.js +104 -0
- package/dist/withWorkflowVerification.persistBundle.test.js.map +1 -0
- package/dist/workflowResultNormalize.d.ts +9 -0
- package/dist/workflowResultNormalize.d.ts.map +1 -0
- package/dist/workflowResultNormalize.js +40 -0
- package/dist/workflowResultNormalize.js.map +1 -0
- package/dist/workflowResultSignature.d.ts +8 -0
- package/dist/workflowResultSignature.d.ts.map +1 -0
- package/dist/workflowResultSignature.js +44 -0
- package/dist/workflowResultSignature.js.map +1 -0
- package/dist/workflowRunLevelConsistency.d.ts +5 -0
- package/dist/workflowRunLevelConsistency.d.ts.map +1 -0
- package/dist/workflowRunLevelConsistency.js +30 -0
- package/dist/workflowRunLevelConsistency.js.map +1 -0
- package/dist/workflowTruthReport.d.ts +24 -0
- package/dist/workflowTruthReport.d.ts.map +1 -0
- package/dist/workflowTruthReport.js +395 -0
- package/dist/workflowTruthReport.js.map +1 -0
- package/dist/workflowTruthReport.semantics.test.d.ts +2 -0
- package/dist/workflowTruthReport.semantics.test.d.ts.map +1 -0
- package/dist/workflowTruthReport.semantics.test.js +182 -0
- package/dist/workflowTruthReport.semantics.test.js.map +1 -0
- package/dist/workflowVerdictSurface.test.d.ts +2 -0
- package/dist/workflowVerdictSurface.test.d.ts.map +1 -0
- package/dist/workflowVerdictSurface.test.js +68 -0
- package/dist/workflowVerdictSurface.test.js.map +1 -0
- package/dist/writeRunBundleCli.d.ts +9 -0
- package/dist/writeRunBundleCli.d.ts.map +1 -0
- package/dist/writeRunBundleCli.js +28 -0
- package/dist/writeRunBundleCli.js.map +1 -0
- package/package.json +115 -0
- package/schemas/agent-run-record-v1.schema.json +51 -0
- package/schemas/agent-run-record-v2.schema.json +61 -0
- package/schemas/assurance-manifest-v1.schema.json +28 -0
- package/schemas/assurance-run-report-v1.schema.json +28 -0
- package/schemas/ci-lock-v1.schema.json +163 -0
- package/schemas/cli-error-envelope.schema.json +48 -0
- package/schemas/event.schema.json +111 -0
- package/schemas/execution-trace-view.schema.json +122 -0
- package/schemas/openapi-commercial-v1.in.yaml +215 -0
- package/schemas/openapi-commercial-v1.yaml +215 -0
- package/schemas/plan-validation-core.schema.json +95 -0
- package/schemas/public-verification-report-v1.schema.json +51 -0
- package/schemas/quick-verify-report.schema.json +251 -0
- package/schemas/registry-validation-result.schema.json +99 -0
- package/schemas/run-comparison-report.schema.json +513 -0
- package/schemas/tools-registry-export.schema.json +9 -0
- package/schemas/tools-registry.schema.json +284 -0
- package/schemas/workflow-engine-result.schema.json +591 -0
- package/schemas/workflow-result-compare-input.schema.json +15 -0
- package/schemas/workflow-result-signature.schema.json +20 -0
- package/schemas/workflow-result-v9.schema.json +85 -0
- package/schemas/workflow-result.schema.json +80 -0
- package/schemas/workflow-truth-report.schema.json +761 -0
- package/scripts/discovery-acquisition.lib.cjs +195 -0
- package/scripts/discovery-payload.lib.cjs +346 -0
- package/scripts/render-discovery-ci.mjs +103 -0
|
@@ -0,0 +1,956 @@
|
|
|
1
|
+
import { execFileSync } from "node:child_process";
|
|
2
|
+
import { writeFileSync, mkdirSync, readFileSync, mkdtempSync } from "node:fs";
|
|
3
|
+
import { tmpdir } from "node:os";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
import { describe, expect, it } from "vitest";
|
|
7
|
+
import { CLI_OPERATIONAL_CODES } from "./cliOperationalCodes.js";
|
|
8
|
+
import { loadSchemaValidator } from "./schemaLoad.js";
|
|
9
|
+
import { TruthLayerError } from "./truthLayerError.js";
|
|
10
|
+
import { buildPlanTransitionEventsNdjson, buildPlanTransitionWorkflowResult, evaluatePlanRules, loadPlanTransitionRules, parseGitNameStatusZ, parseGitVersionTriple, PLAN_RULE_CODES, preflightAllPlanPatterns, preflightPatternString, } from "./planTransition.js";
|
|
11
|
+
import { PLAN_TRANSITION_WORKFLOW_ID } from "./planTransitionConstants.js";
|
|
12
|
+
const root = path.join(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
13
|
+
/** Mirrors `DERIVED_CITATION_REQUIRE_ROW_KINDS` in planTransition.ts (derived citation obligations). */
|
|
14
|
+
const DERIVED_REQUIRE_MATCH_ROW_KINDS = [
|
|
15
|
+
"add",
|
|
16
|
+
"modify",
|
|
17
|
+
"delete",
|
|
18
|
+
"rename",
|
|
19
|
+
"copy",
|
|
20
|
+
"type_change",
|
|
21
|
+
];
|
|
22
|
+
function gitConfig(repo) {
|
|
23
|
+
execFileSync("git", ["-C", repo, "config", "user.email", "pt@test.local"], { windowsHide: true });
|
|
24
|
+
execFileSync("git", ["-C", repo, "config", "user.name", "PlanTransition Test"], { windowsHide: true });
|
|
25
|
+
}
|
|
26
|
+
describe("planTransition", () => {
|
|
27
|
+
it("parseGitVersionTriple parses semver prefix", () => {
|
|
28
|
+
expect(parseGitVersionTriple("git version 2.43.0.windows.1")).toEqual([2, 43, 0]);
|
|
29
|
+
expect(parseGitVersionTriple("git version 2.30.0")).toEqual([2, 30, 0]);
|
|
30
|
+
expect(parseGitVersionTriple("git version 2.29.0")).toEqual([2, 29, 0]);
|
|
31
|
+
expect(parseGitVersionTriple("bogus")).toBeNull();
|
|
32
|
+
});
|
|
33
|
+
it("parseGitNameStatusZ parses golden NUL buffers per status class", () => {
|
|
34
|
+
const cases = [
|
|
35
|
+
{
|
|
36
|
+
buf: Buffer.from("A\0f.txt\0", "utf8"),
|
|
37
|
+
want: [{ rowKind: "add", paths: ["f.txt"] }],
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
buf: Buffer.from("M\0m.txt\0", "utf8"),
|
|
41
|
+
want: [{ rowKind: "modify", paths: ["m.txt"] }],
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
buf: Buffer.from("D\0d.txt\0", "utf8"),
|
|
45
|
+
want: [{ rowKind: "delete", paths: ["d.txt"] }],
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
buf: Buffer.from("T\0t.txt\0", "utf8"),
|
|
49
|
+
want: [{ rowKind: "type_change", paths: ["t.txt"] }],
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
buf: Buffer.from("U\0u.txt\0", "utf8"),
|
|
53
|
+
want: [{ rowKind: "unmerged", paths: ["u.txt"] }],
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
buf: Buffer.from("R100\0old/path.txt\0new/path.txt\0", "utf8"),
|
|
57
|
+
want: [{ rowKind: "rename", paths: ["old/path.txt", "new/path.txt"] }],
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
buf: Buffer.from("C095\0src/original.ts\0src/copy.ts\0", "utf8"),
|
|
61
|
+
want: [{ rowKind: "copy", paths: ["src/original.ts", "src/copy.ts"] }],
|
|
62
|
+
},
|
|
63
|
+
];
|
|
64
|
+
for (const { buf, want } of cases) {
|
|
65
|
+
expect(parseGitNameStatusZ(buf)).toEqual(want);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
it("parseGitNameStatusZ rejects unknown status", () => {
|
|
69
|
+
expect(() => parseGitNameStatusZ(Buffer.from("X\0a\0", "utf8"))).toThrow(TruthLayerError);
|
|
70
|
+
});
|
|
71
|
+
it("requireRenameFromTo includeCopy true vs false on injected copy row", () => {
|
|
72
|
+
const rows = [{ rowKind: "copy", paths: ["src/original.ts", "src/copy.ts"] }];
|
|
73
|
+
const okRule = {
|
|
74
|
+
id: "r1",
|
|
75
|
+
kind: "requireRenameFromTo",
|
|
76
|
+
fromPattern: "src/original.ts",
|
|
77
|
+
toPattern: "src/copy.ts",
|
|
78
|
+
includeCopy: true,
|
|
79
|
+
};
|
|
80
|
+
const badRule = { ...okRule, includeCopy: false };
|
|
81
|
+
expect(evaluatePlanRules(rows, [okRule])[0]?.status).toBe("verified");
|
|
82
|
+
expect(evaluatePlanRules(rows, [badRule])[0]?.status).toBe("inconsistent");
|
|
83
|
+
expect(evaluatePlanRules(rows, [badRule])[0]?.reasons[0]?.code).toBe(PLAN_RULE_CODES.RENAME_MISMATCH);
|
|
84
|
+
});
|
|
85
|
+
it("matchingRowsMustHaveRowKinds fails on add when modify required", () => {
|
|
86
|
+
const rows = [{ rowKind: "add", paths: ["x.txt"] }];
|
|
87
|
+
const rule = {
|
|
88
|
+
id: "r1",
|
|
89
|
+
kind: "matchingRowsMustHaveRowKinds",
|
|
90
|
+
pattern: "x.txt",
|
|
91
|
+
rowKinds: ["modify"],
|
|
92
|
+
};
|
|
93
|
+
const step = evaluatePlanRules(rows, [rule])[0];
|
|
94
|
+
expect(step.status).toBe("inconsistent");
|
|
95
|
+
expect(step.reasons[0]?.code).toBe(PLAN_RULE_CODES.ROW_KIND_MISMATCH);
|
|
96
|
+
});
|
|
97
|
+
it("evaluatePlanRules: foreign path fails when every changed path must match pattern set", () => {
|
|
98
|
+
const rows = [
|
|
99
|
+
{ rowKind: "modify", paths: ["good.txt"] },
|
|
100
|
+
{ rowKind: "add", paths: ["evil.txt"] },
|
|
101
|
+
];
|
|
102
|
+
const rule = {
|
|
103
|
+
id: "r1",
|
|
104
|
+
kind: "allChangedPathsMustMatchAllowlist",
|
|
105
|
+
allowPatterns: ["good.txt"],
|
|
106
|
+
};
|
|
107
|
+
expect(evaluatePlanRules(rows, [rule])[0]?.status).toBe("inconsistent");
|
|
108
|
+
expect(evaluatePlanRules(rows, [rule])[0]?.reasons[0]?.code).toBe(PLAN_RULE_CODES.ALLOWLIST_VIOLATION);
|
|
109
|
+
});
|
|
110
|
+
it("every-path-must-match-patterns rule fails rename when destination outside pattern set", () => {
|
|
111
|
+
const rows = [{ rowKind: "rename", paths: ["allowed/old.txt", "outside/new.txt"] }];
|
|
112
|
+
const rule = {
|
|
113
|
+
id: "r1",
|
|
114
|
+
kind: "allChangedPathsMustMatchAllowlist",
|
|
115
|
+
allowPatterns: ["allowed/**"],
|
|
116
|
+
};
|
|
117
|
+
expect(evaluatePlanRules(rows, [rule])[0]?.status).toBe("inconsistent");
|
|
118
|
+
});
|
|
119
|
+
it("preflightPatternString rejects ..", () => {
|
|
120
|
+
expect(() => preflightPatternString("../x", "p")).toThrow(TruthLayerError);
|
|
121
|
+
});
|
|
122
|
+
it("preflightAllPlanPatterns labels allowPatterns by rule index and array index", () => {
|
|
123
|
+
const rules = [
|
|
124
|
+
{ id: "r0", kind: "forbidMatchingRows", pattern: "safe" },
|
|
125
|
+
{
|
|
126
|
+
id: "r1",
|
|
127
|
+
kind: "allChangedPathsMustMatchAllowlist",
|
|
128
|
+
allowPatterns: ["ok/**", "../evil"],
|
|
129
|
+
},
|
|
130
|
+
];
|
|
131
|
+
try {
|
|
132
|
+
preflightAllPlanPatterns(rules);
|
|
133
|
+
expect.fail("expected TruthLayerError");
|
|
134
|
+
}
|
|
135
|
+
catch (e) {
|
|
136
|
+
expect(e).toBeInstanceOf(TruthLayerError);
|
|
137
|
+
expect(e.message).toContain("rules[1].allowPatterns[1]");
|
|
138
|
+
expect(e.message).not.toContain("rules[2]");
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
it("plan-validation-core schema rejects requireRenameFromTo without includeCopy", () => {
|
|
142
|
+
const v = loadSchemaValidator("plan-validation-core");
|
|
143
|
+
const bad = {
|
|
144
|
+
schemaVersion: 1,
|
|
145
|
+
rules: [
|
|
146
|
+
{
|
|
147
|
+
id: "x",
|
|
148
|
+
kind: "requireRenameFromTo",
|
|
149
|
+
fromPattern: "a",
|
|
150
|
+
toPattern: "b",
|
|
151
|
+
},
|
|
152
|
+
],
|
|
153
|
+
};
|
|
154
|
+
expect(v(bad)).toBe(false);
|
|
155
|
+
});
|
|
156
|
+
it("buildPlanTransitionEventsNdjson validates against event schema", () => {
|
|
157
|
+
const v = loadSchemaValidator("event");
|
|
158
|
+
const buf = buildPlanTransitionEventsNdjson({
|
|
159
|
+
workflowId: PLAN_TRANSITION_WORKFLOW_ID,
|
|
160
|
+
beforeRef: "main~1",
|
|
161
|
+
afterRef: "main",
|
|
162
|
+
beforeCommitSha: "a".repeat(40),
|
|
163
|
+
afterCommitSha: "b".repeat(40),
|
|
164
|
+
planResolvedPath: path.join(root, "Plan.md"),
|
|
165
|
+
planSha256: "c".repeat(64),
|
|
166
|
+
transitionRulesSource: "front_matter",
|
|
167
|
+
});
|
|
168
|
+
const line = JSON.parse(buf.toString("utf8").trim());
|
|
169
|
+
expect(v(line)).toBe(true);
|
|
170
|
+
expect(line.params.transitionRulesSource).toBe("front_matter");
|
|
171
|
+
expect(line.params.beforeCommitSha).toHaveLength(40);
|
|
172
|
+
expect(line.params.planSha256).toHaveLength(64);
|
|
173
|
+
});
|
|
174
|
+
it("buildPlanTransitionEventsNdjson accepts transitionRulesSource derived_citations", () => {
|
|
175
|
+
const v = loadSchemaValidator("event");
|
|
176
|
+
const buf = buildPlanTransitionEventsNdjson({
|
|
177
|
+
workflowId: PLAN_TRANSITION_WORKFLOW_ID,
|
|
178
|
+
beforeRef: "main~1",
|
|
179
|
+
afterRef: "main",
|
|
180
|
+
beforeCommitSha: "a".repeat(40),
|
|
181
|
+
afterCommitSha: "b".repeat(40),
|
|
182
|
+
planResolvedPath: path.join(root, "Plan.md"),
|
|
183
|
+
planSha256: "c".repeat(64),
|
|
184
|
+
transitionRulesSource: "derived_citations",
|
|
185
|
+
});
|
|
186
|
+
const line = JSON.parse(buf.toString("utf8").trim());
|
|
187
|
+
expect(v(line)).toBe(true);
|
|
188
|
+
expect(line.params.transitionRulesSource).toBe("derived_citations");
|
|
189
|
+
});
|
|
190
|
+
it("git subprocess: modify file with space in name matches parser", () => {
|
|
191
|
+
const dir = mkdtempSync(path.join(tmpdir(), "plan-tr-"));
|
|
192
|
+
execFileSync("git", ["init", dir], { windowsHide: true });
|
|
193
|
+
gitConfig(dir);
|
|
194
|
+
writeFileSync(path.join(dir, "a b.txt"), "1");
|
|
195
|
+
execFileSync("git", ["-C", dir, "add", "."], { windowsHide: true });
|
|
196
|
+
execFileSync("git", ["-C", dir, "commit", "-m", "c1"], { windowsHide: true });
|
|
197
|
+
writeFileSync(path.join(dir, "a b.txt"), "2");
|
|
198
|
+
execFileSync("git", ["-C", dir, "add", "."], { windowsHide: true });
|
|
199
|
+
execFileSync("git", ["-C", dir, "commit", "-m", "c2"], { windowsHide: true });
|
|
200
|
+
const h1 = execFileSync("git", ["-C", dir, "rev-parse", "HEAD~1"], { encoding: "utf8", windowsHide: true }).trim();
|
|
201
|
+
const h2 = execFileSync("git", ["-C", dir, "rev-parse", "HEAD"], { encoding: "utf8", windowsHide: true }).trim();
|
|
202
|
+
const buf = execFileSync("git", ["-C", dir, "diff", "--no-ext-diff", "-z", "--name-status", `${h1}..${h2}`], {
|
|
203
|
+
windowsHide: true,
|
|
204
|
+
});
|
|
205
|
+
const rows = parseGitNameStatusZ(buf);
|
|
206
|
+
expect(rows.length).toBe(1);
|
|
207
|
+
expect(rows[0]?.rowKind).toBe("modify");
|
|
208
|
+
expect(rows[0]?.paths[0]).toBe("a b.txt");
|
|
209
|
+
}, 20_000);
|
|
210
|
+
it("integration: buildPlanTransitionWorkflowResult with Plan.md and two commits", () => {
|
|
211
|
+
const dir = mkdtempSync(path.join(tmpdir(), "plan-tr-int-"));
|
|
212
|
+
execFileSync("git", ["init", dir], { windowsHide: true });
|
|
213
|
+
gitConfig(dir);
|
|
214
|
+
mkdirSync(path.join(dir, "src"), { recursive: true });
|
|
215
|
+
writeFileSync(path.join(dir, "src", "x.txt"), "a");
|
|
216
|
+
execFileSync("git", ["-C", dir, "add", "."], { windowsHide: true });
|
|
217
|
+
execFileSync("git", ["-C", dir, "commit", "-m", "base"], { windowsHide: true });
|
|
218
|
+
const before = execFileSync("git", ["-C", dir, "rev-parse", "HEAD"], { encoding: "utf8", windowsHide: true }).trim();
|
|
219
|
+
writeFileSync(path.join(dir, "src", "x.txt"), "b");
|
|
220
|
+
execFileSync("git", ["-C", dir, "add", "."], { windowsHide: true });
|
|
221
|
+
execFileSync("git", ["-C", dir, "commit", "-m", "chg"], { windowsHide: true });
|
|
222
|
+
const after = execFileSync("git", ["-C", dir, "rev-parse", "HEAD"], { encoding: "utf8", windowsHide: true }).trim();
|
|
223
|
+
const planBody = `---
|
|
224
|
+
planValidation:
|
|
225
|
+
schemaVersion: 1
|
|
226
|
+
rules:
|
|
227
|
+
- id: must_modify
|
|
228
|
+
kind: matchingRowsMustHaveRowKinds
|
|
229
|
+
pattern: "src/x.txt"
|
|
230
|
+
rowKinds: [modify]
|
|
231
|
+
---
|
|
232
|
+
# Plan
|
|
233
|
+
`;
|
|
234
|
+
const planPath = path.join(dir, "Plan.md");
|
|
235
|
+
writeFileSync(planPath, planBody, "utf8");
|
|
236
|
+
const { workflowResult: result } = buildPlanTransitionWorkflowResult({
|
|
237
|
+
repoRoot: dir,
|
|
238
|
+
beforeRef: before,
|
|
239
|
+
afterRef: after,
|
|
240
|
+
planPath,
|
|
241
|
+
workflowId: PLAN_TRANSITION_WORKFLOW_ID,
|
|
242
|
+
});
|
|
243
|
+
expect(result.workflowId).toBe(PLAN_TRANSITION_WORKFLOW_ID);
|
|
244
|
+
expect(result.status).toBe("complete");
|
|
245
|
+
expect(result.steps.length).toBe(1);
|
|
246
|
+
expect(result.steps[0]?.status).toBe("verified");
|
|
247
|
+
}, 20_000);
|
|
248
|
+
it("picomatch ** matches nested path for every-path-must-match-patterns rule", () => {
|
|
249
|
+
const rows = [{ rowKind: "modify", paths: ["src/nested/foo.ts"] }];
|
|
250
|
+
const rule = {
|
|
251
|
+
id: "r1",
|
|
252
|
+
kind: "allChangedPathsMustMatchAllowlist",
|
|
253
|
+
allowPatterns: ["src/**/*.ts"],
|
|
254
|
+
};
|
|
255
|
+
expect(evaluatePlanRules(rows, [rule])[0]?.status).toBe("verified");
|
|
256
|
+
});
|
|
257
|
+
it("evaluatePlanRules: requireMatchingRow is inconsistent when diff rows are empty", () => {
|
|
258
|
+
const rows = [];
|
|
259
|
+
const rule = {
|
|
260
|
+
id: "r1",
|
|
261
|
+
kind: "requireMatchingRow",
|
|
262
|
+
pattern: "any/path.ts",
|
|
263
|
+
rowKinds: ["modify"],
|
|
264
|
+
};
|
|
265
|
+
const step = evaluatePlanRules(rows, [rule])[0];
|
|
266
|
+
expect(step.status).toBe("inconsistent");
|
|
267
|
+
expect(step.reasons[0]?.code).toBe(PLAN_RULE_CODES.REQUIRED_ROW_MISSING);
|
|
268
|
+
});
|
|
269
|
+
it("integration: git mv satisfies requireRenameFromTo", () => {
|
|
270
|
+
const dir = mkdtempSync(path.join(tmpdir(), "plan-tr-mv-"));
|
|
271
|
+
execFileSync("git", ["init", dir], { windowsHide: true });
|
|
272
|
+
gitConfig(dir);
|
|
273
|
+
writeFileSync(path.join(dir, "old.txt"), "a");
|
|
274
|
+
execFileSync("git", ["-C", dir, "add", "."], { windowsHide: true });
|
|
275
|
+
execFileSync("git", ["-C", dir, "commit", "-m", "base"], { windowsHide: true });
|
|
276
|
+
const before = execFileSync("git", ["-C", dir, "rev-parse", "HEAD"], { encoding: "utf8", windowsHide: true }).trim();
|
|
277
|
+
execFileSync("git", ["-C", dir, "mv", "old.txt", "new.txt"], { windowsHide: true });
|
|
278
|
+
execFileSync("git", ["-C", dir, "commit", "-m", "mv"], { windowsHide: true });
|
|
279
|
+
const after = execFileSync("git", ["-C", dir, "rev-parse", "HEAD"], { encoding: "utf8", windowsHide: true }).trim();
|
|
280
|
+
const planBody = `---
|
|
281
|
+
planValidation:
|
|
282
|
+
schemaVersion: 1
|
|
283
|
+
rules:
|
|
284
|
+
- id: renamed
|
|
285
|
+
kind: requireRenameFromTo
|
|
286
|
+
fromPattern: "old.txt"
|
|
287
|
+
toPattern: "new.txt"
|
|
288
|
+
includeCopy: false
|
|
289
|
+
---
|
|
290
|
+
`;
|
|
291
|
+
const planPath = path.join(dir, "Plan.md");
|
|
292
|
+
writeFileSync(planPath, planBody, "utf8");
|
|
293
|
+
const { workflowResult: result } = buildPlanTransitionWorkflowResult({
|
|
294
|
+
repoRoot: dir,
|
|
295
|
+
beforeRef: before,
|
|
296
|
+
afterRef: after,
|
|
297
|
+
planPath,
|
|
298
|
+
});
|
|
299
|
+
expect(result.status).toBe("complete");
|
|
300
|
+
expect(result.steps[0]?.status).toBe("verified");
|
|
301
|
+
}, 20_000);
|
|
302
|
+
it("integration: add file fails when rule requires modify only", () => {
|
|
303
|
+
const dir = mkdtempSync(path.join(tmpdir(), "plan-tr-add-"));
|
|
304
|
+
execFileSync("git", ["init", dir], { windowsHide: true });
|
|
305
|
+
gitConfig(dir);
|
|
306
|
+
writeFileSync(path.join(dir, "x.txt"), "a");
|
|
307
|
+
execFileSync("git", ["-C", dir, "add", "."], { windowsHide: true });
|
|
308
|
+
execFileSync("git", ["-C", dir, "commit", "-m", "base"], { windowsHide: true });
|
|
309
|
+
const before = execFileSync("git", ["-C", dir, "rev-parse", "HEAD"], { encoding: "utf8", windowsHide: true }).trim();
|
|
310
|
+
writeFileSync(path.join(dir, "y.txt"), "new");
|
|
311
|
+
execFileSync("git", ["-C", dir, "add", "."], { windowsHide: true });
|
|
312
|
+
execFileSync("git", ["-C", dir, "commit", "-m", "add"], { windowsHide: true });
|
|
313
|
+
const after = execFileSync("git", ["-C", dir, "rev-parse", "HEAD"], { encoding: "utf8", windowsHide: true }).trim();
|
|
314
|
+
const planBody = `---
|
|
315
|
+
planValidation:
|
|
316
|
+
schemaVersion: 1
|
|
317
|
+
rules:
|
|
318
|
+
- id: y_must_be_modify
|
|
319
|
+
kind: matchingRowsMustHaveRowKinds
|
|
320
|
+
pattern: "y.txt"
|
|
321
|
+
rowKinds: [modify]
|
|
322
|
+
---
|
|
323
|
+
`;
|
|
324
|
+
const planPath = path.join(dir, "Plan.md");
|
|
325
|
+
writeFileSync(planPath, planBody, "utf8");
|
|
326
|
+
const { workflowResult: result } = buildPlanTransitionWorkflowResult({
|
|
327
|
+
repoRoot: dir,
|
|
328
|
+
beforeRef: before,
|
|
329
|
+
afterRef: after,
|
|
330
|
+
planPath,
|
|
331
|
+
});
|
|
332
|
+
expect(result.status).toBe("inconsistent");
|
|
333
|
+
expect(result.steps[0]?.status).toBe("inconsistent");
|
|
334
|
+
}, 20_000);
|
|
335
|
+
it("integration: body-section yaml rules match FM equivalent for modify", () => {
|
|
336
|
+
const dir = mkdtempSync(path.join(tmpdir(), "plan-tr-body-"));
|
|
337
|
+
execFileSync("git", ["init", dir], { windowsHide: true });
|
|
338
|
+
gitConfig(dir);
|
|
339
|
+
mkdirSync(path.join(dir, "src"), { recursive: true });
|
|
340
|
+
writeFileSync(path.join(dir, "src", "x.txt"), "a");
|
|
341
|
+
execFileSync("git", ["-C", dir, "add", "."], { windowsHide: true });
|
|
342
|
+
execFileSync("git", ["-C", dir, "commit", "-m", "base"], { windowsHide: true });
|
|
343
|
+
const before = execFileSync("git", ["-C", dir, "rev-parse", "HEAD"], { encoding: "utf8", windowsHide: true }).trim();
|
|
344
|
+
writeFileSync(path.join(dir, "src", "x.txt"), "b");
|
|
345
|
+
execFileSync("git", ["-C", dir, "add", "."], { windowsHide: true });
|
|
346
|
+
execFileSync("git", ["-C", dir, "commit", "-m", "chg"], { windowsHide: true });
|
|
347
|
+
const after = execFileSync("git", ["-C", dir, "rev-parse", "HEAD"], { encoding: "utf8", windowsHide: true }).trim();
|
|
348
|
+
const planBody = `---
|
|
349
|
+
name: Cursor plan
|
|
350
|
+
overview: test
|
|
351
|
+
---
|
|
352
|
+
## Repository transition validation
|
|
353
|
+
\`\`\`yaml
|
|
354
|
+
schemaVersion: 1
|
|
355
|
+
rules:
|
|
356
|
+
- id: must_modify
|
|
357
|
+
kind: matchingRowsMustHaveRowKinds
|
|
358
|
+
pattern: "src/x.txt"
|
|
359
|
+
rowKinds: [modify]
|
|
360
|
+
\`\`\`
|
|
361
|
+
`;
|
|
362
|
+
const planPath = path.join(dir, "Plan.md");
|
|
363
|
+
writeFileSync(planPath, planBody, "utf8");
|
|
364
|
+
const { workflowResult: result, transitionRulesProvenance } = buildPlanTransitionWorkflowResult({
|
|
365
|
+
repoRoot: dir,
|
|
366
|
+
beforeRef: before,
|
|
367
|
+
afterRef: after,
|
|
368
|
+
planPath,
|
|
369
|
+
workflowId: PLAN_TRANSITION_WORKFLOW_ID,
|
|
370
|
+
});
|
|
371
|
+
expect(transitionRulesProvenance).toBe("body_section");
|
|
372
|
+
expect(result.status).toBe("complete");
|
|
373
|
+
expect(result.steps[0]?.status).toBe("verified");
|
|
374
|
+
}, 20_000);
|
|
375
|
+
it("integration: FM planValidation wins over duplicate body headings and yaml", () => {
|
|
376
|
+
const dir = mkdtempSync(path.join(tmpdir(), "plan-tr-fmwin-"));
|
|
377
|
+
execFileSync("git", ["init", dir], { windowsHide: true });
|
|
378
|
+
gitConfig(dir);
|
|
379
|
+
mkdirSync(path.join(dir, "src"), { recursive: true });
|
|
380
|
+
writeFileSync(path.join(dir, "src", "x.txt"), "a");
|
|
381
|
+
execFileSync("git", ["-C", dir, "add", "."], { windowsHide: true });
|
|
382
|
+
execFileSync("git", ["-C", dir, "commit", "-m", "base"], { windowsHide: true });
|
|
383
|
+
const before = execFileSync("git", ["-C", dir, "rev-parse", "HEAD"], { encoding: "utf8", windowsHide: true }).trim();
|
|
384
|
+
writeFileSync(path.join(dir, "src", "x.txt"), "b");
|
|
385
|
+
execFileSync("git", ["-C", dir, "add", "."], { windowsHide: true });
|
|
386
|
+
execFileSync("git", ["-C", dir, "commit", "-m", "chg"], { windowsHide: true });
|
|
387
|
+
const after = execFileSync("git", ["-C", dir, "rev-parse", "HEAD"], { encoding: "utf8", windowsHide: true }).trim();
|
|
388
|
+
const planBody = `---
|
|
389
|
+
planValidation:
|
|
390
|
+
schemaVersion: 1
|
|
391
|
+
rules:
|
|
392
|
+
- id: must_modify
|
|
393
|
+
kind: matchingRowsMustHaveRowKinds
|
|
394
|
+
pattern: "src/x.txt"
|
|
395
|
+
rowKinds: [modify]
|
|
396
|
+
---
|
|
397
|
+
## Repository transition validation
|
|
398
|
+
## Repository transition validation
|
|
399
|
+
\`\`\`yaml
|
|
400
|
+
schemaVersion: 1
|
|
401
|
+
rules:
|
|
402
|
+
- id: forbid_all
|
|
403
|
+
kind: forbidMatchingRows
|
|
404
|
+
pattern: "**/*"
|
|
405
|
+
\`\`\`
|
|
406
|
+
`;
|
|
407
|
+
const planPath = path.join(dir, "Plan.md");
|
|
408
|
+
writeFileSync(planPath, planBody, "utf8");
|
|
409
|
+
const { workflowResult: result, transitionRulesProvenance } = buildPlanTransitionWorkflowResult({
|
|
410
|
+
repoRoot: dir,
|
|
411
|
+
beforeRef: before,
|
|
412
|
+
afterRef: after,
|
|
413
|
+
planPath,
|
|
414
|
+
});
|
|
415
|
+
expect(transitionRulesProvenance).toBe("front_matter");
|
|
416
|
+
expect(result.status).toBe("complete");
|
|
417
|
+
expect(result.steps[0]?.status).toBe("verified");
|
|
418
|
+
}, 20_000);
|
|
419
|
+
it("integration: FM rules used when body would forbid all paths", () => {
|
|
420
|
+
const dir = mkdtempSync(path.join(tmpdir(), "plan-tr-prec-"));
|
|
421
|
+
execFileSync("git", ["init", dir], { windowsHide: true });
|
|
422
|
+
gitConfig(dir);
|
|
423
|
+
mkdirSync(path.join(dir, "src"), { recursive: true });
|
|
424
|
+
writeFileSync(path.join(dir, "src", "x.txt"), "a");
|
|
425
|
+
execFileSync("git", ["-C", dir, "add", "."], { windowsHide: true });
|
|
426
|
+
execFileSync("git", ["-C", dir, "commit", "-m", "base"], { windowsHide: true });
|
|
427
|
+
const before = execFileSync("git", ["-C", dir, "rev-parse", "HEAD"], { encoding: "utf8", windowsHide: true }).trim();
|
|
428
|
+
writeFileSync(path.join(dir, "src", "x.txt"), "b");
|
|
429
|
+
execFileSync("git", ["-C", dir, "add", "."], { windowsHide: true });
|
|
430
|
+
execFileSync("git", ["-C", dir, "commit", "-m", "chg"], { windowsHide: true });
|
|
431
|
+
const after = execFileSync("git", ["-C", dir, "rev-parse", "HEAD"], { encoding: "utf8", windowsHide: true }).trim();
|
|
432
|
+
const planBody = `---
|
|
433
|
+
planValidation:
|
|
434
|
+
schemaVersion: 1
|
|
435
|
+
rules:
|
|
436
|
+
- id: must_modify
|
|
437
|
+
kind: matchingRowsMustHaveRowKinds
|
|
438
|
+
pattern: "src/x.txt"
|
|
439
|
+
rowKinds: [modify]
|
|
440
|
+
---
|
|
441
|
+
## Repository transition validation
|
|
442
|
+
\`\`\`yaml
|
|
443
|
+
schemaVersion: 1
|
|
444
|
+
rules:
|
|
445
|
+
- id: forbid_all
|
|
446
|
+
kind: forbidMatchingRows
|
|
447
|
+
pattern: "**/*"
|
|
448
|
+
\`\`\`
|
|
449
|
+
`;
|
|
450
|
+
const planPath = path.join(dir, "Plan.md");
|
|
451
|
+
writeFileSync(planPath, planBody, "utf8");
|
|
452
|
+
const { workflowResult: result } = buildPlanTransitionWorkflowResult({
|
|
453
|
+
repoRoot: dir,
|
|
454
|
+
beforeRef: before,
|
|
455
|
+
afterRef: after,
|
|
456
|
+
planPath,
|
|
457
|
+
});
|
|
458
|
+
expect(result.status).toBe("complete");
|
|
459
|
+
expect(result.steps[0]?.status).toBe("verified");
|
|
460
|
+
}, 20_000);
|
|
461
|
+
it("integration: derived_citations passes when diff only touches cited file", () => {
|
|
462
|
+
const dir = mkdtempSync(path.join(tmpdir(), "plan-tr-derived-pass-"));
|
|
463
|
+
execFileSync("git", ["init", dir], { windowsHide: true });
|
|
464
|
+
gitConfig(dir);
|
|
465
|
+
mkdirSync(path.join(dir, "src"), { recursive: true });
|
|
466
|
+
writeFileSync(path.join(dir, "src", "tracked.ts"), "a");
|
|
467
|
+
execFileSync("git", ["-C", dir, "add", "."], { windowsHide: true });
|
|
468
|
+
execFileSync("git", ["-C", dir, "commit", "-m", "base"], { windowsHide: true });
|
|
469
|
+
const before = execFileSync("git", ["-C", dir, "rev-parse", "HEAD"], { encoding: "utf8", windowsHide: true }).trim();
|
|
470
|
+
writeFileSync(path.join(dir, "src", "tracked.ts"), "b");
|
|
471
|
+
execFileSync("git", ["-C", dir, "add", "."], { windowsHide: true });
|
|
472
|
+
execFileSync("git", ["-C", dir, "commit", "-m", "chg"], { windowsHide: true });
|
|
473
|
+
const after = execFileSync("git", ["-C", dir, "rev-parse", "HEAD"], { encoding: "utf8", windowsHide: true }).trim();
|
|
474
|
+
const planBody = `---
|
|
475
|
+
name: Plan
|
|
476
|
+
overview: x
|
|
477
|
+
isProject: false
|
|
478
|
+
---
|
|
479
|
+
|
|
480
|
+
# Work
|
|
481
|
+
|
|
482
|
+
## Implementation
|
|
483
|
+
|
|
484
|
+
Change \`src/tracked.ts\`.
|
|
485
|
+
`;
|
|
486
|
+
const planPath = path.join(dir, "Plan.md");
|
|
487
|
+
writeFileSync(planPath, planBody, "utf8");
|
|
488
|
+
const { workflowResult: result, transitionRulesProvenance } = buildPlanTransitionWorkflowResult({
|
|
489
|
+
repoRoot: dir,
|
|
490
|
+
beforeRef: before,
|
|
491
|
+
afterRef: after,
|
|
492
|
+
planPath,
|
|
493
|
+
});
|
|
494
|
+
expect(transitionRulesProvenance).toBe("derived_citations");
|
|
495
|
+
expect(result.status).toBe("complete");
|
|
496
|
+
expect(result.steps.length).toBe(1);
|
|
497
|
+
expect(result.steps[0]?.status).toBe("verified");
|
|
498
|
+
}, 20_000);
|
|
499
|
+
it("integration: derived_citations passes when diff adds uncited file if cited path changes", () => {
|
|
500
|
+
const dir = mkdtempSync(path.join(tmpdir(), "plan-tr-derived-fail-"));
|
|
501
|
+
execFileSync("git", ["init", dir], { windowsHide: true });
|
|
502
|
+
gitConfig(dir);
|
|
503
|
+
mkdirSync(path.join(dir, "src"), { recursive: true });
|
|
504
|
+
writeFileSync(path.join(dir, "src", "tracked.ts"), "a");
|
|
505
|
+
execFileSync("git", ["-C", dir, "add", "."], { windowsHide: true });
|
|
506
|
+
execFileSync("git", ["-C", dir, "commit", "-m", "base"], { windowsHide: true });
|
|
507
|
+
const before = execFileSync("git", ["-C", dir, "rev-parse", "HEAD"], { encoding: "utf8", windowsHide: true }).trim();
|
|
508
|
+
writeFileSync(path.join(dir, "src", "tracked.ts"), "b");
|
|
509
|
+
writeFileSync(path.join(dir, "z_uncited.txt"), "x");
|
|
510
|
+
execFileSync("git", ["-C", dir, "add", "."], { windowsHide: true });
|
|
511
|
+
execFileSync("git", ["-C", dir, "commit", "-m", "chg"], { windowsHide: true });
|
|
512
|
+
const after = execFileSync("git", ["-C", dir, "rev-parse", "HEAD"], { encoding: "utf8", windowsHide: true }).trim();
|
|
513
|
+
const planBody = `---
|
|
514
|
+
name: Plan
|
|
515
|
+
overview: x
|
|
516
|
+
isProject: false
|
|
517
|
+
---
|
|
518
|
+
|
|
519
|
+
# Work
|
|
520
|
+
|
|
521
|
+
## Implementation
|
|
522
|
+
|
|
523
|
+
Change \`src/tracked.ts\`.
|
|
524
|
+
`;
|
|
525
|
+
const planPath = path.join(dir, "Plan.md");
|
|
526
|
+
writeFileSync(planPath, planBody, "utf8");
|
|
527
|
+
const { workflowResult: result, transitionRulesProvenance } = buildPlanTransitionWorkflowResult({
|
|
528
|
+
repoRoot: dir,
|
|
529
|
+
beforeRef: before,
|
|
530
|
+
afterRef: after,
|
|
531
|
+
planPath,
|
|
532
|
+
});
|
|
533
|
+
expect(transitionRulesProvenance).toBe("derived_citations");
|
|
534
|
+
expect(result.status).toBe("complete");
|
|
535
|
+
expect(result.steps.length).toBe(1);
|
|
536
|
+
expect(result.steps.every((s) => s.status === "verified")).toBe(true);
|
|
537
|
+
}, 20_000);
|
|
538
|
+
it("integration: derived_citations fails when only uncited path changes", () => {
|
|
539
|
+
const dir = mkdtempSync(path.join(tmpdir(), "plan-tr-derived-uncited-only-"));
|
|
540
|
+
execFileSync("git", ["init", dir], { windowsHide: true });
|
|
541
|
+
gitConfig(dir);
|
|
542
|
+
mkdirSync(path.join(dir, "src"), { recursive: true });
|
|
543
|
+
writeFileSync(path.join(dir, "src", "tracked.ts"), "a");
|
|
544
|
+
execFileSync("git", ["-C", dir, "add", "."], { windowsHide: true });
|
|
545
|
+
execFileSync("git", ["-C", dir, "commit", "-m", "base"], { windowsHide: true });
|
|
546
|
+
const before = execFileSync("git", ["-C", dir, "rev-parse", "HEAD"], { encoding: "utf8", windowsHide: true }).trim();
|
|
547
|
+
writeFileSync(path.join(dir, "z_extra.txt"), "x");
|
|
548
|
+
execFileSync("git", ["-C", dir, "add", "."], { windowsHide: true });
|
|
549
|
+
execFileSync("git", ["-C", dir, "commit", "-m", "add uncited only"], { windowsHide: true });
|
|
550
|
+
const after = execFileSync("git", ["-C", dir, "rev-parse", "HEAD"], { encoding: "utf8", windowsHide: true }).trim();
|
|
551
|
+
const planBody = `---
|
|
552
|
+
name: Plan
|
|
553
|
+
overview: x
|
|
554
|
+
isProject: false
|
|
555
|
+
---
|
|
556
|
+
|
|
557
|
+
# Work
|
|
558
|
+
|
|
559
|
+
## Implementation
|
|
560
|
+
|
|
561
|
+
Change \`src/tracked.ts\`.
|
|
562
|
+
`;
|
|
563
|
+
const planPath = path.join(dir, "Plan.md");
|
|
564
|
+
writeFileSync(planPath, planBody, "utf8");
|
|
565
|
+
const { workflowResult: result, transitionRulesProvenance } = buildPlanTransitionWorkflowResult({
|
|
566
|
+
repoRoot: dir,
|
|
567
|
+
beforeRef: before,
|
|
568
|
+
afterRef: after,
|
|
569
|
+
planPath,
|
|
570
|
+
});
|
|
571
|
+
expect(transitionRulesProvenance).toBe("derived_citations");
|
|
572
|
+
expect(result.status).toBe("inconsistent");
|
|
573
|
+
expect(result.steps.length).toBe(1);
|
|
574
|
+
expect(result.steps[0]?.status).toBe("inconsistent");
|
|
575
|
+
expect(result.steps[0]?.reasons[0]?.code).toBe(PLAN_RULE_CODES.REQUIRED_ROW_MISSING);
|
|
576
|
+
}, 20_000);
|
|
577
|
+
});
|
|
578
|
+
describe("loadPlanTransitionRules", () => {
|
|
579
|
+
it("Cursor-like front matter without planValidation and no citations yields INSUFFICIENT_SPEC", () => {
|
|
580
|
+
const md = `---
|
|
581
|
+
name: Example plan
|
|
582
|
+
overview: x
|
|
583
|
+
todos: []
|
|
584
|
+
isProject: false
|
|
585
|
+
---
|
|
586
|
+
|
|
587
|
+
# Body
|
|
588
|
+
`;
|
|
589
|
+
try {
|
|
590
|
+
loadPlanTransitionRules(md);
|
|
591
|
+
expect.fail("expected TruthLayerError");
|
|
592
|
+
}
|
|
593
|
+
catch (e) {
|
|
594
|
+
expect(e).toBeInstanceOf(TruthLayerError);
|
|
595
|
+
expect(e.code).toBe(CLI_OPERATIONAL_CODES.PLAN_VALIDATION_INSUFFICIENT_SPEC);
|
|
596
|
+
}
|
|
597
|
+
});
|
|
598
|
+
it("derived_citations: zero Repository transition heading and one backtick path yields requireMatchingRow rules", () => {
|
|
599
|
+
const md = `---
|
|
600
|
+
name: Example plan
|
|
601
|
+
overview: x
|
|
602
|
+
isProject: false
|
|
603
|
+
---
|
|
604
|
+
|
|
605
|
+
# Body
|
|
606
|
+
|
|
607
|
+
## Implementation
|
|
608
|
+
|
|
609
|
+
Change \`src/only.ts\`.
|
|
610
|
+
`;
|
|
611
|
+
const { rules, source } = loadPlanTransitionRules(md);
|
|
612
|
+
expect(source).toBe("derived_citations");
|
|
613
|
+
expect(rules).toEqual([
|
|
614
|
+
{
|
|
615
|
+
id: "derived.require.0",
|
|
616
|
+
kind: "requireMatchingRow",
|
|
617
|
+
pattern: "src/only.ts",
|
|
618
|
+
rowKinds: [...DERIVED_REQUIRE_MATCH_ROW_KINDS],
|
|
619
|
+
},
|
|
620
|
+
]);
|
|
621
|
+
});
|
|
622
|
+
it("derived_citations: two backtick paths yield two requireMatchingRow rules in path sort order", () => {
|
|
623
|
+
const md = `---
|
|
624
|
+
name: Example plan
|
|
625
|
+
overview: x
|
|
626
|
+
isProject: false
|
|
627
|
+
---
|
|
628
|
+
|
|
629
|
+
# Body
|
|
630
|
+
|
|
631
|
+
## Implementation
|
|
632
|
+
|
|
633
|
+
Touch \`src/a.ts\` and \`src/b.ts\`.
|
|
634
|
+
`;
|
|
635
|
+
const { rules, source } = loadPlanTransitionRules(md);
|
|
636
|
+
expect(source).toBe("derived_citations");
|
|
637
|
+
expect(rules.length).toBe(2);
|
|
638
|
+
expect(rules[0]).toEqual({
|
|
639
|
+
id: "derived.require.0",
|
|
640
|
+
kind: "requireMatchingRow",
|
|
641
|
+
pattern: "src/a.ts",
|
|
642
|
+
rowKinds: [...DERIVED_REQUIRE_MATCH_ROW_KINDS],
|
|
643
|
+
});
|
|
644
|
+
expect(rules[1]).toEqual({
|
|
645
|
+
id: "derived.require.1",
|
|
646
|
+
kind: "requireMatchingRow",
|
|
647
|
+
pattern: "src/b.ts",
|
|
648
|
+
rowKinds: [...DERIVED_REQUIRE_MATCH_ROW_KINDS],
|
|
649
|
+
});
|
|
650
|
+
});
|
|
651
|
+
it("duplicate Repository transition validation headings yield AMBIGUOUS_BODY_RULES", () => {
|
|
652
|
+
const md = `---
|
|
653
|
+
name: x
|
|
654
|
+
---
|
|
655
|
+
## Repository transition validation
|
|
656
|
+
x
|
|
657
|
+
## Repository transition validation
|
|
658
|
+
y
|
|
659
|
+
`;
|
|
660
|
+
try {
|
|
661
|
+
loadPlanTransitionRules(md);
|
|
662
|
+
expect.fail("expected TruthLayerError");
|
|
663
|
+
}
|
|
664
|
+
catch (e) {
|
|
665
|
+
expect(e).toBeInstanceOf(TruthLayerError);
|
|
666
|
+
expect(e.code).toBe(CLI_OPERATIONAL_CODES.PLAN_VALIDATION_AMBIGUOUS_BODY_RULES);
|
|
667
|
+
}
|
|
668
|
+
});
|
|
669
|
+
it("first fence not yaml yields INSUFFICIENT_SPEC", () => {
|
|
670
|
+
const md = `---
|
|
671
|
+
name: x
|
|
672
|
+
---
|
|
673
|
+
## Repository transition validation
|
|
674
|
+
\`\`\`json
|
|
675
|
+
{}
|
|
676
|
+
\`\`\`
|
|
677
|
+
`;
|
|
678
|
+
try {
|
|
679
|
+
loadPlanTransitionRules(md);
|
|
680
|
+
expect.fail("expected TruthLayerError");
|
|
681
|
+
}
|
|
682
|
+
catch (e) {
|
|
683
|
+
expect(e).toBeInstanceOf(TruthLayerError);
|
|
684
|
+
expect(e.code).toBe(CLI_OPERATIONAL_CODES.PLAN_VALIDATION_INSUFFICIENT_SPEC);
|
|
685
|
+
}
|
|
686
|
+
});
|
|
687
|
+
it("two yaml fences in section yield AMBIGUOUS_BODY_RULES", () => {
|
|
688
|
+
const md = `---
|
|
689
|
+
name: x
|
|
690
|
+
---
|
|
691
|
+
## Repository transition validation
|
|
692
|
+
\`\`\`yaml
|
|
693
|
+
schemaVersion: 1
|
|
694
|
+
rules: []
|
|
695
|
+
\`\`\`
|
|
696
|
+
\`\`\`yaml
|
|
697
|
+
schemaVersion: 1
|
|
698
|
+
rules: []
|
|
699
|
+
\`\`\`
|
|
700
|
+
`;
|
|
701
|
+
try {
|
|
702
|
+
loadPlanTransitionRules(md);
|
|
703
|
+
expect.fail("expected TruthLayerError");
|
|
704
|
+
}
|
|
705
|
+
catch (e) {
|
|
706
|
+
expect(e).toBeInstanceOf(TruthLayerError);
|
|
707
|
+
expect(e.code).toBe(CLI_OPERATIONAL_CODES.PLAN_VALIDATION_AMBIGUOUS_BODY_RULES);
|
|
708
|
+
}
|
|
709
|
+
});
|
|
710
|
+
it("invalid yaml in body fence yields PLAN_VALIDATION_YAML_INVALID with body prefix", () => {
|
|
711
|
+
const md = `---
|
|
712
|
+
name: x
|
|
713
|
+
---
|
|
714
|
+
## Repository transition validation
|
|
715
|
+
\`\`\`yaml
|
|
716
|
+
schemaVersion: 1
|
|
717
|
+
rules: [oops not closed
|
|
718
|
+
\`\`\`
|
|
719
|
+
`;
|
|
720
|
+
try {
|
|
721
|
+
loadPlanTransitionRules(md);
|
|
722
|
+
expect.fail("expected TruthLayerError");
|
|
723
|
+
}
|
|
724
|
+
catch (e) {
|
|
725
|
+
expect(e).toBeInstanceOf(TruthLayerError);
|
|
726
|
+
expect(e.code).toBe(CLI_OPERATIONAL_CODES.PLAN_VALIDATION_YAML_INVALID);
|
|
727
|
+
expect(e.message).toContain("body Repository transition validation:");
|
|
728
|
+
}
|
|
729
|
+
});
|
|
730
|
+
it("body yaml valid but schema invalid yields SCHEMA_INVALID with body prefix", () => {
|
|
731
|
+
const md = `---
|
|
732
|
+
name: x
|
|
733
|
+
---
|
|
734
|
+
## Repository transition validation
|
|
735
|
+
\`\`\`yaml
|
|
736
|
+
schemaVersion: 1
|
|
737
|
+
rules:
|
|
738
|
+
- id: x
|
|
739
|
+
kind: requireRenameFromTo
|
|
740
|
+
fromPattern: a
|
|
741
|
+
toPattern: b
|
|
742
|
+
\`\`\`
|
|
743
|
+
`;
|
|
744
|
+
try {
|
|
745
|
+
loadPlanTransitionRules(md);
|
|
746
|
+
expect.fail("expected TruthLayerError");
|
|
747
|
+
}
|
|
748
|
+
catch (e) {
|
|
749
|
+
expect(e).toBeInstanceOf(TruthLayerError);
|
|
750
|
+
expect(e.code).toBe(CLI_OPERATIONAL_CODES.PLAN_VALIDATION_SCHEMA_INVALID);
|
|
751
|
+
expect(e.message.startsWith("body Repository transition validation:")).toBe(true);
|
|
752
|
+
}
|
|
753
|
+
});
|
|
754
|
+
it("planValidation in front matter wins over body path citations", () => {
|
|
755
|
+
const md = `---
|
|
756
|
+
planValidation:
|
|
757
|
+
schemaVersion: 1
|
|
758
|
+
rules:
|
|
759
|
+
- id: fm_rule
|
|
760
|
+
kind: forbidMatchingRows
|
|
761
|
+
pattern: "nope.txt"
|
|
762
|
+
---
|
|
763
|
+
|
|
764
|
+
## Implementation
|
|
765
|
+
|
|
766
|
+
Also \`src/ignored.ts\` in prose.
|
|
767
|
+
`;
|
|
768
|
+
const { rules, source } = loadPlanTransitionRules(md);
|
|
769
|
+
expect(source).toBe("front_matter");
|
|
770
|
+
expect(rules).toHaveLength(1);
|
|
771
|
+
expect(rules[0]?.id).toBe("fm_rule");
|
|
772
|
+
});
|
|
773
|
+
});
|
|
774
|
+
describe("plan-transition CLI", () => {
|
|
775
|
+
const cliJs = path.join(root, "dist", "cli.js");
|
|
776
|
+
it("plan-transition emits WorkflowResult JSON", () => {
|
|
777
|
+
const dir = mkdtempSync(path.join(tmpdir(), "plan-cli-"));
|
|
778
|
+
execFileSync("git", ["init", dir], { windowsHide: true });
|
|
779
|
+
execFileSync("git", ["-C", dir, "config", "user.email", "c@test"], { windowsHide: true });
|
|
780
|
+
execFileSync("git", ["-C", dir, "config", "user.name", "c"], { windowsHide: true });
|
|
781
|
+
writeFileSync(path.join(dir, "f.txt"), "1");
|
|
782
|
+
execFileSync("git", ["-C", dir, "add", "."], { windowsHide: true });
|
|
783
|
+
execFileSync("git", ["-C", dir, "commit", "-m", "a"], { windowsHide: true });
|
|
784
|
+
const b = execFileSync("git", ["-C", dir, "rev-parse", "HEAD"], { encoding: "utf8", windowsHide: true }).trim();
|
|
785
|
+
writeFileSync(path.join(dir, "f.txt"), "2");
|
|
786
|
+
execFileSync("git", ["-C", dir, "add", "."], { windowsHide: true });
|
|
787
|
+
execFileSync("git", ["-C", dir, "commit", "-m", "b"], { windowsHide: true });
|
|
788
|
+
const a = execFileSync("git", ["-C", dir, "rev-parse", "HEAD"], { encoding: "utf8", windowsHide: true }).trim();
|
|
789
|
+
const plan = `---
|
|
790
|
+
planValidation:
|
|
791
|
+
schemaVersion: 1
|
|
792
|
+
rules:
|
|
793
|
+
- id: r1
|
|
794
|
+
kind: forbidMatchingRows
|
|
795
|
+
pattern: "nonexistent.zzz"
|
|
796
|
+
---
|
|
797
|
+
`;
|
|
798
|
+
const planPath = path.join(dir, "Plan.md");
|
|
799
|
+
writeFileSync(planPath, plan, "utf8");
|
|
800
|
+
const out = execFileSync(process.execPath, [cliJs, "plan-transition", "--repo", dir, "--before", b, "--after", a, "--plan", planPath, "--no-truth-report"], { encoding: "utf8", windowsHide: true });
|
|
801
|
+
const wf = JSON.parse(out.trim());
|
|
802
|
+
expect(wf.workflowId).toBe(PLAN_TRANSITION_WORKFLOW_ID);
|
|
803
|
+
expect(wf.status).toBe("complete");
|
|
804
|
+
}, 20_000);
|
|
805
|
+
it("plan-transition --write-run-bundle writes three artifacts", () => {
|
|
806
|
+
const dir = mkdtempSync(path.join(tmpdir(), "plan-bundle-"));
|
|
807
|
+
execFileSync("git", ["init", dir], { windowsHide: true });
|
|
808
|
+
execFileSync("git", ["-C", dir, "config", "user.email", "c@test"], { windowsHide: true });
|
|
809
|
+
execFileSync("git", ["-C", dir, "config", "user.name", "c"], { windowsHide: true });
|
|
810
|
+
writeFileSync(path.join(dir, "f.txt"), "1");
|
|
811
|
+
execFileSync("git", ["-C", dir, "add", "."], { windowsHide: true });
|
|
812
|
+
execFileSync("git", ["-C", dir, "commit", "-m", "a"], { windowsHide: true });
|
|
813
|
+
const b = execFileSync("git", ["-C", dir, "rev-parse", "HEAD"], { encoding: "utf8", windowsHide: true }).trim();
|
|
814
|
+
writeFileSync(path.join(dir, "f.txt"), "2");
|
|
815
|
+
execFileSync("git", ["-C", dir, "add", "."], { windowsHide: true });
|
|
816
|
+
execFileSync("git", ["-C", dir, "commit", "-m", "b"], { windowsHide: true });
|
|
817
|
+
const a = execFileSync("git", ["-C", dir, "rev-parse", "HEAD"], { encoding: "utf8", windowsHide: true }).trim();
|
|
818
|
+
const plan = `---
|
|
819
|
+
planValidation:
|
|
820
|
+
schemaVersion: 1
|
|
821
|
+
rules:
|
|
822
|
+
- id: noop
|
|
823
|
+
kind: forbidMatchingRows
|
|
824
|
+
pattern: "__no_such_path_plan_bundle__.txt"
|
|
825
|
+
---
|
|
826
|
+
`;
|
|
827
|
+
const planPath = path.join(dir, "Plan.md");
|
|
828
|
+
writeFileSync(planPath, plan, "utf8");
|
|
829
|
+
const bundleDir = path.join(dir, "bundle-out");
|
|
830
|
+
mkdirSync(bundleDir, { recursive: true });
|
|
831
|
+
execFileSync(process.execPath, [
|
|
832
|
+
cliJs,
|
|
833
|
+
"plan-transition",
|
|
834
|
+
"--repo",
|
|
835
|
+
dir,
|
|
836
|
+
"--before",
|
|
837
|
+
b,
|
|
838
|
+
"--after",
|
|
839
|
+
a,
|
|
840
|
+
"--plan",
|
|
841
|
+
planPath,
|
|
842
|
+
"--no-truth-report",
|
|
843
|
+
"--write-run-bundle",
|
|
844
|
+
bundleDir,
|
|
845
|
+
], { encoding: "utf8", windowsHide: true });
|
|
846
|
+
const ev = readFileSync(path.join(bundleDir, "events.ndjson"), "utf8");
|
|
847
|
+
const v = loadSchemaValidator("event");
|
|
848
|
+
const evLine = JSON.parse(ev.trim());
|
|
849
|
+
expect(v(evLine)).toBe(true);
|
|
850
|
+
expect(evLine.params.transitionRulesSource).toBe("front_matter");
|
|
851
|
+
const ar = JSON.parse(readFileSync(path.join(bundleDir, "agent-run.json"), "utf8"));
|
|
852
|
+
const vAr = loadSchemaValidator("agent-run-record-v1");
|
|
853
|
+
expect(vAr(ar)).toBe(true);
|
|
854
|
+
}, 20_000);
|
|
855
|
+
it("plan-transition --write-run-bundle sets transitionRulesSource body_section for body rules", () => {
|
|
856
|
+
const dir = mkdtempSync(path.join(tmpdir(), "plan-bundle-body-"));
|
|
857
|
+
execFileSync("git", ["init", dir], { windowsHide: true });
|
|
858
|
+
execFileSync("git", ["-C", dir, "config", "user.email", "c@test"], { windowsHide: true });
|
|
859
|
+
execFileSync("git", ["-C", dir, "config", "user.name", "c"], { windowsHide: true });
|
|
860
|
+
writeFileSync(path.join(dir, "f.txt"), "1");
|
|
861
|
+
execFileSync("git", ["-C", dir, "add", "."], { windowsHide: true });
|
|
862
|
+
execFileSync("git", ["-C", dir, "commit", "-m", "a"], { windowsHide: true });
|
|
863
|
+
const b = execFileSync("git", ["-C", dir, "rev-parse", "HEAD"], { encoding: "utf8", windowsHide: true }).trim();
|
|
864
|
+
writeFileSync(path.join(dir, "f.txt"), "2");
|
|
865
|
+
execFileSync("git", ["-C", dir, "add", "."], { windowsHide: true });
|
|
866
|
+
execFileSync("git", ["-C", dir, "commit", "-m", "b"], { windowsHide: true });
|
|
867
|
+
const a = execFileSync("git", ["-C", dir, "rev-parse", "HEAD"], { encoding: "utf8", windowsHide: true }).trim();
|
|
868
|
+
const plan = `---
|
|
869
|
+
name: p
|
|
870
|
+
---
|
|
871
|
+
## Repository transition validation
|
|
872
|
+
\`\`\`yaml
|
|
873
|
+
schemaVersion: 1
|
|
874
|
+
rules:
|
|
875
|
+
- id: noop
|
|
876
|
+
kind: forbidMatchingRows
|
|
877
|
+
pattern: "__no_such_path_plan_bundle_body__.txt"
|
|
878
|
+
\`\`\`
|
|
879
|
+
`;
|
|
880
|
+
const planPath = path.join(dir, "Plan.md");
|
|
881
|
+
writeFileSync(planPath, plan, "utf8");
|
|
882
|
+
const bundleDir = path.join(dir, "bundle-out");
|
|
883
|
+
mkdirSync(bundleDir, { recursive: true });
|
|
884
|
+
execFileSync(process.execPath, [
|
|
885
|
+
cliJs,
|
|
886
|
+
"plan-transition",
|
|
887
|
+
"--repo",
|
|
888
|
+
dir,
|
|
889
|
+
"--before",
|
|
890
|
+
b,
|
|
891
|
+
"--after",
|
|
892
|
+
a,
|
|
893
|
+
"--plan",
|
|
894
|
+
planPath,
|
|
895
|
+
"--no-truth-report",
|
|
896
|
+
"--write-run-bundle",
|
|
897
|
+
bundleDir,
|
|
898
|
+
], { encoding: "utf8", windowsHide: true });
|
|
899
|
+
const evLine = JSON.parse(readFileSync(path.join(bundleDir, "events.ndjson"), "utf8").trim());
|
|
900
|
+
expect(loadSchemaValidator("event")(evLine)).toBe(true);
|
|
901
|
+
expect(evLine.params.transitionRulesSource).toBe("body_section");
|
|
902
|
+
}, 20_000);
|
|
903
|
+
it("plan-transition --write-run-bundle sets transitionRulesSource derived_citations", () => {
|
|
904
|
+
const dir = mkdtempSync(path.join(tmpdir(), "plan-bundle-derived-"));
|
|
905
|
+
execFileSync("git", ["init", dir], { windowsHide: true });
|
|
906
|
+
execFileSync("git", ["-C", dir, "config", "user.email", "c@test"], { windowsHide: true });
|
|
907
|
+
execFileSync("git", ["-C", dir, "config", "user.name", "c"], { windowsHide: true });
|
|
908
|
+
mkdirSync(path.join(dir, "src"), { recursive: true });
|
|
909
|
+
writeFileSync(path.join(dir, "src", "t.ts"), "1");
|
|
910
|
+
execFileSync("git", ["-C", dir, "add", "."], { windowsHide: true });
|
|
911
|
+
execFileSync("git", ["-C", dir, "commit", "-m", "a"], { windowsHide: true });
|
|
912
|
+
const b = execFileSync("git", ["-C", dir, "rev-parse", "HEAD"], { encoding: "utf8", windowsHide: true }).trim();
|
|
913
|
+
writeFileSync(path.join(dir, "src", "t.ts"), "2");
|
|
914
|
+
execFileSync("git", ["-C", dir, "add", "."], { windowsHide: true });
|
|
915
|
+
execFileSync("git", ["-C", dir, "commit", "-m", "b"], { windowsHide: true });
|
|
916
|
+
const a = execFileSync("git", ["-C", dir, "rev-parse", "HEAD"], { encoding: "utf8", windowsHide: true }).trim();
|
|
917
|
+
const plan = `---
|
|
918
|
+
name: p
|
|
919
|
+
overview: x
|
|
920
|
+
---
|
|
921
|
+
|
|
922
|
+
# x
|
|
923
|
+
|
|
924
|
+
## Implementation
|
|
925
|
+
|
|
926
|
+
Change \`src/t.ts\`.
|
|
927
|
+
`;
|
|
928
|
+
const planPath = path.join(dir, "Plan.md");
|
|
929
|
+
writeFileSync(planPath, plan, "utf8");
|
|
930
|
+
const bundleDir = path.join(dir, "bundle-out");
|
|
931
|
+
mkdirSync(bundleDir, { recursive: true });
|
|
932
|
+
execFileSync(process.execPath, [
|
|
933
|
+
cliJs,
|
|
934
|
+
"plan-transition",
|
|
935
|
+
"--repo",
|
|
936
|
+
dir,
|
|
937
|
+
"--before",
|
|
938
|
+
b,
|
|
939
|
+
"--after",
|
|
940
|
+
a,
|
|
941
|
+
"--plan",
|
|
942
|
+
planPath,
|
|
943
|
+
"--no-truth-report",
|
|
944
|
+
"--write-run-bundle",
|
|
945
|
+
bundleDir,
|
|
946
|
+
], { encoding: "utf8", windowsHide: true });
|
|
947
|
+
const evLine = JSON.parse(readFileSync(path.join(bundleDir, "events.ndjson"), "utf8").trim());
|
|
948
|
+
expect(loadSchemaValidator("event")(evLine)).toBe(true);
|
|
949
|
+
expect(evLine.params.transitionRulesSource).toBe("derived_citations");
|
|
950
|
+
const wf = JSON.parse(readFileSync(path.join(bundleDir, "workflow-result.json"), "utf8"));
|
|
951
|
+
expect(wf.status).toBe("complete");
|
|
952
|
+
expect(wf.steps.length).toBe(1);
|
|
953
|
+
expect(wf.steps[0]?.status).toBe("verified");
|
|
954
|
+
}, 20_000);
|
|
955
|
+
});
|
|
956
|
+
//# sourceMappingURL=planTransition.test.js.map
|