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,654 @@
|
|
|
1
|
+
import { getPointer } from "./jsonPointer.js";
|
|
2
|
+
import { CLI_OPERATIONAL_CODES } from "./failureCatalog.js";
|
|
3
|
+
import { TruthLayerError } from "./truthLayerError.js";
|
|
4
|
+
import { REGISTRY_RESOLVER_CODE } from "./wireReasonCodes.js";
|
|
5
|
+
const IDENT = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
|
|
6
|
+
/** UTF-16 code unit lexicographic order (same as `canonicalJsonForParams` object key sort). */
|
|
7
|
+
export function compareUtf16Id(a, b) {
|
|
8
|
+
return a < b ? -1 : a > b ? 1 : 0;
|
|
9
|
+
}
|
|
10
|
+
function resolveStringSpec(spec, params, label) {
|
|
11
|
+
if ("const" in spec) {
|
|
12
|
+
const v = spec.const;
|
|
13
|
+
if (typeof v !== "string" || v.length === 0) {
|
|
14
|
+
return {
|
|
15
|
+
ok: false,
|
|
16
|
+
code: REGISTRY_RESOLVER_CODE.CONST_STRING_EMPTY,
|
|
17
|
+
message: `${label}: const must be non-empty string`,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
return { ok: true, value: v };
|
|
21
|
+
}
|
|
22
|
+
const got = getPointer(params, spec.pointer);
|
|
23
|
+
if (got === undefined || got === null) {
|
|
24
|
+
return {
|
|
25
|
+
ok: false,
|
|
26
|
+
code: REGISTRY_RESOLVER_CODE.STRING_SPEC_POINTER_MISSING,
|
|
27
|
+
message: `${label}: missing at ${spec.pointer}`,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
if (typeof got !== "string") {
|
|
31
|
+
return {
|
|
32
|
+
ok: false,
|
|
33
|
+
code: REGISTRY_RESOLVER_CODE.STRING_SPEC_TYPE,
|
|
34
|
+
message: `${label}: expected string at ${spec.pointer}`,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
if (got.length === 0) {
|
|
38
|
+
return {
|
|
39
|
+
ok: false,
|
|
40
|
+
code: REGISTRY_RESOLVER_CODE.STRING_SPEC_EMPTY,
|
|
41
|
+
message: `${label}: empty string at ${spec.pointer}`,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
return { ok: true, value: got };
|
|
45
|
+
}
|
|
46
|
+
function resolveKeyValue(spec, params) {
|
|
47
|
+
if ("const" in spec && !("pointer" in spec)) {
|
|
48
|
+
return { ok: true, value: String(spec.const) };
|
|
49
|
+
}
|
|
50
|
+
if ("pointer" in spec) {
|
|
51
|
+
const ptr = spec.pointer;
|
|
52
|
+
const got = getPointer(params, ptr);
|
|
53
|
+
if (got === undefined || got === null) {
|
|
54
|
+
return {
|
|
55
|
+
ok: false,
|
|
56
|
+
code: REGISTRY_RESOLVER_CODE.KEY_VALUE_POINTER_MISSING,
|
|
57
|
+
message: `key.value missing at ${ptr}`,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
if (typeof got === "object") {
|
|
61
|
+
return {
|
|
62
|
+
ok: false,
|
|
63
|
+
code: REGISTRY_RESOLVER_CODE.KEY_VALUE_NOT_SCALAR,
|
|
64
|
+
message: `key.value must be scalar at ${ptr}`,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
return { ok: true, value: String(got) };
|
|
68
|
+
}
|
|
69
|
+
return { ok: false, code: REGISTRY_RESOLVER_CODE.KEY_VALUE_SPEC_INVALID, message: "value: invalid spec" };
|
|
70
|
+
}
|
|
71
|
+
function normalizeSortedIdentityEq(pairs, labelPrefix) {
|
|
72
|
+
const sorted = [...pairs].sort((a, b) => compareUtf16Id(a.column, b.column));
|
|
73
|
+
for (let i = 1; i < sorted.length; i++) {
|
|
74
|
+
if (sorted[i].column === sorted[i - 1].column) {
|
|
75
|
+
return {
|
|
76
|
+
ok: false,
|
|
77
|
+
code: REGISTRY_RESOLVER_CODE.EQUALITY_DUPLICATE_COLUMN,
|
|
78
|
+
message: `${labelPrefix}duplicate equality column: ${sorted[i].column}`,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return { ok: true, identityEq: sorted };
|
|
83
|
+
}
|
|
84
|
+
function resolveRegistryEqualityList(specs, params, labelPrefix) {
|
|
85
|
+
const raw = [];
|
|
86
|
+
for (let i = 0; i < specs.length; i++) {
|
|
87
|
+
const p = specs[i];
|
|
88
|
+
const colRes = resolveStringSpec(p.column, params, `${labelPrefix}identityEq[${i}].column`);
|
|
89
|
+
if (!colRes.ok)
|
|
90
|
+
return colRes;
|
|
91
|
+
if (!IDENT.test(colRes.value)) {
|
|
92
|
+
return {
|
|
93
|
+
ok: false,
|
|
94
|
+
code: REGISTRY_RESOLVER_CODE.INVALID_IDENTIFIER,
|
|
95
|
+
message: `${labelPrefix}identityEq[${i}].column: ${colRes.value}`,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
const valRes = resolveKeyValue(p.value, params);
|
|
99
|
+
if (!valRes.ok) {
|
|
100
|
+
return { ok: false, code: valRes.code, message: `${labelPrefix}identityEq[${i}]. ${valRes.message}` };
|
|
101
|
+
}
|
|
102
|
+
raw.push({ column: colRes.value, value: valRes.value });
|
|
103
|
+
}
|
|
104
|
+
return normalizeSortedIdentityEq(raw, labelPrefix);
|
|
105
|
+
}
|
|
106
|
+
function resolveSqlRowSpec(params, spec, labelPrefix) {
|
|
107
|
+
const tableRes = "const" in spec.table && !("pointer" in spec.table)
|
|
108
|
+
? { ok: true, value: spec.table.const }
|
|
109
|
+
: "pointer" in spec.table
|
|
110
|
+
? (() => {
|
|
111
|
+
const tptr = spec.table.pointer;
|
|
112
|
+
const got = getPointer(params, tptr);
|
|
113
|
+
if (got === undefined || got === null || typeof got !== "string" || got.length === 0) {
|
|
114
|
+
return {
|
|
115
|
+
ok: false,
|
|
116
|
+
code: REGISTRY_RESOLVER_CODE.TABLE_POINTER_INVALID,
|
|
117
|
+
message: `${labelPrefix}table: expected non-empty string at ${tptr}`,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
return { ok: true, value: got };
|
|
121
|
+
})()
|
|
122
|
+
: {
|
|
123
|
+
ok: false,
|
|
124
|
+
code: REGISTRY_RESOLVER_CODE.TABLE_SPEC_INVALID,
|
|
125
|
+
message: `${labelPrefix}table: invalid spec`,
|
|
126
|
+
};
|
|
127
|
+
if (!tableRes.ok)
|
|
128
|
+
return tableRes;
|
|
129
|
+
if (!IDENT.test(tableRes.value)) {
|
|
130
|
+
return {
|
|
131
|
+
ok: false,
|
|
132
|
+
code: REGISTRY_RESOLVER_CODE.INVALID_IDENTIFIER,
|
|
133
|
+
message: `${labelPrefix}table: ${tableRes.value}`,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
const idRes = resolveRegistryEqualityList(spec.identityEq, params, labelPrefix);
|
|
137
|
+
if (!idRes.ok)
|
|
138
|
+
return idRes;
|
|
139
|
+
const fieldsRaw = getPointer(params, spec.requiredFields.pointer);
|
|
140
|
+
if (fieldsRaw === undefined || fieldsRaw === null) {
|
|
141
|
+
return {
|
|
142
|
+
ok: false,
|
|
143
|
+
code: REGISTRY_RESOLVER_CODE.REQUIRED_FIELDS_POINTER_MISSING,
|
|
144
|
+
message: `${labelPrefix}requiredFields missing at ${spec.requiredFields.pointer}`,
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
if (typeof fieldsRaw !== "object" || Array.isArray(fieldsRaw)) {
|
|
148
|
+
return {
|
|
149
|
+
ok: false,
|
|
150
|
+
code: REGISTRY_RESOLVER_CODE.REQUIRED_FIELDS_NOT_OBJECT,
|
|
151
|
+
message: `${labelPrefix}requiredFields must be object at ${spec.requiredFields.pointer}`,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
const requiredFields = {};
|
|
155
|
+
for (const k of Object.keys(fieldsRaw)) {
|
|
156
|
+
if (!IDENT.test(k)) {
|
|
157
|
+
return {
|
|
158
|
+
ok: false,
|
|
159
|
+
code: REGISTRY_RESOLVER_CODE.INVALID_IDENTIFIER,
|
|
160
|
+
message: `${labelPrefix}requiredFields key: ${k}`,
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
const val = fieldsRaw[k];
|
|
164
|
+
if (val === undefined) {
|
|
165
|
+
return {
|
|
166
|
+
ok: false,
|
|
167
|
+
code: REGISTRY_RESOLVER_CODE.REQUIRED_FIELDS_VALUE_UNDEFINED,
|
|
168
|
+
message: `${labelPrefix}requiredFields.${k} must not be undefined`,
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
if (typeof val === "object" && val !== null) {
|
|
172
|
+
return {
|
|
173
|
+
ok: false,
|
|
174
|
+
code: REGISTRY_RESOLVER_CODE.REQUIRED_FIELDS_VALUE_NOT_SCALAR,
|
|
175
|
+
message: `${labelPrefix}requiredFields.${k} must be string, number, boolean, or null`,
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
if (typeof val === "string" || typeof val === "number" || typeof val === "boolean" || val === null) {
|
|
179
|
+
requiredFields[k] = val;
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
return {
|
|
183
|
+
ok: false,
|
|
184
|
+
code: REGISTRY_RESOLVER_CODE.REQUIRED_FIELDS_VALUE_NOT_SCALAR,
|
|
185
|
+
message: `${labelPrefix}requiredFields.${k} must be string, number, boolean, or null`,
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return {
|
|
190
|
+
ok: true,
|
|
191
|
+
request: {
|
|
192
|
+
kind: "sql_row",
|
|
193
|
+
table: tableRes.value,
|
|
194
|
+
identityEq: idRes.identityEq,
|
|
195
|
+
requiredFields,
|
|
196
|
+
},
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
function resolveSqlRowAbsentSpec(params, spec, labelPrefix) {
|
|
200
|
+
const tableRes = "const" in spec.table && !("pointer" in spec.table)
|
|
201
|
+
? { ok: true, value: spec.table.const }
|
|
202
|
+
: "pointer" in spec.table
|
|
203
|
+
? (() => {
|
|
204
|
+
const tptr = spec.table.pointer;
|
|
205
|
+
const got = getPointer(params, tptr);
|
|
206
|
+
if (got === undefined || got === null || typeof got !== "string" || got.length === 0) {
|
|
207
|
+
return {
|
|
208
|
+
ok: false,
|
|
209
|
+
code: REGISTRY_RESOLVER_CODE.TABLE_POINTER_INVALID,
|
|
210
|
+
message: `${labelPrefix}table: expected non-empty string at ${tptr}`,
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
return { ok: true, value: got };
|
|
214
|
+
})()
|
|
215
|
+
: {
|
|
216
|
+
ok: false,
|
|
217
|
+
code: REGISTRY_RESOLVER_CODE.TABLE_SPEC_INVALID,
|
|
218
|
+
message: `${labelPrefix}table: invalid spec`,
|
|
219
|
+
};
|
|
220
|
+
if (!tableRes.ok)
|
|
221
|
+
return tableRes;
|
|
222
|
+
if (!IDENT.test(tableRes.value)) {
|
|
223
|
+
return {
|
|
224
|
+
ok: false,
|
|
225
|
+
code: REGISTRY_RESOLVER_CODE.INVALID_IDENTIFIER,
|
|
226
|
+
message: `${labelPrefix}table: ${tableRes.value}`,
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
const idRes = resolveRegistryEqualityList(spec.identityEq, params, labelPrefix);
|
|
230
|
+
if (!idRes.ok)
|
|
231
|
+
return idRes;
|
|
232
|
+
const identityCols = new Set(idRes.identityEq.map((p) => p.column));
|
|
233
|
+
const filterSpecs = spec.filterEq ?? [];
|
|
234
|
+
const filterRaw = [];
|
|
235
|
+
for (let i = 0; i < filterSpecs.length; i++) {
|
|
236
|
+
const p = filterSpecs[i];
|
|
237
|
+
const colRes = resolveStringSpec(p.column, params, `${labelPrefix}filterEq[${i}].column`);
|
|
238
|
+
if (!colRes.ok)
|
|
239
|
+
return colRes;
|
|
240
|
+
if (!IDENT.test(colRes.value)) {
|
|
241
|
+
return {
|
|
242
|
+
ok: false,
|
|
243
|
+
code: REGISTRY_RESOLVER_CODE.INVALID_IDENTIFIER,
|
|
244
|
+
message: `${labelPrefix}filterEq[${i}].column: ${colRes.value}`,
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
if (identityCols.has(colRes.value)) {
|
|
248
|
+
return {
|
|
249
|
+
ok: false,
|
|
250
|
+
code: REGISTRY_RESOLVER_CODE.FILTER_EQ_OVERLAPS_IDENTITY,
|
|
251
|
+
message: `${labelPrefix}filterEq column ${colRes.value} duplicates identityEq`,
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
const valRes = resolveKeyValue(p.value, params);
|
|
255
|
+
if (!valRes.ok) {
|
|
256
|
+
return { ok: false, code: valRes.code, message: `${labelPrefix}filterEq[${i}]. ${valRes.message}` };
|
|
257
|
+
}
|
|
258
|
+
filterRaw.push({ column: colRes.value, value: valRes.value });
|
|
259
|
+
}
|
|
260
|
+
const filterNorm = normalizeSortedIdentityEq(filterRaw, `${labelPrefix}filterEq: `);
|
|
261
|
+
if (!filterNorm.ok)
|
|
262
|
+
return filterNorm;
|
|
263
|
+
return {
|
|
264
|
+
ok: true,
|
|
265
|
+
request: {
|
|
266
|
+
kind: "sql_row_absent",
|
|
267
|
+
table: tableRes.value,
|
|
268
|
+
identityEq: idRes.identityEq,
|
|
269
|
+
filterEq: filterNorm.identityEq,
|
|
270
|
+
},
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
function resolveTableIdent(spec, params, label) {
|
|
274
|
+
const tableRes = "const" in spec && !("pointer" in spec)
|
|
275
|
+
? { ok: true, value: spec.const }
|
|
276
|
+
: "pointer" in spec
|
|
277
|
+
? (() => {
|
|
278
|
+
const tptr = spec.pointer;
|
|
279
|
+
const got = getPointer(params, tptr);
|
|
280
|
+
if (got === undefined || got === null || typeof got !== "string" || got.length === 0) {
|
|
281
|
+
return {
|
|
282
|
+
ok: false,
|
|
283
|
+
code: REGISTRY_RESOLVER_CODE.TABLE_POINTER_INVALID,
|
|
284
|
+
message: `${label}: expected non-empty string at ${tptr}`,
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
return { ok: true, value: got };
|
|
288
|
+
})()
|
|
289
|
+
: {
|
|
290
|
+
ok: false,
|
|
291
|
+
code: REGISTRY_RESOLVER_CODE.TABLE_SPEC_INVALID,
|
|
292
|
+
message: `${label}: invalid spec`,
|
|
293
|
+
};
|
|
294
|
+
if (!tableRes.ok)
|
|
295
|
+
return tableRes;
|
|
296
|
+
if (!IDENT.test(tableRes.value)) {
|
|
297
|
+
return {
|
|
298
|
+
ok: false,
|
|
299
|
+
code: REGISTRY_RESOLVER_CODE.INVALID_IDENTIFIER,
|
|
300
|
+
message: `${label}: ${tableRes.value}`,
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
return { ok: true, value: tableRes.value };
|
|
304
|
+
}
|
|
305
|
+
function resolveExpectNumber(spec, params, label) {
|
|
306
|
+
if ("const" in spec && !("pointer" in spec)) {
|
|
307
|
+
const n = spec.const;
|
|
308
|
+
if (typeof n !== "number" || !Number.isFinite(n)) {
|
|
309
|
+
return {
|
|
310
|
+
ok: false,
|
|
311
|
+
code: REGISTRY_RESOLVER_CODE.RELATIONAL_EXPECT_VALUE_INVALID,
|
|
312
|
+
message: `${label}: const must be a finite number`,
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
return { ok: true, value: n };
|
|
316
|
+
}
|
|
317
|
+
const ptr = spec.pointer;
|
|
318
|
+
const got = getPointer(params, ptr);
|
|
319
|
+
if (got === undefined || got === null) {
|
|
320
|
+
return {
|
|
321
|
+
ok: false,
|
|
322
|
+
code: REGISTRY_RESOLVER_CODE.RELATIONAL_EXPECT_VALUE_INVALID,
|
|
323
|
+
message: `${label}: missing number at ${ptr}`,
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
if (typeof got !== "number" || !Number.isFinite(got)) {
|
|
327
|
+
return {
|
|
328
|
+
ok: false,
|
|
329
|
+
code: REGISTRY_RESOLVER_CODE.RELATIONAL_EXPECT_VALUE_INVALID,
|
|
330
|
+
message: `${label}: expected finite number at ${ptr}`,
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
return { ok: true, value: got };
|
|
334
|
+
}
|
|
335
|
+
function resolveSqlRelationalCheck(params, spec, labelPrefix) {
|
|
336
|
+
if (spec.checkKind === "anti_join") {
|
|
337
|
+
const anchor = resolveTableIdent(spec.anchorTable, params, `${labelPrefix}anchorTable`);
|
|
338
|
+
if (!anchor.ok)
|
|
339
|
+
return anchor;
|
|
340
|
+
const lookup = resolveTableIdent(spec.lookupTable, params, `${labelPrefix}lookupTable`);
|
|
341
|
+
if (!lookup.ok)
|
|
342
|
+
return lookup;
|
|
343
|
+
const ac = resolveStringSpec(spec.anchorColumn, params, `${labelPrefix}anchorColumn`);
|
|
344
|
+
if (!ac.ok)
|
|
345
|
+
return ac;
|
|
346
|
+
if (!IDENT.test(ac.value)) {
|
|
347
|
+
return {
|
|
348
|
+
ok: false,
|
|
349
|
+
code: REGISTRY_RESOLVER_CODE.INVALID_IDENTIFIER,
|
|
350
|
+
message: `${labelPrefix}anchorColumn: ${ac.value}`,
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
const lc = resolveStringSpec(spec.lookupColumn, params, `${labelPrefix}lookupColumn`);
|
|
354
|
+
if (!lc.ok)
|
|
355
|
+
return lc;
|
|
356
|
+
if (!IDENT.test(lc.value)) {
|
|
357
|
+
return {
|
|
358
|
+
ok: false,
|
|
359
|
+
code: REGISTRY_RESOLVER_CODE.INVALID_IDENTIFIER,
|
|
360
|
+
message: `${labelPrefix}lookupColumn: ${lc.value}`,
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
const pc = resolveStringSpec(spec.lookupPresenceColumn, params, `${labelPrefix}lookupPresenceColumn`);
|
|
364
|
+
if (!pc.ok)
|
|
365
|
+
return pc;
|
|
366
|
+
if (!IDENT.test(pc.value)) {
|
|
367
|
+
return {
|
|
368
|
+
ok: false,
|
|
369
|
+
code: REGISTRY_RESOLVER_CODE.INVALID_IDENTIFIER,
|
|
370
|
+
message: `${labelPrefix}lookupPresenceColumn: ${pc.value}`,
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
const fa = spec.filterEqAnchor ?? [];
|
|
374
|
+
const anchorFilters = [];
|
|
375
|
+
for (let i = 0; i < fa.length; i++) {
|
|
376
|
+
const w = fa[i];
|
|
377
|
+
const col = resolveStringSpec(w.column, params, `${labelPrefix}filterEqAnchor[${i}].column`);
|
|
378
|
+
if (!col.ok)
|
|
379
|
+
return col;
|
|
380
|
+
if (!IDENT.test(col.value)) {
|
|
381
|
+
return {
|
|
382
|
+
ok: false,
|
|
383
|
+
code: REGISTRY_RESOLVER_CODE.INVALID_IDENTIFIER,
|
|
384
|
+
message: `${labelPrefix}filterEqAnchor[${i}].column: ${col.value}`,
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
const val = resolveKeyValue(w.value, params);
|
|
388
|
+
if (!val.ok) {
|
|
389
|
+
return { ok: false, code: val.code, message: `${labelPrefix}filterEqAnchor[${i}]. ${val.message}` };
|
|
390
|
+
}
|
|
391
|
+
anchorFilters.push({ column: col.value, value: val.value });
|
|
392
|
+
}
|
|
393
|
+
const fl = spec.filterEqLookup ?? [];
|
|
394
|
+
const lookupFilters = [];
|
|
395
|
+
for (let i = 0; i < fl.length; i++) {
|
|
396
|
+
const w = fl[i];
|
|
397
|
+
const col = resolveStringSpec(w.column, params, `${labelPrefix}filterEqLookup[${i}].column`);
|
|
398
|
+
if (!col.ok)
|
|
399
|
+
return col;
|
|
400
|
+
if (!IDENT.test(col.value)) {
|
|
401
|
+
return {
|
|
402
|
+
ok: false,
|
|
403
|
+
code: REGISTRY_RESOLVER_CODE.INVALID_IDENTIFIER,
|
|
404
|
+
message: `${labelPrefix}filterEqLookup[${i}].column: ${col.value}`,
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
const val = resolveKeyValue(w.value, params);
|
|
408
|
+
if (!val.ok) {
|
|
409
|
+
return { ok: false, code: val.code, message: `${labelPrefix}filterEqLookup[${i}]. ${val.message}` };
|
|
410
|
+
}
|
|
411
|
+
lookupFilters.push({ column: col.value, value: val.value });
|
|
412
|
+
}
|
|
413
|
+
const anchorNorm = normalizeSortedIdentityEq(anchorFilters, `${labelPrefix}filterEqAnchor: `);
|
|
414
|
+
if (!anchorNorm.ok)
|
|
415
|
+
return anchorNorm;
|
|
416
|
+
const lookupNorm = normalizeSortedIdentityEq(lookupFilters, `${labelPrefix}filterEqLookup: `);
|
|
417
|
+
if (!lookupNorm.ok)
|
|
418
|
+
return lookupNorm;
|
|
419
|
+
return {
|
|
420
|
+
ok: true,
|
|
421
|
+
check: {
|
|
422
|
+
checkKind: "anti_join",
|
|
423
|
+
id: spec.id,
|
|
424
|
+
anchorTable: anchor.value,
|
|
425
|
+
lookupTable: lookup.value,
|
|
426
|
+
anchorColumn: ac.value,
|
|
427
|
+
lookupColumn: lc.value,
|
|
428
|
+
lookupPresenceColumn: pc.value,
|
|
429
|
+
filterEqAnchor: anchorNorm.identityEq,
|
|
430
|
+
filterEqLookup: lookupNorm.identityEq,
|
|
431
|
+
},
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
if (spec.checkKind === "related_exists") {
|
|
435
|
+
const child = resolveTableIdent(spec.childTable, params, `${labelPrefix}childTable`);
|
|
436
|
+
if (!child.ok)
|
|
437
|
+
return child;
|
|
438
|
+
const matchRes = resolveRegistryEqualityList(spec.matchEq, params, labelPrefix);
|
|
439
|
+
if (!matchRes.ok)
|
|
440
|
+
return matchRes;
|
|
441
|
+
return {
|
|
442
|
+
ok: true,
|
|
443
|
+
check: {
|
|
444
|
+
checkKind: "related_exists",
|
|
445
|
+
id: spec.id,
|
|
446
|
+
childTable: child.value,
|
|
447
|
+
matchEq: matchRes.identityEq,
|
|
448
|
+
},
|
|
449
|
+
};
|
|
450
|
+
}
|
|
451
|
+
if (spec.checkKind === "aggregate") {
|
|
452
|
+
const tbl = resolveTableIdent(spec.table, params, `${labelPrefix}table`);
|
|
453
|
+
if (!tbl.ok)
|
|
454
|
+
return tbl;
|
|
455
|
+
let sumColumn;
|
|
456
|
+
if (spec.fn === "SUM") {
|
|
457
|
+
if (!spec.sumColumn) {
|
|
458
|
+
return {
|
|
459
|
+
ok: false,
|
|
460
|
+
code: REGISTRY_RESOLVER_CODE.RELATIONAL_SUM_COLUMN_REQUIRED,
|
|
461
|
+
message: `${labelPrefix}sumColumn required when fn is SUM`,
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
const sc = resolveStringSpec(spec.sumColumn, params, `${labelPrefix}sumColumn`);
|
|
465
|
+
if (!sc.ok)
|
|
466
|
+
return sc;
|
|
467
|
+
if (!IDENT.test(sc.value)) {
|
|
468
|
+
return {
|
|
469
|
+
ok: false,
|
|
470
|
+
code: REGISTRY_RESOLVER_CODE.INVALID_IDENTIFIER,
|
|
471
|
+
message: `${labelPrefix}sumColumn: ${sc.value}`,
|
|
472
|
+
};
|
|
473
|
+
}
|
|
474
|
+
sumColumn = sc.value;
|
|
475
|
+
}
|
|
476
|
+
const whereEq = [];
|
|
477
|
+
for (let i = 0; i < (spec.whereEq?.length ?? 0); i++) {
|
|
478
|
+
const w = spec.whereEq[i];
|
|
479
|
+
const col = resolveStringSpec(w.column, params, `${labelPrefix}whereEq[${i}].column`);
|
|
480
|
+
if (!col.ok)
|
|
481
|
+
return col;
|
|
482
|
+
if (!IDENT.test(col.value)) {
|
|
483
|
+
return {
|
|
484
|
+
ok: false,
|
|
485
|
+
code: REGISTRY_RESOLVER_CODE.INVALID_IDENTIFIER,
|
|
486
|
+
message: `${labelPrefix}whereEq[${i}].column: ${col.value}`,
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
const val = resolveKeyValue(w.value, params);
|
|
490
|
+
if (!val.ok) {
|
|
491
|
+
return { ok: false, code: val.code, message: `${labelPrefix}whereEq[${i}]. ${val.message}` };
|
|
492
|
+
}
|
|
493
|
+
whereEq.push({ column: col.value, value: val.value });
|
|
494
|
+
}
|
|
495
|
+
const exp = resolveExpectNumber(spec.expect.value, params, `${labelPrefix}expect.value`);
|
|
496
|
+
if (!exp.ok)
|
|
497
|
+
return exp;
|
|
498
|
+
return {
|
|
499
|
+
ok: true,
|
|
500
|
+
check: {
|
|
501
|
+
checkKind: "aggregate",
|
|
502
|
+
id: spec.id,
|
|
503
|
+
table: tbl.value,
|
|
504
|
+
fn: spec.fn,
|
|
505
|
+
sumColumn,
|
|
506
|
+
whereEq,
|
|
507
|
+
expectOp: spec.expect.op,
|
|
508
|
+
expectValue: exp.value,
|
|
509
|
+
},
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
const left = resolveTableIdent(spec.leftTable, params, `${labelPrefix}leftTable`);
|
|
513
|
+
if (!left.ok)
|
|
514
|
+
return left;
|
|
515
|
+
const right = resolveTableIdent(spec.rightTable, params, `${labelPrefix}rightTable`);
|
|
516
|
+
if (!right.ok)
|
|
517
|
+
return right;
|
|
518
|
+
const lj = resolveStringSpec(spec.join.leftColumn, params, `${labelPrefix}join.leftColumn`);
|
|
519
|
+
if (!lj.ok)
|
|
520
|
+
return lj;
|
|
521
|
+
if (!IDENT.test(lj.value)) {
|
|
522
|
+
return {
|
|
523
|
+
ok: false,
|
|
524
|
+
code: REGISTRY_RESOLVER_CODE.INVALID_IDENTIFIER,
|
|
525
|
+
message: `${labelPrefix}join.leftColumn: ${lj.value}`,
|
|
526
|
+
};
|
|
527
|
+
}
|
|
528
|
+
const rj = resolveStringSpec(spec.join.rightColumn, params, `${labelPrefix}join.rightColumn`);
|
|
529
|
+
if (!rj.ok)
|
|
530
|
+
return rj;
|
|
531
|
+
if (!IDENT.test(rj.value)) {
|
|
532
|
+
return {
|
|
533
|
+
ok: false,
|
|
534
|
+
code: REGISTRY_RESOLVER_CODE.INVALID_IDENTIFIER,
|
|
535
|
+
message: `${labelPrefix}join.rightColumn: ${rj.value}`,
|
|
536
|
+
};
|
|
537
|
+
}
|
|
538
|
+
const whereEq = [];
|
|
539
|
+
for (let i = 0; i < (spec.whereEq?.length ?? 0); i++) {
|
|
540
|
+
const w = spec.whereEq[i];
|
|
541
|
+
const col = resolveStringSpec(w.column, params, `${labelPrefix}whereEq[${i}].column`);
|
|
542
|
+
if (!col.ok)
|
|
543
|
+
return col;
|
|
544
|
+
if (!IDENT.test(col.value)) {
|
|
545
|
+
return {
|
|
546
|
+
ok: false,
|
|
547
|
+
code: REGISTRY_RESOLVER_CODE.INVALID_IDENTIFIER,
|
|
548
|
+
message: `${labelPrefix}whereEq[${i}].column: ${col.value}`,
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
const val = resolveKeyValue(w.value, params);
|
|
552
|
+
if (!val.ok) {
|
|
553
|
+
return { ok: false, code: val.code, message: `${labelPrefix}whereEq[${i}]. ${val.message}` };
|
|
554
|
+
}
|
|
555
|
+
whereEq.push({ side: w.tableSide, column: col.value, value: val.value });
|
|
556
|
+
}
|
|
557
|
+
const exp = resolveExpectNumber(spec.expect.value, params, `${labelPrefix}expect.value`);
|
|
558
|
+
if (!exp.ok)
|
|
559
|
+
return exp;
|
|
560
|
+
return {
|
|
561
|
+
ok: true,
|
|
562
|
+
check: {
|
|
563
|
+
checkKind: "join_count",
|
|
564
|
+
id: spec.id,
|
|
565
|
+
leftTable: left.value,
|
|
566
|
+
rightTable: right.value,
|
|
567
|
+
leftJoinColumn: lj.value,
|
|
568
|
+
rightJoinColumn: rj.value,
|
|
569
|
+
whereEq,
|
|
570
|
+
expectOp: spec.expect.op,
|
|
571
|
+
expectValue: exp.value,
|
|
572
|
+
},
|
|
573
|
+
};
|
|
574
|
+
}
|
|
575
|
+
export function renderIntendedEffect(template, params) {
|
|
576
|
+
return template.replace(/\{(\/[^{}]+)\}/g, (_, ptr) => {
|
|
577
|
+
const v = getPointer(params, ptr);
|
|
578
|
+
if (v === undefined)
|
|
579
|
+
return "MISSING";
|
|
580
|
+
return JSON.stringify(v);
|
|
581
|
+
});
|
|
582
|
+
}
|
|
583
|
+
export function resolveVerificationRequest(entry, params) {
|
|
584
|
+
const v = entry.verification;
|
|
585
|
+
if (v.kind === "sql_row") {
|
|
586
|
+
const row = resolveSqlRowSpec(params, v, "");
|
|
587
|
+
if (!row.ok)
|
|
588
|
+
return row;
|
|
589
|
+
return { ok: true, verificationKind: "sql_row", request: row.request };
|
|
590
|
+
}
|
|
591
|
+
if (v.kind === "sql_row_absent") {
|
|
592
|
+
const absent = resolveSqlRowAbsentSpec(params, v, "");
|
|
593
|
+
if (!absent.ok)
|
|
594
|
+
return absent;
|
|
595
|
+
return { ok: true, verificationKind: "sql_row_absent", request: absent.request };
|
|
596
|
+
}
|
|
597
|
+
if (v.kind === "sql_relational") {
|
|
598
|
+
const seen = new Set();
|
|
599
|
+
const checks = [];
|
|
600
|
+
for (const item of v.checks) {
|
|
601
|
+
if (seen.has(item.id)) {
|
|
602
|
+
return {
|
|
603
|
+
ok: false,
|
|
604
|
+
code: REGISTRY_RESOLVER_CODE.DUPLICATE_EFFECT_ID,
|
|
605
|
+
message: `Duplicate effect id in registry: ${item.id}`,
|
|
606
|
+
};
|
|
607
|
+
}
|
|
608
|
+
seen.add(item.id);
|
|
609
|
+
const r = resolveSqlRelationalCheck(params, item, `checks[${item.id}].`);
|
|
610
|
+
if (!r.ok)
|
|
611
|
+
return r;
|
|
612
|
+
checks.push(r.check);
|
|
613
|
+
}
|
|
614
|
+
checks.sort((a, b) => compareUtf16Id(a.id, b.id));
|
|
615
|
+
return { ok: true, verificationKind: "sql_relational", checks };
|
|
616
|
+
}
|
|
617
|
+
if (v.kind !== "sql_effects") {
|
|
618
|
+
return {
|
|
619
|
+
ok: false,
|
|
620
|
+
code: REGISTRY_RESOLVER_CODE.UNSUPPORTED_VERIFICATION_KIND,
|
|
621
|
+
message: "unsupported verification kind",
|
|
622
|
+
};
|
|
623
|
+
}
|
|
624
|
+
const seen = new Set();
|
|
625
|
+
const effects = [];
|
|
626
|
+
for (const item of v.effects) {
|
|
627
|
+
if (seen.has(item.id)) {
|
|
628
|
+
return {
|
|
629
|
+
ok: false,
|
|
630
|
+
code: REGISTRY_RESOLVER_CODE.DUPLICATE_EFFECT_ID,
|
|
631
|
+
message: `Duplicate effect id in registry: ${item.id}`,
|
|
632
|
+
};
|
|
633
|
+
}
|
|
634
|
+
seen.add(item.id);
|
|
635
|
+
const { id, ...spec } = item;
|
|
636
|
+
const row = resolveSqlRowSpec(params, spec, `effects[${id}].`);
|
|
637
|
+
if (!row.ok)
|
|
638
|
+
return row;
|
|
639
|
+
effects.push({ id, request: row.request });
|
|
640
|
+
}
|
|
641
|
+
effects.sort((a, b) => compareUtf16Id(a.id, b.id));
|
|
642
|
+
return { ok: true, verificationKind: "sql_effects", effects };
|
|
643
|
+
}
|
|
644
|
+
export function buildRegistryMap(entries) {
|
|
645
|
+
const m = new Map();
|
|
646
|
+
for (const e of entries) {
|
|
647
|
+
if (m.has(e.toolId)) {
|
|
648
|
+
throw new TruthLayerError(CLI_OPERATIONAL_CODES.REGISTRY_DUPLICATE_TOOL_ID, `Duplicate toolId in registry: ${e.toolId}`);
|
|
649
|
+
}
|
|
650
|
+
m.set(e.toolId, e);
|
|
651
|
+
}
|
|
652
|
+
return m;
|
|
653
|
+
}
|
|
654
|
+
//# sourceMappingURL=resolveExpectation.js.map
|