/** * Pure scoring aggregation (M7). The published formula and its weights live * here (mirrored verbatim in `METHODOLOGY.md`); `SCORE_WEIGHTS` is the single * source of truth. No network, no judge - deterministic given the mentions. */ import type { BrandProfile, EngineId, EngineKind, EngineScore, MentionResult, ShareOfVoiceRow, SourceRow } from '../types.js'; /** * The scoring methodology version. Bump this whenever the formula or a weight * that changes the number is touched, so a `diff` across releases can flag that * a delta is methodology-driven, not a real visibility move (rule #2). Snapshots * from before this field existed carry no version and read as "changed" against * a versioned run. History: v1 = 1/avgPosition; v2 = coverage-aware position + * mid-rank credit for unranked mentions; v3 = the grounded premium is earned by * ACTUAL retrieval per answer, not by having requested grounded mode. */ export declare const SCORING_VERSION = 3; /** * Published scoring weights (source of truth for `METHODOLOGY.md`). Update the * date when you touch a number, and update the doc + its worked example. */ export declare const SCORE_WEIGHTS: { /** Weight of mention rate in an engine's 0-1 raw score. */ mention: number; /** Weight of the position component. */ position: number; /** Max +/- swing applied by average sentiment (±15%). */ sentimentSwing: number; /** Composite weight of a grounded engine (cites sources). */ groundedWeight: number; /** Composite weight of a parametric engine. */ parametricWeight: number; /** * Default rank credited to a mention with no parsed numbered position (prose * praise). A conservative mid-list rank: present in the conversation, but not * asserted as the top pick. Keeps "mentioned-without-a-rank" from scoring the * same as "absent". */ unrankedMentionRank: number; lastUpdated: string; }; /** * Approximate run-to-run retrieval variance per engine (Profound fanout study, * as of Apr 2026). HIGH-variance engines rewrite the prompt heavily before * searching (ChatGPT ~91% unique queries per run), so a per-engine score is a * wider estimate and benefits from more samples; near-stable engines (Perplexity * ~14%) vary little. This is HONEST FRAMING ONLY - it never adjusts the score * (fake-precision copy rule). Values are approximate and dated, like * `MODEL_PRICING`; anthropic/gemini are inferred (parametric vs grounding) and * least certain - re-verify at the M17 smoke test. */ export declare const RETRIEVAL_STABILITY: { source: string; asOf: string; lastUpdated: string; variance: Record; }; /** Qualitative retrieval variance for an engine; defaults to `low` if unknown. */ export declare function retrievalVariance(engine: EngineId): 'high' | 'low'; /** Aggregate one engine's per-answer results into an {@link EngineScore}. */ export declare function scoreEngine(engine: EngineId, kind: EngineKind, results: MentionResult[], retrievedAnswers?: number): EngineScore; /** * The composite weight an engine has earned. * * `kind` records the mode that was REQUESTED, and a grounded-mode call is a * request the model can decline (7 of 8 OpenAI answers did, live, on * 2026-07-20). So the grounded premium is earned in proportion to the share of * the engine's answers that actually retrieved, rather than handed over for * asking. This is a strict generalization: an engine whose answers all * retrieved still weighs `groundedWeight`, a parametric engine still weighs * `parametricWeight`, and only the mislabeled middle moves. * * A grounded score with no `retrievedAnswers` count comes from a snapshot * written before this was measured; it keeps the full premium, so re-scoring * an old snapshot reproduces the number it reported. */ export declare function effectiveWeight(engine: EngineScore): number; /** * Weighted mean of engine scores; engines that retrieved weight higher. * * `null` when nothing was measured (no engines scored). An unmeasured brand has * NO score - it is not a brand that scored zero, and a fabricated 0 is * indistinguishable from "never recommended" (rule #6). Mirrors M14's * `feedScore: number | null` over an unevaluated feed. */ export declare function compositeScore(engines: EngineScore[]): number | null; /** Share-of-voice over brand + profile competitors, most-mentioned first. */ export declare function shareOfVoice(results: MentionResult[], profile: BrandProfile): ShareOfVoiceRow[]; /** Aggregate cited domains across all answers, most-cited first. */ export declare function aggregateSources(results: MentionResult[]): SourceRow[];