@osolmaz/pi-workflows 0.12.1 → 0.13.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.
- package/README.md +52 -28
- package/dist/builtins/autodoc.workflow.d.ts +4 -4
- package/dist/builtins/autoimplement.workflow.d.ts +369 -73
- 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 +6 -4
- package/dist/builtins/catalog.js.map +1 -1
- 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 +497 -216
- 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 +170 -22
- 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/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 +89 -2
- 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 -103
- 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 +19 -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/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 +104 -50
- 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/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/autoplan.workflow.ts +290 -40
- package/src/builtins/catalog.ts +6 -4
- package/src/builtins/index.ts +7 -1
- package/src/builtins/monitor.workflow.ts +663 -249
- package/src/builtins/plain-summary.workflow.ts +185 -0
- package/src/builtins/sanity-check.workflow.ts +62 -7
- 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 +105 -2
- package/src/extension/herdr-viewer.ts +0 -5
- package/src/extension/index.ts +180 -118
- 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/skills/monitor/SKILL.md
CHANGED
|
@@ -1,226 +1,154 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: monitor
|
|
3
|
-
description: Use when the user asks to monitor, watch, track, or periodically check a running command, remote Job, CI run, deployment, publication, or other long-running
|
|
3
|
+
description: Use when the user asks to monitor, watch, track, or periodically check a running command, remote Job, CI run, deployment, publication, or other long-running goal. Starts the built-in Pi monitor workflow immediately and finishes the authorized goal through direct advance, recovery, or composed repair work until completion or a material blocker.
|
|
4
4
|
compatibility: Requires pi-workflows and the built-in monitor workflow.
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Monitor
|
|
8
8
|
|
|
9
|
-
Use the built-in Pi `monitor` workflow
|
|
9
|
+
Use the built-in Pi `monitor` workflow to finish the user's authorized goal. It observes the real target first, acts when safe authorized work is available, verifies every action immediately, and waits only while useful work is moving or an external event is pending.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Monitoring does not grant new authority. Preserve the exact objective, allowed and forbidden changes, cost ceiling, provider and runtime contract, required checks, stop conditions, and recovery rules from the conversation and repository instructions.
|
|
12
12
|
|
|
13
|
-
## Start the workflow
|
|
13
|
+
## Start the workflow
|
|
14
14
|
|
|
15
|
-
Build the complete input
|
|
15
|
+
When no workflow is active, list workflows only when you must confirm that `monitor` is available. Build the complete input before starting, then call `workflow` with `action: "start"` exactly once in the same turn as the user's request.
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
2. Preserve the exact objective, immutable execution contract, current identifiers, durable progress, cost already spent, approval ceilings, finish criteria, and known recovery rules in the workflow input. Write or update a durable plan or incident note first only when the work needs one for safe continuation.
|
|
19
|
-
3. Make the workflow instructions faithful to what the user requested. Do not reduce an implementation or recovery objective to observation-only monitoring.
|
|
20
|
-
4. Call `workflow` with `action: "start"` in the current Pi session without asking for another confirmation or waiting for a later turn.
|
|
21
|
-
5. Let the first workflow check run immediately. Do not use Unified Exec sleeps, manual polling loops, a second scheduler, or a separate Pi session as a substitute.
|
|
17
|
+
The public input has four fields:
|
|
22
18
|
|
|
23
|
-
|
|
19
|
+
- `task`: Required. Put the complete goal, stable target identifiers, current durable progress, sources of truth, allowed files and systems, forbidden changes, cost limits, provider/runtime contract, required checks, allowed recovery actions, and stop boundaries here.
|
|
20
|
+
- `stopWhen`: Optional. Use the user's complete finish rule. Omit it only when the user gave no finish rule, which means explicit user stop.
|
|
21
|
+
- `everyMinutes`: Optional. Use the user's interval. The default is 30 minutes.
|
|
22
|
+
- `maxChecks`: Optional. Include it only when the user supplied a check limit.
|
|
24
23
|
|
|
25
|
-
|
|
24
|
+
Do not send any other field. Inputs such as `repair`, `checkTimeoutMinutes`, `reportWhen`, and `audience` are invalid.
|
|
26
25
|
|
|
27
|
-
|
|
26
|
+
When the task can change code or remote state, make `task` state the absolute repository path, concrete edit and test scope, base branch, commit and push authority, pull-request and merge authority, release and deployment authority, and inherited constraints. A repository path alone is not a scope. Derive a narrow scope when one repository and task are clear instead of asking the user to repeat it.
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
- `everyMinutes`: Use the user's interval when present. Use `30` when the user gives no interval. The built-in workflow accepts intervals from 1 minute through 24 hours.
|
|
31
|
-
- `stopWhen`: Infer verified completion from the full conversation. Describe completion of the complete objective, not only the end of one physical process. Also name material blockers that require human intervention.
|
|
32
|
-
- `repair`: Include this object only when the request or an existing approval authorizes mutation. Set `authorized: true` and record the repository, scope, base branch, merge policy, and constraints that apply. Omit it for observation-only work. Omit `repair.approval` for the default behavior: ask on each new repair plan and continue after 10 minutes without an answer. Use `{ "mode": "required" }` to block on plan changes or `{ "mode": "skip" }` to continue without asking.
|
|
33
|
-
|
|
34
|
-
Replace the example values below with facts from the conversation, then make one start call:
|
|
28
|
+
Replace the example values with facts from the conversation:
|
|
35
29
|
|
|
36
30
|
```json
|
|
37
31
|
{
|
|
38
32
|
"action": "start",
|
|
39
33
|
"workflow": "monitor",
|
|
40
34
|
"input": {
|
|
41
|
-
"task": "
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"checkTimeoutMinutes": 10
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
For authorized repair, add a complete `repair` object instead of leaving mutation authority implicit:
|
|
50
|
-
|
|
51
|
-
```json
|
|
52
|
-
{
|
|
53
|
-
"repair": {
|
|
54
|
-
"authorized": true,
|
|
55
|
-
"repository": "/absolute/path/to/repository",
|
|
56
|
-
"scope": "Only /absolute/path/to/repository. May diagnose and fix failures related to the monitored objective, test, commit, push, and update its pull request. Must not modify other repositories, merge, release, deploy, change credentials, or change repository policy.",
|
|
57
|
-
"constraints": ["Keep the monitored objective and method unchanged."],
|
|
58
|
-
"baseBranch": "main",
|
|
59
|
-
"merge": false
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
When the conversation gives no clear finish criterion, set `stopWhen` to `Stop only when the user explicitly asks to stop.` Do not use that fallback when a broader implementation, repair, publication, or deployment objective is clear from context.
|
|
65
|
-
|
|
66
|
-
Do not invent a finite check count. Omit `maxChecks` unless the user explicitly requests one. The workflow host can apply its own safety upper bound. Disclose that bound if it appears.
|
|
67
|
-
|
|
68
|
-
When repair is authorized, route a concrete code or design defect through the monitor's shared plan-change path. Supply the problem, observed evidence, and a stable fingerprint of the issue plus target state. The path runs Autoplan, Autodoc, the configured plan decision, and Autoimplement, then checks the target again. Autoimplement does not ask again for the plan selected by Monitor. It uses the same shared path if later evidence requires another plan. Do not copy their prompts into the monitor task.
|
|
69
|
-
|
|
70
|
-
### Repair plan decisions
|
|
71
|
-
|
|
72
|
-
Omit `repair.approval` for autonomous mode. It asks the `operator` audience and continues with the exact presented plan after 10 minutes without an accepted answer.
|
|
73
|
-
|
|
74
|
-
Block until the operator answers:
|
|
75
|
-
|
|
76
|
-
```json
|
|
77
|
-
{
|
|
78
|
-
"repair": {
|
|
79
|
-
"approval": {
|
|
80
|
-
"mode": "required"
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
Continue without asking:
|
|
87
|
-
|
|
88
|
-
```json
|
|
89
|
-
{
|
|
90
|
-
"repair": {
|
|
91
|
-
"approval": {
|
|
92
|
-
"mode": "skip"
|
|
93
|
-
}
|
|
35
|
+
"task": "Finish the six missing modules in /absolute/path/to/repository. Resume only from verified saved outputs. May edit launch manifests and module outputs, run the named checks, and restart the existing pinned workers. Keep the current provider and runtime. Stay below the recorded cumulative cost ceiling. Do not change unrelated files, credentials, model selection, data source, base branch main, or production state. Commit and push are not authorized. Pull requests, merge, release, and deployment are not authorized. Stop before any action outside these limits.",
|
|
36
|
+
"stopWhen": "All 27 modules have verified durable outputs, or safe continuation is blocked.",
|
|
37
|
+
"everyMinutes": 15
|
|
94
38
|
}
|
|
95
39
|
}
|
|
96
40
|
```
|
|
97
41
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
## Keep routine work moving
|
|
101
|
-
|
|
102
|
-
While the workflow is active, do routine, bounded work required by the exact objective without asking for another confirmation. This includes:
|
|
103
|
-
|
|
104
|
-
- downloading, building, and running code pinned by the monitored objective;
|
|
105
|
-
- building and running task containers from a pinned benchmark or repository revision;
|
|
106
|
-
- installing pinned dependencies in the planned isolated environment;
|
|
107
|
-
- running canaries, tests, retries, restarts, and temporary cleanup;
|
|
108
|
-
- repairing configuration or storage-path errors without changing the method; and
|
|
109
|
-
- continuing paid work that already has applicable approval.
|
|
110
|
-
|
|
111
|
-
Pinned third-party code is part of the objective when the task names its exact repository, revision, lock file, image digest, or benchmark release. Resolve mutable references to immutable revisions when the applicable safety rules require it. Do not ask once per image, package, or task. New unpinned code, unrelated code, or broader privileges remain outside the monitor's authority.
|
|
112
|
-
|
|
113
|
-
## Paid infrastructure authority
|
|
114
|
-
|
|
115
|
-
A monitoring request does not grant spending approval or create a default spending ceiling. Before launching, resuming, retrying, or replacing paid work, load and follow the paid-compute, provider, Job-control, and runtime skills that apply. Use any applicable approval already recorded in the conversation or repository instructions.
|
|
42
|
+
Do not start a second Monitor for the same goal while one is active. When this skill is loaded inside a workflow step, complete that step. Do not start a nested workflow.
|
|
116
43
|
|
|
117
|
-
|
|
44
|
+
## Observation steps
|
|
118
45
|
|
|
119
|
-
|
|
46
|
+
Every Monitor cycle starts with a read-only `observe` step. Use normal read-only tools to inspect the target's authoritative state, active work, durable outputs, checkpoints, failures, and applicable authority.
|
|
120
47
|
|
|
121
|
-
|
|
48
|
+
Answer these questions:
|
|
122
49
|
|
|
123
|
-
|
|
50
|
+
- Is the goal complete?
|
|
51
|
+
- Is useful target work active?
|
|
52
|
+
- Is the goal incomplete and idle?
|
|
53
|
+
- Did work fail?
|
|
54
|
+
- Is there a material blocker?
|
|
55
|
+
- Which safe actions are already authorized?
|
|
124
56
|
|
|
125
|
-
|
|
57
|
+
Select one route:
|
|
126
58
|
|
|
127
|
-
|
|
59
|
+
- `wait`: Useful target work is moving, or an external event must finish.
|
|
60
|
+
- `act`: The goal is incomplete and one safe authorized action is available.
|
|
61
|
+
- `stop`: The goal is complete or cannot continue safely.
|
|
128
62
|
|
|
129
|
-
|
|
63
|
+
Keep Monitor state, goal state, and target work state separate. Never call the target running because Monitor itself is active.
|
|
130
64
|
|
|
131
|
-
|
|
132
|
-
2. Query durable progress and final-output surfaces. Run independent reads in parallel when useful.
|
|
133
|
-
3. Compare the current values with the previous accepted observation.
|
|
134
|
-
4. If operation is not nominal, preserve evidence, diagnose the issue, apply the smallest authorized repair, and verify that durable progress resumes. Fix issues and restart Jobs or processes when that is necessary to keep the same objective moving.
|
|
135
|
-
5. Include a concise report for every accepted check. Report absolute totals and meaningful deltas when counters matter.
|
|
136
|
-
6. Select `continue` or `stop` as required by the step contract.
|
|
137
|
-
7. Call `workflow` with `action: "submit"` exactly once, using the supplied step and attempt IDs and the required output shape.
|
|
65
|
+
For `act`, provide one exact action with:
|
|
138
66
|
|
|
139
|
-
|
|
67
|
+
- `kind`: `advance`, `recover`, or `repair`
|
|
68
|
+
- incomplete work and factual evidence
|
|
69
|
+
- the exact next action
|
|
70
|
+
- the existing authorization and its source
|
|
71
|
+
- allowed and forbidden mutation targets
|
|
72
|
+
- cost and provider/runtime limits
|
|
73
|
+
- required checks and stop conditions
|
|
74
|
+
- verification method
|
|
75
|
+
- stable failure and target-state IDs
|
|
140
76
|
|
|
141
|
-
|
|
77
|
+
An action description records authority. It does not create authority.
|
|
142
78
|
|
|
143
|
-
|
|
79
|
+
## Direct action steps
|
|
144
80
|
|
|
145
|
-
|
|
81
|
+
`advance` starts or continues normal requested work. `recover` restarts or resumes work after an operational stop.
|
|
146
82
|
|
|
147
|
-
|
|
83
|
+
The separate `act` step uses normal tools and performs only the stated action. Do not plan, document, redesign, broaden scope, or add related work. A routine start, resume, retry, launch-file refresh, or checkpoint continuation stays direct and small.
|
|
148
84
|
|
|
149
|
-
|
|
85
|
+
Submit the real result with the unchanged failure and target-state IDs. Monitor observes again immediately. Do not wait for the next interval first.
|
|
150
86
|
|
|
151
|
-
|
|
152
|
-
- `label` and `phase` for short display text and estimation epochs;
|
|
153
|
-
- `completed`, `total`, and `unit` for factual counts;
|
|
154
|
-
- `sourceUpdatedAt` and `sourceEstimatedFinishAt` when the target provides its own fresh estimate.
|
|
87
|
+
## Repair steps
|
|
155
88
|
|
|
156
|
-
|
|
89
|
+
Use `repair` only for a code or configuration defect. Monitor composes the existing plan-change and Autoimplement workflows for repair. Do not start those workflows manually or copy their planning, documentation, implementation, review, or delivery steps.
|
|
157
90
|
|
|
158
|
-
|
|
91
|
+
Preserve the repair approval rule in `task`. `required` mode waits for an explicit operator choice. `skip` mode starts the selected repair without a gate. Default `auto` mode asks and then continues with the exact presented plan after 10 minutes when no answer arrives. These become the internal repair action's `"mode": "required"` or `"mode": "skip"`; they are not public Monitor input fields.
|
|
159
92
|
|
|
160
|
-
|
|
93
|
+
Stop affected paid workers at safe boundaries before repairing a shared code or data defect. Preserve durable outputs and failure evidence.
|
|
161
94
|
|
|
162
|
-
|
|
95
|
+
If the same failure and target-state IDs return after one completed repair, stop. Do not run the same repair cycle again.
|
|
163
96
|
|
|
164
|
-
##
|
|
97
|
+
## Authority and paid work
|
|
165
98
|
|
|
166
|
-
|
|
99
|
+
Monitor may perform an action only when the full action is inside existing authority. Stop when authority is absent, unclear, or too narrow.
|
|
167
100
|
|
|
168
|
-
|
|
101
|
+
A monitoring request does not grant spending approval. Before paid work starts or resumes, verify the applicable approval, method, hardware, concurrency, cumulative cost, and remaining ceiling. When the next action remains inside those limits, continue without asking again. Stop when the next action would exceed the limit or when the limit cannot be verified.
|
|
169
102
|
|
|
170
|
-
|
|
103
|
+
Pinned task code, images, packages, and dependencies that are already part of the authorized goal do not need a new decision for each normal use. Do not ask once per image, package, or task. New unpinned code, broader privileges, or a changed method remain outside authority.
|
|
171
104
|
|
|
172
|
-
|
|
105
|
+
Do not change protected model, method, data source, hardware class, provider/runtime contract, credential destination, production selection, or objective without new authority.
|
|
173
106
|
|
|
174
|
-
|
|
107
|
+
## Progress
|
|
175
108
|
|
|
176
|
-
|
|
109
|
+
The regular Pi model is the observation adapter. Read measurable facts with normal tools and publish useful progress through `workflow` action `update` while the step is active. Include the latest tracks in the final observation output.
|
|
177
110
|
|
|
178
|
-
|
|
111
|
+
Use stable keys. Report factual completed and total values, rates, and source ETA values only when the target exposes them. Otherwise report that progress or ETA is unavailable.
|
|
179
112
|
|
|
180
|
-
|
|
113
|
+
Do not require the monitored process, Job, application, provider, or repository to implement a Pi-specific API, file, endpoint, store, schema, command, service, transport, or dependency.
|
|
181
114
|
|
|
182
|
-
|
|
183
|
-
- an invalid, missing, or unverifiable checkpoint when useful state would be lost;
|
|
184
|
-
- a required credential that has no prior source-and-destination authorization;
|
|
185
|
-
- a changed model, method, source, hardware class, objective, or production decision;
|
|
186
|
-
- a destructive or security-sensitive action outside the recorded authority;
|
|
187
|
-
- a cost, time, or resource ceiling that cannot safely contain the remaining work;
|
|
188
|
-
- evidence that the requested result cannot be made truthful or valid under the current contract.
|
|
115
|
+
## Reports
|
|
189
116
|
|
|
190
|
-
|
|
117
|
+
Every accepted observation produces one status notification. Use this form when target work is active:
|
|
191
118
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
Depending on the target, inspect:
|
|
201
|
-
|
|
202
|
-
- Process, Job, workflow, CI, or deployment status.
|
|
203
|
-
- Durable receipts and counters.
|
|
204
|
-
- Checkpoints or partial outputs.
|
|
205
|
-
- Final manifests, databases, publications, or release artifacts.
|
|
206
|
-
- Error state and the freshness of the last durable update.
|
|
119
|
+
```text
|
|
120
|
+
Monitor: active
|
|
121
|
+
Goal: incomplete
|
|
122
|
+
Work: running
|
|
123
|
+
Progress: 21/27 modules
|
|
124
|
+
Last action: resumed six missing modules
|
|
125
|
+
Next check: 15 minutes
|
|
126
|
+
```
|
|
207
127
|
|
|
208
|
-
|
|
128
|
+
Use this form when the target is idle and an action will run:
|
|
209
129
|
|
|
210
|
-
|
|
130
|
+
```text
|
|
131
|
+
Monitor: active
|
|
132
|
+
Goal: incomplete
|
|
133
|
+
Work: idle
|
|
134
|
+
Next action: refreshing launch files and resuming work now
|
|
135
|
+
```
|
|
211
136
|
|
|
212
|
-
|
|
137
|
+
Show absolute progress before deltas. Do not invent an ETA.
|
|
213
138
|
|
|
214
|
-
##
|
|
139
|
+
## Stop conditions
|
|
215
140
|
|
|
216
|
-
|
|
141
|
+
Stop when:
|
|
217
142
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
-
|
|
221
|
-
-
|
|
222
|
-
-
|
|
223
|
-
-
|
|
224
|
-
|
|
143
|
+
- the goal is complete
|
|
144
|
+
- a material blocker prevents safe continuation
|
|
145
|
+
- the next action is outside authority
|
|
146
|
+
- a paid action lacks approval or would exceed its ceiling
|
|
147
|
+
- a protected contract would change
|
|
148
|
+
- a required credential lacks prior source-and-destination authority
|
|
149
|
+
- a useful checkpoint is invalid or cannot be preserved
|
|
150
|
+
- the same failure and target state return after one completed repair
|
|
151
|
+
- the safety limit is reached
|
|
152
|
+
- the user asks to stop
|
|
225
153
|
|
|
226
|
-
|
|
154
|
+
When the user asks to stop, cancel the active Monitor immediately with `workflow({ action: "cancel" })` and confirm that monitoring stopped.
|
|
@@ -20,7 +20,7 @@ Use the smallest applicable action:
|
|
|
20
20
|
- `pause`, `resume`, and `cancel` control the current active run.
|
|
21
21
|
- `answer` supplies input to an ordinary waiting checkpoint. It cannot satisfy a protected `humanDecision()` gate.
|
|
22
22
|
- `update` publishes a non-completing durable update for the active step attempt.
|
|
23
|
-
- `submit` completes
|
|
23
|
+
- `submit` completes an active submitted agent step with its required output. An assistant-message step completes through its normal visible reply instead.
|
|
24
24
|
|
|
25
25
|
Use `start` only once for one requested run. Before starting, load the matching workflow skill when one exists and build its complete input. Include scope, authority, constraints, identifiers, and finish criteria required by that skill. Do not start with placeholders that still need user or model repair.
|
|
26
26
|
|
|
@@ -43,10 +43,10 @@ Do not build a manual polling loop around a workflow that already schedules its
|
|
|
43
43
|
When a workflow step message arrives:
|
|
44
44
|
|
|
45
45
|
1. Do the requested work with the available tools.
|
|
46
|
-
2.
|
|
47
|
-
3.
|
|
48
|
-
4.
|
|
49
|
-
5. After
|
|
46
|
+
2. Follow the completion form in the current step contract.
|
|
47
|
+
3. For a submitted step, produce the exact expected shape and call `workflow` with `action: "submit"` exactly once, using the current step and attempt ids. If validation rejects the output, correct it and submit again with the same ids.
|
|
48
|
+
4. For an assistant-message step, reply with the requested normal assistant message. Do not call `workflow submit`; the settled visible reply is the node output.
|
|
49
|
+
5. After completion, do not add another response. The workflow sends the next step or final presentation when needed.
|
|
50
50
|
|
|
51
51
|
A node id can run more than once in a loop. Each run has a new attempt id. Never reuse an attempt id from conversation history.
|
|
52
52
|
|
|
@@ -70,13 +70,13 @@ Follow these rules:
|
|
|
70
70
|
- Reuse a finite workflow with a direct typed `includeWorkflow()` mount. Use a controller only when the child needs an independent run or indefinite reconciliation.
|
|
71
71
|
- Give included workflows named exits, map their input explicitly, and keep parent edges out of child internals.
|
|
72
72
|
- Keep `compute` pure. Put external effects in agent, function-action, or shell-action nodes.
|
|
73
|
-
- Use structured node outputs
|
|
73
|
+
- Use structured node outputs when the graph must inspect fields or choose a route. Use `expectedOutput: assistantMessage()` when exact visible text is the node result.
|
|
74
74
|
- Use an ordinary checkpoint for external continuation data that the model may submit. Use `humanDecision()` for a verified human choice. Use its typed `onTimeout` policy only when the workflow may supply a named automatic response after a durable deadline. A timeout response is recorded as policy provenance, not as a human answer.
|
|
75
75
|
- Use the shared internal plan-change workflow for Autoplan, Autodoc, plan approval, and bounded exact-text replanning. Do not copy that sequence into Autoimplement, Monitor, or another workflow.
|
|
76
76
|
- Set explicit step and command timeouts.
|
|
77
77
|
- Bound ordinary loops with `maxSteps` or another clear finish rule.
|
|
78
78
|
- Use a controller instead of a workflow for indefinite resource reconciliation.
|
|
79
|
-
- Keep presentation separate from execution. Use `presentationPrompt`
|
|
79
|
+
- Keep presentation separate from execution. Use `presentationPrompt` for one root response after the run. Use an assistant-message agent when the visible response belongs inside the graph and a parent must continue after it.
|
|
80
80
|
- Preserve the single active workflow rule in one Pi session.
|
|
81
81
|
|
|
82
82
|
Read [../../docs/workflows.md](../../docs/workflows.md) before creating or changing a workflow. Read [../../docs/WORKFLOW_COMPOSITION.md](../../docs/WORKFLOW_COMPOSITION.md) for nested workflows. Read [../../docs/HUMAN_DECISIONS.md](../../docs/HUMAN_DECISIONS.md) before adding a human gate or channel. Read [../../docs/DESIGN_PHILOSOPHY.md](../../docs/DESIGN_PHILOSOPHY.md) before adding public primitives. Use the examples under [../../examples/workflows](../../examples/workflows) as starting points.
|
|
@@ -30,7 +30,7 @@ Replace the example values below with facts from the conversation, then make one
|
|
|
30
30
|
}
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
The workflow is read-only. It collects committed and working-tree evidence, reads matching pull-request metadata when available, runs isolated reviews, verifies their claims,
|
|
33
|
+
The workflow is read-only. It collects committed and working-tree evidence, reads matching pull-request metadata when available, runs isolated reviews, and verifies their claims. It then shows the full detailed report as a normal assistant message, followed by a short plain-language assistant summary. The strict verified verdict remains the workflow result. It does not edit files, post comments, or fix findings.
|
|
34
34
|
|
|
35
35
|
When this skill is loaded inside an active workflow step, do not start another workflow. Complete the current step contract.
|
|
36
36
|
|