feat(hub): radio Morse mode with WPM speed, per-agent pitch and a 0-100 % speech threshold

Morse keys every picked row whole: class prosign (SOS for MAYDAY), DE with the sender's clear name and the full text, after PARIS timing at the hub's morse.wpm (5-40, default 20) and in the sender's own 550-850 Hz tone from the same sha256 slot as its voice. A higher class cuts a keying row, which keys again whole after it. The speech threshold runs 0-100 % in steps of 10, 100 always open, 0 never. The History card moves into page-radiolog.js to keep page-radioview.js under 500 lines.

🎯 Fix: 85 %
💥 Break: 7 %
💸 Tokens: 100 %
⏱️ Velocity: 100 %
🛡️ Security: 100 %
🏆 Score: 79
🚦 Gate: ⛔ fix 85 % < 90, break 7 % > 5

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kevin Veen-BirkenbachandClaude Opus 5.5 committed 2026-11-15 09:46:05 +00:00
1 parent ded7c9a7b6
commit 86d539a95f
22 files changed
+1147 -286

No files matched your search

+65
View File
@@ -277,6 +277,71 @@ LIGHT = """(async () => {@HELPERS@@RADIO@
await sleep(1500);
return {violations: window.e2eViolations};
})()"""
WPMS = {1920: 12, 1366: 25, 390: 40}
MORSE_SPY = """() => {
(@SPY@)();
const keyed = window.e2eMorse = [];
const start = OscillatorNode.prototype.start;
OscillatorNode.prototype.start = function keying(...args) {
this.e2e = {frequency: this.frequency.value, type: this.type, start: args[0], stop: null, cut: false};
keyed.push(this.e2e);
return start.apply(this, args);
};
const stop = OscillatorNode.prototype.stop;
OscillatorNode.prototype.stop = function unkeying(...args) {
if (this.e2e && args[0] === undefined) {
this.e2e.cut = true;
} else if (this.e2e) {
this.e2e.stop = args[0];
}
return stop.apply(this, args);
};
}""".replace("@SPY@", SPY)
MORSE_KEYED = """
const keyed = () => window.e2eMorse.filter((entry) => entry.stop !== null && entry.stop - entry.start > 1);
const speed = () => spot.querySelector('#radio-gear input[aria-label="Morse speed"]');
const rate = () => text(spot.querySelector("#radio-gear .morse-rate"));
const gear = () => all(".spot-head button", spot).find((button) => name(button) === "Read aloud");
"""
MORSE = """(async () => {@HELPERS@@RADIO@@KEYED@
press("morse");
await sleep(200);
const mode = [pressed(), field("mode"), spot.querySelector('.radio-modes button[data-mode="morse"]').title];
if (gear().getAttribute("aria-expanded") !== "true") {
gear().click();
await sleep(200);
}
const before = [speed().min, speed().max, speed().step, speed().value, rate()];
speed().value = "@WPM@";
speed().dispatchEvent(new Event("input", {bubbles: true}));
const dragged = rate();
speed().dispatchEvent(new Event("change", {bubbles: true}));
const toast = await until(() => all("#toasts .toast strong").map(text).includes("Morse speed saved"), 15000);
await sleep(300);
const saved = [speed().value, rate()];
const gearFits = fits();
gear().click();
await sleep(200);
const at = {tts: audio().tts.length, keyed: keyed().length};
await cue("alarm");
refreshNow();
const playing = await until(() => keyed().length > at.keyed && lamp().dataset.lit === "true", 20000);
const caption = spot.querySelector(".radio-caption");
return {
mode, before, dragged, toast: Boolean(toast), saved, gearFits, playing: Boolean(playing), keyed: keyed().slice(at.keyed), tts: audio().tts.length - at.tts,
lamp: [text(lamp()), lamp().dataset.lit], caption: [caption.hidden, text(caption.querySelector("strong"))], fits: fits(),
};
})()""".replace("@KEYED@", MORSE_KEYED)
MORSE_STOP = """(async () => {@HELPERS@@RADIO@@KEYED@
const last = keyed()[keyed().length - 1];
const caption = spot.querySelector(".radio-caption");
const stop = all("button", caption).find((button) => name(button) === "Stop speaking");
const before = [Boolean(stop), lamp().dataset.lit, last.cut];
stop.click();
const quiet = Boolean(await until(() => lamp().dataset.lit === "false", 2000));
await sleep(500);
return {before, cut: last.cut, quiet, hidden: caption.hidden, later: keyed().filter((entry) => !entry.cut).length};
})()""".replace("@KEYED@", MORSE_KEYED)
def probe(template: str) -> str: