Metadata-Version: 2.4
Name: llm-locc
Version: 1.1.0
Summary: Structured output contract testing for LLM systems
Project-URL: Homepage, https://github.com/<org>/locc
Project-URL: Documentation, https://github.com/<org>/locc#readme
Project-URL: Issues, https://github.com/<org>/locc/issues
License: MIT
License-File: LICENSE
Keywords: ci,contracts,llm,structured-output,testing
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
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 :: Testing
Requires-Python: >=3.10
Requires-Dist: click
Requires-Dist: deepdiff>=6.0
Requires-Dist: jsonschema
Requires-Dist: pydantic>=2.0
Requires-Dist: requests
Provides-Extra: dev
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: pytest-cov; extra == 'dev'
Description-Content-Type: text/markdown

# locc - LLM Output Contract Check

Structured output contract testing for LLM systems.
Define what your LLM must output. locc tells you when it drifts.

## Install

```bash
pip install locc
```

## Quickstart

```bash
locc run \
  --contract examples/contract.json \
  --snapshot examples/snapshot.json \
  --output json
```

## What it checks

- Schema conformance: required fields, types, enum values
- Snapshot diff: what changed between runs
- Contract violations: hard constraints your LLM must satisfy

## Output

Sample JSON artifact:

```json
{
  "status": "FAIL",
  "checks": [
    {
      "name": "schema_conformance",
      "result": "FAIL",
      "reason": "Missing required field: category"
    }
  ],
  "diff": {
    "category": {
      "expected": "billing",
      "actual": null
    }
  }
}
```

## Exit codes

| Code | Meaning |
|---|---|
| 0 | PASS |
| 1 | HOLD |
| 2 | FAIL |

## GitHub Actions

```yaml
- uses: actions/setup-python@v5
  with:
    python-version: "3.11"
- run: pip install locc
- run: |
    locc run \
      --contract contracts/current.json \
      --snapshot snapshots/current.json \
      --output json > locc_result.json
- uses: actions/upload-artifact@v4
  if: always()
  with:
    name: locc-result
    path: locc_result.json
```

## Stack integration

locc is part of the LLM Reliability Stack.
locc output feeds Release Governor for staging-time promotion gating.

| Stage | Component |
|---|---|
| Design-time | PFA |
| CI | **locc** |
| Staging | Release Governor |
| Runtime | EGA |

## License

MIT
