{"record":{"id":"e6325035f6876a11","repo":"Hmbown/CodeWhale","slug":"unsupported-hunt-verdict-task-update-other-ex","errorCode":null,"errorMessage":"unsupported hunt_verdict task update '{other}'. Expected one of: hunting, hunted, wounded, escaped","messagePattern":"unsupported hunt_verdict task update '(.+?)'\\. Expected one of: hunting, hunted, wounded, escaped","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/task_manager.rs","lineNumber":3052,"sourceCode":"            &QueueFile {\n                queue: queue.iter().cloned().collect(),\n            },\n        )\n    }\n\n    fn persist_task_locked(&self, task: &TaskRecord) -> Result<()> {\n        let path = self.tasks_dir.join(format!(\"{}.json\", task.id));\n        write_json_atomic(&path, task)\n    }\n}\n\nfn normalize_hunt_verdict(raw: &str) -> Result<&'static str> {\n    match raw.trim() {\n        \"hunting\" => Ok(\"hunting\"),\n        \"hunted\" => Ok(\"hunted\"),\n        \"wounded\" => Ok(\"wounded\"),\n        \"escaped\" => Ok(\"escaped\"),\n        other => bail!(\n            \"unsupported hunt_verdict task update '{other}'. Expected one of: hunting, hunted, wounded, escaped\"\n        ),\n    }\n}\n\nfn validate_preallocated_task_id(task_id: &str) -> Result<()> {\n    if task_id.len() != 21\n        || !task_id.starts_with(\"task_\")\n        || !task_id[5..].chars().all(|ch| ch.is_ascii_hexdigit())\n    {\n        bail!(\"Invalid preallocated task id: expected task_<16hex>\");\n    }\n    Ok(())\n}\n\nfn read_bound_task_file(path: &Path, task_id: &str) -> Result<Option<TaskRecord>> {\n    let bytes = match fs::read(path) {\n        Ok(bytes) => bytes,","sourceCodeStart":3034,"sourceCodeEnd":3070,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/crates/tui/src/task_manager.rs#L3034-L3070","documentation":"normalize_hunt_verdict validates the hunt_verdict task update field against the closed set {hunting, hunted, wounded, escaped} (whitespace-trimmed). Any other string is rejected with the full allowed list in the message.","triggerScenarios":"Submitting a task update with hunt_verdict set to an unrecognized value — e.g. \"Hunted\" (wrong case), \"hunt\", \"kill\", \"\", or a typo — through the hunt-verdict update path.","commonSituations":"UI/automation sending verdicts in different casing or from an older vocabulary; hand-written scripts or tests using invented verdict names; schema drift between a producer and this validator.","solutions":["Use exactly one of: hunting, hunted, wounded, escaped (trimmed)","Normalize casing and trim the incoming verdict before sending","Map legacy verdict names to the supported set at the producer"],"exampleFix":"// before\nupdate(\\\"task_abc...\\\", TaskUpdate { hunt_verdict: Some(\"Hunted\".into()) });\n// after\nlet verdict = raw.trim().to_lowercase();\nanyhow::ensure!(matches!(verdict.as_str(), \"hunting\"|\"hunted\"|\"wounded\"|\"escaped\"), \"bad verdict {verdict}\");\nupdate(\\\"task_abc...\\\", TaskUpdate { hunt_verdict: Some(verdict) });","handlingStrategy":"validation","validationCode":"const VERDICTS: [&str; 4] = [\"hunting\", \"hunted\", \"wounded\", \"escaped\"];\nif !VERDICTS.contains(&raw.trim()) {\n    return Err(format!(\"bad hunt_verdict: {raw}\"));\n}","typeGuard":"fn is_hunt_verdict(s: &str) -> Option<&'static str> {\n    [\"hunting\",\"hunted\",\"wounded\",\"escaped\"].into_iter().find(|v| *v == s.trim())\n}","tryCatchPattern":"match normalize_hunt_verdict(raw) {\n    Ok(v) => apply(v),\n    Err(e) => { /* surface allowed values to the caller/UI */ }\n}","preventionTips":["Centralize verdict constants and share them with producers","Normalize casing/whitespace before sending updates","Version the verdict vocabulary when it changes"],"tags":["validation","enum","tasks"],"backgroundTag":"invalid-enum-value","analyzedSha":"433685b2024e7bc4c99e1e2e326bcad39b4d9d65","analyzedAt":"2026-09-15T12:24:24.634Z","contentChangedAt":"2026-09-15T12:24:24.634Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}