@osolmaz/pi-workflows 0.12.0 → 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 +56 -31
- package/dist/builtins/autodoc.workflow.d.ts +4 -4
- package/dist/builtins/autoimplement.workflow.d.ts +797 -142
- package/dist/builtins/autoimplement.workflow.js +17 -105
- 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/index.d.ts +4 -2
- package/dist/builtins/index.js +3 -1
- package/dist/builtins/index.js.map +1 -1
- package/dist/builtins/monitor.workflow.d.ts +56 -23
- package/dist/builtins/monitor.workflow.js +508 -329
- package/dist/builtins/monitor.workflow.js.map +1 -1
- package/dist/builtins/pi-agent-group.d.ts +72 -0
- package/dist/builtins/pi-agent-group.js +1087 -0
- package/dist/builtins/pi-agent-group.js.map +1 -0
- 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-approval.workflow.d.ts +39 -5
- package/dist/builtins/plan-approval.workflow.js +92 -14
- package/dist/builtins/plan-approval.workflow.js.map +1 -1
- package/dist/builtins/plan-change.workflow.d.ts +449 -0
- package/dist/builtins/plan-change.workflow.js +256 -0
- package/dist/builtins/plan-change.workflow.js.map +1 -0
- package/dist/builtins/plan-presentation.js +2 -2
- package/dist/builtins/plan-presentation.js.map +1 -1
- package/dist/builtins/sanity-check.workflow.d.ts +50 -6
- package/dist/builtins/sanity-check.workflow.js +150 -28
- 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 +4 -2
- package/dist/extension/decision-channels.js +333 -146
- 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 +209 -127
- 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/session-events.d.ts +2 -2
- 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 +29 -3
- 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 +15 -10
- 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 +9 -23
- 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/catalog.js +7 -2
- package/dist/workflows/catalog.js.map +1 -1
- package/dist/workflows/composition.js +20 -2
- package/dist/workflows/composition.js.map +1 -1
- package/dist/workflows/decision-presentation.d.ts +1 -1
- package/dist/workflows/decision-presentation.js +51 -38
- package/dist/workflows/decision-presentation.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 +7 -7
- package/dist/workflows/engine.js +196 -115
- package/dist/workflows/engine.js.map +1 -1
- package/dist/workflows/errors.d.ts +16 -3
- package/dist/workflows/errors.js +18 -3
- package/dist/workflows/errors.js.map +1 -1
- package/dist/workflows/human-decision.d.ts +45 -8
- package/dist/workflows/human-decision.js +641 -274
- package/dist/workflows/human-decision.js.map +1 -1
- package/dist/workflows/index.d.ts +5 -6
- package/dist/workflows/index.js +4 -5
- package/dist/workflows/index.js.map +1 -1
- package/dist/workflows/progress.d.ts +1 -0
- package/dist/workflows/progress.js +15 -3
- package/dist/workflows/progress.js.map +1 -1
- package/dist/workflows/schema.js +27 -1
- package/dist/workflows/schema.js.map +1 -1
- package/dist/workflows/store.d.ts +83 -103
- package/dist/workflows/store.js +907 -951
- package/dist/workflows/store.js.map +1 -1
- package/dist/workflows/types.d.ts +88 -126
- 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 +36 -47
- package/docs/HUMAN_DECISION_PRESENTATIONS.md +14 -24
- package/docs/MONITOR.md +179 -237
- package/docs/SQLITE_STATE.md +219 -0
- package/docs/WORKFLOW_COMPOSITION.md +27 -26
- 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 +322 -0
- package/docs/plans/2026-08-21-sanity-check-plan.md +217 -95
- 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 +127 -53
- package/examples/workflows/approved-plan.workflow.ts +19 -46
- package/examples/workflows/plain-summary.workflow.ts +1 -0
- package/herdr-plugin.toml +1 -1
- package/package.json +7 -7
- package/plugins/herdr/viewer.mjs +1 -11
- package/schemas/human-decision-accepted-v1.schema.json +15 -3
- package/schemas/human-decision-continuation-v1.schema.json +10 -1
- package/schemas/human-decision-delivery-v1.schema.json +8 -0
- package/schemas/human-decision-receipt-v1.schema.json +8 -0
- package/schemas/human-decision-request-v1.schema.json +24 -4
- package/skills/autoimplement/SKILL.md +27 -0
- package/skills/autoplan/SKILL.md +5 -4
- package/skills/monitor/SKILL.md +91 -135
- package/skills/pi-workflows/SKILL.md +9 -8
- package/skills/sanity-check/SKILL.md +44 -0
- package/src/builtins/autoimplement.workflow.ts +19 -118
- package/src/builtins/autoplan.workflow.ts +290 -40
- package/src/builtins/catalog.ts +7 -5
- package/src/builtins/index.ts +18 -1
- package/src/builtins/monitor.workflow.ts +673 -382
- package/src/builtins/pi-agent-group.ts +1407 -0
- package/src/builtins/plain-summary.workflow.ts +185 -0
- package/src/builtins/plan-approval.workflow.ts +157 -24
- package/src/builtins/plan-change.workflow.ts +321 -0
- package/src/builtins/plan-presentation.ts +2 -2
- package/src/builtins/sanity-check.workflow.ts +248 -48
- 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 +456 -203
- package/src/extension/executor.ts +105 -2
- package/src/extension/herdr-viewer.ts +0 -5
- package/src/extension/index.ts +251 -151
- package/src/extension/recorder.ts +13 -22
- package/src/extension/session-events.ts +2 -2
- package/src/extension/step-message.ts +106 -4
- package/src/extension/widget.ts +32 -5
- package/src/host/rpc-executor.ts +4 -0
- package/src/host/runner.ts +93 -41
- package/src/render/graph-render.ts +12 -6
- 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 +19 -30
- 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/catalog.ts +7 -2
- package/src/workflows/composition.ts +21 -3
- package/src/workflows/decision-presentation.ts +56 -43
- package/src/workflows/definition.ts +36 -3
- package/src/workflows/engine.ts +228 -130
- package/src/workflows/errors.ts +27 -3
- package/src/workflows/human-decision.ts +921 -349
- package/src/workflows/index.ts +20 -30
- package/src/workflows/progress.ts +18 -3
- package/src/workflows/schema.ts +36 -1
- package/src/workflows/store.ts +1300 -1163
- package/src/workflows/types.ts +100 -137
- package/dist/builtins/sanity-check-session.d.ts +0 -17
- package/dist/builtins/sanity-check-session.js +0 -168
- package/dist/builtins/sanity-check-session.js.map +0 -1
- 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/schemas/human-decision-accepted-v2.schema.json +0 -50
- package/schemas/human-decision-delivery-v2.schema.json +0 -36
- package/schemas/human-decision-receipt-v2.schema.json +0 -39
- package/schemas/human-decision-request-v2.schema.json +0 -69
- package/schemas/human-decision-resolution-v2.schema.json +0 -27
- package/src/builtins/sanity-check-session.ts +0 -205
- package/src/workflows/artifacts.ts +0 -188
- package/src/workflows/migrate-sources.ts +0 -178
|
@@ -1,28 +1,49 @@
|
|
|
1
1
|
---
|
|
2
|
-
title:
|
|
2
|
+
title: Run Sanity Check with Provider Extensions
|
|
3
3
|
author: Onur Solmaz <2453968+osolmaz@users.noreply.github.com>
|
|
4
4
|
date: 2026-08-21
|
|
5
|
+
updated: 2026-08-23
|
|
6
|
+
status: implemented
|
|
5
7
|
---
|
|
6
8
|
|
|
7
|
-
#
|
|
9
|
+
# Run Sanity Check with Provider Extensions
|
|
8
10
|
|
|
9
11
|
## Goal
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
Use direct Pi SDK sessions for the built-in `sanity-check` workflow. Each reviewer gets an independent in-memory context. Each child can load the extension that owns its exact configured model provider, while only the parent workflow action can control workflow state.
|
|
12
14
|
|
|
13
|
-
The
|
|
15
|
+
The child must use the configured provider, model, thinking level, and provider-owned authentication. It must fail before prompting if that exact dispatch is not available. It must never silently use OpenRouter, Kimi, a local model, or another fallback.
|
|
16
|
+
|
|
17
|
+
The workflow keeps only the final bounded answer and safe operational facts. It does not keep child prompts, reasoning, message history, tool arguments, tool results, repository content, credentials, or extension-private state.
|
|
14
18
|
|
|
15
19
|
## Scope
|
|
16
20
|
|
|
17
|
-
The change is limited to
|
|
21
|
+
The change is limited to Pi Workflows. It changes the private SDK agent-group runner, Sanity Check composition, extension admission, model runtime construction, tests, and canonical documentation.
|
|
22
|
+
|
|
23
|
+
The workflow uses existing `action`, `agent`, and `compute` nodes and includes the existing `plain-summary` workflow. `src/workflows` and `WorkflowActionContext` remain Pi-independent. The change does not add a workflow primitive, public agent-group export, persisted schema, child workflow run, service, queue, store, transport, Pi core change, or private Pi API.
|
|
24
|
+
|
|
25
|
+
Sanity Check keeps its existing input, review areas, child prompts, evidence rules, session counts, strict result validation, verdicts, and progress schema. After verification, it shows two ordered normal assistant responses: the full detailed report first, then a short plain-language summary.
|
|
26
|
+
|
|
27
|
+
## Child session contract
|
|
28
|
+
|
|
29
|
+
Each child session:
|
|
18
30
|
|
|
19
|
-
|
|
31
|
+
- has independent in-memory context and history;
|
|
32
|
+
- uses `SessionManager.inMemory` and creates no Pi session file;
|
|
33
|
+
- owns a separate `ModelRuntime`, provider instance, extension runtime, resource loader, and `AgentSession`;
|
|
34
|
+
- can use only the verified built-in `read`, `grep`, `find`, and `ls` tools;
|
|
35
|
+
- may load the extension that registers the exact configured provider;
|
|
36
|
+
- may load another behavior extension only through an explicit private allowlist;
|
|
37
|
+
- loads no skills, prompt templates, themes, or context files;
|
|
38
|
+
- does not receive the workflow tool, workflow commands, parent run id, node id, attempt id, update channel, or workflow callback;
|
|
39
|
+
- returns only bounded final assistant text and bounded safe lifecycle facts;
|
|
40
|
+
- shares the parent Node process and does not provide OS process isolation.
|
|
20
41
|
|
|
21
|
-
|
|
42
|
+
Pi extensions are trusted in-process code. The runner prevents normal model, tool, command, and callback access to workflow state. It does not sandbox an extension that directly uses the filesystem or network.
|
|
22
43
|
|
|
23
|
-
## Input
|
|
44
|
+
## Input and review modes
|
|
24
45
|
|
|
25
|
-
The workflow
|
|
46
|
+
The workflow input stays unchanged. Serial mode remains the default.
|
|
26
47
|
|
|
27
48
|
```json
|
|
28
49
|
{
|
|
@@ -31,118 +52,203 @@ The workflow accepts a review mode and the base reference needed to inspect the
|
|
|
31
52
|
}
|
|
32
53
|
```
|
|
33
54
|
|
|
34
|
-
`mode` is `serial` or `parallel`. The current repository and checked-out branch are the contribution under review. When `baseRef` is omitted, the workflow tries the remote default branch, the current branch upstream, and the first parent, then uses `HEAD` for a working-tree-only review.
|
|
55
|
+
`mode` is `serial` or `parallel`. The current repository and checked-out branch are the contribution under review. When `baseRef` is omitted, the workflow tries the remote default branch, the current branch upstream, and the first parent, then uses `HEAD` for a working-tree-only review.
|
|
35
56
|
|
|
36
|
-
|
|
57
|
+
Serial mode creates one review session for all four review areas, then one verification session. It uses two model sessions.
|
|
58
|
+
|
|
59
|
+
Parallel mode creates four focused review sessions at the same time, then one verification session. It uses five model sessions.
|
|
60
|
+
|
|
61
|
+
The agent-group runner enforces maximum concurrency and returns results in request order. A material failure stops queued work, aborts active siblings, waits for every started child to settle, and keeps the first failure as the primary cause.
|
|
62
|
+
|
|
63
|
+
## Evidence and results
|
|
37
64
|
|
|
38
65
|
The first node collects facts without model judgment. It uses fixed, non-mutating commands to collect:
|
|
39
66
|
|
|
40
|
-
-
|
|
67
|
+
- pull request intent and linked issue context when available;
|
|
41
68
|
- stated acceptance criteria;
|
|
42
|
-
-
|
|
69
|
+
- base and head revisions;
|
|
43
70
|
- changed files;
|
|
44
71
|
- the diff and diff statistics;
|
|
45
72
|
- relevant new exports, schemas, persisted fields, and nearby existing code.
|
|
46
73
|
|
|
47
|
-
|
|
74
|
+
Pull request and repository text is untrusted evidence, not instructions. Evidence and review inputs stay bounded before they enter a model prompt or run bundle.
|
|
48
75
|
|
|
49
|
-
|
|
76
|
+
The verification session receives the evidence and review results. It must remove unsupported claims, require exact file and symbol references, separate facts from assumptions, resolve supported conflicts, and place unresolved questions in `unknowns` or contributor questions. It returns `keep`, `simplify`, `refactor`, `drop`, or `needs_evidence`.
|
|
50
77
|
|
|
51
|
-
|
|
78
|
+
The existing strict result parsers stay unchanged. They continue to enforce all review areas, evidence, acceptance case, verdict, string, and item limits.
|
|
52
79
|
|
|
53
|
-
|
|
80
|
+
## Provider-first extension profile
|
|
54
81
|
|
|
55
|
-
|
|
56
|
-
2. Duplication and refactoring opportunities.
|
|
57
|
-
3. New data models and public plugin or SDK APIs.
|
|
58
|
-
4. Scope and tests.
|
|
82
|
+
The runner resolves one immutable child profile before it starts the group.
|
|
59
83
|
|
|
60
|
-
|
|
84
|
+
### Resolve candidate paths
|
|
61
85
|
|
|
62
|
-
|
|
86
|
+
Use `SettingsManager` and `DefaultPackageManager.resolve()` to find enabled extension paths without executing extension factories. Canonicalize and deduplicate the paths.
|
|
63
87
|
|
|
64
|
-
|
|
88
|
+
The default candidate set contains enabled user-scope extensions. Project extensions are excluded unless the private policy admits them explicitly. Direct and wrapper paths for Pi Workflows are excluded before any extension factory runs.
|
|
65
89
|
|
|
66
|
-
|
|
67
|
-
2. Duplication and refactoring opportunities.
|
|
68
|
-
3. New data models and public plugin or SDK APIs.
|
|
69
|
-
4. Scope and tests.
|
|
90
|
+
### Preflight provider ownership
|
|
70
91
|
|
|
71
|
-
|
|
92
|
+
Load candidate extensions in a no-session `DefaultResourceLoader` preflight. Pass the paths through `additionalExtensionPaths` and set `noExtensions: true` so the loader does not perform a second discovery pass.
|
|
72
93
|
|
|
73
|
-
|
|
94
|
+
Inspect documented pending native and legacy provider registrations. Admit the one extension path that registers the exact configured provider. Permit other behavior extensions only through an explicit private allowlist.
|
|
74
95
|
|
|
75
|
-
|
|
96
|
+
Fail before session creation when:
|
|
76
97
|
|
|
77
|
-
-
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
81
|
-
-
|
|
82
|
-
-
|
|
98
|
+
- no extension registers the configured provider;
|
|
99
|
+
- more than one extension claims the configured provider;
|
|
100
|
+
- an extension fails to load;
|
|
101
|
+
- an admitted extension registers a reserved workflow tool or command;
|
|
102
|
+
- an extension replaces `read`, `grep`, `find`, or `ls`;
|
|
103
|
+
- a loaded path is outside the frozen candidate snapshot.
|
|
83
104
|
|
|
84
|
-
|
|
105
|
+
Before invalidation, dispatch `session_shutdown` through a temporary public `ExtensionRunner` so factory-owned setup can clean up. Preflight does not create a session or dispatch `session_start`. Always invalidate the preflight extension runtime in `finally`.
|
|
85
106
|
|
|
86
|
-
|
|
107
|
+
Extension factories run before their registrations can be inspected. Pi documents that factories must not start background resources. Pi Workflows relies on that contract and does not claim to contain a factory that violates it.
|
|
87
108
|
|
|
88
|
-
|
|
109
|
+
## Exact model dispatch
|
|
89
110
|
|
|
90
|
-
|
|
111
|
+
Resolve one immutable `{ provider, modelId, thinkingLevel }` value for the group. A complete explicit override wins. Otherwise, use the configured `SettingsManager` defaults. Reject partial overrides, missing defaults, unsupported thinking values, and prompts that start with an extension slash command.
|
|
91
112
|
|
|
92
|
-
|
|
113
|
+
Read and strictly validate the configured cached model catalog once. Keep it as an in-memory group snapshot. Create a deep-cloned in-memory model store for each child. Do the same for ordinary Pi credentials read from `auth.json`. Pi Workflows never writes these snapshots back.
|
|
93
114
|
|
|
94
|
-
|
|
115
|
+
Provider extensions use their existing provider-owned credential store in place. Pi Workflows does not copy, inspect, print, migrate, or persist those credentials.
|
|
95
116
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
117
|
+
For each child:
|
|
118
|
+
|
|
119
|
+
1. Create a fresh non-networked `ModelRuntime` from cloned snapshots.
|
|
120
|
+
2. Create a fresh resource loader with only the frozen admitted extension paths.
|
|
121
|
+
3. Disable secondary extension discovery, skills, prompt templates, themes, and context files.
|
|
122
|
+
4. Load a fresh extension and provider instance.
|
|
123
|
+
5. Find the exact cached model and pass it to `createAgentSession`.
|
|
124
|
+
6. Pass the exact configured thinking level.
|
|
125
|
+
7. Verify the session's actual provider, model, thinking level, authentication, extension state, active tools, and built-in tool sources.
|
|
126
|
+
8. Start the prompt only after all checks pass.
|
|
127
|
+
|
|
128
|
+
Any mismatch is terminal. The runner does not select another provider, model, or thinking level.
|
|
129
|
+
|
|
130
|
+
A transient model selected only in the parent TUI is not inherited. The runner enforces the configured process default unless the private request gives a complete explicit dispatch.
|
|
131
|
+
|
|
132
|
+
## Workflow authority boundary
|
|
133
|
+
|
|
134
|
+
The parent Sanity Check action is the only workflow owner.
|
|
135
|
+
|
|
136
|
+
Children receive only the built-in read-only tool instances requested by Sanity Check. Extension tools can register but remain inactive. The runner rejects same-name replacements for the built-in tools.
|
|
137
|
+
|
|
138
|
+
Children receive no:
|
|
105
139
|
|
|
106
|
-
|
|
140
|
+
- `workflow` tool;
|
|
141
|
+
- `/workflow`, `/piw`, `/controller`, or workflow-channel command;
|
|
142
|
+
- run, node, or attempt identifier;
|
|
143
|
+
- workflow update, answer, submit, pause, resume, or cancel callback;
|
|
144
|
+
- child workflow run or parent workflow handle.
|
|
145
|
+
|
|
146
|
+
The runner rejects prompts that would invoke extension slash commands. These controls prevent the normal child model and admitted extension bindings from inspecting or changing workflow state.
|
|
147
|
+
|
|
148
|
+
## Lifecycle and privacy
|
|
149
|
+
|
|
150
|
+
One owner controls each child from creation through cleanup.
|
|
151
|
+
|
|
152
|
+
The owner:
|
|
153
|
+
|
|
154
|
+
1. Creates the child runtime and session.
|
|
155
|
+
2. Subscribes before prompting.
|
|
156
|
+
3. Emits only bounded safe lifecycle phases.
|
|
157
|
+
4. Waits for prompt settlement.
|
|
158
|
+
5. Extracts only the latest final assistant text.
|
|
159
|
+
6. Bounds the returned text before validation.
|
|
160
|
+
7. Calls and awaits `abort()` on timeout or cancellation.
|
|
161
|
+
8. Waits for prompt settlement after abort.
|
|
162
|
+
9. Unsubscribes.
|
|
163
|
+
10. Disposes the session so extension shutdown runs.
|
|
164
|
+
11. Invalidates remaining extension runtime state.
|
|
165
|
+
12. Releases provider resources.
|
|
166
|
+
|
|
167
|
+
Cleanup runs for success, creation failure, authentication failure, provider failure, malformed output, timeout, parent cancellation, sibling failure, and disposal failure. A cleanup failure remains a bounded secondary diagnostic and does not replace an earlier primary error.
|
|
168
|
+
|
|
169
|
+
The workflow never copies extension events or extension-private state into progress or run bundles.
|
|
170
|
+
|
|
171
|
+
## Progress and visibility
|
|
172
|
+
|
|
173
|
+
Sanity Check keeps the existing `pi-workflows.progress.v1` records and keys:
|
|
107
174
|
|
|
108
175
|
```text
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
176
|
+
agents/review
|
|
177
|
+
agents/review/necessity
|
|
178
|
+
agents/review/duplication
|
|
179
|
+
agents/review/contracts
|
|
180
|
+
agents/review/scope_tests
|
|
181
|
+
agents/verification
|
|
182
|
+
agents/verification/verification
|
|
116
183
|
```
|
|
117
184
|
|
|
118
|
-
|
|
185
|
+
Aggregate tracks report completed and total sessions. Child tracks report a bounded role label, the verified actual model when known, and a safe phase such as `starting`, `thinking`, `tool: read`, `finalizing`, or a terminal phase.
|
|
119
186
|
|
|
120
|
-
|
|
187
|
+
Updates are deduplicated, throttled, and observational. They cannot change agent execution.
|
|
121
188
|
|
|
122
|
-
|
|
189
|
+
The Pi widget shows the aggregate plus failed and active children within its ten-line limit. `piw` shows all durable child tracks and samples. Both views use existing progress records. No new persisted field or schema is added.
|
|
123
190
|
|
|
124
|
-
|
|
191
|
+
## Ordered assistant reports
|
|
125
192
|
|
|
126
|
-
|
|
193
|
+
After strict verification succeeds, an assistant-message `agent` shows the complete bounded report. Its prompt supplies the deterministic report and requires a verbatim response without tools. A mismatch stops before summary generation. This replaces the old final workflow notification.
|
|
194
|
+
|
|
195
|
+
The graph then includes `plain-summary`. The summarizer receives the verified verdict and detailed report, keeps the verdict, and writes one short plain-language response. It uses the plain-summary workflow limits of 2,000 characters and five sentences. The detailed response always settles before the summary starts.
|
|
196
|
+
|
|
197
|
+
Neither response uses `presentationPrompt`, and neither can change the verified verdict. A final compute node returns the original strict `SanityCheckResult` as the workflow result. Both visible responses and their normal assistant receipts use existing Pi session and SQLite records. A detached host parks before these session-visible nodes until the origin Pi session can continue them.
|
|
198
|
+
|
|
199
|
+
## Implementation plan
|
|
127
200
|
|
|
128
|
-
|
|
201
|
+
1. Update the Pi SDK development baseline to one compatible 0.84.x release. Keep the Pi coding-agent, Pi AI, and Pi TUI packages aligned and set an honest peer compatibility floor. Do not add Pi Factory or a provider extension as a dependency.
|
|
202
|
+
2. Add the private dispatch and child extension profile contracts under `src/builtins`. Do not export them from package entry points.
|
|
203
|
+
3. Resolve enabled extension paths without execution. Canonicalize paths, exclude project extensions by default, and exclude direct and wrapper Pi Workflows paths.
|
|
204
|
+
4. Add the no-session extension preflight. Identify the exact native or legacy provider owner and reject reserved workflow capabilities, provider conflicts, load errors, and built-in tool overrides.
|
|
205
|
+
5. Keep the model-catalog snapshot work, but change it to one validated group snapshot and one clone per child. Add the same ownership for ordinary Pi credentials. Remove the previous empty-catalog behavior.
|
|
206
|
+
6. Replace the shared group `ModelRuntime` with one complete runtime per child.
|
|
207
|
+
7. Verify exact provider, model, thinking, authentication, admitted extensions, active tools, and tool sources before every prompt.
|
|
208
|
+
8. Complete provider, extension, and session cleanup on every exit path.
|
|
209
|
+
9. Pass the private profile and exact dispatch through Sanity Check without changing its review behavior or progress schema. Remove any `--no-extensions` launch guidance.
|
|
210
|
+
10. Add the ordered detailed assistant response and included plain summary, then return the original verified result from a final compute node.
|
|
211
|
+
11. Change the built-in Sanity Check revision from 3 to 4 for the presentation graph change.
|
|
212
|
+
12. Add temporary fixture extensions and full unit, integration, interactive Pi, and standalone host coverage.
|
|
213
|
+
13. Update this plan and `docs/workflows.md` to match the shipped behavior.
|
|
214
|
+
14. Run the complete repository gate and inspect the full public diff.
|
|
215
|
+
15. After mock-provider verification of the provider architecture, run one bounded real acceptance on OpenClaw pull request 126028 with `openai-codex/gpt-5.6-sol` and high thinking. Abort immediately if any child reports another provider or model. Do not modify OpenClaw.
|
|
129
216
|
|
|
130
|
-
|
|
131
|
-
- serial mode starting exactly one review session and one verification session;
|
|
132
|
-
- parallel mode starting exactly four concurrent review sessions and one verification session;
|
|
133
|
-
- the four required review areas;
|
|
134
|
-
- the acceptance case and evidence requirements in every review prompt;
|
|
135
|
-
- read-only child tool arguments and disabled session, extension, and skill discovery;
|
|
136
|
-
- structured result validation and all five verdicts;
|
|
137
|
-
- unsupported and conflicting finding handling in the verification prompt;
|
|
138
|
-
- bounded output and error handling;
|
|
139
|
-
- child failure, malformed output, timeout, cancellation, and process cleanup;
|
|
140
|
-
- final notification delivery without a model turn;
|
|
141
|
-
- built-in discovery and export behavior.
|
|
217
|
+
## Revision and compatibility
|
|
142
218
|
|
|
143
|
-
|
|
219
|
+
Sanity Check revision 3 introduced the provider-first child runtime. Revision 4 replaces the final notification with the ordered detailed and plain assistant responses.
|
|
144
220
|
|
|
145
|
-
|
|
221
|
+
This is an alpha hard cutover. Do not retain the revision-3 notification graph, compatibility runner, migration, alias, dual path, or feature flag. An unfinished revision-3 run must fail with clear cancel-and-restart guidance. Terminal older runs remain readable historical evidence because the persisted schema does not change.
|
|
222
|
+
|
|
223
|
+
## Tests
|
|
224
|
+
|
|
225
|
+
Unit and integration tests must cover:
|
|
226
|
+
|
|
227
|
+
- dispatch parsing and exact provider, model, and thinking enforcement;
|
|
228
|
+
- missing authentication and no fallback;
|
|
229
|
+
- extension path resolution, canonicalization, scope filtering, disabled paths, and explicit behavior paths;
|
|
230
|
+
- direct and wrapper Pi Workflows exclusion;
|
|
231
|
+
- native and legacy provider-owner discovery;
|
|
232
|
+
- reserved workflow command and tool rejection;
|
|
233
|
+
- inactive extension tools and built-in tool override rejection;
|
|
234
|
+
- per-child runtime, provider, extension, loader, and history isolation under parallel execution;
|
|
235
|
+
- validated model and credential snapshots, deep clones, cancellation, malformed input, and no writes;
|
|
236
|
+
- provider-owned mock authentication without credential exposure;
|
|
237
|
+
- success, provider error, empty output, malformed output, oversized output, timeout, cancellation, fail-fast, and cleanup-error precedence;
|
|
238
|
+
- final-only retention and absence of private child content in results, errors, updates, and bundles;
|
|
239
|
+
- serial two-session and parallel five-session behavior;
|
|
240
|
+
- existing progress keys, model labels, throttling, and rendering;
|
|
241
|
+
- interactive Pi with normal extensions enabled and the local mock provider;
|
|
242
|
+
- standalone `WorkflowHost` through the same private runtime path;
|
|
243
|
+
- no child session files or child workflow runs;
|
|
244
|
+
- built-in revision 4 and historical terminal run reading;
|
|
245
|
+
- one full detailed assistant response followed by one short plain-language assistant response;
|
|
246
|
+
- unchanged strict final result after both visible responses;
|
|
247
|
+
- no final notification or root presentation turn.
|
|
248
|
+
|
|
249
|
+
Tests use mock providers and temporary directories. They do not call real models or write outside temporary directories.
|
|
250
|
+
|
|
251
|
+
Before completion, run:
|
|
146
252
|
|
|
147
253
|
```bash
|
|
148
254
|
npm run check
|
|
@@ -151,25 +257,41 @@ npx slophammer-ts@latest dry .
|
|
|
151
257
|
npx slophammer-ts@latest check . --only ts.dependency-boundaries-required
|
|
152
258
|
```
|
|
153
259
|
|
|
260
|
+
After these checks and Pi Reviewer pass, perform the one explicitly authorized bounded GPT-5.6 Sol acceptance run.
|
|
261
|
+
|
|
154
262
|
## Acceptance criteria
|
|
155
263
|
|
|
156
264
|
The implementation is complete when:
|
|
157
265
|
|
|
158
|
-
- `/workflow sanity-check` discovers
|
|
159
|
-
-
|
|
160
|
-
- serial mode uses two
|
|
161
|
-
- parallel mode uses five
|
|
162
|
-
- child
|
|
163
|
-
-
|
|
164
|
-
-
|
|
165
|
-
-
|
|
166
|
-
-
|
|
167
|
-
-
|
|
266
|
+
- `/workflow sanity-check` discovers built-in revision 4;
|
|
267
|
+
- the parent Pi process runs with its normal configured extensions;
|
|
268
|
+
- serial mode uses two independent in-memory SDK sessions;
|
|
269
|
+
- parallel mode uses five independent in-memory SDK sessions, with four reviews running concurrently;
|
|
270
|
+
- every child loads the extension that owns the exact configured provider;
|
|
271
|
+
- every child reports the exact required provider, model, and thinking level before prompting;
|
|
272
|
+
- no child silently falls back to OpenRouter, Kimi, a local model, or another dispatch;
|
|
273
|
+
- children use only verified built-in read-only tools and create no session files;
|
|
274
|
+
- children cannot use normal workflow tools, commands, identifiers, or callbacks;
|
|
275
|
+
- the workflow keeps only bounded final answers and safe operational facts;
|
|
276
|
+
- child prompts, reasoning, tool payloads, histories, credentials, and extension state do not enter run bundles or progress updates;
|
|
277
|
+
- provider, extension, and session cleanup completes on every exit path;
|
|
278
|
+
- Sanity Check review behavior, strict validation, verdicts, and progress remain unchanged;
|
|
279
|
+
- the full detailed assistant response appears before the short plain-language summary;
|
|
280
|
+
- the final workflow result remains the strict verified result;
|
|
281
|
+
- interactive and headless runs use the same private SDK path, while session-visible reports wait for the origin Pi session;
|
|
282
|
+
- all required checks pass with coverage margin;
|
|
283
|
+
- the bounded acceptance run on OpenClaw pull request 126028 reports GPT-5.6 Sol for every child and completes with a strict verdict without modifying OpenClaw.
|
|
168
284
|
|
|
169
285
|
## Contract impact
|
|
170
286
|
|
|
171
|
-
- **Origin session:** The normal workflow start record and one
|
|
172
|
-
- **
|
|
173
|
-
- **
|
|
174
|
-
- **
|
|
175
|
-
- **
|
|
287
|
+
- **Origin session:** The normal workflow start record, one detailed assistant response, and one short plain-language assistant response.
|
|
288
|
+
- **Parent extensions:** The parent Pi process loads its normal configured extensions.
|
|
289
|
+
- **Child extensions:** Only the exact provider owner and explicit private behavior paths are admitted.
|
|
290
|
+
- **Child sessions:** Independent in-memory contexts and complete per-child runtimes in the same Node process. No child session file or child workflow run.
|
|
291
|
+
- **Model dispatch:** Exact provider, model, and thinking are required. Fallback is forbidden.
|
|
292
|
+
- **Credentials:** Pi Workflows does not copy or persist credentials. Provider extensions use their existing stores in place.
|
|
293
|
+
- **Other persistent data:** The normal workflow run bundle and existing progress updates only.
|
|
294
|
+
- **Private content:** Prompts, reasoning, intermediate messages, tool payloads, histories, credentials, and extension-private state are not persisted by Pi Workflows.
|
|
295
|
+
- **Pi public API:** Documented package manager, resource loader, extension and provider registration, model runtime, session, event, abort, and disposal APIs only.
|
|
296
|
+
- **Pi Workflows public API:** No change.
|
|
297
|
+
- **Isolation:** Workflow capability is withheld from normal child bindings. Arbitrary trusted in-process extension code is not sandboxed.
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Make Monitor finish authorized goals
|
|
3
|
+
author: Onur Solmaz <2453968+osolmaz@users.noreply.github.com>
|
|
4
|
+
date: 2026-08-22
|
|
5
|
+
status: implemented
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Goal-finishing Monitor plan
|
|
9
|
+
|
|
10
|
+
## Goal
|
|
11
|
+
|
|
12
|
+
Change the built-in Monitor workflow so it finishes the user's authorized goal instead of only checking it.
|
|
13
|
+
|
|
14
|
+
A request such as "resume this work and monitor it" must resume the work, prove that useful work is moving, and then check it on schedule. Monitor continues until the full goal is complete or cannot continue safely.
|
|
15
|
+
|
|
16
|
+
The canonical behavior is specified in [Built-in monitor](../MONITOR.md).
|
|
17
|
+
|
|
18
|
+
## Boundaries
|
|
19
|
+
|
|
20
|
+
The implementation must:
|
|
21
|
+
|
|
22
|
+
- preserve the full goal and authority from `task`, `stopWhen`, repository instructions, and the conversation
|
|
23
|
+
- keep the first observation read-only
|
|
24
|
+
- use normal Pi tools for observations and actions
|
|
25
|
+
- keep only `task`, `stopWhen`, `everyMinutes`, and `maxChecks` as public inputs
|
|
26
|
+
- reject unknown input fields before run creation
|
|
27
|
+
- keep target processes and systems independent of Pi Workflows
|
|
28
|
+
- use the existing plan-change and Autoimplement workflows for real repairs
|
|
29
|
+
- keep normal starts, resumes, and restarts direct and small
|
|
30
|
+
- stop before an action exceeds authority, cost, provider, runtime, credential, or safety limits
|
|
31
|
+
- stop paid workers before repairing a shared code or data defect
|
|
32
|
+
- avoid compatibility aliases or shims for removed alpha inputs and routes
|
|
33
|
+
|
|
34
|
+
The work may change the Pi Workflows source, Monitor tests, the Monitor skill, and relevant documentation. It may run local checks and the non-destructive real-Pi end-to-end suite. It may commit and push the verified change directly to `origin/main`.
|
|
35
|
+
|
|
36
|
+
The work must not:
|
|
37
|
+
|
|
38
|
+
- add a target-specific Pi API, transport, schema, store, file, command, service, or dependency
|
|
39
|
+
- copy the planning, documentation, implementation, review, or delivery logic from existing workflows
|
|
40
|
+
- open a pull request
|
|
41
|
+
- deploy, publish an npm package, or create a release
|
|
42
|
+
- change OnurPi or another repository
|
|
43
|
+
|
|
44
|
+
## Selected design
|
|
45
|
+
|
|
46
|
+
### Strict input
|
|
47
|
+
|
|
48
|
+
Replace the Monitor input parser with strict validation for:
|
|
49
|
+
|
|
50
|
+
- `task`
|
|
51
|
+
- `stopWhen`
|
|
52
|
+
- `everyMinutes`
|
|
53
|
+
- `maxChecks`
|
|
54
|
+
|
|
55
|
+
Keep the full goal, scope, authority, constraints, and recovery contract in `task` instead of adding process-specific or provider-specific fields. Reject all other fields with a direct unsupported-field error.
|
|
56
|
+
|
|
57
|
+
### Read-only observation
|
|
58
|
+
|
|
59
|
+
Replace the current check result with a read-only observation result. Its route is one of:
|
|
60
|
+
|
|
61
|
+
- `wait`: Work is moving, or an external event must finish.
|
|
62
|
+
- `act`: The goal is incomplete and a safe authorized action is available.
|
|
63
|
+
- `stop`: The goal is complete or cannot continue safely.
|
|
64
|
+
|
|
65
|
+
The observation records goal state and target work state separately. It includes factual evidence, the safe actions already authorized by the user, optional progress, a stable target-state ID, and a concise report.
|
|
66
|
+
|
|
67
|
+
An `act` result also includes:
|
|
68
|
+
|
|
69
|
+
- action kind: `advance`, `recover`, or `repair`
|
|
70
|
+
- what is incomplete
|
|
71
|
+
- evidence that proves it
|
|
72
|
+
- the exact next action
|
|
73
|
+
- why existing authority covers it
|
|
74
|
+
- files, systems, and resources it may change
|
|
75
|
+
- how to verify it
|
|
76
|
+
- a stable failure ID
|
|
77
|
+
|
|
78
|
+
The observation cannot grant new authority.
|
|
79
|
+
|
|
80
|
+
### Direct action step
|
|
81
|
+
|
|
82
|
+
Add one mutation-capable agent step that uses normal Pi tools. It performs only the action stated by the observation.
|
|
83
|
+
|
|
84
|
+
Route `advance` and `recover` directly to this step. These actions cover normal starts, resumes, restarts, next commands, launch-file refreshes, safe retries, and verified checkpoint continuation. They do not run planning or documentation workflows.
|
|
85
|
+
|
|
86
|
+
The step returns a factual success, failure, or blocked result with verification evidence.
|
|
87
|
+
|
|
88
|
+
### Existing repair path
|
|
89
|
+
|
|
90
|
+
Route `repair` through the existing shared plan-change workflow and Autoimplement workflow. Pass the observed defect, evidence, repository, authority, constraints, and delivery boundaries into those workflows.
|
|
91
|
+
|
|
92
|
+
Do not copy or replace their design, documentation, approval, implementation, test, review, or delivery behavior.
|
|
93
|
+
|
|
94
|
+
Stop affected paid workers at safe boundaries before repairing a shared code or data defect.
|
|
95
|
+
|
|
96
|
+
### Immediate verification
|
|
97
|
+
|
|
98
|
+
Run a new read-only observation immediately after every direct action or completed repair. Do not schedule or sleep first.
|
|
99
|
+
|
|
100
|
+
The immediate observation must establish one of these states:
|
|
101
|
+
|
|
102
|
+
- the goal is complete
|
|
103
|
+
- useful work is moving
|
|
104
|
+
- the action failed in a new way
|
|
105
|
+
- the same failure returned
|
|
106
|
+
- a blocker exists
|
|
107
|
+
|
|
108
|
+
Only the `wait` route can publish the next schedule and enter the timer.
|
|
109
|
+
|
|
110
|
+
### Repeated failure guard
|
|
111
|
+
|
|
112
|
+
Store stable failure and target-state IDs in accepted outputs. After one repair completes, compare the next observation with prior repaired failures.
|
|
113
|
+
|
|
114
|
+
If the same failure ID and target-state ID return, stop. Do not run the same repair cycle again.
|
|
115
|
+
|
|
116
|
+
A failed direct action can produce a new `recover` action when the new observation proves that recovery is authorized. All loops remain bounded by accepted observations and the Monitor safety limit.
|
|
117
|
+
|
|
118
|
+
### Reports
|
|
119
|
+
|
|
120
|
+
Format every observation report with separate facts for:
|
|
121
|
+
|
|
122
|
+
- Monitor state
|
|
123
|
+
- goal state
|
|
124
|
+
- target work state
|
|
125
|
+
- factual progress when available
|
|
126
|
+
- last action or next action
|
|
127
|
+
- next check when scheduled
|
|
128
|
+
|
|
129
|
+
Never report target work as running only because Monitor is active.
|
|
130
|
+
|
|
131
|
+
### Workflow graph
|
|
132
|
+
|
|
133
|
+
```text
|
|
134
|
+
observe
|
|
135
|
+
├─ stop → finish
|
|
136
|
+
├─ wait → report → schedule → sleep → observe
|
|
137
|
+
└─ act
|
|
138
|
+
├─ advance → direct action → observe immediately
|
|
139
|
+
├─ recover → direct action → observe immediately
|
|
140
|
+
└─ repair → plan change → Autoimplement → observe immediately
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
The timer belongs only on the `wait` path.
|
|
144
|
+
|
|
145
|
+
## Implementation steps
|
|
146
|
+
|
|
147
|
+
1. Replace Monitor's public input parser with strict validation for `task`, `stopWhen`, `everyMinutes`, and `maxChecks` only.
|
|
148
|
+
2. Replace `continue`, `repair`, and `stop` observation routes with `wait`, `act`, and `stop`.
|
|
149
|
+
3. Add structured goal state, work state, evidence, progress, stable IDs, and complete action details to observation output validation.
|
|
150
|
+
4. Add the direct mutation-capable action step for `advance` and `recover`.
|
|
151
|
+
5. Keep the existing shared plan-change and Autoimplement includes for `repair`.
|
|
152
|
+
6. Route every action result directly back to read-only observation.
|
|
153
|
+
7. Route only `wait` through report, schedule, sleep, and the next observation.
|
|
154
|
+
8. Add the repeated repaired-failure guard using stable failure and target-state IDs.
|
|
155
|
+
9. Update report formatting so Monitor, goal, and target work states remain separate.
|
|
156
|
+
10. Update the Monitor skill and workflow documentation for the new graph and simple input contract.
|
|
157
|
+
11. Replace and extend Monitor tests for the new behavior.
|
|
158
|
+
12. Run all required checks, review the diff, commit, and push directly to `origin/main`.
|
|
159
|
+
|
|
160
|
+
## Tests
|
|
161
|
+
|
|
162
|
+
Add tests for these cases:
|
|
163
|
+
|
|
164
|
+
1. The goal is already complete.
|
|
165
|
+
2. Work is active, so Monitor waits.
|
|
166
|
+
3. Work is idle, so Monitor starts it.
|
|
167
|
+
4. Saved work exists, so Monitor resumes it.
|
|
168
|
+
5. An action succeeds, so Monitor observes again immediately.
|
|
169
|
+
6. An action fails once, then recovery succeeds.
|
|
170
|
+
7. The same repaired failure returns, so Monitor stops.
|
|
171
|
+
8. An action is outside authority, so Monitor stops.
|
|
172
|
+
9. A paid action exceeds the limit, so Monitor does not launch it.
|
|
173
|
+
10. Monitor is active while the target is idle.
|
|
174
|
+
11. The target completes between timed observations.
|
|
175
|
+
12. Unknown input fields fail clearly before run creation.
|
|
176
|
+
13. A normal restart does not trigger planning or documentation.
|
|
177
|
+
14. A real code defect uses the existing repair path.
|
|
178
|
+
15. No target-specific monitoring API is required.
|
|
179
|
+
|
|
180
|
+
Keep applicable existing tests for progress, reports, notifications, schedule updates, safety limits, cancellation, interruption, resume, and the widget.
|
|
181
|
+
|
|
182
|
+
## Verification
|
|
183
|
+
|
|
184
|
+
Run:
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
npm run check
|
|
188
|
+
npm run test:e2e
|
|
189
|
+
npx slophammer-ts@latest dry .
|
|
190
|
+
npx slophammer-ts@latest check . --only ts.dependency-boundaries-required
|
|
191
|
+
git diff --check
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Review the full diff and fix each valid issue before delivery.
|
|
195
|
+
|
|
196
|
+
## Delivery
|
|
197
|
+
|
|
198
|
+
Commit the verified change with a Conventional Commit message and push it directly to `origin/main` without a pull request.
|
|
199
|
+
|
|
200
|
+
Do not deploy, publish, or create a release.
|