{"record":{"id":"eb382b6814c56923","repo":"xai-org/grok-build","slug":"invalid-source-path","errorCode":null,"errorMessage":"Invalid source path: {}","messagePattern":"Invalid source path: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codegen/xai-grok-workspace/src/worktree/mod.rs","lineNumber":977,"sourceCode":"        && let Err(e) = db.touch(&record.id)\n    {\n        // A failing touch silently degrades expiry back to created_at;\n        // leave log evidence without bothering callers.\n        tracing::debug!(error = %e, id = %record.id, \"worktree touch failed\");\n    }\n}\n\n// ============================================================================\n// Worktree Lifecycle: Create\n// ============================================================================\n\npub async fn prepare_worktree_creation(req: &CreateWorktreeRequest) -> PrepareWorktreeResult {\n    let source_path = Path::new(&req.source_path);\n    let git_root = match find_main_repo_root_from_path(source_path) {\n        Ok(root) => root,\n        Err(e) => {\n            return PrepareWorktreeResult {\n                response: Err(anyhow::anyhow!(\"Invalid source path: {}\", e)),\n                spawn_task: false,\n            };\n        }\n    };\n\n    let worktree_path = resolve_worktree_path(req, &git_root);\n    let source_git_root = find_git_root_from_path(source_path)\n        .ok()\n        .map(|p| p.to_string_lossy().to_string());\n\n    if is_worktree_in_progress(&req.session_id).await {\n        return PrepareWorktreeResult {\n            response: Ok(CreateWorktreeResponse::Creating {\n                session_id: req.session_id.clone(),\n                worktree_path: worktree_path.clone(),\n                source_git_root,\n            }),\n            spawn_task: false,","sourceCodeStart":959,"sourceCodeEnd":995,"githubUrl":"https://github.com/xai-org/grok-build/blob/bc7f02eddd3d84085849dc19ed216f11c23b0571/crates/codegen/xai-grok-workspace/src/worktree/mod.rs#L959-L995","documentation":"Error \"Invalid source path: {}\" thrown in xai-org/grok-build.","triggerScenarios":"Thrown at crates/codegen/xai-grok-workspace/src/worktree/mod.rs:977 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bc7f02eddd3d84085849dc19ed216f11c23b0571","analyzedAt":"2026-08-31T04:59:42.031Z","schemaVersion":2},"datasetVersion":"2026-08-31T09:17:48.483Z"}