Skip to content

feat: drop dead couch channel, show account vaults as unsynced - #280

Merged
vreshch merged 2 commits into
masterfrom
feature/drop-couch
Aug 9, 2026
Merged

feat: drop dead couch channel, show account vaults as unsynced#280
vreshch merged 2 commits into
masterfrom
feature/drop-couch

Conversation

@vreshch

@vreshch vreshch commented Aug 9, 2026

Copy link
Copy Markdown
Member

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 - and agentage status kept 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:

$ agentage status
vaults     1 connected
  acct  account ✗ not synced - account vaults have no sync channel
  work  git     - unknown (daemon stopped)

$ agentage vault sync
Syncing 1 vault(s)...
work...
work -> https://git.example.com/work.git: failed (unreachable): ...
acct (account): not synced - account vaults have no sync channel

Account vaults do not count toward "N connected", are never silently skipped by vault sync, and --json reports {"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.

channelOf now checks for an external remote before the agentage sentinel, 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:

  • currentBearer in lib/auth/api.ts (+ its 5 tests) - only the couch manager read it.
  • onMutation on the daemon server, its call site, and the MemoryVerb import - the couch push-on-write hook was the only subscriber.
  • SyncRunResult, a union with one member left.
  • local-commit.ts (gitCommitDirty).
  • errorCode(), the CHANNEL_DISABLED / CHANNEL_CONFLICT branches and 'disabled' | 'conflict' from ProvisionStatus. Those codes exist nowhere in agentage/web - POST /api/memories reads only the name - so the branches were unreachable and their message ("Account sync is not enabled on this server") would have become a lie.

provisionAccountVault also stops sending channel: 'couch' (the server has no channel in 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.ts keeps its first three tests (registry + mirror dir + local memory verbs, vault list typing, 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 verify green: 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

  • Medium: provisionAccountVault maps every unexpected status to offline / "will provision when online". The backend now returns 409 LIMIT_REACHED at the plan memory cap and 503 when the writer is unwired - both currently get that misleading line. Pre-existing, same class of dishonesty as the one this PR fixes.
  • Low: Links.sync has no reader in src/ now (couch discovery was its only consumer). Kept - it is a correct mapping of the live git smart-HTTP host, mirroring @agentage/shared links().
  • Low: POST /api/sync/run on the daemon, called directly for an account vault, now 400s with no sync origin configured. vault sync filters 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.

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.
@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

🎉 PR Validation ✅ PASSED

Commit: 334930254fbbdd107a58634eada7b45e01353fbf
Branch: feature/drop-couch

Checks:

  • ✅ Release guard (no version/changelog changes)
  • ✅ Dependencies installed
  • ✅ Type check passed
  • ✅ Linting passed
  • ✅ Format check passed
  • ✅ Tests + coverage passed
  • ✅ Build successful

Ready to merge!


🔗 View workflow run
⏰ Generated at: 2026-08-09T14:31:43.308Z

@vreshch

vreshch commented Aug 9, 2026

Copy link
Copy Markdown
Member Author

CI caught one real gap in the new tests: chalk colours the "not synced" message, so an assertion spanning acct (account): (plain) and the styled remainder found no match. It passed locally only because chalk went dark on a non-TTY.

Fixed by comparing against plain text - plain() in e2e/helpers.ts strips SGR sequences - which keeps the strong single-string assertion instead of splitting it either side of the style boundary. Reproduced the CI condition locally with FORCE_COLOR=1: the whole @offline tier, 35 tests, green.

@vreshch
vreshch merged commit efe4521 into master Aug 9, 2026
3 checks passed
@vreshch
vreshch deleted the feature/drop-couch branch August 9, 2026 14:32
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