fix: unblock Mitsubishi/Fanuc FTP upload (ISS-018, ISS-019, ISS-020) #1

Merged
davide.trentin merged 2 commits from fix/iss-018-019-validator-path into main 2026-06-02 08:17:54 +00:00

What

Field testing against a local docker FTP server surfaced 3 bugs that blocked every Fanuc/Mitsubishi program upload. All fixed + field-verified end-to-end.

  • ISS-018 Validator first-line check read lines[0], but FanucProgram.Standardize() prepends \n -> always failed "First line must be O####". Now scans first non-blank line.
  • ISS-019 Field-test .bat passed -pathprogramma unquoted -> truncated at first space on install paths with spaces. Quoted in all 7 scripts.
  • ISS-020 (Mitsubishi) WriteProgramAsync resolved -path as a directory ("1" -> "1/O0001"), while read used "/PRG/1" -> STOR failed with "unable to connect to remote server". Write now resolves identically to read (per NC Explorer manual IB-1500904: PRG/USER/, no extension). ResolvePath simplified to single-arg.

Tests

  • New unit tests: validator leading-blank regression (Fanuc+Mitsubishi); Mitsubishi write symmetric + roundtrip regression.
  • Field-test suite green: T01 invio 0, T03 gating correct (lowercase/brackets/longblock -204, no_header -202), T07 roundtrip 0/0 with content preserved on the wire.

Still open (logged in .paul/ISSUES.md)

ISS-020 Siemens/Fagor (extension coupling + ISS-013); C5 download wrapper format; ISS-017 wrong-creds diagnostic.

Commits: 85d0b57, 4067366

## What Field testing against a local docker FTP server surfaced 3 bugs that blocked every Fanuc/Mitsubishi program upload. All fixed + field-verified end-to-end. - **ISS-018** Validator first-line check read `lines[0]`, but `FanucProgram.Standardize()` prepends `\n` -> always failed "First line must be O####". Now scans first non-blank line. - **ISS-019** Field-test `.bat` passed `-pathprogramma` unquoted -> truncated at first space on install paths with spaces. Quoted in all 7 scripts. - **ISS-020** (Mitsubishi) `WriteProgramAsync` resolved `-path` as a directory ("1" -> "1/O0001"), while read used "/PRG/1" -> STOR failed with "unable to connect to remote server". Write now resolves identically to read (per NC Explorer manual IB-1500904: PRG/USER/<name>, no extension). `ResolvePath` simplified to single-arg. ## Tests - New unit tests: validator leading-blank regression (Fanuc+Mitsubishi); Mitsubishi write symmetric + roundtrip regression. - Field-test suite green: T01 invio 0, T03 gating correct (lowercase/brackets/longblock -204, no_header -202), T07 roundtrip 0/0 with content preserved on the wire. ## Still open (logged in .paul/ISSUES.md) ISS-020 Siemens/Fagor (extension coupling + ISS-013); C5 download wrapper format; ISS-017 wrong-creds diagnostic. Commits: 85d0b57, 4067366
davide.trentin added 2 commits 2026-06-02 08:13:07 +00:00
ISS-018: FanucProgram.Standardize() prepends a leading '\n' to the
program body, so the O#### header is not on lines[0]. The validator
first-line check read lines[0] and always failed "First line must be
O####", rejecting every valid Fanuc/Mitsubishi upload. Scan the first
non-blank line instead. Upload (FOCAS tape) format unchanged.

ISS-019: field-test .bat files passed -pathprogramma unquoted; on
install paths with spaces ("visual studio prove") cmd split the arg and
ArgParser captured only the first token -> truncated path. Quote the
arg in all 7 scripts.

Add regression test Validate_LeadingBlankLineBeforeONumber for both
Fanuc and Mitsubishi.

Surfaced by field testing against a local docker FTP server.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
WriteProgramAsync resolved -path as a directory and combined it with
program.Name ("1" + "O0001" -> "1/O0001"), while ReadProgramAsync
resolved it as a program identifier under ProgramDirectory ("1" ->
"/PRG/1"). The write target therefore never matched the read target:
STOR went to a nonexistent relative dir and failed with "unable to
connect to remote server" (-204). Surfaced once ISS-018/019 stopped
masking it.

Per Mitsubishi NC Explorer manual IB-1500904, programs live under
PRG/USER and are addressed by their program name/number with no
extension. Resolve write the same way as read: ResolvePath is now
single-arg (path = identifier or full path, joined with
ProgramDirectory). program.Name is used for validation only.

Update write unit test to the symmetric contract and add a roundtrip
regression test (-path "1" -> /PRG/1).

Siemens/Fagor share the pattern but tie extension handling to name
(entangled with ISS-013); left open in ISS-020.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
davide.trentin merged commit f1aa002297 into main 2026-06-02 08:17:54 +00:00
davide.trentin deleted branch fix/iss-018-019-validator-path 2026-06-02 08:17:54 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: davide.trentin/nc_program_manager#1
No description provided.