robot-gate 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- robot_gate-0.2.0/.gitignore +55 -0
- robot_gate-0.2.0/PKG-INFO +195 -0
- robot_gate-0.2.0/README.md +149 -0
- robot_gate-0.2.0/ci/cloudflare-build.sh +79 -0
- robot_gate-0.2.0/ci/run_ci_gate.py +403 -0
- robot_gate-0.2.0/pyproject.toml +102 -0
- robot_gate-0.2.0/scripts/build_wheels.sh +162 -0
- robot_gate-0.2.0/scripts/capture_bob_ev03_live.py +973 -0
- robot_gate-0.2.0/scripts/launch_bob_console.py +316 -0
- robot_gate-0.2.0/scripts/run_microduck_live.py +739 -0
- robot_gate-0.2.0/scripts/run_set_live_bob.py +578 -0
- robot_gate-0.2.0/src/robot_gate/__init__.py +14 -0
- robot_gate-0.2.0/src/robot_gate/audit.py +128 -0
- robot_gate-0.2.0/src/robot_gate/bounded_bridge.py +719 -0
- robot_gate-0.2.0/src/robot_gate/cli.py +2267 -0
- robot_gate-0.2.0/src/robot_gate/compliance_pack.py +1528 -0
- robot_gate-0.2.0/src/robot_gate/device_discovery.py +412 -0
- robot_gate-0.2.0/src/robot_gate/fingerprint.py +64 -0
- robot_gate-0.2.0/src/robot_gate/gate.py +580 -0
- robot_gate-0.2.0/src/robot_gate/intent.py +560 -0
- robot_gate-0.2.0/src/robot_gate/manifest.py +535 -0
- robot_gate-0.2.0/src/robot_gate/mcp_server.py +931 -0
- robot_gate-0.2.0/src/robot_gate/mechanics.py +2018 -0
- robot_gate-0.2.0/src/robot_gate/microduck_mapper.py +2615 -0
- robot_gate-0.2.0/src/robot_gate/onboard.py +1881 -0
- robot_gate-0.2.0/src/robot_gate/ros2_adapter.py +3232 -0
- robot_gate-0.2.0/src/robot_gate/semantic_guard.py +523 -0
- robot_gate-0.2.0/src/robot_gate/server.py +5330 -0
- robot_gate-0.2.0/src/robot_gate/set_kit.py +1216 -0
- robot_gate-0.2.0/src/robot_gate/shop_swarm.py +1944 -0
- robot_gate-0.2.0/src/robot_gate/skillpacks.py +344 -0
- robot_gate-0.2.0/src/robot_gate/telemetry.py +333 -0
- robot_gate-0.2.0/src/robot_gate/trust.py +337 -0
- robot_gate-0.2.0/src/robot_gate/ui.py +2642 -0
- robot_gate-0.2.0/src/robot_gate/vault_client.py +669 -0
- robot_gate-0.2.0/src/robot_gate/world_model.py +658 -0
- robot_gate-0.2.0/systemd/robot-gate.service +16 -0
- robot_gate-0.2.0/tests/test_bob_live_controls.py +901 -0
- robot_gate-0.2.0/tests/test_bounded_embodiment_bridge.py +123 -0
- robot_gate-0.2.0/tests/test_cell_console.py +265 -0
- robot_gate-0.2.0/tests/test_cli_e2e.py +624 -0
- robot_gate-0.2.0/tests/test_compliance_and_ci.py +452 -0
- robot_gate-0.2.0/tests/test_device_discovery.py +73 -0
- robot_gate-0.2.0/tests/test_end_effector_hal.py +808 -0
- robot_gate-0.2.0/tests/test_gate_regression.py +104 -0
- robot_gate-0.2.0/tests/test_intent_and_mcp.py +215 -0
- robot_gate-0.2.0/tests/test_manifest_and_signing.py +93 -0
- robot_gate-0.2.0/tests/test_mcp_plugin_v05.py +370 -0
- robot_gate-0.2.0/tests/test_microduck_mapper.py +777 -0
- robot_gate-0.2.0/tests/test_mujoco_contact_gate.py +359 -0
- robot_gate-0.2.0/tests/test_onboard_cli.py +394 -0
- robot_gate-0.2.0/tests/test_p1_hardening.py +432 -0
- robot_gate-0.2.0/tests/test_ros2_adapter.py +876 -0
- robot_gate-0.2.0/tests/test_rust_kernel.py +216 -0
- robot_gate-0.2.0/tests/test_semantic_guard.py +139 -0
- robot_gate-0.2.0/tests/test_server_hard_latch.py +375 -0
- robot_gate-0.2.0/tests/test_set_kit.py +430 -0
- robot_gate-0.2.0/tests/test_shop_swarm.py +525 -0
- robot_gate-0.2.0/tests/test_skillpacks.py +48 -0
- robot_gate-0.2.0/tests/test_telemetry_and_mjcf.py +87 -0
- robot_gate-0.2.0/tests/test_trust_ladder.py +58 -0
- robot_gate-0.2.0/tests/test_vault_client.py +407 -0
- robot_gate-0.2.0/tests/test_world_model_fusion.py +208 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Graft Robotics — Root .gitignore (Strict Secret, Key, Runtime & Build Exclusions)
|
|
2
|
+
|
|
3
|
+
# Live Ed25519 signing keys & cryptographic secrets (NEVER commit)
|
|
4
|
+
.robot-gate/**/keys/*.pem
|
|
5
|
+
.robot-gate/**/keys/
|
|
6
|
+
*.pem
|
|
7
|
+
*.key
|
|
8
|
+
*_private.pem
|
|
9
|
+
*.p12
|
|
10
|
+
*.pfx
|
|
11
|
+
.env
|
|
12
|
+
.env.*
|
|
13
|
+
!.env.example
|
|
14
|
+
|
|
15
|
+
# Local Wrangler / Cloudflare Pages cache & state
|
|
16
|
+
.wrangler/
|
|
17
|
+
**/.wrangler/
|
|
18
|
+
|
|
19
|
+
# Runtime logs & crash artifacts
|
|
20
|
+
nohup.out
|
|
21
|
+
**/nohup.out
|
|
22
|
+
*.log
|
|
23
|
+
**/*.log
|
|
24
|
+
console.log
|
|
25
|
+
|
|
26
|
+
# Python virtualenvs, caches & bytecode
|
|
27
|
+
.venv/
|
|
28
|
+
**/.venv/
|
|
29
|
+
venv/
|
|
30
|
+
__pycache__/
|
|
31
|
+
**/__pycache__/
|
|
32
|
+
*.pyc
|
|
33
|
+
*.pyo
|
|
34
|
+
*.pyd
|
|
35
|
+
.pytest_cache/
|
|
36
|
+
**/.pytest_cache/
|
|
37
|
+
.ruff_cache/
|
|
38
|
+
**/.ruff_cache/
|
|
39
|
+
.mypy_cache/
|
|
40
|
+
**/.mypy_cache/
|
|
41
|
+
*.egg-info/
|
|
42
|
+
dist/
|
|
43
|
+
build/
|
|
44
|
+
|
|
45
|
+
# Rust / Cargo build outputs
|
|
46
|
+
target/
|
|
47
|
+
**/target/
|
|
48
|
+
|
|
49
|
+
# OS & editor clutter
|
|
50
|
+
.DS_Store
|
|
51
|
+
Thumbs.db
|
|
52
|
+
*.swp
|
|
53
|
+
*.swo
|
|
54
|
+
.vscode/
|
|
55
|
+
.idea/
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: robot-gate
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
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.
|
|
5
|
+
Project-URL: Homepage, https://graftrobotics.ai
|
|
6
|
+
Project-URL: Documentation, https://graftrobotics.ai/docs/
|
|
7
|
+
Project-URL: Repository, https://github.com/craigm26/graft-robotics
|
|
8
|
+
Project-URL: Issues, https://github.com/craigm26/graft-robotics/issues
|
|
9
|
+
Author-email: Craig Merry <craigm26@gmail.com>
|
|
10
|
+
License: Apache-2.0
|
|
11
|
+
Keywords: compliance,deployment-harness,iso-10218,mcp,mujoco,physical-ai,robot-md,robotics,ros2,safety-gate
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Intended Audience :: Manufacturing
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
17
|
+
Classifier: Operating System :: MacOS
|
|
18
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
24
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
25
|
+
Classifier: Topic :: System :: Hardware
|
|
26
|
+
Requires-Python: >=3.11
|
|
27
|
+
Requires-Dist: bounded-embodiment>=0.1.1
|
|
28
|
+
Requires-Dist: cryptography>=41
|
|
29
|
+
Requires-Dist: pyyaml>=6.0
|
|
30
|
+
Provides-Extra: dev
|
|
31
|
+
Requires-Dist: fastapi>=0.110; extra == 'dev'
|
|
32
|
+
Requires-Dist: httpx>=0.27; extra == 'dev'
|
|
33
|
+
Requires-Dist: pillow>=10.0; extra == 'dev'
|
|
34
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
35
|
+
Requires-Dist: uvicorn>=0.27; extra == 'dev'
|
|
36
|
+
Provides-Extra: gateway
|
|
37
|
+
Requires-Dist: robot-md-gateway>=0.5.0a9; extra == 'gateway'
|
|
38
|
+
Provides-Extra: server
|
|
39
|
+
Requires-Dist: fastapi>=0.110; extra == 'server'
|
|
40
|
+
Requires-Dist: pillow>=10.0; extra == 'server'
|
|
41
|
+
Requires-Dist: pydantic>=2.6; extra == 'server'
|
|
42
|
+
Requires-Dist: uvicorn>=0.27; extra == 'server'
|
|
43
|
+
Provides-Extra: sim
|
|
44
|
+
Requires-Dist: mujoco>=4.0; extra == 'sim'
|
|
45
|
+
Description-Content-Type: text/markdown
|
|
46
|
+
|
|
47
|
+
# `robot-gate` — Graft Robotics (`graftrobotics.ai`)
|
|
48
|
+
|
|
49
|
+
**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.**
|
|
50
|
+
|
|
51
|
+
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.
|
|
52
|
+
|
|
53
|
+
> **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.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## `<10s` Zero-ROS-Install Demo (`robot-gate demo --ros2`)
|
|
58
|
+
|
|
59
|
+
Run the full Wedge A-Upmarket end-to-end verification in one command—**zero ROS 2 or robot hardware required**:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
robot-gate demo --ros2
|
|
63
|
+
# Or structured JSON output for scripts / CI:
|
|
64
|
+
robot-gate demo --ros2 --json
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
In under 10 seconds, `robot-gate demo --ros2`:
|
|
68
|
+
1. Scaffolds a clean UR5e workspace and signs `ROBOT.md` v1.1 + `envelope.json` with Ed25519.
|
|
69
|
+
2. Passes the 4-stage deterministic `robot-gate check --sim-only` gate and latches `gate_receipt.json`.
|
|
70
|
+
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`.
|
|
71
|
+
4. Verifies the RFC 8785 / SHA-256 hash-chained `audit_log.jsonl`.
|
|
72
|
+
5. Generates and offline-verifies `graft-compliance-pack.zip` (ISO 10218:2025 & EU 2023/1230).
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Architecture Highlights
|
|
77
|
+
|
|
78
|
+
- **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.
|
|
79
|
+
- **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`.
|
|
80
|
+
- **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 retention.
|
|
81
|
+
- **Rust `graft-core 0.1.0` + `graft-watchdog`:** Microsecond-scale PyO3 Rust spatial kernel (`box_signed_distance`, `check_swept_path_fast`, and 3D 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.
|
|
82
|
+
- **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`.
|
|
83
|
+
- **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`.
|
|
84
|
+
- **Graft Cell Console (`robot-gate serve --dir ... --port 8788`):** 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.
|
|
85
|
+
- **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.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Quickstart (`uv` / `uvx` First)
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
# 1. Instant 10-second ROS 2 + compliance demo (zero ROS install needed):
|
|
93
|
+
uvx robot-gate demo --ros2
|
|
94
|
+
|
|
95
|
+
# 2. 3-click LLM-to-Robot starter kit (Claude, Antigravity, Codex, Gemini, MLX, Gemma 4):
|
|
96
|
+
uvx robot-gate connect --client claude --robot ur5e --env industrial --out ./my-cell
|
|
97
|
+
|
|
98
|
+
# 3. Install locally as a persistent CLI tool (or with Cell Console FastAPI server):
|
|
99
|
+
uv tool install "robot-gate[server]"
|
|
100
|
+
# Install companion RRF core CLI tools with executable shims:
|
|
101
|
+
uv tool install robot-md-gateway --with-executables-from robot-md
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Guided Cell Onboarding, ROS 2 Bridge & Compliance Pack
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
# Guided offline self-serve onboarding wizard (6 personas: cnc, lab, oem, benchtop, ehs, ros2)
|
|
108
|
+
robot-gate onboard --persona ros2 --quick --out ./my-cell --non-interactive
|
|
109
|
+
# Or add ROS 2 launch bundles to any persona with `--with-ros2`:
|
|
110
|
+
robot-gate onboard --persona cnc --with-ros2 --quick --out ./my-cnc-cell --non-interactive
|
|
111
|
+
|
|
112
|
+
# Run the 4-stage deterministic pre-flight gate and sign gate_receipt.json
|
|
113
|
+
robot-gate check --dir ./my-cell --sim-only
|
|
114
|
+
|
|
115
|
+
# Generate ROS 2 launch bundle or inspect shadow mode (L0_OBSERVE zero physical republish)
|
|
116
|
+
robot-gate ros2-bridge --dir ./my-cell --generate-bundle ./my-cell/ros2 --stack ur
|
|
117
|
+
robot-gate ros2-bridge --dir ./my-cell --mode shadow
|
|
118
|
+
|
|
119
|
+
# Generate & offline-verify ISO 10218:2025 & EU 2023/1230 compliance pack
|
|
120
|
+
robot-gate compliance-pack --dir ./my-cell --out ./my-cell/.robot-gate/compliance/graft-compliance-pack.zip
|
|
121
|
+
robot-gate compliance-pack --verify ./my-cell/.robot-gate/compliance/graft-compliance-pack.zip
|
|
122
|
+
|
|
123
|
+
# Opt-in Hosted Fleet Receipt Vault sync (zero network calls when GRAFT_VAULT_API_KEY is unset)
|
|
124
|
+
robot-gate vault push --dir ./my-cell
|
|
125
|
+
robot-gate vault status
|
|
126
|
+
|
|
127
|
+
# Verify audit ledger & explain failures
|
|
128
|
+
robot-gate verify-audit --dir ./my-cell
|
|
129
|
+
robot-gate why --dir ./my-cell
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Cloudflare-Native CI, Local Pre-Commit Hook & `systemd` (Zero GitHub Actions)
|
|
133
|
+
|
|
134
|
+
Graft Robotics enforces a **Zero GitHub Actions** policy. Run deterministic pre-flight verification locally, in Cloudflare Workers/Pages Builds, or via `systemd`:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
# Local / Cloudflare-native CI gate + compliance pack verification
|
|
138
|
+
WORKSPACE_DIR=./my-cell bash robot-gate/ci/cloudflare-build.sh
|
|
139
|
+
|
|
140
|
+
# Install local git pre-commit hook (runs `robot-gate check --sim-only`)
|
|
141
|
+
robot-gate install-hook --dir ./my-cell
|
|
142
|
+
|
|
143
|
+
# Generate a clean parameterized systemd unit file (zero hardcoded user paths)
|
|
144
|
+
robot-gate install-systemd --dir /opt/graft-cell --port 8785 --user robot --out /tmp/robot-gate.service
|
|
145
|
+
|
|
146
|
+
# Start the offline on-robot Graft Cell Console UI (boots safely in L0_OBSERVE)
|
|
147
|
+
robot-gate serve --dir ./my-cell --host 127.0.0.1 --port 8788
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Portable RoboCurve SET Verification (`robot-gate set`) & CapEx Planner (`robot-gate plan`)
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
# Safe L0_OBSERVE rehearsal for all 6 SET tasks on SO-ARM101 (zero physical motion)
|
|
154
|
+
robot-gate set --arm so_arm101_home --task all --json
|
|
155
|
+
|
|
156
|
+
# Evaluate a Haas VF-2 shop and recommend highest-ROI upgrades under $25,000
|
|
157
|
+
robot-gate plan --acquired haas_vf2 --budget 25000 --hourly-rate 110 --shifts 2.0 --recommend --json
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## MCP Integration (Built-in Harness + Full Graft Plugin `v0.5.0`)
|
|
163
|
+
|
|
164
|
+
- **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:
|
|
165
|
+
```bash
|
|
166
|
+
robot-gate mcp-config --dir ./my-cell
|
|
167
|
+
robot-gate mcp --dir ./my-cell
|
|
168
|
+
```
|
|
169
|
+
- **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.
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## Local & Docker Wheel Packaging (Zero GitHub Actions)
|
|
174
|
+
|
|
175
|
+
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:
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
./scripts/build_wheels.sh
|
|
179
|
+
# Print reproducible manylinux Docker build command:
|
|
180
|
+
./scripts/build_wheels.sh --docker-cmd
|
|
181
|
+
# Pure-Python robot-gate wheel/sdist only:
|
|
182
|
+
./scripts/build_wheels.sh --skip-rust
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## Verification & Test Suite (`216/216` Pytest + `13/13` Rust `graft-core` + `18/18` Cloudflare Edge = `247/247`)
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
PYTHONDONTWRITEBYTECODE=1 uv run --no-sync pytest -q
|
|
191
|
+
# Rust hot-path spatial kernel + monotonic watchdog unit tests (13/13):
|
|
192
|
+
cargo test --manifest-path ../graft-core/Cargo.toml
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
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.
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# `robot-gate` — Graft Robotics (`graftrobotics.ai`)
|
|
2
|
+
|
|
3
|
+
**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.**
|
|
4
|
+
|
|
5
|
+
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.
|
|
6
|
+
|
|
7
|
+
> **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.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## `<10s` Zero-ROS-Install Demo (`robot-gate demo --ros2`)
|
|
12
|
+
|
|
13
|
+
Run the full Wedge A-Upmarket end-to-end verification in one command—**zero ROS 2 or robot hardware required**:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
robot-gate demo --ros2
|
|
17
|
+
# Or structured JSON output for scripts / CI:
|
|
18
|
+
robot-gate demo --ros2 --json
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
In under 10 seconds, `robot-gate demo --ros2`:
|
|
22
|
+
1. Scaffolds a clean UR5e workspace and signs `ROBOT.md` v1.1 + `envelope.json` with Ed25519.
|
|
23
|
+
2. Passes the 4-stage deterministic `robot-gate check --sim-only` gate and latches `gate_receipt.json`.
|
|
24
|
+
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`.
|
|
25
|
+
4. Verifies the RFC 8785 / SHA-256 hash-chained `audit_log.jsonl`.
|
|
26
|
+
5. Generates and offline-verifies `graft-compliance-pack.zip` (ISO 10218:2025 & EU 2023/1230).
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Architecture Highlights
|
|
31
|
+
|
|
32
|
+
- **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.
|
|
33
|
+
- **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`.
|
|
34
|
+
- **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 retention.
|
|
35
|
+
- **Rust `graft-core 0.1.0` + `graft-watchdog`:** Microsecond-scale PyO3 Rust spatial kernel (`box_signed_distance`, `check_swept_path_fast`, and 3D 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.
|
|
36
|
+
- **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`.
|
|
37
|
+
- **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`.
|
|
38
|
+
- **Graft Cell Console (`robot-gate serve --dir ... --port 8788`):** 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.
|
|
39
|
+
- **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.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Quickstart (`uv` / `uvx` First)
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# 1. Instant 10-second ROS 2 + compliance demo (zero ROS install needed):
|
|
47
|
+
uvx robot-gate demo --ros2
|
|
48
|
+
|
|
49
|
+
# 2. 3-click LLM-to-Robot starter kit (Claude, Antigravity, Codex, Gemini, MLX, Gemma 4):
|
|
50
|
+
uvx robot-gate connect --client claude --robot ur5e --env industrial --out ./my-cell
|
|
51
|
+
|
|
52
|
+
# 3. Install locally as a persistent CLI tool (or with Cell Console FastAPI server):
|
|
53
|
+
uv tool install "robot-gate[server]"
|
|
54
|
+
# Install companion RRF core CLI tools with executable shims:
|
|
55
|
+
uv tool install robot-md-gateway --with-executables-from robot-md
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Guided Cell Onboarding, ROS 2 Bridge & Compliance Pack
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
# Guided offline self-serve onboarding wizard (6 personas: cnc, lab, oem, benchtop, ehs, ros2)
|
|
62
|
+
robot-gate onboard --persona ros2 --quick --out ./my-cell --non-interactive
|
|
63
|
+
# Or add ROS 2 launch bundles to any persona with `--with-ros2`:
|
|
64
|
+
robot-gate onboard --persona cnc --with-ros2 --quick --out ./my-cnc-cell --non-interactive
|
|
65
|
+
|
|
66
|
+
# Run the 4-stage deterministic pre-flight gate and sign gate_receipt.json
|
|
67
|
+
robot-gate check --dir ./my-cell --sim-only
|
|
68
|
+
|
|
69
|
+
# Generate ROS 2 launch bundle or inspect shadow mode (L0_OBSERVE zero physical republish)
|
|
70
|
+
robot-gate ros2-bridge --dir ./my-cell --generate-bundle ./my-cell/ros2 --stack ur
|
|
71
|
+
robot-gate ros2-bridge --dir ./my-cell --mode shadow
|
|
72
|
+
|
|
73
|
+
# Generate & offline-verify ISO 10218:2025 & EU 2023/1230 compliance pack
|
|
74
|
+
robot-gate compliance-pack --dir ./my-cell --out ./my-cell/.robot-gate/compliance/graft-compliance-pack.zip
|
|
75
|
+
robot-gate compliance-pack --verify ./my-cell/.robot-gate/compliance/graft-compliance-pack.zip
|
|
76
|
+
|
|
77
|
+
# Opt-in Hosted Fleet Receipt Vault sync (zero network calls when GRAFT_VAULT_API_KEY is unset)
|
|
78
|
+
robot-gate vault push --dir ./my-cell
|
|
79
|
+
robot-gate vault status
|
|
80
|
+
|
|
81
|
+
# Verify audit ledger & explain failures
|
|
82
|
+
robot-gate verify-audit --dir ./my-cell
|
|
83
|
+
robot-gate why --dir ./my-cell
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Cloudflare-Native CI, Local Pre-Commit Hook & `systemd` (Zero GitHub Actions)
|
|
87
|
+
|
|
88
|
+
Graft Robotics enforces a **Zero GitHub Actions** policy. Run deterministic pre-flight verification locally, in Cloudflare Workers/Pages Builds, or via `systemd`:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
# Local / Cloudflare-native CI gate + compliance pack verification
|
|
92
|
+
WORKSPACE_DIR=./my-cell bash robot-gate/ci/cloudflare-build.sh
|
|
93
|
+
|
|
94
|
+
# Install local git pre-commit hook (runs `robot-gate check --sim-only`)
|
|
95
|
+
robot-gate install-hook --dir ./my-cell
|
|
96
|
+
|
|
97
|
+
# Generate a clean parameterized systemd unit file (zero hardcoded user paths)
|
|
98
|
+
robot-gate install-systemd --dir /opt/graft-cell --port 8785 --user robot --out /tmp/robot-gate.service
|
|
99
|
+
|
|
100
|
+
# Start the offline on-robot Graft Cell Console UI (boots safely in L0_OBSERVE)
|
|
101
|
+
robot-gate serve --dir ./my-cell --host 127.0.0.1 --port 8788
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Portable RoboCurve SET Verification (`robot-gate set`) & CapEx Planner (`robot-gate plan`)
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
# Safe L0_OBSERVE rehearsal for all 6 SET tasks on SO-ARM101 (zero physical motion)
|
|
108
|
+
robot-gate set --arm so_arm101_home --task all --json
|
|
109
|
+
|
|
110
|
+
# Evaluate a Haas VF-2 shop and recommend highest-ROI upgrades under $25,000
|
|
111
|
+
robot-gate plan --acquired haas_vf2 --budget 25000 --hourly-rate 110 --shifts 2.0 --recommend --json
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## MCP Integration (Built-in Harness + Full Graft Plugin `v0.5.0`)
|
|
117
|
+
|
|
118
|
+
- **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:
|
|
119
|
+
```bash
|
|
120
|
+
robot-gate mcp-config --dir ./my-cell
|
|
121
|
+
robot-gate mcp --dir ./my-cell
|
|
122
|
+
```
|
|
123
|
+
- **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.
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Local & Docker Wheel Packaging (Zero GitHub Actions)
|
|
128
|
+
|
|
129
|
+
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:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
./scripts/build_wheels.sh
|
|
133
|
+
# Print reproducible manylinux Docker build command:
|
|
134
|
+
./scripts/build_wheels.sh --docker-cmd
|
|
135
|
+
# Pure-Python robot-gate wheel/sdist only:
|
|
136
|
+
./scripts/build_wheels.sh --skip-rust
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## Verification & Test Suite (`216/216` Pytest + `13/13` Rust `graft-core` + `18/18` Cloudflare Edge = `247/247`)
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
PYTHONDONTWRITEBYTECODE=1 uv run --no-sync pytest -q
|
|
145
|
+
# Rust hot-path spatial kernel + monotonic watchdog unit tests (13/13):
|
|
146
|
+
cargo test --manifest-path ../graft-core/Cargo.toml
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
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.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Graft Robotics — Cloudflare-Native CI Gate & Local Pre-Commit Runner
|
|
3
|
+
#
|
|
4
|
+
# Zero GitHub Actions policy: runs cleanly inside Cloudflare Workers/Pages Builds,
|
|
5
|
+
# local git pre-commit hooks (`robot-gate install-hook`), or offline `systemd`
|
|
6
|
+
# pre-flight jobs.
|
|
7
|
+
#
|
|
8
|
+
# Environment variables (all optional):
|
|
9
|
+
# WORKSPACE_DIR Path to robot-gate workspace (default: ".")
|
|
10
|
+
# COMPLIANCE_OUTPUT_DIR Output dir for compliance pack (default: ".robot-gate/compliance_pack")
|
|
11
|
+
# SUMMARY_OUT Path for Markdown CI summary (default: ".robot-gate/ci_summary.md")
|
|
12
|
+
# JSON_OUT Path for JSON CI report (default: ".robot-gate/ci_report.json")
|
|
13
|
+
# GENERATE_COMPLIANCE_PACK "true" or "false" (default: "true")
|
|
14
|
+
# VERIFY_COMPLIANCE_PACK "true" or "false" (default: "true")
|
|
15
|
+
# GRAFT_VAULT_API_KEY Optional Bearer token (grv_...) for Cloudflare D1 Fleet Vault;
|
|
16
|
+
# when set, automatically passes `--push-vault` to POST /api/vault/receipts.
|
|
17
|
+
# When unset, remains 100% offline with zero network calls.
|
|
18
|
+
# GRAFT_VAULT_URL Optional override for Fleet Vault endpoint.
|
|
19
|
+
|
|
20
|
+
set -euo pipefail
|
|
21
|
+
|
|
22
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
23
|
+
ROBOT_GATE_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
|
24
|
+
RUNNER="${SCRIPT_DIR}/run_ci_gate.py"
|
|
25
|
+
|
|
26
|
+
WORKSPACE_DIR="${WORKSPACE_DIR:-.}"
|
|
27
|
+
COMPLIANCE_OUTPUT_DIR="${COMPLIANCE_OUTPUT_DIR:-.robot-gate/compliance_pack}"
|
|
28
|
+
SUMMARY_OUT="${SUMMARY_OUT:-.robot-gate/ci_summary.md}"
|
|
29
|
+
JSON_OUT="${JSON_OUT:-.robot-gate/ci_report.json}"
|
|
30
|
+
GENERATE_COMPLIANCE_PACK="${GENERATE_COMPLIANCE_PACK:-true}"
|
|
31
|
+
VERIFY_COMPLIANCE_PACK="${VERIFY_COMPLIANCE_PACK:-true}"
|
|
32
|
+
|
|
33
|
+
is_truthy() {
|
|
34
|
+
case "${1,,}" in
|
|
35
|
+
1|true|yes|y|on) return 0 ;;
|
|
36
|
+
*) return 1 ;;
|
|
37
|
+
esac
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
CMD_ARGS=(
|
|
41
|
+
"--workspace-dir" "${WORKSPACE_DIR}"
|
|
42
|
+
"--compliance-output-dir" "${COMPLIANCE_OUTPUT_DIR}"
|
|
43
|
+
"--summary-out" "${SUMMARY_OUT}"
|
|
44
|
+
"--json-out" "${JSON_OUT}"
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
if is_truthy "${GENERATE_COMPLIANCE_PACK}"; then
|
|
48
|
+
CMD_ARGS+=("--generate-compliance-pack")
|
|
49
|
+
else
|
|
50
|
+
CMD_ARGS+=("--no-generate-compliance-pack")
|
|
51
|
+
fi
|
|
52
|
+
|
|
53
|
+
if is_truthy "${VERIFY_COMPLIANCE_PACK}"; then
|
|
54
|
+
CMD_ARGS+=("--verify-compliance-pack")
|
|
55
|
+
else
|
|
56
|
+
CMD_ARGS+=("--no-verify-compliance-pack")
|
|
57
|
+
fi
|
|
58
|
+
|
|
59
|
+
if [ -n "${GRAFT_VAULT_API_KEY:-}" ]; then
|
|
60
|
+
CMD_ARGS+=("--push-vault")
|
|
61
|
+
fi
|
|
62
|
+
|
|
63
|
+
if [ "$#" -gt 0 ]; then
|
|
64
|
+
CMD_ARGS+=("$@")
|
|
65
|
+
fi
|
|
66
|
+
|
|
67
|
+
export PYTHONDONTWRITEBYTECODE=1
|
|
68
|
+
|
|
69
|
+
if [ -n "${PYTHON_BIN:-}" ]; then
|
|
70
|
+
exec "${PYTHON_BIN}" "${RUNNER}" "${CMD_ARGS[@]}"
|
|
71
|
+
elif [ -x "${ROBOT_GATE_ROOT}/.venv/bin/python" ]; then
|
|
72
|
+
exec "${ROBOT_GATE_ROOT}/.venv/bin/python" "${RUNNER}" "${CMD_ARGS[@]}"
|
|
73
|
+
elif command -v uv >/dev/null 2>&1 && [ -f "${ROBOT_GATE_ROOT}/pyproject.toml" ]; then
|
|
74
|
+
exec uv run --project "${ROBOT_GATE_ROOT}" --no-sync python "${RUNNER}" "${CMD_ARGS[@]}"
|
|
75
|
+
elif command -v python3 >/dev/null 2>&1; then
|
|
76
|
+
exec python3 "${RUNNER}" "${CMD_ARGS[@]}"
|
|
77
|
+
else
|
|
78
|
+
exec python "${RUNNER}" "${CMD_ARGS[@]}"
|
|
79
|
+
fi
|