{"record":{"id":"0acea47c805fd2a1","repo":"abhigyanpatwari/GitNexus","slug":"oracle-snapshot-count-does-not-match-selected-task","errorCode":null,"errorMessage":"oracle snapshot count does not match selected tasks","messagePattern":"oracle snapshot count does not match selected tasks","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/runner_tasks.py","lineNumber":112,"sourceCode":"        **dependency_binding,\n        **oracle_snapshot.binding,\n    }\n\n\ndef resolve_task_bindings(\n    tasks: list[dict[str, Any]],\n    expected: list[dict[str, Any]] | None = None,\n    *,\n    oracle_snapshots: list[TaskOracleSnapshot] | None = None,\n    task_asset_cache: TaskAssetCache | None = None,\n) -> list[dict[str, Any]]:\n    \"\"\"Resolve each repo/ref once and optionally honor an upstream immutable pin.\"\"\"\n\n    if expected is not None and len(expected) != len(tasks):\n        raise ValueError(\"task binding count does not match selected tasks\")\n    snapshots = oracle_snapshots if oracle_snapshots is not None else capture_task_oracles(tasks)\n    if len(snapshots) != len(tasks):\n        raise ValueError(\"oracle snapshot count does not match selected tasks\")\n    bindings: list[dict[str, Any]] = []\n    for index, (task, oracle_snapshot) in enumerate(zip(tasks, snapshots, strict=True)):\n        requested_repo = Path(task[\"repo\"]).expanduser().resolve()\n        repo_output = run_checked(\n            [\"git\", \"-C\", str(requested_repo), \"rev-parse\", \"--show-toplevel\"],\n            timeout=60,\n        ).stdout_tail.strip()\n        repo_identity = Path(repo_output).resolve()\n        if expected is None:\n            resolved_sha = run_checked(\n                [\n                    \"git\",\n                    \"-C\",\n                    str(repo_identity),\n                    \"rev-parse\",\n                    f\"{task.get('ref', 'HEAD')}^{{commit}}\",\n                ],\n                timeout=60,","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/runner_tasks.py#L94-L130","documentation":"Raised by resolve_task_bindings when the supplied `oracle_snapshots` list length differs from the tasks list (runner_tasks.py:111-112). The runner normally captures snapshots via capture_task_oracles just before calling this; a mismatch indicates the caller hand-passed an inconsistent snapshot list.","triggerScenarios":"Calling resolve_task_bindings with oracle_snapshots captured from a different/older task list; passing a partial snapshot list; snapshots filtered after capture.","commonSituations":"Programmatic use of resolve_task_bindings outside runner.main; tests passing hand-built snapshots of the wrong length.","solutions":["Pass oracle_snapshots=None to let the function capture them itself, matching the current tasks.","If supplying explicitly, rebuild the list from the same tasks in the same order.","Verify no task was filtered between capture and resolve."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if oracle_snapshots is not None and len(oracle_snapshots) != len(tasks):\n    raise SystemExit(\"oracle snapshot list length != task count\")","typeGuard":"def snapshot_count_matches(tasks: list, snapshots: list | None) -> bool:\n    return snapshots is None or len(snapshots) == len(tasks)","tryCatchPattern":null,"preventionTips":["Prefer passing oracle_snapshots=None so the function captures them consistently.","Capture snapshots and call resolve in the same pass without filtering tasks in between."],"tags":["workflow-bench","task-binding","oracle","internal-api"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}