commit 0ad2231fcf782fb2e6252ddc0a6856032b5dbecd
parent 347e3506999c4bbb7c4b8df8a38ae99ec57d6099
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Wed, 11 Nov 2026 10:50:47 -0500
sweep-pipeline: a phrase term that holds another gives its remainder (D2 item 1)
qwen3:8b on the Acolyte question proposed "star wars the acolyte" (10
recordings) and "star wars"; "acolyte" alone (48) was never searched, and the
gate held every item to the long phrase. When one term starts or ends with
another, the rest of it is a term too ("acolyte").
Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat:
2 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/common/lib/report/draft/tasks/selection.test.ts b/common/lib/report/draft/tasks/selection.test.ts
@@ -49,6 +49,8 @@ test("cleanTerms: D0's Acolyte terms lose the subject's name and the generic wor
assert.equal(normalizeTerm('"Wizards of the Coast"'), "wizards of the coast");
assert.equal(normalizeTerm("the acolyte"), "acolyte");
assert.deepEqual(cleanTerms(["contest", "contests"], { names }).kept, ["contest"]);
+ // qwen3:8b's Acolyte terms: the phrase that holds another term gives its remainder.
+ assert.deepEqual(cleanTerms(["star wars the acolyte", "star wars", "comments"], { names }).kept, ["star wars the acolyte", "star wars", "acolyte"]);
});
test("termStats: rarity over the scope; a term in > 25% is common; a capped list scores but never nominates", () => {
diff --git a/common/lib/report/draft/tasks/selection.ts b/common/lib/report/draft/tasks/selection.ts
@@ -113,6 +113,17 @@ export function cleanTerms(proposed: readonly unknown[], o: { names: ReadonlySet
else if (kept.some((k) => k === `${t}s` || `${k}s` === t)) dropped.push({ term: t, why: "a plural of another term" });
else kept.push(t);
}
+ // A phrase that holds another term ("star wars the acolyte" and "star
+ // wars"): its remainder is a term too ("acolyte"; qwen3:8b on the Acolyte
+ // question proposed only the two, and "acolyte" alone was never searched).
+ for (const t of [...kept]) {
+ for (const k of kept) {
+ if (k === t || !t.startsWith(`${k} `) && !t.endsWith(` ${k}`)) continue;
+ const rest = normalizeTerm(t.startsWith(`${k} `) ? t.slice(k.length + 1) : t.slice(0, t.length - k.length - 1), o.names);
+ const rw = rest.split(" ");
+ if (rest.length >= 4 && !kept.includes(rest) && !rw.every((w) => GENERIC_WORDS.has(w) || o.names.has(w))) kept.push(rest);
+ }
+ }
const max = o.max ?? 6;
for (const t of kept.slice(max)) dropped.push({ term: t, why: `more than ${max} terms` });
return { kept: kept.slice(0, max), dropped };