Something went wrong. Try again.
small gleam coding and persistent agent daemon with a detachable cli and a canvas ui forked from okami.mom/albedo
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041"""The reference build that mixed-version scenarios run beside this checkout.
test/reference-daemon.sh pins, builds, and caches it; robot-docs/testing.md("Mixed-version moves") says when to bump the pin."""
import functoolsimport subprocessfrom pathlib import Path
from harness import ROOT
@functools.cachedef reference(): """The reference build's directory, built on first use.""" built = subprocess.run( [str(ROOT / "test/reference-daemon.sh")], text=True, capture_output=True ) if built.returncode: raise RuntimeError("building the reference daemon failed:\n" + built.stderr) return Path(built.stdout.strip().splitlines()[-1])
def run_reference(daemon): """Point `daemon`'s environment at the reference daemon and its CLI, so its next boot runs the older build on the same home.""" build = reference() daemon.env["ALBEDO_DAEMON"] = str(build / "daemon" / "albedo-daemon") daemon.env["ALBEDO_TEST_CLI"] = str(build / "albedo") daemon.env["ALBEDO_ROOT"] = str(build / "src")
def run_current(daemon): """Undo `run_reference`: `daemon`'s next boot runs this checkout again.""" for key in ("ALBEDO_DAEMON", "ALBEDO_TEST_CLI", "ALBEDO_ROOT"): if key in daemon.pristine_env: daemon.env[key] = daemon.pristine_env[key] else: daemon.env.pop(key, None)