id: robustness_score
name: Robustness Score
description: >
  Classify the robustness of a finding across specification variants.
  Computes agreement percentage and assigns a robustness class
  (fragile, moderate, robust) based on configurable thresholds.
version: 1.0.0
category: analysis
type: stats-to-stats

inputs:
  - name: agreements
    type: stats
    description: Boolean array — whether each spec variant agrees with the majority direction
    required: true

# Structural: classification of a scalar agreement fraction. requires: omitted.

outputs:
  - name: score
    type: stats
    format: json
    description: Robustness score with pct_agreement, majority_direction, and robustness_class

params:
  robust_threshold:
    type: number
    default: 0.9
    description: Agreement fraction above which finding is classified as robust
  moderate_threshold:
    type: number
    default: 0.7
    description: Agreement fraction above which finding is classified as moderate

# backends: audited 2026-08-14 (defect 50). NOTHING dispatches this op: no arm in folia-engine
# `dispatch_op`, no `registerOp`/OP_TABLE entry in packages/compute, no `_BUILTIN_OP_MAP`
# key in folia/compute.py, no backend manifest. Declared EMPTY on purpose — an absent
# block would be indistinguishable from one nobody ever wrote.
# packages/compute-wasm/src/stats_ops.rs:2089 `robustness_score` exists as a crate fn (wasm shim at stats_ops.rs:2584); nothing registers an op for it.
backends: {}
