Wizard state machine & artefact gating #4

Closed
opened 2026-09-08 17:39:06 +01:00 by gronod · 0 comments
Owner

Summary

WizardState + verifyStageArtefacts. Navigation is disk, not buttons.

Spec refs

docs/06-wizard-and-artefacts.md, 02-architecture.md. #60 #151 #59 #109 #110 #69.

Scope

In: state, gating, basename sanitise, cwd fallback, focus revalidate.
Out: Stage 0 UI (issue 29), CGATS jump (issue 30) — but leave hooks.

Implementation notes

Fields: currentStage (0–5), basename, cwd, printerName, sessionMode (profile | calibration), profileBasename.
Gates:

  • 1 always
  • 2 if {basename}.ti1
  • 3 if .ti1 AND .ti2
  • 4 if .ti3 exists (canonical accepted measurement)
  • 5 if .ti3 AND .icc|.icm
    Stage 4 is NOT unlocked by .ti2. Forward gated; backward always. Re-validate on window focus and stage entry.
    Basename: reject /, \, ... No placeholder "test_target".
    Empty cwd illegal → Documents → Home → app-data (~/Library/Application Support/com.gronod.iccery2).
    getProfilePath: existing .icm if .icc missing, else .icc (macOS default .icc).

Rewrite invariants

#60 no placeholders. #151 deleted files re-lock. #59 empty cwd. #109/#110 .ti3 means accepted. #69 probe both extensions.

Dependencies

Blocks-on: 1.
Unblocks: 7, 8, 21, 30.

Test

  • CI/mock: gating matrix; focus re-lock after deleting .ti2; Stage 4 stays locked on .ti2 only; empty cwd refused.
  • Hardware: N/A.

Acceptance criteria

  • Finder create/delete of artefacts locks/unlocks on focus.
  • Unit tests cover the matrix.
## Summary `WizardState` + `verifyStageArtefacts`. Navigation is disk, not buttons. ## Spec refs docs/06-wizard-and-artefacts.md, 02-architecture.md. #60 #151 #59 #109 #110 #69. ## Scope In: state, gating, basename sanitise, cwd fallback, focus revalidate. Out: Stage 0 UI (issue 29), CGATS jump (issue 30) — but leave hooks. ## Implementation notes Fields: `currentStage` (0–5), `basename`, `cwd`, `printerName`, `sessionMode` (`profile` | `calibration`), `profileBasename`. Gates: - 1 always - 2 if `{basename}.ti1` - 3 if `.ti1` AND `.ti2` - 4 if `.ti3` exists (canonical accepted measurement) - 5 if `.ti3` AND `.icc`|`.icm` Stage 4 is NOT unlocked by `.ti2`. Forward gated; backward always. Re-validate on window focus and stage entry. Basename: reject `/`, `\`, `..`. No placeholder `"test_target"`. Empty cwd illegal → Documents → Home → app-data (`~/Library/Application Support/com.gronod.iccery2`). `getProfilePath`: existing `.icm` if `.icc` missing, else `.icc` (macOS default `.icc`). ## Rewrite invariants #60 no placeholders. #151 deleted files re-lock. #59 empty cwd. #109/#110 `.ti3` means accepted. #69 probe both extensions. ## Dependencies Blocks-on: 1. Unblocks: 7, 8, 21, 30. ## Test - CI/mock: gating matrix; focus re-lock after deleting `.ti2`; Stage 4 stays locked on `.ti2` only; empty cwd refused. - Hardware: N/A. ## Acceptance criteria - [ ] Finder create/delete of artefacts locks/unlocks on focus. - [ ] Unit tests cover the matrix.
gronod added this to the M1 — Foundation & process core milestone 2026-09-08 17:39:06 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: gronod/iccery-v2-mac#4