From 4309defc99e80ed6e19e902eafc32b67a4705ecf Mon Sep 17 00:00:00 2001 From: Andrew Park Date: Tue, 26 May 2026 15:53:53 -0700 Subject: [PATCH] hybrid: de-hardcode user-specific paths in scripts, defaults, docs - Replace hardcoded /matx/u/aspark/... paths with OPENJARVIS_HYBRID_EXPERIMENTS_DIR env var defaulting to ~/.openjarvis/experiments/hybrid across runner, sweep orchestrator, report builder, backfill, and the SWE-bench dataset regression test. - run_sweep.py REPO_ROOT now inferred from __file__; VENV_PY + LOG_DIR overridable via env. - archon.py ARCHON_SRC env var no longer falls back to a personal clone; docstring points at the upstream repo. - README / docstring scrub: remove personal github link, personal install paths, '(Andrew's lane)' comment, /matx/u/aspark/CLAUDE.md spec ref. - Add minion_logs/ and oj-debug.*.json to .gitignore. --- .gitignore | 5 +++++ scripts/ablation/backfill_tool_calls.py | 8 +++++++- scripts/ablation/make_report.py | 14 ++++++++++---- scripts/ablation/run_sweep.py | 15 +++++++++------ src/openjarvis/agents/hybrid/README.md | 16 ++++++++-------- src/openjarvis/agents/hybrid/__init__.py | 6 +++--- src/openjarvis/agents/hybrid/archon.py | 18 ++++++++---------- src/openjarvis/agents/hybrid/minions.py | 6 +++--- .../hybrid/registry/ablation_minions.toml | 2 +- src/openjarvis/agents/hybrid/runner.py | 2 +- .../hybrid/test_swebench_dataset_variant.py | 9 ++++++--- 11 files changed, 61 insertions(+), 40 deletions(-) diff --git a/.gitignore b/.gitignore index 1dfd9b67..75e2da3b 100644 --- a/.gitignore +++ b/.gitignore @@ -125,3 +125,8 @@ learning.db **/learning/benchmarks/ **/teacher_traces/ *.session.json + +# Local dev artifacts (hybrid worker logs + cli debug dumps) +minion_logs/ +*.oj-debug.json +oj-debug.*.json diff --git a/scripts/ablation/backfill_tool_calls.py b/scripts/ablation/backfill_tool_calls.py index dbf824c5..70c62a33 100644 --- a/scripts/ablation/backfill_tool_calls.py +++ b/scripts/ablation/backfill_tool_calls.py @@ -53,7 +53,13 @@ from typing import Any, Dict, List, Optional, Tuple HYBRID_RUNS = Path( os.environ.get( "HYBRID_RUNS_DIR", - "/matx/u/aspark/.openjarvis/experiments/hybrid/runs", + Path( + os.environ.get( + "OPENJARVIS_HYBRID_EXPERIMENTS_DIR", + Path.home() / ".openjarvis" / "experiments" / "hybrid", + ) + ) + / "runs", ) ) diff --git a/scripts/ablation/make_report.py b/scripts/ablation/make_report.py index 2416bf11..a8a6efce 100644 --- a/scripts/ablation/make_report.py +++ b/scripts/ablation/make_report.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 -"""Build /matx/u/aspark/.openjarvis/experiments/hybrid/docs/index.html -plus a set of PNG pareto plots in the same dir. The HTML embeds the PNGs -via so the browser never has to render anything itself — +"""Build ``$OPENJARVIS_HYBRID_EXPERIMENTS_DIR/docs/index.html`` plus a set +of PNG pareto plots in the same dir. The HTML embeds the PNGs via +```` so the browser never has to render anything itself — just shows static images. Re-running is idempotent: regenerates index.html + all PNGs from whatever @@ -11,6 +11,7 @@ from __future__ import annotations import html as html_lib import json +import os import sys from dataclasses import dataclass from datetime import datetime @@ -22,7 +23,12 @@ import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt -HYBRID_ROOT = Path("/matx/u/aspark/.openjarvis/experiments/hybrid") +HYBRID_ROOT = Path( + os.environ.get( + "OPENJARVIS_HYBRID_EXPERIMENTS_DIR", + Path.home() / ".openjarvis" / "experiments" / "hybrid", + ) +) RUNS_DIR = HYBRID_ROOT / "runs" DOCS_DIR = HYBRID_ROOT / "docs" OUT_HTML = DOCS_DIR / "index.html" diff --git a/scripts/ablation/run_sweep.py b/scripts/ablation/run_sweep.py index 51b1e5bc..79833212 100644 --- a/scripts/ablation/run_sweep.py +++ b/scripts/ablation/run_sweep.py @@ -9,8 +9,6 @@ Drives a batch of ``openjarvis.agents.hybrid.runner`` invocations with: * exit-code + summary.json driven retry loop (resume mode, runner-handled) * incremental atomic updates of ``results-table.md`` (auto-section only) * Ctrl-C → SIGTERM the whole process group of each child cleanly - -Spec: see /matx/u/aspark/CLAUDE.md and the task description. """ from __future__ import annotations @@ -33,12 +31,17 @@ from typing import Dict, List, Optional, Tuple # Paths # --------------------------------------------------------------------------- -REPO_ROOT = Path("/matx/u/aspark/OpenJarvis") -VENV_PY = REPO_ROOT / ".venv" / "bin" / "python" -EXPERIMENTS_DIR = Path("/matx/u/aspark/.openjarvis/experiments/hybrid") +REPO_ROOT = Path(__file__).resolve().parents[2] +VENV_PY = Path(os.environ.get("OPENJARVIS_VENV_PY", REPO_ROOT / ".venv" / "bin" / "python")) +EXPERIMENTS_DIR = Path( + os.environ.get( + "OPENJARVIS_HYBRID_EXPERIMENTS_DIR", + Path.home() / ".openjarvis" / "experiments" / "hybrid", + ) +) RUNS_DIR = EXPERIMENTS_DIR / "runs" RESULTS_TABLE = EXPERIMENTS_DIR / "docs" / "results-table.md" -LOG_DIR = Path("/tmp/hybrid-sweep-logs") +LOG_DIR = Path(os.environ.get("HYBRID_SWEEP_LOG_DIR", "/tmp/hybrid-sweep-logs")) AUTO_SECTION_HEADER = "## n=100 sweep — auto-generated" # --------------------------------------------------------------------------- diff --git a/src/openjarvis/agents/hybrid/README.md b/src/openjarvis/agents/hybrid/README.md index 7a191671..3dda4ae4 100644 --- a/src/openjarvis/agents/hybrid/README.md +++ b/src/openjarvis/agents/hybrid/README.md @@ -1,10 +1,10 @@ # Hybrid local+cloud paradigm agents -Six paradigms ported from the legacy hybrid-local-cloud-compute harness -([github.com/andrewparkk1/hybrid-local-cloud-compute](https://github.com/andrewparkk1/hybrid-local-cloud-compute); -results archived at `~/.openjarvis/experiments/hybrid/`) — each is -registered as a standard OpenJarvis agent so the rest of the platform -(SDK, CLI, distillation, evals) can use them like any other agent. +Six paradigms ported from the original ``hybrid-local-cloud-compute`` +harness — each is registered as a standard OpenJarvis agent so the rest +of the platform (SDK, CLI, distillation, evals) can use them like any +other agent. Results live under ``$OPENJARVIS_HYBRID_EXPERIMENTS_DIR`` +(defaults to ``~/.openjarvis/experiments/hybrid/``). | Agent | Plan shape | Trains what? | Workers | |-------------------|-----------------|----------------------|---------------------------| @@ -46,15 +46,15 @@ structural scorer). ## Quickstart ```bash -cd /matx/u/aspark/OpenJarvis +cd OpenJarvis source .env # API keys -# 1. Start vLLM in another shell (see CLAUDE.md for the full recipe) +# 1. Start vLLM in another shell (see your local launch recipe) # CUDA_VISIBLE_DEVICES=0 .venv/bin/python -m vllm.entrypoints.openai.api_server \ # --model Qwen/Qwen3.5-27B-FP8 --port 8001 ... # 2. (Optional) for Minions: install the upstream library -.venv/bin/uv pip install -e /matx/u/aspark/external/minions +.venv/bin/uv pip install -e path/to/minions # 3. Run a smoke cell .venv/bin/python -m openjarvis.agents.hybrid.runner \ diff --git a/src/openjarvis/agents/hybrid/__init__.py b/src/openjarvis/agents/hybrid/__init__.py index 428c024f..a09f34b8 100644 --- a/src/openjarvis/agents/hybrid/__init__.py +++ b/src/openjarvis/agents/hybrid/__init__.py @@ -15,9 +15,9 @@ or the bench's native formatter) and hands it in via ``run(input=...)``. Task metadata that the paradigm needs (a problem statement vs. a question, hints, etc.) goes through ``context.metadata``. -The hybrid harness at ``/matx/u/aspark/hybrid-local-cloud-compute`` is the -reference implementation and stays untouched — these ports are the -OpenJarvis-native versions of the same paradigms. +The original ``hybrid-local-cloud-compute`` harness is the reference +implementation and stays untouched — these ports are the OpenJarvis-native +versions of the same paradigms. """ from __future__ import annotations diff --git a/src/openjarvis/agents/hybrid/archon.py b/src/openjarvis/agents/hybrid/archon.py index 8c50bb82..db493700 100644 --- a/src/openjarvis/agents/hybrid/archon.py +++ b/src/openjarvis/agents/hybrid/archon.py @@ -26,9 +26,9 @@ How the hybrid harness wires it (and what we mirror here): - ``ranker_model`` / ``fuser_model`` (default: ``cloud_model`` for both) - ``max_tokens`` (default 2048), ``temperature`` (default 0.7) -Requires the Archon library (cloned at -``hybrid-local-cloud-compute/external/Archon`` — add its ``src`` to -``PYTHONPATH`` or pip-install editable). Import is lazy. +Requires the Archon library from https://github.com/Stanford-ILIAD/Archon +— either pip-install editable or set ``ARCHON_SRC`` to the checkout's +``src/`` directory. Import is lazy. Ported from ``hybrid-local-cloud-compute/adapters/archon_adapter.py``. """ @@ -87,13 +87,11 @@ def _stub_archon_imports() -> None: def _add_archon_to_path() -> None: - """Locate Archon's ``src`` dir. The hybrid clone is the default location; - override with ``ARCHON_SRC`` env var if Archon is installed elsewhere.""" - archon_src = os.environ.get( - "ARCHON_SRC", - "/matx/u/aspark/hybrid-local-cloud-compute/external/Archon/src", - ) - if archon_src not in sys.path and os.path.isdir(archon_src): + """Locate Archon's ``src`` dir. Set ``ARCHON_SRC`` to point at your + Archon checkout (``/src``); otherwise we assume ``archon`` is on + ``sys.path`` already (e.g. ``pip install`` from a local clone).""" + archon_src = os.environ.get("ARCHON_SRC") + if archon_src and os.path.isdir(archon_src) and archon_src not in sys.path: sys.path.insert(0, archon_src) diff --git a/src/openjarvis/agents/hybrid/minions.py b/src/openjarvis/agents/hybrid/minions.py index 69217064..da5ab9b6 100644 --- a/src/openjarvis/agents/hybrid/minions.py +++ b/src/openjarvis/agents/hybrid/minions.py @@ -17,9 +17,9 @@ acc / $0.67 (vs $1.09). Requires the ``minions`` library from https://github.com/HazyResearch/minions installed in the same env (e.g. -``uv pip install -e /matx/u/aspark/hybrid-local-cloud-compute/external/minions``). -Import is lazy — the agent class registers without ``minions`` available, -and the import error only fires on ``run()``. +``uv pip install -e path/to/minions``). Import is lazy — the agent class +registers without ``minions`` available, and the import error only fires +on ``run()``. Compatibility patches applied at first ``run()`` (idempotent): diff --git a/src/openjarvis/agents/hybrid/registry/ablation_minions.toml b/src/openjarvis/agents/hybrid/registry/ablation_minions.toml index 46e342d4..5cfa5405 100644 --- a/src/openjarvis/agents/hybrid/registry/ablation_minions.toml +++ b/src/openjarvis/agents/hybrid/registry/ablation_minions.toml @@ -2,7 +2,7 @@ # Re-run the per-axis cloud winner on minions to check the ranking # isn't a skillorchestra-only artifact. Same subset, same n. # -# Local is fixed at Qwen-3.5-27B-FP8 (Andrew's lane). +# Local is fixed at Qwen-3.5-27B-FP8 (matches the n=100 sweep local lane). # NOTE: minions × Gemini is fully supported as of 2026-05-19 — the # vendored Minions library ships a GeminiClient that minion.py already # special-cases (Pydantic response_schema for the supervisor JSON diff --git a/src/openjarvis/agents/hybrid/runner.py b/src/openjarvis/agents/hybrid/runner.py index fa891071..e6f9c627 100644 --- a/src/openjarvis/agents/hybrid/runner.py +++ b/src/openjarvis/agents/hybrid/runner.py @@ -45,7 +45,7 @@ DEFAULT_REGISTRY_DIR = PACKAGE_DIR / "registry" DEFAULT_EXPERIMENTS_DIR = Path( os.environ.get( "OPENJARVIS_HYBRID_EXPERIMENTS_DIR", - "/matx/u/aspark/.openjarvis/experiments/hybrid", + Path.home() / ".openjarvis" / "experiments" / "hybrid", ) ) DEFAULT_SUBSETS_DIR = DEFAULT_EXPERIMENTS_DIR / "subsets" diff --git a/tests/agents/hybrid/test_swebench_dataset_variant.py b/tests/agents/hybrid/test_swebench_dataset_variant.py index 8e53a7da..ea3197ac 100644 --- a/tests/agents/hybrid/test_swebench_dataset_variant.py +++ b/tests/agents/hybrid/test_swebench_dataset_variant.py @@ -14,14 +14,17 @@ warm on the mkt cluster. from __future__ import annotations import json +import os from pathlib import Path -from openjarvis.agents.hybrid.runner import _load_swebench_tasks +from openjarvis.agents.hybrid.runner import DEFAULT_SUBSETS_DIR, _load_swebench_tasks SUBSET_PATH = Path( - "/matx/u/aspark/.openjarvis/experiments/hybrid/subsets/" - "swebench_verified_n100_seed42.json" + os.environ.get( + "HYBRID_SWEBENCH_N100_SUBSET", + DEFAULT_SUBSETS_DIR / "swebench_verified_n100_seed42.json", + ) ) KNOWN_FULL_TASK_ID = "pytest-dev__pytest-10081"