@intentius/chant 0.44.14 → 0.46.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/discover.d.ts +26 -2
- package/dist/audit/discover.d.ts.map +1 -1
- package/dist/audit/report-model.d.ts +10 -0
- package/dist/audit/report-model.d.ts.map +1 -1
- package/dist/audit/rules-doc.d.ts.map +1 -1
- package/dist/cli/build-params-cli.d.ts +16 -7
- package/dist/cli/build-params-cli.d.ts.map +1 -1
- package/dist/cli/commands/audit.d.ts +20 -0
- package/dist/cli/commands/audit.d.ts.map +1 -1
- package/dist/cli/commands/build.d.ts +9 -0
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/check-lexicon-docs.d.ts +13 -0
- package/dist/cli/commands/check-lexicon-docs.d.ts.map +1 -1
- package/dist/cli/commands/check-lexicon-examples.d.ts +24 -14
- package/dist/cli/commands/check-lexicon-examples.d.ts.map +1 -1
- package/dist/cli/commands/check-lexicon.d.ts +14 -0
- package/dist/cli/commands/check-lexicon.d.ts.map +1 -1
- package/dist/cli/commands/init-lexicon/templates/codegen.d.ts.map +1 -1
- package/dist/cli/commands/init-lexicon/templates/docs.d.ts +5 -0
- package/dist/cli/commands/init-lexicon/templates/docs.d.ts.map +1 -1
- package/dist/cli/commands/init-lexicon.d.ts.map +1 -1
- package/dist/cli/commands/lexicon-surface-diff.d.ts +6 -0
- package/dist/cli/commands/lexicon-surface-diff.d.ts.map +1 -1
- package/dist/cli/commands/lint.d.ts.map +1 -1
- package/dist/cli/commands/onboard.d.ts +28 -0
- package/dist/cli/commands/onboard.d.ts.map +1 -1
- package/dist/cli/handlers/build.d.ts.map +1 -1
- package/dist/cli/handlers/graph.d.ts.map +1 -1
- package/dist/cli/handlers/lifecycle.d.ts +13 -0
- package/dist/cli/handlers/lifecycle.d.ts.map +1 -1
- package/dist/cli/handlers/run.d.ts.map +1 -1
- package/dist/cli/handlers/search.d.ts +27 -0
- package/dist/cli/handlers/search.d.ts.map +1 -1
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/registry.d.ts +7 -0
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/codegen/docs-pages.d.ts +39 -0
- package/dist/codegen/docs-pages.d.ts.map +1 -0
- package/dist/codegen/docs-sections.d.ts.map +1 -1
- package/dist/codegen/docs-sidebar.d.ts +13 -2
- package/dist/codegen/docs-sidebar.d.ts.map +1 -1
- package/dist/codegen/docs-types.d.ts +30 -10
- package/dist/codegen/docs-types.d.ts.map +1 -1
- package/dist/codegen/docs.d.ts +14 -2
- package/dist/codegen/docs.d.ts.map +1 -1
- package/dist/codegen/lexicon-regen.d.ts +11 -0
- package/dist/codegen/lexicon-regen.d.ts.map +1 -1
- package/dist/codegen/surface-snapshot.d.ts +27 -3
- package/dist/codegen/surface-snapshot.d.ts.map +1 -1
- package/dist/codegen/validate.d.ts +21 -3
- package/dist/codegen/validate.d.ts.map +1 -1
- package/dist/components/capability-plugin.d.ts +13 -2
- package/dist/components/capability-plugin.d.ts.map +1 -1
- package/dist/components/driver.d.ts +38 -0
- package/dist/components/driver.d.ts.map +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/starter-plugin.d.ts.map +1 -1
- package/dist/config.d.ts +85 -5
- package/dist/config.d.ts.map +1 -1
- package/dist/discovery/fold-import.d.ts.map +1 -1
- package/dist/env.d.ts +12 -1
- package/dist/env.d.ts.map +1 -1
- package/dist/fold/fold.d.ts +100 -1
- package/dist/fold/fold.d.ts.map +1 -1
- package/dist/graph-ir.d.ts +12 -0
- package/dist/graph-ir.d.ts.map +1 -1
- package/dist/graph-ops.d.ts +17 -0
- package/dist/graph-ops.d.ts.map +1 -0
- package/dist/lexicon.d.ts +182 -2
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/change-set.d.ts +23 -2
- package/dist/lifecycle/change-set.d.ts.map +1 -1
- package/dist/lifecycle/deep-observe.d.ts.map +1 -1
- package/dist/lifecycle/index.d.ts +1 -0
- package/dist/lifecycle/index.d.ts.map +1 -1
- package/dist/lifecycle/observe.d.ts +8 -0
- package/dist/lifecycle/observe.d.ts.map +1 -1
- package/dist/lifecycle/replay.d.ts.map +1 -1
- package/dist/lifecycle/snapshot.d.ts.map +1 -1
- package/dist/lifecycle/teardown.d.ts +130 -0
- package/dist/lifecycle/teardown.d.ts.map +1 -0
- package/dist/lifecycle/types.d.ts +7 -0
- package/dist/lifecycle/types.d.ts.map +1 -1
- package/dist/lint/engine.d.ts +6 -2
- package/dist/lint/engine.d.ts.map +1 -1
- package/dist/lint/policy.d.ts.map +1 -1
- package/dist/lint/rule.d.ts +31 -0
- package/dist/lint/rule.d.ts.map +1 -1
- package/dist/lint/rules/cor021-env-literal-name.d.ts +3 -0
- package/dist/lint/rules/cor021-env-literal-name.d.ts.map +1 -0
- package/dist/lint/rules/index.d.ts +2 -1
- package/dist/lint/rules/index.d.ts.map +1 -1
- package/dist/managed-fields.d.ts +33 -21
- package/dist/managed-fields.d.ts.map +1 -1
- package/dist/observation.d.ts +23 -1
- package/dist/observation.d.ts.map +1 -1
- package/dist/op/builders.d.ts +36 -7
- package/dist/op/builders.d.ts.map +1 -1
- package/dist/op/index.d.ts +1 -1
- package/dist/op/index.d.ts.map +1 -1
- package/dist/testing.d.ts +136 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/yaml.d.ts +0 -8
- package/dist/yaml.d.ts.map +1 -1
- package/package.json +6 -1
- package/src/__snapshots__/okf.test.ts.snap +20 -0
- package/src/audit/discover.test.ts +55 -1
- package/src/audit/discover.ts +70 -2
- package/src/audit/edge-init-safety.test.ts +149 -18
- package/src/audit/report-model.ts +12 -1
- package/src/audit/rules-doc.ts +1 -0
- package/src/build-params.test.ts +52 -0
- package/src/cli/build-params-cli.test.ts +25 -8
- package/src/cli/build-params-cli.ts +37 -23
- package/src/cli/commands/__fixtures__/audit-coverage/.github/workflows/ci.yml +5 -0
- package/src/cli/commands/__fixtures__/audit-coverage/Dockerfile +2 -0
- package/src/cli/commands/__fixtures__/audit-coverage/infra/main.tf +3 -0
- package/src/cli/commands/__fixtures__/audit-coverage/infra/stack.json +6 -0
- package/src/cli/commands/__fixtures__/audit-coverage/k8s/deploy.yaml +12 -0
- package/src/cli/commands/__fixtures__/init-lexicon-output/docs/pages/getting-started.mdx +16 -0
- package/src/cli/commands/__fixtures__/init-lexicon-output/docs/src/content.config.ts +10 -2
- package/src/cli/commands/__fixtures__/init-lexicon-output/src/codegen/generate-cli.ts +3 -1
- package/src/cli/commands/__fixtures__/init-lexicon-output/src/codegen/generate.ts +2 -1
- package/src/cli/commands/__snapshots__/init-lexicon.test.ts.snap +2 -1
- package/src/cli/commands/audit.test.ts +83 -1
- package/src/cli/commands/audit.ts +121 -28
- package/src/cli/commands/build.test.ts +275 -5
- package/src/cli/commands/build.ts +86 -14
- package/src/cli/commands/check-lexicon-docs.ts +30 -0
- package/src/cli/commands/check-lexicon-examples.test.ts +73 -7
- package/src/cli/commands/check-lexicon-examples.ts +66 -17
- package/src/cli/commands/check-lexicon.test.ts +46 -2
- package/src/cli/commands/check-lexicon.ts +64 -4
- package/src/cli/commands/init-lexicon/templates/codegen.ts +5 -2
- package/src/cli/commands/init-lexicon/templates/docs.ts +35 -2
- package/src/cli/commands/init-lexicon.test.ts +42 -1
- package/src/cli/commands/init-lexicon.ts +3 -1
- package/src/cli/commands/lexicon-rolling-upgrade.ts +1 -1
- package/src/cli/commands/lexicon-surface-diff.test.ts +1 -1
- package/src/cli/commands/lexicon-surface-diff.ts +10 -1
- package/src/cli/commands/lexicon-surface-diff.update.test.ts +112 -0
- package/src/cli/commands/lint.ts +19 -6
- package/src/cli/commands/onboard.test.ts +319 -225
- package/src/cli/commands/onboard.ts +144 -58
- package/src/cli/handlers/build.test.ts +3 -3
- package/src/cli/handlers/build.ts +2 -0
- package/src/cli/handlers/components.ts +2 -2
- package/src/cli/handlers/graph.test.ts +44 -0
- package/src/cli/handlers/graph.ts +24 -4
- package/src/cli/handlers/lifecycle.test.ts +348 -1
- package/src/cli/handlers/lifecycle.ts +235 -3
- package/src/cli/handlers/run.test.ts +5 -5
- package/src/cli/handlers/run.ts +1 -0
- package/src/cli/handlers/search-live.test.ts +217 -0
- package/src/cli/handlers/search.test.ts +41 -1
- package/src/cli/handlers/search.ts +60 -8
- package/src/cli/main.ts +17 -4
- package/src/cli/registry.ts +7 -0
- package/src/cli/security-boundary.test.ts +2 -1
- package/src/codegen/docs-pages.test.ts +194 -0
- package/src/codegen/docs-pages.ts +138 -0
- package/src/codegen/docs-sections.ts +0 -8
- package/src/codegen/docs-sidebar.ts +50 -37
- package/src/codegen/docs-types.ts +32 -4
- package/src/codegen/docs.ts +78 -40
- package/src/codegen/lexicon-regen.ts +22 -2
- package/src/codegen/rolling-upgrade.test.ts +1 -1
- package/src/codegen/rolling-upgrade.ts +1 -1
- package/src/codegen/surface-snapshot.test.ts +139 -0
- package/src/codegen/surface-snapshot.ts +297 -122
- package/src/codegen/validate.test.ts +49 -3
- package/src/codegen/validate.ts +36 -7
- package/src/components/auto-release.ts +1 -1
- package/src/components/capability-plugin.ts +23 -2
- package/src/components/driver.test.ts +45 -0
- package/src/components/driver.ts +64 -27
- package/src/components/index.ts +2 -0
- package/src/components/starter-plugin.ts +5 -2
- package/src/config.test.ts +40 -0
- package/src/config.ts +159 -8
- package/src/discovery/fold-import.test.ts +427 -2
- package/src/discovery/fold-import.ts +163 -7
- package/src/discovery/sandbox/driver.test.ts +11 -0
- package/src/env.test.ts +35 -1
- package/src/env.ts +17 -3
- package/src/fold/fold.test.ts +41 -0
- package/src/fold/fold.ts +372 -2
- package/src/graph-ir-live.test.ts +42 -0
- package/src/graph-ir.ts +42 -2
- package/src/graph-ops.test.ts +69 -0
- package/src/graph-ops.ts +42 -0
- package/src/lexicon.ts +182 -2
- package/src/lifecycle/change-set.test.ts +41 -0
- package/src/lifecycle/change-set.ts +30 -2
- package/src/lifecycle/deep-observe.ts +4 -0
- package/src/lifecycle/index.ts +1 -0
- package/src/lifecycle/observe.ts +29 -2
- package/src/lifecycle/replay.ts +3 -0
- package/src/lifecycle/snapshot.ts +3 -0
- package/src/lifecycle/teardown.test.ts +537 -0
- package/src/lifecycle/teardown.ts +357 -0
- package/src/lifecycle/types.ts +7 -0
- package/src/lint/engine.ts +7 -1
- package/src/lint/policy.ts +14 -3
- package/src/lint/rule.ts +23 -0
- package/src/lint/rules/cor021-env-literal-name.test.ts +128 -0
- package/src/lint/rules/cor021-env-literal-name.ts +114 -0
- package/src/lint/rules/index.ts +4 -1
- package/src/managed-fields.test.ts +15 -42
- package/src/managed-fields.ts +43 -26
- package/src/observation.test.ts +24 -8
- package/src/observation.ts +48 -4
- package/src/op/builders.ts +40 -7
- package/src/op/index.ts +1 -1
- package/src/ownership.test.ts +63 -1
- package/src/testing.test.ts +261 -0
- package/src/testing.ts +338 -0
- package/src/yaml.test.ts +15 -0
- package/src/yaml.ts +19 -2
package/dist/config.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { type SbomFormat } from "./components/verbs/sbom-generator.js";
|
|
|
5
5
|
import type { Severity } from "./components/verbs/vuln-scan.js";
|
|
6
6
|
import type { VulnPolicy } from "./components/verbs/vuln-gate.js";
|
|
7
7
|
import type { BuildParamsConfig } from "./build-params.js";
|
|
8
|
+
import type { BuildParamProvenance } from "./provenance.js";
|
|
8
9
|
/**
|
|
9
10
|
* One project-declared environment (chant #1166). Historically always a bare
|
|
10
11
|
* name (`"floci"`); an entry can now instead carry the endpoint that
|
|
@@ -19,6 +20,13 @@ export type EnvironmentDeclaration = string | {
|
|
|
19
20
|
name: string;
|
|
20
21
|
endpoint?: string;
|
|
21
22
|
};
|
|
23
|
+
/**
|
|
24
|
+
* `ownership.env`: a literal environment identity, or a reference to a
|
|
25
|
+
* declared build parameter whose resolved value becomes the identity (#1396).
|
|
26
|
+
*/
|
|
27
|
+
export type OwnershipEnv = string | {
|
|
28
|
+
param: string;
|
|
29
|
+
};
|
|
22
30
|
/** The declared name of one `environments` entry, whichever form it takes. */
|
|
23
31
|
export declare function environmentName(entry: EnvironmentDeclaration): string;
|
|
24
32
|
/**
|
|
@@ -28,6 +36,29 @@ export declare function environmentName(entry: EnvironmentDeclaration): string;
|
|
|
28
36
|
* `environmentNames(config.environments)?.includes(name)`.
|
|
29
37
|
*/
|
|
30
38
|
export declare function environmentNames(environments: EnvironmentDeclaration[] | undefined): string[] | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Whether a declared environment name is a glob pattern rather than a literal
|
|
41
|
+
* (#1221) — it contains at least one `*`.
|
|
42
|
+
*/
|
|
43
|
+
export declare function isEnvironmentPattern(declaredName: string): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Anchored `*`-glob match (#1221): each `*` in `pattern` matches any run of
|
|
46
|
+
* characters (possibly empty); everything else matches itself. Deliberately
|
|
47
|
+
* the whole surface — no `?`, no character classes, no regex. A pattern with
|
|
48
|
+
* no `*` degenerates to string equality.
|
|
49
|
+
*/
|
|
50
|
+
export declare function matchesEnvironmentPattern(pattern: string, name: string): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Environment-membership test (#1221): is `name` covered by this project's
|
|
53
|
+
* declared `environments`? A literal entry matches by equality; an entry
|
|
54
|
+
* containing `*` matches as a glob pattern (`"pr-*"` covers `pr-42`).
|
|
55
|
+
* Literals are checked first across the whole list, then patterns — so a
|
|
56
|
+
* name that is declared outright never depends on pattern order. `undefined`
|
|
57
|
+
* / empty `environments` returns `false`; callers that treat "no declared
|
|
58
|
+
* environments" as "anything goes" (e.g. {@link unknownEnvError} in
|
|
59
|
+
* `./env.ts`) guard that case themselves.
|
|
60
|
+
*/
|
|
61
|
+
export declare function matchesDeclaredEnvironment(environments: EnvironmentDeclaration[] | undefined, name: string): boolean;
|
|
31
62
|
/**
|
|
32
63
|
* The endpoint `name` declares (chant #1166) — `undefined` for a bare-string
|
|
33
64
|
* entry, an entry with no `endpoint` set, or a name this project doesn't
|
|
@@ -35,6 +66,11 @@ export declare function environmentNames(environments: EnvironmentDeclaration[]
|
|
|
35
66
|
* it injects this into the ambient env var each observing lexicon's CLI
|
|
36
67
|
* shell-out reads (e.g. `AWS_ENDPOINT_URL`), unless that var is already set —
|
|
37
68
|
* ambient always wins.
|
|
69
|
+
*
|
|
70
|
+
* A pattern entry (#1221) can carry an endpoint too: `{ name: "pr-*",
|
|
71
|
+
* endpoint }` supplies the endpoint for every `pr-<n>` environment. A literal
|
|
72
|
+
* entry always wins over a pattern — declaring `pr-special` alongside
|
|
73
|
+
* `pr-*` resolves `pr-special` to the literal entry's endpoint (or none).
|
|
38
74
|
*/
|
|
39
75
|
export declare function environmentEndpoint(environments: EnvironmentDeclaration[] | undefined, name: string): string | undefined;
|
|
40
76
|
export declare const ChantConfigSchema: z.ZodObject<{
|
|
@@ -48,7 +84,9 @@ export declare const ChantConfigSchema: z.ZodObject<{
|
|
|
48
84
|
lint: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
49
85
|
ownership: z.ZodOptional<z.ZodObject<{
|
|
50
86
|
stack: z.ZodOptional<z.ZodString>;
|
|
51
|
-
env: z.ZodOptional<z.ZodString
|
|
87
|
+
env: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
88
|
+
param: z.ZodString;
|
|
89
|
+
}, z.core.$strip>]>>;
|
|
52
90
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
53
91
|
}, z.core.$strip>>;
|
|
54
92
|
build: z.ZodOptional<z.ZodObject<{
|
|
@@ -186,8 +224,17 @@ export interface ChantConfig {
|
|
|
186
224
|
ownership?: {
|
|
187
225
|
/** Stack identity stamped onto resources (required to enable stamping). */
|
|
188
226
|
stack?: string;
|
|
189
|
-
/**
|
|
190
|
-
|
|
227
|
+
/**
|
|
228
|
+
* Optional environment identity. Either a literal, or a reference to one
|
|
229
|
+
* of this project's declared `buildParams` (`{ param: "env" }`), in which
|
|
230
|
+
* case the marker takes whatever value that parameter resolves to for the
|
|
231
|
+
* build — the same value `params.env` reads in source (#1396). A
|
|
232
|
+
* reference is the only way to make the marker follow `--param env=prod`:
|
|
233
|
+
* the config is evaluated before build parameters exist, so a literal
|
|
234
|
+
* computed from `process.env` here and a parameter mapped to the same
|
|
235
|
+
* variable are two sources of truth that nothing keeps in step.
|
|
236
|
+
*/
|
|
237
|
+
env?: OwnershipEnv;
|
|
191
238
|
/** Set false to disable stamping even when `stack` is present. */
|
|
192
239
|
enabled?: boolean;
|
|
193
240
|
};
|
|
@@ -374,11 +421,44 @@ export declare function loadChantConfig(dir: string): Promise<ResolvedConfig>;
|
|
|
374
421
|
* config declaring any project-level key still wins where it stands.
|
|
375
422
|
*/
|
|
376
423
|
export declare function loadChantConfigUpward(startDir: string): Promise<ResolvedConfig>;
|
|
424
|
+
/** Whether an `ownership.env` entry is a build-parameter reference rather than a literal. */
|
|
425
|
+
export declare function isOwnershipParamRef(env: OwnershipEnv | undefined): env is {
|
|
426
|
+
param: string;
|
|
427
|
+
};
|
|
428
|
+
/**
|
|
429
|
+
* The ownership stack identity alone — `ownership.stack` when marking is on
|
|
430
|
+
* (no `stack`, or `enabled: false`, means off). For callers that need the
|
|
431
|
+
* stack and nothing else (a field manager, a prune selector) and so have no
|
|
432
|
+
* build parameters to resolve `env` against.
|
|
433
|
+
*/
|
|
434
|
+
export declare function resolveOwnershipStack(config: ChantConfig): string | undefined;
|
|
435
|
+
/**
|
|
436
|
+
* Resolve the `env` half of the ownership marker (#1396). A literal is
|
|
437
|
+
* returned as-is. A `{ param }` reference is looked up in this build's resolved
|
|
438
|
+
* build parameters and must find one: a reference to a parameter that was
|
|
439
|
+
* never declared, or that resolved to no value, throws rather than quietly
|
|
440
|
+
* stamping a marker without an env — an env-less marker is exactly what lets
|
|
441
|
+
* a prod deployment go unseen by `--owned` filtering scoped to prod.
|
|
442
|
+
*/
|
|
443
|
+
export declare function resolveOwnershipEnv(config: ChantConfig, buildParams: readonly BuildParamProvenance[] | undefined): string | undefined;
|
|
377
444
|
/**
|
|
378
445
|
* Resolve the ownership marker to stamp from project config, or undefined when
|
|
379
|
-
* ownership marking is off (no `stack`, or `enabled: false`).
|
|
446
|
+
* ownership marking is off (no `stack`, or `enabled: false`). `buildParams` is
|
|
447
|
+
* this build's resolved parameters (`resolveBuildParams`'s provenance), which
|
|
448
|
+
* an `ownership.env: { param }` reference resolves against — see {@link
|
|
449
|
+
* resolveOwnershipEnv}; it throws when the reference cannot be satisfied.
|
|
450
|
+
*/
|
|
451
|
+
export declare function resolveOwnershipMarker(config: ChantConfig, buildParams?: readonly BuildParamProvenance[]): OwnershipMarker | undefined;
|
|
452
|
+
/**
|
|
453
|
+
* The divergence #1396 is about, made loud when it cannot be removed: a
|
|
454
|
+
* project whose `ownership.env` is a literal while it also declares a build
|
|
455
|
+
* parameter named `env` has two answers to "which environment is this", and
|
|
456
|
+
* the manifest carries both (the ownership marker from config, the labels
|
|
457
|
+
* from the parameter). Returns a warning naming both values when they differ;
|
|
458
|
+
* undefined when there is nothing to say (no literal, no `env` parameter, or
|
|
459
|
+
* the two agree). The fix is the `{ param: "env" }` reference.
|
|
380
460
|
*/
|
|
381
|
-
export declare function
|
|
461
|
+
export declare function ownershipEnvDisagreement(config: ChantConfig, buildParams: readonly BuildParamProvenance[] | undefined): string | undefined;
|
|
382
462
|
/**
|
|
383
463
|
* Whether auto-emitting a release-ledger record after a successful `chant
|
|
384
464
|
* run --components` deploy should be skipped (#597). Opt-out, not opt-in:
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAuB,KAAK,UAAU,EAAE,MAAM,mCAAmC,CAA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AO,CAAC,UAAU,CAAC,CAiB1E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fold-import.d.ts","sourceRoot":"","sources":["../../src/discovery/fold-import.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAMjC,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAkC,KAAK,iBAAiB,EAAyB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"fold-import.d.ts","sourceRoot":"","sources":["../../src/discovery/fold-import.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAMjC,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAkC,KAAK,iBAAiB,EAAyB,MAAM,cAAc,CAAC;AAgC7G,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEH,mGAAmG;AACnG,MAAM,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,iBAAiB,CAAC,CAAC;AAElF,MAAM,MAAM,cAAc,GACtB;IACE,EAAE,EAAE,IAAI,CAAC;IACT;;;;;;;;OAQG;IACH,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB;;;;;;;;;;;;;OAaG;IACH,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC;;;;;;;;;;;;OAYG;IACH,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAClC,GACD;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAElC;;;;;;;;;;;;;;;;;GA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AAC,kBAAkB,GAAG,MAAM,GAAG,SAAS,CA0D3G;AAqgDD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,MAAM,EACZ,UAAU,GAAE,SAAS,YAAY,EAAO,EACxC,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,cAAc,CAAC,CAEzB;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AACH,wBAAsB,aAAa,CACjC,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,EACvC,WAAW,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,GACrD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CA8EtB"}
|
package/dist/env.d.ts
CHANGED
|
@@ -28,7 +28,18 @@ export declare function env(fallback?: string): string | undefined;
|
|
|
28
28
|
* when it's valid (or when the project declares no environments, in which case
|
|
29
29
|
* any name is accepted). `declared` entries may be a bare name or `{ name,
|
|
30
30
|
* endpoint }` (#1166) — {@link environmentNames} reduces either to the names
|
|
31
|
-
* this checks against.
|
|
31
|
+
* this checks against. An entry containing `*` is a glob pattern (#1221):
|
|
32
|
+
* `"pr-*"` legalizes every `pr-<n>` environment. Literal entries are checked
|
|
33
|
+
* first, then patterns — see {@link matchesDeclaredEnvironment}.
|
|
32
34
|
*/
|
|
33
35
|
export declare function unknownEnvError(requested: string | undefined, declared: EnvironmentDeclaration[] | undefined): string | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* True when an environment name looks like production — `prod`, `production`,
|
|
38
|
+
* and separator-delimited variants (`prod-eu`, `us-prod`, `production2`).
|
|
39
|
+
* `chant lifecycle teardown <env> --yes` demands an extra confirmation for
|
|
40
|
+
* these (#1222): a typo that survives the declared-environments check should
|
|
41
|
+
* still not delete production on one flag. Name-shaped, deliberately — chant
|
|
42
|
+
* has no other signal for which environment is the one that pays the bills.
|
|
43
|
+
*/
|
|
44
|
+
export declare function isProdLikeEnvironment(name: string): boolean;
|
|
34
45
|
//# sourceMappingURL=env.d.ts.map
|
package/dist/env.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAgD,KAAK,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAErG,0DAA0D;AAC1D,eAAO,MAAM,OAAO,cAAc,CAAC;AAEnC,iFAAiF;AACjF,wBAAgB,GAAG,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEzD;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,QAAQ,EAAE,sBAAsB,EAAE,GAAG,SAAS,GAC7C,MAAM,GAAG,SAAS,CAKpB;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE3D"}
|
package/dist/fold/fold.d.ts
CHANGED
|
@@ -42,7 +42,15 @@ import { type SubsetRuleId } from "./subset.js";
|
|
|
42
42
|
* #1044) → {@link FoldedIntrinsicCall}, the same `{__intrinsic}` family
|
|
43
43
|
* the tagged-template form already reduces to.
|
|
44
44
|
*
|
|
45
|
-
*
|
|
45
|
+
* chant #1373 adds a third, the only one that evaluates rather than
|
|
46
|
+
* enveloping: a call to a PROJECT-LOCAL function — declared in this file or
|
|
47
|
+
* imported from a sibling project file — whose body is itself inside the
|
|
48
|
+
* fold subset. ../discovery/fold-import.ts hands such a function in through
|
|
49
|
+
* `externals` as a {@link FoldableFunction}, and {@link callFoldableFunction}
|
|
50
|
+
* folds its body against the defining module's scope with the folded
|
|
51
|
+
* arguments bound. Still nothing is imported or run.
|
|
52
|
+
*
|
|
53
|
+
* Everything else — a package's function, a method call, an array `.map`, a
|
|
46
54
|
* registered name shadowed by a local binding — still throws.
|
|
47
55
|
*
|
|
48
56
|
* Cross-file identifier resolution (chant #1020): `consts` alone is always
|
|
@@ -249,6 +257,97 @@ export declare class FoldError extends Error {
|
|
|
249
257
|
readonly ruleId: SubsetRuleId;
|
|
250
258
|
constructor(message: string, line: number, column: number, ruleId?: SubsetRuleId);
|
|
251
259
|
}
|
|
260
|
+
/**
|
|
261
|
+
* A project-local function `fold()` can CALL — chant #1373.
|
|
262
|
+
*
|
|
263
|
+
* Produced by ../discovery/fold-import.ts for every top-level function a
|
|
264
|
+
* project file declares (`export function f(...) {...}`, `export const f =
|
|
265
|
+
* (...) => ...`, and their non-exported siblings) and placed in the folding
|
|
266
|
+
* file's `externals` under the function's name, so a call through a bare
|
|
267
|
+
* identifier bound to one evaluates STATICALLY: the arguments fold in the
|
|
268
|
+
* caller's scope, the parameters are bound, and the body folds in the
|
|
269
|
+
* DEFINING module's scope (`consts`/`externals` here are that module's, not
|
|
270
|
+
* the caller's). Nothing is imported and nothing runs — this is the same
|
|
271
|
+
* "evaluate the source instead of the module" move #1023 makes for a
|
|
272
|
+
* composite factory body, applied to a plain function.
|
|
273
|
+
*
|
|
274
|
+
* Why this exists: the advice every chant project gets is to read build
|
|
275
|
+
* parameters through a small helper (`optionalAccountId(params.accountId)`)
|
|
276
|
+
* so defaulting and validation live in one place. Before #1373 a call to
|
|
277
|
+
* that helper was "a function call as a value" and unfoldable, and because
|
|
278
|
+
* fallback is per file and taint propagates along imports, ONE helper call
|
|
279
|
+
* at the top of a parameter file demoted every stack that imported it.
|
|
280
|
+
*
|
|
281
|
+
* The value is a marker, never a real function: a folded file's export
|
|
282
|
+
* namespace may carry one (an importer's `buildExternals` picks it up by
|
|
283
|
+
* name), and `fold()` refuses it anywhere a VALUE is expected — a function
|
|
284
|
+
* object cannot be serialized, and the run path's export namespace holds the
|
|
285
|
+
* real function the collector ignores, so ignoring the marker matches.
|
|
286
|
+
*
|
|
287
|
+
* Not a `FoldedValue`: it never appears inside a folded tree.
|
|
288
|
+
*/
|
|
289
|
+
export declare class FoldableFunction {
|
|
290
|
+
/** The binding name, for diagnostics. */
|
|
291
|
+
readonly name: string;
|
|
292
|
+
readonly fn: ts.FunctionDeclaration | ts.ArrowFunction | ts.FunctionExpression;
|
|
293
|
+
/** Absolute path of the defining module, for diagnostics. */
|
|
294
|
+
readonly file: string;
|
|
295
|
+
/**
|
|
296
|
+
* The defining module's top-level `const` initializers, with every
|
|
297
|
+
* `new`-bound one already REMOVED — a body that mentions one reads the
|
|
298
|
+
* live instance out of `externals` instead (the same object the module's
|
|
299
|
+
* own fold registered), never a by-name `{__attrRef}` that would name an
|
|
300
|
+
* entity of the wrong file once revived in the caller.
|
|
301
|
+
*/
|
|
302
|
+
readonly consts: Map<string, ts.Expression>;
|
|
303
|
+
/** The defining module's resolved imports, its own pre-built resources, and its own sibling functions. Read live, never copied, so a function declared before a const it reads still sees that const's value. */
|
|
304
|
+
readonly externals: ReadonlyMap<string, unknown>;
|
|
305
|
+
/** Why an import of the defining module did NOT resolve, by local name — enriches an "unresolved identifier" inside the body. */
|
|
306
|
+
readonly failures?: ReadonlyMap<string, string> | undefined;
|
|
307
|
+
constructor(
|
|
308
|
+
/** The binding name, for diagnostics. */
|
|
309
|
+
name: string, fn: ts.FunctionDeclaration | ts.ArrowFunction | ts.FunctionExpression,
|
|
310
|
+
/** Absolute path of the defining module, for diagnostics. */
|
|
311
|
+
file: string,
|
|
312
|
+
/**
|
|
313
|
+
* The defining module's top-level `const` initializers, with every
|
|
314
|
+
* `new`-bound one already REMOVED — a body that mentions one reads the
|
|
315
|
+
* live instance out of `externals` instead (the same object the module's
|
|
316
|
+
* own fold registered), never a by-name `{__attrRef}` that would name an
|
|
317
|
+
* entity of the wrong file once revived in the caller.
|
|
318
|
+
*/
|
|
319
|
+
consts: Map<string, ts.Expression>,
|
|
320
|
+
/** The defining module's resolved imports, its own pre-built resources, and its own sibling functions. Read live, never copied, so a function declared before a const it reads still sees that const's value. */
|
|
321
|
+
externals: ReadonlyMap<string, unknown>,
|
|
322
|
+
/** Why an import of the defining module did NOT resolve, by local name — enriches an "unresolved identifier" inside the body. */
|
|
323
|
+
failures?: ReadonlyMap<string, string> | undefined);
|
|
324
|
+
/**
|
|
325
|
+
* Set once a call to this function has RETURNED a live object (a value
|
|
326
|
+
* with a prototype — a pre-built resource instance of the defining module,
|
|
327
|
+
* say) into a caller. The caller then shares that object's identity with
|
|
328
|
+
* the defining module exactly as an imported resource binding would, and
|
|
329
|
+
* fold-import.ts records the same `liveSources` edge for it so the two
|
|
330
|
+
* files fold or run together. A function that returns only plain data never
|
|
331
|
+
* sets this, which is what keeps a parameter helper from tainting anything.
|
|
332
|
+
*/
|
|
333
|
+
leakedIdentity: boolean;
|
|
334
|
+
}
|
|
335
|
+
export declare function isFoldableFunction(value: unknown): value is FoldableFunction;
|
|
336
|
+
/**
|
|
337
|
+
* The SHAPE half of what makes a project-local function foldable (chant
|
|
338
|
+
* #1373) — a reason string, or `undefined` when the function is admissible.
|
|
339
|
+
* Deliberately the same statement-level contract #1023 gives a composite
|
|
340
|
+
* factory body: parameters bound plainly (an identifier, optionally
|
|
341
|
+
* defaulted, or a flat object pattern), and a body that is either a single
|
|
342
|
+
* expression or `const` declarations followed by one `return`. Every
|
|
343
|
+
* expression inside is then folded by {@link fold} itself, so the expression
|
|
344
|
+
* subset is defined exactly once — with the additions {@link fold} refuses
|
|
345
|
+
* INSIDE a function body (a `new`, a tagged template, a registered helper or
|
|
346
|
+
* intrinsic call), because each of those reduces to an envelope revived
|
|
347
|
+
* against the CALLER's imports, which are not the scope the body was written
|
|
348
|
+
* in.
|
|
349
|
+
*/
|
|
350
|
+
export declare function findFunctionSubsetViolation(fn: ts.FunctionDeclaration | ts.ArrowFunction | ts.FunctionExpression): string | undefined;
|
|
252
351
|
/**
|
|
253
352
|
* Resolve a node's 1-based line/column via its owning `SourceFile`. Exported
|
|
254
353
|
* (chant #1020) so fold-import.ts can build its own located `FoldError`s
|
package/dist/fold/fold.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fold.d.ts","sourceRoot":"","sources":["../../src/fold/fold.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"fold.d.ts","sourceRoot":"","sources":["../../src/fold/fold.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAyC,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AACtF,OAAO,EAaL,KAAK,YAAY,EAClB,MAAM,UAAU,CAAC;AAGlB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEG;AAEH;;;;GAIG;AACH,MAAM,MAAM,WAAW,GACnB,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,GACT,WAAW,EAAE,GACb;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAAA;CAAE,GAC9B,YAAY,GACZ,eAAe,GACf,gBAAgB,GAChB,aAAa,GACb,cAAc,CAAC;AAEnB;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;CAClD;AAED;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG,kBAAkB,GAAG,mBAAmB,CAAC;AAEvE,+EAA+E;AAC/E,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE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 +121,10 @@ export interface IRExport {
|
|
|
121
121
|
node?: string;
|
|
122
122
|
/** Producer-side attribute the output reads (e.g. "Arn"). */
|
|
123
123
|
attr?: string;
|
|
124
|
+
/** The published value, when the graph was observed rather than declared (#1279). */
|
|
125
|
+
value?: unknown;
|
|
126
|
+
/** The deployed stack that publishes it, on an observed graph (#1279). */
|
|
127
|
+
stack?: string;
|
|
124
128
|
}
|
|
125
129
|
/** A cross-stack import this stack consumes — a `Parameter` fed from another
|
|
126
130
|
* stack's output at deploy time. A viewer matches an import `name` to another
|
|
@@ -226,6 +230,14 @@ export interface LiveObservation {
|
|
|
226
230
|
* keys, so an edge can only reference something the observation also reported.
|
|
227
231
|
*/
|
|
228
232
|
edges?: IREdge[];
|
|
233
|
+
/**
|
|
234
|
+
* What each deployed stack publishes (#1279), keyed by stack name. Stack-level
|
|
235
|
+
* by nature, so it is carried here once and projected onto the IR's `exports`
|
|
236
|
+
* rather than copied onto every node's `attrs` — which is what the AWS
|
|
237
|
+
* observation used to do, leaving every VPC with the stack's `expWebIp` and
|
|
238
|
+
* no `CidrBlock` of its own.
|
|
239
|
+
*/
|
|
240
|
+
stackExports?: Record<string, Record<string, unknown>>;
|
|
229
241
|
}
|
|
230
242
|
/**
|
|
231
243
|
* Build the graph IR from **live-observed** resources (`chant graph --live`) —
|
package/dist/graph-ir.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph-ir.d.ts","sourceRoot":"","sources":["../src/graph-ir.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,UAAU,EAAgB,MAAM,cAAc,CAAC;AAI7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD;;;;;;;;GAQG;AAEH,iFAAiF;AACjF,MAAM,WAAW,SAAS;IACxB,8EAA8E;IAC9E,IAAI,EAAE,MAAM,CAAC;IACb;;;OA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Ae;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC5C;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC9C;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACxD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,eAAe,EAAE,GAAG,OAAO,CAyEzE;AAED,+EAA+E;AAC/E,MAAM,WAAW,cAAc;IAC7B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;CAC/C;AAED,wFAAwF;AACxF,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,eAAe,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAInG;AAiBD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAgB9F;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAqEpG"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Declarable } from "./declarable.js";
|
|
2
|
+
/**
|
|
3
|
+
* #1675 — the graph IR is built from `discover(sourceDir)`, but the Op
|
|
4
|
+
* convention keeps `*.op.ts` files OUTSIDE `sourceDir` (`ops/` or the project
|
|
5
|
+
* root beside `sourceDir: "src"`), and `chant op` / `chant graph` find them via
|
|
6
|
+
* {@link discoverOps}, which scans from the git root. Join the two scopes: every
|
|
7
|
+
* Op `discoverOps` finds that discovery did not already load becomes a
|
|
8
|
+
* `Temporal::Op` entity in the map, keyed the way discovery keys a default
|
|
9
|
+
* export (the file's basename sans `.op.ts`), so the IR carries the declared
|
|
10
|
+
* DAG whatever the layout. Ops discovery already loaded (same file) are left
|
|
11
|
+
* alone. Returns the op-discovery errors for the caller to surface.
|
|
12
|
+
*/
|
|
13
|
+
export declare function mergeProjectOps(entities: Map<string, Declarable>, sourceFiles: readonly string[], projectPath: string): Promise<{
|
|
14
|
+
added: string[];
|
|
15
|
+
errors: string[];
|
|
16
|
+
}>;
|
|
17
|
+
//# sourceMappingURL=graph-ops.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-ops.d.ts","sourceRoot":"","sources":["../src/graph-ops.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK/C;;;;;;;;;;GAUG;AACH,wBAAsB,eAAe,CACnC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,EACjC,WAAW,EAAE,SAAS,MAAM,EAAE,EAC9B,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAoBhD"}
|
package/dist/lexicon.d.ts
CHANGED
|
@@ -11,12 +11,12 @@ import type { CompletionContext, CompletionItem, HoverContext, HoverInfo, CodeAc
|
|
|
11
11
|
import type { McpToolContribution, McpResourceContribution } from "./mcp/types.js";
|
|
12
12
|
import type { DriverComponent } from "./components/driver.js";
|
|
13
13
|
import type { EmulatorDeclaration } from "./op/emulator-lifecycle.js";
|
|
14
|
-
import type { OwnershipChannel } from "./ownership.js";
|
|
14
|
+
import type { OwnershipChannel, OwnershipMarker } from "./ownership.js";
|
|
15
15
|
import type { LexiconConfigSchema } from "./lexicon-config.js";
|
|
16
16
|
import type { RuleMeta } from "./audit/catalog.js";
|
|
17
17
|
import type { ReferenceCatalog } from "./graph-refs.js";
|
|
18
18
|
import type { IREdge } from "./graph-ir.js";
|
|
19
|
-
import type { DescribeResourcesResult } from "./observation.js";
|
|
19
|
+
import type { DescribeResourcesResult, UnobservedReason } from "./observation.js";
|
|
20
20
|
import type { DeepNormalizationHooks, DeepObservationResult } from "./deep-observation.js";
|
|
21
21
|
import type { OwnerChainVerdict } from "./owner-chain.js";
|
|
22
22
|
import type { CommandGroup } from "./cli/command-group.js";
|
|
@@ -482,6 +482,24 @@ export interface LexiconPlugin {
|
|
|
482
482
|
* for lexicons whose rule metadata still lives in core's static catalog.
|
|
483
483
|
*/
|
|
484
484
|
auditCatalog?(): Record<string, RuleMeta>;
|
|
485
|
+
/**
|
|
486
|
+
* Machine-readable spec-coverage accounting for `check-lexicon` (#1330).
|
|
487
|
+
*
|
|
488
|
+
* `coverage()` prints a report for humans; this returns the one fact the
|
|
489
|
+
* completeness gate cares about: which upstream spec kinds are neither
|
|
490
|
+
* modeled as declarables nor on the lexicon's exclusion list. fountain held
|
|
491
|
+
* this line in a lexicon-local vitest assertion (`coverage.test.ts`), which
|
|
492
|
+
* is a convention rather than a contract — the same class of gap #1342
|
|
493
|
+
* closed for LSP providers.
|
|
494
|
+
*
|
|
495
|
+
* Implementations must work offline from committed snapshots (fountain
|
|
496
|
+
* reads `spec/fountain-openapi.snapshot.json` plus its surface baseline):
|
|
497
|
+
* `check-lexicon` runs on every PR, so no network I/O. Omit when the
|
|
498
|
+
* lexicon has no kind-level spec accounting; the check passes vacuously.
|
|
499
|
+
*/
|
|
500
|
+
coverageReport?(): Promise<{
|
|
501
|
+
unaccountedKinds?: string[];
|
|
502
|
+
}>;
|
|
485
503
|
/** Return intrinsic function definitions */
|
|
486
504
|
intrinsics?(): IntrinsicDef[];
|
|
487
505
|
/** Return pseudo-parameter names (e.g. "MyDomain::StackName") */
|
|
@@ -785,6 +803,90 @@ export interface LexiconPlugin {
|
|
|
785
803
|
environment: string;
|
|
786
804
|
stack: string;
|
|
787
805
|
}): Promise<StackStatusObservation | null>;
|
|
806
|
+
/**
|
|
807
|
+
* Enumerate the resources this lexicon would delete for one marker identity
|
|
808
|
+
* (#1222). Opt-in, and read-only here: this method names the would-delete
|
|
809
|
+
* set, it never deletes. `chant lifecycle teardown <env>` calls it to plan;
|
|
810
|
+
* the execution half ({@link executeTeardown}) deletes from the same
|
|
811
|
+
* enumeration.
|
|
812
|
+
*
|
|
813
|
+
* Selection is marker-scoped by construction. `marker` carries this
|
|
814
|
+
* project's ownership stack plus the requested environment, and every
|
|
815
|
+
* returned candidate must have been read carrying exactly that identity on
|
|
816
|
+
* this lexicon's marker channel — managed-by present, stack equal, env
|
|
817
|
+
* equal. A resource whose marker is absent, foreign-stack, or foreign-env is
|
|
818
|
+
* not a candidate, ever. Core re-checks each candidate's `marker` and drops
|
|
819
|
+
* mismatches, so a buggy implementation cannot widen the set.
|
|
820
|
+
*
|
|
821
|
+
* The #1089 discipline applies: a kind this lexicon stamps but cannot read
|
|
822
|
+
* back (no reader for the kind, the read errored, no credentials) is a
|
|
823
|
+
* `hole`, named with a total {@link UnobservedReason} — never silently
|
|
824
|
+
* absent, because "absent from the plan" reads as "safe", and an unreadable
|
|
825
|
+
* kind is unknown, not safe.
|
|
826
|
+
*
|
|
827
|
+
* A lexicon without this capability still takes part in teardown planning:
|
|
828
|
+
* core falls back to {@link describeResources} and filters on
|
|
829
|
+
* {@link ResourceMetadata.marker}. Implement this when that read is the
|
|
830
|
+
* wrong shape for deletion — aws, whose thin read carries no tags and whose
|
|
831
|
+
* teardown is stack-level, is the motivating case.
|
|
832
|
+
*/
|
|
833
|
+
teardownOwned?(options: {
|
|
834
|
+
environment: string;
|
|
835
|
+
/** The identity to select on: this project's ownership stack + the env being torn down. */
|
|
836
|
+
marker: OwnershipMarker;
|
|
837
|
+
/** Deployed stack name, for a multi-stack project (see `stacks` in {@link ChantConfig}). */
|
|
838
|
+
stack?: string;
|
|
839
|
+
/** Region that stack is deployed in (#1261's contract). */
|
|
840
|
+
region?: string;
|
|
841
|
+
/**
|
|
842
|
+
* Every deployed stack a multi-stack project declares (see `stacks` in
|
|
843
|
+
* {@link ChantConfig}), for a lexicon whose enumeration is stack-shaped
|
|
844
|
+
* (aws). When absent or empty, the single-stack convention applies:
|
|
845
|
+
* `stack`, else the stack named after the environment.
|
|
846
|
+
*/
|
|
847
|
+
stacks?: Array<{
|
|
848
|
+
name: string;
|
|
849
|
+
region?: string;
|
|
850
|
+
}>;
|
|
851
|
+
}): Promise<TeardownEnumeration>;
|
|
852
|
+
/**
|
|
853
|
+
* Delete the teardown candidates core hands over — the execution half of
|
|
854
|
+
* `chant lifecycle teardown <env> --yes` (#1222). Opt-in, and the sibling of
|
|
855
|
+
* {@link teardownOwned}: that method names the would-delete set, this one
|
|
856
|
+
* deletes it. A lexicon that enumerates but does not implement this reports
|
|
857
|
+
* its candidates as skipped rather than pretending.
|
|
858
|
+
*
|
|
859
|
+
* `candidates` is the marker-verified set core computed from the plan — an
|
|
860
|
+
* implementation deletes those and only those, in whatever order its target
|
|
861
|
+
* requires (k8s deletes namespaces last; fly deletes apps last). It never
|
|
862
|
+
* re-widens the set: a live resource not in `candidates` is not this call's
|
|
863
|
+
* business, whatever its labels say.
|
|
864
|
+
*
|
|
865
|
+
* Every candidate gets exactly one outcome per call, keyed by `name`:
|
|
866
|
+
* `deleted` (including already-gone — deletion is idempotent), `failed`
|
|
867
|
+
* (the delete errored; core runs one bounded retry pass over these), or
|
|
868
|
+
* `not-prunable` with a reason (the live object no longer carries the
|
|
869
|
+
* requested identity, the kind cannot be addressed, the target refuses).
|
|
870
|
+
* A candidate the implementation says nothing about is reported as failed
|
|
871
|
+
* by core — silence is never success.
|
|
872
|
+
*/
|
|
873
|
+
executeTeardown?(options: {
|
|
874
|
+
environment: string;
|
|
875
|
+
/** The identity everything was selected on: ownership stack + env. */
|
|
876
|
+
marker: OwnershipMarker;
|
|
877
|
+
/** The marker-verified candidates to delete — from {@link teardownOwned} / the plan. */
|
|
878
|
+
candidates: TeardownCandidate[];
|
|
879
|
+
/** Deployed stack name, for a multi-stack project (see `stacks` in {@link ChantConfig}). */
|
|
880
|
+
stack?: string;
|
|
881
|
+
/** Region that stack is deployed in (#1261's contract). */
|
|
882
|
+
region?: string;
|
|
883
|
+
/** Every declared deployed stack, mirroring {@link teardownOwned} — how a
|
|
884
|
+
* stack-shaped execution (aws) finds each candidate's region. */
|
|
885
|
+
stacks?: Array<{
|
|
886
|
+
name: string;
|
|
887
|
+
region?: string;
|
|
888
|
+
}>;
|
|
889
|
+
}): Promise<TeardownExecution>;
|
|
788
890
|
/**
|
|
789
891
|
* Where this lexicon can stamp and read chant's ownership marker (#1348).
|
|
790
892
|
* Data, not a method.
|
|
@@ -890,6 +992,69 @@ export interface LexiconPlugin {
|
|
|
890
992
|
verbatim?: boolean;
|
|
891
993
|
}): Promise<ExportedTemplate>;
|
|
892
994
|
}
|
|
995
|
+
/**
|
|
996
|
+
* One resource {@link LexiconPlugin.teardownOwned} would delete (#1222).
|
|
997
|
+
* Identity only — no delete happens on this path.
|
|
998
|
+
*/
|
|
999
|
+
export interface TeardownCandidate {
|
|
1000
|
+
/** chant entity name where a declared mapping exists, else the provider-side name. */
|
|
1001
|
+
name: string;
|
|
1002
|
+
/** Resource type (e.g. "AWS::S3::Bucket", "K8s::Apps::Deployment"). */
|
|
1003
|
+
type: string;
|
|
1004
|
+
/** Provider-side identifier, when the read surfaces one. */
|
|
1005
|
+
physicalId?: string;
|
|
1006
|
+
/**
|
|
1007
|
+
* The stack/env identity read off the resource's own marker — read back,
|
|
1008
|
+
* never inferred. Core verifies it equals the requested identity and drops
|
|
1009
|
+
* the candidate otherwise.
|
|
1010
|
+
*/
|
|
1011
|
+
marker: OwnershipMarker;
|
|
1012
|
+
}
|
|
1013
|
+
/**
|
|
1014
|
+
* One kind or entity a teardown enumeration could not read (#1089). A hole is
|
|
1015
|
+
* a claim of ignorance, not of absence: the plan must print it loudly, and the
|
|
1016
|
+
* execution half must refuse to call the env clean while holes exist.
|
|
1017
|
+
*/
|
|
1018
|
+
export interface TeardownHole {
|
|
1019
|
+
/** The unreadable kind or entity name. */
|
|
1020
|
+
name: string;
|
|
1021
|
+
/** Resource type, when known. */
|
|
1022
|
+
type?: string;
|
|
1023
|
+
/** Total verdict — the same vocabulary the observation envelope uses. */
|
|
1024
|
+
reason: UnobservedReason;
|
|
1025
|
+
/** Human-readable detail: the failing command, the unsupported kind. */
|
|
1026
|
+
detail?: string;
|
|
1027
|
+
}
|
|
1028
|
+
/** What {@link LexiconPlugin.teardownOwned} returns: the would-delete set plus its holes. */
|
|
1029
|
+
export interface TeardownEnumeration {
|
|
1030
|
+
candidates: TeardownCandidate[];
|
|
1031
|
+
/** Omit or leave empty when every stamped kind was readable. */
|
|
1032
|
+
holes?: TeardownHole[];
|
|
1033
|
+
}
|
|
1034
|
+
/**
|
|
1035
|
+
* One candidate's fate after {@link LexiconPlugin.executeTeardown} (#1222).
|
|
1036
|
+
* `name` keys it back to the candidate it answers for.
|
|
1037
|
+
*/
|
|
1038
|
+
export interface TeardownOutcome {
|
|
1039
|
+
/** The candidate's `name`, verbatim. */
|
|
1040
|
+
name: string;
|
|
1041
|
+
/** Resource type, when the implementation carries it through. */
|
|
1042
|
+
type?: string;
|
|
1043
|
+
/** Provider-side identifier, when known. */
|
|
1044
|
+
physicalId?: string;
|
|
1045
|
+
/**
|
|
1046
|
+
* - `deleted` — gone, including already-gone (deletion is idempotent);
|
|
1047
|
+
* - `failed` — the delete errored (core retries these once);
|
|
1048
|
+
* - `not-prunable` — deliberately not deleted; `detail` says why.
|
|
1049
|
+
*/
|
|
1050
|
+
outcome: "deleted" | "failed" | "not-prunable";
|
|
1051
|
+
/** The error for `failed`, the reason for `not-prunable`. */
|
|
1052
|
+
detail?: string;
|
|
1053
|
+
}
|
|
1054
|
+
/** What {@link LexiconPlugin.executeTeardown} returns: one outcome per candidate. */
|
|
1055
|
+
export interface TeardownExecution {
|
|
1056
|
+
outcomes: TeardownOutcome[];
|
|
1057
|
+
}
|
|
893
1058
|
/**
|
|
894
1059
|
* The observation view of a lexicon — every capability except live export.
|
|
895
1060
|
*
|
|
@@ -971,6 +1136,21 @@ export interface ResourceMetadata {
|
|
|
971
1136
|
* a delete, and never escalates `unknown` to one.
|
|
972
1137
|
*/
|
|
973
1138
|
ownership?: "owned" | "foreign" | "unknown";
|
|
1139
|
+
/**
|
|
1140
|
+
* The stack/env identity read off the resource's own ownership marker
|
|
1141
|
+
* (#1222) — the tags/labels/metadata chant stamped at synthesis, read back
|
|
1142
|
+
* verbatim on the same channel. This is what marker-scoped selection keys
|
|
1143
|
+
* on: {@link ownership} says "chant's", `marker` says *which* stack and env.
|
|
1144
|
+
*
|
|
1145
|
+
* Set only when the live model actually carries the channel and the
|
|
1146
|
+
* managed-by marker is present — an absent channel means an absent field,
|
|
1147
|
+
* never a guess. In particular aws's thin read is sourced from
|
|
1148
|
+
* `describe-stack-resources`, which returns no tags at all, so aws never
|
|
1149
|
+
* populates this here; aws teardown is stack-level and reads the stack's own
|
|
1150
|
+
* tags instead (later PR). A populated `marker` does not by itself imply an
|
|
1151
|
+
* {@link ownership} verdict on paths that do not declare a marker channel.
|
|
1152
|
+
*/
|
|
1153
|
+
marker?: OwnershipMarker;
|
|
974
1154
|
/**
|
|
975
1155
|
* Where this resource's owner-reference chain leads, for a live resource
|
|
976
1156
|
* that is not itself declared (#1077). A lexicon that maintains an
|