pi-better-harness 0.67.0 → 0.67.2

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 (3) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +42 -531
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.67.2] - 2026-12-04
4
+
5
+ ### Changed
6
+
7
+ - npm and pi.dev now use the GitHub homepage README with three feature recordings and the installation guide.
8
+
9
+ ## [0.67.1] - 2026-12-04
10
+
11
+ ### Changed
12
+
13
+ - The package README opens with a 12-second terminal demo and links to installation, the feature index and the extension comparison.
14
+
3
15
  ## [0.67.0] - 2026-12-04
4
16
 
5
17
  ### Changed
package/README.md CHANGED
@@ -1,563 +1,74 @@
1
- # pi-better-harness
1
+ <h1 align="center"><picture><source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/1aboveio/pi-better-harness/main/docs/images/brand/logo-on-charcoal.webp"><img src="https://raw.githubusercontent.com/1aboveio/pi-better-harness/main/docs/images/brand/logo.png" alt="" width="34" height="34" align="absmiddle"></picture> Pi Better Harness</h1>
2
2
 
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" />
3
+ <p align="center">Track each step in <a href="https://pi.dev">Pi</a> and keep using the prompt while tests run or a second Pi reviews your code.</p>
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 Goal & Todo.
5
+ <p align="center">
6
+ <a href="https://github.com/1aboveio/pi-better-harness#features">Features</a> ·
7
+ <strong><a href="https://github.com/1aboveio/pi-better-harness#installation">Install</a></strong> ·
8
+ <a href="https://github.com/1aboveio/pi-better-harness/blob/main/docs/extension-comparison.md" title="Compare Pi extensions">Compare</a> ·
9
+ <a href="https://github.com/1aboveio/pi-better-harness/blob/main/llms.txt" title="Feature index for agents">For agents</a>
10
+ </p>
6
11
 
7
- ## Quick Answer
12
+ <p align="center">
13
+ <a href="https://github.com/1aboveio/pi-better-harness/blob/main/docs/native-pi-comparison.md#csv-release-check">
14
+ <picture>
15
+ <source media="(prefers-reduced-motion: reduce)" srcset="https://raw.githubusercontent.com/1aboveio/pi-better-harness/main/docs/images/package-gallery/csv-release-check-poster.webp">
16
+ <img src="https://raw.githubusercontent.com/1aboveio/pi-better-harness/main/docs/images/package-gallery/csv-release-check.webp" width="1000" alt="Watch Pi track two todos. Tree view shows npm test under the main agent while a subagent reviews CSV quoting.">
17
+ </picture>
18
+ </a>
19
+ </p>
8
20
 
9
- Use `pi-better-harness` when you want the full working set for Pi. It manages:
21
+ <a name="watch-native-pi-and-harness-side-by-side"></a><a name="core-features"></a>
10
22
 
11
- - `pi-better-sandbox` for an opt-in write sandbox around Pi's foreground tools.
12
- - `pi-better-subagents` for detached, sandboxed subagent runs.
13
- - `pi-better-background-tasks` for durable shell tasks and watchers.
14
- - `pi-better-server` provides the shared task runtime and opt-in remote session commands.
15
- - `pi-better-ssh` for short remote commands over reusable SSH connections.
16
- - `pi-better-goal` for explicit triggers, pause/resume, and background-aware continuation.
17
- - Harness-owned Goal & Todo for session context and checklist progress. Saved work appears in the panel. Automatic Goal execution defaults to Off.
23
+ ## Features
18
24
 
19
- Both Harness install methods include the shared server for subagents and background tasks. Remote session commands are off by default. Set `PI_BETTER_SERVER_ENABLE_REMOTE=1` before starting Pi to enable `/harness-settings remote` and `/harness-settings detach`. The same variable enables the `pi-remote` CLI.
25
+ Each recording uses the same CSV exporter project. **Native Pi** is on the left and **Pi Better Harness** is on the right.
20
26
 
21
- `pi-better-read-aloud` is intentionally not included yet.
27
+ ### Todo and tool call folding
22
28
 
23
- ## Official Codex model prompts
29
+ Watch the checklist go from **0/2 to 2/2** as Pi inspects the exporter and runs its tests. When Pi finishes, Harness folds the eight tool calls into one line by default.
24
30
 
25
- When **Use model instruction templates for matching OpenAI models** is on for a matching model on `openai` or `openai-codex`, Harness loads OpenAI's exact
26
- `model_messages.instructions_template` alongside Pi's own instructions. Both
27
- foreground and isolated worker sessions use the packaged catalog. No local
28
- Codex installation, network request or Codex model cache is required.
29
- Open **Prompts → Model instruction templates** in the Web console to toggle the setting or read the original template by release and model. It defaults to Off and changes apply on the next prompt. Select a connected session under **Source** to
30
- read its loaded version. The viewer includes the upstream commit and SHA-256.
31
- Sessions pin the release on first use and retain it across resume and fork.
32
- Use `/reload` after upgrading Harness to adopt a newer packaged release.
31
+ https://github.com/user-attachments/assets/daf84108-38c7-4402-81f2-7a563221036f
33
32
 
