Problem
InstanceLibrary.getSingleton declares its folderPath argument with {mustBeFolder}, defaulting to Paths.LocalInstanceFolder, and the class constructor declares the same. On a fresh installation that folder does not exist yet, so the validator rejects the call before the constructor runs:
MATLAB:validators:mustBeFolder
Invalid argument at position 1. These folders do not exist: '.../openMINDS_instances-main/instances'.
The constructor is written for exactly this case: postSetInstanceLibraryLocation downloads the repository when ~isfolder(obj.InstanceLibraryLocation). That branch is unreachable, because the validator runs first. The download only happens today because setup.m calls downloadControlledInstances separately, and an installed toolbox never runs setup.m. A user of the .mltbx whose first call touches controlled instances gets a validation error instead of a download.
Fix
Drop mustBeFolder from both signatures, or validate after the download has had its chance. Since #184 the location is resolved to an absolute path when it is set, so a folder that does not exist yet is a well defined place to download into.
🤖 Generated with Claude Code
Problem
InstanceLibrary.getSingletondeclares itsfolderPathargument with{mustBeFolder}, defaulting toPaths.LocalInstanceFolder, and the class constructor declares the same. On a fresh installation that folder does not exist yet, so the validator rejects the call before the constructor runs:The constructor is written for exactly this case:
postSetInstanceLibraryLocationdownloads the repository when~isfolder(obj.InstanceLibraryLocation). That branch is unreachable, because the validator runs first. The download only happens today becausesetup.mcallsdownloadControlledInstancesseparately, and an installed toolbox never runssetup.m. A user of the .mltbx whose first call touches controlled instances gets a validation error instead of a download.Fix
Drop
mustBeFolderfrom both signatures, or validate after the download has had its chance. Since #184 the location is resolved to an absolute path when it is set, so a folder that does not exist yet is a well defined place to download into.🤖 Generated with Claude Code