affaan-m/ECC · error · FileNotFoundError

no style pack at - expected a pack.json manifest

Error message

no style pack at {sp.dir} - expected a pack.json manifest

What it means

pack.load() wraps a directory as a StylePack and requires a pack.json manifest inside it. If the manifest file does not exist, it raises FileNotFoundError describing the directory and the expected manifest name, failing closed rather than returning an empty pack.

Solutions

  1. Verify the directory exists and contains pack.json (ls the directory)
  2. Run the pack creation/save step (e.g. distill or init workflow) to generate the manifest before loading
  3. Correct the path to point at the actual pack directory, not its parent

Example fix

// before
pack = load("styles/my-pack")  # no pack.json inside
// after
assert Path("styles/my-pack/pack.json").is_file(), "run distill first"
pack = load("styles/my-pack")
Defensive patterns

Strategy: try-catch

Validate before calling

from pathlib import Path
p = Path(pack_dir)
if not (p / "pack.json").is_file():
    raise SystemExit(f"{p} is not a style pack (missing pack.json)")

Try / catch

try:
    sp = pack.load(path)
except FileNotFoundError as e:
    print(f"Style pack missing: {e}. Run the distill/init step first.")

Prevention

When it happens

Trigger: Calling load("path/to/pack") where path/to/pack/pack.json is absent — the directory does not exist, or the pack was created without writing its manifest, or the user pointed at a parent/child directory by mistake.

Common situations: Typo in the pack directory name; pointing at a freshly scaffolded directory before init/save wrote pack.json; unpacking an archive that omitted hidden or top-level files; passing the styles root instead of a single pack directory.

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/863be9c5741e2c91. Report an issue: GitHub.

Appendix: source

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

                for k in ("mean_shot", "median_shot", "cuts_per_min",
                          "rhythm_variance", "n_shots", "fps",
                          "total_duration")
            } if cadence else {},
            "validation": {"status": status, "errors": errors, "warnings": warnings},
        }

    @staticmethod
    def _check(label: str, payload: dict, schem: dict, errors: list[str]) -> None:
        problems = schema.validate(payload, schem)
        for p in problems:
            errors.append(f"{label}: {p}")


def load(path: str | Path) -> StylePack:
    """Load a pack directory; raises if no manifest exists."""
    sp = StylePack(Path(path))
    if not sp.manifest_path.exists():
        raise FileNotFoundError(
            f"no style pack at {sp.dir} - expected a pack.json manifest"
        )
    try:
        sp.manifest = json.loads(sp.manifest_path.read_text(encoding="utf-8"))
    except json.JSONDecodeError as exc:
        sp.manifest = {}
        sp.problems.append(f"pack.json: {exc}")
    return sp

View on GitHub (pinned to 8321021c54)