Commit Graph

44 Commits

Author SHA1 Message Date
Levi Neely 2bbaecb531 JIT subagent generation via subagent_generate | xargs subagent_spawn
- rename agent_generate to subagent_generate
- subagent_generate reads JSON from stdin, copies default.json as base,
  replaces prompt with SYSTEM_PROMPT + identity text
- update tools-subagent.md to enforce composition pattern
- remove unused agent configs and prompts (devops, qa, reviewer,
  sysarchitect, writer)
- update agents/README.md
- update core submodule (remove stale-read pruning)
2026-05-02 13:50:52 +02:00
Levi Neely af6547eb3a subagent_spawn: use /bin/date to avoid plan9 date 2026-05-02 10:50:14 +02:00
Levi Neely bee78e308c tools: add agent_generate for JIT agent creation
New tool that generates a temporary agent config from a base agent
with custom identity text. Returns a unique agent name (jit-<hex>)
for use with subagent_spawn. Single file in a/, no p/ file needed.
2026-05-02 10:29:06 +02:00
Levi Neely 29ea11be22 lsp tool 2026-04-30 14:39:13 +02:00
Levi Neely 3fec18b780 tools: add LSP bridge and tool scripts
Adds a thin LSP bridge daemon (tools/_lib/lsp/) that manages LSP server
processes on demand, with adapters for gopls, clangd, and intelephense.

Tool scripts:
- lsp_definition: go to definition
- lsp_references: find all references
- lsp_hover: type/doc info
- lsp_rename: rename symbol (applies edits directly)
- lsp_symbols: document/workspace symbols
- lsp_diagnostics: errors and warnings
2026-04-30 11:12:31 +02:00
Levi Neely 03f661c0a6 subagent_spawn: use __ separator for parent prefix 2026-04-29 18:21:52 +02:00
Levi Neely 993097ef6f subagent: fire-and-forget spawn, auto-inject parent/session IDs, env file
subagent_spawn rewritten: creates session, submits prompt, returns
immediately. Auto-prefixes session name with parent ID for uniqueness.
Injects [parent_session_id] and [session_id] headers into every prompt.

New read-only env file in session namespace exposes OLLIE_ vars.
TUI background-tails chat file for async output.
Updated SYSTEM_PROMPT.md and tools-subagent.md.
2026-04-26 22:19:06 +02:00
Levi Neely b33a411427 subagent: add -name flag, document roster convention
subagent_spawn now passes -name through to b, letting the parent assign
predictable session IDs. Updated coordination docs: parent passes full
peer roster in seeding prompts, names prefixed with parent session ID
for global uniqueness. Noted silent failure on duplicate names.
2026-04-26 20:34:27 +02:00
Levi Neely 2f9e392320 restore reasoning_think tool and prompt
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 19:07:13 +02:00
Levi Neely e4c76603ba remove reasoning_think tool and prompt
Backend now streams native thinking tokens via StreamEvent.Reasoning.
The no-op scratchpad tool is redundant.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 19:04:03 +02:00
Levi Neely d9e9ca1b52 file tools: simplify to read/edit/write without sentinel machinery
system prompt: require task list for multi-step work
agents: remove preTurn hook; rely on agentSpawn prime + system prompt
backend: require OLLIE_BACKEND/OLLIE_MODEL env vars

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 18:29:18 +02:00
Levi Neely b5a0765fc1 tools/agents: skip blank task_add args; remind task_check when plan has open tasks
preTurn now has two branches: no plan → remind task_add; open tasks → remind
task_check. Blank/whitespace-only arguments to task_add are silently skipped.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 13:26:03 +02:00
Levi Neely dcf7d4010f tools/prompts: fix task_add printf bug; point agents at t/idx for tool discovery
printf format string starting with '-' was treated as a flag; use '--' to
terminate option parsing. Agents reading individual tool scripts to understand
them should use $OLLIE/t/idx instead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 13:10:36 +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 7b8d665457 fix subagent_spawn, sort sessions, update prompts
- subagent_spawn: use s/bfg instead of deprecated b/q
- SYSTEM_PROMPT: fix stale /b/ reference to /s/
- core: sort session index by ID
- webui: gitignore .kiro/
2026-04-24 21:44:57 +02:00
Levi Neely f918955951 file_read: return (binary file) when null bytes detected 2026-04-23 11:35:12 +02:00
Levi Neely ec385d0d6e planning: remove plan_* tools and prompt entirely
The markdown planning mechanism created competing signals against beads.
Removing it eliminates the conflict. Planning goes through beads (bd)
or whatever external mechanism is appropriate.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 11:36:56 +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 dc5356b242 tools: walk up from CWD to find .beads for monorepo support
The .beads check now traverses parent directories so plan_* enforcement
works from any subdirectory of the repo, not just the root.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 11:14:36 +02:00
Levi Neely c7fb791434 tools: fix .beads check to use -d (directory, not file)
bd init creates .beads/ as a directory; -f was silently failing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 11:13:37 +02:00
Levi Neely 89f340eca9 tools: change OLLIE_BEADS_ENABLE default to 1 (opt-out instead of opt-in)
plan_* now blocks by default when bd and .beads are present.
Set OLLIE_BEADS_ENABLE=0 to use the markdown-based plan_* scripts instead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 11:11:26 +02:00
Levi Neely 4f3e04de13 tools: add .beads project file as third guard for plan_* enforcement
All three conditions must hold to block plan_* in favor of bd:
  OLLIE_BEADS_ENABLE=1, bd on PATH, and .beads exists in CWD.
This makes enforcement purely opt-in per project.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 10:47:22 +02:00
Levi Neely 663e7f305a tools: enforce beads for planning when OLLIE_BEADS_ENABLE=1 and bd is present
If both conditions hold, plan_* scripts exit 2 with an error directing
the model to use bd instead. When either condition is false (beads not
configured or bd not installed), the scripts run normally as a fallback.

Document OLLIE_BEADS_ENABLE in README and doc/help.md.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 10:43:32 +02:00
Levi Neely 0abcb6367c beads integration (wip); fix plan_create printf; bump core
- agents/test-bd.json: test agent with bd prime agentSpawn hook
- prompts/06_tool-plan.md: prefer beads when context injected at session start
- tools/plan_create: fix printf treating '- [ ]' format as option flag
- submodules: bump core

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 07:24:51 +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 c5d87567ce prompts: restructure system prompt; replace task tools with plan_* lifecycle
- Rename and reorder prompt files: skills bumped to 02, tool prompts
  prefixed tool-*, execute_code prompt removed (content absorbed into schema)
- Rewrite all tool prompts with explicit Trigger/Calling convention/Returns/Constraints structure
- Trim 03_reasoning.md to essentials; add "returns nothing" clarification
- Restructure task planning: replace task_plan/task_complete with explicit
  plan_create/plan_start/plan_check/plan_finish lifecycle tools
  - plan_finish enforces hard constraint: fails if any - [ ] tasks remain
- Remove no-shell-redirect rule from 00_base (consolidated into 03_tool-files)
- Add t/idx discovery and parallel schema advice to execute_code JSON schema
- Remove dead execute_pipe/execute_tool trustedTools references from agent configs
- Make keyword greps case-insensitive (-i flag)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 14:48:10 +02:00
Levi Neely c3d8879702 tools: rewrite subagent_spawn as thin wrapper around b/q -parallel
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 13:40:55 +02:00
Levi Neely 792ea4663f subagents: add subagent_spawn tool and system prompt fragment
tools/subagent_spawn: fork-join over b/; spawns N parallel subagents
with a shared prompt, polls status concurrently, joins results in
submission order.

prompts/08_subagents.md: core system prompt fragment — when to spawn,
flags, output format, design rules. Always in context, not a skill.
2026-04-16 20:14:57 +02:00
Levi Neely 510ddbd904 new tools 2026-04-15 15:52:02 +02:00
Levi Neely 8ca905799b fix: error handling, sandbox env, file tool enforcement
- tools/file_*: hard-fail when OLLIE_SESSION_ID is unset; surface errors
  on all failure paths including dir checks, marker cleanup, and I/O
