@alexeiled/pi-fusion 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,75 +1,121 @@
1
1
  # pi-fusion
2
2
 
3
- [![npm](https://img.shields.io/badge/npm-%40alexeiled%2Fpi--fusion-cb3837?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@alexeiled/pi-fusion)
3
+ [![npm version](https://img.shields.io/npm/v/%40alexeiled%2Fpi-fusion?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@alexeiled/pi-fusion)
4
+ [![CI](https://img.shields.io/github/actions/workflow/status/alexei-led/pi-fusion/test.yml?branch=master&style=flat-square&label=ci)](https://github.com/alexei-led/pi-fusion/actions/workflows/test.yml?query=branch%3Amaster)
4
5
  [![node](https://img.shields.io/badge/node-%3E%3D22.19.0-5fa04e?style=flat-square&logo=node.js&logoColor=white)](https://nodejs.org/)
5
6
  [![license](https://img.shields.io/badge/license-MIT-blue?style=flat-square)](./LICENSE)
6
7
 
7
- > Parallel panel. One judge. One report.
8
+ > Parallel models. One judge. Better answers.
8
9
 
9
- `pi-fusion` is a Pi extension for questions that need deliberation, not a guess.
10
- It runs a small panel of read-only subagents in parallel, then asks a judge agent
11
- to synthesize one final Markdown report.
10
+ `pi-fusion` is a Pi extension for hard technical questions.
11
+ It uses `pi-subagents` to send the same prompt through a small parallel model panel,
12
+ then asks a judge agent to compare the outputs and return the best realistic answer.
12
13
 
13
- ## Fusion model
14
+ CI covers lint, typecheck, unit tests, integration tests, package smoke tests,
15
+ and `npm pack --dry-run`.
14
16
 
15
- My approach is simple:
17
+ ![pi-fusion flow](https://raw.githubusercontent.com/alexei-led/pi-fusion/master/docs/assets/fusion-flow.png)
16
18
 
17
- - one hard question becomes a short review panel
18
- - panelists work independently in parallel
19
- - the judge reconciles evidence, not votes
20
- - if the judge result is missing but the panel still produced enough signal,
21
- Fusion retries only the judge step
19
+ ## Why Fusion exists
22
20
 
23
- This is evidence-first, not majority vote.
24
- The judge is a synthesizer, not a tie-breaker by headcount.
21
+ Hard questions are often bottlenecked by one model's search path.
22
+ `pi-fusion` trades latency for diversity:
23
+
24
+ - the same prompt fans out to several model runs in parallel
25
+ - each model explores the problem from a different training prior and reasoning path
26
+ - overlap raises confidence
27
+ - disagreement exposes risk
28
+ - the judge keeps the strongest parts and drops weak, partial, or conflicting ones
29
+
30
+ This is evidence selection, not majority vote.
25
31
 
26
32
  ```mermaid
33
+ %%{init: {"theme": "base", "flowchart": {"curve": "basis", "nodeSpacing": 28, "rankSpacing": 48}, "themeVariables": {"background": "#050816", "fontFamily": "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace", "primaryTextColor": "#E5F0FF", "lineColor": "#38bdf8", "tertiaryColor": "#0b1220"}}}%%
27
34
  flowchart LR
28
- classDef input fill:#f8fafc,stroke:#94a3b8,color:#0f172a,stroke-width:1px;
29
- classDef panel fill:#e0f2fe,stroke:#38bdf8,color:#0f172a,stroke-width:1px;
30
- classDef judge fill:#fef3c7,stroke:#f59e0b,color:#0f172a,stroke-width:1px;
31
- classDef report fill:#dcfce7,stroke:#22c55e,color:#0f172a,stroke-width:1px;
32
- classDef fallback fill:#fae8ff,stroke:#c084fc,color:#0f172a,stroke-width:1px,stroke-dasharray:4 3;
33
-
34
- U[You in Pi]:::input --> Q[/fusion prompt/]:::input
35
-
36
- subgraph P[Parallel panel]
37
- direction LR
38
- A[Architect]:::panel
39
- I[Implementer]:::panel
40
- T[Tester]:::panel
35
+ classDef prompt fill:#071321,stroke:#38bdf8,color:#dbeafe,stroke-width:2px;
36
+ classDef modelA fill:#081223,stroke:#38bdf8,color:#dbeafe,stroke-width:2px;
37
+ classDef modelB fill:#120826,stroke:#a855f7,color:#f3e8ff,stroke-width:2px;
38
+ classDef modelC fill:#08180f,stroke:#22c55e,color:#dcfce7,stroke-width:2px;
39
+ classDef modelD fill:#241307,stroke:#f59e0b,color:#fef3c7,stroke-width:2px;
40
+ classDef modelE fill:#260712,stroke:#ff4d8d,color:#ffd1e7,stroke-width:2px;
41
+ classDef judge fill:#2b1905,stroke:#f59e0b,color:#fef3c7,stroke-width:3px;
42
+ classDef answer fill:#062814,stroke:#22c55e,color:#dcfce7,stroke-width:3px;
43
+ classDef note fill:#0b1220,stroke:#475569,color:#cbd5e1,stroke-width:1px;
44
+
45
+ P["input prompt<br/>same question to every model"]:::prompt
46
+
47
+ subgraph PANEL[parallel model panel]
48
+ direction TB
49
+ A["model A<br/>strong baseline candidate"]:::modelA
50
+ B["model B<br/>finds contradiction"]:::modelB
51
+ C["model C<br/>adds unique insight"]:::modelC
52
+ D["model D<br/>fast practical path"]:::modelD
53
+ E["model E<br/>catches edge case"]:::modelE
41
54
  end
42
55
 
43
- Q --> A
44
- Q --> I
45
- Q --> T
46
- A --> J{{Judge}}:::judge
47
- I --> J
48
- T --> J
49
- J --> R[Final Markdown report]:::report
50
- J -. missing judge result .-> F[Fallback judge retry]:::fallback
51
- F --> R
56
+ J["judge<br/>consensus contradictions • blind spots"]:::judge
57
+ R["best answer<br/>selected or synthesized"]:::answer
58
+ N["not majority vote<br/>best evidence wins"]:::note
59
+
60
+ P --> A
61
+ P --> B
62
+ P --> C
63
+ P --> D
64
+ P --> E
65
+
66
+ A --> J
67
+ B --> J
68
+ C --> J
69
+ D --> J
70
+ E --> J
71
+
72
+ J --> R
73
+ J -.-> N
74
+
75
+ linkStyle 0,5 stroke:#38bdf8,stroke-width:3px;
76
+ linkStyle 1,6 stroke:#a855f7,stroke-width:3px;
77
+ linkStyle 2,7 stroke:#22c55e,stroke-width:3px;
78
+ linkStyle 3,8 stroke:#f59e0b,stroke-width:3px;
79
+ linkStyle 4,9 stroke:#ff4d8d,stroke-width:3px;
80
+ linkStyle 10 stroke:#22c55e,stroke-width:4px;
81
+ linkStyle 11 stroke:#94a3b8,stroke-width:2px,stroke-dasharray: 5 5;
52
82
  ```
53
83
 
54
- ## How the judge works
84
+ ## Why a panel can beat one model
85
+
86
+ Single-model answers are brittle on hard tasks. They are limited by one model's
87
+ priors, one reasoning path, and one failure mode.
88
+
89
+ A panel helps because:
90
+
91
+ - different models are trained differently and make different bets
92
+ - errors are less correlated, so blind spots do not line up perfectly
93
+ - consensus is a useful confidence signal without pretending certainty
94
+ - disagreement tells you where the answer is fragile
95
+ - a judge can select or synthesize the best realistic answer from the set
96
+
97
+ The result is slower, but usually better for design choices, risk review,
98
+ tricky debugging, and research-heavy questions.
99
+
100
+ ## What the judge actually does
55
101
 
56
102
  The judge gets:
57
103
 
58
104
  - the original prompt
59
- - the panel outputs
60
- - the panel failures and blind spots
105
+ - every panel output
106
+ - panel failures and blind spots
61
107
  - the configured judge model
62
108
 
63
- It produces one report that highlights:
109
+ It then:
64
110
 
65
- - consensus
66
- - disagreements
67
- - risks
68
- - missing evidence
69
- - next step
111
+ - finds consensus
112
+ - preserves real disagreements
113
+ - spots weak or incomplete answers
114
+ - pulls forward unique insights worth keeping
115
+ - returns one clear recommendation and next step
70
116
 
71
- It does not edit files or spawn more subagents. It does one job: turn
72
- competing notes into one clear recommendation.
117
+ It does not edit files or spawn more subagents. It does one job: choose or
118
+ synthesize the best realistic answer.
73
119
 
74
120
  ## Good fit
75
121
 
@@ -89,6 +135,7 @@ Do not use it for trivial edits, formatting, or obvious one-step fixes.
89
135
  /fusion
90
136
  /fusion <prompt>
91
137
  /fusion --profile <name> <prompt>
138
+ /fusion -p <name> <prompt>
92
139
  /fusion status
93
140
  /fusion stop
94
141
  /fusion init
@@ -113,7 +160,7 @@ Then reload Pi:
113
160
  /reload
114
161
  ```
115
162
 
116
- For full config examples and profile details, see [`docs/user-guide.md`](./docs/user-guide.md).
163
+ For commands, config, and troubleshooting details, see [`docs/user-guide.md`](./docs/user-guide.md).
117
164
 
118
165
  ## Notes
119
166
 
@@ -1,10 +1,10 @@
1
1
  # pi-fusion user guide
2
2
 
3
- Use this when the README is not enough.
3
+ README covers the why. This guide covers commands, config, and troubleshooting.
4
4
 
5
5
  ## Mental model
6
6
 
7
- `pi-fusion` turns one hard question into a small review panel:
7
+ `pi-fusion` turns one hard question into a small parallel panel:
8
8
 
9
9
  ```text
10
10
  prompt → parallel panel → judge synthesis → final report
@@ -12,6 +12,8 @@ prompt → parallel panel → judge synthesis → final report
12
12
 
13
13
  Normal execution is a single `pi-subagents` async chain. If that chain completes without a judge result but at least two panelists still produced usable answers, `pi-fusion` runs one fallback judge pass instead of losing the review.
14
14
 
15
+ Panel diversity can come from different model choices, different perspective prompts, or both. In practice, mixing models is usually the main lever.
16
+
15
17
  The base Pi session stays in control. Fusion is a tool for decisions, not a replacement for normal coding.
16
18
 
17
19
  ## Commands
@@ -108,9 +110,9 @@ Panel member:
108
110
  - `id`: stable machine name
109
111
  - `label`: human-readable report label
110
112
  - `agent`: subagent name
111
- - `model`: optional model override
113
+ - `model`: optional model override; often the main source of panel diversity
112
114
  - `thinking`: optional `off`, `minimal`, `low`, `medium`, `high`, or `xhigh`
113
- - `role`: short perspective instruction
115
+ - `role`: optional perspective hint layered on top of the model
114
116
 
115
117
  Judge:
116
118
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@alexeiled/pi-fusion",
3
- "version": "0.2.0",
4
- "description": "Subagent-native multi-model deliberation for Pi",
3
+ "version": "0.2.1",
4
+ "description": "Stronger answers for hard Pi questions via a parallel model panel + judge, built on pi-subagents",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
7
7
  "license": "MIT",
@@ -22,11 +22,7 @@
22
22
  "files": [
23
23
  "agents/*.md",
24
24
  "src/*.ts",
25
- "README.md",
26
- "LICENSE",
27
- "AGENTS.md",
28
- "docs/user-guide.md",
29
- "tsconfig.json"
25
+ "docs/user-guide.md"
30
26
  ],
31
27
  "scripts": {
32
28
  "check": "tsc --noEmit",
@@ -47,7 +43,8 @@
47
43
  "agents": [
48
44
  "./agents"
49
45
  ]
50
- }
46
+ },
47
+ "image": "https://raw.githubusercontent.com/alexei-led/pi-fusion/master/docs/assets/fusion-icon.png"
51
48
  },
52
49
  "peerDependencies": {
53
50
  "@earendil-works/pi-coding-agent": "*",
package/AGENTS.md DELETED
@@ -1,7 +0,0 @@
1
- # Contributor notes
2
-
3
- - Keep the extension small, typed, and testable.
4
- - Do not own or replace the Pi footer. Publish only the `fusion` status key.
5
- - Use `pi-subagents` RPC for panel and judge execution. Do not import its internals.
6
- - Keep bundled panel agents read-only by default.
7
- - Do not add runtime dependencies unless the task needs them.
package/tsconfig.json DELETED
@@ -1,19 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2023",
4
- "module": "NodeNext",
5
- "moduleResolution": "NodeNext",
6
- "strict": true,
7
- "noUncheckedIndexedAccess": true,
8
- "exactOptionalPropertyTypes": true,
9
- "useUnknownInCatchVariables": true,
10
- "noImplicitOverride": true,
11
- "noImplicitReturns": true,
12
- "noFallthroughCasesInSwitch": true,
13
- "skipLibCheck": true
14
- },
15
- "include": [
16
- "src/**/*.ts",
17
- "test/**/*.ts"
18
- ]
19
- }