Commit Graph

294 Commits

Author SHA1 Message Date
Levi Neely c43ebc5b7e Add 'Leaving Context for Future Agents' section to beads SKILL.md
Prompts agents to comment on beads with decisions, dead ends, and
discoveries during execution, and to search past beads before starting
non-trivial work. Covers human-authored comments as equally authoritative
context. Implements bd-3r1.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 22:23:18 +01:00
Levi Neely 98a659e411 hotfix: mkfile 2026-02-23 22:03:12 +01:00
Levi Neely 96876ea6c8
Add output discipline enforcement (bd-nk8) (#13)
- OUTPUT_PROTOCOL.md: shared protocol injected at session start for all backends
- anvillm-hook: injects OUTPUT_PROTOCOL.md via Kiro agentSpawn
- claude/agent/anvillm-agent.md: Output Protocol section (Claude session-start equivalent)
- bot-templates: Output Protocol block in Conductor and Taskmaster contexts
- anvillm-communication skill: structured body schemas for all message types
- install-hooks.sh: also installs anvillm-agent.md to ~/.claude/agents/
- kiro-cli/README.md: install instructions for prompt files

Co-authored-by: Levi Neely <lkn@darkstar.example.net>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 21:48:58 +01:00
Levi Neely 065e4a3295
Add bulk-archive via inline Put notation to inbox and archive windows (#12)
* Add inline Put actions for sessions and tasks windows

Introduce a Put command to both the sessions list and tasks windows,
allowing inline edits via prefixed annotations in the body:

Sessions (cmd/Assist/main.go):
  - `- <id>`              Kill session
  - `~ <id>`              Stop session (graceful)
  - `@ <id> <alias>`      Set alias on session
  - `+ <backend> <path> [alias]`  Start new session

Tasks (cmd/Assist/main.go + internal/p9/beads.go):
  - `- [idx]`   Delete bead
  - `~ [idx]`   Claim bead as user
  - `^ [idx]`   Unclaim bead (clear assignee, reset to open)
  - `x [idx]`   Complete bead
  - `f [idx]`   Fail bead
  - `+ <title>` Create new bead with title pre-filled

Also adds `unclaim` ctl command to BeadsFS and helper functions:
claimBeadAsUser, unclaimBead, completeBead, failBead,
openNewBeadWindowWithTitle.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Add [Failed] [PendingReview] [PendingApproval] filters to tasks window

Extends the tasks window filter bar with three new status filters:

- [Failed]          closed beads whose close_reason != "completed"
- [PendingReview]   beads with status "pending_review"
- [PendingApproval] beads with status "pending_approval"

Implementation details:
- Add CloseReason field (json:"close_reason") to Bead struct so
  fail-vs-complete distinction is available after JSON decode.
- listBeadsWithFilter: add "failed" special case (closed beads with
  non-"completed" close_reason); "pending_review" and
  "pending_approval" fall through the existing status equality path.
- handleTasksWindow: wire Failed/PendingReview/PendingApproval cases
  to set statusFilter and refresh the list.
- refreshTasksWindowWithBeads: update filter bar header line.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Add bulk-archive via inline Put notation to inbox and archive windows

In the inbox window, lines prefixed with "- <shortID>" are parsed on Put
and each matching message is archived (moved to completed). In the archive
window the same notation permanently deletes the message from the archive.

Adds: parseMailEdits, mailEdit type, deleteArchivedMessage in Assist;
DeleteFromCompleted in mailbox.Manager; "delete <msg-id>" command on
user/ctl in the p9 server.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Levi Neely <lkn@darkstar.example.net>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 19:58:37 +01:00
Levi Neely 5bba76d2b9 hotfixes, msg trace diagram generator 2026-02-23 12:20:46 +01:00
Levi Neely 50ae1d0dad Add approval gates: beads schema, Conductor, notification daemon, init scripts
Implements bd-i4h (Approval Gates / Human in the Loop):

beads schema (bd-i4h.4):
- Add StatusPendingApproval/StatusPendingReview local status constants
- Add pending-approval, pending-review, resume ctl commands
- Add agent/beads/pending read endpoint
- Document requires-approval/requires-review label conventions
- Update BEADS.md with full Approval Gates section

Conductor bot (bd-i4h.2):
- Read context prompt from stdin when not a terminal (custom prompt support)
- Extend default prompt with approval gate workflow instructions

Human notification daemon (bd-i4h.1):
- Add scripts/anvillm-inbox-notify: streams agent/events, fires notify-send
  for configurable message types (default: APPROVAL_REQUEST, REVIEW_REQUEST)
- Add services/inbox-notify-runit/: runit service
- Add services/systemd/anvillm-inbox-notify.service: systemd user service
- Add services/sysvinit/anvillm-inbox-notify: SysV LSB init script
- Add services/sysvinit/rc.anvillm-inbox-notify: Slackware rc script

anvilsrv init scripts:
- Add services/sysvinit/anvilsrv: SysV LSB init script
- Add services/sysvinit/rc.anvilsrv: Slackware rc script

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 18:47:23 +01:00
Levi Neely 45e495a975
Add requires_approval and requires_review flags to bead UI across all frontends (#10)
Implements bd-258: display and toggle of requires_approval / requires_review
boolean flags in all four AnviLLM frontends. Flags are backed by labels
(requires_approval, requires_review) on each bead, read from the labels
array in bead JSON and toggled via label/unlabel ctl commands.

- Acme: adds Labels/HasLabel to Bead struct; shows flags in frontmatter;
  updateBead parses and applies label/unlabel on Put
- TUI: showBead displays flags (green when set); edit dialog adds two
  checkboxes that toggle labels on save
- Web: detail view shows flag status with Set/Unset buttons; new
  toggleBeadFlag() function calls beads ctl API and refreshes
- Emacs: detail buffer shows flag lines; A/R keybindings invoke new
  anvillm-bead-toggle-approval and anvillm-bead-toggle-review commands

Co-authored-by: Levi Neely <lkn@darkstar.example.net>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 18:13:12 +01:00
Levi Neely bb721c0429
Fix child relationship handling (#8)
* Fix child relationship handling

* Fix: Remove automatic dependency creation in createSubtask()

Parent-child relationships are hierarchical via ID structure only.
The server was incorrectly creating blocking dependencies between
parent and child beads, causing children to block parents.

---------

Co-authored-by: Levi Neely <lkn@darkstar.example.net>
2026-02-22 16:22:17 +01:00
Levi Neely db501cca26
Add approval/rejection flags and actions to tasks UI (#9)
* Add approval/rejection flags and actions to tasks UI

Adds visual flags for APPROVAL_REQUEST and REVIEW_REQUEST messages across
all UI frontends (Acme, TUI, web, Emacs), with one-click approve/reject
actions and inferred reply type mapping.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Auto-archive messages on approve or reject across all UIs

After an approval or rejection response is sent, the original inbox
message is now automatically completed/archived in all four frontends:

- Acme: handleReplyWindow gains an originalMsgID param; approve/reject
  windows pass the message ID so the original is archived on Send
- TUI: already archived via completeInboxMessage in approveMessage /
  rejectMessage — no change needed
- Web: approveCurrentMessage archives after reply succeeds; rejectCurrent-
  Message sets pendingArchiveId so the reply-form submit handler archives
  on send
- Emacs: anvillm-inbox-approve and anvillm-inbox-reject write "complete
  <id>" to user/ctl and refresh the inbox after sending the response

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Levi Neely <lkn@darkstar.example.net>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 15:38:23 +01:00
Levi Neely 4c4b906acd Add anvilmcp connection to Backends in architecture diagram 2026-02-22 12:52:46 +01:00
Levi Neely 3ef9cc54c0 Fix architecture diagram: Web connects to anvilwebgw via HTTP 2026-02-22 12:49:32 +01:00
Levi Neely 36c773bf45
Merge pull request #6 from lneely/bug-anvilweb-sessions-null
fix: handle null sessions case in anvilwebgw
2026-02-22 12:28:04 +01:00
Levi Neely 1b38cbb030
Merge pull request #7 from lneely/update-docs
Tech edit README: improve clarity, concision, and flow
2026-02-22 12:27:48 +01:00
Levi Neely 8fccaa8977 Make autonomous workflow diagram full-width 2026-02-22 12:25:21 +01:00
Levi Neely 36e5de7e3c Replace autonomous workflow with sequence diagram
- Shows full workflow: User → Taskmaster → Beads → Conductor → Bots
- Illustrates dependency management and completion notification
- Increased width to 600px for better readability
- Updated cache-busting to v=3
2026-02-22 12:24:01 +01:00
Levi Neely c5c07a3840 Increase automation workflow diagram to 300px 2026-02-22 12:20:28 +01:00
Levi Neely af83bc26df Rename to Autonomous Workflows and reduce diagram to 250px 2026-02-22 12:19:46 +01:00
Levi Neely b99954c214 Center all images and reduce sandbox config to 250px
- All diagrams now centered with <p align="center">
- Sandbox config reduced from 400px to 250px
2026-02-22 12:18:29 +01:00
Levi Neely 52be2d56c4 Remove leftover ASCII diagram after crash recovery SVG 2026-02-22 12:16:56 +01:00
Levi Neely b0bfc2d777 Scale down smaller diagrams
- sandbox-config: 400px
- session-lifecycle: 500px
- crash-recovery: 500px
- client-interactions: 400px
- events: 400px
- Keeps larger diagrams (architecture, mailbox, automation) at full width
2026-02-22 12:15:38 +01:00
Levi Neely cf83b07b04 Add cache-busting to SVG URLs and use default theme
- Add ?v=2 query parameter to all SVG URLs to bypass GitHub cache
- Regenerate with default theme as requested
2026-02-22 12:13:54 +01:00
Levi Neely 4bb5c4e743 Use forest theme for darker arrows
- Arrows now use #000000 (black) instead of #333333
- Much better visibility on all backgrounds
2026-02-22 12:12:13 +01:00
Levi Neely e3b3c111cd Use default theme for better contrast
- Regenerate SVGs with default theme
- Provides darker arrows and better visibility
2026-02-22 12:11:18 +01:00
Levi Neely b78f798db8 Use neutral theme for diagrams
- Regenerate all SVGs with neutral theme instead of dark
- Improves visibility on both light and dark backgrounds
- Better contrast for arrows and boxes
2026-02-22 12:09:32 +01:00
Levi Neely 41acc805d1 Replace ASCII diagrams with SVG images
- Create Mermaid source files for all diagrams
- Generate SVGs using mermaid-cli
- Replace all ASCII art with embedded SVG images
- Diagrams: architecture, sandbox-config, session-lifecycle, crash-recovery, client-interactions, mailbox-flow, automation-workflow, events
- Fixes alignment issues with ASCII box drawing characters
2026-02-22 12:08:12 +01:00
Levi Neely d3267d8771 Add visual diagrams throughout documentation
- Architecture: clients → core services → backends (with ollie → Ollama)
- Sandbox config: layered YAML override hierarchy
- Mailbox flow: user ↔ agent A ↔ agent B cross-backend messaging
- Automation workflow: Taskmaster → beads → Conductor → parallel agents
- 9P filesystem: client interaction patterns
- Session lifecycle: idle ↔ running cycle via CLI hooks
- Crash recovery: state preservation and auto-resume
- Events: multiple consumers reading event stream
- Add 9fans.net/go reference
- Add github.com/simonfxr/pubsub reference for event bus
2026-02-22 11:56:20 +01:00
Levi Neely ee6f50f50c Tech edit README: improve clarity, concision, and flow
- Streamline opening sections (tagline, architecture, 9P rationale)
- Add anvilwebgw to core components
- Replace Workflows section with Bot Templates
- Remove obsolete bot templates (keep only Taskmaster and Conductor)
- Consolidate sandboxing documentation
- Improve formatting and readability throughout
- Correct MCP description (discover agents vs control sessions)
2026-02-22 11:28:37 +01:00
Levi Neely e1489a39fb fix: handle null sessions case in anvilwebgw
Initialize sessions slice as empty array instead of nil to ensure
JSON encoding returns [] instead of null when no sessions exist.
This prevents JavaScript iteration errors in the web frontend.
2026-02-22 11:14:57 +01:00
Levi Neely f72ba507e6
Merge pull request #5 from lneely/conductor
Add automation documentation
2026-02-22 10:58:32 +01:00
Levi Neely f8083a84c0 Add automation documentation
- Add Automating Development section to README
- Create EVENTS.md documenting event stream system
- Document Taskmaster and Conductor workflow
2026-02-22 10:57:37 +01:00
Levi Neely 90143bf6bd
Merge pull request #4 from lneely/conductor
Add bot templates and orchestration system
2026-02-22 10:47:29 +01:00
Levi Neely 8dae78f161 Merge remote-tracking branch 'origin/main' into conductor 2026-02-22 10:46:48 +01:00
Levi Neely 8ecbbbd678 Add bot templates and orchestration system
- Add bot-templates/ directory with specialized agent templates
- Update README.md with orchestration documentation
- Update mkfile with new build targets
- Remove old workflow files (DevReview, DevReviewQA, Docs, Planning, Research, Taskmaster)
2026-02-22 10:45:03 +01:00
Levi Neely e9c78b11e0
Merge pull request #1 from lneely/anvilwebgw
Add anvilwebgw HTTP gateway service
2026-02-22 09:42:50 +01:00
Levi Neely 49dee87384
Merge pull request #2 from lneely/better-subjects
Make bot prompt send_message instruction dynamic and compact
2026-02-22 09:42:18 +01:00
Levi Neely 2602295030
Merge pull request #3 from lneely/better-events
Replace event queue with streaming pub-sub event bus
2026-02-22 09:41:33 +01:00
Levi Neely 407b3732af Replace event queue with in-memory pub-sub event bus
Replaces the TTL-based event queue (internal/events) with a proper
in-memory pub-sub bus (internal/eventbus) backed by simonfxr/pubsub.

The agent/events 9P endpoint is now a streaming subscriber: clients
block on reads and receive one JSON-encoded event per read until they
disconnect. Each open(2) creates a per-connection subscription; clunk
and connection teardown cancel it automatically.

- internal/eventbus/bus.go: new package wrapping simonfxr/pubsub;
  provides Publish(agent, type, data) and Subscribe() -> (chan, cancel)
- internal/events/events.go: deleted
- internal/session/manager.go: SetEventQueue -> SetEventBus; all
  publish sites updated to use eventbus constants
- internal/p9/server.go: fid gains eventCh/eventUnsub fields; Topen
  subscribes, Tread blocks on channel, Tclunk/serve-defer cancel
- cmd/anvilsrv/main.go: wired to SetEventBus

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 09:38:14 +01:00
Levi Neely c415c502b3 Replace deprecated message type references in prompts
- workflows/DevReview: LOG_INFO → PROMPT_RESPONSE (x2)
- claude/agent/anvillm-agent.md: update example types list to use
  current types (QUESTION/STATUS_UPDATE → PROMPT_REQUEST/QUERY_REQUEST)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 09:17:24 +01:00
Levi Neely 27610dd878 Remove all deprecated message types
Drop PROMPT, QUESTION, ANSWER, STATUS_UPDATE, and ERROR_REPORT
constants and their handling in ValidateMessageType.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 09:16:38 +01:00
Levi Neely e8f1f4f9be Remove LOG_* message types entirely
LOG_ERROR and LOG_INFO are no longer supported. Remove the constants,
drop them from ValidateMessageType, update ERROR_REPORT deprecation
notice to point to PROMPT_RESPONSE, and remove LOG_ERROR from the
skill docs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 09:16:01 +01:00
Levi Neely 2d31b40037 Stop auto-archiving PROMPT_RESPONSE messages
Remove the inbox processing loop that auto-completed PROMPT_RESPONSE
messages, so they now stay in the user's inbox like all other types.
Update message.go grouping and SKILL.md docs accordingly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 09:15:10 +01:00
Levi Neely 060dbef65a Make bot prompt send_message instruction dynamic and compact
Replace hardcoded PROMPT_RESPONSE/subject/to values with dynamic
placeholders so bots derive the correct response type, recipient,
and subject from message context. Also restructure prompt assembly
order so the task instruction appears before the send_message
instruction (context → prompt → outInstruction).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 09:12:13 +01:00
Levi Neely bc099a2c21 Add /anvilwebgw to .gitignore
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 09:02:31 +01:00
Levi Neely a28cf13cae Add anvilwebgw HTTP gateway service, simplify anvilweb
- New cmd/anvilwebgw: standalone HTTP gateway daemon with start/stop/fgstart/status
  subcommands, exposing all 9P-connected API endpoints on :8081
- cmd/anvilweb simplified to a plain static file server that reverse-proxies
  /api/* to anvilwebgw; removes all 9P connectivity
- Frontend error handling overhauled: replace alert() with styled dismissible
  error banner and inline container errors showing actual server response detail
- Fix CSS specificity bug that kept error banner always visible
- Fix nil slice JSON encoding (null vs []) for empty inbox/archive responses
- mkfile: add anvilwebgw build and clean targets

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 09:01:23 +01:00
Levi Neely 4b80a279f8 minor fix 2026-02-21 21:05:18 +01:00
Levi Neely 9d0e9b7e42 Add ollama backend support
- Add ollama backend implementation using mcphost and ollie
- Add ollama.yaml sandbox configuration
- Update README with ollama installation and usage instructions
- Add ollama command to Assist, anvilmcp, and anvilsrv
- Add ANVILLM_OLLAMA_MODEL environment variable
- Hardcode ollama-mcp.json config path to ~/.config/anvillm/ollama-mcp.json
2026-02-21 21:03:55 +01:00
Levi Neely 0dd616fe66 Add bead management features to Emacs interface
- Add subtask creation with 's' keybinding in tasks view
- Swap 't' and 'T' keybindings in main view (t=tasks, T=stop)
- Add Return key to view bead details in tasks view
- Add 'w' keybinding to assign beads to agents (both views)
- Add tab completion for bead IDs and agent IDs
2026-02-21 14:30:35 +01:00
Levi Neely 5a212793c3 ui parity 2026-02-21 13:57:05 +01:00
Levi Neely dd6528bfee fix 2026-02-21 10:35:45 +01:00
Levi Neely 4257e6595d fix 2026-02-21 10:33:06 +01:00