A Failure Compiler for AI agents: turn failed outputs into lessons, evaluation summaries, and replayable regression cases.
Project description
Entropy Loop Core
A Failure Compiler for AI agents. Turn failed agent outputs into regression cases and replay them before the same bug ships again.
Get started · Example · CLI · Architecture · Releases · Contributing
Star the repo if you want to follow the Failure Compiler roadmap.
Get started
Install from source (a package-index install is planned after stabilization):
git clone https://github.com/koreaelonmusk/entropy-loop-core.git
cd entropy-loop-core
python -m pip install -e ".[dev]"
entropy-loop replay-demo
Works on Windows, macOS, and Linux with Python 3.10+.
Why
AI agents often fail the same way twice.
Entropy Loop Core makes failures reusable: capture the failed output, classify it, compile a lesson, generate a regression case, and replay it — before the same bug ships again.
Task
→ AgentOutput
→ VerificationResult
→ FailureTrace
→ Lesson
→ RegressionCase
→ RegressionSuite
→ Replay
→ Report
The core is deterministic: no LLM calls, no network calls, no hidden state.
Example
Turn a failure into a regression case, then replay it against a fixed agent:
from entropy_loop_core import (
AgentOutput,
FailureTrace,
RegressionRunner,
RegressionSuite,
RetryContext,
Task,
VerificationPolicy,
Verifier,
generate_regression_case,
)
# A verifier built from a policy: non-empty output that contains "status".
verifier = Verifier.from_policy(
VerificationPolicy(require_non_empty=True, required_terms=["status"])
)
# A past failure (the agent omitted "status") becomes a regression case.
task = Task(id="job-1", instruction="report the job status")
bad = AgentOutput(content="done")
case = generate_regression_case(
FailureTrace(
task=task,
output=bad,
verification_result=verifier.verify(bad),
attempt=1,
)
)
# Replay the case against a corrected agent.
def fixed_agent(task: Task, ctx: RetryContext) -> AgentOutput:
return AgentOutput(content="status: ok")
report = RegressionRunner().run_suite(
RegressionSuite(name="job", cases=[case]), fixed_agent, verifier
)
print(report.passed, report.total_cases, report.success_rate) # 1 1 100.0
Full worked example: examples/json_agent_guard.py.
CLI
entropy-loop replay-demo # generate a regression case, then replay it as a suite
entropy-loop demo # run the loop: verify → trace → learn → retry → regress
entropy-loop doctor # health-check the install
What it is / what it is not
It is
- a deterministic failure compiler,
- a structured failure-trace layer,
- a regression replay primitive,
- a small AI-agent reliability tool.
It is not
- a full agent framework,
- model training,
- model-as-judge by default,
- a correctness guarantee,
- a cloud platform.
Architecture
Verifierapplies ordered, deterministic rules and classifies failures.EntropyLoopruns an agent, verifies, traces the failure, compiles a lesson, and retries.LessonGeneratorturns aFailureTraceinto a reusableLesson.generate_regression_casepins a failure as a repeatable check.RegressionRunnerreplays aRegressionSuiteand returns a report.
Deeper reading: architecture · reliability model · research influences · recording the demo.
Public / private boundary
Open-source the primitive, not the private advantage.
This repository contains only generic reliability primitives — no business logic, proprietary prompts, customer data, secrets, external AI API calls, or network calls. See docs/public-private-boundary.md.
Releases
- v0.3.0 — replay (current)
- v0.2.0 — classification + evaluation
- v0.1.0 — the first Failure Compiler loop
Details in CHANGELOG.md.
Roadmap
- v0.3.1 — stabilization / packaging readiness
- v0.4.0 — memory policy / lesson compaction
- Later — persistence adapters and richer reports
Full plan in docs/roadmap.md.
Contributing
Contributions are welcome. Keep the core small, readable, and deterministic, and respect the public/private boundary. See CONTRIBUTING.md and CODE_OF_CONDUCT.md.
ruff check . # lint
ruff format . # format
pytest # tests
License
Released under the Apache-2.0 license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file entropy_loop_core-0.3.1.tar.gz.
File metadata
- Download URL: entropy_loop_core-0.3.1.tar.gz
- Upload date:
- Size: 159.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
872a98ff987ec48dcdefbe77136d4a7e95a4674cbbadcf8d3c3f7b7561a7a5fa
|
|
| MD5 |
6cad6fb655654a2eade940c4c87731be
|
|
| BLAKE2b-256 |
423d10cf641110776cdcc6ee1fb9ebe86f824eab07db4500e2d23b5ff93aa5e0
|
Provenance
The following attestation bundles were made for entropy_loop_core-0.3.1.tar.gz:
Publisher:
publish.yml on koreaelonmusk/entropy-loop-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
entropy_loop_core-0.3.1.tar.gz -
Subject digest:
872a98ff987ec48dcdefbe77136d4a7e95a4674cbbadcf8d3c3f7b7561a7a5fa - Sigstore transparency entry: 2120893914
- Sigstore integration time:
-
Permalink:
koreaelonmusk/entropy-loop-core@9fc9bb21e67f88b41f542d6bf6ccc5698cdbc456 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/koreaelonmusk
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9fc9bb21e67f88b41f542d6bf6ccc5698cdbc456 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file entropy_loop_core-0.3.1-py3-none-any.whl.
File metadata
- Download URL: entropy_loop_core-0.3.1-py3-none-any.whl
- Upload date:
- Size: 26.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47e3c1bbb3c4984a34b4c9beae878b653c6b0b18a96df5446aedaf22e2c45ad2
|
|
| MD5 |
e3764390264d8bd20a071019cee587f8
|
|
| BLAKE2b-256 |
3c0b5fb0bc49dd3d5f5155fefdbd41ef402b726627ce9332f2db7f3fbff76c0e
|
Provenance
The following attestation bundles were made for entropy_loop_core-0.3.1-py3-none-any.whl:
Publisher:
publish.yml on koreaelonmusk/entropy-loop-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
entropy_loop_core-0.3.1-py3-none-any.whl -
Subject digest:
47e3c1bbb3c4984a34b4c9beae878b653c6b0b18a96df5446aedaf22e2c45ad2 - Sigstore transparency entry: 2120894097
- Sigstore integration time:
-
Permalink:
koreaelonmusk/entropy-loop-core@9fc9bb21e67f88b41f542d6bf6ccc5698cdbc456 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/koreaelonmusk
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9fc9bb21e67f88b41f542d6bf6ccc5698cdbc456 -
Trigger Event:
workflow_dispatch
-
Statement type: