Commit Graph

4 Commits

Author SHA1 Message Date
Bo d82adc3717 fix(evolve): sync local main to origin/main before discovery (ag-6jt #discovery-origin-main) (#636)
## What

The evolve-cron-rpi loop's phase-1 discovery diffed candidate slices
against a **stale local `main`** (the rpi worktree's local main lags
`origin/main`), so work already merged to `origin/main` read as "open"
and got re-seeded as duplicate beads/PRs (ag-b8m≈ag-jov, ag-6kw≈ag-c2i —
4th recurrence). The `work-selection-ladder` reference *claimed* "the
cron syncs local main to origin/main before discovery" but no code
actually did it.

## Change

- **`skills/evolve/scripts/sync-main-to-origin.sh`** (new): `git fetch
origin`, then fast-forward local `main` to `origin/main` (never forced),
emitting `DIFF_BASE: origin/main <sha>` as the authoritative diff base.
A divergence is refused, never force-moved.
- **`scripts/overnight-evolve.sh`**: runs the sync before the loop's
discovery phase. Non-fatal on warning (loop proceeds with origin/main as
the base).
- **`skills/evolve/references/work-selection-ladder.md`**: the claimed
sync now points at the real, runnable script.
- **`tests/scripts/sync-main-to-origin.bats`** (new): hermetic bare-repo
tests pin the diff base = origin/main after fetch (not stale local
main), local main fast-forwards, divergence is refused, and a custom
remote is respected.

Pairs with the grep-existing-beads guard (`duplicate-work-guard.sh`,
#582) to cover both halves of the bead.

## Gates
- `shellcheck --severity=error` clean on both modified scripts.
- `bats tests/scripts/sync-main-to-origin.bats` — 5/5 pass.
- `git diff origin/main --stat` — scope-only (4 files,
evolve/rpi-discovery surface).

Closes-scenario: ag-6jt#discovery-origin-main
Bounded-context: BC3-Loop
Evidence: skills/evolve/scripts/sync-main-to-origin.sh
2026-05-31 12:35:00 -04:00
bo a9d1a35a8b fix(automation): drop --quality/--test-first from ao evolve invocation
Skill-doc-only flags; not implemented in ao evolve v2 CLI. Use --max-cycles
+ --ensure-cleanup which are real CLI flags.
2026-05-02 12:18:55 -04:00
bo f321b574ba fix(automation): align overnight-evolve.sh dirty-tree check with preflight (ignore tool-auto-mutated paths) 2026-05-02 12:18:55 -04:00
bo 5baf0592da feat(automation): overnight ao evolve loop — kickoff + preflight + Wave-1.5 seed
OE-1: seed 8 Wave-1.5 polish items into .agents/rpi/next-work.jsonl
  - awk portability fix (high)
  - lib/finding-compiler-helpers.sh extraction (medium)
  - doc-index entry for eval-verdict-pipeline (low)
  - 9-marker test extension (medium)
  - --reconcile mode stub (low)
  - SCHEMA.md content_hash recompute (low)
  - cross-vendor Codex review (medium)
  - Wave 2 starter: capture-sidecar privacy doc (medium)

OE-2: scripts/overnight-evolve.sh
  Wraps gtimeout 8h ao evolve --quality --max-cycles=10 --test-first.
  Pre-flight refuses dirty tree. Tees output to ~/.agents/overnight/<DATE>/run.log.
  Writes morning summary.md on exit (any cause): commits made, files changed,
  fitness deltas, kill-switch state, exit code interpretation.
  Kill switch: file at $AGENTOPS_OVERNIGHT_KILL_SWITCH (each cycle's pre-flight
  checks; clean exit if present).

OE-3: scripts/overnight-evolve-preflight.sh
  10-check verification: git clean, ao+claude+gtimeout on PATH, ao goals
  measure runs, bd ready works, ~/.agents/overnight writable, seed JSONL
  valid, kickoff script +x, shellcheck clean.

Plan: .agents/plans/2026-05-01-overnight-evolve-loop.md
Packet: .agents/rpi/runs/overnight-evolve-2026-05-01/execution-packet.json

Pre-mortem (inline --quick): PASS, 8 council FAIL patterns assessed,
0 blockers. Safety rails: 8h hard timeout (gtimeout SIGTERM), --max-cycles=10
suspenders, regression breaker (validation FAIL halts), kill-switch file.
No remote push during overnight (branch-only mutation surface). Pre-Wave-1
baseline tag (pre-wave-1-baseline-eval-corpus-2026-05-01) is the rollback
anchor.

Kickoff: bash scripts/overnight-evolve.sh
Kill: touch $AGENTOPS_OVERNIGHT_KILL_SWITCH (set by kickoff)
Morning: cat ~/.agents/overnight/$(ls -t ~/.agents/overnight/ | head -1)/summary.md
2026-05-02 12:18:55 -04:00