fix(stage5): harden gamut .gam and profcheck output parsing (#179) #203

Merged
gronod merged 1 commits from fix/179-gamut-profcheck into enh/185-gamut-viewer 2026-09-06 08:53:37 +01:00
Owner

Closes #179.

This branch stacks on enh/185-gamut-viewer and hardens the Stage 5 gamut viewer and profcheck output parsing.

Changes

  • Rewrote parseGamutFile to:
    • support multiple BEGIN_DATA blocks (some Argyll .gam files split faces across sections);
    • strip inline # comments;
    • warn on out-of-bounds CIELAB vertices and malformed lines;
    • return { vertices, faces, warnings }.
  • Hardened profcheck.js report parsing:
    • finds and parses the last valid JSON object containing avg_de, max_de/peak_de, or rms_de;
    • falls back to an expanded set of regex patterns for legacy plain-text profcheck output;
    • appends parser warnings to the process log when metrics cannot be detected.
  • Fixed loadGamutMesh call signature and wrapped the call in try/catch.
  • Added manual .gam parser tests in src/js/gamut_viewer.test.js.
  • Updated AGENTS.md, README.md, and ROADMAP.md.

Verification

  • CARGO_INCREMENTAL=0 cargo test in src-tauri/: 79 passed.
Closes #179. This branch stacks on `enh/185-gamut-viewer` and hardens the Stage 5 gamut viewer and profcheck output parsing. ### Changes - Rewrote `parseGamutFile` to: - support multiple `BEGIN_DATA` blocks (some Argyll `.gam` files split faces across sections); - strip inline `#` comments; - warn on out-of-bounds CIELAB vertices and malformed lines; - return `{ vertices, faces, warnings }`. - Hardened `profcheck.js` report parsing: - finds and parses the last valid JSON object containing `avg_de`, `max_de`/`peak_de`, or `rms_de`; - falls back to an expanded set of regex patterns for legacy plain-text `profcheck` output; - appends parser warnings to the process log when metrics cannot be detected. - Fixed `loadGamutMesh` call signature and wrapped the call in `try/catch`. - Added manual `.gam` parser tests in `src/js/gamut_viewer.test.js`. - Updated `AGENTS.md`, `README.md`, and `ROADMAP.md`. ### Verification - `CARGO_INCREMENTAL=0 cargo test` in `src-tauri/`: 79 passed.
gronod added 1 commit 2026-09-04 01:04:56 +01:00
- Make parseGamutFile support multiple BEGIN_DATA blocks, inline #
  comments, out-of-bounds vertex warnings, and user-visible parser
  warnings (returned in { vertices, faces, warnings }).
- Harden profcheck report parsing: prefer the last JSON object with
  avg_de/max_de/rms_de keys, then fall back to a wider set of regex
  patterns for legacy plain-text output.
- Add parser warnings to the process log when metrics cannot be found.
- Fix loadGamutMesh call signature and add try/catch around gamut load.
- Add manual gamut parser tests in src/js/gamut_viewer.test.js.
- Update AGENTS.md, README.md, and ROADMAP.md.

Generated with Devin
gronod merged commit 827ebc3e0a into enh/185-gamut-viewer 2026-09-06 08:53:37 +01:00
gronod deleted branch fix/179-gamut-profcheck 2026-09-06 08:53:38 +01:00
Sign in to join this conversation.