Commit graph

20 commits

Author SHA1 Message Date
openhands
d2f788239a fix: address review feedback on prediction agent (#140)
- Remove CLAUDE_TIMEOUT no-op override — inherit factory default (7200s) from env.sh
- Use anchored grep -qxF "NO_PREDICTIONS" to avoid false early exits
- Fetch closed PRs (state=closed, merged_at filter) instead of open — captures merged activity signals
- Parse staleness age from filename date (YYYY-MM-DD.json) instead of file mtime
- Log a warning when date -d falls back due to non-GNU date
- Add comment explaining global lock serialisation trade-off

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-19 10:13:22 +00:00
openhands
c06cf81031 fix: feat: prediction-poll.sh — per-project LLM prediction agent (#140)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-19 10:03:45 +00:00
openhands
d498334dcc fix: address review feedback — restore -d flag, drop formula label, validate names, quote YAML
- Restore `-d` flag on codeberg_api POST /issues call (regression fix)
- Do NOT apply `formula` label — dev-agent rejects it, blocking the pipeline
- Keep YAML front matter in body only (structural, harmless to freeform processing)
- Quote YAML var values with @json to handle special characters
- Validate formula name against on-disk formulas/*.toml catalog
- Fall back to freeform if Claude hallucinates a formula name

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 04:37:17 +00:00
openhands
b5ec6f6cf3 fix: feat: planner emits formula instances instead of freeform issues (#21)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 04:29:21 +00:00
johba
740bddb2db Merge pull request 'fix: feat: RESOURCES.md — infrastructure manifest for planner resource awareness (#23)' (#33) from fix/issue-23 into main 2026-03-17 10:56:52 +01:00
openhands
567dc4bde0 fix: address review findings for supervisor metrics (#24)
- planner: filter CI and dev metrics by project name to prevent cross-project pollution
- planner: replace fragile awk JSONL filter with jq select()
- supervisor: add codeberg_count_paginated() helper; replace hardcoded limit=50 dev-metric API calls with paginated counts so projects with >50 issues report accurate blocked-ratio data
- supervisor: add 24h age filter to CI metric SQL query so stale pipelines are not re-emitted with a fresh timestamp
- supervisor: replace fragile awk key-order-dependent JSON filter in rotate_metrics() with jq select(); add safety guard to prevent overwriting file with empty result on parse failure
- supervisor: move mkdir -p for metrics dir to startup (once) instead of every emit_metric() call
- supervisor: guard _RAM_TOTAL_MB against empty value in bash arithmetic

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 10:56:37 +01:00
openhands
53c1fea6ea fix: feat: supervisor metrics logging for planner trend analysis (#24)
- supervisor-poll.sh: append structured JSONL metrics on every poll
  - infra metric (ram_used_pct, disk_used_pct, swap_mb) after Layer 1 checks
  - ci metric (pipeline id, duration_min, status) per project via wpdb query
  - dev metric (issues_in_backlog, issues_blocked, pr_open) per project via Codeberg API
  - rotate_metrics() trims metrics/supervisor-metrics.jsonl to last 30 days on startup
- planner-agent.sh: reads last 7 days of metrics before Phase 2 gap analysis
  - computes avg CI duration, success rate, RAM/disk utilization, blocked ratio
  - injects summary into gap analysis prompt as "Operational metrics" section
  - instructs planner to create optimization issues when metrics conflict with VISION.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 10:56:37 +01:00
openhands
26d6e1ae52 fix: feat: RESOURCES.md — infrastructure manifest for planner resource awareness (#23)
- Add RESOURCES.example.md: committed template showing Compute/Domains/Accounts/Budget structure
- Gitignore RESOURCES.md so local infrastructure data is never committed
- Planner phase 2 reads RESOURCES.md from factory root when present
- Planner prompt instructs Claude to reference specific resource aliases in operational issues

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 08:48:47 +00:00
johba
7f41048aea fix: remove dead STATE.md code, restore matrix notify, targeted git add (Closes #13, Closes #14)
- Remove STATE_FILE variable and all STATE.md references from phase 2
- Restore matrix_send for gap analysis issue creation
- Replace broad `git add -A "*.md"` with targeted `find -name AGENTS.md`

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 16:53:33 +01:00
johba
3bb75f18be feat: planner uses Claude tool access to navigate AGENTS.md tree (Closes #12)
Phase 1 rewritten:
- Claude gets --dangerously-skip-permissions to navigate code, read
  diffs, and update AGENTS.md files directly
- Per-file <!-- last-reviewed: SHA --> watermarks replace global marker
- Sub-directory AGENTS.md files discovered and updated independently
- ~200 line convention enforced via prompt
- Changes committed on branch and PR'd

Phase 2 now reads AGENTS.md tree + STATE.md for gap analysis.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 16:33:47 +01:00
openhands
679c62e7cb refactor: planner maintains AGENTS.md instead of STATE.md
STATE.md was a machine-generated system description that was always
worse than the human-curated AGENTS.md. Killed STATE.md entirely.

Phase 1: Reviews recent git history against AGENTS.md, suggests
updates via PR to keep the file tree, conventions, and architecture
descriptions current.

Phase 2: Gap analysis — compares AGENTS.md + VISION.md + open issues,
creates backlog issues for missing capabilities.
2026-03-15 15:13:41 +00:00
openhands
5c6293fdab fix: strip non-bullet preamble from planner output
Sonnet prepends narration before the actual bullets. Strip everything
before the first '- ' line instead of rejecting the whole output.
2026-03-15 15:02:53 +00:00
openhands
af75c0eccf fix: even stronger output-only instruction for Sonnet
Sonnet keeps narrating. Made the constraint explicitly say 'starts
with - on the very first character' and 'will be rejected'.
2026-03-15 14:59:42 +00:00
openhands
ff50d28645 feat: planner reads project docs for architectural understanding
Feeds AGENTS.md, PRODUCT-TRUTH.md, ARCHITECTURE.md, UX-DECISIONS.md
into the prompt so the planner understands the system at a conceptual
level. Rewritten prompt emphasizes describing the system, not the
changes. Good/bad examples guide output style.
2026-03-15 14:58:10 +00:00
openhands
a114f638ef fix: planner validates bullet output, rejects meta-commentary
Sonnet sometimes narrates what it did instead of outputting the actual
STATE.md. Added validation that first line starts with '- ' and
strengthened the output-only instruction.
2026-03-15 12:51:59 +00:00
openhands
4b95d32a0c fix: planner PR lookup filters by head.ref client-side
Codeberg head= query param is unreliable — filter with jq instead.
2026-03-15 12:49:22 +00:00
openhands
17053f8559 fix: planner creates PR instead of direct push to protected master
Also removes local keyword from top-level scope.
2026-03-15 12:47:50 +00:00
openhands
335ea0d48d fix: remove local keyword outside function in planner 2026-03-15 12:42:12 +00:00
openhands
efa6eab352 fix: planner GIT_RANGE newline bug from pipefail + head -1
set -o pipefail causes head -1 to fail the pipeline when git log
is still producing output. The || fallback then appends a second
line. Fix: capture first SHA separately with || true.
2026-03-15 12:41:50 +00:00
johba
9b0c1e6c30 feat: add planner-agent, remove STATE.md append from dev-agent
- Remove write_state_entry/append_state_log from dev-agent (#10)
- Add planner-agent.sh: rebuilds STATE.md from git history + closed
  issues, then gap-analyses against VISION.md to create backlog
  issues (#6, #7)
- Add planner-poll.sh: cron wrapper with lock + memory guard

STATE.md is now solely owned by the planner — one compact snapshot
rebuilt each run, not an ever-growing append log.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 11:45:16 +01:00