@domandigital/craft 0.7.0 → 0.8.1

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/dist/audit.cjs CHANGED
@@ -36,15 +36,22 @@ var isProsePath = (path) => /\.(md|markdown|mdx|txt)$/i.test(path);
36
36
  function allText(ctx) {
37
37
  return [...ctx.blocks.filter((b) => isProsePath(b.path)), ...ctx.strings.filter((b) => !isProsePath(b.path))];
38
38
  }
39
+ var LINK = /\b(?:https?:\/\/|www\.)[^\s<>"'`)\]]+|\]\([^)\s]+\)/gi;
40
+ function linkSpans(text) {
41
+ return [...text.matchAll(LINK)].map((m) => [m.index ?? 0, (m.index ?? 0) + m[0].length]);
42
+ }
43
+ var insideLink = (spans, at) => spans.some(([a, b]) => at >= a && at < b);
39
44
  function phrases(patterns, label, source = (ctx) => ctx.blocks, skip = () => false) {
40
45
  return (ctx) => {
41
46
  const hits = [];
42
47
  for (const block of source(ctx)) {
43
48
  const spans = [];
49
+ const links = linkSpans(block.text);
44
50
  for (const pattern of patterns) {
45
51
  const global = new RegExp(pattern.source, pattern.flags.includes("g") ? pattern.flags : `${pattern.flags}g`);
46
52
  for (const m of block.text.matchAll(global)) {
47
53
  if (skip(block, m[0], m.index ?? 0)) continue;
54
+ if (insideLink(links, m.index ?? 0)) continue;
48
55
  spans.push([m.index ?? 0, (m.index ?? 0) + m[0].length, m[0]]);
49
56
  }
50
57
  }
@@ -85,7 +92,14 @@ var AI_WORDS = [
85
92
  "moreover",
86
93
  "navigating",
87
94
  "ever-evolving",
88
- "unparalleled"
95
+ "unparalleled",
96
+ // Measured: Kobak et al. 2024 (arXiv 2406.07016) found these 10 to 14 times
97
+ // above their expected rate in post-ChatGPT abstracts. Academic, so warn only.
98
+ "underscore",
99
+ "underscores",
100
+ "underscoring",
101
+ "showcasing",
102
+ "pivotal"
89
103
  ];
90
104
  var STOCK_PHRASES = [
91
105
  "in today's digital age",
@@ -99,7 +113,11 @@ var STOCK_PHRASES = [
99
113
  "curated",
100
114
  "crafted with care",
101
115
  "tailored to your",
102
- "peace of mind"
116
+ "peace of mind",
117
+ "so here's",
118
+ "in an era where",
119
+ "the future looks bright",
120
+ "only time will tell"
103
121
  ];
104
122
  var AI_PHRASES = [
105
123
  "let's dive in",
@@ -232,7 +250,7 @@ function lineAround(text, index) {
232
250
  var emptyState = (block, match, index = 0) => SIGNED_IN.test(block.path) || DATA_ABSENCE.test(isProsePath(block.path) ? lineAround(block.text, index) : block.text) || DATA_ABSENCE.test(match);
233
251
  var NO_X_NO_Y = /\bno\s+[\w'’ ]{2,30},\s*no\s+\w/i;
234
252
  var NO_X_BADGE = /^no\s+[\w'’\- ]{2,28}[.!]?$/i;
235
- var EMOJI = /[\u{1F300}-\u{1FAFF}\u{1F1E6}-\u{1F1FF}]+/u;
253
+ var EMOJI = /(?:[\u{1F300}-\u{1FAFF}\u{1F1E6}-\u{1F1FF}\u2728\u2705\u274C\u274E\u2757\u2753\u26A1\u2B50\u2764]|[\u2600-\u27BF]\uFE0F)+/u;
236
254
  var placeholderDash = (block) => block.literal === true && /^[\s—]*$/.test(block.text);
237
255
  function badgeHits(ctx) {
238
256
  const hits = [];
@@ -275,10 +293,16 @@ var COPY_TELLS = [
275
293
  surface: "copy",
276
294
  why: "Phrases every generated services page uses. They fill space where a fact should be.",
277
295
  fix: "Replace the phrase with the fact behind it: a number, a name, a place, a time.",
278
- detect: phrases([wordList(STOCK_PHRASES)], quoted),
296
+ detect: phrases([wordList(STOCK_PHRASES), /\b(?:in|on|along)\s+(?:its|their|his|her)\s+journey\b/i], quoted),
279
297
  fixtures: {
280
- flag: [f("content/home.md", "Take your plumbing to the next level with peace of mind.")],
281
- pass: [f("content/home.md", "Gas Safe registered since 2009. Same-day callouts in Brackley.")]
298
+ flag: [
299
+ f("content/home.md", "Take your plumbing to the next level with peace of mind."),
300
+ f("content/home.md", "We meet each practice where it is in its journey.")
301
+ ],
302
+ pass: [
303
+ f("content/home.md", "Gas Safe registered since 2009. Same-day callouts in Brackley."),
304
+ f("content/home.md", "We mapped the patient journey from booking to aftercare.")
305
+ ]
282
306
  }
283
307
  },
284
308
  {
@@ -303,7 +327,11 @@ var COPY_TELLS = [
303
327
  f("content/home.md", "In today's rapidly evolving market, we help."),
304
328
  f("content/home.md", "Whether you're a landlord or a tenant, call us.")
305
329
  ],
306
- pass: [f("content/home.md", "Book in three taps. We confirm by text within the hour.")]
330
+ pass: [
331
+ f("content/home.md", "Book in three taps. We confirm by text within the hour."),
332
+ f("content/home.md", "Book at https://example.com/seamless-booking today."),
333
+ f("content/home.md", "[Book a slot](/seamless-booking) today.")
334
+ ]
307
335
  }
308
336
  },
309
337
  {
@@ -452,8 +480,14 @@ var COPY_TELLS = [
452
480
  fix: "Remove it. Typographic marks are fine: a star for a rating, a middot as a separator, an arrow in a link.",
453
481
  detect: phrases([new RegExp(EMOJI.source, "u")], (m) => `emoji ${m}`, (ctx) => ctx.strings),
454
482
  fixtures: {
455
- flag: [f("content/home.md", "New treatments this month \u2728\u{1F680}"), f("app/cta.tsx", `export const label = "Book \u{1F680}";`)],
456
- pass: [f("content/home.md", "Rated \u2605\u2605\u2605\u2605\u2605 \xB7 Book now \u2192")]
483
+ flag: [
484
+ f("content/home.md", "New treatments this month \u2728\u{1F680}"),
485
+ f("app/cta.tsx", `export const label = "Book \u{1F680}";`),
486
+ f("content/home.md", "New treatments this month \u2728"),
487
+ f("content/home.md", "Same-day callouts \u2705"),
488
+ f("content/home.md", "Open Sundays \u2600\uFE0F")
489
+ ],
490
+ pass: [f("content/home.md", "Rated \u2605\u2605\u2605\u2605\u2605 \xB7 Book now \u2192"), f("content/home.md", "\u2713 Gas Safe registered")]
457
491
  }
458
492
  },
459
493
  {
@@ -551,6 +585,698 @@ var COPY_TELLS = [
551
585
  }
552
586
  }
553
587
  ];
588
+ var ING_TAIL = /,\s+(?:ensuring|highlighting|underscoring|showcasing|reflecting|demonstrating|emphasi[sz]ing|fostering|cementing|solidifying|reinforcing|symboli[sz]ing|signalling|signaling)\b[^.!?\n]{0,80}/i;
589
+ var VAGUE_ATTRIBUTION = [
590
+ /\b(?:studies|research|experts|scientists|surveys|statistics|the data)\s+(?:show|shows|suggest|suggests|agree|say|says|confirm|confirms|prove|proves|indicate|indicates)\b/i,
591
+ /\b(?:many|most)\s+(?:experts|people|customers|professionals|homeowners)\s+(?:agree|say|believe)\b/i,
592
+ /\bit\s+is\s+(?:widely|generally|commonly)\s+(?:known|accepted|believed|agreed)\b/i
593
+ ];
594
+ function sourced(block, _match, index) {
595
+ const before = block.text.slice(Math.max(0, index - 40), index);
596
+ if (/(?:\b[A-Z][\w&]*[’']s|\b[A-Z]{2,}[a-z]*)\s+$/.test(before)) return true;
597
+ const rest = block.text.slice(index, index + 400);
598
+ const end = rest.search(/[.!?](?:\s|$)/);
599
+ const sentence = rest.slice(0, end === -1 ? rest.length : end + 16);
600
+ return /\[\^\w+\]|\]\(https?:|\(source|according to [A-Z]|\bper [A-Z]/.test(sentence);
601
+ }
602
+ var CLOSING_SUMMARY = /(?:^|[.!?]\s+|\n\s*|>\s*)(?:Overall|In conclusion|In summary|To sum up|All in all|In short|To summari[sz]e),/;
603
+ var FALSE_RANGE = [
604
+ /\bfrom\s+(?:[\w'’-]+\s+){0,3}[\w'’-]+\s+to\s+(?:[\w'’-]+\s+){0,3}[\w'’-]+\s+alike\b/i,
605
+ /\b(?:everyone|anyone)\s+from\s+(?:[\w'’-]+\s+){0,3}[\w'’-]+\s+to\s+(?:[\w'’-]+\s*){1,4}/i
606
+ ];
607
+ var RESIDUE = [
608
+ /\bas an AI(?:\s+language)?\s+(?:model|assistant)\b/i,
609
+ /(?:^|\n|>)\s*(?:Certainly|Sure|Absolutely|Of course|Great question)[!,.]\s+(?:Here(?:['’]s| is| are)|Below)\b/i,
610
+ /\bhere(?:['’]s| is)\s+(?:a|an|the|your)\s+(?:revised|rewritten|updated|polished|refined|improved|draft|more concise)\s+(?:version|draft|copy)\b/i,
611
+ /\blet me know if you(?:['’]d| would) like me to\b/i,
612
+ /\b(?:my|the) (?:knowledge|training) cut-?off\b|\bas of my last (?:update|training)\b/i,
613
+ /\bI hope this helps\b/i,
614
+ // Citation tokens a chat tool leaves in copied text.
615
+ // A run of them is one paste: "citeturn11search1turn10view0" is one finding.
616
+ // ChatGPT wraps them in invisible private-use characters (U+E200 to U+E202),
617
+ // which survive a copy and paste into a CMS: found live, 2026-09-23.
618
+ /[\uE200-\uE2FF]*(?:cite)?[\uE200-\uE2FF]*(?:turn\d+(?:search|news|view|fetch|file|image)\d+[\uE200-\uE2FF]*)+/,
619
+ /:?contentReference\[oaicite:\d+\](?:\{index=\d+\})?/,
620
+ // Entity markers from the same paste: entity["company","Bark","services
621
+ // marketplace"] shows on the page where the plain name "Bark" belongs.
622
+ /[\uE200-\uE2FF]*entity[\uE200-\uE2FF]*\["[a-z_]+"\s*,\s*"[^"\n]{1,80}"(?:\s*,\s*"[^"\n]{0,160}")*\][\uE200-\uE2FF]*/,
623
+ /【\d+(?:[:†][^】]{0,40})?】/
624
+ ];
625
+ var AI_UTM = /utm_source=(?:chatgpt\.com|chat\.openai\.com|openai|perplexity(?:\.ai)?|claude\.ai|copilot(?:\.microsoft\.com)?|gemini(?:\.google\.com)?)\b/gi;
626
+ function residueHits(ctx) {
627
+ const hits = phrases(RESIDUE, quoted, allText)(ctx);
628
+ for (const file of ctx.files) {
629
+ for (const m of file.text.matchAll(AI_UTM)) hits.push({ path: file.path, offset: m.index ?? 0, message: `link tracked as copied from a chat assistant: "${m[0]}"` });
630
+ }
631
+ return hits;
632
+ }
633
+ var PLACEHOLDER = [
634
+ /\[(?:insert|your|add|company|client|business|customer|name of|placeholder)\b[^\]\n]{0,40}\](?!\()/i,
635
+ /\blorem ipsum\b/i,
636
+ /\bTODO_PLACEHOLDER\b/
637
+ ];
638
+ var PLACEHOLDER_ELEMENT = />\s*(\[(?:insert|your|add|company|client|business|customer|name of|placeholder)\b[^\]\n<]{0,40}\])\s*</gi;
639
+ function insideQuotes(block, _match, index) {
640
+ const lineStart = block.text.lastIndexOf("\n", index - 1) + 1;
641
+ const before = block.text.slice(lineStart, index);
642
+ const straight = (before.match(/"/g) ?? []).length;
643
+ const curly = (before.match(/“/g) ?? []).length - (before.match(/”/g) ?? []).length;
644
+ return straight % 2 === 1 || curly > 0;
645
+ }
646
+ function placeholderHits(ctx) {
647
+ const hits = phrases(PLACEHOLDER, quoted, allText, insideQuotes)(ctx);
648
+ const seen = new Set(hits.map((h) => `${h.path}:${h.offset}`));
649
+ for (const file of ctx.files) {
650
+ if (isProsePath(file.path)) continue;
651
+ for (const m of file.text.matchAll(PLACEHOLDER_ELEMENT)) {
652
+ const offset = (m.index ?? 0) + m[0].indexOf(m[1]);
653
+ if (!seen.has(`${file.path}:${offset}`)) hits.push({ path: file.path, offset, message: quoted(m[1]) });
654
+ }
655
+ }
656
+ return hits;
657
+ }
658
+ var QUESTION_REVEAL = [
659
+ /\b(?:The|Our|What['’]s the|Here['’]s the)\s+(?:result|catch|secret|answer|difference|best part|twist|kicker|bottom line|upshot)\?\s+[A-Z0-9]/,
660
+ /\?\s+It means\b/
661
+ ];
662
+ function inlineLabelHits(ctx) {
663
+ const hits = [];
664
+ for (const file of ctx.files) {
665
+ if (!isProsePath(file.path)) continue;
666
+ const lines = file.text.split("\n");
667
+ let run = [];
668
+ let offset = 0;
669
+ const flush = () => {
670
+ if (run.length >= 3) hits.push({ path: file.path, offset: run[0], message: `${run.length} bullets in a row open with a bold label and a colon` });
671
+ run = [];
672
+ };
673
+ for (const line of lines) {
674
+ const m = /^\s*(?:[-*+]|\d+\.)\s+\*\*[^*]{1,40}:?\*\*:?\s+(\S.*)$/.exec(line);
675
+ if (m && m[1].trim().split(/\s+/).length <= 6) run.push(offset);
676
+ else flush();
677
+ offset += line.length + 1;
678
+ }
679
+ flush();
680
+ }
681
+ return hits;
682
+ }
683
+ var RESEARCH_TELLS = [
684
+ {
685
+ id: "chatbot-residue",
686
+ name: "Chatbot residue",
687
+ generation: 1,
688
+ severity: "warn",
689
+ surface: "copy",
690
+ why: "'Certainly! Here's a revised version', 'as an AI language model', a citeturn0search0 token, a link tracked utm_source=chatgpt.com: text that exists only because a chat reply was pasted whole. This is evidence, not style.",
691
+ fix: "Delete the residue. Then read the whole passage again, because the rest of it came from the same paste.",
692
+ detect: residueHits,
693
+ fixtures: {
694
+ flag: [
695
+ f("content/home.md", "Certainly! Here's a revised version of your home page."),
696
+ f("content/home.md", "As an AI language model, I cannot visit your salon."),
697
+ f("content/home.md", "Let me know if you'd like me to shorten it."),
698
+ f("content/home.md", "Prices start at \xA340 citeturn0search3 for a full set."),
699
+ f("content/home.md", "Prices start at \xA340. citeturn11search1turn10view0turn2view3"),
700
+ f("content/home.md", "Prices start at \xA340. \uE200cite\uE202turn11search1\uE202turn10view0\uE201"),
701
+ f("content/home.md", "Prices start at \xA340 :contentReference[oaicite:2]{index=2} for a full set."),
702
+ f("content/home.md", "Prices start at \xA340\u30104\u2020source\u3011 for a full set."),
703
+ f("app/guide.tsx", `export const Guide = () => <a href="https://example.com/guide?utm_source=chatgpt.com">Read the guide</a>;`),
704
+ f("content/home.md", "Here's a more concise version for the hero.")
705
+ ],
706
+ pass: [
707
+ f("content/home.md", "Certainly the busiest week of the year: book early."),
708
+ f("content/home.md", "Here's the price list for 2026."),
709
+ f("app/guide.tsx", `export const Guide = () => <a href="https://example.com/guide?utm_source=newsletter">Read the guide</a>;`)
710
+ ]
711
+ }
712
+ },
713
+ {
714
+ id: "placeholder",
715
+ name: "Unfilled placeholder",
716
+ generation: 1,
717
+ severity: "warn",
718
+ surface: "copy",
719
+ why: "'[Insert testimonial]', '[Your Name]', lorem ipsum, TODO_PLACEHOLDER: scaffolding a reader must never see, and the clearest sign a page shipped before anyone read it.",
720
+ fix: "Fill it from the client or the proof source, or remove the element. Never invent the missing fact to close it.",
721
+ detect: placeholderHits,
722
+ fixtures: {
723
+ flag: [
724
+ f("content/home.md", "Rated 5 stars by [Insert client name] and others."),
725
+ f("content/home.md", "Lorem ipsum dolor sit amet."),
726
+ f("content/home.md", "Rated TODO_PLACEHOLDER: google_rating from our reviews."),
727
+ f("app/card.tsx", `export const Quote = () => <blockquote>[Insert testimonial here]</blockquote>;`)
728
+ ],
729
+ pass: [
730
+ f("content/home.md", "Manage bookings in [your account](/account)."),
731
+ f("content/guide.md", 'After 90 days, check your ranking for "[your trade] [your town]" on Google.'),
732
+ f("content/guide.md", "Send a short message: \u201CThanks for choosing [Business Name]! Leave us a review.\u201D"),
733
+ f("content/home.md", "Rated 4.9 from 212 Google reviews.")
734
+ ]
735
+ }
736
+ },
737
+ {
738
+ id: "question-reveal",
739
+ name: "Staged reveal",
740
+ generation: 2,
741
+ severity: "warn",
742
+ surface: "copy",
743
+ why: "'The result? Faster growth.', 'What does this mean for you? It means...': the writer asks the reader's question for them and answers it. An infomercial hook, and a favourite of generated copy.",
744
+ fix: "State the answer: 'Most customers book again within six weeks.'",
745
+ detect: phrases(QUESTION_REVEAL, quoted),
746
+ fixtures: {
747
+ flag: [f("content/home.md", "We rebuilt the booking flow. The result? Twice the bookings."), f("content/home.md", "What does this mean for you? It means fewer missed calls.")],
748
+ pass: [f("content/faq.md", "How long does a set last? About three weeks with gel."), f("content/home.md", "We rebuilt the booking flow, and bookings doubled in a month.")]
749
+ }
750
+ },
751
+ {
752
+ id: "inline-label-list",
753
+ name: "Bold-label bullets",
754
+ generation: 2,
755
+ severity: "warn",
756
+ surface: "copy",
757
+ why: "'**Speed:** Faster pages' three times in a row: a short label restated in a few words, the list shape generated copy defaults to. A definition list, with a real explanation after each label, is not this.",
758
+ fix: "Drop the labels and write each bullet as the fact: 'Pages load in under a second'. Keep labels only where they help a reader navigate, as in a specification.",
759
+ detect: inlineLabelHits,
760
+ fixtures: {
761
+ flag: [f("content/home.md", "- **Speed:** Faster pages\n- **Security:** Safer data\n- **Support:** Help when you need it\n")],
762
+ pass: [
763
+ f("content/home.md", "- Pages load in under a second\n- Card details never touch our server\n- Support by phone until 8pm\n"),
764
+ f("content/home.md", "- **Speed:** Faster pages\n- **Security:** Safer data\n"),
765
+ f("content/guide.md", "- **GDC**: The statutory regulator for all dental professionals.\n- **GCC**: The statutory regulator for chiropractors in the UK.\n- **CQC**: The independent regulator of health and social care in England.\n")
766
+ ]
767
+ }
768
+ },
769
+ {
770
+ id: "ing-tail",
771
+ name: "Empty -ing tail",
772
+ generation: 2,
773
+ severity: "warn",
774
+ surface: "copy",
775
+ why: "'..., ensuring peace of mind', '..., highlighting our commitment': a participle tacked on the end that claims significance and names no mechanism. One of the most common shapes in the Wikipedia guide to AI writing.",
776
+ fix: "Cut the tail, or replace it with the mechanism: 'so you can drop the car off before work'.",
777
+ detect: phrases([ING_TAIL], (m) => quoted(m.replace(/^,\s*/, ""))),
778
+ fixtures: {
779
+ flag: [
780
+ f("content/home.md", "Every engineer is Gas Safe registered, ensuring complete peace of mind."),
781
+ f("app/about.tsx", `export const About = () => <p>We have served Brackley since 2009, highlighting our commitment to the town.</p>;`)
782
+ ],
783
+ pass: [
784
+ f("content/home.md", "We open at 7am, so you can drop the car off before work."),
785
+ f("content/home.md", "Engineers arrive by 9, carrying the parts for most boilers.")
786
+ ]
787
+ }
788
+ },
789
+ {
790
+ id: "vague-attribution",
791
+ name: "Unnamed source",
792
+ generation: 1,
793
+ severity: "warn",
794
+ surface: "copy",
795
+ why: "'Studies show', 'experts agree', 'it is widely known': a claim credited to nobody. A reader cannot check it, and the house proof rule forbids a claim nobody can check.",
796
+ fix: "Name the source and the number ('A 2023 Which? survey of 2,000 drivers found...') or cut the claim.",
797
+ detect: phrases(VAGUE_ATTRIBUTION, quoted, (ctx) => ctx.blocks, sourced),
798
+ fixtures: {
799
+ flag: [
800
+ f("content/home.md", "Studies show that regular servicing saves money."),
801
+ f("content/home.md", "Most experts agree a boiler lasts fifteen years."),
802
+ f("content/home.md", "It is widely known that gel damages nails.")
803
+ ],
804
+ pass: [
805
+ f("content/home.md", "A 2023 Which? survey of 2,000 owners found serviced boilers failed half as often."),
806
+ f("content/home.md", "BrightLocal's research shows that reviews drive 20% of local ranking."),
807
+ f("content/home.md", "Research shows 62% of consumers avoid a business with wrong hours.[^7]"),
808
+ f("content/home.md", "Our customers rate us 4.9 from 212 Google reviews.")
809
+ ]
810
+ }
811
+ },
812
+ {
813
+ id: "closing-summary",
814
+ name: "Closing summary",
815
+ generation: 1,
816
+ severity: "warn",
817
+ surface: "copy",
818
+ why: "'Overall,', 'In conclusion,', 'In short,': a paragraph that announces it is summing up, then restates what the reader has just read.",
819
+ fix: "Cut the summary. End on the last new fact, or on the next step: 'Book a survey and we'll quote within two days'.",
820
+ detect: phrases([CLOSING_SUMMARY], (m) => quoted(m.replace(/^[.!?>\s]+/, ""))),
821
+ fixtures: {
822
+ flag: [
823
+ f("content/home.md", "We rewire, test and certify.\n\nOverall, we are the right choice for your home."),
824
+ f("content/home.md", "Prices start at \xA340. In conclusion, we offer great value.")
825
+ ],
826
+ pass: [f("content/home.md", "We rewire, test and certify.\n\nBook a survey and we'll quote within two days.")]
827
+ }
828
+ },
829
+ {
830
+ id: "false-range",
831
+ name: "False range",
832
+ generation: 1,
833
+ severity: "warn",
834
+ surface: "copy",
835
+ why: "'From first-time buyers to seasoned investors alike' names two ends of no real scale, to sound as if it covers everyone. It describes nobody.",
836
+ fix: "Say who you actually serve, or cut it. A real range is fine: 'from 9am to 5pm', 'from small repairs to full rewires'.",
837
+ detect: phrases(FALSE_RANGE, quoted),
838
+ fixtures: {
839
+ flag: [
840
+ f("content/home.md", "We help clients from first-time buyers to seasoned investors alike."),
841
+ f("content/home.md", "Everyone from students to retirees loves our cakes.")
842
+ ],
843
+ pass: [
844
+ f("content/home.md", "Open from 9am to 5pm, Monday to Saturday."),
845
+ f("content/home.md", "We take on everything from small repairs to full rewires.")
846
+ ]
847
+ }
848
+ }
849
+ ];
850
+
851
+ // src/character/tells/density.ts
852
+ var DOCUMENT = /\.(md|markdown|mdx|txt|html?)$/i;
853
+ var MIN_WORDS = 400;
854
+ var WORD = /[A-Za-z0-9£$€][\w'’£$€%.,-]*/g;
855
+ var countWords = (text) => (text.match(WORD) ?? []).length;
856
+ function documents(ctx) {
857
+ const byPath = /* @__PURE__ */ new Map();
858
+ for (const block of ctx.blocks) {
859
+ if (!DOCUMENT.test(block.path) || block.literal) continue;
860
+ const list = byPath.get(block.path) ?? [];
861
+ list.push(block);
862
+ byPath.set(block.path, list);
863
+ }
864
+ const docs = [];
865
+ for (const [path, blocks] of byPath) {
866
+ const text = blocks.map((b) => withoutHeadings(b.text)).join("\n");
867
+ const words = countWords(text);
868
+ if (words >= MIN_WORDS) docs.push({ path, blocks, words });
869
+ }
870
+ return docs;
871
+ }
872
+ var withoutHeadings = (text) => text.replace(/^\s{0,3}#{1,6}\s.*$/gm, "");
873
+ var allowed = (doc2, floor, per1000) => Math.max(floor, Math.floor(doc2.words * per1000 / 1e3));
874
+ var thousands = (n) => n.toLocaleString("en-GB");
875
+ function sentences(doc2) {
876
+ const out = [];
877
+ for (const block of doc2.blocks) {
878
+ const text = withoutHeadings(block.text);
879
+ for (const para of text.matchAll(/[^\n]+(?:\n(?!\s*\n)[^\n]+)*/g)) {
880
+ const body = para[0];
881
+ const start = para.index ?? 0;
882
+ for (const m of body.matchAll(/[^.!?]+[.!?]+["'’”)]*|[^.!?]+$/g)) {
883
+ const raw = m[0];
884
+ const trimmed = raw.trim();
885
+ if (countWords(trimmed) === 0) continue;
886
+ const lead = raw.length - raw.trimStart().length;
887
+ out.push({ text: trimmed.replace(/\s+/g, " "), offset: block.offset + start + (m.index ?? 0) + lead });
888
+ }
889
+ }
890
+ }
891
+ return out;
892
+ }
893
+ var RATES = [
894
+ { label: "rather than", pattern: /\brather\s+than\b/i, floor: 4, per1000: 0.9, why: "the document's one move" },
895
+ { label: "instead of", pattern: /\binstead\s+of\b/i, floor: 4, per1000: 0.7, why: "the reflex swap once 'rather than' is edited out" },
896
+ { label: "actually", pattern: /\bactually\b/i, floor: 2, per1000: 0.35, why: "filler, the sentence means the same without it" },
897
+ { label: "properly", pattern: /\bproperly\b/i, floor: 3, per1000: 0.4, why: "filler, the sentence means the same without it" },
898
+ { label: "genuinely", pattern: /\bgenuinely\b/i, floor: 1, per1000: 0.2, why: "reaching for sincerity: one is emphasis, two is a tic" },
899
+ {
900
+ label: "the single ...est",
901
+ pattern: /\bthe\s+single\s+(?:\w+est|most|\w+\s+most)\b/i,
902
+ floor: 1,
903
+ per1000: 0.15,
904
+ why: "if three things are the single most important, none is"
905
+ },
906
+ { label: "That is / This is opener", pattern: /^(?:That\s+is|That['’]s|This\s+is)\b/, opener: true, floor: 4, per1000: 0.7, why: "pointing back instead of moving on" },
907
+ { label: "Every opener", pattern: /^Every\b/, opener: true, floor: 4, per1000: 0.6, why: "the same sweeping opener, again" },
908
+ {
909
+ label: "Worth noting opener",
910
+ pattern: /^(?:Worth\s+(?:knowing|noting|saying|mentioning|remembering)|It(?:['’]s|\s+is)\s+worth\s+(?:knowing|noting|saying|mentioning|remembering))\b/,
911
+ opener: true,
912
+ floor: 3,
913
+ per1000: 0.5,
914
+ why: "a hedge that lets a sentence start without committing"
915
+ },
916
+ {
917
+ label: "negation-led opener",
918
+ pattern: /^(?:None\s+of|Not\s+one|Not\s+a\s+single|Nothing|No\s+one|Nobody|Never)\b/,
919
+ opener: true,
920
+ floor: 5,
921
+ per1000: 1,
922
+ why: "each earns its place once or twice; at twenty the document has one move"
923
+ },
924
+ {
925
+ label: "participle triad",
926
+ pattern: /\b[a-z]{3,}ed,\s+[a-z]{3,}ed,?\s+and\s+[a-z]{3,}ed\b/i,
927
+ floor: 3,
928
+ per1000: 0.6,
929
+ why: "'researched, written and referenced' is fine once and a cadence in bulk"
930
+ }
931
+ ];
932
+ function rateHits(ctx) {
933
+ const hits = [];
934
+ for (const doc2 of documents(ctx)) {
935
+ const list = sentences(doc2);
936
+ for (const rate of RATES) {
937
+ const found = [];
938
+ const global = new RegExp(rate.pattern.source, rate.pattern.flags.replace("g", "") + "g");
939
+ for (const s of list) {
940
+ if (rate.opener) {
941
+ if (rate.pattern.test(s.text)) found.push(s);
942
+ } else {
943
+ const n = (s.text.match(global) ?? []).length;
944
+ for (let k = 0; k < n; k += 1) found.push(s);
945
+ }
946
+ }
947
+ const limit = allowed(doc2, rate.floor, rate.per1000);
948
+ if (found.length > limit) {
949
+ hits.push({
950
+ path: doc2.path,
951
+ offset: found[limit].offset,
952
+ message: `"${rate.label}" ${found.length} times in ${thousands(doc2.words)} words (allows ${limit}): ${rate.why}`,
953
+ excerpt: found[limit].text.slice(0, 120)
954
+ });
955
+ }
956
+ }
957
+ }
958
+ return hits;
959
+ }
960
+ function aphorismHits(ctx) {
961
+ const hits = [];
962
+ for (const doc2 of documents(ctx)) {
963
+ const found = [];
964
+ for (const block of doc2.blocks) {
965
+ let at = 0;
966
+ for (const line of withoutHeadings(block.text).split("\n")) {
967
+ const text = line.trim().replace(/^[-*>]\s+/, "");
968
+ const parts2 = text.match(/[^.!?]+[.!?]+/g) ?? [];
969
+ if (parts2.length === 2 && parts2.join("").length >= text.length - 1 && parts2.every((p) => countWords(p) >= 2 && countWords(p) <= 7)) {
970
+ found.push({ text, offset: block.offset + at + line.indexOf(text.charAt(0)) });
971
+ }
972
+ at += line.length + 1;
973
+ }
974
+ }
975
+ const limit = allowed(doc2, 5, 1.2);
976
+ if (found.length > limit) {
977
+ hits.push({
978
+ path: doc2.path,
979
+ offset: found[limit].offset,
980
+ message: `${found.length} two-line aphorisms in ${thousands(doc2.words)} words (allows ${limit}). Keep the one that lands hardest`,
981
+ excerpt: found[limit].text
982
+ });
983
+ }
984
+ }
985
+ return hits;
986
+ }
987
+ var CONTRACTION = /\b(?:\w+n['’]t|\w+['’](?:re|ve|ll|m|d)|(?:it|that|there|here|what|who|he|she|let|where)['’]s)\b/gi;
988
+ function contractionHits(ctx) {
989
+ const hits = [];
990
+ for (const doc2 of documents(ctx)) {
991
+ if (doc2.words < 800) continue;
992
+ const text = doc2.blocks.map((b) => withoutHeadings(b.text)).join("\n");
993
+ const count2 = (text.match(CONTRACTION) ?? []).length;
994
+ const rate = count2 * 1e3 / doc2.words;
995
+ if (rate < 1) {
996
+ const first = sentences(doc2)[0];
997
+ hits.push({
998
+ path: doc2.path,
999
+ offset: first?.offset ?? 0,
1000
+ message: `${count2} contraction${count2 === 1 ? "" : "s"} in ${thousands(doc2.words)} words. Prose with none reads stiff; formal legal pages are the exception`
1001
+ });
1002
+ }
1003
+ }
1004
+ return hits;
1005
+ }
1006
+ function rhythmHits(ctx) {
1007
+ const hits = [];
1008
+ for (const doc2 of documents(ctx)) {
1009
+ const list = sentences(doc2);
1010
+ if (list.length < 40) continue;
1011
+ const lengths = list.map((s) => countWords(s.text));
1012
+ const mean = lengths.reduce((a, b) => a + b, 0) / lengths.length;
1013
+ const sd = Math.sqrt(lengths.reduce((a, b) => a + (b - mean) ** 2, 0) / lengths.length);
1014
+ const cv = sd / mean;
1015
+ if (cv < 0.42) {
1016
+ hits.push({
1017
+ path: doc2.path,
1018
+ offset: list[0].offset,
1019
+ message: `${list.length} sentences averaging ${mean.toFixed(1)} words with little variation (spread ${cv.toFixed(2)}, reads metronomic below 0.42)`
1020
+ });
1021
+ }
1022
+ }
1023
+ return hits;
1024
+ }
1025
+ var normal = (s) => s.toLowerCase().replace(/[’]/g, "'").match(/[a-z0-9£$€'%]+/g) ?? [];
1026
+ function repeatHits(ctx) {
1027
+ const hits = [];
1028
+ const RUN = 9;
1029
+ for (const doc2 of documents(ctx)) {
1030
+ const whole = /* @__PURE__ */ new Map();
1031
+ const runs = /* @__PURE__ */ new Map();
1032
+ for (const s of sentences(doc2)) {
1033
+ const words = normal(s.text);
1034
+ if (words.length < RUN || !/[.!?]["'’”)]*$/.test(s.text)) continue;
1035
+ const key = words.join(" ");
1036
+ const earlier = whole.get(key);
1037
+ if (earlier) {
1038
+ hits.push({ path: doc2.path, offset: s.offset, message: `the same sentence appears twice (${words.length} words)`, excerpt: s.text.slice(0, 120) });
1039
+ continue;
1040
+ }
1041
+ whole.set(key, s);
1042
+ let reported = false;
1043
+ for (let i = 0; i + RUN <= words.length && !reported; i += 1) {
1044
+ const run = words.slice(i, i + RUN).join(" ");
1045
+ const seen = runs.get(run);
1046
+ if (seen && seen.key !== key) {
1047
+ hits.push({ path: doc2.path, offset: s.offset, message: `shares a ${RUN}-word run with an earlier sentence: "${run}"`, excerpt: s.text.slice(0, 120) });
1048
+ reported = true;
1049
+ } else if (!seen) {
1050
+ runs.set(run, { sentence: s, key });
1051
+ }
1052
+ }
1053
+ }
1054
+ }
1055
+ return hits;
1056
+ }
1057
+ function headings(file) {
1058
+ const out = [];
1059
+ for (const m of file.text.matchAll(/^\s{0,3}#{1,6}\s+(.+?)\s*#*\s*$/gm)) {
1060
+ out.push({ text: m[1], offset: (m.index ?? 0) + m[0].indexOf(m[1]), end: (m.index ?? 0) + m[0].length });
1061
+ }
1062
+ for (const m of file.text.matchAll(/<h[1-6]\b[^>]*>([\s\S]*?)<\/h[1-6]>/gi)) {
1063
+ const text = m[1].replace(/<[^>]+>/g, "").replace(/\s+/g, " ").trim();
1064
+ if (text) out.push({ text, offset: (m.index ?? 0) + m[0].indexOf(m[1]), end: (m.index ?? 0) + m[0].length });
1065
+ }
1066
+ return out.sort((a, b) => a.offset - b.offset);
1067
+ }
1068
+ function longFiles(ctx) {
1069
+ const docs = new Map(documents(ctx).map((d) => [d.path, d]));
1070
+ return ctx.files.filter((f4) => docs.has(f4.path)).map((file) => ({ file, doc: docs.get(file.path) }));
1071
+ }
1072
+ var HEADING_SHAPES = [
1073
+ ["X, and Y", /^[^,]{2,}, and [^,]{2,}$/i],
1074
+ ["X, because Y", /^[^,]{2,}, because [^,]{2,}$/i],
1075
+ ["comma list", /^[A-Z][\w'’-]*(?:, [\w'’-]+){2,}(?:,? (?:and|or) [\w'’-]+)?\.?$/]
1076
+ ];
1077
+ function headingShapeHits(ctx) {
1078
+ const hits = [];
1079
+ for (const { file, doc: doc2 } of longFiles(ctx)) {
1080
+ const found = [];
1081
+ for (const heading of headings(file)) {
1082
+ const shape = HEADING_SHAPES.find(([, re]) => re.test(heading.text));
1083
+ if (shape) found.push({ heading, shape: shape[0] });
1084
+ }
1085
+ const limit = allowed(doc2, 3, 0.5);
1086
+ if (found.length > limit) {
1087
+ hits.push({
1088
+ path: file.path,
1089
+ offset: found[limit].heading.offset,
1090
+ message: `${found.length} headings share one shape (${[...new Set(found.map((f4) => f4.shape))].join(", ")}), allows ${limit}`,
1091
+ excerpt: found[limit].heading.text
1092
+ });
1093
+ }
1094
+ }
1095
+ return hits;
1096
+ }
1097
+ function headingEchoHits(ctx) {
1098
+ const hits = [];
1099
+ for (const { file } of longFiles(ctx)) {
1100
+ for (const heading of headings(file)) {
1101
+ const words = normal(heading.text);
1102
+ if (words.length < 4) continue;
1103
+ const after = file.text.slice(heading.end, heading.end + 600).trimStart().replace(/^\s*(?:<\/?(?:p|div|section)\b[^>]*>\s*)*/i, "");
1104
+ const opening = normal(after.split(/\n\s*\n/)[0] ?? "").slice(0, words.length);
1105
+ if (opening.join(" ") === words.join(" ")) {
1106
+ hits.push({ path: file.path, offset: heading.offset, message: `the heading "${heading.text}" is repeated as the first words under it` });
1107
+ }
1108
+ }
1109
+ }
1110
+ return hits;
1111
+ }
1112
+ var FILLER_WORDS = "boiler van kitchen garden studio market street window roof tile paint brush ladder hedge lawn fence gate shop counter oven bread flour kettle chair table shelf lamp cable socket switch meter valve pipe tap sink drain gutter brick mortar timber plank screw bolt hinge lock key door frame glass mirror towel basin morning evening winter summer spring autumn monday tuesday friday weekend hour minute week month year fitted checked cleaned painted mended booked quoted delivered collected measured sanded sealed wired local quiet small large early late busy bright warm dry".split(" ");
1113
+ function filler(words, seed = 1, options = {}) {
1114
+ const { contractions = true, uniform } = options;
1115
+ const shape = [5, 17, 9, 24, 6, 13, 31, 8, 11, 4, 20, 15];
1116
+ let state = seed;
1117
+ const next = (n) => {
1118
+ state = (state * 1103515245 + 12345) % 2147483648;
1119
+ return state % n;
1120
+ };
1121
+ const out = [];
1122
+ let count2 = 0;
1123
+ let i = 0;
1124
+ while (count2 < words) {
1125
+ const length = uniform ?? shape[i % shape.length];
1126
+ const s = [];
1127
+ for (let w = 0; w < length; w += 1) s.push(FILLER_WORDS[next(FILLER_WORDS.length)]);
1128
+ if (contractions && i % 6 === 2) s.splice(1, 0, "we're");
1129
+ s[0] = s[0].charAt(0).toUpperCase() + s[0].slice(1);
1130
+ out.push(`${s.join(" ")}.`);
1131
+ count2 += s.length;
1132
+ i += 1;
1133
+ }
1134
+ const paragraphs = [];
1135
+ for (let p = 0; p < out.length; p += 4) paragraphs.push(out.slice(p, p + 4).join(" "));
1136
+ return paragraphs.join("\n\n");
1137
+ }
1138
+ var f2 = (path, text) => ({ path, text });
1139
+ var doc = (extra, seed = 1) => `${filler(520, seed)}
1140
+
1141
+ ${extra}
1142
+ `;
1143
+ var times = (n, sentence) => Array.from({ length: n }, (_, i) => sentence(i)).join(" ");
1144
+ var DENSITY_TELLS = [
1145
+ {
1146
+ id: "phrase-density",
1147
+ name: "Leaned-on phrase",
1148
+ generation: 2,
1149
+ severity: "warn",
1150
+ surface: "copy",
1151
+ why: "'Rather than', 'actually', 'That is...' openers, participle triads: each is ordinary English once, and a document that uses one far above its rate has one move and repeats it.",
1152
+ fix: "Keep the instances that land hardest and vary or cut the rest. Never delete every one: the count is the problem, not the phrase.",
1153
+ detect: rateHits,
1154
+ fixtures: {
1155
+ flag: [
1156
+ f2("content/proposal.md", doc(times(6, (i) => `We fitted boiler ${i} rather than patching it.`))),
1157
+ f2("content/proposal.md", doc(times(6, (i) => `We sealed roof ${i} instead of patching it.`))),
1158
+ f2("content/proposal.md", doc(times(4, (i) => `Room ${i} actually needed a new valve.`))),
1159
+ f2("content/proposal.md", doc(times(5, (i) => `Gate ${i} was properly hung.`))),
1160
+ f2("content/proposal.md", doc(times(3, (i) => `Kitchen ${i} was genuinely tidy.`))),
1161
+ f2("content/proposal.md", doc(times(3, (i) => `Pipe ${i} is the single biggest risk.`))),
1162
+ f2("content/proposal.md", doc(times(6, (i) => `That is why tap ${i} leaks.`))),
1163
+ f2("content/proposal.md", doc(times(6, (i) => `Every tap ${i} gets checked.`))),
1164
+ f2("content/proposal.md", doc(times(5, (i) => `Worth noting: valve ${i} sticks.`))),
1165
+ f2("content/proposal.md", doc(times(7, (i) => `None of room ${i} needed paint.`))),
1166
+ f2("content/proposal.md", doc(times(5, (i) => `Wall ${i} was measured, sanded and sealed.`))),
1167
+ f2("site/index.html", `<html><body><p>${filler(520, 3)}</p><p>${times(6, (i) => `We fitted boiler ${i} rather than patching it.`)}</p></body></html>`)
1168
+ ],
1169
+ pass: [
1170
+ f2("content/proposal.md", doc(times(3, (i) => `We fitted boiler ${i} rather than patching it.`))),
1171
+ f2("content/short.md", times(6, (i) => `We fitted boiler ${i} rather than patching it.`)),
1172
+ f2("app/page.tsx", `export const copy = [${Array.from({ length: 40 }, (_, i) => `"We fitted boiler ${i} rather than patching it."`).join(", ")}];`)
1173
+ ]
1174
+ }
1175
+ },
1176
+ {
1177
+ id: "aphorism-density",
1178
+ name: "Aphorism cadence",
1179
+ generation: 2,
1180
+ severity: "warn",
1181
+ surface: "copy",
1182
+ why: "Two clipped sentences alone on a line ('All of this already exists. The job is making it findable.') land once. Closing every section, they are a cadence a reader learns to hear.",
1183
+ fix: "Keep the strongest one. Fold the rest into the paragraph above as plain statements.",
1184
+ detect: aphorismHits,
1185
+ fixtures: {
1186
+ flag: [f2("content/proposal.md", doc(Array.from({ length: 7 }, (_, i) => `The site exists. Job ${i} makes it findable.`).join("\n\n")))],
1187
+ pass: [f2("content/proposal.md", doc(Array.from({ length: 3 }, (_, i) => `The site exists. Job ${i} makes it findable.`).join("\n\n")))]
1188
+ }
1189
+ },
1190
+ {
1191
+ id: "contraction-scarcity",
1192
+ name: "No contractions",
1193
+ generation: 1,
1194
+ severity: "warn",
1195
+ surface: "copy",
1196
+ why: "A long document with almost no contractions reads stiff and machine-made. People write 'we're' and 'don't'.",
1197
+ fix: "Contract where you would in speech: 'we are' to 'we're', 'do not' to 'don't'. Formal legal pages are the deliberate exception.",
1198
+ detect: contractionHits,
1199
+ fixtures: {
1200
+ flag: [f2("content/proposal.md", filler(900, 5, { contractions: false }))],
1201
+ pass: [f2("content/proposal.md", filler(900, 5)), f2("content/short.md", filler(500, 5, { contractions: false }))]
1202
+ }
1203
+ },
1204
+ {
1205
+ id: "sentence-rhythm",
1206
+ name: "Metronomic rhythm",
1207
+ generation: 2,
1208
+ severity: "warn",
1209
+ surface: "copy",
1210
+ why: "Sentence after sentence of the same length reads generated. A person's sentences run long, then short, then long again.",
1211
+ fix: "Break one long sentence in two, join two short ones, and let some sentences be flat and plain.",
1212
+ detect: rhythmHits,
1213
+ fixtures: {
1214
+ flag: [f2("content/proposal.md", filler(600, 7, { uniform: 12 }))],
1215
+ pass: [f2("content/proposal.md", filler(600, 7))]
1216
+ }
1217
+ },
1218
+ {
1219
+ id: "repeated-sentence",
1220
+ name: "Repeated sentence",
1221
+ generation: 1,
1222
+ severity: "warn",
1223
+ surface: "copy",
1224
+ why: "The same sentence on two pages, or the same nine words lightly edited, is one of the strongest signs a document was assembled rather than written.",
1225
+ fix: "Say it once, where it matters most, and write the second place fresh.",
1226
+ detect: repeatHits,
1227
+ fixtures: {
1228
+ flag: [
1229
+ f2("content/proposal.md", doc("We check every valve before the engineer leaves the house.\n\nMore here.\n\nWe check every valve before the engineer leaves the house.")),
1230
+ f2("content/proposal.md", doc("We check every valve before the engineer leaves the house.\n\nBy then we check every valve before the engineer leaves the site."))
1231
+ ],
1232
+ pass: [f2("content/proposal.md", doc("We check every valve before the engineer leaves the house.\n\nThe engineer leaves once the customer has signed the sheet."))]
1233
+ }
1234
+ },
1235
+ {
1236
+ id: "heading-shape",
1237
+ name: "One heading shape",
1238
+ generation: 2,
1239
+ severity: "warn",
1240
+ surface: "copy",
1241
+ why: "Headings that all share one shape ('X, and Y', 'X, because Y', 'Keep, rewrite, consolidate, retire') read as a template filled in section by section.",
1242
+ fix: "Write each heading for its section. Most should be a plain noun phrase.",
1243
+ detect: headingShapeHits,
1244
+ fixtures: {
1245
+ flag: [
1246
+ f2("content/proposal.md", ["## Fast, and fairly priced", "## Local, and insured", "## Tidy, and quiet", "## Early, and on time", "", filler(520, 9)].join("\n\n")),
1247
+ f2("site/index.html", `<h2>Fast, because we care</h2><h2>Tidy, because it matters</h2><h2>Early, because you asked</h2><h2>Quiet, because neighbours</h2><p>${filler(520, 9)}</p>`),
1248
+ f2("content/proposal.md", ["## Keep, rewrite, retire", "## Fix, paint, seal", "## Book, quote, fit", "## Plan, build, check", "", filler(520, 9)].join("\n\n"))
1249
+ ],
1250
+ pass: [f2("content/proposal.md", ["## Pricing", "## Fast, and fairly priced", "## Who we are", "## Areas we cover", "", filler(520, 9)].join("\n\n"))]
1251
+ }
1252
+ },
1253
+ {
1254
+ id: "heading-echo",
1255
+ name: "Heading echoed",
1256
+ generation: 2,
1257
+ severity: "warn",
1258
+ surface: "copy",
1259
+ why: "A heading repeated word for word as the first line under it spends the reader's attention twice on the same words.",
1260
+ fix: "Let the first sentence say something the heading did not.",
1261
+ detect: headingEchoHits,
1262
+ fixtures: {
1263
+ flag: [
1264
+ f2("content/proposal.md", `## We fix boilers the same day
1265
+
1266
+ We fix boilers the same day across Brackley.
1267
+
1268
+ ${filler(520, 11)}`),
1269
+ f2("site/index.html", `<h2>We fix boilers the same day</h2>
1270
+ <p>We fix boilers the same day across Brackley.</p><p>${filler(520, 11)}</p>`)
1271
+ ],
1272
+ pass: [f2("content/proposal.md", `## We fix boilers the same day
1273
+
1274
+ Call before noon and an engineer is with you by six.
1275
+
1276
+ ${filler(520, 11)}`)]
1277
+ }
1278
+ }
1279
+ ];
554
1280
 
555
1281
  // src/color/oklch.ts
556
1282
  var clamp01 = (n) => n < 0 ? 0 : n > 1 ? 1 : n;
@@ -614,8 +1340,8 @@ function parts(fn) {
614
1340
  function hslToRgb(h, s, l) {
615
1341
  const k = (n) => (n + h / 30) % 12;
616
1342
  const a = s * Math.min(l, 1 - l);
617
- const f3 = (n) => l - a * Math.max(-1, Math.min(k(n) - 3, Math.min(9 - k(n), 1)));
618
- return { r: f3(0), g: f3(8), b: f3(4) };
1343
+ const f4 = (n) => l - a * Math.max(-1, Math.min(k(n) - 3, Math.min(9 - k(n), 1)));
1344
+ return { r: f4(0), g: f4(8), b: f4(4) };
619
1345
  }
620
1346
  var clamp012 = (n) => Math.min(1, Math.max(0, n));
621
1347
  function parseColour(raw) {
@@ -727,7 +1453,7 @@ function firstMatch(text, pattern) {
727
1453
  return m ? m.index : -1;
728
1454
  }
729
1455
  var FRAMEWORK_PALETTE = /^--(?:color-)?(?:slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-\d+$|^--tw-/;
730
- var f2 = (path, text) => ({ path, text });
1456
+ var f3 = (path, text) => ({ path, text });
731
1457
  function familyNames(value) {
732
1458
  return value.split(",").map((v) => v.trim().replace(/^["']|["']$/g, "").trim()).filter(Boolean);
733
1459
  }
@@ -1192,14 +1918,14 @@ var SOURCE_TELLS = [
1192
1918
  detect: fontTell(REFLEX_FONTS_1),
1193
1919
  fixtures: {
1194
1920
  flag: [
1195
- f2("app/layout.tsx", `import { Inter } from "next/font/google";
1921
+ f3("app/layout.tsx", `import { Inter } from "next/font/google";
1196
1922
  const inter = Inter({ subsets: ["latin"] });`),
1197
- f2("index.html", `<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600" rel="stylesheet">`),
1198
- f2("tailwind.config.js", `fontFamily: { sans: ["Roboto", "sans-serif"] }`),
1199
- f2("main.ts", `import "@fontsource/montserrat";`),
1200
- f2("components/A.tsx", `<p className="font-['Open_Sans']">x</p>`)
1923
+ f3("index.html", `<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600" rel="stylesheet">`),
1924
+ f3("tailwind.config.js", `fontFamily: { sans: ["Roboto", "sans-serif"] }`),
1925
+ f3("main.ts", `import "@fontsource/montserrat";`),
1926
+ f3("components/A.tsx", `<p className="font-['Open_Sans']">x</p>`)
1201
1927
  ],
1202
- pass: [f2("app/layout.tsx", `import { Bricolage_Grotesque } from "next/font/google";`)]
1928
+ pass: [f3("app/layout.tsx", `import { Bricolage_Grotesque } from "next/font/google";`)]
1203
1929
  }
1204
1930
  },
1205
1931
  {
@@ -1212,10 +1938,10 @@ const inter = Inter({ subsets: ["latin"] });`),
1212
1938
  fix: "Pick the display face from the client's world (signage, packaging, the trade's lettering) and record why in art-direction.json. If this face really is the right one, declare an exception with the reason and the evidence.",
1213
1939
  detect: fontTell(REFLEX_FONTS_2),
1214
1940
  fixtures: {
1215
- flag: [f2("src/styles.css", `@theme {
1941
+ flag: [f3("src/styles.css", `@theme {
1216
1942
  --font-sans: "DM Sans", system-ui, sans-serif;
1217
1943
  }`)],
1218
- pass: [f2("src/styles.css", `@theme {
1944
+ pass: [f3("src/styles.css", `@theme {
1219
1945
  --font-sans: "Hanken Grotesk", system-ui, sans-serif;
1220
1946
  }`)]
1221
1947
  }
@@ -1231,10 +1957,10 @@ const inter = Inter({ subsets: ["latin"] });`),
1231
1957
  detect: violetHits,
1232
1958
  fixtures: {
1233
1959
  flag: [
1234
- f2("components/Hero.tsx", `<a className="rounded-md bg-indigo-600 px-4 py-2 text-white">Book</a>`),
1235
- f2("app/globals.css", `:root { --accent: #5a35d1; }`)
1960
+ f3("components/Hero.tsx", `<a className="rounded-md bg-indigo-600 px-4 py-2 text-white">Book</a>`),
1961
+ f3("app/globals.css", `:root { --accent: #5a35d1; }`)
1236
1962
  ],
1237
- pass: [f2("components/Hero.tsx", `<a className="rounded-md bg-emerald-700 px-4 py-2 text-white">Book</a>`)]
1963
+ pass: [f3("components/Hero.tsx", `<a className="rounded-md bg-emerald-700 px-4 py-2 text-white">Book</a>`)]
1238
1964
  }
1239
1965
  },
1240
1966
  {
@@ -1248,10 +1974,10 @@ const inter = Inter({ subsets: ["latin"] });`),
1248
1974
  detect: gradientHits,
1249
1975
  fixtures: {
1250
1976
  flag: [
1251
- f2("components/Hero.tsx", `<section className="bg-gradient-to-r from-blue-600 to-purple-600">`),
1252
- f2("app/globals.css", `.hero { background: linear-gradient(135deg, #2563eb, #9333ea); }`)
1977
+ f3("components/Hero.tsx", `<section className="bg-gradient-to-r from-blue-600 to-purple-600">`),
1978
+ f3("app/globals.css", `.hero { background: linear-gradient(135deg, #2563eb, #9333ea); }`)
1253
1979
  ],
1254
- pass: [f2("components/Hero.tsx", `<section className="bg-gradient-to-b from-stone-100 to-stone-200">`)]
1980
+ pass: [f3("components/Hero.tsx", `<section className="bg-gradient-to-b from-stone-100 to-stone-200">`)]
1255
1981
  }
1256
1982
  },
1257
1983
  {
@@ -1265,10 +1991,10 @@ const inter = Inter({ subsets: ["latin"] });`),
1265
1991
  detect: gradientTextHits,
1266
1992
  fixtures: {
1267
1993
  flag: [
1268
- f2("components/Hero.tsx", `<h1 className="bg-gradient-to-r from-rose-500 to-amber-500 bg-clip-text text-transparent">`),
1269
- f2("app/globals.css", `.headline { -webkit-background-clip: text; color: transparent; }`)
1994
+ f3("components/Hero.tsx", `<h1 className="bg-gradient-to-r from-rose-500 to-amber-500 bg-clip-text text-transparent">`),
1995
+ f3("app/globals.css", `.headline { -webkit-background-clip: text; color: transparent; }`)
1270
1996
  ],
1271
- pass: [f2("components/Hero.tsx", `<h1 className="font-display text-5xl text-ink">`)]
1997
+ pass: [f3("components/Hero.tsx", `<h1 className="font-display text-5xl text-ink">`)]
1272
1998
  }
1273
1999
  },
1274
2000
  {
@@ -1282,10 +2008,10 @@ const inter = Inter({ subsets: ["latin"] });`),
1282
2008
  detect: glassHits,
1283
2009
  fixtures: {
1284
2010
  flag: [
1285
- f2("components/Hero.tsx", `<div className="rounded-2xl bg-white/10 p-8 backdrop-blur-md">`),
1286
- f2("app/globals.css", `.card { background: rgb(255 255 255 / .1); backdrop-filter: blur(12px); }`)
2011
+ f3("components/Hero.tsx", `<div className="rounded-2xl bg-white/10 p-8 backdrop-blur-md">`),
2012
+ f3("app/globals.css", `.card { background: rgb(255 255 255 / .1); backdrop-filter: blur(12px); }`)
1287
2013
  ],
1288
- pass: [f2("components/Hero.tsx", `<div className="rounded-sm bg-paper p-8">`)]
2014
+ pass: [f3("components/Hero.tsx", `<div className="rounded-sm bg-paper p-8">`)]
1289
2015
  }
1290
2016
  },
1291
2017
  {
@@ -1298,10 +2024,10 @@ const inter = Inter({ subsets: ["latin"] });`),
1298
2024
  fix: "Follow the hero with the thing only this business has: the work, the place, the person. Put proof where a doubt arises.",
1299
2025
  detect: heroThenProofHits,
1300
2026
  fixtures: {
1301
- flag: [f2("app/page.tsx", `export default function Page() {
2027
+ flag: [f3("app/page.tsx", `export default function Page() {
1302
2028
  return (<main><Hero /><TrustStrip /><Services /></main>);
1303
2029
  }`)],
1304
- pass: [f2("app/page.tsx", `export default function Page() {
2030
+ pass: [f3("app/page.tsx", `export default function Page() {
1305
2031
  return (<main><Hero /><Workshop /><TrustStrip /></main>);
1306
2032
  }`)]
1307
2033
  }
@@ -1317,7 +2043,7 @@ const inter = Inter({ subsets: ["latin"] });`),
1317
2043
  detect: iconGridHits,
1318
2044
  fixtures: {
1319
2045
  flag: [
1320
- f2(
2046
+ f3(
1321
2047
  "components/Features.tsx",
1322
2048
  `import { Heart } from "lucide-react";
1323
2049
  <div className="grid grid-cols-1 gap-6 md:grid-cols-3">
@@ -1325,7 +2051,7 @@ const inter = Inter({ subsets: ["latin"] });`),
1325
2051
  </div>`
1326
2052
  )
1327
2053
  ],
1328
- pass: [f2("components/Features.tsx", `<ul className="divide-y">
2054
+ pass: [f3("components/Features.tsx", `<ul className="divide-y">
1329
2055
  <li className="flex justify-between py-3">Gel manicure <span>\xA332</span></li>
1330
2056
  </ul>`)]
1331
2057
  }
@@ -1340,8 +2066,8 @@ const inter = Inter({ subsets: ["latin"] });`),
1340
2066
  fix: `Keep one gated signature moment per page (STANDARD section 7) and let the rest arrive still. The limit here is ${REVEAL_LIMIT} per scan.`,
1341
2067
  detect: revealHits,
1342
2068
  fixtures: {
1343
- flag: [f2("app/page.tsx", Array.from({ length: REVEAL_LIMIT + 1 }, (_, i) => `<Reveal><Block n={${i}} /></Reveal>`).join("\n"))],
1344
- pass: [f2("app/page.tsx", `<Reveal><Signature /></Reveal>
2069
+ flag: [f3("app/page.tsx", Array.from({ length: REVEAL_LIMIT + 1 }, (_, i) => `<Reveal><Block n={${i}} /></Reveal>`).join("\n"))],
2070
+ pass: [f3("app/page.tsx", `<Reveal><Signature /></Reveal>
1345
2071
  <Block />
1346
2072
  <Block />`)]
1347
2073
  }
@@ -1356,8 +2082,8 @@ const inter = Inter({ subsets: ["latin"] });`),
1356
2082
  fix: `Choose the shape language on purpose (and record it), then use the pill only where it means something. The limit here is ${PILL_LIMIT} per scan.`,
1357
2083
  detect: pillHits,
1358
2084
  fixtures: {
1359
- flag: [f2("components/Tags.tsx", Array.from({ length: PILL_LIMIT + 1 }, () => `<span className="rounded-full px-3">tag</span>`).join("\n"))],
1360
- pass: [f2("components/Tags.tsx", `<span className="rounded-full px-3">tag</span>
2085
+ flag: [f3("components/Tags.tsx", Array.from({ length: PILL_LIMIT + 1 }, () => `<span className="rounded-full px-3">tag</span>`).join("\n"))],
2086
+ pass: [f3("components/Tags.tsx", `<span className="rounded-full px-3">tag</span>
1361
2087
  <a className="rounded-sm px-4">Book</a>`)]
1362
2088
  }
1363
2089
  },
@@ -1371,8 +2097,8 @@ const inter = Inter({ subsets: ["latin"] });`),
1371
2097
  fix: "Delete the primitives nothing imports. Restyle the ones that stay so they belong to this site.",
1372
2098
  detect: shadcnHits,
1373
2099
  fixtures: {
1374
- flag: [SHADCN_PRIMITIVES.slice(0, SHADCN_LIMIT).map((name) => f2(`src/components/ui/${name}.tsx`, `export function X() { return null; }`))],
1375
- pass: [f2("src/components/ui/button.tsx", `export function Button() { return null; }`)]
2100
+ flag: [SHADCN_PRIMITIVES.slice(0, SHADCN_LIMIT).map((name) => f3(`src/components/ui/${name}.tsx`, `export function X() { return null; }`))],
2101
+ pass: [f3("src/components/ui/button.tsx", `export function Button() { return null; }`)]
1376
2102
  }
1377
2103
  },
1378
2104
  {
@@ -1386,11 +2112,11 @@ const inter = Inter({ subsets: ["latin"] });`),
1386
2112
  detect: creamHits,
1387
2113
  fixtures: {
1388
2114
  flag: [
1389
- f2("app/globals.css", `body { background-color: #f5efe6; }`),
1390
- f2("app/page.tsx", `<main className="bg-cream text-ink">`),
1391
- f2("app/page.tsx", `<main className="bg-[#f7f1e8]">`)
2115
+ f3("app/globals.css", `body { background-color: #f5efe6; }`),
2116
+ f3("app/page.tsx", `<main className="bg-cream text-ink">`),
2117
+ f3("app/page.tsx", `<main className="bg-[#f7f1e8]">`)
1392
2118
  ],
1393
- pass: [f2("app/globals.css", `body { background-color: #ffffff; }`)]
2119
+ pass: [f3("app/globals.css", `body { background-color: #ffffff; }`)]
1394
2120
  }
1395
2121
  },
1396
2122
  {
@@ -1404,11 +2130,11 @@ const inter = Inter({ subsets: ["latin"] });`),
1404
2130
  detect: italicSerifHits,
1405
2131
  fixtures: {
1406
2132
  flag: [
1407
- f2("components/Hero.tsx", `<h1 className="font-display text-6xl">Nails, <em>reimagined</em></h1>`),
1408
- f2("components/Hero.tsx", `<span className="font-serif italic">reimagined</span>`),
1409
- f2("app/globals.css", `.hero h1 { font-style: italic; }`)
2133
+ f3("components/Hero.tsx", `<h1 className="font-display text-6xl">Nails, <em>reimagined</em></h1>`),
2134
+ f3("components/Hero.tsx", `<span className="font-serif italic">reimagined</span>`),
2135
+ f3("app/globals.css", `.hero h1 { font-style: italic; }`)
1410
2136
  ],
1411
- pass: [f2("components/Hero.tsx", `<h1 className="font-display text-6xl">Nails in Brackley</h1>
2137
+ pass: [f3("components/Hero.tsx", `<h1 className="font-display text-6xl">Nails in Brackley</h1>
1412
2138
  <p><em>Walk-ins</em> welcome.</p>`)]
1413
2139
  }
1414
2140
  },
@@ -1423,12 +2149,12 @@ const inter = Inter({ subsets: ["latin"] });`),
1423
2149
  detect: eyebrowChipHits,
1424
2150
  fixtures: {
1425
2151
  flag: [
1426
- f2("components/Hero.tsx", `<span className="inline-flex rounded-full border px-3 py-1 text-xs">Now booking</span>
2152
+ f3("components/Hero.tsx", `<span className="inline-flex rounded-full border px-3 py-1 text-xs">Now booking</span>
1427
2153
  <h1>Nails in Brackley</h1>`),
1428
- f2("components/Hero.tsx", `<span className={cn("rounded-full px-3 text-xs", "bg-rose-500/10")}>New</span>
2154
+ f3("components/Hero.tsx", `<span className={cn("rounded-full px-3 text-xs", "bg-rose-500/10")}>New</span>
1429
2155
  <h1>Nails</h1>`)
1430
2156
  ],
1431
- pass: [f2("components/Hero.tsx", `<h1>Nails in Brackley</h1>
2157
+ pass: [f3("components/Hero.tsx", `<h1>Nails in Brackley</h1>
1432
2158
  <span className="inline-flex rounded-full border px-3 py-1 text-xs">Tag</span>`)]
1433
2159
  }
1434
2160
  },
@@ -1442,9 +2168,9 @@ const inter = Inter({ subsets: ["latin"] });`),
1442
2168
  fix: "Use the client's own marks, photography or numerals. If an icon earns its place, set it inline with the text.",
1443
2169
  detect: iconTileStackHits,
1444
2170
  fixtures: {
1445
- flag: [f2("components/Card.tsx", `import { Sparkles } from "lucide-react";
2171
+ flag: [f3("components/Card.tsx", `import { Sparkles } from "lucide-react";
1446
2172
  <div className="flex size-10 items-center justify-center rounded-lg bg-violet-100"><Sparkles /></div>`)],
1447
- pass: [f2("components/Card.tsx", `import { Sparkles } from "lucide-react";
2173
+ pass: [f3("components/Card.tsx", `import { Sparkles } from "lucide-react";
1448
2174
  <p className="flex items-center gap-2"><Sparkles className="size-4" />Aftercare</p>`)]
1449
2175
  }
1450
2176
  },
@@ -1458,8 +2184,8 @@ const inter = Inter({ subsets: ["latin"] });`),
1458
2184
  fix: "Lay content out by what it is. If one item matters most, give it the page, not a double-width tile.",
1459
2185
  detect: bentoHits,
1460
2186
  fixtures: {
1461
- flag: [f2("components/Features.tsx", `<div className="grid grid-cols-3"><div className="md:col-span-2 md:row-span-2" /><div /></div>`)],
1462
- pass: [f2("components/Features.tsx", `<div className="grid grid-cols-3"><div className="col-span-2" /><div /></div>`)]
2187
+ flag: [f3("components/Features.tsx", `<div className="grid grid-cols-3"><div className="md:col-span-2 md:row-span-2" /><div /></div>`)],
2188
+ pass: [f3("components/Features.tsx", `<div className="grid grid-cols-3"><div className="col-span-2" /><div /></div>`)]
1463
2189
  }
1464
2190
  },
1465
2191
  {
@@ -1473,10 +2199,10 @@ const inter = Inter({ subsets: ["latin"] });`),
1473
2199
  detect: glowHits,
1474
2200
  fixtures: {
1475
2201
  flag: [
1476
- f2("components/Hero.tsx", `<div className="absolute -top-20 left-1/2 h-96 w-96 rounded-full bg-rose-400/30 blur-3xl" />`),
1477
- f2("app/globals.css", `.hero { background: radial-gradient(circle at top, rgb(244 63 94 / .25), transparent 60%); }`)
2202
+ f3("components/Hero.tsx", `<div className="absolute -top-20 left-1/2 h-96 w-96 rounded-full bg-rose-400/30 blur-3xl" />`),
2203
+ f3("app/globals.css", `.hero { background: radial-gradient(circle at top, rgb(244 63 94 / .25), transparent 60%); }`)
1478
2204
  ],
1479
- pass: [f2("components/Hero.tsx", `<div className="absolute inset-0 bg-black/40" />`)]
2205
+ pass: [f3("components/Hero.tsx", `<div className="absolute inset-0 bg-black/40" />`)]
1480
2206
  }
1481
2207
  },
1482
2208
  {
@@ -1490,13 +2216,13 @@ const inter = Inter({ subsets: ["latin"] });`),
1490
2216
  detect: gridBackgroundHits,
1491
2217
  fixtures: {
1492
2218
  flag: [
1493
- f2(
2219
+ f3(
1494
2220
  "app/globals.css",
1495
2221
  `.hero { background-image: linear-gradient(to right, #e5e5e5 1px, transparent 1px), linear-gradient(to bottom, #e5e5e5 1px, transparent 1px); background-size: 24px 24px; }`
1496
2222
  ),
1497
- f2("components/Hero.tsx", `<div className="absolute inset-0 bg-[linear-gradient(to_right,#8882_1px,transparent_1px)] bg-[size:24px_24px]" />`)
2223
+ f3("components/Hero.tsx", `<div className="absolute inset-0 bg-[linear-gradient(to_right,#8882_1px,transparent_1px)] bg-[size:24px_24px]" />`)
1498
2224
  ],
1499
- pass: [f2("app/globals.css", `.hero { background-image: url(/shopfront.avif); }`)]
2225
+ pass: [f3("app/globals.css", `.hero { background-image: url(/shopfront.avif); }`)]
1500
2226
  }
1501
2227
  },
1502
2228
  {
@@ -1510,10 +2236,10 @@ const inter = Inter({ subsets: ["latin"] });`),
1510
2236
  detect: marqueeHits,
1511
2237
  fixtures: {
1512
2238
  flag: [
1513
- f2("app/globals.css", `@keyframes marquee { from { transform: translateX(0) } to { transform: translateX(-50%) } }`),
1514
- f2("components/Logos.tsx", `import Marquee from "react-fast-marquee";`)
2239
+ f3("app/globals.css", `@keyframes marquee { from { transform: translateX(0) } to { transform: translateX(-50%) } }`),
2240
+ f3("components/Logos.tsx", `import Marquee from "react-fast-marquee";`)
1515
2241
  ],
1516
- pass: [f2("app/globals.css", `@keyframes fade { from { opacity: 0 } to { opacity: 1 } }`)]
2242
+ pass: [f3("app/globals.css", `@keyframes fade { from { opacity: 0 } to { opacity: 1 } }`)]
1517
2243
  }
1518
2244
  },
1519
2245
  {
@@ -1527,10 +2253,10 @@ const inter = Inter({ subsets: ["latin"] });`),
1527
2253
  detect: thinBorderWideShadowHits,
1528
2254
  fixtures: {
1529
2255
  flag: [
1530
- f2("components/Card.tsx", `<div className="rounded-2xl border border-black/5 bg-white shadow-2xl">`),
1531
- f2("app/globals.css", `.card { border: 1px solid rgb(0 0 0 / .06); box-shadow: 0 20px 48px rgb(0 0 0 / .08); }`)
2256
+ f3("components/Card.tsx", `<div className="rounded-2xl border border-black/5 bg-white shadow-2xl">`),
2257
+ f3("app/globals.css", `.card { border: 1px solid rgb(0 0 0 / .06); box-shadow: 0 20px 48px rgb(0 0 0 / .08); }`)
1532
2258
  ],
1533
- pass: [f2("components/Card.tsx", `<div className="rounded-sm border border-ink bg-white">`)]
2259
+ pass: [f3("components/Card.tsx", `<div className="rounded-sm border border-ink bg-white">`)]
1534
2260
  }
1535
2261
  },
1536
2262
  {
@@ -1544,15 +2270,61 @@ const inter = Inter({ subsets: ["latin"] });`),
1544
2270
  detect: introHits,
1545
2271
  fixtures: {
1546
2272
  flag: [
1547
- f2("components/IntroCinematic.tsx", `const seen = sessionStorage.getItem("intro");
2273
+ f3("components/IntroCinematic.tsx", `const seen = sessionStorage.getItem("intro");
1548
2274
  export function IntroCinematic() { return <AnimatePresence /> }`),
1549
- f2("app/page.tsx", `<><Preloader /><Hero /></>`)
2275
+ f3("app/page.tsx", `<><Preloader /><Hero /></>`)
1550
2276
  ],
1551
- pass: [f2("components/Introduction.md", `An introduction to the studio.`)]
2277
+ pass: [f3("components/Introduction.md", `An introduction to the studio.`)]
1552
2278
  }
1553
2279
  }
1554
2280
  ];
1555
2281
 
2282
+ // src/character/house.ts
2283
+ var HOUSE = {
2284
+ "em-dash": { tier: "block", label: "em dash, use a full stop or a comma" },
2285
+ emoji: { tier: "block", label: "emoji" },
2286
+ "not-just-but": { tier: "block", label: "contrastive negation. The template is the tell, not the sentiment. Say the positive claim" },
2287
+ "no-x-no-y": {
2288
+ tier: "block",
2289
+ label: '"No X, no Y" list. Defining the brand by what it is not, itemised, is the same template as contrastive negation'
2290
+ },
2291
+ "no-x-badge": { tier: "block", label: 'standalone "No X" badge. Reads as a slapped-on kicker, and worse when reused across pieces' },
2292
+ "ai-phrase": { tier: "block", label: "AI tell" },
2293
+ "plainer-word": { tier: "block", label: "a plainer word exists. Name the mechanism instead" },
2294
+ "plain-english": { tier: "block", label: 'use "properly explained"' },
2295
+ buzzword: { tier: "block", label: "forbidden phrase" },
2296
+ "negative-reassurance": { tier: "block", label: "negative reassurance, say what they get" },
2297
+ "review-phrase": { tier: "review", label: "review tier" },
2298
+ "ai-vocabulary": { tier: "review", label: "AI vocabulary" },
2299
+ "stock-phrase": { tier: "review", label: "stock phrase" },
2300
+ "hollow-imperative": { tier: "review", label: "hollow imperative" },
2301
+ "rhetorical-opener": { tier: "review", label: "rhetorical question opener" },
2302
+ "staccato-triplet": { tier: "review", label: "staccato triplet" },
2303
+ "where-x-meets-y": { tier: "review", label: "'where X meets Y'" },
2304
+ "ing-tail": { tier: "review", label: "empty -ing tail" },
2305
+ "vague-attribution": { tier: "review", label: "unnamed source" },
2306
+ "closing-summary": { tier: "review", label: "closing summary" },
2307
+ "false-range": { tier: "review", label: "false range" },
2308
+ // The first candidate for block: evidence of a pasted chat reply, not a
2309
+ // matter of style. Blocks once its estate hits have been read (ROADMAP.md).
2310
+ "chatbot-residue": { tier: "review", label: "chatbot residue" },
2311
+ "placeholder": { tier: "review", label: "unfilled placeholder" },
2312
+ "question-reveal": { tier: "review", label: "staged reveal" },
2313
+ "inline-label-list": { tier: "review", label: "bold-label bullets" },
2314
+ "phrase-density": { tier: "review", label: "density" },
2315
+ "aphorism-density": { tier: "review", label: "density" },
2316
+ "contraction-scarcity": { tier: "review", label: "density" },
2317
+ "sentence-rhythm": { tier: "review", label: "density" },
2318
+ "repeated-sentence": { tier: "review", label: "repetition" },
2319
+ "heading-shape": { tier: "review", label: "headings" },
2320
+ "heading-echo": { tier: "review", label: "headings" },
2321
+ // Banned only "when vague", per the rules. Too noisy for a sweep.
2322
+ "vague-word": { tier: "explicit", label: "vague" }
2323
+ };
2324
+ function houseRule(id, name = id) {
2325
+ return HOUSE[id] ?? { tier: "review", label: name };
2326
+ }
2327
+
1556
2328
  // src/character/parse.ts
1557
2329
  function lineAt(text, offset) {
1558
2330
  let line = 1;
@@ -1701,8 +2473,8 @@ var oklchOf = (value) => parseColour(value)?.oklch ?? null;
1701
2473
  function reflexFonts(list) {
1702
2474
  const wanted = new Map(list.map((n) => [n.toLowerCase(), n]));
1703
2475
  return (s) => {
1704
- const total = s.fonts.reduce((n, f3) => n + f3.chars, 0) || 1;
1705
- const display = s.fonts.reduce((n, f3) => n + f3.displayChars, 0) || 1;
2476
+ const total = s.fonts.reduce((n, f4) => n + f4.chars, 0) || 1;
2477
+ const display = s.fonts.reduce((n, f4) => n + f4.displayChars, 0) || 1;
1706
2478
  const hits = [];
1707
2479
  const seen = /* @__PURE__ */ new Set();
1708
2480
  const h1 = s.headings.find((h) => h.level === 1);
@@ -1903,8 +2675,8 @@ var RENDERED_PATHS = {
1903
2675
  };
1904
2676
 
1905
2677
  // src/character/check.ts
1906
- var CATALOGUE_VERSION = "2026.09.3";
1907
- var CATALOGUE = [...SOURCE_TELLS, ...COPY_TELLS].map(
2678
+ var CATALOGUE_VERSION = "2026.09.7";
2679
+ var CATALOGUE = [...SOURCE_TELLS, ...COPY_TELLS, ...RESEARCH_TELLS, ...DENSITY_TELLS].map(
1908
2680
  (t) => RENDERED_PATHS[t.id] ? { ...t, rendered: RENDERED_PATHS[t.id] } : t
1909
2681
  );
1910
2682
  function tellById(id) {
@@ -1939,7 +2711,8 @@ function toFinding(tell, hit2, texts) {
1939
2711
  line: texts.has(hit2.path) ? lineAt(text, hit2.offset) : 0,
1940
2712
  excerpt: hit2.excerpt ?? excerptAt(text, hit2.offset),
1941
2713
  message: hit2.message,
1942
- fix: tell.fix
2714
+ fix: tell.fix,
2715
+ ...tell.surface === "copy" ? { house: houseRule(tell.id, tell.name).tier } : {}
1943
2716
  };
1944
2717
  }
1945
2718
  function report(tells, files, run, options) {
@@ -2118,14 +2891,14 @@ function collectInPage() {
2118
2891
  t.chars += chars;
2119
2892
  text.set(cs.color, t);
2120
2893
  const family = firstFamily(cs.fontFamily);
2121
- const f3 = fonts.get(family) ?? { chars: 0, displayChars: 0, italicChars: 0, weights: /* @__PURE__ */ new Set() };
2894
+ const f4 = fonts.get(family) ?? { chars: 0, displayChars: 0, italicChars: 0, weights: /* @__PURE__ */ new Set() };
2122
2895
  const size = px(cs.fontSize);
2123
2896
  const weight = parseInt(cs.fontWeight, 10) || 400;
2124
- f3.chars += chars;
2125
- if (/^H[1-3]$/.test(el.tagName) || size >= 28) f3.displayChars += chars;
2126
- if (cs.fontStyle === "italic" || cs.fontStyle.startsWith("oblique")) f3.italicChars += chars;
2127
- f3.weights.add(weight);
2128
- fonts.set(family, f3);
2897
+ f4.chars += chars;
2898
+ if (/^H[1-3]$/.test(el.tagName) || size >= 28) f4.displayChars += chars;
2899
+ if (cs.fontStyle === "italic" || cs.fontStyle.startsWith("oblique")) f4.italicChars += chars;
2900
+ f4.weights.add(weight);
2901
+ fonts.set(family, f4);
2129
2902
  sizes.add(Math.round(size));
2130
2903
  weights.add(weight);
2131
2904
  }
@@ -2141,7 +2914,7 @@ function collectInPage() {
2141
2914
  const htmlBg = getComputedStyle(document.documentElement).backgroundColor;
2142
2915
  const bodyBg = getComputedStyle(document.body).backgroundColor;
2143
2916
  const ground = painted(bodyBg) ? bodyBg : painted(htmlBg) ? htmlBg : "rgb(255, 255, 255)";
2144
- const headings = Array.from(document.querySelectorAll("h1, h2, h3")).filter(shown).slice(0, 60).map((h) => {
2917
+ const headings2 = Array.from(document.querySelectorAll("h1, h2, h3")).filter(shown).slice(0, 60).map((h) => {
2145
2918
  const cs = style(h);
2146
2919
  const italic = cs.fontStyle !== "normal";
2147
2920
  const italicPart = !italic && Array.from(h.querySelectorAll("*")).some((c) => style(c).fontStyle !== "normal" && (c.textContent ?? "").trim().length > 0);
@@ -2357,8 +3130,8 @@ function collectInPage() {
2357
3130
  pageHeight: document.documentElement.scrollHeight,
2358
3131
  ground,
2359
3132
  colours: { backgrounds: toList(bg).slice(0, 60), text: toList(text).sort((a, b) => b.chars - a.chars).slice(0, 40) },
2360
- fonts: Array.from(fonts, ([family, f3]) => ({ family, chars: f3.chars, displayChars: f3.displayChars, italicChars: f3.italicChars, weights: nums(f3.weights) })).sort((a, b) => b.chars - a.chars),
2361
- headings,
3133
+ fonts: Array.from(fonts, ([family, f4]) => ({ family, chars: f4.chars, displayChars: f4.displayChars, italicChars: f4.italicChars, weights: nums(f4.weights) })).sort((a, b) => b.chars - a.chars),
3134
+ headings: headings2,
2362
3135
  controls,
2363
3136
  sections,
2364
3137
  effects,