Clara Docs
All docs

M5 evidence: the conductor

Evidence13 min readEdit on GitHub

On this page

Date: 2026-11-18. Machine: macOS 26.3, Apple silicon, Node 22.17.1, npm 11.5.2, Playwright 1.65.1 with Chromium 1255 (in .playwright-browsers/). Commits cd97f27 to 121ce76, and the fixes hosted CI asked for after, listed below.

The brief's work for M5: "D8, D9, the runs and review views, and Demo 1." Its proof: "the full fake-agent matrix, approve to pull request and to merge, the demo running headless in CI, and one capped real run with Claude Code if installed."

Acceptance

Check Result
The full fake-agent matrix (E1) Every mode the brief names drives the real conductor through E1's fake agent (test/fixtures/fake-agent.mjs): succeed, fail the checks then fix them, block with a question, ask for a permission, hang, crash, and go over the spend and the turn limits. Three agents work a board in waves as their dependencies end. See the matrix
Approve to a pull request Pushed to a bare remote and opened with a fake gh whose arguments the tests read; the body is made from the ticket and defused. Refused before anything changes without a remote or a gh that starts; a failure part way keeps the approval, and approving again lands what is left. test/integration/land.test.ts, test/integration/cli-review.test.ts, test/integration/server-approve.test.ts
Approve to a merge Merged into the base checkout when it is on the base branch and clean, then the run's worktree and branch removed; a person's own branch is kept; a checkout elsewhere, with changes, or a conflict is refused with nothing changed. The same tests, and in the browser test/e2e/runs.spec.ts, where git shows the merge
The demo, headless, in CI clara demo --headless --json runs in the package gate against the packed tarball installed in an empty folder (scripts/pack-smoke-extra.mjs), in npm run ci and in hosted CI. Its run for this file is below
One capped real run with Claude Code Run on 2026-11-28, with the owner's yes: clara start ADD-1 --headless --model haiku on a scratch repository, CLARA_HOME in a scratch folder, Claude Code 2.1.332, a $1 cap. The agent claimed the ticket, read its context, fixed the code, committed on the ticket's branch and handed it in; the check passed and the ticket reached review in 39 s, 8 turns, $0.0064. The facts are in docs/VERIFIED.md ("One real headless run"). scripts/claude-smoke.mjs repeats a capped run, with a send-back, for a person
The runs view and the review room (D7) Every run on this machine with its log, followed while it goes; the work in review with summary, criteria, checks and diff, approved, sent back or rejected from the room; what agents ask, allowed or denied from "needs you". One journey drives a real clara start with the fake agent as claude (D-116)
npm run ci exits 0 in a clean checkout yes, the browser journeys included, before every push

Tests and coverage

$ npm run ci        # a clean checkout of 9c1c0ce
 Test Files  193 passed (193)
      Tests  4097 passed | 2 skipped (4099)

Statements   : 96.93% ( 9750/10058 )
Branches     : 90.71% ( 6292/6936 )
Functions    : 97.45% ( 1838/1886 )
Lines        : 97.72% ( 8343/8537 )

  first load 84.8 KB gzipped (budget 100 KB)
  lazy lib/markdown.ts 26.8 KB gzipped (budget 60 KB)
  lazy views/graph/graph.tsx 7.0 KB gzipped (budget 60 KB)
  lazy views/idea/plan.tsx 5.5 KB gzipped (budget 60 KB)
  lazy views/insights/insights.tsx 5.9 KB gzipped (budget 60 KB)

  53 passed (34.0s)

All gates passed.

M4 ended at 3,252 tests in 133 files and 41 journeys. This run is the clean checkout of 9c1c0ce, the first commit every platform in hosted CI passed after M5, so it also carries M6's first work (insights, playbooks and decisions, plans, the graph): the counts are M5's and those together. The coverage gate covers library/ and asks for 90% of lines and 85% of branches. Branches fell from M4's 95.0% to 90.7%, still above it; M6's review looks at where.

The fake-agent matrix

The fake agent speaks Claude Code's stream-json, reads its prompt on standard input, and does what FAKE_AGENT_MODE says (or FAKE_AGENT_MODES, a mode per ticket), so the real Claude Code adapter, the conductor and Clara's MCP server all run, and nothing is spent.

