picoclaw/pkg/evolution
程智超0668000959 bbdf746bcb fix(evolution): use CompareAndSwap for atomic lockStoreFile repair
Replace the Delete+LoadOrStore pattern with CompareAndSwap to
atomically swap in a fresh mutex when a corrupted entry is detected.

Changes:
- Use a retry loop with CAS instead of Delete+LoadOrStore, avoiding
  the race where two goroutines could create different mutexes
- Add nil check: a nil *sync.Mutex passes the type assertion but
  panics on Lock() — now handled by the CAS recovery path
- Use continue-loop retry instead of unchecked second assertion

CompareAndSwap guarantees that when multiple goroutines detect a
corrupted entry, they converge on the same replacement mutex.
2026-06-12 11:25:14 +08:00
..
apply.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
apply_test.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
case_writer.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
case_writer_test.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
cold_path_runner.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
cold_path_runner_test.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
draft_review.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
draft_review_test.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
drafts.go fix: handle os.Getwd error in evolution skills_recall and drafts 2026-06-07 21:05:16 +08:00
drafts_test.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
generator_factory.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
lifecycle.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
lifecycle_actions_test.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
lifecycle_test.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
llm_draft_generator.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
llm_draft_generator_test.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
llm_timeout.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
organizer.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
organizer_test.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
paths.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
paths_test.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
pattern_clusterer.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
pattern_clusterer_test.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
preview.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
preview_test.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
profile_sync.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
record_kinds.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
runtime.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
runtime_apply_test.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
runtime_cold_path_test.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
runtime_test.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
skill_content.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
skill_draft_policy.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
skills_recall.go fix: handle os.Getwd error in evolution skills_recall and drafts 2026-06-07 21:05:16 +08:00
skills_recall_test.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
store.go fix(evolution): use CompareAndSwap for atomic lockStoreFile repair 2026-06-12 11:25:14 +08:00
store_test.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
success_judge.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00
types.go feat: agent self evolution (#2847) 2026-05-11 16:13:27 +08:00