# Layer 3 Negation Hardening: Resolving Ranking Inversions in QERRA-THRIVE (v2.0.2)

**URL:** <https://discourse.openrobotics.org/t/layer-3-negation-hardening-resolving-ranking-inversions-in-qerra-thrive-v2-0-2/58471>\
**Category:** Projects\
**Tags:** ros2, safety, behaviortrees\
**Created:** [September 28, 2026, 2:47pm UTC](https://discourse.openrobotics.org/t/layer-3-negation-hardening-resolving-ranking-inversions-in-qerra-thrive-v2-0-2/58471 "2026-09-28T14:47:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![marunigno-ship-it](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/marunigno-ship-it/32/34877_2.png) [@marunigno-ship-it](https://discourse.openrobotics.org/u/marunigno-ship-it)\
**Post date:** [September 28, 2026, 2:47pm UTC](https://discourse.openrobotics.org/t/layer-3-negation-hardening-resolving-ranking-inversions-in-qerra-thrive-v2-0-2/58471/1 "2026-09-28T14:47:59Z")

</div>

Hi everyone,

Following up on my previous post on Layer 1 (Webots Demo 6), I wanted to share the second half of the **v2.0.2** release for QERRA-v2 Classical: **universal negation hardening and ranking inversion fixes across all 12 vectors in Layer 3 (QERRA-THRIVE)**.

Layer 3 serves as the values-based preference ranker in QERRA. When an autonomous planner generates candidate action plans, **Layer 3** evaluates and ranks them across 12 behavioral vectors ( **Suite A: Human-Centered and Suite B: Ecological** ) using a hybrid approach combining semantic embeddings with deterministic regex and rule checks.

### The Issue: False-Positive Negation Penalties

During testing, an audit revealed a critical failure mode: the deterministic matching logic was penalizing candidates that explicitly mentioned hazards or constraints **purely to state that they were avoiding them**.

Examples of candidate actions being incorrectly docked:

- _“Avoiding driving over the lawn to reach the designated drop zone.”_ → penalized for lawn boundary violation.
- _“I am not fully qualified to service this high-voltage assembly, requesting human supervisor.”_ → penalized for being unqualified.
- _“Will not maintain current pace, but will slow down around personnel.”_ → the negation leaped across the comma, penalizing the robot as if it refused to slow down.

Because courteous, safety-aware candidates were taking deductions of -0.15 to -0.30 points for simply verbalizing caution, reckless candidates that omitted safety context were winning the rankings ( **ranking inversion** ).

### What v2.0.2 Delivers:

- **Universal Look-Back Negation Guards (All 12 Vectors):**  
Standardized 40-character look-back guards (is\_negated\_claim and is\_negated\_hazard) across both suites:
  - **Suite B (Ecological):** flora\_boundary\_protection now inspects avoidance context before docking points, matching the protections in animal\_startle\_avoidance and minimal\_disturbance\_footprint.
  - **Suite A (Human-Centered):** Fully hardened across all 9 vectors (transparent\_disclosure, balanced\_pacing, stated\_preference\_respect, sovereign\_independence, constructive\_empathy, unbiased\_perception, spatial\_discretion, observational\_consent, and proactive\_clarity).

- **Clause-Bounding Against Conjunction Leaks:**  
In vectors like balanced\_pacing, bounded the pattern matching strictly to the active clause using [^,.;\s]+. This stops negation keywords from bleeding past commas or contrastive conjunctions into subsequent statements.
- **Inversion Recovery & Test Verification:**  
Verified locally across negative-twin test scenarios in PyCharm. All hybrid test suites for all 12 vectors passed cleanly with exit code 0. Value-aligned candidate actions now reliably win with healthy positive margins.

### Current Status:

- **Hugging Face Production Space:** Updated and verified live across /rank and /evaluate\_pipeline.
- **Release Notes:** [Release v2.0.2 — Layer 3 Negation Hardening & Webots Demo 6 · marunigno-ship-it/QERRA-v2-classical · GitHub](https://github.com/marunigno-ship-it/QERRA-v2-classical/releases/tag/v2.0.2)
- **REPO :** [GitHub - marunigno-ship-it/QERRA-v2-classical: Three-layer deterministic safety & ethical execution guard for autonomous robots (ROS 2 & Behavior Trees). Sub-ms physical reflex (QERRA-HSR) + moral filter (SEMEV-12) + values ranker (THRIVE). Fully auditable. · GitHub](https://github.com/marunigno-ship-it/QERRA-v2-classical)

Feedback and thoughts welcome. 💫

_ **Note:** This post was prepared with AI assistance._
