Metadata-Version: 2.4
Name: syntropy-client
Version: 2.5.0
Summary: Official Python SDK, CLI & MCP Server for Synproof's Syntropy — The Deterministic Dialectical Verification Layer for AI
Home-page: https://synproof.ai
Author: Synproof (Robert Macků)
Author-email: "Synproof (Robert Macků)" <developers@synproof.ai>
License: MIT
Project-URL: Homepage, https://synproof.ai
Project-URL: Documentation, https://synproof.ai/#/docs
Project-URL: AgentSkill, https://synproof.ai/SKILL.md
Project-URL: LLMsTxt, https://synproof.ai/llms-full.txt
Project-URL: API, https://api.synproof.ai/openapi.json
Keywords: syntropy,synproof,ai-verification,formal-logic,epistemic-ai,guardrails,llm-verification,mcp,small-worlds
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Legal Industry
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
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 :: Libraries :: Python Modules
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.24.0
Requires-Dist: websockets>=11.0
Requires-Dist: pydantic>=2.0
Dynamic: author
Dynamic: home-page
Dynamic: requires-python

# Synproof's Syntropy — Official Python SDK, CLI & MCP Server

**Syntropy** (developed by **Synproof** · `https://synproof.ai`) is the deterministic dialectical verification layer for AI (*"AI that has to prove it"*). Instead of returning unverified probabilistic prose, Syntropy puts claims (`thesis`) on formal adversarial trial against immutable domain ground truths (`Small Worlds` and `initial_axioms`) through a 5-sieve dialectical tribunal, SymPy Propositional SAT Solver, and Phan Minh Dung's Grounded Extension semantics.

- **Website & Console:** https://synproof.ai
- **API Base URL:** https://api.synproof.ai
- **Autonomous Agent Skill (`SKILL.md`):** https://synproof.ai/SKILL.md
- **LLM Documentation (`/llms-full.txt`):** https://synproof.ai/llms-full.txt

---

## 1. Installation

```bash
# Install from PyPI (or via Synproof's official PEP 503 index):
pip install syntropy-client --extra-index-url https://synproof.ai/simple

# Or install the wheel directly from synproof.ai:
pip install https://synproof.ai/sdk/syntropy_client-2.5.0-py3-none-any.whl
```

---

## 2. Authentication (Managed Key or Zero-Friction BYOK)

`SyntropyClient` automatically reads credentials from your environment:
- **Managed Mode (`SYNTROPY_API_KEY`):** Pass `syn_mng_...` (from `https://synproof.ai`).
- **Zero-Friction BYOK Mode (`GEMINI_API_KEY` or `OPENROUTER_API_KEY`):** Pass your existing `AIza...` (Google Gemini) or `sk-or-v1-...` (OpenRouter) key — works out-of-the-box!

---

## 3. Python SDK Quickstart (`SyntropyClient`)

```python
from syntropy import SyntropyClient

client = SyntropyClient()  # Reads SYNTROPY_API_KEY, GEMINI_API_KEY, or OPENROUTER_API_KEY

# 1. Verify a thesis against a Small World and/or explicit axioms
verdict = client.debate.verify(
    thesis="A consumer may withdraw from a distance e-shop contract within 14 days without penalty.",
    world="@law:civil-code-obligations",
    initial_axioms=["A consumer has the right to withdraw from a distance contract within 14 days."],
    max_failures=3,
    model_name="gemini-2.5-flash",  # or "anthropic/claude-3.5-sonnet", "deepseek/deepseek-r1"
)

print("Confirmed?", verdict.is_confirmed)          # True / False
print("Status:", verdict.status)                   # "CONFIRMED" | "REFUTED"
print("Winning Thesis:", verdict.winning_thesis)
print("Refuting Argument:", verdict.refuting_argument)

# 2. Discover public Small Worlds & inspect axioms
worlds = client.worlds.list(domain="law")
axioms = client.worlds.get_axioms("@law:civil-code-obligations")
```

---

## 4. Zero-Trust AI Agent Guardrail (`@verify_agent_output`)

```python
from syntropy import SyntropyClient, verify_agent_output, SyntropyGuardrailError

client = SyntropyClient()

@verify_agent_output(
    world="@law:civil-code-obligations",
    client=client,
    on_refuted="raise",          # "raise" | "fallback" | "annotate" | "return_verdict"
    auto_ingest_confirmed=True,  # Optional: auto-saves verified claims to your private Small World
)
async def legal_advisor_agent(user_query: str) -> dict:
    return {"answer": "Every party is obligated to act honestly in legal intercourse."}
```

---

## 5. Command-Line Interface (`syntropy`) & Built-In MCP Server (`syntropy mcp`)

```bash
# Verify a claim directly from the terminal (exit code 0 = CONFIRMED, 2 = REFUTED):
syntropy verify "Total entropy of an isolated system can spontaneously decrease." --world "@physics:conservation-laws-thermo"

# List all verified Small Worlds:
syntropy worlds

# Inspect axioms of a Small World:
syntropy axioms @law:eu-gdpr-data-protection

# Run as a Model Context Protocol (MCP) stdio server for Claude Code, Cursor, or Antigravity:
syntropy mcp
```

### MCP Configuration (`mcp_config.json` / `.cursor/mcp.json` / `claude_desktop_config.json`)
```json
{
  "mcpServers": {
    "synproof-syntropy": {
      "command": "syntropy",
      "args": ["mcp"],
      "env": {
        "SYNTROPY_API_KEY": "syn_mng_..."
      }
    }
  }
}
```
