agent: move the loop prompt's memory into the corpus, and let it push
The autonomous agent's loop prompt had grown to ~9 000 words of accumulated
findings, refutations and traps. That is a symptom, not a style: it was doing
the job the corpus should do, in the one place that dies with the container.
Three concrete failures followed from it, and each gets a structural fix rather
than a louder instruction.
1. IT REPEATED WORK IT HAD ALREADY DONE.
The "do not revive" list and the method traps existed ONLY in the prompt, so
nothing pointed a fresh iteration at them. Extracted verbatim into two
tracked files:
docs/re/REFUTED.md 105 claims tested and dead, grouped by subject so a
grep for your noun finds the neighbourhood
docs/re/METHOD.md the traps already paid for -- controls, inference,
searching, reading data, runtime
Both are linked from INDEX.md, and the loop prompt now opens by requiring
them to be read. This is the fix for "re-derived something already known":
the knowledge is now where the next iteration looks, not in a context window.
2. IT FORGOT TO ARM THE NEXT WAKEUP.
The prompt tried to solve this by shouting at itself in the first line. The
real fix is to stop asking: `loose` now defaults to a FIXED interval (45m),
so the harness owns the cadence and a forgotten ScheduleWakeup cannot end the
run. SYLPH_LOOP_INTERVAL= (empty) restores self-pacing.
3. IT COULD NOT PUBLISH, SO THE WORK ONLY EXISTED IN THE CONTAINER.
New `push-work`, plus a read-only credentials mount
(SYLPH_GIT_CREDENTIALS, default ~/.sylph-git-credentials). It pushes the
CURRENT branch only, refuses anything that is not auto/*, and never
force-pushes -- so the consolidated line stays a human's decision and a
confused iteration cannot rewrite history. The loop prompt now requires a
push on every iteration that commits, rather than at the end of some longer
arc, which is exactly when a container dies.
The prompt itself drops from ~9 000 words to 85 lines and, more importantly,
stops accumulating: findings go in the corpus, and the prompt points at it.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -21,6 +21,9 @@
|
||||
# SYLPH_VULKAN=sw force software Vulkan (lavapipe) even if /dev/dri exists
|
||||
# SYLPH_REMOTE=0 do NOT enable Remote Control (default: enabled for `loose`)
|
||||
# SYLPH_REMOTE_NAME Remote Control session name (default: sylpheed-agent)
|
||||
# SYLPH_GIT_CREDENTIALS file with `https://<user>:<token>@host` for push-work
|
||||
# (default: $HOME/.sylph-git-credentials)
|
||||
# SYLPH_LOOP_INTERVAL fixed loop cadence, e.g. 30m (default: 45m)
|
||||
# SYLPH_CPUS / SYLPH_MEM_GB override the computed half
|
||||
set -euo pipefail
|
||||
|
||||
@@ -125,6 +128,21 @@ docker_args() {
|
||||
echo " packaged SPIRV-Tools is too old. Running is unaffected." >&2
|
||||
fi
|
||||
|
||||
# ── git push ──
|
||||
# Read-only, and only ever used by `push-work`, which refuses anything but an
|
||||
# auto/* branch and never force-pushes. Without this the agent's work only
|
||||
# exists inside the container and dies with it.
|
||||
GITCRED="${SYLPH_GIT_CREDENTIALS:-$HOME/.sylph-git-credentials}"
|
||||
if [ -f "$GITCRED" ]; then
|
||||
_out+=(-v "$GITCRED:/sylph-home/re/.git-credentials:ro")
|
||||
else
|
||||
echo "==> NOTE: no git credentials at $GITCRED — the agent cannot push," >&2
|
||||
echo " so its work will be lost if the container is destroyed. Create it" >&2
|
||||
echo " with a single line and chmod 600:" >&2
|
||||
echo " https://<user>:<token>@git.mc02.dev" >&2
|
||||
echo " or point SYLPH_GIT_CREDENTIALS elsewhere." >&2
|
||||
fi
|
||||
|
||||
[ -n "${ANTHROPIC_API_KEY:-}" ] && _out+=(-e "ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY")
|
||||
[ -n "${SYLPH_VULKAN:-}" ] && _out+=(-e "SYLPH_VULKAN=$SYLPH_VULKAN")
|
||||
[ -n "${SYLPH_REMOTE:-}" ] && _out+=(-e "SYLPH_REMOTE=$SYLPH_REMOTE")
|
||||
@@ -191,7 +209,12 @@ case "${1:-}" in
|
||||
TASK="Work the RE backlog in Syplheed-Reborn/docs/re/BACKLOG.md."
|
||||
fi
|
||||
fi
|
||||
INTERVAL="${SYLPH_LOOP_INTERVAL:-}" # empty = let the model self-pace
|
||||
# A FIXED interval by default, not self-pacing. Self-pacing requires the
|
||||
# agent to call ScheduleWakeup itself at the end of every turn, and the one
|
||||
# thing an agent deep in an experiment reliably forgets is the bookkeeping
|
||||
# after it. With an interval the harness owns the cadence and a forgotten
|
||||
# wakeup cannot end the run. Set SYLPH_LOOP_INTERVAL= (empty) to self-pace.
|
||||
INTERVAL="${SYLPH_LOOP_INTERVAL-45m}"
|
||||
declare -a ARGS; docker_args ARGS
|
||||
ARGS+=(-e SYLPH_AUTONOMOUS=1 -w "$PROJECT")
|
||||
echo "==> loose | cpus=$CPUS mem=${MEM_GB}g shm=${SHM_GB}g"
|
||||
|
||||
Reference in New Issue
Block a user