@xemahq/xema 0.36.2 → 0.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/edition/verify-image-evidence.bundle.mjs +1 -1
- package/dist/edition/verify-image-evidence.bundle.provenance.json +41 -41
- package/edition/develop-chart-set.mjs +38 -4
- package/edition/lib.mjs +21 -2
- package/edition/operation-requirements.mjs +13 -1
- package/edition/resolve-distribution.mjs +7 -0
- package/package.json +2 -2
|
@@ -62932,7 +62932,7 @@ function compareStrings(a, b) {
|
|
|
62932
62932
|
|
|
62933
62933
|
// edition/operation-requirements.mjs
|
|
62934
62934
|
var requireFromHere3 = createRequire3(import.meta.url);
|
|
62935
|
-
var PRINCIPAL_PRIVILEGE_FIELDS = Object.freeze(["requiresOperations", "requiresOrganizationSweeps"]);
|
|
62935
|
+
var PRINCIPAL_PRIVILEGE_FIELDS = Object.freeze(["requiresOperations", "optionalOperations", "requiresOrganizationSweeps"]);
|
|
62936
62936
|
|
|
62937
62937
|
// edition/source-authority.mjs
|
|
62938
62938
|
var DistributionSourceMode = Object.freeze({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"artifactSha256": "sha256:
|
|
3
|
+
"artifactSha256": "sha256:a372353def55d2dc330427711ddb3024938a009b390a6888f752019072c44d5f",
|
|
4
4
|
"esbuild": {
|
|
5
5
|
"version": "0.28.2"
|
|
6
6
|
},
|
|
@@ -2383,229 +2383,229 @@
|
|
|
2383
2383
|
},
|
|
2384
2384
|
{
|
|
2385
2385
|
"package": "@xemahq/xema",
|
|
2386
|
-
"version": "0.
|
|
2386
|
+
"version": "0.38.0",
|
|
2387
2387
|
"path": "edition/adapter-host-versions.mjs",
|
|
2388
2388
|
"sha256": "sha256:1b7ebd3592f4da1225fba74aaba912e7d85fbceeb1626f7dcdac83491cbb4d69"
|
|
2389
2389
|
},
|
|
2390
2390
|
{
|
|
2391
2391
|
"package": "@xemahq/xema",
|
|
2392
|
-
"version": "0.
|
|
2392
|
+
"version": "0.38.0",
|
|
2393
2393
|
"path": "edition/authorization-base.mjs",
|
|
2394
2394
|
"sha256": "sha256:bbeac7ff01376cb89ed2140526d4795d8e559b3f01612b404a701f19aaa24c6a"
|
|
2395
2395
|
},
|
|
2396
2396
|
{
|
|
2397
2397
|
"package": "@xemahq/xema",
|
|
2398
|
-
"version": "0.
|
|
2398
|
+
"version": "0.38.0",
|
|
2399
2399
|
"path": "edition/build-ledger.mjs",
|
|
2400
2400
|
"sha256": "sha256:05202cbdd606aee086c8e9c62d28be68c429653a8b1d73a289ed0fe4ff14da85"
|
|
2401
2401
|
},
|
|
2402
2402
|
{
|
|
2403
2403
|
"package": "@xemahq/xema",
|
|
2404
|
-
"version": "0.
|
|
2404
|
+
"version": "0.38.0",
|
|
2405
2405
|
"path": "edition/connector-source-authority.mjs",
|
|
2406
2406
|
"sha256": "sha256:ea94475f4324737673accd7de1303c44db1cbc4dac61a865a06cd83abe310164"
|
|
2407
2407
|
},
|
|
2408
2408
|
{
|
|
2409
2409
|
"package": "@xemahq/xema",
|
|
2410
|
-
"version": "0.
|
|
2410
|
+
"version": "0.38.0",
|
|
2411
2411
|
"path": "edition/distribution-paths.mjs",
|
|
2412
2412
|
"sha256": "sha256:d78a5c8405bc6c25d36fcec61b0030e1fdacac7d528e698adb96f906f4b70279"
|
|
2413
2413
|
},
|
|
2414
2414
|
{
|
|
2415
2415
|
"package": "@xemahq/xema",
|
|
2416
|
-
"version": "0.
|
|
2416
|
+
"version": "0.38.0",
|
|
2417
2417
|
"path": "edition/edition-artifact.mjs",
|
|
2418
2418
|
"sha256": "sha256:287e4cf042626963e07396c706350e9668adbcacd238a7ad4db1d68bba3858b2"
|
|
2419
2419
|
},
|
|
2420
2420
|
{
|
|
2421
2421
|
"package": "@xemahq/xema",
|
|
2422
|
-
"version": "0.
|
|
2422
|
+
"version": "0.38.0",
|
|
2423
2423
|
"path": "edition/edition-channel.mjs",
|
|
2424
2424
|
"sha256": "sha256:3c0c1564dc50be133cad500452d953353aa5beb703142c05a17bbce8175ba9f3"
|
|
2425
2425
|
},
|
|
2426
2426
|
{
|
|
2427
2427
|
"package": "@xemahq/xema",
|
|
2428
|
-
"version": "0.
|
|
2428
|
+
"version": "0.38.0",
|
|
2429
2429
|
"path": "edition/edition-chart-set.mjs",
|
|
2430
2430
|
"sha256": "sha256:f9f16b58279c8c2619a39c5cc92bdbc334543d1a324304cd5d3b120d66dc8f3a"
|
|
2431
2431
|
},
|
|
2432
2432
|
{
|
|
2433
2433
|
"package": "@xemahq/xema",
|
|
2434
|
-
"version": "0.
|
|
2434
|
+
"version": "0.38.0",
|
|
2435
2435
|
"path": "edition/edition-config.mjs",
|
|
2436
2436
|
"sha256": "sha256:e3997bd9a0082e02d01760868b2a4f41ed3081e904126b30fdf86e7938dc6137"
|
|
2437
2437
|
},
|
|
2438
2438
|
{
|
|
2439
2439
|
"package": "@xemahq/xema",
|
|
2440
|
-
"version": "0.
|
|
2440
|
+
"version": "0.38.0",
|
|
2441
2441
|
"path": "edition/edition-constants.mjs",
|
|
2442
2442
|
"sha256": "sha256:71ae51028847ab3430ffec9b229b0516a7705b75a6de1fcfa665f5e1abf8e9bb"
|
|
2443
2443
|
},
|
|
2444
2444
|
{
|
|
2445
2445
|
"package": "@xemahq/xema",
|
|
2446
|
-
"version": "0.
|
|
2446
|
+
"version": "0.38.0",
|
|
2447
2447
|
"path": "edition/edition-contract-parse.mjs",
|
|
2448
2448
|
"sha256": "sha256:c575e96b70bda82899931eb0b18567988e2e13e664fa498bcbef96b571dcabb4"
|
|
2449
2449
|
},
|
|
2450
2450
|
{
|
|
2451
2451
|
"package": "@xemahq/xema",
|
|
2452
|
-
"version": "0.
|
|
2452
|
+
"version": "0.38.0",
|
|
2453
2453
|
"path": "edition/edition-contract.json",
|
|
2454
2454
|
"sha256": "sha256:aa1a05f1728813a7bdb1e02d9305e9adf641d695e6767305210c67a1d81b38a7"
|
|
2455
2455
|
},
|
|
2456
2456
|
{
|
|
2457
2457
|
"package": "@xemahq/xema",
|
|
2458
|
-
"version": "0.
|
|
2458
|
+
"version": "0.38.0",
|
|
2459
2459
|
"path": "edition/edition-protocol.mjs",
|
|
2460
2460
|
"sha256": "sha256:c488ac72ff3f23c0f28f8db159bf84d2c86ec5cda3633db1fe91ca3f21b12214"
|
|
2461
2461
|
},
|
|
2462
2462
|
{
|
|
2463
2463
|
"package": "@xemahq/xema",
|
|
2464
|
-
"version": "0.
|
|
2464
|
+
"version": "0.38.0",
|
|
2465
2465
|
"path": "edition/edition-source-pins.mjs",
|
|
2466
2466
|
"sha256": "sha256:b141474fff33b06734fb62cd2552752b991c8267bb1c9bccb22a81dd80e91c6c"
|
|
2467
2467
|
},
|
|
2468
2468
|
{
|
|
2469
2469
|
"package": "@xemahq/xema",
|
|
2470
|
-
"version": "0.
|
|
2470
|
+
"version": "0.38.0",
|
|
2471
2471
|
"path": "edition/edition-workspace.mjs",
|
|
2472
2472
|
"sha256": "sha256:18ba727e6b13ca252def25cc6bd9adf894cbc2018198c41ce522637eeac7f871"
|
|
2473
2473
|
},
|
|
2474
2474
|
{
|
|
2475
2475
|
"package": "@xemahq/xema",
|
|
2476
|
-
"version": "0.
|
|
2476
|
+
"version": "0.38.0",
|
|
2477
2477
|
"path": "edition/evidence-checkout.mjs",
|
|
2478
2478
|
"sha256": "sha256:31fb669769b31de4c6f2b2501bb96959548172ef166e7568edbbfed7f5079a11"
|
|
2479
2479
|
},
|
|
2480
2480
|
{
|
|
2481
2481
|
"package": "@xemahq/xema",
|
|
2482
|
-
"version": "0.
|
|
2482
|
+
"version": "0.38.0",
|
|
2483
2483
|
"path": "edition/evidence-grammars.mjs",
|
|
2484
2484
|
"sha256": "sha256:4dae22b61ade99219a482b971c9780d68a3d37d021e39cdfe860b245364b8b9f"
|
|
2485
2485
|
},
|
|
2486
2486
|
{
|
|
2487
2487
|
"package": "@xemahq/xema",
|
|
2488
|
-
"version": "0.
|
|
2488
|
+
"version": "0.38.0",
|
|
2489
2489
|
"path": "edition/evidence-trust-pin.mjs",
|
|
2490
2490
|
"sha256": "sha256:b9dd5c01903394436530783614efb0cd357d982ed2befd844a39328479773cbc"
|
|
2491
2491
|
},
|
|
2492
2492
|
{
|
|
2493
2493
|
"package": "@xemahq/xema",
|
|
2494
|
-
"version": "0.
|
|
2494
|
+
"version": "0.38.0",
|
|
2495
2495
|
"path": "edition/git-json.mjs",
|
|
2496
2496
|
"sha256": "sha256:d0d25cda0c19007becabc9a2827c3dcf759b295cd0b41596eb4480c9549a1f21"
|
|
2497
2497
|
},
|
|
2498
2498
|
{
|
|
2499
2499
|
"package": "@xemahq/xema",
|
|
2500
|
-
"version": "0.
|
|
2500
|
+
"version": "0.38.0",
|
|
2501
2501
|
"path": "edition/image-delivery-entitlement-descriptor.mjs",
|
|
2502
2502
|
"sha256": "sha256:4726b66116f01bf2523fafe2b7a356591eca8fb5ca6bd8b154dd4821873e921b"
|
|
2503
2503
|
},
|
|
2504
2504
|
{
|
|
2505
2505
|
"package": "@xemahq/xema",
|
|
2506
|
-
"version": "0.
|
|
2506
|
+
"version": "0.38.0",
|
|
2507
2507
|
"path": "edition/image-evidence-replay-state.mjs",
|
|
2508
2508
|
"sha256": "sha256:eba0cf1d38af0ab2f00c5099fa8bc2edc543136ce92f895544d4d284b3d6af0f"
|
|
2509
2509
|
},
|
|
2510
2510
|
{
|
|
2511
2511
|
"package": "@xemahq/xema",
|
|
2512
|
-
"version": "0.
|
|
2512
|
+
"version": "0.38.0",
|
|
2513
2513
|
"path": "edition/image-evidence.mjs",
|
|
2514
2514
|
"sha256": "sha256:433202eb2db84510acd11de6fe5ede81c8d96b8bc72991444940f7f84a48897f"
|
|
2515
2515
|
},
|
|
2516
2516
|
{
|
|
2517
2517
|
"package": "@xemahq/xema",
|
|
2518
|
-
"version": "0.
|
|
2518
|
+
"version": "0.38.0",
|
|
2519
2519
|
"path": "edition/kernel-capability-domain.mjs",
|
|
2520
2520
|
"sha256": "sha256:3ecf887dd8d399e91a8285f6f115f6e418fb59bbf3f004539fe65ec667219356"
|
|
2521
2521
|
},
|
|
2522
2522
|
{
|
|
2523
2523
|
"package": "@xemahq/xema",
|
|
2524
|
-
"version": "0.
|
|
2524
|
+
"version": "0.38.0",
|
|
2525
2525
|
"path": "edition/kernel-contract-authority.mjs",
|
|
2526
2526
|
"sha256": "sha256:20abdde62a7b037c01ea9bbe1ff1e6094e6b0efd0add2f656f1938a04409bf82"
|
|
2527
2527
|
},
|
|
2528
2528
|
{
|
|
2529
2529
|
"package": "@xemahq/xema",
|
|
2530
|
-
"version": "0.
|
|
2530
|
+
"version": "0.38.0",
|
|
2531
2531
|
"path": "edition/lib.mjs",
|
|
2532
|
-
"sha256": "sha256:
|
|
2532
|
+
"sha256": "sha256:adb469d6a59dd4f326477973e2d6f2d11cc4b33fff4c438ae1cd6f1da3b46fb0"
|
|
2533
2533
|
},
|
|
2534
2534
|
{
|
|
2535
2535
|
"package": "@xemahq/xema",
|
|
2536
|
-
"version": "0.
|
|
2536
|
+
"version": "0.38.0",
|
|
2537
2537
|
"path": "edition/no-follow-file.mjs",
|
|
2538
2538
|
"sha256": "sha256:c17bdf5e441f3c079aa06d4b48bbed05cad087855b9ad2a5e6dc43d5ee2b17c3"
|
|
2539
2539
|
},
|
|
2540
2540
|
{
|
|
2541
2541
|
"package": "@xemahq/xema",
|
|
2542
|
-
"version": "0.
|
|
2542
|
+
"version": "0.38.0",
|
|
2543
2543
|
"path": "edition/operation-requirements.mjs",
|
|
2544
|
-
"sha256": "sha256:
|
|
2544
|
+
"sha256": "sha256:e7fed25747ee92be84cdc864ca35a723356df5b3d08923cf71f4bc66a791eb5d"
|
|
2545
2545
|
},
|
|
2546
2546
|
{
|
|
2547
2547
|
"package": "@xemahq/xema",
|
|
2548
|
-
"version": "0.
|
|
2548
|
+
"version": "0.38.0",
|
|
2549
2549
|
"path": "edition/pin-source.mjs",
|
|
2550
2550
|
"sha256": "sha256:a23fef4698ef66ba9de4a1aabe3eebe6487d1f105f3fc161bafc5a33b99a2440"
|
|
2551
2551
|
},
|
|
2552
2552
|
{
|
|
2553
2553
|
"package": "@xemahq/xema",
|
|
2554
|
-
"version": "0.
|
|
2554
|
+
"version": "0.38.0",
|
|
2555
2555
|
"path": "edition/source-authority.mjs",
|
|
2556
2556
|
"sha256": "sha256:858b607dde94e2abd00a341f569e18cfa567d4bff139c64a2d60abbb7de4c85e"
|
|
2557
2557
|
},
|
|
2558
2558
|
{
|
|
2559
2559
|
"package": "@xemahq/xema",
|
|
2560
|
-
"version": "0.
|
|
2560
|
+
"version": "0.38.0",
|
|
2561
2561
|
"path": "edition/strict-json.mjs",
|
|
2562
2562
|
"sha256": "sha256:f95778396df7f38b086f55d2ec4f3b6644a8aeff2b32282a62829145fb544562"
|
|
2563
2563
|
},
|
|
2564
2564
|
{
|
|
2565
2565
|
"package": "@xemahq/xema",
|
|
2566
|
-
"version": "0.
|
|
2566
|
+
"version": "0.38.0",
|
|
2567
2567
|
"path": "edition/string-order.mjs",
|
|
2568
2568
|
"sha256": "sha256:b3210cd273e4b2e01fb8b1a91e28734cd211d4010c080d0ce95f5e5ff631cffb"
|
|
2569
2569
|
},
|
|
2570
2570
|
{
|
|
2571
2571
|
"package": "@xemahq/xema",
|
|
2572
|
-
"version": "0.
|
|
2572
|
+
"version": "0.38.0",
|
|
2573
2573
|
"path": "edition/trusted-executable.mjs",
|
|
2574
2574
|
"sha256": "sha256:37d46cdbc999ddd55d4ea8aeed4850ddd1efde89ed7b532f5a2ddec87105d796"
|
|
2575
2575
|
},
|
|
2576
2576
|
{
|
|
2577
2577
|
"package": "@xemahq/xema",
|
|
2578
|
-
"version": "0.
|
|
2578
|
+
"version": "0.38.0",
|
|
2579
2579
|
"path": "edition/verifier-binding.mjs",
|
|
2580
2580
|
"sha256": "sha256:80732658617f5255258c538eeb2383331ec8553b44b58d552b567845a7b916aa"
|
|
2581
2581
|
},
|
|
2582
2582
|
{
|
|
2583
2583
|
"package": "@xemahq/xema",
|
|
2584
|
-
"version": "0.
|
|
2584
|
+
"version": "0.38.0",
|
|
2585
2585
|
"path": "edition/verifier-files.mjs",
|
|
2586
2586
|
"sha256": "sha256:cdd14a20a63f0f194a8abb55680a5a7e3ced1f09f8b210a90d349e655f6de0c0"
|
|
2587
2587
|
},
|
|
2588
2588
|
{
|
|
2589
2589
|
"package": "@xemahq/xema",
|
|
2590
|
-
"version": "0.
|
|
2590
|
+
"version": "0.38.0",
|
|
2591
2591
|
"path": "edition/verifier-provenance.mjs",
|
|
2592
2592
|
"sha256": "sha256:3e2fb8e07cf1f66b8ad6c7ac2555fe3af64ec7abeb07cecbaf1939a18c2b3663"
|
|
2593
2593
|
},
|
|
2594
2594
|
{
|
|
2595
2595
|
"package": "@xemahq/xema",
|
|
2596
|
-
"version": "0.
|
|
2596
|
+
"version": "0.38.0",
|
|
2597
2597
|
"path": "edition/verify-image-evidence.mjs",
|
|
2598
2598
|
"sha256": "sha256:62f83f8bb835f360535402d12657156d2c9d6e651b426c2b30a04a2dc2f8d3e8"
|
|
2599
2599
|
},
|
|
2600
2600
|
{
|
|
2601
2601
|
"package": "@xemahq/xema",
|
|
2602
|
-
"version": "0.
|
|
2602
|
+
"version": "0.38.0",
|
|
2603
2603
|
"path": "edition/workspace-sections.mjs",
|
|
2604
2604
|
"sha256": "sha256:058c849767434e9ba911d9310092bede42e3ef959c75bbd35ff8879dc21ce3ff"
|
|
2605
2605
|
},
|
|
2606
2606
|
{
|
|
2607
2607
|
"package": "@xemahq/xema",
|
|
2608
|
-
"version": "0.
|
|
2608
|
+
"version": "0.38.0",
|
|
2609
2609
|
"path": "scripts/build-evidence-verifier.mjs",
|
|
2610
2610
|
"sha256": "sha256:5a688d20c47dc88aff37aa0c6cc02daf2c370a5bc610fef8446ce7be222d4c0b"
|
|
2611
2611
|
},
|
|
@@ -12,10 +12,16 @@
|
|
|
12
12
|
// member against the registry, and build the same schemaVersion 4 lock. The
|
|
13
13
|
// committed release lock is never read.
|
|
14
14
|
//
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
//
|
|
15
|
+
// TWO PUBLISHERS. A develop lock lists the publisher whose repository is the
|
|
16
|
+
// deploy pin role's (this resolution) followed by the release infra publisher,
|
|
17
|
+
// taken verbatim from the data root's committed chart-set.lock.json. Infra
|
|
18
|
+
// charts have no develop channel: the committed release entry is the only
|
|
19
|
+
// published infra set, and the deploy engine plans and applies scope infra on
|
|
20
|
+
// every channel, so a develop deployment needs it to move infra (pgbouncer,
|
|
21
|
+
// external-services) through the pipeline. The data root pin is already in the
|
|
22
|
+
// develop tag, so a moved infra entry moves the tag. A committed lock that is
|
|
23
|
+
// absent, or lacks exactly one infra publisher, is refused: no fallback, no
|
|
24
|
+
// develop-without-infra mode.
|
|
19
25
|
//
|
|
20
26
|
// NOT PUBLISHED IS A REFUSAL. An index or member the registry does not serve
|
|
21
27
|
// (404) is refused by name and version: publish-charts for the deploy commit
|
|
@@ -31,9 +37,11 @@ import { deployPinKey } from './pin-source.mjs';
|
|
|
31
37
|
import {
|
|
32
38
|
CHART_SET_LOCK_FILE,
|
|
33
39
|
buildLock,
|
|
40
|
+
chartSetLockPath,
|
|
34
41
|
chartRegistryClient,
|
|
35
42
|
chartSetPublishers,
|
|
36
43
|
indexRosterAndDigest,
|
|
44
|
+
readLock,
|
|
37
45
|
registryChartDigest,
|
|
38
46
|
sealRoster,
|
|
39
47
|
} from './resolve-chart-set.mjs';
|
|
@@ -53,6 +61,30 @@ function deployPublisher() {
|
|
|
53
61
|
return publishers[0];
|
|
54
62
|
}
|
|
55
63
|
|
|
64
|
+
/** The configured publishers that are not the deploy pin role's: the infra publisher(s) a release lock carries. */
|
|
65
|
+
function infraPublisherIndexes() {
|
|
66
|
+
const deployRepo = basename(deployPinKey());
|
|
67
|
+
return chartSetPublishers().filter((publisher) => basename(publisher.repo) !== deployRepo).map((publisher) => publisher.index);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** The ONE infra publisher entry of the data root's committed release lock, unchanged. */
|
|
71
|
+
function committedInfraPublisher() {
|
|
72
|
+
const path = chartSetLockPath();
|
|
73
|
+
const committed = readLock(path);
|
|
74
|
+
if (committed === null) {
|
|
75
|
+
throw new Error(`${path} is absent or unreadable; a develop edition carries the release infra chart set from it`);
|
|
76
|
+
}
|
|
77
|
+
assertRosteredChartSetLock(committed, path);
|
|
78
|
+
const indexes = infraPublisherIndexes();
|
|
79
|
+
const found = committed.publishers.filter((publisher) => indexes.includes(publisher.index));
|
|
80
|
+
if (indexes.length !== 1 || found.length !== 1) {
|
|
81
|
+
throw new Error(
|
|
82
|
+
`${path} carries ${found.length} infra publisher entries (${indexes.length} infra publishers configured); exactly one is required`,
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
return found[0];
|
|
86
|
+
}
|
|
87
|
+
|
|
56
88
|
/** Run `read`; a registry 404 becomes the "not published yet" refusal naming `what` and the publisher's run for the deploy commit. */
|
|
57
89
|
async function published(read, what, { publisher, xemaDeploySha }) {
|
|
58
90
|
try {
|
|
@@ -87,6 +119,7 @@ export async function resolveDevelopChartSet({ xemaDeploySha, deployDir = deploy
|
|
|
87
119
|
throw new Error(`the deploy checkout SHA is not a 40-hex commit: ${JSON.stringify(xemaDeploySha)}`);
|
|
88
120
|
}
|
|
89
121
|
const publisher = deployPublisher();
|
|
122
|
+
const infraPublisher = committedInfraPublisher();
|
|
90
123
|
const { indexVersion, members } = readRoster(deployDir);
|
|
91
124
|
const registry = client ?? chartRegistryClient();
|
|
92
125
|
const label = `${publisher.index}@${indexVersion}`;
|
|
@@ -108,5 +141,6 @@ export async function resolveDevelopChartSet({ xemaDeploySha, deployDir = deploy
|
|
|
108
141
|
{ [publisher.index]: indexDigest },
|
|
109
142
|
[publisher],
|
|
110
143
|
);
|
|
144
|
+
lock.publishers.push(infraPublisher);
|
|
111
145
|
return assertRosteredChartSetLock(lock, CHART_SET_LOCK_FILE);
|
|
112
146
|
}
|
package/edition/lib.mjs
CHANGED
|
@@ -32,8 +32,10 @@ import { SHA256_HEX_PATTERN } from './evidence-grammars.mjs';
|
|
|
32
32
|
import { readGitJsonAtCommit } from './git-json.mjs';
|
|
33
33
|
import { isKernelCapabilityDomain } from './kernel-capability-domain.mjs';
|
|
34
34
|
import {
|
|
35
|
+
PRINCIPAL_PRIVILEGE_FIELDS,
|
|
35
36
|
assertPrivilegesHavePrincipals,
|
|
36
37
|
componentOperationRequirements,
|
|
38
|
+
componentOptionalOperationRequirements,
|
|
37
39
|
componentOrganizationSweepRequirements,
|
|
38
40
|
} from './operation-requirements.mjs';
|
|
39
41
|
import {
|
|
@@ -1608,7 +1610,7 @@ export async function manifestToIndexEntry({ raw, generatedIndex, rel, repo, pat
|
|
|
1608
1610
|
'resolve no worker image: a worker declares artifact.kind "oci-image" or "shared-oci-image"',
|
|
1609
1611
|
);
|
|
1610
1612
|
}
|
|
1611
|
-
// A privilege (`requiresOperations`, `requiresOrganizationSweeps`) is admitted for a lock workload
|
|
1613
|
+
// A privilege (`requiresOperations`, `optionalOperations`, `requiresOrganizationSweeps`) is admitted for a lock workload
|
|
1612
1614
|
// principal only; on any other component it is refused, never dropped.
|
|
1613
1615
|
assertPrivilegesHavePrincipals(components, imageComponents, rel);
|
|
1614
1616
|
// A biome must declare its images in EXACTLY ONE shape. Declaring both a
|
|
@@ -1655,6 +1657,10 @@ export async function manifestToIndexEntry({ raw, generatedIndex, rel, repo, pat
|
|
|
1655
1657
|
// (`requiresOperations`), keyed by the SAME name the lock uses. Declared
|
|
1656
1658
|
// intent only: the seal admits or refuses each one.
|
|
1657
1659
|
const operationRequirements = {};
|
|
1660
|
+
// `component → the operations it uses only when their owner is served`
|
|
1661
|
+
// (`optionalOperations`), keyed like `operationRequirements`. Declared
|
|
1662
|
+
// intent only: the seal grants, leaves ungranted or refuses each one.
|
|
1663
|
+
const optionalOperationRequirements = {};
|
|
1658
1664
|
// `component → the organization sweeps it may hold`
|
|
1659
1665
|
// (`requiresOrganizationSweeps`), keyed like `operationRequirements`.
|
|
1660
1666
|
// Declared intent only: the seal admits or refuses each one.
|
|
@@ -1752,7 +1758,7 @@ export async function manifestToIndexEntry({ raw, generatedIndex, rel, repo, pat
|
|
|
1752
1758
|
}
|
|
1753
1759
|
// An operation grant is admitted for a rostered workload caller, and a
|
|
1754
1760
|
// runtime component is not one. Refused rather than dropped.
|
|
1755
|
-
for (const field of
|
|
1761
|
+
for (const field of PRINCIPAL_PRIVILEGE_FIELDS) {
|
|
1756
1762
|
if (component[field] !== undefined) {
|
|
1757
1763
|
throw new Error(
|
|
1758
1764
|
`${where} declares scheduler "runtime" and ${field} — a ` +
|
|
@@ -1846,6 +1852,8 @@ export async function manifestToIndexEntry({ raw, generatedIndex, rel, repo, pat
|
|
|
1846
1852
|
serviceProcessFacts[name] = componentProcessFacts(component, where);
|
|
1847
1853
|
const operations = componentOperationRequirements(component, where);
|
|
1848
1854
|
if (operations !== null) {operationRequirements[name] = operations;}
|
|
1855
|
+
const optionalOperations = componentOptionalOperationRequirements(component, where);
|
|
1856
|
+
if (optionalOperations !== null) {optionalOperationRequirements[name] = optionalOperations;}
|
|
1849
1857
|
const sweeps = componentOrganizationSweepRequirements(component, where);
|
|
1850
1858
|
if (sweeps !== null) {organizationSweepRequirements[name] = sweeps;}
|
|
1851
1859
|
const queues = componentWorkerTaskQueues(component, protocol, where);
|
|
@@ -2285,6 +2293,17 @@ export async function manifestToIndexEntry({ raw, generatedIndex, rel, repo, pat
|
|
|
2285
2293
|
),
|
|
2286
2294
|
}
|
|
2287
2295
|
: {}),
|
|
2296
|
+
// The operations each workload component uses only when their owner is
|
|
2297
|
+
// served; omitted when none declares any.
|
|
2298
|
+
...(Object.keys(optionalOperationRequirements).length > 0
|
|
2299
|
+
? {
|
|
2300
|
+
optionalOperationRequirements: Object.fromEntries(
|
|
2301
|
+
Object.entries(optionalOperationRequirements).sort(([a], [b]) =>
|
|
2302
|
+
compareStrings(a, b),
|
|
2303
|
+
),
|
|
2304
|
+
),
|
|
2305
|
+
}
|
|
2306
|
+
: {}),
|
|
2288
2307
|
// The organization sweeps each workload component may hold; omitted when
|
|
2289
2308
|
// none declares any.
|
|
2290
2309
|
...(Object.keys(organizationSweepRequirements).length > 0
|
|
@@ -69,6 +69,18 @@ export function componentOperationRequirements(component, where) {
|
|
|
69
69
|
return declaredPrivilegeList(component, where, 'requiresOperations', OperationIdSchema, 'operation id');
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
+
/**
|
|
73
|
+
* The operations one workload component uses only when their owner is served
|
|
74
|
+
* (`optionalOperations`), graded exactly like `requiresOperations`. Declared
|
|
75
|
+
* INTENT only: the seal grants each one whose owner is served, leaves it
|
|
76
|
+
* ungranted when the owner is absent, and refuses one listed in both lists
|
|
77
|
+
* (`admitOperationGrants`).
|
|
78
|
+
*/
|
|
79
|
+
export function componentOptionalOperationRequirements(component, where) {
|
|
80
|
+
const { OperationIdSchema } = loadKernelPrivilegeGrammars();
|
|
81
|
+
return declaredPrivilegeList(component, where, 'optionalOperations', OperationIdSchema, 'operation id');
|
|
82
|
+
}
|
|
83
|
+
|
|
72
84
|
/**
|
|
73
85
|
* The organization sweeps one workload component declares it may hold
|
|
74
86
|
* (`requiresOrganizationSweeps`), each a member of the kernel's closed
|
|
@@ -84,7 +96,7 @@ export function componentOrganizationSweepRequirements(component, where) {
|
|
|
84
96
|
* The privilege declarations a component may carry only if it is a workload
|
|
85
97
|
* principal in the lock.
|
|
86
98
|
*/
|
|
87
|
-
export const PRINCIPAL_PRIVILEGE_FIELDS = Object.freeze(['requiresOperations', 'requiresOrganizationSweeps']);
|
|
99
|
+
export const PRINCIPAL_PRIVILEGE_FIELDS = Object.freeze(['requiresOperations', 'optionalOperations', 'requiresOrganizationSweeps']);
|
|
88
100
|
|
|
89
101
|
/**
|
|
90
102
|
* Thrown when a component that has no workload principal in the lock declares
|
|
@@ -2040,6 +2040,13 @@ export function resolveDistributionFromInputs(
|
|
|
2040
2040
|
Object.keys(e.operationRequirements).length > 0
|
|
2041
2041
|
? { operationRequirements: e.operationRequirements }
|
|
2042
2042
|
: {}),
|
|
2043
|
+
// The operations each workload component uses only when their owner is
|
|
2044
|
+
// served, forwarded verbatim; the seal grants them or leaves them
|
|
2045
|
+
// ungranted (`admitOperationGrants`), and refuses one also required.
|
|
2046
|
+
...(e.optionalOperationRequirements !== undefined &&
|
|
2047
|
+
Object.keys(e.optionalOperationRequirements).length > 0
|
|
2048
|
+
? { optionalOperationRequirements: e.optionalOperationRequirements }
|
|
2049
|
+
: {}),
|
|
2043
2050
|
// The organization sweeps each workload component may hold, forwarded
|
|
2044
2051
|
// verbatim; the seal admits them (`admitOrganizationSweeps`).
|
|
2045
2052
|
...(e.organizationSweepRequirements !== undefined &&
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xemahq/xema",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.38.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/xema-dev/xema-cli.git",
|
|
@@ -92,6 +92,6 @@
|
|
|
92
92
|
"typecheck": "tsc --noEmit"
|
|
93
93
|
},
|
|
94
94
|
"xemaRelease": {
|
|
95
|
-
"sourceDigest": "sha256:
|
|
95
|
+
"sourceDigest": "sha256:6ceee7eaad77b410aeb26998f61349944a56481549d146a3bc42a7a325ab3890"
|
|
96
96
|
}
|
|
97
97
|
}
|