fix(graph): keep orphan edges out of the runtime graph#70
Merged
CodeAbra merged 4 commits intoJul 13, 2026
Merged
Conversation
Warm the dispatch surface once, keep a timed-out background warmup alive explicitly, and release async-write and lifecycle resources safely when startup cancellation escapes the inner run loop. Designed by Marsu — Refined by Codex. Co-Authored-By: Codex <codex@openai.com>
Remove workstation-only and process-history assumptions, keep version checks source-aware, use the standard library for plist parsing, and preserve correctness signals without unstable global monkeypatches or hard timing gates. Designed by Marsu — Refined by Codex. Co-Authored-By: Codex <codex@openai.com>
Recognize exact iai_mcp and iai-mcp path components while preserving Desktop precedence and rejecting substring lookalikes. Designed by Marsu — Refined by Codex. Co-Authored-By: Codex <codex@openai.com>
Replay an edge only when both endpoints are active graph nodes, so stale storage edges cannot recreate deleted records or inflate topology work in either full or incremental rebuilds. Bump the graph-cache version once so polluted assignments and rich-club data cannot survive the fix. Designed by Marsu — Refined by Codex. Co-Authored-By: Codex <codex@openai.com>
53df1bd to
1b00956
Compare
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.
Draft / stacked PR
Do not merge before #67, #68, and #69. This branch is stacked on those fixes, so the GitHub diff includes dependency commits until they land. It will then be rebased onto
mainto leave only the runtime-graph integrity change.Problem
Storage edges can temporarily outlive deleted records until the maintenance
sweep runs. Runtime graph construction streams active records first and then
all stored edges;
MemoryGraph.add_edgecreates missing endpoints, so anorphan edge could recreate a deleted record as a payload-less graph node. A
persisted assignment or rich-club cache computed from that polluted graph could
also survive the code fix.
Solution
graph nodes;
results are rebuilt from the corrected node set.
Guarantees and scope
The read path does not mutate or delete stored edges; the existing maintenance
sweep remains responsible for storage cleanup. Every active-to-active edge is
preserved, while missing endpoints can no longer inflate topology or recall
state.
Validation
injected orphan edge and must retain exactly the active node set;
active record count after the guard.
Designed by Marsu — Refined by Codex.
Public CI result
The cumulative macOS correctness gate is fully green: 5,126 passed, 113 skipped, 107 deselected, and 4 xfailed. The universal2 wheel and secret scan also pass.