pi-goal-x 0.31.7 → 0.31.8

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 CHANGED
@@ -23,8 +23,6 @@ The extension saves goal objectives, tasks, and progress across sessions. You ca
23
23
  pi install npm:pi-goal-x
24
24
  ```
25
25
 
26
- Supported Pi versions: **0.83–0.87**. The extension supports Node 22.15+; newer Pi releases require Node 22.19+.
27
-
28
26
  ## Create a goal
29
27
 
30
28
  ```text
@@ -126,92 +124,6 @@ Open `/goal-settings` to change these options. You can save defaults for all pro
126
124
  | Auditor disabled | Turn off independent completion review. |
127
125
  | Auditor provider, model, and thinking level | Choose which model reviews completed work and its reasoning effort. |
128
126
 
129
-
130
- ### Automatic continuation and optional execution contracts
131
-
132
- Active goals continue automatically after successful executions, including reasoning-only responses and final-task verification. No tool call, task update, scheduling declaration, or cooldown is required. Unproductive loops remain possible; optional run limits and token budgets still apply.
133
-
134
- Enable `strictExecutionContract: true` in `/goal-settings` or your global/project settings to require explicit ready/wait decisions. In that mode, a missing decision permits one repair prompt within the remaining allowance, then pauses. This is a user preference; agents should not enable it merely to continue.
135
-
136
- Set an appropriate allowance in `/goal-settings`, or in `.pi/pi-goal-x-settings.json`:
137
-
138
- ```json
139
- { "maxAutonomousRuns": 20 }
140
- ```
141
-
142
- Agents may edit this setting. Changing it does not replenish consumed runs; explicit `/goal-resume` renews the period and continues now, including from a waiting goal. No configured allowance is required unless the effective limit is zero, which disables resume. Tool calls within a run are not separate runs. Existing token budgets still apply.
143
-
144
- Explicit `ready` is optional in default mode. New `wait` declarations require strict mode; otherwise they return a non-terminating error. Previously saved waits retain their deadline, checks, and repair rules when upgrading or disabling strict mode, and may be re-declared with the same identity. Mode changes never resume a paused goal or renew consumed runs.
145
-
146
- ```js
147
- update_goal({ continuation: { kind: "ready", next_action: "Verify the build artifacts" } })
148
- update_goal({ continuation: {
149
- kind: "wait", reason: "Await the remote build",
150
- deadline: "2026-09-15T12:00:00Z",
151
- polling: { interval_seconds: 60, max_checks: 3 }
152
- } })
153
- ```
154
-
155
- Use a future deadline appropriate to the task. Omit `polling` for an event-only wait. Successful declarations terminate the execution segment. On a scheduled check, reuse the returned `wait_id` and original deadline, omitting `polling`; remaining checks cannot be reset. A ready decision ends the wait. Time spent waiting is not active execution time.
156
-
157
- The dashboard, `/goal-status`, and `get_goal` show scheduling state, timing, checks, and allowance consumption. Expired waits and exhausted checks or allowance pause without another model call. Waits survive reopening the same session, without replaying missed checks; Pi must remain open for timers to execute. Another session requires explicit resume to take ownership. An ambiguous interrupted dispatch requires resume instead of automatic replay.
158
-
159
- ### Background producer integration
160
-
161
- Budget-controlled producers emit a scheduler signal instead of starting their own model turn:
162
-
163
- ```js
164
- pi.events.emit("pi-goal:wake", { goalId, waitToken });
165
- ```
166
-
167
- `waitToken` is returned in the wait declaration's tool-result details. Register it before the producer completes, or retain the completion until registration (for example, observe the `update_goal` tool result in the host adapter). The token changes after consumption and re-declaration. A matching signal received before agent settlement is retained; duplicate, stale and wrong-goal tokens are ignored. A signal and timer can claim only one wake.
168
-
169
- Existing producers that directly send `triggerTurn`/`followUp` messages still run as ordinary host work and supersede old pending decisions. Those independently started turns are **outside this extension's allowance**; use `pi-goal:wake` to put them through its spending gate. The allowance also does not limit Pi's own within-run tool loop or native retries. It bounds the goal extension's kickoff, continuation, check, signal, repair and recovery dispatches.
170
-
171
- ### Prompt caching
172
-
173
- Goal state is refreshed at the request tail while the system prompt and conversation prefix stay stable. Pi retains control of provider cache settings. See [prompt caching](docs/prompt-caching.md) for explicit-cache handling, validation, and cache invalidation boundaries.
174
-
175
- ### Changing a token budget
176
-
177
- Use the existing tweak flow: `/goal-tweak remove the token budget` or `/goal-tweak set the token budget to 50000`. The proposal shows the current and proposed limits before confirmation. A budget is a total lifetime limit, not an additional allocation; consumed tokens and completed work are preserved. Omitting a budget change retains the current limit.
178
-
179
- After confirmation, a goal stopped only by its budget can continue if the revised limit allows it and scheduling permits. A still-exhausted budget keeps it stopped. Other-session ownership, interrupted execution and exhausted autonomous-run allowances still require their existing recovery steps. Creation and tweak results always show the effective budget.
180
-
181
- ### Optional arguments on Responses-compatible providers
182
-
183
- Some Pi `openai-responses` configurations omit the wire-level `strict` flag. OpenAI Responses may normalize schemas into strict mode when that flag is omitted. This can conflict with optional goal arguments; it is separate from pi-goal-x's `strictExecutionContract` scheduling setting.
184
-
185
- For the reported OpenCode model, a narrowly scoped Pi `models.json` override makes the supported Pi 0.84.1 adapter send `strict: false` for ordinary tools:
186
-
187
- ```json
188
- {
189
- "providers": {
190
- "opencode": {
191
- "modelOverrides": {
192
- "gpt-6-astra": { "compat": { "supportsStrictMode": true } }
193
- }
194
- }
195
- }
196
- }
197
- ```
198
-
199
- The capability flag permits the adapter to send the explicit non-strict opt-out; it does not request strict sampling for ordinary goal tools. Merge this into existing model configuration and reload Pi. This is a provider-specific workaround, not a guarantee about third-party model behavior. The local reproduction inspects requests before transmission; the issue's live OpenCode A/B result has not been independently reproduced. See [issue #59](https://github.com/tmonk/pi-goal-x/issues/59) and [OpenAI's function-calling documentation](https://developers.openai.com/api/docs/guides/function-calling).
200
-
201
- ### Sharing a goal pool across worktrees
202
-
203
- By default goals stay in `<cwd>/.pi/goals`. Set `goalsRoot` in your project or global settings to an absolute directory (or `~/path`), or set `PI_GOAL_ROOT` for the session. Precedence is environment, project, global, then the existing default. For example:
204
-
205
- ```json
206
- { "goalsRoot": "~/work/project-goals" }
207
- ```
208
-
209
- Worktrees pointing to the same root share goals, archives, ledger and locks; focus remains session-local and execution ownership still requires explicit resume. The working directory for tools and audits is unchanged. Existing goals are not moved automatically. Reload/reopen the session after changing roots; `/goal-refresh` refreshes the selected pool. `/goal-status verbose` shows the effective location. Saved goal paths remain logical `.pi/goals/...` paths within that selected pool.
210
-
211
- `hideUnfocusedPrompt: true` suppresses ordinary unfocused reminders to the model independently of `hideUnfocusedBanner`; neither changes focus or bypasses stale-checkpoint checks.
212
-
213
- Token usage shown in the dashboard is cumulative across goal turns. The model receives a separate context snapshot when Pi can supply one; unavailable context is never reported as zero. Retained snapshots are bounded and newer snapshots supersede older ones.
214
-
215
127
  ## License
216
128
 
217
129
  MIT
@@ -0,0 +1,92 @@
1
+ # Advanced usage
2
+
3
+ For installation, goal workflows, commands and the settings overview, see the [README](../README.md).
4
+
5
+ ## Automatic continuation and optional execution contracts
6
+
7
+ Active goals continue automatically after successful executions, including reasoning-only responses and final-task verification. No tool call, task update, scheduling declaration, or cooldown is required. Unproductive loops remain possible; optional run limits and token budgets still apply.
8
+
9
+ Enable `strictExecutionContract: true` in `/goal-settings` or your global/project settings to require explicit ready/wait decisions. In that mode, a missing decision permits one repair prompt within the remaining allowance, then pauses. This is a user preference; agents should not enable it merely to continue.
10
+
11
+ Set an appropriate allowance in `/goal-settings`, or in `.pi/pi-goal-x-settings.json`:
12
+
13
+ ```json
14
+ { "maxAutonomousRuns": 20 }
15
+ ```
16
+
17
+ Agents may edit this setting. Changing it does not replenish consumed runs; explicit `/goal-resume` renews the period and continues now, including from a waiting goal. No configured allowance is required unless the effective limit is zero, which disables resume. Tool calls within a run are not separate runs. Existing token budgets still apply.
18
+
19
+ Explicit `ready` is optional in default mode. New `wait` declarations require strict mode; otherwise they return a non-terminating error. Previously saved waits retain their deadline, checks, and repair rules when upgrading or disabling strict mode, and may be re-declared with the same identity. Mode changes never resume a paused goal or renew consumed runs.
20
+
21
+ ```js
22
+ update_goal({ continuation: { kind: "ready", next_action: "Verify the build artifacts" } })
23
+ update_goal({ continuation: {
24
+ kind: "wait", reason: "Await the remote build",
25
+ deadline: "2026-09-15T12:00:00Z",
26
+ polling: { interval_seconds: 60, max_checks: 3 }
27
+ } })
28
+ ```
29
+
30
+ Use a future deadline appropriate to the task. Omit `polling` for an event-only wait. Successful declarations terminate the execution segment. On a scheduled check, reuse the returned `wait_id` and original deadline, omitting `polling`; remaining checks cannot be reset. A ready decision ends the wait. Time spent waiting is not active execution time.
31
+
32
+ The dashboard, `/goal-status`, and `get_goal` show scheduling state, timing, checks, and allowance consumption. Expired waits and exhausted checks or allowance pause without another model call. Waits survive reopening the same session, without replaying missed checks; Pi must remain open for timers to execute. Another session requires explicit resume to take ownership. An ambiguous interrupted dispatch requires resume instead of automatic replay.
33
+
34
+ ## Background producer integration
35
+
36
+ Budget-controlled producers emit a scheduler signal instead of starting their own model turn:
37
+
38
+ ```js
39
+ pi.events.emit("pi-goal:wake", { goalId, waitToken });
40
+ ```
41
+
42
+ `waitToken` is returned in the wait declaration's tool-result details. Register it before the producer completes, or retain the completion until registration (for example, observe the `update_goal` tool result in the host adapter). The token changes after consumption and re-declaration. A matching signal received before agent settlement is retained; duplicate, stale and wrong-goal tokens are ignored. A signal and timer can claim only one wake.
43
+
44
+ Existing producers that directly send `triggerTurn`/`followUp` messages still run as ordinary host work and supersede old pending decisions. Those independently started turns are **outside this extension's allowance**; use `pi-goal:wake` to put them through its spending gate. The allowance also does not limit Pi's own within-run tool loop or native retries. It bounds the goal extension's kickoff, continuation, check, signal, repair and recovery dispatches.
45
+
46
+ ## Prompt caching
47
+
48
+ Goal state is refreshed at the request tail while the system prompt and conversation prefix stay stable. Pi retains control of provider cache settings. See [prompt caching](prompt-caching.md) for explicit-cache handling, validation, and cache invalidation boundaries.
49
+
50
+ ## Changing a token budget
51
+
52
+ Use the existing tweak flow: `/goal-tweak remove the token budget` or `/goal-tweak set the token budget to 50000`. The proposal shows the current and proposed limits before confirmation. A budget is a total lifetime limit, not an additional allocation; consumed tokens and completed work are preserved. Omitting a budget change retains the current limit.
53
+
54
+ After confirmation, a goal stopped only by its budget can continue if the revised limit allows it and scheduling permits. A still-exhausted budget keeps it stopped. Other-session ownership, interrupted execution and exhausted autonomous-run allowances still require their existing recovery steps. Creation and tweak results always show the effective budget.
55
+
56
+ ## Optional arguments on Responses-compatible providers
57
+
58
+ Some Pi `openai-responses` configurations omit the wire-level `strict` flag. OpenAI Responses may normalize schemas into strict mode when that flag is omitted. This can conflict with optional goal arguments; it is separate from pi-goal-x's `strictExecutionContract` scheduling setting.
59
+
60
+ For the reported OpenCode model, a narrowly scoped Pi `models.json` override makes the supported Pi 0.84.1 adapter send `strict: false` for ordinary tools:
61
+
62
+ ```json
63
+ {
64
+ "providers": {
65
+ "opencode": {
66
+ "modelOverrides": {
67
+ "gpt-6-astra": { "compat": { "supportsStrictMode": true } }
68
+ }
69
+ }
70
+ }
71
+ }
72
+ ```
73
+
74
+ The capability flag permits the adapter to send the explicit non-strict opt-out; it does not request strict sampling for ordinary goal tools. Merge this into existing model configuration and reload Pi. This is a provider-specific workaround, not a guarantee about third-party model behavior. The local reproduction inspects requests before transmission; the issue's live OpenCode A/B result has not been independently reproduced. See [issue #59](https://github.com/tmonk/pi-goal-x/issues/59) and [OpenAI's function-calling documentation](https://developers.openai.com/api/docs/guides/function-calling).
75
+
76
+ ## Sharing a goal pool across worktrees
77
+
78
+ By default goals stay in `<cwd>/.pi/goals`. Set `goalsRoot` in your project or global settings to an absolute directory (or `~/path`), or set `PI_GOAL_ROOT` for the session. Precedence is environment, project, global, then the existing default. For example:
79
+
80
+ ```json
81
+ { "goalsRoot": "~/work/project-goals" }
82
+ ```
83
+
84
+ Worktrees pointing to the same root share goals, archives, ledger and locks; focus remains session-local and execution ownership still requires explicit resume. The working directory for tools and audits is unchanged. Existing goals are not moved automatically. Reload/reopen the session after changing roots; `/goal-refresh` refreshes the selected pool. `/goal-status verbose` shows the effective location. Saved goal paths remain logical `.pi/goals/...` paths within that selected pool.
85
+
86
+ `hideUnfocusedPrompt: true` suppresses ordinary unfocused reminders to the model independently of `hideUnfocusedBanner`; neither changes focus or bypasses stale-checkpoint checks.
87
+
88
+ Token usage shown in the dashboard is cumulative across goal turns. The model receives a separate context snapshot when Pi can supply one; unavailable context is never reported as zero. Retained snapshots are bounded and newer snapshots supersede older ones.
89
+
90
+ ## Diagnostics and recovery
91
+
92
+ Use `/goal-status verbose` for effective settings and storage location, `/goal-status health` or `/goal-recovery` to check for problems, and `/goal-refresh` to reload saved goals and settings after external changes. `/goal-recovery repair` offers repairs after confirmation.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-goal-x",
3
- "version": "0.31.7",
3
+ "version": "0.31.8",
4
4
  "description": "Adds /goal to pi: conversational goal planning, flexible or ordered goals, persistent progress, and an independent completion auditor.",
5
5
  "license": "MIT",
6
6
  "author": "pi-goal-x contributors",
@@ -35,6 +35,7 @@
35
35
  "docs/agentic-runtime-prd.md",
36
36
  "docs/architecture.md",
37
37
  "docs/prompt-caching.md",
38
+ "docs/advanced-usage.md",
38
39
  "docs/pi-autoresearch-survey.md",
39
40
  "docs/pi-goal-x-unified-dashboard-plan.md",
40
41
  "docs/unified-dashboard.md",