/** * How much of an app Reticle can see, and the prompt that asks a coding agent to close the rest. * * Built only from what a page announced (its HELLO channels, plus the `source` / `testid` markers in * the same list) and the gaps its verdicts actually recorded, never from a survey of the page: the * rule `instrumentation-gap.ts` keeps. The platform derives the same three states from the same * report, so the HUD, `doctor` and the dashboard agree: * * missing a verdict recorded the gap that names it (or a channel every SDK has is absent); * a gap about one control does not outrank its channel seen elsewhere * seen its channel or marker was announced * not seen yet neither — never counted as covered */ import { z } from 'zod'; /** The eight things that decide how strong a verdict on this app can be. */ export declare const CoverageCapability: { readonly PAGE_CONNECTED: "page connected"; readonly DOM_ACTIONS: "DOM actions"; readonly NETWORK: "network"; readonly CONSOLE: "console"; readonly APP_STATE: "app state (store registered)"; readonly SIGNALS: "signals on mutation"; readonly SOURCE_MAPPING: "file:line source mapping"; readonly TEST_IDS: "stable test ids"; }; export type CoverageCapability = (typeof CoverageCapability)[keyof typeof CoverageCapability]; /** A recorded gap, as loosely as the daemon and the platform report carry it. */ export interface CoverageGap { kind: string; missing?: string; cost?: string; fix?: string; /** The control the gap is about, when it names one. */ ref?: string; /** `file:line`, when the gap carries one. */ source?: string; } export interface MissingCapability { capability: CoverageCapability; cost: string; fix: string; } export interface Coverage { seen: CoverageCapability[]; missing: MissingCapability[]; /** Neither seen nor reported missing: never counted as covered. */ notSeenYet: CoverageCapability[]; total: number; covered: number; } /** What a page with these channels and these recorded gaps lets Reticle see. Pure. */ export declare function coverageOf(input: { channels: readonly string[]; gaps: readonly CoverageGap[]; }): Coverage; /** * The gaps that would close these capabilities: the ones verdicts recorded (they name the control * and file), else the capability's own fix, so a capability never checked is still named. Pure. */ export declare function gapsToClose(gaps: readonly CoverageGap[], capabilities: readonly CoverageCapability[]): CoverageGap[]; /** The first line of every coverage prompt. */ export declare const AGENT_PROMPT_LEAD = "Read https://reticle.sh/SKILL.md, then improve Reticle's coverage in this repo:"; /** The last line: what the agent hands back. */ export declare const AGENT_PROMPT_TAIL = "Report the coverage line it prints."; /** * The copy-paste prompt for a coding agent: only the gaps verdicts recorded, each with its fix and * what it is missing (and the control or file, when the gap names one), then the verify that proves * the change. The same text the platform builds from the same report. Pure. */ export declare function agentPromptFor(input: { gaps: readonly CoverageGap[]; appName: string; url: string; }): string; /** The capabilities an app reports as not applying to it, on the wire. Closed: core's eight only. */ export declare const NotApplicableSchema: z.ZodArray, "many">; /** The score at which the Harness unlocks. */ export declare const HARNESS_UNLOCK_COVERAGE = 0.8; /** Seen ÷ applicable over the eight capabilities. See the header for the exact rule. */ export declare function coverageScore(coverage: Pick, notApplicable?: readonly CoverageCapability[]): number; export interface HarnessGate { /** seen ÷ applicable, 0..1. */ score: number; /** floor(score × 100). */ percent: number; unlocked: boolean; /** The applicable capabilities not seen, in the order a reader climbs them. */ unseen: CoverageCapability[]; /** The one sentence a refusal says. Absent when unlocked. */ reason?: string; } /** The one sentence a locked Harness answers with. */ export declare const harnessLockedReason: (percent: number, unseen: readonly string[]) => string; /** Whether the Harness may drive an app with this coverage, and the sentence when it may not. */ export declare function harnessGateOf(coverage: Pick, notApplicable?: readonly CoverageCapability[]): HarnessGate; /** * The prompt for the coding agent that closes the gate: each unseen capability with how to close it * (the control and file when a verdict named one), then the one flow that proves it. Pure. */ export declare function harnessUnlockPrompt(input: { coverage: Pick; gaps: readonly CoverageGap[]; appName: string; url: string; notApplicable?: readonly CoverageCapability[]; }): string;