@revisium/orchestrator 0.1.0-alpha.9 → 0.1.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 (103) hide show
  1. package/README.md +143 -157
  2. package/control-plane/default-playbook/catalog/pipelines.json +217 -8
  3. package/control-plane/default-playbook/package.json +1 -1
  4. package/control-plane/default-playbook/prompts/developer.md +1 -0
  5. package/control-plane/default-playbook/prompts/triager.md +3 -0
  6. package/dist/api/graphql-api/graphql-ws/subscription-mappers.js +3 -0
  7. package/dist/api/graphql-api/graphql-ws/subscription-mappers.js.map +1 -1
  8. package/dist/api/graphql-api/pr/inputs/pr-readiness.input.js +6 -0
  9. package/dist/api/graphql-api/pr/inputs/pr-readiness.input.js.map +1 -1
  10. package/dist/api/graphql-api/pr/model/pr-readiness.model.js +30 -0
  11. package/dist/api/graphql-api/pr/model/pr-readiness.model.js.map +1 -1
  12. package/dist/api/graphql-api/runs/inputs/create-run.input.js +6 -0
  13. package/dist/api/graphql-api/runs/inputs/create-run.input.js.map +1 -1
  14. package/dist/api/graphql-api/runs/model/run.model.js +6 -0
  15. package/dist/api/graphql-api/runs/model/run.model.js.map +1 -1
  16. package/dist/api/graphql-api/share/model/issue-ref.model.js +53 -0
  17. package/dist/api/graphql-api/share/model/issue-ref.model.js.map +1 -0
  18. package/dist/control-plane/bootstrap.js +14 -1
  19. package/dist/control-plane/bootstrap.js.map +1 -1
  20. package/dist/control-plane/client-transport.js +1 -1
  21. package/dist/control-plane/client-transport.js.map +1 -1
  22. package/dist/control-plane/default-playbook-policy.js +593 -0
  23. package/dist/control-plane/default-playbook-policy.js.map +1 -0
  24. package/dist/control-plane/seed-default-playbook.js +77 -8
  25. package/dist/control-plane/seed-default-playbook.js.map +1 -1
  26. package/dist/e2e/kit/agents.js +15 -21
  27. package/dist/e2e/kit/agents.js.map +1 -1
  28. package/dist/e2e/kit/assertions.js +12 -8
  29. package/dist/e2e/kit/assertions.js.map +1 -1
  30. package/dist/e2e/kit/fake-integrator.js +11 -2
  31. package/dist/e2e/kit/fake-integrator.js.map +1 -1
  32. package/dist/e2e/kit/git-target-repo.js +1 -1
  33. package/dist/engine/dbos.service.js +3 -0
  34. package/dist/engine/dbos.service.js.map +1 -1
  35. package/dist/features/pr/queries/impl/get-pr-readiness.query.js.map +1 -1
  36. package/dist/features/runs/commands/impl/create-run.command.js.map +1 -1
  37. package/dist/features/runs/queries/handlers/runs-query.handlers.js +1 -0
  38. package/dist/features/runs/queries/handlers/runs-query.handlers.js.map +1 -1
  39. package/dist/mcp/mcp-capabilities.js +14 -1
  40. package/dist/mcp/mcp-capabilities.js.map +1 -1
  41. package/dist/mcp/mcp-facade.service.js +306 -11
  42. package/dist/mcp/mcp-facade.service.js.map +1 -1
  43. package/dist/mcp/mcp-tools.js +41 -14
  44. package/dist/mcp/mcp-tools.js.map +1 -1
  45. package/dist/observability/activity-signal.js +107 -0
  46. package/dist/observability/activity-signal.js.map +1 -0
  47. package/dist/observability/index.js +1 -0
  48. package/dist/observability/index.js.map +1 -1
  49. package/dist/pipeline/data-driven-task.workflow.js +482 -40
  50. package/dist/pipeline/data-driven-task.workflow.js.map +1 -1
  51. package/dist/pipeline/pipeline.service.js +195 -101
  52. package/dist/pipeline/pipeline.service.js.map +1 -1
  53. package/dist/pipeline/route-contract.js +4 -3
  54. package/dist/pipeline/route-contract.js.map +1 -1
  55. package/dist/pipeline-core/kit/fixtures.js +72 -21
  56. package/dist/pipeline-core/kit/fixtures.js.map +1 -1
  57. package/dist/playbook/import-mapper.js +8 -1
  58. package/dist/playbook/import-mapper.js.map +1 -1
  59. package/dist/poller/pr-readiness-core.js +299 -28
  60. package/dist/poller/pr-readiness-core.js.map +1 -1
  61. package/dist/revisium/playbooks.service.js +17 -2
  62. package/dist/revisium/playbooks.service.js.map +1 -1
  63. package/dist/revisium/run.service.js +1 -0
  64. package/dist/revisium/run.service.js.map +1 -1
  65. package/dist/run/append-event.js +8 -5
  66. package/dist/run/append-event.js.map +1 -1
  67. package/dist/run/create-run.js +5 -1
  68. package/dist/run/create-run.js.map +1 -1
  69. package/dist/run/inspect-run.js +10 -3
  70. package/dist/run/inspect-run.js.map +1 -1
  71. package/dist/run/issue-ref.js +88 -0
  72. package/dist/run/issue-ref.js.map +1 -0
  73. package/dist/runners/claude-code.service.js +2 -2
  74. package/dist/runners/claude-code.service.js.map +1 -1
  75. package/dist/runners/codex.service.js +2 -2
  76. package/dist/runners/codex.service.js.map +1 -1
  77. package/dist/runners/integrator-branch-naming.js +13 -8
  78. package/dist/runners/integrator-branch-naming.js.map +1 -1
  79. package/dist/runners/integrator.js +254 -89
  80. package/dist/runners/integrator.js.map +1 -1
  81. package/dist/runners/worktree.service.js +2 -2
  82. package/dist/runners/worktree.service.js.map +1 -1
  83. package/dist/task-control-plane/pr-readiness.service.js +15 -13
  84. package/dist/task-control-plane/pr-readiness.service.js.map +1 -1
  85. package/dist/task-control-plane/run-watch.service.js +234 -3
  86. package/dist/task-control-plane/run-watch.service.js.map +1 -1
  87. package/dist/task-control-plane/task-control-plane-api.service.js +272 -25
  88. package/dist/task-control-plane/task-control-plane-api.service.js.map +1 -1
  89. package/dist/worker/artifact-store.js +21 -3
  90. package/dist/worker/artifact-store.js.map +1 -1
  91. package/dist/worker/build-context.js +19 -3
  92. package/dist/worker/build-context.js.map +1 -1
  93. package/dist/worker/claude-code-runner.js +76 -15
  94. package/dist/worker/claude-code-runner.js.map +1 -1
  95. package/dist/worker/codex-runner.js +40 -13
  96. package/dist/worker/codex-runner.js.map +1 -1
  97. package/dist/worker/process-executor.js +149 -20
  98. package/dist/worker/process-executor.js.map +1 -1
  99. package/dist/worker/runner-common.js +29 -0
  100. package/dist/worker/runner-common.js.map +1 -1
  101. package/dist/worker/runner.js +16 -1
  102. package/dist/worker/runner.js.map +1 -1
  103. package/package.json +1 -1
package/README.md CHANGED
@@ -1,202 +1,188 @@
1
- # agent-orchestrator
1
+ <div align="center">
2
2
 
3
- Local orchestrator for software-development tasks driven by short-lived AI agents (architect → developer →
4
- reviewer → integrator), hosted in **NestJS**. **DBOS** owns durable progress — execution is crash-safe and resumes
5
- from the first unfinished step — while **Revisium** owns meaning: roles, policy, inbox, events. Workflow-as-data is
6
- a post-MVP goal; see [`docs/architecture-overview.md`](./docs/architecture-overview.md).
3
+ # @revisium/orchestrator
7
4
 
8
- > 🚧 **Early alpha.** The end-to-end MVP works create a run → plan gate → implement → review → PR → merge
9
- > gate — see [`docs/roadmap.md`](./docs/roadmap.md).
5
+ Local-first orchestration for software-development work driven by short-lived agents.
10
6
 
11
- ## Start here
7
+ **Turn a task into a playbook-driven state machine.**
12
8
 
13
- - Repo context for agents: [`AGENTS.md`](./AGENTS.md)
14
- - Vision: [`docs/vision.md`](./docs/vision.md)
15
- - Architecture & invariants: [`docs/architecture-overview.md`](./docs/architecture-overview.md)
16
- - Docs index & roadmap: [`docs/README.md`](./docs/README.md) · [`docs/roadmap.md`](./docs/roadmap.md)
9
+ [![License](https://img.shields.io/github/license/revisium/orchestrator?color=blue)](LICENSE)
10
+ [![CI](https://github.com/revisium/orchestrator/actions/workflows/ci.yml/badge.svg)](https://github.com/revisium/orchestrator/actions/workflows/ci.yml)
11
+ [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=revisium_agent-orchestrator&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=revisium_agent-orchestrator)
12
+ [![npm](https://img.shields.io/npm/v/@revisium/orchestrator?color=red)](https://www.npmjs.com/package/@revisium/orchestrator)
17
13
 
18
- ## Local Development
14
+ Part of the [Revisium](https://github.com/revisium/revisium) ecosystem.
19
15
 
20
- `revo` is one daemonized product. **`revo start`** brings up the whole stack — the standalone
21
- Revisium daemon plus the Revo host daemon that owns DBOS and serves the GraphQL + MCP front doors —
22
- and bootstraps the control-plane so it is ready to use. The CLI is lifecycle-only
23
- (`start` / `stop` / `status` / `restart` / `doctor` / `logs`); orchestration (runs, inbox, …) is
24
- reached over **MCP** (agents) or **GraphQL** (UI/scripts), both served by the daemon.
16
+ </div>
25
17
 
26
- Run a source checkout alongside an installed package without collisions via a named **profile**
27
- (`--profile dev`, or `REVO_PROFILE=dev`): the `dev` profile shifts the whole port band off the
28
- `default` profile, so the two never share a port, data dir, or `dbos` database.
18
+ ```mermaid
19
+ flowchart LR
20
+ task[Task]
21
+ playbook[Playbook]
22
+ machine[State machine]
23
+ outcome[Outcome]
29
24
 
30
- ```sh
31
- pnpm install
32
- pnpm run revo -- start --profile dev # standalone + host daemon, bootstrapped & ready
33
- pnpm run revo -- status --profile dev # stack health summary
34
- pnpm run revo -- doctor --profile dev # diagnose process / port / profile issues
35
- pnpm run revo -- logs --profile dev # tail host + standalone logs; add -f to follow
36
- pnpm run revo -- restart --profile dev # stop, then start
37
- pnpm run revo -- stop --profile dev
25
+ task --> playbook --> machine --> outcome
26
+
27
+ subgraph nodes[State machine nodes]
28
+ agent[Agent step] --> script[Script step] --> gate[Human gate] --> branch{Branch}
29
+ branch --> loop((Loop))
30
+ loop -. retry .-> agent
31
+ loop -. reroute .-> script
32
+ end
33
+
34
+ machine -. expands into .-> nodes
35
+ outcome --> pr[Pull request]
36
+ outcome --> evidence[Evidence]
37
+ outcome --> decisions[Decisions]
38
+ outcome --> history[Run history]
38
39
  ```
39
40
 
40
- | Knob | `default` (installed package) | `dev` (source checkout) |
41
- | --- | --- | --- |
42
- | data dir | `~/.revisium-orchestrator` | `~/.revisium-orchestrator-dev` |
43
- | standalone HTTP / Postgres | `19222` / `15440` | `19622` / `15840` |
44
- | Revo GraphQL | `19223` | `19623` |
45
- | DBOS database | `dbos` | `dbos_dev` |
41
+ > Revo is in active development. The package is suitable for evaluation and local experimentation; do not treat
42
+ > the public contract as stable yet.
46
43
 
47
- Any single knob can be overridden explicitly — `REVO_DATA_DIR` / `REVO_PORT` / `REVO_PG_PORT` /
48
- `REVO_GRAPHQL_PORT` / `REVO_DBOS_DB` — and an explicit env var always wins over the profile band.
44
+ ## Overview
49
45
 
50
- Connect an agent over MCP (`revo mcp` is a thin stdio bridge it does not launch its own DBOS;
51
- if the daemon isn't already running, the bridge auto-starts it on first use; the profile comes
52
- from the process environment, not per-call args):
46
+ Revo is a local control plane for agentic work. A caller creates a run, Revo selects a playbook, and the playbook
47
+ executes as a state machine made of agent steps, script steps, human gates, branches, and loops.
53
48
 
54
- **Claude Code**
49
+ The goal is not to replace coding agents. Revo coordinates them: it keeps state, records evidence, enforces gates,
50
+ and gives humans a stable place to approve plans, resolve questions, inspect feedback, and decide when work is ready
51
+ to ship.
55
52
 
56
- ```sh
57
- # global install
58
- claude mcp add revo -- revo mcp
53
+ ## How It Works
54
+
55
+ - **Playbooks define flow.** Roles, scripts, gates, verdicts, branches, and loop limits are data, not hidden prompt
56
+ convention.
57
+ - **Agent steps are short-lived.** Each agent process receives current state and exits after one step.
58
+ - **Script steps do deterministic work.** Automation such as integration, polling, and response actions stays outside
59
+ agent prompts.
60
+ - **Human gates are state changes.** A plan approval, question answer, or merge approval resolves an inbox item and
61
+ resumes the run.
62
+ - **Outputs are traceable.** Artifacts, evidence, decisions, attempts, cost, and run history are recorded for later
63
+ inspection.
64
+
65
+ ## Concepts
66
+
67
+ | Term | Meaning |
68
+ | --- | --- |
69
+ | **Revo** | The local orchestrator and control plane for software-development runs. |
70
+ | **Playbook** | A versioned bundle of roles, pipelines, policies, and routing rules. |
71
+ | **Pipeline** | A state-machine template that defines the steps, gates, branches, loops, and terminal outcomes. |
72
+ | **Role** | A named agent definition: prompt, model level, scope, runner, and allowed behavior. |
73
+ | **Agent step** | A pipeline node that starts a short-lived coding agent through a role. |
74
+ | **Script step** | A deterministic automation node used for integration, polling, readiness, or response actions. |
75
+ | **Human gate** | A required decision or answer; the run parks until an inbox item is resolved. |
76
+ | **Run** | One task moving through a selected playbook and pipeline. |
77
+ | **Attempt** | One execution of one step; the unit for logs, verdicts, tokens, and cost. |
78
+ | **MCP** | The local agent-facing tool bridge exposed by `revo mcp`. |
79
+ | **GraphQL API** | The local API surface for UI and script integrations. |
80
+
81
+ ## Alpha Install
82
+
83
+ The `@alpha` package is a prerelease for evaluating Revo locally. It uses the `default` profile:
59
84
 
60
- # dev checkout
61
- claude mcp add revo -- pnpm --dir "$PWD" run revo -- mcp
85
+ ```sh
86
+ npm install -g @revisium/orchestrator@alpha
87
+ revo start
88
+ revo status
89
+ revo doctor
90
+ revo logs
91
+ revo stop
62
92
  ```
63
93
 
64
- **Codex CLI** (`codex mcp add` or edit `~/.codex/config.toml` directly)
94
+ Connect an MCP-capable agent to the installed binary:
65
95
 
66
96
  ```sh
67
- # global install
68
97
  codex mcp add revo -- revo mcp
69
-
70
- # dev checkout (use an absolute path — $PWD does not expand in TOML args)
71
- codex mcp add revo-dev -- pnpm --dir /abs/path/to/agent-orchestrator run revo -- mcp
98
+ claude mcp add revo -- revo mcp
72
99
  ```
73
100
 
74
- To use a non-`default` profile with Codex, append `--env REVO_PROFILE=dev` (and the other
75
- dev-band vars; see the JSON block under **Live Run Observability Smoke**) to `codex mcp add`,
76
- or export the vars in the shell before launching Codex — stdio servers inherit the parent
77
- environment. Equivalent TOML for the global install form:
101
+ Default local ports:
78
102
 
79
- ```toml
80
- # ~/.codex/config.toml
81
- [mcp_servers.revo]
82
- command = "revo" # or the absolute path from `which revo` if revo is not on Codex's PATH
83
- args = ["mcp"]
84
- ```
103
+ | Service | Port |
104
+ | --- | --- |
105
+ | Revisium standalone HTTP | `19222` |
106
+ | embedded Postgres | `15440` |
107
+ | Revo GraphQL | `19223` |
85
108
 
86
- **Verify the connection** run `claude mcp list` or `codex mcp list` to confirm the server
87
- appears, then have the agent call `get_status` for a healthy JSON status reply. `list_pipelines`
88
- is a good read-only alternative.
109
+ GraphQL is available at `http://127.0.0.1:19223/graphql` in the default profile. The target contract is documented in
110
+ [docs/specs/graphql-admin-api-v1.spec.md](./docs/specs/graphql-admin-api-v1.spec.md), and the committed SDL is
111
+ [src/api/graphql-api/schema.graphql](./src/api/graphql-api/schema.graphql).
89
112
 
90
- Run the local verification gates:
113
+ ## Roadmap
91
114
 
92
- ```sh
93
- pnpm run typecheck
94
- pnpm run lint:ci
95
- pnpm run test:cov
96
- pnpm run verify
97
- ```
115
+ Revo is in active development. The public roadmap lives in GitHub Milestones and umbrella issues; this README only points to the current tracks.
116
+
117
+ | Track | Start here |
118
+ | --- | --- |
119
+ | Default playbook stabilization | [Milestone #1](https://github.com/revisium/orchestrator/milestone/1), [umbrella #146](https://github.com/revisium/orchestrator/issues/146) |
120
+ | GraphQL admin API v1 migration | [Milestone #4](https://github.com/revisium/orchestrator/milestone/4), [umbrella #167](https://github.com/revisium/orchestrator/issues/167) |
121
+ | Execution profiles and runner/model binding | [Milestone #5](https://github.com/revisium/orchestrator/milestone/5), [umbrella #168](https://github.com/revisium/orchestrator/issues/168) |
122
+ | Loop engineering layer | [Milestone #2](https://github.com/revisium/orchestrator/milestone/2), [umbrella #148](https://github.com/revisium/orchestrator/issues/148) |
123
+ | Role and pipeline authoring | [Milestone #3](https://github.com/revisium/orchestrator/milestone/3), [umbrella #157](https://github.com/revisium/orchestrator/issues/157) |
124
+
125
+ Use umbrella issues for initiative context and child issues for reviewable delivery slices. Work orders do not live in docs.
98
126
 
99
- The smoke scripts are guarded: they require a non-default `REVO_DATA_DIR`,
100
- `REVO_PORT`, `REVO_PG_PORT`, and `REVO_DBOS_DB`; GraphQL smoke paths also require
101
- `REVO_GRAPHQL_PORT`.
127
+ ## Local Development
128
+
129
+ Use the `dev` profile when running a source checkout next to an installed package. The profile has isolated ports,
130
+ data directory, and DBOS database.
102
131
 
103
132
  ```sh
104
- pnpm run smoke:control-plane
105
- pnpm run smoke:create-run
106
- pnpm run smoke:inspect-run
133
+ pnpm install
134
+ pnpm run revo -- start --profile dev
135
+ pnpm run revo -- status --profile dev
136
+ pnpm run revo -- doctor --profile dev
137
+ pnpm run revo -- logs --profile dev
138
+ pnpm run revo -- stop --profile dev
107
139
  ```
108
140
 
109
- ### Live Run Observability Smoke
141
+ | Knob | `default` | `dev` |
142
+ | --- | --- | --- |
143
+ | data dir | `~/.revisium-orchestrator` | `~/.revisium-orchestrator-dev` |
144
+ | standalone HTTP / Postgres | `19222` / `15440` | `19622` / `15840` |
145
+ | Revo GraphQL | `19223` | `19623` |
146
+ | DBOS database | `dbos` | `dbos_dev` |
147
+
148
+ Explicit environment variables override the profile: `REVO_DATA_DIR`, `REVO_PORT`, `REVO_PG_PORT`,
149
+ `REVO_GRAPHQL_PORT`, and `REVO_DBOS_DB`.
150
+
151
+ ## Front Doors
110
152
 
111
- This smoke runs a real agent. It can call provider CLIs and incur cost. Use it
112
- only when that is intentional.
153
+ `revo mcp` is the agent front door. It is a local stdio bridge to the daemon and exposes product-level tools for
154
+ runs, gates, repository diagnostics, method discovery, and PR readiness.
113
155
 
114
156
  ```sh
115
- export REVO_SMOKE_REPO=/path/to/local/sandbox-repo
116
- pnpm run revo -- start --profile dev # standalone + host daemon (serves GraphQL + MCP), ready
157
+ codex mcp add --env REVO_PROFILE=dev revo-dev -- pnpm --dir /abs/path/to/orchestrator run revo -- mcp
158
+ claude mcp add -e REVO_PROFILE=dev revo-dev -- pnpm --dir /abs/path/to/orchestrator run revo -- mcp
117
159
  ```
118
160
 
119
- Drive and observe a run through the daemon's front doors there are no `run`/`serve` CLI commands.
120
- From an agent, use the MCP tools (`create_run`, `start_run`, then `get_agent_activity` /
121
- `get_agent_log`). From a UI or script, use the GraphQL front door the daemon already serves at
122
- `http://127.0.0.1:$REVO_GRAPHQL_PORT/graphql` — create a run:
123
-
124
- ```graphql
125
- mutation Create($data: CreateRunInput!) {
126
- createRun(data: $data) {
127
- runId
128
- }
129
- }
130
- ```
161
+ For the `dev` profile, GraphQL is available at `http://127.0.0.1:19623/graphql`.
131
162
 
132
- Then observe it over the same endpoint:
133
-
134
- ```graphql
135
- query Activity($runId: ID!) {
136
- runAgentActivity(runId: $runId) {
137
- runId
138
- aggregateStatus
139
- latestOutputAt
140
- attempts {
141
- attemptId
142
- runner
143
- status
144
- stdoutBytes
145
- stderrBytes
146
- artifactRef
147
- }
148
- }
149
- }
150
-
151
- query Log($data: GetAgentLogInput!) {
152
- runAgentLog(data: $data) {
153
- runId
154
- attemptId
155
- stream
156
- offsetBytes
157
- nextOffsetBytes
158
- totalBytes
159
- truncated
160
- content
161
- }
162
- }
163
- ```
163
+ ## Verification
164
164
 
165
- For MCP, configure the MCP client to launch this checkout's local binary with the
166
- same environment. The MCP tools do not accept per-call profile arguments; the
167
- profile comes from the process environment.
168
-
169
- ```json
170
- {
171
- "mcpServers": {
172
- "revo-dev": {
173
- "command": "/path/to/agent-orchestrator/bin/revo.js",
174
- "args": ["mcp"],
175
- "env": {
176
- "REVO_DATA_DIR": "/path/to/.revisium-orchestrator-dev",
177
- "REVO_PORT": "19622",
178
- "REVO_PG_PORT": "15840",
179
- "REVO_GRAPHQL_PORT": "19623",
180
- "REVO_DBOS_DB": "dbos_dev"
181
- }
182
- }
183
- }
184
- }
165
+ ```sh
166
+ pnpm run typecheck
167
+ pnpm run lint:ci
168
+ pnpm run test:cov
169
+ pnpm run verify
185
170
  ```
186
171
 
187
- Useful MCP observability tools for the same run:
172
+ Smoke and e2e scripts that start local daemons may need an unsandboxed terminal and isolated non-default ports.
188
173
 
189
- - `get_agent_activity`
190
- - `get_agent_attempts`
191
- - `get_agent_log`
192
- - `read_agent_output_events`
193
- - `tail_agent_log`
174
+ ## Documentation
194
175
 
195
- If running from a sandboxed automation environment, local server checks may fail
196
- with `listen EPERM` or a misleading `No free port found from <port>`. Re-run the
197
- daemon, GraphQL, and MCP smoke commands from a normal terminal or an approved
198
- unsandboxed execution context.
176
+ | Start here | Purpose |
177
+ | --- | --- |
178
+ | [docs/README.md](./docs/README.md) | Documentation map and ownership rules |
179
+ | [docs/vision.md](./docs/vision.md) | Product direction, glossary, and capability map |
180
+ | [docs/architecture-overview.md](./docs/architecture-overview.md) | Runtime layers, invariants, and lifecycle |
181
+ | [docs/developer-guide.md](./docs/developer-guide.md) | Source map and contributor onboarding |
182
+ | [docs/specs/](./docs/specs/) | Exact product contracts |
183
+ | [docs/adr/](./docs/adr/) | Durable architecture decisions |
184
+ | [AGENTS.md](./AGENTS.md) | Repo-local instructions for coding agents |
199
185
 
200
186
  ## License
201
187
 
202
- See [LICENSE](./LICENSE).
188
+ MIT - see [LICENSE](./LICENSE).
@@ -42,7 +42,8 @@
42
42
  "ci_changes",
43
43
  "fix",
44
44
  "wontfix",
45
- "question"
45
+ "question",
46
+ "recheck"
46
47
  ]
47
48
  },
48
49
  "nodes": {
@@ -173,7 +174,10 @@
173
174
  "node": "analyst",
174
175
  "as": "plan"
175
176
  }
176
- ]
177
+ ],
178
+ "produces": {
179
+ "name": "change"
180
+ }
177
181
  },
178
182
  "codeReview": {
179
183
  "id": "codeReview",
@@ -181,7 +185,19 @@
181
185
  "roleRef": "role:reviewer",
182
186
  "next": "codeReviewRouter",
183
187
  "onFailure": "abort",
184
- "resultSchema": "schema:reviewVerdict"
188
+ "resultSchema": "schema:reviewVerdict",
189
+ "consumes": [
190
+ {
191
+ "node": "developer",
192
+ "as": "developerChange",
193
+ "staleOk": true
194
+ },
195
+ {
196
+ "node": "reworkDeveloper",
197
+ "as": "reworkChange",
198
+ "optional": true
199
+ }
200
+ ]
185
201
  },
186
202
  "codeReviewRouter": {
187
203
  "id": "codeReviewRouter",
@@ -255,7 +271,10 @@
255
271
  "resultSchema": "schema:change",
256
272
  "incrementCounters": [
257
273
  "codeReviewLoop"
258
- ]
274
+ ],
275
+ "produces": {
276
+ "name": "change"
277
+ }
259
278
  },
260
279
  "integrator": {
261
280
  "id": "integrator",
@@ -273,14 +292,33 @@
273
292
  }
274
293
  ],
275
294
  "onFailure": "route",
276
- "resultSchema": "schema:integration"
295
+ "resultSchema": "schema:integration",
296
+ "consumes": [
297
+ {
298
+ "node": "developer",
299
+ "as": "developerChange",
300
+ "staleOk": true
301
+ },
302
+ {
303
+ "node": "reworkDeveloper",
304
+ "as": "reworkChange",
305
+ "optional": true
306
+ },
307
+ {
308
+ "node": "ciRework",
309
+ "as": "ciChange",
310
+ "optional": true,
311
+ "staleOk": true
312
+ }
313
+ ]
277
314
  },
278
315
  "mergeGate": {
279
316
  "id": "mergeGate",
280
317
  "kind": "humanGate",
281
318
  "reason": "merge-review",
282
319
  "outcomes": [
283
- "approved"
320
+ "approved",
321
+ "recheck"
284
322
  ],
285
323
  "branches": [
286
324
  {
@@ -290,15 +328,83 @@
290
328
  },
291
329
  "goto": "confirmMerge"
292
330
  },
331
+ {
332
+ "when": {
333
+ "op": "verdict.eq",
334
+ "value": "recheck"
335
+ },
336
+ "goto": "mergeRecheck"
337
+ },
293
338
  {
294
339
  "default": "blockedEnd"
295
340
  }
296
341
  ],
297
342
  "gatedArtifact": {
298
- "node": "pollPr",
343
+ "node": "mergeReadiness",
299
344
  "as": "prFeedback"
300
345
  }
301
346
  },
347
+ "mergeRecheck": {
348
+ "id": "mergeRecheck",
349
+ "kind": "script",
350
+ "scriptRef": "script:pollPr",
351
+ "next": "mergeRecheckRouter",
352
+ "onFailure": "route",
353
+ "resultSchema": "schema:prFeedback",
354
+ "produces": {
355
+ "name": "prFeedback"
356
+ },
357
+ "catch": [
358
+ {
359
+ "onError": "revo.ScriptBlocked",
360
+ "goto": "blockedEnd"
361
+ },
362
+ {
363
+ "onError": "revo.ScriptFailed",
364
+ "goto": "failedEnd"
365
+ }
366
+ ]
367
+ },
368
+ "mergeRecheckRouter": {
369
+ "id": "mergeRecheckRouter",
370
+ "kind": "choice",
371
+ "branches": [
372
+ {
373
+ "when": {
374
+ "op": "verdict.eq",
375
+ "value": "clean"
376
+ },
377
+ "goto": "blockedEnd"
378
+ },
379
+ {
380
+ "when": {
381
+ "op": "verdict.eq",
382
+ "value": "review_changes"
383
+ },
384
+ "goto": "triage"
385
+ },
386
+ {
387
+ "when": {
388
+ "op": "all",
389
+ "of": [
390
+ {
391
+ "op": "verdict.eq",
392
+ "value": "ci_changes"
393
+ },
394
+ {
395
+ "op": "counter.lt",
396
+ "scope": "ciLoop",
397
+ "value": 3
398
+ }
399
+ ]
400
+ },
401
+ "goto": "ciRework"
402
+ },
403
+ {
404
+ "default": "blockedEnd"
405
+ }
406
+ ]
407
+ },
302
408
  "confirmMerge": {
303
409
  "id": "confirmMerge",
304
410
  "kind": "script",
@@ -315,7 +421,13 @@
315
421
  }
316
422
  ],
317
423
  "onFailure": "route",
318
- "resultSchema": "schema:integration"
424
+ "resultSchema": "schema:integration",
425
+ "consumes": [
426
+ {
427
+ "node": "mergeReadiness",
428
+ "as": "mergeReadiness"
429
+ }
430
+ ]
319
431
  },
320
432
  "mergedEnd": {
321
433
  "id": "mergedEnd",
@@ -356,6 +468,67 @@
356
468
  "prRouter": {
357
469
  "id": "prRouter",
358
470
  "kind": "choice",
471
+ "branches": [
472
+ {
473
+ "when": {
474
+ "op": "verdict.eq",
475
+ "value": "clean"
476
+ },
477
+ "goto": "mergeReadiness"
478
+ },
479
+ {
480
+ "when": {
481
+ "op": "verdict.eq",
482
+ "value": "review_changes"
483
+ },
484
+ "goto": "triage"
485
+ },
486
+ {
487
+ "when": {
488
+ "op": "all",
489
+ "of": [
490
+ {
491
+ "op": "verdict.eq",
492
+ "value": "ci_changes"
493
+ },
494
+ {
495
+ "op": "counter.lt",
496
+ "scope": "ciLoop",
497
+ "value": 3
498
+ }
499
+ ]
500
+ },
501
+ "goto": "ciRework"
502
+ },
503
+ {
504
+ "default": "blockedEnd"
505
+ }
506
+ ]
507
+ },
508
+ "mergeReadiness": {
509
+ "id": "mergeReadiness",
510
+ "kind": "script",
511
+ "scriptRef": "script:pollPr",
512
+ "next": "mergeReadinessRouter",
513
+ "onFailure": "route",
514
+ "resultSchema": "schema:prFeedback",
515
+ "produces": {
516
+ "name": "prFeedback"
517
+ },
518
+ "catch": [
519
+ {
520
+ "onError": "revo.ScriptBlocked",
521
+ "goto": "blockedEnd"
522
+ },
523
+ {
524
+ "onError": "revo.ScriptFailed",
525
+ "goto": "failedEnd"
526
+ }
527
+ ]
528
+ },
529
+ "mergeReadinessRouter": {
530
+ "id": "mergeReadinessRouter",
531
+ "kind": "choice",
359
532
  "branches": [
360
533
  {
361
534
  "when": {
@@ -403,10 +576,25 @@
403
576
  "incrementCounters": [
404
577
  "ciLoop"
405
578
  ],
579
+ "produces": {
580
+ "name": "change"
581
+ },
406
582
  "consumes": [
407
583
  {
408
584
  "node": "pollPr",
409
585
  "as": "feedback"
586
+ },
587
+ {
588
+ "node": "mergeReadiness",
589
+ "as": "mergeFeedback",
590
+ "optional": true,
591
+ "staleOk": true
592
+ },
593
+ {
594
+ "node": "mergeRecheck",
595
+ "as": "recheckFeedback",
596
+ "optional": true,
597
+ "staleOk": true
410
598
  }
411
599
  ]
412
600
  },
@@ -429,6 +617,18 @@
429
617
  {
430
618
  "node": "pollPr",
431
619
  "as": "feedback"
620
+ },
621
+ {
622
+ "node": "mergeReadiness",
623
+ "as": "mergeFeedback",
624
+ "optional": true,
625
+ "staleOk": true
626
+ },
627
+ {
628
+ "node": "mergeRecheck",
629
+ "as": "recheckFeedback",
630
+ "optional": true,
631
+ "staleOk": true
432
632
  }
433
633
  ]
434
634
  },
@@ -520,6 +720,9 @@
520
720
  "incrementCounters": [
521
721
  "reviewLoop"
522
722
  ],
723
+ "produces": {
724
+ "name": "change"
725
+ },
523
726
  "consumes": [
524
727
  {
525
728
  "node": "triage",
@@ -534,6 +737,12 @@
534
737
  "next": "respondThreads",
535
738
  "onFailure": "route",
536
739
  "resultSchema": "schema:integration",
740
+ "consumes": [
741
+ {
742
+ "node": "reviewRework",
743
+ "as": "reviewChange"
744
+ }
745
+ ],
537
746
  "catch": [
538
747
  {
539
748
  "onError": "revo.ScriptBlocked",