@intentius/chant 0.124.52 → 0.124.54
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/dist/audit/discover.d.ts.map +1 -1
- package/dist/audit/discover.js +3 -1
- package/dist/behaviour.d.ts +1 -1
- package/dist/behaviour.d.ts.map +1 -1
- package/dist/capabilities/templates.d.ts +65 -0
- package/dist/capabilities/templates.d.ts.map +1 -0
- package/dist/capabilities/templates.js +193 -0
- package/dist/capabilities/templates.json +145 -0
- package/dist/change-set-graph.d.ts +35 -3
- package/dist/change-set-graph.d.ts.map +1 -1
- package/dist/change-set-graph.js +60 -9
- package/dist/change-set.d.ts +65 -7
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +23 -12
- package/dist/ci-identity.d.ts +7 -2
- package/dist/ci-identity.d.ts.map +1 -1
- package/dist/ci-identity.js +4 -1
- package/dist/cli/commands/import-index.d.ts +52 -0
- package/dist/cli/commands/import-index.d.ts.map +1 -0
- package/dist/cli/commands/import-index.js +226 -0
- package/dist/cli/commands/lint.d.ts.map +1 -1
- package/dist/cli/commands/lint.js +4 -2
- package/dist/cli/handlers/components.d.ts.map +1 -1
- package/dist/cli/handlers/components.js +11 -2
- package/dist/cli/handlers/fan-out.d.ts.map +1 -1
- package/dist/cli/handlers/fan-out.js +16 -3
- package/dist/cli/handlers/graph.d.ts.map +1 -1
- package/dist/cli/handlers/graph.js +22 -4
- package/dist/cli/handlers/index-cloud.d.ts +14 -0
- package/dist/cli/handlers/index-cloud.d.ts.map +1 -0
- package/dist/cli/handlers/index-cloud.js +22 -0
- package/dist/cli/handlers/index-diff.d.ts +18 -0
- package/dist/cli/handlers/index-diff.d.ts.map +1 -0
- package/dist/cli/handlers/index-diff.js +142 -0
- package/dist/cli/handlers/lifecycle-drift.d.ts +25 -0
- package/dist/cli/handlers/lifecycle-drift.d.ts.map +1 -0
- package/dist/cli/handlers/lifecycle-drift.js +64 -0
- package/dist/cli/handlers/lifecycle.d.ts.map +1 -1
- package/dist/cli/handlers/lifecycle.js +188 -28
- package/dist/cli/handlers/misc.d.ts +9 -0
- package/dist/cli/handlers/misc.d.ts.map +1 -1
- package/dist/cli/handlers/misc.js +77 -0
- package/dist/cli/handlers/pr.d.ts.map +1 -1
- package/dist/cli/handlers/pr.js +15 -2
- package/dist/cli/handlers/promote.d.ts.map +1 -1
- package/dist/cli/handlers/promote.js +89 -15
- package/dist/cli/handlers/query.d.ts.map +1 -1
- package/dist/cli/handlers/query.js +28 -4
- package/dist/cli/handlers/scenario.d.ts.map +1 -1
- package/dist/cli/handlers/scenario.js +8 -7
- package/dist/cli/handlers/search.d.ts +34 -4
- package/dist/cli/handlers/search.d.ts.map +1 -1
- package/dist/cli/handlers/search.js +216 -36
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +55 -1
- package/dist/cli/mcp/lifecycle-tools.d.ts.map +1 -1
- package/dist/cli/mcp/lifecycle-tools.js +3 -2
- package/dist/cli/mcp/resource-handlers.d.ts.map +1 -1
- package/dist/cli/mcp/resource-handlers.js +4 -3
- package/dist/cli/mcp/workspace-tools.js +1 -1
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +55 -2
- package/dist/cli/registry.d.ts +19 -1
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/cloud-lister/aws.d.ts +35 -0
- package/dist/cloud-lister/aws.d.ts.map +1 -0
- package/dist/cloud-lister/aws.js +203 -0
- package/dist/cloud-lister/azure.d.ts +34 -0
- package/dist/cloud-lister/azure.d.ts.map +1 -0
- package/dist/cloud-lister/azure.js +129 -0
- package/dist/cloud-lister/common.d.ts +40 -0
- package/dist/cloud-lister/common.d.ts.map +1 -0
- package/dist/cloud-lister/common.js +83 -0
- package/dist/cloud-lister/credentials.d.ts +50 -0
- package/dist/cloud-lister/credentials.d.ts.map +1 -0
- package/dist/cloud-lister/credentials.js +86 -0
- package/dist/cloud-lister/fakes.d.ts +27 -0
- package/dist/cloud-lister/fakes.d.ts.map +1 -0
- package/dist/cloud-lister/fakes.js +50 -0
- package/dist/cloud-lister/gcp.d.ts +42 -0
- package/dist/cloud-lister/gcp.d.ts.map +1 -0
- package/dist/cloud-lister/gcp.js +143 -0
- package/dist/cloud-lister/guard.d.ts +49 -0
- package/dist/cloud-lister/guard.d.ts.map +1 -0
- package/dist/cloud-lister/guard.js +103 -0
- package/dist/cloud-lister/ids.d.ts +23 -0
- package/dist/cloud-lister/ids.d.ts.map +1 -0
- package/dist/cloud-lister/ids.js +42 -0
- package/dist/cloud-lister/index.d.ts +67 -0
- package/dist/cloud-lister/index.d.ts.map +1 -0
- package/dist/cloud-lister/index.js +102 -0
- package/dist/cloud-lister/kubernetes.d.ts +64 -0
- package/dist/cloud-lister/kubernetes.d.ts.map +1 -0
- package/dist/cloud-lister/kubernetes.js +276 -0
- package/dist/cloud-lister/markers.d.ts +31 -0
- package/dist/cloud-lister/markers.d.ts.map +1 -0
- package/dist/cloud-lister/markers.js +73 -0
- package/dist/cloud-lister/mask.d.ts +31 -0
- package/dist/cloud-lister/mask.d.ts.map +1 -0
- package/dist/cloud-lister/mask.js +74 -0
- package/dist/cloud-lister/sigv4.d.ts +29 -0
- package/dist/cloud-lister/sigv4.d.ts.map +1 -0
- package/dist/cloud-lister/sigv4.js +54 -0
- package/dist/cloud-lister/transport.d.ts +55 -0
- package/dist/cloud-lister/transport.d.ts.map +1 -0
- package/dist/cloud-lister/transport.js +86 -0
- package/dist/cloud-lister/types.d.ts +121 -0
- package/dist/cloud-lister/types.d.ts.map +1 -0
- package/dist/cloud-lister/types.js +24 -0
- package/dist/components/capability-plugin-loader.d.ts.map +1 -1
- package/dist/components/capability-plugin-loader.js +6 -0
- package/dist/components/capability-plugin.d.ts +9 -0
- package/dist/components/capability-plugin.d.ts.map +1 -1
- package/dist/components/capability.d.ts +215 -0
- package/dist/components/capability.d.ts.map +1 -1
- package/dist/components/cli-support.d.ts +21 -0
- package/dist/components/cli-support.d.ts.map +1 -1
- package/dist/components/cli-support.js +58 -14
- package/dist/components/declared-reads.d.ts +38 -0
- package/dist/components/declared-reads.d.ts.map +1 -0
- package/dist/components/declared-reads.js +131 -0
- package/dist/components/deploy-units.d.ts.map +1 -1
- package/dist/components/deploy-units.js +4 -0
- package/dist/components/driver.d.ts +34 -1
- package/dist/components/driver.d.ts.map +1 -1
- package/dist/components/driver.js +66 -3
- package/dist/components/fan-out-run.d.ts +23 -1
- package/dist/components/fan-out-run.d.ts.map +1 -1
- package/dist/components/fan-out-run.js +82 -14
- package/dist/components/fan-out-support.d.ts +6 -0
- package/dist/components/fan-out-support.d.ts.map +1 -1
- package/dist/components/fan-out-support.js +4 -1
- package/dist/components/fan-out.d.ts +28 -0
- package/dist/components/fan-out.d.ts.map +1 -1
- package/dist/components/groups.d.ts +229 -0
- package/dist/components/groups.d.ts.map +1 -0
- package/dist/components/groups.js +760 -0
- package/dist/components/index.d.ts +6 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +4 -0
- package/dist/components/plan-shape-conformance.d.ts +48 -0
- package/dist/components/plan-shape-conformance.d.ts.map +1 -0
- package/dist/components/plan-shape-conformance.js +122 -0
- package/dist/components/pr-run.d.ts +41 -4
- package/dist/components/pr-run.d.ts.map +1 -1
- package/dist/components/pr-run.js +209 -39
- package/dist/components/promote-rounds.d.ts +9 -0
- package/dist/components/promote-rounds.d.ts.map +1 -1
- package/dist/components/promote-rounds.js +23 -2
- package/dist/components/promote.d.ts +17 -0
- package/dist/components/promote.d.ts.map +1 -1
- package/dist/components/promote.js +36 -6
- package/dist/components/release-gate.d.ts +23 -1
- package/dist/components/release-gate.d.ts.map +1 -1
- package/dist/components/release-gate.js +97 -33
- package/dist/components/run-groups.d.ts +58 -0
- package/dist/components/run-groups.d.ts.map +1 -0
- package/dist/components/run-groups.js +78 -0
- package/dist/components/starter-plugin.d.ts +1 -0
- package/dist/components/starter-plugin.d.ts.map +1 -1
- package/dist/components/starter-plugin.js +6 -1
- package/dist/components/verbs/index.d.ts +1 -0
- package/dist/components/verbs/index.d.ts.map +1 -1
- package/dist/components/verbs/index.js +1 -0
- package/dist/components/verbs/member-outputs.d.ts +187 -0
- package/dist/components/verbs/member-outputs.d.ts.map +1 -0
- package/dist/components/verbs/member-outputs.js +218 -0
- package/dist/config.d.ts +60 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +27 -0
- package/dist/deep-observation.d.ts +1 -13
- package/dist/deep-observation.d.ts.map +1 -1
- package/dist/deep-observation.js +5 -22
- package/dist/drift-record.d.ts +542 -0
- package/dist/drift-record.d.ts.map +1 -0
- package/dist/drift-record.js +886 -0
- package/dist/engine-facts.d.ts +144 -0
- package/dist/engine-facts.d.ts.map +1 -0
- package/dist/engine-facts.js +14 -0
- package/dist/graph-ir.d.ts +153 -2
- package/dist/graph-ir.d.ts.map +1 -1
- package/dist/graph-ir.js +224 -6
- package/dist/graph-refs.d.ts +145 -0
- package/dist/graph-refs.d.ts.map +1 -1
- package/dist/graph-refs.js +305 -0
- package/dist/graph-schema/fixtures/adopt.json +15 -0
- package/dist/graph-schema/fixtures/choudoufu.engine-graph.json +169 -0
- package/dist/graph-schema/fixtures/index.json +68 -0
- package/dist/graph-schema/fixtures/plunge.engine-graph.json +158 -0
- package/dist/graph-schema/fixtures.d.ts +23 -0
- package/dist/graph-schema/fixtures.d.ts.map +1 -0
- package/dist/graph-schema/fixtures.js +246 -0
- package/dist/graph-schema/generate.d.ts +15 -0
- package/dist/graph-schema/generate.d.ts.map +1 -0
- package/dist/graph-schema/generate.js +267 -0
- package/dist/graph-schema/graph.schema.json +1387 -0
- package/dist/health.schema.json +2 -1
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/instance-nodes.d.ts +159 -0
- package/dist/instance-nodes.d.ts.map +1 -0
- package/dist/instance-nodes.js +231 -0
- package/dist/lexicon.d.ts +72 -0
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/adoption-file.d.ts +56 -0
- package/dist/lifecycle/adoption-file.d.ts.map +1 -0
- package/dist/lifecycle/adoption-file.js +123 -0
- package/dist/lifecycle/cloud-index.d.ts +186 -0
- package/dist/lifecycle/cloud-index.d.ts.map +1 -0
- package/dist/lifecycle/cloud-index.js +618 -0
- package/dist/lifecycle/derive-edges.d.ts +59 -0
- package/dist/lifecycle/derive-edges.d.ts.map +1 -0
- package/dist/lifecycle/derive-edges.js +126 -0
- package/dist/lifecycle/git.d.ts +10 -9
- package/dist/lifecycle/git.d.ts.map +1 -1
- package/dist/lifecycle/git.js +7 -1
- package/dist/lifecycle/identity-match.d.ts +133 -0
- package/dist/lifecycle/identity-match.d.ts.map +1 -0
- package/dist/lifecycle/identity-match.js +147 -0
- package/dist/lifecycle/index-diff.d.ts +224 -0
- package/dist/lifecycle/index-diff.d.ts.map +1 -0
- package/dist/lifecycle/index-diff.js +327 -0
- package/dist/lifecycle/index-document.d.ts +130 -0
- package/dist/lifecycle/index-document.d.ts.map +1 -0
- package/dist/lifecycle/index-document.js +189 -0
- package/dist/lifecycle/index-drift.d.ts +121 -0
- package/dist/lifecycle/index-drift.d.ts.map +1 -0
- package/dist/lifecycle/index-drift.js +178 -0
- package/dist/lifecycle/index-import.d.ts +168 -0
- package/dist/lifecycle/index-import.d.ts.map +1 -0
- package/dist/lifecycle/index-import.js +515 -0
- package/dist/lifecycle/index-join.d.ts +129 -0
- package/dist/lifecycle/index-join.d.ts.map +1 -0
- package/dist/lifecycle/index-join.js +248 -0
- package/dist/lifecycle/index.d.ts +4 -0
- package/dist/lifecycle/index.d.ts.map +1 -1
- package/dist/lifecycle/index.js +4 -0
- package/dist/lifecycle/observation-baseline.d.ts +61 -21
- package/dist/lifecycle/observation-baseline.d.ts.map +1 -1
- package/dist/lifecycle/observation-baseline.js +144 -19
- package/dist/lifecycle/observe.d.ts.map +1 -1
- package/dist/lifecycle/observe.js +6 -1
- package/dist/lifecycle/query.d.ts +45 -4
- package/dist/lifecycle/query.d.ts.map +1 -1
- package/dist/lifecycle/query.js +89 -7
- package/dist/lifecycle/replay.d.ts +10 -3
- package/dist/lifecycle/replay.d.ts.map +1 -1
- package/dist/lifecycle/replay.js +10 -6
- package/dist/lifecycle/scenario.d.ts +4 -3
- package/dist/lifecycle/scenario.d.ts.map +1 -1
- package/dist/lifecycle/snapshot-store-fake.d.ts +9 -0
- package/dist/lifecycle/snapshot-store-fake.d.ts.map +1 -0
- package/dist/lifecycle/snapshot-store-fake.js +21 -0
- package/dist/lifecycle/snapshot-store-s3.d.ts +102 -0
- package/dist/lifecycle/snapshot-store-s3.d.ts.map +1 -0
- package/dist/lifecycle/snapshot-store-s3.js +254 -0
- package/dist/lifecycle/snapshot-store.d.ts +170 -0
- package/dist/lifecycle/snapshot-store.d.ts.map +1 -0
- package/dist/lifecycle/snapshot-store.js +832 -0
- package/dist/lifecycle/snapshot.d.ts +11 -0
- package/dist/lifecycle/snapshot.d.ts.map +1 -1
- package/dist/lifecycle/snapshot.js +18 -5
- package/dist/lifecycle/type-listing.d.ts +148 -0
- package/dist/lifecycle/type-listing.d.ts.map +1 -0
- package/dist/lifecycle/type-listing.js +166 -0
- package/dist/lint/component-checks.d.ts +15 -1
- package/dist/lint/component-checks.d.ts.map +1 -1
- package/dist/lint/component-checks.js +1 -0
- package/dist/lint/presets/relaxed.json +2 -1
- package/dist/lint/presets/strict.json +2 -1
- package/dist/lint/rules/__fixtures__/comp/comp008/fail/dns.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp008/fail/dns.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp008/fail/dns.component.js +13 -0
- package/dist/lint/rules/__fixtures__/comp/comp008/pass/dns.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp008/pass/dns.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp008/pass/dns.component.js +8 -0
- package/dist/lint/rules/comp/comp008-applies-signal-only-root.d.ts +33 -0
- package/dist/lint/rules/comp/comp008-applies-signal-only-root.d.ts.map +1 -0
- package/dist/lint/rules/comp/comp008-applies-signal-only-root.js +123 -0
- package/dist/lint/rules/comp/index.d.ts +2 -1
- package/dist/lint/rules/comp/index.d.ts.map +1 -1
- package/dist/lint/rules/comp/index.js +4 -1
- package/dist/observation.d.ts +19 -2
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +18 -1
- package/dist/op/activities/activity-contracts.d.ts +1 -1
- package/dist/op/activities/activity-contracts.js +1 -1
- package/dist/op/activities/change-set.d.ts +6 -4
- package/dist/op/activities/change-set.d.ts.map +1 -1
- package/dist/op/activities/change-set.js +4 -2
- package/dist/op/activity-failure.d.ts +27 -0
- package/dist/op/activity-failure.d.ts.map +1 -1
- package/dist/op/activity-failure.js +31 -0
- package/dist/op/index.d.ts +2 -1
- package/dist/op/index.d.ts.map +1 -1
- package/dist/op/index.js +1 -1
- package/dist/op/local-executor.d.ts +5 -1
- package/dist/op/local-executor.d.ts.map +1 -1
- package/dist/op/local-executor.js +22 -8
- package/dist/pr-loop.d.ts +56 -1
- package/dist/pr-loop.d.ts.map +1 -1
- package/dist/pr-loop.js +51 -1
- package/dist/pulumi-urn.d.ts +101 -0
- package/dist/pulumi-urn.d.ts.map +1 -0
- package/dist/pulumi-urn.js +131 -0
- package/dist/release-floors.d.ts +23 -0
- package/dist/release-floors.d.ts.map +1 -0
- package/dist/release-floors.js +22 -0
- package/dist/sensitive-key.d.ts +23 -0
- package/dist/sensitive-key.d.ts.map +1 -0
- package/dist/sensitive-key.js +31 -0
- package/dist/wave-runtime.mjs +234 -234
- package/dist/workspace/adoption-report.d.ts +53 -0
- package/dist/workspace/adoption-report.d.ts.map +1 -0
- package/dist/workspace/adoption-report.js +76 -0
- package/dist/workspace/capabilities-contract.d.ts +7 -0
- package/dist/workspace/capabilities-contract.d.ts.map +1 -1
- package/dist/workspace/capabilities-contract.js +2 -1
- package/dist/workspace/capabilities.schema.json +98 -0
- package/dist/workspace/change-set.schema.json +42 -3
- package/dist/workspace/ci-cloud-identity.d.ts +13 -1
- package/dist/workspace/ci-cloud-identity.d.ts.map +1 -1
- package/dist/workspace/ci-cloud-identity.js +30 -1
- package/dist/workspace/compose-graph.d.ts +10 -1
- package/dist/workspace/compose-graph.d.ts.map +1 -1
- package/dist/workspace/compose-graph.js +6 -1
- package/dist/workspace/conformance/index.d.ts +1 -1
- package/dist/workspace/conformance/index.d.ts.map +1 -1
- package/dist/workspace/conformance/index.js +6 -1
- package/dist/workspace/drift-cli.d.ts +81 -0
- package/dist/workspace/drift-cli.d.ts.map +1 -0
- package/dist/workspace/drift-cli.js +317 -0
- package/dist/workspace/drift.schema.json +672 -0
- package/dist/workspace/graph-cli.d.ts +2 -0
- package/dist/workspace/graph-cli.d.ts.map +1 -1
- package/dist/workspace/graph-cli.js +3 -0
- package/dist/workspace/graph.schema.json +72 -0
- package/dist/workspace/init.d.ts +5 -1
- package/dist/workspace/init.d.ts.map +1 -1
- package/dist/workspace/init.js +55 -9
- package/dist/workspace/ledger.schema.json +1 -1
- package/dist/workspace/nested-graph.d.ts.map +1 -1
- package/dist/workspace/nested-graph.js +2 -0
- package/dist/workspace/pr-report.schema.json +51 -2
- package/dist/workspace/promote-waves.d.ts +112 -0
- package/dist/workspace/promote-waves.d.ts.map +1 -0
- package/dist/workspace/promote-waves.js +290 -0
- package/dist/workspace/promote.d.ts +84 -2
- package/dist/workspace/promote.d.ts.map +1 -1
- package/dist/workspace/promote.js +347 -61
- package/dist/workspace/reason-codes.d.ts +12 -0
- package/dist/workspace/reason-codes.d.ts.map +1 -1
- package/dist/workspace/reason-codes.js +14 -0
- package/dist/workspace/search-contract.d.ts +3 -3
- package/dist/workspace/search-contract.d.ts.map +1 -1
- package/dist/workspace/search-contract.js +2 -0
- package/dist/workspace/search.schema.json +103 -5
- package/package.json +14 -1
- package/src/__fixtures__/drift-record/README.md +58 -0
- package/src/__fixtures__/drift-record/choudoufu-cone.ndjson +4 -0
- package/src/__fixtures__/drift-record/choudoufu-resource.ndjson +3 -0
- package/src/__fixtures__/drift-record/component-status-ledger.json +65 -0
- package/src/__fixtures__/drift-record/component-status.json +91 -0
- package/src/__fixtures__/drift-record/deep-diff.json +259 -0
- package/src/__fixtures__/drift-record/lifecycle-diff-live.json +825 -0
- package/src/__fixtures__/drift-record/live-diff.json +125 -0
- package/src/audit/discover.e2e.test.ts +14 -0
- package/src/audit/discover.ts +3 -1
- package/src/behaviour.ts +1 -1
- package/src/capabilities/templates.json +145 -0
- package/src/capabilities/templates.test.ts +212 -0
- package/src/capabilities/templates.ts +204 -0
- package/src/change-set-bundle.test.ts +83 -0
- package/src/change-set-graph.ts +80 -9
- package/src/change-set.test.ts +24 -0
- package/src/change-set.ts +77 -14
- package/src/ci-identity-targets.test.ts +23 -0
- package/src/ci-identity.ts +10 -4
- package/src/cli/commands/import-index.test.ts +117 -0
- package/src/cli/commands/import-index.ts +265 -0
- package/src/cli/commands/lint.ts +4 -2
- package/src/cli/handlers/components.test.ts +9 -0
- package/src/cli/handlers/components.ts +12 -2
- package/src/cli/handlers/fan-out.ts +17 -3
- package/src/cli/handlers/graph.test.ts +42 -0
- package/src/cli/handlers/graph.ts +26 -4
- package/src/cli/handlers/index-cloud.ts +32 -0
- package/src/cli/handlers/index-diff.test.ts +68 -0
- package/src/cli/handlers/index-diff.ts +146 -0
- package/src/cli/handlers/ledger-root-member.test.ts +161 -0
- package/src/cli/handlers/lifecycle-drift.ts +68 -0
- package/src/cli/handlers/lifecycle.test.ts +33 -11
- package/src/cli/handlers/lifecycle.ts +205 -30
- package/src/cli/handlers/misc.ts +73 -0
- package/src/cli/handlers/pr-waves-blocked.test.ts +37 -2
- package/src/cli/handlers/pr.ts +14 -2
- package/src/cli/handlers/promote.test.ts +64 -0
- package/src/cli/handlers/promote.ts +81 -6
- package/src/cli/handlers/query.ts +27 -4
- package/src/cli/handlers/run-declared-reads-cli.test.ts +187 -0
- package/src/cli/handlers/run-groups-cli.test.ts +229 -0
- package/src/cli/handlers/scenario.test.ts +13 -0
- package/src/cli/handlers/scenario.ts +8 -7
- package/src/cli/handlers/search-index.test.ts +255 -0
- package/src/cli/handlers/search-json.test.ts +1 -1
- package/src/cli/handlers/search-ownership.test.ts +194 -0
- package/src/cli/handlers/search.ts +271 -38
- package/src/cli/main.test.ts +7 -0
- package/src/cli/main.ts +56 -1
- package/src/cli/mcp/lifecycle-tools.ts +3 -2
- package/src/cli/mcp/resource-handlers.ts +4 -3
- package/src/cli/mcp/workspace-tools.ts +1 -1
- package/src/cli/parse-args.ts +40 -2
- package/src/cli/registry.ts +19 -1
- package/src/cloud-lister/aws.test.ts +202 -0
- package/src/cloud-lister/aws.ts +226 -0
- package/src/cloud-lister/azure.test.ts +132 -0
- package/src/cloud-lister/azure.ts +142 -0
- package/src/cloud-lister/common.ts +115 -0
- package/src/cloud-lister/credentials.ts +110 -0
- package/src/cloud-lister/fakes.ts +66 -0
- package/src/cloud-lister/gcp.test.ts +121 -0
- package/src/cloud-lister/gcp.ts +159 -0
- package/src/cloud-lister/guard.test.ts +198 -0
- package/src/cloud-lister/guard.ts +111 -0
- package/src/cloud-lister/ids.ts +54 -0
- package/src/cloud-lister/index.ts +134 -0
- package/src/cloud-lister/kubernetes.test.ts +160 -0
- package/src/cloud-lister/kubernetes.ts +284 -0
- package/src/cloud-lister/markers.ts +74 -0
- package/src/cloud-lister/mask.ts +77 -0
- package/src/cloud-lister/shape.test.ts +81 -0
- package/src/cloud-lister/sigv4.ts +70 -0
- package/src/cloud-lister/transport.ts +118 -0
- package/src/cloud-lister/types.ts +135 -0
- package/src/components/capability-plugin-loader.ts +4 -0
- package/src/components/capability-plugin.ts +10 -0
- package/src/components/capability.ts +229 -0
- package/src/components/cli-support.ts +70 -14
- package/src/components/declared-reads.test.ts +103 -0
- package/src/components/declared-reads.ts +134 -0
- package/src/components/deploy-units.ts +4 -0
- package/src/components/driver.ts +89 -4
- package/src/components/fan-out-run.ts +95 -15
- package/src/components/fan-out-support.ts +10 -1
- package/src/components/fan-out.ts +30 -0
- package/src/components/groups.test.ts +320 -0
- package/src/components/groups.ts +880 -0
- package/src/components/index.ts +42 -0
- package/src/components/plan-shape-conformance.ts +130 -0
- package/src/components/pr-env-run-bundle.test.ts +2 -0
- package/src/components/pr-run.test.ts +516 -3
- package/src/components/pr-run.ts +231 -41
- package/src/components/promote-rounds.ts +25 -2
- package/src/components/promote.ts +55 -5
- package/src/components/registry.test.ts +1 -1
- package/src/components/release-gate.ts +115 -30
- package/src/components/release-groups.test.ts +362 -0
- package/src/components/run-groups.ts +113 -0
- package/src/components/starter-plugin.ts +6 -0
- package/src/components/verbs/index.ts +1 -0
- package/src/components/verbs/member-outputs.test.ts +205 -0
- package/src/components/verbs/member-outputs.ts +308 -0
- package/src/config.ts +44 -0
- package/src/deep-observation.ts +5 -23
- package/src/drift-record.test.ts +596 -0
- package/src/drift-record.ts +1206 -0
- package/src/engine-facts.guard.test.ts +111 -0
- package/src/engine-facts.test.ts +178 -0
- package/src/engine-facts.ts +154 -0
- package/src/gated-waves-bundle.test.ts +2 -0
- package/src/graph-ir-live.test.ts +92 -0
- package/src/graph-ir.ts +317 -7
- package/src/graph-refs.ts +416 -0
- package/src/graph-schema/fixtures/adopt.json +15 -0
- package/src/graph-schema/fixtures/choudoufu.engine-graph.json +169 -0
- package/src/graph-schema/fixtures/index.json +68 -0
- package/src/graph-schema/fixtures/plunge.engine-graph.json +158 -0
- package/src/graph-schema/fixtures.ts +267 -0
- package/src/graph-schema/generate.ts +263 -0
- package/src/graph-schema/graph-schema.test.ts +153 -0
- package/src/graph-schema/graph.schema.json +1387 -0
- package/src/health.schema.json +2 -1
- package/src/identity.ts +2 -0
- package/src/index.ts +2 -0
- package/src/instance-nodes.ts +288 -0
- package/src/lexicon.ts +76 -0
- package/src/lifecycle/__fixtures__/index-diff/20261026T120000Z-aaaaaaaaaaaa.json +149 -0
- package/src/lifecycle/__fixtures__/index-diff/20261026T130000Z-bbbbbbbbbbbb.json +127 -0
- package/src/lifecycle/adoption-file.test.ts +100 -0
- package/src/lifecycle/adoption-file.ts +154 -0
- package/src/lifecycle/cloud-index.test.ts +517 -0
- package/src/lifecycle/cloud-index.ts +736 -0
- package/src/lifecycle/derive-edges.test.ts +193 -0
- package/src/lifecycle/derive-edges.ts +182 -0
- package/src/lifecycle/git.ts +10 -4
- package/src/lifecycle/identity-match.test.ts +308 -0
- package/src/lifecycle/identity-match.ts +257 -0
- package/src/lifecycle/index-diff.test.ts +198 -0
- package/src/lifecycle/index-diff.ts +476 -0
- package/src/lifecycle/index-document.test.ts +64 -0
- package/src/lifecycle/index-document.ts +299 -0
- package/src/lifecycle/index-drift.test.ts +191 -0
- package/src/lifecycle/index-drift.ts +304 -0
- package/src/lifecycle/index-import.test.ts +255 -0
- package/src/lifecycle/index-import.ts +634 -0
- package/src/lifecycle/index-join.test.ts +250 -0
- package/src/lifecycle/index-join.ts +304 -0
- package/src/lifecycle/index-store-load-bearing.test.ts +187 -0
- package/src/lifecycle/index.ts +4 -0
- package/src/lifecycle/member-ledger.test.ts +25 -7
- package/src/lifecycle/observation-baseline.test.ts +72 -1
- package/src/lifecycle/observation-baseline.ts +190 -27
- package/src/lifecycle/observe.ts +6 -1
- package/src/lifecycle/query.test.ts +69 -1
- package/src/lifecycle/query.ts +103 -10
- package/src/lifecycle/replay.test.ts +9 -5
- package/src/lifecycle/replay.ts +9 -5
- package/src/lifecycle/scenario.ts +4 -3
- package/src/lifecycle/snapshot-store-fake.ts +29 -0
- package/src/lifecycle/snapshot-store-s3.ts +316 -0
- package/src/lifecycle/snapshot-store.test.ts +385 -0
- package/src/lifecycle/snapshot-store.ts +981 -0
- package/src/lifecycle/snapshot.test.ts +13 -0
- package/src/lifecycle/snapshot.ts +23 -6
- package/src/lifecycle/type-listing.test.ts +166 -0
- package/src/lifecycle/type-listing.ts +309 -0
- package/src/lint/component-checks.ts +17 -1
- package/src/lint/config.test.ts +3 -0
- package/src/lint/presets/relaxed.json +2 -1
- package/src/lint/presets/strict.json +2 -1
- package/src/lint/rules/__fixtures__/comp/comp008/fail/dns.component.ts +15 -0
- package/src/lint/rules/__fixtures__/comp/comp008/pass/dns.component.ts +10 -0
- package/src/lint/rules/comp/comp.test.ts +2 -1
- package/src/lint/rules/comp/comp008-applies-signal-only-root.ts +121 -0
- package/src/lint/rules/comp/comp008.test.ts +77 -0
- package/src/lint/rules/comp/index.ts +4 -1
- package/src/observation-edges.test.ts +33 -0
- package/src/observation.ts +36 -1
- package/src/op/activities/activity-contracts.ts +1 -1
- package/src/op/activities/change-set.ts +8 -5
- package/src/op/activity-failure.ts +36 -0
- package/src/op/index.ts +2 -1
- package/src/op/local-executor.test.ts +80 -0
- package/src/op/local-executor.ts +27 -9
- package/src/pr-loop-bundle.test.ts +5 -2
- package/src/pr-loop.test.ts +43 -0
- package/src/pr-loop.ts +111 -2
- package/src/pulumi-urn.ts +151 -0
- package/src/release-floors.ts +22 -0
- package/src/sensitive-key.ts +34 -0
- package/src/workspace/adoption-report.test.ts +61 -0
- package/src/workspace/adoption-report.ts +103 -0
- package/src/workspace/capabilities-contract.test.ts +4 -0
- package/src/workspace/capabilities-contract.ts +9 -1
- package/src/workspace/capabilities.schema.json +98 -0
- package/src/workspace/change-set.schema.json +42 -3
- package/src/workspace/ci-cloud-identity.ts +31 -1
- package/src/workspace/compose-graph.test.ts +12 -0
- package/src/workspace/compose-graph.ts +12 -1
- package/src/workspace/conformance/conformance.e2e.test.ts +2 -1
- package/src/workspace/conformance/index.ts +6 -1
- package/src/workspace/drift-cli.test.ts +65 -0
- package/src/workspace/drift-cli.ts +365 -0
- package/src/workspace/drift.schema.json +672 -0
- package/src/workspace/graph-cli.ts +5 -0
- package/src/workspace/graph.schema.json +72 -0
- package/src/workspace/init.test.ts +38 -1
- package/src/workspace/init.ts +50 -8
- package/src/workspace/intent-gaps.test.ts +18 -2
- package/src/workspace/ledger.schema.json +1 -1
- package/src/workspace/nested-graph.ts +1 -0
- package/src/workspace/pr-report.schema.json +51 -2
- package/src/workspace/promote-waves.test.ts +296 -0
- package/src/workspace/promote-waves.ts +340 -0
- package/src/workspace/promote.test.ts +158 -4
- package/src/workspace/promote.ts +398 -57
- package/src/workspace/reason-codes.test.ts +4 -1
- package/src/workspace/reason-codes.ts +14 -0
- package/src/workspace/search-contract.ts +2 -0
- package/src/workspace/search.schema.json +103 -5
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
{
|
|
2
|
+
"index": "v1",
|
|
3
|
+
"stamp": {
|
|
4
|
+
"source": {
|
|
5
|
+
"kind": "cloud",
|
|
6
|
+
"name": "behold-lister",
|
|
7
|
+
"version": "0.0.0"
|
|
8
|
+
},
|
|
9
|
+
"scope": {
|
|
10
|
+
"kind": "cloud",
|
|
11
|
+
"substrate": "aws",
|
|
12
|
+
"scopeId": "000000000000",
|
|
13
|
+
"locations": [
|
|
14
|
+
"us-east-1"
|
|
15
|
+
],
|
|
16
|
+
"types": [
|
|
17
|
+
"AWS::IAM::Role",
|
|
18
|
+
"AWS::S3::Bucket",
|
|
19
|
+
"AWS::SQS::Queue"
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
"scopeKey": "cloud/aws/000000000000/5c1f0e2a9b7d",
|
|
23
|
+
"observedAt": "2026-10-26T13:00:00Z",
|
|
24
|
+
"completedAt": "2026-10-26T13:00:04Z",
|
|
25
|
+
"digest": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
|
|
26
|
+
},
|
|
27
|
+
"coverage": [
|
|
28
|
+
{
|
|
29
|
+
"listedType": "AWS::IAM::Role",
|
|
30
|
+
"location": "us-east-1",
|
|
31
|
+
"verdict": "listed"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"listedType": "AWS::S3::Bucket",
|
|
35
|
+
"location": "us-east-1",
|
|
36
|
+
"verdict": "listed"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"listedType": "AWS::SQS::Queue",
|
|
40
|
+
"location": "us-east-1",
|
|
41
|
+
"verdict": "read-failed",
|
|
42
|
+
"detail": "ListResources returned ThrottlingException"
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"graph": {
|
|
46
|
+
"version": 1,
|
|
47
|
+
"nodes": [
|
|
48
|
+
{
|
|
49
|
+
"id": "aws/000000000000/us-east-1/AWS::IAM::Role/app-role",
|
|
50
|
+
"kind": "AWS::IAM::Role",
|
|
51
|
+
"lexicon": "aws",
|
|
52
|
+
"attrs": {
|
|
53
|
+
"RoleName": "app-role",
|
|
54
|
+
"Path": "/"
|
|
55
|
+
},
|
|
56
|
+
"physicalId": "app-role",
|
|
57
|
+
"listedType": "AWS::IAM::Role",
|
|
58
|
+
"location": "us-east-1",
|
|
59
|
+
"nativeId": "app-role",
|
|
60
|
+
"facts": {
|
|
61
|
+
"observedAt": "2026-10-26T13:00:00Z"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"id": "aws/000000000000/us-east-1/AWS::S3::Bucket/new-bucket",
|
|
66
|
+
"kind": "AWS::S3::Bucket",
|
|
67
|
+
"lexicon": "aws",
|
|
68
|
+
"attrs": {
|
|
69
|
+
"BucketName": "new-bucket"
|
|
70
|
+
},
|
|
71
|
+
"physicalId": "new-bucket",
|
|
72
|
+
"listedType": "AWS::S3::Bucket",
|
|
73
|
+
"location": "us-east-1",
|
|
74
|
+
"nativeId": "new-bucket",
|
|
75
|
+
"facts": {
|
|
76
|
+
"observedAt": "2026-10-26T13:00:00Z"
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"id": "aws/000000000000/us-east-1/AWS::S3::Bucket/web-logs",
|
|
81
|
+
"kind": "AWS::S3::Bucket",
|
|
82
|
+
"lexicon": "aws",
|
|
83
|
+
"attrs": {
|
|
84
|
+
"BucketName": "web-logs",
|
|
85
|
+
"VersioningConfiguration": {
|
|
86
|
+
"Status": "Enabled"
|
|
87
|
+
},
|
|
88
|
+
"Tags": [
|
|
89
|
+
{
|
|
90
|
+
"Key": "env",
|
|
91
|
+
"Value": "dev"
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
"physicalId": "web-logs",
|
|
96
|
+
"listedType": "AWS::S3::Bucket",
|
|
97
|
+
"location": "us-east-1",
|
|
98
|
+
"nativeId": "web-logs",
|
|
99
|
+
"facts": {
|
|
100
|
+
"observedAt": "2026-10-26T13:00:00Z"
|
|
101
|
+
},
|
|
102
|
+
"tags": {
|
|
103
|
+
"env": "dev"
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
],
|
|
107
|
+
"edges": [
|
|
108
|
+
{
|
|
109
|
+
"from": "aws/000000000000/us-east-1/AWS::IAM::Role/app-role",
|
|
110
|
+
"to": "aws/000000000000/us-east-1/AWS::S3::Bucket/web-logs",
|
|
111
|
+
"kind": "ref",
|
|
112
|
+
"viaAttr": "Policies",
|
|
113
|
+
"origin": "derived",
|
|
114
|
+
"rule": "aws:AWS::IAM::Role:Policies"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"from": "aws/000000000000/us-east-1/AWS::IAM::Role/app-role",
|
|
118
|
+
"to": "aws/000000000000/us-east-1/AWS::S3::Bucket/new-bucket",
|
|
119
|
+
"kind": "ref",
|
|
120
|
+
"viaAttr": "Policies",
|
|
121
|
+
"origin": "derived",
|
|
122
|
+
"rule": "aws:AWS::IAM::Role:Policies"
|
|
123
|
+
}
|
|
124
|
+
],
|
|
125
|
+
"groups": {}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* #4536: the adoption file (`adopt: v1`). Refusals on its own and against
|
|
3
|
+
* the index version it is read with, and the file an index import report
|
|
4
|
+
* gives. Pure; nothing reaches a cloud.
|
|
5
|
+
*/
|
|
6
|
+
import { describe, expect, test } from "vitest";
|
|
7
|
+
import {
|
|
8
|
+
adoptionFileFromImportReport,
|
|
9
|
+
adoptionFileProblems,
|
|
10
|
+
adoptionFileProblemsAgainst,
|
|
11
|
+
validateAdoptionFile,
|
|
12
|
+
type AdoptionFile,
|
|
13
|
+
} from "./adoption-file";
|
|
14
|
+
import { indexDocumentDigest, indexScopeKey, indexVersionName, type CloudIndexScope, type IndexDocument } from "./index-document";
|
|
15
|
+
import type { IndexImportReport } from "./index-import";
|
|
16
|
+
|
|
17
|
+
const SCOPE: CloudIndexScope = { kind: "cloud", substrate: "aws", scopeId: "111", locations: ["us-east-1"], types: "*" };
|
|
18
|
+
const BUCKET = "aws/111/us-east-1/AWS::S3::Bucket/logs";
|
|
19
|
+
const QUEUE = "aws/111/us-east-1/AWS::SQS::Queue/jobs";
|
|
20
|
+
const graph = {
|
|
21
|
+
version: 1 as const,
|
|
22
|
+
nodes: [
|
|
23
|
+
{ id: BUCKET, kind: "AWS::S3::Bucket", lexicon: "aws", attrs: {}, listedType: "AWS::S3::Bucket", location: "us-east-1", nativeId: "logs" },
|
|
24
|
+
{ id: QUEUE, kind: "AWS::SQS::Queue", lexicon: "aws", attrs: {}, listedType: "AWS::SQS::Queue", location: "us-east-1", nativeId: "jobs" },
|
|
25
|
+
],
|
|
26
|
+
edges: [],
|
|
27
|
+
groups: {},
|
|
28
|
+
};
|
|
29
|
+
const DOC: IndexDocument = {
|
|
30
|
+
index: "v1",
|
|
31
|
+
stamp: { source: { kind: "cloud", name: "behold-lister" }, scope: SCOPE, scopeKey: indexScopeKey(SCOPE), observedAt: "2026-10-26T09:00:00Z", digest: indexDocumentDigest({ graph, coverage: [] }) },
|
|
32
|
+
coverage: [],
|
|
33
|
+
graph,
|
|
34
|
+
};
|
|
35
|
+
const file = (over: Partial<AdoptionFile> = {}): AdoptionFile => ({
|
|
36
|
+
adopt: "v1",
|
|
37
|
+
index: { scopeKey: DOC.stamp.scopeKey, version: indexVersionName(DOC.stamp.observedAt, DOC.stamp.digest), digest: DOC.stamp.digest },
|
|
38
|
+
select: [{ node: BUCKET, as: "aws_s3_bucket.logs", type: "aws_s3_bucket" }],
|
|
39
|
+
...over,
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
describe("adoption file (#4536)", () => {
|
|
43
|
+
test("a file naming the version it is read with is accepted, with or without a sha256: prefix", () => {
|
|
44
|
+
expect(adoptionFileProblemsAgainst(file(), DOC)).toEqual([]);
|
|
45
|
+
const prefixed = file();
|
|
46
|
+
prefixed.index = { ...prefixed.index, digest: `sha256:${prefixed.index.digest}` };
|
|
47
|
+
expect(adoptionFileProblemsAgainst(prefixed, DOC)).toEqual([]);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
test("a digest, version or scope key that is not the version's is refused", () => {
|
|
51
|
+
const other = "0".repeat(64);
|
|
52
|
+
const wrongDigest = file();
|
|
53
|
+
wrongDigest.index = { ...wrongDigest.index, digest: other, version: indexVersionName(DOC.stamp.observedAt, other) };
|
|
54
|
+
expect(adoptionFileProblemsAgainst(wrongDigest, DOC).join("\n")).toMatch(/digest does not match/);
|
|
55
|
+
const wrongScope = file();
|
|
56
|
+
wrongScope.index = { ...wrongScope.index, scopeKey: "cloud/aws/222/abcdefabcdef" };
|
|
57
|
+
expect(adoptionFileProblemsAgainst(wrongScope, DOC).join("\n")).toMatch(/scopeKey/);
|
|
58
|
+
const wrongVersion = file();
|
|
59
|
+
wrongVersion.index = { ...wrongVersion.index, version: indexVersionName("2026-10-25T09:00:00Z", DOC.stamp.digest) };
|
|
60
|
+
expect(adoptionFileProblemsAgainst(wrongVersion, DOC).join("\n")).toMatch(/is not the version read/);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
test("a version name that does not carry the digest is refused on its own", () => {
|
|
64
|
+
const f = file();
|
|
65
|
+
f.index = { ...f.index, version: "20261026T090000Z-000000000000.json" };
|
|
66
|
+
expect(adoptionFileProblems(f).join("\n")).toMatch(/does not name the digest/);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
test("a node the version does not hold is refused by name", () => {
|
|
70
|
+
const f = file({ select: [{ node: "aws/111/us-east-1/AWS::S3::Bucket/gone", as: "aws_s3_bucket.gone" }] });
|
|
71
|
+
expect(() => validateAdoptionFile(f, DOC)).toThrow(/AWS::S3::Bucket\/gone is not in index version/);
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
test("no select, a node selected twice and two nodes at one address are refused", () => {
|
|
75
|
+
expect(adoptionFileProblems(file({ select: [] }))).toContain("select names no node");
|
|
76
|
+
const twice = adoptionFileProblems(file({ select: [{ node: BUCKET, as: "a" }, { node: BUCKET, as: "b" }] }));
|
|
77
|
+
expect(twice.join("\n")).toMatch(/selected twice/);
|
|
78
|
+
const oneAddress = adoptionFileProblems(file({ select: [{ node: BUCKET, as: "a" }, { node: QUEUE, as: "a" }] }));
|
|
79
|
+
expect(oneAddress.join("\n")).toMatch(/two nodes are adopted as a/);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
test("an import report gives a file with each imported resource as its logical id; declared and unsupported ones are left out", () => {
|
|
83
|
+
const report: IndexImportReport = {
|
|
84
|
+
report: "chant-index-import/v1",
|
|
85
|
+
index: [{ scopeKey: DOC.stamp.scopeKey, observedAt: DOC.stamp.observedAt, digest: DOC.stamp.digest, source: "behold-lister" }],
|
|
86
|
+
selection: { all: true },
|
|
87
|
+
resources: [
|
|
88
|
+
{ node: QUEUE, identity: { substrate: "aws", scopeId: "111", listedType: "AWS::SQS::Queue", location: "us-east-1", nativeId: "jobs" }, cloudIds: [], lexicon: "aws", kind: "AWS::SQS::Queue", status: "imported", logicalId: "QueueJobs", group: "" },
|
|
89
|
+
{ node: BUCKET, identity: { substrate: "aws", scopeId: "111", listedType: "AWS::S3::Bucket", location: "us-east-1", nativeId: "logs" }, cloudIds: [], lexicon: "aws", kind: "AWS::S3::Bucket", status: "declared", entity: "logs" },
|
|
90
|
+
],
|
|
91
|
+
parameters: [],
|
|
92
|
+
groups: [],
|
|
93
|
+
};
|
|
94
|
+
const f = adoptionFileFromImportReport(report);
|
|
95
|
+
expect(f.select).toEqual([{ node: QUEUE, as: "QueueJobs", type: "AWS::SQS::Queue" }]);
|
|
96
|
+
expect(adoptionFileProblemsAgainst(f, DOC)).toEqual([]);
|
|
97
|
+
expect(() => adoptionFileFromImportReport({ ...report, index: [...report.index, { ...report.index[0], scopeKey: "cloud/aws/111/x" }] })).toThrow(/names one index version/);
|
|
98
|
+
expect(() => adoptionFileFromImportReport({ ...report, resources: [report.resources[1]] })).toThrow(/nothing to adopt/);
|
|
99
|
+
});
|
|
100
|
+
});
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The adoption file, `adopt: "v1"` (chant#4536; ruled on
|
|
3
|
+
* INTENTIUS/choudoufu#2284 Q1, 2026-10-26).
|
|
4
|
+
*
|
|
5
|
+
* One input for the three engines that adopt an indexed resource: choudoufu
|
|
6
|
+
* `live-import`, plunge `stack adopt` and chant's CloudFormation import. It
|
|
7
|
+
* names one index version (scope key, version name and digest) and the nodes
|
|
8
|
+
* to adopt from it. Each selected node carries the engine's address for it
|
|
9
|
+
* and, where the inventory type joins to more than one engine type, the
|
|
10
|
+
* engine type.
|
|
11
|
+
*
|
|
12
|
+
* The index proposes and the live read decides: an engine reads each object
|
|
13
|
+
* again before it writes anything. The file only says which object and
|
|
14
|
+
* where. An engine refuses a file whose index digest does not match the
|
|
15
|
+
* version it loads, and a node that version does not hold
|
|
16
|
+
* ({@link validateAdoptionFile}).
|
|
17
|
+
*
|
|
18
|
+
* Its JSON Schema is `#/$defs/AdoptionFile` in ../graph-schema/graph.schema.json,
|
|
19
|
+
* generated from these types; the Go engines read the JSON and test against
|
|
20
|
+
* ../graph-schema/fixtures/adopt.json.
|
|
21
|
+
*
|
|
22
|
+
* `chant import --index ... --adopt-out <file>` writes one from the import
|
|
23
|
+
* report ({@link adoptionFileFromImportReport}).
|
|
24
|
+
*/
|
|
25
|
+
import { NEXT_RELEASE } from "../release-floors";
|
|
26
|
+
import { indexVersionName, type IndexDocument } from "./index-document";
|
|
27
|
+
import type { IndexImportReport } from "./index-import";
|
|
28
|
+
|
|
29
|
+
/** The first chant that writes or reads an adoption file. */
|
|
30
|
+
export const ADOPTION_FILE_FLOOR = NEXT_RELEASE;
|
|
31
|
+
|
|
32
|
+
/** The index version an adoption file reads from. */
|
|
33
|
+
export interface AdoptionIndexRef {
|
|
34
|
+
/** The version's `stamp.scopeKey`: `cloud/<substrate>/<scopeId>/<scope digest>`. */
|
|
35
|
+
scopeKey: string;
|
|
36
|
+
/** The version's file name under the scope key: `<observedAt>-<digest12>.json`. */
|
|
37
|
+
version: string;
|
|
38
|
+
/** The version's `stamp.digest`, sha256 hex. A `sha256:` prefix is accepted and ignored. */
|
|
39
|
+
digest: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** One node to adopt. */
|
|
43
|
+
export interface AdoptionSelection {
|
|
44
|
+
/** The index node id: `<substrate>/<scopeId>/<location>/<listedType>/<nativeId>`. */
|
|
45
|
+
node: string;
|
|
46
|
+
/**
|
|
47
|
+
* The engine's address for the object: a Terraform address for choudoufu,
|
|
48
|
+
* a URN name and parent for plunge, an entity (logical) name for chant.
|
|
49
|
+
*/
|
|
50
|
+
as: string;
|
|
51
|
+
/**
|
|
52
|
+
* The engine's type (`aws_lb`, `aws:s3/bucket:Bucket`, `AWS::S3::Bucket`).
|
|
53
|
+
* Left out only when the node's listed type joins to exactly one engine
|
|
54
|
+
* type; an engine refuses an ambiguous join without it, naming every
|
|
55
|
+
* candidate.
|
|
56
|
+
*/
|
|
57
|
+
type?: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** An adoption file (`adopt: "v1"`): one index version and the nodes to adopt from it. */
|
|
61
|
+
export interface AdoptionFile {
|
|
62
|
+
adopt: "v1";
|
|
63
|
+
index: AdoptionIndexRef;
|
|
64
|
+
select: AdoptionSelection[];
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const bareDigest = (d: string): string => d.replace(/^sha256:/, "");
|
|
68
|
+
|
|
69
|
+
/** Refusals of an adoption file on its own: shape, version name, duplicate nodes and addresses. */
|
|
70
|
+
export function adoptionFileProblems(file: AdoptionFile): string[] {
|
|
71
|
+
const problems: string[] = [];
|
|
72
|
+
if (file.adopt !== "v1") problems.push(`adoption file version "${String(file.adopt)}" is not v1`);
|
|
73
|
+
const ix = file.index;
|
|
74
|
+
if (!ix || typeof ix.scopeKey !== "string" || ix.scopeKey === "") problems.push("index.scopeKey is missing");
|
|
75
|
+
if (!ix || typeof ix.digest !== "string" || !/^[0-9a-f]{12,}$/.test(bareDigest(ix.digest))) {
|
|
76
|
+
problems.push(`index.digest "${String(ix?.digest)}" is not sha256 hex`);
|
|
77
|
+
} else if (typeof ix.version !== "string" || !/^\d{8}T\d{6}Z-[0-9a-f]{12}\.json$/.test(ix.version)) {
|
|
78
|
+
problems.push(`index.version "${String(ix?.version)}" is not an index version name (<observedAt>-<digest12>.json)`);
|
|
79
|
+
} else if (!ix.version.endsWith(`-${bareDigest(ix.digest).slice(0, 12)}.json`)) {
|
|
80
|
+
problems.push(`index.version ${ix.version} does not name the digest ${bareDigest(ix.digest).slice(0, 12)}`);
|
|
81
|
+
}
|
|
82
|
+
if (!Array.isArray(file.select) || file.select.length === 0) {
|
|
83
|
+
problems.push("select names no node");
|
|
84
|
+
return problems;
|
|
85
|
+
}
|
|
86
|
+
const nodes = new Set<string>();
|
|
87
|
+
const addresses = new Set<string>();
|
|
88
|
+
for (const s of file.select) {
|
|
89
|
+
if (!s.node) problems.push("a selection has no node");
|
|
90
|
+
if (!s.as) problems.push(`${s.node}: no engine address (as)`);
|
|
91
|
+
if (s.node && nodes.has(s.node)) problems.push(`${s.node} is selected twice`);
|
|
92
|
+
if (s.as && addresses.has(s.as)) problems.push(`two nodes are adopted as ${s.as}`);
|
|
93
|
+
nodes.add(s.node);
|
|
94
|
+
addresses.add(s.as);
|
|
95
|
+
}
|
|
96
|
+
return problems;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Refusals of an adoption file against the index version it is read with:
|
|
101
|
+
* a scope key, version or digest that is not that version's, and a selected
|
|
102
|
+
* node the version does not hold. Empty when the file can be used.
|
|
103
|
+
*/
|
|
104
|
+
export function adoptionFileProblemsAgainst(file: AdoptionFile, doc: IndexDocument): string[] {
|
|
105
|
+
const problems = adoptionFileProblems(file);
|
|
106
|
+
const { stamp } = doc;
|
|
107
|
+
if (file.index.scopeKey !== stamp.scopeKey) problems.push(`index.scopeKey ${file.index.scopeKey} is not the version's ${stamp.scopeKey}`);
|
|
108
|
+
if (bareDigest(file.index.digest) !== bareDigest(stamp.digest)) problems.push(`index.digest does not match the version's digest ${bareDigest(stamp.digest).slice(0, 12)}`);
|
|
109
|
+
const version = indexVersionName(stamp.observedAt, stamp.digest);
|
|
110
|
+
if (file.index.version !== version) problems.push(`index.version ${file.index.version} is not the version read (${version})`);
|
|
111
|
+
const held = new Set(doc.graph.nodes.map((n) => n.id));
|
|
112
|
+
for (const s of file.select ?? []) {
|
|
113
|
+
if (s.node && !held.has(s.node)) problems.push(`${s.node} is not in index version ${version}`);
|
|
114
|
+
}
|
|
115
|
+
return problems;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** Throw on the first refusal of {@link adoptionFileProblemsAgainst}, or of {@link adoptionFileProblems} with no document. */
|
|
119
|
+
export function validateAdoptionFile(file: AdoptionFile, doc?: IndexDocument): void {
|
|
120
|
+
const problems = doc ? adoptionFileProblemsAgainst(file, doc) : adoptionFileProblems(file);
|
|
121
|
+
if (problems.length > 0) throw new Error(`adoption file refused: ${problems.join("; ")}`);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* The adoption file for what an index import wrote: every `imported`
|
|
126
|
+
* resource, adopted as its logical id, with its lexicon kind as the type
|
|
127
|
+
* (`AWS::S3::Bucket`). Declared and unsupported resources are left out. Refuses a report
|
|
128
|
+
* read from more than one index version, since an adoption file names one.
|
|
129
|
+
*/
|
|
130
|
+
export function adoptionFileFromImportReport(report: IndexImportReport): AdoptionFile {
|
|
131
|
+
if (report.index.length !== 1) {
|
|
132
|
+
throw new Error(
|
|
133
|
+
`an adoption file names one index version; this import read ${report.index.length} (${report.index.map((i) => i.scopeKey).join(", ")})`,
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
const [ix] = report.index;
|
|
137
|
+
const select: AdoptionSelection[] = report.resources
|
|
138
|
+
.filter((r) => r.status === "imported" && r.logicalId !== undefined)
|
|
139
|
+
.map((r) => ({ node: r.node, as: r.logicalId!, ...(r.kind ? { type: r.kind } : {}) }))
|
|
140
|
+
.sort((a, b) => (a.node < b.node ? -1 : a.node > b.node ? 1 : 0));
|
|
141
|
+
if (select.length === 0) throw new Error("the import wrote no resource, so there is nothing to adopt");
|
|
142
|
+
const file: AdoptionFile = {
|
|
143
|
+
adopt: "v1",
|
|
144
|
+
index: { scopeKey: ix.scopeKey, version: indexVersionName(ix.observedAt, ix.digest), digest: bareDigest(ix.digest) },
|
|
145
|
+
select,
|
|
146
|
+
};
|
|
147
|
+
validateAdoptionFile(file);
|
|
148
|
+
return file;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/** An adoption file as written: two-space JSON and a final newline. */
|
|
152
|
+
export function adoptionFileJson(file: AdoptionFile): string {
|
|
153
|
+
return JSON.stringify(file, null, 2) + "\n";
|
|
154
|
+
}
|