Skip to content

Commit aaf3f1c

Browse files
committed
docs: remove machine-specific paths from documentation
- Use <repo-root> placeholder instead of absolute paths - Use $LOOP_LOG_DIR env var instead of hardcoded /tmp/loop-logs - Scripts use BASH_SOURCE to resolve paths dynamically - Remove unused loop-webhook.py (replaced by cron approach)
1 parent 89e5dc5 commit aaf3f1c

6 files changed

Lines changed: 16 additions & 184 deletions

File tree

.codebuddy/CODEBUDDY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ go list -u -m all
6767

6868
本项目采用 Loop Engineering 理念进行自动化维护。循环配置位于 `.codebuddy/`,总体设计见 [loop-engineering.md](./loop-engineering.md)
6969

70-
**运行方式**:通过系统 cron + `codebuddy -p`(headless)每天凌晨自动运行,无需保持会话。安装:`.codebuddy/scripts/install-cron.sh`,手动触发:`.codebuddy/scripts/run-loop.sh <类型>`日志:`/tmp/loop-logs/`
70+
**运行方式**:通过系统 cron + `codebuddy -p`(headless)每天凌晨自动运行,无需保持会话。安装:`.codebuddy/scripts/install-cron.sh`,手动触发:`.codebuddy/scripts/run-loop.sh <类型>`日志目录由 `LOOP_LOG_DIR` 环境变量控制(默认 `/tmp/loop-logs/`
7171

7272
- 所有循环状态持久化到 `STATE.md`(项目根目录),不依赖模型上下文记忆
7373
- 每个循环遵循五阶段:Discover → Plan → Execute → Verify → Iterate

.codebuddy/loop-engineering.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Each loop runs as a system cron job that invokes `codebuddy -p` (headless mode).
2727

2828
**Install:**
2929
```bash
30-
cd /data/git/req
30+
cd <repo-root>
3131
.codebuddy/scripts/install-cron.sh
3232
```
3333

@@ -44,8 +44,8 @@ cd /data/git/req
4444

4545
**View logs:**
4646
```bash
47-
ls /tmp/loop-logs/
48-
cat /tmp/loop-logs/ci-fix-*.log
47+
ls $LOOP_LOG_DIR # default: /tmp/loop-logs/
48+
cat $LOOP_LOG_DIR/ci-fix-*.log
4949
```
5050

5151
**Schedule (daily, Beijing time, staggered to avoid API rate limits):**
@@ -69,7 +69,7 @@ system cron (daily, e.g. 03:00)
6969
→ write STATE.md # persist state
7070
→ git push # push state changes
7171
→ 10 min timeout protection
72-
→ log to /tmp/loop-logs/
72+
→ log to $LOOP_LOG_DIR (default: /tmp/loop-logs/)
7373
```
7474

7575
### Mode 2: GitHub Actions (Optional, for public API)

.codebuddy/scheduled_tasks.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"sessionId":"df340778-2c1f-4881-914b-addb6afc7203","pid":887657,"acquiredAt":1782540546467}

.codebuddy/scripts/install-cron.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
set -euo pipefail
1818

19-
SCRIPT_DIR="/data/git/req/.codebuddy/scripts"
19+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
2020
RUN_SCRIPT="${SCRIPT_DIR}/run-loop.sh"
2121
MARKER="# loop-engineering-req"
2222

@@ -70,7 +70,7 @@ echo " 03:00 ci-fix"
7070
echo " 04:00 issue-triage"
7171
echo " 05:00 pr-review"
7272
echo ""
73-
echo "Logs: /tmp/loop-logs/"
73+
echo "Logs: \$LOOP_LOG_DIR (default: /tmp/loop-logs/)"
7474
echo "Uninstall: ${SCRIPT_DIR}/install-cron.sh --remove"
7575
echo ""
7676
echo "Current crontab:"

.codebuddy/scripts/loop-webhook.py

Lines changed: 0 additions & 170 deletions
This file was deleted.

.codebuddy/scripts/run-loop.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,18 @@
88
# loop_type: ci-fix | issue-triage | pr-review | dependency-upgrade | upstream-sync
99
#
1010
# Crontab example (Beijing time, UTC+8):
11-
# 0 3 * * * /data/git/req/.codebuddy/scripts/run-loop.sh ci-fix
12-
# 0 4 * * * /data/git/req/.codebuddy/scripts/run-loop.sh issue-triage
13-
# 0 5 * * * /data/git/req/.codebuddy/scripts/run-loop.sh pr-review
14-
# 0 2 * * * /data/git/req/.codebuddy/scripts/run-loop.sh dependency-upgrade
15-
# 0 1 * * * /data/git/req/.codebuddy/scripts/run-loop.sh upstream-sync
11+
# 0 1 * * * <repo-root>/.codebuddy/scripts/run-loop.sh upstream-sync
12+
# 0 2 * * * <repo-root>/.codebuddy/scripts/run-loop.sh dependency-upgrade
13+
# 0 3 * * * <repo-root>/.codebuddy/scripts/run-loop.sh ci-fix
14+
# 0 4 * * * <repo-root>/.codebuddy/scripts/run-loop.sh issue-triage
15+
# 0 5 * * * <repo-root>/.codebuddy/scripts/run-loop.sh pr-review
1616

1717
set -euo pipefail
1818

1919
LOOP_TYPE="${1:?Usage: run-loop.sh <ci-fix|issue-triage|pr-review|dependency-upgrade|upstream-sync>}"
20-
REPO_DIR="/data/git/req"
21-
LOG_DIR="/tmp/loop-logs"
20+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
21+
REPO_DIR="$(cd "$SCRIPT_DIR/../.." && pwd)"
22+
LOG_DIR="${LOOP_LOG_DIR:-/tmp/loop-logs}"
2223
mkdir -p "$LOG_DIR"
2324

2425
cd "$REPO_DIR"

0 commit comments

Comments
 (0)