refactor(agent): move worker runtime into application layer

cmd/archie-agent used to own worker construction, NATS lifecycle, task execution, MCP setup, and workflow wiring. It now owns process input only and invokes internal/app/agentworker, while transport-specific NATS, boot-brief, and git-safety mechanics live under infrastructure.
This commit is contained in:
sam committed 2026-08-15 00:43:12 +10:00
1 parent 0243c13d37
commit 45345cdfb6
35 files changed
+2901 -689

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
package agentexec
import "context"
// StageMessage is one decoded single-stage request together with the transport
// operations that complete its delivery. Infrastructure owns the wire payload,
// reply inbox, and acknowledgement mechanism; the worker only sees typed data.
type StageMessage interface {
Request() (AgentRequestMessage, error)
Respond(context.Context, *AgentResponseEnvelope) error
Ack() error
Nak() error
LogAttributes() []any
}
// StageConsumer receives decoded single-stage requests.
type StageConsumer interface {
FetchStage(context.Context) (StageMessage, error)
}
+1 -1
View File
@@ -37,7 +37,7 @@ func (f *fakePublisher) calls() int {
}
// capturingHandler is a minimal slog.Handler that records every record it
// receives, standing in for cmd/archie-agent's real stderr handler.
// receives, standing in for the agentworker's wrapped process stderr handler.
type capturingHandler struct {
mu sync.Mutex
records []slog.Record