pi-better-harness 0.55.0 → 0.57.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.
Files changed (71) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +40 -57
  3. package/extensions/settings/copy.ts +6 -5
  4. package/extensions/settings/page.ts +2 -2
  5. package/extensions/settings/supervisor.ts +2 -2
  6. package/extensions/supervisor/commitments.ts +2 -2
  7. package/extensions/supervisor/decisions.ts +2 -2
  8. package/extensions/supervisor/index.ts +3 -3
  9. package/extensions/task-context/compact-task-header.ts +19 -4
  10. package/extensions/task-context/dynamic-workflow-view.ts +3 -3
  11. package/extensions/task-context/index.ts +187 -116
  12. package/extensions/task-context/outcome-state.ts +9 -6
  13. package/extensions/task-context/plan-state.ts +5 -1
  14. package/extensions/task-context/plan-widget.ts +41 -5
  15. package/extensions/task-context/preferences.ts +9 -15
  16. package/extensions/task-context/types.ts +1 -0
  17. package/extensions/task-context/work-ledger-actions.ts +30 -17
  18. package/extensions/task-context/work-ledger-session.ts +4 -2
  19. package/extensions/task-context/workflow-plan.ts +12 -6
  20. package/extensions/task-context/workflow-view.ts +16 -20
  21. package/node_modules/pi-better-background-tasks/package.json +1 -1
  22. package/node_modules/pi-better-background-tasks/runtime-client/artifacts/darwin-arm64.gz +0 -0
  23. package/node_modules/pi-better-background-tasks/runtime-client/artifacts/darwin-arm64.json +1 -1
  24. package/node_modules/pi-better-background-tasks/runtime-client/artifacts/darwin-x64.gz +0 -0
  25. package/node_modules/pi-better-background-tasks/runtime-client/artifacts/darwin-x64.json +1 -1
  26. package/node_modules/pi-better-background-tasks/runtime-client/artifacts/linux-arm64.gz +0 -0
  27. package/node_modules/pi-better-background-tasks/runtime-client/artifacts/linux-arm64.json +1 -1
  28. package/node_modules/pi-better-background-tasks/runtime-client/artifacts/linux-x64.gz +0 -0
  29. package/node_modules/pi-better-background-tasks/runtime-client/artifacts/linux-x64.json +1 -1
  30. package/node_modules/pi-better-background-tasks/src/observed-waits.ts +33 -19
  31. package/node_modules/pi-better-background-tasks/src/shared-operation-coordinator/src/assignment-changes.ts +33 -0
  32. package/node_modules/pi-better-background-tasks/src/shared-operation-coordinator/src/assignment-outcomes.ts +0 -2
  33. package/node_modules/pi-better-background-tasks/src/shared-operation-coordinator/src/background-parent-callbacks.ts +5 -0
  34. package/node_modules/pi-better-background-tasks/src/shared-operation-coordinator/src/discovery.ts +7 -4
  35. package/node_modules/pi-better-background-tasks/src/shared-operation-coordinator/src/operations.ts +5 -11
  36. package/node_modules/pi-better-background-tasks/src/shared-operation-coordinator/src/result-supervision.ts +23 -1
  37. package/node_modules/pi-better-background-tasks/src/shared-operation-coordinator/src/schema.ts +75 -5
  38. package/node_modules/pi-better-background-tasks/src/shared-operation-coordinator/src/store.ts +14 -8
  39. package/node_modules/pi-better-background-tasks/src/supervisor/generated/identity.mjs +5 -0
  40. package/node_modules/pi-better-background-tasks/src/supervisor/identity.ts +6 -0
  41. package/node_modules/pi-better-background-tasks/src/supervisor/supervisor.ts +3 -4
  42. package/node_modules/pi-better-goal/README.md +18 -14
  43. package/node_modules/pi-better-goal/package.json +1 -1
  44. package/node_modules/pi-better-goal/src/index.ts +151 -78
  45. package/node_modules/pi-better-goal/src/settings-page.ts +2 -2
  46. package/node_modules/pi-better-goal/src/task-context.ts +19 -4
  47. package/node_modules/pi-better-goal/src/workflow.ts +9 -3
  48. package/node_modules/pi-better-subagents/cleanup.ts +6 -8
  49. package/node_modules/pi-better-subagents/managed-launch-client.ts +15 -1
  50. package/node_modules/pi-better-subagents/package.json +1 -1
  51. package/node_modules/pi-better-subagents/registry.ts +36 -24
  52. package/node_modules/pi-better-subagents/retained-result.ts +2 -3
  53. package/node_modules/pi-better-subagents/runtime-client/artifacts/darwin-arm64.gz +0 -0
  54. package/node_modules/pi-better-subagents/runtime-client/artifacts/darwin-arm64.json +1 -1
  55. package/node_modules/pi-better-subagents/runtime-client/artifacts/darwin-x64.gz +0 -0
  56. package/node_modules/pi-better-subagents/runtime-client/artifacts/darwin-x64.json +1 -1
  57. package/node_modules/pi-better-subagents/runtime-client/artifacts/linux-arm64.gz +0 -0
  58. package/node_modules/pi-better-subagents/runtime-client/artifacts/linux-arm64.json +1 -1
  59. package/node_modules/pi-better-subagents/runtime-client/artifacts/linux-x64.gz +0 -0
  60. package/node_modules/pi-better-subagents/runtime-client/artifacts/linux-x64.json +1 -1
  61. package/node_modules/pi-better-subagents/shared-operation-coordinator/src/assignment-changes.ts +33 -0
  62. package/node_modules/pi-better-subagents/shared-operation-coordinator/src/assignment-outcomes.ts +0 -2
  63. package/node_modules/pi-better-subagents/shared-operation-coordinator/src/background-parent-callbacks.ts +5 -0
  64. package/node_modules/pi-better-subagents/shared-operation-coordinator/src/discovery.ts +7 -4
  65. package/node_modules/pi-better-subagents/shared-operation-coordinator/src/operations.ts +5 -11
  66. package/node_modules/pi-better-subagents/shared-operation-coordinator/src/result-supervision.ts +23 -1
  67. package/node_modules/pi-better-subagents/shared-operation-coordinator/src/schema.ts +75 -5
  68. package/node_modules/pi-better-subagents/shared-operation-coordinator/src/store.ts +14 -8
  69. package/node_modules/pi-better-subagents/worker-waits.ts +6 -17
  70. package/node_modules/pi-better-subagents/workspace-files.ts +27 -5
  71. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.57.0] - 2026-11-26
4
+
5
+ ### Added
6
+
7
+ - Drag the divider between workflow tasks and the diagram, or enter `/todo split 3:2` to set their relative widths. The session branch remembers the split.
8
+
9
+ ### Changed
10
+
11
+ - Workflow panels open with equal column widths. Each task fits on one row and shows its status with an icon. Narrow terminals stack the list and diagram.
12
+ - Bundle Goal 0.17.1, Background Tasks 0.21.2, and Subagents 0.39.2.
13
+
14
+ ### Fixed
15
+
16
+ - Reuse session history during divider drags and skip visual Goal inspection in headless sessions. Switching branches during a drag discards the unfinished resize.
17
+
18
+ ## [0.56.0] - 2026-11-26
19
+
20
+ ### Changed
21
+
22
+ - The saved objective in Todo is now called Goal. Start it from the Todo panel and use `/goal pause` and `/goal resume` to control the current Todo.
23
+ - Harness settings has one switch for automatically starting Goals. Existing saved objectives remain available for manual start.
24
+ - Bundle Goal 0.17.0, Background Tasks 0.21.1, and Subagents 0.39.1.
25
+
3
26
  ## [0.55.0] - 2026-11-25
4
27
 
5
28
  ### Added
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  <img src="https://raw.githubusercontent.com/1aboveio/pi-better-harness/main/docs/images/brand/logo.png" alt="Pi Better Harness logo" width="128" height="128" />
4
4
 
5
- `pi-better-harness` is a Pi meta package for an opt-in foreground write sandbox, delegated subagents, durable background tasks, synchronous SSH commands, goal tracking, and Outcome & Todo.
5
+ `pi-better-harness` is a Pi meta package for an opt-in foreground write sandbox, delegated subagents, durable background tasks, synchronous SSH commands, goal tracking, and Goal & Todo.
6
6
 
7
7
  ## Quick Answer
8
8
 
@@ -13,61 +13,45 @@ Use `pi-better-harness` when you want the full working set for Pi. It manages:
13
13
  - `pi-better-background-tasks` for durable shell tasks and watchers.
14
14
  - `pi-better-ssh` for short remote commands over reusable SSH connections.
15
15
  - `pi-better-goal` for explicit triggers, pause/resume, and background-aware continuation.
16
- - Harness-owned Outcome & Todo for session context and checklist progress. Saved state displays by default; its hooks start off.
16
+ - Harness-owned Goal & Todo for session context and checklist progress. Saved work appears in the panel. Automatic Goal execution defaults to Off.
17
17
 
18
18
  `pi-better-read-aloud` is intentionally not included yet.
19
19
 
20
- ## Outcome & Todo
21
-
22
- In `/harness-settings`, **Outcome and Todo panel** (`outcome-todo-display`)
23
- defaults to **On**, and **Outcome and Todo tools** (`outcome-todo`) defaults to
24
- **Off**. **Project work ledger** (`outcome-todo-ledger`) is a third independent
25
- control and defaults to **Off**. Saved outcomes and checklists display even when
26
- hooks are off; missing state creates no placeholder, state, or settings. Turning
27
- display off does not disable hooks. Saved v1 `enabled` remains the hooks
28
- authority; the optional display and ledger preferences default to their existing
29
- or conservative values.
30
-
31
- The compact widget has one Todo heading, with a caret after Todo and the completion
32
- count on the left. A matching Goal's status and existing active-time clock appear
33
- on the right. The outcome is one muted, truncated subtitle. The collapsed view
34
- shows up to five relevant rows; the expanded view shows all rows. Click to toggle.
35
- `/todo` reveals the compact Overview (when display is on) and returns it to automatic display;
36
- `/todo expand` and `/todo collapse` control which rows it shows. The full
37
- objective, acceptance criteria, boundaries, and plan remain available through
38
- `get_todo` when hooks are enabled. Todo commands remain available with hooks off
39
- for explicit user control.
40
-
41
- An accepted outcome can be saved without a checklist. Completing or clearing its
42
- Todo does not complete or remove the outcome. Write labels as short, plain actions,
43
- usually 3-7 words: "Add Todo toggle", "Keep session state", or "Test keyboard controls".
44
- Keep methods, file paths, and acceptance criteria in the outcome or supporting
45
- records. This is writing guidance, not a hard limit or automatic truncation;
46
- existing saved labels remain unchanged until deliberately updated.
47
-
48
- Use `newTask: true` with a new
49
- outcome for unrelated work; a correction to the current task keeps its binding.
50
- Hooks enable `update_todo`, `get_todo`, capture, matching Goal lifecycle bridge
51
- writes, outcome updates, and automated cleanup. With hooks enabled, Harness records
52
- a hidden, persistent outcome update at the next agent start only when its content
53
- changes. It does not rebuild reminders before each model call. Turning hooks off stops those
54
- hooks without deleting saved state or starting a turn. `/goal` and skills never
55
- enable them.
56
-
57
- In `/harness-settings`, **Auto-start Goal** optionally starts
58
- a Goal after a successful explicit outcome save with an objective and nonempty
59
- `doneWhen` criteria. It defaults Off; `/goal settings auto-start-from-outcome on`
60
- enables it. Existing active, paused or budget-limited Goals stay unchanged, and
61
- restoring state or toggling settings never starts work. The outcome and Todo are
62
- preserved; subsequent continuation follows the existing Goal controls.
20
+ <a id="outcome--todo"></a>
21
+ ## Goal & Todo
22
+
23
+ The Goal records what the user wants to achieve. Its Todo lists the steps. The
24
+ panel shows checklist progress on the left and Goal status on the right. A
25
+ saved Goal has a **Start Goal** button. Click it or press **Alt+G** to start work
26
+ with the existing checklist. Use `/goal pause` to interrupt
27
+ foreground work and hold continuation. Both commands use the current Todo,
28
+ including checklists saved before a Goal was attached.
29
+
30
+ `/harness-settings` has one Goal setting, **Auto-start Goals** (default **Off**).
31
+ Turn it on to start a newly saved Goal with acceptance criteria, restart explicitly
32
+ reopened work, or bind a Goal when invoking `/skill:rush-issues` or
33
+ `/skill:resolve-issues`. Changing the switch takes effect on the next such action.
34
+ With it off, use `/goal resume` to start saved work manually.
35
+
36
+ The panel shows `goal saved` before execution starts and `goal active` with a
37
+ clock while it runs. Use `/todo` to reveal the panel and `/todo expand` to see
38
+ all steps. `get_todo` returns the full Goal and Todo, including acceptance criteria
39
+ and boundaries. Completing a step updates checklist progress. The Goal stays
40
+ open until its completion is recorded.
41
+
42
+ Use `update_todo({ goal: { objective, doneWhen, boundaries }, todo })` to save
43
+ work. Any of `doneWhen`, `boundaries` and `todo` may be omitted. Set
44
+ `newTask: true` for an unrelated task. Existing session records, settings and
45
+ clients using the legacy `outcome` field remain supported.
63
46
 
