feat: session lifecycle audit log — append-only JSONL at ~/.claudeman/session-lifecycle.jsonl

Records every session create, start, exit, delete, recover, stale-clean,
mux-died, and server start/stop with timestamps, names, reasons, and exit
codes. Survives server restarts (unlike in-memory RunSummary).

- New SessionLifecycleLog singleton (src/session-lifecycle-log.ts)
- LifecycleEventType + LifecycleEntry types in types.ts
- GET /api/session-lifecycle endpoint with sessionId/event/since/limit filters
- cleanupSession() now takes reason parameter for audit trail
- state-store cleanupStaleSessions returns cleaned session IDs+names
- UI: lifecycle log modal accessible from header clipboard icon
- Auto-trims to 8k entries when exceeding 10k on server start

chore: bump version to 0.1556

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
arkon
2026-02-19 18:30:14 +01:00
co-authored by Claude Opus 4.6
parent 342a2add10
commit 383ed5e5a0
9 changed files with 333 additions and 79 deletions
+2 -2
View File
@@ -1160,7 +1160,7 @@ export class RespawnController extends EventEmitter {
/**
* Start periodic detection status updates for UI.
* Emits 'detectionUpdate' event every 500ms while running.
* Emits 'detectionUpdate' event every 2s while running.
*/
private startDetectionUpdates(): void {
this.stopDetectionUpdates();
@@ -1173,7 +1173,7 @@ export class RespawnController extends EventEmitter {
} catch (err) {
console.error(`[RespawnController] Error in detectionUpdateTimer:`, err);
}
}, 500);
}, 2000);
}
/**