Commit graph

422 commits

Author SHA1 Message Date
Virgil
83703e1d99 fix(ax): continue AX naming cleanup
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 20:58:12 +00:00
Virgil
f9eca5e395 fix(ax): align runtime names with AX principles
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 20:53:36 +00:00
Virgil
f32edaa17e fix(ax): streamline agentic and monitor helpers
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 20:45:23 +00:00
Virgil
b4f5542b21 fix(ax): escape query params and surface scan parse errors
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 20:37:23 +00:00
Virgil
c077819c0d fix(ax): unify home-path resolution
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 20:32:17 +00:00
Virgil
6bc0eb7e46 fix(ax): remove legacy status readers
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 20:20:50 +00:00
Virgil
dc6f2e2073 fix(ax): resolve nested workspace discovery
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 20:12:39 +00:00
Virgil
7d6fd8af5e fix(ax): make agentic status reads Result-native
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 20:40:31 +01:00
Virgil
f3b70fcdfb fix(ax): use Result-native status writes
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 20:33:12 +01:00
Virgil
e9db636552 fix(ax): make runner status reads Result-native
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 20:23:31 +01:00
Virgil
b8466fb56d fix(ax): make workspace extraction Result-native
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 20:14:57 +01:00
Virgil
e826d672b0 fix(ax): return structured errors from Result failures
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 20:08:28 +01:00
Virgil
a1db312c7b fix(ax): surface atomic write failures
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 20:00:47 +01:00
Virgil
faf6b8b6fb fix(ax): unify home-path resolution
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 19:54:17 +01:00
Virgil
553d149d47 test(ax): add workspace command example coverage
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 18:09:32 +00:00
Virgil
d737e2c29e fix(ax): make JSON state writes atomic
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 17:58:17 +00:00
Virgil
37b31e88fc fix(ax): tighten plan ID contract coverage
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 17:45:58 +00:00
Virgil
d2189ce360 fix(ax): simplify plan ID generation and tidy deps
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 17:37:43 +00:00
Virgil
d4c82ccd56 fix(ax): extract dispatch completion monitor
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 17:02:28 +00:00
Virgil
be3e68ec0f fix(ax): make status projections explicit
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 16:24:06 +00:00
Virgil
d005f881b7 fix(ax): use typed workspace status parsing
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 16:14:08 +00:00
Virgil
c22c63edd2 test(ax): focus path helper coverage
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 16:08:45 +00:00
Virgil
6d239d5b95 fix(ax): remove pid syscall wrappers
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 16:01:32 +00:00
Virgil
3c2575f45b fix(ax): remove proc.go wrapper layer
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 15:48:21 +00:00
Virgil
a757ca81e3 fix(ax): preserve transport causes and remove MustCompile
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 15:33:01 +00:00
Virgil
7672e0922f fix(ax): align plan IDs and validation helpers
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 14:32:01 +00:00
Virgil
a2ff1ce19a fix(agentic): repair AX refactor regressions
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 14:01:43 +00:00
Virgil
3d2fa035a9 refactor(agentic): migrate workflow helpers to core.Result
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 07:30:42 +00:00
Virgil
7ad6721ba7 fix(ax): harden watch flow coverage
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 00:35:33 +00:00
Virgil
eae4d3f904 fix(ax): centralise pid lifecycle checks
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 00:28:11 +00:00
Virgil
6c246a7165 docs(ax): add remaining usage examples
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 00:20:03 +00:00
Virgil
f9d36cab0b fix(ax): align brain and runner result flows
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-29 23:45:48 +00:00
Virgil
54581dcbd7 fix(ax): register named agentic commands
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-29 23:37:28 +00:00
Virgil
cef4d5d1f6 docs(ax): add remaining usage examples
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-29 23:14:26 +00:00
Virgil
f8cd0ff11a fix(ax): align runner and monitor usage examples
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-29 22:53:38 +00:00
Virgil
2f7ca89d80 fix(ax): name handlers and align process coverage
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-29 21:56:45 +00:00
Virgil
364007d424 fix(ax): add missing examples and helper coverage
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-29 21:44:22 +00:00
Virgil
4cc763176f fix(ax): share workspace path helpers across services
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-29 21:19:37 +00:00
Virgil
65970527e8 fix(ax): centralise workspace path helpers
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-29 21:11:46 +00:00
Virgil
6ac195c2e6 fix(agentic): align workspace flow with AX design
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-29 20:15:58 +00:00
Snider
6bb4fb8d57 fix(dispatch): concurrency, queue runner, and path improvements
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-29 20:40:20 +01:00
Snider
1762620a43 fix(prep): pull latest on workspace resume instead of stale clone
When a workspace already exists (resumed=true), checkout main and
pull origin before creating the feature branch. Prevents agents
from working on stale code after previous runs merged.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-29 09:22:58 +01:00
Snider
95c104f7b3 feat(workspace): add PHP CODEX.md template + language-aware prep
Workspace prep now detects repo language and copies the right CODEX.md:
- Go repos get CODEX.md.tmpl (existing — Core primitives, banned imports)
- PHP repos get CODEX-PHP.md.tmpl (CorePHP patterns, lifecycle events,
  Actions, BelongsToWorkspace, Flux Pro, FA Pro, UK English)

