fix(agent): resume always-on SWM after restart - #2036
Open
branarakic wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User impact
After an Edge node restarts, a graph that the user explicitly persisted as
always-onnow resumes both finalized VM synchronization and live/shared-memory synchronization. Broad Edge sync remains disabled:on-demand, runtime-only, unselected, AGENTS, and ONTOLOGY graphs are not pulled by this periodic path.This closes the live canary failure where VM resumed for the selected graph after restart but SWM was skipped because the global
syncSharedMemoryOnConnect=falsedefault was applied to the graph-scoped periodic reconciler.Before
sequenceDiagram participant User participant Edge participant Reconciler participant Provider User->>Edge: Persist CG as always-on Edge->>Edge: Restart and rehydrate selection Reconciler->>Provider: Sync selected CG VM Provider-->>Reconciler: Finalized VM data Reconciler->>Reconciler: Read global SWM-on-connect = false Reconciler--xProvider: Skip selected CG SWM Note over Edge: VM current, SWM/evidence incompleteAfter
sequenceDiagram participant User participant Edge participant Reconciler participant Provider User->>Edge: Persist CG as always-on Edge->>Edge: Restart and rehydrate selection Reconciler->>Reconciler: Validate persisted always-on scope Reconciler->>Provider: Sync only selected CG VM Provider-->>Reconciler: Finalized VM data Reconciler->>Provider: Sync only selected CG SWM Provider-->>Reconciler: Live/shared-memory data Note over Edge: Selected CG evidence complete Note over Reconciler: On-demand and unselected CGs remain excludedSafety boundary
always-onsubscriptions.syncOnConnectEnabledandsyncSharedMemoryOnConnectswitches.Validation
pnpm --filter @origintrail-official/dkg-agent buildsync-coverage-evidence-runtime.test.ts: 22/22 passedgit diff --checkStack
Base: #2035 (
codex/rfc64-m1-post-sync-finalization)