Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.simplefunctions.dev/llms.txt

Use this file to discover all available pages before exploring further.

SF tags every async write with a trace_id so you can reconstruct what happened, who initiated it, and which downstream rows it produced.

What gets tagged

The 9 priority tables:
  • cost_events
  • intents
  • portfolio_ticks
  • portfolio_trades
  • thesis_evaluations
  • heartbeat_logs
  • cron_run_log
  • health_alerts
  • market_scans
Each row carries a trace_id UUID set at the start of the parent operation.

Cron run log

Every cron route is wrapped by observeCron(routeName, fn) which:
  • Generates a trace id at start.
  • Writes a cron_run_log row at end with status (ok | failed), duration_ms, rows_written, error_msg.
  • Surfaces missed runs via the registry-check cron.

Health alerts

When a write fails or a chain breaks, the responsible code calls logHealthAlert(kind, details) which writes to health_alerts. The heartbeat surface aggregates these for ops review.

Reading a trace

GET /api/audit/trace/<trace-id>
Returns the full chain: which cron started it, every row it touched, every downstream alert.

Why this exists

A prior incident (Apr 2-3 2026 outage) was masked because cron failures were silent. Provenance is the structural fix introduced by SPEC-50 phase A: trace_id, cron_run_log, observeCron, and health_alerts together turn silent failures into auditable events.

Next steps

Heartbeat

How operators see this in practice.

Snapshots

Daily R2 archives include all 9 tables.