HKUDS/Vibe-Trading · error · ValuationError

{MODEL_NAME}: driver sequences are empty; at least one proje

Error message

{MODEL_NAME}: driver sequences are empty; at least one projection period is required

What it means

_resolve_period_count requires at least one projected period; if all driver sequences have length 0 it raises ValuationError. An empty projection has no meaning for a three-statement model, and letting it through would return an empty artifact that looks like success.

Source

Thrown at agent/src/quantlib/valuation/threestatement.py:501

    Returns:
        The number of periods to project.

    Raises:
        ValuationError: If the driver sequences disagree in length, or all are
            empty.
    """
    lengths = {field: len(drivers[field]) for field in DRIVER_REQUIRED_FIELDS}
    distinct = set(lengths.values())
    if len(distinct) > 1:
        detail = ", ".join(f"{field}={n}" for field, n in lengths.items())
        raise ValuationError(
            f"{MODEL_NAME}: every driver sequence must share one length (one entry "
            f"per projected period); got {detail}"
        )
    periods = distinct.pop()
    if periods < 1:
        raise ValuationError(
            f"{MODEL_NAME}: driver sequences are empty; at least one projection "
            "period is required"
        )
    return periods


def _project_period(
    period: int,
    prior_bs: BalanceSheet,
    prior_revenue: float,
    revenue_growth: float,
    gross_margin: float,
    opex_pct_revenue: float,
    capex_pct_revenue: float,
    nwc_pct_revenue: float,
    tax_rate: float,
    dividend_payout_ratio: float,
    depreciation_amortization: float,

View on GitHub (pinned to 80ffdda44c)

Solutions

  1. Check why the driver arrays are empty (usually a date filter or empty upstream table).
  2. Populate the drivers with at least one period's assumptions.
  3. Guard with `if not drivers['revenue_growth']: ...` before calling.

Example fix

# before
drivers = {k: [] for k in DRIVER_REQUIRED_FIELDS}
# after
drivers = {"revenue_growth": [0.08], "capex_pct": [0.03], ...}  # >= 1 period
Defensive patterns

Strategy: validation

Validate before calling

assert all(len(v) >= 1 for v in drivers.values()), 'need >= 1 projection period'

Type guard

def has_periods(drivers) -> bool:
    return all(len(v) >= 1 for v in drivers.values())

Try / catch

except ValuationError as e:
    if 'at least one projection period' in str(e): skip_scenario()

Prevention

When it happens

Trigger: Calling project_three_statement with driver lists/arrays of length zero — e.g. slicing a DataFrame to a start date after the end date, or passing empty lists as defaults.

Common situations: Date-range filters that accidentally exclude all rows; parameterized tests looping over empty scenarios; default empty-list config values never populated.

Related errors


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