Metadata-Version: 2.4
Name: sas-client
Version: 0.1.0
Summary: Python client and CLI for SAS - Symbiotic Autoprotection System.
Project-URL: Homepage, https://github.com/Leesintheblindmonk1999/SAS
Project-URL: Repository, https://github.com/Leesintheblindmonk1999/sas-client
Project-URL: Documentation, https://sas-api.onrender.com/docs
Project-URL: API, https://sas-api.onrender.com
Project-URL: Landing, https://leesintheblindmonk1999.github.io/sas-landing/
Project-URL: Zenodo, https://doi.org/10.5281/zenodo.19702379
Author-email: Gonzalo Emir Durante <duranteg2@gmail.com>
Maintainer-email: Gonzalo Emir Durante <duranteg2@gmail.com>
License: GPL-3.0-or-later + Durante Invariance License
License-File: LICENSE.md
Keywords: SAS,Symbiotic Autoprotection System,coherence,generative AI,hallucination detection,kappaD,semantic audit
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: twine>=5.0; extra == 'dev'
Description-Content-Type: text/markdown

# sas-client

Python client and CLI for **SAS - Symbiotic Autoprotection System**.

SAS is a structural coherence audit API for generative AI outputs. It exposes operational endpoints for hallucination / semantic rupture detection using the κD = 0.56 threshold.

- Public API: <https://sas-api.onrender.com>
- API docs: <https://sas-api.onrender.com/docs>
- Main repository: <https://github.com/Leesintheblindmonk1999/SAS>
- Landing page: <https://leesintheblindmonk1999.github.io/sas-landing/>
- Zenodo DOI: <https://doi.org/10.5281/zenodo.19702379>

---

## Install

```bash
pip install sas-client
```

For local development from source:

```bash
pip install -e .[dev]
```

---

## Quick Start

```python
from sas_client import SASClient

client = SASClient(api_key="sas_test_key_2026")

result = client.diff(
    text_a="Python is a programming language used for data analysis.",
    text_b="A python is a large tropical snake."
)

print(result["isi"])
print(result["verdict"])
print(result.get("evidence", {}).get("fired_modules"))
```

---

## API Key

The hosted SAS API expects an API key for protected endpoints.

```python
client = SASClient(api_key="sas_test_key_2026")
```

Or use an environment variable:

```bash
export SAS_API_KEY="sas_test_key_2026"
```

Windows PowerShell:

```powershell
$env:SAS_API_KEY="sas_test_key_2026"
```

---

## Usage

### Health

```python
from sas_client import SASClient

client = SASClient()
print(client.health())
```

### Audit one text

```python
from sas_client import SASClient

client = SASClient(api_key="sas_test_key_2026")

result = client.audit(
    "Paris is the capital of France. The Eiffel Tower is located in Berlin."
)

print(result)
```

### Compare two texts

```python
from sas_client import SASClient

client = SASClient(api_key="sas_test_key_2026")

result = client.diff(
    text_a="Python is a programming language commonly used for automation.",
    text_b="A python is a large tropical snake."
)

print(result["isi"])
print(result["verdict"])
```

### Public stats

```python
from sas_client import SASClient

client = SASClient()
print(client.public_stats())
print(client.public_activity(limit=10))
```

---

## CLI

After installation, the `sas` command is available.

```bash
sas health
sas public-stats
sas public-activity --limit 10
sas audit "Paris is the capital of France. The Eiffel Tower is located in Berlin." --api-key sas_test_key_2026
sas diff "Python is a programming language." "A python is a snake." --api-key sas_test_key_2026
```

Override the API URL:

```bash
sas --base-url https://your-sas-instance.example.com health
```

---

## Privacy

This client does not collect telemetry.

Requests are sent only to the configured SAS API base URL.

---

## License

GPL-3.0 + Durante Invariance License.

The SAS framework and κD = 0.56 require attribution to Gonzalo Emir Durante and citation of the public SAS repository / DOI when used for semantic invariance, hallucination detection, or similar structural coherence auditing purposes.
