1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! `goals` — the agent's long-term goals when interacting with the user.
//!
//! A deliberately small, high-level memory surface: it maintains a compact
//! markdown file (`MEMORY_GOALS.md`, ~200–500 tokens) holding an editable,
//! ordered **list** of the user's durable goals. The list can be mutated two
//! ways:
//!
//! - **Explicitly** — via the [`store`] operations (`list` / `add` / `edit` /
//! `delete`), which back both RPC handlers and agent tools in OpenHuman.
//! - **By reflection** — a turn-based pass ([`reflect`]) that reads the current
//! list plus a context nudge and applies add/edit/delete. On an empty list
//! (first run) it populates an initial set; otherwise it makes minimal
//! changes. The LLM step is abstracted behind [`reflect::GoalsGenerator`];
//! TinyCortex never calls a real model.
//!
//! ## Invariants (ported from OpenHuman)
//!
//! - At most [`store::GOALS_MAX_ITEMS`] (8) items.
//! - Rendered file at most [`store::GOALS_FILE_MAX_CHARS`] (2000) chars.
//! - Each goal is a single line; empty / multi-line text is rejected.
//! - Cap trimming drops the oldest items first.
//! - A missing file loads as an empty document.
//! - Mutations serialise through a process-wide lock.
//! - The storage path must stay inside the workspace; symlink escapes are
//! rejected.
//!
//! The workspace root is read from [`crate::memory::config::MemoryConfig`].
pub use ;
pub use ;
pub use ;