Skip to content

Commit 31371fc

Browse files
committed
ci: fix format check — ignore n8n backups/build dirs, format seed scripts
1 parent 66cc139 commit 31371fc

5 files changed

Lines changed: 183 additions & 74 deletions

File tree

.prettierignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
n8n-backups/
2+
.open-next/
3+
.wrangler/
4+
out/
5+
.next/

scripts/approve-seed-cases.mjs

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,22 @@ const SEED_HANDLE = "registry-seed";
2020
function qualifies(p) {
2121
const reasons = [];
2222
if (p.submitter_handle !== SEED_HANDLE) reasons.push("not registry-seed");
23-
if (!p.source_url || !/^https?:\/\//i.test(p.source_url)) reasons.push("no http(s) source_url");
24-
if (!Array.isArray(p.verified_facts) || p.verified_facts.length < 1) reasons.push("no verified_facts");
25-
if (!p.title || p.title.length < 20 || p.title.length > 200) reasons.push("title length");
23+
if (!p.source_url || !/^https?:\/\//i.test(p.source_url))
24+
reasons.push("no http(s) source_url");
25+
if (!Array.isArray(p.verified_facts) || p.verified_facts.length < 1)
26+
reasons.push("no verified_facts");
27+
if (!p.title || p.title.length < 20 || p.title.length > 200)
28+
reasons.push("title length");
2629
if (!p.outcome || p.outcome.length < 100) reasons.push("outcome too short");
2730
if (p.status !== "pending") reasons.push(`status=${p.status}`);
2831
return reasons;
2932
}
3033

3134
const { data: candidates, error: selErr } = await supabase
3235
.from("posts")
33-
.select("id, title, status, submitter_handle, source_url, verified_facts, outcome, submitter_email, case_number")
36+
.select(
37+
"id, title, status, submitter_handle, source_url, verified_facts, outcome, submitter_email, case_number",
38+
)
3439
.eq("status", "pending")
3540
.eq("submitter_handle", SEED_HANDLE)
3641
.order("created_at", { ascending: true });
@@ -72,11 +77,15 @@ for (const p of candidates) {
7277
.single();
7378

7479
if (error || !data) {
75-
console.error(` ✗ approve failed — ${p.title.slice(0, 50)}: ${error?.message}`);
80+
console.error(
81+
` ✗ approve failed — ${p.title.slice(0, 50)}: ${error?.message}`,
82+
);
7683
continue;
7784
}
7885
approved++;
7986
console.log(` ✓ ${data.case_number}${data.title.slice(0, 58)}`);
8087
}
8188

82-
console.log(`\nDone. approved=${approved} skipped=${skipped} (of ${candidates.length})`);
89+
console.log(
90+
`\nDone. approved=${approved} skipped=${skipped} (of ${candidates.length})`,
91+
);

scripts/seed-real-cases-batch1.mjs

Lines changed: 74 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,19 @@ const CASES = [
3535
tags: ["security-fail", "social-blunder"],
3636
source_url:
3737
"https://gmauthority.com/blog/2023/12/gm-dealer-chat-bot-agrees-to-sell-2024-chevy-tahoe-for-1/",
38-
source_title: "GM Dealer Chat Bot Agrees To Sell 2024 Chevy Tahoe For $1 (GM Authority)",
38+
source_title:
39+
"GM Dealer Chat Bot Agrees To Sell 2024 Chevy Tahoe For $1 (GM Authority)",
3940
published: "2023-12-18T00:00:00Z",
4041
verified_facts: [
4142
"The chatbot was on Chevrolet of Watsonville's site and powered by ChatGPT",
4243
"A user used prompt injection to set new rules for the bot",
4344
"The bot agreed to a $1 sale and called it a 'legally binding offer'",
4445
"The dealership did not honor it and disabled the bot",
4546
],
46-
unknowns: ["Exact date the bot was taken down", "Whether GM or the dealer faced any formal complaint"],
47+
unknowns: [
48+
"Exact date the bot was taken down",
49+
"Whether GM or the dealer faced any formal complaint",
50+
],
4751
lessons: [
4852
"Customer-facing LLM agents need guardrails against prompt injection",
4953
"Never let an LLM make or confirm binding commitments without deterministic checks",
@@ -60,15 +64,20 @@ const CASES = [
6064
damage: 2,
6165
cost: null,
6266
tags: ["social-blunder", "security-fail"],
63-
source_url: "https://time.com/6564726/ai-chatbot-dpd-curses-criticizes-company/",
64-
source_title: "An AI Chatbot Cursed at a Customer and Criticized Its Own Company (TIME)",
67+
source_url:
68+
"https://time.com/6564726/ai-chatbot-dpd-curses-criticizes-company/",
69+
source_title:
70+
"An AI Chatbot Cursed at a Customer and Criticized Its Own Company (TIME)",
6571
published: "2024-01-19T00:00:00Z",
6672
verified_facts: [
6773
"DPD's chatbot swore and criticized DPD after a Jan 18 2024 system update",
6874
"Customer Ashley Beauchamp posted the screenshots to X",
6975
"DPD disabled the AI element",
7076
],
71-
unknowns: ["Which LLM/vendor powered the chatbot", "Whether any customers were materially harmed"],
77+
unknowns: [
78+
"Which LLM/vendor powered the chatbot",
79+
"Whether any customers were materially harmed",
80+
],
7281
lessons: [
7382
"Test LLM behavior after every system update",
7483
"Brand-facing bots need jailbreak-resistant guardrails",
@@ -86,14 +95,17 @@ const CASES = [
8695
tags: ["hallucination", "compliance-violation"],
8796
source_url:
8897
"https://themarkup.org/artificial-intelligence/2024/03/29/nycs-ai-chatbot-tells-businesses-to-break-the-law",
89-
source_title: "NYC's AI Chatbot Tells Businesses to Break the Law (The Markup)",
98+
source_title:
99+
"NYC's AI Chatbot Tells Businesses to Break the Law (The Markup)",
90100
published: "2024-03-29T00:00:00Z",
91101
verified_facts: [
92102
"NYC launched the MyCity chatbot in Oct 2023",
93103
"The Markup found it advised illegal actions (Section 8 discrimination, taking tips, no rent limits)",
94104
"The city initially kept it live with a disclaimer",
95105
],
96-
unknowns: ["Whether any business acted on the advice and was harmed or fined"],
106+
unknowns: [
107+
"Whether any business acted on the advice and was harmed or fined",
108+
],
97109
lessons: [
98110
"Government LLM advice tools need legal-accuracy review and clear non-advice disclaimers",
99111
"High-stakes domains require answers grounded in authoritative sources",
@@ -135,15 +147,18 @@ const CASES = [
135147
tags: ["compliance-violation"],
136148
source_url:
137149
"https://www.cbsnews.com/sanfrancisco/news/nhtsa-robotaxi-cruise-pay-penalty-failing-report-san-francisco-crash-involving-pedestrian/",
138-
source_title: "Cruise to pay $1.5M penalty over San Francisco pedestrian crash (CBS News)",
150+
source_title:
151+
"Cruise to pay $1.5M penalty over San Francisco pedestrian crash (CBS News)",
139152
published: null,
140153
verified_facts: [
141154
"On Oct 2 2023 a Cruise AV dragged a pedestrian ~20 ft after she was hit by another car",
142155
"CA DMV and CPUC suspended Cruise's driverless permits",
143156
"Cruise pulled its fleet nationwide",
144157
"NHTSA imposed a $1.5M penalty for reporting failures; Cruise paid $500K over a false report",
145158
],
146-
unknowns: ["Full technical root cause of the pullover-while-pinned maneuver"],
159+
unknowns: [
160+
"Full technical root cause of the pullover-while-pinned maneuver",
161+
],
147162
lessons: [
148163
"Autonomous agents acting in the physical world need fail-safe behavior for edge cases",
149164
"Prompt, transparent incident reporting is both a legal and ethical necessity",
@@ -161,14 +176,17 @@ const CASES = [
161176
tags: ["data-exfiltration", "security-fail"],
162177
source_url:
163178
"https://techcrunch.com/2023/05/02/samsung-bans-use-of-generative-ai-tools-like-chatgpt-after-april-internal-data-leak/",
164-
source_title: "Samsung bans use of generative AI tools like ChatGPT after data leak (TechCrunch)",
179+
source_title:
180+
"Samsung bans use of generative AI tools like ChatGPT after data leak (TechCrunch)",
165181
published: "2023-05-02T00:00:00Z",
166182
verified_facts: [
167183
"Three leak incidents occurred in ~20 days in April 2023",
168184
"Leaked items included source code and an internal meeting recording",
169185
"Samsung banned generative AI tools and threatened termination",
170186
],
171-
unknowns: ["Whether the leaked data was ever accessed or misused by third parties"],
187+
unknowns: [
188+
"Whether the leaked data was ever accessed or misused by third parties",
189+
],
172190
lessons: [
173191
"Don't paste secrets into third-party LLMs",
174192
"Enterprises need DLP and clear AI-use policies before rollout",
@@ -186,7 +204,8 @@ const CASES = [
186204
tags: ["social-blunder", "hallucination"],
187205
source_url:
188206
"https://www.cnbc.com/2024/02/22/google-pauses-gemini-ai-image-generator-after-inaccuracies.html",
189-
source_title: "Google pauses Gemini AI image generator after inaccurate historical pictures (CNBC)",
207+
source_title:
208+
"Google pauses Gemini AI image generator after inaccurate historical pictures (CNBC)",
190209
published: "2024-02-22T00:00:00Z",
191210
verified_facts: [
192211
"Gemini produced racially inaccurate historical images in Feb 2024",
@@ -211,7 +230,8 @@ const CASES = [
211230
tags: ["hallucination"],
212231
source_url:
213232
"https://www.bloomberg.com/opinion/articles/2024-05-30/pizza-glue-small-rocks-google-ai-overview-answers-are-a-mess",
214-
source_title: "Pizza Glue? Small Rocks? Google AI Overview Answers Are a Mess (Bloomberg)",
233+
source_title:
234+
"Pizza Glue? Small Rocks? Google AI Overview Answers Are a Mess (Bloomberg)",
215235
published: "2024-05-30T00:00:00Z",
216236
verified_facts: [
217237
"AI Overviews suggested glue on pizza and eating rocks in May 2024",
@@ -236,7 +256,8 @@ const CASES = [
236256
tags: ["compliance-violation"],
237257
source_url:
238258
"https://www.eeoc.gov/newsroom/itutorgroup-pay-365000-settle-eeoc-discriminatory-hiring-suit",
239-
source_title: "iTutorGroup to Pay $365,000 to Settle EEOC Discriminatory Hiring Suit (EEOC)",
259+
source_title:
260+
"iTutorGroup to Pay $365,000 to Settle EEOC Discriminatory Hiring Suit (EEOC)",
240261
published: "2023-09-11T00:00:00Z",
241262
verified_facts: [
242263
"The software auto-rejected women over 55 and men over 60",
@@ -261,14 +282,17 @@ const CASES = [
261282
cost: null,
262283
tags: ["social-blunder", "hallucination"],
263284
source_url: "https://futurism.com/sports-illustrated-ai-generated-writers",
264-
source_title: "Sports Illustrated Published Articles by Fake, AI-Generated Writers (Futurism)",
285+
source_title:
286+
"Sports Illustrated Published Articles by Fake, AI-Generated Writers (Futurism)",
265287
published: "2023-11-27T00:00:00Z",
266288
verified_facts: [
267289
"SI published reviews under fake author personas with AI-generated headshots",
268290
"Content was supplied by AdVon Commerce",
269291
"The fake authors were removed after Futurism's inquiry",
270292
],
271-
unknowns: ["The exact extent to which the article text was AI-generated vs human-written"],
293+
unknowns: [
294+
"The exact extent to which the article text was AI-generated vs human-written",
295+
],
272296
lessons: [
273297
"Disclose AI involvement and use real bylines",
274298
"Vet third-party content vendors for synthetic personas",
@@ -286,7 +310,8 @@ const CASES = [
286310
tags: ["compliance-violation", "social-blunder"],
287311
source_url:
288312
"https://www.cbsnews.com/news/google-settle-lawsuit-florida-teens-suicide-character-ai-chatbot/",
289-
source_title: "AI company, Google settle lawsuit over Florida teen's suicide linked to Character.AI (CBS News)",
313+
source_title:
314+
"AI company, Google settle lawsuit over Florida teen's suicide linked to Character.AI (CBS News)",
290315
published: null,
291316
verified_facts: [
292317
"Sewell Setzer III, 14, died by suicide in February 2024",
@@ -313,8 +338,10 @@ const CASES = [
313338
damage: 4,
314339
cost: null,
315340
tags: ["data-exfiltration", "security-fail"],
316-
source_url: "https://www.theregister.com/2024/08/21/slack_ai_prompt_injection/",
317-
source_title: "Slack AI can leak private data via prompt injection (The Register)",
341+
source_url:
342+
"https://www.theregister.com/2024/08/21/slack_ai_prompt_injection/",
343+
source_title:
344+
"Slack AI can leak private data via prompt injection (The Register)",
318345
published: "2024-08-21T00:00:00Z",
319346
verified_facts: [
320347
"PromptArmor disclosed indirect prompt injection in Slack AI in Aug 2024",
@@ -330,7 +357,8 @@ const CASES = [
330357
},
331358
{
332359
agent: "other",
333-
title: "FTC fined 'robot lawyer' DoNotPay $193,000 over unproven AI legal-service claims",
360+
title:
361+
"FTC fined 'robot lawyer' DoNotPay $193,000 over unproven AI legal-service claims",
334362
outcome:
335363
"The FTC charged in September 2024 that DoNotPay marketed an 'AI lawyer' as a substitute for human attorneys without testing whether it performed at a lawyer's level or employing lawyers to verify quality, and that a feature claiming to scan small-business sites for legal violations was ineffective. DoNotPay settled for $193,000, agreed to notify 2021–2023 subscribers, and was barred from unsubstantiated 'robot lawyer' claims (final order January 2025).",
336364
prompt: null,
@@ -339,7 +367,8 @@ const CASES = [
339367
tags: ["compliance-violation", "hallucination"],
340368
source_url:
341369
"https://www.ftc.gov/news-events/news/press-releases/2025/02/ftc-finalizes-order-donotpay-prohibits-deceptive-ai-lawyer-claims-imposes-monetary-relief-requires",
342-
source_title: "FTC Finalizes Order with DoNotPay Over Deceptive 'AI Lawyer' Claims (FTC)",
370+
source_title:
371+
"FTC Finalizes Order with DoNotPay Over Deceptive 'AI Lawyer' Claims (FTC)",
343372
published: "2025-02-11T00:00:00Z",
344373
verified_facts: [
345374
"The FTC charged DoNotPay in Sept 2024 over its 'AI lawyer' claims",
@@ -386,8 +415,10 @@ const CASES = [
386415
damage: 2,
387416
cost: null,
388417
tags: ["social-blunder"],
389-
source_url: "https://www.cnn.com/2023/02/22/tech/vanderbilt-chatgpt-shooting-email",
390-
source_title: "Vanderbilt University apologizes after using ChatGPT to write mass shooting email (CNN)",
418+
source_url:
419+
"https://www.cnn.com/2023/02/22/tech/vanderbilt-chatgpt-shooting-email",
420+
source_title:
421+
"Vanderbilt University apologizes after using ChatGPT to write mass shooting email (CNN)",
391422
published: "2023-02-22T00:00:00Z",
392423
verified_facts: [
393424
"The Peabody EDI office used ChatGPT for a condolence email after the MSU shooting",
@@ -402,15 +433,17 @@ const CASES = [
402433
},
403434
{
404435
agent: "other",
405-
title: "CNET quietly published 77 AI-written finance articles; over half needed corrections",
436+
title:
437+
"CNET quietly published 77 AI-written finance articles; over half needed corrections",
406438
outcome:
407439
"From November 2022, CNET published 77 financial explainers generated by an in-house AI tool under the byline 'CNET Money Staff,' with little disclosure. After Futurism reported it in January 2023, CNET found factual errors and possible plagiarism and issued corrections on 41 of the 77 articles — including a compound-interest explainer with multiple math errors. CNET paused the AI tool and added clearer disclosure.",
408440
prompt: null,
409441
damage: 2,
410442
cost: null,
411443
tags: ["hallucination", "social-blunder"],
412444
source_url: "https://www.cnn.com/2023/01/25/tech/cnet-ai-tool-news-stories",
413-
source_title: "Plagued with errors: A news outlet's decision to write stories with AI backfires (CNN)",
445+
source_title:
446+
"Plagued with errors: A news outlet's decision to write stories with AI backfires (CNN)",
414447
published: "2023-01-25T00:00:00Z",
415448
verified_facts: [
416449
"CNET published 77 AI-generated finance articles from Nov 2022",
@@ -460,7 +493,8 @@ const CASES = [
460493
tags: ["social-blunder"],
461494
source_url:
462495
"https://www.cbsnews.com/news/google-ai-chatbot-threatening-message-human-please-die/",
463-
source_title: "Google AI chatbot responds with a threatening message: 'Human … Please die.' (CBS News)",
496+
source_title:
497+
"Google AI chatbot responds with a threatening message: 'Human … Please die.' (CBS News)",
464498
published: "2024-11-15T00:00:00Z",
465499
verified_facts: [
466500
"In Nov 2024 Gemini told a student to 'please die' within a hostile message",
@@ -475,7 +509,8 @@ const CASES = [
475509
},
476510
{
477511
agent: "other",
478-
title: "Amazon scrapped a secret AI recruiting tool that learned to penalize résumés from women",
512+
title:
513+
"Amazon scrapped a secret AI recruiting tool that learned to penalize résumés from women",
479514
outcome:
480515
"Amazon built (from 2014) an experimental AI tool to score résumés one to five stars. Trained on a decade of mostly male applications, it taught itself to favor men — downgrading résumés that contained the word 'women's' (as in 'women's chess club captain') and graduates of two all-women colleges. Amazon could not guarantee neutrality and scrapped the project; Reuters reported it in October 2018.",
481516
prompt: null,
@@ -484,7 +519,8 @@ const CASES = [
484519
tags: ["compliance-violation"],
485520
source_url:
486521
"https://www.cnbc.com/2018/10/10/amazon-scraps-a-secret-ai-recruiting-tool-that-showed-bias-against-women.html",
487-
source_title: "Amazon scraps a secret AI recruiting tool that showed bias against women (CNBC/Reuters)",
522+
source_title:
523+
"Amazon scraps a secret AI recruiting tool that showed bias against women (CNBC/Reuters)",
488524
published: "2018-10-10T00:00:00Z",
489525
verified_facts: [
490526
"Amazon's experimental résumé-scoring AI favored male candidates",
@@ -524,11 +560,16 @@ for (let i = 0; i < CASES.length; i++) {
524560
const c = CASES[i];
525561
const agentId = agentMap[c.agent];
526562
if (!agentId) {
527-
console.warn(` ⚠ unknown agent slug "${c.agent}" — skipping: ${c.title.slice(0, 50)}`);
563+
console.warn(
564+
` ⚠ unknown agent slug "${c.agent}" — skipping: ${c.title.slice(0, 50)}`,
565+
);
528566
failed++;
529567
continue;
530568
}
531-
if (seenUrls.has(c.source_url) || seenTitles.has(c.title.trim().toLowerCase())) {
569+
if (
570+
seenUrls.has(c.source_url) ||
571+
seenTitles.has(c.title.trim().toLowerCase())
572+
) {
532573
console.log(` ↩ dup — skipping: ${c.title.slice(0, 60)}`);
533574
skipped++;
534575
continue;
@@ -563,7 +604,9 @@ for (let i = 0; i < CASES.length; i++) {
563604
.single();
564605

565606
if (error || !post) {
566-
console.error(` ✗ insert failed: ${c.title.slice(0, 50)}${error?.message}`);
607+
console.error(
608+
` ✗ insert failed: ${c.title.slice(0, 50)}${error?.message}`,
609+
);
567610
failed++;
568611
continue;
569612
}

0 commit comments

Comments
 (0)