pi-goal-x 0.18.0 → 0.18.1

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.
@@ -355,7 +355,7 @@ export class GoalWidgetComponent implements Component {
355
355
 
356
356
  render(width: number): string[] {
357
357
  const settings = this.getSettings();
358
- const lines = renderGoalWidgetLines(this.getGoal(), this.theme, width, {
358
+ let lines = renderGoalWidgetLines(this.getGoal(), this.theme, width, {
359
359
  openGoalCount: this.getOpenGoalCount(),
360
360
  auditorProgress: this.getAuditorProgress(),
361
361
  disableTasks: settings.disableTasks,
@@ -363,6 +363,12 @@ export class GoalWidgetComponent implements Component {
363
363
  if (this.getDebugMode()) {
364
364
  lines.push(...this.renderDebugPanel(width));
365
365
  }
366
+ // Safety net: ensure no returned line exceeds the terminal width
367
+ for (let i = 0; i < lines.length; i++) {
368
+ if (visibleWidth(lines[i]) > width) {
369
+ lines[i] = truncateToWidth(lines[i], width);
370
+ }
371
+ }
366
372
  return lines;
367
373
  }
368
374
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-goal-x",
3
- "version": "0.18.0",
3
+ "version": "0.18.1",
4
4
  "description": "Goal mode extension for pi: persistent long-running objectives, /goal-set drafting, Sisyphus prompt style, autoContinue, and an above-editor status overlay. Fork of @capyup/pi-goal.",
5
5
  "license": "MIT",
6
6
  "author": "pi-goal-x contributors",
package/docs/CHANGELOG.md DELETED
@@ -1,160 +0,0 @@
1
- # Changelog
2
-
3
- ## 0.18.0 (2026-05-29)
4
-
5
- ### Features
6
-
7
- - **Enriched confirmation dialog** — proposal dialogs now render with full-width box-drawing section headers (`┌─ Section Name ─────┐`), per-status task coloring (`[x]` green, `[ ]` yellow), and goal structure section highlighting (`Objective:`, `Success criteria:`, etc. in accent). The 12-line MAX_CONTEXT_LINES cap is removed — full proposals are always visible.
8
- - **Hidden TUI debug mode** — Ctrl+Shift+X toggles a debug panel in the goal widget. Ctrl+Shift+N creates/removes test goals (written to `.pi/goals/debug/`), Ctrl+Shift+T injects sample tasks, Ctrl+Shift+R starts a mock audit, Ctrl+Shift+O opens the proposal dialog with realistic data.
9
-
10
- ### Fixes
11
-
12
- - **Text wrapping inside boxes** — pipe-prefixed lines (`│ content`) that wrap now maintain the `│ ` prefix on continuation lines, keeping wrapped text inside the ASCII box. Task checkbox lines embedded in objective text also get the `│ ` prefix so they appear within the box.
13
-
14
- ### Tests
15
-
16
- - 310 total tests (unchanged).
17
-
18
- ## 0.17.0 (2026-05-29)
19
-
20
- ### Features
21
-
22
- - **Per-goal auditor toggle** — press `a` during the confirmation dialog to toggle the auditor on/off for a specific goal. Default from settings; override persists within session.
23
- - **Task workflow prompt guidance** — added `[TASK WORKFLOW]` section to both `goalPrompt` and `continuationPrompt`, directing agents to complete subtasks one-by-one as progress trackers (not batch-marking at the end).
24
- - **Recursive duplicate ID validation** — `validateTaskListProposal` now checks all task IDs across the entire tree, preventing collisions between parent/subtask or sibling subtask IDs.
25
- - **Escape dialog during audit** — pressing Escape during a completion audit shows a TUI dialog with "Mark complete without audit" or "Continue working" options.
26
-
27
- ### Fixes
28
-
29
- - `validateTaskCompletion` and `validateTaskSkip` now use recursive `findTaskInTree` instead of flat `Array.find()` for nested subtask support.
30
- - Updated README references from legacy `update_goal` to `complete_goal`.
31
-
32
- ### Tests
33
-
34
- - 310 total tests (up from 308).
35
- - Added tests for recursive duplicate ID detection across nested subtask trees.
36
- - Added e2e test for `skipAuditor=true` path.
37
-
38
- ## 0.16.1 (2026-05-29)
39
-
40
- ### Features
41
-
42
- - **Escape-to-skip audit** — press Escape during an auditor run to abort it and complete the goal immediately. The skip is recorded in the ledger with the reason `user_aborted` and auditor model metadata.
43
- - **Audit progress widget** — the TUI shows a spinner, progress bar, step labels, current tool, and output lines while the auditor runs.
44
- - **Audit abort detection** — the auditor detects aborts both from exceptions and from `session.prompt()` returning after an abort signal, preventing stuck goals or ghost states.
45
- - **Goal status for Sisyphus** — `COMPLETED` status label for completed Sisyphus goals.
46
- - **Multi-session focus isolation** — goal focus data uses `goalFocusDetails` which includes the goal id and reason but not full balance data, preventing cross-session focus leakage.
47
-
48
- ### Fixes
49
-
50
- - Fixed a merge bug where `propose_task_list` could produce duplicate task list when called during a continuation.
51
-
52
- ## 0.16.0 (2026-05-29)
53
-
54
- ### Features
55
-
56
- - **`delete_goal` tool** — new lifecycle tool for archiving goals by id. Accepts a required `goalId` and optional `reason`. Agent-facing only; not intended for user use.
57
- - **`complete_goal` `status` optional** — the `status` parameter on `complete_goal` is now optional. When omitted, defaults to `"complete"`. Explicitly setting an invalid value (anything other than `"complete"`) still produces an error.
58
- - **SCROLL FIX** — the confirmation dialog no longer scrolls to the bottom when the user is scrolled up and new content arrives. Uses `addContextWrapped()` which suppresses viewport resets.
59
- - **Task list shown first** — the task list section now appears FIRST in the confirmation dialog context (before the objective), with context capped at 12 lines so tasks don't scroll off-screen.
60
- - **Audit completion flow** — the completion report card no longer says "Goal audit approved." when the auditor was skipped (now shows "Goal audit skipped." with reason).
61
-
62
- ### Fixes
63
-
64
- - Fixed task completion/skip validation for nested subtasks (uses recursive `findTaskInTree`).
65
- - All `complete_goal` calls default to `status: "complete"` when no explicit status is provided.
66
- - Updated prompts and tool descriptions to reflect the `complete_goal` naming.
67
-
68
- ### Tests
69
-
70
- - Updated e2e tests to verify `complete_goal` accepts calls without status.
71
- - Added e2e test verifying `complete_goal` rejects invalid explicit status.
72
-
73
- ## 0.15.1 (2026-05-28)
74
-
75
- ### Fixes
76
-
77
- - Fixed settings file reference in storage writes.
78
-
79
- ### Documentation
80
-
81
- - Reorganized README settings documentation for clarity.
82
-
83
- ## 0.14.0 (2026-05-27)
84
-
85
- ### Features
86
-
87
- - **Subtask hierarchy** — tasks can have nested sub-tasks via `subtasks?: GoalTask[]`. Subtask depth controlled by `subtaskDepth` setting (default: 1). Deep subtrees are rejected at proposal.
88
- - **Lightweight subtasks** — `lightweightSubtasks?: boolean` on tasks. When true, parent can complete regardless of subtask status. Full subtasks require all sub-items completed first.
89
- - **Per-task contracts** — `propose_task_list` supports optional `verificationContract` per task. If set, `complete_task` requires a non-empty `verificationSummary`.
90
- - **Task list block** — tasks are listed in prompts with checkboxes and status indicators.
91
-
92
- ### Tests
93
-
94
- - Added e2e tests for goal creation with task list, scroll fix, and subtask validation.
95
-
96
- ## 0.13.0 (2026-05-22)
97
-
98
- ### Features
99
-
100
- - **Verification contract system** — goals can include a `Verification contract:` section. Extracted and stored on the goal record. `complete_goal` rejects calls without `verificationSummary` when a contract is set.
101
- - **Per-goal verification contracts** — the contract is extracted during goal drafting and enforced by tools and prompts.
102
- - **`complete_goal` `testResults` removed** — replaced with `verificationSummary`. The old structured test results interface is gone.
103
- - **Auditor integration** — the independent completion auditor receives both the `verificationContract` and `verificationSummary` and cross-checks claims against real artifacts.
104
-
105
- ### Tests
106
-
107
- - Updated verification contract tests.
108
-
109
- ## 0.12.0 (2026-04-29)
110
-
111
- ### Features
112
-
113
- - **Task list system** — `propose_task_list` tool with confirmation dialog. Tasks stored on goal record, rendered in prompts and widget, serialized to disk.
114
- - **Unified goal + task acceptance** — `propose_goal_draft` accepts optional `tasks` array. Single dialog shows goal + task list together.
115
- - **`complete_task` and `skip_task` tools** — per-task completion with evidence/verificationSummary. Neither stops the turn.
116
- - **`update_goal` renamed to `complete_goal`** — the core completion tool now uses `complete_goal({status: "complete"})` and requires explicit status acceptance.
117
- - **Completion report heading fix** — the report now shows `Goal complete.` instead of `Goal audit approved.` when no contract or auditor is involved.
118
-
119
- ### Tests
120
-
121
- - Full task lifecycle tests (policy, round-trip, render, edge cases).
122
- - Verification contract tests for both goal-level and per-task contracts.
123
-
124
- ## 0.11.0 (2026-04-23)
125
-
126
- ### Features
127
-
128
- - **Deferred archival** — goals are archived at `turn_end`, not inline in the tool handler. Prevents premature archiving before the agent sees the audit result.
129
- - **`propose_goal_tweak`** — sole mechanism for updating the goal objective during `/goal-tweak`. Uses the same Confirm/Continue Chatting dialog as goal creation.
130
- - **Focus isolation** — goal focus is stored as a branch-local session entry, not in goal markdown metadata. Multiple sessions can have different focused goals.
131
- - **Auditor bypass with user confirmation** — `confirmBypassAuditor: true` bypasses the auditor when the user explicitly opts out.
132
-
133
- ### Fixes
134
-
135
- - Cleaned up lifecycle issues with AbortSignal wiring and timer cleanup.
136
-
137
- ## 0.10.0 (2026-04-15)
138
-
139
- ### Features
140
-
141
- - **Completion audit system** — independent pi auditor agent verifies completion claims before archiving.
142
- - **Audit progress** — real-time TUI progress widget with spinner, progress bar, and step labels.
143
- - **Ledger system** — structured event log for all goal lifecycle events.
144
-
145
- ## 0.9.0 (2026-04-08)
146
-
147
- ### Features
148
-
149
- - **`goal_question` and `goal_questionnaire`** — structured drafting question tools.
150
- - **`/goal-settings`** — interactive settings configuration.
151
- - **Sisyphus goal style** — patient ordered execution with prompt/criteria variant.
152
-
153
- ## 0.8.1 (2026-04-01)
154
-
155
- ### Features
156
-
157
- - Initial fork from @capyup/pi-goal.
158
- - Pause/resume/abort lifecycle.
159
- - Multiple open goals.
160
- - Auto-continue loop.