Skip to main content

scope-resilience — P41

Hallucination resilience mapping for LLM semantic paths GenesisAeon Package 41 · MOR Research Collective · Johann Römer

CI Python 3.11+ License: MIT


What is Ρ_sem?

scope-resilience extends genesis-scope with a formal pre-flight hallucination risk assessment for LLMs: before initialising a model on a semantic topic path, compute how resilient that path is against semantic drift.

Ρ_sem(P, t) = r_sem · tanh²(σ · Γ_sem(P))
            · (1 − Γ_sem(P)/Γ_max)
            · (1 − |dΓ_sem/dt| / Γ̇_critical)

This is the same UTAC fixpoint-resilience formalism as resilience-core (P40), applied to a new domain: instead of physical tipping systems (AMOC, Arctic ice), the "system" is an LLM's coherence on a semantic path, and Γ_sem is derived from a CREP tensor over that path's Sigillin anchors and Q4 transitions.

Factor Meaning
r_sem Domain-specific self-correction rate — the one free parameter per knowledge domain
tanh²(σ·Γ_sem) Intrinsic pull toward the semantic coherence attractor
1 − Γ_sem/Γ_max Criticality margin before the path nears a semantic phase boundary
1 − |dΓ_sem/dt| / Γ̇_critical Live drift penalty — punishes paths that are destabilising in real time

Ρ_sem → 0 means the path is near a semantic phase boundary and actively drifting — the regime where hallucination risk is highest and LLM initialisation should be avoided.


Installation

pip install scope-resilience
# or with the MCP server
pip install "scope-resilience[mcp]"

Quick Start

from scope_resilience import ScopeResilience

sr = ScopeResilience(domain="physics_dense")
result = sr.run_cycle(
    topic="AMOC tipping point",
    sigillin_ids=["s1", "s2", "s3"],
    q4_transitions=[("s1", "s2"), ("s2", "s3")],
)
print(result["rho_sem"], result["risk_level"])

# Best available semantic path for a topic, with a minimum resilience bar
path = sr.get_semantic_path("AMOC tipping point", min_rho=0.4)
print(path.risk_level, path.grounding_recommendations)

# Export as llms.txt for system-prompt injection
print(sr.to_llms_txt())

CLI equivalent:

scope-resilience assess "AMOC tipping point" --domain physics_dense
scope-resilience path "AMOC tipping point" --min-rho 0.4
scope-resilience export-llms-txt "AMOC tipping point"

Risk Levels

Ρ_sem range Level Meaning
0.70 – 1.00 safe Path is semantically stable. Proceed.
0.40 – 0.70 moderate Moderate drift risk. Inject grounding anchors.
0.10 – 0.40 high_risk High hallucination risk. Consider an alternative path.
0.00 – 0.10 critical Near a semantic phase boundary. Do not initialise on this path.

When risk rises, GroundingRecommender suggests concrete mitigations: injecting Sigillin anchors, pulling in cross-domain grounding from high-resilience domains (quantum-genesis, sandpile-utac), or switching to an alternative path entirely.

Domain Calibration

r_sem is the only free parameter per knowledge domain. Structural values (σ, σ_Φ, Γ_max, Γ̇_critical) are universal and shared with resilience-core.

Domain r_sem Status Source
curated_graph 0.90 estimate pending TIP/P50
physics_dense 0.80 estimate pending TIP/P50
quantum 0.85 estimate quantum-genesis analogy (Γ=0.050, Ρ≈0.90)
oceanography 0.75 estimate AMOC-UTAC analogy
general 0.50 conservative_default theoretical midpoint
sparse_fringe 0.30 estimate pending TIP/P50

All r_sem values are provisional. They hold as a pre-registered hypothesis until the TIP/P50 calibration effort delivers ≥30 real perturbation-pair measurements per domain. SemanticCREP.get_domain_r() raises a UserWarning on every use of an uncalibrated domain so this is never silently forgotten. Once real data lands, SemanticCREP.calibrate_r(rho_observed, gamma) recomputes r_sem from measured Ρ and Γ using the same closed-form inversion resilience-core uses for physical domains.

Diamond Interface

ScopeResilience implements all 6 GenesisAeon Diamond methods:

