8000 GitHub - dominicci/Church-App · GitHub
[go: up one dir, main page]

Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Live Event Orchestration Engine

Overview

A local-first, deterministic state management engine for live church presentation systems. Uses hybrid triggers (hot-word detection + manual overrides) to seamlessly transition between presentation modes (Lyrics, Bible, Idle).

Architecture

  • Pattern: Finite State Machine (FSM) with strict type validation
  • Latency Target: <500ms for hot-word processing
  • Matching: Fuzzy matching using Levenshtein distance (threshold: 0.85)
  • Data Integrity: All outputs validated against Pydantic schemas

Project Structure

.
├── orchestrator_schema.py      # Pydantic data models
├── state_machine_def.json      # FSM configuration
├── orchestration_engine.py     # Core engine implementation
├── verify_engine.py            # Verification test suite
├── requirements.txt            # Python dependencies
└── README.md                   # This file

Quick Start

1. Install Dependencies

This project uses uv for dependency management:

# Create virtual environment (if not already created)
uv venv

# Install dependencies
uv sync

2. Run Verification Suite

uv run verify_engine.py

This will:

  • Initialize the engine in IDLE state
  • Test fuzzy matching ("Let us sing" → LYRICS)
  • Test exact matching ("Turn your bibles to" → BIBLE)
  • Test no-match behavior ("Hot dog" → no transition)
  • Generate transition_log.json with all state transitions

Usage Example

from orchestration_engine import OrchestrationEngine
from orchestrator_schema import ServiceState

# Initialize engine
engine = OrchestrationEngine()

# Hot-word trigger (fuzzy match)
event = engine.transition("Let us sing")
print(event.to_state)  # ServiceState.LYRICS

# Manual override
event = engine.transition("", trigger_source="manual", manual_state=ServiceState.IDLE)
print(event.to_state)  # ServiceState.IDLE

State Machine

States

  • IDLE: Default state, clear screen
  • LYRICS: Display song lyrics
  • BIBLE: Display scripture

Hot-Word Triggers

  • "Let's sing", "Worship with me", "Join me and sing" → LYRICS
  • "Open your Bibles", "Turn to", "Let's read" → BIBLE
  • "Thank you everyone" → IDLE

Transition Rules

  • IDLE → [LYRICS, BIBLE]
  • LYRICS → [IDLE, BIBLE, LYRICS]
  • BIBLE → [IDLE, LYRICS, BIBLE]

Success Criteria ✓

  • Engine initializes in IDLE state
  • Fuzzy match "Let us sing" → LYRICS
  • Exact match "Turn your bibles to" → BIBLE
  • No-match "Hot dog" → no transition
  • JSON payload logging with confidence scores

Next Steps

  • Integrate with audio input (Vosk/Porcupine for local speech recognition)
  • Build renderer (React/Flutter UI) to consume state events
  • Add telemetry for latency monitoring
  • Implement phonetic matching for accent variations

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0