ROS 2 / K8S LAB
Lab/Docs/Offline research modules
OFFLINE RESEARCH MODULES

Offline research modules

Seven small Python modules you can run without a cluster, a GPU or a network. Each one fixes a contract, a validator or a teaching baseline that a later real experiment can reuse. Each section gives the run command and the limits of what a pass shows.

PYTHON STANDARD LIBRARY / OFFLINESYNTHETIC OR SIMULATED DATA ONLYNOT A BENCHMARK

What none of these modules show

No module on this page ran ROS 2, DDS, Kubernetes, a GPU, a simulator, a language model or a robot. Their fixtures are hand-written or generated by a seeded script. A passing test or a clean report shows that the code behaves as its authors specified on those fixtures. It is not a measured result, a security guarantee or a safety certification. Cross-worker DDS delivery is tracked separately in issue #14.

The modules at a glance

Run every command from the root of a cloned repository. The modules need Python 3 and its standard library only, with no pip install. Mock policy, action gate and skill-proposal review state Python 3.10 or newer as the minimum; check each module's README for its own notes.

git clone https://github.com/MSKazemi/robo-resilience-lab.git
cd robo-resilience-lab
Offline research modules, what each one answers and the kind of data it uses
ModuleQuestion it answersDataIssue / PR
ROS 2 sequence probeWhich numbered messages arrived, and did any arrive twice or out of order?Synthetic logs (ROS adapters run once, in one container)context #52 / PR #122
Observation/action contract and mock policyIs a simulated observation or action well-formed, fresh and inside the joint limits?Synthetic, seeded#55 / PR #113
Fail-closed simulated action gateShould this proposed simulated action be allowed, held or rejected?Simulation, logical ticks#59 / PR #128
Skill-proposal reviewIs this text a well-formed call to an allowlisted simulated skill?Synthetic corpus#64, #86 / PR #130
DDS/QoS fault triage casebookGiven an evidence bundle, which root cause fits, or is there too little evidence to say?Synthetic cases#84 / PR #129
Run manifest and metrics contractDoes a run record carry everything needed to reproduce and summarise it honestly?Synthetic, seeded#60 / PR #127
Pod recovery metricsHow long until Kubernetes lists, then reports Ready, a replacement pod?Synthetic fixtures (live path not run on a cluster)#45 / PR #131

Every command below was re-run on 2026-11-20 from a checkout of commit e45de7a with Python 3.12.3 on Linux. The exit codes in the comments are the ones observed then. They show that the commands work as written. They do not add any measured result.

ROS 2 sequence probe

CORE / UNIT-TESTEDROS ADAPTERS / ONE CONTAINER ONLY

A counting tool for one ROS 2 topic. The publisher sends numbered messages; the subscriber records which ones arrived and reports gaps, duplicates and reordering in a strict JSON-lines log. Every timestamp carries the name of its clock, and clocks are never mixed. Without ROS you can simulate a log with chosen faults and analyse it.

python3 -m unittest discover -s examples/ros2-sequence-probe/tests -t examples/ros2-sequence-probe   # exit 0

cd examples/ros2-sequence-probe
python3 -m seqprobe simulate --count 20 --drop 5,6 --duplicate 9 --swap 12 --out /tmp/demo.jsonl
python3 -m seqprobe analyze /tmp/demo.jsonl   # exit 1: the SYNTHETIC log contains the injected loss
cd ../..

What it does not claim

Read the sequence probe README ↗

Observation/action contract and mock policy

CONTRACT / UNIT-TESTEDNON-ACTUATING

Contract ros2-obs-action/v1 fixes the joint names, units and limits, the camera keys and the message fields for a simulated six-joint arm. A fail-closed validator returns a typed reason for every rejection: missing fields, stale or expired actions, out-of-limit values, NaN, an unknown source. The seeded mock policy is called MOCK-policy-do-not-report-accuracy for a reason: it has no task accuracy.

python3 -m unittest discover -s examples/cloud-robotics/mock-policy/tests   # exit 0
python3 examples/cloud-robotics/mock-policy/example.py                       # optional: a JSON-lines trace, exit 0
python3 examples/cloud-robotics/mock-policy/fixture_gen.py --check           # exit 0: fixtures have not drifted

What it does not claim

Read the mock-policy README ↗

Fail-closed simulated action gate

FAULT SUITE / DETERMINISTICSIMULATION / LOGICAL TICKS

The gate sits between an untrusted proposal source and a simulated actuator sink and decides ALLOW, HOLD or REJECT for each proposed action. Anything it cannot prove valid is blocked with a typed reason, the failing field and an audit record, and the sink records dispatched: false. A scripted fault suite plays delayed, reordered, duplicated and lost messages, process restarts, operator intervention and invalid model arguments on a logical-tick timeline. It reads joint names and limits from the mock-policy contract.

python3 -m unittest discover -s examples/cloud-robotics/action-gate/tests -t examples/cloud-robotics/action-gate   # exit 0
python3 examples/cloud-robotics/action-gate/run_fault_suite.py --check   # exit 0 only if every expectation held and nothing failed open
python3 examples/cloud-robotics/action-gate/mutation_check.py            # optional, about a minute: exit 0 when every mutant makes the tests fail

What it does not claim

Read the action-gate README and threat model ↗

Skill-proposal review and injection challenge

CORPUS / DETERMINISTICNOT A SECURITY GUARANTEE

A reviewer for text that stands in for a language model's skill proposal. It accepts exactly one strict JSON object, checks it against a closed catalogue of six simulated skills with typed, bounded arguments, and returns ACCEPT, NEEDS_HUMAN or REJECT with typed reasons. Free text is treated as data and never interpreted, and an optional advisor opinion is recorded but cannot change the verdict. A hand-written corpus covers prompt injection, look-alike names, type confusion, numeric abuse, paths and URLs, duplicate keys, size and nesting.

