Skip to main content

state-harness 🌀

PyPI Downloads Python Rust Core License: Split BSL/Apache DOI

Lyapunov-stability monitor for multi-turn LLM agents. Detects token spirals, classifies failure patterns, and tells you why a task failed — no extra LLM calls.

from state_harness import GrowthRatioGuard, FailureReport

guard = GrowthRatioGuard(token_budget=50_000)

with guard:
    for turn in agent_loop:
        result = llm.invoke(turn.prompt)
        guard.record_step(tokens_used=result.usage.total_tokens)

# What went wrong? (zero-cost, no LLM calls)
report = FailureReport.from_guard(guard)
print(report)
⚠️  STABILITY TRIPPED at turn 12

Pattern: Context Accumulation Spiral (confidence: 92%)
  • Last 5 turns all exceeded 1.5× baseline (4/4 were accelerating).
  • Peak growth ratio: 5.2× baseline.
  • Without intervention, projected cost was $0.0396 (actual: $0.0039).

Energy: ▁▁▁▁▁▂▂▃▄▆█
  Baseline: 1050 tokens/turn
  Peak ratio: 5.2× baseline

Cost: $0.0039 (saved ~$0.0357 by tripping early)

Suggested actions:
  🔴 1. Enable RG history compression in your agent loop.
     → Compressing older messages reduces prompt tokens by 40-60%.
  🟡 2. Lower the growth ratio threshold to 1.8×.
     → A lower threshold would have caught it earlier.
  🟢 3. Add a sliding-window context strategy.
     → Send only the last N messages plus a summary of earlier ones.

Why this exists

Production multi-agent systems fail at rates of 41–87% (Kore.ai 2026). When an agent spirals — replaying full context, retrying a broken tool, drifting off-task — a budget cap will kill it, but tells you nothing about why.

State-harness monitors token consumption relative to a warmup baseline via a Lyapunov energy function. When the growth ratio exceeds a threshold for W consecutive steps, it trips and classifies the failure pattern (context spiral, retry storm, policy drift) with fix suggestions — from the energy trajectory alone, no LLM calls.

pip install state-harness and wrap your agent loop.

What it catches

Pattern Signal Example
Context Spiral Token growth accelerating beyond baseline Agent replaying full history each turn
Retry Storm Low-variance repeated calls Tool failing, agent retrying identically
Policy Drift VSA similarity score dropping Agent going off-topic mid-conversation
Early Explosion Token spike in first 3 turns Oversized system prompt or tool response
Budget Exhaustion Cumulative spend hits ceiling Complex task, not necessarily broken

Scope and limitations

State-harness does not improve resolve rates. Over three trials a naive budget cap resolved as many tasks or slightly more (multi-trial results below). The value is:

  1. Failure diagnostics — classified failure patterns with actionable fixes, not just "budget exceeded." No extra LLM calls.
  2. Compute efficiency on long loops — 38.6% fewer search nodes and 30% less wall time on SWE-bench by terminating dead-end branches early.

Validated across 3,175 runs (4 benchmarks, 5-condition ablation, multi-trial with bootstrap CIs). Zero false positives in 80 harness runs on 4 local models via Ollama. On SWE-bench (Gemini 2.5 Flash), 10 of the 25 tasks full-stack monitoring stopped had been resolved by the baseline; it still resolved 7 of them. Details in Benchmarks.

When to use this

  • Search-tree agents (MCTS, beam search) — per-branch caps look fine in isolation; tree-level cost explosion is silent.
  • Platform teams at scale — failure classification at the edge, exported as OpenTelemetry attributes.
  • Benchmarking — the ~4pp nondeterminism floor means single-run deltas <8% are noise.

Not needed for chatbots, RAG, single-turn apps, or ReAct loops with <10 turns — max_iterations + budget cap suffice.


Installation

pip install state-harness

Python ≥ 3.10. Pre-built wheels for Linux, macOS, Windows (x86_64 + ARM64). No Rust toolchain needed.

From source (for development)

git clone https://github.com/vishal-dehurdle/state-harness.git
cd state-harness

python -m venv .venv && source .venv/bin/activate

# Install Rust (if not already installed)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

pip install maturin
maturin develop --release

# Run tests
pip install pytest
pytest tests/

Quickstart

GrowthRatioGuard normalizes token usage against a baseline — trips only on disproportionate growth, not natural context-window accumulation.

from state_harness import GrowthRatioGuard, StabilityViolation

