pi-bro 0.33.0 → 0.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,25 @@
2
2
 
3
3
  All notable changes to pi-bro are documented here.
4
4
 
5
+ ## [0.35.0] - 2026-11-08
6
+
7
+ ### Changed
8
+
9
+ - Overthink factory list now has four focused questions (Direction, Evidence, Risks, Next move), replacing seven overlapping questions. Existing saved global/session lists are unchanged until reset.
10
+ - Structured checks return a short summary and a concise answer for **each configured question**, or `NONE` when nothing material needs attention. The strict materiality filter is inspired by Heads-up. One active Pi model call still covers all questions.
11
+ - Overthink's modal now shows readable summary/question sections, a compact timestamp/model/status line and on-demand **U** token/cache/cost details, with content-sized rendering and scrolling. Old plain-text notes remain viewable; question snapshots remain tied to the assessment.
12
+ - Global and session question editors now use **Ctrl+↑/↓** to reorder, not Alt/Option. All other editor controls and privacy boundaries remain unchanged.
13
+
14
+ ## [0.34.0] - 2026-11-07
15
+
16
+ ### Added
17
+
18
+ - Guided Review can delete a saved PR review, its notes and captured source through a confirmed picker, offline PR target, or Overview action.
19
+ - Deletion by PR target uses local records instead of GitHub; ambiguous bare PR numbers require a full URL. Resume and delete share the same picker and preserve saved titles.
20
+ - Active in-process reviews block command deletion. Overview deletion holds the active lock, settles pending saves and cannot recreate the record on teardown. The storage helper validates review IDs and leaves sibling reviews and Pi settings untouched.
21
+ - Offline storage and picker tests plus a manual test journey for confirmation, active writers and cleanup.
22
+ - No automatic cleanup, new storage engine, live backend call or GitHub mutation.
23
+
5
24
  ## [0.33.0] - 2026-11-07
6
25
 
7
26
  ### Highlights