python3 -m unittest discover -s examples/cloud-robotics/skill-proposal-review/tests -t examples/cloud-robotics/skill-proposal-review   # exit 0
python3 examples/cloud-robotics/skill-proposal-review/evaluate.py                  # exit 0 if every corpus expectation is met
python3 examples/cloud-robotics/skill-proposal-review/evaluate.py --case inj-01    # one annotated audit trace, exit 0

What it does not claim

Read the skill-proposal review README ↗

ROS 2 DDS/QoS fault triage casebook

TEACHING BASELINESYNTHETIC CASES / CIRCULAR SCORE

An openly inspectable casebook of invented incidents (pods not ready, an unreachable Discovery Server, blocked multicast, domain or RMW mismatch, incompatible QoS, clock skew, partitions, publisher restarts) and a closed set of root-cause labels. A small rule baseline answers with a label and the evidence it used, or abstains when the evidence does not decide. Every suggested next step is a read-only diagnostic. The docs/TEACHING.md file in the module has a blind rubric for classes.

python3 -m unittest discover -s examples/ros2-fault-triage-casebook/tests -t examples/ros2-fault-triage-casebook   # exit 0

cd examples/ros2-fault-triage-casebook
python3 -m triage validate                        # exit 0: every case file is valid
python3 -m triage evaluate                        # exit 0: the baseline over all cases
python3 -m triage triage fixtures/case_001.json   # exit 0: one case with label, tier, rule and evidence used
cd ../..

What it does not claim

Read the casebook README ↗

Run manifest and metrics contract

CONTRACT / VALIDATORSYNTHETIC TABLES AND PLOTS

run-manifest/v1 defines what one independent run of a cloud-robotics experiment must record: provenance (commit, image digests, model and dataset revisions, licences), the software stack, placement, network shaping, clocks, faults and outcome. Every quantity carries a unit. A validator reports typed diagnostics, a metric registry defines each metric with its clock requirement and what it does not show, and a summary generator applies fixed statistical rules: the independent run is the unit, fewer than three runs means no statistical claim, censored runs are never averaged in, and no p-values are produced.

python3 examples/run-manifest/rm_validate.py examples/run-manifest/fixtures/manifests/valid/*.json   # exit 0
python3 examples/run-manifest/rm_validate.py examples/run-manifest/fixtures/manifests/invalid/unit_missing.json   # exit 1, typed diagnostic
python3 examples/run-manifest/rm_summary.py --check   # exit 0: the SYNTHETIC reports match a fresh regeneration
python3 -m unittest discover -s examples/run-manifest/tests -t examples/run-manifest   # exit 0

What it does not claim

Read the run-manifest README and metric definitions ↗

Pod recovery metrics

OFFLINE ANALYZER / SYNTHETIC FIXTURESLIVE COLLECTOR / NOT RUN ON A CLUSTER

Tooling in DataAnalysis/ that defines separate, named measurements of how long Kubernetes takes to list and then report Ready a replacement pod after one pod is deleted. The replacement is identified by UID, primary intervals use the local monotonic clock, and server timestamps appear only as rows labelled auxiliary. Output follows the versioned recovery-metrics/1 schema. The offline analyzer reads a recorded observation; the fixtures shipped with it are invented.

python3 DataAnalysis/recovery_metrics.py analyze --observation DataAnalysis/fixtures_recovery/success_basic.json   # exit 0
python3 DataAnalysis/recovery_metrics.py analyze --observation DataAnalysis/fixtures_recovery/success_basic.json | diff - DataAnalysis/fixtures_recovery/expected/success_basic.csv   # no output: byte-identical
python3 DataAnalysis/recovery_metrics.py analyze --observation DataAnalysis/fixtures_recovery/fail_no_replacement.json --format json   # exit 1: a SYNTHETIC failure case

cd DataAnalysis && python3 -m unittest tests.test_recovery_metrics; cd ..   # exit 0

The live collector deletes a pod

DataAnalysis/RH.py is a dry run by default. With --yes and an explicit --context it deletes one pod in the cluster your kubectl points at. It is not needed for anything on this page. Read the live-collection section before using it, and never point it at a cluster you do not own.

What it does not claim

Read the pod recovery section of the DataAnalysis README ↗

How the simulated action-path modules fit together

Three of the modules describe layers of one proposed path from untrusted model output to a simulated actuator. Read the list as a design, not a deployed pipeline: the layers are separate modules and are not wired together in code.

Untrusted proposal text

Model output, a retrieved snippet or a log line. It is never executed. In this repository it is always a hand-written fixture.

Skill-proposal review

Strict parsing and a closed skill catalogue give ACCEPT, NEEDS_HUMAN or REJECT. Consequential skills always need a human.

Fail-closed action gate

Freshness, sequence, epoch, mode and joint-limit checks give ALLOW, HOLD or REJECT, using the mock-policy contract's joint limits.

Simulated sink only

The sink logs dispatched: true or false. No executor, ROS 2 topic, simulator or robot exists behind it.

The measurement modules relate in a similar way. The sequence probe defines how to count delivered messages; the fault triage casebook uses its summary fields as evidence; the run manifest says what a real run must record before its numbers are published; and the pod recovery metrics keep Kubernetes readiness apart from application recovery. None of them has produced a real measurement yet. Published outcomes follow the lab's results registry, where every primary result stays empty until reviewed evidence exists.

Extend a module

These modules are good first contributions because they need no cluster: add a synthetic case to the casebook, a new attack case to the skill-review corpus or a new fault scenario to the action gate, together with a test. Each README explains how to regenerate its fixtures and what to check before opening a pull request. Start from the contributing guide.