@domandigital/craft 0.15.0 → 0.16.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
@@ -1546,6 +1546,60 @@ declare function paragraphUniformity(paragraphs: string[]): number | null;
1546
1546
  /** A block the size of a blurb: 2 to 8 sentences, 20 to 160 words. */
1547
1547
  declare function isBlurb(f: Pick<ShapeFeatures, "sentences" | "words">): boolean;
1548
1548
 
1549
+ /**
1550
+ * Lexical and specificity features for a short block of copy.
1551
+ *
1552
+ * The sentence-shape features (shape.ts) did not separate model copy from
1553
+ * people's at blurb length. These measure what a block says and which words it
1554
+ * reaches for: how many of the tell words and phrases craft already lists, how
1555
+ * many words with published excess-use evidence, and how particular the block
1556
+ * is (names, places, figures, the nouns of the trade).
1557
+ *
1558
+ * Pure and zero-dependency, and used both by the calibration scripts and by
1559
+ * any tell that ships on the result.
1560
+ *
1561
+ * Every word in STUDY_WORDS carries its source. Models change what they
1562
+ * over-use between generations (Juzek and Ward found "boasts" gone and
1563
+ * "underscore" up sharply from GPT-3.5 to GPT-4o-mini), so a listed word is a
1564
+ * measurement with a date, not a fact about models.
1565
+ */
1566
+ interface StudyWord {
1567
+ word: string;
1568
+ source: string;
1569
+ }
1570
+ /**
1571
+ * Words with published excess-use evidence. Academic register, so a word here
1572
+ * is a candidate to measure in marketing copy, not a tell.
1573
+ */
1574
+ declare const STUDY_WORDS: readonly StudyWord[];
1575
+ /** Every word or phrase the features look for, with where it came from. */
1576
+ declare function vocabulary(): {
1577
+ word: string;
1578
+ source: string;
1579
+ }[];
1580
+ /** Occurrences per vocabulary word in the text. */
1581
+ declare function vocabularyCounts(text: string): Map<string, number>;
1582
+ interface LexicalFeatures {
1583
+ /** Hits from craft's own tell lists, per 100 words. */
1584
+ listRate: number;
1585
+ /** Hits from the published excess-use words, per 100 words. */
1586
+ studyRate: number;
1587
+ /** Distinct specifics (names, places, figures, dates, contact details, brief terms) per 100 words. */
1588
+ hardPer100: number;
1589
+ /** Distinct trade nouns per 100 words. */
1590
+ tradePer100: number;
1591
+ /** All specifics per 100 words. */
1592
+ specificsPer100: number;
1593
+ /** 1 when there is no hard specific and fewer than two trade nouns. */
1594
+ generic: number;
1595
+ /** Distinct money, date, time and number specifics. */
1596
+ figures: number;
1597
+ /** Distinct names and brief terms. */
1598
+ names: number;
1599
+ }
1600
+ declare const LEXICAL_FEATURES: readonly (keyof LexicalFeatures)[];
1601
+ declare function lexicalOf(text: string, brief?: string): LexicalFeatures;
1602
+
1549
1603
  /**
1550
1604
  * Specificity tells: a page that could belong to anyone.
1551
1605
  *
@@ -2349,9 +2403,18 @@ interface NullRun {
2349
2403
  interface NullModel {
2350
2404
  version: typeof NULL_VERSION;
2351
2405
  brief: string;
2406
+ /**
2407
+ * The prompt each page was built from. For imported pages, the prompt the
2408
+ * person was asked to give the builder: `craft null prompt` prints it.
2409
+ */
2352
2410
  prompt: string;
2353
- /** What was asked for with --model, or "default". */
2411
+ /** What was asked for with --model, or "default"; "unknown" for imported pages unless given. */
2354
2412
  model: string;
2413
+ /**
2414
+ * The tool that built the pages, when they were imported rather than
2415
+ * generated here: "v0", "lovable". Absent for `craft null build`.
2416
+ */
2417
+ builder?: string;
2355
2418
  catalogueVersion: string;
2356
2419
  builtAt: string;
2357
2420
  runs: NullRun[];
@@ -2876,6 +2939,90 @@ declare function propose(input: ProposeInput): {
2876
2939
  direction: ArtDirection;
2877
2940
  };
2878
2941
 
