Metadata-Version: 2.5
Name: robot-gate
Version: 0.2.6
Summary: Deterministic on-robot deployment harness, ROS 2 pre-flight boundary interceptor, ISO 10218:2025 / EU 2023/1230 compliance pack generator, and change-triggered regression test gate.
Project-URL: Homepage, https://graftrobotics.ai
Project-URL: Documentation, https://graftrobotics.ai/docs/
Project-URL: Repository, https://github.com/craigm26/graft-robotics
Project-URL: Issues, https://github.com/craigm26/graft-robotics/issues
Author-email: Craig Merry <craigm26@gmail.com>
License: Apache-2.0
Keywords: compliance,deployment-harness,iso-10218,mcp,mujoco,physical-ai,robot-md,robotics,ros2,safety-gate
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Manufacturing
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: System :: Hardware
Requires-Python: >=3.11
Requires-Dist: bounded-embodiment>=0.1.1
Requires-Dist: cryptography>=41
Requires-Dist: pyyaml>=6.0
Provides-Extra: dev
Requires-Dist: fastapi>=0.110; extra == 'dev'
Requires-Dist: graft-core>=0.1.0; extra == 'dev'
Requires-Dist: httpx>=0.27; extra == 'dev'
Requires-Dist: pillow>=10.0; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: uvicorn>=0.27; extra == 'dev'
Provides-Extra: gateway
Requires-Dist: robot-md-gateway>=0.5.0a9; extra == 'gateway'
Provides-Extra: server
Requires-Dist: fastapi>=0.110; extra == 'server'
Requires-Dist: pillow>=10.0; extra == 'server'
Requires-Dist: pydantic>=2.6; extra == 'server'
Requires-Dist: uvicorn>=0.27; extra == 'server'
Provides-Extra: sim
Requires-Dist: mujoco>=4.0; extra == 'sim'
Description-Content-Type: text/markdown

# `robot-gate` — Graft Robotics (`graftrobotics.ai`)

**Deterministic on-robot deployment harness, ROS 2 pre-flight boundary interceptor, Rust safety kernel, 6-family Hand HAL, ISO 10218:2025 & EU 2023/1230 compliance pack generator, and offline Graft Cell Console.**

Every time anything on a robot changes—`ROBOT.md` bounds, a skill/policy, an end-effector swap, or an arm transplanted onto a new desk or CNC cell—`robot-gate` runs a fast, offline 4-stage verification gate and emits a cryptographically signed `gate_receipt.json`. The on-robot runtime (`robot-gate serve`) and ROS 2 interceptor (`robot-gate ros2-bridge`) enforce a **hard receipt latch**: if a single byte changes or calibration drifts, the robot **refuses to arm or republish commands** until `robot-gate check` passes again.

> **Strict ISO 13850 Hardware E-Stop Boundary:** `robot-gate`, `graft-core`, `graft-watchdog`, and `robot-md-gateway` provide a deterministic, default-deny software enforcement gateway, pre-flight regression gate, and offline-verifiable RFC 8785 SHA-256 audit layer. They claim **zero PL/SIL risk-reduction credit**, are **NOT** a safety-rated emergency stop (ISO 13850), and **never** replace certified hardwired power cutoffs, ISO 13849-1 safety relays, light curtains, or physical spindle zero-speed interlocks.

---

## `<10s` Zero-ROS-Install Demo (`robot-gate demo --ros2`)

Run the full ROS 2 & compliance pre-flight verification in one command—**zero ROS 2 or robot hardware required**:

```bash
robot-gate demo --ros2
# Or structured JSON output for scripts / CI:
robot-gate demo --ros2 --json
```

In under 10 seconds, `robot-gate demo --ros2`:
1. Scaffolds a clean UR5e workspace and signs `ROBOT.md` v1.1 + `envelope.json` with Ed25519.
2. Passes the 4-stage deterministic `robot-gate check --sim-only` gate and latches `gate_receipt.json`.
3. Feeds a 5-command ROS 2 mock stream (`L0_OBSERVE` shadow block, nominal `PoseStamped`, spindle keep-out violation, `NaN` coordinate injection, and overspeed `Twist`) through `ROS2BoundaryGate`.
4. Verifies the RFC 8785 / SHA-256 hash-chained `audit_log.jsonl`.
5. Generates and offline-verifies `graft-compliance-pack.zip` (ISO 10218:2025 & EU 2023/1230).

---

## Architecture Highlights

- **ROS 2 Pre-Flight Boundary Interceptor (`robot-gate ros2-bridge`):** Drops cleanly between AI/VLA planners (MoveIt 2, OpenVLA, Isaac ROS, custom policies) and `ros2_control` / UR RTDE / Fairino FR5 / xArm6 without replacing ROS 2. Enforces signed `ROBOT.md` + Hard Receipt Latch + Trust Ladder speed clamping (`L0_OBSERVE` = 0% shadow deny, `L1` = 30%, `L2` = 60%, `L3` = 100%) and generates drop-in `graft_ros2_gate.launch.py` & `graft_ros2_params.yaml` bundles.
- **1-Click ISO 10218:2025 & EU 2023/1230 Compliance Pack (`robot-gate compliance-pack`):** Produces a tamper-evident `graft-compliance-pack.zip` (`compliance_manifest.json` + Warm Workshop printable `compliance_dossier.html` + SHA-256 SBOM, strictly excluding all private keys) with fail-closed offline `--verify`.
- **Opt-In Hosted Fleet Receipt Vault (`robot-gate vault push` / `status`):** Zero phone-home when `GRAFT_VAULT_API_KEY` is unset (100% air-gap / ITAR-EAR safe). When opted in, pushes signed receipt hashes, verdicts, and drift telemetry to the Cloudflare D1 Fleet Vault (`POST /api/vault/receipts`) with 5-year active retention (+ 10-year offline-verifiable compliance archive export for EU 2023/1230 Annex IV).
- **Rust `graft-core 0.1.0` + `graft-watchdog`:** Microsecond-scale PyO3 Rust spatial kernel (`box_signed_distance`, `check_swept_path_fast` at `1.96 µs/check`, and `316 Hz` / `3.16 ms p50` LAN 3D LiDAR point-cloud voxel-to-OBJ meshing with pure-Python fallback) paired with `bounded-embodiment` RFC 8785 JCS SHA-256 canonical hashing / Ed25519 Envelope 0.2 signing and an independent OS-level `graft-watchdog` heartbeat supervisor (`0.22 ms p50` `/stop`).
- **6-Family Hand HAL (`mechanics.py`):** Deterministic grasp physics and interlock enforcement across `parallel_2f`, `concentric_3f`, `dexterous_5f`, `vacuum_suction`, `magnetic_atc`, and `bimanual_coordinated`.
- **Semantic-to-Deterministic Ratchet (`semantic_guard.py`):** Monotonic 4-tier trust ladder (`L0_OBSERVE` → `L1_ATOMIC_ASSIST` → `L2_SUPERVISED_CHAIN` → `L3_AUTONOMOUS_FROZEN`) freezing 100%-verified skills into zero-LLM-jitter `skills/<name>.yaml`.
- **Graft Cell Console (`robot-gate serve --dir ... --port 8785`):** Local-first, zero-cloud FastAPI harness + operator UI with hard receipt latch, live actuator telemetry, trust-ladder controls, software hold/release, and EV-03 offline JSON audit export.
- **Guided Onboarding (`6 personas`), Portable SET Kit & Shop CapEx Planner:** `robot-gate onboard` (`cnc`, `lab`, `oem`, `benchtop`, `ehs`, `ros2`), `robot-gate set` RoboCurve Six Easy Tasks rehearsal, and `robot-gate plan` 20-asset Shop Swarm ROI optimizer.

---

## Quickstart (`uv` / `uvx` First)

