@osolmaz/pi-workflows 0.11.2 → 0.12.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 +11 -7
- package/dist/builtins/autoimplement-command-batches.d.ts +52 -0
- package/dist/builtins/autoimplement-command-batches.js +258 -0
- package/dist/builtins/autoimplement-command-batches.js.map +1 -0
- package/dist/builtins/autoimplement.workflow.d.ts +29 -3
- package/dist/builtins/autoimplement.workflow.js +876 -231
- package/dist/builtins/autoimplement.workflow.js.map +1 -1
- package/dist/builtins/catalog.js +3 -1
- package/dist/builtins/catalog.js.map +1 -1
- package/dist/builtins/index.d.ts +2 -0
- package/dist/builtins/index.js +1 -0
- package/dist/builtins/index.js.map +1 -1
- package/dist/builtins/sanity-check-session.d.ts +17 -0
- package/dist/builtins/sanity-check-session.js +168 -0
- package/dist/builtins/sanity-check-session.js.map +1 -0
- package/dist/builtins/sanity-check.workflow.d.ts +83 -0
- package/dist/builtins/sanity-check.workflow.js +398 -0
- package/dist/builtins/sanity-check.workflow.js.map +1 -0
- package/dist/controllers/sqlite.d.ts +90 -2
- package/dist/controllers/sqlite.js +380 -5
- package/dist/controllers/sqlite.js.map +1 -1
- package/dist/extension/decision-channels.js +7 -7
- package/dist/extension/deferred-turn-coordinator.d.ts +32 -0
- package/dist/extension/deferred-turn-coordinator.js +143 -0
- package/dist/extension/deferred-turn-coordinator.js.map +1 -0
- package/dist/extension/deferred-turn.d.ts +44 -0
- package/dist/extension/deferred-turn.js +110 -0
- package/dist/extension/deferred-turn.js.map +1 -0
- package/dist/extension/index.js +286 -47
- package/dist/extension/index.js.map +1 -1
- package/dist/extension/step-message.d.ts +1 -0
- package/dist/extension/step-message.js.map +1 -1
- package/dist/herdr/setup.js +4 -4
- package/dist/workflows/command-batch.d.ts +38 -0
- package/dist/workflows/command-batch.js +176 -0
- package/dist/workflows/command-batch.js.map +1 -0
- package/dist/workflows/engine.js +8 -4
- package/dist/workflows/engine.js.map +1 -1
- package/dist/workflows/index.d.ts +1 -0
- package/dist/workflows/index.js +1 -0
- package/dist/workflows/index.js.map +1 -1
- package/dist/workflows/schema.js +2 -1
- package/dist/workflows/schema.js.map +1 -1
- package/dist/workflows/shell.d.ts +4 -0
- package/dist/workflows/shell.js +6 -0
- package/dist/workflows/shell.js.map +1 -1
- package/dist/workflows/store.js +3 -1
- package/dist/workflows/store.js.map +1 -1
- package/dist/workflows/types.d.ts +4 -3
- package/docs/2026-08-18-herdr-piw-plan.md +1 -1
- package/docs/2026-08-20-durable-workflow-launch-plan.md +19 -23
- package/docs/CONTROLLERS.md +2 -2
- package/docs/DEFERRED_TURNS.md +298 -0
- package/docs/DESIGN_PHILOSOPHY.md +1 -1
- package/docs/HUMAN_DECISIONS.md +7 -7
- package/docs/HUMAN_DECISION_PRESENTATIONS.md +3 -3
- package/docs/MONITOR.md +2 -2
- package/docs/WORKFLOW_COMPOSITION.md +2 -2
- package/docs/WORKFLOW_STEP_MESSAGES.md +5 -5
- package/docs/WORKFLOW_UPDATES.md +28 -5
- package/docs/plans/2026-08-04-controller-runtime-plan.md +1 -1
- package/docs/plans/2026-08-05-always-on-workflows-plan.md +1 -1
- package/docs/plans/2026-08-10-agent-managed-monitor-workflows-plan.md +9 -9
- package/docs/plans/2026-08-13-built-in-workflow-catalog-plan.md +1 -1
- package/docs/plans/2026-08-13-session-addressed-workflow-notifications-plan.md +1 -1
- package/docs/plans/2026-08-16-workflow-updates-plan.md +3 -3
- package/docs/plans/2026-08-17-bundled-skills-plan.md +6 -6
- package/docs/plans/2026-08-19-human-decision-gates-plan.md +5 -5
- package/docs/plans/2026-08-19-human-decision-presentations-plan.md +1 -1
- package/docs/plans/2026-08-19-provider-compatible-workflow-tool-schema-plan.md +1 -1
- package/docs/plans/2026-08-19-workflow-composition-plan.md +6 -6
- package/docs/plans/2026-08-20-autoimplement-blocker-challenge-plan.md +3 -3
- package/docs/plans/2026-08-20-bounded-command-batches-plan.md +206 -0
- package/docs/plans/2026-08-20-herdr-plugin-sync-plan.md +9 -9
- package/docs/plans/2026-08-21-autoimplement-timeout-fallback-plan.md +242 -0
- package/docs/plans/2026-08-21-deferred-turn-intents-plan.md +324 -0
- package/docs/plans/2026-08-21-sanity-check-plan.md +175 -0
- package/docs/run-bundles.md +3 -1
- package/docs/workflows.md +62 -19
- package/examples/workflows/command-batch.workflow.ts +50 -0
- package/examples/workflows/sanity-check.workflow.ts +1 -0
- package/herdr-plugin.toml +3 -3
- package/package.json +1 -1
- package/schemas/decision-presentation-v1.schema.json +1 -1
- package/schemas/human-decision-accepted-v1.schema.json +1 -1
- package/schemas/human-decision-accepted-v2.schema.json +1 -1
- package/schemas/human-decision-answer-attempt-v1.schema.json +1 -1
- package/schemas/human-decision-cancellation-v1.schema.json +1 -1
- package/schemas/human-decision-continuation-v1.schema.json +1 -1
- package/schemas/human-decision-delivery-v1.schema.json +1 -1
- package/schemas/human-decision-delivery-v2.schema.json +1 -1
- package/schemas/human-decision-receipt-v1.schema.json +1 -1
- package/schemas/human-decision-receipt-v2.schema.json +1 -1
- package/schemas/human-decision-request-v1.schema.json +1 -1
- package/schemas/human-decision-request-v2.schema.json +1 -1
- package/schemas/human-decision-resolution-v1.schema.json +1 -1
- package/schemas/human-decision-resolution-v2.schema.json +1 -1
- package/schemas/human-decision-settlement-v1.schema.json +1 -1
- package/skills/autodoc/SKILL.md +33 -2
- package/skills/autoimplement/SKILL.md +66 -12
- package/skills/autoplan/SKILL.md +26 -2
- package/skills/monitor/SKILL.md +35 -21
- package/skills/pi-workflows/SKILL.md +19 -5
- package/src/builtins/autoimplement-command-batches.ts +364 -0
- package/src/builtins/autoimplement.workflow.ts +1065 -261
- package/src/builtins/catalog.ts +3 -1
- package/src/builtins/index.ts +13 -0
- package/src/builtins/sanity-check-session.ts +205 -0
- package/src/builtins/sanity-check.workflow.ts +624 -0
- package/src/controllers/sqlite.ts +580 -7
- package/src/extension/decision-channels.ts +7 -7
- package/src/extension/deferred-turn-coordinator.ts +171 -0
- package/src/extension/deferred-turn.ts +166 -0
- package/src/extension/index.ts +359 -49
- package/src/extension/step-message.ts +1 -0
- package/src/herdr/setup.ts +4 -4
- package/src/workflows/command-batch.ts +254 -0
- package/src/workflows/engine.ts +8 -5
- package/src/workflows/index.ts +15 -0
- package/src/workflows/schema.ts +2 -1
- package/src/workflows/shell.ts +10 -0
- package/src/workflows/store.ts +3 -1
- package/src/workflows/types.ts +4 -3
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
# Deferred workflow turns
|
|
2
|
+
|
|
3
|
+
This specification defines how Pi Workflows schedules one successor agent turn after a workflow event stops or strands the current turn. It covers cancellation, timeout, terminal failure, launch failure, controller interruption, and claim loss.
|
|
4
|
+
|
|
5
|
+
The implementation plan is [Guarantee one successor turn after workflow interruption](plans/2026-08-21-deferred-turn-intents-plan.md).
|
|
6
|
+
|
|
7
|
+
## Terms
|
|
8
|
+
|
|
9
|
+
- **Source event:** The workflow event that creates the need for another turn.
|
|
10
|
+
- **Turn intent:** The durable obligation to send one successor turn.
|
|
11
|
+
- **Natural successor:** The next workflow agent prompt or result presentation.
|
|
12
|
+
- **Fallback:** A factual model-facing message sent when no natural successor remains.
|
|
13
|
+
- **Resolution:** The recorded fact that one message path satisfied the intent.
|
|
14
|
+
- **Target session:** The Pi session that owns the successor turn.
|
|
15
|
+
|
|
16
|
+
## Core rule
|
|
17
|
+
|
|
18
|
+
Each eligible source event creates at most one turn intent. Exactly one of these message paths can resolve it:
|
|
19
|
+
|
|
20
|
+
1. a workflow agent prompt;
|
|
21
|
+
2. a completed or waiting result presentation;
|
|
22
|
+
3. a factual fallback.
|
|
23
|
+
|
|
24
|
+
All three paths claim the same intent before sending. A resolved intent cannot start another turn.
|
|
25
|
+
|
|
26
|
+
Cancellation and process termination remain immediate. Pi Workflows does not keep the old assistant turn alive and does not wait for the successor before stopping active work.
|
|
27
|
+
|
|
28
|
+
## Intent lifecycle
|
|
29
|
+
|
|
30
|
+
An intent has two stored states:
|
|
31
|
+
|
|
32
|
+
| State | Condition | Meaning |
|
|
33
|
+
| -------- | ------------------------------------------------------------- | --------------------------------------------------------- |
|
|
34
|
+
| Pending | `resolvedAt` is null | No message path has resolved the intent. |
|
|
35
|
+
| Resolved | `resolvedAt`, `resolution`, and `resolutionMessageId` are set | One message path was sent or found in the session branch. |
|
|
36
|
+
|
|
37
|
+
Pending intents have separate fallback eligibility:
|
|
38
|
+
|
|
39
|
+
| Eligibility | Condition | Meaning |
|
|
40
|
+
| ----------- | -------------------- | ---------------------------------------------------------------- |
|
|
41
|
+
| Ineligible | `eligibleAt` is null | A natural workflow prompt or presentation can still arrive. |
|
|
42
|
+
| Eligible | `eligibleAt` is set | Durable state shows that no immediate natural successor remains. |
|
|
43
|
+
|
|
44
|
+
A claim is temporary coordination state. A claim does not resolve an intent. An expired claim can be acquired again.
|
|
45
|
+
|
|
46
|
+
Valid resolutions are:
|
|
47
|
+
|
|
48
|
+
```text
|
|
49
|
+
workflowPrompt | presentation | fallback
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Resolution records message delivery into the Pi session or the presence of the same message in the session branch. It does not prove that a model turn started or completed.
|
|
53
|
+
|
|
54
|
+
## Source events
|
|
55
|
+
|
|
56
|
+
Valid causes are:
|
|
57
|
+
|
|
58
|
+
```text
|
|
59
|
+
agentCancelled | timedOut | failed | launchFailed | controllerInterrupted | claimLost
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The event policy is:
|
|
63
|
+
|
|
64
|
+
| Event | Intent | Fallback rule |
|
|
65
|
+
| -------------------------------------------------------------- | ------------------------------------------------------ | -------------------------------------------------------------------------------------- |
|
|
66
|
+
| Agent calls `workflow cancel` during an active workflow turn | Create before `ctx.abort()` when storage is available. | Make eligible after durable terminal cancellation. |
|
|
67
|
+
| Agent step times out | Create before `ctx.abort()` when storage is available. | Keep ineligible while a recovery prompt can arrive. Make eligible on terminal timeout. |
|
|
68
|
+
| Active workflow turn ends in terminal failure | Create or reuse the abort intent. | Make eligible after durable terminal failure. |
|
|
69
|
+
| Workflow reports started, then crashes before its first prompt | Create after durable failure. | Create as eligible. |
|
|
70
|
+
| Queued launch activation fails | Create after the queue row is durably failed. | Create as eligible. |
|
|
71
|
+
| Controller interrupts an active workflow turn | Create before the turn abort when possible. | Durable terminal or handoff state decides eligibility. |
|
|
72
|
+
| Active workflow turn loses its queue claim | Create before the turn abort when possible. | Keep ineligible while a new owner can continue. |
|
|
73
|
+
| Completed or waiting result has a presentation | Do not create a new intent. | Resolve an existing intent through presentation. |
|
|
74
|
+
| Direct `/workflow cancel` | Do not create. | No automatic model turn. |
|
|
75
|
+
| Workflow pause | Do not create. | No automatic model turn. |
|
|
76
|
+
| User Escape or held workflow | Do not create. | No automatic model turn. |
|
|
77
|
+
| Session shutdown | Do not create. | A closing session cannot start another turn. |
|
|
78
|
+
|
|
79
|
+
A terminal failure after a successful start tool result is eligible even when it did not first call `ctx.abort()`. This rule covers asynchronous runtime validation and startup failures that the user can see in the UI but the model cannot see in its current context.
|
|
80
|
+
|
|
81
|
+
## Stable identity
|
|
82
|
+
|
|
83
|
+
`intentId` is a deterministic digest of:
|
|
84
|
+
|
|
85
|
+
- target session ID;
|
|
86
|
+
- run ID;
|
|
87
|
+
- source event ID;
|
|
88
|
+
- node ID or `$launch`;
|
|
89
|
+
- attempt ID when known;
|
|
90
|
+
- cause.
|
|
91
|
+
|
|
92
|
+
The same source event must always produce the same ID. Reusing an ID with different immutable facts is an error.
|
|
93
|
+
|
|
94
|
+
`sourceEventId` identifies the source transition independently of delivery retries. Terminal handling must reuse an earlier abort event instead of creating a second terminal event for the same interruption.
|
|
95
|
+
|
|
96
|
+
IDs use the existing controller-store key limit of 512 characters. The digest representation must be stable across processes and extension restarts.
|
|
97
|
+
|
|
98
|
+
## Stored record
|
|
99
|
+
|
|
100
|
+
`workflow_turn_intents` lives in the existing controller SQLite database.
|
|
101
|
+
|
|
102
|
+
| Column | Null | Meaning |
|
|
103
|
+
| --------------------------- | ---- | -------------------------------------------- |
|
|
104
|
+
| `intent_id` | No | Deterministic primary key. |
|
|
105
|
+
| `source_event_id` | No | Stable source transition identity. |
|
|
106
|
+
| `run_id` | No | Related workflow run. |
|
|
107
|
+
| `workflow_ref` | No | Workflow identity used in messages. |
|
|
108
|
+
| `target_session_id` | No | Session that can receive the successor. |
|
|
109
|
+
| `cause` | No | Closed cause value. |
|
|
110
|
+
| `node_id` | Yes | Source node when known. |
|
|
111
|
+
| `attempt_id` | Yes | Source attempt when known. |
|
|
112
|
+
| `fallback_facts_json` | No | Bounded factual payload. |
|
|
113
|
+
| `requested_at` | No | Absolute ISO 8601 creation time. |
|
|
114
|
+
| `eligible_at` | Yes | Absolute ISO 8601 fallback eligibility time. |
|
|
115
|
+
| `resolved_at` | Yes | Absolute ISO 8601 resolution time. |
|
|
116
|
+
| `resolution` | Yes | Closed resolution value. |
|
|
117
|
+
| `resolution_message_id` | Yes | Stable message identity. |
|
|
118
|
+
| `delivery_claim_token` | Yes | Current claimant. |
|
|
119
|
+
| `delivery_claim_expires_at` | Yes | Claim expiry as epoch milliseconds. |
|
|
120
|
+
|
|
121
|
+
The table requires these indexes:
|
|
122
|
+
|
|
123
|
+
- unresolved intents by run and target session;
|
|
124
|
+
- unresolved eligible intents by target session, eligibility time, and intent ID.
|
|
125
|
+
|
|
126
|
+
A resolved row has all three resolution fields. A pending row has none of them. A row cannot change immutable identity or source fields after creation.
|
|
127
|
+
|
|
128
|
+
## Fallback facts
|
|
129
|
+
|
|
130
|
+
`fallback_facts_json` uses this versioned camelCase object:
|
|
131
|
+
|
|
132
|
+
```json
|
|
133
|
+
{
|
|
134
|
+
"schema": "pi-workflows.deferred-turn-facts.v1",
|
|
135
|
+
"workflowName": "autoimplement",
|
|
136
|
+
"runId": "20260821T081731Z-autoimplement-407480dd",
|
|
137
|
+
"observedState": "failed",
|
|
138
|
+
"cause": "failed",
|
|
139
|
+
"nodeId": "$launch",
|
|
140
|
+
"attemptId": null,
|
|
141
|
+
"reason": "scope must be a non-empty string",
|
|
142
|
+
"handoff": false
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Rules:
|
|
147
|
+
|
|
148
|
+
- `schema` is required and has the exact value shown above.
|
|
149
|
+
- `workflowName`, `runId`, `observedState`, and `cause` are required strings.
|
|
150
|
+
- `nodeId`, `attemptId`, and `reason` are strings or null.
|
|
151
|
+
- `handoff` is a required boolean.
|
|
152
|
+
- `reason` is safe diagnostic text with at most 8,192 characters.
|
|
153
|
+
- The serialized object is at most 64 KiB.
|
|
154
|
+
- Unknown fields are rejected during alpha.
|
|
155
|
+
- The object must not contain credentials, raw environment values, or unbounded command output.
|
|
156
|
+
|
|
157
|
+
`handoff: true` means another runner can continue. A handoff message must not describe the run as terminal unless separate durable state proves it.
|
|
158
|
+
|
|
159
|
+
## Store operations
|
|
160
|
+
|
|
161
|
+
The controller store provides these internal operations:
|
|
162
|
+
|
|
163
|
+
- `ensureWorkflowTurnIntent`
|
|
164
|
+
- `getWorkflowTurnIntent`
|
|
165
|
+
- `claimWorkflowTurnIntentForRun`
|
|
166
|
+
- `claimEligibleWorkflowTurnIntentsForSession`
|
|
167
|
+
- `makeWorkflowTurnIntentEligible`
|
|
168
|
+
- `resolveWorkflowTurnIntent`
|
|
169
|
+
- `releaseWorkflowTurnIntentClaim`
|
|
170
|
+
- a bounded diagnostic list operation
|
|
171
|
+
|
|
172
|
+
`ensureWorkflowTurnIntent` is idempotent when all immutable fields match. It fails on an identity collision.
|
|
173
|
+
|
|
174
|
+
Claim operations use a caller-supplied token and lease duration. Resolution requires the matching live claim token. Conditional updates ensure that natural delivery and fallback cannot both resolve the same intent.
|
|
175
|
+
|
|
176
|
+
List operations require a positive bounded limit and deterministic ordering.
|
|
177
|
+
|
|
178
|
+
## Abort ordering
|
|
179
|
+
|
|
180
|
+
For an eligible active-turn abort, Pi Workflows performs these steps in order:
|
|
181
|
+
|
|
182
|
+
1. Record abort provenance on the active run.
|
|
183
|
+
2. Build the source event and intent ID.
|
|
184
|
+
3. Attempt to persist the intent.
|
|
185
|
+
4. Record the intent ID in system-abort bookkeeping.
|
|
186
|
+
5. Call `ctx.abort()`.
|
|
187
|
+
|
|
188
|
+
The persistence attempt is synchronous because cancellation immediately crosses the turn boundary. A store failure does not prevent `ctx.abort()`. Terminal handling retries the same intent ID. If retry also fails, Pi Workflows reports that it could not preserve the successor-turn guarantee.
|
|
189
|
+
|
|
190
|
+
## Natural delivery
|
|
191
|
+
|
|
192
|
+
All extension-owned workflow prompts and result presentations pass through one `DeferredTurnCoordinator`.
|
|
193
|
+
|
|
194
|
+
If no intent exists, the coordinator preserves current message content and delivery options.
|
|
195
|
+
|
|
196
|
+
If a pending intent exists, the coordinator:
|
|
197
|
+
|
|
198
|
+
1. waits until the old turn has settled or the session is verified idle;
|
|
199
|
+
2. claims the intent for the run and session;
|
|
200
|
+
3. adds `turnIntentId` to the message details;
|
|
201
|
+
4. sends the normal prompt or presentation;
|
|
202
|
+
5. resolves the intent with the matching resolution and message ID;
|
|
203
|
+
6. releases the claim if sending fails.
|
|
204
|
+
|
|
205
|
+
A prompt generated during abort handling must not be sent into the aborting turn. The coordinator releases it after `agent_settled`.
|
|
206
|
+
|
|
207
|
+
## Fallback delivery
|
|
208
|
+
|
|
209
|
+
Fallback synchronization runs:
|
|
210
|
+
|
|
211
|
+
- after `agent_settled` and system-abort cleanup;
|
|
212
|
+
- when the target session starts;
|
|
213
|
+
- during the existing periodic synchronization pass while the session is idle.
|
|
214
|
+
|
|
215
|
+
The fallback custom message uses this details object:
|
|
216
|
+
|
|
217
|
+
```json
|
|
218
|
+
{
|
|
219
|
+
"schema": "pi-workflows.deferred-turn-message.v1",
|
|
220
|
+
"turnIntentId": "deferred-turn:...",
|
|
221
|
+
"runId": "20260821T081731Z-autoimplement-407480dd",
|
|
222
|
+
"cause": "failed"
|
|
223
|
+
}
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
The message type is `pi-workflows-deferred-turn`. Delivery uses:
|
|
227
|
+
|
|
228
|
+
```ts
|
|
229
|
+
{
|
|
230
|
+
deliverAs: "followUp",
|
|
231
|
+
triggerTurn: true,
|
|
232
|
+
}
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
The visible content reports observed facts and asks the agent to inspect durable state before it decides whether an authorized correction is needed. It does not claim that recovery occurred, resume the old run, or retry work.
|
|
236
|
+
|
|
237
|
+
Fallback delivery is disabled during session shutdown and while a user-interrupted workflow is held.
|
|
238
|
+
|
|
239
|
+
## Delivery recovery
|
|
240
|
+
|
|
241
|
+
Every resolving message includes the intent ID in its custom-message details.
|
|
242
|
+
|
|
243
|
+
Before sending, the coordinator scans the current session branch for that ID. If the message is already present, the coordinator resolves the intent without sending again. This repairs a crash or SQLite failure that occurs after `sendMessage` succeeds but before resolution is stored.
|
|
244
|
+
|
|
245
|
+
Store leases prevent concurrent processes from sending the same resolution. Branch identity handles the remaining send-before-resolution window.
|
|
246
|
+
|
|
247
|
+
## Claim transfer
|
|
248
|
+
|
|
249
|
+
Claim loss stops the old runner's work and all fenced run-bundle writes. The intent stays pending and fallback-ineligible while another runner can resume the run.
|
|
250
|
+
|
|
251
|
+
The new runner's next workflow prompt can resolve the intent. If durable state later proves a terminal outcome with no natural successor, terminal handling makes the intent eligible for fallback to its target session.
|
|
252
|
+
|
|
253
|
+
Time alone does not prove terminal failure.
|
|
254
|
+
|
|
255
|
+
## Launch notifications
|
|
256
|
+
|
|
257
|
+
Workflow-authored `progress` and `final` notifications remain passive. They do not trigger model turns.
|
|
258
|
+
|
|
259
|
+
The `launch_failure` notification kind is removed. Queued launch failure creates an eligible turn intent instead.
|
|
260
|
+
|
|
261
|
+
Pending `launch_failure` rows from the earlier alpha contract are incompatible. Pi Workflows must stop with a clear controller-store reset instruction. It must not reinterpret, migrate, or silently delete those rows.
|
|
262
|
+
|
|
263
|
+
## Availability limits
|
|
264
|
+
|
|
265
|
+
Pi Workflows can guarantee only the facts under its control:
|
|
266
|
+
|
|
267
|
+
- the intent was stored;
|
|
268
|
+
- a claimant acquired it;
|
|
269
|
+
- a custom message was sent or found in the session branch;
|
|
270
|
+
- the local intent was resolved.
|
|
271
|
+
|
|
272
|
+
Pi Workflows cannot guarantee model start or completion with the current Pi API. It also cannot deliver after permanent loss of the process, target session, controller store, machine, or model provider.
|
|
273
|
+
|
|
274
|
+
Undelivered intents remain pending. The implementation does not add a service to process them outside a live Pi session.
|
|
275
|
+
|
|
276
|
+
## Compatibility
|
|
277
|
+
|
|
278
|
+
This is an alpha hard cutover.
|
|
279
|
+
|
|
280
|
+
- Keep `pi-workflows.controller-store.v1`.
|
|
281
|
+
- Add `workflow_turn_intents` to the existing database.
|
|
282
|
+
- Remove the launch-trigger runtime path.
|
|
283
|
+
- Add no v2 schema, compatibility reader, dual write, alias, or feature flag.
|
|
284
|
+
- Keep historical terminal run bundles readable because their contract does not change.
|
|
285
|
+
|
|
286
|
+
## Conformance
|
|
287
|
+
|
|
288
|
+
An implementation conforms when:
|
|
289
|
+
|
|
290
|
+
- one eligible source event produces at most one intent;
|
|
291
|
+
- one intent produces at most one successor message;
|
|
292
|
+
- an agent self-cancel receives one fallback after settlement;
|
|
293
|
+
- an asynchronous crash after a successful start result receives one fallback after settlement;
|
|
294
|
+
- a natural recovery prompt or presentation suppresses fallback by resolving the same intent;
|
|
295
|
+
- direct cancellation, pause, Escape, user hold, and shutdown produce no automatic turn;
|
|
296
|
+
- claim transfer permits natural resolution by the new owner and prevents stale writes;
|
|
297
|
+
- polling, restart, lease expiry, and send-before-resolution failure do not duplicate turns;
|
|
298
|
+
- passive workflow notifications keep their current behavior.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Design philosophy
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
pi-workflows should stay small and easy to combine. A small set of clear, general parts should support many kinds of work.
|
|
4
4
|
|
|
5
5
|
## Primary rule
|
|
6
6
|
|
package/docs/HUMAN_DECISIONS.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Human decisions
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
pi-workflows needs a reusable way to stop at a proposal and wait for a person. The same decision must appear in Pi and Telegram, and either channel must be able to continue the run. Workflows must be able to offer plain choices, choices that collect text, and choices that route back to planning.
|
|
4
4
|
|
|
5
5
|
This document defines that behavior. The implementation is tracked in the [human decision gates plan](plans/2026-08-19-human-decision-gates-plan.md).
|
|
6
6
|
|
|
@@ -197,7 +197,7 @@ Private configuration maps the audience to channels:
|
|
|
197
197
|
|
|
198
198
|
The workflow never receives a bot token, user ID, chat ID, Telegram message ID, or Pi session detail. Channel profiles are private host configuration and are excluded from run presentation.
|
|
199
199
|
|
|
200
|
-
|
|
200
|
+
pi-workflows keeps credential references in a separate private file. A Telegram credential points to an existing absolute mode-`0600` token file:
|
|
201
201
|
|
|
202
202
|
```json
|
|
203
203
|
{
|
|
@@ -254,11 +254,11 @@ The adapter does not infer a choice from ordinary chat text. Callback payloads c
|
|
|
254
254
|
|
|
255
255
|
Telegram permits one long-polling consumer for a bot profile. Active Pi processes use a shared lease so one process owns polling and the others use the same private channel state. The lease owner can accept a verified reply, but only the Pi session that owns the waiting run creates its continuation. Active sessions inspect the durable accepted-answer fence and recover their own continuation. If no Pi process is running, Telegram delivery and reply collection resume when Pi starts again. Running an always-on service is outside this design.
|
|
256
256
|
|
|
257
|
-
The Bot API does not provide an idempotency key for `sendMessage`.
|
|
257
|
+
The Bot API does not provide an idempotency key for `sendMessage`. pi-workflows therefore writes a delivery intent before sending and never blindly retries an ambiguous send. A timed-out send is recorded as `unknown`; Pi remains available and an operator can request another delivery. This avoids automatic duplicate messages while keeping decision acceptance exactly once.
|
|
258
258
|
|
|
259
259
|
## Durable decision records
|
|
260
260
|
|
|
261
|
-
Decision records live next to workflow run bundles under the
|
|
261
|
+
Decision records live next to workflow run bundles under the pi-workflows state root. They are additive and linked by run ID. A decision directory contains immutable records for:
|
|
262
262
|
|
|
263
263
|
- the request;
|
|
264
264
|
- channel delivery intents and results;
|
|
@@ -276,7 +276,7 @@ SQLite may index pending decisions and channel leases, but immutable decision fi
|
|
|
276
276
|
|
|
277
277
|
## Planning workflow composition
|
|
278
278
|
|
|
279
|
-
|
|
279
|
+
pi-workflows keeps solution choice, documentation, and implementation in separate built-ins:
|
|
280
280
|
|
|
281
281
|
- `autoplan` chooses a solution or revises one after new evidence.
|
|
282
282
|
- `autodoc` records an already selected solution in the canonical specification and implementation plan. It does not choose a solution or implement it.
|
|
@@ -290,7 +290,7 @@ If later implementation, verification, review, comments, or CI evidence invalida
|
|
|
290
290
|
|
|
291
291
|
## Reusable plan approval workflow
|
|
292
292
|
|
|
293
|
-
|
|
293
|
+
pi-workflows ships a typed `plan-approval` workflow built on `humanDecision()`. Its input contains the documented plan, plan digest, audience, and display summary. It has three named exits:
|
|
294
294
|
|
|
295
295
|
- `continue`, with the approval receipt;
|
|
296
296
|
- `stop`, with the stop receipt; and
|
|
@@ -345,7 +345,7 @@ The engine remains independent from Pi and Telegram. Core code owns decision con
|
|
|
345
345
|
- **Other persistent data:** additive decision records, a rebuildable private channel index, and private channel configuration.
|
|
346
346
|
- **Pi internals:** none.
|
|
347
347
|
- **Public Pi API:** documented extension lifecycle and UI methods only.
|
|
348
|
-
- **Public
|
|
348
|
+
- **Public pi-workflows API:** typed human choices, `humanDecision()`, `humanDecisionEdge()`, the channel interface, and the `plan-approval` workflow.
|
|
349
349
|
|
|
350
350
|
## Verification requirements
|
|
351
351
|
|
|
@@ -7,7 +7,7 @@ The implementation plan is in
|
|
|
7
7
|
[the human decision presentations plan](plans/2026-08-19-human-decision-presentations-plan.md).
|
|
8
8
|
|
|
9
9
|
A human decision contains machine data and a separate message for the operator.
|
|
10
|
-
|
|
10
|
+
pi-workflows stores and validates the machine data. Pi and Telegram render only
|
|
11
11
|
the operator message, and future channels follow the same rule.
|
|
12
12
|
|
|
13
13
|
## Minimal example
|
|
@@ -229,7 +229,7 @@ text prompt. It wraps and scrolls while responding to resize, theme, cancellatio
|
|
|
229
229
|
and `AbortSignal` events.
|
|
230
230
|
|
|
231
231
|
When Telegram or another channel accepts the decision, the signal closes the Pi
|
|
232
|
-
dialog.
|
|
232
|
+
dialog. pi-workflows does not modify Pi core or use undocumented TUI state.
|
|
233
233
|
|
|
234
234
|
### Other channels
|
|
235
235
|
|
|
@@ -239,7 +239,7 @@ for display.
|
|
|
239
239
|
|
|
240
240
|
## Plan presentation
|
|
241
241
|
|
|
242
|
-
|
|
242
|
+
pi-workflows provides a reusable plan presenter for built-in workflows. It
|
|
243
243
|
derives a presentation from the same typed plan stored as the subject.
|
|
244
244
|
|
|
245
245
|
The presenter uses these sections when data exists:
|
package/docs/MONITOR.md
CHANGED
|
@@ -148,9 +148,9 @@ A check may use available tools to read current state. It must use the target's
|
|
|
148
148
|
|
|
149
149
|
## Progress ownership boundary
|
|
150
150
|
|
|
151
|
-
The regular Pi model running the check is the observation adapter. It uses the target-specific tools authorized by the task, converts observed facts into `pi-workflows.progress.v1` tracks, and publishes them through the existing `workflow` tool.
|
|
151
|
+
The regular Pi model running the check is the observation adapter. It uses the target-specific tools authorized by the task, converts observed facts into `pi-workflows.progress.v1` tracks, and publishes them through the existing `workflow` tool. pi-workflows validates, stores, estimates, and displays those tracks.
|
|
152
152
|
|
|
153
|
-
The monitored target stays independent of
|
|
153
|
+
The monitored target stays independent of pi-workflows. A monitor must not require a target Job or application to import pi-workflows, emit a Pi schema, write a Pi progress file, expose a Pi endpoint, create a progress store, or add a progress reader command solely for monitoring. Provider-specific clients and credentials do not belong in pi-workflows.
|
|
154
154
|
|
|
155
155
|
When a target does not expose a factual count, total, or source estimate, the check reports that ETA is unavailable. Better application telemetry is separate work. It should expose normal operational facts for all operators, not a Pi-specific reporting protocol.
|
|
156
156
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Workflow composition
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
pi-workflows can include one workflow inside another without copying nodes, prompts, or routing logic. The included workflow still runs on its own. The parent supplies input and connects the included workflow's named exits to later parent steps.
|
|
4
4
|
|
|
5
5
|
Composition keeps one run, trace, pause state, cancellation state, and final presentation. Controllers remain the correct tool for independent or indefinitely reconciled child runs.
|
|
6
6
|
|
|
@@ -306,7 +306,7 @@ This is a compatible public API addition under the project's pre-1.0 policy. It
|
|
|
306
306
|
- **Other persistent data:** additive source and mount data, definition digests, and include events in existing run bundles.
|
|
307
307
|
- **Pi internals:** none.
|
|
308
308
|
- **Public Pi API:** existing extension APIs only.
|
|
309
|
-
- **Public
|
|
309
|
+
- **Public pi-workflows API:** typed workflow inputs and exits, `includeWorkflow()`, direct imports, dynamic references, and `defineWorkflowRegistry()`.
|
|
310
310
|
|
|
311
311
|
## Required tests
|
|
312
312
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Workflow step messages
|
|
2
2
|
|
|
3
|
-
This specification defines how
|
|
3
|
+
This specification defines how pi-workflows shows agent-step instructions in an interactive Pi session. The model receives the complete step prompt, while the user sees a small workflow card that can be expanded.
|
|
4
4
|
|
|
5
5
|
This contract is implemented for the release after `0.5.3`.
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ This contract is implemented for the release after `0.5.3`.
|
|
|
8
8
|
|
|
9
9
|
Agent-step prompts contain the task, workflow identity, attempt identity, output shape, and submission rules. This information is required by the model, but showing it as a large user message makes the conversation hard to read.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
pi-workflows will send the same prompt as a custom Pi message. A custom renderer will show a compact summary by default and the full content when expanded.
|
|
12
12
|
|
|
13
13
|
This is a presentation change. It does not add a workflow primitive, change graph execution, or change the step completion contract.
|
|
14
14
|
|
|
@@ -85,7 +85,7 @@ The expanded card shows:
|
|
|
85
85
|
- expected output
|
|
86
86
|
- full model prompt
|
|
87
87
|
|
|
88
|
-
Expansion uses Pi's existing custom-message expansion state and keys.
|
|
88
|
+
Expansion uses Pi's existing custom-message expansion state and keys. pi-workflows does not add another toggle or store separate expansion state.
|
|
89
89
|
|
|
90
90
|
## Reminders and resumes
|
|
91
91
|
|
|
@@ -105,9 +105,9 @@ The two message types must not share delivery code that can accidentally change
|
|
|
105
105
|
|
|
106
106
|
New interactive step deliveries replace `sendUserMessage` with `sendMessage`. Existing session entries remain readable and are not rewritten.
|
|
107
107
|
|
|
108
|
-
The custom message is a normal documented Pi session message.
|
|
108
|
+
The custom message is a normal documented Pi session message. pi-workflows adds no Pi session schema, private entry type, or separate persistent store. Run bundles keep the existing full prompt and structured step contract, so this change does not alter the run-bundle schema.
|
|
109
109
|
|
|
110
|
-
If the renderer is unavailable, Pi still retains the custom message content.
|
|
110
|
+
If the renderer is unavailable, Pi still retains the custom message content. pi-workflows does not add a fallback path that sends a duplicate user message.
|
|
111
111
|
|
|
112
112
|
## Public API boundary
|
|
113
113
|
|
package/docs/WORKFLOW_UPDATES.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Workflow updates
|
|
2
2
|
|
|
3
|
-
This specification defines durable, non-terminal updates from running
|
|
3
|
+
This specification defines durable, non-terminal updates from running pi-workflows nodes. An update reports current state without finishing a node or choosing a graph route.
|
|
4
4
|
|
|
5
5
|
## Minimal examples
|
|
6
6
|
|
|
@@ -54,7 +54,7 @@ The `update` tool action does not complete the agent step. The agent still calls
|
|
|
54
54
|
|
|
55
55
|
## Place in the workflow model
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
pi-workflows keeps its current node primitives:
|
|
58
58
|
|
|
59
59
|
- `agent` for model judgment and language work
|
|
60
60
|
- `compute` for pure local calculation
|
|
@@ -76,11 +76,34 @@ Updates do not:
|
|
|
76
76
|
|
|
77
77
|
A node's final result remains the only value that completes the node and controls routing.
|
|
78
78
|
|
|
79
|
+
## Command batch updates
|
|
80
|
+
|
|
81
|
+
A bounded command-batch action can publish one metadata update when an item settles:
|
|
82
|
+
|
|
83
|
+
```json
|
|
84
|
+
{
|
|
85
|
+
"type": "command-batch.item",
|
|
86
|
+
"key": "review/4f2a9c1d",
|
|
87
|
+
"data": {
|
|
88
|
+
"schema": "pi-workflows.command-batch-item.v1",
|
|
89
|
+
"batchKind": "review",
|
|
90
|
+
"itemId": "4f2a9c1d",
|
|
91
|
+
"outcome": "succeeded",
|
|
92
|
+
"completed": 2,
|
|
93
|
+
"total": 4
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
`batchKind` identifies `review`, `ciWatch`, or `verification`. `outcome` is `succeeded`, `failed`, `timedOut`, or `cancelled`. `completed` and `total` are observed command counts. The key stays stable for one batch item.
|
|
99
|
+
|
|
100
|
+
These updates do not contain stdout, stderr, command environments, credentials, or private provider data. The accepted action output contains command receipts and controls workflow routing. A command-batch update cannot satisfy review, CI, or verification. If an unaccepted batch runs again after interruption, its earlier updates remain diagnostic records only.
|
|
101
|
+
|
|
79
102
|
## Model-mediated observation
|
|
80
103
|
|
|
81
104
|
For monitoring, the regular Pi model running the workflow step observes the external target and publishes progress with the existing `workflow` tool. This is the intended adapter boundary. Deterministic runtime code validates, persists, estimates, and renders the submitted data.
|
|
82
105
|
|
|
83
|
-
External Jobs and applications do not need a
|
|
106
|
+
External Jobs and applications do not need a pi-workflows dependency or reporting protocol. Provider-specific observation stays in the agent task and its authorized tools. If the target does not expose enough facts, the model publishes only what is known and leaves ETA unavailable.
|
|
84
107
|
|
|
85
108
|
Do not add a transport, endpoint, store, schema, or provider integration when the regular Pi model can observe the target and use `workflow update` or `submit`.
|
|
86
109
|
|
|
@@ -333,7 +356,7 @@ Fields:
|
|
|
333
356
|
|
|
334
357
|
A progress object is a full snapshot for its key. Omitted optional fields clear their previous values. Publishers mark finished tracks with a terminal status instead of deleting them.
|
|
335
358
|
|
|
336
|
-
The reserved key `overall` represents an explicit aggregate supplied by the workflow.
|
|
359
|
+
The reserved key `overall` represents an explicit aggregate supplied by the workflow. pi-workflows never combines unrelated tracks automatically. Without `overall`, displays list independent tracks.
|
|
337
360
|
|
|
338
361
|
Unknown fields in `pi-workflows.progress.v1` are validation errors.
|
|
339
362
|
|
|
@@ -355,7 +378,7 @@ A measured ETA requires a known total and at least two usable samples in the cur
|
|
|
355
378
|
|
|
356
379
|
The median interval rate is the central estimate. The 25th and 75th percentile rates form the ETA range. The faster rate gives the lower remaining-time bound and the slower rate gives the upper bound. One usable interval has low confidence. With two through four intervals, a ratio of interquartile range to median no greater than 0.5 gives medium confidence; a wider spread gives low confidence. With five or more intervals, a ratio no greater than 0.25 gives high confidence, a ratio through 0.5 gives medium confidence, and a wider spread gives low confidence. A non-positive median makes ETA unavailable. A non-positive lower rate removes the upper time bound, so the formatter shows the central ETA with low confidence instead of a closed range.
|
|
357
380
|
|
|
358
|
-
A fresh `sourceEstimatedFinishAt` takes priority over a measured ETA and is labelled as a source estimate. It is fresh when it comes from the latest track update, is later than the matching `sourceUpdatedAt` or runtime receipt time, and has not passed. When `sourceUpdatedAt` is absent, the runtime receipt time is the source time. A passed source estimate is expired and does not override a measured estimate.
|
|
381
|
+
A fresh `sourceEstimatedFinishAt` takes priority over a measured ETA and is labelled as a source estimate. It is fresh when it comes from the latest track update, is later than the matching `sourceUpdatedAt` or runtime receipt time, and has not passed. When `sourceUpdatedAt` is absent, the runtime receipt time is the source time. A passed source estimate is expired and does not override a measured estimate. pi-workflows does not ask a model to invent an ETA. When the target supplies no usable estimate and the samples cannot support one, the formatter says `ETA unavailable` and states the reason.
|
|
359
382
|
|
|
360
383
|
For `waiting` or `blocked` tracks, measured ETA is paused and the display reports the current state. A source estimate may still be shown when the target reports one. For terminal tracks, remaining work and ETA are omitted.
|
|
361
384
|
|
|
@@ -8,7 +8,7 @@ status: implemented
|
|
|
8
8
|
|
|
9
9
|
# Controller runtime plan
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
pi-workflows needs a controller mode for automation that spans repeated events, external state changes, and process restarts. The design in [CONTROLLERS.md](../CONTROLLERS.md) follows the Kubernetes controller pattern. Durable resources hold desired and observed state, events enqueue resource keys, and each reconciliation reads current facts before acting.
|
|
12
12
|
|
|
13
13
|
The implementation keeps the graph engine focused on finite jobs. Controllers start and observe workflows through a child-run interface. Workflow graphs keep their finite execution model.
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@ status: implemented
|
|
|
8
8
|
|
|
9
9
|
# Always-on workflows plan
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
pi-workflows should feel the same whether the user watches a run or walks away from it. In the user's words: "I might start a workflow locally in Pi then I wait for it to complete. All the while I am looking at the screen and I'm not closing the Pi window. When the workflow ends I just want to be able to continue the same Pi session like normal with a session up to date with what happened in the workflow." And: "I just want to interact by starting a workflow, closing it, and then coming back and then still being able to continue it when I open it up. It's syncing continuously or something."
|
|
12
12
|
|
|
13
13
|
These are not two modes. The user asked for "both in a single unified system." This plan makes the Pi window irrelevant to execution: closing or opening the window is a change in observation, not in the run. The work stays on one machine, uses the merged controller runtime as its foundation, and does not modify Pi core.
|
|
14
14
|
|
|
@@ -10,7 +10,7 @@ status: implemented
|
|
|
10
10
|
|
|
11
11
|
The user should be able to tell an agent, "Monitor this every 30 minutes," and have the agent start the right workflow. The user must not write controller records or JSON. The existing `workflow` model tool should manage workflows instead of serving only as a step-submission tool.
|
|
12
12
|
|
|
13
|
-
A monitor is one
|
|
13
|
+
A monitor is one pi-workflows graph. It checks the target, reports a meaningful change, sleeps for the requested interval with the existing shell node, and loops. This plan does not use controllers, Unified Exec, a new wait node, or a second scheduler.
|
|
14
14
|
|
|
15
15
|
## Shipped design
|
|
16
16
|
|
|
@@ -84,11 +84,11 @@ The `list` result identifies `monitor` as a built-in workflow and gives a short
|
|
|
84
84
|
|
|
85
85
|
## Built-in monitor workflow
|
|
86
86
|
|
|
87
|
-
Ship `monitor` as a built-in workflow in the
|
|
87
|
+
Ship `monitor` as a built-in workflow in the pi-workflows package. Built-ins have the lowest discovery precedence:
|
|
88
88
|
|
|
89
89
|
1. Project workflows under `.pi/workflows/`
|
|
90
90
|
2. Global workflows under `~/.pi/agent/workflows/`
|
|
91
|
-
3. Workflows bundled with
|
|
91
|
+
3. Workflows bundled with pi-workflows
|
|
92
92
|
|
|
93
93
|
A project or global `monitor.workflow.ts` can therefore replace the default. The built-in remains a real workflow file so run bundles can record its path and source hash with the existing rules.
|
|
94
94
|
|
|
@@ -112,13 +112,13 @@ prepare -> guard -> check
|
|
|
112
112
|
| stop and report -> report-final -> finish
|
|
113
113
|
```
|
|
114
114
|
|
|
115
|
-
`prepare` validates and normalizes the input. `guard` enforces `maxChecks`. `check` is an agent node that performs one observation and returns a validated route, a bounded observation, and an optional report. The next `check` can read the previous accepted `check` output, which
|
|
115
|
+
`prepare` validates and normalizes the input. `guard` enforces `maxChecks`. `check` is an agent node that performs one observation and returns a validated route, a bounded observation, and an optional report. The next `check` can read the previous accepted `check` output, which pi-workflows already keeps for looped nodes.
|
|
116
116
|
|
|
117
117
|
The report nodes write a normal assistant message and then submit an acknowledgement. Keeping reporting after accepted check output prevents the agent from showing a report before the structured result passes validation. The final presentation reports why the monitor stopped without repeating a report that the user already saw.
|
|
118
118
|
|
|
119
|
-
The sleep node uses the existing
|
|
119
|
+
The sleep node uses the existing pi-workflows shell action to launch the current Node executable with a timer. Set the node timeout above the largest supported interval because the engine default is 15 minutes. Set the shell execution timeout above the requested wait by a small fixed margin. Cancellation aborts the timer process immediately.
|
|
120
120
|
|
|
121
|
-
If the Pi TUI or standalone workflow host stops during sleep,
|
|
121
|
+
If the Pi TUI or standalone workflow host stops during sleep, pi-workflows parks the run and kills the shell child. Resuming the run starts that sleep node again from the beginning. This is existing workflow behavior and is acceptable for this feature. No special timer persistence is added.
|
|
122
122
|
|
|
123
123
|
The workflow uses a high but finite `maxSteps` value as a second safety guard. Check and report values have explicit size limits so a long run cannot grow its bundle without bound.
|
|
124
124
|
|
|
@@ -133,7 +133,7 @@ Make the feature in `osolmaz/pi-workflows`:
|
|
|
133
133
|
- Add the built-in monitor workflow and focused tests.
|
|
134
134
|
- Update `README.md` and `docs/workflows.md`.
|
|
135
135
|
|
|
136
|
-
After the upstream change is complete, update the pinned
|
|
136
|
+
After the upstream change is complete, update the pinned pi-workflows commit in OnurPi's thin `packages/workflows` wrapper. Do not add a new OnurPi extension or copy a monitor file into live global state.
|
|
137
137
|
|
|
138
138
|
## State and API impact
|
|
139
139
|
|
|
@@ -141,7 +141,7 @@ After the upstream change is complete, update the pinned Pi Workflows commit in
|
|
|
141
141
|
- **Other persistent data:** No new data model. The feature uses existing run bundles and the existing workflow run queue.
|
|
142
142
|
- **Pi internals:** None.
|
|
143
143
|
- **Pi public API:** `registerTool`, `registerCommand`, `sendUserMessage`, and documented agent and session lifecycle events.
|
|
144
|
-
- **
|
|
144
|
+
- **pi-workflows API:** The workflow definition and run-state models do not change. The model-facing `workflow` tool contract changes, and discovery gains a lowest-priority built-in source.
|
|
145
145
|
|
|
146
146
|
## Non-goals
|
|
147
147
|
|
|
@@ -179,6 +179,6 @@ npx slophammer-ts@latest check . --only ts.dependency-boundaries-required
|
|
|
179
179
|
npx -y @simpledoc/simpledoc check
|
|
180
180
|
```
|
|
181
181
|
|
|
182
|
-
Test the extension from the
|
|
182
|
+
Test the extension from the pi-workflows checkout with `pi -e src/extension/index.ts`. Use a short test interval in a controlled fixture, then perform one manual 30-minute monitor run to confirm that the configured node timeout does not stop it. Test plain-language startup with the normal model, then test list, status, pause, resume, cancel, and checkpoint answer actions.
|
|
183
183
|
|
|
184
184
|
After updating OnurPi, run its full checks and start Pi with the installed OnurPi package. Confirm that the model sees one `workflow` tool, discovers `monitor`, and can start it from a plain-language request.
|
|
@@ -66,7 +66,7 @@ If identity or revision cannot be proved, leave the run unchanged and report a c
|
|
|
66
66
|
|
|
67
67
|
## Scope and non-goals
|
|
68
68
|
|
|
69
|
-
This changes
|
|
69
|
+
This changes pi-workflows only. It uses no Pi internals and changes no Pi session entry. It updates pi-workflows run bundles and controller queue records as described above.
|
|
70
70
|
|
|
71
71
|
It does not add runtime compatibility readers, aliases, dual-write fields, or a permanent migration service. It does not hot-reload package-provided built-ins. A package update takes effect after Pi reload or restart.
|
|
72
72
|
|