{"record":{"id":"b5aaf53048d6c81e","repo":"AprilNEA/OpenLogi","slug":"already-exists-but-is-not-an-in-progress-openlogi","errorCode":null,"errorMessage":"{} already exists but is not an in-progress OpenLogi contribution; run `openlogi fixture verify {}` to inspect it","messagePattern":"(.+?) already exists but is not an in-progress OpenLogi contribution; run `openlogi fixture verify (.+?)` to inspect it","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/openlogi-cli/src/cmd/fixture/contribute.rs","lineNumber":73,"sourceCode":"    selected_route: DeviceRoute,\n}\n\npub async fn run(args: ContributeArgs) -> Result<()> {\n    validate_args(&args)?;\n    let state_path = args.output.join(STATE_FILE);\n    if !args\n        .output\n        .try_exists()\n        .context(\"could not inspect output directory\")?\n    {\n        return start(args, &state_path).await;\n    }\n    require_directory(&args.output, \"contribution output\")?;\n    if !state_path\n        .try_exists()\n        .context(\"could not inspect contribution state\")?\n    {\n        bail!(\n            \"{} already exists but is not an in-progress OpenLogi contribution; run `openlogi \\\n             fixture verify {}` to inspect it\",\n            args.output.display(),\n            args.output.display()\n        );\n    }\n    finish(args, &state_path).await\n}\n\nasync fn start(args: ContributeArgs, state_path: &Path) -> Result<()> {\n    let profile_id = format!(\"{}-profile\", args.id);\n    println!(\"Step 1/2: reading semantic state through the running OpenLogi Agent…\");\n    let captured = record_profile::capture_for_contribution(\n        profile_id.clone(),\n        args.name.clone(),\n        args.device.as_deref(),\n    )\n    .await?;","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/AprilNEA/OpenLogi/blob/e846e6f4b4405e33bd6a9aaf949a482ce34cb6d8/crates/openlogi-cli/src/cmd/fixture/contribute.rs#L55-L91","documentation":"`openlogi fixture contribute` resumes an in-progress contribution by looking for a state file (`state.json`-style) inside the `--output` directory. If the output path exists as a directory but has no contribution state file, the command cannot treat it as resumable and bails rather than risk mixing a contribution into unrelated content. This guards against publishing a fixture manifest over an arbitrary directory the user happens to point at.","triggerScenarios":"Running `openlogi fixture contribute --output DIR ...` a second time (or with a pre-created DIR) where DIR exists, is a directory, and does not contain the contribution state file written by step 1 — e.g. the directory was created manually, was partially cleaned, or is some other project's directory.","commonSituations":"Pointing --output at a generic scratch/repo directory instead of the one created by the first contribute run; deleting or moving `state.json` out of the contribution directory; resuming after a crash that corrupted or removed the state file; passing the wrong directory (typo or parent directory).","solutions":["Run `openlogi fixture verify <output-dir>` as the message suggests to inspect what the directory actually contains.","If the directory is not meant to be a contribution, choose a fresh (nonexistent) --output path so `contribute` starts from step 1 cleanly.","If you intended to resume, restore the contribution state file (rerun the first contribute step) or use the original directory where step 1 wrote it.","If the directory holds unrelated files, move them away and rerun with an empty/new directory."],"exampleFix":"// before\nopenlogi fixture contribute --output ./my-fixture ...\n// (./my-fixture exists but was not created by `fixture contribute`)\n\n// after\nrm -rf ./my-fixture   # or pick a new path\nopenlogi fixture contribute --output ./my-fixture ...\n// or inspect it first:\nopenlogi fixture verify ./my-fixture","handlingStrategy":"validation","validationCode":"const STATE_FILE: &str = \"state.json\";\nasync fn ensure_resumable(output: &Path) -> anyhow::Result<()> {\n    anyhow::ensure!(output.is_dir(), \"{} is not a directory\", output.display());\n    anyhow::ensure!(\n        output.join(STATE_FILE).try_exists()?,\n        \"{} is not an in-progress contribution\",\n        output.display()\n    );\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always resume with the exact --output directory the first run printed, not a parent or sibling.","Never delete or move the state file inside a contribution directory between runs.","Use a fresh, previously nonexistent directory for each new contribution.","When in doubt, run `openlogi fixture verify <dir>` before resuming."],"tags":["cli","filesystem","contributions","state-machine"],"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"}