{"record":{"id":"d3bbacb52f589423","repo":"abhigyanpatwari/GitNexus","slug":"task-task-id-oracle-target-is-duplicated-targe","errorCode":null,"errorMessage":"task {task_id} oracle target is duplicated: {target}","messagePattern":"task (.+?) oracle target is duplicated: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/oracle_assets.py","lineNumber":111,"sourceCode":"        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\ndef _read_oracle_file(root: Path, relative: PurePosixPath) -> bytes:\n    current = root","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/oracle_assets.py#L93-L129","documentation":"Raised when two file declarations share the same 'target' path (compared by POSIX-normalized string). Each oracle target must be unique so staged oracle files never collide inside the model's worktree. Enforced via a running set of target.as_posix() values.","triggerScenarios":"Two entries whose 'target' field is the same worktree-relative path, e.g. both writing to 'out/result.json' from different sources.","commonSituations":"Two oracle outputs that conceptually land in the same file; copy-paste of a declaration without updating target; expecting the harness to overwrite/merge targets.","solutions":["Assign each declaration a unique 'target' path within the worktree.","If two logical outputs belong in one file, merge them into a single source file and a single target declaration.","Check that target strings are not accidentally identical after POSIX normalization (trailing slashes, duplicate separators)."],"exampleFix":"// before\n[{\"source\": \"a.txt\", \"target\": \"out/result.json\"},\n {\"source\": \"b.txt\", \"target\": \"out/result.json\"}]\n// after\n[{\"source\": \"a.txt\", \"target\": \"out/result_a.json\"},\n {\"source\": \"b.txt\", \"target\": \"out/result_b.json\"}]","handlingStrategy":"validation","validationCode":"targets = [PurePosixPath(d[\"target\"]).as_posix() for d in task[\"oracle\"][\"files\"]]\nif len(targets) != len(set(targets)):\n    dupes = {t for t in targets if targets.count(t) > 1}\n    raise ValueError(f\"duplicate oracle targets: {dupes}\")","typeGuard":"def targets_are_unique(files: list) -> bool:\n    tgt = [PurePosixPath(d[\"target\"]).as_posix() for d in files]\n    return len(tgt) == len(set(tgt))","tryCatchPattern":"try:\n    validate_oracle_declaration(task)\nexcept ValueError as exc:\n    print(f\"Resolve duplicate target: {exc}\")","preventionTips":["Design each oracle file to land at a distinct worktree path.","Use a deterministic naming scheme for targets to avoid collisions."],"tags":["python","benchmark","validation","oracle","dedup"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}