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