<!-- Unlicense — cochranblock.org -->

# Proof of Artifacts

*Concrete evidence that this project works, ships, and is real.*

> The quality gate behind every CochranBlock binary. No external test frameworks — the test binary IS the CI.

## Architecture

```mermaid
flowchart TD
    Bin[r8r binary] --> Core[core/]
    Bin --> Engine[engine/]
    Bin --> Nodes[nodes/]
    Bin --> Serve[serve.rs<br/>axum API + canvas host]
    Codegen[r8r-codegen binary] --> Spec[nodes-spec/*.json]
    Codegen --> Stub[src/nodes/generated/*.rs]
    Codegen -.reads.-> N8N[/home/mcochran/n8n<br/>reference clone]
    Test[r8r-test binary] --> Exopack[exopack TRIPLE SIMS]
    Test --> Engine
    Test --> Nodes
    Canvas[canvas/ WASM crate] -- trunk build --> Dist[static-canvas/<br/>WASM + JS + HTML]
    Dist -- include_dir! --> Bin
    Bin -- HTTP --> User[Browser/curl]
```

## Build Output

| Metric | Value |
|--------|-------|
| Source LOC (hand-written) | 3,956 |
| Modules | 5 (core, engine, nodes, codegen, serve) + 2 binaries (codegen, test) |
| T1 hand-built nodes | 19 (set, if, no_op, http_request, wait, code, switch, webhook, cron, datetime, crypto, rename_keys, filter, item_lists, postgres, slack, github, openai, email_send) |
| T2 codegen stubs | 566 |
| Total registered | 585 |
| Per-node sims (TRIPLE SIMS) | 12 |
| TRIPLE SIMS pass rate | 3/3 (latest run) |
| Direct deps | 32 from crates.io + 1 path dep (exopack, test-only) |
| Edition / MSRV | 2024 / 1.85 |
| Release binary size | 7.9 MB (8,208,680 bytes) on x86_64-linux |
| Canvas WASM bundle | 350 KB total (316 KB WASM + 34 KB JS shim + 3 KB HTML) |
| Bundle delivery | embedded into the main binary via `include_dir!` — no separate asset deploy |
| Profile | opt-level=3, lto=thin, codegen-units=1, strip=true, panic=abort |
| Commits since scaffold | 9 |
| Persistence | TOML (workflows, credentials) + JSON-per-run; embedded DB deferred to v0.2 |
| License | Unlicense (public domain dedication) |

## Comparison vs n8n

| Dimension | n8n | r8r |
|---|---|---|
| Runtime | Node.js (~300 MB) | static Rust binary (7.9 MB) |
| Persistence required | Postgres | none (TOML + JSON) |
| Editor | Vue SPA + npm install | Leptos WASM bundle (350 KB) embedded in the binary |
| License | Sustainable Use License | Unlicense (public domain) |
| Air-gap deploy | hostile | native |
| Working node count | 306 | 19 (codegen pipeline supplies the rest as registered stubs) |
| Parity-on-name | ✓ (every n8n node is a registered slug here) | |
| Parity-on-function | ~6% (19/306) | |

## TRIPLE SIMS Results (latest run, 2026-04-25)

```
[registry] 585 nodes
[expr] PASS (got: seven=7)
[sim:set] PASS
[sim:if] PASS
[sim:no_op] PASS
[sim:wait] PASS
[sim:code] PASS
[sim:switch] PASS
[sim:datetime] PASS
[sim:crypto] PASS
[sim:rename_keys] PASS
[sim:filter] PASS
[sim:item_lists] PASS
[sim:e2e_smoke] PASS
TRIPLE SIMS pass 1/3 OK (54ms)
TRIPLE SIMS pass 2/3 OK (54ms)
TRIPLE SIMS pass 3/3 OK (54ms)
TRIPLE SIMS: 3/3 passes OK
```

Run via `cargo run --features tests --bin r8r-test`.

## Verification Commands

```bash
# 1. Builds clean
cargo check
cargo build --release --bin r8r

# 2. Tests pass (3x via TRIPLE SIMS)
cargo run --features tests --bin r8r-test

# 3. Codegen is reproducible
cargo run --bin r8r-codegen -- /path/to/n8n
git diff --stat src/nodes/generated/
# expect: zero diff if extractor is deterministic against the same n8n SHA

# 4. Workflow runs end-to-end
./target/release/r8r run examples/trivial.toml
# expect: "ok - 3 nodes executed, last = Through"

# 5. 585 nodes registered
./target/release/r8r list-nodes | wc -l
# expect: 585

# 6. Canvas + API serves
./target/release/r8r serve --port 8080
# open http://localhost:8080/ → Leptos canvas
# curl http://localhost:8080/api/nodes  → JSON list
# curl -X POST -H content-type:application/toml \
#   --data-binary @examples/trivial.toml \
#   http://localhost:8080/api/run

# 7. Binary size
ls -lh target/release/r8r
# expect: ~8 MB
```

## Compliance Posture

- **License**: Unlicense — federal-friendly, no attribution requirements, no copyleft propagation
- **Supply chain**: 32 direct crates.io deps, all pure-Rust except `lettre` (rustls TLS) and bundled SQLite (`tokio-postgres` connection layer); no Node, no npm, no Python
- **Air-gap**: binary makes no outbound calls except via user-configured nodes (HTTP Request, Postgres, Slack, etc.)
- **Federal stack**: matches Cochran Block ecosystem (kova, oakilydokily, exopack) — same headers, same Unlicense, same exopack quality gate
- **Reference upstream**: `/home/mcochran/n8n` is read-only; no source vendored. Codegen extracts metadata schemas (not copyrightable) and emits original Rust impls
