carl-core 0.1.2__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.
Files changed (91) hide show
  1. carl_core-0.1.2/.gitignore +41 -0
  2. carl_core-0.1.2/CLAUDE.md +63 -0
  3. carl_core-0.1.2/LICENSE +21 -0
  4. carl_core-0.1.2/PKG-INFO +70 -0
  5. carl_core-0.1.2/README.md +41 -0
  6. carl_core-0.1.2/pyproject.toml +59 -0
  7. carl_core-0.1.2/src/carl_core/__init__.py +233 -0
  8. carl_core-0.1.2/src/carl_core/audit.py +209 -0
  9. carl_core-0.1.2/src/carl_core/coherence_observer.py +352 -0
  10. carl_core-0.1.2/src/carl_core/coherence_probe.py +312 -0
  11. carl_core-0.1.2/src/carl_core/coherence_trace.py +664 -0
  12. carl_core-0.1.2/src/carl_core/config_requirements.py +330 -0
  13. carl_core-0.1.2/src/carl_core/connection/__init__.py +108 -0
  14. carl_core-0.1.2/src/carl_core/connection/base.py +536 -0
  15. carl_core-0.1.2/src/carl_core/connection/coherence.py +95 -0
  16. carl_core-0.1.2/src/carl_core/connection/errors.py +67 -0
  17. carl_core-0.1.2/src/carl_core/connection/lifecycle.py +135 -0
  18. carl_core-0.1.2/src/carl_core/connection/registry.py +124 -0
  19. carl_core-0.1.2/src/carl_core/connection/spec.py +199 -0
  20. carl_core-0.1.2/src/carl_core/constants.py +52 -0
  21. carl_core-0.1.2/src/carl_core/constitutional.py +573 -0
  22. carl_core-0.1.2/src/carl_core/data_handles.py +393 -0
  23. carl_core-0.1.2/src/carl_core/dependency_probe.py +252 -0
  24. carl_core-0.1.2/src/carl_core/dynamics/__init__.py +10 -0
  25. carl_core-0.1.2/src/carl_core/dynamics/trajectory.py +136 -0
  26. carl_core-0.1.2/src/carl_core/eml.py +671 -0
  27. carl_core-0.1.2/src/carl_core/errors.py +115 -0
  28. carl_core-0.1.2/src/carl_core/frame_buffer.py +166 -0
  29. carl_core-0.1.2/src/carl_core/hashing.py +141 -0
  30. carl_core-0.1.2/src/carl_core/heartbeat.py +553 -0
  31. carl_core-0.1.2/src/carl_core/interaction.py +602 -0
  32. carl_core-0.1.2/src/carl_core/interaction_store.py +242 -0
  33. carl_core-0.1.2/src/carl_core/math.py +31 -0
  34. carl_core-0.1.2/src/carl_core/memory.py +474 -0
  35. carl_core-0.1.2/src/carl_core/optimizer_state.py +408 -0
  36. carl_core-0.1.2/src/carl_core/presence.py +193 -0
  37. carl_core-0.1.2/src/carl_core/py.typed +0 -0
  38. carl_core-0.1.2/src/carl_core/resilience.py +202 -0
  39. carl_core-0.1.2/src/carl_core/resonant.py +599 -0
  40. carl_core-0.1.2/src/carl_core/resource_handles.py +196 -0
  41. carl_core-0.1.2/src/carl_core/retry.py +248 -0
  42. carl_core-0.1.2/src/carl_core/safepath.py +226 -0
  43. carl_core-0.1.2/src/carl_core/secrets.py +272 -0
  44. carl_core-0.1.2/src/carl_core/signing.py +130 -0
  45. carl_core-0.1.2/src/carl_core/tier.py +225 -0
  46. carl_core-0.1.2/src/carl_core/timeutil.py +27 -0
  47. carl_core-0.1.2/src/carl_core/vault.py +484 -0
  48. carl_core-0.1.2/tests/__init__.py +0 -0
  49. carl_core-0.1.2/tests/connection/__init__.py +0 -0
  50. carl_core-0.1.2/tests/connection/test_base.py +325 -0
  51. carl_core-0.1.2/tests/connection/test_errors.py +63 -0
  52. carl_core-0.1.2/tests/connection/test_lifecycle.py +87 -0
  53. carl_core-0.1.2/tests/connection/test_property_lifecycle.py +91 -0
  54. carl_core-0.1.2/tests/connection/test_registry.py +132 -0
  55. carl_core-0.1.2/tests/connection/test_spec.py +119 -0
  56. carl_core-0.1.2/tests/test_audit.py +345 -0
  57. carl_core-0.1.2/tests/test_channel_coherence.py +152 -0
  58. carl_core-0.1.2/tests/test_coherence_autoattach.py +154 -0
  59. carl_core-0.1.2/tests/test_conservation_law.py +91 -0
  60. carl_core-0.1.2/tests/test_constants.py +111 -0
  61. carl_core-0.1.2/tests/test_constitutional.py +476 -0
  62. carl_core-0.1.2/tests/test_contraction_probe.py +148 -0
  63. carl_core-0.1.2/tests/test_data_handles.py +256 -0
  64. carl_core-0.1.2/tests/test_dependency_probe.py +265 -0
  65. carl_core-0.1.2/tests/test_eml.py +543 -0
  66. carl_core-0.1.2/tests/test_errors.py +176 -0
  67. carl_core-0.1.2/tests/test_hashing.py +226 -0
  68. carl_core-0.1.2/tests/test_heartbeat.py +485 -0
  69. carl_core-0.1.2/tests/test_interaction_coherence.py +85 -0
  70. carl_core-0.1.2/tests/test_interaction_eml_audit.py +206 -0
  71. carl_core-0.1.2/tests/test_interaction_store.py +176 -0
  72. carl_core-0.1.2/tests/test_memory.py +375 -0
  73. carl_core-0.1.2/tests/test_multi_layer_probe.py +346 -0
  74. carl_core-0.1.2/tests/test_optimizer_state.py +311 -0
  75. carl_core-0.1.2/tests/test_presence.py +112 -0
  76. carl_core-0.1.2/tests/test_probe_audit_trail.py +126 -0
  77. carl_core-0.1.2/tests/test_property_hashing.py +87 -0
  78. carl_core-0.1.2/tests/test_property_interaction.py +83 -0
  79. carl_core-0.1.2/tests/test_property_retry.py +91 -0
  80. carl_core-0.1.2/tests/test_property_safepath.py +83 -0
  81. carl_core-0.1.2/tests/test_resilience.py +373 -0
  82. carl_core-0.1.2/tests/test_resonant.py +586 -0
  83. carl_core-0.1.2/tests/test_resource_handles.py +206 -0
  84. carl_core-0.1.2/tests/test_retry.py +554 -0
  85. carl_core-0.1.2/tests/test_safepath.py +332 -0
  86. carl_core-0.1.2/tests/test_secrets.py +412 -0
  87. carl_core-0.1.2/tests/test_signing.py +136 -0
  88. carl_core-0.1.2/tests/test_step_redaction.py +190 -0
  89. carl_core-0.1.2/tests/test_tier.py +194 -0
  90. carl_core-0.1.2/tests/test_timeutil.py +108 -0
  91. carl_core-0.1.2/tests/test_vault.py +467 -0
