@tritard/waterbrother 0.8.30 → 0.8.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tritard/waterbrother",
3
- "version": "0.8.30",
3
+ "version": "0.8.31",
4
4
  "description": "Waterbrother: Grok-powered coding CLI with local tools, sessions, operator modes, and approval controls",
5
5
  "type": "module",
6
6
  "bin": {
package/src/frontend.js CHANGED
@@ -55,7 +55,7 @@ const UNIVERSAL_FRONTEND_REMINDERS = [
55
55
  "Prefer hand-authored CSS variables and layout rules over generic template utility sprawl when feasible.",
56
56
  "Cut fake credibility elements, fake brands, fake testimonials, and filler interface chrome unless explicitly requested.",
57
57
  "Do not add fake keyboard shortcuts, fake command palettes, or demo-only interactive chrome unless the interface truly needs them.",
58
- "Avoid placeholder image services, Inter/Playfair default pairings, Tailwind CDN starter aesthetics, and generic premium-blog tropes.",
58
+ "Avoid placeholder image services, Font Awesome CDN chrome, Inter/Playfair default pairings, Tailwind CDN starter aesthetics, and generic premium-blog tropes.",
59
59
  "Prefer fewer sections with stronger hierarchy over a long page full of low-value widgets."
60
60
  ];
61
61
 
@@ -70,15 +70,15 @@ const BENCHMARK_SITE_TYPE_RULES = {
70
70
  "Benchmark blog mode: use neutral structural placeholders or concrete subject matter instead of publication worldbuilding or reflective-editorial atmosphere prose.",
71
71
  "Benchmark blog mode: do not wrap the page in a generic publication shell like Journal, Featured Essay, Latest Dispatches, Print Edition, Submit Work, or similar magazine-site framing.",
72
72
  "Benchmark blog mode: avoid the default editorial scaffold of hero, story list, archive rail, topics grid, and publication footer unless the user explicitly asked for a magazine-style site.",
73
- "Benchmark blog mode: do not use Tailwind CDN starter theming, picsum/placehold imagery, or fake keyboard/search chrome."
73
+ "Benchmark blog mode: do not use Tailwind CDN starter theming, Font Awesome chrome, picsum/placehold imagery, fake keyboard/search chrome, or demo-only modal article previews."
74
74
  ],
75
75
  store: [
76
76
  "Benchmark ecommerce mode: prioritize conversion architecture over editorial styling. The page should sell, not just look clean.",
77
77
  "Benchmark ecommerce mode: include proof, objection handling, and trust signals that belong on a real single-product PDP.",
78
78
  "Benchmark ecommerce mode: do not leave the main merchandising surface as a literal placeholder or demo box.",
79
- "Benchmark ecommerce mode: do not use Tailwind CDN starter theming or placeholder product images such as picsum/placehold on the live merchandising surface.",
80
- "Benchmark ecommerce mode: fake command palettes, fake app shortcuts, and unrelated theme chrome are disallowed.",
81
- "Benchmark ecommerce mode: fake review counts, fake bestseller labels, and fake as-featured-in proof are disallowed."
79
+ "Benchmark ecommerce mode: do not use Tailwind CDN starter theming, Font Awesome chrome, or placeholder product images such as picsum/placehold on the live merchandising surface.",
80
+ "Benchmark ecommerce mode: fake command palettes, fake app shortcuts, demo-only cart gimmicks, and unrelated theme chrome are disallowed.",
81
+ "Benchmark ecommerce mode: fake review counts, fake bestseller labels, fake sales counters, and fake as-featured-in proof are disallowed."
82
82
  ]
83
83
  };
84
84
 
