- scripts/nightly/plan.py: dependency-ordered plan from cleanup report + CURRENT + registry (integrate candidates -> active tasks -> cleanup-ready) - scripts/nightly/advance.py: orchestrator with reentry lock, daemon-health preflight, headless cursor-agent advancement under agentctl leases, queue-drain wait, env:dev rebuild + /health /ready on tip change, no-content-loss cleanup verification, daily report draft + archival - scripts/nightly-advance.sh: cron entrypoint - tests: 9 unit cases for plan builder
33 lines
1.1 KiB
Bash
Executable File
33 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Nightly advance entrypoint (cron 10 3 * * *).
|
|
# Drives the full pipeline via scripts/nightly/advance.py and always leaves a
|
|
# machine-readable summary + report draft under data/nightly/<run>/.
|
|
#
|
|
# Environment:
|
|
# NIGHTLY_ADVANCE_REPO default /home/weichen/projects/Agent-System
|
|
# NIGHTLY_TASK_TIMEOUT per-task cursor-agent timeout seconds (default 3600)
|
|
# NIGHTLY_MAX_TASKS cap planned entries (0 = all)
|
|
#
|
|
# Never pushes, never promotes test/main, never force-removes worktrees.
|
|
set -euo pipefail
|
|
|
|
REPO="${NIGHTLY_ADVANCE_REPO:-/home/weichen/projects/Agent-System}"
|
|
export PATH="/usr/bin:/usr/local/bin:/home/linuxbrew/.linuxbrew/bin:$PATH"
|
|
|
|
LOG_ROOT="${REPO}/.tmp/nightly"
|
|
STAMP="$(date -u +%Y%m%dT%H%M%SZ)"
|
|
ENTRY_LOG="${LOG_ROOT}/entry-${STAMP}.log"
|
|
mkdir -p "${LOG_ROOT}"
|
|
|
|
{
|
|
echo "== nightly-advance ${STAMP} repo=${REPO}"
|
|
python3 -B "${REPO}/scripts/nightly/advance.py" \
|
|
--repo "${REPO}" \
|
|
--task-timeout "${NIGHTLY_TASK_TIMEOUT:-3600}" \
|
|
--max-tasks "${NIGHTLY_MAX_TASKS:-0}"
|
|
RC=$?
|
|
echo "== done rc=${RC}"
|
|
} >> "${ENTRY_LOG}" 2>&1
|
|
|
|
exit "${RC:-0}"
|