Skip to content

Add safety-gated ReBot policy rollout harness - #7

Merged
toyeshhm merged 19 commits into
mainfrom
person-4
Jul 19, 2026
Merged

Add safety-gated ReBot policy rollout harness#7
toyeshhm merged 19 commits into
mainfrom
person-4

Conversation

@toyeshhm

Copy link
Copy Markdown
Collaborator

What changed

  • adds a checkpoint handoff contract for the exact 7D follower-space action and front/side camera order
  • adds fail-closed joint, freshness, step-size, workspace, calibration, serial, and hardware identity gates
  • adds dummy, offline, shadow, and explicitly armed low-speed live rollout paths
  • loads registered LeRobot policies with their saved preprocessor and postprocessor state
  • adds keyboard/signal stop handling with stop-before-send precedence and no automatic homing
  • adds human-confirmed 30-second/300-action episodes with one manually acknowledged retry
  • adds held-out placement reports and deterministic checkpoint comparison tied to authenticated checkpoint/log digests
  • adds the Person 4 operator runbook and documents current calibration and MolmoAct2 runtime blockers

Why

Person 4 needs a tested run-loop that can accept Person 3's checkpoint, evaluate it without hardware first, and only permit bounded physical actions after every safety and operator gate passes.

Validation

  • 187/187 rollout-focused tests pass on the bundled Python 3.11 runtime
  • compileall, launcher syntax/help, lazy-import checks, and git diff --check pass
  • final independent safety review approved
  • no physical robot motion was performed during automated validation

Known hardware/runtime blockers

  • local follower/leader calibration fingerprints must match the authenticated profile
  • tracked plane_to_arm workspace calibration is intentionally null, so hardware rollout fails closed
  • bundled LeRobot 0.4.4 lacks the newer MolmoAct2 runtime; MolmoAct2 Gate A-D remains blocked until a compatible combined runtime or remote inference transport exists

Copilot AI review requested due to automatic review settings July 19, 2026 05:34
@toyeshhm
toyeshhm merged commit b76b215 into main Jul 19, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces a safety-gated rollout harness for ReBot policies, centering around a strict checkpoint handoff contract, fail-closed safety/workspace validation, and operator-controlled live episodes, with offline evaluation and deterministic reporting to support Person 4鈥檚 rollout workflow.

Changes:

  • Adds rebot_operator_kit.rollout contract types plus checkpoint/profile validation and a seven-joint SafetyGovernor.
  • Adds the Person 4 rollout harness in p3_vlm_orchestrator.policy_rollout (runner, LeRobot checkpoint adapter, workspace guard, keyboard/signal stop, offline evaluator, held-out reporting).
  • Adds extensive unit tests plus an operator runbook and a convenience launcher script.

Reviewed changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
rebot_operator_kit/tests/test_rollout_safety.py Unit tests for action freshness/limits/step-cap behavior and governor fault latching.
rebot_operator_kit/tests/test_rollout_contract.py Tests for observation immutability and checkpoint bundle validation contract.
rebot_operator_kit/rollout/safety.py Fail-closed seven-joint action validation with shadow clamp vs live reject behavior.
rebot_operator_kit/rollout/contracts.py Shared immutable observation and adapter Protocol boundaries.
rebot_operator_kit/rollout/checkpoint.py Dependency-free checkpoint/profile sidecar validation and contract extraction.
rebot_operator_kit/rollout/init.py Package docstring for rollout interfaces.
p3_vlm_orchestrator/tests/test_workspace_guard.py Tests for calibrated polygon + Z-prism workspace validation and SDK FK laziness.
p3_vlm_orchestrator/tests/test_rebot_policy_robot.py Tests for authenticated hardware binding, calibration/driver fingerprinting, and safe send/observe behavior.
p3_vlm_orchestrator/tests/test_policy_rollout_runner.py End-to-end tests for runner sequencing, durability/audit, stop handling, and fail-closed faulting.
p3_vlm_orchestrator/tests/test_policy_evaluation.py Tests for held-out manifest/audit validation, deterministic reporting, and comparison ranking.
p3_vlm_orchestrator/tests/test_lerobot_policy.py Tests for LeRobot checkpoint loading, processor restoration, prediction validation, and lazy import boundaries.
p3_vlm_orchestrator/tests/test_keyboard_stop.py Tests for keyboard/signal stop handling and idempotent cleanup.
p3_vlm_orchestrator/tests/test_episode_control.py Tests for bounded operator-confirmed episodes (30s/300 action caps, retry semantics, stop precedence).
p3_vlm_orchestrator/tests/init.py Package docstring for Person 4 rollout tests.
p3_vlm_orchestrator/policy_rollout/workspace_guard.py Workspace guard loading/authentication and FK-based prism validation.
p3_vlm_orchestrator/policy_rollout/runner.py Core rollout loop with audit logging, safety checks, optional workspace guard, and episode controls.
p3_vlm_orchestrator/policy_rollout/offline.py Offline evaluation over finalized datasets with strict sample validation.
p3_vlm_orchestrator/policy_rollout/lerobot_policy.py Lazy LeRobot adapter loading saved processors + strict postprocessing validation.
p3_vlm_orchestrator/policy_rollout/keyboard_stop.py Terminal-reader + SIGINT/SIGTERM stop source with verdict publishing.
p3_vlm_orchestrator/policy_rollout/evaluation.py Held-out manifest + JSONL audit validation, report writing, and checkpoint comparison.
p3_vlm_orchestrator/policy_rollout/dummy_policy.py Deterministic dummy policies for exercising the runner.
p3_vlm_orchestrator/policy_rollout/init.py Public exports for the rollout harness.
p3_vlm_orchestrator/PERSON4_RUNBOOK.md Operator runbook describing gates, episode workflow, and reporting rules.
p3_vlm_orchestrator/08_policy_rollout.command Launcher wiring runtime roots/PYTHONPATH and running the CLI module.

馃挕 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +356 to +366
expected_keys = (
"observation.images.front",
"observation.images.side",
"observation.state",
"task",
)
if tuple(prepared) != expected_keys:
raise ValueError(
"LeRobot prepared observation keys must be exactly "
f"{expected_keys}; received {tuple(prepared)}"
)
Comment on lines +324 to +334
sdk_root = str(sdk_repo)
if sdk_root not in sys.path:
sys.path.insert(0, sdk_root)

def fk_deg_to_xyz_mm(action_deg: np.ndarray) -> np.ndarray:
# Pinocchio and the SDK remain lazy until a live validation is requested.
from reBotArm_control_py.kinematics import joint_to_pose

physical_six_rad = np.radians(np.asarray(action_deg[:6], dtype=float))
position_m, _ = joint_to_pose(physical_six_rad)
return np.asarray(position_m, dtype=float) * 1000.0
Comment on lines +31 to +49
with _PLUGIN_REGISTRATION_LOCK:
discover = importlib.metadata.distributions
policy_distributions = tuple(
distribution
for distribution in discover()
if isinstance(distribution.metadata.get("Name"), str)
and distribution.metadata["Name"].replace("-", "_").startswith(
"lerobot_policy_"
)
)

def discover_policies(*args: Any, **kwargs: Any) -> tuple[Any, ...]:
return policy_distributions

importlib.metadata.distributions = discover_policies
try:
registrar()
finally:
importlib.metadata.distributions = discover
Comment on lines +557 to +565
finally:
try:
self.robot.disconnect()
except Exception as exc:
cleanup_fault_reason = (
"disconnect failed: " + self._exception_text(exc)
)
terminal_reason = "fault"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants