From ba72f3e408440ba7a07220d6ce0e1f09d382dac8 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 2 Apr 2026 17:54:37 +0100 Subject: [PATCH] ax(mining): replace implementation-describing comment with call-site example on saveUnlocked AX Principle 2: comments show HOW to call, not WHAT the body does. The old comment restated the lock/defer mechanics; the new comment shows the caller context (Save and Update) so an agent knows when saveUnlocked is the right call. Co-Authored-By: Charon --- pkg/mining/repository.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/mining/repository.go b/pkg/mining/repository.go index bb8bbd2..23abcdb 100644 --- a/pkg/mining/repository.go +++ b/pkg/mining/repository.go @@ -83,7 +83,7 @@ func (r *FileRepository[T]) Save(data T) error { return r.saveUnlocked(data) } -// r.mutex.Lock(); defer r.mutex.Unlock(); return r.saveUnlocked(data) +// return r.saveUnlocked(data) // called by Save and Update while mutex is held func (r *FileRepository[T]) saveUnlocked(data T) error { dir := filepath.Dir(r.path) if err := os.MkdirAll(dir, 0755); err != nil {