Added lib.WorkspaceFile() helper for reading individual template files.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-27 06:50:54 +00:00
Snider
f7397324b1 feat(prep): clone core/docs into workspace for agent reference
Agents now get the full ecosystem docs (core.help) at
.core/reference/docs/ in their workspace. 349 markdown files
covering architecture, guides, specs — not just the RFC.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-27 04:39:06 +00:00
Snider
23f31953d4 fix(runner): direct spawn via ServiceFor, only mark running after success
drainOne now spawns agents directly via ServiceFor[spawner] instead of
IPC SpawnQueued (which was never received by agentic). Workspace status
is only set to "running" AFTER successful spawn — no more PID=0 ghosts.

Also fixes workspace name resolution: uses relative path from workspace
root (core/go-ai/dev) instead of PathBase (dev).

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-26 14:24:05 +00:00
Snider
ac510fde19 fix(agentic): handle SpawnQueued IPC — actually spawn agents from queue drain
Runner's drainOne sends SpawnQueued but agentic never handled it,
creating ghost "running" entries with PID=0. Now agentic catches
SpawnQueued, calls spawnAgent, and updates status with real PID.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-26 14:02:56 +00:00
Snider
63db9e8733 fix(runner): use c.Config().Get() instead of ConfigGet generic
ConfigGet type assertion fails across package boundaries —
agentic stores map[string]agentic.ConcurrencyLimit but runner
tries to retrieve map[string]runner.ConcurrencyLimit.

Use Core's c.Config().Get() → Result → type assert instead.
This is why concurrency limits were never enforced.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-26 11:30:38 +00:00
Snider
53db749738 fix(runner): reserve slot on approval to prevent TOCTOU race
Runner now creates a reservation entry (PID=-1) in the workspace Registry
immediately when approving a dispatch. This prevents parallel requests
from all seeing count < limit before any spawn completes.

Reservations are counted by countRunningByAgent/ByModel (PID < 0 = always
count). Agentic overwrites with real PID via TrackWorkspace after spawn.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-26 11:23:04 +00:00
Snider
8911dc5f42 fix(agentic): delegate runner/shutdown/poke to runner service
StartRunner and Poke are now no-ops — runner.Service owns the queue.
Shutdown MCP tools delegate to runner.start/stop/kill Actions via IPC.
Updated 18 tests to verify delegation instead of direct state mutation.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-26 11:19:45 +00:00
Snider
0fc6eeb4cc feat(runner): extract dispatch runner into independent Core service
Moves concurrency, queue drain, workspace lifecycle, and frozen state
from agentic/prep into pkg/runner/ — a standalone Core service that
communicates via IPC Actions only.

- runner.Register wires Actions: dispatch, status, start, stop, kill, poke
- runner.HandleIPCEvents catches AgentCompleted → ChannelPush + queue poke
- Agentic dispatch asks runner for permission via c.Action("runner.dispatch")
- Dispatch mutex moved to struct-level sync.Mutex (fixes core.Lock init race)
- Registry-based concurrency counting replaces disk scanning
- TrackWorkspace called on both queued and running status writes
- SpawnQueued message added for runner→agentic spawn requests
- ChannelPush message in core/mcp enables any service to push channel events
- 51 new tests covering runner service, queue, and config parsing

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-26 11:00:47 +00:00