pi-advisor-flow 0.5.4 → 0.5.6

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,7 +2,27 @@
2
2
 
3
3
  All notable changes to this project are documented here.
4
4
 
5
- The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5
+ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0/).
6
+
7
+ ## 0.5.6 - 2026-09-11
8
+
9
+ ### Fixed
10
+
11
+ - Preserve manual `advisor.json` edits when unrelated settings are saved.
12
+ - Bundle the published extension entry so Node's loader shares configuration state.
13
+
14
+ ### Changed
15
+
16
+ - Raised the Pi compatibility dev/test baseline to 0.85.1 and widened the peer ranges to `^0.84.1 || ^0.85.1`, keeping Pi 0.84.x supported while excluding Pi 0.85.0, whose undeclared `/server` import broke extension loading.
17
+ - The model picker frames its list with single border rules matching the other Advisor surfaces, normalizes every rendered line to the terminal width so long model identifiers no longer wrap the layout, and dims its hint row like the other hint rows.
18
+ - The `/advisor-manual` dialog centers its Submit and Cancel buttons between the dialog borders at supported overlay widths.
19
+ - Settings text submenus clear a validation error as soon as the value changes instead of leaving it until the next submit.
20
+
21
+ ## 0.5.5 - 2026-09-08
22
+
23
+ ### Changed
24
+
25
+ - Restored README documentation depth that had been condensed in 0.5.1: the feature list, usage accounting and outcome logging behavior, Scout fallback details, and expanded privacy documentation, while keeping the tightened structure and install/quick-start flow.
6
26
 
7
27
  ## 0.5.4 - 2026-09-08
8
28
 
package/README.md CHANGED
@@ -8,25 +8,37 @@ A configurable second-opinion workflow for <a href="https://github.com/earendil-
8
8
 
9
9
  </div>
10
10
 