- tools/file_read: treat nonexistent path as new file (emit "(new file)",
  write empty marker) so file_write can create new files
- tools/file_write: colorize new-file lines with + (U+FF0B)
- tools/file_glob, file_grep, memory_*, task_*: consistent error handling
  and output to stdout so the model sees all failures
- tui/diffcolor.go: match +/− (U+FF0B/U+2212) lookalikes emitted by
  file_edit/file_write; fix +++ / --- header pattern
- prompts: prohibit execute_code for file creation/modification;
  enforce execute_tool with file_write/file_edit instead
- core submodule: surface isError from MCP responses; inject
  OLLIE_SESSION_ID into execute server at session creation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 22:52:10 +02:00
Levi Neely 1b9c7af9c9 tools: clear usage messages on all tools when called with no/bad args
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 18:21:35 +02:00
Levi Neely 7999bd34a7 Revert "tools: fix file_edit and file_write to write directly, not via temp+rename"
This reverts commit ce1688efb8.
2026-04-14 18:14:16 +02:00
Levi Neely ce1688efb8 tools: fix file_edit and file_write to write directly, not via temp+rename
The temp file + os.replace() (rename) pattern fails on FUSE-mounted paths
(e.g. $OLLIE/sk/, $OLLIE/pl/) because the 9P server doesn't implement Twstat.
Write directly to file_path instead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 18:12:59 +02:00
Levi Neely de00ac1fcc rename OLLIE_9MOUNT → OLLIE throughout; update submodules
Tools, sandbox configs, docs, and skills all updated. $OLLIE is now
the canonical ollie root — cd $OLLIE goes directly to the FUSE mount.
Core now always injects $OLLIE into the execute env at session start.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 17:39:48 +02:00
Levi Neely 7d43a53e48 add memory_remember and memory_recall tools; fix sandbox for pyenv
memory_remember: saves a denote-formatted flat file to $OLLIE_9MOUNT/m
memory_recall: searches memories by keyword/tag/title via grep

Both write/read through the 9P FUSE mount. Removed os.makedirs calls
that failed with ERANGE on the 9P-backed /m directory.

sandbox/restricted.yaml: add {HOME}/.pyenv, .rbenv, .nvm to rox so
python3 and other version-managed interpreters can execute.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 17:29:35 +02:00
Levi Neely 542c5ab96d update submodules and tools: fix memory write path
- sandbox: ~/mnt/ollie added as RWX, OLLIE_9MOUNT passed through
- 9p server: create memory dir on startup
- tools: memory_remember/recall use $OLLIE_9MOUNT/m

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 16:11:57 +02:00
Levi Neely 53371da547 tools: add memory_remember and memory_recall
Flat-file denote-formatted memories in OLLIE_MEMORY_PATH.
memory_remember: YYYYMMddTHHmmss__{slug}--{tags}.md with required
denote frontmatter (title, date, tags, identifier, signature).
memory_recall: grep-backed search across filenames and bodies.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 15:41:43 +02:00
Levi Neely 4d9550e9cf tools: add file_* and reasoning_think scripts; rename task tools
Add shell script implementations of file_read, file_write, file_edit,
file_grep, file_glob, reasoning_think. Rename task_plan.sh/task_complete.py
to task_plan/task_complete (shebang detection makes extensions unnecessary).

Update submodules: core, 9p, skills.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 15:26:42 +02:00
Levi Neely 450a5ba7b9 tools: remove tools.sh — discovery now handled by prompt injection
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 13:02:27 +02:00
Levi Neely 995d72a776 tools: add tools.sh discovery script; update prompt for schema-less tools
tools.sh reads # description/# Args headers from all scripts and prints
a summary — one call replaces the schema injection built-in tools get
for free. Prompt now directs the model to run it before using unfamiliar
tools.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 10:58:03 +02:00
Levi Neely e4aaa25991 tools: add task_plan and task_complete as shell/python scripts
Replaces the removed built-in task server. Plans are written to
$OLLIE_9MOUNT/pl/ (persistent, shared across sessions). Scripts live
in the tools directory and are invoked via execute_tool.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 09:00:57 +02:00