arkaos 2.16.1 → 2.17.0
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.
- package/VERSION +1 -1
- package/config/agent-allowlists/_base.yaml +7 -0
- package/config/agent-allowlists/laravel.yaml +9 -0
- package/config/agent-allowlists/node.yaml +7 -0
- package/config/agent-allowlists/nuxt.yaml +7 -0
- package/config/agent-allowlists/python.yaml +7 -0
- package/config/hooks/agent-provision.sh +135 -0
- package/config/mcp-policy.yaml +36 -0
- package/config/settings-template.json +12 -0
- package/config/standards/claude-md-overlays/laravel.md +8 -0
- package/config/standards/claude-md-overlays/node.md +7 -0
- package/config/standards/claude-md-overlays/nuxt.md +8 -0
- package/config/standards/claude-md-overlays/python.md +8 -0
- package/core/sync/__pycache__/agent_provisioner.cpython-313.pyc +0 -0
- package/core/sync/__pycache__/ai_mcp_decider.cpython-313.pyc +0 -0
- package/core/sync/__pycache__/content_merger.cpython-313.pyc +0 -0
- package/core/sync/__pycache__/content_syncer.cpython-313.pyc +0 -0
- package/core/sync/__pycache__/descriptor_syncer.cpython-313.pyc +0 -0
- package/core/sync/__pycache__/engine.cpython-313.pyc +0 -0
- package/core/sync/__pycache__/mcp_optimizer.cpython-313.pyc +0 -0
- package/core/sync/__pycache__/policy_loader.cpython-313.pyc +0 -0
- package/core/sync/__pycache__/reporter.cpython-313.pyc +0 -0
- package/core/sync/__pycache__/schema.cpython-313.pyc +0 -0
- package/core/sync/__pycache__/self_healing.cpython-313.pyc +0 -0
- package/core/sync/agent_provisioner.py +150 -0
- package/core/sync/ai_mcp_decider.py +86 -0
- package/core/sync/content_merger.py +100 -0
- package/core/sync/content_syncer.py +167 -0
- package/core/sync/engine.py +20 -0
- package/core/sync/mcp_optimizer.py +187 -0
- package/core/sync/policy_loader.py +94 -0
- package/core/sync/reporter.py +49 -1
- package/core/sync/schema.py +37 -0
- package/core/sync/self_healing.py +47 -0
- package/package.json +1 -1
- package/pyproject.toml +1 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"""Retry wrapper for sync engine phases.
|
|
2
|
+
|
|
3
|
+
Wraps phase callables with exponential backoff. Errors are surfaced as
|
|
4
|
+
RetryExhausted after max attempts so the orchestrator can convert them
|
|
5
|
+
into structured SyncError entries on the report.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
import time
|
|
11
|
+
from typing import Callable, TypeVar
|
|
12
|
+
|
|
13
|
+
T = TypeVar("T")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class RetryExhausted(RuntimeError):
|
|
17
|
+
def __init__(self, message: str, last_exception: BaseException | None = None):
|
|
18
|
+
super().__init__(message)
|
|
19
|
+
self.last_exception = last_exception
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def run_with_retry(
|
|
23
|
+
fn: Callable[[], T],
|
|
24
|
+
max_retries: int = 3,
|
|
25
|
+
base_delay: float = 0.1,
|
|
26
|
+
backoff: float = 2.0,
|
|
27
|
+
) -> T:
|
|
28
|
+
"""Call fn with exponential backoff; raise RetryExhausted after max_retries.
|
|
29
|
+
|
|
30
|
+
max_retries=0 means a single attempt (no retries).
|
|
31
|
+
"""
|
|
32
|
+
attempt = 0
|
|
33
|
+
last_exc: BaseException | None = None
|
|
34
|
+
while attempt <= max_retries:
|
|
35
|
+
try:
|
|
36
|
+
return fn()
|
|
37
|
+
except Exception as exc: # noqa: BLE001
|
|
38
|
+
last_exc = exc
|
|
39
|
+
if attempt == max_retries:
|
|
40
|
+
break
|
|
41
|
+
time.sleep(base_delay * (backoff ** attempt))
|
|
42
|
+
attempt += 1
|
|
43
|
+
|
|
44
|
+
raise RetryExhausted(
|
|
45
|
+
f"exhausted {max_retries} retries: {last_exc}",
|
|
46
|
+
last_exception=last_exc,
|
|
47
|
+
)
|
package/package.json
CHANGED