{"record":{"id":"0c945a52a2223b4c","repo":"xai-org/grok-build","slug":"preserve-on-a-projected-grove-source-is-not-suppor","errorCode":null,"errorMessage":"preserve on a projected Grove source is not supported","messagePattern":"preserve on a projected Grove source is not supported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codegen/xai-fast-worktree/src/worktree/execute.rs","lineNumber":350,"sourceCode":"                    reasons = skipped_reasons.join(\"; \"),\n                    \"using file copy fallback (fast paths failed)\"\n                );\n            }\n\n            match &plan.creation_mode {\n                CreationMode::Linked => {\n                    // Status-confirmed linked Grove views must not copy the\n                    // projection (hang / projected state) when CreateWorktree\n                    // declines. Preserve fails; projected+clean may git-checkout.\n                    let linked_view = plan.nfs.as_ref().is_some_and(|opts| {\n                        crate::nfs::source_is_linked_local_view(opts, &plan.source)\n                    });\n                    if crate::nfs::dest_is_projected_mount(&plan.source) {\n                        if matches!(\n                            plan.working_tree,\n                            crate::WorkingTreeMode::PreserveWorkingTree\n                        ) {\n                            anyhow::bail!(\"preserve on a projected Grove source is not supported\");\n                        }\n                        tracing::info!(\n                            source = %plan.source.display(),\n                            \"projected source: skipping copy fallback, using git checkout\"\n                        );\n                        execute_git_checkout_worktree(plan)\n                    } else if linked_view {\n                        anyhow::bail!(\n                            \"linked Grove source: CreateWorktree declined; refusing copy fallback\"\n                        );\n                    } else {\n                        execute_copy_worktree(plan)\n                    }\n                }\n                CreationMode::Standalone => execute_standalone_worktree(plan),\n                _ => unreachable!(),\n            }\n        }","sourceCodeStart":332,"sourceCodeEnd":368,"githubUrl":"https://github.com/xai-org/grok-build/blob/bc7f02eddd3d84085849dc19ed216f11c23b0571/crates/codegen/xai-fast-worktree/src/worktree/execute.rs#L332-L368","documentation":"In execute_create_worktree_dispatch, when the plan's source is detected as a projected NFS/Grove mount (dest_is_projected_mount) and the requested working-tree mode is PreserveWorkingTree, the library refuses to proceed. Projected (lazily-materialized) sources cannot be 'preserved' because their files are not fully materialized on disk, so copy/preserve semantics are undefined; the call fails fast instead of producing a broken worktree.","triggerScenarios":"Creating a worktree whose plan.source points at a projected Grove mount while plan.working_tree == WorkingTreeMode::PreserveWorkingTree.","commonSituations":"Reusing an existing CreateWorktree request template that had preserve mode enabled, then pointing it at a Grove/NFS-projected source; a workload migrated from a normal checkout to a projected Grove source without updating the working-tree mode.","solutions":["Set plan.working_tree to a non-preserve mode (e.g. default checkout) when the source is projected.","Re-issue the CreateWorktree request without PreserveWorkingTree; the dispatcher will use git checkout for projected sources.","If preserve is genuinely required, use a fully-materialized (non-projected) source directory."],"exampleFix":"// before\nplan.working_tree = WorkingTreeMode::PreserveWorkingTree; // source is projected Grove\n// after\nif crate::nfs::dest_is_projected_mount(&source) {\n    plan.working_tree = WorkingTreeMode::GitCheckout;\n}","handlingStrategy":"validation","validationCode":"if crate::nfs::dest_is_projected_mount(&source)\n    && mode == crate::WorkingTreeMode::PreserveWorkingTree {\n    return Err(anyhow::anyhow!(\n        \"preserve is unsupported for projected source {source:?}; use a checkout mode\"\n    ));\n}","typeGuard":null,"tryCatchPattern":"match create_worktree(plan) {\n    Err(e) if e.to_string().contains(\"preserve on a projected\") => {\n        let mut plan = plan.clone();\n        plan.working_tree = WorkingTreeMode::GitCheckout;\n        create_worktree(&plan).context(\"fallback checkout also failed\")?\n    }\n    other => other,\n}","preventionTips":["Detect projected sources at request-assembly time and normalize the mode","Never reuse preserve-mode templates for Grove-backed sources","Document that preserve requires a fully-materialized source","Log source mount type alongside each create request for triage"],"tags":["worktree","nfs","unsupported-operation","grove"],"backgroundTag":"unsupported-mode-for-projected-source","analyzedSha":"bc7f02eddd3d84085849dc19ed216f11c23b0571","analyzedAt":"2026-08-31T04:59:42.031Z","schemaVersion":2},"datasetVersion":"2026-08-31T09:17:48.483Z"}