consciousness/src/agent
Kent Overstreet 62996e27d7 WIP: ContextEntry/ContextSection data structures for incremental token counting
New types — not yet wired to callers:

- ContextEntry: wraps ConversationEntry with cached token count and
  timestamp
- ContextSection: named group of entries with cached token total.
  Private entries/tokens, read via entries()/tokens().
  Mutation via push(entry), set(index, entry), del(index).
- ContextState: system/identity/journal/conversation sections + working_stack
- ConversationEntry::System variant for system prompt entries

Token counting happens once at push time. Sections maintain their
totals incrementally via push/set/del. No more recomputing from
scratch on every budget check.

Does not compile — callers need updating.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
2026-04-07 20:48:08 -04:00
..
api Fix build warnings across workspace 2026-04-07 13:55:30 -04:00
tools Agent-aware provenance for memory tools 2026-04-07 17:46:40 -04:00
context.rs WIP: ContextEntry/ContextSection data structures for incremental token counting 2026-04-07 20:48:08 -04:00
mod.rs WIP: ContextEntry/ContextSection data structures for incremental token counting 2026-04-07 20:48:08 -04:00
oneshot.rs WIP: ContextEntry/ContextSection data structures for incremental token counting 2026-04-07 20:48:08 -04:00