From 68c5a555f3c05af75d3ba15c026ac57a557abcd7 Mon Sep 17 00:00:00 2001 From: dtrentin Date: Mon, 25 May 2026 20:27:44 +0200 Subject: [PATCH] chore(paul): close v0.6 Fagor Support milestone, log ISS-012..017 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PAUL bookkeeping per chiusura milestone v0.6 (Phase 16: 16-01 + 16-02): - STATE.md — sezione v0.6 + Phase 16-01 + 16-02 fixup post-review. - ROADMAP.md — Milestone v0.6 + Phase 16 (2 plans). - paul.json — version 0.6.0, milestone Fagor Support, phase 16 fagor-ftp. - phases/16-fagor-ftp/ — 16-01-PLAN.md + 16-01-SUMMARY.md (impl iniziale), 16-02-PLAN.md + 16-02-SUMMARY.md (fix post-review). - ISSUES.md — ISS-012..ISS-017 derivati da code review v0.6: - ISS-012: Fagor ReadActiveProgramAsync/SelectMainProgram non impl - ISS-013: Program.Invia accoppia FanucProgram a tutti i produttori - ISS-014: ResolvePath null-folder NRE pattern (Siemens/Mitsubishi/Fagor) - ISS-015: encoding source-file rischio codepage Windows non-UTF8 - ISS-016: WriteProgramAsync validator riceve path se Name null - ISS-017: FagorFtpClient.Ping swallow senza log Co-Authored-By: Claude Opus 4.7 --- .paul/ISSUES.md | 76 +++++++++++++++++++++- .paul/ROADMAP.md | 23 ++++++- .paul/STATE.md | 56 +++++++++++++--- .paul/paul.json | 12 ++-- .paul/phases/16-fagor-ftp/16-01-PLAN.md | 60 +++++++++++++++++ .paul/phases/16-fagor-ftp/16-01-SUMMARY.md | 28 ++++++++ .paul/phases/16-fagor-ftp/16-02-PLAN.md | 56 ++++++++++++++++ .paul/phases/16-fagor-ftp/16-02-SUMMARY.md | 39 +++++++++++ 8 files changed, 334 insertions(+), 16 deletions(-) create mode 100644 .paul/phases/16-fagor-ftp/16-01-PLAN.md create mode 100644 .paul/phases/16-fagor-ftp/16-01-SUMMARY.md create mode 100644 .paul/phases/16-fagor-ftp/16-02-PLAN.md create mode 100644 .paul/phases/16-fagor-ftp/16-02-SUMMARY.md diff --git a/.paul/ISSUES.md b/.paul/ISSUES.md index 8bef583..dbd0058 100644 --- a/.paul/ISSUES.md +++ b/.paul/ISSUES.md @@ -108,6 +108,80 @@ Enhancements and known issues discovered during execution and codebase analysis. --- +### ISS-012: Fagor `ReadActiveProgramAsync` / `SelectMainProgramAsync` not implemented + +- **Discovered:** Code review v0.6 (2026-05-25) +- **Type:** Feature / Incomplete Implementation +- **Description:** `FagorMachine.ReadActiveProgramAsync()` e `SelectMainProgramAsync()` ritornano `CncResult.Fail("Not supported via FTP")`. Analogo a ISS-009 (Heidenhain) e ISS-010 (Siemens). Fagor espone stato runtime via DNC/OPC-UA non FTP. +- **Files:** `Cnc/Fagor/FagorMachine.cs` +- **Impact:** Low — caso d'uso corrente richiede path esplicito +- **Effort:** Substantial (richiede protocollo DNC/OPC-UA Fagor) +- **Suggested phase:** Future Fagor advanced features + +--- + +### ISS-013: `Program.Invia` accoppia `FanucProgram` parsing a tutti i produttori + +- **Discovered:** Code review v0.6 (2026-05-25) +- **Type:** Bug / Refactoring +- **Description:** `Program.Invia` crea `new FanucProgram(File.ReadAllText(...))` e chiama `GetProgramTitle()` con regex `O####` o `\d{4}` per tutti i produttori. Per Siemens/Mitsubishi/Fagor con programmi non in formato Fanuc, lancia `InvalidOperationException`. Fagor incrementa esposizione del bug. +- **Files:** `Program.cs` (linee 188-202), `FanucProgram.cs` +- **Fix:** Per non-Fanuc usare `Path.GetFileNameWithoutExtension(inputArgs.pathLocaleProgramma)` come `cncProg.Name`. Bypassare parsing Fanuc. +- **Impact:** Medium — CLI `Invia` rotta per tutti i non-Fanuc (Siemens/Mitsubishi/Fagor) +- **Effort:** Medium (1-2h) — refactor Program.Invia con switch su manufacturer +- **Suggested phase:** Future CLI cleanup phase + +--- + +### ISS-014: `ResolvePath` null-folder NRE shared pattern (Siemens/Mitsubishi/Fagor) + +- **Discovered:** Code review v0.6 (2026-05-25) +- **Type:** Bug / Defensive coding +- **Description:** `ResolvePath(folder, name)` in tutti e 3 le macchine FTP dereferenzia `folder` senza null-guard nel ramo `IsNullOrEmpty(name)`. Caller che passa `path = null` (es. `ReadProgramAsync(null)`) provoca NullReferenceException. +- **Files:** `Cnc/Siemens/SiemensMachine.cs`, `Cnc/Mitsubishi/MitsubishiMachine.cs`, `Cnc/Fagor/FagorMachine.cs` +- **Fix:** `if (folder == null) folder = _config.ProgramDirectory;` all'inizio del metodo. Pattern condiviso → considerare helper unitario. +- **Impact:** Low — null path raro in pratica, ma viola contratto API +- **Effort:** Quick (10 min) — refactor uniforme + +--- + +### ISS-015: Encoding source-file rischio `ñ` su build Windows non-UTF8 + +- **Discovered:** Code review v0.6 (2026-05-25) +- **Type:** Build / Encoding +- **Description:** File sorgenti UTF-8 senza BOM. `csc.exe` su Windows con codepage 1252 (Italian) può decodificare letterali non-ASCII come Mojibake. Risolto in v0.6 (Phase 16-02) per `ñ` in `NcProgramValidator.cs` usando `ñ`. Altri file (`Program.cs` con `è`, `à` in stringhe italiane) ancora potenzialmente a rischio. Funziona se build box codepage compatibile, ma fragile. +- **Files:** `Program.cs`, `Cnc/NcProgramValidator.cs`, file `.cs` con letterali italiani +- **Fix:** (a) Aggiungere UTF-8 BOM a tutti i sorgenti, OR (b) sostituire tutti letterali non-ASCII con escape `\uXXXX`, OR (c) aggiungere `/codepage:65001` ai compile args MSBuild. +- **Impact:** Medium — silent corruption se build box ha codepage diversa +- **Effort:** Medium (audit completo file + correzione) +- **Suggested phase:** Future build hardening phase + +--- + +### ISS-016: `WriteProgramAsync` validator riceve `path` se `program.Name` null (Siemens/Mitsubishi/Fagor) + +- **Discovered:** Code review v0.6 (2026-05-25) +- **Type:** API contract / Validation +- **Description:** `_validator.Validate(program.Name ?? path, program.Content)` — se `program.Name` null, validator valida l'intero path FTP come fosse il nome programma. Errori validatore confusi. +- **Files:** `Cnc/Siemens/SiemensMachine.cs`, `Cnc/Mitsubishi/MitsubishiMachine.cs`, `Cnc/Fagor/FagorMachine.cs` +- **Fix:** Fail-fast con `CncError("WriteProgram", "Program.Name is required")` quando `program.Name == null`. Documentare in `CncProgram.cs`. +- **Impact:** Low — caller di solito imposta `Name` +- **Effort:** Quick + +--- + +### ISS-017: `FagorFtpClient.Ping` swallow exception senza log + +- **Discovered:** Code review v0.6 (2026-05-25) +- **Type:** Diagnostics +- **Description:** `Ping()` catch generico ritorna `false` senza log. Stesso pattern in Siemens/Mitsubishi. Diagnostica ridotta su problemi di connessione (timeout vs credenziali vs path mancante). +- **Files:** `Cnc/Siemens/SiemensFtpClient.cs`, `Cnc/Mitsubishi/MitsubishiFtpClient.cs`, `Cnc/Fagor/FagorFtpClient.cs` +- **Fix:** Aggiungere campo `_log` + `_log.Debug(ex, "FTP ping failed")` nel catch. Mantenere return false. Pattern condiviso. +- **Impact:** Low — diagnostica +- **Effort:** Quick + +--- + ## Closed Issues | ID | Summary | Phase | Commit | @@ -121,5 +195,5 @@ Enhancements and known issues discovered during execution and codebase analysis. --- -*Last updated: 2026-05-18* +*Last updated: 2026-05-25* *Sources: STATE.md deferred issues + CONCERNS.md codebase analysis* diff --git a/.paul/ROADMAP.md b/.paul/ROADMAP.md index bb58b89..297ca4c 100644 --- a/.paul/ROADMAP.md +++ b/.paul/ROADMAP.md @@ -206,4 +206,25 @@ Completed: 2026-05-18 - [x] 15-02: Replace all Console.Write/WriteLine with _log.Info; console target Info-only plain layout --- -*Roadmap updated: 2026-05-18 — v0.5 milestone complete; Phase 15 (logging) complete.* + +## Milestone v0.6 — Fagor Support ✅ + +**Status:** Complete +**Phases:** 1 of 1 complete +**Completed:** 2026-05-25 + +| Phase | Name | Plans | Status | Completed | +|-------|------|-------|--------|-----------| +| 16 | fagor-ftp | 2 | ✅ Complete | 2026-05-25 | + +### Phase 16: fagor-ftp ✅ + +**Goal:** Aggiungere supporto Fagor CNC via FTP. Riuso pattern Siemens/Mitsubishi. Refactor validator per gating per-produttore. Modelli supportati: 8060/8065/8070 nativi, 8055 con opzione Ethernet. +**Issues addressed:** — +**Completed:** 2026-05-25 +**Plans:** +- [x] 16-01: Fagor FTP machine + validator gating + CLI integration + test scaffold +- [x] 16-02: Fagor fixup post-review (validator extension fix, ñ escape, lock tests Siemens/Heidenhain, factory test) + +--- +*Roadmap updated: 2026-05-25 — v0.6 milestone complete; Phase 16 (fagor-ftp) 16-01 + 16-02 complete.* diff --git a/.paul/STATE.md b/.paul/STATE.md index 18f0a88..ef201e1 100644 --- a/.paul/STATE.md +++ b/.paul/STATE.md @@ -5,15 +5,15 @@ See: .paul/PROJECT.md (updated 2026-05-18) **Core value:** Machinists transfer CNC programs to/from any controller without manual steps or internet -**Current focus:** v0.5 complete — all milestones shipped; ready for v0.6 planning +**Current focus:** v0.6 Fagor Support complete; ready for v0.7 planning ## Current Position -Milestone: v0.5 Operational Quality — **Complete** -Phase: 15 of 15 (logging) — Complete -Plan: 15-02 complete -Status: Milestone complete — ready for v0.6 planning -Last activity: 2026-05-18 — Phase 15 complete; v0.5 milestone complete +Milestone: v0.6 Fagor Support — **Complete** +Phase: 16 of 16 (fagor-ftp) — Complete +Plan: 16-02 complete +Status: Milestone complete — ready for v0.7 planning +Last activity: 2026-05-25 — Phase 16-02 fixup complete (post-review); v0.6 milestone complete Progress: - Milestone v0.1: [██████████] 100% (complete) @@ -21,15 +21,55 @@ Progress: - Milestone v0.3: [██████████] 100% (complete) - Milestone v0.4: [██████████] 100% (complete) - Milestone v0.5: [██████████] 100% (complete) +- Milestone v0.6: [██████████] 100% (complete) - Phase 15: [██████████] 100% +- Phase 16: [██████████] 100% ## Loop Position ``` PLAN ──▶ APPLY ──▶ UNIFY - ✓ ✓ ✓ [Loop complete — v0.5 milestone complete] + ✓ ✓ ✓ [Loop complete — v0.6 milestone complete] ``` +## What Was Built (v0.6 Fagor Support — complete) + +### Phase 16 — Fagor FTP + +- `Cnc/Models/CncManufacturer.cs` — aggiunto `Fagor` all'enum +- `Cnc/Fagor/FagorConnectionConfig.cs` — nuovo, ProgramDirectory `/Users/Prg/`, ProgramExtension `.nc` default +- `Cnc/Fagor/IFagorFtpClient.cs` — nuovo, interfaccia mirror Siemens +- `Cnc/Fagor/FagorFtpClient.cs` — nuovo, FtpWebRequest + ASCII, mirror Siemens 1:1 +- `Cnc/Fagor/FagorMachine.cs` — nuovo, implementa `ICncMachine` con `ResolvePath` adattato per `ProgramExtension` configurabile +- `Cnc/CncMachineFactory.cs` — case `Fagor` con porta default 21 +- `Cnc/NcProgramValidator.cs` — refactor: helper `IsRestrictiveDialect()` (Fanuc+Mitsubishi); check generic (block 80, no tab, no lowercase, nested parens, comment 32) gated per-produttore. Case `Fagor` aggiunto in `ValidateName` (max 24 char, no `ñ`, solo lettere/cifre/spazi) e `ValidateForbiddenChars` (nessuna restrizione contenuto) +- `ArgParser.cs` — case `"fagor"` aggiunto +- `Program.cs` — help text aggiornato (manufacturer/username/password) +- `NcProgramManager.csproj` — 4 `` per Cnc\Fagor\*.cs +- `NcProgramManager.Tests/Unit/FagorMachineTests.cs` — nuovo, 12 unit test con `Mock` + 2 test con validator reale (`ñ`, lunghezza) +- `NcProgramManager.Tests/Integration/FagorMachineIntegrationTests.cs` — nuovo, 5 stub-based + 1 hardware skip (`FAGOR_TEST_IP`) +- `NcProgramManager.Tests/Unit/NcProgramValidatorTests.cs` — 8 nuovi test Fagor; 3 test esistenti spostati da Siemens a Fanuc dopo refactor gating +- `NcProgramManager.Tests/NcProgramManager.Tests.csproj` — 2 `` aggiunti +- `README.md` — sezione "Controller Fagor" in italiano: modelli supportati (8060/8065/8070), non supportati (8055 base, 8025-8050), regole nome programma, env var test + +Modelli supportati: Fagor 8060, 8065, 8070 (FTP nativo); Fagor 8055 (richiede opzione Ethernet). +Modelli non supportati: 8025/8030/8040/8050 (solo RS232, modulo seriale non implementato). + +### Phase 16-02 — Fagor Fixup (post-review) + +Fix derivati da code review v0.6: + +- `Cnc/NcProgramValidator.cs` — Fagor `ValidateName`: split stem/extension via `LastIndexOf('.')`; whitelist letter/digit/space applicata solo allo stem (consente `.nc` o altre estensioni). Letterali `ñ` sostituiti con escape Unicode `ñ` (codepage safety) +- `NcProgramManager.Tests/Unit/NcProgramValidatorTests.cs`: + - 3 nuovi test lock Siemens (lowercase/tab/long-block ora esenti) + - 3 nuovi test lock Heidenhain (lowercase/tab/long-block ora esenti) + - 4 nuovi test Fagor (`.nc` extension success, `.pim` extension success, stem con simbolo fail, `ñ` escape) + - 1 test esistente Fagor `ñ` migrato a escape `ñ` +- `NcProgramManager.Tests/Unit/CncMachineFactoryTests.cs` — aggiunto `Create_Fagor_ReturnsFagorMachine` +- `.paul/ISSUES.md` — aggiunte ISS-012..ISS-017 da review findings (non risolti in v0.6, deferiti) + +Issue follow-up aperti: ISS-012, ISS-013, ISS-014, ISS-015, ISS-016, ISS-017 + ## What Was Built (v0.5 Operational Quality — complete) ### Phase 15 — Logging @@ -174,7 +214,7 @@ Key open items: None — v0.5 complete. ### Git State -Last commit: (Phase 15 commit — see below after git commit) +Last commit: `60ce1c9` — feat(15-logging): NLog structured logging — all output through NLog (v0.5 complete) LicenseGenerator repo: commit `2ef68dd` — feat: initial LicenseGenerator Branch: main diff --git a/.paul/paul.json b/.paul/paul.json index 3fb01ab..3be91ee 100644 --- a/.paul/paul.json +++ b/.paul/paul.json @@ -1,14 +1,14 @@ { "name": "NcProgramManager", - "version": "0.5.0", + "version": "0.6.0", "milestone": { - "name": "v0.5 Operational Quality", - "version": "0.5.0", + "name": "v0.6 Fagor Support", + "version": "0.6.0", "status": "complete" }, "phase": { - "number": 15, - "name": "logging", + "number": 16, + "name": "fagor-ftp", "status": "complete" }, "loop": { @@ -17,7 +17,7 @@ }, "timestamps": { "created_at": "2026-05-13T00:00:00Z", - "updated_at": "2026-05-18T00:00:00Z" + "updated_at": "2026-05-25T00:00:00Z" }, "satellite": { "groom": true diff --git a/.paul/phases/16-fagor-ftp/16-01-PLAN.md b/.paul/phases/16-fagor-ftp/16-01-PLAN.md new file mode 100644 index 0000000..d78e704 --- /dev/null +++ b/.paul/phases/16-fagor-ftp/16-01-PLAN.md @@ -0,0 +1,60 @@ +# Phase 16-01 — Fagor FTP Support + +## Goal + +Aggiungere supporto Fagor CNC via FTP a `NcProgramManager`. Riusare pattern Siemens/Mitsubishi (FtpWebRequest + ASCII). Refactor validator per gating per-produttore dei check generic (block 80, no tab, no lowercase, nested parens, comment 32) — applicati ora solo a Fanuc+Mitsubishi (Fagor esente). Estendere CLI con `-manufacturer=fagor`. + +## Modelli supportati + +| Modello | Supporto | Note | +|---------|----------|------| +| 8055 | Solo con opzione Ethernet | Richiede attivazione server FTP via parametri macchina | +| 8060 | Sì | FTP nativo (Windows-based) | +| 8065 | Sì | FTP nativo (Windows-based) | +| 8070 | Sì | FTP nativo (Windows embedded) | + +## Modelli non supportati + +| Modello | Motivo | +|---------|--------| +| 8055 base (senza Ethernet) | Solo RS232; protocollo seriale non implementato | +| 8025 / 8030 / 8040 / 8050 | Legacy, esclusivamente RS232 | + +## Files creati + +- `Cnc/Fagor/FagorConnectionConfig.cs` +- `Cnc/Fagor/IFagorFtpClient.cs` +- `Cnc/Fagor/FagorFtpClient.cs` +- `Cnc/Fagor/FagorMachine.cs` +- `NcProgramManager.Tests/Unit/FagorMachineTests.cs` +- `NcProgramManager.Tests/Integration/FagorMachineIntegrationTests.cs` + +## Files modificati + +- `Cnc/Models/CncManufacturer.cs` — enum aggiunto `Fagor` +- `Cnc/CncMachineFactory.cs` — case `Fagor` +- `Cnc/NcProgramValidator.cs` — refactor gating + case Fagor +- `ArgParser.cs` — case `"fagor"` +- `Program.cs` — help text +- `NcProgramManager.csproj` — 4 `` +- `NcProgramManager.Tests/NcProgramManager.Tests.csproj` — 2 `` +- `NcProgramManager.Tests/Unit/NcProgramValidatorTests.cs` — 3 test esistenti spostati Siemens → Fanuc, 8 nuovi Fagor +- `README.md` — sezione Controller Fagor + +## Regole validatore Fagor + +- Nome programma: max 24 caratteri, no `ñ`, solo lettere/cifre/spazi +- Contenuto programma: nessuna restrizione (Fagor permette ISO + linguaggio alto livello) +- Check generic (block 80, tab, lowercase, nested parens, comment 32) NON applicati a Fagor + +## Funzioni non supportate via FTP + +- `ReadActiveProgramAsync` — richiede DNC/OPC-UA +- `SelectMainProgramAsync` — richiede DNC +- `ReadAsync` ritorna `MachineSnapshot` con valori `Unknown` + +## Variabili d'ambiente test integration + +- `FAGOR_TEST_IP` — indirizzo IP macchina (test skippato se assente) +- `FAGOR_USER` — username FTP (default `user`) +- `FAGOR_PASS` — password FTP (default `pass`) diff --git a/.paul/phases/16-fagor-ftp/16-01-SUMMARY.md b/.paul/phases/16-fagor-ftp/16-01-SUMMARY.md new file mode 100644 index 0000000..0a8487d --- /dev/null +++ b/.paul/phases/16-fagor-ftp/16-01-SUMMARY.md @@ -0,0 +1,28 @@ +# Phase 16-01 — Summary + +**Status:** Complete +**Completed:** 2026-05-25 + +## Risultato + +Supporto Fagor CNC via FTP integrato in `NcProgramManager`. Pattern Siemens/Mitsubishi riutilizzato 1:1 con adattamenti per `ProgramExtension` configurabile. Validator refactored con `IsRestrictiveDialect()` helper per gating per-produttore. + +## Decisioni chiave + +1. Check generic (block 80, tab, lowercase, nested parens, comment 32) applicati solo a Fanuc+Mitsubishi. Heidenhain/Siemens/Fagor esentati. Refactor immediato. +2. Modelli 8025-8050 e 8055 base esclusi (solo RS232, modulo seriale non implementato). Documentato in README. +3. Default `ProgramDirectory = /Users/Prg/`, `ProgramExtension = .nc` per Fagor 8060/8065/8070. Configurabili tramite `FagorConnectionConfig`. +4. Nessun `FagorFtpStub` dedicato — riusato `FtpServerStub` generico esistente per round-trip integration test. +5. Validator nome Fagor: max 24 char, no `ñ`, solo lettere/cifre/spazi (verificato da manuali Fagor online). + +## Test coverage + +- 12 unit test su `FagorMachine` (10 con mock + 2 con validator reale) +- 5 integration test stub-based + 1 hardware skip +- 8 unit test nuovi su validator Fagor +- 3 test esistenti aggiornati per refactor gating (Siemens → Fanuc) + +## Issue follow-up potenziali + +- ISS-009 candidate: monitoraggio falsi positivi validator su produttori esentati (Heidenhain/Siemens/Fagor). Da aprire se field reports si lamentano. +- ISS-010 candidate: `ProgramExtension` `.nc` non verificato vs `.pim`/`.pit` su tutti i firmware Fagor 8055/8060. diff --git a/.paul/phases/16-fagor-ftp/16-02-PLAN.md b/.paul/phases/16-fagor-ftp/16-02-PLAN.md new file mode 100644 index 0000000..fb723ff --- /dev/null +++ b/.paul/phases/16-fagor-ftp/16-02-PLAN.md @@ -0,0 +1,56 @@ +# Phase 16-02 — Fagor Fixup (Post-Review) + +## Origine + +Code review post-implementazione v0.6 Fagor Support ha identificato: + +**Critical:** +1. `NcProgramValidator` case Fagor rifiuta `.` nel nome → default `ProgramExtension = ".nc"` contraddice regola validator +2. (Pre-existing, deferito) `Program.Invia` accoppia `FanucProgram` parsing a tutti i produttori + +**Major:** +1. (Deferito) `ResolvePath` NRE su null folder +2. (Deferito) Validator riceve `path` se `program.Name` null +3. `CncMachineFactoryTests` manca case Fagor +4. Behavior change Heidenhain/Siemens (esenzione check generic) non lockato in test +5. Letterali `ñ` in `NcProgramValidator.cs` rischio codepage Windows non-UTF8 + +## Scope + +Fix immediato per: +- Critical #1 — bug introdotto v0.6 +- Major #3 — test mancante +- Major #4 — lock comportamento con test +- Major #5 — escape `ñ` → `ñ` + +Deferiti a ISS: +- Critical #2 → ISS-013 +- Major #1 → ISS-014 +- Major #2 → ISS-016 + +## Tasks + +1. Riscrittura case Fagor in `ValidateName`: split stem/extension, whitelist su stem +2. Escape `'ñ'` → `'ñ'` (codice + messaggio errore) +3. 4 nuovi test Fagor coverage estensioni +4. 6 nuovi test lock Siemens/Heidenhain +5. `Create_Fagor_ReturnsFagorMachine` in `CncMachineFactoryTests` +6. ISSUES.md updated con ISS-012..ISS-017 + +## Files modificati + +- `Cnc/NcProgramValidator.cs` +- `NcProgramManager.Tests/Unit/NcProgramValidatorTests.cs` +- `NcProgramManager.Tests/Unit/CncMachineFactoryTests.cs` +- `.paul/ISSUES.md` +- `.paul/STATE.md` +- `.paul/ROADMAP.md` +- `.paul/paul.json` +- `.paul/phases/16-fagor-ftp/16-02-PLAN.md` (questo file) +- `.paul/phases/16-fagor-ftp/16-02-SUMMARY.md` + +## Vincoli + +- Nessuna modifica `.csproj` (file già listati in v0.6 16-01) +- Pattern Siemens preservato come reference (no cross-impact) +- Tests esistenti pre-refactor preservati o migrati esplicitamente diff --git a/.paul/phases/16-fagor-ftp/16-02-SUMMARY.md b/.paul/phases/16-fagor-ftp/16-02-SUMMARY.md new file mode 100644 index 0000000..c1edd02 --- /dev/null +++ b/.paul/phases/16-fagor-ftp/16-02-SUMMARY.md @@ -0,0 +1,39 @@ +# Phase 16-02 — Summary + +**Status:** Complete +**Completed:** 2026-05-25 + +## Risultato + +Critical bug Fagor name validator vs `.nc` extension risolto. `ñ` literal escapato. Behavior change Siemens/Heidenhain lockato con 6 test nuovi. Factory test Fagor aggiunto. + +## Issue identificati ma deferiti (ISS-012..ISS-017) + +| ID | Tema | Effort | +|----|------|--------| +| ISS-012 | Fagor `ReadActiveProgramAsync`/`SelectMainProgram` non implementate | Substantial | +| ISS-013 | `Program.Invia` accoppia `FanucProgram` a tutti i produttori | Medium 1-2h | +| ISS-014 | `ResolvePath` null-folder NRE pattern condiviso | Quick 10min | +| ISS-015 | Source file encoding rischio codepage Windows | Medium | +| ISS-016 | Validator riceve `path` se `program.Name` null | Quick | +| ISS-017 | `FagorFtpClient.Ping` swallow senza log | Quick | + +## Test coverage v0.6 finale + +- 12 unit test `FagorMachine` (10 mock + 2 validator reale) +- 6 integration test Fagor (5 stub + 1 hardware skip) +- 12 nuovi unit test `NcProgramValidator` Fagor (8 originali + 4 fixup) +- 6 nuovi unit test lock Siemens/Heidenhain +- 1 test factory Fagor +- 3 test pre-existing migrati Siemens→Fanuc (16-01) + +## Build verification + +Non eseguita in ambiente Linux (no dotnet toolchain). Compilazione e run test richiede ambiente Windows con MSBuild/VS o `dotnet build`. Sintassi C# 7.3 verificata manualmente. + +## Decisioni chiave + +1. Nome Fagor: stem alphanumerico + estensione separata. Default `.nc` compatibile. +2. `ñ` escape su tutti i sorgenti per `ñ` (codice + test + messaggi) +3. Behavior change validator gating Siemens/Heidenhain confermato come voluto. Lockato con 6 test esplicit. +4. CLI bug Fanuc-parsing (Critical #2) deferito a ISS-013 — pre-existing, non Fagor-specific, fix in phase separata.