@intentius/chant 0.46.0 → 0.50.0
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/catalog.d.ts +13 -3
- package/dist/audit/catalog.d.ts.map +1 -1
- package/dist/audit/core.d.ts +30 -3
- package/dist/audit/core.d.ts.map +1 -1
- package/dist/audit/discover.d.ts +9 -2
- package/dist/audit/discover.d.ts.map +1 -1
- package/dist/audit/fetch.d.ts.map +1 -1
- package/dist/audit/report-html.d.ts.map +1 -1
- package/dist/audit/report-model.d.ts +6 -0
- package/dist/audit/report-model.d.ts.map +1 -1
- package/dist/audit/report.d.ts.map +1 -1
- package/dist/audit/rules-doc.d.ts.map +1 -1
- package/dist/audit/secrets.d.ts +95 -0
- package/dist/audit/secrets.d.ts.map +1 -0
- package/dist/audit/wrangler.d.ts +33 -0
- package/dist/audit/wrangler.d.ts.map +1 -0
- package/dist/build.d.ts +3 -3
- package/dist/build.d.ts.map +1 -1
- package/dist/cli/commands/audit.d.ts +7 -0
- package/dist/cli/commands/audit.d.ts.map +1 -1
- package/dist/cli/commands/build.d.ts +23 -0
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/lint.d.ts.map +1 -1
- package/dist/cli/handlers/build.d.ts.map +1 -1
- package/dist/cli/handlers/components.d.ts +31 -0
- package/dist/cli/handlers/components.d.ts.map +1 -1
- package/dist/cli/handlers/lifecycle.d.ts +12 -1
- package/dist/cli/handlers/lifecycle.d.ts.map +1 -1
- package/dist/cli/handlers/operator.d.ts +32 -0
- package/dist/cli/handlers/operator.d.ts.map +1 -0
- package/dist/cli/handlers/scenario.d.ts +39 -0
- package/dist/cli/handlers/scenario.d.ts.map +1 -0
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/mcp/resource-handlers.d.ts.map +1 -1
- package/dist/cli/mcp/server.d.ts +35 -2
- package/dist/cli/mcp/server.d.ts.map +1 -1
- package/dist/cli/mcp/tools/explain.d.ts +6 -0
- package/dist/cli/mcp/tools/explain.d.ts.map +1 -1
- package/dist/cli/mcp/types.d.ts +29 -1
- package/dist/cli/mcp/types.d.ts.map +1 -1
- package/dist/cli/plugins.d.ts +1 -1
- package/dist/cli/plugins.d.ts.map +1 -1
- package/dist/cli/registry.d.ts +14 -2
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/cli/reporters/stylish.d.ts +15 -1
- package/dist/cli/reporters/stylish.d.ts.map +1 -1
- package/dist/codegen/docs-rule-scanning.d.ts.map +1 -1
- package/dist/components/auto-release.d.ts +4 -0
- package/dist/components/auto-release.d.ts.map +1 -1
- package/dist/components/capability.d.ts +17 -2
- package/dist/components/capability.d.ts.map +1 -1
- package/dist/components/cli-support.d.ts +7 -0
- package/dist/components/cli-support.d.ts.map +1 -1
- package/dist/components/component.d.ts +15 -0
- package/dist/components/component.d.ts.map +1 -1
- package/dist/components/driver.d.ts.map +1 -1
- package/dist/components/starter-plugin.d.ts +2 -0
- package/dist/components/starter-plugin.d.ts.map +1 -1
- package/dist/components/verbs/ensure-secret.d.ts +50 -0
- package/dist/components/verbs/ensure-secret.d.ts.map +1 -0
- package/dist/components/verbs/index.d.ts +13 -0
- package/dist/components/verbs/index.d.ts.map +1 -1
- package/dist/components/verbs/r2-sync.d.ts +76 -0
- package/dist/components/verbs/r2-sync.d.ts.map +1 -0
- package/dist/components/verbs/run-agent.d.ts +499 -0
- package/dist/components/verbs/run-agent.d.ts.map +1 -0
- package/dist/components/verbs/sign.d.ts +30 -0
- package/dist/components/verbs/sign.d.ts.map +1 -1
- package/dist/components/verbs/wrangler.d.ts +108 -0
- package/dist/components/verbs/wrangler.d.ts.map +1 -0
- package/dist/composite.d.ts +6 -1
- package/dist/composite.d.ts.map +1 -1
- package/dist/config.d.ts +26 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/deep-observation.d.ts +14 -0
- package/dist/deep-observation.d.ts.map +1 -1
- package/dist/discovery/collect.d.ts.map +1 -1
- package/dist/discovery/fold-import.d.ts +15 -1
- package/dist/discovery/fold-import.d.ts.map +1 -1
- package/dist/discovery/fold-rank.d.ts +66 -0
- package/dist/discovery/fold-rank.d.ts.map +1 -0
- package/dist/discovery/index.d.ts +15 -0
- package/dist/discovery/index.d.ts.map +1 -1
- package/dist/discovery/param-deps.d.ts +17 -0
- package/dist/discovery/param-deps.d.ts.map +1 -0
- package/dist/effect-receipt.d.ts +177 -0
- package/dist/effect-receipt.d.ts.map +1 -0
- package/dist/fold/fold.d.ts +55 -2
- package/dist/fold/fold.d.ts.map +1 -1
- package/dist/fold/subset.d.ts +20 -0
- package/dist/fold/subset.d.ts.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/lexicon-schema.d.ts +2 -0
- package/dist/lexicon-schema.d.ts.map +1 -1
- package/dist/lexicon.d.ts +137 -3
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/change-set.d.ts +33 -5
- package/dist/lifecycle/change-set.d.ts.map +1 -1
- package/dist/lifecycle/converge-ledger.d.ts +90 -0
- package/dist/lifecycle/converge-ledger.d.ts.map +1 -0
- package/dist/lifecycle/deep-diff.d.ts +18 -0
- package/dist/lifecycle/deep-diff.d.ts.map +1 -1
- package/dist/lifecycle/deep-observe.d.ts +9 -1
- package/dist/lifecycle/deep-observe.d.ts.map +1 -1
- package/dist/lifecycle/gate-ledger.d.ts +33 -0
- package/dist/lifecycle/gate-ledger.d.ts.map +1 -0
- package/dist/lifecycle/git.d.ts +145 -21
- package/dist/lifecycle/git.d.ts.map +1 -1
- package/dist/lifecycle/index.d.ts +6 -0
- package/dist/lifecycle/index.d.ts.map +1 -1
- package/dist/lifecycle/lease.d.ts +113 -0
- package/dist/lifecycle/lease.d.ts.map +1 -0
- package/dist/lifecycle/observation-baseline.d.ts +21 -3
- package/dist/lifecycle/observation-baseline.d.ts.map +1 -1
- package/dist/lifecycle/receipt-plan.d.ts +62 -0
- package/dist/lifecycle/receipt-plan.d.ts.map +1 -0
- package/dist/lifecycle/release-ledger.d.ts +20 -0
- package/dist/lifecycle/release-ledger.d.ts.map +1 -1
- package/dist/lifecycle/scenario-eval.d.ts +42 -0
- package/dist/lifecycle/scenario-eval.d.ts.map +1 -0
- package/dist/lifecycle/scenario.d.ts +163 -0
- package/dist/lifecycle/scenario.d.ts.map +1 -0
- package/dist/lifecycle/symptoms.d.ts +63 -0
- package/dist/lifecycle/symptoms.d.ts.map +1 -0
- package/dist/lifecycle/teardown.d.ts +6 -4
- package/dist/lifecycle/teardown.d.ts.map +1 -1
- package/dist/lifecycle/unobserved-gate.d.ts +67 -0
- package/dist/lifecycle/unobserved-gate.d.ts.map +1 -0
- package/dist/lint/knowledge-checks.d.ts +48 -0
- package/dist/lint/knowledge-checks.d.ts.map +1 -0
- package/dist/lint/output-checks.d.ts +5 -0
- package/dist/lint/output-checks.d.ts.map +1 -0
- package/dist/lint/output-docs.d.ts +94 -0
- package/dist/lint/output-docs.d.ts.map +1 -0
- package/dist/lint/pipeline-change-gate.d.ts +101 -0
- package/dist/lint/pipeline-change-gate.d.ts.map +1 -0
- package/dist/lint/post-synth.d.ts +41 -0
- package/dist/lint/post-synth.d.ts.map +1 -1
- package/dist/lint/receipt-checks.d.ts +9 -0
- package/dist/lint/receipt-checks.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp003/pass/agent-turn.component.d.ts +11 -0
- package/dist/lint/rules/__fixtures__/comp/comp003/pass/agent-turn.component.d.ts.map +1 -0
- package/dist/lint/rules/cor022-receipt-leaf.d.ts +13 -0
- package/dist/lint/rules/cor022-receipt-leaf.d.ts.map +1 -0
- package/dist/lint/rules/cor024-receipt-secret-pointer.d.ts +3 -0
- package/dist/lint/rules/cor024-receipt-secret-pointer.d.ts.map +1 -0
- package/dist/lint/rules/evl001-non-literal-expression.d.ts.map +1 -1
- package/dist/lint/rules/index.d.ts +3 -1
- package/dist/lint/rules/index.d.ts.map +1 -1
- package/dist/lsp/lexicon-providers.d.ts +7 -0
- package/dist/lsp/lexicon-providers.d.ts.map +1 -1
- package/dist/okf-read.d.ts +78 -0
- package/dist/okf-read.d.ts.map +1 -0
- package/dist/op/activity-contract.d.ts +139 -0
- package/dist/op/activity-contract.d.ts.map +1 -0
- package/dist/op/builders.d.ts +140 -3
- package/dist/op/builders.d.ts.map +1 -1
- package/dist/op/converge-rule.d.ts +161 -0
- package/dist/op/converge-rule.d.ts.map +1 -0
- package/dist/op/generate-pipeline.d.ts +39 -0
- package/dist/op/generate-pipeline.d.ts.map +1 -0
- package/dist/op/index.d.ts +18 -2
- package/dist/op/index.d.ts.map +1 -1
- package/dist/op/local-executor.d.ts +2 -1
- package/dist/op/local-executor.d.ts.map +1 -1
- package/dist/op/op-verb-class.d.ts +42 -0
- package/dist/op/op-verb-class.d.ts.map +1 -0
- package/dist/op/operator.d.ts +128 -0
- package/dist/op/operator.d.ts.map +1 -0
- package/dist/op/receipt-store.d.ts +138 -0
- package/dist/op/receipt-store.d.ts.map +1 -0
- package/dist/op/step-output-ref.d.ts +187 -0
- package/dist/op/step-output-ref.d.ts.map +1 -0
- package/dist/op/types.d.ts +49 -2
- package/dist/op/types.d.ts.map +1 -1
- package/dist/provenance.d.ts +73 -3
- package/dist/provenance.d.ts.map +1 -1
- package/dist/runtime-adapter.d.ts +7 -1
- package/dist/runtime-adapter.d.ts.map +1 -1
- package/dist/secret-materialization.d.ts +138 -0
- package/dist/secret-materialization.d.ts.map +1 -0
- package/dist/secret-provenance.d.ts +218 -0
- package/dist/secret-provenance.d.ts.map +1 -0
- package/dist/serializer.d.ts +29 -0
- package/dist/serializer.d.ts.map +1 -1
- package/dist/toml.d.ts +40 -5
- package/dist/toml.d.ts.map +1 -1
- package/dist/yaml.d.ts.map +1 -1
- package/package.json +4 -1
- package/src/audit/catalog.test.ts +1 -1
- package/src/audit/catalog.ts +75 -3
- package/src/audit/core.test.ts +57 -0
- package/src/audit/core.ts +0 -0
- package/src/audit/detect-bundle.test.ts +1 -1
- package/src/audit/discover.test.ts +24 -0
- package/src/audit/discover.ts +40 -4
- package/src/audit/fetch.test.ts +216 -3
- package/src/audit/fetch.ts +270 -59
- package/src/audit/report-html.ts +5 -2
- package/src/audit/report-model.ts +9 -0
- package/src/audit/report.test.ts +22 -0
- package/src/audit/report.ts +3 -2
- package/src/audit/rules-doc.ts +13 -1
- package/src/audit/secrets.test.ts +303 -0
- package/src/audit/secrets.ts +406 -0
- package/src/audit/wrangler.test.ts +230 -0
- package/src/audit/wrangler.ts +290 -0
- package/src/build.test.ts +41 -0
- package/src/build.ts +39 -6
- package/src/cli/command-group.ts +1 -1
- package/src/cli/commands/__fixtures__/audit-fountain/agents/fleet.yaml +27 -0
- package/src/cli/commands/__fixtures__/audit-fountain/k8s/deploy.yaml +16 -0
- package/src/cli/commands/__fixtures__/audit-fountain-clean/fleet.yaml +20 -0
- package/src/cli/commands/__fixtures__/schemas/sarif-2.1.0.schema.json +2882 -0
- package/src/cli/commands/audit.test.ts +268 -1
- package/src/cli/commands/audit.ts +87 -18
- package/src/cli/commands/build.test.ts +245 -0
- package/src/cli/commands/build.ts +210 -21
- package/src/cli/commands/lint.ts +15 -3
- package/src/cli/handlers/build.ts +2 -0
- package/src/cli/handlers/components.test.ts +199 -1
- package/src/cli/handlers/components.ts +160 -3
- package/src/cli/handlers/explain.test.ts +70 -1
- package/src/cli/handlers/graph.test.ts +20 -0
- package/src/cli/handlers/graph.ts +12 -3
- package/src/cli/handlers/lifecycle.test.ts +115 -1
- package/src/cli/handlers/lifecycle.ts +96 -15
- package/src/cli/handlers/operator.test.ts +255 -0
- package/src/cli/handlers/operator.ts +240 -0
- package/src/cli/handlers/scenario.test.ts +456 -0
- package/src/cli/handlers/scenario.ts +330 -0
- package/src/cli/main.test.ts +23 -0
- package/src/cli/main.ts +72 -1
- package/src/cli/mcp/resource-handlers.ts +38 -1
- package/src/cli/mcp/server.test.ts +323 -3
- package/src/cli/mcp/server.ts +84 -7
- package/src/cli/mcp/tools/explain.ts +51 -2
- package/src/cli/mcp/types.ts +27 -1
- package/src/cli/plugins.ts +4 -2
- package/src/cli/registry.ts +14 -2
- package/src/cli/reporters/stylish.test.ts +154 -0
- package/src/cli/reporters/stylish.ts +154 -33
- package/src/codegen/docs-rule-scanning.test.ts +42 -0
- package/src/codegen/docs-rule-scanning.ts +25 -2
- package/src/components/README.md +7 -0
- package/src/components/auto-release.ts +6 -0
- package/src/components/capability.ts +17 -2
- package/src/components/cli-support.test.ts +17 -0
- package/src/components/cli-support.ts +13 -1
- package/src/components/component-schema.test.ts +32 -0
- package/src/components/component.schema.json +6 -0
- package/src/components/component.test.ts +21 -0
- package/src/components/component.ts +15 -0
- package/src/components/driver.ts +12 -4
- package/src/components/registry.test.ts +7 -2
- package/src/components/starter-plugin.ts +17 -0
- package/src/components/verbs/ensure-secret.test.ts +130 -0
- package/src/components/verbs/ensure-secret.ts +79 -0
- package/src/components/verbs/index.ts +13 -0
- package/src/components/verbs/r2-sync.test.ts +107 -0
- package/src/components/verbs/r2-sync.ts +124 -0
- package/src/components/verbs/run-agent.test.ts +683 -0
- package/src/components/verbs/run-agent.ts +786 -0
- package/src/components/verbs/sign.test.ts +19 -0
- package/src/components/verbs/sign.ts +34 -2
- package/src/components/verbs/wrangler.test.ts +170 -0
- package/src/components/verbs/wrangler.ts +241 -0
- package/src/composite.ts +31 -2
- package/src/config.test.ts +15 -0
- package/src/config.ts +30 -0
- package/src/deep-observation.test.ts +19 -0
- package/src/deep-observation.ts +17 -0
- package/src/discovery/collect.ts +11 -2
- package/src/discovery/fold-import.test.ts +54 -0
- package/src/discovery/fold-import.ts +178 -38
- package/src/discovery/fold-rank.test.ts +197 -0
- package/src/discovery/fold-rank.ts +346 -0
- package/src/discovery/index.ts +16 -1
- package/src/discovery/param-deps.test.ts +118 -0
- package/src/discovery/param-deps.ts +170 -0
- package/src/effect-receipt-exclusion.test.ts +190 -0
- package/src/effect-receipt.test.ts +419 -0
- package/src/effect-receipt.ts +412 -0
- package/src/fold/fold.test.ts +6 -2
- package/src/fold/fold.ts +184 -3
- package/src/fold/subset.test.ts +95 -6
- package/src/fold/subset.ts +66 -2
- package/src/index.ts +4 -0
- package/src/lexicon-schema.ts +3 -0
- package/src/lexicon.ts +151 -5
- package/src/lifecycle/change-set.ts +46 -7
- package/src/lifecycle/converge-ledger.test.ts +199 -0
- package/src/lifecycle/converge-ledger.ts +179 -0
- package/src/lifecycle/deep-diff.test.ts +79 -1
- package/src/lifecycle/deep-diff.ts +23 -0
- package/src/lifecycle/deep-observe.ts +13 -2
- package/src/lifecycle/gate-ledger.test.ts +103 -0
- package/src/lifecycle/gate-ledger.ts +140 -0
- package/src/lifecycle/git.test.ts +430 -0
- package/src/lifecycle/git.ts +446 -84
- package/src/lifecycle/index.ts +6 -0
- package/src/lifecycle/lease.test.ts +343 -0
- package/src/lifecycle/lease.ts +270 -0
- package/src/lifecycle/observation-baseline.test.ts +46 -0
- package/src/lifecycle/observation-baseline.ts +33 -1
- package/src/lifecycle/receipt-plan.test.ts +250 -0
- package/src/lifecycle/receipt-plan.ts +249 -0
- package/src/lifecycle/release-ledger.ts +20 -0
- package/src/lifecycle/scenario-eval.test.ts +199 -0
- package/src/lifecycle/scenario-eval.ts +158 -0
- package/src/lifecycle/scenario.test.ts +195 -0
- package/src/lifecycle/scenario.ts +321 -0
- package/src/lifecycle/symptoms.test.ts +116 -0
- package/src/lifecycle/symptoms.ts +126 -0
- package/src/lifecycle/teardown.test.ts +31 -0
- package/src/lifecycle/teardown.ts +6 -4
- package/src/lifecycle/unobserved-gate.test.ts +109 -0
- package/src/lifecycle/unobserved-gate.ts +102 -0
- package/src/lint/knowledge-checks.test.ts +80 -0
- package/src/lint/knowledge-checks.ts +74 -0
- package/src/lint/output-checks.test.ts +85 -0
- package/src/lint/output-checks.ts +99 -0
- package/src/lint/output-docs.test.ts +220 -0
- package/src/lint/output-docs.ts +204 -0
- package/src/lint/pipeline-change-gate.test.ts +144 -0
- package/src/lint/pipeline-change-gate.ts +153 -0
- package/src/lint/post-synth.test.ts +97 -0
- package/src/lint/post-synth.ts +60 -0
- package/src/lint/receipt-checks.test.ts +101 -0
- package/src/lint/receipt-checks.ts +93 -0
- package/src/lint/rules/__fixtures__/comp/comp003/pass/agent-turn.component.ts +26 -0
- package/src/lint/rules/comp/comp.test.ts +49 -1
- package/src/lint/rules/cor022-receipt-leaf.test.ts +116 -0
- package/src/lint/rules/cor022-receipt-leaf.ts +130 -0
- package/src/lint/rules/cor024-receipt-secret-pointer.test.ts +121 -0
- package/src/lint/rules/cor024-receipt-secret-pointer.ts +218 -0
- package/src/lint/rules/evl001-non-literal-expression.test.ts +35 -3
- package/src/lint/rules/evl001-non-literal-expression.ts +7 -0
- package/src/lint/rules/index.ts +7 -1
- package/src/lsp/lexicon-providers.test.ts +44 -0
- package/src/lsp/lexicon-providers.ts +11 -1
- package/src/okf-read.test.ts +149 -0
- package/src/okf-read.ts +197 -0
- package/src/op/activity-contract.test.ts +180 -0
- package/src/op/activity-contract.ts +278 -0
- package/src/op/builders-exports.test.ts +17 -1
- package/src/op/builders.ts +198 -6
- package/src/op/converge-rule.test.ts +179 -0
- package/src/op/converge-rule.ts +311 -0
- package/src/op/effect-step.test.ts +311 -0
- package/src/op/generate-pipeline.test.ts +53 -0
- package/src/op/generate-pipeline.ts +99 -0
- package/src/op/index.ts +40 -3
- package/src/op/local-executor.test.ts +92 -0
- package/src/op/local-executor.ts +212 -29
- package/src/op/op-verb-class.test.ts +126 -0
- package/src/op/op-verb-class.ts +115 -0
- package/src/op/op.test.ts +25 -2
- package/src/op/operator.test.ts +346 -0
- package/src/op/operator.ts +213 -0
- package/src/op/receipt-store.ts +211 -0
- package/src/op/step-output-ref.test.ts +334 -0
- package/src/op/step-output-ref.ts +453 -0
- package/src/op/types.ts +51 -2
- package/src/provenance.test.ts +151 -4
- package/src/provenance.ts +118 -4
- package/src/runtime-adapter.ts +31 -10
- package/src/secret-materialization.test.ts +199 -0
- package/src/secret-materialization.ts +235 -0
- package/src/secret-provenance.test.ts +388 -0
- package/src/secret-provenance.ts +475 -0
- package/src/serializer.ts +30 -0
- package/src/toml.test.ts +157 -384
- package/src/toml.ts +371 -5
- package/src/yaml.test.ts +88 -0
- package/src/yaml.ts +76 -6
package/dist/provenance.d.ts
CHANGED
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
* entity object, so it never serializes into the emitted YAML/JSON — it is build
|
|
6
6
|
* metadata, not declared configuration. Read it back with {@link getProvenance}.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* Entity-level provenance (which file declared it, and which composite expanded
|
|
9
|
+
* it) answers "where did this resource come from?", which is the question an
|
|
10
|
+
* agent asks before changing it. {@link PathOrigin} (chant #1443) answers the
|
|
11
|
+
* follow-up — "what set THIS field" — for the paths a build can attribute
|
|
12
|
+
* without guessing. Neither is a YAML-line source map.
|
|
11
13
|
*
|
|
12
14
|
* {@link BuildParamProvenance} (chant #1064) is the other half: not "where did
|
|
13
15
|
* this ENTITY come from" but "what INPUTS was this whole BUILD invoked with" —
|
|
@@ -27,7 +29,55 @@ export interface EntityProvenance {
|
|
|
27
29
|
* collapse a composite to a single node at coarse diagram detail levels (#494).
|
|
28
30
|
*/
|
|
29
31
|
compositeInstance?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Per-path origins within the entity's `props` (chant #1443). Read with
|
|
34
|
+
* {@link originOfPath}, which does the prefix resolution these keys are
|
|
35
|
+
* written for.
|
|
36
|
+
*
|
|
37
|
+
* Keys are dotted property paths only — `spec.template.spec.containers` —
|
|
38
|
+
* with `""` for the whole entity. They never carry an array segment, because
|
|
39
|
+
* a producing mechanism attributes a whole array at once: the coarsest path
|
|
40
|
+
* it actually determines is the honest one to record, and a positional key
|
|
41
|
+
* would go stale the moment an element moved.
|
|
42
|
+
*
|
|
43
|
+
* Query paths come from #1441's diff addressing and may carry `[#key]` for an
|
|
44
|
+
* element of an associative list or `[n]` for a positional one. Resolution is
|
|
45
|
+
* longest segment-boundary prefix, so `spec.containers[#app].image` finds a
|
|
46
|
+
* key recorded at `spec.containers`, and a key recorded at
|
|
47
|
+
* `spec.containers.image` never matches it. The two grammars agree without
|
|
48
|
+
* the recorder needing the lexicon's ordering hook, which it has no access to.
|
|
49
|
+
*
|
|
50
|
+
* Absent means this build could not record path origins, not that nothing
|
|
51
|
+
* governs the entity's fields — the run path executes modules and has no
|
|
52
|
+
* expression to inspect, and a sandboxed child's provenance does not survive
|
|
53
|
+
* the wire (`discovery/entity-wire-codec.ts` drops build metadata).
|
|
54
|
+
*/
|
|
55
|
+
paths?: Record<string, PathOrigin>;
|
|
30
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* What produced one path inside an entity's props.
|
|
59
|
+
*
|
|
60
|
+
* - `authored` — written in the source file that declared the entity.
|
|
61
|
+
* - `composite` — the entity was expanded by a composite, or the path was
|
|
62
|
+
* supplied by `propagate()`'s shared props at the instance.
|
|
63
|
+
* - `build-param` — the build parameters the authored expression for this path
|
|
64
|
+
* *reads*, which is a syntactic dependency, not a value taint. For
|
|
65
|
+
* `replicas: params.tier === "prod" ? 5 : 1` a taint says the value came from
|
|
66
|
+
* the literal `5`, which is true and useless; the dependency says the field
|
|
67
|
+
* is governed by `tier`, which is what an editor needs to know. Under-reports
|
|
68
|
+
* (a shape the collector does not follow drops a dependency) and never
|
|
69
|
+
* over-reports a parameter the expression does not mention.
|
|
70
|
+
*/
|
|
71
|
+
export type PathOrigin = {
|
|
72
|
+
kind: "authored";
|
|
73
|
+
} | {
|
|
74
|
+
kind: "composite";
|
|
75
|
+
composite: string;
|
|
76
|
+
instance: string;
|
|
77
|
+
} | {
|
|
78
|
+
kind: "build-param";
|
|
79
|
+
params: string[];
|
|
80
|
+
};
|
|
31
81
|
/**
|
|
32
82
|
* Merge provenance onto an entity. Non-enumerable so it is invisible to
|
|
33
83
|
* serializers and spreads. Existing fields win (`??=`), so the first/most
|
|
@@ -36,6 +86,26 @@ export interface EntityProvenance {
|
|
|
36
86
|
export declare function setProvenance(entity: object, prov: EntityProvenance): void;
|
|
37
87
|
/** Read an entity's build provenance, if any was stamped. */
|
|
38
88
|
export declare function getProvenance(entity: object): EntityProvenance | undefined;
|
|
89
|
+
/**
|
|
90
|
+
* Record one path's origin, first writer wins — the same rule
|
|
91
|
+
* {@link setProvenance} applies to entity-level fields, and for the same
|
|
92
|
+
* reason: expansion runs innermost-composite-first, so the earliest writer is
|
|
93
|
+
* the most specific one.
|
|
94
|
+
*/
|
|
95
|
+
export declare function setPathProvenance(entity: object, path: string, origin: PathOrigin): void;
|
|
96
|
+
/**
|
|
97
|
+
* An entity's recorded path origins in sorted key order, or `undefined` when
|
|
98
|
+
* none were recorded. Sorted because a build's outputs are compared byte for
|
|
99
|
+
* byte and object key order is not something insertion should decide.
|
|
100
|
+
*/
|
|
101
|
+
export declare function getPathProvenance(entity: object): Record<string, PathOrigin> | undefined;
|
|
102
|
+
/**
|
|
103
|
+
* The origin governing `path` — the longest recorded key that addresses it or
|
|
104
|
+
* one of its ancestors. See {@link PROVENANCE_PATH_GRAMMAR}.
|
|
105
|
+
*/
|
|
106
|
+
export declare function originOfPath(paths: Readonly<Record<string, PathOrigin>> | undefined, path: string): PathOrigin | undefined;
|
|
107
|
+
/** One-line rendering of an origin, for diff output. */
|
|
108
|
+
export declare function describePathOrigin(origin: PathOrigin): string;
|
|
39
109
|
/**
|
|
40
110
|
* One resolved build-time parameter (chant #1064, see ../build-params.ts): its
|
|
41
111
|
* final value and which source won it, so a build's parameter inputs are
|
package/dist/provenance.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provenance.d.ts","sourceRoot":"","sources":["../src/provenance.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"provenance.d.ts","sourceRoot":"","sources":["../src/provenance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,MAAM,WAAW,gBAAgB;IAC/B,+EAA+E;IAC/E,UAAU,CAAC,EAAE,MAAM,CAA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,oBAAoB;IACnC,gFAAgF;IAChF,IAAI,EAAE,MAAM,CAAC;IACb,yFAAyF;IACzF,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IACjC,sCAAsC;IACtC,MAAM,EAAE,KAAK,GAAG,aAAa,GAAG,KAAK,GAAG,SAAS,CAAC;CACnD"}
|
|
@@ -19,9 +19,15 @@ export interface RuntimeAdapter {
|
|
|
19
19
|
readonly hashAlgorithm: string;
|
|
20
20
|
/** Test whether filePath matches a glob pattern */
|
|
21
21
|
globMatch(pattern: string, filePath: string): boolean;
|
|
22
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* Spawn a child process and collect output. When `opts.stdin` is set, it is
|
|
24
|
+
* written to the child's stdin and the stream is closed — the caller never
|
|
25
|
+
* needs to round-trip content through a shell (`sh -c "echo … | cmd"`) just
|
|
26
|
+
* to feed a command that reads from stdin (e.g. `git hash-object --stdin`).
|
|
27
|
+
*/
|
|
23
28
|
spawn(cmd: string[], opts?: {
|
|
24
29
|
cwd?: string;
|
|
30
|
+
stdin?: string;
|
|
25
31
|
}): Promise<SpawnResult>;
|
|
26
32
|
/** Commands to use when spawning package manager / executor */
|
|
27
33
|
readonly commands: RuntimeCommands;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-adapter.d.ts","sourceRoot":"","sources":["../src/runtime-adapter.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,6BAA6B;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,oCAAoC;IACpC,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,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AU,IAAI,cAAc,CAK3C;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAEvD"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated-once secret materialization — the one implementation behind the
|
|
3
|
+
* `ensure-secret` capability verb (components/verbs/ensure-secret.ts) and the
|
|
4
|
+
* `ensureSecret(...)` op step builder (op/builders.ts). chant #1829, epic
|
|
5
|
+
* #1365 decisions 3 and 6.
|
|
6
|
+
*
|
|
7
|
+
* The contract is read-then-write:
|
|
8
|
+
*
|
|
9
|
+
* - Absent: mint once, through the store adapter, and report `created`.
|
|
10
|
+
* - Present: verify presence, the declared key-set, and any declared
|
|
11
|
+
* metadata, then STOP — present means done. Never mint over an existing
|
|
12
|
+
* value. Never rotate implicitly. A re-run of a whole deploy leaves the
|
|
13
|
+
* stored bytes untouched.
|
|
14
|
+
* - Mismatch: fail loudly, naming what mismatched — key names and metadata
|
|
15
|
+
* keys, never a value or a value-derived hash (#1365 decision 6).
|
|
16
|
+
*
|
|
17
|
+
* The constitutional line (../secret-provenance.ts): no code path here may
|
|
18
|
+
* hold, log, hash, or compare a secret value. That is structural, not
|
|
19
|
+
* discipline:
|
|
20
|
+
*
|
|
21
|
+
* - {@link ensureSecretMaterialization} never calls the generator. It hands
|
|
22
|
+
* the generator to the store adapter's `create`, which consumes the
|
|
23
|
+
* material as it writes. The engine's result type has no field that could
|
|
24
|
+
* carry material.
|
|
25
|
+
* - The generator produces {@link SecretMaterial}, an opaque single-use
|
|
26
|
+
* handle. The plaintext lives in a module-private WeakMap, not on the
|
|
27
|
+
* object: enumeration, `JSON.stringify`, `String(...)`, and `util.inspect`
|
|
28
|
+
* all see only a redaction marker. Only {@link consumeSecretMaterial} —
|
|
29
|
+
* meant for store adapters, at the write — yields the plaintext, exactly
|
|
30
|
+
* once; a second consume throws.
|
|
31
|
+
* - `describe` returns key names and metadata only, so the mismatch check
|
|
32
|
+
* has nothing value-shaped to compare even by accident.
|
|
33
|
+
*
|
|
34
|
+
* Store adapters are per-provider (#1830 is the k8s row); core defines only
|
|
35
|
+
* the seam.
|
|
36
|
+
*/
|
|
37
|
+
/**
|
|
38
|
+
* A single-use, opaque handle to generated secret material. The plaintext is
|
|
39
|
+
* not a property of this object — it lives in a module-private WeakMap — so
|
|
40
|
+
* spreading, enumerating, stringifying, or logging the handle yields only a
|
|
41
|
+
* redaction marker. A store adapter redeems it with
|
|
42
|
+
* {@link consumeSecretMaterial} at the moment it writes; nothing else can.
|
|
43
|
+
*/
|
|
44
|
+
export declare class SecretMaterial {
|
|
45
|
+
private constructor();
|
|
46
|
+
/** Wrap plaintext in an opaque handle. Call inside a generator only. */
|
|
47
|
+
static mint(plaintext: string): SecretMaterial;
|
|
48
|
+
toString(): string;
|
|
49
|
+
toJSON(): string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Redeem a {@link SecretMaterial} handle for its plaintext — exactly once.
|
|
53
|
+
* For store adapters only, at the write to the backing store. Throws if the
|
|
54
|
+
* handle was already consumed (or was never minted here): material flows to
|
|
55
|
+
* the store exactly once and is retained nowhere.
|
|
56
|
+
*/
|
|
57
|
+
export declare function consumeSecretMaterial(material: SecretMaterial): string;
|
|
58
|
+
/**
|
|
59
|
+
* Produces the material for one key of a secret being minted. Called by the
|
|
60
|
+
* store adapter (never by the engine) once per declared key, at create time —
|
|
61
|
+
* generation is apply-time I/O, never synthesis.
|
|
62
|
+
*/
|
|
63
|
+
export type SecretMaterialGenerator = (key: string) => SecretMaterial | Promise<SecretMaterial>;
|
|
64
|
+
/** 32 bytes from the CSPRNG, base64url — the default mint. */
|
|
65
|
+
export declare const defaultSecretMaterialGenerator: SecretMaterialGenerator;
|
|
66
|
+
/** What `describe` reports about an existing secret: key NAMES and metadata. Never values. */
|
|
67
|
+
export interface SecretStoreDescription {
|
|
68
|
+
/** The key names present in the stored secret. */
|
|
69
|
+
readonly keys: readonly string[];
|
|
70
|
+
/** Store metadata (e.g. k8s labels/annotations the provider surfaces). */
|
|
71
|
+
readonly metadata?: Readonly<Record<string, string>>;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* A provider's view of one secret store — the seam #1830 (k8s) and future
|
|
75
|
+
* provider rows implement. `create` receives the generator and consumes each
|
|
76
|
+
* key's material as it writes; no method returns material.
|
|
77
|
+
*/
|
|
78
|
+
export interface SecretStoreAdapter {
|
|
79
|
+
/** Whether a secret of this name exists in the store. */
|
|
80
|
+
exists(name: string): Promise<boolean>;
|
|
81
|
+
/** Key names and metadata of an existing secret. Never values. */
|
|
82
|
+
describe(name: string): Promise<SecretStoreDescription>;
|
|
83
|
+
/**
|
|
84
|
+
* Create the secret, minting material for each declared key via
|
|
85
|
+
* `generate` and writing it straight to the store. Returns nothing:
|
|
86
|
+
* material must not travel back through this seam.
|
|
87
|
+
*/
|
|
88
|
+
create(name: string, keys: readonly string[], generate: SecretMaterialGenerator): Promise<void>;
|
|
89
|
+
}
|
|
90
|
+
/** The declared contract to ensure — names and keys only, never material. */
|
|
91
|
+
export interface EnsureSecretSpec {
|
|
92
|
+
/** The secret's name as the store knows it. */
|
|
93
|
+
readonly name: string;
|
|
94
|
+
/** The declared key-set. Creation mints one value per key; verification compares names. */
|
|
95
|
+
readonly keys: readonly string[];
|
|
96
|
+
/** Declared metadata an existing secret must carry (compared per key; mismatches are reported by KEY). */
|
|
97
|
+
readonly metadata?: Readonly<Record<string, string>>;
|
|
98
|
+
}
|
|
99
|
+
/** What `ensureSecretMaterialization` did. No field can carry material. */
|
|
100
|
+
export interface EnsureSecretOutcome {
|
|
101
|
+
/** `created` = minted now (first materialization); `present` = existed and matched the contract (no write). */
|
|
102
|
+
readonly outcome: "created" | "present";
|
|
103
|
+
/** The secret's name. */
|
|
104
|
+
readonly name: string;
|
|
105
|
+
/** The declared key names the contract was checked (or minted) against. */
|
|
106
|
+
readonly keys: readonly string[];
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* The loud failure: an existing secret does not match its declared contract.
|
|
110
|
+
* `mismatches` names what differed — key names and metadata keys only.
|
|
111
|
+
* Constructing one with anything value-shaped is the reviewer's tripwire;
|
|
112
|
+
* nothing in this module can, because nothing in this module holds a value.
|
|
113
|
+
*/
|
|
114
|
+
export declare class SecretContractMismatchError extends Error {
|
|
115
|
+
/** The secret's name. */
|
|
116
|
+
readonly secretName: string;
|
|
117
|
+
/** Human-readable mismatch descriptions, naming keys — never values. */
|
|
118
|
+
readonly mismatches: readonly string[];
|
|
119
|
+
constructor(
|
|
120
|
+
/** The secret's name. */
|
|
121
|
+
secretName: string,
|
|
122
|
+
/** Human-readable mismatch descriptions, naming keys — never values. */
|
|
123
|
+
mismatches: readonly string[]);
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Ensure a `generated-once` secret exists and matches its declared contract.
|
|
127
|
+
* Read-then-write:
|
|
128
|
+
*
|
|
129
|
+
* - Absent: `store.create(name, keys, generate)` — one mint, then done.
|
|
130
|
+
* - Present and matching: no write of any kind; returns `present`.
|
|
131
|
+
* - Present and mismatching: throws {@link SecretContractMismatchError}
|
|
132
|
+
* naming the missing/unexpected key names and mismatched metadata keys.
|
|
133
|
+
*
|
|
134
|
+
* The engine never calls `generate` itself and never sees what the adapter
|
|
135
|
+
* writes; its return value carries names only.
|
|
136
|
+
*/
|
|
137
|
+
export declare function ensureSecretMaterialization(store: SecretStoreAdapter, spec: EnsureSecretSpec, generate?: SecretMaterialGenerator): Promise<EnsureSecretOutcome>;
|
|
138
|
+
//# sourceMappingURL=secret-materialization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secret-materialization.d.ts","sourceRoot":"","sources":["../src/secret-materialization.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAWH;;;;;;GAMG;AACH,qBAAa,cAAc;IACzB,OAAO;IAEP,wEAAwE;IACxE,MAAM,CAAC,IAAI,C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AAC,CAAC,CAAC;CACtD;AAED,2EAA2E;AAC3E,MAAM,WAAW,mBAAmB;IAClC,+GAA+G;IAC/G,QAAQ,CAAC,OAAO,EAAE,SAAS,GAAG,SAAS,CAAC;IACxC,yBAAyB;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,2EAA2E;IAC3E,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC;AAED;;;;;GAKG;AACH,qBAAa,2BAA4B,SAAQ,KAAK;IAElD,yBAAyB;aACT,UAAU,EAAE,MAAM;IAClC,wEAAwE;aACxD,UAAU,EAAE,SAAS,MAAM,EAAE;;IAH7C,yBAAyB;IACT,UAAU,EAAE,MAAM;IAClC,wEAAwE;IACxD,UAAU,EAAE,SAAS,MAAM,EAAE;CAQhD;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,2BAA2B,CAC/C,KAAK,EAAE,kBAAkB,EACzB,IAAI,EAAE,gBAAgB,EACtB,QAAQ,GAAE,uBAAwD,GACjE,OAAO,CAAC,mBAAmB,CAAC,CA0C9B"}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Secret provenance vocabulary (chant #1828, epic #1365).
|
|
3
|
+
*
|
|
4
|
+
* A secret's PROVENANCE is where its value comes from — never what the value
|
|
5
|
+
* is. chant's constitutional line on secrets: no code path may hold, log,
|
|
6
|
+
* hash, or compare a secret value. This module makes that structural: the
|
|
7
|
+
* declaration types have no field that could carry material, the factory
|
|
8
|
+
* rejects material-shaped fields at both the type level (`never` fields) and
|
|
9
|
+
* at runtime (own-property check, naming only the offending KEY), and
|
|
10
|
+
* "mismatch" anywhere downstream means presence, declared key-set, and
|
|
11
|
+
* metadata — never a value or a value-derived hash (#1365 decision 6).
|
|
12
|
+
*
|
|
13
|
+
* The closed kind set:
|
|
14
|
+
*
|
|
15
|
+
* - `referenced` — the value exists out of band (a human or an external
|
|
16
|
+
* process put it where consumers read it). chant records only that the
|
|
17
|
+
* estate depends on it, which is what lets the consumed-but-unproduced
|
|
18
|
+
* check (#1382) ship as an error instead of a guess.
|
|
19
|
+
* - `from-provider` — a declared provider binding materializes it (the
|
|
20
|
+
* operator/CRD seam; `K8s::Infisical::InfisicalSecret` from #1321 is the
|
|
21
|
+
* exemplar). The declaration POINTS at that binding, it does not re-model
|
|
22
|
+
* it.
|
|
23
|
+
* - `generated-once` — minted on first materialization, then never
|
|
24
|
+
* regenerated (present means done). The declaration carries contract flags
|
|
25
|
+
* only — e.g. the declared key-set — never mint parameters holding
|
|
26
|
+
* material. `generated-once` secrets never enter the prunable set (#1365
|
|
27
|
+
* decision 5).
|
|
28
|
+
* - `committed-encrypted` — sops-style ciphertext committed in the repo,
|
|
29
|
+
* decrypted by the delivery system (Flux) straight into the target. The
|
|
30
|
+
* declaration records a repo-relative PATH to the ciphertext, never the
|
|
31
|
+
* bytes: the factory is pure and touches no filesystem, so it still folds
|
|
32
|
+
* under `--sandbox`. The bytes are read at `buildRoots()` — the one
|
|
33
|
+
* sanctioned impure seam — and emitted as a sidecar file, never as a
|
|
34
|
+
* document in the primary output. See
|
|
35
|
+
* `docs/design/committed-encrypted-sops-provenance.md`.
|
|
36
|
+
*
|
|
37
|
+
* Declarations are serializer-neutral: discovery collects them like any
|
|
38
|
+
* entity (they are Declarables), but `partitionByLexicon` (../build.ts)
|
|
39
|
+
* excludes them from every serializer partition, so no lexicon ever emits
|
|
40
|
+
* them. They are data that lint rules and lexicons READ (via
|
|
41
|
+
* {@link collectSecretDeclarations}), not output.
|
|
42
|
+
*/
|
|
43
|
+
import { type Declarable } from "./declarable.js";
|
|
44
|
+
/** The closed union of secret origins. */
|
|
45
|
+
export type SecretProvenance = "referenced" | "from-provider" | "generated-once" | "committed-encrypted";
|
|
46
|
+
/** Every provenance kind, for exhaustiveness checks. */
|
|
47
|
+
export declare const SECRET_PROVENANCE_KINDS: readonly SecretProvenance[];
|
|
48
|
+
/**
|
|
49
|
+
* Encryption tools a {@link CommittedEncryptedSecretDeclaration} understands.
|
|
50
|
+
* A closed union with one member, not a free string: a second tool later is a
|
|
51
|
+
* deliberate widening with a detection rule attached, not an unvalidated
|
|
52
|
+
* string that silently means nothing.
|
|
53
|
+
*/
|
|
54
|
+
export type SecretEncryption = "sops";
|
|
55
|
+
/** Every encryption tool, for exhaustiveness checks. */
|
|
56
|
+
export declare const SECRET_ENCRYPTION_TOOLS: readonly SecretEncryption[];
|
|
57
|
+
/** Marker symbol identifying a secret provenance declaration. `Symbol.for` so
|
|
58
|
+
* it survives the entity-wire codec (../discovery/entity-wire-codec.ts). */
|
|
59
|
+
export declare const SECRET_DECLARATION_MARKER: unique symbol;
|
|
60
|
+
/** The `entityType` every secret declaration carries. */
|
|
61
|
+
export declare const SECRET_DECLARATION_ENTITY_TYPE = "Chant::SecretProvenance";
|
|
62
|
+
/**
|
|
63
|
+
* Points a `from-provider` declaration at the provider binding that
|
|
64
|
+
* materializes the secret — the CRD seam, not a re-model of it. The binding
|
|
65
|
+
* itself is an ordinary declarable in its own lexicon (e.g. an
|
|
66
|
+
* `InfisicalSecret` instance, #1321); this ref names it so lint can resolve
|
|
67
|
+
* the pair without core depending on any lexicon.
|
|
68
|
+
*/
|
|
69
|
+
export interface SecretProviderRef {
|
|
70
|
+
/** Entity name (export name) of the provider binding declarable in this project. */
|
|
71
|
+
readonly binding: string;
|
|
72
|
+
/**
|
|
73
|
+
* Expected `entityType` of the binding (e.g.
|
|
74
|
+
* `"K8s::Infisical::InfisicalSecret"`). Optional; when present, lint can
|
|
75
|
+
* verify the named binding is actually the kind of seam the declaration
|
|
76
|
+
* claims.
|
|
77
|
+
*/
|
|
78
|
+
readonly entityType?: string;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Fields that would carry secret material, forbidden by construction. Typed
|
|
82
|
+
* as `never` on every factory input so they fail to compile even when the
|
|
83
|
+
* input object was widened or spread (plain excess-property checks only catch
|
|
84
|
+
* object literals). The runtime check in {@link declareSecret} is the same
|
|
85
|
+
* list, for untyped callers.
|
|
86
|
+
*/
|
|
87
|
+
interface NoSecretMaterial {
|
|
88
|
+
readonly value?: never;
|
|
89
|
+
readonly data?: never;
|
|
90
|
+
readonly stringData?: never;
|
|
91
|
+
readonly material?: never;
|
|
92
|
+
readonly plaintext?: never;
|
|
93
|
+
readonly ciphertext?: never;
|
|
94
|
+
}
|
|
95
|
+
/** Fields shared by every secret declaration. */
|
|
96
|
+
interface SecretDeclarationBase extends Declarable {
|
|
97
|
+
readonly [SECRET_DECLARATION_MARKER]: true;
|
|
98
|
+
readonly lexicon: "chant";
|
|
99
|
+
readonly entityType: typeof SECRET_DECLARATION_ENTITY_TYPE;
|
|
100
|
+
/** The secret's name as consumers know it (e.g. the k8s Secret name). */
|
|
101
|
+
readonly name: string;
|
|
102
|
+
/** Which of the closed kind set this declaration is. */
|
|
103
|
+
readonly provenance: SecretProvenance;
|
|
104
|
+
}
|
|
105
|
+
/** A secret whose value exists out of band. */
|
|
106
|
+
export interface ReferencedSecretDeclaration extends SecretDeclarationBase {
|
|
107
|
+
readonly provenance: "referenced";
|
|
108
|
+
/** Where consumers find it — free-form (a namespace, a vault path, a doc link). */
|
|
109
|
+
readonly scope?: string;
|
|
110
|
+
}
|
|
111
|
+
/** A secret a declared provider binding materializes. */
|
|
112
|
+
export interface FromProviderSecretDeclaration extends SecretDeclarationBase {
|
|
113
|
+
readonly provenance: "from-provider";
|
|
114
|
+
readonly provider: SecretProviderRef;
|
|
115
|
+
}
|
|
116
|
+
/** A secret minted on first materialization and never regenerated. */
|
|
117
|
+
export interface GeneratedOnceSecretDeclaration extends SecretDeclarationBase {
|
|
118
|
+
readonly provenance: "generated-once";
|
|
119
|
+
/**
|
|
120
|
+
* The declared key-set of the materialized secret. This is the contract a
|
|
121
|
+
* materializer (#1830) checks for mismatch — presence and keys, never
|
|
122
|
+
* values.
|
|
123
|
+
*/
|
|
124
|
+
readonly keys?: readonly string[];
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* A secret whose ciphertext is committed to the repo and decrypted by the
|
|
128
|
+
* delivery system on the way into the target.
|
|
129
|
+
*
|
|
130
|
+
* The declaration is a POINTER: `file` is a repo-relative path, and nothing
|
|
131
|
+
* here carries bytes. That is what keeps the factory pure — the ciphertext is
|
|
132
|
+
* read at `buildRoots()` and emitted as a sidecar, never inlined into the
|
|
133
|
+
* primary output an applier reads.
|
|
134
|
+
*/
|
|
135
|
+
export interface CommittedEncryptedSecretDeclaration extends SecretDeclarationBase {
|
|
136
|
+
readonly provenance: "committed-encrypted";
|
|
137
|
+
/** Repo-relative path to the committed ciphertext file. */
|
|
138
|
+
readonly file: string;
|
|
139
|
+
/** Encryption tool. Defaults to `"sops"` when omitted. */
|
|
140
|
+
readonly encryption: SecretEncryption;
|
|
141
|
+
/**
|
|
142
|
+
* Public recipient identifiers — age recipients or PGP fingerprints. Public
|
|
143
|
+
* by definition, which is the opposite of material; a private key here is
|
|
144
|
+
* refused by the factory.
|
|
145
|
+
*/
|
|
146
|
+
readonly recipients?: readonly string[];
|
|
147
|
+
/**
|
|
148
|
+
* The declared key-set of the decrypted Secret — the same contract meaning
|
|
149
|
+
* as {@link GeneratedOnceSecretDeclaration.keys}: presence and key names,
|
|
150
|
+
* never values. SOPS leaves key NAMES cleartext, so this is checkable
|
|
151
|
+
* against the file itself.
|
|
152
|
+
*/
|
|
153
|
+
readonly keys?: readonly string[];
|
|
154
|
+
}
|
|
155
|
+
/** A secret provenance declaration — the discriminant is `provenance`. */
|
|
156
|
+
export type SecretDeclaration = ReferencedSecretDeclaration | FromProviderSecretDeclaration | GeneratedOnceSecretDeclaration | CommittedEncryptedSecretDeclaration;
|
|
157
|
+
/** Narrow a declaration to the committed-encrypted kind. */
|
|
158
|
+
export declare function isCommittedEncryptedSecret(decl: SecretDeclaration): decl is CommittedEncryptedSecretDeclaration;
|
|
159
|
+
/** Factory input for a `referenced` secret. */
|
|
160
|
+
export interface ReferencedSecretInput extends NoSecretMaterial {
|
|
161
|
+
readonly name: string;
|
|
162
|
+
readonly provenance: "referenced";
|
|
163
|
+
readonly scope?: string;
|
|
164
|
+
}
|
|
165
|
+
/** Factory input for a `from-provider` secret. */
|
|
166
|
+
export interface FromProviderSecretInput extends NoSecretMaterial {
|
|
167
|
+
readonly name: string;
|
|
168
|
+
readonly provenance: "from-provider";
|
|
169
|
+
readonly provider: SecretProviderRef;
|
|
170
|
+
}
|
|
171
|
+
/** Factory input for a `generated-once` secret. */
|
|
172
|
+
export interface GeneratedOnceSecretInput extends NoSecretMaterial {
|
|
173
|
+
readonly name: string;
|
|
174
|
+
readonly provenance: "generated-once";
|
|
175
|
+
readonly keys?: readonly string[];
|
|
176
|
+
}
|
|
177
|
+
/** Factory input for a `committed-encrypted` secret. */
|
|
178
|
+
export interface CommittedEncryptedSecretInput extends NoSecretMaterial {
|
|
179
|
+
readonly name: string;
|
|
180
|
+
readonly provenance: "committed-encrypted";
|
|
181
|
+
/**
|
|
182
|
+
* Repo-relative path to the committed ciphertext file — `file`, never
|
|
183
|
+
* `ciphertext`: the declaration points at bytes, it does not carry them,
|
|
184
|
+
* and `ciphertext` is a forbidden material field.
|
|
185
|
+
*/
|
|
186
|
+
readonly file: string;
|
|
187
|
+
/** Encryption tool. Closed union; `"sops"` is its only member today. */
|
|
188
|
+
readonly encryption?: SecretEncryption;
|
|
189
|
+
/** Public recipient identifiers — age recipients or PGP fingerprints. */
|
|
190
|
+
readonly recipients?: readonly string[];
|
|
191
|
+
/** The declared key-set of the decrypted Secret. Names only, never values. */
|
|
192
|
+
readonly keys?: readonly string[];
|
|
193
|
+
}
|
|
194
|
+
export type SecretDeclarationInput = ReferencedSecretInput | FromProviderSecretInput | GeneratedOnceSecretInput | CommittedEncryptedSecretInput;
|
|
195
|
+
/**
|
|
196
|
+
* Declare a secret's provenance. The returned object is a locked Declarable:
|
|
197
|
+
* discovery collects it like any entity, `chant list` shows it, lint and
|
|
198
|
+
* lexicons read it — and no serializer ever emits it.
|
|
199
|
+
*
|
|
200
|
+
* Only the fields the kind defines are copied onto the declaration; anything
|
|
201
|
+
* else on the input — in particular anything that could carry material — is
|
|
202
|
+
* either a compile error ({@link NoSecretMaterial}) or a thrown error here.
|
|
203
|
+
* The thrown message names the offending KEY only, never its value.
|
|
204
|
+
*/
|
|
205
|
+
export declare function declareSecret(input: ReferencedSecretInput): ReferencedSecretDeclaration;
|
|
206
|
+
export declare function declareSecret(input: FromProviderSecretInput): FromProviderSecretDeclaration;
|
|
207
|
+
export declare function declareSecret(input: GeneratedOnceSecretInput): GeneratedOnceSecretDeclaration;
|
|
208
|
+
export declare function declareSecret(input: CommittedEncryptedSecretInput): CommittedEncryptedSecretDeclaration;
|
|
209
|
+
/** Type guard for a secret provenance declaration. */
|
|
210
|
+
export declare function isSecretDeclaration(value: unknown): value is SecretDeclaration;
|
|
211
|
+
/**
|
|
212
|
+
* Extract the secret declarations from a discovered entity map — the read
|
|
213
|
+
* surface for lint rules (#1382) and lexicon materializers (#1830). Keyed by
|
|
214
|
+
* entity name (export name), the same key `DiscoveryResult.entities` uses.
|
|
215
|
+
*/
|
|
216
|
+
export declare function collectSecretDeclarations(entities: ReadonlyMap<string, Declarable>): Map<string, SecretDeclaration>;
|
|
217
|
+
export {};
|
|
218
|
+
//# sourceMappingURL=secret-provenance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secret-provenance.d.ts","sourceRoot":"","sources":["../src/secret-provenance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAElE,0CAA0C;AAC1C,MAAM,MAAM,gBAAgB,GACxB,YAAY,GACZ,eAAe,GACf,gBAAgB,GAChB,qBAAqB,CAAC;AAE1B,wDAAwD;AACxD,eAAO,MAAM,uBAAuB,EAAE,SAAS,gBAAgB,EAK9D,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,g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BAAgB,yBAAyB,CACvC,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,GACxC,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAMhC"}
|
package/dist/serializer.d.ts
CHANGED
|
@@ -18,6 +18,17 @@ export interface SerializeContext {
|
|
|
18
18
|
* ad-hoc builds (e.g. context tools) that pass no config.
|
|
19
19
|
*/
|
|
20
20
|
config?: Record<string, unknown>;
|
|
21
|
+
/**
|
|
22
|
+
* Effect receipts (#1832, epic #1703) declared in this lexicon's partition.
|
|
23
|
+
* Withheld from the `entities` map by the build: receipts are observe-only
|
|
24
|
+
* to the generic apply path, and the serialized output is what feeds
|
|
25
|
+
* appliers, so a receipt must never enter the apply-bound document. A
|
|
26
|
+
* serializer that wants to render receipts for visibility (#1835) reads
|
|
27
|
+
* them here and puts them anywhere BUT the section an applier writes from;
|
|
28
|
+
* a serializer that ignores this field emits nothing for them, which is the
|
|
29
|
+
* safe default.
|
|
30
|
+
*/
|
|
31
|
+
receipts?: ReadonlyMap<string, Declarable>;
|
|
21
32
|
}
|
|
22
33
|
/**
|
|
23
34
|
* Result of serialization that may include additional files (e.g. nested stack templates).
|
|
@@ -27,6 +38,24 @@ export interface SerializerResult {
|
|
|
27
38
|
primary: string;
|
|
28
39
|
/** Additional files keyed by filename (e.g. "network.template.json" → content) */
|
|
29
40
|
files?: Record<string, string>;
|
|
41
|
+
/**
|
|
42
|
+
* Basenames from `files` that must reach disk byte-for-byte — never
|
|
43
|
+
* `JSON.parse`d, key-sorted, or reformatted to YAML by the build's
|
|
44
|
+
* additional-file writer (chant#1937).
|
|
45
|
+
*
|
|
46
|
+
* A separate field rather than a per-file flag on `files` (e.g. widening
|
|
47
|
+
* its value to `string | { content: string; verbatim: boolean }`) so every
|
|
48
|
+
* existing lexicon serializer that returns `files: Record<string, string>`
|
|
49
|
+
* keeps compiling and behaving unchanged: this list defaults to empty, and
|
|
50
|
+
* only a serializer that actually carries opaque/pre-formatted bytes
|
|
51
|
+
* (committed ciphertext, a vendored file) needs to populate it.
|
|
52
|
+
*
|
|
53
|
+
* Before this field existed, "JSON.parse fails on this content" was the
|
|
54
|
+
* only way to opt out of round-tripping — true for YAML that happens not to
|
|
55
|
+
* parse as JSON, but never a structural guarantee (YAML is a JSON
|
|
56
|
+
* superset).
|
|
57
|
+
*/
|
|
58
|
+
verbatimFiles?: string[];
|
|
30
59
|
/**
|
|
31
60
|
* Non-fatal diagnostics produced during serialization (e.g. a dialect
|
|
32
61
|
* dropping keys the target platform ignores). The build pipeline collects
|
package/dist/serializer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializer.d.ts","sourceRoot":"","sources":["../src/serializer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,SAAS,CAAC,EAAE,eAAe,CAAC;IAE5B;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"serializer.d.ts","sourceRoot":"","sources":["../src/serializer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,SAAS,CAAC,EAAE,eAAe,CAAC;IAE5B;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEjC;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;CAC5C;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,+BAA+B;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,kFAAkF;IAClF,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B;;;;;;;;;;;;;;;;OAgBG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;;;;;;;;;OAaG;IACH,iBAAiB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAEtC;;;;;OAKG;IACH,SAAS,CACP,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,EACjC,OAAO,CAAC,EAAE,aAAa,EAAE,EACzB,OAAO,CAAC,EAAE,gBAAgB,GACzB,MAAM,GAAG,gBAAgB,CAAC;IAE7B;;;;;OAKG;IACH,iBAAiB,CAAC,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC;CACpD"}
|
package/dist/toml.d.ts
CHANGED
|
@@ -1,9 +1,44 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* TOML
|
|
2
|
+
* Lightweight TOML parser (#446).
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Written for the audit engine's spike: is there a pure, dependency-free way
|
|
5
|
+
* to parse a config format the engine can't read today? TOML fits — it is a
|
|
6
|
+
* fully-specified, static (no macros/interpolation/imports) grammar, so a
|
|
7
|
+
* hand-rolled tokenizer + recursive-descent parser covers it without any
|
|
8
|
+
* runtime surface a Workers sandbox would reject (no `eval`, no native
|
|
9
|
+
* modules, no filesystem/network).
|
|
10
|
+
*
|
|
11
|
+
* Covers the subset of TOML v1.0 that real-world deploy configs
|
|
12
|
+
* (`wrangler.toml`, `Cargo.toml`, `pyproject.toml`, `netlify.toml`) actually
|
|
13
|
+
* use: basic/literal strings (single-line), integers, floats, booleans,
|
|
14
|
+
* arrays (including multi-line), inline tables, dotted keys, standard tables
|
|
15
|
+
* (`[a.b]`), and arrays of tables (`[[a.b]]`).
|
|
16
|
+
*
|
|
17
|
+
* Deliberately NOT a full spec implementation:
|
|
18
|
+
* - Multi-line strings (`"""..."""`, `'''...'''`) are read as a single
|
|
19
|
+
* opaque string body (no line-ending backslash trimming); good enough to
|
|
20
|
+
* not crash, not spec-perfect for continuation whitespace.
|
|
21
|
+
* - Dates/times are returned as their raw source text (a string), not a
|
|
22
|
+
* `Date` — none of the checks built on this parser need calendar math.
|
|
23
|
+
* - A dotted-key path element must be a bare word or a plain quoted string;
|
|
24
|
+
* mixing exotic key shapes mid-path is not supported.
|
|
25
|
+
* These gaps only matter for exotic TOML; they don't affect the shapes the
|
|
26
|
+
* audit checks read (`[vars]`, `[[kv_namespaces]]`, `[env.NAME]`, …).
|
|
27
|
+
*/
|
|
28
|
+
export declare class TomlParseError extends Error {
|
|
29
|
+
}
|
|
30
|
+
type TomlValue = string | number | boolean | TomlValue[] | {
|
|
31
|
+
[k: string]: TomlValue;
|
|
32
|
+
};
|
|
33
|
+
type TomlTable = {
|
|
34
|
+
[k: string]: TomlValue;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Parse a TOML document into a plain nested object. Throws {@link TomlParseError}
|
|
38
|
+
* on malformed input — callers that scan arbitrary repo files should wrap the
|
|
39
|
+
* call in a try/catch (matching the rest of the audit engine's tolerance for
|
|
40
|
+
* unparseable content).
|
|
6
41
|
*/
|
|
7
|
-
export
|
|
8
|
-
export {
|
|
42
|
+
export declare function parseTOML(input: string): TomlTable;
|
|
43
|
+
export {};
|
|
9
44
|
//# sourceMappingURL=toml.d.ts.map
|
package/dist/toml.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toml.d.ts","sourceRoot":"","sources":["../src/toml.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"toml.d.ts","sourceRoot":"","sources":["../src/toml.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,qBAAa,cAAe,SAAQ,KAAK;CAAG;AAqK5C,KAAK,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,EAAE,GAAG;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AACtF,KAAK,SAAS,GAAG;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAgJ5C;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CA8BlD"}
|
package/dist/yaml.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yaml.d.ts","sourceRoot":"","sources":["../src/yaml.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA0BH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAgH/D;AAMD,sCAAsC;AACtC,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CASlE;AAiFD;;GAEG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EAAE,EACf,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GACjB,WAAW,CA8Eb;AA0GD;;GAEG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EAAE,EACf,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GACjB,WAAW,CAqGb;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"yaml.d.ts","sourceRoot":"","sources":["../src/yaml.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA0BH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAgH/D;AAMD,sCAAsC;AACtC,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CASlE;AAiFD;;GAEG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EAAE,EACf,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GACjB,WAAW,CA8Eb;AA0GD;;GAEG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EAAE,EACf,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GACjB,WAAW,CAqGb;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAwBlD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intentius/chant",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.50.0",
|
|
4
4
|
"description": "Declarative infrastructure-as-code toolkit — TypeScript on Node.js",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://intentius.io/chant",
|
|
@@ -91,5 +91,8 @@
|
|
|
91
91
|
"devDependencies": {
|
|
92
92
|
"@cdktf/hcl2json": "^0.21.0",
|
|
93
93
|
"ajv": "^8.20.0"
|
|
94
|
+
},
|
|
95
|
+
"overrides": {
|
|
96
|
+
"esbuild": "^0.28.1"
|
|
94
97
|
}
|
|
95
98
|
}
|
|
@@ -91,7 +91,7 @@ describe("RULE_CATALOG (aggregated: core static + lexicon-contributed, #687)", (
|
|
|
91
91
|
expect(m.remediation.length, `${id} has remediation`).toBeGreaterThan(0);
|
|
92
92
|
expect(["merge-worthy", "report-only"]).toContain(m.tier);
|
|
93
93
|
expect(["deterministic", "guidance"]).toContain(m.fixKind);
|
|
94
|
-
expect(["security", "correctness", "best-practice"], `${id} has a valid category`).toContain(m.category);
|
|
94
|
+
expect(["security", "correctness", "best-practice", "efficiency"], `${id} has a valid category`).toContain(m.category);
|
|
95
95
|
}
|
|
96
96
|
});
|
|
97
97
|
|