diff --git a/AGENTS.md b/AGENTS.md index 856f9c4..3093fac 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -58,9 +58,10 @@ Integration tests run on the staging machine `jarvis` (see "### jarvis (staging) - Canonical repo lives on Gitea: `git.manyworlds.fit`, **SSH on port 222** (`ssh://git@git.manyworlds.fit:222/gabby/semif-agent.git`). Key - `~/.ssh/id_ed25519` is registered there. The staging machine `jarvis` clones - to `~/semif-agent` (via `scripts/bootstrap.sh`); the old box working copy is - at `~/repos/semif-agent` (its editable install still points at the moved + `~/.ssh/id_ed25519` is registered there. The staging machine `jarvis` runs + from a manual clone at `~/semif-agent` (`scripts/bootstrap.sh` provisions + everything else and never re-clones the agent repo); the old box working copy + is at `~/repos/semif-agent` (its editable install still points at the moved `~/semif-agent`, so `import semif_agent` is broken there — moot, guppy runs ollama only now); the dev machine at `~/Repos/semif-agent`. Push/pull from Gitea — never rsync/tar the code. @@ -211,11 +212,14 @@ unit tests (24) + box integration tests (2). ### jarvis (staging) -- Provision a fresh Ubuntu machine into a running staging box: +- Provision a fresh Ubuntu machine into a running staging box: clone + `semif-agent` to `~/semif-agent` first (register its SSH key on Gitea), then `scripts/bootstrap.sh --peer-ollama http://192.168.8.181:11434`. - Idempotent and rerunnable; every stage no-ops on existing state, so it also - boots an unknown-state machine. It installs **no ollama** — llm + codegen - both point at guppy. + The script must be run from a checkout — it reads pins from that checkout's + `config.example.json` and never re-clones the agent repo (only the SemIf + engine). Idempotent and rerunnable; every stage no-ops on existing state, so + it also boots an unknown-state machine. It installs **no ollama** — llm + + codegen both point at guppy. - All pins are read from `config.example.json`'s `engine` block: `semif_repo` (public GitHub `TheoLeeCJ/SemIf`), `semif_ref` (pinned commit the box runs), `gguf_url`/`gguf_sha256` (verified after download), and the HF tokenizer diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index 0376dc9..187d3ff 100755 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -5,6 +5,11 @@ # so it can also bootstrap a machine of unknown state. All LLM traffic points # at a peer ollama endpoint (default: guppy) — this script installs NO ollama. # +# Must be run from a semif-agent checkout (it reads pins from this checkout's +# config.example.json); the checkout is used as-is and never re-cloned — only +# the SemIf engine is fetched. Clone the agent repo to ~/semif-agent first +# (its SSH key must be registered on Gitea). +# # Pins (SemIf git commit, GGUF url+sha256, python deps) are read from # config.example.json's engine block, which is the single source of truth; # bump those there and rerun to upgrade. @@ -102,23 +107,16 @@ if ! "$PY" -c 'import sys; raise SystemExit(0 if sys.version_info >= (3, 11) els fi echo "== python: $("$PY" --version)" -# --- stage 2: ssh key + clones ------------------------------------------------- +# --- stage 2: ssh key + SemIf engine clone ------------------------------------ mkdir -p ~/.ssh if [[ ! -f ~/.ssh/id_ed25519 ]]; then - echo "== generating ~/.ssh/id_ed25519" + echo "== generating ~/.ssh/id_ed25519 (register this key on Gitea for the agent repo)" ssh-keygen -t ed25519 -N "" -f ~/.ssh/id_ed25519 + cat ~/.ssh/id_ed25519.pub fi -if [[ ! -d ~/semif-agent/.git ]]; then - echo "== cloning semif-agent from Gitea" - if ! git clone ssh://git@git.manyworlds.fit:222/gabby/semif-agent.git ~/semif-agent; then - echo "clone failed — register this key on Gitea, then rerun:" >&2 - cat ~/.ssh/id_ed25519.pub >&2 - exit 1 - fi -else - git -C ~/semif-agent pull --ff-only || true -fi +AGENT_DIR="$REPO_ROOT" +git -C "$AGENT_DIR" pull --ff-only || true if [[ ! -d ~/semif/.git ]]; then echo "== cloning SemIf engine from $SEMIF_REPO" @@ -141,7 +139,7 @@ echo "== installing engine deps into venv" "$PIP" install -e ~/semif --no-deps "$PIP" install numpy==2.3.5 transformers==5.17.0 tokenizers==0.23.2 huggingface-hub CMAKE_BUILD_PARALLEL_LEVEL=6 MAKEFLAGS=-j6 "$PIP" install llama-cpp-python==0.3.35 -"$PIP" install -e ~/semif-agent --no-deps +"$PIP" install -e "$AGENT_DIR" --no-deps "$PIP" install pytest # --- stage 4: GGUF -------------------------------------------------------------- @@ -193,8 +191,8 @@ PY # --- stage 7: optional data copy ----------------------------------------------------- if [[ -n "$COPY_DATA" ]]; then echo "== rsync data from $COPY_DATA" - mkdir -p ~/semif-agent/data - rsync -a "$COPY_DATA/" ~/semif-agent/data/ + mkdir -p "$AGENT_DIR/data" + rsync -a "$COPY_DATA/" "$AGENT_DIR/data/" fi # --- stage 8: verify --------------------------------------------------------------------