package/README.md CHANGED
@@ -65,10 +65,11 @@ File and webpage examples need your own real path or URL; see [how to explain th
65
65
  | `/bro architecture [focus]` | **[Architecture Docs](docs/features/architecture.md).** Inspects the project and writes Markdown, diagrams and an offline interactive `architecture.html` under `docs/architecture/`. Uses BTW model settings. |
66
66
  | `/bro elevate` or **Ctrl+Shift+E** | **[Elevate](docs/elevate.md).** Discover missing expert considerations, select useful improvements, and rewrite your task without submitting it. Shares BTW backend settings. |
67
67
  | `/bro remember-me [thought]` | **[Remember Me](docs/remember-me.md).** Privately clarify and approve short personal memories with unfoldable background. Agents can call `about_user` to read summaries and expand IDs. |
68
- | `/bro overthink` | **[Overthink](docs/overthink.md).** Quietly checks meaningful work with the active Pi model, using editable global/session questions and a private notes modal. Automatic checks can be switched off in config. No separate backend. |
68
+ | `/bro overthink` | **[Overthink](docs/overthink.md).** Quietly checks meaningful work with the active Pi model; four factory questions, a short summary and one response per editable question. Automatic checks can be switched off in config. No separate backend. |
69
69
  | `/bro grill-me` | **[Grill Me](docs/grill-me.md) (experimental).** A private, opinionated decision interview: light, balanced or exhaustive; one question per round; `/consolidate` drafts a brief without ending the interview; `/copy` returns the latest reply or decision brief to the clipboard. Uses BTW model settings; read-only restrictions vary by backend. |
70
70
  | `/bro btw` | **[Side questions](docs/features/btw.md#bro-btw-side-conversation).** A separate conversation seeded with recent context, so you can ask without interrupting the agent. ⚠️ [Full-permission mode](#what-leaves-your-machine) can edit files. |
71
71
  | `/bro guided-review <PR>` | **[Guided Review](docs/guided-review.md).** An explanation and quality assessment of a GitHub PR, with ranked findings, source evidence and private questions. Claude, Muse, or Pi is recommended for untrusted PRs. |
72
+ | `/bro guided-review delete [PR]` | Choose a saved review and explicitly delete its record, questions and captured source after confirmation. No automatic cleanup. |
72
73
  | `bro_advisor` tool | **[Second opinion](docs/features/advisor.md#bro-advisor).** A tool your agent can call mid-task; a fresh backend process reviews the session snapshot, can inspect the workspace when needed, and returns advice to the agent. ⚠️ [Runs with permissions bypassed](#what-leaves-your-machine). |
73
74
  | `/bro config`, `/bro preferences` | **[Settings](docs/reference/settings.md#settings) and [preferences](docs/user-guide.md#preferences).** Pick the backend, model and effort per feature, and tell Bro how you like answers. |
74
75
 
@@ -81,6 +81,23 @@ Copy finding copies a finding's text, evidence references and suggested fix/chec
81
81
 
82
82
  Use Overview → Regenerate guide only when you want a fresh explanation/assessment. Confirmation identifies the captured revision and the model call. **It reuses the same captured source; it is not an update fetch.** Successful output replaces one current guide. Failure/cancellation keeps the current guide. Questions and nonempty drafts retain their original context under Your questions; there is no guide-version picker. A replacement that fails to save remains in memory with retry controls.
83
83
 
84
+ ### Delete a saved review
85
+
86
+ Use **Overview → Delete review** inside a saved review, or run
87
+ `/bro guided-review delete` to choose from your saved reviews. For a specific
88
+ record, use `/bro guided-review delete <PR number or URL>`. Deletion reads
89
+ only local saved records: no GitHub access or model call is required. A bare
90
+ PR number must match exactly one saved review across all repositories, regardless
91
+ of your current working directory. In contrast, opening a PR by number uses
92
+ the current repository. Use the full PR URL if multiple saved reviews share
93
+ that number. If none are saved, Bro says there is nothing to delete.
94
+ Pressing Esc cancels silently.
95
+ Bro shows the target and asks for confirmation before removing its JSON record,
96
+ private questions/drafts and captured Git source. Closing the picker or declining
97
+ the confirmation changes nothing. Close an open review first; an active writer
98
+ blocks deletion. This affects only the selected review, not your main working tree.
99
+ Deletion cannot be undone. There is no automatic cleanup.
100
+
84
101
  ## Access, privacy and storage
85
102
 
86
103
  Review never runs with full-access or bypass flags. **Claude, Muse, and Pi provide strict file-only inspection** and are recommended for untrusted PRs: Claude runs with `--restricted`, Read/Grep/Glob only, `dontAsk`, safe mode and no MCP; Muse disables write, shell and web tools, foreign personal context and native session logs, without trusting repository rules; Pi runs in-process with `read/grep/find/ls` only, no shell, and an isolated session. No model-run project tests, commands, Git or network tools are available on Claude, Muse, or Pi.
@@ -99,7 +116,13 @@ Records, private text and captured source remain under:
99
116
  ${PI_CODING_AGENT_DIR:-$HOME/.pi/agent}/bro-reviews/
100
117
  ```
101
118
 
102
- The implementation uses the host's `getAgentDir()`. Records are `<review-id>.json`; captured source is under `source/<review-id>/`, including preserved `.incomplete-*` recovery directories. Failed/corrupt records are reported without overwriting them. There is no automatic cleanup or cross-machine sync. Source and recovery directories can grow. To remove one review manually, first close it in every Pi process and back up anything needed. Find its JSON record by matching `snapshot.target.repository` and `snapshot.target.number` (for example, search the JSON files for `"repository":"OWNER/REPO"`, then check the PR number). The filename without `.json` is its review ID; its source directory has that same ID under `source/`. Remove only that record and matching source directory. Do not delete the whole `bro-reviews/` directory, `bro-settings.json`, or another review's data. No deletion command is provided.
119
+ The implementation uses the host's `getAgentDir()`. Records are
120
+ `<review-id>.json`, captured source lives under `source/<review-id>/`,
121
+ including preserved incomplete recovery directories. Failed/corrupt records are
122
+ reported without overwriting them. There is no cross-machine sync or automatic
123
+ cleanup. Use the explicit deletion picker rather than editing these files by hand.
124
+ Cross-process writers are not locked, so close the same review in every Pi process
125
+ before deletion.
103
126
 
104
127
  One open writer per review is supported within a Pi process. Concurrent editing of the same review from separate processes is unsupported.
105
128
 
@@ -107,7 +130,7 @@ One open writer per review is supported within a Pi process. Concurrent editing
107
130
 
108
131
  | Problem | What to do |
109
132
  | --- | --- |
110
- | GitHub unavailable when reopening | Use bare `/bro guided-review` to choose a saved review; the picker does not fetch |
133
+ | GitHub unavailable when reopening | Use bare `/bro guided-review` to choose a saved review; resume and deletion from local records do not fetch |
111
134
  | Sandboxed shell review backend (Codex, Grok, Agy) | Advisory shown; choose Claude, Muse, or Pi in `/bro config` for strict file-only inspection on untrusted PRs |
112
135
  | Git/gh authentication or fetch error | Read the acquisition error; check Git/`gh auth status`; retry explicitly |
113
136
  | Invalid/failed preparation | Changed files remain available; use Prepare guide to retry when ready for another call |
package/docs/overthink.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Overthink — private second look
2
2
 
3
- Overthink gives Pi's work a small, skeptical second pass. It checks the direction, the assumptions, the risks and the next move, without making a new agent or interrupting the original conversation. It is inspired by [pi-heads-up](https://github.com/Pringled/pi-extensions/tree/main/packages/pi-heads-up).
3
+ Overthink gives Pi's work a small, skeptical second pass. It checks the direction, the evidence, the risks and the next move, without making a new agent or interrupting the original conversation. It is inspired by [pi-heads-up](https://github.com/Pringled/pi-extensions/tree/main/packages/pi-heads-up).
4
4
 
5
5
  ## Normal use
6
6
 
@@ -8,11 +8,29 @@ With **automatic checks on** (the factory default), after a **fully settled subs
8
8
 
9
9
  Run `/bro overthink` to **view** the latest assessment. Opening the modal makes **no model request**. The notes never enter Pi's user/assistant conversation and do not direct the agent to perform work.
10
10
 
11
+ ## Four factory questions
12
+
13
+ A new session starts with four questions:
14
+
15
+ 1. **Direction:** Are we solving the right problem and moving toward the intended outcome?
16
+ 2. **Evidence:** What important assumptions or conclusions might be wrong or insufficiently verified?
17
+ 3. **Risks:** What material risks, unintended changes, or needless complexity have we introduced?
18
+ 4. **Next move:** What correction, decision, or next step would most improve the outcome?
19
+
20
+ Bro still permits up to 32 custom questions and does **one same-model call for the entire list**. When nothing material is missed, the model should answer `NONE` and Overthink stays quiet. Otherwise it must return a brief 2–3-sentence summary followed by **one concise answer for each saved question**, in order. A question without a material concern can say so; it need not invent criticism.
21
+
22
+ **Existing saved global and per-session question lists do not change automatically.** To adopt the four new factory questions, reset the global defaults (Ctrl+D twice, Ctrl+S), then reset the session list (Ctrl+D twice, Ctrl+S). User-edited lists remain intact, even when they contain the former seven questions.
23
+
24
+ ## Viewer
25
+
26
+ The modal shows a compact check date/model/freshness line, followed by **Summary** and numbered question–answer sections. The original question wording is visible. For the four factory questions, the sections are labeled Direction, Evidence, Risks and Next move. Longer results scroll; short results no longer expand into a mostly empty frame. Earlier plain-text notes stay viewable without being misrepresented as answers to the new questions.
27
+
11
28
  In the modal:
12
29
 
13
30
  - **Ctrl+R** — force a fresh assessment (also works for smaller tasks). A check uses the **current** session context.
14
31
  - **Ctrl+E** — edit the questions for **this Pi session**.
15
32
  - **?** — show or hide help.
33
+ - **U** — show or hide full token/cache/estimated-cost usage details (hidden by default).
16
34
  - **Ctrl+C** — copy the latest findings.
17
35
  - **Esc** — close or leave Help.
18
36
  - **↑/↓** — scroll.
@@ -27,7 +45,7 @@ The same ordered, editable list is used in both places:
27
45
  - **Automatic checks:** `/bro config → Features → Overthink → Automatic checks` toggles the global on/off switch. It starts **On**. Turning it off does not delete questions or notes; the viewer and manual **Ctrl+R** still work.
28
46
  - **Session questions:** `/bro overthink`, then **Ctrl+E**.
29
47
 
30
- Use **↑/↓** to choose an entry; **Enter** to edit; **Ctrl+N** to add; **Ctrl+X** to delete; **Alt+↑/↓** to reorder; **Ctrl+S** to save; **Esc** to cancel. Saving an empty list disables checks. Unsaved changes are protected by a second-Esc warning.
48
+ Use **↑/↓** to choose an entry; **Enter** to edit; **Ctrl+N** to add; **Ctrl+X** to delete; **Ctrl+↑/↓** to reorder; **Ctrl+S** to save; **Esc** to cancel. Saving an empty list disables checks. Unsaved changes are protected by a second-Esc warning.
31
49
 
32
50
  **Ctrl+D** twice resets the editor draft. In the global editor it restores Bro's factory questions; in the session editor it restores the **current global defaults**. Press Ctrl+S to save that reset. A new session inherits the current global defaults once and can then be edited independently. Existing sessions do not change when the global defaults are updated.
33
51
 
@@ -35,9 +53,9 @@ Use **↑/↓** to choose an entry; **Enter** to edit; **Ctrl+N** to add; **Ctrl
35
53
 
36
54
  Overthink **never** uses the BTW or Bro backend/model setting. It calls Pi's current `modelRegistry.streamSimple` using `buildSessionProjection()` plus a single appended private review instruction. It uses the active physical session model and reasoning level, makes **one call for all questions**, **never executes tools**, and does not add the assessment to the main model context. The request may still contain Pi's tool descriptions as part of the original context; the prompt tells the model to respond in text and not call tools. An unexpected tool-use response is treated as a failed check, not executed. The call sends the session context (including tool evidence exposed by Pi's projection) to that model's provider, under the provider's data policy.
37
55
 
38
- This largely preserves the request prefix and **can** reuse provider prompt-cache input. The benefit varies by provider, model, elapsed time, tool/context changes, other extensions' context hooks, and prompt-cache policy. It does not replicate every live Pi context modification. In Pi 1.3 and 1.5, `context_with_system` can observe a prepared context just before a provider call, while `before_provider_request` can observe a provider-specific payload; neither provides a portable, complete, settled-session request that can simply be appended and replayed through `streamSimple`. A recorded pre-call context also lacks the final agent response that Overthink needs to review. Bro therefore keeps the explicit projection path until a real provider-side comparison shows a safe improvement. **A cached prefix is not free:** high thinking effort can add substantial reasoning tokens on top of the visible-output limit, and both output and reasoning can cost money. The viewer shows *provider-reported* input, cache-read, cache-write, output and reasoning tokens when available. It labels USD cost separately as **estimated cost** from Pi's model price table, not a provider-billed amount; subscription or OAuth users may pay differently. A reported cache-read value of **0** could mean no hit **or unsupported caching**; it is not proof that caching works. Some providers report no usage fields. Check actual billed cost before treating Overthink as cheap.
56
+ This largely preserves the request prefix and **can** reuse provider prompt-cache input. The benefit varies by provider, model, elapsed time, tool/context changes, other extensions' context hooks, and prompt-cache policy. It does not replicate every live Pi context modification. In Pi 1.3 and 1.5, `context_with_system` can observe a prepared context just before a provider call, while `before_provider_request` can observe a provider-specific payload; neither provides a portable, complete, settled-session request that can simply be appended and replayed through `streamSimple`. A recorded pre-call context also lacks the final agent response that Overthink needs to review. Bro therefore keeps the explicit projection path until a real provider-side comparison shows a safe improvement. **A cached prefix is not free:** high thinking effort can add substantial reasoning tokens on top of the visible-output limit, and both output and reasoning can cost money. Press **U** in the viewer to show *provider-reported* input, cache-read, cache-write, output and reasoning tokens when available; the details are hidden during normal reading. It labels USD cost separately as **estimated cost** from Pi's model price table, not a provider-billed amount; subscription or OAuth users may pay differently. A reported cache-read value of **0** could mean no hit **or unsupported caching**; it is not proof that caching works. Some providers report no usage fields. Check actual billed cost before treating Overthink as cheap.
39
57
 
40
- Overthink stores editable global defaults in `getAgentDir()/bro-overthink-defaults.json` and session questions plus the **latest** private check in Pi session `custom` entries (`bro-overthink`). Those entries are outside LLM prompts. Session forks inherit their branch's last state; later edits are independent. The viewer resolves only the **latest** note. Pi stores session custom entries by appending, so **each completed check adds another entry to the session file**, even though Bro does not provide a history browser or archive. This is a deliberate reuse of Pi's branch-aware persistence, not a claim that only one physical record exists. Keep this storage growth in mind for long sessions. It does not write to your project files.
58
+ New structured assessments include the exact question snapshot used for that check, so later edits do not relabel earlier answers. Saved notes made by older versions remain plain text. Invalid or incomplete structured model outputs are rejected rather than shown under the wrong question.\n\nOverthink stores editable global defaults in `getAgentDir()/bro-overthink-defaults.json` and session questions plus the **latest** private check in Pi session `custom` entries (`bro-overthink`). Those entries are outside LLM prompts. Session forks inherit their branch's last state; later edits are independent. The viewer resolves only the **latest** note. Pi stores session custom entries by appending, so **each completed check adds another entry to the session file**, even though Bro does not provide a history browser or archive. This is a deliberate reuse of Pi's branch-aware persistence, not a claim that only one physical record exists. Keep this storage growth in mind for long sessions. It does not write to your project files.
41
59
 
42
60
  ## Limits and verification
43
61
 
@@ -41,8 +41,9 @@ Typing `/bro ` displays ten task-level suggestions: `simplify`, `show`, `btw`, `
41
41
  | `/bro architecture [focus]` | Read the current project and create or refresh `docs/architecture/` with Markdown, an editable graph and offline HTML. Inherits BTW backend settings. [Guide](../features/architecture.md). |
42
42
  | `/bro guided-review <PR number or URL>` | Automatically explain and assess a captured PR in local Pi, with source evidence and optional private questions. Opening the same PR restores its saved review. |
43
43
  | `/bro guided-review` | List saved reviews; `resume` is an alias. |
44
+ | `/bro guided-review delete [PR number or URL]` | Choose and confirm deletion of a saved review and its captured source. Without a target, opens the saved-review picker. |
44
45
  | `/bro remember-me [thought]` | Start a private memory-writing conversation, browse and expand memories, and approve saves explicitly. [Guide](../remember-me.md). |
45
- | `/bro overthink` | View the latest private automatic second-look notes, without a model call. Ctrl+R retry, Ctrl+E edit session questions, ? help, Ctrl+C copy. [Guide](../overthink.md). |
46
+ | `/bro overthink` | View the latest private automatic second-look notes, without a model call. Ctrl+R retry, Ctrl+E edit session questions, U usage details, ? help, Ctrl+C copy. [Guide](../overthink.md). |
46
47
  | `/bro grill-me [topic]` | Private one-question-at-a-time decision interview. Supply a topic to start fresh; omit it to resume. `/consolidate` drafts a brief; `/copy` copies the latest reply or brief; Pi's editor stays untouched. `/help` lists modal controls. [Guide](../grill-me.md). |
47
48
  | `/bro elevate [request]` | Improve an assignment before execution. Discover up to five gaps, choose useful findings, and copy the revised request. Pi's editor is never changed. **Ctrl+Shift+E** can use your unsent draft. See [Elevate](../elevate.md). |
48
49
  | `/bro btw [question]` | Open a side conversation in a modal, seeded with recent main-session context. Starts conversation-only; `/mode` toggles full workspace access; `/copy` and `/copy-all` copy the latest answer or full thread. |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-bro",
3
- "version": "0.33.0",
3
+ "version": "0.35.0",
4
4
  "description": "A sidekick for you and your Pi agent: plain-language explanations, side questions, diagrams, PR review and second opinions, without cluttering the agent's context.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -105,7 +105,7 @@
105
105
  "scripts": {
106
106
  "docs:check": "node scripts/check-docs.mjs && node --test test/docs-quality.test.mjs",
107
107
  "typecheck": "tsc --noEmit",
108
- "test": "npm run typecheck && npm run docs:check && node .github/scripts/release-utils.mjs selftest && node --test test/architecture.test.mjs test/architecture-review.test.mjs test/architecture-controller.test.mjs test/elevate-docs.test.mjs test/elevate.test.ts test/overthink.test.ts test/simplify.test.ts test/simplify-modal.test.mjs test/session-state.test.ts test/session-lifecycle.test.mjs test/grill.test.ts test/config-navigation.test.ts test/config-navigation-modal.test.mjs test/remember.test.ts test/remember-modal.test.mjs test/review-ux.test.mjs test/review-doctor.test.mjs test/review-versions.test.mjs test/review-regeneration.test.mjs test/review-modal.test.mjs test/review.test.ts test/review-ui.test.mjs test/review-session.test.mjs test/helpers.test.mjs test/prompt.test.ts test/backend.test.ts test/claude.test.ts test/grok.test.ts test/codex.test.ts test/muse.test.ts test/settings.test.ts test/sources.test.ts test/release.test.ts test/show-html.test.ts test/smoke-rpc.test.ts test/ui-capabilities.test.ts test/modal-contract.test.mjs benchmark/*.test.ts && sh ./test/smoke-test.sh",
108
+ "test": "npm run typecheck && npm run docs:check && node .github/scripts/release-utils.mjs selftest && node --experimental-transform-types --test --test-concurrency=2 test/architecture.test.mjs test/architecture-review.test.mjs test/architecture-controller.test.mjs test/elevate.test.ts test/overthink.test.ts test/simplify.test.ts test/simplify-modal.test.mjs test/session-state.test.ts test/session-lifecycle.test.mjs test/host-lifecycle.test.mjs test/grill.test.ts test/config-navigation.test.ts test/config-navigation-modal.test.mjs test/remember.test.ts test/remember-modal.test.mjs test/review-ux.test.mjs test/review-doctor.test.mjs test/review-versions.test.mjs test/review-regeneration.test.mjs test/review-modal.test.mjs test/review.test.ts test/review-session.test.mjs test/helpers.test.mjs test/prompt.test.ts test/backend.test.ts test/claude.test.ts test/grok.test.ts test/codex.test.ts test/muse.test.ts test/settings.test.ts test/sources.test.ts test/release.test.ts test/show-html.test.ts test/smoke-rpc.test.ts test/ui-capabilities.test.ts test/modal-contract.test.mjs benchmark/*.test.ts && sh ./test/smoke-test.sh",
109
109
  "benchmark:dry-run": "node benchmark/run.ts dry-run",
110
110
  "benchmark:run": "node benchmark/run.ts run",
111
111
  "benchmark:report": "node benchmark/run.ts report",