containers: each agent clones the monorepo into its own volume
The last structural fix for the collision class that has bitten three times. Both containers now clone the repository into their OWN named volume instead of bind-mounting a human's working tree, so an agent's local git config cannot capture a human's commits, a credential helper cannot leak a container-only path onto the host, and a `git add -A` cannot sweep another party's in-flight files. Cloned once at startup and never auto-pulled: pulling under a running agent moves files out from under whatever it is mid-edit, which is the same bug again. Accepted knowingly: Claude Code keys per-project memory off the working directory, so moving off the host path starts that memory empty. The corpus in docs/ is the memory that matters and it travels with the clone. Other changes: * docker/agent -> docker/decoder; the launcher is sylph-decoder. Roles, not "the agent", now that there is more than one. * /reborn is gone -- one repository now, so the port reads HANDOFF from its own checkout rather than through a live read-only mount of someone else's tree. * Canary mounts separately at /canary; it stays a fork tracking upstream. * A shared `sylpheed-exchange` volume at /exchange, with tools/ on PATH so `share` is available in both. * The decoder's credential file gets the .host-copy treatment the port already had -- `credential.helper=store` rewrites by rename-over-target, which is EBUSY on a bind mount and reports a fatal that is not one. * Budget split deliberately: decoder 5 cpu / 6 GB, port 3 / 4, leaving room for the planned Referee. "Half the host" was right when there was one agent. Prompts move to docs/agents/ and are rewritten around the protocol: the oracle is the running game, dynamic RE stays with the decoder, each iteration must attempt to refute one claim of the other, and neither may verify its way out of its own role.
This commit is contained in:
@@ -1,62 +0,0 @@
|
||||
# Notes for an agent working inside this container
|
||||
|
||||
Read this before starting a dynamic-RE run. Everything here is something that
|
||||
already went wrong once.
|
||||
|
||||
## The container fixes three old traps for you
|
||||
|
||||
* **The display outlives the turn.** Xvfb and openbox are children of PID 1, not
|
||||
of your shell. The old "Xvfb dies on its own every few minutes" note is gone —
|
||||
you no longer have to wrap a whole session in one blocking foreground call to
|
||||
keep it alive.
|
||||
* **The toolchain is real.** `tools/re-capture/rebuild_canary.sh` exists because
|
||||
the old box had no cmake/ninja/clang and only runtime sonames, so it hand-
|
||||
relinked object files. **Do not use it here.** Use `build-canary`.
|
||||
* **numpy and Pillow are installed.** `entities2.py`, `flight_probe.py` and the
|
||||
image oracles work. Their absence used to look like a logic bug.
|
||||
|
||||
## Method (the part that matters more than the tooling)
|
||||
|
||||
* **Measure the oracle; never infer it.** A session with zero Canary runs is a
|
||||
red flag.
|
||||
* **Trace upstream to where data first goes wrong**, rather than patching the
|
||||
symptom you can see.
|
||||
* **Try to refute before believing.** Record demotions rather than editing them
|
||||
away — `docs/re/README.md` has the ✅/🟡/❔ convention, and a withdrawn result
|
||||
is more useful than a quietly deleted one.
|
||||
* **A probe that never performs the action will "prove" the action does not
|
||||
exist.** The "targeting is automatic" conclusion came from a sweep that only
|
||||
ever tapped once; target select is Ⓐ pressed *twice*.
|
||||
* **Do not poll faster than the guest updates** — it manufactures a clean curve
|
||||
out of noise. `rate-curve-aliased-BAD.csv` is committed as the bad example.
|
||||
|
||||
## Running the emulator
|
||||
|
||||
```bash
|
||||
run-canary # correct audio/pad/display flags baked in
|
||||
pad.py tap A ; pad.py dpad down # scripted input (--hid=file, no uinput)
|
||||
screenshot ~/shots/now.png # cropped to the GAME surface, not the window
|
||||
python3 tools/re-capture/gmem.py find hex:820af844 400
|
||||
```
|
||||
|
||||
* **One emulator at a time.** `run-canary` enforces it with a lockfile.
|
||||
* Boot is slow cold, ~25 s once the shader/code caches are warm — so a
|
||||
launch-and-dump fits in a single call.
|
||||
* **Screens: classify by whole-image statistics** (`screen_id.py`), not named
|
||||
pixels. Named-pixel oracles are only valid while the game image sits at a
|
||||
known place, and nothing errors when it moves.
|
||||
|
||||
## Verifying your own work
|
||||
|
||||
* Reborn's disc-gated tests **self-skip** without `SYLPHEED_DISC`. A green run
|
||||
with it unset means almost nothing. `build-reborn test` wires it up for you.
|
||||
* Prefer a headless self-verify over "it compiles": `sylpheed-cli mesh render`,
|
||||
`screen render`, `save info` all produce checkable artifacts.
|
||||
* A Bevy system-parameter conflict is invisible to the type checker and panics
|
||||
at startup. If you touch viewer systems, *run the binary*, don't just build it.
|
||||
|
||||
## Reporting
|
||||
|
||||
State what you measured, what you assumed, and what you could not settle. If a
|
||||
result is withdrawn, say so and keep the reasoning — that is the corpus's whole
|
||||
convention, and the reason its numbers can be trusted.
|
||||
@@ -1,132 +0,0 @@
|
||||
Answer the open questions the Godot menu port is blocked on, one at a time.
|
||||
|
||||
## Your objective
|
||||
|
||||
`Syplheed-Reborn/docs/port/MISSION.md` — read it every iteration. It lists the
|
||||
open questions Q1…Q9 plus a gated probe S1, and the gate each one must pass.
|
||||
|
||||
**You do not build the port.** A separate agent does that, from what you produce.
|
||||
Your deliverable is decoded, verified, written-down answers with the evidence.
|
||||
If you find yourself designing an export schema or writing GDScript, you have
|
||||
crossed the line — go back to the question you were answering.
|
||||
|
||||
This is still reverse engineering. What changed is what earns attention: an item
|
||||
is worth doing when the menu port is blocked on it.
|
||||
|
||||
## Read these first, every iteration
|
||||
|
||||
Short on purpose, and the reason this prompt is short:
|
||||
|
||||
1. `docs/port/MISSION.md` — the open questions, their gates, what is out of scope.
|
||||
2. `docs/port/HANDOFF.md` — what the port agent has been told so far. **Update it
|
||||
when you answer something.** An answer not reachable from that page has not
|
||||
been delivered.
|
||||
3. `docs/re/REFUTED.md` — claims already tested and dead. Grep it for your nouns
|
||||
before designing anything.
|
||||
4. `docs/re/METHOD.md` — the traps this corpus has already paid for.
|
||||
5. `docs/re/INDEX.md` — what is already decoded. Re-deriving a ✅ row is not a
|
||||
finding; asking whether its values *resolve* is.
|
||||
6. `docker/agent/AGENT.md` — the container's tooling.
|
||||
|
||||
`docs/re/disc-atlas.html` maps how the assets reference each other — useful when
|
||||
you need to find what feeds what.
|
||||
|
||||
**These files are the memory.** A finding that lives only in your context is lost
|
||||
when the container dies.
|
||||
|
||||
## Each iteration
|
||||
|
||||
1. **Pick one question** from MISSION.md, preferring the one that blocks the port
|
||||
earliest and whose first step is cheapest. If you are mid-question, continue it
|
||||
rather than starting another.
|
||||
2. **Do the smallest experiment that could settle it**, and try to *refute* your
|
||||
hypothesis before believing it. Run the known-positive through any new filter
|
||||
first; a filter that fails its own control is dead, not tuneable.
|
||||
3. **Classify the answer honestly.** Every answer is exactly one of:
|
||||
* **decoded** — the field, plus a disc-wide check;
|
||||
* **measured** — not on the disc in any form you found, but here is what the
|
||||
running game does, and here is the capture;
|
||||
* **undecodable, with reach** — you looked here, here and here, and this is
|
||||
why it is not there.
|
||||
|
||||
Never a fourth thing. *Measured* and *undecodable* mean the port agent will
|
||||
author that value by hand, and it must know it is authoring rather than
|
||||
transcribing. Labelling a guess as a decode puts it into the port wearing the
|
||||
badge of a measurement.
|
||||
4. **Write it down** in `docs/re/` under the ✅/🟡/❔ convention, with the evidence
|
||||
and the *reach* of any negative, then update the row in `docs/port/HANDOFF.md`.
|
||||
* Refuted something → a line in `REFUTED.md`.
|
||||
* Bitten by a general trap → a line in `METHOD.md`.
|
||||
* Closed a format → update its `INDEX.md` row.
|
||||
5. **Commit** to `auto/<topic>`, one logical change per commit.
|
||||
6. **Publish**: `push-work`. Every iteration that produced a commit.
|
||||
7. **Say plainly what you did not settle**, and stop.
|
||||
|
||||
## Hard rules
|
||||
|
||||
* **Do not build the port.** No Godot project, no GDScript, no asset pipeline, no
|
||||
export schema, no transcoding. Those belong to the port agent.
|
||||
* **Do not touch `crates/sylpheed-viewer`.** The Explorer is the human's tool for
|
||||
exploring and verifying the RE work; it keeps its static-data-only rule and the
|
||||
port does not depend on it.
|
||||
* **Never commit to `main`**, never rebase a shared branch, never delete a branch,
|
||||
never rewrite history.
|
||||
* **Do not touch another agent's worktree.** `git worktree list` first; branches
|
||||
marked `+` are checked out elsewhere.
|
||||
* **One emulator at a time** — `run-canary` enforces it with a lockfile.
|
||||
* **Measure the oracle; never infer it.** Most of the open questions are about
|
||||
*behaviour* — timing, transitions, what a button does, what a d-pad press does
|
||||
at the end of a list. Those cannot be answered from the file. An iteration that
|
||||
reasons about the game without running it is a red flag unless the question is
|
||||
a pure static-format one.
|
||||
* **Do not improvise around a blocker.** If a question needs a decision only the
|
||||
user can make, or the container cannot do it, write what you found, note it in
|
||||
MISSION.md, and move to the next question you can actually finish.
|
||||
|
||||
## The S1 probe
|
||||
|
||||
One iteration, then **stop and write the go/no-go**. Do not start Ready Room work
|
||||
on your own authority — MISSION.md §S1 says why.
|
||||
|
||||
## Verifying
|
||||
|
||||
* `build-reborn test` wires up `SYLPHEED_DISC`; without it the disc tests
|
||||
self-skip and a green run means almost nothing.
|
||||
* Verify with an **artifact**, not with "it compiles": `sylpheed-cli screen
|
||||
info` / `screen render` / `mesh render` / `save info`, a capture, a screenshot.
|
||||
* Commit the reference data beside the finding, so the port can be built without
|
||||
a disc in the loop during development.
|
||||
* A regenerated artifact that comes out byte-identical is strong evidence a change
|
||||
was additive. When it does change, check that every diff line pairs exactly.
|
||||
|
||||
## Publishing
|
||||
|
||||
`push-work` pushes the current branch to origin. It refuses anything that is not
|
||||
`auto/*` and never force-pushes, so the consolidated line stays a human's
|
||||
decision. Run it **every iteration that produced a commit** — not at the end of
|
||||
some longer arc, which is exactly when a container dies.
|
||||
|
||||
If it reports no credentials, say so in your reply and continue working. Do not
|
||||
improvise another route out: no remote rewrite, no credential helper of your own,
|
||||
no alternate transport. A push that is blocked is a blocked push.
|
||||
|
||||
## Pacing
|
||||
|
||||
One experiment plus its write-up is a good iteration; a marathon is not. Stop with
|
||||
a clean commit, a push, and an honest list of what is still open.
|
||||
|
||||
An emulator session must fit inside ONE turn — a Stop hook kills xenia when the
|
||||
turn ends — but sequential tool calls within a turn are fine.
|
||||
|
||||
The loop runs on a fixed interval set by the harness, so you do **not** need to
|
||||
arm the next wakeup yourself. Spend that attention on the write-up instead.
|
||||
|
||||
**And never stop it.** Do not call `ScheduleWakeup` at all — not to re-pace the
|
||||
loop, not to tidy up, and above all not with `stop`. Ending the loop ends the
|
||||
run: the container exits, and the next iteration never happens. If the cadence
|
||||
is genuinely wrong, say so in your reply and leave it to a human — the interval
|
||||
is set outside this prompt and is not yours to optimise.
|
||||
|
||||
This is not hypothetical. A run ended at 2026-08-29 04:0x with a clean exit 0
|
||||
while the display title read "Loop interval optimization", leaving four files of
|
||||
work uncommitted in the tree.
|
||||
@@ -139,7 +139,7 @@ ENV HOME=/sylph-home/re \
|
||||
XENIA_BUILD_DIR=/sylph-home/re/canary-build \
|
||||
SDL_AUDIODRIVER=dummy \
|
||||
LIBGL_ALWAYS_SOFTWARE=1 \
|
||||
PATH=/work/Syplheed-Reborn/tools/re-capture/bin:/work/Syplheed-Reborn/tools/re-capture:/sylph-home/re/.cargo/bin:/usr/local/bin:/usr/bin:/bin
|
||||
PATH=/work/tools:/work/tools/re-capture/bin:/work/tools/re-capture:/sylph-home/re/.cargo/bin:/usr/local/bin:/usr/bin:/bin
|
||||
|
||||
ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/entrypoint.sh"]
|
||||
CMD ["bash"]
|
||||
@@ -92,6 +92,26 @@ log "build parallelism: $jobs (cpus=$cpus, mem=${mem_gib}GiB avail)"
|
||||
|
||||
mkdir -p "$HOME/shots" "$HOME/logs"
|
||||
|
||||
# ── The repository, cloned into THIS AGENT'S OWN volume ─────────────────────
|
||||
# Not a bind mount of a human's working tree. That arrangement bit this project
|
||||
# three times: an agent's `git config --local` captured a human's commits, a
|
||||
# credential helper leaked a container-only path onto the host, and a `git add
|
||||
# -A` swept an agent's in-flight files into somebody else's commit. Separate
|
||||
# checkouts make all three impossible rather than discouraged.
|
||||
#
|
||||
# Cloned ONCE. Never auto-pulled: pulling under a running agent moves files out
|
||||
# from under whatever it is mid-edit, which is the same class of bug again.
|
||||
if [ ! -d /work/.git ]; then
|
||||
echo "[entrypoint] cloning ${SYLPH_REPO_URL:-https://git.mc02.dev/fabi/Sylpheed.git} into /work"
|
||||
git clone --quiet "${SYLPH_REPO_URL:-https://git.mc02.dev/fabi/Sylpheed.git}" /work || {
|
||||
echo "[entrypoint] clone FAILED -- the agent has no repository" >&2; }
|
||||
else
|
||||
echo "[entrypoint] /work is at $(git -C /work rev-parse --short HEAD 2>/dev/null) on $(git -C /work rev-parse --abbrev-ref HEAD 2>/dev/null)"
|
||||
fi
|
||||
|
||||
# The shared exchange, for transient files that must not enter git history.
|
||||
mkdir -p /exchange/files 2>/dev/null || true
|
||||
|
||||
# ── Claude Code config ───────────────────────────────────────────────────────
|
||||
# Seed ~/.claude.json from the host's read-only copy, then stamp onboarding as
|
||||
# complete. Claude Code re-runs its first-run wizard whenever
|
||||
@@ -101,6 +121,15 @@ mkdir -p "$HOME/shots" "$HOME/logs"
|
||||
if [ -f "$HOME/.claude.host.json" ] && [ ! -s "$HOME/.claude.json" ]; then
|
||||
cp "$HOME/.claude.host.json" "$HOME/.claude.json" 2>/dev/null || true
|
||||
fi
|
||||
# `credential.helper=store` rewrites this file by rename-over-target, which
|
||||
# fails with EBUSY on a bind mount -- reported as `fatal: unable to write
|
||||
# credential store`, while the push itself succeeds. A fatal line that is
|
||||
# routinely wrong teaches the reader to ignore the one that is real.
|
||||
if [ -f "$HOME/.git-credentials.host" ]; then
|
||||
cp "$HOME/.git-credentials.host" "$HOME/.git-credentials" 2>/dev/null || true
|
||||
chmod 600 "$HOME/.git-credentials" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
CLAUDE_VER=$(claude --version 2>/dev/null | grep -oE '^[0-9][0-9.]*' || echo 0.0.0)
|
||||
python3 /usr/local/bin/seed-claude-config.py "$HOME/.claude.json" "$CLAUDE_VER" \
|
||||
"$PWD" "${PROJECT_DIR:-/work}" "$HOME" || true
|
||||
@@ -38,8 +38,12 @@ PROJECT="${SYLPH_PROJECT:-$(cd "$HERE/../../.." && pwd)}"
|
||||
# --cpus with "failed to parse as a rational number".
|
||||
HOST_CPUS=$(nproc)
|
||||
HOST_MEM_KB=$(awk '/MemTotal/{print $2}' /proc/meminfo)
|
||||
CPUS="${SYLPH_CPUS:-$(LC_ALL=C awk -v c="$HOST_CPUS" 'BEGIN{printf "%.1f", c/2}')}"
|
||||
MEM_GB="${SYLPH_MEM_GB:-$(LC_ALL=C awk -v m="$HOST_MEM_KB" 'BEGIN{printf "%d", m/1048576/2}')}"
|
||||
# Fixed, not "half the host": half was right when this was the only agent. There
|
||||
# are now two, and a Referee is planned, so the budget is split deliberately
|
||||
# instead of each container claiming half of a box it shares. The decoder gets
|
||||
# the larger share because it builds and drives the emulator.
|
||||
CPUS="${SYLPH_CPUS:-5}"
|
||||
MEM_GB="${SYLPH_MEM_GB:-6}"
|
||||
[ "$MEM_GB" -lt 2 ] && MEM_GB=2
|
||||
# /dev/shm holds the emulator's guest memory (gmem.py reads it there). Docker's
|
||||
# 64 MB default is far too small for a 512 MB console address space, and the
|
||||
@@ -83,16 +87,30 @@ docker_args() {
|
||||
--cap-add SYS_PTRACE
|
||||
--security-opt seccomp=unconfined
|
||||
--security-opt apparmor=unconfined
|
||||
# ── project ──
|
||||
# Mounted TWICE, at the same path the host uses and at /work. The host path
|
||||
# is what makes Claude Code's memory carry over: its per-project state key is
|
||||
# derived from the working directory, so running at /work would give the
|
||||
# agent an empty `-work` project instead of the accumulated
|
||||
# `-home-fabi-RE-Project-Sylpheed` one. /work stays because the toolkit
|
||||
# scripts and every doc here refer to it.
|
||||
-v "$PROJECT:$PROJECT"
|
||||
-v "$PROJECT:/work"
|
||||
# ── the repository ──
|
||||
# The agent's OWN clone, in its own volume -- not a bind mount of a human's
|
||||
# working tree. That arrangement bit this project three times: an agent's
|
||||
# `git config --local` captured a human's commits, a credential helper
|
||||
# leaked a container-only path onto the host, and a `git add -A` swept an
|
||||
# agent's in-flight files into someone else's commit. Separate checkouts
|
||||
# make all three impossible rather than merely discouraged.
|
||||
#
|
||||
# The cost, accepted knowingly: Claude Code keys its per-project memory off
|
||||
# the working directory, so moving from the host path to /work starts that
|
||||
# memory empty. The corpus in docs/ is the memory that matters and it
|
||||
# travels with the clone.
|
||||
-v "sylpheed-decoder-repo:/work"
|
||||
# Xenia Canary stays a separate repository -- it is a fork tracking upstream
|
||||
# and carries our instrumentation. Read-write: building probes into it is
|
||||
# real work, not a side effect.
|
||||
-v "${SYLPH_CANARY:-$HOME/RE Project Sylpheed/xenia-canary}:/canary"
|
||||
# The shared exchange: transient files with provenance, outside git history.
|
||||
-v "sylpheed-exchange:/exchange"
|
||||
-e "PROJECT_DIR=/work"
|
||||
-e "SYLPH_EXCHANGE=/exchange"
|
||||
-e "SYLPH_AGENT=decoder"
|
||||
-e "SYLPH_REPO_URL=https://git.mc02.dev/fabi/Sylpheed.git"
|
||||
-e "XENIA_SRC=/canary"
|
||||
# ── claude ──
|
||||
# The state dir is shared read-write: credentials live in
|
||||
# .claude/.credentials.json, so token refresh needs to write, and this is
|
||||
@@ -134,7 +152,7 @@ docker_args() {
|
||||
# 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")
|
||||
_out+=(-v "$GITCRED:/sylph-home/re/.git-credentials.host: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
|
||||
@@ -203,8 +221,8 @@ case "${1:-}" in
|
||||
# answer once and exit, killing the loop on its first iteration.
|
||||
TASK="${1:-}"
|
||||
if [ -z "$TASK" ]; then
|
||||
if [ -f "$HERE/loop-task.md" ]; then
|
||||
TASK="$(cat "$HERE/loop-task.md")"
|
||||
if [ -f "$HERE/../../docs/agents/decoder-loop.md" ]; then
|
||||
TASK="$(cat "$HERE/../../docs/agents/decoder-loop.md")"
|
||||
else
|
||||
TASK="Work the RE backlog in Syplheed-Reborn/docs/re/BACKLOG.md."
|
||||
fi
|
||||
@@ -85,7 +85,7 @@ WORKDIR /work
|
||||
ENV RUSTUP_HOME=/sylph-home/port/.rustup \
|
||||
CARGO_HOME=/sylph-home/port/.cargo \
|
||||
CARGO_TARGET_DIR=/sylph-home/port/target-container \
|
||||
PATH=/sylph-home/port/.cargo/bin:/usr/local/bin:/usr/bin:/bin
|
||||
PATH=/work/tools:/sylph-home/port/.cargo/bin:/usr/local/bin:/usr/bin:/bin
|
||||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
|
||||
| sh -s -- -y --default-toolchain stable --profile minimal --component clippy --component rustfmt
|
||||
|
||||
|
||||
@@ -45,6 +45,26 @@ python3 /usr/local/bin/seed-claude-config.py "$HOME/.claude.json" "$CLAUDE_VER"
|
||||
"$PWD" "${PROJECT_DIR:-/work}" "$HOME" || true
|
||||
chmod 600 "$HOME/.claude.json" 2>/dev/null || true
|
||||
|
||||
# ── The repository, cloned into THIS AGENT'S OWN volume ─────────────────────
|
||||
# Not a bind mount of a human's working tree. That arrangement bit this project
|
||||
# three times: an agent's `git config --local` captured a human's commits, a
|
||||
# credential helper leaked a container-only path onto the host, and a `git add
|
||||
# -A` swept an agent's in-flight files into somebody else's commit. Separate
|
||||
# checkouts make all three impossible rather than discouraged.
|
||||
#
|
||||
# Cloned ONCE. Never auto-pulled: pulling under a running agent moves files out
|
||||
# from under whatever it is mid-edit, which is the same class of bug again.
|
||||
if [ ! -d /work/.git ]; then
|
||||
echo "[entrypoint] cloning ${SYLPH_REPO_URL:-https://git.mc02.dev/fabi/Sylpheed.git} into /work"
|
||||
git clone --quiet "${SYLPH_REPO_URL:-https://git.mc02.dev/fabi/Sylpheed.git}" /work || {
|
||||
echo "[entrypoint] clone FAILED -- the agent has no repository" >&2; }
|
||||
else
|
||||
echo "[entrypoint] /work is at $(git -C /work rev-parse --short HEAD 2>/dev/null) on $(git -C /work rev-parse --abbrev-ref HEAD 2>/dev/null)"
|
||||
fi
|
||||
|
||||
# The shared exchange, for transient files that must not enter git history.
|
||||
mkdir -p /exchange/files 2>/dev/null || true
|
||||
|
||||
# ── Claude Code ──────────────────────────────────────────────────────────────
|
||||
# Without this the loop prompt is handed to `exec` as a command, and the whole
|
||||
# markdown file is tried as a filename: exit 126, "File name too long".
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
# Env:
|
||||
# SYLPH_PORT_CPUS / SYLPH_PORT_MEM_GB override the cap (default 3 / 4)
|
||||
# SYLPH_PORT_REPO repo to mount at /work (default: this script's parent)
|
||||
# SYLPH_REBORN path to the Syplheed-Reborn checkout (read-only mount)
|
||||
# SYLPH_DISC extracted disc root
|
||||
# SYLPH_GIT_CREDENTIALS file with `https://<user>:<token>@host` for push-work
|
||||
# SYLPH_LOOP_INTERVAL fixed loop cadence (default 45m)
|
||||
@@ -44,7 +43,6 @@ NAME="${SYLPH_PORT_NAME:-sylpheed-port}"
|
||||
CPUS="${SYLPH_PORT_CPUS:-3}"
|
||||
MEM_GB="${SYLPH_PORT_MEM_GB:-4}"
|
||||
|
||||
REBORN="${SYLPH_REBORN:-$(cd "$REPO/../Syplheed-Reborn" 2>/dev/null && pwd || true)}"
|
||||
DISC="${SYLPH_DISC:-$(cd "$REPO/../sylph_extract" 2>/dev/null && pwd || true)}"
|
||||
|
||||
docker_args() {
|
||||
@@ -56,25 +54,20 @@ docker_args() {
|
||||
--memory-swap "${MEM_GB}g" # no swap escape hatch: a swapping build
|
||||
# thrashes the whole host
|
||||
--pids-limit 2048
|
||||
-v "$REPO:/work"
|
||||
-v "sylpheed-port-repo:/work"
|
||||
-v "sylpheed-port-target:/sylph-home/port/target-container"
|
||||
# CARGO_HOME on a volume, not the container overlay: without it the pinned
|
||||
# decoder source is re-fetched from the network on every fresh container.
|
||||
-v "sylpheed-port-cargo:/sylph-home/port/.cargo"
|
||||
-v "${SYLPH_CLAUDE_HOME:-$HOME/.claude}:/sylph-home/port/.claude"
|
||||
-v "${SYLPH_CLAUDE_JSON:-$HOME/.claude.json}:/sylph-home/port/.claude.host.json:ro"
|
||||
-v "sylpheed-exchange:/exchange"
|
||||
-e "PROJECT_DIR=/work"
|
||||
-e "SYLPH_EXCHANGE=/exchange"
|
||||
-e "SYLPH_AGENT=port"
|
||||
-e "SYLPH_REPO_URL=https://git.mc02.dev/fabi/Sylpheed.git"
|
||||
)
|
||||
|
||||
# The RE corpus, READ-ONLY. `docs/port/HANDOFF.md` is the contract, and the
|
||||
# agent also builds sylpheed-cli from here for the reference renderer. Mounted
|
||||
# ro so a port iteration cannot edit the other agent's repository.
|
||||
if [ -n "$REBORN" ] && [ -d "$REBORN" ]; then
|
||||
_out+=(-v "$REBORN:/reborn:ro")
|
||||
else
|
||||
echo "==> NOTE: no Syplheed-Reborn checkout found; the agent cannot read" >&2
|
||||
echo " HANDOFF.md or build the reference renderer. Set SYLPH_REBORN." >&2
|
||||
fi
|
||||
|
||||
if [ -n "$DISC" ] && [ -d "$DISC" ]; then
|
||||
_out+=(-v "$DISC:/disc:ro" -e "SYLPHEED_DISC=/disc")
|
||||
@@ -131,8 +124,8 @@ case "${1:-}" in
|
||||
shift
|
||||
TASK="${1:-}"
|
||||
if [ -z "$TASK" ]; then
|
||||
if [ -f "$REPO/docs/loop-task.md" ]; then
|
||||
TASK="$(cat "$REPO/docs/loop-task.md")"
|
||||
if [ -f "$HERE/../../docs/agents/port-loop.md" ]; then
|
||||
TASK="$(cat "$HERE/../../docs/agents/port-loop.md")"
|
||||
else
|
||||
TASK="Work the milestones in docs/MISSION.md."
|
||||
fi
|
||||
@@ -143,7 +136,6 @@ case "${1:-}" in
|
||||
INTERVAL="${SYLPH_LOOP_INTERVAL-45m}"
|
||||
echo "==> loose | cpus=$CPUS mem=${MEM_GB}g pacing=${INTERVAL:-self}"
|
||||
echo "==> repo: $REPO"
|
||||
echo "==> reborn: ${REBORN:-<none>} (read-only)"
|
||||
docker run -d -i -t "${ARGS[@]}" -e SYLPH_AUTONOMOUS=1 -w /work "$IMAGE" \
|
||||
"/loop ${INTERVAL:+$INTERVAL }$TASK" >/dev/null
|
||||
echo
|
||||
|
||||
Reference in New Issue
Block a user