pi-advisor-flow 0.9.2-dev.4 → 0.9.2-dev.5

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
@@ -6,6 +6,11 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
6
6
 
7
7
  ## Unreleased
8
8
 
9
+ ### Added
10
+
11
+ - Added `/advisor-stats`, a local rendered report for retained outcome triggers, adoption, followed-versus-rejected validation pass rates, distinct pseudonymous advice hashes, and the capped ledger time window.
12
+ - Added default-on, toggleable `AGENTS.md` context for trusted Advisor calls, with origin labels, redaction, byte caps, untrusted-rule framing, and explicit withholding for untrusted projects.
13
+
9
14
  ### Fixed
10
15
 
11
16
  - Prevented settings saves from overwriting malformed `advisor.json` files and rolled back runtime settings when persistence fails.
package/README.md CHANGED
@@ -22,7 +22,8 @@ Keep implementation on a fast model and borrow frontier reasoning only when deci
22
22
  - **Separate model and reasoning controls** for the Executor and Advisor, with same-model consultations skipped by default to avoid redundant calls.
23
23
  - **Model whitelist** that can restrict Advisor calls to exact `provider/model` Executor references.
24
24
  - **Advisor usage accounting** with per-response token and cost details, normalized usage in Pi's `/cost` totals, and an optional cumulative footer.
25
- - **Privacy controls** for conversation history, repository context, explicit file and image handoff, tool results, secret redaction, and outcome logging.
25
+ - **Outcome reporting** through `/advisor-stats`, with adoption and validation comparisons over the retained ledger window.
26
+ - **Privacy controls** for conversation history, repository context, trusted `AGENTS.md` rules, explicit file and image handoff, tool results, secret redaction, and outcome logging.
26
27
  - **Visual Advisor reviews** for supported PNG, JPEG, GIF, and WebP images in selected conversation or tool results when the Advisor model accepts images.
27
28
  - **Optional persistent activation, Simple mode, session summaries, and Herdr integration.**
28
29
  - **Compact searchable `/advisor-settings`** that matches Pi's settings list and saves changes immediately.
@@ -69,6 +70,7 @@ Reload Pi after installing.
69
70
  /advisor # Enable the Advisor Flow
70
71
  /advisor-models # Choose the Executor and Advisor models
71
72
  /advisor-settings # Configure behavior, modes, etc.
73
+ /advisor-stats # Show retained outcome adoption and validation stats
72
74
  ```
73
75
 
74
76
  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. If the active Executor and Advisor use the same provider/model, calls and automatic gates are skipped with a notice; switching either model resumes consultations. Turn off **Disable same-model Advisor** in `/advisor-settings` (or set `"advisorDisableSameModel": false` globally) if you intentionally want a higher-effort review from that same model. You can also enable the flow and select both models at once:
@@ -89,6 +91,8 @@ Unknown fields in `advisor.json` are preserved for forward compatibility and rep
89
91
 
90
92
  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.
91
93
 
94
+ `/advisor-stats` reads the local outcomes ledger and reports trigger counts, adoption, followed-versus-rejected validation pass rates, distinct pseudonymous advice hashes, and the retained time window. It never fabricates historical cost data; the ledger is capped at 1 MiB and rewritten on overflow.
95
+
92
96
  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.
93
97
 
94
98
  ## Commands
@@ -99,6 +103,7 @@ Successful calls return an opaque `adviceId`. If global outcome logging is enabl
99
103
  | `/advisor-manual [focus]` | Ask for an immediate second opinion. |
100
104
  | `/advisor-models` | Choose the Executor and Advisor models. |
101
105
  | `/advisor-settings` | Configure behavior, context, privacy, and limits. |
106
+ | `/advisor-stats` | Show retained outcome adoption and validation stats. |
102
107
  | `/advisor-off` | Disable the flow and persistent activation. |
103
108
 
104
109
  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.
@@ -109,7 +114,7 @@ Advisor Scout is off by default. When enabled in `/advisor-settings` or via `"ad
109
114
 
110
115
  ## Privacy
111
116
 
112
- 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. Images from disclosed conversation and full-policy tool results can be sent as pixels only to image-capable Advisor models; Scout sees markers, not pixels. Exact tracked and untracked image files can be attached using `includeTrackedFiles` and `includeUntracked` under their existing separate global consent rules. Images are limited to four and 8 MiB total, with a 4 MiB per-image cap; unsupported, missing, or oversized images are reported as withheld, not reviewed. 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.
117
+ Advisor requests can include user messages, tool calls, tool results, targeted questions, trusted project and global `AGENTS.md` rules, and repository information. `advisorAgentsMdContext` is on by default and can be disabled in `/advisor-settings`; rules are sent as origin-labelled, capped, redacted, untrusted review guidance only. Untrusted projects withhold both rule files and tell the Advisor that rules were withheld. 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. Images from disclosed conversation and full-policy tool results can be sent as pixels only to image-capable Advisor models; Scout sees markers, not pixels. Exact tracked and untracked image files can be attached using `includeTrackedFiles` and `includeUntracked` under their existing separate global consent rules. Images are limited to four and 8 MiB total, with a 4 MiB per-image cap; unsupported, missing, or oversized images are reported as withheld, not reviewed. 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.
113
118
 
114
119
  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.
115
120