feat: harden runtime readiness and session workflow

This commit is contained in:
User
2026-07-14 10:27:25 +02:00
parent 6d7738d538
commit 6dbf93fff9
52 changed files with 1464 additions and 169 deletions
+19
View File
@@ -242,6 +242,25 @@ def close_session(session_id: str, sessions_root: Path) -> SessionManifest:
return manifest
def fail_session(session_id: str, sessions_root: Path) -> SessionManifest:
"""Record a fatal managed-runtime failure without losing phase artifacts."""
manifest = load_session(session_id, sessions_root)
manifest.status = "failed"
manifest.updated_at = datetime.now(UTC)
manifest.updated_by = current_author()
manifest.to_yaml(sessions_root / session_id / MANIFEST)
return manifest
def reopen_session(session_id: str, sessions_root: Path) -> SessionManifest:
"""Mark a manually resumed session active again."""
manifest = load_session(session_id, sessions_root)
manifest.status = "open"
manifest.updated_at = datetime.now(UTC)
manifest.updated_by = current_author()
manifest.to_yaml(sessions_root / session_id / MANIFEST)
return manifest
def _save_touched(manifest: SessionManifest, sessions_root: Path) -> SessionManifest:
"""Persist `manifest` updating updated_at/updated_by (single save path for mutations)."""
manifest.updated_at = datetime.now(UTC)