diff --git a/examples/install-local-smoke.py b/examples/install-local-smoke.py index 3bfcb16ef..58d656c2e 100644 --- a/examples/install-local-smoke.py +++ b/examples/install-local-smoke.py @@ -291,6 +291,16 @@ def main() -> int: release_python = release_root / ".loopx-python" assert release_python.read_text(encoding="utf-8").strip() == sys.executable assert (release_root / "loopx" / "cli.py").is_file(), release_root + repair = codex_home / "skills" / "loopx-self-repair" / "scripts" / "find_pattern.py" + assert repair.with_name("lexical_retrieval.py").read_bytes() == ( + release_root / "loopx" / "lexical_retrieval.py" + ).read_bytes() + repair_query = subprocess.run( + [sys.executable, "-I", str(repair), "--query", "closeout recovery"], + cwd=root, env={"PATH": str(root / "empty-path")}, + check=True, capture_output=True, text=True, + ) + assert json.loads(repair_query.stdout)["total_matches"] > 0 runtime_package = release_root / "loopx" / "control_plane" / "runtime" assert (runtime_package / "run_compaction.py").is_file(), release_root assert (runtime_package / "session_runtime.py").is_file(), release_root diff --git a/scripts/install-local.sh b/scripts/install-local.sh index 6119a61d4..a7abceb1e 100755 --- a/scripts/install-local.sh +++ b/scripts/install-local.sh @@ -390,7 +390,16 @@ PY fi skill_target="$skills_dir/$skill_name" skill_tmp="$(mktemp -d "$skills_dir/.${skill_name}.tmp.XXXXXX")" - if ! cp -R "$skill_source"/. "$skill_tmp"/; then + if ! PYTHONSAFEPATH=1 PYTHONPATH="$source_root${PYTHONPATH:+:$PYTHONPATH}" \ + "${LOOPX_PYTHON:-python3}" - "$skill_source" "$skill_tmp" <<'PY' +import sys +from pathlib import Path + +from loopx.workflow_skill_install import _install_one_skill + +_install_one_skill(Path(sys.argv[1]), Path(sys.argv[2])) +PY + then rm -rf "$skill_tmp" return 1 fi