Files
Sylpheed/docker/decoder/bin/build-canary
MechaCat02 c58196b795 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.
2026-08-29 11:48:30 +02:00

53 lines
2.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# Configure + build Xenia Canary inside the container.
#
# The build directory is $XENIA_BUILD_DIR (outside the bind-mounted repo) on
# purpose. The host builds this same tree, and CMake caches an absolute compiler
# path and a generator: sharing repo/build between host and container makes each
# one reconfigure and relink everything the other just did.
#
# Parallelism comes from $SYLPH_JOBS, which the entrypoint derives from
# AVAILABLE MEMORY as well as core count — a full-parallel build of this tree
# has OOM-killed the host outright.
#
# build-canary [Release|Debug] [extra cmake --build args]
set -euo pipefail
CONFIG="${1:-Release}"; shift || true
SRC="${PROJECT_DIR:-/work}/xenia-canary"
BUILD="${XENIA_BUILD_DIR:-/sylph-home/re/canary-build}"
JOBS="${SYLPH_JOBS:-2}"
[ -d "$SRC" ] || { echo "build-canary: no source at $SRC" >&2; exit 1; }
# Submodules: this tree has drifted before, and a checkout that changes a
# gitlink fails silently into a half-built third_party. Report rather than fix,
# because one submodule here carries an in-tree cmake build whose untracked
# artifacts block an update.
if ! git -C "$SRC" submodule status --recursive 2>/dev/null | grep -qv '^ '; then
:
else
echo "build-canary: note — submodules are not all at their recorded commits:" >&2
git -C "$SRC" submodule status 2>/dev/null | grep -v '^ ' | sed 's/^/ /' >&2
fi
if [ ! -f "$BUILD/CMakeCache.txt" ]; then
echo "==> configuring $BUILD ($CONFIG, Ninja Multi-Config, clang $(clang --version | head -1 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+'))"
cmake -S "$SRC" -B "$BUILD" -G "Ninja Multi-Config" \
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
-DXENIA_BUILD_TESTS=OFF -DXENIA_BUILD_MISC=OFF \
-DXENIA_ENABLE_LTO=OFF
fi
echo "==> building $CONFIG with -j$JOBS"
cmake --build "$BUILD" --config "$CONFIG" --parallel "$JOBS" --target xenia_canary "$@"
BIN="$BUILD/bin/Linux/$CONFIG/xenia_canary"
if [ -x "$BIN" ]; then
echo "==> $BIN"
echo " run it with: run-canary"
else
echo "build-canary: target did not produce $BIN" >&2
exit 1
fi