Commit Graph

2134 Commits

Author SHA1 Message Date
Levi Neely fd4a3afa4f move tool catalog to toolsrv: add /all file, tools_all ctl command
- Remove /tools from olliesrv root (toolsrv owns all tool state)
- Add /all file to toolsrv namespace (lists all available tools on disk)
- Add ListAllTools() to toolsrv client library
- Add tools_all ctl command to agent (reads from toolsrv/all)
- Update system prompt with tools_all usage
2026-08-13 21:58:08 +02:00
Levi Neely 16e54d1f03 fix: trailing comma in agent configs (invalid JSON from sed) 2026-08-13 21:49:58 +02:00
Levi Neely a8cc7914e0 justfile: remove tool_load install line 2026-08-13 21:48:13 +02:00
Levi Neely a1e78bca80 remove tool_load: use ctl directly
tool_load was a built-in intercept in the agent loop — the only
'tool' that didn't run in toolsrv. Removed entirely:
- Intercept in loop.go (25 lines)
- Script + .meta in data/tools/
- autoLoad references in agent configs

Loading tools is now exclusively via ctl (which already existed):
  echo 'tool_load X' | ollie-9p write .../ctl

System prompt updated to show the ctl pattern.
2026-08-13 21:44:46 +02:00
Levi Neely ef640fb4be doc/architecture.md: combine philosophy paragraphs 2026-08-13 21:29:01 +02:00
Levi Neely 0eeef8eb4a doc/architecture.md: remove Emacs comparison from philosophy 2026-08-13 21:28:30 +02:00
Levi Neely e5d067ecf8 doc/architecture.md: fix event streaming description (pub/sub, not ring buffer) 2026-08-13 21:27:34 +02:00
Levi Neely 7b4eea5c00 doc/architecture.md: tool defs belong in toolsrv box 2026-08-13 21:25:06 +02:00
Levi Neely 22c34cf231 doc/architecture.md: remove dead ollie-remote from diagram 2026-08-13 21:24:27 +02:00
Levi Neely 2707bfce57 doc/architecture.md: fix ollie-remote (dead), fsedsl→virtfs, add feed+lib9p 2026-08-13 21:23:06 +02:00
Levi Neely e379a08c08 doc/9p.md: add feed file to namespace table and examples 2026-08-13 21:21:22 +02:00
Levi Neely 51d0576680 doc: add pair programming section, update evolution, fix o new syntax
- README: add 'Pair programming' to capabilities table
- usage.md: full section on observer agent setup + wiring patterns
- usage.md: update o new syntax to sname/aname form
- evolution.md: document feed + BlockOnce/Stream refactor session
2026-08-13 21:18:25 +02:00
Levi Neely 4061e494b3 remove ObserverFeed script — feed file replaces it 2026-08-13 21:10:22 +02:00
Levi Neely 324247b6a5 fs: remove dead streamChat and mergeCtx 2026-08-13 21:09:53 +02:00
Levi Neely 4bb08e860b toolsrv: fix shutdown ordering — close conn before draining
On context cancellation, close the connection first to unblock
ReadFcall. Then wait for in-flight handlers, drain the response
channel, and wait for the writer to finish. No writes hit a
closed socket.
2026-08-13 21:08:01 +02:00
Levi Neely d9026499fd toolsrv: suppress write errors during shutdown 2026-08-13 21:04:19 +02:00
Levi Neely bcaac146d2 server: on BlockOnce timeout, fall back to non-blocking Read
Frontends rely on getting the current state on timeout (heartbeat).
When BlockOnce returns empty (5s timeout), the server now calls the
plain Read handler as fallback. Files without a Read handler (like
feed) return nothing — consumer unaffected.
2026-08-13 20:59:05 +02:00
Levi Neely dd0021fd9a fix: restore sessions after 9P listener is ready
ConsumeFeed dials the 9P socket. Moving session restore to after
the listener starts ensures the socket exists when feed consumers
connect.
2026-08-13 20:55:02 +02:00
Levi Neely dcd119c853 virtfs: refactor Stream to accept (readFn, signalFn)
Same pattern as BlockOnce: framework handles the blocking loop.
readFn takes a base string, returns (data, nextBase, error).
signal fires when new data may be available.

Chat stream handlers now use Stream(a.ChatRead, a.ChatSignal).
StreamRaw retained for custom handlers.

streamChat() in support.go is now dead code (replaced by ChatRead).
2026-08-13 20:50:27 +02:00
Levi Neely 794673a5d0 virtfs: refactor BlockOnce to accept (readFn, signalFn)
BlockOnce now takes a value-reader and a signal source. The framework
handles the blocking loop: read → compare hash to base → if different
return → else wait on signal or timeout.

On timeout (ctx.Done), returns empty (not error) so clients re-open
cleanly.

BlockOnceRaw retained for queue-style handlers (bypass/pending,
proc/wait) that manage their own blocking.

EventValue adapter wraps a <-chan Event into BlockOnce-compatible
(readFn, signalFn) pair via a thin goroutine.
2026-08-13 20:44:50 +02:00
Levi Neely b5cb8c397d feed: BlockOnce with base init, ConsumeFeed via lib9p client
- BlockOnce handler initializes base to current hash on fresh open,
  then blocks until hash changes. Same pattern as statewait.
- ConsumeFeed is a plain function: dials 9P, reads feed in a loop
  (open → block → data → close → repeat), submits to agent.
- Context cancellation closes the 9P client, unblocking Read().
- Called as go ConsumeFeed(ctx, ag) from AddAgent and session resume.
2026-08-13 20:26:08 +02:00
Levi Neely e2695d6f50 feed: export Feed field, remove wrapper methods, use direct access everywhere 2026-08-13 20:09:28 +02:00
Levi Neely 1537e35685 feed: inline handlers, remove FeedBlockingRead wrapper 2026-08-13 20:06:32 +02:00
Levi Neely 721b49ffa2 feed: use BlockOnce for read side, dedup via base comparison
Feed is now read-write (0666):
- Write: store data, signal via notifyChange
- Read (BlockOnce): block until content hash differs from base

Dedup lives in the read layer (same pattern as statewait). The
internal consumer goroutine and external 9P clients both call
FeedBlockingRead — same codepath, same dedup logic.

Consumer started from AddAgent (if ctx available) and session resume.
2026-08-13 20:05:46 +02:00
Levi Neely dfacdfed94 agent: add feed file — change-detecting streaming input gate
Feed is a write-only file in the agent namespace. Writes are
deduplicated against the previous value; the internal consumer
(blocking on WaitChange/WatchFeed) only wakes when genuinely new
data arrives.

Wiring is external and source-agnostic:
  # human → observer (poll git):
  while :; do git diff HEAD; sleep 5; done | ollie-9p write .../feed
  # agent → observer (stream chat):
  ollie-9p read .../coder/chat | ollie-9p write .../observer/feed

Uses the agent's existing signalCh/notifyChange plumbing — no new
channel infrastructure. Consumer goroutine spawned at agent creation
(AddAgent) and session resume, tied to session context.
2026-08-13 20:02:06 +02:00
Levi Neely 5459e7fa2a fix: XDG default fallback in prompt resolver; deduplicate tool headers
- envLookup: provide XDG spec defaults (XDG_CONFIG_HOME, XDG_DATA_HOME,
  XDG_CACHE_HOME) when env vars are unset, so agent profile prompts
  resolve correctly on systems without explicit XDG vars.
- renderTools: skip generated '## name' header when the tool's prompt
  text already starts with a markdown header, eliminating duplicates.
2026-08-13 15:45:35 +02:00
Levi Neely 0b932a60ca rename observer-feed to ObserverFeed 2026-08-13 14:55:33 +02:00
Levi Neely b9dfae0204 observer prompt: make constraints explicit and unambiguous 2026-08-13 14:28:51 +02:00
Levi Neely 81e78a952d add observer agent: read-only watcher with git-based feeder script
- observer.json: read-only tool set (file_read, file_grep, file_glob, reasoning_think)
- agent-observer.md: terse observation-only prompt
- observer-feed: polls git diff, feeds changes to agent prompt
- justfile: install new files
2026-08-13 14:28:20 +02:00
Levi Neely 78d11f2ce8 update kde submodule 2026-08-13 12:27:39 +02:00
Levi Neely 6a19c135eb prompts: drop tool path from system prompt, use absolute path in copilot example 2026-08-13 12:04:52 +02:00
Levi Neely 83b0b59a0a prompts: remove /home/user path examples that bias tilde expansion
- file_grep.meta: replace /home/user/project with /abs/path
- system_prompt.md: use $XDG_CONFIG_HOME instead of ~
- agent-copilot.md: use relative path in code block example
2026-08-13 12:02:27 +02:00
Levi Neely 1ac50d97e1 agent: drain FIFO after interrupted/failed turns
Fix holes where queued prompts were orphaned:
- After turn loop exits (interrupt, toolsrv unavailable), drain remaining FIFO items
- On panic recovery, pop next FIFO item and re-submit in a new goroutine
- fifo file write triggers Submit when agent is idle
2026-08-13 11:59:11 +02:00
Levi Neely e662d32c61 o: simplify new — only accept sname/aname syntax 2026-08-13 09:30:01 +02:00
Levi Neely 6465861908 o: accept sname/aname syntax for new command 2026-08-13 09:29:00 +02:00
Levi Neely 05770ee28b o: re-split args to handle quoted invocations from acme 2026-08-13 09:24:52 +02:00
Levi Neely 37608ab9b6 o new: ignore 'session already exists' error 2026-08-13 09:22:18 +02:00
Levi Neely bbf8176cc8 o new: use sname/aname syntax to create session+agent 2026-08-13 09:19:34 +02:00
Levi Neely c4b5a58300 doc: promote evolution.md to doc/, add rationale
It's a study log, not a resource. Added opening paragraph explaining
what the document is and why the dead ends matter.
2026-08-12 21:48:06 +02:00
Levi Neely 155e4fe97b evolution: consolidate dead ends into comprehensive final table
Removed two inline 'Dead Ends and Reversals' tables scattered mid-document.
Added single comprehensive table at the end covering all reversals from all
phases — including hooks, event ring buffer, abstractions, namespace merges,
concurrent-by-default rejection, and every other thing that was built and
then killed.
2026-08-12 21:39:53 +02:00
Levi Neely 8ead5c29e1 evolution: update background process interrupt delivery, drop concurrent-by-default
Background processes now deliver completions as user prompts (queued via
the agent's prompt file) upon completion, not injected in-loop alongside
tool results.

Removed 'Open Problem: Concurrency' section — concurrent-by-default was
considered and rejected (sequential execution but slower and more expensive).
Replaced with a paragraph explaining the deliberate design choice.
2026-08-12 21:30:33 +02:00
Levi Neely e323e7079e doc: add Phases 22-26 + Good Idea Fairy + pubsub migration to evolution.md
Major architectural changes documented:
- Aug 3: Ring buffer -> pubsub (Phase 19)
- Aug 5: Hooks deleted entirely, ~960 lines removed
- Aug 11-12: Meta-only tool definitions, bypass via 9P, fs/ flattening,
  sandbox simplification, agent loop cleanup
2026-08-12 20:43:08 +02:00
Levi Neely ef9a56d41b doc: rename tool scripts to tool definitions throughout 2026-08-12 19:40:06 +02:00
Levi Neely df7eefaf71 doc: rename tool-overlays to tool-definitions 2026-08-12 19:35:58 +02:00
Levi Neely 7d44e9ac1f doc: add tool overlays documentation
- Add doc/tool-overlays.md explaining meta-only tools and overlay pattern
- Examples: ripgrep, kubectl, MCP server wrapping
- Update README.md with tool overlays row in capabilities table
2026-08-12 19:14:32 +02:00
Levi Neely 9b98a958cc fix: treat meta cmd as shell command string, prepend tools dir to PATH
- ResolveTool now returns cmd field as-is instead of trying to resolve
  it as a binary path. This allows meta-only tools to use full shell
  command strings with env vars, pipes, and subshells.

- Prepend ~/.config/ollie/tools to PATH when executing tools so cmd
  fields can reference other tools by name.
2026-08-12 18:44:16 +02:00
Levi Neely 92d9fec51a docs: fix auth section - both servers use attach identity for permissions 2026-08-12 18:20:34 +02:00
Levi Neely 255986bad6 docs: fix 9p.md auth section, clarify toolsrv Tauth and aname scoping 2026-08-12 18:17:39 +02:00
Levi Neely 79a7cc68c7 docs: rewrite 9p.md to match current olliesrv and toolsrv namespaces 2026-08-12 18:16:55 +02:00
Levi Neely c2df612da5 docs: update usage.md slash commands, fix context model description 2026-08-12 18:12:01 +02:00