@tritard/waterbrother 0.8.42 → 0.8.43

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/frontend.js +43 -12
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tritard/waterbrother",
3
- "version": "0.8.42",
3
+ "version": "0.8.43",
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
@@ -53,7 +53,8 @@ const BENCHMARK_SITE_TYPE_RULES = {
53
53
  "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.",
54
54
  "Benchmark blog mode: include one real editorial image surface or one authored abstract visual composition. Do not replace visuals with text placeholders.",
55
55
  "Benchmark blog mode: do not invent named authors, editors, contributors, or interview credits unless the user explicitly asked for fictional worldbuilding.",
56
- "Benchmark blog mode: prefer concrete subject matter headlines and dek copy over abstract phrases like silence, attention, memory, slowness, or restraint."
56
+ "Benchmark blog mode: prefer concrete subject matter headlines and dek copy over abstract phrases like silence, attention, memory, slowness, or restraint.",
57
+ "Benchmark blog mode: use at least two clear typographic roles and finish with a designed coda or closing gesture. Do not end on a bare year or generic footer label."
57
58
  ],
58
59
  store: [
59
60
  "Benchmark ecommerce mode: prioritize conversion architecture over editorial styling. The page should sell, not just look clean.",
@@ -218,7 +219,7 @@ const BENCHMARK_STARTERS = {
218
219
  "Section 1: restrained masthead with a non-publication title treatment.",
219
220
  "Section 2: one dominant lead piece with a strong headline and one supporting block offset beside or below it.",
220
221
  "Section 3: one compact secondary list or pair of entries, not an archive rail plus topics plus notes stack.",
221
- "Section 4: minimal closing footer note only if needed.",
222
+ "Section 4: designed closing coda only if needed; never a bare year or default footer label.",
222
223
  "No publication shell, no archive/topic chrome, no subscribe CTA, no author bylines, no contributor credits, no demo interactions, no explanation that the page is a demo.",
223
224
  "Use one strong visual surface: a real editorial image URL or an authored abstract composition made with CSS/SVG."
224
225
  ],
@@ -232,6 +233,7 @@ const BENCHMARK_STARTERS = {
232
233
  "Section 5: compact FAQ or guarantee block if still needed.",
233
234
  "No Tailwind starter shell, no fake reviews, no fake badges, no placeholder gallery, no emoji or dashed placeholder hero, no alert-based checkout, no keyboard shortcut chrome, no demo footer copy.",
234
235
  "If you do not implement a real cart drawer or checkout flow, keep cart UI passive. Do not use alert/prompt fallbacks that explain what would happen in a real Shopify store.",
236
+ "If you cannot support full cart behavior, keep the buy action visually strong but behaviorally passive. Never use toasts, fake checkout success, or explanatory demo flows.",
235
237
  "The hero must merchandise the product with a believable product surface and product-specific benefit language, not generic luxury-commerce filler.",
236
238
  "Use a real product image URL or an authored SVG/CSS product silhouette with material/shadow treatment. Never use text-only image placeholders."
237
239
  ]
@@ -245,7 +247,7 @@ const BENCHMARK_STARTER_VARIANTS = {
245
247
  starter: [
246
248
  "Variant shape: severe image-text split with one offset note card and one lean secondary pair.",
247
249
  "Palette should feel mineral, paper, and shadow-driven rather than warm lifestyle-editorial.",
248
- "Finish with one restrained final gesture, not a generic footer label."
250
+ "Finish with one restrained but intentional coda band, rule block, or caption treatment. Never end on a bare year or generic footer label."
249
251
  ]
250
252
  },
251
253
  {
@@ -254,7 +256,8 @@ const BENCHMARK_STARTER_VARIANTS = {
254
256
  starter: [
255
257
  "Variant shape: oversized white space, one dominant visual surface, one short text block, one caption-like secondary band.",
256
258
  "Treat typography like exhibition text: sparse, quiet, and deliberate.",
257
- "Avoid default editorial chrome entirely; let spacing and crop do the work."
259
+ "Avoid default editorial chrome entirely; let spacing and crop do the work.",
260
+ "The closing move should feel designed, not absent. Use one quiet colophon, caption band, or spatial coda."
258
261
  ]
259
262
  },
260
263
  {
@@ -304,13 +307,15 @@ const BENCHMARK_FEWSHOT_EXAMPLES = {
304
307
  "Neutral title treatment instead of Journal/LUMEN/Dispatch.",
305
308
  "One dominant editorial image, one offset supporting block, 3-4 sections max.",
306
309
  "Concrete topic language like 'Concrete Light in Osaka' or 'Domestic Brutalism in Sao Paulo'.",
307
- "No bylines, no archive chrome, no demo footer, no modal article preview JS."
310
+ "No bylines, no archive chrome, no demo footer, no modal article preview JS.",
311
+ "Finish with a designed coda, caption band, or colophon rather than a bare year."
308
312
  ],
309
313
  bad: [
310
314
  "Nav items like Essays, Conversations, Archive.",
311
315
  "Labels like Featured Essay, Latest Dispatches, Notes, From the Archive.",
312
316
  "Fake author lines, contributor credits, or footer copy explaining it is a demo.",
313
- "Headline/dek filler about silence, attention, memory, slowness, or restraint."
317
+ "Headline/dek filler about silence, attention, memory, slowness, or restraint.",
318
+ "A footer that is only a year or one generic label."
314
319
  ]
315
320
  },
316
321
  store: {
@@ -319,14 +324,16 @@ const BENCHMARK_FEWSHOT_EXAMPLES = {
319
324
  "Purchase stack plus trust, objections, and compact FAQ only if needed.",
320
325
  "Copy names material, dimensions, carry/use case, warranty, or care.",
321
326
  "When the prompt is generic, stay with a neutral physical product class instead of drifting into skincare/beauty campaign pages.",
322
- "No alert-based checkout, no fake review counts, no fake featured-in strip, no demo footer."
327
+ "No alert-based checkout, no fake review counts, no fake featured-in strip, no demo footer.",
328
+ "No Tailwind CDN, no Font Awesome, no picsum, no toasts, no newsletter filler."
323
329
  ],
324
330
  bad: [
325
331
  "Generic luxury filler like considered life, timeless essentials, or modern living.",
326
332
  "Beauty/skincare serum landing pages when the user did not ask for that product category.",
327
333
  "Demo cart toasts, alert-based cart fallbacks, or 'in a real Shopify store' copy.",
328
334
  "Placeholder gallery or weak hero that does not merchandise the product.",
329
- "Fake proof chrome like bestseller badges, sold-this-month counters, or made-up review totals."
335
+ "Fake proof chrome like bestseller badges, sold-this-month counters, or made-up review totals.",
336
+ "Tailwind starter shells, Font Awesome icons, picsum imagery, fake press/logo rows, or newsletter signup filler."
330
337
  ]
331
338
  }
332
339
  };
@@ -342,6 +349,7 @@ const BENCHMARK_GRADERS = {
342
349
  { key: "no_demo_js", label: "grader failed: benchmark store still contains demo JS behavior", pattern: /\b(?:alert\(|prompt\(|console\.log|showToast|static demo|in a real shopify store)\b/i, weight: 4, hardBlock: true },
343
350
  { key: "no_fake_cart_fallback", label: "grader failed: benchmark store still uses fake cart or checkout fallback behavior", pattern: /\b(?:cart would open here|would go to checkout|would continue to checkout|would appear here)\b/i, weight: 4, hardBlock: true },
344
351
  { key: "no_fake_proof", label: "grader failed: benchmark store still uses fake proof or badge chrome", pattern: /\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)\b/i, weight: 4, hardBlock: true },
352
+ { key: "no_template_runtime", label: "grader failed: benchmark store still relies on Tailwind CDN, Font Awesome, or placeholder imagery", pattern: /\b(?:cdn\.tailwindcss\.com|fontawesome|font-awesome|picsum\.photos|placehold\.co|placeholder\.com)\b/i, weight: 5, hardBlock: true },
345
353
  { key: "no_generic_luxury_copy", label: "grader failed: benchmark store still relies on generic luxury-commerce copy", pattern: /\b(?:objects for a considered life|considered life|timeless essentials|designed for modern living|carry less\. keep more\.)\b/i, weight: 3, hardBlock: true },
346
354
  { key: "product_specific_copy", label: "grader failed: benchmark store copy is missing product-specific merchandising detail", missing: /\b(?:material|materials|capacity|fits|carry|pocket|warranty|care|dimensions?|full-grain|canvas|leather|zip|strap)\b/i, weight: 2, hardBlock: false }
347
355
  ]
@@ -387,7 +395,8 @@ const SLOP_PATTERNS = [
387
395
  { 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 },
388
396
  { key: "author_bylines", label: "named author or contributor byline", pattern: /\b(?:by [A-Z][A-Za-z]+(?:\s+[A-Z][A-Za-z]+)+|contributor|essay by|interview by)\b/i, weight: 3 },
389
397
  { key: "fake_social_proof", label: "fake reader count or social proof", pattern: /\b(?:\d+\s+readers joined this month|\d+\s+subscribers?|trusted by)\b/i, weight: 2 },
390
- { key: "placeholder_surface", label: "placeholder surface or stand-in hero", pattern: /\b(?:placeholder|visual placeholder|product representation|hero placeholder|dashed|emoji stand-in|🧥|🎧)\b/i, weight: 3 }
398
+ { key: "placeholder_surface", label: "placeholder surface or stand-in hero", pattern: /\b(?:placeholder|visual placeholder|product representation|hero placeholder|dashed|emoji stand-in|🧥|🎧)\b/i, weight: 3 },
399
+ { key: "underdesigned_footer", label: "underdesigned closing gesture", pattern: /<footer[^>]*>\s*(?:<div[^>]*>\s*)?(?:20\d{2}|[A-Z]{2,8})\s*(?:<\/div>)?\s*<\/footer>/i, weight: 2 }
391
400
  ];
392
401
 
393
402
  function getBenchmarkSiteTypeRules(siteType, benchmarkMode) {
@@ -845,6 +854,14 @@ export async function inspectFrontendArtifacts({ cwd, promptText = "", receipt =
845
854
  flags.push("benchmark store still contains generic luxury-commerce copy");
846
855
  score += 3;
847
856
  }
857
+ if (/\b(?:subscribe|newsletter|join)\b/i.test(htmlText)) {
858
+ flags.push("benchmark store still contains newsletter or signup filler");
859
+ score += 2;
860
+ }
861
+ if (/\b(?:LIMITED TIME OFFER|ONLY\s+\d+\s+LEFT|ships today)\b/i.test(htmlText)) {
862
+ flags.push("benchmark store still contains fake urgency copy");
863
+ score += 3;
864
+ }
848
865
  if (!/\b(?:material|materials|capacity|fits|carry|pocket|warranty|care|dimensions?|full-grain|canvas|leather|zip|strap)\b/i.test(htmlText)) {
849
866
  flags.push("benchmark store still lacks product-specific merchandising detail");
850
867
  score += 2;
@@ -867,6 +884,10 @@ export async function inspectFrontendArtifacts({ cwd, promptText = "", receipt =
867
884
  flags.push("benchmark blog still contains generic editorial filler copy");
868
885
  score += 3;
869
886
  }
887
+ if (/<footer[^>]*>\s*(?:<div[^>]*>\s*)?(?:20\d{2}|[A-Z]{2,8})\s*(?:<\/div>)?\s*<\/footer>/i.test(htmlText)) {
888
+ flags.push("benchmark blog closing is underdesigned");
889
+ score += 2;
890
+ }
870
891
  }
871
892
  }
872
893
  }
@@ -896,7 +917,7 @@ export function mergeFrontendSlop(base = null, extra = null) {
896
917
  }
897
918
 
898
919
  export function shouldAutoReviseFrontend({ designReview = null, slop = null, revisionCount = 0, frontend = null } = {}) {
899
- const maxPasses = frontend?.benchmarkMode && frontend?.siteType === "store" ? 5 : 3;
920
+ const maxPasses = frontend?.benchmarkMode && frontend?.siteType === "store" ? 6 : 3;
900
921
  if (revisionCount >= maxPasses) return false;
901
922
  if (!designReview) return false;
902
923
  if (slop?.hardBlock) return true;
@@ -908,7 +929,7 @@ export function shouldAutoReviseFrontend({ designReview = null, slop = null, rev
908
929
  export function shouldForceFrontendRebuild({ frontend = null, slop = null, revisionCount = 0 } = {}) {
909
930
  if (!frontend?.benchmarkMode) return false;
910
931
  if (!slop?.hardBlock) return false;
911
- if (frontend.siteType === "store") return revisionCount < 4;
932
+ if (frontend.siteType === "store") return revisionCount < 5;
912
933
  return revisionCount < 2;
913
934
  }
914
935
 
@@ -928,11 +949,18 @@ export function getFrontendAcceptanceFailure({ frontend = null, slop = null, des
928
949
  flags: Array.isArray(slop?.flags) ? slop.flags : []
929
950
  };
930
951
  }
952
+ if (frontend.siteType === "store" && designReview?.verdict && designReview.verdict !== "strong") {
953
+ return {
954
+ siteType: frontend.siteType,
955
+ reason: `benchmark store acceptance failed: final design review must be strong, got ${String(designReview.verdict)}`,
956
+ flags: Array.isArray(slop?.flags) ? slop.flags : []
957
+ };
958
+ }
931
959
  if (!slop?.hardBlock) return null;
932
960
  const flags = Array.isArray(slop.flags) ? slop.flags : [];
933
961
  if (frontend.siteType === "store") {
934
962
  const blocking = flags.filter((flag) =>
935
- /Tailwind CDN|Font Awesome|placeholder product imagery|placeholder imagery|fake proof or badge chrome|fake keyboard or shortcut chrome|demo behavior|demo page explanation copy|fake cart or checkout fallback behavior|generic luxury-commerce copy|beauty\/skincare landing-page tropes|semantic drift/i.test(flag)
963
+ /Tailwind CDN|Font Awesome|placeholder product imagery|placeholder imagery|fake proof or badge chrome|fake keyboard or shortcut chrome|demo behavior|demo page explanation copy|fake cart or checkout fallback behavior|generic luxury-commerce copy|beauty\/skincare landing-page tropes|semantic drift|newsletter or signup filler|fake urgency copy/i.test(flag)
936
964
  );
937
965
  if (blocking.length > 0) {
938
966
  return {
@@ -982,10 +1010,13 @@ export function buildFrontendRevisionPrompt({
982
1010
  "For benchmark blog tasks, do not use generic publication-shell labels like Journal, Featured Essay, Latest Dispatches, Notes, Archive, Print Edition, Submit Work, or publication-footer framing.",
983
1011
  "For benchmark blog tasks, do not use essay-magazine fallback headlines like In Praise of Slowness, On Attention, The Measure of Restraint, or similar reflective placeholders.",
984
1012
  "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.",
1013
+ "For benchmark blog tasks, do not end on a bare year or generic footer label. Close with a designed coda, caption band, or colophon-level finishing move.",
1014
+ "For benchmark blog tasks, do not collapse to a single-font austere page. Use a stronger headline/body distinction and one additional finishing move after the hero.",
985
1015
  "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.",
986
1016
  "For benchmark store tasks, do not use dashed placeholder boxes, emoji stand-ins, or wireframe hero surfaces. If needed, build a graphic product silhouette or material-driven composition instead.",
987
1017
  "For benchmark store tasks, do not use Tailwind CDN starter theming, Font Awesome chrome, picsum-style placeholder imagery, or fake command-palette behavior.",
988
1018
  "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.",
1019
+ "For benchmark store tasks, do not use newsletter/signup filler, fake urgency copy, or toast/demo success flows. If cart behavior is not real, keep it passive and quiet.",
989
1020
  slop?.hardBlock ? "Hard-fail benchmark patterns are still present. Rebuild the page from scratch if needed rather than preserving those patterns." : "",
990
1021
  "Reduce section count if needed and push one stronger asymmetrical composition instead of a sequence of balanced blocks.",
991
1022
  "Simplify the page if needed. Stronger direction with fewer elements is preferred over busier generic output.",