🧬 feat(agents): add bee.Evolver autonomous self-improvement agent#208
Conversation
Introduces bee.Evolver — an agent that runs on parasitic compute
(GitHub Actions free tier + Google Colab) and autonomously improves
the Hive by generating code patches, prompt updates, docs, and
GitHub Issues/PRs.
Architecture follows the existing ATCG pattern:
- Aggregator: reads git log, HIVE_STATE.md, open Issues/PRs, filesystem
- Transformer: LLM analysis (Mistral primary, GPT-4o-mini fallback)
produces an EvolutionPlan with typed Improvement items
- Generator: creates evolver/cycle-{timestamp} branch, applies patches
via git apply, commits with [skip ci] and pushes
- Connector: opens GitHub Issues + PR (label: evolver), sends Telegram
metabolic status pulse directly via Bot API (no NATS dependency)
Triggers: weekly cron (Mon 06:00 UTC) + workflow_dispatch with
optional focus hint input.
Also includes tools/evolver_colab.ipynb for manual heavy-inference
runs on Colab T4 GPU.
Co-authored-by: Ona <no-reply@ona.com>
There was a problem hiding this comment.
Code Review
This pull request introduces bee.Evolver, an autonomous self-improvement agent for the Aura Hive. The agent follows the ATCG (Aggregator, Transformer, Connector, Generator) architecture to analyze the repository's state, propose mutations via an LLM, apply code or documentation patches, and communicate results through GitHub and Telegram. The review feedback focuses on enhancing the robustness and configurability of the agent. Key suggestions include implementing recursive filesystem scanning to provide better context to the LLM, avoiding global git configuration side effects in CI environments, and externalizing hardcoded parameters such as API pagination limits and truncation thresholds into the settings module.
- Filesystem scan: switch from top-level iterdir to recursive rglob with configurable exclude_dirs (default: .git, .venv, __pycache__, gen-proto, etc.) so the LLM receives full project context - Git identity: drop --global flag, scope config to repo with check=True so failures surface immediately rather than silently - GitHub Issues fetch: remove empty labels= param (was filtering for unlabelled issues only); externalize per_page and body truncation limit into EvolverSettings (EVOLVER_ISSUES_PER_PAGE, EVOLVER_ISSUE_BODY_LIMIT) Co-authored-by: Ona <no-reply@ona.com>
|
All four review comments addressed in e57fab3: [high] Recursive filesystem scan ( [high] Local git config, no silent failures ( [medium] GitHub Issues fetch params ( [medium] Issue body truncation limit ( |
- generator/__init__.py: remove unused datetime/UTC imports (timestamp is passed in as a pre-formatted string from metabolism.py) - tools/evolver_colab.ipynb: exclude from ruff in pyproject.toml; Colab notebooks have inherently cross-cell state that makes E402 (imports after non-import statements) and I001 (import ordering) inapplicable; also remove unused json import and bare f-string Co-authored-by: Ona <no-reply@ona.com>
- main.py: add noqa: E402 to imports after sys.path.insert block - connector/__init__.py: remove unused UTC and datetime imports Co-authored-by: Ona <no-reply@ona.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces bee.Evolver, an autonomous self-improvement agent for the Aura Hive. The agent follows the ATCG (Aggregator, Transformer, Connector, Generator) architecture to analyze the repository's state, propose mutations via an LLM, apply code or documentation patches, and communicate results through GitHub and Telegram. The review feedback suggests several technical refinements: using git checkout -B for more robust branch management, switching to a more reliable Telegram message format (HTML or MarkdownV2) to prevent parsing failures, optimizing filesystem traversal by pruning excluded directories early, and implementing pagination for GitHub API requests to ensure full context is captured.
- generator: use checkout -B (force-reset) instead of -b so a previously interrupted cycle on the same timestamp doesn't fail with 'branch already exists' - connector: switch Telegram parse_mode from Markdown V1 to HTML; add _h() escape helper for &, <, > so LLM-generated titles with underscores, asterisks, or backticks don't cause 400 parse errors - aggregator: replace rglob+post-filter with os.walk and in-place dirs pruning so excluded directories (.git, .venv, node_modules) are never traversed, improving performance on large repos - aggregator: paginate GitHub Issues fetch; collects pages until issues_per_page total items are gathered or the last page is reached, ensuring no issues are silently missed Co-authored-by: Ona <no-reply@ona.com>
What
Introduces
bee.Evolver— an autonomous agent that runs on parasitic compute (GitHub Actions free tier + Google Colab) and improves the Hive by generating code patches, prompt updates, docs, and GitHub Issues/PRs.Architecture
Follows the existing ATCG pattern, lives at
agents/bee-evolver/:src/hive/aggregator/HIVE_STATE.md, open Issues/PRs, filesystem, keeper promptsrc/hive/transformer/EvolutionPlanwith typedImprovementitemssrc/hive/generator/evolver/cycle-{timestamp}branch, applies patches viagit apply, commits[skip ci]+ pushessrc/hive/connector/evolver), sends Telegram pulse via Bot APITriggers
cron: '0 6 * * 1')workflow_dispatchwith optionalfocusinput (e.g."improve prompts","fix heresies")Telegram metabolic pulse
After each cycle, sends a message to
AURA_BEE_KEEPER__ADMIN_CHAT_ID:Key design decisions
https://api.telegram.org. The evolver runs in CI without cluster access.[skip ci]on all commits — prevents the evolver's own push from triggering the main pipeline in a loop.git apply --checkfirst; failures are collected and reported in the Telegram pulse rather than aborting the cycle.issuetype as safe fallback — the LLM prompt instructs the model to prefertype: "issue"over a potentially broken code patch when uncertain.Google Colab
tools/evolver_colab.ipynb— 7-cell notebook for manual heavy-inference runs on Colab T4 GPU. Not auto-triggered.Secrets required
Add to GitHub repo secrets if not already present:
AURA_TELEGRAM_TOKENAURA_BEE_KEEPER__ADMIN_CHAT_ID(already used by bee.Keeper)MISTRAL_API_KEY,OPENAI_API_KEY,GITHUB_TOKENare already configured.