generate-daily-exec-report
Purpose
Generates the Executive Daily Report - a comprehensive daily briefing that synthesizes:
- •Raw conversations from ChatGPT, Claude, Gemini, Cursor
- •Extracted memories (CMA output)
- •Business insights (PAR output)
- •SEO recommendations (SEOS output)
- •Operational telemetry
What It Does
- •Reads exported conversations for the date (
/cosmocrat/inbox/conversations/{date}.json) - •Queries ClickHouse for memories, insights, and telemetry
- •Loads prior day's report for delta computation
- •Calls OpenAI (gpt-4o) with structured prompts
- •Writes JSON + Markdown reports to
/cosmocrat/reports/{date}/ - •Indexes to ClickHouse (
artifacts_daily,orion_daily_analyses) - •Posts summary to Slack #orion-ops
Memory Contract
Reads
- •
conversation_message(ops lane) - Source conversations - •
daily_event(ops lane) - Operational events for context - •
episodic_memory(ops lane) - Short-term agent memories
Writes
- •
artifact_daily(ops lane) - Report artifact with input/output - •
daily_analysis(ops lane) - Structured analysis (decisions, actions, themes)
Provenance
All writes include:
- •
run_id- Execution ID - •
trace_id- Langfuse trace ID - •
source_ref- Date identifier (e.g., "daily_report_2025-12-21") - •
actor- "generate_daily_exec_report"
Schedule
Cron: 5 2 * * * (02:05 PT daily)
Triggered after: conversation-exporter (23:50 PT)
Implementation
Script: app/services/mcp/jobs/daily/executive_daily_report_runner.py
Indexer: app/services/mcp/jobs/memory/index_exec_report.py
Outputs
JSON Schema
json
{
"date": "YYYY-MM-DD",
"decisions": [{"id": "d1", "title": "...", "status": "..."}],
"actions_due": [{"id": "a1", "title": "...", "owner": "...", "status": "..."}],
"themes": [{"name": "...", "stability_score": 0-100}],
"deltas": {
"new": ["..."],
"closed": ["..."],
"updated": ["..."]
},
"deltaComputed": true
}
Markdown Format
markdown
**Executive Daily Report — {DATE}**
## Recommendations
...
## Decisions
...
## Actions Due
...
## Themes
...
Dependencies
- •OpenAI API (gpt-4o)
- •ClickHouse (messages_v2, events_daily)
- •Slack hooks (orion-ops channel)
- •Langfuse (tracing)
Observability
- •Langfuse trace:
executive-daily-report-{date} - •ClickHouse events:
events_daily(agent_id: executive-daily-report) - •Metrics: duration_ms, token_count, decisions_count, actions_count, themes_count
Error Handling
- •Missing input file → Warning, skip gracefully
- •ClickHouse unavailable → Fail fast, alert
- •OpenAI timeout → Retry with exponential backoff (3 attempts)
- •Slack post failure → Log warning, continue (non-critical)