Files
nisse/scripts/bringup-repo.sh
T
dongarandClaude Opus 5.5 154a0c3fa8
CI / checks (push) Skipped
CI / checks (pull_request) Successful in 1m42s
CI / e2e (pull_request) Successful in 4m0s
M7.1: extract nisse-core
What isn't the dev agent's moves to nisse-core, unchanged in behaviour,
with its tests: canonical, render, render_anthropic, llm, catalog, probe,
context, views, state, reconcile, worker, cancel, dump, transport, matrix,
execution, testing, vault, memory, oplog, envfile and gitea (whole).

- nisse_core.state.StateStore holds the tables every agent has; an
  agent's subclass adds its tables (version, migrations), roles and
  views. nisse_dev.state.StateStore adds the build VM blocks (v5).
- views.project takes what each role is shown, rather than a fixed table.
- Vault takes the agent's name (agent=), for provenance.
- A test that nisse_core never imports an agent.
- The loop, config, git, delegation, expert, tools and evals stay in
  nisse-dev until nisse-ops has a loop to share.

Docs: the Development Plan marks M7.1 done and notes that Phase 6 waits on
the agent host and Terraform; Architecture Part L names the package.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J5Utyfzw7gF7UhjRDEtjTk
2026-10-13 18:37:01 +00:00

43 lines
1.8 KiB
Bash
Executable File

#!/usr/bin/env bash
# The bring-up's test repository (Development Plan, live runs):
# nisse-testing-operator/nisse-bringup, made as the end-to-end tests make
# theirs (tests/integration/e2e_support.py, make_repo), but kept between runs.
# Seeded with the test package, the bring-up agent's account a collaborator,
# main protected, and a deploy key of its own at $E2E/ssh/nisse-bringup.key.
#
# scripts/bringup-repo.sh create make it
# scripts/bringup-repo.sh reset delete it and make it again
# scripts/bringup-repo.sh delete delete it
#
# Needs NISSE_OPERATOR_TOKEN (.env here) and the bring-up agent's token
# (NISSE_GITEA_TOKEN in $E2E/.env), which names the agent's account.
set -euo pipefail
cd "$(dirname "$0")/.."
E2E=${NISSE_E2E:-/root/nisse-e2e}
case "${1:-}" in create|reset|delete) ;; *) sed -n '2,15p' "$0" | sed 's/^# \{0,1\}//'; exit 2 ;; esac
set -a; [ -f .env ] && . ./.env; set +a
exec uv run python - "$1" "$E2E" <<'PY'
import sys
from pathlib import Path
sys.path.insert(0, "tests/integration")
from e2e_support import OWNER, delete_repo, make_repo, operator_gitea # noqa: E402
from nisse_core.envfile import load_env_file # noqa: E402
from nisse_core.gitea import GiteaClient # noqa: E402
action, e2e = sys.argv[1], Path(sys.argv[2])
url = "https://gitea.dongar.net"
operator = operator_gitea(url)
name = "nisse-bringup"
if action in ("reset", "delete"):
delete_repo(operator, f"{OWNER}/{name}")
print(f"deleted {OWNER}/{name}")
if action in ("create", "reset"):
agent_env: dict[str, str] = {}
load_env_file(e2e / ".env", agent_env)
agent = GiteaClient(url, agent_env["NISSE_GITEA_TOKEN"]).whoami()
repo = make_repo(operator, name, e2e / "ssh", agent=agent)
print(f"made {repo.name}: {agent} a collaborator; push key {repo.push_key}")
PY