{"record":{"id":"c1b6672825afdcb5","repo":"openai/codex","slug":"consolidated-memory-artifact-is-not-a-file","errorCode":null,"errorMessage":"consolidated memory artifact is not a file: {}","messagePattern":"consolidated memory artifact is not a file: (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/memories/write/src/workspace.rs","lineNumber":65,"sourceCode":"    reset_git_repository(root).await\n}\n\n/// Verifies that a completed consolidation run left the required memory artifacts in place.\npub async fn validate_consolidation_artifacts(root: &Path) -> anyhow::Result<()> {\n    let removed_symlinks = remove_memory_symlinks(root).await?;\n    anyhow::ensure!(\n        removed_symlinks == 0,\n        \"removed {removed_symlinks} symbolic links from consolidated memory workspace\"\n    );\n\n    let memory_path = root.join(\"MEMORY.md\");\n    let memory_metadata = tokio::fs::metadata(&memory_path).await.with_context(|| {\n        format!(\n            \"read consolidated memory artifact {}\",\n            memory_path.display()\n        )\n    })?;\n    anyhow::ensure!(\n        memory_metadata.is_file(),\n        \"consolidated memory artifact is not a file: {}\",\n        memory_path.display()\n    );\n\n    let summary_path = root.join(\"memory_summary.md\");\n    let summary = tokio::fs::read_to_string(&summary_path)\n        .await\n        .with_context(|| format!(\"read memory summary artifact {}\", summary_path.display()))?;\n    anyhow::ensure!(\n        summary.lines().next() == Some(\"v1\"),\n        \"memory summary artifact does not start with v1: {}\",\n        summary_path.display()\n    );\n\n    Ok(())\n}\n","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/memories/write/src/workspace.rs#L47-L83","documentation":"validate_consolidation_artifacts resolved MEMORY.md in the memory root but its metadata shows it is not a regular file (e.g. a directory, fifo, or device). The consolidated memory artifact must be a plain file for later reads to be safe.","triggerScenarios":"Thrown at codex-rs/memories/write/src/workspace.rs:65 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the non-file entry and re-run consolidation to regenerate MEMORY.md","Investigate what replaced MEMORY.md with a non-regular file","Restore from the memory git history if available"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}