From 4b250ba9298f13d5d2bba19b20c3369840654f73 Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Mon, 14 Sep 2026 08:09:14 +0000 Subject: [PATCH] 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. --- internal/plugin/architecture_test.go | 29 ---------------------------- 1 file changed, 29 deletions(-) diff --git a/internal/plugin/architecture_test.go b/internal/plugin/architecture_test.go index ae61fbcbe..485f58329 100644 --- a/internal/plugin/architecture_test.go +++ b/internal/plugin/architecture_test.go @@ -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) -}