affaan-m/ECC · error · FileNotFoundError

no style pack ' ' under - run mint.py first

Error message

no style pack '{name}' under {root} - run mint.py first

What it means

`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.

Solutions

  1. Run the pack generator first: `python scripts/mint.py ...` to create the style pack and its manifest.
  2. Verify the expected path exists: `Path(root) / name / 'manifest.json'`; list `root` to see available packs.
  3. Pass the same `root=` used when minting if a custom root was used.
  4. Check pack name spelling and case, especially on case-sensitive filesystems.

Example fix

// before
pack = load('summer-film')   # never minted -> FileNotFoundError
// after
from pathlib import Path
root = Path('packs')
if not (root / 'summer-film' / 'manifest.json').exists():
    subprocess.run(['python', 'scripts/mint.py', '--name', 'summer-film', '--root', str(root)])
pack = load('summer-film', root=root)
Defensive patterns

Strategy: try-catch

Validate before calling

from pathlib import Path
manifest = Path(root) / name / 'manifest.json'
if not manifest.is_file():
    subprocess.run(['python', 'scripts/mint.py', '--name', name, '--root', str(root)])

Type guard

def pack_exists(name: str, root: str | Path) -> bool:
    return (Path(root) / name / 'manifest.json').is_file()

Try / catch

try:
    pack = load(name, root)
except FileNotFoundError as e:
    if 'run mint.py first' in str(e):
        mint_pack(name, root)
        pack = load(name, root)
    else:
        raise

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "Config file not found": what it means and how to fix it in docker-sync, Maven, Vagrant, Turborepo and other tools — this error's family across 60 libraries.

Related errors


AI-assisted analysis of affaan-m/ECC@8321021c54 (2026-09-16). Data as JSON: /api/errors/ce84138f24603042. Report an issue: GitHub.

Appendix: source

Thrown at skills/taste-application/scripts/taste/pack.py:149

        return path

    def read_json(self, path: Path) -> dict:
        if not path.exists():
            return {}
        return json.loads(path.read_text(encoding="utf-8"))

    def archive(self, dest_dir: str | Path = "out") -> Path:
        """Zip the pack so a whole taste can be handed off as one file."""
        dest_dir = Path(dest_dir)
        dest_dir.mkdir(parents=True, exist_ok=True)
        base = dest_dir / f"{self.name}-stylepack"
        return Path(shutil.make_archive(str(base), "zip", root_dir=self.dir))


def load(name: str, root: str | Path = DEFAULT_ROOT) -> StylePack:
    p = StylePack(name=name, root=Path(root))
    if not p.manifest_path.exists():
        raise FileNotFoundError(
            f"no style pack '{name}' under {root} - run mint.py first"
        )
    p.manifest = json.loads(p.manifest_path.read_text(encoding="utf-8"))
    return p


def create(name: str, root: str | Path = DEFAULT_ROOT) -> StylePack:
    return StylePack(name=name, root=Path(root)).ensure()


def list_packs(root: str | Path = DEFAULT_ROOT) -> list[str]:
    root = Path(root)
    if not root.exists():
        return []
    return sorted(d.name for d in root.iterdir() if (d / "pack.json").exists())

View on GitHub (pinned to 8321021c54)