{"record":{"id":"0c09ee604b34f018","repo":"HKUDS/Vibe-Trading","slug":"model-governance-fields-were-supplied-sorted-sup","errorCode":null,"errorMessage":"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.","messagePattern":"model governance fields were supplied \\((.+?)\\), so (.+?) are required too\\. A model record without a stated intended use and stated limitations cannot be reviewed\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"agent/src/tools/sdm_register_tool.py","lineNumber":233,"sourceCode":"            Keyword arguments to pass to :class:`Artifact`, empty when no\n            governance field was supplied.\n\n        Raises:\n            ValueError: If governance fields were supplied without both\n                ``intended_use`` and ``limitations``, or if an enum value is\n                unknown.\n        \"\"\"\n        supplied = {\n            f: kwargs[f]\n            for f in self._GOVERNANCE_FIELDS\n            if kwargs.get(f) not in (None, \"\")\n        }\n        if not supplied:\n            return {}\n\n        missing = [f for f in (\"intended_use\", \"limitations\") if f not in supplied]\n        if missing:\n            raise ValueError(\n                f\"model governance fields were supplied ({sorted(supplied)}), so \"\n                f\"{missing} are required too. A model record without a stated \"\n                \"intended use and stated limitations cannot be reviewed.\"\n            )\n\n        if \"model_tier\" in supplied:\n            supplied[\"model_tier\"] = ModelTier(supplied[\"model_tier\"])\n        if \"validation_status\" in supplied:\n            supplied[\"validation_status\"] = ValidationStatus(supplied[\"validation_status\"])\n        return supplied\n","sourceCodeStart":215,"sourceCodeEnd":244,"githubUrl":"https://github.com/HKUDS/Vibe-Trading/blob/80ffdda44c5c4db0dd84d70e051cca591cea67df/agent/src/tools/sdm_register_tool.py#L215-L244","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","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"],"exampleFix":"# before\nregister_model(name=\"m1\", model_tier=\"tier_2\")\n# after\nregister_model(name=\"m1\", model_tier=\"tier_2\", intended_use=\"fraud scoring\", limitations=\"not for credit decisions\")","handlingStrategy":"validation","validationCode":"GOVERNANCE = {\"intended_use\", \"limitations\", \"model_tier\"}  # per tool docs\nsupplied = {k for k in kwargs if k in GOVERNANCE}\nif supplied and not {\"intended_use\", \"limitations\"} <= supplied:\n    raise ValueError(\"intended_use and limitations are required when any governance field is set\")\nregister_model(name, **kwargs)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["sdm","model-governance","conditional-required","validation"],"backgroundTag":"conditional-required-fields","analyzedSha":"80ffdda44c5c4db0dd84d70e051cca591cea67df","analyzedAt":"2026-08-28T12:46:38.989Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}