{"record":{"id":"9c12acd274ac4f0f","repo":"nikivdev/code","slug":"unable-to-resolve-docs-for","errorCode":null,"errorMessage":"Unable to resolve docs for {}","messagePattern":"Unable to resolve docs for (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/docs.rs","lineNumber":844,"sourceCode":"            .context(\"failed to invoke kill\")?;\n        return Ok(());\n    }\n\n    #[cfg(windows)]\n    {\n        Command::new(\"taskkill\")\n            .args([\"/PID\", &pid.to_string(), \"/F\"])\n            .status()\n            .context(\"failed to invoke taskkill\")?;\n        Ok(())\n    }\n}\n\nfn open_project_docs(project_root: &Path) -> Result<()> {\n    let code_root = config::expand_path(\"~/code\");\n    let org_root = config::expand_path(\"~/org\");\n    let Some(project) = project_docs_for_root(project_root, &code_root, &org_root, false) else {\n        bail!(\"Unable to resolve docs for {}\", project_root.display());\n    };\n\n    let hub_opts = DocsHubOpts {\n        host: \"127.0.0.1\".to_string(),\n        port: 4410,\n        hub_root: \"~/.config/flow/docs-hub\".to_string(),\n        template_root: DEFAULT_DOCS_TEMPLATE_ROOT.to_string(),\n        code_root: \"~/code\".to_string(),\n        org_root: \"~/org\".to_string(),\n        no_ai: true,\n        no_open: true,\n        sync_only: false,\n    };\n    ensure_docs_hub_daemon_with_focus(&hub_opts, Some(project_root))?;\n\n    if !(project_root.starts_with(&code_root) || project_root.starts_with(&org_root)) {\n        println!(\n            \"Docs hub only indexes ~/code and ~/org; {} may not be available.\",","sourceCodeStart":826,"sourceCodeEnd":862,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/docs.rs#L826-L862","documentation":"open_project_docs maps the current project root to its docs by checking whether the path lives under ~/code or ~/org (via project_docs_for_root). If the project root is under neither known root, it cannot resolve a docs hub entry and bails with the project path in the message.","triggerScenarios":"Calling the `run`/docs-open command from a project directory outside ~/code and ~/org — e.g. repos in ~/src, ~/work, /tmp, or a custom checkout directory — or when project_docs_for_root cannot match the root even under those trees.","commonSituations":"Developer keeps repositories in a non-default location (~/dev, ~/projects); symlinks confusing path canonicalization; fresh machine where ~/code/~/org don't exist yet; CI running from arbitrary build directories.","solutions":["Move or symlink the project under ~/code or ~/org so path resolution succeeds (ln -s ~/work/myrepo ~/code/myrepo)","Create the expected roots (mkdir -p ~/code ~/org) if the machine is fresh and relocate projects there","Check for symlinks/case mismatches making the resolved path differ; use the real path for your checkout","If a custom root is supported by the tool configuration, add your checkout directory to it"],"exampleFix":"// before\n$ cd ~/work/myrepo && mytool docs open\nError: Unable to resolve docs for /home/me/work/myrepo\n// after\n$ mkdir -p ~/code && ln -s ~/work/myrepo ~/code/myrepo\n$ cd ~/code/myrepo && mytool docs open\nOpening docs hub for myrepo...","handlingStrategy":"validation","validationCode":"let root = std::fs::canonicalize(cwd)?;\nlet under = |base: &str| root.starts_with(config::expand_path(base));\nif !under(\"~/code\") && !under(\"~/org\") {\n    eprintln!(\"{} is not under ~/code or ~/org; docs cannot be resolved\", root.display());\n    return;\n}\nrun_docs_open()?;","typeGuard":null,"tryCatchPattern":"match run(&cmd) {\n    Err(e) if e.to_string().contains(\"Unable to resolve docs for\") => {\n        eprintln!(\"move or symlink the project under ~/code or ~/org, then retry\");\n    }\n    Err(e) => return Err(e),\n    Ok(()) => {}\n}","preventionTips":["Keep all repositories under ~/code or ~/org (or symlink them there)","Create ~/code and ~/org on new machines before using docs commands","Beware symlinks: canonicalize paths when debugging resolution failures","Document the expected checkout layout for your team to avoid surprise paths like /tmp or ~/Desktop"],"tags":["rust","path-resolution","configuration","docs"],"backgroundTag":"unresolved-project-path","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}