Metadata-Version: 2.4
Name: vnvspec
Version: 0.3.1
Summary: V&V-grade specifications for engineered systems — AI, optimization, simulation, and physics.
Project-URL: Homepage, https://github.com/ai-vnv/vnvspec
Project-URL: Documentation, https://ai-vnv.kfupm.io/vnvspec
Project-URL: Repository, https://github.com/ai-vnv/vnvspec
Author-email: Mansur Arief <ariefm@stanford.edu>
License-Expression: Apache-2.0
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: networkx>=3.2
Requires-Dist: openpyxl>=3.1
Requires-Dist: packaging>=23
Requires-Dist: pydantic>=2.7
Requires-Dist: pyyaml>=6.0
Requires-Dist: tomli-w>=1.0
Provides-Extra: all
Requires-Dist: codespell>=2.2; extra == 'all'
Requires-Dist: hypothesis>=6.100; extra == 'all'
Requires-Dist: mkdocs-gen-files; extra == 'all'
Requires-Dist: mkdocs-literate-nav; extra == 'all'
Requires-Dist: mkdocs-material>=9.5; extra == 'all'
Requires-Dist: mkdocs-section-index; extra == 'all'
Requires-Dist: mkdocstrings[python]>=0.25; extra == 'all'
Requires-Dist: mypy>=1.10; extra == 'all'
Requires-Dist: networkx-stubs>=0.0.1; extra == 'all'
Requires-Dist: pandas-stubs; extra == 'all'
Requires-Dist: pandera[pandas]>=0.19; extra == 'all'
Requires-Dist: pre-commit>=3.7; extra == 'all'
Requires-Dist: protobuf>=4.0; extra == 'all'
Requires-Dist: pytest-cov>=5.0; extra == 'all'
Requires-Dist: pytest>=8.0; extra == 'all'
Requires-Dist: ruff>=0.4; extra == 'all'
Requires-Dist: sentencepiece>=0.1.99; extra == 'all'
Requires-Dist: torch>=2.3; extra == 'all'
Requires-Dist: transformers>=4.40; extra == 'all'
Requires-Dist: types-openpyxl>=0.1; extra == 'all'
Requires-Dist: types-pyyaml>=6.0; extra == 'all'
Provides-Extra: dev
Requires-Dist: codespell>=2.2; extra == 'dev'
Requires-Dist: hypothesis>=6.100; extra == 'dev'
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: networkx-stubs>=0.0.1; extra == 'dev'
Requires-Dist: pandas-stubs; extra == 'dev'
Requires-Dist: pandera[pandas]>=0.19; extra == 'dev'
Requires-Dist: pre-commit>=3.7; extra == 'dev'
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Requires-Dist: types-openpyxl>=0.1; extra == 'dev'
Requires-Dist: types-pyyaml>=6.0; extra == 'dev'
Provides-Extra: docs
Requires-Dist: mkdocs-gen-files; extra == 'docs'
Requires-Dist: mkdocs-literate-nav; extra == 'docs'
Requires-Dist: mkdocs-material>=9.5; extra == 'docs'
Requires-Dist: mkdocs-section-index; extra == 'docs'
Requires-Dist: mkdocstrings[python]>=0.25; extra == 'docs'
Provides-Extra: torch
Requires-Dist: protobuf>=4.0; extra == 'torch'
Requires-Dist: sentencepiece>=0.1.99; extra == 'torch'
Requires-Dist: torch>=2.3; extra == 'torch'
Requires-Dist: transformers>=4.40; extra == 'torch'
Description-Content-Type: text/markdown

# vnvspec

V&V-grade specifications for engineered systems — AI, optimization, simulation, and physics.

[![CI](https://github.com/ai-vnv/vnvspec/actions/workflows/ci.yml/badge.svg)](https://github.com/ai-vnv/vnvspec/actions/workflows/ci.yml)
[![Docs](https://github.com/ai-vnv/vnvspec/actions/workflows/docs.yml/badge.svg)](https://ai-vnv.kfupm.io/vnvspec/)
[![codecov](https://codecov.io/gh/ai-vnv/vnvspec/graph/badge.svg)](https://codecov.io/gh/ai-vnv/vnvspec)
[![V&Ved](https://ai-vnv.kfupm.io/vnvspec/dashboard/badge.svg?v=2)](https://ai-vnv.kfupm.io/vnvspec/dashboard/)
[![PyPI](https://img.shields.io/pypi/v/vnvspec)](https://pypi.org/project/vnvspec/)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
[![Python](https://img.shields.io/badge/python-≥3.11-blue.svg)](https://python.org)

## Overview

**vnvspec** lets you write machine-readable V&V specifications for any engineered system
and automatically assess models against them. It produces traceable evidence reports
that map to international standards (ISO/PAS 8800, ISO 21448, UL 4600, EU AI Act, and more).

### Key features

- **Typed spec language** — Pydantic-based `Spec`, `Requirement`, `IOContract`, `ODD`, `Hazard`, `Evidence` models
- **INCOSE GtWR quality checker** — catch vague, ambiguous, or unverifiable requirements early, with configurable profiles (formal, web-app, embedded)
- **Traceability graphs** — link requirements ↔ hazards ↔ evidence ↔ standards clauses, plus auto-trace scanning
- **Standards registries** — built-in clause databases for ISO/PAS 8800, ISO 21448, UL 4600, EU AI Act, NIST AI RMF
- **Compliance matrix** — auditor-grade XLSX/CSV/HTML exports with gap analysis against any standard
- **Best-practices catalogs** — pre-written requirements for PyTorch, HuggingFace, FastAPI, SQLAlchemy, Pyomo; composable via `Spec.extend()`
- **Pluggable adapters** — wrap any model (PyTorch, HuggingFace, scikit-learn, ONNX, Pyomo, FMI)
- **EvidenceCollector** — ergonomic context manager for building evidence from assertions and JUnit XML
- **pytest plugin** — `pytest-vnvspec` captures evidence directly from test results
- **Multi-format specs** — define specs in Python, YAML, or TOML; lossless round-trips
- **CI integrations** — GitHub Actions composite action, V&V badge SVG, report diff for regression detection
- **Rich exports** — HTML reports, Markdown, GSN assurance cases (Mermaid), EU AI Act Annex IV tech docs

## Installation

```bash
pip install vnvspec
```

With PyTorch adapter:

```bash
pip install vnvspec[torch]
```

## Quick start

```python
from vnvspec import Requirement, Spec

req = Requirement(
    id="REQ-001",
    statement="The classifier shall produce probabilities in [0, 1].",
    rationale="Probability outputs must be valid for downstream calibration.",
    verification_method="test",
    acceptance_criteria=["All output probabilities are between 0.0 and 1.0 inclusive."],
)

spec = Spec(name="image-classifier-v1", requirements=[req])
violations = req.check_quality()
print(f"Quality issues: {len(violations)}")
```

## Development

```bash
# Install all dev dependencies
just install

# Run all checks (lint, typecheck, test with coverage)
just check
```

## License

Apache-2.0. See [LICENSE](LICENSE).
