Files
archie/internal/infrastructure/taskactions/service.go
T
sam dbaa7284a3 feat(taskactions): archive reaps the task's worktree; cleanup test models a completed run
A worktree terminal cleanup keeps (uncaptured or unreadable work) now has a
reap path: archiving calls Daemon.RemoveWorktree for the owning identity's
trees, and the keep logs name archive as the way out. The no-change cleanup
test reports completed through one direct transition instead of reaching
merged via a faked pr_open hop.
2026-09-27 13:38:12 +10:00

35 lines
1017 B
Go

package taskactions
import (
"context"
"github.com/samcharles93/archie-core/internal/domain/taskactions"
"github.com/samcharles93/archie-core/internal/events"
)
// NewService assembles the operator task-action service from its production
// dependencies. Both the dashboard's in-process service (webui) and the
// daemon's NATS responder build through this one constructor so the two
// surfaces cannot diverge.
func NewService(
store taskactions.Store,
maxRetries func(*taskactions.Task) int,
cancel func(int64) bool,
closeIssue func(context.Context, string, string, int, string) error,
removeLogs func(int64) error,
removeWorktree func(*taskactions.Task) error,
publish func(events.Event),
warn func(string, ...any),
) taskactions.Service {
return taskactions.Service{
Store: store,
MaxRetries: maxRetries,
CancelTask: cancel,
CloseIssue: closeIssue,
RemoveLogs: removeLogs,
RemoveWorktree: removeWorktree,
Publish: publish,
Warn: warn,
}
}