Commit graph

182 commits

Author SHA1 Message Date
Snider
3c49620548 chore: bump plugin version to 0.14.0
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 02:14:36 +00:00
Snider
c6490c175a refactor: migrate imports to dappco.re paths + bump mcp to v0.4.0
Update all go-* imports from forge.lthn.ai to dappco.re/go/core/*.
Bump mcp to v0.4.0 (Options{} struct API).
Versions: core v0.5.0, io v0.2.0, log v0.1.0, process v0.3.0,
ws v0.3.0, ai v0.2.0, webview v0.2.0, i18n v0.2.0.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 01:27:48 +00:00
94af637411 Merge pull request '[agent/claude] Write tests for /pkg/monitor/ to reach 80% coverage. Current...' (#2) from agent/write-tests-for--pkg-monitor--to-reach-8 into main
Some checks failed
CI / test (push) Failing after 2s
2026-03-22 00:46:00 +00:00
Snider
2d58145e65 test(monitor): add unit tests for completions, inbox, lifecycle
Cover checkCompletions, checkInbox, syncRepos, loop, Poke,
Start/Shutdown, New, initSyncTimestamp, and agentStatusResource.
Mock HTTP endpoints with httptest, use t.TempDir for workspace
scanning, and create fake status.json files for completions.

Also fix dispatch.go build error (removed unsupported RunOptions
fields: KillGroup, Timeout, GracePeriod).

Coverage: 23.2% → 86.5%

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 00:45:43 +00:00
ddaf950654 Merge pull request '[agent/claude] Write tests for /pkg/agentic/ to improve coverage. Current c...' (#4) from agent/write-tests-for--pkg-agentic--to-improve into main
Some checks are pending
CI / test (push) Waiting to run
2026-03-22 00:45:19 +00:00
e2d26dccc1 Merge pull request '[agent/claude] Write tests for /pkg/brain/ to reach 80% coverage. Current c...' (#3) from agent/write-tests-for--pkg-brain--to-reach-80 into main
Some checks are pending
CI / test (push) Waiting to run
2026-03-22 00:45:08 +00:00
Snider
05f120b166 Merge remote-tracking branch 'github/dev'
Some checks failed
CI / test (push) Failing after 3s
2026-03-22 00:29:11 +00:00
Snider
ddf765dee1 fix(dispatch): use correct Codex CLI flags (exec --full-auto)
Some checks failed
CI / test (push) Failing after 3s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 21:26:13 +00:00
Snider
5393828ac6 feat(monitor): include message content in inbox channel events
Some checks failed
CI / test (push) Failing after 3s
inbox.message events now include full message objects (id, from,
subject, content) so recipients can read messages inline without
calling agent_inbox. Charon's messages arrive directly in session.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 20:08:13 +00:00
Snider
81806e5dcc chore: plugin v0.13.0, research v0.2.0, marketplace naming + MONITOR_INTERVAL
Some checks failed
CI / test (push) Failing after 3s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 20:01:51 +00:00
Snider
0fda800e8b chore(monitor): remove debug logging from check cycle
Some checks failed
CI / test (push) Failing after 3s
Debug channel events and stderr logging removed — monitor runs
silently unless something actually happens. Only real events
(agent.complete, inbox.message, harvest.complete) fire now.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 19:42:38 +00:00
Snider
5a234c1179 fix(monitor): seed completions on startup, suppress initial flood
Some checks failed
CI / test (push) Failing after 3s
Both checkCompletions and checkInbox now seed on first run —
existing workspaces and messages are recorded without firing
channel events. Only genuinely new events trigger notifications.

Tests updated to pre-seed flags and filter debug events.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 19:38:03 +00:00
Snider
36dc76cce1 feat(monitor): ID-based inbox detection + channels fully working
Some checks failed
CI / test (push) Failing after 3s
Track inbox by highest message ID instead of unread count. Fixes:
- API pagination limit (max 20) no longer causes missed notifications
- Restart no longer floods with all existing unread messages (seeded)
- Each new message fires exactly once regardless of read state

Added MONITOR_INTERVAL env override and debugChannel helper for
faster iteration during channel development.

All three channel types confirmed working:
- agent.complete: workspace status changes
- inbox.message: new messages by ID tracking
- monitor.debug: real-time debug trace

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 19:31:11 +00:00
Snider
1e9278fd9d feat(monitor): channels working — inbox uses {data:[...]} + debug events
Some checks failed
CI / test (push) Failing after 3s
Fixed inbox API response parsing: {data:[...]} not {messages:[...]}.
Added debugChannel helper for real-time debug events via channels.
MONITOR_INTERVAL env override for faster iteration.

Channels confirmed working:
- agent.complete: workspace status changes
- inbox.message: unread message notifications
- monitor.debug: debug trace events

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 19:24:07 +00:00
Snider
b5dcdd1261 fix(monitor): inbox API returns {data:[...]} not {messages:[...]}
Some checks failed
CI / test (push) Failing after 3s
The MCP agent_inbox tool wraps the response as {messages:[...]},
but the raw API returns {data:[...]}. The monitor calls the raw
API directly, so it needs to parse {data:[...]}.

Verified with curl against live API. Removed debug channel events.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 19:17:53 +00:00
Snider
62b9ee7729 refactor(plugin): split research skills into separate plugin
Some checks failed
CI / test (push) Failing after 3s
New plugin: claude/research (core-research v0.1.0)
- 12 collection/research skills moved from core
- collection subsystem (hooks, scripts) moved
- Installed separately when research work is needed

Core plugin bumped to v0.12.0 — now focused on:
- Dispatch, review, messaging, OpenBrain (operational)
- Deploy, app-split, repo-sweep (infrastructure)
- Architecture review, security review (quality)

Marketplace updated with CoreResearch entry.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 18:16:06 +00:00
Snider
287a4cf110 fix(plugin): address validation findings — commands + skill frontmatter
Some checks failed
CI / test (push) Failing after 3s
Critical: /core:remember rewritten to use brain_remember MCP tool
instead of missing capture-context.sh script.

Major: /core:pipeline persona paths fixed — now reference
pkg/lib/persona/ with correct slugs instead of nonexistent
agents/engineering/ directory.

Major: Added YAML frontmatter (name + description) to all 12
collection skill SKILL.md files for Claude Code auto-discovery.

Removed empty channel/ directory.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 18:12:40 +00:00
Snider
6d28fc439b docs: update known-issues after 9 rounds of Codex review
Some checks failed
CI / test (push) Failing after 2s
77+ findings across 9 rounds, 73+ fixed. False positive rate
climbing in round 9 — codebase is converging.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 17:57:55 +00:00
Snider
92b7b08113 fix: Codex round 9 — verify push target, plan path traversal, mirror branch
Some checks failed
CI / test (push) Failing after 3s
High: verify rebase push now targets Forge remote, not local origin
High/Security: planPath sanitises ID via filepath.Base to prevent
path traversal in plan read/update/delete
Medium: mirror compares and pushes local default branch, not HEAD

Findings 3-6 verified as false positives/known issues (bridge async
by design, API returns top-level memories not {data:...}, inbox uses
{messages:...} confirmed against live API).

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 17:57:03 +00:00
Snider
6da52aa60f fix: Codex round 8 — remote success propagation + stale question cleanup
Some checks failed
CI / test (push) Failing after 3s
Medium: remote dispatch now propagates inner dispatchOut.Success
instead of hardcoding true.

Low: updateStatus clears stale question field when new state
has no question, preventing leftover rejection messages.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 17:46:04 +00:00
Snider
d94eed0b54 docs: Codex review pipeline — forge → github polish + LEM training
Some checks failed
CI / test (push) Failing after 3s
Proven workflow from 7 rounds on core/agent (74 findings, 70+ fixed).
Forge keeps full history, GitHub gets squashed releases. Codex findings
become LEM training data. Charon owns the pipeline.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 17:42:28 +00:00
Snider
40d2b0db16 fix: address Codex round 7 — path traversal + dispatch check
Some checks failed
CI / test (push) Failing after 2s
High/Security: sanitise input.Repo via filepath.Base to prevent
path traversal in workspace prep (../escape from CODE_PATH).

High/Security: sanitise repo.Repo from API response in syncRepos
to prevent path traversal via crafted checkin responses.

Medium: dispatchFixFromQueue now returns error, review_queue checks
success before recording fix_dispatched.

Known issues updated with async bridge provider findings.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 17:25:23 +00:00
Snider
013396bf91 docs: record known issues from 7 rounds of Codex review
Some checks failed
CI / test (push) Failing after 3s
API enhancements, test coverage gaps, conventions, and compile
issues — all acknowledged and tracked for future work.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 17:22:17 +00:00
Snider
5b39e13a6e fix: address Codex round 6 findings — 2 high, 3 medium, 1 low
Some checks failed
CI / test (push) Failing after 3s
High: workspace names use UnixNano to prevent same-second collisions
High: sync only pulls the branch the server reported (was pulling current)

Medium: drainQueue serialised via mutex to prevent concurrent over-dispatch
Medium: remote_status checks JSON-RPC error field before reporting success
Medium: dead agent PIDs without output log marked failed, not completed

Low: detectLanguage uses ordered slice instead of map for deterministic results

Also: URL-encoded agent names in messaging, monitor inbox, and sync endpoints.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 17:10:43 +00:00
Snider
66220021c9 fix: address Codex round 5 findings — 2 high, 5 medium, 4 low
Some checks failed
CI / test (push) Failing after 3s
High: clean stale BLOCKED.md before spawn (prevents stuck workspaces)
High: agentic_create_pr pushes to Forge URL, not local origin

Medium: watch treats merged/ready-for-review as terminal states
Medium: scan paginates org repos (was limited to first 50)
Medium: agent_conversation URL-encodes agent names (injection fix)

Low: inbox/sync/monitor URL-encode agent names in query strings
Low: pullWiki closes response body on non-200 (connection leak)

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 16:53:55 +00:00
Snider
e4f94eaaab fix: address Codex round 4 findings
Some checks failed
CI / test (push) Failing after 3s
High: Codex review now sets working directory (was missing)
Medium: harvest skip-branch check uses defaultBranch() not just "main"
Medium: dry_run reads PROMPT.md from src/ (was reading wrong path)
Low: agent prompt says "current directory" not "parent directory"
Low: queue prompt matches dispatch prompt

Finding 1 (inbox messages vs data) verified as false positive —
API returns {messages:[...]}, confirmed against live endpoint.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 16:36:26 +00:00
Snider
67249fa78f fix: address Codex round 3 findings — 5 high, 4 medium, 1 low
Some checks failed
CI / test (push) Failing after 3s
High: prep creates workspace dir before clone (was missing)
High: auto_pr detects default branch instead of hardcoding main
High: mirror gh pr commands now use --repo for correct targeting
High: syncRepos HTTP client has 15s timeout (was no timeout)
High: sync timestamp only advances when all repos were pulled

Medium: rebaseBranch uses detected default branch
Medium: scan URL-encodes labels to prevent injection
Medium: recall MinConfidence forwarding (acknowledged, API-level)
Medium: recall tags preservation (acknowledged, API-level)

Low: harvest pushBranch uses coreerr.E instead of fmt.Errorf

Shared gitDefaultBranch helper added to agentic/paths.go.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 16:22:18 +00:00
Snider
026b31edf7 fix: address Codex round 2 mediums
Some checks failed
CI / test (push) Failing after 3s
- harvest: message says 'ready-for-review' not 'pushed'
- sync: timestamp advanced after pulls, not before
- sync: accepts main/master/reported branch, not just main
- inbox: checks CORE_BRAIN_KEY env before falling back to file
- inbox: parses 'from' not 'from_agent', 'messages' not 'data'
- queue: strips variant suffix for rate limit lookup (claude:opus → claude)
- review_queue: respects ReviewQueueInput.Reviewer instead of hardcoding coderabbit
- tests: updated to match real API response structure

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 16:05:59 +00:00
Snider
98ce071b13 fix: address Codex round 2 findings — 3 verified highs
Some checks failed
CI / test (push) Failing after 3s
High: harvest no longer hardcodes 'main' — detects default branch
via symbolic-ref/rev-parse fallback. Repos with master/other
default branches are now harvested correctly.

High: empty task no longer produces invalid 'agent/' branch name.
Falls back to issue-N or work-timestamp. Branch creation errors
are now surfaced instead of silently ignored.

High: PHP verification no longer returns passed:true when no test
runner exists. Untested PHP repos correctly fail verification.

(brain/direct.go findings 5-6 verified as false positives — API
returns top-level keys, not {data: ...} envelope)

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 15:59:48 +00:00
Snider
422777580b fix: address Codex review findings — 2 high, 3 medium
Some checks failed
CI / test (push) Failing after 3s
High: Fix missed-notification bug — track completions by workspace
name instead of count, so harvest status rewrites don't suppress
future notifications. Also tracks blocked/failed terminal states.

High: Safety gate fail-closed — check ALL changed files (not just
added), reject on git diff failure instead of proceeding.

Medium: emitCompletionEvent now passes actual status (completed,
failed, blocked) instead of hardcoding "completed".

Medium/AX: Harvest no longer auto-pushes to source repos. Sets
status to ready-for-review only — pushing happens during explicit
review, not silently in the background.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 15:31:29 +00:00
Snider
726a384873 test(agentic): add unit tests for paths, status, queue, plans
Some checks failed
CI / test (push) Failing after 3s
Coverage: 4.2% → 9.2%. Tests for extractPRNumber, workspace
status scanning, queue management, and plan file operations.
Remaining coverage requires integration tests (git/forge/process).

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 15:06:19 +00:00
Snider
4fe1bf0aff test(agentic): add unit tests for paths, status, queue, plans
Coverage: 4.2% → 9.2%. Tests for extractPRNumber, workspace
status scanning, queue management, and plan file operations.
Remaining coverage requires integration tests (git/forge/process).

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 15:06:04 +00:00
Snider
e0bcb6b271 ci: add GitHub Actions workflow with Codecov
Runs tests for brain, monitor, and agentic packages on push to main.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 15:06:04 +00:00
Snider
f2276904bf test(monitor): add unit tests for completions, inbox, lifecycle
Coverage: 23.2% → 86.5%
Tests for checkCompletions, checkInbox, monitor loop,
Poke, New, Start/Shutdown. Uses httptest for API mocking.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 15:06:04 +00:00
Snider
c38a3aefff test(brain): add unit tests for recall, remember, messaging
Coverage: 5.3% → 92.8%. Tests cover DirectSubsystem (apiCall, remember,
recall, forget via httptest), messaging (sendMessage, inbox, conversation,
parseMessages, toInt), BrainProvider (gin handlers, routes, describe,
status), Subsystem bridge-backed handlers, and RegisterTools.

Also fixes build error in dispatch.go (removed KillGroup, Timeout,
GracePeriod fields no longer in process.RunOptions).

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 15:06:04 +00:00
Snider
2c0b75d6f1 test(monitor): add harvest and channel notification tests
15 tests covering:
- Branch detection, unpushed commit counting, file counting
- Safety checks: binary rejection, large file rejection
- Workspace harvesting: happy path, skip running, skip main, reject binary
- Channel event emission via mock notifier
- Status file updates

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 15:06:04 +00:00
Snider
7932f3a7ba feat(agent): wire channel notifications into monitor
- Monitor pushes agent.complete, inbox.message, harvest.complete
  events via ChannelSend instead of temp files
- Remove /tmp/claude-inbox-notify file write (channels replace it)
- Update mcp.New() to use Options{} struct
- Wire mcpSvc as ChannelNotifier after creation

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 15:06:04 +00:00
Snider
da6d6cfa1a test(agentic): add unit tests for paths, status, queue, plans
Add comprehensive tests for pkg/agentic covering:
- status.go: writeStatus, readStatus, roundtrip, overwrite, error cases
- plan.go: writePlan, readPlan, planPath, roundtrip, directory creation
- queue.go: baseAgent edge cases, config defaults, concurrency checks
- prep.go: envOr, detectLanguage, detectBuildCmd, detectTestCmd, NewPrep

Coverage improved from 4.2% to 9.2%. All tests use t.TempDir(),
coreio.Local for file I/O, and _Good/_Bad/_Ugly naming convention.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 14:03:40 +00:00
Snider
267550b288 ci: add GitHub Actions workflow with Codecov
Some checks failed
CI / test (push) Failing after 2s
Runs tests for brain, monitor, and agentic packages on push to main.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 13:53:57 +00:00
Snider
8eb2430486 test(monitor): add unit tests for completions, inbox, lifecycle
Coverage: 23.2% → 86.5%
Tests for checkCompletions, checkInbox, monitor loop,
Poke, New, Start/Shutdown. Uses httptest for API mocking.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 13:49:23 +00:00
Snider
0a77b058b6 test(brain): add unit tests for recall, remember, messaging
Coverage: 5.3% → 92.8%. Tests cover DirectSubsystem (apiCall, remember,
recall, forget via httptest), messaging (sendMessage, inbox, conversation,
parseMessages, toInt), BrainProvider (gin handlers, routes, describe,
status), Subsystem bridge-backed handlers, and RegisterTools.

Also fixes build error in dispatch.go (removed KillGroup, Timeout,
GracePeriod fields no longer in process.RunOptions).

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 13:46:33 +00:00
Snider
77cc22b0a7 test(brain): add unit tests for recall, remember, messaging
Coverage: 5.3% → 92.8%. Tests cover DirectSubsystem (apiCall, remember,
recall, forget via httptest), messaging (sendMessage, inbox, conversation,
parseMessages, toInt), BrainProvider (gin handlers, routes, describe,
status), Subsystem bridge-backed handlers, and RegisterTools.

Also fixes build error in dispatch.go (removed KillGroup, Timeout,
GracePeriod fields no longer in process.RunOptions).

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 13:40:20 +00:00
Snider
4d0bd3ad38 test(monitor): add harvest and channel notification tests
15 tests covering:
- Branch detection, unpushed commit counting, file counting
- Safety checks: binary rejection, large file rejection
- Workspace harvesting: happy path, skip running, skip main, reject binary
- Channel event emission via mock notifier
- Status file updates

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 13:21:23 +00:00
Snider
2f10c7d368 feat(agent): wire channel notifications into monitor
- Monitor pushes agent.complete, inbox.message, harvest.complete
  events via ChannelSend instead of temp files
- Remove /tmp/claude-inbox-notify file write (channels replace it)
- Update mcp.New() to use Options{} struct
- Wire mcpSvc as ChannelNotifier after creation

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 12:56:24 +00:00
Snider
5628abcc7f refactor: flatten go/ subdir, migrate to dappco.re/go/agent, restore process service
- Module path: dappco.re/go/agent
- Core import: dappco.re/go/core v0.4.7
- Process service re-enabled with new Core API
- Plugin bumped to v0.11.0
- Directory flattened from go/ to root

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 11:12:40 +00:00
Claude
fc9fc1af83 feat(skills): add repo-sweep skill for multi-repo agent dispatch
Orchestrates dispatching agents across multiple repos with:
- Repo selection (all, by org, by language, explicit list)
- Configurable persona + template + task per sweep
- Concurrency-aware dispatch with queue monitoring
- Finding triage: actionable → Forge issue, informational → OpenBrain, noise → ignore
- Summary report with per-repo findings

5 default profiles: quality, security, conventions, tests, docs.
Uses testing/reality-checker persona for quality sweeps.

Co-Authored-By: Charon <charon@lethean.io>
2026-03-21 11:12:40 +00:00
Snider
21f234aa7c refactor: flatten go/ subdir, migrate to dappco.re/go/agent, restore process service
- Module path: dappco.re/go/agent
- Core import: dappco.re/go/core v0.4.7
- Process service re-enabled with new Core API
- Plugin bumped to v0.11.0
- Directory flattened from go/ to root

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 11:10:44 +00:00
Snider
be1130f470 agent updates 2026-03-21 11:10:44 +00:00
Snider
1215898608 agent updates 2026-03-20 19:31:45 +00:00
Claude
2e3f56c4a7
feat(skills): add repo-sweep skill for multi-repo agent dispatch
Orchestrates dispatching agents across multiple repos with:
- Repo selection (all, by org, by language, explicit list)
- Configurable persona + template + task per sweep
- Concurrency-aware dispatch with queue monitoring
- Finding triage: actionable → Forge issue, informational → OpenBrain, noise → ignore
- Summary report with per-repo findings

5 default profiles: quality, security, conventions, tests, docs.
Uses testing/reality-checker persona for quality sweeps.

Co-Authored-By: Charon <charon@lethean.io>
2026-03-18 15:21:11 +00:00