{"record":{"id":"8bcf9e745682d718","repo":"Hmbown/CodeWhale","slug":"unsupported-legacy-spillover-ownership-schema","errorCode":null,"errorMessage":"unsupported legacy spillover ownership schema","messagePattern":"unsupported legacy spillover ownership schema","errorType":"exception","errorClass":"std::io::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/tools/truncate.rs","lineNumber":174,"sourceCode":"}\n\npub(crate) fn read_legacy_spillover_ownership(\n    payload_path: &Path,\n) -> io::Result<LegacySpilloverOwnership> {\n    let sidecar = legacy_spillover_ownership_path(payload_path);\n    if std::fs::symlink_metadata(&sidecar)?\n        .file_type()\n        .is_symlink()\n    {\n        return Err(io::Error::new(\n            io::ErrorKind::PermissionDenied,\n            \"legacy spillover ownership sidecar must not be a symlink\",\n        ));\n    }\n    let ownership = serde_json::from_slice::<LegacySpilloverOwnership>(&std::fs::read(sidecar)?)\n        .map_err(|error| io::Error::new(io::ErrorKind::InvalidData, error))?;\n    if ownership.schema_version != LEGACY_SPILLOVER_OWNER_SCHEMA_VERSION {\n        return Err(io::Error::new(\n            io::ErrorKind::InvalidData,\n            \"unsupported legacy spillover ownership schema\",\n        ));\n    }\n    Ok(ownership)\n}\n\n/// Resolve the spillover-file path for a SHA256 content hash. Separate\n/// namespace (`sha_<hex>.txt`) from the tool-call-id files so legacy\n/// SHA-addressed evidence can be recognized without colliding with\n/// tool-call references. Retrieval still requires matching ownership\n/// metadata. `sha` must be the raw 64-char lowercase hex digest —\n/// case-insensitive matching is done by the caller.\n#[must_use]\npub fn sha_spillover_path(sha: &str) -> Option<PathBuf> {\n    let sha = sha.trim().to_ascii_lowercase();\n    if !is_valid_sha256(&sha) {\n        return None;","sourceCodeStart":156,"sourceCodeEnd":192,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/tools/truncate.rs#L156-L192","documentation":"InvalidData returned by read_legacy_spillover_ownership when the sidecar's schema_version does not equal LEGACY_SPILLOVER_OWNER_SCHEMA_VERSION. The sidecar JSON parsed fine but was written by a different (older or newer) Codewhale version whose ownership schema is not the one this build understands, so the reader refuses instead of misinterpreting fields.","triggerScenarios":"Reading a legacy spillover ownership sidecar written by a previous release after an upgrade (or by a newer release after a downgrade): the JSON parses, but schema_version no longer matches the compiled constant.","commonSituations":"Version rollforward/rollback across releases that bumped the ownership schema; long-lived machines with stale spillover directories; parallel installs of two Codewhale versions sharing one home directory.","solutions":["Discard the stale sidecar/payload: delete the old spillover file(s) so ownership is re-established on the next write","Re-publish the affected output with the current version instead of reusing old spillover artifacts","Keep one Codewhale version per home directory; avoid mixed-version installs sharing state"],"exampleFix":"# before\n# sidecar written by older release: {\"schema_version\": 1, ...}, current build expects 2\n# read -> InvalidData: unsupported legacy spillover ownership schema\n\n# after\n$ rm ~/.codewhale/spillover/sha_<hex>.ownership   # stale metadata only\n# re-run the tool output write; the current version rewrites the sidecar","handlingStrategy":"fallback","validationCode":"let raw = std::fs::read(&sidecar)?;\nlet probe: serde_json::Value = serde_json::from_slice(&raw)?;\nif probe.get(\"schema_version\") != Some(&serde_json::json!(LEGACY_SPILLOVER_OWNER_SCHEMA_VERSION)) {\n    // stale artifact from another version: drop it and re-publish instead of reading\n}","typeGuard":"fn is_schema_mismatch(e: &std::io::Error) -> bool {\n    e.kind() == std::io::ErrorKind::InvalidData\n        && e.to_string().contains(\"unsupported legacy spillover ownership schema\")\n}","tryCatchPattern":null,"preventionTips":["Purge stale spillover state when switching Codewhale versions","Do not share one home directory between two installed versions","Treat old large-output artifacts as non-portable across upgrades"],"tags":["spillover","schema-version","version-skew","migration","rust"],"backgroundTag":"schema-version-mismatch","analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}