{"record":{"id":"4672466f116a2946","repo":"HKUDS/Vibe-Trading","slug":"limitations-is-required-and-must-be-non-empty","errorCode":null,"errorMessage":"limitations is required and must be non-empty","messagePattern":"limitations is required and must be non-empty","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"agent/src/strategy_store/models.py","lineNumber":256,"sourceCode":"\ndef validate_model_registration(artifact: Artifact) -> None:\n    \"\"\"Validate that *artifact* carries the minimum model-registration fields.\n\n    A model registration without a stated intended use or a stated\n    limitation is, for governance purposes, not actually registered — so\n    both fields are required and must be non-blank.\n\n    Args:\n        artifact: The artifact/model record to validate.\n\n    Raises:\n        ValueError: if ``intended_use`` or ``limitations`` is missing or\n            consists only of whitespace.\n    \"\"\"\n    if not artifact.intended_use or not artifact.intended_use.strip():\n        raise ValueError(\"intended_use is required and must be non-empty\")\n    if not artifact.limitations or not artifact.limitations.strip():\n        raise ValueError(\"limitations is required and must be non-empty\")\n","sourceCodeStart":238,"sourceCodeEnd":257,"githubUrl":"https://github.com/HKUDS/Vibe-Trading/blob/80ffdda44c5c4db0dd84d70e051cca591cea67df/agent/src/strategy_store/models.py#L238-L257","documentation":"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.","triggerScenarios":"register_artifact with limitations='' or omitted; registration configs that describe intended use but not known weaknesses.","commonSituations":"Automated re-registration pipelines that drop optional-looking fields; teams new to the governance schema forgetting limitations is mandatory.","solutions":["Add an explicit limitations description before registering","If a model truly has none documented yet, write the known scope limits ('not validated outside 2019-2023 data') rather than blank"],"exampleFix":"# before\nArtifact(name='m1', universe='u1', intended_use='...', limitations='')\n# after\nArtifact(name='m1', universe='u1', intended_use='...', limitations='not validated in high-volatility regimes')","handlingStrategy":"type-guard","validationCode":"if not (artifact.limitations or '').strip():\n    artifact.limitations = 'not yet documented; scope unvalidated'","typeGuard":"def has_limitations(a) -> bool:\n    return bool(a.limitations and a.limitations.strip())","tryCatchPattern":"try:\n    store.register_artifact(artifact)\nexcept ValueError as e:\n    if 'limitations' in str(e): document known scope limits and retry\n    else: raise","preventionTips":["Require limitations in the model registration template","Treat blank strings as missing in upstream config validation"],"tags":["python","model-registry","required-field"],"backgroundTag":"missing-required-field","analyzedSha":"80ffdda44c5c4db0dd84d70e051cca591cea67df","analyzedAt":"2026-08-28T12:46:38.989Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}