{"record":{"id":"ae7cb7c3e60b83a6","repo":"astrid-runtime/astrid","slug":"git-could-not-enumerate-the-captured-version-chain","errorCode":null,"errorMessage":"git could not enumerate the captured version chain","messagePattern":"git could not enumerate the captured version chain","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-storage-chunker-evidence/src/corpus.rs","lineNumber":95,"sourceCode":"    pub fn version_chain_from_path(name: String, root: &Path) -> Result<Self> {\n        Self::from_files(name, CorpusKind::VersionChain, collect_files(root, false)?)\n    }\n\n    pub fn version_chain_from_git(\n        name: String,\n        repository: &Path,\n        relative_path: &Path,\n    ) -> Result<Self> {\n        validate_relative_git_path(relative_path)?;\n        let revisions = Command::new(\"git\")\n            .args([\"-C\"])\n            .arg(repository)\n            .args([\"rev-list\", \"--reverse\", \"--max-count=32\", \"HEAD\", \"--\"])\n            .arg(relative_path)\n            .output()\n            .context(\"enumerate captured version chain\")?;\n        if !revisions.status.success() {\n            bail!(\"git could not enumerate the captured version chain\");\n        }\n        let revisions = String::from_utf8(revisions.stdout).context(\"git emitted non-UTF-8 IDs\")?;\n        let mut inputs = Vec::new();\n        for revision in revisions.lines() {\n            if revision.is_empty() || !revision.bytes().all(|byte| byte.is_ascii_hexdigit()) {\n                bail!(\"git emitted an invalid revision ID\");\n            }\n            if !git_path_exists_at_revision(repository, relative_path, revision)? {\n                continue;\n            }\n            let object = format!(\"{revision}:{}\", relative_path.to_string_lossy());\n            let version = Command::new(\"git\")\n                .args([\"-C\"])\n                .arg(repository)\n                .args([\"show\", &object])\n                .output()\n                .context(\"read captured version\")?;\n            if !version.status.success() {","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-storage-chunker-evidence/src/corpus.rs#L77-L113","documentation":"`version_chain_from_git` runs `git rev-list --reverse --max-count=32 HEAD -- <path>` to enumerate the file's captured version chain. If the git subprocess exits with a non-zero status, the crate bails with this error since it cannot enumerate the chain.","triggerScenarios":"Calling `version_chain_from_git` against a repository where the `git rev-list` subprocess fails: corrupt repo, missing HEAD, bad relative_path, or git not installed producing an error exit.","commonSituations":"Running the corpus builder outside a valid git worktree; path not tracked on HEAD; shallow/bare repo oddities; corrupted repository metadata.","solutions":["Run `git rev-list --reverse --max-count=32 HEAD -- <path>` manually in the repo to see the underlying error.","Verify the path is tracked and has commits reachable from HEAD.","Confirm you are in a valid, non-corrupt git worktree with a resolvable HEAD.","Check that git is installed and on PATH."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"use std::process::Command;\nlet ok = Command::new(\"git\").arg(\"-C\").arg(&repo).args([\"rev-parse\", \"--is-inside-work-tree\"])\n    .output().map(|o| o.status.success()).unwrap_or(false);\nassert!(ok, \"not a valid git worktree\");","typeGuard":null,"tryCatchPattern":"match version_chain_from_git(&repo, &path, name) {\n    Ok(corpus) => corpus,\n    Err(e) if e.to_string().contains(\"enumerate captured version chain\") => {\n        // surface git stderr / run git rev-list manually to diagnose\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Verify the repository and target path are valid and tracked before building version-chain corpora","Confirm git is installed and reachable on PATH","Run git fsck periodically on repos used as corpus sources"],"tags":["git","subprocess","version-chain"],"backgroundTag":"git-command-failed","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}