@origintrail-official/dkg-agent 10.0.19 → 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/confirmed-graph-scoped-vm-resolver.d.ts +7 -1
- package/dist/confirmed-graph-scoped-vm-resolver.d.ts.map +1 -1
- package/dist/confirmed-graph-scoped-vm-resolver.js +5 -3
- package/dist/confirmed-graph-scoped-vm-resolver.js.map +1 -1
- package/dist/context-graph-authority-dependency.d.ts +11 -0
- package/dist/context-graph-authority-dependency.d.ts.map +1 -0
- package/dist/context-graph-authority-dependency.js +50 -0
- package/dist/context-graph-authority-dependency.js.map +1 -0
- package/dist/context-graph-binding-state.d.ts +6 -0
- package/dist/context-graph-binding-state.d.ts.map +1 -1
- package/dist/context-graph-binding-state.js +17 -10
- package/dist/context-graph-binding-state.js.map +1 -1
- package/dist/context-graph-claim-proof.d.ts +74 -0
- package/dist/context-graph-claim-proof.d.ts.map +1 -0
- package/dist/context-graph-claim-proof.js +137 -0
- package/dist/context-graph-claim-proof.js.map +1 -0
- package/dist/context-graph-member-proof.d.ts +33 -0
- package/dist/context-graph-member-proof.d.ts.map +1 -0
- package/dist/context-graph-member-proof.js +142 -0
- package/dist/context-graph-member-proof.js.map +1 -0
- 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-confirmation.d.ts +22 -2
- package/dist/context-graph-meta-confirmation.d.ts.map +1 -1
- package/dist/context-graph-meta-confirmation.js +54 -23
- package/dist/context-graph-meta-confirmation.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-metadata-relocation.d.ts +18 -30
- package/dist/context-graph-metadata-relocation.d.ts.map +1 -1
- package/dist/context-graph-metadata-relocation.js +32 -2
- package/dist/context-graph-metadata-relocation.js.map +1 -1
- package/dist/context-graph-private-meta-proof.d.ts +8 -9
- package/dist/context-graph-private-meta-proof.d.ts.map +1 -1
- package/dist/context-graph-private-meta-proof.js +25 -89
- package/dist/context-graph-private-meta-proof.js.map +1 -1
- package/dist/context-graph-public-meta-proof.d.ts +11 -1
- package/dist/context-graph-public-meta-proof.d.ts.map +1 -1
- package/dist/context-graph-public-meta-proof.js +23 -3
- package/dist/context-graph-public-meta-proof.js.map +1 -1
- package/dist/context-graph-read-authority.d.ts +30 -3
- package/dist/context-graph-read-authority.d.ts.map +1 -1
- package/dist/context-graph-read-authority.js +62 -18
- package/dist/context-graph-read-authority.js.map +1 -1
- package/dist/context-graph-storage-discovery.d.ts +14 -4
- package/dist/context-graph-storage-discovery.d.ts.map +1 -1
- package/dist/context-graph-storage-discovery.js +27 -7
- package/dist/context-graph-storage-discovery.js.map +1 -1
- package/dist/context-graph-subscription-authority-recovery.d.ts +7 -0
- package/dist/context-graph-subscription-authority-recovery.d.ts.map +1 -1
- package/dist/context-graph-subscription-authority-recovery.js +1 -0
- package/dist/context-graph-subscription-authority-recovery.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 +18 -4
- package/dist/curator-meta-refresh.d.ts.map +1 -1
- package/dist/curator-meta-refresh.js +61 -58
- 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-agents-phonebook.d.ts +41 -0
- package/dist/dkg-agent-agents-phonebook.d.ts.map +1 -0
- package/dist/dkg-agent-agents-phonebook.js +155 -0
- package/dist/dkg-agent-agents-phonebook.js.map +1 -0
- package/dist/dkg-agent-base.d.ts +162 -24
- package/dist/dkg-agent-base.d.ts.map +1 -1
- package/dist/dkg-agent-base.js +175 -147
- package/dist/dkg-agent-base.js.map +1 -1
- package/dist/dkg-agent-cg-chain-observation.d.ts +6 -1
- package/dist/dkg-agent-cg-chain-observation.d.ts.map +1 -1
- package/dist/dkg-agent-cg-chain-observation.js +20 -5
- package/dist/dkg-agent-cg-chain-observation.js.map +1 -1
- package/dist/dkg-agent-cg-name-resolution.d.ts +38 -2
- package/dist/dkg-agent-cg-name-resolution.d.ts.map +1 -1
- package/dist/dkg-agent-cg-name-resolution.js +100 -8
- package/dist/dkg-agent-cg-name-resolution.js.map +1 -1
- package/dist/dkg-agent-cg-registry.d.ts +43 -3
- package/dist/dkg-agent-cg-registry.d.ts.map +1 -1
- package/dist/dkg-agent-cg-registry.js +267 -129
- 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 +40 -18
- package/dist/dkg-agent-cg-resolve.js.map +1 -1
- package/dist/dkg-agent-constants.d.ts +10 -2
- package/dist/dkg-agent-constants.d.ts.map +1 -1
- package/dist/dkg-agent-constants.js +10 -2
- package/dist/dkg-agent-constants.js.map +1 -1
- package/dist/dkg-agent-context-graph.d.ts.map +1 -1
- package/dist/dkg-agent-context-graph.js +1 -5
- package/dist/dkg-agent-context-graph.js.map +1 -1
- package/dist/dkg-agent-crypto.d.ts +128 -21
- package/dist/dkg-agent-crypto.d.ts.map +1 -1
- package/dist/dkg-agent-crypto.js +824 -176
- package/dist/dkg-agent-crypto.js.map +1 -1
- package/dist/dkg-agent-diagnostics.d.ts.map +1 -1
- package/dist/dkg-agent-diagnostics.js +4 -3
- package/dist/dkg-agent-diagnostics.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 +129 -22
- package/dist/dkg-agent-lifecycle.d.ts.map +1 -1
- package/dist/dkg-agent-lifecycle.js +690 -211
- 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 +194 -281
- 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 +102 -86
- 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 +87 -80
- package/dist/dkg-agent-rfc64-catalog.d.ts.map +1 -1
- package/dist/dkg-agent-rfc64-catalog.js +726 -476
- package/dist/dkg-agent-rfc64-catalog.js.map +1 -1
- package/dist/dkg-agent-rfc64-meta-bootstrap.d.ts +6 -1
- package/dist/dkg-agent-rfc64-meta-bootstrap.d.ts.map +1 -1
- package/dist/dkg-agent-rfc64-meta-bootstrap.js +29 -13
- package/dist/dkg-agent-rfc64-meta-bootstrap.js.map +1 -1
- package/dist/dkg-agent-rfc64-swm-catalog-projection-supervisor.d.ts +8 -0
- package/dist/dkg-agent-rfc64-swm-catalog-projection-supervisor.d.ts.map +1 -1
- package/dist/dkg-agent-rfc64-swm-catalog-projection-supervisor.js +249 -40
- package/dist/dkg-agent-rfc64-swm-catalog-projection-supervisor.js.map +1 -1
- package/dist/dkg-agent-rfc64-swm-catalog-projection.d.ts.map +1 -1
- package/dist/dkg-agent-rfc64-swm-catalog-projection.js +3 -2
- package/dist/dkg-agent-rfc64-swm-catalog-projection.js.map +1 -1
- package/dist/dkg-agent-swm-host.d.ts +217 -52
- package/dist/dkg-agent-swm-host.d.ts.map +1 -1
- package/dist/dkg-agent-swm-host.js +1305 -858
- 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 +49 -8
- package/dist/dkg-agent-swm-substrate.d.ts.map +1 -1
- package/dist/dkg-agent-swm-substrate.js +219 -46
- package/dist/dkg-agent-swm-substrate.js.map +1 -1
- package/dist/dkg-agent-types.d.ts +86 -27
- 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 +4 -0
- package/dist/dkg-agent-vm-promotion.d.ts.map +1 -1
- package/dist/dkg-agent-vm-promotion.js +40 -5
- package/dist/dkg-agent-vm-promotion.js.map +1 -1
- package/dist/dkg-agent-vm-reconcile-scheduling.d.ts +7 -0
- package/dist/dkg-agent-vm-reconcile-scheduling.d.ts.map +1 -1
- package/dist/dkg-agent-vm-reconcile-scheduling.js +18 -0
- package/dist/dkg-agent-vm-reconcile-scheduling.js.map +1 -1
- package/dist/dkg-agent.d.ts +31 -2
- package/dist/dkg-agent.d.ts.map +1 -1
- package/dist/dkg-agent.js +188 -72
- 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 +26 -211
- package/dist/finalization-handler.d.ts.map +1 -1
- package/dist/finalization-handler.js +94 -1652
- package/dist/finalization-handler.js.map +1 -1
- package/dist/finalization-recovery-sqlite-displacement.d.ts +37 -0
- package/dist/finalization-recovery-sqlite-displacement.d.ts.map +1 -0
- package/dist/finalization-recovery-sqlite-displacement.js +102 -0
- package/dist/finalization-recovery-sqlite-displacement.js.map +1 -0
- package/dist/finalization-recovery-sqlite-policy.d.ts +20 -4
- package/dist/finalization-recovery-sqlite-policy.d.ts.map +1 -1
- package/dist/finalization-recovery-sqlite-policy.js +21 -5
- package/dist/finalization-recovery-sqlite-policy.js.map +1 -1
- package/dist/finalization-recovery-sqlite-rows.d.ts +53 -0
- package/dist/finalization-recovery-sqlite-rows.d.ts.map +1 -0
- package/dist/finalization-recovery-sqlite-rows.js +77 -0
- package/dist/finalization-recovery-sqlite-rows.js.map +1 -0
- package/dist/finalization-recovery-sqlite-store.d.ts +10 -4
- package/dist/finalization-recovery-sqlite-store.d.ts.map +1 -1
- package/dist/finalization-recovery-sqlite-store.js +49 -50
- package/dist/finalization-recovery-sqlite-store.js.map +1 -1
- package/dist/finalization-recovery-store.d.ts +18 -0
- package/dist/finalization-recovery-store.d.ts.map +1 -1
- package/dist/finalization-recovery-store.js +24 -0
- package/dist/finalization-recovery-store.js.map +1 -1
- package/dist/finalization-recovery-worker.js +1 -1
- package/dist/finalization-recovery-worker.js.map +1 -1
- package/dist/finalization-recovery.d.ts +2 -3
- package/dist/finalization-recovery.d.ts.map +1 -1
- package/dist/finalization-recovery.js +12 -9
- package/dist/finalization-recovery.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-publish-handler.d.ts.map +1 -1
- package/dist/gossip-publish-handler.js +4 -2
- package/dist/gossip-publish-handler.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 +4 -1
- 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/approved-member-acceptance.d.ts +61 -0
- package/dist/internal/context-graph-authority/approved-member-acceptance.d.ts.map +1 -0
- package/dist/internal/context-graph-authority/approved-member-acceptance.js +75 -0
- package/dist/internal/context-graph-authority/approved-member-acceptance.js.map +1 -0
- 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/context-graph-authority.d.ts +1 -0
- package/dist/internal/context-graph-authority/context-graph-authority.d.ts.map +1 -1
- package/dist/internal/context-graph-authority/context-graph-authority.js +25 -0
- package/dist/internal/context-graph-authority/context-graph-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 +84 -0
- package/dist/internal/context-graph-authority/swm-transport-authority.d.ts.map +1 -0
- package/dist/internal/context-graph-authority/swm-transport-authority.js +175 -0
- package/dist/internal/context-graph-authority/swm-transport-authority.js.map +1 -0
- 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 +79 -22
- 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/p2p/peer-connect.d.ts +10 -1
- package/dist/p2p/peer-connect.d.ts.map +1 -1
- package/dist/p2p/peer-connect.js +11 -2
- package/dist/p2p/peer-connect.js.map +1 -1
- package/dist/p2p/peer-selection.d.ts +8 -0
- package/dist/p2p/peer-selection.d.ts.map +1 -1
- package/dist/p2p/peer-selection.js +21 -12
- package/dist/p2p/peer-selection.js.map +1 -1
- package/dist/p2p/protocol-readiness.d.ts +3 -3
- package/dist/p2p/protocol-readiness.d.ts.map +1 -1
- package/dist/p2p/protocol-readiness.js +4 -3
- package/dist/p2p/protocol-readiness.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 +19 -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/applied-catalog-authority-transition-v1.d.ts.map +1 -1
- package/dist/rfc64/applied-catalog-authority-transition-v1.js +15 -17
- package/dist/rfc64/applied-catalog-authority-transition-v1.js.map +1 -1
- 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 +12 -13
- package/dist/rfc64/catalog-operational-applied-heads-v1.d.ts.map +1 -1
- package/dist/rfc64/catalog-operational-applied-heads-v1.js +17 -52
- 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-repair-diagnostics-v1.d.ts +28 -0
- package/dist/rfc64/catalog-repair-diagnostics-v1.d.ts.map +1 -0
- package/dist/rfc64/catalog-repair-diagnostics-v1.js +93 -0
- package/dist/rfc64/catalog-repair-diagnostics-v1.js.map +1 -0
- package/dist/rfc64/catalog-repair-retry-v1.d.ts +13 -0
- package/dist/rfc64/catalog-repair-retry-v1.d.ts.map +1 -0
- package/dist/rfc64/catalog-repair-retry-v1.js +39 -0
- package/dist/rfc64/catalog-repair-retry-v1.js.map +1 -0
- package/dist/rfc64/catalog-replay-recovery-runtime-v1.d.ts +52 -0
- package/dist/rfc64/catalog-replay-recovery-runtime-v1.d.ts.map +1 -1
- package/dist/rfc64/catalog-replay-recovery-runtime-v1.js +188 -32
- package/dist/rfc64/catalog-replay-recovery-runtime-v1.js.map +1 -1
- package/dist/rfc64/catalog-replay-snapshot-runtime-v1.d.ts +2 -8
- package/dist/rfc64/catalog-replay-snapshot-runtime-v1.d.ts.map +1 -1
- package/dist/rfc64/catalog-replay-snapshot-runtime-v1.js +10 -37
- package/dist/rfc64/catalog-replay-snapshot-runtime-v1.js.map +1 -1
- package/dist/rfc64/catalog-rollout-authority-v1.d.ts +13 -0
- package/dist/rfc64/catalog-rollout-authority-v1.d.ts.map +1 -1
- package/dist/rfc64/catalog-rollout-authority-v1.js +11 -0
- package/dist/rfc64/catalog-rollout-authority-v1.js.map +1 -1
- package/dist/rfc64/catalog-row-authorship.d.ts +12 -0
- package/dist/rfc64/catalog-row-authorship.d.ts.map +1 -1
- package/dist/rfc64/catalog-row-authorship.js +110 -57
- package/dist/rfc64/catalog-row-authorship.js.map +1 -1
- package/dist/rfc64/inventory-v1/candidate.d.ts +31 -10
- package/dist/rfc64/inventory-v1/candidate.d.ts.map +1 -1
- package/dist/rfc64/inventory-v1/candidate.js +51 -16
- package/dist/rfc64/inventory-v1/candidate.js.map +1 -1
- package/dist/rfc64/inventory-v1/index.d.ts +1 -1
- package/dist/rfc64/inventory-v1/index.d.ts.map +1 -1
- package/dist/rfc64/inventory-v1/index.js +1 -1
- package/dist/rfc64/inventory-v1/index.js.map +1 -1
- package/dist/rfc64/inventory-v1/open.d.ts.map +1 -1
- package/dist/rfc64/inventory-v1/open.js +7 -4
- package/dist/rfc64/inventory-v1/open.js.map +1 -1
- package/dist/rfc64/inventory-v1/swm-author-inventory-persistence.d.ts +3 -1
- package/dist/rfc64/inventory-v1/swm-author-inventory-persistence.d.ts.map +1 -1
- package/dist/rfc64/inventory-v1/swm-author-inventory-persistence.js +15 -0
- package/dist/rfc64/inventory-v1/swm-author-inventory-persistence.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/public-catalog-native-receiver-v1.d.ts.map +1 -1
- package/dist/rfc64/public-catalog-native-receiver-v1.js +26 -21
- package/dist/rfc64/public-catalog-native-receiver-v1.js.map +1 -1
- package/dist/rfc64/public-catalog-native-reconciler-v1.d.ts +17 -11
- package/dist/rfc64/public-catalog-native-reconciler-v1.d.ts.map +1 -1
- package/dist/rfc64/public-catalog-native-reconciler-v1.js +10 -8
- package/dist/rfc64/public-catalog-native-reconciler-v1.js.map +1 -1
- package/dist/rfc64/public-catalog-receiver-v1.d.ts +9 -0
- package/dist/rfc64/public-catalog-receiver-v1.d.ts.map +1 -1
- package/dist/rfc64/public-catalog-receiver-v1.js +11 -2
- package/dist/rfc64/public-catalog-receiver-v1.js.map +1 -1
- package/dist/rfc64/public-catalog-service-v1.d.ts.map +1 -1
- package/dist/rfc64/public-catalog-service-v1.js +21 -22
- package/dist/rfc64/public-catalog-service-v1.js.map +1 -1
- package/dist/rfc64/public-catalog-successor-producer-v1.d.ts.map +1 -1
- package/dist/rfc64/public-catalog-successor-producer-v1.js +5 -4
- package/dist/rfc64/public-catalog-successor-producer-v1.js.map +1 -1
- 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-catalog-durable-asset-resolver-v1.d.ts.map +1 -1
- package/dist/rfc64/swm-catalog-durable-asset-resolver-v1.js +60 -53
- package/dist/rfc64/swm-catalog-durable-asset-resolver-v1.js.map +1 -1
- package/dist/rfc64/swm-inventory-catalog-reconciler-v1.d.ts +2 -1
- package/dist/rfc64/swm-inventory-catalog-reconciler-v1.d.ts.map +1 -1
- package/dist/rfc64/swm-inventory-catalog-reconciler-v1.js +44 -4
- package/dist/rfc64/swm-inventory-catalog-reconciler-v1.js.map +1 -1
- 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-asset-fetch.d.ts +22 -0
- package/dist/sync/exact-asset-fetch.d.ts.map +1 -1
- package/dist/sync/exact-asset-fetch.js +30 -3
- package/dist/sync/exact-asset-fetch.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/on-connect/sync-on-connect.d.ts +1 -1
- package/dist/sync/on-connect/sync-on-connect.d.ts.map +1 -1
- package/dist/sync/on-connect/sync-on-connect.js +3 -3
- package/dist/sync/on-connect/sync-on-connect.js.map +1 -1
- package/dist/sync/on-demand-agents-phonebook.d.ts +162 -0
- package/dist/sync/on-demand-agents-phonebook.d.ts.map +1 -0
- package/dist/sync/on-demand-agents-phonebook.js +571 -0
- package/dist/sync/on-demand-agents-phonebook.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 +61 -27
- 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 +26 -1
- package/dist/sync/responder/sync-handler.d.ts.map +1 -1
- package/dist/sync/responder/sync-handler.js +107 -58
- 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/system-context-graph-policy.d.ts +10 -0
- package/dist/sync/system-context-graph-policy.d.ts.map +1 -1
- package/dist/sync/system-context-graph-policy.js +11 -0
- package/dist/sync/system-context-graph-policy.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-publish-snapshot-preflight.d.ts +13 -0
- package/dist/vm-publish-snapshot-preflight.d.ts.map +1 -0
- package/dist/vm-publish-snapshot-preflight.js +94 -0
- package/dist/vm-publish-snapshot-preflight.js.map +1 -0
- 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/dist/vm-refresh.d.ts +138 -0
- package/dist/vm-refresh.d.ts.map +1 -0
- package/dist/vm-refresh.js +201 -0
- package/dist/vm-refresh.js.map +1 -0
- package/package.json +19 -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
|
@@ -16,10 +16,15 @@
|
|
|
16
16
|
* Gate-1 boundary: staging a fetched head is the terminal step. Nothing here
|
|
17
17
|
* admits candidate rows or activates KA / SWM / VM state.
|
|
18
18
|
*/
|
|
19
|
-
import {
|
|
19
|
+
import { Rfc64CatalogTargetTrackerV1, rfc64CatalogTargetExactIdentityKeyV1 } from './rfc64/catalog-operational-targets-v1.js';
|
|
20
|
+
import { evaluateRfc64CatalogCompletionV1 } from './rfc64/catalog-completion-evidence-v1.js';
|
|
21
|
+
export { RFC64_CATALOG_TARGET_MAX_ENTRIES_V1, RFC64_CATALOG_TARGET_MAX_CONTEXT_OVERFLOWS_V1, Rfc64CatalogTargetTrackerV1, rfc64CatalogTargetExactIdentityKeyV1, projectRfc64OperationalRowCountsV1 } from './rfc64/catalog-operational-targets-v1.js';
|
|
22
|
+
import { SYSTEM_CONTEXT_GRAPHS, DKGEvent, ZERO_DIGEST32_V1, MAX_AUTHOR_CATALOG_BUCKET_ROWS_V1, contextGraphDataGraphUri, contextGraphMetaGraphUri, assertContextGraphIdV1, assertNetworkIdV1, assertSignedAuthorCatalogBucketEnvelopeV1, assertSignedAuthorCatalogDirectoryNodeEnvelopeV1, assertSignedAuthorCatalogHeadEnvelopeV1, assertSignedAuthorCatalogIssuerDelegationEnvelopeV1, computeAuthorCatalogScopeDigestV1, computeControlSignatureVariantDigestHex, createOperationContext, deriveAuthorCatalogScopeFromHeadV1, } from '@origintrail-official/dkg-core';
|
|
20
23
|
import { assertContextGraphAuthorityIndexId, resolveRpcUrls, verifyControlEnvelopeIssuerSignatureV1, withRpcRequestContext, } from '@origintrail-official/dkg-chain';
|
|
21
24
|
import { ethers } from 'ethers';
|
|
22
25
|
import { DKGAgentBase } from './dkg-agent-base.js';
|
|
26
|
+
import { resolveChainFinalityConfirmationsV1 } from './chain-finality-confirmations-v1.js';
|
|
27
|
+
import { isApprovedPrivateReplicaDelegationActive, resolveApprovedPrivateReplicaAuthority, } from './approved-private-replica.js';
|
|
23
28
|
import { Rfc64CatalogReplayConnectionRuntimeV1, } from './rfc64/catalog-replay-connection-runtime-v1.js';
|
|
24
29
|
import { Rfc64CatalogReplayRecoveryRuntimeV1, } from './rfc64/catalog-replay-recovery-runtime-v1.js';
|
|
25
30
|
export { RFC64_CATALOG_TARGET_MAX_ENTRIES_PER_CONTEXT_GRAPH_V1 } from './rfc64/catalog-limits-v1.js';
|
|
@@ -34,12 +39,15 @@ import { createRfc64CatalogAppliedHeadCoordinatorV1, } from './rfc64/catalog-app
|
|
|
34
39
|
import { reduceRfc64CatalogSynchronizationEvidenceReplayV1, snapshotRfc64CatalogSynchronizationEvidenceV1, } from './rfc64/catalog-synchronization-evidence-v1.js';
|
|
35
40
|
import { createRfc64BoundedPublicRootCatalogNativeReconcilerV1, createRfc64VerifiedStagedCatalogHeadMemoV1, } from './rfc64/public-catalog-native-reconciler-v1.js';
|
|
36
41
|
import { loadRfc64OperationalAppliedHeadsV1, rfc64CatalogTargetScopeKeyV1, } from './rfc64/catalog-operational-applied-heads-v1.js';
|
|
42
|
+
import { groupRfc64OperationalAppliedHeadsV1, loadRfc64OperationalPromisedRowCountsV1 } from './rfc64/catalog-operational-reads-v1.js';
|
|
43
|
+
import { verifyPrivateCatalogSubscriptionReadinessV1 } from './rfc64/private-catalog-subscription-readiness-v1.js';
|
|
37
44
|
import { Rfc64PublicCatalogSuccessorProducerV1, } from './rfc64/public-catalog-successor-producer-v1.js';
|
|
38
|
-
import { RFC64_PUBLIC_CATALOG_HEAD_ANNOUNCEMENT_KIND_V1, Rfc64PublicCatalogTransportErrorV1, } from './rfc64/public-catalog-transport-v1.js';
|
|
45
|
+
import { RFC64_PUBLIC_CATALOG_HEAD_ANNOUNCEMENT_KIND_V1, RFC64_PUBLIC_CATALOG_HEAD_REPLAY_KIND_V1, Rfc64PublicCatalogTransportErrorV1, } from './rfc64/public-catalog-transport-v1.js';
|
|
39
46
|
import { createRfc64CatalogNativeScopedReadProviderV1 } from './rfc64/catalog-native-scoped-read-provider-v1.js';
|
|
40
47
|
import { projectRfc64CatalogReceiverAuthorityV1, resolveRfc64CatalogResponsibilityAuthorityV1, } from './rfc64/public-catalog-activation-config-v1.js';
|
|
41
48
|
import { Rfc64CatalogResponsibilityRegistryV1, resolveRfc64CatalogResponsibilityReasonV1, } from './rfc64/catalog-responsibility-registry-v1.js';
|
|
42
|
-
import { rfc64CatalogResponsibilityOwnsAuthorityWorkloadV1, } from './rfc64/catalog-rollout-authority-v1.js';
|
|
49
|
+
import { projectRfc64CatalogTransportStateV1, rfc64CatalogResponsibilityOwnsAuthorityWorkloadV1, } from './rfc64/catalog-rollout-authority-v1.js';
|
|
50
|
+
import { isRfc64AuthorityRpcCircuitOpenErrorV1, } from './rfc64/authority-rpc-circuit-breaker-v1.js';
|
|
43
51
|
import { composeRfc64FinalizedCatalogAuthorityV1, composeRfc64RegisteredRosterVersionV1, composeRfc64UnregisteredCatalogAuthorityV1, parseRfc64AuthoritySnapshotV1, } from './rfc64/release-native-catalog-authority-v1.js';
|
|
44
52
|
import { acquireRfc64LegacySwmBoundaryReceiverLeaseV1, readRfc64LegacySwmBoundaryCountV1, } from './rfc64/legacy-swm-boundary-v1.js';
|
|
45
53
|
import { Rfc64CatalogReplaySnapshotRuntimeV1, } from './rfc64/catalog-replay-snapshot-runtime-v1.js';
|
|
@@ -49,15 +57,6 @@ import { isRfc64SharedStorePressureFailureV1, } from './rfc64/catalog-authority-
|
|
|
49
57
|
import { loadRfc64UnregisteredReplicaAuthorityV1 } from './rfc64/unregistered-replica-authority-v1.js';
|
|
50
58
|
const RFC64_PRIVATE_ROSTER_VERSION_PREDICATE_V1 = 'https://dkg.network/ontology#rfc64RosterVersion';
|
|
51
59
|
const RFC64_PRIVATE_ROSTER_VERSION_RADIX_V1 = 10000000000000n;
|
|
52
|
-
function groupRfc64OperationalAppliedHeadsV1(heads) {
|
|
53
|
-
const byContextGraph = new Map();
|
|
54
|
-
for (const head of heads) {
|
|
55
|
-
const grouped = byContextGraph.get(head.contextGraphId) ?? [];
|
|
56
|
-
grouped.push(head);
|
|
57
|
-
byContextGraph.set(head.contextGraphId, grouped);
|
|
58
|
-
}
|
|
59
|
-
return byContextGraph;
|
|
60
|
-
}
|
|
61
60
|
export { RFC64_PUBLIC_CATALOG_RECONCILIATION_FAILURE_MAX_ENTRIES_V1, Rfc64CatalogReconciliationTerminalErrorV1, } from './rfc64/public-catalog-reconciliation-failure-v1.js';
|
|
62
61
|
export { snapshotRfc64CatalogAccessPolicyAuthorityV1, snapshotRfc64CatalogDeploymentProfileV1, snapshotRfc64PublicCatalogAutoPublishConfigV1, snapshotRfc64PublicCatalogBootstrapConfigV1, } from './rfc64/catalog-authority-config-v1.js';
|
|
63
62
|
import { CONTEXT_GRAPH_AUTHORITY_RPC_SITES as CG_AUTH_RPC_SITES, withRpcUsageSite, } from '@origintrail-official/dkg-chain';
|
|
@@ -67,6 +66,14 @@ const rfc64CatalogAuthorityProgressV1 = new WeakMap();
|
|
|
67
66
|
const rfc64CatalogAuthorityRevisionsV1 = new WeakMap();
|
|
68
67
|
const rfc64AuthorityAcceptedCatchupTimersV1 = new WeakMap();
|
|
69
68
|
const rfc64DirectAcceptedCompatibilityV1 = new WeakMap();
|
|
69
|
+
/**
|
|
70
|
+
* Context graphs whose accepted policy was composed from a private join
|
|
71
|
+
* approval rather than from owner-signed or finalized evidence. The approval
|
|
72
|
+
* proof is time-limited and bound to one request generation, so this
|
|
73
|
+
* authority may run catalog responsibility but never stands in for the live
|
|
74
|
+
* proof on reads or shared-memory access.
|
|
75
|
+
*/
|
|
76
|
+
const rfc64JoinDerivedAcceptedAuthorityV1 = new WeakMap();
|
|
70
77
|
const rfc64ResponsibilityAuthorityBatchRuntimesV1 = new WeakMap();
|
|
71
78
|
const rfc64ScheduledResponsibilityStatesV1 = new WeakMap();
|
|
72
79
|
const rfc64SystemContextGraphIdsV1 = new Set(Object.values(SYSTEM_CONTEXT_GRAPHS));
|
|
@@ -86,15 +93,50 @@ const RFC64_AUTHORITY_CATALOG_RECOVERY_RETRY_DELAYS_MS_V1 = Object.freeze([
|
|
|
86
93
|
1_000,
|
|
87
94
|
4_000,
|
|
88
95
|
]);
|
|
96
|
+
/**
|
|
97
|
+
* A join-approved replica can accept its policy before its providers have the
|
|
98
|
+
* roster that names it. Only that replica keeps asking for this long.
|
|
99
|
+
*/
|
|
100
|
+
const RFC64_JOIN_DERIVED_CATALOG_RECOVERY_RETRY_DELAYS_MS_V1 = Object.freeze([
|
|
101
|
+
...RFC64_AUTHORITY_CATALOG_RECOVERY_RETRY_DELAYS_MS_V1,
|
|
102
|
+
15_000,
|
|
103
|
+
30_000,
|
|
104
|
+
60_000,
|
|
105
|
+
120_000,
|
|
106
|
+
240_000,
|
|
107
|
+
]);
|
|
108
|
+
const RFC64_JOIN_APPROVAL_CATALOG_REPLAY_RETRY_DELAYS_MS_V1 = Object.freeze([
|
|
109
|
+
5_000,
|
|
110
|
+
15_000,
|
|
111
|
+
30_000,
|
|
112
|
+
60_000,
|
|
113
|
+
]);
|
|
114
|
+
/**
|
|
115
|
+
* Waits before an authority snapshot is composed again after local authority
|
|
116
|
+
* facts moved under the previous composition. The first retry is immediate;
|
|
117
|
+
* the later ones outlast the burst of local writes a join or a publish makes.
|
|
118
|
+
*/
|
|
119
|
+
export const RFC64_AUTHORITY_FACTS_MOVED_RETRY_DELAYS_MS_V1 = Object.freeze([
|
|
120
|
+
0,
|
|
121
|
+
50,
|
|
122
|
+
200,
|
|
123
|
+
500,
|
|
124
|
+
1_000,
|
|
125
|
+
2_000,
|
|
126
|
+
]);
|
|
89
127
|
const RFC64_CATALOG_REPLAY_MAX_QUEUED_V1 = 64;
|
|
90
128
|
const RFC64_CATALOG_REPLAY_MAX_QUEUED_PER_PEER_V1 = 4;
|
|
91
|
-
export const RFC64_CATALOG_TARGET_MAX_ENTRIES_V1 = 1_024;
|
|
92
|
-
export const RFC64_CATALOG_TARGET_MAX_CONTEXT_OVERFLOWS_V1 = 64;
|
|
93
129
|
function isRfc64ActiveRegisteredSubscriptionV1(subscription) {
|
|
94
130
|
return subscription?.subscribed === true
|
|
95
131
|
&& subscription.onChainId !== undefined
|
|
96
132
|
&& subscription.onChainHash !== undefined;
|
|
97
133
|
}
|
|
134
|
+
/** A private join has no numeric binding while its signed _meta catches up. */
|
|
135
|
+
function isRfc64LocalJoinIntentUnregisteredSubscriptionV1(hasLocalJoinIntent, subscription) {
|
|
136
|
+
return subscription?.subscribed === true
|
|
137
|
+
&& subscription.onChainId === undefined
|
|
138
|
+
&& hasLocalJoinIntent;
|
|
139
|
+
}
|
|
98
140
|
/**
|
|
99
141
|
* Construct the complete retry identity once so dispatcher-key uniqueness,
|
|
100
142
|
* the revision fence, attempt, and delay cannot drift at separate call sites.
|
|
@@ -125,294 +167,6 @@ const rfc64CatalogReplayRuntimesV1 = new WeakMap();
|
|
|
125
167
|
const rfc64CatalogReplaySnapshotRuntimesV1 = new WeakMap();
|
|
126
168
|
const rfc64CatalogReplayConnectionRuntimesV1 = new WeakMap();
|
|
127
169
|
const rfc64CatalogReplayRecoveryRuntimesV1 = new WeakMap();
|
|
128
|
-
/** Process-local, bounded operational targets; semantic truth remains the durable inventory. */
|
|
129
|
-
export class Rfc64CatalogTargetTrackerV1 {
|
|
130
|
-
#byContextGraph = new Map();
|
|
131
|
-
#contextGraphOverflows = new Map();
|
|
132
|
-
#contextEpochs = new Map();
|
|
133
|
-
#globalOverflow = null;
|
|
134
|
-
#size = 0;
|
|
135
|
-
get size() {
|
|
136
|
-
return this.#size;
|
|
137
|
-
}
|
|
138
|
-
targetsForContextGraph(contextGraphId) {
|
|
139
|
-
return Object.freeze([...this.#byContextGraph.get(contextGraphId)?.values() ?? []]
|
|
140
|
-
.map(({ announcement }) => announcement));
|
|
141
|
-
}
|
|
142
|
-
hasTerminalFailure(announcement) {
|
|
143
|
-
const entry = this.#byContextGraph
|
|
144
|
-
.get(announcement.contextGraphId)
|
|
145
|
-
?.get(rfc64CatalogTargetScopeKeyV1(announcement));
|
|
146
|
-
return entry !== undefined
|
|
147
|
-
&& rfc64CatalogTargetExactIdentityV1(entry.announcement, announcement)
|
|
148
|
-
&& entry.terminalFailure;
|
|
149
|
-
}
|
|
150
|
-
capacityExceededForContextGraph(contextGraphId) {
|
|
151
|
-
return this.#globalOverflow !== null
|
|
152
|
-
|| this.#contextGraphOverflows.has(contextGraphId);
|
|
153
|
-
}
|
|
154
|
-
/** Invalidate every outstanding lease and release all process-local target evidence. */
|
|
155
|
-
resetAll() {
|
|
156
|
-
for (const contextEpoch of this.#contextEpochs.values())
|
|
157
|
-
contextEpoch.valid = false;
|
|
158
|
-
this.#contextEpochs.clear();
|
|
159
|
-
this.#byContextGraph.clear();
|
|
160
|
-
this.#contextGraphOverflows.clear();
|
|
161
|
-
this.#globalOverflow = null;
|
|
162
|
-
this.#size = 0;
|
|
163
|
-
}
|
|
164
|
-
clearContextGraph(contextGraphId) {
|
|
165
|
-
const byScope = this.#byContextGraph.get(contextGraphId);
|
|
166
|
-
const contextEpoch = this.#contextEpochs.get(contextGraphId);
|
|
167
|
-
if (contextEpoch !== undefined) {
|
|
168
|
-
contextEpoch.valid = false;
|
|
169
|
-
this.#contextEpochs.delete(contextGraphId);
|
|
170
|
-
}
|
|
171
|
-
this.#contextGraphOverflows.delete(contextGraphId);
|
|
172
|
-
if (this.#globalOverflow !== null) {
|
|
173
|
-
for (const [identity, witness] of this.#globalOverflow.failureWitnesses) {
|
|
174
|
-
if (witness.contextGraphId === contextGraphId) {
|
|
175
|
-
this.#globalOverflow.failureWitnesses.delete(identity);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
this.#globalOverflow.saturatedContextGraphs.delete(contextGraphId);
|
|
179
|
-
this.#finishOverflowIfResolved(this.#globalOverflow, null);
|
|
180
|
-
}
|
|
181
|
-
if (byScope !== undefined) {
|
|
182
|
-
this.#byContextGraph.delete(contextGraphId);
|
|
183
|
-
this.#size -= byScope.size;
|
|
184
|
-
}
|
|
185
|
-
this.#promoteOverflowWitnesses();
|
|
186
|
-
return byScope?.size ?? 0;
|
|
187
|
-
}
|
|
188
|
-
begin(announcement) {
|
|
189
|
-
const existingByScope = this.#byContextGraph.get(announcement.contextGraphId);
|
|
190
|
-
const key = rfc64CatalogTargetScopeKeyV1(announcement);
|
|
191
|
-
const previous = existingByScope?.get(key);
|
|
192
|
-
let contextEpoch = this.#contextEpochs.get(announcement.contextGraphId);
|
|
193
|
-
if (contextEpoch === undefined) {
|
|
194
|
-
contextEpoch = { valid: true, activeLeases: 0 };
|
|
195
|
-
this.#contextEpochs.set(announcement.contextGraphId, contextEpoch);
|
|
196
|
-
}
|
|
197
|
-
contextEpoch.activeLeases += 1;
|
|
198
|
-
const lease = (disposition, overflow = null) => Object.freeze({
|
|
199
|
-
announcement,
|
|
200
|
-
disposition,
|
|
201
|
-
state: { active: true, contextEpoch, overflow },
|
|
202
|
-
});
|
|
203
|
-
if (previous !== undefined
|
|
204
|
-
&& BigInt(announcement.catalogVersion)
|
|
205
|
-
< BigInt(previous.announcement.catalogVersion))
|
|
206
|
-
return lease('covered');
|
|
207
|
-
if (previous === undefined
|
|
208
|
-
&& (existingByScope?.size ?? 0)
|
|
209
|
-
>= RFC64_CATALOG_TARGET_MAX_ENTRIES_PER_CONTEXT_GRAPH_V1) {
|
|
210
|
-
const overflow = this.#beginContextGraphOverflow(announcement.contextGraphId);
|
|
211
|
-
return lease(overflow.disposition, overflow.overflow);
|
|
212
|
-
}
|
|
213
|
-
if (previous === undefined && this.#size >= RFC64_CATALOG_TARGET_MAX_ENTRIES_V1) {
|
|
214
|
-
this.#globalOverflow ??= this.#createOverflow();
|
|
215
|
-
this.#globalOverflow.active += 1;
|
|
216
|
-
return lease('global-capacity', this.#globalOverflow);
|
|
217
|
-
}
|
|
218
|
-
let byScope = existingByScope;
|
|
219
|
-
if (byScope === undefined) {
|
|
220
|
-
byScope = new Map();
|
|
221
|
-
this.#byContextGraph.set(announcement.contextGraphId, byScope);
|
|
222
|
-
}
|
|
223
|
-
byScope.set(key, { announcement, terminalFailure: false });
|
|
224
|
-
if (previous === undefined)
|
|
225
|
-
this.#size += 1;
|
|
226
|
-
return lease('tracked');
|
|
227
|
-
}
|
|
228
|
-
reject(announcement) {
|
|
229
|
-
const lease = this.begin(announcement);
|
|
230
|
-
this.settle(lease, 'dropped');
|
|
231
|
-
return lease;
|
|
232
|
-
}
|
|
233
|
-
settle(lease, outcome) {
|
|
234
|
-
if (!lease.state.active)
|
|
235
|
-
return;
|
|
236
|
-
lease.state.active = false;
|
|
237
|
-
const { contextEpoch } = lease.state;
|
|
238
|
-
contextEpoch.activeLeases = Math.max(0, contextEpoch.activeLeases - 1);
|
|
239
|
-
if (contextEpoch.activeLeases === 0
|
|
240
|
-
&& this.#contextEpochs.get(lease.announcement.contextGraphId) === contextEpoch)
|
|
241
|
-
this.#contextEpochs.delete(lease.announcement.contextGraphId);
|
|
242
|
-
const overflow = lease.state.overflow;
|
|
243
|
-
if (!contextEpoch.valid) {
|
|
244
|
-
if (overflow !== null) {
|
|
245
|
-
overflow.active = Math.max(0, overflow.active - 1);
|
|
246
|
-
if (this.#globalOverflow === overflow) {
|
|
247
|
-
this.#finishOverflowIfResolved(overflow, null);
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
return;
|
|
251
|
-
}
|
|
252
|
-
const resolved = outcome === 'already-applied'
|
|
253
|
-
|| outcome === 'applied'
|
|
254
|
-
|| outcome === 'closed'
|
|
255
|
-
|| outcome === 'staged-only';
|
|
256
|
-
if (lease.disposition === 'tracked') {
|
|
257
|
-
if (resolved)
|
|
258
|
-
this.retire(lease.announcement);
|
|
259
|
-
else
|
|
260
|
-
this.#markTerminalFailure(lease.announcement);
|
|
261
|
-
return;
|
|
262
|
-
}
|
|
263
|
-
if (lease.disposition === 'covered')
|
|
264
|
-
return;
|
|
265
|
-
if (overflow === null
|
|
266
|
-
|| (lease.disposition === 'context-capacity'
|
|
267
|
-
? this.#contextGraphOverflows.get(lease.announcement.contextGraphId) !== overflow
|
|
268
|
-
: this.#globalOverflow !== overflow))
|
|
269
|
-
return;
|
|
270
|
-
overflow.active = Math.max(0, overflow.active - 1);
|
|
271
|
-
const exactIdentity = rfc64CatalogTargetExactIdentityKeyV1(lease.announcement);
|
|
272
|
-
if (resolved) {
|
|
273
|
-
overflow.failureWitnesses.delete(exactIdentity);
|
|
274
|
-
}
|
|
275
|
-
else if (!overflow.failureWitnesses.has(exactIdentity)) {
|
|
276
|
-
if (overflow.failureWitnesses.size
|
|
277
|
-
>= RFC64_CATALOG_TARGET_MAX_ENTRIES_PER_CONTEXT_GRAPH_V1)
|
|
278
|
-
this.#markOverflowSaturated(overflow, lease.announcement.contextGraphId);
|
|
279
|
-
else
|
|
280
|
-
overflow.failureWitnesses.set(exactIdentity, lease.announcement);
|
|
281
|
-
}
|
|
282
|
-
this.#finishOverflowIfResolved(overflow, lease.disposition === 'context-capacity'
|
|
283
|
-
? lease.announcement.contextGraphId
|
|
284
|
-
: null);
|
|
285
|
-
}
|
|
286
|
-
retire(announcement) {
|
|
287
|
-
const byScope = this.#byContextGraph.get(announcement.contextGraphId);
|
|
288
|
-
const key = rfc64CatalogTargetScopeKeyV1(announcement);
|
|
289
|
-
const current = byScope?.get(key);
|
|
290
|
-
let retired = false;
|
|
291
|
-
if (current !== undefined
|
|
292
|
-
&& rfc64CatalogTargetExactIdentityV1(current.announcement, announcement)) {
|
|
293
|
-
byScope.delete(key);
|
|
294
|
-
this.#size -= 1;
|
|
295
|
-
if (byScope.size === 0)
|
|
296
|
-
this.#byContextGraph.delete(announcement.contextGraphId);
|
|
297
|
-
retired = true;
|
|
298
|
-
}
|
|
299
|
-
const exactIdentity = rfc64CatalogTargetExactIdentityKeyV1(announcement);
|
|
300
|
-
const contextOverflow = this.#contextGraphOverflows.get(announcement.contextGraphId);
|
|
301
|
-
if (contextOverflow?.failureWitnesses.delete(exactIdentity) === true) {
|
|
302
|
-
this.#finishOverflowIfResolved(contextOverflow, announcement.contextGraphId);
|
|
303
|
-
retired = true;
|
|
304
|
-
}
|
|
305
|
-
if (this.#globalOverflow?.failureWitnesses.delete(exactIdentity) === true) {
|
|
306
|
-
this.#finishOverflowIfResolved(this.#globalOverflow, null);
|
|
307
|
-
retired = true;
|
|
308
|
-
}
|
|
309
|
-
this.#promoteOverflowWitnesses();
|
|
310
|
-
return retired;
|
|
311
|
-
}
|
|
312
|
-
#markTerminalFailure(announcement) {
|
|
313
|
-
const entry = this.#byContextGraph
|
|
314
|
-
.get(announcement.contextGraphId)
|
|
315
|
-
?.get(rfc64CatalogTargetScopeKeyV1(announcement));
|
|
316
|
-
if (entry !== undefined
|
|
317
|
-
&& rfc64CatalogTargetExactIdentityV1(entry.announcement, announcement))
|
|
318
|
-
entry.terminalFailure = true;
|
|
319
|
-
}
|
|
320
|
-
#beginContextGraphOverflow(contextGraphId) {
|
|
321
|
-
let overflow = this.#contextGraphOverflows.get(contextGraphId);
|
|
322
|
-
if (overflow === undefined) {
|
|
323
|
-
if (this.#contextGraphOverflows.size
|
|
324
|
-
>= RFC64_CATALOG_TARGET_MAX_CONTEXT_OVERFLOWS_V1) {
|
|
325
|
-
this.#globalOverflow ??= this.#createOverflow();
|
|
326
|
-
this.#globalOverflow.active += 1;
|
|
327
|
-
return Object.freeze({
|
|
328
|
-
disposition: 'global-capacity',
|
|
329
|
-
overflow: this.#globalOverflow,
|
|
330
|
-
});
|
|
331
|
-
}
|
|
332
|
-
overflow = this.#createOverflow();
|
|
333
|
-
this.#contextGraphOverflows.set(contextGraphId, overflow);
|
|
334
|
-
}
|
|
335
|
-
overflow.active += 1;
|
|
336
|
-
return Object.freeze({ disposition: 'context-capacity', overflow });
|
|
337
|
-
}
|
|
338
|
-
#createOverflow() {
|
|
339
|
-
return {
|
|
340
|
-
active: 0,
|
|
341
|
-
failureWitnesses: new Map(),
|
|
342
|
-
saturatedContextGraphs: new Set(),
|
|
343
|
-
unattributedSaturation: false,
|
|
344
|
-
};
|
|
345
|
-
}
|
|
346
|
-
#markOverflowSaturated(overflow, contextGraphId) {
|
|
347
|
-
if (overflow.saturatedContextGraphs.has(contextGraphId))
|
|
348
|
-
return;
|
|
349
|
-
if (overflow.saturatedContextGraphs.size
|
|
350
|
-
>= RFC64_CATALOG_TARGET_MAX_CONTEXT_OVERFLOWS_V1) {
|
|
351
|
-
overflow.unattributedSaturation = true;
|
|
352
|
-
return;
|
|
353
|
-
}
|
|
354
|
-
overflow.saturatedContextGraphs.add(contextGraphId);
|
|
355
|
-
}
|
|
356
|
-
#finishOverflowIfResolved(overflow, contextGraphId) {
|
|
357
|
-
if (overflow.active > 0)
|
|
358
|
-
return;
|
|
359
|
-
if (overflow.failureWitnesses.size === 0
|
|
360
|
-
&& overflow.saturatedContextGraphs.size === 0
|
|
361
|
-
&& !overflow.unattributedSaturation) {
|
|
362
|
-
if (contextGraphId === null)
|
|
363
|
-
this.#globalOverflow = null;
|
|
364
|
-
else
|
|
365
|
-
this.#contextGraphOverflows.delete(contextGraphId);
|
|
366
|
-
return;
|
|
367
|
-
}
|
|
368
|
-
this.#promoteOverflowWitness(contextGraphId, overflow);
|
|
369
|
-
}
|
|
370
|
-
#promoteOverflowWitnesses() {
|
|
371
|
-
for (const [contextGraphId, overflow] of this.#contextGraphOverflows) {
|
|
372
|
-
this.#promoteOverflowWitness(contextGraphId, overflow);
|
|
373
|
-
}
|
|
374
|
-
if (this.#globalOverflow !== null)
|
|
375
|
-
this.#promoteOverflowWitness(null, this.#globalOverflow);
|
|
376
|
-
}
|
|
377
|
-
#promoteOverflowWitness(contextGraphId, overflow) {
|
|
378
|
-
if (overflow.active > 0)
|
|
379
|
-
return;
|
|
380
|
-
for (const [identity, witness] of overflow.failureWitnesses) {
|
|
381
|
-
const byScope = this.#byContextGraph.get(witness.contextGraphId);
|
|
382
|
-
const key = rfc64CatalogTargetScopeKeyV1(witness);
|
|
383
|
-
const current = byScope?.get(key);
|
|
384
|
-
if (current !== undefined) {
|
|
385
|
-
if (BigInt(current.announcement.catalogVersion) > BigInt(witness.catalogVersion)) {
|
|
386
|
-
overflow.failureWitnesses.delete(identity);
|
|
387
|
-
continue;
|
|
388
|
-
}
|
|
389
|
-
current.announcement = witness;
|
|
390
|
-
current.terminalFailure = true;
|
|
391
|
-
overflow.failureWitnesses.delete(identity);
|
|
392
|
-
continue;
|
|
393
|
-
}
|
|
394
|
-
if ((byScope?.size ?? 0) >= RFC64_CATALOG_TARGET_MAX_ENTRIES_PER_CONTEXT_GRAPH_V1
|
|
395
|
-
|| this.#size >= RFC64_CATALOG_TARGET_MAX_ENTRIES_V1)
|
|
396
|
-
continue;
|
|
397
|
-
const targetByScope = byScope ?? new Map();
|
|
398
|
-
if (byScope === undefined)
|
|
399
|
-
this.#byContextGraph.set(witness.contextGraphId, targetByScope);
|
|
400
|
-
targetByScope.set(key, { announcement: witness, terminalFailure: true });
|
|
401
|
-
this.#size += 1;
|
|
402
|
-
overflow.failureWitnesses.delete(identity);
|
|
403
|
-
}
|
|
404
|
-
if (overflow.failureWitnesses.size === 0
|
|
405
|
-
&& overflow.saturatedContextGraphs.size === 0
|
|
406
|
-
&& !overflow.unattributedSaturation) {
|
|
407
|
-
if (contextGraphId === null && this.#globalOverflow === overflow) {
|
|
408
|
-
this.#globalOverflow = null;
|
|
409
|
-
}
|
|
410
|
-
else if (contextGraphId !== null
|
|
411
|
-
&& this.#contextGraphOverflows.get(contextGraphId) === overflow)
|
|
412
|
-
this.#contextGraphOverflows.delete(contextGraphId);
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
170
|
const rfc64CatalogTargetAnnouncementsV1 = new WeakMap();
|
|
417
171
|
function rfc64CatalogReplayRuntimeForV1(agent) {
|
|
418
172
|
let runtime = rfc64CatalogReplayRuntimesV1.get(agent);
|
|
@@ -431,8 +185,7 @@ function rfc64CatalogReplaySnapshotRuntimeForV1(agent, persistence, mutationCoor
|
|
|
431
185
|
if (owned?.persistence === persistence)
|
|
432
186
|
return owned.runtime;
|
|
433
187
|
const runtime = new Rfc64CatalogReplaySnapshotRuntimeV1(Object.freeze({
|
|
434
|
-
|
|
435
|
-
readAppliedCatalogHeadsRevisionV1: () => persistence.inventory.readAppliedCatalogHeadsRevisionV1(),
|
|
188
|
+
readAppliedCatalogHeadsSnapshotV1: () => persistence.inventory.readAppliedCatalogHeadsSnapshotV1(),
|
|
436
189
|
readVerifiedCatalogHeadV1: async (objectDigest) => (await persistence.controlObjects.getVerifiedObjectByDigest({
|
|
437
190
|
objectDigest,
|
|
438
191
|
verifyIssuerSignature: verifyControlEnvelopeIssuerSignatureV1,
|
|
@@ -441,18 +194,22 @@ function rfc64CatalogReplaySnapshotRuntimeForV1(agent, persistence, mutationCoor
|
|
|
441
194
|
rfc64CatalogReplaySnapshotRuntimesV1.set(agent, Object.freeze({ persistence, runtime }));
|
|
442
195
|
return runtime;
|
|
443
196
|
}
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
target
|
|
454
|
-
target.
|
|
455
|
-
|
|
197
|
+
/**
|
|
198
|
+
* Keep only the newest catalog version promised for each scope. Targets that
|
|
199
|
+
* share that newest version but disagree on the head digest are all kept: that
|
|
200
|
+
* fork is evidence the row projection reports as ambiguous, and dropping one
|
|
201
|
+
* side of it would pick a branch at random.
|
|
202
|
+
*/
|
|
203
|
+
function pruneRfc64SupersededCatalogTargetsV1(targets) {
|
|
204
|
+
const newestByScope = new Map();
|
|
205
|
+
for (const target of targets) {
|
|
206
|
+
const scopeKey = rfc64CatalogTargetScopeKeyV1(target);
|
|
207
|
+
const version = BigInt(target.catalogVersion);
|
|
208
|
+
const newest = newestByScope.get(scopeKey);
|
|
209
|
+
if (newest === undefined || version > newest)
|
|
210
|
+
newestByScope.set(scopeKey, version);
|
|
211
|
+
}
|
|
212
|
+
return targets.filter((target) => (BigInt(target.catalogVersion) === newestByScope.get(rfc64CatalogTargetScopeKeyV1(target))));
|
|
456
213
|
}
|
|
457
214
|
function recordRfc64CatalogTargetAnnouncementV1(agent, announcement) {
|
|
458
215
|
let tracker = rfc64CatalogTargetAnnouncementsV1.get(agent);
|
|
@@ -481,6 +238,25 @@ function markRfc64DirectAcceptedCompatibilityV1(agent, contextGraphId) {
|
|
|
481
238
|
}
|
|
482
239
|
accepted.add(contextGraphId);
|
|
483
240
|
}
|
|
241
|
+
/**
|
|
242
|
+
* Record whether the private policy just accepted for a graph is join-derived.
|
|
243
|
+
* Both ways a private policy is accepted call this (authority composition and
|
|
244
|
+
* the direct snapshot acceptance), so the mark always describes the acceptance
|
|
245
|
+
* that produced the current snapshot. An open policy cannot replace a
|
|
246
|
+
* join-derived one: the registry only takes a linked successor.
|
|
247
|
+
*/
|
|
248
|
+
function noteRfc64AcceptedAuthorityOriginV1(agent, contextGraphId, origin) {
|
|
249
|
+
let joinDerived = rfc64JoinDerivedAcceptedAuthorityV1.get(agent);
|
|
250
|
+
if (origin === 'authenticated') {
|
|
251
|
+
joinDerived?.delete(contextGraphId);
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
if (joinDerived === undefined) {
|
|
255
|
+
joinDerived = new Set();
|
|
256
|
+
rfc64JoinDerivedAcceptedAuthorityV1.set(agent, joinDerived);
|
|
257
|
+
}
|
|
258
|
+
joinDerived.add(contextGraphId);
|
|
259
|
+
}
|
|
484
260
|
function rfc64CatalogAuthorityGenerationChangedV1(previous, accepted) {
|
|
485
261
|
return previous !== null
|
|
486
262
|
&& (previous.policyDigest !== accepted.policyDigest
|
|
@@ -564,6 +340,22 @@ function nextRfc64CatalogAuthorityRevisionV1(agent, contextGraphId) {
|
|
|
564
340
|
function isCurrentRfc64CatalogAuthorityRevisionV1(agent, contextGraphId, revision) {
|
|
565
341
|
return rfc64CatalogAuthorityRevisionsV1.get(agent)?.get(contextGraphId) === revision;
|
|
566
342
|
}
|
|
343
|
+
/**
|
|
344
|
+
* One authority composition that was discarded because a local authority fact
|
|
345
|
+
* moved while it was being read. Unlike a superseded composition, no newer one
|
|
346
|
+
* is running for this graph.
|
|
347
|
+
*/
|
|
348
|
+
class Rfc64AuthorityFactsMovedV1 {
|
|
349
|
+
authorityRevision;
|
|
350
|
+
constructor(authorityRevision) {
|
|
351
|
+
this.authorityRevision = authorityRevision;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
function waitForRfc64AuthorityFactsMovedRetryV1(delayMs, signal) {
|
|
355
|
+
if (signal !== undefined)
|
|
356
|
+
return waitForRfc64ScheduledResponsibilityDelayV1(signal, delayMs);
|
|
357
|
+
return new Promise((resolve) => { setTimeout(resolve, delayMs); });
|
|
358
|
+
}
|
|
567
359
|
/** Intermediate acceleration-pull WARNs are rate-limited per scope to this window. */
|
|
568
360
|
const RFC64_ACCELERATION_WARN_INTERVAL_MS_V1 = 30_000;
|
|
569
361
|
/** Bound on rate-limit bookkeeping so hostile scope churn cannot grow it unboundedly. */
|
|
@@ -582,9 +374,39 @@ function requireRfc64ContextGraphAuthorityReaderV1(capability) {
|
|
|
582
374
|
}
|
|
583
375
|
return capability.reader;
|
|
584
376
|
}
|
|
377
|
+
/**
|
|
378
|
+
* Refresh failures that are a not-yet, not a denial. Each keeps the graph in
|
|
379
|
+
* `resolving` and lets the AUTHOR OF RECORD retain its last accepted policy
|
|
380
|
+
* while the condition clears; a replica never retains, and every other code
|
|
381
|
+
* still fails closed to `blocked`.
|
|
382
|
+
*
|
|
383
|
+
* - `registered-authority-unfinalized`: the finalized chain index lags the
|
|
384
|
+
* registration.
|
|
385
|
+
* - `registered-private-roster-unresolved`: the authenticated lifecycle roster
|
|
386
|
+
* for a private graph is not resolvable locally yet. Demoting to `blocked`
|
|
387
|
+
* here fenced off the curator's own SWM root-catalog authoring lane, which is
|
|
388
|
+
* the only root-scope SWM delivery path on a catalog-selected graph.
|
|
389
|
+
*/
|
|
390
|
+
const RFC64_TRANSIENT_AUTHORITY_REFRESH_FAILURES_V1 = new Set([
|
|
391
|
+
'registered-authority-unfinalized',
|
|
392
|
+
'registered-private-roster-unresolved',
|
|
393
|
+
'unregistered-private-roster-unresolved',
|
|
394
|
+
'authority-rpc-circuit-open',
|
|
395
|
+
]);
|
|
396
|
+
/**
|
|
397
|
+
* Is this refresh failure a not-yet rather than a denial? Exported so the
|
|
398
|
+
* classification itself is pinned: it decides whether the author keeps its
|
|
399
|
+
* catalog lane or is parked `blocked`, and on a catalog-selected graph that
|
|
400
|
+
* lane is the only root-scope SWM delivery path.
|
|
401
|
+
*/
|
|
402
|
+
export function isRfc64TransientAuthorityRefreshFailureV1(code) {
|
|
403
|
+
return RFC64_TRANSIENT_AUTHORITY_REFRESH_FAILURES_V1.has(code);
|
|
404
|
+
}
|
|
585
405
|
function rfc64CatalogAuthorityFailureCodeV1(error) {
|
|
586
406
|
if (error instanceof Rfc64CatalogAuthorityResolutionErrorV1)
|
|
587
407
|
return error.code;
|
|
408
|
+
if (isRfc64AuthorityRpcCircuitOpenErrorV1(error))
|
|
409
|
+
return 'authority-rpc-circuit-open';
|
|
588
410
|
return 'authority-resolution-failed';
|
|
589
411
|
}
|
|
590
412
|
/**
|
|
@@ -595,35 +417,8 @@ function rfc64CatalogAuthorityFailureCodeV1(error) {
|
|
|
595
417
|
export function isRfc64UnregisteredOwnerUnresolvedErrorV1(error) {
|
|
596
418
|
return rfc64CatalogAuthorityFailureCodeV1(error) === 'unregistered-owner-unresolved';
|
|
597
419
|
}
|
|
598
|
-
function aggregateRfc64DigestV1(values) {
|
|
599
|
-
if (values.length === 0)
|
|
600
|
-
return null;
|
|
601
|
-
const sorted = [...values].sort();
|
|
602
|
-
if (sorted.length === 1)
|
|
603
|
-
return sorted[0];
|
|
604
|
-
return ethers.keccak256(ethers.toUtf8Bytes(sorted.join('\n')));
|
|
605
|
-
}
|
|
606
|
-
function sumDecimalCountsV1(values) {
|
|
607
|
-
return values.reduce((sum, value) => sum + BigInt(value), 0n).toString(10);
|
|
608
|
-
}
|
|
609
420
|
export class Rfc64CatalogMethods extends DKGAgentBase {
|
|
610
421
|
/** Stable recovery capabilities are captured once per agent-owned runtime. */
|
|
611
|
-
/**
|
|
612
|
-
* The node's SINGLE finality depth, taken from the adapter that actually
|
|
613
|
-
* resolves the anchors whenever it can report one.
|
|
614
|
-
*
|
|
615
|
-
* `dkg-agent-types.ts` documents `chainAdapter` as "If provided, chainConfig
|
|
616
|
-
* is ignored", so in the SDK-embedding shape `chainConfig.finalityConfirmations`
|
|
617
|
-
* is absent or stale while the adapter holds the operator's real value. An
|
|
618
|
-
* adapter that does not implement the accessor (mocks, out-of-tree adapters)
|
|
619
|
-
* has no opinion, and the configured value stands.
|
|
620
|
-
*/
|
|
621
|
-
resolveChainFinalityConfirmationsV1() {
|
|
622
|
-
const fromAdapter = typeof this.chain.getFinalityConfirmations === 'function'
|
|
623
|
-
? this.chain.getFinalityConfirmations()
|
|
624
|
-
: undefined;
|
|
625
|
-
return fromAdapter ?? this.config.chainConfig?.finalityConfirmations;
|
|
626
|
-
}
|
|
627
422
|
rfc64CatalogReplayRecoveryRuntimeV1() {
|
|
628
423
|
let runtime = rfc64CatalogReplayRecoveryRuntimesV1.get(this);
|
|
629
424
|
if (runtime !== undefined)
|
|
@@ -663,7 +458,9 @@ export class Rfc64CatalogMethods extends DKGAgentBase {
|
|
|
663
458
|
await this.rfc64PublicCatalogServiceV1
|
|
664
459
|
?.whenReceiverIdleForContextGraph(contextGraphId, signal);
|
|
665
460
|
},
|
|
461
|
+
warn: (message) => this.log.warn(createOperationContext('system'), message),
|
|
666
462
|
targetIdentity: rfc64CatalogTargetExactIdentityKeyV1,
|
|
463
|
+
pruneSupersededTargets: pruneRfc64SupersededCatalogTargetsV1,
|
|
667
464
|
parityFailed: async (contextGraphId, promised) => {
|
|
668
465
|
const persistence = this.rfc64PersistenceV1;
|
|
669
466
|
if (persistence === undefined)
|
|
@@ -802,55 +599,79 @@ export class Rfc64CatalogMethods extends DKGAgentBase {
|
|
|
802
599
|
replaySnapshotRevision = replayRecovery.revision;
|
|
803
600
|
appliedByContextGraph = groupRfc64OperationalAppliedHeadsV1(await loadRfc64OperationalAppliedHeadsV1(persistence));
|
|
804
601
|
}
|
|
602
|
+
const targetTracker = rfc64CatalogTargetAnnouncementsV1.get(this);
|
|
603
|
+
const targetsByContextGraph = new Map(selections.map((selection) => [
|
|
604
|
+
selection.contextGraphId,
|
|
605
|
+
targetTracker?.targetsForContextGraph(selection.contextGraphId) ?? [],
|
|
606
|
+
]));
|
|
607
|
+
// One accepted-policy snapshot per selection, resolved before the durable
|
|
608
|
+
// reads below and reused for both the promised targets and the replay
|
|
609
|
+
// status. Reading it twice across an await lets an accepted-policy rotation
|
|
610
|
+
// pair an old-digest promise set with a null replay status, which publishes
|
|
611
|
+
// an expected/missing pair built from promises the runtime has already
|
|
612
|
+
// dropped at that rotation.
|
|
613
|
+
const acceptedByContextGraph = new Map(selections.map((selection) => [
|
|
614
|
+
selection.contextGraphId,
|
|
615
|
+
service !== undefined && networkId !== undefined
|
|
616
|
+
? service.acceptedPolicySnapshot(networkId, selection.contextGraphId)
|
|
617
|
+
: null,
|
|
618
|
+
]));
|
|
619
|
+
const promisedTargetsByContextGraph = new Map(selections.map((selection) => {
|
|
620
|
+
const accepted = acceptedByContextGraph.get(selection.contextGraphId) ?? null;
|
|
621
|
+
return [
|
|
622
|
+
selection.contextGraphId,
|
|
623
|
+
accepted === null
|
|
624
|
+
? null
|
|
625
|
+
: replayRecovery.promisedTargets(selection.contextGraphId, accepted.policyDigest),
|
|
626
|
+
];
|
|
627
|
+
}));
|
|
628
|
+
const operationalTargets = [...new Map(selections.flatMap((selection) => [
|
|
629
|
+
...targetsByContextGraph.get(selection.contextGraphId) ?? [],
|
|
630
|
+
...promisedTargetsByContextGraph.get(selection.contextGraphId) ?? [],
|
|
631
|
+
]).map((target) => [rfc64CatalogTargetExactIdentityKeyV1(target), target])).values()];
|
|
632
|
+
const promisedRowCounts = persistence === undefined
|
|
633
|
+
? new Map()
|
|
634
|
+
: await loadRfc64OperationalPromisedRowCountsV1(persistence, operationalTargets);
|
|
805
635
|
const replaySnapshotUnstable = replaySnapshotRevision !== replayRecovery.revision;
|
|
806
636
|
const progressByContextGraph = rfc64CatalogAuthorityProgressV1.get(this);
|
|
807
637
|
const receiverStats = service?.stats().receiver;
|
|
808
638
|
return Object.freeze(selections.map((selection) => {
|
|
809
|
-
const accepted =
|
|
810
|
-
? service.acceptedPolicySnapshot(networkId, selection.contextGraphId)
|
|
811
|
-
: null;
|
|
639
|
+
const accepted = acceptedByContextGraph.get(selection.contextGraphId) ?? null;
|
|
812
640
|
const progress = progressByContextGraph?.get(selection.contextGraphId);
|
|
813
641
|
const currentReplayProgress = accepted === null
|
|
814
642
|
? null
|
|
815
643
|
: replayRecovery.status(selection.contextGraphId, accepted.policyDigest);
|
|
816
|
-
const replayActive = replaySnapshotUnstable || currentReplayProgress?.active === true;
|
|
817
|
-
// Only parity/overflow evidence fails a Context Graph. Providers that
|
|
818
|
-
// could not be replayed from surface through providerHealth instead.
|
|
819
|
-
const replayFailed = currentReplayProgress?.failed === true;
|
|
820
644
|
const heads = appliedByContextGraph.get(selection.contextGraphId) ?? [];
|
|
821
|
-
//
|
|
822
|
-
//
|
|
823
|
-
//
|
|
824
|
-
//
|
|
825
|
-
//
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
const
|
|
830
|
-
|
|
645
|
+
// The owner is the only possible catalog author only in a private graph
|
|
646
|
+
// whose accepted roster is the owner alone: catalog authorship follows
|
|
647
|
+
// the access policy (any member, or any author of a public graph, which
|
|
648
|
+
// has no roster), not the publish policy. When this node is that owner
|
|
649
|
+
// and its verified applied heads all belong to it, an unanswered
|
|
650
|
+
// connected peer cannot reveal another author's catalog. Keep the
|
|
651
|
+
// provider failure visible in providerHealth, but do not turn locally
|
|
652
|
+
// complete owner inventory into unknown graph parity.
|
|
653
|
+
const curatedOwnerAddress = accepted?.policy.source.kind === 'owner-signed-unregistered'
|
|
654
|
+
? accepted.policy.source.ownerAddress
|
|
655
|
+
: null;
|
|
656
|
+
const ownerIsSoleCatalogAuthor = accepted !== null
|
|
657
|
+
&& curatedOwnerAddress !== null
|
|
658
|
+
&& accepted.roster?.members.length === 1
|
|
659
|
+
&& accepted.roster.members[0]?.agentAddress === curatedOwnerAddress;
|
|
660
|
+
const localCuratedOwnerHeads = accepted !== null
|
|
661
|
+
&& accepted.policy.publishPolicy === 0
|
|
662
|
+
&& curatedOwnerAddress !== null
|
|
663
|
+
&& ownerIsSoleCatalogAuthor
|
|
664
|
+
&& heads.length > 0
|
|
665
|
+
&& this.listLocalAgents().some(({ agentAddress }) => (agentAddress.toLowerCase() === curatedOwnerAddress))
|
|
666
|
+
&& heads.every(({ snapshot }) => (snapshot.authorAddress === curatedOwnerAddress));
|
|
667
|
+
const targets = targetsByContextGraph.get(selection.contextGraphId) ?? [];
|
|
668
|
+
const promisedTargets = promisedTargetsByContextGraph.get(selection.contextGraphId) ?? null;
|
|
831
669
|
const targetCapacityExceeded = targetTracker
|
|
832
670
|
?.capacityExceededForContextGraph(selection.contextGraphId) ?? false;
|
|
833
|
-
const
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
return applied === undefined
|
|
837
|
-
|| BigInt(target.catalogVersion) > BigInt(applied.snapshot.catalogVersion)
|
|
838
|
-
|| (target.catalogVersion === applied.snapshot.catalogVersion
|
|
839
|
-
&& target.catalogHeadObjectDigest !== applied.snapshot.currentCatalogHeadDigest);
|
|
671
|
+
const { replayActive, replayFailed, replayUnverified, replayUnsettled, pendingTargets, catalogHeadDigest, expectedCatalogHeadDigest, inventoryDigest, rowCount, rowProjection, } = evaluateRfc64CatalogCompletionV1({
|
|
672
|
+
heads, targets, promisedTargets, promisedRowCounts, replay: currentReplayProgress,
|
|
673
|
+
replaySnapshotUnstable, targetCapacityExceeded, localCuratedOwnerHeads,
|
|
840
674
|
});
|
|
841
|
-
const catalogHeadDigest = aggregateRfc64DigestV1(heads.map(({ snapshot }) => snapshot.currentCatalogHeadDigest));
|
|
842
|
-
const expectedCatalogHeadDigests = new Map(heads.map(({ scopeKey, snapshot }) => [
|
|
843
|
-
scopeKey,
|
|
844
|
-
snapshot.currentCatalogHeadDigest,
|
|
845
|
-
]));
|
|
846
|
-
for (const target of pendingTargets) {
|
|
847
|
-
expectedCatalogHeadDigests.set(rfc64CatalogTargetScopeKeyV1(target), target.catalogHeadObjectDigest);
|
|
848
|
-
}
|
|
849
|
-
const expectedCatalogHeadDigest = aggregateRfc64DigestV1([...expectedCatalogHeadDigests.values()]);
|
|
850
|
-
const inventoryDigest = aggregateRfc64DigestV1(heads.map(({ snapshot }) => snapshot.appliedInventoryDigest));
|
|
851
|
-
const rowCount = heads.length === 0
|
|
852
|
-
? null
|
|
853
|
-
: sumDecimalCountsV1(heads.map(({ snapshot }) => snapshot.inventoryRowCount));
|
|
854
675
|
const appliedCatalogVersion = heads.length === 0
|
|
855
676
|
? null
|
|
856
677
|
: heads.reduce((highest, { snapshot }) => (BigInt(snapshot.catalogVersion) > BigInt(highest)
|
|
@@ -927,11 +748,14 @@ export class Rfc64CatalogMethods extends DKGAgentBase {
|
|
|
927
748
|
? 'applying'
|
|
928
749
|
: legacyReadOnlyCount > 0
|
|
929
750
|
? 'known-incomplete'
|
|
930
|
-
:
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
751
|
+
: rowProjection.missingRowCount !== null
|
|
752
|
+
&& BigInt(rowProjection.missingRowCount) > 0n
|
|
753
|
+
? 'known-incomplete'
|
|
754
|
+
: heads.length === 0
|
|
755
|
+
? 'bootstrapping'
|
|
756
|
+
: replayUnverified
|
|
757
|
+
? 'unknown-freshness'
|
|
758
|
+
: 'complete';
|
|
935
759
|
return Object.freeze({
|
|
936
760
|
contextGraphId: selection.contextGraphId,
|
|
937
761
|
responsibilityReason: selection.responsibilityReason,
|
|
@@ -957,16 +781,9 @@ export class Rfc64CatalogMethods extends DKGAgentBase {
|
|
|
957
781
|
? null
|
|
958
782
|
: inventoryDigest,
|
|
959
783
|
appliedInventoryDigest: inventoryDigest,
|
|
960
|
-
expectedRowCount:
|
|
961
|
-
? null
|
|
962
|
-
: rowCount,
|
|
784
|
+
expectedRowCount: rowProjection.expectedRowCount,
|
|
963
785
|
appliedRowCount: rowCount,
|
|
964
|
-
missingRowCount:
|
|
965
|
-
|| replayUnsettled
|
|
966
|
-
|| pendingTargets.length > 0
|
|
967
|
-
|| rowCount === null
|
|
968
|
-
? null
|
|
969
|
-
: '0',
|
|
786
|
+
missingRowCount: rowProjection.missingRowCount,
|
|
970
787
|
legacyReadOnlyCount,
|
|
971
788
|
catalogVersion,
|
|
972
789
|
authorHeadCount: heads.length,
|
|
@@ -985,18 +802,122 @@ export class Rfc64CatalogMethods extends DKGAgentBase {
|
|
|
985
802
|
});
|
|
986
803
|
}));
|
|
987
804
|
}
|
|
805
|
+
/** Re-prove catalog completion before the daemon's synchronous readiness commit. */
|
|
806
|
+
async withVerifiedPrivateCatalogSubscriptionReadinessV1(contextGraphId, commit) {
|
|
807
|
+
return verifyPrivateCatalogSubscriptionReadinessV1(this, contextGraphId, commit, () => {
|
|
808
|
+
const progress = rfc64CatalogAuthorityProgressV1.get(this)?.get(contextGraphId);
|
|
809
|
+
const tracker = rfc64CatalogTargetAnnouncementsV1.get(this);
|
|
810
|
+
const targets = tracker?.targetsForContextGraph(contextGraphId) ?? [];
|
|
811
|
+
return {
|
|
812
|
+
service: this.rfc64PublicCatalogServiceV1,
|
|
813
|
+
persistence: this.rfc64PersistenceV1,
|
|
814
|
+
networkId: this.config.rfc64CatalogDeploymentProfile?.networkId ?? this.config.networkIdentity?.chainId,
|
|
815
|
+
approvedAgent: this.localApprovedAgentByCG.get(contextGraphId),
|
|
816
|
+
subscription: this.subscribedContextGraphs.get(contextGraphId),
|
|
817
|
+
plan: this.config.rfc64CatalogExecutionPlan,
|
|
818
|
+
metadataRevision: this.contextGraphMetaProjection.readContextGraphAuthorityFactsRevision(contextGraphId),
|
|
819
|
+
replay: this.rfc64CatalogReplayRecoveryRuntimeV1(),
|
|
820
|
+
authorityRevision: rfc64CatalogAuthorityRevisionsV1.get(this)?.get(contextGraphId),
|
|
821
|
+
authorityCurrent: progress?.state === 'accepted' && Date.now() - progress.updatedAtMs
|
|
822
|
+
<= RFC64_CATALOG_AUTHORITY_REFRESH_POLICY_V1.intervalMs * RFC64_CATALOG_AUTHORITY_REFRESH_POLICY_V1.freshnessIntervalCount,
|
|
823
|
+
legacyReadOnlyCount: readRfc64LegacySwmBoundaryCountV1(this, contextGraphId),
|
|
824
|
+
targets,
|
|
825
|
+
targetCapacityExceeded: tracker?.capacityExceededForContextGraph(contextGraphId) ?? false,
|
|
826
|
+
targetFailed: targets.some((target) => tracker.hasTerminalFailure(target)),
|
|
827
|
+
targetFence: JSON.stringify(targets.map((target) => [
|
|
828
|
+
rfc64CatalogTargetExactIdentityKeyV1(target), tracker.hasTerminalFailure(target),
|
|
829
|
+
])),
|
|
830
|
+
};
|
|
831
|
+
});
|
|
832
|
+
}
|
|
988
833
|
/**
|
|
989
|
-
* Resolve the private member set from the
|
|
990
|
-
*
|
|
991
|
-
*
|
|
992
|
-
*
|
|
993
|
-
*
|
|
834
|
+
* Resolve the private member set from the authoritative roster source after
|
|
835
|
+
* the complete graph definition has been authenticated. Registered private
|
|
836
|
+
* graphs retain the finalized chain roster; unregistered graphs use the
|
|
837
|
+
* effective store-backed metadata projection. This is deliberately
|
|
838
|
+
* independent of the accepted RFC-64 overlay: responsibility and roster
|
|
839
|
+
* rotation cannot ask the roster they are about to establish for permission
|
|
840
|
+
* to establish it.
|
|
994
841
|
*/
|
|
995
842
|
async resolveRfc64VerifiedPrivateRosterV1(contextGraphId) {
|
|
996
|
-
|
|
843
|
+
// The creator's explicit local-first registration marker already proves
|
|
844
|
+
// this graph has no chain roster. Reading the general member-recovery
|
|
845
|
+
// authority here would ask the accepted catalog policy we are currently
|
|
846
|
+
// rotating to authorize its own successor. A concurrent admission can
|
|
847
|
+
// then make that read return unavailable and strand the new member behind
|
|
848
|
+
// the old policy. Read the creator's own confirmed _meta instead, while
|
|
849
|
+
// keeping merged revocations effective and fencing registration changes.
|
|
850
|
+
const localFirst = await this.isLocalFirstUnregisteredContextGraph(contextGraphId);
|
|
851
|
+
const accepted = this.readAcceptedRfc64CatalogAccessSnapshotV1(contextGraphId);
|
|
852
|
+
const approvedAgent = this.localApprovedAgentByCG.get(contextGraphId);
|
|
853
|
+
let approvedReplicaGate;
|
|
854
|
+
if (!localFirst
|
|
855
|
+
&& approvedAgent !== undefined
|
|
856
|
+
&& accepted?.policy.accessPolicy === 1
|
|
857
|
+
&& accepted.policy.source.kind === 'owner-signed-unregistered') {
|
|
858
|
+
const revision = this.contextGraphMetaProjection
|
|
859
|
+
.readContextGraphAuthorityFactsRevision(contextGraphId);
|
|
860
|
+
const approved = await resolveApprovedPrivateReplicaAuthority(this, contextGraphId, approvedAgent, () => this.localApprovedAgentByCG.get(contextGraphId)?.toLowerCase()
|
|
861
|
+
=== approvedAgent.toLowerCase(), () => this.contextGraphMetaProjection
|
|
862
|
+
.readContextGraphAuthorityFactsRevision(contextGraphId) === revision).catch(() => null);
|
|
863
|
+
if (approved?.kind === 'unregistered-private-replica'
|
|
864
|
+
&& approved.authority.ownerAddress === accepted.policy.source.ownerAddress) {
|
|
865
|
+
// The approved-member proof authenticates this replica's own private
|
|
866
|
+
// definition. Check finalized name absence independently, then read
|
|
867
|
+
// the effective local roster and fence both sources again after the
|
|
868
|
+
// store awaits. The general recovery helper would ask the accepted
|
|
869
|
+
// catalog policy to authorize the roster needed to authorize that
|
|
870
|
+
// same catalog transport, leaving cold approved replicas stuck.
|
|
871
|
+
const before = await this.readRfc64RegisteredAuthoritySnapshotV1(contextGraphId)
|
|
872
|
+
.catch(() => undefined);
|
|
873
|
+
if (before === undefined)
|
|
874
|
+
return null;
|
|
875
|
+
if (before === null) {
|
|
876
|
+
const merged = await this.getLocalMetadataMemberRecoveryGate(contextGraphId)
|
|
877
|
+
.catch(() => null);
|
|
878
|
+
const own = await this.getOwnCgMetaFacts(contextGraphId)
|
|
879
|
+
.catch(() => null);
|
|
880
|
+
const after = await this.readRfc64RegisteredAuthoritySnapshotV1(contextGraphId)
|
|
881
|
+
.catch(() => undefined);
|
|
882
|
+
if (merged === null
|
|
883
|
+
|| own === null
|
|
884
|
+
|| after !== null
|
|
885
|
+
|| this.contextGraphMetaProjection
|
|
886
|
+
.readContextGraphAuthorityFactsRevision(contextGraphId) !== revision
|
|
887
|
+
|| this.localApprovedAgentByCG.get(contextGraphId)?.toLowerCase()
|
|
888
|
+
!== approvedAgent.toLowerCase()
|
|
889
|
+
|| this.readAcceptedRfc64CatalogAccessSnapshotV1(contextGraphId)
|
|
890
|
+
?.policyDigest !== accepted.policyDigest
|
|
891
|
+
// The clock is the one thing the fences above cannot see.
|
|
892
|
+
|| !isApprovedPrivateReplicaDelegationActive(approved.authority))
|
|
893
|
+
return null;
|
|
894
|
+
const named = new Set([...own.allowedAgents, ...own.participantAgents]
|
|
895
|
+
.map((address) => address.toLowerCase()));
|
|
896
|
+
approvedReplicaGate = merged.filter((address) => named.has(address.toLowerCase()));
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
if (approvedReplicaGate === undefined
|
|
901
|
+
&& !await this.hasConfirmedMetaState(contextGraphId).catch(() => false)) {
|
|
997
902
|
return null;
|
|
998
903
|
}
|
|
999
|
-
const gate =
|
|
904
|
+
const gate = approvedReplicaGate !== undefined
|
|
905
|
+
? approvedReplicaGate
|
|
906
|
+
: localFirst
|
|
907
|
+
? await (async () => {
|
|
908
|
+
const revision = this.contextGraphMetaProjection
|
|
909
|
+
.readContextGraphAuthorityFactsRevision(contextGraphId);
|
|
910
|
+
const merged = await this.getLocalMetadataMemberRecoveryGate(contextGraphId);
|
|
911
|
+
const own = await this.getOwnCgMetaFacts(contextGraphId);
|
|
912
|
+
if (!await this.isLocalFirstUnregisteredContextGraph(contextGraphId)
|
|
913
|
+
|| this.contextGraphMetaProjection
|
|
914
|
+
.readContextGraphAuthorityFactsRevision(contextGraphId) !== revision)
|
|
915
|
+
return null;
|
|
916
|
+
const named = new Set([...own.allowedAgents, ...own.participantAgents]
|
|
917
|
+
.map((address) => address.toLowerCase()));
|
|
918
|
+
return merged?.filter((address) => named.has(address.toLowerCase())) ?? null;
|
|
919
|
+
})().catch(() => null)
|
|
920
|
+
: await withRpcUsageSite(CG_AUTH_RPC_SITES.rfc64Roster, () => this.getMemberRecoveryRosterSource(contextGraphId)).catch(() => null);
|
|
1000
921
|
if (gate === null || gate.length === 0)
|
|
1001
922
|
return null;
|
|
1002
923
|
const members = new Set();
|
|
@@ -1121,50 +1042,47 @@ export class Rfc64CatalogMethods extends DKGAgentBase {
|
|
|
1121
1042
|
}
|
|
1122
1043
|
/**
|
|
1123
1044
|
* Resolve a catalog peer from authenticated, Context-Graph-scoped state.
|
|
1124
|
-
*
|
|
1125
|
-
*
|
|
1126
|
-
*
|
|
1127
|
-
*
|
|
1045
|
+
* A peer may advertise a generic agent profile after a private transfer has
|
|
1046
|
+
* already begun. That profile need not be the agent approved for this graph.
|
|
1047
|
+
* Prefer the verified delegatee or curator binding, so late profile gossip
|
|
1048
|
+
* cannot change the identity used for catalog authorization mid-transfer.
|
|
1128
1049
|
*/
|
|
1129
1050
|
async resolveRfc64CatalogRemoteAgentAddressV1(remotePeerId, contextGraphId) {
|
|
1051
|
+
if (await this.hasConfirmedMetaState(contextGraphId).catch(() => false)) {
|
|
1052
|
+
const delegatedAgents = new Set();
|
|
1053
|
+
const delegateePeers = await this.getContextGraphAllowedDelegateePeers(contextGraphId)
|
|
1054
|
+
.catch(() => new Map());
|
|
1055
|
+
for (const [agentAddress, peerIds] of delegateePeers) {
|
|
1056
|
+
const normalized = agentAddress.toLowerCase();
|
|
1057
|
+
if (peerIds.includes(remotePeerId)
|
|
1058
|
+
&& /^0x[0-9a-f]{40}$/u.test(normalized)) {
|
|
1059
|
+
delegatedAgents.add(normalized);
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
if (delegatedAgents.size === 1)
|
|
1063
|
+
return [...delegatedAgents][0];
|
|
1064
|
+
if (delegatedAgents.size > 1)
|
|
1065
|
+
return null;
|
|
1066
|
+
const approvedAgent = this.localApprovedAgentByCG.get(contextGraphId);
|
|
1067
|
+
if (approvedAgent !== undefined) {
|
|
1068
|
+
const requesterState = await this.readRequesterJoinRequestState(contextGraphId, approvedAgent).catch(() => null);
|
|
1069
|
+
if (requesterState?.status === 'approved'
|
|
1070
|
+
&& requesterState.curatorPeerId === remotePeerId
|
|
1071
|
+
&& requesterState.curatorAgentAddress !== undefined
|
|
1072
|
+
&& requesterState.curatorAuthorityEra !== undefined) {
|
|
1073
|
+
const current = await this.readRfc64CurrentCuratorAuthorityBindingV1(contextGraphId).catch(() => null);
|
|
1074
|
+
if (current?.agentAddress === requesterState.curatorAgentAddress
|
|
1075
|
+
&& current.authorityEra === requesterState.curatorAuthorityEra)
|
|
1076
|
+
return current.agentAddress;
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1130
1080
|
const discovered = (await this.findAgentByPeerId(remotePeerId))
|
|
1131
1081
|
?.agentAddress
|
|
1132
1082
|
?.toLowerCase();
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
if (!await this.hasConfirmedMetaState(contextGraphId).catch(() => false)) {
|
|
1137
|
-
return null;
|
|
1138
|
-
}
|
|
1139
|
-
const delegatedAgents = new Set();
|
|
1140
|
-
const delegateePeers = await this.getContextGraphAllowedDelegateePeers(contextGraphId)
|
|
1141
|
-
.catch(() => new Map());
|
|
1142
|
-
for (const [agentAddress, peerIds] of delegateePeers) {
|
|
1143
|
-
const normalized = agentAddress.toLowerCase();
|
|
1144
|
-
if (peerIds.includes(remotePeerId)
|
|
1145
|
-
&& /^0x[0-9a-f]{40}$/u.test(normalized)) {
|
|
1146
|
-
delegatedAgents.add(normalized);
|
|
1147
|
-
}
|
|
1148
|
-
}
|
|
1149
|
-
if (delegatedAgents.size === 1)
|
|
1150
|
-
return [...delegatedAgents][0];
|
|
1151
|
-
if (delegatedAgents.size > 1)
|
|
1152
|
-
return null;
|
|
1153
|
-
const approvedAgent = this.localApprovedAgentByCG.get(contextGraphId);
|
|
1154
|
-
if (approvedAgent === undefined)
|
|
1155
|
-
return null;
|
|
1156
|
-
const requesterState = await this.readRequesterJoinRequestState(contextGraphId, approvedAgent).catch(() => null);
|
|
1157
|
-
if (requesterState?.status !== 'approved'
|
|
1158
|
-
|| requesterState.curatorPeerId !== remotePeerId
|
|
1159
|
-
|| requesterState.curatorAgentAddress === undefined
|
|
1160
|
-
|| requesterState.curatorAuthorityEra === undefined)
|
|
1161
|
-
return null;
|
|
1162
|
-
const current = await this.readRfc64CurrentCuratorAuthorityBindingV1(contextGraphId).catch(() => null);
|
|
1163
|
-
if (current === null
|
|
1164
|
-
|| current.agentAddress !== requesterState.curatorAgentAddress
|
|
1165
|
-
|| current.authorityEra !== requesterState.curatorAuthorityEra)
|
|
1166
|
-
return null;
|
|
1167
|
-
return current.agentAddress;
|
|
1083
|
+
return discovered !== undefined && /^0x[0-9a-f]{40}$/u.test(discovered)
|
|
1084
|
+
? discovered
|
|
1085
|
+
: null;
|
|
1168
1086
|
}
|
|
1169
1087
|
/** Read the curator-authored local roster generation from authenticated metadata. */
|
|
1170
1088
|
async readRfc64PrivateRosterVersionV1(contextGraphId) {
|
|
@@ -1576,6 +1494,18 @@ export class Rfc64CatalogMethods extends DKGAgentBase {
|
|
|
1576
1494
|
// silently instead of reporting a false authority failure.
|
|
1577
1495
|
if (ownerSignal.aborted)
|
|
1578
1496
|
throw ownerSignal.reason;
|
|
1497
|
+
if (isRfc64AuthorityRpcCircuitOpenErrorV1(error)) {
|
|
1498
|
+
// Awaited subscribe/bootstrap callers do not belong to the
|
|
1499
|
+
// scheduled responsibility batch. A circuit-open read must still
|
|
1500
|
+
// get an owned follow-up after cooldown; otherwise the private
|
|
1501
|
+
// receiver can remain unselected until an unrelated event.
|
|
1502
|
+
this.rfc64BackgroundWorkDispatcherV1.scheduleKeyed(`responsibility-circuit-retry\0${contextGraphId}\0${revision}`, async (signal) => {
|
|
1503
|
+
await waitForRfc64ScheduledResponsibilityDelayV1(signal, RFC64_SCHEDULED_RESPONSIBILITY_RETRY_MS_V1);
|
|
1504
|
+
signal.throwIfAborted();
|
|
1505
|
+
if (isCurrentRfc64CatalogResponsibilityRevisionV1(this, contextGraphId, revision))
|
|
1506
|
+
this.scheduleRfc64CatalogResponsibilityReconciliationV1(contextGraphId);
|
|
1507
|
+
});
|
|
1508
|
+
}
|
|
1579
1509
|
this.log.warn(createOperationContext('system'), `RFC-64 authority bootstrap incomplete for "${contextGraphId}": ${error instanceof Error ? error.message : String(error)}`);
|
|
1580
1510
|
return null;
|
|
1581
1511
|
});
|
|
@@ -1682,7 +1612,8 @@ export class Rfc64CatalogMethods extends DKGAgentBase {
|
|
|
1682
1612
|
const eligible = authorityRequest.kind === 'finalized-absence'
|
|
1683
1613
|
&& !responsibility.active
|
|
1684
1614
|
&& !this.config.rfc64CatalogExecutionPlan.killSwitchActive
|
|
1685
|
-
&& isRfc64ActiveRegisteredSubscriptionV1(subscription)
|
|
1615
|
+
&& (isRfc64ActiveRegisteredSubscriptionV1(subscription)
|
|
1616
|
+
|| isRfc64LocalJoinIntentUnregisteredSubscriptionV1(this.localApprovedAgentByCG.has(contextGraphId), subscription))
|
|
1686
1617
|
&& isCurrentRfc64CatalogResponsibilityRevisionV1(this, contextGraphId, revision);
|
|
1687
1618
|
if (!eligible) {
|
|
1688
1619
|
this.clearRfc64ScheduledFinalizedAbsenceRetryV1(contextGraphId, revision);
|
|
@@ -1704,7 +1635,8 @@ export class Rfc64CatalogMethods extends DKGAgentBase {
|
|
|
1704
1635
|
return;
|
|
1705
1636
|
}
|
|
1706
1637
|
const currentSubscription = this.subscribedContextGraphs.get(contextGraphId);
|
|
1707
|
-
if (!isRfc64ActiveRegisteredSubscriptionV1(currentSubscription)
|
|
1638
|
+
if (!isRfc64ActiveRegisteredSubscriptionV1(currentSubscription)
|
|
1639
|
+
&& !isRfc64LocalJoinIntentUnregisteredSubscriptionV1(this.localApprovedAgentByCG.has(contextGraphId), currentSubscription)) {
|
|
1708
1640
|
this.clearRfc64ScheduledFinalizedAbsenceRetryV1(contextGraphId, retry.revision);
|
|
1709
1641
|
return;
|
|
1710
1642
|
}
|
|
@@ -1850,13 +1782,13 @@ export class Rfc64CatalogMethods extends DKGAgentBase {
|
|
|
1850
1782
|
pending.clear();
|
|
1851
1783
|
throw ownerSignal.reason ?? error;
|
|
1852
1784
|
}
|
|
1853
|
-
if (isRfc64SharedStorePressureFailureV1(error)
|
|
1854
|
-
|
|
1855
|
-
//
|
|
1856
|
-
//
|
|
1857
|
-
// suffix
|
|
1858
|
-
//
|
|
1859
|
-
this.log.warn(createOperationContext('system'), `RFC-64 background responsibility batch paused after shared
|
|
1785
|
+
if (isRfc64SharedStorePressureFailureV1(error)
|
|
1786
|
+
|| isRfc64AuthorityRpcCircuitOpenErrorV1(error)) {
|
|
1787
|
+
// Shared store pressure and an open authority RPC circuit are
|
|
1788
|
+
// temporary node-wide conditions. Requeue this graph and the
|
|
1789
|
+
// untouched suffix after one bounded delay instead of leaving a
|
|
1790
|
+
// private receiver parked until an unrelated lifecycle nudge.
|
|
1791
|
+
this.log.warn(createOperationContext('system'), `RFC-64 background responsibility batch paused after shared authority pressure; `
|
|
1860
1792
|
+ `${authorityTargets.length - targetIndex} target(s) deferred: ${error instanceof Error ? error.message : String(error)}`);
|
|
1861
1793
|
try {
|
|
1862
1794
|
await waitForRfc64ScheduledResponsibilityDelayV1(ownerSignal, RFC64_SCHEDULED_RESPONSIBILITY_RETRY_MS_V1);
|
|
@@ -1889,8 +1821,32 @@ export class Rfc64CatalogMethods extends DKGAgentBase {
|
|
|
1889
1821
|
* Rebuild and accept current RFC-64 authority from ordinary DKG state. A
|
|
1890
1822
|
* supplied compatibility manifest remains an authority seed for its exact
|
|
1891
1823
|
* graph; every other responsible graph takes this release-native path.
|
|
1824
|
+
*
|
|
1825
|
+
* `null` means a newer composition owns the outcome. A snapshot discarded
|
|
1826
|
+
* because a local authority fact moved while it was being composed has no
|
|
1827
|
+
* such successor, so it is composed again here. Returning `null` for it left
|
|
1828
|
+
* the graph `resolving` until the next periodic refresh pass, and a curator
|
|
1829
|
+
* that lost the refresh after a membership change kept refusing the new
|
|
1830
|
+
* member's catalog replay for that long.
|
|
1892
1831
|
*/
|
|
1893
1832
|
async reconcileRfc64CatalogAccessAuthorityV1(contextGraphId, signal, authorityRequest = Object.freeze({ kind: 'auto' })) {
|
|
1833
|
+
for (let retry = 0;; retry += 1) {
|
|
1834
|
+
const outcome = await this.composeRfc64CatalogAccessAuthorityV1(contextGraphId, signal, authorityRequest);
|
|
1835
|
+
if (!(outcome instanceof Rfc64AuthorityFactsMovedV1))
|
|
1836
|
+
return outcome;
|
|
1837
|
+
const retryDelayMs = RFC64_AUTHORITY_FACTS_MOVED_RETRY_DELAYS_MS_V1[retry];
|
|
1838
|
+
if (retryDelayMs === undefined) {
|
|
1839
|
+
this.log.warn(createOperationContext('system'), `RFC-64 authority refresh for "${contextGraphId}" was discarded ${retry + 1} times because local authority facts kept changing; the next refresh pass retries it`);
|
|
1840
|
+
return null;
|
|
1841
|
+
}
|
|
1842
|
+
await waitForRfc64AuthorityFactsMovedRetryV1(retryDelayMs, signal);
|
|
1843
|
+
// A composition that started during the wait owns the outcome now.
|
|
1844
|
+
if (!isCurrentRfc64CatalogAuthorityRevisionV1(this, contextGraphId, outcome.authorityRevision))
|
|
1845
|
+
return null;
|
|
1846
|
+
}
|
|
1847
|
+
}
|
|
1848
|
+
/** One composition; see {@link reconcileRfc64CatalogAccessAuthorityV1}. */
|
|
1849
|
+
async composeRfc64CatalogAccessAuthorityV1(contextGraphId, signal, authorityRequest) {
|
|
1894
1850
|
const service = this.rfc64PublicCatalogServiceV1;
|
|
1895
1851
|
if (this.config.rfc64CatalogExecutionPlan.selectedAuthority[contextGraphId] !== undefined) {
|
|
1896
1852
|
return null;
|
|
@@ -1948,6 +1904,38 @@ export class Rfc64CatalogMethods extends DKGAgentBase {
|
|
|
1948
1904
|
&& directAcceptedPrivateSnapshot.policy.accessPolicy === 1
|
|
1949
1905
|
&& directAcceptedPrivateSnapshot.roster !== null
|
|
1950
1906
|
&& directAcceptedPrivateSnapshot.policy.source.kind === 'owner-signed-unregistered';
|
|
1907
|
+
// A join-approved private replica has a curator-bound decision and an
|
|
1908
|
+
// exact, source-qualified member/delegation proof in its own _meta. That
|
|
1909
|
+
// is sufficient local authority after finalized name absence; a remote
|
|
1910
|
+
// private definition must not be promoted from RDF alone.
|
|
1911
|
+
const approvedAgent = this.localApprovedAgentByCG.get(contextGraphId);
|
|
1912
|
+
const approvedPrivateMetaRevision = this.contextGraphMetaProjection
|
|
1913
|
+
.readContextGraphAuthorityFactsRevision(contextGraphId);
|
|
1914
|
+
const approvedPrivateReplica = (boundOnChainId === undefined
|
|
1915
|
+
&& !localFirstUnregistered
|
|
1916
|
+
&& !directAcceptedPrivateAuthority
|
|
1917
|
+
&& authorityRequest.kind === 'finalized-absence'
|
|
1918
|
+
&& approvedAgent !== undefined) ? await resolveApprovedPrivateReplicaAuthority(this, contextGraphId, approvedAgent, () => this.localApprovedAgentByCG.get(contextGraphId)?.toLowerCase()
|
|
1919
|
+
=== approvedAgent.toLowerCase(), () => this.contextGraphMetaProjection
|
|
1920
|
+
.readContextGraphAuthorityFactsRevision(contextGraphId)
|
|
1921
|
+
=== approvedPrivateMetaRevision, signal) : null;
|
|
1922
|
+
// A join or catalog write can invalidate this graph's metadata while
|
|
1923
|
+
// the source-qualified proof is reading it. The proof correctly returns
|
|
1924
|
+
// null for that mixed generation, but null alone is not evidence that
|
|
1925
|
+
// the approved owner vanished. Recompose against the new revision before
|
|
1926
|
+
// falling through to owner-unresolved and deactivating a valid receiver.
|
|
1927
|
+
if (approvedPrivateReplica === null
|
|
1928
|
+
&& approvedAgent !== undefined
|
|
1929
|
+
&& boundOnChainId === undefined
|
|
1930
|
+
&& !localFirstUnregistered
|
|
1931
|
+
&& !directAcceptedPrivateAuthority
|
|
1932
|
+
&& authorityRequest.kind === 'finalized-absence'
|
|
1933
|
+
&& this.contextGraphMetaProjection
|
|
1934
|
+
.readContextGraphAuthorityFactsRevision(contextGraphId)
|
|
1935
|
+
!== approvedPrivateMetaRevision)
|
|
1936
|
+
return new Rfc64AuthorityFactsMovedV1(authorityRevision);
|
|
1937
|
+
const approvedPrivateReplicaAuthority = approvedPrivateReplica?.kind
|
|
1938
|
+
=== 'unregistered-private-replica' ? approvedPrivateReplica.authority : null;
|
|
1951
1939
|
// Replica authority is admissible only after the shared finalized name
|
|
1952
1940
|
// index proves that no on-chain graph owns this name. The embedded
|
|
1953
1941
|
// policy is independently owner-signed and graph/network-bound; plain
|
|
@@ -1957,6 +1945,7 @@ export class Rfc64CatalogMethods extends DKGAgentBase {
|
|
|
1957
1945
|
const replicaUnregisteredAuthority = (boundOnChainId === undefined
|
|
1958
1946
|
&& !localFirstUnregistered
|
|
1959
1947
|
&& !directAcceptedPrivateAuthority
|
|
1948
|
+
&& approvedPrivateReplicaAuthority === null
|
|
1960
1949
|
&& authorityRequest.kind === 'finalized-absence')
|
|
1961
1950
|
? await loadRfc64UnregisteredReplicaAuthorityV1({
|
|
1962
1951
|
store: this.store,
|
|
@@ -2003,6 +1992,7 @@ export class Rfc64CatalogMethods extends DKGAgentBase {
|
|
|
2003
1992
|
}
|
|
2004
1993
|
const registeredAuthorityRead = (localFirstUnregistered
|
|
2005
1994
|
|| directAcceptedPrivateAuthority
|
|
1995
|
+
|| approvedPrivateReplicaAuthority !== null
|
|
2006
1996
|
|| replicaUnregisteredAuthority !== null
|
|
2007
1997
|
|| (boundOnChainId === undefined
|
|
2008
1998
|
&& authorityRequest.kind === 'finalized-absence'))
|
|
@@ -2031,6 +2021,11 @@ export class Rfc64CatalogMethods extends DKGAgentBase {
|
|
|
2031
2021
|
})()
|
|
2032
2022
|
: await this.readRfc64RegisteredAuthoritySnapshotV1(contextGraphId, signal);
|
|
2033
2023
|
let authority;
|
|
2024
|
+
// Mutable local authority facts must be one projection generation. Keep
|
|
2025
|
+
// the exact revision paired with every later metadata/version await and
|
|
2026
|
+
// refuse to accept a composed snapshot if owner, policy, revocation, or
|
|
2027
|
+
// membership facts changed in the meantime.
|
|
2028
|
+
let metadataAuthorityRevision = null;
|
|
2034
2029
|
if (registeredAuthorityRead !== null) {
|
|
2035
2030
|
const { expectedNameHash, snapshot } = registeredAuthorityRead;
|
|
2036
2031
|
if (signal?.aborted)
|
|
@@ -2040,9 +2035,21 @@ export class Rfc64CatalogMethods extends DKGAgentBase {
|
|
|
2040
2035
|
}
|
|
2041
2036
|
let authoritativeSnapshot = snapshot;
|
|
2042
2037
|
if (snapshot.accessPolicy === 1) {
|
|
2038
|
+
metadataAuthorityRevision = this.contextGraphMetaProjection
|
|
2039
|
+
.readContextGraphAuthorityFactsRevision(contextGraphId);
|
|
2043
2040
|
const localRoster = await this.resolveRfc64VerifiedPrivateRosterV1(contextGraphId);
|
|
2044
2041
|
if (localRoster === null) {
|
|
2045
|
-
|
|
2042
|
+
// TRANSIENT, and typed so it is classified as such. `null` here
|
|
2043
|
+
// means the authenticated roster is not resolvable *yet* — not
|
|
2044
|
+
// that membership was revoked to empty, which arrives as a
|
|
2045
|
+
// resolved, smaller roster. A bare Error fell through to the
|
|
2046
|
+
// `blocked` branch below, which closes the authoring fence and
|
|
2047
|
+
// takes the SWM root-catalog lane with it: on a catalog-selected
|
|
2048
|
+
// graph that lane is the ONLY delivery path for root-scope SWM
|
|
2049
|
+
// (legacy apply is deliberately closed), so the curator authored
|
|
2050
|
+
// zero catalog rows for a whole matrix cell and SWM converged
|
|
2051
|
+
// 0/50 rather than slowly.
|
|
2052
|
+
throw new Rfc64CatalogAuthorityResolutionErrorV1('registered-private-roster-unresolved', 'registered private RFC-64 Context Graph has no authenticated lifecycle roster yet');
|
|
2046
2053
|
}
|
|
2047
2054
|
// The finalized chain snapshot can lag an authenticated local
|
|
2048
2055
|
// removal. Never union a chain participant back into the catalog
|
|
@@ -2070,6 +2077,7 @@ export class Rfc64CatalogMethods extends DKGAgentBase {
|
|
|
2070
2077
|
else {
|
|
2071
2078
|
if (!localFirstUnregistered
|
|
2072
2079
|
&& !directAcceptedPrivateAuthority
|
|
2080
|
+
&& approvedPrivateReplicaAuthority === null
|
|
2073
2081
|
&& replicaUnregisteredAuthority === null) {
|
|
2074
2082
|
throw new Rfc64CatalogAuthorityResolutionErrorV1('unregistered-owner-unresolved', 'unregistered RFC-64 Context Graph has no authenticated owner authority');
|
|
2075
2083
|
}
|
|
@@ -2077,6 +2085,19 @@ export class Rfc64CatalogMethods extends DKGAgentBase {
|
|
|
2077
2085
|
authority = replicaUnregisteredAuthority;
|
|
2078
2086
|
}
|
|
2079
2087
|
else {
|
|
2088
|
+
// Capture before the first owner/policy authority-fact read. Taking
|
|
2089
|
+
// this revision only before the later roster read could combine an
|
|
2090
|
+
// old owner with a new policy/roster generation and still pass the
|
|
2091
|
+
// acceptance-time fence.
|
|
2092
|
+
//
|
|
2093
|
+
// A join-approved composition keeps the revision its proof was
|
|
2094
|
+
// taken against. Capturing a fresh one here would make a change
|
|
2095
|
+
// that landed between the proof's last check and this line the new
|
|
2096
|
+
// baseline, and the acceptance-time fence could no longer see it.
|
|
2097
|
+
metadataAuthorityRevision = approvedPrivateReplicaAuthority !== null
|
|
2098
|
+
? approvedPrivateMetaRevision
|
|
2099
|
+
: this.contextGraphMetaProjection
|
|
2100
|
+
.readContextGraphAuthorityFactsRevision(contextGraphId);
|
|
2080
2101
|
const ownerDid = await this.getContextGraphOwner(contextGraphId);
|
|
2081
2102
|
if (signal?.aborted)
|
|
2082
2103
|
throw signal.reason;
|
|
@@ -2109,15 +2130,58 @@ export class Rfc64CatalogMethods extends DKGAgentBase {
|
|
|
2109
2130
|
&& ownerAddress !== directAcceptedPrivateSnapshot.policy.source.ownerAddress) {
|
|
2110
2131
|
throw new Rfc64CatalogAuthorityResolutionErrorV1('unregistered-owner-unresolved', 'authenticated private RFC-64 authority owner does not match lifecycle metadata');
|
|
2111
2132
|
}
|
|
2133
|
+
if (approvedPrivateReplicaAuthority !== null
|
|
2134
|
+
&& (accessPolicy !== 'private'
|
|
2135
|
+
|| ownerAddress !== approvedPrivateReplicaAuthority.ownerAddress)) {
|
|
2136
|
+
throw new Rfc64CatalogAuthorityResolutionErrorV1('unregistered-owner-unresolved', 'approved private replica authority does not match lifecycle metadata');
|
|
2137
|
+
}
|
|
2112
2138
|
const stored = await this.getStoredContextGraphRegistrationOptions(contextGraphId);
|
|
2113
2139
|
const publishPolicy = stored.publishPolicy === 0 || stored.publishPolicy === 1
|
|
2114
2140
|
? stored.publishPolicy
|
|
2115
2141
|
: accessPolicy === 'private' ? 0 : 1;
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2142
|
+
// The approved-replica proof above has already authenticated this
|
|
2143
|
+
// receiver's private definition and is fenced to its metadata
|
|
2144
|
+
// revision. Read that definition's effective roster directly here.
|
|
2145
|
+
// The general recovery helper performs another registration read;
|
|
2146
|
+
// during a catalog refresh that read can lose the accepted-absence
|
|
2147
|
+
// allowance while authority is resolving, making the roster depend
|
|
2148
|
+
// on the very catalog authority this refresh is meant to restore.
|
|
2149
|
+
let members = [];
|
|
2150
|
+
if (accessPolicy === 'private') {
|
|
2151
|
+
if (approvedPrivateReplicaAuthority !== null) {
|
|
2152
|
+
const confirmed = await this.hasConfirmedMetaState(contextGraphId)
|
|
2153
|
+
.catch(() => false);
|
|
2154
|
+
members = confirmed
|
|
2155
|
+
? await this.getLocalMetadataMemberRecoveryGate(contextGraphId, { signal })
|
|
2156
|
+
: null;
|
|
2157
|
+
if (members !== null) {
|
|
2158
|
+
// The join proof authenticates one member against the graph's
|
|
2159
|
+
// own `_meta`. The roster above comes from the merged
|
|
2160
|
+
// projection, where the shared agents and ontology graphs can
|
|
2161
|
+
// name allowed agents no curator approved. Keep only addresses
|
|
2162
|
+
// the graph's own `_meta` names; a revocation from any source
|
|
2163
|
+
// has already been applied.
|
|
2164
|
+
const ownMeta = await this.getOwnCgMetaFacts(contextGraphId, { signal });
|
|
2165
|
+
if (signal?.aborted)
|
|
2166
|
+
throw signal.reason;
|
|
2167
|
+
const namedByOwnMeta = new Set([...ownMeta.allowedAgents, ...ownMeta.participantAgents]
|
|
2168
|
+
.map((address) => address.toLowerCase()));
|
|
2169
|
+
members = members.filter((member) => namedByOwnMeta.has(member.toLowerCase()));
|
|
2170
|
+
}
|
|
2171
|
+
}
|
|
2172
|
+
else {
|
|
2173
|
+
members = await this.resolveRfc64VerifiedPrivateRosterV1(contextGraphId);
|
|
2174
|
+
}
|
|
2175
|
+
}
|
|
2119
2176
|
if (accessPolicy === 'private' && members === null) {
|
|
2120
|
-
throw new
|
|
2177
|
+
throw new Rfc64CatalogAuthorityResolutionErrorV1(localFirstUnregistered
|
|
2178
|
+
? 'unregistered-private-roster-unresolved'
|
|
2179
|
+
: 'unregistered-owner-unresolved', 'unregistered private RFC-64 Context Graph has no authenticated lifecycle roster');
|
|
2180
|
+
}
|
|
2181
|
+
if (approvedPrivateReplicaAuthority !== null
|
|
2182
|
+
&& !members?.some((member) => member.toLowerCase()
|
|
2183
|
+
=== approvedPrivateReplicaAuthority.approvedAgentAddress)) {
|
|
2184
|
+
throw new Rfc64CatalogAuthorityResolutionErrorV1('unregistered-owner-unresolved', 'approved private replica member is absent from the authenticated roster');
|
|
2121
2185
|
}
|
|
2122
2186
|
const rosterVersion = await this.readRfc64PrivateRosterVersionV1(contextGraphId);
|
|
2123
2187
|
if (signal?.aborted)
|
|
@@ -2138,6 +2202,11 @@ export class Rfc64CatalogMethods extends DKGAgentBase {
|
|
|
2138
2202
|
}
|
|
2139
2203
|
if (!isCurrentRfc64CatalogAuthorityRevisionV1(this, contextGraphId, authorityRevision))
|
|
2140
2204
|
return null;
|
|
2205
|
+
if (metadataAuthorityRevision !== null
|
|
2206
|
+
&& this.contextGraphMetaProjection
|
|
2207
|
+
.readContextGraphAuthorityFactsRevision(contextGraphId)
|
|
2208
|
+
!== metadataAuthorityRevision)
|
|
2209
|
+
return new Rfc64AuthorityFactsMovedV1(authorityRevision);
|
|
2141
2210
|
// Finalized absence was exact when the refresh request was created, but
|
|
2142
2211
|
// RDF evidence loading is asynchronous. Discovery may bind the graph to
|
|
2143
2212
|
// a chain id during that await without starting a successor reconcile
|
|
@@ -2149,12 +2218,20 @@ export class Rfc64CatalogMethods extends DKGAgentBase {
|
|
|
2149
2218
|
&& this.subscribedContextGraphs.get(contextGraphId)?.onChainId !== undefined) {
|
|
2150
2219
|
throw new Rfc64CatalogAuthorityResolutionErrorV1('registered-authority-binding-mismatch', 'registered RFC-64 Context Graph cannot accept unregistered replica authority');
|
|
2151
2220
|
}
|
|
2221
|
+
// The join proof was taken before the reads above. Its delegation can
|
|
2222
|
+
// pass its deadline in the meantime without any store write, so the
|
|
2223
|
+
// revision fences do not see it: check the deadline in this same pass.
|
|
2224
|
+
if (approvedPrivateReplicaAuthority !== null
|
|
2225
|
+
&& !isApprovedPrivateReplicaDelegationActive(approvedPrivateReplicaAuthority)) {
|
|
2226
|
+
throw new Rfc64CatalogAuthorityResolutionErrorV1('unregistered-owner-unresolved', 'approved private replica delegation expired while its authority was composed');
|
|
2227
|
+
}
|
|
2152
2228
|
const previousAuthority = service.acceptedPolicySnapshot(authority.policy.networkId, authority.policy.contextGraphId);
|
|
2153
2229
|
const acceptedAuthority = service.acceptAuthoritativePolicySnapshot({
|
|
2154
2230
|
policy: authority.policy,
|
|
2155
2231
|
policyDigest: authority.policyDigest,
|
|
2156
2232
|
roster: authority.roster,
|
|
2157
2233
|
});
|
|
2234
|
+
noteRfc64AcceptedAuthorityOriginV1(this, contextGraphId, approvedPrivateReplicaAuthority === null ? 'authenticated' : 'join-approval');
|
|
2158
2235
|
const authorityGenerationChanged = rfc64CatalogAuthorityGenerationChangedV1(previousAuthority, acceptedAuthority);
|
|
2159
2236
|
if (authorityGenerationChanged) {
|
|
2160
2237
|
service.deactivateReceiverContextGraph(contextGraphId);
|
|
@@ -2169,6 +2246,11 @@ export class Rfc64CatalogMethods extends DKGAgentBase {
|
|
|
2169
2246
|
reason: null,
|
|
2170
2247
|
updatedAtMs: Date.now(),
|
|
2171
2248
|
});
|
|
2249
|
+
// Restart can restore all applied heads without a receiver completion.
|
|
2250
|
+
// Fresh accepted authority must also wake the live readiness verifier.
|
|
2251
|
+
if (approvedPrivateReplicaAuthority !== null) {
|
|
2252
|
+
this.eventBus.emit(DKGEvent.CATALOG_READINESS_CHECK_REQUESTED, { contextGraphId });
|
|
2253
|
+
}
|
|
2172
2254
|
// A first subscription attempt can race this authority bootstrap and
|
|
2173
2255
|
// correctly fail closed. Re-enter the idempotent transport reconciler
|
|
2174
2256
|
// exactly when authority becomes usable (or its generation changes),
|
|
@@ -2177,7 +2259,10 @@ export class Rfc64CatalogMethods extends DKGAgentBase {
|
|
|
2177
2259
|
this.queueSharedMemoryGossipSubscription(contextGraphId);
|
|
2178
2260
|
this.scheduleRfc64AuthorityAcceptedPeerCatchupV1();
|
|
2179
2261
|
}
|
|
2180
|
-
this.scheduleRfc64AuthorityAcceptedCatalogRecoveryV1(contextGraphId, acceptedAuthority.policyDigest
|
|
2262
|
+
this.scheduleRfc64AuthorityAcceptedCatalogRecoveryV1(contextGraphId, acceptedAuthority.policyDigest, {
|
|
2263
|
+
awaitsProviderAuthorization: approvedPrivateReplicaAuthority !== null,
|
|
2264
|
+
retryIncompletePrivate: acceptedAuthority.policy.accessPolicy === 1,
|
|
2265
|
+
});
|
|
2181
2266
|
return authority;
|
|
2182
2267
|
}
|
|
2183
2268
|
catch (error) {
|
|
@@ -2185,7 +2270,7 @@ export class Rfc64CatalogMethods extends DKGAgentBase {
|
|
|
2185
2270
|
throw signal.reason;
|
|
2186
2271
|
if (isCurrentRfc64CatalogAuthorityRevisionV1(this, contextGraphId, authorityRevision)) {
|
|
2187
2272
|
const failureCode = rfc64CatalogAuthorityFailureCodeV1(error);
|
|
2188
|
-
if (failureCode
|
|
2273
|
+
if (RFC64_TRANSIENT_AUTHORITY_REFRESH_FAILURES_V1.has(failureCode)) {
|
|
2189
2274
|
// Finality lag is transient. Stay in `resolving`, keep whatever
|
|
2190
2275
|
// accepted lineage the refresh started with (so an author keeps
|
|
2191
2276
|
// serving and announcing under its accepted policy), and leave the
|
|
@@ -2231,24 +2316,56 @@ export class Rfc64CatalogMethods extends DKGAgentBase {
|
|
|
2231
2316
|
* wait on receiver admission. The keyed dispatcher owns cancellation,
|
|
2232
2317
|
* coalescing, error reporting, and shutdown drain for the detached work.
|
|
2233
2318
|
*/
|
|
2234
|
-
scheduleRfc64AuthorityAcceptedCatalogRecoveryV1(contextGraphId, policyDigest) {
|
|
2319
|
+
scheduleRfc64AuthorityAcceptedCatalogRecoveryV1(contextGraphId, policyDigest, options = {}) {
|
|
2320
|
+
const awaitsProviderAuthorization = options.awaitsProviderAuthorization === true;
|
|
2321
|
+
const retryDelays = awaitsProviderAuthorization
|
|
2322
|
+
? RFC64_JOIN_DERIVED_CATALOG_RECOVERY_RETRY_DELAYS_MS_V1
|
|
2323
|
+
: RFC64_AUTHORITY_CATALOG_RECOVERY_RETRY_DELAYS_MS_V1;
|
|
2235
2324
|
const workKey = `authority-catalog-recovery\0${contextGraphId}\0${policyDigest}`;
|
|
2236
2325
|
this.rfc64BackgroundWorkDispatcherV1.scheduleKeyed(workKey, async (signal) => {
|
|
2237
|
-
for (let attempt = 0; attempt <=
|
|
2326
|
+
for (let attempt = 0; attempt <= retryDelays.length; attempt += 1) {
|
|
2238
2327
|
try {
|
|
2239
2328
|
await this.promoteRfc64OwnerSignedSwmInventoriesV1(contextGraphId, signal);
|
|
2240
2329
|
signal.throwIfAborted();
|
|
2241
|
-
await this.requestRfc64CatalogHeadReplaysFromConnectedPeersV1(contextGraphId, signal);
|
|
2242
|
-
|
|
2330
|
+
const replay = await this.requestRfc64CatalogHeadReplaysFromConnectedPeersV1(contextGraphId, signal);
|
|
2331
|
+
// A private join may accept its owner-signed policy before both
|
|
2332
|
+
// peers have the current member roster. A peer may answer replay
|
|
2333
|
+
// while the subsequent native fetch is still denied. The replay
|
|
2334
|
+
// runtime's settled parity, not an answered request alone, is the
|
|
2335
|
+
// evidence that the promised catalog rows were applied, so that
|
|
2336
|
+
// replica keeps this bounded demand alive until the parity is clean.
|
|
2337
|
+
if (!awaitsProviderAuthorization && !options.retryIncompletePrivate)
|
|
2338
|
+
return;
|
|
2339
|
+
const progress = this.rfc64CatalogReplayRecoveryRuntimeV1().status(contextGraphId, policyDigest);
|
|
2340
|
+
const incomplete = progress?.failed === true || progress?.unverified === true;
|
|
2341
|
+
// A private graph can finish receiving every row while its replay
|
|
2342
|
+
// drain times out or an authorized peer is temporarily unavailable.
|
|
2343
|
+
// Its first accepted-authority pass must not leave that unverified
|
|
2344
|
+
// witness standing until another authority revision happens. Retry
|
|
2345
|
+
// only this observed incomplete state, under the existing short
|
|
2346
|
+
// budget. Ordinary public and already-clean graphs still do one
|
|
2347
|
+
// pass; the longer join-derived budget remains join-only.
|
|
2348
|
+
if (!awaitsProviderAuthorization) {
|
|
2349
|
+
if (!options.retryIncompletePrivate || !incomplete)
|
|
2350
|
+
return;
|
|
2351
|
+
}
|
|
2352
|
+
else if (replay.requested > 0 && !incomplete) {
|
|
2353
|
+
return;
|
|
2354
|
+
}
|
|
2243
2355
|
}
|
|
2244
2356
|
catch (error) {
|
|
2245
2357
|
if (signal.aborted)
|
|
2246
2358
|
throw signal.reason ?? error;
|
|
2247
|
-
const retryDelayMs =
|
|
2359
|
+
const retryDelayMs = retryDelays[attempt];
|
|
2248
2360
|
if (retryDelayMs === undefined)
|
|
2249
2361
|
throw error;
|
|
2250
2362
|
await waitForRfc64ScheduledResponsibilityDelayV1(signal, retryDelayMs);
|
|
2363
|
+
continue;
|
|
2251
2364
|
}
|
|
2365
|
+
const retryDelayMs = retryDelays[attempt];
|
|
2366
|
+
if (retryDelayMs === undefined)
|
|
2367
|
+
return;
|
|
2368
|
+
await waitForRfc64ScheduledResponsibilityDelayV1(signal, retryDelayMs);
|
|
2252
2369
|
}
|
|
2253
2370
|
});
|
|
2254
2371
|
}
|
|
@@ -2287,12 +2404,10 @@ export class Rfc64CatalogMethods extends DKGAgentBase {
|
|
|
2287
2404
|
* to legacy authority; `false` is a catalog-owned fail-closed decision.
|
|
2288
2405
|
*/
|
|
2289
2406
|
resolveAcceptedRfc64SharedMemoryAuthorityV1(contextGraphId, opts = {}) {
|
|
2290
|
-
const
|
|
2291
|
-
if (
|
|
2292
|
-
|| receiverAuthority.mode !== 'catalog')
|
|
2407
|
+
const transport = projectRfc64CatalogTransportStateV1(this.resolveRfc64CatalogReceiverAuthorityV1(contextGraphId));
|
|
2408
|
+
if (transport === 'legacy')
|
|
2293
2409
|
return undefined;
|
|
2294
|
-
if (
|
|
2295
|
-
|| receiverAuthority.reconciliationLane !== 'catalog-apply')
|
|
2410
|
+
if (transport === 'catalog-blocked')
|
|
2296
2411
|
return false;
|
|
2297
2412
|
const service = this.rfc64PublicCatalogServiceV1;
|
|
2298
2413
|
const activeNetworkId = this.config.rfc64CatalogDeploymentProfile?.networkId
|
|
@@ -2311,6 +2426,10 @@ export class Rfc64CatalogMethods extends DKGAgentBase {
|
|
|
2311
2426
|
return false;
|
|
2312
2427
|
if (accepted.policy.accessPolicy === 0)
|
|
2313
2428
|
return true;
|
|
2429
|
+
// Join-derived authority does not replace the live join proof: leave the
|
|
2430
|
+
// decision to the caller's read-authority check, which runs that proof.
|
|
2431
|
+
if (this.isRfc64JoinDerivedAcceptedAuthorityV1?.(contextGraphId) === true)
|
|
2432
|
+
return undefined;
|
|
2314
2433
|
if (accepted.roster === null)
|
|
2315
2434
|
return false;
|
|
2316
2435
|
const effectiveCaller = opts.callerAgentAddress
|
|
@@ -2318,6 +2437,20 @@ export class Rfc64CatalogMethods extends DKGAgentBase {
|
|
|
2318
2437
|
?? this.defaultAgentAddress;
|
|
2319
2438
|
return this.isAgentAddressAllowed(effectiveCaller, accepted.roster.members.map(({ agentAddress }) => agentAddress));
|
|
2320
2439
|
}
|
|
2440
|
+
/**
|
|
2441
|
+
* Whether this graph's accepted policy was composed from a private join
|
|
2442
|
+
* approval. Such a snapshot is labelled owner-signed-unregistered like an
|
|
2443
|
+
* authenticated owner policy, but it rests on a proof that expires with the
|
|
2444
|
+
* member's delegation and belongs to one request generation. Reads and
|
|
2445
|
+
* shared-memory access therefore ignore it and keep running the proof.
|
|
2446
|
+
*/
|
|
2447
|
+
isRfc64JoinDerivedAcceptedAuthorityV1(contextGraphId) {
|
|
2448
|
+
return rfc64JoinDerivedAcceptedAuthorityV1.get(this)?.has(contextGraphId) === true;
|
|
2449
|
+
}
|
|
2450
|
+
/** Whether an accepted compatibility policy, not responsibility, owns this CG's RFC-64 authority. */
|
|
2451
|
+
hasRfc64AcceptedCompatibilityAuthorityV1(contextGraphId) {
|
|
2452
|
+
return this.resolveRfc64AcceptedCompatibilityAuthorityV1(contextGraphId) !== null;
|
|
2453
|
+
}
|
|
2321
2454
|
/** Whether the exact active network/CG authority is an accepted unregistered owner policy. */
|
|
2322
2455
|
hasAcceptedRfc64UnregisteredAuthorityV1(contextGraphId) {
|
|
2323
2456
|
const service = this.rfc64PublicCatalogServiceV1;
|
|
@@ -2346,6 +2479,59 @@ export class Rfc64CatalogMethods extends DKGAgentBase {
|
|
|
2346
2479
|
return false;
|
|
2347
2480
|
return service.acceptedPolicySnapshot(activeNetworkId, contextGraphId)?.policy.accessPolicy === 0;
|
|
2348
2481
|
}
|
|
2482
|
+
/**
|
|
2483
|
+
* Whether this node's accepted RFC-64 authority may govern transport for the
|
|
2484
|
+
* graph right now: the receiver-authority fence shared-memory admission uses
|
|
2485
|
+
* (catalog mode, no kill switch, active, catalog-apply lane). An accepted
|
|
2486
|
+
* snapshot is retained after a failed refresh or a kill switch, so a
|
|
2487
|
+
* transport decision must never read the snapshot without this.
|
|
2488
|
+
*/
|
|
2489
|
+
isRfc64CatalogTransportAuthorityActiveV1(contextGraphId) {
|
|
2490
|
+
return projectRfc64CatalogTransportStateV1(this.resolveRfc64CatalogReceiverAuthorityV1(contextGraphId)) === 'catalog-active';
|
|
2491
|
+
}
|
|
2492
|
+
/**
|
|
2493
|
+
* {@link hasAcceptedRfc64PublicUnregisteredAuthorityV1}, but only while that
|
|
2494
|
+
* authority governs transport ({@link isRfc64CatalogTransportAuthorityActiveV1}).
|
|
2495
|
+
* SWM consults this one: a retained public snapshot must not keep plaintext
|
|
2496
|
+
* open once catalog authority is killed, inactive, or blocked (#2831 review).
|
|
2497
|
+
*/
|
|
2498
|
+
hasActiveAcceptedRfc64PublicUnregisteredAuthorityV1(contextGraphId) {
|
|
2499
|
+
return this.isRfc64CatalogTransportAuthorityActiveV1(contextGraphId)
|
|
2500
|
+
&& this.hasAcceptedRfc64PublicUnregisteredAuthorityV1(contextGraphId);
|
|
2501
|
+
}
|
|
2502
|
+
/**
|
|
2503
|
+
* Current private roster of the accepted owner-signed unregistered policy,
|
|
2504
|
+
* but only while RFC-64 catalog authority governs transport for this graph.
|
|
2505
|
+
*
|
|
2506
|
+
* `undefined` means that no active accepted private-unregistered authority
|
|
2507
|
+
* applies. `null` keeps an applicable but incomplete private authority
|
|
2508
|
+
* fail-closed. Callers must not use the retained accepted snapshot directly:
|
|
2509
|
+
* it deliberately survives a kill switch or inactive catalog lane.
|
|
2510
|
+
*/
|
|
2511
|
+
resolveActiveAcceptedRfc64PrivateUnregisteredRosterV1(contextGraphId) {
|
|
2512
|
+
if (!this.isRfc64CatalogTransportAuthorityActiveV1(contextGraphId)) {
|
|
2513
|
+
return undefined;
|
|
2514
|
+
}
|
|
2515
|
+
const configuredPrivate = this.config.rfc64CatalogBootstrap?.acceptedPolicies.some(({ policyEnvelope }) => (policyEnvelope.payload.contextGraphId === contextGraphId
|
|
2516
|
+
&& policyEnvelope.payload.accessPolicy === 1)) === true;
|
|
2517
|
+
const accepted = this.readAcceptedRfc64CatalogAccessSnapshotV1(contextGraphId);
|
|
2518
|
+
// A selected private graph stays fail-closed while its policy/roster has
|
|
2519
|
+
// not yet been accepted. Once the catalog transport fence is inactive,
|
|
2520
|
+
// the early return above deliberately restores the legacy fallback.
|
|
2521
|
+
if (accepted === null)
|
|
2522
|
+
return configuredPrivate ? null : undefined;
|
|
2523
|
+
if (accepted.policy.source.kind !== 'owner-signed-unregistered'
|
|
2524
|
+
|| accepted.policy.accessPolicy !== 1) {
|
|
2525
|
+
return undefined;
|
|
2526
|
+
}
|
|
2527
|
+
// A join-derived roster is not owner-authenticated transport authority;
|
|
2528
|
+
// the approved-replica proof path keeps governing this graph.
|
|
2529
|
+
if (this.isRfc64JoinDerivedAcceptedAuthorityV1?.(contextGraphId) === true)
|
|
2530
|
+
return undefined;
|
|
2531
|
+
if (accepted.roster === null)
|
|
2532
|
+
return null;
|
|
2533
|
+
return Object.freeze(accepted.roster.members.map(({ agentAddress }) => agentAddress));
|
|
2534
|
+
}
|
|
2349
2535
|
/**
|
|
2350
2536
|
* Access policy of the authority this catalog owner has already accepted for
|
|
2351
2537
|
* the exact active network and graph, or `null` while none is accepted. The
|
|
@@ -2636,6 +2822,9 @@ export class Rfc64CatalogMethods extends DKGAgentBase {
|
|
|
2636
2822
|
// through the ambient lane. Exact retirement must not depend on the
|
|
2637
2823
|
// optional attempt-observer bookkeeping still being present.
|
|
2638
2824
|
retireRfc64CatalogTargetAnnouncementV1(this, announcement);
|
|
2825
|
+
this.eventBus.emit(DKGEvent.CATALOG_READINESS_CHECK_REQUESTED, {
|
|
2826
|
+
contextGraphId: announcement.contextGraphId,
|
|
2827
|
+
});
|
|
2639
2828
|
const attempt = reconciliationAttempts.get(token);
|
|
2640
2829
|
if (attempt === undefined)
|
|
2641
2830
|
return;
|
|
@@ -2760,6 +2949,7 @@ export class Rfc64CatalogMethods extends DKGAgentBase {
|
|
|
2760
2949
|
this.rfc64PublicCatalogSynchronizationEvidenceV1.clear();
|
|
2761
2950
|
this.rfc64PublicCatalogReconciliationFailuresV1.clear();
|
|
2762
2951
|
rfc64DirectAcceptedCompatibilityV1.delete(this);
|
|
2952
|
+
rfc64JoinDerivedAcceptedAuthorityV1.delete(this);
|
|
2763
2953
|
rfc64CatalogReplayRuntimesV1.delete(this);
|
|
2764
2954
|
rfc64CatalogReplaySnapshotRuntimesV1.delete(this);
|
|
2765
2955
|
rfc64CatalogReplayRecoveryRuntimesV1.get(this)?.reset();
|
|
@@ -2800,6 +2990,7 @@ export class Rfc64CatalogMethods extends DKGAgentBase {
|
|
|
2800
2990
|
this.clearRfc64CatalogOperationalTargetsV1(input.policy.contextGraphId);
|
|
2801
2991
|
}
|
|
2802
2992
|
markRfc64DirectAcceptedCompatibilityV1(this, input.policy.contextGraphId);
|
|
2993
|
+
noteRfc64AcceptedAuthorityOriginV1(this, input.policy.contextGraphId, 'authenticated');
|
|
2803
2994
|
return accepted;
|
|
2804
2995
|
}
|
|
2805
2996
|
/** Author path for a previously accepted policy snapshot in any V1 cell. */
|
|
@@ -3042,6 +3233,53 @@ export class Rfc64CatalogMethods extends DKGAgentBase {
|
|
|
3042
3233
|
},
|
|
3043
3234
|
});
|
|
3044
3235
|
}
|
|
3236
|
+
/** Replay only this graph's current head to the exact approved peer. */
|
|
3237
|
+
async reannounceRfc64CatalogAfterJoinApprovalV1(contextGraphId, approvedAgentAddress, peerId) {
|
|
3238
|
+
const accepted = this.readAcceptedRfc64CatalogAccessSnapshotV1(contextGraphId);
|
|
3239
|
+
if (accepted === null)
|
|
3240
|
+
return false;
|
|
3241
|
+
if (accepted.policy.accessPolicy === 1
|
|
3242
|
+
&& !accepted.roster?.members.some((member) => member.agentAddress.toLowerCase() === approvedAgentAddress.toLowerCase()))
|
|
3243
|
+
return false;
|
|
3244
|
+
const replay = await this.reannounceRfc64CatalogHeadsToPeerV1(peerId, {
|
|
3245
|
+
kind: RFC64_PUBLIC_CATALOG_HEAD_REPLAY_KIND_V1,
|
|
3246
|
+
networkId: accepted.policy.networkId,
|
|
3247
|
+
contextGraphId: accepted.policy.contextGraphId,
|
|
3248
|
+
policyDigest: accepted.policyDigest,
|
|
3249
|
+
});
|
|
3250
|
+
// An approval can precede the first authored head. An empty replay is not
|
|
3251
|
+
// delivery evidence: keep the bounded retry armed so a head published a
|
|
3252
|
+
// moment later is announced under the settled private roster.
|
|
3253
|
+
return replay.failed === 0 && replay.announced > 0;
|
|
3254
|
+
}
|
|
3255
|
+
/**
|
|
3256
|
+
* An approval can arrive while its successor private roster is still being
|
|
3257
|
+
* composed. Keep the exact approved peer's replay demand alive past the
|
|
3258
|
+
* short notification attempt without delaying the join or widening the
|
|
3259
|
+
* accepted policy. The dispatcher cancels and drains this bounded work on
|
|
3260
|
+
* shutdown; each attempt rechecks current authority and membership.
|
|
3261
|
+
*/
|
|
3262
|
+
scheduleRfc64CatalogAfterJoinApprovalRetryV1(contextGraphId, approvedAgentAddress, peerId) {
|
|
3263
|
+
const workKey = `join-approved-catalog-replay\0${contextGraphId}\0${approvedAgentAddress.toLowerCase()}\0${peerId}`;
|
|
3264
|
+
return this.rfc64BackgroundWorkDispatcherV1.scheduleKeyed(workKey, async (signal) => {
|
|
3265
|
+
for (const delayMs of RFC64_JOIN_APPROVAL_CATALOG_REPLAY_RETRY_DELAYS_MS_V1) {
|
|
3266
|
+
await waitForRfc64ScheduledResponsibilityDelayV1(signal, delayMs);
|
|
3267
|
+
try {
|
|
3268
|
+
await this.reconcileRfc64CatalogAccessAuthorityV1(contextGraphId, signal);
|
|
3269
|
+
signal.throwIfAborted();
|
|
3270
|
+
if (await this.reannounceRfc64CatalogAfterJoinApprovalV1(contextGraphId, approvedAgentAddress, peerId))
|
|
3271
|
+
return;
|
|
3272
|
+
}
|
|
3273
|
+
catch (error) {
|
|
3274
|
+
if (signal.aborted)
|
|
3275
|
+
throw signal.reason ?? error;
|
|
3276
|
+
// An overlapping metadata write or transport refusal is retryable;
|
|
3277
|
+
// the next pass still has to authenticate the current roster.
|
|
3278
|
+
}
|
|
3279
|
+
}
|
|
3280
|
+
this.log.warn(createOperationContext('system'), `RFC-64 catalog replay remained pending after bounded join approval retries for "${contextGraphId}"`);
|
|
3281
|
+
});
|
|
3282
|
+
}
|
|
3045
3283
|
/** Request scoped head replay from already-connected peers after late activation. */
|
|
3046
3284
|
async requestRfc64CatalogHeadReplaysFromConnectedPeersV1(contextGraphId, signal) {
|
|
3047
3285
|
return this.requestRfc64CatalogHeadReplayV1(contextGraphId, {
|
|
@@ -3072,27 +3310,34 @@ export class Rfc64CatalogMethods extends DKGAgentBase {
|
|
|
3072
3310
|
contextGraphId,
|
|
3073
3311
|
policyDigest: accepted.policyDigest,
|
|
3074
3312
|
};
|
|
3313
|
+
const settle = async (task) => {
|
|
3314
|
+
const result = await task;
|
|
3315
|
+
// Receiver completion precedes the replay owner's parity settlement.
|
|
3316
|
+
// Wake readiness again after that owner releases its active fence.
|
|
3317
|
+
this.eventBus.emit(DKGEvent.CATALOG_READINESS_CHECK_REQUESTED, { contextGraphId });
|
|
3318
|
+
return result;
|
|
3319
|
+
};
|
|
3075
3320
|
switch (request.kind) {
|
|
3076
3321
|
case 'connected-peers':
|
|
3077
|
-
return this.rfc64CatalogReplayRecoveryRuntimeV1().request({
|
|
3322
|
+
return settle(this.rfc64CatalogReplayRecoveryRuntimeV1().request({
|
|
3078
3323
|
...scope,
|
|
3079
3324
|
...(signal === undefined ? {} : { signal }),
|
|
3080
3325
|
kind: 'full-connected-peers',
|
|
3081
3326
|
connectedPeerIds: this.node.libp2p.getPeers().map((peer) => peer.toString()),
|
|
3082
|
-
});
|
|
3327
|
+
}));
|
|
3083
3328
|
case 'pending-recovery':
|
|
3084
|
-
return this.rfc64CatalogReplayRecoveryRuntimeV1().request({
|
|
3329
|
+
return settle(this.rfc64CatalogReplayRecoveryRuntimeV1().request({
|
|
3085
3330
|
...scope,
|
|
3086
3331
|
...(signal === undefined ? {} : { signal }),
|
|
3087
3332
|
kind: 'pending-recovery',
|
|
3088
|
-
});
|
|
3333
|
+
}));
|
|
3089
3334
|
case 'connection-demand':
|
|
3090
|
-
return this.rfc64CatalogReplayRecoveryRuntimeV1().request({
|
|
3335
|
+
return settle(this.rfc64CatalogReplayRecoveryRuntimeV1().request({
|
|
3091
3336
|
...scope,
|
|
3092
3337
|
...(signal === undefined ? {} : { signal }),
|
|
3093
3338
|
kind: 'connection-demand',
|
|
3094
3339
|
demand: request.replayDemand,
|
|
3095
|
-
});
|
|
3340
|
+
}));
|
|
3096
3341
|
}
|
|
3097
3342
|
}
|
|
3098
3343
|
/**
|
|
@@ -3395,7 +3640,7 @@ export class Rfc64CatalogMethods extends DKGAgentBase {
|
|
|
3395
3640
|
// `chainConfig` is ignored, so reading it here would pin the
|
|
3396
3641
|
// precommits to the default while the adapter's own authority
|
|
3397
3642
|
// reads honoured the operator. One anchor, one source.
|
|
3398
|
-
finalityConfirmations: this.
|
|
3643
|
+
finalityConfirmations: resolveChainFinalityConfirmationsV1(this.chain, this.config.chainConfig),
|
|
3399
3644
|
getOnChainContextGraphId: (contextGraphId, signal) => this.getContextGraphOnChainId(contextGraphId, { signal }),
|
|
3400
3645
|
getEvmChainId: () => this.chain.getEvmChainId(),
|
|
3401
3646
|
});
|
|
@@ -3409,7 +3654,7 @@ export class Rfc64CatalogMethods extends DKGAgentBase {
|
|
|
3409
3654
|
// `chainConfig` is ignored, so reading it here would pin the
|
|
3410
3655
|
// precommits to the default while the adapter's own authority
|
|
3411
3656
|
// reads honoured the operator. One anchor, one source.
|
|
3412
|
-
finalityConfirmations: this.
|
|
3657
|
+
finalityConfirmations: resolveChainFinalityConfirmationsV1(this.chain, this.config.chainConfig),
|
|
3413
3658
|
getOnChainContextGraphId: (contextGraphId, signal) => this.getContextGraphOnChainId(contextGraphId, { signal }),
|
|
3414
3659
|
getEvmChainId: () => this.chain.getEvmChainId(),
|
|
3415
3660
|
getKnowledgeAssetStorageAddress: async () => {
|
|
@@ -3487,6 +3732,12 @@ export class Rfc64CatalogMethods extends DKGAgentBase {
|
|
|
3487
3732
|
resolveTrustedCatalogScope: clients.resolveTrustedCatalogScope,
|
|
3488
3733
|
resolveDeployment,
|
|
3489
3734
|
requiresAppliedHeadPrecommit: (announcement) => {
|
|
3735
|
+
// An exact applied head can precede a late legacy SWM root marker.
|
|
3736
|
+
// Replaying that authenticated head retires the marker under the
|
|
3737
|
+
// native receiver lease; treating the head as satisfied would
|
|
3738
|
+
// leave the graph permanently known-incomplete despite row parity.
|
|
3739
|
+
if (readRfc64LegacySwmBoundaryCountV1(this, announcement.contextGraphId) > 0)
|
|
3740
|
+
return true;
|
|
3490
3741
|
const accepted = this.requireRfc64PublicCatalogServiceV1()
|
|
3491
3742
|
.acceptedPolicySnapshotForCatalogScope(clients.resolveTrustedCatalogScope(announcement));
|
|
3492
3743
|
return accepted.policy.accessPolicy === 1
|
|
@@ -3502,8 +3753,7 @@ export class Rfc64CatalogMethods extends DKGAgentBase {
|
|
|
3502
3753
|
// removed, and an EIP-191 head verifies from its envelope alone, so
|
|
3503
3754
|
// an exact staged head read and verified once is reused by the
|
|
3504
3755
|
// applied-head check instead of being re-read on every announcement.
|
|
3505
|
-
|
|
3506
|
-
peekStagedCatalogHead: stagedCatalogHeads.peek,
|
|
3756
|
+
stagedCatalogHeads,
|
|
3507
3757
|
});
|
|
3508
3758
|
const deploymentAwareReconciler = {
|
|
3509
3759
|
isHeadSatisfied: (announcement) => withRpcRequestContext({ requestClass: 'background' }, () => {
|