Skip to content

Pipeline — Brainstorm #584

Pipeline — Brainstorm

Pipeline — Brainstorm #584

name: Pipeline — Brainstorm
on:
schedule:
- cron: '0 * * * *' # every hour
workflow_dispatch:
permissions:
actions: write # workflow_dispatch to pages.yml
contents: write
issues: write
concurrency:
group: pipeline-brainstorm
cancel-in-progress: false
jobs:
run:
runs-on: ubuntu-latest
timeout-minutes: 25
env:
DARTMOUTH_CHAT_API_KEY: ${{ secrets.DARTMOUTH_CHAT_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v5
with: { ref: main }
- uses: actions/setup-python@v6
with: { python-version: "3.11", cache: pip }
- run: pip install -e ".[dev]"
- name: Preflight
run: python -m llmxive preflight
- name: Seed new ideas (LLM-driven)
run: |
python -c "
from pathlib import Path
from llmxive.state import project as project_store
from llmxive.types import Stage
projects = project_store.list_all(repo_root=Path('.'))
backlog = [p for p in projects if p.current_stage == Stage.BRAINSTORMED]
deficit = max(0, 3 - len(backlog))
print(f'[seed] {len(backlog)} brainstormed projects; will seed {deficit} new')
import subprocess, sys
if deficit:
subprocess.run([sys.executable, '-m', 'llmxive', 'brainstorm', '-n', str(deficit)], check=False)
"
- name: Advance brainstormed projects (flesh-out)
run: python -m llmxive run --max-tasks 5 --stage brainstormed
- name: Regenerate web data
run: python -c "from llmxive.agents.status_reporter import regenerate_web_data; from pathlib import Path; regenerate_web_data(repo_root=Path('.'))"
- name: Commit + push
id: commit
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add state/ projects/ web/data/ || true
if git diff --cached --quiet; then
echo "no changes"
echo "pushed=false" >> $GITHUB_OUTPUT
else
git commit -m "pipeline(brainstorm): hourly tick"
for i in 1 2 3 4 5; do
git pull --rebase origin main && git push && break
echo "push attempt $i failed; retrying..." >&2
sleep $((5 * i))
done
echo "pushed=true" >> $GITHUB_OUTPUT
fi
- name: Trigger Pages deploy
# GitHub suppresses workflow triggers from GITHUB_TOKEN pushes (to
# prevent infinite cron loops); workflow_dispatch invoked from another
# workflow DOES fire regardless. Without this, pages.yml never
# redeploys after a cron tick even though we touched web/data/.
if: steps.commit.outputs.pushed == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh workflow run pages.yml --ref main