{"id":49943417,"url":"https://github.com/szl-holdings/ouroboros","last_synced_at":"2026-05-17T12:47:30.105Z","repository":{"id":354888135,"uuid":"1225835095","full_name":"szl-holdings/ouroboros","owner":"szl-holdings","description":"Bounded-loop runtime implementing the Lutar Invariant. 172/172 tests passing at v6.2.0. Reference implementation for the Ouroboros Thesis.","archived":false,"fork":false,"pushed_at":"2026-05-10T22:19:01.000Z","size":177,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-11T00:22:02.547Z","etag":null,"topics":["ai-governance","bounded-recursion","convergence","proof-chain","runtime","typescript","vitest"],"latest_commit_sha":null,"homepage":"https://doi.org/10.5281/zenodo.19983066","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/szl-holdings.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-30T17:33:45.000Z","updated_at":"2026-05-10T22:19:06.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/szl-holdings/ouroboros","commit_stats":null,"previous_names":["szl-holdings/ouroboros"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/szl-holdings/ouroboros","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szl-holdings%2Fouroboros","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szl-holdings%2Fouroboros/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szl-holdings%2Fouroboros/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szl-holdings%2Fouroboros/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/szl-holdings","download_url":"https://codeload.github.com/szl-holdings/ouroboros/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szl-holdings%2Fouroboros/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33139580,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T09:28:26.183Z","status":"ssl_error","status_checked_at":"2026-05-17T09:27:52.702Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-governance","bounded-recursion","convergence","proof-chain","runtime","typescript","vitest"],"created_at":"2026-05-17T12:47:28.313Z","updated_at":"2026-05-17T12:47:30.090Z","avatar_url":"https://github.com/szl-holdings.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @szl-holdings/ouroboros\n\n  \u003e Bounded loops with measurable convergence as a system primitive — the v6 ecosystem layer (services, halts, routing, permissions, sandbox, agent registry) plus a structured government-procurement readiness module.\n\n  [![Tests](https://img.shields.io/badge/tests-218%2F218-2da44e?style=flat-square)](./packages/ouroboros)\n  [![Release](https://img.shields.io/badge/release-v6.2.0-2b6cb0?style=flat-square)](https://github.com/szl-holdings/ouroboros/releases/tag/v6.2.0)\n  [![Thesis](https://img.shields.io/badge/thesis-v1%E2%86%92v11%20published%20%C2%B7%20v12%20in%20review-805AD5?style=flat-square)](https://github.com/szl-holdings/ouroboros-thesis)\n  [![DOI v11](https://img.shields.io/badge/DOI%20v11-10.5281%2Fzenodo.20119582-1f78b4?style=flat-square)](https://doi.org/10.5281/zenodo.20119582)\n  [![Concept DOI](https://img.shields.io/badge/Concept%20DOI-10.5281%2Fzenodo.19944926-1f78b4?style=flat-square)](https://doi.org/10.5281/zenodo.19944926)\n  [![Lean](https://img.shields.io/badge/Lean%204-kernel--verified-2D5BB9?style=flat-square\u0026logo=lean\u0026logoColor=white)](https://github.com/szl-holdings/lutar-lean)\n  [![License](https://img.shields.io/badge/license-Proprietary-red?style=flat-square)](./LICENSE)\n  [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/szl-holdings/ouroboros/badge)](https://securityscorecards.dev/viewer/?uri=github.com/szl-holdings/ouroboros)\n\n  This package implements the **Ouroboros runtime** described in [`szl-holdings/ouroboros-thesis`](https://github.com/szl-holdings/ouroboros-thesis). It draws on, and generalizes to the system layer, prior work on adaptive computation in the language-model literature (Universal Transformers; PonderNet; Adaptive Computation Time).\n\n  ## Runtime architecture\n\n  ```mermaid\n  flowchart TD\n      classDef api fill:#01696F,stroke:#C8B26A,color:#F7F6F2;\n      classDef core fill:#1B474D,stroke:#01696F,color:#F7F6F2;\n      classDef gov fill:#28251D,stroke:#C8B26A,color:#F7F6F2;\n      classDef io fill:#F7F6F2,stroke:#01696F,color:#1B474D;\n\n      I[\"Caller / Platform API\"]:::io\n      H[\"Halt Service\u003cbr/\u003ebounded-iteration policy\"]:::core\n      R[\"Routing Service\u003cbr/\u003epolicy-gated provider routing\"]:::core\n      P[\"Permissions\u003cbr/\u003escope + tenant + role\"]:::gov\n      S[\"Sandbox\u003cbr/\u003ecapability + egress policy\"]:::gov\n      A[\"Agent Registry\u003cbr/\u003esigned agent manifests\"]:::core\n      L[\"Lambda Engine\u003cbr/\u003e9-axis Lutar Invariant\"]:::core\n      PR[\"Proof Chain\u003cbr/\u003eappend-only receipts\"]:::api\n\n      I --\u003e H --\u003e R --\u003e P --\u003e S --\u003e A --\u003e L --\u003e PR --\u003e I\n  ```\n\n  ## Citable record\n\n  The Ouroboros Thesis is a versioned series. The canonical paper line lives in [`szl-holdings/ouroboros-thesis`](https://github.com/szl-holdings/ouroboros-thesis); each Zenodo deposit is DOI-pinned.\n\n  | Version | Status | DOI | Notes |\n  |---|---|---|---|\n  | **v11** (current published) | Published 2026-05-09 | [10.5281/zenodo.20119582](https://doi.org/10.5281/zenodo.20119582) | The Λ-Ouroboros Substrate (consolidated) |\n  | v10 | Published 2026-05-07 | [10.5281/zenodo.20053163](https://doi.org/10.5281/zenodo.20053163) | — |\n  | v9 | Published 2026-05-07 | [10.5281/zenodo.20053148](https://doi.org/10.5281/zenodo.20053148) | — |\n  | v8 | Published 2026-05-05 | [10.5281/zenodo.20020849](https://doi.org/10.5281/zenodo.20020849) | — |\n  | v3 | Published 2026-05-02 | [10.5281/zenodo.19983066](https://doi.org/10.5281/zenodo.19983066) | The Loop Is the Product |\n  | v2 | Published 2026-04-30 | [10.5281/zenodo.19934129](https://doi.org/10.5281/zenodo.19934129) | Empirical companion |\n  | v1 | Published 2026-04-28 | [10.5281/zenodo.19867281](https://doi.org/10.5281/zenodo.19867281) | Position paper |\n\n  Concept DOI (always resolves to latest): [10.5281/zenodo.19944926](https://doi.org/10.5281/zenodo.19944926).\n  v12 — *The Λ-Ouroboros Substrate — Four Machine-Verified Mechanisms* — is in review ([thesis PR #25](https://github.com/szl-holdings/ouroboros-thesis/pull/25)); v13 — *The Unified Ouroboros Spine* — is in writing on `paper-v13-thesis`.\n\n  ## Mechanisms (I–VI)\n\n  | # | Mechanism | Paper section | Lean | TypeScript |\n  |---|---|---|---|---|\n  | I | Λ-gate (9-axis Lutar Invariant) | v11 §3.1 | [`Lutar/Invariant.lean`](https://github.com/szl-holdings/lutar-lean/blob/main/Lutar/Invariant.lean) · [`Lutar/Bound.lean`](https://github.com/szl-holdings/lutar-lean/blob/main/Lutar/Bound.lean) | `packages/ouroboros-invariant` (platform) |\n  | II | Receipt chain (signed bounded recursion) | v11 §3.2 | — | `packages/ouroboros-guardrails` (platform) |\n  | III | Bekenstein gate (information-bounded admit) | v11 §3.3 | — | `packages/ouroboros-newton` (platform) |\n  | IV | Dual-witness verdict (MATCH/DIVERGE) | v11 §3.4 | — | `packages/ouroboros-loop` (platform) |\n  | V | Witness diversity (Gauss class-number gating) | v12 §4 | (statement) | `packages/ouroboros-gauss` + `ouroboros-loop` (platform) |\n  | VI | Reference-vector parity (bit-exact cross-runtime) | v13 (in writing) | [`RefVectors.lean`](https://github.com/szl-holdings/lutar-lean/blob/main/RefVectors.lean) | `packages/{a11oy,amaru,sentra}-runtime` (platform) |\n\n  Empirical benchmarks for mechanisms I–IV are reproduced by [`packages/ouroboros-integrations/bench/the-four.bench.ts`](https://github.com/szl-holdings/ouroboros/tree/main/packages/ouroboros-integrations/bench) in this repository's full v6.2 substrate. Measured at commit `6c5c28366` (Node 24.0.0, N = 10,000 reps, mulberry32-seeded): Λ₉ p50 = **3.12 µs** (258k ops/sec); receipt build p50 = **11.5 µs** (62.8k ops/sec); receipt verify p50 = **10.4 µs** (74.1k ops/sec); receipt chain of 10k entries = **114.6 ms** at p50; Bekenstein indicator fires **49.5%** under uniform seed; dual-witness clean-channel agreement **100%** / noisy-channel agreement **43.6%** at τ = 0.40; V composed-effect at τ = 0.65 reduces error from **21.9% → 7.8%** (64.3% reduction, 70.4% admitted). Source artefact: [`packages/ouroboros-integrations/bench-data.json`](https://github.com/szl-holdings/ouroboros/tree/main/packages/ouroboros-integrations/bench-data.json).\n\n  ## Modules\n\n  ### Loop kernel (v1–v4 contracts)\n\n  | Module | Responsibility |\n  |---|---|\n  | `loop-kernel` | `runLoop()` — the bounded reconciliation primitive |\n  | `depth-allocator` | `allocateDepth()` — depth allocation over Δ-magnitude and validator entropy |\n  | `consistency` | Cross-step consistency scoring (numeric, vector, set, string) |\n  | `proof-route` | `resolveProofRoute()` — `PRF_SYSTEM_CLAIMS`, `PRF_SECURITY_ACTIONS`, `PRF_DATA_SYNC` |\n  | `risk-tier` | `evaluateRiskTier()` — R1 → R4 escalation gate |\n  | `almanac` | `advanceAlmanac()` / `rebuildAlmanac()` — bounded periodic coordination |\n\n  ### v6 ecosystem layer\n\n  | Module | Responsibility |\n  |---|---|\n  | `v6-payload/services` | `SHARED_RUNTIME_SERVICES_V6` — shared runtime services manifest |\n  | `v6-payload/halts` | Halt conditions including `primary_source_required_but_unavailable`, `permission_denied`, `sandbox_policy_violation` |\n  | `v6-payload/routing` | Extended task-routing rules including `regulated_monitoring`, `record_reconciliation`, `filings`, `regulatory`, `government_data` |\n  | `v6-payload/permissions` | `TOOL_PERMISSION_MATRIX` + `checkToolPermission()` — R3-mutating-needs-approval, R4-read-only-until-approved, deny-by-default |\n  | `v6-payload/sandbox` | Three execution classes; emits `class` field per canonical contract |\n  | `v6-payload/agent-registry` | Required-field schema + `validateAgentRegistryEntry()` |\n  | `v6-payload/secrets-broker` | Managed-secrets specification |\n\n  ### Government-procurement readiness (`gov-readiness`)\n\n  A structured, machine-readable representation of the materials prepared for SZL's procurement counseling engagements. It is **not** a third-party audit; it is the founder's own readiness data published as input material for a buyer's evaluator to read directly.\n\n  | Symbol | What it is |\n  |---|---|\n  | `PLATFORM_READINESS` | Per-platform self-assessment scorecards with strengths and gaps |\n  | `NIST_RMF_ALIGNMENT` | NIST AI RMF function × platform coverage mapping (intent + current state) |\n  | `DOD_TENETS` | The five DoD Responsible AI tenets with per-tenet status |\n  | `GSAR_552_239_7001_READINESS` | The ten GSAR 552.239-7001 procurement requirements with per-requirement status and documented gaps |\n  | `RECOMMENDED_NAICS_CODES` | NAICS codes relevant to SZL Holdings |\n  | `SAM_GOV_REGISTRATION_STEPS` / `NEW_YORK_STATE_REGISTRATION_STEPS` | Registration sequences |\n  | `COMPETITIVE_POSITIONING_STATEMENT` | Pinned positioning text |\n  | `GOV_READINESS_MANIFEST` | Top-level summary view |\n\n  \u003e The platform scorecards and the NIST/DoD/GSAR coverage matrices are **founder self-assessments** prepared as input material for procurement counseling sessions with the **Empire APEX Accelerator** (administered by NYSTEC). Empire APEX is a counseling program, not an audit body; this material has not been certified by a third party.\n\n  Source of truth: [`docs/audit/szl-government-readiness.md`](./docs/audit/szl-government-readiness.md).\n\n  ## Operational contract\n\n  The package implements the **v6 operational contract** defined in the thesis repository — see [`a11oy-ultimate-replit-payload.v6.json`](https://github.com/szl-holdings/ouroboros-thesis/blob/main/a11oy-ultimate-replit-payload.v6.json) for the canonical JSON.\n\n  ## Tests\n\n  ```bash\n  pnpm install\n  pnpm exec vitest run --no-coverage\n  ```\n\n  **218/218 passing** in the `@szl-holdings/ouroboros` package (verified 2026-05-12), across 7 test files: proof-route resolver, risk-tier escalation gate, almanac cycle advancer, v6 services / halts / routing / permission matrix (deny-by-default pinned) / sandbox policy (`class` wire-format pinned) / agent-registry validation, `allocateDepth()` controller, `lutar-invariant-proof` Λ-bound and Λ-Egyptian-weight pins, and pinning tests for every cardinal fact in the government-readiness module.\n\n  ## Status\n\n  `v6.2.0` is the current release. `v6.1.0` introduced the `allocateDepth()` controller — a pure-function depth allocator over Δ-magnitude and validator entropy with verdicts `continue` / `early_exit_converged` / `early_exit_entropy` / `extend`. Opt-in via `loop_policy.adaptive_depth.enabled = true`; with the flag off, runs are bit-identical to v6.0.0.\n\n  The seven product surfaces (A11oy, Sentra, Amaru, Counsel, Terra, Vessels, Carlota Jo) live as a working multi-artifact monorepo in [`szl-holdings/platform`](https://github.com/szl-holdings/platform) (private; 1,220 tests across 76 packages, including the v6.2 substrate, the MCP gateway 27/27 e2e, dual-witness diversity, reference-vector parity, and per-runtime Λ-engine bit-exact assertions). The runtime is the open-source primitive that powers them.\n\n  **Companion proofs.** The Lean 4 machine-checked uniqueness proof of Λ_k lives in [`szl-holdings/lutar-lean`](https://github.com/szl-holdings/lutar-lean) — the kernel is the referee.\n\n  ---\n\n  © 2026 SZL Holdings. See [LICENSE](./LICENSE).\n  ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fszl-holdings%2Fouroboros","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fszl-holdings%2Fouroboros","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fszl-holdings%2Fouroboros/lists"}