Commit graph

105 commits

Author SHA1 Message Date
Snider
06b72136b6 chore: add .mcp.json for Claude Code MCP integration
Uses just "core-agent" (no absolute paths) — works on any machine
where core-agent is on PATH.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-17 18:35:29 +00:00
Snider
317be4c53f fix: use CORE_WORKSPACE env var in shell scripts, fallback to ~/Code/.core
Scripts now use ${CORE_WORKSPACE:-$HOME/Code/.core} instead of
hardcoded host-uk path. Works on both Cladius and Charon.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-17 18:23:39 +00:00
Snider
e677d15bdd fix: remove hardcoded paths, gitignore binaries
- Add paths.go with WorkspaceRoot(), CoreRoot(), PlansRoot()
- All workspace paths now check CORE_WORKSPACE env var first
- Fallback: ~/Code/.core/workspace (works on any machine)
- Remove committed core-agent and mcp binaries from tracking
- Add .gitignore for compiled binaries

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-17 18:13:44 +00:00
Snider
0622982fa7 chore: bump plugin to v0.9.0, update description and keywords
Reflects all capabilities added today:
- Remote dispatch (Charon HTTP daemon)
- Verify+merge pipeline with rebase retry
- CodeRabbit + Codex review queue
- GitHub mirror sync
- PostToolUse inbox notification hook
- Cross-agent messaging

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-17 18:04:10 +00:00
Snider
90b03191b2 feat(agent): v0.2.0 — HTTP daemon, remote dispatch, review queue, verify+merge
Major additions:
- core-agent serve: persistent HTTP daemon with PID file, health check, registry
- agentic_dispatch_remote: dispatch tasks to remote agents (Charon) over MCP HTTP
- agentic_status_remote: check remote agent workspace status
- agentic_mirror: sync Forge repos to GitHub mirrors with file count limits
- agentic_review_queue: CodeRabbit/Codex review queue with rate-limit awareness
- verify.go: auto-verify (run tests) + auto-merge + retry with rebase + needs-review label
- monitor sync: checkin API integration for cross-agent repo sync
- PostToolUse inbox notification hook (check-notify.sh)

Dispatch improvements:
- --dangerously-skip-permissions (CLI flag changed)
- proc.CloseStdin() after spawn (Claude CLI stdin pipe fix)
- GOWORK=off in agent env and verify
- Exit code / BLOCKED.md / failure detection
- Monitor poke for instant notifications

New agent types:
- coderabbit: CodeRabbit CLI review (--plain --base)
- codex:review: OpenAI Codex review mode

Integrations:
- CODEX.md: OpenAI Codex conventions file
- Gemini extension: points at core-agent MCP (not Node server)
- Codex config: core-agent MCP server added
- GitHub webhook handler + CodeRabbit KPI tables (PHP)
- Forgejo provider for uptelligence webhooks
- Agent checkin endpoint for repo sync

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-17 17:45:04 +00:00
Snider
b95a367d9d feat: add check-inbox.sh with marker-based change detection
Only outputs when there are new messages since last check.
Uses .inbox-last-id marker file to track highest seen message ID.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-17 06:17:29 +00:00
Snider
c639a848c2 fix: PID polling fallback for process completion detection
proc.Wait() hangs when Claude Code's child processes inherit pipes.
Added PID polling every 5s — when the main process is dead (Signal(0)
fails), force completion even if pipes are still open.

Fixes: empty agent logs, missing completion events, stuck queue drain.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-17 05:56:22 +00:00
Snider
ccfd68ca1a feat: fire resource subscription notification on agent status change
Monitor now calls Server.ResourceUpdated() for status://agents when
agent completions or inbox changes are detected. Clients subscribed
to this resource get notified automatically via MCP protocol.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-17 05:52:12 +00:00
Snider
99733bd83e chore: bump plugin to v0.7.0
New since v0.6.0:
- Monitor subsystem (background ecosystem watcher via MCP session)
- agentic_watch tool (progress notifications)
- Auto PR creation on agent completion
- Sandbox enforcement (3-layer)
- Completion events (events.jsonl)
- status://agents MCP resource
- go-process init for dispatch

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-17 05:45:01 +00:00
Snider
0ca253fe68 feat: add monitor subsystem — background ecosystem watcher
Runs every 2 minutes while MCP server is active:
- Checks for newly completed agent workspaces
- Checks inbox for unread messages
- Pushes notifications via ServerSession.Log() to connected clients

Also registers status://agents resource for on-demand workspace status.

The MCP connection is bidirectional — monitor uses it to actively
notify rather than waiting for tool calls.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-17 05:37:57 +00:00
Snider
132ade1765 feat: add agentic_watch tool with MCP progress notifications
Watches running/queued agent workspaces until all complete.
Sends progress notifications via MCP protocol as each agent finishes.
Returns summary with completed/failed counts and PR URLs.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-17 04:31:19 +00:00
Snider
71decc26b2 feat: auto-create PR on Forge after agent completion
When a dispatched agent completes with commits:
1. Branch name threaded through PrepOutput → status.json
2. Completion goroutine pushes branch to forge
3. Auto-creates PR via Forge API with task description
4. PR URL stored in status.json for review

