@telorun/cli 0.88.0 → 0.90.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/dist/bundle/built-layers.d.ts +36 -0
  2. package/dist/bundle/built-layers.d.ts.map +1 -0
  3. package/dist/bundle/built-layers.js +84 -0
  4. package/dist/bundle/built-layers.js.map +1 -0
  5. package/dist/bundle/module-payload.d.ts +30 -15
  6. package/dist/bundle/module-payload.d.ts.map +1 -1
  7. package/dist/bundle/module-payload.js +118 -21
  8. package/dist/bundle/module-payload.js.map +1 -1
  9. package/dist/bundle/partition-layers.d.ts +13 -6
  10. package/dist/bundle/partition-layers.d.ts.map +1 -1
  11. package/dist/bundle/partition-layers.js +49 -7
  12. package/dist/bundle/partition-layers.js.map +1 -1
  13. package/dist/bundle/payload-drift.d.ts +1 -1
  14. package/dist/bundle/payload-drift.d.ts.map +1 -1
  15. package/dist/bundle/select-files.d.ts +11 -2
  16. package/dist/bundle/select-files.d.ts.map +1 -1
  17. package/dist/bundle/select-files.js +23 -8
  18. package/dist/bundle/select-files.js.map +1 -1
  19. package/dist/bundle/staged-files.d.ts +43 -0
  20. package/dist/bundle/staged-files.d.ts.map +1 -0
  21. package/dist/bundle/staged-files.js +158 -0
  22. package/dist/bundle/staged-files.js.map +1 -0
  23. package/dist/bundle/warm-layers.d.ts +11 -6
  24. package/dist/bundle/warm-layers.d.ts.map +1 -1
  25. package/dist/bundle/warm-layers.js +26 -10
  26. package/dist/bundle/warm-layers.js.map +1 -1
  27. package/dist/commands/install.d.ts +1 -0
  28. package/dist/commands/install.d.ts.map +1 -1
  29. package/dist/commands/install.js +7 -1
  30. package/dist/commands/install.js.map +1 -1
  31. package/dist/commands/module.d.ts.map +1 -1
  32. package/dist/commands/module.js +21 -7
  33. package/dist/commands/module.js.map +1 -1
  34. package/dist/commands/publish.d.ts.map +1 -1
  35. package/dist/commands/publish.js +5 -1
  36. package/dist/commands/publish.js.map +1 -1
  37. package/dist/commands/release.d.ts +8 -6
  38. package/dist/commands/release.d.ts.map +1 -1
  39. package/dist/commands/release.js +168 -69
  40. package/dist/commands/release.js.map +1 -1
  41. package/dist/commands/run.d.ts.map +1 -1
  42. package/dist/commands/run.js +14 -6
  43. package/dist/commands/run.js.map +1 -1
  44. package/dist/controller-runtime.d.ts +25 -3
  45. package/dist/controller-runtime.d.ts.map +1 -1
  46. package/dist/controller-runtime.js +39 -9
  47. package/dist/controller-runtime.js.map +1 -1
  48. package/dist/env-files.d.ts +23 -8
  49. package/dist/env-files.d.ts.map +1 -1
  50. package/dist/env-files.js +77 -17
  51. package/dist/env-files.js.map +1 -1
  52. package/dist/release/apply-plan.d.ts +2 -1
  53. package/dist/release/apply-plan.d.ts.map +1 -1
  54. package/dist/release/apply-plan.js +8 -4
  55. package/dist/release/apply-plan.js.map +1 -1
  56. package/dist/release/cargo-toml.d.ts +17 -0
  57. package/dist/release/cargo-toml.d.ts.map +1 -0
  58. package/dist/release/cargo-toml.js +253 -0
  59. package/dist/release/cargo-toml.js.map +1 -0
  60. package/dist/release/crate-inputs.d.ts +41 -0
  61. package/dist/release/crate-inputs.d.ts.map +1 -0
  62. package/dist/release/crate-inputs.js +407 -0
  63. package/dist/release/crate-inputs.js.map +1 -0
  64. package/dist/release/evidence.d.ts +13 -17
  65. package/dist/release/evidence.d.ts.map +1 -1
  66. package/dist/release/evidence.js +26 -30
  67. package/dist/release/evidence.js.map +1 -1
  68. package/dist/release/stage.d.ts +61 -0
  69. package/dist/release/stage.d.ts.map +1 -0
  70. package/dist/release/stage.js +506 -0
  71. package/dist/release/stage.js.map +1 -0
  72. package/dist/release/targets.d.ts +60 -0
  73. package/dist/release/targets.d.ts.map +1 -0
  74. package/dist/release/targets.js +94 -0
  75. package/dist/release/targets.js.map +1 -0
  76. package/dist/release/workspace.d.ts +17 -5
  77. package/dist/release/workspace.d.ts.map +1 -1
  78. package/dist/release/workspace.js +89 -13
  79. package/dist/release/workspace.js.map +1 -1
  80. package/package.json +7 -7
@@ -0,0 +1,36 @@
1
+ /**
2
+ * The layers a payload build produces, before anything is framed: what may be
3
+ * pushed, the index entry of a layer known by pins, and the entry rules a runtime
4
+ * enforces at extraction, checked here first.
5
+ */
6
+ import { type ArtifactSelector, type LayerRole } from "@telorun/analyzer";
7
+ import { type LayerEntry, type PayloadLayer } from "@telorun/kernel";
8
+ /** A layer built from a working copy: what publish pushes and what the release
9
+ * ledger digests. Mutable-shaped because the transport's own `PayloadLayer` is,
10
+ * and the two are handed straight across. */
11
+ export interface BuiltLayer {
12
+ role: LayerRole;
13
+ selector?: ArtifactSelector;
14
+ /** A pinned entry appears only when the builder reads staged files from their
15
+ * pins, which publish never does. */
16
+ files: LayerEntry[];
17
+ }
18
+ /** The layers a transport can push: every entry carries its bytes. Throws for a
19
+ * payload built from pins, which has none to push. */
20
+ export declare function pushableLayers(layers: readonly BuiltLayer[]): PayloadLayer[];
21
+ /**
22
+ * The `blob` that stands in for a layer holding pinned entries, which has no
23
+ * framed bytes to address: `sha256:` plus the hex form of the layer's integrity
24
+ * digest — a digest over its pinned entries, deterministic across trees and
25
+ * forks. It addresses nothing a registry holds, so only a digest of the manifest
26
+ * that carries it may ever see it; publish frames the staged bytes instead.
27
+ */
28
+ export declare function pinnedLayerBlob(files: readonly LayerEntry[]): Promise<string>;
29
+ /**
30
+ * Refuse a payload with a layer extraction would refuse — a symbolic link that
31
+ * does not name a file of its own layer, an entry path that is repeated or runs
32
+ * through another entry — caught before anything is framed. A link to a
33
+ * directory gets its own reason, since the link rule would call it dangling.
34
+ */
35
+ export declare function assertLayerEntries(manifestDir: string, layers: readonly BuiltLayer[]): void;
36
+ //# sourceMappingURL=built-layers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"built-layers.d.ts","sourceRoot":"","sources":["../../src/bundle/built-layers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAML,KAAK,UAAU,EAEf,KAAK,YAAY,EAClB,MAAM,iBAAiB,CAAC;AAIzB;;8CAE8C;AAC9C,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B;0CACsC;IACtC,KAAK,EAAE,UAAU,EAAE,CAAC;CACrB;AAED;uDACuD;AACvD,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,GAAG,YAAY,EAAE,CAW5E;AAED;;;;;;GAMG;AACH,wBAAsB,eAAe,CAAC,KAAK,EAAE,SAAS,UAAU,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAGnF;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,UAAU,EAAE,GAAG,IAAI,CAqC3F"}
@@ -0,0 +1,84 @@
1
+ /**
2
+ * The layers a payload build produces, before anything is framed: what may be
3
+ * pushed, the index entry of a layer known by pins, and the entry rules a runtime
4
+ * enforces at extraction, checked here first.
5
+ */
6
+ import { describeSelector, } from "@telorun/analyzer";
7
+ import { computeFilesIntegrity, describeLayerViolations, findLayerViolations, isPayloadLink, isPinnedFile, } from "@telorun/kernel";
8
+ import * as fs from "node:fs";
9
+ import * as path from "node:path";
10
+ /** The layers a transport can push: every entry carries its bytes. Throws for a
11
+ * payload built from pins, which has none to push. */
12
+ export function pushableLayers(layers) {
13
+ for (const layer of layers) {
14
+ const pinned = layer.files.find(isPinnedFile);
15
+ if (pinned) {
16
+ throw new Error(`'${pinned.name}' is known only by its sources: pin, so its layer cannot be pushed — ` +
17
+ `build the payload from staged files (\`stagedFiles: "disk"\`) to publish it.`);
18
+ }
19
+ }
20
+ return layers;
21
+ }
22
+ /**
23
+ * The `blob` that stands in for a layer holding pinned entries, which has no
24
+ * framed bytes to address: `sha256:` plus the hex form of the layer's integrity
25
+ * digest — a digest over its pinned entries, deterministic across trees and
26
+ * forks. It addresses nothing a registry holds, so only a digest of the manifest
27
+ * that carries it may ever see it; publish frames the staged bytes instead.
28
+ */
29
+ export async function pinnedLayerBlob(files) {
30
+ const integrity = await computeFilesIntegrity(files);
31
+ return `sha256:${Buffer.from(integrity.slice("sha256-".length), "base64url").toString("hex")}`;
32
+ }
33
+ /**
34
+ * Refuse a payload with a layer extraction would refuse — a symbolic link that
35
+ * does not name a file of its own layer, an entry path that is repeated or runs
36
+ * through another entry — caught before anything is framed. A link to a
37
+ * directory gets its own reason, since the link rule would call it dangling.
38
+ */
39
+ export function assertLayerEntries(manifestDir, layers) {
40
+ const problems = [];
41
+ for (const layer of layers) {
42
+ const elsewhere = new Set(layers.filter((other) => other !== layer).flatMap((other) => other.files.map((f) => f.name)));
43
+ const directoryLinks = layer.files.flatMap((file) => isPayloadLink(file) && linksToDirectory(path.resolve(manifestDir, file.name))
44
+ ? [
45
+ {
46
+ path: file.name,
47
+ target: file.link,
48
+ reason: "points at a directory; only a link to a file can ship",
49
+ },
50
+ ]
51
+ : []);
52
+ const pointsAtDirectory = new Set(directoryLinks.map((v) => v.path));
53
+ const violations = [
54
+ ...directoryLinks,
55
+ ...findLayerViolations(layer.files, elsewhere).filter((v) => v.target === undefined || !pointsAtDirectory.has(v.path)),
56
+ ];
57
+ if (violations.length === 0)
58
+ continue;
59
+ const label = layer.selector ? `${layer.role} (${describeSelector(layer.selector)})` : layer.role;
60
+ problems.push(`the ${label} layer:\n${describeLayerViolations(violations)}`);
61
+ }
62
+ if (problems.length === 0)
63
+ return;
64
+ throw new Error(`Module '${path.basename(manifestDir)}' ships entries a runtime would refuse to extract, in ` +
65
+ `${problems.join("\nand ")}\n` +
66
+ `A link ships as a link, and a runtime extracts only the layers it needs, so its target ` +
67
+ `must be a file in the same layer and inside the module directory. Claim the target ` +
68
+ `through the same declaration as the link, point the link at a file that ships beside it, ` +
69
+ `or ship the file itself in place of the link.`);
70
+ }
71
+ /** Whether the symbolic link at `abs` resolves to a directory. A link that
72
+ * resolves to nothing is the link rule's to report. */
73
+ function linksToDirectory(abs) {
74
+ try {
75
+ return fs.statSync(abs).isDirectory();
76
+ }
77
+ catch (err) {
78
+ const code = err.code;
79
+ if (code === "ENOENT" || code === "ENOTDIR" || code === "ELOOP")
80
+ return false;
81
+ throw err;
82
+ }
83
+ }
84
+ //# sourceMappingURL=built-layers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"built-layers.js","sourceRoot":"","sources":["../../src/bundle/built-layers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,gBAAgB,GAGjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,EACnB,aAAa,EACb,YAAY,GAIb,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAalC;uDACuD;AACvD,MAAM,UAAU,cAAc,CAAC,MAA6B;IAC1D,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC9C,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CACb,IAAI,MAAM,CAAC,IAAI,uEAAuE;gBACpF,8EAA8E,CACjF,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,MAAwB,CAAC;AAClC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,KAA4B;IAChE,MAAM,SAAS,GAAG,MAAM,qBAAqB,CAAC,KAAK,CAAC,CAAC;IACrD,OAAO,UAAU,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE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AAU,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QACtC,MAAM,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,KAAK,gBAAgB,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC;QAClG,QAAQ,CAAC,IAAI,CAAC,OAAO,KAAK,YAAY,uBAAuB,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IAC/E,CAAC;IACD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAClC,MAAM,IAAI,KAAK,CACb,WAAW,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,wDAAwD;QAC3F,GAAG,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI;QAC9B,yFAAyF;QACzF,qFAAqF;QACrF,2FAA2F;QAC3F,+CAA+C,CAClD,CAAC;AACJ,CAAC;AAED;wDACwD;AACxD,SAAS,gBAAgB,CAAC,GAAW;IACnC,IAAI,CAAC;QACH,OAAO,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;IACxC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,IAAI,GAAI,GAA6B,CAAC,IAAI,CAAC;QACjD,IAAI,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,OAAO;YAAE,OAAO,KAAK,CAAC;QAC9E,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC"}
@@ -33,17 +33,8 @@
33
33
  * into the manifest. It is not derivable, so the ledger records which base its
34
34
  * digests were taken against.
35
35
  */
36
- import { type ArtifactSelector, type LayerRole } from "@telorun/analyzer";
37
- import { type PayloadFile } from "@telorun/kernel";
36
+ import { type BuiltLayer } from "./built-layers.js";
38
37
  import { type Partition } from "./partition-layers.js";
39
- /** A layer built from a working copy: what publish pushes and what the release
40
- * ledger digests. Mutable-shaped because the transport's own `PayloadLayer` is,
41
- * and the two are handed straight across. */
42
- export interface BuiltLayer {
43
- role: LayerRole;
44
- selector?: ArtifactSelector;
45
- files: PayloadFile[];
46
- }
47
38
  export interface ModulePayload {
48
39
  /** The `telo.yaml` that ships, byte for byte: canonicalized, pinned, includes
49
40
  * inlined, `layers:` index written. A dependent's import pin is a hash of
@@ -94,6 +85,19 @@ export interface ModulePayload {
94
85
  export interface PayloadBuilderOptions {
95
86
  /** Where the controller build cache lives. */
96
87
  readonly cacheRoot: string;
88
+ /**
89
+ * Where the entry of a file a `sources:` entry stages comes from.
90
+ *
91
+ * `pins` (the default, every release command): the pin, whether or not the
92
+ * file is staged, so every layer's `integrity` is what publish derives from
93
+ * the bytes and a cold tree digests exactly as a staged one. A layer holding a
94
+ * pinned file takes a stand-in `blob`, which only the `manifest` ledger digest
95
+ * sees.
96
+ *
97
+ * `disk` (publish): the staged bytes, each verified against its pin, so every
98
+ * `blob` is real and every sibling pin names the text the registry serves.
99
+ */
100
+ readonly stagedFiles?: "pins" | "disk";
97
101
  }
98
102
  /**
99
103
  * One module's payload, memoized across a batch.
@@ -133,14 +137,25 @@ export declare class ModulePayloadBuilder {
133
137
  constructor(options: PayloadBuilderOptions);
134
138
  payload(manifestPath: string, destination: string): Promise<ModulePayload>;
135
139
  /**
136
- * The in-repo siblings this module imports relatively, without building a
137
- * single controller.
140
+ * The in-repo siblings this module imports relatively, and the ref each import
141
+ * canonicalizes to — from the manifest text alone.
142
+ *
143
+ * **It claims no destination and builds no payload**, which is what the two
144
+ * callers need and what this used to only claim. It delegated to
145
+ * `transformManifest`, which CLAIMS each sibling's derived destination and
146
+ * hashes it — and hashing a sibling builds that sibling's payload, controller
147
+ * bundles and all. So asking who imports whom built most of the workspace, and
148
+ * a destination disagreement was refused by `claimDestination` from inside
149
+ * this call, before any check that could explain it in terms of the workspace
150
+ * file could run.
138
151
  *
139
152
  * Publish ORDER needs only this — a dependency must be pushed before its
140
153
  * dependents, because canonicalization writes the sibling's ref into the
141
- * manifest and publish then hard-fails when it does not resolve — and running
142
- * esbuild across the whole standard library to answer it would be minutes of
143
- * work for a question the manifests already contain.
154
+ * manifest and publish then hard-fails when it does not resolve.
155
+ *
156
+ * The traversal is the same `importSourceRefs` / `resolveSiblingManifest` pair
157
+ * `transformManifest` walks; what it omits is the pin, which answers a
158
+ * different question.
144
159
  */
