Skip to content

feat(sync): add --scope user for store sync - #304

Closed
RaviTharuma wants to merge 2 commits into
AVIDS2:mainfrom
RaviTharuma:feat/sync-scope-user
Closed

RaviTharuma wants to merge 2 commits into
AVIDS2:mainfrom
RaviTharuma:feat/sync-scope-user

Conversation

@RaviTharuma

Copy link
Copy Markdown
Contributor

Summary

memorix sync store stays project-scoped by default. This adds an explicit --scope user so one local SQLite can replicate every project's eligible observations across a user's machines, without copying the live database.

  • Default --scope project is unchanged: other-project rows stay local.
  • --scope user uses a separate user-global remote namespace (override with MEMORIX_SYNC_USER_NAMESPACE when several operators share one remote).
  • Privacy filters still drop personal, agent-targeted, candidate, and ephemeral rows.
  • --scope user does not require a Git checkout; it opens the shared data directory directly.
  • Providers remain fs|github|s3|postgres.

Fixes #302

Verification

  • npm run lint passed.
  • Focused suite: tests/sync/engine.test.ts, tests/sync/policy.test.ts, tests/sync/sqlite-store.test.ts, tests/sync/merge.test.ts — 36 passed.
  • Coverage includes other-project eligibility, user-scope engine replication, and a real SQLite two-device run that ships two projects and keeps a personal row local.

Notes

User-global state is isolated from project-scoped sync_row_state / outbox / cursors so a row can be relayed independently in each namespace.

Keep the default project-scoped relay. An explicit --scope user replicates
every local project's eligible observations through a separate user-global
namespace, still without copying the live SQLite file. Privacy filters
continue to drop personal, agent-targeted, candidate, and ephemeral rows.

Fixes #302
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Device identity lives on the shared data directory. rotate no longer
requires a bound Git project, matching --scope user. Namespace overrides
reject path-like values.
@RaviTharuma

Copy link
Copy Markdown
Contributor Author

Follow-up on this PR after a self-review (CI was already green; no maintainer review comments yet).

Fixed in b6f18d5

  • memorix sync store device rotate no longer requires a Git checkout. Device identity is per data directory, which matches --scope user.
  • MEMORIX_SYNC_USER_NAMESPACE rejects path-like values (../escape).

Default --scope project is unchanged. Privacy filters still drop personal, agent-targeted, candidate, and ephemeral rows.

@AVIDS2

AVIDS2 commented Sep 20, 2026

Copy link
Copy Markdown
Owner

Superseded and included in the merged 1.9.5 release PR #305, with additional scope-aware tombstone, ID remap, and namespace hardening.

@AVIDS2 AVIDS2 closed this Sep 20, 2026
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.

feat(sync): optional user-global store sync (all projects, still local-first)

2 participants