Parent Epic
#637
Summary
Extend telemetry JSONL with structured activity events for all orchestrator mutations and agent lifecycle events.
Changes Required
terraphim_orchestrator
- New
activity.rs module with ActivityEvent enum and JSONL writer - Events to log:
ConfigChanged {before_hash, after_hash, changed_keys}BudgetWarning {agent, spent_cents, budget_cents, percentage}BudgetPaused {agent, spent_cents, budget_cents}AgentDriftDetected {agent, score, level, action_taken}AgentRestarted {agent, reason, restart_count, session_resumed}CompoundReviewCompleted {findings_count, pr_created, duration}ApprovalRequested {id, type, agent}ApprovalDecided {id, decision, actor}
- Schema:
{timestamp, event_type, agent_name, details: {}, actor: "system"|"human"|agent_name} - Write to
activity.jsonl in logs directory
Integration
- Replace ad-hoc
telemetry.jsonl writes with structured ActivityEvent emissions - Activity log is append-only, rotatable by external logrotate
Reference
- Paperclip activity log:
packages/db/src/schema/activity_log.ts - Paperclip activity service:
server/src/services/activity.ts
Acceptance Criteria
Parent Epic
#637
Summary
Extend telemetry JSONL with structured activity events for all orchestrator mutations and agent lifecycle events.
Changes Required
terraphim_orchestrator
activity.rsmodule withActivityEventenum and JSONL writerConfigChanged {before_hash, after_hash, changed_keys}BudgetWarning {agent, spent_cents, budget_cents, percentage}BudgetPaused {agent, spent_cents, budget_cents}AgentDriftDetected {agent, score, level, action_taken}AgentRestarted {agent, reason, restart_count, session_resumed}CompoundReviewCompleted {findings_count, pr_created, duration}ApprovalRequested {id, type, agent}ApprovalDecided {id, decision, actor}{timestamp, event_type, agent_name, details: {}, actor: "system"|"human"|agent_name}activity.jsonlin logs directoryIntegration
telemetry.jsonlwrites with structuredActivityEventemissionsReference
packages/db/src/schema/activity_log.tsserver/src/services/activity.tsAcceptance Criteria
activity.jsonlwith consistent schemaadf activityCLI command to tail/query recent events