@autodidacticon/orchestrator 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/README.md +60 -33
  2. package/dist/src/agent/mcp-shim.js +1 -1
  3. package/dist/src/agent/server.js +11 -6
  4. package/dist/src/agent/server.js.map +1 -1
  5. package/dist/src/brief/compose.js +8 -1
  6. package/dist/src/brief/compose.js.map +1 -1
  7. package/dist/src/config.js +23 -3
  8. package/dist/src/config.js.map +1 -1
  9. package/dist/src/graph/load.js +4 -0
  10. package/dist/src/graph/load.js.map +1 -1
  11. package/dist/src/import/mapping.js +29 -5
  12. package/dist/src/import/mapping.js.map +1 -1
  13. package/dist/src/index.js +8 -1
  14. package/dist/src/index.js.map +1 -1
  15. package/dist/src/launch/launch.js +5 -1
  16. package/dist/src/launch/launch.js.map +1 -1
  17. package/dist/src/log.js +20 -0
  18. package/dist/src/log.js.map +1 -0
  19. package/dist/src/loop/orchestrator.js +94 -3
  20. package/dist/src/loop/orchestrator.js.map +1 -1
  21. package/dist/src/loop/tick.js +2 -1
  22. package/dist/src/loop/tick.js.map +1 -1
  23. package/dist/src/main.js +115 -33
  24. package/dist/src/main.js.map +1 -1
  25. package/dist/src/operator/cli.js +40 -2
  26. package/dist/src/operator/cli.js.map +1 -1
  27. package/dist/src/operator/mcp-server.js +41 -9
  28. package/dist/src/operator/mcp-server.js.map +1 -1
  29. package/dist/src/operator/mcp.js +1 -1
  30. package/dist/src/operator/routes.js +62 -5
  31. package/dist/src/operator/routes.js.map +1 -1
  32. package/dist/src/runner/claude-code.js +1 -1
  33. package/dist/src/runner/claude-code.js.map +1 -1
  34. package/dist/src/runner/command.js +24 -0
  35. package/dist/src/runner/command.js.map +1 -0
  36. package/dist/src/runner/selection.js +20 -0
  37. package/dist/src/runner/selection.js.map +1 -0
  38. package/dist/src/runner/subprocess.js +7 -1
  39. package/dist/src/runner/subprocess.js.map +1 -1
  40. package/dist/src/runs/childEnv.js +32 -0
  41. package/dist/src/runs/childEnv.js.map +1 -0
  42. package/dist/src/runs/lifecycle.js +102 -5
  43. package/dist/src/runs/lifecycle.js.map +1 -1
  44. package/dist/src/runs/resolve.js +217 -0
  45. package/dist/src/runs/resolve.js.map +1 -0
  46. package/dist/src/runs/runDir.js +63 -13
  47. package/dist/src/runs/runDir.js.map +1 -1
  48. package/dist/src/state/store.js.map +1 -1
  49. package/dist/src/toolchain/branch.js +19 -0
  50. package/dist/src/toolchain/branch.js.map +1 -0
  51. package/dist/src/toolchain/detect.js +115 -0
  52. package/dist/src/toolchain/detect.js.map +1 -0
  53. package/dist/src/toolchain/tools.js +56 -0
  54. package/dist/src/toolchain/tools.js.map +1 -0
  55. package/dist/src/verify/verifier.js +9 -3
  56. package/dist/src/verify/verifier.js.map +1 -1
  57. package/hosts/claude-code/.claude-plugin/plugin.json +1 -1
  58. package/hosts/claude-code/package-lock.json +1247 -0
  59. package/hosts/claude-code/package.json +1 -1
  60. package/hosts/claude-code/skills/import/SKILL.md +66 -14
  61. package/hosts/claude-code/skills/run/SKILL.md +83 -21
  62. package/hosts/claude-code/skills/work/SKILL.md +25 -6
  63. package/hosts/claude-code/workflows/work.js +23 -9
  64. package/package.json +1 -1
package/README.md CHANGED
@@ -1,27 +1,51 @@
1
1
  # orchestrator
2
2
 
3
- An orchestrator that runs many coding agents in parallel from a dependency graph of tasks against one repository. Dependencies gate admission. Each agent works in its own git worktree and reports through a local API. Humans resolve blockers and review milestones. A task is done only after its sealed work has been rebased, checked, and published to the integration branch. The orchestrator itself is a static TypeScript daemon with named hook points for model-backed judgment, designed to converge to the same outcome after a crash at any point. Task graphs are imported from Linear or Jira through the session's own tracker connector, and progress is mirrored back to the tracker.
3
+ An orchestrator that runs many coding agents in parallel from a dependency graph of tasks against one repository. Dependencies gate admission. Each agent works in its own git worktree and reports through a local API. Humans resolve blockers and review milestones. A task is done only after its sealed work has been rebased, checked, and published to the integration branch. The orchestrator itself is a static TypeScript daemon with named hook points for model-backed judgment, designed to converge to the same outcome after a crash at any point. Task graphs are imported from Linear, Jira, or GitHub Issues through the session's own tracker connector (the `gh` CLI for GitHub), and progress is mirrored back to the tracker.
4
4
 
5
5
  ## Running locally
6
6
 