Mode What the agent does What Clara must do Tests
succeed commits its work and hands it in run the checks on the commit, record the run, move the ticket to review dispatch.test.ts, cli-runs.test.ts, custom-agent.test.ts, review-agent.test.ts
fix fails the checks on the first try, passes on the second send the failed output back and try again, within max_attempts dispatch.test.ts, custom-agent.test.ts
fail fails the checks every time after the last attempt, block the ticket with the checks' reason dispatch.test.ts, server-approve.test.ts
block asks a question through clara_block end the run blocked; resume the agent's own session with the answer, or a new one given the whole ticket when the old one is gone dispatch.test.ts, cli-start.test.ts
permission asks to run a command its rules do not allow put it to a person through the bridge, answered from a terminal or the page; the agent does without when denied; what no one answered is denied once the agent stops dispatch.test.ts, cli-runs.test.ts, e2e/runs.spec.ts
sneak tries to write a file beside the worktree with git commands its rules allow, through --output quoted to slip past a rule and through a redirection refuse every one in the hook that runs before each command, so no file is written; the work still lands dispatch.test.ts, unit/conductor/refuse.test.ts
redirect after its work, points the worktree's .git file at a git folder it wrote, whose config names a program for git status to run notice the change before git runs there again, fail the run, block the ticket for a person, and run no git and no reviewer there dispatch.test.ts, worktree.test.ts, review-agent.test.ts
hang, stubborn says nothing and never ends; stubborn also ignores the interrupt interrupt it at max_minutes, terminate it if it ignores that, and block the ticket with the reason dispatch.test.ts, cli-runs.test.ts
crash exits with an error part way block the ticket with what the agent printed dispatch.test.ts, custom-agent.test.ts, review-agent.test.ts
budget, turns spends past max_budget_usd, or takes more than max_turns end the run at the limit; the day's ceiling caps a run at what is left and starts none once it is spent dispatch.test.ts
idle ends having committed nothing fail the run dispatch.test.ts, work.test.ts
three at once three agents, a board with dependencies work three tickets at once, then each wave its dependencies unblock, until none is left work.test.ts

The reviewer agent (D9, D-106) has modes of its own (FAKE_REVIEW_MODE): approve, changes, note (an opinion and no verdict), meddle (tries to write and to commit, which a read-only run refuses) and crash, driven in review-agent.test.ts. All of these files are under test/integration/, apart from the journey and the unit test named.

Demo 1

clara demo --headless from the build of ad0a0d8, run once for this file in an empty folder with NO_COLOR=1 and a CLARA_HOME of its own. It made Ledger in a temporary folder, worked it with Clara's own work loop and the scripted demo adapter, merged each approved ticket into main, ran the check on the merged work, and removed the folder. Exit 0, 15.2 s of wall time; the empty folder and the CLARA_HOME were still empty after.

This is a simulation: scripted agents, not real ones, are working a made-up project in a temporary folder. No model is called.
The work is real all the same: Clara’s own work loop starts each agent in a worktree of its own, runs the checks, and merges what the lead approves.

