commit c8e95c172125c5fb295f9b579a7ee93e86e4e845
parent c82fb58bb0a4dee913f5a9f6f292bbe47edaa1c9
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Wed, 4 Nov 2026 20:17:22 -0500
umtool: a project's own masked word is masked whole -- no first letter on the card
A word a cut adds to its slur filter (`posts slurs <p> add <word>`) is most often a
name kept off the card; its pill showed the first letter ("r*******"), which spells
half of it. It is now all stars, the length of the word; an add entry that gives its
own `mask` keeps it, and the built-in slurs keep their first letter. The CLI's
confirmation prints the whole mask too (operator, 4 Nov: "we probably shouldn't show
the first letter of his name on the visual").
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
4 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/umtool/lib/report/postSlurs.test.mjs b/umtool/lib/report/postSlurs.test.mjs
@@ -87,7 +87,7 @@ test("posts slurs on|off|level|visual|voice|add|except|remove: one writer, refus
await ok("level", "strong");
await ok("visual", "blackout");
await ok("voice", "skip");
- assert.match(await ok("add", "zorbo"), /z\*{4} is masked in this cut/);
+ assert.match(await ok("add", "zorbo"), / \*{5} is masked in this cut/);
await ok("except", F);
assert.deepEqual((await manifest(p)).render.posts.slurs, { level: "strong", visual: "blackout", voice: "skip", add: ["zorbo"], except: [F] });
const red = await projectRedaction(p.dir, await manifest(p));
diff --git a/umtool/lib/report/postSlursCli.mjs b/umtool/lib/report/postSlursCli.mjs
@@ -14,7 +14,7 @@
//
// Plain ESM: the CLI runs under bare node.
import { isNarrated, pickedTake, rootTakeOf } from "umtool-report-to-video/post-narration";
-import { SLURS_DEFAULTS, SLUR_LEVELS, SLUR_VISUALS, SLUR_VOICES, maskOfWord, slurReport, takeBleeps } from "umtool-report-to-video/post-slurs";
+import { SLURS_DEFAULTS, SLUR_LEVELS, SLUR_VISUALS, SLUR_VOICES, maskOfOwnWord, slurReport, takeBleeps } from "umtool-report-to-video/post-slurs";
import { cutSlurs } from "umtool-report-to-video/post-redact-files";
import { readManifest } from "../projects/report.mjs";
import { withEditNotes } from "./edit-guard.mjs";
@@ -89,7 +89,7 @@ export async function slursCommand(project, rest, { json = false, out = (s) => c
if (sub === "add" || sub === "except" || sub === "remove") {
if (!arg || !/^[A-Za-z][A-Za-z-]{1,39}$/.test(arg)) throw new SlursError(`posts slurs ${sub} takes a word (letters, 2–40)`);
const what = sub === "add" ? "masked in this cut" : sub === "except" ? "never masked in this cut" : "off the project's lists";
- return said({ [sub]: arg }, `${maskOfWord(arg.toLowerCase())} is ${what}`);
+ return said({ [sub]: arg }, `${maskOfOwnWord(arg)} is ${what}`);
}
if (sub !== "ls") throw new SlursError(`posts slurs: ls, on, off, level, visual, voice, add, except or remove (not ${sub})`);
const manifest = await readManifest(project.dir);
diff --git a/umtool/report-to-video/post-slurs.mjs b/umtool/report-to-video/post-slurs.mjs
@@ -85,7 +85,7 @@ function addedEntry(a) {
const x = typeof a === "string" ? { word: a } : a;
const word = lc(x?.word);
const forms = Array.isArray(x?.forms) && x.forms.length ? x.forms.map(lc) : [word];
- return { id: `add:${word}`, level: "strong", word, forms: forms.includes(word) ? forms : [word, ...forms], ...(x?.mask ? { mask: x.mask } : {}), say: str(x?.say).trim() || "slur", added: true };
+ return { id: `add:${word}`, level: "strong", word, forms: forms.includes(word) ? forms : [word, ...forms], mask: x?.mask ? x.mask : maskOfOwnWord(word), say: str(x?.say).trim() || "slur", added: true };
}
/**
@@ -212,6 +212,8 @@ export function slurMatches(text, s) {
export const slurEntryOf = (s, id) => (Array.isArray(s?.entries) ? s.entries.find((e) => e.id === id) ?? null : null);
/** A word's default masked form: its first letter, an asterisk for each other. */
+/** A project's own word (a name kept off the card, most often) is masked whole: no first letter to spell it. */
+export const maskOfOwnWord = (word) => "*".repeat(Math.max(1, str(word).length));
export const maskOfWord = (word) => (str(word) ? `${str(word)[0]}${"*".repeat(Math.max(1, str(word).length - 1))}` : "*");
/** The masked form a hit is drawn as: the slur's mask, its first letter in the case the text wrote it. */
diff --git a/umtool/report-to-video/post-slurs.test.mjs b/umtool/report-to-video/post-slurs.test.mjs
@@ -70,6 +70,8 @@ test("the level, the project's additions and exceptions", () => {
assert.equal(slurMatches(F, strong).length, 1);
const own = resolveSlurs({ add: ["zorbo", { word: "blerg", forms: ["blergs"], mask: "b***", say: "b-word" }], except: [FS, "r-word"] }, LIST);
assert.equal(slurMatches("a zorbo and two blergs", own).length, 2);
+ assert.equal(own.entries.find((e) => e.word === "zorbo").mask, "*****", "a project's own word is masked whole -- no first letter");
+ assert.equal(own.entries.find((e) => e.word === "blerg").mask, "b***", "its own mask, when it gives one");
assert.equal(slurMatches(FS, own).length, 0, "an excepted form");
assert.equal(slurMatches(F, own).length, 1, "the rest of its slur");
assert.equal(slurMatches(R, own).length, 0, "an excepted slur, by its id");