7
- Prerequisites: Node 22.13 or newer (the store uses Node's built-in SQLite), git, and, for real agents, the Claude Code CLI (`claude`) logged in. Scripted agents need nothing else.
7
+ Prerequisites: Node 22.13 or newer (the store uses Node's built-in SQLite), git, and, for real agents, the Claude Code CLI (`claude`) logged in. Scripted agents need nothing else. Start from a Claude Code session with the plugin, or from a terminal with the CLIs.
8
+
9
+ ### From a Claude Code session
10
+
11
+ Install the plugin from this repository's marketplace. Nothing else needs to be installed or on PATH:
12
+
13
+ ```
14
+ claude plugin marketplace add autodidacticon/orchestrator
15
+ claude plugin install orchestrator@orchestrator
16
+ ```
17
+
18
+ From a checkout instead, run `npm install && npm run build` once, then `claude --plugin-dir /path/to/orchestrator/hosts/claude-code`.
19
+
20
+ Then use the skills: `import` turns a Linear or Jira epic, or a GitHub issue or milestone with its sub-issues, into the graph with the session's own tracker connector, `run` starts the daemon, has the session's own subagents execute the launches through a bundled workflow, and monitors (questions, reviews, stuck tasks, proposals, tracker mirroring), `work` adds workers from another session or switches the mode, and `review` judges a milestone's pinned commit. On `start` the daemon detects the repository's check command, integration branch, and the tools agents may run, and the skill reports them with their sources; when nothing supplies a check command, the skill looks in `CLAUDE.md`, the README, and the root manifests and sets it through `configure`, or asks. No `orchestrator.yaml` is needed; the terminal section below describes the resolution order and the overrides. The plugin's launcher (`hosts/claude-code/bin/orchestrator.mjs`) runs the package from the plugin's own `node_modules` after a marketplace install (Claude Code installs the published package `@autodidacticon/orchestrator` pinned in `hosts/claude-code/package.json`), from the checkout when loaded with `--plugin-dir`, and through `npx` as a fallback.
21
+
22
+ Who executes launches is `runner.mode`: `pull` parks each prepared launch until a worker claims it, and is what a run started from the plugin defaults to, with the `run` skill's workflow claiming launches for visible session subagents; `spawn` has the daemon run headless Claude Code agents, and is the default for `orchestrator-ctl start` from a terminal, where no session is attached; `mixed` parks for `runner.claimWindowMs` (default 60 s) and then spawns. `runner.mode` in `orchestrator.yaml`, `orchestrator-ctl mode <mode>`, or `start` with `mode` are explicit choices that the plugin default never overrides. A claimed launch has no process: its lease is renewed by the worker's API calls and by progress in the worktree, and `release` hands it back (untouched: no attempt spent; with `--keep`, or `keep: true` on the tool, uncommitted work is committed on the launch branch, the branch is kept, and the task returns to unstarted at no cost with an `interrupted` context in its next brief, up to `daemon.maxKeptReleases` times, default 3).
23
+
24
+ ### From a terminal
25
+
26
+ Build the package and put its executables on PATH:
8
27
 
9
28
  ```
10
29
  git clone git@github.com:autodidacticon/orchestrator.git && cd orchestrator
11
30
  npm install
12
31
  npm run build
13
32
  npm link # puts orchestrator, orchestrator-ctl, orchestrator-mcp, orchestrator-mcp-shim on PATH
14
- npm test # unit, slice, and crash-injection suites with scripted agents; no model calls
15
33
  ```
16
34
 
17
- ### From a terminal
18
-
19
- 1. In the repository you want to work on, write `orchestrator.yaml` (every key is optional):
35
+ 1. No configuration file is needed. At every start the daemon reads the repository root (never subdirectories) and detects the check command from the first matching manifest in a fixed order (a `Makefile` with a `test` target, then `package.json` with a real `test` script using the package manager named by `packageManager` or the lockfile, then `Cargo.toml`, `go.mod`, `pyproject.toml`/`setup.cfg`/`pytest.ini` with uv or poetry when their lockfile exists, `Gemfile`, `build.gradle(.kts)`, `pom.xml`, `mix.exs`, `*.sln`/`*.csproj`), the integration branch (`origin/HEAD` when that branch exists locally, else the checked-out branch, else `main`), and the tools spawned agents may run (`Bash(git:*)` and the orchestrator tools, plus the test, run, install, and exec commands of every toolchain found: `npm test`, `npm run`, `npm install`, `npm ci`, `npx`, `node`, `cargo`, `go`, `pytest`, `python`, `pip`, `uv`, `poetry`, `make`, and their counterparts). Every value is resolved in one order, an explicit argument over `orchestrator.yaml` over the branch pinned for the run (integration branch only) over detection over the built-in default, and records where it came from. Arguments are durable overrides for the run: `orchestrator-ctl start --set checkCommand="make check" --set capacity=3` (also `integrationBranch`, `allowedTools` as a JSON array or one rule per flag, `runnerCommand`, `model`, `effort`), and `orchestrator-ctl config --check-command ... --capacity ... --allow "Bash(docker:*)" --runner-command ... --model ... --effort ... --clear <key>` on a running daemon; `orchestrator-ctl config` alone prints every key with its value and source, the detection record, and `needsConfig`. The same facts are in `status` (`config`, `toolchain`, `needsConfig`) and in `config.json` in the run directory. When nothing supplies a check command, `needsConfig` names it and submitted work is held, without spending an attempt, until one is set. The integration branch is pinned when the run first starts: a re-pointed `origin/HEAD` or a different checked-out branch never moves it, and an explicit different branch is refused once the run holds launches (start from a fresh run directory to change it). The derived allow list lets spawned agents fetch and run packages, including their install scripts, with the user's credentials; `runner.claude.deriveTools: false` with an explicit `runner.claude.allowedTools`, or a `deny` rule in the project's `.claude/settings.json`, narrows it. Which agents get the list is the runner mode: it is filled into the `{allowedTools}` slot of the default `runnerCommand` for launches the daemon spawns (`spawn`, and `mixed` after the claim window), while a launch claimed by a session worker runs under that session's own permissions (see the previous section). Workers run `claude-opus-5-5` at `medium` effort by default (`runner.claude.model` and `runner.claude.effort`, overridable the same way); a task chooses its own with `model` and `effort` in its payload, which the import fills from `model:<name>` and `effort:<level>` labels on the issue. The choice is fixed when a launch is prepared, filled into the `{model}` and `{effort}` slots of the default `runnerCommand` for spawned agents, carried in the claim response for session workers, and shown per launch in `status`. An existing `orchestrator.yaml` keeps working unchanged: keys it sets resolve with source `file`, and a `runnerCommand` without the `{allowedTools}`, `{model}`, or `{effort}` slots runs verbatim. The file is optional for everything else too:
20
36
 
21
37
  ```yaml
22
38
  integrationBranch: main
23
39
  checkCommand: npm test # run on every rebased submission before it is published
40
+ apiBind: 127.0.0.1 # the address the API binds; 0.0.0.0 in a cluster (file key, read at start)
41
+ apiBaseUrl: http://orchestrator.orch.svc:8080 # the URL advertised to agents and clients when it differs from the bind
24
42
  capacity: 2 # agents in parallel
43
+ runner:
44
+ claude:
45
+ allowedTools: ["Bash(docker:*)"] # appended to the derived list for spawned agents
46
+ deriveTools: true # false: only Bash(git:*), the orchestrator tools, and the rules above
47
+ model: claude-opus-5-5 # worker model; a task's `model` payload key or `model:<name>` label overrides it
48
+ effort: medium # low, medium, high, xhigh, or max; a task's `effort` key or `effort:<level>` label overrides it
25
49
  scheduling:
26
50
  order: [criticalPath, priority, fifo] # admission order; ties keep graph file order
27
51
  scopes: true # never run two tasks whose declared scopes overlap
@@ -62,7 +86,8 @@ npm test # unit, slice, and crash-injection suites with scripted agen
62
86
  4. Operate the run from the same terminal:
63
87
 
64
88
  ```
65
- orchestrator-ctl status # sets by state, stall roots, open questions, stuck tasks, deferred tasks, cost
89
+ orchestrator-ctl status # sets by state, stall roots, open questions, stuck tasks, deferred tasks, cost, config, toolchain, needsConfig
90
+ orchestrator-ctl config [--check-command <cmd>] [--allow <rule>] [--capacity <n>] [--clear <key>] # show or override the configuration
66
91
  orchestrator-ctl answer T1 "use sqlite" # answer an agent's question
67
92
  orchestrator-ctl logs T1 # the agent's captured output
68
93
  orchestrator-ctl nudge T1 "commit what you have"
@@ -77,29 +102,22 @@ npm test # unit, slice, and crash-injection suites with scripted agen
77
102
 
78
103
  The daemon exits on its own after `daemon.idleExitMs` (default 10 min, 0 disables) with nothing live and no session attached (`daemon.exitWhileAttached: true` lets it exit while one is), records why in `daemon.json` (`runs` shows `exit` for a daemon that is gone, or nothing after a crash), and any `orchestrator-ctl` command or plugin tool revives it on demand; only an explicit `stop` is final until the next `start`. `status` reports `idle` and `attachments`. To run the daemon in the foreground instead, `orchestrator --repo .` (SIGTERM stops it gracefully). To keep everything inside one directory, use a config with explicit paths and `orchestrator --config orchestrator.yaml` with `repoPath`, `graphPath`, and `dataDir` set; then pass `--data-dir` to `orchestrator-ctl`.
79
104
 
80
- By default agents are headless Claude Code sessions (`runnerCommand`), each in its own git worktree with the brief on stdin and the agent API as an MCP server. For a dry run without model calls, point `runnerCommand` at the scripted agent: `node --import <repo>/node_modules/tsx/dist/loader.mjs <repo>/test/agents/scripted.ts {briefJson}`, and give each task a `behavior` such as `commitAndSubmit`, `blockAndWait:<question>`, or `fail`.
81
-
82
- ### From a Claude Code session
83
-
84
- Load the plugin and use its skills: `import` turns a Linear or Jira epic into the graph with the session's own tracker connector, `run` starts the daemon, has the session's own subagents execute the launches through a bundled workflow, and monitors (questions, reviews, stuck tasks, proposals, tracker mirroring), `work` adds workers from another session or switches the mode, and `review` judges a milestone's pinned commit. Nothing needs to be on PATH: the plugin's launcher (`hosts/claude-code/bin/orchestrator.mjs`) runs the package from the checkout when loaded with `--plugin-dir`, from the plugin's own `node_modules` after a marketplace install (Claude Code installs the published package `@autodidacticon/orchestrator` pinned in `hosts/claude-code/package.json`), and through `npx` as a fallback.
85
-
86
- ```
87
- npm install && npm run build
88
- claude --plugin-dir /path/to/orchestrator/hosts/claude-code # from a checkout
89
- claude plugin marketplace add autodidacticon/orchestrator # or install from this repository's marketplace
90
- claude plugin install orchestrator@orchestrator
91
- ```
92
-
93
- Who executes launches is `runner.mode`: `pull` parks each prepared launch until a worker claims it, and is what a run started from the plugin defaults to, with the `run` skill's workflow claiming launches for visible session subagents; `spawn` has the daemon run headless Claude Code agents, and is the default for `orchestrator-ctl start` from a terminal, where no session is attached; `mixed` parks for `runner.claimWindowMs` (default 60 s) and then spawns. `runner.mode` in `orchestrator.yaml`, `orchestrator-ctl mode <mode>`, or `start` with `mode` are explicit choices that the plugin default never overrides. A claimed launch has no process: its lease is renewed by the worker's API calls and by progress in the worktree, and `release` hands it back (untouched: no attempt spent; with `--keep`, or `keep: true` on the tool, uncommitted work is committed on the launch branch, the branch is kept, and the task returns to unstarted at no cost with an `interrupted` context in its next brief, up to `daemon.maxKeptReleases` times, default 3).
105
+ By default agents are headless Claude Code sessions (`runnerCommand`, with `{allowedTools}`, `{model}`, and `{effort}` filled at spawn), each in its own git worktree with the brief on stdin and the agent API as an MCP server. For a dry run without model calls, point `runnerCommand` at the scripted agent: `node --import <repo>/node_modules/tsx/dist/loader.mjs <repo>/test/agents/scripted.ts {briefJson}`, and give each task a `behavior` such as `commitAndSubmit`, `blockAndWait:<question>`, or `fail`.
94
106
 
95
107
  ### Tests
96
108
 
97
109
  `npm test` runs everything that needs no model: unit tests, slices with real subprocess agents, git, and the HTTP API, and the crash-injection suite in `test/crash`, which is the project gate. Three opt-in tests use a real model: `ORCH_E2E_CLAUDE=1 npm test -- test/e2e/claude` runs three Claude Code agents, `ORCH_E2E_CLAUDE_PLUGIN=1 npm test -- test/e2e/plugin` has a Claude Code session operate a run through the plugin, and `ORCH_E2E_CLAUDE_WORK=1 npm test -- test/e2e/work` has a session execute a run in pull mode with two workers through the work skill.
98
110
 
111
+ ### Running on Kubernetes
112
+
113
+ The daemon also runs as a long-lived container. `deploy/README.md` is the operational reference: the `Dockerfile` builds an image with Node, git, and ssh only (`orchestrator` and `orchestrator-ctl` on PATH); `deploy/base` is a kustomize layout with a Recreate Deployment that clones `REPO_URL` into a volume, probes `/healthz` and `/readyz`, and runs in pull mode behind a ClusterIP Service; `deploy/overlays/kind` adds an in-cluster git origin and a one-task graph; and `deploy/smoke.sh` builds, loads into kind, applies the overlay, and asserts the milestone claims over the API (`--dry-run` prints the steps). The cluster-facing settings are `apiBind` and `apiBaseUrl` (the address the API binds and the URL it advertises; file keys read at start, not runtime overrides), `ORCH_LOG_FORMAT=json` for one JSON object per log line, and `ORCH_URL` on a client naming a non-loopback host, which makes `orchestrator-ctl` and the operator MCP server use that daemon without ever starting a local one. Workers do not yet run in the cluster: a daemon there parks launches for session workers, and the mounted graph is read-only, so import and proposal acceptance fail in that layout until the graph lives in the store. The specification is [cluster-runtime](openspec/specs/cluster-runtime/spec.md) and the "Container mode" requirement of [operator-control](openspec/specs/operator-control/spec.md).
114
+
99
115
  ## Behaviour
100
116
 
101
117
  A task is done once its sealed work has been rebased onto the integration branch, checked, and published as one squash commit with `Orchestrator-Task` and `Orchestrator-Launch` trailers; a gated milestone then waits for a human to accept its pinned commit. The daemon converges to the same outcome after a crash at any named point, and surviving agents are adopted on restart.
102
118
 
119
+ Child processes. Spawned agents and check commands inherit the daemon's environment with `ORCH_HOME` pointed inside the run's data directory and the client-side variables (`ORCH_URL`, `ORCH_REPO`, `ORCH_DATA_DIR`) removed, so repository code they run cannot discover or stop the user's daemons; `ORCH_API` stays, since the agent shim needs its own daemon. A `shutdown` through the route records who asked (attachment id, remote address, user agent) in an `operator.shutdown` event and in the exit record, and the revival refusal after a stop names the caller.
120
+
103
121
  Tracker sync. After an import that names its tracker, the daemon derives tracker-bound effects from its own transitions into a durable outbox, in the same transaction as the transition: an issue goes in progress on its first launch, done when its work is published (or, with `tracker.doneAt: milestoneAccepted`, when its gated milestone is accepted), cancelled on cancel; the parent issue follows its first starting child and closes when the milestone is accepted. Comments are posted where a human is needed: an agent's question, a block with its reason, a milestone ready for review, accepted, or rejected (`tracker.commentOnDone` and `tracker.commentOnFail` add completion and failure comments, both off by default). The daemon never talks to a tracker: the `run` skill drains the outbox after every `wait` with the session's Linear or Atlassian tools, mapping states by type, and acknowledges each effect (`outbox`, `ack` tools; `GET /v1/outbox`, `POST /v1/outbox/:id/{ack,nack}` routes; `orchestrator-ctl outbox | ack`). Every comment ends with a marker line, `— orchestrator run <id> · event <n>`, so a drainer can recognise its own comments and never posts one twice. A human reply under a question comment is relayed as the answer (`tracker.answersFromComments`, default on); the first answer wins. Config keys: `tracker.enabled` (`auto` | `always` | `never`), `maxAttempts`, `parentInProgress`, `doneAt`, `commentOnDone`, `commentOnFail`, `answersFromComments`. Status reports `tracker`, `outboxPending`, and `trackerErrors`. Manual check against a sandbox workspace: import an epic with the `import` skill in a Claude Code session connected to Linear or Jira, run it with the `run` skill, and watch the child issues move and the question comment appear; this is not part of `npm test`.
104
122
 
105
123
  The daemon's life. A session attaches through the plugin's operator server, which registers its process ancestry with the daemon on first contact and ends the attachment when its transport closes; the plugin's `SessionEnd` hook posts the ending session's ancestry as well, and the daemon ends any attachment whose own process has died. A claim made through a session carries its attachment, and when the attachment ends the daemon releases that launch with `keep` on the next tick: uncommitted work becomes a work-in-progress commit on the launch branch, the worktree goes, the branch stays, the task returns to `unstarted` with `attempts` unchanged and an `interrupted` context (prior launch, branch, head, the WIP commit) in its next brief, counted in `interruptions` and bounded by `daemon.maxKeptReleases`. With nothing live, no verifier job pending, no cascade pending, no request in flight, and no session attached, the daemon exits after `daemon.idleExitMs`, writes an exit record, and is revived by the next operator call; the plugin's `SessionStart` hook names runs whose daemon is alive or whose last exit left parked launches, open questions, a milestone under review, or a stall. Releasing a new version: bump the version in `package.json`, `hosts/claude-code/.claude-plugin/plugin.json`, and the pin in `hosts/claude-code/package.json`; `npm publish` (which builds); regenerate `hosts/claude-code/package-lock.json` with `npm install --package-lock-only` in that directory against the published version; then push.
@@ -114,22 +132,25 @@ Graph mutation. Milestones hold no work, so they never block a reopen: reopening
114
132
 
115
133
  ### Requirements
116
134
 
117
- Current specs in `openspec/specs/`, synced from the archived changes `add-orchestrator-v1`, `add-session-operator`, `add-tracker-sync`, `add-health-monitoring`, `add-graph-mutation`, `add-pull-runner`, `add-scheduling-policy`, and `replace-sqlite-driver`:
135
+ Current specs in `openspec/specs/`, synced from the archived changes `add-orchestrator-v1`, `add-session-operator`, `add-tracker-sync`, `add-health-monitoring`, `add-graph-mutation`, `add-pull-runner`, `add-scheduling-policy`, `replace-sqlite-driver`, `add-daemon-lifecycle`, `add-toolchain-discovery`, `add-model-selection`, and `add-cluster-runtime`:
118
136
 
119
137
  - Capability specs
120
138
  - [task-graph](openspec/specs/task-graph/spec.md): loading, validation, external nodes, readiness, milestones, stall detection, revisions, reload compatibility, revocability through milestones and the cascade plan, critical path length
121
139
  - [task-lifecycle](openspec/specs/task-lifecycle/spec.md): states, transitions by actor, admission, counters, leases, retry, reopen guard, cascade reopen, milestone reset and review, cancellation
122
- - [agent-protocol](openspec/specs/agent-protocol/spec.md): the brief, the API, deduplication, sealing, no-op and acceptance checks, blocking and resume, fallback, fencing, MCP façade, brief validation
123
- - [integration-pipeline](openspec/specs/integration-pipeline/spec.md): worktrees, the verifier, publication, conflicts, foreign commits, milestone tags
124
- - [crash-recovery](openspec/specs/crash-recovery/spec.md): durable records, recovery per boundary, adoption, fencing, sweeps, crash points, invariants, store transactions
125
- - [operator-control](openspec/specs/operator-control/spec.md): operator routes shared by the CLI and the MCP server, status, run directories, daemon lifecycle, event stream, review bundle, graph import, pause and resume, shutdown, logs
126
- - [operator-mcp](openspec/specs/operator-mcp/spec.md): the operator MCP server a host session drives: tool set, wait, start, review
127
- - [graph-import](openspec/specs/graph-import/spec.md): normalized issue records, mapping rules, acceptance criteria and scope extraction, priority normalisation, import outcome
128
- - [host-integration](openspec/specs/host-integration/spec.md): package entrypoints, per-host wrappers, skills, no native dependencies, quiet SQLite binding
140
+ - [agent-protocol](openspec/specs/agent-protocol/spec.md): the brief, the API, deduplication, sealing, no-op and acceptance checks, blocking and resume, fallback, fencing, MCP façade, brief validation, the check command and tool rules in the brief, the isolated agent environment
141
+ - [integration-pipeline](openspec/specs/integration-pipeline/spec.md): worktrees, the verifier and the hold while no check command is configured, publication, conflicts, foreign commits, milestone tags, the check environment
142
+ - [crash-recovery](openspec/specs/crash-recovery/spec.md): durable records, recovery per boundary, adoption, fencing, sweeps, crash points, invariants, store transactions, idle exit and revival including container mode
143
+ - [operator-control](openspec/specs/operator-control/spec.md): operator routes shared by the CLI and the MCP server, status, run directories, daemon lifecycle, idle exit, exit record and revival, session attachments, the configuration route and start arguments, event stream, review bundle, graph import, pause and resume, shutdown, logs, container mode (signalled shutdown, JSON logs, remote URL), attributed shutdown
144
+ - [operator-mcp](openspec/specs/operator-mcp/spec.md): the operator MCP server a host session drives: tool set, wait, start with configuration arguments, configure, review
145
+ - [graph-import](openspec/specs/graph-import/spec.md): normalized issue records from Linear, Jira, or GitHub, mapping rules including the `model:` and `effort:` selector labels, acceptance criteria and scope extraction, priority normalisation, import outcome
146
+ - [host-integration](openspec/specs/host-integration/spec.md): package entrypoints, per-host wrappers, the plugin launcher and session hooks, skills and how they report the toolchain and resolve `needsConfig`, no native dependencies, quiet SQLite binding, the import and run skills' Linear, Jira, and GitHub branches
129
147
  - [tracker-sync](openspec/specs/tracker-sync/spec.md): the durable outbox of tracker effects, effect kinds and marker, mirroring policy, done semantics, the drainer contract
130
148
  - [health-monitoring](openspec/specs/health-monitoring/spec.md): process liveness, progress signals, stuck detection and escalation, the diagnosis hook, launch and run budgets, usage accounting, the base-moved notice
131
- - [pull-runner](openspec/specs/pull-runner/spec.md): runner modes and the claim window, claim and release, worker identity and idempotent re-claim, access modes with remote reserved
149
+ - [pull-runner](openspec/specs/pull-runner/spec.md): runner modes and the claim window, claim and release with keep (the claim carrying the launch's model and effort), session attachments, worker identity and idempotent re-claim, access modes with remote reserved
132
150
  - [scheduling-policy](openspec/specs/scheduling-policy/spec.md): the admission ordering chain and its stages, declared scopes, the overlap rule, the scope filter at admission
151
+ - [toolchain-discovery](openspec/specs/toolchain-discovery/spec.md): resolution order and provenance, toolchain detection and the package manager, integration branch detection and pinning, derived allowed tools, runner command composition with the allow-list, model, and effort slots, the resolved configuration record, runtime overrides and start-only keys
152
+ - [cluster-runtime](openspec/specs/cluster-runtime/spec.md): bind host and advertised URL, health probes, the daemon image, the reference kustomize manifests and kind overlay, the read-only mounted graph, the smoke test
153
+ - [model-selection](openspec/specs/model-selection/spec.md): the run default worker model and effort with provenance, per-task selectors and their validation, resolution fixed at preparation, delivery to spawned agents and claimed workers, visibility to operators
133
154
  - Archived change `add-orchestrator-v1` (the v1 runtime): [Proposal](openspec/changes/archive/2026-10-12-add-orchestrator-v1/proposal.md), [Design](openspec/changes/archive/2026-10-12-add-orchestrator-v1/design.md), [Tasks](openspec/changes/archive/2026-10-12-add-orchestrator-v1/tasks.md)
134
155
  - Archived change `add-session-operator` (operate from a Claude Code session): [Proposal](openspec/changes/archive/2026-10-12-add-session-operator/proposal.md), [Design](openspec/changes/archive/2026-10-12-add-session-operator/design.md), [Tasks](openspec/changes/archive/2026-10-12-add-session-operator/tasks.md)
135
156
  - Archived change `add-tracker-sync` (mirror the run to the tracker): [Proposal](openspec/changes/archive/2026-10-12-add-tracker-sync/proposal.md), [Design](openspec/changes/archive/2026-10-12-add-tracker-sync/design.md), [Tasks](openspec/changes/archive/2026-10-12-add-tracker-sync/tasks.md)
@@ -138,8 +159,14 @@ Current specs in `openspec/specs/`, synced from the archived changes `add-orches
138
159
  - Archived change `add-pull-runner` (workers claim launches; the work skill and workflow): [Proposal](openspec/changes/archive/2026-10-13-add-pull-runner/proposal.md), [Design](openspec/changes/archive/2026-10-13-add-pull-runner/design.md), [Tasks](openspec/changes/archive/2026-10-13-add-pull-runner/tasks.md)
139
160
  - Archived change `add-scheduling-policy` (ordering chain, scopes, deferrals): [Proposal](openspec/changes/archive/2026-10-13-add-scheduling-policy/proposal.md), [Design](openspec/changes/archive/2026-10-13-add-scheduling-policy/design.md), [Tasks](openspec/changes/archive/2026-10-13-add-scheduling-policy/tasks.md)
140
161
  - Archived change `replace-sqlite-driver` (Node's built-in SQLite, no native dependency): [Proposal](openspec/changes/archive/2026-10-13-replace-sqlite-driver/proposal.md), [Design](openspec/changes/archive/2026-10-13-replace-sqlite-driver/design.md), [Tasks](openspec/changes/archive/2026-10-13-replace-sqlite-driver/tasks.md)
162
+ - Archived change `add-daemon-lifecycle` (visible session subagents by default, idle exit and revival, session attachments, kept release, self-contained plugin, hooks): [Proposal](openspec/changes/archive/2026-10-13-add-daemon-lifecycle/proposal.md), [Design](openspec/changes/archive/2026-10-13-add-daemon-lifecycle/design.md), [Tasks](openspec/changes/archive/2026-10-13-add-daemon-lifecycle/tasks.md)
163
+ - Archived change `add-toolchain-discovery` (the check command, integration branch, and spawned agents' allowed tools detected from the repository with provenance, durable overrides through `configure` and `--set`, no `orchestrator.yaml` required): [Proposal](openspec/changes/archive/2026-10-13-add-toolchain-discovery/proposal.md), [Design](openspec/changes/archive/2026-10-13-add-toolchain-discovery/design.md), [Tasks](openspec/changes/archive/2026-10-13-add-toolchain-discovery/tasks.md)
164
+
165
+ - Archived change `add-model-selection` (workers run `claude-opus-5-5` at `medium` by default; a task names its own model or effort by payload or by `model:`/`effort:` labels; the choice is fixed per launch and carried to spawned agents and session workers): [Proposal](openspec/changes/archive/2026-10-17-add-model-selection/proposal.md), [Design](openspec/changes/archive/2026-10-17-add-model-selection/design.md), [Tasks](openspec/changes/archive/2026-10-17-add-model-selection/tasks.md)
141
166
 
142
- Active changes, planned 2026-10-13 from the first end-to-end walkthrough, in apply order:
167
+ - Archived change `harden-daemon-boundaries` (spawned agents and check commands get an isolated `ORCH_HOME` and lose the client-side daemon variables; the shutdown route records its caller in the event log and the exit record): [Proposal](openspec/changes/archive/2026-10-17-harden-daemon-boundaries/proposal.md), [Design](openspec/changes/archive/2026-10-17-harden-daemon-boundaries/design.md), [Tasks](openspec/changes/archive/2026-10-17-harden-daemon-boundaries/tasks.md)
168
+ - Archived change `fix-tracker-mapping-gaps` (a cancelled child is a satisfied external node; closing a GitHub issue removes the in-progress label): [Proposal](openspec/changes/archive/2026-10-17-fix-tracker-mapping-gaps/proposal.md), [Design](openspec/changes/archive/2026-10-17-fix-tracker-mapping-gaps/design.md), [Tasks](openspec/changes/archive/2026-10-17-fix-tracker-mapping-gaps/tasks.md)
169
+ - Archived change `add-github-tracker` (GitHub Issues as a tracker: sub-issues and `blockedBy` dependencies at import, `stateReason` mapping, an optional in-progress label, closing with reasons and sub-issue proposals at sync, all through the session's `gh`): [Proposal](openspec/changes/archive/2026-10-17-add-github-tracker/proposal.md), [Design](openspec/changes/archive/2026-10-17-add-github-tracker/design.md), [Tasks](openspec/changes/archive/2026-10-17-add-github-tracker/tasks.md)
170
+ - Archived change `add-cluster-runtime` (the specification for milestone M1 of the cloud-native project, written after an unattended orchestrator run landed the daemon image, kustomize manifests, kind overlay, smoke script, health probes, bind host and advertised URL, and container-mode lifecycle): [Proposal](openspec/changes/archive/2026-10-17-add-cluster-runtime/proposal.md), [Design](openspec/changes/archive/2026-10-17-add-cluster-runtime/design.md), [Tasks](openspec/changes/archive/2026-10-17-add-cluster-runtime/tasks.md)
143
171
 
144
- 1. `add-daemon-lifecycle`: visible session subagents as the plugin's default, a daemon that exits when idle and revives on demand, session attachments with a kept release, a self-contained plugin launcher, session hooks. [Proposal](openspec/changes/add-daemon-lifecycle/proposal.md), [Design](openspec/changes/add-daemon-lifecycle/design.md), [Tasks](openspec/changes/add-daemon-lifecycle/tasks.md)
145
- 2. `add-toolchain-discovery`: the check command, integration branch, and spawned agents' allowed tools detected from the repository with provenance, runtime overrides through a `configure` tool, no `orchestrator.yaml` required. [Proposal](openspec/changes/add-toolchain-discovery/proposal.md), [Design](openspec/changes/add-toolchain-discovery/design.md), [Tasks](openspec/changes/add-toolchain-discovery/tasks.md)
172
+ No change is active. The next planned piece of work, not yet proposed, is the usage and log loss when a launch is reaped on report, and a re-import rule for tasks the run has already finished (see the GitHub tracker test notes in the archive).
@@ -42,7 +42,7 @@ export const TOOL_NAMES = ['heartbeat', 'report', 'block', 'inbox', 'log'];
42
42
  export async function startShim(env) {
43
43
  const { McpServer } = await import('@modelcontextprotocol/sdk/server/mcp.js');
44
44
  const { StdioServerTransport } = await import('@modelcontextprotocol/sdk/server/stdio.js');
45
- const server = new McpServer({ name: 'orchestrator-agent-api', version: '0.1.0' });
45
+ const server = new McpServer({ name: 'orchestrator-agent-api', version: '0.3.0' });
46
46
  const text = (r) => ({
47
47
  content: [{ type: 'text', text: JSON.stringify({ status: r.status, ...(typeof r.body === 'object' && r.body ? r.body : { body: r.body }) }) }],
48
48
  isError: r.status >= 400,
@@ -2,6 +2,7 @@
2
2
  * Loopback HTTP server for agents and operators.
3
3
  * POST /v1/launches/:id/{heartbeat,report,block,log}
4
4
  * GET /v1/launches/:id/inbox
5
+ * Health probes (/healthz, /readyz) and operator routes are registered by operator/routes.ts.
5
6
  * Operator routes are registered by operator/routes.ts.
6
7
  */
7
8
  import http from 'node:http';
@@ -25,23 +26,27 @@ export class ApiServer {
25
26
  addRoute(method, pattern, handler) {
26
27
  this.routes.push({ method, pattern, handler });
27
28
  }
28
- async listen(port = 0) {
29
+ /** Binds to `bind` and returns the advertised URL: `baseUrl` when set, else `http://<bind>:<port>`. */
30
+ async listen(port = 0, opts = {}) {
31
+ const bind = opts.bind ?? '127.0.0.1';
29
32
  await new Promise((resolve, reject) => {
30
33
  const onError = (err) => reject(err);
31
34
  this.server.once('error', onError);
32
- this.server.listen(port, '127.0.0.1', () => {
35
+ this.server.listen(port, bind, () => {
33
36
  this.server.off('error', onError);
34
37
  resolve();
35
38
  });
36
39
  });
37
40
  this.port = this.server.address().port;
38
- const url = `http://127.0.0.1:${this.port}`;
41
+ const url = opts.baseUrl ? opts.baseUrl.replace(/\/+$/, '') : `http://${bind.includes(':') ? `[${bind}]` : bind}:${this.port}`;
39
42
  this.orch.apiBaseUrl = url;
40
43
  return url;
41
44
  }
42
45
  async close() {
43
- await new Promise((resolve) => this.server.close(() => resolve()));
46
+ // Close open connections (a long-polling block or inbox) before waiting, or the close callback waits for them.
47
+ const closed = new Promise((resolve) => this.server.close(() => resolve()));
44
48
  this.server.closeAllConnections();
49
+ await closed;
45
50
  }
46
51
  async dispatch(req, res) {
47
52
  const url = new URL(req.url ?? '/', 'http://127.0.0.1');
@@ -51,8 +56,8 @@ export class ApiServer {
51
56
  const m = r.pattern.exec(url.pathname);
52
57
  if (!m)
53
58
  continue;
54
- // A probe is a liveness check that must not count as activity. See specs/operator-control "Idle exit".
55
- const probe = req.method === 'GET' && url.pathname === '/v1/status' && url.searchParams.get('probe') === '1';
59
+ // A probe is a liveness check that must not count as activity. See specs/operator-control "Idle exit" and specs/cluster-runtime "Probes".
60
+ const probe = req.method === 'GET' && ((url.pathname === '/v1/status' && url.searchParams.get('probe') === '1') || url.pathname === '/healthz' || url.pathname === '/readyz');
56
61
  const attachment = req.headers['x-orch-attachment'];
57
62
  const attachmentId = typeof attachment === 'string' && attachment ? attachment : undefined;
58
63
  this.orch.requestBegan();
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../../../src/agent/server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AAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AAC1D,CAAC;AAED,SAAS,IAAI,CAAC,GAAwB,EAAE,MAAc,EAAE,IAAa,EAAE,UAAkC,EAAE;IACzG,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;IACxC,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrH,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC;AAED,KAAK,UAAU,QAAQ,CAAC,GAAyB;IAC/C,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,IAAI,KAAK,EAAE,MAAM,CAAC,IAAI,GAAG;QAAE,MAAM,CAAC,IAAI,CAAC,CAAW,CAAC,CAAC;IACpD,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACpD,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,CAAC;IAC5B,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAY,CAAC;IAC3C,OAAO,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAE,MAAkC,CAAC,CAAC,CAAC,EAAE,CAAC;AACzF,CAAC"}
@@ -20,6 +20,7 @@ export function composeBrief(input, opts) {
20
20
  graphRev: launch.graphRev,
21
21
  integrationBranch: input.integrationBranch,
22
22
  checkCommand: input.checkCommand,
23
+ allowedTools: input.allowedTools,
23
24
  retryWindowMs: input.retryWindowMs,
24
25
  fallbackPath: opts.fallbackPath,
25
26
  attempt: launch.attempt,
@@ -47,9 +48,15 @@ export function composeBrief(input, opts) {
47
48
  else
48
49
  lines.push('- (none declared)');
49
50
  lines.push('', '## Definition of done', '');
50
- lines.push(`- Commit all work on branch \`${launch.branch}\` in this worktree. Uncommitted or untracked files make your submission be rejected with 409 and the file list; commit and resubmit.`, `- Never merge into, push to, or check out \`${input.integrationBranch}\`. You may rebase your launch branch onto it when a baseMoved notice says it advanced; the orchestrator integrates your branch after verification.`, `- Run the check command before submitting: \`${input.checkCommand}\`.`, '- If the task needs no changes, say so explicitly with `noChanges: { justification }` in your report.', '- Your report must give evidence for every acceptance criterion above: one `acceptance` entry per criterion, whose `criterion` quotes the criterion text (markdown and case do not matter) or gives its number.', '- Terminate as soon as your report is accepted.', '');
51
+ lines.push(`- Commit all work on branch \`${launch.branch}\` in this worktree. Uncommitted or untracked files make your submission be rejected with 409 and the file list; commit and resubmit.`, `- Never merge into, push to, or check out \`${input.integrationBranch}\`. You may rebase your launch branch onto it when a baseMoved notice says it advanced; the orchestrator integrates your branch after verification.`, input.checkCommand
52
+ ? `- Run the check command before submitting: \`${input.checkCommand}\`.`
53
+ : '- No check command is configured for this repository yet; the operator is being asked. Run the project\'s documented test suite before submitting.', '- If the task needs no changes, say so explicitly with `noChanges: { justification }` in your report.', '- Your report must give evidence for every acceptance criterion above: one `acceptance` entry per criterion, whose `criterion` quotes the criterion text (markdown and case do not matter) or gives its number.', '- Terminate as soon as your report is accepted.', '');
51
54
  lines.push('## Workspace', '');
52
55
  lines.push(`- Worktree: \`${launch.worktree}\``, `- Branch: \`${launch.branch}\``, `- Base commit: \`${launch.baseSha}\``, `- Integration branch: \`${input.integrationBranch}\``);
56
+ if (input.allowedTools?.length) {
57
+ const bash = input.allowedTools.filter((r) => r.startsWith('Bash('));
58
+ lines.push(`- If the orchestrator spawned you, these Bash rules are in force: ${bash.map((r) => `\`${r}\``).join(', ')}. A worker holding a claimed launch runs under its own permissions instead.`, '- Run commands from the worktree root without `cd`: every part of a compound command must match a rule on its own. When you need a command these rules do not cover, ask with a `needsAccess` question naming the command rather than retrying it.');
59
+ }
53
60
  lines.push('- Notices may arrive in your inbox (the `inbox` operation): `stuck` when no progress has been observed for a while, `nudge` with a message from the operator, `baseMoved` with the new integration `head` and the `files` that changed, and `payloadChanged` when your task\'s description was edited (re-read the brief file). Check the inbox after long steps.', '');
54
61
  lines.push('## Dependencies', '');
55
62
  if (!input.depReports.length)
@@ -1 +1 @@
1
- {"version":3,"file":"compose.js","sourceRoot":"","sources":["../../../src/brief/compose.ts"],"names":[],"mappings":"AA+BA,MAAM,UAAU,oBAAoB,CAAC,OAAgC;IACnE,MAAM,GAAG,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC1C,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QAAE,OAAO,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC/C,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,IAAI,EAAE;QAAE,OAAO,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC/H,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,KAAiB,EAAE,IAAoB;IAClE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IAC/B,MAAM,QAAQ,GAAG,oBAAoB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACpD,MAAM,IAAI,GAAc;QACtB,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,MAAM,EAAE,IAAI,CAAC,EAAE;QACf,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,QAAQ,EAA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,CAAC;AAC9C,CAAC"}
@@ -2,6 +2,9 @@
2
2
  * Orchestrator configuration with defaults. Loaded from a YAML/JSON file by main.ts.
3
3
  */
4
4
  import { z } from 'zod';
5
+ import { DEFAULT_CLAUDE_COMMAND } from './runner/command.js';
6
+ import { DEFAULT_EFFORT, DEFAULT_MODEL, effortSchema, modelSchema } from './runner/selection.js';
7
+ import { isSafeRule } from './toolchain/tools.js';
5
8
  /** Admission ordering stages. See specs/scheduling-policy "Ordering chain". */
6
9
  export const stageNames = ['criticalPath', 'priority', 'fifo'];
7
10
  export const configSchema = z.object({
@@ -21,14 +24,19 @@ export const configSchema = z.object({
21
24
  maxAttempts: z.number().int().positive().default(2),
22
25
  integrationRetries: z.number().int().nonnegative().default(3),
23
26
  tickIntervalMs: z.number().int().positive().default(5_000),
24
- checkCommand: z.string().default('npm test'),
27
+ /** Run on every rebased submission. Detected from the repository when the file does not set it; unresolved holds verification. See specs/toolchain-discovery. */
28
+ checkCommand: z.string().min(1).optional(),
25
29
  checkTimeoutMs: z.number().int().positive().default(15 * 60_000),
26
30
  /** Loopback API port; 0 picks a free port. */
27
31
  apiPort: z.number().int().nonnegative().default(0),
32
+ /** Address the API binds to; `0.0.0.0` in a cluster. See specs/cluster-runtime. */
33
+ apiBind: z.string().min(1).default('127.0.0.1'),
34
+ /** The URL the daemon advertises (kv, daemon.json, briefs, claims) instead of `http://<apiBind>:<port>`. */
35
+ apiBaseUrl: z.string().url().optional(),
28
36
  /** Agent retry window before falling back to the report file. */
29
37
  retryWindowMs: z.number().int().positive().default(120_000),
30
- /** Runner command template; {brief}, {worktree}, {launchId}, {mcpConfig} are substituted. */
31
- runnerCommand: z.string().default('claude -p --output-format json --mcp-config {mcpConfig} --strict-mcp-config --permission-mode acceptEdits --allowedTools "Bash(git:*)" "mcp__orchestrator__heartbeat" "mcp__orchestrator__report" "mcp__orchestrator__block" "mcp__orchestrator__inbox" "mcp__orchestrator__log" --no-session-persistence < {brief}'),
38
+ /** Runner command template; {brief}, {worktree}, {launchId}, {mcpConfig}, and {allowedTools} are substituted at every spawn. */
39
+ runnerCommand: z.string().default(DEFAULT_CLAUDE_COMMAND),
32
40
  validateAt: z.enum(['ready', 'ingest']).default('ready'),
33
41
  onInsufficient: z.enum(['block', 'remediate']).default('block'),
34
42
  remediateMode: z.enum(['review', 'auto']).default('review'),
@@ -39,6 +47,18 @@ export const configSchema = z.object({
39
47
  /** spawn: the daemon spawns a process; pull: launches wait for a worker; mixed: parked for claimWindowMs, then spawned. */
40
48
  mode: z.enum(['spawn', 'pull', 'mixed']).default('spawn'),
41
49
  claimWindowMs: z.number().int().nonnegative().default(60_000),
50
+ /** The allow list of spawned Claude Code agents. See specs/toolchain-discovery "Derived allowed tools". */
51
+ claude: z
52
+ .object({
53
+ /** Rules appended to the derived list, in the documented prefix form such as `Bash(docker:*)`. */
54
+ allowedTools: z.array(z.string().refine(isSafeRule, { message: 'a rule must not contain a double quote, backslash, dollar sign, or backtick' })).default([]),
55
+ /** Derive rules from the toolchains found in the repository root. */
56
+ deriveTools: z.boolean().default(true),
57
+ /** The worker model and effort for launches prepared under this run. See specs/model-selection. */
58
+ model: modelSchema.default(DEFAULT_MODEL),
59
+ effort: effortSchema.default(DEFAULT_EFFORT),
60
+ })
61
+ .default({}),
42
62
  })
43
63
  .default({}),
44
64
  /** Graph reload behaviour. See specs/agent-protocol "Payload change notice". */
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,+EAA+E;AAC/E,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,cAAc,EAAE,UAAU,EAAE,MAAM,CAAU,CAAC;AAGxE,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,uEAAuE;IACvE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,GAAG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,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;AAC3G,CAAC"}
@@ -5,6 +5,7 @@ import { createHash } from 'node:crypto';
5
5
  import { readFile } from 'node:fs/promises';
6
6
  import { parse as parseYaml } from 'yaml';
7
7
  import { z } from 'zod';
8
+ import { effortSchema, modelSchema } from '../runner/selection.js';
8
9
  import { makeGraph } from './model.js';
9
10
  export class GraphValidationError extends Error {
10
11
  code;
@@ -25,6 +26,9 @@ const nodeSchema = z
25
26
  deps: z.array(z.string().min(1)).default([]),
26
27
  /** Path globs the task's work stays within; stays in the payload. See specs/scheduling-policy "Scope declaration". */
27
28
  scope: z.array(z.string().min(1)).optional(),
29
+ /** The worker model and effort for this task's launches; stay in the payload. See specs/model-selection "Task selectors". */
30
+ model: modelSchema.optional(),
31
+ effort: effortSchema.optional(),
28
32
  })
29
33
  .passthrough();
30
34
  const fileSchema = z.object({ nodes: z.array(nodeSchema) });
@@ -1 +1 @@
1
- {"version":3,"file":"load.js","sourceRoot":"","sources":["../../../src/graph/load.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAuC,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5E,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAG3B;IAOA;IATlB,YACE,OAAe,EACC,IAML,EACK,UAAmC,EAAE;QAErD,KAAK,CAAC,OAAO,CAAC,CAAC;QATC,SAAI,GAAJ,IAAI,CAMT;QACK,YAAO,GAAP,OAAO,CAA8B;QAGrD,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF;AAED,MAAM,UAAU,GAAG,CAAC;KACjB,MAAM,CAAC;IACN,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
  import { GraphValidationError, parseGraph } from '../graph/load.js';
8
+ import { isEffort, isModelName } from '../runner/selection.js';
8
9
  export const issueStateSchema = z.enum(['open', 'inProgress', 'done', 'cancelled']);
9
10
  export const issueRecordSchema = z.object({
10
11
  id: z.string().min(1),
@@ -25,10 +26,15 @@ export const importOptionsSchema = z.object({
25
26
  gated: z.boolean().default(true),
26
27
  });
27
28
  /** The tracker an import came from; recorded by the daemon so effects can be derived. See specs/graph-import "Tracker record". */
28
- export const trackerSchema = z.object({
29
- kind: z.enum(['linear', 'atlassian']),
29
+ export const trackerSchema = z
30
+ .object({
31
+ kind: z.enum(['linear', 'atlassian', 'github']),
32
+ /** Linear workspace key, Jira site, or GitHub repository as `owner/repo`. */
30
33
  workspace: z.string().min(1).optional(),
31
- });
34
+ /** GitHub only: the label that stands for the in-progress state, read at import and applied at sync. */
35
+ inProgressLabel: z.string().min(1).optional(),
36
+ })
37
+ .refine((t) => t.inProgressLabel === undefined || t.kind === 'github', { message: 'inProgressLabel applies to kind github only', path: ['inProgressLabel'] });
32
38
  export const importInputSchema = z.object({
33
39
  root: z.string().min(1),
34
40
  issues: z.array(issueRecordSchema),
@@ -36,6 +42,22 @@ export const importInputSchema = z.object({
36
42
  /** Passed through to the daemon's import route; the mapping ignores it. */
37
43
  tracker: trackerSchema.optional(),
38
44
  });
45
+ /** Selector labels: a case-insensitive `model:` or `effort:` prefix sets the payload key when the value has the right shape. */
46
+ function selectorsOf(i, ignored) {
47
+ const out = {};
48
+ for (const label of i.labels ?? []) {
49
+ const m = /^(model|effort):(.*)$/i.exec(label);
50
+ if (!m)
51
+ continue;
52
+ const key = m[1].toLowerCase();
53
+ const value = m[2].trim();
54
+ if (key === 'model' ? isModelName(value) : isEffort(value))
55
+ out[key] = value;
56
+ else
57
+ ignored.push({ id: i.id, label });
58
+ }
59
+ return out;
60
+ }
39
61
  export class ImportError extends Error {
40
62
  details;
41
63
  constructor(message, details = undefined) {
@@ -104,7 +126,7 @@ export function mapIssues(raw) {
104
126
  throw new ImportError(`root ${root} has no children (records with parent: ${root})`);
105
127
  const childIds = new Set(children.map((c) => c.id));
106
128
  const nodes = [];
107
- const summary = { tasks: 0, external: 0, milestones: 0, missingCriteria: [], unknownExternal: [], inProgressAsExternal: [] };
129
+ const summary = { tasks: 0, external: 0, milestones: 0, missingCriteria: [], unknownExternal: [], inProgressAsExternal: [], ignoredLabels: [] };
108
130
  const externalIds = new Set();
109
131
  const payloadOf = (i) => {
110
132
  const { description, acceptanceCriteria, scope } = splitDescription(i.description, options.criteriaHeading, options.scopeHeading);
@@ -114,6 +136,7 @@ export function mapIssues(raw) {
114
136
  acceptanceCriteria,
115
137
  ...(scope ? { scope } : {}),
116
138
  ...(i.labels ? { labels: i.labels } : {}),
139
+ ...selectorsOf(i, summary.ignoredLabels),
117
140
  // Linear's 0 means no priority; every other value passes through unchanged. See specs/graph-import "Priority normalisation".
118
141
  ...(i.priority !== undefined && i.priority !== 0 ? { priority: i.priority } : {}),
119
142
  ...(i.url ? { url: i.url } : {}),
@@ -130,7 +153,8 @@ export function mapIssues(raw) {
130
153
  nodes.push({ id, kind: 'external', done: false, deps: [], title: id, trackerState: 'unknown', unknown: true });
131
154
  }
132
155
  else {
133
- nodes.push({ id, kind: 'external', done: rec.state === 'done', deps: [], ...payloadOf(rec), externalCause: cause });
156
+ // Done and cancelled both mean nothing more will happen: neither holds a milestone or a dependant. See specs/graph-import "Mapping rules".
157
+ nodes.push({ id, kind: 'external', done: rec.state === 'done' || rec.state === 'cancelled', deps: [], ...payloadOf(rec), externalCause: cause });
134
158
  }
135
159
  summary.external++;
136
160
  };