Repository navigation
refactor(macOS): centralize Rewind repository plumbing - #15376
Git-on-my-level merged 20 commits into
Conversation
|
Verified end-to-end against #9519 — this is a clean, well-evidenced consolidation. Thank you for the per-storage commit split, the honest local-test report, and the changelog restraint. What I checked:
Two nits, neither blocking:
Leaving for human maintainer review rather than an automated verdict: this reshapes the local-storage lifecycle for 11 actors behind one shared owner and adds a repo-wide CI guard that will reject future PRs reintroducing private pool caches, so the consolidation and the new enforcement both deserve a maintainer's explicit sign-off before merge. 🤖 Automated review on behalf of the maintainers. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
…storage-base # Conflicts: # .github/checks-manifest.yaml
|
Conflict resolved, and the owner-string nit from your review is fixed in its own commit. The conflict, and why it keeps happening. Verified by parsing rather than by eye, since a manifest that looks merged while having silently dropped an entry is the failure this file cannot afford: 279 entries against main's 277, the two added are this PR's, none dropped, no duplicate ids. The guard still holds on the merged head: Your first nit I tried to fix and then reverted — the rename is blocked by another guard. Any spelling that matches the type name matches that regex, so there is no version of this rename that passes while the Gate F baseline stands. Reverted; the file keeps Your second nit I deliberately left alone. The ownership guard scanning all of Scope is unchanged at 21 files, +608/−361, desktop/macOS and the manifest only — no behaviour change from the merge. |
|
Refreshed against current Same reasoning as the sibling desktop PRs: the checks on Verified on the merged head:
Diff scope unchanged at 21 files, |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The recovery gauntlet needs stronger assertions proving action-item and task-chat continuity after reopening.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Refactors macOS Rewind storage to centralize database-pool lifecycle and FTS repair in RewindRepository.
Changes:
- Migrates storage consumers to shared repository ownership.
- Adds lifecycle, recovery, FTS, and ownership-check coverage.
- Preserves injected-pool behavior and records no user-facing change.
| File | Reviewed change |
|---|---|
desktop/macos/scripts/check-rewind-repository-ownership.py |
Adds repository ownership guard. |
desktop/macos/e2e/flows/rewind-artifact-recovery.yaml |
Extends recovery-flow coverage. |
desktop/macos/Desktop/Tests/RewindRepositoryTests.swift |
Tests repository lifecycle and FTS repair. |
desktop/macos/Desktop/Tests/RewindArtifactGauntletTests.swift |
Tests artifact recovery behavior. |
desktop/macos/Desktop/Tests/ActionItemsFTSRepairTests.swift |
Tests generic FTS repair. |
desktop/macos/Desktop/Sources/Rewind/Core/TranscriptionStorage.swift |
Migrates transcription storage ownership. |
desktop/macos/Desktop/Sources/Rewind/Core/TaskChatMessageStorage.swift |
Migrates task-chat storage ownership. |
desktop/macos/Desktop/Sources/Rewind/Core/StagedTaskStorage.swift |
Migrates staged-task storage ownership. |
desktop/macos/Desktop/Sources/Rewind/Core/RewindRepository.swift |
Adds shared pool lifecycle and FTS repair. |
desktop/macos/Desktop/Sources/Rewind/Core/RewindDatabase.swift |
Removes domain-specific FTS plumbing. |
desktop/macos/Desktop/Sources/Rewind/Core/RewindArtifactGauntlet.swift |
Exercises post-reopen repository reads. |
desktop/macos/Desktop/Sources/Rewind/Core/ProactiveStorage.swift |
Migrates proactive storage ownership. |
desktop/macos/Desktop/Sources/Rewind/Core/MemoryStorage.swift |
Migrates memory storage ownership. |
desktop/macos/Desktop/Sources/Rewind/Core/GoalStorage.swift |
Migrates goal storage ownership. |
desktop/macos/Desktop/Sources/Rewind/Core/ActionItemStorage.swift |
Migrates action-item storage and FTS handling. |
desktop/macos/Desktop/Sources/ProactiveAssistants/Services/AIUserProfileService.swift |
Migrates profile persistence ownership. |
desktop/macos/Desktop/Sources/LiveNotes/NoteStorage.swift |
Migrates note storage ownership. |
desktop/macos/Desktop/Sources/FileIndexing/KnowledgeGraphStorage.swift |
Migrates graph storage ownership. |
desktop/macos/Desktop/Sources/FileIndexing/FileIndexerService.swift |
Preserves injected-pool behavior. |
desktop/macos/changelog/unreleased/20260921-rewind-repository-consolidation.json |
Records no user-facing change. |
.github/checks-manifest.yaml |
Registers ownership checks. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Refreshed against current Verified on the merged head: swift build complete (99.99s); check-rewind-repository-ownership PASS; --self-test PASS. |
…tlet reopen The reopen step only proved the action-item and task-chat reads did not throw, so a stale pool returning an empty result still reported both as readable. Seed one action item and one task-chat row before the close, read them back by ID and content on both sides of the reopen, and remove them on success and failure. The action item is stored soft-deleted with no backend ID so task lists and backend sync never pick it up. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Pushed 6fa8cb6: the Rewind gauntlet now checks that real rows survive the database reopen, not just that the reads don't throw.
|
…storage-base # Conflicts: # desktop/macos/Desktop/Sources/Rewind/Core/MemoryStorage.swift
|
Merged current
|
|
Reviewed the full diff — this is a clean, well-tested consolidation. Specific observations:
The one local suite failure noted in the PR description (floating-bar AppKit sizing assertion) touches no files in this diff and the GitHub Desktop Swift Build & Tests check is green, so it does not gate here. Leaving for human maintainer sign-off before merge: this consolidates the storage-pool lifecycle for user data (sign-out/user-switch invalidation and recovery) across every Rewind-backed macOS actor, which is an architecture call worth a maintainer's eyes even though the migration itself looks correct. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
…storage-base # Conflicts: # desktop/macos/e2e/flows/rewind-artifact-recovery.yaml
|
Reviewed the full diff on top of the earlier feedback in this thread — the consolidation holds up. File-by-file notes:
The one full-suite failure called out in the PR body (floating-bar AppKit sizing, No security concerns found: no new dependencies, no secrets handling, and the FTS SQL construction is identifier-guarded with no user input reaching the type. Leaving formal sign-off to the maintainer review already requested — this is a storage-lifecycle consolidation across every Rewind consumer plus a new CI guard, so it deserves that final human pass 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 this is green and ready for a maintainer review when you have a moment. |

What changed and why
Closes #9519.
Rewind-backed macOS services independently cached
DatabasePoolreferences and repeated the same pool-generation/reopen logic. That made user switches and local-database recovery depend on every storage owner implementing an identical lifecycle correctly.This PR introduces one
RewindRepositoryactor that owns pool acquisition, generation revalidation, invalidation, and recovery. It migrates all 11 discovered consumers one storage at a time:It also moves action-item FTS recovery out of
RewindDatabaseinto a parameterized external-content FTS definition. Durable source rows remain authoritative, repair is performed against the exact failing pool, and the File Indexer test-injected pool behavior is preserved.There is no schema or user-visible behavior change. The desktop changelog entry is intentionally
{"kind":"none"}.Product invariants affected
The refactor preserves these contracts while consolidating the local storage lifecycle behind one replaceable-pool owner.
How it was verified
197.5 >= 198.0); it reproduces when run independently and no floating-bar source or test is changed by this PR.Named-bundle smoke was run from clean revision
237486e327using bundlecom.omi.omi-9519-rewind-repo; the committedrewind-artifact-recoverybridge flow passed in 398 ms with zero log errors. The non-production recovery gauntlet proved:Tests
RewindRepositoryTestscovers generation revalidation, explicit invalidation, failed reopen without stale-pool fallback, injected-pool isolation, and generic FTS repair.RewindArtifactGauntletTestscovers the real encoder → SQLite → video-readback → close/reopen path, including post-reopen action-item and task-chat reads.ActionItemsFTSRepairTestsnow exercises the generic FTS definition and verifies durable action-item rows survive index reconstruction.check-rewind-repository-ownership.py --self-testproves copied private pool/generation caches are rejected while repository-owned storage passes.Failure class (fixes)
Failure-Class: none
New guards (only when adding a check or ratchet)
The duplicated ownership documented in #9519 is the incident this guard would have caught. The prevention is the shared
RewindRepositoryprimitive; the structural check only prevents future storage owners from bypassing it with private_dbQueueor generation caches.Scoped cleanups
Removed the action-items-specific FTS classifier/install/repair/drop plumbing from
RewindDatabase, leaving schema migration and pool ownership there while the reusable repair behavior lives with the repository abstraction.