@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
package/src/health.schema.json
CHANGED
package/src/identity.ts
CHANGED
|
@@ -369,6 +369,8 @@ export function unresolvedReasonText(reason: UnobservedReason | undefined): stri
|
|
|
369
369
|
return "the substrate exposes no self-query";
|
|
370
370
|
case "filtered":
|
|
371
371
|
return "withheld";
|
|
372
|
+
case "not-reached":
|
|
373
|
+
return "the self-query never answered";
|
|
372
374
|
default:
|
|
373
375
|
return "no reason given";
|
|
374
376
|
}
|
package/src/index.ts
CHANGED
|
@@ -32,6 +32,8 @@ export * from "./discovery/cache";
|
|
|
32
32
|
export * from "./build";
|
|
33
33
|
export * from "./env";
|
|
34
34
|
export * from "./graph-ir";
|
|
35
|
+
// Engine facts and the engine graph document (#4527): types for readers that show the graph.
|
|
36
|
+
export * from "./engine-facts";
|
|
35
37
|
export * from "./graph-detail";
|
|
36
38
|
export * from "./graph-mermaid";
|
|
37
39
|
export * from "./graph-dot";
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Instance nodes (#4454): one graph node per `count` or `for_each` instance,
|
|
3
|
+
* under the node of the block that declares it.
|
|
4
|
+
*
|
|
5
|
+
* A lexicon whose entity is a block that expands into instances (terraform's
|
|
6
|
+
* `aws_eip.pool`, applied as `aws_eip.pool[0]`, `aws_eip.pool[1]`, ...) has
|
|
7
|
+
* one graph node per block. A plan, a state read and a drift read all speak
|
|
8
|
+
* per instance. This module is the contract that puts both on the graph:
|
|
9
|
+
*
|
|
10
|
+
* - An instance's node id is its block's node id followed by the instance key
|
|
11
|
+
* exactly as Terraform prints it: `<blockNode>[0]`, `<blockNode>["a"]`.
|
|
12
|
+
* Inside a workspace the member goes in front as for any node, so
|
|
13
|
+
* `<member>/<blockNode>[0]`.
|
|
14
|
+
* - The block node keeps existing and is the rollup: its verdict is the
|
|
15
|
+
* aggregate of its instances' ({@link rollupInstances}).
|
|
16
|
+
* - In the graph IR an instance node is a child of its block node. It carries
|
|
17
|
+
* `instanceOf`, the block node's id, and `instanceKey`, the key on its own
|
|
18
|
+
* (`IRNode` in `./graph-ir.ts`). It has no edges and no attrs of its own:
|
|
19
|
+
* both stay on the block, since a reference in the source is block to block.
|
|
20
|
+
* - A change-set entry and a drift row for an instance carry the instance
|
|
21
|
+
* node's id as `node`, and the block node's id as `instanceOf`.
|
|
22
|
+
*
|
|
23
|
+
* The graph lists the instances a read of the source can count: a literal
|
|
24
|
+
* `count` or a literal `for_each`, or (#4486) one that reads a variable whose
|
|
25
|
+
* value the root's files give. An expansion that only a plan can count has
|
|
26
|
+
* no instance nodes in the declared graph, and an entry
|
|
27
|
+
* for one of its instances still names the instance id by the rule above,
|
|
28
|
+
* with `instanceOf` saying which block node to hang it under.
|
|
29
|
+
*
|
|
30
|
+
* Under a module call that is itself expanded (#4486), the module key goes
|
|
31
|
+
* on the call segment it belongs to, as Terraform prints it, and the
|
|
32
|
+
* block's own key stays at the end: `module.app[0].aws_eip.pool[1]` in root
|
|
33
|
+
* `estate` is `estate/module.app[0]/aws_eip.pool[1]`, under the block node
|
|
34
|
+
* `estate/module.app/aws_eip.pool`. The node also carries `instanceScope`,
|
|
35
|
+
* the expanded module path as Terraform prints it (`module.app[0]`), and its
|
|
36
|
+
* `instanceKey` is the block's own key, absent when only the module call is
|
|
37
|
+
* expanded. With no module call expanded the rule is the one above. The
|
|
38
|
+
* module call's own node gets instance nodes by the first rule,
|
|
39
|
+
* `estate/module.app[0]`.
|
|
40
|
+
*
|
|
41
|
+
* Imports nothing at run time, so it bundles with `./change-set.ts`.
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
import type { EngineFacts } from "./engine-facts";
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Why the declared graph leaves an expanded block as one node (#4489): the
|
|
48
|
+
* codes of a block node's `instanceRollup`. Each is in the read contract's
|
|
49
|
+
* closed list (`workspace/reason-codes.ts`).
|
|
50
|
+
*/
|
|
51
|
+
export const INSTANCE_ROLLUP_CODES = [
|
|
52
|
+
"instances-each-value",
|
|
53
|
+
"instances-merge",
|
|
54
|
+
"instances-value-unknown",
|
|
55
|
+
"instances-form-unread",
|
|
56
|
+
"instances-over-limit",
|
|
57
|
+
"instances-module-uncounted",
|
|
58
|
+
] as const;
|
|
59
|
+
export type InstanceRollupCode = (typeof INSTANCE_ROLLUP_CODES)[number];
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* On a block node whose `count` or `for_each` the declared graph cannot
|
|
63
|
+
* count (#4489): why, and the expression it could not count. `argument` and
|
|
64
|
+
* `expression` are the block's own, or with `call` those of the enclosing
|
|
65
|
+
* module call that could not be counted.
|
|
66
|
+
*/
|
|
67
|
+
export interface InstanceRollup {
|
|
68
|
+
code: InstanceRollupCode;
|
|
69
|
+
/** `count` or `for_each`. */
|
|
70
|
+
argument: "count" | "for_each";
|
|
71
|
+
/** The expression as written, without the `${ }` around it. */
|
|
72
|
+
expression: string;
|
|
73
|
+
/** With `instances-module-uncounted`: the module call, `module.app` or `module.app.module.db`. */
|
|
74
|
+
call?: string;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** An entity's duck-typed `instanceRollup`, when it is one (#4489). */
|
|
78
|
+
export function entityInstanceRollup(entity: unknown): InstanceRollup | undefined {
|
|
79
|
+
const r = (entity as { instanceRollup?: unknown } | null)?.instanceRollup;
|
|
80
|
+
if (typeof r !== "object" || r === null) return undefined;
|
|
81
|
+
const { code, argument, expression, call } = r as Record<string, unknown>;
|
|
82
|
+
if (!(INSTANCE_ROLLUP_CODES as readonly unknown[]).includes(code)) return undefined;
|
|
83
|
+
if (argument !== "count" && argument !== "for_each") return undefined;
|
|
84
|
+
if (typeof expression !== "string") return undefined;
|
|
85
|
+
return { code: code as InstanceRollupCode, argument, expression, ...(typeof call === "string" ? { call } : {}) };
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** A `[...]` instance key, a number or a quoted string with escapes. */
|
|
89
|
+
const KEY = /\[(?:"(?:[^"\\]|\\.)*"|\d+)\]/;
|
|
90
|
+
const TRAILING_KEY = new RegExp(`(${KEY.source})$`);
|
|
91
|
+
|
|
92
|
+
/** An instance key as Terraform prints it: `[0]` for a `count` index, `["a"]` for a `for_each` key. */
|
|
93
|
+
export function instanceKeyLiteral(key: string | number): string {
|
|
94
|
+
return typeof key === "number" ? `[${key}]` : `[${JSON.stringify(key)}]`;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** The instance node id for a block node id and an instance key as Terraform prints it. */
|
|
98
|
+
export function instanceNodeId(blockNode: string, key: string): string {
|
|
99
|
+
return `${blockNode}${key}`;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* The instance key a terraform-family address ends with, as printed
|
|
104
|
+
* (`[0]`, `["a"]`), or undefined when it has none or when a module call on
|
|
105
|
+
* the way to it is expanded, which rolls up to the block (see the module doc).
|
|
106
|
+
*/
|
|
107
|
+
export function terraformInstanceKey(address: string): string | undefined {
|
|
108
|
+
const m = TRAILING_KEY.exec(address);
|
|
109
|
+
if (!m) return undefined;
|
|
110
|
+
const head = address.slice(0, m.index);
|
|
111
|
+
if (head.includes("[")) return undefined;
|
|
112
|
+
return m[1];
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/** One part of a terraform address: a name and the `[...]` key that follows it, if any. */
|
|
116
|
+
interface AddressPart {
|
|
117
|
+
name: string;
|
|
118
|
+
key?: string;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** Split a terraform address on its dots, keeping each part's `[...]` key. Quoted keys may hold `.` or `]`. */
|
|
122
|
+
function addressParts(address: string): AddressPart[] {
|
|
123
|
+
const parts: AddressPart[] = [];
|
|
124
|
+
let name = "";
|
|
125
|
+
let key = "";
|
|
126
|
+
let depth = 0;
|
|
127
|
+
let quoted = false;
|
|
128
|
+
const flush = (): void => {
|
|
129
|
+
if (name.length > 0) parts.push({ name, ...(key ? { key } : {}) });
|
|
130
|
+
name = "";
|
|
131
|
+
key = "";
|
|
132
|
+
};
|
|
133
|
+
for (let i = 0; i < address.length; i++) {
|
|
134
|
+
const c = address[i]!;
|
|
135
|
+
if (depth > 0) {
|
|
136
|
+
key += c;
|
|
137
|
+
if (quoted) {
|
|
138
|
+
if (c === "\\") key += address[++i] ?? "";
|
|
139
|
+
else if (c === '"') quoted = false;
|
|
140
|
+
} else if (c === '"') quoted = true;
|
|
141
|
+
else if (c === "]") depth--;
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
if (c === "[") {
|
|
145
|
+
depth++;
|
|
146
|
+
key += c;
|
|
147
|
+
} else if (c === ".") flush();
|
|
148
|
+
else name += c;
|
|
149
|
+
}
|
|
150
|
+
flush();
|
|
151
|
+
return parts;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/** Where one terraform-family instance address sits, relative to its root (#4486). */
|
|
155
|
+
export interface TerraformInstancePath {
|
|
156
|
+
/** The block's key in its root: `module.app/aws_eip.pool`. */
|
|
157
|
+
block: string;
|
|
158
|
+
/** The instance node's key in its root: `module.app[0]/aws_eip.pool[1]`. */
|
|
159
|
+
instance: string;
|
|
160
|
+
/** The block's own instance key, `[1]`, absent when the block itself is not expanded. */
|
|
161
|
+
key?: string;
|
|
162
|
+
/** The expanded module path, `module.app[0]`, absent when no module call on the way is expanded. */
|
|
163
|
+
scope?: string;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* The block key and instance node key a terraform-family address names, or
|
|
168
|
+
* undefined when nothing on it is expanded (no `[...]` anywhere) or the
|
|
169
|
+
* address is not a block's. `module.app[0].aws_eip.pool[1]` is block
|
|
170
|
+
* `module.app/aws_eip.pool`, instance `module.app[0]/aws_eip.pool[1]`, key
|
|
171
|
+
* `[1]`, scope `module.app[0]`.
|
|
172
|
+
*/
|
|
173
|
+
export function terraformInstancePath(address: string): TerraformInstancePath | undefined {
|
|
174
|
+
const parts = addressParts(address);
|
|
175
|
+
const blockScope: string[] = [];
|
|
176
|
+
const instanceScope: string[] = [];
|
|
177
|
+
let expandedScope = false;
|
|
178
|
+
let i = 0;
|
|
179
|
+
while (parts[i]?.name === "module" && i + 1 < parts.length) {
|
|
180
|
+
const call = parts[i + 1]!;
|
|
181
|
+
blockScope.push(`module.${call.name}`);
|
|
182
|
+
instanceScope.push(`module.${call.name}${call.key ?? ""}`);
|
|
183
|
+
if (call.key) expandedScope = true;
|
|
184
|
+
i += 2;
|
|
185
|
+
}
|
|
186
|
+
const rest = parts.slice(i);
|
|
187
|
+
let block: string;
|
|
188
|
+
let key: string | undefined;
|
|
189
|
+
if (rest.length === 0) {
|
|
190
|
+
// The module call itself, a block of its caller.
|
|
191
|
+
if (blockScope.length === 0) return undefined;
|
|
192
|
+
const call = blockScope.pop()!;
|
|
193
|
+
const inst = instanceScope.pop()!;
|
|
194
|
+
block = call;
|
|
195
|
+
key = inst.length > call.length ? inst.slice(call.length) : undefined;
|
|
196
|
+
expandedScope = instanceScope.some((s, n) => s !== blockScope[n]);
|
|
197
|
+
} else if (rest[0]!.name === "data" && rest.length >= 3) {
|
|
198
|
+
block = `data.${rest[1]!.name}.${rest[2]!.name}`;
|
|
199
|
+
key = rest[2]!.key;
|
|
200
|
+
} else if (rest.length >= 2) {
|
|
201
|
+
block = `${rest[0]!.name}.${rest[1]!.name}`;
|
|
202
|
+
key = rest[1]!.key;
|
|
203
|
+
} else return undefined;
|
|
204
|
+
if (key === undefined && !expandedScope) return undefined;
|
|
205
|
+
const scope = expandedScope ? instanceScope.join(".") : undefined;
|
|
206
|
+
return {
|
|
207
|
+
block: [...blockScope, block].join("/"),
|
|
208
|
+
instance: [...(expandedScope ? instanceScope : blockScope), `${block}${key ?? ""}`].join("/"),
|
|
209
|
+
...(key !== undefined ? { key } : {}),
|
|
210
|
+
...(scope !== undefined ? { scope } : {}),
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* One instance's observed verdict, carried on its block's
|
|
216
|
+
* `ResourceMetadata.instances` (`./lexicon.ts`) so the live graph can draw the
|
|
217
|
+
* instance node and paint it on its own.
|
|
218
|
+
*/
|
|
219
|
+
export interface InstanceObservation {
|
|
220
|
+
/**
|
|
221
|
+
* The block's own instance key as Terraform prints it, `[0]` or `["a"]`.
|
|
222
|
+
* Absent on an instance that only an expanded module call makes (#4488),
|
|
223
|
+
* which then carries {@link scope}.
|
|
224
|
+
*/
|
|
225
|
+
key?: string;
|
|
226
|
+
/**
|
|
227
|
+
* The expanded module path as Terraform prints it, `module.app[0]`, on an
|
|
228
|
+
* instance under an expanded module call (#4488). The live graph then
|
|
229
|
+
* builds the node id by {@link terraformInstancePath} from {@link address},
|
|
230
|
+
* the same id the declared graph lists: `estate/module.app[0]/aws_eip.pool[1]`.
|
|
231
|
+
*/
|
|
232
|
+
scope?: string;
|
|
233
|
+
/** The engine's own instance address, `aws_eip.pool[0]` or `module.app[0].aws_eip.pool[1]`. */
|
|
234
|
+
address: string;
|
|
235
|
+
verdict: "present" | "absent" | "not-observed";
|
|
236
|
+
/** The provider's id, on a present instance, when the read gave one. */
|
|
237
|
+
physicalId?: string;
|
|
238
|
+
/** Same meaning as `ResourceMetadata.ownership`, on a present instance. */
|
|
239
|
+
ownership?: "owned" | "foreign" | "unknown";
|
|
240
|
+
/** Same meaning as `ResourceMetadata.facts` (#4527), on a present instance. Never read for a decision. */
|
|
241
|
+
facts?: EngineFacts;
|
|
242
|
+
/** The lexicon's status word for this instance, as on `ResourceMetadata.status`. */
|
|
243
|
+
status?: string;
|
|
244
|
+
/** Why it was not observed, on a not-observed instance. An `UnobservedReason`. */
|
|
245
|
+
reason?: string;
|
|
246
|
+
detail?: string;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* The live graph's node id for one observed instance of the block node
|
|
251
|
+
* `blockNode` (#4488): `<blockNode><key>` with no expanded module call on
|
|
252
|
+
* the way, else the declared graph's rule (#4486) applied to the instance's
|
|
253
|
+
* address, so `module.app[0].aws_eip.pool[1]` under
|
|
254
|
+
* `estate/module.app/aws_eip.pool` is `estate/module.app[0]/aws_eip.pool[1]`.
|
|
255
|
+
* Undefined when the address does not belong to that block node.
|
|
256
|
+
*/
|
|
257
|
+
export function observedInstanceNodeId(blockNode: string, inst: Pick<InstanceObservation, "key" | "scope" | "address">): string | undefined {
|
|
258
|
+
if (inst.scope === undefined) return inst.key === undefined ? undefined : instanceNodeId(blockNode, inst.key);
|
|
259
|
+
const path = terraformInstancePath(inst.address);
|
|
260
|
+
if (!path?.scope) return undefined;
|
|
261
|
+
if (blockNode !== path.block && !blockNode.endsWith(`/${path.block}`)) return undefined;
|
|
262
|
+
return `${blockNode.slice(0, blockNode.length - path.block.length)}${path.instance}`;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* The block's verdict from its instances' (#4454, the one place the rollup is
|
|
267
|
+
* written): the first kind in `precedence` that any instance has, or
|
|
268
|
+
* undefined when there are no instances or none has a kind `precedence`
|
|
269
|
+
* names. The precedence is the caller's, most significant first; terraform's
|
|
270
|
+
* is {@link TERRAFORM_INSTANCE_ROLLUP}.
|
|
271
|
+
*
|
|
272
|
+
* Partial knowledge is not knowledge: put the not-observed kind first and a
|
|
273
|
+
* block with one unread instance is unread, never partly owned.
|
|
274
|
+
*/
|
|
275
|
+
export function rollupInstances<V extends { kind: string }>(verdicts: readonly V[], precedence: readonly V["kind"][]): V | undefined {
|
|
276
|
+
for (const kind of precedence) {
|
|
277
|
+
const found = verdicts.find((v) => v.kind === kind);
|
|
278
|
+
if (found) return found;
|
|
279
|
+
}
|
|
280
|
+
return undefined;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Terraform's block rollup over live-plan instance verdicts: any instance
|
|
285
|
+
* not-observed makes the block not-observed, then foreign, then adoptable,
|
|
286
|
+
* then owned, and a block whose instances are all absent is absent.
|
|
287
|
+
*/
|
|
288
|
+
export const TERRAFORM_INSTANCE_ROLLUP = ["unobserved", "foreign", "adoptable", "owned", "absent"] as const;
|
package/src/lexicon.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { InstanceObservation } from "./instance-nodes";
|
|
2
|
+
import type { EngineFacts } from "./engine-facts";
|
|
1
3
|
import type { CapabilityPack } from "./capabilities/view";
|
|
2
4
|
import type { Serializer } from "./serializer";
|
|
3
5
|
import type { Declarable } from "./declarable";
|
|
@@ -24,8 +26,12 @@ import type { OwnershipChannel, OwnershipMarker } from "./ownership";
|
|
|
24
26
|
import type { LexiconConfigSchema } from "./lexicon-config";
|
|
25
27
|
import type { RuleMeta } from "./audit/catalog";
|
|
26
28
|
import type { ReferenceCatalog } from "./graph-refs";
|
|
29
|
+
import type { ListedTypeMapping } from "./lifecycle/type-listing";
|
|
30
|
+
import type { IndexIdentity } from "./lifecycle/identity-match";
|
|
31
|
+
import type { IndexImportCodegen } from "./lifecycle/index-import";
|
|
27
32
|
import type { IREdge, LexiconGraphEdges, LexiconUnreadSource, LexiconWorkspaceLinks, LexiconWorkspaceOutputs } from "./graph-ir";
|
|
28
33
|
import type { DescribeResourcesResult, UnobservedReason } from "./observation";
|
|
34
|
+
import type { ReadDriftOptions, ReadDriftResult } from "./drift-record";
|
|
29
35
|
import type { DescribeIdentityOptions, DescribeIdentityResult } from "./identity";
|
|
30
36
|
import type { DeepNormalizationHooks, DeepObservationResult } from "./deep-observation";
|
|
31
37
|
import type { BehaviourResult, PredictBehaviourOptions } from "./behaviour";
|
|
@@ -1989,6 +1995,24 @@ export interface LexiconPlugin {
|
|
|
1989
1995
|
*/
|
|
1990
1996
|
predictBehaviour?(options: PredictBehaviourOptions): Promise<BehaviourResult>;
|
|
1991
1997
|
|
|
1998
|
+
/**
|
|
1999
|
+
* The drift of what this lexicon reads, as drift-record stream lines
|
|
2000
|
+
* (behold#995, `./drift-record.ts`): a `drift-start`, one record per
|
|
2001
|
+
* resource instance and a `drift-settle`, for each root or stack the
|
|
2002
|
+
* project declares. `chant lifecycle drift` calls it and prints the lines,
|
|
2003
|
+
* and `chant workspace drift` runs that command in the reader project of
|
|
2004
|
+
* a member whose kind the lexicon reads, so a terraform or choudoufu
|
|
2005
|
+
* member's drift comes from the engine that owns it.
|
|
2006
|
+
*
|
|
2007
|
+
* Optional. A lexicon without it has no drift read of its own; a chant
|
|
2008
|
+
* member's drift comes from `lifecycle diff --live` instead. A read that
|
|
2009
|
+
* the lexicon cannot answer (a read its engine does not have, or one
|
|
2010
|
+
* resource on an engine that cannot read one alone) is a `refused`
|
|
2011
|
+
* answer. A read that ran and failed is records, `not-observed`, never a
|
|
2012
|
+
* refusal and never a throw.
|
|
2013
|
+
*/
|
|
2014
|
+
readDrift?(options: ReadDriftOptions): Promise<ReadDriftResult>;
|
|
2015
|
+
|
|
1992
2016
|
/**
|
|
1993
2017
|
* What this lexicon's own entity types are, to an engine that prices them
|
|
1994
2018
|
* (#2382). Rows, not a capability: core resolves and predicts, and a lexicon
|
|
@@ -2175,6 +2199,39 @@ export interface LexiconPlugin {
|
|
|
2175
2199
|
*/
|
|
2176
2200
|
referenceCatalog?: ReferenceCatalog;
|
|
2177
2201
|
|
|
2202
|
+
/**
|
|
2203
|
+
* How a cloud inventory API's type names map to this lexicon's kinds
|
|
2204
|
+
* (#4521): CloudFormation types for aws, lowercase ARM types for azure,
|
|
2205
|
+
* Cloud Asset types for gcp, group/version/kind for k8s. `typeListing`
|
|
2206
|
+
* (./lifecycle/type-listing.ts) reads it to type an indexed resource, then
|
|
2207
|
+
* normalizes its properties with {@link deepNormalizationHooks}. Data plus
|
|
2208
|
+
* pure functions. Opt-in: a lexicon without it leaves listed objects of its
|
|
2209
|
+
* substrate as unknown-kind nodes.
|
|
2210
|
+
*/
|
|
2211
|
+
listedTypes?: ListedTypeMapping;
|
|
2212
|
+
|
|
2213
|
+
/**
|
|
2214
|
+
* How this lexicon's declared entities match indexed resources by identity
|
|
2215
|
+
* (#4523): the identifier a declaration's props spell (aws: the
|
|
2216
|
+
* CloudFormation `primaryIdentifier`), or why there is none (a
|
|
2217
|
+
* server-assigned id). `matchDeclaredToIndex`
|
|
2218
|
+
* (./lifecycle/identity-match.ts) runs it against an index version, and the
|
|
2219
|
+
* identity-match edge pass (./lifecycle/derive-edges.ts) uses it to name
|
|
2220
|
+
* this lexicon's indexed nodes. Data plus pure functions. Opt-in: a lexicon
|
|
2221
|
+
* whose live read already matches by name or state does not need it.
|
|
2222
|
+
*/
|
|
2223
|
+
indexIdentity?: IndexIdentity;
|
|
2224
|
+
|
|
2225
|
+
/**
|
|
2226
|
+
* How this lexicon writes an indexed resource as source (#4524, `chant
|
|
2227
|
+
* import --index`): the import IR for one indexed node, a value as a
|
|
2228
|
+
* reference to another imported node, and a parameter for a masked value.
|
|
2229
|
+
* Core hands the IR to {@link templateGenerator}, the codegen a template
|
|
2230
|
+
* import uses. Data plus pure functions. Opt-in: an indexed node of a
|
|
2231
|
+
* lexicon without it is reported as unsupported and written nowhere.
|
|
2232
|
+
*/
|
|
2233
|
+
indexImport?: IndexImportCodegen;
|
|
2234
|
+
|
|
2178
2235
|
/**
|
|
2179
2236
|
* This lexicon's capability pack (#4375): its mapping onto the
|
|
2180
2237
|
* lexicon-neutral view the capability rules read (labels, edge names,
|
|
@@ -2480,6 +2537,14 @@ export interface ResourceMetadata {
|
|
|
2480
2537
|
* a delete, and never escalates `unknown` to one.
|
|
2481
2538
|
*/
|
|
2482
2539
|
ownership?: "owned" | "foreign" | "unknown";
|
|
2540
|
+
/**
|
|
2541
|
+
* What an ownership engine (choudoufu, plunge) observed about this resource
|
|
2542
|
+
* (#4520, #4527), read from the engine's graph document. `buildLiveGraphIr`
|
|
2543
|
+
* copies it onto the node beside `physicalId`. Never read for a decision:
|
|
2544
|
+
* the change set reads {@link ownership}, and no change set, lifecycle step
|
|
2545
|
+
* or Op imports `EngineFacts`. Absent unless an engine supplied it.
|
|
2546
|
+
*/
|
|
2547
|
+
facts?: EngineFacts;
|
|
2483
2548
|
/**
|
|
2484
2549
|
* The stack/env identity read off the resource's own ownership marker
|
|
2485
2550
|
* (#1222) — the tags/labels/metadata chant stamped at synthesis, read back
|
|
@@ -2509,6 +2574,17 @@ export interface ResourceMetadata {
|
|
|
2509
2574
|
* undeclared live resource stays `orphan`.
|
|
2510
2575
|
*/
|
|
2511
2576
|
ownerChain?: OwnerChainVerdict;
|
|
2577
|
+
/**
|
|
2578
|
+
* The instances of a `count` or `for_each` block (#4454), each with its own
|
|
2579
|
+
* verdict, keyed as the engine prints them (`[0]`, `["a"]`). The rest of
|
|
2580
|
+
* this metadata is the block's rollup over them. `buildLiveGraphIr` draws
|
|
2581
|
+
* each present instance as a node `<name><key>` under this one, or by the
|
|
2582
|
+
* declared graph's module-key rule when the instance carries a `scope`
|
|
2583
|
+
* (`estate/module.app[0]/aws_eip.pool[1]`, #4488), and the
|
|
2584
|
+
* overlay paints a declared instance from it. Absent when the lexicon reads
|
|
2585
|
+
* no instances, or the block is not expanded.
|
|
2586
|
+
*/
|
|
2587
|
+
instances?: InstanceObservation[];
|
|
2512
2588
|
/**
|
|
2513
2589
|
* The declared node ids that reference this resource (#1273), set on an
|
|
2514
2590
|
* undeclared resource observed only because something declared points at it —
|
|
@@ -0,0 +1,149 @@
|
|
|
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-26T12:00:00Z",
|
|
24
|
+
"completedAt": "2026-10-26T12:00:04Z",
|
|
25
|
+
"digest": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
|
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": "listed"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"graph": {
|
|
45
|
+
"version": 1,
|
|
46
|
+
"nodes": [
|
|
47
|
+
{
|
|
48
|
+
"id": "aws/000000000000/us-east-1/AWS::IAM::Role/app-role",
|
|
49
|
+
"kind": "AWS::IAM::Role",
|
|
50
|
+
"lexicon": "aws",
|
|
51
|
+
"attrs": {
|
|
52
|
+
"RoleName": "app-role",
|
|
53
|
+
"Path": "/"
|
|
54
|
+
},
|
|
55
|
+
"physicalId": "app-role",
|
|
56
|
+
"listedType": "AWS::IAM::Role",
|
|
57
|
+
"location": "us-east-1",
|
|
58
|
+
"nativeId": "app-role",
|
|
59
|
+
"facts": {
|
|
60
|
+
"observedAt": "2026-10-26T12:00:00Z"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"id": "aws/000000000000/us-east-1/AWS::S3::Bucket/old-bucket",
|
|
65
|
+
"kind": "AWS::S3::Bucket",
|
|
66
|
+
"lexicon": "aws",
|
|
67
|
+
"attrs": {
|
|
68
|
+
"BucketName": "old-bucket"
|
|
69
|
+
},
|
|
70
|
+
"physicalId": "old-bucket",
|
|
71
|
+
"listedType": "AWS::S3::Bucket",
|
|
72
|
+
"location": "us-east-1",
|
|
73
|
+
"nativeId": "old-bucket",
|
|
74
|
+
"facts": {
|
|
75
|
+
"observedAt": "2026-10-26T12:00:00Z"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"id": "aws/000000000000/us-east-1/AWS::S3::Bucket/web-logs",
|
|
80
|
+
"kind": "AWS::S3::Bucket",
|
|
81
|
+
"lexicon": "aws",
|
|
82
|
+
"attrs": {
|
|
83
|
+
"BucketName": "web-logs",
|
|
84
|
+
"VersioningConfiguration": {
|
|
85
|
+
"Status": "Suspended"
|
|
86
|
+
},
|
|
87
|
+
"Tags": [
|
|
88
|
+
{
|
|
89
|
+
"Key": "env",
|
|
90
|
+
"Value": "dev"
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
},
|
|
94
|
+
"physicalId": "web-logs",
|
|
95
|
+
"listedType": "AWS::S3::Bucket",
|
|
96
|
+
"location": "us-east-1",
|
|
97
|
+
"nativeId": "web-logs",
|
|
98
|
+
"facts": {
|
|
99
|
+
"observedAt": "2026-10-26T12:00:00Z"
|
|
100
|
+
},
|
|
101
|
+
"tags": {
|
|
102
|
+
"env": "dev"
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"id": "aws/000000000000/us-east-1/AWS::SQS::Queue/jobs",
|
|
107
|
+
"kind": "AWS::SQS::Queue",
|
|
108
|
+
"lexicon": "aws",
|
|
109
|
+
"attrs": {
|
|
110
|
+
"QueueName": "jobs"
|
|
111
|
+
},
|
|
112
|
+
"physicalId": "jobs",
|
|
113
|
+
"listedType": "AWS::SQS::Queue",
|
|
114
|
+
"location": "us-east-1",
|
|
115
|
+
"nativeId": "jobs",
|
|
116
|
+
"facts": {
|
|
117
|
+
"observedAt": "2026-10-26T12:00:00Z"
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
],
|
|
121
|
+
"edges": [
|
|
122
|
+
{
|
|
123
|
+
"from": "aws/000000000000/us-east-1/AWS::IAM::Role/app-role",
|
|
124
|
+
"to": "aws/000000000000/us-east-1/AWS::S3::Bucket/web-logs",
|
|
125
|
+
"kind": "ref",
|
|
126
|
+
"viaAttr": "Policies",
|
|
127
|
+
"origin": "derived",
|
|
128
|
+
"rule": "aws:AWS::IAM::Role:Policies"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"from": "aws/000000000000/us-east-1/AWS::IAM::Role/app-role",
|
|
132
|
+
"to": "aws/000000000000/us-east-1/AWS::SQS::Queue/jobs",
|
|
133
|
+
"kind": "ref",
|
|
134
|
+
"viaAttr": "Policies",
|
|
135
|
+
"origin": "derived",
|
|
136
|
+
"rule": "aws:AWS::IAM::Role:Policies"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"from": "aws/000000000000/us-east-1/AWS::IAM::Role/app-role",
|
|
140
|
+
"to": "aws/000000000000/us-east-1/AWS::S3::Bucket/old-bucket",
|
|
141
|
+
"kind": "ref",
|
|
142
|
+
"viaAttr": "Policies",
|
|
143
|
+
"origin": "derived",
|
|
144
|
+
"rule": "aws:AWS::IAM::Role:Policies"
|
|
145
|
+
}
|
|
146
|
+
],
|
|
147
|
+
"groups": {}
|
|
148
|
+
}
|
|
149
|
+
}
|