{"record":{"id":"15c06b542f9e17da","repo":"Hmbown/CodeWhale","slug":"memory-edits-require-non-empty-evidence","errorCode":null,"errorMessage":"memory edits require non-empty evidence","messagePattern":"memory edits require non-empty evidence","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/native_memory.rs","lineNumber":876,"sourceCode":"            several.len()\n        ),\n    }\n}\n\n/// The note body of a Markdown bullet, if the line is one.\nfn bullet_text(line: &str) -> Option<&str> {\n    let trimmed = line.trim();\n    trimmed\n        .strip_prefix(\"- \")\n        .or_else(|| trimmed.strip_prefix(\"* \"))\n        .map(str::trim)\n}\n\n/// Evidence is required on every in-place edit and held to the same bounds\n/// as a note. An unexplained rewrite of durable context is the thing the\n/// journal exists to prevent.\nfn normalize_evidence(evidence: &str) -> Result<String> {\n    normalize_note(evidence).map_err(|_| anyhow!(\"memory edits require non-empty evidence\"))\n}\n\nfn normalize_note(note: &str) -> Result<String> {\n    let note = note.replace(\"\\r\\n\", \"\\n\").replace('\\r', \"\\n\");\n    let note = note\n        .lines()\n        .map(str::trim)\n        .filter(|line| !line.is_empty())\n        .collect::<Vec<_>>()\n        .join(\" \");\n    if note.is_empty() {\n        bail!(\"memory note is empty\");\n    }\n    if note.len() > MAX_NOTE_BYTES {\n        bail!(\"memory note exceeds {MAX_NOTE_BYTES} bytes\");\n    }\n    Ok(note.trim_start_matches('-').trim().to_string())\n}","sourceCodeStart":858,"sourceCodeEnd":894,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/crates/tui/src/native_memory.rs#L858-L894","documentation":"Error \"memory edits require non-empty evidence\" thrown in Hmbown/CodeWhale.","triggerScenarios":"Thrown at crates/tui/src/native_memory.rs:876 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}