@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
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The unobserved gate predicate (#1568): a plan containing unobserved
|
|
3
|
+
* entities must not pass as clean.
|
|
4
|
+
*
|
|
5
|
+
* `buildChangeSet` (./change-set.ts) already refuses to guess when a lexicon
|
|
6
|
+
* could not look (#1089) — entries land as `action: "unobserved"`, carrying a
|
|
7
|
+
* total `unobservedReason` (`read-failed`, `no-credentials`, `no-binding`,
|
|
8
|
+
* `unsupported-kind`, `filtered`; see ../observation.ts). But nothing
|
|
9
|
+
* downstream is *required* to look: a gate that checks lint-clean,
|
|
10
|
+
* owned-only, and a blast-radius budget can walk right past a change set
|
|
11
|
+
* whose live read partially failed and call it clean, because none of those
|
|
12
|
+
* checks reads `unobserved` at all. A gate over an incomplete read is a gate
|
|
13
|
+
* over a guess.
|
|
14
|
+
*
|
|
15
|
+
* This is a reusable predicate, not a runtime — evaluate a `ChangeSet`
|
|
16
|
+
* against a policy and get back a verdict; the caller (a `lint.policies`
|
|
17
|
+
* check routed through `policyGate`, an Op step, #1487's gate-as-fact once it
|
|
18
|
+
* lands) decides what to do with a refusal (throw, diagnostic, a durable
|
|
19
|
+
* gated-run fact). Same instinct #1484 already adopts for `unknown` in the
|
|
20
|
+
* operating loop ("`unknown` never remediates"), surfaced here as something
|
|
21
|
+
* any gate can declare rather than a property of one runtime.
|
|
22
|
+
*/
|
|
23
|
+
import type { ChangeSet } from "./change-set.js";
|
|
24
|
+
import { type UnobservedReason } from "../observation.js";
|
|
25
|
+
/**
|
|
26
|
+
* How the gate treats the change set's unobserved set.
|
|
27
|
+
*
|
|
28
|
+
* - `"refuse"` (the default) — any unobserved entry not covered by `allow`
|
|
29
|
+
* fails the gate outright. Fail-closed, the right default for a policy set
|
|
30
|
+
* aimed at agent-proposed change sets: a hole must never launder into a
|
|
31
|
+
* clean verdict just because nobody configured otherwise.
|
|
32
|
+
* - `"escalate"` — the gate does not fail here; instead the verdict reports
|
|
33
|
+
* `escalate: true` so a caller can route the plan to a stricter gate class
|
|
34
|
+
* rather than the ordinary path (the same shape of routing decision #1569
|
|
35
|
+
* makes for pipeline changes).
|
|
36
|
+
* - `{ allow: [...] }` — the listed reasons are tolerated (e.g. `"filtered"`,
|
|
37
|
+
* intentional in a scoped run) and never fail or escalate the gate; any
|
|
38
|
+
* reason NOT in the list still refuses. `no-credentials` — a hole that must
|
|
39
|
+
* never launder into a clean verdict — should never appear in an `allow`
|
|
40
|
+
* list for a policy aimed at agent-proposed change sets.
|
|
41
|
+
*/
|
|
42
|
+
export type UnobservedGatePolicy = "refuse" | "escalate" | {
|
|
43
|
+
allow: UnobservedReason[];
|
|
44
|
+
};
|
|
45
|
+
/** One unobserved hole the gate found, carried into the refusal. */
|
|
46
|
+
export interface UnobservedGateFinding {
|
|
47
|
+
name: string;
|
|
48
|
+
type?: string;
|
|
49
|
+
reason: UnobservedReason;
|
|
50
|
+
detail?: string;
|
|
51
|
+
}
|
|
52
|
+
export interface UnobservedGateVerdict {
|
|
53
|
+
/** False when the policy is `"refuse"` (default) and an unallowed unobserved entry exists. */
|
|
54
|
+
pass: boolean;
|
|
55
|
+
/** True when the policy is `"escalate"` and an unallowed unobserved entry exists — route to a stricter gate instead of failing here. */
|
|
56
|
+
escalate: boolean;
|
|
57
|
+
/** Every unobserved entry the policy did not allow. Empty when `pass` is true and `escalate` is false. */
|
|
58
|
+
findings: UnobservedGateFinding[];
|
|
59
|
+
/** Human-readable summary carrying the reasons into a refusal — the message a caller can surface as-is. Undefined when `findings` is empty. */
|
|
60
|
+
detail?: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Evaluate a `ChangeSet`'s unobserved set against `policy`. Pure — reads only
|
|
64
|
+
* `cs.entries`, no I/O. Defaults to `"refuse"`.
|
|
65
|
+
*/
|
|
66
|
+
export declare function evaluateUnobservedGate(cs: ChangeSet, policy?: UnobservedGatePolicy): UnobservedGateVerdict;
|
|
67
|
+
//# sourceMappingURL=unobserved-gate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unobserved-gate.d.ts","sourceRoot":"","sources":["../../src/lifecycle/unobserved-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAwB,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAE7E;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GAAG,UAAU,GAAG;IAAE,KAAK,EAAE,gBAAgB,EAAE,CAAA;CAAE,CAAC;AAEzF,oEAAoE;AACpE,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,gBAAgB,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,qBAAqB;IACpC,8FAA8F;IAC9F,IAAI,EAAE,OAAO,CAAC;IACd,wIAAwI;IACxI,QAAQ,EAAE,OAAO,CAAC;IAClB,0GAA0G;IAC1G,QAAQ,EAAE,qBAAqB,EAAE,CAAC;IAClC,+IAA+I;IAC/I,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,EAAE,EAAE,SAAS,EACb,MAAM,GAAE,oBAA+B,GACtC,qBAAqB,CA+BvB"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { PostSynthCheck } from "./post-synth.js";
|
|
2
|
+
import type { OkfBundle } from "../okf-read.js";
|
|
3
|
+
/**
|
|
4
|
+
* COR026: Stale Knowledge Binding (#1865, design #1059, epic #1057)
|
|
5
|
+
*
|
|
6
|
+
* A concept's `binds` frontmatter key names a discovered entity's logical
|
|
7
|
+
* name (#1864, `../okf-read.ts`'s `bindConcepts`). A name that resolves to
|
|
8
|
+
* nothing is a stale binding — the entity was renamed or removed, or the
|
|
9
|
+
* concept was authored against a name that never existed — and per #1059's
|
|
10
|
+
* stated failure posture ("the spec permits broken links, which argues for
|
|
11
|
+
* warn") that is a warning, never a build failure: knowledge is deliberately
|
|
12
|
+
* softer than the typed graph it describes, and OKF itself tolerates broken
|
|
13
|
+
* links (epic #1057).
|
|
14
|
+
*
|
|
15
|
+
* The converse is deliberately silent: a concept with no `binds` at all is
|
|
16
|
+
* orphaned knowledge, not an omission (a runbook, a decision about the
|
|
17
|
+
* project as a whole), and `bindConcepts` never reports it as unresolved in
|
|
18
|
+
* the first place — see its own doc comment. A project with no knowledge
|
|
19
|
+
* bundle loads an empty one (`loadOkfBundle`), so this check produces no
|
|
20
|
+
* diagnostics either.
|
|
21
|
+
*
|
|
22
|
+
* Wired into `chant build` (`../cli/commands/build.ts`) alongside
|
|
23
|
+
* `coreReceiptChecks` — same reasons COR023/COR024 are build-owned rather
|
|
24
|
+
* than a per-file `LintRule`: the check needs the full discovered entity map
|
|
25
|
+
* (`ctx.entities`), not one `ts.SourceFile`, and that map only exists after
|
|
26
|
+
* discovery has run. Unlike COR023/024 it never reads `ctx.outputs` — the
|
|
27
|
+
* bundle is loaded once, up front (async — `loadOkfBundle` reads the
|
|
28
|
+
* filesystem), and closed over here so the check itself stays the same sync
|
|
29
|
+
* shape every other `PostSynthCheck` has.
|
|
30
|
+
*/
|
|
31
|
+
export declare const STALE_KNOWLEDGE_BINDING_CHECK_ID = "COR026";
|
|
32
|
+
/**
|
|
33
|
+
* Build the COR026 check for one loaded bundle. A factory, not a bare
|
|
34
|
+
* constant, because — unlike `coreReceiptChecks`, which needs nothing but
|
|
35
|
+
* `ctx.entities` — this check needs the bundle loaded from disk, and
|
|
36
|
+
* `loadOkfBundle` is async while `PostSynthCheck#check` is not. The caller
|
|
37
|
+
* loads the bundle once (`resolveKnowledgeDir` + `loadOkfBundle`) and passes
|
|
38
|
+
* it in; see `../cli/commands/build.ts`.
|
|
39
|
+
*/
|
|
40
|
+
export declare function staleKnowledgeBindingCheck(bundle: OkfBundle): PostSynthCheck;
|
|
41
|
+
/**
|
|
42
|
+
* Core's own post-synth check over knowledge bindings, run by `chant build`
|
|
43
|
+
* over the full build result — unscoped, like `coreReceiptChecks`, since a
|
|
44
|
+
* concept's `binds` can name any discovered entity regardless of which
|
|
45
|
+
* lexicon owns it.
|
|
46
|
+
*/
|
|
47
|
+
export declare function coreKnowledgeChecks(bundle: OkfBundle): PostSynthCheck[];
|
|
48
|
+
//# sourceMappingURL=knowledge-checks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge-checks.d.ts","sourceRoot":"","sources":["../../src/lint/knowledge-checks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAuB,MAAM,cAAc,CAAC;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAG7C;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,eAAO,MAAM,gCAAgC,WAAW,CAAC;AAEzD;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,SAAS,GAAG,cAAc,CAoB5E;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,GAAG,cAAc,EAAE,CAEvE"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { PostSynthCheck } from "./post-synth.js";
|
|
2
|
+
export declare const STRINGIFIED_REFERENCE_CHECK_ID = "COR025";
|
|
3
|
+
/** Core-owned post-synth checks over serialized output text (#1526). */
|
|
4
|
+
export declare function coreOutputChecks(): PostSynthCheck[];
|
|
5
|
+
//# sourceMappingURL=output-checks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output-checks.d.ts","sourceRoot":"","sources":["../../src/lint/output-checks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAuB,MAAM,cAAc,CAAC;AAoCxE,eAAO,MAAM,8BAA8B,WAAW,CAAC;AA0DvD,wEAAwE;AACxE,wBAAgB,gBAAgB,IAAI,cAAc,EAAE,CAEnD"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parsed-output view for post-synth checks (chant #975).
|
|
3
|
+
*
|
|
4
|
+
* `PostSynthContext.outputs` carries raw serialized strings — a `chant build`
|
|
5
|
+
* consumer has to parse YAML/JSON itself before it can reason about
|
|
6
|
+
* structure. Every lexicon that needs this today rolls its own splitter
|
|
7
|
+
* (`parseK8sManifests` in k8s, hand-rolled `JSON.parse` in aws's
|
|
8
|
+
* `cf-refs.ts`), and each of the ~30 k8s post-synth checks reparses the same
|
|
9
|
+
* output independently. This module is the shared, parse-once primitive:
|
|
10
|
+
* `parseOutputDocs` turns `ctx.outputs` into a flat list of `OutputDoc`s,
|
|
11
|
+
* and `PostSynthContext.docs` (see `./post-synth.ts`) memoizes one call to it
|
|
12
|
+
* per build so every check — lexicon-shipped or project-authored policy —
|
|
13
|
+
* shares the same parse.
|
|
14
|
+
*
|
|
15
|
+
* `pick`/`get` are the "look at only the fields you care about" ergonomic
|
|
16
|
+
* from the issue's `,remain`-style framing — a partial, unvalidated view of
|
|
17
|
+
* an already-parsed tree, not a query DSL. Selector languages over the
|
|
18
|
+
* *source* AST stay in `./declarative.ts`; this module is output-side only.
|
|
19
|
+
*/
|
|
20
|
+
import type { SerializerResult } from "../serializer.js";
|
|
21
|
+
/**
|
|
22
|
+
* One parsed document from a build's serialized output.
|
|
23
|
+
*
|
|
24
|
+
* A single `ctx.outputs` entry can yield more than one `OutputDoc`: a
|
|
25
|
+
* multi-document YAML stream (`---`-separated) yields one per document, and
|
|
26
|
+
* a `SerializerResult` with `files` yields further docs for each nested
|
|
27
|
+
* file (a CloudFormation nested stack template, a sidecar manifest).
|
|
28
|
+
*/
|
|
29
|
+
export interface OutputDoc {
|
|
30
|
+
/** The `ctx.outputs` map key this document came from. */
|
|
31
|
+
lexicon: string;
|
|
32
|
+
/** Position of this document within its source (primary output or one
|
|
33
|
+
* `files` entry) — 0 for a single-document source, 0..n-1 for a
|
|
34
|
+
* multi-document YAML stream. */
|
|
35
|
+
index: number;
|
|
36
|
+
/** Whether this document was decoded as YAML or as whole-content JSON. */
|
|
37
|
+
format: "yaml" | "json";
|
|
38
|
+
/** The parsed tree. `undefined` when parsing failed — see `error`. */
|
|
39
|
+
value: unknown;
|
|
40
|
+
/**
|
|
41
|
+
* Set when this document came from a `SerializerResult.files` entry rather
|
|
42
|
+
* than the primary output — the file's key in that map (e.g. a nested
|
|
43
|
+
* stack template's filename).
|
|
44
|
+
*/
|
|
45
|
+
file?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Set when this document could not be parsed into a usable tree. The
|
|
48
|
+
* document is still returned (a marker, not a throw) so a caller can see
|
|
49
|
+
* that something in the build output failed to parse, rather than the
|
|
50
|
+
* failure disappearing silently the way `parseK8sManifests` has always
|
|
51
|
+
* swallowed it. `value` is `undefined` on an errored document. Filter with
|
|
52
|
+
* `ctx.docs.filter((d) => !d.error)` to get only usable documents.
|
|
53
|
+
*/
|
|
54
|
+
error?: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Parse every output in `outputs` into a flat list of `OutputDoc`s: one call,
|
|
58
|
+
* shared by every post-synth check via `PostSynthContext.docs`.
|
|
59
|
+
*
|
|
60
|
+
* Format detection is whole-source, not per-document: if the entire source
|
|
61
|
+
* parses as JSON, it is one `"json"` document (CloudFormation, most non-k8s
|
|
62
|
+
* serializers). Otherwise the source is treated as a YAML stream — split on
|
|
63
|
+
* `---` document separators — and each resulting document is parsed as YAML
|
|
64
|
+
* (`format: "yaml"`), even one that happens to also be valid JSON, since
|
|
65
|
+
* JSON is a YAML subset. `SerializerResult.files` entries (nested templates,
|
|
66
|
+
* sidecar manifests) are parsed the same way, tagged with `file`.
|
|
67
|
+
*
|
|
68
|
+
* A document that fails to parse into a non-null object/array — malformed
|
|
69
|
+
* input, or a bare scalar where a manifest was expected — is not thrown:
|
|
70
|
+
* it is included with `error` set and `value: undefined`. See `OutputDoc`.
|
|
71
|
+
*/
|
|
72
|
+
export declare function parseOutputDocs(outputs: Map<string, string | SerializerResult>): OutputDoc[];
|
|
73
|
+
/**
|
|
74
|
+
* Partial typed decode — the `,remain`-style ergonomic from `ma91n/tfpolicy`:
|
|
75
|
+
* decode the fields you care about, leave everything else in place,
|
|
76
|
+
* unvalidated. Returns a shallow, top-level view of `value` narrowed to the
|
|
77
|
+
* keys named in `shape`. A key absent from `value` (or `value` not being a
|
|
78
|
+
* plain object) is simply absent from the result — no default is invented.
|
|
79
|
+
*
|
|
80
|
+
* This is NOT runtime validation: a key that IS present is copied as-is,
|
|
81
|
+
* whatever its actual shape, and cast to `T`'s declared type for that key.
|
|
82
|
+
* Use `get` for a deeper walk into one of the picked values.
|
|
83
|
+
*/
|
|
84
|
+
export declare function pick<T extends object>(value: unknown, shape: (keyof T)[]): Partial<T>;
|
|
85
|
+
/**
|
|
86
|
+
* Dotted-path getter for the common walk over a parsed doc, e.g.
|
|
87
|
+
* `get(doc.value, "spec.template.spec")`. Not a query DSL — no wildcards,
|
|
88
|
+
* no predicates, no array-flattening. An array index is just a numeric path
|
|
89
|
+
* segment (`get(value, "items.0.name")`), since JS indexes arrays by string
|
|
90
|
+
* key underneath. Returns `undefined` as soon as any segment is missing or
|
|
91
|
+
* the value at that point isn't indexable — it never throws on a bad path.
|
|
92
|
+
*/
|
|
93
|
+
export declare function get(value: unknown, path: string): unknown;
|
|
94
|
+
//# sourceMappingURL=output-docs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output-docs.d.ts","sourceRoot":"","sources":["../../src/lint/output-docs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGtD;;;;;;;GAOG;AACH,MAAM,WAAW,SAAS;IACxB,yDAAyD;IACzD,OAAO,EAAE,MAAM,CAAC;IAChB;;sCAEkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,sEAAsE;IACtE,KAAK,EAAE,OAAO,CAAC;IACf;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,CAAC,GAAG,SAAS,EAAE,CAY5F;AA4ED;;;;;;;;;;GAUG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,CAWrF;AAED;;;;;;;GAOG;AACH,wBAAgB,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAQzD"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pipeline-change gate class (#1569): changes to the pipeline itself
|
|
3
|
+
* route to a stricter gate.
|
|
4
|
+
*
|
|
5
|
+
* The honest concession in the PR-flow teardown (rubric-product-research,
|
|
6
|
+
* 06-objections §1): chant Ops have a `shell` step, so a governed plane is
|
|
7
|
+
* not automatically immune to "the change edits the machinery that applies
|
|
8
|
+
* changes." What chant *can* claim — and a plain PR flow structurally cannot
|
|
9
|
+
* — is that pipeline changes are distinguishable: a composition is data over
|
|
10
|
+
* a bounded verb registry, and the COMP rules already police the escape
|
|
11
|
+
* hatches (COMP006 — every `shell` step carries a declared reason;
|
|
12
|
+
* COMP005 — no noun-shaped escape hatches, `./rules/comp/`). What was missing
|
|
13
|
+
* was the routing: nothing classified a change as "touches the pipeline" and
|
|
14
|
+
* required a stricter gate for it, so a change to a composition rode through
|
|
15
|
+
* the same gate as a replica-count bump.
|
|
16
|
+
*
|
|
17
|
+
* This is the cheap first cut #1569 asks for: the registry-only predicate.
|
|
18
|
+
* A composition that contains only registry verbs is ordinary; a `shell`
|
|
19
|
+
* step (the deliberate escape hatch) or a change to the set of verbs a
|
|
20
|
+
* composition invokes trips the stricter class. comp005/comp006 already make
|
|
21
|
+
* both decidable from the text — this module reuses the same walk
|
|
22
|
+
* (`./rules/comp/support.ts`) rather than re-deriving it.
|
|
23
|
+
*
|
|
24
|
+
* Like #1568's `evaluateUnobservedGate`
|
|
25
|
+
* (../lifecycle/unobserved-gate.ts), this is a reusable predicate, not a
|
|
26
|
+
* runtime: classify a change and get back a verdict; the caller (a
|
|
27
|
+
* `lint.policies` check routed through `policyGate`, an Op step, #1487's
|
|
28
|
+
* gate-as-fact once it lands) decides what "stricter" means in its own
|
|
29
|
+
* context. The stricter class composes with #1487's principle that
|
|
30
|
+
* destructive verbs always wait for a person — pipeline changes are the
|
|
31
|
+
* second category that should never free-run, because they change what
|
|
32
|
+
* "gated" means for everything after them. That is why the default policy
|
|
33
|
+
* below is `"human-always"`, not `"stricter-gate"`.
|
|
34
|
+
*/
|
|
35
|
+
import type { Component } from "../components/component.js";
|
|
36
|
+
/** Why a composition (or a change to one) tripped the pipeline-change class. */
|
|
37
|
+
export type PipelineChangeReason = {
|
|
38
|
+
kind: "shell-step";
|
|
39
|
+
phaseName: string;
|
|
40
|
+
} | {
|
|
41
|
+
kind: "unregistered-verb";
|
|
42
|
+
stepKind: string;
|
|
43
|
+
phaseName: string;
|
|
44
|
+
} | {
|
|
45
|
+
kind: "verb-set-changed";
|
|
46
|
+
added: string[];
|
|
47
|
+
removed: string[];
|
|
48
|
+
};
|
|
49
|
+
export interface PipelineChangeClassification {
|
|
50
|
+
/** True when any reason below applies. */
|
|
51
|
+
pipelineChange: boolean;
|
|
52
|
+
reasons: PipelineChangeReason[];
|
|
53
|
+
}
|
|
54
|
+
/** Every non-gate step kind a component's composition invokes, across `deploy` and `rollback` (nested fan-out phases included, via `walkComponent`). `gate` steps are excluded — they are not a capability verb. */
|
|
55
|
+
export declare function componentVerbSet(component: Component): Set<string>;
|
|
56
|
+
/**
|
|
57
|
+
* Classify a single component's composition (the "cheap first cut", no
|
|
58
|
+
* before/after needed): a `shell` step trips the class unconditionally — it
|
|
59
|
+
* is the escape hatch by construction (COMP006) — and any step whose `kind`
|
|
60
|
+
* is outside `knownKinds` trips it too, since an unregistered verb is,
|
|
61
|
+
* structurally, the same kind of hole a `shell` step is: something the
|
|
62
|
+
* bounded registry does not account for.
|
|
63
|
+
*/
|
|
64
|
+
export declare function classifyComponentPipelineChange(component: Component, opts?: {
|
|
65
|
+
knownKinds?: ReadonlySet<string>;
|
|
66
|
+
}): PipelineChangeClassification;
|
|
67
|
+
/**
|
|
68
|
+
* Classify a *change* to a component's composition between two revisions
|
|
69
|
+
* (#1569's "add or modify a shell step ... or the composition graph
|
|
70
|
+
* itself"): on top of `classifyComponentPipelineChange`'s single-composition
|
|
71
|
+
* check on `after`, a change also trips the class when the verb set itself
|
|
72
|
+
* changed — a verb added or removed changes what the composition can invoke,
|
|
73
|
+
* which is the routing signal even when every individual verb, before and
|
|
74
|
+
* after, is registry-clean. `before: undefined` (a brand-new component) never
|
|
75
|
+
* reports a verb-set change — there is nothing to diff against, and the
|
|
76
|
+
* single-composition check already covers a new component's own shell/
|
|
77
|
+
* unregistered-verb findings.
|
|
78
|
+
*/
|
|
79
|
+
export declare function classifyPipelineChange(before: Component | undefined, after: Component, opts?: {
|
|
80
|
+
knownKinds?: ReadonlySet<string>;
|
|
81
|
+
}): PipelineChangeClassification;
|
|
82
|
+
/**
|
|
83
|
+
* How the gate routes a classified pipeline change.
|
|
84
|
+
*
|
|
85
|
+
* - `"human-always"` (the recommended default — see this module's doc
|
|
86
|
+
* comment) — a pipeline change never free-runs, mirroring #1487's "a
|
|
87
|
+
* destructive verb always waits for a person."
|
|
88
|
+
* - `"stricter-gate"` — route to a named stricter gate class rather than
|
|
89
|
+
* requiring a person on every run; the caller supplies what "stricter"
|
|
90
|
+
* means (an additional approval, a narrower blast-radius budget, ...).
|
|
91
|
+
*/
|
|
92
|
+
export type PipelineChangeGatePolicy = "stricter-gate" | "human-always";
|
|
93
|
+
export interface PipelineChangeGateVerdict extends PipelineChangeClassification {
|
|
94
|
+
/** What the policy says to do about it. `"none"` when the change is not a pipeline change at all. */
|
|
95
|
+
route: PipelineChangeGatePolicy | "none";
|
|
96
|
+
}
|
|
97
|
+
/** Evaluate a component composition change against a routing policy. Pure — no I/O. */
|
|
98
|
+
export declare function evaluatePipelineChangeGate(before: Component | undefined, after: Component, policy?: PipelineChangeGatePolicy, opts?: {
|
|
99
|
+
knownKinds?: ReadonlySet<string>;
|
|
100
|
+
}): PipelineChangeGateVerdict;
|
|
101
|
+
//# sourceMappingURL=pipeline-change-gate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline-change-gate.d.ts","sourceRoot":"","sources":["../../src/lint/pipeline-change-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAczD,gFAAgF;AAChF,MAAM,MAAM,oBAAoB,GAC5B;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GACzC;IAAE,IAAI,EAAE,mBAAmB,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAClE;IAAE,IAAI,EAAE,kBAAkB,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAErE,MAAM,WAAW,4BAA4B;IAC3C,0CAA0C;IAC1C,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,oBAAoB,EAAE,CAAC;CACjC;AAED,oNAAoN;AACpN,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC,CAGlE;AAED;;;;;;;GAOG;AACH,wBAAgB,+BAA+B,CAC7C,SAAS,EAAE,SAAS,EACpB,IAAI,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CAAE,GAC1C,4BAA4B,CAc9B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,SAAS,GAAG,SAAS,EAC7B,KAAK,EAAE,SAAS,EAChB,IAAI,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CAAE,GAC1C,4BAA4B,CAe9B;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,wBAAwB,GAAG,eAAe,GAAG,cAAc,CAAC;AAExE,MAAM,WAAW,yBAA0B,SAAQ,4BAA4B;IAC7E,qGAAqG;IACrG,KAAK,EAAE,wBAAwB,GAAG,MAAM,CAAC;CAC1C;AAED,uFAAuF;AACvF,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,SAAS,GAAG,SAAS,EAC7B,KAAK,EAAE,SAAS,EAChB,MAAM,GAAE,wBAAyC,EACjD,IAAI,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CAAE,GAC1C,yBAAyB,CAG3B"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { Declarable } from "../declarable.js";
|
|
2
2
|
import type { SerializerResult } from "../serializer.js";
|
|
3
3
|
import type { Severity } from "./rule.js";
|
|
4
|
+
import { type OutputDoc } from "./output-docs.js";
|
|
5
|
+
export { parseOutputDocs, pick, get, type OutputDoc } from "./output-docs.js";
|
|
4
6
|
/**
|
|
5
7
|
* Context provided to post-synthesis checks.
|
|
6
8
|
*/
|
|
@@ -15,6 +17,25 @@ export interface PostSynthContext {
|
|
|
15
17
|
* e.g. "no public buckets in prod". Undefined when no environment is set.
|
|
16
18
|
*/
|
|
17
19
|
env?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Parsed output documents (chant #975) — `ctx.outputs` run through
|
|
22
|
+
* `parseOutputDocs` once and cached. A lazy `readonly` getter, not a plain
|
|
23
|
+
* field: computed on first access and shared across every check in the
|
|
24
|
+
* run, so a check that only reads `entities` pays nothing, and no two
|
|
25
|
+
* checks re-parse the same YAML/JSON. See `./output-docs.ts`.
|
|
26
|
+
*
|
|
27
|
+
* Optional at the type level — NOT because it can be absent from a real
|
|
28
|
+
* build. Every context chant itself constructs (`runPostSynthChecks`
|
|
29
|
+
* below, `@intentius/chant-test-utils`'s `createPostSynthContext` and
|
|
30
|
+
* `makePostSynthCtx*`) wires it up via `createDocsAccessor` and it is
|
|
31
|
+
* always present there. It is typed optional only so the many lexicon
|
|
32
|
+
* tests that build a `PostSynthContext` object literal by hand (predating
|
|
33
|
+
* this field) keep compiling unchanged, per this issue's own "existing
|
|
34
|
+
* checks compile unchanged" constraint — a new check that wants `ctx.docs`
|
|
35
|
+
* should still get a real array from every context chant builds; guard
|
|
36
|
+
* with `ctx.docs ?? []` only when a context's provenance is unknown.
|
|
37
|
+
*/
|
|
38
|
+
readonly docs?: OutputDoc[];
|
|
18
39
|
/** Raw build result object */
|
|
19
40
|
buildResult: {
|
|
20
41
|
outputs: Map<string, string | SerializerResult>;
|
|
@@ -27,10 +48,30 @@ export interface PostSynthContext {
|
|
|
27
48
|
sourceFileCount: number;
|
|
28
49
|
};
|
|
29
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* Build the lazy, memoized `docs` accessor shared by `runPostSynthChecks`
|
|
53
|
+
* (below) and `@intentius/chant-test-utils`'s `createPostSynthContext` — the
|
|
54
|
+
* two places a `PostSynthContext` gets constructed. Returns a zero-arg
|
|
55
|
+
* function suitable for a `get docs()` object-literal accessor; the first
|
|
56
|
+
* call parses, every later call returns the same cached array.
|
|
57
|
+
*/
|
|
58
|
+
export declare function createDocsAccessor(outputs: Map<string, string | SerializerResult>): () => OutputDoc[];
|
|
30
59
|
/**
|
|
31
60
|
* Extract the primary content string from a serializer output.
|
|
32
61
|
*/
|
|
33
62
|
export declare function getPrimaryOutput(output: string | SerializerResult): string;
|
|
63
|
+
/**
|
|
64
|
+
* Extract the ADDITIONAL files from a serializer output — everything
|
|
65
|
+
* {@link getPrimaryOutput} discards.
|
|
66
|
+
*
|
|
67
|
+
* Every post-synth check shipped before this one reads the primary output
|
|
68
|
+
* only, which means a sidecar file (a nested stack template, committed SOPS
|
|
69
|
+
* ciphertext) is invisible to all of them. That is the right default — the
|
|
70
|
+
* primary output is what appliers read — but a rule ABOUT a sidecar has to
|
|
71
|
+
* be able to see it, and `PostSynthContext.outputs` has carried the data all
|
|
72
|
+
* along. WK8504 (k8s) is the first caller.
|
|
73
|
+
*/
|
|
74
|
+
export declare function getAdditionalFiles(output: string | SerializerResult): Record<string, string>;
|
|
34
75
|
/**
|
|
35
76
|
* A diagnostic from a post-synthesis check.
|
|
36
77
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post-synth.d.ts","sourceRoot":"","sources":["../../src/lint/post-synth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"post-synth.d.ts","sourceRoot":"","sources":["../../src/lint/post-synth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AA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AkB,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAE5F;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,mBAAmB;IAClC,oDAAoD;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB,qBAAqB;IACrB,QAAQ,EAAE,QAAQ,CAAC;IACnB,6BAA6B;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kDAAkD;IAClD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,iCAAiC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,+CAA+C;IAC/C,KAAK,CAAC,GAAG,EAAE,gBAAgB,GAAG,mBAAmB,EAAE,CAAC;CACrD;AAED,8EAA8E;AAC9E,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAQxE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,cAAc,EAAE,EACxB,WAAW,EAAE,gBAAgB,CAAC,aAAa,CAAC,EAC5C,GAAG,CAAC,EAAE,MAAM,GACX,mBAAmB,EAAE,CAiBvB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { PostSynthCheck } from "./post-synth.js";
|
|
2
|
+
export declare const RECEIPT_PLAIN_STORE_CHECK_ID = "COR023";
|
|
3
|
+
/**
|
|
4
|
+
* Core's own post-synth checks over effect receipts, run by `chant build`
|
|
5
|
+
* over the full build result (plugin checks are lexicon-scoped; receipts are
|
|
6
|
+
* recognized by marker, so this set is deliberately not).
|
|
7
|
+
*/
|
|
8
|
+
export declare function coreReceiptChecks(): PostSynthCheck[];
|
|
9
|
+
//# sourceMappingURL=receipt-checks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"receipt-checks.d.ts","sourceRoot":"","sources":["../../src/lint/receipt-checks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAuB,MAAM,cAAc,CAAC;AAqCxE,eAAO,MAAM,4BAA4B,WAAW,CAAC;AAgDrD;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,cAAc,EAAE,CAEpD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Component } from "../../../../../../components/component.js";
|
|
2
|
+
/**
|
|
3
|
+
* COMP003 pass case (#1944): a bare "run-agent" step with no "noRollback"
|
|
4
|
+
* opt-out and no component-level "rollback" — must pass COMP003 because
|
|
5
|
+
* "run-agent"'s rollbackPolicy is "native" (#1941), not "needs-opt-out". This
|
|
6
|
+
* is the regression test proving the registry's declared rollbackPolicy for
|
|
7
|
+
* "run-agent" is wired correctly into ctx.rollbackPolicies, the same seam
|
|
8
|
+
* COMP005 uses for ctx.knownKinds — see comp.test.ts's FIXTURE_ROLLBACK_POLICIES.
|
|
9
|
+
*/
|
|
10
|
+
export declare const agentTurn: Component;
|
|
11
|
+
//# sourceMappingURL=agent-turn.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-turn.component.d.ts","sourceRoot":"","sources":["../../../../../../../src/lint/rules/__fixtures__/comp/comp003/pass/agent-turn.component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AAGxE;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS,EAAE,SAcvB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as ts from "typescript";
|
|
2
|
+
import type { LintRule } from "../rule.js";
|
|
3
|
+
/** A variable declaration's `EffectReceipt(...)` initializer, if that is what it is. */
|
|
4
|
+
export declare function receiptFactoryCall(decl: ts.VariableDeclaration): ts.CallExpression | undefined;
|
|
5
|
+
/**
|
|
6
|
+
* Every variable name bound to an effect receipt in this file: direct
|
|
7
|
+
* `EffectReceipt(...)` initializers plus identifier aliases, resolved to a
|
|
8
|
+
* fixpoint so declaration order does not matter. Scope-naive by design, the
|
|
9
|
+
* same trade COR011 makes — a chant source file is flat declarations.
|
|
10
|
+
*/
|
|
11
|
+
export declare function collectReceiptVariables(sourceFile: ts.SourceFile): Set<string>;
|
|
12
|
+
export declare const cor022ReceiptLeafRule: LintRule;
|
|
13
|
+
//# sourceMappingURL=cor022-receipt-leaf.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cor022-receipt-leaf.d.ts","sourceRoot":"","sources":["../../../src/lint/rules/cor022-receipt-leaf.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,KAAK,EAAE,QAAQ,EAA+B,MAAM,SAAS,CAAC;AAsCrE,wFAAwF;AACxF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,EAAE,CAAC,mBAAmB,GAAG,EAAE,CAAC,cAAc,GAAG,SAAS,CAG9F;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC,CA2B9E;AASD,eAAO,MAAM,qBAAqB,EAAE,QA0CnC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cor024-receipt-secret-pointer.d.ts","sourceRoot":"","sources":["../../../src/lint/rules/cor024-receipt-secret-pointer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAA+B,MAAM,SAAS,CAAC;AA2IrE,eAAO,MAAM,8BAA8B,EAAE,QA6E5C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evl001-non-literal-expression.d.ts","sourceRoot":"","sources":["../../../src/lint/rules/evl001-non-literal-expression.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAA+B,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"evl001-non-literal-expression.d.ts","sourceRoot":"","sources":["../../../src/lint/rules/evl001-non-literal-expression.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAA+B,MAAM,SAAS,CAAC;AA6DrE,eAAO,MAAM,8BAA8B,EAAE,QAU5C,CAAC"}
|
|
@@ -24,9 +24,11 @@ export { evl010CompositeNoTransformRule } from "./evl010-composite-no-transform.
|
|
|
24
24
|
export { cor017CompositeNameMatchRule } from "./cor017-composite-name-match.js";
|
|
25
25
|
export { cor018CompositePreferLexiconTypeRule } from "./cor018-composite-prefer-lexicon-type.js";
|
|
26
26
|
export { cor021EnvLiteralNameRule } from "./cor021-env-literal-name.js";
|
|
27
|
+
export { cor022ReceiptLeafRule, collectReceiptVariables, receiptFactoryCall } from "./cor022-receipt-leaf.js";
|
|
28
|
+
export { cor024ReceiptSecretPointerRule } from "./cor024-receipt-secret-pointer.js";
|
|
27
29
|
export { isInsideCompositeFactory } from "./composite-scope.js";
|
|
28
30
|
/**
|
|
29
|
-
* Load all
|
|
31
|
+
* Load all 24 core lint rules (COR + EVL).
|
|
30
32
|
*/
|
|
31
33
|
export declare function loadCoreRules(): LintRule[];
|
|
32
34
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lint/rules/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAA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F,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AA2B7D;;GAEG;AACH,wBAAgB,aAAa,IAAI,QAAQ,EAAE,CA2B1C"}
|
|
@@ -16,6 +16,13 @@ export interface LexiconEntry {
|
|
|
16
16
|
writeOnly?: string[];
|
|
17
17
|
primaryIdentifier?: string[];
|
|
18
18
|
deprecatedProperties?: string[];
|
|
19
|
+
/**
|
|
20
|
+
* Subset of `deprecatedProperties` that only prose supports — a lexicon
|
|
21
|
+
* generator matched the property description against a deprecation regex
|
|
22
|
+
* rather than reading an upstream declaration (#1701). Editors do not strike
|
|
23
|
+
* these through; the basis is too weak to mark a property dead.
|
|
24
|
+
*/
|
|
25
|
+
inferredDeprecations?: string[];
|
|
19
26
|
conditionalCreateOnly?: string[];
|
|
20
27
|
replacementStrategy?: "delete_then_create" | "create_then_delete";
|
|
21
28
|
tagging?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lexicon-providers.d.ts","sourceRoot":"","sources":["../../src/lsp/lexicon-providers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAI1F,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,UAAU,GAAG,UAAU,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9C,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,qBAAqB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
1
|
+
import type { Declarable } from "./declarable.js";
|
|
2
|
+
/**
|
|
3
|
+
* One authored concept document, parsed from a bundle. Deliberately thinner
|
|
4
|
+
* than the emit side's internal `Concept` (`./okf.ts`) — this is what a
|
|
5
|
+
* *reader* trusts, and per the #1059 design that is `type`/`title` plus the
|
|
6
|
+
* single frontmatter key chant interprets, `binds`. Everything else an
|
|
7
|
+
* author wrote rides along in {@link frontmatter} unexamined, so a consumer
|
|
8
|
+
* that needs a project-specific key (a future `category`, say) can still
|
|
9
|
+
* reach it without a reader change.
|
|
10
|
+
*/
|
|
11
|
+
export interface OkfConcept {
|
|
12
|
+
/** Bundle-relative path (forward-slash separated), e.g. "decisions/public-assets.md". */
|
|
13
|
+
path: string;
|
|
14
|
+
/** The frontmatter `type`. May be empty — the reader never rejects a concept for it, unlike the emitter's conformance check. */
|
|
15
|
+
type: string;
|
|
16
|
+
/** Frontmatter `title`, when the author set one. */
|
|
17
|
+
title?: string;
|
|
18
|
+
/**
|
|
19
|
+
* This concept's `binds` frontmatter key, normalized to a list — one name,
|
|
20
|
+
* several, or `[]` for "declared no binding, and that's legitimate."
|
|
21
|
+
* Structural-looking keys (`name`, `lexicon`, `kind`) are deliberately
|
|
22
|
+
* *not* surfaced here or anywhere else on this type: the reader interprets
|
|
23
|
+
* exactly `binds` (#1059's precedence-by-construction), so authored and
|
|
24
|
+
* inferred knowledge cannot conflict at the fact level.
|
|
25
|
+
*/
|
|
26
|
+
binds: string[];
|
|
27
|
+
/** Every frontmatter key this concept's document carries, `binds` included, verbatim. */
|
|
28
|
+
frontmatter: Record<string, unknown>;
|
|
29
|
+
/** Markdown body (everything after the closing `---`), unchanged. */
|
|
30
|
+
body: string;
|
|
31
|
+
}
|
|
32
|
+
/** A loaded OKF knowledge bundle: every authored concept found, reserved files already excluded. */
|
|
33
|
+
export interface OkfBundle {
|
|
34
|
+
concepts: OkfConcept[];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Load every authored concept from an OKF knowledge bundle directory.
|
|
38
|
+
* `index.md`/`log.md` are skipped (reserved, by basename, at any depth —
|
|
39
|
+
* matching `okfConformanceProblems`'s check on the emit side). A directory
|
|
40
|
+
* that does not exist yields an empty bundle, not an error: the #1059 design
|
|
41
|
+
* treats a missing `knowledge/` as "this project has none yet," the same
|
|
42
|
+
* posture as a project with no lexicons configured.
|
|
43
|
+
*
|
|
44
|
+
* A file that fails to parse — no frontmatter block, unparseable YAML, or
|
|
45
|
+
* frontmatter that isn't a mapping — is skipped with a `console.warn` and
|
|
46
|
+
* does not affect any other file. Nothing here throws.
|
|
47
|
+
*/
|
|
48
|
+
export declare function loadOkfBundle(dir: string): Promise<OkfBundle>;
|
|
49
|
+
/** {@link bindConcepts}'s result: bound concepts per entity, plus every binding that resolved nothing. */
|
|
50
|
+
export interface BindConceptsResult {
|
|
51
|
+
/**
|
|
52
|
+
* Bound concepts keyed by entity logical name — the same names that key
|
|
53
|
+
* `DiscoveryResult.entities` (`./discovery/index.ts`). An entity with no
|
|
54
|
+
* bound concepts is absent from the map, never present with `[]`.
|
|
55
|
+
*/
|
|
56
|
+
bound: Map<string, OkfConcept[]>;
|
|
57
|
+
/** Every `binds` entry that named no entity in `entities` — chant's own broken-link posture (#1059): a warning for the caller to surface (COR022, #1865), never a load failure. */
|
|
58
|
+
unresolved: UnresolvedBinding[];
|
|
59
|
+
}
|
|
60
|
+
/** One `binds` entry that resolved to nothing. */
|
|
61
|
+
export interface UnresolvedBinding {
|
|
62
|
+
/** The concept whose `binds` named this entity. */
|
|
63
|
+
concept: OkfConcept;
|
|
64
|
+
/** The unresolved logical name. */
|
|
65
|
+
name: string;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Resolve every concept's `binds` against a project's discovered entities.
|
|
69
|
+
* `entities` is the same shape `./okf.ts`'s emitter takes, `DiscoveryResult`'s
|
|
70
|
+
* own `entities` map — a bare logical name is unambiguous within one
|
|
71
|
+
* discovery pass (#1059's "Rejected options" on binding ambiguity).
|
|
72
|
+
*
|
|
73
|
+
* A concept with no `binds` contributes to neither `bound` nor `unresolved`;
|
|
74
|
+
* an unbound concept is legitimate, not an omission (a runbook, a decision
|
|
75
|
+
* about the project as a whole).
|
|
76
|
+
*/
|
|
77
|
+
export declare function bindConcepts(bundle: OkfBundle, entities: Map<string, Declarable>): BindConceptsResult;
|
|
78
|
+
//# sourceMappingURL=okf-read.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"okf-read.d.ts","sourceRoot":"","sources":["../src/okf-read.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAkB/C;;;;;;;;GAQG;AACH,MAAM,WAAW,UAAU;IACzB,yFAAyF;IACzF,IAAI,EAAE,MAAM,CAAC;IACb,gIAAgI;IAChI,IAAI,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;;OAOG;IACH,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,yFAAyF;IACzF,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;CACd;AAED,oGAAoG;AACpG,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,UAAU,EAAE,CAAC;CACxB;AAmCD;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CA8CnE;AAED,0GAA0G;AAC1G,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;IACjC,mLAAmL;IACnL,UAAU,EAAE,iBAAiB,EAAE,CAAC;CACjC;AAED,kDAAkD;AAClD,MAAM,WAAW,iBAAiB;IAChC,mDAAmD;IACnD,OAAO,EAAE,UAAU,CAAC;IACpB,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,kBAAkB,CAgBrG"}
|