# Repository Briefing: disler/fusion-harness
> Source: https://repoforai.com/repo/disler/fusion-harness (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/disler/fusion-harness
- **Category**: Coding, Skills & MCP (AI 编程 / Skills / MCP)
- **Primary Language**: TypeScript
- **License**: MIT
- **Engineering Health**: B (56/100 · Maintenance 12/35 · Adoption 18/25 · Releases 6/20 · License 20/20)
- **Review Snapshot**: 2026-12-01
- **Deployment / Stack Signals**: CLI, API
- **Momentum**: 614 ★ total (+0 24h / +3 7d) · 117 forks
- **When to Use**: Best for: Pi users who want independent model reviews or plans before letting one agent at a time modify a shared checkout. Skip if: You need offline inference, a standalone MCP or HTTP service, parallel writes in isolated worktrees, or the cost and simplicity of a single model call.

## Overview
```text
### Architecture & Core Mechanics
Fusion Harness is an MIT-licensed TypeScript extension for the Pi coding agent, not a standalone agent server or a documented MCP server. `extensions/fusion-harness/fusion-harness.ts` loads the stack, sets Pi’s live chat model to Main, manages slot sessions, and registers commands and UI components. `model-stack.ts` validates the explicit YAML configuration; `yaml` is the sole listed package dependency, while Pi provides the host and agent runtime.

`child-runner.ts` launches clean-room Pi children with `--no-extensions`, streams JSON events from `pi --mode json -p`, and uses process groups for cancellation and timeout handling. Non-Main transcripts are scoped to the app run and keyed by slot and fully qualified model; Main follows Pi’s native transcript behavior when switching models. Collaboration checks the architect’s task DAG before scheduling and uses both a run-level writer token and an atomic lease keyed to the canonical working directory to coordinate harness-managed writers.

### Key Capabilities & Differentiators
An explicit `--fh-config` stack binds two to five `provider/id` model slots, with exactly one architect and one non-architect primary. The primary handles raw Pi chat. Slots can set thinking levels and supply inline or file-based system prompts. Opinion and debate modes allow only `read`, `grep`, `find`, and `ls`; later debate rounds give surviving agents one another’s labeled prior positions and end without a judge or automatic merge.

Fusion gives a fresh temporary agent sole write access, then distributes the full result to Main and every slot. Exact ACK checks, one retry for malformed replies, and a common SHA-256 in the run artifacts make delivery status auditable; a missing ACK leaves the result visible but marks synchronization incomplete. Collaboration runs read-only planning, starts tasks as DAG dependencies clear, and closes with architect integration. Separately, auto-validation writes a `uv` acceptance gate, checks that the baseline fails, and then iterates with Main, with a default cap of five validations.

### Trade-offs & Limitations
Against a single Pi session, the strongest reason to adopt Fusion Harness is getting separate model judgments before committing to a change, then handing implementation to one writer in the existing checkout. The cost is more provider calls and more credentials and model availability to manage. Parallel read-only turns can overlap, but debate rounds, fusion and synchronization, and validation passes add serial stages. Use a narrower mode when you only need one opinion or one implementation pass.

Against agents working in separate worktrees, the shared checkout avoids a branch merge step but also forgoes parallel editing: write-enabled tasks queue, and collaboration rejects observed worktree commands. The lease coordinates participating harness processes; it is not a filesystem sandbox for agents or unrelated tools. Likewise, an exact fusion ACK records a protocol response, not proof that a model understood the result. The local orchestrator also does not change the fact that context sent for inference is subject to each provider’s data policies.

### Hardware & Deployment Guide
The manual path installs `@earendil-works/pi-coding-agent` globally with npm, installs repository dependencies with `npm install`, and requires `just`, Bun, `jq`, and `uv`. Copy `.env.example` to `.env` and supply credentials for the providers in use; Pi expects `GEMINI_API_KEY` for its Google provider. `just fusion` starts a preset, and `just fh-stack <yaml>` starts an explicit stack. There is no config auto-discovery, and `--fh-config` cannot be combined with legacy model, thinking, or system-prompt flags.

The documented deployment runs the extension and its tooling locally while making provider API calls; no Docker image, standalone API service, or offline inference path is documented. Confirm that models are visible to clean-room children before rollout: invalid or unavailable stacks fail at startup. `npm test` runs 34 deterministic tests without paid calls, and `npm run test:fusion-harness` is the focused test entry point. No GitHub release is listed, so pin a known commit if reproducibility matters.
```

## Key Capabilities
```text
- Stack contract: Explicit YAML defines 2–5 slots with exactly one architect and one non-architect Main builder; Main becomes Pi’s live chat model.
- Process control: Pi children stream JSON events and run in separate process groups so cancellation can reach tool descendants.
- Debate: Each surviving slot sees every other slot’s labeled prior-round opinion; closing positions stay separate, with no judge or automatic merge.
- Collaboration: A validated dependency graph schedules ready tasks, while a global writer token and a checkout-scoped lease serialize harness-managed writes.
- Fusion handoff: A temporary sole writer produces the result, which is synchronized in full with exact acknowledgments and a shared SHA-256 recorded in run artifacts.
- Acceptance loop: A `uv` gate must fail before implementation starts; the default cap is five validations.
```

## Quick Start / Clone
```bash
npm install -g @earendil-works/pi-coding-agent   # the pi coding agent
brew install just jq uv                          # command runner + gate tooling
npm install                                      # repo deps (yaml parser)
cp .env.example .env                             # then fill ANTHROPIC/GEMINI/FIREWORKS/OPENAI/OPENROUTER_API_KEY
npm test                                         # 34 deterministic tests, zero paid calls
```