2942
+ /**
2943
+ * Calibration: how well the catalogue separates pages a person has labelled.
2944
+ *
2945
+ * A labelled set holds three kinds of page. `ai` pages were generated. `human`
2946
+ * pages were made by people. `ai-looking` pages were made by people and still
2947
+ * read as generated to someone who looks at many sites: they are what the
2948
+ * tells are for, since a tell detects a look, not a maker. So a tell's hit on
2949
+ * an `ai` or an `ai-looking` page counts for it, and a hit on a `human` page
2950
+ * counts against it.
2951
+ *
2952
+ * The verdict is the one CHARACTER.md fixed before any result was read: a page
2953
+ * is flagged when it is typical against the null models, or tell-heavy (three
2954
+ * or more distinct design tells). With no null models, tell-heavy decides.
2955
+ *
2956
+ * The targets are CHARACTER.md's first three. Target 4 (no siblings in the
2957
+ * estate) is `craft estate compare`; target 5 (people cannot tell) is the blind
2958
+ * test in docs/blind-test.md, which no tool here can run.
2959
+ *
2960
+ * Pure. Taking snapshots and reading files lives in the CLI.
2961
+ */
2962
+ declare const LABELS: readonly ["ai", "ai-looking", "human"];
2963
+ type Label = (typeof LABELS)[number];
2964
+ /** Targets 1 and 3: this share of the set flagged, or more. */
2965
+ declare const FLAGGED_TARGET = 0.9;
2966
+ /** Target 2: this share of the human set typical, or less. */
2967
+ declare const HUMAN_TYPICAL_TARGET = 0.1;
2968
+ interface MeasuredPage {
2969
+ id: string;
2970
+ label: Label;
2971
+ /** Every catalogue tell found on the page, each once. */
2972
+ tells: string[];
2973
+ /** Findings in the blocking tier. */
2974
+ blocking: number;
2975
+ /** Against the pooled null models; absent when none were given. */
2976
+ typicality?: {
2977
+ score: number;
2978
+ typical: boolean;
2979
+ };
2980
+ }
2981
+ interface UnmeasuredPage {
2982
+ id: string;
2983
+ label: Label;
2984
+ reason: string;
2985
+ }
2986
+ interface LabelSummary {
2987
+ label: Label;
2988
+ pages: number;
2989
+ flagged: number;
2990
+ typical: number | null;
2991
+ tellHeavy: number;
2992
+ blocking: number;
2993
+ }
2994
+ interface TellRate {
2995
+ tell: string;
2996
+ hits: Record<Label, number>;
2997
+ /** Hits on `ai` and `ai-looking` pages over all hits. */
2998
+ precision: number;
2999
+ /** `ai` and `ai-looking` pages hit, over all of them measured. Null when there are none. */
3000
+ recall: number | null;
3001
+ }
3002
+ interface TargetCheck {
3003
+ target: string;
3004
+ /** Null when no page with that label was measured. */
3005
+ met: boolean | null;
3006
+ detail: string;
3007
+ }
3008
+ interface Calibration {
3009
+ pages: number;
3010
+ /** Whether typicality was measured, or tell-heavy alone decided. */
3011
+ typicality: boolean;
3012
+ labels: LabelSummary[];
3013
+ tells: TellRate[];
3014
+ /** Catalogue tells that fired on no page. */
3015
+ silent: string[];
3016
+ targets: TargetCheck[];
3017
+ unmeasured: UnmeasuredPage[];
3018
+ }
3019
+ /** Tells about the look, not the words: what "tell-heavy" counts. */
3020
+ declare function designTells(tells: string[]): string[];
3021
+ declare function isFlagged(page: MeasuredPage): boolean;
3022
+ declare function calibrate(pages: MeasuredPage[], unmeasured?: UnmeasuredPage[]): Calibration;
3023
+ /** `notes` are lines the caller knows and the numbers do not show, printed under the heading. */
3024
+ declare function formatCalibration(c: Calibration, notes?: string[]): string;
3025
+
2879
3026
  /**
2880
3027
  * The character report: the three signals and the reason rule, read together.
2881
3028
  *
@@ -2951,4 +3098,4 @@ declare function characterReport(input: CharacterInputs, copyTells?: Set<string>
2951
3098
 
2952
3099
  declare function retrofitPlan(report: CharacterReport, direction?: ArtDirection | null): string;
2953
3100
 
2954
- export { ACCENT_SCALE, ACCENT_SHARED, AI_PHRASES, AI_SOURCE_TYPES, AI_VIOLET, AI_WORDS, type AccentFork, type AccentForkOptions, type Action, type ActionPosition, type Area, type ArtDirection, BASELINE_VERSION, BUZZWORDS, type Baseline, type BaselineEntry, CATALOGUE, CATALOGUE_VERSION, CHOICE_KEYS, COMPONENT_ROLES, CONSIDERATION, CONVENTION, CUSTOMER_KINDS, type CandidateKind, type CharacterInputs, type CharacterReport, type CheckOptions, type CheckReport, type CheckRestraintInput, type ChoiceKey, type Claim, type ClaimsReport, type CompetitorComparison, type ComponentPair, type ComponentTypicality, type Consideration, type ContrastCheck, type ContrastReport, type CopySide, type CopyTell, type CraftConfig, type CraftTokensInput, type CraftTokensResult, type CustomerKind, DEFAULT_IGNORE, DENSITIES, DENSITY_NAMES, DIRECTION_VERSION, DIRECTION_VERSIONS, DISTANCE_WEIGHTS, DURATION_MS, DURATION_S, type DensityCssOptions, type DensityName, type DirectionChoice, type DirectionComparison, type DirectionMatch, type DirectionProblem, type DirectionReport, type DirectionSource, type DirectionSummary, 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, FUNCTION_WORDS, type Fact, type FactComparison, type FactKind, type Finding, type Fingerprint, type FingerprintDistance, type FingerprintSection, type FluidSpaceOptions, type FluidTypeOptions, type FluidTypeResult, type FontClass, GROUND_SCALE, GROUND_SHARED, type Gamut, type Generation, HIERARCHY_FIELDS, HOME_FILE, HOME_URL, 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, type JobContext, type JobMap, type JobPart, LICENCES, LIGHTNESS_CURVE, type LicenceEntry, type LicenceSubject, MIN_DECIDED, MIN_RUNS, MOOD, type MotionDecision, type MotionKind, type MultiClient, NEGATIVE_REASSURANCE, NULL_VERSION, type NullModel, type NullRun, type Oklch, type OklchToHexOptions, PAGE_TYPES, PILL_LIMIT, PLAINER_WORDS, PREFERENCE, PROMO_BADGE, PROOF_NAMES, PROPOSED, PROVENANCE_SCAN_BYTES, type PageCopy, type PageHierarchy, type PageResult, type PageType, 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 ReasonInput, type RenderedTell, type ResearchInput, type RestraintBudget, type RestraintReport, type RestraintSeverity, type RestraintViolation, type Rgb, type RgbaImage, SCALE, SECTION_ROLES, SHADCN_LIMIT, SHADCN_PRIMITIVES, SHARED_PART, SIBLING_AT, SNAPSHOT_VERSION, SOURCE_KINDS, SPACE_STEPS, SPECIFICITY_COPY_TELLS, SPECIFICITY_RENDERED_TELLS, SPRING, STANDING_CLAIM, STOCK_AVATAR_HOSTS, STOCK_FIGURES, 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 ShapeFeatures, 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 Specific, type SpecificKind, type Specificity, type Surface, TELL_HEAVY, TRADE_NOUNS, TYPE_STEPS, TYPICAL_AT, type TailwindPreset, type Tell, type TellException, type Tricolon, type TypeStep, type Typicality, VAGUE_WORDS, type ValidateContext, type Verdict, accentFork, addSite, apcaContrast, applyBaseline, applyHouseGate, applySeverity, auditSnapshot, briefTerms, catalogueTable, characterReport, checkCopy, checkOrder, checkPair, checkReason, checkRestraint, choicesOf, clauseDepth, closestComponents, compareCompetitor, compareDirections, compareFacts, compareToDeclared, compareToEstate, componentDistance, componentShared, componentTypicalities, componentTypicality, componentsOf, contentWords, countWords, craftTokens, createBaseline, cv, deltaEOk, deltaEOkHex, densityCss, densityTokens, emitCss, emptyEstate, estateComponentPairs, estatePairs, exitDuration, extractHtml, faceLicence, findClaims, findColours, findingKey, fingerprint, fingerprintDistance, fluidClamp, fluidSpace, fluidType, fontClass, formatClaims, formatComparison, formatCompetitor, formatDirectionMatches, formatHex, formatReport, globToRegExp, groundName, harvest, hedgeCount, hedgedClose, hexToOklch, holdHouseBlocks, houseRule, hueName, hueSwatch, ignoreMatcher, inP3Gamut, inSrgbGamut, initDirection, isAiViolet, isBlurb, isCategoryLabel, isCream, jobWords, layoutDistance, licencesJson, makeSnapshot, motionTokens, namedSources, nearest, nominalisations, normaliseFamily, nullPrompt, oklchToHex, oklchToRgb, pageCopy, paletteFromPixels, paragraphUniformity, parseBaseline, parseColour, parseCraftConfig, parseHex, participialClauses, phrasalCoordinations, propose, protectedFacts, ramp, rampFromAnchors, readSnapshot, renderedOrder, researchPrompt, retrofitPlan, runTell, scanProvenance, scanSource, sectionRhythm, semantic, sentencesOf, severityExceptions, shapeMoves, shapeName, shapeOf, words as shapeWords, sharedParts, shouldAnimate, siblingLine, skeleton, skeletonRepeat, specificity, specifics, splitSentences, stackedConditional, stockAvatarSource, stockSource, summariseDirection, tailwindV3Preset, tailwindV4Theme, tellById, toGamut, toJson, toSarif, tradeOf, tricolons, typeFeatureTokens, typicality, unprovenClaims, validateDirection, validateHierarchy, validateJob, visibleText, visualMeasures, wcagContrast, wordListsJson };
3101
+ export { ACCENT_SCALE, ACCENT_SHARED, AI_PHRASES, AI_SOURCE_TYPES, AI_VIOLET, AI_WORDS, type AccentFork, type AccentForkOptions, type Action, type ActionPosition, type Area, type ArtDirection, BASELINE_VERSION, BUZZWORDS, type Baseline, type BaselineEntry, CATALOGUE, CATALOGUE_VERSION, CHOICE_KEYS, COMPONENT_ROLES, CONSIDERATION, CONVENTION, CUSTOMER_KINDS, type Calibration, type CandidateKind, type CharacterInputs, type CharacterReport, type CheckOptions, type CheckReport, type CheckRestraintInput, type ChoiceKey, type Claim, type ClaimsReport, type CompetitorComparison, type ComponentPair, type ComponentTypicality, type Consideration, type ContrastCheck, type ContrastReport, type CopySide, type CopyTell, type CraftConfig, type CraftTokensInput, type CraftTokensResult, type CustomerKind, DEFAULT_IGNORE, DENSITIES, DENSITY_NAMES, DIRECTION_VERSION, DIRECTION_VERSIONS, DISTANCE_WEIGHTS, DURATION_MS, DURATION_S, type DensityCssOptions, type DensityName, type DirectionChoice, type DirectionComparison, type DirectionMatch, type DirectionProblem, type DirectionReport, type DirectionSource, type DirectionSummary, 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, FLAGGED_TARGET, FUNCTION_WORDS, type Fact, type FactComparison, type FactKind, type Finding, type Fingerprint, type FingerprintDistance, type FingerprintSection, type FluidSpaceOptions, type FluidTypeOptions, type FluidTypeResult, type FontClass, GROUND_SCALE, GROUND_SHARED, type Gamut, type Generation, HIERARCHY_FIELDS, HOME_FILE, HOME_URL, HOUSE, HOUSE_BUDGET, HOUSE_LOCKED, HOUSE_TYPE, HUMAN_TYPICAL_TARGET, type HarvestCandidate, type HarvestOptions, type Hit, type HouseRule, type HouseTier, IMAGERY_TELLS, type ImageProvenance, type ImageRole, JSON_SCHEMA_VERSION, type JobContext, type JobMap, type JobPart, LABELS, LEXICAL_FEATURES, LICENCES, LIGHTNESS_CURVE, type Label, type LabelSummary, type LexicalFeatures, type LicenceEntry, type LicenceSubject, MIN_DECIDED, MIN_RUNS, MOOD, type MeasuredPage, type MotionDecision, type MotionKind, type MultiClient, NEGATIVE_REASSURANCE, NULL_VERSION, type NullModel, type NullRun, type Oklch, type OklchToHexOptions, PAGE_TYPES, PILL_LIMIT, PLAINER_WORDS, PREFERENCE, PROMO_BADGE, PROOF_NAMES, PROPOSED, PROVENANCE_SCAN_BYTES, type PageCopy, type PageHierarchy, type PageResult, type PageType, 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 ReasonInput, type RenderedTell, type ResearchInput, type RestraintBudget, type RestraintReport, type RestraintSeverity, type RestraintViolation, type Rgb, type RgbaImage, SCALE, SECTION_ROLES, SHADCN_LIMIT, SHADCN_PRIMITIVES, SHARED_PART, SIBLING_AT, SNAPSHOT_VERSION, SOURCE_KINDS, SPACE_STEPS, SPECIFICITY_COPY_TELLS, SPECIFICITY_RENDERED_TELLS, SPRING, STANDING_CLAIM, STOCK_AVATAR_HOSTS, STOCK_FIGURES, STOCK_PHOTO_HOSTS, STOCK_PHRASES, STUDY_WORDS, type SarifOptions, type SarifTell, type SectionGeometry, type SectionKind, type SectionRhythmOptions, type SectionRole, type SemanticInput, type SemanticResult, type Severity, type SeverityLevel, type SeverityOverride, type ShapeFeatures, 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 Specific, type SpecificKind, type Specificity, type StudyWord, type Surface, TELL_HEAVY, TRADE_NOUNS, TYPE_STEPS, TYPICAL_AT, type TailwindPreset, type TargetCheck, type Tell, type TellException, type TellRate, type Tricolon, type TypeStep, type Typicality, type UnmeasuredPage, VAGUE_WORDS, type ValidateContext, type Verdict, accentFork, addSite, apcaContrast, applyBaseline, applyHouseGate, applySeverity, auditSnapshot, briefTerms, calibrate, catalogueTable, characterReport, checkCopy, checkOrder, checkPair, checkReason, checkRestraint, choicesOf, clauseDepth, closestComponents, compareCompetitor, compareDirections, compareFacts, compareToDeclared, compareToEstate, componentDistance, componentShared, componentTypicalities, componentTypicality, componentsOf, contentWords, countWords, craftTokens, createBaseline, cv, deltaEOk, deltaEOkHex, densityCss, densityTokens, designTells, emitCss, emptyEstate, estateComponentPairs, estatePairs, exitDuration, extractHtml, faceLicence, findClaims, findColours, findingKey, fingerprint, fingerprintDistance, fluidClamp, fluidSpace, fluidType, fontClass, formatCalibration, formatClaims, formatComparison, formatCompetitor, formatDirectionMatches, formatHex, formatReport, globToRegExp, groundName, harvest, hedgeCount, hedgedClose, hexToOklch, holdHouseBlocks, houseRule, hueName, hueSwatch, ignoreMatcher, inP3Gamut, inSrgbGamut, initDirection, isAiViolet, isBlurb, isCategoryLabel, isCream, isFlagged, jobWords, layoutDistance, lexicalOf, licencesJson, makeSnapshot, motionTokens, namedSources, nearest, nominalisations, normaliseFamily, nullPrompt, oklchToHex, oklchToRgb, pageCopy, paletteFromPixels, paragraphUniformity, parseBaseline, parseColour, parseCraftConfig, parseHex, participialClauses, phrasalCoordinations, propose, protectedFacts, ramp, rampFromAnchors, readSnapshot, renderedOrder, researchPrompt, retrofitPlan, runTell, scanProvenance, scanSource, sectionRhythm, semantic, sentencesOf, severityExceptions, shapeMoves, shapeName, shapeOf, words as shapeWords, sharedParts, shouldAnimate, siblingLine, skeleton, skeletonRepeat, specificity, specifics, splitSentences, stackedConditional, stockAvatarSource, stockSource, summariseDirection, tailwindV3Preset, tailwindV4Theme, tellById, toGamut, toJson, toSarif, tradeOf, tricolons, typeFeatureTokens, typicality, unprovenClaims, validateDirection, validateHierarchy, validateJob, visibleText, visualMeasures, vocabulary, vocabularyCounts, wcagContrast, wordListsJson };
package/dist/index.d.ts CHANGED
@@ -1546,6 +1546,60 @@ declare function paragraphUniformity(paragraphs: string[]): number | null;
1546
1546
  /** A block the size of a blurb: 2 to 8 sentences, 20 to 160 words. */
