@herbertgao/pi-extensions 2026.9.2 → 2026.9.3
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/README.md +3 -2
- package/THIRD_PARTY_NOTICES.md +24 -0
- package/node_modules/@herbertgao/sol-pi/LICENSE +19 -0
- package/node_modules/@herbertgao/sol-pi/README.md +159 -0
- package/node_modules/@herbertgao/sol-pi/SECURITY.md +26 -0
- package/node_modules/@herbertgao/sol-pi/THIRD_PARTY_NOTICES.md +19 -0
- package/node_modules/@herbertgao/sol-pi/agents-install.md +150 -0
- package/node_modules/@herbertgao/sol-pi/assets/sol-pi-hero.png +0 -0
- package/node_modules/@herbertgao/sol-pi/docs/compatibility.md +69 -0
- package/node_modules/@herbertgao/sol-pi/docs/configuration.md +75 -0
- package/node_modules/@herbertgao/sol-pi/package.json +76 -0
- package/node_modules/@herbertgao/sol-pi/scripts/check-pi-compat.mjs +32 -0
- package/node_modules/@herbertgao/sol-pi/scripts/check-sol-pi-config.mjs +120 -0
- package/node_modules/@herbertgao/sol-pi/sol-pi.example.json +10 -0
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/config.ts +135 -0
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/action-fusion/file-queue.ts +74 -0
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/action-fusion/index.ts +185 -0
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/action-fusion/then-run.ts +128 -0
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/evidence-preserving-reducer/archive.ts +53 -0
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/evidence-preserving-reducer/candidate.ts +101 -0
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/evidence-preserving-reducer/config.ts +71 -0
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/evidence-preserving-reducer/index.ts +220 -0
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/evidence-preserving-reducer/journal.ts +25 -0
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/evidence-preserving-reducer/provider.ts +164 -0
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/evidence-preserving-reducer/receipt.ts +177 -0
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/observation-pack/index.ts +227 -0
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/observation-pack/ledger.ts +20 -0
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/observation-pack/observation.ts +252 -0
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/economics.ts +237 -0
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/extension.ts +455 -0
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/index.ts +49 -0
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/plan.ts +79 -0
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/state.ts +208 -0
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/tools.ts +100 -0
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/index.ts +42 -0
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/runtime-paths.ts +17 -0
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/tui.ts +71 -0
- package/node_modules/@narumitw/pi-btw/dist/index.ts +12 -2
- package/node_modules/@narumitw/pi-btw/dist/index.ts.map +2 -2
- package/node_modules/@narumitw/pi-btw/package.json +1 -1
- package/node_modules/@narumitw/pi-btw/src/btw.ts +13 -2
- package/node_modules/pi-lens/CHANGELOG.md +176 -0
- package/node_modules/pi-lens/README.md +13 -8
- package/node_modules/pi-lens/config/dependency-cruiser-eager-allowlist.json +3 -1
- package/node_modules/pi-lens/dist/clients/analysed-root.js +1 -0
- package/node_modules/pi-lens/dist/clients/ast-grep-tool-logger.js +1 -1
- package/node_modules/pi-lens/dist/clients/biome-client.js +13 -2
- package/node_modules/pi-lens/dist/clients/bounded-telemetry.js +2 -0
- package/node_modules/pi-lens/dist/clients/cache-observability.js +122 -1
- package/node_modules/pi-lens/dist/clients/complexity-client.js +5 -0
- package/node_modules/pi-lens/dist/clients/config-diagnostic-codes.js +2 -0
- package/node_modules/pi-lens/dist/clients/config-resolve.js +6 -3
- package/node_modules/pi-lens/dist/clients/config-schema.js +17 -0
- package/node_modules/pi-lens/dist/clients/config-warn.js +2 -2
- package/node_modules/pi-lens/dist/clients/dead-code-client.js +8 -1
- package/node_modules/pi-lens/dist/clients/dependency-checker.js +5 -1
- package/node_modules/pi-lens/dist/clients/dispatch/dispatcher.js +38 -15
- package/node_modules/pi-lens/dist/clients/dispatch/facts/function-facts.js +1 -1
- package/node_modules/pi-lens/dist/clients/dispatch/facts/import-facts.js +5 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/actionlint.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/biome-check.js +2 -3
- package/node_modules/pi-lens/dist/clients/dispatch/runners/cpp-check.js +4 -3
- package/node_modules/pi-lens/dist/clients/dispatch/runners/credo.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/cue-vet.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/dart-analyze.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/detekt.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/dotnet-build.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/elixir-check.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/eslint.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/fish-indent.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/gleam-check.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/go-vet.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/golangci-lint.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/hadolint.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/helm-lint.js +3 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/helm-render.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/htmlhint.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/javac.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/ktlint.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/lsp.js +19 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/markdownlint.js +3 -2
- package/node_modules/pi-lens/dist/clients/dispatch/runners/mypy.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/oxlint.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/php-lint.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/phpstan.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/prisma-validate.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/psscriptanalyzer.js +12 -12
- package/node_modules/pi-lens/dist/clients/dispatch/runners/pyright.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/rubocop.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/ruff.js +2 -2
- package/node_modules/pi-lens/dist/clients/dispatch/runners/rust-clippy.js +12 -11
- package/node_modules/pi-lens/dist/clients/dispatch/runners/shellcheck.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/shfmt.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/spellcheck.js +2 -2
- package/node_modules/pi-lens/dist/clients/dispatch/runners/spotbugs.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/sqlfluff.js +3 -2
- package/node_modules/pi-lens/dist/clients/dispatch/runners/stylelint.js +3 -2
- package/node_modules/pi-lens/dist/clients/dispatch/runners/swiftlint.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/taplo.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/terragrunt.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/tflint.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/trivy-config.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/availability-policy.js +5 -0
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/candidate-probe.js +2 -2
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/runner-helpers.js +8 -2
- package/node_modules/pi-lens/dist/clients/dispatch/runners/vale.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/yamllint.js +4 -3
- package/node_modules/pi-lens/dist/clients/dispatch/runners/zig-check.js +2 -1
- package/node_modules/pi-lens/dist/clients/effective-config.js +12 -2
- package/node_modules/pi-lens/dist/clients/extension-log.js +2 -0
- package/node_modules/pi-lens/dist/clients/file-role.js +18 -1
- package/node_modules/pi-lens/dist/clients/finding-delivery-gate.js +4 -0
- package/node_modules/pi-lens/dist/clients/formatters.js +54 -188
- package/node_modules/pi-lens/dist/clients/generation-guard.js +4 -0
- package/node_modules/pi-lens/dist/clients/gitleaks-client.js +42 -6
- package/node_modules/pi-lens/dist/clients/govulncheck-client.js +48 -7
- package/node_modules/pi-lens/dist/clients/installer/index.js +196 -52
- package/node_modules/pi-lens/dist/clients/jscpd-client.js +9 -1
- package/node_modules/pi-lens/dist/clients/knip-client.js +9 -2
- package/node_modules/pi-lens/dist/clients/language-profile.js +12 -2
- package/node_modules/pi-lens/dist/clients/latency-logger.js +2 -0
- package/node_modules/pi-lens/dist/clients/lens-config.js +4 -0
- package/node_modules/pi-lens/dist/clients/lsp/config.js +36 -7
- package/node_modules/pi-lens/dist/clients/lsp/diagnostic-binding.js +24 -1
- package/node_modules/pi-lens/dist/clients/lsp/document-drift.js +78 -0
- package/node_modules/pi-lens/dist/clients/lsp/index.js +281 -45
- package/node_modules/pi-lens/dist/clients/lsp/server.js +62 -15
- package/node_modules/pi-lens/dist/clients/lsp/workspace-diagnostics-cache.js +37 -4
- package/node_modules/pi-lens/dist/clients/mcp/analyze.js +3 -0
- package/node_modules/pi-lens/dist/clients/mcp/session.js +2 -0
- package/node_modules/pi-lens/dist/clients/opengrep-client.js +2 -0
- package/node_modules/pi-lens/dist/clients/package-manager.js +2 -1
- package/node_modules/pi-lens/dist/clients/php-cs-fixer-config.js +8 -3
- package/node_modules/pi-lens/dist/clients/pipeline.js +3 -2
- package/node_modules/pi-lens/dist/clients/project-diagnostics/fresh-fetch.js +38 -10
- package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/gitleaks.js +10 -9
- package/node_modules/pi-lens/dist/clients/project-lens-config.js +3 -0
- package/node_modules/pi-lens/dist/clients/read-guard-logger.js +2 -0
- package/node_modules/pi-lens/dist/clients/review-graph-logger.js +2 -0
- package/node_modules/pi-lens/dist/clients/ruff-client.js +18 -9
- package/node_modules/pi-lens/dist/clients/runtime-agent-end.js +9 -0
- package/node_modules/pi-lens/dist/clients/runtime-coordinator.js +5 -0
- package/node_modules/pi-lens/dist/clients/runtime-session.js +13 -4
- package/node_modules/pi-lens/dist/clients/runtime-tool-result.js +4 -1
- package/node_modules/pi-lens/dist/clients/runtime-turn.js +48 -1
- package/node_modules/pi-lens/dist/clients/security-scan-client.js +2 -2
- package/node_modules/pi-lens/dist/clients/session-event-guard.js +69 -1
- package/node_modules/pi-lens/dist/clients/sg-runner.js +2 -1
- package/node_modules/pi-lens/dist/clients/situational-tool-telemetry.js +108 -0
- package/node_modules/pi-lens/dist/clients/test-runner-client.js +291 -76
- package/node_modules/pi-lens/dist/clients/tool-config.js +199 -0
- package/node_modules/pi-lens/dist/clients/tool-cwd.js +299 -0
- package/node_modules/pi-lens/dist/clients/tool-probe.js +53 -0
- package/node_modules/pi-lens/dist/clients/tool-set-policy.js +42 -0
- package/node_modules/pi-lens/dist/clients/trivy-client.js +9 -1
- package/node_modules/pi-lens/dist/clients/turn-context.js +52 -0
- package/node_modules/pi-lens/dist/clients/widget-state.js +4 -3
- package/node_modules/pi-lens/dist/index.js +21969 -20005
- package/node_modules/pi-lens/dist/mcp/analyze-cli.js +3 -2
- package/node_modules/pi-lens/dist/mcp/server.js +135 -159
- package/node_modules/pi-lens/dist/tools/activate-tools.js +10 -7
- package/node_modules/pi-lens/dist/tools/ast-grep-outline.js +2 -13
- package/node_modules/pi-lens/dist/tools/ast-grep-replace.js +8 -13
- package/node_modules/pi-lens/dist/tools/ast-grep-search.js +83 -39
- package/node_modules/pi-lens/dist/tools/effective-config.js +4 -3
- package/node_modules/pi-lens/dist/tools/lens-diagnostic-mark.js +1 -10
- package/node_modules/pi-lens/dist/tools/lens-diagnostics.js +353 -85
- package/node_modules/pi-lens/dist/tools/lsp-diagnostics.js +21 -110
- package/node_modules/pi-lens/dist/tools/lsp-navigation.js +20 -44
- package/node_modules/pi-lens/dist/tools/module-report.js +5 -9
- package/node_modules/pi-lens/dist/tools/project-report.js +9 -17
- package/node_modules/pi-lens/dist/tools/render-compact.js +280 -1
- package/node_modules/pi-lens/dist/tools/symbol-search.js +2 -2
- package/node_modules/pi-lens/docs/agent-guide.md +3 -4
- package/node_modules/pi-lens/docs/agent-tools.md +46 -22
- package/node_modules/pi-lens/docs/configuration.md +9 -0
- package/node_modules/pi-lens/docs/environment-variables.md +0 -5
- package/node_modules/pi-lens/docs/features.md +5 -5
- package/node_modules/pi-lens/docs/globalconfig.md +11 -1
- package/node_modules/pi-lens/docs/mcp.md +13 -1
- package/node_modules/pi-lens/docs/pi-lens-fixer.md +71 -0
- package/node_modules/pi-lens/docs/pi-lens-investigator.md +15 -0
- package/node_modules/pi-lens/docs/pi-lens-monitor.md +88 -0
- package/node_modules/pi-lens/docs/pi-lens-reviewer.md +35 -0
- package/node_modules/pi-lens/docs/pi-lens-subagent.md +12 -4
- package/node_modules/pi-lens/docs/public-api-stability.md +1 -0
- package/node_modules/pi-lens/docs/real-harness.md +46 -0
- package/node_modules/pi-lens/docs/release-qa-baseline.md +5 -1
- package/node_modules/pi-lens/docs/servercapabilities.md +1 -6
- package/node_modules/pi-lens/docs/settings.md +37 -2
- package/node_modules/pi-lens/docs/tools_improvement2.md +4 -4
- package/node_modules/pi-lens/docs/tree-sitter_rules_catalog.md +1 -1
- package/node_modules/pi-lens/docs/usage.md +13 -3
- package/node_modules/pi-lens/package.json +10 -1
- package/node_modules/pi-lens/rules/tree-sitter-queries/typescript/sql-injection.yml +7 -3
- package/node_modules/pi-lens/skills/pi-lens-ast-grep/SKILL.md +8 -6
- package/node_modules/pi-lens/skills/pi-lens-lsp-navigation/SKILL.md +19 -9
- package/node_modules/pi-web-access/CHANGELOG.md +29 -0
- package/node_modules/pi-web-access/README.md +33 -22
- package/node_modules/pi-web-access/abortable.ts +17 -0
- package/node_modules/pi-web-access/crawl4ai.ts +204 -0
- package/node_modules/pi-web-access/credential-source.ts +1 -0
- package/node_modules/pi-web-access/curator-page.ts +20 -2
- package/node_modules/pi-web-access/curator-run.ts +44 -0
- package/node_modules/pi-web-access/curator-server.ts +3 -1
- package/node_modules/pi-web-access/duckduckgo.ts +1 -1
- package/node_modules/pi-web-access/extract.ts +57 -12
- package/node_modules/pi-web-access/fetch-params.ts +1 -1
- package/node_modules/pi-web-access/gemini-search.ts +9 -5
- package/node_modules/pi-web-access/index.ts +25 -18
- package/node_modules/pi-web-access/openai-search.ts +35 -13
- package/node_modules/pi-web-access/package.json +2 -2
- package/node_modules/pi-web-access/page-query.ts +5 -2
- package/node_modules/pi-web-access/query-rewrite.ts +5 -2
- package/node_modules/pi-web-access/serpapi.ts +220 -0
- package/node_modules/pi-web-access/ssrf-protection.ts +5 -1
- package/node_modules/pi-web-access/storage.ts +10 -0
- package/node_modules/pi-web-access/summary-review.ts +34 -21
- package/node_modules/pi-web-access/utils.ts +6 -4
- package/package.json +7 -4
- package/node_modules/pi-lens/dist/tools/ast-dump.js +0 -103
package/README.md
CHANGED
|
@@ -10,12 +10,13 @@ pi install npm:@herbertgao/pi-extensions
|
|
|
10
10
|
|
|
11
11
|
Requires Node.js 24 or newer and Pi 0.84.4 or newer.
|
|
12
12
|
|
|
13
|
-
The package bundles
|
|
13
|
+
The package bundles 5 active `@herbertgao/*` child packages—`pi-bark`, `pi-cc-extensions`, `resume-from`, `pi-subagents`, and `sol-pi`—plus the following upstream packages under their original names:
|
|
14
14
|
|
|
15
15
|
- `@dietrichgebert/ponytail@4.9.0`
|
|
16
16
|
- `@juicesharp/rpiv-ask-user-question@2.8.0`
|
|
17
17
|
- `@luxusai/pi-hindsight@0.12.0`
|
|
18
18
|
- `@narumitw/pi-btw@0.57.0`
|
|
19
|
+
|
|
19
20
|
- `@narumitw/pi-caffeinate@0.49.7`
|
|
20
21
|
- `@pi-plugins/fast-mode@0.1.10`
|
|
21
22
|
- `@tifan/pi-copy-response@0.2.6`
|
|
@@ -40,7 +41,7 @@ Pi loads their extensions and skills through `node_modules/` paths inside one pa
|
|
|
40
41
|
|
|
41
42
|
`@narumitw/pi-caffeinate@0.49.7` uses the host platform's sleep inhibitor during each Pi agent run. On macOS, `/caffeinate sleep` keeps the system awake while allowing the display to sleep; `/caffeinate display` also keeps the display awake. It releases the inhibitor when the run or session ends.
|
|
42
43
|
|
|
43
|
-
`@herbertgao/resume-from@0.2.0` keeps Claude Code sessions associated with their original repository when the active transcript later moves into a nested cwd. `pi-lens@4.1.3` expands language routing and bounds retained diagnostic facts across multi-root sessions. `pi-automode@1.15.0` preserves dynamic providers on legacy registries. `pi-web-access@0.27.0` adds configurable fetch deadlines and answer models plus isolated GitHub clone runtimes. Preferred Thinking 1.0.1 preserves an explicit subagent `--thinking` choice. Deprecated `@tifan/pi-titlebar-spinner` is no longer bundled; Rename remains the single owner of Herdr tab naming.
|
|
44
|
+
`@herbertgao/resume-from@0.2.0` keeps Claude Code sessions associated with their original repository when the active transcript later moves into a nested cwd. `@herbertgao/sol-pi@0.1.0` adds opt-in Action Fusion, ObservationPack, Evidence-Preserving Reducer, and Online Context Compact; see its [configuration guide](../sol-pi/docs/configuration.md). `pi-lens@4.1.3` expands language routing and bounds retained diagnostic facts across multi-root sessions. `pi-automode@1.15.0` preserves dynamic providers on legacy registries. `pi-web-access@0.27.0` adds configurable fetch deadlines and answer models plus isolated GitHub clone runtimes. Preferred Thinking 1.0.1 preserves an explicit subagent `--thinking` choice. Deprecated `@tifan/pi-titlebar-spinner` is no longer bundled; Rename remains the single owner of Herdr tab naming.
|
|
44
45
|
|
|
45
46
|
`pi-stash` is no longer bundled: `/btw` already preserves the main editor draft while handling side questions outside the main conversation. Prior `@herbertgao/pi-stash` releases remain available but are no longer maintained here.
|
|
46
47
|
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -63,3 +63,27 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
63
63
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
64
64
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
65
65
|
SOFTWARE.
|
|
66
|
+
|
|
67
|
+
## `@herbertgao/sol-pi`
|
|
68
|
+
|
|
69
|
+
The aggregate bundles [`@herbertgao/sol-pi`](https://github.com/HerbertGao/pi-extensions/tree/master/packages/sol-pi) version 0.1.0. Its source is republished from [`NVlabs/SoL-Pi`](https://github.com/NVlabs/SoL-Pi) under the MIT license:
|
|
70
|
+
|
|
71
|
+
Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
72
|
+
|
|
73
|
+
Permission is hereby granted, free of charge, to any person obtaining a
|
|
74
|
+
copy of this software and associated documentation files (the "Software"),
|
|
75
|
+
to deal in the Software without restriction, including without limitation
|
|
76
|
+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
77
|
+
and/or sell copies of the Software, and to permit persons to whom the
|
|
78
|
+
Software is furnished to do so, subject to the following conditions:
|
|
79
|
+
|
|
80
|
+
The above copyright notice and this permission notice shall be included in
|
|
81
|
+
all copies or substantial portions of the Software.
|
|
82
|
+
|
|
83
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
84
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
85
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
86
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
87
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
88
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
89
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a
|
|
4
|
+
copy of this software and associated documentation files (the "Software"),
|
|
5
|
+
to deal in the Software without restriction, including without limitation
|
|
6
|
+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
7
|
+
and/or sell copies of the Software, and to permit persons to whom the
|
|
8
|
+
Software is furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
|
11
|
+
all copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
16
|
+
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
18
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
19
|
+
DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="assets/sol-pi-hero.png" width="100%" alt="SoL-Pi: Scaling Auto-Research Loops for Efficient Agent Harnesses" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
# ⚡ SoL-Pi: Scaling Auto-Research Loops for Efficient Agent Harnesses
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="#getting-started"><img src="https://img.shields.io/badge/Getting%20Started-Install-76B900" alt="Getting Started" /></a>
|
|
9
|
+
<a href="docs/configuration.md"><img src="https://img.shields.io/badge/Docs-Configuration-555555" alt="Configuration" /></a>
|
|
10
|
+
<a href="https://nvlabs.github.io/SoL-Pi/"><img src="https://img.shields.io/badge/Blog-SoL--Pi-76B900" alt="SoL-Pi Blog" /></a>
|
|
11
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="MIT License" /></a>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
> [!NOTE]
|
|
15
|
+
> This package republishes the MIT-licensed SoL-Pi source from [NVlabs/SoL-Pi](https://github.com/NVlabs/SoL-Pi) at the reviewed commit recorded in `package.json`. It is maintained here as `@herbertgao/sol-pi`, not an official distribution of Pi or NVIDIA.
|
|
16
|
+
>
|
|
17
|
+
> The package is independently loadable and is bundled by `@herbertgao/pi-extensions`; its aggregate entry is covered by the collection smoke test.
|
|
18
|
+
|
|
19
|
+
## 💡 TL;DR
|
|
20
|
+
|
|
21
|
+
**Spend less without making the agent do less useful work.**
|
|
22
|
+
|
|
23
|
+
SoL-Pi is a standalone extension for Pi that packages four reusable efficiency mechanisms discovered through scaled auto-research loops. It reduces repeated model turns, context replay, oversized observations, and unnecessary long-log reading while preserving the work and evidence an agent needs to finish a task.
|
|
24
|
+
|
|
25
|
+
SoL-Pi installs on top of an unmodified Pi release. Every mechanism is opt-in and disabled by default.
|
|
26
|
+
|
|
27
|
+
## Introduction
|
|
28
|
+
|
|
29
|
+
Long-running coding agents accumulate repeated work. A file edit is often followed by a predictable validation command. Large tool results are replayed long after their first use. Completed subtasks remain in active context, and a frontier model may spend a full request reading a log when only a few lines affect the next decision.
|
|
30
|
+
|
|
31
|
+
SoL-Pi grew out of a broader question from our auto-research work: before scaling agent loops, can agents first make the harness itself more efficient? The search focused on constrained efficiency: reducing token traffic, inference work, and agent turns without stopping early, skipping verification, or hiding evidence.
|
|
32
|
+
|
|
33
|
+
The standalone release contains four mechanisms that survived that process. They operate at different parts of the harness and compose through Pi's public extension APIs.
|
|
34
|
+
|
|
35
|
+
## What SoL-Pi Adds
|
|
36
|
+
|
|
37
|
+
| Area | Mechanism | What changes |
|
|
38
|
+
| --- | --- | --- |
|
|
39
|
+
| Tools | **Action Fusion** | An edit or write can run its follow-up validation command in the same tool call. |
|
|
40
|
+
| Observations | **ObservationPack** | Repeated large text results become stable handles with exact paged recall. |
|
|
41
|
+
| Delegation | **Evidence-Preserving Reducer** | Long diagnostic logs become compact receipts only when every retained quotation matches the archived source. |
|
|
42
|
+
| Context | **Online Context Compact** | Completed plan steps become candidate points for Pi's native compaction, subject to economic and window-pressure checks; after a successful compaction, Pi continues the task in a new turn. |
|
|
43
|
+
|
|
44
|
+
The mechanisms share four rules:
|
|
45
|
+
|
|
46
|
+
- **No Pi patches.** SoL-Pi imports public Pi APIs and does not vendor the Pi source tree.
|
|
47
|
+
- **Explicit opt-in.** A missing configuration leaves every mechanism disabled.
|
|
48
|
+
- **Preserve evidence.** Original observations remain available locally, and reducer failures leave the original result unchanged.
|
|
49
|
+
- **Use Pi's runtime choices.** Authentication, provider URLs, the main model, and shell behavior remain under Pi's control.
|
|
50
|
+
|
|
51
|
+
## Technical Details and Core Insights
|
|
52
|
+
|
|
53
|
+
Read the [SoL-Pi blog](https://nvlabs.github.io/SoL-Pi/) for a deeper look at the technical details, design rationale, and core insights behind SoL-Pi, including how auto-research led to the four efficiency mechanisms and how they work.
|
|
54
|
+
|
|
55
|
+
## Getting Started
|
|
56
|
+
|
|
57
|
+
### Requirements
|
|
58
|
+
|
|
59
|
+
- Node.js 22.19 or newer
|
|
60
|
+
- npm
|
|
61
|
+
- `@earendil-works/pi-coding-agent` 0.84.2
|
|
62
|
+
|
|
63
|
+
### Install
|
|
64
|
+
|
|
65
|
+
Install the tested Pi release:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
npm install --global @earendil-works/pi-coding-agent@0.84.2
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Then install SoL-Pi directly from [NVlabs/SoL-Pi](https://github.com/NVlabs/SoL-Pi):
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
pi install git:github.com/NVlabs/SoL-Pi
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
To install it only for the current project, use the project-local scope:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
pi install git:github.com/NVlabs/SoL-Pi --local --approve
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Configure
|
|
84
|
+
|
|
85
|
+
SoL-Pi uses a single effective configuration. With the official Pi distribution, it looks for a `sol-pi.json` file in the following locations, in order:
|
|
86
|
+
|
|
87
|
+
1. `.pi/sol-pi.json` in the current project, if the project is trusted and the file exists;
|
|
88
|
+
2. `~/.pi/agent/sol-pi.json` otherwise.
|
|
89
|
+
|
|
90
|
+
If neither file exists, SoL-Pi uses its built-in defaults. The project-level configuration takes precedence over the user-level configuration; the two files are not merged.
|
|
91
|
+
|
|
92
|
+
The following conservative configuration enables only the two local mechanisms that make no additional model calls and do not stop an active run:
|
|
93
|
+
|
|
94
|
+
```json
|
|
95
|
+
{
|
|
96
|
+
"version": 1,
|
|
97
|
+
"actionFusion": true,
|
|
98
|
+
"observationPack": true,
|
|
99
|
+
"evidencePreservingReducer": false,
|
|
100
|
+
"onlineContextCompact": false,
|
|
101
|
+
"cacheWriteReadRatio": 12.5
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Enable additional mechanisms only after reviewing their configuration and security implications. SoL-Pi uses no dedicated environment variables; feature flags, the reducer provider/model route, and the compaction ratio are configured in `sol-pi.json`.
|
|
106
|
+
|
|
107
|
+
For the complete schema, see [Configuration](docs/configuration.md). Coding agents and automated environments should follow the canonical [agent installation and configuration protocol](agents-install.md). Its all-enabled profile is checked with `scripts/check-sol-pi-config.mjs --require-all-enabled`.
|
|
108
|
+
|
|
109
|
+
## Storage and Security
|
|
110
|
+
|
|
111
|
+
ObservationPack and Evidence-Preserving Reducer store session-specific archives under:
|
|
112
|
+
|
|
113
|
+
```text
|
|
114
|
+
<session-directory>/sol-pi/<session-id>/
|
|
115
|
+
├── observation-pack/
|
|
116
|
+
└── evidence-preserving-reducer/
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
They archive eligible source material in this directory. The archived copies remain local and are not automatically deleted when the Pi session ends.
|
|
120
|
+
|
|
121
|
+
Online Context Compact stores its state in Pi's session log. After a successful compaction, it starts a new turn and automatically continues the active task. Cancelling the run or exiting Pi does not trigger automatic continuation.
|
|
122
|
+
|
|
123
|
+
Evidence-Preserving Reducer may send eligible diagnostic-log content to its configured reducer model using Pi-managed authentication. Review [SECURITY.md](SECURITY.md) before enabling it. Do not enable remote reduction for logs that must remain local.
|
|
124
|
+
|
|
125
|
+
## Documentation
|
|
126
|
+
|
|
127
|
+
| Document | Purpose |
|
|
128
|
+
| --- | --- |
|
|
129
|
+
| [Configuration](docs/configuration.md) | Config search order, schema, defaults, and trust behavior |
|
|
130
|
+
| [Compatibility](docs/compatibility.md) | Supported Pi APIs and standalone integration details |
|
|
131
|
+
| [Security](SECURITY.md) | Local storage, remote reduction, and sensitive behavior |
|
|
132
|
+
| [Agent installation](agents-install.md) | Reproducible installation and all-enabled validation procedure |
|
|
133
|
+
|
|
134
|
+
## Development
|
|
135
|
+
|
|
136
|
+
Install from the lockfile and run the complete source checks:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
npm ci --ignore-scripts
|
|
140
|
+
npm run check
|
|
141
|
+
npm audit --audit-level=high
|
|
142
|
+
node scripts/check-pi-compat.mjs
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
`npm run check` covers TypeScript, the complete test suite, and package inspection. The development dependency set is pinned to Pi 0.84.2; runtime Pi packages remain peer dependencies so Pi owns their installation and upgrades.
|
|
146
|
+
|
|
147
|
+
## Project Status
|
|
148
|
+
|
|
149
|
+
SoL-Pi is developed and maintained by NVIDIA as a standalone extension for Pi.
|
|
150
|
+
|
|
151
|
+
External code contributions are not accepted at this time. Bug reports and private security reports remain welcome through the channels described in [CONTRIBUTING.md](CONTRIBUTING.md) and [SECURITY.md](SECURITY.md).
|
|
152
|
+
|
|
153
|
+
## Acknowledgements
|
|
154
|
+
|
|
155
|
+
SoL-Pi builds on the public extension interfaces provided by [Pi](https://github.com/earendil-works/pi). Pi remains an independent upstream project and is not vendored into this repository.
|
|
156
|
+
|
|
157
|
+
## License
|
|
158
|
+
|
|
159
|
+
SoL-Pi is released under the [MIT License](LICENSE).
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
SoL-Pi is a Pi extension. It runs with the filesystem, process, network, and credential permissions of the Pi process that loads it. SoL-Pi is not a sandbox or permission boundary.
|
|
4
|
+
|
|
5
|
+
## Sensitive behavior
|
|
6
|
+
|
|
7
|
+
- Action Fusion can modify files and run shell commands requested by the model.
|
|
8
|
+
- ObservationPack stores large tool results under Pi's session directory.
|
|
9
|
+
- Evidence-Preserving Reducer archives diagnostic logs locally and, when explicitly enabled, sends eligible logs through the configured reducer model using Pi-managed authentication.
|
|
10
|
+
- The reducer skips text matching its likely-secret detector, but that detector is a precaution rather than a complete secret scanner. Do not enable remote reduction for workloads whose logs must remain local.
|
|
11
|
+
- Online Context Compact stores plan and compaction state in Pi's session log; see below.
|
|
12
|
+
- Project-local `.pi/sol-pi.json` files should be used only in trusted repositories.
|
|
13
|
+
|
|
14
|
+
## Online Context Compact data
|
|
15
|
+
|
|
16
|
+
Online Context Compact is off by default. When enabled, every `update_plan` call appends a versioned custom state entry to Pi's session log. The latest valid entry holds the model-authored plan, concise progress fields, request counts, token-growth estimates, and compaction debt. These values can include paths, command names, and design notes and should be treated as sensitive as the rest of the conversation. After a successful compaction, the extension also writes one hidden, generic custom message that tells the assistant to rebuild its plan; the reminder contains no task-specific data.
|
|
17
|
+
|
|
18
|
+
The extension creates no sidecar, attestation, payload-capture, or research-instrumentation files. State entries do not enter the model context; only the generic post-compaction reminder does. Deleting the Pi session removes both kinds of persisted Online Context Compact data.
|
|
19
|
+
|
|
20
|
+
Evidence-Preserving Reducer may temporarily read an overlong bash result from outside its session archive. It accepts only a regular, non-symlink `pi-bash-*.log` file directly inside the operating system's temporary directory and copies eligible content into the session-specific archive before any nested model call.
|
|
21
|
+
|
|
22
|
+
## Reporting a vulnerability
|
|
23
|
+
|
|
24
|
+
Use the repository's GitHub Security Advisories page to submit a private report. Do not open a public issue for a suspected vulnerability.
|
|
25
|
+
|
|
26
|
+
Include the affected commit or version, configuration, impact, reproduction steps, and any available mitigation. Reports about Pi itself should be sent to the upstream Pi project.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Third-Party Notices
|
|
2
|
+
|
|
3
|
+
SoL-Pi does not vendor third-party source code. Its npm tarball contains only SoL-Pi source, documentation, tests-excluded assets, and project metadata.
|
|
4
|
+
|
|
5
|
+
## Runtime peer dependencies
|
|
6
|
+
|
|
7
|
+
The following packages are supplied by the user's Pi installation and retain their own licenses:
|
|
8
|
+
|
|
9
|
+
| Package | Development-tested version | License | Source |
|
|
10
|
+
| --- | ---: | --- | --- |
|
|
11
|
+
| `@earendil-works/pi-agent-core` | 0.84.2 | MIT | <https://github.com/earendil-works/pi> |
|
|
12
|
+
| `@earendil-works/pi-ai` | 0.84.2 | MIT | <https://github.com/earendil-works/pi> |
|
|
13
|
+
| `@earendil-works/pi-coding-agent` | 0.84.2 | MIT | <https://github.com/earendil-works/pi> |
|
|
14
|
+
| `@earendil-works/pi-tui` | 0.84.2 | MIT | <https://github.com/earendil-works/pi> |
|
|
15
|
+
| `typebox` | 1.3.7 | MIT | <https://github.com/sinclairzx81/typebox> |
|
|
16
|
+
|
|
17
|
+
## Development-only dependencies
|
|
18
|
+
|
|
19
|
+
`@types/node` (MIT), TypeScript (Apache-2.0), and Vitest (MIT) are used to type-check and test the repository. They are not included in the SoL-Pi npm tarball. Exact versions and transitive dependency metadata are recorded in `package-lock.json`.
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# SoL-Pi Agent Installation and Configuration Protocol
|
|
2
|
+
|
|
3
|
+
This is the canonical procedure for Codex, Claude Code, and other coding agents that install, configure, or validate SoL-Pi from a full source checkout. Follow the phases in order. Explicit user instructions take precedence. An extracted npm package is not a substitute for the checkout because it does not contain the test suite.
|
|
4
|
+
|
|
5
|
+
Installation and configuration are complete only when Pi remains unmodified, the repository checks pass, Pi lists the package, all four mechanisms are enabled in one effective `sol-pi.json`, and Pi starts without an extension error.
|
|
6
|
+
|
|
7
|
+
## Rules
|
|
8
|
+
|
|
9
|
+
- Do not modify, patch, fork, or vendor upstream Pi. SoL-Pi must load as a standalone extension through Pi's public package interface.
|
|
10
|
+
- Use Node.js 22.19 or newer and the tested Pi release `@earendil-works/pi-coding-agent@0.84.2`. Treat a different Pi version as a compatibility change and rerun the full suite before using it.
|
|
11
|
+
- Do not clean, reset, switch, or overwrite unrelated repository changes.
|
|
12
|
+
- Do not print, log, commit, upload, or include any secret in a command line. Check only whether a credential is present.
|
|
13
|
+
- Keep SoL-Pi settings in `sol-pi.json`. The Evidence-Preserving Reducer provider/model route is a SoL-Pi setting; provider URLs, credentials, the main agent model, and shell behavior remain Pi settings.
|
|
14
|
+
- Keep persistent artifacts under Pi's session-derived `sol-pi/<session-id>/` root; do not configure a separate storage path.
|
|
15
|
+
|
|
16
|
+
## Inputs
|
|
17
|
+
|
|
18
|
+
Resolve these values before making changes:
|
|
19
|
+
|
|
20
|
+
- `sol_pi_root`: absolute path to the intended SoL-Pi checkout;
|
|
21
|
+
- `target_project`: project in which Pi will run;
|
|
22
|
+
- install scope: project-local or user-wide;
|
|
23
|
+
- exact SoL-Pi branch and commit.
|
|
24
|
+
|
|
25
|
+
Do not guess an ambiguous path or install scope.
|
|
26
|
+
|
|
27
|
+
## Phase 1: validate the checkout
|
|
28
|
+
|
|
29
|
+
From `sol_pi_root`, record the repository state without changing it:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
git status --short --branch
|
|
33
|
+
git rev-parse HEAD
|
|
34
|
+
node --version
|
|
35
|
+
npm --version
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Require Node.js 22.19 or newer. Install from the lockfile and run the source checks:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npm ci --ignore-scripts
|
|
42
|
+
npm run check
|
|
43
|
+
npm audit --audit-level=high
|
|
44
|
+
node scripts/check-pi-compat.mjs
|
|
45
|
+
npx vitest run tests/all-mechanisms.test.ts
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
`npm run check` covers type checking, the complete test suite, and package inspection. `tests/all-mechanisms.test.ts` confirms that one all-enabled configuration registers all four mechanisms against Pi's public extension API. The tests run without a model provider.
|
|
49
|
+
|
|
50
|
+
Stop if any command fails. Do not hide a failure with `|| true` or replace `npm ci` with an unlocked install.
|
|
51
|
+
|
|
52
|
+
## Phase 2: install Pi and SoL-Pi
|
|
53
|
+
|
|
54
|
+
Install the tested Pi release without changing its source:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
npm install --global --ignore-scripts @earendil-works/pi-coding-agent@0.84.2
|
|
58
|
+
pi --version
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Require `pi --version` to report `0.84.2`.
|
|
62
|
+
|
|
63
|
+
For a project-local registration, run this from `target_project` and substitute the resolved absolute `sol_pi_root`:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
pi install "/absolute/path/to/SoL-Pi" --local --approve
|
|
67
|
+
pi list --approve
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
For a user-wide registration, omit `--local`:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
pi install "/absolute/path/to/SoL-Pi" --approve
|
|
74
|
+
pi list --approve
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
The `pi list` output must show the exact SoL-Pi source in the selected scope. Do not install the same checkout in both scopes. A project-local registration must run only in a trusted project; use `--approve` for automated invocations unless trust has already been explicitly persisted.
|
|
78
|
+
|
|
79
|
+
## Phase 3: configure all four mechanisms
|
|
80
|
+
|
|
81
|
+
SoL-Pi defaults every mechanism to disabled. For this managed installation, create exactly one effective configuration with every mechanism enabled:
|
|
82
|
+
|
|
83
|
+
```json
|
|
84
|
+
{
|
|
85
|
+
"version": 1,
|
|
86
|
+
"actionFusion": true,
|
|
87
|
+
"observationPack": true,
|
|
88
|
+
"evidencePreservingReducer": true,
|
|
89
|
+
"evidencePreservingReducerProvider": "provider-id",
|
|
90
|
+
"evidencePreservingReducerModel": "model-id",
|
|
91
|
+
"onlineContextCompact": true,
|
|
92
|
+
"cacheWriteReadRatio": 12.5
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
`evidencePreservingReducerProvider` and `evidencePreservingReducerModel` select the nested reducer route that Evidence-Preserving Reducer resolves through Pi's model registry. They default to the built-in reducer route and must be non-empty strings when supplied. Change them only when a different reducer model is intended.
|
|
97
|
+
|
|
98
|
+
`cacheWriteReadRatio` is the only pricing-related input SoL-Pi reads. It defaults to `12.5`, accepts any finite non-negative number, and treats `0` as an explicit statement that a cache write adds no cost relative to a cache read. SoL-Pi does not inspect Pi model prices. The value controls one compaction decision and is not a bill estimate. The default follows the GPT-5.6 Sol OpenAI Standard cache-write/read ratio checked on 2026-08-21; see [OpenAI API pricing](https://developers.openai.com/api/docs/pricing). Change it when a different policy is required.
|
|
99
|
+
|
|
100
|
+
Use one location matching the selected scope. Resolve the directory through Pi; the official Pi defaults are shown in parentheses:
|
|
101
|
+
|
|
102
|
+
- project-local: `<target_project>/<Pi config directory>/sol-pi.json` (`<target_project>/.pi/sol-pi.json`);
|
|
103
|
+
- user-wide: `<Pi agent directory>/sol-pi.json` (`~/.pi/agent/sol-pi.json`).
|
|
104
|
+
|
|
105
|
+
SoL-Pi uses Pi's public `CONFIG_DIR_NAME` and `getAgentDir()` APIs. Do not assume the defaults when Pi reports different directories.
|
|
106
|
+
|
|
107
|
+
The project file replaces the user-wide file; the two are not merged. If both exist, inspect them and obtain direction before changing either one. Unknown keys, unsupported versions, malformed JSON, non-boolean feature values, invalid reducer model fields, and invalid ratios must remain fatal.
|
|
108
|
+
|
|
109
|
+
Do not put provider URL, credentials, shell path, command prefix, storage path, or run ID in `sol-pi.json`. SoL-Pi either reads those values from Pi or derives them from the Pi session.
|
|
110
|
+
|
|
111
|
+
SoL-Pi reads no dedicated environment variables. Evidence-Preserving Reducer uses the configured reducer provider/model route and Pi-managed authentication. Configure credentials in Pi and do not copy them into `sol-pi.json`.
|
|
112
|
+
|
|
113
|
+
From `sol_pi_root`, validate the exact effective file:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
node scripts/check-sol-pi-config.mjs \
|
|
117
|
+
--config /absolute/path/to/effective/sol-pi.json \
|
|
118
|
+
--require-all-enabled
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Require exit status 0 and retain its JSON output. The check applies SoL-Pi's default values, rejects unknown keys and wrong types, and confirms all four mechanisms are enabled. A partially enabled file can be valid SoL-Pi configuration, but it does not satisfy this all-enabled profile.
|
|
122
|
+
|
|
123
|
+
## Phase 4: verify the installation
|
|
124
|
+
|
|
125
|
+
1. Run `pi list --approve` from `target_project` and confirm the expected SoL-Pi source and scope.
|
|
126
|
+
2. Run `check-sol-pi-config.mjs --require-all-enabled` against the effective `sol-pi.json`.
|
|
127
|
+
3. Re-run `npx vitest run tests/all-mechanisms.test.ts` from `sol_pi_root`.
|
|
128
|
+
4. Start Pi with `--offline --approve`, send no prompt, confirm there is no extension load error, and exit.
|
|
129
|
+
5. Confirm that upstream Pi was not patched and that the SoL-Pi checkout contains no vendored Pi monorepo source.
|
|
130
|
+
|
|
131
|
+
## Completion report
|
|
132
|
+
|
|
133
|
+
Report:
|
|
134
|
+
|
|
135
|
+
- SoL-Pi absolute path, branch, and commit;
|
|
136
|
+
- repository state before and after installation;
|
|
137
|
+
- Node, npm, and Pi versions;
|
|
138
|
+
- install scope and the exact entry shown by `pi list`;
|
|
139
|
+
- effective config path, four enabled flags, EPR reducer provider/model, and `cacheWriteReadRatio`, without secrets;
|
|
140
|
+
- every validation command and result;
|
|
141
|
+
- any blocker or deviation.
|
|
142
|
+
|
|
143
|
+
Do not describe the installation as successful if a required check is missing.
|
|
144
|
+
|
|
145
|
+
## Agent entry files
|
|
146
|
+
|
|
147
|
+
`agents-install.md` is the single source of truth, but agents do not universally auto-discover arbitrary filenames. Root `AGENTS.md` tells Codex to read this file, while root `CLAUDE.md` imports it for Claude Code. Keep those entry files short and keep executable installation details here.
|
|
148
|
+
|
|
149
|
+
- [Codex `AGENTS.md` discovery](https://developers.openai.com/codex/guides/agents-md)
|
|
150
|
+
- [Claude Code project memory and imports](https://docs.anthropic.com/zh-CN/docs/claude-code/memory)
|
|
Binary file
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Pi Compatibility
|
|
2
|
+
|
|
3
|
+
SoL-Pi is developed and tested against `@earendil-works/pi-coding-agent` 0.84.2. Its public API surface is also type-checked and exercised against Pi 0.81.1, the base used by the original Pi fork. The runtime range is deliberately expressed as a peer dependency because Pi owns installation and upgrade of its packages.
|
|
4
|
+
|
|
5
|
+
SoL-Pi imports only public package exports:
|
|
6
|
+
|
|
7
|
+
- `createEditToolDefinition`
|
|
8
|
+
- `createWriteToolDefinition`
|
|
9
|
+
- `createBashToolDefinition`
|
|
10
|
+
- extension types and `ExtensionAPI.registerTool`
|
|
11
|
+
- `context`, `before_provider_request`, `tool_result`, `turn_end`, `agent_settled`, and `session_before_tree` extension events
|
|
12
|
+
- native compaction events, `ExtensionContext.getContextUsage()`, and `ExtensionContext.compact()`
|
|
13
|
+
- `ExtensionContext.model` and `ExtensionContext.modelRegistry`
|
|
14
|
+
- the public session-manager methods exposed through `ExtensionContext`
|
|
15
|
+
|
|
16
|
+
## Action Fusion
|
|
17
|
+
|
|
18
|
+
The built-in edit/write definitions capture their working directory, so SoL-Pi caches one definition per `ctx.cwd`. Its own per-file queue surrounds the built-in mutation and follow-up command. It does not nest Pi's built-in mutation queue.
|
|
19
|
+
|
|
20
|
+
Action Fusion decodes `file://` targets with Node's `fileURLToPath()` before resolving the queue and hash-check path. This keeps file URLs, including percent-encoded filenames and Pi's optional `@` prefix, aligned with the file handled by the built-in mutation tool.
|
|
21
|
+
|
|
22
|
+
The queue covers only fused operations registered by this SoL-Pi instance. External processes, direct built-in-tool calls outside the replacement, and unrelated extensions are not globally locked. SoL-Pi hashes the target immediately before launching `then_run` and skips the command if it observes an intervening content change.
|
|
23
|
+
|
|
24
|
+
When another extension already owns `write`, Action Fusion leaves that tool in place and only registers its `edit` replacement. When `pi-automode` exposes `automode_inspect`, Action Fusion registers neither mutation replacement: nested `then_run` cannot re-enter Pi's public `tool_call` permission pipeline, so disabling the fusion is the safe fallback.
|
|
25
|
+
|
|
26
|
+
## ObservationPack
|
|
27
|
+
|
|
28
|
+
ObservationPack changes only the messages projected through the public `context` event. Stored session history remains intact. Original bytes and the JSONL ledger live under the session-derived SoL-Pi directory.
|
|
29
|
+
|
|
30
|
+
## Evidence-Preserving Reducer
|
|
31
|
+
|
|
32
|
+
The reducer handles public `tool_result` events and resolves the configured reducer provider/model through Pi's model registry before calling `ExtensionContext.modelRegistry.complete()` when available. For the Pi 0.81.1 fork, which exposes no registry `complete()` method, it resolves authentication for that reducer model through `getApiKeyAndHeaders()` and calls the shared `@earendil-works/pi-ai/compat` completion API. The reducer preserves the original result whenever the configured reducer model is unavailable or eligibility, model-call, schema, source-hash, exact-quote, size, or likely-secret checks fail.
|
|
33
|
+
|
|
34
|
+
All persistent paths use `SessionManager.getSessionDir()` and `getSessionId()`, which are present in both the fork and Pi 0.84.2. SoL-Pi creates no configurable storage-path surface.
|
|
35
|
+
|
|
36
|
+
The unpublished shared artifact layout is not read or migrated. Each session starts from its own `<sessionDir>/sol-pi/<sessionId>/` directory.
|
|
37
|
+
|
|
38
|
+
## Online Context Compact
|
|
39
|
+
|
|
40
|
+
Online Context Compact uses ordinary public `context` and `before_provider_request` handlers instead of fork-only post-transform observer methods. Public handlers run in extension load order, so the SoL-Pi entrypoint registers Online Context Compact after its other context transformers. A third-party transformer loaded later is outside the context-growth observation used by its estimate.
|
|
41
|
+
|
|
42
|
+
Before selecting or executing a boundary compaction, it also checks the optional `Symbol.for("pi-subagents:manager")` registry exposed by `pi-subagents`. A running top-level subagent, or an unreadable registry, suppresses that compaction rather than risking a context rewrite during delegated work. When the registry is absent, the check is a no-op.
|
|
43
|
+
|
|
44
|
+
Pi does not expose its active retained-tail compaction setting through the public extension context. The standalone extension therefore uses the documented Pi 0.84.2 default of 20,000 tokens for its economic estimate. Its programmatic factory accepts an explicit matching value for a non-default Pi setting.
|
|
45
|
+
|
|
46
|
+
Pi 0.84.2's `ExtensionContext.compact()` aborts the active agent before it summarizes, and `agent_settled` fires only once a whole run has drained every turn, retry, auto-compaction, and queued continuation. A plan boundary that selects compaction therefore saves its plan and progress state, calls `ExtensionContext.abort()` to stop the run, and runs compaction from the `agent_settled` that stop produces. The handler awaits the compaction's own `onComplete`/`onError` callbacks. On success, the extension sends a hidden reminder through public `ExtensionAPI.sendMessage()` with `triggerTurn: true`, so Pi starts a new turn against the compacted context and rebuilds the plan even when the native summary omits that instruction.
|
|
47
|
+
|
|
48
|
+
A settlement barrier keeps the original `agent_settled` dispatch open until the triggered continuation settles. Print- and JSON-mode processes therefore complete the compact-and-continue sequence within the same Pi invocation; an outer driver does not need to resume the session or send `Continue working`. This continuation is armed only by a successful boundary compaction. Cancelling or exiting does not schedule one. A Pi build that never emits `agent_settled` starts no boundary compaction.
|
|
49
|
+
|
|
50
|
+
Pi 0.84.2 does not return a promise from `ExtensionAPI.sendMessage()`. The barrier is therefore verified for standalone SoL-Pi and depends on Pi starting the requested turn synchronously. A later-loaded third-party extension that performs long asynchronous work in its own `agent_settled` handler is outside this guarantee and needs an integration test with that extension set.
|
|
51
|
+
|
|
52
|
+
Pi reports the session as idle while an extension-requested manual compaction is running. SoL-Pi cancels `session_before_tree` during that interval to prevent tree navigation from moving the active leaf underneath the compaction. Navigation works normally after the compaction callback settles.
|
|
53
|
+
|
|
54
|
+
Online Context Compact reads `ExtensionContext.getContextUsage()` for both the context window and the provider-counted context size. When Pi reports no size — as it does between a compaction and the next answered request — the boundary falls back to its own estimate.
|
|
55
|
+
|
|
56
|
+
The standalone entry passes `cacheWriteReadRatio` from `sol-pi.json` directly into Online Context Compact's economic check. It does not inspect model price metadata. Changing models during a session does not change the ratio; users who want a different decision policy update the configuration and start a new session.
|
|
57
|
+
|
|
58
|
+
## Interactive TUI
|
|
59
|
+
|
|
60
|
+
The lightning savings treatment uses Pi 0.84.2's public `renderCall`,
|
|
61
|
+
`renderResult`, `ctx.ui.notify()`, and keyed `ctx.ui.setStatus()` APIs. It checks
|
|
62
|
+
`ctx.mode === "tui"` rather than `ctx.hasUI`, because RPC mode also reports UI
|
|
63
|
+
support. The renderer therefore changes only the interactive terminal display;
|
|
64
|
+
it does not change session messages, provider requests, tool results, JSON
|
|
65
|
+
events, print output, or RPC UI requests.
|
|
66
|
+
|
|
67
|
+
## Test doubles
|
|
68
|
+
|
|
69
|
+
The test suite drives every extension through the same public `ExtensionAPI` and `ExtensionContext` surface Pi provides, over a real public `SessionManager`, with no provider registered. That keeps the suite zero-spend and independent of the deleted Pi monorepo test harness. Suites that need a genuine session tree — branch order, compaction entries, custom entries, resume — use `SessionManager.inMemory()` or `SessionManager.create()` rather than reimplementing them.
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Configuration
|
|
2
|
+
|
|
3
|
+
SoL-Pi reads one effective JSON configuration file at extension startup. It uses Pi's public `CONFIG_DIR_NAME` and `getAgentDir()` APIs rather than assuming fixed directories.
|
|
4
|
+
|
|
5
|
+
## Search order
|
|
6
|
+
|
|
7
|
+
1. `<working-directory>/<Pi config directory>/sol-pi.json`, only after Pi marks the project trusted
|
|
8
|
+
2. `<Pi agent directory>/sol-pi.json`
|
|
9
|
+
3. Built-in defaults when neither file exists
|
|
10
|
+
|
|
11
|
+
For the official Pi distribution, the first two locations normally resolve to `.pi/sol-pi.json` and `~/.pi/agent/sol-pi.json`.
|
|
12
|
+
|
|
13
|
+
The project file replaces the global file. SoL-Pi does not merge them.
|
|
14
|
+
|
|
15
|
+
## Schema
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"version": 1,
|
|
20
|
+
"actionFusion": false,
|
|
21
|
+
"observationPack": false,
|
|
22
|
+
"evidencePreservingReducer": false,
|
|
23
|
+
"evidencePreservingReducerProvider": "provider-id",
|
|
24
|
+
"evidencePreservingReducerModel": "model-id",
|
|
25
|
+
"onlineContextCompact": false,
|
|
26
|
+
"cacheWriteReadRatio": 12.5
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Feature keys may be omitted and then default to `false`. `cacheWriteReadRatio` may be omitted and then defaults to `12.5`; when present it must be a finite non-negative number, and `0` explicitly means that a cache write adds no cost relative to a cache read. `evidencePreservingReducerProvider` and `evidencePreservingReducerModel` may be omitted and then use the built-in reducer route; when present each must be a non-empty string. Unknown keys, unsupported versions, malformed JSON, non-boolean feature values, invalid ratios, and invalid reducer model fields stop extension loading with a direct error.
|
|
31
|
+
|
|
32
|
+
For the managed all-enabled installation described in the [agent installation and configuration protocol](../agents-install.md), validate the effective file before starting Pi:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
node scripts/check-sol-pi-config.mjs \
|
|
36
|
+
--config /absolute/path/to/effective/sol-pi.json \
|
|
37
|
+
--require-all-enabled
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
This preflight does not make every valid SoL-Pi configuration all-enabled. Without `--require-all-enabled`, omitted feature keys retain their normal `false` defaults. The managed workflow uses the flag because its acceptance criterion is that all four mechanisms are active.
|
|
41
|
+
|
|
42
|
+
## Feature behavior
|
|
43
|
+
|
|
44
|
+
- `actionFusion`: registers SoL-Pi replacements for Pi's `edit` and `write` tools.
|
|
45
|
+
- `observationPack`: registers `obs_recall` and a provider-context projection handler.
|
|
46
|
+
- `evidencePreservingReducer`: registers a `tool_result` handler and delegates long diagnostic-log reduction to the configured reducer provider/model.
|
|
47
|
+
- `evidencePreservingReducerProvider`: provider namespace used to resolve the reducer model through Pi's model registry.
|
|
48
|
+
- `evidencePreservingReducerModel`: model id used for Evidence-Preserving Reducer.
|
|
49
|
+
- `onlineContextCompact`: registers `update_plan` and boundary-driven native compaction after the other SoL-Pi context transformers.
|
|
50
|
+
- `cacheWriteReadRatio`: supplies the single economic decision ratio used by Online Context Compact.
|
|
51
|
+
|
|
52
|
+
## Evidence-Preserving Reducer runtime inputs
|
|
53
|
+
|
|
54
|
+
The release entry supplies the run label and session-derived storage. It uses one configurable model route:
|
|
55
|
+
|
|
56
|
+
- **Reducer provider/model** — from `evidencePreservingReducerProvider` and `evidencePreservingReducerModel` in the effective `sol-pi.json`. If omitted, SoL-Pi uses its built-in reducer route. SoL-Pi resolves that model through Pi's model registry and still relies on Pi-managed authentication; do not put credentials in `sol-pi.json`.
|
|
57
|
+
|
|
58
|
+
## Online Context Compact runtime inputs
|
|
59
|
+
|
|
60
|
+
The release entry uses two runtime inputs:
|
|
61
|
+
|
|
62
|
+
- **Context window** — from `ExtensionContext.getContextUsage()`, used for window-pressure protection.
|
|
63
|
+
- **Cache write/read ratio** — from `cacheWriteReadRatio` in the effective `sol-pi.json`. The value remains fixed for the session and is not recomputed when the model changes. It drives one runtime decision and is not a cost report.
|
|
64
|
+
|
|
65
|
+
The configured ratio stays fixed for the loaded extension. The mechanism stores its current plan, progress summaries, request horizon, context growth, and compaction debt as versioned custom entries in Pi's session log. After a successful compaction it sends one hidden, generic message with `triggerTurn: true`, which starts a new turn and instructs the assistant to rebuild its plan. A settlement barrier keeps print and JSON modes in the same Pi invocation until that continuation settles, so callers do not need to resume the session or inject `Continue working`. Cancelling or exiting does not schedule an automatic continuation. The mechanism creates no separate Online Context Compact files. The programmatic factory exposes only a matching retained-tail value for installations whose Pi compaction setting differs from the default.
|
|
66
|
+
|
|
67
|
+
## Pi integration
|
|
68
|
+
|
|
69
|
+
SoL-Pi reads no dedicated environment variables. Evidence-Preserving Reducer resolves its configured reducer provider/model through `ExtensionContext.modelRegistry` and uses Pi-managed authentication. If the configured reducer model is unavailable or the nested model call fails, the original tool result continues unchanged.
|
|
70
|
+
|
|
71
|
+
SoL-Pi does not configure shell paths, command prefixes, storage paths, run IDs, provider URLs, reasoning levels, timeouts, or per-mechanism enable flags through environment variables. Apart from the EPR reducer provider/model route in `sol-pi.json`, model selection remains with Pi. Action Fusion uses Pi's default shell behavior. Persistent artifacts are derived from Pi's session directory and session ID.
|
|
72
|
+
|
|
73
|
+
## Trust
|
|
74
|
+
|
|
75
|
+
A project-local config can enable file mutation, shell execution, local archival, and remote diagnostic-log reduction. SoL-Pi waits for Pi's `session_start` context and ignores the project file unless `ctx.isProjectTrusted()` is true. Prefer the global file when you want one personal configuration across trusted projects.
|