Commit graph

58 commits

Author SHA1 Message Date
Snider
a0bf57f10b fix: migrate module paths from forge.lthn.ai to dappco.re
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-04 16:21:13 +01:00
Virgil
1ad4c2aa72 fix(process): guard runner without service 2026-04-03 23:13:57 +00:00
Virgil
e2f84b69e1 fix(process): capture health server in serve goroutine 2026-04-03 23:10:33 +00:00
Virgil
f94b83fe6d chore: verify process package against RFC contract 2026-04-03 07:52:18 +00:00
Virgil
8b0fe175b9 Harden process ring buffer and daemon/health shutdown behavior 2026-04-03 07:36:44 +00:00
Virgil
2d68f89197 fix(process): keep runner results ordered 2026-04-01 09:53:02 +00:00
Virgil
1a6a74085e fix(process): leave exit action error unset
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-31 19:59:32 +00:00
Virgil
3a60b9f1e7 fix(process): ensure program paths are absolute
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-31 19:56:13 +00:00
Virgil
cd16b014da fix(api): include health-check reason payload
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-31 19:53:19 +00:00
Virgil
7c3801e741 feat(process): honor pending process lifecycle
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-31 19:49:31 +00:00
Virgil
8f359bb004 fix(process): make process.start non-detached by default
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-31 19:46:05 +00:00
Virgil
c60f355b25 fix(process): emit kill action immediately
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-31 19:33:51 +00:00
Virgil
9a93ebea66 feat(process-ui): stream live process list from websocket
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-31 19:30:38 +00:00
Virgil
0e4dde9307 fix(process): harden program helpers and health schema
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-31 19:22:49 +00:00
Virgil
8a6c253ea2 fix(ax): align action handlers and exec errors 2026-03-30 13:43:00 +00:00
Virgil
8a85c3cd86 fix(ax): complete Agent Experience service alignment 2026-03-30 06:34:42 +00:00
Virgil
e75cb1fc97 docs(ax): add RFC/spec artifacts for AX contract alignment 2026-03-30 06:34:38 +00:00
Virgil
b0dd22fc5e docs(ax): align process docs with AX action/result contract 2026-03-30 06:34:38 +00:00
Virgil
aa3602fbb0 refactor(ax): remove legacy global process singleton 2026-03-30 06:34:38 +00:00
Virgil
15e4c8ddeb fix(process): align service APIs with AX-compatible error boundaries 2026-03-30 06:34:35 +00:00
Snider
4ff0d0b745 fix(tests): migrate to new Core API — New() returns *Core, no WithName/ServiceFor
Replace framework.New(framework.WithName(...)) + framework.ServiceFor[T]()
with direct factory calls: factory := NewService(opts); raw, _ := factory(c)

RegisterAction handler signature: func(*Core, Message) Result (was error)

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 00:04:07 +00:00
Claude
a09ca4f408
chore: migrate to dappco.re vanity import path
Module path: forge.lthn.ai/core/go-process -> dappco.re/go/core/process

Import path updates:
- forge.lthn.ai/core/go-log -> dappco.re/go/core/log
- forge.lthn.ai/core/go-io -> dappco.re/go/core/io
- forge.lthn.ai/core/go-ws -> dappco.re/go/core/ws
- forge.lthn.ai/core/go-process (self) -> dappco.re/go/core/process
- forge.lthn.ai/core/api left as-is (not yet migrated)

