{
  "schema": "nodus.tolerance-direction-result.v1",
  "status": "passed",
  "method": "Original authored finite scalar Fraction arithmetic; no NumPy/PyTorch invocation.",
  "runtime": {
    "implementation": "CPython",
    "python_version": "3.9.6",
    "python_build": [
      "default",
      "May 22 2026 11:13:45"
    ],
    "fraction_backend": "Python standard library fractions.Fraction"
  },
  "source_sha256": "0dcb1125ca80099086fc1bb50bea6cae1a6454fcf87536d783060e83d5a96738",
  "fixture_sha256": "759ede1f070a49a66760c822b313d70b74a7d885d89b6da58fa6b3a49e66cfcc",
  "protocol_sha256": "fc5fc71b2f5749d57df11e485ec63dbbf4ed59b7a762dffa115d1331795d4a5b",
  "contract": {
    "declared_reference": "reference",
    "candidate": "candidate",
    "acceptance": "abs(candidate-reference) <= atol + rtol*abs(reference)",
    "alternative": "abs(candidate-reference) <= atol + rtol*abs(candidate)",
    "boundary": "inclusive <=",
    "inputs": "Finite canonical rational strings; nonnegative rtol and atol. Exact arithmetic, no float coercion.",
    "meaning": "The declared reference sets the relative scale. The alternative changes that contract; it is not an independent correctness oracle."
  },
  "rows": [
    {
      "id": "upward_scale",
      "reference": "1",
      "candidate": "2",
      "rtol": "1/2",
      "atol": "0",
      "absolute_error": "1",
      "reference_threshold": "1/2",
      "candidate_threshold": "1",
      "reference_accept": false,
      "candidate_accept": true,
      "expected": {
        "absolute_error": "1",
        "reference_threshold": "1/2",
        "candidate_threshold": "1",
        "reference_accept": false,
        "candidate_accept": true
      },
      "expected_case_check_passed": true,
      "verdict_changed": true
    },
    {
      "id": "downward_scale",
      "reference": "2",
      "candidate": "1",
      "rtol": "1/2",
      "atol": "0",
      "absolute_error": "1",
      "reference_threshold": "1",
      "candidate_threshold": "1/2",
      "reference_accept": true,
      "candidate_accept": false,
      "expected": {
        "absolute_error": "1",
        "reference_threshold": "1",
        "candidate_threshold": "1/2",
        "reference_accept": true,
        "candidate_accept": false
      },
      "expected_case_check_passed": true,
      "verdict_changed": true
    },
    {
      "id": "nearby_same_pass",
      "reference": "4",
      "candidate": "5",
      "rtol": "1/2",
      "atol": "0",
      "absolute_error": "1",
      "reference_threshold": "2",
      "candidate_threshold": "5/2",
      "reference_accept": true,
      "candidate_accept": true,
      "expected": {
        "absolute_error": "1",
        "reference_threshold": "2",
        "candidate_threshold": "5/2",
        "reference_accept": true,
        "candidate_accept": true
      },
      "expected_case_check_passed": true,
      "verdict_changed": false
    },
    {
      "id": "far_same_fail",
      "reference": "1",
      "candidate": "4",
      "rtol": "1/2",
      "atol": "0",
      "absolute_error": "3",
      "reference_threshold": "1/2",
      "candidate_threshold": "2",
      "reference_accept": false,
      "candidate_accept": false,
      "expected": {
        "absolute_error": "3",
        "reference_threshold": "1/2",
        "candidate_threshold": "2",
        "reference_accept": false,
        "candidate_accept": false
      },
      "expected_case_check_passed": true,
      "verdict_changed": false
    },
    {
      "id": "reference_boundary",
      "reference": "2",
      "candidate": "3",
      "rtol": "1/2",
      "atol": "0",
      "absolute_error": "1",
      "reference_threshold": "1",
      "candidate_threshold": "3/2",
      "reference_accept": true,
      "candidate_accept": true,
      "expected": {
        "absolute_error": "1",
        "reference_threshold": "1",
        "candidate_threshold": "3/2",
        "reference_accept": true,
        "candidate_accept": true
      },
      "expected_case_check_passed": true,
      "verdict_changed": false
    },
    {
      "id": "both_zero",
      "reference": "0",
      "candidate": "0",
      "rtol": "1/2",
      "atol": "0",
      "absolute_error": "0",
      "reference_threshold": "0",
      "candidate_threshold": "0",
      "reference_accept": true,
      "candidate_accept": true,
      "expected": {
        "absolute_error": "0",
        "reference_threshold": "0",
        "candidate_threshold": "0",
        "reference_accept": true,
        "candidate_accept": true
      },
      "expected_case_check_passed": true,
      "verdict_changed": false
    },
    {
      "id": "zero_reference_nonzero",
      "reference": "0",
      "candidate": "1",
      "rtol": "1/2",
      "atol": "0",
      "absolute_error": "1",
      "reference_threshold": "0",
      "candidate_threshold": "1/2",
      "reference_accept": false,
      "candidate_accept": false,
      "expected": {
        "absolute_error": "1",
        "reference_threshold": "0",
        "candidate_threshold": "1/2",
        "reference_accept": false,
        "candidate_accept": false
      },
      "expected_case_check_passed": true,
      "verdict_changed": false
    },
    {
      "id": "absolute_boundary",
      "reference": "0",
      "candidate": "1/4",
      "rtol": "1/2",
      "atol": "1/4",
      "absolute_error": "1/4",
      "reference_threshold": "1/4",
      "candidate_threshold": "3/8",
      "reference_accept": true,
      "candidate_accept": true,
      "expected": {
        "absolute_error": "1/4",
        "reference_threshold": "1/4",
        "candidate_threshold": "3/8",
        "reference_accept": true,
        "candidate_accept": true
      },
      "expected_case_check_passed": true,
      "verdict_changed": false
    },
    {
      "id": "absolute_only",
      "reference": "1",
      "candidate": "3/2",
      "rtol": "0",
      "atol": "1/2",
      "absolute_error": "1/2",
      "reference_threshold": "1/2",
      "candidate_threshold": "1/2",
      "reference_accept": true,
      "candidate_accept": true,
      "expected": {
        "absolute_error": "1/2",
        "reference_threshold": "1/2",
        "candidate_threshold": "1/2",
        "reference_accept": true,
        "candidate_accept": true
      },
      "expected_case_check_passed": true,
      "verdict_changed": false
    },
    {
      "id": "negative_scale",
      "reference": "-1",
      "candidate": "-2",
      "rtol": "1/2",
      "atol": "0",
      "absolute_error": "1",
      "reference_threshold": "1/2",
      "candidate_threshold": "1",
      "reference_accept": false,
      "candidate_accept": true,
      "expected": {
        "absolute_error": "1",
        "reference_threshold": "1/2",
        "candidate_threshold": "1",
        "reference_accept": false,
        "candidate_accept": true
      },
      "expected_case_check_passed": true,
      "verdict_changed": true
    }
  ],
  "selected_refusal_controls": [
    {
      "id": "negative_rtol",
      "changed_case_index": 0,
      "field": "rtol",
      "malformed_value": "-1/2",
      "expected": "ValueError refusal",
      "observed": "ValueError refusal",
      "reason": "negative tolerance",
      "passed": true
    },
    {
      "id": "negative_atol",
      "changed_case_index": 0,
      "field": "atol",
      "malformed_value": "-1/4",
      "expected": "ValueError refusal",
      "observed": "ValueError refusal",
      "reason": "negative tolerance",
      "passed": true
    },
    {
      "id": "float_input",
      "changed_case_index": 0,
      "field": "reference",
      "malformed_value": 1.0,
      "expected": "ValueError refusal",
      "observed": "ValueError refusal",
      "reason": "rational must be a bounded canonical string",
      "passed": true
    },
    {
      "id": "boolean_input",
      "changed_case_index": 0,
      "field": "candidate",
      "malformed_value": true,
      "expected": "ValueError refusal",
      "observed": "ValueError refusal",
      "reason": "rational must be a bounded canonical string",
      "passed": true
    },
    {
      "id": "nan_text",
      "changed_case_index": 0,
      "field": "reference",
      "malformed_value": "NaN",
      "expected": "ValueError refusal",
      "observed": "ValueError refusal",
      "reason": "invalid rational syntax",
      "passed": true
    },
    {
      "id": "duplicate_case_id",
      "changed_case_index": 1,
      "field": "id",
      "malformed_value": "upward_scale",
      "expected": "ValueError refusal",
      "observed": "ValueError refusal",
      "reason": "duplicate or invalid case id",
      "passed": true
    }
  ],
  "summary": {
    "main_cases": 10,
    "main_case_checks_passed": 10,
    "selected_controls": 6,
    "selected_controls_passed": 6,
    "verdict_differences": 3,
    "verdict_agreements": 7,
    "reference_accepts": 6,
    "candidate_scale_accepts": 7,
    "all_checks_passed": true
  },
  "limits": [
    "Authored finite scalar rational arithmetic, not a NumPy or PyTorch execution or conformance test.",
    "No floating-point conversion or rounding is modeled. No arrays, broadcasting, dtypes, nonfinite values or reduction contract are evaluated.",
    "rtol=1/2 is deliberately illustrative, not a recommended tolerance for real work.",
    "The selected cases are not sampled workloads or evidence of defect prevalence. Directional tolerance is documented behavior, not an API bug.",
    "No GPU, training, runtime performance, production vulnerability, security or economic claim.",
    "Selected parser refusals are teaching-contract checks, not exhaustive validation."
  ]
}
