Metadata-Version: 2.4
Name: qisa-consensus-engine
Version: 0.2.4
Summary: Deterministic multi-perspective consensus engine with fixpoint convergence, auditability, and categorical coherence metrics.
Project-URL: Repository, https://github.com/crasofuentes-hub/qisa-consensus-engine
Project-URL: Documentation, https://github.com/crasofuentes-hub/qisa-consensus-engine/tree/main/docs
Project-URL: Issues, https://github.com/crasofuentes-hub/qisa-consensus-engine/issues
Project-URL: Changelog, https://github.com/crasofuentes-hub/qisa-consensus-engine/blob/main/CHANGELOG.md
Project-URL: Releases, https://github.com/crasofuentes-hub/qisa-consensus-engine/releases
Author: Oscar Fuentes Fernández
License: ﻿MIT License
        
        Copyright (c) 2026 Oscar Fuentes Fernández
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: ai-consensus,auditability,categorical-reasoning,convergence,deterministic-ai,fixpoint,multi-agent-systems,tamper-evident,verifiable-ai
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Security :: Cryptography
Requires-Python: >=3.11
Provides-Extra: dev
Requires-Dist: hypothesis>=6.0; extra == 'dev'
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
Requires-Dist: pytest>=7.4; extra == 'dev'
Requires-Dist: ruff>=0.6.0; extra == 'dev'
Description-Content-Type: text/markdown

﻿[![CI](https://github.com/crasofuentes-hub/qisa-consensus-engine/actions/workflows/ci.yml/badge.svg)](https://github.com/crasofuentes-hub/qisa-consensus-engine/actions/workflows/ci.yml)
[![Coverage](https://img.shields.io/badge/coverage-%E2%89%A570%25-brightgreen)](#coverage)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.18598067.svg)](https://doi.org/10.5281/zenodo.18598067)
[![Python](https://img.shields.io/badge/python-%3E%3D3.11-blue)](https://www.python.org/)
[![Code style: ruff](https://img.shields.io/badge/code%20style-ruff-000000.svg)](https://github.com/astral-sh/ruff)

# QISA Consensus Engine

**Deterministic, auditable multi-perspective consensus** with explicit **fixpoint semantics** and **tamper-evident trace hashing**.

QISA provides a **reference-grade core** for decision systems where **reproducibility, auditability, and determinism** are first-class constraints.

This repository intentionally avoids stochasticity and external services in order to support **verifiable execution** and **post-hoc inspection**.

---

## Key properties

- **Deterministic convergence**  
  Fixpoint iteration converges (or fails fast) under bounded steps.

- **Idempotence**  
  Re-running from a converged state yields the same final state and trace hash.

- **Tamper-evident traces**  
  Each execution step is hash-chained; any post-hoc mutation is detectable.

- **Reproducible benchmarks**  
  Benchmarks emit pinned JSON artifacts plus a generated comparison table.



## What problem does QISA solve?

**QISA (Quantum-Inspired System of AI Consensus)** addresses a core problem in automated decision systems:  
**how to produce reproducible, auditable, and deterministic decisions when multiple perspectives disagree.**

### In five clear points
1. **Deterministic consensus (non-stochastic)** — same inputs, same outputs.
2. **Verifiable audit trail** — hash-chained traces detect tampering.
3. **Fixpoint convergence** — stability via idempotence prevents loops.
4. **Comparable baselines** — reproducible benchmark harness + pinned results.
5. **No external dependencies** — not an LLM, no external services required.

> QISA does not aim to be creative. It aims to be correct, verifiable, and repeatable.

**Quality gate:** CI enforces test coverage (pytest-cov) with a minimum threshold.
---

## Installation

```bash
python -m venv .venv
source .venv/bin/activate  # Windows: .\.venv\Scripts\Activate.ps1
python -m pip install -U pip
python -m pip install -e ".[dev]"

<!-- QISA_META_START -->

## Tools (Trace export + external verification)
- Paper-grade instructions: 	ools/README.md
- Quick demo:
  - Host: python tools\export_trace_demo.py then python tools\verify_trace_json.py tools\_artifacts\trace_demo.json
  - Docker: docker run --rm -v \C:\repos\qisa-consensus-engine:/app qisa-consensus-engine:dev python tools/export_trace_demo.py

## Benchmarks (adversarial)
- Latest results (generated): enchmarks\_results\results.md
- Re-run: python .\benchmarks\bench_adversarial.py

<!-- QISA_META_END -->

