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

+20 -6
View File
@@ -50,6 +50,26 @@ func TestRequestJSONRoundTrip(t *testing.T) {
}
}
func TestRequestValidateRequiresPositiveTaskID(t *testing.T) {
for _, test := range []struct {
name string
request Request
wantErr bool
}{
{name: "missing task", wantErr: true},
{name: "zero ID", request: Request{Task: &store.Task{}}, wantErr: true},
{name: "negative ID", request: Request{Task: &store.Task{ID: -1}}, wantErr: true},
{name: "positive ID", request: Request{Task: &store.Task{ID: 1}}},
} {
t.Run(test.name, func(t *testing.T) {
err := test.request.Validate()
if (err != nil) != test.wantErr {
t.Fatalf("Validate() error = %v, wantErr %v", err, test.wantErr)
}
})
}
}
func TestResponseJSONRoundTrip(t *testing.T) {
resp := Response{
Task: &store.Task{ID: 1, Status: store.StatusPROpen},
@@ -67,9 +87,3 @@ func TestResponseJSONRoundTrip(t *testing.T) {
t.Fatalf("Response did not round-trip: %+v", got)
}
}
func TestSubjectForTask(t *testing.T) {
if got := SubjectForTask(42); got != "archie.taskrun.42" {
t.Fatalf("SubjectForTask(42) = %q", got)
}
}