Skip to content

fix(agent): resume always-on SWM after restart - #2036

Open
branarakic wants to merge 2 commits into
codex/rfc64-m1-post-sync-finalizationfrom
codex/rfc64-m1-edge-always-on-swm-resume
Open

fix(agent): resume always-on SWM after restart#2036
branarakic wants to merge 2 commits into
codex/rfc64-m1-post-sync-finalizationfrom
codex/rfc64-m1-edge-always-on-swm-resume

Conversation

@branarakic

Copy link
Copy Markdown
Contributor

User impact

After an Edge node restarts, a graph that the user explicitly persisted as always-on now 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=false default 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 incomplete
Loading

After

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 excluded
Loading

Safety boundary

  • The override applies only to the module-private periodic Edge invocation whose scopes are derived from startup-rehydrated, persisted always-on subscriptions.
  • The ordinary peer-connect path still obeys the global syncOnConnectEnabled and syncSharedMemoryOnConnect switches.
  • Core behavior and system-graph inclusion are unchanged.

Validation

  • pnpm --filter @origintrail-official/dkg-agent build
  • Focused sync-coverage-evidence-runtime.test.ts: 22/22 passed
  • Full Agent unit lane: 165 files, 2,243 passed, 5 skipped, 0 failed
  • git diff --check

Stack

Base: #2035 (codex/rfc64-m1-post-sync-finalization)

Comment thread packages/agent/src/dkg-agent-lifecycle.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants