{"record":{"id":"d0c2b5b1f7741604","repo":"AprilNEA/OpenLogi","slug":"unsupported-contribution-state-version","errorCode":null,"errorMessage":"unsupported contribution state version {}","messagePattern":"unsupported contribution state version (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/openlogi-cli/src/cmd/fixture/contribute.rs","lineNumber":466,"sourceCode":"    }\n    if Path::new(&args.id).file_name() != Some(OsStr::new(&args.id))\n        || args.id.contains('/')\n        || args.id.contains('\\\\')\n    {\n        bail!(\"--id must be one synthetic path component without separators\");\n    }\n    if args.name.trim().is_empty() {\n        bail!(\"--name must be a nonempty synthetic device name\");\n    }\n    if args.output.file_name() != Some(OsStr::new(&args.id)) {\n        bail!(\"--output directory name must exactly equal --id\");\n    }\n    Ok(())\n}\n\nfn validate_state(args: &ContributeArgs, state: &ContributionState) -> Result<()> {\n    if state.version != STATE_VERSION {\n        bail!(\"unsupported contribution state version {}\", state.version);\n    }\n    if state.fixture_id != args.id\n        || state.profile_id != format!(\"{}-profile\", args.id)\n        || state.profile_name != args.name\n    {\n        bail!(\"--id and --name must match the in-progress contribution\");\n    }\n    Ok(())\n}\n\nfn read_json<T: serde::de::DeserializeOwned>(path: &Path, asset: &str) -> Result<T> {\n    let bytes = fs::read(path).with_context(|| format!(\"could not read {asset}\"))?;\n    serde_json::from_slice(&bytes).with_context(|| format!(\"could not parse {asset}\"))\n}\n\nfn require_directory(path: &Path, asset: &str) -> Result<()> {\n    let metadata =\n        fs::symlink_metadata(path).with_context(|| format!(\"could not inspect {asset}\"))?;","sourceCodeStart":448,"sourceCodeEnd":484,"githubUrl":"https://github.com/AprilNEA/OpenLogi/blob/e846e6f4b4405e33bd6a9aaf949a482ce34cb6d8/crates/openlogi-cli/src/cmd/fixture/contribute.rs#L448-L484","documentation":"When finishing a contribution, the persisted contribution state file carries a version field that must equal the CLI's current `STATE_VERSION`. An unknown/older version means the state was written by a different (older or newer) tool version and cannot safely be resumed. `validate_state` rejects it before `finish` proceeds.","triggerScenarios":"Run the `finish` step of `openlogi fixture contribute` against a state file produced by an older or newer OpenLogi CLI whose STATE_VERSION differs. Happens after upgrading/downgrading the CLI, or mixing two installs.","commonSituations":"Upgrading the CLI mid-contribution; checking out an older branch and finishing a state created on a newer one; a corrupted state file whose version field was hand-edited.","solutions":["Use the same CLI version that started the contribution to run the finish step.","Delete the in-progress output directory and restart the contribution from scratch with the current CLI.","Inspect the state file's `version` field and, if a stale artifact, remove it; do not hand-edit the version to force a match."],"exampleFix":"// before (state from older CLI)\nopenlogi fixture contribute finish --id mx-master ...\n// after\nrm -rf out/mx-master && openlogi fixture contribute --id mx-master --name \"MX Master\" --output out/mx-master  # restart with current CLI","handlingStrategy":"fallback","validationCode":"version=$(python3 -c \"import json;print(json.load(open('out/$ID/state.json'))['version'])\") && [ \"$version\" = \"1\" ] || echo \"state version mismatch: use the originating CLI version\"","typeGuard":null,"tryCatchPattern":"match finish_contribution() {\n    Err(e) if e.to_string().contains(\"unsupported contribution state version\") => {\n        // restart the contribution with the current CLI\n    }\n    other => other?,\n}","preventionTips":["Finish a contribution with the same CLI version that started it.","Don't upgrade the CLI in the middle of a multi-step contribution.","Never hand-edit the state file's version field."],"tags":["cli","versioning","state"],"backgroundTag":"unsupported-operation","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"}