{"record":{"id":"ce84138f24603042","repo":"affaan-m/ECC","slug":"no-style-pack-name-under-root-run-mint-py-first","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-application/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-application/scripts/taste/pack.py#L131-L165","documentation":"`load()` resolves a named StylePack under a root directory and raises a FileNotFoundError when the pack's manifest file is missing. Style packs must be generated first (via mint.py); loading a name that was never minted — or from the wrong root — trips this guard before any JSON is read. The message names the pack and root and explicitly suggests running mint.py.","triggerScenarios":"Calling `load(name, root)` where `<root>/<name>/manifest.json` does not exist — wrong pack name, packs minted under a different root directory, typo in name, or the manifest file was deleted.","commonSituations":"Forgetting to run mint.py after cloning a fresh checkout; using the default root while packs were minted into a custom `root=`; case-sensitivity mismatches on Linux (MyPack vs mypack); renaming packs without re-minting.","solutions":["Run the pack generator first: `python scripts/mint.py ...` to create the style pack and its manifest.","Verify the expected path exists: `Path(root) / name / 'manifest.json'`; list `root` to see available packs.","Pass the same `root=` used when minting if a custom root was used.","Check pack name spelling and case, especially on case-sensitive filesystems."],"exampleFix":"// before\npack = load('summer-film')   # never minted -> FileNotFoundError\n// after\nfrom pathlib import Path\nroot = Path('packs')\nif not (root / 'summer-film' / 'manifest.json').exists():\n    subprocess.run(['python', 'scripts/mint.py', '--name', 'summer-film', '--root', str(root)])\npack = load('summer-film', root=root)","handlingStrategy":"try-catch","validationCode":"from pathlib import Path\nmanifest = Path(root) / name / 'manifest.json'\nif not manifest.is_file():\n    subprocess.run(['python', 'scripts/mint.py', '--name', name, '--root', str(root)])","typeGuard":"def pack_exists(name: str, root: str | Path) -> bool:\n    return (Path(root) / name / 'manifest.json').is_file()","tryCatchPattern":"try:\n    pack = load(name, root)\nexcept FileNotFoundError as e:\n    if 'run mint.py first' in str(e):\n        mint_pack(name, root)\n        pack = load(name, root)\n    else:\n        raise","preventionTips":["Run mint.py as a documented setup step before any grading","Use one canonical packs root shared across scripts","Validate pack names against a directory listing at CLI level","Watch for case-sensitive filesystems when naming packs"],"tags":["file-not-found","config","style-pack","manifest"],"backgroundTag":"config-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"}