commit 07ccac0ba53258be4d6b0f81ac0097d7e54ba8e8
parent 7fe411b671ee154c6aae2050f9a0180e6fd1b8ff
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Thu, 12 Nov 2026 08:57:28 -0500
sweep-pipeline: a code-written heading names what its quotes share, numbered in the order shown; docs (D2 round b review)
Replaying the round's runs with the new heading rule: most sections' headings
were refused ("Criticism of Content", "Fan Reactions and Reviews",
"Production and Budget" -- a word of judging, or a word in none of the
quotes), and the commonest label of a section was usually the run's topic
(every refused label's) or a label one quote of many had ("Spin-offs
confirmed" over a section of others). A code heading is now built from the
labels the model wrote and code kept, and only from one that two quotes or
more share (or the section's only quote); else it is the run's topic. Its
ordinal is given again once the caps have dropped what they drop, in the
order shown, so "(2)" never follows nothing and "(3)" never follows "(1)".
Docs: the editor's changelog (the labels and headings, the refresh, the
revision, the meaning budget, the linear patterns) and OPERATING.md's local
sweep note.
Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat:
5 files changed, 39 insertions(+), 6 deletions(-)
diff --git a/OPERATING.md b/OPERATING.md
@@ -912,7 +912,11 @@ pnpm ops get generation-usage
sentence. A quote whose transcript has a sign of reading aloud around it (a tweet, likes read out, an article being
introduced, "it says", "according to", a clip, the host named in the third person) is kept in a last section,
**To check by ear**, with the flag `check by ear: may be read aloud` on its claim — listen to those before
- filming; a reading nothing in the transcript announces is not caught. Both are `settings.generation.localSweep`:
+ filming; a reading nothing in the transcript announces is not caught. A topic label and a section heading are
+ noun-phrase topics held by code — no pronoun, no word of saying, feeling or judging ("comments", "reaction",
+ "blames", "hates"), no "is / was / has", no "the actress's …", every word found in the quotes, the titles or the
+ question — else code writes them. A refresh sweeps in the same form, and a revision keeps the lines, headings and
+ title code's and the flags on their claims. Both are `settings.generation.localSweep`:
```sh
pnpm archilyzer gen local-sweep # what they are
diff --git a/common/lib/report/draft/tasks/neutralClaim.test.ts b/common/lib/report/draft/tasks/neutralClaim.test.ts
@@ -52,6 +52,9 @@ test("the title is code's; a heading is kept only when it is a grounded noun-phr
assert.equal(racist.from, "code");
assert.match(racist.why!, /“racist” is in none of/);
assert.equal(neutralHeading("What he thinks of the lore", { ...o, labels: [] }).heading, "The acolyte");
+ // One quote's label is not a heading over others: the run's topic.
+ assert.equal(neutralHeading("Fan Reactions", { ...o, labels: ["spin-offs confirmed", "the acolyte budget"] }).heading, "The acolyte");
+ assert.equal(neutralHeading("Fan Reactions", { ...o, labels: ["spin-offs confirmed"] }).heading, "Spin-offs confirmed");
// A heading an earlier section has gets an ordinal; never two sections of one name.
const used = new Set<string>();
assert.equal(neutralHeading("Reviews and budget", { ...o, used }).heading, "Reviews and budget");
diff --git a/common/lib/report/draft/tasks/neutralClaim.ts b/common/lib/report/draft/tasks/neutralClaim.ts
@@ -289,9 +289,10 @@ export function neutralTitle(topic: string, channels: readonly string[]): string
// A section heading the grouping call wrote: kept when it passes the label
// rules (labelProblem) AND every content word of it is grounded in the
// section's own labels and quotes, its recordings' titles or the question.
-// Else code writes it: the commonest label of the section's quotes (labels are
-// held down already), or the run's topic; a heading already used gets an
-// ordinal. `used`: the headings of the sections before it (lowercase).
+// Else code writes it: the label two or more of the section's quotes share
+// (labels are held down already), or the run's topic; a heading already used
+// gets an ordinal. `labels`: the section's labels the model wrote and code
+// kept; `used`: the headings of the sections before it (lowercase).
export function neutralHeading(
heading: string,
o: { labels: readonly string[]; ground: readonly string[]; topic: string; hosts?: readonly string[]; used?: Set<string> },
@@ -305,9 +306,13 @@ export function neutralHeading(
used.add(h.toLowerCase());
return { heading: h, from: "model" };
}
+ // The commonest label, when it is the label of two quotes or more (or of
+ // the section's only one): one quote's topic over a section of others
+ // would misname them. Else the run's topic.
const count = new Map<string, number>();
for (const l of o.labels) count.set(l.toLowerCase(), (count.get(l.toLowerCase()) ?? 0) + 1);
- const best = [...count.entries()].sort((a, b) => b[1] - a[1])[0]?.[0] ?? o.topic.toLowerCase();
+ const top = [...count.entries()].sort((a, b) => b[1] - a[1])[0];
+ const best = top && (top[1] >= 2 || o.labels.length === 1) ? top[0] : o.topic.toLowerCase();
const base = (best ? best[0]!.toUpperCase() + best.slice(1) : "Quotes").slice(0, 54).trim();
let out = base;
for (let k = 2; used.has(out.toLowerCase()); k++) out = `${base} (${k})`;
diff --git a/common/lib/report/draft/tasks/sweep-pipeline.ts b/common/lib/report/draft/tasks/sweep-pipeline.ts
@@ -877,12 +877,19 @@ async function pipelineBody(h: TaskHandle, input: SweepPipelineInput): Promise<T
// The neutral form's headings are held down like its labels: a heading that
// is not a grounded noun-phrase topic (neutralHeading) is code's, built from
// the section's labels.
+ // A code-written heading's base (its ordinal off), to number them again
+ // once the caps have dropped what they drop.
+ const codeBase = new Map<string, string>();
if (neutral) {
const used = new Set<string>();
sections = sections.map((s) => {
const recs = s.nums.map((n) => pool[n - 1]!);
- const r = neutralHeading(s.heading, { labels: recs.map((x) => x.label!.label), ground: [...recs.flatMap((x) => [x.quote, x.title]), question], topic: runTopic, hosts: hostNames, used });
+ // The labels a code heading is built from are the model's that passed
+ // (a refused one is the run's topic, which is every section's).
+ const own = recs.filter((x) => x.label!.from === "model").map((x) => x.label!.label);
+ const r = neutralHeading(s.heading, { labels: own, ground: [...recs.flatMap((x) => [x.quote, x.title]), question, runTopic], topic: runTopic, hosts: hostNames, used });
if (r.from === "code") {
+ codeBase.set(r.heading, r.heading.replace(/ \(\d+\)$/, ""));
const line = `heading “${s.heading}” replaced by “${r.heading}” (${r.why})`;
h.log(line);
h.trace({ t: "note", text: line });
@@ -913,6 +920,19 @@ async function pipelineBody(h: TaskHandle, input: SweepPipelineInput): Promise<T
secs = secs.map((s, si) => ({ heading: s.heading, recs: s.recs.filter((_, ri) => keep.has(`${si}:${ri}`)) })).filter((s) => s.recs.length);
leftOut += total - maxClaims;
}
+ if (codeBase.size) {
+ // Ordinals in the order shown, with no gap: (2) follows the base, or a
+ // model heading of the same words.
+ const k = new Map<string, number>();
+ for (const s of secs) if (!codeBase.has(s.heading)) k.set(s.heading.toLowerCase(), 1);
+ for (const s of secs) {
+ const base = codeBase.get(s.heading);
+ if (base === undefined) continue;
+ const n = (k.get(base.toLowerCase()) ?? 0) + 1;
+ k.set(base.toLowerCase(), n);
+ s.heading = n === 1 ? base : `${base} (${n})`;
+ }
+ }
if (marked.length) secs.push({ heading: "To check by ear", recs: marked });
for (const s of secs) s.recs.sort((a, b) => a.date.localeCompare(b.date) || a.sec - b.sec);
diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md
@@ -1,6 +1,7 @@
# Changelog
## [Unreleased]
+- **A local sweep's topic labels and section headings never attribute, a refresh keeps the local sweep's settings, and a revision keeps a speaker-neutral report neutral.** A heading the model wrote was kept unless it held one of a few words, and was never checked against the quotes, so a section could be headed "Main Actress's Comments" over quotes none of them hers, or "Fan Reactions"; a label could still say "acolyte writer blames filon" or "his love of the show" when the quote held those words. A label and a heading are now noun-phrase topics, read word by word against closed lists: no personal or possessive pronoun, no word of saying, thinking, feeling or judging in any of its forms (comments, reaction, response, statement, accusation, criticism, blames, hates, loves, admission, lying, defending, …), no "is / was / has / been" or contracted verb, no person-role in the possessive ("the showrunner's …"), no host's name — and every word found in the section's quotes, labels or titles, or the question. A heading that fails is written by code from its quotes' labels; the question's topic, the fallback label and the report's title, goes through the same rules. A recurring **refresh** of a report on the local route swept the new recordings in the old drafted-sentence form with no read-aloud check; it now uses `generation.localSweep`. A **revision** of a speaker-neutral report keeps its lines code's (a line is not rewritten; an added finding's line is written again from its recording's title and date and its checked topic), refuses a heading, a title or a summary that attributes, and keeps each claim's `check by ear` flag, which it used to lose. In the drafted-sentence form, a quote marked to check by ear is meaning-checked last, so it no longer takes the place of an unmarked one in the check's budget. The read-aloud patterns run in linear time: one of them took over a second on 40 letters of transcript and never returned on 60.
- **A local model's sweep no longer says who said it: code writes each finding around the quote, and a quote that may be read aloud is marked to check by ear.** A sweep on the `local` route (a small model on this machine) wrote "Jeremy says …" over words the host was reading out — a tweet, a headline, a review — because nothing in an automatic transcript marks a quotation and a small model cannot tell the reading from the speaking. Its findings are now written by code as `In <recording's title> (<date>), on <topic>: "<quote>"`, with the citation and the link: the model only copies the quote and names its topic in a few words, and a topic that names the speaker, says who thinks what, or uses words found nowhere around the quote is replaced by the question's topic. The report's title is written the same way, and it says where the words are, not whose they are. Before a quote is kept, code also looks at the transcript around it for signs of reading aloud — a tweet, likes and retweets read out, an article or headline being introduced, "it says", "he writes", "according to", a clip, a chat message, the host named in the third person. Such a quote goes to a last section, **To check by ear**, its line starting `Check by ear:` and its claim carrying the flag `check by ear: may be read aloud`; it can be left out instead. The signs are patterns, so a headline read with nothing announcing it is not caught: the section is where to listen first, not a guarantee about the rest. Both are settings (`generation.localSweep.claimForm`: `neutral` or `sentence`, the earlier drafted sentence with its meaning check; `generation.localSweep.readAloud`: `flag`, `drop` or `off`), set with `archilyzer gen local-sweep [--form …] [--read-aloud …]` or on umtool's **Settings → Generation**. Sweeps by Claude (Claude Code or the API) are not changed.
- **A published archive is a source: connect it once, sweep it, and fetch its cited clips with no local corpus.** A fresh clone pointed at jeralyzer.pages.dev could search it through the MCP and do nothing else: Create had no corpus to offer, and every clip of a channel the editor did not archive was a 404 `Channel "<slug>" not found`. An archive is now connected by its origin — `/sites` → **Connected archives**, or `pnpm ops archives --json '{"connect":"https://jeralyzer.pages.dev"}'` (`"dryRun": true` reads it and writes nothing; `pnpm ops get archives` lists them) — and kept in `settings.remoteArchives`. `TRANSCRIPT_SITE_URL`'s archive is offered without being connected, so a clone set up as AGENTS.md says starts with one. Create offers each connected archive as a sweep's source, preselected when this machine has no corpus of its own, the MCP's `list_sources` lists them and `generate` passes the choice. A sweep over an archive cites that archive's origin, whatever `generation.citationOrigin` says, and its revisions, drafts and refreshes inherit it. A clip window cited from one registers its channel **remote-only** on first need (`fetch-windows` and `fetch-window` take `"archive"`, and the MCP's `fetch_clip` names it): a `config.json` and nothing else, shown as "remote only" in the channel list, skipped by every sync, lane, scan and site build, and left out of the site form's channel picker. On a whole-recording platform (Rumble) a window means downloading the whole recording, which nobody planned for a channel that is not archived here: it is refused with the recording's length and estimated size until the ask carries `"allowWholeRecording": true`. The archive's documents are cached on disk by its build (512 MB by default), read one at a time and paced. `corpus.json` is spec 6 (the export's changelog): each channel names its platform and its page there; an older archive's platform is read from a record's `webpageUrl`.
- **A connected archive is untrusted input.** umtool can connect one and is open on the LAN, and everything an archive serves is someone else's JSON. An archive on this machine or its network — loopback, private, link-local and CGNAT addresses in any spelling (decimal, hex, IPv4 carried inside IPv6), a `.local`/`.internal`/`.lan` name, or a name that resolves to one — is refused at connect, before anything is asked of it, unless the editor runs with `ARCHILYZER_ALLOW_PRIVATE_ARCHIVES=1` or the origin is `TRANSCRIPT_SITE_URL`'s or already in `settings.json`; the check is made once, at connect. Its documents are read on its own origin only: a redirect elsewhere is refused unfollowed, a manifest its `corpus.json` names on another origin is not followed, and no document past 32 MB is read or kept. A record's page URL is fetched only when its host is its channel's video platform's own domain or a subdomain (`evilyoutube.com` and `youtube.com.evil.example` are not YouTube); a URL carrying a backslash, whitespace or a control character is refused unparsed, because Node and yt-dlp's Python read its host differently; and what reaches yt-dlp is the URL the check parsed, never the archive's own string. A remote-only channel whose archive was removed from settings is refused before its record is read.