doc/9p.md: add feed file to namespace table and examples

This commit is contained in:
Levi Neely 2026-08-13 21:21:22 +02:00
parent 51d0576680
commit e379a08c08
1 changed files with 12 additions and 2 deletions

View File

@ -64,6 +64,13 @@ for s in session/*/agent/*/prompt; do echo "run tests" > "$s"; done
# Wait for all agents to finish
for s in session/*/agent/*/statewait; do cat "$s" > /dev/null; done
# Pipe git diffs into an observer's feed (dedup is automatic)
while :; do git diff HEAD --; sleep 5; done | ollie-9p write session/myproj/agent/obs/feed
# Wire an agent's state changes to an observer
while :; do ollie-9p read session/myproj/agent/coder/statewait >/dev/null; git diff HEAD --; done \
| ollie-9p write session/myproj/agent/obs/feed
# Grep all agent plans
grep -r "TODO" session/*/agent/*/plan
@ -83,8 +90,10 @@ with a 10-line shell script instead of a framework.
per-fid: write a request, read back the result
- **`ctl` files** — control operations (stop, kill, rename, compact) are writes
to a control file, not method calls
- **Blocking reads** — `statewait` blocks until state changes, replacing event
subscriptions with a simple `cat`
- **Blocking reads** — `statewait` and `feed` block until their value changes,
replacing event subscriptions with a simple `cat` in a loop
- **Change detection** — `feed` deduplicates on the read side: same data written
repeatedly never wakes the reader
- **Multiplexing** — multiple clients mount the same server simultaneously,
each with an independent view through per-fid state
@ -145,6 +154,7 @@ echo '{"prompt":"explain recursion"}' | ollie-9p rdwr generate
|------|------|-------------|
| `prompt` | w | Queue a new turn (write prompt text) |
| `fifo` | r/w | Prompt queue (write=enqueue, read=dequeue) |
| `feed` | r/w (blocking) | Change-detecting input: write data, read blocks until value changes |
| `chat` | r (streaming) | Filtered text output (markers stripped) |
| `chat.raw` | r (streaming) | Full output with block markers |
| `statewait` | r (blocking) | Blocks until state changes, returns new state |