@telorun/analyzer 0.29.0 → 0.30.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.
@@ -7,7 +7,7 @@ export type { CelHandlers } from "@telorun/templating";
7
7
  *
8
8
  * - `variables`: typed from the manifest's `variables` field if it is a schema map
9
9
  * (only module-identity docs — `Telo.Application` / `Telo.Library` — carry this); otherwise registered as `map` (dyn).
10
- * - `secrets`, `resources`, `env`: always `map` (dyn — output schemas unknown).
10
+ * - `secrets`, `resources`: always `map` (dyn — output schemas unknown).
11
11
  * - `extraContextSchema`: additional variables from an `x-telo-context` annotation.
12
12
  *
13
13
  * NOTE: The set of kernel globals registered here must match `KERNEL_GLOBAL_NAMES`
@@ -17,7 +17,7 @@ export declare function buildTypedCelEnvironment(baseEnv: Environment, manifest:
17
17
  *
18
18
  * Import inputs are a config-only contract: their expressions are evaluated
19
19
  * against the IMPORTING module's `variables`/`secrets`, never the import's own
20
- * values map (the bug) nor the imported child's. `resources`, `env`, and `ports`
20
+ * values map (the bug) nor the imported child's. `resources` and `ports`
21
21
  * are registered as empty typed objects, so referencing them is a "No such key"
22
22
  * error that steers authors to a typed `variables` entry. */
23
23
  export declare function buildImportInputCelEnvironment(baseEnv: Environment, moduleManifest: ResourceManifest | undefined): Environment;
@@ -1 +1 @@
1
- {"version":3,"file":"cel-environment.d.ts","sourceRoot":"","sources":["../src/cel-environment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAUrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;;;;;;;uEASuE;AACvE,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,gBAAgB,EAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,EAI/C,kBAAkB,CAAC,EAAE,gBAAgB,GACpC,WAAW,CAuEb;AAuBD;;;;;;8DAM8D;AAC9D,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,WAAW,EACpB,cAAc,EAAE,gBAAgB,GAAG,SAAS,GAC3C,WAAW,CAwBb"}
1
+ {"version":3,"file":"cel-environment.d.ts","sourceRoot":"","sources":["../src/cel-environment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAUrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;;;;;;;uEASuE;AACvE,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,gBAAgB,EAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,EAI/C,kBAAkB,CAAC,EAAE,gBAAgB,GACpC,WAAW,CAsEb;AAuBD;;;;;;8DAM8D;AAC9D,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,WAAW,EACpB,cAAc,EAAE,gBAAgB,GAAG,SAAS,GAC3C,WAAW,CAwBb"}
@@ -11,7 +11,7 @@ export { buildCelEnvironment } from "@telorun/templating";
11
11
  *
12
12
  * - `variables`: typed from the manifest's `variables` field if it is a schema map
13
13
  * (only module-identity docs — `Telo.Application` / `Telo.Library` — carry this); otherwise registered as `map` (dyn).
14
- * - `secrets`, `resources`, `env`: always `map` (dyn — output schemas unknown).
14
+ * - `secrets`, `resources`: always `map` (dyn — output schemas unknown).
15
15
  * - `extraContextSchema`: additional variables from an `x-telo-context` annotation.
16
16
  *
17
17
  * NOTE: The set of kernel globals registered here must match `KERNEL_GLOBAL_NAMES`
@@ -71,7 +71,6 @@ rootModuleManifest) {
71
71
  }
72
72
  env.registerVariable("secrets", "map");
73
73
  env.registerVariable("resources", "map");
74
- env.registerVariable("env", "map");
75
74
  if (extraContextSchema?.properties) {
76
75
  for (const [name, propSchema] of Object.entries(extraContextSchema.properties)) {
77
76
  if (!env.hasVariable(name)) {
@@ -104,7 +103,7 @@ function registerConfigNamespace(env, block, name) {
104
103
  *
105
104
  * Import inputs are a config-only contract: their expressions are evaluated
106
105
  * against the IMPORTING module's `variables`/`secrets`, never the import's own
107
- * values map (the bug) nor the imported child's. `resources`, `env`, and `ports`
106
+ * values map (the bug) nor the imported child's. `resources` and `ports`
108
107
  * are registered as empty typed objects, so referencing them is a "No such key"
109
108
  * error that steers authors to a typed `variables` entry. */
110
109
  export function buildImportInputCelEnvironment(baseEnv, moduleManifest) {
@@ -125,10 +124,10 @@ export function buildImportInputCelEnvironment(baseEnv, moduleManifest) {
125
124
  env.registerVariable("variables", "map");
126
125
  env.registerVariable("secrets", "map");
127
126
  }
128
- // Override the base env's dyn `resources`/`env`/`ports` with empty typed objects
129
- // so any access (`resources.X`, `env.X`) is a "No such key" error — these
127
+ // Override the base env's dyn `resources`/`ports` with empty typed objects
128
+ // so any access (`resources.X`, `ports.X`) is a "No such key" error — these
130
129
  // surfaces are not part of the config-only import contract.
131
- for (const name of ["resources", "env", "ports"]) {
130
+ for (const name of ["resources", "ports"]) {
132
131
  env.registerVariable({ name, schema: {} });
133
132
  }
134
133
  return env;
@@ -5,12 +5,12 @@ import type { ResourceManifest } from "@telorun/sdk";
5
5
  * `buildTypedCelEnvironment` in cel-environment.ts (CEL type-checking)
6
6
  * must stay in sync with this list.
7
7
  *
8
- * Note: `env` is only available in the root module context. Child modules
9
- * loaded via Telo.Import do not receive host environment variables.
10
- * There is no `imports` namespace at runtime import snapshots are stored
11
- * under `resources.<alias>`.
8
+ * Note: there is no `imports` namespace at runtime import snapshots are
9
+ * stored under `resources.<alias>`. Host environment variables are reached
10
+ * by declaring a typed `variables:`/`secrets:` entry with an `env:` binding
11
+ * and referencing `variables.X` / `secrets.X`.
12
12
  */
13
- export declare const KERNEL_GLOBAL_NAMES: readonly ["variables", "secrets", "resources", "ports", "env"];
13
+ export declare const KERNEL_GLOBAL_NAMES: readonly ["variables", "secrets", "resources", "ports"];
14
14
  /**
15
15
  * Build a typed JSON Schema describing the kernel globals available in the
16
16
  * given manifest set. Used to merge into `x-telo-context` schemas so that
@@ -23,12 +23,11 @@ export declare const KERNEL_GLOBAL_NAMES: readonly ["variables", "secrets", "res
23
23
  * in the outer module; Libraries are only relevant when the caller scoped
24
24
  * the manifest list to a single library's file.
25
25
  * - `resources`: enumerates all non-system resource names
26
- * - `env`: dynamic (runtime env vars, root module only)
27
26
  */
28
27
  export declare function buildKernelGlobalsSchema(manifests: ResourceManifest[]): Record<string, any>;
29
28
  /**
30
29
  * Merge kernel globals into an `x-telo-context` schema so chain-access
31
- * validation recognises `variables`, `secrets`, `resources`, `env`
30
+ * validation recognises `variables`, `secrets`, `resources`, `ports`
32
31
  * without module authors having to re-declare them.
33
32
  *
34
33
  * Context-specific properties take precedence over globals (spread order).
@@ -1 +1 @@
1
- {"version":3,"file":"kernel-globals.d.ts","sourceRoot":"","sources":["../src/kernel-globals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGrD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mBAAmB,gEAAiE,CAAC;AASlG;;;;;;;;;;;;;GAaG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,gBAAgB,EAAE,GAC5B,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAkCrB;AA4CD;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,CAC3C,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAClC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACjC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CASrB"}
1
+ {"version":3,"file":"kernel-globals.d.ts","sourceRoot":"","sources":["../src/kernel-globals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGrD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mBAAmB,yDAA0D,CAAC;AAS3F;;;;;;;;;;;;GAYG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,gBAAgB,EAAE,GAC5B,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAiCrB;AA4CD;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,CAC3C,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAClC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACjC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CASrB"}
@@ -5,12 +5,12 @@ import { residualEntrySchemaMap } from "./residual-schema.js";
5
5
  * `buildTypedCelEnvironment` in cel-environment.ts (CEL type-checking)
6
6
  * must stay in sync with this list.
7
7
  *
8
- * Note: `env` is only available in the root module context. Child modules
9
- * loaded via Telo.Import do not receive host environment variables.
10
- * There is no `imports` namespace at runtime import snapshots are stored
11
- * under `resources.<alias>`.
8
+ * Note: there is no `imports` namespace at runtime import snapshots are
9
+ * stored under `resources.<alias>`. Host environment variables are reached
10
+ * by declaring a typed `variables:`/`secrets:` entry with an `env:` binding
11
+ * and referencing `variables.X` / `secrets.X`.
12
12
  */
13
- export const KERNEL_GLOBAL_NAMES = ["variables", "secrets", "resources", "ports", "env"];
13
+ export const KERNEL_GLOBAL_NAMES = ["variables", "secrets", "resources", "ports"];
14
14
  const SYSTEM_KINDS = new Set([
15
15
  "Telo.Definition",
16
16
  "Telo.Application",
@@ -29,7 +29,6 @@ const SYSTEM_KINDS = new Set([
29
29
  * in the outer module; Libraries are only relevant when the caller scoped
30
30
  * the manifest list to a single library's file.
31
31
  * - `resources`: enumerates all non-system resource names
32
- * - `env`: dynamic (runtime env vars, root module only)
33
32
  */
34
33
  export function buildKernelGlobalsSchema(manifests) {
35
34
  const moduleManifest = manifests.find((m) => m.kind === "Telo.Application") ??
@@ -56,7 +55,6 @@ export function buildKernelGlobalsSchema(manifests) {
56
55
  additionalProperties: false,
57
56
  },
58
57
  ports: buildPortsSchema(moduleManifest?.ports),
59
- env: { type: "object", additionalProperties: true },
60
58
  },
61
59
  };
62
60
  }
@@ -98,7 +96,7 @@ function buildSchemaMapSchema(schemaMap) {
98
96
  }
99
97
  /**
100
98
  * Merge kernel globals into an `x-telo-context` schema so chain-access
101
- * validation recognises `variables`, `secrets`, `resources`, `env`
99
+ * validation recognises `variables`, `secrets`, `resources`, `ports`
102
100
  * without module authors having to re-declare them.
103
101
  *
104
102
  * Context-specific properties take precedence over globals (spread order).
@@ -1 +1 @@
1
- {"version":3,"file":"reconcile-module-versions.d.ts","sourceRoot":"","sources":["../src/reconcile-module-versions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAElE,OAAO,EAAsB,KAAK,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAIzE;;;;0CAI0C;AAC1C,MAAM,WAAW,qBAAqB;IACpC,gEAAgE;IAChE,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B;2EACuE;IACvE,WAAW,EAAE,kBAAkB,EAAE,CAAC;CACnC;AA8KD;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,EAClC,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,GAChD,qBAAqB,CAiDvB"}
1
+ {"version":3,"file":"reconcile-module-versions.d.ts","sourceRoot":"","sources":["../src/reconcile-module-versions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAElE,OAAO,EAAsB,KAAK,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAIzE;;;;0CAI0C;AAC1C,MAAM,WAAW,qBAAqB;IACpC,gEAAgE;IAChE,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B;2EACuE;IACvE,WAAW,EAAE,kBAAkB,EAAE,CAAC;CACnC;AAwKD;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,EAClC,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,GAChD,qBAAqB,CAiDvB"}
@@ -148,15 +148,10 @@ function hoistDiagnostic(identity, importerSource, alias, loser, winner, conflic
148
148
  data,
149
149
  };
150
150
  }
151
- return {
152
- severity: DiagnosticSeverity.Warning,
153
- code: "MODULE_VERSION_HOISTED",
154
- source: SOURCE,
155
- message: `Module '${identity}@${loser.version || "<unknown>"}' was hoisted to '${winner.version}' ` +
156
- `because the same module is imported at the higher version elsewhere in the graph. ` +
157
- `Pre-1.0 versions are additive, so the higher version is used for every importer.`,
158
- data,
159
- };
151
+ // Same-major hoist to a higher version: additive pre-1.0, so the redirect is
152
+ // non-lossy and by design — resolve to the winner silently, like a package
153
+ // manager picking the highest compatible version of a transitive dep.
154
+ return null;
160
155
  }
161
156
  /**
162
157
  * Reconcile a loaded import graph so each module identity (`namespace/name`)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telorun/analyzer",
3
- "version": "0.29.0",
3
+ "version": "0.30.0",
4
4
  "description": "Telo Analyzer - Static manifest validator for Telo manifests.",
5
5
  "keywords": [
6
6
  "telo",
@@ -17,7 +17,7 @@ export type { CelHandlers } from "@telorun/templating";
17
17
  *
18
18
  * - `variables`: typed from the manifest's `variables` field if it is a schema map
19
19
  * (only module-identity docs — `Telo.Application` / `Telo.Library` — carry this); otherwise registered as `map` (dyn).
20
- * - `secrets`, `resources`, `env`: always `map` (dyn — output schemas unknown).
20
+ * - `secrets`, `resources`: always `map` (dyn — output schemas unknown).
21
21
  * - `extraContextSchema`: additional variables from an `x-telo-context` annotation.
22
22
  *
23
23
  * NOTE: The set of kernel globals registered here must match `KERNEL_GLOBAL_NAMES`
@@ -85,7 +85,6 @@ export function buildTypedCelEnvironment(
85
85
 
86
86
  env.registerVariable("secrets", "map");
87
87
  env.registerVariable("resources", "map");
88
- env.registerVariable("env", "map");
89
88
 
90
89
  if (extraContextSchema?.properties) {
91
90
  for (const [name, propSchema] of Object.entries(
@@ -128,7 +127,7 @@ function registerConfigNamespace(
128
127
  *
129
128
  * Import inputs are a config-only contract: their expressions are evaluated
130
129
  * against the IMPORTING module's `variables`/`secrets`, never the import's own
131
- * values map (the bug) nor the imported child's. `resources`, `env`, and `ports`
130
+ * values map (the bug) nor the imported child's. `resources` and `ports`
132
131
  * are registered as empty typed objects, so referencing them is a "No such key"
133
132
  * error that steers authors to a typed `variables` entry. */
134
133
  export function buildImportInputCelEnvironment(
@@ -151,10 +150,10 @@ export function buildImportInputCelEnvironment(
151
150
  env.registerVariable("variables", "map");
152
151
  env.registerVariable("secrets", "map");
153
152
  }
154
- // Override the base env's dyn `resources`/`env`/`ports` with empty typed objects
155
- // so any access (`resources.X`, `env.X`) is a "No such key" error — these
153
+ // Override the base env's dyn `resources`/`ports` with empty typed objects
154
+ // so any access (`resources.X`, `ports.X`) is a "No such key" error — these
156
155
  // surfaces are not part of the config-only import contract.
157
- for (const name of ["resources", "env", "ports"]) {
156
+ for (const name of ["resources", "ports"]) {
158
157
  (env as any).registerVariable({ name, schema: {} });
159
158
  }
160
159
  return env;
@@ -7,12 +7,12 @@ import { residualEntrySchemaMap } from "./residual-schema.js";
7
7
  * `buildTypedCelEnvironment` in cel-environment.ts (CEL type-checking)
8
8
  * must stay in sync with this list.
9
9
  *
10
- * Note: `env` is only available in the root module context. Child modules
11
- * loaded via Telo.Import do not receive host environment variables.
12
- * There is no `imports` namespace at runtime import snapshots are stored
13
- * under `resources.<alias>`.
10
+ * Note: there is no `imports` namespace at runtime import snapshots are
11
+ * stored under `resources.<alias>`. Host environment variables are reached
12
+ * by declaring a typed `variables:`/`secrets:` entry with an `env:` binding
13
+ * and referencing `variables.X` / `secrets.X`.
14
14
  */
15
- export const KERNEL_GLOBAL_NAMES = ["variables", "secrets", "resources", "ports", "env"] as const;
15
+ export const KERNEL_GLOBAL_NAMES = ["variables", "secrets", "resources", "ports"] as const;
16
16
 
17
17
  const SYSTEM_KINDS = new Set([
18
18
  "Telo.Definition",
@@ -33,7 +33,6 @@ const SYSTEM_KINDS = new Set([
33
33
  * in the outer module; Libraries are only relevant when the caller scoped
34
34
  * the manifest list to a single library's file.
35
35
  * - `resources`: enumerates all non-system resource names
36
- * - `env`: dynamic (runtime env vars, root module only)
37
36
  */
38
37
  export function buildKernelGlobalsSchema(
39
38
  manifests: ResourceManifest[],
@@ -68,7 +67,6 @@ export function buildKernelGlobalsSchema(
68
67
  additionalProperties: false,
69
68
  },
70
69
  ports: buildPortsSchema(moduleManifest?.ports),
71
- env: { type: "object", additionalProperties: true },
72
70
  },
73
71
  };
74
72
  }
@@ -117,7 +115,7 @@ function buildSchemaMapSchema(
117
115
 
118
116
  /**
119
117
  * Merge kernel globals into an `x-telo-context` schema so chain-access
120
- * validation recognises `variables`, `secrets`, `resources`, `env`
118
+ * validation recognises `variables`, `secrets`, `resources`, `ports`
121
119
  * without module authors having to re-declare them.
122
120
  *
123
121
  * Context-specific properties take precedence over globals (spread order).
@@ -177,16 +177,10 @@ function hoistDiagnostic(
177
177
  data,
178
178
  };
179
179
  }
180
- return {
181
- severity: DiagnosticSeverity.Warning,
182
- code: "MODULE_VERSION_HOISTED",
183
- source: SOURCE,
184
- message:
185
- `Module '${identity}@${loser.version || "<unknown>"}' was hoisted to '${winner.version}' ` +
186
- `because the same module is imported at the higher version elsewhere in the graph. ` +
187
- `Pre-1.0 versions are additive, so the higher version is used for every importer.`,
188
- data,
189
- };
180
+ // Same-major hoist to a higher version: additive pre-1.0, so the redirect is
181
+ // non-lossy and by design — resolve to the winner silently, like a package
182
+ // manager picking the highest compatible version of a transitive dep.
183
+ return null;
190
184
  }
191
185
 
192
186
  /**