Learning Loop #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # SPDX-License-Identifier: PMPL-1.0-or-later | |
| # Hypatia Learning Loop - Auto-generate rules from observed patterns | |
| name: Learning Loop | |
| on: | |
| schedule: | |
| - cron: '0 0 * * 0' # Weekly on Sunday | |
| workflow_dispatch: | |
| permissions: read-all | |
| jobs: | |
| process-findings: | |
| name: Process Findings and Generate Rules | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # For creating rule proposal PRs | |
| pull-requests: write # For creating PRs | |
| steps: | |
| - name: Checkout gitbot-fleet | |
| uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
| - name: Process pending findings | |
| run: | | |
| echo "📊 Processing pending findings..." | |
| bash fleet-coordinator.sh process-findings | |
| - name: Generate rule proposals | |
| run: | | |
| echo "🧠 Generating rule proposals from observed patterns..." | |
| bash fleet-coordinator.sh generate-rules | |
| - name: Upload rule proposals | |
| if: always() | |
| uses: actions/upload-artifact@65c79d7f54e76e4e3c7a8f34db0f4ac8b515c478 # v4 | |
| with: | |
| name: rule-proposals | |
| path: shared-context/learning/rule-proposals/*.lgt | |
| if-no-files-found: ignore | |
| - name: Show learning summary | |
| run: | | |
| echo "## Learning Loop Summary" >> $GITHUB_STEP_SUMMARY | |
| if [ -f shared-context/learning/observed-patterns.jsonl ]; then | |
| TOTAL=$(wc -l < shared-context/learning/observed-patterns.jsonl) | |
| echo "- Total observations: $TOTAL" >> $GITHUB_STEP_SUMMARY | |
| else | |
| echo "- No observations yet" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| if [ -d shared-context/learning/rule-proposals ]; then | |
| PROPOSALS=$(find shared-context/learning/rule-proposals -name "*.lgt" | wc -l) | |
| echo "- Rule proposals: $PROPOSALS" >> $GITHUB_STEP_SUMMARY | |
| if [ $PROPOSALS -gt 0 ]; then | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "### Proposed Rules" >> $GITHUB_STEP_SUMMARY | |
| for rule in shared-context/learning/rule-proposals/*.lgt; do | |
| [ -f "$rule" ] && echo "- $(basename "$rule")" >> $GITHUB_STEP_SUMMARY | |
| done | |
| fi | |
| fi | |
| deploy-approved-rules: | |
| name: Deploy Approved Rules to Hypatia | |
| runs-on: ubuntu-latest | |
| needs: process-findings | |
| if: false # Enable after manual approval workflow is ready | |
| steps: | |
| - name: Placeholder for rule deployment | |
| run: echo "Rule deployment will be implemented after approval workflow" |