HKUDS/Vibe-Trading · error · ValueError
model governance fields were supplied ({sorted(supplied)}),
Error message
model governance fields were supplied ({sorted(supplied)}), so {missing} are required too. A model record without a stated intended use and stated limitations cannot be reviewed. What it means
The SDM model registration tool requires governance fields as a set: if any of the optional governance kwargs (like model_tier) are supplied, then both `intended_use` and `limitations` become mandatory. The tool computes which governance fields were supplied and raises when one of the two required narrative fields is missing, listing what is missing. This enforces reviewable model records.
Source
Thrown at agent/src/tools/sdm_register_tool.py:233
Keyword arguments to pass to :class:`Artifact`, empty when no
governance field was supplied.
Raises:
ValueError: If governance fields were supplied without both
``intended_use`` and ``limitations``, or if an enum value is
unknown.
"""
supplied = {
f: kwargs[f]
for f in self._GOVERNANCE_FIELDS
if kwargs.get(f) not in (None, "")
}
if not supplied:
return {}
missing = [f for f in ("intended_use", "limitations") if f not in supplied]
if missing:
raise ValueError(
f"model governance fields were supplied ({sorted(supplied)}), so "
f"{missing} are required too. A model record without a stated "
"intended use and stated limitations cannot be reviewed."
)
if "model_tier" in supplied:
supplied["model_tier"] = ModelTier(supplied["model_tier"])
if "validation_status" in supplied:
supplied["validation_status"] = ValidationStatus(supplied["validation_status"])
return supplied
View on GitHub (pinned to 80ffdda44c)
Solutions
- Add both intended_use and limitations kwargs (non-empty strings) whenever you supply any governance field
- If the record genuinely has no governance metadata yet, remove ALL governance kwargs including model_tier so `supplied` is empty and the requirement is skipped
- Ensure values are not whitespace-only if the tool trims them before checking presence
Example fix
# before register_model(name="m1", model_tier="tier_2") # after register_model(name="m1", model_tier="tier_2", intended_use="fraud scoring", limitations="not for credit decisions")
Defensive patterns
Strategy: validation
Validate before calling
GOVERNANCE = {"intended_use", "limitations", "model_tier"} # per tool docs
supplied = {k for k in kwargs if k in GOVERNANCE}
if supplied and not {"intended_use", "limitations"} <= supplied:
raise ValueError("intended_use and limitations are required when any governance field is set")
register_model(name, **kwargs) Prevention
- Treat intended_use and limitations as mandatory in registration forms whenever tier/governance is collected
- Build the kwargs dict conditionally: either all governance fields or none
When it happens
Trigger: Calling sdm_register with e.g. model_tier="..." but no intended_use, or with intended_use="..." but no limitations (supplying one makes `supplied` non-empty, so the other is required).
Common situations: Users add model_tier for classification but skip the longer free-text governance fields; migration scripts populate only some governance columns; copy-pasted registration payloads from an older schema that lacked these fields.
Related errors
- invalid alpha_id
- alpha_id not found
- invalid period: {exc}
- too many running benches; wait for one to finish
- invalid job_id
AI-assisted analysis of HKUDS/Vibe-Trading@80ffdda44c (2026-08-28).
Data as JSON: /api/errors/0c09ee604b34f018.
Report an issue: GitHub.