@intentius/chant 0.28.0 → 0.29.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.
Files changed (75) hide show
  1. package/dist/cli/handlers/components.d.ts.map +1 -1
  2. package/dist/cli/handlers/graph.d.ts.map +1 -1
  3. package/dist/cli/handlers/lifecycle.d.ts +5 -3
  4. package/dist/cli/handlers/lifecycle.d.ts.map +1 -1
  5. package/dist/config.d.ts +46 -4
  6. package/dist/config.d.ts.map +1 -1
  7. package/dist/discovery/fold-import.d.ts +153 -17
  8. package/dist/discovery/fold-import.d.ts.map +1 -1
  9. package/dist/discovery/sandbox/config-wire.d.ts +3 -2
  10. package/dist/discovery/sandbox/config-wire.d.ts.map +1 -1
  11. package/dist/env.d.ts +5 -2
  12. package/dist/env.d.ts.map +1 -1
  13. package/dist/fold/fold.d.ts +12 -0
  14. package/dist/fold/fold.d.ts.map +1 -1
  15. package/dist/graph-ir.d.ts +29 -4
  16. package/dist/graph-ir.d.ts.map +1 -1
  17. package/dist/index.d.ts +1 -0
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/kubectl-context.d.ts +27 -0
  20. package/dist/kubectl-context.d.ts.map +1 -1
  21. package/dist/lexicon.d.ts +31 -6
  22. package/dist/lexicon.d.ts.map +1 -1
  23. package/dist/lifecycle/change-set.d.ts +26 -5
  24. package/dist/lifecycle/change-set.d.ts.map +1 -1
  25. package/dist/lifecycle/live-diff.d.ts +25 -1
  26. package/dist/lifecycle/live-diff.d.ts.map +1 -1
  27. package/dist/lifecycle/observe.d.ts +4 -2
  28. package/dist/lifecycle/observe.d.ts.map +1 -1
  29. package/dist/lifecycle/snapshot.d.ts.map +1 -1
  30. package/dist/lifecycle/status.d.ts +26 -1
  31. package/dist/lifecycle/status.d.ts.map +1 -1
  32. package/dist/lifecycle/types.d.ts +8 -0
  33. package/dist/lifecycle/types.d.ts.map +1 -1
  34. package/dist/live-endpoint.d.ts +92 -0
  35. package/dist/live-endpoint.d.ts.map +1 -0
  36. package/dist/observation.d.ts +123 -0
  37. package/dist/observation.d.ts.map +1 -0
  38. package/dist/stack-output.d.ts.map +1 -1
  39. package/package.json +1 -1
  40. package/src/cli/handlers/components.test.ts +63 -4
  41. package/src/cli/handlers/components.ts +78 -35
  42. package/src/cli/handlers/graph.test.ts +69 -6
  43. package/src/cli/handlers/graph.ts +61 -27
  44. package/src/cli/handlers/lifecycle.test.ts +285 -6
  45. package/src/cli/handlers/lifecycle.ts +297 -185
  46. package/src/config.test.ts +75 -0
  47. package/src/config.ts +61 -3
  48. package/src/discovery/fold-composite.test.ts +594 -0
  49. package/src/discovery/fold-import.ts +987 -43
  50. package/src/discovery/sandbox/config-wire.ts +3 -2
  51. package/src/env.test.ts +12 -0
  52. package/src/env.ts +12 -4
  53. package/src/fold/fold.ts +12 -2
  54. package/src/graph-ir-live.test.ts +28 -1
  55. package/src/graph-ir.ts +68 -12
  56. package/src/index.ts +1 -0
  57. package/src/kubectl-context.ts +81 -0
  58. package/src/lexicon.ts +41 -6
  59. package/src/lifecycle/change-set.test.ts +93 -1
  60. package/src/lifecycle/change-set.ts +65 -13
  61. package/src/lifecycle/live-diff.test.ts +39 -0
  62. package/src/lifecycle/live-diff.ts +51 -5
  63. package/src/lifecycle/observe.test.ts +74 -3
  64. package/src/lifecycle/observe.ts +82 -22
  65. package/src/lifecycle/snapshot.test.ts +39 -1
  66. package/src/lifecycle/snapshot.ts +34 -9
  67. package/src/lifecycle/status.test.ts +89 -8
  68. package/src/lifecycle/status.ts +53 -3
  69. package/src/lifecycle/types.ts +8 -0
  70. package/src/live-endpoint.test.ts +115 -0
  71. package/src/live-endpoint.ts +148 -0
  72. package/src/observation.test.ts +96 -0
  73. package/src/observation.ts +213 -0
  74. package/src/stack-output.test.ts +55 -0
  75. package/src/stack-output.ts +41 -20
