Repository navigation
fix(mobile): resolve Mind Map owner by identity, not names - #22845
Conversation
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
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Verdict: the production change is correct, tight, and well-tested — no blocking issues.
UX: people who share your name (or are labeled "I"/"me") now stay separate nodes instead of collapsing into your owner node; name-only legacy "owner" projections render as content instead of silently triggering recovery. Performance: no added queries or passes; remap is O(n) over nodes. USER IMPACT: Mind Map no longer merges distinct people into your center node just because they share your name — they stay separate, and your own node is anchored by identity. Remaining for a maintainer: the affected #20578 payload should be verified on a live build before that issue is closed (the PR checklist flags this too). Nothing else material outstanding. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
kodjima33
left a comment
There was a problem hiding this comment.
Trusted contributor (aryanorastar), scoped mobile identity-collision fix with contract tests; confidence 4/5 (root cause, fix(mobile) title, CI green, tests added) — diff size is the only failing criterion. mergeStateStatus clean.
Summary
userID and the existing explicit legacy owner signals; profile names and labels are presentation only.user, and remap only proven owner aliases. Preserve distinct people, concepts, edge direction/labels and the bounded canvas.Refs #20578. Follow-up to the identity collision findings on #21311; this does not automatically close either item and is not a deployment request.
Contract and remaining evidence
backend/models/memory_promotion.py:canonical_graph_entity_idreservesuser; named entities have distinctent_*IDs. The legacy extractor inbackend/utils/llm/knowledge_graph.pyemits labels without proving account-owner identity. Tests therefore must not treat a matching display name as an identity assertion. The earlier label-set expectation and the name-only owner-recovery fixture are migrated to this authoritative contract, not simply weakened.This is a shared primitive rather than a new source-scraping check. The regression tests execute the real widget and HTTP adapter and run in the existing Flutter suite. The rendered scenario also runs in the existing visual-audit smoke suite.
An ambiguous historical name-only node is deliberately kept distinct. Maintainers still need to inspect the affected #20578 payload privately and verify the owner mapping/relaunch on the affected build. No customer data was accessed, rewritten, rebuilt or deleted for these fixtures.
Verification
TZ=UTC bash app/test.sh test/widgets/memory_graph_owner_identity_test.dartran 138 protected contracts successfully, then all 8 new widget regressions failed against unchanged production code on main5482752833b3.TZ=UTC flutter test --no-pub test/widgets/memory_graph_owner_identity_test.dart test/widgets/memory_graph_empty_state_test.dart test/utils/memory_graph_identity_test.dart test/unit/knowledge_graph_read_test.dartpassed all 64 tests, including a final post-commit rerun.bash app/scripts/analyze_ratchet.sh: passed, no new analyzer errors/lint debt.OMI_PR_BODY_FILE=/private/tmp/omi-owner-identity-pr-body.md make preflightand final post-commitscripts/pr-preflight --pr-body-file /private/tmp/omi-owner-identity-pr-body.md: all 26 selected checks passed in both runs.TZ=UTC bash app/scripts/visual_audit.sh --head WORKTREE --only memories-mind-map-distinct-identities --out /private/tmp/omi-owner-identity-visual: passed. Inspected both rendered frames: owner, same-name people andIstay distinct before and after tapping Refresh.TZ=UTC make mobile-verify ARGS='fast --paths app/lib/utils/memory_graph_identity.dart app/lib/pages/memories/widgets/memory_graph_page.dart app/lib/backend/http/api/knowledge_graph_api.dart': selected all 6 seeded journeys via the fail-closed full-suite fallback; 23 tests passed, 0 failed/skipped. Receipt:/var/folders/42/1hgpqdd93c9760xd6rhq4brw0000gn/T/mobile_verify_hgw3r4ue/verify-receipt.json.TZ=UTC bash app/test.sh: passed. Protected opt-in spine: 138 passed. Full ordinary app suite (including the new widget/API/identity regressions and rendered smoke scenario): 6,773 passed, 18 skipped, 0 failed.git pushpre-push gate passed, including app-client OpenAPI compatibility and pinned Dart formatting. Native platform compiles and hosted CI remain separate evidence; no check was bypassed.Evidence is synthetic/hermetic and exercises production widgets and HTTP boundaries. No physical-device, native-build or affected-account verification is claimed. The original PR head
890cc2fseparately failed the three review probes (full-name person in both orders and a concept namedI). Screenshots and logs are retained locally, not committed.Product invariants affected
INV-MEM-1
Failure-Class: none
UI-Evidence: none -- identity/data handling only, no layout/style changes. Local production-widget rendered evidence is
/private/tmp/omi-owner-identity-visual/after/(loaded/refreshed frames); the same scenario executes in the regular visual-audit smoke suite.