@mannyc1/ts-release 0.0.7 → 0.2.2
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/ARCHITECTURE.md +124 -92
- package/CHANGELOG.md +115 -0
- package/LICENSE +21 -0
- package/README.md +278 -324
- package/SPEC.md +206 -310
- package/apps/release-ts/README.md +32 -0
- package/apps/release-ts/src/cli/command.ts +164 -0
- package/apps/release-ts/src/cli/commands.ts +351 -0
- package/apps/release-ts/src/cli/main.ts +43 -0
- package/apps/release-ts/src/cli/node-main.ts +49 -0
- package/apps/ts-release-agents/LICENSE +21 -0
- package/apps/ts-release-agents/README.md +21 -0
- package/apps/ts-release-agents/evals/cases.json +11 -0
- package/apps/ts-release-agents/manifests/claude.json +5 -0
- package/apps/ts-release-agents/manifests/codex.json +5 -0
- package/apps/ts-release-agents/package.json +11 -0
- package/apps/ts-release-agents/skills/release/SKILL.md +48 -0
- package/apps/ts-release-agents/skills/release/references/configuration.md +18 -0
- package/apps/ts-release-agents/skills/release/references/recovery.md +10 -0
- package/apps/ts-release-agents/skills/release/references/staged-workflow.md +12 -0
- package/apps/ts-release-agents/skills/release/references/target-selection.md +13 -0
- package/apps/ts-release-agents/skills/release/references/verification.md +14 -0
- package/apps/ts-release-agents/src/build.ts +105 -0
- package/apps/ts-release-agents/src/check.ts +117 -0
- package/apps/ts-release-agents/src/install.ts +121 -0
- package/apps/ts-release-agents/test/contract.test.ts +56 -0
- package/apps/ts-release-agents/tsconfig.json +5 -0
- package/dist/api/api.d.ts +15 -0
- package/dist/api/api.d.ts.map +1 -0
- package/dist/api/api.js +244 -0
- package/dist/api/api.js.map +1 -0
- package/dist/api/errors.d.ts +39 -0
- package/dist/api/errors.d.ts.map +1 -0
- package/dist/api/errors.js +32 -0
- package/dist/api/errors.js.map +1 -0
- package/dist/api/input.d.ts +10 -0
- package/dist/api/input.d.ts.map +1 -0
- package/dist/api/input.js +73 -0
- package/dist/api/input.js.map +1 -0
- package/dist/api/runtime.d.ts +18 -0
- package/dist/api/runtime.d.ts.map +1 -0
- package/dist/api/runtime.js +7 -0
- package/dist/api/runtime.js.map +1 -0
- package/dist/api/types.d.ts +76 -0
- package/dist/api/types.d.ts.map +1 -0
- package/dist/api/types.js +17 -0
- package/dist/api/types.js.map +1 -0
- package/dist/bin/ts-release.js +39239 -0
- package/dist/capabilities/bun-targets.d.ts +3 -0
- package/dist/capabilities/bun-targets.d.ts.map +1 -0
- package/dist/capabilities/bun-targets.js +3 -0
- package/dist/capabilities/bun-targets.js.map +1 -0
- package/dist/capabilities/field-ownership.d.ts +17 -0
- package/dist/capabilities/field-ownership.d.ts.map +1 -0
- package/dist/capabilities/field-ownership.js +40 -0
- package/dist/capabilities/field-ownership.js.map +1 -0
- package/dist/capabilities/module.d.ts +91 -0
- package/dist/capabilities/module.d.ts.map +1 -0
- package/dist/capabilities/module.js +2 -0
- package/dist/capabilities/module.js.map +1 -0
- package/dist/capabilities/registry.d.ts +829 -0
- package/dist/capabilities/registry.d.ts.map +1 -0
- package/dist/capabilities/registry.js +291 -0
- package/dist/capabilities/registry.js.map +1 -0
- package/dist/config/config.d.ts +6 -0
- package/dist/config/config.d.ts.map +1 -0
- package/dist/config/config.js +42 -0
- package/dist/config/config.js.map +1 -0
- package/dist/correction/coordinator.d.ts +248 -0
- package/dist/correction/coordinator.d.ts.map +1 -0
- package/dist/correction/coordinator.js +274 -0
- package/dist/correction/coordinator.js.map +1 -0
- package/dist/correction/index.d.ts +3 -0
- package/dist/correction/index.d.ts.map +1 -0
- package/dist/correction/index.js +3 -0
- package/dist/correction/index.js.map +1 -0
- package/dist/correction/intent.d.ts +111 -0
- package/dist/correction/intent.d.ts.map +1 -0
- package/dist/correction/intent.js +146 -0
- package/dist/correction/intent.js.map +1 -0
- package/dist/drivers/archive.d.ts +8 -0
- package/dist/drivers/archive.d.ts.map +1 -0
- package/dist/drivers/archive.js +101 -0
- package/dist/drivers/archive.js.map +1 -0
- package/dist/drivers/contain.d.ts +6 -0
- package/dist/drivers/contain.d.ts.map +1 -0
- package/dist/drivers/contain.js +17 -0
- package/dist/drivers/contain.js.map +1 -0
- package/dist/drivers/environment.d.ts +4 -0
- package/dist/drivers/environment.d.ts.map +1 -0
- package/dist/drivers/environment.js +18 -0
- package/dist/drivers/environment.js.map +1 -0
- package/dist/drivers/errors.d.ts +9 -0
- package/dist/drivers/errors.d.ts.map +1 -0
- package/dist/drivers/errors.js +6 -0
- package/dist/drivers/errors.js.map +1 -0
- package/dist/drivers/glob.d.ts +2 -0
- package/dist/drivers/glob.d.ts.map +1 -0
- package/dist/drivers/glob.js +162 -0
- package/dist/drivers/glob.js.map +1 -0
- package/dist/drivers/process.d.ts +48 -0
- package/dist/drivers/process.d.ts.map +1 -0
- package/dist/drivers/process.js +257 -0
- package/dist/drivers/process.js.map +1 -0
- package/dist/drivers/redact.d.ts +4 -0
- package/dist/drivers/redact.d.ts.map +1 -0
- package/dist/drivers/redact.js +24 -0
- package/dist/drivers/redact.js.map +1 -0
- package/dist/drivers/seccomp-helper-source.d.ts +7 -0
- package/dist/drivers/seccomp-helper-source.d.ts.map +1 -0
- package/dist/drivers/seccomp-helper-source.js +121 -0
- package/dist/drivers/seccomp-helper-source.js.map +1 -0
- package/dist/drivers/utils.d.ts +4 -0
- package/dist/drivers/utils.d.ts.map +1 -0
- package/dist/drivers/utils.js +5 -0
- package/dist/drivers/utils.js.map +1 -0
- package/dist/drivers/workspace.d.ts +6 -0
- package/dist/drivers/workspace.d.ts.map +1 -0
- package/dist/drivers/workspace.js +49 -0
- package/dist/drivers/workspace.js.map +1 -0
- package/dist/extensions/provider-adapter.d.ts +48 -0
- package/dist/extensions/provider-adapter.d.ts.map +1 -0
- package/dist/extensions/provider-adapter.js +64 -0
- package/dist/extensions/provider-adapter.js.map +1 -0
- package/dist/host.d.ts +33 -0
- package/dist/host.d.ts.map +1 -0
- package/dist/host.js +20 -0
- package/dist/host.js.map +1 -0
- package/dist/index.d.ts +19 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/dist/model/artifact-collection.d.ts +84 -0
- package/dist/model/artifact-collection.d.ts.map +1 -0
- package/dist/model/artifact-collection.js +185 -0
- package/dist/model/artifact-collection.js.map +1 -0
- package/dist/model/authority.d.ts +89 -0
- package/dist/model/authority.d.ts.map +1 -0
- package/dist/model/authority.js +80 -0
- package/dist/model/authority.js.map +1 -0
- package/dist/model/bun-targets.d.ts +34 -0
- package/dist/model/bun-targets.d.ts.map +1 -0
- package/dist/model/bun-targets.js +17 -0
- package/dist/model/bun-targets.js.map +1 -0
- package/dist/model/canonical.d.ts +8 -0
- package/dist/model/canonical.d.ts.map +1 -0
- package/dist/model/canonical.js +205 -0
- package/dist/model/canonical.js.map +1 -0
- package/dist/model/catalog.d.ts +76 -0
- package/dist/model/catalog.d.ts.map +1 -0
- package/dist/model/catalog.js +174 -0
- package/dist/model/catalog.js.map +1 -0
- package/dist/model/digest.d.ts +53 -0
- package/dist/model/digest.d.ts.map +1 -0
- package/dist/model/digest.js +127 -0
- package/dist/model/digest.js.map +1 -0
- package/dist/model/errors.d.ts +14 -0
- package/dist/model/errors.d.ts.map +1 -0
- package/dist/model/errors.js +8 -0
- package/dist/model/errors.js.map +1 -0
- package/dist/model/primitives.d.ts +19 -0
- package/dist/model/primitives.d.ts.map +1 -0
- package/dist/model/primitives.js +18 -0
- package/dist/model/primitives.js.map +1 -0
- package/dist/model/pypi.d.ts +12 -0
- package/dist/model/pypi.d.ts.map +1 -0
- package/dist/model/pypi.js +20 -0
- package/dist/model/pypi.js.map +1 -0
- package/dist/model/python-distribution.d.ts +33 -0
- package/dist/model/python-distribution.d.ts.map +1 -0
- package/dist/model/python-distribution.js +367 -0
- package/dist/model/python-distribution.js.map +1 -0
- package/dist/model/secret-patterns.d.ts +2 -0
- package/dist/model/secret-patterns.d.ts.map +1 -0
- package/dist/model/secret-patterns.js +12 -0
- package/dist/model/secret-patterns.js.map +1 -0
- package/dist/platform/bun.d.ts +7 -0
- package/dist/platform/bun.d.ts.map +1 -0
- package/dist/platform/bun.js +15 -0
- package/dist/platform/bun.js.map +1 -0
- package/dist/platform/credentials.d.ts +32 -0
- package/dist/platform/credentials.d.ts.map +1 -0
- package/dist/platform/credentials.js +772 -0
- package/dist/platform/credentials.js.map +1 -0
- package/dist/platform/host-support.d.ts +2 -0
- package/dist/platform/host-support.d.ts.map +1 -0
- package/dist/platform/host-support.js +4 -0
- package/dist/platform/host-support.js.map +1 -0
- package/dist/platform/node.d.ts +7 -0
- package/dist/platform/node.d.ts.map +1 -0
- package/dist/platform/node.js +15 -0
- package/dist/platform/node.js.map +1 -0
- package/dist/platform/release-runtime.d.ts +11 -0
- package/dist/platform/release-runtime.d.ts.map +1 -0
- package/dist/platform/release-runtime.js +34 -0
- package/dist/platform/release-runtime.js.map +1 -0
- package/dist/platform/services.d.ts +15 -0
- package/dist/platform/services.d.ts.map +1 -0
- package/dist/platform/services.js +30 -0
- package/dist/platform/services.js.map +1 -0
- package/dist/platform/source-observer.d.ts +5 -0
- package/dist/platform/source-observer.d.ts.map +1 -0
- package/dist/platform/source-observer.js +159 -0
- package/dist/platform/source-observer.js.map +1 -0
- package/dist/provider-sdk.d.ts +14 -0
- package/dist/provider-sdk.d.ts.map +1 -0
- package/dist/provider-sdk.js +10 -0
- package/dist/provider-sdk.js.map +1 -0
- package/dist/publication/adapter.d.ts +212 -0
- package/dist/publication/adapter.d.ts.map +1 -0
- package/dist/publication/adapter.js +83 -0
- package/dist/publication/adapter.js.map +1 -0
- package/dist/publication/authority.d.ts +137 -0
- package/dist/publication/authority.d.ts.map +1 -0
- package/dist/publication/authority.js +233 -0
- package/dist/publication/authority.js.map +1 -0
- package/dist/publication/catalog-git.d.ts +37 -0
- package/dist/publication/catalog-git.d.ts.map +1 -0
- package/dist/publication/catalog-git.js +451 -0
- package/dist/publication/catalog-git.js.map +1 -0
- package/dist/publication/claim.d.ts +39 -0
- package/dist/publication/claim.d.ts.map +1 -0
- package/dist/publication/claim.js +31 -0
- package/dist/publication/claim.js.map +1 -0
- package/dist/publication/coordinator.d.ts +246 -0
- package/dist/publication/coordinator.d.ts.map +1 -0
- package/dist/publication/coordinator.js +370 -0
- package/dist/publication/coordinator.js.map +1 -0
- package/dist/publication/github.d.ts +36 -0
- package/dist/publication/github.d.ts.map +1 -0
- package/dist/publication/github.js +644 -0
- package/dist/publication/github.js.map +1 -0
- package/dist/publication/http.d.ts +69 -0
- package/dist/publication/http.d.ts.map +1 -0
- package/dist/publication/http.js +29 -0
- package/dist/publication/http.js.map +1 -0
- package/dist/publication/index.d.ts +5 -0
- package/dist/publication/index.d.ts.map +1 -0
- package/dist/publication/index.js +5 -0
- package/dist/publication/index.js.map +1 -0
- package/dist/publication/npm.d.ts +40 -0
- package/dist/publication/npm.d.ts.map +1 -0
- package/dist/publication/npm.js +359 -0
- package/dist/publication/npm.js.map +1 -0
- package/dist/publication/profiles.d.ts +136 -0
- package/dist/publication/profiles.d.ts.map +1 -0
- package/dist/publication/profiles.js +90 -0
- package/dist/publication/profiles.js.map +1 -0
- package/dist/publication/publisher.d.ts +82 -0
- package/dist/publication/publisher.d.ts.map +1 -0
- package/dist/publication/publisher.js +53 -0
- package/dist/publication/publisher.js.map +1 -0
- package/dist/publication/pypi.d.ts +45 -0
- package/dist/publication/pypi.d.ts.map +1 -0
- package/dist/publication/pypi.js +369 -0
- package/dist/publication/pypi.js.map +1 -0
- package/dist/publication/recovery.d.ts +663 -0
- package/dist/publication/recovery.d.ts.map +1 -0
- package/dist/publication/recovery.js +252 -0
- package/dist/publication/recovery.js.map +1 -0
- package/dist/publication/report.d.ts +1061 -0
- package/dist/publication/report.d.ts.map +1 -0
- package/dist/publication/report.js +441 -0
- package/dist/publication/report.js.map +1 -0
- package/dist/recipes/config.d.ts +296 -0
- package/dist/recipes/config.d.ts.map +1 -0
- package/dist/recipes/config.js +325 -0
- package/dist/recipes/config.js.map +1 -0
- package/dist/release/capabilities.d.ts +12 -0
- package/dist/release/capabilities.d.ts.map +1 -0
- package/dist/release/capabilities.js +395 -0
- package/dist/release/capabilities.js.map +1 -0
- package/dist/release/compiler.d.ts +5 -0
- package/dist/release/compiler.d.ts.map +1 -0
- package/dist/release/compiler.js +19 -0
- package/dist/release/compiler.js.map +1 -0
- package/dist/release/config.d.ts +5 -0
- package/dist/release/config.d.ts.map +1 -0
- package/dist/release/config.js +10 -0
- package/dist/release/config.js.map +1 -0
- package/dist/release/context.d.ts +96 -0
- package/dist/release/context.d.ts.map +1 -0
- package/dist/release/context.js +168 -0
- package/dist/release/context.js.map +1 -0
- package/dist/release/graph.d.ts +271 -0
- package/dist/release/graph.d.ts.map +1 -0
- package/dist/release/graph.js +766 -0
- package/dist/release/graph.js.map +1 -0
- package/dist/release/inspect.d.ts +88 -0
- package/dist/release/inspect.d.ts.map +1 -0
- package/dist/release/inspect.js +75 -0
- package/dist/release/inspect.js.map +1 -0
- package/dist/release/prepare.d.ts +24 -0
- package/dist/release/prepare.d.ts.map +1 -0
- package/dist/release/prepare.js +1116 -0
- package/dist/release/prepare.js.map +1 -0
- package/dist/release/prepared-ref.d.ts +60 -0
- package/dist/release/prepared-ref.d.ts.map +1 -0
- package/dist/release/prepared-ref.js +131 -0
- package/dist/release/prepared-ref.js.map +1 -0
- package/dist/release/prepared-store.d.ts +90 -0
- package/dist/release/prepared-store.d.ts.map +1 -0
- package/dist/release/prepared-store.js +337 -0
- package/dist/release/prepared-store.js.map +1 -0
- package/dist/release/prepared.d.ts +172 -0
- package/dist/release/prepared.d.ts.map +1 -0
- package/dist/release/prepared.js +268 -0
- package/dist/release/prepared.js.map +1 -0
- package/dist/release/staging.d.ts +31 -0
- package/dist/release/staging.d.ts.map +1 -0
- package/dist/release/staging.js +218 -0
- package/dist/release/staging.js.map +1 -0
- package/dist/resolve/authored.d.ts +53 -0
- package/dist/resolve/authored.d.ts.map +1 -0
- package/dist/resolve/authored.js +55 -0
- package/dist/resolve/authored.js.map +1 -0
- package/dist/resolve/encode.d.ts +3 -0
- package/dist/resolve/encode.d.ts.map +1 -0
- package/dist/resolve/encode.js +21 -0
- package/dist/resolve/encode.js.map +1 -0
- package/dist/resolve/errors.d.ts +7 -0
- package/dist/resolve/errors.d.ts.map +1 -0
- package/dist/resolve/errors.js +17 -0
- package/dist/resolve/errors.js.map +1 -0
- package/dist/resolve/facts.d.ts +12 -0
- package/dist/resolve/facts.d.ts.map +1 -0
- package/dist/resolve/facts.js +18 -0
- package/dist/resolve/facts.js.map +1 -0
- package/dist/resolve/resolve.d.ts +10 -0
- package/dist/resolve/resolve.d.ts.map +1 -0
- package/dist/resolve/resolve.js +242 -0
- package/dist/resolve/resolve.js.map +1 -0
- package/dist/store.d.ts +11 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +9 -0
- package/dist/store.js.map +1 -0
- package/examples/README.md +20 -30
- package/examples/github-release/release.config.json +11 -18
- package/examples/homebrew-tap/README.md +11 -0
- package/examples/homebrew-tap/release.config.json +40 -28
- package/examples/multi-target/release.config.json +28 -53
- package/examples/npm-first-publish/release.config.json +23 -25
- package/examples/npm-only/release.config.json +22 -30
- package/examples/portable-cli/README.md +17 -0
- package/examples/portable-cli/artifacts/portable-example-0.1.0-darwin-arm64 +1 -0
- package/examples/portable-cli/artifacts/portable-example-0.1.0-darwin-x64 +1 -0
- package/examples/portable-cli/artifacts/portable-example-0.1.0-linux-arm64 +1 -0
- package/examples/portable-cli/artifacts/portable-example-0.1.0-linux-x64 +1 -0
- package/examples/portable-cli/artifacts/portable-example-0.1.0-windows-x64.exe +1 -0
- package/examples/portable-cli/artifacts/portable_example-0.1.0-py3-none-macosx_10_15_x86_64.whl +1 -0
- package/examples/portable-cli/artifacts/portable_example-0.1.0-py3-none-macosx_11_0_arm64.whl +1 -0
- package/examples/portable-cli/artifacts/portable_example-0.1.0-py3-none-manylinux2014_aarch64.whl +1 -0
- package/examples/portable-cli/artifacts/portable_example-0.1.0-py3-none-manylinux2014_x86_64.whl +1 -0
- package/examples/portable-cli/artifacts/portable_example-0.1.0-py3-none-win_amd64.whl +1 -0
- package/examples/portable-cli/package.json +9 -0
- package/examples/portable-cli/release.config.json +53 -0
- package/examples/portable-cli/src/cli.ts +3 -0
- package/examples/pypi-registry/README.md +8 -0
- package/examples/scoop-bucket/README.md +10 -0
- package/examples/scoop-bucket/release.config.json +40 -30
- package/package.json +60 -156
- package/src/api/api.ts +365 -0
- package/src/api/errors.ts +36 -0
- package/src/api/input.ts +92 -0
- package/src/api/runtime.ts +14 -0
- package/src/api/types.ts +103 -0
- package/src/capabilities/bun-targets.ts +2 -0
- package/src/capabilities/field-ownership.ts +60 -0
- package/src/capabilities/module.ts +158 -0
- package/src/capabilities/registry.ts +333 -0
- package/src/config/config.ts +48 -0
- package/src/correction/coordinator.ts +336 -0
- package/src/correction/index.ts +2 -0
- package/src/correction/intent.ts +172 -0
- package/src/drivers/archive.ts +102 -0
- package/src/drivers/contain.ts +20 -0
- package/src/drivers/environment.ts +28 -0
- package/src/drivers/errors.ts +6 -0
- package/src/drivers/glob.ts +137 -0
- package/src/drivers/process.ts +340 -0
- package/src/drivers/redact.ts +31 -0
- package/src/drivers/seccomp-helper-source.ts +121 -0
- package/src/drivers/utils.ts +10 -0
- package/src/drivers/workspace.ts +40 -0
- package/src/extensions/provider-adapter.ts +99 -0
- package/src/host.ts +140 -0
- package/src/index.ts +64 -0
- package/src/model/artifact-collection.ts +237 -0
- package/src/model/authority.ts +116 -0
- package/src/model/bun-targets.ts +34 -0
- package/src/model/canonical.ts +205 -0
- package/src/model/catalog.ts +220 -0
- package/src/model/digest.ts +172 -0
- package/src/model/errors.ts +6 -0
- package/src/model/primitives.ts +37 -0
- package/src/model/pypi.ts +30 -0
- package/src/model/python-distribution.ts +360 -0
- package/src/model/secret-patterns.ts +11 -0
- package/src/platform/bun.ts +38 -0
- package/src/platform/credentials.ts +1083 -0
- package/src/platform/host-support.ts +4 -0
- package/src/platform/node.ts +38 -0
- package/src/platform/release-runtime.ts +47 -0
- package/src/platform/services.ts +57 -0
- package/src/platform/source-observer.ts +193 -0
- package/src/provider-sdk.ts +48 -0
- package/src/publication/adapter.ts +132 -0
- package/src/publication/authority.ts +397 -0
- package/src/publication/catalog-git.ts +603 -0
- package/src/publication/claim.ts +51 -0
- package/src/publication/coordinator.ts +578 -0
- package/src/publication/github.ts +954 -0
- package/src/publication/http.ts +101 -0
- package/src/publication/index.ts +4 -0
- package/src/publication/npm.ts +525 -0
- package/src/publication/profiles.ts +94 -0
- package/src/publication/publisher.ts +130 -0
- package/src/publication/pypi.ts +463 -0
- package/src/publication/recovery.ts +349 -0
- package/src/publication/report.ts +628 -0
- package/src/recipes/config.ts +395 -0
- package/src/release/capabilities.ts +459 -0
- package/src/release/compiler.ts +28 -0
- package/src/release/config.ts +12 -0
- package/src/release/context.ts +223 -0
- package/src/release/graph.ts +866 -0
- package/src/release/inspect.ts +83 -0
- package/src/release/prepare.ts +1331 -0
- package/src/release/prepared-ref.ts +193 -0
- package/src/release/prepared-store.ts +377 -0
- package/src/release/prepared.ts +299 -0
- package/src/release/staging.ts +257 -0
- package/src/resolve/authored.ts +64 -0
- package/src/resolve/encode.ts +22 -0
- package/src/resolve/errors.ts +15 -0
- package/src/resolve/facts.ts +18 -0
- package/src/resolve/resolve.ts +328 -0
- package/src/store.ts +28 -0
- package/templates/README.md +55 -72
- package/templates/bun-cli-github/README.md +7 -9
- package/templates/bun-cli-github/release.config.json +35 -73
- package/templates/github-actions/release.yml +57 -0
- package/templates/github-actions/reviewed-release.yml +80 -0
- package/templates/multi-target-homebrew/README.md +10 -0
- package/templates/multi-target-homebrew/release.config.json +43 -60
- package/templates/multi-target-scoop/README.md +10 -0
- package/templates/multi-target-scoop/release.config.json +43 -62
- package/templates/npm-github/release.config.json +25 -38
- package/templates/npm-github/reviewed-release.config.json +37 -0
- package/templates/npm-only/README.md +10 -0
- package/templates/npm-only/release.config.json +15 -30
- package/templates/portable-cli/README.md +13 -0
- package/templates/portable-cli/release.config.json +53 -0
- package/dist/artifacts/adapter.d.ts +0 -39
- package/dist/artifacts/adapter.d.ts.map +0 -1
- package/dist/artifacts/adapter.js +0 -23
- package/dist/artifacts/adapter.js.map +0 -1
- package/dist/artifacts/registry.d.ts +0 -21
- package/dist/artifacts/registry.d.ts.map +0 -1
- package/dist/artifacts/registry.js +0 -21
- package/dist/artifacts/registry.js.map +0 -1
- package/dist/config/errors.d.ts +0 -24
- package/dist/config/errors.d.ts.map +0 -1
- package/dist/config/errors.js +0 -19
- package/dist/config/errors.js.map +0 -1
- package/dist/config/load.d.ts +0 -9
- package/dist/config/load.d.ts.map +0 -1
- package/dist/config/load.js +0 -29
- package/dist/config/load.js.map +0 -1
- package/dist/config/schema.d.ts +0 -12
- package/dist/config/schema.d.ts.map +0 -1
- package/dist/config/schema.js +0 -19
- package/dist/config/schema.js.map +0 -1
- package/dist/domain/artifact.d.ts +0 -118
- package/dist/domain/artifact.d.ts.map +0 -1
- package/dist/domain/artifact.js +0 -197
- package/dist/domain/artifact.js.map +0 -1
- package/dist/domain/evidence.d.ts +0 -59
- package/dist/domain/evidence.d.ts.map +0 -1
- package/dist/domain/evidence.js +0 -51
- package/dist/domain/evidence.js.map +0 -1
- package/dist/domain/operation.d.ts +0 -143
- package/dist/domain/operation.d.ts.map +0 -1
- package/dist/domain/operation.js +0 -198
- package/dist/domain/operation.js.map +0 -1
- package/dist/domain/release.d.ts +0 -93
- package/dist/domain/release.d.ts.map +0 -1
- package/dist/domain/release.js +0 -82
- package/dist/domain/release.js.map +0 -1
- package/dist/domain/remote-state.d.ts +0 -58
- package/dist/domain/remote-state.d.ts.map +0 -1
- package/dist/domain/remote-state.js +0 -55
- package/dist/domain/remote-state.js.map +0 -1
- package/dist/domain/target.d.ts +0 -148
- package/dist/domain/target.d.ts.map +0 -1
- package/dist/domain/target.js +0 -151
- package/dist/domain/target.js.map +0 -1
- package/dist/host/host.d.ts +0 -32
- package/dist/host/host.d.ts.map +0 -1
- package/dist/host/host.js +0 -24
- package/dist/host/host.js.map +0 -1
- package/dist/host/http-live.d.ts +0 -6
- package/dist/host/http-live.d.ts.map +0 -1
- package/dist/host/http-live.js +0 -86
- package/dist/host/http-live.js.map +0 -1
- package/dist/host/http.d.ts +0 -43
- package/dist/host/http.d.ts.map +0 -1
- package/dist/host/http.js +0 -59
- package/dist/host/http.js.map +0 -1
- package/dist/host/platform.d.ts +0 -10
- package/dist/host/platform.d.ts.map +0 -1
- package/dist/host/platform.js +0 -114
- package/dist/host/platform.js.map +0 -1
- package/dist/host/test.d.ts +0 -23
- package/dist/host/test.d.ts.map +0 -1
- package/dist/host/test.js +0 -222
- package/dist/host/test.js.map +0 -1
- package/dist/internal/workspace-path.d.ts +0 -15
- package/dist/internal/workspace-path.d.ts.map +0 -1
- package/dist/internal/workspace-path.js +0 -36
- package/dist/internal/workspace-path.js.map +0 -1
- package/dist/planner/artifact-inventory.d.ts +0 -9
- package/dist/planner/artifact-inventory.d.ts.map +0 -1
- package/dist/planner/artifact-inventory.js +0 -86
- package/dist/planner/artifact-inventory.js.map +0 -1
- package/dist/planner/create-release-plan.d.ts +0 -5
- package/dist/planner/create-release-plan.d.ts.map +0 -1
- package/dist/planner/create-release-plan.js +0 -25
- package/dist/planner/create-release-plan.js.map +0 -1
- package/dist/planner/errors.d.ts +0 -67
- package/dist/planner/errors.d.ts.map +0 -1
- package/dist/planner/errors.js +0 -58
- package/dist/planner/errors.js.map +0 -1
- package/dist/planner/evidence-recorder.d.ts +0 -28
- package/dist/planner/evidence-recorder.d.ts.map +0 -1
- package/dist/planner/evidence-recorder.js +0 -362
- package/dist/planner/evidence-recorder.js.map +0 -1
- package/dist/planner/executor.d.ts +0 -58
- package/dist/planner/executor.d.ts.map +0 -1
- package/dist/planner/executor.js +0 -147
- package/dist/planner/executor.js.map +0 -1
- package/dist/planner/normalize-release.d.ts +0 -19
- package/dist/planner/normalize-release.d.ts.map +0 -1
- package/dist/planner/normalize-release.js +0 -342
- package/dist/planner/normalize-release.js.map +0 -1
- package/dist/planner/reconcile.d.ts +0 -17
- package/dist/planner/reconcile.d.ts.map +0 -1
- package/dist/planner/reconcile.js +0 -259
- package/dist/planner/reconcile.js.map +0 -1
- package/dist/planner/render-plan.d.ts +0 -15
- package/dist/planner/render-plan.d.ts.map +0 -1
- package/dist/planner/render-plan.js +0 -231
- package/dist/planner/render-plan.js.map +0 -1
- package/dist/targets/adapter-helpers.d.ts +0 -79
- package/dist/targets/adapter-helpers.d.ts.map +0 -1
- package/dist/targets/adapter-helpers.js +0 -194
- package/dist/targets/adapter-helpers.js.map +0 -1
- package/dist/targets/adapter.d.ts +0 -17
- package/dist/targets/adapter.d.ts.map +0 -1
- package/dist/targets/adapter.js +0 -2
- package/dist/targets/adapter.js.map +0 -1
- package/dist/targets/github-release.d.ts +0 -25
- package/dist/targets/github-release.d.ts.map +0 -1
- package/dist/targets/github-release.js +0 -82
- package/dist/targets/github-release.js.map +0 -1
- package/dist/targets/github.d.ts +0 -11
- package/dist/targets/github.d.ts.map +0 -1
- package/dist/targets/github.js +0 -117
- package/dist/targets/github.js.map +0 -1
- package/dist/targets/homebrew.d.ts +0 -11
- package/dist/targets/homebrew.d.ts.map +0 -1
- package/dist/targets/homebrew.js +0 -210
- package/dist/targets/homebrew.js.map +0 -1
- package/dist/targets/live.d.ts +0 -5
- package/dist/targets/live.d.ts.map +0 -1
- package/dist/targets/live.js +0 -50
- package/dist/targets/live.js.map +0 -1
- package/dist/targets/npm.d.ts +0 -10
- package/dist/targets/npm.d.ts.map +0 -1
- package/dist/targets/npm.js +0 -112
- package/dist/targets/npm.js.map +0 -1
- package/dist/targets/pypi.d.ts +0 -11
- package/dist/targets/pypi.d.ts.map +0 -1
- package/dist/targets/pypi.js +0 -141
- package/dist/targets/pypi.js.map +0 -1
- package/dist/targets/registry.d.ts +0 -25
- package/dist/targets/registry.d.ts.map +0 -1
- package/dist/targets/registry.js +0 -34
- package/dist/targets/registry.js.map +0 -1
- package/dist/targets/scoop.d.ts +0 -11
- package/dist/targets/scoop.d.ts.map +0 -1
- package/dist/targets/scoop.js +0 -88
- package/dist/targets/scoop.js.map +0 -1
- package/dist/types/effect-internal.d.ts +0 -5
- package/dist/types/effect-internal.d.ts.map +0 -1
- package/dist/types/effect-internal.js +0 -2
- package/dist/types/effect-internal.js.map +0 -1
- package/dist/workflows/config.d.ts +0 -202
- package/dist/workflows/config.d.ts.map +0 -1
- package/dist/workflows/config.js +0 -420
- package/dist/workflows/config.js.map +0 -1
- package/dist/workflows/diagnostics.d.ts +0 -62
- package/dist/workflows/diagnostics.d.ts.map +0 -1
- package/dist/workflows/diagnostics.js +0 -530
- package/dist/workflows/diagnostics.js.map +0 -1
- package/dist/workflows/distribution.d.ts +0 -25
- package/dist/workflows/distribution.d.ts.map +0 -1
- package/dist/workflows/distribution.js +0 -24
- package/dist/workflows/distribution.js.map +0 -1
- package/dist/workflows/evidence.d.ts +0 -17
- package/dist/workflows/evidence.d.ts.map +0 -1
- package/dist/workflows/evidence.js +0 -32
- package/dist/workflows/evidence.js.map +0 -1
- package/dist/workflows/index.d.ts +0 -8
- package/dist/workflows/index.d.ts.map +0 -1
- package/dist/workflows/index.js +0 -7
- package/dist/workflows/index.js.map +0 -1
- package/dist/workflows/init.d.ts +0 -84
- package/dist/workflows/init.d.ts.map +0 -1
- package/dist/workflows/init.js +0 -487
- package/dist/workflows/init.js.map +0 -1
- package/dist/workflows/live.d.ts +0 -9
- package/dist/workflows/live.d.ts.map +0 -1
- package/dist/workflows/live.js +0 -7
- package/dist/workflows/live.js.map +0 -1
- package/dist/workflows/options.d.ts +0 -30
- package/dist/workflows/options.d.ts.map +0 -1
- package/dist/workflows/options.js +0 -16
- package/dist/workflows/options.js.map +0 -1
- package/examples/non-strict-skips/artifacts/release-example-skips-0.1.0.tgz +0 -1
- package/examples/non-strict-skips/release.config.json +0 -31
- package/examples/pypi-registry/release.config.json +0 -31
- package/templates/github-actions/plan-and-approved-execute.yml +0 -58
- package/templates/github-actions/plan-only.yml +0 -33
- package/templates/github-actions/trusted-publishing.yml +0 -61
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
import * as Schema from "effect/Schema"
|
|
2
|
+
import { encodeCanonicalJson } from "../model/canonical.js"
|
|
3
|
+
import { SafeReason } from "./report.js"
|
|
4
|
+
|
|
5
|
+
/** Independent recovery axes. None of these values implies another axis. */
|
|
6
|
+
export const ObservationStrength = Schema.Literals(["exact", "conditional", "none"])
|
|
7
|
+
export type ObservationStrength = typeof ObservationStrength.Type
|
|
8
|
+
|
|
9
|
+
export const AuthoritativeAbsenceCapability = Schema.Literals([
|
|
10
|
+
"proved",
|
|
11
|
+
"provider-specific",
|
|
12
|
+
"unavailable"
|
|
13
|
+
])
|
|
14
|
+
export type AuthoritativeAbsenceCapability = typeof AuthoritativeAbsenceCapability.Type
|
|
15
|
+
|
|
16
|
+
export const CreateAuthorizationCapability = Schema.Literals([
|
|
17
|
+
"none",
|
|
18
|
+
"authenticated-namespace-and-unique-coordinate"
|
|
19
|
+
])
|
|
20
|
+
export type CreateAuthorizationCapability = typeof CreateAuthorizationCapability.Type
|
|
21
|
+
|
|
22
|
+
export const ReplayCapability = Schema.Literals([
|
|
23
|
+
"coordinate-unique",
|
|
24
|
+
"idempotency-key",
|
|
25
|
+
"conditional",
|
|
26
|
+
"unsafe"
|
|
27
|
+
])
|
|
28
|
+
export type ReplayCapability = typeof ReplayCapability.Type
|
|
29
|
+
|
|
30
|
+
export const IdentifierReuseCapability = Schema.Literals([
|
|
31
|
+
"reusable",
|
|
32
|
+
"consumed-after-delete",
|
|
33
|
+
"not-applicable"
|
|
34
|
+
])
|
|
35
|
+
export type IdentifierReuseCapability = typeof IdentifierReuseCapability.Type
|
|
36
|
+
|
|
37
|
+
export const CorrectionKind = Schema.Literals([
|
|
38
|
+
"deprecate",
|
|
39
|
+
"amend-release-metadata",
|
|
40
|
+
"yank-file",
|
|
41
|
+
"forward-catalog-state"
|
|
42
|
+
])
|
|
43
|
+
export type CorrectionKind = typeof CorrectionKind.Type
|
|
44
|
+
|
|
45
|
+
export const ExposureCapability = Schema.Literals([
|
|
46
|
+
"retractable",
|
|
47
|
+
"persistent-to-consumers",
|
|
48
|
+
"append-only"
|
|
49
|
+
])
|
|
50
|
+
export type ExposureCapability = typeof ExposureCapability.Type
|
|
51
|
+
|
|
52
|
+
export const HistoryStoreRequirement = Schema.Literals([
|
|
53
|
+
"optional-evidence",
|
|
54
|
+
"durable-cas-required"
|
|
55
|
+
])
|
|
56
|
+
export type HistoryStoreRequirement = typeof HistoryStoreRequirement.Type
|
|
57
|
+
|
|
58
|
+
const documentedUrl = Schema.String.check(Schema.makeFilter((value: string) => {
|
|
59
|
+
try {
|
|
60
|
+
const parsed = new URL(value)
|
|
61
|
+
return parsed.protocol === "https:" && parsed.username === "" && parsed.password === ""
|
|
62
|
+
? undefined
|
|
63
|
+
: "A documented convergence contract must use a credential-free HTTPS URL."
|
|
64
|
+
} catch {
|
|
65
|
+
return "A documented convergence contract must use a valid HTTPS URL."
|
|
66
|
+
}
|
|
67
|
+
}))
|
|
68
|
+
|
|
69
|
+
const calendarDate = Schema.String.check(Schema.makeFilter((value: string) => {
|
|
70
|
+
if (!/^\d{4}-\d{2}-\d{2}$/u.test(value)) return "A convergence contract date must use YYYY-MM-DD."
|
|
71
|
+
const instant = new Date(`${value}T00:00:00.000Z`)
|
|
72
|
+
return Number.isNaN(instant.getTime()) || instant.toISOString().slice(0, 10) !== value
|
|
73
|
+
? "A convergence contract date must be a real calendar date."
|
|
74
|
+
: undefined
|
|
75
|
+
}))
|
|
76
|
+
|
|
77
|
+
export class DocumentedReadConvergenceContract
|
|
78
|
+
extends Schema.TaggedClass<DocumentedReadConvergenceContract>()("documented", {
|
|
79
|
+
url: documentedUrl,
|
|
80
|
+
date: calendarDate
|
|
81
|
+
}) {}
|
|
82
|
+
|
|
83
|
+
export class AssumedReadConvergenceContract
|
|
84
|
+
extends Schema.TaggedClass<AssumedReadConvergenceContract>()("assumed", {
|
|
85
|
+
basis: SafeReason
|
|
86
|
+
}) {}
|
|
87
|
+
|
|
88
|
+
export class UnknownReadConvergenceContract
|
|
89
|
+
extends Schema.TaggedClass<UnknownReadConvergenceContract>()("unknown", {}) {}
|
|
90
|
+
|
|
91
|
+
export const ReadConvergenceContract = Schema.Union([
|
|
92
|
+
DocumentedReadConvergenceContract,
|
|
93
|
+
AssumedReadConvergenceContract,
|
|
94
|
+
UnknownReadConvergenceContract
|
|
95
|
+
])
|
|
96
|
+
export type ReadConvergenceContract = typeof ReadConvergenceContract.Type
|
|
97
|
+
|
|
98
|
+
const boundedInteger = (name: string, minimum: number, maximum: number) =>
|
|
99
|
+
Schema.Number.check(Schema.makeFilter((value: number) =>
|
|
100
|
+
Number.isSafeInteger(value) && value >= minimum && value <= maximum
|
|
101
|
+
? undefined
|
|
102
|
+
: `${name} must be a safe integer between ${minimum} and ${maximum}.`))
|
|
103
|
+
|
|
104
|
+
const boundedFactor = Schema.Number.check(Schema.makeFilter((value: number) =>
|
|
105
|
+
Number.isFinite(value) && value >= 1 && value <= 100
|
|
106
|
+
? undefined
|
|
107
|
+
: "A retry factor must be finite and between 1 and 100."))
|
|
108
|
+
|
|
109
|
+
const MaxAttempts = boundedInteger("maxAttempts", 1, 100)
|
|
110
|
+
const BackoffMilliseconds = boundedInteger("A backoff duration", 0, 3_600_000)
|
|
111
|
+
const TotalBudgetMilliseconds = boundedInteger("totalBudgetMs", 0, 86_400_000)
|
|
112
|
+
|
|
113
|
+
export class ObservationRetryBackoff
|
|
114
|
+
extends Schema.Class<ObservationRetryBackoff>("ObservationRetryBackoff")({
|
|
115
|
+
baseMs: BackoffMilliseconds,
|
|
116
|
+
factor: boundedFactor,
|
|
117
|
+
capMs: BackoffMilliseconds
|
|
118
|
+
}) {}
|
|
119
|
+
|
|
120
|
+
class ObservationRetryRecord
|
|
121
|
+
extends Schema.Class<ObservationRetryRecord>("ObservationRetry")({
|
|
122
|
+
maxAttempts: MaxAttempts,
|
|
123
|
+
backoff: ObservationRetryBackoff,
|
|
124
|
+
totalBudgetMs: TotalBudgetMilliseconds
|
|
125
|
+
}) {}
|
|
126
|
+
|
|
127
|
+
const observationRetryIssue = (value: ObservationRetryRecord): string | undefined => {
|
|
128
|
+
if (value.backoff.capMs < value.backoff.baseMs) {
|
|
129
|
+
return "A retry backoff cap must be greater than or equal to its base."
|
|
130
|
+
}
|
|
131
|
+
if (value.maxAttempts === 1) {
|
|
132
|
+
return value.backoff.baseMs === 0 && value.backoff.capMs === 0 && value.totalBudgetMs === 0
|
|
133
|
+
? undefined
|
|
134
|
+
: "A one-attempt policy must carry zero backoff and zero total budget."
|
|
135
|
+
}
|
|
136
|
+
if (value.backoff.baseMs === 0 || value.totalBudgetMs === 0) {
|
|
137
|
+
return "A multi-attempt policy requires a positive base backoff and total budget."
|
|
138
|
+
}
|
|
139
|
+
return undefined
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export const ObservationRetry = ObservationRetryRecord.pipe(Schema.check(
|
|
143
|
+
Schema.makeFilter((value) => observationRetryIssue(value))
|
|
144
|
+
))
|
|
145
|
+
export type ObservationRetry = typeof ObservationRetry.Type
|
|
146
|
+
|
|
147
|
+
export const RetryEligible = Schema.Literal("VisibilityPending | Inconclusive")
|
|
148
|
+
export type RetryEligible = typeof RetryEligible.Type
|
|
149
|
+
|
|
150
|
+
export const RetryExhaustion = Schema.Literal("UncertainSubject with full trace")
|
|
151
|
+
export type RetryExhaustion = typeof RetryExhaustion.Type
|
|
152
|
+
|
|
153
|
+
class ReadConvergenceProfileRecord
|
|
154
|
+
extends Schema.Class<ReadConvergenceProfileRecord>("ReadConvergenceProfile")({
|
|
155
|
+
contract: ReadConvergenceContract,
|
|
156
|
+
observationRetry: ObservationRetry,
|
|
157
|
+
retryEligible: RetryEligible,
|
|
158
|
+
exhaustion: RetryExhaustion
|
|
159
|
+
}) {}
|
|
160
|
+
|
|
161
|
+
const readConvergenceIssue = (value: ReadConvergenceProfileRecord): string | undefined =>
|
|
162
|
+
value.contract._tag === "unknown" && value.observationRetry.maxAttempts !== 1
|
|
163
|
+
? "An unknown convergence contract cannot authorize additional observation attempts."
|
|
164
|
+
: undefined
|
|
165
|
+
|
|
166
|
+
export const ReadConvergenceProfile = ReadConvergenceProfileRecord.pipe(Schema.check(
|
|
167
|
+
Schema.makeFilter((value) => readConvergenceIssue(value))
|
|
168
|
+
))
|
|
169
|
+
export type ReadConvergenceProfile = typeof ReadConvergenceProfile.Type
|
|
170
|
+
|
|
171
|
+
class RecoveryCapabilityProfileRecord
|
|
172
|
+
extends Schema.Class<RecoveryCapabilityProfileRecord>("RecoveryCapabilityProfile")({
|
|
173
|
+
observation: ObservationStrength,
|
|
174
|
+
authoritativeAbsence: AuthoritativeAbsenceCapability,
|
|
175
|
+
createAuthorization: CreateAuthorizationCapability,
|
|
176
|
+
replay: ReplayCapability,
|
|
177
|
+
identifierReuse: IdentifierReuseCapability,
|
|
178
|
+
correction: Schema.Array(CorrectionKind),
|
|
179
|
+
exposure: ExposureCapability,
|
|
180
|
+
historyRequirement: HistoryStoreRequirement,
|
|
181
|
+
readConvergence: ReadConvergenceProfile
|
|
182
|
+
}) {}
|
|
183
|
+
|
|
184
|
+
const recoveryCapabilityIssue = (value: RecoveryCapabilityProfileRecord): string | undefined => {
|
|
185
|
+
if (new Set(value.correction).size !== value.correction.length) {
|
|
186
|
+
return "Correction kinds in a recovery profile must be unique."
|
|
187
|
+
}
|
|
188
|
+
return readConvergenceIssue(value.readConvergence)
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export const RecoveryCapabilityProfile = RecoveryCapabilityProfileRecord.pipe(Schema.check(
|
|
192
|
+
Schema.makeFilter((value) => recoveryCapabilityIssue(value))
|
|
193
|
+
))
|
|
194
|
+
export type RecoveryCapabilityProfile = typeof RecoveryCapabilityProfile.Type
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* One executable publication adapter and the durable recovery profile it
|
|
198
|
+
* promises to honor. `correctionAdapters` names only actually installed
|
|
199
|
+
* conditional correction implementations; an authored operator proposal is
|
|
200
|
+
* not an adapter.
|
|
201
|
+
*/
|
|
202
|
+
export interface PublicationProfileRegistration {
|
|
203
|
+
readonly id: string
|
|
204
|
+
readonly provider: string
|
|
205
|
+
readonly preparedTag: string
|
|
206
|
+
readonly recovery: RecoveryCapabilityProfile
|
|
207
|
+
readonly correctionAdapters: ReadonlyArray<CorrectionKind>
|
|
208
|
+
readonly evidence: {
|
|
209
|
+
readonly reviewedAt: string
|
|
210
|
+
readonly observationSources: ReadonlyArray<string>
|
|
211
|
+
readonly correctionSources: ReadonlyArray<string>
|
|
212
|
+
readonly correctionFinding: string
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export class RecoveryProfileRegistrationError
|
|
217
|
+
extends Schema.TaggedErrorClass<RecoveryProfileRegistrationError>()("RecoveryProfileRegistrationError", {
|
|
218
|
+
registration: Schema.NonEmptyString,
|
|
219
|
+
reason: SafeReason
|
|
220
|
+
}) {}
|
|
221
|
+
|
|
222
|
+
const decodeRecoveryCapabilityProfile = (value: unknown): RecoveryCapabilityProfile =>
|
|
223
|
+
Schema.decodeUnknownSync(RecoveryCapabilityProfile, { onExcessProperty: "error" })(value)
|
|
224
|
+
|
|
225
|
+
/** Canonical profile bytes are shared by registration checks and generators. */
|
|
226
|
+
export const encodeRecoveryCapabilityProfile = (value: unknown): string =>
|
|
227
|
+
encodeCanonicalJson(Schema.encodeSync(RecoveryCapabilityProfile)(decodeRecoveryCapabilityProfile(value)))
|
|
228
|
+
|
|
229
|
+
export const recoveryCapabilityProfilesEqual = (left: unknown, right: unknown): boolean =>
|
|
230
|
+
encodeRecoveryCapabilityProfile(left) === encodeRecoveryCapabilityProfile(right)
|
|
231
|
+
|
|
232
|
+
const registrationFailure = (registration: string, reason: string): RecoveryProfileRegistrationError =>
|
|
233
|
+
RecoveryProfileRegistrationError.make({
|
|
234
|
+
registration,
|
|
235
|
+
reason: SafeReason.make(reason)
|
|
236
|
+
})
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Fail module registration before any provider operation when the declared
|
|
240
|
+
* profile or installed correction behavior is incoherent.
|
|
241
|
+
*/
|
|
242
|
+
export const validatePublicationProfiles = <
|
|
243
|
+
const Profiles extends Readonly<Record<string, PublicationProfileRegistration>>
|
|
244
|
+
>(profiles: Profiles): Profiles => {
|
|
245
|
+
const ids = new Set<string>()
|
|
246
|
+
const preparedTags = new Set<string>()
|
|
247
|
+
for (const [name, registration] of Object.entries(profiles)) {
|
|
248
|
+
try {
|
|
249
|
+
if (registration.id.length === 0 || registration.provider.length === 0 || registration.preparedTag.length === 0) {
|
|
250
|
+
throw registrationFailure(name, "Registration id, provider, and prepared tag must be nonempty.")
|
|
251
|
+
}
|
|
252
|
+
if (ids.has(registration.id)) throw registrationFailure(name, "Publication profile ids must be unique.")
|
|
253
|
+
if (preparedTags.has(registration.preparedTag)) {
|
|
254
|
+
throw registrationFailure(name, "Prepared publication tags must be unique.")
|
|
255
|
+
}
|
|
256
|
+
ids.add(registration.id)
|
|
257
|
+
preparedTags.add(registration.preparedTag)
|
|
258
|
+
|
|
259
|
+
const recovery = decodeRecoveryCapabilityProfile(registration.recovery)
|
|
260
|
+
const adapters = Schema.decodeUnknownSync(Schema.Array(CorrectionKind), {
|
|
261
|
+
onExcessProperty: "error"
|
|
262
|
+
})(registration.correctionAdapters)
|
|
263
|
+
if (new Set(adapters).size !== adapters.length) {
|
|
264
|
+
throw registrationFailure(name, "Installed correction adapter kinds must be unique.")
|
|
265
|
+
}
|
|
266
|
+
if (encodeCanonicalJson(adapters) !== encodeCanonicalJson(recovery.correction)) {
|
|
267
|
+
throw registrationFailure(
|
|
268
|
+
name,
|
|
269
|
+
"Installed correction adapters do not exactly match the recovery profile correction axis."
|
|
270
|
+
)
|
|
271
|
+
}
|
|
272
|
+
Schema.decodeUnknownSync(calendarDate)(registration.evidence.reviewedAt)
|
|
273
|
+
if (registration.evidence.observationSources.length === 0 ||
|
|
274
|
+
registration.evidence.correctionSources.length === 0) {
|
|
275
|
+
throw registrationFailure(name, "A publication profile requires observation and correction evidence sources.")
|
|
276
|
+
}
|
|
277
|
+
for (const url of [
|
|
278
|
+
...registration.evidence.observationSources,
|
|
279
|
+
...registration.evidence.correctionSources
|
|
280
|
+
]) Schema.decodeUnknownSync(documentedUrl)(url)
|
|
281
|
+
Schema.decodeUnknownSync(SafeReason)(registration.evidence.correctionFinding)
|
|
282
|
+
} catch (cause) {
|
|
283
|
+
if (cause instanceof RecoveryProfileRegistrationError) throw cause
|
|
284
|
+
throw registrationFailure(name, "Publication profile registration failed strict schema validation.")
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
return profiles
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/** Refuse a subject factory whose executable subject advertises another policy. */
|
|
291
|
+
export const assertRecoveryProfileMatches = (
|
|
292
|
+
registration: string,
|
|
293
|
+
expected: RecoveryCapabilityProfile,
|
|
294
|
+
actual: unknown
|
|
295
|
+
): void => {
|
|
296
|
+
try {
|
|
297
|
+
if (!recoveryCapabilityProfilesEqual(expected, actual)) {
|
|
298
|
+
throw registrationFailure(
|
|
299
|
+
registration,
|
|
300
|
+
"Executable subject recovery behavior does not match its registered profile."
|
|
301
|
+
)
|
|
302
|
+
}
|
|
303
|
+
} catch (cause) {
|
|
304
|
+
if (cause instanceof RecoveryProfileRegistrationError) throw cause
|
|
305
|
+
throw registrationFailure(registration, "Executable subject recovery profile failed strict schema validation.")
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
export const validateRecoveryProfileSubjects = (
|
|
310
|
+
registration: string,
|
|
311
|
+
expected: RecoveryCapabilityProfile,
|
|
312
|
+
actualProfiles: ReadonlyArray<unknown>
|
|
313
|
+
): void => {
|
|
314
|
+
if (actualProfiles.length === 0) {
|
|
315
|
+
throw registrationFailure(registration, "A registered publication adapter produced no release subject.")
|
|
316
|
+
}
|
|
317
|
+
for (const actual of actualProfiles) assertRecoveryProfileMatches(registration, expected, actual)
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/** Decode at module/registration boundaries so malformed policies never run. */
|
|
321
|
+
export const makeRecoveryCapabilityProfile = (value: unknown): RecoveryCapabilityProfile =>
|
|
322
|
+
decodeRecoveryCapabilityProfile(value)
|
|
323
|
+
|
|
324
|
+
/** Unknown provider timing permits the mandatory first reread and nothing else. */
|
|
325
|
+
export const conservativeUnknownRecoveryProfile = makeRecoveryCapabilityProfile({
|
|
326
|
+
observation: "conditional",
|
|
327
|
+
authoritativeAbsence: "unavailable",
|
|
328
|
+
createAuthorization: "none",
|
|
329
|
+
replay: "unsafe",
|
|
330
|
+
identifierReuse: "not-applicable",
|
|
331
|
+
correction: [],
|
|
332
|
+
exposure: "persistent-to-consumers",
|
|
333
|
+
historyRequirement: "optional-evidence",
|
|
334
|
+
readConvergence: {
|
|
335
|
+
contract: { _tag: "unknown" },
|
|
336
|
+
observationRetry: {
|
|
337
|
+
maxAttempts: 1,
|
|
338
|
+
backoff: { baseMs: 0, factor: 1, capMs: 0 },
|
|
339
|
+
totalBudgetMs: 0
|
|
340
|
+
},
|
|
341
|
+
retryEligible: "VisibilityPending | Inconclusive",
|
|
342
|
+
exhaustion: "UncertainSubject with full trace"
|
|
343
|
+
}
|
|
344
|
+
})
|
|
345
|
+
|
|
346
|
+
/** Additional reads are permitted only when their timing basis is explicit. */
|
|
347
|
+
export const isReadConvergenceLagCapable = (profile: RecoveryCapabilityProfile): boolean =>
|
|
348
|
+
profile.readConvergence.contract._tag !== "unknown" &&
|
|
349
|
+
profile.readConvergence.observationRetry.maxAttempts > 1
|