@xemahq/xema 0.25.1 → 0.27.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 (239) hide show
  1. package/README.md +70 -37
  2. package/dist/assets/appliance-base/images.lock.json +126 -126
  3. package/dist/assets/appliance-lean/images.lock.json +123 -123
  4. package/dist/assets/cloud/images.lock.json +126 -126
  5. package/dist/assets/core/images.lock.json +120 -120
  6. package/dist/assets/distribution-assets.manifest.json +15 -16
  7. package/dist/assets/minimal/images.lock.json +108 -108
  8. package/dist/assets/oss/images.lock.json +126 -126
  9. package/dist/assets/starter/images.lock.json +123 -123
  10. package/dist/cli.js +2 -2
  11. package/dist/cli.js.map +1 -1
  12. package/dist/commands/dev.js +1 -0
  13. package/dist/commands/dev.js.map +1 -1
  14. package/dist/commands/down.d.ts.map +1 -1
  15. package/dist/commands/down.js +7 -1
  16. package/dist/commands/down.js.map +1 -1
  17. package/dist/commands/edition.d.ts +3 -0
  18. package/dist/commands/edition.d.ts.map +1 -0
  19. package/dist/commands/edition.js +46 -0
  20. package/dist/commands/edition.js.map +1 -0
  21. package/dist/commands/init.js +2 -2
  22. package/dist/commands/init.js.map +1 -1
  23. package/dist/commands/serve.js +1 -0
  24. package/dist/commands/serve.js.map +1 -1
  25. package/dist/commands/up.js +1 -0
  26. package/dist/commands/up.js.map +1 -1
  27. package/dist/dev/env-defaults.d.ts.map +1 -1
  28. package/dist/dev/env-defaults.js +6 -1
  29. package/dist/dev/env-defaults.js.map +1 -1
  30. package/dist/dev/infra-preflight.d.ts +3 -2
  31. package/dist/dev/infra-preflight.d.ts.map +1 -1
  32. package/dist/dev/infra-preflight.js +18 -8
  33. package/dist/dev/infra-preflight.js.map +1 -1
  34. package/dist/edition/verify-image-evidence.bundle.mjs +54179 -0
  35. package/dist/edition/verify-image-evidence.bundle.provenance.json +2871 -0
  36. package/dist/runtime/backing-registration.d.ts.map +1 -1
  37. package/dist/runtime/backing-registration.js +7 -2
  38. package/dist/runtime/backing-registration.js.map +1 -1
  39. package/dist/runtime/config/schema.d.ts +1 -0
  40. package/dist/runtime/config/schema.d.ts.map +1 -1
  41. package/dist/runtime/custody/local-custody.d.ts +12 -0
  42. package/dist/runtime/custody/local-custody.d.ts.map +1 -0
  43. package/dist/runtime/custody/local-custody.js +22 -0
  44. package/dist/runtime/custody/local-custody.js.map +1 -0
  45. package/dist/runtime/custody/openbao-custody-bootstrap.d.ts +18 -0
  46. package/dist/runtime/custody/openbao-custody-bootstrap.d.ts.map +1 -0
  47. package/dist/runtime/custody/openbao-custody-bootstrap.js +50 -0
  48. package/dist/runtime/custody/openbao-custody-bootstrap.js.map +1 -0
  49. package/dist/runtime/custody/openbao-custody-store.d.ts +18 -0
  50. package/dist/runtime/custody/openbao-custody-store.d.ts.map +1 -0
  51. package/dist/runtime/custody/openbao-custody-store.js +55 -0
  52. package/dist/runtime/custody/openbao-custody-store.js.map +1 -0
  53. package/dist/runtime/custody/openbao-http-client.d.ts +34 -0
  54. package/dist/runtime/custody/openbao-http-client.d.ts.map +1 -0
  55. package/dist/runtime/custody/openbao-http-client.js +154 -0
  56. package/dist/runtime/custody/openbao-http-client.js.map +1 -0
  57. package/dist/runtime/custody/openbao-local-constants.d.ts +22 -0
  58. package/dist/runtime/custody/openbao-local-constants.d.ts.map +1 -0
  59. package/dist/runtime/custody/openbao-local-constants.js +48 -0
  60. package/dist/runtime/custody/openbao-local-constants.js.map +1 -0
  61. package/dist/runtime/custody/openbao-local-runner.d.ts +16 -0
  62. package/dist/runtime/custody/openbao-local-runner.d.ts.map +1 -0
  63. package/dist/runtime/custody/openbao-local-runner.js +86 -0
  64. package/dist/runtime/custody/openbao-local-runner.js.map +1 -0
  65. package/dist/runtime/edition/run-entry.d.ts +9 -0
  66. package/dist/runtime/edition/run-entry.d.ts.map +1 -0
  67. package/dist/runtime/edition/run-entry.js +36 -0
  68. package/dist/runtime/edition/run-entry.js.map +1 -0
  69. package/dist/runtime/edition/verb-map.d.ts +60 -0
  70. package/dist/runtime/edition/verb-map.d.ts.map +1 -0
  71. package/dist/runtime/edition/verb-map.js +146 -0
  72. package/dist/runtime/edition/verb-map.js.map +1 -0
  73. package/dist/runtime/env-seeder.d.ts +3 -0
  74. package/dist/runtime/env-seeder.d.ts.map +1 -1
  75. package/dist/runtime/env-seeder.js +20 -3
  76. package/dist/runtime/env-seeder.js.map +1 -1
  77. package/dist/runtime/launch.d.ts +3 -1
  78. package/dist/runtime/launch.d.ts.map +1 -1
  79. package/dist/runtime/launch.js +37 -8
  80. package/dist/runtime/launch.js.map +1 -1
  81. package/dist/runtime/paths.d.ts +1 -2
  82. package/dist/runtime/paths.d.ts.map +1 -1
  83. package/dist/runtime/paths.js +0 -10
  84. package/dist/runtime/paths.js.map +1 -1
  85. package/dist/runtime/runner/chart-local-provenance.d.ts +20 -0
  86. package/dist/runtime/runner/chart-local-provenance.d.ts.map +1 -0
  87. package/dist/runtime/runner/chart-local-provenance.js +114 -0
  88. package/dist/runtime/runner/chart-local-provenance.js.map +1 -0
  89. package/dist/runtime/runner/chart-preflight.d.ts +8 -8
  90. package/dist/runtime/runner/chart-preflight.d.ts.map +1 -1
  91. package/dist/runtime/runner/chart-preflight.js +30 -69
  92. package/dist/runtime/runner/chart-preflight.js.map +1 -1
  93. package/dist/runtime/runner/chart-pull.d.ts +14 -0
  94. package/dist/runtime/runner/chart-pull.d.ts.map +1 -0
  95. package/dist/runtime/runner/chart-pull.js +96 -0
  96. package/dist/runtime/runner/chart-pull.js.map +1 -0
  97. package/dist/runtime/runner/chart-resolver.d.ts +4 -12
  98. package/dist/runtime/runner/chart-resolver.d.ts.map +1 -1
  99. package/dist/runtime/runner/chart-resolver.js +16 -62
  100. package/dist/runtime/runner/chart-resolver.js.map +1 -1
  101. package/dist/runtime/runner/chart-set-lock.d.ts +6 -20
  102. package/dist/runtime/runner/chart-set-lock.d.ts.map +1 -1
  103. package/dist/runtime/runner/chart-set-lock.js +55 -99
  104. package/dist/runtime/runner/chart-set-lock.js.map +1 -1
  105. package/dist/runtime/runner/helm-cli.d.ts +3 -1
  106. package/dist/runtime/runner/helm-cli.d.ts.map +1 -1
  107. package/dist/runtime/runner/helm-cli.js +9 -7
  108. package/dist/runtime/runner/helm-cli.js.map +1 -1
  109. package/dist/runtime/runner/helm-runner.d.ts +4 -4
  110. package/dist/runtime/runner/helm-runner.d.ts.map +1 -1
  111. package/dist/runtime/runner/helm-runner.js +18 -16
  112. package/dist/runtime/runner/helm-runner.js.map +1 -1
  113. package/dist/runtime/sources/kinds/git.d.ts +1 -2
  114. package/dist/runtime/sources/kinds/git.d.ts.map +1 -1
  115. package/dist/runtime/sources/kinds/git.js +8 -5
  116. package/dist/runtime/sources/kinds/git.js.map +1 -1
  117. package/dist/runtime/sources/manifest-walk.d.ts +3 -1
  118. package/dist/runtime/sources/manifest-walk.d.ts.map +1 -1
  119. package/dist/runtime/sources/manifest-walk.js +8 -3
  120. package/dist/runtime/sources/manifest-walk.js.map +1 -1
  121. package/dist/runtime/sources/schema.d.ts +3 -0
  122. package/dist/runtime/sources/schema.d.ts.map +1 -1
  123. package/dist/runtime/sources/schema.js +6 -1
  124. package/dist/runtime/sources/schema.js.map +1 -1
  125. package/dist/runtime/supervisor.d.ts +3 -0
  126. package/dist/runtime/supervisor.d.ts.map +1 -1
  127. package/dist/runtime/supervisor.js +2 -0
  128. package/dist/runtime/supervisor.js.map +1 -1
  129. package/edition/README.md +315 -0
  130. package/edition/assemble-producer-input.mjs +1251 -0
  131. package/edition/authorization-base.mjs +347 -0
  132. package/edition/biome-content.mjs +268 -0
  133. package/edition/build-biome-index.mjs +175 -0
  134. package/edition/build-platform-service-index.mjs +288 -0
  135. package/edition/build-runtime-image-source-index.mjs +821 -0
  136. package/edition/built-verifier.mjs +55 -0
  137. package/edition/catalogue-edition.mjs +49 -0
  138. package/edition/catalogue-fetch.mjs +64 -0
  139. package/edition/catalogue.mjs +135 -0
  140. package/edition/chart-set-source-commit.mjs +92 -0
  141. package/edition/check-committed-image-evidence.mjs +383 -0
  142. package/edition/checkout-indexed-source-repositories.mjs +105 -0
  143. package/edition/comment-blanker.mjs +75 -0
  144. package/edition/connector-source-authority.mjs +60 -0
  145. package/edition/customer-definition.mjs +183 -0
  146. package/edition/customer-flags.mjs +7 -0
  147. package/edition/develop-customer-edition.mjs +99 -0
  148. package/edition/develop-edition-resolve.mjs +65 -0
  149. package/edition/develop-edition.mjs +274 -0
  150. package/edition/develop-freeze.mjs +173 -0
  151. package/edition/develop-image-coordinate.mjs +54 -0
  152. package/edition/develop-seal.mjs +77 -0
  153. package/edition/develop-snapshot-inputs.mjs +104 -0
  154. package/edition/dist-check.mjs +986 -0
  155. package/edition/distribution-evidence-set.mjs +987 -0
  156. package/edition/distribution-paths.mjs +191 -0
  157. package/edition/edition-artifact.mjs +270 -0
  158. package/edition/edition-biome-manifests.mjs +85 -0
  159. package/edition/edition-channel.mjs +6 -0
  160. package/edition/edition-chart-set.mjs +93 -0
  161. package/edition/edition-config.mjs +207 -0
  162. package/edition/edition-constants.mjs +57 -0
  163. package/edition/edition-contract.json +23 -0
  164. package/edition/edition-list.mjs +35 -0
  165. package/edition/edition-locks.mjs +69 -0
  166. package/edition/edition-protocol.mjs +228 -0
  167. package/edition/edition-workspace.mjs +176 -0
  168. package/edition/evidence-checkout.mjs +418 -0
  169. package/edition/evidence-grammars.mjs +16 -0
  170. package/edition/evidence-trust-pin.mjs +304 -0
  171. package/edition/evidence-trust-policy.mjs +256 -0
  172. package/edition/external-source-walk.mjs +463 -0
  173. package/edition/first-party-source-ids.mjs +59 -0
  174. package/edition/fleet-coordinate-finality.mjs +350 -0
  175. package/edition/git-source-auth.mjs +52 -0
  176. package/edition/image-evidence-replay-state.mjs +242 -0
  177. package/edition/image-evidence.mjs +1225 -0
  178. package/edition/kernel-contract-authority.mjs +443 -0
  179. package/edition/lib.mjs +3018 -0
  180. package/edition/no-follow-file.mjs +94 -0
  181. package/edition/oci-evidence-verbs.mjs +392 -0
  182. package/edition/oci-image-source-evidence.mjs +239 -0
  183. package/edition/oras.mjs +648 -0
  184. package/edition/pin-source.mjs +227 -0
  185. package/edition/plan-image-evidence-refresh.mjs +408 -0
  186. package/edition/platform-lock-readability.mjs +892 -0
  187. package/edition/platform-service-class.mjs +18 -0
  188. package/edition/platform-service-source-authority.mjs +105 -0
  189. package/edition/positive-closure.mjs +162 -0
  190. package/edition/produce-distribution-completeness-evidence.mjs +311 -0
  191. package/edition/produce-image-delivery-entitlement-evidence.mjs +294 -0
  192. package/edition/produce-image-source-evidence.mjs +765 -0
  193. package/edition/producer-evidence-bundle.mjs +157 -0
  194. package/edition/registry-credentials.mjs +193 -0
  195. package/edition/release-catalogue.mjs +39 -0
  196. package/edition/release-channel-guard.mjs +99 -0
  197. package/edition/release-edition-artifact.mjs +158 -0
  198. package/edition/remedy-command.mjs +89 -0
  199. package/edition/repin-evidence-trust.mjs +101 -0
  200. package/edition/required-resource-provider.mjs +58 -0
  201. package/edition/resolve-chart-set.mjs +415 -0
  202. package/edition/resolve-customer-edition.mjs +288 -0
  203. package/edition/resolve-distribution.mjs +2318 -0
  204. package/edition/resolve-edition.mjs +186 -0
  205. package/edition/resolve-images.mjs +1606 -0
  206. package/edition/seal-image-digests.mjs +855 -0
  207. package/edition/sealed-evidence-accept.mjs +82 -0
  208. package/edition/source-authority.mjs +725 -0
  209. package/edition/source-closure.mjs +116 -0
  210. package/edition/strict-json.mjs +121 -0
  211. package/edition/string-order.mjs +5 -0
  212. package/edition/trust-policy-arming.mjs +120 -0
  213. package/edition/trusted-executable.mjs +166 -0
  214. package/edition/verifier-binding.mjs +45 -0
  215. package/edition/verifier-files.mjs +8 -0
  216. package/edition/verifier-kernel-schemas.mjs +22 -0
  217. package/edition/verifier-provenance.mjs +64 -0
  218. package/edition/verify-image-evidence.mjs +430 -0
  219. package/edition/verify-image-platforms.mjs +495 -0
  220. package/edition/why.mjs +56 -0
  221. package/edition/workspace-sections.mjs +195 -0
  222. package/examples/06-biome-sources.yaml +1 -0
  223. package/package.json +18 -7
  224. package/dist/commands/dist.d.ts +0 -16
  225. package/dist/commands/dist.d.ts.map +0 -1
  226. package/dist/commands/dist.js +0 -182
  227. package/dist/commands/dist.js.map +0 -1
  228. package/dist/runtime/distribution/available-biome.d.ts +0 -10
  229. package/dist/runtime/distribution/available-biome.d.ts.map +0 -1
  230. package/dist/runtime/distribution/available-biome.js +0 -154
  231. package/dist/runtime/distribution/available-biome.js.map +0 -1
  232. package/dist/runtime/distribution/compose.d.ts +0 -23
  233. package/dist/runtime/distribution/compose.d.ts.map +0 -1
  234. package/dist/runtime/distribution/compose.js +0 -48
  235. package/dist/runtime/distribution/compose.js.map +0 -1
  236. package/dist/runtime/runner/chart-trust.d.ts +0 -57
  237. package/dist/runtime/runner/chart-trust.d.ts.map +0 -1
  238. package/dist/runtime/runner/chart-trust.js +0 -270
  239. package/dist/runtime/runner/chart-trust.js.map +0 -1
