diff --git a/AGENTS.md b/AGENTS.md index f91636e..7fbb588 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -100,7 +100,7 @@ Ollie is **experimental and unstable** software. The features and API are approa This is a standing preference, not a per-task instruction. Apply it without asking. ## Architecture (key concepts) -1. **One integration surface**: `olliesrv` exposes sessions and agents through a 9P2000 filesystem. Frontends include `o`, `ollie-9p`, KDE, Kate, Emacs, and scripts. Reads from `chat`, `statewait`, `eventwait`, and `feed` provide blocking/event-driven synchronization. +1. **One integration surface**: `olliesrv` exposes sessions and agents through a 9P2000 filesystem. Frontends include `o`, `ollie-9p`, KDE, Kate, Emacs, and scripts. Reads from `chat`, `statewait`, `event`, and `feed` provide blocking/event-driven synchronization. 2. **Session and tool processes**: Each session owns an agent runtime in `olliesrv` and a separate `toolsrv` process. They communicate over an authenticated Unix socket using 9P. `toolclient` can respawn local toolsrv processes and can deploy/start toolsrv remotely over SSH with socket forwarding. 3. **Agent loop** (`cmd/olliesrv/internal/agent/`): The agent package is organized by concern: - `loop.go`: Main loop — stream LLM, execute tools, update history diff --git a/cmd/olliesrv/internal/fs/doc.go b/cmd/olliesrv/internal/fs/doc.go index 7b246e3..2479e0d 100644 --- a/cmd/olliesrv/internal/fs/doc.go +++ b/cmd/olliesrv/internal/fs/doc.go @@ -33,7 +33,7 @@ // // # Blocking Reads // -// Files like statewait and eventwait block until their condition is met. +// Files like statewait and event block until their condition is met. // This is the primary coordination mechanism — clients read these files // in a loop to react to state changes. // diff --git a/cmd/olliesrv/internal/fs/spec.go b/cmd/olliesrv/internal/fs/spec.go index cfc512d..512f00f 100644 --- a/cmd/olliesrv/internal/fs/spec.go +++ b/cmd/olliesrv/internal/fs/spec.go @@ -116,7 +116,7 @@ func buildTreeSpec(cfg *Config) virtfs.FsNodeDecl { treeSpecUID = u.Username } - // Event subscription for eventwait (lives for server lifetime). + // Event subscription for event (lives for server lifetime). eventRead, eventSignal := session.EventStream(session.SubscribeEvents(cfg.Ctx, "*")) return virtfs.DirNode("/", diff --git a/doc/architecture-9p.md b/doc/architecture-9p.md index 11806ca..47839cb 100644 --- a/doc/architecture-9p.md +++ b/doc/architecture-9p.md @@ -45,7 +45,7 @@ A 9P filesystem client can mount the namespace when the platform provides a 9P m | `help` | r | Generated filesystem reference. | | `aliases` | r | Stable ID-to-path mappings. | | `ctl` | rdwr | Server controls such as `invalidate` and `kill`. | -| `eventwait` | r | Blocking server-event stream. | +| `event` | r | Blocking server-event stream. | | `generate` | rdwr | One-shot LLM request. | | `session/` | dir | Session collection. | @@ -158,7 +158,7 @@ Control files use request-response semantics: write one command, then read the r ## Plan 9 interaction patterns - **Control files:** writes express operations such as stop, kill, rename, compact, and reload. -- **Blocking reads:** `statewait`, `eventwait`, `feed`, and streaming chat replace event subscriptions with ordinary reads. +- **Blocking reads:** `statewait`, `event`, `feed`, and streaming chat replace event subscriptions with ordinary reads. - **Stateless request/response:** `generate`, `ctl`, and `rdwr` files accept a request and return a result. - **Change detection:** `feed` does not wake readers for identical consecutive data. - **Shared namespace:** multiple clients can inspect and modify the same sessions concurrently. diff --git a/doc/evolution.md b/doc/evolution.md index 172aea0..16785a0 100644 --- a/doc/evolution.md +++ b/doc/evolution.md @@ -503,7 +503,7 @@ The entire namespace is declared in a single `FsNodeDecl` tree in `fs/spec.go`: ```go var treeSpec = Dir("/", Leaf("backends", 0444, Read(readBackends), GID("agent")), - Leaf("eventwait", 0444, Read(readEventwait), Stream(blockEventwait), GID("agent")), + Leaf("event", 0444, Read(readEvent), Stream(blockEvent), GID("agent")), Leaf("complete", 0666, Request(requestComplete), GID("agent")), // ... Dir("session", GID("agent"), @@ -559,18 +559,18 @@ Following the EDSL conversion, the 9P protocol server itself - `main.go` simplified as bypass tree wiring moved to `fs/` - Server is now a thin 9P2000 protocol translator, not a filesystem -## Phase 17: Eventwait Redesign & Chat Log Format (Aug 2) +## Phase 17: Event Redesign & Chat Log Format (Aug 2) -### Global /eventwait +### Global /event Replaced per-session event polling with a global event ring buffer and a -single `/eventwait` file. Events carry structured prefixes and delta descriptions: +single `/event` file. Events carry structured prefixes and delta descriptions: - `S new session/` — session created - `S kill session/` — session destroyed - `S rename session/ session/` — session renamed - `A kill session//agent/` — agent killed The event ring is a fixed-size circular buffer (100 slots) with a `sync.Cond` -for blocking reads. Frontends block on `/eventwait` and receive deltas since +for blocking reads. Frontends block on `/event` and receive deltas since their last known offset. No polling, no timer, no D-Bus. Fixes along the way: @@ -608,7 +608,7 @@ The KDE frontend received extensive updates across both days: - **Double-click rename** — inline renaming of agent nodes - **Robust session loading** — loads sessions on startup, handles empty state - **Context menu** — kill session, per-session operations -- **Eventwait-driven updates** — replaced timer-based polling with blocking `/eventwait` +- **Event-driven updates** — replaced timer-based polling with blocking `/event` - **Fence fix** — fixed a bug where code fences could eat surrounding content - Removed D-Bus entirely; all communication via `9p` plan9port binary @@ -620,7 +620,7 @@ The KDE frontend received extensive updates across both days: ├── models model list (cached) ├── agents agent config list ├── ctl root control (invalidate, kill) -├── eventwait global event stream (blocking read) +├── event global event stream (blocking read) ├── complete request-response: code completion ├── generate request-response: one-shot LLM generation ├── route request-response: model routing diff --git a/kde/gui/lib9pstreamer.cpp b/kde/gui/lib9pstreamer.cpp index c18d5d1..c8da6d4 100644 --- a/kde/gui/lib9pstreamer.cpp +++ b/kde/gui/lib9pstreamer.cpp @@ -70,7 +70,7 @@ void Lib9pStreamer::Worker::run() return; } if (n == 0) { - // EOF — normal for statewait/eventwait after returning data + // EOF — normal for statewait/event after returning data emit finished(true, QString()); return; } diff --git a/kde/gui/nativestreamer.h b/kde/gui/nativestreamer.h index 3e63056..b963ad8 100644 --- a/kde/gui/nativestreamer.h +++ b/kde/gui/nativestreamer.h @@ -11,7 +11,7 @@ * NativeStreamer - Streaming file reader using ollie-9p subprocess. * * Uses ollie-9p subprocess for streaming reads (blocking wait files like - * chat, statewait, eventwait). The native library is used for request/response + * chat, statewait, event). The native library is used for request/response * operations, but subprocess is needed for streaming because: * - Blocking reads in Go can't be interrupted by closing the fid * - Subprocess can be killed cleanly diff --git a/kde/gui/ollie9pclient.cpp b/kde/gui/ollie9pclient.cpp index d13efd8..cbbb09f 100644 --- a/kde/gui/ollie9pclient.cpp +++ b/kde/gui/ollie9pclient.cpp @@ -39,7 +39,7 @@ Ollie9pClient::Ollie9pClient(QObject *parent) } }); - // Event stream — looping, reads server eventwait for session/agent events. + // Event stream — looping, reads server event for session/agent events. m_event = new Lib9pStreamer(Lib9pStreamer::Looping, this); connect(m_event, &Lib9pStreamer::dataReady, this, [this](const QByteArray &data) { // Events may come in batches separated by newlines @@ -169,7 +169,7 @@ QString Ollie9pClient::sessionConnectionColor(const QString &sessionId) const return "gray"; } -// handleEvent processes a single event from eventwait. +// handleEvent processes a single event from event stream. // Event format: "topic payload" where topic is "session.{sid}.{action}" or // "session.{sid}.agent.{aid}.{action}" // Optimized for the hot path: agent.state changes diff --git a/kde/gui/ollie9pclient.h b/kde/gui/ollie9pclient.h index eaa559d..064fd33 100644 --- a/kde/gui/ollie9pclient.h +++ b/kde/gui/ollie9pclient.h @@ -12,7 +12,7 @@ #include "lib9pstreamer.h" // 9P-based client for ollie. Uses native libollie9p for all operations. -// Streaming files (chat, statewait, eventwait) use Lib9pStreamer threads. +// Streaming files (chat, statewait, event) use Lib9pStreamer threads. class Ollie9pClient : public QObject { Q_OBJECT @@ -150,7 +150,7 @@ private: // Native streaming readers Lib9pStreamer *m_chat = nullptr; // Guarded — reads agent chat log Lib9pStreamer *m_state = nullptr; // Guarded — reads agent statewait - Lib9pStreamer *m_event = nullptr; // Looping — reads server eventwait + Lib9pStreamer *m_event = nullptr; // Looping — reads server event }; #endif // OLLIE9PCLIENT_H \ No newline at end of file