Skip to content

Wire heartbeat module to telemetry endpoint in daemon event loop #26

@Brad-Edwards

Description

@Brad-Edwards

Problem

daemon/heartbeat.c implements frame-count anomaly detection (freeze/rewind) and timeout tracking. It has 10 unit tests, all passing. But it's never called from the daemon's event loop or connected to the Lambda telemetry API (platform/api/handler.py has POST /heartbeat ready).

The heartbeat tracker is dead code in production — fully implemented, tested, and unused.

What exists

  • daemon/heartbeat.{h,c}owl_hb_register(), owl_hb_process(), owl_hb_check_timeout(), anomaly detection
  • platform/api/handler.pyPOST /heartbeat endpoint, returns action (continue/kill/pause), DynamoDB storage
  • daemon/main.c — no heartbeat initialization, no periodic heartbeat send, no telemetry HTTP client

What's missing

  1. Heartbeat send loop — periodic POST to telemetry API with frame count, state hash, timestamp
  2. HTTP client in daemon — libcurl is already in LDFLAGS (-lcurl) but unused
  3. API key retrieval — SSM parameter store has the key; daemon needs to read it or accept via CLI/env
  4. Response handling — telemetry API can return kill/pause actions; daemon should honor them

Acceptance

  • Daemon sends heartbeats to configured telemetry endpoint every N seconds
  • Telemetry API receives and stores heartbeats
  • Frame freeze/rewind anomalies detected and reported
  • Timeout (missed heartbeats) generates OWL_EVENT_HEARTBEAT_MISSED

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions