@toa.io/norm 1.0.0-alpha.33 → 1.0.0-alpha.330

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 (100) hide show
  1. package/CHANGELOG.md +381 -0
  2. package/package.json +9 -7
  3. package/src/.component/.expand/bridge.js +2 -6
  4. package/src/.component/.expand/entity.js +2 -9
  5. package/src/.component/.expand/events.js +2 -6
  6. package/src/.component/.expand/extensions.js +8 -9
  7. package/src/.component/.expand/index.js +7 -19
  8. package/src/.component/.expand/operations.js +2 -9
  9. package/src/.component/.expand/receivers.js +4 -7
  10. package/src/.component/.expand/version.js +72 -28
  11. package/src/.component/.normalize/entity.js +7 -0
  12. package/src/.component/.normalize/events.js +16 -4
  13. package/src/.component/.normalize/index.js +4 -9
  14. package/src/.component/.normalize/operations.js +13 -6
  15. package/src/.component/.normalize/receivers.js +4 -5
  16. package/src/.component/collapse.js +60 -9
  17. package/src/.component/defaults.js +5 -11
  18. package/src/.component/dependencies.js +14 -10
  19. package/src/.component/dereference.js +5 -49
  20. package/src/.component/expand.js +3 -9
  21. package/src/.component/extensions.js +9 -10
  22. package/src/.component/index.js +10 -21
  23. package/src/.component/merge.js +25 -15
  24. package/src/.component/migrations.js +57 -0
  25. package/src/.component/normalize.js +10 -6
  26. package/src/.component/schema.yaml +165 -70
  27. package/src/.component/validate.js +67 -17
  28. package/src/.context/.dependencies/connectors.js +5 -9
  29. package/src/.context/.dependencies/describe.js +4 -5
  30. package/src/.context/.dependencies/extensions.js +98 -20
  31. package/src/.context/.dependencies/index.js +3 -9
  32. package/src/.context/.dependencies/resolve.js +44 -7
  33. package/src/.context/complete.js +1 -5
  34. package/src/.context/converge.js +31 -0
  35. package/src/.context/dependencies.js +44 -6
  36. package/src/.context/dereference.js +11 -6
  37. package/src/.context/evict.js +40 -0
  38. package/src/.context/expand.js +37 -5
  39. package/src/.context/index.js +8 -15
  40. package/src/.context/normalize.js +9 -7
  41. package/src/.context/schema.yaml +183 -11
  42. package/src/.context/validate.js +11 -14
  43. package/src/component.js +33 -14
  44. package/src/context.js +47 -15
  45. package/src/definition.js +63 -0
  46. package/src/entity.js +15 -0
  47. package/src/index.js +7 -9
  48. package/src/manifest.js +159 -0
  49. package/src/map.js +26 -0
  50. package/src/shortcuts.js +12 -15
  51. package/test/component/collapse.fixtures.js +30 -39
  52. package/test/component/collapse.test.js +90 -10
  53. package/test/component/dependencies.test.js +16 -14
  54. package/test/component/dereference.fixtures.js +10 -98
  55. package/test/component/dereference.test.js +10 -14
  56. package/test/component/dummies/extension/index.js +1 -5
  57. package/test/component/dummies/migrations/conflicting/migrations/0001-one.yaml +2 -0
  58. package/test/component/dummies/migrations/conflicting/migrations/0001-one.yml +2 -0
  59. package/test/component/dummies/migrations/malformed/migrations/0001-one.yaml +1 -0
  60. package/test/component/dummies/migrations/ordered/migrations/0001-first.yml +4 -0
  61. package/test/component/dummies/migrations/ordered/migrations/0002-second.yaml +4 -0
  62. package/test/component/dummies/migrations/ordered/migrations/0010-third.json +1 -0
  63. package/test/component/dummies/migrations/stateless/migrations/0001-one.yaml +2 -0
  64. package/test/component/expand.fixtures.js +13 -13
  65. package/test/component/expand.test.js +17 -13
  66. package/test/component/migrations.test.js +62 -0
  67. package/test/component/normalize.fixtures.js +3 -7
  68. package/test/component/normalize.test.js +94 -28
  69. package/test/component/validate.fixtures.js +17 -15
  70. package/test/component/validate.test.js +311 -108
  71. package/test/context/complete.fixtures.js +2 -8
  72. package/test/context/complete.test.js +14 -8
  73. package/test/context/converge.test.js +57 -0
  74. package/test/context/dereference.fixtures.js +3 -9
  75. package/test/context/dereference.test.js +18 -7
  76. package/test/context/evict.fixtures.js +39 -0
  77. package/test/context/evict.test.js +73 -0
  78. package/test/context/expand.fixtures.js +1 -5
  79. package/test/context/expand.test.js +36 -8
  80. package/test/context/normalize.fixtures.js +2 -7
  81. package/test/context/normalize.test.js +33 -9
  82. package/test/context/validate.fixtures.js +1 -6
  83. package/test/context/validate.test.js +173 -35
  84. package/test/definition.test.js +35 -0
  85. package/test/dummies/bare/index.js +1 -0
  86. package/test/dummies/defined/definition.js +1 -0
  87. package/test/dummies/defined/index.js +1 -0
  88. package/test/dummies/defined/package.json +1 -0
  89. package/test/manifest.test.js +137 -0
  90. package/test/shortcuts.fixtures.js +4 -9
  91. package/test/shortcuts.test.js +17 -15
  92. package/test/system.test.js +31 -0
  93. package/types/component.d.ts +32 -5
  94. package/types/context/declaration.d.ts +34 -3
  95. package/types/context.d.ts +27 -13
  96. package/types/entity.d.ts +7 -0
  97. package/types/index.d.ts +18 -3
  98. package/src/.component/.expand/properties.js +0 -14
  99. package/src/.context/.dependencies/load.js +0 -36
  100. package/test/context/dependencies.load.test.js +0 -24
package/CHANGELOG.md ADDED
@@ -0,0 +1,381 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ # [1.0.0-alpha.330](https://github.com/toa-io/toa/compare/v1.0.0-alpha.329...v1.0.0-alpha.330) (2026-10-15)
7
+
8
+ **Note:** Version bump only for package @toa.io/norm
9
+
10
+
11
+
12
+
13
+
14
+ # [1.0.0-alpha.329](https://github.com/toa-io/toa/compare/v1.0.0-alpha.328...v1.0.0-alpha.329) (2026-10-11)
15
+
16
+ **Note:** Version bump only for package @toa.io/norm
17
+
18
+
19
+
20
+
21
+
22
+ # [1.0.0-alpha.328](https://github.com/toa-io/toa/compare/v1.0.0-alpha.327...v1.0.0-alpha.328) (2026-10-10)
23
+
24
+ **Note:** Version bump only for package @toa.io/norm
25
+
26
+
27
+
28
+
29
+
30
+ # [1.0.0-alpha.327](https://github.com/toa-io/toa/compare/v1.0.0-alpha.326...v1.0.0-alpha.327) (2026-10-10)
31
+
32
+ ### Features
33
+
34
+ * name a component without a namespace by its name ([abcdd9c](https://github.com/toa-io/toa/commit/abcdd9c9a3d3c5c1c68b74544791848e59a7e158))
35
+
36
+
37
+ # [1.0.0-alpha.326](https://github.com/toa-io/toa/compare/v1.0.0-alpha.325...v1.0.0-alpha.326) (2026-10-06)
38
+
39
+ * feat(core)!: deliver an operation's error as its code and its cause ([18d303b](https://github.com/toa-io/toa/commit/18d303b9143930735e4b093345db1dbf37f90052))
40
+
41
+ ### Bug Fixes
42
+
43
+ * **deps:** find files with tinyglobby, which carries no braces ([ef951af](https://github.com/toa-io/toa/commit/ef951af26b5f93fec567033520c62ca01f397355))
44
+
45
+ ### BREAKING CHANGES
46
+
47
+ * an error returned with a `code` field and no message is an exception,
48
+ and a property of an error other than `cause` no longer reaches the caller.
49
+
50
+
51
+ # [1.0.0-alpha.325](https://github.com/toa-io/toa/compare/v1.0.0-alpha.324...v1.0.0-alpha.325) (2026-10-02)
52
+
53
+ **Note:** Version bump only for package @toa.io/norm
54
+
55
+
56
+
57
+
58
+
59
+ # [1.0.0-alpha.324](https://github.com/toa-io/toa/compare/v1.0.0-alpha.323...v1.0.0-alpha.324) (2026-10-02)
60
+
61
+ **Note:** Version bump only for package @toa.io/norm
62
+
63
+
64
+
65
+
66
+
67
+ # [1.0.0-alpha.323](https://github.com/toa-io/toa/compare/v1.0.0-alpha.322...v1.0.0-alpha.323) (2026-10-01)
68
+
69
+ **Note:** Version bump only for package @toa.io/norm
70
+
71
+
72
+
73
+
74
+
75
+ # [1.0.0-alpha.322](https://github.com/toa-io/toa/compare/v1.0.0-alpha.321...v1.0.0-alpha.322) (2026-09-29)
76
+
77
+ ### Features
78
+
79
+ * **continuity:** give back what a continued effect was answered on an earlier attempt ([507145b](https://github.com/toa-io/toa/commit/507145beb635dad3d948b74630e34858537bf8ef))
80
+
81
+
82
+ # [1.0.0-alpha.321](https://github.com/toa-io/toa/compare/v1.0.0-alpha.320...v1.0.0-alpha.321) (2026-09-28)
83
+
84
+ ### Features
85
+
86
+ * **core:** let an operation declared unchained begin a chain of its own ([6d94324](https://github.com/toa-io/toa/commit/6d94324cb43ff4b12e1bc267d81498445b40a02e))
87
+
88
+
89
+ # [1.0.0-alpha.320](https://github.com/toa-io/toa/compare/v1.0.0-alpha.319...v1.0.0-alpha.320) (2026-09-28)
90
+
91
+ **Note:** Version bump only for package @toa.io/norm
92
+
93
+
94
+
95
+
96
+
97
+ # [1.0.0-alpha.319](https://github.com/toa-io/toa/compare/v1.0.0-alpha.318...v1.0.0-alpha.319) (2026-09-27)
98
+
99
+ **Note:** Version bump only for package @toa.io/norm
100
+
101
+
102
+
103
+
104
+
105
+ # [1.0.0-alpha.318](https://github.com/toa-io/toa/compare/v1.0.0-alpha.317...v1.0.0-alpha.318) (2026-09-23)
106
+
107
+ ### Features
108
+
109
+ * **norm:** hash what a component links into its version ([c01db29](https://github.com/toa-io/toa/commit/c01db29954efbda1a1787abaf20b727f2cbbe7e2))
110
+
111
+
112
+ # [1.0.0-alpha.317](https://github.com/toa-io/toa/compare/v1.0.0-alpha.316...v1.0.0-alpha.317) (2026-09-23)
113
+
114
+ **Note:** Version bump only for package @toa.io/norm
115
+
116
+
117
+
118
+
119
+
120
+ # [1.0.0-alpha.316](https://github.com/toa-io/toa/compare/v1.0.0-alpha.315...v1.0.0-alpha.316) (2026-09-23)
121
+
122
+ **Note:** Version bump only for package @toa.io/norm
123
+
124
+
125
+
126
+
127
+
128
+ # [1.0.0-alpha.315](https://github.com/toa-io/toa/compare/v1.0.0-alpha.314...v1.0.0-alpha.315) (2026-09-23)
129
+
130
+ * feat(map)!: leave out of a contract what the runtime gives every component ([b81837a](https://github.com/toa-io/toa/commit/b81837a3bc4771d7ee1c10fe613c9a1d7501bf1a))
131
+
132
+ ### BREAKING CHANGES
133
+
134
+ * the deployed component map is `/etc/toa/.map.json.gz`.
135
+
136
+
137
+ # [1.0.0-alpha.314](https://github.com/toa-io/toa/compare/v1.0.0-alpha.313...v1.0.0-alpha.314) (2026-09-19)
138
+
139
+ * feat(core)!: let an operation state how long its calls are remembered ([af177c2](https://github.com/toa-io/toa/commit/af177c2ab3d00d475840b5ef9e612f04e82b72bd))
140
+ * feat(core)!: rename trailers to the TRAILERS system property ([8d59ef9](https://github.com/toa-io/toa/commit/8d59ef90d04b7329578203fe10bd21fe41dfe2f5))
141
+
142
+ ### Features
143
+
144
+ * **core:** a reference may name a declaration its package claims ([8040f60](https://github.com/toa-io/toa/commit/8040f60976549ab90497675bb54e664261f5b6bb))
145
+
146
+ ### BREAKING CHANGES
147
+
148
+ * `inbox.retention` under 600 is refused. See
149
+ migrations/313.md.
150
+ * `state._trailers` is `state.TRAILERS`; see migrations/313.md.
151
+
152
+
153
+ # [1.0.0-alpha.313](https://github.com/toa-io/toa/compare/v1.0.0-alpha.312...v1.0.0-alpha.313) (2026-09-18)
154
+
155
+ **Note:** Version bump only for package @toa.io/norm
156
+
157
+
158
+
159
+
160
+
161
+ # [1.0.0-alpha.312](https://github.com/toa-io/toa/compare/v1.0.0-alpha.311...v1.0.0-alpha.312) (2026-09-18)
162
+
163
+ ### Features
164
+
165
+ * **bindings.http:** carry a call that holds a stream ([c571793](https://github.com/toa-io/toa/commit/c571793b617e3d5ae1dce5b98b64d67d7d8224f6))
166
+ * **cli:** write the property that carries a stream into a component's types ([8eae8ce](https://github.com/toa-io/toa/commit/8eae8cea011c0be78b27ed1380a1a6f17c9479f8))
167
+ * **norm:** let an operation declare the input property that carries a stream ([85a8f1f](https://github.com/toa-io/toa/commit/85a8f1ff5b62f658e0527dcce7230d8388d28fe0))
168
+ * **operations:** refuse to render a chart for a context with no version ([d6cd083](https://github.com/toa-io/toa/commit/d6cd083bfe8d7da9f3d451c2c25d821eb41ce958))
169
+
170
+
171
+ # [1.0.0-alpha.311](https://github.com/toa-io/toa/compare/v1.0.0-alpha.310...v1.0.0-alpha.311) (2026-09-17)
172
+
173
+ **Note:** Version bump only for package @toa.io/norm
174
+
175
+
176
+
177
+
178
+
179
+ # [1.0.0-alpha.310](https://github.com/toa-io/toa/compare/v1.0.0-alpha.309...v1.0.0-alpha.310) (2026-09-16)
180
+
181
+ **Note:** Version bump only for package @toa.io/norm
182
+
183
+
184
+
185
+
186
+
187
+ # [1.0.0-alpha.309](https://github.com/toa-io/toa/compare/v1.0.0-alpha.308...v1.0.0-alpha.309) (2026-09-16)
188
+
189
+ **Note:** Version bump only for package @toa.io/norm
190
+
191
+
192
+
193
+
194
+
195
+ # [1.0.0-alpha.308](https://github.com/toa-io/toa/compare/v1.0.0-alpha.307...v1.0.0-alpha.308) (2026-09-15)
196
+
197
+ **Note:** Version bump only for package @toa.io/norm
198
+
199
+
200
+
201
+
202
+
203
+ # [1.0.0-alpha.307](https://github.com/toa-io/toa/compare/v1.0.0-alpha.306...v1.0.0-alpha.307) (2026-09-15)
204
+
205
+ **Note:** Version bump only for package @toa.io/norm
206
+
207
+
208
+
209
+
210
+
211
+ # [1.0.0-alpha.306](https://github.com/toa-io/toa/compare/v1.0.0-alpha.305...v1.0.0-alpha.306) (2026-09-14)
212
+
213
+ **Note:** Version bump only for package @toa.io/norm
214
+
215
+
216
+
217
+
218
+
219
+ # [1.0.0-alpha.305](https://github.com/toa-io/toa/compare/v1.0.0-alpha.304...v1.0.0-alpha.305) (2026-09-13)
220
+
221
+ **Note:** Version bump only for package @toa.io/norm
222
+
223
+
224
+
225
+
226
+
227
+ # [1.0.0-alpha.304](https://github.com/toa-io/toa/compare/v1.0.0-alpha.303...v1.0.0-alpha.304) (2026-09-13)
228
+
229
+ **Note:** Version bump only for package @toa.io/norm
230
+
231
+
232
+
233
+
234
+
235
+ # [1.0.0-alpha.303](https://github.com/toa-io/toa/compare/v1.0.0-alpha.302...v1.0.0-alpha.303) (2026-09-12)
236
+
237
+ ### Features
238
+
239
+ * **operations:** a composition states how many replicas it runs ([4466f5a](https://github.com/toa-io/toa/commit/4466f5abcc22c6dceb2994a0143b6bf9d5201d9d))
240
+ * **telemetry:** let a component declare its own metrics ([05aa3c7](https://github.com/toa-io/toa/commit/05aa3c72cd6a160e1cef99df6176a7f627075bc0))
241
+
242
+
243
+ # [1.0.0-alpha.302](https://github.com/toa-io/toa/compare/v1.0.0-alpha.301...v1.0.0-alpha.302) (2026-09-11)
244
+
245
+ **Note:** Version bump only for package @toa.io/norm
246
+
247
+
248
+
249
+
250
+
251
+ # [1.0.0-alpha.301](https://github.com/toa-io/toa/compare/v1.0.0-alpha.300...v1.0.0-alpha.301) (2026-09-11)
252
+
253
+ ### Bug Fixes
254
+
255
+ * **norm:** an operation that takes no input states none ([3b69b4c](https://github.com/toa-io/toa/commit/3b69b4c92b3f06361a3552f036a927f4ff32e58b))
256
+
257
+ ### Features
258
+
259
+ * **norm:** an environment name may fall back along a colon-separated chain ([a267c1c](https://github.com/toa-io/toa/commit/a267c1caae816a75ada8352d5361b99817c72eb1))
260
+ * **operations:** an evicted component is given its environment and configuration ([6cf7890](https://github.com/toa-io/toa/commit/6cf7890a632a2185d2b7d9790890a04187e5a897))
261
+
262
+
263
+ # [1.0.0-alpha.300](https://github.com/toa-io/toa/compare/v1.0.0-alpha.299...v1.0.0-alpha.300) (2026-09-11)
264
+
265
+ * feat(boot)!: a process is a thing, and an extension may keep something in one ([528d6cd](https://github.com/toa-io/toa/commit/528d6cdd307b45a6c30b6a184d7e06b3328cecf8))
266
+ * feat(core)!: an operation may ask to run once ([dca616c](https://github.com/toa-io/toa/commit/dca616cb380a7a389e277875d3bd5ca55a6e4d45))
267
+
268
+ ### Features
269
+
270
+ * **core:** a call may name the process it goes to, and wait for a set time ([7d8adb2](https://github.com/toa-io/toa/commit/7d8adb2772a95ff45ae5374efdedfb5a857fbbe9))
271
+ * **core:** an assignment may ask to run once as well ([10fbcbd](https://github.com/toa-io/toa/commit/10fbcbd86a5e82960e65f62c09d0a465ae8d0353))
272
+ * **norm:** a context says what it does not deploy ([135e6fd](https://github.com/toa-io/toa/commit/135e6fdfbc4270762028e9e5a0516766960ce59c))
273
+
274
+ ### BREAKING CHANGES
275
+
276
+ * `Storage.store`, `.upsert` and `.ensure` take one more
277
+ argument, and `Storage` has two more members. A connector that ignores them
278
+ works exactly as it did; a component that asks it for `once` is refused at
279
+ boot. See migrations/299.md.
280
+ * a composition booted directly has no readiness probe. Readiness is
281
+ the process's, and a composition is not a process. `stage.workload` boots one where a
282
+ suite needs it.
283
+
284
+
285
+ # [1.0.0-alpha.299](https://github.com/toa-io/toa/compare/v1.0.0-alpha.298...v1.0.0-alpha.299) (2026-09-10)
286
+
287
+ ### Features
288
+
289
+ * **convergence:** deployments of one context converge ([8a70343](https://github.com/toa-io/toa/commit/8a70343cf6953aab58d4a25bac215508ff8d9a37))
290
+ * **convergence:** what an extension ships converges too ([b3be33d](https://github.com/toa-io/toa/commit/b3be33d2a1db45cfd844288467441aea2f4a722d))
291
+ * **core:** a record carries the region that wrote it ([13ed187](https://github.com/toa-io/toa/commit/13ed187604f06dec66feec2e26ccf9dae30bb048))
292
+
293
+
294
+ # [1.0.0-alpha.298](https://github.com/toa-io/toa/compare/v1.0.0-alpha.297...v1.0.0-alpha.298) (2026-09-08)
295
+
296
+ **Note:** Version bump only for package @toa.io/norm
297
+
298
+
299
+
300
+
301
+
302
+ # [1.0.0-alpha.297](https://github.com/toa-io/toa/compare/v1.0.0-alpha.296...v1.0.0-alpha.297) (2026-09-08)
303
+
304
+ **Note:** Version bump only for package @toa.io/norm
305
+
306
+
307
+
308
+
309
+
310
+ # [1.0.0-alpha.296](https://github.com/toa-io/toa/compare/v1.0.0-alpha.295...v1.0.0-alpha.296) (2026-09-08)
311
+
312
+ **Note:** Version bump only for package @toa.io/norm
313
+
314
+
315
+
316
+
317
+
318
+ # [1.0.0-alpha.295](https://github.com/toa-io/toa/compare/v1.0.0-alpha.294...v1.0.0-alpha.295) (2026-09-07)
319
+
320
+ **Note:** Version bump only for package @toa.io/norm
321
+
322
+
323
+
324
+
325
+
326
+ # [1.0.0-alpha.294](https://github.com/toa-io/toa/compare/v1.0.0-alpha.293...v1.0.0-alpha.294) (2026-09-07)
327
+
328
+ **Note:** Version bump only for package @toa.io/norm
329
+
330
+
331
+
332
+
333
+
334
+ # [1.0.0-alpha.293](https://github.com/toa-io/toa/compare/v1.0.0-alpha.292...v1.0.0-alpha.293) (2026-09-07)
335
+
336
+ **Note:** Version bump only for package @toa.io/norm
337
+
338
+
339
+
340
+
341
+
342
+ # [1.0.0-alpha.292](https://github.com/toa-io/toa/compare/v1.0.0-alpha.291...v1.0.0-alpha.292) (2026-09-07)
343
+
344
+ ### Features
345
+
346
+ * **cli:** the deployment library is a peer, and the binary is the CLI's ([a923f81](https://github.com/toa-io/toa/commit/a923f8173a55ed1c091213a7c7db1863ca1d0ba6))
347
+ * **definitions:** the version of Toa is the definitions package's ([3d0272e](https://github.com/toa-io/toa/commit/3d0272ea0ab862f4b6c2e58a2f003f92d0f8a87f))
348
+ * **definitions:** what a package declares is read from one package ([7052341](https://github.com/toa-io/toa/commit/70523411b5d9e2b204c999aa02365173f3bb518d))
349
+ * **norm:** a package's definition is read by one resolver ([bffd41c](https://github.com/toa-io/toa/commit/bffd41c8d18c42786b0bf321623088b9dabc4724))
350
+
351
+
352
+ # [1.0.0-alpha.291](https://github.com/toa-io/toa/compare/v1.0.0-alpha.290...v1.0.0-alpha.291) (2026-09-07)
353
+
354
+ **Note:** Version bump only for package @toa.io/norm
355
+
356
+
357
+
358
+
359
+
360
+ # [1.0.0-alpha.289](https://github.com/toa-io/toa/compare/v1.0.0-alpha.288...v1.0.0-alpha.289) (2026-09-07)
361
+
362
+ * A deploy moves only what changed, and a component sees none of the runtime's environment (#1073) ([f38e3db](https://github.com/toa-io/toa/commit/f38e3db533f24db866c57bfa1ef294eff1eaf499)), closes [#1073](https://github.com/toa-io/toa/issues/1073) [#1064](https://github.com/toa-io/toa/issues/1064) [#1066](https://github.com/toa-io/toa/issues/1066) [#1067](https://github.com/toa-io/toa/issues/1067) [#1068](https://github.com/toa-io/toa/issues/1068) [#1069](https://github.com/toa-io/toa/issues/1069) [#1071](https://github.com/toa-io/toa/issues/1071) [#1070](https://github.com/toa-io/toa/issues/1070) [#1072](https://github.com/toa-io/toa/issues/1072)
363
+
364
+ ### BREAKING CHANGES
365
+
366
+ * a component that read `process.env.TOA_*` reads `context` instead;
367
+ `echo(input)` no longer substitutes from the environment; a bash operation sees no
368
+ `TOA_*`; images no longer set `USER node` — see migrations/289.md.
369
+
370
+
371
+ # [1.0.0-alpha.288](https://github.com/toa-io/toa/compare/v1.0.0-alpha.287...v1.0.0-alpha.288) (2026-09-06)
372
+
373
+ **Note:** Version bump only for package @toa.io/norm
374
+
375
+
376
+
377
+
378
+
379
+ # [1.0.0-alpha.287](https://github.com/toa-io/toa/compare/v1.0.0-alpha.286...v1.0.0-alpha.287) (2026-09-06)
380
+
381
+ **Note:** Version bump only for package @toa.io/norm
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@toa.io/norm",
3
- "version": "1.0.0-alpha.33",
3
+ "version": "1.0.0-alpha.330",
4
+ "type": "module",
4
5
  "description": "Toa declarations normalization and validation",
5
6
  "author": "temich <tema.gurtovoy@gmail.com>",
6
7
  "homepage": "https://github.com/toa-io/toa#readme",
@@ -20,11 +21,12 @@
20
21
  "test": "echo \"Error: run tests from root\" && exit 1"
21
22
  },
22
23
  "dependencies": {
23
- "@toa.io/core": "1.0.0-alpha.33",
24
- "@toa.io/generic": "1.0.0-alpha.33",
25
- "@toa.io/schema": "1.0.0-alpha.33",
26
- "@toa.io/schemas": "1.0.0-alpha.33",
27
- "@toa.io/yaml": "1.0.0-alpha.33"
24
+ "@toa.io/core": "1.0.0-alpha.330",
25
+ "@toa.io/definitions": "1.0.0-alpha.330",
26
+ "@toa.io/generic": "1.0.0-alpha.330",
27
+ "@toa.io/prototype": "1.0.0-alpha.327",
28
+ "@toa.io/schemas": "1.0.0-alpha.330",
29
+ "tinyglobby": "0.2.17"
28
30
  },
29
- "gitHead": "ef81cea49d8f8b3b248adaba62d4548bbeb39f80"
31
+ "gitHead": "8d5b161d026b24ee1974005e1f418bc2b782fd3b"
30
32
  }
@@ -1,9 +1,5 @@
1
- 'use strict'
1
+ import { resolve } from '../../shortcuts.js'
2
2
 
3
- const { resolve } = require('../../shortcuts')
4
-
5
- function bridge (manifest) {
3
+ export function bridge(manifest) {
6
4
  manifest.bridge = resolve(manifest.bridge)
7
5
  }
8
-
9
- exports.bridge = bridge
@@ -1,14 +1,7 @@
1
- 'use strict'
1
+ import { resolve } from '../../shortcuts.js'
2
2
 
3
- const { expand } = require('@toa.io/schemas')
4
-
5
- const { resolve } = require('../../shortcuts')
6
-
7
- function entity (manifest) {
3
+ export function entity(manifest) {
8
4
  if (!('entity' in manifest)) return
9
- if ('schema' in manifest.entity) manifest.entity.schema = expand(manifest.entity.schema)
10
5
 
11
6
  manifest.entity.storage = resolve(manifest.entity.storage)
12
7
  }
13
-
14
- exports.entity = entity
@@ -1,8 +1,6 @@
1
- 'use strict'
1
+ import { resolve } from '../../shortcuts.js'
2
2
 
3
- const { resolve } = require('../../shortcuts')
4
-
5
- function events (manifest) {
3
+ export function events(manifest) {
6
4
  if (manifest.events === undefined) return
7
5
 
8
6
  for (const event of Object.values(manifest.events)) {
@@ -10,5 +8,3 @@ function events (manifest) {
10
8
  if (event.bridge !== undefined) event.bridge = resolve(event.bridge)
11
9
  }
12
10
  }
13
-
14
- exports.events = events
@@ -1,20 +1,19 @@
1
- 'use strict'
1
+ import { recognize } from '../../shortcuts.js'
2
2
 
3
- const { recognize } = require('../../shortcuts')
4
-
5
- function extensions (manifest) {
3
+ export function extensions(manifest) {
6
4
  recognize(SHORTCUTS, manifest, 'extensions')
7
5
  recognize(SHORTCUTS, manifest.extensions)
8
6
  }
9
7
 
10
8
  const SHORTCUTS = {
11
9
  exposition: '@toa.io/extensions.exposition',
12
- realtime: '@toa.io/extensions.realtime',
13
- origins: '@toa.io/extensions.origins',
10
+ realtime: '@toa.io/extensions.exposition#realtime',
14
11
  configuration: '@toa.io/extensions.configuration',
15
12
  state: '@toa.io/extensions.state',
16
13
  stash: '@toa.io/extensions.stash',
17
- storages: '@toa.io/extensions.storages'
14
+ storages: '@toa.io/extensions.storages',
15
+ cadence: '@toa.io/extensions.cadence',
16
+ continuity: '@toa.io/extensions.continuity',
17
+ introspection: '@toa.io/extensions.introspection',
18
+ telemetry: '@toa.io/extensions.telemetry'
18
19
  }
19
-
20
- exports.extensions = extensions
@@ -1,19 +1,7 @@
1
- 'use strict'
2
-
3
- const { bridge } = require('./bridge')
4
- const { entity } = require('./entity')
5
- const { events } = require('./events')
6
- const { extensions } = require('./extensions')
7
- const { operations } = require('./operations')
8
- const { properties } = require('./properties')
9
- const { receivers } = require('./receivers')
10
- const { version } = require('./version')
11
-
12
- exports.bridge = bridge
13
- exports.entity = entity
14
- exports.events = events
15
- exports.extensions = extensions
16
- exports.operations = operations
17
- exports.properties = properties
18
- exports.receivers = receivers
19
- exports.version = version
1
+ export { bridge } from './bridge.js'
2
+ export { entity } from './entity.js'
3
+ export { events } from './events.js'
4
+ export { extensions } from './extensions.js'
5
+ export { operations } from './operations.js'
6
+ export { receivers } from './receivers.js'
7
+ export { version } from './version.js'
@@ -1,14 +1,9 @@
1
- 'use strict'
1
+ import { resolve } from '../../shortcuts.js'
2
2
 
3
- const { expand } = require('@toa.io/schemas')
4
- const { resolve } = require('../../shortcuts')
5
-
6
- function operations (manifest) {
3
+ export function operations(manifest) {
7
4
  if (manifest.operations === undefined) return
8
5
 
9
6
  for (const operation of Object.values(manifest.operations)) {
10
- if (operation.input !== undefined) operation.input = expand(operation.input)
11
- if (operation.output !== undefined) operation.output = expand(operation.output)
12
7
  if (operation.bridge !== undefined) operation.bridge = resolve(operation.bridge)
13
8
 
14
9
  if (operation.bindings !== undefined && operation.bindings !== null) {
@@ -16,5 +11,3 @@ function operations (manifest) {
16
11
  }
17
12
  }
18
13
  }
19
-
20
- exports.operations = operations
@@ -1,16 +1,13 @@
1
- 'use strict'
1
+ import { resolve } from '../../shortcuts.js'
2
2
 
3
- const { resolve } = require('../../shortcuts')
4
-
5
- function receivers (manifest) {
3
+ export function receivers(manifest) {
6
4
  if (manifest.receivers === undefined) return
7
5
 
8
6
  for (const [locator, receiver] of Object.entries(manifest.receivers)) {
9
- if (typeof receiver === 'string') manifest.receivers[locator] = { operation: receiver }
7
+ if (typeof receiver === 'string')
8
+ manifest.receivers[locator] = { operation: receiver }
10
9
 
11
10
  if (receiver.binding !== undefined) receiver.binding = resolve(receiver.binding)
12
11
  if (receiver.bridge !== undefined) receiver.bridge = resolve(receiver.bridge)
13
12
  }
14
13
  }
15
-
16
- exports.receivers = receivers
@@ -1,45 +1,89 @@
1
- 'use strict'
1
+ import { join } from 'node:path'
2
+ import { createHash } from 'node:crypto'
3
+ import fs from 'node:fs/promises'
4
+ import { glob } from 'tinyglobby'
2
5
 
3
- const { join } = require('node:path')
4
- const { createHash } = require('node:crypto')
5
- const fs = require('node:fs/promises')
6
- const { createReadStream } = require('node:fs')
7
- const { once } = require('node:events')
6
+ import { definition } from '../../definition.js'
8
7
 
9
- async function version (manifest) {
10
- manifest.version ??= await hash(manifest.path)
8
+ export async function version(manifest) {
9
+ manifest.version ??= await hash(manifest)
11
10
  }
12
11
 
13
- async function hash (path) {
14
- const hash = await hashd(path)
12
+ /**
13
+ * Identifies a build of a component: it becomes the tag of its image, so it must be the
14
+ * same for the same sources and different for different ones — on any machine, and whichever
15
+ * build produced them.
16
+ *
17
+ * What a build leaves out cannot change it: the bridge states what no build ships, a component
18
+ * adds to that with `ignore` and puts one back with `!`, and `files` names what its version is
19
+ * made of where a build copies only some of it. Its manifest is always one of them, because
20
+ * what it declares is what a caller is held to.
21
+ */
22
+ async function hash(manifest) {
23
+ const files = (await list(manifest)).sort()
24
+ const digests = await Promise.all(
25
+ files.map((file) => digest(join(manifest.path, file)))
26
+ )
27
+ const total = createHash('sha256')
15
28
 
16
- return hash.digest('hex').slice(0, 8)
29
+ // the path is part of it: moving a file changes the build even if no content did
30
+ for (let i = 0; i < files.length; i++) total.update(files[i]).update(digests[i])
31
+
32
+ return total.digest('hex').slice(0, 8)
17
33
  }
18
34
 
19
35
  /**
20
- * @param {string} path
21
- * @param {import('node:crypto').Hash} hash
36
+ * @param {toa.norm.Component} manifest
37
+ * @returns {Promise<string[]>} paths relative to the component
22
38
  */
23
- async function hashd (path, hash = createHash('sha256')) {
24
- const stat = await fs.stat(path)
39
+ async function list(manifest) {
40
+ const files = await glob(patterns(manifest.files), {
41
+ cwd: manifest.path,
42
+ dot: true,
43
+ onlyFiles: true,
44
+ expandDirectories: false,
45
+ // sources a component keeps outside its own directory are its own: what a link points to is
46
+ // hashed as the file it stands for, so changing it changes the version
47
+ followSymbolicLinks: true,
48
+ ignore: await ignore(manifest)
49
+ })
50
+
51
+ // what a component declares is what a caller is held to, so its manifest is always one of them
52
+ if (!files.includes(MANIFEST) && (await exists(join(manifest.path, MANIFEST))))
53
+ files.push(MANIFEST)
25
54
 
26
- if (stat.isFile()) {
27
- const stream = createReadStream(path)
55
+ return files
56
+ }
28
57
 
29
- stream.pipe(hash, { end: false })
58
+ /** A path names what is under it, and a pattern is taken as it is. */
59
+ function patterns(files = ['**']) {
60
+ return files.flatMap((file) => (file.includes('*') ? [file] : [file, file + '/**']))
61
+ }
30
62
 
31
- return await once(stream, 'end')
32
- }
63
+ async function ignore(manifest) {
64
+ const { module } = await definition(manifest.bridge)
65
+ const stated = manifest.ignore ?? []
66
+ const back = new Set(
67
+ stated.filter((pattern) => pattern[0] === '!').map((pattern) => pattern.slice(1))
68
+ )
33
69
 
34
- if (stat.isDirectory()) {
35
- const entries = await fs.opendir(path)
70
+ return [
71
+ ...(module.ignore ?? []).filter((pattern) => !back.has(pattern)),
72
+ ...stated.filter((pattern) => pattern[0] !== '!')
73
+ ]
74
+ }
36
75
 
37
- for await (const entry of entries) {
38
- await hashd(join(path, entry.name), hash)
39
- }
76
+ async function exists(path) {
77
+ return await fs
78
+ .access(path)
79
+ .then(() => true)
80
+ .catch(() => false)
81
+ }
40
82
 
41
- return hash
42
- }
83
+ async function digest(path) {
84
+ return createHash('sha256')
85
+ .update(await fs.readFile(path))
86
+ .digest()
43
87
  }
44
88
 
45
- exports.version = version
89
+ const MANIFEST = 'manifest.toa.yaml'