# Changelog

All notable changes to pi-bro are documented here.

## [0.25.0] - 2026-10-19

### Highlights

- Improve a request before you send it: `/bro elevate <request>`, or **Ctrl+Shift+E** on an unsent draft, suggests up to five things an expert would check that you may have missed.
- Pick the suggestions you want, and Bro rewrites your request using only those. Nothing is ticked for you, and Bro does not do the task itself.
- Write or paste a **multi-line** objective: the request field grows like Bro's other editors instead of flattening it onto one line.
- Insert the rewrite into Pi's editor with one button, or copy it. Nothing goes to the main agent until you press Enter.
- Find what you need faster: the docs are split into a getting-started page, feature guides, a settings and commands reference, and examples.

### Added

- `/bro elevate [request]` and the **Ctrl+Shift+E** shortcut open Bro Elevate in a Bro modal: write the objective, review findings, then insert or copy. An explicit request takes priority over the editor draft; with neither, the modal asks for one. Discovery returns up to five findings, none selected at first. Pick them with **Space** on the highlighted row (**↑**/**↓** move, `Tab` reaches the buttons), then **Enter** rewrites using only the selected findings. **Nothing is selected for you and every action is a labelled button**, so a stray keypress cannot toggle a finding, trigger a rewrite, or replace your editor text. Some terminals don't send Ctrl+Shift+E; use the command instead.
- Insertion never sends anything. Choose **[Insert into editor]** in the terminal, which replaces the editor only when Elevate was opened on that draft and it is still unchanged; if you passed an explicit request, the editor must be empty. In Pi Desktop it inserts only into an empty editor. Otherwise use **[Copy]**.
- The objective is a multi-line editor: `Enter` adds a line and **Ctrl+S** (or `Ctrl+Enter` where the terminal delivers it) starts discovery. **Ctrl+C** copies your objective or the rewritten request whenever there is one, and on a terminal too short for the editor the modal asks for a bigger one rather than letting you type blind.
- Elevate uses the btw backend, model and effort from `/bro config`; there is no separate Elevate setting. It sends the request, uncapped current-branch user/assistant text by default, saved preferences and approved findings. A visible **Context: Messages / Full** switch adds tool-call arguments and text results in Full mode; both exclude hidden reasoning and image binaries. Compose opens before any call, and changing mode resets discovery without sending. Explicit Retry after a recognized context-overload error progressively removes older history, visibly marks reduced context and preserves the objective and approvals; other failures do not trim history. Each step is a fresh call; selections are kept in memory only and cleared on close. Findings are model suggestions, not checked facts. **Retry** repeats the step that failed, so a failed rewrite keeps the findings you approved instead of re-running discovery. See [docs/elevate.md](docs/elevate.md).
- `/bro help` has an Elevate section.

### Changed

- Elevate instructions explicitly carry forward user decisions and corrections, avoid completed or rejected work, seek simplifying opportunities, and integrate approved insights without adding separate deliverables. Output usefulness is left to user feedback rather than AI scoring.
- The docs are reorganised. A docs home (`docs/README.md`) links to getting started, per-feature guides (`docs/features/`), commands, settings, data-and-permissions and troubleshooting references (`docs/reference/`), and examples. `docs/user-guide.md` now links to these pages, and the new pages ship in the package.
- `npm run docs:check` checks docs links and quality, and `npm test` runs it.

## [0.24.0] - 2026-10-19

### Highlights

- Guided Review now works with Codex, Grok and Agy, not just Claude and Muse. Those three run shell commands inside their own sandbox on the captured checkout.
- Bro tells you plainly when a review backend can run shell commands (and that Agy's sandbox still allows writes), and recommends Claude or Muse for PRs you do not trust.
- `/bro doctor` no longer treats a Codex/Grok/Agy review choice as a setup problem; it shows the same advisory as information.
- Nothing changes for Claude and Muse, which still use strict file-only inspection.

### Changed

- Review generation and questions no longer fail before starting on Codex, Grok and Agy. Codex runs `--sandbox read-only --ephemeral`, Grok runs `--sandbox read-only --permission-mode dontAsk`, and Agy keeps `--sandbox` (which limits terminal commands, not file writes); all three use the captured checkout and the 10-minute review deadline. No bypass flag is ever added to a review, and Grok review no longer gets the "do not inspect" prompt restriction.
- A new advisory appears while a review is being prepared, in the review window, and in `/bro doctor`: the backend runs commands inside its sandbox rather than doing strict file-only inspection.
- Saved reviews still open with any backend.

## [0.23.1] - 2026-10-15

### Highlights

- Scroll Bro's explain, show, help and btw windows with the mouse wheel again on Pi 1.2.
- See the save messages and key hints in `/bro preferences`, `/bro advisor-steer` and `/bro config` on normal-size terminals; they were cut off at the bottom.
- btw keeps your place: it follows the newest answer while you are at the bottom and no longer jumps back to the top after each reply.

### Fixed

- Mouse-wheel scrolling in the explain/show/doctor/help and btw windows on Pi 1.2 fullscreen. Pi 1.2 stopped passing raw wheel input to windows without a mouse handler; both windows now handle Pi's mouse events and keep the raw path for Pi 0.84 and regular mode.
- The wheel over the preferences, advisor-steer, config and Guided Review loading windows no longer scrolls the chat behind them on Pi 1.2.
- `/bro preferences`, `/bro advisor-steer` and `/bro config` fit their windows: no blank padding rows, a shorter editor hint line, the editors' height limit raised from 60% to 78% like the other Bro windows, and the config list sized to the terminal. At 24 rows the preferences editor now draws 18 rows instead of 27. Very short terminals (under about 22 rows) can still clip the editors, because Pi's editor has a minimum height.
- `/bro config` shows one key-hint line instead of two that disagreed, and its model picker shows its own hints.
- btw's hint while a reply runs now says Esc closes the panel and stops the reply, which is what it does.
- Guided Review saves once when you close it instead of twice; teardown without closing it (for example switching sessions) still saves.

### Changed

- Internal: `src/bro.ts` is split into feature and modal modules (#133). No behaviour change.

## [0.23.0] - 2026-10-13

### Highlights

- `/bro show` can draw a real sequence diagram when a conversation traces messages among three or more parts of a system. Press **O** to see it rendered in your browser.
- Bro is now tested on Pi 1.2 as well as Pi 0.84.2, and the README says so.
- pi-bro has a preview card in the pi.dev package gallery.

### Added

- `/bro show` can end a reply with one Mermaid `sequenceDiagram` for interactions among three or more participants (#108). The modal keeps the diagram's source readable and **O** opens a rendered version. Bro builds that page itself: it inlines a vendored Mermaid 12.1.0, allows only its own two scripts by hash, runs Mermaid with `securityLevel: "strict"` and no HTML labels, and inserts the model's text as escaped source. Any other Mermaid stays in the modal as plain text. If the diagram file cannot be written, the reply is kept and a warning is shown.

### Changed

- Tested on Pi 1.2.0 (development pin) with a CI job that keeps Pi 0.84.2 covered; the README's Pi range now reads `>=0.84.2` (#130).
- The package now bundles Mermaid 12.1.0 for sequence diagrams, so it grows from about 0.5 MB to 6 MB unpacked (#108).
- Runtime source moved into `src/`; the extension entry is now `src/bro.ts`. Installs are unaffected. The package also sets a pi.dev gallery preview image (#116).

## [0.22.2] - 2026-10-13

### Highlights

- Get `/bro show` pages built from plain HTML and CSS, without Mermaid source that could never render; prose answers stay as text.
- Get started from a short README, and find the full reference in `docs/user-guide.md` (linked from `/bro help`).
- Stopping Bro while it reads a PDF or Word file now always stops cleanly.

### Fixed

- `/bro show` no longer invites Mermaid inside the HTML fence. Bro's HTML page blocks all scripts, so Mermaid could only appear as plain source text. The prompt now asks for hand-rolled HTML and CSS only and says prose subjects never use the HTML fence (#108).

- Make cancellation consistent across synchronous reading and asynchronous parsing in `extractDocumentText` (#87).

### Added

- Reader benchmark: five real, maintainer-approved Explain fixtures and a brief-mode candidate arm for shipped-vs-candidate comparisons. Exact-text and Markdown-marker checks removed; meaning is checked by the yes/no questions (#101).

- Reader benchmark for Explain modes, BTW answers, preferences and repeated samples (#110):
  - Fingerprinted live runs, narrow Jev binary checks, and per-check candidate comparisons.
  - Report-only reader-visible counts and source deltas, separate from preservation and formatting checks.
  - Committed synthetic baseline evidence with offline recomputation in CI.
  - Optional generation through existing Claude, Codex and Muse adapters alongside Agy.
  - Synthetic coverage and experimental judgments are decision support, not proof of full fidelity or comprehension; production prompts are unchanged.

### Changed

- The README is now a short overview (install, try it, requirements, what leaves your machine, limits). The full reference moved to `docs/user-guide.md`, and `/bro help` links there (#116).
- Added `SECURITY.md`, `CONTRIBUTING.md`, issue forms and `docs/PUBLIC-PRESENTATION.md`, the presentation standard for pi-* repos (#116).
- Refocus prompt tests on safety and structure rather than frozen wording or presentation order; identify fake-Agy Explain modes from current prompt builders instead of hardcoded phrases (#110).

## [0.22.1] - 2026-10-12

### Security

- Public-web transport safety boundaries and offline qualification (#86):
  - Block IPv4-compatible IPv6 (`::/96`) and Site-Local IPv6 (`fec0::/10`) in `NON_PUBLIC_ADDRESSES` to prevent SSRF bypasses via mapped loopback and cloud metadata targets on dual-stack hosts.
  - Disable HTTP socket connection pooling (`agent: false`) on web requests so keep-alive socket reuse cannot bypass address pinning (`lookup`).
  - Add offline test coverage in `test/sources.test.ts` for mixed DNS answers, address pinning, private redirects, HTTPS downgrade, loops, hop bounds, payload limits, encoding, and cancellation.

### Fixed

- Interrupt stalled DNS lookups immediately when an abort or timeout signal fires during web ingestion (#86).

## [0.22.0] - 2026-10-11

### Fixed

- Persist settings with atomic replacement and mode 0o600 (#84):
  - Replace direct `writeFile` with atomic sibling write (`.tmp`) and `rename` to prevent settings corruption on failure, crash, or disk full (`ENOSPC`).
  - Flush writes before replacement (`flush: true`) and clean up temporary files on failure.
  - Enforce `mode: 0o600` on replaced settings files so permissions are never loosened.
  - Resolve symlinks via lstat and realpath before replacement to preserve dotfile-managed configuration symlinks, and reject if an existing symlink target cannot be resolved.
  - Align on-disk state with modal rollback behavior in `/bro config`.

### Added

- Guided Review (#104): open a PR by URL/number in local Pi to automatically get an explanation and quality assessment, captured Git evidence, findings with fix/check suggestions, diffs and optional private questions. Acquisition uses authenticated `gh` outside the active working tree. Findings remain model proposals, not approval or applied changes.
- Automatic local remembering of questions/drafts/reading position; reopening the same PR restores the captured revision without a model call. Bare `/bro guided-review` lists saved reviews; `resume` remains an alias. Close saves automatically; Stop and close cancels first. Copy finding copies to the system clipboard without submission.
- Confirmed same-revision regeneration replaces one current guide and preserves original private context; failed/cancelled generation retains it and save errors offer recovery. There is no guide-version UI or prototype-format migration. Review has its own backend override.
- Bounded live checks demonstrated an unchanged-caller defect and successful regeneration; manual UX accepted. This is not a general accuracy guarantee, live five-backend matrix or complete #104 scope. Notes, examination tracking, branch/update review and feedback delivery are not implemented.

- Durable advisor steering across sessions in `~/.pi/agent/bro-advisor.md` (#97):
  - Ingest standing priorities from `bro-advisor.md` alongside session steering (`/bro advisor-steer`).
  - Labeled prompt composition in `buildAdvisorPrompt`: standing priorities appear under `### Standing priorities (durable across sessions)` and session priorities under `### Session priorities (this session only)`.
  - Session-specific priorities take precedence over standing defaults where they conflict.
  - Fail-closed validation rejects files > 64 KB and > 4,000 characters before spawning any backend process.
  - Doctor reports both `Advisor steering (session)` and `Advisor steering (durable)`.
  - Tool result context line and details track `steeringSources: { durable, session }` while preserving backwards-compatible `steeringIncluded` boolean.
  - Retries use a frozen prompt snapshot built prior to `runAdvisorWithRetries`.
  - Clearing session steering leaves durable steering intact.

### Changed

- Doctor treats an unsupported optional review backend as an informational override hint, not a broken installation; healthy Agy/Grok/Codex defaults still report ready.
- Review is file-only on Claude/Muse: no shell, write or web tools; Agy/Grok/Codex review calls fail closed without switching backend. Other features retain their access behavior.
- Capture uses depth-1 head/merge-base trees instead of full history; fetch gets a ten-minute bound while evidence stays offline. Interrupted-capture recovery remains.
- Removed prototype record migrations after one-time backup/normalization of development records; split validation and formatted review modules/tests to the repository tab style.

- Guided Review UX consistency pass: origin-preserving Back, focused-action Enter, topic-filtered findings, pane-aware paging, visible focus/overflow, selected-item previews and compact full-width 36×18 layout. Discussion follows conversation/composer/actions order; save errors have shared retry controls and failed questions have draft-safe explicit edit/resend. Request errors are separate from model answers, streaming follows again at the bottom, and acquisition/resume/close messages give clearer orientation. Current review behavior, controls, access/storage and recovery are documented in the user guide; developer/testing guidance records its implementation rules and verification limits. Review itself has no publication action.
- Remove dead declarations and stale backend naming (#90):
  - Enable native TypeScript unused checks (`noUnusedLocals`, `noUnusedParameters`) in `tsconfig.json`.
  - Remove verified unused declarations across `bro.ts`, `backend.test.ts`, `benchmark/run.ts`, `codex.test.ts`, and `release.test.ts`.
  - Drop pass-through re-exports from `bro.ts` (`agyFailureMessage`, `agySelection`, `advisorFlagErrorHint`, `parseBtwAgyLine`); tests and consumers import them directly from `backend.ts`.
  - Rename multi-backend facilities with obsolete Agy prefixes: `runAgyText` -> `runBackendText` in `bro.ts` and `killAgyGroup` -> `killProcessGroup` in `backend.ts`.
  - Modernize outdated single-backend and pre-extraction comments.
- Separate Bro responsibilities and unify settings and backend-selection policy (#83):
  - Extract `settings.ts` (schema, typed `EXTERNAL_BACKENDS` metadata, selection policy, pure transitions, and file persistence).
  - Extract `sources.ts` (self-contained document text extraction and public web scraping with SSRF protection).
  - Extract `config-ui.ts` (`/bro config` modal, setting items, and async save serialization).
  - Extract `util.ts` (shared leaf utility helpers).
  - Unify legacy flat and v2 settings parsing into one converged validation pipeline in `settings.ts`, eliminating duplicate validation branches.
  - Initialize clean version 2 settings on fresh installations in `ensureSettingsFile()`.
  - Share pure state transitions (`applyModelChange`, `applyEffortChange`) across default and capability override rows.
  - Fix Agy variant model reselection bug where resolved effort from suffixed variants was lost.
  - Consolidate CLI version probes in `/bro doctor` into a single `checkCliVersion` helper.

## [0.21.0] - 2026-10-04

### Added

- `bro-preferences.md`: tell Bro about yourself and how you like answers. Bro adds it, JSON-quoted and labelled, to every explain, `/bro show`, and `/bro btw` prompt alongside its own instructions; the advisor never receives it. Preferences can change wording, tone, technical depth, and the answer language (code, commands, paths, names, and numbers stay verbatim). In Show they change only wording and language. Per-run choices (the mode, **M**, a Show steering query, a BTW question) win over them, and Bro's source rules, Show's hard rules, and BTW access mode always apply. Blank or missing preferences leave every prompt byte-identical to 0.20.0 (#94).
- `/bro preferences` edits the file (**Ctrl+S** save, **Ctrl+K** delete, **Ctrl+C** copy, **Esc** close). Without a file it opens with unsaved starter text that restates the old built-in audience and brief wording. Saves are checked against the 4,000-character limit, and an oversize file still opens so it can be trimmed (#94).
- The modal header shows `· prefs` when preferences shaped an explanation, drawing, or BTW turn; `/bro open` keeps the result's tag (#94).

### Changed

- Modes, **M**, and the source guard now always apply; nothing disables them (#94).
- Preferences over 4,000 characters stop explain, Show, and BTW with an actionable error before any backend call instead of being truncated. `/bro doctor` replaces its Prompt check with a Preferences check, and `/bro help` shows the preferences status (#94).
- When preferences change mid-thread, the next BTW turn starts a fresh native session reseeded with the quoted thread, on every backend, so old preferences don't linger in the backend's history (#94).

### Removed

- **Breaking:** `bro-prompt.md` is no longer read. It was a full replacement template for the explain prompt that disabled modes, **M**, and the source guard and did not affect Show or BTW. Bro does not migrate, rename, or delete it. Move what you want to keep into `/bro preferences`, and use `/bro mode brief` for the original ELI-simpleton instruction (#94).

## [0.20.0] - 2026-10-04

### Added

- Press **M** in an explanation modal to re-simplify the captured source in the next explain mode (brief → balanced → faithful). The switch applies to that explanation only: the saved mode is unchanged, **R** and `/bro open` keep the shown mode, and a second press while Bro is working cancels and skips ahead. The header now names the mode; **M** is hidden for Show, Doctor, and custom prompts.

### Changed

- `/bro btw` now tells the model who it is writing for: a tired reader who needs the point first, in plain words, at a length that fits the question, in the language they asked in. The guidance describes the reader and the goal rather than a fixed template. In full-permission mode, answers say which points were checked in the workspace.

## [0.19.5] - 2026-10-01

### Changed

- Remove the always-true backend-support predicate and unreachable doctor/config branches; retain backend-specific effort and permission validation (#74).
- Move helper, modal, advisor, and Pi SDK regression checks into named Node tests with shared isolated compilation, leaving shell smoke tests focused on host RPC integration and avoiding duplicate helper execution in PiG (#74).
- Consolidate redundant support, prompt, and BTW assertions; replace prose greps with package-documentation checks and document surviving coverage (#74).

### Fixed

- Make the advisor throttle cancellation test actually queue an emission and advance controlled time beyond its deadline; verified by removing cleanup and observing failure (#74).

### Documentation

- Explicitly archive the seven pre-conversation-only decomposition captures as historical semantic examples and record before/after test organization and timings (#74).

## [0.19.4] - 2026-10-01

### Fixed

- Preserve advisor timeout and cancellation status through the consultation wrapper. Host deadlines and cancellation stop after one attempt without backoff; ordinary invocation failures retain the existing three-attempt policy (#72).
- Bound benchmark call and usage-preflight cleanup when descendants retain output pipes, reusing backend process-group termination and escalation. Ignore late output after a stop without adding benchmark retries (#72).

### Documentation

- Distinguish host deadlines from CLI-reported failures and document unverified shutdown/reload cancellation, POSIX process-group cleanup, and Windows direct-child limits (#72).

## [0.19.3] - 2026-09-30

### Fixed

- Send large Agy explain, Show, and BTW prompts over stdin instead of exceeding argument-size limits. Older Agy versions report an upgrade hint rather than silently falling back (#73).
- Retain newest turns and message tails when bounding Show and BTW context, preserving JSON message framing (#73).

## [0.19.2] - 2026-09-30

### Fixed

- Preserve Show's diagram controls, captured source, and steering when reopening and rerunning a result. Recreate missing temporary diagrams without a model call and retain the previous diagram after a failed rerun (#71).

## [0.19.1] - 2026-09-30

### Fixed

- Always enforce Bro's restrictive content policy on generated HTML, including when model output contains a permissive policy or CSP-looking comment (#69).
- Isolate smoke-test temporary artifacts and block real backend CLIs during offline tests. Order settings mutations by RPC acknowledgements instead of fixed sleeps, and support spaces in settings-test checkout paths (#70).

## [0.19.0] - 2026-09-25

### Added

- Support for OpenAI Codex CLI (`codex`) across all features: explain, show, BTW, and advisor. Explain and show run under a read-only sandbox with ephemeral session handling; BTW continues natively via `resume` across both conversation-only and full-permission modes; advisor runs in the workspace with sandbox bypassed. Supports seeded models `gpt-5.5` and `gpt-5.4` plus custom model IDs, and reasoning efforts `low`, `medium`, `high`, `xhigh`.
- Support for Meta Muse Code (`muse`) across all features: explain, show, BTW, and advisor. Explain and show run in a scratch directory with approval, non-shell write, and shell disabled; BTW continues natively via `--session-id` across `/mode` switches; advisor runs in the workspace with `--yolo`. Supports seeded models `muse-spark-1.3-contributor` and `muse-spark-1.3` plus custom model IDs, and reasoning efforts `minimal`, `low`, `medium`, `high`, `xhigh`, `max` (omitted for model default).
- Configuration modal support in `/bro config` for Codex and Muse, including atomic model selection, custom model ID inputs, and dynamic reasoning effort dropdowns.
- Doctor diagnostic checks for Codex (version and `codex login status` authentication probe) and Muse (version probe).

## [0.18.1] - 2026-09-30

### Fixed

- Declare host-provided `typebox` and Pi packages as wildcard peer dependencies, keeping pinned copies only for development. This removes the host-dependency warning added in Pi 0.99.0 and avoids installing a separate runtime TypeBox copy.

## [0.18.0] - 2026-09-24

### Added

- `/mode` inside `/bro btw` toggles conversation-only / full permission without losing the conversation (#62). Threads start conversation-only, and reopening keeps the current mode. The header shows a simple `conversation-only` / `full permission` badge next to the model and effort.
- Claude Code BTW with native multi-turn continuation in both modes (#58): turns run in the workspace with session persistence and `--resume`. Conversation-only turns disable tools, and full permission turns bypass permissions.
- Across a `/mode` switch, Claude and Grok resume the same native session. Agy conversations stay bound to their original workspace, so Agy starts a fresh native session seeded with the main-session context and every earlier turn. The same reseed also covers any thread that has turns but no native session ID.

### Removed

- The `/bro btw --full` and `--sandbox` flags. Both are now rejected with a hint to use `/mode`, and nothing is sent to the model.
- The `/bro btw --fresh` flag. Every new or cleared thread is seeded with main-session context; reopening still continues the thread natively. `--fresh` is rejected with a `/clear` hint and nothing is sent.
- The `/insert!` and `/insert-all!` BTW composer commands. `/insert` and `/insert-all` never replace an existing main-editor draft; they ask you to edit or clear it first. The old force strings only show a notice and are never sent as questions.
- The `/bro model` and `/bro effort` commands. Use `/bro config` for the shared default and per-capability model/effort. Both now show a `/bro config` pointer and never fall through to a text explanation.

### Changed

- Docs: the README is the single backend-neutral user guide (Agy is the default, not a requirement), with one "Backends: access and retention" section. `/bro help` is now a concise reference that points to the README. The advisor prompt no longer names a backend or CLI flags. `docs/DEVELOPMENT.md` replaces `docs/DEV-SNAPSHOT.md`, and `docs/TESTING.md` is the single manual end-to-end checklist.

## [0.17.0] - 2026-09-24

### Added

- Grok Build execution for explain, show, native multi-turn BTW (both modes), and advisor, with per-capability model/effort configuration, custom model IDs, and installation diagnostics. Agy remains the default.
- Capability-first Grok access: conversation-only intent uses prompt instructions when enforcement is unavailable, with truthful UI/docs rather than feature bans or speculative tool blacklists. Native tools remain available.
- Private temporary prompt files, backend-bound continuation, authoritative terminal completion checks and bounded cancellation. Backend/access changes start a fresh BTW thread instead of reusing incompatible native session IDs.
- Explain, show, and BTW modal headers show the model and reasoning effort each request used (`default` when the model's own effort applies); `/bro open` keeps the original label.

### Changed

- The BTW header no longer shows a sandbox/conversation-only access label; the `full · edits repo` badge still marks `--full` threads.

### Removed

- `/bro usage` is removed for now. Doctor still checks Agy account access.

## [0.16.0] - 2026-09-24

### Added

- Claude Code execution for explain, show and advisor, selected independently per capability through `/bro config`. Explain/show disable tools and customizations; advisor runs fresh with workspace tools. Claude-backed BTW is explicitly unsupported in this release.
- Backend-tagged model/effort selections with atomic per-capability overrides. Existing settings remain Agy selections and are migrated to version 2 only when saved; Agy remains the default.

## [0.15.1] - 2026-09-22

### Changed

- Explain, show, BTW and advisor now share an internal Agy execution boundary. Agy remains the only backend; existing settings, prompts, access modes, continuation and advisor retries are unchanged.

### Fixed

- Cancellation, host deadlines and malformed execution streams use bounded subprocess cleanup, with POSIX process-group termination and escalation. Unexpected signal exits are reported as failures rather than mislabeled timeouts. Windows cleanup remains limited to the direct child.
- Offline RPC smoke checks wait for command acknowledgements instead of relying on fixed delays to prevent overlapping requests and premature shutdown.

## [0.15.0] - 2026-09-22

### Changed

- In the `/bro btw` modal, `/copy` and `/copy-all` now copy the latest answer or the full thread to the **system clipboard** instead of the main editor. New `/insert` and `/insert-all` commands (with `/insert!`/`/insert-all!` force variants to replace an existing main-editor draft) insert into the main editor without submitting. Removed the legacy `/send` aliases and the spaced `/copy all`/`/insert all` spellings.

## [0.14.0] - 2026-09-20

### Added

- `bro_advisor` — a tool the **executor agent** (not the human) can voluntarily call mid-task for a second opinion from a fresh, standalone Agy process with real, unsandboxed tool access in the workspace (`--dangerously-skip-permissions`). Bro automatically captures a harness-neutral snapshot of the executor's system instructions, active tools, and conversation so far (including tool calls and results) and sends it, plus an optional executor-supplied question, to the advisor. The advisor is instructed to investigate before advising and to leave edits to the executor, but that boundary is behavioral, not enforced. Invocation failures retry twice (5s, then 10s) with the identical snapshot before surfacing Agy's own diagnostic.
- `/bro advisor-steer` — an editor for one persistent, session-scoped steering brief the advisor always reads (e.g. "quick prototype; keep A and B careful, everything else minimal"). The brief is stored as session-only extension data, is never added to Pi's conversation or sent to the main model, persists across resume/reload, and is inherited by forks.
- `/bro advisor` — a quick notice of whether `bro_advisor` is currently exposed and active, pointing at `/bro config`, `/bro advisor-steer`, and `/bro doctor`. `/bro doctor` carries the full diagnostic, including the Agy 1.1.15+ compatibility check.
- `/bro config` — a production settings screen replacing the earlier configuration-only spike: a shared default model/effort (still owned by `/bro model`/`/bro effort`) plus optional per-capability overrides for `explain`, `show`, `btw`, and `advisor`. An override always pins both model and effort together and is only ever cleared by an explicit "Default" selection. Saves are serialized and coalesced, with in-place revert and an inline error notice on failure.

### Changed

- Requires Earendil Pi `>=0.84.2 <1` and `agy >=1.1.15` (up from `>=0.78.1 <1` and `>=1.1.11`).

## [0.13.2] - 2026-09-19

### Changed

- In the `/bro btw` modal, your questions now render as a quoted **You** block and answers carry an explicit **Bro** label, with a horizontal rule between turns. The old `## you` heading was indistinguishable from headings inside Bro's answers.

## [0.13.1] - 2026-09-17

### Changed

- Renamed `/bro btw` composer commands from `/send` and `/send all` to `/copy` and `/copy-all` (also accepts `/copy all`), with `/copy!` and `/copy-all!` force variants to replace existing main-editor drafts. Legacy `/send` commands remain supported as aliases.

## [0.13.0] - 2026-09-15

### Added

- `/bro btw` — a side conversation in a modal, sandboxed (read-only) by default, with `--full` opting up to workspace access and `--fresh` skipping main-session context. Composer commands: `/send`, `/send all`, `/send!`, `/send all!`, `/retry`, `/clear`; empty Enter re-asks the last question. Runs through Agy, resumed via `--conversation <id>`; the thread is memory-only and clears on session change.

## [0.12.0] - 2026-09-11

### Changed

- `/bro show` now captures only user and assistant conversation text — every intermediate assistant message within a turn is kept, but tool calls, tool results, reasoning, and images are omitted entirely, with no placeholder text standing in for them. This supersedes the 0.10.0 design, which captured tool calls and tool results (trimmed) alongside conversation text; the source label changes from `last N turn(s)` to `last N turn(s) · conversation only` to reflect the narrower capture. Turn counting, the `n-turns` override, steering query, retry-on-**R**, and the 100,000-character transcript limit are unchanged.
- The show prompt now states its outcome hierarchy explicitly — user-visible behavior and outcome first, then system/data/state effects, then component or file relationships — and distinguishes what was explicitly requested, proposed but not done, reported as complete, or left unresolved. It also names that the transcript is the conversation's own account of what happened, not an independent check against the actual code or system, so shapes should say a result was reported or claimed rather than implying verification, without hedging every line.

### Development

- Rewrote `benchmark/show-corpus.ts`'s ten fixtures as conversation-only transcripts (no `## tool call` / `## tool result` sections), matching what `/bro show` now actually sends to the draw model, while keeping every fixture's required-token traceability.
- `benchmark/fixtures/decomposition/` (manual, not part of `npm test`) is annotated as predating conversation-only capture; its mined fixtures still contain tool call/result sections from the old format.
- Added smoke-test coverage asserting that every intermediate assistant message within a turn is retained, that tool calls and tool results never reach the captured transcript even when present in the session branch, and that the empty-session case still returns nothing to show.

## [0.11.0] - 2026-09-09

### Changed

- Rewrote the `/bro show` prompt from single-diagram shrinking to subject-first decomposition: find what the user actually wanted and what is true now, never diagram tool chronology (tool invocations, retries, git/gh commands, test runs) unless the process itself is the subject, and treat fetching, reading, editing, and testing as sub-steps rather than separate concerns. One concern still yields exactly one shape; multiple concerns yield a small overview plus 2–4 focused shapes that each add information instead of restating one another. Read-only pages, reviews, and analyses now keep their substance instead of collapsing to labels, while incidental orientation reads and process noise are omitted. Prose and research subjects degrade to a compact outline or comparison.
- Lowered the default `/bro show` window from the last 10 turns to the last 1, since the decomposed prompt now draws the resulting outcome rather than tool chronology, so a single turn is usually enough context.
- `/bro show` now takes an optional steering query, with or without a leading turn count (`/bro show`, `/bro show 3`, `/bro show what changed in the auth flow`, `/bro show 3 what changed in the auth flow`). The query is passed to the model as a lens on the same transcript, not as additional evidence, and its original casing and internal spacing are preserved. Only the first whitespace-delimited token is ever read as the turn count, so a digit-leading query word never gets mistaken for one: `/bro show 1 404 handler` captures 1 turn and steers on "404 handler", and `/bro show 2FA flow` treats "2FA" as the start of the query since it isn't a bare integer.
- `/bro show`'s prompt now offers a user flow, data flow, or state diagram as first-choice shapes for "what happens" subjects, ahead of code-structure shapes — and these high-level shapes no longer degrade to a plain outline just because the session has no code structure to draw. The prompt also requires naming any evidence missing from the transcript instead of guessing to fill the gap.

### Development

- Added a `/bro show` decomposition validation set under `benchmark/fixtures/decomposition/`: seven serialized-transcript fixtures mined from real pi-bro sessions (one shallow single-concern baseline, four medium multi-concern, one deep, one cross-cutting stretch case), a manifest recording each window's expected concerns and expected shape count, and a 15-check binary rubric (coverage, decomposition, simplicity, coherence, traceability, usefulness) for grading outputs without 1–5 scores. Personal emails in the fixtures are redacted. Grading is manual; nothing here runs in `npm test`.

## [0.10.1] - 2026-09-09

### Development

- Added release automation: merging a PR that bumps the version now tags it, publishes to npm through trusted publishing (OIDC, with provenance), and creates the matching GitHub release. CI validates the bump against npm before merge, and a daily sync check reports any npm/GitHub drift. No packaged files changed in this release.

## [0.10.0] - 2026-09-07

### Added

- Added `/bro show <n-turns>`: draw the last session turns, including tool results, as shapes — pseudocode, call trees, file trees, component trees, types and signatures, or diffs — instead of prose, in the same context-isolated modal. Defaults to the last 10 turns; a new `showTurns` setting (positive integer) changes the default and `/bro show <n-turns>` overrides it for one run. Adapts the `show-me` plugin from humanlayer/skills (MIT; credited in `THIRD_PARTY_NOTICES.md`).
- Added an HTML escalation path for show: when a reply ends with one self-contained ` ```html ` fence, Bro writes it to `/tmp/pi-bro-<uid>/bro-show-<hash>.html` with a restrictive Content-Security-Policy, replaces it in the modal with a placeholder, and offers **O** to open it in the default browser. **C** still copies the complete reply including the fence, and **R** regenerates it.
- Added a separate `show` benchmark track (`--track show`): serialized-transcript fixtures graded by selection semantics — hardened identifier traceability (camelCase, snake_case, and SCREAMING_CASE tokens inside fences, diff-header stripping, backtick tokenization), fence-shape rules (balanced fences, html-last with no trailing prose, no bare or untagged mermaid, no external resources), and diff-marker validation. The corpus carries one fixture per show-me form; the modes benchmark keeps its frozen 32-row baseline and fingerprint.

### Changed

- Show capture and serialization: a turn is one user message plus every assistant message, tool call, and tool result after it; section headers are plain and every payload is JSON-quoted, matching the existing injection posture; tool results are trimmed to the first and last 2,000 characters with an elision marker; tool-call arguments are head-trimmed at 500 characters; thinking and image content become one-line placeholders; oldest turns are dropped whole when the serialized transcript exceeds 100,000 characters, and the source label reports the turns actually kept.
- `/bro show` reuses the captured transcript snapshot on **R** (like `/bro url`), feeds `/bro open` through the same remember path as the other source commands, and shows an in-modal empty state instead of an error when the session has no turns.
- Show bypasses explanation modes and `bro-prompt.md` entirely; it has its own built-in prompt. Modes, settings, and custom-prompt precedence are unchanged.
- Show output never wraps identifiers in Markdown links, and prose-only sessions degrade to a plain outline rather than a diff or a forced diagram.

### Development

- `docs/plans/2026-09-07-bro-show-visual-design.md` records the full design, the decision to separate show from the built-in modes after implementing it as a fourth mode, and the post-review hardening list. An earlier commit on this branch added `visual` as a mode and was superseded before release; no released version ever offered it.
- Smoke tests cover serialization, trimming, capture windows, the HTML contract (per-user directory, keep-one cleanup, CSP injection, CRLF tolerance), routing canaries, `showTurns` validation, and session/model-context leak checks for show output. Live validation: a 132 KB real session captured to a 76,210-character transcript (3 turns, 33 tool calls/results, 7 elided) produced a 3,065-character output; a prose-only session degraded to an outline.

## [0.9.3] - 2026-09-06

### Fixed

- Corrected the built-in help's brief-mode description, which still claimed a fixed word target removed in 0.9.1, and quoted the spaced-path example in the README. The 0.9.2 package on npm was packed before these doc fixes landed.

## [0.9.2] - 2026-09-06

### Changed

- Renamed `/bro simplify` to `/bro text`, matching the `/bro file` and `/bro url` input-source commands. Bare `/bro` (or `/bro text` with no text) still explains the latest completed assistant reply.
- Added context-aware routing: an unknown first word makes the whole input the source — a lone URL runs the webpage reader, an existing workspace file with a supported extension runs the document reader (including quoted paths with spaces), and anything else is explained as pasted text. Explicit subcommands are unchanged; inputs that used to fail as unknown actions are now explained as text, while `/bro open` and `/bro help` with extra words now warn instead of silently explaining the latest reply.

## [0.9.1] - 2026-08-24

### Changed

- Replaced the built-in mode prompts with the original audience-led brief prompt and Gemini-authored balanced and faithful prompts.
- Removed fixed word targets. Balanced trims repetition while preserving important context; faithful preserves every source detail and formatting choice.
- Kept a shared guard that rejects embedded source instructions and unsupported facts, advice, or conclusions.

## [0.9.0] - 2026-08-24

### Added

- Added persistent `/bro mode [brief|balanced|faithful]` selection.
- Added three built-in explanation modes:
  - `brief` focuses on the main point and next action.
  - `balanced` preserves material detail while improving clarity and is the default.
  - `faithful` stays closest to the source and has no fixed word limit.
- Added stronger preservation of source language, commands, URLs, paths, numbers, warnings, conditions, Markdown links, and fenced code.

### Changed

- Existing settings without `mode` now use `balanced` automatically.
- Built-in prompts now reject embedded source instructions, avoid preambles and unsupported inferences, replace clichés with their plain meaning, and avoid unnecessarily expanding already-clear text.
- The balanced mode's 400-word target may be exceeded when preserving important details requires it.

### Compatibility

- Existing valid `bro-prompt.md` files continue working unchanged.
- A custom prompt fully overrides built-in mode instructions. `/bro mode` still saves a selection, but it remains inactive until `bro-prompt.md` is removed or renamed.
- Bro still uses Agy and keeps explanations outside Pi's session and main-agent context.

### Development

- Added a manual, resumable 32-row Agy prompt benchmark with stable hashes, explicit fingerprint approval, process isolation, mechanical checks, and blind-review output.
- Adapted benchmark fixtures and checks from `speak-like-you-eat` under its MIT license.
- Final benchmark results and limitations are recorded in `benchmark/initial-results.md`.
