consciousness/src
Kent Overstreet d5e6f55da9 Fix context budgeting and compaction
- Budget now counts exact message tokens matching what assemble_api_messages
  sends, not raw string content. Eliminates undercounting from formatting
  overhead (journal headers, personality separators, working stack).

- Load journal before trimming so trim accounts for journal cost.

- Compact before every turn, not just after turn completion. Prevents
  agent_cycle surfaced memories from pushing context over budget.

- Move agent_cycle orchestration from Agent::turn to Mind::start_turn —
  surfaced memories and reflections now precede the user message.

- Move AgentCycleState from Agent to Mind — it's orchestration, not
  per-agent state. memory_scoring_in_flight and memory_scores stay on
  Agent where they belong.

- Tag DMN entries as ConversationEntry::Dmn — compaction evicts them
  first since they're ephemeral. Compaction also prefers evicting
  memories over conversation when memories exceed 50% of entry tokens.

- Kill /retry slash command.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
2026-04-06 22:43:55 -04:00
..
agent Fix context budgeting and compaction 2026-04-06 22:43:55 -04:00
bin split out src/mind 2026-04-04 02:46:32 -04:00
claude poc-daemon: subscribe to channel notifications, drop config.rs 2026-04-05 12:58:46 -04:00
cli deps: remove faer (224 transitive crates) 2026-04-05 06:39:47 -04:00
hippocampus deps: remove faer (224 transitive crates) 2026-04-05 06:39:47 -04:00
learn rust edition 2024 2026-04-05 06:20:16 -04:00
mind Fix context budgeting and compaction 2026-04-06 22:43:55 -04:00
subconscious Fix context budgeting and compaction 2026-04-06 22:43:55 -04:00
thalamus supervisor: PID file to prevent duplicate daemon spawns 2026-04-05 13:30:56 -04:00
user Fix context budgeting and compaction 2026-04-06 22:43:55 -04:00
config.rs training: per-node scoring with graph weight updates 2026-04-05 01:18:47 -04:00
lib.rs user: InteractScreen extracted, all screens use ScreenView trait 2026-04-05 18:57:54 -04:00
main.rs deps: remove faer (224 transitive crates) 2026-04-05 06:39:47 -04:00
session.rs move Claude Code-specific code from thalamus/ to claude/ 2026-04-03 19:26:24 -04:00
util.rs delete 20 dead public functions across 12 files 2026-04-02 16:21:01 -04:00