From 676f3f3daf5b33ec2ca3cc2c08ac74bb60851c67 Mon Sep 17 00:00:00 2001 From: AlexisLeDain Date: Wed, 4 Nov 2026 09:42:54 +0100 Subject: [PATCH] docs: exempt deliberate boundaries from the second-caller rule As written, the bullet banned any interface with a single implementation, which contradicts the Repository Pattern in rules/common/patterns.md: it requires business logic to depend on an abstract repository interface, and a project backed by one database has exactly one implementation. Scope the rule to speculative abstractions and name the exemption, so the two files in rules/common/ no longer give opposite instructions. --- rules/common/coding-style.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/rules/common/coding-style.md b/rules/common/coding-style.md index fd6345a87..dd947d89e 100644 --- a/rules/common/coding-style.md +++ b/rules/common/coding-style.md @@ -31,9 +31,11 @@ Rationale: Immutable data prevents hidden side effects, makes debugging easier, - Do not build features or abstractions before they are needed - Avoid speculative generality - Start simple, then refactor when the pressure is real -- No abstraction before the second caller: no interface with a single - implementation, no factory for one product, no config option for a value - that never varies +- No speculative abstraction before the second caller: no interface extracted + from a single implementation, no factory for one product, no config option + for a value that never varies. A deliberate boundary is not speculative: a + repository interface that isolates business logic from storage (see + `patterns.md`) earns its place at the first implementation ## File Organization