@domandigital/craft 0.12.0 → 0.13.0

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/index.d.cts CHANGED
@@ -788,6 +788,50 @@ interface SnapshotSection {
788
788
  role?: SectionRole;
789
789
  /** Version 2. */
790
790
  geometry?: SectionGeometry;
791
+ /** Version 2: short pill or label texts in the section ("Most popular", "New"), at most 5. */
792
+ badges?: string[];
793
+ /** Version 2: small round portraits (at most 96px, roughly square, radius 40% or more). */
794
+ avatars?: number;
795
+ /** Version 2: a horizontal scroller, snap track or prev/next control holds the content. */
796
+ carousel?: boolean;
797
+ /** Version 2: large standalone figures ("500+", "98%", "4.9/5") at 24px or more. */
798
+ figures?: number;
799
+ }
800
+ type ImageRole = "photo" | "illustration" | "icon" | "avatar" | "logo";
801
+ /**
802
+ * What the image's own bytes say about where it came from. Only a positive
803
+ * is evidence: most images carry no metadata at all, and a re-encode strips
804
+ * it, so no marker proves nothing.
805
+ */
806
+ interface ImageProvenance {
807
+ /** The IPTC digital source type found, if any: "trainedAlgorithmicMedia" or "compositeWithTrainedAlgorithmicMedia". */
808
+ digitalSourceType: string | null;
809
+ /** Where the marker sat: an XMP packet, a C2PA manifest, or somewhere else in the file. */
810
+ source: "xmp" | "c2pa" | "other" | null;
811
+ /** The file carries a C2PA manifest (Content Credentials), whatever it says. */
812
+ c2pa: boolean;
813
+ /** Bytes read, from the start of the file. */
814
+ bytes: number;
815
+ }
816
+ /** One image as the visitor sees it: an `img`, or a CSS background large enough to be a picture. */
817
+ interface SnapshotImage {
818
+ /** The URL the browser loaded, unwrapped from an image optimiser (`/_next/image?url=`), or a `data:` URI cut to 64 characters. */
819
+ src: string;
820
+ /** Host of `src`, or null for a `data:` URI. */
821
+ host: string | null;
822
+ width: number;
823
+ height: number;
824
+ top: number;
825
+ role: ImageRole;
826
+ alt: string | null;
827
+ /** Empty alt, `aria-hidden` or `role="presentation"`. */
828
+ decorative: boolean;
829
+ /** Index into `sections`, or null when the image sits outside them. */
830
+ section: number | null;
831
+ /** A CSS `background-image`, not an `img`. */
832
+ background: boolean;
833
+ /** Present when the bytes were read. */
834
+ provenance?: ImageProvenance;
791
835
  }
792
836
  /**
793
837
  * Measures of the rendered pixels, from a full-page screenshot (capped at
@@ -862,6 +906,11 @@ interface Snapshot {
862
906
  rhythmVariance?: number | null;
863
907
  /** Version 2: absent when the page could not be screenshotted. */
864
908
  visual?: SnapshotVisual;
909
+ /**
910
+ * Version 2, craft 0.14 and later: every image on the page, largest first, at
911
+ * most 60. Absent in older snapshots, which the imagery tells never judge.
912
+ */
913
+ images?: SnapshotImage[];
865
914
  /** Set when a version 1 snapshot was read and upgraded in memory. */
866
915
  migratedFrom?: 1;
867
916
  /** The design-system measures trawl has collected since v7, kept so it can switch to this. */
@@ -899,7 +948,13 @@ interface Snapshot {
899
948
  */
900
949
  type Generation = 1 | 2 | 3;
901
950
  /** Where a tell is detected first. A source tell may also carry a rendered path. */
902
- type Surface = "source" | "copy";
951
+ /**
952
+ * Where a tell is detected first. `rendered` tells exist only on a rendered
953
+ * page (a pricing trio, a centred CTA band): source code cannot show them
954
+ * reliably, so they have no source detector and no source fixtures, only a
955
+ * rendered path with its own flag and pass snapshots.
956
+ */
957
+ type Surface = "source" | "copy" | "rendered";
903
958
  /**
904
959
  * `warn` is reported and never fails a run unless `--strict` is passed.
905
960
  * `block` fails a run.
@@ -1019,7 +1074,12 @@ interface CopyTell extends TellBase {
1019
1074
  surface: "copy";
1020
1075
  detect(ctx: CopyContext): Hit[];
1021
1076
  }
1022
- type Tell = SourceTell | CopyTell;
1077
+ /** A tell with a rendered path only. See `Surface`. */
1078
+ interface RenderedTell extends Omit<TellBase, "fixtures" | "rendered"> {
1079
+ surface: "rendered";
1080
+ rendered: RenderedPath;
1081
+ }
1082
+ type Tell = SourceTell | CopyTell | RenderedTell;
1023
1083
  /**
1024
1084
  * A declared reason to keep a tell. Lives in the site's `art-direction.json`.
1025
1085
  *
@@ -1084,7 +1144,7 @@ interface CheckReport {
1084
1144
  * Bumped whenever an entry is added, removed or its detection changes, so a
1085
1145
  * report can say which list it was judged against.
1086
1146
  */
1087
- declare const CATALOGUE_VERSION = "2026.09.9";
1147
+ declare const CATALOGUE_VERSION = "2026.09.11";
1088
1148
  declare const CATALOGUE: readonly Tell[];
1089
1149
  declare function tellById(id: string): Tell | undefined;
1090
1150
  /**
@@ -1463,6 +1523,71 @@ declare function toJson(data: object): string;
1463
1523
 
1464
1524
  declare const RENDERED_PATHS: Record<string, RenderedPath>;
1465
1525
 
1526
+ /**
1527
+ * Tells that exist only on a rendered page: the stock components.
1528
+ *
1529
+ * A pricing trio with a "Most popular" badge, a centred band with one button,
1530
+ * an avatar carousel of testimonials: none of these is visible in one source
1531
+ * file, and all of them are visible on the page. They read the version 2
1532
+ * snapshot's `role`, `geometry` and section parts, so a version 1 snapshot
1533
+ * never trips them.
1534
+ *
1535
+ * Each changes the look, never the page grammar. The fix for a stock pricing
1536
+ * trio keeps the prices; the fix for a stock band keeps the call to action.
1537
+ */
1538
+
1539
+ declare const RENDERED_TELLS: RenderedTell[];
1540
+
1541
+ /**
1542
+ * Imagery and provenance: what the pictures on a rendered page say about
1543
+ * where they came from.
1544
+ *
1545
+ * A page built with no assets reaches for three things: a stock library, a
1546
+ * generator, or no pictures at all and a grid of icons where the work should
1547
+ * be. Each is visible in the snapshot's `images`. A snapshot taken before
1548
+ * craft recorded images has none, and none of these tells judges it.
1549
+ *
1550
+ * Each fix keeps the page's job and changes the evidence: a photo of the
1551
+ * client's own work in place of a library one.
1552
+ */
1553
+
1554
+ /** Stock libraries and placeholder services, by the domain they serve images from. */
1555
+ declare const STOCK_PHOTO_HOSTS: Readonly<Record<string, string>>;
1556
+ /** Services that hand out a face on request: placeholder portraits and generated people. */
1557
+ declare const STOCK_AVATAR_HOSTS: Readonly<Record<string, string>>;
1558
+ /** Where a stock picture came from, by host or by file name, or null. */
1559
+ declare function stockSource(image: Pick<SnapshotImage, "src" | "host">): string | null;
1560
+ /** The placeholder-face service an avatar came from, or a stock library, or null. */
1561
+ declare function stockAvatarSource(image: Pick<SnapshotImage, "src" | "host">): string | null;
1562
+ declare const IMAGERY_TELLS: RenderedTell[];
1563
+
1564
+ /**
1565
+ * Where an image came from, as far as its own bytes say.
1566
+ *
1567
+ * Generators that label their output do it in one of two places: an XMP
1568
+ * packet (Adobe's metadata format, in JPEG, PNG, WebP and AVIF) or a C2PA
1569
+ * manifest (Content Credentials, a JUMBF box). Both name the IPTC digital
1570
+ * source type, and two of its values mean a trained model made the picture:
1571
+ *
1572
+ * http://cv.iptc.org/newscodes/digitalsourcetype/trainedAlgorithmicMedia
1573
+ * http://cv.iptc.org/newscodes/digitalsourcetype/compositeWithTrainedAlgorithmicMedia
1574
+ *
1575
+ * This is a byte scan with no parser and no dependency: the IRI is plain text
1576
+ * in XMP and a CBOR text string in C2PA, so it reads the same either way.
1577
+ *
1578
+ * Only a positive is evidence. Most images carry no metadata, every CMS and
1579
+ * image optimiser that re-encodes strips it, and a PNG can keep its metadata
1580
+ * after the pixels, beyond what is read. No marker proves nothing, and this
1581
+ * never says an image is real.
1582
+ */
1583
+
1584
+ /** Bytes read from the start of a file. JPEG and WebP metadata sit well inside it. */
1585
+ declare const PROVENANCE_SCAN_BYTES: number;
1586
+ /** The IPTC digital source types that mean a trained model made the image, most specific first. */
1587
+ declare const AI_SOURCE_TYPES: readonly ["compositeWithTrainedAlgorithmicMedia", "trainedAlgorithmicMedia"];
1588
+ /** Read an image's leading bytes for an AI digital source type. Pure. */
1589
+ declare function scanProvenance(bytes: Uint8Array): ImageProvenance;
1590
+
1466
1591
  /**
1467
1592
  * A plain, decided-looking page as a snapshot, for fixtures.
1468
1593
  *
@@ -1553,6 +1678,21 @@ interface FingerprintSection {
1553
1678
  centred: number;
1554
1679
  /** Content width over viewport width, 0 to 1. */
1555
1680
  width: number;
1681
+ /** Left-right balance of the content, 0 to 1. Component comparison only. */
1682
+ symmetry?: number;
1683
+ /** Buttons in the section. */
1684
+ controls?: number;
1685
+ /** Cards side by side. */
1686
+ cards?: number;
1687
+ /** The section's own background, or null when it is the page ground. */
1688
+ background?: Oklch | null;
1689
+ /** Badge texts ("Most popular"), lower-cased. */
1690
+ badges?: string[];
1691
+ /** Small round portraits. */
1692
+ avatars?: number;
1693
+ carousel?: boolean;
1694
+ /** Large standalone figures. */
1695
+ figures?: number;
1556
1696
  }
