@telorun/analyzer 0.63.0 → 0.64.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/analysis-registry.d.ts +24 -0
- package/dist/analysis-registry.d.ts.map +1 -1
- package/dist/analysis-registry.js +35 -0
- package/dist/analyzer.d.ts +3 -37
- package/dist/analyzer.d.ts.map +1 -1
- package/dist/analyzer.js +57 -467
- package/dist/cel-scope-query.d.ts +109 -0
- package/dist/cel-scope-query.d.ts.map +1 -0
- package/dist/cel-scope-query.js +270 -0
- package/dist/cel-scope.d.ts +166 -0
- package/dist/cel-scope.d.ts.map +1 -0
- package/dist/cel-scope.js +377 -0
- package/dist/definition-registry.d.ts +15 -0
- package/dist/definition-registry.d.ts.map +1 -1
- package/dist/definition-registry.js +25 -9
- package/dist/find-manifest.d.ts +10 -0
- package/dist/find-manifest.d.ts.map +1 -0
- package/dist/find-manifest.js +12 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -0
- package/dist/invocation-contract.d.ts +11 -0
- package/dist/invocation-contract.d.ts.map +1 -1
- package/dist/invocation-contract.js +15 -0
- package/dist/manifest-analysis.d.ts +73 -0
- package/dist/manifest-analysis.d.ts.map +1 -0
- package/dist/manifest-analysis.js +78 -0
- package/dist/manifest-path.d.ts +18 -0
- package/dist/manifest-path.d.ts.map +1 -0
- package/dist/manifest-path.js +37 -0
- package/dist/schema-walk.d.ts +25 -0
- package/dist/schema-walk.d.ts.map +1 -0
- package/dist/schema-walk.js +126 -0
- package/dist/telo-version.d.ts +1 -1
- package/dist/telo-version.js +1 -1
- package/dist/validate-step-inputs.d.ts +17 -0
- package/dist/validate-step-inputs.d.ts.map +1 -1
- package/dist/validate-step-inputs.js +97 -6
- package/package.json +2 -2
- package/src/analysis-registry.ts +37 -0
- package/src/analyzer.ts +61 -585
- package/src/cel-scope-query.ts +337 -0
- package/src/cel-scope.ts +570 -0
- package/src/definition-registry.ts +31 -13
- package/src/find-manifest.ts +19 -0
- package/src/index.ts +13 -0
- package/src/invocation-contract.ts +22 -0
- package/src/manifest-analysis.ts +132 -0
- package/src/manifest-path.ts +34 -0
- package/src/schema-walk.ts +144 -0
- package/src/telo-version.ts +1 -1
- package/src/validate-step-inputs.ts +143 -7
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
import { bindingContextProperties, bindingPathChain, BINDINGS_ANNOTATION, schemaAtChain, } from "./cel-bindings.js";
|
|
2
|
+
import { buildImportInputCelEnvironment, buildTypedCelEnvironment } from "./cel-environment.js";
|
|
3
|
+
import { effectiveAuthorSchema } from "./extends-resolution.js";
|
|
4
|
+
import { analyzerContractScope, PERMISSIVE_CONTRACT, resolveContract, } from "./invocation-contract.js";
|
|
5
|
+
import { mergeKernelGlobalsIntoContext, } from "./kernel-globals.js";
|
|
6
|
+
import { resolveLocalRef, walkStepArray } from "./schema-walk.js";
|
|
7
|
+
import { readStepSlot } from "./step-slot.js";
|
|
8
|
+
import { getManifestItem, resolveContextAnnotations, resolveTypeFieldToSchema, } from "./validate-cel-context.js";
|
|
9
|
+
/** Build a closed JSON Schema for the `self` CEL variable available inside a
|
|
10
|
+
* `Telo.Definition` template body. Mirrors the runtime template controller's
|
|
11
|
+
* `const self = { ...resource, name: resource.metadata.name };` — every
|
|
12
|
+
* property the user declared in `schema:` plus synthetic `name` / `kind` and
|
|
13
|
+
* the metadata sub-object (kept open since metadata legitimately carries
|
|
14
|
+
* arbitrary user-added fields). */
|
|
15
|
+
function buildSelfSchema(definition, defs, aliases) {
|
|
16
|
+
// The author-facing schema resolves inheritance: with `base:` the child's own
|
|
17
|
+
// schema (the parent's config is internal); without it, `merge(parent, own)`.
|
|
18
|
+
const userSchema = (defs
|
|
19
|
+
? effectiveAuthorSchema(definition, (k) => defs.resolve(aliases?.resolveKind(k) ?? k) ?? defs.resolve(k))
|
|
20
|
+
: (definition.schema ?? {}));
|
|
21
|
+
const userProps = (userSchema.properties ?? {});
|
|
22
|
+
const userRequired = Array.isArray(userSchema.required) ? userSchema.required : [];
|
|
23
|
+
return {
|
|
24
|
+
type: "object",
|
|
25
|
+
additionalProperties: false,
|
|
26
|
+
properties: {
|
|
27
|
+
...userProps,
|
|
28
|
+
name: { type: "string" },
|
|
29
|
+
kind: { type: "string" },
|
|
30
|
+
metadata: {
|
|
31
|
+
type: "object",
|
|
32
|
+
additionalProperties: true,
|
|
33
|
+
properties: { name: { type: "string" } },
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
required: [...userRequired, "name", "kind"],
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/** Build the JSON Schema for the `inputs` CEL variable available inside an
|
|
40
|
+
* invocable template body — the shared contract resolver applied to the
|
|
41
|
+
* definition itself, so a body is typed against the exact signature callers are
|
|
42
|
+
* checked against and dispatch enforces. Walks the whole `extends` chain rather
|
|
43
|
+
* than one hop, so a definition two levels below the declaration still gets
|
|
44
|
+
* typed inputs. Undefined when nothing in the chain declares a contract —
|
|
45
|
+
* the caller signals opaque `map<string, dyn>` upstream. */
|
|
46
|
+
function lookupTemplateInputsSchema(definition, defs, aliases, allManifests, scopes) {
|
|
47
|
+
return resolveContract("inputType", undefined, definition, analyzerContractScope(defs, aliases, scopes, allManifests))?.schema;
|
|
48
|
+
}
|
|
49
|
+
/** Returns a "resolver-facing" view of the manifest where the fields used as
|
|
50
|
+
* navigation roots by Telo.Definition's `x-telo-context-from-root` annotations
|
|
51
|
+
* have been pre-augmented:
|
|
52
|
+
* - `schema` → augmented `self` schema (synthetic `name`/`kind`/metadata).
|
|
53
|
+
* - `inputType` → resolved through the shared contract resolver, so
|
|
54
|
+
* `x-telo-context-from-root: inputType` substitutes the
|
|
55
|
+
* real signature. Without it the annotation would replace
|
|
56
|
+
* the node verbatim with the inline `{kind, schema}` wrapper
|
|
57
|
+
* the standard library writes everywhere, typing `inputs` as
|
|
58
|
+
* `{kind, schema}` instead of the declared properties.
|
|
59
|
+
*
|
|
60
|
+
* For non-definition manifests the original object is returned. */
|
|
61
|
+
export function manifestRootForResolver(m, defs, aliases, allManifests, scopes) {
|
|
62
|
+
if (m.kind !== "Telo.Definition")
|
|
63
|
+
return m;
|
|
64
|
+
const inputs = lookupTemplateInputsSchema(m, defs, aliases, allManifests, scopes);
|
|
65
|
+
return {
|
|
66
|
+
...m,
|
|
67
|
+
schema: buildSelfSchema(m, defs, aliases),
|
|
68
|
+
...(inputs ? { inputType: inputs } : {}),
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Build a `steps` context schema for a kind's step body.
|
|
73
|
+
* Walks each step in the manifest array, resolves the invoked resource's output
|
|
74
|
+
* contract, and builds `steps.<name>.result` context entries.
|
|
75
|
+
*
|
|
76
|
+
* Resolution is the shared {@link resolveContract} — the invoked resource
|
|
77
|
+
* manifest's own declaration, then the kind's, resolved to the nearest
|
|
78
|
+
* declaration along `extends`, then permissive. Sharing it with the kernel is
|
|
79
|
+
* what stops `telo check` from typing `steps.X.result` against one contract
|
|
80
|
+
* while dispatch validates against another.
|
|
81
|
+
*
|
|
82
|
+
* The kind layer is what makes `x-telo-stream` properties on definitions
|
|
83
|
+
* actually govern step-result chain validation — without it, the validator falls
|
|
84
|
+
* back to permissive and the stream-opacity rule never fires.
|
|
85
|
+
*
|
|
86
|
+
* Recursion into nested step arrays is annotation-driven via
|
|
87
|
+
* `x-telo-topology-role`. The analyzer recognises three role values:
|
|
88
|
+
* - `branch` — value is an array of steps (e.g. then / else / do / catch).
|
|
89
|
+
* - `branch-list`— value is an array of objects each carrying further roled
|
|
90
|
+
* sub-properties (e.g. elseif: [{ if, then }]).
|
|
91
|
+
* - `case-map` — value is an object whose values are step arrays (e.g. cases).
|
|
92
|
+
* No specific Run.Sequence field name is hardcoded; any kind that uses
|
|
93
|
+
* a step body and tags its branch fields with these roles works.
|
|
94
|
+
*/
|
|
95
|
+
export function buildStepContextSchema(manifest, defSchema, allManifests, defs, aliases, scopes) {
|
|
96
|
+
const props = defSchema.properties;
|
|
97
|
+
if (!props)
|
|
98
|
+
return undefined;
|
|
99
|
+
const contractScope = analyzerContractScope(defs, aliases, scopes, allManifests);
|
|
100
|
+
const readingModule = manifest.metadata?.module;
|
|
101
|
+
for (const [fieldName, fieldSchema] of Object.entries(props)) {
|
|
102
|
+
const stepCtx = readStepSlot(fieldSchema);
|
|
103
|
+
if (!stepCtx)
|
|
104
|
+
continue;
|
|
105
|
+
const invokeField = stepCtx.invoke;
|
|
106
|
+
const outputTypeField = stepCtx.outputType;
|
|
107
|
+
// Optional: the field a step uses to produce a result without dispatching.
|
|
108
|
+
// Only a kind that declares one has pure steps at all.
|
|
109
|
+
const valueField = stepCtx.value;
|
|
110
|
+
if (!invokeField || !outputTypeField)
|
|
111
|
+
continue;
|
|
112
|
+
const steps = manifest[fieldName];
|
|
113
|
+
if (!Array.isArray(steps))
|
|
114
|
+
continue;
|
|
115
|
+
const stepItemSchema = resolveLocalRef(fieldSchema.items, defSchema);
|
|
116
|
+
// The instance's own input contract, for typing a pure step that just
|
|
117
|
+
// forwards one of its values.
|
|
118
|
+
const ownInputs = resolveTypeFieldToSchema(manifest.inputType, allManifests);
|
|
119
|
+
const stepProperties = {};
|
|
120
|
+
walkStepArray(steps, stepItemSchema, defSchema, fieldName, (s) => {
|
|
121
|
+
const name = s.name;
|
|
122
|
+
const invoke = s[invokeField];
|
|
123
|
+
// Only invoke steps register a `steps.<name>.result` entry — control-flow
|
|
124
|
+
// wrappers (try/if/while/switch/throw) don't produce a result and must
|
|
125
|
+
// not shadow real entries with a permissive `additionalProperties: true`,
|
|
126
|
+
// or unknown step references slip through chain validation.
|
|
127
|
+
if (typeof name !== "string")
|
|
128
|
+
return;
|
|
129
|
+
if (!invoke || typeof invoke !== "object") {
|
|
130
|
+
// A pure step dispatches nothing, so there is no contract to resolve.
|
|
131
|
+
// Where its expression is a plain chain into something already typed —
|
|
132
|
+
// an earlier step's result, or the kind's own inputs — that type carries
|
|
133
|
+
// through; anything else (arithmetic, a call, a comprehension) stays
|
|
134
|
+
// permissive rather than guessed. Same rule as a named binding's.
|
|
135
|
+
if (valueField && valueField in s) {
|
|
136
|
+
const scopeRoot = {
|
|
137
|
+
properties: {
|
|
138
|
+
steps: { type: "object", properties: { ...stepProperties } },
|
|
139
|
+
...(ownInputs ? { inputs: ownInputs } : {}),
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
const chained = schemaAtChain(bindingPathChain(s[valueField]), scopeRoot);
|
|
143
|
+
stepProperties[name] = {
|
|
144
|
+
type: "object",
|
|
145
|
+
properties: { result: chained ?? PERMISSIVE_CONTRACT },
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
const invokedKind = invoke.kind;
|
|
151
|
+
const invokedName = invoke.name;
|
|
152
|
+
// A named `!ref` carries the target's own manifest (which may narrow the
|
|
153
|
+
// contract for this one instance); an inline `{ kind, ... }` step IS the
|
|
154
|
+
// manifest. Either way the kind layer resolves through `extends`.
|
|
155
|
+
const invokedManifest = invokedName
|
|
156
|
+
? allManifests.find((m) => m.metadata?.name === invokedName && (!invokedKind || m.kind === invokedKind))
|
|
157
|
+
: invoke;
|
|
158
|
+
const invokedDef = invokedKind
|
|
159
|
+
? contractScope.resolveIn(invokedKind, readingModule)
|
|
160
|
+
: undefined;
|
|
161
|
+
const outputSchema = resolveContract(outputTypeField, invokedManifest, invokedDef, contractScope)?.schema;
|
|
162
|
+
stepProperties[name] = {
|
|
163
|
+
type: "object",
|
|
164
|
+
properties: {
|
|
165
|
+
result: outputSchema ?? PERMISSIVE_CONTRACT,
|
|
166
|
+
},
|
|
167
|
+
};
|
|
168
|
+
});
|
|
169
|
+
if (Object.keys(stepProperties).length > 0) {
|
|
170
|
+
return {
|
|
171
|
+
type: "object",
|
|
172
|
+
properties: stepProperties,
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return undefined;
|
|
177
|
+
}
|
|
178
|
+
export function collectErrorContextScopes(defSchema) {
|
|
179
|
+
const out = new Map();
|
|
180
|
+
if (!defSchema || typeof defSchema !== "object")
|
|
181
|
+
return out;
|
|
182
|
+
const seen = new Set();
|
|
183
|
+
const walk = (schema) => {
|
|
184
|
+
if (!schema || typeof schema !== "object" || seen.has(schema))
|
|
185
|
+
return;
|
|
186
|
+
seen.add(schema);
|
|
187
|
+
const props = schema.properties;
|
|
188
|
+
if (props) {
|
|
189
|
+
for (const [fieldName, fieldSchema] of Object.entries(props)) {
|
|
190
|
+
if (fieldSchema && typeof fieldSchema === "object") {
|
|
191
|
+
const errCtx = fieldSchema["x-telo-error-context"];
|
|
192
|
+
if (errCtx && typeof errCtx === "object" && !out.has(fieldName)) {
|
|
193
|
+
out.set(fieldName, errCtx);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
walk(resolveLocalRef(fieldSchema, defSchema));
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
if (schema.items)
|
|
200
|
+
walk(resolveLocalRef(schema.items, defSchema));
|
|
201
|
+
for (const key of ["oneOf", "anyOf", "allOf"]) {
|
|
202
|
+
const arr = schema[key];
|
|
203
|
+
if (Array.isArray(arr))
|
|
204
|
+
for (const sub of arr)
|
|
205
|
+
walk(resolveLocalRef(sub, defSchema));
|
|
206
|
+
}
|
|
207
|
+
if (schema.$defs && typeof schema.$defs === "object") {
|
|
208
|
+
for (const sub of Object.values(schema.$defs)) {
|
|
209
|
+
walk(sub);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
walk(defSchema);
|
|
214
|
+
return out;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Return the error-context schema for a CEL `path` when the path lies within
|
|
218
|
+
* (any depth under) one of the error-bearing fields, else undefined. A path is
|
|
219
|
+
* "within" field `f` when it contains a segment `f[<index>]`. When multiple
|
|
220
|
+
* error-bearing fields match (e.g. a `finally` nested inside a `catch`), the
|
|
221
|
+
* deepest — the one whose segment appears latest in the path — wins, so the
|
|
222
|
+
* innermost branch's schema governs.
|
|
223
|
+
*/
|
|
224
|
+
export function errorContextForPath(path, scopes) {
|
|
225
|
+
let best;
|
|
226
|
+
for (const [fieldName, schema] of scopes) {
|
|
227
|
+
const escaped = fieldName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
228
|
+
for (const match of path.matchAll(new RegExp(`(^|\\.)${escaped}\\[\\d+\\]`, "g"))) {
|
|
229
|
+
if (best === undefined || match.index > best.index) {
|
|
230
|
+
best = { index: match.index, schema };
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
return best?.schema;
|
|
235
|
+
}
|
|
236
|
+
/** Add a kind's named bindings to a resolved context, when the context declares
|
|
237
|
+
* a bindings region. They go UNDER the context's own properties: a scope
|
|
238
|
+
* variable wins over a same-named binding at runtime, so static typing has to
|
|
239
|
+
* agree (the collision itself is `BINDING_NAME_RESERVED`). */
|
|
240
|
+
export function withBindingNames(contextSchema, resource) {
|
|
241
|
+
const field = contextSchema[BINDINGS_ANNOTATION];
|
|
242
|
+
if (typeof field !== "string")
|
|
243
|
+
return contextSchema;
|
|
244
|
+
const bindings = resource[field];
|
|
245
|
+
if (bindings === null || typeof bindings !== "object" || Array.isArray(bindings)) {
|
|
246
|
+
return contextSchema;
|
|
247
|
+
}
|
|
248
|
+
return {
|
|
249
|
+
...contextSchema,
|
|
250
|
+
properties: {
|
|
251
|
+
...bindingContextProperties(bindings, contextSchema),
|
|
252
|
+
...(contextSchema.properties ?? {}),
|
|
253
|
+
},
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* The CEL scope rule, applied per resource and then per expression.
|
|
258
|
+
*
|
|
259
|
+
* Stateful across a resource because the per-resource half — the step context,
|
|
260
|
+
* the error-bearing regions, the invocation context — is derived from the kind's
|
|
261
|
+
* schema once and read by every expression in that resource. `enterResource`
|
|
262
|
+
* establishes it; `scopeFor` answers for one path.
|
|
263
|
+
*/
|
|
264
|
+
export class CelScopeResolver {
|
|
265
|
+
inputs;
|
|
266
|
+
typedEnvByManifest = new Map();
|
|
267
|
+
/** Per-resource state, replaced at each `enterResource`. */
|
|
268
|
+
stepContext;
|
|
269
|
+
invocationContext;
|
|
270
|
+
errorScopes = new Map();
|
|
271
|
+
constructor(inputs) {
|
|
272
|
+
this.inputs = inputs;
|
|
273
|
+
}
|
|
274
|
+
/** The `steps` context schema for the current resource, or undefined when its
|
|
275
|
+
* kind declares no step body. Exposed because the step-inputs check needs the
|
|
276
|
+
* same schema this resource's expressions are typed against — recomputing it
|
|
277
|
+
* there is how the two would come to disagree. */
|
|
278
|
+
get stepContextSchema() {
|
|
279
|
+
return this.stepContext;
|
|
280
|
+
}
|
|
281
|
+
/** The error-bearing regions the current resource's kind declares. */
|
|
282
|
+
get errorContextScopes() {
|
|
283
|
+
return this.errorScopes;
|
|
284
|
+
}
|
|
285
|
+
/** The resource-wide invocation context, when this resource is an inline
|
|
286
|
+
* declaration that carries one. Read by the "CEL in a non-eval field" check:
|
|
287
|
+
* such a resource's CEL is evaluated by the enclosing kind, not by an
|
|
288
|
+
* `x-telo-eval` annotation of its own. */
|
|
289
|
+
get invocationContextSchema() {
|
|
290
|
+
return this.invocationContext;
|
|
291
|
+
}
|
|
292
|
+
/** Establish the per-resource half of the scope. */
|
|
293
|
+
enterResource(m, definition) {
|
|
294
|
+
const { allManifests, defs, aliases, scopes } = this.inputs;
|
|
295
|
+
this.invocationContext = m.metadata?.xTeloInvocationContext;
|
|
296
|
+
this.stepContext = definition?.schema
|
|
297
|
+
? buildStepContextSchema(m, definition.schema, allManifests, defs, aliases, scopes)
|
|
298
|
+
: undefined;
|
|
299
|
+
this.errorScopes = collectErrorContextScopes(definition?.schema);
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* What the expression at `site` is typed against.
|
|
303
|
+
*
|
|
304
|
+
* The environment is cached per manifest when no context applied, which is
|
|
305
|
+
* most expressions: it then depends only on the manifest, so rebuilding it per
|
|
306
|
+
* expression is pure waste — a clone plus a re-registration of every variable,
|
|
307
|
+
* on every keystroke in the IDE. A matched context makes it path-specific (its
|
|
308
|
+
* schema is resolved against the enclosing array item), so those build fresh
|
|
309
|
+
* rather than risk one item's types leaking into another's.
|
|
310
|
+
*/
|
|
311
|
+
scopeFor(site) {
|
|
312
|
+
const m = site.source;
|
|
313
|
+
const contextSchema = this.resolveContextFor(site);
|
|
314
|
+
const { celEnv, allManifests, moduleManifest, } = this.inputs;
|
|
315
|
+
const cached = contextSchema === null ? this.typedEnvByManifest.get(m) : undefined;
|
|
316
|
+
const env = cached ??
|
|
317
|
+
// A `Telo.Import`'s variables/secrets are a config-only contract evaluated
|
|
318
|
+
// in the IMPORTING module's scope, so they type from the owning module doc
|
|
319
|
+
// and drop `resources`/`env`, making a reference to either an error.
|
|
320
|
+
(m.kind === "Telo.Import"
|
|
321
|
+
? buildImportInputCelEnvironment(celEnv, allManifests.find((mm) => (mm.kind === "Telo.Application" || mm.kind === "Telo.Library") &&
|
|
322
|
+
mm.metadata?.name ===
|
|
323
|
+
m.metadata?.module))
|
|
324
|
+
: buildTypedCelEnvironment(celEnv, m, contextSchema ?? undefined, moduleManifest));
|
|
325
|
+
if (contextSchema === null && !cached)
|
|
326
|
+
this.typedEnvByManifest.set(m, env);
|
|
327
|
+
return { env, contextSchema };
|
|
328
|
+
}
|
|
329
|
+
/** The context schema in force at `site`: the matched `x-telo-context` (or the
|
|
330
|
+
* resource-wide invocation context), plus the step and error regions this
|
|
331
|
+
* path falls in, resolved and merged with the kernel globals. */
|
|
332
|
+
resolveContextFor(site) {
|
|
333
|
+
const { path } = site;
|
|
334
|
+
const m = site.source;
|
|
335
|
+
let matched = site.contextSchema ?? this.invocationContext;
|
|
336
|
+
if (this.stepContext) {
|
|
337
|
+
const base = matched ?? { type: "object", properties: {}, additionalProperties: true };
|
|
338
|
+
matched = {
|
|
339
|
+
...base,
|
|
340
|
+
properties: { ...(base.properties ?? {}), steps: this.stepContext },
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
// `error` is only in scope inside an error-bearing branch (e.g. a
|
|
344
|
+
// `catch:` / `finally:`), so it's merged per-path, not resource-wide.
|
|
345
|
+
const errorSchema = this.errorScopes.size > 0 ? errorContextForPath(path, this.errorScopes) : undefined;
|
|
346
|
+
if (errorSchema) {
|
|
347
|
+
const base = matched ?? { type: "object", properties: {}, additionalProperties: true };
|
|
348
|
+
matched = {
|
|
349
|
+
...base,
|
|
350
|
+
properties: { ...(base.properties ?? {}), error: errorSchema },
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
if (!matched) {
|
|
354
|
+
// No `x-telo-context` matched, so nothing was chain-validated here before.
|
|
355
|
+
// Validate the observed-state segment alone rather than merging the kernel
|
|
356
|
+
// globals, whose closed `variables` / `ports` nodes would newly reject
|
|
357
|
+
// reads that pass today.
|
|
358
|
+
return this.inputs.observedStateContext;
|
|
359
|
+
}
|
|
360
|
+
const { defs, aliases, scopes, allManifests, kernelGlobals } = this.inputs;
|
|
361
|
+
const manifestItem = site.matchedScope
|
|
362
|
+
? getManifestItem(path, site.matchedScope, m)
|
|
363
|
+
: m;
|
|
364
|
+
const rootForResolver = manifestRootForResolver(m, defs, aliases, allManifests, scopes);
|
|
365
|
+
const resolved = resolveContextAnnotations(matched, manifestItem, {
|
|
366
|
+
manifestRoot: rootForResolver,
|
|
367
|
+
defs,
|
|
368
|
+
aliases,
|
|
369
|
+
allManifests: allManifests,
|
|
370
|
+
});
|
|
371
|
+
return mergeKernelGlobalsIntoContext(withBindingNames(resolved, m),
|
|
372
|
+
// Typed in the module that DECLARED this resource — for a manifest
|
|
373
|
+
// forwarded from an imported library, that is its `moduleGlobals` stamp,
|
|
374
|
+
// not the consuming application's block.
|
|
375
|
+
kernelGlobals.forResource(m));
|
|
376
|
+
}
|
|
377
|
+
}
|
|
@@ -133,6 +133,21 @@ export declare class DefinitionRegistry {
|
|
|
133
133
|
* anchors depend on a sibling property at runtime and stay unexpanded; the
|
|
134
134
|
* analyzer's reference validation phase already flags the cases that matter. */
|
|
135
135
|
expandedFieldMapForResource(resource: ResourceManifest, aliases: AliasResolver, aliasesByModule: Map<string, AliasResolver>): ReferenceFieldMap | undefined;
|
|
136
|
+
/**
|
|
137
|
+
* The schema an `x-telo-schema-from` slot derives its shape from.
|
|
138
|
+
*
|
|
139
|
+
* Only the STATIC form resolves: an anchor that is a dotted alias-qualified
|
|
140
|
+
* kind (`HttpDispatch.Request/$defs/Matcher`). The polymorphic forms — a
|
|
141
|
+
* relative anchor, or a single-segment absolute one — name a sibling property
|
|
142
|
+
* whose value is known per resource, so a definition-level lookup would be
|
|
143
|
+
* guessing at one instance's shape.
|
|
144
|
+
*
|
|
145
|
+
* Its own method because a schema-from slot is otherwise INVISIBLE to anything
|
|
146
|
+
* reading `properties`: the field map needs the nested ref slots, and an IDE
|
|
147
|
+
* needs the very same node to offer a key or describe one. Two resolutions of
|
|
148
|
+
* one annotation would eventually disagree about which anchors are static.
|
|
149
|
+
*/
|
|
150
|
+
resolveSchemaFromNode(schemaFrom: string, ownerScope: AliasResolver): Record<string, any> | undefined;
|
|
136
151
|
private resolveSchemaFromSubMap;
|
|
137
152
|
/** Returns all definitions that transitively extend the given abstract kind.
|
|
138
153
|
* Follows the capability chain to any depth (equivalent to instanceof in OOP).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition-registry.d.ts","sourceRoot":"","sources":["../src/definition-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAIL,KAAK,iBAAiB,EACvB,MAAM,0BAA0B,CAAC;AAIlC,+EAA+E;AAC/E,qBAAa,kBAAkB;;IAK7B;;sFAEkF;IAClF,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAe;IACnC,OAAO,CAA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AAiB,GAAG,SAAS;IAOhC;;;;;;;;qFAQiF;IACjF,2BAA2B,CACzB,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,EAAE,aAAa,EACtB,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,GAC1C,iBAAiB,GAAG,SAAS;IAkChC;;;;;;;;;;;;;OAaG;IACH,qBAAqB,CACnB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,aAAa,GACxB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS;IAsBlC,OAAO,CAAC,uBAAuB;IAU/B;;qEAEiE;IACjE,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,kBAAkB,EAAE;IAgBxD,KAAK,IAAI,MAAM,EAAE;CAGlB"}
|
|
@@ -299,28 +299,44 @@ export class DefinitionRegistry {
|
|
|
299
299
|
}
|
|
300
300
|
return expanded;
|
|
301
301
|
}
|
|
302
|
-
|
|
302
|
+
/**
|
|
303
|
+
* The schema an `x-telo-schema-from` slot derives its shape from.
|
|
304
|
+
*
|
|
305
|
+
* Only the STATIC form resolves: an anchor that is a dotted alias-qualified
|
|
306
|
+
* kind (`HttpDispatch.Request/$defs/Matcher`). The polymorphic forms — a
|
|
307
|
+
* relative anchor, or a single-segment absolute one — name a sibling property
|
|
308
|
+
* whose value is known per resource, so a definition-level lookup would be
|
|
309
|
+
* guessing at one instance's shape.
|
|
310
|
+
*
|
|
311
|
+
* Its own method because a schema-from slot is otherwise INVISIBLE to anything
|
|
312
|
+
* reading `properties`: the field map needs the nested ref slots, and an IDE
|
|
313
|
+
* needs the very same node to offer a key or describe one. Two resolutions of
|
|
314
|
+
* one annotation would eventually disagree about which anchors are static.
|
|
315
|
+
*/
|
|
316
|
+
resolveSchemaFromNode(schemaFrom, ownerScope) {
|
|
303
317
|
const isAbsolute = schemaFrom.startsWith("/");
|
|
304
318
|
const expr = isAbsolute ? schemaFrom.slice(1) : schemaFrom;
|
|
305
319
|
const slashIdx = expr.indexOf("/");
|
|
306
320
|
if (slashIdx === -1)
|
|
307
|
-
return
|
|
321
|
+
return undefined;
|
|
308
322
|
const anchorName = expr.slice(0, slashIdx);
|
|
309
323
|
const jsonPointer = "/" + expr.slice(slashIdx + 1);
|
|
310
|
-
// Static form: absolute path whose anchor is a dotted alias (e.g.
|
|
311
|
-
// "HttpDispatch.Outcomes/$defs/Returns"). Polymorphic forms — relative
|
|
312
|
-
// anchors or single-segment absolute anchors — only resolve once we know a
|
|
313
|
-
// sibling property's value, which is per-resource.
|
|
314
324
|
if (!anchorName.includes("."))
|
|
315
|
-
return
|
|
325
|
+
return undefined;
|
|
316
326
|
const targetKind = ownerScope.resolveKind(anchorName);
|
|
317
327
|
if (!targetKind)
|
|
318
|
-
return
|
|
328
|
+
return undefined;
|
|
319
329
|
const targetDef = this.resolve(targetKind);
|
|
320
330
|
if (!targetDef?.schema)
|
|
321
|
-
return
|
|
331
|
+
return undefined;
|
|
322
332
|
const subSchema = navigateJsonPointer(targetDef.schema, jsonPointer);
|
|
323
333
|
if (!subSchema || typeof subSchema !== "object")
|
|
334
|
+
return undefined;
|
|
335
|
+
return subSchema;
|
|
336
|
+
}
|
|
337
|
+
resolveSchemaFromSubMap(schemaFrom, fieldPath, ownerScope) {
|
|
338
|
+
const subSchema = this.resolveSchemaFromNode(schemaFrom, ownerScope);
|
|
339
|
+
if (!subSchema)
|
|
324
340
|
return null;
|
|
325
341
|
return buildFieldMapAtPath(subSchema, fieldPath);
|
|
326
342
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ResourceManifest } from "@telorun/sdk";
|
|
2
|
+
/**
|
|
3
|
+
* The manifest a `(kind, name)` pair addresses.
|
|
4
|
+
*
|
|
5
|
+
* One implementation, because two consumers needed it and a manifest set is
|
|
6
|
+
* exactly the thing `ManifestAnalysis` exists to have one answer over. Undefined
|
|
7
|
+
* when the set holds no such resource — a document the author is still writing.
|
|
8
|
+
*/
|
|
9
|
+
export declare function findManifest(manifests: readonly ResourceManifest[], kind: string | undefined, name: string | undefined): ResourceManifest | undefined;
|
|
10
|
+
//# sourceMappingURL=find-manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-manifest.d.ts","sourceRoot":"","sources":["../src/find-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,SAAS,EAAE,SAAS,gBAAgB,EAAE,EACtC,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,IAAI,EAAE,MAAM,GAAG,SAAS,GACvB,gBAAgB,GAAG,SAAS,CAK9B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The manifest a `(kind, name)` pair addresses.
|
|
3
|
+
*
|
|
4
|
+
* One implementation, because two consumers needed it and a manifest set is
|
|
5
|
+
* exactly the thing `ManifestAnalysis` exists to have one answer over. Undefined
|
|
6
|
+
* when the set holds no such resource — a document the author is still writing.
|
|
7
|
+
*/
|
|
8
|
+
export function findManifest(manifests, kind, name) {
|
|
9
|
+
if (!kind || !name)
|
|
10
|
+
return undefined;
|
|
11
|
+
return manifests.find((m) => m.kind === kind && m.metadata?.name === name);
|
|
12
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -108,6 +108,13 @@ export { documentToAst, parseToAst } from "./yaml-ast.js";
|
|
|
108
108
|
export type { AstDocument, AstMap, AstNode, AstPair, AstScalar, AstSeq } from "./yaml-ast.js";
|
|
109
109
|
export { CelParseError, buildCelSegments, wrapCelAst } from "./cel-ast.js";
|
|
110
110
|
export type { CelNode, CelSegment } from "./cel-ast.js";
|
|
111
|
+
export { CelScopeResolver } from "./cel-scope.js";
|
|
112
|
+
export type { CelScope, CelScopeInputs, CelSiteRef } from "./cel-scope.js";
|
|
113
|
+
export { CelScopeQuery } from "./cel-scope-query.js";
|
|
114
|
+
export type { CelScopeQueryContext, ContextDeclarationSite } from "./cel-scope-query.js";
|
|
115
|
+
export { navigateConcretePath } from "./manifest-path.js";
|
|
116
|
+
export { ManifestAnalysis } from "./manifest-analysis.js";
|
|
117
|
+
export type { ManifestRef } from "./manifest-analysis.js";
|
|
111
118
|
export { DEFAULT_MANIFEST_FILENAME, DiagnosticSeverity, diagnosticFix } from "./types.js";
|
|
112
119
|
export type { AnalysisDiagnostic, AnalysisOptions, DiagnosticData, DiagnosticFix, LoaderInitOptions, LoadOptions, ManifestSource, Position, PositionIndex, Range } from "./types.js";
|
|
113
120
|
export * from "./manifest-schemas.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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,0BAA0B,EAC1B,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,iBAAiB,CAAC;AACjE,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,YAAY,EAAE,MAAM,mBA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zF,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC1F,YAAY,EACR,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,cAAc,EACd,QAAQ,EACR,aAAa,EACb,KAAK,EACR,MAAM,YAAY,CAAC;AACpB,cAAc,uBAAuB,CAAC;AAGtC,cAAc,sBAAsB,CAAC;AAIrC,OAAO,EACL,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,4BAA4B,CAAC;AACpC,cAAc,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -68,6 +68,15 @@ export { PUBLISH_BLOCKING_CODES } from "./validate-module-metadata.js";
|
|
|
68
68
|
export { withSyntheticPositions } from "./with-synthetic-positions.js";
|
|
69
69
|
export { documentToAst, parseToAst } from "./yaml-ast.js";
|
|
70
70
|
export { CelParseError, buildCelSegments, wrapCelAst } from "./cel-ast.js";
|
|
71
|
+
// The CEL scope rule, and the way into it from outside the analysis pass. What
|
|
72
|
+
// completes, what hovers and what type-checks are one answer because they are
|
|
73
|
+
// one function.
|
|
74
|
+
export { CelScopeResolver } from "./cel-scope.js";
|
|
75
|
+
export { CelScopeQuery } from "./cel-scope-query.js";
|
|
76
|
+
// The pairing of a registry and the manifests it analyzed — the one seam a host
|
|
77
|
+
// threads for every question that needs both.
|
|
78
|
+
export { navigateConcretePath } from "./manifest-path.js";
|
|
79
|
+
export { ManifestAnalysis } from "./manifest-analysis.js";
|
|
71
80
|
export { DEFAULT_MANIFEST_FILENAME, DiagnosticSeverity, diagnosticFix } from "./types.js";
|
|
72
81
|
export * from "./manifest-schemas.js";
|
|
73
82
|
// The JSON Schema vocabulary a manifest may write, as data — the source both the
|
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
import { type ResourceDefinition } from "@telorun/sdk";
|
|
2
|
+
import { AliasResolver, type ModuleScopes } from "./alias-resolver.js";
|
|
3
|
+
import { DefinitionRegistry } from "./definition-registry.js";
|
|
2
4
|
import { type ContractDirection, type DefResolver } from "./extends-resolution.js";
|
|
3
5
|
import { type ProjectionFailure } from "./schema-projection.js";
|
|
4
6
|
export type { ContractDirection };
|
|
7
|
+
/** The {@link ContractScope} the analyzer resolves invocation contracts in: kinds
|
|
8
|
+
* resolve in the module that declared the definition they were read off (so an
|
|
9
|
+
* `extends` chain crossing module boundaries re-scopes at every hop), and named
|
|
10
|
+
* `telo#Type` references resolve against the flattened manifest list. `resolveIn`
|
|
11
|
+
* is the top-level entry point, where the kind was written by the READING
|
|
12
|
+
* module and there is no declaring definition yet. */
|
|
13
|
+
export declare function analyzerContractScope(defs: DefinitionRegistry, aliases: AliasResolver, scopes: ModuleScopes, allManifests: Record<string, any>[]): ContractScope & {
|
|
14
|
+
resolveIn(kind: string, module?: string): ResourceDefinition | undefined;
|
|
15
|
+
};
|
|
5
16
|
/**
|
|
6
17
|
* The one answer to "what is this target's input / output schema".
|
|
7
18
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invocation-contract.d.ts","sourceRoot":"","sources":["../src/invocation-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,kBAAkB,EAAe,MAAM,cAAc,CAAC;AAChF,OAAO,EACL,KAAK,iBAAiB,EAEtB,KAAK,WAAW,EAEjB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,wBAAwB,CAAC;AAEhC,YAAY,EAAE,iBAAiB,EAAE,CAAC;AAElC;;;;;;;;;;;;GAYG;AAEH;;oCAEoC;AACpC,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,MAAM,CAAC;AAEjD,MAAM,WAAW,gBAAg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ot, valueTypeOf } from "@telorun/sdk";
|
|
2
|
+
import { moduleScopedDefResolver } from "./alias-resolver.js";
|
|
2
3
|
import { contractDeclarer, effectiveContractField, } from "./extends-resolution.js";
|
|
3
4
|
import { resolveTypeFieldToSchema } from "./validate-cel-context.js";
|
|
4
5
|
import { manifestListScope, resolveSchemaProjections, } from "./schema-projection.js";
|
|
6
|
+
/** The {@link ContractScope} the analyzer resolves invocation contracts in: kinds
|
|
7
|
+
* resolve in the module that declared the definition they were read off (so an
|
|
8
|
+
* `extends` chain crossing module boundaries re-scopes at every hop), and named
|
|
9
|
+
* `telo#Type` references resolve against the flattened manifest list. `resolveIn`
|
|
10
|
+
* is the top-level entry point, where the kind was written by the READING
|
|
11
|
+
* module and there is no declaring definition yet. */
|
|
12
|
+
export function analyzerContractScope(defs, aliases, scopes, allManifests) {
|
|
13
|
+
const resolve = moduleScopedDefResolver(defs, aliases, scopes);
|
|
14
|
+
return {
|
|
15
|
+
resolveDefinition: resolve,
|
|
16
|
+
resolveIn: resolve.in,
|
|
17
|
+
typeManifestsFor: () => allManifests,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
5
20
|
/** The fallback for a target that declares no contract: anything goes. Not
|
|
6
21
|
* `additionalProperties: false` — an undeclared contract is an absence of a
|
|
7
22
|
* claim, not a claim of emptiness. */
|