terraphim / terraphim/terraphim-ai

Phase 4: Structured activity log for ADF

Open
#641 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Rust
Stars
62
Forks
5
Avg merge
2h 27m
Merged PRs (30d)
1

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the proposed terraphim_orchestrator/activity.rs module and review the Paperclip activity log references at packages/db/src/schema/activity_log.ts and server/src/services/activity.ts. Trace existing telemetry.jsonl writes before defining the structured event integration. Done means orchestrator mutations emit consistent append-only activity.jsonl events, existing telemetry remains compatible, and the adf activity CLI command can tail or query recent events.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, observability-sre
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.