"""Archive primary sources and pinned code for the PhaseLatch design study. Only public text/code is fetched; no simulator or model is installed. Existing repository pins are reused unless --refresh-pins is passed. """ import argparse import concurrent.futures import hashlib import json import re import subprocess import time import urllib.request from datetime import datetime, timezone from html.parser import HTMLParser from pathlib import Path ROOT = Path(__file__).resolve().parents[1] SOURCES = { "embodiedswe_site": "https://embodiedswe.github.io/", "embodiedswe_paper": "https://arxiv.org/html/2609.27308v1", "oopsie_paper": "https://arxiv.org/html/2606.31993v1", "oopsie_site": "https://robin-lab.cs.utexas.edu/oopsieverse/", "reflex_paper": "https://arxiv.org/html/2608.14379v1", "hazard_paper": "https://arxiv.org/html/2401.12975v1", "dojo_paper": "https://arxiv.org/html/2607.04434v1", "pro_paper": "https://arxiv.org/html/2510.03827v1", "twin_paper": "https://arxiv.org/html/2506.18088v2", "safelab_site": "https://yingwen.io/en/publications/safelab-an-interactive-high-fidelity-benchmark-for-embodied-safety-in-scientific-robotics/", "safelab_proceedings": "https://proceedings.mlr.press/v306/bai26e.html", "safelab_pdf": "https://raw.githubusercontent.com/mlresearch/v306/main/assets/bai26e/bai26e.pdf", "safevla_paper": "https://arxiv.org/html/2606.00773v1", "dynamicvla_paper": "https://arxiv.org/html/2601.22153v1", "latent_safety_site": "https://kensukenk.github.io/latent-safety/", "mujoco_equality": "https://mujoco.readthedocs.io/en/stable/XMLreference.html", "mujoco_computation": "https://mujoco.readthedocs.io/en/stable/computation/index.html", "mujoco_modeling": "https://mujoco.readthedocs.io/en/stable/modeling.html", "physx_joints": "https://nvidia-omniverse.github.io/PhysX/physx/5.4.1/docs/Joints.html", "newton_docs": "https://newton-physics.github.io/newton/", "domino_paper": "https://arxiv.org/html/2603.15620v1", "dlo_paper": "https://arxiv.org/html/2606.04206v1", "plasticine_site": "https://plasticinelab.csail.mit.edu/", "disect_site": "https://diff-cutting-sim.github.io/", "empm_site": "https://embodied-mpm.github.io/", "redman_paper": "https://link.springer.com/article/10.1007/s10994-025-06825-x", "reflex_site": "https://reflexvla.github.io/", "fluidlab_site": "https://fluidlab2023.github.io/", } REPOS = { "swe": "EmbodiedSWE/EmbodiedSWE", "dojo": "RoboDojo-Benchmark/RoboDojo", "twin": "RoboTwin-Platform/RoboTwin", "pro": "Zxy-MLlab/LIBERO-PRO", "safelab": "ChangWinde/SafeLab", "reflex": "LxRoboticsLab/ReflexBench", "oopsie": "UT-Austin-RobIn/oopsieverse", } CODE_TERMS = { "dojo": ["base_env.py", "eval_env.py", "main.py", "insert", "button", "toolbox", "hammer", "handover"], "twin": ["_base_task.py", "click_bell.py", "move_stapler_pad.py", "handover", "open", "put_bottles", "insert", "place_cans"], "pro": ["env_wrapper.py", "libero_suite_task_map.py", "run_libero_eval.py", "perturb"], "swe": ["cut", "fracture", "scene", "controller", "task", "grader"], "safelab": ["safety", "constraint", "damage"], "reflex": ["eval", "latency", "conveyor"], "oopsie": ["damage", "health", "mechanical"], } FALLBACK_PATHS = { "swe": ["README.md", "LICENSE", "robobench/README.md", "robobench/core/env.py", "robobench/controllers/task_space.py", "robobench/suites/cutting/scenes/slice_food.py", "robobench/suites/cutting/scenes/dice_food.py", "robobench/suites/cutting/grader/slice_food.py", "robobench/suites/puzzle/scenes/coffee_service.py", "vla/eval/sim.py"], "dojo": ["README.md", "LICENSE", "env/environment/base_env.py", "src/eval_client/eval_env.py", "src/eval_client/main.py", "task/RoboDojo/tasks/insert_tubes.py", "task/RoboDojo/tasks/insert_key.py", "task/RoboDojo/tasks/fasten_screws.py", "task/RoboDojo/tasks/press_by_number.py", "task/RoboDojo/tasks/match_and_pick_from_conveyor.py", "task/RoboDojo/tasks/store_tools_in_toolbox.py"], "twin": ["README.md", "LICENSE", "envs/_base_task.py", "envs/move_stapler_pad.py", "envs/click_bell.py", "envs/handover_block.py", "envs/put_bottles_dustbin.py"], "pro": ["README.md", "LICENSE", "libero/libero/envs/env_wrapper.py", "libero/libero/benchmark/libero_suite_task_map.py"], "safelab": ["README.md", "index.html"], "reflex": ["README.md", "LICENSE", "scripts/evaluation/eval.py", "scripts/evaluation/POLICY_SERVER.md"], "oopsie": ["README.md"], } def get(url): req = urllib.request.Request(url, headers={"User-Agent": "PhaseLatch-research/0.1"}) for attempt in range(3): try: with urllib.request.urlopen(req, timeout=35) as response: return response.read(), response.url except Exception as exc: if getattr(exc, "code", None) in (403, 404) or attempt == 2: raise time.sleep(0.4) class Plain(HTMLParser): def __init__(self): super().__init__() self.skip = 0 self.parts = [] def handle_starttag(self, tag, attrs): if tag in ("script", "style"): self.skip += 1 if tag in ("p", "div", "li", "h1", "h2", "h3", "tr", "section"): self.parts.append("\n") def handle_endtag(self, tag): if tag in ("script", "style"): self.skip = max(0, self.skip - 1) def handle_data(self, data): if not self.skip: self.parts.append(data) def fetch(item): key, url = item try: body, final = get(url) suffix = ".pdf" if body.startswith(b"%PDF") else ".py" if url.endswith(".py") else ".txt" path = ROOT / "research" / "snapshots" / (key + suffix) path.write_bytes(body) decoded = body.decode("utf-8", errors="replace") if suffix != ".pdf" else "" if "