Skip to content

Commit b317527

Browse files
Antigravity Agentclaude
andcommitted
feat(scholar): add report mode + cron in bridge-agent
- /scholar report: show cached scan results (no API calls) - bridge-agent.sh: auto-submit scholar jobs at 06:00/18:00 UTC - PX_SCHOLAR_CRON=1 to enable (default on) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c8c51c9 commit b317527

2 files changed

Lines changed: 40 additions & 5 deletions

File tree

.claude/skills/scholar/SKILL.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: scholar
33
description: Self-Evolving Research Agent — scans web for relevant tech, evaluates findings, proposes improvements. Uses Perplexity Sonar API via MCP.
4-
argument-hint: [scan|eval|apply|full|topic:"query"]
4+
argument-hint: [scan|eval|apply|full|report|topic:"query"]
55
allowed-tools: Bash(gh *), Bash(cat *), Bash(grep *), Bash(find *), Bash(python3 *), Bash(echo *), Bash(date *), Bash(wc *), Bash(git *), Bash(test *), Bash(ls *), Read, Edit, Write, mcp__perplexity__perplexity_search, mcp__perplexity__perplexity_ask, mcp__perplexity__perplexity_research, mcp__perplexity__perplexity_reason
66
---
77

@@ -19,6 +19,7 @@ Parse $ARGUMENTS to determine mode:
1919
- `eval` — Run EVAL phase on last scan results
2020
- `apply` — Run APPLY phase (create issues / enrich MU)
2121
- `full` — Run all 3 phases sequentially (default if no args)
22+
- `report` — Show last scan results without running new scan (for bridge/Perplexity)
2223
- `topic:"<query>"` — Deep research on a specific topic
2324
- `errors` — Scan for solutions to current broken specs/compilation errors
2425
- `zig` — Scan for Zig 0.15 updates and best practices
@@ -256,19 +257,31 @@ Render a report after each run:
256257
✨ Scholar says: "{contextual insight about findings}"
257258
```
258259

260+
## Mode: report
261+
262+
If $ARGUMENTS is `report`, do NOT run any scan. Instead:
263+
264+
1. Read the latest scan file from `.trinity/scholar/` (most recent `scan_*.json`)
265+
2. Render the Output Format report above using cached data
266+
3. If no scan file exists, output: "No scan data. Run: /scholar scan"
267+
268+
This mode is optimized for bridge-agent / Perplexity queries — fast, no API calls.
269+
259270
## Cron Integration
260271

261272
Scholar can be triggered remotely via bridge-agent:
262273
```
263274
claude:Run /scholar full
264275
claude:Run /scholar errors
276+
claude:Run /scholar report
265277
claude:Run /scholar topic:"ternary neural network quantization"
266278
```
267279

268-
For automated 24h cycle, add to bridge cron:
269-
- 08:00 — `claude:Run /scholar zig` (morning: language updates)
270-
- 20:00 — `claude:Run /scholar errors` (evening: fix broken specs)
271-
- 02:00 — `claude:Run /scholar full` (night: deep research)
280+
### Automated 24h cycle (via bridge-agent cron):
281+
- **06:00 UTC**`claude:Run /scholar full` (morning: full scan + eval + apply)
282+
- **18:00 UTC**`claude:Run /scholar errors` (evening: fix broken specs)
283+
284+
The bridge-agent checks UTC hour and auto-submits scholar jobs.
272285

273286
## Translation Table (EN → RU)
274287

deploy/tri-bridge-agent.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ set -euo pipefail
1717
RAILWAY_URL="${RAILWAY_URL:-https://trinity-production-a1d4.up.railway.app}"
1818
TOKEN="${PX_BRIDGE_TOKEN:?ERROR: PX_BRIDGE_TOKEN not set}"
1919
POLL_INTERVAL="${PX_POLL_INTERVAL:-3}"
20+
SCHOLAR_CRON="${PX_SCHOLAR_CRON:-1}" # Enable scholar cron (1=on, 0=off)
21+
LAST_SCHOLAR_HOUR=""
2022
REPO_DIR="${PX_REPO_DIR:-$(cd "$(dirname "$0")/.." && pwd)}"
2123
MAX_RESULT=100000 # 100KB max result size
2224

@@ -104,5 +106,25 @@ while true; do
104106
echo "[bridge-agent] $(date '+%H:%M:%S') done=$JOB_ID exit=$EXIT_CODE (${#RESULT} bytes)"
105107
fi
106108

109+
# ─── Scholar Cron ─────────────────────────────────────────
110+
# Auto-submit scholar jobs at scheduled UTC hours
111+
if [ "$SCHOLAR_CRON" = "1" ]; then
112+
CURRENT_HOUR=$(date -u '+%H')
113+
if [ "$CURRENT_HOUR" != "$LAST_SCHOLAR_HOUR" ]; then
114+
case "$CURRENT_HOUR" in
115+
"06")
116+
echo "[bridge-agent] $(date '+%H:%M:%S') CRON: submitting scholar full scan"
117+
curl -sf "${RAILWAY_URL}/px/exec?token=${TOKEN}&cmd=claude%3ARun+%2Fscholar+full" > /dev/null 2>&1 || true
118+
LAST_SCHOLAR_HOUR="$CURRENT_HOUR"
119+
;;
120+
"18")
121+
echo "[bridge-agent] $(date '+%H:%M:%S') CRON: submitting scholar errors scan"
122+
curl -sf "${RAILWAY_URL}/px/exec?token=${TOKEN}&cmd=claude%3ARun+%2Fscholar+errors" > /dev/null 2>&1 || true
123+
LAST_SCHOLAR_HOUR="$CURRENT_HOUR"
124+
;;
125+
esac
126+
fi
127+
fi
128+
107129
sleep "$POLL_INTERVAL"
108130
done

0 commit comments

Comments
 (0)