1547
1547
  declare function isBlurb(f: Pick<ShapeFeatures, "sentences" | "words">): boolean;
1548
1548
 
1549
+ /**
1550
+ * Lexical and specificity features for a short block of copy.
1551
+ *
1552
+ * The sentence-shape features (shape.ts) did not separate model copy from
1553
+ * people's at blurb length. These measure what a block says and which words it
1554
+ * reaches for: how many of the tell words and phrases craft already lists, how
1555
+ * many words with published excess-use evidence, and how particular the block
1556
+ * is (names, places, figures, the nouns of the trade).
1557
+ *
1558
+ * Pure and zero-dependency, and used both by the calibration scripts and by
1559
+ * any tell that ships on the result.
1560
+ *
1561
+ * Every word in STUDY_WORDS carries its source. Models change what they
1562
+ * over-use between generations (Juzek and Ward found "boasts" gone and
1563
+ * "underscore" up sharply from GPT-3.5 to GPT-4o-mini), so a listed word is a
1564
+ * measurement with a date, not a fact about models.
1565
+ */
1566
+ interface StudyWord {
1567
+ word: string;
1568
+ source: string;
1569
+ }
1570
+ /**
1571
+ * Words with published excess-use evidence. Academic register, so a word here
1572
+ * is a candidate to measure in marketing copy, not a tell.
1573
+ */
1574
+ declare const STUDY_WORDS: readonly StudyWord[];
1575
+ /** Every word or phrase the features look for, with where it came from. */
1576
+ declare function vocabulary(): {
1577
+ word: string;
1578
+ source: string;
1579
+ }[];
1580
+ /** Occurrences per vocabulary word in the text. */
1581
+ declare function vocabularyCounts(text: string): Map<string, number>;
1582
+ interface LexicalFeatures {
1583
+ /** Hits from craft's own tell lists, per 100 words. */
1584
+ listRate: number;
1585
+ /** Hits from the published excess-use words, per 100 words. */
1586
+ studyRate: number;
1587
+ /** Distinct specifics (names, places, figures, dates, contact details, brief terms) per 100 words. */
1588
+ hardPer100: number;
1589
+ /** Distinct trade nouns per 100 words. */
1590
+ tradePer100: number;
1591
+ /** All specifics per 100 words. */
1592
+ specificsPer100: number;
1593
+ /** 1 when there is no hard specific and fewer than two trade nouns. */
1594
+ generic: number;
1595
+ /** Distinct money, date, time and number specifics. */
1596
+ figures: number;
1597
+ /** Distinct names and brief terms. */
1598
+ names: number;
1599
+ }
1600
+ declare const LEXICAL_FEATURES: readonly (keyof LexicalFeatures)[];
1601
+ declare function lexicalOf(text: string, brief?: string): LexicalFeatures;
1602
+
1549
1603
  /**
1550
1604
  * Specificity tells: a page that could belong to anyone.
1551
1605
  *
@@ -2349,9 +2403,18 @@ interface NullRun {
2349
2403
  interface NullModel {
2350
2404
  version: typeof NULL_VERSION;
2351
2405
  brief: string;
2406
+ /**
2407
+ * The prompt each page was built from. For imported pages, the prompt the
2408
+ * person was asked to give the builder: `craft null prompt` prints it.
2409
+ */
2352
2410
  prompt: string;
