fix(profile): complete calibration identity and profile resolution (#83) #99

Merged
gronod merged 1 commits from feat/83-calibration-profile-contracts into milestone/m8-consolidation 2026-09-11 11:24:42 +01:00
Owner

Summary

Phase 3 of the M8 consolidation plan — completes the calibration identity and profile-resolution contracts.

Calibration identity (CalibrationIdentity.parse)

  • An empty live basename now always produces an empty identity, regardless of any non-empty persisted calibrationOriginalBasename — an empty original must never invent or resurrect a target.
  • Persisted-original precedence is retained strictly when the live basename carries the CAL_ prefix (Force Quit restoration contract, #29).
  • All CAL_ logic remains encapsulated in CalibrationIdentity; no second hasPrefix("CAL_") ternary exists elsewhere.

Profile resolution (ArtefactProbe.resolveProfile(_:))

  • Extension flipping is now restricted strictly to .icc <-> .icm. Missing URLs with unrelated extensions (.mpp, .txt, ...) are returned unchanged — never rewritten.
  • Explicit-existing URL wins immediately, before any probing or sibling flipping.
  • Basename probe precedence unchanged: .icm first, then .icc; neither -> nil.

Tests

  • New focused suite Tests/ICCeryCoreTests/CalibrationIdentityTests.swift (extracted from JSONFileStoreTests): standard live basename, CAL_ live, persisted-precedence, empty-live + non-empty persisted (asserts empty identity), already-prefixed inputs, and ProcessID.targen == targen_CAL_foo.
  • ArtefactProbeProfileTests expanded to the full basename-probe and explicit-URL matrices.
  • ArgyllRunnerCalibrationTests now asserts calibration targen from foo creates CAL_foo.ti1 and runs under process id targen_CAL_foo (observed via the ProcessManager event bus).
  • WizardCalibrationSessionTests covers Force Quit launch restore: original basename, profile mode, and generate stage all preserved.

Gate

xcodebuild test -scheme ICCery -destination 'platform=macOS' -only-testing:ICCeryCoreTests/CalibrationIdentityTests -only-testing:ICCeryCoreTests/ArtefactProbeProfileTests -only-testing:ICCeryCoreTests/WizardCalibrationSessionTests -only-testing:ICCeryCoreTests/ArgyllRunnerCalibrationTests -only-testing:ICCeryUITests/Milestone6CalibrationUITestsTEST SUCCEEDED (27 core tests + Milestone 6 calibration UI flow, 0 failures).

Refs #83

## Summary Phase 3 of the M8 consolidation plan — completes the calibration identity and profile-resolution contracts. ### Calibration identity (`CalibrationIdentity.parse`) - An **empty live basename now always produces an empty identity**, regardless of any non-empty persisted `calibrationOriginalBasename` — an empty original must never invent or resurrect a target. - Persisted-original precedence is retained **strictly** when the live basename carries the `CAL_` prefix (Force Quit restoration contract, #29). - All `CAL_` logic remains encapsulated in `CalibrationIdentity`; no second `hasPrefix("CAL_")` ternary exists elsewhere. ### Profile resolution (`ArtefactProbe.resolveProfile(_:)`) - Extension flipping is now restricted strictly to `.icc` <-> `.icm`. Missing URLs with unrelated extensions (`.mpp`, `.txt`, ...) are returned unchanged — never rewritten. - Explicit-existing URL wins immediately, before any probing or sibling flipping. - Basename probe precedence unchanged: `.icm` first, then `.icc`; neither -> `nil`. ### Tests - New focused suite `Tests/ICCeryCoreTests/CalibrationIdentityTests.swift` (extracted from `JSONFileStoreTests`): standard live basename, `CAL_` live, persisted-precedence, empty-live + non-empty persisted (asserts empty identity), already-prefixed inputs, and `ProcessID.targen` == `targen_CAL_foo`. - `ArtefactProbeProfileTests` expanded to the full basename-probe and explicit-URL matrices. - `ArgyllRunnerCalibrationTests` now asserts calibration targen from `foo` creates `CAL_foo.ti1` and runs under process id `targen_CAL_foo` (observed via the `ProcessManager` event bus). - `WizardCalibrationSessionTests` covers Force Quit launch restore: original basename, profile mode, and generate stage all preserved. ### Gate `xcodebuild test -scheme ICCery -destination 'platform=macOS' -only-testing:ICCeryCoreTests/CalibrationIdentityTests -only-testing:ICCeryCoreTests/ArtefactProbeProfileTests -only-testing:ICCeryCoreTests/WizardCalibrationSessionTests -only-testing:ICCeryCoreTests/ArgyllRunnerCalibrationTests -only-testing:ICCeryUITests/Milestone6CalibrationUITests` — **TEST SUCCEEDED** (27 core tests + Milestone 6 calibration UI flow, 0 failures). Refs #83
gronod added this to the M7 — Deduplicate & consolidate (develop) milestone 2026-09-11 11:10:33 +01:00
gronod added the Kind/Enhancement
Priority
High
2
Project/ICCery-v2Feature/Backend
labels 2026-09-11 11:10:33 +01:00
gronod self-assigned this 2026-09-11 11:10:33 +01:00
gronod added 1 commit 2026-09-11 11:10:34 +01:00
Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
gronod merged commit 7751701208 into milestone/m8-consolidation 2026-09-11 11:24:42 +01:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: gronod/iccery-v2-mac#99