package/README.md CHANGED
@@ -87,7 +87,7 @@ The wizard walks you through:
87
87
  **external** (paste your connection URL), and each external URL is
88
88
  **connection-tested** (reachability),
89
89
  - **your own biomes** — add git repo(s) as sources (composed with the edition at
90
- launch), or use `xema dist build` for a full custom distribution.
90
+ launch).
91
91
 
92
92
  Every generated config is validated against the schema before it's written, so it
93
93
  can never be one `xema up` would reject.
@@ -256,6 +256,39 @@ sources must be regular, non-symlink files with no group/other permissions
256
256
  `xema.config.yaml`. The Helm substrate does not accept launcher-resolved
257
257
  secrets: configure Kubernetes Secrets through each service chart instead.
258
258
 
259
+ ### Credential custody — the local OpenBao
260
+
261
+ The credential broker (`credential-broker-api`) refuses to boot without a
262
+ deployment-selected custody provider. On the container and native substrates
263
+ `xema up` therefore runs its own single-node OpenBao (`xema-openbao`, the
264
+ official `openbao/openbao` image pinned by digest, integrated raft storage on the
265
+ `xema-openbao-data` volume, published on `127.0.0.1:8200` only) whenever the
266
+ roster contains the broker. On the first launch the CLI initialises it with a
267
+ single unseal share and stores the unseal key and root token, encrypted, in
268
+ `~/.xema/installations/<installation-id>/openbao-custody.json` (directory
269
+ `0700`, file `0600`); they are never printed. Every later launch only unseals
270
+ from the stored key, so `xema up` is idempotent. The CLI mounts a KV v2 engine
271
+ at `xema-local`, writes a policy limited to `xema-local/{data,metadata}/xema/*`,
272
+ and mints a scoped (non-root) token for the broker on each launch. The broker
273
+ alone receives:
274
+
275
+ | Variable | Value |
276
+ | --- | --- |
277
+ | `CUSTODY_PROVIDER_REF` | `openbao` |
278
+ | `OPENBAO_ADDRESS` | `http://xema-openbao:8200` (container) or `http://127.0.0.1:8200` (native) |
279
+ | `OPENBAO_AUTH_METHOD` | `token` |
280
+ | `OPENBAO_TOKEN` | the scoped broker token |
281
+ | `OPENBAO_MOUNT_PATH` | `xema-local` |
282
+
283
+ `xema down` keeps the vault and its keys; `xema down --purge` removes both
284
+ together. A vault whose keys are missing (or keys whose vault is gone) is
285
+ reported with that instruction rather than re-initialised. The Helm substrate
286
+ does not start a vault: the chart selects the provider.
287
+
288
+ `xema dev` does not start a vault. It expects an OpenBao on `127.0.0.1:8200`
289
+ (pre-flight checks the port) and an `OPENBAO_TOKEN` in your environment; it
290
+ defaults the rest of the contract above.
291
+
259
292
  ### Realtime dev
