Repository navigation
feat(voice,dialectic): transport commands, in-loop intercept, typed-prompt input, and biofeedback docs (issue 8) - #80
Open
aurascoper wants to merge 2 commits into
Open
aurascoper wants to merge 2 commits into
aurascoper wants to merge 2 commits into
Conversation
…yped-prompt input path
Two things people say back to the voice, "say that again" and "slow down",
were reaching the dialectic generators as prompts. This adds them as first
class commands on both surfaces and gives the hypnagogic loop a keyboard.
Transport commands
- AppCommand gains .repeatLastUtterance ("tts.repeat") and .slowDownSpeech
("tts.slow-down"), with descriptors (aliases from the interaction logs),
dispatcher arms and AppCommandDispatchTarget methods.
- AppViewModel tracks lastSpokenText and a speechRateScale (steps of 0.15,
floor 0.5) applied to every planned prosody in speak(text:); repeat and
slow-down forward to a running HypnagogicDialecticLoop, which owns its own
last voiced turn.
- HypnagogicDialecticLoop intercepts transport phrases in runTurn before any
generation (classifyTransportCommand), re-speaks the last voiced turn with
a cumulative rate offset (steps of 0.08, floor -0.20, rate never below
0.25), logs a candidate-less silent turn so the harness turn count still
advances, and never touches the silence counter. App-side entries
repeatLastUtterance() and slowDownSpeech() do the same without a log line.
- StubCommandRecognizer: an exact alias now wins over a longer alias it
prefixes, so "say" stays .speak beside the new "say that again".
Typed-prompt input
- TypedPromptListener (BCICore): a HypnagogicListening actor fed by typed
text; FIFO, suspends until submit, drops blank lines, cancel() resumes
waiters with nil. parseSeedLines(_:) is the shared seed-file parser.
- dialectic-session --seed-file <path>: prompts from a file, one per line,
# comments and blank lines skipped, queued before any <heard...> args;
positional heard lines may then be empty.
- App: DialecticInputSource (microphone | typedPrompt) on AppViewModel,
TypedPromptPanel in ContentView while the loop is enabled, the loop
rebuilt on a source change, no mic authorization on the typed path, and
the banner badge reading "Typed + Cloud" when typing.
Tests
- New: TypedPromptListenerTests, HypnagogicDialecticLoopTransportTests.
- Updated pins: AppCommandTests, AppCommandDispatcherTests (vocab 12 -> 14,
allCasesForTesting), AppViewModelVoiceCommandTests spy, Stub and Fuzzy
recognizer suites gain transport cases.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ESMEkNUJgN9USJkov7oWDH
README.md - Add the five NEURALCOMPOSE_BIOFEEDBACK_* variables to the environment variable table. - New "Biofeedback out (OSC and CoreMIDI)" section: the run-biofeedback-osc.sh flags, the Mind Monitor-compatible address table as MindMonitorMirror actually emits it (no touching_forehead, no batt), custom BiofeedbackMapping routes with their HealthPolicy, the virtual MIDI source name, and the loopback / LAN privacy tiers as the banner shows them. - Architecture tree, load-bearing boundaries and repository layout now list BCIBiofeedback. HARDWARE_SETUP.md - New subsection under the Mind Monitor transport: outbound biofeedback OSC (UDP 7000, or 9000) vs the inbound Mind Monitor listener (UDP 5000), why the ports must differ, and why the native BLE profiles and Mind Monitor cannot hold the headband at the same time (one BLE central). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ESMEkNUJgN9USJkov7oWDH
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacked on
origin/mainatbdfc4e9as two commits:5b8224a-feat(voice,dialectic): transport commands ("say that again", "slow down") on both surfaces, sharedSpeechRatePolicy, and the typed-seed path for the CLI and the app.369283b-docs(biofeedback): Issue 8 sections forREADME.mdandHARDWARE_SETUP.mdcovering the ADR-011 OSC and CoreMIDI egress.Review Findings Addressed (A-D)
SpeechRatePolicyinBCICore):scaled(_:by:), step0.15, floor0.5soProsodyWobbleclause ratios survive) and the dialectic competition additive offset adapter (offset(_:by:), step0.08, floor-0.20, rate floor0.25so pole cadence separation survives) into one sharedSpeechRatePolicycontract inSources/BCICore/Protocols/SpeechSynthesizing.swift.HypnagogicDialecticLoopTransportTests.testStandingSlowDownShapesTheNextVoicedTurnToocompares the second real turn of["the sea", "slow down", "the sea"]against a baseline["the sea", "the sea"]loop (accounting for Turn 1 populatingDialecticalMemoryhistory/reply centroids).HypnagogicDialecticLoopTransportTests.testReplayPreservesNodeIDEmbeddingSilenceCounterAndMemoryverifies that consecutive transport replays ("say that again","repeat that") do not callgenerator.generate, preserve the originalSpokenNodeEvent.nodeID("0") andembedding, do not incrementconsecutiveSilence(maxConsecutiveSilence = 2never fires a silence cue), and do not duplicate the reply or insert transport phrases intoConversationHistory.AppViewModelVoiceCommandTests.testTypedPromptInputEnqueuesWithoutRequestingMicAuthorizationAndRetainsRuntimeDisclosureverifies that selectingDialecticInputSource.typedPromptand submitting a prompt queues intoTypedPromptListenerwith zero calls to microphone/speech authorization while retaining the runtime disclosure.README.mdandHARDWARE_SETUP.mdmatch the mergedBCIBiofeedbackimplementation onmain(fiveNEURALCOMPOSE_BIOFEEDBACK_*variables,MindMonitorMirroraddress table, customBiofeedbackMappinghealth policies, loopback vs LAN privacy tiers, and the single-BLE-central constraint scoped explicitly to the supported Muse native-BLE profilesmuseTwoNativeBLE,museSNativeBLE, andmuseSAthena).Verification Gates (Compiled & Executed on macOS Apple Silicon)
FuzzyCommandRecognizerTests(14/14) &StubCommandRecognizerTests(17/17)HypnagogicDialecticLoopTransportTests(9/9, 0 failures)HypnagogicDialecticLoopTransportTests+AppViewModelVoiceCommandTests(13/13)TypedPromptListenerTests(12/12, 0 failures)testTypedPromptInputEnqueuesWithoutRequestingMicAuthorizationAndRetainsRuntimeDisclosure--seed-filedry-runswift run dialectic-session --dry-run --seed-file /tmp/seed.txt focusedexits 0./Scripts/build.sh+swift testacross all 9 test targets (BCIBiofeedbackTests71/71,BCIEEGTests100/100,NeuralComposeAppTests,BCIVoiceTests,BCICloudBridgeTests,BCIPeerBridgeTests,BCIClassifierTests,BCILLMTests,WorldModelDemoTests,BCICoreTests)HypnagogicDialogueLoopmirror mode does not intercept transport commands; app-triggered replay while mic is hot can be heard on the mic path