{"record":{"id":"6487bc5346ac56b1","repo":"astrid-runtime/astrid","slug":"legacy-capsule-authority-root-contains-a-non-regul-6487bc","errorCode":null,"errorMessage":"legacy capsule authority root contains a non-regular entry: {}","messagePattern":"legacy capsule authority root contains a non-regular entry: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-capsule-install/src/authority/status.rs","lineNumber":73,"sourceCode":"        )\n    })?;\n\n    let permitted = workspace_targets\n        .iter()\n        .map(|target| authority_paths(home, target).map(|paths| paths.active))\n        .collect::<anyhow::Result<BTreeSet<_>>>()?;\n    let mut status = LegacyAuthorityReceiptStatus::default();\n    let mut entries = std::fs::read_dir(&directory)\n        .with_context(|| format!(\"read legacy capsule authority root {}\", directory.display()))?\n        .collect::<Result<Vec<_>, _>>()\n        .with_context(|| format!(\"read legacy capsule authority root {}\", directory.display()))?;\n    entries.sort_by_key(std::fs::DirEntry::file_name);\n    for entry in entries {\n        let path = entry.path();\n        let metadata = std::fs::symlink_metadata(&path)\n            .with_context(|| format!(\"inspect legacy capsule authority {}\", path.display()))?;\n        if metadata.file_type().is_symlink() || !metadata.is_file() {\n            bail!(\n                \"legacy capsule authority root contains a non-regular entry: {}\",\n                path.display()\n            );\n        }\n        let Some(name) = path.file_name().and_then(|name| name.to_str()) else {\n            bail!(\n                \"legacy capsule authority entry has a non-UTF-8 name: {}\",\n                path.display()\n            );\n        };\n        if name.ends_with(\".pending\") {\n            status.pending.push(path);\n        } else if name.ends_with(\".previous\") {\n            status.previous.push(path);\n        } else if !path\n            .extension()\n            .is_some_and(|extension| extension.eq_ignore_ascii_case(\"json\"))\n            || !permitted.contains(&path)","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-capsule-install/src/authority/status.rs#L55-L91","documentation":"While enumerating entries of the legacy authority root for status reporting, legacy_authority_receipt_status requires each entry (via fs::symlink_metadata) to be a regular file. Any symlink, subdirectory, or special file triggers this error so status is never computed from redirected or non-file entries.","triggerScenarios":"Calling legacy_capsule_authority_status (or its test callers) when any entry in the authority root (status.rs:73) is a symlink/directory/FIFO — e.g. a stray subdirectory or a symlinked receipt left by a dotfile manager.","commonSituations":"Manual cleanup left a backup subdirectory inside the authority root; receipts symlinked into a synced folder; a socket or pipe created by another tool in that directory.","solutions":["Find the offending entry with find <authority-root> ! -type f and move non-files out of the directory","Replace symlinked receipt entries with real file copies","Keep the authority directory flat: only regular receipt files belong there","Re-run the status command after cleaning to confirm"],"exampleFix":"// before\n~/.astrid/authority/archive/ (subdirectory)\n// after\n$ mv ~/.astrid/authority/archive ~/astrid-archive/\n$ astrid authority status","handlingStrategy":"validation","validationCode":"let bad: Vec<_> = std::fs::read_dir(root)?.filter_map(Result::ok)\n    .filter(|e| !std::fs::symlink_metadata(e.path()).map(|m| m.is_file()).unwrap_or(false))\n    .map(|e| e.path()).collect();\nif !bad.is_empty() { eprintln!(\"move these out first: {:?}\", bad); }","typeGuard":"fn entry_is_regular(p: &Path) -> bool {\n    std::fs::symlink_metadata(p).map(|m| !m.is_symlink() && m.is_file()).unwrap_or(false)\n}","tryCatchPattern":null,"preventionTips":["Treat the authority directory as tool-managed: only regular receipt files inside","Avoid leaving backup subdirectories in the authority root","Check with find after any manual file operations in .astrid"],"tags":["filesystem","symlink","directory"],"backgroundTag":"incompatible-source-type","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}