Commit Graph

72 Commits

Author SHA1 Message Date
Levi Neely 55ebd64677 feat: add Daemon management UI and graceful degradation
Assist now continues working even if anvilsrv fails to start, and
provides a Daemon management window for server control.

Changes:
- Assist no longer fails fatally if anvilsrv won't start
- Logs ERROR and continues with disconnected state
- Add Daemon command to open /AnviLLM/Daemon window
- Daemon window shows server status with Start/Stop/Restart buttons
- Add isConnected() checks to all 9P operations
- Display friendly "not connected" message in main window
- Auto-reconnect when starting daemon from Daemon window

Daemon Window Features:
- Shows current daemon status (RUNNING/NOT RUNNING)
- Displays 9P socket path and existence
- Shows connection state
- Start button: runs `anvilsrv start` and reconnects
- Stop button: runs `anvilsrv stop` and disconnects
- Restart button: stops then starts
- Get button: refreshes status display

User Experience:
- Can still use Assist UI features (Sandbox, etc.) without daemon
- Session-related features show "not connected" errors
- Daemon command provides easy server management
- No more hard failures on startup

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-14 11:40:27 +01:00
Levi Neely 825d527b46 feat: restore Sandbox command to Assist UI
The Sandbox command was accidentally omitted during the architectural
split. This restores the UI convenience feature for managing sandbox
configuration.

Changes:
- Add Sandbox to main window tag and command handlers
- Port sandbox UI functions from old internal/ui/sandbox.go
- Open /AnviLLM/Sandbox window with Get/Edit/Reload/Status commands
- Edit opens config in Acme or $EDITOR
- Status shows landrun availability and version

README:
- Update Architecture section explaining daemon/client split
- Add Service Integration section (systemd/runit)
- Add anvilsrv commands (start/fgstart/stop/status)
- Update Commands table with Stop/Restart/Refresh/Sandbox
- Add path validation and security notes
- Expand troubleshooting section

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-14 11:36:50 +01:00
Levi Neely b7a823f120 feat: split monolith into anvilsrv daemon and Assist client
Major architectural refactoring to separate server and UI concerns:

Architecture Changes:
- Split into anvilsrv (server daemon) and Assist (Acme client)
- Removed UI coupling from server (OnAliasChange, WinID tracking)
- Server runs as background daemon, client reconnects as needed
- Client auto-starts server if not running

Server (anvilsrv):
- Add daemon management: start/stop/status commands
- Daemonize by default (fgstart for foreground/debug mode)
- Proper PID file handling in $NAMESPACE (not /tmp)
- Graceful shutdown with SIGTERM handling
- Duplicate start prevention with stale PID detection

Client (Assist):
- Auto-start anvilsrv if not running
- Fixed plan9 package imports (OWRITE/OREAD constants)
- Removed unused context import

Security Fixes:
- Move PID file from /tmp to $NAMESPACE (prevent symlink attacks)
- Add path validation in session creation:
  - Clean path traversal (/../../../etc → /etc)
  - Verify directory exists before creating session
  - Ensure absolute paths
  - Reject non-directory paths
- Add SECURITY.md documenting 9P socket risks

Service Integration:
- Add systemd service files (system, user, template)
- Add runit service files (run, finish)
- Add service documentation and installation instructions

Build & Testing:
- Both binaries build successfully
- All daemon operations verified (start/stop/status/daemonize)
- Path validation tested and working
- Auto-start functionality verified
- Add DevReviewQA workflow script

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-14 11:30:57 +01:00
Levi Neely c445b21206 fix: Stop now preserves tmux window by tracking backend PID
The Stop() method was destroying the tmux window because it killed the
bash shell (pane PID) instead of just the backend process. This commit
fixes the issue by:

1. Added FindBackendPID() to find the actual backend process (child of bash)
2. Modified session creation to store the backend PID, not the shell PID
3. Updated stopInternal() to kill only the backend process:
   - Send Ctrl+C (handles SIGINT)
   - Send second Ctrl+C if still alive (some CLIs need 2x)
   - Use SIGTERM/SIGKILL on backend PID if unresponsive
   - Never kill the bash shell, preserving the tmux window
4. Fixed Restart() to properly clean up and recreate FIFO

Tested successfully:
- Stop kills backend but preserves window ✓
- Session state transitions to "stopped" ✓
- Restart reuses same window and works ✓
- Can send prompts after restart ✓

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-14 10:28:06 +01:00
Levi Neely e25d1658dd feat: add Stop/Restart support and fix critical deadlock bug
Add Stop and Restart commands for session management, allowing graceful
termination and restart of backend processes. Add peer-bot skill for
agent-to-agent communication via 9P filesystem.

Critical fixes:
- Fix double-unlock deadlock in Stop() that would cause immediate panic
- Fix resource leak in Restart() where transitioning flag wasn't cleared on error paths
- Fix race conditions in reader() goroutine from multiple lock/unlock cycles
- Fix busy loop in reader() after EOF by using proper wait loop instead of polling FIFO

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-14 09:47:02 +01:00
Levi Neely df73ce39c9 update workflow scripts 2026-02-13 18:17:30 +01:00
Levi Neely 341436a6fd feat: add Refresh command to re-detect session state
- Expose via Acme tag bar and 9P ctl file
- No arg refreshes all sessions, with arg refreshes one
2026-02-13 15:05:11 +01:00
Levi Neely e28d39aab6 fix: improve kiro-cli state detection and add Refresh method
- IsBusy now checks /proc/PID/stat for process state (R/D = busy)
  when no child processes exist, fixing false idle detection