260
293
 
261
294
  Xema always runs the `distributed` model: every service is its own process and
@@ -327,46 +360,46 @@ What a biome _does_ (services, skills, capabilities, agents) is wholly open —
327
360
  only the bundle _shape_ is standardized, so every author builds the same way and
328
361
  any source resolves the same way.
329
362
 
330
- ## Compose a distribution — `xema dist build`
331
-
332
- Build **your own platform**: take a base edition's first-party biomes and add
333
- the ones you bring (your git repos / workspace dirs). The composition is
334
- validated by the real distribution resolver (dependency closure + trust +
335
- operator rules), then written as a distribution + a launch config:
336
-
337
- ```bash
338
- xema dist build --id acme-platform --base oss \
339
- --platform linux/amd64 \
340
- --git acme=https://github.com/acme/xema-biomes.git \
341
- --source local=./my-biomes \
342
- --config-out acme.config.yaml
343
- # or read sources from an existing config: --config xema.config.yaml
344
- # --no-allow-third-party rejects non-first-party biomes (default: allowed)
345
- ```
346
-
347
- `--platform` is **required and has no default**. It declares the OCI platform(s)
348
- every runtime image of your distribution must be published for — the value
349
- delivery verifies against the real registry manifest. Pass it repeatedly or
350
- comma-separated (`--platform linux/amd64 --platform linux/arm64`, or
351
- `--platform linux/amd64,linux/arm64`); the closed set is `linux/amd64` and
352
- `linux/arm64`. It is not inherited from `--base`: a base edition's
353
- `distribution.lock.json` does not carry the platform set, and guessing one would
354
- silently commit an appliance composition to an architecture its hardware cannot
355
- run. State what your images are actually built for.
356
-
357
- It writes `~/.xema/distributions/<id>/{xema-distribution.json,distribution.lock.json}`
358
- (the composed recipe + resolved record) and, with `--config-out`, a
359
- `xema.config.yaml` (base edition + your sources). Then:
363
+ ## Resolve and check an edition — `xema edition`
360
364
 
361
365
  ```bash
362
- xema dev --config acme.config.yaml # native — your biomes run from source
363
- xema up --edition acme-platform # first-party biomes by edition (your composition)
366
+ xema edition resolve <id> [--check] # the release lock set (distribution, authorization, chart-set, images)
367
+ xema edition seal <id> # seal the image digests
368
+ xema edition develop <subcommand> ... # develop editions: resolve a snapshot into the edition artifact files
369
+ xema edition artifact <id> --channel release --registry <ns> --coordinate <tag> --engine-image <repo>@sha256:<digest> --out <dir>
370
+ # the release edition artifact files, from the committed sealed locks
371
+ xema edition index biome|platform-service|runtime-image-source [--check]
372
+ xema edition check # the committed locks and indices are current
373
+ xema edition why <id> <biome> # why a biome is in an edition
374
+ xema edition verify-platforms <id> # the registry serves every required platform
375
+ xema edition checkout-sources # check out the sources the image index pins
364
376
  ```
365
377
 
366
- Your composed distribution also shows up as an edition in `xema init` and
367
- `xema up --edition <id>`. User biomes are `third-party` by origin and launch via
368
- the source registry (which resolves their source roots); building container
369
- images for your own biomes is a separate step.
378
+ Every verb takes the six roots (`--data-root`, `--editions-root`, `--sources-root`, `--kernel`,
379
+ `--deploy-root`, `--cache-dir`); see `edition/README.md` for which verb needs which.
380
+
381
+ ### The edition protocol — what ties this CLI to a kernel
382
+
383
+ The CLI is coupled to the kernel's **edition protocol**, not to the whole kernel package.
384
+ `@xemahq/contracts` exports the protocol's identity as data
385
+ (`@xemahq/contracts/edition-protocol/edition-protocol.json`): a version and a content digest over
386
+ the exact bytes of every kernel source file the protocol's entry subpaths load at runtime (the
387
+ schemas and every refinement, parser, resolver and composer behind them), derived from the
388
+ kernel's import graph. This CLI declares the protocol versions it supports, each pinned to one
389
+ digest, and vendors each supported contract (the identity, the entry subpaths and the source
390
+ paths); it loads no kernel subpath outside those entry subpaths. `xema edition check` and every
391
+ other verb compare only that identity with the `--kernel` they are given, and refuse any other,
392
+ naming the versions this CLI supports and the version the kernel declares.
393
+
394
+ The digest is a CONSERVATIVE, deterministic stand-in for protocol semantics. Any change to
395
+ accepted or refused edition semantics MUST change it; a behaviour-preserving refactor MAY change
396
+ it too, and the cost is a repin, which is accepted. Semantic equivalence isn't computable, so it
397
+ is never detected.
398
+
399
+ A kernel change outside the protocol's source files keeps the identity, so it needs no CLI
400
+ release. An edition protocol change needs a CLI that supports it, so the order is: **the CLI
401
+ release that supports the new protocol goes first, then the data root repins its kernel
402
+ authority** to a kernel that speaks it.
370
403
 
371
404
  ## Author biomes & run capabilities
372
405