{"record":{"id":"f762ec1d20e0cd4d","repo":"BoundaryML/baml","slug":"history-boundary-was-not-found","errorCode":null,"errorMessage":"history boundary {} was not found","messagePattern":"history boundary (.+?) was not found","errorType":"error_code","errorClass":"io::Error","httpStatus":404,"severity":"error","filePath":"baml_language/crates/bex_events/src/history/mod.rs","lineNumber":269,"sourceCode":"\n    pub fn open(&self, boundary_id: BoundaryId) -> io::Result<Run> {\n        let (known_dir, search_roots) = {\n            let inner = self\n                .inner\n                .lock()\n                .unwrap_or_else(std::sync::PoisonError::into_inner);\n            (\n                inner\n                    .boundaries\n                    .get(&boundary_id)\n                    .map(|state| state.path.boundary_dir.clone()),\n                inner.search_roots.clone(),\n            )\n        };\n        let dir = known_dir\n            .or_else(|| find_boundary_dir(&search_roots, boundary_id))\n            .ok_or_else(|| {\n                io::Error::new(\n                    io::ErrorKind::NotFound,\n                    format!(\n                        \"history boundary {} was not found\",\n                        boundary_id.to_wire_string()\n                    ),\n                )\n            })?;\n        open_boundary_from_dir(&dir)\n    }\n\n    pub fn read_value(\n        &self,\n        boundary_id: BoundaryId,\n        value_ref_id: &str,\n    ) -> io::Result<Option<HistoryValueBody>> {\n        self.read_value_result(boundary_id, value_ref_id)\n            .map(HistoryValueReadResult::into_body)\n    }","sourceCodeStart":251,"sourceCodeEnd":287,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/baml_language/crates/bex_events/src/history/mod.rs#L251-L287","documentation":"open (boundary replay) resolves the boundary directory either from a known dir or by searching configured search roots; if no directory for the BoundaryId exists, it returns NotFound saying the boundary was not found. This is a replay-time error: the on-disk history for that boundary is missing or not in the search path.","triggerScenarios":"Calling History::open(boundary_id, ...) where no boundary directory was ever written, the search roots don't include the directory, or the directory name doesn't match the boundary's wire ID.","commonSituations":"Pointing replay at the wrong history root (test ran in a different temp dir), deleting history files before replay, or a renamed/moved artifacts directory.","solutions":["Add the directory containing the boundary to the search roots (or pass it as the known dir).","Confirm the boundary ID in the message exists as a directory name under the search roots.","Re-run the recording session to regenerate the history if it was deleted.","Ensure the process that writes history finishes/flushes before open is called."],"exampleFix":"// before\nlet b = History::open(boundary_id)?;\n// after\nlet b = History::open_in_dir(boundary_id, &recorded_dir)\n    .or_else(|_| History::open(boundary_id))?;","handlingStrategy":"fallback","validationCode":"let dir = recorded_root.join(boundary_id.to_wire_string());\nif !dir.is_dir() {\n    return Err(format!(\"boundary dir {} missing\", dir.display()));\n}","typeGuard":null,"tryCatchPattern":"let boundary = match History::open(boundary_id) {\n    Ok(b) => b,\n    Err(e) if e.kind() == std::io::ErrorKind::NotFound => {\n        History::open_in_dir(boundary_id, &recorded_dir)?\n    }\n    Err(e) => return Err(e),\n};","preventionTips":["Pass the explicit recorded directory instead of relying on search roots.","Don't delete or move history directories between recording and replay.","Keep each recording run's artifacts in a unique directory."],"tags":["io","not-found","replay","history"],"backgroundTag":"directory-not-found","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}