@@ -240,12 +240,14 @@ const GENERIC_EDITORIAL_LAYOUT_PATTERNS = [
240
240
  const SLOP_PATTERNS = [
241
241
  { key: "placeholder_images", label: "placeholder image service", pattern: /\b(?:picsum\.photos|placehold\.co|placeholder\.com)\b/i, weight: 3 },
242
242
  { key: "tailwind_cdn", label: "Tailwind CDN starter styling", pattern: /cdn\.tailwindcss\.com/i, weight: 2 },
243
+ { key: "font_awesome_cdn", label: "Font Awesome CDN chrome", pattern: /cdnjs\.cloudflare\.com\/ajax\/libs\/font-awesome|fontawesome/i, weight: 2 },
243
244
  { key: "inter_playfair", label: "generic Inter/Playfair premium pairing", pattern: /Inter|Playfair\s+Display/i, weight: 2 },
244
245
  { key: "browser_default_type", label: "browser-default serif/sans fallback typography", pattern: /\b(?:Georgia|Times New Roman|serif;|system-ui|BlinkMacSystemFont|Segoe UI|Helvetica|Arial)\b/i, weight: 2 },
245
246
  { key: "fake_prestige", label: "fake prestige or publication badge", pattern: /\b(?:featured in|as seen in|forbes|the atlantic|wall street journal|award-winning)\b/i, weight: 3 },
246
247
  { key: "fake_founder_lore", label: "fake founder or studio lore", pattern: /\b(?:founded in|est\s+20\d{2}|from the studio|published from a small studio|founder\s*&\s*essayist)\b/i, weight: 2 },
247
248
  { key: "newsletter_cliche", label: "generic newsletter promise copy", pattern: /\b(?:no spam, ever|respect your inbox|join the newsletter|subscribe to the journal|receive the next dispatch|quarterly letters from the edge of attention|only the essential)\b/i, weight: 2 },
248
249
  { key: "fake_ui_chrome", label: "fake low-value UI chrome", pattern: /\b(?:search|filterCategory|showPostModal|toggleSearch|Latest Stories|Recent Dispatches|command palette would open here|metaKey && e\.key === ['"]k['"])\b/i, weight: 2 },
250
+ { key: "demo_modal_chrome", label: "demo modal or prompt/alert interaction chrome", pattern: /\b(?:prompt\(|alert\(|modal|demo only|structural preview|select an essay to read a structural preview)\b/i, weight: 2 },
249
251
  { key: "premium_blog_trope", label: "generic premium-blog editorial trope", pattern: /\b(?:thoughtful living|slow living|curated reflections|crafted with intention|made with intention|a quiet publication|made with restraint|journal of attention|discipline of seeing|private notes made public)\b/i, weight: 2 },
250
252
  { key: "reflective_editorial_copy", label: "generic reflective-editorial copy trope", pattern: /\b(?:quiet architecture of attention|great thinkers understood|value of slowness|the examined life|deliberate cultivation of focus|most radical act|what we have forgotten|how everyday items carry|still matters)\b/i, weight: 2 },
251
253
  { key: "fictional_publication_brand", label: "invented publication/author scaffolding", pattern: /\b(?:by [A-Z][a-z]+ [A-Z][a-z]+|photography by [A-Z][a-z]+ [A-Z][a-z]+|journal of attention|vesper|lumen|dispatches|vol\.\s*\d+|winter 20\d{2}|autumn 20\d{2}|spring 20\d{2}|summer 20\d{2}|the quarterly|editorial\.)\b/i, weight: 3 },
@@ -438,14 +440,22 @@ export function detectFrontendSlop({ promptText = "", assistantText = "", receip
438
440
  flags.push("benchmark store relied on Tailwind CDN starter theming");
439
441
  score += 4;
440
442
  }
443
+ if (siteType === "store" && benchmarkMode && /(?:cdnjs\.cloudflare\.com\/ajax\/libs\/font-awesome|fontawesome)/i.test(haystack)) {
444
+ flags.push("benchmark store relied on Font Awesome chrome");
445
+ score += 3;
446
+ }
441
447
  if (siteType === "store" && benchmarkMode && /\b(?:picsum\.photos|placehold\.co|placeholder\.com)\b/i.test(haystack)) {
442
448
  flags.push("benchmark store used placeholder product imagery");
443
449
  score += 4;
444
450
  }
445
- if (siteType === "store" && benchmarkMode && /\b(?:best seller|best seller|\d[\d,]*\s+reviews|as featured in|featured in|trusted by|studio engineers approved)\b/i.test(haystack)) {
451
+ if (siteType === "store" && benchmarkMode && /\b(?:best seller|bestseller|\d[\d,]*\s+reviews|\d[\d,]*\s+\w+\s+sold\s+this\s+month|sold this month|as featured in|featured in|trusted by|studio engineers approved)\b/i.test(haystack)) {
446
452
  flags.push("benchmark store used fake proof or badge chrome");
447
453
  score += 4;
448
454
  }
455
+ if (siteType === "store" && benchmarkMode && /\b(?:metaKey && e\.key === ['"]k['"]|command palette|keyboard shortcuts?)\b/i.test(haystack)) {
456
+ flags.push("benchmark store used fake keyboard or shortcut chrome");
457
+ score += 4;
458
+ }
449
459
  if (siteType === "store" && benchmarkMode && !/\b(?:review|reviews|testimonial|rated|stars?|customers?)\b/i.test(haystack)) {
450
460
  flags.push("benchmark store lacks social proof or review architecture");
451
461
  score += 2;
@@ -470,10 +480,18 @@ export function detectFrontendSlop({ promptText = "", assistantText = "", receip
470
480
  flags.push("benchmark blog relied on Tailwind CDN starter theming");
471
481
  score += 4;
472
482
  }
483
+ if (siteType === "blog" && benchmarkMode && /(?:cdnjs\.cloudflare\.com\/ajax\/libs\/font-awesome|fontawesome)/i.test(haystack)) {
484
+ flags.push("benchmark blog relied on Font Awesome chrome");
485
+ score += 3;
486
+ }
473
487
  if (siteType === "blog" && benchmarkMode && /\b(?:picsum\.photos|placehold\.co|placeholder\.com)\b/i.test(haystack)) {
474
488
  flags.push("benchmark blog used placeholder imagery");
475
489
  score += 4;
476
490
  }
491
+ if (siteType === "blog" && benchmarkMode && /\b(?:prompt\(|alert\(|toggleSearch|viewPost\(|modal|structural preview|subscribe)\b/i.test(haystack)) {
492
+ flags.push("benchmark blog used demo interaction chrome");
493
+ score += 3;
494
+ }
477
495
  if (/\b(?:command palette would open here|metaKey && e\.key === ['"]k['"]|keyboard accessibility)\b/i.test(haystack)) {
478
496
  flags.push("fake keyboard or command-palette gimmick");
479
497
  score += 3;
@@ -492,14 +510,14 @@ export function detectFrontendSlop({ promptText = "", assistantText = "", receip
492
510
  return {
493
511
  score,
494
512
  flags,
495
- hardBlock: flags.some((flag) => /fictional publication identity|generic publication-shell framing|fake keyboard|reflective-editorial atmosphere|primary merchandising surface as a placeholder|Tailwind CDN starter theming|placeholder product imagery|placeholder imagery|fake proof or badge chrome/.test(flag)),
513
+ hardBlock: flags.some((flag) => /fictional publication identity|generic publication-shell framing|fake keyboard|reflective-editorial atmosphere|primary merchandising surface as a placeholder|Tailwind CDN starter theming|Font Awesome chrome|placeholder product imagery|placeholder imagery|fake proof or badge chrome|demo interaction chrome/.test(flag)),
496
514
  severe: score >= 5,
497
515
  summary: flags.length > 0 ? `frontend slop flags: ${flags.join(", ")}` : "no deterministic frontend slop flags"
498
516
  };
499
517
  }
500
518
 
501
519
  export function shouldAutoReviseFrontend({ designReview = null, slop = null, revisionCount = 0 } = {}) {
502
- if (revisionCount >= 2) return false;
520
+ if (revisionCount >= 3) return false;
503
521
  if (!designReview) return false;
504
522
  if (slop?.hardBlock) return true;
505
523
  if (designReview.verdict === "weak") return true;
@@ -528,16 +546,18 @@ export function buildFrontendRevisionPrompt({
528
546
  visualNextPass.length > 0 ? `Screenshot revision priorities:\n- ${visualNextPass.join("\n- ")}` : "",
529
547
  "Do not add new filler sections.",
530
548
  "Do not add fake prestige, fake testimonials, fake brands, placeholder-image services, or fictional publication/persona lore unless the user explicitly asked for that worldbuilding.",
549
+ "Do not use Tailwind CDN or Font Awesome CDN for benchmark pages. Use authored CSS and native SVG or plain text/icon treatment instead.",
531
550
  "If this is a blog or editorial site, prefer structural labels and a stronger layout idea over invented magazines, authors, newsletter promises, or atmosphere-copy.",
532
551
  "Do not use browser-default serif/sans fallback stacks as the end-state typography. Pick a deliberate type system or simplify until the typography feels intentional.",
533
552
  "Remove fake keyboard shortcuts, fake command palettes, and demo-only interaction flourishes that do not help the page.",
534
553
  "Cut reflective-editorial filler copy and replace it with either concrete language or neutral structural placeholders.",
535
554
  "For benchmark blog tasks, default to neutral structural placeholder content instead of invented publication framing, issue metadata, or named contributors.",
536
555
  "For benchmark blog tasks, do not use generic publication-shell labels like Journal, Featured Essay, Latest Dispatches, Print Edition, Submit Work, or publication-footer framing.",
537
- "For benchmark blog tasks, do not use Tailwind CDN starter theming, picsum-style placeholder imagery, or fake search/shortcut chrome.",
556
+ "For benchmark blog tasks, do not use Tailwind CDN starter theming, Font Awesome chrome, picsum-style placeholder imagery, fake search/shortcut chrome, subscribe/newsletter CTA chrome, or demo modal article previews.",
538
557
  "For benchmark store tasks, do not leave the product image area as a labeled placeholder. Use product-shaped merchandising composition, proof, and objection-handling blocks instead.",
539
- "For benchmark store tasks, do not use Tailwind CDN starter theming, picsum-style placeholder imagery, or fake command-palette behavior.",
540
- "For benchmark store tasks, do not invent review counts, bestseller labels, or as-featured-in proof unless the user explicitly requested fictional marketing chrome.",
558
+ "For benchmark store tasks, do not use Tailwind CDN starter theming, Font Awesome chrome, picsum-style placeholder imagery, or fake command-palette behavior.",
559
+ "For benchmark store tasks, do not invent review counts, bestseller labels, sold-this-month counters, or as-featured-in proof unless the user explicitly requested fictional marketing chrome.",
560
+ slop?.hardBlock ? "Hard-fail benchmark patterns are still present. Rebuild the page from scratch if needed rather than preserving those patterns." : "",
541
561
  "Reduce section count if needed and push one stronger asymmetrical composition instead of a sequence of balanced blocks.",
542
562
  "Simplify the page if needed. Stronger direction with fewer elements is preferred over busier generic output.",
543
563
  "Rewrite the weakest sections rather than making superficial tweaks."
package/src/tools.js CHANGED
@@ -506,11 +506,20 @@ function normalizeContractArgs(args = {}) {
506
506
  summary: String(args.summary || "").trim(),
507
507
  paths: normalizePathList(args.paths || []),
508
508
  commands: uniqueStrings(args.commands || []),
509
- verification: uniqueStrings(args.verification || []),
509
+ verification: uniqueStrings((args.verification || []).map((command) => normalizeVerificationCommand(command))),
510
510
  risk: ["low", "medium", "high"].includes(String(args.risk || "").toLowerCase()) ? String(args.risk).toLowerCase() : "medium"
511
511
  };
512
512
  }
513
513
 
514
+ function normalizeVerificationCommand(command) {
515
+ const raw = String(command || "").trim();
516
+ if (!raw) return raw;
517
+ return raw
518
+ .replace(/(^|[\s("'`])\/desktop(?=\/|$)/gi, `$1${shellEscape(path.join(os.homedir(), "Desktop"))}`)
519
+ .replace(/(^|[\s("'`])\/downloads(?=\/|$)/gi, `$1${shellEscape(path.join(os.homedir(), "Downloads"))}`)
520
+ .replace(/(^|[\s("'`])\/documents(?=\/|$)/gi, `$1${shellEscape(path.join(os.homedir(), "Documents"))}`);
521
+ }
522
+
514
523
  function getTouchedPathsForTool(toolName, args = {}) {
515
524
  if (toolName === "write_file" || toolName === "replace_in_file" || toolName === "make_directory" || toolName === "delete_path") {
516
525
  return normalizePathList([args.path || ""]);