consciousness/src/user
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
..
chat.rs WIP: ContextEntry/ContextSection data structures for incremental token counting 2026-04-07 20:48:08 -04:00
context.rs WIP: ContextEntry/ContextSection data structures for incremental token counting 2026-04-07 20:48:08 -04:00
mod.rs Three-pane subconscious debug screen with shared widgets 2026-04-07 19:03:14 -04:00
subconscious.rs WIP: ContextEntry/ContextSection data structures for incremental token counting 2026-04-07 20:48:08 -04:00
thalamus.rs Fix build warnings across workspace 2026-04-07 13:55:30 -04:00
unconscious.rs fix unused imports 2026-04-06 22:43:55 -04:00
widgets.rs WIP: ContextEntry/ContextSection data structures for incremental token counting 2026-04-07 20:48:08 -04:00