Archilyzer · Source

archilyzer

Archilyzer
git clone https://archilyzer.pages.dev/source/archilyzer.git
Log | Files | Refs | README | LICENSE

commit 7cb6a218f742a31cbcd0af92aa785d6aa3403930
parent 73d75bf5985f365454827a2cbee4f7d134d69d8a
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Mon,  2 Nov 2026 05:02:22 -0500

leads: a role note alone keeps the lead's disposition; e2e: an excluded scan target on the Captures tab

Editing a lead's role sent its disposition back as "undecided" when it had none set on the row,
and the route read a missing disposition as null, so a role typed on an archived lead could clear
it. The disposition is now sent only when it changes (absent: kept; null or "": undecided), and
the unit test says so. editor/e2e/wayback-captures.spec gains the excluded target: marked on the
tab's target list, the next target scanned.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

Diffstat:
Meditor/e2e/wayback-captures.spec.ts | 45+++++++++++++++++++++++++++++++++++++++++++++
Mumtool/app/api/research/cases/[id]/stages/leads/route.ts | 3++-
Mumtool/components/research/stages/LeadsPanel.tsx | 7++++---
Mumtool/lib/research/case-stages.test.ts | 7+++++++
4 files changed, 58 insertions(+), 4 deletions(-)

diff --git a/editor/e2e/wayback-captures.spec.ts b/editor/e2e/wayback-captures.spec.ts @@ -156,3 +156,48 @@ test("Captures: scan on the fake → the table → filter by year → Import sel await wb.close(); } }); + +// Release 38 lane C: a target the Wayback Machine excludes (a CDX 403) is a +// line of its own on the tab, and the scan goes on to the next target. +test("Captures: an excluded target is marked, and the next target is scanned", async ({ page }) => { + test.setTimeout(120_000); + await resetData("empty"); + const transcripts = resolvePath(testPaths().transcriptsDir); + const slug = "synth-pages-excluded"; + const channelRoot = path.join(transcripts, "channels", slug); + await mkdir(channelRoot, { recursive: true }); + const targets = [ + { url: "gone.example", match: "host" }, + { url: "blog.example", match: "host" }, + ]; + await writeFile( + path.join(channelRoot, "config.json"), + JSON.stringify({ + handling: "transcribe", + sourceKind: "social", + platform: "webpage", + socialHandle: "blog.example", + name: "Synth Blog, one target excluded", + url: "https://web.archive.org/web/*/blog.example*", + wayback: { targets }, + }), + ); + const wb = await startFakeWayback({ captures: SCAN_CAPTURES, excluded: ["gone.example"] }); + const originFile = waybackOriginFile(transcripts); + await writeFile(originFile, wb.base); + try { + await page.goto(`/channels/${slug}/captures`); + await page.getByRole("button", { name: "Scan now" }).click(); + const status = page.getByLabel("captures status line"); + await expect(status).toContainText("7 versions of 5 pages", { timeout: 30_000 }); + await expect(status).toContainText("complete"); + const list = page.getByRole("list", { name: "scan targets" }); + await expect(list.locator("li").filter({ hasText: "gone.example" }).locator("[data-scan-target-excluded]")).toHaveText( + "excluded from the Wayback Machine (cause unknown)", + ); + await expect(list.locator("li").filter({ hasText: "blog.example" })).toContainText("complete"); + } finally { + await rm(originFile, { force: true }); + await wb.close(); + } +}); diff --git a/umtool/app/api/research/cases/[id]/stages/leads/route.ts b/umtool/app/api/research/cases/[id]/stages/leads/route.ts @@ -27,7 +27,8 @@ export async function POST(request: Request, ctx: { params: Promise<{ id: string const str = (k: string) => (typeof b[k] === "string" ? (b[k] as string) : undefined); const r = await decideLead(id, { key: String(b.key ?? ""), - disposition: b.disposition === null ? null : str("disposition"), + // Absent: the disposition stays as it is; null or "": undecided again. + ...("disposition" in b ? { disposition: b.disposition === null ? null : str("disposition") ?? null } : {}), role: str("role"), name: str("name"), url: str("url"), diff --git a/umtool/components/research/stages/LeadsPanel.tsx b/umtool/components/research/stages/LeadsPanel.tsx @@ -53,7 +53,8 @@ export default function LeadsPanel({ caseId, initial }: { caseId: string; initia } }; - const decide = async (lead: LeadRow, disposition: LeadDisposition | "", role?: string) => { + // `disposition` undefined: the role alone changes; "" makes the lead undecided again. + const decide = async (lead: LeadRow, disposition: LeadDisposition | "" | undefined, role?: string) => { setBusy(lead.key); setError(null); setNote(null); @@ -62,7 +63,7 @@ export default function LeadsPanel({ caseId, initial }: { caseId: string; initia method: "POST", body: { key: lead.key, - disposition: disposition || null, + ...(disposition !== undefined ? { disposition: disposition || null } : {}), ...(role !== undefined ? { role } : {}), url: lead.url, count: lead.count, @@ -170,7 +171,7 @@ export default function LeadsPanel({ caseId, initial }: { caseId: string; initia value={roles[l.key] ?? l.role ?? ""} placeholder="who this is to the case" onChange={(e) => setRoles({ ...roles, [l.key]: e.target.value })} - onBlur={() => roles[l.key] !== undefined && roles[l.key] !== (l.role ?? "") && decide(l, l.disposition ?? "", roles[l.key])} + onBlur={() => roles[l.key] !== undefined && roles[l.key] !== (l.role ?? "") && decide(l, undefined, roles[l.key])} className="w-56 rounded-[3px] border border-seam bg-ground px-1.5 py-0.5 text-[12.5px] text-text" /> </TD> diff --git a/umtool/lib/research/case-stages.test.ts b/umtool/lib/research/case-stages.test.ts @@ -190,6 +190,13 @@ test("leads: never-archive feeds the name as a hash and keeps the lead only as i assert.equal("sites" in create.body, false, "X on no site, by rule"); assert.equal(create.body.fetchPostsNow, true); assert.equal(a.lead.channel, a.created?.slug); + const roleOnly = await lib.leads.decideLead(CASE, { key: "x:@harborwatch", role: "posts the council minutes" }); + assert.equal(roleOnly.lead.disposition, "archive", "a role alone leaves the disposition as it was"); + assert.equal(roleOnly.lead.channel, a.lead.channel); + assert.equal(roleOnly.created, undefined, "nothing is created twice"); + const undecided = await lib.leads.decideLead(CASE, { key: "youtube:@harborradio", disposition: "watch", url: "https://www.youtube.com/@HarborRadio" }); + assert.equal(undecided.lead.disposition, "watch"); + assert.equal((await lib.leads.decideLead(CASE, { key: "youtube:@harborradio", disposition: null })).lead.disposition, undefined); const older = await lib.leads.startOlderWalk(CASE, "x:@harborwatch"); assert.equal(older.slug, a.lead.channel); assert.deepEqual(asked[asked.length - 1].body, { slug: a.lead.channel, older: true });