{"record":{"id":"1739f9aebdec58c6","repo":"affaan-m/ECC","slug":"pack-has-no-measured-cadence-cadence-json-is-missing","errorCode":null,"errorMessage":"pack has no measured cadence (cadence.json is missing)","messagePattern":"pack has no measured cadence \\(cadence\\.json is missing\\)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"skills/taste-application/scripts/tasteforge/apply.py","lineNumber":158,"sourceCode":"    no_repeat: bool = False,\n) -> dict[str, Any]:\n    \"\"\"Plan a cut from the pack's cadence over local media clips.\n\n    With ``no_repeat=True``, normalized source paths are used at most once;\n    insufficient sources or source durations fail instead of repeating clips.\n    Strict plans fill the nearest whole-frame target and never exceed source\n    capacity. Media duration metadata must describe the available source.\n\n    Returns an application report validated against\n    ``schema.APPLICATION_REPORT_SCHEMA``. The report structurally cannot\n    claim a provider run: ``provider`` is enum-locked to ``\"none\"`` and\n    ``dry_run`` to ``true``.\n    \"\"\"\n    if not media:\n        raise ValueError(\"apply_local needs at least one media clip\")\n\n    if not sp.cadence_path.exists():\n        raise ValueError(\"pack has no measured cadence (cadence.json is missing)\")\n    cadence = sp.read_json(sp.cadence_path)\n    if not isinstance(cadence, dict) or not (cadence.get(\"shots\") or \"mean_shot\" in cadence):\n        raise ValueError(\"cadence.json has no measured shots to plan from\")\n    seq_fps = _positive(fps if fps is not None else cadence.get(\"fps\", _DEFAULT_FPS), \"fps\")\n    validated_media = []\n    for clip in media:\n        if not isinstance(clip, dict) or not isinstance(clip.get(\"path\"), (str, Path)):\n            raise ValueError(\"media clips require a local source path\")\n        if not str(clip[\"path\"]).strip():\n            raise ValueError(\"media clips require a local source path\")\n        validated_media.append({**clip, \"duration\": _positive(clip.get(\"duration\"), \"media duration\")})\n    target = _positive(duration if duration is not None else sum(\n        c[\"duration\"] for c in validated_media\n    ), \"target duration\")\n    planned = plan_shots(cadence, target)\n    assignments = _strict_assign(planned, validated_media, target, seq_fps) if no_repeat else [\n        (validated_media[i % len(validated_media)], max(1, timeline.seconds_to_frames(d, seq_fps)))\n        for i, d in enumerate(planned)","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/skills/taste-application/scripts/tasteforge/apply.py#L140-L176","documentation":"apply_local refuses to run when the style pack's cadence.json file does not exist at sp.cadence_path. The library plans shot durations from measured cadence data, so without this file there is nothing deterministic to plan from. It fails fast with a ValueError rather than guessing or fabricating timing data.","triggerScenarios":"Calling apply_local(sp, media=[...]) when the StylePack's cadence_path does not point to an existing cadence.json — e.g. the pack was never through the measure/forge step, or the pack directory was partially copied.","commonSituations":"Using a freshly scaffolded style pack before running the cadence measurement step; renaming or moving the pack directory so cadence_path no longer resolves; checking out a repo with the pack's media but not its generated JSON artifacts (gitignored).","solutions":["Run the pack's cadence measurement/build step first so cadence.json is generated at sp.cadence_path.","Verify sp.cadence_path points at the right location (print it and check the file exists).","Re-ingest or rebuild the style pack if the file was lost or the directory was moved.","Use a different, complete style pack that already contains cadence.json."],"exampleFix":"// before\nreport = apply_local(sp, media=clips)  # ValueError: pack has no measured cadence\n\n// after\nif not sp.cadence_path.exists():\n    sp = build_style_pack(...)  # generates cadence.json from measured shots\nreport = apply_local(sp, media=clips)","handlingStrategy":"validation","validationCode":"if not sp.cadence_path.exists():\n    raise FileNotFoundError(f\"build cadence.json first at {sp.cadence_path}\")","typeGuard":"def has_cadence(sp) -> bool:\n    return sp.cadence_path.is_file()","tryCatchPattern":"try:\n    report = apply_local(sp, media=clips)\nexcept ValueError as e:\n    if \"cadence.json is missing\" in str(e):\n        sp = build_style_pack(...)  # regenerate\n        report = apply_local(sp, media=clips)\n    else:\n        raise","preventionTips":["Always run the cadence measurement step before apply_local.","Check sp.cadence_path.exists() in your pipeline's preflight.","Don't gitignore generated cadence.json if packs are shared via VCS."],"tags":["missing-file","style-pack","prerequisite-not-met"],"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"}