Commit graph

58 commits

Author SHA1 Message Date
Virgil
fa79e4eee7 fix(process): guard program run inputs 2026-04-04 00:18:14 +00:00
Virgil
214cf4cfa8 feat(process): expose health probe failure reasons
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-04 00:15:20 +00:00
Virgil
5142114e89 feat(process): rollback daemon startup on registry failure 2026-04-04 00:11:21 +00:00
Virgil
84d07daf19 feat(process): relax runner success semantics 2026-04-04 00:07:48 +00:00
Virgil
2bc6eb70d7 fix(process): copy info slices defensively 2026-04-04 00:04:54 +00:00
Virgil
f5a940facd feat(process): add running flag to process info 2026-04-04 00:01:22 +00:00
Virgil
9b536f08c6 feat(exec): require command context 2026-04-03 23:56:56 +00:00
Virgil
e58f376e4c feat(process): signal process groups 2026-04-03 23:53:19 +00:00
Virgil
252f68db64 feat(process): forward task run options 2026-04-03 23:50:52 +00:00
Virgil
1b7431e3a0 feat(process): skip unresolved pipeline specs 2026-04-03 23:47:38 +00:00
Virgil
6fda03d64d feat(process): fail invalid runner dependencies 2026-04-03 23:45:06 +00:00
Virgil
9457694e46 feat(process): preserve runner result order 2026-04-03 23:41:36 +00:00
Virgil
dcf058047e feat(process): emit exit actions consistently 2026-04-03 23:37:48 +00:00
Virgil
f70e301631 feat(process): validate KillGroup requires Detach 2026-04-03 23:34:16 +00:00
Virgil
87bebd7fa6 feat(exec): add background command support 2026-04-03 23:27:27 +00:00
Virgil
62e7bd7814 Fix runner deadlock handling 2026-04-03 23:22:43 +00:00
Virgil
b6530cf85d feat(process): track killed process lifecycle 2026-04-03 23:20:28 +00:00
Virgil
0546b42ce3 feat(process): add Core task for run execution 2026-04-03 23:17:11 +00:00
206b9a1f52 Merge pull request 'chore: update dependencies to dappco.re tagged versions' (#8) from dev into main
Reviewed-on: #8
2026-03-23 20:35:28 +00:00
Claude
61867e56bb
chore: update dependencies to dappco.re tagged versions
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 01:10:19 +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