Skip to content

feat: delete git sync channel (couch-only device channel)#89

Merged
vreshch merged 2 commits into
masterfrom
feature/couch-only-sync
Jul 8, 2026
Merged

feat: delete git sync channel (couch-only device channel)#89
vreshch merged 2 commits into
masterfrom
feature/couch-only-sync

Conversation

@vreshch

@vreshch vreshch commented Jul 8, 2026

Copy link
Copy Markdown
Member

What

Delete the git device channel from the Obsidian plugin entirely. CouchDB is now the only device channel. A server bridge continues to commit couch edits to git, so the store stays one bare git repo per memory — this change is purely about how the plugin talks to the server.

Why

Simplicity over backward support (owner decision). The git client was the heaviest part of the bundle and duplicated a device channel that couch already covers end-to-end.

Changes

  • Deleted src/git/ (git-client, merge-note, backup-ref, http-requesturl, vault-fs, stream-utils, git-test-server + tests), src/sync-controller.ts, src/types/diff3.d.ts, and the isomorphic-git + diff3 dependencies. Nothing outside main.ts/sync-controller.ts imported them; couch does not share vault-fs, so no file needed to be kept.
  • resolve-host.tsVaultChannel is now couch | error. Removed git routing (buildRepoUrl, gitMemoryFromConfig) and the gitEndpoint/vaults fields. Discovery + 1h caching kept; a memory absent from couch_vaults resolves to channel: 'error'.
  • main.ts — Removed the git controller lifecycle, the git-bound-folder guard, the merge driver, and the git preview path. A chosen memory that is not on the couch channel now surfaces a clear Notice + red status dot ("This memory is not on the new sync channel yet - server update pending"), never a silent no-op or git fallback. Couch sync drives the status dot (syncing/idle/error).
  • Sync preview modal — the git sync-controller supplied its incoming/outgoing counts. Couch's incoming count is only known after a pull, so (per the simpler-honest option) the modal now shows couch pending-push count only (pending = queued live pushes + deletes), read from the live controller without a network round-trip.
  • esbuild.config.mjs — node-builtin externals kept (still needed for the desktop ~/.agentage config mirror + the loopback OAuth listener); only the isomorphic-git comment was dropped. check:bundle green.
  • README / CLAUDE.md — git language → live couch sync; dropped the isomorphic-git/diff3 third-party attribution. check:hosts + check:docs updated (isomorphic-git requirement → js-yaml) and green. sync.agentage.io stays a required host (still the discovery endpoint).

Deltas

  • LOC: +149 / -1915 (net, excluding the lockfile); 1723 lines deleted from src/git/ + sync-controller alone.
  • Bundle: main.js 344 KB → 40 KB (-88%).

Verify

npm run verify fully green (type-check + lint + format + 109 tests + build + check:hosts/docs/bundle). Version intentionally not bumped (release is a separate step).

⚠️ Merge gate

Do not merge until the server-side couch flip ships. Until every memory is advertised on the couch channel, memories not yet migrated will hit the new error state instead of syncing. This PR stays DRAFT by design.

Follow-up

  • Cosmetic nit: the sync preview modal's pending-push count reads 0 on the very first memory pick (before the live controller has queued anything), so it briefly under-reports until the first push/pull tick. Not a correctness issue, deferred.

Remove the git device channel entirely (isomorphic-git + diff3, the git/
client, sync-controller, 3-way merge driver). Couch is now the sole channel:
a memory the server has not advertised on couch resolves to an explicit error
(Notice + red status dot), never a silent git fallback.

- resolve-host: VaultChannel is couch|error; drop buildRepoUrl/gitMemoryFromConfig
- main: strip git controller wiring + git-bound-folder guard; route non-couch to error
- sync preview modal: couch pending-push count (incoming needs a pull, so omit it)
- README/CLAUDE.md: git -> live couch sync; drop isomorphic-git/diff3 attribution
- bundle: main.js 344KB -> 40KB (-88%)

Merge only after the server-side couch flip ships.
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

🎉 PR Validation ✅ PASSED

Commit: bad570802867061288e9891c517bea1dc23ecd4f
Branch: feature/couch-only-sync

Checks:

  • ✅ Dependencies installed
  • ✅ Type check passed
  • ✅ Linting passed
  • ✅ Format check passed
  • ✅ Tests + coverage passed
  • ✅ Build successful
  • ✅ Store-compliance checks passed
  • ✅ Bundle is mobile-safe

Ready to merge!


🔗 View workflow run

@vreshch
vreshch marked this pull request as ready for review July 8, 2026 22:53
@vreshch
vreshch merged commit 152c327 into master Jul 8, 2026
1 check passed
@vreshch
vreshch deleted the feature/couch-only-sync branch July 8, 2026 22:59
vreshch added a commit that referenced this pull request Jul 17, 2026
…96)

Reverts #89 (couch-only). Git = default channel for every memory; a memory
the resolution advertises on couch routes to the couch controller (server
decides per memory, future /api/me capabilities gate the paid couch tier).

- src/git/* + sync-controller restored; couch impl stays at master (resilient
  syncNow, missing-leaf abort, pendingCount)
- previewSync routes per channel: git = both-way controller preview, couch =
  honest outgoing count (#92 semantics kept); SyncPreview.incoming optional
- fake router advertises git_endpoint; lifecycle 10 rewritten for dual-channel
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