Metadata-Version: 2.4
Name: provadyne-engine
Version: 0.3.0
Summary: Provadyne — MISRA C:2012 analysis and ISO 26262 traceability engine
Author: sgchoi
License: MIT
Project-URL: Homepage, https://github.com/sgchoi/provadyne
Project-URL: Repository, https://github.com/sgchoi/provadyne
Keywords: misra,iso-26262,automotive,functional-safety,cppcheck,embedded
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Quality Assurance
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: fastapi
Requires-Dist: uvicorn
Requires-Dist: tree-sitter
Requires-Dist: tree-sitter-c
Requires-Dist: tree-sitter-cpp
Requires-Dist: reportlab
Requires-Dist: openpyxl
Requires-Dist: PyYAML>=6.0
Requires-Dist: httpx>=0.27
Provides-Extra: llm-api
Requires-Dist: openai>=1.0; extra == "llm-api"
Requires-Dist: anthropic>=0.30; extra == "llm-api"
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-asyncio; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: respx; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"

# provadyne-engine

The Python analysis engine behind [Provadyne](https://github.com/sgchoi/provadyne)
— MISRA C:2012 violation detection (via cppcheck), ISO 26262-6 rule mapping,
PDF report generation, and optional LLM fix suggestions.

This package is the shared core used by the Provadyne daemon, the GitHub
Action, and the IDE extensions. It is normally driven through the daemon, but
the modules are runnable directly.

## Requirements

- Python 3.11+
- [`cppcheck`](https://cppcheck.sourceforge.io/) 2.x on the `PATH` (provides the
  MISRA addon). Install via `brew install cppcheck` / `apt-get install cppcheck`.

## Install

```bash
pip install provadyne-engine
# optional: external LLM providers for fix suggestions
pip install "provadyne-engine[llm-api]"
```

## Usage

```bash
# Single file — exits 1 when violations are found, 0 when clean, 2 on error.
python -m engine.misra.checker path/to/source.c

# Multiple files, aggregated batch envelope
python -m engine.misra.checker --batch src/*.c

# Console-script equivalents (installed with the package)
provadyne-misra path/to/source.c
provadyne-stubgen --help
```

Output is JSON on stdout:

```json
{
  "file_path": "/abs/path/source.c",
  "violations": [
    { "rule": "11.3", "severity": "required", "line": 9, "column": 6,
      "message": "Cast shall not be performed between pointer to object and pointer to different object type",
      "suggestion": null }
  ],
  "summary": { "total": 1, "required": 1, "advisory": 0, "mandatory": 0 },
  "analyzed_at": "2026-05-29T05:37:40Z",
  "engine_version": "0.1.0",
  "cppcheck_version": "2.20.0"
}
```

## License

MIT.