11
- ![d18m Downloads](https://img.shields.io/npm/d18m/pi-advisor-flow?style=flat) ![NPM Version](https://img.shields.io/npm/v/pi-advisor-flow?style=flat) ![Pi Advisor Flow badge](https://img.shields.io/badge/advisor%20flow-fff?logo=pi&logoColor=000)
12
-
11
+ ![Downloads](https://img.shields.io/npm/d18m/pi-advisor-flow?style=flat) ![NPM Version](https://img.shields.io/npm/v/pi-advisor-flow?style=flat) ![Pi Advisor Flow badge](https://img.shields.io/badge/advisor%20flow-fff?logo=pi&logoColor=000)
13
12
 
14
13
  `pi-advisor-flow` keeps one model focused on execution and makes a second, smarter model available for consequential decisions, stalled work, and final reviews. The Executor still owns the work. The Advisor challenges assumptions, exposes risks, and suggests verification steps without taking over or running tools.
15
14
 
16
15
  Keep implementation on a fast model and borrow frontier reasoning only when decisions matter. [Read why this workflow is useful](https://philipbrembeck.com/writings/2026/07/only-as-much-intelligence-as-you-need).
17
16
 
17
+ ## Features
18
+
19
+ - **On-demand second opinions** through the `ask_advisor` tool or `/advisor-manual`.
20
+ - **Configurable review gates** before plans, after repeated failures, and before declaring completion.
21
+ - **Automatic loop detection** for repeated tool calls, with explicit proceed, revise, or blocked decisions.
22
+ - **Separate model and reasoning controls** for the Executor and Advisor.
23
+ - **Advisor usage accounting** with per-response token and cost details, normalized usage in Pi's `/cost` totals, and an optional cumulative footer.
24
+ - **Privacy controls** for conversation history, repository context, explicit file handoff, tool results, secret redaction, and outcome logging.
25
+ - **Optional persistent activation, Simple mode, session summaries, and Herdr integration.**
26
+ - **Compact searchable `/advisor-settings`** that matches Pi's settings list and saves changes immediately.
27
+ - **Experimental Advisor Scout** that uses the configured Executor model to curate conversation evidence before every Advisor call.
28
+
18
29
  ## How it works
19
30
 
20
- 1. The Executor works on your task as usual.
21
- 2. It calls `ask_advisor`, or an enabled gate starts a review.
31
+ 1. The Executor investigates the task and forms its own candidate direction.
32
+ 2. For a consequential decision, stalled attempt, or final review, it calls `ask_advisor` or an enabled gate starts a review.
22
33
  3. pi-advisor reconstructs the relevant conversation and allowed repository context.
23
- 4. The Advisor returns an opinion. The Executor decides what to adopt, changes the code, and validates it.
34
+ 4. The Advisor returns an opinion with risks, alternatives, and verification steps.
35
+ 5. The Executor decides what to adopt, changes the code, and validates it.
24
36
 
25
- Regular consultations do not block execution. Automatic loop gates are different: they can stop a repeated tool action or session based on your configured failure policy.
37
+ Regular consultations never block execution. Automatic loop gates are different: they evaluate repeated tool calls and can stop a tool action or session based on your configured failure policy.
26
38
 
27
39
  ## Install
28
40
 
29
- Requires Pi 0.84.1 or later.
41
+ Requires Pi 0.84.1 or later. Pi 0.85.0 is not supported (broken upstream release); use Pi 0.85.1 or later instead.
30
42
 
31
43
  ```bash
32
44
  pi install npm:pi-advisor-flow
@@ -48,39 +60,58 @@ Reload Pi after installing.
48
60
  /advisor-settings # Configure behavior, modes, etc.
49
61
  ```
50
62
 
51
- On first use, or whenever a saved model is unavailable, `/advisor` opens the same available-model picker as `/advisor-models`; it never silently chooses an unconfigured model. After activation, `/advisor` explains that the Advisor reviews the Executor's context without changing files or running tools.
63
+ On first use, or whenever a saved model is unavailable, `/advisor` opens the same available-model picker as `/advisor-models`; it never silently chooses an unconfigured model. You can also enable the flow and select both models at once:
64
+
65
+ ```text
66
+ /advisor executor=openai-codex/gpt-5.6-luna advisor=openai-codex/gpt-5.6-sol
67
+ ```
52
68
 
53
69
  From the Executor, `ask_advisor({})` requests a general review. A targeted `question` or concise `draft` can focus the review on a particular decision.
54
70
 
55
- In the Settings, enable the Simple Mode for a quick start.
71
+ In the Settings, enable Simple Mode for a quick start.
72
+
56
73
  ![Pi Advisor Settings Panel](https://raw.githubusercontent.com/philipbrembeck/pi-advisor/refs/heads/main/assets/settings.png)
57
74
 
75
+ Unknown fields in `advisor.json` are preserved for forward compatibility and reported as non-blocking warnings. Invalid recognized values fail their own Advisor call with a clear message instead of blocking every tool call.
76
+
77
+ ## Usage and accounting
78
+
79
+ Advisor responses show provider-reported input, output, cache, and cost details when available. Successful `ask_advisor` calls also carry normalized usage into Pi's built-in `/cost` totals. Manual consultations and automatic gates keep their own session-local accounting instead, so nothing is double-counted. Missing or partial provider usage is shown as unavailable rather than fabricated as zero. `/advisor-settings` controls both the per-response details and the optional cumulative footer independently.
80
+
81
+ Successful calls return an opaque `adviceId`. If global outcome logging is enabled, the Executor can call `record_advisor_outcome` once to record whether the advice was adopted and whether final validation passed.
82
+
58
83
  ## Commands
59
84
 
60
- | Command | What it does |
61
- | ------------------------- | ------------------------------------------------- |
85
+ | Command | What it does |
86
+ | ------------------------- | --------------------------------------------------- |
62
87
  | `/advisor` | Enable the flow; choose available models when needed. |
63
- | `/advisor-manual [focus]` | Ask for an immediate second opinion. |
64
- | `/advisor-models` | Choose the Executor and Advisor models. |
65
- | `/advisor-settings` | Configure behavior, context, privacy, and limits. |
66
- | `/advisor-off` | Disable the flow and persistent activation. |
88
+ | `/advisor-manual [focus]` | Ask for an immediate second opinion. |
89
+ | `/advisor-models` | Choose the Executor and Advisor models. |
90
+ | `/advisor-settings` | Configure behavior, context, privacy, and limits. |
91
+ | `/advisor-off` | Disable the flow and persistent activation. |
92
+
93
+ In the interactive TUI, `/advisor-manual [focus]` opens a centered overlay with the focus text prefilled, a choice of permitted Git-context level, and live progress in the transcript. Canceling has no side effects.
67
94
 
68
95
  ### Experimental Advisor Scout
69
96
 
70
- Advisor Scout is off by default. When enabled, the Executor model first selects relevant conversation history before the Advisor sees it. This adds a model call, latency, and cost. See the [configuration guide](https://github.com/philipbrembeck/pi-advisor/blob/main/docs/configuration.md) for details.
97
+ Advisor Scout is off by default. When enabled in `/advisor-settings` or via `"advisorScoutEnabled": true`, the Executor model first selects relevant conversation history before the Advisor sees it. Scout runs in a separate model call, which adds cost and latency up front but can shrink the Advisor call. A bounded result shows the model, selection counts, and usage; on any failure it falls back to sending the original conversation unchanged. This experiment adapts the context-boundary idea from Zhang et al., ["FastContext: Training Efficient Repository Explorer for Coding Agents"](https://arxiv.org/html/2606.14066v1) — it curates conversation history only and is not a reproduction of FastContext. See the [configuration guide](https://github.com/philipbrembeck/pi-advisor/blob/main/docs/configuration.md) for details.
71
98
 
72
99
  ## Privacy
73
100
 
74
- Advisor requests can include user messages, tool calls, tool results, targeted questions, and repository information. `/advisor-settings` controls context, tool disclosure, redaction, and explicit file handoff. Secret redaction is off by default; when enabled, credential-shaped values in targeted questions are redacted before the provider request. Tools without an explicit policy use full context. Settings are global, so a project cannot silently change them.
101
+ Advisor requests can include user messages, tool calls, tool results, targeted questions, and repository information. Repository context is configurable from no access through changed-file summaries to a capped patch; when it is disabled, the Advisor is told so rather than shown an apparently clean tree. Explicit tracked and untracked file contents require separate global opt-ins and are sent as untrusted data. Secret redaction is off by default; when enabled, credential-shaped values in targeted questions are redacted before the provider request. Tools without an explicit policy use full context. Settings are global, so a project cannot silently change them.
75
102
 
76
- Read [Privacy and data handling](https://github.com/philipbrembeck/pi-advisor/blob/main/docs/privacy.md) before using pi-advisor with sensitive work.
103
+ When Scout is enabled, the Executor model provider also receives bounded Advisor-eligible conversation history. Read [Privacy and data handling](https://github.com/philipbrembeck/pi-advisor/blob/main/docs/privacy.md) before using pi-advisor with sensitive work.
77
104
 
78
105
  ## Documentation
79
106
 
80
107
  - [Configuration and automatic loop gates](https://github.com/philipbrembeck/pi-advisor/blob/main/docs/configuration.md)
81
108
  - [Privacy and data handling](https://github.com/philipbrembeck/pi-advisor/blob/main/docs/privacy.md)
82
109
  - [Development](https://github.com/philipbrembeck/pi-advisor/blob/main/docs/development.md)
83
- - [Benchmarking](docs/benchmark.md)
110
+ - [Benchmarking](https://github.com/philipbrembeck/pi-advisor/blob/main/docs/benchmark.md)
111
+ - [Documentation index](https://github.com/philipbrembeck/pi-advisor/blob/main/docs/README.md)
112
+
113
+ ## Links
114
+
84
115
  - [Changelog](CHANGELOG.md)
85
116
  - [MIT License](LICENSE)
86
117
  - [npm package](https://www.npmjs.com/package/pi-advisor-flow)