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.
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
| Module | Question it answers | Data | Issue / PR |
|---|---|---|---|
| ROS 2 sequence probe | Which 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 policy | Is a simulated observation or action well-formed, fresh and inside the joint limits? | Synthetic, seeded | #55 / PR #113 |
| Fail-closed simulated action gate | Should this proposed simulated action be allowed, held or rejected? | Simulation, logical ticks | #59 / PR #128 |
| Skill-proposal review | Is this text a well-formed call to an allowlisted simulated skill? | Synthetic corpus | #64, #86 / PR #130 |
| DDS/QoS fault triage casebook | Given an evidence bundle, which root cause fits, or is there too little evidence to say? | Synthetic cases | #84 / PR #129 |
| Run manifest and metrics contract | Does a run record carry everything needed to reproduce and summarise it honestly? | Synthetic, seeded | #60 / PR #127 |
| Pod recovery metrics | How 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
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
- It counts messages only. It reports no latency, jitter, throughput or "resilience" figure.
- The
rclpypublisher and subscriber adapters were run once on 2026-11-20, on one host, inside one Jazzy container (recorded results). They have not been run across containers, nodes or Kubernetes. - The tests exercise the counting logic over an in-memory channel. They do not test DDS, a network or Kubernetes.
Read the sequence probe README ↗
Observation/action contract and mock policy
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
- The validator is not a safety-certified gate, and
source_idis a label, not authentication. - No ROS 2 adapter exists yet; no ROS runtime was used.
- Fixtures are random bytes from a fixed seed, not camera data. Never report the mock policy's output as a model result.
Fail-closed simulated action gate
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
- No certification against any safety standard and no safety case.
HOLD,safe_stopandlockedare logical states of a simulation, not motor braking. - No real time: "time-to-block" is counted in simulation ticks, not seconds. The committed report is simulation output and must not be quoted as a benchmark.
- The "network faults" are scripted events, not a real network. No ROS 2, DDS or Kubernetes was run, and no language model was called.
- No authentication: source and model identifiers are compared to allow-lists, so anyone who can write messages can claim them. Residual risks are listed in the module's threat model.
Read the action-gate README and threat model ↗
Skill-proposal review and injection challenge
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
- No model was run: no LLM, local or hosted advisor output exists in the repository.
ACCEPTis not an authorisation to execute. There is no executor, ROS 2 adapter or simulator integration, and this layer does not import the action gate.- The corpus was written by the same author as the reviewer. Meeting every expectation says nothing about inputs nobody thought of.
- No latency, cost, false-positive or false-negative rate on real data was measured.
Read the skill-proposal review README ↗
ROS 2 DDS/QoS fault triage casebook
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
- No real ROS 2 or DDS behaviour was observed. A label is the root cause the author constructed the evidence to support.
- The cases and the rules were written together, so the baseline's score is circular: a regression pin, not an accuracy result. Most classes have one or two cases.
- No language-model or Jev result exists; the evaluation plan in the module is marked NOT RUN.
- Confidence tiers are not probabilities, and the casebook verifies no cross-worker DDS delivery.
Run manifest and metrics contract
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
- Every number in its fixtures and reports is invented by a seeded generator and resembles no real system. The summary tool refuses any input that is not marked synthetic.
- A manifest that validates is internally consistent, not true. The validator cannot know whether a digest, version or clock statement is correct.
- The secret and address checks are heuristics, not a secret scanner.
- Real benchmarking stays gated on the cross-worker baseline (issues #14, #15, #16).
Read the run-manifest README and metric definitions ↗
Pod recovery metrics
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
- A new pod or
Ready=Trueis not ROS recovery. It says nothing about DDS discovery, topic delivery or a working node. The application-level row stays "not measured" because no message probe produces that record yet. - The live path was tested only against injected fake
kubectloutput. No run on a real cluster was performed for this change. - The fixture values are arithmetic on invented times, not measurements. The historical notebooks and samples were not reinterpreted with these definitions.
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.