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,195 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const { readFileSync } = require("node:fs");
|
|
4
|
+
const { join } = require("node:path");
|
|
5
|
+
const Ajv = require("ajv");
|
|
6
|
+
const addFormats = require("ajv-formats");
|
|
7
|
+
|
|
8
|
+
const PLACEHOLDER_KEYS = [
|
|
9
|
+
["{{ORIGIN}}", "ORIGIN"],
|
|
10
|
+
["{{ACQUISITION_PATH}}", "ACQUISITION_PATH"],
|
|
11
|
+
["{{HERO_TITLE}}", "HERO_TITLE"],
|
|
12
|
+
["{{HERO_SUBTITLE}}", "HERO_SUBTITLE"],
|
|
13
|
+
["{{VISITOR_PROBLEM_ANSWER}}", "VISITOR_PROBLEM_ANSWER"],
|
|
14
|
+
["{{TERMINAL_TITLE}}", "TERMINAL_TITLE"],
|
|
15
|
+
["{{TERMINAL_TRANSCRIPT}}", "TERMINAL_TRANSCRIPT"],
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @param {string} root
|
|
20
|
+
*/
|
|
21
|
+
function discoveryPaths(root) {
|
|
22
|
+
return {
|
|
23
|
+
jsonPath: join(root, "config", "discovery-acquisition.json"),
|
|
24
|
+
schemaPath: join(root, "config", "discovery-acquisition.schema.json"),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @param {string} root
|
|
30
|
+
*/
|
|
31
|
+
function loadDiscoveryAcquisition(root) {
|
|
32
|
+
const { jsonPath } = discoveryPaths(root);
|
|
33
|
+
return JSON.parse(readFileSync(jsonPath, "utf8"));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @param {Record<string, unknown>} discovery
|
|
38
|
+
* @param {string} originNormalized
|
|
39
|
+
*/
|
|
40
|
+
function buildDiscoveryFoldBody(discovery, originNormalized) {
|
|
41
|
+
const slug = String(discovery.slug);
|
|
42
|
+
const demo = /** @type {{ title: string; transcript: string }} */ (discovery.shareableTerminalDemo);
|
|
43
|
+
const map = {
|
|
44
|
+
"{{ORIGIN}}": originNormalized,
|
|
45
|
+
"{{ACQUISITION_PATH}}": slug,
|
|
46
|
+
"{{HERO_TITLE}}": String(discovery.heroTitle),
|
|
47
|
+
"{{HERO_SUBTITLE}}": String(discovery.heroSubtitle),
|
|
48
|
+
"{{VISITOR_PROBLEM_ANSWER}}": String(discovery.visitorProblemAnswer),
|
|
49
|
+
"{{TERMINAL_TITLE}}": String(demo.title),
|
|
50
|
+
"{{TERMINAL_TRANSCRIPT}}": String(demo.transcript),
|
|
51
|
+
};
|
|
52
|
+
const lines = discovery.readmeFold.templateLines.map((line) => substituteTemplateLine(String(line), map));
|
|
53
|
+
const body = lines.join("\n");
|
|
54
|
+
const label = String(discovery.homepageAcquisitionCtaLabel);
|
|
55
|
+
const mdLink = `\n\n[${escapeMdLinkText(label)}](${originNormalized}${slug})`;
|
|
56
|
+
const full = body + mdLink;
|
|
57
|
+
const urlInParens = `(${originNormalized}${slug})`;
|
|
58
|
+
if (!full.includes(urlInParens)) {
|
|
59
|
+
throw new Error("discovery-acquisition: fold body must include markdown URL in parentheses");
|
|
60
|
+
}
|
|
61
|
+
return full;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* @param {string} line
|
|
66
|
+
* @param {Record<string, string>} map
|
|
67
|
+
*/
|
|
68
|
+
function substituteTemplateLine(line, map) {
|
|
69
|
+
let out = line;
|
|
70
|
+
for (const [token, _] of PLACEHOLDER_KEYS) {
|
|
71
|
+
if (out.includes(token) && map[token] !== undefined) {
|
|
72
|
+
out = out.split(token).join(map[token]);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
if (out.includes("{{")) {
|
|
76
|
+
throw new Error(`discovery-acquisition: unresolved placeholder in template line: ${line}`);
|
|
77
|
+
}
|
|
78
|
+
return out;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* @param {string} s
|
|
83
|
+
*/
|
|
84
|
+
function escapeMdLinkText(s) {
|
|
85
|
+
return s.replace(/\\/g, "\\\\").replace(/\[/g, "\\[").replace(/\]/g, "\\]");
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* @param {Record<string, unknown>} discovery
|
|
90
|
+
*/
|
|
91
|
+
function validateIndexableGuides(discovery) {
|
|
92
|
+
const guides = /** @type {{ path: string; navLabel: string; problemAnchor: string }[]} */ (
|
|
93
|
+
discovery.indexableGuides
|
|
94
|
+
);
|
|
95
|
+
if (!Array.isArray(guides)) {
|
|
96
|
+
throw new Error("discovery-acquisition: indexableGuides must be an array");
|
|
97
|
+
}
|
|
98
|
+
const paths = guides.map((g) => String(g.path));
|
|
99
|
+
const uniq = new Set(paths);
|
|
100
|
+
if (uniq.size !== paths.length) {
|
|
101
|
+
throw new Error("discovery-acquisition: indexableGuides paths must be unique");
|
|
102
|
+
}
|
|
103
|
+
const demandMoments = /** @type {string[]} */ (discovery.demandMoments);
|
|
104
|
+
for (let k = 0; k < guides.length; k++) {
|
|
105
|
+
const pa = String(guides[k].problemAnchor);
|
|
106
|
+
if (pa.includes("`")) {
|
|
107
|
+
throw new Error("discovery-acquisition: problemAnchor must not contain backtick");
|
|
108
|
+
}
|
|
109
|
+
if (k >= 1) {
|
|
110
|
+
const dm = String(demandMoments[k - 1]);
|
|
111
|
+
if (!dm.includes(pa)) {
|
|
112
|
+
throw new Error(
|
|
113
|
+
`discovery-acquisition: indexableGuides[${k}].problemAnchor must be a substring of demandMoments[${k - 1}]`,
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* @param {string} baseLlms
|
|
122
|
+
* @param {Record<string, unknown>} discovery
|
|
123
|
+
* @param {string} canonicalOrigin
|
|
124
|
+
*/
|
|
125
|
+
function appendDiscoveryLlmsAppendix(baseLlms, discovery, canonicalOrigin) {
|
|
126
|
+
const slug = String(discovery.slug);
|
|
127
|
+
const origin = canonicalOrigin;
|
|
128
|
+
const llms = discovery.llms;
|
|
129
|
+
const bullets = (/** @type {string[]} */ arr) => arr.map((x) => `- ${x}`).join("\n");
|
|
130
|
+
|
|
131
|
+
let out = String(baseLlms).replace(/\s*$/, "") + "\n";
|
|
132
|
+
const guides = /** @type {{ path: string }[] | undefined} */ (discovery.indexableGuides);
|
|
133
|
+
if (Array.isArray(guides) && guides.length > 0) {
|
|
134
|
+
out += "\n## Indexable guides\n";
|
|
135
|
+
for (const g of guides) {
|
|
136
|
+
out += `- ${origin}${String(g.path)}\n`;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
const demo = discovery.shareableTerminalDemo;
|
|
140
|
+
if (demo && typeof demo.title === "string" && typeof demo.transcript === "string") {
|
|
141
|
+
out += `\n## ${demo.title}\n\n\`\`\`text\n${demo.transcript}\n\`\`\`\n`;
|
|
142
|
+
}
|
|
143
|
+
out += "\n## Intent phrases\n";
|
|
144
|
+
out += bullets(llms.intentPhrases) + "\n";
|
|
145
|
+
out += "\n## Not for\n";
|
|
146
|
+
out += bullets(llms.notFor) + "\n";
|
|
147
|
+
out += "\n## Related queries\n";
|
|
148
|
+
out += bullets(llms.relatedQueries) + "\n";
|
|
149
|
+
const moments = /** @type {string[]} */ (discovery.demandMoments);
|
|
150
|
+
out += "\n## When this hurts (search-shaped)\n";
|
|
151
|
+
out += bullets(moments) + "\n";
|
|
152
|
+
out += "\n## Problem framing (shareable)\n";
|
|
153
|
+
out += `- Full page: ${origin}${slug}\n`;
|
|
154
|
+
out += "\n## Visitor problem (canonical answer)\n\n";
|
|
155
|
+
out += String(discovery.visitorProblemAnswer) + "\n";
|
|
156
|
+
return out;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* @param {string} root
|
|
161
|
+
*/
|
|
162
|
+
function validateDiscoveryAcquisition(root) {
|
|
163
|
+
const { jsonPath, schemaPath } = discoveryPaths(root);
|
|
164
|
+
const discovery = JSON.parse(readFileSync(jsonPath, "utf8"));
|
|
165
|
+
const schema = JSON.parse(readFileSync(schemaPath, "utf8"));
|
|
166
|
+
const ajv = new Ajv({ allErrors: true, strict: true });
|
|
167
|
+
addFormats(ajv);
|
|
168
|
+
const validate = ajv.compile(schema);
|
|
169
|
+
if (!validate(discovery)) {
|
|
170
|
+
const msg = ajv.errorsText(validate.errors, { separator: "\n" });
|
|
171
|
+
throw new Error(`discovery-acquisition: schema validation failed:\n${msg}`);
|
|
172
|
+
}
|
|
173
|
+
const anchorsPath = join(root, "config", "public-product-anchors.json");
|
|
174
|
+
const anchors = JSON.parse(readFileSync(anchorsPath, "utf8"));
|
|
175
|
+
const { normalize } = require("./public-product-anchors.cjs");
|
|
176
|
+
const origin = normalize(anchors.productionCanonicalOrigin);
|
|
177
|
+
buildDiscoveryFoldBody(discovery, origin);
|
|
178
|
+
const demo = discovery.shareableTerminalDemo;
|
|
179
|
+
if (demo && String(demo.transcript).includes("```")) {
|
|
180
|
+
throw new Error(
|
|
181
|
+
"discovery-acquisition: shareableTerminalDemo.transcript must not contain markdown fence ```",
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
validateIndexableGuides(discovery);
|
|
185
|
+
return discovery;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
module.exports = {
|
|
189
|
+
loadDiscoveryAcquisition,
|
|
190
|
+
buildDiscoveryFoldBody,
|
|
191
|
+
appendDiscoveryLlmsAppendix,
|
|
192
|
+
validateDiscoveryAcquisition,
|
|
193
|
+
validateIndexableGuides,
|
|
194
|
+
discoveryPaths,
|
|
195
|
+
};
|
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const { readFileSync } = require("node:fs");
|
|
4
|
+
const { join } = require("node:path");
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Same origin normalization as public-product-anchors.cjs (duplicated to avoid circular require).
|
|
8
|
+
* @param {string} s
|
|
9
|
+
*/
|
|
10
|
+
function normalizeOrigin(s) {
|
|
11
|
+
const t = String(s).trim();
|
|
12
|
+
if (!t) throw new Error("normalizeOrigin: empty origin");
|
|
13
|
+
const u = new URL(t);
|
|
14
|
+
return u.origin;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** @type {const} */
|
|
18
|
+
const DISCOVERY_LLM_BRANCH = "main";
|
|
19
|
+
|
|
20
|
+
/** @type {const} */
|
|
21
|
+
const PR_MARKER_LINE = "<!-- agentskeptic-discovery:v1 -->";
|
|
22
|
+
|
|
23
|
+
/** @type {const} */
|
|
24
|
+
const PR_MARKER_LINE_LEGACY = "<!-- workflow-verifier-discovery:v1 -->";
|
|
25
|
+
|
|
26
|
+
const MAX_SUMMARY_UTF8_BYTES = 65536;
|
|
27
|
+
const MAX_PR_BODY_UTF8_BYTES = 10240;
|
|
28
|
+
const STDERR_TAIL_LINES = 20;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @param {string} gitRepositoryUrl
|
|
32
|
+
* @returns {{ owner: string, repo: string }}
|
|
33
|
+
*/
|
|
34
|
+
function parseGithubRepoFromUrl(gitRepositoryUrl) {
|
|
35
|
+
const u = String(gitRepositoryUrl);
|
|
36
|
+
const m = u.match(/github\.com\/([^/]+)\/([^/#?]+)/i);
|
|
37
|
+
if (!m) {
|
|
38
|
+
throw new Error("discovery-payload: cannot parse owner/repo from gitRepositoryUrl");
|
|
39
|
+
}
|
|
40
|
+
const repo = m[2].replace(/\.git$/i, "");
|
|
41
|
+
return { owner: m[1], repo };
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @param {string} s
|
|
46
|
+
*/
|
|
47
|
+
function utf8ByteLength(s) {
|
|
48
|
+
return Buffer.byteLength(s, "utf8");
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @param {string} label
|
|
53
|
+
* @param {string} s
|
|
54
|
+
* @param {number} maxBytes
|
|
55
|
+
*/
|
|
56
|
+
function assertUtf8ByteLength(label, s, maxBytes) {
|
|
57
|
+
const n = utf8ByteLength(s);
|
|
58
|
+
if (n > maxBytes) {
|
|
59
|
+
throw new Error(`${label}: UTF-8 length ${n} exceeds max ${maxBytes}`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* CRLF → LF, trim trailing whitespace/newlines, exactly one trailing LF.
|
|
65
|
+
* @param {string} s
|
|
66
|
+
*/
|
|
67
|
+
function normalizeDiscoveryText(s) {
|
|
68
|
+
let t = String(s).replace(/\r\n/g, "\n").replace(/\r/g, "\n");
|
|
69
|
+
t = t.replace(/\s+$/, "");
|
|
70
|
+
return `${t}\n`;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* @param {string} text
|
|
75
|
+
* @param {number} n
|
|
76
|
+
*/
|
|
77
|
+
function tailLines(text, n) {
|
|
78
|
+
const lines = normalizeDiscoveryText(text)
|
|
79
|
+
.replace(/\n$/, "")
|
|
80
|
+
.split("\n");
|
|
81
|
+
if (lines.length === 1 && lines[0] === "") return [];
|
|
82
|
+
const k = Math.max(0, Math.min(n, lines.length));
|
|
83
|
+
return lines.slice(lines.length - k);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* @param {string} root
|
|
88
|
+
*/
|
|
89
|
+
function buildDiscoveryPayload(root) {
|
|
90
|
+
const discoveryLib = require("./discovery-acquisition.lib.cjs");
|
|
91
|
+
discoveryLib.validateDiscoveryAcquisition(root);
|
|
92
|
+
const discovery = discoveryLib.loadDiscoveryAcquisition(root);
|
|
93
|
+
const anchorsPath = join(root, "config", "public-product-anchors.json");
|
|
94
|
+
const anchors = JSON.parse(readFileSync(anchorsPath, "utf8"));
|
|
95
|
+
const canonicalOrigin = normalizeOrigin(anchors.productionCanonicalOrigin);
|
|
96
|
+
const integrateUrl = `${canonicalOrigin}/integrate`;
|
|
97
|
+
const openapiSelfCanonical = `${canonicalOrigin}/openapi-commercial-v1.yaml`;
|
|
98
|
+
const { owner, repo } = parseGithubRepoFromUrl(anchors.gitRepositoryUrl);
|
|
99
|
+
const llmsRaw = `https://raw.githubusercontent.com/${owner}/${repo}/refs/heads/${DISCOVERY_LLM_BRANCH}/llms.txt`;
|
|
100
|
+
const llmsBlob = `https://github.com/${owner}/${repo}/blob/${DISCOVERY_LLM_BRANCH}/llms.txt`;
|
|
101
|
+
const openapiRaw = `https://raw.githubusercontent.com/${owner}/${repo}/refs/heads/${DISCOVERY_LLM_BRANCH}/schemas/openapi-commercial-v1.yaml`;
|
|
102
|
+
const llms = /** @type {{ intentPhrases: string[]; notFor: string[]; relatedQueries: string[] }} */ (
|
|
103
|
+
discovery.llms
|
|
104
|
+
);
|
|
105
|
+
const demo = /** @type {{ title: string; transcript: string }} */ (discovery.shareableTerminalDemo);
|
|
106
|
+
return {
|
|
107
|
+
schemaVersion: 1,
|
|
108
|
+
identityOneLiner: String(anchors.identityOneLiner),
|
|
109
|
+
llmBranch: DISCOVERY_LLM_BRANCH,
|
|
110
|
+
links: {
|
|
111
|
+
site: `${canonicalOrigin}/`,
|
|
112
|
+
integrate: integrateUrl,
|
|
113
|
+
openapiCanonical: openapiSelfCanonical,
|
|
114
|
+
openapiRaw,
|
|
115
|
+
repo: String(anchors.gitRepositoryUrl),
|
|
116
|
+
npm: String(anchors.npmPackageUrl),
|
|
117
|
+
llmsRaw,
|
|
118
|
+
llmsBlob,
|
|
119
|
+
},
|
|
120
|
+
appendix: {
|
|
121
|
+
slug: String(discovery.slug),
|
|
122
|
+
visitorProblemAnswer: String(discovery.visitorProblemAnswer),
|
|
123
|
+
intentPhrases: llms.intentPhrases.map(String),
|
|
124
|
+
notFor: llms.notFor.map(String),
|
|
125
|
+
relatedQueries: llms.relatedQueries.map(String),
|
|
126
|
+
demandMoments: /** @type {string[]} */ (discovery.demandMoments).map(String),
|
|
127
|
+
indexableGuides: /** @type {unknown} */ (discovery.indexableGuides),
|
|
128
|
+
shareableTerminalDemo: {
|
|
129
|
+
title: String(demo.title),
|
|
130
|
+
transcript: String(demo.transcript),
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* @param {Record<string, unknown>} payload
|
|
138
|
+
*/
|
|
139
|
+
function discoveryObjectFromAppendix(payload) {
|
|
140
|
+
const ap = /** @type {{ slug: string; visitorProblemAnswer: string; intentPhrases: string[]; notFor: string[]; relatedQueries: string[]; demandMoments: string[]; indexableGuides?: { path: string; navLabel: string; problemAnchor: string }[]; shareableTerminalDemo?: { title: string; transcript: string } }} */ (
|
|
141
|
+
payload.appendix
|
|
142
|
+
);
|
|
143
|
+
const out = {
|
|
144
|
+
slug: ap.slug,
|
|
145
|
+
visitorProblemAnswer: ap.visitorProblemAnswer,
|
|
146
|
+
demandMoments: ap.demandMoments,
|
|
147
|
+
llms: {
|
|
148
|
+
intentPhrases: ap.intentPhrases,
|
|
149
|
+
notFor: ap.notFor,
|
|
150
|
+
relatedQueries: ap.relatedQueries,
|
|
151
|
+
},
|
|
152
|
+
};
|
|
153
|
+
if (ap.shareableTerminalDemo) {
|
|
154
|
+
Object.assign(out, { shareableTerminalDemo: ap.shareableTerminalDemo });
|
|
155
|
+
}
|
|
156
|
+
if (Array.isArray(ap.indexableGuides)) {
|
|
157
|
+
Object.assign(out, { indexableGuides: ap.indexableGuides });
|
|
158
|
+
}
|
|
159
|
+
return out;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* @param {Record<string, unknown>} payload
|
|
164
|
+
*/
|
|
165
|
+
function renderLlmsTextFromPayload(payload) {
|
|
166
|
+
if (payload.schemaVersion !== 1) throw new Error("discovery-payload: unsupported schemaVersion");
|
|
167
|
+
const links = /** @type {Record<string, string>} */ (payload.links);
|
|
168
|
+
const anchorsLike = {
|
|
169
|
+
identityOneLiner: payload.identityOneLiner,
|
|
170
|
+
gitRepositoryUrl: links.repo,
|
|
171
|
+
npmPackageUrl: links.npm,
|
|
172
|
+
};
|
|
173
|
+
const canonicalOrigin = links.site.replace(/\/$/, "");
|
|
174
|
+
const integrateUrl = links.integrate;
|
|
175
|
+
const openapiSelfCanonical = links.openapiCanonical;
|
|
176
|
+
const lines = [
|
|
177
|
+
"# AgentSkeptic",
|
|
178
|
+
"",
|
|
179
|
+
"## Summary",
|
|
180
|
+
String(payload.identityOneLiner),
|
|
181
|
+
"",
|
|
182
|
+
"## Primary links",
|
|
183
|
+
`- Canonical site: ${links.site}`,
|
|
184
|
+
`- First-run integration: ${integrateUrl}`,
|
|
185
|
+
`- OpenAPI (canonical): ${openapiSelfCanonical}`,
|
|
186
|
+
`- OpenAPI (repo raw): ${links.openapiRaw}`,
|
|
187
|
+
`- Source repository: ${links.repo}`,
|
|
188
|
+
`- npm package: ${links.npm}`,
|
|
189
|
+
`- llms.txt (repo raw): ${links.llmsRaw}`,
|
|
190
|
+
"",
|
|
191
|
+
];
|
|
192
|
+
const base = lines.join("\n");
|
|
193
|
+
const { appendDiscoveryLlmsAppendix } = require("./discovery-acquisition.lib.cjs");
|
|
194
|
+
const synthetic = discoveryObjectFromAppendix(payload);
|
|
195
|
+
const raw = appendDiscoveryLlmsAppendix(base, synthetic, canonicalOrigin);
|
|
196
|
+
return normalizeDiscoveryText(raw);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* @param {Record<string, unknown>} payload
|
|
201
|
+
*/
|
|
202
|
+
function renderCiSummaryMarkdownFromPayload(payload) {
|
|
203
|
+
if (payload.schemaVersion !== 1) throw new Error("discovery-payload: unsupported schemaVersion");
|
|
204
|
+
const L = /** @type {Record<string, string>} */ (payload.links);
|
|
205
|
+
const lines = [
|
|
206
|
+
"## AgentSkeptic",
|
|
207
|
+
"",
|
|
208
|
+
String(payload.identityOneLiner),
|
|
209
|
+
"",
|
|
210
|
+
"- Canonical site: " + L.site,
|
|
211
|
+
"- Integrate: " + L.integrate,
|
|
212
|
+
"- OpenAPI: " + L.openapiCanonical,
|
|
213
|
+
"- OpenAPI (repo raw): " + L.openapiRaw,
|
|
214
|
+
"- Repository: " + L.repo,
|
|
215
|
+
"- npm: " + L.npm,
|
|
216
|
+
"- llms.txt (raw): " + L.llmsRaw,
|
|
217
|
+
"- llms.txt (blob): " + L.llmsBlob,
|
|
218
|
+
"",
|
|
219
|
+
];
|
|
220
|
+
const out = lines.join("\n");
|
|
221
|
+
assertUtf8ByteLength("ci_summary_markdown", out, MAX_SUMMARY_UTF8_BYTES);
|
|
222
|
+
return normalizeDiscoveryText(out);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* @param {string} stderrText
|
|
227
|
+
*/
|
|
228
|
+
function formatStderrBlock(stderrText) {
|
|
229
|
+
const trimmed = String(stderrText).trim();
|
|
230
|
+
if (!trimmed) {
|
|
231
|
+
return "## CLI stderr (last 20 lines)\n\n_(no stderr)_\n";
|
|
232
|
+
}
|
|
233
|
+
const tail = tailLines(trimmed, STDERR_TAIL_LINES);
|
|
234
|
+
const body = tail.join("\n");
|
|
235
|
+
return `## CLI stderr (last ${STDERR_TAIL_LINES} lines)\n\n\`\`\`text\n${body}\n\`\`\`\n`;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Assemble PR body: header → optional verdict → stderr → footer → marker.
|
|
240
|
+
* Truncates stderr block from the start only until UTF-8 length ≤ max.
|
|
241
|
+
*
|
|
242
|
+
* @param {Record<string, unknown>} payload
|
|
243
|
+
* @param {{ stderrText: string; workflowStdoutText: string }} capture
|
|
244
|
+
*/
|
|
245
|
+
function renderCiPrBodyFromPayload(payload, capture) {
|
|
246
|
+
if (payload.schemaVersion !== 1) throw new Error("discovery-payload: unsupported schemaVersion");
|
|
247
|
+
const L = /** @type {Record<string, string>} */ (payload.links);
|
|
248
|
+
const stderrText = capture.stderrText ?? "";
|
|
249
|
+
const workflowStdoutText = capture.workflowStdoutText ?? "";
|
|
250
|
+
|
|
251
|
+
const header = `## AgentSkeptic — verification failed
|
|
252
|
+
|
|
253
|
+
${String(payload.identityOneLiner)}
|
|
254
|
+
|
|
255
|
+
`;
|
|
256
|
+
|
|
257
|
+
const verdictTrim = String(workflowStdoutText).trim();
|
|
258
|
+
const oneLine =
|
|
259
|
+
verdictTrim.length > 0 ? verdictTrim.split("\n")[0].slice(0, 500) : "";
|
|
260
|
+
const verdictSection = oneLine
|
|
261
|
+
? ["## Verification stdout (first line)", "", "```", oneLine, "```", ""].join("\n")
|
|
262
|
+
: "";
|
|
263
|
+
|
|
264
|
+
let stderrBlock = formatStderrBlock(stderrText);
|
|
265
|
+
|
|
266
|
+
const footer = [
|
|
267
|
+
"---",
|
|
268
|
+
"",
|
|
269
|
+
"- " + L.site,
|
|
270
|
+
"- " + L.integrate,
|
|
271
|
+
"- " + L.repo,
|
|
272
|
+
"",
|
|
273
|
+
PR_MARKER_LINE,
|
|
274
|
+
"",
|
|
275
|
+
].join("\n");
|
|
276
|
+
|
|
277
|
+
function assemble(verdict, sb) {
|
|
278
|
+
const raw = header + verdict + sb + footer;
|
|
279
|
+
return normalizeDiscoveryText(raw);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
let body = assemble(verdictSection, stderrBlock);
|
|
283
|
+
if (utf8ByteLength(body) <= MAX_PR_BODY_UTF8_BYTES) {
|
|
284
|
+
return body;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
const stderrLines = stderrText.trim() ? tailLines(stderrText, STDERR_TAIL_LINES) : [];
|
|
288
|
+
for (let drop = 1; drop <= stderrLines.length; drop++) {
|
|
289
|
+
const shortened = stderrLines.slice(drop);
|
|
290
|
+
const inner = shortened.length ? shortened.join("\n") : "";
|
|
291
|
+
stderrBlock = inner
|
|
292
|
+
? `## CLI stderr (last ${STDERR_TAIL_LINES} lines)\n\n\`\`\`text\n${inner}\n\`\`\`\n`
|
|
293
|
+
: "## CLI stderr (last 20 lines)\n\n_(no stderr)_\n";
|
|
294
|
+
body = assemble(verdictSection, stderrBlock);
|
|
295
|
+
if (utf8ByteLength(body) <= MAX_PR_BODY_UTF8_BYTES) return body;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
stderrBlock = "## CLI stderr (last 20 lines)\n\n_(no stderr)_\n";
|
|
299
|
+
body = assemble(verdictSection, stderrBlock);
|
|
300
|
+
if (utf8ByteLength(body) <= MAX_PR_BODY_UTF8_BYTES) return body;
|
|
301
|
+
|
|
302
|
+
if (verdictSection) {
|
|
303
|
+
body = assemble("", stderrBlock);
|
|
304
|
+
if (utf8ByteLength(body) <= MAX_PR_BODY_UTF8_BYTES) return body;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
throw new Error(
|
|
308
|
+
`discovery-payload: PR body still exceeds ${MAX_PR_BODY_UTF8_BYTES} bytes after truncation`,
|
|
309
|
+
);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* GitHub list issue comments returns ascending creation time.
|
|
314
|
+
* Pick the newest comment whose body includes the marker.
|
|
315
|
+
* @param {Array<{ id: number; body?: string | null }>} comments
|
|
316
|
+
* @param {string} marker
|
|
317
|
+
* @returns {{ action: 'create' } | { action: 'update'; id: number }}
|
|
318
|
+
*/
|
|
319
|
+
function selectPrCommentUpsert(comments, marker) {
|
|
320
|
+
const withMarker = comments.filter((c) => {
|
|
321
|
+
const b = String(c.body ?? "");
|
|
322
|
+
return b.includes(marker) || b.includes(PR_MARKER_LINE_LEGACY);
|
|
323
|
+
});
|
|
324
|
+
if (withMarker.length === 0) return { action: "create" };
|
|
325
|
+
const newest = withMarker[withMarker.length - 1];
|
|
326
|
+
return { action: "update", id: newest.id };
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
module.exports = {
|
|
330
|
+
DISCOVERY_LLM_BRANCH,
|
|
331
|
+
PR_MARKER_LINE,
|
|
332
|
+
PR_MARKER_LINE_LEGACY,
|
|
333
|
+
MAX_SUMMARY_UTF8_BYTES,
|
|
334
|
+
MAX_PR_BODY_UTF8_BYTES,
|
|
335
|
+
STDERR_TAIL_LINES,
|
|
336
|
+
buildDiscoveryPayload,
|
|
337
|
+
normalizeDiscoveryText,
|
|
338
|
+
utf8ByteLength,
|
|
339
|
+
assertUtf8ByteLength,
|
|
340
|
+
tailLines,
|
|
341
|
+
renderLlmsTextFromPayload,
|
|
342
|
+
renderCiSummaryMarkdownFromPayload,
|
|
343
|
+
renderCiPrBodyFromPayload,
|
|
344
|
+
parseGithubRepoFromUrl,
|
|
345
|
+
selectPrCommentUpsert,
|
|
346
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { createRequire } from "node:module";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
|
|
7
|
+
const require = createRequire(import.meta.url);
|
|
8
|
+
const {
|
|
9
|
+
renderCiSummaryMarkdownFromPayload,
|
|
10
|
+
renderCiPrBodyFromPayload,
|
|
11
|
+
} = require("./discovery-payload.lib.cjs");
|
|
12
|
+
|
|
13
|
+
function usage() {
|
|
14
|
+
return `Usage:
|
|
15
|
+
node scripts/render-discovery-ci.mjs summary
|
|
16
|
+
node scripts/render-discovery-ci.mjs pr_body --stderr-file PATH --workflow-stdout-file PATH
|
|
17
|
+
|
|
18
|
+
Environment:
|
|
19
|
+
AS_REPO_ROOT Root of installed agentskeptic package (preferred)
|
|
20
|
+
WFV_REPO_ROOT Legacy alias for AS_REPO_ROOT (default: parent of scripts/)
|
|
21
|
+
`;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function resolveRoot() {
|
|
25
|
+
const e = process.env.AS_REPO_ROOT || process.env.WFV_REPO_ROOT;
|
|
26
|
+
if (e && String(e).trim()) return path.resolve(String(e).trim());
|
|
27
|
+
return path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function loadPayload(root) {
|
|
31
|
+
const p = path.join(root, "dist", "discovery-payload-v1.json");
|
|
32
|
+
const raw = readFileSync(p, "utf8");
|
|
33
|
+
const payload = JSON.parse(raw);
|
|
34
|
+
if (payload.schemaVersion !== 1) {
|
|
35
|
+
console.error("render-discovery-ci: discovery-payload-v1.json schemaVersion must be 1");
|
|
36
|
+
process.exit(2);
|
|
37
|
+
}
|
|
38
|
+
return payload;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function main() {
|
|
42
|
+
const argv = process.argv.slice(2);
|
|
43
|
+
if (argv.length < 1) {
|
|
44
|
+
console.error(usage());
|
|
45
|
+
process.exit(2);
|
|
46
|
+
}
|
|
47
|
+
const mode = argv[0];
|
|
48
|
+
if (mode !== "summary" && mode !== "pr_body") {
|
|
49
|
+
console.error(usage());
|
|
50
|
+
process.exit(2);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const root = resolveRoot();
|
|
54
|
+
let payload;
|
|
55
|
+
try {
|
|
56
|
+
payload = loadPayload(root);
|
|
57
|
+
} catch (e) {
|
|
58
|
+
console.error(
|
|
59
|
+
e instanceof Error ? e.message : e,
|
|
60
|
+
"\nrender-discovery-ci: failed to read dist/discovery-payload-v1.json — run build first.",
|
|
61
|
+
);
|
|
62
|
+
process.exit(2);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (mode === "summary") {
|
|
66
|
+
if (argv.length !== 1) {
|
|
67
|
+
console.error(usage());
|
|
68
|
+
process.exit(2);
|
|
69
|
+
}
|
|
70
|
+
process.stdout.write(renderCiSummaryMarkdownFromPayload(payload));
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
let stderrPath = "";
|
|
75
|
+
let stdoutPath = "";
|
|
76
|
+
for (let i = 1; i < argv.length; i++) {
|
|
77
|
+
if (argv[i] === "--stderr-file" && argv[i + 1]) {
|
|
78
|
+
stderrPath = argv[++i];
|
|
79
|
+
} else if (argv[i] === "--workflow-stdout-file" && argv[i + 1]) {
|
|
80
|
+
stdoutPath = argv[++i];
|
|
81
|
+
} else {
|
|
82
|
+
console.error(usage());
|
|
83
|
+
process.exit(2);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if (!stderrPath || !stdoutPath) {
|
|
87
|
+
console.error(usage());
|
|
88
|
+
process.exit(2);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const stderrText = readFileSync(stderrPath, "utf8");
|
|
92
|
+
const workflowStdoutText = readFileSync(stdoutPath, "utf8");
|
|
93
|
+
process.stdout.write(
|
|
94
|
+
renderCiPrBodyFromPayload(payload, { stderrText, workflowStdoutText }),
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
try {
|
|
99
|
+
main();
|
|
100
|
+
} catch (e) {
|
|
101
|
+
console.error(e instanceof Error ? e.message : e);
|
|
102
|
+
process.exit(1);
|
|
103
|
+
}
|