Skip to content

[agency] Create hybrid CLJS transcription analyzer #13

Description

@meekmachine

Goal

Create the Polyester transcription agency as a hybrid ClojureScript analyzer/reducer plus host adapter for browser speech and microphone effects.

Current state

Polyester root still inherits the TypeScript transcription service from Latticework. There is no src-cljs/latticework/transcription.cljs agency yet. The current TypeScript service owns SpeechRecognition, mic permission, AudioContext analyzers, reference-track echo filtering, restart timers, and interruption state.

This mirrors the Latticework research issue: meekmachine/Latticework#38.

Clojure-way direction

  • Main thread owns SpeechRecognition, getUserMedia, AudioContext, MediaStreamTrack, analyzer nodes, and sampling loops.
  • CLJS owns transcript normalization, interim/final transcript state, echo-filter policy, interruption threshold/latch state, and serializable transcript/interruption decisions.
  • Host sends plain audio-level samples, reference-level samples, and speech-recognition events into the planner.
  • Planner emits data events: transcript interim/final, interruption detected/cleared, restart/stop recommendations, and state snapshots.

Acceptance criteria

  • Existing transcription public API remains source-compatible through an adapter.
  • Current interruption behavior remains equivalent: audio interruption stops TTS, final interrupted transcript processes once, transcript-only fallback stays disabled by default unless configured.
  • No CLJS worker code references SpeechRecognition, navigator, AudioContext, MediaStream, DOM, or requestAnimationFrame.
  • Add tests for transcript normalization, echo-filter thresholds, interruption latch/release, final transcript handling, restart policy, and cleanup.
  • Conversation agency can consume transcription events as plain data, independent of browser API objects.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions