Commit Graph

465 Commits

Author SHA1 Message Date
Levi Neely d76ccf4979 mcptools: convert all positional args to named flags
Every argument in every mcptools script is now a named flag (--mount,
--id, --agent-id, --session-id, --cwd, --child, --repo, --ticket, etc.).
No positional arguments remain. SKILL.md files updated to match.

Also updates cmd/Assist/main.go to pass --cwd flag to mount_beads.sh.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 13:41:25 +01:00
Levi Neely 9ebf90f564 mcptools: convert optional positional args to named flags
spawn_agent.sh: --cwd, --prompt
mail_history.sh: --date
mail_search.sh: --pattern, --date
claim_bead.sh: --assignee
mark_pending_approval.sh: --assignee
mark_pending_review.sh: --assignee
fail_bead.sh: --reason
comment_bead.sh: --text

Update beads, anvillm-sessions, anvillm-communication SKILL.md to match.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 13:24:03 +01:00
Levi Neely 014831e500 beads: flag-based args for create_bead.sh and update_bead.sh
Replace positional optional args with named flags to eliminate
argument conflation bugs. Update SKILL.md to document new flags
and new atomic operation scripts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 13:20:51 +01:00
Levi Neely 5313116276 update_bead: drop field validation from script, let 9p own it
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 13:17:07 +01:00
Levi Neely 5436a4223d beads: restore update_bead.sh; block atomic fields from direct update
The update ctl command now rejects fields managed by atomic operations
(status, assignee, closed_at, close_reason, defer_until) with a hint
pointing to the correct command. update_bead.sh is restored with valid
fields documented in the header.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 13:16:36 +01:00
Levi Neely e55742d691 beads: add atomic ctl operations; replace update_bead.sh
Add to 9p ctl handler: open, defer [until <RFC3339>], reopen, relate,
unrelate, config. Add corresponding mcptools scripts. Remove
update_bead.sh in favour of atomic operation scripts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 13:14:39 +01:00
Levi Neely 5dbd4cf777 beads: default new bead status to deferred
New beads created via the 9p interface now start as deferred instead
of open. Planning/human review is required to promote a bead to open
before the scheduler can assign it to a worker.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 13:07:59 +01:00
Levi Neely b2e710444e mcptools: add view_denote.sh
Look up and display a denote document by identifier. Accepts both
bare identifiers and denote:{identifier} format. Searches ~/doc
recursively.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 00:39:18 +01:00
Levi Neely 021b1b8221 mount_beads: drop friendly name, UUID is the mount name
Simplify: the optional friendly name parameter is removed. UUID first
segment is always the mount name; mtab provides the path mapping.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 00:24:20 +01:00
Levi Neely 8e5248cbef mcptools: add success output to silent mutation scripts
All bead mutation scripts now echo a descriptive confirmation after
a successful 9p write. set -euo pipefail ensures the echo only runs
if the write succeeded.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 00:18:38 +01:00
Levi Neely 6cd4c450b1 Assist: read mount_beads.sh via 9p client instead of shelling out
Use readFile() to fetch the script over the existing 9p connection,
then pipe it to bash -s. Removes dependency on the 9p CLI binary.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 00:09:16 +01:00
Levi Neely a0b0ef056b sandbox: allow anvillm mail dir; remove scripts/mail_history.sh
Add ~/.local/share/anvillm to sandbox write allowlist so agents can
archive mail. Remove scripts/mail_history.sh (superseded by
mcptools/mail_history.sh).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 00:08:01 +01:00
Levi Neely bede87b619 Assist: delegate mountProject to mount_beads.sh mcptool
Replace direct beads/ctl write with mount_beads.sh subprocess call.
UUID-based mount names are now generated by the script; the returned
name is captured and used as windowMount. Optional friendly name is
passed through for display only.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 00:07:15 +01:00
Levi Neely ba8e6d2edf mcptools: mount_beads.sh uses UUID first segment as default mount name
Avoids ambiguity with directory-based names (e.g. "main" is not unique
across projects). First segment of uuidgen (8 hex chars, 32-bit entropy)
is sufficient for personal dev environments. Optional friendly name
printed alongside UUID for human reference.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 23:47:02 +01:00
Levi Neely 82f9469a5f mcptools: add mail_history.sh and mail_search.sh
mail_history.sh: renamed from search_mail.sh; displays message history
for an agent by date. Name reflects actual behavior — search is the
caller's job.

mail_search.sh: thin wrapper around mail_history.sh + grep -E for
regex search over formatted history output.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 23:29:11 +01:00
Levi Neely 179a59bf16 p9: buffer Twrite chunks, dispatch on Tclunk
The 9P client splits writes larger than msize into multiple Twrite
messages with increasing offsets. The server was dispatching each
Twrite immediately, so only the first chunk was ever processed —
causing JSON parse failures for payloads exceeding msize.

Fix: accumulate all Twrite data into a per-fid writeBuf, then dispatch
the fully-assembled payload in Tclunk. Tclunk can return Rerror if
dispatch fails, preserving error reporting to the caller.

