{"record":{"id":"e4c6bd756e7a53e4","repo":"abhigyanpatwari/GitNexus","slug":"task-task-id-oracle-source-is-duplicated-sourc","errorCode":null,"errorMessage":"task {task_id} oracle source is duplicated: {source}","messagePattern":"task (.+?) oracle source is duplicated: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/oracle_assets.py","lineNumber":109,"sourceCode":"    if (\n        not isinstance(command, str)\n        or not command.strip()\n        or len(command.encode()) > MAX_ORACLE_COMMAND_BYTES\n        or \"\\x00\" in command\n    ):\n        raise ValueError(f\"task {task_id} oracle command must be nonblank and bounded\")\n    files = oracle.get(\"files\")\n    if not isinstance(files, list) or not files or len(files) > MAX_ORACLE_FILES:\n        raise ValueError(f\"task {task_id} oracle files must contain 1..{MAX_ORACLE_FILES} entries\")\n    sources: set[str] = set()\n    targets: set[str] = set()\n    for index, declaration in enumerate(files):\n        if not isinstance(declaration, dict) or set(declaration) != {\"source\", \"target\"}:\n            raise ValueError(f\"task {task_id} oracle file {index} requires exactly source and target\")\n        source = _bounded_relative_path(declaration.get(\"source\"), label=f\"task {task_id} oracle source\")\n        target = _bounded_relative_path(declaration.get(\"target\"), label=f\"task {task_id} oracle target\")\n        if source.as_posix() in sources:\n            raise ValueError(f\"task {task_id} oracle source is duplicated: {source}\")\n        if target.as_posix() in targets:\n            raise ValueError(f\"task {task_id} oracle target is duplicated: {target}\")\n        sources.add(source.as_posix())\n        targets.add(target.as_posix())\n\n\ndef _real_oracle_root(root: Path) -> Path:\n    lexical = root.expanduser().absolute()\n    try:\n        metadata = lexical.lstat()\n        resolved = lexical.resolve(strict=True)\n    except OSError as exc:\n        raise ValueError(f\"oracle root is unavailable: {lexical}\") from exc\n    if stat.S_ISLNK(metadata.st_mode) or not stat.S_ISDIR(metadata.st_mode) or resolved != lexical:\n        raise ValueError(f\"oracle root must be a real non-symlink directory: {lexical}\")\n    return lexical\n\n","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/oracle_assets.py#L91-L127","documentation":"Raised when two file declarations share the same 'source' path (compared by POSIX-normalized string). Each oracle source must be unique so the harness captures a distinct, well-defined set of inputs. Deduplication is enforced via a running set of source.as_posix() values during validation.","triggerScenarios":"Two entries in oracle['files'] whose 'source' field resolves to the same POSIX path string, e.g. both 'a/b.txt' and the equivalent 'a//b.txt' collapse, or literally identical source strings.","commonSituations":"Copy-pasting a file declaration and forgetting to change the source; intending two targets for one source (the harness forbids this — you must declare one canonical target).","solutions":["Give each oracle file declaration a distinct 'source' path.","If one source must map to multiple targets, reconsider the oracle design — the schema is 1:1 source-to-target.","Re-run validate_oracle_declaration after editing to confirm the duplicate is gone."],"exampleFix":"// before\n[{\"source\": \"expect.txt\", \"target\": \"a.txt\"},\n {\"source\": \"expect.txt\", \"target\": \"b.txt\"}]\n// after\n[{\"source\": \"expect_a.txt\", \"target\": \"a.txt\"},\n {\"source\": \"expect_b.txt\", \"target\": \"b.txt\"}]","handlingStrategy":"validation","validationCode":"sources = [PurePosixPath(d[\"source\"]).as_posix() for d in task[\"oracle\"][\"files\"]]\nif len(sources) != len(set(sources)):\n    dupes = {s for s in sources if sources.count(s) > 1}\n    raise ValueError(f\"duplicate oracle sources: {dupes}\")","typeGuard":"def sources_are_unique(files: list) -> bool:\n    src = [PurePosixPath(d[\"source\"]).as_posix() for d in files]\n    return len(src) == len(set(src))","tryCatchPattern":"try:\n    validate_oracle_declaration(task)\nexcept ValueError as exc:\n    print(f\"Resolve duplicate source: {exc}\")","preventionTips":["Generate file declarations from a dict keyed by source path to prevent duplicates.","Review duplicate-source conflicts as a design smell: the schema is 1:1."],"tags":["python","benchmark","validation","oracle","dedup"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}