```bash
# 1. Instant 10-second ROS 2 + compliance demo (zero ROS install needed):
uvx robot-gate demo --ros2

# 2. 3-click LLM-to-Robot starter kit (Claude, Antigravity, Codex, Gemini, MLX, Gemma 4):
uvx robot-gate connect --client claude --robot ur5e --env industrial --out ./my-cell

# 3. Install locally as a persistent CLI tool (or with Cell Console FastAPI server):
uv tool install --upgrade "robot-gate[server]"
# Install companion RRF core CLI tools with executable shims:
uv tool install robot-md-gateway --with-executables-from robot-md
```

### Guided Cell Onboarding, ROS 2 Bridge & Compliance Pack

```bash
# Guided offline self-serve onboarding wizard (6 personas: cnc, lab, oem, benchtop, ehs, ros2)
robot-gate onboard --persona ros2 --quick --out ./my-cell --non-interactive
# Or add ROS 2 launch bundles to any persona with `--with-ros2`:
robot-gate onboard --persona cnc --with-ros2 --quick --out ./my-cnc-cell --non-interactive

# Run the 4-stage deterministic pre-flight gate and sign gate_receipt.json
robot-gate check --dir ./my-cell --sim-only

# Generate ROS 2 launch bundle or inspect shadow mode (L0_OBSERVE zero physical republish)
robot-gate ros2-bridge --dir ./my-cell --generate-bundle ./my-cell/ros2 --stack ur
robot-gate ros2-bridge --dir ./my-cell --mode shadow

# Generate & offline-verify ISO 10218:2025 & EU 2023/1230 compliance pack
robot-gate compliance-pack --dir ./my-cell --out ./my-cell/.robot-gate/compliance/graft-compliance-pack.zip
robot-gate compliance-pack --verify ./my-cell/.robot-gate/compliance/graft-compliance-pack.zip

# Opt-in Hosted Fleet Receipt Vault sync (zero network calls when GRAFT_VAULT_API_KEY is unset)
robot-gate vault push --dir ./my-cell
robot-gate vault status

# Verify audit ledger & explain failures
robot-gate verify-audit --dir ./my-cell
robot-gate why --dir ./my-cell
```

### Cell passports, the public log, the known-failure list and shared zones (0.2.4 and 0.2.5)

A cell passport (`GRAFT_CELL_PASSPORT.json`) is one signed file per robot cell: who commissioned it,
which limits file it runs, and the hash of the passport it replaces. `robot-gate compliance-pack`
writes one into each evidence pack. Anyone you send it to can check it, offline, with no account:

```bash
# Check a passport someone sent you (get the signer's public key from them separately)
uvx robot-gate passport verify GRAFT_CELL_PASSPORT.json --key signer.pub.pem

# Or in a browser, nothing uploaded: https://graftrobotics.ai/verify/

# Add a passport you made to the public log (keeps only its hash, key id, revision links and time)
uvx robot-gate passport log GRAFT_CELL_PASSPORT.json --key signer.pub.pem

# Check a passport and see when it was first logged
uvx robot-gate passport verify GRAFT_CELL_PASSPORT.json --key signer.pub.pem --check-log

# Compare your cell with the list of failure modes we have reproduced (offline)
uvx robot-gate registry check --dir . --fail-on-critical

# Strip names, addresses and coordinates locally, then decide whether to send it to us
uvx robot-gate registry export-anon --deny-code NON_FINITE_COMMAND --embodiment so_arm101 --out draft.json
```

`robot-gate interop` adds signed, short-lived zone leases so robots from different makers can share
a work zone; a lease that runs out puts the zone back to keep-out. None of this is a safety function:
the software is not an emergency stop and carries no PL or SIL rating.

### Cloudflare-Native CI, Local Pre-Commit Hook & `systemd` (Zero GitHub Actions)

Graft Robotics enforces a **Zero GitHub Actions** policy. Run deterministic pre-flight verification locally, in Cloudflare Workers/Pages Builds, or via `systemd`:

