{"record":{"id":"e5430a901a532680","repo":"Hmbown/CodeWhale","slug":"fleet-task-instructions-cannot-be-empty","errorCode":null,"errorMessage":"fleet task {} instructions cannot be empty","messagePattern":"fleet task (.+?) instructions cannot be empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/fleet/task_spec.rs","lineNumber":169,"sourceCode":"\npub fn validate_task_spec_document(doc: &FleetTaskSpecDocument) -> Result<()> {\n    if doc.security_policy.is_some() {\n        bail!(\n            \"fleet task spec security_policy is a legacy compatibility field, not executable Fleet identity; configure trust, secrets, approvals, sandboxing, and tool authority through Runtime policy\"\n        );\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)?;","sourceCodeStart":151,"sourceCodeEnd":187,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/fleet/task_spec.rs#L151-L187","documentation":"Each fleet task must carry non-empty instructions. validate_task_spec_document (crates/tui/src/fleet/task_spec.rs:169) rejects a task whose `instructions` field is empty or whitespace-only, since instructions are what the worker executes.","triggerScenarios":"A [[tasks]] block has `instructions = \"\"`, only whitespace, or the key omitted and defaulted to empty, when the document is validated.","commonSituations":"Template blocks left with placeholder-empty instructions; YAML/TOML generators emitting empty strings when a prompt variable is unset.","solutions":["Write concrete instructions in the task's `instructions` field","Fix the upstream variable/templating that produced an empty prompt","Validate the spec before queueing"],"exampleFix":"# before\n[[tasks]]\nid = \"build\"\ninstructions = \"\"\n# after\n[[tasks]]\nid = \"build\"\ninstructions = \"Run cargo build --release and report failures\"","handlingStrategy":"validation","validationCode":"if task.instructions.trim().is_empty() {\n    return Err(format!(\"task {} needs non-empty instructions\", task.id));\n}","typeGuard":null,"tryCatchPattern":"match load_task_spec_document(path) {\n    Ok(doc) => doc,\n    Err(e) if e.to_string().contains(\"instructions cannot be empty\") => {\n        eprintln!(\"{}: fill in the task instructions\", path.display());\n        return;\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Never emit instructions = \"\" from generators; omit or fill","Fail template rendering early when the prompt variable is empty","Review specs for placeholder text before queueing runs"],"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"}