Skip to content

API Connection Opportunities — Hinata Endpoint Wiring

  period: project
  owner: trunks + jimmy-neutron
  status: staging
  created: 2026-05-27

Current State

The /events endpoint at api.michael-engineer.dev is live. 3 producers. 1 consumer. 31 of 34 LaunchAgents don't emit events — 91% silent. The endpoint is a working heart with one artery wired.

  EndpointURLStatus

    /eventshttps://api.michael-engineer.dev/events (POST + GET)LIVE on jimmy-vps · x-hinata-key auth
    /football/profilessame hostLIVE since 2026-05-26 (497 profiles loaded)
    /musicmastery/*same hostLIVE (powers Studio MusicMastery tab)

A — Producer Instrumentation (highest leverage)

One-line emit_event() call appended to each LaunchAgent script. 31 silent → 31 vocal in one PR.

Key targets: hinata-bot-poller (bot.reply), telegram-poller (telegram.received), mail-poller (mail.received), refresh-tasks (task.close/open), nightly-vault-diff (vault.diff), morning-briefing (briefing.sent), smoking-update (smoking.zoot_logged), bodybuilding-update (fitness.session), football pollers, health-export, transcribe-audio, inbox-clear.

Total potential: ~30 new event types with one shared helper (emit_event.sh already exists).

B — Consumer Surfaces

  • B.1 Dashboard "system pulse" widget — last 24h event count, sparkline of event flow, top 3 emitters, "Stuck" alert if any LaunchAgent silent >24h. Effort: ~1 hour.

  • B.2 Per-Commander event filter — slim ActivityLog in each Commander tab filtered by source/kind. Effort: ~1 hour.

  • B.3 Calendar event overlay — overlay events onto Calendar grid as markers per day cell. Effort: ~2 hours.

  • B.4 Bot context injection — inject last 5 events into Commander LLM context per bot turn. Effort: ~30 min.

  • B.5 Telegram daily digest — end-of-day script (21:30) reads 24h events, sends 3-5 highlights. Effort: ~30 min.

  • B.6 Orochimaru weekly event-pattern analysis — new emitters, stuck emitters, frequency drift, compound patterns. Effort: ~1-2 hours.

C — New API Tenants

  TenantURLPurposeStatus

    /bulmaapi.michael-engineer.dev/bulma/*finance queriesStaged #840064 (Wave 3)
    /calendar/calendar/*calendar aggregates · clash detection · auto-accept statsNEW
    /tasks/tasks/*task queries — open/closed/age · loop-evidence triggersNEW
    /health/health/*Apple Health aggregates — workout summary · HRV trend · sleep scoreNEW
    /smoking/smoking/*zoot-state · nudge response rates · streak queryNEW
    /commander/{name}/commander/{name}/snapshotgeneric Commander snapshot — what every bot reads on each turnNEW (#840060)

E — Webhook Fan-Out (advanced)

Events can trigger other LaunchAgents via a small dispatcher: monzo.written → kick snapshot rebuild immediately; vault.commit → kick relevant audit; smoking.zoot_logged → fire smoking-nudge calc + Telegram. Mechanism: new event-dispatcher.py LaunchAgent runs every 60s. Effort: ~3 hours for dispatcher + 1 hour per rule.

  WaveScopeEffort

    1Mass producer instrumentation (A) — append emit_event to 20 LaunchAgents~2 hr
    2Dashboard system pulse widget (B.1)~1 hr
    3Per-Commander event filter (B.2)~1 hr
    4Bot context injection (B.4)~30 min
    5Telegram daily digest (B.5)~30 min

Cumulative effort to Wave 5: ~5 hours total. Entire system becomes event-driven, every LaunchAgent observable, every bot context-aware.

◆ hinata · projects/api-connection-opportunities.html · phase-18 flatten