Skip to content

ADR-0005: Keep limits, models and repo settings in jarvis.config.json, validated with Zod at startup ​

Context and Problem Statement ​

The owner runs Jarvis on Claude Max 5x ($100) and does not want a demo to burn the whole limit. Limits (concurrency, retries, rounds, turns, budget, polling) must be easy to change without code edits and must never hold secrets. A new YAML/TOML parser would be a new dependency.

Considered Options ​

  • ~/.jarvis/jarvis.config.json (outside the repo, ADR-0009), jarvis.config.example.json committed, schema in shared/ (Zod)
  • Environment variables only
  • Rows in the database edited from the UI

Decision Outcome ​

Chosen option: "jarvis.config.json with a Zod schema", because JSON needs no new dependency, the schema gives clear startup errors, and the file is diffable and shareable with webinar participants.

Keys and defaults for Max 5x (indicative; the engine spec fixes the final list):

KeyDefaultCovers
repo.path, repo.remote, repo.baseBranch—CON-04
limits.maxConcurrentWorkers1 (2 allowed)DSP-08
limits.checkRetries3WRK-07
limits.ciFixRounds2CI-04
limits.reviewRounds3CI-05
limits.taskTimeoutMinutes90WRK-11 (active worker time; 60 until 2026-12-03)
limits.autoContinueRuns5runs started automatically in a row when a worker ends (or crashes out of) a run at a working stage (0 = off); a run cut by the subscription rate limit continues after the window resets, up to 3 times in a row
limits.maxTurnsPerRun60ADR-0003
limits.maxBudgetUsdPerRun3ADR-0003 (estimate)
limits.dailyBudgetUsd20pause new runs when reached (estimate)
limits.permissionTimeoutMinutes30ADR-0004
watch.pollSeconds60NFR-03
models.dispatcher / models.worker / models.reviewersonnet / sonnet / sonnetcost control
allowlist.githubReviewers[]CI-06
connectors.notionRoot, connectors.googleFolder—CTX-02, CTX-03

The engine re-reads the file on change; a run already started keeps the values it started with.

Consequences ​

  • Good, because the demo can be tuned in one place and participants get a safe default.
  • Bad, because dollar figures are CLI estimates, not real subscription usage; they are a brake, not a meter.

Confirmation ​

  • RULE: Engine startup fails with a readable error when jarvis.config.json does not match the schema. CHECK: unit test engine/src/infrastructure/config/config.test.ts
  • RULE: The config schema has no fields for tokens or passwords. CHECK: reviewer on shared/src/config.ts