Commit Graph

7 Commits

Author SHA1 Message Date
Levi Neely 57c40d541e Migrate chat log to JSONL format
Server changes:
- format/block.go: Block struct with JSONL marshaling, RenderBlock for text
- Deleted format/event.go, format.go, format_test.go (old delimiter format)
- agent/chat.go: Dual logs (rawLog JSONL + textLog rendered text)
- agent/chatlog.go: Streaming via flushPartial/closeBlock, skip internal events
- fs/spec.go: New files log.raw (JSONL), log (text), block (ID lookup)
- Removed chat/chat.raw/chat.search from namespace

GUI changes:
- chatblockmodel: JSONL parsing via QJsonDocument, removed regex state machine
- ollie9pclient: Read from log.raw for replay, removed old streaming code
- Added Context type to block enum, filter context/state/usage from display

Docs updated: AGENTS.md, system_prompt.md, architecture-*.md, scripts/o
2026-10-09 18:52:40 +02:00
Levi Neely 5f67d44e27 Add block ID tests and document chat log files
- Add unit tests for NextBlockID and ChatSearchByID in chat_test.go
- Add unit tests for ParseBlockHeader, BlockDelim, FormatEvent in format_test.go
- Add e2e test script using o CLI to verify block ID search
- Document chat log files in AGENTS.md: chat/chat.raw are blocking streams,
  use log for non-blocking reads, chat.search for block lookup
2026-10-09 17:00:37 +02:00
Levi Neely 46aa901763 server-side block IDs for stable bookmark/plumb targets
- Add blockCounter to Agent, generating sequential hex IDs
- Include #blockId in all block headers: [[[role:name#id]]]
- GUI parses server-provided IDs from headers
- Falls back to client-generated IDs for legacy blocks without server IDs
- Block IDs are now deterministic based on chat history order
2026-10-09 16:12:26 +02:00
Ollie Agent 42cae9ee2e human-friendliness: self-describing ctl, structured errors, status, overview
Make the namespace explain itself instead of requiring prior knowledge.

- ctl is self-describing: reading it (empty write) or writing 'help'
  returns the valid verbs with one-line descriptions; an unknown verb
  errors with the valid list. Refactor dispatch to an ordered []ctlCmd
  carrying descriptions; drop the undocumented '.' alias and the
  drift-prone hardcoded help verb. Keep 'i' (drop 'inject') for fast
  injects. o's ctl usage now reads the live listing.
- Errors carry severity + remediation. backend.ClassifyError maps the
  typed errors to transient/config/fatal with a one-line fix; the error
  event renders [[[error:<severity>]]] and a 'remediation:' line so a
  human knows whether to wait or intervene.
- Add a human status file: 'thinking · 12s', 'calling shell · 3s',
  'idle' — distinct from the machine-facing raw state. Wire the TUI bar
  to it.
- Bare 'o' shows an overview of running sessions/agents with status, so
  you don't need to know any names to get oriented.

Tests: dispatch help/unknown/routing, ClassifyError severity table.
2026-09-07 13:55:45 +02:00
Levi Neely d936ec29a8 format: remove agent dependency from FormatEvent
FormatEvent now takes primitive string arguments instead of agent.Event.
This fixes the dependency direction - format/ should be a leaf package
that agent/, session/, and fs/ depend on, not the other way around.
2026-08-07 10:16:28 +02:00
Levi Neely 21e46b9895 refactor: consolidate event formatting, remove log validator
- Move FormatEvent to format/ package for reuse by both live handler
  and replay
- Move LoadConfig to agent/ package where it belongs
- Remove log validator (was noisy, not essential)
- Update replay to use FormatEvent for consistent output format
- Update kde submodule with GUI streaming fix
2026-08-07 10:11:48 +02:00
Ollie Agent c7f1bec71c refactor: extract format package, ctl dispatcher, and log structure validator
- Extract all [[[block]]] formatting constants/helpers into format/format.go
  (EndTag, RoleDelim, ToolDelim, CallDelim, BlockHeader, ParseBlockHeader, IsEndMarker)
- Replace switch/case ctl dispatchers in fs/handlers.go with generic
  ctlDispatch() from new fs/ctl.go
- Add LogValidator state machine to AgentLog enforcing:
  - Every [[[block]]] MUST have an [[[end]]] marker
  - Blocks SHALL NOT be nested
  - Streaming line buffering across partial writes
  - Fatal failure on first violation with line-number reporting
  - UnclosedAtTeardown() for session/agent teardown checks
- Fix kde/kate ollie_ghost compile: stripPrefixEcho signature mismatch
2026-08-07 08:59:07 +02:00