# M001: Kerf Engine — Raster-to-Vector Pipeline & API

## Vision
Build and validate the standalone Kerf Engine: a stateless HTTP API that accepts raster images (or existing SVGs) and returns clean, production-quality vector output (SVG, DXF, JSON) through a multi-stage pipeline of preprocessing, vectorization, post-processing, and format conversion. This is the proprietary IP core — it must work flawlessly before anything else is built.

## Slice Overview
| ID | Slice | Risk | Depends | Done | After this |
|----|-------|------|---------|------|------------|
| S01 | Core Pipeline — Preprocessing + Vectorization | high — dependency installation, opencv+potrace+vtracer integration | — | ✅ | POST /engine/trace with a PNG logo returns valid SVG using both Potrace and VTracer modes |
| S02 | Post-Processing + Output Formats (SVG, DXF, JSON) | high — dxf generation quality is hard to validate programmatically | S01 | ✅ | /engine/trace returns valid DXF and JSON output; /engine/simplify reduces node count on complex SVG |
| S03 | Preset System + Engine Docker Packaging | low — presets are config files; docker packaging is well-understood | S02 | ✅ | GET /engine/presets returns all presets; each preset produces distinct output from same input; engine runs in Docker |
