Extract Grammaratur, Dregarnuhr, Geduldh, Mestionora, Ordoschnellic, Schutzaria, Kunstzeal and Seheweit behind compatible application contracts. Include accumulated editor resilience, navigation and theme UX, remote CLI, storage/schema and DR groundwork, tests and design/operations documentation. Verified: uncached full Go suite; go vet ./...; race tests for all eight components; 11 targeted Chromium tests; Node suites; 19 Python CLI tests; reproducible editor build. No push, release tag or deployment in this checkpoint.
41 lines
946 B
Go
41 lines
946 B
Go
package grammaratur
|
|
|
|
import (
|
|
"go/parser"
|
|
"go/token"
|
|
"path/filepath"
|
|
"strconv"
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestComponentBoundary(t *testing.T) {
|
|
if Component != "grammaratur" {
|
|
t.Fatal("component identity changed")
|
|
}
|
|
files, err := filepath.Glob("*.go")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
for _, file := range files {
|
|
if strings.HasSuffix(file, "_test.go") {
|
|
continue
|
|
}
|
|
ast, err := parser.ParseFile(token.NewFileSet(), file, nil, parser.ImportsOnly)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
for _, spec := range ast.Imports {
|
|
path, err := strconv.Unquote(spec.Path.Value)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
for _, forbidden := range []string{"pageswiki/internal/", "database/", "net", "os"} {
|
|
if path == forbidden || strings.HasPrefix(path, strings.TrimSuffix(forbidden, "/")+"/") {
|
|
t.Errorf("%s imports %s: Grammaratur must not own I/O, persistence or application policy", file, path)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|