```bash
# Local / Cloudflare-native CI gate + compliance pack verification
WORKSPACE_DIR=./my-cell bash robot-gate/ci/cloudflare-build.sh

# Install local git pre-commit hook (runs `robot-gate check --sim-only`)
robot-gate install-hook --dir ./my-cell

# Generate a clean parameterized systemd unit file (zero hardcoded user paths)
robot-gate install-systemd --dir /opt/graft-cell --port 8785 --user robot --out /tmp/robot-gate.service

# Start the offline on-robot Graft Cell Console UI (boots safely in L0_OBSERVE)
robot-gate serve --dir ./my-cell --host 127.0.0.1 --port 8785
```

### Portable RoboCurve SET Verification (`robot-gate set`) & CapEx Planner (`robot-gate plan`)

```bash
# Safe L0_OBSERVE rehearsal for all 6 SET tasks on SO-ARM101 (zero physical motion)
robot-gate set --arm so_arm101_home --task all --json

# Evaluate a Haas VF-2 shop and recommend highest-ROI upgrades under $25,000
robot-gate plan --acquired haas_vf2 --budget 25000 --hourly-rate 110 --shifts 2.0 --recommend --json
```

---

## MCP Integration (Built-in Harness + Full Graft Plugin `v0.5.0`)

- **Built-in zero-dependency stdio server (`robot-gate mcp`):** Exposes **11** local harness JSON-RPC 2.0 tools directly against any `ROBOT.md` cell (`robot_get_status`, `robot_run_gate_check`, `robot_dry_run_plan`, `robot_execute_plan`, `robot_freeze_skill`, `robot_estop`, `robot_verify_audit`, `compliance_pack`, `ros2_generate_bundle`, `vault_status`, `connect_agent`). Print a drop-in MCP config snippet with:
  ```bash
  robot-gate mcp-config --dir ./my-cell
  robot-gate mcp --dir ./my-cell
  ```
- **Full `graft-robotics` Plugin (`v0.5.0`, Antigravity / Claude Code / Codex / Gemini CLI / Apple MLX / Gemma 4):** Exposes **19 tools**, **7 operational playbooks** (including `/ros2-compliance-audit`), **5 resources**, and **4 fail-closed form elicitations** covering ROS 2 boundary verification, ISO 10218:2025 / EU 2023/1230 compliance packs, the 6-family Hand HAL, Semantic-to-Deterministic Ratchet, opt-in Cloudflare D1 Fleet Vault status, and 3-click `/connect/` agent kits.

---

## Local & Docker Wheel Packaging (Zero GitHub Actions)

Build release wheels for both `graft-core` (Rust PyO3 via `maturin build --release`) and `robot-gate` (`uv build`) locally or inside a reproducible `manylinux` container:

```bash
./scripts/build_wheels.sh
# Print reproducible manylinux Docker build command:
./scripts/build_wheels.sh --docker-cmd
# Pure-Python robot-gate wheel/sdist only:
./scripts/build_wheels.sh --skip-rust
```

---

## Verification & Test Suite (`216/216` Pytest + `13/13` Rust `graft-core` + `18/18` Cloudflare Edge = `247/247`)

```bash
PYTHONDONTWRITEBYTECODE=1 uv run --no-sync pytest -q
# Rust hot-path spatial kernel + monotonic watchdog unit tests (13/13):
cargo test --manifest-path ../graft-core/Cargo.toml
```

Covers Ed25519 manifest provenance, Rust `graft-core 0.1.0` swept-path & voxel meshing + `bounded-embodiment` RFC 8785 JCS hashing, ROS 2 `ROS2BoundaryGate` / `ROS2GateNode` interception & launch bundles, ISO 10218:2025 & EU 2023/1230 compliance pack generation & fail-closed offline verification, opt-in Hosted Fleet Receipt Vault sync, 6-family Hand HAL physics & ATC spindle interlocks, Semantic-to-Deterministic Ratchet monotonicity, hard receipt latch enforcement, Cell Console APIs, `robot-gate demo --ros2`, `robot-gate onboard`, `robot-gate install-systemd`, `robot-gate set`, `robot-gate plan`, and end-to-end CLI workflows.
