@ibgib/core-gib 0.1.60 → 0.1.62

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 (181) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/common/other/graph-helper.d.mts.map +1 -1
  3. package/dist/common/other/graph-helper.mjs +7 -6
  4. package/dist/common/other/graph-helper.mjs.map +1 -1
  5. package/dist/keystone/keystone-config-builder.d.mts +1 -2
  6. package/dist/keystone/keystone-config-builder.d.mts.map +1 -1
  7. package/dist/keystone/keystone-config-builder.mjs +4 -19
  8. package/dist/keystone/keystone-config-builder.mjs.map +1 -1
  9. package/dist/keystone/keystone-constants.d.mts +2 -1
  10. package/dist/keystone/keystone-constants.d.mts.map +1 -1
  11. package/dist/keystone/keystone-constants.mjs +2 -1
  12. package/dist/keystone/keystone-constants.mjs.map +1 -1
  13. package/dist/keystone/keystone-helpers.d.mts +28 -16
  14. package/dist/keystone/keystone-helpers.d.mts.map +1 -1
  15. package/dist/keystone/keystone-helpers.mjs +155 -76
  16. package/dist/keystone/keystone-helpers.mjs.map +1 -1
  17. package/dist/keystone/keystone-policy-types.d.mts +6 -4
  18. package/dist/keystone/keystone-policy-types.d.mts.map +1 -1
  19. package/dist/keystone/keystone-service-v1.d.mts +38 -2
  20. package/dist/keystone/keystone-service-v1.d.mts.map +1 -1
  21. package/dist/keystone/keystone-service-v1.mjs +177 -11
  22. package/dist/keystone/keystone-service-v1.mjs.map +1 -1
  23. package/dist/keystone/keystone-service-v1.respec.mjs +527 -41
  24. package/dist/keystone/keystone-service-v1.respec.mjs.map +1 -1
  25. package/dist/keystone/keystone-types.d.mts +53 -11
  26. package/dist/keystone/keystone-types.d.mts.map +1 -1
  27. package/dist/keystone/policy/keystone-profile-builder.d.mts +25 -0
  28. package/dist/keystone/policy/keystone-profile-builder.d.mts.map +1 -0
  29. package/dist/keystone/policy/keystone-profile-builder.mjs +117 -0
  30. package/dist/keystone/policy/keystone-profile-builder.mjs.map +1 -0
  31. package/dist/keystone/policy/profiles/profile-high.json +84 -0
  32. package/dist/keystone/policy/profiles/profile-low.json +84 -0
  33. package/dist/keystone/policy/profiles/profile-medium.json +84 -0
  34. package/dist/keystone/policy/profiles/profile-session.json +84 -0
  35. package/dist/keystone/policy/profiles/profile-test.json +84 -0
  36. package/dist/keystone/policy/schemas/connect-pool.high.schema.json +23 -0
  37. package/dist/keystone/policy/schemas/connect-pool.low.schema.json +23 -0
  38. package/dist/keystone/policy/schemas/connect-pool.medium.schema.json +23 -0
  39. package/dist/keystone/policy/schemas/keystone.high.schema.json +26 -0
  40. package/dist/keystone/policy/schemas/keystone.low.schema.json +26 -0
  41. package/dist/keystone/policy/schemas/keystone.medium.schema.json +26 -0
  42. package/dist/keystone/policy/schemas/manage-pool.high.schema.json +23 -0
  43. package/dist/keystone/policy/schemas/manage-pool.low.schema.json +23 -0
  44. package/dist/keystone/policy/schemas/manage-pool.medium.schema.json +23 -0
  45. package/dist/keystone/policy/schemas/revoke-pool.high.schema.json +23 -0
  46. package/dist/keystone/policy/schemas/revoke-pool.low.schema.json +23 -0
  47. package/dist/keystone/policy/schemas/revoke-pool.medium.schema.json +23 -0
  48. package/dist/keystone/policy/schemas/sign-pool.high.schema.json +23 -0
  49. package/dist/keystone/policy/schemas/sign-pool.low.schema.json +23 -0
  50. package/dist/keystone/policy/schemas/sign-pool.medium.schema.json +23 -0
  51. package/dist/keystone/policy/schemas/sync-pool.high.schema.json +23 -0
  52. package/dist/keystone/policy/schemas/sync-pool.low.schema.json +23 -0
  53. package/dist/keystone/policy/schemas/sync-pool.medium.schema.json +23 -0
  54. package/dist/sync/sync-conflict-adv-multitimelines.withid.respec.d.mts +8 -0
  55. package/dist/sync/sync-conflict-adv-multitimelines.withid.respec.d.mts.map +1 -0
  56. package/dist/sync/sync-conflict-adv-multitimelines.withid.respec.mjs +582 -0
  57. package/dist/sync/sync-conflict-adv-multitimelines.withid.respec.mjs.map +1 -0
  58. package/dist/sync/sync-conflict-basic-divergence.withid.respec.d.mts +7 -0
  59. package/dist/sync/sync-conflict-basic-divergence.withid.respec.d.mts.map +1 -0
  60. package/dist/sync/sync-conflict-basic-divergence.withid.respec.mjs +274 -0
  61. package/dist/sync/sync-conflict-basic-divergence.withid.respec.mjs.map +1 -0
  62. package/dist/sync/sync-conflict-basic-multitimelines.withid.respec.d.mts +8 -0
  63. package/dist/sync/sync-conflict-basic-multitimelines.withid.respec.d.mts.map +1 -0
  64. package/dist/sync/sync-conflict-basic-multitimelines.withid.respec.mjs +322 -0
  65. package/dist/sync/sync-conflict-basic-multitimelines.withid.respec.mjs.map +1 -0
  66. package/dist/sync/sync-conflict-text-merge.withid.respec.d.mts +7 -0
  67. package/dist/sync/sync-conflict-text-merge.withid.respec.d.mts.map +1 -0
  68. package/dist/sync/sync-conflict-text-merge.withid.respec.mjs +307 -0
  69. package/dist/sync/sync-conflict-text-merge.withid.respec.mjs.map +1 -0
  70. package/dist/sync/sync-innerspace-constants.withid.respec.d.mts +8 -0
  71. package/dist/sync/sync-innerspace-constants.withid.respec.d.mts.map +1 -0
  72. package/dist/sync/sync-innerspace-constants.withid.respec.mjs +233 -0
  73. package/dist/sync/sync-innerspace-constants.withid.respec.mjs.map +1 -0
  74. package/dist/sync/sync-innerspace-deep-updates.withid.respec.d.mts +7 -0
  75. package/dist/sync/sync-innerspace-deep-updates.withid.respec.d.mts.map +1 -0
  76. package/dist/sync/sync-innerspace-deep-updates.withid.respec.mjs +233 -0
  77. package/dist/sync/sync-innerspace-deep-updates.withid.respec.mjs.map +1 -0
  78. package/dist/sync/sync-innerspace-dest-ahead.withid.respec.d.mts +7 -0
  79. package/dist/sync/sync-innerspace-dest-ahead.withid.respec.d.mts.map +1 -0
  80. package/dist/sync/sync-innerspace-dest-ahead.withid.respec.mjs +225 -0
  81. package/dist/sync/sync-innerspace-dest-ahead.withid.respec.mjs.map +1 -0
  82. package/dist/sync/sync-innerspace-multiple-timelines.respec.mjs.map +1 -1
  83. package/dist/sync/sync-innerspace-multiple-timelines.withid.respec.d.mts +7 -0
  84. package/dist/sync/sync-innerspace-multiple-timelines.withid.respec.d.mts.map +1 -0
  85. package/dist/sync/sync-innerspace-multiple-timelines.withid.respec.mjs +235 -0
  86. package/dist/sync/sync-innerspace-multiple-timelines.withid.respec.mjs.map +1 -0
  87. package/dist/sync/sync-innerspace-partial-update.withid.respec.d.mts +7 -0
  88. package/dist/sync/sync-innerspace-partial-update.withid.respec.d.mts.map +1 -0
  89. package/dist/sync/sync-innerspace-partial-update.withid.respec.mjs +211 -0
  90. package/dist/sync/sync-innerspace-partial-update.withid.respec.mjs.map +1 -0
  91. package/dist/sync/sync-innerspace.withid.respec.d.mts +8 -0
  92. package/dist/sync/sync-innerspace.withid.respec.d.mts.map +1 -0
  93. package/dist/sync/sync-innerspace.withid.respec.mjs +260 -0
  94. package/dist/sync/sync-innerspace.withid.respec.mjs.map +1 -0
  95. package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-peer-websocket-receiver-v1.d.mts +1 -0
  96. package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-peer-websocket-receiver-v1.d.mts.map +1 -1
  97. package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-peer-websocket-receiver-v1.mjs +13 -4
  98. package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-peer-websocket-receiver-v1.mjs.map +1 -1
  99. package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-websocket-peer-helpers.d.mts +1 -1
  100. package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-websocket-peer-helpers.d.mts.map +1 -1
  101. package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-websocket-peer-helpers.mjs +5 -3
  102. package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-websocket-peer-helpers.mjs.map +1 -1
  103. package/dist/sync/sync-saga-coordinator.d.mts.map +1 -1
  104. package/dist/sync/sync-saga-coordinator.mjs +165 -145
  105. package/dist/sync/sync-saga-coordinator.mjs.map +1 -1
  106. package/dist/sync/sync-withid.pingpong.respec.mjs +8 -8
  107. package/dist/sync/sync-withid.pingpong.respec.mjs.map +1 -1
  108. package/dist/timeline/timeline-api.d.mts.map +1 -1
  109. package/dist/timeline/timeline-api.mjs +1 -14
  110. package/dist/timeline/timeline-api.mjs.map +1 -1
  111. package/dist/witness/space/reconciliation-space/reconciliation-space-base.d.mts.map +1 -1
  112. package/dist/witness/space/reconciliation-space/reconciliation-space-base.mjs +0 -40
  113. package/dist/witness/space/reconciliation-space/reconciliation-space-base.mjs.map +1 -1
  114. package/dist/witness/space/reconciliation-space/reconciliation-space-helper.d.mts.map +1 -1
  115. package/dist/witness/space/reconciliation-space/reconciliation-space-helper.mjs +6 -6
  116. package/dist/witness/space/reconciliation-space/reconciliation-space-helper.mjs.map +1 -1
  117. package/ibgib-foundations.md +2 -1
  118. package/package.json +1 -1
  119. package/src/common/other/graph-helper.mts +7 -6
  120. package/src/keystone/README.md +34 -17
  121. package/src/keystone/docs/CRYPTANALYSIS.md +185 -0
  122. package/src/keystone/docs/architecture.md +45 -3
  123. package/src/keystone/docs/delegation.md +57 -0
  124. package/src/keystone/docs/profiles.md +124 -0
  125. package/src/keystone/keystone-config-builder.mts +3 -21
  126. package/src/keystone/keystone-constants.mts +2 -1
  127. package/src/keystone/keystone-helpers.mts +204 -81
  128. package/src/keystone/keystone-policy-types.mts +6 -4
  129. package/src/keystone/keystone-service-v1.mts +223 -11
  130. package/src/keystone/keystone-service-v1.respec.mts +596 -39
  131. package/src/keystone/keystone-types.mts +55 -9
  132. package/src/keystone/policy/IMPLEMENTATION.md +60 -0
  133. package/src/keystone/policy/README.md +94 -0
  134. package/src/keystone/policy/keystone-profile-builder.mts +131 -0
  135. package/src/keystone/policy/profiles/profile-high.json +84 -0
  136. package/src/keystone/policy/profiles/profile-low.json +84 -0
  137. package/src/keystone/policy/profiles/profile-medium.json +84 -0
  138. package/src/keystone/policy/profiles/profile-session.json +84 -0
  139. package/src/keystone/policy/profiles/profile-test.json +84 -0
  140. package/src/keystone/policy/schemas/connect-pool.high.schema.json +23 -0
  141. package/src/keystone/policy/schemas/connect-pool.low.schema.json +23 -0
  142. package/src/keystone/policy/schemas/connect-pool.medium.schema.json +23 -0
  143. package/src/keystone/policy/schemas/keystone.high.schema.json +26 -0
  144. package/src/keystone/policy/schemas/keystone.low.schema.json +26 -0
  145. package/src/keystone/policy/schemas/keystone.medium.schema.json +26 -0
  146. package/src/keystone/policy/schemas/manage-pool.high.schema.json +23 -0
  147. package/src/keystone/policy/schemas/manage-pool.low.schema.json +23 -0
  148. package/src/keystone/policy/schemas/manage-pool.medium.schema.json +23 -0
  149. package/src/keystone/policy/schemas/revoke-pool.high.schema.json +23 -0
  150. package/src/keystone/policy/schemas/revoke-pool.low.schema.json +23 -0
  151. package/src/keystone/policy/schemas/revoke-pool.medium.schema.json +23 -0
  152. package/src/keystone/policy/schemas/sign-pool.high.schema.json +23 -0
  153. package/src/keystone/policy/schemas/sign-pool.low.schema.json +23 -0
  154. package/src/keystone/policy/schemas/sign-pool.medium.schema.json +23 -0
  155. package/src/keystone/policy/schemas/sync-pool.high.schema.json +23 -0
  156. package/src/keystone/policy/schemas/sync-pool.low.schema.json +23 -0
  157. package/src/keystone/policy/schemas/sync-pool.medium.schema.json +23 -0
  158. package/src/sync/docs/security.md +54 -21
  159. package/src/sync/sync-conflict-adv-multitimelines.withid.respec.mts +706 -0
  160. package/src/sync/sync-conflict-basic-divergence.withid.respec.mts +321 -0
  161. package/src/sync/sync-conflict-basic-multitimelines.withid.respec.mts +374 -0
  162. package/src/sync/sync-conflict-text-merge.withid.respec.mts +347 -0
  163. package/src/sync/sync-innerspace-constants.withid.respec.mts +264 -0
  164. package/src/sync/sync-innerspace-deep-updates.withid.respec.mts +272 -0
  165. package/src/sync/sync-innerspace-dest-ahead.withid.respec.mts +266 -0
  166. package/src/sync/sync-innerspace-multiple-timelines.respec.mts +0 -1
  167. package/src/sync/sync-innerspace-multiple-timelines.withid.respec.mts +273 -0
  168. package/src/sync/sync-innerspace-partial-update.withid.respec.mts +249 -0
  169. package/src/sync/sync-innerspace.withid.respec.mts +265 -0
  170. package/src/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-peer-websocket-receiver-v1.mts +12 -4
  171. package/src/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-websocket-peer-helpers.mts +5 -3
  172. package/src/sync/sync-saga-coordinator.mts +159 -143
  173. package/src/sync/sync-withid.pingpong.respec.mts +8 -8
  174. package/src/timeline/timeline-api.mts +1 -15
  175. package/src/timeline/timeline-api.respec.mts +3 -3
  176. package/src/witness/space/reconciliation-space/reconciliation-space-base.mts +0 -46
  177. package/src/witness/space/reconciliation-space/reconciliation-space-helper.mts +6 -5
  178. package/tsconfig.json +6 -1
  179. package/src/keystone/keystone-policy.schema.json +0 -51
  180. package/src/witness/space/reconciliation-space/reconciliation-space-base.mts.OLD.md +0 -884
  181. package/src/witness/space/reconciliation-space/reconciliation-space-helper.mts.OLD.md +0 -125
