brainiac-fizzy 0.0.40 → 0.0.42
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/handlers/assignment.rb +9 -5
- data/lib/brainiac/plugins/fizzy/handlers/comments.rb +17 -2
- data/lib/brainiac/plugins/fizzy/handlers/summarize.rb +11 -4
- data/lib/brainiac/plugins/fizzy/hooks.rb +1 -1
- data/lib/brainiac/plugins/fizzy/prompts.rb +9 -0
- 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: bd5840ff8112c851eff8400d9be4fd1bd3b1233dbdfc663a92a6d274a43e41a0
|
|
4
|
+
data.tar.gz: 938965e69f73c101d85f68ac7d9832e8f036155cbcc8967d473056177966a53c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1fefa175a1bcab72083fec372845a1872445de3b83fadc2ae1d8f038c88ec6451c30acb8fc06421fd691b4f808d5587be671b01b5a175bcdaabfd633e758219d
|
|
7
|
+
data.tar.gz: 8c06a60d5741a63c73b10dd1ac5ffd0494486632451b1a929e60de241a85ad566f0ed978be7a4f9dfc98bb1eccbd28824795b4d52a77233ed4c9b327d8402aa5
|
|
@@ -40,14 +40,17 @@ def handle_card_assigned(payload, board_key: nil)
|
|
|
40
40
|
return [200, { status: "ignored", reason: "session already active" }.to_json]
|
|
41
41
|
end
|
|
42
42
|
|
|
43
|
+
# Model tags resolve against the provider that will run (a cli:X chip), not the default's map.
|
|
44
|
+
initial_cli = detect_cli_provider(tags: tags)
|
|
45
|
+
initial_model, initial_model_explicit = detect_model_explicit(project_config, tags: tags, cli_provider_override: initial_cli,
|
|
46
|
+
agent_name: assigned_agent)
|
|
47
|
+
|
|
43
48
|
LOG.info "Card ##{card_number} assigned to #{assigned_agent} for project '#{project_key}', " \
|
|
44
|
-
"creating worktree: #{branch} (model: #{
|
|
49
|
+
"creating worktree: #{branch} (model: #{initial_model || "default"})"
|
|
45
50
|
|
|
46
51
|
react_to_assignment(card_number, repo_path, assigned_agent)
|
|
47
52
|
worktree_path = setup_assigned_worktree(repo_path, branch, card_internal_id, card_number, project_key, assigned_agent, board_key: board_key)
|
|
48
53
|
|
|
49
|
-
initial_cli = detect_cli_provider(tags: tags)
|
|
50
|
-
initial_model, initial_model_explicit = detect_model_explicit(project_config, tags: tags)
|
|
51
54
|
initial_effort = detect_effort(project_config, tags: tags)
|
|
52
55
|
# Profile ([profile:X]/[p:X]) can be specified inline in the card title OR as a
|
|
53
56
|
# card tag (a `p:k+`/`profile:k+` chip, or a bare chip matching a known profile).
|
|
@@ -59,12 +62,13 @@ def handle_card_assigned(payload, board_key: nil)
|
|
|
59
62
|
end
|
|
60
63
|
|
|
61
64
|
# Persist initial overrides from card tags to the work item (profile included, so
|
|
62
|
-
# later comments without a [p:X] keep using it).
|
|
65
|
+
# later comments without a [p:X] keep using it). Only a tagged model is persisted;
|
|
66
|
+
# the project default must not get pinned to the card.
|
|
63
67
|
profile_kwargs = work_item_overrides_support_profile? ? { inline_profile: initial_profile } : {}
|
|
64
68
|
resolve_work_item_overrides(
|
|
65
69
|
branch: branch,
|
|
66
70
|
inline_cli_provider: initial_cli,
|
|
67
|
-
inline_model: initial_model,
|
|
71
|
+
inline_model: (initial_model if initial_model_explicit),
|
|
68
72
|
inline_effort: initial_effort,
|
|
69
73
|
**profile_kwargs
|
|
70
74
|
)
|
|
@@ -109,15 +109,16 @@ def build_comment_context(eventable:, plain_text:, tags:, card_internal_id:, car
|
|
|
109
109
|
card_tags = eventable.dig("card", "tags") || []
|
|
110
110
|
clean_text = tags[:clean_text]
|
|
111
111
|
|
|
112
|
+
branch = card_info["branch"] if card_info.is_a?(Hash)
|
|
112
113
|
inline_cli = detect_cli_provider(text: plain_text, tags: card_tags)
|
|
113
|
-
inline_model, inline_model_explicit =
|
|
114
|
+
inline_model, inline_model_explicit = detect_comment_model(project_config, plain_text, card_tags,
|
|
115
|
+
inline_cli: inline_cli, branch: branch, agent_name: agent_name)
|
|
114
116
|
inline_effort = detect_effort(project_config, tags: card_tags, text: plain_text)
|
|
115
117
|
inline_profile = detect_comment_profile(plain_text, card_tags, tags)
|
|
116
118
|
|
|
117
119
|
# Resolve overrides against the work item — merges stored overrides with inline tags
|
|
118
120
|
# and persists any new inline tags for future dispatches. The profile is sticky too:
|
|
119
121
|
# a [p:k+] comment keeps later untagged comments on k+ until a different [p:X].
|
|
120
|
-
branch = card_info["branch"] if card_info.is_a?(Hash)
|
|
121
122
|
if branch
|
|
122
123
|
profile_kwargs = work_item_overrides_support_profile? ? { inline_profile: inline_profile } : {}
|
|
123
124
|
resolved = resolve_work_item_overrides(
|
|
@@ -162,6 +163,20 @@ def build_comment_context(eventable:, plain_text:, tags:, card_internal_id:, car
|
|
|
162
163
|
)
|
|
163
164
|
end
|
|
164
165
|
|
|
166
|
+
# Resolve a [model] tag against the CLI provider that will actually run this comment
|
|
167
|
+
# (inline [cli:X], else the work item's sticky provider, else the agent/project default).
|
|
168
|
+
# Model maps are per provider: [sonnet] is claude-sonnet-4.6 under kiro but `sonnet`
|
|
169
|
+
# under claude, and run_agent drops any ID the running provider doesn't know.
|
|
170
|
+
#
|
|
171
|
+
# Returns [model, explicit]. The model is nil unless a tag matched, so an untagged
|
|
172
|
+
# comment falls through to the work item's stored model instead of the project default.
|
|
173
|
+
def detect_comment_model(project_config, plain_text, card_tags, inline_cli:, branch:, agent_name:)
|
|
174
|
+
model_cli = inline_cli || (work_item_overrides_for(branch: branch)["cli_provider"] if branch)
|
|
175
|
+
model, explicit = detect_model_explicit(project_config, text: plain_text, tags: card_tags,
|
|
176
|
+
cli_provider_override: model_cli, agent_name: agent_name)
|
|
177
|
+
[explicit ? model : nil, explicit]
|
|
178
|
+
end
|
|
179
|
+
|
|
165
180
|
# Older core builds' resolve_work_item_overrides has no inline_profile: keyword.
|
|
166
181
|
def work_item_overrides_support_profile?
|
|
167
182
|
method(:resolve_work_item_overrides).parameters.any? { |t, n| t == :key && n == :inline_profile }
|
|
@@ -32,7 +32,8 @@ module Brainiac
|
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
pid, log_file = dispatch_summarize_agent(card_number, card_title, branch, agent_name,
|
|
35
|
-
project_config, worktree_path
|
|
35
|
+
project_config, worktree_path,
|
|
36
|
+
overrides: work_item&.dig("overrides") || {})
|
|
36
37
|
register_session("card-#{card_number}-summarize", pid, log_file: log_file, agent_name: agent_name)
|
|
37
38
|
|
|
38
39
|
monitor_summarize_session(pid, card_number, agent_name, branch, repo_path, session_started_at,
|
|
@@ -98,16 +99,22 @@ module Brainiac
|
|
|
98
99
|
end
|
|
99
100
|
end
|
|
100
101
|
|
|
101
|
-
|
|
102
|
+
# Runs on the card's stored cli_provider/model/effort/profile so the summary comes from
|
|
103
|
+
# the same CLI that did the work (not the project default, e.g. kiro after a [cli:claude] run).
|
|
104
|
+
def dispatch_summarize_agent(card_number, card_title, branch, agent_name, project_config, worktree_path,
|
|
105
|
+
overrides: {})
|
|
102
106
|
prompt = render_prompt(Prompts::SUMMARIZE_WORK,
|
|
103
|
-
{ "CARD_NUMBER" => card_number, "
|
|
107
|
+
{ "CARD_NUMBER" => card_number, "CARD_ID" => card_number, "CARD_TITLE" => card_title,
|
|
108
|
+
"BRANCH" => branch },
|
|
104
109
|
brain_context: "", agent_name: agent_name, channel: :fizzy,
|
|
105
110
|
board_key: Config.board_key_for_project(project_config))
|
|
106
111
|
|
|
107
112
|
run_agent(prompt,
|
|
108
113
|
project_config: project_config, chdir: worktree_path,
|
|
109
114
|
log_name: "summarize-#{card_number}", agent_name: agent_name,
|
|
110
|
-
source: :fizzy,
|
|
115
|
+
source: :fizzy, cli_provider: overrides["cli_provider"],
|
|
116
|
+
model: overrides["model"], explicit_model: overrides["model"] ? true : nil,
|
|
117
|
+
effort: overrides["effort"], profile: overrides["profile"],
|
|
111
118
|
source_context: { card_number: card_number, skip_summarize_redispatch: true },
|
|
112
119
|
skip_column_move: true)
|
|
113
120
|
end
|
|
@@ -351,7 +351,7 @@ module Brainiac
|
|
|
351
351
|
card_title = card_info["title"] || ctx[:pr_title]
|
|
352
352
|
|
|
353
353
|
prompt = render_prompt(Prompts::UAT_TESTING,
|
|
354
|
-
{ "CARD_NUMBER" => card_number, "CARD_TITLE" => card_title,
|
|
354
|
+
{ "CARD_NUMBER" => card_number, "CARD_ID" => card_number, "CARD_TITLE" => card_title,
|
|
355
355
|
"PR_NUMBER" => ctx[:pull_request]["number"].to_s },
|
|
356
356
|
brain_context: build_brain_context(agent_name: agent_name, card_number: card_number,
|
|
357
357
|
card_title: card_title, project_key: project_key),
|
|
@@ -117,6 +117,9 @@ module Brainiac
|
|
|
117
117
|
- Check your memory file for context on what's already been discussed/decided
|
|
118
118
|
|
|
119
119
|
If you've already addressed what's being asked, reply confirming it's done.
|
|
120
|
+
|
|
121
|
+
**Response destination: Post your response as a comment on this Fizzy card.**
|
|
122
|
+
Anything you only print to stdout is never seen.
|
|
120
123
|
PROMPT
|
|
121
124
|
|
|
122
125
|
MENTION = <<~PROMPT
|
|
@@ -124,6 +127,9 @@ module Brainiac
|
|
|
124
127
|
You are on branch "{{BRANCH}}" in a dedicated worktree.
|
|
125
128
|
|
|
126
129
|
Investigate the codebase and respond accordingly.
|
|
130
|
+
|
|
131
|
+
**Response destination: Post your response as a comment on this Fizzy card.**
|
|
132
|
+
Anything you only print to stdout is never seen.
|
|
127
133
|
PROMPT
|
|
128
134
|
|
|
129
135
|
CROSS_AGENT_REVIEW = <<~'PROMPT'
|
|
@@ -138,6 +144,9 @@ module Brainiac
|
|
|
138
144
|
You are in your own worktree at `{{WORKTREE_PATH}}` on branch `{{BRANCH}}`.
|
|
139
145
|
Respond to what's being asked — code review, opinion, debugging help, or sanity check.
|
|
140
146
|
|
|
147
|
+
**Response destination: Post your response as a comment on Fizzy card #{{CARD_NUMBER}}.**
|
|
148
|
+
Anything you only print to stdout is never seen.
|
|
149
|
+
|
|
141
150
|
**IMPORTANT: Do NOT @mention any other agents in your response.**
|
|
142
151
|
PROMPT
|
|
143
152
|
|