{"record":{"id":"b0fc685d17e570da","repo":"HKUDS/Vibe-Trading","slug":"provide-exactly-one-of-manifest-path-or-runs-not","errorCode":null,"errorMessage":"provide exactly one of manifest_path or runs, not both","messagePattern":"provide exactly one of manifest_path or runs, not both","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"agent/src/tools/strategy_discovery_tool.py","lineNumber":605,"sourceCode":"    \"\"\"Shared refresh core for the agent tool and the CLI (one code path).\n\n    Validates the exactly-one-source rule, loads the manifest (or accepts\n    inline ``runs``), validates every entry (path containment included), and\n    rebuilds the DEFAULT evidence store — ``EvidenceStore()`` resolution:\n    env override → runtime root → ``~/.vibe-trading``; NEVER a CWD-relative\n    path.\n\n    Returns:\n        The strict envelope ``{status, runs, strategies, rows, skipped}``\n        where ``runs`` counts every supplied entry (processed + skipped) and\n        ``skipped`` merges entry-level skips with harness skips.\n\n    Raises:\n        ValueError: Operator-facing usage errors (exactly-one rule violated,\n            manifest missing/invalid/wrong shape, ``runs`` not an array).\n    \"\"\"\n    if manifest_path is not None and runs is not None:\n        raise ValueError(\"provide exactly one of manifest_path or runs, not both\")\n    if manifest_path is None and runs is None:\n        raise ValueError(\n            \"refresh_strategy_evidence requires exactly one of manifest_path \" \"or runs\"\n        )\n    if manifest_path is not None:\n        entries = load_manifest(manifest_path)\n    else:\n        if not isinstance(runs, list):\n            raise ValueError(\n                \"runs must be an array of {strategy_id, run_dir, \"\n                \"position_size?} objects\"\n            )\n        entries = runs\n\n    specs, skipped = validate_refresh_entries(entries)\n    if not specs:\n        # Nothing admissible to rebuild from. Do NOT call rebuild_evidence:\n        # an empty rebuild clears the store, and wiping the cache because","sourceCodeStart":587,"sourceCodeEnd":623,"githubUrl":"https://github.com/HKUDS/Vibe-Trading/blob/80ffdda44c5c4db0dd84d70e051cca591cea67df/agent/src/tools/strategy_discovery_tool.py#L587-L623","documentation":"refresh_strategy_evidence_core takes mutually exclusive inputs: you must pass exactly one of manifest_path (path to a manifest file) or runs (inline array of run entries). Passing both raises immediately; passing neither raises a companion error. This prevents ambiguous sources of truth for the refresh set.","triggerScenarios":"Calling refresh_strategy_evidence(manifest_path=\"m.json\", runs=[...]) with both arguments; commonly happens when a wrapper forwards a full kwargs dict unconditionally.","commonSituations":"Wrapper functions defaulting both args and forwarding everything; LLM tool calls filling all schema fields; refactors that started with runs and later added manifest_path without removing the other.","solutions":["Pass only one: either manifest_path=\"...\" or runs=[{...}], never both","In wrapper code, build kwargs conditionally: include only the argument that is actually set","If you have inline run dicts, prefer runs and drop manifest_path; if the runs live in a file, drop runs"],"exampleFix":"# before\nrefresh_strategy_evidence_core(manifest_path=\"m.json\", runs=entries)\n# after\nrefresh_strategy_evidence_core(runs=entries)  # or manifest_path=\"m.json\" alone","handlingStrategy":"validation","validationCode":"if (manifest_path is None) == (runs is None):\n    raise ValueError(\"pass exactly one of manifest_path or runs\")\nrefresh_strategy_evidence_core(manifest_path=manifest_path, runs=runs, ...)","typeGuard":null,"tryCatchPattern":"except ValueError as e: if 'exactly one' in str(e): drop one of the two args and retry","preventionTips":["Build kwargs conditionally instead of forwarding both always","Pick one input mode (file manifest vs inline runs) per integration and stick to it"],"tags":["strategy-discovery","mutually-exclusive-args","refresh","validation"],"backgroundTag":"mutually-exclusive-parameters","analyzedSha":"80ffdda44c5c4db0dd84d70e051cca591cea67df","analyzedAt":"2026-08-28T12:46:38.989Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}