feat(orchestrator): Gibberlink radio mode with ggwave and a fallback selector (018)

A new radio mode sends each spoken row as ggwave frames of at most 140 bytes: frame 1 carries the full session id, later frames its 8-character prefix, each with n/m. engines.sound_of() gives every speaker one of the four audible ggwave protocols that decode every frame length, plus its own stereo position, by a stable hash. The vendored ggwave 0.4.0 (MIT, LICENSE kept, sha256 pinned in test_hub_artifacts) runs only in the /gibberlink encoder page, sandboxed into an opaque origin with eval and WebAssembly but no connection; the hub page frames it (frame-src 'self') and review pages refuse framing (frame-ancestors 'none'). The radio gear gains a fallback selector (Gibberlink, Morse, Hiss) for rows that speech cannot play.

Accepted MEDUSA false positives (security.py accept after kvb-think-criticize, 2026-11-17): engines.py FTSCAN-231 INF-SCAN-2638 INF-SCAN-2057 STG009 B603; handler.py FTSC-SCAN-089 B105 EXA002 EXA006; view.py WEB-FLASK-004 FINE-043 LO002.

🎯 Fix: 91 %
💥 Break: 4 %
💸 Tokens: –
⏱️ Velocity: –
🛡️ Security: 100 %
🏆 Score: 87
🚦 Gate: ✅ 90/5, tokens and velocity <= 100, security 100 %

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kevin Veen-BirkenbachandClaude Opus 5.5 committed 2026-11-17 19:05:40 +00:00
1 parent af3555e88b
commit 621dc7536f
23 files changed
+1021 -34

No files matched your search

+13 -8
View File
@@ -27,11 +27,11 @@
/**
* @param {object|undefined} step the step the radio set plans now at the index that plays.
* @param {string} kind word, speech or burst: what plays or is about to play there.
* @returns {boolean} whether that sound may play: the planned kind, or the burst standing in for a planned speech line.
* @param {string} kind word, speech, or a fallback kind (gibberlink, morse, burst): what plays or is about to play there.
* @returns {boolean} whether that sound may play: the planned kind, or a fallback standing in for a planned speech line.
*/
function allows(step, kind) {
return Boolean(step) && (step.kind === kind || (kind === "burst" && step.kind === "speech"));
return Boolean(step) && (step.kind === kind || (RadioSet.FALLBACKS.includes(kind) && step.kind === "speech"));
}
function speechFailed(lines) {
@@ -54,7 +54,7 @@
function preempt() {
const {item, source} = speech;
const [first] = speech.pending;
if (item && source && item.playing === "morse" && first && Voice.rank(first) < Voice.rank(item)) {
if (item && source && RadioSet.KEYED.includes(item.playing) && first && Voice.rank(first) < Voice.rank(item)) {
speech.item = null;
speech.pending = Voice.enqueue(speech.pending, item, SPEECH_QUEUE);
source.stop();
@@ -224,8 +224,8 @@
await burst(audio, item);
continue;
}
if (step.kind === "morse") {
voiced = (await keyMorse(audio, item, step)) || voiced;
if (RadioSet.KEYED.includes(step.kind)) {
voiced = (await keyed(audio, item, step)) || voiced;
done -= Number(item.cut);
continue;
}
@@ -244,11 +244,16 @@
speechFailed([failed]);
}
if (failed && step.kind === "speech" && speech.item === item && allows(stepOf(item, done), "burst")) {
item.playing = "burst";
await burst(audio, item);
const stand = item.row ? RadioSet.standIn(item.row, radioSet) : {kind: "burst"};
item.playing = stand.kind;
await (stand.kind === "burst" ? burst(audio, item) : keyed(audio, item, stand));
}
}
function keyed(audio, item, step) {
return step.kind === "morse" ? keyMorse(audio, item, step) : keyGibberlink(audio, item, step);
}
async function pump() {
if (speech.busy || !speech.pending.length) {
return;