Agents now create PRs instead of committing to main. Combined
with sandbox restrictions, this closes the loop on controlled
agent contributions.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-17 04:19:48 +00:00
Snider
da1c45b4df feat: sandbox dispatched agents to workspace directory
Three-layer sandboxing:
1. --append-system-prompt with SANDBOX boundary instructions
2. PROMPT.md templates include SANDBOX BOUNDARY (HARD LIMIT) section
3. Agent starts in src/ with only cloned repo visible

Agents are instructed to reject absolute paths, cd .., and any
file operations outside the repository. Violations cause work rejection.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-17 04:12:54 +00:00
Snider
67705e2be9 fix: remove SessionStart completion check, keep idle_prompt only
Completion notifications should fire while running (idle), not on restart.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-17 03:47:42 +00:00
Snider
cb56cfb270 fix: initialise go-process for dispatch, fix Notification hook matcher
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-17 03:22:34 +00:00
Snider
58749c87f8 feat: agent completion events + plugin hooks
spawnAgent() now writes completion events to events.jsonl.
Plugin hooks check for completions on:
- SessionStart: report agents that finished since last session
- Notification(idle_prompt): check when Claude is idle

Event format: {"type":"agent_completed","agent":"...","workspace":"...","timestamp":"..."}

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-17 03:05:26 +00:00
Snider
662217c6f5 chore: sync dependencies for v0.3.3
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 22:28:07 +00:00
Snider
5eb26f90fc refactor: replace fmt.Errorf/os.* with go-io/go-log conventions
Replace all fmt.Errorf and errors.New in production code with
coreerr.E("caller.Method", "message", err) from go-log. Replace
all os.ReadFile/os.WriteFile/os.MkdirAll/os.Remove with coreio.Local
equivalents from go-io. Test files are intentionally untouched.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 21:48:31 +00:00
Snider
56397d7377 chore: bump claude concurrency to 3, activate charon
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 17:57:59 +00:00
Snider
42788a2a88 refactor(dispatch): use go-process for agent spawning
Replace raw exec.Command with go-process.StartWithOptions for all agent
spawning (dispatch, queue, resume). Uses pipes for output capture instead
of file descriptor redirect — fixes Claude Code's empty log issue.

Shared spawnAgent() helper eliminates duplication across 3 files.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 17:52:55 +00:00
Snider
267a5e5e6d fix(dispatch): use --output-format text for claude agent logging
Claude -p output wasn't reaching the log file. Explicitly set
--output-format text, --permission-mode bypassPermissions (replaces
deprecated flag), and --no-session-persistence for ephemeral workers.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 17:37:58 +00:00
Snider
4e8fff62a0 chore: update core/mcp, drop go-ml/go-duckdb dependency
core/mcp no longer pulls go-ml. Unblocks CGO_ENABLED=0 cross-compilation.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 15:38:06 +00:00
Snider
5f83cf902a fix: messaging routes use auth.api, fix InboxInput schema
- Remove messaging routes from core/agent (conflict with AgentApiAuth)
- Routes now only in host app with auth.api middleware (same as brain)
- Add Agent field to InboxInput so MCP schema isn't empty

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 15:11:10 +00:00
Snider
7b8b93b4b1 feat: merge review/verify into core plugin, add messaging MCP tools
Consolidate all commands under /core: prefix — review and verify plugins
merged into core. Adds agent_send, agent_inbox, agent_conversation as
Laravel MCP tools so messaging works through the HTTP server.

- 15 commands all under /core: (was split across 3 plugins)
- Messaging tools registered in Boot::onMcpTools()
- Hooks merged (PostToolUse for PR create, PreToolUse for git push)
- Plugin bumped to v0.6.0

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 14:52:01 +00:00
Snider
ec6b07dea2 chore: bump plugin to v0.5.0 (agent messaging)
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 14:17:21 +00:00
Snider
37f6d61368 feat: agent messaging — direct chronological messages between agents
New: agent_send, agent_inbox, agent_conversation MCP tools.
API: /v1/messages/send, /v1/messages/inbox, /v1/messages/conversation/{agent}
Model: AgentMessage with inbox, unread, conversation scopes.

Separate channel from semantic brain search. Messages are chronological,
not vector-searched. Agents can now have direct conversations.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 14:03:36 +00:00
Snider
85dd0555ac fix(brain): shared brain — don't filter by agent_id on recall
Was forcing agent isolation. Now all agents see all memories by default.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 11:50:20 +00:00
Snider
5fbaf4f211 fix(brain): use hostname-based agent_id instead of hardcoded cladius
Charon gets agent_id 'charon', Cladius gets 'cladius'.
Override with AGENT_NAME env var.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 11:24:59 +00:00
Snider
2ea50959f2 refactor: move brain + agentic packages into core/agent, use core/cli
Brain and agentic subsystems now live in core/agent/pkg/ instead of
core/mcp/pkg/mcp/. core-agent binary uses core/cli for proper command
framework. Usage: core-agent mcp

