# Fusible Roadmap & Architecture
Fusible is the electronic linter and hardware–firmware bridge for tscircuit projects. It enforces electrical validity ("blowing the fuse") before firmware codegen or compilation can occur.
## 1. Monorepo Architecture
Projects using Fusible are structured as hardware + firmware monorepos:
```text
my-project/
├── fusible.yml # Unified hardware + firmware manifest
├── hardware/ # tscircuit board and component definitions (.tsx)
│ ├── package.json
│ └── index.tsx # Top-level board entry point
├── firmware/ # Rust (Embassy / Cortex-M) or C/C++ firmware
│ ├── Cargo.toml
│ └── src/
│ ├── main.rs
│ └── pins.rs # Auto-generated by Fusible (fuse intact only)
└── dist/ # Generated artifacts (circuit.json, gerbers, 3d)
```
## 2. `fusible.yml` Specification
A minimal, ergonomic YAML syntax with sensible defaults:
```yaml
name: sensor-node
hardware:
entry: hardware/index.tsx # Entry point (.tsx or circuit.json)
out_dir: dist # Output directory for circuit artifacts
port: 3020 # Dev server port for interactive viewer
mcu:
chip: stm32g431 # Target silicon identifier
firmware:
path: firmware # Directory containing firmware crate
build_cmd: cargo build # Optional build command
```
## 3. CLI Subcommand Suite
Fusible unifies the hardware development workflow by wrapping tscircuit commands:
* `fusible [options]` / `fusible check [file]`: Runs the electrical linter. If target is `.tsx`, evaluates circuit to JSON first. Exits `0` (intact), `1` (fuse blown), or `2` (tool error).
* `fusible dev [file] [--port P]` (aliases: `view`, `webview`): Starts the tscircuit interactive web previewer (`tsci dev` / `@tscircuit/runframe`) with hot reloading.
* `fusible export [file] [-f format] [-o out]`: Wraps `tsci export` to generate Gerbers, SVGs, 3D models (GLB/STEP), or netlists.
* `fusible build`: Compiles `.tsx` to Circuit JSON, validates electrical rules, generates `pins.rs`, and builds firmware.
* `fusible init`: Scaffolds a starter monorepo with `fusible.yml`, `hardware/`, and `firmware/`.
## 4. Implementation Milestones
- [x] **Milestone 1: MVP Core** — Circuit JSON parser, fail-closed electrical linter, miette diagnostics, exit code contract.
- [ ] **Milestone 2: Project Manifest (`src/config/`)** — `fusible.yml` schema, auto-discovery, fallback defaults.
- [ ] **Milestone 3: tscircuit Runner (`src/tscircuit/`)** — Auto-detection (`tsci`, `bun x tscircuit`, `npx tscircuit`), dev viewer, export, and build wrapping.
- [ ] **Milestone 4: CLI Subcommands (`src/cli.rs`, `src/main.rs`)** — `dev`, `view`, `check`, `export`, `init`, and pipeline `build`.
- [ ] **Milestone 5: MCU Pin-Muxing & Firmware Codegen** — Pin assignment validation and `pins.rs` generation for Embassy.