// Read-aloud cues (demo epic D2, round b), on the transcripts of the claims // the grader marked "not his words" in D0 and round a (11 Nov 2026), and on // ones that are his own. import { test } from "node:test"; import assert from "node:assert/strict"; import { cuesLine, READ_ALOUD_FLAG, readAloudCues } from "./readAloud"; const cues = (before: string, quote: string, after = "", hosts: string[] = ["jeremy", "quartering"]) => readAloudCues({ before, quote, after, hosts }).map((c) => c.cue); test("a tweet being introduced, its likes read out, 'writes', 'here you have': the quote is read aloud", () => { // i123-d-q25 k06: Shad's tweet. assert.deepEqual( cues( "there's one thing I want to one way that put one tweet that put it really good I want to give them credit for it because um you know I need to do better about that but like here Shad uh writes from", "Shad adversity the acolyte episode 5 doesn't understand power scaling at all which is crucial if you want consistency and investment in a fight", ), ["tweet", "writes"], ); // i123-d-q25 k05: the End Wokeness tweet, its likes read out. assert.deepEqual( cues( "even polygon which is a you know extremely left leaning uh publication is turning on it here you have n wokeness 19,000 likes here it is", "Disney's latest episode of Star Wars the acolyte has a they them pronoun scene the pronouns of the acolyte are garbage", ), ["likes", "here"], ); }); test("an article, a clip, a rumour, a letter, 'also added', 'saying' right before the quote", () => { assert.ok(cues("eight percent is a non-starter i did see this article out via bounding in the comics it said", "new rumor details that disney encouraged individuals to delete twitter accounts").includes("article")); assert.deepEqual(cues("and you see see this clip from Looper which they only deleted after massive backlash some audience members have issues with the show's diversity", "they do however viewers should genuinely examine the legitimate criticisms the acolyte has received"), ["clip", "here"]); assert.deepEqual(cues("and even hinted at her desire to join the franchise in the past according to some", "larson is set to be involved in an animated spin-off show"), ["according to"]); assert.ok(cues("this is not just a problem for alan dean foster who wrote this to disney dear mickey we have a lot in common this is the letter he wrote them", "you acquired and acquired the rights to some books that i wrote").includes("letter")); assert.deepEqual(cues("that's what it seems like they're saying interestingly enough wwe pro also added", "kathleen kennedy while in charge of lucasfilm for the next three years is being stripped of any control over star wars"), ["writes", "says", "saying"]); assert.deepEqual(cues("he went on to find humor in the situation saying", "can we please appreciate the irony of youtube accusing papa of using this word"), ["saying"]); }); test("what he says AFTER it: 'this is from … shout out good take', 'this is a lie', 'what a shame'", () => { // i123-d-q25 k04: nothing before the quote says it is read. assert.deepEqual(cues("she's an attention seeking dless celebrity the truth is Star Wars", "the acolyte sucks and her performance is terrible", "it's not racism her performance is just weak in the RO in the role this is from Roar Ashley shout out good take and I r"), ["from (after)"]); // D0 a k01: the review he reads to deny it. assert.ok(cues("", "the reason for the ban was constant sexual harassment", "this is a lie this is liable this is slanderous").includes("reaction (after)")); // i123-d-q3b k27: a critic's review. assert.deepEqual(cues("in fact", "the acolyte keeps reminding me of the prequel trilogy in all the worst ways", "ah well what a shame I'll keep watching obviously"), ["reaction (after)"]); }); test("the quote names the host in the third person — but not his own sign-on; a chat line; reported speech inside it", () => { assert.deepEqual(cues("", "Jeremy Hambly was banned by Wizards of the coast from attending sanctioned events for the company's games"), ["names the host"]); assert.deepEqual(cues("", "what's going on everyone Jeremy here from the quartering and I don't think many people would disagree"), []); assert.deepEqual(cues("", "Jeremy are from the quartering and it's a tale as old as time"), [], "the transcript's mis-hearing of the sign-on"); assert.deepEqual(cues("", "you'll find my name Jeremy Hambly as a lifetime banned player"), []); assert.deepEqual(cues("", "sologamer5 says hey jeremy been a while glad to see your work ethic hasn't slacked off"), ["names the host", "chat"]); assert.deepEqual(cues("", "the one thing they can use now they're saying if you rely upon misinformation then it tells me you're afraid of the truth"), ["saying"]); }); test("the words right before the quote, and 'this via' after it (round b's own runs)", () => { // d-nf-1 k29: what the showrunner says, as he reports it. assert.deepEqual(cues("i mean you see leslie hedland again harvey's best friend who heads up the show says", "the acolyte is the gayest Star Wars"), ["says"]); // d-nf-1 k16: a tweet. assert.deepEqual(cues("i wonder how many of those are people who are literally just hate watching now we have chris gore writing", "the acolyte episode 7 might be the most amateurish poorly written episode of TV ever"), ["says", "saying"]); // d-nd-1 k08: "emon uh saying uh andy mayan so". assert.deepEqual(cues("let's just get right to some of the reactions first we'll get uh emon uh saying uh andy mayan so", "the third episode of Star Wars the acolyte basically ruins the original films"), ["saying"]); // d-nf-1 k02, k21, k17. assert.deepEqual(cues("in terms of what makes a character uh good for you you can see", "the acolyte showrunner disney hadlon recently provided some"), ["says"]); assert.deepEqual(cues("they marked the fresh on rotten tomatoes because they include phrases such as", "the acolyte doesn't offer anything new to the universe the way the Andor did and it feels forced"), ["says"]); assert.deepEqual(cues("reprising his role as darth vader lucasfilm also revealed that", "the name and premise of the russian doll creator leslie hedland's disney plus series the acolyte"), ["says"]); // d-nf-1 k05: the Forbes headline, named after it. assert.deepEqual(cues("so we'll go and we'll cover another rag in forbes magazine", "the acolyte episode 3 review one the most disappointing Star Wars episodes ever made", "this via Eric Kane who is generally pretty even keeled in his reviews"), ["from (after)"]); // b-nf-1 k19: a designer's tweet. assert.deepEqual(cues("principal game designer at wizards of the coast pronouns in the bio going on to say", "hard week for my heart and many of yours still feeling raw today"), ["writes"]); // His own: "and I said", "I'm just saying", "the writing on the wall", an email he was sent. assert.deepEqual(cues("so i looked at the numbers and i said", "the acolyte is the worst rated Star Wars show there has ever been"), []); assert.deepEqual(cues("look i'm just saying", "the acolyte is the worst rated Star Wars show there has ever been"), []); assert.deepEqual(cues("because i saw the writing on the wall it was", "eventually barred from playing in any official Magic the Gathering events"), []); assert.deepEqual(cues("there's a video on my channel that shows the actual email i got from wizards of the coast that showed why i was banned", "that's why people like oh isn't that the guy that got banned for harassing a cosplayer no"), []); }); test("his own words with nothing around them that says reading: no cue", () => { // i123-d-q3b k01, k09, k20 (graded supported, his own). assert.deepEqual(cues("so the show is out and", "the reviews are absolutely bottoming out the last review I saw for it was a 2.2 on IMDb and a certified rotten review score on Rotten Tomatoes", "everybody is absolutely"), []); assert.deepEqual(cues("and I think that", "the acolyte you know has single-handedly removed has destroyed uh the lore of Star Wars", "and that is something"), []); assert.deepEqual(cues("what's going on everyone", "the acolyte has been soundly rejected by any respectable Star Wars fan", "and today"), []); }); test("a cue far back does not count for the near ones; each cue is reported once, with the words that matched", () => { const far = `he also added ${"and then we went on with the show and nothing else was read at all ".repeat(5)}`; assert.deepEqual(cues(far, "I think the show is bad and I have said so from the first trailer"), []); const got = readAloudCues({ before: "one tweet here another tweet 371 likes", quote: "you people are making a mistake nothing was offensive", after: "" }); assert.deepEqual(got, [ { cue: "tweet", where: "before", match: "tweet" }, { cue: "likes", where: "before", match: "371 likes" }, ]); assert.equal(cuesLine(got), "tweet (“tweet”), likes (“371 likes”)"); assert.ok(READ_ALOUD_FLAG.length <= 60, "a claim's flag is at most 60 characters"); }); // The review of round b (12 Nov 2026): the after-quote pattern backtracked // for ever on one long word ("a"×60 never returned). Every pattern, at every // place it reads, on long and adversarial text: under 50 ms. test("the cues are linear: long words, repeated syllables, digits, 100k-character text", () => { const big = (s: string) => s.repeat(Math.ceil(100_000 / s.length)).slice(0, 100_000); const inputs = [ "a".repeat(200), "a".repeat(60), "x".repeat(150), "ha".repeat(75), "7".repeat(150), "1,".repeat(75), big("a "), big("a"), big("see "), big("you see "), big("1, "), big(" ."), big("jeremy "), big("i'm jeremy "), big("hey "), big("@a"), big("says "), big("oh"), big("mm"), "a".repeat(100_000) + " what a shame", ]; for (const s of inputs) { for (const where of ["before", "quote", "after"] as const) { const o = { before: "", quote: "the quote", after: "", hosts: ["jeremy", "jeremy hambly", "the quartering"], [where]: s }; const t0 = performance.now(); readAloudCues(o); const ms = performance.now() - t0; assert.ok(ms < 50, `${where} = ${JSON.stringify(s.slice(0, 12))}×${s.length}: ${ms.toFixed(1)} ms`); } } }); test("'what a shame', 'goes on to say' within the first ten words after the quote, and not past them", () => { assert.deepEqual(cues("", "the show is bad", "ah well what a shame I'll keep watching"), ["reaction (after)"]); assert.deepEqual(cues("", "the show is bad", "and then he goes on to say more"), ["reaction (after)"]); assert.deepEqual(cues("", "the show is bad", "one two three four five six seven eight nine ten imagine that"), ["reaction (after)"]); assert.deepEqual(cues("", "the show is bad", "one two three four five six seven eight nine ten eleven imagine that"), []); assert.deepEqual(cues("", "the show is bad", "a".repeat(60) + " what a shame"), ["reaction (after)"]); assert.equal(readAloudCues({ before: "", quote: "q", after: "ah well what a shame I'll" })[0]!.match, "ah well what a shame"); });