This unblocks large bead descriptions/comments and message bodies
without any msize negotiation changes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 23:17:57 +01:00
Levi Neely f3c23bc61e Remove AGENT_ID references from communication skill 2026-03-13 14:26:31 +01:00
Levi Neely 859a9961a7 remove jira-to-beads skill (work-specific) 2026-03-13 11:48:19 +01:00
Levi Neely caeb6481f8 mcptools: source agent ID from $AGENT_ID env; conductor cleanup
- read_inbox.sh, send_message.sh: remove explicit <agent_id>/<from>
  params; source from $AGENT_ID env var instead
- skills/anvillm-communication/SKILL.md: update signatures to match
- roles/conductor.md: remove verbose capability table, minor wording fixes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 07:54:59 +01:00
Levi Neely e2f3bc7b12 fileaddr; smart delegation 2026-03-12 18:44:40 +01:00
Levi Neely 4dbabd197d msgtrace panning 2026-03-12 17:22:13 +01:00
Levi Neely 11f54d9d0b fileaddr 2026-03-12 13:18:45 +01:00
Levi Neely b4abe0b6d7 anvilspawn convenience: $PWD default workdir 2026-03-12 12:21:00 +01:00
Levi Neely 2a1d620a31 rename 9P endpoint from 'agent' to 'anvillm'
- Update socket path, MountService calls, path prefixes
- Update mcptools, scripts, docs, diagrams, services
- Fix idleSince initialization at session creation
2026-03-12 12:13:40 +01:00
Levi Neely 46da046fb3 tmux: remove FIFO plumbing, fix per-window metadata
- Remove dead streaming code: reader(), waitForReady(), StartupHandler, pipe-pane
- Switch recovery metadata from session-scoped set-environment to window-scoped set-option -w @key
- Sessions now start in idle state immediately (no startup wait)
2026-03-12 11:47:37 +01:00
Levi Neely d0e459b818 skill discovery stuff 2026-03-11 18:11:31 +01:00
Levi Neely 9ae05a42f8 Add inbox_refresh.py and update msgtrace.py with alias/role display
- inbox_refresh.py: watches agent/events for UserRecv, refreshes /AnviLLM/inbox acme window
- msgtrace.py: display agent alias (when set) instead of ID, show role parenthetically
2026-03-11 15:39:40 +01:00
Levi Neely 329bc8a8e5 Add code_explorer skill for token-efficient code search
- Preview-then-fetch workflow reduces token usage
- Indexes files with ctags for symbol search
- Integrates with SKILLS_PROMPT.md context injection
2026-03-11 11:30:58 +01:00
Levi Neely 494894b406 beads skill: clarify search fields 2026-03-11 09:52:57 +01:00
Levi Neely 4c3f3b69a2 beads: add search_beads.sh, update skill docs 2026-03-11 09:52:11 +01:00
Levi Neely 39b49e83ce beads: reduce context overflow, simplify filters, atomic blockers
- list_beads.sh/list_ready_beads.sh: filter to id,priority,title,status
- Add read_bead_comments.sh tool and Comments view in Assist
- Simplify Assist filters to All/Ready (was 6 status filters)
- Server-side filtering: list excludes closed at DB, ready uses GetReadyWork
- Default limit 100, DB-level filtering
- Atomic blockers= support in new command
2026-03-11 09:45:20 +01:00
Levi Neely 3896b3db43 Assist: add Comments view for beads; add read_bead_comments.sh tool 2026-03-11 09:07:05 +01:00
Levi Neely e563330226 mcptools: filter bead list output to reduce context usage 2026-03-11 09:03:46 +01:00
Levi Neely b579c8bde2 skills: add CWD- and activity-based proactive skill discovery
Extend proactive discovery with two new passes before the existing
intent-based pass:
1. CWD-based: extract project keywords from basename(PWD) and run
   discover_skill on each segment (e.g., pcloudcc-lneely → pcloudcc)
2. Activity-based: infer task type (testing, debugging, docs, etc.)
   and map to discovery keywords

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-08 09:06:58 +01:00
Levi Neely 6d33528fd7 pcloudcc-testing: add superpowerd sandbox escape, enforce -d flag
Use execute_elevated_bash (superpowerd) to start/stop the pcloudcc
daemon outside the sandbox instead of asking the user. Add explicit
rule to always use -d when starting the daemon.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-08 09:04:38 +01:00
Levi Neely 824ab88fe3 anvilmcp: handle args passed as JSON-encoded string; fix team-templates install path
- Parse args as JSON string fallback when LLM passes args incorrectly
- Update SKILLS_PROMPT and agent docs to use unquoted args syntax
- Install team-templates under $INSTALL_PATH/Teams instead of hardcoded $HOME/bin/Teams

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 17:40:35 +01:00
Levi Neely 919335a271 conductor: adaptive delegation based on available staff
- roles/conductor.md: discover roster before planning; adapt workflow
  to available roles (dev-only, dev+review, dev+review+test, etc.);
  drive iterative cycles; parallelize across multiple same-role bots;
  report skipped phases instead of blocking on missing roles

- team-templates/debug: new workflow with conductor+developer+tester;
  blocks until all roles are idle before returning

