test(plugin): stop asserting documentation prose in a test

TestPluginEngineRuleIsCanonicalAndSharedByAgentInstructions read
ARCHITECTURE.md and CLAUDE.md and failed if their prose did not contain a
particular heading and link. That is not a behaviour check: it makes an
agent-instruction file load-bearing for the build, so editing documentation
can break compilation of the test suite, and a doc drift becomes a red gate
that says nothing about the code.

The genuine invariant -- that an engine family has one owner that both
registers and resolves it -- is asserted on the AST by
TestEngineFamilyInspectionRejectsInvalidShapes, which is untouched.

Removes the readTestFile helper it was the only caller of.
This commit is contained in:
sam committed 2026-09-14 08:09:14 +00:00
1 parent fa8b608c1f
commit 4b250ba929
1 file changed
-29
-29
View File
@@ -5,32 +5,12 @@ import (
"go/parser"
"go/token"
"maps"
"os"
"path/filepath"
"slices"
"strings"
"testing"
)
const (
engineRuleHeading = "## Plugin engine rule (strict)"
engineRuleLink = "ARCHITECTURE.md#plugin-engine-rule-strict"
)
func TestPluginEngineRuleIsCanonicalAndSharedByAgentInstructions(t *testing.T) {
t.Parallel()
architecture := readTestFile(t, filepath.Join("..", "..", "ARCHITECTURE.md"))
if !strings.Contains(architecture, engineRuleHeading) {
t.Fatalf("ARCHITECTURE.md missing canonical heading %q", engineRuleHeading)
}
claudeMD := readTestFile(t, filepath.Join("..", "..", "CLAUDE.md"))
if !strings.Contains(claudeMD, engineRuleLink) {
t.Fatalf("CLAUDE.md missing reference to %q", engineRuleLink)
}
}
func TestEngineFamilyInspectionRejectsInvalidShapes(t *testing.T) {
t.Parallel()
@@ -318,12 +298,3 @@ func expressionNamesType(expr ast.Expr, typeName string) bool {
ident, ok := expr.(*ast.Ident)
return ok && ident.Name == typeName
}
func readTestFile(t *testing.T, path string) string {
t.Helper()
data, err := os.ReadFile(path)
if err != nil {
t.Fatalf("read %s: %v", path, err)
}
return string(data)
}