{
  "schema": "sonic_forage_live_framework_lesson.v1",
  "generated_utc": "2026-05-13T07:37:34Z",
  "status": "operator_lesson_demo_review_only_stream_already_running_no_new_provider_action",
  "purpose": "A full-page operator lesson/demo that explains the Sonic-Forage generated-radio/live-code framework, shows what can be tested, and records closed gates.",
  "live_receipt": {
    "modal_app": "sonic-forage-kick-generated-radio-v4",
    "modal_app_id": "ap-Ja4Z0jhsshIKj34JjDs3zE",
    "state": "ephemeral",
    "tasks": 1,
    "source": "Modal browser/Xvfb/FFmpeg pusher using generated radio MP3 plus operator page",
    "evidence": "FFmpeg frames/time advanced at speed near 1x after restart; Modal app list showed one task. Kick public viewer status is platform-side and may cache/stale outside this receipt."
  },
  "architecture_lanes": [
    {
      "id": "single_primary_pusher",
      "title": "Single primary pusher",
      "explain": "Exactly one Modal task owns the Kick RTMPS feed. Local duplicate pushers stay off unless deliberately used as a labeled bypass."
    },
    {
      "id": "browser_program_surface",
      "title": "Browser program surface",
      "explain": "A static/operator HTML surface becomes the visual show: music mode, build wall, chat/code queue, lesson/demo panels."
    },
    {
      "id": "generated_audio_bed",
      "title": "Generated audio bed",
      "explain": "Owned/generated 40-minute radio MP3 loops under FFmpeg, keeping music on while the page explains the system."
    },
    {
      "id": "safe_queue",
      "title": "Safe chat/build queue",
      "explain": "Viewer sparks become reviewed queue cards and proof artifacts. Chat never runs shell commands directly."
    },
    {
      "id": "watchdog",
      "title": "Watchdog + receipts",
      "explain": "A no-agent cron checks Modal app/task state every five minutes and restarts only if the active Modal task disappears."
    }
  ],
  "things_we_can_do": [
    "Show a full lesson/demo page on stream without exposing secrets.",
    "Render live build-wall/status cards from safe JSON files.",
    "Turn chat ideas into queue cards, proof cards, bumpers, poems, badges, and review-only artifacts.",
    "Swap to new visual lessons or episode blocks through a controlled single-primary Modal refresh.",
    "Add OBS takeover/human co-host lanes while preserving a fallback AI/default feed.",
    "Add Kick API/EventSub-like crowd feedback later only through least-privilege OAuth and webhook gates."
  ],
  "tests_available": [
    {
      "id": "static_html_parse",
      "command": "PYTHONDONTWRITEBYTECODE=1 python3 scripts/verify_sonic_forage_live_framework_lesson.py",
      "expected": "HTML parses, manifest fields pass, closed gates remain false."
    },
    {
      "id": "modal_dry_run",
      "command": "modal run /opt/data/scripts/kick_24h_streamer_generated_radio_mix_v4.py --dry-run-seconds 12 --hours 0.01",
      "expected": "Browser/Xvfb/FFmpeg emits frames to null at speed near 1x."
    },
    {
      "id": "modal_live_task_check",
      "command": "modal app list --json | check sonic-forage-kick-generated-radio-v4 Tasks == 1",
      "expected": "Exactly one active Modal task for the live source."
    },
    {
      "id": "secret_redaction_check",
      "command": "scan changed docs/scripts for sk_ / live_ / token-like strings",
      "expected": "No stream keys or private tokens are committed or displayed."
    },
    {
      "id": "browser_console_check",
      "command": "Open docs/operator/sonic_forage_live_framework_lesson.html in browser",
      "expected": "No console errors; page readable at 1280x720 and mobile widths."
    }
  ],
  "closed_gates": {
    "starts_new_stream": false,
    "stops_existing_stream": false,
    "prints_stream_key": false,
    "chat_to_shell": false,
    "payments_or_outreach": false,
    "provider_spend": false,
    "model_training_or_upload": false,
    "public_posting": false,
    "cron_mutation_from_page": false
  },
  "human_approval_needed_for": [
    "Replacing the currently live Modal source with this lesson page as the public visual feed.",
    "Enabling real Kick API OAuth/webhooks beyond local/safe JSON demos.",
    "Letting chat influence anything outside a reviewed queue artifact.",
    "Paid provider generation, model training, dataset/model upload, public posts, payment links, or outreach."
  ],
  "proof_paths": [
    "docs/operator/sonic_forage_live_framework_lesson.html",
    "docs/data/sonic-forage-live-framework-lesson.json",
    "scripts/verify_sonic_forage_live_framework_lesson.py",
    "docs/operator/sonic_forage_music_mode_chat_code_v3.html"
  ]
}
