fix: feat: predictor v2 — outcome measurement + external signal scanning (#547)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
251d160e21
commit
b417747f89
3 changed files with 120 additions and 19 deletions
|
|
@ -1,14 +1,22 @@
|
|||
<!-- last-reviewed: ac51497489abc5412bc47f451facc30b0455cbd2 -->
|
||||
# Predictor Agent
|
||||
|
||||
**Role**: Infrastructure pattern detection (the "goblin"). Runs a 3-step
|
||||
**Role**: Risk oracle and opportunity spotter (the "goblin"). Runs a 3-step
|
||||
formula (preflight → collect-signals → analyze-and-predict) via interactive
|
||||
tmux Claude session (sonnet). Collects disinto-specific signals: CI pipeline
|
||||
trends (Woodpecker), stale issues, agent health (tmux sessions + logs), and
|
||||
resource patterns (RAM, disk, load, containers). Files up to 5
|
||||
`prediction/unreviewed` issues for the Planner to triage. The predictor MUST
|
||||
NOT emit feature work — only observations about CI health, issue staleness,
|
||||
agent status, and system conditions.
|
||||
tmux Claude session (sonnet). Collects three categories of signals:
|
||||
|
||||
1. **Health signals** — CI pipeline trends (Woodpecker), stale issues, agent
|
||||
health (tmux sessions + logs), resource patterns (RAM, disk, load, containers)
|
||||
2. **Outcome signals** — output freshness (formula journals/artifacts), capacity
|
||||
utilization (idle agents vs dispatchable backlog), throughput (closed issues,
|
||||
merged PRs, churn detection)
|
||||
3. **External signals** — dependency security advisories, upstream breaking
|
||||
changes, deprecation notices, ecosystem shifts (via targeted web search)
|
||||
|
||||
Files up to 5 `prediction/unreviewed` issues for the Planner to triage.
|
||||
Predictions cover both "things going wrong" and "opportunities being missed".
|
||||
The predictor MUST NOT emit feature work — only observations about health,
|
||||
outcomes, and external risks/opportunities.
|
||||
|
||||
**Trigger**: `predictor-run.sh` runs daily at 06:00 UTC via cron (1h before
|
||||
the planner at 07:00). Guarded by PID lock (`/tmp/predictor-run.lock`) and
|
||||
|
|
@ -31,6 +39,8 @@ memory check (skips if available RAM < 2000 MB).
|
|||
|
||||
**Lifecycle**: predictor-run.sh (daily 06:00 cron) → lock + memory guard →
|
||||
load formula + context → create tmux session → Claude collects signals
|
||||
(CI trends, stale issues, agent health, resources) → dedup against existing
|
||||
open predictions → file `prediction/unreviewed` issues → `PHASE:done`.
|
||||
(health: CI trends, stale issues, agent health, resources; outcomes: output
|
||||
freshness, capacity utilization, throughput; external: dependency advisories,
|
||||
ecosystem changes via web search) → dedup against existing open predictions →
|
||||
file `prediction/unreviewed` issues → `PHASE:done`.
|
||||
The planner's Phase 1 later triages these predictions.
|
||||
|
|
|
|||
|
|
@ -57,10 +57,16 @@ build_prompt_footer
|
|||
# shellcheck disable=SC2034 # consumed by run_formula_and_monitor
|
||||
PROMPT="You are the prediction agent (goblin) for ${CODEBERG_REPO}. Work through the formula below. You MUST write PHASE:done to '${PHASE_FILE}' when finished — the orchestrator will time you out if you return to the prompt without signalling.
|
||||
|
||||
Your role: spot patterns in infrastructure signals and file them as prediction issues.
|
||||
Your role: spot patterns across three signal categories and file them as prediction issues:
|
||||
1. Health signals — CI trends, agent status, resource pressure, stale issues
|
||||
2. Outcome signals — output freshness, capacity utilization, throughput
|
||||
3. External signals — dependency advisories, upstream changes, ecosystem shifts
|
||||
|
||||
The planner (adult) will triage every prediction before acting.
|
||||
You MUST NOT emit feature work or implementation issues — only predictions
|
||||
about CI health, issue staleness, agent status, and system conditions.
|
||||
about health, outcomes, and external risks/opportunities.
|
||||
Use WebSearch for external signal scanning — be targeted (project dependencies
|
||||
and tools only, not general news). Limit to 5 web searches per run.
|
||||
|
||||
## Project context
|
||||
${CONTEXT_BLOCK}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue