memories: add extraction and prompt module foundation (#11200)

## Summary
- add the new `core/src/memories` module (phase-one parsing, rollout
filtering, storage, selection, prompts)
- add Askama-backed memory templates for stage-one input/system and
consolidation prompts
- add module tests for parsing, filtering, path bucketing, and summary
maintenance

## Testing
- just fmt
- cargo test -p codex-core --lib memories::
This commit is contained in:
jif-oai
2026-02-10 10:10:24 +00:00
committed by GitHub
parent 44ebf4588f
commit 6049ff02a0
27 changed files with 1998 additions and 82 deletions

View File

@@ -9,7 +9,7 @@ use sqlx::sqlite::SqliteRow;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ThreadMemory {
pub thread_id: ThreadId,
pub trace_summary: String,
pub raw_memory: String,
pub memory_summary: String,
pub updated_at: DateTime<Utc>,
}
@@ -17,7 +17,7 @@ pub struct ThreadMemory {
#[derive(Debug)]
pub(crate) struct ThreadMemoryRow {
thread_id: String,
trace_summary: String,
raw_memory: String,
memory_summary: String,
updated_at: i64,
}
@@ -26,7 +26,7 @@ impl ThreadMemoryRow {
pub(crate) fn try_from_row(row: &SqliteRow) -> Result<Self> {
Ok(Self {
thread_id: row.try_get("thread_id")?,
trace_summary: row.try_get("trace_summary")?,
raw_memory: row.try_get("raw_memory")?,
memory_summary: row.try_get("memory_summary")?,
updated_at: row.try_get("updated_at")?,
})
@@ -39,7 +39,7 @@ impl TryFrom<ThreadMemoryRow> for ThreadMemory {
fn try_from(row: ThreadMemoryRow) -> std::result::Result<Self, Self::Error> {
Ok(Self {
thread_id: ThreadId::try_from(row.thread_id)?,
trace_summary: row.trace_summary,
raw_memory: row.raw_memory,
memory_summary: row.memory_summary,
updated_at: epoch_seconds_to_datetime(row.updated_at)?,
})