Commit Graph

181 Commits

Author SHA1 Message Date
Levi Neely 9f5286c8b2 feat: add tail file mode to session makeStat 2026-04-22 12:29:35 +02:00
Levi Neely cb206a7387 docs: update README for refactor (stores, prompts, sandbox) 2026-04-22 10:35:38 +02:00
Levi Neely 2df001a5eb server: report content length for session files in stat
makeStat was missing a case for /s/{id}/{file} paths, so stat
reported Length=0 and clients (cat via 9pfuse) read zero bytes.
2026-04-22 09:38:33 +02:00
Levi Neely 426a6ac7bc remove tracked binary, add .gitignore 2026-04-21 21:10:50 +02:00
Levi Neely f411589519 server: adapt to Store+StoreEntry model
- Replace Get/Put calls with storeRead/storeWrite helpers
- Replace Wait calls with storeBlockingRead helper
- Wrapper types override Open instead of Get
- Use OpenStore for session/batch child stores
- All store fields typed as Store
2026-04-21 20:07:37 +02:00
Levi Neely ee1710b2cb server: use Open instead of JobStore/SessionFileStore
- FlatDirStore alias points to BlobStore
- Server fields use BlobStore for flat stores
- Replace JobStore/SessionFileStore with Open
- Type-assert for Wait/LogInfo where needed
- Rename store variable to sfs to avoid package shadowing
2026-04-21 19:03:19 +02:00
Levi Neely d5bc214bd0 server: delegate SessionFileStore construction to SessionStore
- Wire SaveTranscript into SessionStoreConfig
- sessionFileStore now calls sessionStore.SessionFileStore
2026-04-21 18:29:00 +02:00
Levi Neely d6bf477531 server: adapt to store storeConfig architecture
- FlatDirStore alias points to store.Store interface
- UtilStore/ExecStore/ToolStore embed interface not pointer
- NewFlatDirStore/NewSkillStore return interfaces
- Rename ChatInfo->LogInfo
2026-04-21 18:23:28 +02:00
Levi Neely 6936c1c959 flatten: merge internal/p9 into package main
Removes internal/p9/ directory. store.go and server.go merged into
root server.go alongside main.go. No logic changes.
2026-04-21 16:44:02 +02:00
Levi Neely 73b634b6d3 store: use core Session/SessionStore/SessionFileStore, remove local implementations
Server no longer owns sessions map or session lifecycle methods.
SessionStore and SessionFileStore are type aliases to core.
Fid path rewriting on rename handled via OnRename callback.
2026-04-21 16:37:43 +02:00
Levi Neely b6d579d74c store: use core BatchStore, FormatEvent, LoadAgentConfig; remove local batchstore 2026-04-21 16:29:38 +02:00
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