{"record":{"id":"9835f11aa06a813e","repo":"Hmbown/CodeWhale","slug":"fleet-task-objective-cannot-be-empty","errorCode":null,"errorMessage":"fleet task {} objective cannot be empty","messagePattern":"fleet task (.+?) objective cannot be empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/fleet/task_spec.rs","lineNumber":174,"sourceCode":"        );\n    }\n    if doc.tasks.is_empty() {\n        bail!(\"fleet task spec must include at least one task\");\n    }\n    let mut ids = BTreeSet::new();\n    for task in &doc.tasks {\n        validate_fleet_identity(\"task id\", &task.id)?;\n        if !ids.insert(task.id.clone()) {\n            bail!(\"duplicate fleet task id {}\", task.id);\n        }\n        validate_fleet_name(&format!(\"task {} name\", task.id), &task.name)?;\n        if task.instructions.trim().is_empty() {\n            bail!(\"fleet task {} instructions cannot be empty\", task.id);\n        }\n        if let Some(objective) = &task.objective\n            && objective.trim().is_empty()\n        {\n            bail!(\"fleet task {} objective cannot be empty\", task.id);\n        }\n        validate_worker_profile(&task.id, task.worker.as_ref())?;\n        if task\n            .metadata\n            .contains_key(super::worker_runtime::FROZEN_FLEET_MEMBER_METADATA_KEY)\n        {\n            bail!(\n                \"fleet task {} metadata key {} is reserved for the durable Runtime selection receipt\",\n                task.id,\n                super::worker_runtime::FROZEN_FLEET_MEMBER_METADATA_KEY\n            );\n        }\n        validate_tags(&task.id, &task.tags)?;\n        validate_workspace_requirements(task)?;\n    }\n    let mut worker_ids = BTreeSet::new();\n    for worker in &doc.workers {\n        validate_fleet_identity(\"worker id\", &worker.id)?;","sourceCodeStart":156,"sourceCodeEnd":192,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/fleet/task_spec.rs#L156-L192","documentation":"If a fleet task supplies an optional `objective`, it must be non-empty. validate_task_spec_document (crates/tui/src/fleet/task_spec.rs:174) bails when objective is present but trims to empty, preventing meaningless objectives from entering a run.","triggerScenarios":"A [[tasks]] block sets `objective = \"\"` or whitespace; the document passes through load_task_spec_document or create_queued_run_with_descriptor.","commonSituations":"Copy-pasted blocks with an objective key left blank; generators that always emit the objective key even when no value was provided.","solutions":["Fill in a real objective string, or remove the objective key entirely","Fix the generator to omit objective when unset","Re-validate the document"],"exampleFix":"# before\n[[tasks]]\nid = \"build\"\ninstructions = \"Run build\"\nobjective = \"  \"\n# after\n[[tasks]]\nid = \"build\"\ninstructions = \"Run build\"\nobjective = \"Produce a clean release binary\"","handlingStrategy":"validation","validationCode":"if let Some(o) = &task.objective {\n    if o.trim().is_empty() {\n        return Err(format!(\"task {} has empty objective; set it or remove the key\", task.id));\n    }\n}","typeGuard":null,"tryCatchPattern":"match load_task_spec_document(path) {\n    Ok(doc) => doc,\n    Err(e) if e.to_string().contains(\"objective cannot be empty\") => {\n        eprintln!(\"{}: supply an objective or delete the key\", path.display());\n        return;\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Only emit the objective key when a real value exists","Omit optional keys rather than writing empty strings","Validate specs before create_queued_run_with_descriptor"],"tags":["config","fleet","validation"],"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"}