@intentius/chant 0.49.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 +9 -0
- package/dist/audit/core.d.ts.map +1 -1
- package/dist/audit/discover.d.ts +6 -0
- 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.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/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 +11 -0
- 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/server.d.ts +35 -2
- package/dist/cli/mcp/server.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/registry.d.ts +14 -2
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/codegen/docs-rule-scanning.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/verbs/index.d.ts +6 -1
- package/dist/components/verbs/index.d.ts.map +1 -1
- 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/composite.d.ts +6 -1
- package/dist/composite.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/fold/fold.d.ts +55 -2
- package/dist/fold/fold.d.ts.map +1 -1
- package/dist/fold/subset.d.ts +21 -14
- package/dist/fold/subset.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 +93 -0
- package/dist/lexicon.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 +4 -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/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/lint/output-docs.d.ts +94 -0
- package/dist/lint/output-docs.d.ts.map +1 -0
- package/dist/lint/post-synth.d.ts +29 -0
- package/dist/lint/post-synth.d.ts.map +1 -1
- 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/lsp/lexicon-providers.d.ts +7 -0
- package/dist/lsp/lexicon-providers.d.ts.map +1 -1
- 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 +42 -2
- 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 +14 -0
- package/dist/op/index.d.ts.map +1 -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/step-output-ref.d.ts +187 -0
- package/dist/op/step-output-ref.d.ts.map +1 -0
- package/dist/op/types.d.ts +18 -1
- 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/serializer.d.ts +18 -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/package.json +1 -1
- package/src/audit/catalog.test.ts +1 -1
- package/src/audit/catalog.ts +75 -3
- package/src/audit/core.ts +9 -0
- package/src/audit/discover.ts +29 -2
- 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 +2 -0
- 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.ts +8 -3
- package/src/cli/command-group.ts +1 -1
- package/src/cli/commands/__fixtures__/schemas/sarif-2.1.0.schema.json +2882 -0
- package/src/cli/commands/audit.test.ts +215 -1
- package/src/cli/commands/audit.ts +86 -17
- package/src/cli/commands/build.test.ts +167 -2
- package/src/cli/commands/build.ts +114 -23
- 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/graph.test.ts +20 -0
- package/src/cli/handlers/graph.ts +10 -1
- package/src/cli/handlers/lifecycle.ts +12 -4
- 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/server.test.ts +265 -2
- package/src/cli/mcp/server.ts +84 -7
- package/src/cli/mcp/types.ts +27 -1
- package/src/cli/registry.ts +14 -2
- 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/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/verbs/index.ts +6 -1
- 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/composite.ts +31 -2
- 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/fold/fold.test.ts +6 -2
- package/src/fold/fold.ts +184 -3
- package/src/fold/subset.test.ts +82 -19
- package/src/fold/subset.ts +79 -41
- package/src/lexicon-schema.ts +3 -0
- package/src/lexicon.ts +103 -2
- 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 +4 -0
- package/src/lifecycle/lease.test.ts +343 -0
- package/src/lifecycle/lease.ts +270 -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/lint/output-docs.test.ts +220 -0
- package/src/lint/output-docs.ts +204 -0
- package/src/lint/post-synth.test.ts +97 -0
- package/src/lint/post-synth.ts +45 -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/evl001-non-literal-expression.test.ts +8 -3
- package/src/lint/rules/evl001-non-literal-expression.ts +6 -6
- package/src/lsp/lexicon-providers.test.ts +44 -0
- package/src/lsp/lexicon-providers.ts +11 -1
- 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 +59 -5
- package/src/op/converge-rule.test.ts +179 -0
- package/src/op/converge-rule.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 +30 -0
- package/src/op/local-executor.test.ts +92 -0
- package/src/op/local-executor.ts +45 -9
- package/src/op/op-verb-class.test.ts +126 -0
- package/src/op/op-verb-class.ts +115 -0
- package/src/op/operator.test.ts +346 -0
- package/src/op/operator.ts +213 -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 +18 -1
- package/src/provenance.test.ts +151 -4
- package/src/provenance.ts +118 -4
- package/src/runtime-adapter.ts +31 -10
- package/src/serializer.ts +18 -0
- package/src/toml.test.ts +157 -384
- package/src/toml.ts +371 -5
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plan scenarios (chant #1292): a declared expectation about what a change
|
|
3
|
+
* SHOULD do, checkable offline against a fixture snapshot.
|
|
4
|
+
*
|
|
5
|
+
* Everything else chant validates is about shape — is this declaration
|
|
6
|
+
* well-formed, does this reference resolve. Nothing answers "what will this
|
|
7
|
+
* change do" as something source can assert about itself, until now. A
|
|
8
|
+
* `Scenario` pairs a `given` (a stand-in for live observation) with an
|
|
9
|
+
* `expect` (a claim about the resulting change set) — `chant scenario check`
|
|
10
|
+
* (../cli/handlers/scenario.ts) builds the project, replays `given` in place
|
|
11
|
+
* of a live read, and evaluates `expect` against the resulting `ChangeSet`
|
|
12
|
+
* (./change-set.ts) via `evaluateScenario` (./scenario-eval.ts).
|
|
13
|
+
*
|
|
14
|
+
* Modeled precisely on the other non-resource Declarables (../effect-receipt.ts,
|
|
15
|
+
* ../secret-provenance.ts): discovery collects a `Scenario` like any entity
|
|
16
|
+
* (it is a Declarable), but it carries no resource payload and no serializer
|
|
17
|
+
* ever emits it — `partitionByLexicon` (../build.ts) excludes it from every
|
|
18
|
+
* lexicon's partition, the same way it excludes a secret declaration.
|
|
19
|
+
*
|
|
20
|
+
* This module is pure and does no I/O: `snapshot()` records where the fixture
|
|
21
|
+
* comes from without reading it, and the factory validates and freezes. The
|
|
22
|
+
* CLI handler is where the fixture is actually read, replayed, and compared —
|
|
23
|
+
* the same synthesis/plan split every other lifecycle primitive here follows.
|
|
24
|
+
*/
|
|
25
|
+
import { type Declarable } from "../declarable.js";
|
|
26
|
+
import type { Ownership } from "./change-set.js";
|
|
27
|
+
/** Marker symbol identifying a scenario declaration. `Symbol.for` so it
|
|
28
|
+
* survives the entity-wire codec, the same reason ../effect-receipt.ts and
|
|
29
|
+
* ../secret-provenance.ts use `Symbol.for` for their markers. */
|
|
30
|
+
export declare const SCENARIO_MARKER: unique symbol;
|
|
31
|
+
/** The `entityType` every scenario declaration carries. */
|
|
32
|
+
export declare const SCENARIO_ENTITY_TYPE = "Chant::Scenario";
|
|
33
|
+
/**
|
|
34
|
+
* `given: snapshot("fixtures/prod-baseline.json")` — a checked-in fixture, in
|
|
35
|
+
* the same {@link LifecycleSnapshot} JSON shape `chant lifecycle snapshot`
|
|
36
|
+
* writes (a single lexicon's recorded resources). Path-relative to the
|
|
37
|
+
* project root, read at check time — never here.
|
|
38
|
+
*/
|
|
39
|
+
export interface ScenarioGivenFile {
|
|
40
|
+
readonly kind: "file";
|
|
41
|
+
/** Repo-relative path to the fixture JSON file. */
|
|
42
|
+
readonly path: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* `given: snapshot("prod")` — the last snapshot recorded for that environment
|
|
46
|
+
* on the `chant/lifecycle` orphan branch (one file per lexicon, read via
|
|
47
|
+
* `readSnapshot`/`readEnvironmentSnapshots`, ../lifecycle/git.ts), replayed
|
|
48
|
+
* exactly as `chant lifecycle plan` reads its own prior snapshot.
|
|
49
|
+
*/
|
|
50
|
+
export interface ScenarioGivenEnv {
|
|
51
|
+
readonly kind: "env";
|
|
52
|
+
/** Environment name, matching a `chant.config.ts` `environments` entry. */
|
|
53
|
+
readonly env: string;
|
|
54
|
+
}
|
|
55
|
+
/** What a scenario's `given` stands in for — a fixture file or a recorded environment. */
|
|
56
|
+
export type ScenarioGiven = ScenarioGivenFile | ScenarioGivenEnv;
|
|
57
|
+
/**
|
|
58
|
+
* Declare `given` from a single string. Pure and offline: no filesystem
|
|
59
|
+
* access, no git — the factory only classifies the string's SHAPE, never
|
|
60
|
+
* checks whether it exists. That is what keeps `Scenario` foldable under
|
|
61
|
+
* `--sandbox`, the same discipline `declareSecret`'s committed-encrypted path
|
|
62
|
+
* validation follows (../secret-provenance.ts).
|
|
63
|
+
*
|
|
64
|
+
* The classification is structural: a string containing a path separator or
|
|
65
|
+
* ending in `.json` is a fixture file; anything else (a bare token like
|
|
66
|
+
* `"prod"`) is an environment name. A `chant.config.ts` environment name that
|
|
67
|
+
* happens to contain a slash or end in `.json` is not supported by this
|
|
68
|
+
* heuristic — pass `{ kind: "env", env }` directly in that unlikely case.
|
|
69
|
+
*/
|
|
70
|
+
export declare function snapshot(source: string): ScenarioGiven;
|
|
71
|
+
/** One named delete an `expect.deletes` clause requires — the resource must
|
|
72
|
+
* be proposed for deletion, and with exactly this ownership verdict. */
|
|
73
|
+
export interface ScenarioDeleteExpectation {
|
|
74
|
+
/** The change-set entry name (ChangeSetEntry.name) expected to delete. */
|
|
75
|
+
readonly name: string;
|
|
76
|
+
/** The ownership verdict (./change-set.ts's `Ownership`) the delete must carry. */
|
|
77
|
+
readonly ownership: Ownership;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* How a scenario treats the change set's `unobserved` rows (#1089):
|
|
81
|
+
*
|
|
82
|
+
* - `"refuse"` — any unobserved entry fails the scenario. The plan admitting
|
|
83
|
+
* a hole is never a pass, the same fail-closed instinct
|
|
84
|
+
* `evaluateUnobservedGate`'s default takes (./unobserved-gate.ts).
|
|
85
|
+
* - `{ allow: [names] }` — the named entities may be unobserved without
|
|
86
|
+
* failing the scenario; any unobserved entity NOT in the list still fails
|
|
87
|
+
* it. Unlike `evaluateUnobservedGate`'s policy (which allows by *reason*),
|
|
88
|
+
* this allows by entity *name* — the natural unit for a scenario written
|
|
89
|
+
* against one fixture, where "this specific resource has no binding in the
|
|
90
|
+
* fixture" is a known, accepted gap rather than a class of reason to trust
|
|
91
|
+
* everywhere.
|
|
92
|
+
*/
|
|
93
|
+
export type ScenarioUnobservedPolicy = "refuse" | {
|
|
94
|
+
readonly allow: readonly string[];
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* The assertion vocabulary (#1292 research, settled shape). Every clause is
|
|
98
|
+
* independently optional and clauses compose within one `expect` object — a
|
|
99
|
+
* scenario can assert `noop`, exact counts, specific named deletes, and an
|
|
100
|
+
* unobserved policy together. At least one clause must be present; an empty
|
|
101
|
+
* `expect` asserts nothing and is refused as a likely mistake.
|
|
102
|
+
*/
|
|
103
|
+
export interface ScenarioExpect {
|
|
104
|
+
/** The plan proposes no create, update, or delete, and no declared effect
|
|
105
|
+
* receipt (#1832) fires — the majority-value case (refactors, upgrades,
|
|
106
|
+
* no-op deploys). Equivalent to `{ create: 0, update: 0, delete: 0 }` plus
|
|
107
|
+
* "no receipt classifies as `effect`", but reads as the specific claim it
|
|
108
|
+
* is: a pending effect fire is a real proposed action even though it never
|
|
109
|
+
* joins the create/update/delete triad. */
|
|
110
|
+
readonly noop?: true;
|
|
111
|
+
/** Exact count of `create` rows the plan must propose. Omitted = unconstrained. */
|
|
112
|
+
readonly create?: number;
|
|
113
|
+
/** Exact count of `update` rows the plan must propose. Omitted = unconstrained. */
|
|
114
|
+
readonly update?: number;
|
|
115
|
+
/** Exact count of `delete` rows the plan must propose. Omitted = unconstrained. */
|
|
116
|
+
readonly delete?: number;
|
|
117
|
+
/** Exactly these resources must delete, each with the stated ownership —
|
|
118
|
+
* and no OTHER delete may be proposed. The highest-value assertion in the
|
|
119
|
+
* vocabulary: "this plan deletes nothing foreign", made precise per-name. */
|
|
120
|
+
readonly deletes?: readonly ScenarioDeleteExpectation[];
|
|
121
|
+
/** How the scenario treats unobserved rows. Omitted = unconstrained (an
|
|
122
|
+
* unobserved entity neither passes nor fails the scenario on its own). */
|
|
123
|
+
readonly unobserved?: ScenarioUnobservedPolicy;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* A scenario declaration — a Declarable, so discovery collects it and `chant
|
|
127
|
+
* list` shows it, but it carries no resource payload: `partitionByLexicon`
|
|
128
|
+
* (../build.ts) excludes it from every serializer partition, so no lexicon
|
|
129
|
+
* ever emits it and no apply-bound document ever contains one.
|
|
130
|
+
*/
|
|
131
|
+
export interface ScenarioDeclaration extends Declarable {
|
|
132
|
+
readonly [SCENARIO_MARKER]: true;
|
|
133
|
+
readonly lexicon: "chant";
|
|
134
|
+
readonly entityType: typeof SCENARIO_ENTITY_TYPE;
|
|
135
|
+
/** The scenario's own name — what `chant scenario check` reports pass/fail against. */
|
|
136
|
+
readonly name: string;
|
|
137
|
+
readonly given: ScenarioGiven;
|
|
138
|
+
readonly expect: ScenarioExpect;
|
|
139
|
+
}
|
|
140
|
+
/** Factory options for {@link Scenario}. */
|
|
141
|
+
export interface ScenarioOptions {
|
|
142
|
+
/** What stands in for live observation — a fixture file or a recorded environment. */
|
|
143
|
+
readonly given: ScenarioGiven;
|
|
144
|
+
/** The claim about the resulting change set. At least one clause required. */
|
|
145
|
+
readonly expect: ScenarioExpect;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Declare a plan scenario. The returned object is a locked Declarable:
|
|
149
|
+
* declared fields are immutable and nested structures are frozen, the same
|
|
150
|
+
* shape ../effect-receipt.ts and ../secret-provenance.ts lock down; the
|
|
151
|
+
* top-level object stays extensible so discovery can still stamp its own
|
|
152
|
+
* symbol-keyed metadata.
|
|
153
|
+
*/
|
|
154
|
+
export declare function Scenario(name: string, options: ScenarioOptions): ScenarioDeclaration;
|
|
155
|
+
/** Type guard for a scenario declaration. */
|
|
156
|
+
export declare function isScenario(value: unknown): value is ScenarioDeclaration;
|
|
157
|
+
/**
|
|
158
|
+
* Extract the scenario declarations from a discovered entity map — the read
|
|
159
|
+
* surface `chant scenario check` (../cli/handlers/scenario.ts) uses. Keyed by
|
|
160
|
+
* entity name (export name), the same key `DiscoveryResult.entities` uses.
|
|
161
|
+
*/
|
|
162
|
+
export declare function collectScenarios(entities: ReadonlyMap<string, Declarable>): Map<string, ScenarioDeclaration>;
|
|
163
|
+
//# sourceMappingURL=scenario.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scenario.d.ts","sourceRoot":"","sources":["../../src/lifecycle/scenario.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C;;iEAEiE;AACjE,eAAO,MAAM,eAAe,eAA+B,CAAC;AAE5D,2DAA2D;AAC3D,eAAO,MAAM,oBAAoB,oBAAoB,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,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,CAAC,eAAe,CAAC,EAAE,IAAI,CAAC;IACjC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,OAAO,oBAAoB,CAAC;IACjD,uFAAuF;IACvF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;CACjC;AAED,4CAA4C;AAC5C,MAAM,WAAW,eAAe;IAC9B,sFAAsF;IACtF,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,8EAA8E;IAC9E,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;CACjC;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,mBAAmB,CAoBpF;AAuGD,6CAA6C;AAC7C,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,mBAAmB,CAOvE;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAM5G"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Symptom derivation (#1484, epic #1487 feature 5) — one typed record joining
|
|
3
|
+
* the status join (./status.ts), change-set summaries (./change-set.ts), and
|
|
4
|
+
* unobserved evidence (../observation.ts) into the shape `ConvergeOp`'s rule
|
|
5
|
+
* table evaluates against.
|
|
6
|
+
*
|
|
7
|
+
* Derive-only, per the issue's leaning on its own open question 4: no new
|
|
8
|
+
* `LexiconPlugin.symptoms?()` interface in v1 — everything here is a pure
|
|
9
|
+
* projection of structures chant already computes (`ChangeSet`,
|
|
10
|
+
* `ComponentStatusRow[]`). No I/O in this module; a caller (the `convergeTick`
|
|
11
|
+
* activity, lexicons/temporal/src/op/activities/converge.ts) gathers those
|
|
12
|
+
* inputs and hands them here.
|
|
13
|
+
*
|
|
14
|
+
* One record per tick, not per component: the issue's own rule sketch reads
|
|
15
|
+
* `s.status`/`s.backupVerifiedAge` as a single symptom `s` a rule closes
|
|
16
|
+
* over, and epic feature 5 calls it "one typed record" (singular). A
|
|
17
|
+
* multi-component environment still resolves to one record per tick —
|
|
18
|
+
* `components` carries the per-component detail behind the aggregate for
|
|
19
|
+
* reporting, and `status` is the worst verdict across all of them (see
|
|
20
|
+
* {@link worstStatus}), so "any component is unknown" is enough to trip
|
|
21
|
+
* `unknown never remediates` for the whole tick.
|
|
22
|
+
*/
|
|
23
|
+
import type { ChangeSet } from "./change-set.js";
|
|
24
|
+
import type { ComponentStatusRow } from "./status.js";
|
|
25
|
+
import { type UnobservedReason } from "../observation.js";
|
|
26
|
+
/** The worst (most-cautious) reconciliation verdict across a set of component rows. `"reconciled"` for an empty set — nothing to converge is a quiet environment. */
|
|
27
|
+
export declare function worstStatus(rows: ComponentStatusRow[]): ComponentStatusRow["reconciliation"];
|
|
28
|
+
/**
|
|
29
|
+
* One tick's typed symptom record. Every field a `ConvergeOp` rule may
|
|
30
|
+
* reference — see `../op/converge-rule.ts`'s `SymptomPredicate<S>`, where
|
|
31
|
+
* `S` is this interface, so a rule whose predicate names a field outside
|
|
32
|
+
* this shape fails TypeScript at the author's call site (the "symptom field
|
|
33
|
+
* nothing produces" build-time refusal).
|
|
34
|
+
*/
|
|
35
|
+
export interface ConvergeSymptom {
|
|
36
|
+
env: string;
|
|
37
|
+
/** The worst reconciliation verdict across every component row this tick observed (see {@link worstStatus}). */
|
|
38
|
+
status: ComponentStatusRow["reconciliation"];
|
|
39
|
+
/** Per-component detail behind `status`, for reporting — never read by a rule predicate directly (rules read the flat counts below). */
|
|
40
|
+
components: ComponentStatusRow[];
|
|
41
|
+
/** Change-set action counts for the tick (./change-set.ts's `summarize`). */
|
|
42
|
+
createCount: number;
|
|
43
|
+
updateCount: number;
|
|
44
|
+
deleteCount: number;
|
|
45
|
+
/** Live but undeclared, ownership unestablished — a candidate to adopt into source. Never auto-claimed; see the issue's "adopt is reported, never auto-claimed" honesty requirement. */
|
|
46
|
+
adoptCount: number;
|
|
47
|
+
runtimeCount: number;
|
|
48
|
+
effectCount: number;
|
|
49
|
+
/** Declared, but the lexicon could not observe it (#1089) — the count backing `status: "unknown"`. */
|
|
50
|
+
unobservedCount: number;
|
|
51
|
+
/** Every distinct reason behind `unobservedCount`, for a report action's detail. */
|
|
52
|
+
unobservedReasons: UnobservedReason[];
|
|
53
|
+
/** Total resource count under change-set evidence for this tick (sum of the six counts above). */
|
|
54
|
+
totalCount: number;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Join a `ChangeSet` and `ComponentStatusRow[]` for one tick into a
|
|
58
|
+
* `ConvergeSymptom`. Pure — no I/O.
|
|
59
|
+
*/
|
|
60
|
+
export declare function deriveSymptoms(env: string, cs: ChangeSet, statusRows: ComponentStatusRow[]): ConvergeSymptom;
|
|
61
|
+
/** Every field name a `ConvergeSymptom` produces — the runtime whitelist `TMP014` (lexicons/temporal) re-validates a serialized rule table's predicates against. Kept in sync with {@link ConvergeSymptom} by hand (deliberately small, changes rarely). */
|
|
62
|
+
export declare const CONVERGE_SYMPTOM_FIELDS: ReadonlySet<string>;
|
|
63
|
+
//# sourceMappingURL=symptoms.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"symptoms.d.ts","sourceRoot":"","sources":["../../src/lifecycle/symptoms.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,EAAgB,SAAS,EAAE,MAAM,cAAc,CAAC;AAE5D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,EAAwB,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAkB7E,qKAAqK;AACrK,wBAAgB,WAAW,CAAC,IAAI,EAAE,kBAAkB,EAAE,GAAG,kBAAkB,CAAC,gBAAgB,CAAC,CAM5F;AAED;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,gHAAgH;IAChH,MAAM,EAAE,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;IAC7C,wIAAwI;IACxI,UAAU,EAAE,kBAAkB,EAAE,CAAC;IACjC,6EAA6E;IAC7E,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,wLAAwL;IACxL,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,sGAAsG;IACtG,eAAe,EAAE,MAAM,CAAC;IACxB,oFAAoF;IACpF,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;IACtC,kGAAkG;IAClG,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,kBAAkB,EAAE,GAAG,eAAe,CAwB5G;AAED,4PAA4P;AAC5P,eAAO,MAAM,uBAAuB,EAAE,WAAW,CAAC,MAAM,CAatD,CAAC"}
|
|
@@ -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"}
|
|
@@ -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,6 +48,14 @@ 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
|
*/
|
|
@@ -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;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAmB,KAAK,SAAS,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mB;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,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"}
|
|
@@ -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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S,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,KAAK,SAAS,GAAG,SAAS,GAC9E,SAAS,GAAG,SAAS,CAiBvB"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Activity contracts — the Stage 1 fix for chant #1288 ("Ops are the one
|
|
3
|
+
* place chant accepts untyped arguments and resolves names at runtime").
|
|
4
|
+
*
|
|
5
|
+
* Maintainer decision (#1288, 2026-08-25): a staged approach. Stage 1 (this
|
|
6
|
+
* module) is registered args/return schemas per activity, validated by
|
|
7
|
+
* `chant build` against every step — non-breaking, no change to
|
|
8
|
+
* {@link ActivityStep.args}'s `Record<string, unknown>` shape or the step
|
|
9
|
+
* builders. Stage 2 (a separate PR) regenerates the step builders as fully
|
|
10
|
+
* typed wrappers for editor completion and go-to-definition. #1289 (op.json
|
|
11
|
+
* IR) and #1290 (step-output references) build on these contracts — #1290
|
|
12
|
+
* specifically needs a declared `returns` schema to validate a later step's
|
|
13
|
+
* reference into an earlier one's output against, which is why `returns` is
|
|
14
|
+
* part of the shape here even though nothing in Stage 1 reads it for that.
|
|
15
|
+
*
|
|
16
|
+
* An activity declares a contract alongside its implementation — the same
|
|
17
|
+
* "registration surface" the issue asked for (`activity-registry.ts`'s
|
|
18
|
+
* `collectActivities` already does this for implementations; this is the
|
|
19
|
+
* schema-shaped sibling). `chant build` — via a lexicon's own post-synth
|
|
20
|
+
* check, e.g. the temporal lexicon's TMP012 — resolves each step's `fn`
|
|
21
|
+
* against a contract map built the same way and validates `args` and
|
|
22
|
+
* `outcomeAttribute.from`. A step whose `fn` has no registered contract is
|
|
23
|
+
* skipped (not an error): this is deliberately incremental — a lexicon opts
|
|
24
|
+
* an activity in by declaring a contract for it, and the k8s/aws/azure/gcp/
|
|
25
|
+
* fly activity sets are expected to pick this up lexicon by lexicon rather
|
|
26
|
+
* than all at once (see the issue's "worth checking this lands cleanly"
|
|
27
|
+
* note).
|
|
28
|
+
*
|
|
29
|
+
* Ownership is decentralized on purpose: each lexicon declares contracts for
|
|
30
|
+
* the activities it implements and validates them with its own post-synth
|
|
31
|
+
* check (the same `rulePrefix`-per-lexicon pattern every other check in
|
|
32
|
+
* chant already uses), rather than a shared cross-lexicon registry. A
|
|
33
|
+
* `Temporal::Op` step can call an activity contributed by any lexicon, and
|
|
34
|
+
* `PostSynthContext.entities` already carries the whole resolved graph to
|
|
35
|
+
* every lexicon's checks, so no new plumbing is needed for that to work.
|
|
36
|
+
*/
|
|
37
|
+
import { z } from "zod";
|
|
38
|
+
import type { OpConfig } from "./types.js";
|
|
39
|
+
/** Every literal value {@link ActivityStep.profile} may hold. Kept in sync with `types.ts`'s `ActivityStep["profile"]`. */
|
|
40
|
+
export declare const KNOWN_ACTIVITY_PROFILES: readonly ["fastIdempotent", "longInfra", "k8sWait", "humanGate", "argoSync", "policyCheck"];
|
|
41
|
+
declare const CONTRACT_BRAND: unique symbol;
|
|
42
|
+
/**
|
|
43
|
+
* A registered activity's args/return schemas — the declaration that lets
|
|
44
|
+
* `chant build` catch a typo'd or mistyped step before it ever reaches a
|
|
45
|
+
* cluster.
|
|
46
|
+
*
|
|
47
|
+
* Author `args` with `z.strictObject(...)` (or an equivalent that rejects
|
|
48
|
+
* unrecognized keys), not `z.object(...)`. Zod's default `.object()` silently
|
|
49
|
+
* drops a key it doesn't recognize instead of failing — exactly the
|
|
50
|
+
* `helmInstall("api", "./chart", { nameSpace: "prod" })` failure class the
|
|
51
|
+
* issue names, where the misspelled key vanishes instead of erroring. A
|
|
52
|
+
* strict schema turns that into a build error.
|
|
53
|
+
*/
|
|
54
|
+
export interface ActivityContract<Args = unknown, Return = unknown> {
|
|
55
|
+
readonly [CONTRACT_BRAND]: true;
|
|
56
|
+
/** The activity's registered name — must match a step's `fn`. */
|
|
57
|
+
name: string;
|
|
58
|
+
/** Schema every step's `args` (defaulted to `{}` when omitted) must satisfy. */
|
|
59
|
+
args: z.ZodType<Args>;
|
|
60
|
+
/**
|
|
61
|
+
* Schema the activity resolves to. Optional: an activity that returns
|
|
62
|
+
* nothing meaningful (or hasn't had its return type written down yet) can
|
|
63
|
+
* omit it. Needed to validate a step's `outcomeAttribute.from` path, and —
|
|
64
|
+
* per #1290 — a later step's reference into this one's output.
|
|
65
|
+
*/
|
|
66
|
+
returns?: z.ZodType<Return>;
|
|
67
|
+
}
|
|
68
|
+
/** Declare an activity contract. */
|
|
69
|
+
export declare function activityContract<ArgsSchema extends z.ZodTypeAny, ReturnSchema extends z.ZodTypeAny = never>(name: string, args: ArgsSchema, returns?: ReturnSchema): ActivityContract<z.infer<ArgsSchema>, ReturnSchema extends z.ZodTypeAny ? z.infer<ReturnSchema> : unknown>;
|
|
70
|
+
/** Structural guard for a value produced by {@link activityContract}. */
|
|
71
|
+
export declare function isActivityContract(value: unknown): value is ActivityContract;
|
|
72
|
+
/**
|
|
73
|
+
* Add every {@link ActivityContract} exported from an activity-contracts
|
|
74
|
+
* module to `into`, keyed by its declared `name` — the schema-shaped sibling
|
|
75
|
+
* of `activity-registry.ts`'s `collectActivities`.
|
|
76
|
+
*/
|
|
77
|
+
export declare function collectActivityContracts(mod: Record<string, unknown>, into: Map<string, ActivityContract>): void;
|
|
78
|
+
export interface ActivityContractIssue {
|
|
79
|
+
/** The Op the offending step belongs to. */
|
|
80
|
+
opName: string;
|
|
81
|
+
/** The phase the offending step belongs to. */
|
|
82
|
+
phase: string;
|
|
83
|
+
/** The activity name the offending step calls. */
|
|
84
|
+
fn: string;
|
|
85
|
+
/** Human-readable description of the mismatch. */
|
|
86
|
+
message: string;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Does dot-path `path` resolve to a field that exists on `schema`? Object
|
|
90
|
+
* shapes only — a return schema whose root (or an intermediate segment) is
|
|
91
|
+
* a `z.record(...)`/`z.array(...)` rather than a `z.object(...)` hard-errors
|
|
92
|
+
* (returns `false`) instead of skipping, deliberately (chant #1290 comment
|
|
93
|
+
* on #1288's pre-merge review): a record's keys are dynamic and an array's
|
|
94
|
+
* elements are index-addressed, neither of which a dot-path segment can
|
|
95
|
+
* check against in any way that's more meaningful than "the author probably
|
|
96
|
+
* meant something else." No declared `returns` schema needs this today, so
|
|
97
|
+
* there's no live case to design against yet. The escape hatch is an empty
|
|
98
|
+
* path — `outcomeAttribute.from` omitted, or a {@link StepOutputRef}'s
|
|
99
|
+
* `path` omitted — which references the whole return value and never calls
|
|
100
|
+
* this function; a record/array-returning activity's whole value is always
|
|
101
|
+
* a valid reference target.
|
|
102
|
+
*/
|
|
103
|
+
export declare function pathExistsInSchema(schema: z.ZodTypeAny, path: string): boolean;
|
|
104
|
+
/**
|
|
105
|
+
* The zod schema at property-key path `path` inside `schema`, walking
|
|
106
|
+
* through `z.ZodObject` shapes only (unwrapping optional/nullable/default at
|
|
107
|
+
* each level, same as {@link pathExistsInSchema}). `undefined` when a
|
|
108
|
+
* segment doesn't resolve, or an intermediate schema isn't a `z.ZodObject` —
|
|
109
|
+
* same record/array hard-stop {@link pathExistsInSchema} documents. An empty
|
|
110
|
+
* `path` returns `schema` itself (unwrapped).
|
|
111
|
+
*/
|
|
112
|
+
export declare function schemaAtPath(schema: z.ZodTypeAny, path: ReadonlyArray<string>): z.ZodTypeAny | undefined;
|
|
113
|
+
/**
|
|
114
|
+
* A primitive-shape classification of a zod schema — `string`/`number`/
|
|
115
|
+
* `boolean`/`object`/`array`, or `undefined` for anything else (a union,
|
|
116
|
+
* enum, literal, `z.any()`/`z.unknown()`, a transform, …). Used by the
|
|
117
|
+
* step-output-ref cross-contract type check (chant #1950-3) to compare a
|
|
118
|
+
* producer's declared return type against a consumer's declared arg type at
|
|
119
|
+
* the same structural position — deliberately shallow: it bails (returns
|
|
120
|
+
* `undefined`) on anything fancier than these five kinds rather than trying
|
|
121
|
+
* to reason about it, per that check's "bail out silently" design.
|
|
122
|
+
*/
|
|
123
|
+
export type PrimitiveSchemaKind = "string" | "number" | "boolean" | "object" | "array";
|
|
124
|
+
export declare function primitiveKindOf(schema: z.ZodTypeAny): PrimitiveSchemaKind | undefined;
|
|
125
|
+
/**
|
|
126
|
+
* Validate every activity step in an Op's phases (main and `onFailure`)
|
|
127
|
+
* against a contract map. A step whose `fn` has no entry in `contracts` is
|
|
128
|
+
* skipped — Stage 1 is opt-in per activity, not a hard requirement that
|
|
129
|
+
* every activity have a declared contract.
|
|
130
|
+
*
|
|
131
|
+
* Catches the four failure classes chant #1288 names:
|
|
132
|
+
* - an unrecognized `profile` (checked against {@link KNOWN_ACTIVITY_PROFILES}, independent of whether `fn` has a contract),
|
|
133
|
+
* - an args key the declared schema doesn't recognize,
|
|
134
|
+
* - an args value of the wrong type (including a required key that's missing),
|
|
135
|
+
* - an `outcomeAttribute.from` path that can't exist on the declared return type.
|
|
136
|
+
*/
|
|
137
|
+
export declare function validateActivitySteps(config: Pick<OpConfig, "name" | "phases" | "onFailure">, contracts: ReadonlyMap<string, ActivityContract>): ActivityContractIssue[];
|
|
138
|
+
export {};
|
|
139
|
+
//# sourceMappingURL=activity-contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activity-contract.d.ts","sourceRoot":"","sources":["../../src/op/activity-contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,QAAQ,EAAiD,MAAM,SAAS,CAAC;AAEvF,2HAA2H;AAC3H,eAAO,MAAM,uBAAuB,6FAO1B,CAAC;AAEX,QAAA,MAAM,cAAc,eAA0C,CAAC;AAE/D;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,gBAAgB,CAAC,IAAI,GAAG,OAAO,EAAE,MAAM,GAAG,OAAO;IAChE,QAAQ,CAAC,CAAC,cAAc,CAAC,EAAE,IAAI,CAAC;IAChC,iEAAiE;IACjE,IAAI,EAAE,MAAM,CAAC;IACb,gFAAgF;IAChF,IAAI,EAAE,CAAC,CAAC,OAAO,CAA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