@domandigital/craft 0.16.0 → 0.17.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
@@ -925,6 +925,13 @@ interface Snapshot {
925
925
  * claim, not its menu or its calls to action.
926
926
  */
927
927
  firstScreenText?: string[];
928
+ /**
929
+ * Whether this is a site's home page, set by whoever knows: `craft
930
+ * calibrate` from its labels, and `craft null build` and `null import`,
931
+ * which ask for a home page. Absent, the URL decides (`HOME_URL`), and a
932
+ * local file such as `pages/01.html` never reads as one.
933
+ */
934
+ home?: boolean;
928
935
  /** Set when a version 1 snapshot was read and upgraded in memory. */
929
936
  migratedFrom?: 1;
930
937
  /** The design-system measures trawl has collected since v7, kept so it can switch to this. */
@@ -1600,6 +1607,159 @@ interface LexicalFeatures {
1600
1607
  declare const LEXICAL_FEATURES: readonly (keyof LexicalFeatures)[];
1601
1608
  declare function lexicalOf(text: string, brief?: string): LexicalFeatures;
1602
1609
 
1610
+ /**
1611
+ * Register features: the measures a writer steers by when choosing a register.
1612
+ *
1613
+ * The shape and lexical features ask whether copy reads as generated. These
1614
+ * ask something simpler: how long are the sentences, how often does the
1615
+ * writer say "you", contract a verb or use the passive. Plain writing, a
1616
+ * customer email and a literary paragraph differ on exactly these.
1617
+ *
1618
+ * Pure and zero-dependency, like `shape.ts`, whose sentence splitter and word
1619
+ * counter they share. The calibration readers call the same function, so a
1620
+ * published band describes the measure that ships.
1621
+ *
1622
+ * `passiveShare` is a heuristic: a form of "be" (optionally one adverb) then a
1623
+ * participle, with common adjectival participles ("tired", "interested")
1624
+ * excluded. It misses "get" passives and catches some predicative adjectives.
1625
+ * It is measured, not assumed, before anything relies on it.
1626
+ */
1627
+ interface RegisterFeatures {
1628
+ /** Words per sentence. */
1629
+ meanSentenceWords: number;
1630
+ /** Contracted forms per 100 words: you'll, it's, don't, we're. */
1631
+ contractionsPer100: number;
1632
+ /** you, your, yours, yourself, yourselves per 100 words. */
1633
+ youPer100: number;
1634
+ /** I, me, my, mine, we, us, our, ours per 100 words. */
1635
+ firstPersonPer100: number;
1636
+ /** Share of sentences with a passive construction. */
1637
+ passiveShare: number;
1638
+ /** Letters per word. */
1639
+ meanWordLength: number;
1640
+ }
1641
+ declare const REGISTER_FEATURES: readonly (keyof RegisterFeatures)[];
1642
+ declare function registerOf(text: string): RegisterFeatures;
1643
+
1644
+ /**
1645
+ * Register briefs: how to write in a chosen register, read before drafting.
1646
+ *
1647
+ * `COPY.md` says what every piece of house copy avoids. A register says what a
1648
+ * draft reaches for: plain for a form or a policy, persuasive for a landing
1649
+ * page, warm for a customer email, literary for a premium brand. The brief is
1650
+ * read before drafting and `craft copy` runs afterwards, the order `COPY.md`
1651
+ * sets for its own writing directives.
1652
+ *
1653
+ * Directives are positive ("do this"), never a list of phrases to avoid:
1654
+ * naming a phrase puts it in the writer's head. Each one names its source, and
1655
+ * a directive with no public authority behind it says "house judgement".
1656
+ *
1657
+ * Nothing here measures or grades. `REGISTERS.md` carries the generated text
1658
+ * of this file, bound by a test.
1659
+ */
1660
+ type RegisterId = "plain" | "persuasive" | "warm" | "literary";
1661
+ interface RegisterSource {
1662
+ name: string;
1663
+ url?: string;
1664
+ /** What this register takes from it, and anything it does not. */
1665
+ note: string;
1666
+ }
1667
+ interface Directive {
1668
+ text: string;
1669
+ /** Short source key: a `RegisterSource.name`, `COPY.md`, or "house judgement". */
1670
+ from: string;
1671
+ }
1672
+ interface Register {
1673
+ id: RegisterId;
1674
+ name: string;
1675
+ useFor: string;
1676
+ directives: Directive[];
1677
+ example: {
1678
+ before: string;
1679
+ after: string;
1680
+ why: string;
1681
+ };
1682
+ sources: RegisterSource[];
1683
+ }
1684
+ declare const REGISTERS: readonly Register[];
1685
+ declare const REGISTER_IDS: readonly RegisterId[];
1686
+ declare function getRegister(id: string): Register | undefined;
1687
+ /** The brief as plain text, for reading before a draft or pasting into a prompt. */
1688
+ declare function registerBrief(id: RegisterId): string;
1689
+ /** The generated block of REGISTERS.md. */
1690
+ declare function registersDoc(): string;
1691
+
1692
+ /**
1693
+ * `craft register check`: where a draft sits against the human baselines.
1694
+ *
1695
+ * A single short passage cannot be placed: at blurb length the registers
1696
+ * overlap too much (calibration/copy-shape/report-registers.md). Averaged over
1697
+ * five paragraphs, every register pair separates on several features. So the
1698
+ * check reads documents only, measures each blurb-sized paragraph with the
1699
+ * same functions the baselines used, averages them, and compares the average
1700
+ * with the document-level bands in `profile.ts`.
1701
+ *
1702
+ * It reports, never grades: which features fall outside the chosen
1703
+ * register's usual range, and which baseline the draft reads closest to.
1704
+ * `COPY.md` "Style is not evidence" applies: no score, no verdict.
1705
+ */
1706
+
1707
+ interface Band {
1708
+ p10: number;
1709
+ p50: number;
1710
+ p90: number;
1711
+ sd: number;
1712
+ /** Baseline registers this feature separates this one from, at document level. */
1713
+ separates: string[];
1714
+ }
1715
+ /** Baseline register -> feature -> band. */
1716
+ type RegisterProfile = Readonly<Record<string, Readonly<Record<string, Band>>>>;
1717
+ /** Which baseline each brief is compared with, and what that baseline is not. */
1718
+ declare const REGISTER_BASELINE: Readonly<Record<RegisterId, {
1719
+ baseline: string;
1720
+ note: string;
1721
+ }>>;
1722
+ declare const MIN_PARAGRAPHS = 5;
1723
+ /**
1724
+ * Features that measure what a text is about, not how it is written. Enron is
1725
+ * dense with deal names and figures because of its subject, not its register,
1726
+ * so these stay in the separation report but out of the check: a warm email
1727
+ * about a kitchen refit should not be told it names too few people.
1728
+ */
1729
+ declare const CONTENT_FEATURES: ReadonlySet<string>;
1730
+ interface Outside {
1731
+ feature: string;
1732
+ value: number;
1733
+ band: [number, number];
1734
+ direction: "higher" | "lower";
1735
+ sentence: string;
1736
+ }
1737
+ interface RegisterCheck {
1738
+ register: RegisterId;
1739
+ baseline: string;
1740
+ /** Blurb-sized paragraphs measured. */
1741
+ paragraphs: number;
1742
+ /** False under MIN_PARAGRAPHS: nothing is compared. */
1743
+ measured: boolean;
1744
+ means: Record<string, number>;
1745
+ outside: Outside[];
1746
+ /** Standardised distance to each baseline's median, closest first. */
1747
+ nearest: {
1748
+ register: string;
1749
+ distance: number;
1750
+ }[];
1751
+ note: string;
1752
+ summary: string;
1753
+ }
1754
+ declare const featureLabel: (f: string) => string;
1755
+ /** Paragraphs as the baselines read them: blank lines split, headings dropped. */
1756
+ declare function documentParagraphs(text: string): string[];
1757
+ declare function checkRegister(text: string, id: RegisterId, profile: RegisterProfile): RegisterCheck;
1758
+
1759
+ declare const PROFILE_PARAGRAPHS = 5;
1760
+ declare const PROFILE_MEASURED = "2026-09-30";
1761
+ declare const PROFILE: RegisterProfile;
1762
+
1603
1763
  /**
1604
1764
  * Specificity tells: a page that could belong to anyone.
1605
1765
  *
@@ -2993,6 +3153,8 @@ interface LabelSummary {
2993
3153
  }
2994
3154
  interface TellRate {
2995
3155
  tell: string;
3156
+ /** The catalogue generation it belongs to; null for a tell the catalogue no longer holds. */
3157
+ generation: number | null;
2996
3158
  hits: Record<Label, number>;
2997
3159
  /** Hits on `ai` and `ai-looking` pages over all hits. */
2998
3160
  precision: number;
@@ -3098,4 +3260,4 @@ declare function characterReport(input: CharacterInputs, copyTells?: Set<string>
3098
3260
 
3099
3261
  declare function retrofitPlan(report: CharacterReport, direction?: ArtDirection | null): string;
3100
3262
 
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 };
3263
+ 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 Band, type Baseline, type BaselineEntry, CATALOGUE, CATALOGUE_VERSION, CHOICE_KEYS, COMPONENT_ROLES, CONSIDERATION, CONTENT_FEATURES, 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_PARAGRAPHS, 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, PROFILE, PROFILE_MEASURED, PROFILE_PARAGRAPHS, 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, REGISTERS, REGISTER_BASELINE, REGISTER_FEATURES, REGISTER_IDS, RENDERED_PATHS, RENDERED_TELLS, REVEAL_LIMIT, REVIEW_PHRASES, type Ramp, type RampFromAnchorsOptions, type RampOptions, type RampStep, type ReasonInput, type Register, type RegisterCheck, type RegisterFeatures, type RegisterId, type RegisterProfile, 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, checkRegister, checkRestraint, choicesOf, clauseDepth, closestComponents, compareCompetitor, compareDirections, compareFacts, compareToDeclared, compareToEstate, componentDistance, componentShared, componentTypicalities, componentTypicality, componentsOf, contentWords, countWords, craftTokens, createBaseline, cv, deltaEOk, deltaEOkHex, densityCss, densityTokens, designTells, documentParagraphs, emitCss, emptyEstate, estateComponentPairs, estatePairs, exitDuration, extractHtml, faceLicence, featureLabel, findClaims, findColours, findingKey, fingerprint, fingerprintDistance, fluidClamp, fluidSpace, fluidType, fontClass, formatCalibration, formatClaims, formatComparison, formatCompetitor, formatDirectionMatches, formatHex, formatReport, getRegister, 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, registerBrief, registerOf, registersDoc, 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
@@ -925,6 +925,13 @@ interface Snapshot {
925
925
  * claim, not its menu or its calls to action.
926
926
  */
927
927
  firstScreenText?: string[];
928
+ /**
929
+ * Whether this is a site's home page, set by whoever knows: `craft
930
+ * calibrate` from its labels, and `craft null build` and `null import`,
931
+ * which ask for a home page. Absent, the URL decides (`HOME_URL`), and a
932
+ * local file such as `pages/01.html` never reads as one.
933
+ */
934
+ home?: boolean;
928
935
  /** Set when a version 1 snapshot was read and upgraded in memory. */
929
936
  migratedFrom?: 1;
930
937
  /** The design-system measures trawl has collected since v7, kept so it can switch to this. */
@@ -1600,6 +1607,159 @@ interface LexicalFeatures {
1600
1607
  declare const LEXICAL_FEATURES: readonly (keyof LexicalFeatures)[];
1601
1608
  declare function lexicalOf(text: string, brief?: string): LexicalFeatures;
1602
1609
 
1610
+ /**
1611
+ * Register features: the measures a writer steers by when choosing a register.
1612
+ *
1613
+ * The shape and lexical features ask whether copy reads as generated. These
1614
+ * ask something simpler: how long are the sentences, how often does the
1615
+ * writer say "you", contract a verb or use the passive. Plain writing, a
1616
+ * customer email and a literary paragraph differ on exactly these.
1617
+ *
1618
+ * Pure and zero-dependency, like `shape.ts`, whose sentence splitter and word
1619
+ * counter they share. The calibration readers call the same function, so a
1620
+ * published band describes the measure that ships.
1621
+ *
1622
+ * `passiveShare` is a heuristic: a form of "be" (optionally one adverb) then a
1623
+ * participle, with common adjectival participles ("tired", "interested")
1624
+ * excluded. It misses "get" passives and catches some predicative adjectives.
1625
+ * It is measured, not assumed, before anything relies on it.
1626
+ */
1627
+ interface RegisterFeatures {
1628
+ /** Words per sentence. */
1629
+ meanSentenceWords: number;
1630
+ /** Contracted forms per 100 words: you'll, it's, don't, we're. */
1631
+ contractionsPer100: number;
1632
+ /** you, your, yours, yourself, yourselves per 100 words. */
1633
+ youPer100: number;
1634
+ /** I, me, my, mine, we, us, our, ours per 100 words. */
1635
+ firstPersonPer100: number;
1636
+ /** Share of sentences with a passive construction. */
1637
+ passiveShare: number;
1638
+ /** Letters per word. */
1639
+ meanWordLength: number;
1640
+ }
1641
+ declare const REGISTER_FEATURES: readonly (keyof RegisterFeatures)[];
1642
+ declare function registerOf(text: string): RegisterFeatures;
1643
+
1644
+ /**
1645
+ * Register briefs: how to write in a chosen register, read before drafting.
1646
+ *
1647
+ * `COPY.md` says what every piece of house copy avoids. A register says what a
1648
+ * draft reaches for: plain for a form or a policy, persuasive for a landing
1649
+ * page, warm for a customer email, literary for a premium brand. The brief is
1650
+ * read before drafting and `craft copy` runs afterwards, the order `COPY.md`
1651
+ * sets for its own writing directives.
1652
+ *
1653
+ * Directives are positive ("do this"), never a list of phrases to avoid:
1654
+ * naming a phrase puts it in the writer's head. Each one names its source, and
1655
+ * a directive with no public authority behind it says "house judgement".
1656
+ *
1657
+ * Nothing here measures or grades. `REGISTERS.md` carries the generated text
1658
+ * of this file, bound by a test.
1659
+ */
1660
+ type RegisterId = "plain" | "persuasive" | "warm" | "literary";
1661
+ interface RegisterSource {
1662
+ name: string;
1663
+ url?: string;
1664
+ /** What this register takes from it, and anything it does not. */
1665
+ note: string;
1666
+ }
1667
+ interface Directive {
1668
+ text: string;
1669
+ /** Short source key: a `RegisterSource.name`, `COPY.md`, or "house judgement". */
1670
+ from: string;
1671
+ }
1672
+ interface Register {
1673
+ id: RegisterId;
1674
+ name: string;
1675
+ useFor: string;
1676
+ directives: Directive[];
1677
+ example: {
1678
+ before: string;
1679
+ after: string;
1680
+ why: string;
1681
+ };
1682
+ sources: RegisterSource[];
1683
+ }
1684
+ declare const REGISTERS: readonly Register[];
1685
+ declare const REGISTER_IDS: readonly RegisterId[];
1686
+ declare function getRegister(id: string): Register | undefined;
1687
+ /** The brief as plain text, for reading before a draft or pasting into a prompt. */
1688
+ declare function registerBrief(id: RegisterId): string;
1689
+ /** The generated block of REGISTERS.md. */
1690
+ declare function registersDoc(): string;
1691
+
1692
+ /**
1693
+ * `craft register check`: where a draft sits against the human baselines.
1694
+ *
1695
+ * A single short passage cannot be placed: at blurb length the registers
1696
+ * overlap too much (calibration/copy-shape/report-registers.md). Averaged over
1697
+ * five paragraphs, every register pair separates on several features. So the
1698
+ * check reads documents only, measures each blurb-sized paragraph with the
1699
+ * same functions the baselines used, averages them, and compares the average
1700
+ * with the document-level bands in `profile.ts`.
1701
+ *
1702
+ * It reports, never grades: which features fall outside the chosen
1703
+ * register's usual range, and which baseline the draft reads closest to.
1704
+ * `COPY.md` "Style is not evidence" applies: no score, no verdict.
1705
+ */
1706
+
1707
+ interface Band {
1708
+ p10: number;
1709
+ p50: number;
1710
+ p90: number;
1711
+ sd: number;
1712
+ /** Baseline registers this feature separates this one from, at document level. */
1713
+ separates: string[];
1714
+ }
1715
+ /** Baseline register -> feature -> band. */
1716
+ type RegisterProfile = Readonly<Record<string, Readonly<Record<string, Band>>>>;
1717
+ /** Which baseline each brief is compared with, and what that baseline is not. */
1718
+ declare const REGISTER_BASELINE: Readonly<Record<RegisterId, {
1719
+ baseline: string;
1720
+ note: string;
1721
+ }>>;
1722
+ declare const MIN_PARAGRAPHS = 5;
1723
+ /**
1724
+ * Features that measure what a text is about, not how it is written. Enron is
1725
+ * dense with deal names and figures because of its subject, not its register,
1726
+ * so these stay in the separation report but out of the check: a warm email
1727
+ * about a kitchen refit should not be told it names too few people.
1728
+ */
1729
+ declare const CONTENT_FEATURES: ReadonlySet<string>;
1730
+ interface Outside {
1731
+ feature: string;
1732
+ value: number;
1733
+ band: [number, number];
1734
+ direction: "higher" | "lower";
1735
+ sentence: string;
1736
+ }
1737
+ interface RegisterCheck {
1738
+ register: RegisterId;
1739
+ baseline: string;
1740
+ /** Blurb-sized paragraphs measured. */
1741
+ paragraphs: number;
1742
+ /** False under MIN_PARAGRAPHS: nothing is compared. */
1743
+ measured: boolean;
1744
+ means: Record<string, number>;
1745
+ outside: Outside[];
1746
+ /** Standardised distance to each baseline's median, closest first. */
1747
+ nearest: {
1748
+ register: string;
1749
+ distance: number;
1750
+ }[];
1751
+ note: string;
1752
+ summary: string;
1753
+ }
1754
+ declare const featureLabel: (f: string) => string;
1755
+ /** Paragraphs as the baselines read them: blank lines split, headings dropped. */
1756
+ declare function documentParagraphs(text: string): string[];
1757
+ declare function checkRegister(text: string, id: RegisterId, profile: RegisterProfile): RegisterCheck;
1758
+
1759
+ declare const PROFILE_PARAGRAPHS = 5;
1760
+ declare const PROFILE_MEASURED = "2026-09-30";
1761
+ declare const PROFILE: RegisterProfile;
1762
+
1603
1763
  /**
1604
1764
  * Specificity tells: a page that could belong to anyone.
1605
1765
  *
@@ -2993,6 +3153,8 @@ interface LabelSummary {
2993
3153
  }
2994
3154
  interface TellRate {
2995
3155
  tell: string;
3156
+ /** The catalogue generation it belongs to; null for a tell the catalogue no longer holds. */
3157
+ generation: number | null;
2996
3158
  hits: Record<Label, number>;
2997
3159
  /** Hits on `ai` and `ai-looking` pages over all hits. */
2998
3160
  precision: number;
@@ -3098,4 +3260,4 @@ declare function characterReport(input: CharacterInputs, copyTells?: Set<string>
3098
3260
 
3099
3261
  declare function retrofitPlan(report: CharacterReport, direction?: ArtDirection | null): string;
3100
3262
 
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 };
3263
+ 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 Band, type Baseline, type BaselineEntry, CATALOGUE, CATALOGUE_VERSION, CHOICE_KEYS, COMPONENT_ROLES, CONSIDERATION, CONTENT_FEATURES, 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_PARAGRAPHS, 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, PROFILE, PROFILE_MEASURED, PROFILE_PARAGRAPHS, 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, REGISTERS, REGISTER_BASELINE, REGISTER_FEATURES, REGISTER_IDS, RENDERED_PATHS, RENDERED_TELLS, REVEAL_LIMIT, REVIEW_PHRASES, type Ramp, type RampFromAnchorsOptions, type RampOptions, type RampStep, type ReasonInput, type Register, type RegisterCheck, type RegisterFeatures, type RegisterId, type RegisterProfile, 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, checkRegister, checkRestraint, choicesOf, clauseDepth, closestComponents, compareCompetitor, compareDirections, compareFacts, compareToDeclared, compareToEstate, componentDistance, componentShared, componentTypicalities, componentTypicality, componentsOf, contentWords, countWords, craftTokens, createBaseline, cv, deltaEOk, deltaEOkHex, densityCss, densityTokens, designTells, documentParagraphs, emitCss, emptyEstate, estateComponentPairs, estatePairs, exitDuration, extractHtml, faceLicence, featureLabel, findClaims, findColours, findingKey, fingerprint, fingerprintDistance, fluidClamp, fluidSpace, fluidType, fontClass, formatCalibration, formatClaims, formatComparison, formatCompetitor, formatDirectionMatches, formatHex, formatReport, getRegister, 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, registerBrief, registerOf, registersDoc, 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 };