Mira Okafor leads Ledger, and 3 agents work 5 tickets of it: atlas, juniper, sage.
LED-3 goes to agent:juniper (its assignee)
LED-2 goes to agent:atlas (its assignee)
LED-3 ✓ handed in · 1 attempt, 3 s, $0.00
LED-3 goes to agent:sage for review (read-only)
LED-2 ✓ handed in · 1 attempt, 2 s, $0.00
LED-2 goes to agent:sage for review (read-only)
LED-3 review by agent:sage ✓ commented · 1 attempt, 0 s, $0.00
LED-3 approved by Mira Okafor
LED-3 merged into main (28c6fa0)
LED-5 goes to agent:juniper (its assignee)
LED-2 review by agent:sage ✓ commented · 1 attempt, 1 s, $0.00
LED-4 goes to agent:atlas (its assignee)
LED-2 approved by Mira Okafor
LED-2 merged into main (86b2ff8)
LED-4 blocked: LED-4 asks for a decision on who pays the extra cents, and that is the lead's to ma… · 1 attempt, 3 s, $0.00
LED-4 asks Mira Okafor: When a bill does not divide evenly, who pays the extra cents? I can give th…
LED-4 Mira Okafor answered: The first people in the list, one cent each. Predictable beats fair here, s…
LED-4 goes to agent:atlas (its assignee, carrying on its last session)
LED-5 ✗ check test failed (exit 1)
LED-5 attempt 2: the checks failed, so it tries again
LED-5 ✓ handed in · 2 attempts, 5 s, $0.00
LED-5 goes to agent:sage for review (read-only)
LED-4 ✓ handed in · 1 attempt, 1 s, $0.00
LED-4 goes to agent:sage for review (read-only)
LED-5 review by agent:sage ✓ commented · 1 attempt, 1 s, $0.00
LED-5 approved by Mira Okafor
LED-5 merged into main (1cbeb6d)
LED-4 review by agent:sage ✓ commented · 1 attempt, 1 s, $0.00
LED-4 approved by Mira Okafor
LED-4 merged into main (95c14aa)
LED-6 goes to agent:atlas (its assignee)
LED-6 ✓ handed in · 1 attempt, 2 s, $0.00
LED-6 goes to agent:sage for review (read-only)
LED-6 review by agent:sage ✓ commented · 1 attempt, 1 s, $0.00
LED-6 approved by Mira Okafor
LED-6 merged into main (d4884eb)
✓ check test passes on the merged work

Done in 15 s: 5 tickets merged, 1 question answered.

What it shows, each line from the real conductor rather than a script of output:

  • Three agents work two tickets at once, and each later ticket starts when its dependency is merged (LED-5 and LED-4 after LED-3 and LED-2, LED-6 last).
  • LED-4 blocks on a question for the lead, is answered, and carries on its own session.
  • LED-5 fails its check on the first attempt and passes on the second.
  • agent:sage reviews every hand-in read-only, as D9's second opinion, and the lead approves; approval merges into main through the same landing code as clara approve.
  • The check runs again on the merged work at the end; --headless exits 1 if it fails.

The scripted agent is the demo adapter, which ships with Clara for this and nothing else, and every screen of the browser demo says it is a simulation (test/integration/demo.test.ts, test/integration/cli-demo.test.ts, test/integration/demo-template.test.ts, test/unit/conductor/demo.test.ts).

Fresh-eyes review

A reviewer with no part in the build read git diff 89d14b6..HEAD (the conductor and its views) for the most serious problems, changing nothing. It reported seven, and judged the rest sound: the trust store, the router, the Windows command escaping, worktree paths, branch validation, the push that never forces, the defused pull request body, the run slot, log masking, the web views and the demo's own trust. All seven were real; each was fixed with a test that fails without it.

# Severity Finding Fix
1 critical The board's checks run code the agent wrote, as the person, so clara called from a test script acted as the person 82279a0: checks run as the agent (CLARA_ACTOR, CLARA_RUN), so a clara call from them is the agent's. The security model now says plainly that a check runs the agent's code with the person's rights, as any CI job on a branch does; there is no sandbox to put it in that every check would run under
2 high git log, git show and git diff, which the guarded and read-only rules allow, write any text to any file with --output 1fb6a03: a Claude Code run gets a hook, written for the run, that reads each command as the shell does and refuses a redirection to a file, git's --output, and git with $ or a backtick, however it is quoted; the sneak mode tries each. OpenCode and Gemini CLI get deny rules for them, and Copilot CLI exact reads. The two doc passages that said otherwise are corrected
3 high Approving landed whatever the ticket's branch pointed at, which any agent could change, not the commit handed in and checked c3442a7: completion records the branch, landing refuses a branch that moved since it was handed in and lands that exact commit, and an agent names a branch or pull request only on a ticket it holds
4 medium commitFolders puts the other run branches and the worktree's commondir in the Codex and Cursor sandboxes' reach 944e262: before git runs in a worktree again (the gates, reuse, the reviewer), Clara checks its .git file, gitdir, commondir and config.worktree are as git made them, else fails the run and runs nothing there; the redirect mode does it. Other branches are covered by 3; 121ce76 corrects the comments that said less was in reach
5 low-medium The person's own ~/.claude/settings.json can allow tools to guarded and reviewer runs, which the docs denied 8c6b249: the read-only run denies the editing tools outright, which wins over any allow the person's settings give, and the security model says what those settings can still add, such as a shell rule
6 low A clone with the base only as origin/<base> failed every run as "committed nothing" 24065c2: the gate and the reviewer resolve the base as landing does
7 low The checks could run well past the run's time limit 86d6250: the checks stop at the run's deadline, and the run ends at its limit with the ticket blocked for a person

