@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,515 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `chant import --index` (#4524, the step from tier 1 to tier 2 of
|
|
3
|
+
* INTENTIUS/behold#1025): typed source for indexed resources. Nothing is
|
|
4
|
+
* applied and nothing is written to the cloud.
|
|
5
|
+
*
|
|
6
|
+
* {@link planIndexImport} is the pure part. It takes the documents of one
|
|
7
|
+
* index read, a selection and the lexicons, and returns one import IR per
|
|
8
|
+
* output group plus the report. The caller (../cli/commands/import-index.ts)
|
|
9
|
+
* hands each IR to the lexicon's own `templateGenerator()`, the codegen
|
|
10
|
+
* `chant import <template>` uses, and writes the files.
|
|
11
|
+
*
|
|
12
|
+
* Rules:
|
|
13
|
+
* - each selected node goes to the lexicon its kind belongs to. A lexicon
|
|
14
|
+
* writes it only through its `indexImport` seam ({@link IndexImportCodegen}).
|
|
15
|
+
* A node of unknown kind, or of a lexicon with no seam, is reported as
|
|
16
|
+
* unsupported by name and written nowhere;
|
|
17
|
+
* - a node already declared in the project (the identity matcher, #4523,
|
|
18
|
+
* bound an entity to it) is reported as declared with the entity's name and
|
|
19
|
+
* is not imported again ({@link declaredNodes});
|
|
20
|
+
* - a derived edge (#4522, `origin: "derived"`) becomes a reference when its
|
|
21
|
+
* target is imported into the same group and the lexicon can spell the
|
|
22
|
+
* value as a reference to it. Otherwise the value stays a literal, and a
|
|
23
|
+
* comment in the file names the edge and why;
|
|
24
|
+
* - a value the listing masked (`[REDACTED]`) is never written. Each one
|
|
25
|
+
* becomes a parameter to fill in;
|
|
26
|
+
* - output is deterministic: nodes, edges, parameters and logical ids are
|
|
27
|
+
* ordered by id, so the same index and selection give the same IR, and the
|
|
28
|
+
* same files.
|
|
29
|
+
*
|
|
30
|
+
* The report names each resource's identity (substrate, scope id, listed
|
|
31
|
+
* type, location, native id) and cloud ids, for the adoption step that
|
|
32
|
+
* follows (INTENTIUS/choudoufu#2284).
|
|
33
|
+
*/
|
|
34
|
+
import { createHash } from "node:crypto";
|
|
35
|
+
import { MASKED } from "../deep-observation.js";
|
|
36
|
+
import { readPath } from "../graph-refs.js";
|
|
37
|
+
import { matchDeclaredToIndex } from "./identity-match.js";
|
|
38
|
+
const byString = (a, b) => (a < b ? -1 : a > b ? 1 : 0);
|
|
39
|
+
/** Locations that hold global types, as derive-edges.ts reads them. */
|
|
40
|
+
const GLOBAL_LOCATIONS = new Set(["global", "cluster", ""]);
|
|
41
|
+
function canonicalSelection(sel) {
|
|
42
|
+
const sortU = (xs) => (xs && xs.length > 0 ? [...new Set(xs)].sort(byString) : undefined);
|
|
43
|
+
const out = {};
|
|
44
|
+
if (sel.all)
|
|
45
|
+
out.all = true;
|
|
46
|
+
const types = sortU(sel.types);
|
|
47
|
+
if (types)
|
|
48
|
+
out.types = types;
|
|
49
|
+
const names = sortU(sel.names);
|
|
50
|
+
if (names)
|
|
51
|
+
out.names = names;
|
|
52
|
+
const nodes = sortU(sel.nodes);
|
|
53
|
+
if (nodes)
|
|
54
|
+
out.nodes = nodes;
|
|
55
|
+
if (sel.tags && Object.keys(sel.tags).length > 0) {
|
|
56
|
+
out.tags = Object.fromEntries(Object.keys(sel.tags).sort(byString).map((k) => [k, sel.tags[k]]));
|
|
57
|
+
}
|
|
58
|
+
return out;
|
|
59
|
+
}
|
|
60
|
+
/** True when the selection names nothing: no `all` and no filter. An empty selection selects no node. */
|
|
61
|
+
export function selectionIsEmpty(sel) {
|
|
62
|
+
const c = canonicalSelection(sel);
|
|
63
|
+
return !c.all && !c.types && !c.names && !c.nodes && !c.tags;
|
|
64
|
+
}
|
|
65
|
+
/** Whether a node is selected. */
|
|
66
|
+
export function nodeSelected(node, sel) {
|
|
67
|
+
if (selectionIsEmpty(sel))
|
|
68
|
+
return false;
|
|
69
|
+
if (sel.all)
|
|
70
|
+
return true;
|
|
71
|
+
if (sel.types && sel.types.length > 0 && !sel.types.includes(node.listedType ?? node.kind) && !sel.types.includes(node.kind))
|
|
72
|
+
return false;
|
|
73
|
+
if (sel.names && sel.names.length > 0 && !sel.names.includes(node.nativeId ?? "") && !sel.names.includes(node.id))
|
|
74
|
+
return false;
|
|
75
|
+
if (sel.nodes && sel.nodes.length > 0 && !sel.nodes.includes(node.id))
|
|
76
|
+
return false;
|
|
77
|
+
if (sel.tags) {
|
|
78
|
+
for (const [k, v] of Object.entries(sel.tags))
|
|
79
|
+
if (node.tags?.[k] !== v)
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* The indexed nodes the project already declares, keyed by node id, with
|
|
86
|
+
* the entity's name: the identity matcher (#4523) run once per location the
|
|
87
|
+
* index holds, for each lexicon that declares an `indexIdentity`. A node two
|
|
88
|
+
* entities bind keeps the first by entity name.
|
|
89
|
+
*/
|
|
90
|
+
export function declaredNodes(docs, entitiesByLexicon, identities) {
|
|
91
|
+
const out = new Map();
|
|
92
|
+
if (docs.length === 0)
|
|
93
|
+
return out;
|
|
94
|
+
const scope = docs[0].stamp.scope;
|
|
95
|
+
if (scope.kind !== "cloud")
|
|
96
|
+
return out;
|
|
97
|
+
const locations = [...new Set(docs.flatMap((d) => d.graph.nodes.map((n) => n.location ?? "")))]
|
|
98
|
+
.filter((l) => !GLOBAL_LOCATIONS.has(l))
|
|
99
|
+
.sort(byString);
|
|
100
|
+
for (const { name, indexIdentity } of [...identities].sort((a, b) => byString(a.name, b.name))) {
|
|
101
|
+
if (!indexIdentity || indexIdentity.substrate !== scope.substrate)
|
|
102
|
+
continue;
|
|
103
|
+
const entities = entitiesByLexicon.get(name) ?? [];
|
|
104
|
+
if (entities.length === 0)
|
|
105
|
+
continue;
|
|
106
|
+
// A global type matches at `global` whatever the region; one pass with no region covers it.
|
|
107
|
+
for (const region of locations.length > 0 ? locations : [undefined]) {
|
|
108
|
+
const { matches } = matchDeclaredToIndex(entities, docs, indexIdentity, region ? { region } : {});
|
|
109
|
+
for (const m of Object.values(matches)) {
|
|
110
|
+
if (m.verdict === "bound" && !out.has(m.node))
|
|
111
|
+
out.set(m.node, m.entity);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return out;
|
|
116
|
+
}
|
|
117
|
+
function pascalWords(s) {
|
|
118
|
+
return s
|
|
119
|
+
.split(/[^A-Za-z0-9]+/)
|
|
120
|
+
.filter(Boolean)
|
|
121
|
+
.map((w) => w.charAt(0).toUpperCase() + w.slice(1))
|
|
122
|
+
.join("");
|
|
123
|
+
}
|
|
124
|
+
function shortHash(s) {
|
|
125
|
+
return createHash("sha256").update(s).digest("hex").slice(0, 8);
|
|
126
|
+
}
|
|
127
|
+
/** The kind's last `::`, `/` or `.` segment: `Bucket` for `AWS::S3::Bucket`. */
|
|
128
|
+
function defaultTypeLabel(node) {
|
|
129
|
+
const parts = node.kind.split(/::|\/|\./).filter(Boolean);
|
|
130
|
+
return pascalWords(parts[parts.length - 1] ?? "Resource") || "Resource";
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* `<TypeLabel><NativeId in PascalCase>`, letters and digits only. A long id
|
|
134
|
+
* keeps its tail and a hash of the node id. Collisions take a number, in
|
|
135
|
+
* node id order, so the names are stable.
|
|
136
|
+
*/
|
|
137
|
+
function assignLogicalIds(nodes, label) {
|
|
138
|
+
const out = new Map();
|
|
139
|
+
const used = new Set();
|
|
140
|
+
for (const n of [...nodes].sort((a, b) => byString(a.id, b.id))) {
|
|
141
|
+
const native = n.nativeId ?? n.id;
|
|
142
|
+
// An ARN or a URL: its last path segment names the object.
|
|
143
|
+
const tail = native.includes("/") ? native.slice(native.lastIndexOf("/") + 1) || native : native;
|
|
144
|
+
const prefix = label(n);
|
|
145
|
+
let words = tail.split(/[^A-Za-z0-9]+/).filter(Boolean);
|
|
146
|
+
// `vpc-0a1` under `VPC` reads `VPC0a1`, not `VPCVpc0a1`.
|
|
147
|
+
if (words.length > 1 && words[0].toLowerCase() === prefix.toLowerCase())
|
|
148
|
+
words = words.slice(1);
|
|
149
|
+
let id = pascalWords(words.join("-"));
|
|
150
|
+
if (id.length > 48)
|
|
151
|
+
id = `${id.slice(-40)}${shortHash(n.id)}`;
|
|
152
|
+
let base = `${prefix}${id}`;
|
|
153
|
+
if (!/^[A-Za-z]/.test(base))
|
|
154
|
+
base = `R${base}`;
|
|
155
|
+
let name = base;
|
|
156
|
+
for (let i = 2; used.has(name); i++)
|
|
157
|
+
name = `${base}${i}`;
|
|
158
|
+
used.add(name);
|
|
159
|
+
out.set(n.id, name);
|
|
160
|
+
}
|
|
161
|
+
return out;
|
|
162
|
+
}
|
|
163
|
+
/** The path a derived edge's rule names on its holder, or undefined (identity-match and tag rules name none). */
|
|
164
|
+
export function edgeRulePath(edge, holder) {
|
|
165
|
+
const rule = edge.rule;
|
|
166
|
+
if (!rule)
|
|
167
|
+
return undefined;
|
|
168
|
+
const prefix = `${holder.lexicon}:${holder.kind}:`;
|
|
169
|
+
if (!rule.startsWith(prefix))
|
|
170
|
+
return undefined;
|
|
171
|
+
const path = rule.slice(prefix.length);
|
|
172
|
+
return path.startsWith("tag:") ? undefined : path;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Rewrite the string leaves at `path` (`a.b`, `arr[].id`, as readPath reads
|
|
176
|
+
* it). A path that ends on an array rewrites its string elements. Returns
|
|
177
|
+
* the new tree and the dotted paths it changed.
|
|
178
|
+
*/
|
|
179
|
+
function rewriteAtPath(tree, path, fn) {
|
|
180
|
+
const changed = [];
|
|
181
|
+
const parts = path.split(".");
|
|
182
|
+
const walk = (value, i, at) => {
|
|
183
|
+
if (i === parts.length) {
|
|
184
|
+
if (typeof value === "string") {
|
|
185
|
+
const r = fn(value);
|
|
186
|
+
if (r !== undefined) {
|
|
187
|
+
changed.push(at);
|
|
188
|
+
return r;
|
|
189
|
+
}
|
|
190
|
+
return value;
|
|
191
|
+
}
|
|
192
|
+
if (Array.isArray(value))
|
|
193
|
+
return value.map((v, j) => walk(v, i, `${at}[${j}]`));
|
|
194
|
+
return value;
|
|
195
|
+
}
|
|
196
|
+
if (value === null || typeof value !== "object" || Array.isArray(value))
|
|
197
|
+
return value;
|
|
198
|
+
const part = parts[i];
|
|
199
|
+
const isArr = part.endsWith("[]");
|
|
200
|
+
const key = isArr ? part.slice(0, -2) : part;
|
|
201
|
+
const obj = value;
|
|
202
|
+
if (!(key in obj))
|
|
203
|
+
return value;
|
|
204
|
+
const here = at === "" ? key : `${at}.${key}`;
|
|
205
|
+
const child = obj[key];
|
|
206
|
+
let next;
|
|
207
|
+
if (isArr) {
|
|
208
|
+
if (!Array.isArray(child))
|
|
209
|
+
return value;
|
|
210
|
+
next = child.map((c, j) => walk(c, i + 1, `${here}[${j}]`));
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
next = walk(child, i + 1, here);
|
|
214
|
+
}
|
|
215
|
+
return next === child ? value : { ...obj, [key]: next };
|
|
216
|
+
};
|
|
217
|
+
return { tree: walk(tree, 0, ""), changed };
|
|
218
|
+
}
|
|
219
|
+
/** Every string leaf, outside `Tags`, as a dotted path (identity-match edges name no path). */
|
|
220
|
+
function stringLeafPaths(tree, at = "") {
|
|
221
|
+
if (typeof tree === "string")
|
|
222
|
+
return [at];
|
|
223
|
+
if (Array.isArray(tree))
|
|
224
|
+
return tree.flatMap((v, j) => stringLeafPaths(v, `${at}[${j}]`));
|
|
225
|
+
if (tree === null || typeof tree !== "object")
|
|
226
|
+
return [];
|
|
227
|
+
return Object.keys(tree)
|
|
228
|
+
.sort(byString)
|
|
229
|
+
.filter((k) => !(at === "" && (k === "Tags" || k === "tags")))
|
|
230
|
+
.flatMap((k) => stringLeafPaths(tree[k], at === "" ? k : `${at}.${k}`));
|
|
231
|
+
}
|
|
232
|
+
/** A path with explicit indices (`a[2].b`) as readPath/rewriteAtPath segments over one leaf. */
|
|
233
|
+
function exactPathParts(path) {
|
|
234
|
+
const out = [];
|
|
235
|
+
for (const seg of path.split(".")) {
|
|
236
|
+
const m = /^([^[]*)((?:\[\d+\])*)$/.exec(seg);
|
|
237
|
+
if (!m) {
|
|
238
|
+
out.push(seg);
|
|
239
|
+
continue;
|
|
240
|
+
}
|
|
241
|
+
if (m[1] !== "")
|
|
242
|
+
out.push(m[1]);
|
|
243
|
+
for (const idx of m[2].matchAll(/\[(\d+)\]/g))
|
|
244
|
+
out.push(Number(idx[1]));
|
|
245
|
+
}
|
|
246
|
+
return out;
|
|
247
|
+
}
|
|
248
|
+
function setExact(tree, parts, value) {
|
|
249
|
+
if (parts.length === 0)
|
|
250
|
+
return value;
|
|
251
|
+
const [head, ...rest] = parts;
|
|
252
|
+
if (typeof head === "number") {
|
|
253
|
+
if (!Array.isArray(tree))
|
|
254
|
+
return tree;
|
|
255
|
+
const copy = [...tree];
|
|
256
|
+
copy[head] = setExact(copy[head], rest, value);
|
|
257
|
+
return copy;
|
|
258
|
+
}
|
|
259
|
+
if (tree === null || typeof tree !== "object" || Array.isArray(tree))
|
|
260
|
+
return tree;
|
|
261
|
+
const obj = tree;
|
|
262
|
+
return { ...obj, [head]: setExact(obj[head], rest, value) };
|
|
263
|
+
}
|
|
264
|
+
function getExact(tree, parts) {
|
|
265
|
+
let cur = tree;
|
|
266
|
+
for (const p of parts) {
|
|
267
|
+
if (cur === null || typeof cur !== "object")
|
|
268
|
+
return undefined;
|
|
269
|
+
cur = cur[p];
|
|
270
|
+
}
|
|
271
|
+
return cur;
|
|
272
|
+
}
|
|
273
|
+
/** Every masked leaf, as a dotted path with indices, in key order. */
|
|
274
|
+
function maskedPaths(tree, at = "") {
|
|
275
|
+
if (tree === MASKED)
|
|
276
|
+
return [at];
|
|
277
|
+
if (Array.isArray(tree))
|
|
278
|
+
return tree.flatMap((v, j) => maskedPaths(v, `${at}[${j}]`));
|
|
279
|
+
if (tree === null || typeof tree !== "object")
|
|
280
|
+
return [];
|
|
281
|
+
return Object.keys(tree)
|
|
282
|
+
.sort(byString)
|
|
283
|
+
.flatMap((k) => maskedPaths(tree[k], at === "" ? k : `${at}.${k}`));
|
|
284
|
+
}
|
|
285
|
+
function identityOf(doc, node) {
|
|
286
|
+
const scope = doc.stamp.scope;
|
|
287
|
+
return {
|
|
288
|
+
substrate: scope.kind === "cloud" ? scope.substrate : node.lexicon,
|
|
289
|
+
scopeId: scope.kind === "cloud" ? scope.scopeId : doc.stamp.scopeKey,
|
|
290
|
+
listedType: node.listedType ?? node.kind,
|
|
291
|
+
location: node.location ?? "",
|
|
292
|
+
nativeId: node.nativeId ?? node.physicalId ?? node.id,
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Plan an import from the documents of one index read. Pure; throws only on
|
|
297
|
+
* documents from two accounts or two reads, as derive-edges.ts does.
|
|
298
|
+
*/
|
|
299
|
+
export function planIndexImport(docs, selection, lexicons, options = {}) {
|
|
300
|
+
const first = docs[0]?.stamp;
|
|
301
|
+
for (const d of docs) {
|
|
302
|
+
if (first && (d.stamp.observedAt !== first.observedAt || JSON.stringify(scopeAccount(d)) !== JSON.stringify(scopeAccount(docs[0])))) {
|
|
303
|
+
throw new Error(`an index import reads one read of one account: ${first.scopeKey} and ${d.stamp.scopeKey} differ`);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
const sel = canonicalSelection(selection);
|
|
307
|
+
const declared = options.declared ?? new Map();
|
|
308
|
+
const byLexicon = new Map(lexicons.map((l) => [l.name, l]));
|
|
309
|
+
const docOf = new Map();
|
|
310
|
+
const nodes = [];
|
|
311
|
+
for (const d of docs) {
|
|
312
|
+
for (const n of d.graph.nodes) {
|
|
313
|
+
if (docOf.has(n.id))
|
|
314
|
+
continue;
|
|
315
|
+
docOf.set(n.id, d);
|
|
316
|
+
nodes.push(n);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
nodes.sort((a, b) => byString(a.id, b.id));
|
|
320
|
+
const nodeById = new Map(nodes.map((n) => [n.id, n]));
|
|
321
|
+
const edges = docs
|
|
322
|
+
.flatMap((d) => d.graph.edges)
|
|
323
|
+
.filter((e) => e.origin === "derived")
|
|
324
|
+
.sort((a, b) => byString(`${a.from}\u0000${a.rule ?? ""}\u0000${a.to}`, `${b.from}\u0000${b.rule ?? ""}\u0000${b.to}`));
|
|
325
|
+
const reports = new Map();
|
|
326
|
+
const writable = [];
|
|
327
|
+
for (const node of nodes) {
|
|
328
|
+
if (!nodeSelected(node, sel))
|
|
329
|
+
continue;
|
|
330
|
+
const doc = docOf.get(node.id);
|
|
331
|
+
const base = {
|
|
332
|
+
node: node.id,
|
|
333
|
+
identity: identityOf(doc, node),
|
|
334
|
+
cloudIds: (node.facts?.cloudIds ?? []).map((c) => ({ kind: c.kind, value: c.value })),
|
|
335
|
+
...(node.facts?.markers ? { markers: node.facts.markers } : {}),
|
|
336
|
+
lexicon: node.lexicon,
|
|
337
|
+
kind: node.kind,
|
|
338
|
+
status: "unsupported",
|
|
339
|
+
};
|
|
340
|
+
const entity = declared.get(node.id);
|
|
341
|
+
if (entity !== undefined) {
|
|
342
|
+
reports.set(node.id, { ...base, status: "declared", entity, reason: `already declared as ${entity}; not imported again` });
|
|
343
|
+
continue;
|
|
344
|
+
}
|
|
345
|
+
if (node.unmappedKind) {
|
|
346
|
+
reports.set(node.id, { ...base, reason: `no lexicon kind maps the listed type ${node.listedType ?? node.kind}` });
|
|
347
|
+
continue;
|
|
348
|
+
}
|
|
349
|
+
const lexicon = byLexicon.get(node.lexicon);
|
|
350
|
+
if (!lexicon) {
|
|
351
|
+
reports.set(node.id, { ...base, reason: `the ${node.lexicon} lexicon is not loaded` });
|
|
352
|
+
continue;
|
|
353
|
+
}
|
|
354
|
+
if (!lexicon.indexImport) {
|
|
355
|
+
reports.set(node.id, { ...base, reason: `the ${node.lexicon} lexicon has no index import codegen (indexImport)` });
|
|
356
|
+
continue;
|
|
357
|
+
}
|
|
358
|
+
const r = lexicon.indexImport.resource(node);
|
|
359
|
+
if ("unsupported" in r) {
|
|
360
|
+
reports.set(node.id, { ...base, reason: r.unsupported });
|
|
361
|
+
continue;
|
|
362
|
+
}
|
|
363
|
+
reports.set(node.id, { ...base, status: "imported" });
|
|
364
|
+
writable.push({ node, codegen: lexicon.indexImport, type: r.type, properties: r.properties, ...(r.attributes ? { attributes: r.attributes } : {}) });
|
|
365
|
+
}
|
|
366
|
+
// Groups: lexicon + location. Global nodes join their lexicon's only regional group, when there is one.
|
|
367
|
+
const regional = new Map();
|
|
368
|
+
for (const w of writable) {
|
|
369
|
+
const loc = w.node.location ?? "";
|
|
370
|
+
if (!GLOBAL_LOCATIONS.has(loc))
|
|
371
|
+
(regional.get(w.node.lexicon) ?? regional.set(w.node.lexicon, new Set()).get(w.node.lexicon)).add(loc);
|
|
372
|
+
}
|
|
373
|
+
const groupLocation = (n) => {
|
|
374
|
+
const loc = n.location ?? "";
|
|
375
|
+
if (!GLOBAL_LOCATIONS.has(loc))
|
|
376
|
+
return loc;
|
|
377
|
+
const regions = regional.get(n.lexicon);
|
|
378
|
+
return regions && regions.size === 1 ? [...regions][0] : loc === "" ? "global" : loc;
|
|
379
|
+
};
|
|
380
|
+
const groupKeys = [...new Set(writable.map((w) => `${w.node.lexicon}/${groupLocation(w.node)}`))].sort(byString);
|
|
381
|
+
const single = groupKeys.length === 1;
|
|
382
|
+
const groupDir = (n) => (single ? "" : `${n.lexicon}/${groupLocation(n)}`);
|
|
383
|
+
const logicalIds = new Map();
|
|
384
|
+
for (const key of groupKeys) {
|
|
385
|
+
const members = writable.filter((w) => `${w.node.lexicon}/${groupLocation(w.node)}` === key);
|
|
386
|
+
const codegen = members[0].codegen;
|
|
387
|
+
const label = (n) => codegen.typeLabel?.(n) ?? defaultTypeLabel(n);
|
|
388
|
+
for (const [id, name] of assignLogicalIds(members.map((m) => m.node), label))
|
|
389
|
+
logicalIds.set(id, name);
|
|
390
|
+
}
|
|
391
|
+
const groups = [];
|
|
392
|
+
const parameterReports = [];
|
|
393
|
+
for (const key of groupKeys) {
|
|
394
|
+
const members = writable.filter((w) => `${w.node.lexicon}/${groupLocation(w.node)}` === key);
|
|
395
|
+
const dir = groupDir(members[0].node);
|
|
396
|
+
const header = [];
|
|
397
|
+
const resources = [];
|
|
398
|
+
const parameters = [];
|
|
399
|
+
const usedParams = new Set();
|
|
400
|
+
for (const w of members) {
|
|
401
|
+
const logicalId = logicalIds.get(w.node.id);
|
|
402
|
+
const report = reports.get(w.node.id);
|
|
403
|
+
report.logicalId = logicalId;
|
|
404
|
+
report.group = dir;
|
|
405
|
+
let props = w.properties;
|
|
406
|
+
const references = [];
|
|
407
|
+
for (const e of edges.filter((x) => x.from === w.node.id)) {
|
|
408
|
+
const target = nodeById.get(e.to);
|
|
409
|
+
const path = edgeRulePath(e, w.node);
|
|
410
|
+
const literal = (reason) => {
|
|
411
|
+
const at = path ?? e.viaAttr ?? "";
|
|
412
|
+
references.push({ path: at, target: e.to, ...(e.rule ? { rule: e.rule } : {}), written: "literal", reason });
|
|
413
|
+
const values = path ? readPath(props, path) : [];
|
|
414
|
+
header.push(`${logicalId}.${at}${values.length > 0 ? ` = ${values.map((v) => JSON.stringify(v)).join(", ")}` : ""} stays a literal: ` +
|
|
415
|
+
`derived edge ${e.rule ?? "(no rule)"} to ${e.to}; ${reason}`);
|
|
416
|
+
};
|
|
417
|
+
if (e.rule && edgeRulePath(e, w.node) === undefined && e.rule.startsWith(`${w.node.lexicon}:${w.node.kind}:tag:`)) {
|
|
418
|
+
literal("a tag rule names no property to reference");
|
|
419
|
+
continue;
|
|
420
|
+
}
|
|
421
|
+
if (!target) {
|
|
422
|
+
literal("the target is not in the index");
|
|
423
|
+
continue;
|
|
424
|
+
}
|
|
425
|
+
const targetDeclared = declared.get(target.id);
|
|
426
|
+
if (targetDeclared !== undefined) {
|
|
427
|
+
literal(`the target is already declared as ${targetDeclared}`);
|
|
428
|
+
continue;
|
|
429
|
+
}
|
|
430
|
+
const targetReport = reports.get(target.id);
|
|
431
|
+
if (!targetReport) {
|
|
432
|
+
literal("the target is not in the selection");
|
|
433
|
+
continue;
|
|
434
|
+
}
|
|
435
|
+
if (targetReport.status !== "imported") {
|
|
436
|
+
literal(`the target is not imported (${targetReport.reason ?? targetReport.status})`);
|
|
437
|
+
continue;
|
|
438
|
+
}
|
|
439
|
+
if (groupDir(target) !== dir || target.lexicon !== w.node.lexicon) {
|
|
440
|
+
literal(`the target is written to another group (${groupDir(target) || "."})`);
|
|
441
|
+
continue;
|
|
442
|
+
}
|
|
443
|
+
const t = { logicalId: logicalIds.get(target.id), node: target };
|
|
444
|
+
const changed = [];
|
|
445
|
+
if (path) {
|
|
446
|
+
const r = rewriteAtPath(props, path, (v) => w.codegen.reference(v, t));
|
|
447
|
+
props = r.tree;
|
|
448
|
+
changed.push(...r.changed);
|
|
449
|
+
}
|
|
450
|
+
else {
|
|
451
|
+
for (const leaf of stringLeafPaths(props)) {
|
|
452
|
+
const parts = exactPathParts(leaf);
|
|
453
|
+
const v = getExact(props, parts);
|
|
454
|
+
if (typeof v !== "string")
|
|
455
|
+
continue;
|
|
456
|
+
const ref = w.codegen.reference(v, t);
|
|
457
|
+
if (ref === undefined)
|
|
458
|
+
continue;
|
|
459
|
+
props = setExact(props, parts, ref);
|
|
460
|
+
changed.push(leaf);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
if (changed.length === 0) {
|
|
464
|
+
literal(`the ${w.node.lexicon} lexicon cannot spell the value as a reference to ${t.logicalId}`);
|
|
465
|
+
continue;
|
|
466
|
+
}
|
|
467
|
+
for (const at of changed)
|
|
468
|
+
references.push({ path: at, target: e.to, ...(e.rule ? { rule: e.rule } : {}), written: "reference" });
|
|
469
|
+
}
|
|
470
|
+
const params = [];
|
|
471
|
+
for (const at of maskedPaths(props)) {
|
|
472
|
+
let name = `${logicalId}${pascalWords(at)}`;
|
|
473
|
+
for (let i = 2; usedParams.has(name); i++)
|
|
474
|
+
name = `${logicalId}${pascalWords(at)}${i}`;
|
|
475
|
+
usedParams.add(name);
|
|
476
|
+
parameters.push(w.codegen.secretParameter(name, { node: w.node, logicalId, path: at }));
|
|
477
|
+
props = setExact(props, exactPathParts(at), w.codegen.parameterReference(name));
|
|
478
|
+
params.push(name);
|
|
479
|
+
parameterReports.push({ name, node: w.node.id, path: at, group: dir });
|
|
480
|
+
header.push(`${logicalId}.${at} was masked in the index; fill in the parameter ${name}`);
|
|
481
|
+
}
|
|
482
|
+
if (references.length > 0)
|
|
483
|
+
report.references = references;
|
|
484
|
+
if (params.length > 0)
|
|
485
|
+
report.parameters = params;
|
|
486
|
+
resources.push({ logicalId, type: w.type, properties: props, ...(w.attributes && Object.keys(w.attributes).length > 0 ? { attributes: w.attributes } : {}) });
|
|
487
|
+
}
|
|
488
|
+
const [lexicon, ...loc] = key.split("/");
|
|
489
|
+
groups.push({ dir, lexicon, location: loc.join("/"), ir: { resources, parameters }, header });
|
|
490
|
+
}
|
|
491
|
+
const report = {
|
|
492
|
+
report: "chant-index-import/v1",
|
|
493
|
+
index: [...docs]
|
|
494
|
+
.map((d) => ({ scopeKey: d.stamp.scopeKey, observedAt: d.stamp.observedAt, digest: d.stamp.digest, source: d.stamp.source.name }))
|
|
495
|
+
.sort((a, b) => byString(a.scopeKey, b.scopeKey)),
|
|
496
|
+
selection: sel,
|
|
497
|
+
resources: [...reports.values()].sort((a, b) => byString(a.node, b.node)),
|
|
498
|
+
parameters: parameterReports,
|
|
499
|
+
groups: groups.map((g) => ({ group: g.dir, lexicon: g.lexicon, location: g.location, resources: g.ir.resources.length })),
|
|
500
|
+
};
|
|
501
|
+
return { groups, report };
|
|
502
|
+
}
|
|
503
|
+
function scopeAccount(d) {
|
|
504
|
+
const s = d.stamp.scope;
|
|
505
|
+
return s.kind === "cloud" ? [s.substrate, s.scopeId] : [s.kind, d.stamp.scopeKey];
|
|
506
|
+
}
|
|
507
|
+
/** The header comment for a group's first file. Same plan, same text. */
|
|
508
|
+
export function indexImportHeader(plan, group) {
|
|
509
|
+
const lines = [
|
|
510
|
+
"Generated by chant import --index. Nothing was applied. Review before committing.",
|
|
511
|
+
...plan.report.index.map((i) => `index ${i.scopeKey} read ${i.observedAt} (digest ${i.digest.slice(0, 12)})`),
|
|
512
|
+
...group.header,
|
|
513
|
+
];
|
|
514
|
+
return lines.map((l) => `// ${l.replace(/\r?\n/g, " ")}`).join("\n") + "\n\n";
|
|
515
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `chant search --index <ref>` (#4525): an index version as the observed side
|
|
3
|
+
* of a search, joined to the declared rows.
|
|
4
|
+
*
|
|
5
|
+
* Two halves, both pure apart from {@link readIndexRef}'s store read:
|
|
6
|
+
*
|
|
7
|
+
* - a ref names one index version in the store (#4519, ./index-document.ts):
|
|
8
|
+
* `<scope key>`, `<scope key>@latest`, `<scope key>@<version>` or
|
|
9
|
+
* `<scope key>/<version>.json`, where the scope key is `stamp.scopeKey`
|
|
10
|
+
* (`cloud/aws/<account>/<scope digest>`) and a version is a name the store
|
|
11
|
+
* lists (`20261026T091403Z-<digest12>`, with or without `.json`);
|
|
12
|
+
* - {@link joinDeclaredToIndex} gives every declared node a join verdict
|
|
13
|
+
* and lays the bound indexed nodes over the declared canvas, the way
|
|
14
|
+
* `--live` lays a live read over it (`sourceOverlayGraphs`).
|
|
15
|
+
*
|
|
16
|
+
* The join goes through each lexicon's own index match, its plugin's
|
|
17
|
+
* `indexIdentity` (#4523, ./identity-match.ts). aws has one; a lexicon with
|
|
18
|
+
* none gets `not-observed`, reason `unsupported-kind`, on every row, never a
|
|
19
|
+
* guessed match. The verdicts:
|
|
20
|
+
*
|
|
21
|
+
* - `bound`: one indexed node carries the identity the declaration spells;
|
|
22
|
+
* - `absent`: none does, and the index's coverage says it listed that type
|
|
23
|
+
* and location;
|
|
24
|
+
* - `not-observed`: the index did not look (coverage `filtered`,
|
|
25
|
+
* `not-reached`, a read failure), the lexicon has no index match, or the
|
|
26
|
+
* index is of another substrate. Always with the reason and a detail;
|
|
27
|
+
* - `no-binding`: the declaration does not spell an identity (a
|
|
28
|
+
* server-assigned id, a Ref), or the entity names no region and nothing
|
|
29
|
+
* matched;
|
|
30
|
+
* - `ambiguous`: two or more indexed nodes carry the identity. None is bound.
|
|
31
|
+
*
|
|
32
|
+
* Indexed nodes no declared row binds stay out of a project's answer, as an
|
|
33
|
+
* undeclared resource stays out of a `--live` one; with no project the index
|
|
34
|
+
* is the whole graph ({@link indexOnlyGraph}).
|
|
35
|
+
*/
|
|
36
|
+
import { type GraphIR } from "../graph-ir.js";
|
|
37
|
+
import type { UnobservedReason } from "../observation.js";
|
|
38
|
+
import { type IndexIdentity } from "./identity-match.js";
|
|
39
|
+
import { type IndexDocument } from "./index-document.js";
|
|
40
|
+
import type { SnapshotStore } from "./snapshot-store.js";
|
|
41
|
+
/** One index version, as a ref names it. */
|
|
42
|
+
export interface IndexRef {
|
|
43
|
+
/** `stamp.scopeKey`: `<source path>/<scope path>`. */
|
|
44
|
+
scopeKey: string;
|
|
45
|
+
/** `latest`, or a version name with its `.json`. */
|
|
46
|
+
version: string;
|
|
47
|
+
}
|
|
48
|
+
/** Parse `--index <ref>`, or say why it is not one. */
|
|
49
|
+
export declare function parseIndexRef(ref: string): IndexRef | {
|
|
50
|
+
error: string;
|
|
51
|
+
hint: string;
|
|
52
|
+
};
|
|
53
|
+
/** The ref as one string, version resolved: `<scope key>@<version name without .json>`. */
|
|
54
|
+
export declare function formatIndexRef(scopeKey: string, versionName: string): string;
|
|
55
|
+
export type IndexRead = {
|
|
56
|
+
doc: IndexDocument;
|
|
57
|
+
ref: IndexRef;
|
|
58
|
+
version: string;
|
|
59
|
+
} | {
|
|
60
|
+
error: string;
|
|
61
|
+
hint?: string;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Read the version a ref names. A stamp that disagrees with itself or with
|
|
65
|
+
* the key it was read under is refused: the answer would be about another
|
|
66
|
+
* scope than the one asked for.
|
|
67
|
+
*/
|
|
68
|
+
export declare function readIndexRef(store: SnapshotStore, ref: IndexRef): Promise<IndexRead>;
|
|
69
|
+
interface JoinBase {
|
|
70
|
+
/** The listed type and identifier the declaration spells, when it spells one. */
|
|
71
|
+
listedType?: string;
|
|
72
|
+
identifier?: string;
|
|
73
|
+
location?: string;
|
|
74
|
+
}
|
|
75
|
+
/** One declared row's join verdict. */
|
|
76
|
+
export type IndexJoin = (JoinBase & {
|
|
77
|
+
verdict: "bound";
|
|
78
|
+
node: string;
|
|
79
|
+
nativeId: string;
|
|
80
|
+
}) | (JoinBase & {
|
|
81
|
+
verdict: "absent";
|
|
82
|
+
}) | (JoinBase & {
|
|
83
|
+
verdict: "not-observed";
|
|
84
|
+
reason: UnobservedReason;
|
|
85
|
+
detail: string;
|
|
86
|
+
}) | (JoinBase & {
|
|
87
|
+
verdict: "no-binding";
|
|
88
|
+
detail: string;
|
|
89
|
+
}) | (JoinBase & {
|
|
90
|
+
verdict: "ambiguous";
|
|
91
|
+
candidates: string[];
|
|
92
|
+
detail: string;
|
|
93
|
+
});
|
|
94
|
+
export type IndexJoinVerdict = IndexJoin["verdict"];
|
|
95
|
+
/** Every verdict, in the order a summary lists them. */
|
|
96
|
+
export declare const INDEX_JOIN_VERDICTS: readonly IndexJoinVerdict[];
|
|
97
|
+
/** What the join needs of a lexicon: its name and its index match. */
|
|
98
|
+
export interface JoinLexicon {
|
|
99
|
+
name: string;
|
|
100
|
+
indexIdentity?: IndexIdentity;
|
|
101
|
+
}
|
|
102
|
+
export interface JoinOptions {
|
|
103
|
+
/** The region of a declared node, from the stack it belongs to. */
|
|
104
|
+
regionOf?: (id: string) => string | undefined;
|
|
105
|
+
}
|
|
106
|
+
export interface IndexJoinResult {
|
|
107
|
+
/** The declared canvas with the bound indexed nodes laid over it. */
|
|
108
|
+
ir: GraphIR;
|
|
109
|
+
/** Every declared node's verdict, by node id. */
|
|
110
|
+
joins: Record<string, IndexJoin>;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Join every declared node to an index version. Pure: the lexicons come in
|
|
114
|
+
* as data. The canvas keeps every declared node and edge; a bound node takes
|
|
115
|
+
* the indexed node's physical id, attributes and facts, as `--live` gives a
|
|
116
|
+
* node its read's.
|
|
117
|
+
*/
|
|
118
|
+
export declare function joinDeclaredToIndex(declared: GraphIR, doc: IndexDocument, lexicons: readonly JoinLexicon[], options?: JoinOptions): IndexJoinResult;
|
|
119
|
+
/**
|
|
120
|
+
* The index alone, for a search with no project: every indexed node, each
|
|
121
|
+
* with its native id as its physical id.
|
|
122
|
+
*/
|
|
123
|
+
export declare function indexOnlyGraph(doc: IndexDocument): GraphIR;
|
|
124
|
+
/** How many rows carry each verdict, for the provenance line. */
|
|
125
|
+
export declare function countJoins(joins: Record<string, IndexJoin>, ids: readonly string[]): Record<IndexJoinVerdict, number>;
|
|
126
|
+
/** A row's verdict where a physical id would go: `(absent)`, `(not observed: filtered)`, `(ambiguous: 2 candidates)`. */
|
|
127
|
+
export declare function joinCell(j: IndexJoin): string | undefined;
|
|
128
|
+
export {};
|
|
129
|
+
//# sourceMappingURL=index-join.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-join.d.ts","sourceRoot":"","sources":["../../src/lifecycle/index-join.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,EAAuB,KAAK,OAAO,EAAe,MAAM,aAAa,CAAC;AAC7E,OAAO,KAAK,EAAoB,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAiE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACrH,OAAO,EAA+D,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACnH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,4CAA4C;AAC5C,MAAM,WAAW,QAAQ;IACvB,sDAAsD;IACtD,QAAQ,EAAE,MAAM,CAAC;IACjB,oDAAoD;IACpD,OAAO,EAAE,MAAM,CAAC;CACjB;AAQD,uDAAuD;AACvD,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAyBrF;AAED,2FAA2F;AAC3F,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAE5E;AAED,MAAM,MAAM,SAAS,GAAG;IAAE,GAAG,EAAE,aAAa,CAAC;IAAC,GAAG,EAAE,QAAQ,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAElH;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC,CA6B1F;AAED,UAAU,QAAQ;IAChB,iFAAiF;IACjF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,uCAAuC;AACvC,MAAM,MAAM,SAAS,GACjB,CAAC,QAAQ,GAAG;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,GACjE,CAAC,QAAQ,GAAG;IAAE,OAAO,EAAE,QAAQ,CAAA;CAAE,CAAC,GAClC,CAAC,QAAQ,GAAG;IAAE,OAAO,EAAE,cAAc,CAAC;IAAC,MAAM,EAAE,gBAAgB,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,GAClF,CAAC,QAAQ,GAAG;IAAE,OAAO,EAAE,YAAY,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,GACtD,CAAC,QAAQ,GAAG;IAAE,OAAO,EAAE,WAAW,CAAC;IAAC,UAAU,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEhF,MAAM,MAAM,gBAAgB,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC;AAEpD,wDAAwD;AACxD,eAAO,MAAM,mBAAmB,EAAE,SAAS,gBAAgB,EAAmE,CAAC;AAE/H,sEAAsE;AACtE,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B;AAED,MAAM,WAAW,WAAW;IAC1B,mEAAmE;IACnE,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;CAC/C;AAED,MAAM,WAAW,eAAe;IAC9B,qEAAqE;IACrE,EAAE,EAAE,OAAO,CAAC;IACZ,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CAClC;AAsBD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,OAAO,EACjB,GAAG,EAAE,aAAa,EAClB,QAAQ,EAAE,SAAS,WAAW,EAAE,EAChC,OAAO,GAAE,WAAgB,GACxB,eAAe,CAsEjB;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAM1D;AAED,iEAAiE;AACjE,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,GAAG,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAOrH;AAED,yHAAyH;AACzH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAazD"}
|