Commit Graph

97 Commits

Author SHA1 Message Date
Levi Neely b4be3a01d9 add cascade tool and script-driven orchestrator
tools/cascade: fire-and-forget delegation to cheap model; worker
reports back to parent prompt when done. Parallelizable.

scripts/u/cascade: script-driven hub-and-spoke orchestrator for
terminal use — planner decomposes, workers execute in parallel,
planner synthesizes.
2026-05-17 13:16:18 +02:00
Levi Neely 4888db8e12 u/complete: add -cwd flag; acme submodule update (type resolution) 2026-05-11 16:50:43 +02:00
Levi Neely 6ae476355a u/complete: stronger prompt (no reasoning output); drop :: echo to stderr 2026-05-11 16:15:27 +02:00
Levi Neely bb13c24ef2 u/complete: prompt says implement, not complete; reject stub echoing 2026-05-11 15:48:52 +02:00
Levi Neely 51fc98ccdf u/complete: add -context flag, increase prefix to 12K chars 2026-05-11 14:07:58 +02:00
Levi Neely 1c26a19c0a update acme, scripts 2026-05-08 17:41:55 +02:00
Levi Neely 767a6ab64f sh: simplify sigint handler - just send stop, let rc resume 2026-05-08 14:59:21 +02:00
Levi Neely 2a98363b99 sh: fix signal handler name: sigint not sigintr 2026-05-08 14:58:20 +02:00
Levi Neely 2c4d8a0782 sh: remove statewait read before poll loop 2026-05-08 14:56:45 +02:00
Levi Neely b07fcec765 sh: read state file directly instead of parsing cfg 2026-05-08 14:55:35 +02:00
Levi Neely 284f1969d8 sh: on Ctrl-C during turn, send stop and re-exec to resume 2026-05-08 14:53:27 +02:00
Levi Neely 7265c8202d sh: redefine sigintr during agent turn to interrupt without exiting 2026-05-08 14:46:41 +02:00
Levi Neely dd4e5a677a sh: Ctrl-C interrupts running turn instead of exiting 2026-05-08 14:45:02 +02:00
Levi Neely fb29487a1f revert chatwait changes in sh and acme frontends 2026-05-08 12:45:05 +02:00
Levi Neely ecbb9e240c use chatwait for responsive streaming in sh and acme frontends 2026-05-08 12:08:54 +02:00
Levi Neely ba8f7948bb s/sh: fix case patterns for argument-taking commands
Quoted '*' in rc switch cases is a literal character, not a wildcard.
Replace '/cmd *' patterns with /cmd?* so rc treats them as globs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 08:18:15 +02:00
Levi Neely 3186bb12f2 s/sh: replace readmulti with inline bash readline; fix /model feedback
Replace the Python raw-mode multiline hack (readmulti) with an inline
bash read -e loop using backslash continuation. Add show_new to display
the server response after /model, /agent, /backend cfg writes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-05 22:47:20 +02:00
Levi Neely 45d1b6b77e readme: add "What you get" section; update submodules
- README.md: add feature summary with bulleted list
- acme: add README documenting ollie-acme and Kmpl
- el: refactor completion to shell out to u/complete
- u/complete: improve prompt and strip leaked tags
2026-05-03 22:03:01 +02:00
Levi Neely ed178dfad0 u/complete: prompt to complete logical unit, not just minimal insertion 2026-05-03 21:32:40 +02:00
Levi Neely 410335cb51 u/complete: split into completion engine + acme glue (Kmpl)
u/complete is now acme-free: reads prefix from stdin, takes -suffix,
-file, -model, -backend flags. Prints completion to stdout.

acme/scripts/Kmpl is the thin acme wrapper that extracts prefix/suffix
from the window and pipes to u/complete.

Also fixes prefix truncation bug (bash substring returning empty when
string is shorter than offset) and updates core submodule with
interrupt handling improvements.
2026-05-03 21:10:57 +02:00
Levi Neely 2f7107d44c u/complete: strip markdown fences, insert at cursor, info to stderr
Also set tools:false on copilot agent and update core submodule
with the new tools config field.
2026-05-03 14:59:05 +02:00
Levi Neely ebea90d5f7 u/complete: fix TOCTOU race spawning duplicate copilot sessions
Use deterministic session ID derived from cwd hash instead of
timestamp. Concurrent invocations for the same directory now
converge on the same session name, and the server rejects the
duplicate atomically.
2026-05-03 14:08:15 +02:00
Levi Neely 3c03faed3a u/complete: persistent copilot session per cwd; add freeloader hook
- Replace per-invocation s/bfg calls with a persistent *-copilot session
  looked up from s/idx; first call in a cwd spawns the session, subsequent
  calls reuse it, skipping s/new overhead
- Clear context after each completion so inference stays fast
- Fix session lookup to read s/idx instead of globbing the 9P mount
- Add x/freeloader turnError hook to copilot.json

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 13:54:29 +02:00
Levi Neely cddda76a3f u/complete: add model/backend flags and env var support; fix winid=0
- Add -model and -backend flags; read OLLIE_COMPLETE_MODEL /
  OLLIE_COMPLETE_BACKEND as defaults; error if neither is set
- Guard against winid=0 (acme column tag / +Errors window)
- Document OLLIE_COMPLETE_MODEL and OLLIE_COMPLETE_BACKEND in
  README.md and doc/env.sample

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 13:43:30 +02:00
Levi Neely 2c8e59e7f5 acme: add u/complete for AI ghost-text code completion
Adds a u/complete script that reads prefix/suffix from the current acme
window via dot position, submits a fill-in-the-middle prompt to ollie
via s/bfg, and writes the completion to a new ollie/complete window.

Also adds a minimal copilot agent config (no system prompt, no tools)
for use by u/complete, and wires both into the install target in mkfile.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 13:30:26 +02:00
Levi Neely 5682065bbd restore readmulti, update s/sh command reference in USAGE.md 2026-05-01 10:41:07 +02:00
Levi Neely cfe367bca1 docs: sync documentation with current implementation
- Update agent config docs (prompt array, hooks, mcpServers)
- Add new session files (context, cost, env, plan, prompt.prev)
- Document httpgw daemon subcommands
- Update tool scripts list
- Move readmulti to tui submodule
2026-04-30 09:07:59 +02:00
Levi Neely 415d75c97f freeloader: exhaust full model pool before giving up; fix resubmission and stream newlines
- scripts/x/freeloader: track tried models per-session in freeloader-tried-$SID;
  walk the full sorted :free pool in order before exiting 1; write recovery
  prompt to fifo.in (not prompt) to avoid goroutine race
- core submodule: 404 tool_unsupported detection + FIFO drain on error
- tui submodule: fix mid-stream newlines from backgroundTail chatOff race

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-28 18:47:57 +02:00
Levi Neely 15df9eeb1a freeloader: turnError-driven free model cycling with blacklist
- scripts/x/freeloader: hook-driven script; intercepts rate_limit and
  tool_unsupported on :free models; auto-blacklists on tool_unsupported;
  cycles to next non-blacklisted free model; exits 1 for unhandled errors
- agents: add turnError hook to all agent configs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-28 17:17:56 +02:00
Levi Neely 84e7b29015 agents: inline bd prime conditional; simplify task dispatcher
Replace 'task prime' hook with inline .beads walk in all agent configs —
no wrapper script needed. Drop 'prime' subcommand from scripts/x/task.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 12:31:34 +02:00
Levi Neely b7f6b08e6a task: session plan checklist; replace todo.sh fallback
- tools/task_add, task_check, task_clear: manage s/{sid}/plan markdown checklist
- prompts/tools-task.md: agent command reference, injected at spawn via prime tools-task
- agents: add 'prime tools-task' to agentSpawn in all configs
- scripts/x/task: show_plan() on 'task list'; drop todo.sh fallback (wrong tool)
- prompts/tools-todosh.md: removed (no longer needed)
- prompts/tools-subagent.md: add coordination model documentation
- core: update submodule ref (s/{sid}/plan 9p endpoint)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 12:30:14 +02:00
Levi Neely 1a01002f7b planning: observe step, task dispatcher, tool parallel annotations, graceful degradation
- agents: agentSpawn uses 'task prime', postTurn uses 'task list' (observe step)
- scripts/x/task: dispatcher routes to bd (beads) or todo.sh based on availability
- prompts/tools-todosh.md: prime context for todo.sh fallback
- tools: add '# ollie:parallel read' annotation to file_read, file_glob, file_grep,
  file_grep, memory_recall, reasoning_think, denote_view
