szl-ouroboros — bounded-loop trace + loop-tax decomposition, offline

kernel tests Λ license

🟩 Kernel + REAL trained surrogate. The governance kernel (pure-Python, stdlib-only) is UNCHANGED and remains the sole ground truth — it reconstructs the a11oy agent-loop trace and its loop-tax decomposition from a run's provider-attempt windows (sums, max, subtraction only). Since surrogate v1 this repo ALSO ships model.joblib — a real trained sklearn regressor that predicts the kernel's DERIVED overheadMs from trace observables, with MEASURED held-out MAE 15.59 ms / R² 0.9822 (target std 191.1 ms). The surrogate never replaces the kernel's exact arithmetic. Λ is not touched here and stays Conjecture 1 (open).

Kernel Hub migration (verified 2026-07-15): get_kernel(...) resolves the first-class Kernel Hub repo; main and v1 pin verified revision 756678f0bf096bde25054336c8e1ff78a9eb9172.

The whole point: honest MEASURED vs DERIVED labels

Loop timing is easy to overclaim. This kernel labels every field, carrying the backbone's LOOP_TIMING_BASIS verbatim:

Field Label Meaning
modelMs MEASURED Σ of every provider-attempt wall window (success AND failed hops)
peakAttemptMs MEASURED the single slowest attempt window (peak-vs-sum)
overheadMs DERIVED max(0, wall − modelMs) — Alloy's orchestration, NOT pure CPU time
serializationTaxMs DERIVED max(0, modelMs − peak) — a COUNTERFACTUAL, never a realized saving (loop is strictly sequential)
deadHopMs DERIVED Σ failed windows before the served hop — upper bound only, no prefetch
maxBudget DECLARED the per-run attempt ceiling
exit REPORTED converged / budgetExhausted / aborted / error
receiptsInEqOut DOCTRINE one receipt trail in, one out — a doctrine invariant, NOT a proof

When wall_ms=None, overheadMs is honestly None / UNAVAILABLE — never fabricated. A wall smaller than modelMs surfaces wallLessThanModel (a measurement inconsistency made visible, never hidden).

Quickstart (fully offline)

from kernels import get_kernel
ou = get_kernel("SZLHOLDINGS/szl-ouroboros", revision="main", trust_remote_code=True)
attempts = [
    {"provider": "sovereign", "model": "own-metal", "ok": False, "latency_ms": 220, "node": "tower"},
    {"provider": "sovereign", "model": "own-metal", "ok": True,  "latency_ms": 900, "node": "laptop"}]
trace = ou.build_loop_trace(attempts, wall_ms=1300, exit="converged", max_budget=4)
print(trace["modelMs"], trace["overheadMs"], trace["deadHopMs"])  # 1120 180 220
print(ou.selfcheck())    # falsifiable arithmetic self-check

LOOP_DOCTRINE = "bounded, terminating, receipt-closed" — the Ouroboros closes on its own tail. withinBudget surfaces the bounded-loop guarantee; a violation is reported, never clamped. Demo runs make no model call → modelMs / peak / deadHop are honestly 0.

Tests — MEASURED, local, stdlib-only

PYTHONPATH=build/torch-universal python3 -m pytest tests/ -q13 passed. The arithmetic is falsifiable — a wrong split flips the asserts; an unmeasured wall yields overheadMs=None; a missing latency raises; a budget violation is surfaced.

Provenance

Mirrors the live a11oy loop-tax accounting (backbone.tsbuildLoopTrace, sumAttemptMs, peakAttemptMs, deadHopMs, LOOP_DOCTRINE, LOOP_TIMING_BASIS). Backed by lutar-lean, DOI 10.5281/zenodo.20434308. Honest-model trio with szl-invariants and szl-formulas; anchored by szl-kernels. Live substrate: a-11-oy.com.

License

Apache-2.0 · © 2026 SZL Holdings · Stephen P. Lutar · ORCID 0009-0001-0110-4173.

Trained loop-tax regressor v1 (MEASURED — see TRAINING_RECEIPT.json)

A real sklearn HistGradientBoostingRegressor trained on 11,841 runs generated as bounded agent loops and labeled by this kernel itself: the target is ou.loop_tax(attempts, wall_ms)["overheadMs"] — the kernel's own DERIVED max(0, wall − modelMs) (seed 20260721; 40 runs re-audited by full kernel replay). Runs with an unmeasured wall (overheadMs honestly None/UNAVAILABLE) are dropped, never fabricated. Features are observable trace fields only (per-attempt latencies + ok flags + run wall + budget).

metric value
held-out MAE (ms) 15.5853
held-out R² 0.9822
target std (ms) 191.0790

R² is the fidelity of the surrogate to the kernel's DERIVED overheadMs — a fast approximation of the loop-tax derivation, not a new measurement. The kernel's exact arithmetic remains authoritative; serializationTaxMs stays a counterfactual, never a realized saving. Λ untouched = Conjecture 1.

import joblib
reg = joblib.load("model.joblib")   # feature spec: TRAINING_RECEIPT.json data.features

Re-verify everything: python scripts/eval.py (sha256-checks the shipped model against the receipt, regenerates the seeded dataset via the in-repo kernel, retrains, and compares R² within ±0.02).


SZL Holdings honesty footer. Λ = Conjecture 1 (advisory, never a theorem). locked-proven = exactly 8 {F1,F4,F7,F11,F12,F18,F19,F22}. Honesty labels: MEASURED / REPORTED / MODELED / HEURISTIC / UNKNOWN / UNAVAILABLE. Trust never 100% (ceiling 0.97). serializationTax is a counterfactual, never a saving. a-11-oy.com · huggingface.co/SZLHOLDINGS

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Space using SZLHOLDINGS/szl-ouroboros 1

Collections including SZLHOLDINGS/szl-ouroboros