- list format: replace model field with role (field 5) in agent/list;
  update Assist, anvillm, anvilwebgw, list_sessions.sh accordingly

- Assist /AnviLLM/: replace Model column with Role in session list
2026-03-07 17:24:40 +01:00
Levi Neely 715a1f7432 team-templates: add workflow team scripts using anvilspawn 2026-03-07 12:37:48 +01:00
Levi Neely ac937c6786 roles: add git strategy to conductor and devops 2026-03-07 12:33:47 +01:00
Levi Neely 10d25a371a session: reset initialPromptSent when context is set
If context is written after the first mail nudge has already fired,
initialPromptSent was already true and the context would never be
injected. Resetting it on SetContext ensures the context is always
prepended to the next prompt regardless of timing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 12:30:21 +01:00
Levi Neely e4ea258c6a session: remove wakeup channel, use ticker-only mail processing
The wakeup channel caused duplicate message delivery: inbox delivery
and idle state transitions both signaled an immediate wakeup with
bypassIdleCheck=true, prompting bots before they were ready.

Replace with a simple 5-second ticker. The idle threshold is always
applied, eliminating the race condition. Worst-case delivery latency
is 10 seconds (one tick to drain outboxes, next tick to prompt).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 22:38:21 +01:00
Levi Neely bf5ab44d76 roles: add conductor, refine all roles, document workflow design
- Add conductor role: human-activated, decomposes beads, coordinates
  bots directly via messaging, evaluates completeness before dispatching
- Add solo-developer role: full-cycle, no delegation required
- Standardize all roles: Responsibilities/Prohibited Activities/Workflow/
  Response Format; remove all explicit delegation protocols
- Remove inbox-check startup steps from all roles
- anvillm-communication: always reply to sender, not user, unless sender is user
- Add WORKFLOW_DESIGN.md: documents anvilspawn, claimable-by label design,
  Supervisor rewrite plan, and open questions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 21:19:18 +01:00
Levi Neely a73ef83d3d roles: replace bot-templates with anvilspawn and structured roles
- Remove bot-templates/ entirely
- Add scripts/anvilspawn: spawn a bot by role+workdir, hash-prefixed alias
  ties bots to the same workdir for organic collaboration
- Add roles: solo-developer, developer, reviewer, tester, devops, author,
  technical-editor, researcher, taskmgr
- Standardize all roles to: Responsibilities / Prohibited Activities /
  Workflow / Response Format
- Remove explicit delegation protocols from all roles; delegation is emergent
- Remove inbox-check startup steps; messages are delivered automatically
- Update mkfile to install anvilspawn

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 20:49:30 +01:00
Levi Neely 4a233801b2 gitignore: ignore compiled test binaries (*.test)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 19:43:20 +01:00
Levi Neely 7891d062ab p9: on role write, validate role exists and deliver to bot inbox
Instead of silently setting context on the session, writing to
agent/{id}/role now: validates the role exists in RolesFS (returning
"role not found" on failure), sets the role name on the session, and
delivers the role definition as a PROMPT_REQUEST from "user" to the
bot's inbox. The wakeup mechanism fires immediately via the onRecv
callback.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 19:39:21 +01:00
Levi Neely 29f7b45adc session: wake mail processor immediately on inbox delivery or idle transition
Add wakeupCh (buffered 1) to session.Manager. The mail processing loop
now selects on both the 5s ticker and the wakeup channel. Two events
signal the wakeup: a message delivered to any bot inbox (via onRecv
callback), and a session transitioning to idle with pending messages
(via OnStateChange). When woken, processMailboxes bypasses the
idleDuration threshold check. This covers all delivery paths including
direct DeliverToInbox calls from the supervisor.

Also flatten p9/roles to match p9/skills: remove focus-area directory
layer, expose roles as a flat <name>.md listing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 19:35:41 +01:00
Levi Neely 15bf980298 p9/skills: flatten to <name>.md, add load_skill.sh, fix discover_skill.sh
Replace intent-based hierarchy (skills/<intent>/<name>/) with flat
skills/<name>.md files serving SKILL.md content directly. Update
discover_skill.sh to search the flat layout. Add load_skill.sh mcp
tool. Update anvillm-communication SKILL.md to use pipe syntax.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 19:04:58 +01:00
Levi Neely 3e74c264e9 anvilmcp: add pipe mode for tool composition
Adds a third execution mode: pipe accepts an ordered array of stages
{tool?, args?, code?} and chains them as a Unix pipeline. Tool stages
are read from 9P (trusted); inline code stages are validated individually
before the pipeline is assembled, so the combined string always runs as
trusted regardless of mix. readTool moved from main.go to execute.go.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 18:47:42 +01:00
Levi Neely ebc162ac4f crash recovery: reset initialPromptSent and send inbox message
On crash restart:
- Reset initialPromptSent flag so context gets re-injected
- Send 'Continue working.' inbox message from user to session
- Add OnCrashRestart callback to Session struct
2026-03-06 17:27:50 +01:00
Levi Neely b913fcc644 Fix elevated bash execution 2026-03-06 17:02:57 +01:00