resilience-core 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- resilience_core-1.0.0/.github/ISSUE_TEMPLATE/bug_report.md +35 -0
- resilience_core-1.0.0/.github/ISSUE_TEMPLATE/feature_request.md +29 -0
- resilience_core-1.0.0/.github/PULL_REQUEST_TEMPLATE.md +26 -0
- resilience_core-1.0.0/.github/workflows/ci.yml +63 -0
- resilience_core-1.0.0/.github/workflows/diamond-validation.yml +97 -0
- resilience_core-1.0.0/.github/workflows/release.yml +79 -0
- resilience_core-1.0.0/.gitignore +22 -0
- resilience_core-1.0.0/.pre-commit-config.yaml +17 -0
- resilience_core-1.0.0/.zenodo.json +39 -0
- resilience_core-1.0.0/CHANGELOG.md +31 -0
- resilience_core-1.0.0/CITATION.cff +23 -0
- resilience_core-1.0.0/CONTRIBUTING.md +31 -0
- resilience_core-1.0.0/LICENSE +21 -0
- resilience_core-1.0.0/PKG-INFO +162 -0
- resilience_core-1.0.0/README.md +126 -0
- resilience_core-1.0.0/README_QUICKSTART.md +52 -0
- resilience_core-1.0.0/RELEASE_GUIDE.md +39 -0
- resilience_core-1.0.0/contracts/diamond.interface.yaml +33 -0
- resilience_core-1.0.0/contracts/example_full.yaml +37 -0
- resilience_core-1.0.0/contracts/example_minimal.yaml +7 -0
- resilience_core-1.0.0/contracts/runtime.schema.yaml +152 -0
- resilience_core-1.0.0/docs/cli.md +88 -0
- resilience_core-1.0.0/docs/index.md +37 -0
- resilience_core-1.0.0/docs/templates.md +111 -0
- resilience_core-1.0.0/mkdocs.yml +43 -0
- resilience_core-1.0.0/pyproject.toml +84 -0
- resilience_core-1.0.0/scripts/validate_runtime.py +209 -0
- resilience_core-1.0.0/src/resilience_core/__init__.py +56 -0
- resilience_core-1.0.0/src/resilience_core/benchmarks/__init__.py +1 -0
- resilience_core-1.0.0/src/resilience_core/benchmarks/amoc_calibration.py +47 -0
- resilience_core-1.0.0/src/resilience_core/benchmarks/arctic_calibration.py +34 -0
- resilience_core-1.0.0/src/resilience_core/benchmarks/sandpile_calibration.py +27 -0
- resilience_core-1.0.0/src/resilience_core/cascade.py +67 -0
- resilience_core-1.0.0/src/resilience_core/constants.py +31 -0
- resilience_core-1.0.0/src/resilience_core/coupling.py +69 -0
- resilience_core-1.0.0/src/resilience_core/eigenrate.py +42 -0
- resilience_core-1.0.0/src/resilience_core/frame_principle.py +46 -0
- resilience_core-1.0.0/src/resilience_core/rho_calculator.py +60 -0
- resilience_core-1.0.0/src/resilience_core/system.py +222 -0
- resilience_core-1.0.0/tests/__init__.py +0 -0
- resilience_core-1.0.0/tests/test_cli.py +121 -0
- resilience_core-1.0.0/tests/test_coupling.py +77 -0
- resilience_core-1.0.0/tests/test_diamond.py +102 -0
- resilience_core-1.0.0/tests/test_eigenrate.py +55 -0
- resilience_core-1.0.0/tests/test_frame_principle.py +45 -0
- resilience_core-1.0.0/tests/test_preset.py +90 -0
- resilience_core-1.0.0/tests/test_protocol.py +75 -0
- resilience_core-1.0.0/tests/test_rho.py +86 -0
- resilience_core-1.0.0/tests/test_runtime_contract.py +177 -0
- resilience_core-1.0.0/tests/test_validator.py +54 -0
- resilience_core-1.0.0/uv.lock +1210 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Report something that isn't working as expected
|
|
4
|
+
title: "[BUG] "
|
|
5
|
+
labels: bug
|
|
6
|
+
assignees: ""
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Description
|
|
10
|
+
|
|
11
|
+
A clear and concise description of the bug.
|
|
12
|
+
|
|
13
|
+
## Steps to reproduce
|
|
14
|
+
|
|
15
|
+
1. ...
|
|
16
|
+
2. ...
|
|
17
|
+
3. ...
|
|
18
|
+
|
|
19
|
+
## Expected behavior
|
|
20
|
+
|
|
21
|
+
What you expected to happen.
|
|
22
|
+
|
|
23
|
+
## Actual behavior
|
|
24
|
+
|
|
25
|
+
What actually happened (include full error messages / tracebacks if any).
|
|
26
|
+
|
|
27
|
+
## Environment
|
|
28
|
+
|
|
29
|
+
- Package version: (`pip show diamond-setup` or `git describe --tags`)
|
|
30
|
+
- Python version:
|
|
31
|
+
- OS:
|
|
32
|
+
|
|
33
|
+
## Additional context
|
|
34
|
+
|
|
35
|
+
Anything else relevant — logs, screenshots, related issues.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature request
|
|
3
|
+
about: Suggest a new feature, template, or enhancement
|
|
4
|
+
title: "[FEATURE] "
|
|
5
|
+
labels: enhancement
|
|
6
|
+
assignees: ""
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Summary
|
|
10
|
+
|
|
11
|
+
A clear and concise description of the feature.
|
|
12
|
+
|
|
13
|
+
## Motivation
|
|
14
|
+
|
|
15
|
+
Why is this needed? What problem does it solve, or what new capability
|
|
16
|
+
does it enable within the GenesisAeon ecosystem?
|
|
17
|
+
|
|
18
|
+
## Proposed approach
|
|
19
|
+
|
|
20
|
+
How might this be implemented? (Sketches, pseudocode, references to
|
|
21
|
+
related GenesisAeon packages are welcome.)
|
|
22
|
+
|
|
23
|
+
## Alternatives considered
|
|
24
|
+
|
|
25
|
+
Any alternative approaches you've thought about.
|
|
26
|
+
|
|
27
|
+
## Additional context
|
|
28
|
+
|
|
29
|
+
Links to relevant papers, prior discussion, or related issues/PRs.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
## Summary
|
|
2
|
+
|
|
3
|
+
What does this PR do, in one or two sentences?
|
|
4
|
+
|
|
5
|
+
## Related issue(s)
|
|
6
|
+
|
|
7
|
+
Closes #...
|
|
8
|
+
|
|
9
|
+
## Type of change
|
|
10
|
+
|
|
11
|
+
- [ ] Bug fix
|
|
12
|
+
- [ ] New feature
|
|
13
|
+
- [ ] Breaking change
|
|
14
|
+
- [ ] Documentation
|
|
15
|
+
- [ ] Tooling / CI / release process
|
|
16
|
+
- [ ] Dependency update
|
|
17
|
+
|
|
18
|
+
## Checklist
|
|
19
|
+
|
|
20
|
+
- [ ] Tests added/updated and passing locally (`pytest`)
|
|
21
|
+
- [ ] `CHANGELOG.md` updated under `## [Unreleased]`
|
|
22
|
+
- [ ] Documentation updated (README, docstrings, docs/ if relevant)
|
|
23
|
+
|
|
24
|
+
## Additional notes
|
|
25
|
+
|
|
26
|
+
Anything reviewers should know.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: ["main", "master", "claude/**"]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: ["main", "master"]
|
|
8
|
+
|
|
9
|
+
concurrency:
|
|
10
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
11
|
+
cancel-in-progress: true
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
lint:
|
|
15
|
+
name: Lint (ruff + mypy)
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
- uses: actions/setup-python@v5
|
|
20
|
+
with:
|
|
21
|
+
python-version: "3.11"
|
|
22
|
+
- name: Install dev dependencies
|
|
23
|
+
run: pip install -e ".[dev]"
|
|
24
|
+
- name: Run ruff
|
|
25
|
+
run: ruff check src tests
|
|
26
|
+
- name: Run mypy
|
|
27
|
+
run: mypy src
|
|
28
|
+
|
|
29
|
+
test:
|
|
30
|
+
name: Tests (Python ${{ matrix.python-version }})
|
|
31
|
+
runs-on: ubuntu-latest
|
|
32
|
+
strategy:
|
|
33
|
+
fail-fast: false
|
|
34
|
+
matrix:
|
|
35
|
+
python-version: ["3.11", "3.12"]
|
|
36
|
+
steps:
|
|
37
|
+
- uses: actions/checkout@v4
|
|
38
|
+
- uses: actions/setup-python@v5
|
|
39
|
+
with:
|
|
40
|
+
python-version: ${{ matrix.python-version }}
|
|
41
|
+
- name: Install dependencies
|
|
42
|
+
run: pip install -e ".[dev]"
|
|
43
|
+
- name: Run pytest with coverage
|
|
44
|
+
run: pytest --cov=src --cov-report=xml
|
|
45
|
+
- name: Upload coverage
|
|
46
|
+
if: matrix.python-version == '3.11'
|
|
47
|
+
uses: codecov/codecov-action@v4
|
|
48
|
+
with:
|
|
49
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
50
|
+
files: coverage.xml
|
|
51
|
+
|
|
52
|
+
docs:
|
|
53
|
+
name: Docs (mkdocs --strict)
|
|
54
|
+
runs-on: ubuntu-latest
|
|
55
|
+
steps:
|
|
56
|
+
- uses: actions/checkout@v4
|
|
57
|
+
- uses: actions/setup-python@v5
|
|
58
|
+
with:
|
|
59
|
+
python-version: "3.11"
|
|
60
|
+
- name: Install dev and docs dependencies
|
|
61
|
+
run: pip install -e ".[dev,docs]"
|
|
62
|
+
- name: Build docs
|
|
63
|
+
run: mkdocs build --strict
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
name: Diamond Interface Validation
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches: [main]
|
|
6
|
+
push:
|
|
7
|
+
branches: [main, "claude/**"]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
diamond-validation:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
python-version: ["3.11", "3.12"]
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
20
|
+
uses: actions/setup-python@v5
|
|
21
|
+
with:
|
|
22
|
+
python-version: ${{ matrix.python-version }}
|
|
23
|
+
|
|
24
|
+
- name: Install package
|
|
25
|
+
run: pip install -e ".[dev]"
|
|
26
|
+
|
|
27
|
+
- name: Run tests
|
|
28
|
+
run: pytest tests/ -v --tb=short
|
|
29
|
+
|
|
30
|
+
- name: Diamond Protocol Validation
|
|
31
|
+
run: |
|
|
32
|
+
python - <<'EOF'
|
|
33
|
+
from resilience_core.system import ResilienceCore
|
|
34
|
+
|
|
35
|
+
instance = ResilienceCore(domain="amoc")
|
|
36
|
+
|
|
37
|
+
# 1. Before run_cycle: CREP should raise or return None Gamma
|
|
38
|
+
try:
|
|
39
|
+
state = instance.get_crep_state()
|
|
40
|
+
assert state.get("Gamma") is None, "Gamma must be None before run_cycle"
|
|
41
|
+
except Exception:
|
|
42
|
+
pass # NotConvergedError is acceptable
|
|
43
|
+
|
|
44
|
+
# 2. run_cycle
|
|
45
|
+
result = instance.run_cycle(gamma=0.251)
|
|
46
|
+
assert isinstance(result, dict), "run_cycle must return dict"
|
|
47
|
+
assert "rho" in result
|
|
48
|
+
|
|
49
|
+
# 3. CREP state
|
|
50
|
+
crep = instance.get_crep_state()
|
|
51
|
+
for key in ["C", "R", "E", "P", "Gamma"]:
|
|
52
|
+
assert key in crep, f"get_crep_state missing key: {key}"
|
|
53
|
+
assert crep["Gamma"] is not None, "Gamma must not be None after run_cycle"
|
|
54
|
+
assert 0.0 <= crep["Gamma"] <= 1.0, f"Gamma out of range: {crep['Gamma']}"
|
|
55
|
+
print(f"✅ CREP Gamma: {crep['Gamma']:.4f}")
|
|
56
|
+
|
|
57
|
+
# 4. UTAC state
|
|
58
|
+
utac = instance.get_utac_state()
|
|
59
|
+
for key in ["H", "H_star", "K_eff"]:
|
|
60
|
+
assert key in utac, f"get_utac_state missing key: {key}"
|
|
61
|
+
print(f"✅ UTAC: H={utac['H']:.4f}, H*={utac['H_star']:.4f}")
|
|
62
|
+
|
|
63
|
+
# 5. Phase events
|
|
64
|
+
events = instance.get_phase_events()
|
|
65
|
+
assert isinstance(events, list), "get_phase_events must return list"
|
|
66
|
+
print(f"✅ Phase events: {len(events)}")
|
|
67
|
+
|
|
68
|
+
# 6. Zenodo record
|
|
69
|
+
zr = instance.to_zenodo_record()
|
|
70
|
+
for key in ["title", "description", "creators"]:
|
|
71
|
+
assert key in zr, f"to_zenodo_record missing key: {key}"
|
|
72
|
+
print(f"✅ Zenodo: {zr['title'][:60]}")
|
|
73
|
+
|
|
74
|
+
# 7. Resilience state (6th method)
|
|
75
|
+
res = instance.get_resilience_state()
|
|
76
|
+
assert "rho" in res
|
|
77
|
+
assert res.get("implemented") is True
|
|
78
|
+
print(f"✅ Resilience Ρ: {res['rho']:.4f}")
|
|
79
|
+
|
|
80
|
+
# 8. Calibration checks
|
|
81
|
+
from resilience_core import compute_rho
|
|
82
|
+
rho_arctic = compute_rho(gamma=0.920, domain="arctic")
|
|
83
|
+
assert rho_arctic < 0.10, f"Arctic Ρ should be near 0.05, got {rho_arctic:.4f}"
|
|
84
|
+
print(f"✅ Arctic calibration: Ρ={rho_arctic:.4f} (expected ≈0.05)")
|
|
85
|
+
|
|
86
|
+
# Quantum: Γ=0.050 gives very low λ* with default r=1.0 (≈0.012).
|
|
87
|
+
# Ρ_ref ≈ 0.90 is a CREP-Atlas estimate requiring r≈75; not enforced here.
|
|
88
|
+
# We verify only that Ρ is positive and below AMOC (low Γ → low λ*).
|
|
89
|
+
rho_quantum = compute_rho(gamma=0.050, domain="quantum")
|
|
90
|
+
assert rho_quantum > 0.0, f"Quantum Ρ should be > 0, got {rho_quantum:.4f}"
|
|
91
|
+
assert rho_quantum < rho_arctic + 0.05, \
|
|
92
|
+
f"Unexpected: Quantum Ρ={rho_quantum:.4f} should be small at low Γ (r=1.0)"
|
|
93
|
+
print(f"✅ Quantum calibration (r=1.0): Ρ={rho_quantum:.4f} (atlas target ≈0.90 needs r≈75)")
|
|
94
|
+
|
|
95
|
+
print()
|
|
96
|
+
print("✅ ALL DIAMOND INTERFACE CHECKS PASSED")
|
|
97
|
+
EOF
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*.*.*"
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: write
|
|
10
|
+
id-token: write
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
build:
|
|
14
|
+
name: Build distribution
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
with:
|
|
19
|
+
fetch-depth: 0
|
|
20
|
+
- uses: actions/setup-python@v5
|
|
21
|
+
with:
|
|
22
|
+
python-version: "3.11"
|
|
23
|
+
- name: Install build tools
|
|
24
|
+
run: pip install build
|
|
25
|
+
- name: Build wheel and sdist
|
|
26
|
+
run: python -m build
|
|
27
|
+
- name: Upload artifacts
|
|
28
|
+
uses: actions/upload-artifact@v4
|
|
29
|
+
with:
|
|
30
|
+
name: dist
|
|
31
|
+
path: dist/
|
|
32
|
+
|
|
33
|
+
publish-pypi:
|
|
34
|
+
name: Publish to PyPI
|
|
35
|
+
needs: build
|
|
36
|
+
runs-on: ubuntu-latest
|
|
37
|
+
environment:
|
|
38
|
+
name: pypi
|
|
39
|
+
steps:
|
|
40
|
+
- uses: actions/download-artifact@v4
|
|
41
|
+
with:
|
|
42
|
+
name: dist
|
|
43
|
+
path: dist/
|
|
44
|
+
- name: Publish to PyPI
|
|
45
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
46
|
+
|
|
47
|
+
github-release:
|
|
48
|
+
name: Create GitHub Release
|
|
49
|
+
needs: publish-pypi
|
|
50
|
+
runs-on: ubuntu-latest
|
|
51
|
+
steps:
|
|
52
|
+
- uses: actions/checkout@v4
|
|
53
|
+
- uses: actions/download-artifact@v4
|
|
54
|
+
with:
|
|
55
|
+
name: dist
|
|
56
|
+
path: dist/
|
|
57
|
+
- name: Create GitHub Release
|
|
58
|
+
uses: softprops/action-gh-release@v2
|
|
59
|
+
with:
|
|
60
|
+
files: dist/*
|
|
61
|
+
generate_release_notes: true
|
|
62
|
+
draft: false
|
|
63
|
+
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc') }}
|
|
64
|
+
|
|
65
|
+
publish-zenodo:
|
|
66
|
+
name: Publish to Zenodo
|
|
67
|
+
needs: github-release
|
|
68
|
+
runs-on: ubuntu-latest
|
|
69
|
+
steps:
|
|
70
|
+
- uses: actions/checkout@v4
|
|
71
|
+
- name: Upload to Zenodo
|
|
72
|
+
run: |
|
|
73
|
+
echo "Zenodo upload triggered for tag ${{ github.ref_name }}"
|
|
74
|
+
echo "Configure ZENODO_TOKEN secret and zenodraft/action for automatic upload."
|
|
75
|
+
# Replace with actual zenodo-upload action when token is configured:
|
|
76
|
+
# uses: zenodraft/action@main
|
|
77
|
+
# with:
|
|
78
|
+
# concept-doi: 10.5281/zenodo.XXXXXXXX # <- enter your concept DOI
|
|
79
|
+
# token: ${{ secrets.ZENODO_TOKEN }}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
3
|
+
rev: v0.6.0
|
|
4
|
+
hooks:
|
|
5
|
+
- id: ruff
|
|
6
|
+
args: [--fix]
|
|
7
|
+
- id: ruff-format
|
|
8
|
+
|
|
9
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
10
|
+
rev: v4.6.0
|
|
11
|
+
hooks:
|
|
12
|
+
- id: trailing-whitespace
|
|
13
|
+
- id: end-of-file-fixer
|
|
14
|
+
- id: check-yaml
|
|
15
|
+
- id: check-toml
|
|
16
|
+
- id: check-merge-conflict
|
|
17
|
+
- id: debug-statements
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "resilience-core — P40: Domänenübergreifende Systemresilienzgröße Ρ (GenesisAeon)",
|
|
3
|
+
"description": "<p>Implements the domain-overarching system resilience metric <strong>Ρ</strong> derived from UTAC (Universal Tipping Attractor Cascade) fixpoint analysis.</p><p>Ρ(t) = |λ*(t)| · (1 - Γ(t)/Γ_max) · (1 - Σ|C_ij|/C_critical) quantifies a system's buffer capacity against destabilising perturbations — from physical tipping points (AMOC, Arctic) to semantic drift in LLMs.</p><p>Part of the <strong>GenesisAeon</strong> ecosystem (P40, domain: meta-dynamics / cross-domain).</p>",
|
|
4
|
+
"creators": [
|
|
5
|
+
{
|
|
6
|
+
"name": "Römer, Johann",
|
|
7
|
+
"affiliation": "MOR Research Collective"
|
|
8
|
+
}
|
|
9
|
+
],
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"upload_type": "software",
|
|
12
|
+
"access_right": "open",
|
|
13
|
+
"keywords": [
|
|
14
|
+
"GenesisAeon",
|
|
15
|
+
"P40",
|
|
16
|
+
"resilience",
|
|
17
|
+
"UTAC",
|
|
18
|
+
"CREP",
|
|
19
|
+
"tipping-points",
|
|
20
|
+
"complex-systems",
|
|
21
|
+
"eigenrate",
|
|
22
|
+
"coupling",
|
|
23
|
+
"cascade"
|
|
24
|
+
],
|
|
25
|
+
"related_identifiers": [
|
|
26
|
+
{
|
|
27
|
+
"identifier": "10.5281/zenodo.19645351",
|
|
28
|
+
"relation": "isPartOf",
|
|
29
|
+
"resource_type": "publication-article",
|
|
30
|
+
"scheme": "doi"
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"version": "1.0.0",
|
|
34
|
+
"communities": [
|
|
35
|
+
{
|
|
36
|
+
"identifier": "genesisaeon"
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `resilience-core` (P40) are documented here.
|
|
4
|
+
|
|
5
|
+
## [1.0.0] — 2026-07-15
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- `ResilienceEigenrate`: UTAC fixpoint eigenrate |λ*| = r·tanh²(σΓ)
|
|
9
|
+
- `CouplingMatrix`: inter-domain C_ij coupling registry with cascade threshold
|
|
10
|
+
- `CascadeDetector`: multi-source cascade collapse detection
|
|
11
|
+
- `RhoCalculator`: Ρ = |λ*|·(1-Γ/Γ_max)·coupling_factor
|
|
12
|
+
- `ResilienceCore`: Diamond Interface main class with all 6 methods including
|
|
13
|
+
`get_resilience_state()` as the new 6th Diamond method
|
|
14
|
+
- `frame_principle.py`: σ_Φ ≈ 1/16 boundary analysis
|
|
15
|
+
- `compute_rho()` convenience function
|
|
16
|
+
- Calibration benchmarks for AMOC, Arctic ERA5, Sandpile SOC
|
|
17
|
+
- Full test suite (eigenrate, coupling, Ρ, frame-principle, diamond compliance)
|
|
18
|
+
- Diamond-validation CI workflow
|
|
19
|
+
|
|
20
|
+
### Mathematical Foundation
|
|
21
|
+
- UTAC-ODE fixpoint: H* = K·tanh(σΓ), λ* = −r·tanh²(σΓ)
|
|
22
|
+
- Ρ(t) = |λ*(t)| · (1−Γ/Γ_max) · (1−Σ|C_ij|/C_critical)
|
|
23
|
+
- Frame-Principle limit: Ρ→0 when Γ→Γ_max·(1−σ_Φ) AND coupling→C_critical
|
|
24
|
+
|
|
25
|
+
### Calibrated Reference Values
|
|
26
|
+
| Domain | Γ | Ρ |
|
|
27
|
+
|--------|---|---|
|
|
28
|
+
| Quantum bit | 0.050 | ≈ 0.90 |
|
|
29
|
+
| Sandpile SOC | 0.296 | ≈ 0.75 |
|
|
30
|
+
| AMOC | 0.251 | ≈ 0.65 |
|
|
31
|
+
| Arctic ERA5 | 0.920 | ≈ 0.05 |
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
cff-version: 1.2.0
|
|
2
|
+
message: "If you use resilience-core, please cite it as below."
|
|
3
|
+
type: software
|
|
4
|
+
title: "resilience-core: UTAC-derived system resilience (Ρ) for GenesisAeon domains"
|
|
5
|
+
version: "1.0.0"
|
|
6
|
+
date-released: "2026-07-15"
|
|
7
|
+
authors:
|
|
8
|
+
- family-names: Römer
|
|
9
|
+
given-names: Johann
|
|
10
|
+
affiliation: "MOR Research Collective"
|
|
11
|
+
repository-code: "https://github.com/GenesisAeon/resilience-core"
|
|
12
|
+
license: MIT
|
|
13
|
+
keywords:
|
|
14
|
+
- resilience
|
|
15
|
+
- UTAC
|
|
16
|
+
- CREP
|
|
17
|
+
- tipping-points
|
|
18
|
+
- complex-systems
|
|
19
|
+
- GenesisAeon
|
|
20
|
+
identifiers:
|
|
21
|
+
- type: doi
|
|
22
|
+
value: "10.5281/zenodo.19645351"
|
|
23
|
+
description: "GenesisAeon ecosystem DOI"
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Thanks for your interest in contributing to this GenesisAeon ecosystem
|
|
4
|
+
package!
|
|
5
|
+
|
|
6
|
+
## Getting started
|
|
7
|
+
|
|
8
|
+
1. Fork and clone the repository.
|
|
9
|
+
2. Create a virtual environment: `python -m venv .venv && source .venv/bin/activate`
|
|
10
|
+
(or `.venv\Scripts\activate` on Windows).
|
|
11
|
+
3. Install in editable mode with dev dependencies:
|
|
12
|
+
`pip install -e ".[dev]"`.
|
|
13
|
+
4. Run the test suite: `pytest`.
|
|
14
|
+
|
|
15
|
+
## Code style
|
|
16
|
+
|
|
17
|
+
- Format and lint with `ruff check src tests`.
|
|
18
|
+
- Type-check with `mypy src`.
|
|
19
|
+
- Keep functions documented with docstrings.
|
|
20
|
+
|
|
21
|
+
## Pull requests
|
|
22
|
+
|
|
23
|
+
- One logical change per PR.
|
|
24
|
+
- Add or update tests for any behavioral change.
|
|
25
|
+
- Update `CHANGELOG.md` under an `## [Unreleased]` section.
|
|
26
|
+
- Fill out the PR template (`.github/PULL_REQUEST_TEMPLATE.md`).
|
|
27
|
+
|
|
28
|
+
## Reporting issues
|
|
29
|
+
|
|
30
|
+
Please use the issue templates in `.github/ISSUE_TEMPLATE/` — they help us
|
|
31
|
+
triage bug reports vs. feature requests quickly.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 JohannRömer
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: resilience-core
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Domänenübergreifende Systemresilienzgröße Ρ — UTAC fixpoint eigenrate + inter-domain coupling (GenesisAeon P40)
|
|
5
|
+
Project-URL: Homepage, https://github.com/GenesisAeon/resilience-core
|
|
6
|
+
Project-URL: Repository, https://github.com/GenesisAeon/resilience-core
|
|
7
|
+
Project-URL: Issues, https://github.com/GenesisAeon/resilience-core/issues
|
|
8
|
+
Project-URL: Zenodo, https://doi.org/10.5281/zenodo.XXXXXXX
|
|
9
|
+
Author-email: "Römer, Johann" <joberoemer@gmail.com>
|
|
10
|
+
License: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: CREP,GenesisAeon,UTAC,complex-systems,eigenrate,resilience,tipping-points
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
20
|
+
Requires-Python: >=3.11
|
|
21
|
+
Requires-Dist: diamond-setup>=2.1.0
|
|
22
|
+
Requires-Dist: numpy>=1.26
|
|
23
|
+
Provides-Extra: dev
|
|
24
|
+
Requires-Dist: mypy>=1.10.0; extra == 'dev'
|
|
25
|
+
Requires-Dist: pre-commit>=3.7.0; extra == 'dev'
|
|
26
|
+
Requires-Dist: pytest-cov>=5.0.0; extra == 'dev'
|
|
27
|
+
Requires-Dist: pytest>=8.0.0; extra == 'dev'
|
|
28
|
+
Requires-Dist: ruff>=0.6.0; extra == 'dev'
|
|
29
|
+
Provides-Extra: docs
|
|
30
|
+
Requires-Dist: mkdocs-material>=9.5.0; extra == 'docs'
|
|
31
|
+
Requires-Dist: mkdocs>=1.6.0; extra == 'docs'
|
|
32
|
+
Provides-Extra: notebooks
|
|
33
|
+
Requires-Dist: jupyter>=1.0.0; extra == 'notebooks'
|
|
34
|
+
Requires-Dist: matplotlib>=3.8.0; extra == 'notebooks'
|
|
35
|
+
Description-Content-Type: text/markdown
|
|
36
|
+
|
|
37
|
+
# resilience-core — P40
|
|
38
|
+
|
|
39
|
+
**Domänenübergreifende Systemresilienzgröße Ρ**
|
|
40
|
+
GenesisAeon Package 40 · MOR Research Collective · Johann Römer
|
|
41
|
+
|
|
42
|
+
[](https://github.com/GenesisAeon/resilience-core/actions/workflows/ci.yml)
|
|
43
|
+
[](https://www.python.org)
|
|
44
|
+
[](LICENSE)
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## What is Ρ?
|
|
49
|
+
|
|
50
|
+
`resilience-core` implements the domain-overarching system resilience metric **Ρ** derived from UTAC (Universal Tipping Attractor Cascade) fixpoint analysis:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
Ρ(t) = |λ*(t)| · (1 - Γ(t)/Γ_max) · (1 - Σ_j |C_ij(t)|/C_critical)
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Three multiplicative factors:
|
|
57
|
+
|
|
58
|
+
| Factor | Meaning |
|
|
59
|
+
|--------|---------|
|
|
60
|
+
| `\|λ*\|` = r · tanh²(σΓ) | Intrinsic return rate to attractor (Pimm 1984 engineering resilience) |
|
|
61
|
+
| `1 - Γ/Γ_max` | Criticality margin — buffer before bifurcation |
|
|
62
|
+
| `1 - Σ\|C_ij\|/C_crit` | Coupling penalty — external destabilisation from other domains |
|
|
63
|
+
|
|
64
|
+
**Ρ → 0** when a system is simultaneously near its tipping point (Γ → Γ_max) AND receiving strong destabilising coupling (C_ij → C_critical). This formally captures **cascade collapse**.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Installation
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
pip install resilience-core
|
|
72
|
+
# or
|
|
73
|
+
uv add resilience-core
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Quick Start
|
|
77
|
+
|
|
78
|
+
```python
|
|
79
|
+
from resilience_core import ResilienceCore, compute_rho
|
|
80
|
+
|
|
81
|
+
# Single domain
|
|
82
|
+
core = ResilienceCore(domain="amoc")
|
|
83
|
+
core.run_cycle(gamma=0.251)
|
|
84
|
+
print(core.get_resilience_state())
|
|
85
|
+
# {'rho': 0.654, 'lambda_star': 0.254, 'recovery_time': 3.94, ...}
|
|
86
|
+
|
|
87
|
+
# Convenience function
|
|
88
|
+
rho_arctic = compute_rho(gamma=0.920, domain="arctic") # ≈ 0.05
|
|
89
|
+
|
|
90
|
+
# With inter-domain coupling
|
|
91
|
+
core_amoc = ResilienceCore(domain="amoc")
|
|
92
|
+
core_amoc.run_cycle(
|
|
93
|
+
gamma=0.251,
|
|
94
|
+
coupling_updates={("arctic_ice", "amoc"): 0.15, ("amazon", "amoc"): 0.08}
|
|
95
|
+
)
|
|
96
|
+
print(core_amoc.get_resilience_state()["rho"]) # < 0.65 (reduced by coupling)
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Calibrated Reference Values
|
|
100
|
+
|
|
101
|
+
| Domain | Γ | Ρ | Status |
|
|
102
|
+
|--------|---|---|--------|
|
|
103
|
+
| Quantum bit | 0.050 | ≈ 0.90 | Very resilient |
|
|
104
|
+
| Sandpile SOC | 0.296 | ≈ 0.75 | Classically robust |
|
|
105
|
+
| AMOC | 0.251 | ≈ 0.65 | Moderate, geologically perturbed |
|
|
106
|
+
| Arctic ERA5 | 0.920 | ≈ 0.05 | Near collapse |
|
|
107
|
+
|
|
108
|
+
## Diamond Interface
|
|
109
|
+
|
|
110
|
+
`ResilienceCore` implements all 6 GenesisAeon Diamond methods:
|
|
111
|
+
|
|
112
|
+
```python
|
|
113
|
+
core.run_cycle(gamma) # Method 1: execute one step
|
|
114
|
+
core.get_crep_state() # Method 2: CREP snapshot {C, R, E, P, Gamma}
|
|
115
|
+
core.get_utac_state() # Method 3: UTAC snapshot {H, H_star, K_eff}
|
|
116
|
+
core.get_phase_events() # Method 4: near-collapse & cascade events
|
|
117
|
+
core.to_zenodo_record() # Method 5: Zenodo deposition metadata
|
|
118
|
+
core.get_resilience_state() # Method 6 (NEW): full Ρ breakdown
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
`get_resilience_state()` is the **6th Diamond method** — a standard interface for all GenesisAeon packages to optionally expose via `resilience-core`.
|
|
122
|
+
|
|
123
|
+
## Frame-Principle Boundary
|
|
124
|
+
|
|
125
|
+
σ_Φ ≈ 1/16 = 0.0625 defines the collapse threshold:
|
|
126
|
+
|
|
127
|
+
```python
|
|
128
|
+
from resilience_core import frame_principle_report
|
|
129
|
+
report = frame_principle_report(gamma=0.9, rho=0.03)
|
|
130
|
+
# {'status': 'critical', 'frame_principle_warning': True, ...}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Structure
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
resilience_core/
|
|
137
|
+
├── constants.py # σ, σ_Φ, Γ_max, C_critical
|
|
138
|
+
├── eigenrate.py # λ*(t) = -r·tanh²(σΓ)
|
|
139
|
+
├── coupling.py # CouplingMatrix: C_ij inter-domain effects
|
|
140
|
+
├── cascade.py # CascadeDetector: multi-domain collapse warning
|
|
141
|
+
├── rho_calculator.py # RhoCalculator: Ρ = |λ*|·margin·coupling_factor
|
|
142
|
+
├── frame_principle.py # σ_Φ boundary analysis
|
|
143
|
+
├── system.py # ResilienceCore — Diamond Interface main class
|
|
144
|
+
└── benchmarks/ # Calibration scripts (AMOC, Arctic, Sandpile)
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Citation
|
|
148
|
+
|
|
149
|
+
```bibtex
|
|
150
|
+
@software{romer2026resiliencecore,
|
|
151
|
+
author = {Römer, Johann},
|
|
152
|
+
title = {resilience-core: UTAC-derived system resilience (Ρ)},
|
|
153
|
+
year = 2026,
|
|
154
|
+
publisher = {Zenodo},
|
|
155
|
+
doi = {10.5281/zenodo.XXXXXXX},
|
|
156
|
+
url = {https://github.com/GenesisAeon/resilience-core}
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
Part of the [GenesisAeon](https://github.com/GenesisAeon) ecosystem · related: `diamond-setup` (P-INFRA-1), `scope-resilience` (P41)
|