brainiac-basecamp 0.0.23 → 0.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: afa545126394e953d63caa1cc6f70658f9c0c1333c77abb6a704230b72d6f8cb
4
- data.tar.gz: 1fe95fc5d1433efa9b0b526686da1349141de314d5de59c25073e0798d05af25
3
+ metadata.gz: 5c8050e48cf49fc743e8e1cf01db98abcb279fa7b8a2c70b99ee77cf2f331378
4
+ data.tar.gz: 0eb5638888a2369c61b1b0cc3bfed7c4729df1dc1ed2e14e56af69ca36280644
5
5
  SHA512:
6
- metadata.gz: e68209ddcbc0ff9a4f4889d68354f424638323b99ed5c252c870e55f848680ebc752b58b9b24f97ad20f5e9f4ad7c6a96ad8f18d645f48c7ef3d299a064dc460
7
- data.tar.gz: b94eee6029d0c89b60b4e6582af63164ac31035de1994f069c70f05afa98838443ae4380c47d21ef573d09664ff22bc3e896aab6e34f1c3b66e2225b50c94260
6
+ metadata.gz: 8aca50da9477027ff6800582dea934506a76897256eb4c91d8f2a9cfd8f27b3c786784a98410f487eb9c77d83924a74ee9ea9e753fe8d21c2f57c885afd7de30
7
+ data.tar.gz: c64f4de4ff526fa7c0a18149309b61a917b04f373ea02bc31855b752b9ce0ad820df9b040b90fe71d4fdcd2d5f7221e2ef5d3f297b6a90747cbe738b632f667f
@@ -732,6 +732,15 @@ module Brainiac
732
732
  epic["updated_at"] = Time.now.iso8601
733
733
  log_event(epic, "completed", "All tasks complete — epic finished!")
734
734
 
735
+ # Persist the completed status to disk IMMEDIATELY, before any slow
736
+ # network calls (opening final PRs, posting to Basecamp). Recovery
737
+ # reconciliation reads epics fresh from disk every 90s; if we defer
738
+ # the write until after those calls, an overlapping reconcile pass
739
+ # reads status="active", passes the guard above, and re-runs the
740
+ # whole completion flow — including the notification below. That's
741
+ # how the "Epic completed" Discord message fired repeatedly.
742
+ save_epic(epic)
743
+
735
744
  LOG.info "[Basecamp:Orchestrator] Epic '#{epic['title']}' completed!" if defined?(LOG)
736
745
 
737
746
  # If epic_branch mode, open final PRs to main
@@ -750,12 +759,20 @@ module Brainiac
750
759
  profile: epic["agent"]&.downcase
751
760
  )
752
761
 
753
- # Send notification (Discord or other configured channel)
754
- send_notification(
755
- event: :epic_completed,
756
- message: "🎉 Epic completed: **#{epic['title']}** (#{epic['tasks'].size} tasks)",
757
- agent: epic["agent"]
758
- )
762
+ # Send the completion notification at most once, ever. This is a
763
+ # belt-and-suspenders guard on top of the early status persistence
764
+ # above — even if two passes somehow race past the status check, the
765
+ # notification will only go out for the first one to reach here.
766
+ unless epic["completion_notified"]
767
+ epic["completion_notified"] = true
768
+ save_epic(epic)
769
+
770
+ send_notification(
771
+ event: :epic_completed,
772
+ message: "🎉 Epic completed: **#{epic['title']}** (#{epic['tasks'].size} tasks)",
773
+ agent: epic["agent"]
774
+ )
775
+ end
759
776
  end
760
777
 
761
778
  # Fetch todos from the epic's todolist.
@@ -3,7 +3,7 @@
3
3
  module Brainiac
4
4
  module Plugins
5
5
  module Basecamp
6
- VERSION = "0.0.23"
6
+ VERSION = "0.0.24"
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brainiac-basecamp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.23
4
+ version: 0.0.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Davis