Metadata-Version: 2.4
Name: agent-test-loop
Version: 1.0.0
Summary: Deterministic critic for AI agents: runs weighed checks for real, scores 0-100 and blocks delivery below the threshold.
Author: Samuel Medeiros
License: MIT
Project-URL: Homepage, https://skills.seu.pet/en/p/ai-test-loop?utm_source=pypi&utm_medium=readme&utm_campaign=ai-test-loop
Project-URL: Repository, https://github.com/Samuelfmedeiros/ai-test-loop
Keywords: ai-agents,test-loop,quality-gate,critic,llm
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Dynamic: license-file

# agent-test-loop

Your agent says "done". This makes it prove it.

`agent-test-loop` is a **deterministic critic**: it runs the checks you declare (tests, build, lint,
a health endpoint, a secrets scan), captures the real output as evidence, and prints a score from
0 to 100. Below the threshold, delivery is blocked. No model calls, no network, no telemetry —
stdlib only.

## Install

```bash
pip install agent-test-loop
```

## Use

```bash
agent-test-loop --config loop.json
```

`loop.json`:

```json
{
  "name": "my-project",
  "threshold": 85,
  "max_rounds": 8,
  "checks": [
    {"name": "unit tests", "cmd": "pytest -q", "weight": 40, "timeout_s": 900},
    {"name": "build", "cmd": "npm run build", "weight": 25, "timeout_s": 600},
    {"name": "lint", "cmd": "ruff check .", "weight": 10},
    {"name": "no secrets", "cmd": "gitleaks detect --no-banner", "weight": 15,
     "fail_if_output_matches": "leaks found: [1-9]"},
    {"name": "api responds", "cmd": "curl -sS localhost:8000/health", "weight": 10,
     "must_match": "\"status\"\\s*:\\s*\"ok\""}
  ]
}
```

Output:

```
SCORE=100
GAPS=[]
EVIDENCE=.loop/round-1.json
```

Useful flags: `--dry-run` (validate the config without running), `--quiet` (only the three lines
above), `--json` (full report), `--show-state` (last round from `.loop/`).

## What it does not do

It does not judge code quality, style, or intent — it measures whether the commands you declared
actually pass. That is the point: the agent that wrote the code is not allowed to grade itself.

## Need the full gate?

Visual diff that does not produce false positives, MCP handshake preflight, GPU training guard and
the delivery-proof ebook:

- Full pack — https://skills.seu.pet/en/p/pack-completo?utm_source=pypi&utm_medium=readme&utm_campaign=agent-test-loop
- Guided setup, first cycle run together — https://skills.seu.pet/en/service?utm_source=pypi&utm_medium=readme&utm_campaign=agent-test-loop

MIT licensed.
