Commit Graph

392 Commits

Author SHA1 Message Date
Levi Neely 9bfccebff6 change tools to hierarchical 2026-04-30 14:38:47 +02:00
Levi Neely 7c113c1db4 docs: update session files list and ctl commands 2026-04-30 09:07:49 +02:00
Levi Neely 61c169af3b move store package from core into 9p/store 2026-04-30 07:53:39 +02:00
Levi Neely 4aa815b50c server: add cost to readable session files
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-27 18:14:34 +02:00
Levi Neely fee59a2f7c 9p: add 10s read timeout to all store read operations 2026-04-27 13:23:54 +02:00
Levi Neely b44ce18d54 server: dispatch handleWrite on empty writes from writable fids
Fids opened OWRITE or ORDWR with zero bytes written were silently
dropped on clunk — the old writeBuf-length guard prevented handleWrite
from being called, leaving the previous file content intact.

Track writable by open mode instead, and remove the blanket empty-input
early return in handleWrite. /s/new retains its own empty guard since
a zero-byte write there is meaningless.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 12:49:58 +02:00
Levi Neely fb4d76a3aa server, docs: remove batch jobs; rename spec -> cfg
BatchStore removed from server. s/new always creates an interactive
session. Filesystem layout updated: batch dirspec gone, cfg replaces
spec in session dirspec, s/job -> s/b, s/q -> s/bfg, s/sched -> s/bbg.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 08:41:46 +02:00
Levi Neely b432ba987c server: update mode mappings for spec; drop removed session files
spec is 0666; offset/statewait/systemprompt/models/ctxsz/usage are
0444 explicitly. Remove mode cases for state, backend, model, agent,
cwd, params, cwdwait, usagewait, ctxszwait. Update README.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 07:42:58 +02:00
Levi Neely f1a60264e2 docs: document batch job vs interactive session dirspec distinction
s/new routes to BatchStore (one-and-done lifecycle) when the write
contains a \n---\n separator, and to SessionStore (multi-turn) otherwise.
Document both dirspecs separately: batch jobs have spec/state/statewait/
result/usage/ctxsz/log; interactive sessions have the full file set.
Also add missing params file to session dirspec.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 07:14:22 +02:00
Levi Neely c464879c1b docs: update README for s/b/ unification and new filesystem entries
Remove b/ directory (merged into s/ after namespace unification).
Add job/q/sched/cleanup scripts under s/, document tr/ and tmp/
endpoints, fix t/idx entry, update backing stores table, and correct
olliesrv mount subcommand signature.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 07:05:52 +02:00
Levi Neely 8d5be7212f 9p: remove /b/ namespace, batch jobs served via /s/
All /b/ routing removed from pathType, read, remove, handleWrite,
readDir, and makeStat. The batchStore field is gone from Server;
SessionStore now handles both session and batch job lifecycle.

-154 lines from server.go.
2026-04-23 18:49:45 +02:00
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