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.
| ADR | Decision | Status | Scope |
|---|---|---|---|
| 0001 | Build Jarvis as a TypeScript pnpm monorepo (shared, engine, web) on the Agent Ops Center stack | accepted | ** |
| 0002 | Structure the engine as an onion with Zod contracts in shared | accepted | engine/src/, shared/src/ |
| 0003 | Run Claude only through the official CLI in print mode with stream-json, on the subscription | accepted | engine/src/infrastructure/claude/, engine/src/application/ |
| 0004 | Give dispatcher and workers their capabilities as tools of a Jarvis MCP server, incl. the permission prompt tool | accepted | engine/src/presentation/mcp/**, shared/src/mcp.ts |
| 0005 | Keep limits, models and repo settings in jarvis.config.json, validated with Zod | accepted | jarvis.config*.json, engine/src/infrastructure/config/**, shared/src/config.ts |
| 0006 | Talk to the owner through an OwnerChannel port: web chat now, Slack threads (Socket Mode) later | accepted | engine/src/presentation/, web/src/features/chat/ |
| 0007 | Act on GitHub as a bot account; watch CI and reviews by polling | accepted | engine/src/infrastructure/github/, engine/src/presentation/watcher/, engine/src/infrastructure/git/** |
| 0008 | Store state and journals in Postgres (Docker), SDD artifacts as files per task | accepted | engine/src/infrastructure/db/, engine/drizzle/, compose.yaml |
| 0009 | Ship the agent definition as a plugin in agent/; keep personal and runtime data in ~/.jarvis | accepted | agent/, engine/src/infrastructure/claude/, engine/src/infrastructure/config/** |
| 0010 | Build the web app as a React 19 + Vite SPA with react-router, CSS Modules and TanStack Query fed by SSE | accepted | web/** |
| 0011 | Test with Vitest/RTL, real Postgres, Playwright and a fake claude binary | accepted | tests, engine/test/, web/e2e/ |
| 0012 | Let 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.path | accepted | shared/src/config.ts, jarvis.config*.json, engine/src/infrastructure/config/, engine/src/infrastructure/git/, engine/src/application/** |
| 0013 | Dispatcher-writable owner data: learned facts appended to USER.md's ## Learned, and config edits (limits included) on explicit owner request | accepted | agent/USER.example.md, shared/src/{config,mcp}.ts, engine/src/application/{profile,config}/, engine/src/infrastructure/profile/ |
| 0014 | Verify 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 upload | accepted | agent/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 |
| 0015 | Secrets live only in Infisical; ~/.jarvis/.env is the local fallback; no committed or deployed file carries a secret value | accepted | .env.example, compose.yaml, scripts/with-secrets.sh, deploy/systemd/, engine/src/infrastructure/config/ |
| 0016 | Server operations: Hetzner VPS behind Tailscale (systemd), rehearsed in a local runtime image, observed via journald + CLI OTel + Alloy + Grafana Cloud; session economics in Postgres | accepted | compose.yaml, docker/runtime/, deploy/, engine/src/infrastructure/{claude,logging}/, engine/src/presentation/timers/ |
| 0017 | Externally-authored text enters prompts wrapped as <untrusted-content>; an injection attempt is reported to the owner before the agent continues | accepted | engine/src/application/conversation/untrusted.ts, engine/src/application/code-host/**, agent/prompts/worker.md, agent/SOUL.md |
| 0018 | Check 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 approve | accepted | engine/src/domain/task.ts, engine/drizzle/, engine/src/application/{tasks,ui}/, shared/src/{config,mcp}.ts, agent/prompts/**, agent/settings/worker.json |
| 0019 | A 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 container | superseded by 0026 | shared/src/config.ts, engine/src/application/ports/dev-server.ts, engine/src/infrastructure/dev-server/**, jarvis.config.example.json |
| 0020 | The run retrospective is a retro run role reading an engine-precomputed retro-input.md: no worker slot, no token, one at a time | proposed | shared/src/{enums,mcp,config}.ts, engine/src/application/{runs,retro}/, engine/src/infrastructure/claude/, agent/prompts/retro.md |
| 0021 | Memory 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) | accepted | agent/USER.example.md, agent/prompts/, agent/skills/memory-review/, shared/src/{mcp,config}.ts, engine/src/application/profile/, engine/src/infrastructure/profile/ |
| 0022 | The 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_TOKEN | accepted | agent/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}/ |
| 0023 | One WorkflowDefinition per task kind (transitions, tools, workspace, context, gates) read by the engine instead of branching on the kind; retro stays a separate axis | proposed | shared/src/enums.ts, engine/src/domain/workflows/, engine/src/application/{workflows,runs,tasks}/, engine/src/infrastructure/claude/, agent/prompts/ |
| 0024 | The 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 branch | proposed | shared/src/config.ts, engine/src/domain/watch*, engine/src/application/{code-host,watch}/, engine/src/infrastructure/{db,github}/, engine/drizzle/, engine/src/presentation/timers/ |
| 0025 | The 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 values | accepted | shared/src/api/capabilities.ts, engine/src/{application,infrastructure}/capabilities/, engine/src/infrastructure/claude/, engine/src/presentation/http/routes/capabilities.ts, web/src/features/capabilities/** |
| 0026 | The 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 step | accepted | shared/src/{config,environment-plan,mcp}.ts, engine/src/infrastructure/dev-server/, engine/src/application/{ui,tasks}/, agent/** |
| 0027 | Runs 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 source | accepted | shared/src/config.ts, engine/src/infrastructure/claude/, engine/src/infrastructure/connections/, agent/prompts/**, docs/architecture/connectors.md |
| 0028 | Mutating 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 ports | accepted | engine/src/presentation/http/owner-guard.ts, engine/src/infrastructure/claude/run-files.ts, web/src/api/client.ts |
| 0029 | One 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 other | accepted | docs/.vitepress/**, .github/workflows/pages.yml, deck/index.html, package.json |
| 0030 | The 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 removed | accepted | agent/** |