brainiac-fizzy 0.0.19 → 0.0.21
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 +4 -4
- data/lib/brainiac/plugins/fizzy/delegators.rb +2 -2
- data/lib/brainiac/plugins/fizzy/handlers/assignment.rb +10 -7
- data/lib/brainiac/plugins/fizzy/handlers/comments.rb +10 -5
- data/lib/brainiac/plugins/fizzy/helpers.rb +2 -2
- data/lib/brainiac/plugins/fizzy/hooks.rb +5 -2
- data/lib/brainiac/plugins/fizzy/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e1056d8b7b4c49d9d894136c786cdcc06ac9afc2c99a4170c3853ba4fd5e00d6
|
|
4
|
+
data.tar.gz: fc14a297accc9f82468fc31ca9e3fe5ce450d42a3d5445fdda72cadf463862d5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9020ce620ad63e672f7649e073e42ac173f2209ade3096b1e155f83bee296b3f54cb5e048da57bee7acba8c2a46e6e215b1d80544f9b65d0f6073a560906a2bc
|
|
7
|
+
data.tar.gz: a871635aa26480877c983cdb352d6267a474cd8e970dbead96881c5f2e45f8b6bf77bc2b58c777dcc6ba64cca4327b21bf2d773c4210371e9733617b4160ba17
|
|
@@ -29,8 +29,8 @@ def fetch_intent_context(card_number, repo_path:, agent_name: nil)
|
|
|
29
29
|
Brainiac::Plugins::Fizzy::Helpers.fetch_intent_context(card_number, repo_path: repo_path, agent_name: agent_name)
|
|
30
30
|
end
|
|
31
31
|
|
|
32
|
-
def move_card_to_column(card_number, column_name, project_config:, agent_name: nil)
|
|
33
|
-
Brainiac::Plugins::Fizzy::Helpers.move_card_to_column(card_number, column_name, project_config: project_config, agent_name: agent_name)
|
|
32
|
+
def move_card_to_column(card_number, column_name, project_config:, agent_name: nil, board_key: nil)
|
|
33
|
+
Brainiac::Plugins::Fizzy::Helpers.move_card_to_column(card_number, column_name, project_config: project_config, agent_name: agent_name, board_key: board_key)
|
|
34
34
|
end
|
|
35
35
|
|
|
36
36
|
def append_fizzy_comment_footer(card_number, project_config:, agent_name: nil, since: nil)
|
|
@@ -44,7 +44,7 @@ def handle_card_assigned(payload, board_key: nil)
|
|
|
44
44
|
"creating worktree: #{branch} (model: #{detect_model(project_config, tags: tags) || "default"})"
|
|
45
45
|
|
|
46
46
|
react_to_assignment(card_number, repo_path, assigned_agent)
|
|
47
|
-
worktree_path = setup_assigned_worktree(repo_path, branch, card_internal_id, card_number, project_key, assigned_agent)
|
|
47
|
+
worktree_path = setup_assigned_worktree(repo_path, branch, card_internal_id, card_number, project_key, assigned_agent, board_key: board_key)
|
|
48
48
|
|
|
49
49
|
initial_cli = detect_cli_provider(tags: tags)
|
|
50
50
|
initial_model = detect_model(project_config, tags: tags)
|
|
@@ -62,7 +62,7 @@ def handle_card_assigned(payload, board_key: nil)
|
|
|
62
62
|
card_number: card_number, card_internal_id: card_internal_id, title: title, tags: tags,
|
|
63
63
|
branch: branch, worktree_path: worktree_path, project_config: project_config, project_key: project_key,
|
|
64
64
|
agent_name: assigned_agent, model: initial_model,
|
|
65
|
-
effort: initial_effort, cli_provider_override: initial_cli
|
|
65
|
+
effort: initial_effort, cli_provider_override: initial_cli, board_key: board_key
|
|
66
66
|
)
|
|
67
67
|
end
|
|
68
68
|
|
|
@@ -110,20 +110,23 @@ def react_to_assignment(card_number, repo_path, agent_name)
|
|
|
110
110
|
end
|
|
111
111
|
end
|
|
112
112
|
|
|
113
|
-
def setup_assigned_worktree(repo_path, branch, card_internal_id, card_number, project_key, agent_name)
|
|
113
|
+
def setup_assigned_worktree(repo_path, branch, card_internal_id, card_number, project_key, agent_name, board_key: nil)
|
|
114
114
|
debounced_repo_fetch(repo_path)
|
|
115
115
|
worktree_path = File.join(File.dirname(repo_path), "#{File.basename(repo_path)}--#{branch}")
|
|
116
116
|
worktree_path = create_or_reuse_worktree(repo_path: repo_path, branch: branch, worktree_path: worktree_path)
|
|
117
117
|
|
|
118
|
+
source_data = { "card_internal_id" => card_internal_id, "card_number" => card_number }
|
|
119
|
+
source_data["board_key"] = board_key if board_key
|
|
120
|
+
|
|
118
121
|
register_work_item(
|
|
119
122
|
branch: branch, worktree: worktree_path, project: project_key, agent: agent_name,
|
|
120
|
-
source: :fizzy, source_data:
|
|
123
|
+
source: :fizzy, source_data: source_data
|
|
121
124
|
)
|
|
122
125
|
worktree_path
|
|
123
126
|
end
|
|
124
127
|
|
|
125
128
|
def dispatch_assigned_card(card_number:, card_internal_id:, title:, tags:, branch:, worktree_path:,
|
|
126
|
-
project_config:, project_key:, agent_name:, model:, effort:, cli_provider_override:)
|
|
129
|
+
project_config:, project_key:, agent_name:, model:, effort:, cli_provider_override:, board_key: nil)
|
|
127
130
|
card_context = prefetch_card_context(card_number, repo_path: project_config["repo_path"], agent_name: agent_name)
|
|
128
131
|
planning_info = detect_planning_mode(text: title, tags: tags, card_internal_id: card_internal_id, card_number: card_number)
|
|
129
132
|
|
|
@@ -152,11 +155,11 @@ def dispatch_assigned_card(card_number:, card_internal_id:, title:, tags:, branc
|
|
|
152
155
|
project_config: project_config, chdir: worktree_path,
|
|
153
156
|
log_name: "assigned-#{card_number}", model: model, effort: effort,
|
|
154
157
|
agent_name: agent_name, card_number: card_number, source: :fizzy,
|
|
155
|
-
source_context: { card_number: card_number, dispatched_at: Time.now },
|
|
158
|
+
source_context: { card_number: card_number, board_key: board_key, dispatched_at: Time.now },
|
|
156
159
|
cli_provider: cli_provider_override)
|
|
157
160
|
register_session(card_key, pid, log_file: log_file, supersede_key: card_key, agent_name: agent_name)
|
|
158
161
|
|
|
159
|
-
Thread.new { move_card_to_column(card_number, "right_now", project_config: project_config, agent_name: agent_name) }
|
|
162
|
+
Thread.new { move_card_to_column(card_number, "right_now", project_config: project_config, agent_name: agent_name, board_key: board_key) }
|
|
160
163
|
|
|
161
164
|
[200, { status: "processed", card: card_number, branch: branch, project: project_key, agent: agent_name }.to_json]
|
|
162
165
|
end
|
|
@@ -18,6 +18,7 @@ CommentContext = Struct.new(
|
|
|
18
18
|
:project_config, :project_key, :card_number, :worktree,
|
|
19
19
|
:model, :effort, :deploy_intent, :cli_provider_override,
|
|
20
20
|
:comment_vars, :card_tags, :worktree_override, :fresh,
|
|
21
|
+
:board_key,
|
|
21
22
|
keyword_init: true
|
|
22
23
|
)
|
|
23
24
|
|
|
@@ -67,7 +68,7 @@ def handle_comment(payload, board_key: nil)
|
|
|
67
68
|
card_info: card_info, comment_id: comment_id, creator_name: creator_name,
|
|
68
69
|
creator_is_agent: creator_is_agent, mentioned_agent: mentioned_agent,
|
|
69
70
|
agent_name: agent_name, is_cross_agent_mention: is_cross_agent_mention,
|
|
70
|
-
project_config: project_config, project_key: project_key
|
|
71
|
+
project_config: project_config, project_key: project_key, board_key: board_key
|
|
71
72
|
)
|
|
72
73
|
|
|
73
74
|
# --- Intent gate (mirrors brainiac-discord pattern) ---
|
|
@@ -101,7 +102,7 @@ end
|
|
|
101
102
|
|
|
102
103
|
def build_comment_context(eventable:, plain_text:, tags:, card_internal_id:, card_info:, comment_id:, creator_name:,
|
|
103
104
|
creator_is_agent:, mentioned_agent:, agent_name:, is_cross_agent_mention:,
|
|
104
|
-
project_config:, project_key:)
|
|
105
|
+
project_config:, project_key:, board_key: nil)
|
|
105
106
|
deploy_intent = tags[:deploy_intent]
|
|
106
107
|
LOG.info "[Deploy] Detected [deploy#{":#{deploy_intent}" unless deploy_intent == :auto}] tag on card #{card_internal_id}" if deploy_intent
|
|
107
108
|
|
|
@@ -137,6 +138,7 @@ def build_comment_context(eventable:, plain_text:, tags:, card_internal_id:, car
|
|
|
137
138
|
creator_is_agent: creator_is_agent, mentioned_agent: mentioned_agent,
|
|
138
139
|
agent_name: agent_name, is_cross_agent_mention: is_cross_agent_mention,
|
|
139
140
|
project_config: project_config, project_key: project_key,
|
|
141
|
+
board_key: board_key,
|
|
140
142
|
model: effective_model,
|
|
141
143
|
effort: effective_effort,
|
|
142
144
|
deploy_intent: deploy_intent,
|
|
@@ -497,9 +499,12 @@ def setup_new_mention_worktree(ctx, card_number, card_title)
|
|
|
497
499
|
repo_path = ctx.project_config["repo_path"]
|
|
498
500
|
worktree_path, branch = resolve_or_create_worktree(ctx, card_number, card_title, repo_path)
|
|
499
501
|
|
|
502
|
+
source_data = { "card_internal_id" => ctx.card_internal_id, "card_number" => card_number }
|
|
503
|
+
source_data["board_key"] = ctx.board_key if ctx.board_key
|
|
504
|
+
|
|
500
505
|
register_work_item(
|
|
501
506
|
branch: branch, worktree: worktree_path, project: ctx.project_key, agent: ctx.agent_name,
|
|
502
|
-
source: :fizzy, source_data:
|
|
507
|
+
source: :fizzy, source_data: source_data
|
|
503
508
|
)
|
|
504
509
|
|
|
505
510
|
[worktree_path, branch]
|
|
@@ -554,13 +559,13 @@ def dispatch_followup_comment(ctx, card_key:, card_number:, work_dir:)
|
|
|
554
559
|
source: :fizzy, cli_provider: ctx.cli_provider_override, resume: should_resume,
|
|
555
560
|
source_context: {
|
|
556
561
|
card_number: card_number, card_internal_id: ctx.card_internal_id,
|
|
557
|
-
deploy_intent: ctx.deploy_intent, dispatched_at: Time.now
|
|
562
|
+
deploy_intent: ctx.deploy_intent, board_key: ctx.board_key, dispatched_at: Time.now
|
|
558
563
|
})
|
|
559
564
|
return [200, { status: "dispatch_failed", agent: ctx.agent_name, card: card_number }.to_json] unless pid
|
|
560
565
|
|
|
561
566
|
register_session(card_key, pid, log_file: log_file, supersede_key: card_key, agent_name: ctx.agent_name)
|
|
562
567
|
|
|
563
|
-
Thread.new { move_card_to_column(card_number, "right_now", project_config: ctx.project_config, agent_name: ctx.agent_name) }
|
|
568
|
+
Thread.new { move_card_to_column(card_number, "right_now", project_config: ctx.project_config, agent_name: ctx.agent_name, board_key: ctx.board_key) }
|
|
564
569
|
|
|
565
570
|
{ status: "follow_up", card: card_number, card_internal_id: ctx.card_internal_id,
|
|
566
571
|
worktree: work_dir, project: ctx.project_key }
|
|
@@ -92,8 +92,8 @@ module Brainiac
|
|
|
92
92
|
nil
|
|
93
93
|
end
|
|
94
94
|
|
|
95
|
-
def move_card_to_column(card_number, column_name, project_config:, agent_name: nil)
|
|
96
|
-
board_key
|
|
95
|
+
def move_card_to_column(card_number, column_name, project_config:, agent_name: nil, board_key: nil)
|
|
96
|
+
board_key ||= Config.board_key_for_project(project_config)
|
|
97
97
|
column_id = Config.board_column_id(board_key, column_name) if board_key
|
|
98
98
|
return unless column_id
|
|
99
99
|
|
|
@@ -38,7 +38,8 @@ module Brainiac
|
|
|
38
38
|
unless ctx[:skip_column_move] || work_item_merged?(card_number)
|
|
39
39
|
Helpers.move_card_to_column(card_number, "needs_review",
|
|
40
40
|
project_config: ctx[:project_config],
|
|
41
|
-
agent_name: ctx[:agent_name]
|
|
41
|
+
agent_name: ctx[:agent_name],
|
|
42
|
+
board_key: ctx[:source_context]&.dig(:board_key))
|
|
42
43
|
record_self_move(card_number)
|
|
43
44
|
end
|
|
44
45
|
|
|
@@ -129,6 +130,7 @@ module Brainiac
|
|
|
129
130
|
card_agent = card_info["agent"]
|
|
130
131
|
env = Helpers.fizzy_env_for(card_agent)
|
|
131
132
|
repo_path = ctx[:repo_path]
|
|
133
|
+
board_key = card_info.dig("sources", "fizzy", "board_key") || Config.board_key_for_project(ctx[:project_config])
|
|
132
134
|
|
|
133
135
|
# Post PR link comment
|
|
134
136
|
pr_url = ctx[:pr_url]
|
|
@@ -142,7 +144,8 @@ module Brainiac
|
|
|
142
144
|
# Move card to UAT
|
|
143
145
|
Helpers.move_card_to_column(card_number, "uat",
|
|
144
146
|
project_config: ctx[:project_config],
|
|
145
|
-
agent_name: card_agent
|
|
147
|
+
agent_name: card_agent,
|
|
148
|
+
board_key: board_key)
|
|
146
149
|
record_self_move(card_number)
|
|
147
150
|
|
|
148
151
|
# Clear deployment tracking
|