{"record":{"id":"de24a403a1d43adf","repo":"HKUDS/Vibe-Trading","slug":"an-assumption-must-be-named","errorCode":null,"errorMessage":"an assumption must be named","messagePattern":"an assumption must be named","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"agent/src/quantlib/valuation/contracts.py","lineNumber":99,"sourceCode":"        basis: Why this value. Free text, but required and non-empty: an\n            assumption whose justification nobody wrote down cannot be reviewed,\n            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","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/HKUDS/Vibe-Trading/blob/80ffdda44c5c4db0dd84d70e051cca591cea67df/agent/src/quantlib/valuation/contracts.py#L81-L117","documentation":"The Assumption dataclass requires a non-blank name in __post_init__. Assumptions are first-class justified values in this package, so an anonymous assumption cannot be referenced or audited and is rejected at construction.","triggerScenarios":"Constructing Assumption(name='', value=0.02, basis='...') or Assumption(name='   ', ...); usually a dict unpacking where the name key is missing/empty.","commonSituations":"Building assumptions in a loop from config entries where one lacks a 'name' key; whitespace-only names from templated strings; refactor renaming keys but not the constructor call.","solutions":["Ensure every assumption dict has a meaningful non-empty name before construction.","Validate config: assert each key is non-blank before building Assumptions from it.","Use descriptive snake_case names like 'terminal_growth_rate' so name checks also catch swapped-key bugs."],"exampleFix":"# before\nAssumption(name='', value=0.025, basis='proxy for LT GDP growth')\n\n# after\nAssumption(name='terminal_growth_rate', value=0.025, basis='proxy for LT GDP growth')","handlingStrategy":"validation","validationCode":"if not str(name or '').strip():\n    raise ValueError('assumption name required')","typeGuard":"def valid_assumption_name(n):\n    return bool(str(n or '').strip())","tryCatchPattern":null,"preventionTips":["Validate assumption config entries have non-empty name keys","Use descriptive parameter-matching names"],"tags":["valuation","assumption","required-field","validation"],"backgroundTag":"required-field-missing","analyzedSha":"80ffdda44c5c4db0dd84d70e051cca591cea67df","analyzedAt":"2026-08-28T12:46:38.989Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}