tracegrove 0.0.0-stage → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +588 -2
- package/conformance/coordination-vectors.json +377 -0
- package/dist/adapters/browser/capabilities.d.ts +45 -0
- package/dist/adapters/browser/capabilities.js +14 -0
- package/dist/adapters/browser/capabilities.js.map +1 -0
- package/dist/adapters/browser/driver.d.ts +45 -0
- package/dist/adapters/browser/driver.js +295 -0
- package/dist/adapters/browser/driver.js.map +1 -0
- package/dist/adapters/browser/session.d.ts +21 -0
- package/dist/adapters/browser/session.js +87 -0
- package/dist/adapters/browser/session.js.map +1 -0
- package/dist/adapters/http/capabilities.d.ts +2 -0
- package/dist/adapters/http/capabilities.js +21 -0
- package/dist/adapters/http/capabilities.js.map +1 -0
- package/dist/adapters/http/driver.d.ts +55 -0
- package/dist/adapters/http/driver.js +125 -0
- package/dist/adapters/http/driver.js.map +1 -0
- package/dist/adapters/job/capabilities.d.ts +45 -0
- package/dist/adapters/job/capabilities.js +8 -0
- package/dist/adapters/job/capabilities.js.map +1 -0
- package/dist/adapters/job/driver.d.ts +26 -0
- package/dist/adapters/job/driver.js +110 -0
- package/dist/adapters/job/driver.js.map +1 -0
- package/dist/adapters/job/types.d.ts +9 -0
- package/dist/adapters/job/types.js +2 -0
- package/dist/adapters/job/types.js.map +1 -0
- package/dist/adapters/mcp/capabilities.d.ts +46 -0
- package/dist/adapters/mcp/capabilities.js +17 -0
- package/dist/adapters/mcp/capabilities.js.map +1 -0
- package/dist/adapters/mcp/driver.d.ts +10 -0
- package/dist/adapters/mcp/driver.js +83 -0
- package/dist/adapters/mcp/driver.js.map +1 -0
- package/dist/adapters/poll.d.ts +12 -0
- package/dist/adapters/poll.js +31 -0
- package/dist/adapters/poll.js.map +1 -0
- package/dist/authoring/activity.d.ts +17 -0
- package/dist/authoring/activity.js +18 -0
- package/dist/authoring/activity.js.map +1 -0
- package/dist/authoring/agent.d.ts +70 -0
- package/dist/authoring/agent.js +268 -0
- package/dist/authoring/agent.js.map +1 -0
- package/dist/authoring/appLaunch.d.ts +7 -0
- package/dist/authoring/appLaunch.js +32 -0
- package/dist/authoring/appLaunch.js.map +1 -0
- package/dist/authoring/appLocation.d.ts +2 -0
- package/dist/authoring/appLocation.js +5 -0
- package/dist/authoring/appLocation.js.map +1 -0
- package/dist/authoring/browser.d.ts +15 -0
- package/dist/authoring/browser.js +20 -0
- package/dist/authoring/browser.js.map +1 -0
- package/dist/authoring/compile.d.ts +47 -0
- package/dist/authoring/compile.js +508 -0
- package/dist/authoring/compile.js.map +1 -0
- package/dist/authoring/discover.d.ts +43 -0
- package/dist/authoring/discover.js +149 -0
- package/dist/authoring/discover.js.map +1 -0
- package/dist/authoring/environmentTemplates.d.ts +3 -0
- package/dist/authoring/environmentTemplates.js +24 -0
- package/dist/authoring/environmentTemplates.js.map +1 -0
- package/dist/authoring/heal.d.ts +108 -0
- package/dist/authoring/heal.js +723 -0
- package/dist/authoring/heal.js.map +1 -0
- package/dist/authoring/index.d.ts +14 -0
- package/dist/authoring/index.js +15 -0
- package/dist/authoring/index.js.map +1 -0
- package/dist/authoring/init.d.ts +21 -0
- package/dist/authoring/init.js +141 -0
- package/dist/authoring/init.js.map +1 -0
- package/dist/authoring/localSettings.d.ts +33 -0
- package/dist/authoring/localSettings.js +31 -0
- package/dist/authoring/localSettings.js.map +1 -0
- package/dist/authoring/media.d.ts +10 -0
- package/dist/authoring/media.js +37 -0
- package/dist/authoring/media.js.map +1 -0
- package/dist/authoring/module.d.ts +2 -0
- package/dist/authoring/module.js +38 -0
- package/dist/authoring/module.js.map +1 -0
- package/dist/authoring/run.d.ts +74 -0
- package/dist/authoring/run.js +242 -0
- package/dist/authoring/run.js.map +1 -0
- package/dist/authoring/runSource.d.ts +6 -0
- package/dist/authoring/runSource.js +24 -0
- package/dist/authoring/runSource.js.map +1 -0
- package/dist/authoring/savedRun.d.ts +13 -0
- package/dist/authoring/savedRun.js +94 -0
- package/dist/authoring/savedRun.js.map +1 -0
- package/dist/authoring/schema.d.ts +574 -0
- package/dist/authoring/schema.js +147 -0
- package/dist/authoring/schema.js.map +1 -0
- package/dist/authoring/snapshotSource.d.ts +13 -0
- package/dist/authoring/snapshotSource.js +41 -0
- package/dist/authoring/snapshotSource.js.map +1 -0
- package/dist/authoring/sourceSelection.d.ts +34 -0
- package/dist/authoring/sourceSelection.js +13 -0
- package/dist/authoring/sourceSelection.js.map +1 -0
- package/dist/authoring/sources.d.ts +5 -0
- package/dist/authoring/sources.js +65 -0
- package/dist/authoring/sources.js.map +1 -0
- package/dist/authoring/status.d.ts +48 -0
- package/dist/authoring/status.js +100 -0
- package/dist/authoring/status.js.map +1 -0
- package/dist/authoring/typed.d.ts +6 -0
- package/dist/authoring/typed.js +5 -0
- package/dist/authoring/typed.js.map +1 -0
- package/dist/authoring/ui.d.ts +10 -0
- package/dist/authoring/ui.js +486 -0
- package/dist/authoring/ui.js.map +1 -0
- package/dist/authoring/uiPage.d.ts +1 -0
- package/dist/authoring/uiPage.js +358 -0
- package/dist/authoring/uiPage.js.map +1 -0
- package/dist/authoring/uiSourceControls.d.ts +2 -0
- package/dist/authoring/uiSourceControls.js +41 -0
- package/dist/authoring/uiSourceControls.js.map +1 -0
- package/dist/authoring/verificationSource.d.ts +41 -0
- package/dist/authoring/verificationSource.js +46 -0
- package/dist/authoring/verificationSource.js.map +1 -0
- package/dist/authoring/workspace.d.ts +33 -0
- package/dist/authoring/workspace.js +58 -0
- package/dist/authoring/workspace.js.map +1 -0
- package/dist/cli/arguments.d.ts +288 -0
- package/dist/cli/arguments.js +121 -0
- package/dist/cli/arguments.js.map +1 -0
- package/dist/cli/cleanup.d.ts +18 -0
- package/dist/cli/cleanup.js +40 -0
- package/dist/cli/cleanup.js.map +1 -0
- package/dist/cli/doctor.d.ts +51 -0
- package/dist/cli/doctor.js +118 -0
- package/dist/cli/doctor.js.map +1 -0
- package/dist/cli/errors.d.ts +2 -0
- package/dist/cli/errors.js +84 -0
- package/dist/cli/errors.js.map +1 -0
- package/dist/cli/jsonFile.d.ts +2 -0
- package/dist/cli/jsonFile.js +15 -0
- package/dist/cli/jsonFile.js.map +1 -0
- package/dist/cli/main.d.ts +2 -0
- package/dist/cli/main.js +603 -0
- package/dist/cli/main.js.map +1 -0
- package/dist/cli/render.d.ts +22 -0
- package/dist/cli/render.js +150 -0
- package/dist/cli/render.js.map +1 -0
- package/dist/cli/samples/catalog.d.ts +10 -0
- package/dist/cli/samples/catalog.js +3 -0
- package/dist/cli/samples/catalog.js.map +1 -0
- package/dist/cli/samples/write.d.ts +5 -0
- package/dist/cli/samples/write.js +64 -0
- package/dist/cli/samples/write.js.map +1 -0
- package/dist/cli/source.d.ts +41 -0
- package/dist/cli/source.js +59 -0
- package/dist/cli/source.js.map +1 -0
- package/dist/core/activationDecision.d.ts +153 -0
- package/dist/core/activationDecision.js +34 -0
- package/dist/core/activationDecision.js.map +1 -0
- package/dist/core/artifacts.d.ts +18 -0
- package/dist/core/artifacts.js +79 -0
- package/dist/core/artifacts.js.map +1 -0
- package/dist/core/atomicFiles.d.ts +9 -0
- package/dist/core/atomicFiles.js +76 -0
- package/dist/core/atomicFiles.js.map +1 -0
- package/dist/core/boundedFile.d.ts +2 -0
- package/dist/core/boundedFile.js +28 -0
- package/dist/core/boundedFile.js.map +1 -0
- package/dist/core/bundle.d.ts +77 -0
- package/dist/core/bundle.js +375 -0
- package/dist/core/bundle.js.map +1 -0
- package/dist/core/bundleArchive.d.ts +10 -0
- package/dist/core/bundleArchive.js +47 -0
- package/dist/core/bundleArchive.js.map +1 -0
- package/dist/core/bundleEvidence.d.ts +12 -0
- package/dist/core/bundleEvidence.js +169 -0
- package/dist/core/bundleEvidence.js.map +1 -0
- package/dist/core/bundleExport.d.ts +12 -0
- package/dist/core/bundleExport.js +36 -0
- package/dist/core/bundleExport.js.map +1 -0
- package/dist/core/bundleFiles.d.ts +5 -0
- package/dist/core/bundleFiles.js +47 -0
- package/dist/core/bundleFiles.js.map +1 -0
- package/dist/core/bundlePaths.d.ts +2 -0
- package/dist/core/bundlePaths.js +7 -0
- package/dist/core/bundlePaths.js.map +1 -0
- package/dist/core/bundleSnapshot.d.ts +26 -0
- package/dist/core/bundleSnapshot.js +71 -0
- package/dist/core/bundleSnapshot.js.map +1 -0
- package/dist/core/capabilityBoundary.d.ts +1452 -0
- package/dist/core/capabilityBoundary.js +361 -0
- package/dist/core/capabilityBoundary.js.map +1 -0
- package/dist/core/capabilityLifecycle.d.ts +366 -0
- package/dist/core/capabilityLifecycle.js +79 -0
- package/dist/core/capabilityLifecycle.js.map +1 -0
- package/dist/core/cleanup.d.ts +35 -0
- package/dist/core/cleanup.js +71 -0
- package/dist/core/cleanup.js.map +1 -0
- package/dist/core/cleanupActions.d.ts +5 -0
- package/dist/core/cleanupActions.js +15 -0
- package/dist/core/cleanupActions.js.map +1 -0
- package/dist/core/cleanupAttestation.d.ts +23 -0
- package/dist/core/cleanupAttestation.js +57 -0
- package/dist/core/cleanupAttestation.js.map +1 -0
- package/dist/core/clock.d.ts +4 -0
- package/dist/core/clock.js +14 -0
- package/dist/core/clock.js.map +1 -0
- package/dist/core/compiler.d.ts +19 -0
- package/dist/core/compiler.js +200 -0
- package/dist/core/compiler.js.map +1 -0
- package/dist/core/controller.d.ts +7 -0
- package/dist/core/controller.js +132 -0
- package/dist/core/controller.js.map +1 -0
- package/dist/core/coordination.d.ts +72 -0
- package/dist/core/coordination.js +118 -0
- package/dist/core/coordination.js.map +1 -0
- package/dist/core/corpus.d.ts +60 -0
- package/dist/core/corpus.js +216 -0
- package/dist/core/corpus.js.map +1 -0
- package/dist/core/deadline.d.ts +12 -0
- package/dist/core/deadline.js +38 -0
- package/dist/core/deadline.js.map +1 -0
- package/dist/core/deliveryJournal.d.ts +37 -0
- package/dist/core/deliveryJournal.js +85 -0
- package/dist/core/deliveryJournal.js.map +1 -0
- package/dist/core/environmentPreflight.d.ts +14 -0
- package/dist/core/environmentPreflight.js +179 -0
- package/dist/core/environmentPreflight.js.map +1 -0
- package/dist/core/errors.d.ts +22 -0
- package/dist/core/errors.js +29 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/events.d.ts +14 -0
- package/dist/core/events.js +37 -0
- package/dist/core/events.js.map +1 -0
- package/dist/core/executionInspection.d.ts +90 -0
- package/dist/core/executionInspection.js +31 -0
- package/dist/core/executionInspection.js.map +1 -0
- package/dist/core/executionOwnership.d.ts +72 -0
- package/dist/core/executionOwnership.js +82 -0
- package/dist/core/executionOwnership.js.map +1 -0
- package/dist/core/executionPreparation.d.ts +362 -0
- package/dist/core/executionPreparation.js +93 -0
- package/dist/core/executionPreparation.js.map +1 -0
- package/dist/core/executionReadback.d.ts +15 -0
- package/dist/core/executionReadback.js +21 -0
- package/dist/core/executionReadback.js.map +1 -0
- package/dist/core/executor.d.ts +46 -0
- package/dist/core/executor.js +616 -0
- package/dist/core/executor.js.map +1 -0
- package/dist/core/frozenBundle.d.ts +314 -0
- package/dist/core/frozenBundle.js +24 -0
- package/dist/core/frozenBundle.js.map +1 -0
- package/dist/core/fsDurability.d.ts +2 -0
- package/dist/core/fsDurability.js +12 -0
- package/dist/core/fsDurability.js.map +1 -0
- package/dist/core/generators.d.ts +4 -0
- package/dist/core/generators.js +71 -0
- package/dist/core/generators.js.map +1 -0
- package/dist/core/gitSnapshot.d.ts +63 -0
- package/dist/core/gitSnapshot.js +55 -0
- package/dist/core/gitSnapshot.js.map +1 -0
- package/dist/core/gitSources.d.ts +29 -0
- package/dist/core/gitSources.js +97 -0
- package/dist/core/gitSources.js.map +1 -0
- package/dist/core/ledger.d.ts +38 -0
- package/dist/core/ledger.js +169 -0
- package/dist/core/ledger.js.map +1 -0
- package/dist/core/ledgerInspection.d.ts +18 -0
- package/dist/core/ledgerInspection.js +66 -0
- package/dist/core/ledgerInspection.js.map +1 -0
- package/dist/core/ledgerRecords.d.ts +23 -0
- package/dist/core/ledgerRecords.js +29 -0
- package/dist/core/ledgerRecords.js.map +1 -0
- package/dist/core/localActivationState.d.ts +260 -0
- package/dist/core/localActivationState.js +49 -0
- package/dist/core/localActivationState.js.map +1 -0
- package/dist/core/localPromotionState.d.ts +387 -0
- package/dist/core/localPromotionState.js +22 -0
- package/dist/core/localPromotionState.js.map +1 -0
- package/dist/core/localQualificationResults.d.ts +39 -0
- package/dist/core/localQualificationResults.js +160 -0
- package/dist/core/localQualificationResults.js.map +1 -0
- package/dist/core/localReviewStore.d.ts +28 -0
- package/dist/core/localReviewStore.js +167 -0
- package/dist/core/localReviewStore.js.map +1 -0
- package/dist/core/localScenarioActivation.d.ts +6 -0
- package/dist/core/localScenarioActivation.js +70 -0
- package/dist/core/localScenarioActivation.js.map +1 -0
- package/dist/core/localScenarioOwner.d.ts +20 -0
- package/dist/core/localScenarioOwner.js +2 -0
- package/dist/core/localScenarioOwner.js.map +1 -0
- package/dist/core/localScenarioPromotion.d.ts +9 -0
- package/dist/core/localScenarioPromotion.js +49 -0
- package/dist/core/localScenarioPromotion.js.map +1 -0
- package/dist/core/localScenarioState.d.ts +2297 -0
- package/dist/core/localScenarioState.js +117 -0
- package/dist/core/localScenarioState.js.map +1 -0
- package/dist/core/localScenarioStore.d.ts +838 -0
- package/dist/core/localScenarioStore.js +218 -0
- package/dist/core/localScenarioStore.js.map +1 -0
- package/dist/core/localScenarioStructure.d.ts +4 -0
- package/dist/core/localScenarioStructure.js +52 -0
- package/dist/core/localScenarioStructure.js.map +1 -0
- package/dist/core/localStructureState.d.ts +2 -0
- package/dist/core/localStructureState.js +22 -0
- package/dist/core/localStructureState.js.map +1 -0
- package/dist/core/lookup.d.ts +662 -0
- package/dist/core/lookup.js +55 -0
- package/dist/core/lookup.js.map +1 -0
- package/dist/core/ownership.d.ts +3 -0
- package/dist/core/ownership.js +24 -0
- package/dist/core/ownership.js.map +1 -0
- package/dist/core/planInspection.d.ts +108 -0
- package/dist/core/planInspection.js +44 -0
- package/dist/core/planInspection.js.map +1 -0
- package/dist/core/planner.d.ts +14 -0
- package/dist/core/planner.js +261 -0
- package/dist/core/planner.js.map +1 -0
- package/dist/core/qualification.d.ts +26 -0
- package/dist/core/qualification.js +58 -0
- package/dist/core/qualification.js.map +1 -0
- package/dist/core/qualificationBundle.d.ts +6 -0
- package/dist/core/qualificationBundle.js +51 -0
- package/dist/core/qualificationBundle.js.map +1 -0
- package/dist/core/qualificationExecution.d.ts +879 -0
- package/dist/core/qualificationExecution.js +54 -0
- package/dist/core/qualificationExecution.js.map +1 -0
- package/dist/core/recoveryStatus.d.ts +6 -0
- package/dist/core/recoveryStatus.js +123 -0
- package/dist/core/recoveryStatus.js.map +1 -0
- package/dist/core/reducer.d.ts +56 -0
- package/dist/core/reducer.js +355 -0
- package/dist/core/reducer.js.map +1 -0
- package/dist/core/replayAssessment.d.ts +15 -0
- package/dist/core/replayAssessment.js +78 -0
- package/dist/core/replayAssessment.js.map +1 -0
- package/dist/core/replayEvidence.d.ts +7 -0
- package/dist/core/replayEvidence.js +58 -0
- package/dist/core/replayEvidence.js.map +1 -0
- package/dist/core/repositorySelectionEvidence.d.ts +3 -0
- package/dist/core/repositorySelectionEvidence.js +58 -0
- package/dist/core/repositorySelectionEvidence.js.map +1 -0
- package/dist/core/rerun.d.ts +3 -0
- package/dist/core/rerun.js +24 -0
- package/dist/core/rerun.js.map +1 -0
- package/dist/core/resultSink.d.ts +52 -0
- package/dist/core/resultSink.js +120 -0
- package/dist/core/resultSink.js.map +1 -0
- package/dist/core/review.d.ts +22 -0
- package/dist/core/review.js +65 -0
- package/dist/core/review.js.map +1 -0
- package/dist/core/runnerCapabilities.d.ts +22 -0
- package/dist/core/runnerCapabilities.js +44 -0
- package/dist/core/runnerCapabilities.js.map +1 -0
- package/dist/core/scenario.d.ts +32 -0
- package/dist/core/scenario.js +119 -0
- package/dist/core/scenario.js.map +1 -0
- package/dist/core/scenarioActivation.d.ts +16 -0
- package/dist/core/scenarioActivation.js +47 -0
- package/dist/core/scenarioActivation.js.map +1 -0
- package/dist/core/scenarioStructure.d.ts +400 -0
- package/dist/core/scenarioStructure.js +72 -0
- package/dist/core/scenarioStructure.js.map +1 -0
- package/dist/core/snapshotEvidence.d.ts +3 -0
- package/dist/core/snapshotEvidence.js +37 -0
- package/dist/core/snapshotEvidence.js.map +1 -0
- package/dist/core/snapshotRepository.d.ts +48 -0
- package/dist/core/snapshotRepository.js +47 -0
- package/dist/core/snapshotRepository.js.map +1 -0
- package/dist/core/source-analysis.d.ts +18 -0
- package/dist/core/source-analysis.js +99 -0
- package/dist/core/source-analysis.js.map +1 -0
- package/dist/core/source-citation.d.ts +53 -0
- package/dist/core/source-citation.js +59 -0
- package/dist/core/source-citation.js.map +1 -0
- package/dist/core/sourcePromotion.d.ts +929 -0
- package/dist/core/sourcePromotion.js +92 -0
- package/dist/core/sourcePromotion.js.map +1 -0
- package/dist/core/sourceReviewEvidence.d.ts +271 -0
- package/dist/core/sourceReviewEvidence.js +24 -0
- package/dist/core/sourceReviewEvidence.js.map +1 -0
- package/dist/core/targetObservation.d.ts +3 -0
- package/dist/core/targetObservation.js +26 -0
- package/dist/core/targetObservation.js.map +1 -0
- package/dist/hosts/launchTemplates.d.ts +2 -0
- package/dist/hosts/launchTemplates.js +5 -0
- package/dist/hosts/launchTemplates.js.map +1 -0
- package/dist/hosts/local.d.ts +17 -0
- package/dist/hosts/local.js +311 -0
- package/dist/hosts/local.js.map +1 -0
- package/dist/hosts/localSupervisor.d.ts +1 -0
- package/dist/hosts/localSupervisor.js +115 -0
- package/dist/hosts/localSupervisor.js.map +1 -0
- package/dist/hosts/mock.d.ts +4 -0
- package/dist/hosts/mock.js +82 -0
- package/dist/hosts/mock.js.map +1 -0
- package/dist/hosts/pinnedArguments.d.ts +3 -0
- package/dist/hosts/pinnedArguments.js +39 -0
- package/dist/hosts/pinnedArguments.js.map +1 -0
- package/dist/hosts/runtime.d.ts +5 -0
- package/dist/hosts/runtime.js +60 -0
- package/dist/hosts/runtime.js.map +1 -0
- package/dist/hosts/sourceIdentity.d.ts +54 -0
- package/dist/hosts/sourceIdentity.js +27 -0
- package/dist/hosts/sourceIdentity.js.map +1 -0
- package/dist/hosts/types.d.ts +39 -0
- package/dist/hosts/types.js +2 -0
- package/dist/hosts/types.js.map +1 -0
- package/dist/index.d.ts +56 -0
- package/dist/index.js +52 -0
- package/dist/index.js.map +1 -0
- package/dist/integrations/awr/attachment.d.ts +34 -0
- package/dist/integrations/awr/attachment.js +120 -0
- package/dist/integrations/awr/attachment.js.map +1 -0
- package/dist/integrations/awr/attachmentContracts.d.ts +273 -0
- package/dist/integrations/awr/attachmentContracts.js +39 -0
- package/dist/integrations/awr/attachmentContracts.js.map +1 -0
- package/dist/integrations/awr/attachmentHttp.d.ts +9 -0
- package/dist/integrations/awr/attachmentHttp.js +19 -0
- package/dist/integrations/awr/attachmentHttp.js.map +1 -0
- package/dist/integrations/awr/cli.d.ts +7 -0
- package/dist/integrations/awr/cli.js +43 -0
- package/dist/integrations/awr/cli.js.map +1 -0
- package/dist/integrations/awr/contracts.d.ts +54 -0
- package/dist/integrations/awr/contracts.js +33 -0
- package/dist/integrations/awr/contracts.js.map +1 -0
- package/dist/integrations/awr/http.d.ts +8 -0
- package/dist/integrations/awr/http.js +23 -0
- package/dist/integrations/awr/http.js.map +1 -0
- package/dist/integrations/awr/index.d.ts +7 -0
- package/dist/integrations/awr/index.js +8 -0
- package/dist/integrations/awr/index.js.map +1 -0
- package/dist/integrations/awr/jsonHttp.d.ts +15 -0
- package/dist/integrations/awr/jsonHttp.js +69 -0
- package/dist/integrations/awr/jsonHttp.js.map +1 -0
- package/dist/integrations/awr/outbox.d.ts +28 -0
- package/dist/integrations/awr/outbox.js +88 -0
- package/dist/integrations/awr/outbox.js.map +1 -0
- package/dist/integrations/awr/projection.d.ts +4 -0
- package/dist/integrations/awr/projection.js +54 -0
- package/dist/integrations/awr/projection.js.map +1 -0
- package/dist/protocol/canonical.d.ts +41 -0
- package/dist/protocol/canonical.js +114 -0
- package/dist/protocol/canonical.js.map +1 -0
- package/dist/protocol/index.d.ts +9620 -0
- package/dist/protocol/index.js +185 -0
- package/dist/protocol/index.js.map +1 -0
- package/dist/protocol/primitives.d.ts +63 -0
- package/dist/protocol/primitives.js +46 -0
- package/dist/protocol/primitives.js.map +1 -0
- package/dist/protocol/schemas/browser.d.ts +153 -0
- package/dist/protocol/schemas/browser.js +29 -0
- package/dist/protocol/schemas/browser.js.map +1 -0
- package/dist/protocol/schemas/capability.d.ts +2126 -0
- package/dist/protocol/schemas/capability.js +165 -0
- package/dist/protocol/schemas/capability.js.map +1 -0
- package/dist/protocol/schemas/capabilityLifecycle.d.ts +509 -0
- package/dist/protocol/schemas/capabilityLifecycle.js +47 -0
- package/dist/protocol/schemas/capabilityLifecycle.js.map +1 -0
- package/dist/protocol/schemas/cleanup.d.ts +109 -0
- package/dist/protocol/schemas/cleanup.js +59 -0
- package/dist/protocol/schemas/cleanup.js.map +1 -0
- package/dist/protocol/schemas/cli.d.ts +121 -0
- package/dist/protocol/schemas/cli.js +24 -0
- package/dist/protocol/schemas/cli.js.map +1 -0
- package/dist/protocol/schemas/config.d.ts +59 -0
- package/dist/protocol/schemas/config.js +32 -0
- package/dist/protocol/schemas/config.js.map +1 -0
- package/dist/protocol/schemas/corpus.d.ts +36 -0
- package/dist/protocol/schemas/corpus.js +10 -0
- package/dist/protocol/schemas/corpus.js.map +1 -0
- package/dist/protocol/schemas/definitions.d.ts +3409 -0
- package/dist/protocol/schemas/definitions.js +431 -0
- package/dist/protocol/schemas/definitions.js.map +1 -0
- package/dist/protocol/schemas/evidenceProjection.d.ts +146 -0
- package/dist/protocol/schemas/evidenceProjection.js +18 -0
- package/dist/protocol/schemas/evidenceProjection.js.map +1 -0
- package/dist/protocol/schemas/execution.d.ts +3179 -0
- package/dist/protocol/schemas/execution.js +500 -0
- package/dist/protocol/schemas/execution.js.map +1 -0
- package/dist/protocol/schemas/gitSources.d.ts +330 -0
- package/dist/protocol/schemas/gitSources.js +32 -0
- package/dist/protocol/schemas/gitSources.js.map +1 -0
- package/dist/protocol/schemas/mcp.d.ts +24 -0
- package/dist/protocol/schemas/mcp.js +16 -0
- package/dist/protocol/schemas/mcp.js.map +1 -0
- package/dist/protocol/schemas/nativeJob.d.ts +106 -0
- package/dist/protocol/schemas/nativeJob.js +16 -0
- package/dist/protocol/schemas/nativeJob.js.map +1 -0
- package/dist/protocol/schemas/portableEnvironment.d.ts +1256 -0
- package/dist/protocol/schemas/portableEnvironment.js +108 -0
- package/dist/protocol/schemas/portableEnvironment.js.map +1 -0
- package/dist/protocol/schemas/promotion.d.ts +132 -0
- package/dist/protocol/schemas/promotion.js +9 -0
- package/dist/protocol/schemas/promotion.js.map +1 -0
- package/dist/protocol/schemas/protocol.d.ts +146 -0
- package/dist/protocol/schemas/protocol.js +25 -0
- package/dist/protocol/schemas/protocol.js.map +1 -0
- package/dist/protocol/schemas/recoveryStatus.d.ts +88 -0
- package/dist/protocol/schemas/recoveryStatus.js +20 -0
- package/dist/protocol/schemas/recoveryStatus.js.map +1 -0
- package/dist/protocol/schemas/resultSink.d.ts +80 -0
- package/dist/protocol/schemas/resultSink.js +14 -0
- package/dist/protocol/schemas/resultSink.js.map +1 -0
- package/dist/protocol/schemas/review.d.ts +248 -0
- package/dist/protocol/schemas/review.js +45 -0
- package/dist/protocol/schemas/review.js.map +1 -0
- package/dist/protocol/schemas/scenario.d.ts +810 -0
- package/dist/protocol/schemas/scenario.js +53 -0
- package/dist/protocol/schemas/scenario.js.map +1 -0
- package/dist/protocol/schemas/source.d.ts +300 -0
- package/dist/protocol/schemas/source.js +25 -0
- package/dist/protocol/schemas/source.js.map +1 -0
- package/dist/source/git.d.ts +36 -0
- package/dist/source/git.js +159 -0
- package/dist/source/git.js.map +1 -0
- package/dist/source/gitObjectProof.d.ts +12 -0
- package/dist/source/gitObjectProof.js +115 -0
- package/dist/source/gitObjectProof.js.map +1 -0
- package/dist/source/snapshotPaths.d.ts +2 -0
- package/dist/source/snapshotPaths.js +24 -0
- package/dist/source/snapshotPaths.js.map +1 -0
- package/dist/source/snapshotTree.d.ts +15 -0
- package/dist/source/snapshotTree.js +79 -0
- package/dist/source/snapshotTree.js.map +1 -0
- package/docs/architecture.md +126 -0
- package/docs/awr-delivery.md +102 -0
- package/docs/browser-driver.md +148 -0
- package/docs/cleanup-followups.md +74 -0
- package/docs/developer-ux.md +315 -0
- package/docs/examples/portable-environments/alongside_runner.json +199 -0
- package/docs/examples/portable-environments/external_staging.json +183 -0
- package/docs/git-object-proof.md +100 -0
- package/docs/git-source-resolution.md +133 -0
- package/docs/images/ui-run.png +0 -0
- package/docs/local-execution-recovery.md +55 -0
- package/docs/local-review-store.md +13 -0
- package/docs/local-scenario-store.md +91 -0
- package/docs/mcp-driver.md +87 -0
- package/docs/native-jobs.md +96 -0
- package/docs/portable-environments.md +155 -0
- package/docs/qualification-registration.md +58 -0
- package/docs/qualification-results.md +59 -0
- package/docs/replay-assessment.md +17 -0
- package/docs/result-sink.md +87 -0
- package/docs/scenario-activation.md +54 -0
- package/docs/scenario-structure.md +58 -0
- package/docs/source-promotion.md +104 -0
- package/docs/source-review.md +21 -0
- package/docs/verified-bundles.md +175 -0
- package/docs/work-report-attachment.md +127 -0
- package/package.json +45 -4
- package/samples/django-notes/manage.py +8 -0
- package/samples/django-notes/notes/__init__.py +0 -0
- package/samples/django-notes/notes/auth.py +14 -0
- package/samples/django-notes/notes/migrations/0001_initial.py +19 -0
- package/samples/django-notes/notes/migrations/__init__.py +0 -0
- package/samples/django-notes/notes/models.py +13 -0
- package/samples/django-notes/notes/views.py +33 -0
- package/samples/django-notes/notesite/__init__.py +0 -0
- package/samples/django-notes/notesite/settings.py +17 -0
- package/samples/django-notes/notesite/urls.py +9 -0
- package/samples/django-notes/requirements.txt +1 -0
- package/samples/django-notes/tracegrove/notes/crud.flow.yaml +27 -0
- package/samples/django-notes/tracegrove.config.yaml +7 -0
- package/samples/fastapi-notes/app/__init__.py +0 -0
- package/samples/fastapi-notes/app/main.py +69 -0
- package/samples/fastapi-notes/requirements.txt +2 -0
- package/samples/fastapi-notes/tracegrove/notes/crud.flow.yaml +27 -0
- package/samples/fastapi-notes/tracegrove.config.yaml +8 -0
- package/samples/notes-api/app/app.mjs +67 -0
- package/samples/notes-api/app/http.mjs +16 -0
- package/samples/notes-api/tracegrove/fixtures/existing-note.fixture.yaml +12 -0
- package/samples/notes-api/tracegrove/notes/create-read-delete.flow.yaml +35 -0
- package/samples/notes-api/tracegrove/notes/list.flow.yaml +25 -0
- package/samples/notes-api/tracegrove.config.yaml +15 -0
- package/samples/notes-api/verification/actions/notes.registry.yaml +6 -0
- package/samples/notes-api/verification/auth/host-issued-owner.yaml +6 -0
- package/samples/notes-api/verification/cases/notes.contract.yaml +51 -0
- package/samples/notes-api/verification/cases/notes.create.yaml +123 -0
- package/samples/notes-api/verification/cases/notes.suite.yaml +5 -0
- package/samples/notes-api/verification/components/notes-api-stub.profile.yaml +8 -0
- package/samples/notes-api/verification/components/notes-api.profile.yaml +15 -0
- package/samples/notes-api/verification/environments/local-notes.yaml +11 -0
- package/samples/notes-api/verification/environments/mock-notes.yaml +11 -0
- package/samples/notes-api/verification/fidelity/full-live-sandbox.yaml +7 -0
- package/samples/notes-api/verification/fidelity/mock-contract.yaml +6 -0
- package/samples/notes-api/verification/fixtures/existing-note.payload.yaml +15 -0
- package/samples/notes-api/verification/fixtures/existing-note.plan.yaml +9 -0
- package/samples/notes-api/verification/fixtures/existing-note.recipe.yaml +29 -0
- package/samples/notes-api/verification/hosts/local-process.yaml +27 -0
- package/samples/notes-api/verification/hosts/mock-loopback.yaml +14 -0
- package/samples/notes-api/verification/mocks/notes.responses.yaml +5 -0
- package/samples/notes-api/verification/personas/owner.yaml +16 -0
- package/samples/notes-api/verification/policies/no-authoring-inference.yaml +10 -0
- package/samples/notes-api/verification/runners/http.yaml +5 -0
- package/samples/notes-api/verification/surfaces/http-api.binding.yaml +11 -0
- package/samples/notes-api/verification/surfaces/http-api.pack.yaml +7 -0
- package/samples/notes-api/verification/workflow.yaml +27 -0
- package/samples/notes-browser/tracegrove/notes/browser.flow.yaml +19 -0
- package/samples/notes-browser/verification/cases/notes.browser.yaml +63 -0
- package/samples/notes-browser/verification/cases/notes.suite.yaml +4 -0
- package/samples/notes-browser/verification/runners/http.yaml +5 -0
- package/samples/notes-browser/verification/surfaces/http-api.binding.yaml +11 -0
- package/samples/notes-browser/verification/surfaces/http-api.pack.yaml +7 -0
- package/samples/notes-django/README.md +21 -0
- package/samples/notes-django/app/django_app.py +119 -0
- package/samples/notes-django/app/requirements.lock +4 -0
- package/samples/notes-mcp/app/mcp.mjs +47 -0
- package/samples/notes-mcp/tracegrove/notes.flow.yaml +20 -0
- package/samples/notes-mcp/tracegrove.config.yaml +13 -0
- package/samples/report-jobs/README.md +30 -0
- package/samples/report-jobs/app/jobs-api.mjs +65 -0
- package/samples/report-jobs/app/native-bridge.mjs +30 -0
- package/samples/report-jobs/app/store.mjs +74 -0
- package/samples/report-jobs/app/worker.mjs +22 -0
- package/samples/report-jobs/tracegrove/fixtures/failed-job.fixture.yaml +12 -0
- package/samples/report-jobs/tracegrove/fixtures/held-job.fixture.yaml +12 -0
- package/samples/report-jobs/tracegrove/fixtures/success-job.fixture.yaml +12 -0
- package/samples/report-jobs/tracegrove/reports/cancellation.flow.yaml +15 -0
- package/samples/report-jobs/tracegrove/reports/completion.flow.yaml +31 -0
- package/samples/report-jobs/tracegrove/reports/failure.flow.yaml +12 -0
- package/samples/report-jobs/tracegrove.config.yaml +10 -0
- package/samples/report-native/README.md +11 -0
- package/samples/report-native/tracegrove/cancellation.flow.yaml +11 -0
- package/samples/report-native/tracegrove/completion.flow.yaml +22 -0
- package/samples/report-native/tracegrove/failure.flow.yaml +7 -0
- package/samples/report-native/tracegrove.config.yaml +11 -0
- package/schema/tracegrove_cli-error_v1.json +156 -0
- package/schema/tracegrove_config_v1.json +233 -0
- package/schema/tracegrove_fixture_v1.json +297 -0
- package/schema/tracegrove_flow_v1.json +960 -0
- package/schema/tracegrove_recovery-status_v1.json +234 -0
- package/schema/tracegrove_run-video_v1.json +25 -0
- package/schema/workflow_action-registry_v1.json +303 -0
- package/schema/workflow_auth-recipe_v1.json +146 -0
- package/schema/workflow_boundary-observation_v1.json +515 -0
- package/schema/workflow_browser-command_v1.json +292 -0
- package/schema/workflow_browser-locator_v1.json +74 -0
- package/schema/workflow_browser-network-observation_v1.json +48 -0
- package/schema/workflow_browser-observation_v1.json +53 -0
- package/schema/workflow_budget-reservation_v1.json +150 -0
- package/schema/workflow_campaign-result_v1.json +382 -0
- package/schema/workflow_capability-artifact-manifest_v1.json +529 -0
- package/schema/workflow_capability-descriptor_v1.json +351 -0
- package/schema/workflow_capability-lifecycle-checkpoint_v1.json +510 -0
- package/schema/workflow_capability-observation_v1.json +1707 -0
- package/schema/workflow_capability-operation_v1.json +3212 -0
- package/schema/workflow_capability-replay-plan_v1.json +1247 -0
- package/schema/workflow_capability-retry-policy_v1.json +39 -0
- package/schema/workflow_capability-retry-state_v1.json +242 -0
- package/schema/workflow_case_v1.json +4222 -0
- package/schema/workflow_change-model_v1.json +614 -0
- package/schema/workflow_cleanup-expectation_v1.json +108 -0
- package/schema/workflow_cleanup-followup_v1.json +145 -0
- package/schema/workflow_component-profile_v1.json +219 -0
- package/schema/workflow_config_v1.json +180 -0
- package/schema/workflow_corpus_v1.json +172 -0
- package/schema/workflow_cost-observation_v1.json +366 -0
- package/schema/workflow_credential-lease_v1.json +222 -0
- package/schema/workflow_effective-config_v1.json +214 -0
- package/schema/workflow_environment-plan_v1.json +445 -0
- package/schema/workflow_environment_v1.json +1827 -0
- package/schema/workflow_evidence-projection_v1.json +636 -0
- package/schema/workflow_execution_v1.json +4086 -0
- package/schema/workflow_fidelity-plan_v1.json +512 -0
- package/schema/workflow_fidelity-profile_v1.json +396 -0
- package/schema/workflow_fixture-manifest_v1.json +918 -0
- package/schema/workflow_fixture-plan_v1.json +594 -0
- package/schema/workflow_git-source-request_v1.json +124 -0
- package/schema/workflow_git-source-resolution_v1.json +660 -0
- package/schema/workflow_git-source-snapshot_v1.json +287 -0
- package/schema/workflow_host-lease_v1.json +321 -0
- package/schema/workflow_host-observation_v1.json +282 -0
- package/schema/workflow_host-plan_v1.json +719 -0
- package/schema/workflow_identity-attestation_v1.json +412 -0
- package/schema/workflow_intelligence-policy_v1.json +153 -0
- package/schema/workflow_logical-payload_v1.json +206 -0
- package/schema/workflow_mcp-tool-call_v1.json +70 -0
- package/schema/workflow_mcp-tool-observation_v1.json +125 -0
- package/schema/workflow_mock-responses_v1.json +185 -0
- package/schema/workflow_native-job-action_v1.json +123 -0
- package/schema/workflow_native-job-observation_v1.json +138 -0
- package/schema/workflow_native-job-ready_v1.json +31 -0
- package/schema/workflow_native-job-request_v1.json +155 -0
- package/schema/workflow_native-job-response_v1.json +125 -0
- package/schema/workflow_ownership_v1.json +116 -0
- package/schema/workflow_persona_v1.json +499 -0
- package/schema/workflow_plan-edit-projection_v1.json +152 -0
- package/schema/workflow_plan-review_v1.json +246 -0
- package/schema/workflow_portable-environment-intent_v1.json +499 -0
- package/schema/workflow_portable-environment-profile_v1.json +1429 -0
- package/schema/workflow_portable-preflight_v1.json +2281 -0
- package/schema/workflow_qualification-admission_v1.json +467 -0
- package/schema/workflow_qualification-intent_v1.json +98 -0
- package/schema/workflow_qualification-policy_v1.json +109 -0
- package/schema/workflow_qualification-round_v1.json +226 -0
- package/schema/workflow_replay-assessment_v1.json +197 -0
- package/schema/workflow_replay-finding_v1.json +147 -0
- package/schema/workflow_request_v1.json +1567 -0
- package/schema/workflow_result-ingest_v1.json +343 -0
- package/schema/workflow_revisions_v1.json +334 -0
- package/schema/workflow_routing-decision_v1.json +482 -0
- package/schema/workflow_runner-capabilities_v1.json +316 -0
- package/schema/workflow_runner-profile_v1.json +119 -0
- package/schema/workflow_runner-protocol_v1_host.json +382 -0
- package/schema/workflow_runner-protocol_v1_plugin.json +491 -0
- package/schema/workflow_scenario-activation-intent_v1.json +346 -0
- package/schema/workflow_scenario-activation_v1.json +562 -0
- package/schema/workflow_scenario-projection_v1.json +221 -0
- package/schema/workflow_scenario-promotion_v1.json +455 -0
- package/schema/workflow_scenario-replay-assessment_v1.json +696 -0
- package/schema/workflow_scenario-revision-token_v1.json +115 -0
- package/schema/workflow_scenario-structure_v1.json +368 -0
- package/schema/workflow_scenario_v1.json +401 -0
- package/schema/workflow_scoped-resource_v1.json +550 -0
- package/schema/workflow_seed-recipe_v1.json +724 -0
- package/schema/workflow_selection_v1.json +1108 -0
- package/schema/workflow_signed-cleanup-followup_v1.json +175 -0
- package/schema/workflow_source-plan_v1.json +756 -0
- package/schema/workflow_source-selection_v1.json +456 -0
- package/schema/workflow_source-validation_v1.json +366 -0
- package/schema/workflow_step-event_v1.json +228 -0
- package/schema/workflow_stream-transcript_v1.json +1030 -0
- package/schema/workflow_suite_v1.json +64 -0
- package/schema/workflow_surface-binding_v1.json +411 -0
- package/schema/workflow_surface-pack_v1.json +159 -0
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
/** Pure lifecycle decisions. No retries, reset, filesystem access or cleanup is performed here. */
|
|
2
|
+
import { type Ref } from '../protocol/index.ts';
|
|
3
|
+
export declare function planCapabilityRetry(policyValue: unknown, stateValue: unknown): {
|
|
4
|
+
decision: "retry" | "stop" | "reconcile";
|
|
5
|
+
reason: string;
|
|
6
|
+
delayMs: number | null;
|
|
7
|
+
priorAttemptRef: {
|
|
8
|
+
id: string;
|
|
9
|
+
revision: string;
|
|
10
|
+
digest: {
|
|
11
|
+
algorithm: "sha256";
|
|
12
|
+
hex: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
retainedArtifactRefs: {
|
|
16
|
+
id: string;
|
|
17
|
+
revision: string;
|
|
18
|
+
digest: {
|
|
19
|
+
algorithm: "sha256";
|
|
20
|
+
hex: string;
|
|
21
|
+
};
|
|
22
|
+
}[];
|
|
23
|
+
};
|
|
24
|
+
/** Resolve inventory against host-owned records. Ambiguity/staleness always needs reconciliation. */
|
|
25
|
+
export declare function planCapabilityTeardown(checkpointValue: unknown, currentValue: unknown, ownedValues: unknown[], now?: number): {
|
|
26
|
+
resourceRef: {
|
|
27
|
+
id: string;
|
|
28
|
+
revision: string;
|
|
29
|
+
digest: {
|
|
30
|
+
algorithm: "sha256";
|
|
31
|
+
hex: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
action: "cleanup" | "reconcile" | "already_confirmed";
|
|
35
|
+
priorEvidenceRefs: {
|
|
36
|
+
id: string;
|
|
37
|
+
revision: string;
|
|
38
|
+
digest: {
|
|
39
|
+
algorithm: "sha256";
|
|
40
|
+
hex: string;
|
|
41
|
+
};
|
|
42
|
+
}[];
|
|
43
|
+
}[];
|
|
44
|
+
/** Artifact paths contain only a content hash and a closed extension; user/domain names never enter them. */
|
|
45
|
+
export declare function capabilityArtifactName(ref: Ref, extension: 'json' | 'jsonl' | 'xml' | 'webm' | 'png' | 'zip' | 'txt'): string;
|
|
46
|
+
export declare function capabilityIdentitySlugs(bindingValue: unknown): {
|
|
47
|
+
scenario: string;
|
|
48
|
+
run: string;
|
|
49
|
+
attempt: string;
|
|
50
|
+
};
|
|
51
|
+
export declare function validateCapabilityArtifactManifest(value: unknown, currentValue: unknown): {
|
|
52
|
+
schemaVersion: "workflow.capability-artifact-manifest/v1";
|
|
53
|
+
binding: {
|
|
54
|
+
campaignId: string;
|
|
55
|
+
executionId: string;
|
|
56
|
+
attemptId: string;
|
|
57
|
+
generation: number;
|
|
58
|
+
requestRef: {
|
|
59
|
+
id: string;
|
|
60
|
+
revision: string;
|
|
61
|
+
digest: {
|
|
62
|
+
algorithm: "sha256";
|
|
63
|
+
hex: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
sourceSelectionRef: {
|
|
67
|
+
id: string;
|
|
68
|
+
revision: string;
|
|
69
|
+
digest: {
|
|
70
|
+
algorithm: "sha256";
|
|
71
|
+
hex: string;
|
|
72
|
+
};
|
|
73
|
+
} | null;
|
|
74
|
+
caseRef: {
|
|
75
|
+
id: string;
|
|
76
|
+
revision: string;
|
|
77
|
+
digest: {
|
|
78
|
+
algorithm: "sha256";
|
|
79
|
+
hex: string;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
personaRef: {
|
|
83
|
+
id: string;
|
|
84
|
+
revision: string;
|
|
85
|
+
digest: {
|
|
86
|
+
algorithm: "sha256";
|
|
87
|
+
hex: string;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
targetRef: {
|
|
91
|
+
id: string;
|
|
92
|
+
revision: string;
|
|
93
|
+
digest: {
|
|
94
|
+
algorithm: "sha256";
|
|
95
|
+
hex: string;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
environmentRef: {
|
|
99
|
+
id: string;
|
|
100
|
+
revision: string;
|
|
101
|
+
digest: {
|
|
102
|
+
algorithm: "sha256";
|
|
103
|
+
hex: string;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
scope: {
|
|
107
|
+
ownerId: string;
|
|
108
|
+
tenantId: string | null;
|
|
109
|
+
visibility: "public" | "owner_private" | "tenant_private";
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
publication: "incomplete" | "committed";
|
|
113
|
+
artifacts: {
|
|
114
|
+
fileName: string;
|
|
115
|
+
artifact: {
|
|
116
|
+
ref: {
|
|
117
|
+
id: string;
|
|
118
|
+
revision: string;
|
|
119
|
+
digest: {
|
|
120
|
+
algorithm: "sha256";
|
|
121
|
+
hex: string;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
mediaType: string;
|
|
125
|
+
byteCount: number;
|
|
126
|
+
producer: {
|
|
127
|
+
adapterId: string;
|
|
128
|
+
adapterVersion: string;
|
|
129
|
+
tool: string;
|
|
130
|
+
toolVersion: string;
|
|
131
|
+
};
|
|
132
|
+
redaction: "not_required" | "applied" | "unavailable";
|
|
133
|
+
redactionPolicyRef: {
|
|
134
|
+
id: string;
|
|
135
|
+
revision: string;
|
|
136
|
+
digest: {
|
|
137
|
+
algorithm: "sha256";
|
|
138
|
+
hex: string;
|
|
139
|
+
};
|
|
140
|
+
} | null;
|
|
141
|
+
};
|
|
142
|
+
}[];
|
|
143
|
+
};
|
|
144
|
+
/** Explicit replay semantics; support must come from the host, never a caller's mode label. */
|
|
145
|
+
export declare function validateCapabilityReplay(value: unknown, supportedModes?: readonly string[]): {
|
|
146
|
+
schemaVersion: "workflow.capability-replay-plan/v1";
|
|
147
|
+
mode: "evidence_playback" | "fixture_rerun" | "recorded_io_rerun" | "workflow_history_replay";
|
|
148
|
+
sourceReceiptRef: {
|
|
149
|
+
id: string;
|
|
150
|
+
revision: string;
|
|
151
|
+
digest: {
|
|
152
|
+
algorithm: "sha256";
|
|
153
|
+
hex: string;
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
sourceBinding: {
|
|
157
|
+
campaignId: string;
|
|
158
|
+
executionId: string;
|
|
159
|
+
attemptId: string;
|
|
160
|
+
generation: number;
|
|
161
|
+
requestRef: {
|
|
162
|
+
id: string;
|
|
163
|
+
revision: string;
|
|
164
|
+
digest: {
|
|
165
|
+
algorithm: "sha256";
|
|
166
|
+
hex: string;
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
sourceSelectionRef: {
|
|
170
|
+
id: string;
|
|
171
|
+
revision: string;
|
|
172
|
+
digest: {
|
|
173
|
+
algorithm: "sha256";
|
|
174
|
+
hex: string;
|
|
175
|
+
};
|
|
176
|
+
} | null;
|
|
177
|
+
caseRef: {
|
|
178
|
+
id: string;
|
|
179
|
+
revision: string;
|
|
180
|
+
digest: {
|
|
181
|
+
algorithm: "sha256";
|
|
182
|
+
hex: string;
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
personaRef: {
|
|
186
|
+
id: string;
|
|
187
|
+
revision: string;
|
|
188
|
+
digest: {
|
|
189
|
+
algorithm: "sha256";
|
|
190
|
+
hex: string;
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
targetRef: {
|
|
194
|
+
id: string;
|
|
195
|
+
revision: string;
|
|
196
|
+
digest: {
|
|
197
|
+
algorithm: "sha256";
|
|
198
|
+
hex: string;
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
environmentRef: {
|
|
202
|
+
id: string;
|
|
203
|
+
revision: string;
|
|
204
|
+
digest: {
|
|
205
|
+
algorithm: "sha256";
|
|
206
|
+
hex: string;
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
scope: {
|
|
210
|
+
ownerId: string;
|
|
211
|
+
tenantId: string | null;
|
|
212
|
+
visibility: "public" | "owner_private" | "tenant_private";
|
|
213
|
+
};
|
|
214
|
+
};
|
|
215
|
+
targetBinding: {
|
|
216
|
+
campaignId: string;
|
|
217
|
+
executionId: string;
|
|
218
|
+
attemptId: string;
|
|
219
|
+
generation: number;
|
|
220
|
+
requestRef: {
|
|
221
|
+
id: string;
|
|
222
|
+
revision: string;
|
|
223
|
+
digest: {
|
|
224
|
+
algorithm: "sha256";
|
|
225
|
+
hex: string;
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
sourceSelectionRef: {
|
|
229
|
+
id: string;
|
|
230
|
+
revision: string;
|
|
231
|
+
digest: {
|
|
232
|
+
algorithm: "sha256";
|
|
233
|
+
hex: string;
|
|
234
|
+
};
|
|
235
|
+
} | null;
|
|
236
|
+
caseRef: {
|
|
237
|
+
id: string;
|
|
238
|
+
revision: string;
|
|
239
|
+
digest: {
|
|
240
|
+
algorithm: "sha256";
|
|
241
|
+
hex: string;
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
personaRef: {
|
|
245
|
+
id: string;
|
|
246
|
+
revision: string;
|
|
247
|
+
digest: {
|
|
248
|
+
algorithm: "sha256";
|
|
249
|
+
hex: string;
|
|
250
|
+
};
|
|
251
|
+
};
|
|
252
|
+
targetRef: {
|
|
253
|
+
id: string;
|
|
254
|
+
revision: string;
|
|
255
|
+
digest: {
|
|
256
|
+
algorithm: "sha256";
|
|
257
|
+
hex: string;
|
|
258
|
+
};
|
|
259
|
+
};
|
|
260
|
+
environmentRef: {
|
|
261
|
+
id: string;
|
|
262
|
+
revision: string;
|
|
263
|
+
digest: {
|
|
264
|
+
algorithm: "sha256";
|
|
265
|
+
hex: string;
|
|
266
|
+
};
|
|
267
|
+
};
|
|
268
|
+
scope: {
|
|
269
|
+
ownerId: string;
|
|
270
|
+
tenantId: string | null;
|
|
271
|
+
visibility: "public" | "owner_private" | "tenant_private";
|
|
272
|
+
};
|
|
273
|
+
} | null;
|
|
274
|
+
sourceCodeRef: {
|
|
275
|
+
id: string;
|
|
276
|
+
revision: string;
|
|
277
|
+
digest: {
|
|
278
|
+
algorithm: "sha256";
|
|
279
|
+
hex: string;
|
|
280
|
+
};
|
|
281
|
+
};
|
|
282
|
+
targetCodeRef: {
|
|
283
|
+
id: string;
|
|
284
|
+
revision: string;
|
|
285
|
+
digest: {
|
|
286
|
+
algorithm: "sha256";
|
|
287
|
+
hex: string;
|
|
288
|
+
};
|
|
289
|
+
};
|
|
290
|
+
compatibilityReviewRef: {
|
|
291
|
+
id: string;
|
|
292
|
+
revision: string;
|
|
293
|
+
digest: {
|
|
294
|
+
algorithm: "sha256";
|
|
295
|
+
hex: string;
|
|
296
|
+
};
|
|
297
|
+
} | null;
|
|
298
|
+
pins: {
|
|
299
|
+
fixtureRef: {
|
|
300
|
+
id: string;
|
|
301
|
+
revision: string;
|
|
302
|
+
digest: {
|
|
303
|
+
algorithm: "sha256";
|
|
304
|
+
hex: string;
|
|
305
|
+
};
|
|
306
|
+
};
|
|
307
|
+
seedRef: {
|
|
308
|
+
id: string;
|
|
309
|
+
revision: string;
|
|
310
|
+
digest: {
|
|
311
|
+
algorithm: "sha256";
|
|
312
|
+
hex: string;
|
|
313
|
+
};
|
|
314
|
+
};
|
|
315
|
+
generatorRef: {
|
|
316
|
+
id: string;
|
|
317
|
+
revision: string;
|
|
318
|
+
digest: {
|
|
319
|
+
algorithm: "sha256";
|
|
320
|
+
hex: string;
|
|
321
|
+
};
|
|
322
|
+
};
|
|
323
|
+
runtimeRef: {
|
|
324
|
+
id: string;
|
|
325
|
+
revision: string;
|
|
326
|
+
digest: {
|
|
327
|
+
algorithm: "sha256";
|
|
328
|
+
hex: string;
|
|
329
|
+
};
|
|
330
|
+
};
|
|
331
|
+
configRef: {
|
|
332
|
+
id: string;
|
|
333
|
+
revision: string;
|
|
334
|
+
digest: {
|
|
335
|
+
algorithm: "sha256";
|
|
336
|
+
hex: string;
|
|
337
|
+
};
|
|
338
|
+
};
|
|
339
|
+
clockMode: "wall" | "frozen" | "engine_virtual";
|
|
340
|
+
clockRef: {
|
|
341
|
+
id: string;
|
|
342
|
+
revision: string;
|
|
343
|
+
digest: {
|
|
344
|
+
algorithm: "sha256";
|
|
345
|
+
hex: string;
|
|
346
|
+
};
|
|
347
|
+
};
|
|
348
|
+
};
|
|
349
|
+
freshFixtureRefs: {
|
|
350
|
+
id: string;
|
|
351
|
+
revision: string;
|
|
352
|
+
digest: {
|
|
353
|
+
algorithm: "sha256";
|
|
354
|
+
hex: string;
|
|
355
|
+
};
|
|
356
|
+
}[];
|
|
357
|
+
historyRef: {
|
|
358
|
+
id: string;
|
|
359
|
+
revision: string;
|
|
360
|
+
digest: {
|
|
361
|
+
algorithm: "sha256";
|
|
362
|
+
hex: string;
|
|
363
|
+
};
|
|
364
|
+
} | null;
|
|
365
|
+
externalEffects: "none" | "declared_isolated";
|
|
366
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/** Pure lifecycle decisions. No retries, reset, filesystem access or cleanup is performed here. */
|
|
2
|
+
import { CapabilityReplayPlan, CapabilityRetryPolicy, CapabilityRetryState, CapabilityLifecycleCheckpoint, CapabilityArtifactManifest, ScopedResource, CapabilityBinding, digestOfValue, sameRef } from "../protocol/index.js";
|
|
3
|
+
import { CapabilityBoundaryError } from "./capabilityBoundary.js";
|
|
4
|
+
const same = (a, b) => digestOfValue(a).hex === digestOfValue(b).hex;
|
|
5
|
+
export function planCapabilityRetry(policyValue, stateValue) {
|
|
6
|
+
const policy = CapabilityRetryPolicy.parse(policyValue);
|
|
7
|
+
const state = CapabilityRetryState.parse(stateValue);
|
|
8
|
+
const result = (decision, reason, delayMs = null) => ({ decision, reason, delayMs,
|
|
9
|
+
priorAttemptRef: structuredClone(state.priorAttemptRef), retainedArtifactRefs: structuredClone(state.retainedArtifactRefs) });
|
|
10
|
+
if (state.effects === 'ambiguous')
|
|
11
|
+
return result('reconcile', 'effect_outcome_ambiguous');
|
|
12
|
+
if (['assertion', 'cancelled', 'unsupported'].includes(state.failure))
|
|
13
|
+
return result('stop', 'failure_not_automatically_retryable');
|
|
14
|
+
if (state.mutating && state.effects === 'acknowledged' && !state.idempotency)
|
|
15
|
+
return result('reconcile', 'idempotency_authority_required');
|
|
16
|
+
if (state.attemptNumber >= policy.maxAttempts || state.requestsUsed >= policy.maxRequests)
|
|
17
|
+
return result('stop', 'attempt_or_request_budget_exhausted');
|
|
18
|
+
const delay = Math.max(policy.baseDelayMs * 2 ** Math.min(state.attemptNumber - 1, 10), state.retryAfterMs ?? 0);
|
|
19
|
+
if (delay > policy.maxDelayMs || state.elapsedMs + delay >= policy.maxElapsedMs || delay >= state.remainingDeadlineMs)
|
|
20
|
+
return result('stop', 'retry_delay_exceeds_budget');
|
|
21
|
+
return result('retry', 'transport_or_setup_retry', delay);
|
|
22
|
+
}
|
|
23
|
+
/** Resolve inventory against host-owned records. Ambiguity/staleness always needs reconciliation. */
|
|
24
|
+
export function planCapabilityTeardown(checkpointValue, currentValue, ownedValues, now = Date.now()) {
|
|
25
|
+
const checkpoint = CapabilityLifecycleCheckpoint.parse(checkpointValue);
|
|
26
|
+
const current = CapabilityBinding.parse(currentValue);
|
|
27
|
+
if (!same(checkpoint.binding, current))
|
|
28
|
+
throw new CapabilityBoundaryError('stale_or_cross_run_cleanup');
|
|
29
|
+
const owned = ownedValues.map(value => ScopedResource.parse(value));
|
|
30
|
+
return checkpoint.inventory.map(item => {
|
|
31
|
+
const resource = owned.find(value => sameRef(value.ref, item.resourceRef));
|
|
32
|
+
const bound = resource && same(resource.binding, current) && sameRef(resource.leaseRef, item.leaseRef) && resource.isolation === 'owned_isolated' && resource.identityRef !== null && Date.parse(resource.expiresAt) > now;
|
|
33
|
+
const action = !bound || ['reserved', 'effect_unacknowledged'].includes(item.state) ? 'reconcile'
|
|
34
|
+
: item.state === 'removed' ? 'already_confirmed' : 'cleanup';
|
|
35
|
+
return { resourceRef: structuredClone(item.resourceRef), action, priorEvidenceRefs: structuredClone(item.evidenceRefs) };
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/** Artifact paths contain only a content hash and a closed extension; user/domain names never enter them. */
|
|
39
|
+
export function capabilityArtifactName(ref, extension) {
|
|
40
|
+
const name = `${ref.digest.hex}.${extension}`;
|
|
41
|
+
if (!/^[a-f0-9]{64}\.(?:json|jsonl|xml|webm|png|zip|txt)$/.test(name))
|
|
42
|
+
throw new CapabilityBoundaryError('unsafe_artifact_name');
|
|
43
|
+
return name;
|
|
44
|
+
}
|
|
45
|
+
export function capabilityIdentitySlugs(bindingValue) {
|
|
46
|
+
const binding = CapabilityBinding.parse(bindingValue);
|
|
47
|
+
return { scenario: `scenario-${digestOfValue(binding.caseRef.id).hex.slice(0, 16)}`,
|
|
48
|
+
run: `run-${digestOfValue({ campaignId: binding.campaignId, executionId: binding.executionId }).hex.slice(0, 16)}`,
|
|
49
|
+
attempt: `attempt-${digestOfValue({ executionId: binding.executionId, attemptId: binding.attemptId, generation: binding.generation }).hex.slice(0, 16)}` };
|
|
50
|
+
}
|
|
51
|
+
export function validateCapabilityArtifactManifest(value, currentValue) {
|
|
52
|
+
const manifest = CapabilityArtifactManifest.parse(value);
|
|
53
|
+
const current = CapabilityBinding.parse(currentValue);
|
|
54
|
+
if (!same(manifest.binding, current))
|
|
55
|
+
throw new CapabilityBoundaryError('stale_or_cross_run_artifact_manifest');
|
|
56
|
+
return structuredClone(manifest);
|
|
57
|
+
}
|
|
58
|
+
/** Explicit replay semantics; support must come from the host, never a caller's mode label. */
|
|
59
|
+
export function validateCapabilityReplay(value, supportedModes = ['evidence_playback']) {
|
|
60
|
+
const plan = CapabilityReplayPlan.parse(value);
|
|
61
|
+
if (!supportedModes.includes(plan.mode))
|
|
62
|
+
throw new CapabilityBoundaryError('unsupported_replay_mode');
|
|
63
|
+
if (plan.mode === 'evidence_playback') {
|
|
64
|
+
if (plan.targetBinding || plan.freshFixtureRefs.length || plan.externalEffects !== 'none' || !sameRef(plan.sourceCodeRef, plan.targetCodeRef))
|
|
65
|
+
throw new CapabilityBoundaryError('playback_must_not_execute_actions');
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
if (!plan.targetBinding || plan.targetBinding.executionId === plan.sourceBinding.executionId || plan.targetBinding.attemptId === plan.sourceBinding.attemptId || !plan.freshFixtureRefs.length)
|
|
69
|
+
throw new CapabilityBoundaryError('rerun_requires_fresh_attempt_and_fixtures');
|
|
70
|
+
if (plan.freshFixtureRefs.some(ref => ref.id === plan.pins.fixtureRef.id) || new Set(plan.freshFixtureRefs.map(ref => ref.id)).size !== plan.freshFixtureRefs.length)
|
|
71
|
+
throw new CapabilityBoundaryError('rerun_requires_distinct_fresh_fixtures');
|
|
72
|
+
if (plan.targetBinding.scope.ownerId !== plan.sourceBinding.scope.ownerId || !same(plan.targetBinding.scope, plan.sourceBinding.scope))
|
|
73
|
+
throw new CapabilityBoundaryError('replay_scope_mismatch');
|
|
74
|
+
if (plan.mode === 'workflow_history_replay' && (!plan.historyRef || (!sameRef(plan.sourceCodeRef, plan.targetCodeRef) && !plan.compatibilityReviewRef)))
|
|
75
|
+
throw new CapabilityBoundaryError('history_code_compatibility_unreviewed');
|
|
76
|
+
}
|
|
77
|
+
return structuredClone(plan); // No replay/provider operation is performed.
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=capabilityLifecycle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilityLifecycle.js","sourceRoot":"","sources":["../../src/core/capability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uB,CAAC,uBAAuB,CAAC,CAAC;QACnM,IAAI,IAAI,CAAC,IAAI,KAAK,yBAAyB,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;YAAE,MAAM,IAAI,uBAAuB,CAAC,uCAAuC,CAAC,CAAC;IACtO,CAAC;IACD,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,6CAA6C;AAC7E,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type ActionRegistry, type CleanupObservation } from '../protocol/index.ts';
|
|
2
|
+
import type { HttpDriver } from '../adapters/http/driver.ts';
|
|
3
|
+
import type { HostSession } from '../hosts/types.ts';
|
|
4
|
+
import type { Deadline } from './deadline.ts';
|
|
5
|
+
import type { EventLog } from './events.ts';
|
|
6
|
+
export type AllocatedFixture = {
|
|
7
|
+
entityKey: string;
|
|
8
|
+
physicalId: string;
|
|
9
|
+
cleanup: {
|
|
10
|
+
actionId: string;
|
|
11
|
+
args: Record<string, unknown>;
|
|
12
|
+
} | null;
|
|
13
|
+
absence: {
|
|
14
|
+
actionId: string;
|
|
15
|
+
expectStatus: number;
|
|
16
|
+
} | null;
|
|
17
|
+
};
|
|
18
|
+
/** Collect observed cleanup only. This report is not an authority to release a hosted lease. */
|
|
19
|
+
export declare function collectCleanup(input: {
|
|
20
|
+
allocated: readonly AllocatedFixture[];
|
|
21
|
+
uncertainAllocations: number;
|
|
22
|
+
uncertainOperations?: number;
|
|
23
|
+
registry: ActionRegistry | null;
|
|
24
|
+
driver: Pick<HttpDriver, 'request'> | null;
|
|
25
|
+
origin: string;
|
|
26
|
+
deadline: Deadline;
|
|
27
|
+
session: HostSession | null;
|
|
28
|
+
reason: string;
|
|
29
|
+
log: Pick<EventLog, 'emit'>;
|
|
30
|
+
}): Promise<{
|
|
31
|
+
cleanup: CleanupObservation;
|
|
32
|
+
criticalCleanupConfirmed: boolean;
|
|
33
|
+
confirmedFixtureKeys: string[];
|
|
34
|
+
hostCleanupConfirmed: boolean;
|
|
35
|
+
}>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { CleanupObservation as CleanupSchema } from "../protocol/index.js";
|
|
2
|
+
import { cleanupActionError } from "./cleanupActions.js";
|
|
3
|
+
/** Collect observed cleanup only. This report is not an authority to release a hosted lease. */
|
|
4
|
+
export async function collectCleanup(input) {
|
|
5
|
+
const { allocated, driver, registry, origin, deadline, session, log } = input;
|
|
6
|
+
const attempted = [];
|
|
7
|
+
const confirmed = [];
|
|
8
|
+
for (const entry of [...allocated].reverse()) {
|
|
9
|
+
if (!entry.cleanup || !driver || !registry) {
|
|
10
|
+
log.emit('cleanup.entity', null, { entityKey: entry.entityKey, confirmed: false, reason: 'cleanup_unavailable' });
|
|
11
|
+
continue;
|
|
12
|
+
}
|
|
13
|
+
attempted.push(entry.entityKey);
|
|
14
|
+
try {
|
|
15
|
+
const action = registry.actions.find(item => item.actionId === entry.cleanup.actionId);
|
|
16
|
+
const absenceAction = registry.actions.find(item => item.actionId === entry.absence?.actionId);
|
|
17
|
+
const error = cleanupActionError(action, absenceAction, entry.absence?.expectStatus ?? 0);
|
|
18
|
+
if (error)
|
|
19
|
+
throw new Error(error);
|
|
20
|
+
if (!action || !entry.absence || !absenceAction)
|
|
21
|
+
throw new Error('cleanup actions unavailable');
|
|
22
|
+
const result = await driver.request({ origin, method: action.method, path: action.path, body: action.body,
|
|
23
|
+
auth: action.auth, variables: entry.cleanup.args, deadline: deadline.child(5000) });
|
|
24
|
+
const readback = await driver.request({ origin, method: absenceAction.method, path: absenceAction.path,
|
|
25
|
+
body: absenceAction.body, auth: absenceAction.auth, variables: entry.cleanup.args, deadline: deadline.child(5000) });
|
|
26
|
+
const absent = readback.status === entry.absence.expectStatus;
|
|
27
|
+
const ok = (action.expectStatus === null || result.status === action.expectStatus) && absent;
|
|
28
|
+
if (ok)
|
|
29
|
+
confirmed.push(entry.entityKey);
|
|
30
|
+
log.emit('cleanup.entity', null, { entityKey: entry.entityKey, status: result.status,
|
|
31
|
+
absenceConfirmed: absent, confirmed: ok });
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
log.emit('cleanup.entity', null, { entityKey: entry.entityKey, confirmed: false,
|
|
35
|
+
error: error instanceof Error ? error.message : 'cleanup failed' });
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
let hostStopConfirmed = false;
|
|
39
|
+
if (session) {
|
|
40
|
+
try {
|
|
41
|
+
const stop = await session.stop(input.reason);
|
|
42
|
+
hostStopConfirmed = stop.confirmed;
|
|
43
|
+
log.emit('cleanup.host', null, { confirmed: stop.confirmed, detail: stop.detail });
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
log.emit('cleanup.host', null, { confirmed: false, detail: error instanceof Error ? error.message : 'host cleanup failed' });
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
// Every allocation remains unresolved until observed cleanup, including those
|
|
50
|
+
// lacking handles. A lost allocation response cannot invent a physical ID.
|
|
51
|
+
const unconfirmed = allocated.filter(item => !confirmed.includes(item.entityKey)).length;
|
|
52
|
+
const unknown = unconfirmed + input.uncertainAllocations + (input.uncertainOperations ?? 0);
|
|
53
|
+
const hostResources = session?.ownedResources ?? [];
|
|
54
|
+
const cleanup = CleanupSchema.parse({
|
|
55
|
+
ownedResources: [...allocated.map(item => ({ entityKey: item.entityKey, physicalId: item.physicalId, boundaryId: 'application' })), ...hostResources],
|
|
56
|
+
attempted: [...attempted, ...hostResources.map(item => item.entityKey)],
|
|
57
|
+
confirmed: [...confirmed, ...(hostStopConfirmed ? hostResources.map(item => item.entityKey) : [])],
|
|
58
|
+
remainingUnknownMutations: unknown,
|
|
59
|
+
critical: [...allocated.map(item => item.entityKey), ...hostResources.map(item => item.entityKey)],
|
|
60
|
+
janitorReceiptRef: null,
|
|
61
|
+
reasonCodes: [...(unconfirmed ? ['fixture_cleanup_unconfirmed'] : []),
|
|
62
|
+
...(input.uncertainAllocations ? ['fixture_allocation_uncertain'] : []),
|
|
63
|
+
...(input.uncertainOperations ? ['operation_outcome_uncertain'] : []),
|
|
64
|
+
...(session && !hostStopConfirmed ? ['host_stop_unconfirmed'] : [])],
|
|
65
|
+
});
|
|
66
|
+
// Typed acknowledgement provenance is separate from the legacy public display-key arrays.
|
|
67
|
+
// A fixture key may equal a host key; neither can acknowledge the other resource kind.
|
|
68
|
+
return { cleanup, criticalCleanupConfirmed: unknown === 0 && (!session || hostStopConfirmed),
|
|
69
|
+
confirmedFixtureKeys: [...confirmed], hostCleanupConfirmed: hostStopConfirmed };
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=cleanup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cleanup.js","sourceRoot":"","sources":["../../src/core/cleanup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,IAAI,aAAa,EAAgD,MAAM,sBAAsB,CAAC;AAKzH,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAQzD,gGAAgG;AAChG,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,KAKpC;IACC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC;IAC9E,MAAM,SAAS,GAAa,EAAE,CAAC;IAAC,MAAM,SAAS,GAAa,EAAE,CAAC;IAC/D,KAAK,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;QAC7C,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC3C,GAAG,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,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CAAC,iBAAiB,CAAC,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAClG,yBAAyB,EAAE,OAAO;QAClC,QAAQ,EAAE,CAAC,GAAG,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAClG,iBAAiB,EAAE,IAAI;QACvB,WAAW,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,6BAA6B,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACnE,GAAG,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,8BAA8B,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACvE,GAAG,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,6BAA6B,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACrE,GAAG,CAAC,OAAO,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;KACvE,CAAC,CAAC;IACH,0FAA0F;IAC1F,uFAAuF;IACvF,OAAO,EAAE,OAAO,EAAE,wBAAwB,EAAE,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,IAAI,iBAAiB,CAAC;QAC1F,oBAAoB,EAAE,CAAC,GAAG,SAAS,CAAC,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,CAAC;AACpF,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ActionRegistry } from '../protocol/index.ts';
|
|
2
|
+
type Action = ActionRegistry['actions'][number];
|
|
3
|
+
/** The HTTP status-only absence contract requires an explicit missing-resource response. */
|
|
4
|
+
export declare function cleanupActionError(action: Action | undefined, absence: Action | undefined, absenceStatus: number): string | null;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** The HTTP status-only absence contract requires an explicit missing-resource response. */
|
|
2
|
+
export function cleanupActionError(action, absence, absenceStatus) {
|
|
3
|
+
if (!action || !absence)
|
|
4
|
+
return 'cleanup requires registered deletion and absence readback';
|
|
5
|
+
if (action.effect !== 'delete' || ['GET', 'HEAD', 'OPTIONS'].includes(action.method)) {
|
|
6
|
+
return 'cleanup requires a registered delete effect with a mutating method';
|
|
7
|
+
}
|
|
8
|
+
if (absence.effect !== 'read' || !['GET', 'HEAD'].includes(absence.method)) {
|
|
9
|
+
return 'absence readback requires a registered read effect using GET or HEAD';
|
|
10
|
+
}
|
|
11
|
+
if (![404, 410].includes(absenceStatus))
|
|
12
|
+
return 'status-only absence readback requires 404 or 410';
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=cleanupActions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cleanupActions.js","sourceRoot":"","sources":["../../src/core/cleanupActions.ts"],"names":[],"mappings":"AAIA,4FAA4F;AAC5F,MAAM,UAAU,kBAAkB,CAAC,MAA0B,EAAE,OAA2B,EACxF,aAAqB;IACrB,IAAI,CAAC,MAAM,IAAI,CAAC,OAAO;QAAE,OAAO,2DAA2D,CAAC;IAC5F,IAAI,MAAM,CAAC,MAAM,KAAK,QAAQ,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QACrF,OAAO,oEAAoE,CAAC;IAC9E,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,KAAK,MAAM,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3E,OAAO,sEAAsE,CAAC;IAChF,CAAC;IACD,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC;QAAE,OAAO,kDAAkD,CAAC;IACnG,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type KeyObject } from 'node:crypto';
|
|
2
|
+
import { type CleanupExpectation, type SignedCleanupFollowup } from '../protocol/schemas/cleanup.ts';
|
|
3
|
+
export declare function cleanupExpectationDigest(raw: unknown): string;
|
|
4
|
+
/** Only an independent collector holding its protected signing key may issue this follow-up. */
|
|
5
|
+
export declare function signCleanupFollowup(raw: unknown, keyId: string, privateKey: KeyObject): SignedCleanupFollowup;
|
|
6
|
+
export type CleanupObserver = {
|
|
7
|
+
scopeId: string;
|
|
8
|
+
observerId: string;
|
|
9
|
+
publicKey: KeyObject;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Integrity and expectation validation only. The storage owner must recheck the
|
|
13
|
+
* current lease, manifest and time under its admission lock before releasing it.
|
|
14
|
+
* Signature trust does not establish provider qualification or authorize effects.
|
|
15
|
+
*/
|
|
16
|
+
export declare function verifyCleanupFollowup(raw: unknown, expectedRaw: unknown, input: {
|
|
17
|
+
trustedObservers: ReadonlyMap<string, CleanupObserver>;
|
|
18
|
+
observedAt: number;
|
|
19
|
+
}): {
|
|
20
|
+
followup: SignedCleanupFollowup['followup'];
|
|
21
|
+
proofDigest: string;
|
|
22
|
+
expectation: CleanupExpectation;
|
|
23
|
+
};
|