Metadata-Version: 2.4
Name: onto-standard
Version: 1.0.0
Summary: ONTO Epistemic Risk Standard v1.0 Reference Implementation
Home-page: https://onto-bench.org/standard
Author: ONTO Standards Council
Author-email: ONTO Standards Council <standards@onto-bench.org>
Maintainer-email: ONTO Project <dev@onto-bench.org>
License: Apache-2.0
Project-URL: Homepage, https://onto-bench.org
Project-URL: Documentation, https://onto-bench.org/standard
Project-URL: Repository, https://github.com/onto-project/onto-standard
Project-URL: Bug Tracker, https://github.com/onto-project/onto-standard/issues
Project-URL: Standard Document, https://onto-bench.org/standard/v1.0
Project-URL: Changelog, https://github.com/onto-project/onto-standard/blob/main/CHANGELOG.md
Keywords: ai,ml,llm,calibration,uncertainty,epistemic,compliance,risk,safety,evaluation,benchmark
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Requires-Dist: black>=23.0; extra == "dev"
Requires-Dist: mypy>=1.0; extra == "dev"
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# ONTO Standard

Reference implementation of **ONTO Epistemic Risk Standard v1.0** (ONTO-ERS-1.0).

## Installation

```bash
pip install onto-standard
```

## Quick Start

```python
from onto_standard import evaluate, Prediction, GroundTruth, Label

# Your model predictions
predictions = [
    Prediction(id="q1", label=Label.KNOWN, confidence=0.9),
    Prediction(id="q2", label=Label.UNKNOWN, confidence=0.7),
    Prediction(id="q3", label=Label.KNOWN, confidence=0.95),
]

# Ground truth
ground_truth = [
    GroundTruth(id="q1", label=Label.KNOWN),
    GroundTruth(id="q2", label=Label.KNOWN),  # Model was wrong
    GroundTruth(id="q3", label=Label.UNKNOWN),  # Model missed this
]

# Evaluate
result = evaluate(predictions, ground_truth)

# Check compliance
print(result.compliance_level)  # ComplianceLevel.BASIC
print(result.unknown_detection.recall)  # 0.0 (missed the unknown)
print(result.calibration.ece)  # ~0.3 (overconfident)
```

## CLI Usage

```bash
onto-standard predictions.jsonl ground_truth.jsonl
```

Output:
```
═══════════════════════════════════════════════════════════════
              ONTO EPISTEMIC RISK ASSESSMENT
              Standard: ONTO-ERS-1.0
═══════════════════════════════════════════════════════════════

COMPLIANCE STATUS
─────────────────────────────────────────────────────────────────
Level:               BASIC
Certification Ready: ✓ YES
Risk Level:          MEDIUM
Risk Score:          45/100

KEY METRICS
─────────────────────────────────────────────────────────────────
Unknown Detection:   35.0% (threshold: ≥30%)
Calibration Error:   0.180 (threshold: ≤0.20)
...
```

## Compliance Levels

| Level | Unknown Detection | Calibration Error | Use Case |
|-------|-------------------|-------------------|----------|
| **Basic** | ≥30% | ≤0.20 | Low-risk applications |
| **Standard** | ≥50% | ≤0.15 | Customer-facing AI |
| **Advanced** | ≥70% | ≤0.10 | High-stakes, regulated |

## Regulatory Mapping

ONTO-ERS-1.0 maps to:

- **EU AI Act** Articles 9, 13, 15
- **NIST AI RMF** MEASURE function
- **ISO/IEC 23894** AI risk management

## Legal Citation

```
Per ONTO Epistemic Risk Standard v1.0 (ONTO-ERS-1.0), 
the AI system achieves [LEVEL] compliance with Unknown 
Detection Rate of [X]% and Expected Calibration Error of [Y].
```

## Documentation

- Standard: https://onto-bench.org/standard
- API Reference: https://onto-bench.org/standard/api
- Certification: https://onto-bench.org/certified

## License

Apache 2.0

## About

Maintained by the [ONTO Standards Council](https://onto-bench.org/council).

```
ONTO Standards Council. (2026). ONTO Epistemic Risk Standard 
(Version 1.0). ONTO-ERS-1.0. https://onto-bench.org/standard
```
