brainiac-fizzy 0.0.12 → 0.0.13
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: 0e09da26fb3e4d7a37ef7fff687ad5b5e094d6cad508227fac32467273541619
|
|
4
|
+
data.tar.gz: 4de9000657e8afd645e5dcd04b02c9522912fb2df1428ffca10e4235b9d1b462
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3fe71aad4fec21bb3430d71bc9461156779b590c465bb49ec7199e6a4183f9321af16d98b3b6ffd9a01dc8505dd8d8708c9f0d1dfbdef98dd7e3b8c7fe3cea96
|
|
7
|
+
data.tar.gz: 22cff590e92a0455820feb9f40a0eacf9552f9989ccde9b155e193673c0260f108771469c4d45b739c72626a87927bd79108d2063b85c2fe0aab981681b2f0bd
|
|
@@ -153,11 +153,9 @@ def render_planning_prompt(situation_template, vars = {}, brain_context: "", car
|
|
|
153
153
|
result += plugin_prompt || CHANNEL_PROMPTS.fetch(channel, "")
|
|
154
154
|
result += situation_template
|
|
155
155
|
|
|
156
|
-
# Pre-post comment check (same as render_prompt)
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
when :github then result += PROMPT_PRE_POST_CHECK_GITHUB
|
|
160
|
-
end
|
|
156
|
+
# Pre-post comment check (same as render_prompt — use plugin-registered lookup)
|
|
157
|
+
plugin_pre_post = Brainiac.channel_pre_post_checks[channel]
|
|
158
|
+
result += plugin_pre_post if plugin_pre_post
|
|
161
159
|
|
|
162
160
|
result += PROMPT_REFLECTION
|
|
163
161
|
|
|
@@ -174,12 +172,7 @@ def render_planning_prompt(situation_template, vars = {}, brain_context: "", car
|
|
|
174
172
|
planning_vars[var_name] ||= (board_key && board_column_id(board_key, col_name)) || default_id
|
|
175
173
|
end
|
|
176
174
|
|
|
177
|
-
|
|
178
|
-
if vars["CARD_ID"]
|
|
179
|
-
memory_file = File.join(planning_vars["MEMORY_DIR"], "card-#{vars["CARD_ID"]}.md")
|
|
180
|
-
FileUtils.mkdir_p(planning_vars["MEMORY_DIR"])
|
|
181
|
-
FileUtils.touch(memory_file)
|
|
182
|
-
end
|
|
175
|
+
ensure_memory_file_exists!(vars["CARD_ID"], planning_vars["MEMORY_DIR"])
|
|
183
176
|
|
|
184
177
|
roster = agent_roster
|
|
185
178
|
roster_lines = roster.map { |_key, display| " - @#{display}" }.join("\n")
|
|
@@ -189,6 +182,15 @@ def render_planning_prompt(situation_template, vars = {}, brain_context: "", car
|
|
|
189
182
|
result
|
|
190
183
|
end
|
|
191
184
|
|
|
185
|
+
# Ensure a card's memory file exists so the agent can read it without error.
|
|
186
|
+
def ensure_memory_file_exists!(card_id, memory_dir)
|
|
187
|
+
return unless card_id
|
|
188
|
+
|
|
189
|
+
memory_file = File.join(memory_dir, "card-#{card_id}.md")
|
|
190
|
+
FileUtils.mkdir_p(memory_dir)
|
|
191
|
+
FileUtils.touch(memory_file)
|
|
192
|
+
end
|
|
193
|
+
|
|
192
194
|
# Config constants — handler files reference these as top-level constants.
|
|
193
195
|
# These are evaluated after Config.load! has been called (during plugin register).
|
|
194
196
|
# Use a delegating object so it always reflects current config state.
|
|
@@ -78,9 +78,11 @@ def handle_comment(payload)
|
|
|
78
78
|
directly_addressed = mentioned_agent || (card_info && card_info["agent"]&.downcase == agent_name.downcase)
|
|
79
79
|
unless directly_addressed
|
|
80
80
|
card_number_for_intent = card_info&.dig("number") || eventable.dig("card", "number")
|
|
81
|
-
intent_ctx =
|
|
81
|
+
intent_ctx = if card_number_for_intent
|
|
82
|
+
fetch_intent_context(card_number_for_intent, repo_path: project_config["repo_path"], agent_name: agent_name)
|
|
83
|
+
end
|
|
82
84
|
if intent_skip?(ctx.plain_text, agent_name: agent_name, source: :fizzy,
|
|
83
|
-
|
|
85
|
+
channel: "Fizzy card ##{card_number_for_intent || card_internal_id}", context: intent_ctx)
|
|
84
86
|
return [200, { status: "intent_skip", agent: agent_name }.to_json]
|
|
85
87
|
end
|
|
86
88
|
end
|
|
@@ -532,9 +534,7 @@ def dispatch_followup_comment(ctx, card_key:, card_number:, work_dir:)
|
|
|
532
534
|
agent_name: ctx.agent_name, chdir: work_dir
|
|
533
535
|
)
|
|
534
536
|
|
|
535
|
-
if ctx.fresh && is_worktree
|
|
536
|
-
LOG.info "[Fizzy] [fresh] tag — forcing new session instead of resuming on card #{card_number || ctx.card_internal_id}"
|
|
537
|
-
end
|
|
537
|
+
LOG.info "[Fizzy] [fresh] — forcing new session instead of resuming on card #{card_number || ctx.card_internal_id}" if ctx.fresh && is_worktree
|
|
538
538
|
|
|
539
539
|
prompt = if should_resume
|
|
540
540
|
LOG.info "[Resume] Using lean prompt for follow-up on card #{card_number || ctx.card_internal_id}"
|