File size: 1,594 Bytes
93ee340
 
 
 
 
 
 
 
 
 
 
1fcfbcd
 
 
 
 
 
 
 
 
 
 
 
93ee340
6209783
93ee340
 
 
 
6209783
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/bin/sh
# VAPE intel sync — commit+push whatever the agent wrote into intel/ this cycle.
# Pure git plumbing, ZERO LLM cost. The agent cron writes the report file(s) first,
# then calls this to persist them. Lowest-compute: one pull/commit/push per cycle.
set -e
REPO="/home/node/.openclaw/repos/vape"
cd "$REPO"

STAMP="$(date -u +%Y-%m-%d\ %H:%M) UTC"
MSG="${1:-VAPE intel sync $STAMP}"

# Deep investigation on the highest-signal live target (zero-LLM, real data).
# Never let a recon hiccup block the sync.
if [ -f agents/investigate.py ]; then
  python3 agents/investigate.py --auto >/dev/null 2>&1 || echo "[intel_sync] no auto investigation this cycle"
fi

# Refresh the dashboard's machine-readable index (reports/broadcasts/tools/investigations).
if [ -f agents/build_intel_index.py ]; then
  python3 agents/build_intel_index.py >/dev/null 2>&1 || echo "[intel_sync] index build skipped"
fi

git add intel/ skillforge/ data/ 2>/dev/null || true

if git diff --cached --quiet && [ -z "$(git log origin/main..HEAD 2>/dev/null)" ]; then
  echo "[intel_sync] no changes to commit"
  exit 0
fi

git diff --cached --quiet || git commit -m "$MSG" >/dev/null

# Retry loop: rebase on latest remote then push, to survive concurrent GH Actions pushes.
n=0
while [ $n -lt 5 ]; do
  git pull --rebase --autostash origin main >/dev/null 2>&1 || true
  if git push origin main >/dev/null 2>&1; then
    echo "[intel_sync] pushed: $MSG"
    exit 0
  fi
  n=$((n+1))
  echo "[intel_sync] push race, retry $n/5..." >&2
  sleep $((n*3))
done
echo "[intel_sync] PUSH FAILED after retries" >&2
exit 1