{"record":{"id":"ee00d977635fa91d","repo":"Hmbown/CodeWhale","slug":"invalid-evidence-owner","errorCode":null,"errorMessage":"invalid evidence owner","messagePattern":"invalid evidence owner","errorType":"exception","errorClass":"std::io::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/tools/large_output_router.rs","lineNumber":312,"sourceCode":"}\n\npub fn publish_evidence_metadata(\n    session_id: &str,\n    artifact: &EvidenceArtifact,\n) -> io::Result<PathBuf> {\n    let bytes = serde_json::to_vec_pretty(artifact)\n        .map_err(|err| io::Error::new(io::ErrorKind::InvalidData, err))?;\n    crate::artifacts::write_session_relative_immutable(\n        session_id,\n        &evidence_metadata_relative_path(&artifact.handle),\n        &bytes,\n    )\n}\n\npub fn read_evidence_metadata(session_id: &str, handle: &str) -> io::Result<EvidenceArtifact> {\n    let relative = evidence_metadata_relative_path(handle);\n    let path = crate::artifacts::session_artifact_absolute_path(session_id, &relative)\n        .ok_or_else(|| io::Error::new(io::ErrorKind::PermissionDenied, \"invalid evidence owner\"))?;\n    let raw = std::fs::read(path)?;\n    serde_json::from_slice(&raw).map_err(|err| io::Error::new(io::ErrorKind::InvalidData, err))\n}\n\n#[must_use]\npub fn unix_millis_now() -> u64 {\n    std::time::SystemTime::now()\n        .duration_since(std::time::UNIX_EPOCH)\n        .unwrap_or_default()\n        .as_millis()\n        .try_into()\n        .unwrap_or(u64::MAX)\n}\n\n#[must_use]\npub fn evidence_is_expired(artifact: &EvidenceArtifact, now_ms: u64) -> bool {\n    artifact.retention_state == EvidenceRetentionState::Expired\n        || now_ms > artifact.retain_until_unix_ms","sourceCodeStart":294,"sourceCodeEnd":330,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/crates/tui/src/tools/large_output_router.rs#L294-L330","documentation":"A sentinel/guard error from read_evidence_metadata meaning the evidence metadata JSON it read does not carry a recognizable owner field — the on-disk artifact is malformed or was written by an incompatible version, so the record cannot be attributed to a session/handle owner and is rejected rather than trusted.","triggerScenarios":"Thrown at crates/tui/src/tools/large_output_router.rs:312 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Regenerate the evidence metadata by re-running the offload/publish that produced the artifact","Delete the stale .evidence.json file so the next publish recreates it with a valid owner","If reading artifacts from an older version, migrate or upgrade them to the current owner schema before reading"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"433685b2024e7bc4c99e1e2e326bcad39b4d9d65","analyzedAt":"2026-09-15T12:24:24.634Z","contentChangedAt":"2026-09-15T12:24:24.634Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}