From 4f2eb4091dacda00f63c5d018c728ee5c4bc4146 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D7=A0=CF=85=CE=B1=CE=B7=20=D7=A0=CF=85=CE=B1=CE=B7=D1=95?= =?UTF-8?q?=CF=83=CE=B7?= Date: Sat, 15 Aug 2026 23:34:02 -0700 Subject: [PATCH] feat: require a suite to be named for its surface Applying the change removed the suite naming convention from four repositories while the capability did not state it. All five follow it: 506 of 506 public suites, and internal suites everywhere except integration smoke suites, which are a different thing. Resolves the open question by answering it with what applying showed. Co-Authored-By: Claude Opus 5 (1M context) --- .../changes/specify-go-code-standards/design.md | 8 +++++--- .../specs/go-code-standards/spec.md | 17 +++++++++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/openspec/changes/specify-go-code-standards/design.md b/openspec/changes/specify-go-code-standards/design.md index b082ae9..f447697 100644 --- a/openspec/changes/specify-go-code-standards/design.md +++ b/openspec/changes/specify-go-code-standards/design.md @@ -107,6 +107,8 @@ can be written. ## Open Questions -- Should the suite naming convention (`{Name}PublicTestSuite`) be a requirement? - All five follow it, but it is a naming detail rather than a structural rule, - and the capability is already long. +None. The suite naming convention was left open in the first draft and is now a +requirement — applying the change is what settled it. Removing the convention +from four repositories while the capability did not state it would have deleted +a rule all five follow, which answered the question more clearly than the +argument about whether the capability was already long enough. diff --git a/openspec/changes/specify-go-code-standards/specs/go-code-standards/spec.md b/openspec/changes/specify-go-code-standards/specs/go-code-standards/spec.md index 786ca4c..3e4c947 100644 --- a/openspec/changes/specify-go-code-standards/specs/go-code-standards/spec.md +++ b/openspec/changes/specify-go-code-standards/specs/go-code-standards/spec.md @@ -65,6 +65,23 @@ reach. - **WHEN** a behavior can be exercised through the exported surface - **THEN** the test does so, rather than reaching inside the package +### Requirement: A suite is named for the surface it tests + +A suite exercising the exported surface SHALL be named `{Name}PublicTestSuite`. +A suite exercising a package's internals SHALL be named `{Name}TestSuite`. + +The name states which surface the suite covers, so a reader knows without +opening the file whether it tests the package as a consumer sees it. + +A suite that is neither — an integration suite driving a built binary — is named +for what it drives rather than forced into this pair. + +#### Scenario: A reader looks for the tests of an exported function + +- **WHEN** a reader wants the tests covering a package's exported surface +- **THEN** the suite name identifies them, rather than requiring each file to be + opened + ### Requirement: Mocks are generated Where a test replaces an interface with a mock, the mock SHALL be generated by