{"record":{"id":"7e8c5a7e478ae99c","repo":"Hmbown/CodeWhale","slug":"fleet-task-task-id-tag-cannot-be-empty","errorCode":null,"errorMessage":"fleet task {task_id} tag cannot be empty","messagePattern":"fleet task (.+?) tag cannot be empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/fleet/task_spec.rs","lineNumber":449,"sourceCode":"    Ok(receipt)\n}\n\npub fn record_verification_receipt(\n    ledger: &FleetLedger,\n    workspace: &Path,\n    input: &FleetTaskVerificationInput,\n    verification: FleetTaskVerification,\n) -> Result<FleetReceipt> {\n    let receipt = prepare_verification_receipt(workspace, input, verification)?;\n    ledger.record_receipt(receipt.clone())?;\n    Ok(receipt)\n}\n\nfn validate_tags(task_id: &str, tags: &[String]) -> Result<()> {\n    let mut seen = BTreeSet::new();\n    for tag in tags {\n        if tag.trim().is_empty() {\n            bail!(\"fleet task {task_id} tag cannot be empty\");\n        }\n        if !seen.insert(tag) {\n            bail!(\"fleet task {task_id} has duplicate tag {tag}\");\n        }\n    }\n    Ok(())\n}\n\nfn validate_workspace_requirements(task: &FleetTaskSpec) -> Result<()> {\n    let Some(workspace) = &task.workspace else {\n        return Ok(());\n    };\n    let env = workspace.environment.as_ref();\n    for name in env\n        .into_iter()\n        .flat_map(|env| env.required.iter().chain(env.allowlist.iter()))\n    {\n        if name.trim().is_empty() {","sourceCodeStart":431,"sourceCodeEnd":467,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/fleet/task_spec.rs#L431-L467","documentation":"Fleet task spec validation rejects a tag entry that is empty or whitespace-only. Tags identify/classify tasks, and an empty tag carries no information and breaks downstream lookups. validate_tags iterates every tag in the task's tag list and fails fast on the first blank one.","triggerScenarios":"Calling validate_task_spec_document (via validate_tags) with a FleetTaskSpec whose tags array contains \"\" or a whitespace-only string like \" \".","commonSituations":"Hand-edited JSON/YAML task specs with a trailing comma leaving an empty entry; programmatic tag construction where a split/join on an empty label produced \"\"; copy-pasted specs with placeholder tags never filled in.","solutions":["Remove empty or whitespace-only entries from the task's tags array before validation.","Trim user-supplied tag input and skip blank values at spec-construction time.","Add a UI/editor check that refuses saving a spec with blank tags."],"exampleFix":"// before\n\"tags\": [\"gpu\", \"\"]\n// after\n\"tags\": [\"gpu\"]","handlingStrategy":"validation","validationCode":"fn has_no_blank_tags(tags: &[String]) -> bool { tags.iter().all(|t| !t.trim().is_empty()) }","typeGuard":"fn valid_tag(t: &str) -> bool { !t.trim().is_empty() }","tryCatchPattern":null,"preventionTips":["Trim and filter tag input at spec construction","Deduplicate and drop blank entries before saving specs","Validate specs in the UI before persisting"],"tags":["validation","fleet","config"],"backgroundTag":"empty-required-field","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}