@@ -466,154 +466,158 @@ export class SyncSagaCoordinator {
466
466
  }));
467
467
  // #endregion set up peer observable for any domainPayloadsMap
468
468
 
469
- // ...create/compose the Request Context itself...
470
- const requestCtx = await this.createSyncSagaContext({
471
- sagaFrame: currentFrame,
472
- /**
473
- * init frame: empty
474
- * ack frame: possible push offers
475
- * delta frame: requested ibgibs or commit offer
476
- * commit frame: empty
477
- */
478
- payloadIbGibsDomain: nextDomainIbGibs,
479
- localSpace,
480
- metaspace,
481
- sessionIdentityAddr: peer.currentSessionIdentityAddr,
482
- peer,
483
- });
469
+ try {
470
+ // ...create/compose the Request Context itself...
471
+ const requestCtx = await this.createSyncSagaContext({
472
+ sagaFrame: currentFrame,
473
+ /**
474
+ * init frame: empty
475
+ * ack frame: possible push offers
476
+ * delta frame: requested ibgibs or commit offer
477
+ * commit frame: empty
478
+ */
479
+ payloadIbGibsDomain: nextDomainIbGibs,
480
+ localSpace,
481
+ metaspace,
482
+ sessionIdentityAddr: peer.currentSessionIdentityAddr,
483
+ peer,
484
+ });
484
485
 
485
- // #region Log what we're sending
486
- if (logalotControlDomain) {
487
- const domainAddrs = nextDomainIbGibs.map(p => getIbGibAddr({ ibGib: p }));
488
- console.log(`${lc}${lcControlDomain} SENDER TRANSMIT -> peer.witness (I: 5b0081803698770f0bf64992220b312)`);
489
- console.log(`${lc}${lcControlDomain} Context: ${getIbGibAddr({ ibGib: requestCtx })}`);
490
- console.log(`${lc}${lcControlDomain} Frame: ${getIbGibAddr({ ibGib: currentFrame })}`);
491
- console.log(`${lc}${lcControlDomain} DOMAIN Payloads (${domainAddrs.length}): ${domainAddrs.join(', ') || '(none)'}`);
492
- }
493
- // #endregion Log what we're sending
494
-
495
- // update our saga listeners...
496
- // if (logalot) { console.log(`${lc} transmitting... requestCtx: ${pretty(requestCtx)} (I: 8cf20817c66899abdb1e76df50356826)`); }
497
- updates$.next(requestCtx); // spins off for saga UI updates
498
-
499
- // ...And send the context.
500
- peer.setOptionalOpts({ localSpace, localTempSpace: tempSpace, });
501
- const responseCtx = await peer.witness(requestCtx);
502
-
503
- // the send returned, but a peer can return a falsy responseCtx, if
504
- // we just sent a commit to them and they're done. If so, there will
505
- // necessarily be no payload to wait to receive
506
- if (!responseCtx) {
507
- if (currentFrame) {
508
- // Check for Commit (Peer silence expected)
509
- const msg = await getSyncSagaMessageFromFrame({ frameIbGib: currentFrame, space: localSpace });
510
- if (msg?.data?.stage === SyncStage.commit) {
511
- if (logalot) { console.log(`${lc} Sender sent Commit. Peer returned no response. Saga Complete. (I: 26f9ee073858ca78b8284753368b5226)`); }
512
- currentFrame = null;
513
- break;
486
+ // #region Log what we're sending
487
+ if (logalotControlDomain) {
488
+ const domainAddrs = nextDomainIbGibs.map(p => getIbGibAddr({ ibGib: p }));
489
+ console.log(`${lc}${lcControlDomain} SENDER TRANSMIT -> peer.witness (I: 5b0081803698770f0bf64992220b312)`);
490
+ console.log(`${lc}${lcControlDomain} Context: ${getIbGibAddr({ ibGib: requestCtx })}`);
491
+ console.log(`${lc}${lcControlDomain} Frame: ${getIbGibAddr({ ibGib: currentFrame })}`);
492
+ console.log(`${lc}${lcControlDomain} DOMAIN Payloads (${domainAddrs.length}): ${domainAddrs.join(', ') || '(none)'}`);
493
+ }
494
+ // #endregion Log what we're sending
495
+
496
+ // update our saga listeners...
497
+ // if (logalot) { console.log(`${lc} transmitting... requestCtx: ${pretty(requestCtx)} (I: 8cf20817c66899abdb1e76df50356826)`); }
498
+ updates$.next(requestCtx); // spins off for saga UI updates
499
+
500
+ // ...And send the context.
501
+ peer.setOptionalOpts({ localSpace, localTempSpace: tempSpace, });
502
+ const responseCtx = await peer.witness(requestCtx);
503
+
504
+ // the send returned, but a peer can return a falsy responseCtx, if
505
+ // we just sent a commit to them and they're done. If so, there will
506
+ // necessarily be no payload to wait to receive
507
+ if (!responseCtx) {
508
+ if (currentFrame) {
509
+ // Check for Commit (Peer silence expected)
510
+ const msg = await getSyncSagaMessageFromFrame({ frameIbGib: currentFrame, space: localSpace });
511
+ if (msg?.data?.stage === SyncStage.commit) {
512
+ if (logalot) { console.log(`${lc} Sender sent Commit. Peer returned no response. Saga Complete. (I: 26f9ee073858ca78b8284753368b5226)`); }
513
+ currentFrame = null;
514
+ break;
515
+ } else {
516
+ throw new Error(`(UNEXPECTED) responseCtx falsy and currentFrame truthy, but we're not in the commit stage? This may be expected ultimately, but atow I am not seeing this as being expected. (E: cc34498962bd370deeff351fac939f26)`);
517
+ }
514
518
  } else {
515
- throw new Error(`(UNEXPECTED) responseCtx falsy and currentFrame truthy, but we're not in the commit stage? This may be expected ultimately, but atow I am not seeing this as being expected. (E: cc34498962bd370deeff351fac939f26)`);
519
+ throw new Error(`(UNEXPECTED) no response and currentFrame falsy? (E: 8d1085ea2f28cfc3f9c922649864a826)`);
516
520
  }
517
- } else {
518
- throw new Error(`(UNEXPECTED) no response and currentFrame falsy? (E: 8d1085ea2f28cfc3f9c922649864a826)`);
519
521
  }
520
- }
521
522
 
522
- // at this point, we did indeed receive a response to analyze. BUT!
523
- // we have only necessarily received the response context ibgib.
524
- // if there were payloads expected to be transferred, they may not
525
- // be done yet.
523
+ // at this point, we did indeed receive a response to analyze. BUT!
524
+ // we have only necessarily received the response context ibgib.
525
+ // if there were payloads expected to be transferred, they may not
526
+ // be done yet.
526
527
 
527
- if (!responseCtx.data) { throw new Error(`(UNEXPECTED) responseCtx.data falsy? (E: a969992bae53ab18a827ec58aec15826)`); }
528
- updates$.next(responseCtx); // spins off for saga UI updating
528
+ if (!responseCtx.data) { throw new Error(`(UNEXPECTED) responseCtx.data falsy? (E: a969992bae53ab18a827ec58aec15826)`); }
529
+ updates$.next(responseCtx); // spins off for saga UI updating
529
530
 
530
- // immediately validate context/saga frame (but not payloads because
531
- // we may not have those yet)
532
- const contextAndSagaFrameValidationErrors =
533
- await validateContextAndSagaFrame({ context: responseCtx });
534
- if (contextAndSagaFrameValidationErrors.length > 0) { throw new Error(`contextAndSagaFrameValidationErrors: ${contextAndSagaFrameValidationErrors} (E: 6eebe8e7fa437c00a8cde3ada3c66826)`); }
535
-
536
- // Turn-by-turn continuation & identity checks
537
- const returnContextErrors = await this.validateReturnContext({
538
- requestCtx,
539
- responseCtx,
540
- localSpace,
541
- });
542
- if (returnContextErrors.length > 0) {
543
- throw new Error(`validateReturnContext errors: ${returnContextErrors.join(', ')} (E: cb8a023b9d0728cceb09fa3da0bb8226)`);
544
- }
531
+ // immediately validate context/saga frame (but not payloads because
532
+ // we may not have those yet)
533
+ const contextAndSagaFrameValidationErrors =
534
+ await validateContextAndSagaFrame({ context: responseCtx });
535
+ if (contextAndSagaFrameValidationErrors.length > 0) { throw new Error(`contextAndSagaFrameValidationErrors: ${contextAndSagaFrameValidationErrors} (E: 6eebe8e7fa437c00a8cde3ada3c66826)`); }
545
536
 
546
- // Extract expected domain addresses from response context
547
- const responsePayloadAddrsDomain = responseCtx.data[SYNC_SAGA_PAYLOAD_ADDRS_DOMAIN] as string[] || [];
548
-
549
- // Poll for them if needed. see above jsdocs for domainPayloadsMap
550
- if (responsePayloadAddrsDomain.length > 0) {
551
- responseCtx.payloadIbGibsDomain = await this.pollForDomainPayloads({
552
- expectedAddrs: responsePayloadAddrsDomain,
553
- pollIntervalMs: 20, // relatively arbitrary right now
554
- domainPayloadsMap,
555
- tempSpace,
537
+ // Turn-by-turn continuation & identity checks
538
+ const returnContextErrors = await this.validateReturnContext({
539
+ requestCtx,
540
+ responseCtx,
541
+ localSpace,
556
542
  });
557
- }
558
-
559
- // #region Log what we received back
560
- if (!responseCtx.sagaFrame) { throw new Error(`(UNEXPECTED) responseCtx.sagaFrame falsy? the Peer should have set this when it got the response back from the remote. (E: e650adadf9a2063ec6764a1e31d3d826)`); }
561
- if (logalotControlDomain) {
562
- const responseControlAddrs = responseCtx.data?.['@payloadAddrsControl'] as string[] || [];
563
- console.log(`${lc}${lcControlDomain} SENDER RECEIVED <- peer.witness (I: 3dc76a9744d89a4fc3e2f076c2be4826)`);
564
- console.log(`${lc}${lcControlDomain} Response Context: ${getIbGibAddr({ ibGib: responseCtx })}`);
565
- console.log(`${lc}${lcControlDomain} Response Saga Frame: ${getIbGibAddr({ ibGib: responseCtx.sagaFrame })}`);
566
- console.log(`${lc}${lcControlDomain} CONTROL Payloads (${responseControlAddrs.length}): ${responseControlAddrs.join(', ') || '(none)'}`);
567
- console.log(`${lc}${lcControlDomain} DOMAIN Payloads (${responsePayloadAddrsDomain.length}): ${responsePayloadAddrsDomain.join(', ') || '(none)'}`);
568
- }
569
- // #endregion Log what we received back
543
+ if (returnContextErrors.length > 0) {
544
+ throw new Error(`validateReturnContext errors: ${returnContextErrors.join(', ')} (E: cb8a023b9d0728cceb09fa3da0bb8226)`);
545
+ }
570
546
 
571
- // at this point, we have received the context AND **all** of the
572
- // domain payloads (if applicable), so we are ready to do the next
573
- // iteration in the saga loop
547
+ // Extract expected domain addresses from response context
548
+ const responsePayloadAddrsDomain = responseCtx.data[SYNC_SAGA_PAYLOAD_ADDRS_DOMAIN] as string[] || [];
574
549
 
575
- // this is the part that drives the FSM forward, i.e., when we
576
- // evolve the sync saga ibgib itself to the next frame if we aren't
577
- // finished/errored out.
578
- const contextResult = await this.handleResponseSagaContext({
579
- sagaContext: responseCtx,
580
- initDomainGraph,
581
- mySpace: localSpace,
582
- myTempSpace: tempSpace,
583
- metaspace,
584
- });
550
+ // Poll for them if needed. see above jsdocs for domainPayloadsMap
551
+ if (responsePayloadAddrsDomain.length > 0) {
552
+ responseCtx.payloadIbGibsDomain = await this.pollForDomainPayloads({
553
+ expectedAddrs: responsePayloadAddrsDomain,
554
+ pollIntervalMs: 20, // relatively arbitrary right now
555
+ domainPayloadsMap,
556
+ tempSpace,
557
+ });
558
+ }
585
559
 
586
- if (!contextResult) {
587
- // should this ever hit?
588
- console.error(`${lc} NAG ERROR (DOES NOT THROW): does this ever hit now? (E: e04d02efc2a8e72a88b79f1f0f95ca26)`);
589
- break;
590
- } else if (contextResult.nextFrameInfo?.sagaComplete) {
591
- if (logalot) { console.log(`${lc} Handler returned null (Saga End). (I: 123bf9e7dca8886de72553a8d4f29e26)`); }
592
- break;
593
- }
560
+ // #region Log what we received back
561
+ if (!responseCtx.sagaFrame) { throw new Error(`(UNEXPECTED) responseCtx.sagaFrame falsy? the Peer should have set this when it got the response back from the remote. (E: e650adadf9a2063ec6764a1e31d3d826)`); }
562
+ if (logalotControlDomain) {
563
+ const responseControlAddrs = responseCtx.data?.['@payloadAddrsControl'] as string[] || [];
564
+ console.log(`${lc}${lcControlDomain} SENDER RECEIVED <- peer.witness (I: 3dc76a9744d89a4fc3e2f076c2be4826)`);
565
+ console.log(`${lc}${lcControlDomain} Response Context: ${getIbGibAddr({ ibGib: responseCtx })}`);
566
+ console.log(`${lc}${lcControlDomain} Response Saga Frame: ${getIbGibAddr({ ibGib: responseCtx.sagaFrame })}`);
567
+ console.log(`${lc}${lcControlDomain} CONTROL Payloads (${responseControlAddrs.length}): ${responseControlAddrs.join(', ') || '(none)'}`);
568
+ console.log(`${lc}${lcControlDomain} DOMAIN Payloads (${responsePayloadAddrsDomain.length}): ${responsePayloadAddrsDomain.join(', ') || '(none)'}`);
569
+ }
570
+ // #endregion Log what we received back
571
+
572
+ // at this point, we have received the context AND **all** of the
573
+ // domain payloads (if applicable), so we are ready to do the next
574
+ // iteration in the saga loop
575
+
576
+ // this is the part that drives the FSM forward, i.e., when we
577
+ // evolve the sync saga ibgib itself to the next frame if we aren't
578
+ // finished/errored out.
579
+ const contextResult = await this.handleResponseSagaContext({
580
+ sagaContext: responseCtx,
581
+ initDomainGraph,
582
+ mySpace: localSpace,
583
+ myTempSpace: tempSpace,
584
+ metaspace,
585
+ });
594
586
 
595
- // #region error conditions throw
596
- if (contextResult.errorMsg) {
597
- throw new Error(`Couldn't handle response saga context. errorMsg: ${contextResult.errorMsg} (E: c948e81d513b2a0eb8b8afa878edc626)`);
598
- } else if (!contextResult.nextFrameInfo) {
599
- throw new Error(`(UNEXPECTED) contextResult.nextFrameInfo falsy? (E: c287a82e823e662a77923278e2418826)`);
600
- }
601
- // #endregion error conditions throw
587
+ if (!contextResult) {
588
+ // should this ever hit?
589
+ console.error(`${lc} NAG ERROR (DOES NOT THROW): does this ever hit now? (E: e04d02efc2a8e72a88b79f1f0f95ca26)`);
590
+ break;
591
+ } else if (contextResult.nextFrameInfo?.sagaComplete) {
592
+ if (logalot) { console.log(`${lc} Handler returned null (Saga End). (I: 123bf9e7dca8886de72553a8d4f29e26)`); }
593
+ break;
594
+ }
602
595
 
603
- // we have another frame to process and send out, with possibly
604
- // payload domain ibgibs as well
605
- const { frame, payloadIbGibsDomain, } = contextResult.nextFrameInfo;
606
- currentFrame = frame;
607
- nextDomainIbGibs = [...(payloadIbGibsDomain || [])];
608
-
609
- // #region Log handler output for next iteration
610
- if (logalotControlDomain) {
611
- const handlerDomainAddrs = nextDomainIbGibs.map(p => getIbGibAddr({ ibGib: p }));
612
- console.log(`${lc}${lcControlDomain} HANDLER RESULT -> next iteration (I: 6b0d88c4c28857ccd812381515bd7826)`);
613
- console.log(`${lc}${lcControlDomain} Next Frame: ${getIbGibAddr({ ibGib: currentFrame })}`);
614
- console.log(`${lc}${lcControlDomain} DOMAIN for next (${handlerDomainAddrs.length}): ${handlerDomainAddrs.join(', ') || '(none)'}`);
596
+ // #region error conditions throw
597
+ if (contextResult.errorMsg) {
598
+ throw new Error(`Couldn't handle response saga context. errorMsg: ${contextResult.errorMsg} (E: c948e81d513b2a0eb8b8afa878edc626)`);
599
+ } else if (!contextResult.nextFrameInfo) {
600
+ throw new Error(`(UNEXPECTED) contextResult.nextFrameInfo falsy? (E: c287a82e823e662a77923278e2418826)`);
601
+ }
602
+ // #endregion error conditions throw
603
+
604
+ // we have another frame to process and send out, with possibly
605
+ // payload domain ibgibs as well
606
+ const { frame, payloadIbGibsDomain, } = contextResult.nextFrameInfo;
607
+ currentFrame = frame;
608
+ nextDomainIbGibs = [...(payloadIbGibsDomain || [])];
609
+
610
+ // #region Log handler output for next iteration
611
+ if (logalotControlDomain) {
612
+ const handlerDomainAddrs = nextDomainIbGibs.map(p => getIbGibAddr({ ibGib: p }));
613
+ console.log(`${lc}${lcControlDomain} HANDLER RESULT -> next iteration (I: 6b0d88c4c28857ccd812381515bd7826)`);
614
+ console.log(`${lc}${lcControlDomain} Next Frame: ${getIbGibAddr({ ibGib: currentFrame })}`);
615
+ console.log(`${lc}${lcControlDomain} DOMAIN for next (${handlerDomainAddrs.length}): ${handlerDomainAddrs.join(', ') || '(none)'}`);
616
+ }
617
+ // #endregion Log handler output for next iteration
618
+ } finally {
619
+ await subscription.unsubscribe();
615
620
  }
616
- // #endregion Log handler output for next iteration
617
621
  }
618
622
  }
619
623
 
@@ -1033,7 +1037,8 @@ export class SyncSagaCoordinator {
1033
1037
 
1034
1038
  let resultDomainPayloads: IbGib_V1[] = [];
1035
1039
 
1036
- let pending = [...expectedAddrs];
1040
+ const uniqueExpectedAddrs = [...new Set(expectedAddrs)];
1041
+ let pending = [...uniqueExpectedAddrs];
1037
1042
  const start = Date.now();
1038
1043
  /**
1039
1044
  * This needs
@@ -1067,8 +1072,8 @@ export class SyncSagaCoordinator {
1067
1072
  if (pending.length > 0) { await delay(pollIntervalMs); }
1068
1073
  }
1069
1074
 
1070
- if (expectedAddrs.length !== resultDomainPayloads.length) {
1071
- throw new Error(`(UNEXPECTED) expectedAddrs.length !== resultDomainPayloads.length? at this point, we expect all of the payload ibgibs to have been received. (E: 03749a7478c4b8b28bfc86951887a826)`);
1075
+ if (uniqueExpectedAddrs.length !== resultDomainPayloads.length) {
1076
+ throw new Error(`(UNEXPECTED) uniqueExpectedAddrs.length !== resultDomainPayloads.length? at this point, we expect all of the payload ibgibs to have been received. (E: 03749a7478c4b8b28bfc86951887a826)`);
1072
1077
  }
1073
1078
 
1074
1079
  return resultDomainPayloads;
@@ -1662,12 +1667,10 @@ export class SyncSagaCoordinator {
1662
1667
  */
1663
1668
  const outgoingPayloadIbGibsDomain_conflicts: IbGib_V1[] = [];
1664
1669
 
1670
+ const activeConflicts: SyncSagaConflictInfo[] = [];
1665
1671
  if (conflicts.length > 0) {
1666
1672
  if (logalot) { console.log(`${lc} [CONFLICT DEBUG] Processing ${conflicts.length} non-terminal conflicts`); }
1667
1673
 
1668
- // we will need to resolve conflicts, so no commit yet
1669
- proposeCommit = false;
1670
-
1671
1674
  for (const conflict of conflicts) {
1672
1675
  const {
1673
1676
  receiverTipAddr,
@@ -1739,11 +1742,24 @@ export class SyncSagaCoordinator {
1739
1742
  const deltaPayloadIbGib = deltaGraph[deltaPayloadAddr];
1740
1743
  outgoingPayloadIbGibsDomain_conflicts.push(deltaPayloadIbGib);
1741
1744
  });
1742
- if (conflict.accretivePayloadAddrs) { throw new Error(`(UNEXPECTED) conflict.accretivePayloadAddrs already truthy? This is expected to be falsy at this point in the sync. (E: 6b6b1846779867849cbde208f4374326)`); }
1743
- conflict.accretivePayloadAddrs = accretivePayloadAddrs;
1745
+
1746
+ const isFastForward = latestCommonFrameAddr === receiverTipAddr;
1747
+ if (isFastForward) {
1748
+ if (logalot) { console.log(`${lc} [CONFLICT DEBUG] TJP ${tjpAddr}: Fast-forward detected (receiver behind sender). Excluding from active conflicts and sending delta payload.`); }
1749
+ } else {
1750
+ if (conflict.accretivePayloadAddrs) { throw new Error(`(UNEXPECTED) conflict.accretivePayloadAddrs already truthy? This is expected to be falsy at this point in the sync. (E: 6b6b1846779867849cbde208f4374326)`); }
1751
+ conflict.accretivePayloadAddrs = accretivePayloadAddrs;
1752
+ activeConflicts.push(conflict);
1753
+ }
1754
+ }
1755
+
1756
+ if (activeConflicts.length > 0) {
1757
+ proposeCommit = false;
1758
+ } else {
1759
+ proposeCommit = true;
1744
1760
  }
1745
1761
 
1746
- if (logalot) { console.log(`${lc} [CONFLICT DEBUG] Finished processing ${conflicts.length} conflicts. outgoingPayloadIbGibsDomain_conflicts.length (total outgoing payload ibgibs for ALL conflicts): ${outgoingPayloadIbGibsDomain_conflicts.length}`); }
1762
+ if (logalot) { console.log(`${lc} [CONFLICT DEBUG] Finished processing ${conflicts.length} conflicts. Active (divergent) conflicts: ${activeConflicts.length}. outgoingPayloadIbGibsDomain_conflicts.length (total outgoing payload ibgibs for ALL conflicts): ${outgoingPayloadIbGibsDomain_conflicts.length}`); }
1747
1763
  } else {
1748
1764
  if (logalot) { console.log(`${lc} [CONFLICT DEBUG] No optimistic conflicts to process`); }
1749
1765
  }
@@ -1783,7 +1799,7 @@ export class SyncSagaCoordinator {
1783
1799
  /**
1784
1800
  * these are the modified conflicts with additional information.
1785
1801
  */
1786
- conflicts,
1802
+ conflicts: activeConflicts,
1787
1803
  /**
1788
1804
  * we're sending these domain ibgibs as payload (they were
1789
1805
  * requested by receiver and/or they are being sent as delta
@@ -9,7 +9,7 @@
9
9
  */
10
10
 
11
11
  import {
12
- respecfully, ifWeMight, iReckon,
12
+ respecfully, ifWeMight, iReckon, ifWe,
13
13
  } from '@ibgib/helper-gib/dist/respec-gib/respec-gib.mjs';
14
14
  const maam = `[${import.meta.url}]`, sir = maam;
15
15
  import { clone, delay, extractErrorMsg } from '@ibgib/helper-gib/dist/helpers/utils-helper.mjs';
@@ -154,12 +154,12 @@ await respecfully(sir, `Test Phase 3A: Ping Pong Sync with Identity`, async () =
154
154
  syncError = error;
155
155
  }
156
156
 
157
- await ifWeMight(sir, 'completes the entire sync saga successfully', async () => {
157
+ await ifWe(sir, 'completes the entire sync saga successfully', async () => {
158
158
  const errorMsg = syncError ? extractErrorMsg(syncError) : '';
159
159
  iReckon(sir, syncError).asTo(`syncError: ${errorMsg}`).isGonnaBeFalsy();
160
160
  });
161
161
 
162
- await ifWeMight(sir, 'alpha dep graph matches on source and dest', async () => {
162
+ await ifWe(sir, 'alpha dep graph matches on source and dest', async () => {
163
163
  const resGetDest = await getFromSpace({ space: destSpace, addr: xStoneAddr });
164
164
  iReckon(sir, resGetDest.success && resGetDest.ibGibs?.length === 1).asTo('xStone exists in destSpace').isGonnaBeTrue();
165
165
  if (resGetDest.success && resGetDest.ibGibs?.[0]) {
@@ -171,7 +171,7 @@ await respecfully(sir, `Test Phase 3A: Ping Pong Sync with Identity`, async () =
171
171
  }
172
172
  });
173
173
 
174
- await ifWeMight(sir, 'sessionIdentity evolved the expected number of times', async () => {
174
+ await ifWe(sir, 'sessionIdentity evolved the expected number of times', async () => {
175
175
  const latestS = peer.currentSessionIdentity;
176
176
  iReckon(sir, latestS).asTo('latest session identity exists on peer').isGonnaBeTruthy();
177
177
  if (latestS) {
@@ -179,7 +179,7 @@ await respecfully(sir, `Test Phase 3A: Ping Pong Sync with Identity`, async () =
179
179
  }
180
180
  });
181
181
 
182
- await ifWeMight(sir, 'sender durable space has I (evolved frame)', async () => {
182
+ await ifWe(sir, 'sender durable space has I (evolved frame)', async () => {
183
183
  const latestSenderIdentityAddr = await metaspace.getLatestAddr({
184
184
  addr: getIbGibAddr({ ibGib: senderIdentity }),
185
185
  space: sourceSpace,
@@ -195,7 +195,7 @@ await respecfully(sir, `Test Phase 3A: Ping Pong Sync with Identity`, async () =
195
195
  }
196
196
  });
197
197
 
198
- await ifWeMight(sir, 'receiver durable space has I (evolved frame)', async () => {
198
+ await ifWe(sir, 'receiver durable space has I (evolved frame)', async () => {
199
199
  const latestSenderIdentityAddr = await metaspace.getLatestAddr({
200
200
  addr: getIbGibAddr({ ibGib: senderIdentity }),
201
201
  space: sourceSpace,
@@ -211,7 +211,7 @@ await respecfully(sir, `Test Phase 3A: Ping Pong Sync with Identity`, async () =
211
211
  }
212
212
  });
213
213
 
214
- await ifWeMight(sir, 'sender durable space has full S dep graph', async () => {
214
+ await ifWe(sir, 'sender durable space has full S dep graph', async () => {
215
215
  const latestS = peer.currentSessionIdentity;
216
216
  iReckon(sir, latestS).asTo('latestS exists').isGonnaBeTruthy();
217
217
  if (latestS) {
@@ -221,7 +221,7 @@ await respecfully(sir, `Test Phase 3A: Ping Pong Sync with Identity`, async () =
221
221
  }
222
222
  });
223
223
 
224
- await ifWeMight(sir, 'receiver durable space has full S dep graph', async () => {
224
+ await ifWe(sir, 'receiver durable space has full S dep graph', async () => {
225
225
  const latestS = peer.currentSessionIdentity;
226
226
  iReckon(sir, latestS).asTo('latestS exists').isGonnaBeTruthy();
227
227
  if (latestS) {
@@ -293,11 +293,7 @@ export async function appendToTimeline({
293
293
  });
294
294
  }
295
295
 
296
- // should we publish within the lock or not within the lock?
297
- // should we await the publish or spin it off
298
- // right now I have this spin off, inside the lock
299
- // await metaspace.registerNewIbGib({ ibGib: newTimelineIbGib, space });
300
- metaspace.registerNewIbGib({ ibGib: newTimelineIbGib, space }); // spin off
296
+ await metaspace.registerNewIbGib({ ibGib: newTimelineIbGib, space }); // already spins off
301
297
 
302
298
  return newTimelineIbGib;
303
299
  };
@@ -314,12 +310,6 @@ export async function appendToTimeline({
314
310
  fn,
315
311
  });
316
312
 
317
- // should we publish within the lock or not within the lock?
318
- // should we await the publish or spin it off
319
- // right now I have this spin off, inside the lock
320
- // await metaspace.registerNewIbGib({ ibGib: newTimelineIbGib, space });
321
- // metaspace.registerNewIbGib({ ibGib: newTimelineIbGib, space }); // spin off
322
-
323
313
  return newTimelineIbGib;
324
314
  } catch (error) {
325
315
  console.error(`${lc} ${extractErrorMsg(error)}`);
@@ -691,10 +681,6 @@ export async function mut8Timeline<TData extends IbGibData_V1 = any>({
691
681
  });
692
682
  }
693
683
 
694
- // should we publish within the lock or not within the lock?
695
- // should we await the publish or spin it off
696
- // right now I have this spin off, inside the lock
697
- // await metaspace.registerNewIbGib({ ibGib: newTimelineIbGib, space });
698
684
  // we await the register call because this spins off the publish events (we are assuming implementation details here)
699
685
  await metaspace.registerNewIbGib({ ibGib: newTimelineIbGib, space }); // already spins off
700
686
 
@@ -186,14 +186,14 @@ respecfully(sir, `[timeline-api]`, async () => {
186
186
  * I'm getting output (warnings?) that the transform ibgib addr
187
187
  * already exists. This stems from the fact that dna/transform
188
188
  * ibgibs do not have timestamps or anything, they simply are
189
- * memoized args to the transform functions. So we need something
189
+ * memoized args to the transform functions. So we need something
190
190
  * unique _in the arg itself_, which in this case means in the
191
191
  * `dataToAddOrPatch` field.
192
- *
192
+ *
193
193
  * Note, however, that it is expected for the original `fork`
194
194
  * transform that created tInitial to be common and for it to
195
195
  * already have this fork dna ibgib. But this shouldn't happen for
196
- * each mut8 transform.
196
+ * each mut8 transform.
197
197
  */
198
198
  const uniqueIdsForUniqueTransforms: string[] = [];
199
199
  for (let i = 0; i < N; i++) {
@@ -689,52 +689,6 @@ export abstract class ReconciliationSpaceBase<
689
689
  }
690
690
  }
691
691
 
692
- // protected async applyTransforms({
693
- // src,
694
- // createdIbGibs_Running,
695
- // dnaAddrsToApplyToStoreVersion,
696
- // allLocalIbGibs,
697
- // }: {
698
- // src: TIbGib,
699
- // createdIbGibs_Running: TIbGib[],
700
- // dnaAddrsToApplyToStoreVersion: IbGibAddr[],
701
- // allLocalIbGibs: TIbGib[],
702
- // }): Promise<TIbGib> {
703
- // const lc = `${this.lc}[${this.applyTransforms.name}]`;
704
- // try {
705
- // if (logalot) { console.log(`${lc} starting...`); }
706
-
707
- // let currentSrc = src;
708
- // // find the dna ibgibs from the local ibgibs that were passed in.
709
- // const allLocalIbGibsMap = new Map<IbGibAddr, TIbGib>();
710
- // allLocalIbGibs.forEach(x => allLocalIbGibsMap.set(getIbGibAddr({ ibGib: x }), x));
711
-
712
- // for (const dnaAddr of dnaAddrsToApplyToStoreVersion) {
713
- // const dnaIbGib = allLocalIbGibsMap.get(dnaAddr);
714
- // if (!dnaIbGib) { throw new Error(`(UNEXPECTED) dnaIbGib not found in allLocalIbGibs. addr: ${dnaAddr} (E: 106402377a644e5989710f606e9323ff)`); }
715
- // const resMut8 = await mut8({
716
- // src: currentSrc,
717
- // mut8Ib: dnaIbGib.ib,
718
- // dataToAddOrPatch: { ...dnaIbGib.data }, // this is a transform, so we just care about data and ib
719
- // noTimestamp: true,
720
- // });
721
-
722
- // currentSrc = resMut8.newIbGib as TIbGib;
723
- // if (resMut8.intermediateIbGibs) {
724
- // resMut8.intermediateIbGibs.forEach(x => createdIbGibs_Running.push(x as TIbGib));
725
- // }
726
- // createdIbGibs_Running.push(currentSrc);
727
- // }
728
-
729
- // return currentSrc;
730
- // } catch (error) {
731
- // const emsg = `${lc} ${extractErrorMsg(error)}`;
732
- // console.error(emsg);
733
- // throw error;
734
- // }
735
- // }
736
-
737
-
738
692
  protected async routeAndDoCommand<TCmdModifier extends SyncSpaceOptionsCmdModifier = SyncSpaceOptionsCmdModifier>({
739
693
  cmd,
740
694
  cmdModifiers,
@@ -135,13 +135,14 @@ export async function applyTransforms({
135
135
  const dnaIbGib_IntermediateArray =
136
136
  allLocalIbGibs.filter(x => getIbGibAddr({ ibGib: x }) === dnaAddrToApply);
137
137
  let dnaIbGib: IbGib_V1;
138
- if (dnaIbGib_IntermediateArray.length === 1) {
138
+ if (dnaIbGib_IntermediateArray.length > 0) {
139
139
  dnaIbGib = dnaIbGib_IntermediateArray[0];
140
- } else if (dnaIbGib_IntermediateArray.length === 0) {
141
- throw new Error(`dna ibGib not found in supplied allLocalIbGibs. dnaAddr: ${dnaAddrToApply}. (E: 7f56826852cf48a79ab8af16bf27e284)`);
140
+ // NOTE: length > 1 is NOT an error condition because mut8/rel8
141
+ // transforms do not have uuids or timestamps. So if the same
142
+ // mut8/rel8 call occurs, e.g., changing the same field on the
143
+ // same source, then we could have a duplicate dna transform.
142
144
  } else {
143
- // more than one ibgib with the dna address?
144
- throw new Error(`More than one ibGib in allLocalIbGibs with the dna address of ${dnaAddrToApply}? (E: a726134f4cc14a4fb2ed2d39d22af17c)(UNEXPECTED)`);
145
+ throw new Error(`dna ibGib not found in supplied allLocalIbGibs. dnaAddr: ${dnaAddrToApply}. (E: 7f56826852cf48a79ab8af16bf27e284)`);
145
146
  }
146
147
 
147
148
  // we have our dna to apply, so do so against the incoming src
package/tsconfig.json CHANGED
@@ -9,9 +9,14 @@
9
9
  "outDir": "./dist", /* Redirect output structure to the directory. */
10
10
  "module": "ESNext", /* https://www.typescriptlang.org/docs/handbook/esm-node.html */
11
11
  },
12
+ "include": [
13
+ "src/**/*.ts",
14
+ "src/**/*.mts",
15
+ "src/keystone/policy/profiles/*.json"
16
+ ],
12
17
  "exclude": [
13
18
  "./node_modules",
14
19
  "**/*.spec.mts",
15
20
  "./dist/**/*"
16
21
  ]
17
- }
22
+ }