Skip to content

Phase 4: Structured activity log for ADF #641

@AlexMikhalev

Description

@AlexMikhalev

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

  • All orchestrator mutations emit structured activity events
  • Events written to activity.jsonl with consistent schema
  • Events include timestamp, event_type, agent_name, details
  • Backward compatible with existing telemetry (can coexist)
  • adf activity CLI command to tail/query recent events

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions