Commit Graph

420 Commits

Author SHA1 Message Date
Levi Neely 37c3d70544 store: use core SkillStore, remove local implementation 2026-04-21 16:22:14 +02:00
Levi Neely c2127d4458 store: combine configstore, utilstore, pluginstore, toolstore into store.go 2026-04-21 16:18:27 +02:00
Levi Neely ec251bf296 store: use core synthetic types via aliases, remove local implementations 2026-04-21 16:14:40 +02:00
Levi Neely 0aceefe75f store: use core pkg/store, re-export types as aliases
Replace local store interfaces and FlatDirStore with type aliases to
ollie/pkg/store. Synthetic dir entry helpers remain 9p-local.
2026-04-21 16:10:21 +02:00
Levi Neely 38fbc752f2 inject log.Sink from main, remove plog global
- Server.New takes *Sink, creates tagged loggers
- BatchStore/SessionFileStore use injected loggers
- main.go creates Sink, calls sink.Flush at shutdown
2026-04-21 14:49:03 +02:00
Levi Neely e031d2ba90 p9: add configstore, move skills filesystem ops from core
- configstore.go: loadAgentConfig helper for agent config loading
- skillstore.go: absorbed List/Read/Dirs from skills package
- Removed unused config imports from batchstore/server
2026-04-21 13:52:12 +02:00
Levi Neely 2ac8ca8639 remove mcp file from session namespace
- Remove mcp from session file list and read handler
- Remove mcp from ctl command list
- Remove mcp from server.go mode switch
- Update README: remove mcp from file table and ctl docs
2026-04-21 13:25:49 +02:00
Levi Neely 07c3e14f50 p9: InterruptAll on SIGINT/SIGTERM, inline agents/sessions dirs
- Add Server.InterruptAll() to cancel in-progress turns on all sessions
- Call InterruptAll() before Shutdown() on SIGINT/SIGTERM in main
- Remove defaultAgentsDir/defaultSessionsDir helpers; inline paths.CfgDir()
  expressions directly (OLLIE_CFG_PATH already handles relocation)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 12:28:36 +02:00
Levi Neely 0e43664b40 9p: simplify BatchJobStore.Wait; remove CurrentWaitValue
State is terminal-only (running→done/failed), so base comparison
adds nothing — block on the done channel directly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 20:06:40 +02:00
Levi Neely 4d5ae06780 9p: add b/{id}/log file; fix BatchJobStore.Wait empty base
Mirrors s/{id}/chat: append-only event log, tailable via Qid version
polling. Also fixes Wait not treating empty base as current value,
which caused statewait to return immediately with "running".

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 20:03:52 +02:00
Levi Neely 8cc305b2ea p9: remove statewait Topen baseline snapshot 2026-04-19 21:19:43 +02:00
Levi Neely 6527f243c5 p9: remove newline event handling; reset assistantStarted on user event
Drop formatEvent "newline" case (event no longer emitted). Reset
assistantStarted on "user" event instead so chained turns get the
"assistant: " prefix correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 21:01:11 +02:00
Levi Neely b9509a0961 batch: rename status→state, add statewait blocking read
- Rename batchJob.status → .state; update all references
- Add done chan struct{} to batchJob, closed on terminal state
- Add statewait file to b/<id>/: blocks until state leaves "running"
- Add CurrentWaitValue/Wait methods to BatchJobStore
- Extend Topen handler to snapshot waitBase for b/ wait files
- Extend Tread handler for b/ to serve statewait with 5s timeout/retry

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 20:45:01 +02:00
Levi Neely 80651d3b98 README: rename p/ prompt files to semantic names
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 20:10:08 +02:00
Levi Neely 4dd16cb840 9p: add 5s timeout to *wait reads for FUSE signal delivery
FUSE puts blocked processes in D state (uninterruptible sleep) waiting
for the read to return. SIGINT cannot interrupt D-state, so Ctrl+C has
no effect even after Tflush cancels the goroutine. A 5s timeout causes
the read to return periodically, letting FUSE unblock the client process
and deliver any pending signals.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 17:00:32 +02:00
Levi Neely 2f3c11649b 9p: fix *wait one-shot semantics and Tflush cancellation
Two fixes:
- *wait files are one-shot per open: offset > 0 returns EOF immediately
  instead of blocking on the next state transition (was consuming two
  transitions per cat invocation)
- Tflush now cancels the in-flight request goroutine via per-tag contexts,
  so Ctrl+C on a blocking cat properly unblocks the read

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 16:56:05 +02:00
Levi Neely 2bc30d275c 9p: snapshot *wait baseline at open time to eliminate inter-read race
The previous design read the current value at read time. If a state
change fired between one cat returning and the next cat opening, the
new cat would see the changed value as current and wait forever for
the next change.

Fix: snapshot the baseline in the fid at Topen time. Each read blocks
until the value changes from the open-time snapshot, then updates the
fid's baseline for the next read. The race window is closed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 16:37:45 +02:00
Levi Neely a6b6e911dd 9p: goroutine-per-request; *wait files use connection context
Serve now dispatches each 9P request to its own goroutine with a shared
response channel, so blocking reads no longer stall the serve loop.

*wait files are handled via SessionFileStore.Wait(connCtx, name), which
merges the connection context with the session context via
context.AfterFunc — the wait unblocks on either connection close or
session kill, preventing goroutine leaks.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 16:19:11 +02:00
Levi Neely 596f658703 9p: add statewait/usagewait/ctxszwait/cwdwait; rename enqueue/dequeue
*wait files block on read until the corresponding value changes, then
return the new value. enqueue/dequeue renamed to fifo.in/fifo.out.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 16:11:10 +02:00
Levi Neely 1e1769860a docs: update p/ and pl/ references for hook-based priming
- Remove 06_tool-plan.md from p/ listing (removed)
- Remove pl/ from filesystem layout and backing stores table
- Replace Go-template note with prime/agentSpawn hook explanation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 12:16:25 +02:00
Levi Neely 8dbec81362 server: remove pl/ directory and OLLIE_PLAN_PATH support
The markdown planning mechanism has been removed. pl/ no longer needs
to exist as a 9P directory.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 11:42:06 +02:00
Levi Neely 439ee6af1e p9: rename PluginStore to ExecStore
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 05:55:15 +02:00
Levi Neely fe5363702f correct prompt names in doc 2026-04-18 22:12:23 +02:00
Levi Neely 680e2a49bd p9: add x/ plugin namespace; wire elevation via x/elevate
Add PluginStore backed by scripts/x/, exposed read-only at x/ in the
9P filesystem. Remove elevator field and elevation.Detect(); update
execute.Decl() call sites to drop the now-removed elevator parameter.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 20:50:27 +02:00
Levi Neely 8b233c295e p9: wire elevation.Detect() into execute server; remove session env injection
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 20:06:48 +02:00
Levi Neely 9b747e011b p9: add writable s/{id}/env file for session-scoped env injection
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 19:19:59 +02:00
Levi Neely 734d5b4d45 9p: use env.NAME= in s/new template (no angle brackets)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 19:05:14 +02:00
Levi Neely f2cddff6ea 9p: add env.<NAME>= to s/new read template
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 19:03:19 +02:00
Levi Neely 0c585b4346 env: session-scoped injection via s/new spec; remove global env file
- createSession parses env.NAME=VALUE from spec, passes sessionEnv to
  BuildAgentEnv for MCP expansion and core.SetEnv for execute subprocesses
