Repository navigation
docs: ADR-0009 remote mode — one canonical instance, thin clients over Tailscale - #4
Merged
Merged
Conversation
…r Tailscale Decision document only; no code. Proposes the Personal AI Hub deployment shape: `engram serve` on a tailnet-only Ubuntu VM, thin `engram` clients (hooks, CLI, voice agent) over plain HTTP+JSON, seam at the hook/CLI boundary rather than a storage-backend abstraction (ADR-0001's deferral stays deferred). Decides transport, seam + Phase 1 endpoint set, portable project identity (project_key + host + profile on checkpoints, code-set origin stamp on items), client-vs-server responsibilities, Phase 1 offline behaviour (degrade to no context, counted in the ledger), tailnet-only security with no app tokens, and the v29 migration + what stays local on clients. Each decision lists the alternatives rejected. Consequences name the four house invariants: local-first, measured-not-vibes, fail-closed governance, single-owner writes. Context verified against the code on 2026-10-13 (file:line refs cited). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Context now records two verified platform facts: Claude Code's `http` hook handler (POST of the event JSON, whole-second timeouts, no project id/hostname, `last_assistant_message` on Stop) and MCP 2026-07-28's stateless design (no sessions/initialize; elicitation becomes MRTR). Decisions updated: - §1 MCP-over-HTTP rationale no longer cites session negotiation; the real Phase 2 cost is rewriting the ADR-0007 elicitation gate as MRTR. - §2 adds `/v1/route`, `/v1/extract`, read-only `/v1/inbox` (the spec wants route/auto_extract in every .mcp.json and a plugin inbox poller); SessionStart hook as a resume client; checkpoint returns an empty body (Stop additionalContext would continue the turn); considers and defers native `http` hooks to Phase 2 with the three blockers named. - §3 recall/guard/resume are profile-scoped by default; hard isolation is a second `engram serve` on a second DB path; voice call id = session_id. - §4 turn summary comes from `last_assistant_message`, transcript tail is the fallback; voice agent ~1 s search budget, Pipecat processor shape. - §5 client enforces sub-second budgets (hook timeouts are whole seconds); strict guard = `onFailure: "block"`; Anthropic-hosted cloud sessions are out of scope and fail open. - §6 bind 127.0.0.1 behind `tailscale serve`; authorize on `Tailscale-App-Capabilities` grants (works for tagged nodes), identity headers for attribution; VM disk + Drive snapshot encrypted. - Context names the per-device nodes as a fourth client kind. Consequences add: the spec must change where it disagrees (read-only Drive snapshot, SSE-proxy option, 768-fixed claim), and `engram-mcp`'s 2024-11-05 declaration under Claude Code's v2 MCP runtime is untested. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Summary
Adds
docs/decisions/0009-remote-mode.md(status: proposed). Decision document only — no code changes.The ADR proposes the Personal AI Hub deployment shape: one canonical Engram instance (
engram serve) on a tailnet-only Ubuntu VM, with thin clients (Claude Code hooks + CLI on Mac and Windows/WSL, a Pipecat voice agent, and per-device nodes) talking plain HTTP+JSON over Tailscale.It decides, with rejected alternatives for each:
httphooks to Phase 2.project_key(normalized git remote) +host+profileon checkpoints; recall/guard/resume profile-scoped by default; code-set origin stamp on items, converging with the portable-brains plan's provenance column.last_assistant_messagefrom the Stop payload with transcript tail as fallback, git state, cwd) vs what only the server should compute (search, ranking, gates, ledger, embeddings, LLM). Voice agent gets a ~1 s search budget.engram serveon 127.0.0.1 behindtailscale serve; authorization onTailscale-App-Capabilitiesgrants (works for tagged nodes), identity headers for attribution; no public port, no Funnel, no app tokens in Phase 1; VM disk and Drive snapshot encrypted.Consequences name the four house invariants: local-first (no
ENGRAM_REMOTE_URL→ unchanged install), measured-not-vibes (every remote call is a ledger row, numeric acceptance gate), fail-closed governance, single-owner writes. They also list where the hub spec must change (read-only Drive snapshot on clients, SSE-proxy option, 768-fixed claim) and flag thatengram-mcp's 2024-11-05 declaration is untested under Claude Code's v2 MCP runtime.Revision 2 (2026-10-13)
Folded in a review against the hub spec (rev 64) and current vendor docs: Claude Code
httphooks and the Stop payload'slast_assistant_message, MCP 2026-07-28 statelessness, Tailscale Serve identity/capability headers, cloud-session network limits, and the spec's asks for route/auto_extract in.mcp.json, profile-scoped recall, and an inbox poller. See the second commit for the per-section list.Test plan
# ADR 0009: …,Date:,Status: proposed, Context / Decision / Consequences)src/...paths exist; function names, MCP tool names and line ranges re-verified🤖 Generated with Claude Code