@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,126 @@
|
|
|
1
|
+
import { containmentGroups, reconstructIdentityEdges, reconstructIndexedEdges, } from "../graph-refs.js";
|
|
2
|
+
import { indexDocumentDigest } from "./index-document.js";
|
|
3
|
+
/** Locations that hold global types: AWS's `global`, Kubernetes' cluster-scoped objects. */
|
|
4
|
+
const GLOBAL_LOCATIONS = new Set(["global", "cluster", ""]);
|
|
5
|
+
/** The scope an indexed node's identifiers are unique in, from its document's stamp and its own location. */
|
|
6
|
+
export function indexedNodeScope(doc, node) {
|
|
7
|
+
const scope = doc.stamp.scope;
|
|
8
|
+
const account = scope.kind === "cloud" ? `${scope.substrate}/${scope.scopeId}` : doc.stamp.scopeKey;
|
|
9
|
+
const location = node.location ?? "";
|
|
10
|
+
return GLOBAL_LOCATIONS.has(location) ? { account } : { account, region: location };
|
|
11
|
+
}
|
|
12
|
+
const byString = (a, b) => (a < b ? -1 : a > b ? 1 : 0);
|
|
13
|
+
function noteKey(n) {
|
|
14
|
+
return `${n.kind}\u0000${n.listedType ?? ""}\u0000${n.location ?? ""}\u0000${n.message}`;
|
|
15
|
+
}
|
|
16
|
+
/** Derived edges over one index document. */
|
|
17
|
+
export function deriveEdges(doc, lexicons) {
|
|
18
|
+
return deriveEdgesAcross([doc], lexicons)[0];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Derived edges over every document of one account from one read (behold#1023
|
|
22
|
+
* Q7): regional documents and an account-level one for global types, or the
|
|
23
|
+
* single document a `behold index` run writes (behold#1025 Q6). The documents
|
|
24
|
+
* must be cloud reads of one substrate and scope id with one `observedAt`;
|
|
25
|
+
* anything else is refused, because joining two reads would carry a name from
|
|
26
|
+
* one read to an object of another.
|
|
27
|
+
*/
|
|
28
|
+
export function deriveEdgesAcross(docs, lexicons) {
|
|
29
|
+
if (docs.length === 0)
|
|
30
|
+
return [];
|
|
31
|
+
const first = docs[0].stamp;
|
|
32
|
+
for (const d of docs) {
|
|
33
|
+
const s = d.stamp.scope;
|
|
34
|
+
if (s.kind !== "cloud" || first.scope.kind !== "cloud") {
|
|
35
|
+
throw new Error(`derived edges run over cloud index documents; ${d.stamp.scopeKey} is a ${s.kind} source`);
|
|
36
|
+
}
|
|
37
|
+
if (s.substrate !== first.scope.substrate || s.scopeId !== first.scope.scopeId) {
|
|
38
|
+
throw new Error(`derived edges run over one account: ${first.scope.substrate}/${first.scope.scopeId} and ${s.substrate}/${s.scopeId} are two`);
|
|
39
|
+
}
|
|
40
|
+
if (d.stamp.observedAt !== first.observedAt) {
|
|
41
|
+
throw new Error(`derived edges run over one read: ${first.observedAt} and ${d.stamp.observedAt} are two`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const named = [...lexicons]
|
|
45
|
+
.filter((l) => l.referenceCatalog !== undefined)
|
|
46
|
+
.sort((a, b) => byString(a.name, b.name))
|
|
47
|
+
.map((l) => ({ lexicon: l.name, catalog: l.referenceCatalog }));
|
|
48
|
+
const withCatalog = new Set(named.map((c) => c.lexicon));
|
|
49
|
+
const holderDoc = new Map();
|
|
50
|
+
const scopes = new Map();
|
|
51
|
+
const all = [];
|
|
52
|
+
docs.forEach((d, i) => {
|
|
53
|
+
for (const n of d.graph.nodes) {
|
|
54
|
+
holderDoc.set(n.id, i);
|
|
55
|
+
scopes.set(n.id, indexedNodeScope(d, n));
|
|
56
|
+
all.push(n);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
const derived = reconstructIndexedEdges(all, named, (n) => scopes.get(n.id));
|
|
60
|
+
const owners = [...lexicons]
|
|
61
|
+
.filter((l) => l.indexIdentity !== undefined)
|
|
62
|
+
.sort((a, b) => byString(a.name, b.name))
|
|
63
|
+
.map((l) => ({ lexicon: l.name, ...(l.indexIdentity.nodeIdentities ? { identities: l.indexIdentity.nodeIdentities } : {}) }));
|
|
64
|
+
const identity = owners.length > 0
|
|
65
|
+
? reconstructIdentityEdges(all, owners, (n) => scopes.get(n.id), derived.edges)
|
|
66
|
+
: { edges: [], ambiguous: [] };
|
|
67
|
+
return docs.map((d, i) => {
|
|
68
|
+
const mine = (from) => holderDoc.get(from) === i;
|
|
69
|
+
const edges = [...d.graph.edges.filter((e) => e.origin !== "derived"), ...derived.edges.filter((e) => mine(e.from)), ...identity.edges.filter((e) => mine(e.from))];
|
|
70
|
+
const pairs = derived.containment.filter((p) => mine(p.child));
|
|
71
|
+
const dangling = new Map();
|
|
72
|
+
for (const r of [
|
|
73
|
+
...(d.graph.dangling ?? []),
|
|
74
|
+
...derived.dangling.filter((x) => mine(x.from)).map((x) => ({ from: x.from, kind: "ref", path: x.path, value: x.value })),
|
|
75
|
+
]) {
|
|
76
|
+
dangling.set(`${r.from}\u0000${r.kind}\u0000${r.path}\u0000${r.value}`, r);
|
|
77
|
+
}
|
|
78
|
+
const notes = (d.notes ?? []).filter((n) => n.kind !== "no-catalog" && n.kind !== "ambiguous-reference" && n.kind !== "ambiguous-identity");
|
|
79
|
+
for (const a of derived.ambiguous.filter((x) => mine(x.from))) {
|
|
80
|
+
notes.push({
|
|
81
|
+
kind: "ambiguous-reference",
|
|
82
|
+
message: `${a.from} ${a.path} = ${JSON.stringify(a.value)} matches ${a.candidates.length} nodes (${a.candidates.join(", ")}); rule ${a.rule} drew no edge`,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
for (const a of identity.ambiguous.filter((x) => mine(x.from))) {
|
|
86
|
+
notes.push({
|
|
87
|
+
kind: "ambiguous-identity",
|
|
88
|
+
message: `${a.from} ${a.path} = ${JSON.stringify(a.value)} names ${a.candidates.length} nodes (${a.candidates.join(", ")}); the identity-match pass drew no edge`,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
const counts = new Map();
|
|
92
|
+
for (const n of d.graph.nodes)
|
|
93
|
+
if (!n.unmappedKind)
|
|
94
|
+
counts.set(n.lexicon, (counts.get(n.lexicon) ?? 0) + 1);
|
|
95
|
+
for (const lexicon of [...counts.keys()].sort()) {
|
|
96
|
+
if (withCatalog.has(lexicon))
|
|
97
|
+
continue;
|
|
98
|
+
notes.push({
|
|
99
|
+
kind: "no-catalog",
|
|
100
|
+
message: `the ${lexicon} lexicon has no referenceCatalog, so its ${counts.get(lexicon)} node(s) have no derived edges`,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
notes.sort((a, b) => byString(noteKey(a), noteKey(b)));
|
|
104
|
+
const groups = { ...d.graph.groups };
|
|
105
|
+
const byContainer = containmentGroups(pairs);
|
|
106
|
+
if (Object.keys(byContainer).length > 0)
|
|
107
|
+
groups.byContainer = byContainer;
|
|
108
|
+
else
|
|
109
|
+
delete groups.byContainer;
|
|
110
|
+
const graph = { ...d.graph, edges, groups };
|
|
111
|
+
if (dangling.size > 0)
|
|
112
|
+
graph.dangling = [...dangling.values()];
|
|
113
|
+
else
|
|
114
|
+
delete graph.dangling;
|
|
115
|
+
const out = {
|
|
116
|
+
...d,
|
|
117
|
+
stamp: { ...d.stamp, digest: indexDocumentDigest({ graph, coverage: d.coverage }) },
|
|
118
|
+
graph,
|
|
119
|
+
};
|
|
120
|
+
if (notes.length > 0)
|
|
121
|
+
out.notes = notes;
|
|
122
|
+
else
|
|
123
|
+
delete out.notes;
|
|
124
|
+
return out;
|
|
125
|
+
});
|
|
126
|
+
}
|
package/dist/lifecycle/git.d.ts
CHANGED
|
@@ -124,26 +124,28 @@ export declare function snapshotStorageKey(lexicon: string, stack?: string): str
|
|
|
124
124
|
/**
|
|
125
125
|
* Write a state snapshot JSON to the orphan branch.
|
|
126
126
|
*
|
|
127
|
+
* Nothing in chant calls this since #4519: snapshots go through the index
|
|
128
|
+
* store (./snapshot-store.ts), whose default is `refs/chant/snapshots`. Kept
|
|
129
|
+
* for code outside chant that wrote snapshots here itself.
|
|
130
|
+
*
|
|
127
131
|
* Pipeline: hash-object → mktree → commit-tree → update-ref
|
|
128
132
|
*/
|
|
129
133
|
export declare function writeSnapshot(environment: string, lexicon: string, json: string, opts?: {
|
|
130
134
|
cwd?: string;
|
|
131
135
|
}): Promise<string>;
|
|
132
136
|
/**
|
|
133
|
-
* Read a snapshot from the orphan branch.
|
|
137
|
+
* Read a snapshot from the orphan branch. Since #4519 this is the read side
|
|
138
|
+
* of the read-only orphan-branch store (./snapshot-store.ts); chant's own
|
|
139
|
+
* readers go through the store.
|
|
134
140
|
*/
|
|
135
|
-
export declare function readSnapshot(environment: string, lexicon: string, opts?:
|
|
136
|
-
cwd?: string;
|
|
137
|
-
}): Promise<string | null>;
|
|
141
|
+
export declare function readSnapshot(environment: string, lexicon: string, opts?: LedgerLocation): Promise<string | null>;
|
|
138
142
|
/**
|
|
139
143
|
* Read a snapshot at a specific orphan-branch commit (#822). `readSnapshot` reads
|
|
140
144
|
* the branch tip; this reads `<ref>:<env>/<lexicon>.json` for any commit `ref`
|
|
141
145
|
* (as listed by {@link listSnapshots}), so two historical snapshots can be diffed.
|
|
142
146
|
* Returns null if that env/lexicon wasn't captured at `ref`.
|
|
143
147
|
*/
|
|
144
|
-
export declare function readSnapshotAt(environment: string, lexicon: string, ref: string, opts?:
|
|
145
|
-
cwd?: string;
|
|
146
|
-
}): Promise<string | null>;
|
|
148
|
+
export declare function readSnapshotAt(environment: string, lexicon: string, ref: string, opts?: LedgerLocation): Promise<string | null>;
|
|
147
149
|
/**
|
|
148
150
|
* Append one immutable release record line to `<environment>/releases.jsonl`
|
|
149
151
|
* on the orphan branch (#568, epic #551 "Build & deploy observability"). Same
|
|
@@ -227,8 +229,7 @@ export declare function readEnvironmentSnapshots(environment: string, opts?: {
|
|
|
227
229
|
/**
|
|
228
230
|
* List snapshot history from the orphan branch.
|
|
229
231
|
*/
|
|
230
|
-
export declare function listSnapshots(opts?: {
|
|
231
|
-
cwd?: string;
|
|
232
|
+
export declare function listSnapshots(opts?: LedgerLocation & {
|
|
232
233
|
environment?: string;
|
|
233
234
|
}): Promise<Array<{
|
|
234
235
|
commit: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/lifecycle/git.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAIpD;;;;;;;GAOG;AACH,wBAAsB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAEnF;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,yHAAyH;IACzH,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;IACpC,yFAAyF;IACzF,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAmFD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,eAAe,CACnC,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,IAAI,CAAC,EAAE,cAAc,GAAG;IAAE,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAC7D,OAAO,CAAC,MAAM,CAAC,CAOjB;AAED,6CAA6C;AAC7C,MAAM,WAAW,eAAe;IAC9B,0GAA0G;IAC1G,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,IAAI,CAAC;IACb,2FAA2F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,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAO5E;AAyBD;;;;;GAKG;AACH,wBAAsB,cAAc,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAGlE;AA0DD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,CAAC,EAAE,cAAc,GAAG,cAAc,CAMvE"}
|
package/dist/lifecycle/git.js
CHANGED
|
@@ -382,13 +382,19 @@ export function snapshotStorageKey(lexicon, stack) {
|
|
|
382
382
|
/**
|
|
383
383
|
* Write a state snapshot JSON to the orphan branch.
|
|
384
384
|
*
|
|
385
|
+
* Nothing in chant calls this since #4519: snapshots go through the index
|
|
386
|
+
* store (./snapshot-store.ts), whose default is `refs/chant/snapshots`. Kept
|
|
387
|
+
* for code outside chant that wrote snapshots here itself.
|
|
388
|
+
*
|
|
385
389
|
* Pipeline: hash-object → mktree → commit-tree → update-ref
|
|
386
390
|
*/
|
|
387
391
|
export async function writeSnapshot(environment, lexicon, json, opts) {
|
|
388
392
|
return writeBlobToPath(environment, `${lexicon}.json`, json, "State snapshot", opts);
|
|
389
393
|
}
|
|
390
394
|
/**
|
|
391
|
-
* Read a snapshot from the orphan branch.
|
|
395
|
+
* Read a snapshot from the orphan branch. Since #4519 this is the read side
|
|
396
|
+
* of the read-only orphan-branch store (./snapshot-store.ts); chant's own
|
|
397
|
+
* readers go through the store.
|
|
392
398
|
*/
|
|
393
399
|
export async function readSnapshot(environment, lexicon, opts) {
|
|
394
400
|
return readBlobFromPath(environment, `${lexicon}.json`, opts);
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Declared entities matched to indexed resources by identity (#4523, tier 2
|
|
3
|
+
* of INTENTIUS/behold#1025, rule written out on behold#1025's design comment,
|
|
4
|
+
* join rules ruled on behold#1023 2026-10-26).
|
|
5
|
+
*
|
|
6
|
+
* A lexicon whose live read needs a stack chant deployed (aws: the
|
|
7
|
+
* CloudFormation stack named after the environment) cannot see source that
|
|
8
|
+
* was never deployed. Its identity fallback (#1647, lexicons/aws/src/
|
|
9
|
+
* identity-observe.ts) asks Cloud Control `GetResource` for the identifier
|
|
10
|
+
* the declared props spell. {@link matchDeclaredToIndex} is that rule run
|
|
11
|
+
* against an index version instead of a live call:
|
|
12
|
+
*
|
|
13
|
+
* A declared entity of type T with props P matches the indexed node whose
|
|
14
|
+
* `listedType` is T, whose `location` is the entity's region (or `global`
|
|
15
|
+
* for a global type), and whose `nativeId` equals the identifier P spells.
|
|
16
|
+
*
|
|
17
|
+
* - one node binds;
|
|
18
|
+
* - two or more are refused, naming every candidate. A refusal never reads
|
|
19
|
+
* as absent or as bound;
|
|
20
|
+
* - no node is absent only when the index's coverage lists (T, location) as
|
|
21
|
+
* `listed` ({@link indexCoverageFor}, where `"*"` matches every type or
|
|
22
|
+
* location). Otherwise the entity is not observed, with the coverage's
|
|
23
|
+
* reason: `filtered` when the scope left the type or location out (or the
|
|
24
|
+
* read had a tag filter, which cannot tell an untagged object from a
|
|
25
|
+
* missing one), `not-reached` when nothing covered it;
|
|
26
|
+
* - an identity the declaration does not spell (a server-assigned id such as
|
|
27
|
+
* an instance id or a queue URL, a Ref, an intrinsic) cannot match: not
|
|
28
|
+
* observed, reason `no-binding`.
|
|
29
|
+
*
|
|
30
|
+
* The lexicon says how its props spell an identifier ({@link IndexIdentity},
|
|
31
|
+
* a plugin's `indexIdentity`); this module holds the rule. Pure.
|
|
32
|
+
*/
|
|
33
|
+
import type { IRNode } from "../graph-ir.js";
|
|
34
|
+
import type { NodeIdentityValue } from "../graph-refs.js";
|
|
35
|
+
import type { UnobservedReason } from "../observation.js";
|
|
36
|
+
import { type CloudIndexScope, type IndexDocument } from "./index-document.js";
|
|
37
|
+
/** What a declared entity's props say about its identity. */
|
|
38
|
+
export type DeclaredIdentity = {
|
|
39
|
+
kind: "identifier";
|
|
40
|
+
/** The inventory API's type name the identifier belongs to (the CloudFormation type for aws). */
|
|
41
|
+
listedType: string;
|
|
42
|
+
/** The identifier as the index's `nativeId` spells it (Cloud Control's, `|`-joined for a multi-part one). */
|
|
43
|
+
identifier: string;
|
|
44
|
+
/** A global type is indexed once per account at location `global`. */
|
|
45
|
+
global: boolean;
|
|
46
|
+
} | {
|
|
47
|
+
kind: "unmatchable";
|
|
48
|
+
/** `no-binding` for an identity the declaration does not spell; `unsupported-kind` for a type with none on record. */
|
|
49
|
+
reason: UnobservedReason;
|
|
50
|
+
detail: string;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* How a lexicon matches its declared entities to its substrate's indexed
|
|
54
|
+
* nodes (a plugin's `indexIdentity`). Data plus pure functions.
|
|
55
|
+
*/
|
|
56
|
+
export interface IndexIdentity {
|
|
57
|
+
substrate: CloudIndexScope["substrate"];
|
|
58
|
+
/** The identifier a declared entity's props spell, or why there is none. */
|
|
59
|
+
declaredIdentity(entityType: string, props: Record<string, unknown>): DeclaredIdentity;
|
|
60
|
+
/**
|
|
61
|
+
* The values that name an indexed node of this lexicon, for the
|
|
62
|
+
* identity-match edge pass (../graph-refs.ts `reconstructIdentityEdges`).
|
|
63
|
+
* Absent: its native id and its ARN cloud ids.
|
|
64
|
+
*/
|
|
65
|
+
nodeIdentities?(node: IRNode): NodeIdentityValue[];
|
|
66
|
+
}
|
|
67
|
+
/** One declared entity, as the build output names it. */
|
|
68
|
+
export interface DeclaredEntity {
|
|
69
|
+
name: string;
|
|
70
|
+
entityType: string;
|
|
71
|
+
props: Record<string, unknown>;
|
|
72
|
+
/** The entity's region; falls back to the match's `region` option. */
|
|
73
|
+
region?: string;
|
|
74
|
+
}
|
|
75
|
+
interface MatchBase {
|
|
76
|
+
entity: string;
|
|
77
|
+
entityType: string;
|
|
78
|
+
}
|
|
79
|
+
/** The verdict for one declared entity. */
|
|
80
|
+
export type IdentityMatch = (MatchBase & {
|
|
81
|
+
verdict: "bound";
|
|
82
|
+
identifier: string;
|
|
83
|
+
listedType: string;
|
|
84
|
+
location: string;
|
|
85
|
+
node: string;
|
|
86
|
+
nativeId: string;
|
|
87
|
+
}) | (MatchBase & {
|
|
88
|
+
verdict: "refused";
|
|
89
|
+
identifier: string;
|
|
90
|
+
listedType: string;
|
|
91
|
+
candidates: string[];
|
|
92
|
+
detail: string;
|
|
93
|
+
}) | (MatchBase & {
|
|
94
|
+
verdict: "absent";
|
|
95
|
+
identifier: string;
|
|
96
|
+
listedType: string;
|
|
97
|
+
location: string;
|
|
98
|
+
}) | (MatchBase & {
|
|
99
|
+
verdict: "not-observed";
|
|
100
|
+
reason: UnobservedReason;
|
|
101
|
+
detail: string;
|
|
102
|
+
identifier?: string;
|
|
103
|
+
listedType?: string;
|
|
104
|
+
location?: string;
|
|
105
|
+
});
|
|
106
|
+
export interface IdentityMatchResult {
|
|
107
|
+
/** Keyed by entity name, in name order. */
|
|
108
|
+
matches: Record<string, IdentityMatch>;
|
|
109
|
+
}
|
|
110
|
+
export interface MatchOptions {
|
|
111
|
+
/** The region of an entity that names none. */
|
|
112
|
+
region?: string;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Whether the index looked at (type, location), from its coverage. `listed`
|
|
116
|
+
* means a missing node is absent; anything else is a reason it is not
|
|
117
|
+
* observed.
|
|
118
|
+
*/
|
|
119
|
+
export declare function indexCoverageVerdict(docs: readonly IndexDocument[], listedType: string, location: string): {
|
|
120
|
+
listed: true;
|
|
121
|
+
} | {
|
|
122
|
+
listed: false;
|
|
123
|
+
reason: UnobservedReason;
|
|
124
|
+
detail: string;
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Match each declared entity to the index by identity. `docs` are the
|
|
128
|
+
* documents of one read of one account (one `behold index` run, or its
|
|
129
|
+
* regional and account-level documents); `identity` is the lexicon's.
|
|
130
|
+
*/
|
|
131
|
+
export declare function matchDeclaredToIndex(entities: readonly DeclaredEntity[], docs: readonly IndexDocument[], identity: IndexIdentity, options?: MatchOptions): IdentityMatchResult;
|
|
132
|
+
export {};
|
|
133
|
+
//# sourceMappingURL=identity-match.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity-match.d.ts","sourceRoot":"","sources":["../../src/lifecycle/identity-match.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAoB,KAAK,eAAe,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE9F,6DAA6D;AAC7D,MAAM,MAAM,gBAAgB,GACxB;IACE,IAAI,EAAE,YAAY,CAAC;IACnB,iGAAiG;IACjG,UAAU,EAAE,MAAM,CAAC;IACnB,6GAA6G;IAC7G,UAAU,EAAE,MAAM,CAAC;IACnB,sEAAsE;IACtE,MAAM,EAAE,OAAO,CAAC;CACjB,GACD;IACE,IAAI,EAAE,aAAa,CAAC;IACpB,sHAAsH;IACtH,MAAM,EAAE,gBAAgB,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEN;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,eAAe,CAAC,WAAW,CAAC,CAAC;IACxC,4EAA4E;IAC5E,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,gBAAgB,CAAC;IACvF;;;;OAIG;IACH,cAAc,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB,EAAE,CAAC;CACpD;AAED,yDAAyD;AACzD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB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AC;CACjB;AA2BD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,SAAS,aAAa,EAAE,EAC9B,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GACf;IAAE,MAAM,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,gBAAgB,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAkChF;AAKD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,SAAS,cAAc,EAAE,EACnC,IAAI,EAAE,SAAS,aAAa,EAAE,EAC9B,QAAQ,EAAE,aAAa,EACvB,OAAO,GAAE,YAAiB,GACzB,mBAAmB,CAuErB"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { indexCoverageFor } from "./index-document.js";
|
|
2
|
+
const byString = (a, b) => (a < b ? -1 : a > b ? 1 : 0);
|
|
3
|
+
/** The documents must be cloud reads of one substrate, one account and one read, or a candidate from another read would bind. */
|
|
4
|
+
function cloudScopes(docs, substrate) {
|
|
5
|
+
const scopes = [];
|
|
6
|
+
for (const d of docs) {
|
|
7
|
+
const s = d.stamp.scope;
|
|
8
|
+
if (s.kind !== "cloud")
|
|
9
|
+
throw new Error(`identity matching reads cloud index documents; ${d.stamp.scopeKey} is a ${s.kind} source`);
|
|
10
|
+
if (s.substrate !== substrate)
|
|
11
|
+
throw new Error(`identity matching for ${substrate} was given a ${s.substrate} index (${d.stamp.scopeKey})`);
|
|
12
|
+
scopes.push(s);
|
|
13
|
+
}
|
|
14
|
+
for (const d of docs) {
|
|
15
|
+
const s = d.stamp.scope;
|
|
16
|
+
if (s.scopeId !== scopes[0].scopeId)
|
|
17
|
+
throw new Error(`identity matching runs over one account: ${scopes[0].scopeId} and ${s.scopeId} are two`);
|
|
18
|
+
if (d.stamp.observedAt !== docs[0].stamp.observedAt) {
|
|
19
|
+
throw new Error(`identity matching runs over one read: ${docs[0].stamp.observedAt} and ${d.stamp.observedAt} are two`);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return scopes;
|
|
23
|
+
}
|
|
24
|
+
function scopeIncludes(list, value) {
|
|
25
|
+
return list === "*" || list.includes(value);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Whether the index looked at (type, location), from its coverage. `listed`
|
|
29
|
+
* means a missing node is absent; anything else is a reason it is not
|
|
30
|
+
* observed.
|
|
31
|
+
*/
|
|
32
|
+
export function indexCoverageVerdict(docs, listedType, location) {
|
|
33
|
+
let firstRefusal;
|
|
34
|
+
let tagFiltered;
|
|
35
|
+
let scoped = false;
|
|
36
|
+
for (const d of docs) {
|
|
37
|
+
const scope = d.stamp.scope;
|
|
38
|
+
if (scope.kind !== "cloud")
|
|
39
|
+
continue;
|
|
40
|
+
const entry = indexCoverageFor(d.coverage, listedType, location);
|
|
41
|
+
if (entry?.verdict === "listed") {
|
|
42
|
+
if (scope.tagFilter && Object.keys(scope.tagFilter).length > 0) {
|
|
43
|
+
tagFiltered ?? (tagFiltered = Object.entries(scope.tagFilter).map(([k, v]) => `${k}=${v}`).join(","));
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
return { listed: true };
|
|
47
|
+
}
|
|
48
|
+
if (entry && !firstRefusal) {
|
|
49
|
+
firstRefusal = {
|
|
50
|
+
reason: entry.verdict,
|
|
51
|
+
detail: entry.detail ?? `the index read ${listedType} in ${location} as ${entry.verdict}`,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
// A global type sits at location `global`, which a region list never names.
|
|
55
|
+
if (scopeIncludes(scope.types, listedType) && (location === "global" || scopeIncludes(scope.locations, location)))
|
|
56
|
+
scoped = true;
|
|
57
|
+
}
|
|
58
|
+
if (firstRefusal)
|
|
59
|
+
return { listed: false, ...firstRefusal };
|
|
60
|
+
if (tagFiltered !== undefined) {
|
|
61
|
+
return {
|
|
62
|
+
listed: false,
|
|
63
|
+
reason: "filtered",
|
|
64
|
+
detail: `the index listed ${listedType} in ${location} under the tag filter ${tagFiltered}, so an untagged object and a missing one look the same`,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
if (!scoped)
|
|
68
|
+
return { listed: false, reason: "filtered", detail: `the index scope left out ${listedType} in ${location}` };
|
|
69
|
+
return { listed: false, reason: "not-reached", detail: `the index has no coverage for ${listedType} in ${location}` };
|
|
70
|
+
}
|
|
71
|
+
/** The node's listed type: `listedType` on an indexed node, else its kind. */
|
|
72
|
+
const listedTypeOf = (n) => n.listedType ?? n.kind;
|
|
73
|
+
/**
|
|
74
|
+
* Match each declared entity to the index by identity. `docs` are the
|
|
75
|
+
* documents of one read of one account (one `behold index` run, or its
|
|
76
|
+
* regional and account-level documents); `identity` is the lexicon's.
|
|
77
|
+
*/
|
|
78
|
+
export function matchDeclaredToIndex(entities, docs, identity, options = {}) {
|
|
79
|
+
cloudScopes(docs, identity.substrate);
|
|
80
|
+
// listedType -> nativeId -> nodes
|
|
81
|
+
const byIdentity = new Map();
|
|
82
|
+
for (const d of docs) {
|
|
83
|
+
for (const n of d.graph.nodes) {
|
|
84
|
+
if (n.nativeId === undefined)
|
|
85
|
+
continue;
|
|
86
|
+
const t = listedTypeOf(n);
|
|
87
|
+
const m = byIdentity.get(t) ?? byIdentity.set(t, new Map()).get(t);
|
|
88
|
+
(m.get(n.nativeId) ?? m.set(n.nativeId, []).get(n.nativeId)).push(n);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
const matches = {};
|
|
92
|
+
for (const entity of [...entities].sort((a, b) => byString(a.name, b.name))) {
|
|
93
|
+
const base = { entity: entity.name, entityType: entity.entityType };
|
|
94
|
+
const declared = identity.declaredIdentity(entity.entityType, entity.props ?? {});
|
|
95
|
+
if (declared.kind === "unmatchable") {
|
|
96
|
+
matches[entity.name] = { ...base, verdict: "not-observed", reason: declared.reason, detail: declared.detail };
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
const { listedType, identifier } = declared;
|
|
100
|
+
const region = entity.region ?? options.region;
|
|
101
|
+
const location = declared.global ? "global" : region;
|
|
102
|
+
const all = byIdentity.get(listedType)?.get(identifier) ?? [];
|
|
103
|
+
const inScope = location === undefined ? all : all.filter((n) => n.location === location);
|
|
104
|
+
const candidates = [...new Set(inScope.map((n) => n.id))].sort(byString);
|
|
105
|
+
if (candidates.length > 1) {
|
|
106
|
+
matches[entity.name] = {
|
|
107
|
+
...base,
|
|
108
|
+
verdict: "refused",
|
|
109
|
+
identifier,
|
|
110
|
+
listedType,
|
|
111
|
+
candidates,
|
|
112
|
+
detail: `${listedType} ${identifier} names ${candidates.length} indexed resources (${candidates.join(", ")}); none is bound`,
|
|
113
|
+
};
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
if (candidates.length === 1) {
|
|
117
|
+
const node = inScope.find((n) => n.id === candidates[0]);
|
|
118
|
+
matches[entity.name] = {
|
|
119
|
+
...base,
|
|
120
|
+
verdict: "bound",
|
|
121
|
+
identifier,
|
|
122
|
+
listedType,
|
|
123
|
+
location: node.location ?? location ?? "",
|
|
124
|
+
node: node.id,
|
|
125
|
+
nativeId: node.nativeId,
|
|
126
|
+
};
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
if (location === undefined) {
|
|
130
|
+
// No region, so there is no (type, location) whose coverage could make absence true.
|
|
131
|
+
matches[entity.name] = {
|
|
132
|
+
...base,
|
|
133
|
+
verdict: "not-observed",
|
|
134
|
+
reason: "no-binding",
|
|
135
|
+
detail: `${entity.name} names no region and no match option gives one, so absence of ${listedType} ${identifier} cannot be scoped`,
|
|
136
|
+
identifier,
|
|
137
|
+
listedType,
|
|
138
|
+
};
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
const coverage = indexCoverageVerdict(docs, listedType, location);
|
|
142
|
+
matches[entity.name] = coverage.listed
|
|
143
|
+
? { ...base, verdict: "absent", identifier, listedType, location }
|
|
144
|
+
: { ...base, verdict: "not-observed", reason: coverage.reason, detail: coverage.detail, identifier, listedType, location };
|
|
145
|
+
}
|
|
146
|
+
return { matches };
|
|
147
|
+
}
|