34
- The daily synchronization workflow resolves the latest stable release of
35
- `openai/codex` to its commit and proposes a snapshot update. A repository can
36
- provide a scoped `CODEX_PROMPT_SYNC_TOKEN` with contents and pull requests write
37
- access when its default Actions token cannot open PRs. Run
38
- `node scripts/sync-codex-model-prompts.mjs` to reproduce the update.
39
- The separate opt-in `node scripts/codex-model-prompt.eval.mjs 2` uses the
40
- configured OpenAI provider for paired first-action probes with inert tools.
33
+ [Todo setup](https://github.com/1aboveio/pi-better-harness/blob/main/packages/pi-better-harness/docs/usage.md#goal--todo) · [Tool output settings](https://github.com/1aboveio/pi-better-harness/blob/main/packages/pi-better-harness/README.md#minimal-tool-output) · [MP4 · 18s](https://github.com/1aboveio/pi-better-harness/blob/main/docs/images/package-gallery/compare/todo.mp4)
41
34
 
42
- <a id="outcome--todo"></a>
43
- ## Goal & Todo
35
+ ### Subagents
44
36
 
45
- The Goal records what the user wants to achieve. Its Todo lists the steps. The
46
- panel shows checklist progress on the left and Goal status on the right. A
47
- saved Goal has a **Resume** button, even without a checklist. Click it, press
48
- **Alt+G**, or enter `/goal resume` to start the saved work. The Goal keeps any
49
- existing checklist. Use `/goal pause` to interrupt foreground work and hold continuation.
37
+ Ask a second Pi to review how the exporter handles commas. **The main prompt is ready** while the reviewer works. Its findings come back to the same conversation.
50
38
 
51
- `/harness-settings` has one Goal setting, **Auto-start Goals** (default **Off**).
52
- Turn it on to start a newly saved Goal with acceptance criteria, restart explicitly
53
- reopened work, or bind a Goal when invoking `/skill:rush-issues` or
54
- `/skill:resolve-issues`. Changing the switch takes effect on the next such action.
55
- With it off, use `/goal resume` to start saved work manually.
39
+ https://github.com/user-attachments/assets/c00b4ac0-9070-4831-b3de-b22c1b626bba
56
40
 
57
- The panel shows `goal saved` before execution starts and `goal active` with a
58
- clock while it runs. Use `/harness-settings todo` to reveal the panel and `/harness-settings todo expand` to see
59
- all steps. `get_todo` returns the full Goal and Todo, including acceptance criteria
60
- and boundaries. Completing a step updates checklist progress. The Goal stays
61
- open until its completion is recorded.
41
+ [Subagent tools](https://github.com/1aboveio/pi-better-harness/blob/main/packages/pi-better-subagents/docs/usage.md#tools) · [MP4 · 21s](https://github.com/1aboveio/pi-better-harness/blob/main/docs/images/package-gallery/compare/subagent.mp4)
62
42
 
63
- Use `update_todo({ goal: { objective, doneWhen, boundaries }, todo })` to save
64
- work. Any of `doneWhen`, `boundaries` and `todo` may be omitted. Set
65
- `newTask: true` for an unrelated task. Existing session records, settings and
66
- clients using the legacy `outcome` field remain supported.
43
+ ### Background tasks
67
44
 
68
- Todo uses the same workflow view for a bound task plan and a dynamic workflow.
69
- The task list and diagram start at equal widths. Drag their divider in fullscreen Pi
70
- or enter `/harness-settings todo split 3:2` to give the task list three fifths of the available width.
71
- The session remembers the ratio across reloads. Use `/harness-settings todo split 1:1` to restore equal columns.
72
- Below 36 terminal columns, the diagram follows the task list. Stage counts use the task symbols, so `Implement ●2` shows two tasks in progress. A pending stage shows `○`. In a mixed stage, `!1 ●2` shows one blocked task and two running.
45
+ Ask Pi a question while `npm test` runs. The task row shows elapsed time, and **Pi reports the result** when all three tests pass. An active Goal can check that result against its acceptance criteria.
73
46
 
74
- Existing Plan session histories restore as Todo. Workflow task-plan files and
75
- revision checks continue to govern workflow-owned plans. See the [usage guide](docs/usage.md#goal--todo).
47
+ https://github.com/user-attachments/assets/44f54db3-6573-4859-8c30-ee8573c3d6a8
76
48
 
77
- ### Dynamic workflows
49
+ [Background task tools](https://github.com/1aboveio/pi-better-harness/blob/main/packages/pi-better-background-tasks/docs/usage.md#tools) · [Completion callbacks](https://github.com/1aboveio/pi-better-harness/blob/main/packages/pi-better-background-tasks/docs/usage.md#completion-callbacks) · [MP4 · 37s](https://github.com/1aboveio/pi-better-harness/blob/main/docs/images/package-gallery/compare/background-task.mp4)
78
50
 
79
- Run `/harness-settings dynamic-workflow` to plan the current task once. In `/harness-settings`,
80
- **Automatic dynamic workflows (Beta)** defaults to **Off**. With **On**, Pi handles
81
- simple requests directly and can plan a workflow for dependencies, role handoffs
82
- or repeated review. Existing **Adaptive** settings are treated as **On**.
83
- The command works with either setting and keeps your saved preference.
51
+ <a name="try-it"></a><a name="install-the-whole-harness"></a>
84
52
 
85
- The agent records an objective, acceptance criteria, required outputs and task
86
- dependencies. When the steps form a single chain in list order, the task list
87
- uses the full width. Parallel branches, joins and review loops keep their
88
- diagram as work progresses. The list uses full task titles. The diagram uses
89
- short step or stage labels such as `Code review` and `UX review`.
90
- Task icons distinguish ready (○), working (●), waiting (·), optional standby (–),
91
- failed (×), and completed (✓) steps. In mouse-enabled Pi, click a task to highlight
92
- its stage and inspect its latest result. Use `/harness-settings todo expand` to show every task.
93
- Independent tasks can run together. A join waits for each prerequisite's output.
94
- If a reviewer requests changes, the revision opens and the revised artifact
95
- returns to review. Delivery waits for approval of the current version.
53
+ ## Installation
96
54
 
97
- The agent can select an inspected catalog role or named agent for a step.
98
- The ordinary subagent launch applies the catalog skills and current permissions.
99
- Harness associates the returned assignment and its verified result with the step.
100
- Resume the session branch to continue from its saved outputs. A bound Goal also
101
- requires evidence for its objective. A standalone workflow can finish on its own.
102
-
103
- The separate **Project work ledger** setting enables a durable project-scoped
104
- record of the overall outcome, boundaries, and high-level items. It stays off by
105
- default; turning it off removes ledger views and hints without deleting records.
106
- The same `update_todo` / `get_todo` interface carries optional ledger payloads and
107
- selectors for create, update, attach, detach, list, and read. Updates require the
108
- current revision, preserve completed evidence and history, and never associate old
109
- work with a new session automatically. Use `/harness-settings ledger attach <id>` (or an explicit
110
- `update_todo` ledger attach) to continue the same record; `/harness-settings ledger list`,
111
- `/harness-settings ledger switch`, and `/harness-settings ledger detach` manage the reference without copying it. A
112
- resumed session keeps its reference, a fresh session stays unassociated, and
113
- bounded recovery reminders after compaction or resume are rebuilt from durable
114
- state. Workflow-owned rows keep their canonical stage/status rendering; the
115
- ledger adds context, not a second execution model. See
116
- [usage](docs/usage.md#associate-a-ledger-with-a-session).
117
-
118
- Subagent and background-task rows can be clicked to open their existing navigator
119
- details. Enter and keyboard controls remain available, and editor input stays
120
- passive. Harness packages do not write to Pi's status bar. Goal holds and resume
121
- instructions remain available through `/goal`; permission checks are unchanged.
122
-
123
- ## Screenshots
124
-
125
- <p><img src="https://raw.githubusercontent.com/1aboveio/pi-better-harness/main/docs/images/package-gallery/pi-better-harness.png" alt="pi-better-harness rendered in Pi" width="49%" /><img src="https://raw.githubusercontent.com/1aboveio/pi-better-harness/main/docs/images/package-gallery/overview/pi-better-harness.png" alt="pi-better-harness package overview" width="49%" /></p>
126
-
127
- ## Install
128
-
129
- Install the extensions as standalone Pi packages, so Pi displays and manages each by its own package name:
55
+ With Pi installed, run these commands in your project.
130
56
 
131
57
  ```sh
132
58
  npx pi-better-harness install
133
- ```
134
-
135
- For project-local Pi settings:
136
-
137
- ```sh
138
- npx pi-better-harness install --local
139
- ```
140
-
141
- 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.
142
-
143
- The single-bundle installation remains available:
144
-
145
- ```sh
146
- pi install npm:pi-better-harness
147
- ```
148
-
149
- To add model routing, run `pi install npm:pi-better-model-router` and select
150
- `router/deepseek-flash-auto` in `/model`. The router package includes the Ollama
151
- Cloud provider and requires Pi's `registerVirtualModel` API.
152
-
153
- After a normal bundle install or `pi update`, Harness masks any separately loaded
154
- `pi-better-plan` package before Pi registers its tools, `/plan` command, widgets,
155
- or prompt hooks. This applies in either load order. The old registration and cached files may remain, but are inactive while
156
- Harness is loaded. Settings and session history are not rewritten. The explicit
157
- installer above removes the old registration in its selected scope instead.
158
-
159
- ## Ordinary Startup
160
-
161
- You keep launching Pi the way you always have:
162
-
163
- ```sh
164
59
  pi
165
60
  ```
166
61
 
167
- The foreground write sandbox starts inactive. Use `/harness-settings sandbox on` for the current
168
- session or `/harness-settings sandbox default on` to persist opt-in across startup, new session,
169
- resume, fork, and reload. There is no launcher.
170
-
171
- While it is on, Pi's built-in `bash`, `write`, and `edit` tools, your own `!` / `!!` commands, local background tasks, and subagents can write only under the directory you launched Pi from, minus the packaged deny paths (`.git/hooks`, `.env`, `.env.local`).
172
-
173
- **Reads and network access are unrestricted** — this sandbox limits writes only. Writes are confined for those integrated first-party execution paths; Pi's own process, arbitrary `pi.exec` calls, and unrelated third-party extension code are **not** confined. Confinement is also **per surface**: each integrated surface denies its own control plane, not every other surface's, so with several first-party surfaces installed a confined process on one can still write another's control plane.
174
-
175
- Sandbox state is human-only: `/harness-settings sandbox`, `/harness-settings sandbox on`, `/harness-settings sandbox off`,
176
- `/harness-settings sandbox default on|off`, `/harness-settings sandbox deny ...`, and `/harness-settings sandbox rules` are slash
177
- commands with no tool equivalent. `/harness-settings sandbox off` and `/harness-settings sandbox default off`
178
- need interactive confirmation. Full policy: [pi-better-sandbox](https://github.com/1aboveio/pi-better-harness/tree/main/packages/pi-better-sandbox#readme).
179
-
180
- ## Minimal Tool Output
181
-
182
- In the interactive TUI, **Tool output** defaults to **Compact**. Choose **Normal** in
183
- `/harness-settings` for ordinary tool output.
184
-
185
- Minimal mode folds each tool call into a single-line header, including running
186
- calls. The tool-specific icon and tool name share a state color: accent while
187
- running, muted when completed, and error-colored when failed. In fullscreen Pi, a soft highlight travels through the entire visible running tool name and its
188
- inline command/path details; details stay dim between highlight passes. Scrollback terminals keep static state colors.
189
- Choose **Tool progress animation** set to **Off** in `/harness-settings` for static running headers.
190
- Running and failed calls retain text labels so state never depends on color or
191
- motion alone. Tool rows are indented two columns past
192
- the assistant text padding. Long
193
- headers are truncated to the terminal width; result bodies,
194
- images, boxes, and tool spacers are hidden. Built-in, extension, and MCP calls
195
- are included. Tools without a custom call renderer use a generic icon and a
196
- compact argument hint. Compaction summaries also collapse to one quiet row with
197
- the pre-compaction token count; Ctrl+O reveals their original summary.
198
- Custom transcript messages from any extension also fold to a quiet disclosure
199
- row with the message type and first content line. This includes background
200
- completion batches and subagent health/timing alerts. Ctrl+O or a fullscreen
201
- click reveals the original content and any custom renderer. Direct UI notices
202
- are unchanged.
203
- Execution, sandboxing, and agent-facing payloads are unchanged.
204
- When a foreground run ends, each consecutive block of tool calls folds further
205
- into one disclosure row showing the call count and any failures. Only the failure
206
- count uses the error color; the disclosure and total stay muted. Assistant text
207
- stays visible, and restored history uses the same folded view. In newer Pi
208
- fullscreen mode, click a block disclosure to reveal its call rows, then click a
209
- call to expand its original details. Hover highlights compact call and disclosure
210
- rows using the selection background (reverse video for themes without one), and
211
- tool icons sit centered in a three-column gutter. Click the disclosure again to refold the
212
- block; native expanded call/result clicks collapse individual details. Regular
213
- terminals keep mouse input for terminal selection and scrollback; Ctrl+O expands
214
- all original tool details in both modes and folds them again on the next toggle.
215
- Error result bodies are also
216
- hidden in minimal mode and remain available when expanded.
217
-
218
- Minimal mode also covers Harness tools: Subagents, Background Tasks, Goal, Todo,
219
- catalog inspection, and SSH. Compact calls retain the run or task ID, launch name
220
- and task, background command, goal action, or plan summary without showing result
221
- bodies. Finished calls fold into the same disclosure blocks as built-in tools;
222
- expanding them restores their original package renderers. Goal and Todo widgets
223
- and the background-work navigator are independent UI surfaces and remain visible.
224
-
225
- Changing tool output saves the choice in
226
- global `settings.json` under `piBetterHarness.toolOutput`, as well as the current
227
- session. New sessions inherit it; resumed branches retain their own saved choice.
228
- This is a version-sensitive internal TUI adapter,
229
- tested with Pi 0.82.1, 0.99.1, and the bundled Pi 1.0.4 CLI; incompatible APIs
230
- produce a warning and leave ordinary output enabled. Print/RPC output and
231
- exported transcripts are unchanged.
232
-
233
- The installer includes this Harness-owned extension. To run it directly from a checkout:
234
-
235
- ```sh
236
- pi -e ./packages/pi-better-harness/extensions/minimal-output/index.ts
237
- ```
238
-
239
- ## Harness Settings
240
-
241
- Open `/harness-settings` or `/better-harness-settings` for the same menu.
242
- Use ←/→ or Tab/Shift+Tab to switch tabs, ↑/↓ to select a row, and Enter or Space to open or change it.
243
- The navigation stays in place while the selection scrolls. Esc returns from a page to the row that opened it. The slash menu also offers `/goal` and `/subagents`.
244
-
245
- | Tab | Settings and actions |
246
- | --- | --- |
247
- | Goals | Goal execution, Todo display and actions, project ledgers, workflow ownership and dynamic workflows |
248
- | Agents | Delegation, concurrency, run limits, skills, agent catalog and history |
249
- | Sandbox | Sandbox activation, permissions, protected paths and diagnostics |
250
- | Background | Current activity, wait reviews and completion delivery |
251
- | Display | Pinned panels, tool output and animation |
252
- | Supervision | Supervisor mode, scenarios and recovery commitments |
253
- | OpenAI Optimization | Responses compaction |
254
- | Prompts | Recaps, prompt editor and prompt experiments |
255
- | Remote | Connect to a host, pull a session or move it to a host |
256
- | Audio | Read a reply or selected text aloud and stop playback |
257
-
258
- The menu shows actions from loaded extensions. Remote appears when remote sessions are enabled.
259
- Audio appears when `pi-better-read-aloud` is installed. For scripts and direct access, both settings
260
- aliases accept an action and its arguments, for example `/harness-settings sandbox deny list`.
261
-
262
- Click **Flat / Tree** at the right of the Navigator or press **v** while it has focus to switch layouts.
263
- **Flat** (the default) keeps the Subagents
264
- and Background Tasks groups and includes tasks launched by subagents. Tree puts
265
- Main and subagents at the same level, with each agent's background tasks indented
266
- beneath it. Switching applies immediately and saves `piBetterHarness.navigatorView`.
267
- Worker-owned tasks expose status and logs; their execution remains managed by the
268
- owning agent. Older worker tasks appear when a retained assignment wait proves
269
- their parent, so unrelated sessions are never inferred from a reused conversation.
270
-
271
- **Pin work panels** controls the shared navigator used by Goal & Todo,
272
- Subagents, and Background Tasks. **On** (the default) keeps it above the input;
273
- **Off** places it in the conversation so it scrolls with chat. Changes apply
274
- immediately and save under `piBetterHarness.navigator` for future sessions.
275
- Package controls and detail views remain available in either mode. Standalone
276
- packages use the same shared navigator and saved preference.
277
-
278
- The hub includes **Tool output** and **Tool progress animation** when the bundled renderer
279
- extension is loaded. Changes apply immediately and save the default for future
280
- sessions. The animation preference is stored in `piBetterHarness.toolAnimation`;
281
- normal output and expanded tool details are never animated.
282
- The hub also owns **Completion delivery**, shared by Subagents and Background
283
- Tasks. Choose **When idle** (the default) or **During run**. Changes
284
- apply immediately and autosave to the current session branch, including across
285
- reloads. Press **Ctrl+S** to save the current choice as your default for future
286
- Pi sessions; changing a session afterward does not change that saved default.
287
- Saving a default leaves already-open sessions unchanged, including when
288
- navigating to a branch without a session override.
289
- The user default is stored in
290
- `<agent-dir>/settings.json` under `piBetterHarness.callbacks` and also applies
291
- when either callback package is loaded standalone. The former
292
- `PI_BETTER_CALLBACK_WHILE_BUSY` environment variable is no longer supported.
293
-
294
- All Harness-owned defaults use the `piBetterHarness` section of global
295
- `~/.pi/agent/settings.json` (or `PI_CODING_AGENT_DIR/settings.json`): tool output,
296
- Subagents configuration, callback delivery, Goal controls, and Sandbox activation,
297
- permissions, and deny-rule templates. Existing preference files migrate on first
298
- use after validation; global choices take precedence, and old files remain intact.
299
- Updates preserve Pi's own settings and other packages' choices. SSH profiles,
300
- plans, run records, and role/agent definitions remain in their existing stores:
301
- they are session data or reusable definitions, not global UI defaults.
302
- In `/harness-settings agents`, model and effort edits are session-local until Ctrl+S saves them
303
- to the user or trusted project's `agents/settings.json`. Markdown definitions
304
- remain unchanged, so bundled prompt updates keep applying. The Settings,
305
- Instructions, and Files tabs keep configuration separate from prompts.
306
- **Reset to bundled** in Settings restores model/effort without changing the
307
- prompt; in Instructions, it restores the prompt while preserving model/effort.
308
- A user Markdown override is archived when its prompt is reset. Saved defaults
309
- survive sessions and upgrades.
310
-
311
- ### OpenAI native compaction
312
-
313
- **Responses compaction** under **OpenAI Optimization** defaults to On. Manual `/compact` and automatic compaction use the provider’s native compressor. Switching it off applies to future compactions. It supports GPT models on OpenAI Responses and Codex Responses routes. If the standalone endpoint is unavailable, Harness tries the Responses compaction trigger. Routes without either capability use Pi’s summary.
314
-
315
- Pi saves the complete compacted window in the session journal alongside the boundary of the recent messages it kept. Restarting before that write leaves the previous history available for retry. After the write, Pi can reopen the session and reuse the saved window. Switching to another route restores the original Pi history for that route.
316
-
317
- The first request with a newly compacted prefix can be cold. Later turns reuse the same prefix, including across a restart. Cache hit rate depends on the length of the reusable input and the provider. To run the metered acceptance check, set `PI_NATIVE_COMPACTION_LIVE=1` and run `node --import tsx --test --test-name-pattern 'live GPT' packages/pi-better-harness/test/native-compaction.test.mjs` from the repository root with a configured `OPENAI_API_KEY`. The check reports each turn and requires more than 95% cached input on each of three warm follow-ups.
318
-
319
- ### Session recap
320
-
321
- Enable **Session recap** in `/harness-settings` to show a summary below the corresponding answer. The default is Off. The summary wraps after `↳ Recap:`. An agreed next step appears on its own line under the summary, marked `Next:`. Saved recaps scroll with the conversation and reappear on their original branch.
322
-
323
- Recap waits for the foreground turn and queued messages to settle and for the session’s background workers to drain. If a Goal exists, it must be paused or complete. A later pause or worker completion can produce the recap without another turn. Work that resumes during generation cancels the pending summary.
324
-
325
- **Recap prompt** changes the instructions for the next summary. Clear the prompt to restore the default. Each recap uses a separate request to the answering model with bounded recent conversation text. Saved recaps stay outside the main model’s context. Generation requires a Pi host with configured model streaming and transcript entry renderers.
326
-
327
- ### Harness instructions
328
-
329
- In the Web console, open **Prompts → Edit → Harness instructions**. Enable the block to edit its full-text override.
330
- Saving updates the Harness block and stores the text in the global Pi settings
331
- under `piBetterHarness.instructionsPrompt`. Turning the switch off removes the
332
- block. Turning it back on restores the saved text. Changes apply on the next
333
- startup or explicit `/reload`.
334
-
335
- The CLI manages the same switch. To enable it from the command line:
336
-
337
- ```sh
338
- npx pi-better-harness instructions enable
339
- ```
340
-
341
- By default, Harness renders the ordered Markdown modules in
342
- `extensions/harness-instructions/AGENTS.md` into a marked block in
343
- `<agent-dir>/APPEND_SYSTEM.md`. It preserves text outside the markers,
344
- including blocks owned by other extensions. To use your own Markdown, set
345
- `piBetterHarness.instructionsFile` in the global Pi `settings.json` to an
346
- absolute path or a path relative to the agent directory (normally
347
- `~/.pi/agent`), then run `instructions sync`. A prompt saved in the editor takes precedence
348
- over this file. Choose **Remove override** to restore the configured file or modular revision.
349
-
350
- | Command | Effect |
351
- | --- | --- |
352
- | `npx pi-better-harness instructions preview` | Print the selected modular prompt. |
353
- | `npx pi-better-harness instructions enable` | Create or refresh the block. |
354
- | `npx pi-better-harness instructions sync` | Refresh an existing block after editing the source or changing its path. |
355
- | `npx pi-better-harness instructions disable` | Remove the block and preserve the surrounding file. |
356
-
357
- A global Harness CLI install refreshes an enabled block. A global CLI uninstall
358
- removes it. If you remove the package directly with Pi, disable the block first.
359
- Setting `instructionsFile` to `false` removes the block on the next sync.
360
- The CLI stops on missing or duplicate delimiters in an existing block.
361
- Keep other extensions' content outside the Harness markers.
362
-
363
- Pi loads the file as a system prompt addendum. Ordinary turns and compaction
364
- retain the loaded text. A new Pi process or an explicit `/reload` reads the
365
- current file. Pi gives a trusted project's `.pi/APPEND_SYSTEM.md` precedence
366
- over the global file. Explicit `--append-system-prompt` sources also take
367
- precedence over automatic discovery.
368
-
369
- ### Try a prompt edit
370
-
371
- The Web UI is off by default. Run `PI_HARNESS_WEB_UI=1 pi-better-harness web`
372
- to inspect the local server, sessions and inventories. To open **Prompts → Edit**
373
- directly, run `PI_HARNESS_WEB_UI=1 pi-better-harness instructions web`.
374
- To open either editor from Pi, start `PI_HARNESS_WEB_UI=1 pi`, run
375
- `/harness-settings` or `/better-harness-settings`, and press Enter on the
376
- first row of **Agents** or **Prompts**. **Edit agent defaults** saves the
377
- model and reasoning effort for a personal role or named agent. It uses
378
- the models available to the current Pi session. **Manage prompts**
379
- opens the prompt revision editor. The standalone web console opens the
380
- catalog in view-only mode. All use the current Pi agent directory
381
- (`PI_CODING_AGENT_DIR`). The CLI prints a
382
- private loopback URL and opens the browser. Set `BROWSER=none` to print
383
- the URL only. Stop the CLI to close the server.
62
+ In a project with tests, try this prompt.
384
63
 
385
- **Prompts**, **Agent Catalog**, **MCP**, **Skills** and **Tools** use the host agent
386
- directory. You can open them with no Pi sessions running. Skills are grouped by
387
- directory or package. Tools groups registered definitions by source and cached MCP
388
- tools by server. MCP lists configured servers. **Authenticate** opens Pi's OAuth
389
- sign-in for an eligible HTTP server and reports the result after Pi reconnects.
64
+ > Run npm test in the background. Tell me when it starts so I can ask a question.
390
65
 
391
- Opening the session list automatically connects running interactive Pi terminals in
392
- this agent directory. After upgrading, run `/reload`
393
- once in already-open terminals to load the extension. Select a terminal to see
394
- its live Pi screen at the terminal's current dimensions. Browser and terminal
395
- input share the same editor, menus and dialogs. A daemon session with no attached
396
- interactive Pi terminal shows its read-only output.
397
- Closing the last console tab releases the web connections. The terminals and
398
- their current work continue.
399
-
400
- Each bundled module retains its package original and position. Edit its local
401
- override, toggle inclusion, or use **Reset to original**. Turning a slot off
402
- retains its override for the next time it is enabled.
403
- User modules have separate names, text and order, including when a user module
404
- shares a name with a bundled module. Enabled bundled modules render first.
405
- Package updates retain the toggles and user text. Historical snapshots keep
406
- their original rendering. The manager shows the scope of matching upstream
407
- validation or says when evidence is missing.
408
-
409
- Select a revision, edit the local composition and save a candidate. Review
410
- the parent and active diffs before publishing. Manual publication and
411
- rollback appear in activation history. Reload Pi to load the installed
412
- revision. Off, saved-text and custom-file configurations retain their source.
413
-
414
- To evaluate a complete session, run `/harness-settings prompt-task-capture <manifest.json>`
415
- before the task. The manifest specifies the number of user turns, required
416
- workspace files and expected final file contents. In **Replay → Evaluate
417
- sessions**, review the recommended tasks from connected sessions and their
418
- expectation sources. Each arm restores the starting Git checkout and working
419
- files. A later user turn runs when the preceding reply matches the historical
420
- one, or when the reviewed manifest explicitly lists that turn in
421
- `independentTurns`. The report includes each file check and the reason for
422
- any unscored session.
423
-
424
- To compare a candidate on one response, capture it with `/harness-settings prompt-capture` or load
425
- a reviewed suite with `/harness-settings prompt-import`. Open **Prompts → Manage prompts** in the owning Pi session and choose **Connect this Pi session** in the browser. The connection lasts until disconnect, reload or session
426
- shutdown. Select a captured request or a suite and model
427
- in **Replay** and choose the two saved revisions. Results and judgments stay in the agent directory and
428
- can be reopened in the Web console. Promotion requires a reviewed result
429
- for the displayed baseline and candidate.
430
-
431
- Enable the modular instructions and reload Pi. For existing overrides, remove
432
- `instructionsPrompt` and `instructionsFile` from the global Harness settings
433
- before syncing. Use a streaming `openai-completions` model for response replay.
434
-
435
- 1. Run `/harness-settings prompt-capture`, then send the writing request you want to evaluate,
436
- for example "Unit checks passed and deployment verification is pending. Can we close delivery?"
437
- 2. Ask the agent to list modules, read `bundled:verification`, and use
438
- `prompt_edit` to create a `user:verification` module requiring the pending
439
- check in the first sentence. To replace a bundled rule, turn it off in the manager.
440
- 3. Ask it to run `prompt_replay` with the case and candidate IDs, inspect
441
- both new responses, and use `prompt_compare` to record the rubric and judgment.
442
- 4. Request `prompt_promote` for those revisions and the evaluation ID. Confirm
443
- the change in Pi. Use `/reload` to adopt it in the working session.
444
- 5. Request `prompt_rollback` with the current and former active IDs. Confirm
445
- and reload to use the previous rendering.
446
-
447
- Capture holds one pre-answer provider payload in session memory until another
448
- capture or reload. Replay sends two requests to the captured model endpoint.
449
- A capture uses Pi's `before_provider_request` hook. Load the experiment extension
450
- after any extension that rewrites the request body so capture sees those edits.
451
- A requested tool ends that arm and is reported for turn replay. Comparisons
452
- and revision history are saved under `<agent-dir>/harness-prompt-revisions`.
453
- The offline walkthrough runs with `node --test packages/pi-better-harness/test/harness-instructions.test.mjs` from the repository root.
454
-
455
- ### Replay a turn or task
456
-
457
- After `/harness-settings prompt-capture`, let the original turn finish. Ask for
458
- `prompt_turn_replay` with the case ID, candidate ID and generation budget
459
- (1 through 64 per arm). Each requested tool must match the next recorded
460
- name and arguments. The result includes the assistant actions, returned tool
461
- data and the first divergence, cancellation or budget stop.
462
-
463
- For a multi-turn file task, run `/harness-settings prompt-task-capture task.json` from the Git
464
- repository root before sending the first task input. For example:
465
-
466
- ```json
467
- {
468
- "turns": 2,
469
- "required": ["notes.txt"],
470
- "omit": ["node_modules"],
471
- "checks": [{ "path": "notes.txt", "equals": "Ready for review.\n" }]
472
- }
473
- ```
474
-
475
- Capture records the starting commit and working files, including untracked
476
- and uncommitted inputs. Use `omit` for paths outside the task. Send the
477
- declared number of user turns and request `prompt_task_replay` with the same
478
- arguments as turn replay. Each arm restores a private checkout, shares its
479
- budget across the turns and reports its diff and file-equality checks.
480
- The fixture supports whole-file `read` and `write` on restored regular files.
481
- Other actions, including shell commands and external writes, stop that arm
482
- with a trace. Reload or start another capture to release the saved checkpoint.
483
-
484
- ### Evaluate cases and propose edits
485
-
486
- Run `prompt_evaluate` with a sample count (1 through 16) and an optional
487
- candidate ID. The default suite pairs narrow status questions with a delivery
488
- question that needs a qualification. Each case has expected behavior, a
489
- counterexample and a case-insensitive required/forbidden phrase rubric.
490
- The report includes every response and its score or reason it could not be scored.
491
-
492
- After a response replay, `/harness-settings prompt-export path.json` opens its captured input
493
- for review and redaction. Add the rubric and examples before saving the new
494
- file. In another session, `/harness-settings prompt-import path.json` loads the reviewed suite.
495
- An empty import argument restores the bundled cases.
496
-
497
- To use evaluated cases for an edit, enable `/harness-settings prompt-learning on`. Ask the
498
- agent to select two distinct baseline failures with the same failure category
499
- and one passing counterexample. With `prompt_propose`, it supplies those IDs
500
- and a user module edit. Inspect the before/after samples, then use
501
- `prompt_judge_proposal` and `prompt_promote` or clear the pending proposal
502
- with `/harness-settings prompt-learning discard`. Learning is disabled in a fresh session.
503
-
504
- Run `node --test packages/pi-better-harness/test/prompt-experiments.test.mjs`
505
- from the repository root for the offline turn, task and historical-case fixtures.
506
-
507
- Next-prompt inference is deferred pending safe public auth/header resolution in
508
- Pi's SDK. It is not loaded by the bundle, has no toggle or preference store in
509
- this version, and makes no auxiliary model requests. The integration blocker is
510
- [issue #426](https://github.com/1aboveio/pi-better-harness/issues/426).
511
-
512
- The hub is TUI-only and is included by the installer. To load the settings extension directly from the checkout:
513
-
514
- ```sh
515
- pi -e ./packages/pi-better-harness/extensions/settings/index.ts
516
- ```
517
-
518
- ### Agent Supervisor
519
-
520
- In `/harness-settings`, use **Supervisor scenarios** to choose which scenarios to run. **Supervisor mode** turns that selection on or off. You can edit the selection while the mode is off. First use starts with an empty selection. Settings apply to sessions sharing the Pi agent directory. Turning the mode off preserves the selection and lets existing tasks continue.
521
-
522
- | Scenario | What the owner receives |
523
- | --- | --- |
524
- | 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. |
525
- | Diagnose stalled Goals | A diagnostic review after repeated identical successful repository reads return the same evidence throughout the stall interval. |
526
- | 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. |
527
- | 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. |
528
- | 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. |
529
- | Follow up on recovery commitments | Use `supervisor_followup` to record the action, expected verification and actual tool results. Read progress with `/harness-settings supervisor-followup`. Request one reminder with `/harness-settings supervisor-followup remind <id> <minutes>`. |
530
-
531
- ## When To Use
532
-
533
- 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.
534
-
535
- ## Compatibility
536
-
537
- | Requirement | Support |
538
- |-------------|---------|
539
- | Pi | Required |
540
- | Recommended install | `npx pi-better-harness install` |
541
- | Managed Subagents and Background Tasks | macOS and Linux on x64 or arm64. Windows x64 support starts with Harness 0.64.0 for tasks that can run without kernel sandboxing. [Windows Server 2022 acceptance (#917)](https://github.com/1aboveio/pi-better-harness/issues/917) |
542
- | Write sandbox on macOS | Seatbelt (`sandbox-exec`), ships with the OS |
543
- | Write sandbox on Linux | Bubblewrap — install `bubblewrap` |
544
- | Linked-worktree project context | A Pi host that applies `systemPromptOptions` after `before_agent_start` (Pi 1.x); older hosts keep the loaded prompt |
545
- | Development runtime | Node.js 22+ |
546
-
547
- ## Update Or Remove
548
-
549
- For an installer-managed setup, run `npx pi-better-harness@latest install` to update Harness, Server and both task clients together. Add `--local` for a project install. For a direct bundle install, run `pi update npm:pi-better-harness`.
550
-
551
- Remove every standalone package:
552
-
553
- ```sh
554
- npx pi-better-harness uninstall
555
- ```
66
+ [More installation options](https://github.com/1aboveio/pi-better-harness/blob/main/packages/pi-better-harness/docs/usage.md#install) · [Settings](https://github.com/1aboveio/pi-better-harness/blob/main/packages/pi-better-harness/README.md#harness-settings) · [Platform support](https://github.com/1aboveio/pi-better-harness/blob/main/packages/pi-better-harness/README.md#compatibility)
556
67
 
557
- Add `--local` to remove them from project-local settings. This also removes the filtered Harness registration in that scope.
68
+ ## Resources
558
69
 
559
- ## More Detail
70
+ - **Compare** · [Pi extensions](https://github.com/1aboveio/pi-better-harness/blob/main/docs/extension-comparison.md) · [Recording notes and session excerpts](https://github.com/1aboveio/pi-better-harness/blob/main/docs/native-pi-comparison.md)
71
+ - **For agents** · [Tools and slash commands by package](https://github.com/1aboveio/pi-better-harness/blob/main/llms.txt)
72
+ - **Development** · [Build and release](https://github.com/1aboveio/pi-better-harness/blob/main/docs/development-and-release.md#development) · [Architecture decisions](https://github.com/1aboveio/pi-better-harness/blob/main/docs/adr/README.md) · [License](https://github.com/1aboveio/pi-better-harness/blob/main/LICENSE)
560
73
 
561
- - Repository: https://github.com/1aboveio/pi-better-harness
562
- - Detailed notes: https://github.com/1aboveio/pi-better-harness/blob/main/packages/pi-better-harness/docs/usage.md
563
- - License: https://github.com/1aboveio/pi-better-harness/blob/main/LICENSE
74
+ <!-- Document new features in the owning package and link them from llms.txt so this page stays a quick first run. -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-better-harness",
3
- "version": "0.67.0",
3
+ "version": "0.67.2",
4
4
  "description": "Pi extension bundle for a write sandbox, subagents, background tasks, SSH, Goals, and Todo lists.",
5
5
  "license": "MIT",
6
6
  "type": "module",