145
160
  relativeImportsOf(manifestPath: string, destination: string): Promise<readonly {
146
161
  manifestPath: string;
@@ -1 +1 @@
1
- {"version":3,"file":"module-payload.d.ts","sourceRoot":"","sources":["../../src/bundle/module-payload.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EAKL,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAKL,KAAK,WAAW,EAEjB,MAAM,iBAAiB,CAAC;AAOzB,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGxE;;8CAE8C;AAC9C,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,KAAK,EAAE,WAAW,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,aAAa;IAC5B;;wBAEoB;IACpB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,UAAU,EAAE,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC;;;;OAIG;IACH,QAAQ,CAAC,eAAe,EAAE,SAAS;QACjC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;QAC9B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;KACtB,EAAE,CAAC;IACJ;;;;;;;;;;;;;;;O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;IACH,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA6B;gBAE7B,OAAO,EAAE,qBAAqB;IAErD,OAAO,CAAC,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAehF;;;;;;;;;;;;;;;;;;;;OAoBG;IACG,iBAAiB,CACrB,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,SAAS;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IA6B5D;;;;;;;;OAQG;IACG,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAK9D,OAAO,CAAC,iBAAiB;IAQzB,OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,aAAa;IAQrB;;iFAE6E;IAC7E,OAAO,CAAC,YAAY;IASpB;;;OAGG;YACW,iBAAiB;YA0EjB,WAAW;YAKX,YAAY;CA2I3B"}
@@ -34,15 +34,17 @@
34
34
  * digests were taken against.
35
35
  */
36
36
  import { collectModuleFileClaims, DEFAULT_MANIFEST_FILENAME, sha256Base64Url, splitIntegrity, } from "@telorun/analyzer";
37
- import { buildControllerBundle, defaultTransportRegistry, injectLayerIndex, readOwnerManifest, } from "@telorun/kernel";
37
+ import { buildControllerBundle, computeFilesIntegrity, defaultTransportRegistry, injectLayerIndex, isPayloadLink, isPinnedFile, readOwnerManifest, readPayloadFile, } from "@telorun/kernel";
38
38
  import { defaultCustomTags } from "@telorun/templating";
39
39
  import * as fs from "node:fs";
40
40
  import * as path from "node:path";
41
41
  import { parseAllDocuments } from "yaml";
42
42
  import { findModuleDoc, importSourceRefs } from "../commands/manifest-imports.js";
43
+ import { assertLayerEntries, pinnedLayerBlob } from "./built-layers.js";
43
44
  import { expandAndInlineIncludes, readAssetPatterns, readFilesPatterns } from "./manifest-text.js";
44
45
  import { partitionLayers } from "./partition-layers.js";
45
46
  import { assertWithinModule, selectFiles } from "./select-files.js";
47
+ import { assertNamedFiles, readNativeFiles, readSources, stagedEntriesOf } from "./staged-files.js";
46
48
  /**
47
49
  * One module's payload, memoized across a batch.
48
50
  *
@@ -97,19 +99,54 @@ export class ModulePayloadBuilder {
97
99
  return work;
98
100
  }
99
101
  /**
100
- * The in-repo siblings this module imports relatively, without building a
101
- * single controller.
102
+ * The in-repo siblings this module imports relatively, and the ref each import
103
+ * canonicalizes to — from the manifest text alone.
104
+ *
105
+ * **It claims no destination and builds no payload**, which is what the two
106
+ * callers need and what this used to only claim. It delegated to
107
+ * `transformManifest`, which CLAIMS each sibling's derived destination and
108
+ * hashes it — and hashing a sibling builds that sibling's payload, controller
109
+ * bundles and all. So asking who imports whom built most of the workspace, and
110
+ * a destination disagreement was refused by `claimDestination` from inside
111
+ * this call, before any check that could explain it in terms of the workspace
112
+ * file could run.
102
113
  *
103
114
  * Publish ORDER needs only this — a dependency must be pushed before its
104
115
  * dependents, because canonicalization writes the sibling's ref into the
105
- * manifest and publish then hard-fails when it does not resolve — and running
106
- * esbuild across the whole standard library to answer it would be minutes of
107
- * work for a question the manifests already contain.
116
+ * manifest and publish then hard-fails when it does not resolve.
117
+ *
118
+ * The traversal is the same `importSourceRefs` / `resolveSiblingManifest` pair
119
+ * `transformManifest` walks; what it omits is the pin, which answers a
120
+ * different question.
108
121
  */
109
122
  async relativeImportsOf(manifestPath, destination) {
110
123
  const key = path.resolve(manifestPath);
111
- this.claimDestination(key, destination);
112
- return (await this.transformManifest(key)).relativeImports;
124
+ const manifestDir = path.dirname(key);
125
+ const docs = parseAllDocuments(fs.readFileSync(key, "utf8"), {
126
+ customTags: defaultCustomTags(),
127
+ });
128
+ const moduleDoc = findModuleDoc(docs);
129
+ if (!moduleDoc)
130
+ return [];
131
+ // Resolved from the destination passed in rather than through
132
+ // `transportFor`, which reads a CLAIMED one — claiming is exactly what this
133
+ // must not do.
134
+ const transport = defaultTransportRegistry().forRef(destination);
135
+ if (!transport)
136
+ throw new Error(`no transport owns publish destination '${destination}'`);
137
+ const imports = [];
138
+ for (const entry of importSourceRefs(moduleDoc)) {
139
+ const source = entry.source;
140
+ if (!source.startsWith(".") && !source.startsWith("/"))
141
+ continue;
142
+ imports.push({
143
+ manifestPath: resolveSiblingManifest(manifestDir, source),
144
+ // The destination the import resolves to, unversioned: the question here
145
+ // is WHERE a sibling publishes, and the version is the pin's business.
146
+ ref: transport.source.resolveRelative(destination, source),
147
+ });
148
+ }
149
+ return imports;
113
150
  }
114
151
  /**
115
152
  * The published `telo.yaml` text — byte for byte what the transport pushes,
@@ -168,6 +205,7 @@ export class ModulePayloadBuilder {
168
205
  const moduleDoc = findModuleDoc(docs);
169
206
  const relativeImports = [];
170
207
  const authoredPins = [];
208
+ const sources = readSources(moduleDoc?.toJSON(), manifestDir);
171
209
  if (moduleDoc) {
172
210
  const destination = this.destinationOf(manifestPath);
173
211
  const transport = this.transportFor(manifestPath);
@@ -203,6 +241,10 @@ export class ModulePayloadBuilder {
203
241
  moduleDoc.setIn(entry.path, `${ref}#${hash}`);
204
242
  }
205
243
  }
244
+ // `sources:` is authoring input no consumer reads. Removed here, in the text
245
+ // every dependent's pin hashes, so an upstream URL that moved with unchanged
246
+ // bytes changes no published manifest.
247
+ moduleDoc?.delete("sources");
206
248
  // Unconditional. Whether a manifest was rewritten is a property of its own
207
249
  // content, and letting it decide the serializer meant one commit produced two
208
250
  // different byte sequences for the same document.
@@ -211,6 +253,7 @@ export class ModulePayloadBuilder {
211
253
  text: expandAndInlineIncludes(canonical, manifestDir),
212
254
  relativeImports,
213
255
  authoredPins,
256
+ sources,
214
257
  };
215
258
  }
216
259
  async siblingHash(siblingManifest) {
@@ -219,9 +262,20 @@ export class ModulePayloadBuilder {
219
262
  }
220
263
  async buildPayload(manifestPath) {
221
264
  const manifestDir = path.dirname(manifestPath);
222
- const { text: manifest, relativeImports, authoredPins } = await this.transformManifest(manifestPath);
265
+ const { text: manifest, relativeImports, authoredPins, sources } = await this.transformManifest(manifestPath);
266
+ const fromPins = (this.options.stagedFiles ?? "pins") === "pins";
223
267
  const claims = collectModuleFileClaims(manifest);
224
- const partition = partitionLayers(claims, selectFiles(manifestDir, readFilesPatterns(manifest)), readAssetPatterns(manifest));
268
+ const native = readNativeFiles(manifest, manifestDir);
269
+ const staged = stagedEntriesOf(sources);
270
+ await assertNamedFiles(manifestDir, native, claims, sources, staged, fromPins);
271
+ // A notice ships because its source names it, as if `files:` selected it.
272
+ const notices = sources.flatMap((source) => source.notices);
273
+ const partition = partitionLayers(claims, [
274
+ ...new Set([
275
+ ...selectFiles(manifestDir, readFilesPatterns(manifest), { links: true }),
276
+ ...notices,
277
+ ]),
278
+ ].sort(), readAssetPatterns(manifest), native);
225
279
  // Every code entry point is BUILT, not read: `path=` names a gitignored
226
280
  // artifact that may not exist at all on a fresh clone, and reading a stale
227
281
  // one would digest and ship bytes other than the source the manifest says
@@ -255,15 +309,43 @@ export class ModulePayloadBuilder {
255
309
  for (const input of bundle.inputs)
256
310
  buildInputs.add(input);
257
311
  }
258
- assertWithinModule(manifestDir, partition.layers.flatMap((layer) => layer.files), new Set(built.keys()));
259
- const layers = partition.layers.map((layer) => ({
260
- role: layer.role,
261
- ...(layer.selector ? { selector: layer.selector } : {}),
262
- files: layer.files.map((rel) => ({
263
- name: rel,
264
- content: built.get(rel) ?? fs.readFileSync(path.resolve(manifestDir, rel)),
265
- })),
266
- }));
312
+ // Built entry points exist once built; staged files, when read from their
313
+ // pins, need not be on disk at all.
314
+ assertWithinModule(manifestDir, partition.layers.flatMap((layer) => layer.files), new Set([...built.keys(), ...(fromPins ? staged.keys() : [])]));
315
+ // Read as the kind each file is on disk: a link ships as a link, a file with
316
+ // an execute bit as executable, and both are in the layer's integrity. A
317
+ // staged file read from its pin contributes exactly that line.
318
+ const layers = [];
319
+ for (const layer of partition.layers) {
320
+ const files = [];
321
+ for (const rel of layer.files) {
322
+ const content = built.get(rel);
323
+ const stagedEntry = staged.get(rel)?.entry;
324
+ if (content) {
325
+ files.push({ name: rel, content });
326
+ }
327
+ else if (fromPins && stagedEntry?.kind === "link") {
328
+ files.push({ name: rel, link: stagedEntry.target });
329
+ }
330
+ else if (fromPins && stagedEntry?.kind === "file") {
331
+ // `assertNamedFiles` refused an unpinned one.
332
+ files.push({ name: rel, sha256: stagedEntry.pin.sha256, executable: stagedEntry.pin.executable });
333
+ }
334
+ else if (stagedEntry?.kind === "file") {
335
+ // `assertNamedFiles` verified the bytes against the pin, and the pin is
336
+ // what declares the execute bit — a Windows checkout has none to read.
337
+ const file = await readPayloadFile(manifestDir, rel);
338
+ if (isPayloadLink(file))
339
+ throw new Error(`'${rel}' is staged as a file, but is a link on disk.`);
340
+ files.push(stagedEntry.pin.executable ? { name: rel, content: file.content, executable: true } : { name: rel, content: file.content });
341
+ }
342
+ else {
343
+ files.push(await readPayloadFile(manifestDir, rel));
344
+ }
345
+ }
346
+ layers.push({ role: layer.role, ...(layer.selector ? { selector: layer.selector } : {}), files });
347
+ }
348
+ assertLayerEntries(manifestDir, layers);
267
349
  // The `layers:` index is part of the published manifest, so it is written
268
350
  // HERE and not by the transport at push time.
269
351
  //
@@ -278,8 +360,23 @@ export class ModulePayloadBuilder {
278
360
  //
279
361
  // The transport still owns the framing a `blob` digest covers, so the index
280
362
  // comes from it; publish re-frames the same layers and hard-fails if a
281
- // digest moved.
282
- const index = await this.transportFor(manifestPath).layerIndex(layers);
363
+ // digest moved. A layer holding a pinned entry has no bytes to frame and
364
+ // takes the stand-in `blob`; publish reads the staged bytes instead, so a
365
+ // stand-in never reaches a registry.
366
+ const transport = this.transportFor(manifestPath);
367
+ const index = [];
368
+ for (const layer of layers) {
369
+ if (!layer.files.some(isPinnedFile)) {
370
+ index.push(...(await transport.layerIndex([layer])));
371
+ continue;
372
+ }
373
+ index.push({
374
+ role: layer.role,
375
+ ...(layer.selector ? { selector: layer.selector } : {}),
376
+ blob: await pinnedLayerBlob(layer.files),
377
+ integrity: await computeFilesIntegrity(layer.files),
378
+ });
379
+ }
283
380
  return {
284
381
  manifest: index.length > 0 ? injectLayerIndex(manifest, index) : manifest,
285
382
  layers,
@@ -1 +1 @@
1
- {"version":3,"file":"module-payload.js","sourceRoot":"","sources":["../../src/bundle/module-payload.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EACzB,eAAe,EACf,cAAc,GAGf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,gBAAgB,EAChB,iBAAiB,GAGlB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAClF,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACnG,OAAO,EAAE,eAAe,EAAkB,MAAM,uBAAuB,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAgEpE;;;;;;;;;GASG;AACH,MAAM,OAAO,oBAAoB;IA0BF;IAzBZ,QAAQ,GAAG,IAAI,GAAG,EAAkC,CAAC;IACtE;2EACuE;IACtD,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;IAE9C;;;;;;;;;;;;;;;;;OAiBG;IACc,YAAY,GAAG,IAAI,GAAG,EAAkB,CAAC;IAE1D,YAA6B,OAA8B;QAA9B,YAAO,GAAP,OAAO,CAAuB;IAAG,CAAC;IAE/D,KAAK,CAAC,OAAO,CAAC,YAAoB,EAAE,WAAmB;QACrD,MAAM,GAAG,G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B,MAAM,oDAAoD,CAAC,CAAC;IAChG,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAS,kBAAkB,CAAC,eAAuB,EAAE,MAAc;IACjE,MAAM,KAAK,GAAG,iBAAiB,CAAC,EAAE,CAAC,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC,EAAE;QACxE,UAAU,EAAE,iBAAiB,EAAE;KAChC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,EAAsD,CAAC;IACpE,MAAM,OAAO,GAAG,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAC;IACzC,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CACb,kBAAkB,MAAM,iBAAiB,eAAe,8BAA8B;YACpF,gDAAgD,CACnD,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -1,4 +1,4 @@
1
- import { type ArtifactSelector, type ModuleFileClaim } from "@telorun/analyzer";
1
+ import { type ArtifactSelector, type ModuleFileClaim, type NativeEntry } from "@telorun/analyzer";
2
2
  import type { PayloadLayer } from "@telorun/kernel";
3
3
  /** Manifest-relative POSIX path of a selected file, grouped into the layer it
4
4
  * belongs to. Content is read by the caller — this module decides membership
@@ -27,9 +27,12 @@ export interface Partition {
27
27
  * Partition the selected payload into the layers a module artifact ships.
28
28
  *
29
29
  * A **controller layer** per distinct selector, holding its entry points plus
30
- * whatever their sibling qualifiers claim. The **assets** layer holds what
31
- * `assets:` claims it is fetched lazily, on first module-relative access. The
32
- * **common** layer holds everything left over.
30
+ * whatever their sibling qualifiers claim. A **native layer** per distinct
31
+ * selector of the module's `native:` entries, holding their files a claim that
32
+ * outranks `files:`, `assets:` and a sibling pattern selecting the same file, so
33
+ * a platform's binary never ships to another platform. The **assets** layer
34
+ * holds what `assets:` claims — it is fetched lazily, on first module-relative
35
+ * access. The **common** layer holds everything left over.
33
36
  *
34
37
  * The sink runs toward correctness: an unclaimed file joins `common`, which is
35
38
  * materialized alongside *any* controller layer, so a sidecar nobody declared is
@@ -43,9 +46,13 @@ export interface Partition {
43
46
  * `assetPatterns` is the author's `assets:` list. A claimed file joins the
44
47
  * payload whether or not `files:` selected it — the manifest already names it,
45
48
  * so restating it would be pure duplication. Layers with no files are dropped,
46
- * so a controller-only module publishes exactly one payload layer.
49
+ * so a controller-only module publishes exactly one payload layer. `native` is
50
+ * what `readNativeEntries` read off the module doc.
51
+ *
52
+ * Throws when a `native:` entry names a file the manifest also names as code or
53
+ * as an embed: a file extracts from exactly one layer.
47
54
  */
48
- export declare function partitionLayers(claims: readonly ModuleFileClaim[], files: string[], assetPatterns: string[]): Partition;
55
+ export declare function partitionLayers(claims: readonly ModuleFileClaim[], files: string[], assetPatterns: string[], native?: readonly NativeEntry[]): Partition;
49
56
  /**
50
57
  * One line per layer for the publish output, so an author can see that a file they
51
58
  * meant as a sidecar or an asset landed in `common` instead.
@@ -1 +1 @@
1
- {"version":3,"file":"partition-layers.d.ts","sourceRoot":"","sources":["../../src/bundle/partition-layers.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACrB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD;;uDAEuD;AACvD,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC3B,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;uEAEuE;AACvE,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB;yDACqD;IACrD,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B;oBACgB;IAChB,iBAAiB,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC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hE"}
@@ -1,12 +1,15 @@
1
- import { describeSelector, selectorKey, } from "@telorun/analyzer";
1
+ import { describeClaim, describeSelector, nativeClaimConflicts, selectorKey, } from "@telorun/analyzer";
2
2
  import { selectByPatterns } from "@telorun/glob";
3
3
  /**
4
4
  * Partition the selected payload into the layers a module artifact ships.
5
5
  *
6
6
  * A **controller layer** per distinct selector, holding its entry points plus
7
- * whatever their sibling qualifiers claim. The **assets** layer holds what
8
- * `assets:` claims it is fetched lazily, on first module-relative access. The
9
- * **common** layer holds everything left over.
7
+ * whatever their sibling qualifiers claim. A **native layer** per distinct
8
+ * selector of the module's `native:` entries, holding their files a claim that
9
+ * outranks `files:`, `assets:` and a sibling pattern selecting the same file, so
10
+ * a platform's binary never ships to another platform. The **assets** layer
11
+ * holds what `assets:` claims — it is fetched lazily, on first module-relative
12
+ * access. The **common** layer holds everything left over.
10
13
  *
11
14
  * The sink runs toward correctness: an unclaimed file joins `common`, which is
12
15
  * materialized alongside *any* controller layer, so a sidecar nobody declared is
@@ -20,9 +23,15 @@ import { selectByPatterns } from "@telorun/glob";
20
23
  * `assetPatterns` is the author's `assets:` list. A claimed file joins the
21
24
  * payload whether or not `files:` selected it — the manifest already names it,
22
25
  * so restating it would be pure duplication. Layers with no files are dropped,
23
- * so a controller-only module publishes exactly one payload layer.
26
+ * so a controller-only module publishes exactly one payload layer. `native` is
27
+ * what `readNativeEntries` read off the module doc.
28
+ *
29
+ * Throws when a `native:` entry names a file the manifest also names as code or
30
+ * as an embed: a file extracts from exactly one layer.
24
31
  */
25
- export function partitionLayers(claims, files, assetPatterns) {
32
+ export function partitionLayers(claims, files, assetPatterns, native = []) {
33
+ const nativeFiles = new Set(native.map((entry) => entry.path));
34
+ assertNativeFilesUnclaimed(native, claims);
26
35
  // Narrowing predicates, so the controller branch reaches `selector` and
27
36
  // `siblings` as declared fields rather than through a non-null assertion —
28
37
  // the claim type is a discriminated union precisely so this is checked.
@@ -43,7 +52,11 @@ export function partitionLayers(claims, files, assetPatterns) {
43
52
  // Sibling patterns are still matched against `files:` alone: a sibling is a
44
53
  // glob over the payload, so a pattern that selects nothing there means the
45
54
  // author forgot to include the file, which `unmatchedSiblings` reports.
46
- const selected = new Set([...files, ...claims.map((claim) => claim.path)]);
55
+ const selected = new Set([
56
+ ...files,
57
+ ...claims.map((claim) => claim.path),
58
+ ...nativeFiles,
59
+ ]);
47
60
  const unclaimed = new Set([...files, ...claimedAssets.map((claim) => claim.path)]);
48
61
  // Controller layers first: a file an entry point or sibling claims belongs to
49
62
  // that selector, never to assets or common, so the layer a kernel skips is
@@ -81,6 +94,10 @@ export function partitionLayers(claims, files, assetPatterns) {
81
94
  }
82
95
  }
83
96
  for (const file of [claim.path, ...siblings]) {
97
+ // A native file a sibling pattern also matches belongs to its platform's
98
+ // native layer; copying it here would ship it to every host of this format.
99
+ if (nativeFiles.has(file))
100
+ continue;
84
101
  unclaimed.delete(file);
85
102
  // A controller entry point that is also this module's library entry point
86
103
  // ships once, in the library layer; the controller layer would be a second
@@ -91,6 +108,19 @@ export function partitionLayers(claims, files, assetPatterns) {
91
108
  plan.files.push(file);
92
109
  }
93
110
  }
111
+ // Names sharing a selector share its layer; one path declared under several
112
+ // names is one file.
113
+ for (const entry of native) {
114
+ const key = `native\0${selectorKey(entry.selector)}`;
115
+ let plan = bySelector.get(key);
116
+ if (!plan) {
117
+ plan = { role: "native", selector: entry.selector, files: [] };
118
+ bySelector.set(key, plan);
119
+ }
120
+ unclaimed.delete(entry.path);
121
+ if (!plan.files.includes(entry.path))
122
+ plan.files.push(entry.path);
123
+ }
94
124
  // A file a tag embeds is an asset by declaration, so it needs no `assets:`
95
125
  // pattern to be lazy — the manifest already said what it is. A pattern can
96
126
  // still claim more, and a file claimed both ways is one file.
@@ -115,6 +145,18 @@ export function partitionLayers(claims, files, assetPatterns) {
115
145
  unmatchedSiblings,
116
146
  };
117
147
  }
148
+ /** Refuse a file both a `native:` entry and another manifest declaration name —
149
+ * the rule `telo check` reports as `NATIVE_PATH_CLAIMED`. */
150
+ function assertNativeFilesUnclaimed(native, claims) {
151
+ const conflicts = nativeClaimConflicts(native, claims.map((claim) => ({ claim }))).map(({ entry, claim }) => ` '${entry.path}': ${entry.origin} for ${describeSelector(entry.selector)}, and ` +
152
+ describeClaim(claim));
153
+ if (conflicts.length === 0)
154
+ return;
155
+ throw new Error(`The manifest names ${conflicts.length === 1 ? "a file" : "files"} both as a native file ` +
156
+ `and through another declaration:\n${conflicts.join("\n")}\n` +
157
+ `A native file ships only in its platform's native layer, and a file extracts from ` +
158
+ `exactly one layer. Give the native entry its own file, or drop the other declaration.`);
159
+ }
118
160
  /**
119
161
  * One line per layer for the publish output, so an author can see that a file they
120
162
  * meant as a sidecar or an asset landed in `common` instead.