@intentius/chant 0.124.13 → 0.124.14
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/bin/chant +11 -0
- package/dist/agents/checks.js +326 -0
- package/dist/agents/discover.js +885 -0
- package/dist/agents/importer.js +17 -0
- package/dist/agents/index.js +12 -0
- package/dist/agents/types.js +19 -0
- package/dist/apply.js +151 -0
- package/dist/attrref.js +70 -0
- package/dist/audit/catalog.js +350 -0
- package/dist/audit/core.js +252 -0
- package/dist/audit/discover.js +633 -0
- package/dist/audit/fetch.js +666 -0
- package/dist/audit/lineage.js +91 -0
- package/dist/audit/nginx.js +366 -0
- package/dist/audit/prior-art.js +132 -0
- package/dist/audit/proof.js +321 -0
- package/dist/audit/report-html.js +194 -0
- package/dist/audit/report-model.js +198 -0
- package/dist/audit/report.js +102 -0
- package/dist/audit/rules-doc.js +144 -0
- package/dist/audit/secrets.js +405 -0
- package/dist/audit/terraform-state.js +140 -0
- package/dist/audit/wrangler.js +262 -0
- package/dist/behaviour-delta.js +401 -0
- package/dist/behaviour-engine.js +357 -0
- package/dist/behaviour-graph.js +83 -0
- package/dist/behaviour-http.js +188 -0
- package/dist/behaviour-kinds.js +172 -0
- package/dist/behaviour-overlay.js +50 -0
- package/dist/behaviour-predict.js +188 -0
- package/dist/behaviour-request.js +194 -0
- package/dist/behaviour.js +1325 -0
- package/dist/build-params.js +108 -0
- package/dist/build.js +668 -0
- package/dist/builder.js +44 -0
- package/dist/cdk/advise.js +30 -0
- package/dist/cdk/assembly.js +122 -0
- package/dist/cdk/graph.js +444 -0
- package/dist/cdk/tier-map.js +64 -0
- package/dist/cdk/types.js +24 -0
- package/dist/change-set.js +312 -0
- package/dist/child-project.js +21 -0
- package/dist/claimed-fields.js +135 -0
- package/dist/cli/build-options.js +70 -0
- package/dist/cli/build-params-cli.js +139 -0
- package/dist/cli/command-group.js +123 -0
- package/dist/cli/commands/audit-agents.js +326 -0
- package/dist/cli/commands/audit.js +571 -0
- package/dist/cli/commands/build.js +920 -0
- package/dist/cli/commands/carve-apply.js +153 -0
- package/dist/cli/commands/carve-bridge.js +201 -0
- package/dist/cli/commands/carve-emit.js +332 -0
- package/dist/cli/commands/carve-status.js +119 -0
- package/dist/cli/commands/carve.js +204 -0
- package/dist/cli/commands/check-lexicon-docs.js +79 -0
- package/dist/cli/commands/check-lexicon-examples.js +177 -0
- package/dist/cli/commands/check-lexicon-intrinsics.js +291 -0
- package/dist/cli/commands/check-lexicon-mcp.js +82 -0
- package/dist/cli/commands/check-lexicon-plugin.d.ts.map +1 -1
- package/dist/cli/commands/check-lexicon-plugin.js +104 -0
- package/dist/cli/commands/check-lexicon.js +766 -0
- package/dist/cli/commands/describe.js +85 -0
- package/dist/cli/commands/diff.js +175 -0
- package/dist/cli/commands/doctor.js +350 -0
- package/dist/cli/commands/import-agents.js +155 -0
- package/dist/cli/commands/import.js +670 -0
- package/dist/cli/commands/init-lexicon/templates/codegen.js +194 -0
- package/dist/cli/commands/init-lexicon/templates/docs.js +100 -0
- package/dist/cli/commands/init-lexicon/templates/examples.js +29 -0
- package/dist/cli/commands/init-lexicon/templates/lint.js +34 -0
- package/dist/cli/commands/init-lexicon/templates/lsp.js +37 -0
- package/dist/cli/commands/init-lexicon/templates/plugin.js +108 -0
- package/dist/cli/commands/init-lexicon/templates/project.js +240 -0
- package/dist/cli/commands/init-lexicon/templates/spec.js +56 -0
- package/dist/cli/commands/init-lexicon/templates/tests.js +66 -0
- package/dist/cli/commands/init-lexicon.js +172 -0
- package/dist/cli/commands/init.js +381 -0
- package/dist/cli/commands/lexicon-rolling-upgrade.js +145 -0
- package/dist/cli/commands/lexicon-surface-diff.js +145 -0
- package/dist/cli/commands/licenses.js +125 -0
- package/dist/cli/commands/lint.d.ts.map +1 -1
- package/dist/cli/commands/lint.js +948 -0
- package/dist/cli/commands/list.js +63 -0
- package/dist/cli/commands/migrate.d.ts.map +1 -1
- package/dist/cli/commands/migrate.js +423 -0
- package/dist/cli/commands/onboard.js +403 -0
- package/dist/cli/commands/pinned-upgrade.js +191 -0
- package/dist/cli/commands/update.js +194 -0
- package/dist/cli/commands/vendor.js +217 -0
- package/dist/cli/conflict-check.js +104 -0
- package/dist/cli/debug.js +8 -0
- package/dist/cli/format.js +104 -0
- package/dist/cli/handlers/build.js +267 -0
- package/dist/cli/handlers/carve-apply.js +30 -0
- package/dist/cli/handlers/carve-bridge.js +28 -0
- package/dist/cli/handlers/carve-emit.js +50 -0
- package/dist/cli/handlers/carve-status.js +26 -0
- package/dist/cli/handlers/carve.js +40 -0
- package/dist/cli/handlers/change-set.js +46 -0
- package/dist/cli/handlers/components.js +730 -0
- package/dist/cli/handlers/dev.js +113 -0
- package/dist/cli/handlers/emulator.js +233 -0
- package/dist/cli/handlers/explain.js +54 -0
- package/dist/cli/handlers/fan-out.js +422 -0
- package/dist/cli/handlers/gate-resume.js +275 -0
- package/dist/cli/handlers/generate.js +84 -0
- package/dist/cli/handlers/graph.js +969 -0
- package/dist/cli/handlers/init.js +102 -0
- package/dist/cli/handlers/lifecycle.js +1727 -0
- package/dist/cli/handlers/lint.js +62 -0
- package/dist/cli/handlers/migrate.js +48 -0
- package/dist/cli/handlers/misc.js +391 -0
- package/dist/cli/handlers/operator.js +1162 -0
- package/dist/cli/handlers/override-approve.js +102 -0
- package/dist/cli/handlers/pr.js +503 -0
- package/dist/cli/handlers/promote.js +342 -0
- package/dist/cli/handlers/run-generate.js +206 -0
- package/dist/cli/handlers/run-wave.js +66 -0
- package/dist/cli/handlers/run.js +1191 -0
- package/dist/cli/handlers/scenario.js +325 -0
- package/dist/cli/handlers/search.js +924 -0
- package/dist/cli/handlers/serve.js +32 -0
- package/dist/cli/handlers/vendor.js +154 -0
- package/dist/cli/index.js +3 -0
- package/dist/cli/is-entry-point.js +23 -0
- package/dist/cli/lsp/capabilities.js +28 -0
- package/dist/cli/lsp/diagnostics.js +34 -0
- package/dist/cli/lsp/server.js +329 -0
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +2540 -0
- package/dist/cli/mcp/lifecycle-tools.js +80 -0
- package/dist/cli/mcp/op-tools.js +306 -0
- package/dist/cli/mcp/resource-handlers.js +258 -0
- package/dist/cli/mcp/resources/context.js +85 -0
- package/dist/cli/mcp/server.js +353 -0
- package/dist/cli/mcp/tools/build.js +111 -0
- package/dist/cli/mcp/tools/composites.js +95 -0
- package/dist/cli/mcp/tools/explain.js +166 -0
- package/dist/cli/mcp/tools/import.js +49 -0
- package/dist/cli/mcp/tools/lint.js +41 -0
- package/dist/cli/mcp/tools/scaffold.js +111 -0
- package/dist/cli/mcp/tools/search.js +112 -0
- package/dist/cli/mcp/types.js +1 -0
- package/dist/cli/mcp/workspace-plugins.js +91 -0
- package/dist/cli/mcp/workspace-tools.d.ts +1 -1
- package/dist/cli/mcp/workspace-tools.js +564 -0
- package/dist/cli/mcp-config.js +70 -0
- package/dist/cli/plugins.js +313 -0
- package/dist/cli/registry.js +23 -0
- package/dist/cli/reporters/stylish.js +329 -0
- package/dist/cli/version.js +15 -0
- package/dist/cli/watch.js +79 -0
- package/dist/codegen/bound-property-types.js +82 -0
- package/dist/codegen/coverage.js +119 -0
- package/dist/codegen/docs-file-markers.js +60 -0
- package/dist/codegen/docs-pages.js +115 -0
- package/dist/codegen/docs-rule-scanning.js +164 -0
- package/dist/codegen/docs-rules.js +76 -0
- package/dist/codegen/docs-sections.js +117 -0
- package/dist/codegen/docs-sidebar.js +65 -0
- package/dist/codegen/docs-types.js +4 -0
- package/dist/codegen/docs.js +356 -0
- package/dist/codegen/fetch.js +340 -0
- package/dist/codegen/generate-post-synth-barrel.js +63 -0
- package/dist/codegen/generate-registry.js +71 -0
- package/dist/codegen/generate-runtime-index.js +56 -0
- package/dist/codegen/generate-typescript.js +119 -0
- package/dist/codegen/generate.js +115 -0
- package/dist/codegen/json-patch.js +141 -0
- package/dist/codegen/json-schema-to-ts.js +344 -0
- package/dist/codegen/json-schema.js +246 -0
- package/dist/codegen/lexicon-regen.js +412 -0
- package/dist/codegen/naming.js +217 -0
- package/dist/codegen/okf-lexicon.js +245 -0
- package/dist/codegen/package.js +150 -0
- package/dist/codegen/pinned-upgrade.d.ts.map +1 -1
- package/dist/codegen/pinned-upgrade.js +494 -0
- package/dist/codegen/registry.js +60 -0
- package/dist/codegen/rehype-base-url.mjs +68 -0
- package/dist/codegen/rolling-upgrade.js +217 -0
- package/dist/codegen/surface-snapshot.js +537 -0
- package/dist/codegen/testdata/postgres-tags.json +242 -0
- package/dist/codegen/topo-sort.js +36 -0
- package/dist/codegen/typecheck.js +115 -0
- package/dist/codegen/validate.js +200 -0
- package/dist/codegen/version-bump.js +35 -0
- package/dist/components/auto-release.js +143 -0
- package/dist/components/builders.js +47 -0
- package/dist/components/capability-plugin-loader.js +175 -0
- package/dist/components/capability-plugin-schema.js +46 -0
- package/dist/components/capability-plugin.js +99 -0
- package/dist/components/capability.js +60 -0
- package/dist/components/changed-files.js +72 -0
- package/dist/components/cli-support.js +427 -0
- package/dist/components/component.js +120 -0
- package/dist/components/component.schema.json +271 -0
- package/dist/components/config-defaults.js +130 -0
- package/dist/components/deploy-units.js +60 -0
- package/dist/components/discover.d.ts.map +1 -1
- package/dist/components/discover.js +189 -0
- package/dist/components/driver-output.js +86 -0
- package/dist/components/driver.js +728 -0
- package/dist/components/fan-out-output.js +165 -0
- package/dist/components/fan-out-record.js +94 -0
- package/dist/components/fan-out-run.js +373 -0
- package/dist/components/fan-out-support.js +60 -0
- package/dist/components/fan-out.js +273 -0
- package/dist/components/gate-plan.js +41 -0
- package/dist/components/gated-wave-pipeline.js +46 -0
- package/dist/components/index.js +24 -0
- package/dist/components/layers.js +28 -0
- package/dist/components/manifest-persistence.js +108 -0
- package/dist/components/pilots/alb-ecs.pilot.js +59 -0
- package/dist/components/pilots/dynamodb.pilot.js +51 -0
- package/dist/components/pilots/jar-emr.pilot.js +65 -0
- package/dist/components/pilots/lambda.pilot.js +52 -0
- package/dist/components/pilots/neo4j-fanout.pilot.js +68 -0
- package/dist/components/pilots/project.js +12 -0
- package/dist/components/pr-pipeline.js +134 -0
- package/dist/components/pr-run.js +363 -0
- package/dist/components/presets/ecs-fargate.js +72 -0
- package/dist/components/presets/index.js +28 -0
- package/dist/components/presets/lambda.js +34 -0
- package/dist/components/presets/single-host-compose.js +41 -0
- package/dist/components/promote.js +549 -0
- package/dist/components/registry.js +34 -0
- package/dist/components/run-progress.js +33 -0
- package/dist/components/sandbox/driver.d.ts.map +1 -1
- package/dist/components/sandbox/driver.js +93 -0
- package/dist/components/sandbox/run.js +115 -0
- package/dist/components/starter-plugin.js +104 -0
- package/dist/components/verbs/__tests__/mock-cloud-executor.js +68 -0
- package/dist/components/verbs/__tests__/mock-process-runner.js +45 -0
- package/dist/components/verbs/__tests__/mock-sbom-generator.js +56 -0
- package/dist/components/verbs/bom-writer.js +287 -0
- package/dist/components/verbs/build-archive.js +188 -0
- package/dist/components/verbs/build.js +142 -0
- package/dist/components/verbs/cloud-executor.js +110 -0
- package/dist/components/verbs/component-bom.js +125 -0
- package/dist/components/verbs/ensure-secret.js +50 -0
- package/dist/components/verbs/index.js +61 -0
- package/dist/components/verbs/license-policy.js +75 -0
- package/dist/components/verbs/lockfile-sbom-generator.js +191 -0
- package/dist/components/verbs/process-runner.js +78 -0
- package/dist/components/verbs/r2-sync.js +93 -0
- package/dist/components/verbs/reproducibility.js +62 -0
- package/dist/components/verbs/run-agent.js +577 -0
- package/dist/components/verbs/sbom-generator.js +119 -0
- package/dist/components/verbs/sbom.js +97 -0
- package/dist/components/verbs/shell.js +32 -0
- package/dist/components/verbs/sign.js +221 -0
- package/dist/components/verbs/stub.js +28 -0
- package/dist/components/verbs/tool-sbom-generator.js +154 -0
- package/dist/components/verbs/verify.js +112 -0
- package/dist/components/verbs/vex.js +131 -0
- package/dist/components/verbs/vuln-gate.js +152 -0
- package/dist/components/verbs/vuln-scan.js +288 -0
- package/dist/components/verbs/wait-verify.js +106 -0
- package/dist/components/verbs/wrangler.js +179 -0
- package/dist/components/wave-plan.js +102 -0
- package/dist/composite.js +305 -0
- package/dist/config-import.d.ts.map +1 -1
- package/dist/config-import.js +22 -0
- package/dist/config-sandbox.js +122 -0
- package/dist/config-static.js +206 -0
- package/dist/config.js +605 -0
- package/dist/content-digest.js +23 -0
- package/dist/declarable.js +114 -0
- package/dist/deep-observation.js +437 -0
- package/dist/detectLexicon.js +54 -0
- package/dist/discovery/cache.js +70 -0
- package/dist/discovery/collect.js +208 -0
- package/dist/discovery/cycles.js +95 -0
- package/dist/discovery/entity-wire-codec.js +391 -0
- package/dist/discovery/entity-wire.js +42 -0
- package/dist/discovery/files.js +121 -0
- package/dist/discovery/fold-import.d.ts.map +1 -1
- package/dist/discovery/fold-import.js +4178 -0
- package/dist/discovery/fold-rank.js +292 -0
- package/dist/discovery/graph.js +115 -0
- package/dist/discovery/import.d.ts.map +1 -1
- package/dist/discovery/import.js +65 -0
- package/dist/discovery/index.js +333 -0
- package/dist/discovery/param-deps.js +487 -0
- package/dist/discovery/resolve.js +39 -0
- package/dist/discovery/sandbox/bundle.js +214 -0
- package/dist/discovery/sandbox/child-errors.js +26 -0
- package/dist/discovery/sandbox/config-run.js +100 -0
- package/dist/discovery/sandbox/config-wire.js +183 -0
- package/dist/discovery/sandbox/driver.d.ts.map +1 -1
- package/dist/discovery/sandbox/driver.js +333 -0
- package/dist/discovery/sandbox/fork.js +229 -0
- package/dist/discovery/sandbox/policy-run.js +142 -0
- package/dist/discovery/sandbox/policy-wire.js +152 -0
- package/dist/discovery/sandbox/run.js +77 -0
- package/dist/discovery/specifier-resolve.js +320 -0
- package/dist/discovery/walk.js +284 -0
- package/dist/effect-receipt.js +340 -0
- package/dist/env.js +55 -0
- package/dist/errors.js +62 -0
- package/dist/fold/fold.js +1434 -0
- package/dist/fold/foldable-helpers.js +229 -0
- package/dist/fold/subset.js +696 -0
- package/dist/fold-provenance.js +414 -0
- package/dist/gate-decision.js +260 -0
- package/dist/gate-resume-run.js +154 -0
- package/dist/gated-waves.js +165 -0
- package/dist/governance.js +43 -0
- package/dist/graph-declared.js +45 -0
- package/dist/graph-detail.js +207 -0
- package/dist/graph-dot.js +54 -0
- package/dist/graph-effective.js +107 -0
- package/dist/graph-ir.js +623 -0
- package/dist/graph-layout.js +184 -0
- package/dist/graph-lens.js +105 -0
- package/dist/graph-mermaid.js +83 -0
- package/dist/graph-ops.js +39 -0
- package/dist/graph-refs.js +156 -0
- package/dist/held-elsewhere.js +87 -0
- package/dist/identity.js +251 -0
- package/dist/import/base-parser.js +34 -0
- package/dist/import/embedded.js +255 -0
- package/dist/import/generator.js +1 -0
- package/dist/import/ir-utils.js +85 -0
- package/dist/import/parser-options.js +45 -0
- package/dist/import/parser.js +1 -0
- package/dist/index.js +118 -0
- package/dist/intrinsic-interpolation.js +73 -0
- package/dist/intrinsic.js +31 -0
- package/dist/join-key.js +35 -0
- package/dist/kubectl-context.js +150 -0
- package/dist/lexicon-config.js +58 -0
- package/dist/lexicon-integrity.js +47 -0
- package/dist/lexicon-manifest.js +70 -0
- package/dist/lexicon-module.d.ts.map +1 -1
- package/dist/lexicon-module.js +241 -0
- package/dist/lexicon-output.js +218 -0
- package/dist/lexicon-plugin-helpers.js +104 -0
- package/dist/lexicon-schema.js +136 -0
- package/dist/lexicon.js +130 -0
- package/dist/lifecycle/affected.js +224 -0
- package/dist/lifecycle/assert-live.js +110 -0
- package/dist/lifecycle/build-ledger-store.js +160 -0
- package/dist/lifecycle/build-ledger.js +155 -0
- package/dist/lifecycle/change-set.js +356 -0
- package/dist/lifecycle/converge-ledger.js +161 -0
- package/dist/lifecycle/deep-diff.js +233 -0
- package/dist/lifecycle/deep-observe.js +147 -0
- package/dist/lifecycle/digest.js +143 -0
- package/dist/lifecycle/disruption.js +135 -0
- package/dist/lifecycle/gate-applied.js +113 -0
- package/dist/lifecycle/gate-audit.js +341 -0
- package/dist/lifecycle/gate-ledger-select.js +89 -0
- package/dist/lifecycle/gate-ledger.js +193 -0
- package/dist/lifecycle/gate-origin.js +117 -0
- package/dist/lifecycle/gate-pending.js +58 -0
- package/dist/lifecycle/git.js +1182 -0
- package/dist/lifecycle/identity.js +58 -0
- package/dist/lifecycle/index.js +26 -0
- package/dist/lifecycle/lease.js +283 -0
- package/dist/lifecycle/ledger-port.js +1 -0
- package/dist/lifecycle/legacy-digest.js +91 -0
- package/dist/lifecycle/live-diff.js +274 -0
- package/dist/lifecycle/local-note.js +15 -0
- package/dist/lifecycle/member-ledger.js +122 -0
- package/dist/lifecycle/observation-baseline.js +155 -0
- package/dist/lifecycle/observe.js +375 -0
- package/dist/lifecycle/oras-referrer-lookup.js +82 -0
- package/dist/lifecycle/override-ledger.js +54 -0
- package/dist/lifecycle/plan-digest.js +110 -0
- package/dist/lifecycle/plan-ledger.js +129 -0
- package/dist/lifecycle/receipt-plan.js +192 -0
- package/dist/lifecycle/release-ledger.js +155 -0
- package/dist/lifecycle/release-read.js +64 -0
- package/dist/lifecycle/replay.js +193 -0
- package/dist/lifecycle/rollback.js +102 -0
- package/dist/lifecycle/run-ledger.js +183 -0
- package/dist/lifecycle/scenario-eval.js +204 -0
- package/dist/lifecycle/scenario.js +214 -0
- package/dist/lifecycle/snapshot.js +239 -0
- package/dist/lifecycle/status.js +447 -0
- package/dist/lifecycle/symptoms.js +117 -0
- package/dist/lifecycle/teardown.js +255 -0
- package/dist/lifecycle/types.js +1 -0
- package/dist/lifecycle/unobserved-gate.js +33 -0
- package/dist/lifecycle/wave-plans.js +68 -0
- package/dist/lifecycle/work-item-id.js +36 -0
- package/dist/lifecycle/work-lease.js +393 -0
- package/dist/lint/component-checks.js +87 -0
- package/dist/lint/config.js +483 -0
- package/dist/lint/declarative.js +122 -0
- package/dist/lint/discover.d.ts.map +1 -1
- package/dist/lint/discover.js +138 -0
- package/dist/lint/engine.js +246 -0
- package/dist/lint/knowledge-checks.js +64 -0
- package/dist/lint/named-checks.js +22 -0
- package/dist/lint/output-checks.js +87 -0
- package/dist/lint/output-docs.js +163 -0
- package/dist/lint/parser.js +33 -0
- package/dist/lint/pipeline-change-gate.js +70 -0
- package/dist/lint/policy-import.d.ts +1 -1
- package/dist/lint/policy-import.d.ts.map +1 -1
- package/dist/lint/policy-import.js +62 -0
- package/dist/lint/policy-sandbox.js +86 -0
- package/dist/lint/policy.js +122 -0
- package/dist/lint/post-synth.js +87 -0
- package/dist/lint/presets/relaxed.json +26 -0
- package/dist/lint/presets/strict.json +24 -24
- package/dist/lint/receipt-checks.js +83 -0
- package/dist/lint/rule-loader.d.ts.map +1 -1
- package/dist/lint/rule-loader.js +89 -0
- package/dist/lint/rule-registry.js +86 -0
- package/dist/lint/rule.js +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp000-discovery-error/broken-a.component.js +7 -0
- package/dist/lint/rules/__fixtures__/comp/comp000-discovery-error/broken-b.component.js +7 -0
- package/dist/lint/rules/__fixtures__/comp/comp001/fail/orphan-lib.component.js +9 -0
- package/dist/lint/rules/__fixtures__/comp/comp001/pass/emr-job.component.js +11 -0
- package/dist/lint/rules/__fixtures__/comp/comp001/pass/jar-lib.component.js +9 -0
- package/dist/lint/rules/__fixtures__/comp/comp002/fail/search-service.component.js +25 -0
- package/dist/lint/rules/__fixtures__/comp/comp002/pass/jar-lib.component.js +8 -0
- package/dist/lint/rules/__fixtures__/comp/comp002/pass/search-service.component.js +21 -0
- package/dist/lint/rules/__fixtures__/comp/comp003/fail/migrator.component.js +8 -0
- package/dist/lint/rules/__fixtures__/comp/comp003/pass/agent-turn.component.js +24 -0
- package/dist/lint/rules/__fixtures__/comp/comp003/pass/migrator.component.js +17 -0
- package/dist/lint/rules/__fixtures__/comp/comp003/pass/orders-table.component.js +8 -0
- package/dist/lint/rules/__fixtures__/comp/comp004/fail/neo4j-cluster.component.js +18 -0
- package/dist/lint/rules/__fixtures__/comp/comp004/pass/neo4j-cluster.component.js +20 -0
- package/dist/lint/rules/__fixtures__/comp/comp004/pass/orders-table.component.js +8 -0
- package/dist/lint/rules/__fixtures__/comp/comp005/fail/search-service.component.js +12 -0
- package/dist/lint/rules/__fixtures__/comp/comp005/pass/search-service.component.js +16 -0
- package/dist/lint/rules/__fixtures__/comp/comp006/fail/legacy-tool.component.js +8 -0
- package/dist/lint/rules/__fixtures__/comp/comp006/pass/legacy-tool.component.js +12 -0
- package/dist/lint/rules/__fixtures__/comp/comp007/fail/inventory-table.component.js +11 -0
- package/dist/lint/rules/__fixtures__/comp/comp007/fail/orders-table.component.js +11 -0
- package/dist/lint/rules/__fixtures__/comp/comp007/pass/orders-table.component.js +10 -0
- package/dist/lint/rules/__fixtures__/comp/comp007/pass/search-service.component.js +16 -0
- package/dist/lint/rules/comp/comp001-publishes-never-applies.js +69 -0
- package/dist/lint/rules/comp/comp002-dangling-wiring-ref.js +84 -0
- package/dist/lint/rules/comp/comp003-mutating-no-rollback.js +103 -0
- package/dist/lint/rules/comp/comp004-gate-needs-durable-runtime.js +70 -0
- package/dist/lint/rules/comp/comp005-capability-kind-is-noun.js +109 -0
- package/dist/lint/rules/comp/comp006-shell-needs-reason.js +49 -0
- package/dist/lint/rules/comp/comp007-composition-sprawl.js +64 -0
- package/dist/lint/rules/comp/index.js +33 -0
- package/dist/lint/rules/comp/support.js +129 -0
- package/dist/lint/rules/composite-scope.js +51 -0
- package/dist/lint/rules/cor017-composite-name-match.js +93 -0
- package/dist/lint/rules/cor018-composite-prefer-lexicon-type.js +136 -0
- package/dist/lint/rules/cor021-env-literal-name.js +100 -0
- package/dist/lint/rules/cor022-receipt-leaf.js +118 -0
- package/dist/lint/rules/cor024-receipt-secret-pointer.js +199 -0
- package/dist/lint/rules/declarable-naming-convention.js +62 -0
- package/dist/lint/rules/evl001-non-literal-expression.js +66 -0
- package/dist/lint/rules/evl002-control-flow-resource.js +69 -0
- package/dist/lint/rules/evl003-dynamic-property-access.js +44 -0
- package/dist/lint/rules/evl004-spread-non-const.js +94 -0
- package/dist/lint/rules/evl005-resource-block-body.js +41 -0
- package/dist/lint/rules/evl007-invalid-siblings.js +105 -0
- package/dist/lint/rules/evl009-composite-no-constant.js +158 -0
- package/dist/lint/rules/evl010-composite-no-transform.js +59 -0
- package/dist/lint/rules/evl011-symbolic-in-template.js +106 -0
- package/dist/lint/rules/export-required.js +115 -0
- package/dist/lint/rules/file-declarable-limit.js +88 -0
- package/dist/lint/rules/flat-declarations.js +62 -0
- package/dist/lint/rules/index.js +90 -0
- package/dist/lint/rules/no-cyclic-declarable-ref.js +138 -0
- package/dist/lint/rules/no-redundant-type-import.js +76 -0
- package/dist/lint/rules/no-redundant-value-cast.js +41 -0
- package/dist/lint/rules/no-string-ref.js +59 -0
- package/dist/lint/rules/no-unused-declarable-import.js +75 -0
- package/dist/lint/rules/no-unused-declarable.js +142 -0
- package/dist/lint/rules/op/index.js +28 -0
- package/dist/lint/rules/op/ops012-activity-contract.js +54 -0
- package/dist/lint/rules/op/ops013-step-output-ref.js +88 -0
- package/dist/lint/rules/op/ops014-converge-rule-refusals.js +114 -0
- package/dist/lint/rules/op/ops015-gate-approval.js +45 -0
- package/dist/lint/rules/op/support.js +11 -0
- package/dist/lint/rules/op/sys010-key-over-plain-http.js +100 -0
- package/dist/lint/rules/property-kind.js +56 -0
- package/dist/lint/rules/single-concern-file.js +71 -0
- package/dist/lint/rules/sys001-no-literal-key.js +60 -0
- package/dist/lint/selectors.js +168 -0
- package/dist/lint/suppressions.js +129 -0
- package/dist/lint/typescript.js +17 -0
- package/dist/live-endpoint.js +113 -0
- package/dist/live-read-session.js +76 -0
- package/dist/lsp/lexicon-providers.js +163 -0
- package/dist/lsp/types.js +5 -0
- package/dist/managed-fields.js +293 -0
- package/dist/mcp/types.js +4 -0
- package/dist/notify-verify.js +0 -1
- package/dist/notify.js +0 -1
- package/dist/notify.schema.json +72 -0
- package/dist/observation.js +266 -0
- package/dist/okf-read.js +134 -0
- package/dist/okf.js +275 -0
- package/dist/op/__fixtures__/decide-stub-backend.js +125 -0
- package/dist/op/activities/activity-contracts.js +313 -0
- package/dist/op/activities/apply.js +582 -0
- package/dist/op/activities/build.js +18 -0
- package/dist/op/activities/change-coverage.js +40 -0
- package/dist/op/activities/change-set.js +64 -0
- package/dist/op/activities/converge.js +492 -0
- package/dist/op/activities/decide.js +211 -0
- package/dist/op/activities/env-teardown.js +110 -0
- package/dist/op/activities/factory.js +591 -0
- package/dist/op/activities/forge-pull-request.js +82 -0
- package/dist/op/activities/gh-host.js +78 -0
- package/dist/op/activities/guard-validate.js +165 -0
- package/dist/op/activities/http-check.js +40 -0
- package/dist/op/activities/index.js +59 -0
- package/dist/op/activities/lexicon-upgrade.js +629 -0
- package/dist/op/activities/lifecycle.js +109 -0
- package/dist/op/activities/pipeline-audit.js +147 -0
- package/dist/op/activities/policy.js +26 -0
- package/dist/op/activities/predict-behaviour.js +341 -0
- package/dist/op/activities/propose-upgrade.js +165 -0
- package/dist/op/activities/reconcile.js +997 -0
- package/dist/op/activities/shell.js +118 -0
- package/dist/op/activities/source-release.js +97 -0
- package/dist/op/activities/source-rollback.js +165 -0
- package/dist/op/activities/teardown.js +17 -0
- package/dist/op/activities/util.js +6 -0
- package/dist/op/activities/wait.js +51 -0
- package/dist/op/activities/work-evidence.js +35 -0
- package/dist/op/activities/workflow-audit.js +133 -0
- package/dist/op/activity-contract-registry.js +106 -0
- package/dist/op/activity-contract.js +232 -0
- package/dist/op/activity-failure.js +31 -0
- package/dist/op/activity-profiles.js +129 -0
- package/dist/op/activity-registry.js +105 -0
- package/dist/op/activity-runtime.js +28 -0
- package/dist/op/builders.js +801 -0
- package/dist/op/change-signal.js +118 -0
- package/dist/op/composites/apply-op.js +151 -0
- package/dist/op/composites/behaviour-op.js +65 -0
- package/dist/op/composites/converge-op.js +141 -0
- package/dist/op/composites/index.js +19 -0
- package/dist/op/composites/lexicon-upgrade-op.js +107 -0
- package/dist/op/composites/pipeline-audit-op.js +50 -0
- package/dist/op/composites/reconcile-op.js +84 -0
- package/dist/op/composites/watch-op.js +69 -0
- package/dist/op/composites/workflow-audit-op.js +57 -0
- package/dist/op/converge-rule.js +205 -0
- package/dist/op/cron.js +146 -0
- package/dist/op/decide-backend.js +181 -0
- package/dist/op/decide-config.js +68 -0
- package/dist/op/decide-read-inputs.js +141 -0
- package/dist/op/discover.d.ts.map +1 -1
- package/dist/op/discover.js +213 -0
- package/dist/op/duration.js +21 -0
- package/dist/op/emulator-freshness.js +80 -0
- package/dist/op/emulator-lifecycle.js +269 -0
- package/dist/op/factory.js +83 -0
- package/dist/op/gate-approval.js +172 -0
- package/dist/op/gate-name.js +86 -0
- package/dist/op/gate-plan-context.js +167 -0
- package/dist/op/gate-point-run.js +67 -0
- package/dist/op/gate-point.js +111 -0
- package/dist/op/gate-resume-plan.js +155 -0
- package/dist/op/gate-resume.js +31 -0
- package/dist/op/gate-review.js +290 -0
- package/dist/op/gate-run-locator.js +85 -0
- package/dist/op/gate-summary.js +100 -0
- package/dist/op/gate-wait.js +56 -0
- package/dist/op/gate.js +449 -0
- package/dist/op/generate-pipeline.js +124 -0
- package/dist/op/index.js +51 -0
- package/dist/op/lifecycle-receipt-store.js +45 -0
- package/dist/op/local-executor.js +1164 -0
- package/dist/op/local-output.js +140 -0
- package/dist/op/op-ir.js +317 -0
- package/dist/op/op-verb-class.js +131 -0
- package/dist/op/op-waves-notify.js +136 -0
- package/dist/op/op-waves-run.js +1657 -0
- package/dist/op/op-waves.js +409 -0
- package/dist/op/operator.js +743 -0
- package/dist/op/receipt-store.js +94 -0
- package/dist/op/resource.js +23 -0
- package/dist/op/run-context.js +28 -0
- package/dist/op/run-live.js +256 -0
- package/dist/op/runtime.js +21 -0
- package/dist/op/runtimes/local.js +195 -0
- package/dist/op/source-archive.js +131 -0
- package/dist/op/step-output-ref.js +397 -0
- package/dist/op/steward-beside.js +169 -0
- package/dist/op/steward-points.js +138 -0
- package/dist/op/steward-turn.js +59 -0
- package/dist/op/steward.js +317 -0
- package/dist/op/types.js +25 -0
- package/dist/op/work-lease-decl.js +81 -0
- package/dist/op/work-lease-run.js +393 -0
- package/dist/override-gate.js +284 -0
- package/dist/owner-chain.js +74 -0
- package/dist/ownership.js +92 -0
- package/dist/params.js +61 -0
- package/dist/plan-summary.js +711 -0
- package/dist/point-decision.js +211 -0
- package/dist/pr-forge.js +810 -0
- package/dist/pr-loop.js +203 -0
- package/dist/project-codegen.js +191 -0
- package/dist/project-root.js +74 -0
- package/dist/project-validation.js +50 -0
- package/dist/provenance.js +157 -0
- package/dist/pseudo-parameter.js +40 -0
- package/dist/reconcile.js +450 -0
- package/dist/resource-attributes.js +33 -0
- package/dist/runtime-adapter.js +77 -0
- package/dist/runtime.js +66 -0
- package/dist/secret-materialization.js +153 -0
- package/dist/secret-provenance.js +250 -0
- package/dist/serializer-walker.js +112 -0
- package/dist/serializer.js +1 -0
- package/dist/sort.js +45 -0
- package/dist/stack-output.js +115 -0
- package/dist/telemetry-attribution.js +149 -0
- package/dist/terraform/__fixtures__/build-graph.js +63 -0
- package/dist/terraform/adopt-state.js +40 -0
- package/dist/terraform/aws-resources.js +384 -0
- package/dist/terraform/bridge.js +204 -0
- package/dist/terraform/carve-provider.js +155 -0
- package/dist/terraform/carve.js +138 -0
- package/dist/terraform/data-source-shape.js +57 -0
- package/dist/terraform/emit-source.js +36 -0
- package/dist/terraform/excise.js +123 -0
- package/dist/terraform/graduate.js +128 -0
- package/dist/terraform/graph.js +435 -0
- package/dist/terraform/hcl2json.js +60 -0
- package/dist/terraform/manifest.js +149 -0
- package/dist/terraform/parse.js +81 -0
- package/dist/terraform/providers/aws.js +146 -0
- package/dist/terraform/providers/gcp.js +294 -0
- package/dist/terraform/providers/index.js +17 -0
- package/dist/terraform/providers/kubernetes.js +253 -0
- package/dist/terraform/score.js +151 -0
- package/dist/terraform/state.js +67 -0
- package/dist/terraform/tier-map.js +74 -0
- package/dist/terraform/types.js +13 -0
- package/dist/terraform/unified-diff.js +132 -0
- package/dist/testing.js +295 -0
- package/dist/toml-emit.js +153 -0
- package/dist/toml-parse.js +355 -0
- package/dist/toml-utils.js +60 -0
- package/dist/toml.js +428 -0
- package/dist/ts-loader.d.ts +46 -0
- package/dist/ts-loader.d.ts.map +1 -0
- package/dist/ts-loader.js +103 -0
- package/dist/types.js +1 -0
- package/dist/utils.js +61 -0
- package/dist/validation.js +20 -0
- package/dist/vendor/js-yaml-load.js +1662 -0
- package/dist/workspace/__fixtures__/contract-repo.js +103 -0
- package/dist/workspace/__fixtures__/decide-workspace.js +112 -0
- package/dist/workspace/__fixtures__/sessions.js +91 -0
- package/dist/workspace/__fixtures__/two-member-workspace.js +34 -0
- package/dist/workspace/agent-cli.js +99 -0
- package/dist/workspace/agent.schema.json +390 -0
- package/dist/workspace/answers-ledger.js +89 -0
- package/dist/workspace/box-cli.js +142 -0
- package/dist/workspace/box-factory-write.js +196 -0
- package/dist/workspace/box-factory-write.schema.json +342 -0
- package/dist/workspace/box-factory.js +88 -0
- package/dist/workspace/box-intent.js +126 -0
- package/dist/workspace/box-isolation.js +169 -0
- package/dist/workspace/box-listing-write.schema.json +204 -0
- package/dist/workspace/box-listing.js +298 -0
- package/dist/workspace/box-publish.js +352 -0
- package/dist/workspace/box-publish.schema.json +498 -0
- package/dist/workspace/box-services.js +39 -0
- package/dist/workspace/broker-protocol.js +359 -0
- package/dist/workspace/broker-protocol.schema.json +228 -0
- package/dist/workspace/change-set.schema.json +460 -0
- package/dist/workspace/changes-cli.js +56 -0
- package/dist/workspace/changes.js +446 -0
- package/dist/workspace/changes.schema.json +642 -0
- package/dist/workspace/chant-migrations/chud-lexicon-exit-fly-site.js +198 -0
- package/dist/workspace/chant-migrations/chud-lexicon-exit-live-names.js +155 -0
- package/dist/workspace/chant-migrations/chud-lexicon-exit-rollback.js +214 -0
- package/dist/workspace/chant-migrations/chud-lexicon-exit-ship-inputs.js +180 -0
- package/dist/workspace/chant-migrations/chud-lexicon-exit-ship-policy.js +99 -0
- package/dist/workspace/chant-migrations/chud-lexicon-exit.js +847 -0
- package/dist/workspace/chant-migrations.js +113 -0
- package/dist/workspace/check.schema.json +433 -0
- package/dist/workspace/checks/box-isolation.js +62 -0
- package/dist/workspace/checks/boxes.js +491 -0
- package/dist/workspace/checks/diagrams.js +104 -0
- package/dist/workspace/checks/generated.js +419 -0
- package/dist/workspace/checks/ledgers.js +212 -0
- package/dist/workspace/checks/links.js +191 -0
- package/dist/workspace/checks/live.js +100 -0
- package/dist/workspace/checks/pipelines.js +188 -0
- package/dist/workspace/checks/records.js +169 -0
- package/dist/workspace/checks.js +426 -0
- package/dist/workspace/ci-green-cli.js +125 -0
- package/dist/workspace/ci-green-forge.js +83 -0
- package/dist/workspace/ci-green-workflow.js +199 -0
- package/dist/workspace/ci-green.js +325 -0
- package/dist/workspace/ci-last-green.schema.json +158 -0
- package/dist/workspace/compose-graph.js +235 -0
- package/dist/workspace/compose-reports.js +146 -0
- package/dist/workspace/composites.js +264 -0
- package/dist/workspace/composites.schema.json +617 -0
- package/dist/workspace/conformance/__fixture__/app/package.json +7 -0
- package/dist/workspace/conformance/__fixture__/app/src/server.mjs +29 -0
- package/dist/workspace/conformance/__fixture__/decisions/decision.kind.mjs +54 -0
- package/dist/workspace/conformance/__fixture__/decisions/decision.schema.json +512 -0
- package/dist/workspace/conformance/__fixture__/decisions/fix-001-how-the-app-is-deployed.md +40 -0
- package/dist/workspace/conformance/__fixture__/delivery/chant.config.ts +7 -0
- package/dist/workspace/conformance/__fixture__/delivery/lexicon/index.ts +26 -0
- package/dist/workspace/conformance/__fixture__/delivery/package.json +7 -0
- package/dist/workspace/conformance/__fixture__/delivery/src/app.component.ts +14 -0
- package/dist/workspace/conformance/__fixture__/delivery/src/app.ts +4 -0
- package/dist/workspace/conformance/__fixtures__/reference-broker.js +205 -0
- package/dist/workspace/conformance/__writer_fixture__/answers/answer.kind.mjs +32 -0
- package/dist/workspace/conformance/__writer_fixture__/answers/answer.schema.json +135 -0
- package/dist/workspace/conformance/__writer_fixture__/contracts/contract.kind.mjs +37 -0
- package/dist/workspace/conformance/__writer_fixture__/contracts/contract.schema.json +213 -0
- package/dist/workspace/conformance/__writer_fixture__/decisions/points.json +228 -0
- package/dist/workspace/conformance/__writer_fixture__/drivers/driver.kind.mjs +15 -0
- package/dist/workspace/conformance/__writer_fixture__/drivers/driver.schema.json +38 -0
- package/dist/workspace/conformance/__writer_fixture__/sessions/session.kind.mjs +54 -0
- package/dist/workspace/conformance/__writer_fixture__/sessions/session.schema.json +289 -0
- package/dist/workspace/conformance/__writer_fixture__/work/W-001-the-writer-suite-works-this-item.md +25 -0
- package/dist/workspace/conformance/__writer_fixture__/work/work.kind.mjs +60 -0
- package/dist/workspace/conformance/__writer_fixture__/work/work.schema.json +603 -0
- package/dist/workspace/conformance/broker.js +736 -0
- package/dist/workspace/conformance/index.js +673 -0
- package/dist/workspace/conformance/vitest.js +108 -0
- package/dist/workspace/conformance/writer.js +1080 -0
- package/dist/workspace/decide.js +879 -0
- package/dist/workspace/decision-points.schema.json +135 -135
- package/dist/workspace/declaration-write-cli.js +74 -0
- package/dist/workspace/declaration-write.js +238 -0
- package/dist/workspace/declaration.js +938 -0
- package/dist/workspace/declaration.schema.json +1413 -1413
- package/dist/workspace/declared-kinds.js +106 -0
- package/dist/workspace/environments.js +164 -0
- package/dist/workspace/evidence.schema.json +279 -0
- package/dist/workspace/export-cli.js +185 -0
- package/dist/workspace/export.js +499 -0
- package/dist/workspace/factory-rules.js +175 -0
- package/dist/workspace/generated-files.js +92 -0
- package/dist/workspace/glob.js +45 -0
- package/dist/workspace/graph-cache.js +352 -0
- package/dist/workspace/graph-cli.js +348 -0
- package/dist/workspace/graph.schema.json +1338 -0
- package/dist/workspace/identity-gate-rule.js +75 -0
- package/dist/workspace/identity.js +126 -0
- package/dist/workspace/import.js +283 -0
- package/dist/workspace/init.js +620 -0
- package/dist/workspace/intent-cli.js +263 -0
- package/dist/workspace/intent-joins.js +201 -0
- package/dist/workspace/intent-record.js +352 -0
- package/dist/workspace/intent-record.schema.json +864 -0
- package/dist/workspace/intent.js +1582 -0
- package/dist/workspace/intent.schema.json +2420 -0
- package/dist/workspace/json-edit.js +221 -0
- package/dist/workspace/jsonc.js +235 -0
- package/dist/workspace/kind-readers.js +103 -0
- package/dist/workspace/kinds.js +587 -0
- package/dist/workspace/lexicon-symbols.js +112 -0
- package/dist/workspace/lineage-adopt-cli.js +102 -0
- package/dist/workspace/lineage-adopt.js +360 -0
- package/dist/workspace/lineage-check.js +282 -0
- package/dist/workspace/lineage-cli.js +121 -0
- package/dist/workspace/lineage-hash-index.js +284 -0
- package/dist/workspace/lineage-init.js +507 -0
- package/dist/workspace/lineage-lock.js +387 -0
- package/dist/workspace/lineage-merge.js +45 -0
- package/dist/workspace/lineage-migrations.d.ts.map +1 -1
- package/dist/workspace/lineage-migrations.js +329 -0
- package/dist/workspace/lineage-provenance.js +36 -0
- package/dist/workspace/lineage-update.js +138 -0
- package/dist/workspace/lineage-upgrade-cli.js +131 -0
- package/dist/workspace/lineage-upgrade.js +889 -0
- package/dist/workspace/lineage-vendor.js +171 -0
- package/dist/workspace/lineage-version.js +128 -0
- package/dist/workspace/lineage-versions.js +275 -0
- package/dist/workspace/links.js +330 -0
- package/dist/workspace/ls-generated.js +95 -0
- package/dist/workspace/ls.js +277 -0
- package/dist/workspace/ls.schema.json +333 -0
- package/dist/workspace/member-commands.js +508 -0
- package/dist/workspace/member-handles.js +216 -0
- package/dist/workspace/member-pipeline.js +258 -0
- package/dist/workspace/member-run.js +117 -0
- package/dist/workspace/member-write.schema.json +193 -0
- package/dist/workspace/nested-graph.js +156 -0
- package/dist/workspace/nesting.js +38 -0
- package/dist/workspace/patch.js +301 -0
- package/dist/workspace/patch.schema.json +321 -0
- package/dist/workspace/pin-cli.js +55 -0
- package/dist/workspace/pin-integrity.js +100 -0
- package/dist/workspace/plan-summary.schema.json +155 -0
- package/dist/workspace/point-answer.schema.json +129 -129
- package/dist/workspace/points-cli.js +291 -0
- package/dist/workspace/points-write.schema.json +660 -0
- package/dist/workspace/points.js +521 -0
- package/dist/workspace/points.schema.json +916 -0
- package/dist/workspace/pr-report.schema.json +108 -0
- package/dist/workspace/principal-classes.js +245 -0
- package/dist/workspace/reason-codes.js +326 -0
- package/dist/workspace/record-assets.js +151 -0
- package/dist/workspace/record-decided.js +105 -0
- package/dist/workspace/record-sessions.js +96 -0
- package/dist/workspace/record-source.js +114 -0
- package/dist/workspace/records-amend.schema.json +284 -0
- package/dist/workspace/records-checkout.js +76 -0
- package/dist/workspace/records-cli.js +707 -0
- package/dist/workspace/records-close.js +116 -0
- package/dist/workspace/records-close.schema.json +278 -0
- package/dist/workspace/records-new.schema.json +202 -0
- package/dist/workspace/records-review.schema.json +367 -0
- package/dist/workspace/records-since.js +317 -0
- package/dist/workspace/records-since.schema.json +218 -0
- package/dist/workspace/records-write.js +1229 -0
- package/dist/workspace/records.js +1345 -0
- package/dist/workspace/records.schema.json +604 -0
- package/dist/workspace/reference-kinds/app/package.json +10 -0
- package/dist/workspace/reference-kinds/app/workspace-kinds.json +45 -0
- package/dist/workspace/returns.js +303 -0
- package/dist/workspace/root-refusal.js +75 -0
- package/dist/workspace/run-statement.schema.json +622 -0
- package/dist/workspace/runs-cli.js +584 -0
- package/dist/workspace/runs-write.schema.json +994 -0
- package/dist/workspace/runs.js +708 -0
- package/dist/workspace/runs.schema.json +1257 -0
- package/dist/workspace/runtimes.js +76 -0
- package/dist/workspace/session-kinds.js +83 -0
- package/dist/workspace/signers.schema.json +206 -0
- package/dist/workspace/source-block.js +125 -0
- package/dist/workspace/squash.js +177 -0
- package/dist/workspace/status-gates.js +162 -0
- package/dist/workspace/status-stewards.js +330 -0
- package/dist/workspace/status.js +514 -0
- package/dist/workspace/status.schema.json +998 -0
- package/dist/workspace/steward-index.js +191 -0
- package/dist/workspace/symbols.js +188 -0
- package/dist/workspace/template-manifest.js +227 -0
- package/dist/workspace/template-pins.js +115 -0
- package/dist/workspace/trailer-joins.js +65 -0
- package/dist/workspace/trailers.js +111 -0
- package/dist/workspace/tree.js +136 -0
- package/dist/workspace/trust/attestor.js +63 -0
- package/dist/workspace/trust/dsse.js +108 -0
- package/dist/workspace/trust/evidence-cli.js +175 -0
- package/dist/workspace/trust/evidence.js +161 -0
- package/dist/workspace/trust/gate-seal.js +226 -0
- package/dist/workspace/trust/policy.js +190 -0
- package/dist/workspace/trust/provenance.js +180 -0
- package/dist/workspace/trust/rotation.js +298 -0
- package/dist/workspace/trust/run-commits.js +101 -0
- package/dist/workspace/trust/run-statement.js +182 -0
- package/dist/workspace/trust/seal.js +272 -0
- package/dist/workspace/trust/signers-cli.js +152 -0
- package/dist/workspace/trust/ssh-commit.js +178 -0
- package/dist/workspace/trust/test-repo.js +118 -0
- package/dist/workspace/trust/trust-files.js +193 -0
- package/dist/workspace/trust/verify-cli.js +63 -0
- package/dist/workspace/trust/verify.js +192 -0
- package/dist/workspace/which-chant.js +141 -0
- package/dist/workspace/wip-cli.js +95 -0
- package/dist/workspace/wip-write.schema.json +504 -0
- package/dist/workspace/wip.js +631 -0
- package/dist/workspace/wip.schema.json +334 -0
- package/dist/workspace/work-cli.js +448 -0
- package/dist/workspace/work-evidence.js +122 -0
- package/dist/workspace/work-evidence.schema.json +222 -0
- package/dist/workspace/work-history.schema.json +421 -0
- package/dist/workspace/work-lease.schema.json +246 -0
- package/dist/workspace/work-size.js +77 -0
- package/dist/workspace/work.js +283 -0
- package/dist/workspace/workspace-kinds.schema.json +259 -259
- package/dist/workspace/workspace-principals.schema.json +53 -53
- package/dist/workspace/write-lock-cli.js +105 -0
- package/dist/workspace/write-lock.js +424 -0
- package/dist/workspace/write-lock.schema.json +172 -0
- package/dist/workspace/write-scope.js +484 -0
- package/dist/yaml.js +459 -0
- package/package.json +2 -2
- package/src/cli/commands/check-lexicon-plugin.ts +2 -0
- package/src/cli/commands/lint.ts +3 -0
- package/src/cli/commands/migrate.ts +2 -0
- package/src/cli/compiled-cli.e2e.test.ts +165 -0
- package/src/cli/main.ts +121 -27
- package/src/cli/mcp/workspace-tools.ts +1 -1
- package/src/codegen/pinned-upgrade.ts +2 -0
- package/src/components/discover.ts +2 -0
- package/src/components/sandbox/driver.ts +3 -1
- package/src/config-import.ts +3 -0
- package/src/discovery/fold-import.ts +23 -14
- package/src/discovery/import.ts +2 -0
- package/src/discovery/sandbox/driver.ts +3 -1
- package/src/lexicon-module.ts +3 -0
- package/src/lint/config.ts +1 -1
- package/src/lint/discover.ts +28 -8
- package/src/lint/policy-import.ts +4 -1
- package/src/lint/rule-loader.ts +2 -0
- package/src/op/discover.ts +3 -0
- package/src/ts-loader.test.ts +23 -0
- package/src/ts-loader.ts +122 -0
- package/src/workspace/chant-migrations/chud-lexicon-exit.ts +1 -1
- package/src/workspace/declaration.ts +1 -1
- package/src/workspace/kinds.ts +1 -1
- package/src/workspace/lineage-migrations.ts +2 -0
- package/src/workspace/points.ts +1 -1
- package/src/workspace/principal-classes.ts +1 -1
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Telemetry attribution (#2558, #2524 D22, ws-060).
|
|
3
|
+
*
|
|
4
|
+
* A workload's spans carry resource attributes that name the declaration and
|
|
5
|
+
* the release that produced them, so a reader (hud, behold) can join a span
|
|
6
|
+
* back to a member, a release and a node of `chant workspace graph`. They use
|
|
7
|
+
* OpenTelemetry semantic conventions where those exist and a `chant.*`
|
|
8
|
+
* namespace for the rest ({@link TELEMETRY_ATTRIBUTES}).
|
|
9
|
+
*
|
|
10
|
+
* A lexicon that declares workloads stamps them as environment variables
|
|
11
|
+
* (`OTEL_SERVICE_NAME` and `OTEL_RESOURCE_ATTRIBUTES`, which every OTel SDK
|
|
12
|
+
* reads) when it builds inside a workspace. The build resolves the facts once
|
|
13
|
+
* ({@link resolveTelemetryAttribution}) and hands them to each serializer on
|
|
14
|
+
* `SerializeContext.telemetry`, and {@link telemetryEnvironment} turns them
|
|
15
|
+
* into the variables for one workload.
|
|
16
|
+
*
|
|
17
|
+
* Level 0 is untouched: a project with no `chant.workspace.json` above it,
|
|
18
|
+
* and no `telemetry.attribution: true` in its config, resolves to nothing and
|
|
19
|
+
* its output is the same bytes as before. The workspace declaration reader is
|
|
20
|
+
* imported only once a declaration has been found (#2525 rule 5, pinned by
|
|
21
|
+
* #2526's goldens), and this module's name keeps it off the workspace-module
|
|
22
|
+
* list.
|
|
23
|
+
*/
|
|
24
|
+
import { relative, resolve, sep } from "node:path";
|
|
25
|
+
import { findWorkspaceRoot } from "./project-root.js";
|
|
26
|
+
export const TELEMETRY_ATTRIBUTES = [
|
|
27
|
+
{ key: "service.name", source: "the declaration's name", joinsTo: "the service", stampedAtBuild: true },
|
|
28
|
+
{ key: "service.version", source: "the release's artifact digest", joinsTo: "the member's release ledger", stampedAtBuild: false },
|
|
29
|
+
{ key: "deployment.environment.name", source: "the environment", joinsTo: "the ledger's environment", stampedAtBuild: true },
|
|
30
|
+
{ key: "vcs.ref.head.revision", source: "the git SHA", joinsTo: "the workspace revision (D15)", stampedAtBuild: false },
|
|
31
|
+
{ key: "chant.workspace", source: "the workspace declaration's `name`", joinsTo: "the workspace", stampedAtBuild: true },
|
|
32
|
+
{ key: "chant.member", source: "the member name", joinsTo: "the member", stampedAtBuild: true },
|
|
33
|
+
{ key: "chant.decl", source: "the declaration id", joinsTo: "the node in `chant workspace graph`", stampedAtBuild: true },
|
|
34
|
+
];
|
|
35
|
+
/** The config's opt-in or opt-out, `telemetry.attribution`. */
|
|
36
|
+
function configured(config) {
|
|
37
|
+
const telemetry = config?.telemetry;
|
|
38
|
+
if (typeof telemetry !== "object" || telemetry === null)
|
|
39
|
+
return undefined;
|
|
40
|
+
const value = telemetry.attribution;
|
|
41
|
+
return typeof value === "boolean" ? value : undefined;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* What a build at `projectDir` stamps, or `undefined` for nothing.
|
|
45
|
+
*
|
|
46
|
+
* Inside a workspace attribution is on, and `telemetry.attribution: false`
|
|
47
|
+
* turns it off. Outside one it is off, and `telemetry.attribution: true`
|
|
48
|
+
* turns it on, with the attributes that need no workspace (`chant.workspace`
|
|
49
|
+
* and `chant.member` are then absent).
|
|
50
|
+
*
|
|
51
|
+
* A declaration that can't be read stamps the workspace-free attributes only:
|
|
52
|
+
* `chant workspace check` is where a broken declaration is reported, and a
|
|
53
|
+
* build must not fail on it.
|
|
54
|
+
*/
|
|
55
|
+
export async function resolveTelemetryAttribution(projectDir, config, environment) {
|
|
56
|
+
const setting = configured(config);
|
|
57
|
+
if (setting === false)
|
|
58
|
+
return undefined;
|
|
59
|
+
const found = findWorkspaceRoot(projectDir);
|
|
60
|
+
if (!found && setting !== true)
|
|
61
|
+
return undefined;
|
|
62
|
+
const out = {};
|
|
63
|
+
if (found) {
|
|
64
|
+
// Only now does workspace code load.
|
|
65
|
+
try {
|
|
66
|
+
const { readDeclaration, resolveGroups, ownerOf } = await import("./workspace/declaration.js");
|
|
67
|
+
const { workingTree } = await import("./workspace/tree.js");
|
|
68
|
+
const tree = workingTree(found.dir);
|
|
69
|
+
const declaration = readDeclaration(tree);
|
|
70
|
+
out.workspace = declaration.name;
|
|
71
|
+
const rel = relative(found.dir, resolve(projectDir));
|
|
72
|
+
const owner = ownerOf(declaration, resolveGroups(declaration, tree), rel === "" ? "" : rel.split(sep).join("/"));
|
|
73
|
+
if (owner && "member" in owner)
|
|
74
|
+
out.member = owner.member.name;
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
// Left to `chant workspace check`.
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
if (environment)
|
|
81
|
+
out.environment = environment;
|
|
82
|
+
return out;
|
|
83
|
+
}
|
|
84
|
+
/** The environment variables that carry one workload's attributes. Keys the build can't fill are left out. */
|
|
85
|
+
export function telemetryEnvironment(attribution, workload) {
|
|
86
|
+
const pairs = [
|
|
87
|
+
["chant.workspace", attribution.workspace],
|
|
88
|
+
["chant.member", attribution.member],
|
|
89
|
+
["chant.decl", workload.decl],
|
|
90
|
+
["deployment.environment.name", attribution.environment],
|
|
91
|
+
["service.version", workload.version],
|
|
92
|
+
];
|
|
93
|
+
return {
|
|
94
|
+
OTEL_SERVICE_NAME: workload.service,
|
|
95
|
+
OTEL_RESOURCE_ATTRIBUTES: pairs
|
|
96
|
+
.filter((p) => p[1] !== undefined && p[1] !== "")
|
|
97
|
+
.map(([k, v]) => `${k}=${encodeURIComponent(v)}`)
|
|
98
|
+
.join(","),
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Add `extra` to a resource-attributes string a project already set. A key the
|
|
103
|
+
* project set keeps its value, so a team's own `chant.member` is never
|
|
104
|
+
* overwritten; a key it didn't set is appended.
|
|
105
|
+
*/
|
|
106
|
+
export function mergeResourceAttributes(existing, extra) {
|
|
107
|
+
const have = new Set(existing.split(",").map((kv) => kv.split("=")[0].trim()).filter(Boolean));
|
|
108
|
+
const added = extra.split(",").filter((kv) => kv !== "" && !have.has(kv.split("=")[0]));
|
|
109
|
+
return [existing, ...added].filter((s) => s !== "").join(",");
|
|
110
|
+
}
|
|
111
|
+
// ── Release attributes (#3061, ws-081) ─────────────────────────────
|
|
112
|
+
/**
|
|
113
|
+
* The environment variable a deploy sets to the release attributes, as a
|
|
114
|
+
* suffix for `OTEL_RESOURCE_ATTRIBUTES`. A stamped workload's generated
|
|
115
|
+
* output appends it where the platform expands variables (Compose
|
|
116
|
+
* interpolation, a Kubernetes `$(VAR)` reference), so the committed files are
|
|
117
|
+
* the same bytes whatever is released.
|
|
118
|
+
*/
|
|
119
|
+
export const RELEASE_ATTRIBUTES_VARIABLE = "CHANT_RELEASE_ATTRIBUTES";
|
|
120
|
+
/**
|
|
121
|
+
* The pod-template annotation a Kubernetes release writes the suffix to. A
|
|
122
|
+
* stamped container reads it into {@link RELEASE_ATTRIBUTES_VARIABLE} through
|
|
123
|
+
* the downward API; an absent annotation reads as empty.
|
|
124
|
+
*/
|
|
125
|
+
export const RELEASE_ATTRIBUTES_ANNOTATION = "chant.intentius.io/release-attributes";
|
|
126
|
+
/**
|
|
127
|
+
* The release attributes as a suffix for `OTEL_RESOURCE_ATTRIBUTES`: each
|
|
128
|
+
* pair preceded by a comma and percent-encoded the way
|
|
129
|
+
* {@link telemetryEnvironment} encodes, or `""` when the release knows
|
|
130
|
+
* neither. The build-time list always has `chant.decl`, so the suffix never
|
|
131
|
+
* starts the list.
|
|
132
|
+
*/
|
|
133
|
+
export function releaseAttributesSuffix(release) {
|
|
134
|
+
if (!release)
|
|
135
|
+
return "";
|
|
136
|
+
const pairs = [
|
|
137
|
+
["service.version", release.version],
|
|
138
|
+
["vcs.ref.head.revision", release.revision],
|
|
139
|
+
];
|
|
140
|
+
return pairs
|
|
141
|
+
.filter((p) => p[1] !== undefined && p[1] !== "")
|
|
142
|
+
.map(([k, v]) => `,${k}=${encodeURIComponent(v)}`)
|
|
143
|
+
.join("");
|
|
144
|
+
}
|
|
145
|
+
/** The variables a deploy step exports for a release: {@link RELEASE_ATTRIBUTES_VARIABLE}, or nothing. */
|
|
146
|
+
export function releaseEnvironment(release) {
|
|
147
|
+
const suffix = releaseAttributesSuffix(release);
|
|
148
|
+
return suffix === "" ? {} : { [RELEASE_ATTRIBUTES_VARIABLE]: suffix };
|
|
149
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { buildGraph, collectExpressions } from "../graph.js";
|
|
2
|
+
/**
|
|
3
|
+
* Shortest-hop count from `address` back through inbound edges — how many
|
|
4
|
+
* dependents-of-dependents deep the estate goes behind that node (#2323).
|
|
5
|
+
* Production has no reachability pass yet (that is the spike's sub-issue 3);
|
|
6
|
+
* this is a test-only BFS over the same `TfGraph` shape, so a fixture's depth
|
|
7
|
+
* can be asserted without waiting on that feature. Folds/outputs are not
|
|
8
|
+
* special-cased: an output pseudo-address has no inbound edges by
|
|
9
|
+
* construction (`buildGraph` never lets anything reference an output), so it
|
|
10
|
+
* is always a dead end and never inflates the count.
|
|
11
|
+
*/
|
|
12
|
+
function inboundDepthOf(graph, address) {
|
|
13
|
+
let frontier = new Set([address]);
|
|
14
|
+
const visited = new Set(frontier);
|
|
15
|
+
let depth = 0;
|
|
16
|
+
for (;;) {
|
|
17
|
+
const next = new Set();
|
|
18
|
+
for (const e of graph.edges) {
|
|
19
|
+
if (frontier.has(e.to) && !visited.has(e.from))
|
|
20
|
+
next.add(e.from);
|
|
21
|
+
}
|
|
22
|
+
if (next.size === 0)
|
|
23
|
+
return depth;
|
|
24
|
+
depth++;
|
|
25
|
+
for (const addr of next)
|
|
26
|
+
visited.add(addr);
|
|
27
|
+
frontier = next;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The longest inbound chain anywhere in the graph — the same "depth" column
|
|
32
|
+
* the spike measured (docs/design/carve-dependency-blast-radius-spike.md
|
|
33
|
+
* section 2): 1 hop is a direct dependent, 2 is a dependent of a dependent,
|
|
34
|
+
* and so on. Every shipped fixture tops out at 1; `depth-estate` is built to
|
|
35
|
+
* clear that.
|
|
36
|
+
*/
|
|
37
|
+
export function maxTransitiveInboundDepth(graph) {
|
|
38
|
+
let max = 0;
|
|
39
|
+
for (const node of graph.nodes) {
|
|
40
|
+
const depth = inboundDepthOf(graph, node.address);
|
|
41
|
+
if (depth > max)
|
|
42
|
+
max = depth;
|
|
43
|
+
}
|
|
44
|
+
return max;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Test-only stand-in for the hcl2json expression AST (`parse.ts`'s
|
|
48
|
+
* `resolveExpressionRefs`). Fixture expressions are simple `${<accessor>}`
|
|
49
|
+
* templates, so each one's accessor list is just its interpolation bodies.
|
|
50
|
+
* Production never takes this path — `parseTerraformDir` resolves every
|
|
51
|
+
* expression through `getReferencesInExpression`.
|
|
52
|
+
*/
|
|
53
|
+
export function fixtureExprRefs(tree) {
|
|
54
|
+
const refs = new Map();
|
|
55
|
+
for (const expr of collectExpressions(tree)) {
|
|
56
|
+
refs.set(expr, [...expr.matchAll(/\$\{([^}]+)\}/g)].map((m) => m[1].trim()));
|
|
57
|
+
}
|
|
58
|
+
return refs;
|
|
59
|
+
}
|
|
60
|
+
/** `buildGraph` over a hand-written fixture tree, accessors derived per {@link fixtureExprRefs}. */
|
|
61
|
+
export function buildFixtureGraph(tree) {
|
|
62
|
+
return buildGraph(tree, fixtureExprRefs(tree));
|
|
63
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adopt a Terraform-managed resource into chant source from its `.tfstate`
|
|
3
|
+
* (#1009). This is the correct adoption source for carving OUT of Terraform:
|
|
4
|
+
* a TF resource is created through the provider API, not CloudFormation, so it
|
|
5
|
+
* is not in any CFN stack — but its resolved attributes ARE in the state file.
|
|
6
|
+
*
|
|
7
|
+
* The mapping itself belongs to the carve provider that owns the Terraform type
|
|
8
|
+
* (`carve-provider.ts`, #2016) — aws maps snake_case provider attributes to
|
|
9
|
+
* CloudFormation PascalCase props over the AWS carve-out table. This module is
|
|
10
|
+
* the dispatch: it resolves the provider and hands off. A new provider adds a
|
|
11
|
+
* file under `providers/`, never an edit here.
|
|
12
|
+
*/
|
|
13
|
+
import { canCarveEmit, carveEmitTypes } from "./tier-map.js";
|
|
14
|
+
import { resolveEmitProvider } from "./carve-provider.js";
|
|
15
|
+
export { PARAMS_IMPORT } from "./emit-source.js";
|
|
16
|
+
/**
|
|
17
|
+
* Is this Terraform type adoptable from state (a provider emits it)? The same
|
|
18
|
+
* gate serves the live path, so both are the shared `canCarveEmit`.
|
|
19
|
+
*/
|
|
20
|
+
export function canAdoptFromState(tfType) {
|
|
21
|
+
return canCarveEmit(tfType);
|
|
22
|
+
}
|
|
23
|
+
/** Terraform types that can currently be adopted from state, for user-facing hints. */
|
|
24
|
+
export function supportedStateAdoptionTypes() {
|
|
25
|
+
return carveEmitTypes();
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Render chant source for a state-adopted resource, through the provider that
|
|
29
|
+
* owns its Terraform type. `params` carries the deferred outbound inputs the
|
|
30
|
+
* boundary report found (#998) and `folded` the carve set's sub-resources read
|
|
31
|
+
* from the same state file (#1637); what a provider does with them is its own
|
|
32
|
+
* business, and both are reported back on the {@link AdoptedSource}.
|
|
33
|
+
*
|
|
34
|
+
* Null means no registered provider emits this type — the caller has already
|
|
35
|
+
* refused it at the emit gate, so this is the belt-and-braces path.
|
|
36
|
+
*/
|
|
37
|
+
export function adoptFromState(resource, params = [], folded = []) {
|
|
38
|
+
const provider = resolveEmitProvider(resource.type);
|
|
39
|
+
return provider?.adopt?.(resource, params, folded) ?? null;
|
|
40
|
+
}
|
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The AWS carve-out resource table — the single source of truth for which AWS
|
|
3
|
+
* Terraform types chant can carve, and how.
|
|
4
|
+
*
|
|
5
|
+
* Both the advisor (tier map / scoring) and `carve emit --state` derive from
|
|
6
|
+
* this one list, so advise and emit cover exactly the same AWS types: advise
|
|
7
|
+
* never ranks a resource emit cannot produce, and emit never claims a type
|
|
8
|
+
* advise did not score. Adding a type here lights it up for both at once.
|
|
9
|
+
*
|
|
10
|
+
* Each entry maps the common, high-confidence Terraform attributes to their
|
|
11
|
+
* CloudFormation property names (chant AWS constructors take CFN PascalCase
|
|
12
|
+
* props). Attributes without a mapping here are preserved in a reference
|
|
13
|
+
* comment on emit, never dropped — a curated seed, not a full TF↔CFN transform.
|
|
14
|
+
*/
|
|
15
|
+
export const AWS_LEXICON_IMPORT = "@intentius/chant-lexicon-aws";
|
|
16
|
+
/** Parse a Terraform JSON-string attribute (IAM policy docs) into an object. */
|
|
17
|
+
const asJson = (v) => {
|
|
18
|
+
if (typeof v !== "string")
|
|
19
|
+
return v;
|
|
20
|
+
try {
|
|
21
|
+
return JSON.parse(v);
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
return v;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const json = (prop) => ({ prop, transform: asJson });
|
|
28
|
+
/**
|
|
29
|
+
* Terraform state renders a nested block as a one-element list. Take that
|
|
30
|
+
* entry (or the object itself, if the provider wrote it unwrapped).
|
|
31
|
+
*/
|
|
32
|
+
function firstBlock(value) {
|
|
33
|
+
const candidate = Array.isArray(value) ? value[0] : value;
|
|
34
|
+
return candidate && typeof candidate === "object" ? candidate : undefined;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A list of TF server-side-encryption `rule` blocks → the CFN `BucketEncryption`
|
|
38
|
+
* property. Shared by the bucket's own (deprecated, still state-resident)
|
|
39
|
+
* `server_side_encryption_configuration` block and by the modern
|
|
40
|
+
* `aws_s3_bucket_server_side_encryption_configuration` sub-resource, whose
|
|
41
|
+
* `rule` list has the same shape.
|
|
42
|
+
*/
|
|
43
|
+
function sseRulesToCfn(rules) {
|
|
44
|
+
if (!Array.isArray(rules))
|
|
45
|
+
return undefined;
|
|
46
|
+
const cfnRules = [];
|
|
47
|
+
for (const raw of rules) {
|
|
48
|
+
if (!raw || typeof raw !== "object")
|
|
49
|
+
continue;
|
|
50
|
+
const rule = raw;
|
|
51
|
+
const out = {};
|
|
52
|
+
const byDefault = firstBlock(rule.apply_server_side_encryption_by_default);
|
|
53
|
+
const algorithm = byDefault?.sse_algorithm;
|
|
54
|
+
if (typeof algorithm === "string" && algorithm) {
|
|
55
|
+
const sse = { SSEAlgorithm: algorithm };
|
|
56
|
+
const kmsKey = byDefault?.kms_master_key_id;
|
|
57
|
+
if (typeof kmsKey === "string" && kmsKey)
|
|
58
|
+
sse.KMSMasterKeyID = kmsKey;
|
|
59
|
+
out.ServerSideEncryptionByDefault = sse;
|
|
60
|
+
}
|
|
61
|
+
if (typeof rule.bucket_key_enabled === "boolean")
|
|
62
|
+
out.BucketKeyEnabled = rule.bucket_key_enabled;
|
|
63
|
+
if (Object.keys(out).length)
|
|
64
|
+
cfnRules.push(out);
|
|
65
|
+
}
|
|
66
|
+
return cfnRules.length ? { ServerSideEncryptionConfiguration: cfnRules } : undefined;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* The bucket's own deprecated `versioning` block, as state still carries it.
|
|
70
|
+
* Only an enabled bucket says anything CloudFormation needs: a bucket that
|
|
71
|
+
* never had versioning has no `VersioningConfiguration` at all, so `enabled =
|
|
72
|
+
* false` maps to nothing and the block stays in the unmapped comment.
|
|
73
|
+
*/
|
|
74
|
+
function legacyVersioningToCfn(value) {
|
|
75
|
+
const block = firstBlock(value);
|
|
76
|
+
return block?.enabled === true ? { Status: "Enabled" } : undefined;
|
|
77
|
+
}
|
|
78
|
+
export const AWS_CARVE_TYPES = [
|
|
79
|
+
// ── Storage & data ──
|
|
80
|
+
{ tfType: "aws_s3_bucket", tier: 1, nativeType: "AWS::S3::Bucket", ctor: "Bucket", identityAttr: "bucket",
|
|
81
|
+
fields: {
|
|
82
|
+
bucket: "BucketName",
|
|
83
|
+
// The provider still resolves these two into the bucket's own state, even
|
|
84
|
+
// when the config declares them through sub-resources (#1637).
|
|
85
|
+
server_side_encryption_configuration: { prop: "BucketEncryption", transform: (v) => sseRulesToCfn(firstBlock(v)?.rule) },
|
|
86
|
+
versioning: { prop: "VersioningConfiguration", transform: legacyVersioningToCfn },
|
|
87
|
+
}, tags: true },
|
|
88
|
+
{ tfType: "aws_dynamodb_table", tier: 2, nativeType: "AWS::DynamoDB::Table", ctor: "Table", identityAttr: "name",
|
|
89
|
+
fields: { name: "TableName", billing_mode: "BillingMode" }, tags: true },
|
|
90
|
+
{ tfType: "aws_efs_file_system", tier: 1, nativeType: "AWS::EFS::FileSystem", ctor: "EFSFileSystem",
|
|
91
|
+
fields: { encrypted: "Encrypted", performance_mode: "PerformanceMode", throughput_mode: "ThroughputMode" }, tags: true },
|
|
92
|
+
// ── Messaging ──
|
|
93
|
+
{ tfType: "aws_sns_topic", tier: 1, nativeType: "AWS::SNS::Topic", ctor: "Topic", identityAttr: "name",
|
|
94
|
+
fields: { name: "TopicName", display_name: "DisplayName", fifo_topic: "FifoTopic" }, tags: true },
|
|
95
|
+
{ tfType: "aws_sqs_queue", tier: 1, nativeType: "AWS::SQS::Queue", ctor: "Queue", identityAttr: "name",
|
|
96
|
+
fields: { name: "QueueName", visibility_timeout_seconds: "VisibilityTimeout", fifo_queue: "FifoQueue", delay_seconds: "DelaySeconds" }, tags: true },
|
|
97
|
+
// ── IAM ──
|
|
98
|
+
{ tfType: "aws_iam_role", tier: 2, nativeType: "AWS::IAM::Role", ctor: "Role", identityAttr: "name",
|
|
99
|
+
fields: { name: "RoleName", assume_role_policy: json("AssumeRolePolicyDocument"), managed_policy_arns: "ManagedPolicyArns", description: "Description", path: "Path" }, tags: true },
|
|
100
|
+
{ tfType: "aws_iam_policy", tier: 1, nativeType: "AWS::IAM::ManagedPolicy", ctor: "ManagedPolicy", identityAttr: "name",
|
|
101
|
+
fields: { name: "ManagedPolicyName", policy: json("PolicyDocument"), description: "Description", path: "Path" } },
|
|
102
|
+
{ tfType: "aws_iam_instance_profile", tier: 1, nativeType: "AWS::IAM::InstanceProfile", ctor: "InstanceProfile", identityAttr: "name",
|
|
103
|
+
fields: { name: "InstanceProfileName", path: "Path", role: { prop: "Roles", transform: (v) => (v === undefined ? v : [v]) } } },
|
|
104
|
+
// ── Registry, keys, secrets, config ──
|
|
105
|
+
{ tfType: "aws_ecr_repository", tier: 1, nativeType: "AWS::ECR::Repository", ctor: "ECRRepository", identityAttr: "name",
|
|
106
|
+
fields: { name: "RepositoryName", image_tag_mutability: "ImageTagMutability" }, tags: true },
|
|
107
|
+
{ tfType: "aws_kms_key", tier: 2, nativeType: "AWS::KMS::Key", ctor: "KmsKey",
|
|
108
|
+
fields: { description: "Description", enable_key_rotation: "EnableKeyRotation", deletion_window_in_days: "PendingWindowInDays", is_enabled: "Enabled" }, tags: true },
|
|
109
|
+
{ tfType: "aws_secretsmanager_secret", tier: 1, nativeType: "AWS::SecretsManager::Secret", ctor: "Secret", identityAttr: "name",
|
|
110
|
+
fields: { name: "Name", description: "Description", kms_key_id: "KmsKeyId" }, tags: true },
|
|
111
|
+
{ tfType: "aws_ssm_parameter", tier: 1, nativeType: "AWS::SSM::Parameter", ctor: "SsmParameter", identityAttr: "name",
|
|
112
|
+
fields: { name: "Name", type: "Type", value: "Value", tier: "Tier", description: "Description" } },
|
|
113
|
+
// ── Compute ──
|
|
114
|
+
{ tfType: "aws_lambda_function", tier: 2, nativeType: "AWS::Lambda::Function", ctor: "Function", identityAttr: "function_name",
|
|
115
|
+
fields: { function_name: "FunctionName", runtime: "Runtime", handler: "Handler", memory_size: "MemorySize", timeout: "Timeout", description: "Description", architectures: "Architectures" }, tags: true },
|
|
116
|
+
{ tfType: "aws_ecs_service", tier: 3, nativeType: "AWS::ECS::Service", ctor: "EcsService", identityAttr: "name",
|
|
117
|
+
fields: { name: "ServiceName", cluster: "Cluster", desired_count: "DesiredCount", launch_type: "LaunchType", task_definition: "TaskDefinition" }, tags: true },
|
|
118
|
+
// ── Networking ──
|
|
119
|
+
{ tfType: "aws_vpc", tier: 1, nativeType: "AWS::EC2::VPC", ctor: "Vpc",
|
|
120
|
+
fields: { cidr_block: "CidrBlock", enable_dns_support: "EnableDnsSupport", enable_dns_hostnames: "EnableDnsHostnames", instance_tenancy: "InstanceTenancy" }, tags: true },
|
|
121
|
+
{ tfType: "aws_subnet", tier: 1, nativeType: "AWS::EC2::Subnet", ctor: "Subnet",
|
|
122
|
+
fields: { vpc_id: "VpcId", cidr_block: "CidrBlock", availability_zone: "AvailabilityZone", map_public_ip_on_launch: "MapPublicIpOnLaunch" }, tags: true },
|
|
123
|
+
{ tfType: "aws_security_group", tier: 2, nativeType: "AWS::EC2::SecurityGroup", ctor: "SecurityGroup", identityAttr: "name",
|
|
124
|
+
fields: { description: "GroupDescription", name: "GroupName", vpc_id: "VpcId" }, tags: true },
|
|
125
|
+
{ tfType: "aws_route_table", tier: 2, nativeType: "AWS::EC2::RouteTable", ctor: "RouteTable",
|
|
126
|
+
fields: { vpc_id: "VpcId" }, tags: true },
|
|
127
|
+
{ tfType: "aws_internet_gateway", tier: 1, nativeType: "AWS::EC2::InternetGateway", ctor: "InternetGateway",
|
|
128
|
+
fields: {}, tags: true },
|
|
129
|
+
{ tfType: "aws_eip", tier: 1, nativeType: "AWS::EC2::EIP", ctor: "EIP",
|
|
130
|
+
fields: { domain: "Domain", instance: "InstanceId" }, tags: true },
|
|
131
|
+
{ tfType: "aws_nat_gateway", tier: 2, nativeType: "AWS::EC2::NatGateway", ctor: "NatGateway",
|
|
132
|
+
fields: { subnet_id: "SubnetId", allocation_id: "AllocationId", connectivity_type: "ConnectivityType" }, tags: true },
|
|
133
|
+
// ── DNS & observability ──
|
|
134
|
+
{ tfType: "aws_route53_zone", tier: 1, nativeType: "AWS::Route53::HostedZone", ctor: "HostedZone", identityAttr: "name",
|
|
135
|
+
fields: { name: "Name", comment: "HostedZoneConfig" } },
|
|
136
|
+
{ tfType: "aws_cloudwatch_log_group", tier: 1, nativeType: "AWS::Logs::LogGroup", ctor: "LogGroup", identityAttr: "name",
|
|
137
|
+
fields: { name: "LogGroupName", retention_in_days: "RetentionInDays", kms_key_id: "KmsKeyId" }, tags: true },
|
|
138
|
+
{ tfType: "aws_cloudwatch_metric_alarm", tier: 2, nativeType: "AWS::CloudWatch::Alarm", ctor: "Alarm", identityAttr: "alarm_name",
|
|
139
|
+
fields: { alarm_name: "AlarmName", comparison_operator: "ComparisonOperator", metric_name: "MetricName", namespace: "Namespace", threshold: "Threshold", evaluation_periods: "EvaluationPeriods", period: "Period", statistic: "Statistic", alarm_description: "AlarmDescription" }, tags: true },
|
|
140
|
+
{ tfType: "aws_cloudwatch_event_rule", tier: 2, nativeType: "AWS::Events::Rule", ctor: "EventRule", identityAttr: "name",
|
|
141
|
+
fields: { name: "Name", schedule_expression: "ScheduleExpression", event_pattern: json("EventPattern"), description: "Description", state: "State" } },
|
|
142
|
+
// ── Compute (EC2 / ECS / ASG) ──
|
|
143
|
+
{ tfType: "aws_instance", tier: 2, nativeType: "AWS::EC2::Instance", ctor: "Instance",
|
|
144
|
+
fields: { ami: "ImageId", instance_type: "InstanceType", subnet_id: "SubnetId", key_name: "KeyName", availability_zone: "AvailabilityZone", iam_instance_profile: "IamInstanceProfile" }, tags: true },
|
|
145
|
+
{ tfType: "aws_launch_template", tier: 2, nativeType: "AWS::EC2::LaunchTemplate", ctor: "LaunchTemplate", identityAttr: "name",
|
|
146
|
+
fields: { name: "LaunchTemplateName" }, tags: true },
|
|
147
|
+
{ tfType: "aws_autoscaling_group", tier: 2, nativeType: "AWS::AutoScaling::AutoScalingGroup", ctor: "AutoScalingGroup", identityAttr: "name",
|
|
148
|
+
fields: { name: "AutoScalingGroupName", min_size: "MinSize", max_size: "MaxSize", desired_capacity: "DesiredCapacity", vpc_zone_identifier: "VPCZoneIdentifier", health_check_type: "HealthCheckType" } },
|
|
149
|
+
{ tfType: "aws_ecs_cluster", tier: 1, nativeType: "AWS::ECS::Cluster", ctor: "EcsCluster", identityAttr: "name",
|
|
150
|
+
fields: { name: "ClusterName" }, tags: true },
|
|
151
|
+
{ tfType: "aws_ecs_task_definition", tier: 3, nativeType: "AWS::ECS::TaskDefinition", ctor: "TaskDefinition", identityAttr: "family",
|
|
152
|
+
fields: { family: "Family", cpu: "Cpu", memory: "Memory", network_mode: "NetworkMode", execution_role_arn: "ExecutionRoleArn", task_role_arn: "TaskRoleArn" }, tags: true },
|
|
153
|
+
{ tfType: "aws_ebs_volume", tier: 1, nativeType: "AWS::EC2::Volume", ctor: "EC2Volume",
|
|
154
|
+
fields: { availability_zone: "AvailabilityZone", size: "Size", type: "VolumeType", encrypted: "Encrypted", iops: "Iops" }, tags: true },
|
|
155
|
+
// ── Load balancing (ELBv2; aws_alb is a legacy alias) ──
|
|
156
|
+
{ tfType: "aws_lb", tier: 2, nativeType: "AWS::ElasticLoadBalancingV2::LoadBalancer", ctor: "LoadBalancer", identityAttr: "name",
|
|
157
|
+
fields: { name: "Name", load_balancer_type: "Type", internal: { prop: "Scheme", transform: (v) => (v === true ? "internal" : v === false ? "internet-facing" : v) } }, tags: true },
|
|
158
|
+
{ tfType: "aws_alb", tier: 2, nativeType: "AWS::ElasticLoadBalancingV2::LoadBalancer", ctor: "LoadBalancer", identityAttr: "name",
|
|
159
|
+
fields: { name: "Name", load_balancer_type: "Type", internal: { prop: "Scheme", transform: (v) => (v === true ? "internal" : v === false ? "internet-facing" : v) } }, tags: true },
|
|
160
|
+
{ tfType: "aws_lb_target_group", tier: 2, nativeType: "AWS::ElasticLoadBalancingV2::TargetGroup", ctor: "TargetGroup", identityAttr: "name",
|
|
161
|
+
fields: { name: "Name", port: "Port", protocol: "Protocol", vpc_id: "VpcId", target_type: "TargetType" }, tags: true },
|
|
162
|
+
{ tfType: "aws_lb_listener", tier: 2, nativeType: "AWS::ElasticLoadBalancingV2::Listener", ctor: "Listener",
|
|
163
|
+
fields: { port: "Port", protocol: "Protocol", load_balancer_arn: "LoadBalancerArn" } },
|
|
164
|
+
// ── Databases & cache ──
|
|
165
|
+
{ tfType: "aws_db_instance", tier: 2, nativeType: "AWS::RDS::DBInstance", ctor: "DbInstance", identityAttr: "identifier",
|
|
166
|
+
fields: { identifier: "DBInstanceIdentifier", engine: "Engine", engine_version: "EngineVersion", instance_class: "DBInstanceClass", allocated_storage: "AllocatedStorage", db_name: "DBName", multi_az: "MultiAZ", storage_encrypted: "StorageEncrypted" }, tags: true },
|
|
167
|
+
{ tfType: "aws_db_subnet_group", tier: 1, nativeType: "AWS::RDS::DBSubnetGroup", ctor: "RDSDBSubnetGroup", identityAttr: "name",
|
|
168
|
+
fields: { name: "DBSubnetGroupName", description: "DBSubnetGroupDescription", subnet_ids: "SubnetIds" }, tags: true },
|
|
169
|
+
{ tfType: "aws_elasticache_cluster", tier: 2, nativeType: "AWS::ElastiCache::CacheCluster", ctor: "CacheCluster", identityAttr: "cluster_id",
|
|
170
|
+
fields: { cluster_id: "ClusterName", engine: "Engine", node_type: "CacheNodeType", num_cache_nodes: "NumCacheNodes", engine_version: "EngineVersion" }, tags: true },
|
|
171
|
+
{ tfType: "aws_elasticache_replication_group", tier: 2, nativeType: "AWS::ElastiCache::ReplicationGroup", ctor: "ReplicationGroup", identityAttr: "replication_group_id",
|
|
172
|
+
fields: { replication_group_id: "ReplicationGroupId", description: "ReplicationGroupDescription", node_type: "CacheNodeType", engine: "Engine" }, tags: true },
|
|
173
|
+
// ── DNS, CDN & API ──
|
|
174
|
+
{ tfType: "aws_route53_record", tier: 2, nativeType: "AWS::Route53::RecordSet", ctor: "RecordSet", identityAttr: "name",
|
|
175
|
+
fields: { name: "Name", type: "Type", ttl: "TTL", zone_id: "HostedZoneId", records: "ResourceRecords" } },
|
|
176
|
+
{ tfType: "aws_api_gateway_rest_api", tier: 2, nativeType: "AWS::ApiGateway::RestApi", ctor: "RestApi", identityAttr: "name",
|
|
177
|
+
fields: { name: "Name", description: "Description" }, tags: true },
|
|
178
|
+
{ tfType: "aws_apigatewayv2_api", tier: 2, nativeType: "AWS::ApiGatewayV2::Api", ctor: "HttpApi", identityAttr: "name",
|
|
179
|
+
fields: { name: "Name", protocol_type: "ProtocolType", description: "Description" }, tags: true },
|
|
180
|
+
// ── IAM (users/groups), certs & keys ──
|
|
181
|
+
{ tfType: "aws_iam_user", tier: 1, nativeType: "AWS::IAM::User", ctor: "IAMUser", identityAttr: "name",
|
|
182
|
+
fields: { name: "UserName", path: "Path" }, tags: true },
|
|
183
|
+
{ tfType: "aws_iam_group", tier: 1, nativeType: "AWS::IAM::Group", ctor: "IAMGroup", identityAttr: "name",
|
|
184
|
+
fields: { name: "GroupName", path: "Path" } },
|
|
185
|
+
{ tfType: "aws_acm_certificate", tier: 2, nativeType: "AWS::CertificateManager::Certificate", ctor: "AcmCertificate", identityAttr: "domain_name",
|
|
186
|
+
fields: { domain_name: "DomainName", validation_method: "ValidationMethod", subject_alternative_names: "SubjectAlternativeNames" }, tags: true },
|
|
187
|
+
{ tfType: "aws_kms_alias", tier: 1, nativeType: "AWS::KMS::Alias", ctor: "KMSAlias", identityAttr: "name",
|
|
188
|
+
fields: { name: "AliasName", target_key_id: "TargetKeyId" } },
|
|
189
|
+
// ── Messaging & step functions ──
|
|
190
|
+
{ tfType: "aws_sns_topic_subscription", tier: 2, nativeType: "AWS::SNS::Subscription", ctor: "Subscription",
|
|
191
|
+
fields: { protocol: "Protocol", endpoint: "Endpoint", topic_arn: "TopicArn" } },
|
|
192
|
+
{ tfType: "aws_sfn_state_machine", tier: 3, nativeType: "AWS::StepFunctions::StateMachine", ctor: "StateMachine", identityAttr: "name",
|
|
193
|
+
fields: { name: "StateMachineName", role_arn: "RoleArn", type: "StateMachineType" }, tags: true },
|
|
194
|
+
{ tfType: "aws_sqs_queue_policy", tier: 2, nativeType: "AWS::SQS::QueuePolicy", ctor: "QueuePolicy",
|
|
195
|
+
fields: { policy: json("PolicyDocument"), queue_url: { prop: "Queues", transform: (v) => (v === undefined ? v : [v]) } } },
|
|
196
|
+
{ tfType: "aws_sns_topic_policy", tier: 2, nativeType: "AWS::SNS::TopicPolicy", ctor: "TopicPolicy",
|
|
197
|
+
fields: { policy: json("PolicyDocument"), arn: { prop: "Topics", transform: (v) => (v === undefined ? v : [v]) } } },
|
|
198
|
+
// ── Streaming ──
|
|
199
|
+
{ tfType: "aws_kinesis_stream", tier: 1, nativeType: "AWS::Kinesis::Stream", ctor: "KinesisStream", identityAttr: "name",
|
|
200
|
+
fields: { name: "Name", shard_count: "ShardCount", retention_period: "RetentionPeriodHours" }, tags: true },
|
|
201
|
+
{ tfType: "aws_kinesis_firehose_delivery_stream", tier: 3, nativeType: "AWS::KinesisFirehose::DeliveryStream", ctor: "DeliveryStream", identityAttr: "name",
|
|
202
|
+
fields: { name: "DeliveryStreamName" }, tags: true },
|
|
203
|
+
// ── EKS ──
|
|
204
|
+
{ tfType: "aws_eks_cluster", tier: 2, nativeType: "AWS::EKS::Cluster", ctor: "EKSCluster", identityAttr: "name",
|
|
205
|
+
fields: { name: "Name", role_arn: "RoleArn", version: "Version" }, tags: true },
|
|
206
|
+
{ tfType: "aws_eks_node_group", tier: 2, nativeType: "AWS::EKS::Nodegroup", ctor: "Nodegroup", identityAttr: "node_group_name",
|
|
207
|
+
fields: { cluster_name: "ClusterName", node_group_name: "NodegroupName", node_role_arn: "NodeRole", subnet_ids: "Subnets",
|
|
208
|
+
instance_types: "InstanceTypes", ami_type: "AmiType", capacity_type: "CapacityType", disk_size: "DiskSize" } },
|
|
209
|
+
// ── Lambda periphery ──
|
|
210
|
+
{ tfType: "aws_lambda_permission", tier: 1, nativeType: "AWS::Lambda::Permission", ctor: "Permission",
|
|
211
|
+
fields: { action: "Action", function_name: "FunctionName", principal: "Principal", source_arn: "SourceArn", source_account: "SourceAccount" } },
|
|
212
|
+
{ tfType: "aws_lambda_event_source_mapping", tier: 2, nativeType: "AWS::Lambda::EventSourceMapping", ctor: "EventSourceMapping",
|
|
213
|
+
fields: { event_source_arn: "EventSourceArn", function_name: "FunctionName", batch_size: "BatchSize", enabled: "Enabled",
|
|
214
|
+
starting_position: "StartingPosition", maximum_batching_window_in_seconds: "MaximumBatchingWindowInSeconds" } },
|
|
215
|
+
{ tfType: "aws_lambda_alias", tier: 1, nativeType: "AWS::Lambda::Alias", ctor: "LambdaAlias", identityAttr: "name",
|
|
216
|
+
fields: { name: "Name", function_name: "FunctionName", function_version: "FunctionVersion", description: "Description" } },
|
|
217
|
+
{ tfType: "aws_lambda_layer_version", tier: 2, nativeType: "AWS::Lambda::LayerVersion", ctor: "LayerVersion", identityAttr: "layer_name",
|
|
218
|
+
fields: { layer_name: "LayerName", description: "Description", compatible_runtimes: "CompatibleRuntimes",
|
|
219
|
+
compatible_architectures: "CompatibleArchitectures", license_info: "LicenseInfo" } },
|
|
220
|
+
// ── Networking (endpoints, routes, peering, flow logs) ──
|
|
221
|
+
{ tfType: "aws_vpc_endpoint", tier: 2, nativeType: "AWS::EC2::VPCEndpoint", ctor: "VPCEndpoint",
|
|
222
|
+
fields: { vpc_id: "VpcId", service_name: "ServiceName", vpc_endpoint_type: "VpcEndpointType", route_table_ids: "RouteTableIds",
|
|
223
|
+
subnet_ids: "SubnetIds", security_group_ids: "SecurityGroupIds", private_dns_enabled: "PrivateDnsEnabled", policy: json("PolicyDocument") }, tags: true },
|
|
224
|
+
{ tfType: "aws_route_table_association", tier: 2, nativeType: "AWS::EC2::SubnetRouteTableAssociation", ctor: "SubnetRouteTableAssociation",
|
|
225
|
+
fields: { subnet_id: "SubnetId", route_table_id: "RouteTableId" } },
|
|
226
|
+
{ tfType: "aws_route", tier: 2, nativeType: "AWS::EC2::Route", ctor: "EC2Route",
|
|
227
|
+
fields: { route_table_id: "RouteTableId", destination_cidr_block: "DestinationCidrBlock", destination_ipv6_cidr_block: "DestinationIpv6CidrBlock",
|
|
228
|
+
gateway_id: "GatewayId", nat_gateway_id: "NatGatewayId", transit_gateway_id: "TransitGatewayId",
|
|
229
|
+
vpc_peering_connection_id: "VpcPeeringConnectionId", network_interface_id: "NetworkInterfaceId" } },
|
|
230
|
+
{ tfType: "aws_egress_only_internet_gateway", tier: 1, nativeType: "AWS::EC2::EgressOnlyInternetGateway", ctor: "EgressOnlyInternetGateway",
|
|
231
|
+
fields: { vpc_id: "VpcId" } },
|
|
232
|
+
{ tfType: "aws_vpc_peering_connection", tier: 2, nativeType: "AWS::EC2::VPCPeeringConnection", ctor: "VPCPeeringConnection",
|
|
233
|
+
fields: { vpc_id: "VpcId", peer_vpc_id: "PeerVpcId", peer_owner_id: "PeerOwnerId", peer_region: "PeerRegion" }, tags: true },
|
|
234
|
+
{ tfType: "aws_flow_log", tier: 2, nativeType: "AWS::EC2::FlowLog", ctor: "FlowLog",
|
|
235
|
+
fields: { traffic_type: "TrafficType", log_destination: "LogDestination", log_destination_type: "LogDestinationType",
|
|
236
|
+
iam_role_arn: "DeliverLogsPermissionArn", log_group_name: "LogGroupName", max_aggregation_interval: "MaxAggregationInterval" }, tags: true },
|
|
237
|
+
{ tfType: "aws_key_pair", tier: 1, nativeType: "AWS::EC2::KeyPair", ctor: "KeyPair", identityAttr: "key_name",
|
|
238
|
+
fields: { key_name: "KeyName", public_key: "PublicKeyMaterial" }, tags: true },
|
|
239
|
+
// ── Audit & observability ──
|
|
240
|
+
{ tfType: "aws_cloudtrail", tier: 2, nativeType: "AWS::CloudTrail::Trail", ctor: "Trail", identityAttr: "name",
|
|
241
|
+
fields: { name: "TrailName", s3_bucket_name: "S3BucketName", s3_key_prefix: "S3KeyPrefix",
|
|
242
|
+
include_global_service_events: "IncludeGlobalServiceEvents", is_multi_region_trail: "IsMultiRegionTrail",
|
|
243
|
+
enable_logging: "IsLogging", enable_log_file_validation: "EnableLogFileValidation", kms_key_id: "KMSKeyId",
|
|
244
|
+
sns_topic_name: "SnsTopicName", cloud_watch_logs_group_arn: "CloudWatchLogsLogGroupArn", cloud_watch_logs_role_arn: "CloudWatchLogsRoleArn" }, tags: true },
|
|
245
|
+
{ tfType: "aws_cloudwatch_dashboard", tier: 1, nativeType: "AWS::CloudWatch::Dashboard", ctor: "CwDashboard", identityAttr: "dashboard_name",
|
|
246
|
+
fields: { dashboard_name: "DashboardName", dashboard_body: "DashboardBody" } },
|
|
247
|
+
// ── Databases & cache (groups, clusters) ──
|
|
248
|
+
{ tfType: "aws_elasticache_subnet_group", tier: 1, nativeType: "AWS::ElastiCache::SubnetGroup", ctor: "EcSubnetGroup", identityAttr: "name",
|
|
249
|
+
fields: { name: "CacheSubnetGroupName", description: "Description", subnet_ids: "SubnetIds" }, tags: true },
|
|
250
|
+
{ tfType: "aws_db_parameter_group", tier: 2, nativeType: "AWS::RDS::DBParameterGroup", ctor: "RDSDBParameterGroup", identityAttr: "name",
|
|
251
|
+
fields: { name: "DBParameterGroupName", family: "Family", description: "Description" }, tags: true },
|
|
252
|
+
{ tfType: "aws_rds_cluster", tier: 2, nativeType: "AWS::RDS::DBCluster", ctor: "DbCluster", identityAttr: "cluster_identifier",
|
|
253
|
+
fields: { cluster_identifier: "DBClusterIdentifier", engine: "Engine", engine_version: "EngineVersion", database_name: "DatabaseName",
|
|
254
|
+
master_username: "MasterUsername", backup_retention_period: "BackupRetentionPeriod", preferred_backup_window: "PreferredBackupWindow",
|
|
255
|
+
storage_encrypted: "StorageEncrypted", kms_key_id: "KmsKeyId", port: "Port" }, tags: true },
|
|
256
|
+
// ── Load balancing & API stages ──
|
|
257
|
+
{ tfType: "aws_lb_listener_rule", tier: 3, nativeType: "AWS::ElasticLoadBalancingV2::ListenerRule", ctor: "ListenerRule",
|
|
258
|
+
fields: { listener_arn: "ListenerArn", priority: "Priority" } },
|
|
259
|
+
{ tfType: "aws_api_gateway_stage", tier: 2, nativeType: "AWS::ApiGateway::Stage", ctor: "ApigwStage", identityAttr: "stage_name",
|
|
260
|
+
fields: { rest_api_id: "RestApiId", stage_name: "StageName", deployment_id: "DeploymentId", description: "Description" }, tags: true },
|
|
261
|
+
{ tfType: "aws_api_gateway_deployment", tier: 2, nativeType: "AWS::ApiGateway::Deployment", ctor: "ApigwDeployment",
|
|
262
|
+
fields: { rest_api_id: "RestApiId", description: "Description" } },
|
|
263
|
+
{ tfType: "aws_apigatewayv2_stage", tier: 2, nativeType: "AWS::ApiGatewayV2::Stage", ctor: "Apigwv2Stage", identityAttr: "name",
|
|
264
|
+
fields: { api_id: "ApiId", name: "StageName", auto_deploy: "AutoDeploy", description: "Description" } },
|
|
265
|
+
// ── Identity & scaling ──
|
|
266
|
+
{ tfType: "aws_cognito_user_pool", tier: 3, nativeType: "AWS::Cognito::UserPool", ctor: "UserPool", identityAttr: "name",
|
|
267
|
+
fields: { name: "UserPoolName", mfa_configuration: "MfaConfiguration", deletion_protection: "DeletionProtection" } },
|
|
268
|
+
{ tfType: "aws_appautoscaling_target", tier: 2, nativeType: "AWS::ApplicationAutoScaling::ScalableTarget", ctor: "ScalableTarget",
|
|
269
|
+
fields: { max_capacity: "MaxCapacity", min_capacity: "MinCapacity", resource_id: "ResourceId",
|
|
270
|
+
scalable_dimension: "ScalableDimension", service_namespace: "ServiceNamespace", role_arn: "RoleARN" } },
|
|
271
|
+
// ── EFS periphery ──
|
|
272
|
+
{ tfType: "aws_efs_mount_target", tier: 1, nativeType: "AWS::EFS::MountTarget", ctor: "EFSMountTarget",
|
|
273
|
+
fields: { file_system_id: "FileSystemId", subnet_id: "SubnetId", ip_address: "IpAddress", security_groups: "SecurityGroups" } },
|
|
274
|
+
{ tfType: "aws_efs_access_point", tier: 2, nativeType: "AWS::EFS::AccessPoint", ctor: "EFSAccessPoint",
|
|
275
|
+
fields: { file_system_id: "FileSystemId" } },
|
|
276
|
+
];
|
|
277
|
+
const BY_TYPE = new Map(AWS_CARVE_TYPES.map((t) => [t.tfType, t]));
|
|
278
|
+
export function awsCarveType(tfType) {
|
|
279
|
+
return BY_TYPE.get(tfType);
|
|
280
|
+
}
|
|
281
|
+
/** Identity and parent-link attributes: never content, never reported unmapped. */
|
|
282
|
+
const FOLD_LINK_ATTRS = new Set(["id", "arn", "bucket"]);
|
|
283
|
+
export const AWS_FOLD_MAPPERS = {
|
|
284
|
+
aws_s3_bucket_versioning: {
|
|
285
|
+
consumes: ["versioning_configuration"],
|
|
286
|
+
map: (attrs) => {
|
|
287
|
+
const status = firstBlock(attrs.versioning_configuration)?.status;
|
|
288
|
+
// CFN takes Enabled/Suspended only; TF's third state ("Disabled", write-once
|
|
289
|
+
// buckets) has no CloudFormation spelling and stays in the comment.
|
|
290
|
+
return status === "Enabled" || status === "Suspended" ? { VersioningConfiguration: { Status: status } } : {};
|
|
291
|
+
},
|
|
292
|
+
},
|
|
293
|
+
aws_s3_bucket_public_access_block: {
|
|
294
|
+
consumes: ["block_public_acls", "block_public_policy", "ignore_public_acls", "restrict_public_buckets"],
|
|
295
|
+
map: (attrs) => {
|
|
296
|
+
const config = {};
|
|
297
|
+
const flags = [
|
|
298
|
+
["block_public_acls", "BlockPublicAcls"],
|
|
299
|
+
["block_public_policy", "BlockPublicPolicy"],
|
|
300
|
+
["ignore_public_acls", "IgnorePublicAcls"],
|
|
301
|
+
["restrict_public_buckets", "RestrictPublicBuckets"],
|
|
302
|
+
];
|
|
303
|
+
for (const [tfAttr, prop] of flags) {
|
|
304
|
+
if (typeof attrs[tfAttr] === "boolean")
|
|
305
|
+
config[prop] = attrs[tfAttr];
|
|
306
|
+
}
|
|
307
|
+
return Object.keys(config).length ? { PublicAccessBlockConfiguration: config } : {};
|
|
308
|
+
},
|
|
309
|
+
},
|
|
310
|
+
aws_s3_bucket_server_side_encryption_configuration: {
|
|
311
|
+
consumes: ["rule"],
|
|
312
|
+
map: (attrs) => {
|
|
313
|
+
const encryption = sseRulesToCfn(attrs.rule);
|
|
314
|
+
return encryption ? { BucketEncryption: encryption } : {};
|
|
315
|
+
},
|
|
316
|
+
},
|
|
317
|
+
};
|
|
318
|
+
/**
|
|
319
|
+
* Apply a folded sub-resource's state attributes to its parent's properties.
|
|
320
|
+
*
|
|
321
|
+
* Returns the props it contributes plus the attributes that stay genuinely
|
|
322
|
+
* unmappable (which the emitted source preserves in its reference comment). A
|
|
323
|
+
* mapper that produced nothing consumes nothing — the caller reports the whole
|
|
324
|
+
* sub-resource rather than claiming a fold that did not happen. `null` means
|
|
325
|
+
* this sub-resource type has no fold mapping at all.
|
|
326
|
+
*/
|
|
327
|
+
export function applyAwsFold(tfType, attrs) {
|
|
328
|
+
const mapper = AWS_FOLD_MAPPERS[tfType];
|
|
329
|
+
if (!mapper)
|
|
330
|
+
return null;
|
|
331
|
+
const props = mapper.map(attrs);
|
|
332
|
+
const consumed = new Set(Object.keys(props).length ? mapper.consumes : []);
|
|
333
|
+
return { props, unmapped: unmappedFoldAttrs(attrs, consumed) };
|
|
334
|
+
}
|
|
335
|
+
/** A folded sub-resource's attributes minus what was consumed and its parent link. */
|
|
336
|
+
export function unmappedFoldAttrs(attrs, consumed = new Set()) {
|
|
337
|
+
const rest = {};
|
|
338
|
+
for (const [key, value] of Object.entries(attrs)) {
|
|
339
|
+
if (consumed.has(key) || FOLD_LINK_ATTRS.has(key))
|
|
340
|
+
continue;
|
|
341
|
+
rest[key] = value;
|
|
342
|
+
}
|
|
343
|
+
return rest;
|
|
344
|
+
}
|
|
345
|
+
/** TF `tags` map → CloudFormation `Tags` list of {Key, Value}. */
|
|
346
|
+
function tagsToCfn(tags) {
|
|
347
|
+
if (!tags || typeof tags !== "object" || Array.isArray(tags))
|
|
348
|
+
return undefined;
|
|
349
|
+
const entries = Object.entries(tags);
|
|
350
|
+
return entries.length ? entries.map(([Key, Value]) => ({ Key, Value })) : undefined;
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Apply an entry's field mappings to a resource's Terraform attributes, yielding
|
|
354
|
+
* CloudFormation properties and the set of attribute keys that were consumed
|
|
355
|
+
* (so the caller can report the rest as unmapped).
|
|
356
|
+
*/
|
|
357
|
+
export function applyAwsMapper(entry, attrs) {
|
|
358
|
+
const props = {};
|
|
359
|
+
const mappedKeys = ["id", "arn"]; // identity/computed attrs, ignored not dropped
|
|
360
|
+
for (const [tfAttr, spec] of Object.entries(entry.fields)) {
|
|
361
|
+
const value = attrs[tfAttr];
|
|
362
|
+
if (value === undefined)
|
|
363
|
+
continue;
|
|
364
|
+
if (typeof spec === "string") {
|
|
365
|
+
props[spec] = value;
|
|
366
|
+
}
|
|
367
|
+
else {
|
|
368
|
+
// A transform that declines (undefined) has mapped nothing — the attribute
|
|
369
|
+
// stays in the unmapped report rather than being claimed and dropped.
|
|
370
|
+
const t = spec.transform(value);
|
|
371
|
+
if (t === undefined)
|
|
372
|
+
continue;
|
|
373
|
+
props[spec.prop] = t;
|
|
374
|
+
}
|
|
375
|
+
mappedKeys.push(tfAttr);
|
|
376
|
+
}
|
|
377
|
+
if (entry.tags) {
|
|
378
|
+
const tags = tagsToCfn(attrs.tags);
|
|
379
|
+
if (tags)
|
|
380
|
+
props.Tags = tags;
|
|
381
|
+
mappedKeys.push("tags");
|
|
382
|
+
}
|
|
383
|
+
return { props, mappedKeys };
|
|
384
|
+
}
|