{"record":{"id":"2e2ee77966281eaf","repo":"HKUDS/Vibe-Trading","slug":"title-is-required","errorCode":null,"errorMessage":"title is required","messagePattern":"title is required","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"agent/src/hypotheses/registry.py","lineNumber":191,"sourceCode":"            title: Short hypothesis title.\n            thesis: Research thesis or rationale.\n            status: Initial lifecycle status.\n            universe: Target market or asset universe.\n            signal_definition: Signal logic.\n            data_sources: Source names.\n            skills: Related Vibe-Trading skills.\n            invalidation_notes: Initial invalidation notes.\n\n        Returns:\n            Created hypothesis.\n\n        Raises:\n            ValueError: If title/thesis/status are invalid.\n        \"\"\"\n        title = title.strip()\n        thesis = thesis.strip()\n        if not title:\n            raise ValueError(\"title is required\")\n        if not thesis:\n            raise ValueError(\"thesis is required\")\n\n        records = self.list()\n        now = _utc_now()\n        hyp = Hypothesis(\n            hypothesis_id=_new_hypothesis_id(title, now, {h.hypothesis_id for h in records}),\n            title=title,\n            thesis=thesis,\n            status=_validate_status(status),\n            universe=universe.strip(),\n            signal_definition=signal_definition.strip(),\n            data_sources=_coerce_str_list(data_sources),\n            skills=_coerce_str_list(skills),\n            invalidation_notes=invalidation_notes.strip(),\n            created_at=now,\n            updated_at=now,\n        )","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/HKUDS/Vibe-Trading/blob/80ffdda44c5c4db0dd84d70e051cca591cea67df/agent/src/hypotheses/registry.py#L173-L209","documentation":"HypothesisRegistry.create requires a non-blank title; the value is stripped and if empty the call is rejected before any record is written. Titles are mandatory identity fields for hypotheses tracked across analysis and backtests.","triggerScenarios":"Calling registry.create(title=\"\", thesis=...) or title=\"   \" (whitespace-only), or forwarding an empty form/UI field into create.","commonSituations":"User submits an empty title in a CLI/web form, or a script creates hypotheses in a loop and one row has a missing title column.","solutions":["Supply a non-blank title (strip it first and check before calling)","Add a required-field check in the calling form/API before invoking create"],"exampleFix":"# before\nregistry.create(title=\"   \", thesis=\"momentum persists\")\n# after\nregistry.create(title=\"Momentum persistence\", thesis=\"momentum persists\")","handlingStrategy":"validation","validationCode":"title = (title or '').strip()\nif not title:\n    raise ValueError('title required')\nregistry.create(title=title, thesis=thesis)","typeGuard":"def has_title(t) -> bool:\n    return isinstance(t, str) and bool(t.strip())","tryCatchPattern":"try:\n    hyp = registry.create(title=title, thesis=thesis)\nexcept ValueError as exc:\n    show_form_error(str(exc))  # 'title is required' / 'thesis is required'","preventionTips":["Make title a required field in forms/API schemas","Strip and assert non-empty before calling create","Validate at the edge so the registry never sees blanks"],"tags":["python","validation","required-field"],"backgroundTag":"missing-required-field","analyzedSha":"80ffdda44c5c4db0dd84d70e051cca591cea67df","analyzedAt":"2026-08-28T12:46:38.989Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}