Metadata-Version: 2.4
Name: court
Version: 0.3.2
Summary: ⚖️ Fleet court — agent judgment, dispute resolution, and quality scoring
License: MIT
Project-URL: Homepage, https://github.com/cocapn/court
Project-URL: Repository, https://github.com/cocapn/court
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# ⚖️ Court

> Fleet governance — agent judgment, dispute resolution, and quality scoring

Every fleet needs a court. Judge agent actions, track trust scores over time, and review knowledge tiles for quality before they enter PLATO.

## Install

```bash
pip install court
```

## Quick Start

### Judge Actions

```python
from court import Judge

judge = Judge()
verdict = judge.evaluate("oracle1", "submit_tile", {"confidence": 0.92})
print(f"{verdict.severity.value}: {verdict.reason}")
```

### Track Trust

```python
from court import TrustLedger

ledger = TrustLedger()
ledger.record("oracle1", "tile_accepted", delta=0.02, reason="High quality")
ledger.record("oracle1", "tile_rejected", delta=-0.05, reason="Absolute claim")
print(f"Trust: {ledger.trust_score('oracle1'):.2f}")
print(f"Level: {ledger.trust_level('oracle1')}")
```

### Review Tiles

```python
from court import Review

review = Review()
result = review.check_tile({
    "question": "What is X?",
    "answer": "X is always Y.",
    "confidence": 0.5,
})
print(f"{result.status.value}: {result.feedback}")
```

## API Reference

| Class | Purpose |
|-------|---------|
| `Judge` | Evaluate actions → Verdict (severity + score) |
| `TrustLedger` | Track trust scores (0-1) with history |
| `Review` | Check tiles for quality (absolute claims, missing fields) |

## Part of [Cocapn](https://github.com/cocapn) · Agent Infrastructure
