@telorun/analyzer 0.51.0 → 0.53.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.
@@ -1 +1 @@
1
- {"version":3,"file":"analyzer.d.ts","sourceRoot":"","sources":["../src/analyzer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAIzE,OAAO,EACL,aAAa,EAEb,KAAK,YAAY,EAElB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAIL,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,EACL,KAAK,aAAa,EAGnB,MAAM,0BAA0B,CAAC;AA2BlC,OAAO,EAAsB,KAAK,kBAAkB,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AA0E/F;;;;;uDAKuD;AACvD,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,kBAAkB,EACxB,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAClC,aAAa,GAAG;IAAE,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS,CAAA;CAAE,CAO9F;AA6FD;0CAC0C;AAC1C,eAAO,MAAM,eAAe,GAAI,OAAO;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,KAAG,OACT,CAAC;AAErD;8EAC8E;AAC9E,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGhD;AAuBD;2DAC2D;AAC3D,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,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,SAAS,EAAE,gBAAgB,EAAE,EAC7B,QAAQ,EAAE,gBAAgB,EAI1B,kBAAkB,CAAC,EAAE,gBAAgB,EAAE,GACtC,gBAAgB,EAAE;IAyBrB,OAAO,CACL,SAAS,EAAE,gBAAgB,EAAE,EAC7B,QAAQ,EAAE,gBAAgB,GACzB;QAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;QAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE;CAsB5F"}
package/dist/analyzer.js CHANGED
@@ -6,7 +6,7 @@ import { DefinitionRegistry } from "./definition-registry.js";
6
6
  import { effectiveAuthorSchema } from "./extends-resolution.js";
7
7
  import { PERMISSIVE_CONTRACT, resolveContract, } from "./invocation-contract.js";
8
8
  import { buildDependencyGraph, formatCycle } from "./dependency-graph.js";
9
- import { buildKernelGlobalsSchema, mergeKernelGlobalsIntoContext } from "./kernel-globals.js";
9
+ import { buildKernelGlobalsSchema, KERNEL_GLOBAL_NAMES, mergeKernelGlobalsIntoContext, } from "./kernel-globals.js";
10
10
  import { buildObservedStateIndex, buildObservedStateResourcesSchema, collectRunReachableNames, observedStateRead, validateObservedStateDeclarations, } from "./validate-observed-state.js";
11
11
  import { computeSuggestKind } from "./kind-suggest.js";
12
12
  import { visitManifest } from "./manifest-visitor.js";
@@ -21,11 +21,13 @@ import { rewriteSyntheticOrigins } from "./rewrite-synthetic-origins.js";
21
21
  import { celTypeSatisfiesJsonSchema, substituteCelFields, validateAgainstSchema, } from "./schema-compat.js";
22
22
  import { collectValueSchemaIssues } from "./validate-value-schema.js";
23
23
  import { DiagnosticSeverity } from "./types.js";
24
- import { extractAccessChains, extractCelRegionScopes, extractContextsFromSchema, getManifestItem, pathMatchesScope, resolveContextAnnotations, } from "./validate-cel-context.js";
24
+ import { extractAccessChains, extractCelRegionScopes, extractContextsFromSchema, getManifestItem, pathMatchesScope, resolveContextAnnotations, resolveTypeFieldToSchema, } from "./validate-cel-context.js";
25
25
  import { buildEvalPaths, evalPathsCover } from "./eval-paths.js";
26
+ import { BINDINGS_ANNOTATION, bindingContextProperties, bindingPathChain, CEL_RESERVED_WORDS, findBindingSites, resolveBindingOrder, schemaAtChain, } from "./cel-bindings.js";
26
27
  import { validateExtends } from "./validate-extends.js";
27
28
  import { validateLogging } from "./validate-logging.js";
28
29
  import { validateModuleArtifact } from "./validate-module-artifact.js";
30
+ import { validateModuleMetadata } from "./validate-module-metadata.js";
29
31
  import { validateBaseMapping } from "./validate-base-mapping.js";
30
32
  import { validateInvocationContract } from "./validate-invocation-contract.js";
31
33
  import { collectStepInputIssues } from "./validate-step-inputs.js";
@@ -307,12 +309,18 @@ function buildStepContextSchema(manifest, defSchema, allManifests, defs, aliases
307
309
  continue;
308
310
  const invokeField = stepCtx.invoke;
309
311
  const outputTypeField = stepCtx.outputType;
312
+ // Optional: the field a step uses to produce a result without dispatching.
313
+ // Only a kind that declares one has pure steps at all.
314
+ const valueField = stepCtx.value;
310
315
  if (!invokeField || !outputTypeField)
311
316
  continue;
312
317
  const steps = manifest[fieldName];
313
318
  if (!Array.isArray(steps))
314
319
  continue;
315
320
  const stepItemSchema = resolveLocalRef(fieldSchema.items, defSchema);
321
+ // The instance's own input contract, for typing a pure step that just
322
+ // forwards one of its values.
323
+ const ownInputs = resolveTypeFieldToSchema(manifest.inputType, allManifests);
316
324
  const stepProperties = {};
317
325
  walkStepArray(steps, stepItemSchema, defSchema, fieldName, (s) => {
318
326
  const name = s.name;
@@ -321,8 +329,29 @@ function buildStepContextSchema(manifest, defSchema, allManifests, defs, aliases
321
329
  // wrappers (try/if/while/switch/throw) don't produce a result and must
322
330
  // not shadow real entries with a permissive `additionalProperties: true`,
323
331
  // or unknown step references slip through chain validation.
324
- if (typeof name !== "string" || !invoke || typeof invoke !== "object")
332
+ if (typeof name !== "string")
325
333
  return;
334
+ if (!invoke || typeof invoke !== "object") {
335
+ // A pure step dispatches nothing, so there is no contract to resolve.
336
+ // Where its expression is a plain chain into something already typed —
337
+ // an earlier step's result, or the kind's own inputs — that type carries
338
+ // through; anything else (arithmetic, a call, a comprehension) stays
339
+ // permissive rather than guessed. Same rule as a named binding's.
340
+ if (valueField && valueField in s) {
341
+ const scopeRoot = {
342
+ properties: {
343
+ steps: { type: "object", properties: { ...stepProperties } },
344
+ ...(ownInputs ? { inputs: ownInputs } : {}),
345
+ },
346
+ };
347
+ const chained = schemaAtChain(bindingPathChain(s[valueField]), scopeRoot);
348
+ stepProperties[name] = {
349
+ type: "object",
350
+ properties: { result: chained ?? PERMISSIVE_CONTRACT },
351
+ };
352
+ }
353
+ return;
354
+ }
326
355
  const invokedKind = invoke.kind;
327
356
  const invokedName = invoke.name;
328
357
  // A named `!ref` carries the target's own manifest (which may narrow the
@@ -618,6 +647,26 @@ function errorContextForPath(path, scopes) {
618
647
  }
619
648
  return best?.schema;
620
649
  }
650
+ /** Add a kind's named bindings to a resolved context, when the context declares
651
+ * a bindings region. They go UNDER the context's own properties: a scope
652
+ * variable wins over a same-named binding at runtime, so static typing has to
653
+ * agree (the collision itself is `BINDING_NAME_RESERVED`). */
654
+ function withBindingNames(contextSchema, resource) {
655
+ const field = contextSchema[BINDINGS_ANNOTATION];
656
+ if (typeof field !== "string")
657
+ return contextSchema;
658
+ const bindings = resource[field];
659
+ if (bindings === null || typeof bindings !== "object" || Array.isArray(bindings)) {
660
+ return contextSchema;
661
+ }
662
+ return {
663
+ ...contextSchema,
664
+ properties: {
665
+ ...bindingContextProperties(bindings, contextSchema),
666
+ ...(contextSchema.properties ?? {}),
667
+ },
668
+ };
669
+ }
621
670
  /** Member-access chains in a CEL expression, or none when it doesn't parse.
622
671
  * Best-effort: a syntax error is reported by the engine pass, not here. */
623
672
  function celAccessChains(env, expr) {
@@ -1036,6 +1085,10 @@ export class StaticAnalyzer {
1036
1085
  // would otherwise fail on a consumer's machine — or, for a mistyped platform
1037
1086
  // axis, silently offer one platform's binary to every host.
1038
1087
  diagnostics.push(...validateModuleArtifact(allManifests));
1088
+ // The descriptive `metadata:` surface. Nothing in the kernel branches on
1089
+ // these fields, which is precisely why they need a check: a mistyped one
1090
+ // has no runtime failure mode that would ever surface it.
1091
+ diagnostics.push(...validateModuleMetadata(allManifests, defs, aliases));
1039
1092
  }
1040
1093
  resolveSchemaTypeRefs(allManifests, aliases, aliasesByModule);
1041
1094
  // Trusted-input fast path: when the caller has already attested that
@@ -1414,6 +1467,9 @@ export class StaticAnalyzer {
1414
1467
  // `x-telo-step-context` / `x-telo-error-context` scopes. A `!cel` outside
1415
1468
  // every region is read as a literal — the runtime never evaluates it.
1416
1469
  let celEvalPaths = [];
1470
+ // The bindings field this kind declares (if any), read by the CEL sites that
1471
+ // see the names it introduces.
1472
+ let celBindingSites;
1417
1473
  // The compile half alone: a field that resolves at startup, where observed
1418
1474
  // state cannot exist yet.
1419
1475
  let celCompilePaths = [];
@@ -1444,6 +1500,72 @@ export class StaticAnalyzer {
1444
1500
  }
1445
1501
  }
1446
1502
  celErrorScopes = collectErrorContextScopes(e.definition?.schema);
1503
+ celBindingSites = findBindingSites(e.definition?.schema);
1504
+ if (celBindingSites) {
1505
+ const declared = m[celBindingSites.field];
1506
+ const bindingsName = m.metadata?.name;
1507
+ const bindingsFile = m.metadata?.source;
1508
+ const resourceRef = { kind: m.kind, name: bindingsName ?? "" };
1509
+ // Which field holds the bindings would otherwise be decided by
1510
+ // schema walk order, silently.
1511
+ if (celBindingSites.fields.length > 1) {
1512
+ diagnostics.push({
1513
+ severity: DiagnosticSeverity.Error,
1514
+ code: "BINDING_FIELD_AMBIGUOUS",
1515
+ source: SOURCE,
1516
+ message: `${m.kind}/${bindingsName}: the kind's schema points '${BINDINGS_ANNOTATION}' at more than one field (${celBindingSites.fields.join(", ")}). Every annotated context must name the same bindings field.`,
1517
+ data: { resource: resourceRef, filePath: bindingsFile, path: celBindingSites.field },
1518
+ });
1519
+ }
1520
+ if (declared !== null && typeof declared === "object" && !Array.isArray(declared)) {
1521
+ for (const cycle of resolveBindingOrder(declared).cycles) {
1522
+ diagnostics.push({
1523
+ severity: DiagnosticSeverity.Error,
1524
+ code: "BINDING_CYCLE",
1525
+ source: SOURCE,
1526
+ message: `${m.kind}/${bindingsName}: '${celBindingSites.field}' has a cycle — ${cycle.join(" → ")}. A binding is resolved from the ones it references, so it cannot reference itself, directly or through others.`,
1527
+ data: {
1528
+ resource: resourceRef,
1529
+ filePath: bindingsFile,
1530
+ path: `${celBindingSites.field}.${cycle[0]}`,
1531
+ },
1532
+ });
1533
+ }
1534
+ // Every name the CEL environment already binds at this site: the
1535
+ // kernel globals (registered straight onto the environment, not
1536
+ // contributed by any annotation), the scope the annotated contexts
1537
+ // declare, and the two the analyzer merges per site. Shadowing one
1538
+ // would leave the binding silently unreachable there — as would
1539
+ // naming it after a CEL keyword, which never lexes as a reference.
1540
+ const inScope = new Set([
1541
+ ...KERNEL_GLOBAL_NAMES,
1542
+ ...celBindingSites.scopeNames,
1543
+ ]);
1544
+ if (celStepContextSchema)
1545
+ inScope.add("steps");
1546
+ if (celErrorScopes.size > 0)
1547
+ inScope.add("error");
1548
+ const keywords = new Set(CEL_RESERVED_WORDS);
1549
+ for (const name of Object.keys(declared)) {
1550
+ const shadows = inScope.has(name);
1551
+ if (!shadows && !keywords.has(name))
1552
+ continue;
1553
+ diagnostics.push({
1554
+ severity: DiagnosticSeverity.Error,
1555
+ code: "BINDING_NAME_RESERVED",
1556
+ source: SOURCE,
1557
+ message: shadows
1558
+ ? `${m.kind}/${bindingsName}: binding '${name}' shadows a variable already in scope here (${[...inScope].sort().join(", ")}). Rename the binding — a scope variable always wins, so this one would never be read.`
1559
+ : `${m.kind}/${bindingsName}: binding '${name}' is a CEL keyword, so no expression can read it as a reference. Rename the binding.`,
1560
+ data: {
1561
+ resource: resourceRef,
1562
+ filePath: bindingsFile,
1563
+ path: `${celBindingSites.field}.${name}`,
1564
+ },
1565
+ });
1566
+ }
1567
+ }
1568
+ }
1447
1569
  // The non-eval-field check only applies to runtime resource instances:
1448
1570
  // structural / templating kinds (capability `Telo.Template`, or no
1449
1571
  // definition) carry CEL the kernel evaluates by other rules.
@@ -1565,7 +1687,7 @@ export class StaticAnalyzer {
1565
1687
  aliases,
1566
1688
  allManifests: allManifests,
1567
1689
  });
1568
- effectiveContext = mergeKernelGlobalsIntoContext(resolvedContext, kernelGlobals);
1690
+ effectiveContext = mergeKernelGlobalsIntoContext(withBindingNames(resolvedContext, m), kernelGlobals);
1569
1691
  }
1570
1692
  else if (observedStateContext) {
1571
1693
  // No `x-telo-context` matched, so nothing was chain-validated here
@@ -0,0 +1,57 @@
1
+ /** Annotation on an `x-telo-context` node naming the resource field that holds
2
+ * the kind's named CEL bindings. The field is read from the RESOURCE ROOT, not
3
+ * the per-scope manifest item: a bindings map belongs to the resource, while the
4
+ * contexts that see it may be anchored anywhere (a decision table annotates both
5
+ * `choices` and `default`). */
6
+ export declare const BINDINGS_ANNOTATION = "x-telo-bindings-from";
7
+ export interface BindingSites {
8
+ /** Resource field holding the bindings map. */
9
+ field: string;
10
+ /** Every field named by an annotation on this kind. More than one is a
11
+ * kind-authoring mistake: which of them holds the bindings would be decided
12
+ * by schema walk order. */
13
+ fields: string[];
14
+ /** Variable names the annotated contexts declare — a binding may not shadow one. */
15
+ scopeNames: Set<string>;
16
+ }
17
+ /**
18
+ * CEL keywords. A binding named after one is unreachable — `true` lexes as a
19
+ * literal, `in` as an operator — so it is reserved alongside the scope names,
20
+ * which turns silence into a diagnostic.
21
+ */
22
+ export declare const CEL_RESERVED_WORDS: readonly string[];
23
+ /** Locate a kind's bindings field and the scope names its annotated contexts
24
+ * declare. Returns undefined for a kind that declares no bindings region. */
25
+ export declare function findBindingSites(definitionSchema: Record<string, any> | undefined): BindingSites | undefined;
26
+ /** Each binding's dependencies, restricted to its siblings — an identifier that
27
+ * names something else in scope (`inputs`, `item`) is not an edge. */
28
+ export declare function bindingDependencies(bindings: Record<string, unknown>): Map<string, Set<string>>;
29
+ /** Member-access chain for a binding whose value is one bare dotted identifier
30
+ * expression (`inputs.user.name`). Null for anything else — a literal, a call,
31
+ * a comprehension, a structured value — none of which reduces to a typed path. */
32
+ export declare function bindingPathChain(value: unknown): string[] | null;
33
+ /**
34
+ * The context properties a bindings map contributes: each name typed from its
35
+ * expression where that expression is a chain into an already-typed scope
36
+ * variable, and left open otherwise.
37
+ *
38
+ * Gradual by design — the same stance `x-telo-context-element-from` takes. An
39
+ * open schema costs a missed `CEL_UNKNOWN_FIELD` under that name; inventing a
40
+ * type would cost a false one.
41
+ */
42
+ export declare function bindingContextProperties(bindings: Record<string, unknown>, contextSchema: Record<string, any>): Record<string, any>;
43
+ /** Walk a member-access chain through a schema's `properties`, returning the
44
+ * terminal node or undefined once the path leaves typed schema. */
45
+ export declare function schemaAtChain(chain: string[] | null, root: Record<string, any>): Record<string, any> | undefined;
46
+ /**
47
+ * Evaluation order derived from the reference graph, plus any cycles found.
48
+ *
49
+ * Order is what the editor and diagnostics show; the runtime does not need it,
50
+ * since lazy evaluation reaches a binding's dependencies by construction. A
51
+ * cycle is reported as the path that closes it (`a → b → a`).
52
+ */
53
+ export declare function resolveBindingOrder(bindings: Record<string, unknown>): {
54
+ order: string[];
55
+ cycles: string[][];
56
+ };
57
+ //# sourceMappingURL=cel-bindings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cel-bindings.d.ts","sourceRoot":"","sources":["../src/cel-bindings.ts"],"names":[],"mappings":"AAIA;;;;gCAIgC;AAChC,eAAO,MAAM,mBAAmB,yBAAyB,CAAC;AAE1D,MAAM,WAAW,YAAY;IAC3B,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd;;gCAE4B;IAC5B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,oFAAoF;IACpF,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACzB;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAsB/C,CAAC;AAEF;8EAC8E;AAC9E,wBAAgB,gBAAgB,CAC9B,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,GAChD,YAAY,GAAG,SAAS,CAW1B;AAuDD;uEACuE;AACvE,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAW1B;AAED;;mFAEmF;AACnF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,GAAG,IAAI,CAQhE;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACjC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAMrB;AAED;oEACoE;AACpE,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,EACtB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACxB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,CASjC;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IACtE,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;CACpB,CAwBA"}
@@ -0,0 +1,207 @@
1
+ import { isCompiledValue } from "@telorun/sdk";
2
+ import { buildCelEnvironment, extractAccessChains } from "@telorun/templating";
3
+ import { extractContextsFromSchema } from "./validate-cel-context.js";
4
+ /** Annotation on an `x-telo-context` node naming the resource field that holds
5
+ * the kind's named CEL bindings. The field is read from the RESOURCE ROOT, not
6
+ * the per-scope manifest item: a bindings map belongs to the resource, while the
7
+ * contexts that see it may be anchored anywhere (a decision table annotates both
8
+ * `choices` and `default`). */
9
+ export const BINDINGS_ANNOTATION = "x-telo-bindings-from";
10
+ /**
11
+ * CEL keywords. A binding named after one is unreachable — `true` lexes as a
12
+ * literal, `in` as an operator — so it is reserved alongside the scope names,
13
+ * which turns silence into a diagnostic.
14
+ */
15
+ export const CEL_RESERVED_WORDS = [
16
+ "as",
17
+ "break",
18
+ "const",
19
+ "continue",
20
+ "else",
21
+ "false",
22
+ "for",
23
+ "function",
24
+ "if",
25
+ "import",
26
+ "in",
27
+ "let",
28
+ "loop",
29
+ "namespace",
30
+ "null",
31
+ "package",
32
+ "return",
33
+ "true",
34
+ "var",
35
+ "void",
36
+ "while",
37
+ ];
38
+ /** Locate a kind's bindings field and the scope names its annotated contexts
39
+ * declare. Returns undefined for a kind that declares no bindings region. */
40
+ export function findBindingSites(definitionSchema) {
41
+ if (!definitionSchema)
42
+ return undefined;
43
+ const fields = [];
44
+ const scopeNames = new Set();
45
+ for (const { schema } of extractContextsFromSchema(definitionSchema)) {
46
+ const declared = schema?.[BINDINGS_ANNOTATION];
47
+ if (typeof declared !== "string" || declared.length === 0)
48
+ continue;
49
+ if (!fields.includes(declared))
50
+ fields.push(declared);
51
+ for (const name of Object.keys(schema.properties ?? {}))
52
+ scopeNames.add(name);
53
+ }
54
+ return fields.length > 0 ? { field: fields[0], fields, scopeNames } : undefined;
55
+ }
56
+ const TEMPLATE_RE = /\$\{\{\s*([^}]+?)\s*\}\}/g;
57
+ const EXACT_TEMPLATE_RE = /^\s*\$\{\{\s*([^}]+?)\s*\}\}\s*$/;
58
+ /** Parser for expressions that reach here uncompiled. Built once; the base
59
+ * environment is stateless and shared with the runtime's own. */
60
+ let parseEnv;
61
+ /**
62
+ * Root identifiers an expression source reads — the first element of every
63
+ * member-access chain, which is what a dependency edge is made of.
64
+ *
65
+ * Parsed, never lexed: `inputs.total` reads `inputs`, not `total`, and a name
66
+ * inside a string literal reads nothing. A token scan would make two bindings
67
+ * named after each other's *fields* look mutually recursive and reject a correct
68
+ * manifest — the worst outcome a static check has. An expression that does not
69
+ * parse contributes no edges; its syntax error is the engine pass's to report.
70
+ */
71
+ function addRootIdentifiers(source, out) {
72
+ try {
73
+ parseEnv ??= buildCelEnvironment();
74
+ for (const chain of extractAccessChains(parseEnv.parse(source).ast)) {
75
+ if (chain.length > 0)
76
+ out.add(chain[0]);
77
+ }
78
+ }
79
+ catch {
80
+ // Unparseable — see above.
81
+ }
82
+ }
83
+ /** Root identifiers a binding's value reads. Walks the whole value so a
84
+ * structured binding (a map with `!cel` leaves) is covered, and reads both a
85
+ * compiled expression and a still-raw `${{ }}` string — the editor's
86
+ * round-trip view never compiles. An untagged plain string is a literal, not
87
+ * an expression, and contributes nothing. */
88
+ function collectRefs(value, out) {
89
+ if (isCompiledValue(value)) {
90
+ const refs = value.refs;
91
+ if (refs)
92
+ for (const ref of refs)
93
+ out.add(ref);
94
+ else
95
+ addRootIdentifiers(value.source ?? "", out);
96
+ return;
97
+ }
98
+ if (typeof value === "string") {
99
+ for (const match of value.matchAll(TEMPLATE_RE))
100
+ addRootIdentifiers(match[1], out);
101
+ return;
102
+ }
103
+ if (Array.isArray(value)) {
104
+ for (const entry of value)
105
+ collectRefs(entry, out);
106
+ return;
107
+ }
108
+ if (value !== null && typeof value === "object") {
109
+ for (const entry of Object.values(value))
110
+ collectRefs(entry, out);
111
+ }
112
+ }
113
+ /** Each binding's dependencies, restricted to its siblings — an identifier that
114
+ * names something else in scope (`inputs`, `item`) is not an edge. */
115
+ export function bindingDependencies(bindings) {
116
+ const names = new Set(Object.keys(bindings));
117
+ const deps = new Map();
118
+ for (const [name, value] of Object.entries(bindings)) {
119
+ const refs = new Set();
120
+ collectRefs(value, refs);
121
+ const own = new Set();
122
+ for (const ref of refs)
123
+ if (names.has(ref))
124
+ own.add(ref);
125
+ deps.set(name, own);
126
+ }
127
+ return deps;
128
+ }
129
+ /** Member-access chain for a binding whose value is one bare dotted identifier
130
+ * expression (`inputs.user.name`). Null for anything else — a literal, a call,
131
+ * a comprehension, a structured value — none of which reduces to a typed path. */
132
+ export function bindingPathChain(value) {
133
+ let source;
134
+ if (isCompiledValue(value))
135
+ source = value.source;
136
+ else if (typeof value === "string")
137
+ source = value.match(EXACT_TEMPLATE_RE)?.[1];
138
+ if (source === undefined)
139
+ return null;
140
+ const expr = source.trim();
141
+ if (!/^[A-Za-z_]\w*(\.[A-Za-z_]\w*)*$/.test(expr))
142
+ return null;
143
+ return expr.split(".");
144
+ }
145
+ /**
146
+ * The context properties a bindings map contributes: each name typed from its
147
+ * expression where that expression is a chain into an already-typed scope
148
+ * variable, and left open otherwise.
149
+ *
150
+ * Gradual by design — the same stance `x-telo-context-element-from` takes. An
151
+ * open schema costs a missed `CEL_UNKNOWN_FIELD` under that name; inventing a
152
+ * type would cost a false one.
153
+ */
154
+ export function bindingContextProperties(bindings, contextSchema) {
155
+ const props = {};
156
+ for (const [name, value] of Object.entries(bindings)) {
157
+ props[name] = schemaAtChain(bindingPathChain(value), contextSchema) ?? {};
158
+ }
159
+ return props;
160
+ }
161
+ /** Walk a member-access chain through a schema's `properties`, returning the
162
+ * terminal node or undefined once the path leaves typed schema. */
163
+ export function schemaAtChain(chain, root) {
164
+ if (!chain)
165
+ return undefined;
166
+ let current = root;
167
+ for (const key of chain) {
168
+ const props = current?.properties;
169
+ if (!props || !(key in props))
170
+ return undefined;
171
+ current = props[key];
172
+ }
173
+ return current && typeof current === "object" ? current : undefined;
174
+ }
175
+ /**
176
+ * Evaluation order derived from the reference graph, plus any cycles found.
177
+ *
178
+ * Order is what the editor and diagnostics show; the runtime does not need it,
179
+ * since lazy evaluation reaches a binding's dependencies by construction. A
180
+ * cycle is reported as the path that closes it (`a → b → a`).
181
+ */
182
+ export function resolveBindingOrder(bindings) {
183
+ const deps = bindingDependencies(bindings);
184
+ const order = [];
185
+ const cycles = [];
186
+ const state = new Map();
187
+ const path = [];
188
+ const visit = (name) => {
189
+ const seen = state.get(name);
190
+ if (seen === "done")
191
+ return;
192
+ if (seen === "visiting") {
193
+ cycles.push([...path.slice(path.indexOf(name)), name]);
194
+ return;
195
+ }
196
+ state.set(name, "visiting");
197
+ path.push(name);
198
+ for (const dep of deps.get(name) ?? [])
199
+ visit(dep);
200
+ path.pop();
201
+ state.set(name, "done");
202
+ order.push(name);
203
+ };
204
+ for (const name of Object.keys(bindings))
205
+ visit(name);
206
+ return { order, cycles };
207
+ }
package/dist/index.d.ts CHANGED
@@ -5,6 +5,8 @@ export { importResolutionDiagnostics } from "./import-resolution-diagnostics.js"
5
5
  export type { GraphLoadError, ImportEdge, LoadedFile, LoadedGraph, LoadedModule, ParseError, } from "./loaded-types.js";
6
6
  export { flattenForAnalyzer, flattenLoadedModule, forwardReExportManifests, parseExportEntry, reExportSpecsFromExports, resolveExportedKinds, selectModuleManifestsForAnalysis, stampExportedKinds, stampReExportedKinds, type ParsedExportEntry, type ReExportSpec, } from "./flatten-for-analyzer.js";
7
7
  export { buildEvalPaths, evalPathCovers } from "./eval-paths.js";
8
+ export { BINDINGS_ANNOTATION, bindingContextProperties, bindingDependencies, findBindingSites, resolveBindingOrder, } from "./cel-bindings.js";
9
+ export type { BindingSites } from "./cel-bindings.js";
8
10
  export { applyObservedStateNode, buildObservedStateIndex, buildObservedStateResourcesSchema, collectRunReachableNames, observedStateRead, validateObservedStateDeclarations, OBSERVED_STATE_SCHEMA, } from "./validate-observed-state.js";
9
11
  export type { AnalyzedResource, ObservedStateRead } from "./validate-observed-state.js";
10
12
  export { moduleScopedDefResolver, scopeResolverForModule } from "./alias-resolver.js";
@@ -36,7 +38,7 @@ export type { DocumentPosition } from "./position-metadata.js";
36
38
  export { HttpSource } from "./sources/http-source.js";
37
39
  export { RegistrySource } from "./sources/registry-source.js";
38
40
  export { defaultSources } from "./sources/default-sources.js";
39
- export { splitIntegrity, foldIntegrity, verifyIntegrity, verifiedFetch, sha256Base64Url, IntegrityError, } from "./sources/integrity.js";
41
+ export { splitIntegrity, foldIntegrity, isCanonicalIntegrity, verifyIntegrity, verifiedFetch, sha256Base64Url, IntegrityError, } from "./sources/integrity.js";
40
42
  export { parseModuleRef, isRegistryRef } from "./sources/module-ref.js";
41
43
  export type { ParsedModuleRef } from "./sources/module-ref.js";
42
44
  export { OCI_SCHEME, isOciRef, parseOciRef } from "./sources/oci-ref.js";
@@ -51,6 +53,7 @@ export type { ArtifactSelector, LayerRole, PlatformAxis, PlatformTarget, } from
51
53
  export { LayerIndexError, matchControllerLayers, parseLayerIndex, singletonLayer, } from "./artifact-layer-index.js";
52
54
  export type { ArtifactLayer } from "./artifact-layer-index.js";
53
55
  export { validateModuleArtifact } from "./validate-module-artifact.js";
56
+ export { PUBLISH_BLOCKING_CODES } from "./validate-module-metadata.js";
54
57
  export { withSyntheticPositions } from "./with-synthetic-positions.js";
55
58
  export { documentToAst, parseToAst } from "./yaml-ast.js";
56
59
  export type { AstDocument, AstMap, AstNode, AstPair, AstScalar, AstSeq } from "./yaml-ast.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AACjF,YAAY,EACR,cAAc,EACd,UAAU,EACV,UAAU,EACV,WAAW,EACX,YAAY,EACZ,UAAU,GACb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACH,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACxB,gBAAgB,EAChB,wBAAwB,EACxB,oBAAoB,EACpB,gCAAgC,EAChC,kBAAkB,EAClB,oBAAoB,EACpB,KAAK,iBAAiB,EACtB,KAAK,YAAY,GACpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iBAA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AY,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAC3E,YAAY,EACR,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,WAAW,EACX,cAAc,EACd,QAAQ,EACR,aAAa,EACb,KAAK,EACR,MAAM,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -3,6 +3,7 @@ export { StaticAnalyzer } from "./analyzer.js";
3
3
  export { importResolutionDiagnostics } from "./import-resolution-diagnostics.js";
4
4
  export { flattenForAnalyzer, flattenLoadedModule, forwardReExportManifests, parseExportEntry, reExportSpecsFromExports, resolveExportedKinds, selectModuleManifestsForAnalysis, stampExportedKinds, stampReExportedKinds, } from "./flatten-for-analyzer.js";
5
5
  export { buildEvalPaths, evalPathCovers } from "./eval-paths.js";
6
+ export { BINDINGS_ANNOTATION, bindingContextProperties, bindingDependencies, findBindingSites, resolveBindingOrder, } from "./cel-bindings.js";
6
7
  export { applyObservedStateNode, buildObservedStateIndex, buildObservedStateResourcesSchema, collectRunReachableNames, observedStateRead, validateObservedStateDeclarations, OBSERVED_STATE_SCHEMA, } from "./validate-observed-state.js";
7
8
  export { moduleScopedDefResolver, scopeResolverForModule } from "./alias-resolver.js";
8
9
  export { ancestorChain, contractDeclarer, controllerBearingAncestor, effectiveAuthorSchema, effectiveContractField, effectiveStatusSchema, hasOwnControllerOrTemplate, inheritedCapability, isInheritedDelegation, mappingFieldFor, needsContractMapping, resolveParent, } from "./extends-resolution.js";
@@ -21,7 +22,7 @@ export { buildDocumentPositions, buildLineOffsets, buildPositionIndex, documentL
21
22
  export { HttpSource } from "./sources/http-source.js";
22
23
  export { RegistrySource } from "./sources/registry-source.js";
23
24
  export { defaultSources } from "./sources/default-sources.js";
24
- export { splitIntegrity, foldIntegrity, verifyIntegrity, verifiedFetch, sha256Base64Url, IntegrityError, } from "./sources/integrity.js";
25
+ export { splitIntegrity, foldIntegrity, isCanonicalIntegrity, verifyIntegrity, verifiedFetch, sha256Base64Url, IntegrityError, } from "./sources/integrity.js";
25
26
  export { parseModuleRef, isRegistryRef } from "./sources/module-ref.js";
26
27
  export { OCI_SCHEME, isOciRef, parseOciRef } from "./sources/oci-ref.js";
27
28
  export { parseVersionedRef, withRefVersion } from "./sources/versioned-ref.js";
@@ -30,6 +31,10 @@ export { MANIFEST_CACHE_BASE_URL, ManifestCacheSource, isHttpsModuleRef, manifes
30
31
  export { LAYER_ROLES, PLATFORM_AXES, ArtifactSelectorError, describeSelector, isLayerRole, normalizeSelector, selectorFromQualifiers, selectorKey, selectorMatches, } from "./artifact-selector.js";
31
32
  export { LayerIndexError, matchControllerLayers, parseLayerIndex, singletonLayer, } from "./artifact-layer-index.js";
32
33
  export { validateModuleArtifact } from "./validate-module-artifact.js";
34
+ // Warnings everywhere, fatal at `telo publish` — descriptive metadata has no
35
+ // runtime failure mode, so it must not stop a manifest running, but it is the
36
+ // module's public face the moment it is published.
37
+ export { PUBLISH_BLOCKING_CODES } from "./validate-module-metadata.js";
33
38
  export { withSyntheticPositions } from "./with-synthetic-positions.js";
34
39
  export { documentToAst, parseToAst } from "./yaml-ast.js";
35
40
  export { CelParseError, buildCelSegments, wrapCelAst } from "./cel-ast.js";
@@ -24,6 +24,16 @@ export declare function splitIntegrity(ref: string): {
24
24
  * author-authored pin is never overwritten). Inverse of `splitIntegrity`;
25
25
  * used to fold the object form's `integrity:` sibling into the source string. */
26
26
  export declare function foldIntegrity(source: string, integrity: unknown): string;
27
+ /** True for a value safe to WRITE into a manifest as an integrity pin.
28
+ *
29
+ * A pin arriving from outside the file — the hub's version index, a registry
30
+ * response — is untrusted text before it is untrusted *content*: a value
31
+ * carrying a quote, a `#`, or a newline corrupts the YAML it is spliced into,
32
+ * which no later install-time verification can catch because the manifest no
33
+ * longer parses. A wrong-but-well-formed hash is the case install *does*
34
+ * catch; this is the case it cannot. Callers writing a pin they did not
35
+ * compute check here first and fall back to writing none. */
36
+ export declare function isCanonicalIntegrity(value: unknown): value is string;
27
37
  /** SHA-256 of `bytes` as unpadded base64url — the canonical inline-hash form. */
28
38
  export declare function sha256Base64Url(bytes: Uint8Array): Promise<string>;
29
39
  /** Hash `bytes` and compare against `integrity` (`<alg>-<digest>`). Throws a
@@ -1 +1 @@
1
- {"version":3,"file":"integrity.d.ts","sourceRoot":"","sources":["../../src/sources/integrity.ts"],"names":[],"mappings":"AAAA;;;;;;6EAM6E;AAO7E;;;qDAGqD;AACrD,qBAAa,cAAe,SAAQ,KAAK;gBAC3B,OAAO,EAAE,MAAM;CAI5B;AAED;;2EAE2E;AAC3E,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAIhF;AAED;;;kFAGkF;AAClF,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,MAAM,CAIxE;AAcD,iFAAiF;AACjF,wBAAsB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAOxE;AAED;;gFAEgF;AAChF,wBAAsB,eAAe,CACnC,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,CAkBf;AAED;;;;sCAIsC;AACtC,wBAAsB,aAAa,CACjC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC;IAAE,KAAK,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAU9C"}
1
+ {"version":3,"file":"integrity.d.ts","sourceRoot":"","sources":["../../src/sources/integrity.ts"],"names":[],"mappings":"AAAA;;;;;;6EAM6E;AAc7E;;;qDAGqD;AACrD,qBAAa,cAAe,SAAQ,KAAK;gBAC3B,OAAO,EAAE,MAAM;CAI5B;AAED;;2EAE2E;AAC3E,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAIhF;AAED;;;kFAGkF;AAClF,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,MAAM,CAIxE;AAED;;;;;;;;8DAQ8D;AAC9D,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAEpE;AAcD,iFAAiF;AACjF,wBAAsB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAOxE;AAED;;gFAEgF;AAChF,wBAAsB,eAAe,CACnC,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,CAkBf;AAED;;;;sCAIsC;AACtC,wBAAsB,aAAa,CACjC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC;IAAE,KAAK,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAU9C"}
@@ -9,6 +9,12 @@
9
9
  * fragments (rare in module refs) pass through untouched. `sha256` is the
10
10
  * only algorithm accepted today; the prefix leaves room to migrate. */
11
11
  const INTEGRITY_FRAGMENT = /#(sha256-[A-Za-z0-9_+/=-]+)$/;
12
+ /** The canonical written form: SHA-256 as unpadded base64url, exactly what
13
+ * {@link sha256Base64Url} emits and what the `layers[].integrity` schema
14
+ * accepts. Stricter than {@link INTEGRITY_FRAGMENT}, which also tolerates the
15
+ * padded / standard-base64 spellings {@link verifyIntegrity} normalizes on the
16
+ * way in — reading is forgiving, writing is not. */
17
+ const CANONICAL_INTEGRITY = /^sha256-[A-Za-z0-9_-]{43}$/;
12
18
  /** A failed integrity/tamper check — always terminal, never best-effort. A
13
19
  * distinct type so a caller doing best-effort network handling (e.g. the
14
20
  * bundle extractor warning-and-skipping on a fetch blip) can still let a
@@ -37,6 +43,18 @@ export function foldIntegrity(source, integrity) {
37
43
  ? `${source}#${integrity}`
38
44
  : source;
39
45
  }
46
+ /** True for a value safe to WRITE into a manifest as an integrity pin.
47
+ *
48
+ * A pin arriving from outside the file — the hub's version index, a registry
49
+ * response — is untrusted text before it is untrusted *content*: a value
50
+ * carrying a quote, a `#`, or a newline corrupts the YAML it is spliced into,
51
+ * which no later install-time verification can catch because the manifest no
52
+ * longer parses. A wrong-but-well-formed hash is the case install *does*
53
+ * catch; this is the case it cannot. Callers writing a pin they did not
54
+ * compute check here first and fall back to writing none. */
55
+ export function isCanonicalIntegrity(value) {
56
+ return typeof value === "string" && CANONICAL_INTEGRITY.test(value);
57
+ }
40
58
  function toBase64Url(bytes) {
41
59
  let binary = "";
42
60
  for (let i = 0; i < bytes.length; i++)
@@ -1 +1 @@
1
- {"version":3,"file":"validate-cel-context.d.ts","sourceRoot":"","sources":["../src/validate-cel-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AAItF,MAAM,WAAW,kBAAkB;IACjC;mEAC+D;IAC/D,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACnC;;kDAE8C;IAC9C,IAAI,CAAC,EAAE;QACL,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,CAAC;KACxD,CAAC;IACF,OAAO,CAAC,EAAE;QACR,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;KAC/C,CAAC;IACF,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE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