guard = GrowthRatioGuard(
    token_budget=100_000,     # hard ceiling
    ratio_threshold=2.0,      # trip when turn is 2× the baseline
    window=3,                 # 3 consecutive escalating turns to trip
    budget_gate=8_000,        # don't trip until 8K tokens spent
)

with guard:
    for turn in agent_loop:
        try:
            result = llm.invoke(turn.prompt)
            guard.record_step(
                tokens_used=result.usage.total_tokens,
                errors=0,
            )
        except StabilityViolation as e:
            print(f"Agent killed: {e}")
            break

print(f"Total cost: {guard.total_tokens} tokens")
print(f"Baseline: {guard.baseline} tokens/turn")
print(f"Peak ratio: {guard.current_ratio}×")

Failure Diagnostics

After any execution (tripped or not):

from state_harness import FailureReport

report = FailureReport.from_guard(guard, model="gemini-2.5-flash")

# Human-readable terminal output
print(report)

# Structured dict for logging / dashboards
import json
print(json.dumps(report.to_dict(), indent=2))

Classifies the failure pattern, provides evidence, estimates cost, and suggests fixes — no LLM calls.

Classic: BoundaryGuard

For lower-level control using raw token counts (no normalization):

from state_harness import BoundaryGuard

with BoundaryGuard(token_budget=100_000, lambda_=1.0, window=5) as guard:
    for turn in agent_loop:
        result = llm.invoke(turn.prompt)
        guard.record_step(
            tokens_used=result.usage.total_tokens,
            errors=0,
            tool_name="search",
        )

Decorator: @boundary_guard

from state_harness import boundary_guard

@boundary_guard(
    token_budget=50_000,
    token_counter=lambda r: r.usage.total_tokens,
)
def agent_step(prompt: str):
    return llm.invoke(prompt)

Framework Integration

from langgraph.prebuilt import create_react_agent
from state_harness.adapters import monitor_graph

agent = create_react_agent(model, tools=[search, calculate])
safe = monitor_graph(agent, token_budget=100_000)

result = safe.invoke({"messages": [("user", "Fix the login bug")]})

# After execution — always available:
print(safe.total_tokens)  # cumulative usage
print(safe.tripped)       # did stability trip?
print(safe.report)        # full FailureReport with pattern + suggestions

For streaming:

for chunk in safe.stream({"messages": [("user", "Refactor this module")]}):
    print(chunk)

With a trip callback (e.g., for Slack alerts):

safe = monitor_graph(
    agent,
    token_budget=100_000,
    on_trip=lambda report: slack.send(f"Agent tripped: {report.pattern}"),
)
Advanced: per-tool wrapping with LangGraphMiddleware
from state_harness import BoundaryGuard
from state_harness.adapters import LangGraphMiddleware

guard = BoundaryGuard(token_budget=150_000)
middleware = LangGraphMiddleware(guard)

@middleware.wrap_tool
def search_database(query: str):
    return db.search(query)

with guard:
    result = agent.invoke({"messages": [...]})

CrewAI

from crewai import Agent, Task, Crew
from state_harness.adapters import CrewAICallback

callback = CrewAICallback(token_budget=200_000)

crew = Crew(
    agents=[researcher, writer],
    tasks=[research_task, write_task],
    step_callback=callback.step_callback,
    task_callback=callback.task_callback,
)

result = crew.kickoff()
print(callback.report)  # FailureReport
callback.close()

Vanilla Python Hooks

from state_harness import BoundaryGuard
from state_harness.adapters import VanillaHook

guard = BoundaryGuard(token_budget=50_000)
hook = VanillaHook(guard)

with guard:
    for step in agent_loop:
        hook.before_call(tool_name="search")
        result = execute_tool(step)
        hook.after_call(tokens_used=result.tokens)

CLI

# Simulate a token trajectory — see what the guard would do
state-harness simulate 1000 1200 1500 2000 3000 5000 8000 --budget 50000

# Analyze a saved report
state-harness analyze report.json
state-harness analyze report.json --json    # JSON output
state-harness analyze report.json --otel    # OpenTelemetry attributes

# Batch analyze all reports in a directory
state-harness batch --dir ./reports/ --output results.csv

Structured Output

FailureReport supports multiple output formats:

report = FailureReport.from_guard(guard)

# JSON (for logging, APIs, storage)
report.to_json()            # pretty-printed
report.to_json(indent=None) # compact, single line

# CSV (for batch analysis of 1000s of runs)
with open("results.csv", "w") as f:
    f.write(FailureReport.csv_header() + "\n")
    for r in reports:
        f.write(r.to_csv_row() + "\n")

# OpenTelemetry (for Datadog, Grafana, Honeycomb)
from opentelemetry import trace
span = trace.get_current_span()
span.set_attributes(report.to_otel_attributes())
# Adds: state_harness.pattern, state_harness.confidence, etc.

Architecture

Three mechanisms, implemented in Rust (via PyO3):

graph TD
    A["Agent Loop"] --> B["GrowthRatioGuard\n(Python SDK)"]
    B --> |"Normalizes tokens → growth ratio\nWarmup baseline · Budget gate"| C{" "}
    C --> D["Lyapunov Monitor\nV(k) = S + λθ\nΔV ≥ 0?"]
    C --> E["RG Decimator\nTF-IDF\nCompression"]
    C --> F["Holographic Engine\n(VSA)\nDrift Detection"]
    
    style D fill:#1a1a1a,stroke:#555,color:#e8e8e8
    style E fill:#1a1a1a,stroke:#555,color:#e8e8e8
    style F fill:#1a1a1a,stroke:#555,color:#e8e8e8
    style B fill:#0d1117,stroke:#30363d,color:#e6edf3
Component Purpose Speed
Lyapunov Monitor Tracks energy derivative ΔV(k). Trips when ΔV ≥ 0 for W consecutive steps. ~1μs/step
RG Decimator RG-inspired decimation of conversation history (TF-IDF scoring). Retains structurally important messages. ~100µs/compress
Holographic Engine VSA-based policy drift detection. Binds domain invariants to high-dimensional vectors. ~10μs/check

Benchmarks

5-condition ablation across 4 benchmarks (3,175 total runs). Full methodology in the research paper.

Ablation Conditions

Condition Lyapunov RG Decimation VSA Dual-Gate Description
A. Baseline — — — Unmonitored agent
B. Lyapunov-only ✅ — — Energy monitoring, no intervention
C. Lyapunov+RG ✅ ✅ — + history compression on violation
D. Full-stack ✅ ✅ ✅ + policy drift gating
E. Naive Cap — — — Hard budget cap (control)

Summary

Benchmark Runs Stability Trips Cost Savings (D vs A) Resolve-Rate Δ Diagnostics
MINT (reasoning + coding) 1,136 0 ~0% −0.7pp (noise) N/A (no trips)
τ³-bench (customer service) 750 0 8.1% −10pp (+2pp in an earlier run) N/A (no trips)
SWE-bench Verified (coding) 333 + 148 87 / 148 D runs (59%) 38.6% (nodes) −4.5pp (not significant, p = 0.28) Pattern classification
Custom Local (4 models) 240 3 (true pos.) 15.2% 0pp Pattern classification
MINT Local (Qwen3:4B) 568 0 ~0% +1.8pp N/A (no trips)

Resolve-rate deltas fall within LLM nondeterminism (~4pp stdev on SWE-bench; up to 10pp between identical re-runs on τ³-bench). No trips on short/medium loops (1,886 runs). Savings concentrate on long-loop search trees.

SWE-bench Verified (central result)

37 Django instances, SWE-bench Verified. Agent: moatless-tools SearchTree, 50-node budget. Model: Gemini 2.5 Flash.

Single-trial ablation (148 runs)

Condition Resolved Rate Total Nodes Wall Time Nodes/Resolve
A. Baseline 15 / 37 40.5% 945 80 min 63.0
B. Lyapunov 16 / 37 43.2% 620 69 min 38.8
D. Full-stack 14 / 37 37.8% 580 56 min 41.4
E. Naive Cap 21 / 37 56.8% 876 77 min 41.7

Note: Single-trial resolve rates have ~±8pp standard error. E's apparent 56.8% is not statistically significant vs A's 40.5%. Multi-trial results below confirm this.

Full-stack monitoring: 38.6% fewer nodes (945 → 580), 30% less wall time (80 → 56 min). Baseline had 7 tasks burning the full 50-node budget (all failed); with monitoring, zero hit ceiling. Lyapunov alone (Condition B, ~5 lines of code) delivers ~90% of the savings.

Ablation — each mechanism contributes independently:

Layer Added Compute (nodes) Δ vs Baseline Cumulative Reduction
A. No monitoring 945 — —
B. + Lyapunov 620 −325 34.4%
D. + RG + VSA 580 −40 38.6%