Local replace directives added until vanity URL server is configured.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 23:49:08 +00:00
Snider
93f3ab054c refactor: migrate core import to dappco.re/go/core
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 20:00:57 +00:00
94c4fde4b0 Merge pull request '[agent/claude:sonnet] Implement the plan at docs/plans/2026-03-18-absorb-sail-prog...' (#3) from agent/implement-the-plan-at-docs-plans-2026-03 into main 2026-03-18 15:07:17 +00:00
Snider
87b16ca41c feat(process): add Program struct with Find, Run, RunDir
Add Program to the process package as a lightweight tool-finder and runner.
Find() resolves a binary via exec.LookPath (wrapping ErrProgramNotFound),
Run() and RunDir() execute the binary and return trimmed combined output.
Includes 7 tests covering happy paths, error paths, and the errors.Is contract.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-18 15:07:03 +00:00
Snider
e0df0d3b34 chore: sync dependencies for v0.2.9
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-17 17:53:00 +00:00
Snider
cdea149a20 chore: sync dependencies for v0.2.8
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-17 17:48:46 +00:00
Snider
1a015ed6ba feat: add Timeout, GracePeriod, KillGroup, Shutdown to RunOptions
- RunOptions.Timeout: auto-kills after duration (SIGTERM → SIGKILL)
- RunOptions.GracePeriod: time between SIGTERM and SIGKILL
- RunOptions.KillGroup: kills entire process group (child processes too)
- Process.Shutdown(): graceful SIGTERM → wait → SIGKILL
- OnShutdown uses Shutdown() instead of Kill() for graceful stops
- Runner circular deps now count as Failed, not Skipped
- Tests for all new features

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-17 17:44:37 +00:00
eac2d0b0cd Merge pull request '[agent/claude:opus] Fix CodeRabbit findings. Verify each against current code, f...' (#2) from agent/fix-coderabbit-findings--verify-each-aga into main 2026-03-17 13:13:37 +00:00
Snider
f3e995ffd0 fix(coderabbit): address review findings
- Assert SetDefault error return in tests instead of ignoring it
- Pass caller location to wrapError for accurate error traces
- daemon.go reviewed: no actionable finding

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-17 13:13:26 +00:00
75cb802ef6 Merge pull request '[agent/claude:opus] DX audit and fix. 1) Review CLAUDE.md — update any outdate...' (#1) from agent/dx-audit-and-fix--1--review-claude-md into main 2026-03-17 08:43:17 +00:00
Snider
87ef2dbe16 fix(dx): audit CLAUDE.md, error handling, and test coverage
- Update CLAUDE.md: document Detach, DisableCapture, ShutdownTimeout,
  auto-registration, graceful shutdown, and error handling conventions;
  add missing go-log and go-io dependencies
- Replace ServiceError type in process_global.go with coreerr.E()
  sentinel errors for consistency with the rest of the package
- Wrap raw error returns in Registry.Register, Registry.Unregister,
  and PIDFile.Release with coreerr.E() for proper context
- Add tests for Service.Kill, Service.Output, Service.OnShutdown,
  Service.OnStartup, Service.RunWithOptions, Service.Running,
  Process.Signal, Daemon.Run (context cancellation),
  Daemon.Stop (idempotent), DisableCapture, Detach, env vars,
  exec.WithDir, exec.WithEnv, exec.WithStdin/Stdout/Stderr,
  exec.RunQuiet
- Coverage: root 82.7% → 88.3%, exec/ 61.9% → 87.3%

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-17 08:42:56 +00:00
Snider
d955ffc0e7 chore: sync dependencies for v0.2.7
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 22:17:52 +00:00
Snider
d73dfa3d73 refactor(process): replace fmt.Errorf and errors.New with coreerr.E()
Replace all 27 instances of fmt.Errorf/errors.New in production code
with coreerr.E() from forge.lthn.ai/core/go-log for structured error
context (op, message, cause). Promote go-log from indirect to direct
dependency in go.mod.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 20:38:08 +00:00
Snider
10adcbe289 fix(test): SetDefault returns error not panic, update test
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 18:41:56 +00:00
Snider
715c14f048 refactor(process): replace os file ops with coreio.Local in pidfile and registry
Replace all os.ReadFile, os.WriteFile, os.MkdirAll, os.Remove calls in
pidfile.go and registry.go with coreio.Local equivalents (Read, Write,
EnsureDir, Delete). Add forge.lthn.ai/core/go-io v0.1.2 as a direct dependency.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 18:31:35 +00:00
Snider
c3b9374ae1 feat: add Detach option for process group isolation
RunOptions.Detach creates the process in its own process group
(Setpgid) and uses context.Background() instead of the parent
context. Detached processes survive parent death.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-15 15:55:20 +00:00
Snider
4760cd8c80 chore: bump core/go to v0.3.1
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-15 15:36:39 +00:00
Snider
3694f6e36d chore: add .core/ and .idea/ to .gitignore 2026-03-15 10:17:50 +00:00
Snider
2b93b63a5a fix: update stale import paths and dependency versions from extraction
Resolve stale forge.lthn.ai/core/cli v0.1.0 references (tag never existed,
earliest is v0.0.1) and regenerate go.sum via workspace-aware go mod tidy.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-14 13:38:59 +00:00
Snider
59e82f74af docs: remove implemented plan files
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-14 12:45:56 +00:00
Snider
0ae76c2414 feat(ui): add Lit custom elements for process management
Five Lit custom elements following the go-scm UI pattern:
- <core-process-panel> tabbed container (Daemons/Processes/Pipelines)
- <core-process-daemons> daemon registry with health checks and stop
- <core-process-list> managed processes with status badges
- <core-process-output> live stdout/stderr WS stream viewer
- <core-process-runner> pipeline execution results display

Also adds provider.Renderable interface to ProcessProvider with
Element() returning core-process-panel tag, extends WS channels
with process-level events, and embeds the built UI bundle via
go:embed.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-14 12:25:06 +00:00
Snider
ae321f5344 refactor(api): update import path from go-api to core/api
Part of the polyglot merge — forge.lthn.ai/core/go-api is now
forge.lthn.ai/core/api.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-14 10:10:43 +00:00
Snider
58e4d37008 feat(api): add process service provider with REST endpoints
Wraps the daemon Registry as a provider.Provider with REST endpoints for
list, get, stop, and health check. Implements Streamable and Describable
for WS event streaming and OpenAPI generation. Adds go-api, go-ws, and
gin as direct dependencies for the pkg/api sub-package.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-14 09:47:20 +00:00
Snider
d04d042e96 docs: add CLAUDE.md project instructions
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-13 13:38:02 +00:00
Snider
ec95200765 docs: add human-friendly documentation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 13:02:40 +00:00
Snider
81de841903 feat: auto-register/unregister daemons via optional Registry
When Registry is set on DaemonOptions, Start() auto-registers the daemon
(filling PID and Health address) and Stop() auto-unregisters it. Consumers
without a registry are completely unaffected.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 14:49:47 +00:00
Snider
2a26948d44 feat: add daemon Registry for tracking running daemons
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 14:42:25 +00:00
Snider
953a95f26f fix: address code review — HTTP client timeout, errors.Join, remove unused OnReload
- WaitForHealth: use http.Client with 2s timeout instead of DefaultClient
- Daemon.Stop: use errors.Join for proper error unwrapping
- Remove unused OnReload field from DaemonOptions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 14:19:10 +00:00
Snider
0696d32042 feat: add Daemon orchestrator for managed process lifecycle
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 14:01:40 +00:00