Files
archie/internal/infrastructure/agenttransport/nats/architecture_test.go
T
sam d28ca099c5 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.
2026-08-15 00:43:12 +10:00

36 lines
708 B
Go

package nats
import (
"go/parser"
"go/token"
"path/filepath"
"strconv"
"strings"
"testing"
)
func TestInfrastructureDoesNotImportApplication(t *testing.T) {
files, err := filepath.Glob("*.go")
if err != nil {
t.Fatal(err)
}
for _, path := range files {
if strings.HasSuffix(path, "_test.go") {
continue
}
file, err := parser.ParseFile(token.NewFileSet(), path, nil, parser.ImportsOnly)
if err != nil {
t.Fatal(err)
}
for _, imported := range file.Imports {
name, err := strconv.Unquote(imported.Path.Value)
if err != nil {
t.Fatal(err)
}
if strings.Contains(name, "/internal/app/") {
t.Errorf("%s imports application package %q", path, name)
}
}
}
}