fix(agent): retire cold-joined finalized SWM heads - #2034
Open
branarakic wants to merge 1 commit 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
A cold-joining Edge node can receive both a finalized VM copy and the still-retained SWM recovery copy of the same Knowledge Asset. Before this change, the user-facing SWM view could show that finalized asset as if it were still live whenever the receiver had not observed the original finalization transaction envelope.
After this change, once the node independently verifies the exact VM content against the current chain-resolved root, it retires only the matching current SWM head from user queries. The physical SWM copy remains available for recovery, and the node does not invent missing transaction provenance.
This is a bounded correction discovered by the M1 testnet canary. It does not broaden Edge subscriptions, does not activate unselected CGs, and does not weaken VM verification.
Before
sequenceDiagram participant Core as Core peer participant Edge as Cold Edge node participant Chain as Chain participant User as User query Core->>Edge: Durable VM snapshot Core->>Edge: Retained SWM recovery snapshot Edge->>Chain: Resolve current KA root Chain-->>Edge: Current root Edge->>Edge: Verify exact VM content Edge->>Edge: Transaction provenance unavailable Edge-->>User: VM asset plus stale SWM assetAfter
sequenceDiagram participant Core as Core peer participant Edge as Cold Edge node participant Chain as Chain participant Store as Local store participant User as User query Core->>Edge: Durable VM snapshot Core->>Edge: Retained SWM recovery snapshot Edge->>Chain: Resolve current KA root Chain-->>Edge: Current root Edge->>Edge: Verify exact VM content Edge->>Store: Mark only matching current SWM head finalized Edge->>Edge: Keep provenance state pending Edge-->>User: Finalized VM asset only Note over Store: SWM recovery quads remain physically storedSafety properties
Canary evidence
The initial M1 three-role canary reproduced the defect on the selected public on-demand CG: one exact finalized VM asset was present in both VM and the user-facing SWM view. Logs showed that VM content verification succeeded while transaction provenance remained unavailable. This change turns that exact state into a retired SWM view while preserving the recovery copy and pending provenance state.
Verification
git diff --check: passedStack