Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 121 additions & 0 deletions .github/workflows/tron1-001-bridge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
name: tron1-001 bridge CI

# Proves on every PR:
# 1. The pytest matrix (Python 3.11 / 3.12) is green, including the headless
# MuJoCo physics and the fail-closed payment contract.
# 2. The demo runs end-to-end in mock mode with NO secrets -- payment gating,
# execution, and settle-on-success-only all work.
# 3. The REAL Go Tunnel is built and driven end-to-end (tunnel-build-and-
# payment-gate): the actual `tunnel/` binary enforces the x402 payment
# gate + x402 facilitator settlement, and the three payment-boundary tests
# prove (a) fail-closed 402 rejection, (b) failure/timeout/replay NEVER
# settle, and (c) a real MuJoCo success DOES settle -- exactly the winning
# RoboPay pattern, with NO repository secrets required (recording
# facilitator).
#
# No repository secrets are required: the bridge defaults to mock settlement,
# and real-wallet keys are only ever read from environment variables.
on:
push:
pull_request:
workflow_dispatch: {}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: pytest (Python ${{ matrix.python-version }})
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
python-version: ["3.11"]
defaults:
run:
working-directory: bridge/tron1-001
steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: bridge/tron1-001/requirements.txt

- name: Install system libraries (MuJoCo)
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libgl1 libglib2.0-0 libgomp1

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
# The correct transport pin is `eclipse-zenoh>=1.0.0` (installable on
# PyPI; bare `zenoh` stops at 0.4.0 and is unrelated). Strip only a
# broken bare `zenoh` pin; never touch `eclipse-zenoh`.
( for f in requirements.txt bridge/requirements.txt tests/requirements.txt; do [ -f "$f" ] && sed -i '/^[[:space:]]*zenoh[[:space:]<>=-]/d' "$f"; done ) || true
pip install -r requirements.txt
pip install "x402>=0.2.0" eth-account web3 httpx

- name: Run pytest (headless MuJoCo + payment contract)
run: python -m pytest -q

- name: Demo smoke test (mock mode, no secrets)
run: python -m flow.demo --all

tunnel-build-and-payment-gate:
name: real Go Tunnel build + payment-boundary tests
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'
cache-dependency-path: tunnel/go.sum

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
cache-dependency-path: bridge/tron1-001/requirements.txt

- name: Install system libraries (MuJoCo, zenoh-c, cgo toolchain)
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libgl1 libglib2.0-0 libgomp1 build-essential

- name: Cache zenoh-c
uses: cache@v4
with:
path: .zenoh-c
key: zenoh-c-1.9.0-${{ runner.os }}

- name: Build the real Go Tunnel (x402 gate + facilitator)
run: make build

- name: Install Python dependencies
working-directory: bridge/tron1-001
run: |
python -m pip install --upgrade pip
( for f in requirements.txt bridge/requirements.txt tests/requirements.txt; do [ -f "$f" ] && sed -i '/^[[:space:]]*zenoh[[:space:]<>=-]/d' "$f"; done ) || true
pip install -r requirements.txt
pip install "x402>=0.2.0" eth-account web3 httpx

- name: Run payment-boundary tests against the real Tunnel binary
working-directory: bridge/tron1-001
env:
# Drive the freshly built binary; rpath also points at .zenoh-c/lib.
TUNNEL_BIN: ${{ github.workspace }}/bin/tunnel
LD_LIBRARY_PATH: ${{ github.workspace }}/.zenoh-c/lib
run: |
python -m pytest tests/test_payment_gate.py \
tests/test_x402_no_settlement.py \
tests/test_bridge_executes.py -v
80 changes: 37 additions & 43 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,43 +1,37 @@
*.exe
*.exe~
*.dll
*.so
*.dylib

*.test

*.out
coverage.*
*.coverprofile
profile.cov

go.work
go.work.sum

.env
robopay_idempotency.json

.idea/
.vscode/

.zenoh-c/

bin/

__pycache__/
*.pyc
*.egg-info/
.pytest_cache/
.venv/

build/
install/
log/
.colcon_settings.yaml

PROJECT_MEMORY.md

# Robot-profile runtime evidence and durable local state are generated by CI
# or the operator. Vendor source/model assets under registry remain tracked.
registry/**/artifacts/
registry/**/simulators/webots/scenes/*.generated.wbt
*.exe
*.exe~
*.dll
*.so
*.dylib

*.test

*.out
coverage.*
*.coverprofile
profile.cov

go.work
go.work.sum

.env

.idea/
.vscode/

.zenoh-c/

bin/

__pycache__/
*.pyc
*.egg-info/
.pytest_cache/
.venv/

build/
install/
log/
.colcon_settings.yaml

PROJECT_MEMORY.md
Loading