brainiac-fizzy 0.0.7 → 0.0.8
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: 98a0dcf9fc45aff45ad0dd467090b4f7ef96e426ce2862fcf5b9251baf4fc519
|
|
4
|
+
data.tar.gz: eb2b8ec913902f3365efefa1424ae271f3e63f94161c0bbaddc116f9c0ec1bcb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 065dd360d8c26815dc3122e652003c40296edd8fcd582ac9d23a8446b3e29bbcff7d2983b468ad4c395b5729d1ee309a26756af663291ea5385ba4325d7d885d
|
|
7
|
+
data.tar.gz: 969d24c897c660ef777576c258df0b26d9f86d478525306f53e5836bcb36716ad6b9b9d6133a465efce89a14c4fab51f5b46b3f44e2f563fdbf885d7caaccaad
|
|
@@ -25,6 +25,10 @@ def prefetch_card_context(card_number, repo_path:, agent_name: nil)
|
|
|
25
25
|
Brainiac::Plugins::Fizzy::Helpers.prefetch_card_context(card_number, repo_path: repo_path, agent_name: agent_name)
|
|
26
26
|
end
|
|
27
27
|
|
|
28
|
+
def fetch_intent_context(card_number, repo_path:, agent_name: nil)
|
|
29
|
+
Brainiac::Plugins::Fizzy::Helpers.fetch_intent_context(card_number, repo_path: repo_path, agent_name: agent_name)
|
|
30
|
+
end
|
|
31
|
+
|
|
28
32
|
def move_card_to_column(card_number, column_name, project_config:, agent_name: nil)
|
|
29
33
|
Brainiac::Plugins::Fizzy::Helpers.move_card_to_column(card_number, column_name, project_config: project_config, agent_name: agent_name)
|
|
30
34
|
end
|
|
@@ -364,6 +364,7 @@ def dispatch_cross_agent_review(ctx, card_key:, card_number:, card_assigned_agen
|
|
|
364
364
|
review_worktree_path, review_branch = setup_cross_agent_worktree(ctx, card_number)
|
|
365
365
|
prompt = build_cross_agent_prompt(ctx, card_number, card_assigned_agent, review_worktree_path, review_branch)
|
|
366
366
|
|
|
367
|
+
intent_ctx = fetch_intent_context(card_number, repo_path: ctx.project_config["repo_path"], agent_name: ctx.agent_name)
|
|
367
368
|
pid, log_file = run_agent(prompt,
|
|
368
369
|
project_config: ctx.project_config, chdir: review_worktree_path,
|
|
369
370
|
log_name: "review-#{ctx.agent_name.downcase}-#{card_number || ctx.card_internal_id}",
|
|
@@ -371,7 +372,8 @@ def dispatch_cross_agent_review(ctx, card_key:, card_number:, card_assigned_agen
|
|
|
371
372
|
card_number: card_number, comment_id: ctx.comment_id,
|
|
372
373
|
source: :fizzy, source_context: { card_number: card_number },
|
|
373
374
|
cli_provider: ctx.cli_provider_override,
|
|
374
|
-
message: ctx.plain_text, channel: "Fizzy comment"
|
|
375
|
+
message: ctx.plain_text, channel: "Fizzy comment",
|
|
376
|
+
context: intent_ctx)
|
|
375
377
|
return [200, { status: "intent_skip", agent: ctx.agent_name, card: card_number }.to_json] unless pid
|
|
376
378
|
|
|
377
379
|
register_session(card_key, pid, log_file: log_file, supersede_key: card_key, agent_name: ctx.agent_name)
|
|
@@ -472,6 +474,7 @@ end
|
|
|
472
474
|
def dispatch_new_mention(ctx, card_key:, card_number:, card_title:, branch:, worktree_path:)
|
|
473
475
|
prompt = build_mention_prompt(ctx, card_number, card_title, branch, worktree_path)
|
|
474
476
|
|
|
477
|
+
intent_ctx = fetch_intent_context(card_number, repo_path: ctx.project_config["repo_path"], agent_name: ctx.agent_name)
|
|
475
478
|
pid, log_file = run_agent(prompt,
|
|
476
479
|
project_config: ctx.project_config, chdir: worktree_path,
|
|
477
480
|
log_name: "mention-#{card_number || ctx.card_internal_id}",
|
|
@@ -479,7 +482,8 @@ def dispatch_new_mention(ctx, card_key:, card_number:, card_title:, branch:, wor
|
|
|
479
482
|
card_number: card_number, comment_id: ctx.comment_id,
|
|
480
483
|
source: :fizzy, cli_provider: ctx.cli_provider_override,
|
|
481
484
|
source_context: { card_number: card_number },
|
|
482
|
-
message: ctx.plain_text, channel: "Fizzy comment"
|
|
485
|
+
message: ctx.plain_text, channel: "Fizzy comment",
|
|
486
|
+
context: intent_ctx)
|
|
483
487
|
return [200, { status: "intent_skip", agent: ctx.agent_name, card: card_number }.to_json] unless pid
|
|
484
488
|
|
|
485
489
|
register_session(card_key, pid, log_file: log_file, supersede_key: card_key, agent_name: ctx.agent_name)
|
|
@@ -509,6 +513,7 @@ def dispatch_followup_comment(ctx, card_key:, card_number:, work_dir:)
|
|
|
509
513
|
build_followup_prompt(ctx, card_number, card_tags, work_dir)
|
|
510
514
|
end
|
|
511
515
|
|
|
516
|
+
intent_ctx = fetch_intent_context(card_number, repo_path: ctx.project_config["repo_path"], agent_name: ctx.agent_name)
|
|
512
517
|
pid, log_file = run_agent(prompt,
|
|
513
518
|
project_config: ctx.project_config, chdir: work_dir,
|
|
514
519
|
log_name: "followup-#{card_number || ctx.card_internal_id}",
|
|
@@ -519,7 +524,8 @@ def dispatch_followup_comment(ctx, card_key:, card_number:, work_dir:)
|
|
|
519
524
|
card_number: card_number, card_internal_id: ctx.card_internal_id,
|
|
520
525
|
deploy_intent: ctx.deploy_intent
|
|
521
526
|
},
|
|
522
|
-
message: ctx.plain_text, channel: "Fizzy comment"
|
|
527
|
+
message: ctx.plain_text, channel: "Fizzy comment",
|
|
528
|
+
context: intent_ctx)
|
|
523
529
|
return [200, { status: "intent_skip", agent: ctx.agent_name, card: card_number }.to_json] unless pid
|
|
524
530
|
|
|
525
531
|
register_session(card_key, pid, log_file: log_file, supersede_key: card_key, agent_name: ctx.agent_name)
|
|
@@ -73,6 +73,25 @@ module Brainiac
|
|
|
73
73
|
""
|
|
74
74
|
end
|
|
75
75
|
|
|
76
|
+
# Lightweight recent comment context for intent classification.
|
|
77
|
+
# Returns a simple "author: message" format (last 5 comments).
|
|
78
|
+
def fetch_intent_context(card_number, repo_path:, agent_name: nil)
|
|
79
|
+
env = fizzy_env_for(agent_name || AI_AGENT_NAME)
|
|
80
|
+
output = run_cmd("fizzy", "comment", "list", "--card", card_number.to_s, chdir: repo_path, env: env)
|
|
81
|
+
comments = JSON.parse(output)["data"] || []
|
|
82
|
+
return nil if comments.empty?
|
|
83
|
+
|
|
84
|
+
comments.last(5).map do |c|
|
|
85
|
+
creator = c["creator_name"] || "unknown"
|
|
86
|
+
body = (c.dig("body", "plain_text") || "").lines.first(3).join.strip
|
|
87
|
+
body = "#{body[0..200]}..." if body.length > 200
|
|
88
|
+
"#{creator}: #{body}"
|
|
89
|
+
end.join("\n")
|
|
90
|
+
rescue StandardError => e
|
|
91
|
+
LOG.warn "[Fizzy] Could not fetch intent context for card ##{card_number}: #{e.message}" if defined?(LOG)
|
|
92
|
+
nil
|
|
93
|
+
end
|
|
94
|
+
|
|
76
95
|
def move_card_to_column(card_number, column_name, project_config:, agent_name: nil)
|
|
77
96
|
board_key = Config.board_key_for_project(project_config)
|
|
78
97
|
column_id = Config.board_column_id(board_key, column_name) if board_key
|