brainiac-basecamp 0.0.18 → 0.0.19
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e7d5fd8ee1c180d8083b77c3324d138678276d8bbc471dfa48c51d43ae0cca06
|
|
4
|
+
data.tar.gz: ec08e6a76392e28d5ef6b6a88adac7712bb60887eca9643d02227f556c7d472a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c82d88fd5a6cc8cf77330773b7eff552a3bfb7db291627ab0aef5dc3e8e178cee829389a0f72abd1938e4610c04878f3688e0963091a5361f6ae9dcea9f63b4c
|
|
7
|
+
data.tar.gz: 7ecb2081edefc0da28093bb5eb2b3cd26da316926349093bf51a36c7308073b5387279d3723a0a814c05f3a79dd7a4b17df07c7f479cc132f0fbeb75d5b64f88
|
|
@@ -522,7 +522,7 @@ module Brainiac
|
|
|
522
522
|
def resolve_project_from_fizzy_card(card_number)
|
|
523
523
|
return nil unless card_number
|
|
524
524
|
|
|
525
|
-
# Query the Fizzy card for its tags
|
|
525
|
+
# Query the Fizzy card for its tags and board
|
|
526
526
|
stdout, _, status = Open3.capture3("fizzy", "card", "show", card_number.to_s, "--json")
|
|
527
527
|
return nil unless status.success?
|
|
528
528
|
|
|
@@ -531,20 +531,43 @@ module Brainiac
|
|
|
531
531
|
card = card_data.is_a?(Hash) && card_data["data"] ? card_data["data"] : card_data
|
|
532
532
|
tags = card["tags"] || []
|
|
533
533
|
|
|
534
|
-
#
|
|
535
|
-
tag_names = tags.map { |t| t.is_a?(Hash) ? t["name"] : t.to_s }.map(&:downcase)
|
|
536
|
-
return nil if tag_names.empty?
|
|
537
|
-
|
|
538
|
-
# Load projects and match tags
|
|
534
|
+
# Load projects for matching
|
|
539
535
|
projects_file = File.join(BRAINIAC_DIR, "projects.json")
|
|
540
536
|
return nil unless File.exist?(projects_file)
|
|
541
537
|
|
|
542
538
|
all_projects = JSON.parse(File.read(projects_file))
|
|
543
539
|
|
|
544
|
-
#
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
540
|
+
# Priority 1: Match by card tags (same as fizzy handler)
|
|
541
|
+
tag_names = tags.map { |t| t.is_a?(Hash) ? t["name"] : t.to_s }.map(&:downcase)
|
|
542
|
+
unless tag_names.empty?
|
|
543
|
+
all_projects.each do |key, config|
|
|
544
|
+
project_tags = (config["tags"] || config["fizzy_tags"] || []).map(&:downcase)
|
|
545
|
+
return key if tag_names.intersect?(project_tags)
|
|
546
|
+
end
|
|
547
|
+
end
|
|
548
|
+
|
|
549
|
+
# Priority 2: Match by card's board → board_key → project with fizzy_board
|
|
550
|
+
# This mirrors the fizzy handler's fallback logic to prevent project mismatch
|
|
551
|
+
board_id = card.dig("board", "id")
|
|
552
|
+
if board_id
|
|
553
|
+
board_key = resolve_board_key_for_id(board_id)
|
|
554
|
+
if board_key
|
|
555
|
+
# Check for board's default_project in fizzy config
|
|
556
|
+
fizzy_config_file = File.join(BRAINIAC_DIR, "fizzy.json")
|
|
557
|
+
if File.exist?(fizzy_config_file)
|
|
558
|
+
fizzy_config = JSON.parse(File.read(fizzy_config_file))
|
|
559
|
+
board_config = fizzy_config.dig("boards", board_key)
|
|
560
|
+
if board_config && board_config["default_project"]
|
|
561
|
+
project_key = board_config["default_project"]
|
|
562
|
+
return project_key if all_projects.key?(project_key)
|
|
563
|
+
end
|
|
564
|
+
end
|
|
565
|
+
|
|
566
|
+
# Fall back to any project whose fizzy_board matches this board_key
|
|
567
|
+
all_projects.each do |key, config|
|
|
568
|
+
return key if config["fizzy_board"] == board_key
|
|
569
|
+
end
|
|
570
|
+
end
|
|
548
571
|
end
|
|
549
572
|
|
|
550
573
|
nil
|
|
@@ -553,6 +576,23 @@ module Brainiac
|
|
|
553
576
|
nil
|
|
554
577
|
end
|
|
555
578
|
|
|
579
|
+
# Resolve a fizzy board_key from a board_id by checking fizzy.json boards config.
|
|
580
|
+
def resolve_board_key_for_id(board_id)
|
|
581
|
+
fizzy_config_file = File.join(BRAINIAC_DIR, "fizzy.json")
|
|
582
|
+
return nil unless File.exist?(fizzy_config_file)
|
|
583
|
+
|
|
584
|
+
fizzy_config = JSON.parse(File.read(fizzy_config_file))
|
|
585
|
+
boards = fizzy_config["boards"] || {}
|
|
586
|
+
|
|
587
|
+
boards.each do |key, config|
|
|
588
|
+
return key if config["board_id"] == board_id
|
|
589
|
+
end
|
|
590
|
+
|
|
591
|
+
nil
|
|
592
|
+
rescue StandardError
|
|
593
|
+
nil
|
|
594
|
+
end
|
|
595
|
+
|
|
556
596
|
# Dispatch an agent to review the epic state after a task completes.
|
|
557
597
|
# This ensures the remaining plan still makes sense given implementation decisions.
|
|
558
598
|
# The callback is called after the review completes.
|