pi-bro 0.34.0 → 0.35.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,23 @@
2
2
 
3
3
  All notable changes to pi-bro are documented here.
4
4
 
5
+ ## [0.35.1] - 2026-11-09
6
+
7
+ ### Highlights
8
+
9
+ - Overthink assessments now hard-code plain, everyday words for a tired reader alongside the 2–3-sentence summary and 1–2-sentence per-question limits, preventing dense jargon compression.
10
+ - Saved `bro-preferences.md` preferences now layer on top of Overthink to adjust tone or override the default answer language for prose, while keeping `NONE`, JSON keys (`summary`, `answers`), code, commands, paths, names, numbers, and sentence limits intact.
11
+ - Unified `preferencesFile()` path resolution across reads, saves, deletes, and help display.
12
+
13
+ ## [0.35.0] - 2026-11-08
14
+
15
+ ### Changed
16
+
17
+ - 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.
18
+ - 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.
19
+ - 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.
20
+ - Global and session question editors now use **Ctrl+↑/↓** to reorder, not Alt/Option. All other editor controls and privacy boundaries remain unchanged.
21
+
5
22
  ## [0.34.0] - 2026-11-07
6
23
 
7
24
  ### Added
package/README.md CHANGED
@@ -65,7 +65,7 @@ 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. |
@@ -111,7 +111,7 @@ which may keep it under their own policies. Paths below are under
111
111
  | Show | User and assistant text from recent turns (no tool calls, tool results, reasoning or images), plus your preferences | Last result in the private Pi session, plus temporary diagram pages in `pi-bro-<uid>/` |
112
112
  | Side questions | Your questions and up to the last 8 turns of conversation text, plus your preferences | Private Pi session entries with completed turns, mode and draft |
113
113
  | Grill Me | Topic, interview turns, up to the last 8 main-session text turns and preferences; any workspace files the selected inspector reads | Private Pi session entries with the interview and brief |
114
- | Overthink | Current session projection, including tool evidence, plus private user-editable questions, to the active Pi provider | Global questions in `bro-overthink-defaults.json`; per-session questions and latest private note in Pi session custom entries |
114
+ | Overthink | Current session projection, including tool evidence, plus private user-editable questions and preferences, to the active Pi provider | Global questions in `bro-overthink-defaults.json`; per-session questions and latest private note in Pi session custom entries |
115
115
  | Elevate | Your objective, selected findings, all current-branch user/assistant text; Full also includes tool-call arguments and text results, and preferences | Nothing; the workflow stays in memory |
116
116
  | Guided Review | The PR description and diff, the files the backend reads, your questions, plus your preferences | Reviews and captured source in `bro-reviews/`, with no automatic cleanup |
117
117
  | Advisor | The agent's system instructions, tool list and whole conversation, including tool calls and results (reasoning and images omitted), plus your steering | Steering in `bro-advisor.md` and the session file |
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, written in plain, everyday words for a tired reader. Saved [preferences](reference/settings.md#preferences) (`bro-preferences.md`) can adjust tone or answer language on top, without overriding the JSON format, sentence limits, plain-language brevity or review rules. 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
 
@@ -43,7 +43,7 @@ Typing `/bro ` displays ten task-level suggestions: `simplify`, `show`, `btw`, `
43
43
  | `/bro guided-review` | List saved reviews; `resume` is an alias. |
44
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. |
45
45
  | `/bro remember-me [thought]` | Start a private memory-writing conversation, browse and expand memories, and approve saves explicitly. [Guide](../remember-me.md). |
46
- | `/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). |
47
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). |
48
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). |
49
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. |
@@ -94,7 +94,7 @@ See [feature guide](../features/architecture.md).
94
94
 
95
95
  ## Privacy and safety
96
96
 
97
- - **Overthink requests:** after a substantive Pi turn, Bro makes one additional provider call using Pi's active model and current session conversation projection (including exposed tool evidence), appending the current session's questions. Overthink never executes tool calls. It may still send tool descriptions copied from Pi's existing context to support cache reuse; a tool-use response is rejected without executing the tool. The provider may retain input under its policy. Results and questions are stored in private Pi session custom entries, not LLM turns; global questions use `bro-overthink-defaults.json` in the agent home. This cannot promise a cache hit or fixed incremental cost. Features → Overthink has an on/off switch (on by default). The viewer displays provider-reported input/cache-read/cache-write/output/reasoning tokens and USD cost when available; a reported cache-read value of zero may mean either a cache miss or unsupported caching. See [Overthink](../overthink.md).
97
+ - **Overthink requests:** after a substantive Pi turn, Bro makes one additional provider call using Pi's active model and current session conversation projection (including exposed tool evidence), appending the current session's questions and any saved `bro-preferences.md` (for tone and language only). Overthink never executes tool calls. It may still send tool descriptions copied from Pi's existing context to support cache reuse; a tool-use response is rejected without executing the tool. The provider may retain input under its policy. Results and questions are stored in private Pi session custom entries, not LLM turns; global questions use `bro-overthink-defaults.json` in the agent home. This cannot promise a cache hit or fixed incremental cost. Features → Overthink has an on/off switch (on by default). The viewer displays provider-reported input/cache-read/cache-write/output/reasoning tokens and USD cost when available; a reported cache-read value of zero may mean either a cache miss or unsupported caching. See [Overthink](../overthink.md).
98
98
 
