@osolmaz/pi-workflows 0.12.1 → 0.13.1
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.
- package/README.md +59 -33
- package/dist/builtins/autodoc.workflow.d.ts +194 -7
- package/dist/builtins/autodoc.workflow.js +156 -30
- package/dist/builtins/autodoc.workflow.js.map +1 -1
- package/dist/builtins/autoimplement-command-batches.d.ts +1 -0
- package/dist/builtins/autoimplement-command-batches.js +29 -31
- package/dist/builtins/autoimplement-command-batches.js.map +1 -1
- package/dist/builtins/autoimplement.workflow.d.ts +1619 -97
- package/dist/builtins/autoimplement.workflow.js +416 -153
- package/dist/builtins/autoimplement.workflow.js.map +1 -1
- package/dist/builtins/autoplan.workflow.d.ts +126 -13
- package/dist/builtins/autoplan.workflow.js +200 -29
- package/dist/builtins/autoplan.workflow.js.map +1 -1
- package/dist/builtins/catalog.js +7 -5
- package/dist/builtins/catalog.js.map +1 -1
- package/dist/builtins/change-verification.workflow.d.ts +110 -0
- package/dist/builtins/change-verification.workflow.js +860 -0
- package/dist/builtins/change-verification.workflow.js.map +1 -0
- package/dist/builtins/index.d.ts +2 -1
- package/dist/builtins/index.js +1 -0
- package/dist/builtins/index.js.map +1 -1
- package/dist/builtins/monitor.workflow.d.ts +56 -21
- package/dist/builtins/monitor.workflow.js +499 -217
- package/dist/builtins/monitor.workflow.js.map +1 -1
- package/dist/builtins/plain-summary.workflow.d.ts +32 -0
- package/dist/builtins/plain-summary.workflow.js +134 -0
- package/dist/builtins/plain-summary.workflow.js.map +1 -0
- package/dist/builtins/plan-change.workflow.d.ts +527 -26
- package/dist/builtins/plan-change.workflow.js +26 -0
- package/dist/builtins/plan-change.workflow.js.map +1 -1
- package/dist/builtins/sanity-check.workflow.d.ts +45 -3
- package/dist/builtins/sanity-check.workflow.js +45 -7
- package/dist/builtins/sanity-check.workflow.js.map +1 -1
- package/dist/builtins/workspace-preparation.workflow.d.ts +75 -0
- package/dist/builtins/workspace-preparation.workflow.js +498 -0
- package/dist/builtins/workspace-preparation.workflow.js.map +1 -0
- package/dist/controllers/effects.d.ts +3 -2
- package/dist/controllers/effects.js +8 -1
- package/dist/controllers/effects.js.map +1 -1
- package/dist/controllers/index.d.ts +1 -1
- package/dist/controllers/index.js +1 -1
- package/dist/controllers/index.js.map +1 -1
- package/dist/controllers/manager.d.ts +1 -0
- package/dist/controllers/manager.js +41 -17
- package/dist/controllers/manager.js.map +1 -1
- package/dist/controllers/sqlite.d.ts +107 -85
- package/dist/controllers/sqlite.js +1611 -1486
- package/dist/controllers/sqlite.js.map +1 -1
- package/dist/controllers/store.d.ts +9 -8
- package/dist/controllers/store.js +1 -31
- package/dist/controllers/store.js.map +1 -1
- package/dist/controllers/types.d.ts +3 -0
- package/dist/controllers/workflow-engine-scheduler.d.ts +1 -1
- package/dist/controllers/workflow-engine-scheduler.js +3 -5
- package/dist/controllers/workflow-engine-scheduler.js.map +1 -1
- package/dist/controllers/workflows.d.ts +2 -2
- package/dist/controllers/workflows.js +11 -10
- package/dist/controllers/workflows.js.map +1 -1
- package/dist/extension/controller-host.js +2 -2
- package/dist/extension/controller-host.js.map +1 -1
- package/dist/extension/decision-channels.d.ts +2 -0
- package/dist/extension/decision-channels.js +311 -118
- package/dist/extension/decision-channels.js.map +1 -1
- package/dist/extension/executor.d.ts +9 -2
- package/dist/extension/executor.js +90 -6
- package/dist/extension/executor.js.map +1 -1
- package/dist/extension/herdr-viewer.d.ts +0 -1
- package/dist/extension/herdr-viewer.js +0 -4
- package/dist/extension/herdr-viewer.js.map +1 -1
- package/dist/extension/index.js +156 -117
- package/dist/extension/index.js.map +1 -1
- package/dist/extension/recorder.d.ts +3 -10
- package/dist/extension/recorder.js +13 -22
- package/dist/extension/recorder.js.map +1 -1
- package/dist/extension/step-message.d.ts +7 -2
- package/dist/extension/step-message.js +94 -2
- package/dist/extension/step-message.js.map +1 -1
- package/dist/extension/widget.js +6 -0
- package/dist/extension/widget.js.map +1 -1
- package/dist/host/rpc-executor.d.ts +3 -0
- package/dist/host/rpc-executor.js +2 -0
- package/dist/host/rpc-executor.js.map +1 -1
- package/dist/host/runner.d.ts +3 -6
- package/dist/host/runner.js +83 -32
- package/dist/host/runner.js.map +1 -1
- package/dist/render/graph-render.js +14 -8
- package/dist/render/graph-render.js.map +1 -1
- package/dist/state/database.d.ts +35 -0
- package/dist/state/database.js +287 -0
- package/dist/state/database.js.map +1 -0
- package/dist/state/index.d.ts +4 -0
- package/dist/state/index.js +5 -0
- package/dist/state/index.js.map +1 -0
- package/dist/state/json.d.ts +6 -0
- package/dist/state/json.js +38 -0
- package/dist/state/json.js.map +1 -0
- package/dist/state/mutation.d.ts +57 -0
- package/dist/state/mutation.js +255 -0
- package/dist/state/mutation.js.map +1 -0
- package/dist/state/schema.d.ts +6 -0
- package/dist/state/schema.js +473 -0
- package/dist/state/schema.js.map +1 -0
- package/dist/viewer/cli.d.ts +2 -2
- package/dist/viewer/cli.js +142 -122
- package/dist/viewer/cli.js.map +1 -1
- package/dist/viewer/render.d.ts +4 -4
- package/dist/viewer/render.js +2 -17
- package/dist/viewer/render.js.map +1 -1
- package/dist/viewer/session-reducer.d.ts +1 -1
- package/dist/viewer/session-reducer.js +1 -1
- package/dist/viewer/tui.d.ts +3 -3
- package/dist/viewer/tui.js +15 -13
- package/dist/viewer/tui.js.map +1 -1
- package/dist/viewer/watch.d.ts +2 -5
- package/dist/viewer/watch.js +13 -13
- package/dist/viewer/watch.js.map +1 -1
- package/dist/workflows/composition.js +12 -2
- package/dist/workflows/composition.js.map +1 -1
- package/dist/workflows/definition.d.ts +6 -2
- package/dist/workflows/definition.js +17 -0
- package/dist/workflows/definition.js.map +1 -1
- package/dist/workflows/engine.d.ts +6 -6
- package/dist/workflows/engine.js +183 -103
- package/dist/workflows/engine.js.map +1 -1
- package/dist/workflows/errors.d.ts +3 -3
- package/dist/workflows/errors.js +3 -3
- package/dist/workflows/human-decision.d.ts +29 -4
- package/dist/workflows/human-decision.js +547 -283
- package/dist/workflows/human-decision.js.map +1 -1
- package/dist/workflows/index.d.ts +4 -5
- package/dist/workflows/index.js +3 -4
- package/dist/workflows/index.js.map +1 -1
- package/dist/workflows/schema.js +17 -1
- package/dist/workflows/schema.js.map +1 -1
- package/dist/workflows/store.d.ts +83 -103
- package/dist/workflows/store.js +902 -951
- package/dist/workflows/store.js.map +1 -1
- package/dist/workflows/types.d.ts +55 -81
- package/docs/CONTROLLERS.md +10 -8
- package/docs/DEFERRED_TURNS.md +2 -2
- package/docs/DESIGN_PHILOSOPHY.md +4 -2
- package/docs/HUMAN_DECISIONS.md +13 -14
- package/docs/MONITOR.md +179 -231
- package/docs/SQLITE_STATE.md +219 -0
- package/docs/WORKFLOW_COMPOSITION.md +27 -19
- package/docs/WORKFLOW_STEP_MESSAGES.md +20 -18
- package/docs/WORKFLOW_UPDATES.md +10 -9
- package/docs/development.md +9 -9
- package/docs/live-replay-protocol.md +28 -37
- package/docs/plans/2026-08-16-workflow-updates-plan.md +1 -1
- package/docs/plans/2026-08-19-human-decision-gates-plan.md +1 -1
- package/docs/plans/2026-08-21-autoimplement-timeout-fallback-plan.md +1 -1
- package/docs/plans/2026-08-21-plan-change-approval-policy-plan.md +1 -1
- package/docs/plans/2026-08-21-sanity-check-plan.md +30 -16
- package/docs/plans/2026-08-22-goal-finishing-monitor-plan.md +200 -0
- package/docs/plans/2026-08-23-assistant-agent-completion-plan.md +701 -0
- package/docs/plans/2026-08-23-sqlite-state-plan.md +970 -0
- package/docs/plans/2026-08-24-change-scoped-verification-plan.md +419 -0
- package/docs/plans/replayable-run-bundles-implementation-plan.md +2 -2
- package/docs/plans/session-event-replay-implementation-plan.md +1 -1
- package/docs/plans/tui-viewer-implementation-plan.md +1 -1
- package/docs/session-event-journal.md +63 -434
- package/docs/tui-viewer.md +13 -15
- package/docs/workflows.md +111 -62
- package/examples/workflows/plain-summary.workflow.ts +1 -0
- package/herdr-plugin.toml +1 -1
- package/package.json +1 -1
- package/plugins/herdr/viewer.mjs +1 -11
- package/skills/autodoc/SKILL.md +7 -0
- package/skills/autoimplement/SKILL.md +4 -0
- package/skills/autoplan/SKILL.md +5 -4
- package/skills/monitor/SKILL.md +91 -163
- package/skills/pi-workflows/SKILL.md +7 -7
- package/skills/sanity-check/SKILL.md +1 -1
- package/src/builtins/autodoc.workflow.ts +184 -33
- package/src/builtins/autoimplement-command-batches.ts +39 -33
- package/src/builtins/autoimplement.workflow.ts +483 -175
- package/src/builtins/autoplan.workflow.ts +290 -40
- package/src/builtins/catalog.ts +7 -5
- package/src/builtins/change-verification.workflow.ts +1143 -0
- package/src/builtins/index.ts +7 -1
- package/src/builtins/monitor.workflow.ts +667 -250
- package/src/builtins/plain-summary.workflow.ts +185 -0
- package/src/builtins/plan-change.workflow.ts +35 -0
- package/src/builtins/sanity-check.workflow.ts +62 -7
- package/src/builtins/workspace-preparation.workflow.ts +668 -0
- package/src/controllers/effects.ts +7 -0
- package/src/controllers/index.ts +0 -6
- package/src/controllers/manager.ts +72 -32
- package/src/controllers/sqlite.ts +2420 -1948
- package/src/controllers/store.ts +17 -38
- package/src/controllers/types.ts +3 -0
- package/src/controllers/workflow-engine-scheduler.ts +4 -8
- package/src/controllers/workflows.ts +45 -21
- package/src/extension/controller-host.ts +1 -2
- package/src/extension/decision-channels.ts +427 -144
- package/src/extension/executor.ts +106 -6
- package/src/extension/herdr-viewer.ts +0 -5
- package/src/extension/index.ts +180 -132
- package/src/extension/recorder.ts +13 -22
- package/src/extension/step-message.ts +106 -4
- package/src/extension/widget.ts +8 -0
- package/src/host/rpc-executor.ts +4 -0
- package/src/host/runner.ts +93 -41
- package/src/render/graph-render.ts +11 -4
- package/src/state/database.ts +375 -0
- package/src/state/index.ts +29 -0
- package/src/state/json.ts +42 -0
- package/src/state/mutation.ts +435 -0
- package/src/state/schema.ts +475 -0
- package/src/viewer/cli.ts +151 -144
- package/src/viewer/render.ts +12 -24
- package/src/viewer/session-reducer.ts +1 -1
- package/src/viewer/tui.ts +18 -17
- package/src/viewer/watch.ts +13 -17
- package/src/workflows/composition.ts +12 -3
- package/src/workflows/definition.ts +36 -3
- package/src/workflows/engine.ts +212 -116
- package/src/workflows/errors.ts +3 -3
- package/src/workflows/human-decision.ts +795 -340
- package/src/workflows/index.ts +15 -19
- package/src/workflows/schema.ts +19 -1
- package/src/workflows/store.ts +1295 -1163
- package/src/workflows/types.ts +61 -81
- package/dist/workflows/artifacts.d.ts +0 -40
- package/dist/workflows/artifacts.js +0 -155
- package/dist/workflows/artifacts.js.map +0 -1
- package/dist/workflows/migrate-sources.d.ts +0 -42
- package/dist/workflows/migrate-sources.js +0 -133
- package/dist/workflows/migrate-sources.js.map +0 -1
- package/docs/run-bundles.md +0 -481
- package/src/workflows/artifacts.ts +0 -188
- package/src/workflows/migrate-sources.ts +0 -178
package/README.md
CHANGED
|
@@ -11,11 +11,11 @@ live in a standalone terminal viewer.
|
|
|
11
11
|
|
|
12
12
|
The workflow model is a port of [openclaw/acpx](https://github.com/openclaw/acpx)
|
|
13
13
|
flows into pi itself. Agent steps run inside your current pi conversation, so
|
|
14
|
-
the model keeps everything it already knows from the discussion.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
the model keeps everything it already knows from the discussion. A submitted
|
|
15
|
+
agent calls the JSON `workflow` tool with structured output. An assistant agent
|
|
16
|
+
writes a normal visible response that becomes the node output. See the [design
|
|
17
|
+
philosophy](docs/DESIGN_PHILOSOPHY.md) for the principles behind the engine and
|
|
18
|
+
its public parts. Running steps can publish durable [workflow
|
|
19
19
|
updates](docs/WORKFLOW_UPDATES.md), including progress counts and ETA data.
|
|
20
20
|
Agent instructions use compact [workflow step
|
|
21
21
|
messages](docs/WORKFLOW_STEP_MESSAGES.md), and the built-in
|
|
@@ -79,6 +79,17 @@ The npm package also includes the simpler `pi-workflows` snapshot viewer. To
|
|
|
79
79
|
link that command from a clone, run `npm install && npm run build && npm link`,
|
|
80
80
|
or run it in place with `npx tsx src/viewer/cli.ts`.
|
|
81
81
|
|
|
82
|
+
All live workflow and controller state uses one local database:
|
|
83
|
+
|
|
84
|
+
```text
|
|
85
|
+
~/.pi/agent/workflows/state.sqlite
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Runs, decisions, queues, claims, controllers, session capture, notifications,
|
|
89
|
+
channel transport state, effects, and large text values share that database.
|
|
90
|
+
Reads are read-only. Every write checks its actor, expected revision, and owner
|
|
91
|
+
lease when required. See [SQLite state](docs/SQLITE_STATE.md).
|
|
92
|
+
|
|
82
93
|
## Herdr integration
|
|
83
94
|
|
|
84
95
|
pi-workflows also ships as a [Herdr](https://herdr.dev) plugin. After installing
|
|
@@ -96,7 +107,7 @@ plan](docs/plans/2026-08-20-herdr-plugin-sync-plan.md) defines update and
|
|
|
96
107
|
recovery behavior.
|
|
97
108
|
|
|
98
109
|
When Pi runs inside Herdr, a workflow widget shows `Ctrl+Shift+R piw`. When the widget has hidden rows, this call to action shares the existing scroll-controls line instead of taking another line.
|
|
99
|
-
The shortcut opens the exact run
|
|
110
|
+
The shortcut opens the exact SQLite run state and lets you choose a split, tab, or new
|
|
100
111
|
workspace. `/piw` opens the same menu, and `/piw right`, `/piw below`, `/piw
|
|
101
112
|
left`, `/piw above`, `/piw tab`, or `/piw workspace` selects a placement
|
|
102
113
|
directly. If a viewer for that run already exists, pi-workflows focuses it
|
|
@@ -156,8 +167,15 @@ While a run is on screen, the footer status bar shows a compact
|
|
|
156
167
|
|
|
157
168
|
`presentationPrompt` is optional. When present, pi-workflows uses it after the
|
|
158
169
|
structured run ends to request one normal, human-readable assistant response.
|
|
159
|
-
|
|
160
|
-
|
|
170
|
+
Without it, pi-workflows does not request a separate final response. If the
|
|
171
|
+
model writes text after submitting its last agent step, that text stays visible.
|
|
172
|
+
Shell-only and machine-consumed workflows remain model-free.
|
|
173
|
+
|
|
174
|
+
Use `expectedOutput: assistantMessage()` when a normal assistant response must
|
|
175
|
+
be a node inside the graph rather than a presentation after the run. Its exact
|
|
176
|
+
visible text becomes the node output after the turn settles. The helper has no
|
|
177
|
+
default character limit; a workflow can set one explicitly with
|
|
178
|
+
`assistantMessage({ maxChars: 2_000 })`.
|
|
161
179
|
|
|
162
180
|
## Compose workflows
|
|
163
181
|
|
|
@@ -193,8 +211,9 @@ Direct imports check child input and exit names in TypeScript. Names and paths r
|
|
|
193
211
|
## Agent-managed workflows
|
|
194
212
|
|
|
195
213
|
The model can use the same `workflow` tool to list, start, inspect, pause,
|
|
196
|
-
resume, cancel, and answer workflows.
|
|
197
|
-
action.
|
|
214
|
+
resume, cancel, and answer workflows. Submitted-step contracts use the tool's
|
|
215
|
+
`submit` action. Assistant-step contracts require a normal assistant response
|
|
216
|
+
instead. Slash commands and model actions share one lifecycle implementation.
|
|
198
217
|
|
|
199
218
|
pi-workflows includes a `monitor` workflow for plain-language requests such as:
|
|
200
219
|
|
|
@@ -217,14 +236,15 @@ discussion first and then trigger a workflow that builds on it. The
|
|
|
217
236
|
an elegant production-ready solution, and compares it with the holy grail. It
|
|
218
237
|
then selects the best practical in-scope solution without asking the user to
|
|
219
238
|
resolve the gap. The ideal can win when it is feasible, but work outside the
|
|
220
|
-
current authority cannot block a valid practical solution. The workflow
|
|
221
|
-
|
|
222
|
-
|
|
239
|
+
current authority cannot block a valid practical solution. The workflow keeps
|
|
240
|
+
the detailed implementation plan and shows one short assistant response with
|
|
241
|
+
the selected plan and a gist of every rejected option. `autoplan` replaces the
|
|
242
|
+
earlier `autodevise` name; the old command and export are not retained.
|
|
223
243
|
|
|
224
244
|
## Watching a run
|
|
225
245
|
|
|
226
|
-
Runs persist
|
|
227
|
-
|
|
246
|
+
Runs persist in `~/.pi/agent/workflows/state.sqlite` as they execute. The
|
|
247
|
+
viewer reads that database and re-renders on every state change:
|
|
228
248
|
|
|
229
249
|
```bash
|
|
230
250
|
pi-workflows view # interactive picker, live updates
|
|
@@ -281,20 +301,22 @@ full boxed graph and its edges.
|
|
|
281
301
|
## Node types
|
|
282
302
|
|
|
283
303
|
A workflow is a graph of named nodes with exactly one entry point. Each node
|
|
284
|
-
finishes with
|
|
285
|
-
|
|
286
|
-
An `agent` node sends a prompt into the pi conversation
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
304
|
+
finishes with an output, and edges decide what runs next.
|
|
305
|
+
|
|
306
|
+
An `agent` node sends a prompt into the pi conversation. By default, it waits
|
|
307
|
+
for structured output through the `workflow` tool. With
|
|
308
|
+
`expectedOutput: assistantMessage()`, it waits for a normal visible assistant
|
|
309
|
+
response and uses the exact text as its output. A `compute` node runs a pure
|
|
310
|
+
TypeScript function. A `notify` node writes a durable message for the Pi
|
|
311
|
+
session that started the run. An `action` node performs a side effect, either a
|
|
312
|
+
TypeScript function (`action({ run })`) or a runtime-owned shell command
|
|
313
|
+
(`shell({ exec, parse })`). A `checkpoint` node ends the run in a `waiting`
|
|
314
|
+
state so a human can pick it up. On top of `agent`, the `decision` helper asks
|
|
293
315
|
the model to pick from a fixed set of choices and validates the answer, and
|
|
294
316
|
`decisionEdge` routes on the result with compile-time case checking.
|
|
295
317
|
|
|
296
318
|
See [docs/workflows.md](docs/workflows.md) for the full authoring reference
|
|
297
|
-
and [docs/
|
|
319
|
+
and [docs/SQLITE_STATE.md](docs/SQLITE_STATE.md) for the on-disk run format.
|
|
298
320
|
|
|
299
321
|
## Controllers
|
|
300
322
|
|
|
@@ -330,7 +352,7 @@ The standalone CLI provides read-only views with `pi-workflows controllers` and
|
|
|
330
352
|
|
|
331
353
|
Runs do not depend on the Pi window. Every `/workflow` run is claimed through a durable queue, so closing Pi mid-run **parks** the run instead of cancelling it. Another interactive session cannot claim it. Reopening the exact session that started the run resumes it. A standalone host can also resume it without changing where reports go. A checkpointed run waits durably until you answer it with `/workflow answer <json>`, which continues the graph in a linked run.
|
|
332
354
|
|
|
333
|
-
Workflow reports use a durable session-addressed outbox. A report waits while its starting session is closed and is delivered only to that session when it opens again. Runs in the same
|
|
355
|
+
Workflow reports use a durable session-addressed outbox. A report waits while its starting session is closed and is delivered only to that session when it opens again. Runs in the same database do not broadcast messages to each other's conversations.
|
|
334
356
|
|
|
335
357
|
For runs that must continue while Pi is closed, keep the standalone host running:
|
|
336
358
|
|
|
@@ -338,12 +360,12 @@ For runs that must continue while Pi is closed, keep the standalone host running
|
|
|
338
360
|
pi-workflows host --project /path/to/project
|
|
339
361
|
```
|
|
340
362
|
|
|
341
|
-
The host claims parked runs and reconciles controllers without a Pi session. Conversation nodes execute in headless `pi --mode rpc` children that expose the same `workflow` tool contract. It is a foreground process — stop it with Ctrl-C; a crashed host's leftovers are reaped by the next one. See [docs/workflows.md](docs/workflows.md#durable-runs-parking-and-resume) for the model and [docs/
|
|
363
|
+
The host claims parked runs and reconciles controllers without a Pi session. Conversation nodes execute in headless `pi --mode rpc` children that expose the same `workflow` tool contract. It is a foreground process — stop it with Ctrl-C; a crashed host's leftovers are reaped by the next one. See [docs/workflows.md](docs/workflows.md#durable-runs-parking-and-resume) for the model and [docs/SQLITE_STATE.md](docs/SQLITE_STATE.md) for the on-disk rules.
|
|
342
364
|
|
|
343
365
|
## Examples
|
|
344
366
|
|
|
345
|
-
The [examples/workflows/](examples/workflows/) directory
|
|
346
|
-
|
|
367
|
+
The [examples/workflows/](examples/workflows/) directory contains complete
|
|
368
|
+
workflow examples. Copy any of them into `.pi/workflows/` to use them:
|
|
347
369
|
|
|
348
370
|
- `echo` is the smallest possible workflow, one agent step.
|
|
349
371
|
- `branch` classifies a task with a `decision` and routes to either a
|
|
@@ -353,12 +375,16 @@ example set. Copy any of them into `.pi/workflows/` to use them:
|
|
|
353
375
|
while they run.
|
|
354
376
|
- `two-turn` chains three agent steps that build on each other's outputs in
|
|
355
377
|
the same conversation.
|
|
378
|
+
- `plain-summary` turns structured source data into one short visible assistant
|
|
379
|
+
response. It is also a built-in workflow that other workflows can include.
|
|
356
380
|
- `autoplan` turns the current problem into a chosen practical solution and
|
|
357
381
|
a detailed implementation plan, using the ideal end state as guidance rather
|
|
358
|
-
than an out-of-scope requirement.
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
382
|
+
than an out-of-scope requirement. It also shows a short assistant response
|
|
383
|
+
with the selected plan and each rejected option.
|
|
384
|
+
- `autoimplement` finds a clear existing plan, prepares a safe branch or
|
|
385
|
+
worktree before mutation, documents it when needed, and verifies the current
|
|
386
|
+
change against eligible base-branch failures. It writes and runs the exact
|
|
387
|
+
pi-reviewer command, tracks P0 through P2, handles PR comments and CI, and
|
|
362
388
|
finalizes the PR. P0 and P1 fixes require another review. P2-only work is
|
|
363
389
|
verified without another reviewer round. A five-minute CI wait routes to
|
|
364
390
|
additional useful local testing. New evidence can route through autoplan
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
+
import { type ChangeVerificationInput, type ChangeVerificationResult, type VerificationCheck } from "./change-verification.workflow.js";
|
|
2
|
+
import { parsePreparedWorkspace, type PreparedWorkspace, type WorkspaceMode, type WorkspacePreparationInput } from "./workspace-preparation.workflow.js";
|
|
1
3
|
export type AutodocInput = {
|
|
2
4
|
task: string;
|
|
3
5
|
plan?: unknown;
|
|
4
6
|
repository?: string;
|
|
7
|
+
baseBranch?: string;
|
|
8
|
+
scope?: string;
|
|
9
|
+
workspaceMode?: WorkspaceMode;
|
|
10
|
+
directDefaultBranchAuthorized?: boolean;
|
|
11
|
+
preparedWorkspace?: PreparedWorkspace;
|
|
12
|
+
verificationChecks?: VerificationCheck[];
|
|
5
13
|
documents?: string[];
|
|
6
14
|
evidence?: unknown;
|
|
7
15
|
};
|
|
@@ -16,13 +24,18 @@ export type DocumentedPlan = {
|
|
|
16
24
|
digests: Record<string, string>;
|
|
17
25
|
evidence: unknown;
|
|
18
26
|
};
|
|
19
|
-
verification:
|
|
27
|
+
verification: ChangeVerificationResult | {
|
|
28
|
+
route: "ready";
|
|
29
|
+
reason: string;
|
|
30
|
+
};
|
|
31
|
+
workspace?: PreparedWorkspace;
|
|
20
32
|
};
|
|
21
33
|
export type AutodocBlocked = {
|
|
22
34
|
status: "blocked";
|
|
23
35
|
task: string;
|
|
24
36
|
reason: string;
|
|
25
37
|
evidence: unknown;
|
|
38
|
+
sourceNode?: string;
|
|
26
39
|
};
|
|
27
40
|
export declare const autodocWorkflow: import("../workflows/types.js").WorkflowDefinition<AutodocInput, {
|
|
28
41
|
readonly ready: {
|
|
@@ -33,17 +46,191 @@ export declare const autodocWorkflow: import("../workflows/types.js").WorkflowDe
|
|
|
33
46
|
readonly from: "blocked";
|
|
34
47
|
readonly validate: (value: unknown) => AutodocBlocked;
|
|
35
48
|
};
|
|
36
|
-
},
|
|
49
|
+
}, {
|
|
50
|
+
readonly workspace: import("../workflows/types.js").WorkflowIncludeDefinition<import("../workflows/types.js").WorkflowDefinition<WorkspacePreparationInput, {
|
|
51
|
+
readonly ready: {
|
|
52
|
+
readonly from: "ready";
|
|
53
|
+
readonly validate: typeof parsePreparedWorkspace;
|
|
54
|
+
};
|
|
55
|
+
readonly blocked: {
|
|
56
|
+
readonly from: "blocked";
|
|
57
|
+
readonly validate: (value: unknown) => {
|
|
58
|
+
route: "ready" | "propose" | "blocked";
|
|
59
|
+
selectedMode?: import("./workspace-preparation.workflow.js").PreparedWorkspaceMode;
|
|
60
|
+
preparedWorkspace?: PreparedWorkspace;
|
|
61
|
+
repository: string;
|
|
62
|
+
baseBranch: string;
|
|
63
|
+
baseRevision?: string;
|
|
64
|
+
currentBranch?: string;
|
|
65
|
+
preExistingChangedPaths: string[];
|
|
66
|
+
reason: string;
|
|
67
|
+
evidence: string[];
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
}, import("../workflows/types.js").WorkflowIncludeMap> & {
|
|
71
|
+
nodes: {
|
|
72
|
+
readonly inspect: import("../workflows/types.js").FunctionActionNodeDefinition;
|
|
73
|
+
readonly propose: import("../workflows/types.js").SubmittedAgentNodeDefinition;
|
|
74
|
+
readonly apply: import("../workflows/types.js").FunctionActionNodeDefinition;
|
|
75
|
+
readonly ready: import("../workflows/types.js").ComputeNodeDefinition;
|
|
76
|
+
readonly blocked: import("../workflows/types.js").ComputeNodeDefinition;
|
|
77
|
+
};
|
|
78
|
+
includes?: import("../workflows/types.js").WorkflowIncludeMap;
|
|
79
|
+
exits?: {
|
|
80
|
+
readonly ready: {
|
|
81
|
+
readonly from: "ready";
|
|
82
|
+
readonly validate: typeof parsePreparedWorkspace;
|
|
83
|
+
};
|
|
84
|
+
readonly blocked: {
|
|
85
|
+
readonly from: "blocked";
|
|
86
|
+
readonly validate: (value: unknown) => {
|
|
87
|
+
route: "ready" | "propose" | "blocked";
|
|
88
|
+
selectedMode?: import("./workspace-preparation.workflow.js").PreparedWorkspaceMode;
|
|
89
|
+
preparedWorkspace?: PreparedWorkspace;
|
|
90
|
+
repository: string;
|
|
91
|
+
baseBranch: string;
|
|
92
|
+
baseRevision?: string;
|
|
93
|
+
currentBranch?: string;
|
|
94
|
+
preExistingChangedPaths: string[];
|
|
95
|
+
reason: string;
|
|
96
|
+
evidence: string[];
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
}>;
|
|
101
|
+
readonly verification: import("../workflows/types.js").WorkflowIncludeDefinition<import("../workflows/types.js").WorkflowDefinition<ChangeVerificationInput, {
|
|
102
|
+
readonly ready: {
|
|
103
|
+
readonly from: "ready";
|
|
104
|
+
readonly validate: (value: unknown) => ChangeVerificationResult;
|
|
105
|
+
};
|
|
106
|
+
readonly blocked: {
|
|
107
|
+
readonly from: "blocked";
|
|
108
|
+
readonly validate: (value: unknown) => ChangeVerificationResult;
|
|
109
|
+
};
|
|
110
|
+
}, import("../workflows/types.js").WorkflowIncludeMap> & {
|
|
111
|
+
nodes: {
|
|
112
|
+
readonly selectChecks: import("../workflows/types.js").ComputeNodeDefinition;
|
|
113
|
+
readonly planChecks: import("../workflows/types.js").SubmittedAgentNodeDefinition;
|
|
114
|
+
readonly runCandidate: import("../workflows/types.js").FunctionActionNodeDefinition;
|
|
115
|
+
readonly runBase: import("../workflows/types.js").FunctionActionNodeDefinition;
|
|
116
|
+
readonly classify: import("../workflows/types.js").ComputeNodeDefinition;
|
|
117
|
+
readonly repairGuard: import("../workflows/types.js").ComputeNodeDefinition;
|
|
118
|
+
readonly mechanicalRepair: import("../workflows/types.js").FunctionActionNodeDefinition;
|
|
119
|
+
readonly semanticRepair: import("../workflows/types.js").SubmittedAgentNodeDefinition;
|
|
120
|
+
readonly judge: import("../workflows/types.js").SubmittedAgentNodeDefinition;
|
|
121
|
+
readonly ready: import("../workflows/types.js").ComputeNodeDefinition;
|
|
122
|
+
readonly blocked: import("../workflows/types.js").ComputeNodeDefinition;
|
|
123
|
+
};
|
|
124
|
+
includes?: import("../workflows/types.js").WorkflowIncludeMap;
|
|
125
|
+
exits?: {
|
|
126
|
+
readonly ready: {
|
|
127
|
+
readonly from: "ready";
|
|
128
|
+
readonly validate: (value: unknown) => ChangeVerificationResult;
|
|
129
|
+
};
|
|
130
|
+
readonly blocked: {
|
|
131
|
+
readonly from: "blocked";
|
|
132
|
+
readonly validate: (value: unknown) => ChangeVerificationResult;
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
}>;
|
|
136
|
+
}> & {
|
|
37
137
|
nodes: {
|
|
38
138
|
readonly prepare: import("../workflows/types.js").ComputeNodeDefinition;
|
|
39
|
-
readonly locatePlan: import("../workflows/types.js").
|
|
40
|
-
readonly
|
|
41
|
-
readonly
|
|
42
|
-
readonly
|
|
139
|
+
readonly locatePlan: import("../workflows/types.js").SubmittedAgentNodeDefinition;
|
|
140
|
+
readonly workspaceGuard: import("../workflows/types.js").ComputeNodeDefinition;
|
|
141
|
+
readonly inspectDocumentation: import("../workflows/types.js").SubmittedAgentNodeDefinition;
|
|
142
|
+
readonly updateDocumentation: import("../workflows/types.js").SubmittedAgentNodeDefinition;
|
|
43
143
|
readonly finalize: import("../workflows/types.js").ComputeNodeDefinition;
|
|
44
144
|
readonly blocked: import("../workflows/types.js").ComputeNodeDefinition;
|
|
45
145
|
};
|
|
46
|
-
includes?:
|
|
146
|
+
includes?: {
|
|
147
|
+
readonly workspace: import("../workflows/types.js").WorkflowIncludeDefinition<import("../workflows/types.js").WorkflowDefinition<WorkspacePreparationInput, {
|
|
148
|
+
readonly ready: {
|
|
149
|
+
readonly from: "ready";
|
|
150
|
+
readonly validate: typeof parsePreparedWorkspace;
|
|
151
|
+
};
|
|
152
|
+
readonly blocked: {
|
|
153
|
+
readonly from: "blocked";
|
|
154
|
+
readonly validate: (value: unknown) => {
|
|
155
|
+
route: "ready" | "propose" | "blocked";
|
|
156
|
+
selectedMode?: import("./workspace-preparation.workflow.js").PreparedWorkspaceMode;
|
|
157
|
+
preparedWorkspace?: PreparedWorkspace;
|
|
158
|
+
repository: string;
|
|
159
|
+
baseBranch: string;
|
|
160
|
+
baseRevision?: string;
|
|
161
|
+
currentBranch?: string;
|
|
162
|
+
preExistingChangedPaths: string[];
|
|
163
|
+
reason: string;
|
|
164
|
+
evidence: string[];
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
}, import("../workflows/types.js").WorkflowIncludeMap> & {
|
|
168
|
+
nodes: {
|
|
169
|
+
readonly inspect: import("../workflows/types.js").FunctionActionNodeDefinition;
|
|
170
|
+
readonly propose: import("../workflows/types.js").SubmittedAgentNodeDefinition;
|
|
171
|
+
readonly apply: import("../workflows/types.js").FunctionActionNodeDefinition;
|
|
172
|
+
readonly ready: import("../workflows/types.js").ComputeNodeDefinition;
|
|
173
|
+
readonly blocked: import("../workflows/types.js").ComputeNodeDefinition;
|
|
174
|
+
};
|
|
175
|
+
includes?: import("../workflows/types.js").WorkflowIncludeMap;
|
|
176
|
+
exits?: {
|
|
177
|
+
readonly ready: {
|
|
178
|
+
readonly from: "ready";
|
|
179
|
+
readonly validate: typeof parsePreparedWorkspace;
|
|
180
|
+
};
|
|
181
|
+
readonly blocked: {
|
|
182
|
+
readonly from: "blocked";
|
|
183
|
+
readonly validate: (value: unknown) => {
|
|
184
|
+
route: "ready" | "propose" | "blocked";
|
|
185
|
+
selectedMode?: import("./workspace-preparation.workflow.js").PreparedWorkspaceMode;
|
|
186
|
+
preparedWorkspace?: PreparedWorkspace;
|
|
187
|
+
repository: string;
|
|
188
|
+
baseBranch: string;
|
|
189
|
+
baseRevision?: string;
|
|
190
|
+
currentBranch?: string;
|
|
191
|
+
preExistingChangedPaths: string[];
|
|
192
|
+
reason: string;
|
|
193
|
+
evidence: string[];
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
}>;
|
|
198
|
+
readonly verification: import("../workflows/types.js").WorkflowIncludeDefinition<import("../workflows/types.js").WorkflowDefinition<ChangeVerificationInput, {
|
|
199
|
+
readonly ready: {
|
|
200
|
+
readonly from: "ready";
|
|
201
|
+
readonly validate: (value: unknown) => ChangeVerificationResult;
|
|
202
|
+
};
|
|
203
|
+
readonly blocked: {
|
|
204
|
+
readonly from: "blocked";
|
|
205
|
+
readonly validate: (value: unknown) => ChangeVerificationResult;
|
|
206
|
+
};
|
|
207
|
+
}, import("../workflows/types.js").WorkflowIncludeMap> & {
|
|
208
|
+
nodes: {
|
|
209
|
+
readonly selectChecks: import("../workflows/types.js").ComputeNodeDefinition;
|
|
210
|
+
readonly planChecks: import("../workflows/types.js").SubmittedAgentNodeDefinition;
|
|
211
|
+
readonly runCandidate: import("../workflows/types.js").FunctionActionNodeDefinition;
|
|
212
|
+
readonly runBase: import("../workflows/types.js").FunctionActionNodeDefinition;
|
|
213
|
+
readonly classify: import("../workflows/types.js").ComputeNodeDefinition;
|
|
214
|
+
readonly repairGuard: import("../workflows/types.js").ComputeNodeDefinition;
|
|
215
|
+
readonly mechanicalRepair: import("../workflows/types.js").FunctionActionNodeDefinition;
|
|
216
|
+
readonly semanticRepair: import("../workflows/types.js").SubmittedAgentNodeDefinition;
|
|
217
|
+
readonly judge: import("../workflows/types.js").SubmittedAgentNodeDefinition;
|
|
218
|
+
readonly ready: import("../workflows/types.js").ComputeNodeDefinition;
|
|
219
|
+
readonly blocked: import("../workflows/types.js").ComputeNodeDefinition;
|
|
220
|
+
};
|
|
221
|
+
includes?: import("../workflows/types.js").WorkflowIncludeMap;
|
|
222
|
+
exits?: {
|
|
223
|
+
readonly ready: {
|
|
224
|
+
readonly from: "ready";
|
|
225
|
+
readonly validate: (value: unknown) => ChangeVerificationResult;
|
|
226
|
+
};
|
|
227
|
+
readonly blocked: {
|
|
228
|
+
readonly from: "blocked";
|
|
229
|
+
readonly validate: (value: unknown) => ChangeVerificationResult;
|
|
230
|
+
};
|
|
231
|
+
};
|
|
232
|
+
}>;
|
|
233
|
+
};
|
|
47
234
|
exits?: {
|
|
48
235
|
readonly ready: {
|
|
49
236
|
readonly from: "finalize";
|