githolon 0.107.1 → 0.107.3

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.
Binary file
Binary file
package/dist/full-cli.mjs CHANGED
@@ -1046,6 +1046,58 @@ var init_value_object = __esm({
1046
1046
  }
1047
1047
  });
1048
1048
 
1049
+ // ../dsl/src/evolution.ts
1050
+ function formerAggregate(id, fieldNames = []) {
1051
+ if (!id.trim()) throw new Error("formerAggregate(id) needs the prior aggregate's non-empty name");
1052
+ const fields = {};
1053
+ for (const name of fieldNames) {
1054
+ if (!name.trim()) throw new Error(`formerAggregate(${id}) has an empty prior field name`);
1055
+ if (fields[name] !== void 0) throw new Error(`formerAggregate(${id}) repeats prior field '${name}'`);
1056
+ fields[name] = Object.freeze({
1057
+ [FORMER_FIELD_BRAND]: true,
1058
+ aggregate: id,
1059
+ name
1060
+ });
1061
+ }
1062
+ return Object.freeze({
1063
+ [FORMER_AGGREGATE_BRAND]: true,
1064
+ id,
1065
+ fields: Object.freeze(fields)
1066
+ });
1067
+ }
1068
+ function retirement(entity) {
1069
+ if (entity === null || typeof entity !== "object") {
1070
+ throw new Error("retirement(entity) needs a handle from formerAggregate(...)");
1071
+ }
1072
+ if (entity[FORMER_AGGREGATE_BRAND] === true) {
1073
+ const aggregate2 = entity;
1074
+ return Object.freeze({
1075
+ [RETIREMENT_BRAND]: true,
1076
+ kind: "aggregate",
1077
+ aggregate: aggregate2.id
1078
+ });
1079
+ }
1080
+ if (entity[FORMER_FIELD_BRAND] === true) {
1081
+ const field = entity;
1082
+ return Object.freeze({
1083
+ [RETIREMENT_BRAND]: true,
1084
+ kind: "field",
1085
+ aggregate: field.aggregate,
1086
+ field: field.name
1087
+ });
1088
+ }
1089
+ throw new Error("retirement(entity) needs a handle from formerAggregate(...)");
1090
+ }
1091
+ var FORMER_AGGREGATE_BRAND, FORMER_FIELD_BRAND, RETIREMENT_BRAND;
1092
+ var init_evolution = __esm({
1093
+ "../dsl/src/evolution.ts"() {
1094
+ "use strict";
1095
+ FORMER_AGGREGATE_BRAND = "__nomos_former_aggregate_v1";
1096
+ FORMER_FIELD_BRAND = "__nomos_former_field_v1";
1097
+ RETIREMENT_BRAND = "__nomos_retirement_v1";
1098
+ }
1099
+ });
1100
+
1049
1101
  // ../dsl/src/principal_evidence.ts