64
47
  Todo uses the same workflow view for a bound task plan and a dynamic workflow.
65
- It shows tasks on the left and the workflow diagram on the right. Below 36 terminal
66
- columns, the diagram follows the task list.
48
+ The task list and diagram start at equal widths. Drag their divider in fullscreen Pi
49
+ or enter `/todo split 3:2` to give the task list three fifths of the available width.
50
+ The session remembers the ratio across reloads. Use `/todo split 1:1` to restore equal columns.
51
+ Below 36 terminal columns, the diagram follows the task list.
67
52
 
68
53
  Existing Plan session histories restore as Todo. Workflow task-plan files and
69
- revision checks stay unchanged; skills continue using their own records when the
70
- optional interface is off. See the [usage guide](docs/usage.md#outcome--todo).
54
+ revision checks continue to govern workflow-owned plans. See the [usage guide](docs/usage.md#goal--todo).
71
55
 
72
56
  ### Dynamic workflows
73
57
 
@@ -130,7 +114,7 @@ For project-local Pi settings:
130
114
  npx pi-better-harness install --local
131
115
  ```
132
116
 
133
- The installer also registers Harness with filters for its own settings, minimal output, and Outcome & Todo extensions. It removes an old `pi-better-plan` registration in the selected scope. The component packages keep their separate identities. Pi's normal installation prompts and errors still apply.
117
+ The installer also registers Harness with filters for its own settings, minimal output, and Goal & Todo extensions. It removes an old `pi-better-plan` registration in the selected scope. The component packages keep their separate identities. Pi's normal installation prompts and errors still apply.
134
118
 
135
119
  The single-bundle installation remains available:
136
120
 
@@ -144,8 +128,7 @@ Cloud provider and requires Pi's `registerVirtualModel` API.
144
128
 
145
129
  After a normal bundle install or `pi update`, Harness masks any separately loaded
146
130
  `pi-better-plan` package before Pi registers its tools, `/plan` command, widgets,
147
- or prompt hooks. This applies in either load order, including when Outcome & Todo
148
- hooks are off. The old registration and cached files may remain, but are inactive while
131
+ or prompt hooks. This applies in either load order. The old registration and cached files may remain, but are inactive while
149
132
  Harness is loaded. Settings and session history are not rewritten. The explicit
150
133
  installer above removes the old registration in its selected scope instead.
151
134
 
@@ -234,7 +217,7 @@ pi -e ./packages/pi-better-harness/extensions/minimal-output/index.ts
234
217
  The bundled harness provides `/harness-settings`, using Pi's native settings
235
218
  list. Work planning comes first, followed by delegation and sandbox access,
236
219
  background waits and completion delivery, then display settings. It opens
237
- the settings screens of loaded Sandbox, Subagents, and Goal
220
+ the settings screens of loaded Sandbox and Subagents
238
221
  packages without duplicating their configuration, plus the **Agent catalog** shortcut
239
222
  to the `/agents` catalog. `/sandbox`, `/subagents settings`, `/agents`, and
240
223
  `/goal settings` remain available in standalone installations.
@@ -248,7 +231,7 @@ Worker-owned tasks expose status and logs; their execution remains managed by th
248
231
  owning agent. Older worker tasks appear when a retained assignment wait proves
249
232
  their parent, so unrelated sessions are never inferred from a reused conversation.
250
233
 
251
- **Pin work panels** controls the shared navigator used by Goal, Outcome & Todo,
234
+ **Pin work panels** controls the shared navigator used by Goal & Todo,
252
235
  Subagents, and Background Tasks. **On** (the default) keeps it above the input;
253
236
  **Off** places it in the conversation so it scrolls with chat. Changes apply
254
237
  immediately and save under `piBetterHarness.navigator` for future sessions.
@@ -353,15 +336,15 @@ Open **Supervisor mode** in `/harness-settings`. Turn it on and select the scena
353
336
  | Scenario | What the owner receives |
354
337
  | --- | --- |
355
338
  | CI observation recovery | A suggestion to resume observation of the original GitHub run when its local watcher exits and a fresh check confirms the run is active. Use `supervisor_consult` for the managed observer. |
356
- | Diagnose stalled Outcomes | A diagnostic review after repeated identical successful repository reads return the same evidence throughout the stall interval. |
357
- | Review Outcome scope | A review of changed Todo steps against the latest user instruction and Outcome. The owner chooses which steps to keep or prune. Use `supervisor_review` for an on-demand review. |
339
+ | Diagnose stalled Goals | A diagnostic review after repeated identical successful repository reads return the same evidence throughout the stall interval. |
340
+ | Review Goal scope | A review of changed Todo steps against the latest user instruction and Goal. The owner chooses which steps to keep or prune. Use `supervisor_review` for an on-demand review. |
358
341
  | Shared daemon fault diagnosis | A shared read-plane diagnosis with an owner-specific verification step when a runtime read fails and the daemon confirms degraded or rebuilding inventory. |
359
342
  | Consolidate authorization requests | Owners in a trusted workspace can use `supervisor_request_decision` for the same proposal. The dialog shows the reference, operation, host, resource, side effect, workspace and validity period. Execution still needs the permissions normally required by the tool. |
360
343
  | Follow up on recovery commitments | Use `supervisor_followup` to record the action, expected verification and actual tool results. Read progress with `/supervisor-followup`. Request one reminder with `/supervisor-followup remind <id> <minutes>`. |
361
344
 
362
345
  ## When To Use
363
346
 
364
- Use the installer when you want every core extension with standalone package identities. Install an individual package instead when you only need the sandbox, subagents, shell task supervision, synchronous SSH, goal tracking, or model routing. Outcome & Todo is available through Harness.
347
+ Use the installer when you want every core extension with standalone package identities. Install an individual package instead when you only need the sandbox, subagents, shell task supervision, synchronous SSH, goal tracking, or model routing. Goal & Todo is available through Harness.
365
348
 
366
349
  ## Compatibility
367
350
 
@@ -11,7 +11,8 @@ export const controlCopy = new Map<string, SettingCopy>([
11
11
  description: "When the session is waiting for a local task with callbacks on, Pi asks the main agent to review it after this long without progress. Each review shows elapsed time and the last check or output.",
12
12
  }],
13
13
  ["goal-auto-start", {
14
- description: "Start a Goal automatically when Pi accepts an Outcome with work to do and there is no unfinished Goal.",
14
+ label: "Auto-start Goals",
15
+ description: "Start a Goal when Pi saves acceptance criteria, reopens completed work, or runs an issue workflow. When off, use /goal resume to start saved work.",
15
16
  }],
16
17
  ["tool-call-guard", {
17
18
  label: "Foreground wait guard",
@@ -21,7 +22,7 @@ export const controlCopy = new Map<string, SettingCopy>([
21
22
  description: "Choose when Pi can plan a workflow automatically. Adaptive uses workflows for dependencies, handoffs or review. /dynamic-workflow starts one run in every mode.",
22
23
  }],
23
24
  ["outcome-todo", {
24
- label: "Outcome and Todo tools",
25
+ label: "Goal and Todo tools",
25
26
  description: "Lets Pi record what the session should deliver and track its progress as a checklist.",
26
27
  }],
27
28
  ["outcome-todo-ledger", {
@@ -29,8 +30,8 @@ export const controlCopy = new Map<string, SettingCopy>([
29
30
  description: "Lets sessions attach a saved project checklist and carry its progress across sessions. Use /ledger to list or attach a ledger.",
30
31
  }],
31
32
  ["outcome-todo-display", {
32
- label: "Outcome and Todo panel",
33
- description: "Shows the session objective and checklist in the TUI when Outcome and Todo tools are on.",
33
+ label: "Goal and Todo panel",
34
+ description: "Shows the saved Goal, its execution status, and Todo steps. The panel also works with the tools off.",
34
35
  }],
35
36
  ["navigator-sticky", {
36
37
  label: "Pin work panels",
@@ -58,7 +59,7 @@ export const linkCopy = new Map<string, SettingCopy>([
58
59
  description: "Browse the agents Pi can delegate to and manage their profiles.",
59
60
  }],
60
61
  ["goal", {
61
- label: "Goal settings",
62
+ label: "Goal execution settings",
62
63
  description: "Choose when Goals continue automatically, resume from conversation, or pause on Escape.",
63
64
  }],
64
65
  ["sandbox", {
@@ -19,10 +19,10 @@ const callbackDescription = (source: "session" | "default") => [
19
19
 
20
20
  // Keep each package page beside the controls used for the same task.
21
21
  const taskOrder = [
22
- "setting:outcome-todo", "setting:dynamic-workflow", "setting:goal-auto-start", "link:goal", "setting:outcome-todo-ledger",
22
+ "setting:goal-auto-start", "setting:dynamic-workflow", "setting:outcome-todo-ledger",
23
23
  "link:subagents", "link:agents", "link:sandbox",
24
24
  "setting:tool-call-guard", "setting:background-review-interval", CALLBACK_SETTING_ID,
25
- "setting:navigator-view", "setting:navigator-sticky", "setting:outcome-todo-display",
25
+ "setting:navigator-view", "setting:navigator-sticky",
26
26
  "setting:tool-output", "setting:tool-animation", "setting:session-recap", "link:recap-prompt",
27
27
  ];
28
28
  const position = new Map(taskOrder.map((id, index) => [id, index]));
@@ -6,8 +6,8 @@ import { harnessSettingsPath, readHarnessSetting, updateHarnessSetting } from ".
6
6
  const key = "supervisorMode";
7
7
  const options = new Map([
8
8
  ["ci-observation", "CI observation recovery"],
9
- ["stall-diagnosis", "Diagnose stalled Outcomes"],
10
- ["scope-review", "Review Outcome scope"],
9
+ ["stall-diagnosis", "Diagnose stalled Goals"],
10
+ ["scope-review", "Review Goal scope"],
11
11
  ["shared-fault", "Shared daemon fault diagnosis"],
12
12
  ["shared-decisions", "Consolidate authorization requests"],
13
13
  ["commitment-followup", "Follow up on recovery commitments"],
@@ -86,7 +86,7 @@ export function registerCommitments(pi: ExtensionAPI, onFailure: (ctx: Extension
86
86
  if (!enabled()) return reply("Commitment follow-up is disabled.");
87
87
  const branch = ctx.sessionManager.getBranch();
88
88
  const outcome = outcomeId(branch);
89
- if (!outcome) return reply("No active Outcome.");
89
+ if (!outcome) return reply("No active Goal.");
90
90
  const items = records(branch);
91
91
  if (p.action === "status" && !p.id) return reply([...items.values()].map(describe).join("\n\n") || "No recorded commitments.");
92
92
  if (p.action === "accept") {
@@ -99,7 +99,7 @@ export function registerCommitments(pi: ExtensionAPI, onFailure: (ctx: Extension
99
99
  return reply(describe(c));
100
100
  }
101
101
  const c = items.get(p.id ?? "");
102
- if (!c) throw new Error("Unknown commitment in this Outcome.");
102
+ if (!c) throw new Error("Unknown commitment in this Goal.");
103
103
  if (p.action === "status") return reply(describe(c));
104
104
 
105
105
  const latest = branch.map(e => e.type === "custom" && e.customType === ENTRY && (e.data as Commitment)?.id === c.id).lastIndexOf(true);
@@ -28,7 +28,7 @@ export function registerDecisionTool(pi: ExtensionAPI, connect: typeof openSuper
28
28
  const branch = ctx.sessionManager.getBranch();
29
29
  const scope = scopeEvidence(branch);
30
30
  const revision = scope?.revision;
31
- if (!scope || !revision || !ctx.isProjectTrusted()) return reply("requires an active Outcome in a trusted workspace");
31
+ if (!scope || !revision || !ctx.isProjectTrusted()) return reply("requires an active Goal in a trusted workspace");
32
32
  const current = () => ctx.sessionManager.getSessionId() === session &&
33
33
  scopeEvidence(ctx.sessionManager.getBranch())?.revision === revision && scenarioRevision("shared-decisions") === setting;
34
34
  const key = digest(JSON.stringify([proposal.reference, proposal.operation, proposal.host, proposal.resource, proposal.effect]));
@@ -40,7 +40,7 @@ export function registerDecisionTool(pi: ExtensionAPI, connect: typeof openSuper
40
40
  const entry = branch[index];
41
41
  const last = entry?.type === "custom" ? entry.data as DecisionRecord : undefined;
42
42
  if (verifyToolCallId) {
43
- if (last?.status !== "approved") return reply("no approved decision in this Outcome");
43
+ if (last?.status !== "approved") return reply("no approved decision in this Goal");
44
44
  if (last.result === verifyToolCallId) return reply(last.successful ? "verified" : "verification failed");
45
45
  const proof = branch.slice(index + 1).find(e => e.type === "message" && e.message.role === "toolResult" &&
46
46
  e.message.toolCallId === verifyToolCallId && !e.message.toolName.startsWith("supervisor_"));
@@ -162,7 +162,7 @@ export function installSupervisor(pi: ExtensionAPI, connect: typeof openSupervis
162
162
  }
163
163
  }
164
164
  }
165
- const scopeChange = "The owner revised the Outcome or Todo.";
165
+ const scopeChange = "The owner revised the Goal or Todo.";
166
166
  function reviewPlan(ctx: ExtensionContext) {
167
167
  if (enabledScenarios().includes("scope-review") && planShape(ctx) !== reviewedShape)
168
168
  void review(ctx, "scope-review", scopeChange);
@@ -170,7 +170,7 @@ export function installSupervisor(pi: ExtensionAPI, connect: typeof openSupervis
170
170
  // User instructions can revise scope without updating Todo in the same turn.
171
171
  pi.on("agent_end", (_event, ctx) => { reviewPlan(ctx); });
172
172
  pi.registerTool({
173
- name: "supervisor_review", label: "Review Outcome",
173
+ name: "supervisor_review", label: "Review Goal",
174
174
  description: "Consult Supervisor about scope or a possible progress stall. Shares the proactive review and returns prior advice without another push.",
175
175
  parameters: Type.Object({ scenario: StringEnum(["scope-review", "stall-diagnosis"] as const) }),
176
176
  async execute(_id, { scenario }, _signal, _update, ctx) {
@@ -186,7 +186,7 @@ export function installSupervisor(pi: ExtensionAPI, connect: typeof openSupervis
186
186
  if (event.toolName === "update_todo" && !event.isError) {
187
187
  reset();
188
188
  recordProgress(ctx);
189
- if (event.input.todo || event.input.outcome) reviewPlan(ctx);
189
+ if (event.input.todo || event.input.goal || event.input.outcome) reviewPlan(ctx);
190
190
  return;
191
191
  }
192
192
  if (!enabledScenarios().includes("stall-diagnosis")) { repeats.reset(); return; }
@@ -4,14 +4,19 @@ import type { PlanRenderTheme } from "./plan-presentation.js";
4
4
  export interface CompactTaskHeader {
5
5
  subtitle?: string;
6
6
  disclosure?: string;
7
- runtime?: { status: string; clock?: string };
7
+ onStartButton?: (row: number, left: number, right: number) => void;
8
+ runtime?: { status: string; clock?: string; subject?: "workflow" };
8
9
  /** Preformatted high-level ledger counts shown in the existing Todo surface. */
9
10
  ledger?: string;
10
11
  }
11
12
 
13
+ function runtimeLabel(runtime: NonNullable<CompactTaskHeader["runtime"]>): string {
14
+ return `${runtime.subject ?? "goal"} ${runtime.status}`;
15
+ }
16
+
12
17
  export function canRenderTaskRuntime(width: number, runtime: CompactTaskHeader["runtime"]): boolean {
13
18
  if (!runtime || !Number.isFinite(width)) return false;
14
- return visibleWidth(runtime.status + (runtime.clock ? ` ${runtime.clock}` : "")) + 6 <= Math.floor(width);
19
+ return visibleWidth(runtimeLabel(runtime) + (runtime.clock ? ` ${runtime.clock}` : "")) + 6 <= Math.floor(width);
15
20
  }
16
21
 
17
22
  export function renderCompactTaskHeader(summary: string | undefined, width: number, theme: PlanRenderTheme, header: CompactTaskHeader, inProgress = false): string[] {
@@ -20,7 +25,7 @@ export function renderCompactTaskHeader(summary: string | undefined, width: numb
20
25
  (summary ? theme.fg("dim", ` ${summary}`) : "");
21
26
  const runtime = header.runtime;
22
27
  const tone = runtime?.status === "complete" ? "success" : runtime?.status === "active" ? "accent" : "warning";
23
- const right = runtime ? theme.fg(tone, runtime.status) + (runtime.clock ? theme.fg("dim", ` ${runtime.clock}`) : "") : "";
28
+ const right = runtime ? theme.fg(tone, runtimeLabel(runtime)) + (runtime.clock ? theme.fg("dim", ` ${runtime.clock}`) : "") : "";
24
29
  const rightWidth = visibleWidth(right);
25
30
  const showRuntime = right && canRenderTaskRuntime(size, runtime);
26
31
  const leftWidth = showRuntime ? Math.max(4, size - rightWidth - 2) : size;
@@ -43,6 +48,16 @@ export function renderCompactTaskHeader(summary: string | undefined, width: numb
43
48
  const text = header.ledger.replace(/[\r\n\t]+/g, " ").replace(/ {2,}/g, " ").trim();
44
49
  details.push(" ".repeat(indent) + theme.fg("dim", truncateToWidth(text, size - indent)));
45
50
  }
46
- if (details.length > 0) lines.push(...details, "");
51
+ if (details.length > 0) {
52
+ lines.push(...details);
53
+ const fullLabel = "[Start Goal · Alt+G]";
54
+ const label = indent + fullLabel.length <= size ? fullLabel : "[Start]";
55
+ if (header.onStartButton && size >= indent + label.length) {
56
+ header.onStartButton(lines.length, indent, indent + label.length);
57
+ lines.push(" ".repeat(indent) + theme.fg("accent", label));
58
+ } else {
59
+ lines.push("");
60
+ }
61
+ }
47
62
  return lines;
48
63
  }
@@ -33,7 +33,7 @@ function diagramNodes(run: WorkflowRun, selected?: string): WorkflowNode[] {
33
33
  });
34
34
  }
35
35
 
36
- export function renderDynamicFrame(run: WorkflowRun, width: number, theme: WorkflowTheme, expanded: boolean, header: CompactTaskHeader, selected?: string): WorkflowFrame {
36
+ export function renderDynamicFrame(run: WorkflowRun, width: number, theme: WorkflowTheme, expanded: boolean, header: CompactTaskHeader, selected?: string, leftShare = 0.5): WorkflowFrame {
37
37
  const size = Math.max(1, Math.floor(width));
38
38
  const rows = run.steps.map(step => {
39
39
  const state = phase(run, step);
@@ -48,10 +48,10 @@ export function renderDynamicFrame(run: WorkflowRun, width: number, theme: Workf
48
48
  const completed = rows.filter(row => row.state === "complete").length;
49
49
  const total = rows.filter(row => row.state !== "standby").length;
50
50
  const heading = renderCompactTaskHeader(completed + "/" + total, size, theme, {
51
- ...header, subtitle: run.objective, runtime: header.runtime ?? { status: run.evidence ? "complete" : "active" },
51
+ ...header, subtitle: run.objective, runtime: header.runtime ?? { subject: "workflow", status: run.evidence ? "complete" : "active" },
52
52
  });
53
53
 
54
- const frame = renderWorkflowFrame(rows, diagramNodes(run, selected), heading, size, theme, expanded);
54
+ const frame = renderWorkflowFrame(rows, diagramNodes(run, selected), heading, size, theme, expanded, leftShare);
55
55
  const step = run.steps.find(s => s.id === selected);
56
56
  if (step) {
57
57
  const entry = run.history.filter(h => h.step === step.id).at(-1);