feat: drop dead couch channel, show account vaults as unsynced - #280
Merged
Conversation
CouchDB stopped being a sync channel on 2026-07-31 when the per-memory JWT route was deleted server-side; git smart-HTTP is the only device channel. The CLI's copy of the couch channel has been dead since, while `status` kept reporting account vaults as healthy. Remove src/sync/couch/ and every caller, and make the resulting gap visible rather than silent: an account vault now renders as `account not synced - account vaults have no sync channel` in `status` (channel `account`, state `unsynced` in --json), and `vault sync` names it with the same line instead of skipping it or printing a success line. Account vaults still register, provision, and serve locally over MCP - only the machine<->account sync is gone, and the CLI now says so. Also removed as dead once the channel went: `currentBearer` (api), `onMutation` (daemon server), `SyncRunResult` (daemon client), and the CHANNEL_DISABLED / CHANNEL_CONFLICT provisioning branches - the backend create-memory route emits neither code.
Contributor
|
🎉 PR Validation ✅ PASSED Commit: Checks:
Ready to merge! ✨ 🔗 View workflow run |
Member
Author
|
CI caught one real gap in the new tests: chalk colours the "not synced" message, so an assertion spanning Fixed by comparing against plain text - |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CouchDB was dropped as a sync channel on 2026-07-31: the auth route that minted the per-memory JWT (
POST /account/couch-token) was deleted then, and git smart-HTTP is the only device channel. The CLI's couch code has been dead ever since - andagentage statuskept reporting those vaults as healthy, which is the worse half of the problem.-2,578 lines, 47 files. All of
src/sync/couch/, both couch e2e suites, and the couch wiring in the daemon, the daemon client,vault sync,daemon status, the git manager and provisioning.The honesty change
Deleting the channel is only half of it. An account (
agentage) vault is still registered and still works locally over MCP - it simply has no sync channel now. Both surfaces say exactly that, and neither hides it:Account vaults do not count toward "N connected", are never silently skipped by
vault sync, and--jsonreports{"channel":"account","status":"unsynced"}. With only account vaults configured there is no "Syncing N vault(s)..." header and no success line at all. No date, no roadmap promise - just the current truth.channelOfnow checks for an external remote before theagentagesentinel, so an entry carrying both is reported by the channel that actually moves bytes.Removals beyond the couch tree
Each had exactly one caller, which was couch:
currentBearerinlib/auth/api.ts(+ its 5 tests) - only the couch manager read it.onMutationon the daemon server, its call site, and theMemoryVerbimport - the couch push-on-write hook was the only subscriber.SyncRunResult, a union with one member left.local-commit.ts(gitCommitDirty).errorCode(), theCHANNEL_DISABLED/CHANNEL_CONFLICTbranches and'disabled' | 'conflict'fromProvisionStatus. Those codes exist nowhere inagentage/web-POST /api/memoriesreads only the name - so the branches were unreachable and their message ("Account sync is not enabled on this server") would have become a lie.provisionAccountVaultalso stops sendingchannel: 'couch'(the server has nochannelin its schema and ignores it) and its messages no longer promise sync - it creates the memory in the account, nothing more.Test coverage
e2e/account-vault.test.tskeeps its first three tests (registry + mirror dir + local memory verbs,vault listtyping,vault remove) - all still real. Its fourth asserted the couch cycle and is replaced by two tests pinning the new output, one per surface.npm run verifygreen: 45 files, 454 tests. Coverage rose on every axis against the repo floors (statements 87.43 -> 87.84, branches 79.63 -> 80.40, functions 78.98 -> 80.41, lines 89.22 -> 89.62).Findings, not in this PR
provisionAccountVaultmaps every unexpected status tooffline/ "will provision when online". The backend now returns409 LIMIT_REACHEDat the plan memory cap and503when the writer is unwired - both currently get that misleading line. Pre-existing, same class of dishonesty as the one this PR fixes.Links.synchas no reader insrc/now (couch discovery was its only consumer). Kept - it is a correct mapping of the live git smart-HTTP host, mirroring@agentage/shared links().POST /api/sync/runon the daemon, called directly for an account vault, now 400s withno sync origin configured.vault syncfilters those client-side, so it is only reachable by hand, and the message is true.Completes the estate-wide sweep: auth#18, obsidian-sync#107, dashboard#36, web#472, auth#19, memory-core#30.