Two more came from elsewhere in the same stretch. An automated security review found that the second opinion started the reviewer in a worktree whose agent-written files (.codex/, opencode.json) it would load untrusted (ef225b4: the reviewer starts only while they are trusted). And the clean-checkout run before a push caught the refusal hook failing when Clara runs from source through tsx, which keeps function names (9fdd78e, with a test that runs it that way).

Clara on its own board

M5 was worked on Clara's own board as agent:claude, with review.mode: gates (D-043), as M4 was.

Ticket What
CLA-56 to CLA-60 The run record, the adapter seam and the Claude Code adapter, dispatch, the work loop, and the router and limits
CLA-61 Review: the second opinion, and approving to a pull request or a merge
CLA-47 The clara_permission tool for dispatched runs, through the approval bridge
CLA-62 The other agents: six experimental adapters and custom commands
CLA-63 The runs and review views
CLA-64 Demo 1
CLA-65 The capped real run: prepared as a script for a person, and recorded here

Hosted CI

Started by hand when the milestone's work was done (D-028). The first three runs failed. Each failure was a fault in Clara or a test that read the wrong thing, and each was fixed. No test was skipped and no assertion weakened; two tests that start processes were given the time the others that start processes already had.

Run Commit Result
44520767845 88342cd Failed. The demo template's own tests print Node's spec reporter on Node 24 and 26, not the TAP the test read: they now run with TAP (18d26ad). On a phone, two wrapped reply rows in what needs you were too close for a finger (5cb4537). Windows failed 13 tests in 9 files: PATH as Windows passes it (73d10dd), an agent ended by force given an exit code (4f81190), the commit folders' paths spelled the POSIX way (ae14316), a file in a worktree's .git replaced in place (7eba6ba), and the docs gate test given too little time (52e2a63)
44528475733 4411f95 Failed. On Ubuntu with Node 22 and 26, clara list on 1,000 tickets went over its 200 ms on a slow runner; it was made faster, not given more time (6a7f5fa). On Windows, two tests expected a slash in a worktree path Windows spells with a backslash (997eea8)
44635797477 6a7f5fa Failed on Windows only: the MCP conformance test, which starts clara mcp as a process of its own, ran past 20 s; it now has the minute the other tests that start processes have (9c1c0ce)
44640736047 9c1c0ce Passed on all nine jobs: Ubuntu on Node 22 (354 s), 24 (339 s) and 26 (373 s), macOS (191 s) and Windows (618 s) on Node 24, the browser journeys on Ubuntu (194 s), Bun running the CLI (21 s), the plan job and the summary

Test totals in the green run: Ubuntu 4,096 passed and 3 skipped on each Node, macOS 4,097 and 2, Windows 4,092 and 7. The skips are shells a system lacks for parsing completion scripts; on Windows, file modes and links that only POSIX has, and an interrupt Windows cannot send another process; elsewhere, the test of a Windows .cmd script. The browser journeys passed 53 of 53 in Chromium on Linux (2.6 minutes).

The budgets on the slowest runners: clara --version from cold in 43.2 ms on Windows and 25.4 ms on Ubuntu (limit 100 ms); clara list on 1,000 tickets in 189.0 ms on Windows (its limit 400 ms, D-071) and 132.3 ms on Ubuntu (limit 200 ms).

The Linux screenshot baselines were removed when the runs and review views changed every view's navigation (D-116), so this run wrote a new set instead of comparing, and uploaded it as e2e-baselines. That set was not committed: the docs view (D-126) adds to every view's navigation again two commits later. The set M6's hosted run writes is the one to look at and commit.