2353
- /** What was asked for with --model, or "default". */
2411
+ /** What was asked for with --model, or "default"; "unknown" for imported pages unless given. */
2354
2412
  model: string;
2413
+ /**
2414
+ * The tool that built the pages, when they were imported rather than
2415
+ * generated here: "v0", "lovable". Absent for `craft null build`.
2416
+ */
2417
+ builder?: string;
2355
2418
  catalogueVersion: string;
2356
2419
  builtAt: string;
2357
2420
  runs: NullRun[];
@@ -2876,6 +2939,90 @@ declare function propose(input: ProposeInput): {
2876
2939
  direction: ArtDirection;
2877
2940
  };
2878
2941
 
2942
+ /**
2943
+ * Calibration: how well the catalogue separates pages a person has labelled.
2944
+ *
2945
+ * A labelled set holds three kinds of page. `ai` pages were generated. `human`
2946
+ * pages were made by people. `ai-looking` pages were made by people and still
2947
+ * read as generated to someone who looks at many sites: they are what the
2948
+ * tells are for, since a tell detects a look, not a maker. So a tell's hit on
2949
+ * an `ai` or an `ai-looking` page counts for it, and a hit on a `human` page
2950
+ * counts against it.
2951
+ *
2952
+ * The verdict is the one CHARACTER.md fixed before any result was read: a page
2953
+ * is flagged when it is typical against the null models, or tell-heavy (three
2954
+ * or more distinct design tells). With no null models, tell-heavy decides.
2955
+ *
2956
+ * The targets are CHARACTER.md's first three. Target 4 (no siblings in the
2957
+ * estate) is `craft estate compare`; target 5 (people cannot tell) is the blind
2958
+ * test in docs/blind-test.md, which no tool here can run.
2959
+ *
2960
+ * Pure. Taking snapshots and reading files lives in the CLI.
2961
+ */
2962
+ declare const LABELS: readonly ["ai", "ai-looking", "human"];
2963
+ type Label = (typeof LABELS)[number];
2964
+ /** Targets 1 and 3: this share of the set flagged, or more. */
2965
+ declare const FLAGGED_TARGET = 0.9;
2966
+ /** Target 2: this share of the human set typical, or less. */
2967
+ declare const HUMAN_TYPICAL_TARGET = 0.1;
2968
+ interface MeasuredPage {
2969
+ id: string;
2970
+ label: Label;
2971
+ /** Every catalogue tell found on the page, each once. */
2972
+ tells: string[];
2973
+ /** Findings in the blocking tier. */
2974
+ blocking: number;
2975
+ /** Against the pooled null models; absent when none were given. */
2976
+ typicality?: {
2977
+ score: number;
2978
+ typical: boolean;
2979
+ };
2980
+ }
2981
+ interface UnmeasuredPage {
2982
+ id: string;
2983
+ label: Label;
2984
+ reason: string;
2985
+ }
2986
+ interface LabelSummary {
2987
+ label: Label;
2988
+ pages: number;
2989
+ flagged: number;
2990
+ typical: number | null;
2991
+ tellHeavy: number;
2992
+ blocking: number;
2993
+ }
2994
+ interface TellRate {
2995
+ tell: string;
2996
+ hits: Record<Label, number>;
2997
+ /** Hits on `ai` and `ai-looking` pages over all hits. */
2998
+ precision: number;
2999
+ /** `ai` and `ai-looking` pages hit, over all of them measured. Null when there are none. */
3000
+ recall: number | null;
3001
+ }
3002
+ interface TargetCheck {
3003
+ target: string;
3004
+ /** Null when no page with that label was measured. */
3005
+ met: boolean | null;
3006
+ detail: string;
3007
+ }
3008
+ interface Calibration {
3009
+ pages: number;
3010
+ /** Whether typicality was measured, or tell-heavy alone decided. */
3011
+ typicality: boolean;
3012
+ labels: LabelSummary[];
3013
+ tells: TellRate[];
3014
+ /** Catalogue tells that fired on no page. */
3015
+ silent: string[];
3016
+ targets: TargetCheck[];
3017
+ unmeasured: UnmeasuredPage[];
3018
+ }
3019
+ /** Tells about the look, not the words: what "tell-heavy" counts. */
3020
+ declare function designTells(tells: string[]): string[];
3021
+ declare function isFlagged(page: MeasuredPage): boolean;
3022
+ declare function calibrate(pages: MeasuredPage[], unmeasured?: UnmeasuredPage[]): Calibration;
3023
+ /** `notes` are lines the caller knows and the numbers do not show, printed under the heading. */
3024
+ declare function formatCalibration(c: Calibration, notes?: string[]): string;
3025
+
2879
3026
  /**
2880
3027
  * The character report: the three signals and the reason rule, read together.
2881
3028
  *
@@ -2951,4 +3098,4 @@ declare function characterReport(input: CharacterInputs, copyTells?: Set<string>
2951
3098
 
2952
3099
  declare function retrofitPlan(report: CharacterReport, direction?: ArtDirection | null): string;
2953
3100
 
2954
- export { ACCENT_SCALE, ACCENT_SHARED, AI_PHRASES, AI_SOURCE_TYPES, AI_VIOLET, AI_WORDS, type AccentFork, type AccentForkOptions, type Action, type ActionPosition, type Area, type ArtDirection, BASELINE_VERSION, BUZZWORDS, type Baseline, type BaselineEntry, CATALOGUE, CATALOGUE_VERSION, CHOICE_KEYS, COMPONENT_ROLES, CONSIDERATION, CONVENTION, CUSTOMER_KINDS, type CandidateKind, type CharacterInputs, type CharacterReport, type CheckOptions, type CheckReport, type CheckRestraintInput, type ChoiceKey, type Claim, type ClaimsReport, type CompetitorComparison, type ComponentPair, type ComponentTypicality, type Consideration, type ContrastCheck, type ContrastReport, type CopySide, type CopyTell, type CraftConfig, type CraftTokensInput, type CraftTokensResult, type CustomerKind, DEFAULT_IGNORE, DENSITIES, DENSITY_NAMES, DIRECTION_VERSION, DIRECTION_VERSIONS, DISTANCE_WEIGHTS, DURATION_MS, DURATION_S, type DensityCssOptions, type DensityName, type DirectionChoice, type DirectionComparison, type DirectionMatch, type DirectionProblem, type DirectionReport, type DirectionSource, type DirectionSummary, 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, FUNCTION_WORDS, type Fact, type FactComparison, type FactKind, type Finding, type Fingerprint, type FingerprintDistance, type FingerprintSection, type FluidSpaceOptions, type FluidTypeOptions, type FluidTypeResult, type FontClass, GROUND_SCALE, GROUND_SHARED, type Gamut, type Generation, HIERARCHY_FIELDS, HOME_FILE, HOME_URL, 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, type JobContext, type JobMap, type JobPart, LICENCES, LIGHTNESS_CURVE, type LicenceEntry, type LicenceSubject, MIN_DECIDED, MIN_RUNS, MOOD, type MotionDecision, type MotionKind, type MultiClient, NEGATIVE_REASSURANCE, NULL_VERSION, type NullModel, type NullRun, type Oklch, type OklchToHexOptions, PAGE_TYPES, PILL_LIMIT, PLAINER_WORDS, PREFERENCE, PROMO_BADGE, PROOF_NAMES, PROPOSED, PROVENANCE_SCAN_BYTES, type PageCopy, type PageHierarchy, type PageResult, type PageType, 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 ReasonInput, type RenderedTell, type ResearchInput, type RestraintBudget, type RestraintReport, type RestraintSeverity, type RestraintViolation, type Rgb, type RgbaImage, SCALE, SECTION_ROLES, SHADCN_LIMIT, SHADCN_PRIMITIVES, SHARED_PART, SIBLING_AT, SNAPSHOT_VERSION, SOURCE_KINDS, SPACE_STEPS, SPECIFICITY_COPY_TELLS, SPECIFICITY_RENDERED_TELLS, SPRING, STANDING_CLAIM, STOCK_AVATAR_HOSTS, STOCK_FIGURES, 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 ShapeFeatures, 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 Specific, type SpecificKind, type Specificity, type Surface, TELL_HEAVY, TRADE_NOUNS, TYPE_STEPS, TYPICAL_AT, type TailwindPreset, type Tell, type TellException, type Tricolon, type TypeStep, type Typicality, VAGUE_WORDS, type ValidateContext, type Verdict, accentFork, addSite, apcaContrast, applyBaseline, applyHouseGate, applySeverity, auditSnapshot, briefTerms, catalogueTable, characterReport, checkCopy, checkOrder, checkPair, checkReason, checkRestraint, choicesOf, clauseDepth, closestComponents, compareCompetitor, compareDirections, compareFacts, compareToDeclared, compareToEstate, componentDistance, componentShared, componentTypicalities, componentTypicality, componentsOf, contentWords, countWords, craftTokens, createBaseline, cv, deltaEOk, deltaEOkHex, densityCss, densityTokens, emitCss, emptyEstate, estateComponentPairs, estatePairs, exitDuration, extractHtml, faceLicence, findClaims, findColours, findingKey, fingerprint, fingerprintDistance, fluidClamp, fluidSpace, fluidType, fontClass, formatClaims, formatComparison, formatCompetitor, formatDirectionMatches, formatHex, formatReport, globToRegExp, groundName, harvest, hedgeCount, hedgedClose, hexToOklch, holdHouseBlocks, houseRule, hueName, hueSwatch, ignoreMatcher, inP3Gamut, inSrgbGamut, initDirection, isAiViolet, isBlurb, isCategoryLabel, isCream, jobWords, layoutDistance, licencesJson, makeSnapshot, motionTokens, namedSources, nearest, nominalisations, normaliseFamily, nullPrompt, oklchToHex, oklchToRgb, pageCopy, paletteFromPixels, paragraphUniformity, parseBaseline, parseColour, parseCraftConfig, parseHex, participialClauses, phrasalCoordinations, propose, protectedFacts, ramp, rampFromAnchors, readSnapshot, renderedOrder, researchPrompt, retrofitPlan, runTell, scanProvenance, scanSource, sectionRhythm, semantic, sentencesOf, severityExceptions, shapeMoves, shapeName, shapeOf, words as shapeWords, sharedParts, shouldAnimate, siblingLine, skeleton, skeletonRepeat, specificity, specifics, splitSentences, stackedConditional, stockAvatarSource, stockSource, summariseDirection, tailwindV3Preset, tailwindV4Theme, tellById, toGamut, toJson, toSarif, tradeOf, tricolons, typeFeatureTokens, typicality, unprovenClaims, validateDirection, validateHierarchy, validateJob, visibleText, visualMeasures, wcagContrast, wordListsJson };
3101
+ export { ACCENT_SCALE, ACCENT_SHARED, AI_PHRASES, AI_SOURCE_TYPES, AI_VIOLET, AI_WORDS, type AccentFork, type AccentForkOptions, type Action, type ActionPosition, type Area, type ArtDirection, BASELINE_VERSION, BUZZWORDS, type Baseline, type BaselineEntry, CATALOGUE, CATALOGUE_VERSION, CHOICE_KEYS, COMPONENT_ROLES, CONSIDERATION, CONVENTION, CUSTOMER_KINDS, type Calibration, type CandidateKind, type CharacterInputs, type CharacterReport, type CheckOptions, type CheckReport, type CheckRestraintInput, type ChoiceKey, type Claim, type ClaimsReport, type CompetitorComparison, type ComponentPair, type ComponentTypicality, type Consideration, type ContrastCheck, type ContrastReport, type CopySide, type CopyTell, type CraftConfig, type CraftTokensInput, type CraftTokensResult, type CustomerKind, DEFAULT_IGNORE, DENSITIES, DENSITY_NAMES, DIRECTION_VERSION, DIRECTION_VERSIONS, DISTANCE_WEIGHTS, DURATION_MS, DURATION_S, type DensityCssOptions, type DensityName, type DirectionChoice, type DirectionComparison, type DirectionMatch, type DirectionProblem, type DirectionReport, type DirectionSource, type DirectionSummary, 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, FLAGGED_TARGET, FUNCTION_WORDS, type Fact, type FactComparison, type FactKind, type Finding, type Fingerprint, type FingerprintDistance, type FingerprintSection, type FluidSpaceOptions, type FluidTypeOptions, type FluidTypeResult, type FontClass, GROUND_SCALE, GROUND_SHARED, type Gamut, type Generation, HIERARCHY_FIELDS, HOME_FILE, HOME_URL, HOUSE, HOUSE_BUDGET, HOUSE_LOCKED, HOUSE_TYPE, HUMAN_TYPICAL_TARGET, type HarvestCandidate, type HarvestOptions, type Hit, type HouseRule, type HouseTier, IMAGERY_TELLS, type ImageProvenance, type ImageRole, JSON_SCHEMA_VERSION, type JobContext, type JobMap, type JobPart, LABELS, LEXICAL_FEATURES, LICENCES, LIGHTNESS_CURVE, type Label, type LabelSummary, type LexicalFeatures, type LicenceEntry, type LicenceSubject, MIN_DECIDED, MIN_RUNS, MOOD, type MeasuredPage, type MotionDecision, type MotionKind, type MultiClient, NEGATIVE_REASSURANCE, NULL_VERSION, type NullModel, type NullRun, type Oklch, type OklchToHexOptions, PAGE_TYPES, PILL_LIMIT, PLAINER_WORDS, PREFERENCE, PROMO_BADGE, PROOF_NAMES, PROPOSED, PROVENANCE_SCAN_BYTES, type PageCopy, type PageHierarchy, type PageResult, type PageType, 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 ReasonInput, type RenderedTell, type ResearchInput, type RestraintBudget, type RestraintReport, type RestraintSeverity, type RestraintViolation, type Rgb, type RgbaImage, SCALE, SECTION_ROLES, SHADCN_LIMIT, SHADCN_PRIMITIVES, SHARED_PART, SIBLING_AT, SNAPSHOT_VERSION, SOURCE_KINDS, SPACE_STEPS, SPECIFICITY_COPY_TELLS, SPECIFICITY_RENDERED_TELLS, SPRING, STANDING_CLAIM, STOCK_AVATAR_HOSTS, STOCK_FIGURES, STOCK_PHOTO_HOSTS, STOCK_PHRASES, STUDY_WORDS, type SarifOptions, type SarifTell, type SectionGeometry, type SectionKind, type SectionRhythmOptions, type SectionRole, type SemanticInput, type SemanticResult, type Severity, type SeverityLevel, type SeverityOverride, type ShapeFeatures, 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 Specific, type SpecificKind, type Specificity, type StudyWord, type Surface, TELL_HEAVY, TRADE_NOUNS, TYPE_STEPS, TYPICAL_AT, type TailwindPreset, type TargetCheck, type Tell, type TellException, type TellRate, type Tricolon, type TypeStep, type Typicality, type UnmeasuredPage, VAGUE_WORDS, type ValidateContext, type Verdict, accentFork, addSite, apcaContrast, applyBaseline, applyHouseGate, applySeverity, auditSnapshot, briefTerms, calibrate, catalogueTable, characterReport, checkCopy, checkOrder, checkPair, checkReason, checkRestraint, choicesOf, clauseDepth, closestComponents, compareCompetitor, compareDirections, compareFacts, compareToDeclared, compareToEstate, componentDistance, componentShared, componentTypicalities, componentTypicality, componentsOf, contentWords, countWords, craftTokens, createBaseline, cv, deltaEOk, deltaEOkHex, densityCss, densityTokens, designTells, emitCss, emptyEstate, estateComponentPairs, estatePairs, exitDuration, extractHtml, faceLicence, findClaims, findColours, findingKey, fingerprint, fingerprintDistance, fluidClamp, fluidSpace, fluidType, fontClass, formatCalibration, formatClaims, formatComparison, formatCompetitor, formatDirectionMatches, formatHex, formatReport, globToRegExp, groundName, harvest, hedgeCount, hedgedClose, hexToOklch, holdHouseBlocks, houseRule, hueName, hueSwatch, ignoreMatcher, inP3Gamut, inSrgbGamut, initDirection, isAiViolet, isBlurb, isCategoryLabel, isCream, isFlagged, jobWords, layoutDistance, lexicalOf, licencesJson, makeSnapshot, motionTokens, namedSources, nearest, nominalisations, normaliseFamily, nullPrompt, oklchToHex, oklchToRgb, pageCopy, paletteFromPixels, paragraphUniformity, parseBaseline, parseColour, parseCraftConfig, parseHex, participialClauses, phrasalCoordinations, propose, protectedFacts, ramp, rampFromAnchors, readSnapshot, renderedOrder, researchPrompt, retrofitPlan, runTell, scanProvenance, scanSource, sectionRhythm, semantic, sentencesOf, severityExceptions, shapeMoves, shapeName, shapeOf, words as shapeWords, sharedParts, shouldAnimate, siblingLine, skeleton, skeletonRepeat, specificity, specifics, splitSentences, stackedConditional, stockAvatarSource, stockSource, summariseDirection, tailwindV3Preset, tailwindV4Theme, tellById, toGamut, toJson, toSarif, tradeOf, tricolons, typeFeatureTokens, typicality, unprovenClaims, validateDirection, validateHierarchy, validateJob, visibleText, visualMeasures, vocabulary, vocabularyCounts, wcagContrast, wordListsJson };