{"record":{"id":"576684fb878a0342","repo":"Hmbown/CodeWhale","slug":"continual-harness-has-no-entry-id","errorCode":null,"errorMessage":"continual harness has no entry `{id}`","messagePattern":"continual harness has no entry `(.+?)`","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/continual_harness.rs","lineNumber":147,"sourceCode":"        Ok(entry)\n    })\n}\n\n/// Remove one exact entry. Returning the removed entry makes deletion\n/// receipts useful without re-reading the state file.\npub fn remove(workspace: &Path, id: &str) -> Result<HarnessEntry> {\n    let id = id.trim();\n    if id.is_empty() {\n        bail!(\"continual harness entry id cannot be empty\");\n    }\n    let path = state_path_for_write(workspace)?;\n    with_write_lock(&path, || {\n        let mut state = load_state(&path)?;\n        let index = state\n            .entries\n            .iter()\n            .position(|entry| entry.id == id)\n            .ok_or_else(|| anyhow!(\"continual harness has no entry `{id}`\"))?;\n        let removed = state.entries.remove(index);\n        state.schema_version = SCHEMA_VERSION;\n        save_state(&path, &state)?;\n        // Removal is the edit most worth recording: the entry is gone from\n        // state, so the journal is the only place its content survives.\n        append_journal(&path, \"remove\", &removed)?;\n        Ok(removed)\n    })\n}\n\n/// Render the bounded, lower-authority state that follows the stable prompt\n/// prefix. Broken or future-version state is intentionally omitted rather\n/// than becoming a prompt-injection path.\n#[must_use]\npub fn prompt_block(workspace: &Path) -> Option<String> {\n    let overview = overview(workspace).ok()?;\n    if overview.entries.is_empty() {\n        return None;","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/continual_harness.rs#L129-L165","documentation":"The continual harness journal's remove operation scans the persisted state for an entry with the given id; if none exists it fails with this error. Nothing is removed or journaled when the id is unknown.","triggerScenarios":"Calling ContinualHarness::remove (public) with an id string not present in the harness state file, or one already removed in a previous call.","commonSituations":"A stale id from an earlier session or a different harness state path (working directory changed so the state file location differs); double-removal after a previous successful delete; typo or truncated id.","solutions":["List current entries first and use an id that exists, then call remove.","Handle Err gracefully for idempotent removal — treat this error as 'already gone' and continue.","Verify the harness is pointed at the same state file that contains the entry (same working directory or explicit path)."],"exampleFix":"// before\nharness.remove(&id)?; // fails if already removed\n// after\nif harness.list()?.iter().any(|e| e.id == id) {\n    harness.remove(&id)?;\n}","handlingStrategy":"try-catch","validationCode":"if !harness.list()?.iter().any(|e| e.id == id) {\n    return Ok(()); // already removed\n}","typeGuard":null,"tryCatchPattern":"match harness.remove(&id) {\n    Err(e) if e.to_string().contains(&format!(\"no entry `{id}`\")) => { /* idempotent no-op */ }\n    other => other?,\n}","preventionTips":["Refresh the entry list before each remove instead of caching ids.","Make removal flows idempotent by treating this error as success.","Pin the harness to an explicit state path so CWD changes do not hide entries."],"tags":["rust","journal","idempotency"],"backgroundTag":"record-not-found","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}