From 3eedd34ac18a04a5089c1514bf8066ea81fd5e80 Mon Sep 17 00:00:00 2001 From: Eduardo Chiarotti Date: Mon, 10 Aug 2026 11:39:59 -0300 Subject: [PATCH] Add evolve status CLI helper --- src/ai_agent/features/evolve/status.py | 29 ++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/ai_agent/features/evolve/status.py diff --git a/src/ai_agent/features/evolve/status.py b/src/ai_agent/features/evolve/status.py new file mode 100644 index 0000000..e0cdd40 --- /dev/null +++ b/src/ai_agent/features/evolve/status.py @@ -0,0 +1,29 @@ +"""Status rendering for the evolve organism.""" + +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any + + +def render_status(state: Mapping[str, Any]) -> str: + """Render the public evolve status in a stable, human-readable format.""" + lines = [ + f"organism_id: {state.get('organism_id', '')}", + f"stopped: {state.get('stopped', False)}", + f"goals_queue: {state.get('goals_queue', [])}", + f"evolves_today: {state.get('evolves_today', 0)}/{state.get('max_evolves_today', 0)}", + f"merges_today: {state.get('merges_today', 0)}", + f"next_wake_at: {state.get('next_wake_at', '')}", + f"last_run_id: {state.get('last_run_id', '')}", + ] + last_run = state.get("last_run") + if isinstance(last_run, Mapping): + lines.extend( + [ + f"status: {last_run.get('status', '')}", + f"pr_url: {last_run.get('pr_url', '')}", + f"intent: {last_run.get('intent', '')}", + ] + ) + return "\n".join(lines)