Replace the legacy ANSI-based DashboardTUI with an Ink/React rewrite under packages/cli/src/commands/dashboard-tui/, delete the standalone @fusion/tui package, and make `fn` (no args) launch the dashboard. The new TUI keeps the existing 5-panel status mode (system, logs, utilities, stats, settings) but adds an interactive mode (b/a/g) with three views: a kanban board with project picker and per-task detail, an agents list+detail with state management, and a settings editor. Bordered focus-aware panels, solid-background help overlay, static all-blue FUSION splash that adapts to small terminals. DashboardTUI and DashboardLogSink public API are unchanged so dashboard.ts only needed import-path updates plus interactiveData/loadingStatus wiring. Also adds zod to @fusion/dashboard to satisfy a peer dep introduced by pi-coding-agent 0.70. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
146 lines
4.4 KiB
Markdown
146 lines
4.4 KiB
Markdown
# Contributing
|
|
|
|
[← Docs index](./README.md)
|
|
|
|
Thanks for contributing to Fusion.
|
|
|
|
## Development Setup
|
|
|
|
### Prerequisites
|
|
|
|
- Node.js (current LTS recommended)
|
|
- pnpm (`packageManager` is pnpm)
|
|
- Git
|
|
- `pi` runtime/auth configured for AI features
|
|
|
|
### Install dependencies
|
|
|
|
```bash
|
|
pnpm install --frozen-lockfile
|
|
```
|
|
|
|
### Build all packages
|
|
|
|
```bash
|
|
pnpm build
|
|
```
|
|
|
|
## Workspace Package Overview
|
|
|
|
| Package | Purpose |
|
|
|---|---|
|
|
| `@fusion/core` | Shared domain types, stores, persistence, and core utilities |
|
|
| `@fusion/dashboard` | Express API + React UI |
|
|
| `@fusion/engine` | Scheduling, triage, execution, merge orchestration |
|
|
| `@fusion/desktop` | Electron shell around Fusion dashboard/client |
|
|
| `@fusion/mobile` | Capacitor + PWA mobile packaging |
|
|
| `@fusion/plugin-sdk` | Plugin SDK for building Fusion extensions |
|
|
| `@runfusion/fusion` | Published CLI + pi extension |
|
|
|
|
## Development Workflow
|
|
|
|
```bash
|
|
pnpm dev # build + run CLI entrypoint in dev mode
|
|
pnpm dev:ui # dashboard dev server only
|
|
pnpm lint # lint all packages
|
|
pnpm test # workspace test suite (clean-worktree compatible)
|
|
pnpm build # workspace builds
|
|
pnpm verify:workspace # canonical lint -> test -> build verification gate
|
|
pnpm typecheck # workspace typechecks
|
|
```
|
|
|
|
## Deterministic workspace verification bootstrap
|
|
|
|
Fusion codifies workspace verification as a deterministic contract:
|
|
|
|
- Use `pnpm install --frozen-lockfile` for clean bootstrap and dependency repair paths.
|
|
- `pnpm test` must be runnable in a clean worktree without requiring a prior `pnpm build`.
|
|
- This includes clean states where `packages/core/dist`, `packages/engine/dist`, and `packages/dashboard/dist` are absent.
|
|
- `pnpm verify:workspace` is the canonical pre-merge gate and runs in strict order:
|
|
1. `pnpm lint`
|
|
2. `pnpm test`
|
|
3. `pnpm build`
|
|
|
|
CI uses `pnpm verify:workspace` directly, so changes that reintroduce hidden test pre-build dependencies fail fast.
|
|
|
|
## Quality Gate Checklist
|
|
|
|
Before submitting changes, verify:
|
|
|
|
- [ ] `pnpm verify:workspace` — canonical lint → test → build gate
|
|
- [ ] `pnpm typecheck` — type checking passes
|
|
|
|
## Testing Requirements
|
|
|
|
Use real test runs (not manual verification substitutes):
|
|
|
|
```bash
|
|
pnpm test
|
|
pnpm test:coverage
|
|
pnpm test:coverage:core
|
|
pnpm test:coverage:engine
|
|
pnpm test:coverage:cli
|
|
pnpm test:coverage:dashboard
|
|
```
|
|
|
|
## Build Standalone Executables
|
|
|
|
Fusion supports standalone binary builds through Bun compile scripts in the CLI package.
|
|
|
|
```bash
|
|
pnpm build:exe # build host-target executable
|
|
pnpm build:exe:all # build multi-target executables
|
|
```
|
|
|
|
## Release Process
|
|
|
|
Fusion uses Changesets + version PR workflow.
|
|
|
|
- See [RELEASING.md](../RELEASING.md) for release flow details.
|
|
- For published package behavior changes, include a changeset.
|
|
|
|
## Code Signing
|
|
|
|
Release binary signing setup is documented here:
|
|
|
|
- [Code Signing Setup](./CODE_SIGNING.md)
|
|
|
|
## Git / Commit Conventions
|
|
|
|
Use task-ID-scoped conventional commits:
|
|
|
|
- `feat(FN-XXX): ...`
|
|
- `fix(FN-XXX): ...`
|
|
- `test(FN-XXX): ...`
|
|
- `docs(FN-XXX): ...` (for documentation-only changes)
|
|
|
|
## Project Memory
|
|
|
|
When enabled, Fusion uses OpenClaw-style memory files:
|
|
|
|
- `.fusion/memory/MEMORY.md` — long-term project memory
|
|
- `.fusion/memory/YYYY-MM-DD.md` — daily running notes
|
|
- `.fusion/memory/DREAMS.md` — dream-processing memory file
|
|
- The legacy top-level memory file is a deprecated migration fallback (seed/alias behavior) and should not be treated as canonical
|
|
|
|
Use project memory for reusable patterns, constraints, and pitfalls that should persist across tasks.
|
|
|
|
### Background Memory Summarization
|
|
|
|
Fusion can automatically extract insights from memory and prune transient content. Enable via `insightExtractionEnabled` setting:
|
|
|
|
- `.fusion/memory/MEMORY.md` — Canonical long-term memory source (inside the layered `.fusion/memory/` workspace) compacted/pruned by extraction jobs
|
|
- `.fusion/memory-insights.md` — Distilled insights output
|
|
- `.fusion/memory-audit.md` — Audit report after each extraction (includes pruning outcome)
|
|
|
|
See [Settings Reference](./settings-reference.md#background-memory-summarization--audit) for configuration details.
|
|
|
|
## SQLite Test Runner Pitfall
|
|
|
|
When running engine tests with Vitest and `node:sqlite`, ensure the engine Vitest config uses thread pool mode:
|
|
|
|
- ✅ `pool: "threads"`
|
|
- ❌ `pool: "vmThreads"`
|
|
|
|
`node:sqlite` fails under Vitest VM contexts; using threads avoids that failure mode.
|