Lyapunov alone delivers ~90% of the benefit. RG and VSA add incremental value.

Multi-trial validation (333 runs)

3 trials per condition (A, D, E) across all 37 instances — 333 total runs. 12 runs hung in Docker (28+ min) without a logged result. Each run's result is taken from its evaluation record, which marks 5 of those 12 resolved; the other 7 count as failures:

Condition Trial 1 Trial 2 Trial 3 Mean ± σ
A. Baseline 19/37 (51.4%) 16/37 (43.2%) 16/37 (43.2%) 45.9% ± 4.7%
D. Full-stack 15/37 (40.5%) 17/37 (45.9%) 14/37 (37.8%) 41.4% ± 4.1%
E. Naive Cap 19/37 (51.4%) 17/37 (45.9%) 17/37 (45.9%) 47.7% ± 3.1%

Spread of condition means (3.3%) < within-condition nondeterminism (4.0%). A−D (−4.5pp) is about one stdev and not significant (Welch p = 0.28).

The ~4% within-condition stdev is larger than the trial-to-trial spread on τ³-bench (1.2–5.0pp by condition). Single-run deltas <8% are unreliable.

Bootstrap CIs (10,000 resamples) and Welch's t-tests: A−D = +4.5pp [−0.9, +9.9], p ≈ 0.28; A−E = −1.8pp [−6.3, +3.6], p ≈ 0.61; D−E = −6.3pp [−10.8, −1.8], p ≈ 0.11. D−E is the one gap whose bootstrap CI excludes zero: a possible small cost of full-stack monitoring relative to a naive cap, which more trials should test. Full analysis in paper §7.3.1.

τ³-bench Airline (non-invasiveness confirmation)

50 tasks × 3 trials × 5 conditions = 750 total runs. Agent handles airline reservations via tool calls. Model: Gemini 2.5 Flash. Concurrency=1.

Condition Trial Pass Rate Task Pass (maj) Rate Cost Cost Δ
A. Baseline 99/150 66.0% 35/50 70.0% $2.47 —
B. Lyapunov-only 83/150 55.3% 28/50 56.0% $2.42 −2.0%
C. Lyapunov+RG 79/150 52.7% 26/50 52.0% $1.69 −31.8%
D. Full-stack 86/150 57.3% 30/50 60.0% $2.28 −8.1%
E. Naive Cap 81/150 54.0% 26/50 52.0% $2.33 −5.7%

Key findings:

  • Zero stability trips across 750 runs. All airline tasks classified as stable; no interventions.
  • Pass-rate variance is nondeterminism. Naive cap (E, zero monitoring) drops −18pp from baseline — worse than full-stack (D, −10pp). The ~10–18pp spread is intrinsic variance.
  • 24–34% of tasks flip pass/fail within the same condition across trials (28% on average). Across three identical runs the baseline's majority pass rate was 70%, 62% and 60%, and D−A was −10pp in this run and +2pp in an earlier one.
  • 8.1% cost savings from passive monitoring (zero interventions).

MINT (non-invasiveness validation)

284 tasks × 4 conditions = 1,136 total runs across GSM8K (48), MATH (100), HumanEval (45), MBPP (91). Agent uses up to 5 turns per task.

Condition GSM8K MATH Total Tokens
A. Baseline 91.7% 39.0% 29.2% 1,909,582
B. Lyapunov 91.7% 41.0% 29.9% 1,904,421
C. Lyapunov+RG 89.6% 37.0% 28.2% 1,910,926
D. Full-stack 87.5% 39.0% 28.5% 1,949,708

Zero stability violations across 1,136 runs. Token usage invariant (<2% overhead).

Failed tasks cost disproportionately more:

Task Success Avg Failure Avg Ratio
GSM8K 2,613 tok 8,857 tok 3.4×
MATH 5,154 tok 8,188 tok 1.6×

HumanEval and MBPP show 0% across all conditions — a MINT framework limitation in code execution evaluation, consistent across conditions (harness does not introduce new failure modes).

Local Model Validation (edge deployment)

20 custom tasks (5 easy, 10 medium, 5 hard) × 4 models × 3 conditions = 240 runs. Hardware: Apple M4 MacBook Pro, 16 GB RAM, Ollama local inference.