1557
1697
  interface Fingerprint {
1558
1698
  version: 1 | 2;
@@ -1621,6 +1761,270 @@ declare function nearest<T>(target: Fingerprint, set: {
1621
1761
  distance: FingerprintDistance;
1622
1762
  }[];
1623
1763
 
1764
+ /**
1765
+ * The estate register: every site the agency has shipped, fingerprinted, so a
1766
+ * new one can be checked against its siblings. Signal 3 of CHARACTER.md.
1767
+ *
1768
+ * An agency's biggest tell is its clients looking like each other. No single
1769
+ * site shows it; only the set does. So the register holds one fingerprint per
1770
+ * site, and `compareToEstate` says which sites a page sits nearest and what
1771
+ * it shares with them.
1772
+ *
1773
+ * The line for "siblings" is not a number picked here. Two different
1774
+ * businesses are siblings when they sit closer together than two pages Claude
1775
+ * builds for the same brief usually do: if a barber and an electrician look
1776
+ * more alike than two drafts of one barber, nobody chose either look. The
1777
+ * median comes from null models when they are given, and from the 2026-09-23
1778
+ * calibration when they are not.
1779
+ *
1780
+ * Pure. The CLI reads and writes the register file.
1781
+ */
1782
+
1783
+ declare const ESTATE_VERSION = 1;
1784
+ /**
1785
+ * Median fingerprint distance between two null pages built from the same
1786
+ * brief, across seven briefs and 1,330 pairs (calibration/null, 2026-09-23).
1787
+ */
1788
+ declare const SIBLING_AT = 0.31;
1789
+ interface EstateSite {
1790
+ /** Short kebab-case id: "rmp", "chair-and-blade". */
1791
+ id: string;
1792
+ client: string;
1793
+ url: string;
1794
+ /** Where the site's source lives, if known: "rmp474/RMP-Electrical". */
1795
+ repo?: string;
1796
+ fingerprint: Fingerprint;
1797
+ /** Rendered tells found when it was added, for the record. */
1798
+ tells: string[];
1799
+ addedAt: string;
1800
+ }
1801
+ interface EstateRegister {
1802
+ version: typeof ESTATE_VERSION;
1803
+ sites: EstateSite[];
1804
+ }
1805
+ declare function emptyEstate(): EstateRegister;
1806
+ /** Add a site, or replace the one with the same id. Sorted by id so the file diffs cleanly. */
1807
+ declare function addSite(register: EstateRegister, site: EstateSite): EstateRegister;
1808
+ /**
1809
+ * What two fingerprints effectively share, named the way a person would see
1810
+ * it: "Fraunces headline", "no accent", "pill buttons". A part counts when its
1811
+ * distance is 0.2 or less.
1812
+ */
1813
+ declare function sharedParts(a: Fingerprint, b: Fingerprint, d?: FingerprintDistance): string[];
1814
+ interface EstateMatch {
1815
+ id: string;
1816
+ distance: number;
1817
+ sibling: boolean;
1818
+ shared: string[];
1819
+ }
1820
+ /** The sites nearest a fingerprint, closest first, leaving out `exclude` (the site itself). */
1821
+ declare function compareToEstate(target: Fingerprint, register: EstateRegister, options?: {
1822
+ exclude?: string;
1823
+ siblingAt?: number;
1824
+ }): EstateMatch[];
1825
+ interface EstatePair {
1826
+ a: string;
1827
+ b: string;
1828
+ distance: number;
1829
+ sibling: boolean;
1830
+ shared: string[];
1831
+ }
1832
+ /** Every pair in the register, closest first. */
1833
+ declare function estatePairs(register: EstateRegister, siblingAt?: number): EstatePair[];
1834
+ /**
1835
+ * The sibling line from null models: the median distance between two pages
1836
+ * built from the same brief. Each inner array is one brief's fingerprints.
1837
+ */
1838
+ declare function siblingLine(briefs: Fingerprint[][]): number;
1839
+
1840
+ /**
1841
+ * The counterfactual: what a model builds for this brief when nobody tells it
1842
+ * anything else. Signal 2 of CHARACTER.md.
1843
+ *
1844
+ * A null model is about twenty pages generated from one brief, each reduced to
1845
+ * a fingerprint. A site is typical when it sits as close to those pages as they
1846
+ * sit to each other. That question keeps working when model defaults move,
1847
+ * which a fixed list of tells cannot: ban Inter and the null model moves with
1848
+ * the model, so the comparison moves too.
1849
+ *
1850
+ * `harvest` reads the same pages the other way round: which choices recur
1851
+ * across them that the catalogue does not know yet. Those are the candidates
1852
+ * for the next generation of tells. A person decides; nothing is added here.
1853
+ *
1854
+ * Pure. Generating pages and snapshotting them lives in the CLI.
1855
+ */
1856
+
1857
+ declare const NULL_VERSION = 1;
1858
+ /**
1859
+ * The prompt a null run gets: the brief, and nothing about how it should look.
1860
+ * Changing this changes every null model built after it, so it is versioned
1861
+ * by being recorded in each one.
1862
+ */
1863
+ declare function nullPrompt(brief: string): string;
1864
+ interface NullRun {
1865
+ /** The page's file name without extension: "01". */
1866
+ id: string;
1867
+ fingerprint: Fingerprint;
1868
+ /** Catalogue tells found on the page, source and rendered, each once. */
1869
+ tells: string[];
1870
+ /** Every visible string on the page, for the phrase harvest. */
1871
+ copy: string[];
1872
+ }
1873
+ interface NullModel {
1874
+ version: typeof NULL_VERSION;
1875
+ brief: string;
1876
+ prompt: string;
1877
+ /** What was asked for with --model, or "default". */
1878
+ model: string;
1879
+ catalogueVersion: string;
1880
+ builtAt: string;
1881
+ runs: NullRun[];
1882
+ }
1883
+ /** The HTML document in a model's reply, without code fences or commentary. */
1884
+ declare function extractHtml(reply: string): string | null;
1885
+ /** Fewer runs than this and the spread of the null is noise, so nothing is judged. */
1886
+ declare const MIN_RUNS = 5;
1887
+ /** Typical when at least this share of the null's own pages sit further out. */
1888
+ declare const TYPICAL_AT = 0.1;
1889
+ interface Typicality {
1890
+ /**
1891
+ * 0 to 1: the share of the null's own pages that sit further from the rest
1892
+ * than this page sits from them. 1 is more typical than anything the model
1893
+ * built; 0 is further out than every one of them.
1894
+ */
1895
+ score: number;
1896
+ typical: boolean;
1897
+ /** Mean distance to the k nearest null pages. */
1898
+ distance: number;
1899
+ /** The same measure for each null page against the others, median. */
1900
+ baseline: number;
1901
+ nearest: {
1902
+ id: string;
1903
+ distance: number;
1904
+ }[];
1905
+ /** The choices this page shares with most of the null: why it reads as typical. */
1906
+ shared: {
1907
+ part: string;
1908
+ value: string;
1909
+ runs: number;
1910
+ of: number;
1911
+ }[];
1912
+ }
1913
+ /**
1914
+ * How typical a page is against one or more null models (pooled). Every null
1915
+ * page is scored against the others the same way, leaving itself out, so the
1916
+ * threshold comes from the model's own spread and not from a number picked
1917
+ * here: a page drawn from the null is flagged nine times in ten by
1918
+ * construction, and the calibration checks whether real sites are not.
1919
+ */
1920
+ declare function typicality(target: Fingerprint, runs: NullRun[], k?: number): Typicality;
1921
+ declare function hueName(o: Oklch | null): string;
1922
+ declare function groundName(o: Oklch): string;
1923
+ declare function shapeName(roundness: number | null): string;
1924
+ /** The discrete choices a fingerprint makes, as part → value. What a person would name. */
1925
+ declare function choicesOf(fp: Fingerprint): Record<string, string[]>;
1926
+ type CandidateKind = "face" | "accent" | "ground" | "shape" | "motion" | "opening" | "tell" | "phrase";
1927
+ interface HarvestCandidate {
1928
+ kind: CandidateKind;
1929
+ value: string;
1930
+ /** Null pages that make this choice, across every model given. */
1931
+ runs: number;
1932
+ of: number;
1933
+ /** Distinct briefs it turned up for. A habit shows across briefs; a brief's own words do not. */
1934
+ briefs: number;
1935
+ /** The catalogue tell that already catches it, or null when nothing does. */
1936
+ known: string | null;
1937
+ /** An example, for a phrase: the string it came from. */
1938
+ example?: string;
1939
+ }
1940
+ interface HarvestOptions {
1941
+ /** Report a choice made by at least this share of pages. Default 0.25. */
1942
+ minShare?: number;
1943
+ /** Which copy tell, if any, already catches a phrase. The CLI passes the catalogue's. */
1944
+ copyTell?: (phrase: string) => string | null;
1945
+ }
1946
+ /**
1947
+ * Choices that recur across null pages, with the tell that already catches
1948
+ * each, if any. The ones with `known: null` are the next generation's
1949
+ * candidates. Nothing here decides: a person reads them, and a candidate only
1950
+ * becomes a tell with a flag case and a pass case like every other.
1951
+ */
1952
+ declare function harvest(models: Pick<NullModel, "brief" | "runs">[], options?: HarvestOptions): HarvestCandidate[];
1953
+ /** A representative colour for a hue family, for a report. */
1954
+ declare function hueSwatch(runs: NullRun[], hue: string): string | null;
1955
+
1956
+ /**
1957
+ * Component-level sameness: the CTA band, the pricing table, the testimonial
1958
+ * strip, compared one kind at a time.
1959
+ *
1960
+ * The page fingerprint can say two sites look alike overall. It cannot say
1961
+ * "every site in the estate ends on the same centred band with one orange
1962
+ * button". That is the sameness a client notices when they put two of the
1963
+ * agency's sites side by side, and it lives in the components.
1964
+ *
1965
+ * Pure, over the `sections` of version 2 fingerprints. A version 1
1966
+ * fingerprint has none, so it simply has no components to compare.
1967
+ */
1968
+
1969
+ /** Badge texts that promote one option over the others. */
1970
+ declare const PROMO_BADGE: RegExp;
1971
+ /** The sections of one role in a fingerprint, in running order. */
1972
+ declare function componentsOf(fp: Fingerprint, role: SectionRole): FingerprintSection[];
1973
+ /**
1974
+ * 0 (the same recipe) to 1 (nothing in common), over the parts both
1975
+ * components carry: layout (centring, width, balance), furniture (buttons,
1976
+ * cards, figures, avatars, carousel, a promo badge) and colour (its own
1977
+ * ground or the page's). Different roles are 1: a pricing table and an FAQ
1978
+ * are not the same component however they are laid out.
1979
+ */
1980
+ declare function componentDistance(a: FingerprintSection, b: FingerprintSection): number;
1981
+ /** What two components share, as a person would name it. */
1982
+ declare function componentShared(a: FingerprintSection, b: FingerprintSection): string[];
1983
+ /** The closest pair of components of one role between two fingerprints. */
1984
+ declare function closestComponents(a: Fingerprint, b: Fingerprint, role: SectionRole): {
1985
+ distance: number;
1986
+ shared: string[];
1987
+ } | null;
1988
+ interface ComponentPair {
1989
+ a: string;
1990
+ b: string;
1991
+ distance: number;
1992
+ shared: string[];
1993
+ }
1994
+ /**
1995
+ * Every pair of estate sites that both have a component of this role, closest
1996
+ * first. No sibling line yet: that needs a calibration set of real
1997
+ * components, so this ranks and names, and judges nothing.
1998
+ */
1999
+ declare function estateComponentPairs(register: EstateRegister, role: SectionRole): ComponentPair[];
2000
+ interface ComponentTypicality {
2001
+ role: SectionRole;
2002
+ score: number;
2003
+ typical: boolean;
2004
+ distance: number;
2005
+ baseline: number;
2006
+ /** How many null pages had a component of this role to compare with. */
2007
+ runs: number;
2008
+ }
2009
+ /**
2010
+ * How typical one component is against the same role in a null model, by
2011
+ * the method `typicality` uses for whole pages: each null component is scored
2012
+ * against the others leaving itself out, and the page's component is placed
2013
+ * in that spread. Null when fewer than `MIN_RUNS` null pages have the role.
2014
+ */
2015
+ declare function componentTypicality(target: FingerprintSection, runs: NullRun[], k?: number): ComponentTypicality | null;
2016
+ /**
2017
+ * The roles that name a component rather than a generic block: what
2018
+ * `--component` accepts and what `craft audit --null` scores one by one.
2019
+ */
2020
+ declare const COMPONENT_ROLES: readonly SectionRole[];
2021
+ /**
2022
+ * Typicality for each component on a page that the null model can speak to:
2023
+ * the first section of each component role, skipping roles too few null
2024
+ * pages have.
2025
+ */
2026
+ declare function componentTypicalities(fp: Fingerprint, runs: NullRun[], k?: number): ComponentTypicality[];
2027
+
1624
2028
  /**
1625
2029
  * Every colour syntax the estate actually writes, read into OKLCh.
1626
2030
  *
@@ -1911,198 +2315,6 @@ declare function propose(input: ProposeInput): {
1911
2315
  direction: ArtDirection;
1912
2316
  };
1913
2317
 
1914
- /**
1915
- * The counterfactual: what a model builds for this brief when nobody tells it
1916
- * anything else. Signal 2 of CHARACTER.md.
1917
- *
1918
- * A null model is about twenty pages generated from one brief, each reduced to
1919
- * a fingerprint. A site is typical when it sits as close to those pages as they
1920
- * sit to each other. That question keeps working when model defaults move,
1921
- * which a fixed list of tells cannot: ban Inter and the null model moves with
1922
- * the model, so the comparison moves too.
1923
- *
1924
- * `harvest` reads the same pages the other way round: which choices recur
1925
- * across them that the catalogue does not know yet. Those are the candidates
1926
- * for the next generation of tells. A person decides; nothing is added here.
1927
- *
1928
- * Pure. Generating pages and snapshotting them lives in the CLI.
1929
- */
1930
-
1931
- declare const NULL_VERSION = 1;
1932
- /**
1933
- * The prompt a null run gets: the brief, and nothing about how it should look.
1934
- * Changing this changes every null model built after it, so it is versioned
1935
- * by being recorded in each one.
1936
- */
1937
- declare function nullPrompt(brief: string): string;
1938
- interface NullRun {
1939
- /** The page's file name without extension: "01". */
1940
- id: string;
1941
- fingerprint: Fingerprint;
1942
- /** Catalogue tells found on the page, source and rendered, each once. */
1943
- tells: string[];
1944
- /** Every visible string on the page, for the phrase harvest. */
1945
- copy: string[];
1946
- }
1947
- interface NullModel {
1948
- version: typeof NULL_VERSION;
1949
- brief: string;
1950
- prompt: string;
1951
- /** What was asked for with --model, or "default". */
1952
- model: string;
1953
- catalogueVersion: string;
1954
- builtAt: string;
1955
- runs: NullRun[];
1956
- }
1957
- /** The HTML document in a model's reply, without code fences or commentary. */
1958
- declare function extractHtml(reply: string): string | null;
1959
- /** Fewer runs than this and the spread of the null is noise, so nothing is judged. */
1960
- declare const MIN_RUNS = 5;
1961
- /** Typical when at least this share of the null's own pages sit further out. */
1962
- declare const TYPICAL_AT = 0.1;
1963
- interface Typicality {
1964
- /**
1965
- * 0 to 1: the share of the null's own pages that sit further from the rest
1966
- * than this page sits from them. 1 is more typical than anything the model
1967
- * built; 0 is further out than every one of them.
1968
- */
1969
- score: number;
1970
- typical: boolean;
1971
- /** Mean distance to the k nearest null pages. */
1972
- distance: number;
1973
- /** The same measure for each null page against the others, median. */
1974
- baseline: number;
1975
- nearest: {
1976
- id: string;
1977
- distance: number;
1978
- }[];
1979
- /** The choices this page shares with most of the null: why it reads as typical. */
1980
- shared: {
1981
- part: string;
1982
- value: string;
1983
- runs: number;
1984
- of: number;
1985
- }[];
1986
- }
1987
- /**
1988
- * How typical a page is against one or more null models (pooled). Every null
1989
- * page is scored against the others the same way, leaving itself out, so the
1990
- * threshold comes from the model's own spread and not from a number picked
1991
- * here: a page drawn from the null is flagged nine times in ten by
1992
- * construction, and the calibration checks whether real sites are not.
1993
- */
1994
- declare function typicality(target: Fingerprint, runs: NullRun[], k?: number): Typicality;
1995
- declare function hueName(o: Oklch | null): string;
1996
- declare function groundName(o: Oklch): string;
1997
- declare function shapeName(roundness: number | null): string;
1998
- /** The discrete choices a fingerprint makes, as part → value. What a person would name. */
1999
- declare function choicesOf(fp: Fingerprint): Record<string, string[]>;
2000
- type CandidateKind = "face" | "accent" | "ground" | "shape" | "motion" | "opening" | "tell" | "phrase";
2001
- interface HarvestCandidate {
2002
- kind: CandidateKind;
2003
- value: string;
2004
- /** Null pages that make this choice, across every model given. */
2005
- runs: number;
2006
- of: number;
2007
- /** Distinct briefs it turned up for. A habit shows across briefs; a brief's own words do not. */
2008
- briefs: number;
2009
- /** The catalogue tell that already catches it, or null when nothing does. */
2010
- known: string | null;
2011
- /** An example, for a phrase: the string it came from. */
2012
- example?: string;
2013
- }
2014
- interface HarvestOptions {
2015
- /** Report a choice made by at least this share of pages. Default 0.25. */
2016
- minShare?: number;
2017
- /** Which copy tell, if any, already catches a phrase. The CLI passes the catalogue's. */
2018
- copyTell?: (phrase: string) => string | null;
2019
- }
2020
- /**
2021
- * Choices that recur across null pages, with the tell that already catches
2022
- * each, if any. The ones with `known: null` are the next generation's
2023
- * candidates. Nothing here decides: a person reads them, and a candidate only
2024
- * becomes a tell with a flag case and a pass case like every other.
2025
- */
2026
- declare function harvest(models: Pick<NullModel, "brief" | "runs">[], options?: HarvestOptions): HarvestCandidate[];
2027
- /** A representative colour for a hue family, for a report. */
2028
- declare function hueSwatch(runs: NullRun[], hue: string): string | null;
2029
-
2030
- /**
2031
- * The estate register: every site the agency has shipped, fingerprinted, so a
2032
- * new one can be checked against its siblings. Signal 3 of CHARACTER.md.
2033
- *
2034
- * An agency's biggest tell is its clients looking like each other. No single
2035
- * site shows it; only the set does. So the register holds one fingerprint per
2036
- * site, and `compareToEstate` says which sites a page sits nearest and what
2037
- * it shares with them.
2038
- *
2039
- * The line for "siblings" is not a number picked here. Two different
2040
- * businesses are siblings when they sit closer together than two pages Claude
2041
- * builds for the same brief usually do: if a barber and an electrician look
2042
- * more alike than two drafts of one barber, nobody chose either look. The
2043
- * median comes from null models when they are given, and from the 2026-09-23
2044
- * calibration when they are not.
2045
- *
2046
- * Pure. The CLI reads and writes the register file.
2047
- */
2048
-
2049
- declare const ESTATE_VERSION = 1;
2050
- /**
2051
- * Median fingerprint distance between two null pages built from the same
2052
- * brief, across seven briefs and 1,330 pairs (calibration/null, 2026-09-23).
2053
- */
2054
- declare const SIBLING_AT = 0.31;
2055
- interface EstateSite {
2056
- /** Short kebab-case id: "rmp", "chair-and-blade". */
2057
- id: string;
2058
- client: string;
2059
- url: string;
2060
- /** Where the site's source lives, if known: "rmp474/RMP-Electrical". */
2061
- repo?: string;
2062
- fingerprint: Fingerprint;
2063
- /** Rendered tells found when it was added, for the record. */
2064
- tells: string[];
2065
- addedAt: string;
2066
- }
2067
- interface EstateRegister {
2068
- version: typeof ESTATE_VERSION;
2069
- sites: EstateSite[];
2070
- }
2071
- declare function emptyEstate(): EstateRegister;
2072
- /** Add a site, or replace the one with the same id. Sorted by id so the file diffs cleanly. */
2073
- declare function addSite(register: EstateRegister, site: EstateSite): EstateRegister;
2074
- /**
2075
- * What two fingerprints effectively share, named the way a person would see
2076
- * it: "Fraunces headline", "no accent", "pill buttons". A part counts when its
2077
- * distance is 0.2 or less.
2078
- */
2079
- declare function sharedParts(a: Fingerprint, b: Fingerprint, d?: FingerprintDistance): string[];
2080
- interface EstateMatch {
2081
- id: string;
2082
- distance: number;
2083
- sibling: boolean;
2084
- shared: string[];
2085
- }
2086
- /** The sites nearest a fingerprint, closest first, leaving out `exclude` (the site itself). */
2087
- declare function compareToEstate(target: Fingerprint, register: EstateRegister, options?: {
2088
- exclude?: string;
2089
- siblingAt?: number;
2090
- }): EstateMatch[];
2091
- interface EstatePair {
2092
- a: string;
2093
- b: string;
2094
- distance: number;
2095
- sibling: boolean;
2096
- shared: string[];
2097
- }
2098
- /** Every pair in the register, closest first. */
2099
- declare function estatePairs(register: EstateRegister, siblingAt?: number): EstatePair[];
2100
- /**
2101
- * The sibling line from null models: the median distance between two pages
2102
- * built from the same brief. Each inner array is one brief's fingerprints.
2103
- */
2104
- declare function siblingLine(briefs: Fingerprint[][]): number;
2105
-
2106
2318
  /**
2107
2319
  * The character report: the three signals and the reason rule, read together.
2108
2320
  *
@@ -2178,4 +2390,4 @@ declare function characterReport(input: CharacterInputs, copyTells?: Set<string>
2178
2390
 
2179
2391
  declare function retrofitPlan(report: CharacterReport, direction?: ArtDirection | null): string;
2180
2392
 
2181
- export { AI_PHRASES, AI_VIOLET, AI_WORDS, type AccentFork, type AccentForkOptions, type Action, type Area, type ArtDirection, BASELINE_VERSION, BUZZWORDS, type Baseline, type BaselineEntry, CATALOGUE, CATALOGUE_VERSION, CHOICE_KEYS, type CandidateKind, type CharacterInputs, type CharacterReport, type CheckOptions, type CheckReport, type CheckRestraintInput, type ChoiceKey, type Claim, type ClaimsReport, type ContrastCheck, type ContrastReport, type CopyTell, type CraftConfig, type CraftTokensInput, type CraftTokensResult, DEFAULT_IGNORE, DENSITIES, DENSITY_NAMES, DIRECTION_VERSION, DISTANCE_WEIGHTS, DURATION_MS, DURATION_S, type DensityCssOptions, type DensityName, type DirectionChoice, type DirectionProblem, type DirectionReport, type DirectionSource, type DurationName, EASE, EASE_TUPLE, EDGE_STEP, ESTATE_VERSION, EXIT_RATIO, type EaseName, type EmitCssOptions, type EstateMatch, type EstatePair, type EstateRegister, type EstateSite, FINGERPRINT_VERSION, type Fact, type FactComparison, type FactKind, type Finding, type Fingerprint, type FingerprintDistance, type FingerprintSection, type FluidSpaceOptions, type FluidTypeOptions, type FluidTypeResult, type FontClass, type Gamut, type Generation, HOUSE, HOUSE_BUDGET, HOUSE_LOCKED, HOUSE_TYPE, type HarvestCandidate, type HarvestOptions, type Hit, type HouseRule, type HouseTier, JSON_SCHEMA_VERSION, LICENCES, LIGHTNESS_CURVE, type LicenceEntry, type LicenceSubject, MIN_DECIDED, MIN_RUNS, type MotionDecision, type MotionKind, type MultiClient, NEGATIVE_REASSURANCE, NULL_VERSION, type NullModel, type NullRun, type Oklch, type OklchToHexOptions, PILL_LIMIT, PLAINER_WORDS, PROPOSED, type PaletteColour, type Proposal, type ProposeInput, RAMP_STEPS, READABLE_SNAPSHOT_VERSIONS, REFLEX_FONTS_1, REFLEX_FONTS_2, RENDERED_PATHS, REVEAL_LIMIT, REVIEW_PHRASES, type Ramp, type RampFromAnchorsOptions, type RampOptions, type RampStep, type RestraintBudget, type RestraintReport, type RestraintSeverity, type RestraintViolation, type Rgb, type RgbaImage, SCALE, SHADCN_LIMIT, SHADCN_PRIMITIVES, SIBLING_AT, SNAPSHOT_VERSION, SOURCE_KINDS, SPACE_STEPS, SPRING, STOCK_PHRASES, type SarifOptions, type SarifTell, type SectionGeometry, type SectionKind, type SectionRhythmOptions, type SectionRole, type SemanticInput, type SemanticResult, type Severity, type SeverityLevel, type SeverityOverride, type ShouldAnimateInput, type SignalResult, type Snapshot, type SnapshotColour, type SnapshotControl, type SnapshotEffects, type SnapshotFont, type SnapshotGradient, type SnapshotHeading, type SnapshotMotion, type SnapshotPatch, type SnapshotSection, type SnapshotVisual, type SourceFile, type SourceKind, type SourceTell, type SpaceStep, type Surface, TELL_HEAVY, TYPE_STEPS, TYPICAL_AT, type TailwindPreset, type Tell, type TellException, type TypeStep, type Typicality, VAGUE_WORDS, type ValidateContext, type Verdict, accentFork, addSite, apcaContrast, applyBaseline, applyHouseGate, applySeverity, auditSnapshot, catalogueTable, characterReport, checkCopy, checkPair, checkRestraint, choicesOf, compareFacts, compareToEstate, craftTokens, createBaseline, deltaEOk, deltaEOkHex, densityCss, densityTokens, emitCss, emptyEstate, estatePairs, exitDuration, extractHtml, faceLicence, findClaims, findColours, findingKey, fingerprint, fingerprintDistance, fluidClamp, fluidSpace, fluidType, fontClass, formatClaims, formatComparison, formatHex, formatReport, globToRegExp, groundName, harvest, hexToOklch, holdHouseBlocks, houseRule, hueName, hueSwatch, ignoreMatcher, inP3Gamut, inSrgbGamut, initDirection, isAiViolet, isCream, layoutDistance, licencesJson, makeSnapshot, motionTokens, namedSources, nearest, normaliseFamily, nullPrompt, oklchToHex, oklchToRgb, paletteFromPixels, parseBaseline, parseColour, parseCraftConfig, parseHex, propose, protectedFacts, ramp, rampFromAnchors, readSnapshot, retrofitPlan, runTell, scanSource, sectionRhythm, semantic, severityExceptions, shapeName, sharedParts, shouldAnimate, siblingLine, tailwindV3Preset, tailwindV4Theme, tellById, toGamut, toJson, toSarif, typeFeatureTokens, typicality, validateDirection, visibleText, visualMeasures, wcagContrast, wordListsJson };
2393
+ export { AI_PHRASES, AI_SOURCE_TYPES, AI_VIOLET, AI_WORDS, type AccentFork, type AccentForkOptions, type Action, type Area, type ArtDirection, BASELINE_VERSION, BUZZWORDS, type Baseline, type BaselineEntry, CATALOGUE, CATALOGUE_VERSION, CHOICE_KEYS, COMPONENT_ROLES, type CandidateKind, type CharacterInputs, type CharacterReport, type CheckOptions, type CheckReport, type CheckRestraintInput, type ChoiceKey, type Claim, type ClaimsReport, type ComponentPair, type ComponentTypicality, type ContrastCheck, type ContrastReport, type CopyTell, type CraftConfig, type CraftTokensInput, type CraftTokensResult, DEFAULT_IGNORE, DENSITIES, DENSITY_NAMES, DIRECTION_VERSION, DISTANCE_WEIGHTS, DURATION_MS, DURATION_S, type DensityCssOptions, type DensityName, type DirectionChoice, type DirectionProblem, type DirectionReport, type DirectionSource, type DurationName, EASE, EASE_TUPLE, EDGE_STEP, ESTATE_VERSION, EXIT_RATIO, type EaseName, type EmitCssOptions, type EstateMatch, type EstatePair, type EstateRegister, type EstateSite, FINGERPRINT_VERSION, type Fact, type FactComparison, type FactKind, type Finding, type Fingerprint, type FingerprintDistance, type FingerprintSection, type FluidSpaceOptions, type FluidTypeOptions, type FluidTypeResult, type FontClass, type Gamut, type Generation, HOUSE, HOUSE_BUDGET, HOUSE_LOCKED, HOUSE_TYPE, type HarvestCandidate, type HarvestOptions, type Hit, type HouseRule, type HouseTier, IMAGERY_TELLS, type ImageProvenance, type ImageRole, JSON_SCHEMA_VERSION, LICENCES, LIGHTNESS_CURVE, type LicenceEntry, type LicenceSubject, MIN_DECIDED, MIN_RUNS, type MotionDecision, type MotionKind, type MultiClient, NEGATIVE_REASSURANCE, NULL_VERSION, type NullModel, type NullRun, type Oklch, type OklchToHexOptions, PILL_LIMIT, PLAINER_WORDS, PROMO_BADGE, PROPOSED, PROVENANCE_SCAN_BYTES, type PaletteColour, type Proposal, type ProposeInput, RAMP_STEPS, READABLE_SNAPSHOT_VERSIONS, REFLEX_FONTS_1, REFLEX_FONTS_2, RENDERED_PATHS, RENDERED_TELLS, REVEAL_LIMIT, REVIEW_PHRASES, type Ramp, type RampFromAnchorsOptions, type RampOptions, type RampStep, type RenderedTell, type RestraintBudget, type RestraintReport, type RestraintSeverity, type RestraintViolation, type Rgb, type RgbaImage, SCALE, SHADCN_LIMIT, SHADCN_PRIMITIVES, SIBLING_AT, SNAPSHOT_VERSION, SOURCE_KINDS, SPACE_STEPS, SPRING, STOCK_AVATAR_HOSTS, STOCK_PHOTO_HOSTS, STOCK_PHRASES, type SarifOptions, type SarifTell, type SectionGeometry, type SectionKind, type SectionRhythmOptions, type SectionRole, type SemanticInput, type SemanticResult, type Severity, type SeverityLevel, type SeverityOverride, type ShouldAnimateInput, type SignalResult, type Snapshot, type SnapshotColour, type SnapshotControl, type SnapshotEffects, type SnapshotFont, type SnapshotGradient, type SnapshotHeading, type SnapshotImage, type SnapshotMotion, type SnapshotPatch, type SnapshotSection, type SnapshotVisual, type SourceFile, type SourceKind, type SourceTell, type SpaceStep, type Surface, TELL_HEAVY, TYPE_STEPS, TYPICAL_AT, type TailwindPreset, type Tell, type TellException, type TypeStep, type Typicality, VAGUE_WORDS, type ValidateContext, type Verdict, accentFork, addSite, apcaContrast, applyBaseline, applyHouseGate, applySeverity, auditSnapshot, catalogueTable, characterReport, checkCopy, checkPair, checkRestraint, choicesOf, closestComponents, compareFacts, compareToEstate, componentDistance, componentShared, componentTypicalities, componentTypicality, componentsOf, craftTokens, createBaseline, deltaEOk, deltaEOkHex, densityCss, densityTokens, emitCss, emptyEstate, estateComponentPairs, estatePairs, exitDuration, extractHtml, faceLicence, findClaims, findColours, findingKey, fingerprint, fingerprintDistance, fluidClamp, fluidSpace, fluidType, fontClass, formatClaims, formatComparison, formatHex, formatReport, globToRegExp, groundName, harvest, hexToOklch, holdHouseBlocks, houseRule, hueName, hueSwatch, ignoreMatcher, inP3Gamut, inSrgbGamut, initDirection, isAiViolet, isCream, layoutDistance, licencesJson, makeSnapshot, motionTokens, namedSources, nearest, normaliseFamily, nullPrompt, oklchToHex, oklchToRgb, paletteFromPixels, parseBaseline, parseColour, parseCraftConfig, parseHex, propose, protectedFacts, ramp, rampFromAnchors, readSnapshot, retrofitPlan, runTell, scanProvenance, scanSource, sectionRhythm, semantic, severityExceptions, shapeName, sharedParts, shouldAnimate, siblingLine, stockAvatarSource, stockSource, tailwindV3Preset, tailwindV4Theme, tellById, toGamut, toJson, toSarif, typeFeatureTokens, typicality, validateDirection, visibleText, visualMeasures, wcagContrast, wordListsJson };