{"record":{"id":"de00d1f0dc5c4b54","repo":"nikivdev/code","slug":"bike-app-not-found-at","errorCode":null,"errorMessage":"Bike.app not found at {}","messagePattern":"Bike\\.app not found at (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/todo.rs","lineNumber":80,"sourceCode":"        .map(|name| name.to_string())\n        .filter(|name| !name.trim().is_empty())\n        .unwrap_or_else(|| \"project\".to_string());\n\n    let dir = root.join(\".ai\").join(\"todos\");\n    let path = dir.join(format!(\"{}.bike\", project_name));\n    fs::create_dir_all(&dir)?;\n    let needs_init = match fs::read_to_string(&path) {\n        Ok(content) => !looks_like_bike(&content),\n        Err(_) => true,\n    };\n    if needs_init {\n        let content = render_bike_template(&project_name);\n        fs::write(&path, content)?;\n    }\n\n    let bike_app = Path::new(\"/System/Volumes/Data/Applications/Bike.app\");\n    if !bike_app.exists() {\n        bail!(\"Bike.app not found at {}\", bike_app.display());\n    }\n\n    let status = Command::new(\"open\")\n        .arg(\"-a\")\n        .arg(bike_app)\n        .arg(&path)\n        .status()\n        .context(\"failed to launch Bike.app\")?;\n    if !status.success() {\n        bail!(\"Bike.app failed to open {}\", path.display());\n    }\n\n    Ok(())\n}\n\nfn looks_like_bike(content: &str) -> bool {\n    let trimmed = content.trim_start();\n    if !trimmed.starts_with(\"<?xml\") {","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/todo.rs#L62-L98","documentation":"Raised by open_bike (src/todo.rs:80) when the Bike.app application bundle is not present at the hardcoded path /System/Volumes/Data/Applications/Bike.app. Before invoking `open -a Bike.app <file>`, the code checks bike_app.exists() and bails if the bundle is missing, because macOS `open` would otherwise fail obscurely.","triggerScenarios":"Calling the todo open command (via run) on a machine where Bike.app (the macOS outliner) is not installed, is installed only in ~/Applications or /Applications instead of the expected path, or was moved/renamed/uninstalled.","commonSituations":"Fresh macOS installs without Bike.app; apps installed per-user in ~/Applications while the code probes the system /System/Volumes/Data/Applications path; running the tool on Linux/CI where the path never exists.","solutions":["Install Bike.app, or if already installed, symlink it to /System/Volumes/Data/Applications/Bike.app (e.g. `ln -s /Applications/Bike.app /System/Volumes/Data/Applications/Bike.app`).","Check the actual install location with `mdfind Bike.app` and adjust or patch the hardcoded path.","Skip the open step or use a different todo app if Bike.app is not available."],"exampleFix":"// before\nlet bike_app = Path::new(\"/System/Volumes/Data/Applications/Bike.app\");\n// after: tolerate common install locations\nlet bike_app = [\"/System/Volumes/Data/Applications/Bike.app\", \"/Applications/Bike.app\"]\n    .iter().map(Path::new).find(|p| p.exists())\n    .ok_or_else(|| anyhow!(\"Bike.app not found\"))?;","handlingStrategy":"validation","validationCode":"use std::path::Path;\nlet candidates = [\"/System/Volumes/Data/Applications/Bike.app\", \"/Applications/Bike.app\"];\nif !candidates.iter().any(|p| Path::new(p).exists()) {\n    eprintln!(\"Bike.app is not installed at any known location\");\n}","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().starts_with(\"Bike.app not found\") => {\n        eprintln!(\"install Bike.app or symlink it into /System/Volumes/Data/Applications\");\n    }\n    Err(e) => return Err(e),\n    Ok(v) => v,\n}","preventionTips":["Install Bike.app system-wide (/Applications) and symlink to the expected path if needed.","Skip todo-open features on non-macOS machines (cfg/target check).","Verify with `mdfind Bike.app` after macOS updates that may move app bundles."],"tags":["macos","app-not-found","filesystem"],"backgroundTag":"application-not-installed","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}