-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (61 loc) · 2.5 KB
/
learning-loop.yml
File metadata and controls
75 lines (61 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# 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"