- Add Refresh() to Session interface to re-detect state on demand
2026-02-13 15:03:27 +01:00
Levi Neely 1656ff6a6b Fix broken hyperlinks in README 2026-02-13 12:00:31 +01:00
Levi Neely 882b8d68e1 Remove Notes column from backends table 2026-02-13 11:57:56 +01:00
Levi Neely ea272397c7 Add agent-kb skill for knowledge base management 2026-02-13 11:56:00 +01:00
Levi Neely f36dbaa81f Remove ticket-id argument from Planning script 2026-02-13 11:50:37 +01:00
Levi Neely bb174ca272 Fix 9p write examples to use pipe 2026-02-13 11:48:46 +01:00
Levi Neely be03368766 Expand 9P file list in README 2026-02-13 11:47:31 +01:00
Levi Neely f31ea21d5f Remove unused err file from 9P filesystem 2026-02-13 11:47:02 +01:00
Levi Neely a71a1ff8e8 Refactor workflow scripts and remove PID from session list
- Remove PID column from session list display in main.go
- Rename workflow scripts: Claude-DevReview.sh -> DevReview, Kiro-Planning.sh -> Planning
- Make workflow scripts backend-agnostic (accept backend as first argument)
- Install workflow scripts to $INSTALL_PATH/Workflows/ in mkfile
2026-02-13 11:43:49 +01:00
Levi Neely ef8cc122fd docs: add reproducible workflows section with script examples 2026-02-13 11:35:26 +01:00
Levi Neely 13e9873ac8 docs: condense README for clarity 2026-02-13 11:18:43 +01:00
Levi Neely b9942e7f95 docs: update README to reflect current program state
- Fix architecture diagram (window naming, 9P structure)
- Correct Kill command to use session-id not pid
- Remove nonexistent Open command, document right-click
- Add Context command documentation
- Update 9P filesystem (list, context files)
- Fix sandbox defaults (network.enabled: false)
- Update backend descriptions with actual CLI flags
2026-02-13 11:17:01 +01:00
Levi Neely 680f5bcaf1 planning workflow 2026-02-13 11:10:40 +01:00
Levi Neely 026ae4c587 damn bot 2026-02-13 08:47:05 +01:00
Levi Neely 2df14ce071 fix bot-to-bot interaction in claude? 2026-02-13 07:54:06 +01:00
Levi Neely 9721927050 remove Open command, add backends display
Removed Open command from tag and event handling. Added Backends: [Kiro] [Claude] line to session list display.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-12 23:19:25 +01:00
Levi Neely 4eaa82e513 bookmarks.html again, wtf 2026-02-12 19:42:09 +01:00
Levi Neely 483ada27d8 bugfix in ctl new, dev-reviewer flow create script 2026-02-12 19:41:51 +01:00
Levi Neely b20f6e95db remove dead/wasteful code 2026-02-12 18:45:29 +01:00
Levi Neely b462b1a281 no idea where bookmarks.html came from 2026-02-12 18:25:50 +01:00
Levi Neely 50f2234f69 remove poc script 2026-02-12 18:23:32 +01:00
Levi Neely 255c939b2f non-blocking 9p in 2026-02-12 18:23:18 +01:00
Levi Neely 2f6e49c1ef Simplify prompt window: remove chat UI, send-and-close behavior
- Rename Chat to Prompt windows
- Remove Login command from main window
- Prompt window now just has Send button, closes after sending
- Remove handleChatWindow, sendPrompt, openSessionsWindow
- Simplify OnAliasChange callback assignment
2026-02-12 16:18:29 +01:00
Levi Neely fe56df8930 Replace quiescence detection with process tree inspection
Detect idle state by checking if kiro-cli-chat has tool children
rather than relying purely on output quiescence. Fixes premature
idle detection during long-running processes like remote builds.
2026-02-12 16:01:24 +01:00
Levi Neely 4253c52f15 ideas: conductor bot and supervisor concepts 2026-02-12 15:31:28 +01:00
Levi Neely e28fab9d49 ideas: pull-based output model with 9p FIFO semantics 2026-02-12 15:24:26 +01:00
Levi Neely 6e9a4c612e Add session context, summary, and bot-to-bot communication support
- Add context field to sessions (prepended to every prompt)
- Add summary field (first 100 chars of last response)
- Expose context/summary via 9p filesystem
- Add Alias and Context commands to acme UI
- Improve notify script to show cwd basename and summary
- Simplify Kill command to use session ID instead of PID
- Update list format to include alias column
- Add IDEAS.md notes on bot-to-bot communication
2026-02-12 14:59:35 +01:00
Levi Neely 213dededb4 Add grace time for shell initialization in tmux sessions 2026-02-12 09:04:47 +01:00
Levi Neely 35c19c4d27 Don't auto-open chat window on new session creation 2026-02-11 17:26:01 +01:00
Levi Neely e6f49c0b6e Add Attach command to open tmux session in terminal 2026-02-11 16:49:51 +01:00
Levi Neely aa54737b3e docs: add fire-and-forget prompts and anvillm-notify 2026-02-11 16:41:25 +01:00
Levi Neely f0f28b88cd simplify fire-and-forget: use e.Arg from 2-1 chord directly 2026-02-11 16:39:27 +01:00
Levi Neely ccfcca591b Add fire-and-forget prompting, remove auto-refresh
- B2 on session ID in main window sends selected text as prompt
- Remove periodic refresh (use Get manually to avoid cursor warping)
- Remove fire-and-forget idea from IDEAS.md (implemented)
2026-02-11 16:34:17 +01:00
Levi Neely fd13be576c Add anvillm-notify script for session state change notifications
- Add anvillm-notify script that polls session state files
- Sends desktop notification when session transitions running→idle
- Update mkfile with notify target
- Expose state via 9p in main.go
- Remove notification idea from IDEAS.md (implemented)
2026-02-11 16:30:57 +01:00
Levi Neely 9897070b57 Add IDEAS.md with orchestrator feature ideas 2026-02-11 16:15:55 +01:00
Levi Neely f104c6aa5e rethink save/load 2026-02-11 11:35:08 +01:00
Levi Neely 3f570e993e kiro fixes 2026-02-11 09:35:28 +01:00
Levi Neely 326c512976 env support for sandbox 2026-02-11 09:15:59 +01:00
Levi Neely 27530827d7 update docs, never disable sandbox 2026-02-11 08:48:06 +01:00
Levi Neely 528a482fe8 basic sandboxing support with landrun, fail fast 2026-02-11 08:32:14 +01:00
Levi Neely 3c66c48241
Revise README for session commands and 9P filesystem
Updated README to reflect changes in session management commands and 9P filesystem structure.
2026-02-10 23:01:50 +01:00
Levi Neely 22c7d29094
Fix formatting in README diagram 2026-02-10 22:57:59 +01:00
Levi Neely da16c193b9 initial docs 2026-02-10 22:57:21 +01:00