@origintrail-official/dkg-agent 10.0.20 → 10.0.21
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/approved-private-replica.d.ts +54 -0
- package/dist/approved-private-replica.d.ts.map +1 -0
- package/dist/approved-private-replica.js +148 -0
- package/dist/approved-private-replica.js.map +1 -0
- package/dist/bounded-operation.d.ts +2 -0
- package/dist/bounded-operation.d.ts.map +1 -1
- package/dist/bounded-operation.js +5 -0
- package/dist/bounded-operation.js.map +1 -1
- package/dist/chain-finality-confirmations-v1.d.ts +7 -0
- package/dist/chain-finality-confirmations-v1.d.ts.map +1 -0
- package/dist/chain-finality-confirmations-v1.js +9 -0
- package/dist/chain-finality-confirmations-v1.js.map +1 -0
- package/dist/chain-reconciler.d.ts +23 -0
- package/dist/chain-reconciler.d.ts.map +1 -1
- package/dist/chain-reconciler.js +35 -0
- package/dist/chain-reconciler.js.map +1 -1
- package/dist/context-graph-member-proof.d.ts +13 -0
- package/dist/context-graph-member-proof.d.ts.map +1 -1
- package/dist/context-graph-member-proof.js +36 -0
- package/dist/context-graph-member-proof.js.map +1 -1
- package/dist/context-graph-membership-persist-scheduler.d.ts +7 -23
- package/dist/context-graph-membership-persist-scheduler.d.ts.map +1 -1
- package/dist/context-graph-membership-persist-scheduler.js +12 -88
- package/dist/context-graph-membership-persist-scheduler.js.map +1 -1
- package/dist/context-graph-meta-projection.d.ts +13 -2
- package/dist/context-graph-meta-projection.d.ts.map +1 -1
- package/dist/context-graph-meta-projection.js +61 -24
- package/dist/context-graph-meta-projection.js.map +1 -1
- package/dist/context-graph-private-meta-proof.d.ts +5 -0
- package/dist/context-graph-private-meta-proof.d.ts.map +1 -1
- package/dist/context-graph-private-meta-proof.js +23 -0
- package/dist/context-graph-private-meta-proof.js.map +1 -1
- package/dist/context-graph-read-authority.d.ts +13 -0
- package/dist/context-graph-read-authority.d.ts.map +1 -1
- package/dist/context-graph-read-authority.js +23 -3
- package/dist/context-graph-read-authority.js.map +1 -1
- package/dist/context-graph-storage-discovery.d.ts +11 -2
- package/dist/context-graph-storage-discovery.d.ts.map +1 -1
- package/dist/context-graph-storage-discovery.js +11 -2
- package/dist/context-graph-storage-discovery.js.map +1 -1
- package/dist/context-graph-subscription-persist-scheduler.d.ts +52 -0
- package/dist/context-graph-subscription-persist-scheduler.d.ts.map +1 -0
- package/dist/context-graph-subscription-persist-scheduler.js +78 -0
- package/dist/context-graph-subscription-persist-scheduler.js.map +1 -0
- package/dist/curator-dial-address.d.ts +16 -0
- package/dist/curator-dial-address.d.ts.map +1 -0
- package/dist/curator-dial-address.js +58 -0
- package/dist/curator-dial-address.js.map +1 -0
- package/dist/curator-meta-refresh.d.ts +2 -0
- package/dist/curator-meta-refresh.d.ts.map +1 -1
- package/dist/curator-meta-refresh.js +2 -44
- package/dist/curator-meta-refresh.js.map +1 -1
- package/dist/curator-peer-connection.d.ts +21 -0
- package/dist/curator-peer-connection.d.ts.map +1 -0
- package/dist/curator-peer-connection.js +41 -0
- package/dist/curator-peer-connection.js.map +1 -0
- package/dist/dkg-agent-base.d.ts +94 -22
- package/dist/dkg-agent-base.d.ts.map +1 -1
- package/dist/dkg-agent-base.js +97 -144
- package/dist/dkg-agent-base.js.map +1 -1
- package/dist/dkg-agent-cg-registry.d.ts +10 -0
- package/dist/dkg-agent-cg-registry.d.ts.map +1 -1
- package/dist/dkg-agent-cg-registry.js +176 -115
- package/dist/dkg-agent-cg-registry.js.map +1 -1
- package/dist/dkg-agent-cg-resolve.d.ts +6 -4
- package/dist/dkg-agent-cg-resolve.d.ts.map +1 -1
- package/dist/dkg-agent-cg-resolve.js +22 -16
- package/dist/dkg-agent-cg-resolve.js.map +1 -1
- package/dist/dkg-agent-constants.d.ts +4 -2
- package/dist/dkg-agent-constants.d.ts.map +1 -1
- package/dist/dkg-agent-constants.js +4 -2
- package/dist/dkg-agent-constants.js.map +1 -1
- package/dist/dkg-agent-crypto.d.ts +101 -21
- package/dist/dkg-agent-crypto.d.ts.map +1 -1
- package/dist/dkg-agent-crypto.js +670 -152
- package/dist/dkg-agent-crypto.js.map +1 -1
- package/dist/dkg-agent-helpers.d.ts +2 -2
- package/dist/dkg-agent-helpers.d.ts.map +1 -1
- package/dist/dkg-agent-helpers.js +3 -3
- package/dist/dkg-agent-helpers.js.map +1 -1
- package/dist/dkg-agent-join.d.ts +12 -1
- package/dist/dkg-agent-join.d.ts.map +1 -1
- package/dist/dkg-agent-join.js +80 -92
- package/dist/dkg-agent-join.js.map +1 -1
- package/dist/dkg-agent-lifecycle.d.ts +58 -15
- package/dist/dkg-agent-lifecycle.d.ts.map +1 -1
- package/dist/dkg-agent-lifecycle.js +295 -114
- package/dist/dkg-agent-lifecycle.js.map +1 -1
- package/dist/dkg-agent-publish.d.ts +33 -40
- package/dist/dkg-agent-publish.d.ts.map +1 -1
- package/dist/dkg-agent-publish.js +190 -256
- package/dist/dkg-agent-publish.js.map +1 -1
- package/dist/dkg-agent-query.d.ts +7 -0
- package/dist/dkg-agent-query.d.ts.map +1 -1
- package/dist/dkg-agent-query.js +75 -63
- package/dist/dkg-agent-query.js.map +1 -1
- package/dist/dkg-agent-registered-private-empty-vm.d.ts +70 -0
- package/dist/dkg-agent-registered-private-empty-vm.d.ts.map +1 -0
- package/dist/dkg-agent-registered-private-empty-vm.js +133 -0
- package/dist/dkg-agent-registered-private-empty-vm.js.map +1 -0
- package/dist/dkg-agent-rfc64-catalog-auto-publish.d.ts +8 -3
- package/dist/dkg-agent-rfc64-catalog-auto-publish.d.ts.map +1 -1
- package/dist/dkg-agent-rfc64-catalog-auto-publish.js +45 -51
- package/dist/dkg-agent-rfc64-catalog-auto-publish.js.map +1 -1
- package/dist/dkg-agent-rfc64-catalog.d.ts +63 -87
- package/dist/dkg-agent-rfc64-catalog.d.ts.map +1 -1
- package/dist/dkg-agent-rfc64-catalog.js +595 -551
- package/dist/dkg-agent-rfc64-catalog.js.map +1 -1
- package/dist/dkg-agent-swm-host.d.ts +43 -52
- package/dist/dkg-agent-swm-host.d.ts.map +1 -1
- package/dist/dkg-agent-swm-host.js +629 -812
- package/dist/dkg-agent-swm-host.js.map +1 -1
- package/dist/dkg-agent-swm-state.d.ts +15 -0
- package/dist/dkg-agent-swm-state.d.ts.map +1 -1
- package/dist/dkg-agent-swm-state.js +43 -0
- package/dist/dkg-agent-swm-state.js.map +1 -1
- package/dist/dkg-agent-swm-substrate.d.ts +2 -0
- package/dist/dkg-agent-swm-substrate.d.ts.map +1 -1
- package/dist/dkg-agent-swm-substrate.js +110 -53
- package/dist/dkg-agent-swm-substrate.js.map +1 -1
- package/dist/dkg-agent-types.d.ts +62 -26
- package/dist/dkg-agent-types.d.ts.map +1 -1
- package/dist/dkg-agent-types.js.map +1 -1
- package/dist/dkg-agent-vm-promotion.d.ts +2 -0
- package/dist/dkg-agent-vm-promotion.d.ts.map +1 -1
- package/dist/dkg-agent-vm-promotion.js +39 -5
- package/dist/dkg-agent-vm-promotion.js.map +1 -1
- package/dist/dkg-agent.d.ts +8 -1
- package/dist/dkg-agent.d.ts.map +1 -1
- package/dist/dkg-agent.js +75 -45
- package/dist/dkg-agent.js.map +1 -1
- package/dist/exact-graph-content-verifier.d.ts.map +1 -1
- package/dist/exact-graph-content-verifier.js +3 -2
- package/dist/exact-graph-content-verifier.js.map +1 -1
- package/dist/finalization-handler.d.ts +19 -207
- package/dist/finalization-handler.d.ts.map +1 -1
- package/dist/finalization-handler.js +79 -1646
- package/dist/finalization-handler.js.map +1 -1
- package/dist/finalization-recovery-worker.js +1 -1
- package/dist/finalization-recovery-worker.js.map +1 -1
- package/dist/finalized-authority-cold-resolution.d.ts +6 -1
- package/dist/finalized-authority-cold-resolution.d.ts.map +1 -1
- package/dist/finalized-authority-cold-resolution.js +22 -3
- package/dist/finalized-authority-cold-resolution.js.map +1 -1
- package/dist/gossip-session.d.ts +29 -0
- package/dist/gossip-session.d.ts.map +1 -0
- package/dist/gossip-session.js +48 -0
- package/dist/gossip-session.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/internal/context-graph-authority/context-graph-agent-gate-authority.d.ts +5 -5
- package/dist/internal/context-graph-authority/context-graph-agent-gate-authority.d.ts.map +1 -1
- package/dist/internal/context-graph-authority/context-graph-agent-gate-authority.js +59 -49
- package/dist/internal/context-graph-authority/context-graph-agent-gate-authority.js.map +1 -1
- package/dist/internal/context-graph-authority/finalized-target-projection.d.ts +17 -0
- package/dist/internal/context-graph-authority/finalized-target-projection.d.ts.map +1 -0
- package/dist/internal/context-graph-authority/finalized-target-projection.js +36 -0
- package/dist/internal/context-graph-authority/finalized-target-projection.js.map +1 -0
- package/dist/internal/context-graph-authority/swm-transport-authority.d.ts +43 -7
- package/dist/internal/context-graph-authority/swm-transport-authority.d.ts.map +1 -1
- package/dist/internal/context-graph-authority/swm-transport-authority.js +135 -18
- package/dist/internal/context-graph-authority/swm-transport-authority.js.map +1 -1
- package/dist/internal/context-graph-binding-abort.d.ts +3 -0
- package/dist/internal/context-graph-binding-abort.d.ts.map +1 -0
- package/dist/internal/context-graph-binding-abort.js +32 -0
- package/dist/internal/context-graph-binding-abort.js.map +1 -0
- package/dist/internal/context-graph-cache-invalidating-store.d.ts +3 -0
- package/dist/internal/context-graph-cache-invalidating-store.d.ts.map +1 -0
- package/dist/internal/context-graph-cache-invalidating-store.js +167 -0
- package/dist/internal/context-graph-cache-invalidating-store.js.map +1 -0
- package/dist/internal/context-graph-meta-record-copy.d.ts +3 -0
- package/dist/internal/context-graph-meta-record-copy.d.ts.map +1 -0
- package/dist/internal/context-graph-meta-record-copy.js +21 -0
- package/dist/internal/context-graph-meta-record-copy.js.map +1 -0
- package/dist/internal/gossip/host-mode-handler.d.ts +11 -0
- package/dist/internal/gossip/host-mode-handler.d.ts.map +1 -0
- package/dist/internal/gossip/host-mode-handler.js +41 -0
- package/dist/internal/gossip/host-mode-handler.js.map +1 -0
- package/dist/internal/join-encryption-key-bundle.d.ts +10 -0
- package/dist/internal/join-encryption-key-bundle.d.ts.map +1 -0
- package/dist/internal/join-encryption-key-bundle.js +72 -0
- package/dist/internal/join-encryption-key-bundle.js.map +1 -0
- package/dist/internal/knowledge-asset-vm-publish-request.d.ts +31 -0
- package/dist/internal/knowledge-asset-vm-publish-request.d.ts.map +1 -0
- package/dist/internal/knowledge-asset-vm-publish-request.js +91 -0
- package/dist/internal/knowledge-asset-vm-publish-request.js.map +1 -0
- package/dist/internal/lifecycle-sync-policy.d.ts +5 -0
- package/dist/internal/lifecycle-sync-policy.d.ts.map +1 -0
- package/dist/internal/lifecycle-sync-policy.js +12 -0
- package/dist/internal/lifecycle-sync-policy.js.map +1 -0
- package/dist/internal/local-private-member.d.ts +14 -0
- package/dist/internal/local-private-member.d.ts.map +1 -0
- package/dist/internal/local-private-member.js +21 -0
- package/dist/internal/local-private-member.js.map +1 -0
- package/dist/internal/promote/assertion-promote-precommit.d.ts +41 -1
- package/dist/internal/promote/assertion-promote-precommit.d.ts.map +1 -1
- package/dist/internal/promote/assertion-promote-precommit.js +74 -5
- package/dist/internal/promote/assertion-promote-precommit.js.map +1 -1
- package/dist/internal/storage-ack-owned-request.d.ts +16 -0
- package/dist/internal/storage-ack-owned-request.d.ts.map +1 -0
- package/dist/internal/storage-ack-owned-request.js +16 -0
- package/dist/internal/storage-ack-owned-request.js.map +1 -0
- package/dist/internal/vm-reconcile-local-admission-wait.d.ts +96 -0
- package/dist/internal/vm-reconcile-local-admission-wait.d.ts.map +1 -0
- package/dist/internal/vm-reconcile-local-admission-wait.js +226 -0
- package/dist/internal/vm-reconcile-local-admission-wait.js.map +1 -0
- package/dist/internal/vm-reconcile-read-authority.d.ts +27 -0
- package/dist/internal/vm-reconcile-read-authority.d.ts.map +1 -0
- package/dist/internal/vm-reconcile-read-authority.js +33 -0
- package/dist/internal/vm-reconcile-read-authority.js.map +1 -0
- package/dist/internal/vm-reconcile-sweep-admission.d.ts +2 -0
- package/dist/internal/vm-reconcile-sweep-admission.d.ts.map +1 -1
- package/dist/internal/vm-reconcile-sweep.d.ts +16 -4
- package/dist/internal/vm-reconcile-sweep.d.ts.map +1 -1
- package/dist/internal/vm-reconcile-sweep.js +91 -50
- package/dist/internal/vm-reconcile-sweep.js.map +1 -1
- package/dist/internal/workspace-projected-delegatees.d.ts +3 -0
- package/dist/internal/workspace-projected-delegatees.d.ts.map +1 -0
- package/dist/internal/workspace-projected-delegatees.js +34 -0
- package/dist/internal/workspace-projected-delegatees.js.map +1 -0
- package/dist/join-approval-restart-projection.d.ts +14 -0
- package/dist/join-approval-restart-projection.d.ts.map +1 -0
- package/dist/join-approval-restart-projection.js +32 -0
- package/dist/join-approval-restart-projection.js.map +1 -0
- package/dist/keyed-persist-scheduler.d.ts +72 -0
- package/dist/keyed-persist-scheduler.d.ts.map +1 -0
- package/dist/keyed-persist-scheduler.js +140 -0
- package/dist/keyed-persist-scheduler.js.map +1 -0
- package/dist/map-with-concurrency.d.ts +7 -0
- package/dist/map-with-concurrency.d.ts.map +1 -1
- package/dist/map-with-concurrency.js +36 -0
- package/dist/map-with-concurrency.js.map +1 -1
- package/dist/p2p/network-admission-coordinator.d.ts +15 -0
- package/dist/p2p/network-admission-coordinator.d.ts.map +1 -1
- package/dist/p2p/network-admission-coordinator.js +20 -2
- package/dist/p2p/network-admission-coordinator.js.map +1 -1
- package/dist/prepare-unscoped-context-graph-read-checks.d.ts.map +1 -1
- package/dist/prepare-unscoped-context-graph-read-checks.js +12 -0
- package/dist/prepare-unscoped-context-graph-read-checks.js.map +1 -1
- package/dist/registered-context-graph-authority.d.ts +7 -0
- package/dist/registered-context-graph-authority.d.ts.map +1 -1
- package/dist/registered-private-empty-vm-attempt-v1.d.ts +34 -0
- package/dist/registered-private-empty-vm-attempt-v1.d.ts.map +1 -0
- package/dist/registered-private-empty-vm-attempt-v1.js +120 -0
- package/dist/registered-private-empty-vm-attempt-v1.js.map +1 -0
- package/dist/reserved-ka-id-allocation.d.ts +12 -0
- package/dist/reserved-ka-id-allocation.d.ts.map +1 -0
- package/dist/reserved-ka-id-allocation.js +25 -0
- package/dist/reserved-ka-id-allocation.js.map +1 -0
- package/dist/rfc64/authority-rpc-circuit-breaker-v1.d.ts +5 -3
- package/dist/rfc64/authority-rpc-circuit-breaker-v1.d.ts.map +1 -1
- package/dist/rfc64/authority-rpc-circuit-breaker-v1.js +9 -0
- package/dist/rfc64/authority-rpc-circuit-breaker-v1.js.map +1 -1
- package/dist/rfc64/catalog-completion-evidence-v1.d.ts +38 -0
- package/dist/rfc64/catalog-completion-evidence-v1.d.ts.map +1 -0
- package/dist/rfc64/catalog-completion-evidence-v1.js +49 -0
- package/dist/rfc64/catalog-completion-evidence-v1.js.map +1 -0
- package/dist/rfc64/catalog-operational-applied-heads-v1.d.ts +6 -3
- package/dist/rfc64/catalog-operational-applied-heads-v1.d.ts.map +1 -1
- package/dist/rfc64/catalog-operational-applied-heads-v1.js +6 -3
- package/dist/rfc64/catalog-operational-applied-heads-v1.js.map +1 -1
- package/dist/rfc64/catalog-operational-reads-v1.d.ts +13 -0
- package/dist/rfc64/catalog-operational-reads-v1.d.ts.map +1 -0
- package/dist/rfc64/catalog-operational-reads-v1.js +56 -0
- package/dist/rfc64/catalog-operational-reads-v1.js.map +1 -0
- package/dist/rfc64/catalog-operational-targets-v1.d.ts +55 -0
- package/dist/rfc64/catalog-operational-targets-v1.d.ts.map +1 -0
- package/dist/rfc64/catalog-operational-targets-v1.js +379 -0
- package/dist/rfc64/catalog-operational-targets-v1.js.map +1 -0
- package/dist/rfc64/catalog-replay-recovery-runtime-v1.d.ts +2 -0
- package/dist/rfc64/catalog-replay-recovery-runtime-v1.d.ts.map +1 -1
- package/dist/rfc64/catalog-replay-recovery-runtime-v1.js +18 -25
- package/dist/rfc64/catalog-replay-recovery-runtime-v1.js.map +1 -1
- package/dist/rfc64/legacy-swm-boundary-codec-v1.d.ts +25 -0
- package/dist/rfc64/legacy-swm-boundary-codec-v1.d.ts.map +1 -0
- package/dist/rfc64/legacy-swm-boundary-codec-v1.js +127 -0
- package/dist/rfc64/legacy-swm-boundary-codec-v1.js.map +1 -0
- package/dist/rfc64/legacy-swm-boundary-v1.d.ts +12 -0
- package/dist/rfc64/legacy-swm-boundary-v1.d.ts.map +1 -1
- package/dist/rfc64/legacy-swm-boundary-v1.js +83 -144
- package/dist/rfc64/legacy-swm-boundary-v1.js.map +1 -1
- package/dist/rfc64/private-catalog-subscription-readiness-v1.d.ts +33 -0
- package/dist/rfc64/private-catalog-subscription-readiness-v1.d.ts.map +1 -0
- package/dist/rfc64/private-catalog-subscription-readiness-v1.js +97 -0
- package/dist/rfc64/private-catalog-subscription-readiness-v1.js.map +1 -0
- package/dist/rfc64/private-read-roster-v1.d.ts +14 -0
- package/dist/rfc64/private-read-roster-v1.d.ts.map +1 -0
- package/dist/rfc64/private-read-roster-v1.js +57 -0
- package/dist/rfc64/private-read-roster-v1.js.map +1 -0
- package/dist/rfc64/registered-private-empty-vm-proof-v1.d.ts +20 -0
- package/dist/rfc64/registered-private-empty-vm-proof-v1.d.ts.map +1 -0
- package/dist/rfc64/registered-private-empty-vm-proof-v1.js +26 -0
- package/dist/rfc64/registered-private-empty-vm-proof-v1.js.map +1 -0
- package/dist/rfc64/swm-inventory-shadow-runtime-v1.d.ts +3 -1
- package/dist/rfc64/swm-inventory-shadow-runtime-v1.d.ts.map +1 -1
- package/dist/rfc64/swm-inventory-shadow-runtime-v1.js +34 -0
- package/dist/rfc64/swm-inventory-shadow-runtime-v1.js.map +1 -1
- package/dist/sync/auth/pipe-request-tail.d.ts +5 -1
- package/dist/sync/auth/pipe-request-tail.d.ts.map +1 -1
- package/dist/sync/auth/pipe-request-tail.js +13 -3
- package/dist/sync/auth/pipe-request-tail.js.map +1 -1
- package/dist/sync/auth/request-build.d.ts +3 -0
- package/dist/sync/auth/request-build.d.ts.map +1 -1
- package/dist/sync/auth/request-build.js +11 -2
- package/dist/sync/auth/request-build.js.map +1 -1
- package/dist/sync/backpressure.d.ts +27 -16
- package/dist/sync/backpressure.d.ts.map +1 -1
- package/dist/sync/backpressure.js +66 -40
- package/dist/sync/backpressure.js.map +1 -1
- package/dist/sync/catchup-policy.d.ts +2 -0
- package/dist/sync/catchup-policy.d.ts.map +1 -1
- package/dist/sync/catchup-policy.js +2 -0
- package/dist/sync/catchup-policy.js.map +1 -1
- package/dist/sync/exact-assets.d.ts +7 -5
- package/dist/sync/exact-assets.d.ts.map +1 -1
- package/dist/sync/exact-assets.js +13 -8
- package/dist/sync/exact-assets.js.map +1 -1
- package/dist/sync/exact-batch-observation.d.ts +3 -0
- package/dist/sync/exact-batch-observation.d.ts.map +1 -0
- package/dist/sync/exact-batch-observation.js +13 -0
- package/dist/sync/exact-batch-observation.js.map +1 -0
- package/dist/sync/exact-batch-stream-capability.d.ts +24 -0
- package/dist/sync/exact-batch-stream-capability.d.ts.map +1 -0
- package/dist/sync/exact-batch-stream-capability.js +88 -0
- package/dist/sync/exact-batch-stream-capability.js.map +1 -0
- package/dist/sync/exact-batch-stream-contract.d.ts +78 -0
- package/dist/sync/exact-batch-stream-contract.d.ts.map +1 -0
- package/dist/sync/exact-batch-stream-contract.js +206 -0
- package/dist/sync/exact-batch-stream-contract.js.map +1 -0
- package/dist/sync/peer-connection.d.ts.map +1 -1
- package/dist/sync/peer-connection.js +11 -2
- package/dist/sync/peer-connection.js.map +1 -1
- package/dist/sync/priority-admission-queue.d.ts +17 -0
- package/dist/sync/priority-admission-queue.d.ts.map +1 -1
- package/dist/sync/priority-admission-queue.js +58 -37
- package/dist/sync/priority-admission-queue.js.map +1 -1
- package/dist/sync/requester/admission-boundary.d.ts +12 -0
- package/dist/sync/requester/admission-boundary.d.ts.map +1 -0
- package/dist/sync/requester/admission-boundary.js +22 -0
- package/dist/sync/requester/admission-boundary.js.map +1 -0
- package/dist/sync/requester/durable-sync.d.ts +2 -1
- package/dist/sync/requester/durable-sync.d.ts.map +1 -1
- package/dist/sync/requester/durable-sync.js +3 -188
- package/dist/sync/requester/durable-sync.js.map +1 -1
- package/dist/sync/requester/exact-batch-stream-driver.d.ts +83 -0
- package/dist/sync/requester/exact-batch-stream-driver.d.ts.map +1 -0
- package/dist/sync/requester/exact-batch-stream-driver.js +299 -0
- package/dist/sync/requester/exact-batch-stream-driver.js.map +1 -0
- package/dist/sync/requester/exact-batch-stream.d.ts +72 -0
- package/dist/sync/requester/exact-batch-stream.d.ts.map +1 -0
- package/dist/sync/requester/exact-batch-stream.js +267 -0
- package/dist/sync/requester/exact-batch-stream.js.map +1 -0
- package/dist/sync/requester/exact-recovery-transport.d.ts +19 -0
- package/dist/sync/requester/exact-recovery-transport.d.ts.map +1 -0
- package/dist/sync/requester/exact-recovery-transport.js +3 -0
- package/dist/sync/requester/exact-recovery-transport.js.map +1 -0
- package/dist/sync/requester/finalized-swm-twin-reconciliation.js +12 -3
- package/dist/sync/requester/finalized-swm-twin-reconciliation.js.map +1 -1
- package/dist/sync/requester/graph-scoped-materialization.d.ts.map +1 -1
- package/dist/sync/requester/graph-scoped-materialization.js +58 -24
- package/dist/sync/requester/graph-scoped-materialization.js.map +1 -1
- package/dist/sync/requester/page-fetch.d.ts +7 -0
- package/dist/sync/requester/page-fetch.d.ts.map +1 -1
- package/dist/sync/requester/page-fetch.js +103 -49
- package/dist/sync/requester/page-fetch.js.map +1 -1
- package/dist/sync/requester/shared-memory-sync.d.ts +10 -5
- package/dist/sync/requester/shared-memory-sync.d.ts.map +1 -1
- package/dist/sync/requester/shared-memory-sync.js +149 -150
- package/dist/sync/requester/shared-memory-sync.js.map +1 -1
- package/dist/sync/requester/swm-materialization-memo.d.ts +12 -0
- package/dist/sync/requester/swm-materialization-memo.d.ts.map +1 -0
- package/dist/sync/requester/swm-materialization-memo.js +54 -0
- package/dist/sync/requester/swm-materialization-memo.js.map +1 -0
- package/dist/sync/requester/swm-recovery.d.ts +3 -29
- package/dist/sync/requester/swm-recovery.d.ts.map +1 -1
- package/dist/sync/requester/swm-recovery.js +11 -10
- package/dist/sync/requester/swm-recovery.js.map +1 -1
- package/dist/sync/requester/swm-snapshot-materializer.d.ts.map +1 -1
- package/dist/sync/requester/swm-snapshot-materializer.js +18 -0
- package/dist/sync/requester/swm-snapshot-materializer.js.map +1 -1
- package/dist/sync/requester/swm-target-executor.d.ts +6 -0
- package/dist/sync/requester/swm-target-executor.d.ts.map +1 -1
- package/dist/sync/requester/swm-target-executor.js +24 -3
- package/dist/sync/requester/swm-target-executor.js.map +1 -1
- package/dist/sync/requester/verified-asset-preparation.d.ts +9 -0
- package/dist/sync/requester/verified-asset-preparation.d.ts.map +1 -0
- package/dist/sync/requester/verified-asset-preparation.js +190 -0
- package/dist/sync/requester/verified-asset-preparation.js.map +1 -0
- package/dist/sync/responder/asset-metadata.d.ts +18 -0
- package/dist/sync/responder/asset-metadata.d.ts.map +1 -0
- package/dist/sync/responder/asset-metadata.js +27 -0
- package/dist/sync/responder/asset-metadata.js.map +1 -0
- package/dist/sync/responder/durable-data-request-policy.d.ts +2 -16
- package/dist/sync/responder/durable-data-request-policy.d.ts.map +1 -1
- package/dist/sync/responder/durable-data-request-policy.js +1 -31
- package/dist/sync/responder/durable-data-request-policy.js.map +1 -1
- package/dist/sync/responder/exact-asset-export-cache.d.ts +89 -0
- package/dist/sync/responder/exact-asset-export-cache.d.ts.map +1 -0
- package/dist/sync/responder/exact-asset-export-cache.js +550 -0
- package/dist/sync/responder/exact-asset-export-cache.js.map +1 -0
- package/dist/sync/responder/exact-batch-stream.d.ts +47 -0
- package/dist/sync/responder/exact-batch-stream.d.ts.map +1 -0
- package/dist/sync/responder/exact-batch-stream.js +151 -0
- package/dist/sync/responder/exact-batch-stream.js.map +1 -0
- package/dist/sync/responder/exact-data-session.d.ts +67 -0
- package/dist/sync/responder/exact-data-session.d.ts.map +1 -0
- package/dist/sync/responder/exact-data-session.js +130 -0
- package/dist/sync/responder/exact-data-session.js.map +1 -0
- package/dist/sync/responder/exact-graph-cursor-filter.d.ts +9 -0
- package/dist/sync/responder/exact-graph-cursor-filter.d.ts.map +1 -0
- package/dist/sync/responder/exact-graph-cursor-filter.js +101 -0
- package/dist/sync/responder/exact-graph-cursor-filter.js.map +1 -0
- package/dist/sync/responder/exact-graph-reader.d.ts +95 -0
- package/dist/sync/responder/exact-graph-reader.d.ts.map +1 -0
- package/dist/sync/responder/exact-graph-reader.js +623 -0
- package/dist/sync/responder/exact-graph-reader.js.map +1 -0
- package/dist/sync/responder/exact-page-reader.d.ts +37 -0
- package/dist/sync/responder/exact-page-reader.d.ts.map +1 -0
- package/dist/sync/responder/exact-page-reader.js +130 -0
- package/dist/sync/responder/exact-page-reader.js.map +1 -0
- package/dist/sync/responder/graph-plan.d.ts +19 -85
- package/dist/sync/responder/graph-plan.d.ts.map +1 -1
- package/dist/sync/responder/graph-plan.js +51 -988
- package/dist/sync/responder/graph-plan.js.map +1 -1
- package/dist/sync/responder/page-framing-policy.d.ts +31 -0
- package/dist/sync/responder/page-framing-policy.d.ts.map +1 -0
- package/dist/sync/responder/page-framing-policy.js +41 -0
- package/dist/sync/responder/page-framing-policy.js.map +1 -0
- package/dist/sync/responder/responder-row-page.d.ts +85 -0
- package/dist/sync/responder/responder-row-page.d.ts.map +1 -0
- package/dist/sync/responder/responder-row-page.js +181 -0
- package/dist/sync/responder/responder-row-page.js.map +1 -0
- package/dist/sync/responder/row-serialization.d.ts +34 -0
- package/dist/sync/responder/row-serialization.d.ts.map +1 -0
- package/dist/sync/responder/row-serialization.js +69 -0
- package/dist/sync/responder/row-serialization.js.map +1 -0
- package/dist/sync/responder/session-plan-memo.d.ts +20 -0
- package/dist/sync/responder/session-plan-memo.d.ts.map +1 -0
- package/dist/sync/responder/session-plan-memo.js +135 -0
- package/dist/sync/responder/session-plan-memo.js.map +1 -0
- package/dist/sync/responder/sync-handler.d.ts +18 -1
- package/dist/sync/responder/sync-handler.d.ts.map +1 -1
- package/dist/sync/responder/sync-handler.js +101 -57
- package/dist/sync/responder/sync-handler.js.map +1 -1
- package/dist/sync/shared-memory-completion.d.ts +30 -0
- package/dist/sync/shared-memory-completion.d.ts.map +1 -1
- package/dist/sync/shared-memory-completion.js +13 -0
- package/dist/sync/shared-memory-completion.js.map +1 -1
- package/dist/sync/wire-compression.d.ts +47 -0
- package/dist/sync/wire-compression.d.ts.map +1 -0
- package/dist/sync/wire-compression.js +111 -0
- package/dist/sync/wire-compression.js.map +1 -0
- package/dist/unscoped-query-consistency.d.ts +12 -0
- package/dist/unscoped-query-consistency.d.ts.map +1 -1
- package/dist/unscoped-query-consistency.js +17 -1
- package/dist/unscoped-query-consistency.js.map +1 -1
- package/dist/vm-promotion-audit.d.ts +2 -2
- package/dist/vm-promotion-audit.d.ts.map +1 -1
- package/dist/vm-promotion-audit.js +26 -9
- package/dist/vm-promotion-audit.js.map +1 -1
- package/dist/vm-reconcile-dispatcher.d.ts +42 -1
- package/dist/vm-reconcile-dispatcher.d.ts.map +1 -1
- package/dist/vm-reconcile-dispatcher.js +103 -4
- package/dist/vm-reconcile-dispatcher.js.map +1 -1
- package/dist/vm-reconcile-peer-topology.d.ts +7 -9
- package/dist/vm-reconcile-peer-topology.d.ts.map +1 -1
- package/dist/vm-reconcile-peer-topology.js +1 -37
- package/dist/vm-reconcile-peer-topology.js.map +1 -1
- package/dist/vm-recovery-candidate-order.d.ts +16 -0
- package/dist/vm-recovery-candidate-order.d.ts.map +1 -0
- package/dist/vm-recovery-candidate-order.js +24 -0
- package/dist/vm-recovery-candidate-order.js.map +1 -0
- package/dist/vm-recovery-core-transport-preference.d.ts +69 -0
- package/dist/vm-recovery-core-transport-preference.d.ts.map +1 -0
- package/dist/vm-recovery-core-transport-preference.js +131 -0
- package/dist/vm-recovery-core-transport-preference.js.map +1 -0
- package/dist/vm-recovery-experiment-policy.d.ts +24 -0
- package/dist/vm-recovery-experiment-policy.d.ts.map +1 -0
- package/dist/vm-recovery-experiment-policy.js +18 -0
- package/dist/vm-recovery-experiment-policy.js.map +1 -0
- package/dist/vm-recovery-footprint.d.ts +54 -0
- package/dist/vm-recovery-footprint.d.ts.map +1 -1
- package/dist/vm-recovery-footprint.js +88 -24
- package/dist/vm-recovery-footprint.js.map +1 -1
- package/dist/vm-recovery-microbatch.d.ts +2 -0
- package/dist/vm-recovery-microbatch.d.ts.map +1 -1
- package/dist/vm-recovery-microbatch.js +7 -3
- package/dist/vm-recovery-microbatch.js.map +1 -1
- package/dist/vm-recovery-pass-authority.d.ts +84 -0
- package/dist/vm-recovery-pass-authority.d.ts.map +1 -0
- package/dist/vm-recovery-pass-authority.js +126 -0
- package/dist/vm-recovery-pass-authority.js.map +1 -0
- package/dist/vm-recovery-phase-timing.d.ts +75 -0
- package/dist/vm-recovery-phase-timing.d.ts.map +1 -0
- package/dist/vm-recovery-phase-timing.js +236 -0
- package/dist/vm-recovery-phase-timing.js.map +1 -0
- package/dist/vm-recovery-preparation.d.ts +143 -0
- package/dist/vm-recovery-preparation.d.ts.map +1 -0
- package/dist/vm-recovery-preparation.js +433 -0
- package/dist/vm-recovery-preparation.js.map +1 -0
- package/dist/vm-recovery-provider-policy.d.ts +13 -1
- package/dist/vm-recovery-provider-policy.d.ts.map +1 -1
- package/dist/vm-recovery-provider-policy.js +37 -5
- package/dist/vm-recovery-provider-policy.js.map +1 -1
- package/dist/vm-recovery-stream-profile.d.ts +15 -0
- package/dist/vm-recovery-stream-profile.d.ts.map +1 -0
- package/dist/vm-recovery-stream-profile.js +53 -0
- package/dist/vm-recovery-stream-profile.js.map +1 -0
- package/dist/vm-recovery-stream-setback-policy.d.ts +54 -0
- package/dist/vm-recovery-stream-setback-policy.d.ts.map +1 -0
- package/dist/vm-recovery-stream-setback-policy.js +85 -0
- package/dist/vm-recovery-stream-setback-policy.js.map +1 -0
- package/dist/vm-recovery-timing-observer.d.ts +27 -0
- package/dist/vm-recovery-timing-observer.d.ts.map +1 -0
- package/dist/vm-recovery-timing-observer.js +49 -0
- package/dist/vm-recovery-timing-observer.js.map +1 -0
- package/dist/vm-recovery-transport-budget-policy.d.ts +32 -0
- package/dist/vm-recovery-transport-budget-policy.d.ts.map +1 -0
- package/dist/vm-recovery-transport-budget-policy.js +55 -0
- package/dist/vm-recovery-transport-budget-policy.js.map +1 -0
- package/dist/vm-recovery-transport-plan.d.ts +83 -0
- package/dist/vm-recovery-transport-plan.d.ts.map +1 -0
- package/dist/vm-recovery-transport-plan.js +117 -0
- package/dist/vm-recovery-transport-plan.js.map +1 -0
- package/package.json +17 -9
- package/dist/finalization-annotations.d.ts +0 -5
- package/dist/finalization-annotations.d.ts.map +0 -1
- package/dist/finalization-annotations.js +0 -6
- package/dist/finalization-annotations.js.map +0 -1
- package/dist/swm-ka-bound.d.ts +0 -21
- package/dist/swm-ka-bound.d.ts.map +0 -1
- package/dist/swm-ka-bound.js +0 -36
- package/dist/swm-ka-bound.js.map +0 -1
|
@@ -7,112 +7,34 @@
|
|
|
7
7
|
* register/batch/identity entrypoints. Bodies are a 1:1 move; methods take
|
|
8
8
|
* `this: DKGAgent` so cross-calls resolve against the composed class.
|
|
9
9
|
*/
|
|
10
|
-
import {
|
|
10
|
+
import { planKnowledgeAssetVmPublication, isGraphScopedKnowledgeAssetVmPublishRequest, assertionSealFromQueuedKnowledgeAssetVmPublishRequest, createKnowledgeAssetVmPublishIntentKey } from './internal/knowledge-asset-vm-publish-request.js';
|
|
11
|
+
export { createKnowledgeAssetVmPublishIntentKey } from './internal/knowledge-asset-vm-publish-request.js';
|
|
12
|
+
import { randomUUID } from 'node:crypto';
|
|
11
13
|
import { preflightKnowledgeAssetVmPublishSnapshot } from './vm-publish-snapshot-preflight.js';
|
|
12
|
-
import { PROTOCOL_SWM_UPDATE, contextGraphPublishTopic, contextGraphWorkspaceTopic, contextGraphUpdateTopic, contextGraphFinalizationTopic, contextGraphDataGraphUri, contextGraphMetaGraphUri,
|
|
14
|
+
import { PROTOCOL_SWM_UPDATE, contextGraphPublishTopic, contextGraphWorkspaceTopic, contextGraphUpdateTopic, contextGraphFinalizationTopic, contextGraphDataGraphUri, contextGraphMetaGraphUri, contextGraphSharedMemoryUri, contextGraphDataUri, contextGraphMetaUri, assertionLifecycleUri, contextGraphAssertionUri, contextGraphCatalogUri, contextGraphLayerUri, MemoryLayer, encodeKAUpdateRequest, encodeGossipEnvelope, GOSSIP_ENVELOPE_VERSION, encodeFinalizationMessage, SYSTEM_CONTEXT_GRAPHS, DKG_ONTOLOGY, createOperationContext, escapeSparqlLiteral, assertSafeIri, isTrustLevelQuad, buildAuthorAttestationTypedData, buildUpdateAuthorAttestationTypedData, AUTHOR_SCHEME_VERSION_V1, buildAssertionSealQuads, buildAssertionPublishReceiptQuads, parseAssertionSealQuads, ASSERTION_SEAL_PREDICATES, GRAPH_KA_CONTENT_SCOPE_VERSION, LegacyKnowledgeAssetReadOnlyError, createGraphKnowledgeAssetScope, knowledgeAssetLayerGraphUri, computeSwmSenderKeyMembershipHash, encryptV10PublishPayload, encryptChunked, buildCiphertextChunksRoot, computeGossipSigningPayloadV2, GOSSIP_TYPE_WORKSPACE_PUBLISH_CHUNKED, ciphertextChunkStoreGraph, ciphertextChunkStoreSubject, CIPHERTEXT_CHUNK_PREDICATE, withSpan, getMetrics, assertQuadLiteralsMutf8Safe, PUBLISH_AUTHOR_NOT_CUSTODIAL_CODE, PUBLISH_AUTHOR_SELECTION_CONFLICT_CODE, formatPublishAuthorNotCustodialMessage, } from '@origintrail-official/dkg-core';
|
|
13
15
|
import { SpanStatusCode } from '@opentelemetry/api';
|
|
14
|
-
import { deleteByPatternWithoutCount, GraphManager, PrivateContentStore, loadSharedMemoryQuadsForScope,
|
|
15
|
-
import { computeFlatKCRootV10 as computeFlatKCRoot, computePrivateRootV10 as computePrivateRoot, skolemizeKnowledgeAssetParts, assertNoKnowledgeAssetPayloadNamedGraphs, assertValidPrecomputedUpdateAttestation, isReservedSubject, canonicalPublishPayload, generatedPrivateCatalogTripleKeys,
|
|
16
|
-
// OT-RFC-43 A2 — per-layer pointer + KA-id predicates and stamp helpers.
|
|
17
|
-
KA_ID_PRED, RESERVED_UAL_PRED, WM_CURRENT_ASSERTION_PRED, SWM_CURRENT_ASSERTION_PRED, VM_CURRENT_ASSERTION_PRED, createResolveCurrentWorkspaceGossipPayload, parseEncodedWorkspaceGossipPayload, assertPublicationPricingPolicyApplicable, } from '@origintrail-official/dkg-publisher';
|
|
16
|
+
import { deleteByPatternWithoutCount, GraphManager, PrivateContentStore, loadSharedMemoryQuadsForScope, } from '@origintrail-official/dkg-storage';
|
|
17
|
+
import { computeFlatKCRootV10 as computeFlatKCRoot, computePrivateRootV10 as computePrivateRoot, skolemizeKnowledgeAssetParts, assertNoKnowledgeAssetPayloadNamedGraphs, assertValidPrecomputedUpdateAttestation, isReservedSubject, canonicalPublishPayload, generatedPrivateCatalogTripleKeys, resolveKnowledgeAssetOperationPublicQuads, resolveKnowledgeAssetWorkspaceHead, workspaceHeadIncludesShareOperationId, KnowledgeAssetOperationPublicSnapshotNotFoundError, workspacePublicQuadsDigest, TripleStoreAsyncLiftPublisher, KA_ID_PRED, RESERVED_UAL_PRED, WM_CURRENT_ASSERTION_PRED, SWM_CURRENT_ASSERTION_PRED, VM_CURRENT_ASSERTION_PRED, createResolveCurrentWorkspaceGossipPayload, parseEncodedWorkspaceGossipPayload, } from '@origintrail-official/dkg-publisher';
|
|
18
18
|
import { pickPublishLifecycleHooks } from '@origintrail-official/dkg-publisher';
|
|
19
19
|
import { ethers } from 'ethers';
|
|
20
20
|
import { buildAuthoritativePublicMetaQuads } from './context-graph-public-meta-proof.js';
|
|
21
21
|
import { resolveFinalizedAssertionAuthor } from './finalized-assertion-author.js';
|
|
22
|
-
import { RootlessUpdateError } from './rootless-update-error.js';
|
|
22
|
+
import { RootlessUpdateError, isRootlessUpdateError } from './rootless-update-error.js';
|
|
23
23
|
import { emitPublicProjection, buildPublicProjection } from './context-graph-public-projection.js';
|
|
24
24
|
import { chooseFanOutTier, executeSubstrateFanOut, classifySendResult, } from './swm/substrate-fanout.js';
|
|
25
25
|
import { classifySwmFanoutPeerOutcome, } from './swm/swm-fanout-peer-selection.js';
|
|
26
|
-
import { KEEP_ROOT_COPY_PREDICATE } from './finalization-handler.js';
|
|
27
26
|
import { applyPublishedNamedKaVmLifecycle } from './named-ka-vm-lifecycle.js';
|
|
27
|
+
import { packKnowledgeAssetIdFromIdentity } from './ka-identity.js';
|
|
28
28
|
import { normalizeRecoveredNamedKaPublish, throwIfRecoveryDeadlineReached, } from './named-ka-publish-recovery.js';
|
|
29
29
|
import { stripLiteral, jsonLdToQuads, } from './dkg-agent-utils.js';
|
|
30
30
|
import { PRIVATE_DATA_ANCHOR, } from './dkg-agent-constants.js';
|
|
31
31
|
import { ContextGraphNotFoundError, InvalidContentError, } from './dkg-agent-types.js';
|
|
32
32
|
import { normalizePublishContextGraphId, isPublishAsyncQuadEnvelope, assertQuadArray, sliceIntoCiphertextChunks, } from './dkg-agent-helpers.js';
|
|
33
33
|
import { readMaxKaNumberWithRetry, isTransientChainError } from './allocator.js';
|
|
34
|
-
import { swmSenderStateKey, } from './dkg-agent-swm-state.js';
|
|
34
|
+
import { computeSwmSenderKeyRecipientRouteHash, swmSenderStateKey, } from './dkg-agent-swm-state.js';
|
|
35
35
|
import { DKGAgentBase } from './dkg-agent-base.js';
|
|
36
36
|
import { CONTEXT_GRAPH_AUTHORITY_RPC_SITES as CG_AUTH_RPC_SITES, withRpcUsageSite, } from '@origintrail-official/dkg-chain';
|
|
37
37
|
import { createLocalContextGraphOriginMembershipRecord } from './local-context-graph-provenance.js';
|
|
38
|
-
/** One operation discriminator shared by admission, sync, and queued execution. */
|
|
39
|
-
function planKnowledgeAssetVmPublication(input) {
|
|
40
|
-
if (input.vmCurrentAssertion) {
|
|
41
|
-
assertPublicationPricingPolicyApplicable(input.pricingPolicy, { kind: 'update' });
|
|
42
|
-
return { kind: 'update', vmCurrentAssertion: input.vmCurrentAssertion };
|
|
43
|
-
}
|
|
44
|
-
assertPublicationPricingPolicyApplicable(input.pricingPolicy, {
|
|
45
|
-
kind: 'initial',
|
|
46
|
-
graphScoped: true,
|
|
47
|
-
});
|
|
48
|
-
return { kind: 'initial', pricingPolicy: input.pricingPolicy };
|
|
49
|
-
}
|
|
50
|
-
/** Rebuild the immutable graph-scoped seal carried by one queued VM request. */
|
|
51
|
-
function assertionSealFromQueuedKnowledgeAssetVmPublishRequest(request) {
|
|
52
|
-
// Both execution boundaries validate the immutable graph-scoped envelope
|
|
53
|
-
// before calling this shared reconstruction helper.
|
|
54
|
-
const graphScope = createGraphKnowledgeAssetScope(request.kaUal, request.assertionVersion);
|
|
55
|
-
return {
|
|
56
|
-
merkleRoot: ethers.getBytes(request.seal.merkleRoot),
|
|
57
|
-
authorAddress: ethers.getAddress(request.seal.authorAddress),
|
|
58
|
-
authorAttestationR: ethers.getBytes(request.seal.signature.r),
|
|
59
|
-
authorAttestationVS: ethers.getBytes(request.seal.signature.vs),
|
|
60
|
-
authorSchemeVersion: request.seal.schemeVersion,
|
|
61
|
-
chainId: BigInt(request.sealChainId),
|
|
62
|
-
kav10Address: ethers.getAddress(request.sealKav10Address),
|
|
63
|
-
finalizedAtIso: request.sealFinalizedAtIso,
|
|
64
|
-
contentScopeVersion: GRAPH_KA_CONTENT_SCOPE_VERSION,
|
|
65
|
-
kaUal: graphScope.ual,
|
|
66
|
-
assertionVersion: graphScope.assertionVersion,
|
|
67
|
-
publicTripleCount: request.publicTripleCount,
|
|
68
|
-
...(request.privateMerkleRoot
|
|
69
|
-
? { privateMerkleRoot: ethers.getBytes(request.privateMerkleRoot) }
|
|
70
|
-
: {}),
|
|
71
|
-
privateTripleCount: request.privateTripleCount,
|
|
72
|
-
rootEntities: [],
|
|
73
|
-
...(request.seal.reservedKaId !== undefined
|
|
74
|
-
? { reservedKaId: BigInt(request.seal.reservedKaId) }
|
|
75
|
-
: {}),
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
/** Canonical immutable projection of the persisted queued-publish request. */
|
|
79
|
-
export function createKnowledgeAssetVmPublishIntentKey(request) {
|
|
80
|
-
const canonicalIntent = {
|
|
81
|
-
contextGraphId: request.contextGraphId,
|
|
82
|
-
name: request.name,
|
|
83
|
-
agentAddress: request.agentAddress ?? null,
|
|
84
|
-
subGraphName: request.subGraphName ?? null,
|
|
85
|
-
shareOperationId: request.shareOperationId,
|
|
86
|
-
roots: request.roots,
|
|
87
|
-
contentScopeVersion: request.contentScopeVersion ?? null,
|
|
88
|
-
kaUal: request.kaUal ?? null,
|
|
89
|
-
assertionVersion: request.assertionVersion ?? null,
|
|
90
|
-
publicTripleCount: request.publicTripleCount ?? null,
|
|
91
|
-
privateMerkleRoot: request.privateMerkleRoot?.toLowerCase() ?? null,
|
|
92
|
-
privateTripleCount: request.privateTripleCount ?? null,
|
|
93
|
-
accessPolicy: request.accessPolicy ?? null,
|
|
94
|
-
allowedPeers: request.allowedPeers ?? [],
|
|
95
|
-
entityProofs: request.entityProofs ?? null,
|
|
96
|
-
sealMerkleRoot: request.sealMerkleRoot.toLowerCase(),
|
|
97
|
-
seal: request.seal,
|
|
98
|
-
sealChainId: request.sealChainId,
|
|
99
|
-
sealKav10Address: request.sealKav10Address,
|
|
100
|
-
sealFinalizedAtIso: request.sealFinalizedAtIso,
|
|
101
|
-
wmCurrentAssertion: request.wmCurrentAssertion ?? null,
|
|
102
|
-
swmCurrentAssertion: request.swmCurrentAssertion ?? null,
|
|
103
|
-
vmCurrentAssertion: request.vmCurrentAssertion ?? null,
|
|
104
|
-
kaNumber: request.kaNumber ?? null,
|
|
105
|
-
reservedUal: request.reservedUal ?? null,
|
|
106
|
-
publishEpochs: request.publishEpochs ?? null,
|
|
107
|
-
// Keep the pre-feature canonical JSON unchanged when the policy is omitted.
|
|
108
|
-
...(request.pricingPolicy !== undefined
|
|
109
|
-
? { pricingPolicy: request.pricingPolicy }
|
|
110
|
-
: {}),
|
|
111
|
-
clearSharedMemoryAfter: request.clearSharedMemoryAfter ?? null,
|
|
112
|
-
publisherNodeIdentityIdOverride: request.publisherNodeIdentityIdOverride ?? null,
|
|
113
|
-
};
|
|
114
|
-
return `sha256:${createHash('sha256').update(JSON.stringify(canonicalIntent)).digest('hex')}`;
|
|
115
|
-
}
|
|
116
38
|
/**
|
|
117
39
|
* #1116 (round 11) — stable code tagged on the `assertionFinalize` throws that are
|
|
118
40
|
* recoverable SIGNING/CHAIN CAPABILITY GAPS (no local signing key, non-V10 chain
|
|
@@ -156,6 +78,24 @@ function updateAttestationNotCustodialError(authorAddress) {
|
|
|
156
78
|
function rootlessUpdateError(code, message) {
|
|
157
79
|
return new RootlessUpdateError(code, message);
|
|
158
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* GH#2958 — a finalized update numbered anything but `confirmed + 1` can never be published: the
|
|
83
|
+
* publisher, the StorageACK handler, peers and the chain all require exactly that number. Coded
|
|
84
|
+
* `PUBLISH_INTENT_STALE` (the draft no longer matches what can be published) so the async lane
|
|
85
|
+
* records a terminal pre-send failure instead of the retryable `rpc_unavailable` an untyped
|
|
86
|
+
* error falls into, and both publish routes answer 409. The recovery depends on which way the
|
|
87
|
+
* number is off: a draft numbered too high keeps its shared content, a draft numbered too low
|
|
88
|
+
* means the published version moved on, so it is re-based on that.
|
|
89
|
+
*/
|
|
90
|
+
function versionGapError(kaUal, sealVersion, requiredVersion) {
|
|
91
|
+
const sealed = BigInt(sealVersion);
|
|
92
|
+
const recovery = sealed > requiredVersion
|
|
93
|
+
? 'Re-open the draft with wm/pull-from (layer "swm" keeps the shared content), then finalize and share it again.'
|
|
94
|
+
: 'The published version has moved on since this draft was finalized: re-base it with wm/pull-from '
|
|
95
|
+
+ '(layer "vm"), re-apply your edits, then finalize and share it again.';
|
|
96
|
+
return Object.assign(new Error(`Cannot publish the update of ${kaUal}: this finalized version is numbered ${sealed}, but the next `
|
|
97
|
+
+ `publishable version is ${requiredVersion} (the confirmed version is ${requiredVersion - 1n}). ${recovery}`), { code: 'PUBLISH_INTENT_STALE' });
|
|
98
|
+
}
|
|
159
99
|
function latestShareOperationId(history) {
|
|
160
100
|
const promoted = [...history.events]
|
|
161
101
|
.reverse()
|
|
@@ -987,14 +927,25 @@ export class PublishMethods extends DKGAgentBase {
|
|
|
987
927
|
if (!opts?.localOnly && promoted.gossipPayload) {
|
|
988
928
|
await this.publishWorkspaceGossip(contextGraphId, promoted.gossipPayload, ctx, gossipSigner, promoted.shareOperationId);
|
|
989
929
|
}
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
930
|
+
try {
|
|
931
|
+
await this.afterDurableSwmPromotionV1({
|
|
932
|
+
contextGraphId,
|
|
933
|
+
subGraphName: opts?.subGraphName,
|
|
934
|
+
assertionCoordinate: assertionName,
|
|
935
|
+
lifecycleAgentAddress,
|
|
936
|
+
shareOperationId: promoted.shareOperationId,
|
|
937
|
+
ctx,
|
|
938
|
+
});
|
|
939
|
+
}
|
|
940
|
+
catch {
|
|
941
|
+
// Deliberately best-effort here (the stamp already logged its cause).
|
|
942
|
+
// This entry point mints a fresh `async-<uuid>` assertion per call, so
|
|
943
|
+
// surfacing the error would hand the caller a failure for a name it
|
|
944
|
+
// cannot replay, inviting a re-publish under a NEW identity. The VM
|
|
945
|
+
// publish queued below stamps `vmCurrentAssertion`, and an absent swm
|
|
946
|
+
// pointer is then the valid divergence-only shape (swm == vm).
|
|
947
|
+
// Named-KA shares (`assertion.promote`) do surface and replay the failure.
|
|
948
|
+
}
|
|
998
949
|
const intent = await this.resolveFinalizedAssertionVmPublishIntent(contextGraphId, assertionName, {
|
|
999
950
|
agentAddress: lifecycleAgentAddress,
|
|
1000
951
|
subGraphName: opts?.subGraphName,
|
|
@@ -1351,8 +1302,7 @@ export class PublishMethods extends DKGAgentBase {
|
|
|
1351
1302
|
}
|
|
1352
1303
|
if (opts.assertionVersion !== undefined
|
|
1353
1304
|
&& BigInt(opts.assertionVersion) !== BigInt(nextAssertionVersion)) {
|
|
1354
|
-
throw
|
|
1355
|
-
`the durable current version to ${nextAssertionVersion}`);
|
|
1305
|
+
throw versionGapError(updateScope.ual, opts.assertionVersion, BigInt(nextAssertionVersion));
|
|
1356
1306
|
}
|
|
1357
1307
|
if (opts.publicTripleCount !== undefined
|
|
1358
1308
|
&& opts.publicTripleCount !== canonicalParts.publicQuads.length) {
|
|
@@ -2242,6 +2192,18 @@ export class PublishMethods extends DKGAgentBase {
|
|
|
2242
2192
|
`KaNumberAllocator on the agent (daemon lifecycle) or supply a ` +
|
|
2243
2193
|
`preSignedAuthorAttestation whose reservedKaId lives in the author's namespace.`), { code: SEAL_CAPABILITY_GAP_CODE });
|
|
2244
2194
|
}
|
|
2195
|
+
// GH#2958 — a draft of a PUBLISHED KA is numbered from the confirmed record `update()` will
|
|
2196
|
+
// validate, not from the lifecycle counter. That counter is "last FINALIZED": it only ever
|
|
2197
|
+
// grows, so every finalized update that is abandoned before it is published (superseded,
|
|
2198
|
+
// discarded, replaced by pull-from) would push the next draft one number too high, past
|
|
2199
|
+
// what `update()`, the publisher and the chain accept, and the KA could never be updated
|
|
2200
|
+
// again. An abandoned draft instead shares its number with its successor, as an
|
|
2201
|
+
// unpublished mint already does. The lifecycle counter above stays the fallback for a
|
|
2202
|
+
// record that cannot answer. The number is not signed (the attestation binds merkleRoot,
|
|
2203
|
+
// author, reservedKaId and scheme), so deriving it here changes no signature.
|
|
2204
|
+
if (hasConfirmedVm) {
|
|
2205
|
+
assertionVersion = await this._nextUpdateVersionOrUndefined(reservedKaId, contextGraphId, opts?.subGraphName) ?? assertionVersion;
|
|
2206
|
+
}
|
|
2245
2207
|
// 8. Build EIP-712 typed data (binds reservedKaId — OT-RFC-43 §F2).
|
|
2246
2208
|
const typedData = buildAuthorAttestationTypedData({
|
|
2247
2209
|
chainId,
|
|
@@ -2752,12 +2714,21 @@ export class PublishMethods extends DKGAgentBase {
|
|
|
2752
2714
|
recipientKeyId: r.recipientKeyId,
|
|
2753
2715
|
})),
|
|
2754
2716
|
});
|
|
2717
|
+
const recipientRouteHash = computeSwmSenderKeyRecipientRouteHash({
|
|
2718
|
+
contextGraphId,
|
|
2719
|
+
subGraphName,
|
|
2720
|
+
recipients: resolution.recipients,
|
|
2721
|
+
});
|
|
2755
2722
|
const stateKey = swmSenderStateKey(contextGraphId, subGraphName, senderAddress);
|
|
2756
2723
|
let state = this.swmSenderKeySendStates.get(stateKey);
|
|
2757
|
-
if (!state
|
|
2724
|
+
if (!state
|
|
2725
|
+
|| state.membershipHash !== membershipHash
|
|
2726
|
+
|| state.recipientRouteHash !== recipientRouteHash) {
|
|
2758
2727
|
const reason = !state
|
|
2759
2728
|
? 'no persisted state'
|
|
2760
|
-
:
|
|
2729
|
+
: state.membershipHash !== membershipHash
|
|
2730
|
+
? `membership changed (was=${state.membershipHash} now=${membershipHash})`
|
|
2731
|
+
: `recipient routes changed (was=${state.recipientRouteHash ?? 'legacy-untracked'} now=${recipientRouteHash})`;
|
|
2761
2732
|
this.log.info(ctx, `${logPrefix}: bootstrapping/rotating swm-sender-key epoch for curated CG ${contextGraphId} ` +
|
|
2762
2733
|
`(sender=${senderAddress}, recipients=${resolution.recipients.length}, reason=${reason})`);
|
|
2763
2734
|
const pruned = this.prunePendingSenderKeysForEpochRotation({
|
|
@@ -2782,7 +2753,12 @@ export class PublishMethods extends DKGAgentBase {
|
|
|
2782
2753
|
await this.saveSwmSenderKeyState();
|
|
2783
2754
|
}
|
|
2784
2755
|
else {
|
|
2785
|
-
await this.drainPendingSenderKeyForRecipients(resolution.recipients, ctx
|
|
2756
|
+
await this.drainPendingSenderKeyForRecipients(resolution.recipients, ctx, {
|
|
2757
|
+
contextGraphId,
|
|
2758
|
+
subGraphName,
|
|
2759
|
+
senderAgentAddress: state.senderAgentAddress,
|
|
2760
|
+
epochId: state.epochId,
|
|
2761
|
+
});
|
|
2786
2762
|
}
|
|
2787
2763
|
return {
|
|
2788
2764
|
chainKey: state.chainKey,
|
|
@@ -3206,6 +3182,17 @@ export class PublishMethods extends DKGAgentBase {
|
|
|
3206
3182
|
throw Object.assign(new Error(`Cannot publish "${name}" asynchronously: the current SWM share has no sealed assertion pointer. ` +
|
|
3207
3183
|
`Finalize and share the full asset before publishing.`), { code: 'PUBLISH_INTENT_STALE' });
|
|
3208
3184
|
}
|
|
3185
|
+
if (operationPlan.kind === 'update') {
|
|
3186
|
+
// GH#2958 — refuse a finalized update `update()` is going to refuse, here, before a job
|
|
3187
|
+
// exists, so the client learns it at the moment it can act. Last, so every recovery this
|
|
3188
|
+
// error recommends (re-open from the shared copy) is possible whenever it is raised. A
|
|
3189
|
+
// confirmed record that cannot answer leaves the decision to `update()`.
|
|
3190
|
+
const sealScope = createGraphKnowledgeAssetScope(seal.kaUal, seal.assertionVersion);
|
|
3191
|
+
const requiredVersion = await this._nextUpdateVersionOrUndefined(packKnowledgeAssetIdFromIdentity(sealScope), contextGraphId, opts?.subGraphName);
|
|
3192
|
+
if (requiredVersion !== undefined && requiredVersion !== BigInt(seal.assertionVersion)) {
|
|
3193
|
+
throw versionGapError(seal.kaUal, seal.assertionVersion, requiredVersion);
|
|
3194
|
+
}
|
|
3195
|
+
}
|
|
3209
3196
|
const sealMerkleRoot = (merkleBare.startsWith('0x') ? merkleBare : `0x${merkleBare}`);
|
|
3210
3197
|
const queuedSeal = {
|
|
3211
3198
|
merkleRoot: ethers.hexlify(seal.merkleRoot),
|
|
@@ -3265,18 +3252,32 @@ export class PublishMethods extends DKGAgentBase {
|
|
|
3265
3252
|
intentKey: createKnowledgeAssetVmPublishIntentKey(request),
|
|
3266
3253
|
};
|
|
3267
3254
|
}
|
|
3255
|
+
/**
|
|
3256
|
+
* GH#2958 — the version a finalized update of this KA must carry, read from the SAME confirmed
|
|
3257
|
+
* record `update()` validates, so the number a draft is sealed with and the number `update()`
|
|
3258
|
+
* demands cannot disagree. `undefined` when that record cannot answer (not materialized here,
|
|
3259
|
+
* not confirmed yet, corrupt or legacy): the caller then falls back to its own rule. Anything
|
|
3260
|
+
* else (a store failure) propagates - a transient read error must never silently pick a number.
|
|
3261
|
+
*/
|
|
3262
|
+
async _nextUpdateVersionOrUndefined(kaId, contextGraphId, subGraphName) {
|
|
3263
|
+
try {
|
|
3264
|
+
const scope = await resolveDirectRootlessUpdateScope(this, this.chain.chainId, kaId, contextGraphId, subGraphName);
|
|
3265
|
+
return BigInt(scope.assertionVersion);
|
|
3266
|
+
}
|
|
3267
|
+
catch (err) {
|
|
3268
|
+
if (!isRootlessUpdateError(err) && !(err instanceof LegacyKnowledgeAssetReadOnlyError))
|
|
3269
|
+
throw err;
|
|
3270
|
+
this.log.debug(createOperationContext('publish'), `The confirmed record of KA ${kaId} cannot number its next update (${err.code}); using the lifecycle counter`);
|
|
3271
|
+
return undefined;
|
|
3272
|
+
}
|
|
3273
|
+
}
|
|
3268
3274
|
async preflightKnowledgeAssetVmPublishSnapshot(request) {
|
|
3269
3275
|
return preflightKnowledgeAssetVmPublishSnapshot({
|
|
3270
3276
|
store: this.store, publicSnapshotStore: this.publicSnapshotStore, log: this.log, request,
|
|
3271
3277
|
});
|
|
3272
3278
|
}
|
|
3273
3279
|
async preflightQueuedKnowledgeAssetVmPublishExecution(request, opts) {
|
|
3274
|
-
if (request
|
|
3275
|
-
|| request.kaUal === undefined
|
|
3276
|
-
|| request.assertionVersion === undefined
|
|
3277
|
-
|| request.publicTripleCount === undefined
|
|
3278
|
-
|| request.privateTripleCount === undefined
|
|
3279
|
-
|| request.roots.length !== 0) {
|
|
3280
|
+
if (!isGraphScopedKnowledgeAssetVmPublishRequest(request)) {
|
|
3280
3281
|
throw new LegacyKnowledgeAssetReadOnlyError();
|
|
3281
3282
|
}
|
|
3282
3283
|
createGraphKnowledgeAssetScope(request.kaUal, request.assertionVersion);
|
|
@@ -3359,10 +3360,10 @@ export class PublishMethods extends DKGAgentBase {
|
|
|
3359
3360
|
throw stale(`Knowledge asset VM publish intent for "${request.name}" changed after enqueue: ` +
|
|
3360
3361
|
'the immutable SWM access envelope no longer matches the queued request.');
|
|
3361
3362
|
}
|
|
3362
|
-
//
|
|
3363
|
-
//
|
|
3364
|
-
//
|
|
3365
|
-
//
|
|
3363
|
+
// The swm pointer is a divergence-only projection, and `publishAsync`
|
|
3364
|
+
// keeps its stamp best-effort. The lifecycle row can therefore be absent
|
|
3365
|
+
// even though the complete-share marker and immutable graph-scoped head
|
|
3366
|
+
// both committed. Absence alone is not proof that the queued content
|
|
3366
3367
|
// changed: the exact operation id, assertion version, access envelope and
|
|
3367
3368
|
// queued WM root above are the durable authority. A present-but-different
|
|
3368
3369
|
// SWM pointer remains terminally stale via the comparison above.
|
|
@@ -3463,12 +3464,7 @@ export class PublishMethods extends DKGAgentBase {
|
|
|
3463
3464
|
}
|
|
3464
3465
|
async _finalizeRecoveredQueuedKnowledgeAssetVmPublish(input, ctx) {
|
|
3465
3466
|
const { request, job, lookup, recovery, signal } = input;
|
|
3466
|
-
if (request
|
|
3467
|
-
|| request.kaUal === undefined
|
|
3468
|
-
|| request.assertionVersion === undefined
|
|
3469
|
-
|| request.publicTripleCount === undefined
|
|
3470
|
-
|| request.privateTripleCount === undefined
|
|
3471
|
-
|| request.roots.length !== 0) {
|
|
3467
|
+
if (!isGraphScopedKnowledgeAssetVmPublishRequest(request)) {
|
|
3472
3468
|
throw new LegacyKnowledgeAssetReadOnlyError();
|
|
3473
3469
|
}
|
|
3474
3470
|
const recovered = await normalizeRecoveredNamedKaPublish({
|
|
@@ -3676,11 +3672,7 @@ export class PublishMethods extends DKGAgentBase {
|
|
|
3676
3672
|
if (request.contentScopeVersion !== GRAPH_KA_CONTENT_SCOPE_VERSION) {
|
|
3677
3673
|
throw new LegacyKnowledgeAssetReadOnlyError();
|
|
3678
3674
|
}
|
|
3679
|
-
if (request
|
|
3680
|
-
|| request.kaUal === undefined
|
|
3681
|
-
|| request.assertionVersion === undefined
|
|
3682
|
-
|| request.publicTripleCount === undefined
|
|
3683
|
-
|| request.privateTripleCount === undefined) {
|
|
3675
|
+
if (!isGraphScopedKnowledgeAssetVmPublishRequest(request)) {
|
|
3684
3676
|
throw new Error('Queued graph-scoped VM publish has an incomplete KA content envelope');
|
|
3685
3677
|
}
|
|
3686
3678
|
const graphScope = createGraphKnowledgeAssetScope(request.kaUal, request.assertionVersion);
|
|
@@ -3770,12 +3762,14 @@ export class PublishMethods extends DKGAgentBase {
|
|
|
3770
3762
|
let result;
|
|
3771
3763
|
const clearPublishedGraph = async (label) => {
|
|
3772
3764
|
try {
|
|
3773
|
-
await publisher.clearPublishedKnowledgeAssetSwm(request.contextGraphId, sharedMemoryScope, request.subGraphName, ctx, graphScope.ual);
|
|
3765
|
+
await publisher.clearPublishedKnowledgeAssetSwm(request.contextGraphId, sharedMemoryScope, request.subGraphName, ctx, graphScope.ual, graphScope.assertionVersion);
|
|
3774
3766
|
}
|
|
3775
3767
|
catch (err) {
|
|
3776
3768
|
this.log.warn(ctx, `Failed to clear published SWM graph after confirmed queued ${label} of <${lifecycleUri}>: ` +
|
|
3777
3769
|
(err instanceof Error ? err.message : String(err)));
|
|
3770
|
+
return;
|
|
3778
3771
|
}
|
|
3772
|
+
await this.retireLegacySwmAfterConfirmedLocalPublish(request.contextGraphId, graphScope.ual, graphScope.assertionVersion, request.subGraphName, ctx);
|
|
3779
3773
|
};
|
|
3780
3774
|
const clearRemainingSharedMemory = async () => {
|
|
3781
3775
|
try {
|
|
@@ -4001,29 +3995,6 @@ export class PublishMethods extends DKGAgentBase {
|
|
|
4001
3995
|
catch {
|
|
4002
3996
|
this.log.warn(ctx, `No peers subscribed to ${topic} yet`);
|
|
4003
3997
|
}
|
|
4004
|
-
try {
|
|
4005
|
-
const gm = new GraphManager(this.store);
|
|
4006
|
-
const wsMetaGraph = request.subGraphName
|
|
4007
|
-
? gm.sharedMemoryMetaUri(request.contextGraphId, request.subGraphName)
|
|
4008
|
-
: contextGraphWorkspaceMetaGraphUri(request.contextGraphId);
|
|
4009
|
-
const keepLiteral = `"${keepRootCopyOnLabel}"`;
|
|
4010
|
-
for (const root of rootEntities.filter(isSafeIri)) {
|
|
4011
|
-
await deleteByPatternWithoutCount(this.store, {
|
|
4012
|
-
subject: root,
|
|
4013
|
-
predicate: KEEP_ROOT_COPY_PREDICATE,
|
|
4014
|
-
graph: wsMetaGraph,
|
|
4015
|
-
});
|
|
4016
|
-
await this.store.insert([{
|
|
4017
|
-
subject: root,
|
|
4018
|
-
predicate: KEEP_ROOT_COPY_PREDICATE,
|
|
4019
|
-
object: keepLiteral,
|
|
4020
|
-
graph: wsMetaGraph,
|
|
4021
|
-
}]);
|
|
4022
|
-
}
|
|
4023
|
-
}
|
|
4024
|
-
catch (err) {
|
|
4025
|
-
this.log.warn(ctx, `Failed to persist keepRootCopyOnLabel signal for ${result.ual}: ${err instanceof Error ? err.message : String(err)}`);
|
|
4026
|
-
}
|
|
4027
3998
|
}
|
|
4028
3999
|
if (result.status === 'confirmed') {
|
|
4029
4000
|
try {
|
|
@@ -4240,7 +4211,8 @@ export class PublishMethods extends DKGAgentBase {
|
|
|
4240
4211
|
// that mirrored the share), so SWM and VM permanently disagreed.
|
|
4241
4212
|
if (result.status === 'confirmed') {
|
|
4242
4213
|
try {
|
|
4243
|
-
await publisher.clearPublishedKnowledgeAssetSwm(contextGraphId, sharedMemoryScope, opts?.subGraphName, opts?.operationCtx ?? createOperationContext('publishFromSWM'), graphScope.ual);
|
|
4214
|
+
await publisher.clearPublishedKnowledgeAssetSwm(contextGraphId, sharedMemoryScope, opts?.subGraphName, opts?.operationCtx ?? createOperationContext('publishFromSWM'), graphScope.ual, graphScope.assertionVersion);
|
|
4215
|
+
await this.retireLegacySwmAfterConfirmedLocalPublish(contextGraphId, graphScope.ual, graphScope.assertionVersion, opts?.subGraphName, opts?.operationCtx ?? createOperationContext('publishFromSWM'));
|
|
4244
4216
|
}
|
|
4245
4217
|
catch (err) {
|
|
4246
4218
|
this.log.warn(opts?.operationCtx ?? createOperationContext('publishFromSWM'), `Failed to clear SWM after confirmed update of <${lifecycleUri}>: ` +
|
|
@@ -4506,6 +4478,21 @@ export class PublishMethods extends DKGAgentBase {
|
|
|
4506
4478
|
return;
|
|
4507
4479
|
await this.observeRfc64ConfirmedVmV1(input);
|
|
4508
4480
|
}
|
|
4481
|
+
/** The local confirmed publisher has already written VM and drained this exact SWM root. */
|
|
4482
|
+
async retireLegacySwmAfterConfirmedLocalPublish(contextGraphId, kaUal, assertionVersion, subGraphName, ctx) {
|
|
4483
|
+
try {
|
|
4484
|
+
await this.retireLegacySwmAfterVerifiedVmTwin({
|
|
4485
|
+
contextGraphId,
|
|
4486
|
+
kaUal,
|
|
4487
|
+
assertionVersion,
|
|
4488
|
+
subGraphName,
|
|
4489
|
+
});
|
|
4490
|
+
}
|
|
4491
|
+
catch (err) {
|
|
4492
|
+
this.log.warn(ctx, `Failed to retire the legacy SWM boundary after confirmed local VM publish: ` +
|
|
4493
|
+
(err instanceof Error ? err.message : String(err)));
|
|
4494
|
+
}
|
|
4495
|
+
}
|
|
4509
4496
|
/**
|
|
4510
4497
|
* OT-RFC-43 A2 — mint a `precomputedUpdateAttestation` over
|
|
4511
4498
|
* `UpdateAuthorAttestation(kaId, newMerkleRoot=seal.merkleRoot, author)` for
|
|
@@ -4620,10 +4607,16 @@ export class PublishMethods extends DKGAgentBase {
|
|
|
4620
4607
|
* OT-RFC-43 A2 (decision 2) — stamp `dkg:swmCurrentAssertion` on the
|
|
4621
4608
|
* lifecycle URN when an assertion is promoted/shared into SWM. The pointer
|
|
4622
4609
|
* value is the assertion's sealed merkle root hex (read from the seal on the
|
|
4623
|
-
* assertion-graph URI).
|
|
4624
|
-
*
|
|
4625
|
-
*
|
|
4626
|
-
*
|
|
4610
|
+
* assertion-graph URI). A missing seal (a non-finalized promote) leaves the
|
|
4611
|
+
* SWM pointer unset, which `deriveStatus` reads as "not yet wm-sealed for
|
|
4612
|
+
* SWM".
|
|
4613
|
+
*
|
|
4614
|
+
* A store failure is logged and RETHROWN. The SWM share already committed, so
|
|
4615
|
+
* the caller owns the classification: swallowing it here left a share that
|
|
4616
|
+
* reported success with a permanently missing root (GH#2901). The stamp is an
|
|
4617
|
+
* idempotent drop-then-set, so replaying the already-committed operation is
|
|
4618
|
+
* the repair. The drop and the set are two store calls: until that replay, a
|
|
4619
|
+
* failure between them leaves the committed share with no pointer.
|
|
4627
4620
|
*/
|
|
4628
4621
|
async _stampSwmPointer(contextGraphId, name, agentAddress, subGraphName) {
|
|
4629
4622
|
try {
|
|
@@ -4644,52 +4637,26 @@ export class PublishMethods extends DKGAgentBase {
|
|
|
4644
4637
|
catch (err) {
|
|
4645
4638
|
this.log.warn(createOperationContext('share'), `Failed to stamp swmCurrentAssertion for "${name}" in "${contextGraphId}": ` +
|
|
4646
4639
|
(err instanceof Error ? err.message : String(err)));
|
|
4640
|
+
throw err;
|
|
4647
4641
|
}
|
|
4648
4642
|
}
|
|
4649
|
-
/**
|
|
4650
|
-
* OT-RFC-49 legacy compatibility — ensure a curated CG's public `_catalog`
|
|
4651
|
-
* floor is in SWM for an arbitrary root-selected combined-model publish.
|
|
4652
|
-
*
|
|
4653
|
-
* New graph-scoped KAs never call this helper: they keep the catalog detached
|
|
4654
|
-
* from WM/SWM and derive its proof material at the publisher boundary. This
|
|
4655
|
-
* remains only for legacy selection-based publishes whose author seal and KC
|
|
4656
|
-
* root intentionally use the historical combined model.
|
|
4657
|
-
*
|
|
4658
|
-
* IDEMPOTENT: repeated insertion dedupes in the store/V10 Merkle path because
|
|
4659
|
-
* the floor is deterministic, so `catalogLeafCount` stays stable across
|
|
4660
|
-
* repeated legacy selection publishes.
|
|
4661
|
-
*
|
|
4662
|
-
* Returns a possibly-extended `selection`: for a `{rootEntities}` publish the
|
|
4663
|
-
* CG-DID catalog subject is appended so it is in scope for BOTH the author seal
|
|
4664
|
-
* (`_loadSelectedSWMQuads`) and the publisher's reload — which scope identically.
|
|
4665
|
-
* For `selection: 'all'` the selection is returned unchanged (both already read
|
|
4666
|
-
* the whole SWM graph). The generated floor is written into the same explicit
|
|
4667
|
-
* graph scope as the publish; otherwise an exact named-lifecycle read would
|
|
4668
|
-
* correctly exclude a floor left in the legacy bucket.
|
|
4669
|
-
*/
|
|
4670
|
-
async _ensureCuratedCatalogInSwm(contextGraphId, selection, subGraphName, ctx, scope = { kind: 'complete-family' }) {
|
|
4671
|
-
const swmGraph = contextGraphSharedMemoryUri(contextGraphId, subGraphName);
|
|
4672
|
-
const catalogTargetGraph = canonicalSharedMemoryScopeWriteGraph(swmGraph, scope);
|
|
4673
|
-
const cgDid = contextGraphDataUri(contextGraphId);
|
|
4674
|
-
const { quads: catalogQuads } = appendMissingGeneratedPrivateCatalogFloor(contextGraphId, [], catalogTargetGraph);
|
|
4675
|
-
await this.store.insert(catalogQuads);
|
|
4676
|
-
this.log.info(ctx, `OT-RFC-49: ensured ${catalogQuads.length}-quad public _catalog floor in SWM for curated CG ${contextGraphId} (from-SWM publish without finalize)`);
|
|
4677
|
-
if (selection !== 'all' && !selection.rootEntities.includes(cgDid)) {
|
|
4678
|
-
return { rootEntities: [...selection.rootEntities, cgDid] };
|
|
4679
|
-
}
|
|
4680
|
-
return selection;
|
|
4681
|
-
}
|
|
4682
4643
|
/**
|
|
4683
4644
|
* Publish shared memory content: read from SWM graph and publish with full finality (data graph + chain).
|
|
4684
4645
|
* After on-chain confirmation, broadcasts a lightweight FinalizationMessage so peers with matching
|
|
4685
4646
|
* SWM state can promote it to canonical without re-downloading the full payload.
|
|
4686
4647
|
*
|
|
4687
|
-
*
|
|
4688
|
-
*
|
|
4689
|
-
*
|
|
4690
|
-
*
|
|
4691
|
-
*
|
|
4692
|
-
*
|
|
4648
|
+
* The publish must be graph-scoped (`contentScopeVersion`, `kaUal`,
|
|
4649
|
+
* `assertionVersion`): a call without that scope is refused with
|
|
4650
|
+
* `LegacyKnowledgeAssetReadOnlyError`. `publishFromFinalizedAssertion`
|
|
4651
|
+
* supplies the scope from the finalized seal and is the entry point for
|
|
4652
|
+
* callers that hold a named assertion.
|
|
4653
|
+
*
|
|
4654
|
+
* #1116 (round 9) — INTENTIONALLY NOT marker-gated. This is the internal
|
|
4655
|
+
* substrate entry (#1087): without a precomputed seal it mints a FRESH inline
|
|
4656
|
+
* seal over the selected slice rather than consuming a finalized named
|
|
4657
|
+
* lifecycle, so the swmShareComplete full-share invariant does not apply. The
|
|
4658
|
+
* marker gate lives on `publishFromFinalizedAssertion` (the named-lifecycle
|
|
4659
|
+
* /vm/publish path) only.
|
|
4693
4660
|
*/
|
|
4694
4661
|
async publishFromSharedMemory(contextGraphId, selection, options) {
|
|
4695
4662
|
return withSpan('agent.publish_from_swm', async (span) => {
|
|
@@ -4704,6 +4671,16 @@ export class PublishMethods extends DKGAgentBase {
|
|
|
4704
4671
|
...(chainId ? { 'dkg.chain_id': chainId } : {}),
|
|
4705
4672
|
});
|
|
4706
4673
|
const ctx = options?.operationCtx ?? createOperationContext('publishFromSWM');
|
|
4674
|
+
// A publish names the Knowledge Asset's own graph. Root-entity Knowledge
|
|
4675
|
+
// Assets are read-only: peers finalize nothing else, and a Core keeps no
|
|
4676
|
+
// copy of such a publish that it could promote.
|
|
4677
|
+
if (options?.contentScopeVersion !== GRAPH_KA_CONTENT_SCOPE_VERSION) {
|
|
4678
|
+
const scopeVersion = options?.contentScopeVersion;
|
|
4679
|
+
if (scopeVersion === undefined || scopeVersion === 0 || scopeVersion === 1) {
|
|
4680
|
+
throw new LegacyKnowledgeAssetReadOnlyError();
|
|
4681
|
+
}
|
|
4682
|
+
throw new Error(`Unsupported KA content scope version ${scopeVersion}`);
|
|
4683
|
+
}
|
|
4707
4684
|
const effectiveSubCG = options?.subContextGraphId ?? options?.contextGraphId;
|
|
4708
4685
|
// `ctxGraphIdStr` doubles as `publishContextGraphId` for REMAP-flow
|
|
4709
4686
|
// publishes — the publisher uses its presence as a signal to DELETE the
|
|
@@ -4712,17 +4689,6 @@ export class PublishMethods extends DKGAgentBase {
|
|
|
4712
4689
|
const ctxGraphIdStr = effectiveSubCG != null ? String(effectiveSubCG) : undefined;
|
|
4713
4690
|
const onChainId = ctxGraphIdStr ?? (await this.getContextGraphOnChainId(contextGraphId)) ?? undefined;
|
|
4714
4691
|
const v10ACKProvider = this.createV10ACKProvider(contextGraphId);
|
|
4715
|
-
// OT-RFC-49 catalog handling differs by content model. Legacy arbitrary
|
|
4716
|
-
// SWM selections retain their combined-model floor injection. A V2 named
|
|
4717
|
-
// lifecycle carries only the trusted floor capability: the publisher
|
|
4718
|
-
// derives a detached catalog commitment without altering the exact KA
|
|
4719
|
-
// graph or its author seal.
|
|
4720
|
-
const graphScopedPublish = options?.contentScopeVersion === GRAPH_KA_CONTENT_SCOPE_VERSION;
|
|
4721
|
-
let localTrustedNonManifestCatalogTriples;
|
|
4722
|
-
if (!graphScopedPublish && onChainId != null && (await this.isPrivateContextGraph(contextGraphId))) {
|
|
4723
|
-
localTrustedNonManifestCatalogTriples = generatedPrivateCatalogTripleKeys(contextGraphId);
|
|
4724
|
-
selection = await this._ensureCuratedCatalogInSwm(contextGraphId, selection, options?.subGraphName, ctx, options?.sharedMemoryScope);
|
|
4725
|
-
}
|
|
4726
4692
|
// RFC-001 §9.x — selection-based publish bridge. If the caller
|
|
4727
4693
|
// already sealed the content (named-assertion lifecycle) they
|
|
4728
4694
|
// pass `precomputedAttestation` through and we forward verbatim.
|
|
@@ -4748,7 +4714,7 @@ export class PublishMethods extends DKGAgentBase {
|
|
|
4748
4714
|
...(options?.schemeVersion !== undefined
|
|
4749
4715
|
? { schemeVersion: options.schemeVersion }
|
|
4750
4716
|
: {}),
|
|
4751
|
-
graphScoped:
|
|
4717
|
+
graphScoped: true,
|
|
4752
4718
|
});
|
|
4753
4719
|
}
|
|
4754
4720
|
}
|
|
@@ -4781,17 +4747,16 @@ export class PublishMethods extends DKGAgentBase {
|
|
|
4781
4747
|
this.log.info(ctx, `LU-11: curated CG ${contextGraphId} — chunked path active (per-chunk SWM gossip + V2 ACK)`);
|
|
4782
4748
|
}
|
|
4783
4749
|
// V2 curation is decided by the live chain-aware encryption resolver, not
|
|
4784
|
-
// by a second local `_meta` read.
|
|
4785
|
-
//
|
|
4786
|
-
//
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
: localTrustedNonManifestCatalogTriples;
|
|
4750
|
+
// by a second local `_meta` read. The publish carries the detached catalog
|
|
4751
|
+
// (OT-RFC-49) whenever the exact same operation was resolved as curated:
|
|
4752
|
+
// the publisher derives its commitment without altering the exact KA graph
|
|
4753
|
+
// or its author seal.
|
|
4754
|
+
const trustedNonManifestCatalogTriples = resolveCuratedV2CatalogCapability({
|
|
4755
|
+
contextGraphId,
|
|
4756
|
+
graphScoped: true,
|
|
4757
|
+
onChainContextGraphId: onChainId,
|
|
4758
|
+
encryptInlinePayload,
|
|
4759
|
+
});
|
|
4795
4760
|
const publisher = options?.publisherOverride ?? this.publisher;
|
|
4796
4761
|
const result = await publisher.publishFromSharedMemory(contextGraphId, selection, {
|
|
4797
4762
|
operationCtx: ctx,
|
|
@@ -4820,6 +4785,11 @@ export class PublishMethods extends DKGAgentBase {
|
|
|
4820
4785
|
encryptInlinePayload,
|
|
4821
4786
|
encryptInlineChunked,
|
|
4822
4787
|
});
|
|
4788
|
+
if (result.status === 'confirmed'
|
|
4789
|
+
&& options?.kaUal !== undefined
|
|
4790
|
+
&& options.assertionVersion !== undefined) {
|
|
4791
|
+
await this.retireLegacySwmAfterConfirmedLocalPublish(contextGraphId, options.kaUal, String(options.assertionVersion), options.subGraphName, ctx);
|
|
4792
|
+
}
|
|
4823
4793
|
span.setAttribute('dkg.publish_status', result.status);
|
|
4824
4794
|
if (result.status === 'failed') {
|
|
4825
4795
|
span.setStatus({ code: SpanStatusCode.ERROR });
|
|
@@ -4871,19 +4841,15 @@ export class PublishMethods extends DKGAgentBase {
|
|
|
4871
4841
|
targetContextGraphId: result.contextGraphError ? undefined : broadcastCgId,
|
|
4872
4842
|
subGraphName: options?.subGraphName,
|
|
4873
4843
|
keepRootCopyOnLabel,
|
|
4874
|
-
|
|
4875
|
-
|
|
4876
|
-
|
|
4877
|
-
|
|
4878
|
-
|
|
4879
|
-
...(options.privateMerkleRoot
|
|
4880
|
-
? { privateMerkleRoot: options.privateMerkleRoot }
|
|
4881
|
-
: {}),
|
|
4882
|
-
privateTripleCount: options.privateTripleCount ?? 0,
|
|
4883
|
-
accessPolicy: result.accessPolicy ?? 'ownerOnly',
|
|
4884
|
-
allowedPeers: result.allowedPeers ?? [],
|
|
4885
|
-
}
|
|
4844
|
+
contentScopeVersion: GRAPH_KA_CONTENT_SCOPE_VERSION,
|
|
4845
|
+
assertionVersion: String(options.assertionVersion),
|
|
4846
|
+
publicTripleCount: options.publicTripleCount ?? 0,
|
|
4847
|
+
...(options.privateMerkleRoot
|
|
4848
|
+
? { privateMerkleRoot: options.privateMerkleRoot }
|
|
4886
4849
|
: {}),
|
|
4850
|
+
privateTripleCount: options.privateTripleCount ?? 0,
|
|
4851
|
+
accessPolicy: result.accessPolicy ?? 'ownerOnly',
|
|
4852
|
+
allowedPeers: result.allowedPeers ?? [],
|
|
4887
4853
|
};
|
|
4888
4854
|
const topic = contextGraphFinalizationTopic(contextGraphId);
|
|
4889
4855
|
try {
|
|
@@ -4893,38 +4859,6 @@ export class PublishMethods extends DKGAgentBase {
|
|
|
4893
4859
|
catch {
|
|
4894
4860
|
this.log.warn(ctx, `No peers subscribed to ${topic} yet`);
|
|
4895
4861
|
}
|
|
4896
|
-
// Durable keep-root signal. The gossip envelope's `keepRootCopyOnLabel`
|
|
4897
|
-
// only reaches peers online for the broadcast; a subscriber that missed
|
|
4898
|
-
// it later recovers the publish via the chain-driven reconcile sweep,
|
|
4899
|
-
// which has no wire to learn the dual-write intent from. Persist the same
|
|
4900
|
-
// decision per root into SWM workspace meta — co-located with the per-root
|
|
4901
|
-
// `privateMerkleRoot` that already replicates to subscribers — so the
|
|
4902
|
-
// reconcile path can mirror the gossip dual-write decision. Read back by
|
|
4903
|
-
// `FinalizationHandler.getKeepRootCopySignal`. Updates reuse a root
|
|
4904
|
-
// entity, so replace any prior value rather than accumulate.
|
|
4905
|
-
try {
|
|
4906
|
-
const gm = new GraphManager(this.store);
|
|
4907
|
-
const wsMetaGraph = options?.subGraphName
|
|
4908
|
-
? gm.sharedMemoryMetaUri(contextGraphId, options.subGraphName)
|
|
4909
|
-
: contextGraphWorkspaceMetaGraphUri(contextGraphId);
|
|
4910
|
-
const keepLiteral = `"${keepRootCopyOnLabel}"`;
|
|
4911
|
-
for (const root of rootEntities.filter(isSafeIri)) {
|
|
4912
|
-
await deleteByPatternWithoutCount(this.store, {
|
|
4913
|
-
subject: root,
|
|
4914
|
-
predicate: KEEP_ROOT_COPY_PREDICATE,
|
|
4915
|
-
graph: wsMetaGraph,
|
|
4916
|
-
});
|
|
4917
|
-
await this.store.insert([{
|
|
4918
|
-
subject: root,
|
|
4919
|
-
predicate: KEEP_ROOT_COPY_PREDICATE,
|
|
4920
|
-
object: keepLiteral,
|
|
4921
|
-
graph: wsMetaGraph,
|
|
4922
|
-
}]);
|
|
4923
|
-
}
|
|
4924
|
-
}
|
|
4925
|
-
catch (err) {
|
|
4926
|
-
this.log.warn(ctx, `Failed to persist keepRootCopyOnLabel signal for ${result.ual}: ${err instanceof Error ? err.message : String(err)}`);
|
|
4927
|
-
}
|
|
4928
4862
|
}
|
|
4929
4863
|
recordPublishOutcome(result.status, 'swm', publishStartedAt, chainId);
|
|
4930
4864
|
return result;
|