Commit Graph

50 Commits

Author SHA1 Message Date
Levi Neely 9e26eb0375 s/b: poll for session directory after creation
FUSE entry cache may not reflect the new session directory immediately
after the write to s/new returns. Poll until it appears, mirroring the
approach in s/sh.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 09:17:41 +02:00
Levi Neely 00155f28fc s/b: write s/new as single write() to avoid partial-KV parse failure
Bash's printf builtin issues one write() syscall per call; the server
processes each write independently, so the first write (name= only)
would fail the cwd-required check. Build the full KV string first,
then write once.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 08:48:58 +02:00
Levi Neely b3e0367078 fix s/bfg and s/bbg: reference s/b not s/job
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 08:44:48 +02:00
Levi Neely 57d164310c remove batch jobs; rename spec -> cfg; s/job -> s/b, s/q -> s/bfg, s/sched -> s/bbg
Batch jobs were a front-end concern. All one-shot query workflows now
compose session primitives via s/b (engine), s/bfg (foreground), and
s/bbg (background). Parallel execution is a shell loop.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 08:42:38 +02:00
Levi Neely 127e518dae frontends: update to spec file; remove individual session file reads
tui/session: IsIdle reads spec and parses state= key.
scripts/s/sh, sh.rc: add spec_get helper; is_idle, /cwd, /model,
/agent, /backend read via spec_get; writes go to spec as key=value.
el/ellie.el: ellie--state reads spec with string-match on state=.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 07:43:10 +02:00
Levi Neely f4c340c2cb unify s/ and b/ namespaces: batch jobs now live under s/
Option C implementation: single namespace with composable file tables.
Batch jobs are sessions with a reduced file set — the directory
contents declare the capability.

- core: SessionStore absorbs BatchStore; s/new detects batch format
- 9p: /b/ removed entirely; all routing through /s/
- scripts/b/* moved to scripts/s/*; paths updated
- subagent_spawn, optimize: /b/q -> /s/q
- scripts/b/ removed
2026-04-23 18:50:05 +02:00
Levi Neely 5457e3ba43 scripts/s/sh: port from bash to rc shell
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 20:29:30 +02:00
Levi Neely 2a741f50eb Fix s/sh display synchronization issue
Simplify the script to fix the timing/display problem where LLM responses
weren't shown in real-time and user typing wasn't echoed properly.

The fix:
1. Block on statewait file until agent leaves idle state
2. Stream chat output in loop while agent is not idle
3. Use simple tail -c +offset to read new chat content
4. Remove complex buffering logic and background processes

This resolves the issue where assistant responses would appear one prompt
late and user typing wasn't visible during LLM response generation.
2026-04-19 21:55:06 +02:00
Levi Neely d37f23da39 b/q: accept piped stdin 2026-04-19 21:19:49 +02:00
Levi Neely 3bc6785230 scripts,docs: batch status→state; use statewait in b/job and b/cleanup
b/job now blocks on statewait instead of polling; b/cleanup reads state.
Update all documentation references. Bump 9p submodule.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 20:45:08 +02:00
Levi Neely 748337571f scripts/s/sh: statewait, stdin pipe, startup tail; bump tui
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 17:20:20 +02:00
Levi Neely e23c79c713 docs,prompts,scripts,tui,el: rename enqueue/dequeue to fifo.in/fifo.out; add *wait docs; bump submodules
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 16:11:19 +02:00
Levi Neely 8d870001bc prompts: migrate to hook-based priming via prime script
Remove Go template syntax from all prompt files (converted to envsubst
variables in prior commits). Agent agentSpawn hooks now call prime for
each prompt file explicitly, replacing the automatic Go-based directory
scan. coding agent gets 08_tool-elevate; default does not.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 12:10:26 +02:00
Levi Neely acc791cbda scripts: add prime wrapper for agentSpawn prompt injection
prime <name> prints $OLLIE/p/<name>[.md] to stdout, which the agentSpawn
hook captures as context. Allows agent prompt composition to be driven
entirely from hook config rather than built-in Go code.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 12:03:28 +02:00
Levi Neely 6ca864de19 scripts: fix bd wrapper path (.local/bin/bd not .local/bd)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 11:25:38 +02:00
Levi Neely 2d3d17237b tools,scripts: use -e not -d for .git boundary check
Submodules have .git as a file, not a directory. -d was stopping the
walk immediately in submodule directories.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 11:20:34 +02:00
Levi Neely a960566ec9 tools,scripts: bound .beads walk-up at .git boundary
Walk up from CWD only while .git exists at each level. Stops at the
first directory without .git, preventing false positives outside the repo.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 11:18:08 +02:00
Levi Neely 78cd60581d scripts: add bd wrapper to x/; prepend $OLLIE/x/ to PATH in execute server
The bd wrapper walks up from CWD to find a .beads directory and sets
BEADS_DIR, so bd works from any subdirectory of a monorepo without the
model needing to know about it.

The execute server now always prepends $OLLIE/x/ to PATH for tool
subprocesses, so wrappers placed there shadow system binaries transparently.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 11:07:15 +02:00
Levi Neely 8a82d0966b elevation: add x/elevate plugin; update mkfile and docs
Replace tools/elevate_superpowers with scripts/x/elevate — a single
self-contained plugin that bootstraps into a superpowers session and
runs the IPC. mkfile installs it to ~/.config/ollie/scripts/x/.
Update 08_tool-elevate.md to remove backend-specific language.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 20:50:37 +02:00
Levi Neely 4202505704 elevation: add elevate_superpowers tool; remove frontend env injection from s/sh and submodules
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 20:07:10 +02:00
Levi Neely c06fed4503 env: inject session env via s/{id}/env; works on new and resumed sessions
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 19:20:03 +02:00
Levi Neely ed2316c2d0 env: session-scoped env via -e flag; remove daemon-global env export
- s/sh: add -e VAR1,VAR2 flag to inject named vars from frontend env
  into session spec as env.NAME=VALUE lines
- s/sh: remove $MOUNT/env export loop (global env file removed)
- Bump core and 9p submodules

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 19:02:35 +02:00
Levi Neely 72eeff473a env: centralize daemon env management; add /mcp slash command to s/sh
- Bump core and 9p submodules for env refactor
- s/sh: export daemon env from $MOUNT/env on startup
- s/sh: add /mcp command

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 15:44:31 +02:00
Levi Neely 179a157c8b scripts/s/sh: implement all supported slash commands
Add explicit handlers for all session ctl commands (/stop, /kill,
/compact, /clear, /rn, /cwd) and session file r/w commands (/agent,
/model, /backend) and read-only queries (/models, /backends, /usage,
/ctxsz). Ctl commands now continue past the drain loop. /rn updates
local $id/$S after rename. Unknown slash commands print an error
instead of writing garbage to ctl.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 14:53:42 +02:00
Levi Neely e3eb782be5 scripts: b/job parallel improvements — streaming results, input/output headers, -failfast
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 13:52:22 +02:00
Levi Neely 9de1baa197 scripts: add b/cleanup; update docs and mkfile
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 12:39:34 +02:00
Levi Neely ea58313f94 scripts: b/job accepts args as instruction and stdin as content when both present
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 12:36:05 +02:00
Levi Neely ab0b354132 doc: reorganize scripts README by namespace
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 12:15:36 +02:00
Levi Neely 9da56b0622 scripts: rename s/job -> b/job; b/q and b/sched wrap b/job
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 12:14:14 +02:00
Levi Neely 718fabf500 scripts: use $0 for cmd name in q, sched, sh
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 12:12:00 +02:00
Levi Neely 11ee91cd5a scripts: use $0 for error/usage name in s/job
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 12:10:24 +02:00
Levi Neely c43b9e5213 doc: add missing s/ls and s/kill sections to scripts README
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 12:01:13 +02:00
Levi Neely 106bd6410e scripts: move optimize to u/ (utility) namespace
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 12:00:39 +02:00
Levi Neely 97297a6c76 scripts: move q and sched to b/ namespace
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 11:58:42 +02:00
Levi Neely a4ba0f9f9f scripts: organize by hosted namespace (scripts/s/)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 11:56:35 +02:00
Levi Neely 4b630a76a8 doc: document optimize script and AI pipeline composition
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 11:43:01 +02:00
Levi Neely 1eda21b900 scripts: make optimize executable
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 11:31:07 +02:00
Levi Neely fc818dd28f scripts: add s/optimize — LLM prompt optimization pipeline
Generates N candidate optimized prompts in parallel, then judges and
returns the best. Accepts -cb/-cm for candidate model and -jb/-jm for
judge model, defaulting to OLLIE_BACKEND/OLLIE_MODEL for both stages.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 11:28:54 +02:00
Levi Neely a69f1cbc2b scripts: don't pass output= to server; formatting is client-side only
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 11:20:08 +02:00
Levi Neely e0b9f3ece7 scripts: replace -output with -json flag in oq and wrappers
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 11:17:42 +02:00
Levi Neely 2ac6378c7e scripts: emit JSONL for -output json; plain newline only for text
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 11:15:18 +02:00
Levi Neely fe23dba7b3 scripts: ensure newline after each oq result
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 11:11:32 +02:00
Levi Neely c0f13ada3e scripts: add -help to s/q and s/sched wrappers
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 11:08:38 +02:00
Levi Neely e396ea15d2 scripts: add -help to osh and oq
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 11:07:06 +02:00
Levi Neely 7a4d5fc4c8 doc: document all s/ scripts (ls, kill, q, sched)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 11:06:32 +02:00
Levi Neely f984565082 scripts: add s/sh, s/job, s/q, s/sched, s/ls, s/kill to ollie filesystem
Install scripts to ~/.config/ollie/scripts/ (not ~/bin/) so they are
served via the 9p mount without PATH changes. Add thin wrappers oq-q
(s/q, foreground one-shot) and oq-schedule (s/sched, background with
b/ path output). Switch osh and oq from OLLIE_9MOUNT to OLLIE.
Update mkfile, docs, and submodule pointer.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 11:06:05 +02:00
Levi Neely 57b037d238 oq: add -bg flag and trailing newline on exit
-bg submits the job and exits immediately, printing session id(s) for
later retrieval via b/<id>/result; implicitly enables -keep.
A trailing newline is printed on all exit paths via an EXIT trap.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 22:46:50 +02:00
Levi Neely 7f65ccf383 scripts/osh: fix write_new exit code
Brace group exit code was the last [ -n ] test, which returns 1 when
the variable is empty, triggering || die even on success. Adding true
as the final statement ensures a clean exit.
2026-04-16 19:39:06 +02:00
Levi Neely 59abf0fa7d scripts/osh: fix session creation and /kill
Replace write to defunct /ctl with s/new spec format. Add -name flag
so named sessions skip the post-write poll. Fix /kill to write to
s/{id}/ctl instead of the removed top-level ctl file.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 19:35:02 +02:00
Levi Neely 694a840c21 rename toys/ to scripts/
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 19:31:51 +02:00