1050
1102
  function endorsementOf(value) {
1051
1103
  return typeof value === "object" && value !== null && REGISTRY.has(value) ? REGISTRY.get(value) ?? null : null;
@@ -2253,7 +2305,7 @@ function releaseReceiptAggregateId(candidateHash, atStateRoot) {
2253
2305
  function releaseReceiptInstance(candidateHash, atStateRoot) {
2254
2306
  return instance(ReleaseReceipt, releaseReceiptAggregateId(candidateHash, atStateRoot));
2255
2307
  }
2256
- var MODEL_LIFECYCLE_AUTHORITY, DOMAIN_LIFECYCLE_DIRECTIVES, INSTALL_DOMAIN_DIRECTIVE, modelLifecycleRelations, DOMAIN_INSTALLATION_PHASES, DomainInstallation, RELEASE_RECEIPT_AGGREGATE, RELEASE_RECEIPT_PREFIX, ReleaseReceipt, dispositions, lowerHex64, gitOid, preflightReceipt, installPackagePayload, stagedPackagePayload, installDomain, stageDomain, promoteDomain, rollbackDomain;
2308
+ var MODEL_LIFECYCLE_AUTHORITY, DOMAIN_LIFECYCLE_DIRECTIVES, INSTALL_DOMAIN_DIRECTIVE, modelLifecycleRelations, DOMAIN_INSTALLATION_PHASES, DomainInstallation, RELEASE_RECEIPT_AGGREGATE, RELEASE_RECEIPT_PREFIX, ReleaseReceipt, counterfactualReleaseReceipt, baselineRootRetired, candidateIntentsRetired, candidateRootRetired, completeRetired, divergenceCountRetired, historyHashRetired, projectionEqualRetired, rawPromotableRetired, replayedIntentsRetired, reportHashRetired, reportJsonRetired, dispositions, lowerHex64, gitOid, preflightReceipt, installPackagePayload, stagedPackagePayload, installDomain, stageDomain, promoteDomain, rollbackDomain;
2257
2309
  var init_domain_lifecycle = __esm({
2258
2310
  "../dsl/src/framework/domain_lifecycle.ts"() {
2259
2311
  "use strict";
@@ -2261,6 +2313,7 @@ var init_domain_lifecycle = __esm({
2261
2313
  init_drivers();
2262
2314
  init_fields();
2263
2315
  init_directive();
2316
+ init_evolution();
2264
2317
  init_ops();
2265
2318
  init_relation_schema();
2266
2319
  MODEL_LIFECYCLE_AUTHORITY = relationRef("installDomain");
@@ -2309,6 +2362,30 @@ var init_domain_lifecycle = __esm({
2309
2362
  acceptedBy: attributionField(t.string().merge(Lww)),
2310
2363
  acceptedAt: t.int().merge(Lww)
2311
2364
  }).public();
2365
+ counterfactualReleaseReceipt = formerAggregate(RELEASE_RECEIPT_AGGREGATE, [
2366
+ "baselineRoot",
2367
+ "candidateIntents",
2368
+ "candidateRoot",
2369
+ "complete",
2370
+ "divergenceCount",
2371
+ "historyHash",
2372
+ "projectionEqual",
2373
+ "rawPromotable",
2374
+ "replayedIntents",
2375
+ "reportHash",
2376
+ "reportJson"
2377
+ ]);
2378
+ baselineRootRetired = retirement(counterfactualReleaseReceipt.fields.baselineRoot);
2379
+ candidateIntentsRetired = retirement(counterfactualReleaseReceipt.fields.candidateIntents);
2380
+ candidateRootRetired = retirement(counterfactualReleaseReceipt.fields.candidateRoot);
2381
+ completeRetired = retirement(counterfactualReleaseReceipt.fields.complete);
2382
+ divergenceCountRetired = retirement(counterfactualReleaseReceipt.fields.divergenceCount);
2383
+ historyHashRetired = retirement(counterfactualReleaseReceipt.fields.historyHash);
2384
+ projectionEqualRetired = retirement(counterfactualReleaseReceipt.fields.projectionEqual);
2385
+ rawPromotableRetired = retirement(counterfactualReleaseReceipt.fields.rawPromotable);
2386
+ replayedIntentsRetired = retirement(counterfactualReleaseReceipt.fields.replayedIntents);
2387
+ reportHashRetired = retirement(counterfactualReleaseReceipt.fields.reportHash);
2388
+ reportJsonRetired = retirement(counterfactualReleaseReceipt.fields.reportJson);
2312
2389
  dispositions = z4.object({
2313
2390
  retired: z4.array(z4.string()).optional(),
2314
2391
  retyped: z4.record(z4.string(), z4.string()).optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "githolon",
3
- "version": "0.107.1",
3
+ "version": "0.107.3",
4
4
  "type": "module",
5
5
  "description": "githolon — the Nomos developer CLI: Rails-style generators for @githolon/dsl domains + the package compiler. Kernel-independent.",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -30,7 +30,7 @@
30
30
  "dependencies": {
31
31
  "@bjorn3/browser_wasi_shim": "0.4.2",
32
32
  "@bufbuild/protobuf": "^2.13.0",
33
- "@githolon/dsl": "^0.107.1",
33
+ "@githolon/dsl": "^0.107.3",
34
34
  "fast-xml-parser": "5.10.1",
35
35
  "isomorphic-git": "^1.38.4",
36
36
  "tsx": "^4.19.2"