Skip to content

feat(desktop): add canonical memory atlas - #9499

Merged
Git-on-my-level merged 58 commits into
BasedHardware:mainfrom
Git-on-my-level:codex/memory-atlas
Jul 27, 2026
Merged

Git-on-my-level merged 58 commits into
BasedHardware:mainfrom
Git-on-my-level:codex/memory-atlas

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Jul 11, 2026 •

Copy link
Copy Markdown
Member

Summary

  • add a canonical-memory-only Memory Atlas for the macOS Memories page while retaining the legacy graph for users who have not entered the canonical lifecycle
  • provide progressive entity/relationship exploration with deterministic layout, viewport budgets, deep labelled Inspect mode, search, evidence navigation, and automation coverage
  • draw neighbourhoods as islands with real coastlines, name every island on the island itself, and make Escape back out of the map one layer at a time
  • fix named Atlas QA bundle reliability: dedicated local storage, recoverable SQLite pool rotation, and explicit --yolo backend routing

Why

The legacy graph does not make relationship-rich canonical memory data navigable at account scale. The Atlas builds rankings and layout once per graph snapshot, culls presentation to the viewport, and increases detail progressively as the user zooms.

The QA failure was separate from graph rendering: distinct named bundles had different bundle IDs but shared one signed-in user's local Rewind SQLite/WAL store. Running multiple named bundles concurrently caused SQLITE_IOERR reads, which the Memories page surfaced as Failed to Load Memories.

User impact

  • Canonical-memory users can explore relationships progressively and drill to labelled, interactive nodes without reintroducing camera-driven freezes.
  • Legacy-memory users continue to receive the existing graph unchanged.
  • Named QA bundles now have independent local cache/database roots, so they can run side-by-side without corrupting or blocking each other. Production, beta, and the normal Omi Dev bundle retain their established storage root.

Root cause and durable guards

  • Graph performance: camera-driven global scans and unbounded presentation density. The guard is snapshot-indexed layout plus viewport/LOD budgets, backed by a production-scale harness.
  • Named-bundle reliability: local state was isolated by bundle ID only at the instance-lock level, not at the storage boundary. The guard derives a dedicated storage root from each named development bundle ID.
  • Recovery: AgentSync previously logged recoverable local database failures without notifying the database lifecycle owner. It now reports only recognized SQLite I/O/corruption codes so the stale pool can be rotated safely.
  • QA routing: --yolo supplies dev defaults without overwriting an explicit backend selection.

Product invariants

  • INV-MEM-1 — this changes only the desktop projection and local cache behavior around the existing canonical knowledge graph; it does not add a memory tier, store, or access policy.
  • INV-DATA-1 — desktop presentation only. Nothing here reads, writes, routes, or retains customer data differently; the atlas draws the knowledge graph the backend already returns.
  • INV-AUTH-1 — the touched storage and sync paths preserve the existing session owner; named-bundle cache isolation does not alter authentication or session invalidation policy.

Validation

  • cd desktop/macos && xcrun swift test --package-path Desktop --filter 'MemoryAtlasPerformanceHarnessTests|MemoryAtlasLayoutTests|MemoryGraphRevisitTests|DesktopAutomationSecondaryActionTests/testMemoryAtlasHarnessActionsPostBoundedViewportNotifications'
  • cd desktop/macos && xcrun swift test --package-path Desktop --filter DesktopLocalProfileTests
  • cd desktop/macos && xcrun swift test --package-path Desktop --skip-build --filter RewindDatabaseLifecycleTests/testAgentSyncDatabaseFailureReportingClosesPoolForRecovery
  • cd desktop/macos && bash tests/test-yolo-dev-backend.sh
  • python3 desktop/macos/scripts/check_desktop_test_quality.py
  • scripts/pr-preflight --pr-body-file /tmp/omi-memory-atlas-pr-body.md
  • Built and signed /Applications/omi-memory-atlas-types.app; live authenticated check loaded 1,291 memories with no error and rendered a non-empty Atlas (1,946 nodes / 2,784 edges).

Brain Map: territories, island names, and Escape

The map now reads as a map. Neighbourhoods are drawn as islands with real
coastlines — a scalar influence field, argmax ownership per cell, marching
squares — so territories tile by construction and a group that lives in two
places shows as two islands. Ground two groups share is left as water: the
winner has to beat the runner-up by a margin, or nobody gets it. The kernel is
sized from the map's own median nearest-neighbour spacing, because a fixed
radius silently deleted every region on a small account.

Every drawn island carries its name, written on the island and shortened to one
landmark, and entities standing on named ground give up their labels until you
go in. Which names to hide and which islands can be drawn define each other, so
placement runs twice; both single-pass versions are visibly wrong.

Escape now pops one layer per press — search, selection, the place you are
inside, then the map itself — instead of clearing two things at once while the
newest mode had no keyboard exit at all. The last step calls a leave action the
host supplies (the page returns to Memories, the hub tab to the hub); it cannot
travel up to the window, because a canvas takes no focus and onExitCommand
there never fires. That is a wider problem than this PR — filed as #10698.

The island you are inside stays drawn while you zoom in and select entities on
it, which is the whole point of having gone in.

Verified live (omi-pr-9499 dev bundle, 1,161-entity account)

  • Entered Cursor IDE, selected the Cursor entity inside it: all three of the
    region's islands stay outlined and named at 395% with the inspector open.
  • Three Escapes walked the layers — selection cleared with the island intact,
    neighbourhood left with every coastline back, page closed to Memories.
  • xcrun swift test --package-path Desktop: 3,300 tests, 0 failures.
  • swift-format lint-scope clean; swiftlint 0 violations in 913 files.

Review round

An adversarial pass over the working tree found three states this work created
or left standing, each fixed with a test:

  • Escape dropped a whole breadcrumb trail at once — following three related
    entities and pressing Escape returned to the map instead of the previous
    entity. It now pops one hop at a time.
  • Entering a region large enough to fill the map clamped the camera to the
    minimum zoom, putting the departure threshold below the minimum: the mode
    looked leavable by zooming out and was not. It now offers no zoom-out exit
    there rather than a broken one.
  • A neighbourhood id belongs to the snapshot that detected it, but survived a
    graph rebuild — leaving the map "inside" a place with no coastline, no
    caption, and, on the inline surface, no Escape monitor to get out with.

Those three rest on unit tests rather than a hand-run: automation cannot build
a selection trail (selecting by label resets it), and the other two need a
map-filling region and a destructive graph rebuild on a live account.

Failure class

Failure-Class: none

@Git-on-my-level

Copy link
Copy Markdown
Member Author

Rebased onto latest main (was 11 commits behind). No code changes — the existing commits apply cleanly.

Verification before push:

  • git diff --check — clean
  • xcrun swiftc -parse on all changed Swift sources — no errors
  • Desktop changelog fragment present and valid
  • scripts/pr-preflight — 6/6 checks passed (diff-hygiene, architecture-guardrails, product-invariants INV-MEM-1, desktop-changelog-data, desktop-changelog-entry, desktop-e2e-flow-coverage)

Post-push CI: all checks green (Desktop Swift Build & Tests, contracts, desktop-core-e2e-t0, Hygiene, Detect Changes).

No unresolved review threads on this PR.

Git-on-my-level and others added 5 commits July 14, 2026 21:06
…pop delight

Turn the canonical memory atlas from a static picture into something you
navigate through time, and clean up the two-ego-node confusion.

- Time axis: a scrubbable histogram + playhead built on entity createdAt.
  Press play to watch your memory grow (spawn-pop bloom as the playhead
  reaches each new entity); the as-of counter and connections roll up live.
  Auto-plays on open; pausing or scrubbing persists an opt-out
  (memory_atlas_timeline_autoplay). Degrades gracefully to the legacy legend
  when timestamps carry no spread.
- Single "you": the layout engine now collapses duplicate self nodes (a
  generic "User"/"Me" or a second person sharing the account name) into the
  one anchor, rerouting their relationships instead of drawing two ego nodes.
- Render planner gains an as-of time filter (anchor always exempt); edges
  respect their own createdAt.
- ViewExporter: a deterministic, timestamped atlas sample so the timeline is
  offscreen-renderable for QA (no signed-in account needed).
- Automation: memory_atlas_set_time bridge action to scrub/play/reset.

Tests: 5 new hermetic tests (self-collapse + self-loop drop, timeline
span/bucket/nil, as-of filter through the real render planner). Verified in a
named bundle against the real 1,946-entity graph and via an offscreen export
capturing the timeline at a mid-cursor frame.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
…ory-atlas-type-layout

# Conflicts:
#	desktop/macos/Desktop/Sources/DesktopAutomationBridge.swift
#	desktop/macos/Desktop/Sources/MainWindow/Pages/MemoriesPage.swift
#	desktop/macos/Desktop/Sources/MainWindow/Pages/MemoryGraph/CanonicalMemoryAtlasView.swift
#	desktop/macos/Desktop/Sources/MainWindow/Pages/MemoryGraph/MemoryGraphPage.swift
#	desktop/macos/Desktop/Tests/DesktopAutomationSecondaryActionTests.swift
#	desktop/macos/Desktop/Tests/MemoryAtlasLayoutTests.swift
#	desktop/macos/Desktop/Tests/MemoryAtlasPerformanceHarnessTests.swift
#	desktop/macos/changelog/unreleased/20260711-memory-atlas.json
Git-on-my-level and others added 7 commits July 16, 2026 17:39
…pe-layout

# Conflicts:
#	desktop/macos/Desktop/Sources/AgentSyncService.swift
#	desktop/macos/Desktop/Sources/OmiSupport/DesktopLocalProfile.swift
#	desktop/macos/Desktop/Sources/Rewind/Core/RewindDatabase.swift
#	desktop/macos/Desktop/Sources/ViewExporter.swift
Verification: xcrun swift build -c debug --package-path desktop/macos/Desktop; xcrun swift test --package-path desktop/macos/Desktop --filter MemoryAtlas(LayoutTests|PerformanceHarnessTests)|DesktopLocalProfileTests; named bundle QA via omi-ctl on com.omi.omi-memory-atlas-types.
Verification: xcrun swift test --package-path desktop/macos/Desktop --filter DesktopLocalProfileTests.
Verification: focused macOS regression suite passed (41 tests); make preflight passed.
Verification: Atlas memories bridge flow passed on omi-memory-atlas-types.
The app/ Dart files were formatted with the SDK default language version
(3.12) but CI resolves the package language version (3.0 from
sdk: '>=3.0.0 <4.0.0') after flutter pub get. This produced 19 files
that dart_style 3.1.6 formats differently between the two language
versions. Reformatting with --language-version 3.0 matches CI exactly.
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Monitor summary — Hygiene + Formatting fixes

Changes:

  • Added Failure-Class: none declaration to the PR body. The PR has fix: commits but no failure-class declaration, which failed the failure-class-protocol Hygiene check.
  • Reformatted 19 Dart files in app/ to match the Dart language version 3.0 that CI resolves after flutter pub get (from sdk: ">=3.0.0 <4.0.0"). The local formatter defaults to language version 3.12, which produces different output for the same dart_style 3.1.6. Formatting with --language-version 3.0 matches CI exactly.

Verification:

  • scripts/failure-class validate --base origin/main --head HEAD --pr-body-file <body> → ok: true
  • dart format --line-length 120 --language-version 3.0 --set-exit-if-changed --output=none on all 21 changed Dart files → 0 changed
  • CI: Hygiene ✓ pass, Formatting ✓ pass (previously both failed)
  • Desktop Swift Build & Tests still pending (pre-existing, unrelated to this fix)

Git-on-my-level and others added 12 commits July 25, 2026 14:25
# Conflicts:
#	.github/scripts/product_file_line_count_ratchet_baseline.json
#	app/lib/services/services.dart
#	desktop/macos/Desktop/Sources/MainWindow/DesktopHomeView.swift
#	desktop/macos/Desktop/Sources/MainWindow/Pages/MemoriesPage.swift
#	desktop/macos/Desktop/Sources/Rewind/Core/VideoChunkEncoder.swift
#	desktop/macos/e2e/flows/memories.yaml
The Memory hub's Brain Map destination rendered MemoryGraphPage
unconditionally, so canonical-cohort users still got the legacy SceneKit
graph there even though the atlas had shipped behind
MemoryGraphPresentationMode. The gate was only consulted by the inline
entry point inside the Memories list, which is not the surface users
reach from the Memory menu.

Resolve the destination through the same gate: canonical-cohort users
get the atlas, everyone else keeps the legacy graph. The hub already
owns navigation chrome, so this adds CanonicalMemoryAtlasTabView — a
header-less presentation that renders the surface full-bleed instead of
stacking the atlas page's own back/title bar under the hub bar.

The destination also establishes the lifecycle capability itself via
loadMemoriesIfNeeded(). Without it, opening straight into a persisted
Brain Map destination resolves the legacy graph for a canonical user
purely because the Memories destination was never visited.

Verification:
- xcrun swift test --package-path Desktop --filter
  'MemoryHubBrainMapRoutingTests|MemoryAtlasLayoutTests|MemoryAtlasPerformanceHarnessTests|MemoryGraphRevisitTests|MemoryLayerFilterTests'
  -> Executed 55 tests, 0 failures
- xcrun swift test --package-path Desktop --filter
  'DesktopLocalProfileTests|RewindDatabaseLifecycleTests|DesktopAutomationSecondaryActionTests|APIClientMemoryLifecycleHeaderTests'
  -> Executed 45 tests, 0 failures
- bash scripts/swift-format-wrapper.sh lint-scope -> clean
- python3 scripts/check_desktop_test_quality.py -> OK (55 files / 154 sites)
- check_product_file_line_count_ratchet.py -> OK (baselines raised with
  justifications for the two files this grows)
- The new static checker was confirmed to fail against the pre-fix
  source, so it catches the defect it was written for.

Not yet exercised live: the signed omi-pr-9499 QA bundle is rebuilt from
this commit but the cohort path has not been clicked through in an
authenticated session.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
run.sh --help documents OMI_FORCE_CANONICAL_MEMORY_ATLAS=1 as the local
QA override for the canonical atlas rollout gate, but nothing plumbed it
to the app. `open` starts the bundle from launchd rather than from
run.sh's shell, so the variable never reached the process; only the
direct-exec fallback (taken solely when `open` fails) inherited it. The
documented flag silently did nothing on the normal launch path.

Forward it with `open --env` from a build_launch_env_args() helper, on
every `open` invocation on the launch path so the override does not work
on some transports and not others.

The optional array is expanded as ${arr[@]+"${arr[@]}"} rather than bare
"${arr[@]}" per FC-shell-unset-array-under-nounset: run.sh sets only
`set -e` today, but the bare form traps `unbound variable` on macOS's
bash 3.2 the moment anything adds `set -u`. The contract test asserts
the safe form, as that class's canonical prevention requires.