- Remove /env root file (was daemon-global and readable)
- No writable s/{sid}/env file needed; spec is the injection point

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 19:02:27 +02:00
Levi Neely eef8ccecd9 env: use pkg/env for defaults; expose ollie/env in 9p filesystem
- Replace inline ensureEnv() with env.EnsureDefaults() from ollie/pkg/env
- Serve ollie/env as a readable file containing the daemon's full process env
- Remove extraEnv/InitialEnv session-spec mechanism (no longer needed)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 15:44:24 +02:00
Levi Neely 237e4dec8c 9p: add b/cleanup script to server
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 12:39:33 +02:00
Levi Neely 80b7d1aad6 doc: move Agents and Example session from monorepo USAGE.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 12:28:01 +02:00
Levi Neely afe514525d doc: move Sessions reference back from monorepo USAGE.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 12:27:16 +02:00
Levi Neely 43dff26415 doc: move usage content to monorepo; README is now server reference only
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 12:25:39 +02:00
Levi Neely cf4ccc2cf1 doc: document s/sh interactive shell
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 12:23:39 +02:00
Levi Neely 4576b32a7a doc: document background job scheduling with b/sched
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 12:21:45 +02:00
Levi Neely 9611150181 doc: document AI pipeline composition with b/* and u/optimize
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 12:19:07 +02:00
Levi Neely 81f34a5516 doc: update README for u/ namespace and script reorganization
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 12:18:08 +02:00
Levi Neely 4a42002a0f 9p: move job script to b/; remove job from s/ sessionStoreFiles
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 12:14:09 +02:00
Levi Neely 0c3f4e8e4a 9p: add u/ namespace; move q/sched/optimize to correct namespaces
- Add u/ as a top-level namespace backed by scripts/u/
- Expose b/q and b/sched as script files under b/
- Remove q, sched, optimize from s/ (sessionStoreFiles)
- Update s/ script read path to scripts/s/

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 12:08:43 +02:00
Levi Neely 723d586678 9p: drive SessionStore.Get from sessionStoreFiles map
Eliminates the explicit script name list — any entry in sessionStoreFiles
beyond "new" and "idx" is automatically served from disk.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 11:33:11 +02:00
Levi Neely 5bb1783808 9p: add s/optimize to session store
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 11:28:48 +02:00
Levi Neely 3a96284d98 9p: expose s/ scripts via sessionStoreFiles map
Add s/sh, s/job, s/q, s/sched, s/ls, and s/kill as file-backed entries
in the session store, all served from ~/.config/ollie/scripts/. Introduce
sessionStoreFiles to centralize permissions and drive routing, mode, and
stat length — replacing per-entry switch cases and OR chains in server.go.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 11:05:42 +02:00
Levi Neely 4ec6707bf9 9p: add s/kill synthetic script
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 10:32:14 +02:00
Levi Neely d10bdf6fcc 9p: remove tailable machinery from non-chat session files
Tailing works well for append-only logs but is fundamentally racy for
files that get overwritten: fast state changes collapse into a single
truncation signal, so tail reads the wrong (already-stale) value.

Remove mutableFile, mutableVers, trackMutable, and the per-fid readBuf
entirely. Only chat retains append-only stat reporting (Qid.Vers +
Length) for tail -f. All other session files (state, usage, backend,
model, agent, cwd) are plain poll-on-read files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 10:20:32 +02:00
Levi Neely a876190310 Merge ollie-tmp into master 2026-04-18 09:51:41 +02:00
Levi Neely 3e7c05a6e1 9p: add s/{id}/params endpoint
Expose generation parameters (maxTokens, temperature, frequencyPenalty,
presencePenalty) as a readable/writable 9P file. Read returns all four
keys as key=value lines; empty value means unset (API default). Write
parses the same format, updating only the keys present.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 09:49:48 +02:00
Levi Neely 5286551f4c use paths.CfgDir/DataDir for config and data directories
Replace hard-coded ~/.config/ollie and ~/.local/share/ollie paths
with paths.CfgDir() and paths.DataDir() to support OLLIE_CFG_PATH
and OLLIE_DATA_PATH env vars.
2026-04-17 15:31:19 +02:00
Levi Neely 231e9ebcc5 s/ls, ollie-tmp-path 2026-04-17 13:05:23 +02:00
Levi Neely 9cf6ba8d51 9p: update ollie/tmp doc comment
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 09:29:00 +02:00