Files
iccery-v2-mac/docs/06-wizard-and-artefacts.md
gronodandDevin <158243242+devin-ai-integration[bot]@users.noreply.github.com> 1d78957d7a feat(project): .icceryproj index over basename and cwd + recipe + last ΔE (#149)
Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-13 11:28:40 +01:00

3.1 KiB
Raw Permalink Blame History

06 — Wizard, artefact gating, resume

Stages

# DOM Unlocked when
0 #stage-cal Always (optional, not in stepper)
1 #stage-1 Always
2 #stage-2 {basename}.ti1 exists
3 #stage-3 .ti1 and .ti2
4 #stage-4 .ti3 exists (imported datasets may skip 12)
5 #stage-5 .ti3 and .icc/.icm

verify_stage_artefacts(cwd, basename) returns { stage1_complete, stage2_complete, stage3_complete, stage4_complete, profile_path }.

Stage 4 is not unlocked by .ti2. Multi-pass averaging deletes the canonical .ti3 after each snapshot (snapshot_ti3) so Stage 4 stays locked until Finish (#109, #110).

wizardState fields

Field Role
currentStage 05
basename run name without extension
cwd working directory
printerName last spooled printer (drift history)
sessionMode "profile" (extensible)
profileBasename may differ after import
noticeTimer banner auto-hide

setTarget(basename, cwd) updates gating. navigateToStage(n) refuses locked stages with a warning banner. Window focus re-runs updateGating (user may have deleted files in Finder/Explorer) (#151).

Resume from existing target (#140)

Stage 1 Open Existing (select_existing_target) filters .ti1/.ti2. parse_ti2_header reads TARGET_INSTRUMENT, NUMBER_OF_SETS, NUMBER_OF_PAGES, sibling .ti1 presence. If .ti2 exists, Stage 3 banner shows "Resumed from .ti2".

CGATS import (#94, #211) can jump to Stage 4/5 with a synthesised .ti3 — must use an open dialog, never save (#211).

Empty cwd (#59)

Never spawn with cwd: "". Initialize from get_default_working_dir (Documents → Home → app data). Disable Generate until basename and directory are set. Display path in #selectedPathDisplay.

Profile extension (#69)

resolve_profile_extension: if only .icm exists, use it; else if .icc exists, use it; else default .icm on Windows, .icc elsewhere. profcheck and iccgamut also swap extension if the requested path is missing.

No "test_target" fallbacks (#60)

A rewrite must not invent default basenames. Later stages stay inert until wizardState.basename is set from a real artefact.

Project file (#149)

A .icceryproj is a JSON index (schema_version 1) over basename + cwd + optional media_recipe_id/preset_id/calibration_url/printer_* + a last_verification ΔE₀₀ snapshot. It is never a second source of truth: opening one writes WizardState and re-runs the same artefact probe window focus uses — if JSON claims Stage 5 but disk stops at .ti2, the stepper follows the disk and the sidebar chip shows projectChipStale with an info banner.

wizard_state.json remains the crash-resume file; there is no auto-save. Recents live in appDataDir/recent_projects.json (cap 20, bookmark + path, corrupt → [] + keep bytes). Save Report… writes {basename}-report.md in cwd atomically. A live CAL_ basename is never persisted — Save resolves the persisted calibrationOriginalBasename or refuses with a banner.