anima-core 1.3.0 → 1.5.0
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/.reek.yml +23 -26
- data/README.md +118 -104
- data/agents/thoughts-analyzer.md +12 -7
- data/anima-core.gemspec +1 -0
- data/app/channels/session_channel.rb +38 -58
- data/app/decorators/agent_message_decorator.rb +7 -2
- data/app/decorators/message_decorator.rb +31 -100
- data/app/decorators/pending_from_melete_decorator.rb +36 -0
- data/app/decorators/pending_from_melete_goal_decorator.rb +13 -0
- data/app/decorators/pending_from_melete_skill_decorator.rb +19 -0
- data/app/decorators/pending_from_melete_workflow_decorator.rb +13 -0
- data/app/decorators/pending_from_mneme_decorator.rb +44 -0
- data/app/decorators/pending_message_decorator.rb +94 -0
- data/app/decorators/pending_subagent_decorator.rb +46 -0
- data/app/decorators/pending_tool_response_decorator.rb +51 -0
- data/app/decorators/pending_user_message_decorator.rb +22 -0
- data/app/decorators/system_message_decorator.rb +5 -0
- data/app/decorators/tool_call_decorator.rb +16 -5
- data/app/decorators/tool_response_decorator.rb +2 -2
- data/app/decorators/user_message_decorator.rb +7 -2
- data/app/jobs/count_tokens_job.rb +23 -0
- data/app/jobs/drain_job.rb +169 -0
- data/app/jobs/melete_enrichment_job/goal_change_listener.rb +52 -0
- data/app/jobs/melete_enrichment_job.rb +48 -0
- data/app/jobs/mneme_enrichment_job.rb +46 -0
- data/app/jobs/tool_execution_job.rb +87 -0
- data/app/models/concerns/token_estimation.rb +54 -0
- data/app/models/goal.rb +23 -11
- data/app/models/message.rb +46 -48
- data/app/models/pending_message.rb +407 -12
- data/app/models/pinned_message.rb +8 -3
- data/app/models/session.rb +660 -566
- data/app/models/snapshot.rb +11 -21
- data/bin/inspect-cassette +157 -0
- data/bin/release +212 -0
- data/bin/with-llms +20 -0
- data/config/application.rb +1 -0
- data/config/database.yml +1 -0
- data/config/initializers/event_subscribers.rb +71 -4
- data/config/initializers/inflections.rb +3 -1
- data/db/cable_structure.sql +9 -0
- data/db/migrate/20260330120000_add_source_to_pending_messages.rb +8 -0
- data/db/migrate/20260401180000_add_api_metrics_to_messages.rb +7 -0
- data/db/migrate/20260401210935_remove_recalled_message_ids_from_sessions.rb +5 -0
- data/db/migrate/20260403080031_add_initial_cwd_to_sessions.rb +5 -0
- data/db/migrate/20260407170803_remove_viewport_message_ids_from_sessions.rb +5 -0
- data/db/migrate/20260407180400_remove_mneme_snapshot_pointer_columns_from_sessions.rb +6 -0
- data/db/migrate/20260411120553_add_token_count_to_pinned_messages.rb +5 -0
- data/db/migrate/20260411172926_remove_active_skills_and_workflow_from_sessions.rb +6 -0
- data/db/migrate/20260412110625_replace_processing_with_aasm_state.rb +6 -0
- data/db/migrate/20260418150323_add_kind_and_message_type_to_pending_messages.rb +6 -0
- data/db/migrate/20260419120000_add_drain_fields_to_pending_messages.rb +7 -0
- data/db/migrate/20260419130000_drop_pending_messages_kind_default.rb +5 -0
- data/db/migrate/20260419140000_add_drain_indexes_to_pending_messages.rb +8 -0
- data/db/migrate/20260420100000_add_hud_visibility_to_sessions.rb +15 -0
- data/db/queue_structure.sql +61 -0
- data/db/structure.sql +133 -0
- data/lib/agents/registry.rb +1 -1
- data/lib/anima/cli.rb +41 -13
- data/lib/anima/installer.rb +13 -0
- data/lib/anima/settings.rb +16 -36
- data/lib/anima/version.rb +1 -1
- data/lib/events/authentication_required.rb +24 -0
- data/lib/events/bounce_back.rb +4 -4
- data/lib/events/eviction_completed.rb +28 -0
- data/lib/events/goal_created.rb +28 -0
- data/lib/events/goal_updated.rb +32 -0
- data/lib/events/llm_responded.rb +35 -0
- data/lib/events/message_created.rb +27 -0
- data/lib/events/message_updated.rb +25 -0
- data/lib/events/session_state_changed.rb +30 -0
- data/lib/events/skill_activated.rb +28 -0
- data/lib/events/start_melete.rb +36 -0
- data/lib/events/start_mneme.rb +33 -0
- data/lib/events/start_processing.rb +32 -0
- data/lib/events/subagent_evicted.rb +31 -0
- data/lib/events/subscribers/active_state_broadcaster.rb +27 -0
- data/lib/events/subscribers/authentication_broadcaster.rb +34 -0
- data/lib/events/subscribers/drain_kickoff.rb +20 -0
- data/lib/events/subscribers/eviction_broadcaster.rb +26 -0
- data/lib/events/subscribers/llm_response_handler.rb +111 -0
- data/lib/events/subscribers/melete_kickoff.rb +24 -0
- data/lib/events/subscribers/message_broadcaster.rb +34 -0
- data/lib/events/subscribers/mneme_kickoff.rb +24 -0
- data/lib/events/subscribers/mneme_scheduler.rb +21 -0
- data/lib/events/subscribers/persister.rb +8 -9
- data/lib/events/subscribers/session_state_broadcaster.rb +33 -0
- data/lib/events/subscribers/subagent_message_router.rb +28 -34
- data/lib/events/subscribers/subagent_visibility_broadcaster.rb +33 -0
- data/lib/events/subscribers/tool_response_creator.rb +33 -0
- data/lib/events/subscribers/transient_broadcaster.rb +1 -1
- data/lib/events/tool_executed.rb +34 -0
- data/lib/events/workflow_activated.rb +27 -0
- data/lib/llm/client.rb +46 -199
- data/lib/mcp/client_manager.rb +41 -46
- data/lib/mcp/stdio_transport.rb +9 -5
- data/lib/{analytical_brain → melete}/runner.rb +73 -68
- data/lib/{analytical_brain → melete}/tools/activate_skill.rb +3 -3
- data/lib/{analytical_brain → melete}/tools/assign_nickname.rb +3 -3
- data/lib/{analytical_brain → melete}/tools/everything_is_ready.rb +2 -2
- data/lib/{analytical_brain → melete}/tools/finish_goal.rb +6 -3
- data/lib/melete/tools/goal_messaging.rb +29 -0
- data/lib/{analytical_brain → melete}/tools/read_workflow.rb +4 -4
- data/lib/{analytical_brain → melete}/tools/rename_session.rb +3 -3
- data/lib/{analytical_brain → melete}/tools/set_goal.rb +6 -2
- data/lib/{analytical_brain → melete}/tools/update_goal.rb +9 -5
- data/lib/{analytical_brain.rb → melete.rb} +6 -3
- data/lib/mneme/base_runner.rb +121 -0
- data/lib/mneme/l2_runner.rb +14 -20
- data/lib/mneme/recall_runner.rb +132 -0
- data/lib/mneme/runner.rb +123 -165
- data/lib/mneme/search.rb +104 -62
- data/lib/mneme/tools/nothing_to_surface.rb +25 -0
- data/lib/mneme/tools/save_snapshot.rb +2 -10
- data/lib/mneme/tools/surface_memory.rb +89 -0
- data/lib/mneme.rb +11 -5
- data/lib/providers/anthropic.rb +112 -7
- data/lib/shell_session.rb +290 -432
- data/lib/skills/definition.rb +2 -2
- data/lib/skills/registry.rb +1 -1
- data/lib/tools/base.rb +16 -1
- data/lib/tools/bash.rb +25 -55
- data/lib/tools/edit.rb +2 -0
- data/lib/tools/mark_goal_completed.rb +4 -5
- data/lib/tools/read.rb +2 -0
- data/lib/tools/registry.rb +85 -4
- data/lib/tools/response_truncator.rb +1 -1
- data/lib/tools/{recall.rb → search_messages.rb} +19 -21
- data/lib/tools/spawn_specialist.rb +22 -14
- data/lib/tools/spawn_subagent.rb +30 -20
- data/lib/tools/subagent_prompts.rb +17 -19
- data/lib/tools/think.rb +1 -1
- data/lib/tools/{remember.rb → view_messages.rb} +10 -10
- data/lib/tools/write.rb +2 -0
- data/lib/tui/app.rb +393 -149
- data/lib/tui/braille_spinner.rb +7 -7
- data/lib/tui/cable_client.rb +9 -16
- data/lib/tui/decorators/base_decorator.rb +47 -6
- data/lib/tui/decorators/bash_decorator.rb +1 -1
- data/lib/tui/decorators/edit_decorator.rb +4 -2
- data/lib/tui/decorators/read_decorator.rb +4 -2
- data/lib/tui/decorators/think_decorator.rb +2 -2
- data/lib/tui/decorators/web_get_decorator.rb +1 -1
- data/lib/tui/decorators/write_decorator.rb +4 -2
- data/lib/tui/flash.rb +19 -14
- data/lib/tui/formatting.rb +20 -9
- data/lib/tui/input_buffer.rb +6 -6
- data/lib/tui/message_store.rb +165 -28
- data/lib/tui/performance_logger.rb +2 -3
- data/lib/tui/screens/chat.rb +149 -79
- data/lib/tui/settings.rb +93 -0
- data/lib/workflows/definition.rb +3 -3
- data/lib/workflows/registry.rb +1 -1
- data/skills/github.md +38 -0
- data/templates/config.toml +16 -32
- data/templates/tui.toml +209 -0
- data/workflows/review_pr.md +18 -14
- metadata +98 -29
- data/app/jobs/agent_request_job.rb +0 -199
- data/app/jobs/analytical_brain_job.rb +0 -33
- data/app/jobs/count_message_tokens_job.rb +0 -39
- data/app/jobs/passive_recall_job.rb +0 -29
- data/app/models/concerns/message/broadcasting.rb +0 -85
- data/config/initializers/fts5_schema_dump.rb +0 -21
- data/lib/agent_loop.rb +0 -186
- data/lib/analytical_brain/tools/deactivate_skill.rb +0 -39
- data/lib/analytical_brain/tools/deactivate_workflow.rb +0 -34
- data/lib/environment_probe.rb +0 -232
- data/lib/events/agent_message.rb +0 -11
- data/lib/events/subscribers/message_collector.rb +0 -64
- data/lib/events/tool_call.rb +0 -31
- data/lib/events/tool_response.rb +0 -33
- data/lib/mneme/compressed_viewport.rb +0 -200
- data/lib/mneme/passive_recall.rb +0 -69
data/templates/config.toml
CHANGED
|
@@ -29,12 +29,19 @@ max_tool_rounds = 500
|
|
|
29
29
|
|
|
30
30
|
# Context window budget — tokens reserved for conversation history.
|
|
31
31
|
# Set this based on your model's context window minus system prompt.
|
|
32
|
-
token_budget =
|
|
32
|
+
token_budget = 120_000
|
|
33
33
|
|
|
34
34
|
# Maximum character length for the Think tool's thoughts parameter.
|
|
35
35
|
# Sub-agents receive half this budget (their tasks are less complex).
|
|
36
36
|
thinking_budget = 10_000
|
|
37
37
|
|
|
38
|
+
# Model for sub-agent sessions. Sonnet is cost-effective for focused tasks.
|
|
39
|
+
subagent_model = "claude-sonnet-4-6"
|
|
40
|
+
|
|
41
|
+
# Context window budget for sub-agent sessions.
|
|
42
|
+
# Smaller than main to stay out of the "dumb zone" (~last 10% of context).
|
|
43
|
+
subagent_token_budget = 90_000
|
|
44
|
+
|
|
38
45
|
# ─── Timeouts (seconds) ─────────────────────────────────────────
|
|
39
46
|
|
|
40
47
|
[timeouts]
|
|
@@ -95,16 +102,6 @@ max_tool_response_chars = 6_000
|
|
|
95
102
|
# ~24000 chars ≈ ~8000 tokens.
|
|
96
103
|
max_subagent_response_chars = 24_000
|
|
97
104
|
|
|
98
|
-
# ─── Environment ──────────────────────────────────────────────
|
|
99
|
-
|
|
100
|
-
[environment]
|
|
101
|
-
|
|
102
|
-
# Files to scan for in the working directory (at root and up to project_files_max_depth subdirectories deep).
|
|
103
|
-
project_files = ["CLAUDE.md", "AGENTS.md", "README.md", "CONTRIBUTING.md"]
|
|
104
|
-
|
|
105
|
-
# Maximum directory depth for project file scanning.
|
|
106
|
-
project_files_max_depth = 3
|
|
107
|
-
|
|
108
105
|
# ─── GitHub ─────────────────────────────────────────────────────
|
|
109
106
|
|
|
110
107
|
[github]
|
|
@@ -130,33 +127,16 @@ soul = "{{ANIMA_HOME}}/soul.md"
|
|
|
130
127
|
# View mode for new sessions: "basic", "verbose", or "debug".
|
|
131
128
|
default_view_mode = "basic"
|
|
132
129
|
|
|
133
|
-
# Regenerate session name every N messages.
|
|
134
|
-
name_generation_interval = 30
|
|
135
130
|
|
|
136
|
-
# ───
|
|
131
|
+
# ─── Melete ─────────────────────────────────────────
|
|
137
132
|
|
|
138
|
-
[
|
|
133
|
+
[melete]
|
|
139
134
|
|
|
140
|
-
#
|
|
141
|
-
# before a completed goal is automatically evicted from context.
|
|
142
|
-
completed_decay_messages = 5
|
|
143
|
-
|
|
144
|
-
# ─── Analytical Brain ─────────────────────────────────────────
|
|
145
|
-
|
|
146
|
-
[analytical_brain]
|
|
147
|
-
|
|
148
|
-
# Maximum tokens per analytical brain response.
|
|
135
|
+
# Maximum tokens per Melete response.
|
|
149
136
|
# Must accommodate multiple tool calls (rename + goals + skills + ready).
|
|
150
137
|
max_tokens = 4096
|
|
151
138
|
|
|
152
|
-
#
|
|
153
|
-
# Ensures activated skills are available for the current response.
|
|
154
|
-
blocking_on_user_message = true
|
|
155
|
-
|
|
156
|
-
# Run the analytical brain asynchronously after the main agent completes.
|
|
157
|
-
blocking_on_agent_message = false
|
|
158
|
-
|
|
159
|
-
# Number of recent messages to include in the analytical brain's context window.
|
|
139
|
+
# Number of recent messages to include in Melete's context window.
|
|
160
140
|
message_window = 20
|
|
161
141
|
|
|
162
142
|
# ─── Mneme (Memory Department) ──────────────────────────────────
|
|
@@ -181,6 +161,10 @@ l2_budget_fraction = 0.05
|
|
|
181
161
|
# Number of uncovered Level 1 snapshots that triggers Level 2 compression.
|
|
182
162
|
l2_snapshot_threshold = 5
|
|
183
163
|
|
|
164
|
+
# Fraction of the viewport to evict in batch when Mneme runs.
|
|
165
|
+
# Matches the viewport_fraction (Mneme's zone = eviction zone).
|
|
166
|
+
eviction_fraction = 0.33
|
|
167
|
+
|
|
184
168
|
# Fraction of the main viewport token budget reserved for pinned messages.
|
|
185
169
|
# Pinned messages appear between snapshots and the sliding window in the Goals section.
|
|
186
170
|
pinned_budget_fraction = 0.05
|
data/templates/tui.toml
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
# TUI Configuration
|
|
2
|
+
#
|
|
3
|
+
# Presentation settings for the Anima terminal interface.
|
|
4
|
+
# Changes take effect immediately — no restart needed.
|
|
5
|
+
#
|
|
6
|
+
# These settings only affect the TUI client, not the brain server.
|
|
7
|
+
# Brain settings live in config.toml.
|
|
8
|
+
|
|
9
|
+
# ─── Connection ──────────────────────────────────────────────────
|
|
10
|
+
|
|
11
|
+
[connection]
|
|
12
|
+
|
|
13
|
+
# Brain server address (host:port). Override per-launch with --host flag.
|
|
14
|
+
default_host = "localhost:42134"
|
|
15
|
+
|
|
16
|
+
# Seconds to wait for WebSocket thread cleanup on disconnect.
|
|
17
|
+
disconnect_timeout = 2
|
|
18
|
+
|
|
19
|
+
# Seconds between connection status checks during connect/reconnect.
|
|
20
|
+
poll_interval = 0.1
|
|
21
|
+
|
|
22
|
+
# Seconds before a connection attempt is considered timed out.
|
|
23
|
+
timeout = 10
|
|
24
|
+
|
|
25
|
+
# Maximum reconnection attempts before giving up.
|
|
26
|
+
max_reconnect_attempts = 10
|
|
27
|
+
|
|
28
|
+
# Initial delay before first reconnection attempt (seconds).
|
|
29
|
+
# Doubles with each subsequent attempt up to backoff_cap.
|
|
30
|
+
backoff_base = 1.0
|
|
31
|
+
|
|
32
|
+
# Maximum delay between reconnection attempts (seconds).
|
|
33
|
+
backoff_cap = 30.0
|
|
34
|
+
|
|
35
|
+
# Seconds without an Action Cable ping before the connection is stale.
|
|
36
|
+
ping_stale_threshold = 6.0
|
|
37
|
+
|
|
38
|
+
# ─── HUD ─────────────────────────────────────────────────────────
|
|
39
|
+
|
|
40
|
+
[hud]
|
|
41
|
+
|
|
42
|
+
# Minimum width (columns) for the info panel.
|
|
43
|
+
# The HUD occupies 1/3 of screen width, clamped to this minimum.
|
|
44
|
+
min_width = 24
|
|
45
|
+
|
|
46
|
+
# Lines scrolled per keyboard arrow event.
|
|
47
|
+
scroll_step = 1
|
|
48
|
+
|
|
49
|
+
# Lines scrolled per mouse wheel event.
|
|
50
|
+
mouse_scroll_step = 2
|
|
51
|
+
|
|
52
|
+
# ─── Chat ────────────────────────────────────────────────────────
|
|
53
|
+
|
|
54
|
+
[chat]
|
|
55
|
+
|
|
56
|
+
# Minimum height (rows) for the text input area.
|
|
57
|
+
min_input_height = 3
|
|
58
|
+
|
|
59
|
+
# Lines scrolled per keyboard arrow event.
|
|
60
|
+
scroll_step = 1
|
|
61
|
+
|
|
62
|
+
# Lines scrolled per mouse wheel event.
|
|
63
|
+
mouse_scroll_step = 2
|
|
64
|
+
|
|
65
|
+
# Entries rendered before scroll target for upward scroll margin.
|
|
66
|
+
viewport_back_buffer = 3
|
|
67
|
+
|
|
68
|
+
# Viewports worth of lines to pre-build for smooth scrolling.
|
|
69
|
+
viewport_overflow_multiplier = 2
|
|
70
|
+
|
|
71
|
+
# Entries from the end before including all trailing entries.
|
|
72
|
+
viewport_bottom_threshold = 10
|
|
73
|
+
|
|
74
|
+
# ─── Terminal ────────────────────────────────────────────────────
|
|
75
|
+
|
|
76
|
+
[terminal]
|
|
77
|
+
|
|
78
|
+
# How often the watchdog checks if the controlling terminal is alive (seconds).
|
|
79
|
+
check_interval = 0.5
|
|
80
|
+
|
|
81
|
+
# Grace period for watchdog thread to exit before force-killing it (seconds).
|
|
82
|
+
shutdown_timeout = 1
|
|
83
|
+
|
|
84
|
+
# ─── Token Dialog ────────────────────────────────────────────────
|
|
85
|
+
|
|
86
|
+
[token_dialog]
|
|
87
|
+
|
|
88
|
+
# Leading characters shown unmasked in the token input.
|
|
89
|
+
# Default 14 matches the "sk-ant-oat01-" prefix plus one secret character.
|
|
90
|
+
mask_visible = 14
|
|
91
|
+
|
|
92
|
+
# Maximum stars shown in the masked portion.
|
|
93
|
+
mask_stars = 4
|
|
94
|
+
|
|
95
|
+
# Height (rows) of the token setup popup.
|
|
96
|
+
popup_height = 14
|
|
97
|
+
|
|
98
|
+
# Minimum width (columns) of the token setup popup.
|
|
99
|
+
popup_min_width = 44
|
|
100
|
+
|
|
101
|
+
# ─── Session Picker ──────────────────────────────────────────────
|
|
102
|
+
|
|
103
|
+
[session_picker]
|
|
104
|
+
|
|
105
|
+
# Sessions displayed per page.
|
|
106
|
+
page_size = 9
|
|
107
|
+
|
|
108
|
+
# Maximum sessions fetched from the brain for client-side pagination.
|
|
109
|
+
fetch_limit = 50
|
|
110
|
+
|
|
111
|
+
# ─── Flash ───────────────────────────────────────────────────────
|
|
112
|
+
|
|
113
|
+
[flash]
|
|
114
|
+
|
|
115
|
+
# Seconds before flash notifications auto-dismiss.
|
|
116
|
+
auto_dismiss_seconds = 20.0
|
|
117
|
+
|
|
118
|
+
# Flash area occupies at most 1/N of the chat pane height.
|
|
119
|
+
max_height_fraction = 3
|
|
120
|
+
|
|
121
|
+
# ─── Input ───────────────────────────────────────────────────────
|
|
122
|
+
|
|
123
|
+
[input]
|
|
124
|
+
|
|
125
|
+
# Maximum character length for the text input buffer.
|
|
126
|
+
max_length = 10_000
|
|
127
|
+
|
|
128
|
+
# ─── Message Store ───────────────────────────────────────────────
|
|
129
|
+
|
|
130
|
+
[message_store]
|
|
131
|
+
|
|
132
|
+
# Maximum cache history entries for sparkline rendering.
|
|
133
|
+
# Each braille character encodes 2 data points, so 200 entries
|
|
134
|
+
# render as ~100 characters.
|
|
135
|
+
max_cache_history = 200
|
|
136
|
+
|
|
137
|
+
# ─── Theme ────────────────────────────────────────────────────────
|
|
138
|
+
|
|
139
|
+
[theme]
|
|
140
|
+
|
|
141
|
+
# Progress bar width in characters.
|
|
142
|
+
progress_bar_width = 8
|
|
143
|
+
|
|
144
|
+
# Rate limit color thresholds (percentage).
|
|
145
|
+
# Below warning = green, between warning and critical = yellow, above critical = red.
|
|
146
|
+
rate_limit_warning = 70
|
|
147
|
+
rate_limit_critical = 90
|
|
148
|
+
|
|
149
|
+
# Cache hit color thresholds (percentage).
|
|
150
|
+
# Above good = green, between low and good = yellow, below low = red.
|
|
151
|
+
cache_hit_good = 70
|
|
152
|
+
cache_hit_low = 30
|
|
153
|
+
|
|
154
|
+
# Chat message background colors (256-color palette codes).
|
|
155
|
+
# 22 = dark green (#005f00), 17 = dark navy (#00005f).
|
|
156
|
+
# Full palette: https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit
|
|
157
|
+
user_message_bg = 22
|
|
158
|
+
assistant_message_bg = 17
|
|
159
|
+
|
|
160
|
+
# Scrollbar colors.
|
|
161
|
+
scrollbar_thumb = "cyan"
|
|
162
|
+
scrollbar_track = "dark_gray"
|
|
163
|
+
|
|
164
|
+
# Semantic colors — consistent visual language across the TUI.
|
|
165
|
+
# Success (connected, completed, saved), error (disconnected, failed),
|
|
166
|
+
# warning (connecting, loading, in-progress), info (labels, highlights),
|
|
167
|
+
# muted (de-emphasized, idle, hints), accent (tool calls, special actions).
|
|
168
|
+
color_success = "green"
|
|
169
|
+
color_error = "red"
|
|
170
|
+
color_warning = "yellow"
|
|
171
|
+
color_info = "cyan"
|
|
172
|
+
color_muted = "dark_gray"
|
|
173
|
+
color_accent = "magenta"
|
|
174
|
+
color_text = "white"
|
|
175
|
+
|
|
176
|
+
# Selection highlight (session picker, menus).
|
|
177
|
+
highlight_fg = "black"
|
|
178
|
+
highlight_bg = "cyan"
|
|
179
|
+
|
|
180
|
+
# Flash notification colors.
|
|
181
|
+
flash_error_fg = "white"
|
|
182
|
+
flash_error_bg = "red"
|
|
183
|
+
flash_warning_fg = "black"
|
|
184
|
+
flash_warning_bg = "yellow"
|
|
185
|
+
flash_info_fg = "white"
|
|
186
|
+
flash_info_bg = "blue"
|
|
187
|
+
|
|
188
|
+
# Token count color for expensive responses (10k-20k tokens).
|
|
189
|
+
# 208 = orange in 256-color palette.
|
|
190
|
+
color_expensive = 208
|
|
191
|
+
|
|
192
|
+
# Tool response CRUD colors — distinguish read/create/update at a glance.
|
|
193
|
+
tool_read_color = "light_blue"
|
|
194
|
+
tool_create_color = "light_green"
|
|
195
|
+
tool_update_color = "light_yellow"
|
|
196
|
+
|
|
197
|
+
# Border colors.
|
|
198
|
+
border_focused = "yellow"
|
|
199
|
+
border_normal = "white"
|
|
200
|
+
border_input_connected = "green"
|
|
201
|
+
border_input_connecting = "yellow"
|
|
202
|
+
border_input_disconnected = "dark_gray"
|
|
203
|
+
|
|
204
|
+
# ─── Performance ─────────────────────────────────────────────────
|
|
205
|
+
|
|
206
|
+
[performance]
|
|
207
|
+
|
|
208
|
+
# File path for TUI performance debug logs (relative to working directory).
|
|
209
|
+
log_path = "log/tui_performance.log"
|
data/workflows/review_pr.md
CHANGED
|
@@ -124,37 +124,38 @@ Read the diff from: /tmp/pr_<number>_diff.txt
|
|
|
124
124
|
- REST conventions and route design
|
|
125
125
|
- ActiveRecord patterns (associations, validations placement)
|
|
126
126
|
- Service object patterns and naming
|
|
127
|
+
- Security-adjacent AR patterns: raw SQL interpolation, mass assignment gaps, missing tenant/org scoping on shared-model queries
|
|
127
128
|
|
|
128
129
|
Output: List findings tagged [major], [minor], or [nit] with file:line references."
|
|
129
130
|
```
|
|
130
131
|
|
|
131
|
-
#### Subagent 2:
|
|
132
|
+
#### Subagent 2: TicketDelivery
|
|
132
133
|
|
|
133
134
|
```
|
|
134
|
-
Prompt: "
|
|
135
|
+
Prompt: "Your role: verify this PR delivers the ticket. Code-quality subagents judge how the work was done; you judge whether the work was done.
|
|
135
136
|
|
|
136
137
|
Read the diff from: /tmp/pr_<number>_diff.txt
|
|
137
138
|
|
|
138
|
-
|
|
139
|
+
The ticket defines 'done'. The PR description is how the author frames their work — useful context, not authority. When the two disagree, the ticket wins and the disagreement itself is a finding.
|
|
139
140
|
|
|
140
|
-
## Ticket
|
|
141
|
-
<ticket title,
|
|
141
|
+
## Ticket (verbatim — do not summarize)
|
|
142
|
+
<full ticket title, description, every Task, every Acceptance Criterion>
|
|
143
|
+
|
|
144
|
+
## PR description (verbatim)
|
|
145
|
+
<PR body from Step 1>
|
|
142
146
|
|
|
143
147
|
## Historical Context
|
|
144
148
|
<output from thoughts-analyzer>
|
|
145
149
|
|
|
146
150
|
<any additional instructions from user input>
|
|
147
151
|
|
|
148
|
-
##
|
|
149
|
-
- SQL injection (raw queries, interpolation in where clauses)
|
|
150
|
-
- XSS vulnerabilities (unescaped output, html_safe misuse)
|
|
151
|
-
- CSRF protection gaps
|
|
152
|
-
- Mass assignment vulnerabilities (permit params)
|
|
153
|
-
- Authentication/authorization bypasses
|
|
154
|
-
- Secrets or credentials in code
|
|
155
|
-
- Insecure direct object references
|
|
152
|
+
## How to work
|
|
156
153
|
|
|
157
|
-
|
|
154
|
+
Map each requirement in the ticket — Tasks, Acceptance Criteria, named targets — to evidence in the diff. For each, produce one line: ✅ delivered, ⚠️ partial, or ❌ missing, with file:line references.
|
|
155
|
+
|
|
156
|
+
A requirement is delivered when the code does what the ticket asked for in meaning, not merely in mention. Match semantics against the ticket's verbs: 'add Y' needs Y; 'replace X with Y' needs Y and no X. When the ticket lists multiple targets, verify each separately.
|
|
157
|
+
|
|
158
|
+
Output: the verification table first. Then findings tagged [major], [minor], or [nit] with file:line references."
|
|
158
159
|
```
|
|
159
160
|
|
|
160
161
|
#### Subagent 3: PerfPro
|
|
@@ -182,6 +183,7 @@ Read the diff from: /tmp/pr_<number>_diff.txt
|
|
|
182
183
|
- Memory bloat (loading large datasets)
|
|
183
184
|
- Missing caching opportunities
|
|
184
185
|
- Background job considerations (should this be async?)
|
|
186
|
+
- Cross-tenant data leakage in aggregation (missing organization_id scope on joins, unscoped WHERE in reports)
|
|
185
187
|
|
|
186
188
|
Output: List findings tagged [major], [minor], or [nit] with file:line references."
|
|
187
189
|
```
|
|
@@ -210,6 +212,7 @@ Read the diff from: /tmp/pr_<number>_diff.txt
|
|
|
210
212
|
- Test isolation issues (shared state, missing cleanup)
|
|
211
213
|
- Assertion quality (testing behavior vs implementation)
|
|
212
214
|
- Missing edge case coverage
|
|
215
|
+
- Missing coverage for authorization boundaries (cross-org access denial, role-based access denied, unauthenticated request rejected)
|
|
213
216
|
|
|
214
217
|
Output: List findings tagged [major], [minor], or [nit] with file:line references."
|
|
215
218
|
```
|
|
@@ -235,6 +238,7 @@ Read the diff from: /tmp/pr_<number>_diff.txt
|
|
|
235
238
|
- Complex logic lacking explanatory comments
|
|
236
239
|
- Misleading or outdated comments
|
|
237
240
|
- Magic numbers or strings needing constants
|
|
241
|
+
- Secrets, tokens, or credentials appearing in logs, comments, error messages, or test fixtures; permission-gating magic constants that should be named
|
|
238
242
|
|
|
239
243
|
Output: List findings tagged [major], [minor], or [nit] with file:line references."
|
|
240
244
|
```
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: anima-core
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Yevhenii Hurin
|
|
@@ -9,6 +9,20 @@ bindir: exe
|
|
|
9
9
|
cert_chain: []
|
|
10
10
|
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: aasm
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - "~>"
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '5.5'
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - "~>"
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '5.5'
|
|
12
26
|
- !ruby/object:Gem::Dependency
|
|
13
27
|
name: certifi
|
|
14
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -260,20 +274,31 @@ files:
|
|
|
260
274
|
- app/decorators/agent_message_decorator.rb
|
|
261
275
|
- app/decorators/application_decorator.rb
|
|
262
276
|
- app/decorators/message_decorator.rb
|
|
277
|
+
- app/decorators/pending_from_melete_decorator.rb
|
|
278
|
+
- app/decorators/pending_from_melete_goal_decorator.rb
|
|
279
|
+
- app/decorators/pending_from_melete_skill_decorator.rb
|
|
280
|
+
- app/decorators/pending_from_melete_workflow_decorator.rb
|
|
281
|
+
- app/decorators/pending_from_mneme_decorator.rb
|
|
282
|
+
- app/decorators/pending_message_decorator.rb
|
|
283
|
+
- app/decorators/pending_subagent_decorator.rb
|
|
284
|
+
- app/decorators/pending_tool_response_decorator.rb
|
|
285
|
+
- app/decorators/pending_user_message_decorator.rb
|
|
263
286
|
- app/decorators/system_message_decorator.rb
|
|
264
287
|
- app/decorators/tool_call_decorator.rb
|
|
265
288
|
- app/decorators/tool_decorator.rb
|
|
266
289
|
- app/decorators/tool_response_decorator.rb
|
|
267
290
|
- app/decorators/user_message_decorator.rb
|
|
268
291
|
- app/decorators/web_get_tool_decorator.rb
|
|
269
|
-
- app/jobs/agent_request_job.rb
|
|
270
|
-
- app/jobs/analytical_brain_job.rb
|
|
271
292
|
- app/jobs/application_job.rb
|
|
272
|
-
- app/jobs/
|
|
293
|
+
- app/jobs/count_tokens_job.rb
|
|
294
|
+
- app/jobs/drain_job.rb
|
|
295
|
+
- app/jobs/melete_enrichment_job.rb
|
|
296
|
+
- app/jobs/melete_enrichment_job/goal_change_listener.rb
|
|
297
|
+
- app/jobs/mneme_enrichment_job.rb
|
|
273
298
|
- app/jobs/mneme_job.rb
|
|
274
|
-
- app/jobs/
|
|
299
|
+
- app/jobs/tool_execution_job.rb
|
|
275
300
|
- app/models/application_record.rb
|
|
276
|
-
- app/models/concerns/
|
|
301
|
+
- app/models/concerns/token_estimation.rb
|
|
277
302
|
- app/models/goal.rb
|
|
278
303
|
- app/models/goal_pinned_message.rb
|
|
279
304
|
- app/models/message.rb
|
|
@@ -282,9 +307,12 @@ files:
|
|
|
282
307
|
- app/models/secret.rb
|
|
283
308
|
- app/models/session.rb
|
|
284
309
|
- app/models/snapshot.rb
|
|
310
|
+
- bin/inspect-cassette
|
|
285
311
|
- bin/jobs
|
|
286
312
|
- bin/rails
|
|
287
313
|
- bin/rake
|
|
314
|
+
- bin/release
|
|
315
|
+
- bin/with-llms
|
|
288
316
|
- config.ru
|
|
289
317
|
- config/application.rb
|
|
290
318
|
- config/boot.rb
|
|
@@ -295,7 +323,6 @@ files:
|
|
|
295
323
|
- config/environments/production.rb
|
|
296
324
|
- config/environments/test.rb
|
|
297
325
|
- config/initializers/event_subscribers.rb
|
|
298
|
-
- config/initializers/fts5_schema_dump.rb
|
|
299
326
|
- config/initializers/inflections.rb
|
|
300
327
|
- config/initializers/time_nanoseconds.rb
|
|
301
328
|
- config/puma.rb
|
|
@@ -303,6 +330,7 @@ files:
|
|
|
303
330
|
- config/recurring.yml
|
|
304
331
|
- config/routes.rb
|
|
305
332
|
- db/cable_schema.rb
|
|
333
|
+
- db/cable_structure.sql
|
|
306
334
|
- db/migrate/.keep
|
|
307
335
|
- db/migrate/20260308124202_create_sessions.rb
|
|
308
336
|
- db/migrate/20260308124203_create_events.rb
|
|
@@ -330,24 +358,27 @@ files:
|
|
|
330
358
|
- db/migrate/20260328100000_create_secrets.rb
|
|
331
359
|
- db/migrate/20260328152142_add_evicted_at_to_goals.rb
|
|
332
360
|
- db/migrate/20260329120000_create_pending_messages.rb
|
|
361
|
+
- db/migrate/20260330120000_add_source_to_pending_messages.rb
|
|
362
|
+
- db/migrate/20260401180000_add_api_metrics_to_messages.rb
|
|
363
|
+
- db/migrate/20260401210935_remove_recalled_message_ids_from_sessions.rb
|
|
364
|
+
- db/migrate/20260403080031_add_initial_cwd_to_sessions.rb
|
|
365
|
+
- db/migrate/20260407170803_remove_viewport_message_ids_from_sessions.rb
|
|
366
|
+
- db/migrate/20260407180400_remove_mneme_snapshot_pointer_columns_from_sessions.rb
|
|
367
|
+
- db/migrate/20260411120553_add_token_count_to_pinned_messages.rb
|
|
368
|
+
- db/migrate/20260411172926_remove_active_skills_and_workflow_from_sessions.rb
|
|
369
|
+
- db/migrate/20260412110625_replace_processing_with_aasm_state.rb
|
|
370
|
+
- db/migrate/20260418150323_add_kind_and_message_type_to_pending_messages.rb
|
|
371
|
+
- db/migrate/20260419120000_add_drain_fields_to_pending_messages.rb
|
|
372
|
+
- db/migrate/20260419130000_drop_pending_messages_kind_default.rb
|
|
373
|
+
- db/migrate/20260419140000_add_drain_indexes_to_pending_messages.rb
|
|
374
|
+
- db/migrate/20260420100000_add_hud_visibility_to_sessions.rb
|
|
333
375
|
- db/queue_schema.rb
|
|
376
|
+
- db/queue_structure.sql
|
|
334
377
|
- db/seeds.rb
|
|
378
|
+
- db/structure.sql
|
|
335
379
|
- exe/anima
|
|
336
|
-
- lib/agent_loop.rb
|
|
337
380
|
- lib/agents/definition.rb
|
|
338
381
|
- lib/agents/registry.rb
|
|
339
|
-
- lib/analytical_brain.rb
|
|
340
|
-
- lib/analytical_brain/runner.rb
|
|
341
|
-
- lib/analytical_brain/tools/activate_skill.rb
|
|
342
|
-
- lib/analytical_brain/tools/assign_nickname.rb
|
|
343
|
-
- lib/analytical_brain/tools/deactivate_skill.rb
|
|
344
|
-
- lib/analytical_brain/tools/deactivate_workflow.rb
|
|
345
|
-
- lib/analytical_brain/tools/everything_is_ready.rb
|
|
346
|
-
- lib/analytical_brain/tools/finish_goal.rb
|
|
347
|
-
- lib/analytical_brain/tools/read_workflow.rb
|
|
348
|
-
- lib/analytical_brain/tools/rename_session.rb
|
|
349
|
-
- lib/analytical_brain/tools/set_goal.rb
|
|
350
|
-
- lib/analytical_brain/tools/update_goal.rb
|
|
351
382
|
- lib/anima.rb
|
|
352
383
|
- lib/anima/cli.rb
|
|
353
384
|
- lib/anima/cli/mcp.rb
|
|
@@ -358,35 +389,70 @@ files:
|
|
|
358
389
|
- lib/anima/spinner.rb
|
|
359
390
|
- lib/anima/version.rb
|
|
360
391
|
- lib/credential_store.rb
|
|
361
|
-
- lib/
|
|
362
|
-
- lib/events/agent_message.rb
|
|
392
|
+
- lib/events/authentication_required.rb
|
|
363
393
|
- lib/events/base.rb
|
|
364
394
|
- lib/events/bounce_back.rb
|
|
365
395
|
- lib/events/bus.rb
|
|
396
|
+
- lib/events/eviction_completed.rb
|
|
397
|
+
- lib/events/goal_created.rb
|
|
398
|
+
- lib/events/goal_updated.rb
|
|
399
|
+
- lib/events/llm_responded.rb
|
|
400
|
+
- lib/events/message_created.rb
|
|
401
|
+
- lib/events/message_updated.rb
|
|
402
|
+
- lib/events/session_state_changed.rb
|
|
403
|
+
- lib/events/skill_activated.rb
|
|
404
|
+
- lib/events/start_melete.rb
|
|
405
|
+
- lib/events/start_mneme.rb
|
|
406
|
+
- lib/events/start_processing.rb
|
|
407
|
+
- lib/events/subagent_evicted.rb
|
|
366
408
|
- lib/events/subscriber.rb
|
|
367
|
-
- lib/events/subscribers/
|
|
409
|
+
- lib/events/subscribers/active_state_broadcaster.rb
|
|
410
|
+
- lib/events/subscribers/authentication_broadcaster.rb
|
|
411
|
+
- lib/events/subscribers/drain_kickoff.rb
|
|
412
|
+
- lib/events/subscribers/eviction_broadcaster.rb
|
|
413
|
+
- lib/events/subscribers/llm_response_handler.rb
|
|
414
|
+
- lib/events/subscribers/melete_kickoff.rb
|
|
415
|
+
- lib/events/subscribers/message_broadcaster.rb
|
|
416
|
+
- lib/events/subscribers/mneme_kickoff.rb
|
|
417
|
+
- lib/events/subscribers/mneme_scheduler.rb
|
|
368
418
|
- lib/events/subscribers/persister.rb
|
|
419
|
+
- lib/events/subscribers/session_state_broadcaster.rb
|
|
369
420
|
- lib/events/subscribers/subagent_message_router.rb
|
|
421
|
+
- lib/events/subscribers/subagent_visibility_broadcaster.rb
|
|
422
|
+
- lib/events/subscribers/tool_response_creator.rb
|
|
370
423
|
- lib/events/subscribers/transient_broadcaster.rb
|
|
371
424
|
- lib/events/system_message.rb
|
|
372
|
-
- lib/events/
|
|
373
|
-
- lib/events/tool_response.rb
|
|
425
|
+
- lib/events/tool_executed.rb
|
|
374
426
|
- lib/events/user_message.rb
|
|
427
|
+
- lib/events/workflow_activated.rb
|
|
375
428
|
- lib/llm/client.rb
|
|
376
429
|
- lib/mcp/client_manager.rb
|
|
377
430
|
- lib/mcp/config.rb
|
|
378
431
|
- lib/mcp/health_check.rb
|
|
379
432
|
- lib/mcp/secrets.rb
|
|
380
433
|
- lib/mcp/stdio_transport.rb
|
|
434
|
+
- lib/melete.rb
|
|
435
|
+
- lib/melete/runner.rb
|
|
436
|
+
- lib/melete/tools/activate_skill.rb
|
|
437
|
+
- lib/melete/tools/assign_nickname.rb
|
|
438
|
+
- lib/melete/tools/everything_is_ready.rb
|
|
439
|
+
- lib/melete/tools/finish_goal.rb
|
|
440
|
+
- lib/melete/tools/goal_messaging.rb
|
|
441
|
+
- lib/melete/tools/read_workflow.rb
|
|
442
|
+
- lib/melete/tools/rename_session.rb
|
|
443
|
+
- lib/melete/tools/set_goal.rb
|
|
444
|
+
- lib/melete/tools/update_goal.rb
|
|
381
445
|
- lib/mneme.rb
|
|
382
|
-
- lib/mneme/
|
|
446
|
+
- lib/mneme/base_runner.rb
|
|
383
447
|
- lib/mneme/l2_runner.rb
|
|
384
|
-
- lib/mneme/
|
|
448
|
+
- lib/mneme/recall_runner.rb
|
|
385
449
|
- lib/mneme/runner.rb
|
|
386
450
|
- lib/mneme/search.rb
|
|
387
451
|
- lib/mneme/tools/attach_messages_to_goals.rb
|
|
388
452
|
- lib/mneme/tools/everything_ok.rb
|
|
453
|
+
- lib/mneme/tools/nothing_to_surface.rb
|
|
389
454
|
- lib/mneme/tools/save_snapshot.rb
|
|
455
|
+
- lib/mneme/tools/surface_memory.rb
|
|
390
456
|
- lib/providers/anthropic.rb
|
|
391
457
|
- lib/shell_session.rb
|
|
392
458
|
- lib/skills/definition.rb
|
|
@@ -399,14 +465,14 @@ files:
|
|
|
399
465
|
- lib/tools/mcp_tool.rb
|
|
400
466
|
- lib/tools/open_issue.rb
|
|
401
467
|
- lib/tools/read.rb
|
|
402
|
-
- lib/tools/recall.rb
|
|
403
468
|
- lib/tools/registry.rb
|
|
404
|
-
- lib/tools/remember.rb
|
|
405
469
|
- lib/tools/response_truncator.rb
|
|
470
|
+
- lib/tools/search_messages.rb
|
|
406
471
|
- lib/tools/spawn_specialist.rb
|
|
407
472
|
- lib/tools/spawn_subagent.rb
|
|
408
473
|
- lib/tools/subagent_prompts.rb
|
|
409
474
|
- lib/tools/think.rb
|
|
475
|
+
- lib/tools/view_messages.rb
|
|
410
476
|
- lib/tools/web_get.rb
|
|
411
477
|
- lib/tools/write.rb
|
|
412
478
|
- lib/tui/app.rb
|
|
@@ -426,6 +492,7 @@ files:
|
|
|
426
492
|
- lib/tui/message_store.rb
|
|
427
493
|
- lib/tui/performance_logger.rb
|
|
428
494
|
- lib/tui/screens/chat.rb
|
|
495
|
+
- lib/tui/settings.rb
|
|
429
496
|
- lib/workflows/definition.rb
|
|
430
497
|
- lib/workflows/registry.rb
|
|
431
498
|
- skills/activerecord/SKILL.md
|
|
@@ -530,6 +597,7 @@ files:
|
|
|
530
597
|
- skills/draper-decorators/references/patterns.md
|
|
531
598
|
- skills/draper-decorators/references/testing.md
|
|
532
599
|
- skills/gh-issue.md
|
|
600
|
+
- skills/github.md
|
|
533
601
|
- skills/mcp-server/SKILL.md
|
|
534
602
|
- skills/mcp-server/examples/dynamic_tools.rb
|
|
535
603
|
- skills/mcp-server/examples/file_manager_tool.rb
|
|
@@ -609,6 +677,7 @@ files:
|
|
|
609
677
|
- skills/rspec/references/rails.md
|
|
610
678
|
- templates/config.toml
|
|
611
679
|
- templates/soul.md
|
|
680
|
+
- templates/tui.toml
|
|
612
681
|
- workflows/commit.md
|
|
613
682
|
- workflows/create_handoff.md
|
|
614
683
|
- workflows/create_note.md
|