Skip to content

develop

Developing Arthur itself: roadmap entry 66, arthur plugin new <name> --budget <lines>, a new plugin package in Arthur’s repository with its package.json, plugin file, test against the fake host and doc page, its line budget in test/structure.test.ts, that passes npm run check and npm test as created (arthur plugin --help); entry 67, arthur eval, coordinator turns replayed against the scenarios of the loaded packages, each run on a copy of its scenario’s fixture with arthur a recording stub, scored by what it left behind, its pass rate against the baseline (arthur eval --help); and entry 68, the scenarios, each in evals/<name>/ of the package whose procedure it tests, replayed against a fake agent by packages/develop/test/scenarios.test.ts, their rates on the coordinator’s model in evals/baseline.json.

plugins: [
orchestration({}),
projects({ folders: ["projects/arthur"] }), // projects/arthur/project.config.ts: projects.project({ prefix: "AR", path: "../.." })
develop({ evals: { runs: 3, baseline: "evals/baseline.json" } }),
],

It needs the project list (the projects plugin): arthur plugin new writes into a project’s checkout, or, run by a job, into that job’s own worktree, named with --root, so a worker on a new plugin’s ticket makes the package on its own branch; in Arthur’s repository the planner’s and the worker’s prompt carry the line that runs it from a job, and the coordinator’s context the line that has a new plugin’s ticket name "machine": "local" in its JSON block, which the machines plugin places its jobs by (arthur plugin --help). arthur eval keeps its baseline in the main project’s checkout. arthur eval also needs orchestration, whose coordinator role and model it runs.

Option What it is Default
evals.runs How many times each scenario runs per arthur eval, all at once; --runs overrides it. A whole number, 1 or more. 3
evals.baseline The baseline, each scenario’s pass rate, in the main project’s checkout; arthur eval --save-baseline writes it. A path inside the checkout: neither absolute nor through ... evals/baseline.json

Any other option or key is refused at load: develop.<key>: unknown option; options: evals, develop.evals.<key>: unknown key; keys: runs, baseline, and a wrong value names what it should be.

Usage: arthur eval [<scenario>...] [--runs <n>] [--save-baseline]. Comes with the develop plugin (roadmap entry 67).

Measures the coordinator: replays one coordinator turn per run against each scenario of the loaded packages (or only those named), --runs times each (default evals.runs, 3), the runs of one scenario at once, the scenarios one after another; a scenario with agent replays a project agent’s turn instead. A run costs what a coordinator turn costs: it runs the real agent.

$ arthur eval delivery/review-pass delivery/worker-done
arthur eval: model anthropic/claude-opus-5-5, thinking high, 3 runs each; transcripts in /home/arthur/arthur/.arthur/develop/evals/2026-10-22T08-00-00-000Z
delivery/review-pass: 3/3 (baseline 2/3, up)
delivery/worker-done: 1/3 (baseline 3/3, down)
run 1: no call matches /^arthur review (\S+-)?3c1f9a20$/
run 3: the turn ran past its timeout of 900 s and was stopped
passed 4/6 runs; moved against the baseline: delivery/review-pass (up, 2/3 to 3/3), delivery/worker-done (down, 3/3 to 1/3)

The scenarios Arthur ships (roadmap entry 68), run by npm test against a fake agent in packages/develop/test/scenarios.test.ts: in delivery, worker-done, condition-before-review, review-pass, review-pass-hook, review-fail-handed-back, review-fail-continue, merge and check-failed; in orchestration, later-is-a-ticket, no-sleep, night-one-line, morning-report, env-refusal, status-from-jobs and room-refused-waits; in manage, audit-autopilot and retro; in session, after-restart-plan, after-restart-agent (a project agent’s turn) and unblocked-after-restart; in github, ci-failed; in projects, onboarding-questions. A new scenario gets its right and wrong turn in that test.

A scenario is a folder evals/<name>/ in a package the load runs (the core’s, each enabled plugin’s), named <package folder>/<name>, kept in the package whose procedure it tests: its fixture/, the repository the turn runs on, with its vision at spec/vision.md (else the turn’s context warns the copy has no vision), and its scenario.json:

{
"turn": { "ended": { "id": "2026-10-22-worker-0a1b2c3d", "kind": "worker", "state": "ended", "reason": "finished" }, "result": "Done: the login is fixed." },
"hour": 23,
"context": { "session": "Restart: none due; no commit changed Arthur's code since arthur run started 2026-10-22 08:41 at 0a41782." },
"timeoutSeconds": 900,
"stub": [{ "match": "^arthur review ", "output": "started review 2026-10-22-review-1a2b3c4d" }],
"expect": {
"files": { "spec/build.json": ["\"AR0001\""] },
"missing": ["notes.md"],
"refs": { "refs/heads/main": "kept", "origin:refs/heads/main": "kept" },
"calls": ["^arthur jobs\\b", { "match": "^arthur review 2026-10-22-worker-0a1b2c3d$", "times": 1 }],
"never": ["^arthur merge "],
"reply": { "lines": 3, "match": ["AR0001"], "never": ["\\bsorry\\b"] },
"tools": ["^bash [\\s\\S]*\\bsleep\\b"]
}
}
  • turn, one of four, its text the one orchestration’s inbox hands the coordinator for its event, asked of orchestration (coordinator.turn, arthur coordinator --help), so a change of that wording reaches every scenario: { message, channel? }, the owner’s message, a message-received of one text part (telegram when the channel is left out), [via <channel>] with the message quoted under it; { scheduled, message, procedure? }, a schedule entry due, a coordinator-message as the schedule plugin words it, asked of schedule (schedule.message, arthur schedule --help): [scheduled <id>] <message> with, after a blank line, the text of procedure, a file’s path from the scenario’s folder (../../roles/coordinator/morning-report.md reads the package’s own procedure), marked [Arthur: schedule]; { arthur, plugin }, a plugin’s message to the coordinator, a coordinator-message of its text as the plugin words it (CI run …), marked [Arthur: <plugin>], plugin the name of the plugin that emits it (a turn without it fails its run: turn.plugin: expected the name of the plugin that emits turn.arthur); { ended, result? }, a job’s end, ended its { id, kind, state, reason?, project?, records? } (state ended or blocked, project the main one when left out), result its final message: the wake, with what the loaded plugins add for its kind (coordinator.wake: the procedure of an audit, a retro, a plan, an onboarding with its questions, a review’s verdict), each asked with that final message; records, { <plugin>: <its record> }, stands for what a plugin’s own records would hold of the job, which no home holds, as the plugin’s docs name it (delivery’s review: arthur review --help). Arthur’s own turns end with the line that [Arthur] marks them. A turn orchestration or schedule refuses (an id that is not an entry’s, schedule not loaded) fails the scenario, naming why.
  • hour: the hour of the owner’s day the turn is played at, a whole hour 0 to 23, noon (12) when left out, so no scenario hangs on when the eval runs: the context’s ## Time says that hour in core.timeZone (the instant within 12 hours of now that shows it, its minutes now’s), night or day by core.quietHours, and the session’s TZ is the zone Etc/GMT±<n> whose local hour now is that one, so date there reads it too.
  • context: { <plugin>: <text> }, the lines each plugin adds to the coordinator’s context in this turn, instead of what the live plugin answers: a plugin left out adds none, so the run measures the fixture, not the machine the eval runs on. The name is the plugin’s (session, projects, manage, …); one that answers no context there fails the run (coordinator.checkoutContext: context names <name>: no such plugin answers coordinator.context; those that do: <names>). No lines when left out.
  • agent: makes the turn a project agent’s instead of the coordinator’s (arthur coordinator --help, “Project agents”): a path from the repository’s root, the agent’s own session folder in the run’s repository (.arthur/session/agents/shop, as the session plugin’s <home>/session/agents/<project>/). The run makes that folder before the turn and names it in the turn’s ARTHUR_SESSION_FOLDER, as the session plugin does for a live agent, and the context is a project agent’s (below). A path that is not text, is absolute, or is not inside the repository as written, whatever folder the eval runs in (the root itself, one that leaves it through ..), fails the scenario: agent: expected a path inside the repository, the project agent's session folder. A fixture that ships a link on that path fails the run before any folder is made: the run failed: agent: <path> leaves the run's repository through the fixture's link <link>, or Node’s own error for a link to nothing. Left out, the turn is the coordinator’s and it has no ARTHUR_SESSION_FOLDER.
  • timeoutSeconds: how long the turn may run, 900 when left out; past it the agent’s process group is killed and the run fails.
  • stub: what arthur answers. Each call is arthur <arguments joined by spaces>, without the quotes the shell took off; the first answer whose match (a regex) matches it and has not answered yet answers, else the last that matches; none answers with nothing and exit code 0. An answer writes its files ({ <path>: <text> }, from the repository’s root) as the real command would change the repository, then prints its output and exits with its exit (0 when left out).
  • Help needs no stub, and no answer ever takes a help call: arthur <command> ... --help and arthur help [<command>] print what the live CLI prints, with the commands the load registers (the core’s and each enabled plugin’s, commands.docs()), --project <name> ignored as there. A registered command’s page; arthur help, arthur --help and arthur alone, the usage line and every command’s name; a command the load does not register, arthur: unknown command <name> and every name, exit code 2; arthur help of two words, the usage, exit code 2. Such a call is noted { call, help: true } in the stub’s log, and no calls or never regex counts it; the agent’s tool call that ran it stays in tools. Any other call of a command the load does not register goes to the stub answers as any call.
  • expect, what the run must leave behind, all of it optional: files, each file in the working tree after the turn, every regex matching it (multiline); missing, paths that must not exist; refs, each ref of the repository, or of its remote as origin:<ref>, kept (where it was before the turn) or moved (somewhere else, not gone); calls, regexes each matching a call of the stub’s log, in this order, each a regex or { "match": <regex>, "times": <n> }, which also asks that exactly n calls of the whole turn (a whole number, 1 or more) match it, those before the one it is matched to in order included, and fails as /<regex>/ matches <count> calls, expected <n>; never, regexes no call may match; reply, the reply, the text of the agent’s last assistant message that has any: at most lines lines that are not blank, every regex of match matching it and none of never (multiline); tools, regexes none of the agent’s tool calls may match, each bash <command> or <tool> <its arguments as JSON>.
  • needs, a list the runner does not read: each line a ticket the scenario waits for, <id>: what the turn lacks without it, or a finding of a ticket that becomes one at its merge, <id> F<n>: ..., where the run cannot give the coordinator what it sees live (the wake a plugin builds from its own records). The scenario runs all the same, its rate measured without it.
  • The scenario’s fixture/ copied into a new folder arthur-eval-* of the system’s temporary folder, made a Git repository on main with one commit, and pushed to a bare origin beside it.
  • arthur replaced by the recording stub, first on the agent’s PATH: it notes each call in its log and writes only in the run’s repository; a file of an answer outside it, an absolute path or one through .., is refused (exit 1, noted in the log) and nothing of that answer is written. No ARTHUR_ variable of Arthur’s process reaches the turn, so nothing in it names Arthur’s home; ARTHUR_EVAL names the stub, ARTHUR_SESSION_FOLDER the folder of a scenario’s agent in the run’s repository, and the real arthur, reached by its path, refuses every command there: arthur: refused inside an eval session (ARTHUR_EVAL is set): arthur there is the eval's recording stub, <path> (exit code 1).
  • The agent is core.agent.command run once, headless, in the repository: <agent> -p --mode json --no-session --auto-approve -e <env guard> [--model <model>] [--thinking <level>] --append-system-prompt <the coordinator's context> @<the turn>, the model and thinking level the coordinator’s (orchestration’s coordinator options, through roles.model), for a project agent’s turn too. The context is orchestration’s for the run’s copy of the fixture at the scenario’s hour (coordinator.checkoutContext, arthur coordinator --help): the role, the coordinator’s or with agent the project agents’ (project), and criteria of the main project (arthur roles), the copy’s vision and board, the time, and the plugins’ lines the scenario’s context sets, none of the live plugins’ (the session plugin’s Restart: line among them); no jobs, open decisions, slots or silent mode, which are the live Arthur’s, so arthur jobs and the like answer through the stub.
  • It is scored only by what it left behind: the files, the refs, the stub’s log, and the agent’s reply and tool calls from its output, against expect. A turn that ran past its timeout, or an agent that did not start or exited with another code than 0, fails the run.
  • Its folder is removed once scored; the turn, the agent’s output (stream.jsonl, stderr), the stub’s log (arthur.log) and the run’s failures go to <home>/develop/evals/<time>/<package>-<name>-<run>/, and the output to that folder’s report.

A scenario without its fixture/ folder, or whose scenario.json is missing, does not parse or is wrong, fails each of its runs, naming why, and the others run.

evals.baseline (default evals/baseline.json) in the main project’s checkout holds a pass rate per scenario, { "<scenario>": { "passed": 2, "runs": 3 } }. Each scenario’s line compares its rate with the baseline’s, up, down or same, or says no baseline; the last line names every scenario that moved. --save-baseline writes this eval’s rates into it, whole; the scenarios left out keep theirs. The baseline is the checkout’s: commit it.

  • Wrong usage, an unknown flag or a --runs that is not a whole number of 1 or more: exit code 2, with the usage line.
  • No scenario in any loaded package; a scenario name no package has, naming the scenarios there are; no project in the project list; a baseline that does not parse or holds a rate that is not { passed, runs } with passed 0 to runs (a hand edit), naming it; no coordinator role (orchestration not enabled): exit code 1, before any run.

Exit code: 0 once every run was scored, whatever the rates.

Usage: arthur plugin new <name> --budget <lines> [--project <name> | --root <job's worktree>]. Comes with the develop plugin (roadmap entry 66). Answered without the model.

Makes a new plugin package in Arthur’s repository: the checkout of the main project, or of the one --project names, the project Arthur develops itself in (projects({ folders: ["projects/arthur"] }), its projects/arthur/project.config.ts holding projects.project({ prefix: "AR", path: "../.." })). It writes into that checkout as it is, on its current branch, and commits nothing.

$ arthur plugin new acme-bot --budget 120
created packages/acme-bot: package.json, src/acme-bot.ts, test/acme-bot.test.ts, docs/acme-bot.md
added "acme-bot": 120 to BUDGETS in test/structure.test.ts, and @arthur/acme-bot to package-lock.json
next: write what it does, and list acmeBot() in the plugins of arthur.config.ts to load it

In a job (arthur help --help, its record in the home of the arthur.config.ts the CLI reads) it writes only into the job’s own worktree, the one its record names, given as --root, so the new package goes in on the job’s branch and through its review; --project then picks no folder. The CLI reads arthur.config.ts from the folder it runs in, which a worktree lacks, so a worker on a new plugin’s ticket runs it from the project’s checkout (the first line of git worktree list), which the worktree guard lets through. It runs the CLI by its path there, node_modules/.bin/arthur as npm ci links it: a job gets the PATH of arthur run, and the systemd service’s of docs/setup.md has no node_modules/.bin:

$ cd ~/arthur && node_modules/.bin/arthur plugin new acme-bot --budget 120 --root ~/.arthur-worktrees/2026-10-21-worker-0a1b2c3d

In Arthur’s repository (its checkout holds packages/core) the plugin puts this line, under ## A new plugin, into the prompt of the planner, who makes it the first step of a new plugin’s plan, and of the worker, with its own worktree as --root; <checkout>, <name> and <lines> are left for them to fill. Other projects’ jobs and other roles get no such section.

A new plugin’s ticket runs on the local machine. On another machine the project’s repository is bare (arthur remote-job --help), the first line of git worktree list there, and holds no arthur.config.ts, so the CLI there has no plugin command (arthur: unknown command plugin, exit 2). So the coordinator, the author of tickets, gets a line in its context while a project is Arthur’s repository: A ticket that makes a new plugin package in <projects> gets "machine": "local" in its JSON block before its first spawn: .... The machines plugin places every job of a ticket whose JSON block names a machine on it, with a plan or without one (arthur machines --help, “Placing a job”). The planner’s section says so too: the plan says that its worker runs on the local machine, and the coordinator spawns it with --machine local (orchestration’s roles/coordinator/plan-ended.md). A worker placed on another machine all the same gets, in place of the line, that arthur plugin new cannot run there and that the package is made on the local machine, never by hand: it changes nothing and ends, saying that its ticket’s JSON block needs "machine": "local" and its worker spawned again with its task.

What it writes:

  • packages/<name>/package.json: @arthur/<name>, the root package.json’s version (the one release every package holds), private, Apache-2.0, no dependency; its . and ./options both the plugin file.
  • packages/<name>/src/<name>.ts: the plugin file, its options file too (docs/plugin-api.md, “Option tables and ./options”): summary, tools and an empty table, a checkOptions that refuses every option but enabled, and the plugin’s function, <name> in camelCase (acme-bot: acmeBot), with its name, module and an empty setup.
  • packages/<name>/test/<name>.test.ts: the plugin set up on the fake host of @arthur/core/testing, and its refusal of an unknown option.
  • packages/<name>/docs/<name>.md: its doc page, with the line for arthur.config.ts.
  • <name>: <lines>, added to BUDGETS in test/structure.test.ts in name order: before the first budget whose name sorts after it, else last. BUDGETS holds one budget per line, a blank line after each, sorted by name (the structure test refuses it out of order), so Git merges raises to two neighbours without a conflict, and two branches that each add a plugin too when an existing budget’s name sorts between their two names; when none does (delta and denim both go between delivery and develop), both land at the same place and Git conflicts there. The name is quoted when it has a dash; the number is the line budget the plugin’s ticket decides and records in its Decisions.
  • The package in package-lock.json as npm install writes a workspace, with the same version, so npm ci installs the checkout as it is, and node_modules/@arthur/<name> linked when node_modules/@arthur exists, so @arthur/<name> resolves before the next install.

As created, the package passes npm run check, npm test and the structure test with no hand edit. The package folder appears whole: it is written under a hidden name in packages/ and renamed; the lockfile and the structure test are each written to a temporary name and renamed.

Refused, exit 1, with refused: <why>; nothing was written on stderr, before any file is written:

  • a name that is not lowercase letters and dashes, a dash only between letters (uptime, commit-rules), as the host takes a plugin’s name;
  • a name whose function would be a JavaScript reserved word (new, delete, class, …) or a name the new files declare or import (assert, test, fakeHost, checkOptions, summary, tools, table);
  • --budget missing, not a positive whole number (0, 1.5, 01, =-1), or below the lines the new package’s src/ holds as created (25), which the structure test would refuse;
  • a name taken: packages/<name> exists, the core’s included, or BUDGETS has a budget of that name;
  • in a job, no --root (a job writes only in its own worktree: add --root <worktree>), or one that is not, through its links, the worktree the job’s record names (--root <path> is not this job's worktree <worktree>);
  • outside a job, any --root (--root is a job's own worktree; outside a job the package goes into the project's checkout).

Anything but new <name> and its flags, an unknown flag, or --budget with no value prints the usage and exits 2. An unknown --project exits 1 with unknown project <name>; projects: ....