Skip to content

Architecture Decision Records ​

Technical decisions that constrain the code. Each record has a status, a scope (the files it governs) and Confirmation rules that can be checked in review. Change a decision by writing a new record that supersedes the old one.

Renumbered on 2026-11-08 to close the gaps: superseded records (secrets in .env, Infisical wiring, VPS placement, rehearsal image, telemetry — consolidated into 0015 and 0016) were removed and the rest compacted to 0001–0018. The former numbering lives in git history; numbers are not reused going forward.

ADRDecisionStatusScope
0001Build Jarvis as a TypeScript pnpm monorepo (shared, engine, web) on the Agent Ops Center stackaccepted**
0002Structure the engine as an onion with Zod contracts in sharedacceptedengine/src/, shared/src/
0003Run Claude only through the official CLI in print mode with stream-json, on the subscriptionacceptedengine/src/infrastructure/claude/, engine/src/application/
0004Give dispatcher and workers their capabilities as tools of a Jarvis MCP server, incl. the permission prompt toolacceptedengine/src/presentation/mcp/**, shared/src/mcp.ts
0005Keep limits, models and repo settings in jarvis.config.json, validated with Zodacceptedjarvis.config*.json, engine/src/infrastructure/config/**, shared/src/config.ts
0006Talk to the owner through an OwnerChannel port: web chat now, Slack threads (Socket Mode) lateracceptedengine/src/presentation/, web/src/features/chat/
0007Act on GitHub as a bot account; watch CI and reviews by pollingacceptedengine/src/infrastructure/github/, engine/src/presentation/watcher/, engine/src/infrastructure/git/**
0008Store state and journals in Postgres (Docker), SDD artifacts as files per taskacceptedengine/src/infrastructure/db/, engine/drizzle/, compose.yaml
0009Ship the agent definition as a plugin in agent/; keep personal and runtime data in ~/.jarvisacceptedagent/, engine/src/infrastructure/claude/, engine/src/infrastructure/config/**
0010Build the web app as a React 19 + Vite SPA with react-router, CSS Modules and TanStack Query fed by SSEacceptedweb/**
0011Test with Vitest/RTL, real Postgres, Playwright and a fake claude binaryacceptedtests, engine/test/, web/e2e/
0012Let Jarvis clone a repo on demand if it is on an allow-list or owned by the owner's GitHub account, instead of one fixed repo.pathacceptedshared/src/config.ts, jarvis.config*.json, engine/src/infrastructure/config/, engine/src/infrastructure/git/, engine/src/application/**
0013Dispatcher-writable owner data: learned facts appended to USER.md's ## Learned, and config edits (limits included) on explicit owner requestacceptedagent/USER.example.md, shared/src/{config,mcp}.ts, engine/src/application/{profile,config}/, engine/src/infrastructure/profile/
0014Verify a UI change in a real browser through Playwright MCP (ui-tester subagent, engine-leased dev server) and put the screenshots inline in the PR via GitHub's user-attachments uploadacceptedagent/agents/ui-tester.md, agent/prompts/worker.md, shared/src/config.ts, engine/src/application/ui/, engine/src/infrastructure/{dev-server,github,artifacts}/, docker/runtime/Dockerfile
0015Secrets live only in Infisical; ~/.jarvis/.env is the local fallback; no committed or deployed file carries a secret valueaccepted.env.example, compose.yaml, scripts/with-secrets.sh, deploy/systemd/, engine/src/infrastructure/config/
0016Server operations: Hetzner VPS behind Tailscale (systemd), rehearsed in a local runtime image, observed via journald + CLI OTel + Alloy + Grafana Cloud; session economics in Postgresacceptedcompose.yaml, docker/runtime/, deploy/, engine/src/infrastructure/{claude,logging}/, engine/src/presentation/timers/
0017Externally-authored text enters prompts wrapped as <untrusted-content>; an injection attempt is reported to the owner before the agent continuesacceptedengine/src/application/conversation/untrusted.ts, engine/src/application/code-host/**, agent/prompts/worker.md, agent/SOUL.md
0018Check an existing PR's UI as a ui_check task kind: criteria from spec.md/PR body/diff, untrusted head behind an owner permission, PR comment only after approveacceptedengine/src/domain/task.ts, engine/drizzle/, engine/src/application/{tasks,ui}/, shared/src/{config,mcp}.ts, agent/prompts/**, agent/settings/worker.json
0019A UI check's environment is declared per repository as ordered services with readiness probes, and a foreign head's check runs in a disposable Docker containersuperseded by 0026shared/src/config.ts, engine/src/application/ports/dev-server.ts, engine/src/infrastructure/dev-server/**, jarvis.config.example.json
0020The run retrospective is a retro run role reading an engine-precomputed retro-input.md: no worker slot, no token, one at a timeproposedshared/src/{enums,mcp,config}.ts, engine/src/application/{runs,retro}/, engine/src/infrastructure/claude/, agent/prompts/retro.md
0021Memory is one self-curating file: the worker writes repo-scoped insights under ## Learned in USER.md by itself, every entry carries its timestamp and counters of confirming and contradicting tasks, nothing is removed automatically, and the owner reviews afterwards (memory-review skill)acceptedagent/USER.example.md, agent/prompts/, agent/skills/memory-review/, shared/src/{mcp,config}.ts, engine/src/application/profile/, engine/src/infrastructure/profile/
0022The engine runs the checks fixed at spec approval, refuses on red, pushes the checked sha and opens the draft PR (open_pr); no worker has GH_TOKENacceptedagent/prompts/worker.md, agent/settings/worker.json, shared/src/{mcp,config}.ts, engine/src/application/{tasks,code-host}/, engine/src/infrastructure/{checks,git,github,claude}/
0023One WorkflowDefinition per task kind (transitions, tools, workspace, context, gates) read by the engine instead of branching on the kind; retro stays a separate axisproposedshared/src/enums.ts, engine/src/domain/workflows/, engine/src/application/{workflows,runs,tasks}/, engine/src/infrastructure/claude/, agent/prompts/
0024The watcher becomes WatchSource: a snapshot reader, a pure diff and a rule per event, with an event journal for exactly-once; the PR watcher is the first source, then schedule, issue input, CI on the default branchproposedshared/src/config.ts, engine/src/domain/watch*, engine/src/application/{code-host,watch}/, engine/src/infrastructure/{db,github}/, engine/drizzle/, engine/src/presentation/timers/
0025The owner's own skills and subagents are a second plugin in ~/.jarvis/plugin, loaded by every run and written only through the owner's HTTP API, never an agent tool; built-in names are reserved, writes leave backups, MCP stays read-only and shows no valuesacceptedshared/src/api/capabilities.ts, engine/src/{application,infrastructure}/capabilities/, engine/src/infrastructure/claude/, engine/src/presentation/http/routes/capabilities.ts, web/src/features/capabilities/**
0026The engine knows no target project: the worker composes an environment plan from the repository and the engine runs it in disposable Docker containers; no literal credentials; the UI check is a mandatory stepacceptedshared/src/{config,environment-plan,mcp}.ts, engine/src/infrastructure/dev-server/, engine/src/application/{ui,tasks}/, agent/**
0027Runs may read the owner's claude.ai connectors (connectors.claudeAi: Notion, Slack, Google Docs, Google Drive): read tools allowed by name, everything else denied, never for ui_check; such a run is not strict and reads the user settings sourceacceptedshared/src/config.ts, engine/src/infrastructure/claude/, engine/src/infrastructure/connections/, agent/prompts/**, docs/architecture/connectors.md
0028Mutating owner requests need X-Jarvis-Owner: 1 and a same-origin Origin (/api/agent/* exempt, Bearer); the UI-check browser also cannot reach the web UI or Postgres portsacceptedengine/src/presentation/http/owner-guard.ts, engine/src/infrastructure/claude/run-files.ts, web/src/api/client.ts
0029One GitHub Pages site: the deck at the root, every document in docs/ rendered by VitePress under /docs/ (one workflow, pages.yml), each linking to the otheraccepteddocs/.vitepress/**, .github/workflows/pages.yml, deck/index.html, package.json
0030The worker is the main session: it writes spec and plan, picks a mode (Quick, Small, Big); Big runs one implementer per lane (code with its tests, hand-off after 5–8 tasks or ~500k context, recreated fresh); one read-only Opus reviewer is the gate (Must / Should / Consider, at most 3 rounds, later rounds see only the fix diff); plan-verifier removedacceptedagent/**