{"record":{"id":"9b8d9e38b0809dee","repo":"abhigyanpatwari/GitNexus","slug":"ce-plugin-dir-and-ce-plugin-version-require-at","errorCode":null,"errorMessage":"--ce-plugin-dir and --ce-plugin-version require at least one ce_* arm","messagePattern":"--ce-plugin-dir and --ce-plugin-version require at least one ce_\\* arm","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/runtime_mounts.py","lineNumber":265,"sourceCode":"    except (OSError, json.JSONDecodeError) as exc:\n        raise SandboxError(f\"pinned GitNexus shared runtime metadata is invalid: {exc}\") from exc\n    if shared_package.get(\"name\") != \"gitnexus-shared\":\n        raise SandboxError(\"pinned GitNexus shared runtime has an unexpected package identity\")\n    return mounts\n\n\ndef validate_ce_plugin_inputs(\n    arms: Sequence[str],\n    plugin_dir: Path | None,\n    plugin_version: str | None,\n) -> CePluginConfig | None:\n    \"\"\"Require an explicit directory and exact version iff a CE arm is selected.\"\"\"\n\n    has_ce_arm = any(arm in CE_ARMS for arm in arms)\n    supplied = plugin_dir is not None or plugin_version is not None\n    if not has_ce_arm:\n        if supplied:\n            raise ValueError(\"--ce-plugin-dir and --ce-plugin-version require at least one ce_* arm\")\n        return None\n    if plugin_dir is None or plugin_version is None:\n        raise ValueError(\"ce_* arms require both --ce-plugin-dir and --ce-plugin-version\")\n    if _EXACT_VERSION.fullmatch(plugin_version) is None:\n        raise ValueError(\"--ce-plugin-version must be an exact semantic version (aliases and ranges are forbidden)\")\n    source = _validated_runtime_root(plugin_dir, label=\"Compound Engineering plugin source\")\n    return CePluginConfig(source=source, version=plugin_version)\n\n\ndef _is_forbidden_plugin_path(relative: PurePosixPath) -> bool:\n    for part in relative.parts:\n        lowered = part.lower()\n        if lowered in _FORBIDDEN_PATH_PARTS or lowered in _SECRET_EXACT_NAMES:\n            return True\n        if lowered.startswith(\".env.\") or lowered.startswith(\".npmrc.\"):\n            return True\n        if lowered.endswith(_SECRET_SUFFIXES) or any(marker in lowered for marker in _SECRET_NAME_MARKERS):\n            return True","sourceCodeStart":247,"sourceCodeEnd":283,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/runtime_mounts.py#L247-L283","documentation":"validate_ce_plugin_inputs() raises ValueError when --ce-plugin-dir or --ce-plugin-version is supplied but no ce_* arm is in the selected arms list. CE plugin inputs are only meaningful for CE comparator arms, so passing them otherwise is contradictory input the harness refuses to silently ignore.","triggerScenarios":"Invoking the benchmark CLI with `--arms baseline --ce-plugin-dir ./plugin --ce-plugin-version 1.0.0` (no ce_* arm), or calling validate_ce_plugin_inputs(arms=['baseline'], plugin_dir=..., plugin_version=...).","commonSituations":"Copy-pasted CLI invocation from a CE run into a non-CE run; CI config drift; flags left over from a previous experiment.","solutions":["Add a CE arm to --arms, e.g. `--arms baseline ce_workflow`.","Or remove both --ce-plugin-dir and --ce-plugin-version from the invocation."],"exampleFix":"# before\n--arms baseline --ce-plugin-dir ./plugin --ce-plugin-version 1.0.0\n# after\n--arms baseline ce_workflow --ce-plugin-dir ./plugin --ce-plugin-version 1.0.0","handlingStrategy":"validation","validationCode":"from pathlib import Path\nfrom eval.workflow_bench.runtime_mounts import CE_ARMS\n\ndef ce_flags_consistent_when_no_ce_arm(arms, plugin_dir, plugin_version) -> bool:\n    has_ce_arm = any(a in CE_ARMS for a in arms)\n    supplied = plugin_dir is not None or plugin_version is not None\n    # OK only when: not has_ce_arm implies not supplied\n    return has_ce_arm or not supplied","typeGuard":null,"tryCatchPattern":"try:\n    cfg = validate_ce_plugin_inputs(arms, plugin_dir, plugin_version)\nexcept ValueError as exc:\n    if \"require at least one ce_* arm\" in str(exc):\n        # either add a ce_* arm or drop both flags\n        ...\n    raise","preventionTips":["Keep --ce-plugin-dir and --ce-plugin-version in the same config block as the ce_* arm selection.","Templated CI configs should conditionally include CE flags only when a CE arm is in the matrix."],"tags":["cli","argument-validation","ce-plugin"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}