{"record":{"id":"554e2513339932f0","repo":"HKUDS/Vibe-Trading","slug":"model-expected-name-r-must-be-supplied-as-an","errorCode":null,"errorMessage":"{model}: {expected_name!r} must be supplied as an Assumption(name=..., value=..., basis=...) carrying its justification, not a bare {type(value).__name__}. A terminal growth rate or exit multiple chosen without a stated reason is exactly the kind of silent default this package refuses to make on your behalf.","messagePattern":"(.+?): (.+?) must be supplied as an Assumption\\(name=\\.\\.\\., value=\\.\\.\\., basis=\\.\\.\\.\\) carrying its justification, not a bare (.+?)\\. A terminal growth rate or exit multiple chosen without a stated reason is exactly the kind of silent default this package refuses to make on your behalf\\.","errorType":"exception","errorClass":"ValuationError","httpStatus":null,"severity":"error","filePath":"agent/src/quantlib/valuation/dcf.py","lineNumber":210,"sourceCode":"\ndef _require_assumption(value: Any, expected_name: str, model: str) -> Assumption:\n    \"\"\"Check that a terminal-value driver arrived as a justified Assumption.\n\n    Args:\n        value: Candidate supplied by the caller.\n        expected_name: The :attr:`Assumption.name` this slot expects.\n        model: Name used in the error message.\n\n    Returns:\n        ``value``, unchanged.\n\n    Raises:\n        ValuationError: If ``value`` is not an :class:`Assumption`, or if its\n            ``name`` does not match ``expected_name`` (which usually means two\n            assumptions were passed under swapped keys).\n    \"\"\"\n    if not isinstance(value, Assumption):\n        raise ValuationError(\n            f\"{model}: {expected_name!r} must be supplied as an Assumption(\"\n            f\"name=..., value=..., basis=...) carrying its justification, not \"\n            f\"a bare {type(value).__name__}. A terminal growth rate or exit \"\n            \"multiple chosen without a stated reason is exactly the kind of \"\n            \"silent default this package refuses to make on your behalf.\"\n        )\n    if value.name != expected_name:\n        raise ValuationError(\n            f\"{model}: expected an Assumption named {expected_name!r}, got \"\n            f\"{value.name!r}; check that assumptions were not passed under \"\n            \"swapped keys.\"\n        )\n    return value\n\n\ndef _require_nonnegative(value: float, name: str, model: str) -> float:\n    \"\"\"Check a value that is a signed formula's magnitude, so must be >= 0.\n","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/HKUDS/Vibe-Trading/blob/80ffdda44c5c4db0dd84d70e051cca591cea67df/agent/src/quantlib/valuation/dcf.py#L192-L228","documentation":"Terminal-value inputs must be supplied as Assumption(name=..., value=..., basis=...) instances, not bare floats. _require_assumption (used by terminal_value and run_dcf) rejects bare values because an un-justified terminal growth rate or exit multiple is precisely the silent default this package refuses to make.","triggerScenarios":"Calling run_dcf(terminal_growth_rate=0.025, ...) or terminal_value(growth_rate=0.03) with a plain float instead of an Assumption carrying a basis string.","commonSituations":"Porting code from another DCF library that takes raw floats; quick notebooks; wrapper functions that accept floats from config and forward them unchanged.","solutions":["Wrap the value: Assumption(name='terminal_growth_rate', value=0.025, basis='<why>').","In wrappers, convert incoming floats to Assumption at the boundary with a documented basis.","If you cannot state a basis, source one (analyst consensus, Damodaran data) before proceeding."],"exampleFix":"# before\nrun_dcf(inputs, terminal_growth_rate=0.025, exit_multiple=None)\n\n# after\nfrom quantlib.valuation.contracts import Assumption\nrun_dcf(inputs,\n        terminal_growth_rate=Assumption('terminal_growth_rate', 0.025,\n                                         basis='long-run nominal GDP proxy'),\n        exit_multiple=None)","handlingStrategy":"type-guard","validationCode":"from quantlib.valuation.contracts import Assumption\nif not isinstance(terminal_growth_rate, Assumption):\n    terminal_growth_rate = Assumption('terminal_growth_rate', terminal_growth_rate,\n                                      basis='<stated justification>')","typeGuard":"def is_assumption(v):\n    from quantlib.valuation.contracts import Assumption\n    return isinstance(v, Assumption)","tryCatchPattern":"except ValuationError as e:\n    if 'must be supplied as an Assumption' in str(e):\n        wrap_and_retry_with_documented_basis()","preventionTips":["Wrap floats into Assumption at your API boundary","Never forward raw floats into terminal-value parameters"],"tags":["valuation","dcf","assumption","type-validation"],"backgroundTag":"wrong-argument-type","analyzedSha":"80ffdda44c5c4db0dd84d70e051cca591cea67df","analyzedAt":"2026-08-28T12:46:38.989Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}