{"record":{"id":"88a2e221090e7bfb","repo":"HKUDS/Vibe-Trading","slug":"assumption-self-name-r-has-no-basis-state-why-t","errorCode":null,"errorMessage":"assumption {self.name!r} has no basis; state why this value was chosen, or do not make the assumption","messagePattern":"assumption (.+?) has no basis; state why this value was chosen, or do not make the assumption","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"agent/src/quantlib/valuation/contracts.py","lineNumber":101,"sourceCode":"            and an unreviewable assumption in a valuation is indistinguishable\n            from a guess.\n        source: Optional pointer to where the basis came from -- a filing, a\n            data tool call, a named analyst view.\n\n    Raises:\n        ValueError: If ``name`` or ``basis`` is empty or blank.\n    \"\"\"\n\n    name: str\n    value: Any\n    basis: str\n    source: str | None = None\n\n    def __post_init__(self) -> None:\n        if not str(self.name).strip():\n            raise ValueError(\"an assumption must be named\")\n        if not str(self.basis).strip():\n            raise ValueError(\n                f\"assumption {self.name!r} has no basis; state why this value was \"\n                \"chosen, or do not make the assumption\"\n            )\n\n\ndef require_inputs(\n    supplied: Mapping[str, Any],\n    required: Iterable[str],\n    model: str,\n) -> None:\n    \"\"\"Refuse to run unless every required input is present and usable.\n\n    A key that is absent, ``None``, or an empty string counts as missing. Zero\n    and ``False`` do NOT: they are legitimate values for a line item, and\n    treating them as missing is the mirror-image bug of defaulting.\n\n    Args:\n        supplied: The inputs the caller provided.","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/HKUDS/Vibe-Trading/blob/80ffdda44c5c4db0dd84d70e051cca591cea67df/agent/src/quantlib/valuation/contracts.py#L83-L119","documentation":"An Assumption with a blank basis is rejected: the package refuses values chosen without a stated justification (the basis string), because unjustified terminal growth rates or exit multiples are exactly the silent defaults it is designed to prevent.","triggerScenarios":"Constructing Assumption(name='wacc', value=0.09, basis='') or basis='   '; also forgetting the basis keyword when a positional argument order changed.","commonSituations":"Quick experiments where the developer omits basis; config schemas not enforcing a non-empty basis field; positional-argument mismatches after adding the source field.","solutions":["Write the basis: cite why the value was chosen (comparable study, analyst estimate, historical range).","If you genuinely have no justification, do not make the assumption — remove it or source one.","Enforce non-empty basis in your config loader with a clear error message."],"exampleFix":"# before\nAssumption('terminal_growth_rate', 0.02, basis='')\n\n# after\nAssumption('terminal_growth_rate', 0.02, basis='long-run real GDP growth proxy, Damodaran 2024')","handlingStrategy":"validation","validationCode":"if not str(basis or '').strip():\n    raise ValueError('assumption basis/justification required')","typeGuard":"def justified(a):\n    return bool(str(a.basis or '').strip())","tryCatchPattern":"try:\n    Assumption('wacc', 0.09, basis='')\nexcept ValueError:\n    basis = 'industry proxy from Damodaran 2024'\n    a = Assumption('wacc', 0.09, basis=basis)","preventionTips":["Never construct assumptions without a cited basis","Enforce basis in config schema validation"],"tags":["valuation","assumption","justification","validation"],"backgroundTag":"required-field-missing","analyzedSha":"80ffdda44c5c4db0dd84d70e051cca591cea67df","analyzedAt":"2026-08-28T12:46:38.989Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}