Model Size Baseline Harness Naive Cap Token Savings FP
Llama 3.2:3B 2.0 GB 45% 45% 60% 1.2% 0
Phi-4-Mini 2.5 GB 30% 30% 40% 20.7% 0
Qwen3:4B 2.5 GB 30% 30% 40% 0.9% 0
Gemma4:E4B 9.6 GB 35% 35% 70% 37.9% 0

Key findings:

  • Zero false positives across 80 harness runs — 4 model families, 3 difficulty tiers, same threshold for all. The monitor tripped 3 times, all on Llama 3.2:3B and all on tasks the baseline also failed; it never tripped on the other three models.
  • Small-model self-sabotage: Naive cap beats baseline by +17.5pp avg (+12.5pp median). Small models solve early turns correctly, then destroy solutions in later turns. Strongest on Gemma4:E4B (+35pp).
  • Model-family behavioral signatures:
    • Llama 3.2:3B: Classic spirals (ratios: 2.3×, 5.9×, 7.6×) — 3 true-positive trips
    • Phi-4-Mini: Spike-and-recover — 20.7% passive savings
    • Qwen3:4B: 255K tokens but flat ratios (≤1.06×) — stable despite 3× volume
    • Gemma4:E4B: Decreasing ratios — 37.9% passive savings, zero trips

Deploying ≤4B models via Ollama? State-harness works out of the box (zero false positives). The self-sabotage finding suggests adding a turn limit (2–3 turns) for open-ended code generation.

MINT on Qwen3:4B (568 runs)

Task Harness (max=5) Naive Cap (max=2) Δ
GSM8K 37.5% 27.1% +10.4pp
MATH 0.0% 0.0% —
HumanEval 11.1% 11.1% —
MBPP 14.3% 14.3% —
Total 12.7% 10.9% +1.8pp

Zero interventions across 284 tasks. With max 5 turns and W=3, the monitor cannot trigger within available post-warmup turns — a structural guarantee.

Reproducing the benchmarks

Full reproduction steps (all three benchmarks)
# 1. Clone repos
git clone https://github.com/vishal-dehurdle/state-harness.git
git clone https://github.com/sierra-research/tau-bench.git tau3-bench

# 2. Install state-harness
cd state-harness
python -m venv .venv && source .venv/bin/activate
pip install maturin && maturin develop --release

# 3. Install τ³-bench (with state-harness agent)
cd ../tau3-bench
uv sync
cp ../state-harness/tau3_integration/harness_agent.py src/tau2/agent/
cp ../state-harness/tau3_integration/naive_cap_agent.py src/tau2/agent/

# 4. Configure Vertex AI
export GOOGLE_CLOUD_PROJECT=your-project-id
export VERTEXAI_LOCATION=asia-south1

# 5. Run τ³ 5-phase benchmark
bash benchmarks/tau3/run_5phase_airline.sh

# 6. Run SWE-bench (requires Docker images)
bash benchmarks/swe_bench/run_benchmark.sh
bash benchmarks/swe_bench/run_benchmark_dbe.sh

# 7. Run MINT
bash benchmarks/mint/run_mint_fullstack.sh

Ablation conditions are controlled via environment variables:

Variable Values Effect
HARNESS_RG on / off Enable/disable RG history compression
HARNESS_VSA on / off Enable/disable VSA policy drift detection
HARNESS_RATIO_THRESHOLD float (e.g., 2.0) Override growth ratio threshold
HARNESS_BUDGET_GATE int (e.g., 8000) Override minimum spend before trip

See benchmarks/ for setup, configs, and reproduction instructions.

Future evaluations

  • Multi-trial SWE-bench — 333 runs (3 trials × 3 conditions × 37 instances) finding no significant resolve-rate change from monitoring (A−D −4.5pp, p = 0.28)
  • Local model validation — 240 runs across 4 open-weight models (Llama, Phi, Qwen, Gemma) + 568 MINT runs on Qwen3:4B
  • Terminal-Bench — Terminal-based agent tasks; command-line tool loops where spirals manifest as repeated failed commands
  • SWE-bench Pro — Harder, contamination-resistant variant of SWE-bench
  • Cross-model validation — full runs on Gemini 2.5 Flash + Llama 3.2:3B, Phi-4-Mini, Qwen3:4B, Gemma4:E4B; GPT-4o-mini and Claude Haiku 4.5 smoke-tested only (8 runs, no trips, 0 of 2 spirals caught)

