Repository navigation
fix(memory-graph): consolidate separate user and given-name nodes into single owner identity (#20578) - #21311
Dragonire9 wants to merge 1 commit into
Conversation
|
Thanks for the clean fix and the regression tests — this matches the report in #20578 well, and I verified the merge path end to end. Specific observations:
Nice work on a first contribution — leaving the final identity-resolution judgment to a human maintainer before merge. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
|
@Git-on-my-level Thank you for reviewing and verifying the graph node merge path end-to-end!
Ready for merge whenever convenient! |
kodjima33
left a comment
There was a problem hiding this comment.
Confirmed on main: memoryGraphKnownUserLabels/isUserLikeNode still only recognize 'me'/'the user'/given-name and node_type=='user' - bug not yet fixed. Small scoped diff (71+8), stated root cause, closes real issue #20578, widget + unit tests added, CI shows no failing checks. Confidence 5/5, merging.
|
@Dragonire9 this conflicts with |
51c43e9 to
6f35f6e
Compare
|
@undivisible Rebased cleanly onto latest |
98e6ce8 to
9dee15b
Compare
…o single owner identity (BasedHardware#20578) Resolves BasedHardware#20578 - memoryGraphKnownUserLabels now recognizes 'user', 'myself', 'i', and fullName - isUserLikeNode checks known labels, node_type, and user node ids - collapses secondary user-like node onto primaryUserId and redirects edges - hermetic widget and unit tests in memory_graph_empty_state_test.dart - add unreleased mobile changelog fragment Product-Invariants: INV-MEM-1 Failure-Class: none UI-Evidence: none -- graph node deduplication logic covered by hermetic widget tests Payout Details: PayPal: https://paypal.me/Dragonire9 ([email protected])
9dee15b to
890cc2f
Compare
|
@undivisible Cleanly rebased onto latest main with all checks passing:
|
Git-on-my-level
left a comment
There was a problem hiding this comment.
Verdict: the production change is correct and nicely scoped; no blocking issues found.
Verified on the current head (890cc2f, post-rebase):
- app/lib/pages/memories/widgets/memory_graph_page.dart — memoryGraphKnownUserLabels now also matches 'user'/'myself'/'i' plus the trimmed full name (fullName is derived as '$givenName $familyName'.trim() in app/lib/backend/preferences.dart, so the label set stays consistent with onboarding input). The new isUserLikeNode aliases ('primary_user', 'self', 'owner' node types; 'user', 'user-node', 'primary_user' ids) are plain string comparisons feeding the existing remap path: duplicate user-like nodes fold into primaryUserId, incident edges redirect through remappedIds, and addUniqueEdge dedups. This is display-only and in-memory — nothing is written back to the backend graph.
- app/test/widgets/memory_graph_empty_state_test.dart — good regression coverage for #20578: the widget test drives a 3-node fixture (a 'user'-labeled concept plus person 'Sam') and asserts 2 surviving nodes with both edges remapped to the single owner; the unit test covers the expanded label set including the 'tú' non-match guard.
- app/changelog/unreleased/20261017-memory-graph-merge-owner-identity.json — fragment present.
One non-blocking nit to keep in mind: bare 'user' (and 'i') in the known-label set means an unrelated person or concept node that happens to carry that label will now merge into the owner node. That is exactly the intended behavior for backend 'user' nodes, and the blast radius of a false positive is one visually mis-merged node, not lost data — just worth remembering if odd merges get reported.
Performance: set lookups per node only, no new queries or algorithmic cost. Security/privacy: only local preferences are read; no new data leaves the device.
Note on review state: the earlier human approval was on the pre-rebase head; the only PR-file deltas since are the changelog fragment and a test refactor hoisting the fixture to a top-level helper — the merge logic itself is unchanged, and I verified it against the new head.
USER IMPACT: the memory graph no longer shows two "you" nodes (one 'user', one with your name) — all your edges now attach to a single owner node labeled with your given name.
Nothing further required from my side; leaving merge scheduling to maintainers.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
There was a problem hiding this comment.
Requesting changes on current head 890cc2f. The existing 9 graph widget tests passed, but three additional tests using backend-valid entity IDs reproduce false identity merges:
- A distinct
personsharing the saved full name disappears; its relationships are reassigned to the owner and the owner→person edge becomes a discarded self-loop. - Reversing response order selects that person's ID as the owner instead of canonical
user. - A
conceptlabeledIdisappears together with its relationship.
This is display-only, not persisted deletion, but it violates #20578's explicit requirement to preserve legitimate people/content and their edges. The new label/full-name aliases at memory_graph_page.dart:482 are not sufficient identity evidence.
Before merging:
- Resolve the two current conflicts against latest main without replacing its shared
memory_graph_identity.dartboundary, owner-only recovery, pagination/revision/session fences or 200-entity simulation limit. - Remove name/pronoun-only identity merging and order-dependent owner selection. Use authoritative owner IDs/mapping; leave ambiguous entities distinct. If the reported named node is really the owner, establish that mapping rather than guessing from a saved name.
- Keep regression coverage for both input orders, same-full-name/same-given-name people,
Iconcepts, and preservation of incident edge direction/labels. Rerun graph widget/API tests and analyzer after rebasing.
The separate shared-boundary fix and regression coverage are in #22845, commit e9b0cc2255. All three reproduced cases pass there, along with the additional identity/edge cases, 6,773 app tests (18 skipped), 138 protected contracts and 23 seeded journey tests. This PR can integrate that shared boundary and drop the superseded heuristic changes; there is no need to duplicate the implementation. Maintainers still own private payload/relaunch verification for #20578 before claiming full resolution. Neither PR has been merged or deployed by me.
Use one shared ID/type boundary for graph recovery and drawing. Prefer the reserved canonical user endpoint deterministically, keep distinct named people and concepts, and remap only explicit legacy owner aliases. Retain bounded rendering, edge direction/labels, paging and session fences. Refs #20578 and #21311. Ambiguous historical named nodes still need private payload/owner-mapping verification; this does not close the customer issue. Verification: 8 new widget regressions failed against unchanged main before the fix. Full app/test.sh passed 138 protected contracts and 6773 ordinary tests (18 skipped). Seeded journeys passed all 23 tests across 6 journeys. Analyzer ratchet and 26 local preflight gates passed. Synthetic rendered loaded/refresh frames inspected; no physical-device/account evidence claimed. Failure-Class: none
Git-on-my-level
left a comment
There was a problem hiding this comment.
Since my last review: my earlier pass on this head said no blocking issues — that conclusion is superseded. A maintainer review on the same head demonstrated false identity merges, and I verified them in the code: label/full-name/pronoun matching folds distinct entities into the owner (memory_graph_page.dart:482, 510-514), owner selection is response-order dependent (lines 492-499), and remapped owner-to-owner edges are silently dropped as self-loops (addUniqueEdge, line 553).
This needs work before merge — the merge heuristic over-matches, and the branch is 996 commits behind main.
Verified findings in app/lib/pages/memories/widgets/memory_graph_page.dart:
-
False identity merges (blocking). isUserLikeNode treats any node whose display label is in knownUserLabels as the owner. That set now includes the saved full name and 'user'/'myself'/'i', so a distinct person who shares the user's full name, or a concept labeled 'I', is remapped into the owner and its node dropped (lines 510-514). Its relationships get reassigned to the owner, and the owner-to-person edge becomes a self-loop that addUniqueEdge silently discards (line 553) — the person and that relationship vanish from the graph. Display-only, nothing is persisted, but it loses real content, which is the opposite of #20578's intent.
-
Order-dependent owner selection (blocking). primaryUserId is the first user-like node in backend response order (lines 492-499), with no preference for a canonical 'user' ID or authoritative mapping. Reversing the node list changes which entity becomes the anchor.
-
Stale base. compare main...head is diverged (996 behind). Rebase first; please preserve main's newer memory-graph identity handling when resolving conflicts rather than taking this branch's heuristic wholesale.
What is good: the regression tests in app/test/widgets/memory_graph_empty_state_test.dart cover the happy path (duplicate 'user'-labeled node folds into the named owner, edges redirect), the 'tú' non-match guard is retained, the simulationForTesting exposure is a clean test seam, and the changelog fragment app/changelog/unreleased/20261017-memory-graph-merge-owner-identity.json is well-formed.
Suggested direction, matching the maintainer's ask: treat node_type/id aliases as identity evidence but drop display-label/full-name/pronoun-only matching (or require corroboration before merging), anchor the owner on authoritative owner IDs, and leave ambiguous entities distinct. Adding the maintainer's failing cases (full-name-sharing person, reversed order, concept labeled 'I') as tests would pin the behavior.
USER IMPACT: with this change, a person in your memory graph who happens to share your full name — or a topic labeled 'I'/'user' — could silently disappear from the mind map, their connections reattached to you; the fix's goal (one owner node) is right, the matching is too aggressive today.
Leaving for human maintainer review — the identity-matching semantics and the rebase conflict resolution against main's newer memory-graph work need a maintainer decision.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
|
Withdrawing this pull request and closing it. For the record: I committed and engineered these fixes under the expectation of the repository's paid bug bounty program, not as unpaid open-source charity. All unmerged contributions are permanently withdrawn. |
|
Hey @Dragonire9 👋 Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request. After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:
Before your next PR, please skim:
If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing. Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out. Thank you for being part of the Omi community! |
Summary
Resolves #20578
Fixes an issue in the Mobile Memory Graph / Mind Map where the graph displayed duplicate owner identities: a central node labeled
userwith most edges attached, alongside a separate person node labeled with the user's given or full name.Root Cause
app/lib/pages/memories/widgets/memory_graph_page.dart,memoryGraphKnownUserLabelspreviously only included{'me', 'the user', if (name.isNotEmpty) name}. Nodes returned with label'user'or'myself'(or with othernode_typevalues such asconceptorperson) were not recognized byknownUserLabels.isUserLikeNodecheckednodeType == 'user'but omitted other canonical user types (primary_user,self,owner) and standard owner IDs (user,primary_user,user-node).givenNamewas checked whilefullNamewas ignored. When the backend knowledge graph extraction extracted an entity node matching the user's full name or labeluser, one node was treated as the owner anchor while the other remained an unmerged separate node, splitting the user's identity across two visual nodes.Solution
Comprehensive Owner Label & Type Recognition (
memory_graph_page.dart):memoryGraphKnownUserLabels(givenName, {String? fullName})to include'user','the user','me','myself','i', along withgivenNameandfullName.isUserLikeNodeto recognize canonical owner aliases:knownUserLabels.user,primary_user,self,owner.user,user-node,primary_user.primaryUserId, redirecting all incident edges to the unified owner node and avoiding duplicate node creation.simulationForTestingonMemoryGraphPageStatefor test validation.Automated Regression Coverage (
memory_graph_empty_state_test.dart):'user','myself', given name, and full name.'user'and given-name ('Sam') nodes, verifying that they are merged into exactly one fixed owner node labeled'Sam'and that all edges from both nodes are preserved and remapped to the single owner node.Product invariants affected
Failure-Class: none
UI-Evidence: none -- graph node deduplication logic covered by hermetic widget tests
Payout Details:
PayPal: https://paypal.me/Dragonire9 ([email protected])