{"record":{"id":"2a77308f7fbdd895","repo":"affaan-m/ECC","slug":"no-style-pack-name-under-root-run-mint-py-first-2a7730","errorCode":null,"errorMessage":"no style pack '{name}' under {root} - run mint.py first","messagePattern":"no style pack '(.+?)' under (.+?) - run mint\\.py first","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"skills/taste-distillation/scripts/taste/pack.py","lineNumber":149,"sourceCode":"        return path\n\n    def read_json(self, path: Path) -> dict:\n        if not path.exists():\n            return {}\n        return json.loads(path.read_text(encoding=\"utf-8\"))\n\n    def archive(self, dest_dir: str | Path = \"out\") -> Path:\n        \"\"\"Zip the pack so a whole taste can be handed off as one file.\"\"\"\n        dest_dir = Path(dest_dir)\n        dest_dir.mkdir(parents=True, exist_ok=True)\n        base = dest_dir / f\"{self.name}-stylepack\"\n        return Path(shutil.make_archive(str(base), \"zip\", root_dir=self.dir))\n\n\ndef load(name: str, root: str | Path = DEFAULT_ROOT) -> StylePack:\n    p = StylePack(name=name, root=Path(root))\n    if not p.manifest_path.exists():\n        raise FileNotFoundError(\n            f\"no style pack '{name}' under {root} - run mint.py first\"\n        )\n    p.manifest = json.loads(p.manifest_path.read_text(encoding=\"utf-8\"))\n    return p\n\n\ndef create(name: str, root: str | Path = DEFAULT_ROOT) -> StylePack:\n    return StylePack(name=name, root=Path(root)).ensure()\n\n\ndef list_packs(root: str | Path = DEFAULT_ROOT) -> list[str]:\n    root = Path(root)\n    if not root.exists():\n        return []\n    return sorted(d.name for d in root.iterdir() if (d / \"pack.json\").exists())\n","sourceCodeStart":131,"sourceCodeEnd":165,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/skills/taste-distillation/scripts/taste/pack.py#L131-L165","documentation":"pack.load constructs a StylePack for the given name/root and requires its manifest file to exist; if manifest_path is missing it raises FileNotFoundError telling you to run mint.py first. The manifest is the pack's source of truth (LUT paths, parameters), so a pack without one is considered not minted at all. The root defaults to DEFAULT_ROOT but is user-suppliable.","triggerScenarios":"load('packname') where: mint.py was never run for that name, the name is misspelled or differs in case, root points at a different directory than where the pack was minted, or the manifest json was deleted/moved while the pack folder still exists.","commonSituations":"Sharing packs by copying only the .cube files and forgetting the manifest json; running scripts from another cwd with a relative root; renaming a pack folder by hand so the name no longer matches; a crashed mint.py run that created a partial directory without a manifest.","solutions":["Run mint.py with the same name/root to mint the pack: python mint.py --name <name> (check mint.py's CLI for exact flags).","Verify the expected manifest path on disk (e.g. ls <root>/<name>/manifest.json) and fix the name argument to match exactly, including case.","Pass the correct root explicitly: load(name, root='/path/to/packs') if packs live outside DEFAULT_ROOT.","If only the manifest is missing, restore it from version control or regenerate the pack; a directory without a manifest is treated as nonexistent by design.","Wrap in try/except FileNotFoundError to print a helpful hint listing available packs under root."],"exampleFix":"// before\npack = pack.load('teal_orange')  # FileNotFoundError: no style pack 'teal_orange' ... run mint.py first\n// after\nfrom pathlib import Path\nroot = Path('packs')\nif not (root / 'teal_orange' / 'manifest.json').exists():\n    subprocess.run(['python', 'mint.py', '--name', 'teal_orange', '--root', str(root)], check=True)\npack = pack.load('teal_orange', root=root)","handlingStrategy":"validation","validationCode":"from pathlib import Path\nroot = Path(root_arg)\nmanifest = root / name / 'manifest.json'\nif not manifest.is_file():\n    available = [d.name for d in root.iterdir() if d.is_dir()] if root.is_dir() else []\n    raise SystemExit(f'pack {name!r} not minted; available: {available} (run mint.py)')","typeGuard":null,"tryCatchPattern":"try:\n    pack = pack.load(name, root=root)\nexcept FileNotFoundError as e:\n    logger.warning('style pack missing, minting now: %s', e)\n    subprocess.run(['python', 'mint.py', '--name', name, '--root', str(root)], check=True)\n    pack = pack.load(name, root=root)","preventionTips":["Treat the manifest json as part of the pack - copy it together with the LUTs when sharing.","Keep packs under one constant root and reference them by that root, never by cwd-relative paths.","Never rename pack directories manually; re-mint under the new name instead.","Add a startup check in batch scripts that every requested pack's manifest exists before processing."],"tags":["file-io","config","workflow","path"],"backgroundTag":"file-not-found","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}