{"record":{"id":"daac83ca63629f69","repo":"affaan-m/ECC","slug":"workflow-schema-version-must-be-1","errorCode":null,"errorMessage":"workflow schema_version must be 1","messagePattern":"workflow schema_version must be 1","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"skills/taste-application/scripts/tasteforge/workflow.py","lineNumber":537,"sourceCode":"        },\n    }\n\n\ndef run_workflow(config_path: str | Path, out_dir: str | Path, *, probe: Probe | None = None) -> dict[str, Any]:\n    \"\"\"Execute the deterministic offline contract and return its receipt.\"\"\"\n    config_path = Path(config_path)\n    out_dir = Path(out_dir)\n    config = json.loads(config_path.read_text(encoding=\"utf-8\"))\n    probe = probe or probe_media\n\n    def resolve_input(raw_path: str) -> Path:\n        candidate = Path(raw_path).expanduser()\n        if not candidate.is_absolute():\n            candidate = config_path.parent / candidate\n        return Path(os.path.abspath(candidate))\n\n    if config.get(\"schema_version\") != 1:\n        raise ValueError(\"workflow schema_version must be 1\")\n    if config.get(\"dry_run\", True) is not True:\n        raise ValueError(\"workflow requires dry_run=true; provider execution is disabled\")\n    source_policy = config.get(\"source_availability_policy\", \"allow_unavailable\")\n    if source_policy not in {\"allow_unavailable\", \"require_available\"}:\n        raise ValueError(\"source_availability_policy must be allow_unavailable or require_available\")\n    genres = sorted(config.get(\"genres\", []), key=lambda item: item[\"number\"])\n    if not genres:\n        raise ValueError(\"workflow needs at least one numbered genre\")\n\n    output = _SafeOutput(out_dir)\n    output.prepare((\"genres\", \"manifests\", \"resolve\"))\n\n    references: list[dict[str, Any]] = []\n    specs: list[dict[str, Any]] = []\n    manifests: dict[str, dict[str, Any]] = {\n        modality: {\n            \"schema_version\": 1,\n            \"modality\": modality,","sourceCodeStart":519,"sourceCodeEnd":555,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/skills/taste-application/scripts/tasteforge/workflow.py#L519-L555","documentation":"run_workflow only accepts config documents with schema_version exactly 1. Any other value (missing counts as absent and fails this check too since != 1) is rejected so old or future config formats fail loudly.","triggerScenarios":"A config JSON/YAML passed to run_workflow lacks the \"schema_version\" key or has a value other than 1 (e.g. 2, \"1\").","commonSituations":"Hand-written configs forgetting the field; copying configs from a newer/older tool version; YAML parsing \"1\" as string in some writers.","solutions":["Add \"schema_version\": 1 to the workflow config","If migrating from another schema version, convert the config to the v1 format","Ensure the value is the JSON number 1, not the string \"1\""],"exampleFix":"// before\n{ \"genres\": [ ... ] }\n// after\n{ \"schema_version\": 1, \"genres\": [ ... ] }","handlingStrategy":"validation","validationCode":"if config.get(\"schema_version\") != 1:\n    raise SystemExit(\"config schema_version must be exactly 1 (number, not string)\")","typeGuard":"def is_v1_config(config: dict) -> bool:\n    return config.get(\"schema_version\") == 1 and isinstance(config.get(\"schema_version\"), int)","tryCatchPattern":"try:\n    run_workflow(config)\nexcept ValueError as e:\n    if \"schema_version\" in str(e):\n        config[\"schema_version\"] = 1\n        run_workflow(config)\n    else:\n        raise","preventionTips":["Always include \"schema_version\": 1 when hand-writing configs","Validate configs against a JSON schema before running","Ensure writers emit the integer 1, not the string \"1\""],"tags":["config","schema","validation"],"backgroundTag":"schema-validation-failed","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"}