{"record":{"id":"98f9c28cf3961673","repo":"abhigyanpatwari/GitNexus","slug":"flag-must-name-a-nonblank-versioned-model","errorCode":null,"errorMessage":"{flag} must name a nonblank, versioned model","messagePattern":"(.+?) must name a nonblank, versioned model","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/runner_tasks.py","lineNumber":19,"sourceCode":"\"\"\"Model and immutable task-binding validation for workflow benchmarks.\"\"\"\n\nfrom __future__ import annotations\n\nimport hashlib\nimport re\nfrom collections.abc import Mapping\nfrom pathlib import Path\nfrom typing import Any\n\nfrom .oracle_assets import TaskOracleSnapshot, capture_task_oracles, validate_oracle_declaration\nfrom .process_control import run_checked, run_managed\nfrom .task_assets import TaskAssetCache, capture_task_dependency_binding\n\n\ndef normalized_model_identifier(value: str | None, *, flag: str = \"--model\") -> str:\n    model = (value or \"\").strip()\n    if not model:\n        raise ValueError(f\"{flag} must name a nonblank, versioned model\")\n    if re.search(r\"(?:^|[-/@:])(?:auto|latest)$\", model.casefold()):\n        raise ValueError(f\"{flag} must not use a mutable auto/latest model alias: {model!r}\")\n    return model\n\n\ndef select_tasks(tasks: list[Any], *, include_expensive: bool) -> tuple[list[dict[str, Any]], list[str]]:\n    \"\"\"Validate task metadata and filter opt-in expensive scenarios.\"\"\"\n\n    selected: list[dict[str, Any]] = []\n    skipped: list[str] = []\n    seen: set[str] = set()\n    required_strings = (\"id\", \"class\", \"repo\", \"prompt\", \"verify\")\n    optional_strings = (\"ref\", \"setup\")\n    for index, raw_task in enumerate(tasks):\n        if not isinstance(raw_task, Mapping):\n            raise ValueError(f\"task {index} must be a mapping\")\n        task = dict(raw_task)\n        for field in required_strings:","sourceCodeStart":1,"sourceCodeEnd":37,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/runner_tasks.py#L1-L37","documentation":"Thrown by normalized_model_identifier when the model string passed via --model (or equivalent) is empty after stripping whitespace. The benchmark requires a pinned, reproducible model identity, so a blank value (None, '', or whitespace-only) is rejected up front rather than silently falling back to a default.","triggerScenarios":"normalized_model_identifier(None) or normalized_model_identifier('   ') — value is None or strips to empty. The caller passed no --model flag or an empty string.","commonSituations":"The CLI was invoked without --model; the model came from an env var that was unset; a wrapper script forwarded an empty model arg; a config file had a blank model field.","solutions":["Pass an explicit, versioned model id to --model, e.g. 'claude-sonnet-4-5'.","If reading from an env var, fail fast with a clear message when it is unset rather than passing ''.","Set a required-model check in your wrapper before invoking the harness.","Audit config files for blank/missing model fields."],"exampleFix":"// before\nmodel = os.environ.get('MODEL')  # unset -> None -> raises\nnormalized_model_identifier(model)\n\n// after\nmodel = os.environ['MODEL']  # KeyError makes the missing var obvious\n# or\nmodel = os.environ.get('MODEL') or 'claude-sonnet-4-5'\nnormalized_model_identifier(model)","handlingStrategy":"validation","validationCode":"def is_nonblank_model(value: str | None) -> bool:\n    return isinstance(value, str) and bool(value.strip())","typeGuard":"def is_nonblank_model(value: str | None) -> bool:\n    return isinstance(value, str) and bool(value.strip())","tryCatchPattern":"try:\n    model = normalized_model_identifier(value)\nexcept ValueError as e:\n    if 'nonblank, versioned model' in str(e):\n        # supply an explicit versioned model id\n        raise\n    raise","preventionTips":["Always pass an explicit versioned model id to --model.","Fail fast in wrappers when a model env var is unset instead of forwarding ''.","Add is_nonblank_model checks in config loaders.","Treat a blank model field as a config bug."],"tags":["validation","model-config","reproducibility","workflow-bench"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}