{"record":{"id":"a027ef5b8d64dea7","repo":"nikivdev/code","slug":"review-todo-not-found","errorCode":null,"errorMessage":"Review todo '{}' not found","messagePattern":"Review todo '(.+?)' not found","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/reviews_todo.rs","lineNumber":147,"sourceCode":"        .filter(|(_, item)| {\n            item.external_ref\n                .as_deref()\n                .map(|r| r.starts_with(\"flow-review-issue-\"))\n                .unwrap_or(false)\n        })\n        .map(|(i, _)| i)\n        .collect();\n\n    // Match by id prefix among review items\n    let mut matches = Vec::new();\n    for &idx in &review_indices {\n        if items[idx].id == id || items[idx].id.starts_with(id) {\n            matches.push(idx);\n        }\n    }\n\n    let idx = match matches.len() {\n        0 => bail!(\"Review todo '{}' not found\", id),\n        1 => matches[0],\n        _ => bail!(\"Review todo id '{}' is ambiguous\", id),\n    };\n\n    if items[idx].status == \"completed\" {\n        println!(\"Already completed: {}\", items[idx].id);\n        return Ok(());\n    }\n\n    items[idx].status = \"completed\".to_string();\n    items[idx].updated_at = Some(Utc::now().to_rfc3339());\n    todo::save_items(&path, &items)?;\n    println!(\"✓ {} -> completed\", items[idx].id);\n\n    Ok(())\n}\n\nfn fix_review_todos(id: Option<&str>, all: bool) -> Result<()> {","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/reviews_todo.rs#L129-L165","documentation":"done_review_todo (src/reviews_todo.rs) matches a user-supplied todo id against stored review todos by exact match or prefix. When zero items match, it bails with 'Review todo ... not found'. This surfaces typos or ids referencing completed/removed todos.","triggerScenarios":"Calling the done/todo-complete command with an id that neither equals any stored todo id nor is a prefix of one.","commonSituations":"Using a prefix that is shorter than the stored id and matches nothing; the todo was already completed and pruned from the list; stale todos file; typo in the id.","solutions":["List current review todos to get valid ids (e.g. list todos command)","Use the full id or a longer unambiguous prefix","Check the todos file location is the one you expect (correct repo/root)"],"exampleFix":"// before\ndone_review_todo(root, \"abc\")  // no todo starts with \"abc\"\n// after\ndone_review_todo(root, \"abc123de\")  // full id from the todo list","handlingStrategy":"validation","validationCode":"let ids = list_review_todos(root)?;\nlet id = ids.iter().find(|t| t.id == requested || t.id.starts_with(requested))\n    .ok_or_else(|| anyhow!(\"id {requested} not in current todos\"))?;\ndone_review_todo(root, &id.id)?;","typeGuard":null,"tryCatchPattern":"match done_review_todo(root, id) {\n    Err(e) if e.to_string().contains(\"not found\") => eprintln!(\"run the todo list command to get valid ids\"),\n    other => other?,\n}","preventionTips":["Always copy ids from a fresh listing of the todos","Use full ids, not minimal prefixes","Re-list todos after any fix/done cycle since ids can change"],"tags":["cli","lookup","not-found"],"backgroundTag":"resource-not-found","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}