feat: Phase 5 stabilization schedules and custodian path URIs
Add phase5_stabilization_check State Hub resolver with progress evidence sinks, schedule projections for daily and closeout checks, custodian:// and activity-core:// runtime path resolution, and Railiance mounts under /var/custodian.
This commit is contained in:
parent
5c3a89c495
commit
70e3154b05
10 changed files with 672 additions and 18 deletions
37
src/activity_core/runtime_paths.py
Normal file
37
src/activity_core/runtime_paths.py
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
"""Resolve repo-relative runtime paths for Custodian-owned assets."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
_DEFAULT_CUSTODIAN_ROOT = Path("/home/worsch/the-custodian")
|
||||
_DEFAULT_ACTIVITY_CORE_ROOT = Path("/etc/activity-core")
|
||||
|
||||
_CUSTODIAN_SCHEME = "custodian://"
|
||||
_ACTIVITY_CORE_SCHEME = "activity-core://"
|
||||
|
||||
|
||||
def custodian_repo_root() -> Path:
|
||||
raw = os.environ.get("CUSTODIAN_REPO_ROOT", "").strip()
|
||||
return Path(raw).expanduser() if raw else _DEFAULT_CUSTODIAN_ROOT
|
||||
|
||||
|
||||
def activity_core_root() -> Path:
|
||||
raw = os.environ.get("ACTIVITY_CORE_ROOT", "").strip()
|
||||
return Path(raw).expanduser() if raw else _DEFAULT_ACTIVITY_CORE_ROOT
|
||||
|
||||
|
||||
def resolve_runtime_path(raw_path: str) -> Path:
|
||||
"""Map custodian:// and activity-core:// URIs to mounted runtime paths."""
|
||||
value = str(raw_path or "").strip()
|
||||
if not value:
|
||||
return Path(value)
|
||||
|
||||
if value.startswith(_CUSTODIAN_SCHEME):
|
||||
return (custodian_repo_root() / value.removeprefix(_CUSTODIAN_SCHEME)).resolve()
|
||||
|
||||
if value.startswith(_ACTIVITY_CORE_SCHEME):
|
||||
return (activity_core_root() / value.removeprefix(_ACTIVITY_CORE_SCHEME)).resolve()
|
||||
|
||||
return Path(value).expanduser()
|
||||
Loading…
Add table
Add a link
Reference in a new issue