HKUDS/Vibe-Trading · error · ValueError

limitations is required and must be non-empty

Error message

limitations is required and must be non-empty

What it means

Companion to the intended_use check: validate_model_registration requires a non-empty, non-whitespace `limitations` string describing where the model should not be used. ValueError is raised when it is missing or blank.

Source

Thrown at agent/src/strategy_store/models.py:256

def validate_model_registration(artifact: Artifact) -> None:
    """Validate that *artifact* carries the minimum model-registration fields.

    A model registration without a stated intended use or a stated
    limitation is, for governance purposes, not actually registered — so
    both fields are required and must be non-blank.

    Args:
        artifact: The artifact/model record to validate.

    Raises:
        ValueError: if ``intended_use`` or ``limitations`` is missing or
            consists only of whitespace.
    """
    if not artifact.intended_use or not artifact.intended_use.strip():
        raise ValueError("intended_use is required and must be non-empty")
    if not artifact.limitations or not artifact.limitations.strip():
        raise ValueError("limitations is required and must be non-empty")

View on GitHub (pinned to 80ffdda44c)

Solutions

  1. Add an explicit limitations description before registering
  2. If a model truly has none documented yet, write the known scope limits ('not validated outside 2019-2023 data') rather than blank

Example fix

# before
Artifact(name='m1', universe='u1', intended_use='...', limitations='')
# after
Artifact(name='m1', universe='u1', intended_use='...', limitations='not validated in high-volatility regimes')
Defensive patterns

Strategy: type-guard

Validate before calling

if not (artifact.limitations or '').strip():
    artifact.limitations = 'not yet documented; scope unvalidated'

Type guard

def has_limitations(a) -> bool:
    return bool(a.limitations and a.limitations.strip())

Try / catch

try:
    store.register_artifact(artifact)
except ValueError as e:
    if 'limitations' in str(e): document known scope limits and retry
    else: raise

Prevention

When it happens

Trigger: register_artifact with limitations='' or omitted; registration configs that describe intended use but not known weaknesses.

Common situations: Automated re-registration pipelines that drop optional-looking fields; teams new to the governance schema forgetting limitations is mandatory.

Understand the failure class

Background: "Missing required field" and "field is required" errors: why libraries reject payloads that omit mandatory fields — this error's family across 20 libraries.

Related errors


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