{"record":{"id":"9b5970ef30b257f3","repo":"AprilNEA/OpenLogi","slug":"in-progress-contribution-contains-unexpected-entry-other","errorCode":null,"errorMessage":"in-progress contribution contains unexpected entry {other:?}; refusing to publish over it","messagePattern":"in-progress contribution contains unexpected entry (.+?); refusing to publish over it","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/openlogi-cli/src/cmd/fixture/contribute.rs","lineNumber":291,"sourceCode":"    super::verify::run(&super::verify::VerifyArgs {\n        directory: directory.to_path_buf(),\n    })\n}\n\nfn validate_resumable_layout(directory: &Path, cassettes: &[HidCassette]) -> Result<()> {\n    for entry in\n        fs::read_dir(directory).context(\"could not inspect resumable contribution directory\")?\n    {\n        let entry = entry.context(\"could not inspect resumable contribution entry\")?;\n        let name = entry.file_name();\n        match name.to_str() {\n            Some(STATE_FILE | PROFILE_FILE) => {}\n            Some(MANIFEST_FILE) => require_regular_file(&entry.path(), \"fixture manifest\")?,\n            Some(CASES_DIRECTORY) if !cassettes.is_empty() => {\n                require_directory(&entry.path(), \"fixture cases directory\")?;\n                validate_resumable_cases(&entry.path(), cassettes)?;\n            }\n            Some(other) => bail!(\n                \"in-progress contribution contains unexpected entry {other:?}; refusing to \\\n                 publish over it\"\n            ),\n            None => bail!(\"in-progress contribution contains a non-UTF-8 entry\"),\n        }\n    }\n    Ok(())\n}\n\nfn validate_resumable_cases(directory: &Path, cassettes: &[HidCassette]) -> Result<()> {\n    let expected = cassettes\n        .iter()\n        .map(|cassette| format!(\"{}.json\", cassette.name))\n        .collect::<Vec<_>>();\n    for entry in fs::read_dir(directory).context(\"could not inspect resumable fixture cases\")? {\n        let entry = entry.context(\"could not inspect resumable fixture case\")?;\n        let name = entry.file_name();\n        let Some(name) = name.to_str() else {","sourceCodeStart":273,"sourceCodeEnd":309,"githubUrl":"https://github.com/AprilNEA/OpenLogi/blob/e846e6f4b4405e33bd6a9aaf949a482ce34cb6d8/crates/openlogi-cli/src/cmd/fixture/contribute.rs#L273-L309","documentation":"Before publishing the fixture manifest, `validate_resumable_layout` audits every entry of the contribution directory against a known allowlist (state file, profile file, manifest file, cases directory). This bail fires when the directory contains a named entry that is none of those — the command refuses to publish over a directory holding unexpected files, because the final publish removes the state file and writes manifests in place and could clobber or mix in unknown content.","triggerScenarios":"Running the publish/finish phase of `openlogi fixture contribute` (or the profile-only path) when DIR contains any extra file or subdirectory besides the expected state/profile/manifest/cases entries — e.g. editor backups, `.DS_Store`-style metadata, notes, or output from another tool written into the contribution directory.","commonSituations":"Editors or OS tools dropping backup/metadata files (`.DS_Store`, `profile.json~`, `Thumbs.db`) into DIR between step 1 and step 2; the user saving logs or notes inside the contribution folder; extracting an archive into DIR; a previous failed run leaving foreign files behind.","solutions":["Remove or move the unexpected entry named in the message out of the contribution directory, then rerun the command.","Check for hidden files (`ls -la DIR`) — backup files and OS metadata like `.DS_Store` often trigger this.","Keep the contribution directory used exclusively by `openlogi fixture contribute`; do all other work elsewhere.","If the entry is expected content the tool should allow, verify whether it belongs under `cases/` instead of the top level."],"exampleFix":"# before\nls fx/  ->  profile.json  state.json  notes.txt\nopenlogi fixture contribute --output fx ...\n# error: unexpected entry \"notes.txt\"\n\n# after\nmv fx/notes.txt ~/notes.txt\nopenlogi fixture contribute --output fx ...   # publishes","handlingStrategy":"validation","validationCode":"const ALLOWED: [&str; 4] = [\"state.json\", \"profile.json\", \"manifest.json\", \"cases\"];\nfn has_foreign_entries(dir: &Path) -> anyhow::Result<bool> {\n    Ok(fs::read_dir(dir)?\n        .filter_map(Result::ok)\n        .any(|e| !e.file_name().to_str().map_or(true, |n| ALLOWED.contains(&n))))\n}\n// clean up any foreign entry before invoking the finish/publish phase","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat the contribution directory as write-only for the contribute tool; keep notes and logs elsewhere.","Check `ls -la` for hidden backup/metadata files (.DS_Store, ~ backups) before the second run.","Disable editor backup files while working near the directory.","Finish the two-step workflow promptly instead of leaving the directory idle where other tools may touch it."],"tags":["cli","filesystem","contributions","refusal-to-overwrite"],"backgroundTag":"file-already-exists","analyzedSha":"e846e6f4b4405e33bd6a9aaf949a482ce34cb6d8","analyzedAt":"2026-09-13T03:07:16.451Z","contentChangedAt":"2026-09-13T03:07:16.451Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}