sr.run_cycle(topic, sigillin_ids, q4_transitions)  # Method 1: execute one step
sr.get_crep_state()                                # Method 2: CREP snapshot {C, R, E, P, Gamma}
sr.get_utac_state()                                # Method 3: UTAC snapshot {H, H_star, K_eff}
sr.get_phase_events()                               # Method 4: hallucination-risk events
sr.to_zenodo_record()                               # Method 5: Zenodo deposition metadata
sr.get_resilience_state()                           # Method 6 (NEW): full Ρ_sem breakdown

get_resilience_state() is the same 6th Diamond method introduced by resilience-core — here it returns rho_sem, gamma_sem, risk_level, live drift rate, a re-grounding flag, and grounding recommendations.

MCP Server

With the mcp extra installed, scope-resilience exposes its risk assessment as MCP tools for Claude Code / Claude Desktop:

pip install "scope-resilience[mcp]"
scope-resilience serve --port 8765

Tools exposed: get_semantic_path, assess_hallucination_risk, export_llms_txt, list_domain_resilience.

llms.txt Export

scope-resilience ships the first GenesisAeon implementation of llms.txt export — a machine-readable knowledge-space summary (analogous to robots.txt) listing a path's Sigillin anchors, Q4 transitions, CREP breakdown, and grounding recommendations, suitable for direct system-prompt injection.

Structure

scope_resilience/
├── constants.py         # σ, σ_Φ, Γ_max, Γ̇_critical, DOMAIN_CONFIG, RISK_LEVELS
├── domain_profile.py     # DomainProfile — r_sem fingerprint per domain
├── semantic_crep.py       # SemanticCREP — CREP tensor + Γ_sem for a path
├── semantic_utac.py       # SemanticUTAC — H_sem attractor mapping
├── hallucination_risk.py  # HallucinationRisk — Ρ_sem + risk classification
├── path_monitor.py        # PathDriftMonitor — sliding-window dΓ_sem/dt
├── grounding.py            # GroundingRecommender — mitigation suggestions
├── llms_txt.py             # LLMSTxtExporter — llms.txt export
├── mcp_server.py            # Optional FastMCP server (requires [mcp] extra)
├── system.py                # ScopeResilience — Diamond Interface main class
└── _cli.py                  # Typer CLI (assess / path / export-llms-txt / serve)

Citation

@software{romer2026scoperesilience,
  author       = {Römer, Johann},
  title        = {scope-resilience: Hallucination resilience mapping for LLM semantic paths},
  year         = 2026,
  publisher    = {Zenodo},
  doi          = {10.5281/zenodo.XXXXXXX},
  url          = {https://github.com/GenesisAeon/scope-resilience}
}

Part of the GenesisAeon ecosystem · related: diamond-setup (P-INFRA-1), resilience-core (P40), genesis-scope

Metadata

Release files for scope-resilience 1.0.2

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

Source distribution (sdist)

Source distribution for scope-resilience 1.0.2
File Size Uploaded Provenance
scope_resilience-1.0.2.tar.gz 109.1 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for scope-resilience 1.0.2
File Interpreter ABI Platform
scope_resilience-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 136.6 kB

Release files / scope_resilience-1.0.2.tar.gz

Download URL scope_resilience-1.0.2.tar.gz
Size 109.1 kB
Tags Source
SHA-256 checksum
How to use checksums
8848c28b06d49129a395fa0358a3af45eb34e6f85809de9ee7654ec48b46847c
BLAKE2b-256 checksum
How to use checksums
6191723a9ce0f6d21012f672d9b560d71697322cfe65c4e504206180a0293991
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 15, 2026.

Transparency log

Release files / scope_resilience-1.0.2-py3-none-any.whl

Download URL scope_resilience-1.0.2-py3-none-any.whl
Size 27.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
444c250df6721ec79db1875842f09c94cabd0f7f1fb3e073ea41602c34121345
BLAKE2b-256 checksum
How to use checksums
709fac40c4b4cd0228747322e0f859248bd725ce559f62104a22994ffe310d33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 15, 2026.

Transparency log

Security for scope-resilience 1.0.2

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 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for scope_resilience-1.0.2.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 Sep 15, 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