Verification:
- bash desktop/macos/tests/test-launch-env-forwarding.sh -> PASS
- Negative controls: the test fails against the pre-fix run.sh (helper
  absent) and against a variant rewritten to the bare array form
  ("3 'open' launch invocations but only 0 forward LAUNCH_ENV_ARGS in
  the nounset-safe form").
- Confirmed `open --env` is supported on this macOS, and verified under
  `bash 3.2 -eu` that the empty array expands to zero words and the
  populated array to `--env K=1`.
- bash -n desktop/macos/run.sh -> syntax OK
- python3 .github/scripts/test_desktop_manifest_routes.py -> 4 tests OK

Registered as desktop-launch-env-forwarding in
.github/checks-manifest.yaml with both local and ci lanes.

Failure-Class: none

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
QA on a real 26-entity account showed the atlas as a knot of unnamed
dots in the upper middle of an otherwise empty canvas, under a timeline
footer that took roughly 40% of the window. Five separate causes:

1. Timeline footer height. A bare `Spacer()` sat inside the footer's
   VStack, where it expands vertically and takes the space from the
   atlas canvas. The level label and Now button were also stacked
   vertically instead of sitting in the header row. Rebuilt as two tight
   rows (state, then scrubber flanked by its range endpoints).

2. Single-type layout. `centers(for:)` puts one active type at the top
   of the constellation ring (0.5, 0.25), so every node orbited a point
   in the upper middle. A lone constellation now takes the star center.

3. Sparse orbits. The ring between constellations is what normally fills
   the canvas; with one or two types there is no ring, so the orbits now
   expand to do that work.

4. Label and mark budgets. Both are absolute constants tuned for
   thousands of entities ("3 per cluster, 12 total", 2.1pt dots). An
   atlas small enough to name in full now names it in full and draws a
   mark sized to the graph rather than to a crowd.

5. Two marks per entity. The interactive overlay was a VStack of ring
   over label, and `.position` centers that whole stack — so the ring
   floated above the point while the Canvas painted the dot on it. The
   label now hangs in an overlay, outside the laid-out frame.

Also restores a rebuild control. The legacy Brain Map had one; without
it a thin or stale server graph has no recovery path from inside the
atlas.

Verification:
- xcrun swift test --package-path Desktop --filter
  'MemoryAtlas|MemoryGraph|MemoryHub|MemoryLayer|DesktopAutomationSecondaryActionTests'
  -> Executed 94 tests, 0 failures (64 after adding the new cases)
- Rendered both cases offscreen via the ViewExporter and compared before
  and after: `--export-single 14` (dense, 5 types) and `--export-single
  15` (new single-type fixture). The dense render is unchanged apart
  from labels now sitting correctly under their rings.
- bash scripts/swift-format-wrapper.sh lint-scope -> clean
- python3 scripts/check_desktop_test_quality.py -> OK
- check_product_file_line_count_ratchet.py -> OK (baseline raised with
  justification)

Not verified live: the machine locked partway through, so this is
offscreen-render evidence rather than a click-through of the running
bundle. The atlas is confirmed loading the real account graph (26 nodes
/ 30 edges via the automation bridge's memory_graph_snapshot).

Failure-Class: none

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Upstream BasedHardware#10541 unified Memory navigation into the top bar, moving the
hub destination into a DesktopHomeView @AppStorage binding and wrapping
the Memories destination in the readable-width adaptiveContent frame.
Resolved by keeping both: the destination is now the upstream binding,
and the Brain Map case still routes through the canonical atlas gate.

testSecondaryHomePagesReturnHomeOnEscape pinned the literal indentation
of the .onExitCommand block, which this branch's mainContentContainer
extraction re-indents without changing behavior. Relaxed it to match the
handler regardless of nesting depth.

Verification:
  swift build                                     -> Build complete
  swift test                                      -> 3195 tests, 0 failures
  swift-format-wrapper.sh lint-scope              -> clean
… graph

Raising the small-atlas label budget was not enough: collision admission
became the new binding constraint. On the real 26-entity account only 16
entities were named — the other 10 rendered as anonymous dots, which is
the same "what am I looking at" problem the budget fix was meant to
solve. admitLabels drops any name whose rect intersects an admitted one,
which is right for thousands of entities and wrong for 26.

A name that collides below its mark is now retried above it, and only
dropped if neither fits. The flip is gated on the small-atlas predicate,
so a dense atlas keeps dropping colliding names — its label overlay must
stay bounded. The two label overlays share an extracted nodeLabel so the
gap reads identically above and below.

Verification:
  Negative control (allowsFlipAbove: false)  -> 19 of 26 named, test fails
  With the flip                              -> 24 of 26 named, test passes
  The last two are near-coincident marks; a name there would be less
  readable than none, so the test asserts the anonymous tail is gone
  rather than perfect collision handling.

  swift build                                -> Build complete
  swift test                                 -> 3196 tests, 0 failures
  swift-format-wrapper.sh lint-scope         -> clean
  check_product_file_line_count_ratchet.py   -> OK
Four changes to the Memory surfaces, all pulling the same direction —
one place to look at an entity, one place to look at a memory:

- Brain Map is the only name shown for this surface. The atlas replaced
  the legacy graph on the destination that was already called Brain Map,
  so "Memory atlas" was a second name for one place. "Atlas" survives in
  type and symbol names only.
- The Memories page no longer carries an atlas card. A second entry
  point to the Brain Map competed with the memories that page exists to
  show; the hub tab is now the only way in. The card, its bounded
  Canvas preview, and its empty state are deleted rather than orphaned.
- Selecting an entity opens MemoryAtlasDetailPanel on the right: type,
  connections, and the memories the entity is drawn from, read in place.
  "View evidence" used to switch the hub to Memories, discarding the
  camera, the time cursor, and the selection to read one memory. The
  panel is a sibling of the map, not an overlay, so the map narrows
  instead of being covered. Compact surfaces keep the bottom strip.
- Memory detail on the Memories page moves from a modal sheet to a side
  panel with the same geometry, so both Memory surfaces behave alike.
  The readable-width cap yields while a panel is open, so the panel
  takes its width from the window rather than from the list column.

The surface takes an evidenceProvider rather than a navigation callback,
so it resolves cited memory ids without depending on the memories layer;
ids not yet paged in are reported as a count, never silently dropped.

Also adds a memory_graph_rebuild automation action: the rebuild control
is otherwise reachable only by clicking, which makes it untestable on a
machine without accessibility access.

Verification:
  swift build                               -> Build complete
  swift test                                -> All tests passed (3199)
  swift-format-wrapper.sh lint-scope        -> clean
  check_product_file_line_count_ratchet.py  -> OK

  New coverage: evidence resolution drops unloaded ids and keeps list
  order; a static checker fails if the Brain Map's evidence path
  reintroduces a destination write; the width cap yields on open panel.
Found while QAing the atlas against a real account: the Brain Map opened
permanently blank while the API had 26 entities, and the app log showed a
knowledge-graph rebuild POST nobody asked for.

One cause. MemoryGraphPresentationMode resolved from a Bool, so "this
account is not canonical" and "no authoritative response has arrived yet"
were the same answer, and the destination mounted the legacy graph for
the frames before the first memory response. That mount is not inert:

- It calls prepareGraph() on the graph view model the atlas also uses,
  which latches isPreparing. The flip to the atlas cancels that task
  mid-fetch, and the defer that clears the latch is itself skipped when
  the generation moved. The atlas's one-shot .task then hit
  `guard !isPreparing` and returned without ever loading, so the surface
  stayed empty for the rest of the session.
- prepareGraph() then reached its empty-graph bootstrap. `isEmpty`
  starts true and only a successful load clears it, so the cancelled
  fetch read as an empty graph and it issued rebuildKnowledgeGraph
  against a healthy 26-entity graph. The backend deletes the stored
  graph before regenerating, so a cancelled bootstrap can leave an
  account with nothing.

Repaired at both boundaries rather than at the symptom:

- MemoriesViewModel publishes canonicalLifecycleCapabilityEstablished,
  set wherever an authoritative exposure is committed and cleared on
  sign-out. The gate gains an `undetermined` case; the destination shows
  a neutral spinner and mounts neither surface until the cohort is known.
- loadGraph reports whether it authoritatively completed, and the
  bootstrap requires that instead of inferring emptiness from a sentinel.

Failure-Class: FC-unestablished-capability-default

Verification:
  swift build                               -> Build complete
  swift test                                -> All tests passed
  swift-format-wrapper.sh lint-scope        -> clean
  check_product_file_line_count_ratchet.py  -> OK
  scripts/failure-class validate            -> OK

  New coverage: an unestablished capability resolves to .undetermined
  regardless of the stale Bool it carries, both cohorts still resolve to
  a real surface once established, the QA override still short-circuits,
  and a static checker fails if the destructive bootstrap is re-gated on
  isEmpty alone.
The inspector is only reachable by tapping the canvas, so it cannot be
exercised on a machine without accessibility access, and reviewing it
meant trusting a description. Adds a preview-selection seam alongside
the existing previewTimeCursor and an 18-brain-map-inspector export
fixture that opens an entity with connections and evidence.

Verification:
  --export-single 16 -> 18-brain-map-inspector.png (1400x820)
  Render shows the entity header, type and connection count, the
  connections list, an evidence card with its date, and the map
  narrowing beside the panel rather than being covered by it.
…page

The Brain Map reported "3 more memory entries not loaded yet" for entities
whose evidence was sitting on disk. Citations were resolved against
MemoriesViewModel.memories — one tier-filtered, device-scoped page of a browse
— while the graph cites memories from all of them.

MemoryStorage gains a batch id lookup that is deliberately unfiltered by tier,
device scope, or dismissal: the caller already knows exactly which memories it
wants because something else named them, and applying browsing filters there
silently drops cited evidence.

Also drops rows whose persisted content is empty. Neither client write path can
create one, so an empty row means the backend sent it and every sync
re-persists it; rendering it produced a blank, unreadable card. Same trade the
malformed-tier guard beside it already makes.

Verified: xcrun swift test --package-path Desktop (3236 tests, 0 failures);
live against the account in the report, entity 18c53f39 now shows all three
cited memories with dates.

Failure-Class: none

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Three defects the modal sheet hid, and one it caused:

- "Where this came from" read `source`, `sourceApp`, `inputDeviceName` and
  `confidence`. None of those exist on the server's memory model — they are
  desktop-local fields on ServerMemory that decode to nil for every synced
  memory — so the section rendered its heading above a bare timestamp for all
  1044 memories on this account. It now reads the capture device and the
  `app:<name>` tag, which is where that data actually lives, and keeps the
  local-only fields as fallbacks. The app tag stops repeating itself in Tags.
- Save appeared to do nothing. `selectedMemory` is a value copy and
  `ServerMemory.content` is immutable, so a successful edit updated the server,
  the cache and the list but never the open panel. Invisible in a modal that
  dismissed on save; the whole point of a panel is that it stays.
- The editor was 80pt tall — about three lines of a twelve-line memory.
- Publishing was a switch beside a trash can. Public is the only gate that
  feeds a memory into the user's shareable persona, so it moves into the
  secondary actions menu behind a confirmation that says so.

The panel also stops clipping: the old sheet ended in .frame(width: 450) and
laid out at 450 inside a 360pt column, cutting words mid-glyph and leaving its
600pt background short of the window.

Below the width where a text field and five pills fit on one line, the search
field now takes its own line rather than collapsing to "Sea".

Verified: xcrun swift test --package-path Desktop (3236 tests, 0 failures);
live in omi-pr-9499 — a Discord focus memory now reads "Mac · Discord".

Failure-Class: none

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The inspector named things it could not open. Connections were captions and
cited memories were read-only text, so a relationship was a dead end and a
memory existed only inside the graph.

- Clicking a painted connection selects the relationship itself and inspects
  it: which two entities it joins, and the memories behind that specific claim
  rather than everything either endpoint touches. Hit testing lives outside the
  view so the two rules that matter — a line is picked only when the click is
  genuinely on it, and the nearest wins — are testable without a window. The
  5pt tolerance stays inside the 12pt node radius so dots stay clickable.
- A listed connection opens the entity on its other end, and the inspector
  keeps a trail so following one is reversible. Only following a listed
  connection extends the trail; reaching for something on the canvas starts a
  fresh one, so "back" always means where the user actually was.
- A cited memory opens on the Memories page with its detail panel showing. The
  hub switches destination only after the memory is open, so a citation the
  cache cannot resolve never strands the user on an empty panel.
- The anchor wears the user's own name. The extractor writes a generic "The
  User" whenever no memory happens to name them, and collapsing the synonyms
  onto that node still left the one dot they can identify on sight unnamed.

Adds `memories_open_detail` to the automation bridge: opening a memory is a
click on a card, so the detail panel was unreachable to cursor-free QA.

Verified: xcrun swift test --package-path Desktop (3236 tests, 0 failures);
live in omi-pr-9499 — the anchor now reads "David", entity 18c53f39 lists six
followable connections and its three cited memories.

Failure-Class: none

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Git-on-my-level and others added 6 commits July 26, 2026 12:56
…e places

Neighbourhoods that shared a lot of members were drawn on top of one
another, so the busiest part of the map — the part most worth reading —
came out as a single mess. Cohesion could not fix it: it holds each group
to its own radius, and two groups satisfy that perfectly while covering
the same ground. The only thing keeping them apart was the repulsion
between individual entities, which knows nothing about groups.

Overlapping neighbourhoods now push each other apart, and the account
holder repels in proportion to the map they sit in the middle of rather
than as one entity among a thousand tethered to them.

Three things this cost a round to get right, all kept as comments where
they bite:

- Separation has to work from the space a group actually occupies, not
  the ideal spacing its size implies. Cohesion packs groups far tighter
  than that estimate, so clearing the estimate demands more canvas than
  exists and the force stalls against centre gravity — cranking it 16x
  moved the gap from 1.11 to 1.15.
- The margin scales with the *smaller* of two groups. Scaled by their sum,
  every small group must clear the largest group's whole radius, and since
  the push splits by population the small group travels: dozens of them
  end up in a ring of debris at the canvas edge.
- The account holder's push is a share of the map, not a fixed weight. Fixed,
  it is calibrated for hundreds of tethers and blows a 26-entity map apart
  hard enough to collide its own labels.

Measured on the account-shaped fixture and on a second one built for the
case this exists for — three large heavily cross-linked groups amid a long
tail of small ones — over six seeds each. Share of entities inside a
neighbourhood's drawn disc belonging to a different neighbourhood: 0.483 to
0.390 on the even fixture, 0.530 to 0.477 on the large-cluster one.
Community precision is unchanged (0.740/0.738 and 0.912/0.905). Room around
the account holder, in units of the map's typical neighbour gap: 5.76 to
6.85.

Held well below where the distinctness metric peaks. Pushed harder the
groups do read as more distinct, but the bulk of the entities bunch toward
the middle while the sparse tail is fitted to the canvas edge — a dense
blob ringed by specks. That is the 95th-percentile-over-median radius,
which at 1.0 reached 2.6 on the large-cluster fixture against 2.0 left
alone; here it is 2.1.

Verification:
- xcrun swift test --package-path Desktop — 3286 tests, 0 failures
- swift-format lint-scope clean; swiftlint 0 violations in 911 files
- Ran the omi-pr-9499 dev bundle against the live 1,096-entity account and
  read the map at 100% and 75%

Both new tests were confirmed to fail with their force disabled: intrusion
0.380 against a 0.33 ceiling, anchor clearing 5.76 against a 6.2 floor. Two
earlier small-fixture versions of them passed either way and were deleted
rather than kept — at 20 and 40 entities the forces do nothing measurable,
which is the same trap the fixture's own docstring warns about.

Failure-Class: none
… Brain Map

The account holder was never the only superhub. An account has a handful
of entities — the project, the tool, the repository — present in hundreds
of memories, and sharing a memory with one of those is true of nearly
everything, so it separates nothing. That is exactly the argument that
already excludes the account holder from this projection; it was just
never applied to anyone else.

The cost was structural rather than cosmetic. Co-occurrence is sparsified
to each entity's strongest six partners, and a ubiquitous entity wins a
slot in almost every one of those lists — so the step that is supposed to
turn a hairball into structure was spending most of its budget re-drawing
the same few hubs. On a fixture with five entities in a third of all
memories, they took *half of every edge on the map*.

Each shared memory is now weighted by the inverse document frequency of
both entities in the pair. Discounted, not filtered: an entity whose only
relationships are to a ubiquitous one still has them, and dropping those
would strand it in the halo as though it were connected to nothing.

Measured over six seeds of three fixtures — an even one, one with three
large cross-linked groups, and one that adds the five ubiquitous entities:

                     precision       intrusion       rim reach
  even             0.732 → 0.755   0.426 → 0.316   1.973 → 1.886
  large-cluster    0.908 → 0.908   0.534 → 0.438   2.126 → 2.017
  superhub         0.435 → 0.866   0.868 → 0.608   1.685 → 1.511

The superhub column is the one this exists for, but every fixture improves
including the two with no such entity by construction, because the same
discount separates a merely popular entity from a genuinely related one.
Hub share of drawn edges falls from 51% to 19%.

It also repays what the previous commit borrowed: separation costs outlier
reach (1.90 to 2.02 on the large-cluster fixture) and this pulls it back to
2.02 against a 2.02 baseline, so the two together are reach-neutral and far
more distinct.

Recorded while re-measuring: with this in place, `anchorRepulsionShare` now
costs about 0.01 of precision and of distinctness rather than being free.
Its justification is the clearing it opens around the account holder
(5.76 → 6.85), which these three measures cannot see. Said so in its
docstring so the trade stays visible.

Verification:
- xcrun swift test --package-path Desktop — 3288 tests, 0 failures
- swift-format lint-scope clean; swiftlint 0 violations in 911 files
- Ran the omi-pr-9499 dev bundle against the live 1,096-entity account:
  Singapore now reads as a detached island, the stably.io contacts separate
  into their own named region, and several neighbourhoods that were buried
  are now found and named

The discriminating test was confirmed to fail without the weighting: the
ubiquitous pair scores 1.0 against the specific pair's 0.5, which is the
defect stated exactly.

Failure-Class: none
… can see

Spent the session making the geometry better and never checked whether any
of it was reaching the screen. It was not. The map computed neighbourhoods,
named them, and measurably pushed them apart, and then drew them as a
radial gradient at 3.8% opacity that faded to nothing at the edge. Position
alone was being asked to carry structure while colour carried entity type,
so a map with genuinely good clustering still read as fog.

Three changes, none of them to the solver:

- Regions are painted as a plateau rather than a peak — flat across most of
  the radius, released near the rim — so a neighbourhood is a shape instead
  of a smudge under its densest part.

- A region is outlined only when the outline would be true. An outline is a
  claim about a border, and the large central communities overlap each
  other; ringing them alike drew a stack of enormous ellipses that said less
  than the tint alone. Each region now reports the share of entities inside
  its own patch that belong to it, and only those above 0.62 get an edge.
  The rest keep the fill: still findable, without asserting a boundary that
  is not there.

- The map is fitted to its bulk rather than its tail (90th percentile rather
  than 98th) and the halo of unconnected entities is pulled in from 1.07x
  the drawing area plus 0.05 per lap to 1.05x plus 0.03. Those two were the
  same defect seen from opposite ends: scaling so the last stragglers land
  on the edge squeezed everything readable into the middle, which then left
  the ring of unconnected entities an absurd distance outside it. The tail
  is not discarded — `softFold` already bounds it inside the area.

Verification:
- xcrun swift test --package-path Desktop — 3290 tests, 0 failures
- swift-format lint-scope clean; swiftlint 0 violations in 911 files
- Ran the omi-pr-9499 dev bundle against the live account: Singapore and the
  stably.io contacts now read as bounded territories, the sprawling central
  communities as soft fills without false borders

Two things I tried first and did not keep, both recorded because the next
person will consider them:

- Seating the halo against the structure's actual silhouette, per direction.
  A radial profile cannot describe a long thin map — the directions across
  it are empty, so they inherit the reach of the directions along it and an
  entity above a wide flat map is pushed out as far as the map is long. An
  occupancy grid marched inward fixes that but walks to the centre on any
  heading with nothing on it, and hugging the structure at all conflicts
  with the existing contract that an unconnected entity sits outside the
  drawing area — a contract worth more than the aesthetic. Bounded the rim
  instead.
- A test asserting the halo hugs the map's shape. It failed against what I
  actually built, so it was replaced with one asserting what shipped: the
  ring sits outside the drawing area and within 16% of it.

Failure-Class: none
…stlines

A neighbourhood was drawn as the ellipse covering most of its members,
which is the shape of an average rather than the shape of a group. Two
near each other overlapped, so the map could not honestly draw either
one's edge — the previous commit gated the outline on a purity threshold
for exactly that reason. And a group living in two places got one oval
spanning the gulf between them, claiming every unrelated entity standing
in it.

Territory is now awarded per patch of canvas: every member spreads
influence around itself, each patch belongs to whichever neighbourhood
is most present there, and the coast is the line where that answer
changes. Two properties follow, and they are the point of the approach —
no two territories can claim the same ground, and a group that lives in
two places gets two islands rather than a land bridge through someone
else's.

Two things this deliberately does not claim. Non-overlap is not the same
as honesty: ownership by a hair is not ownership, so a patch only becomes
land when its winner is clearly ahead of the runner-up, and genuinely
mixed ground between two interleaved groups stays water. And the kernel
is measured in units of how far apart the entities on this map actually
sit, not in absolute distance — a fixed radius tuned for a thousand
entities left a nine-entity account with no regions at all, which is how
that bug was found.

Verification:
- xcrun swift test --package-path Desktop — 3,294 tests, 0 failures
- Built omi-pr-9499 and read the live 1,114-entity account at overview
  and at 2.6x: coastlines are jagged, interlocking, and hug their groups;
  Singapore, the Omi cluster and the stably.io group each read as one
  island
- Two fixture bugs the first version of these tests hid, both fixed by
  changing the fixture rather than the threshold: "scattered" is
  meaningless without a denser group on the same map to be scattered
  relative to, and two adjacent blobs have a real dividing line, so the
  contested-ground claim is about interleaved groups only

Failure-Class: none

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…field

Three changes, all aimed at the same gap against the graph views this is
measured against.

The mesh is no longer rationed. Thirty-six of roughly fourteen hundred
connections were drawn at overview, which left the whole map to be read
from the positions of dots alone — clustering was there and invisible,
because what shows a group is dense wiring inside it and sparse wiring
out of it. Average degree on a real account is under three, so the full
mesh as hairlines is a texture rather than a thicket, and a connection
inside a neighbourhood is drawn brighter than one crossing between two,
so density falls off at a group's edge the way the graph says it does.

The projection is isotropic. Relaxation works in a square and knows
nothing about the window; projecting each axis onto its own side of the
viewport distorted whatever shape it found by the window's aspect ratio,
so the same account was a horizontal smear on a wide display and a tall
one when the window was dragged narrow. One scale from the shorter side
leaves the map's proportions alone and spends the extra width as margin.

And the account holder's spokes recede much further. The old edge budget
was holding eight hundred tethers back by accident; drawn in full at the
old weight they buried every other connection under a starburst.

The render-cost guards move with the budget rather than being deleted:
what actually bounds the paint is the node cohort one level up, since an
edge needs both endpoints on the map, and the segments batch into one
path per type per weight.

Verification:
- xcrun swift test --package-path Desktop — 3,294 tests, 0 failures
- swift-format lint-scope clean; swiftlint 0 violations in 913 files
- Built omi-pr-9499 and read the live 1,114-entity account: the map is a
  disc rather than a 2.4:1 smear, the mesh reads as structure, and the
  central starburst is gone. Zoomed to 2.6x and panned — labels and
  edges stay correct and the camera lands where it is aimed

Failure-Class: none

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Four things the territory layer was getting wrong, all of them reported
from a real account.

**Islands without names.** A neighbourhood holding two pieces of ground
got one caption over one of them; the other was outlined, filled, and
anonymous. The unit of naming is now the island rather than the
neighbourhood, and the map draws exactly the islands it can name — a
shape on this map always says what it is.

**Zooming in deleted the place.** Territories stopped at neighbourhood
zoom, so looking closer at an island made it and its name vanish. They
now survive to focus zoom, and a caption for an island the camera is
inside is anchored to the part of it still on screen. Once the user has
gone into a place, its island is drawn whatever else is in the way:
dropping it because its name collided with an entity label left them
zoomed into a blank canvas.

**Names too long to glance at.** Three members joined by separators ran
to the width of a paragraph and truncated into "ORACLE ACCESS ·
CONSULT-ORACLE · DAVI…". One landmark now, preferring labels that read
as names — short and few words — over sentences that merely fit. And
written on the island rather than floated above it, so nothing has to
connect the name to the shape. Islands too narrow to hold their own name
keep the old position above the coast.

**Crowding.** An entity standing on a named island gives up its label to
that island's caption, and gets it back when the user goes in. Which
names to hide and which islands can be drawn define each other, so
placement runs twice: one pass dodging every name to find the islands, a
second once the names standing on them are gone. One pass either way was
tried and both are wrong — dodging all of them pushes captions off their
own island, dodging none prints a caption across an entity that then
keeps its label.

Entering also frames the island that was pressed rather than the average
of the group's members, which for a two-lobed neighbourhood is the water
between them.

Adds `memory_atlas_enter_region`, because entering was reachable only by
clicking a small target computed from the live camera — the one
interaction this layer exists for was the one no check could drive.

Verification:
- xcrun swift test --package-path Desktop — 3,297 tests, 0 failures
- swift-format lint-scope clean; swiftlint 0 violations in 913 files
- Built omi-pr-9499 and drove the live 1,120-entity account: at overview
  all eight captions sit on their own islands; entering Singapore leaves
  its two islands alone with their entities named; entering Memory V2
  rollout — the case that failed before the guarantee — now draws and
  names it; leaving restores every coastline without moving the camera

Failure-Class: none

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Escape used to clear the search and the selection together — two decisions
for one keystroke — while the neighbourhood a user had gone into had no
keyboard way out at all, so the newest mode was the only one you could not
leave. And the map consumed every Escape whether or not it used one, which
made the Brain Map a page you could only leave with the mouse.

Now it pops one layer per press, innermost first: the search, then the
selection, then the place you are inside, then the map itself. The last step
calls a leave action the host supplies — the atlas page goes back to
Memories, the hub tab returns to the hub. It cannot travel up to the window
instead: a canvas takes no focus, so `onExitCommand` up there never fires
(BasedHardware#10698).

The island you are inside also stays drawn now. Selecting an entity or
zooming to inspect used to erase it, which are the two things a person does
immediately after arriving somewhere — both removed the only thing on screen
saying where they were. Inside a place the island is the frame, so it
outlasts both, and it is drawn a shade heavier than the rest to read as the
one thing the user chose.

Two fixes found on the way:

- Leaving on zoom-out was a fixed threshold, which made any island framed
  below it unenterable: entering set a zoom that immediately read as "zoomed
  back out" and threw the user straight back to the whole map. The threshold
  is now relative to the camera entering actually chose.
- `memory_atlas_select` takes a `label`, so a QA step can select the entity
  it is talking about instead of a server id nothing on screen shows.

Verified on the live 1,161-entity account (omi-pr-9499 dev bundle):
entered Cursor IDE, selected the Cursor entity inside it — all three of the
region's islands stay outlined and named at 395% with the inspector open.
Three Escapes then walked the layers: selection cleared with the island
intact, neighbourhood left with every coastline back, page closed to
Memories. Screenshots q0/q1b/q2b/q3b.

xcrun swift test --package-path Desktop: 3300 tests, 0 failures.
swift-format lint-scope clean; swiftlint 0 violations in 913 files.
Coastline hit testing, island caption placement, and the Escape ladder are
geometry and policy the atlas view asks questions of; none of it needs the
view. Keeping them in the same file was the single largest reason it kept
growing, so this change nets ~180 added lines there instead of ~590.

Pure move plus the visibility change a cross-file `private` requires. The
line-count baselines are raised to match, with the force layout getting its
first entry: it crossed the threshold in this branch.

xcrun swift test --package-path Desktop: 3300 tests, 0 failures.
…es flow

The territory geometry, the island naming, and the layered Escape had no e2e
flow claiming them, and neither did the memory provenance panel that landed
earlier on this branch. Adds the steps that exercise each — going into a
neighbourhood by its printed caption, selecting an entity on it and checking
the island survives, and walking Escape back out one layer per press — and
lists the files under the memories flow that now covers them.

Steps are written from the run done by hand on the 1,161-entity account, so
they describe what actually happens rather than what should.
…nch needle

The ordered launch-phase contract looks for the literal `open "$APP_PATH"` in
run.sh. 4a68e31 forwarded documented QA env overrides through that call, so
the line became `open ${LAUNCH_ENV_ARGS[@]+...} "$APP_PATH"` and the needle
stopped matching — the gate has been failing every push from this branch since,
on a launch path that is working correctly.

The needle now carries the expansion. Contract unchanged and still exact:
run.sh dispatches an `open` of the built bundle between announcing the start
and signalling that the launch went out.

Failure-Class: none

bash desktop/macos/tests/test-qualify-desktop-beta-contract.sh: passed.
# Conflicts:
#	.github/scripts/product_file_line_count_ratchet_baseline/desktop-swift-mainwindow.json
@Git-on-my-level
Git-on-my-level marked this pull request as ready for review July 27, 2026 06:11

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e143e0c527

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Git-on-my-level and others added 2 commits July 27, 2026 02:36
…view

All three are states the layered Escape work created or left standing.

Escape dropped a whole breadcrumb trail at once. Following three related
entities and pressing Escape returned to the map instead of the previous
entity — the same "two decisions for one keystroke" this change was meant to
end, and worse here because the trail is the only record of how the user got
where they are. It now pops one hop while the trail has one, and clears the
selection only at the start of the walk.

Entering a region large enough to fill the map clamped the camera to the
minimum zoom, which put the departure threshold *below* the minimum. Zooming
out could never cross it, so the mode looked leavable by zoom and was not.
`departureZoom` returns nil for that case, and the map offers no zoom-out exit
rather than a broken one; Escape and the caption still work.

A neighbourhood id belongs to the snapshot that detected it, but survived a
graph rebuild. If the rebuilt snapshot lost that id, the map stayed "inside" a
place that no longer existed: no coastline, no caption, and — on the inline
surface, which has no Escape monitor — no way out. It now leaves when the id
goes.

Found by codex against the working tree; each verified in the code before
fixing. The trail hop and both camera cases are covered by unit tests rather
than by hand: automation cannot build a selection trail (selecting by label
resets it), and the other two need a map-filling region and a destructive
graph rebuild on a live account.

xcrun swift test --package-path Desktop: 3388 tests, 0 failures.
swift-format lint-scope clean; swiftlint 0 violations in 932 files.
Record the atlas's local-projection fallback through
DesktopDiagnosticsManager.recordFallback when the server graph is
unavailable but a local projection is shown (P1 telemetry gap).

Seed entity evidence citations from the selected node's own memoryIds
before unioning edge IDs, so isolated entities and memories without
relationships show their evidence (P1 data gap).

Poll the canonical graph after a rebuild request instead of sleeping
once for 2 seconds and reloading, so a still-processing backend rebuild
does not leave the atlas blank (P2 stale reload).

Use the same square-span projection (min(w,h)) in label collision
detection as the drawing path, preventing horizontally adjacent labels
from overlapping on wide desktop windows (P2 geometry mismatch).

Restrict node hit-testing to the current render plan's visible nodes,
matching the existing connection hit-test that already uses
plan.visibleEdges (P2 invisible-node selection).

Restrict bridged NSError SQLite codes to known SQLite/GRDB domains so
unrelated POSIX or application errors sharing a numeric code cannot
rotate local storage (P2 false-positive recovery).
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Monitor summary — Addressed 6 Codex review threads

Pushed commit: ed11400b (all 3 files parse clean via xcrun swiftc -parse)

Thread Priority Fix
Local-projection fallback telemetry P1 Added DesktopDiagnosticsManager.recordFallback call when the atlas falls back from server graph to local projection
Entity evidence citations P1 citedMemoryIDs now seeds from selectedNode.node.memoryIds before unioning edge IDs
Poll after atlas rebuild P2 Added rebuildCanonicalAtlas() that polls until the replacement graph appears (max 10 × 3s); wired both atlas rebuild callbacks to it
Label collision projection P2 renderedPoint now uses projectionSpan (min(w,h)) matching the drawing path
Node hit-test scope P2 nearestNode now takes visibleNodes from the render plan, matching connection hit-testing
SQLite NSError domain restriction P2 Bridged NSError codes now gated on known SQLite/GRDB domains via isKnownSQLiteDomain

All 6 review threads resolved.

Pre-existing CI failures (not introduced by this commit):

  • Formatting — Dart files in app/ (pre-existing)
  • Hygiene — product-file-line-count-ratchet (PR adds 171 files)

swift-format 602.0.0 reformats CanonicalMemoryAtlasView.swift
(nearestNode signature wrapping) and RewindDatabase.swift (paren
elision), raising their line counts to 4409 and 3547 respectively;
update the product-file-line-count baselines to match.

dart format --line-length 120 (Dart 3.12.2 from Flutter 3.44.8,
matching CI) reformats 73 changed app/ files to the package-resolved
formatter output. The prior format pass used Dart 3.12.0 without
resolved analysis_options, which produced different wrapping.

Verification:
- swift-format-wrapper.sh lint-scope: clean
- xcrun swiftc -parse on both Swift files: exit 0
- dart format --set-exit-if-changed --output=none (3.44.8): 0 changed
- check_product_file_line_count_ratchet.py: OK
Git-on-my-level and others added 8 commits July 27, 2026 18:18
renderedPoint is in MemoryAtlasRenderPlanner but calls projectionSpan
which is a static func on MemoryAtlasLayoutEngine. The unqualified
call compiled in the prior review-feedback commit because swift-format
drift masked the build error; the full CI test build exposes it:

  error: cannot find 'projectionSpan' in scope

Qualify as MemoryAtlasLayoutEngine.projectionSpan(of:) matching the
existing usage at line 3880.
NSSQLiteErrorDomain is a Core Data constant unavailable without
importing CoreData. The other domain comparisons in isKnownSQLiteDomain
already use string literals ("GRDB", "SQLite3", etc), so use the
string "NSSQLiteErrorDomain" for consistency.

CI test build error:
  error: cannot find 'NSSQLiteErrorDomain' in scope
Keep the center-zoom regression test on the same square projection used by rendering, and assert the small-atlas label budget against that real drawing surface.
Keep one prepared graph projection and transient render-plan cache per canonical revision, isolate the Canvas from unrelated memory-sync publications, and skip caption layout while the camera moves.

Failure-Class: none
Resolve the fixture source root from its script location so the hook's GIT_DIR does not erase the work-tree context the fixture verifies.

Failure-Class: none
@Git-on-my-level
Git-on-my-level merged commit 7559ed8 into BasedHardware:main Jul 27, 2026
32 checks passed
undivisible pushed a commit that referenced this pull request Aug 17, 2026
## Summary

- add a canonical-memory-only Memory Atlas for the macOS Memories page
while retaining the legacy graph for users who have not entered the
canonical lifecycle
- provide progressive entity/relationship exploration with deterministic
layout, viewport budgets, deep labelled Inspect mode, search, evidence
navigation, and automation coverage
- draw neighbourhoods as islands with real coastlines, name every island
on the island itself, and make Escape back out of the map one layer at a
time
- fix named Atlas QA bundle reliability: dedicated local storage,
recoverable SQLite pool rotation, and explicit `--yolo` backend routing

## Why

The legacy graph does not make relationship-rich canonical memory data
navigable at account scale. The Atlas builds rankings and layout once
per graph snapshot, culls presentation to the viewport, and increases
detail progressively as the user zooms.

The QA failure was separate from graph rendering: distinct named bundles
had different bundle IDs but shared one signed-in user's local Rewind
SQLite/WAL store. Running multiple named bundles concurrently caused
`SQLITE_IOERR` reads, which the Memories page surfaced as **Failed to
Load Memories**.

## User impact

- Canonical-memory users can explore relationships progressively and
drill to labelled, interactive nodes without reintroducing camera-driven
freezes.
- Legacy-memory users continue to receive the existing graph unchanged.
- Named QA bundles now have independent local cache/database roots, so
they can run side-by-side without corrupting or blocking each other.
Production, beta, and the normal Omi Dev bundle retain their established
storage root.

## Root cause and durable guards

- Graph performance: camera-driven global scans and unbounded
presentation density. The guard is snapshot-indexed layout plus
viewport/LOD budgets, backed by a production-scale harness.
- Named-bundle reliability: local state was isolated by bundle ID only
at the instance-lock level, not at the storage boundary. The guard
derives a dedicated storage root from each named development bundle ID.
- Recovery: AgentSync previously logged recoverable local database
failures without notifying the database lifecycle owner. It now reports
only recognized SQLite I/O/corruption codes so the stale pool can be
rotated safely.
- QA routing: `--yolo` supplies dev defaults without overwriting an
explicit backend selection.

## Product invariants

- `INV-MEM-1` — this changes only the desktop projection and local cache
behavior around the existing canonical knowledge graph; it does not add
a memory tier, store, or access policy.
- `INV-DATA-1` — desktop presentation only. Nothing here reads, writes,
routes, or retains customer data differently; the atlas draws the
knowledge graph the backend already returns.
- `INV-AUTH-1` — the touched storage and sync paths preserve the
existing session owner; named-bundle cache isolation does not alter
authentication or session invalidation policy.

## Validation

- `cd desktop/macos && xcrun swift test --package-path Desktop --filter
'MemoryAtlasPerformanceHarnessTests|MemoryAtlasLayoutTests|MemoryGraphRevisitTests|DesktopAutomationSecondaryActionTests/testMemoryAtlasHarnessActionsPostBoundedViewportNotifications'`
- `cd desktop/macos && xcrun swift test --package-path Desktop --filter
DesktopLocalProfileTests`
- `cd desktop/macos && xcrun swift test --package-path Desktop
--skip-build --filter
RewindDatabaseLifecycleTests/testAgentSyncDatabaseFailureReportingClosesPoolForRecovery`
- `cd desktop/macos && bash tests/test-yolo-dev-backend.sh`
- `python3 desktop/macos/scripts/check_desktop_test_quality.py`
- `scripts/pr-preflight --pr-body-file /tmp/omi-memory-atlas-pr-body.md`
- Built and signed `/Applications/omi-memory-atlas-types.app`; live
authenticated check loaded 1,291 memories with no error and rendered a
non-empty Atlas (1,946 nodes / 2,784 edges).


## Brain Map: territories, island names, and Escape

The map now reads as a map. Neighbourhoods are drawn as islands with
real
coastlines — a scalar influence field, argmax ownership per cell,
marching
squares — so territories tile by construction and a group that lives in
two
places shows as two islands. Ground two groups share is left as water:
the
winner has to beat the runner-up by a margin, or nobody gets it. The
kernel is
sized from the map's own median nearest-neighbour spacing, because a
fixed
radius silently deleted every region on a small account.

Every drawn island carries its name, written on the island and shortened
to one
landmark, and entities standing on named ground give up their labels
until you
go in. Which names to hide and which islands can be drawn define each
other, so
placement runs twice; both single-pass versions are visibly wrong.

Escape now pops one layer per press — search, selection, the place you
are
inside, then the map itself — instead of clearing two things at once
while the
newest mode had no keyboard exit at all. The last step calls a leave
action the
host supplies (the page returns to Memories, the hub tab to the hub); it
cannot
travel up to the window, because a canvas takes no focus and
`onExitCommand`
there never fires. That is a wider problem than this PR — filed as
#10698.

The island you are inside stays drawn while you zoom in and select
entities on
it, which is the whole point of having gone in.

### Verified live (omi-pr-9499 dev bundle, 1,161-entity account)

- Entered *Cursor IDE*, selected the *Cursor* entity inside it: all
three of the
region's islands stay outlined and named at 395% with the inspector
open.
- Three Escapes walked the layers — selection cleared with the island
intact,
  neighbourhood left with every coastline back, page closed to Memories.
- `xcrun swift test --package-path Desktop`: 3,300 tests, 0 failures.
- `swift-format lint-scope` clean; `swiftlint` 0 violations in 913
files.

### Review round

An adversarial pass over the working tree found three states this work
created
or left standing, each fixed with a test:

- Escape dropped a whole breadcrumb trail at once — following three
related
entities and pressing Escape returned to the map instead of the previous
  entity. It now pops one hop at a time.
- Entering a region large enough to fill the map clamped the camera to
the
minimum zoom, putting the departure threshold below the minimum: the
mode
looked leavable by zooming out and was not. It now offers no zoom-out
exit
  there rather than a broken one.
- A neighbourhood id belongs to the snapshot that detected it, but
survived a
  graph rebuild — leaving the map "inside" a place with no coastline, no
caption, and, on the inline surface, no Escape monitor to get out with.

Those three rest on unit tests rather than a hand-run: automation cannot
build
a selection trail (selecting by label resets it), and the other two need
a
map-filling region and a destructive graph rebuild on a live account.

## Failure class

Failure-Class: none
undivisible pushed a commit to undivisible/omi that referenced this pull request Sep 29, 2026
## Summary

- add a canonical-memory-only Memory Atlas for the macOS Memories page
while retaining the legacy graph for users who have not entered the
canonical lifecycle
- provide progressive entity/relationship exploration with deterministic
layout, viewport budgets, deep labelled Inspect mode, search, evidence
navigation, and automation coverage
- draw neighbourhoods as islands with real coastlines, name every island
on the island itself, and make Escape back out of the map one layer at a
time
- fix named Atlas QA bundle reliability: dedicated local storage,
recoverable SQLite pool rotation, and explicit `--yolo` backend routing

## Why

The legacy graph does not make relationship-rich canonical memory data
navigable at account scale. The Atlas builds rankings and layout once
per graph snapshot, culls presentation to the viewport, and increases
detail progressively as the user zooms.

The QA failure was separate from graph rendering: distinct named bundles
had different bundle IDs but shared one signed-in user's local Rewind
SQLite/WAL store. Running multiple named bundles concurrently caused
`SQLITE_IOERR` reads, which the Memories page surfaced as **Failed to
Load Memories**.

## User impact

- Canonical-memory users can explore relationships progressively and
drill to labelled, interactive nodes without reintroducing camera-driven
freezes.
- Legacy-memory users continue to receive the existing graph unchanged.
- Named QA bundles now have independent local cache/database roots, so
they can run side-by-side without corrupting or blocking each other.
Production, beta, and the normal Omi Dev bundle retain their established
storage root.

## Root cause and durable guards

- Graph performance: camera-driven global scans and unbounded
presentation density. The guard is snapshot-indexed layout plus
viewport/LOD budgets, backed by a production-scale harness.
- Named-bundle reliability: local state was isolated by bundle ID only
at the instance-lock level, not at the storage boundary. The guard
derives a dedicated storage root from each named development bundle ID.
- Recovery: AgentSync previously logged recoverable local database
failures without notifying the database lifecycle owner. It now reports
only recognized SQLite I/O/corruption codes so the stale pool can be
rotated safely.
- QA routing: `--yolo` supplies dev defaults without overwriting an
explicit backend selection.

## Product invariants

- `INV-MEM-1` — this changes only the desktop projection and local cache
behavior around the existing canonical knowledge graph; it does not add
a memory tier, store, or access policy.
- `INV-DATA-1` — desktop presentation only. Nothing here reads, writes,
routes, or retains customer data differently; the atlas draws the
knowledge graph the backend already returns.
- `INV-AUTH-1` — the touched storage and sync paths preserve the
existing session owner; named-bundle cache isolation does not alter
authentication or session invalidation policy.

## Validation

- `cd desktop/macos && xcrun swift test --package-path Desktop --filter
'MemoryAtlasPerformanceHarnessTests|MemoryAtlasLayoutTests|MemoryGraphRevisitTests|DesktopAutomationSecondaryActionTests/testMemoryAtlasHarnessActionsPostBoundedViewportNotifications'`
- `cd desktop/macos && xcrun swift test --package-path Desktop --filter
DesktopLocalProfileTests`
- `cd desktop/macos && xcrun swift test --package-path Desktop
--skip-build --filter
RewindDatabaseLifecycleTests/testAgentSyncDatabaseFailureReportingClosesPoolForRecovery`
- `cd desktop/macos && bash tests/test-yolo-dev-backend.sh`
- `python3 desktop/macos/scripts/check_desktop_test_quality.py`
- `scripts/pr-preflight --pr-body-file /tmp/omi-memory-atlas-pr-body.md`
- Built and signed `/Applications/omi-memory-atlas-types.app`; live
authenticated check loaded 1,291 memories with no error and rendered a
non-empty Atlas (1,946 nodes / 2,784 edges).


## Brain Map: territories, island names, and Escape

The map now reads as a map. Neighbourhoods are drawn as islands with
real
coastlines — a scalar influence field, argmax ownership per cell,
marching
squares — so territories tile by construction and a group that lives in
two
places shows as two islands. Ground two groups share is left as water:
the
winner has to beat the runner-up by a margin, or nobody gets it. The
kernel is
sized from the map's own median nearest-neighbour spacing, because a
fixed
radius silently deleted every region on a small account.

Every drawn island carries its name, written on the island and shortened
to one
landmark, and entities standing on named ground give up their labels
until you
go in. Which names to hide and which islands can be drawn define each
other, so
placement runs twice; both single-pass versions are visibly wrong.

Escape now pops one layer per press — search, selection, the place you
are
inside, then the map itself — instead of clearing two things at once
while the
newest mode had no keyboard exit at all. The last step calls a leave
action the
host supplies (the page returns to Memories, the hub tab to the hub); it
cannot
travel up to the window, because a canvas takes no focus and
`onExitCommand`
there never fires. That is a wider problem than this PR — filed as
BasedHardware#10698.

The island you are inside stays drawn while you zoom in and select
entities on
it, which is the whole point of having gone in.

### Verified live (omi-pr-9499 dev bundle, 1,161-entity account)

- Entered *Cursor IDE*, selected the *Cursor* entity inside it: all
three of the
region's islands stay outlined and named at 395% with the inspector
open.
- Three Escapes walked the layers — selection cleared with the island
intact,
  neighbourhood left with every coastline back, page closed to Memories.
- `xcrun swift test --package-path Desktop`: 3,300 tests, 0 failures.
- `swift-format lint-scope` clean; `swiftlint` 0 violations in 913
files.

### Review round

An adversarial pass over the working tree found three states this work
created
or left standing, each fixed with a test:

- Escape dropped a whole breadcrumb trail at once — following three
related
entities and pressing Escape returned to the map instead of the previous
  entity. It now pops one hop at a time.
- Entering a region large enough to fill the map clamped the camera to
the
minimum zoom, putting the departure threshold below the minimum: the
mode
looked leavable by zooming out and was not. It now offers no zoom-out
exit
  there rather than a broken one.
- A neighbourhood id belongs to the snapshot that detected it, but
survived a
  graph rebuild — leaving the map "inside" a place with no coastline, no
caption, and, on the inline surface, no Escape monitor to get out with.

Those three rest on unit tests rather than a hand-run: automation cannot
build
a selection trail (selecting by label resets it), and the other two need
a
map-filling region and a destructive graph rebuild on a live account.

## Failure class

Failure-Class: none
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.

1 participant