- core: update submodule ref

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 09:00:54 +02:00
Levi Neely 2f8d18dc51 elevate: auto-start adapter via agentSpawn hook
Add x/elevate-adapter-start: checks if the adapter is already listening
(connect test), starts it in the background if not. Exits 0 always so it
never blocks session startup. Wire it into agentSpawn in all agent configs
and install it via mkfile.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 11:54:29 +02:00
Levi Neely 778af112db fix: strip script dir from sys.path before imports in x/ Python scripts
Python adds the script directory to sys.path[0] at startup and tries to
create a FileFinder for it. When the script lives on a 9P FUSE mount the
FileFinder init fails before any stdlib import can succeed. sys is a
builtin and loads without filesystem access, so strip the path first.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 11:49:03 +02:00
Levi Neely 16d4fc57ff elevate: default socket to XDG_RUNTIME_DIR, add to sandbox env
Both x/elevate and elevate-adapter-superpowerd now default the socket
path to $XDG_RUNTIME_DIR/ollie/elevate.sock (falling back to
/run/user/<uid>/ollie/elevate.sock) when OLLIE_ELEVATE_SOCKET is unset.
Add OLLIE_ELEVATE_SOCKET to env sections of both sandbox configs.
Add {XDG_RUNTIME_DIR}/ollie to restricted sandbox filesystem rw rules
so x/elevate can reach the socket. Update README env block and
scripts/README socket path docs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 11:43:24 +02:00
Levi Neely 7a88fb3437 implement generic x/elevate with socket broker pattern
x/elevate is now a generic client: reads OLLIE_ELEVATE_SOCKET, sends
{cmd,cwd}, reads back {stdout,stderr,exit_code}. All backend-specific
logic moves to adapters. Add elevate-adapter-superpowerd as the
reference adapter: owns the socket lifecycle, translates the ollie
protocol to superpowerd JSON-RPC ExecuteCommand. Add OLLIE_ELEVATE_SOCKET
to env docs. Update scripts/README.md with protocol spec, adapter
setup, and guide for writing custom adapters.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 11:41:54 +02:00
Levi Neely 1de43c1105 docs: reframe x/elevate as sandbox escape hatch, not privilege escalation
The purpose is to run steps outside the Landlock sandbox, not to gain
privileges. Clarify the constraint (kernel-enforced, must reach an
external process), reframe the minimal example and superpowerd walkthrough
accordingly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 11:33:22 +02:00
Levi Neely 2eefe5a01d docs: correct custom elevation backend section
sudo/doas don't work: Landlock is kernel-level and applies regardless
of user privileges within the sandboxed process. The backend must hand
the command to a process spawned outside landrun entirely. The
superpowerd Unix socket pattern is the right model.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 11:32:09 +02:00
Levi Neely 8700373c63 docs: remove incorrect session token injection paragraph
x/elevate handles token acquisition itself via the re-exec through
superpowers run-session when SUPERPOWERD_SESSION_TOKEN is absent.
No manual injection is needed; the paragraph was wrong.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 11:30:13 +02:00
Levi Neely 0eaa4dc8eb docs: remove broken superpowerd link, treat as hypothetical
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 11:26:37 +02:00
Levi Neely 61491ce786 docs: expand x/elevate with full backend setup guide
Document the plugin interface contract (args, cwd, stdout/exit code),
plugin path resolution (OLLIE_PLUGINS_PATH / ~/.config/ollie/scripts/x/),
a minimal exec-only example, a step-by-step walkthrough of the default
superpowerd implementation including session token injection, and custom
backend examples (sudo, doas, disable).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 11:23:47 +02:00
Levi Neely df651908c4 docs: document x/ namespace and x/elevate in scripts/README.md
Add x/ to the namespace list and add an x/elevate section describing
its role as the elevation plugin for execute_code elevated steps, the
calling convention, the default superpowerd implementation, and how to
replace or disable it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 11:22:29 +02:00
Levi Neely 2148c8c668 update docs: unify b/ into s/, introduce s/bfg and s/bbg
Batch and session namespaces are now a single s/ concept. s/bfg blocks
until the agent finishes and writes to stdout; s/bbg returns immediately
and prints the session path. s/b is the core one-shot runner. Remove all
b/ references from README, USAGE, ARCHITECTURE, and scripts/README.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 08:31:15 +02:00
Levi Neely dfabeab4a8 sh: fix is_idle for multi-word state values 2026-04-24 15:39:42 +02:00
Levi Neely a232925745 sh: multi-line input with C-j/C-m via readmulti 2026-04-24 15:38:38 +02:00
Levi Neely 963210ea6e scripts/s/sh: replace line with awk; remove sh.rc 2026-04-24 15:29:42 +02:00
Levi Neely e4b78b705a s/cleanup: kill idle sessions instead of removing done batch jobs
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 09:18:31 +02:00
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