{"record":{"id":"cf647bb1b63cf1ec","repo":"shareAI-lab/learn-claude-code","slug":"meta-description-must-be-a-string","errorCode":null,"errorMessage":"meta.description must be a string","messagePattern":"meta\\.description must be a string","errorType":"validation","errorClass":"WorkflowInputError","httpStatus":null,"severity":"error","filePath":"s16_workflow_runtime/code.py","lineNumber":131,"sourceCode":"        local_lock.release()\n        with _run_locks_guard:\n            if not local_lock.locked() and _run_locks.get(run_id) is local_lock:\n                _run_locks.pop(run_id, None)\n\n\n# -- Metadata Validation --\ndef validate_meta(meta):\n    \"\"\"Validate name, description, and optional phases before launch.\"\"\"\n    if not isinstance(meta, dict):\n        raise WorkflowInputError(\"meta must be an object literal\")\n    if not meta.get(\"name\") or not meta.get(\"description\"):\n        raise WorkflowInputError(\"meta requires `name` and `description`\")\n    if not isinstance(meta[\"name\"], str) or not WORKFLOW_NAME_RE.fullmatch(meta[\"name\"]):\n        raise WorkflowInputError(\n            \"meta.name must be a 1-64 character slug using letters, numbers, '.', '_', or '-'\"\n        )\n    if not isinstance(meta[\"description\"], str):\n        raise WorkflowInputError(\"meta.description must be a string\")\n    if \"phases\" in meta:\n        if not isinstance(meta[\"phases\"], list) or not all(\n            isinstance(phase, str) and phase for phase in meta[\"phases\"]\n        ):\n            raise WorkflowInputError(\"meta.phases must be a list of non-empty strings\")\n    return meta\n\n\ndef check_permission(meta, settings=None):\n    \"\"\"Apply the s03 allow/deny gate before launching a workflow.\"\"\"\n    settings = settings or {}\n    if meta[\"name\"] in settings.get(\"deny\", []):\n        raise WorkflowInputError(f\"workflow '{meta['name']}' denied by settings\")\n    return \"allow\"\n\n\n# -- Minimal JSON Schema --\nclass SimpleJsonSchema:","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/shareAI-lab/learn-claude-code/blob/985456f4adea6f4df8fbad4112245dbd97444eae/s16_workflow_runtime/code.py#L113-L149","documentation":"After the presence check, validate_meta requires meta['description'] specifically to be a str. Non-string truthy values — a number, list, or dict — pass the earlier truthiness gate but fail here, because the description is surfaced in UIs/logs and compared as text.","triggerScenarios":"run(meta={\"name\": \"ingest\", \"description\": 42}) or description set to a list of bullet points [\"a\", \"b\"]. YAML configs where an unquoted description parses as a number or boolean (yes/no).","commonSituations":"YAML implicit typing (description: 2024 becomes an int; description: yes becomes a bool). Programmatically inserting a computed value that happens to be non-text.","solutions":["Quote the description in YAML; ensure the value is a plain string","Wrap computed descriptions with str(...) at the boundary","For structured content, serialize to a string (e.g. json.dumps) first"],"exampleFix":"# before (YAML)\n# description: 2024-01-30   <- parsed as a date object\n\n# after\ndescription: \"Nightly ingest run for 2024-01-30\"","handlingStrategy":"type-guard","validationCode":"def description_is_str(meta: dict) -> bool:\n    return isinstance(meta.get(\"description\"), str) and bool(meta[\"description\"])\n\nassert description_is_str(meta)","typeGuard":"def meta_description_is_string(meta) -> bool:\n    return isinstance(meta, dict) and isinstance(meta.get(\"description\"), str)","tryCatchPattern":"try:\n    validate_meta(meta)\nexcept WorkflowInputError as exc:\n    if \"description must be a string\" in str(exc):\n        meta = {**meta, \"description\": str(meta[\"description\"])}\n        validate_meta(meta)\n    else:\n        raise","preventionTips":["Quote YAML description values","str() computed descriptions at the boundary","Beware YAML implicit typing of numbers/booleans/dates"],"tags":["workflow","validation","metadata","type-error","yaml"],"backgroundTag":null,"analyzedSha":"985456f4adea6f4df8fbad4112245dbd97444eae","analyzedAt":"2026-08-14T22:02:26.028Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}