Single CalibrationIdentity and one .icc/.icm resolver
#83
Notifications
Due Date
No due date set.
Depends on
Reference: gronod/iccery-v2-mac#83
Reference in New Issue
Block a user
Summary
The
CAL_basename policy is implemented in three places and can disagree after Force Quit:WizardViewModellaunch restore /enterCalibration/restoreCalibrationCalibrationViewModel.calBasename+ generate snapshotArgyllRunner.runCalibrationTargen/runPrintcal(hasPrefix("CAL_") ? x : "CAL_\(x)")Profile extension swap (#69) is also duplicated:
ArtefactProbe.resolveProfile(basename:cwd:)(.icmwins over.icc)ArgyllRunner.resolveProfileForVerification(flip extension if the given URL is missing)Spec refs
docs/07-stage0-calibration.md, issue 29docs/06-wizard-and-artefacts.md(#60 basename, #59 cwd)calibrationOriginalBasenameScope
In
Packages/ICCeryCore/Sources/ICCeryCore/Profile/CalibrationIdentity.swift(name flexible):Rules:
prefixis the only place that addsCAL_.parseifliveBasenamealready hasCAL_andpersistedOriginalis non-empty → use persisted original (Force Quit path, issue 29).CAL_*and persisted original is empty → strip the prefix (current CalibrationViewModel fallbackdropFirst(4)).CAL_+ live."target"(#60).Wire:
WizardViewModelinit restore usesCalibrationIdentity.parse.CalibrationViewModelusesidentity.calibrationBasenamefor.ti3/.calURLs and passesoriginalBasenameintoCalibrationTargenConfig.basename(runner may still prefix — after this ticket the runner must callCalibrationIdentity.prefixinstead of its own ternary).ArgyllRunner.runCalibrationTargen/runPrintcalcallCalibrationIdentity.prefix.ArtefactProbe.resolveProfile(_ url: URL) -> URL(and keep basename+cwd wrapper):urlexists, return it..icc↔.icm..icmwins if both exist (currentresolveProfile(basename:cwd:)).ArgyllRunner.resolveProfileForVerification;runProfcheckuses the probe.Out
CAL_(existing wizard guard stays).Full solution
calibrationOriginalBasename+ livebasenameas today; identity is derived, not a new JSON key.runCalibrationTargenprocess id staystargen_{CAL_stem}so a profiletargenand a caltargencannot collide (#116).CAL_foo.ti1next tofoo.ti1must keep working.Rewrite invariants
sessionMode = .profile, stage.generatewhen that is whatdevelopdoes today — do not “helpfully” stay on Stage 0 if the current init explicitly leaves it..icmpreferred when probing by basename; explicit URL that exists wins even if the other extension is also present.PrinttargArgsalready skips-K/-IforCAL_basenames).Dependencies
Blocks-on: ArgyllRunner streaming-loop ticket (touch
runCalibrationTargen/runPrintcalafter that extract so the prefix call is one line in a thin wrapper).Unblocks: none.
Test
Tests/ICCeryCoreTests/CalibrationIdentityTests.swift:foo, persisted""→ originalfoo, calCAL_fooCAL_foo, persistedfoo→ originalfooCAL_foo, persisted""→ originalfooCAL_foo, persistedbar→ originalbar(persisted wins; document this)WizardCalibrationSessionTests.swiftfor launch restore using the identity helper.ArgyllRunnerCalibrationTests.swift: passing basenamefoostill expects artefactCAL_foo.ti1/ process idtargen_CAL_foo.ArtefactFilesTests.swift/ probe tests:.iccexists.icmexists.icmfor basename probe.iccbut sibling.icmexists → returns.icmMilestone6CalibrationUITests.swift: generate wedge still advances to layout; compute curves still restores original basename.Acceptance criteria
hasPrefix("CAL_")ternary outsideCalibrationIdentity.ArgyllRunner.Implementation originally landed in stacked commit
d4261bavia PR #87.Completion/verification landed in PR #99 at
c539507.Acceptance evidence:
[x] Restricted ArtefactProbe profile URL flipping strictly to .icc <-> .icm; unrelated extensions unmodified.
[x] Existing explicit URLs take precedence over sibling probe resolution.
[x] Empty live basename produces empty CalibrationIdentity (no resurrecting persisted original).
[x] targen_CAL_ process ID contract asserted.
Verification at milestone/m8-consolidation
891a504ee7:targeted suites: passed (28 tests)
full universal ICCeryCoreTests: 339 passed, 0 failed
full ICCeryUITests: 29 passed, 0 failed
Closing manually after code and tests are present on the milestone branch.