Journal: store as structured Vec<JournalEntry>, not String

Keep journal entries as structured data in ContextState. Render
to text only when building the context message. Debug screen reads
the structured entries directly — no parsing ## headers back out.

Compaction paths temporarily parse the string from build_context_window
back to entries (to be cleaned up when compaction is reworked).

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
Kent Overstreet 2026-04-02 02:21:45 -04:00
parent 42f1e888c4
commit 5526a26d4c
3 changed files with 52 additions and 50 deletions

View file

@ -66,7 +66,7 @@ pub fn parse_journal_tail(path: &Path, max_bytes: u64) -> Vec<JournalEntry> {
}
/// Parse journal entries from text (separated for testing).
fn parse_journal_text(text: &str) -> Vec<JournalEntry> {
pub fn parse_journal_text(text: &str) -> Vec<JournalEntry> {
let mut entries = Vec::new();
let mut current_timestamp: Option<DateTime<Utc>> = None;
let mut current_content = String::new();