@@ -0,0 +1,41 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *$py.class
4
+ *.egg-info/
5
+ dist/
6
+ build/
7
+ .eggs/
8
+ *.whl
9
+ .pytest_cache/
10
+ .mypy_cache/
11
+ .ruff_cache/
12
+ *.egg
13
+ .env
14
+ .venv/
15
+ venv/
16
+ env/
17
+
18
+ # Local model-routing cache (regenerated at runtime)
19
+ .model_cache.json
20
+ .model_cache*.json
21
+
22
+ # macOS Finder duplicate artifacts
23
+ * 2.py
24
+ * 3.py
25
+ * 2.json
26
+ * 3.json
27
+ * 2.md
28
+ * 3.md
29
+
30
+ # Ad-hoc scratch / patch scripts at repo root (do not commit)
31
+ /fix_*.py
32
+ /patch_*.py
33
+ .claude/scheduled_tasks.lock
34
+ # v0.18 Track B — project-local .carl/ scaffold
35
+ .carl/
36
+
37
+ # Project-local training config. CARLSettings layers this file in, and
38
+ # users commonly drop dataset paths, hub namespaces, and occasionally
39
+ # secrets into it. Keep it out of version control by default — commit a
40
+ # `carl.yaml.example` template instead if you want to share settings.
41
+ carl.yaml
@@ -0,0 +1,63 @@
1
+ # carl-core — scoped project memory
2
+
3
+ ## Purpose
4
+
5
+ The foundational layer of the CARL stack. Pure coherence math + interaction trace primitive. Every CARL metric is a reduction of the per-token coherence field defined here. Zero network calls, zero training deps.
6
+
7
+ ## Public API
8
+
9
+ - `CoherenceTrace`, `select_traces` (from `coherence_trace`)
10
+ - `CoherenceProbe`, `CoherenceSnapshot` (from `coherence_probe`)
11
+ - `CoherenceObserver` (from `coherence_observer`, anthropic is an optional, lazy import)
12
+ - `FrameBuffer`, `FrameRecord` (from `frame_buffer`)
13
+ - `compute_phi` (from `math`)
14
+ - `KAPPA`, `SIGMA`, `DEFECT_THRESHOLD`, `T_STAR` (from `constants`)
15
+ - `InteractionChain`, `Step`, `ActionType` (from `interaction`)
16
+ - `Step.probe_call: dict | None` (v0.11) — fingerprint of the coherence
17
+ probe invocation that populated phi/kuramoto_r/channel_coherence.
18
+ 12-hex sha256 digests, not full payloads.
19
+ - `InteractionChain.register_coherence_probe(fn)` / `clear_coherence_probe()` —
20
+ opt-in hook invoked at `record()` for `LLM_REPLY` / `TOOL_CALL` /
21
+ `TRAINING_STEP` / `EVAL_PHASE` / `REWARD` when no explicit coherence
22
+ kwargs are passed.
23
+ - `PresenceReport`, `compose_presence_report` (from `presence`, v0.11)
24
+ - `success_rate_probe` (from `presence`, v0.11) — default endogenous probe;
25
+ estimates `kuramoto_r` from chain's tail success rate per action type.
26
+ - `BreakAndRetryStrategy`, `CircuitOpenError` (from `resilience`, v0.8) —
27
+ composes `RetryPolicy` + `CircuitBreaker`. Used by x402 facilitator calls
28
+ and `carl update`'s PyPI fetch.
29
+ - `CARLError` + subclasses (from `errors`): `ConfigError`, `ValidationError`,
30
+ `CredentialError`, `NetworkError`, `BudgetError`, `PermissionError`,
31
+ `CARLTimeoutError`. All carry stable `code` under `carl.<namespace>`.
32
+ - `canonical_json`, `content_hash`, `content_hash_bytes` (from `hashing`)
33
+ - `CircuitBreaker`, `RetryPolicy`, `retry`, `async_retry`, `poll` (from `retry`)
34
+ - `PathEscape`, `SandboxedPath`, `safe_resolve`, `within` (from `safepath`)
35
+ - `Tier`, `FEATURE_TIERS`, `TierGateError`, `feature_tier`, `tier_allows` (from `tier`)
36
+ - `MemoryItem`, `MemoryLayer`, `MemoryStore` (from `memory`)
37
+ - `InteractionStore` (from `interaction_store`)
38
+
39
+ ## Dependencies
40
+
41
+ - **Required:** `numpy`, `pydantic>=2.9`
42
+ - **Optional (lazy-imported):** `anthropic` (for `CoherenceObserver`), `terminals_runtime` (for private math helpers — graceful fallback)
43
+
44
+ ## Depends on us
45
+
46
+ - `carl_studio.training.*` — rewards, probes, trace callback
47
+ - `carl_studio.eval.runner` — evaluation gating
48
+ - `carl_studio.observe.*` — training dashboard
49
+
50
+ ## Conventions
51
+
52
+ - `from __future__ import annotations` at top of every file.
53
+ - Modern type syntax (`list[X]`, `dict[K, V]`, `X | None`).
54
+ - Pydantic v2 models for configs and serialized data.
55
+ - No heavy imports at module level — keep import time fast.
56
+ - Constants are module-level, derived from conservation law (NOT tuning parameters).
57
+
58
+ ## Do NOT
59
+
60
+ - Do NOT add torch, transformers, trl, or any training deps here.
61
+ - Do NOT add HTTP clients or API wrappers other than the existing lazy `anthropic` import in `coherence_observer`.
62
+ - Do NOT import from `carl_studio.*` — carl-core is the foundation; it depends on nothing upstream.
63
+ - Do NOT rename constants (`KAPPA`, `SIGMA`) — these are mathematical constants from the conservation law, with published DOIs.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Intuition Labs LLC
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,70 @@
1
+ Metadata-Version: 2.4
2
+ Name: carl-core
3
+ Version: 0.1.2
4
+ Summary: Coherence math primitives for CARL (Coherence-Aware Reinforcement Learning)
5
+ Project-URL: Homepage, https://github.com/wheattoast11/carl
6
+ Project-URL: Documentation, https://github.com/wheattoast11/carl#readme
7
+ Project-URL: Repository, https://github.com/wheattoast11/carl
8
+ Project-URL: Issues, https://github.com/wheattoast11/carl/issues
9
+ Author-email: Tej Desai <tej@terminals.tech>
10
+ License-Expression: MIT
11
+ License-File: LICENSE
12
+ Keywords: carl,coherence,entropy,information-theory,reinforcement-learning,reward-shaping
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: Science/Research
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
23
+ Classifier: Topic :: Scientific/Engineering :: Information Analysis
24
+ Classifier: Typing :: Typed
25
+ Requires-Python: >=3.11
26
+ Requires-Dist: numpy
27
+ Requires-Dist: pydantic>=2.9
28
+ Description-Content-Type: text/markdown
29
+
30
+ # carl-core
31
+
32
+ Coherence math primitives for CARL — the foundational per-token field that every CARL metric derives from.
33
+
34
+ ## Install
35
+
36
+ ```
37
+ pip install carl-core
38
+ ```
39
+
40
+ ## Use
41
+
42
+ ```python
43
+ from carl_core import CoherenceTrace, compute_phi
44
+
45
+ # From logits:
46
+ trace = CoherenceTrace.from_logits(logits, token_ids=tokens, step=0)
47
+ print(trace.phi_mean, trace.cloud_quality, trace.carl_reward())
48
+
49
+ # Raw phi:
50
+ phi, probs, entropy = compute_phi(logits)
51
+ ```
52
+
53
+ ## What's inside
54
+
55
+ - `CoherenceTrace` — per-token coherence field (phi, entropy, selected_prob, delta_phi)
56
+ - `CoherenceProbe` / `CoherenceSnapshot` — probe + snapshot for training-step metrics
57
+ - `CoherenceObserver` — periodic Claude-backed training health assessment
58
+ - `FrameBuffer` / `FrameRecord` — rolling temporal Phi buffer
59
+ - `compute_phi()` — order parameter from logits: `phi = 1 - H/log|V|`
60
+ - Constants: `KAPPA = 64/3`, `SIGMA = 3/16`, `DEFECT_THRESHOLD`, `T_STAR(d)`
61
+ - `InteractionChain` / `Step` / `ActionType` — typed interaction trace
62
+
63
+ ## Depends on
64
+
65
+ numpy, pydantic.
66
+
67
+ ## Part of
68
+
69
+ Carl Studio — Coherence-Aware Reinforcement Learning.
70
+ Full docs: https://github.com/wheattoast11/carl
@@ -0,0 +1,41 @@
1
+ # carl-core
2
+
3
+ Coherence math primitives for CARL — the foundational per-token field that every CARL metric derives from.
4
+
5
+ ## Install
6
+
7
+ ```
8
+ pip install carl-core
9
+ ```
10
+
11
+ ## Use
12
+
13
+ ```python
14
+ from carl_core import CoherenceTrace, compute_phi
15
+
16
+ # From logits:
17
+ trace = CoherenceTrace.from_logits(logits, token_ids=tokens, step=0)
18
+ print(trace.phi_mean, trace.cloud_quality, trace.carl_reward())
19
+
20
+ # Raw phi:
21
+ phi, probs, entropy = compute_phi(logits)
22
+ ```
23
+
24
+ ## What's inside
25
+
26
+ - `CoherenceTrace` — per-token coherence field (phi, entropy, selected_prob, delta_phi)
27
+ - `CoherenceProbe` / `CoherenceSnapshot` — probe + snapshot for training-step metrics
28
+ - `CoherenceObserver` — periodic Claude-backed training health assessment
29
+ - `FrameBuffer` / `FrameRecord` — rolling temporal Phi buffer
30
+ - `compute_phi()` — order parameter from logits: `phi = 1 - H/log|V|`
31
+ - Constants: `KAPPA = 64/3`, `SIGMA = 3/16`, `DEFECT_THRESHOLD`, `T_STAR(d)`
32
+ - `InteractionChain` / `Step` / `ActionType` — typed interaction trace
33
+
34
+ ## Depends on
35
+
36
+ numpy, pydantic.
37
+
38
+ ## Part of
39
+
40
+ Carl Studio — Coherence-Aware Reinforcement Learning.
41
+ Full docs: https://github.com/wheattoast11/carl
@@ -0,0 +1,59 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "carl-core"
7
+ version = "0.1.2"
8
+ description = "Coherence math primitives for CARL (Coherence-Aware Reinforcement Learning)"
9
+ readme = "README.md"
10
+ license = "MIT"
11
+ requires-python = ">=3.11"
12
+ authors = [
13
+ { name = "Tej Desai", email = "tej@terminals.tech" },
14
+ ]
15
+ keywords = [
16
+ "coherence",
17
+ "information-theory",
18
+ "entropy",
19
+ "carl",
20
+ "reinforcement-learning",
21
+ "reward-shaping",
22
+ ]
23
+ classifiers = [
24
+ "Development Status :: 4 - Beta",
25
+ "Intended Audience :: Science/Research",
26
+ "Intended Audience :: Developers",
27
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
28
+ "Topic :: Scientific/Engineering :: Information Analysis",
29
+ "License :: OSI Approved :: MIT License",
30
+ "Programming Language :: Python :: 3",
31
+ "Programming Language :: Python :: 3.11",
32
+ "Programming Language :: Python :: 3.12",
33
+ "Programming Language :: Python :: 3.13",
34
+ "Typing :: Typed",
35
+ "Operating System :: OS Independent",
36
+ ]
37
+
38
+ dependencies = [
39
+ "numpy",
40
+ "pydantic>=2.9",
41
+ ]
42
+
43
+ [project.urls]
44
+ Homepage = "https://github.com/wheattoast11/carl"
45
+ Documentation = "https://github.com/wheattoast11/carl#readme"
46
+ Repository = "https://github.com/wheattoast11/carl"
47
+ Issues = "https://github.com/wheattoast11/carl/issues"
48
+
49
+ [tool.hatch.build.targets.wheel]
50
+ packages = ["src/carl_core"]
51
+
52
+ [tool.pyright]
53
+ include = ["src"]
54
+ typeCheckingMode = "strict"
55
+ pythonVersion = "3.11"
56
+
57
+ [tool.ruff]
58
+ target-version = "py311"
59
+ line-length = 100
@@ -0,0 +1,233 @@
1
+ """carl-core: coherence math primitives for CARL.
2
+
3
+ This package is the foundation of the CARL stack. Every metric is a reduction
4
+ of the per-token CoherenceTrace field defined here. Zero training dependencies,
5
+ zero network calls — pure math + a typed interaction trace primitive.
6
+ """
7
+ from __future__ import annotations
8
+
9
+ __version__ = "0.1.2"
10
+
11
+ from carl_core.constants import KAPPA, SIGMA, DEFECT_THRESHOLD, T_STAR
12
+ from carl_core.coherence_trace import CoherenceTrace, LayeredTrace, select_traces
13
+ from carl_core.coherence_probe import (
14
+ CARL_LAYER_PROBE_ENABLED,
15
+ CoherenceProbe,
16
+ CoherenceSnapshot,
17
+ )
18
+ from carl_core.coherence_observer import CoherenceObserver
19
+ from carl_core.frame_buffer import FrameBuffer, FrameRecord
20
+ from carl_core.math import compute_phi
21
+ from carl_core.interaction import ActionType, InteractionChain, Step
22
+ from carl_core.presence import PresenceReport, compose_presence_report, success_rate_probe
23
+ from carl_core.interaction_store import InteractionStore
24
+ from carl_core.errors import (
25
+ CARLError,
26
+ ConfigError,
27
+ ValidationError,
28
+ CredentialError,
29
+ NetworkError,
30
+ BudgetError,
31
+ PermissionError,
32
+ CARLTimeoutError,
33
+ )
34
+ from carl_core.hashing import canonical_json, content_hash, content_hash_bytes
35
+ from carl_core.memory import MemoryItem, MemoryLayer, MemoryStore
36
+ from carl_core.retry import (
37
+ CircuitBreaker,
38
+ CircuitState,
39
+ RetryPolicy,
40
+ async_retry,
41
+ poll,
42
+ retry,
43
+ )
44
+ from carl_core.resilience import BreakAndRetryStrategy, CircuitOpenError
45
+ from carl_core.safepath import PathEscape, SandboxedPath, safe_resolve, within
46
+ from carl_core.tier import (
47
+ FEATURE_TIERS,
48
+ Tier,
49
+ TierGateError,
50
+ feature_tier,
51
+ tier_allows,
52
+ )
53
+ from carl_core.timeutil import ISO8601_Z, now_iso, now_iso_ms
54
+ from carl_core.eml import (
55
+ CLAMP_X,
56
+ EPS,
57
+ MAX_DEPTH,
58
+ EMLNode,
59
+ EMLOp,
60
+ EMLTree,
61
+ eml,
62
+ eml_array,
63
+ eml_scalar_reward,
64
+ )
65
+ from carl_core.resonant import Resonant, compose_resonants, make_resonant
66
+ from carl_core.signing import (
67
+ MIN_SECRET_LEN,
68
+ SIG_LEN,
69
+ sign_platform_countersig,
70
+ sign_tree_software,
71
+ verify_platform_countersig,
72
+ verify_software_signature,
73
+ )
74
+ from carl_core.heartbeat import (
75
+ ChainAppender,
76
+ GradientFn,
77
+ HeartbeatConfig,
78
+ HeartbeatState,
79
+ adam_step,
80
+ detect_resonant_modes,
81
+ heartbeat,
82
+ initial_state,
83
+ is_resonant,
84
+ run_heartbeat,
85
+ )
86
+ from carl_core.optimizer_state import (
87
+ DEFAULT_OPT_STATE_DIR,
88
+ AdamMoments,
89
+ OptimizerStateStore,
90
+ )
91
+ from carl_core.connection import (
92
+ VALID_TRANSITIONS,
93
+ AsyncBaseConnection,
94
+ BaseConnection,
95
+ CARLConnectionError,
96
+ ChannelCoherence,
97
+ ConnectionAuthError,
98
+ ConnectionBase,
99
+ ConnectionClosedError,
100
+ ConnectionDirection,
101
+ ConnectionKind,
102
+ ConnectionPolicyError,
103
+ ConnectionRegistry,
104
+ ConnectionScope,
105
+ ConnectionSpec,
106
+ ConnectionState,
107
+ ConnectionStats,
108
+ ConnectionTransitionError,
109
+ ConnectionTransport,
110
+ ConnectionTrust,
111
+ ConnectionUnavailableError,
112
+ can_transition,
113
+ channel_coherence_diff,
114
+ channel_coherence_distance,
115
+ get_registry,
116
+ reset_registry,
117
+ )
118
+
119
+ __all__ = [
120
+ "KAPPA",
121
+ "SIGMA",
122
+ "DEFECT_THRESHOLD",
123
+ "T_STAR",
124
+ "CoherenceTrace",
125
+ "LayeredTrace",
126
+ "select_traces",
127
+ "CARL_LAYER_PROBE_ENABLED",
128
+ "CoherenceProbe",
129
+ "CoherenceSnapshot",
130
+ "CoherenceObserver",
131
+ "FrameBuffer",
132
+ "FrameRecord",
133
+ "compute_phi",
134
+ "ActionType",
135
+ "InteractionChain",
136
+ "InteractionStore",
137
+ "Step",
138
+ "PresenceReport",
139
+ "compose_presence_report",
140
+ "success_rate_probe",
141
+ "CARLError",
142
+ "ConfigError",
143
+ "ValidationError",
144
+ "CredentialError",
145
+ "NetworkError",
146
+ "BudgetError",
147
+ "PermissionError",
148
+ "CARLTimeoutError",
149
+ "canonical_json",
150
+ "content_hash",
151
+ "content_hash_bytes",
152
+ "MemoryItem",
153
+ "MemoryLayer",
154
+ "MemoryStore",
155
+ "CircuitBreaker",
156
+ "CircuitState",
157
+ "RetryPolicy",
158
+ "async_retry",
159
+ "poll",
160
+ "retry",
161
+ "BreakAndRetryStrategy",
162
+ "CircuitOpenError",
163
+ "PathEscape",
164
+ "SandboxedPath",
165
+ "safe_resolve",
166
+ "within",
167
+ "Tier",
168
+ "FEATURE_TIERS",
169
+ "TierGateError",
170
+ "feature_tier",
171
+ "tier_allows",
172
+ # time helpers
173
+ "ISO8601_Z",
174
+ "now_iso",
175
+ "now_iso_ms",
176
+ # connection primitive
177
+ "ConnectionSpec",
178
+ "ConnectionScope",
179
+ "ConnectionKind",
180
+ "ConnectionDirection",
181
+ "ConnectionTransport",
182
+ "ConnectionTrust",
183
+ "ConnectionState",
184
+ "VALID_TRANSITIONS",
185
+ "can_transition",
186
+ "CARLConnectionError",
187
+ "ConnectionUnavailableError",
188
+ "ConnectionAuthError",
189
+ "ConnectionTransitionError",
190
+ "ConnectionClosedError",
191
+ "ConnectionPolicyError",
192
+ "BaseConnection",
193
+ "AsyncBaseConnection",
194
+ "ConnectionBase",
195
+ "ConnectionStats",
196
+ "ConnectionRegistry",
197
+ "get_registry",
198
+ "reset_registry",
199
+ # channel coherence (cross-channel observable)
200
+ "ChannelCoherence",
201
+ "channel_coherence_diff",
202
+ "channel_coherence_distance",
203
+ # EML primitive (Odrzywolek magma)
204
+ "EPS",
205
+ "MAX_DEPTH",
206
+ "CLAMP_X",
207
+ "EMLOp",
208
+ "EMLNode",
209
+ "EMLTree",
210
+ "eml",
211
+ "eml_array",
212
+ "eml_scalar_reward",
213
+ # Resonant (perceive -> cognize -> act)
214
+ "Resonant",
215
+ "make_resonant",
216
+ "compose_resonants",
217
+ # Heartbeat — CARL standing-wave loop
218
+ "HeartbeatState",
219
+ "HeartbeatConfig",
220
+ "GradientFn",
221
+ "ChainAppender",
222
+ "adam_step",
223
+ "heartbeat",
224
+ "is_resonant",
225
+ "run_heartbeat",
226
+ "detect_resonant_modes",
227
+ "initial_state",
228
+ # Optimizer state — durable Adam (m, v)
229
+ "DEFAULT_OPT_STATE_DIR",
230
+ "AdamMoments",
231
+ "OptimizerStateStore",
232
+ "__version__",
233
+ ]