99
99
  - **External requests**: Bro sends the latest completed assistant response,
100
100
  pasted text, extracted document text, extracted webpage text, or recent
@@ -108,8 +108,8 @@ See [feature guide](../features/architecture.md).
108
108
  - **Grill Me requests**: `/bro grill-me` sends the user-supplied topic, their answers, the full private Grill Me transcript so far, preferences, and up to 8 recent main-session text turns (40,000 characters) to the BTW-selected provider. It runs **fresh** each turn in the current workspace, via the Guided Review *inspection execution path* (not the Guided Review UI or checkout). Claude, Muse and Pi use file-only tools; Codex and Grok use a read-only sandbox with shell; **Agy can still write inside the project**. The model is always told not to edit or run mutating commands, but that prompt is not enforced. Optional `/access full` explicitly uses a fresh, full-permission backend call and gives the backend unrestricted tools; it never happens automatically. Grill Me and BTW hold separate in-memory threads, and nothing enters the main agent unless the user inserts it into an empty editor. See [Grill Me](../grill-me.md).
109
109
  - **Guided Review requests**: PR identity/description, captured diff, relevant private discussion and preferences go to the selected backend, which can inspect captured files. Main-session context is not attached. Claude (`--restricted`, file tools only), Muse (write/shell/web disabled), and Pi (`read/grep/find/ls` only, in-process) use strict file-only inspection and are recommended for untrusted PRs. Codex and Grok inspect the captured checkout under a read-only sandbox; Agy's `--sandbox` still allows in-project writes. All three run shell commands and show an advisory. Prompt injection can still corrupt conclusions or reveal captured content to the provider; this is not a general confidentiality guarantee. See [Guided Review access and storage](../guided-review.md#access-privacy-and-storage).
110
110
  - **Preferences**: `bro-preferences.md` is sent with every explain, Show,
111
- BTW, Elevate, and Guided Review request to the selected backend. It is never sent to the advisor or
112
- to Pi's main model.
111
+ BTW, Elevate, Grill Me, Guided Review, and Overthink request. It is never sent to the advisor or
112
+ added to Pi's main conversation.
113
113
  - **Advisor requests**: `bro_advisor` sends the executor agent's system
114
114
  instructions, active tool list (excluding `bro_advisor`), ordered
115
115
  conversation history including tool calls and tool results (unlike Show,
@@ -129,12 +129,12 @@ that is set):
129
129
  means no preferences, and Bro's prompts are then exactly the built-in ones.
130
130
  - **What preferences can change**: wording, tone, technical depth, length in
131
131
  BTW, and the answer language. If you name a language, code, commands, paths,
132
- names, and numbers still stay exactly as written. In `/bro show`,
133
- preferences only change wording and language. Guided Review also receives preferences for explanation/answer wording; they do not override its evidence or review rules. A per-run choice (the mode,
132
+ names, and numbers still stay exactly as written. In `/bro show` and `/bro overthink`,
133
+ preferences only change wording/tone and language. Guided Review also receives preferences for explanation/answer wording; they do not override its evidence or review rules. A per-run choice (the mode,
134
134
  **M**, a Show steering query, or what a BTW/review question asks for) wins over a
135
135
  standing preference.
136
136
  - **Limit**: 4,000 characters, because the text goes with every request. A
137
- longer file stops explain, Show, BTW, and Guided Review with an error until you trim it;
137
+ longer file stops explain, Show, BTW, Guided Review, and manual Overthink checks with an error until you trim it (automatic Overthink checks are skipped quietly);
138
138
  Bro never cuts it silently. `/bro doctor` reports the problem, and the
139
139
  editor still opens the file so you can fix it.
140
140
  - **BTW threads**: when your preferences change, the next side question starts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-bro",
3
- "version": "0.34.0",
3
+ "version": "0.35.1",
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",