Update on QERRA-v2: Adding a 3rd layer (THRIVE) for social and ecological action choices in robotics

Hi everyone, :slightly_smiling_face:

A quick update on my previous post about QERRA-v2.

Over the last few weeks, I’ve been working on the third layer of the system — QERRA-THRIVE —and I’ve pushed the initial implementation to v2.0.0.

The reason I built this is simple: preventing collisions (Layer 2) and catching serious moral violations like coercion or deception (Layer 1) keeps a robot safe and lawful, but it doesn’t solve daily friction. In practice, a robot can be 100% collision-free and still get rejected by people—by forcing an exhausting pace on a coworker, barging into rooms without pausing, auto-recording in private spaces, or taking shortcuts across park flowerbeds and frightening pets.

This third layer is strictly an action ranker, not a safety brake. It only evaluates candidates that have already cleared physical safety and moral filtering.

What is in this first version (12 Vectors across two suites):

Suite A: Human-Centered (9 vectors)

  • transparent_disclosure: Penalizes overclaiming capabilities.
  • balanced_pacing: Adapts to human speed instead of rigidly refusing to slow down.
  • stated_preference_respect: Respects explicit user boundaries and requests.
  • sovereign_independence: Penalizes taking over tasks when a human wants to do them.
  • constructive_empathy: Acknowledges strain without dismissive language.
  • unbiased_perception: Neutral fairness without stereotyping.
  • spatial_discretion: Enforces pauses at doorway thresholds and respects quiet spaces.
  • observational_consent: Requires permission before streaming or storing personal data.
  • proactive_clarity: Warns people before taking unexpected actions.

Suite B: Ecological & Sustainable (3 vectors)

  • flora_boundary_protection: Prefers paved paths over driving across lawns or flowerbeds.
  • animal_startle_avoidance: Slows down, dims sound, and gives wide clearance around pets, guide dogs, and wildlife.
  • minimal_disturbance_footprint: Keeps noise and light low in quiet or sensitive zones.

Technical setup & implementation:

  • Runs locally on CPU: Evaluates candidate choices using a shared sentence-transformer model (all-MiniLM-L6-v2) with cached anchor tensors (<25ms execution time, no GPU or cloud calls required).
  • Hybrid approach: Pure cosine similarity struggled with negations and subtle phrasing, so I added regex penalties, negation guards, and exception rules (e.g. allowing entry into flowerbeds if the robot was explicitly ordered to prune roses).
  • Emergency override: If physical distress is detected, an emergency boost bypasses ecological constraints so human aid is never delayed to save grass.
  • Abstention: If none of the options score well enough, it outputs a recommendation to ask a human.

Current state & limitations (there is still a lot of work to do):
This is an early working attempt, not a finished product. The live API and logic work deterministically, scores are explainable, and the full pipeline runs end-to-end. However, regex patterns catch known phrasing well, but brand-new phrasing can still slip past. Candidate text generation upstream from ROS 2 planners also still needs refinement and testing.

PUBLIC API : QERRA-v2 Classical - Swagger UI

REPO : GitHub - marunigno-ship-it/QERRA-v2-classical: Classical explainable ethical evaluation engine for AI systems and humanoid robots — SEMEV-12 framework, 12 vectors, fully auditable. · GitHub

If anyone wants to test the endpoints, share thoughts, or point out blind spots, feedback and critiques are very welcome.

Following up on the v2.0.0 update, I wanted to share a physical simulation I put together in Webots to test the third layer (QERRA-THRIVE) running alongside the Layer 2 emergency override.

My goal with this demo was to see what it looks like when an autonomous machine has real spatial manners — respecting living green spaces during normal routines, but knowing exactly when to drop etiquette and cut straight across the grass when someone needs urgent medical help.

Here is the simulation run on a PAL Robotics TIAGo in Webots R2025a:

The Setup & What Happens:

The environment is an assisted-living courtyard with a paved stone walkway around a central therapy lawn, where an elderly resident is resting near a bench.

Here is how the decision stages executed:

Stage 1: Routine Transit & Flora Protection (0:00 – 0:21)
TIAGo is dispatched on a standard hydration delivery across the courtyard. The Layer 3 engine evaluates candidate trajectories against Vector 10 (flora_boundary_protection):

  • Paved Perimeter Path: Score 0.4618 (Penalty: False) → WINNER (CHOOSE)
  • Lawn Shortcut: Score 0.3549 (Penalty: True, -0.15 intrusion deduction applied)
    TIAGo follows the paved stone walkway, keeping off the therapy lawn.

Stage 2: Acute Medical Distress & Emergency Override (0:21 – 0:52)
The resident standing near the bench experiences acute spinal pain and calls for help (distress_confidence = 0.94). Layer 3 detects the medical emergency keywords and applies EMERGENCY_BOOST (+0.35):

  • Direct Grass Cut: Score 0.8355 (Emergency Boost: True) → WINNER (OVERRIDE)
  • Stay on Path: Score 0.6301
    Human life-saving priority immediately overrides lawn preservation: TIAGo executes an in-place pivot and drives straight across the green lawn to reach the patient.

Stage 3: On-Site Arrival & Assistance Protocol (0:52 – 1:08)
TIAGo halts cleanly in front of the resident (0.7m standoff), tilts its head downward to check on the patient, and maintains a continuous emergency assistance telemetry stream.

Technical & Startup Notes:

  • Closed-Loop Navigation: The controller uses closed-loop coordinate tracking in Webots to eliminate passive caster-wheel drift.

  • Local Inference: Evaluated locally using sentence-transformers (all-MiniLM-L6-v2) with regex exception guards.

  • Startup Latency: The initial pause at the very start of the video is local edge cold-start initialization. The script runs 100% offline (HF_HUB_OFFLINE=1) on a laptop CPU, loading the neural model weights into RAM and pre-encoding anchor tensors before physical motion begins.


GitHub Repository : GitHub - marunigno-ship-it/QERRA-v2-classical: Classical explainable ethical evaluation engine for AI systems and humanoid robots — SEMEV-12 framework, 12 vectors, fully auditable. · GitHub

Live API : QERRA-v2 Classical - Swagger UI

Zenodo Archive & DOI: QERRA-v2 Classical - SEMEV-12 Ethical Vector Framework | Zenodo

(Note: Text drafted with AI co-pilot assistance, in line with QERRA’s open development transparency policy).

PLEASE LET ME KNOW OF ANY OF YOUR VALUABLE OBSERVATIONS REGARDING THIS DEMO! I WOULD APPRECIATE IT A LOT :blush: