brainiac-fizzy 0.0.3 → 0.0.6
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/config.rb +13 -6
- data/lib/brainiac/plugins/fizzy/handlers/assignment.rb +23 -17
- data/lib/brainiac/plugins/fizzy/handlers/comments.rb +17 -8
- data/lib/brainiac/plugins/fizzy/prompts.rb +4 -1
- data/lib/brainiac/plugins/fizzy/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5dfaa99b356a363fb94b38d0cf20ea4fba925c1c6d0fb13221ccc64840afca5d
|
|
4
|
+
data.tar.gz: 40aa72b55cdf6b2a84b1cdf9a710d566b91944fee0b8100918de3624ecb1876d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: da41d82eb50619c9d06687721a79aaa3c0822f74b86d6af0a7056c38a468869dbd3dc6ff7f9ba16ac2479932997278f94aa2712483a0495da1dabe00c2b5662f
|
|
7
|
+
data.tar.gz: 5c25257f66640dd2eae653874ae6a983129ec23215e9e396045433934fb2ff923c540f88d875e00bfab7996add7d3307aab303581df6d611c059e82480204792
|
|
@@ -63,15 +63,22 @@ module Brainiac
|
|
|
63
63
|
end
|
|
64
64
|
|
|
65
65
|
def board_key_for_project(project_config)
|
|
66
|
+
# Priority 1: explicit fizzy_board in project config (board key name from fizzy.json)
|
|
67
|
+
board_key = project_config["fizzy_board"]
|
|
68
|
+
return board_key if board_key && @boards.key?(board_key)
|
|
69
|
+
|
|
70
|
+
# Priority 2: .fizzy.yaml in the repo directory
|
|
66
71
|
fizzy_yaml = File.join(project_config["repo_path"], ".fizzy.yaml")
|
|
67
|
-
|
|
72
|
+
if File.exist?(fizzy_yaml)
|
|
73
|
+
require "yaml"
|
|
74
|
+
data = YAML.safe_load_file(fizzy_yaml)
|
|
75
|
+
board_id = data["board"]
|
|
76
|
+
return board_key_for_id(board_id)
|
|
77
|
+
end
|
|
68
78
|
|
|
69
|
-
|
|
70
|
-
data = YAML.safe_load_file(fizzy_yaml)
|
|
71
|
-
board_id = data["board"]
|
|
72
|
-
board_key_for_id(board_id)
|
|
79
|
+
nil
|
|
73
80
|
rescue StandardError => e
|
|
74
|
-
LOG.warn "[Fizzy] Could not
|
|
81
|
+
LOG.warn "[Fizzy] Could not resolve board for project: #{e.message}" if defined?(LOG)
|
|
75
82
|
nil
|
|
76
83
|
end
|
|
77
84
|
|
|
@@ -67,28 +67,34 @@ end
|
|
|
67
67
|
|
|
68
68
|
def react_to_assignment(card_number, repo_path, agent_name)
|
|
69
69
|
Thread.new do
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
if
|
|
82
|
-
|
|
83
|
-
|
|
70
|
+
env = fizzy_env_for(agent_name)
|
|
71
|
+
|
|
72
|
+
# Best-effort cleanup of existing reactions from this agent
|
|
73
|
+
begin
|
|
74
|
+
result = run_cmd("fizzy", "reaction", "list", "--card", card_number.to_s,
|
|
75
|
+
chdir: repo_path, env: env)
|
|
76
|
+
reactions = JSON.parse(result)["data"] || []
|
|
77
|
+
|
|
78
|
+
identity_output = run_cmd("fizzy", "identity", "show", chdir: repo_path, env: env)
|
|
79
|
+
current_user_id = JSON.parse(identity_output).dig("data", "accounts", 0, "user", "id")
|
|
80
|
+
|
|
81
|
+
if current_user_id
|
|
82
|
+
reactions.each do |reaction|
|
|
83
|
+
if reaction.dig("reacter", "id") == current_user_id
|
|
84
|
+
run_cmd("fizzy", "reaction", "delete", reaction["id"], "--card", card_number.to_s,
|
|
85
|
+
chdir: repo_path, env: env)
|
|
86
|
+
end
|
|
87
|
+
end
|
|
84
88
|
end
|
|
89
|
+
rescue StandardError => e
|
|
90
|
+
LOG.warn "Could not clean up existing reactions on card ##{card_number}: #{e.message}"
|
|
85
91
|
end
|
|
86
92
|
|
|
87
|
-
#
|
|
93
|
+
# Always attempt to add the reaction even if cleanup failed
|
|
88
94
|
run_cmd("fizzy", "reaction", "create", "--card", card_number.to_s,
|
|
89
|
-
"--content", "
|
|
95
|
+
"--content", "👀", chdir: repo_path, env: env)
|
|
90
96
|
rescue StandardError => e
|
|
91
|
-
LOG.warn "Could not add reaction to card: #{e.message}"
|
|
97
|
+
LOG.warn "Could not add reaction to card ##{card_number}: #{e.message}"
|
|
92
98
|
end
|
|
93
99
|
end
|
|
94
100
|
|
|
@@ -370,7 +370,10 @@ def dispatch_cross_agent_review(ctx, card_key:, card_number:, card_assigned_agen
|
|
|
370
370
|
model: ctx.model, effort: ctx.effort, agent_name: ctx.agent_name,
|
|
371
371
|
card_number: card_number, comment_id: ctx.comment_id,
|
|
372
372
|
source: :fizzy, source_context: { card_number: card_number },
|
|
373
|
-
cli_provider: ctx.cli_provider_override
|
|
373
|
+
cli_provider: ctx.cli_provider_override,
|
|
374
|
+
message: ctx.plain_text, channel: "Fizzy comment")
|
|
375
|
+
return [200, { status: "intent_skip", agent: ctx.agent_name, card: card_number }.to_json] unless pid
|
|
376
|
+
|
|
374
377
|
register_session(card_key, pid, log_file: log_file, supersede_key: card_key, agent_name: ctx.agent_name)
|
|
375
378
|
|
|
376
379
|
[200, { status: "cross_agent_review", agent: ctx.agent_name, card_agent: card_assigned_agent,
|
|
@@ -475,7 +478,10 @@ def dispatch_new_mention(ctx, card_key:, card_number:, card_title:, branch:, wor
|
|
|
475
478
|
model: ctx.model, effort: ctx.effort, agent_name: ctx.agent_name,
|
|
476
479
|
card_number: card_number, comment_id: ctx.comment_id,
|
|
477
480
|
source: :fizzy, cli_provider: ctx.cli_provider_override,
|
|
478
|
-
source_context: { card_number: card_number }
|
|
481
|
+
source_context: { card_number: card_number },
|
|
482
|
+
message: ctx.plain_text, channel: "Fizzy comment")
|
|
483
|
+
return [200, { status: "intent_skip", agent: ctx.agent_name, card: card_number }.to_json] unless pid
|
|
484
|
+
|
|
479
485
|
register_session(card_key, pid, log_file: log_file, supersede_key: card_key, agent_name: ctx.agent_name)
|
|
480
486
|
|
|
481
487
|
[200, { status: "responded", card_internal_id: ctx.card_internal_id, card_number: card_number,
|
|
@@ -488,10 +494,10 @@ def dispatch_followup_comment(ctx, card_key:, card_number:, work_dir:)
|
|
|
488
494
|
effort = detect_effort(ctx.project_config, tags: card_tags, text: ctx.plain_text)
|
|
489
495
|
|
|
490
496
|
is_worktree = work_dir != ctx.project_config["repo_path"]
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
497
|
+
should_resume = is_worktree && resume_viable?(
|
|
498
|
+
project_config: ctx.project_config, cli_provider: ctx.cli_provider_override,
|
|
499
|
+
agent_name: ctx.agent_name, chdir: work_dir
|
|
500
|
+
)
|
|
495
501
|
|
|
496
502
|
prompt = if should_resume
|
|
497
503
|
LOG.info "[Resume] Using lean prompt for follow-up on card #{card_number || ctx.card_internal_id}"
|
|
@@ -508,11 +514,14 @@ def dispatch_followup_comment(ctx, card_key:, card_number:, work_dir:)
|
|
|
508
514
|
log_name: "followup-#{card_number || ctx.card_internal_id}",
|
|
509
515
|
model: ctx.model, effort: effort, agent_name: ctx.agent_name,
|
|
510
516
|
card_number: card_number, comment_id: ctx.comment_id,
|
|
511
|
-
source: :fizzy, cli_provider: ctx.cli_provider_override, resume:
|
|
517
|
+
source: :fizzy, cli_provider: ctx.cli_provider_override, resume: should_resume,
|
|
512
518
|
source_context: {
|
|
513
519
|
card_number: card_number, card_internal_id: ctx.card_internal_id,
|
|
514
520
|
deploy_intent: ctx.deploy_intent
|
|
515
|
-
}
|
|
521
|
+
},
|
|
522
|
+
message: ctx.plain_text, channel: "Fizzy comment")
|
|
523
|
+
return [200, { status: "intent_skip", agent: ctx.agent_name, card: card_number }.to_json] unless pid
|
|
524
|
+
|
|
516
525
|
register_session(card_key, pid, log_file: log_file, supersede_key: card_key, agent_name: ctx.agent_name)
|
|
517
526
|
|
|
518
527
|
Thread.new { move_card_to_column(card_number, "right_now", project_config: ctx.project_config, agent_name: ctx.agent_name) }
|
|
@@ -71,7 +71,10 @@ module Brainiac
|
|
|
71
71
|
"""
|
|
72
72
|
|
|
73
73
|
Focus your response on the comment above. If you've already addressed this in a previous session, reply confirming it's done.
|
|
74
|
-
Otherwise, make the requested changes, commit,
|
|
74
|
+
Otherwise, make the requested changes, commit, and push.
|
|
75
|
+
|
|
76
|
+
**Response destination: Post your response as a comment on Fizzy card #{{CARD_NUMBER}}.**
|
|
77
|
+
Do NOT post comments on the GitHub PR — this conversation is happening on the card.
|
|
75
78
|
PROMPT
|
|
76
79
|
|
|
77
80
|
FOLLOWUP_NO_WORKTREE = <<~PROMPT
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: brainiac-fizzy
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andy Davis
|
|
@@ -15,14 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - ">="
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 0.0.
|
|
18
|
+
version: 0.0.14
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - ">="
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 0.0.
|
|
25
|
+
version: 0.0.14
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: minitest
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|