# Project State ## Project Reference See: .paul/PROJECT.md (updated 2026-05-17) **Core value:** Machinists transfer CNC programs to/from any controller without manual steps or internet **Current focus:** v0.1 complete — ready for next milestone planning ## Current Position Milestone: v0.1 Multi-CN Release — **COMPLETE** Phase: 5 of 5 — Complete Plan: All plans unified Status: Milestone complete, ready for v0.2 planning Last activity: 2026-05-17 — Phase 5 unified, milestone closed Progress: - Milestone v0.1: [██████████] 100% ## Loop Position Current loop state: ``` PLAN ──▶ APPLY ──▶ UNIFY ✓ ✓ ✓ [Loop complete — milestone done] ``` ## What Was Built (v0.1 Multi-CN Release) ### Phase 1 — CNC Abstraction - Namespace: `Fanuc_integration.Cnc.*` → `FanucProgramManager.Cnc.*` (29 files) - `IFocasDialect` extended: `UploadStart`/`DownloadStart` accept `short fileType` - `IFanucMachine` created: extends `ICncMachine` with tool offset + work zero R/W - `CncManufacturer` enum: Fanuc, Heidenhain, Siemens, Mitsubishi - All 29 `Cnc/**/*.cs` files added to csproj ### Phase 2 — Heidenhain LSV2 - `HeidenhainConnectionConfig` — IP, port 19000, credentials, timeout - `Lsv2Client` — TCP framing, CRC-16/CCITT, login (SELECT+LOG_IN), ReceiveFile/SendFile - `HeidenhainMachine : ICncMachine` — RunGuardedAsync pattern, state machine ### Phase 3 — Siemens + Mitsubishi FTP - `SiemensConnectionConfig` / `SiemensFtpClient` / `SiemensMachine : ICncMachine` - `MitsubishiConnectionConfig` / `MitsubishiFtpClient` / `MitsubishiMachine : ICncMachine` ### Phase 4 — Wiring - `CncMachineFactory` — creates right `ICncMachine` from `InputArgs` - `InputArgs` — added `manufacturer`, `username`, `password` fields - `Program.cs` — full rewrite using `ICncMachine`; Fanuc 3-file via `IFanucMachine` cast ### Phase 5 — NC Validator - `ValidationSeverity` / `ValidationError` / `ValidationResult` model types - `INcProgramValidator` + `NcProgramValidator` (5 universal + per-manufacturer rules) - Validator injected into all 4 machine classes; upload blocked on Error severity - `NcProgramValidatorTests` — 30+ NUnit tests ### Test Infrastructure - `FanucProgramManager.Tests/` — NUnit 3.13.3 + Moq 4.18.4, .NET 4.7.2 - `FtpServerStub` + `Lsv2ServerStub` — in-process TCP stubs - Unit + integration tests; Fanuc FOCAS tests `[Ignore]`d (Windows-only DLL) ## CLI Args (v0.1) - `-manufacturer=fanuc|heidenhain|siemens|mitsubishi` (default: fanuc) - `-username=` (Heidenhain/Siemens/Mitsubishi) - `-password=` (Heidenhain/Siemens/Mitsubishi) ## Accumulated Context ### Decisions - .NET 4.7.2 locked — max compatibility - Offline-only license check (AES, unchanged) - Heidenhain: LSV2 port 19000, needs real hardware testing - Siemens: FTP `/_N_MPF_DIR/`, needs Sinumerik FTP option enabled on machine - `#` = Warning in Fanuc/Mitsubishi — macro variable indicator - Constructor injection for validator: internal ctor accepts mock — testability without Windows DLL ### Deferred Issues - License system: hardcoded AES key/IV — v0.2 target (hardware fingerprint + encrypted file) - Heidenhain: `ReadActiveProgramAsync` / `SelectMainProgram` not implemented - Siemens: same as Heidenhain - Build + integration not verifiable on Linux (fwlib32 Windows-only) ### Blockers/Concerns None — code complete, pending hardware testing on real machines. ## Session Continuity Last session: 2026-05-17 Stopped at: v0.1 milestone UNIFY complete Next action: `/paul:plan` for v0.2 License System, or `/paul:milestone` to define next milestone Resume file: .paul/ROADMAP.md --- *STATE.md — Updated after every significant action*