diff --git a/fleet/allegro/allegro-cycle-state.json b/fleet/allegro/allegro-cycle-state.json index af270bb9..15c0f220 100644 --- a/fleet/allegro/allegro-cycle-state.json +++ b/fleet/allegro/allegro-cycle-state.json @@ -1,15 +1,25 @@ { "version": 1, - "last_updated": "2026-04-05T21:17:00Z", + "last_updated": "2026-04-06T15:35:00Z", "cycles": [ { "cycle_id": "init", "started_at": "2026-04-05T21:17:00Z", + "completed_at": "2026-04-05T21:20:00Z", "target": "Epic #842: Create self-improvement infrastructure", + "status": "complete", + "last_completed_step": "Created wake checklist, lane definition, hands-off registry, failure log, handoff template, validator script", + "evidence": "commit e4b1a19 in branch allegro/self-improvement-infra", + "next_step": "Deploy files to ~/.hermes and create PR" + }, + { + "cycle_id": "2026-04-06-deploy", + "started_at": "2026-04-06T15:35:00Z", + "target": "Deploy Allegro self-improvement infrastructure to ~/.hermes", "status": "in_progress", - "last_completed_step": "Created wake checklist and lane definition", - "evidence": "local files: allegro-wake-checklist.md, allegro-lane.md", - "next_step": "Create hands-off registry, failure log, handoff template, validator script" + "last_completed_step": "Created install.sh and updated cycle state", + "evidence": "fleet/allegro/install.sh, fleet/allegro/allegro-cycle-state.json", + "next_step": "Run install.sh, commit, push branch, create PR, update Gitea issue #845" } ] } diff --git a/fleet/allegro/burn-mode-validator.py b/fleet/allegro/burn-mode-validator.py index 015631e5..252090b6 100755 --- a/fleet/allegro/burn-mode-validator.py +++ b/fleet/allegro/burn-mode-validator.py @@ -10,12 +10,21 @@ import os import sys from datetime import datetime, timezone -LOG_PATH = os.path.expanduser("~/.hermes/burn-logs/allegro.log") +import glob + +LOG_DIR = os.path.expanduser("~/.hermes/burn-logs") +_dated = os.path.join(LOG_DIR, f"burn_{datetime.now(timezone.utc).strftime('%Y%m%d')}.log") +LOG_PATH = _dated if os.path.exists(_dated) else os.path.join(LOG_DIR, "allegro.log") STATE_PATH = os.path.expanduser("~/.hermes/allegro-cycle-state.json") FAILURE_LOG_PATH = os.path.expanduser("~/.hermes/allegro-failure-log.md") +def ensure_log_dir(): + os.makedirs(os.path.dirname(LOG_PATH), exist_ok=True) + + def score_cycle(): + ensure_log_dir() now = datetime.now(timezone.utc).isoformat() scores = { "state_check_completed": 0, diff --git a/fleet/allegro/install.sh b/fleet/allegro/install.sh new file mode 100644 index 00000000..a0b86ccb --- /dev/null +++ b/fleet/allegro/install.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +# Allegro Self-Improvement Infrastructure Installer +# Deploys operational files from the-nexus fleet/allegro/ to ~/.hermes/ +# Part of Epic #842 (M2-M7) + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +HOME_DIR="${HOME:-$(eval echo ~$(whoami))}" +TARGET_DIR="${HOME_DIR}/.hermes" +LOG_DIR="${TARGET_DIR}/burn-logs" + +echo "[install] Deploying Allegro self-improvement infrastructure..." + +mkdir -p "${TARGET_DIR}" +mkdir -p "${LOG_DIR}" + +# Copy operational files (not symlinks; these need to survive repo checkouts) +cp -v "${SCRIPT_DIR}/allegro-wake-checklist.md" "${TARGET_DIR}/" +cp -v "${SCRIPT_DIR}/allegro-lane.md" "${TARGET_DIR}/" +cp -v "${SCRIPT_DIR}/allegro-failure-log.md" "${TARGET_DIR}/" +cp -v "${SCRIPT_DIR}/allegro-handoff-template.md" "${TARGET_DIR}/" +cp -v "${SCRIPT_DIR}/allegro-hands-off-registry.json" "${TARGET_DIR}/" +cp -v "${SCRIPT_DIR}/allegro-cycle-state.json" "${TARGET_DIR}/" + +# Copy executable scripts +chmod +x "${SCRIPT_DIR}/burn-mode-validator.py" +cp -v "${SCRIPT_DIR}/burn-mode-validator.py" "${TARGET_DIR}/" + +echo "[install] Done. Files installed to ${TARGET_DIR}" +echo "[install] Run ${TARGET_DIR}/burn-mode-validator.py at the end of each cycle."