Known limitations

  1. 37 SWE-bench instances — A larger sample would improve statistical power (n=3 trials gives limited degrees of freedom for t-tests).
  2. No causal intervention — The harness currently kills spiraling tasks. Redirect/repair is on the roadmap.
  3. Physics-inspired, not physics-equivalent — Terms like "Renormalization Group" and "Lyapunov stability" are used as structural inspirations. The mathematical mapping is analogical, not isomorphic.
  4. Custom benchmark scale — The 20-task local battery is smaller than standard benchmarks. The self-sabotage finding (mean +17.5pp, median +12.5pp) is consistent across 4 models but requires larger-scale replication.

Configuration Guide

Parameter Default Description
token_budget 100,000 Hard ceiling on cumulative tokens
ratio_threshold 2.0 Growth ratio above which a turn counts as "escalating" (domain-tuned: airline=2.0, retail=2.5, telecom=2.0)
window 3 Consecutive escalating turns before circuit breaker trips
warmup_turns 3 Turns used to establish baseline (no monitoring during warmup)
budget_gate 8,000 Minimum cumulative tokens before the monitor can trip (retail: 12,000)
lambda_ 1.0 Error weighting in the Lyapunov energy function

Environment variable overrides (highest precedence, for threshold sweeps):

Env Var Description
HARNESS_RATIO_THRESHOLD Override ratio_threshold (e.g., 2.5)
HARNESS_BUDGET_GATE Override budget_gate (e.g., 12000)

Tuning tips:

  • More aggressive (catch spirals earlier): ratio_threshold=1.8, window=2
  • More conservative (fewer false positives): ratio_threshold=2.5, window=3
  • High-value tasks: Increase budget_gate to 20K+ to let expensive tasks run longer
  • Complex domains (retail, multi-tool): Start with ratio_threshold=2.5

Theoretical Foundations

  • Lyapunov stability: V(k) = S(k) + λθ(k) models token consumption as a dynamical system. ΔV ≥ 0 for W consecutive steps → unstable.
  • Renormalization Group (RG): Message compression via coarse-graining — eliminates high-frequency noise, preserves scale-invariant task objectives.
  • Vector Symbolic Architecture (VSA): Domain policies bound to high-dimensional bipolar vectors (10,000-d, i8), enabling constant-time drift detection outside the LLM context window.

Research

Implements the framework from:

Empirical Lyapunov Stability: Growth-Ratio Energy Functions as Leading Indicators of Agent Task Failure Vishal Verma, 2026 DOI Read the full paper →

Full ablation, multi-trial validation, local-model results, and failure taxonomy. Key results reproduced in Benchmarks above.

Citation

If you use this library or refer to these findings in your research, please cite the preprint:

