{"record":{"id":"48dec5dae4a7c695","repo":"affaan-m/ECC","slug":"genre-genre-slug-has-no-references","errorCode":null,"errorMessage":"genre {genre['slug']} has no references","messagePattern":"genre (.+?) has no references","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"skills/taste-application/scripts/tasteforge/workflow.py","lineNumber":603,"sourceCode":"            path = resolve_input(raw_path)\n            if not path.is_file():\n                raise FileNotFoundError(path)\n            measured, source_bytes, source_digest = _stable_probe(path, probe)\n            source_duration = _validate_probe(measured)\n            ref = {\n                \"genre_number\": genre[\"number\"],\n                \"genre_slug\": genre[\"slug\"],\n                \"path\": str(path),\n                \"bytes\": source_bytes,\n                \"sha256\": source_digest,\n                \"source_duration\": source_duration,\n                \"probe\": measured,\n            }\n            references.append(ref)\n            genre_refs.append(ref)\n\n        if not genre_refs:\n            raise ValueError(f\"genre {genre['slug']} has no references\")\n        total_duration = round(sum(float(ref[\"probe\"].get(\"duration\") or 0) for ref in genre_refs), 6)\n        scene_change_evidence = [{\n            \"sha256\": ref[\"sha256\"],\n            \"source_duration\": ref[\"source_duration\"],\n            \"times\": [float(time) for time in ref[\"probe\"].get(\"scene_changes\", [])],\n        } for ref in genre_refs]\n        scene_changes = [time for item in scene_change_evidence for time in item[\"times\"]]\n        scene_intervals = [\n            later - earlier\n            for earlier, later in zip(scene_changes, scene_changes[1:])  # noqa: RUF007\n        ]\n        style_samples = [\n            sample\n            for ref in genre_refs\n            for sample in ref[\"probe\"].get(\"style_samples\", [])\n        ]\n        luma = [float(sample[\"luma\"]) for sample in style_samples if \"luma\" in sample]\n        saturation = [","sourceCodeStart":585,"sourceCodeEnd":621,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/skills/taste-application/scripts/tasteforge/workflow.py#L585-L621","documentation":"After iterating a genre's references, run_workflow requires that at least one reference successfully resolved and probed (genre_refs non-empty). Since missing files already raise FileNotFoundError, this fires when a genre dict exists but its 'references' list is empty or absent. Every numbered genre must carry at least one reference video.","triggerScenarios":"config['genres'] includes a genre entry whose 'references' key is missing, set to [], or only contains falsy/filtered entries.","commonSituations":"Template config with placeholder genres and no references filled in; a script that appends genres before collecting their reference paths; an edit that accidentally cleared one genre's references.","solutions":["Add at least one valid reference path to the offending genre's 'references' list","Remove the empty genre from config['genres'] if it is not needed","Log/validate each genre's references before calling run_workflow"],"exampleFix":"// before\n{'number': 2, 'slug': 'documentary', 'references': []}\n// after\n{'number': 2, 'slug': 'documentary', 'references': ['/data/refs/doc_reference.mp4']}","handlingStrategy":"validation","validationCode":"bad = [g['slug'] for g in config.get('genres', []) if not g.get('references')]\nif bad:\n    raise ValueError(f'genres without references: {bad}')","typeGuard":"def all_genres_have_references(config) -> bool:\n    return all(bool(g.get('references')) for g in config.get('genres', []))","tryCatchPattern":"try:\n    run_workflow(config, out_dir)\nexcept ValueError as e:\n    if 'has no references' in str(e):\n        print('Fill in or remove the empty genre before running')\n    else:\n        raise","preventionTips":["When generating genres programmatically, only append a genre once its references are collected","Validate per-genre fields with a schema requiring minItems: 1 on references","Audit workflow JSON for empty references arrays before committing it"],"tags":["validation","configuration","empty-list"],"backgroundTag":"empty-required-field","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"}