HKUDS/Vibe-Trading · error · ValueError

assumption {self.name!r} has no basis; state why this value

Error message

assumption {self.name!r} has no basis; state why this value was chosen, or do not make the assumption

What it means

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.

Source

Thrown at agent/src/quantlib/valuation/contracts.py:101

            and an unreviewable assumption in a valuation is indistinguishable
            from a guess.
        source: Optional pointer to where the basis came from -- a filing, a
            data tool call, a named analyst view.

    Raises:
        ValueError: If ``name`` or ``basis`` is empty or blank.
    """

    name: str
    value: Any
    basis: str
    source: str | None = None

    def __post_init__(self) -> None:
        if not str(self.name).strip():
            raise ValueError("an assumption must be named")
        if not str(self.basis).strip():
            raise ValueError(
                f"assumption {self.name!r} has no basis; state why this value was "
                "chosen, or do not make the assumption"
            )


def require_inputs(
    supplied: Mapping[str, Any],
    required: Iterable[str],
    model: str,
) -> None:
    """Refuse to run unless every required input is present and usable.

    A key that is absent, ``None``, or an empty string counts as missing. Zero
    and ``False`` do NOT: they are legitimate values for a line item, and
    treating them as missing is the mirror-image bug of defaulting.

    Args:
        supplied: The inputs the caller provided.

View on GitHub (pinned to 80ffdda44c)

Solutions

  1. Write the basis: cite why the value was chosen (comparable study, analyst estimate, historical range).
  2. If you genuinely have no justification, do not make the assumption — remove it or source one.
  3. Enforce non-empty basis in your config loader with a clear error message.

Example fix

# before
Assumption('terminal_growth_rate', 0.02, basis='')

# after
Assumption('terminal_growth_rate', 0.02, basis='long-run real GDP growth proxy, Damodaran 2024')
Defensive patterns

Strategy: validation

Validate before calling

if not str(basis or '').strip():
    raise ValueError('assumption basis/justification required')

Type guard

def justified(a):
    return bool(str(a.basis or '').strip())

Try / catch

try:
    Assumption('wacc', 0.09, basis='')
except ValueError:
    basis = 'industry proxy from Damodaran 2024'
    a = Assumption('wacc', 0.09, basis=basis)

Prevention

When it happens

Trigger: Constructing Assumption(name='wacc', value=0.09, basis='') or basis=' '; also forgetting the basis keyword when a positional argument order changed.

Common situations: Quick experiments where the developer omits basis; config schemas not enforcing a non-empty basis field; positional-argument mismatches after adding the source field.

Related errors


AI-assisted analysis of HKUDS/Vibe-Trading@80ffdda44c (2026-08-28). Data as JSON: /api/errors/88a2e221090e7bfb. Report an issue: GitHub.