{"record":{"id":"493b6f69d583c919","repo":"nikivdev/code","slug":"doc-file-not-found-md","errorCode":null,"errorMessage":"Doc file not found: {}.md","messagePattern":"Doc file not found: (.+?)\\.md","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/docs.rs","lineNumber":249,"sourceCode":"\n    fs::write(&marker_path, format!(\"{} ({})\\n\", now, head))?;\n\n    println!(\"\\n✓ Sync marker updated\");\n    println!(\"\\nTo fully sync docs, use an AI assistant to:\");\n    println!(\"  1. Review recent commits\");\n    println!(\"  2. Update changelog.md with new features\");\n    println!(\"  3. Update commands.md if CLI changed\");\n    println!(\"  4. Update architecture.md if structure changed\");\n\n    Ok(())\n}\n\n/// Open a doc file in the editor.\nfn edit_doc(docs_dir: &Path, name: &str) -> Result<()> {\n    let doc_path = docs_dir.join(format!(\"{}.md\", name));\n\n    if !doc_path.exists() {\n        bail!(\"Doc file not found: {}.md\", name);\n    }\n\n    let editor = std::env::var(\"EDITOR\").unwrap_or_else(|_| \"vim\".to_string());\n\n    Command::new(&editor)\n        .arg(&doc_path)\n        .status()\n        .with_context(|| format!(\"failed to open {} with {}\", doc_path.display(), editor))?;\n\n    Ok(())\n}\n\nfn review_pending(limit: usize) -> Result<()> {\n    let reviewed = codex_session_docs::review_pending_entries(limit)?;\n    println!(\n        \"Reviewed {} pending session-doc entr{}\",\n        reviewed,\n        if reviewed == 1 { \"y\" } else { \"ies\" }","sourceCodeStart":231,"sourceCodeEnd":267,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/docs.rs#L231-L267","documentation":"Raised by `edit_doc` (src/docs.rs:249) when the requested doc `<name>.md` does not exist under the docs directory. The tool checks `doc_path.exists()` before launching `$EDITOR` (default vim) and bails with the exact filename it looked for.","triggerScenarios":"Calling `f docs edit <name>` (edit_doc -> run) where `docs_dir/<name>.md` does not exist: the doc was never created, the name is misspelled, the name includes an unintended subdirectory or a wrong case, or the docs directory points at the wrong project.","commonSituations":"Typo in the doc slug, editing a doc created by a teammate under a different name, case-sensitivity on Linux filesystems (README vs readme), or running from a different checkout where the doc was never committed.","solutions":["List the docs directory to find the correct slug, then retry with the exact name","Create the doc first (f docs new/add) if it does not exist","Check case sensitivity — file names must match exactly on Linux","Confirm you are in the intended project so docs_dir resolves correctly"],"exampleFix":"// before\nf docs edit archtecture\nerror: Doc file not found: archtecture.md\n// after\nls .ai/docs/\nf docs edit architecture","handlingStrategy":"validation","validationCode":"let doc = format!(\".ai/docs/{name}.md\");\nif !Path::new(&doc).is_file() {\n    anyhow::bail!(\"unknown doc slug '{name}'; list .ai/docs/ first\");\n}\nf_docs_edit(name)?;","typeGuard":"fn doc_exists(docs_dir: &Path, name: &str) -> bool {\n    docs_dir.join(format!(\"{name}.md\")).is_file()\n}","tryCatchPattern":"match f_docs_edit(name) {\n    Err(e) if e.to_string().starts_with(\"Doc file not found\") => {\n        eprintln!(\"{e:#}; available: {:?}\", list_doc_slugs(docs_dir));\n        // optionally create the doc then retry\n    }\n    other => other?,\n}","preventionTips":["List docs before editing to confirm exact slugs","Match case exactly — Linux filesystems are case-sensitive","Create missing docs with the docs add/new command first","Use tab-completion or a slug list in wrapper scripts"],"tags":["docs","file-not-found","cli"],"backgroundTag":"file-not-found","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}