@@ -1 +1 @@
1
- {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/components.ts"],"names":[],"mappings":"AA6CA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,KAAK,EAAE,KAAK,EAAa,MAAM,4BAA4B,CAAC;AAEnE;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,0BAA0B,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA4ErF;AAyCD;;;;;;;;;;;;;;;GAeG;AACH;;;;;;;;6EAQ6E;AAC7E,wBAAgB,eAAe,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,EAAE,CAiBzD;AAwCD,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAyN9E;AAED,kEAAkE;AAClE,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAM/E"}
1
+ {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/components.ts"],"names":[],"mappings":"AA8CA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGlD,OAAO,KAAK,EAAE,KAAK,EAAa,MAAM,4BAA4B,CAAC;AAEnE;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,0BAA0B,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA4ErF;AA4CD;;;;;;;;;;;;;;;GAeG;AACH;;;;;;;;6EAQ6E;AAC7E,wBAAgB,eAAe,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,EAAE,CAiBzD;AAqDD,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAkP9E;AAED,kEAAkE;AAClE,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAM/E"}
@@ -1 +1 @@
1
- {"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/graph.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAKlD;;;;;;;;;GASG;AACH,wBAAsB,QAAQ,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAmBnE"}
1
+ {"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/graph.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAKlD;;;;;;;;;GASG;AACH,wBAAsB,QAAQ,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAmBnE"}
@@ -23,9 +23,11 @@ export declare function runLifecycleDiff(ctx: CommandContext): Promise<number>;
23
23
  * chant lifecycle plan <environment> [lexicon]
24
24
  *
25
25
  * Promote the live diff to a typed, read-only change set: per-entity
26
- * create / update / delete / adopt / noop. Strictly read-only — never
27
- * mutates, never deploys. Deletes are never proposed without ownership
28
- * data (added in #121); an undeclared live resource is `adopt`.
26
+ * create / update / delete / adopt / noop / unobserved. Strictly read-only —
27
+ * never mutates, never deploys. Deletes are never proposed without ownership
28
+ * data (added in #121); an undeclared live resource is `adopt`; a declared
29
+ * entity chant could not read is `unobserved` and gets no proposal at all
30
+ * (#1089) — a create is only ever proposed against a confirmed absence.
29
31
  */
30
32
  export declare function runLifecyclePlan(ctx: CommandContext): Promise<number>;
31
33
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/lifecycle.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAgDlD;;GAEG;AACH,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAqF/E;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM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MAAM,CAAC,CA8I3E;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAiB1E;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAM9E;AAkBD;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA+C/E"}
package/dist/config.d.ts CHANGED
@@ -6,12 +6,44 @@ 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
8
  /**
9
- * Zod schema for ChantConfig validation.
9
+ * One project-declared environment (chant #1166). Historically always a bare
10
+ * name (`"floci"`); an entry can now instead carry the endpoint that
11
+ * environment's `--live` reads should target (`{ name: "floci", endpoint:
12
+ * "http://localhost:4566" }`), so a project pointed at a local emulator is
13
+ * self-sufficient — no ambient `AWS_ENDPOINT_URL` export required to avoid
14
+ * silently querying real AWS. See {@link environmentName}, {@link
15
+ * environmentNames}, {@link environmentEndpoint} below, and
16
+ * `./live-endpoint.ts`'s `applyLiveEndpoint`, the CLI-side consumer.
10
17
  */
18
+ export type EnvironmentDeclaration = string | {
19
+ name: string;
20
+ endpoint?: string;
21
+ };
22
+ /** The declared name of one `environments` entry, whichever form it takes. */
23
+ export declare function environmentName(entry: EnvironmentDeclaration): string;
24
+ /**
25
+ * Every declared environment's name, in `environments` order. `undefined` in,
26
+ * `undefined` out — mirrors the field itself being optional, so a caller that
27
+ * already writes `config.environments?.something` can keep doing so:
28
+ * `environmentNames(config.environments)?.includes(name)`.
29
+ */
30
+ export declare function environmentNames(environments: EnvironmentDeclaration[] | undefined): string[] | undefined;
31
+ /**
32
+ * The endpoint `name` declares (chant #1166) — `undefined` for a bare-string
33
+ * entry, an entry with no `endpoint` set, or a name this project doesn't
34
+ * declare at all. `./live-endpoint.ts`'s `applyLiveEndpoint` is the consumer:
35
+ * it injects this into the ambient env var each observing lexicon's CLI
36
+ * shell-out reads (e.g. `AWS_ENDPOINT_URL`), unless that var is already set —
37
+ * ambient always wins.
38
+ */
39
+ export declare function environmentEndpoint(environments: EnvironmentDeclaration[] | undefined, name: string): string | undefined;
11
40
  export declare const ChantConfigSchema: z.ZodObject<{
12
41
  lexicons: z.ZodOptional<z.ZodArray<z.ZodString>>;
13
42
  capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
14
- environments: z.ZodOptional<z.ZodArray<z.ZodString>>;
43
+ environments: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
44
+ name: z.ZodString;
45
+ endpoint: z.ZodOptional<z.ZodString>;
46
+ }, z.core.$strip>]>>>;
15
47
  sourceDir: z.ZodOptional<z.ZodString>;
16
48
  lint: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
17
49
  ownership: z.ZodOptional<z.ZodObject<{
@@ -100,8 +132,18 @@ export interface ChantConfig {
100
132
  * loaded regardless of this field.
101
133
  */
102
134
  capabilities?: string[];
103
- /** Environment names (e.g. ["staging", "prod"]) */
104
- environments?: string[];
135
+ /**
136
+ * Declared environments (e.g. `["staging", "prod"]`). An entry is either a
137
+ * bare name (unchanged since always) or `{ name, endpoint }` (#1166) when
138
+ * that environment's `--live` reads should target a specific endpoint —
139
+ * a local emulator like Floci (`{ name: "floci", endpoint:
140
+ * "http://localhost:4566" }`) chief among them. See {@link
141
+ * environmentEndpoint} and `./live-endpoint.ts`'s `applyLiveEndpoint`, which
142
+ * injects the declared endpoint into the ambient env var each observing
143
+ * lexicon's CLI shell-out reads (e.g. `AWS_ENDPOINT_URL`) — unless that var
144
+ * is already set, in which case the ambient value always wins.
145
+ */
146
+ environments?: EnvironmentDeclaration[];
105
147
  /**
106
148
  * Directory (relative to the project root) that holds the chant infrastructure
107
149
  * source. Lifecycle commands (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C1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;KACd,CAAC;CACH;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,WAAW,GAAG,uBAAuB,CAanF;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CAW1E"}
@@ -1,3 +1,4 @@
1
+ import * as ts from "typescript";
1
2
  import { type Declarable } from "../declarable.js";
2
3
  import { type CompositeInstance } from "../composite.js";
3
4
  import type { IntrinsicDef } from "../lexicon.js";
@@ -20,28 +21,37 @@ import type { BuildParamValue } from "../build-params.js";
20
21
  * class/function; the only thing skipped here is executing the file's *own*
21
22
  * statements.
22
23
  *
23
- * chant #1023 (epic #1019 Phase 5) extends this from leaf resources
24
- * (`new Type(...)`) to composite factory calls — `SomeComposite({...})`,
24
+ * chant #1022 extends this from leaf resources (`new Type(...)`) to composite
25
+ * factory calls — `SomeComposite({...})`,
25
26
  * `propagate(SomeComposite({...}), {...})`, member access on the result
26
27
  * (`web.deployment`), and destructuring (`const { a, b } = SomeComposite(...)`
27
28
  * or `export const { a, b } = SomeComposite(...)`). A composite factory is a
28
29
  * pure function of its props (EVL009/EVL010 guarantee its body only
29
30
  * references props, sibling members, and imports), so — exactly like a
30
- * resource constructor — it's safe to resolve through the file's imports and
31
- * actually invoke with statically-folded props: no need to pre-verify "is
32
- * this specifically a registered composite" via a shared registry (which
33
- * would be unreliable across separately-loaded module instances of
34
- * `@intentius/chant` anyway) {@link resolveCallExpression} just resolves,
35
- * invokes, and lets the RESULT speak. If it satisfies
36
- * {@link isCompositeInstance} (or, for a plain resource-returning helper,
37
- * {@link isDeclarable}), it's used. Nested composites and `propagate()`'d
38
- * shared props need no special-casing: a nested composite is just another
39
- * member the real factory call already produced (real JS execution inside a
40
- * trusted module), and `propagate` is just another resolvable imported
41
- * function that receives a live `CompositeInstance` plus folded shared props
42
- * and returns it `expandComposite()` (invoked downstream by
43
- * `collectEntities`, unchanged) does the recursive expansion and the shared-
44
- * prop merge exactly as it does for the run path.
31
+ * resource constructor — it is resolved through the file's imports and
32
+ * INVOKED with statically-folded props, and the RESULT is what matters: if it
33
+ * satisfies {@link isCompositeInstance} (or, for a plain resource-returning
34
+ * helper, {@link isDeclarable}), it's used. Nested composites and
35
+ * `propagate()`'d shared props need no special-casing there: a nested
36
+ * composite is just another member the real factory call already produced,
37
+ * and `propagate` is just another resolvable imported function that receives a
38
+ * live `CompositeInstance` plus folded shared props and returns it —
39
+ * `expandComposite()` (invoked downstream by `collectEntities`, unchanged)
40
+ * does the recursive expansion and the shared-prop merge exactly as it does
41
+ * for the run path.
42
+ *
43
+ * chant #1023 (epic #1019 Phase 5) removes that invocation where it can. When
44
+ * the callee is a composite defined in a PROJECT file as
45
+ * `Composite(<fn>, "<name>")` and `<fn>`'s body stays inside a closed,
46
+ * documented subset, its body is INTERPRETED instead — the defining module is
47
+ * never imported, and the members are built here, by the lexicon's own
48
+ * constructors, from the same folded props. That closes the last place a file
49
+ * reported as `[fold:fold]` could still execute project-authored code in the
50
+ * CLI's process (#1093), and lets such a file fold under `--sandbox` rather
51
+ * than being demoted to the child (#1111). A factory outside the subset keeps
52
+ * invoking, unchanged. See the contract block above
53
+ * {@link resolveInterpretableFactory} for the five admissibility rules and
54
+ * what interpretation preserves.
45
55
  */
46
56
  /** One exported `const` name folded to a real, constructed `Declarable` or `CompositeInstance`. */
47
57
  export type FoldedEntity = [name: string, entity: Declarable | CompositeInstance];
@@ -191,6 +201,25 @@ export interface FoldSession {
191
201
  * only the fold half would buy nothing there.
192
202
  */
193
203
  readonly sandbox: boolean;
204
+ /**
205
+ * chant #1023 — per-build memo for {@link readFactoryModule}, keyed by the
206
+ * resolved absolute path of a module that DEFINES a composite. A composite
207
+ * defined once and called from a dozen sibling files is parsed, and its
208
+ * imports resolved, exactly once per build — the same reason
209
+ * {@link FoldSession.cache} exists for the files discovery folds directly.
210
+ *
211
+ * Separate from `cache` because the two ask different questions of the same
212
+ * file: `cache` asks "what are this module's exported VALUES" (and fails
213
+ * outright for a module that exports a function declaration, which a
214
+ * composite-defining module very often does); this asks "what is this
215
+ * module's static SCOPE" — its consts, its imports, and those imports'
216
+ * already-resolved values — which is well-defined even when the module as a
217
+ * whole doesn't fold. `lexicons/aws/examples/lambda-api/src/lambda-api.ts`
218
+ * is exactly that case: it exports two plain functions alongside its
219
+ * `Composite`, so it never folds, and its `LambdaApi` is interpretable
220
+ * regardless.
221
+ */
222
+ readonly factoryModules: Map<string, Promise<FactoryModuleScope | undefined>>;
194
223
  }
195
224
  /**
196
225
  * chant #1063 — the package specifier a lexicon NAME (`"aws"`, `"gitlab"`)
@@ -212,6 +241,112 @@ export declare function lexiconPackageName(lexiconName: string): string;
212
241
  * see {@link FoldSession.sandbox}.
213
242
  */
214
243
  export declare function createFoldSession(intrinsics?: readonly IntrinsicDef[], buildParams?: Readonly<Record<string, BuildParamValue>>, lexicons?: readonly string[], sandbox?: boolean): FoldSession;
244
+ /**
245
+ * What the fold pass actually EXECUTED, and what it interpreted instead — the
246
+ * number chant #1023 is measured by, and the one the #1093/#1111
247
+ * execution-boundary report could not state before: `--sandbox` proves
248
+ * *nothing project-owned ran in this process*, but plain `--fold` still
249
+ * invoked composite factories in-process, and nothing counted them.
250
+ *
251
+ * Purely observational. Two integer increments on paths that were already
252
+ * about to perform a dynamic `import()` or parse a module, so it costs
253
+ * nothing measurable and changes no decision.
254
+ */
255
+ export interface FoldExecutionCounts {
256
+ /**
257
+ * Composite-factory / wrapper calls {@link resolveCallExpression} resolved
258
+ * by importing the defining module and CALLING it in this process.
259
+ */
260
+ factoryInvocations: number;
261
+ /**
262
+ * Of {@link factoryInvocations}, the ones whose callee came from a PROJECT
263
+ * FILE (a relative/absolute specifier) rather than a lexicon package or
264
+ * chant's own — i.e. the ones that execute project-authored code here. Text
265
+ * only ({@link isProjectFileSpecifier}); no resolution is performed to
266
+ * classify.
267
+ */
268
+ projectFactoryInvocations: number;
269
+ /**
270
+ * Composite factory bodies {@link interpretCompositeFactory} evaluated
271
+ * statically instead — each one an invocation that did NOT happen.
272
+ */
273
+ factoryInterpretations: number;
274
+ }
275
+ /** A snapshot of {@link FoldExecutionCounts}. Process-wide and monotonic — a caller wanting a per-build figure calls {@link resetFoldExecutionCounts} first. */
276
+ export declare function foldExecutionCounts(): Readonly<FoldExecutionCounts>;
277
+ /** Zero {@link foldExecutionCounts}, for a caller measuring one build. */
278
+ export declare function resetFoldExecutionCounts(): void;
279
+ /** Where an imported local identifier came from. */
280
+ interface ImportBinding {
281
+ specifier: string;
282
+ imported: string;
283
+ /** The `import ... from "specifier"` declaration's module-specifier
284
+ * string-literal node (chant #1020) — used to attach a source position to
285
+ * a cross-file resolution failure (in particular an import-cycle
286
+ * diagnostic) at the referencing site, not just the defining one. */
287
+ specifierNode: ts.StringLiteral;
288
+ }
289
+ /** Where a namespace import (`import * as ns from "specifier"`) came from — chant #1020. */
290
+ interface NamespaceImportBinding {
291
+ specifier: string;
292
+ specifierNode: ts.StringLiteral;
293
+ }
294
+ /**
295
+ * The static scope of a module that DEFINES composites — everything
296
+ * interpreting one of its factory bodies needs, computed once per module per
297
+ * build (see {@link FoldSession.factoryModules}).
298
+ *
299
+ * Note what is NOT here: the module's exported VALUES. Interpreting a factory
300
+ * never needs them, which is the whole point — a module can define a perfectly
301
+ * interpretable composite and still be unfoldable as a module (an exported
302
+ * function declaration alongside it, say), and those two facts are
303
+ * independent.
304
+ */
305
+ interface FactoryModuleScope {
306
+ file: string;
307
+ sourceFile: ts.SourceFile;
308
+ /**
309
+ * The module's top-level `const`s, MINUS every one that resolves to a
310
+ * `new Type(...)` resource.
311
+ *
312
+ * The exclusion is the load-bearing part. `fold()` turns a property access
313
+ * on a resource-valued const into a symbolic `{__attrRef, entity: "<the
314
+ * const's name>"}` — a name resolved much later, against the entity table of
315
+ * the file being COLLECTED, which is the calling file and not this one. A
316
+ * module-level resource shared by every call of a factory is also a
317
+ * singleton whose identity the run path shares and interpretation would not.
318
+ * Dropping those consts makes any reference to one an ordinary "unresolved
319
+ * identifier" failure, which declines the interpretation and invokes
320
+ * instead — the answer that is right on both counts.
321
+ */
322
+ consts: Map<string, ts.Expression>;
323
+ imports: Map<string, ImportBinding>;
324
+ namespaceImports: Map<string, NamespaceImportBinding>;
325
+ /**
326
+ * This module's own imports, resolved to their real cross-file values (see
327
+ * {@link ResolveCtx.externals}) — LAZILY, and memoized here once built.
328
+ *
329
+ * Laziness is not an optimization detail, it is what keeps this issue from
330
+ * paying #1020's cost all over again. `resolveCallExpression` reaches
331
+ * {@link resolveInterpretableFactory} for EVERY call through a project-file
332
+ * import, the overwhelming majority of which are not composites at all. Only
333
+ * the parse is spent finding that out; resolving a module's whole import
334
+ * graph — which recursively folds every project file it names — is spent
335
+ * only by a call that is actually about to be interpreted.
336
+ */
337
+ resolved?: Promise<{
338
+ externals: Map<string, unknown>;
339
+ failures: Map<string, string>;
340
+ }>;
341
+ }
342
+ /**
343
+ * The SHAPE half of the contract (rules 3-5) — a lone `ts` node in, a reason
344
+ * string out, or `undefined` when the factory is admissible. Deliberately
345
+ * takes nothing but the node: it is the half a caller with no module graph
346
+ * could evaluate, and keeping it separable is what lets the doc above claim
347
+ * the shape rules are checkable without the provenance ones.
348
+ */
349
+ export declare function findFactorySubsetViolation(fn: ts.ArrowFunction | ts.FunctionExpression): string | undefined;
215
350
  /**
216
351
  * Attempt to fold one source file with zero execution of its own top-level
217
352
  * code. Returns the folded, instantiated entities on success, or a reason
@@ -298,4 +433,5 @@ export declare function tryFoldFile(file: string, intrinsics?: readonly Intrinsi
298
433
  * boundary, unchanged.
299
434
  */
300
435
  export declare function planFoldTaint(files: readonly string[], wouldFold: ReadonlyMap<string, boolean>, liveSources?: ReadonlyMap<string, ReadonlySet<string>>): Promise<Set<string>>;
436
+ export {};
301
437
  //# sourceMappingURL=fold-import.d.ts.map
@@ -1 +1 @@
1
- {"version":3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;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"}
@@ -27,8 +27,9 @@
27
27
  * ## What `ChantConfig` legally holds
28
28
  *
29
29
  * Every field of `ChantConfig` (`../../config.ts`) is JSON data: string arrays
30
- * (`lexicons`, `capabilities`, `environments`), strings (`sourceDir`), nested
31
- * plain objects of strings/booleans (`ownership`, `build`, `release`, `sbom`,
30
+ * (`lexicons`, `capabilities`), strings (`sourceDir`), an array of strings or
31
+ * plain `{ name, endpoint }` objects (`environments`, #1166), nested plain
32
+ * objects of strings/booleans (`ownership`, `build`, `release`, `sbom`,
32
33
  * `signing`, `vulnPolicy`), arrays of plain objects (`stacks`), and records of
33
34
  * plain objects (`buildParams`). `lint` is a `LintConfig`, whose rule values
34
35
  * are a severity string or a `[severity, options]` tuple, and whose `plugins`
@@ -1 +1 @@
1
- {"version":3,"file":"config-wire.d.ts","sourceRoot":"","sources":["../../../src/discovery/sandbox/config-wire.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AAEH,8EAA8E;AAC9E,MAAM,WAAW,kBAAkB;IACjC,6FAA6F;IAC7F,IAAI,EAAE,MAAM,CAAC;IACb,wFAAwF;IACxF,KAAK,EAAE,MAAM,CAAC;CACf;AAiFD;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,SAAK,GAAG,kBAAkB,EAAE,CAIvF;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,kBAAkB,EAAE,CAe1E;AAED,2IAA2I;AAC3I,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,SAAS,kBAAkB,EAAE,GACvC,MAAM,CAOR"}
1
+ {"version":3,"file":"config-wire.d.ts","sourceRoot":"","sources":["../../../src/discovery/sandbox/config-wire.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AAEH,8EAA8E;AAC9E,MAAM,WAAW,kBAAkB;IACjC,6FAA6F;IAC7F,IAAI,EAAE,MAAM,CAAC;IACb,wFAAwF;IACxF,KAAK,EAAE,MAAM,CAAC;CACf;AAiFD;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,SAAK,GAAG,kBAAkB,EAAE,CAIvF;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,kBAAkB,EAAE,CAe1E;AAED,2IAA2I;AAC3I,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,SAAS,kBAAkB,EAAE,GACvC,MAAM,CAOR"}
package/dist/env.d.ts CHANGED
@@ -17,6 +17,7 @@
17
17
  * Run `chant graph --env prod` and `chant graph --env dev` to get the two graphs;
18
18
  * pinhole renders/diffs them to show environment drift (INTENTIUS/pinhole#3).
19
19
  */
20
+ import { type EnvironmentDeclaration } from "./config.js";
20
21
  /** The environment variable the CLI sets from `--env`. */
21
22
  export declare const ENV_VAR = "CHANT_ENV";
22
23
  /** The active environment for this run (from `--env`), or `fallback` if none. */
@@ -25,7 +26,9 @@ export declare function env(fallback?: string): string | undefined;
25
26
  * Validate a requested environment against the project's declared `environments`
26
27
  * (`chant.config`). Returns an error message for an unknown env, or `undefined`
27
28
  * when it's valid (or when the project declares no environments, in which case
28
- * any name is accepted).
29
+ * any name is accepted). `declared` entries may be a bare name or `{ name,
30
+ * endpoint }` (#1166) — {@link environmentNames} reduces either to the names
31
+ * this checks against.
29
32
  */
30
- export declare function unknownEnvError(requested: string | undefined, declared: string[] | undefined): string | undefined;
33
+ export declare function unknownEnvError(requested: string | undefined, declared: EnvironmentDeclaration[] | undefined): string | undefined;
31
34
  //# 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,0DAA0D;AAC1D,eAAO,MAAM,OAAO,cAAc,CAAC;AAEnC,iFAAiF;AACjF,wBAAgB,GAAG,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEzD;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAIjH"}
1
+ {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAoB,KAAK,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEzE,0DAA0D;AAC1D,eAAO,MAAM,OAAO,cAAc,CAAC;AAEnC,iFAAiF;AACjF,wBAAgB,GAAG,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEzD;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,QAAQ,EAAE,sBAAsB,EAAE,GAAG,SAAS,GAC7C,MAAM,GAAG,SAAS,CAKpB"}
@@ -245,6 +245,18 @@ export declare function locate(node: ts.Node): {
245
245
  * name -> initializer map. Single-file only (cross-file is #1020).
246
246
  */
247
247
  export declare function collectConsts(sourceFile: ts.SourceFile): Map<string, ts.Expression>;
248
+ /**
249
+ * A property/element key foldable without execution: identifier, string, or
250
+ * numeric literal.
251
+ *
252
+ * Exported for chant #1023's composite-factory interpreter
253
+ * (../discovery/fold-import.ts), which walks object literals itself — a
254
+ * factory body may construct a resource inside one, which {@link fold} has no
255
+ * case for — and must reject a computed key with the identical message
256
+ * {@link fold} would, rather than growing a second, silently divergent copy of
257
+ * this rule.
258
+ */
259
+ export declare function propName(node: ts.PropertyName): string;
248
260
  /**
249
261
  * Fold a single expression node to a value. Throws {@link FoldError} for
250
262
  * anything outside the supported subset — including any `CallExpression`
@@ -1 +1 @@
1
- {"version":3,"file":"fold.d.ts","sourceRoot":"","sources":["../../src/fold/fold.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAyC,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AACtF,OAAO,EAaL,KAAK,YAAY,EAClB,MAAM,UAAU,CAAC;AAGlB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;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,MAAM,EAAE,CAAC;IAClB,MAA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AM,EAAE,EAAE,CAAC,UAAU,CAAC,EAClC,UAAU,GAAE,SAAS,YAAY,EAAO,EACxC,SAAS,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,GACvC,WAAW,CA0Qb;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,EAAE,CAAC,aAAa,EACtB,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,EAClC,UAAU,GAAE,SAAS,YAAY,EAAO,EACxC,SAAS,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,GACvC,cAAc,CA6BhB;AAMD;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,MAAM,EACd,QAAQ,SAAc,EACtB,UAAU,GAAE,SAAS,YAAY,EAAO,GACvC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CA6BjC"}
@@ -1,5 +1,6 @@
1
1
  import { type Declarable } from "./declarable.js";
2
2
  import type { ResourceMetadata } from "./lexicon.js";
3
+ import type { UnobservedEntity } from "./observation.js";
3
4
  /**
4
5
  * Graph IR — the engine-neutral, lint-gated representation of a project's
5
6
  * resolved infrastructure graph. Painters (mermaid, graphviz, custom SVG) and
@@ -131,6 +132,12 @@ export declare function buildGraphIr(entities: Map<string, Declarable>, projectP
131
132
  export interface LiveObservation {
132
133
  lexicon: string;
133
134
  resources: Record<string, ResourceMetadata>;
135
+ /**
136
+ * Declared entities the lexicon could not observe (#1089), keyed by name.
137
+ * They are not live nodes — but they are not confirmed-absent either, so the
138
+ * overlay must not paint them "pending". See {@link sourceOverlayGraphs}.
139
+ */
140
+ unobserved?: Record<string, UnobservedEntity>;
134
141
  }
135
142
  /**
136
143
  * Build the graph IR from **live-observed** resources (`chant graph --live`) —
@@ -144,16 +151,30 @@ export interface LiveObservation {
144
151
  * key) and `ownership` marker. `attrs` is the resource's observed attributes.
145
152
  */
146
153
  export declare function buildLiveGraphIr(observations: LiveObservation[]): GraphIR;
154
+ /** How an overlay learns which declared nodes were never looked at (#1089). */
155
+ export interface OverlayOptions {
156
+ /**
157
+ * Declared entities the observation could not read, keyed by name (union of
158
+ * every {@link LiveObservation}'s `unobserved`). They are tagged `neutral`
159
+ * instead of `accent`: "not yet provisioned" is a claim the read never
160
+ * supported.
161
+ */
162
+ unobserved?: Record<string, UnobservedEntity>;
163
+ }
164
+ /** The union of every observation's unobserved entities — the input to the overlays. */
165
+ export declare function collectUnobserved(observations: LiveObservation[]): Record<string, UnobservedEntity>;
147
166
  /**
148
167
  * Overlay the declared graph on the provisioned one (#780, `chant graph --live
149
168
  * --overlay`) and classify each resource, tagging a `_status` a renderer colours:
150
169
  * - **managed** (declared + provisioned) → `good`
151
170
  * - **foreign** (provisioned, not declared) → `warn`
152
- * - **pending** (declared, not yet provisioned) → `accent`
171
+ * - **pending** (declared, provider confirmed absent) → `accent`
172
+ * - **unobserved** (declared, chant could not look — #1089) → `neutral`,
173
+ * plus an `_unobserved` attr carrying the reason
153
174
  * Live nodes keep their edges/containment; pending nodes are appended (they have
154
175
  * no live edges). Sorted; the live groups pass through unchanged.
155
176
  */
156
- export declare function overlayGraphs(live: GraphIR, declared: GraphIR): GraphIR;
177
+ export declare function overlayGraphs(live: GraphIR, declared: GraphIR, opts?: OverlayOptions): GraphIR;
157
178
  /**
158
179
  * Source-anchored overlay (#821) — the inverse of {@link overlayGraphs}. The
159
180
  * **declared** graph is the canvas, so its edges are kept: cross-substrate edges
@@ -165,11 +186,15 @@ export declare function overlayGraphs(live: GraphIR, declared: GraphIR): GraphIR
165
186
  * Each declared node is classified against live observation and tagged `_status`:
166
187
  * - **managed** (declared + provisioned) → `good`, carrying the observed
167
188
  * `physicalId` / `ownership` onto the declared node
168
- * - **pending** (declared, not provisioned) → `accent`
189
+ * - **pending** (declared, provider confirmed absent) → `accent`
190
+ * - **unobserved** (declared, chant could not look — #1089) → `neutral`, with
191
+ * the reason on `_unobserved`. A wrong-cluster or unsupported-kind read used
192
+ * to paint the whole estate "pending", which is the diagram equivalent of
193
+ * planning a create for something that already exists.
169
194
  * **Foreign** resources (provisioned, not declared) are appended and tagged
170
195
  * `warn`, together with any live-reconstructed edges that touch them — a declared
171
196
  * edge cannot describe an undeclared resource. Declared groups/exports pass
172
197
  * through unchanged; nodes and edges are sorted for deterministic output.
173
198
  */
174
- export declare function sourceOverlayGraphs(declared: GraphIR, live: GraphIR): GraphIR;
199
+ export declare function sourceOverlayGraphs(declared: GraphIR, live: GraphIR, opts?: OverlayOptions): GraphIR;
175
200
  //# sourceMappingURL=graph-ir.d.ts.map
@@ -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;AAElD;;;;;;;;GAQG;AAEH,iFAAiF;AACjF,MAAM,WAAW,SAAS;IACxB,8EAA8E;IAC9E,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wEAAwE;AACxE,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,iCAAiC;AACjC,MAAM,WAAW,MAAM;IACrB,kEAAkE;IAClE,EAAE,EAAE,MAAM,CAAC;IACX,wCAAwC;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,yEAAyE;IACzE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,mCAAmC;IACnC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;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B,CAAC,YAAY,EAAE,eAAe,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAInG;AAgBD;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAc9F;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAoCpG"}
package/dist/index.d.ts CHANGED
@@ -47,6 +47,7 @@ export * from "./lint/discover.js";
47
47
  export * from "./import/parser.js";
48
48
  export * from "./import/generator.js";
49
49
  export * from "./lexicon.js";
50
+ export * from "./observation.js";
50
51
  export * from "./lexicon-integrity.js";
51
52
  export * from "./lexicon-manifest.js";
52
53
  export * from "./lexicon-schema.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,QAAQ,CAAC;AACvB,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CA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ACZ,oBAAoB,EACpB,iBAAiB,EACjB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,YAAY,GAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,2BAA2B,EAC3B,oBAAoB,EACpB,oBAAoB,EACpB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAC/B,KAAK,qBAAqB,GAC3B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,KAAK,SAAS,EACd,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,GACtB,MAAM,0BAA0B,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAElC,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAClE,cAAc,EAAE,iBAAiB,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC5F,YAAY,EAAE,QAAQ,EAAE,eAAe,EAAE,cAAc,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
@@ -19,6 +19,7 @@
19
19
  * Config Connector observation needs it too without taking a dependency on
20
20
  * the k8s lexicon.
21
21
  */
22
+ import type { UnobservedReason } from "./observation.js";
22
23
  /** A single environment's cluster binding — see `K8sChantConfig` in the k8s lexicon. */
23
24
  export interface K8sClusterProfile {
24
25
  /** kubectl context name this environment is bound to. */
@@ -70,4 +71,30 @@ export interface ResolvedClusterTarget {
70
71
  * reading the wrong cluster.
71
72
  */
72
73
  export declare function resolveClusterTarget(config: Record<string, unknown>, environment: string, lexiconName: string): Promise<ResolvedClusterTarget>;
74
+ /**
75
+ * What a failed `kubectl get` actually proved. Shared by the k8s and gcp
76
+ * lexicons, which read through the same kubectl path and used to collapse every
77
+ * non-zero exit into "not there" — so an expired token, a downed API server, or
78
+ * an uninstalled CRD all classified as `create`.
79
+ */
80
+ export type KubectlReadOutcome =
81
+ /** The API server answered and the object is not there. Safe to plan a create. */
82
+ {
83
+ kind: "absent";
84
+ }
85
+ /** The read proved nothing about the object's existence. */
86
+ | {
87
+ kind: "unobserved";
88
+ reason: UnobservedReason;
89
+ detail: string;
90
+ };
91
+ /**
92
+ * Classify a `kubectl get` failure into the observation tri-state (#1089).
93
+ *
94
+ * Only a genuine `NotFound` from the API server — or a kind the server does not
95
+ * serve at all, where no instance can exist — establishes absence. Auth,
96
+ * connectivity, and unresolvable contexts establish nothing, and must reach the
97
+ * change set as NOT-OBSERVED rather than as an empty result.
98
+ */
99
+ export declare function classifyKubectlFailure(err: unknown): KubectlReadOutcome;
73
100
  //# sourceMappingURL=kubectl-context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"kubectl-context.d.ts","sourceRoot":"","sources":["../src/kubectl-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAOH,wFAAwF;AACxF,MAAM,WAAW,iBAAiB;IAChC,yDAAyD;IACzD,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wFAAwF;AACxF,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;CAC9C;AAED;;;;;;GAMG;AACH,qBAAa,2BAA4B,SAAQ,KAAK;aAElC,WAAW,EAAE,MAAM;aACnB,eAAe,EAAE,MAAM;aACvB,cAAc,EAAE,MAAM;gBAFtB,WAAW,EAAE,MAAM,E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