One repo, one clone, everything works.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 11:10:33 +00:00
Snider
84e2b62beb feat: core-agent MCP binary using core/mcp subsystems
Replaces old mcp-go based server with core/mcp (brain + agentic).
Single binary: go install ./cmd/core-agent/
Provides: brain_recall, brain_remember, brain_forget, agentic_dispatch,
agentic_status, agentic_resume, agentic_scan, agentic_create_pr, etc.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 10:58:25 +00:00
Snider
0f12156104 docs: Charon onboarding guide — ecosystem changes March 2026
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 09:04:28 +00:00
Snider
e359522c97 feat(issues): add epic type
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 08:36:25 +00:00
Snider
a389388b9d feat(ui): core-agent-panel Lit custom element
Dashboard showing issues + sprint progress. Works in:
- core/ide (Wails desktop via provider system)
- lthn.sh (Laravel web via Blade component)
- Standalone browser (index.html)

Auto-refreshes every 30s. Accepts api-url and api-key attributes.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 08:16:30 +00:00
Snider
d1537879b3 fix: add keep_alive to local-agent.sh — unloads model after 5m idle
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 07:48:42 +00:00
Snider
796eb83204 feat: add local-agent.sh wrapper + local concurrency config
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 07:35:34 +00:00
Snider
d659f1c2c9 chore: reduce gemini concurrency to 1 (free tier quota)
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 06:36:28 +00:00
Snider
0b8d7b13ed fix(issues): use workspace_id from middleware, not workspace object
AgentApiAuth middleware sets workspace_id attribute, not workspace.
Controllers were trying to read ->id on null.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 06:16:29 +00:00
Snider
12a22aa892 test(issues): phase 5 — feature tests for Issue and Sprint models and actions
IssueTest covers: model CRUD, status transitions, slug generation,
sprint association, comments, label management, scopes, MCP context,
and all Issue Action classes with validation.
SprintTest covers: model lifecycle, progress calculation, scopes,
MCP context, and all Sprint Action classes with validation.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 06:02:08 +00:00
Snider
5a0b126f51 feat(issues): phase 3 — Actions and API controllers for issues and sprints
Issue Actions: CreateIssue, GetIssue, ListIssues, UpdateIssue,
ArchiveIssue, AddIssueComment with full validation and workspace scoping.
Sprint Actions: CreateSprint, GetSprint, ListSprints, UpdateSprint,
ArchiveSprint with status lifecycle management.
IssueController: REST endpoints with filtering by status, type,
priority, sprint, and label. Comment sub-resource endpoints.
SprintController: REST endpoints with progress tracking.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 06:02:08 +00:00
Snider
225b0b4812 feat(issues): phase 2 — migration, models, routes for issue tracker
Add Issue, Sprint, IssueComment models with workspace scoping,
soft deletes, activity logging, and MCP context support.
Migration creates issues, sprints, and issue_comments tables.
API routes registered with read/write permission scopes.
Controller stubs for IssueController and SprintController.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 06:02:08 +00:00
Snider
54e9fe0b61 chore: bump core plugin to v0.4.0 (hook cleanup)
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 05:42:25 +00:00
Snider
88e5fc6f49 refactor(plugin): remove restrictive hooks, clean up orphaned scripts
Removed:
- prefer-core.sh: blocked raw go/php commands unnecessarily
- post-commit-check.sh: noisy warnings after every commit
- block-docs.sh: blocked writing specs and RFCs
- capture-context.sh, extract-actionables.sh, pr-created.sh,
  suggest-compact.sh: orphaned scripts not referenced by any hook

Kept:
- go-format.sh, php-format.sh: auto-format after edits (helpful)
- check-debug.sh: warns about dd()/fmt.Print* (lightweight)
- session-start.sh, pre-compact.sh, session-save.sh: essential

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 05:37:52 +00:00
Snider
cce41faa39 fix(plugin): remove block-docs hook — was blocking specs and RFCs
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 05:32:21 +00:00
Snider
670e4c9a10 feat(templates): add 5 audit templates for self-healing codebase
New scan templates:
- dependency-audit: find code rolling its own vs using framework
- dead-code: unreachable functions, unused exports, orphaned files
- test-gaps: untested functions, missing error path coverage
- api-consistency: endpoint naming, response shapes, error formats
- doc-sync: documentation vs code drift

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-15 18:33:52 +00:00
Snider
e6dbce3a78 feat: rate config for quota-aware scheduling — gemini burst/sustained modes
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-15 17:56:04 +00:00
Snider
e77140a58f feat: per-agent concurrency — claude: 1, gemini: 3, codex: 1
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-15 17:33:26 +00:00
Snider
73212624a3 fix(plugin): update marketplace listing code → core, bump to v0.3.0
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-15 17:11:09 +00:00
Snider
86040da16a chore(plugin): bump version to 0.3.0 for core/ rename
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-15 17:07:47 +00:00
Snider
fd7be94b2c fix(plugin): rename plugin from code → core for /core: namespace
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-15 17:03:58 +00:00
Snider
afbc915db3 rename: claude/code → claude/core for /core: command namespace
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-15 16:59:01 +00:00