@misc{verma2026empirical,
  author       = {Verma, Vishal},
  title        = {Empirical Lyapunov Stability: Growth-Ratio Energy Functions as Leading Indicators of Agent Task Failure},
  month        = jun,
  year         = 2026,
  publisher    = {Zenodo},
  version      = {1.0.0},
  doi          = {10.5281/zenodo.20722987},
  url          = {https://doi.org/10.5281/zenodo.20722987}
}

Based on the theoretical framework from:

The Fluid Dynamics of Multi-Agent AI: Resolving d'Alembert's Paradox of Generative Workflows Vishal Verma, 2026 Read →


Contributing

See CONTRIBUTING.md for dev setup, code style, and PR guidelines.


Roadmap

  • Adaptive threshold — Auto-tune τ based on task complexity signal from early turns
  • Causal intervention — Instead of killing spiraling tasks, redirect them (prompt injection, tool restriction)
  • Streaming support — Token-level monitoring for streaming LLM responses
  • Multi-model validation — Gemini 2.5 Flash + 4 local models via Ollama; GPT-4o-mini and Claude Haiku 4.5 smoke-tested only (8 runs)
  • Dashboard / observability — Optional lightweight UI for monitoring energy trajectories in real-time

Security

See SECURITY.md. Do not open public issues for security reports.


License

Split-core licensing:

Component License Notes
Rust Core (src/) BSL 1.1 Free for non-commercial + ARR < $1M. Converts to Apache 2.0 on May 26, 2030.
Python SDK (python/) Apache 2.0 Fully permissive.

See LICENSE.md for full details.

Metadata

Release files for state-harness 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for state-harness 0.3.1
File Size Uploaded Provenance Actions
state_harness-0.3.1.tar.gz 158.8 kB With provenance Details for state_harness-0.3.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for state-harness 0.3.1
File Actions
state_harness-0.3.1-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for state_harness-0.3.1-cp312-cp312-win_amd64.whl
state_harness-0.3.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details for state_harness-0.3.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
state_harness-0.3.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ ARM64 Details for state_harness-0.3.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
state_harness-0.3.1-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for state_harness-0.3.1-cp312-cp312-macosx_11_0_arm64.whl
state_harness-0.3.1-cp312-cp312-macosx_10_12_x86_64.whl CPython 3.12 CPython 3.12 macOS 10.12+ x86-64 Details for state_harness-0.3.1-cp312-cp312-macosx_10_12_x86_64.whl
state_harness-0.3.1-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for state_harness-0.3.1-cp311-cp311-win_amd64.whl
state_harness-0.3.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details for state_harness-0.3.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
state_harness-0.3.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ ARM64 Details for state_harness-0.3.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
state_harness-0.3.1-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details for state_harness-0.3.1-cp311-cp311-macosx_11_0_arm64.whl
state_harness-0.3.1-cp311-cp311-macosx_10_12_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.12+ x86-64 Details for state_harness-0.3.1-cp311-cp311-macosx_10_12_x86_64.whl
state_harness-0.3.1-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for state_harness-0.3.1-cp310-cp310-win_amd64.whl
state_harness-0.3.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details for state_harness-0.3.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
state_harness-0.3.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ ARM64 Details for state_harness-0.3.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
state_harness-0.3.1-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details for state_harness-0.3.1-cp310-cp310-macosx_11_0_arm64.whl
state_harness-0.3.1-cp310-cp310-macosx_10_12_x86_64.whl CPython 3.10 CPython 3.10 macOS 10.12+ x86-64 Details for state_harness-0.3.1-cp310-cp310-macosx_10_12_x86_64.whl

Total release size: 5.9 MB

Release files / state_harness-0.3.1.tar.gz

Download URL state_harness-0.3.1.tar.gz
Size 158.8 kB
Tags Source
SHA-256 checksum
How to use checksums
89dd37bd1126cee61c214f5ef224da87449440d8dd70507bed26b895af0b2bf0
BLAKE2b-256 checksum
How to use checksums
5b7466ac22abbdc212d9a400549368cfb544ae7f9be860a0631df55bc85136f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / state_harness-0.3.1-cp312-cp312-win_amd64.whl

Download URL state_harness-0.3.1-cp312-cp312-win_amd64.whl
Size 279.0 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
ef376e0a163da92ee25dba977d8aa8600097ff6ce22dec173e375710a4514305
BLAKE2b-256 checksum
How to use checksums
7ee1e1067efa83b41889b277f1e214021776e524c907c905ec1b79c895b2280b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / state_harness-0.3.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL state_harness-0.3.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 428.5 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
b0e8c0cae0c72b60915a01f830aa51f72f7a12f0f461d74358ac5292aa5a506b
BLAKE2b-256 checksum
How to use checksums
7d77ca73c9aae24de03851bd6edcfc31eb388deb3561d56b1e16e1e372005295
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / state_harness-0.3.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL state_harness-0.3.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 424.5 kB
Tags CPython 3.12 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
546b8502278a0d55e16e68ee403bfbb25fef82706f0ca90c27ec42db5a134bd3
BLAKE2b-256 checksum
How to use checksums
352c022cef47559e558aba98d312724ab27e67f0b918ea6d5edb4d871be7e794
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / state_harness-0.3.1-cp312-cp312-macosx_11_0_arm64.whl

Download URL state_harness-0.3.1-cp312-cp312-macosx_11_0_arm64.whl
Size 379.4 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
6a2f6bbfe63366d3b42669b62045bf7005247779f08d63f012b2283f00b90065
BLAKE2b-256 checksum
How to use checksums
7456f929053716e32045382df1685d6a6c68ab17b95f9b1f1487d1f48808e0fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / state_harness-0.3.1-cp312-cp312-macosx_10_12_x86_64.whl

Download URL state_harness-0.3.1-cp312-cp312-macosx_10_12_x86_64.whl
Size 384.4 kB
Tags CPython 3.12 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
8ffaeae2d74b71ba5df0c56ccb5e961c129e40bf40f7139302a2be509321180f
BLAKE2b-256 checksum
How to use checksums
39936470d937287fcc3375e6cde6ae2c64b6f1810288f114a8c679ecd0546878
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / state_harness-0.3.1-cp311-cp311-win_amd64.whl

Download URL state_harness-0.3.1-cp311-cp311-win_amd64.whl
Size 280.1 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
c6fd5bca46bc37a458586eee2a6991dd073a2f0265255b8974ccb3c7b4598c6b
BLAKE2b-256 checksum
How to use checksums
fae4137eb65ed8a5a0502d233149ec81071256361a1eb2e81760426c7a2f4ae4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / state_harness-0.3.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL state_harness-0.3.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 428.9 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
feac8a490df1aab3212d9ee6e1a917744aa31afad51e5262865e1757badb0bc6
BLAKE2b-256 checksum
How to use checksums
9e27bfdfbb5051039ce78ffbc3e4033fcb691d6de72880407e35c7acbc811e5b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / state_harness-0.3.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL state_harness-0.3.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 425.6 kB
Tags CPython 3.11 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
3784b0f9401d3c6fc1e5acac172a3bd10b689e124f5d49c216c15bc4cbcfb914
BLAKE2b-256 checksum
How to use checksums
ffdd481621aa9b6d6df52e519b1027056c5a4961a5e3af22f6da14f969611dc9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / state_harness-0.3.1-cp311-cp311-macosx_11_0_arm64.whl

Download URL state_harness-0.3.1-cp311-cp311-macosx_11_0_arm64.whl
Size 380.0 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
7be118f3bd350fad3e62686328e450d0e6b8212d9bdcd844675b25c89d7fcee0
BLAKE2b-256 checksum
How to use checksums
f002bda87801a1bde2ec992e33399995916e71c556a94594231222b462327931
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / state_harness-0.3.1-cp311-cp311-macosx_10_12_x86_64.whl

Download URL state_harness-0.3.1-cp311-cp311-macosx_10_12_x86_64.whl
Size 386.0 kB
Tags CPython 3.11 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
dcf11714743972595621633901b768ce00a9ebb626e2ea333f5959430fa6717b
BLAKE2b-256 checksum
How to use checksums
e541f9cc9a34b565e95d8e894b6371a408b21c4b9ccbaa1b96e66b0a4e535cde
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / state_harness-0.3.1-cp310-cp310-win_amd64.whl

Download URL state_harness-0.3.1-cp310-cp310-win_amd64.whl
Size 281.9 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
8bcec0d8d60c2ebfba32d73fc25b155356dc5ac600ae91dde29acfd6a2694642
BLAKE2b-256 checksum
How to use checksums
54608d5e7198bdfefc7f88a16e71e735e501c409c98e4d6f8eabccbb4ce861a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / state_harness-0.3.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL state_harness-0.3.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 431.4 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
fa4cbe0a69cf484d6a75e94de42e9e81c74449f3b609172621db80402dbdf40b
BLAKE2b-256 checksum
How to use checksums
370dd907528dc2e2e4d38c9eeb9a229b4c712cb50849b646626e0bc361194428
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / state_harness-0.3.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL state_harness-0.3.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 425.5 kB
Tags CPython 3.10 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
ba93b425ff5393da01bf3828084a5cf72f4a24764f0072e696f9c6209016d50e
BLAKE2b-256 checksum
How to use checksums
63be4dd3298e9108f9dfd46bf5dc6ef3caf587b0d690adfdc1d42711e5c27a97
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / state_harness-0.3.1-cp310-cp310-macosx_11_0_arm64.whl

Download URL state_harness-0.3.1-cp310-cp310-macosx_11_0_arm64.whl
Size 381.8 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
82f74152b76793c01de79ebac07a38ccf0a91ef873cec2394cbfa1ebd0ad1285
BLAKE2b-256 checksum
How to use checksums
09a6735c8e70a187a838c7743d4db05875fa14ad78240d02d0a6db3ce21d2e05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / state_harness-0.3.1-cp310-cp310-macosx_10_12_x86_64.whl

Download URL state_harness-0.3.1-cp310-cp310-macosx_10_12_x86_64.whl
Size 387.8 kB
Tags CPython 3.10 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
e95f0723e28359942cce7ebb5ecffc6c17fb9ed96a72581adb595b5eec41865f
BLAKE2b-256 checksum
How to use checksums
18a942cdd08352e298de9452a946e8c103de49fae4bb1c7c6139eddbc48fcce0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Security for state-harness 0.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 16 files in this release have been uploaded with provenance metadata.

Select from 16 files

Attestation for state_harness-0.3.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page