import { D as DocBridgeConfigV1, a as DocumentationAuditConfig, R as RulesConfig, b as RuleId, c as RuleSeverity, d as DocumentationStandardRuleId } from './index-CimDq6_e.js'; export { A as AgentCorpusConfig, C as ConfigNotFoundError, e as DocBridgeConfigV1Schema, f as DocumentationAuditConfigSchema, g as DocumentationStandardRuleIdSchema, h as DocumentationStandardV1Config, i as DocumentationStandardV1ConfigSchema, E as EcosystemContractEvidenceSchema, L as LoadConfigOptions, j as LoadConfigResult, k as ReportConfig, l as ReportConfigSchema, m as RepositorySafetyConfig, n as RepositorySafetyConfigSchema, o as RuleIdSchema, p as RuleSeveritySchema, q as RulesConfigSchema, W as WorkflowConfig, r as WorkflowConfigSchema, s as applyConfigDefaults, t as defineConfig, u as loadConfig, v as projectRootFromConfigPath, w as resolveProjectRoot } from './index-CimDq6_e.js'; import { z } from 'zod'; import { GraphologyGraph } from 'graphology'; import * as ts from 'typescript'; import { ASTNode } from 'knap'; declare const HANDOFF_SCHEMA_VERSION: 1; declare const AgentQueryModeSchema: z.ZodEnum<{ documentation: "documentation"; discovery: "discovery"; editing: "editing"; debugging: "debugging"; }>; type AgentQueryMode = z.infer; declare const HandoffTargetTypeSchema: z.ZodEnum<{ module: "module"; area: "area"; package: "package"; search: "search"; document: "document"; app: "app"; screen: "screen"; flow: "flow"; component: "component"; intent: "intent"; change: "change"; }>; type HandoffTargetType = z.infer; declare const HandoffTargetSchema: z.ZodObject<{ type: z.ZodEnum<{ module: "module"; area: "area"; package: "package"; search: "search"; document: "document"; app: "app"; screen: "screen"; flow: "flow"; component: "component"; intent: "intent"; change: "change"; }>; id: z.ZodString; path: z.ZodOptional; group: z.ZodOptional; layer: z.ZodOptional; }, z.core.$strict>; type HandoffTarget = z.infer; declare const HandoffBridgeSchema: z.ZodObject<{ humanDoc: z.ZodEnum<{ linked: "linked"; missing: "missing"; external: "external"; }>; action: z.ZodOptional; bootstrap: z.ZodOptional; }, z.core.$strict>; type HandoffBridge = z.infer; /** v1 — canonical AgentHandoff. Legacy payloads may omit schemaVersion. */ declare const AgentHandoffV1Schema: z.ZodObject<{ type: z.ZodLiteral<"agent-handoff">; schemaVersion: z.ZodDefault>; source: z.ZodString; target: z.ZodObject<{ type: z.ZodEnum<{ module: "module"; area: "area"; package: "package"; search: "search"; document: "document"; app: "app"; screen: "screen"; flow: "flow"; component: "component"; intent: "intent"; change: "change"; }>; id: z.ZodString; path: z.ZodOptional; group: z.ZodOptional; layer: z.ZodOptional; }, z.core.$strict>; startHere: z.ZodString; readBeforeEditing: z.ZodArray; editRoots: z.ZodArray; checks: z.ZodArray; humanDoc: z.ZodOptional>; bridge: z.ZodOptional; action: z.ZodOptional; bootstrap: z.ZodOptional; }, z.core.$strict>>; playbookPatterns: z.ZodOptional>; notes: z.ZodArray; related: z.ZodOptional; strength: z.ZodNumber; evidence: z.ZodArray; }, z.core.$strict>>>; explain: z.ZodOptional>>; evidence: z.ZodOptional; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>>; metadata: z.ZodOptional>; budget: z.ZodOptional & z.core.$partial, z.ZodNumber>; }, z.core.$strict>; fits: z.ZodBoolean; order: z.ZodArray>; kept: z.ZodArray>; dropped: z.ZodArray>; tokenMethod: z.ZodLiteral<"approximate">; }, z.core.$strict>>; }, z.core.$strict>; type AgentHandoffV1 = z.infer; /** Accept legacy handoffs without schemaVersion. */ declare const AgentHandoffLegacySchema: z.ZodObject<{ type: z.ZodLiteral<"agent-handoff">; checks: z.ZodArray; humanDoc: z.ZodOptional>; startHere: z.ZodString; metadata: z.ZodOptional>; related: z.ZodOptional; strength: z.ZodNumber; evidence: z.ZodArray; }, z.core.$strict>>>; budget: z.ZodOptional & z.core.$partial, z.ZodNumber>; }, z.core.$strict>; fits: z.ZodBoolean; order: z.ZodArray>; kept: z.ZodArray>; dropped: z.ZodArray>; tokenMethod: z.ZodLiteral<"approximate">; }, z.core.$strict>>; evidence: z.ZodOptional; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>>; target: z.ZodObject<{ type: z.ZodEnum<{ module: "module"; area: "area"; package: "package"; search: "search"; document: "document"; app: "app"; screen: "screen"; flow: "flow"; component: "component"; intent: "intent"; change: "change"; }>; id: z.ZodString; path: z.ZodOptional; group: z.ZodOptional; layer: z.ZodOptional; }, z.core.$strict>; source: z.ZodString; readBeforeEditing: z.ZodArray; editRoots: z.ZodArray; bridge: z.ZodOptional; action: z.ZodOptional; bootstrap: z.ZodOptional; }, z.core.$strict>>; playbookPatterns: z.ZodOptional>; notes: z.ZodArray; explain: z.ZodOptional>>; schemaVersion: z.ZodOptional>; }, z.core.$strict>; declare const AgentSearchV1Schema: z.ZodObject<{ type: z.ZodLiteral<"agent-search">; schemaVersion: z.ZodDefault>; source: z.ZodString; term: z.ZodString; count: z.ZodNumber; bestMatch: z.ZodNullable; score: z.ZodOptional; refs: z.ZodOptional; }, z.core.$strict>>; matches: z.ZodArray; score: z.ZodOptional; refs: z.ZodOptional; }, z.core.$strict>>; nextCommands: z.ZodArray; telemetry: z.ZodOptional; contextBudgetTokens: z.ZodNumber; mode: z.ZodEnum<{ documentation: "documentation"; discovery: "discovery"; editing: "editing"; debugging: "debugging"; }>; truncated: z.ZodBoolean; }, z.core.$strict>>; }, z.core.$strict>; type AgentSearchV1 = z.infer; declare const normalizeAgentHandoff: (input: unknown) => AgentHandoffV1; declare const INDEX_SCHEMA_VERSION: 1; declare const KnowledgeEntrySchema: z.ZodObject<{ id: z.ZodString; type: z.ZodString; title: z.ZodString; path: z.ZodString; description: z.ZodOptional; body: z.ZodOptional; links: z.ZodOptional>; tags: z.ZodOptional>; symbols: z.ZodOptional>; contentHash: z.ZodOptional; }, z.core.$strict>; /** * Fingerprint of the repository files the index was built from. Freshness can then be checked by * re-hashing the inputs instead of rebuilding the whole index on every query. */ declare const RepositoryInputsSchema: z.ZodObject<{ hash: z.ZodString; fileCount: z.ZodNumber; projectionVersion: z.ZodNumber; incomplete: z.ZodOptional; }, z.core.$strict>; /** * How this index was prepared for ranking. Recorded so a ranking is reproducible: a different * stopword list or a different field weight produces a different artifact, visibly. */ declare const RetrievalMetadataSchema: z.ZodObject<{ lexiconVersion: z.ZodNumber; weights: z.ZodRecord; params: z.ZodOptional>; }, z.core.$strict>; declare const DocBridgeIndexV1Schema: z.ZodObject<{ schemaVersion: z.ZodLiteral<1>; contentHash: z.ZodString; contentHashAlgo: z.ZodLiteral<"sha256-normalized-v1">; generatedAt: z.ZodOptional; project: z.ZodOptional; }, z.core.$strict>>; properties: z.ZodOptional; llms: z.ZodOptional; }, z.core.$strict>>>; knowledge: z.ZodArray; body: z.ZodOptional; links: z.ZodOptional>; tags: z.ZodOptional>; symbols: z.ZodOptional>; contentHash: z.ZodOptional; }, z.core.$strict>>; capabilities: z.ZodOptional; }, z.core.$strict>>>; handoffs: z.ZodOptional; checks: z.ZodArray; humanDoc: z.ZodOptional>; startHere: z.ZodString; metadata: z.ZodOptional>; related: z.ZodOptional; strength: z.ZodNumber; evidence: z.ZodArray; }, z.core.$strict>>>; budget: z.ZodOptional & z.core.$partial, z.ZodNumber>; }, z.core.$strict>; fits: z.ZodBoolean; order: z.ZodArray>; kept: z.ZodArray>; dropped: z.ZodArray>; tokenMethod: z.ZodLiteral<"approximate">; }, z.core.$strict>>; evidence: z.ZodOptional; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>>; target: z.ZodObject<{ type: z.ZodEnum<{ module: "module"; area: "area"; package: "package"; search: "search"; document: "document"; app: "app"; screen: "screen"; flow: "flow"; component: "component"; intent: "intent"; change: "change"; }>; id: z.ZodString; path: z.ZodOptional; group: z.ZodOptional; layer: z.ZodOptional; }, z.core.$strict>; source: z.ZodString; readBeforeEditing: z.ZodArray; editRoots: z.ZodArray; bridge: z.ZodOptional; action: z.ZodOptional; bootstrap: z.ZodOptional; }, z.core.$strict>>; playbookPatterns: z.ZodOptional>; notes: z.ZodArray; explain: z.ZodOptional>>; schemaVersion: z.ZodOptional>; }, z.core.$strict>>>; lookup: z.ZodOptional; ownership: z.ZodOptional; layer: z.ZodOptional; purpose: z.ZodOptional; checks: z.ZodArray; checksSource: z.ZodOptional>; agentDoc: z.ZodOptional; humanDoc: z.ZodOptional; readme: z.ZodOptional; }, z.core.$strict>>>; intents: z.ZodOptional; }, z.core.$strict>>>; changes: z.ZodOptional>; }, z.core.$strict>>>; }, z.core.$strict>>; inputs: z.ZodOptional; }, z.core.$strict>>; retrieval: z.ZodOptional; params: z.ZodOptional>; }, z.core.$strict>>; projection: z.ZodOptional; schemaVersion: z.ZodLiteral<1>; contentHash: z.ZodString; contentHashAlgo: z.ZodLiteral<"sha256-normalized-v1">; snapshotHash: z.ZodString; overlayHash: z.ZodString; configurationHash: z.ZodString; lexiconVersion: z.ZodNumber; graphMetricsVersion: z.ZodString; weights: z.ZodRecord; params: z.ZodObject<{ k1: z.ZodNumber; b: z.ZodNumber; }, z.core.$strict>; lexical: z.ZodObject<{ version: z.ZodNumber; documentCount: z.ZodNumber; fieldNames: z.ZodArray; averageFieldLength: z.ZodRecord; }, z.core.$strict>; entries: z.ZodArray; path: z.ZodString; title: z.ZodString; summary: z.ZodOptional; audience: z.ZodOptional>; aliases: z.ZodArray; symbols: z.ZodOptional>; tags: z.ZodArray; fields: z.ZodObject<{ title: z.ZodString; headings: z.ZodString; path: z.ZodString; symbols: z.ZodString; summary: z.ZodString; body: z.ZodString; aliases: z.ZodString; }, z.core.$strict>; graph: z.ZodObject<{ pagerank: z.ZodNumber; inboundLinks: z.ZodNumber; coveredBy: z.ZodArray; mentionedBy: z.ZodArray; areaId: z.ZodOptional; packageId: z.ZodOptional; inbound: z.ZodArray; }, z.core.$strict>>; outbound: z.ZodArray; }, z.core.$strict>>; }, z.core.$strict>; contentHash: z.ZodString; provenance: z.ZodEnum<{ observed: "observed"; declared: "declared"; proposed: "proposed"; }>; confidence: z.ZodEnum<{ observed: "observed"; declared: "declared"; proposed: "proposed"; fuzzy: "fuzzy"; }>; ownershipId: z.ZodOptional; agentSignal: z.ZodOptional; }, z.core.$strict>>; }, z.core.$strict>>; }, z.core.$strict>; type DocBridgeIndexV1 = z.infer; type KnowledgeEntry = z.infer; type RepositoryInputs = z.infer; type RetrievalMetadata = z.infer; declare const MEMORY_CANDIDATE_SCHEMA_VERSION: 1; declare const MemoryCandidateV1Schema: z.ZodObject<{ schemaVersion: z.ZodLiteral<1>; id: z.ZodString; source: z.ZodEnum<{ manual: "manual"; cursor: "cursor"; claude: "claude"; codex: "codex"; copilot: "copilot"; "agent-memory": "agent-memory"; }>; rawPath: z.ZodOptional; fact: z.ZodString; why: z.ZodOptional; howToApply: z.ZodOptional; suggestedType: z.ZodEnum<{ unknown: "unknown"; project: "project"; user: "user"; feedback: "feedback"; reference: "reference"; }>; confidence: z.ZodNumber; references: z.ZodArray; }, z.core.$strict>; type MemoryCandidateV1 = z.infer; type JsonSchema = { readonly [key: string]: unknown; }; declare const AgentHandoffV1JsonSchema: { readonly $schema: "https://json-schema.org/draft/2020-12/schema"; readonly $id: "https://agentskit.io/schemas/doc-bridge/agent-handoff-v1.schema.json"; readonly title: "AgentHandoff v1"; readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["type", "schemaVersion", "source", "target", "startHere", "readBeforeEditing", "editRoots", "checks", "notes"]; readonly properties: { readonly type: { readonly const: "agent-handoff"; }; readonly schemaVersion: { readonly const: 1; }; readonly source: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 512; }; readonly target: { readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["type", "id"]; readonly properties: { readonly type: { readonly enum: readonly ["package", "area", "module", "document", "app", "screen", "flow", "component", "intent", "change", "search"]; }; readonly id: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 256; }; readonly path: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 512; }; readonly group: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 128; }; readonly layer: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 32; }; }; }; readonly startHere: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 512; }; readonly readBeforeEditing: JsonSchema; readonly editRoots: JsonSchema; readonly checks: JsonSchema; readonly humanDoc: { readonly anyOf: readonly [{ readonly type: "string"; readonly minLength: 1; readonly maxLength: 512; }, { readonly type: "null"; }]; }; readonly playbookPatterns: { readonly type: "array"; readonly items: { readonly type: "string"; readonly format: "uri"; }; readonly maxItems: 16; }; readonly notes: JsonSchema; readonly related: { readonly type: "array"; readonly maxItems: 16; readonly items: { readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["id", "path", "direction", "strength", "evidence"]; readonly properties: { readonly id: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 256; }; readonly path: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 512; }; readonly direction: { readonly enum: readonly ["imports", "imported-by"]; }; readonly strength: { readonly type: "integer"; readonly minimum: 1; }; readonly evidence: JsonSchema; }; }; }; readonly explain: { readonly type: "object"; readonly additionalProperties: JsonSchema; }; readonly evidence: { readonly type: "array"; readonly maxItems: 32; readonly items: { readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["source", "path"]; readonly properties: { readonly source: { readonly enum: readonly ["code", "configuration", "documentation", "agent", "derived"]; }; readonly path: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 512; }; readonly lineStart: { readonly type: "integer"; readonly minimum: 1; }; readonly lineEnd: { readonly type: "integer"; readonly minimum: 1; }; readonly contentHash: { readonly type: "string"; readonly pattern: "^[a-f0-9]{64}$"; }; readonly context: { readonly type: "string"; readonly maxLength: 1024; }; }; }; }; readonly metadata: { readonly type: "object"; }; }; }; declare const MemoryCandidateV1JsonSchema: { readonly $schema: "https://json-schema.org/draft/2020-12/schema"; readonly $id: "https://agentskit.io/schemas/doc-bridge/memory-candidate-v1.schema.json"; readonly title: "MemoryCandidate v1"; readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["schemaVersion", "id", "source", "fact", "suggestedType", "confidence", "references"]; readonly properties: { readonly schemaVersion: { readonly const: 1; }; readonly id: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 256; }; readonly source: { readonly enum: readonly ["cursor", "claude", "codex", "copilot", "agent-memory", "manual"]; }; readonly rawPath: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 512; }; readonly fact: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 8000; }; readonly why: { readonly type: "string"; readonly maxLength: 4000; }; readonly howToApply: { readonly type: "string"; readonly maxLength: 4000; }; readonly suggestedType: { readonly enum: readonly ["user", "feedback", "project", "reference", "unknown"]; }; readonly confidence: { readonly type: "number"; readonly minimum: 0; readonly maximum: 1; }; readonly references: JsonSchema; }; }; declare const DocBridgeIndexV1JsonSchema: { readonly $schema: "https://json-schema.org/draft/2020-12/schema"; readonly $id: "https://agentskit.io/schemas/doc-bridge/doc-bridge-index-v1.schema.json"; readonly title: "DocBridgeIndex v1"; readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["schemaVersion", "contentHash", "contentHashAlgo", "knowledge"]; readonly properties: { readonly schemaVersion: { readonly const: 1; }; readonly contentHash: { readonly type: "string"; readonly pattern: "^[a-f0-9]{64}$"; }; readonly contentHashAlgo: { readonly const: "sha256-normalized-v1"; }; readonly generatedAt: { readonly type: "string"; readonly format: "date-time"; }; readonly project: { readonly type: "object"; readonly additionalProperties: false; readonly properties: { readonly name: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 128; }; readonly root: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 512; }; }; }; readonly properties: { readonly type: "array"; readonly maxItems: 16; readonly items: { readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["id", "name"]; readonly properties: { readonly id: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 64; }; readonly name: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 128; }; readonly url: { readonly type: "string"; readonly format: "uri"; }; readonly llms: { readonly type: "string"; readonly format: "uri"; }; }; }; }; readonly knowledge: { readonly type: "array"; readonly maxItems: 50000; readonly items: { readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["id", "type", "title", "path"]; readonly properties: { readonly id: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 256; }; readonly type: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 128; }; readonly title: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 256; }; readonly path: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 512; }; readonly description: { readonly type: "string"; readonly maxLength: 2048; }; readonly body: { readonly type: "string"; readonly maxLength: 8000; }; readonly links: JsonSchema; readonly tags: JsonSchema; }; }; }; readonly capabilities: { readonly type: "array"; readonly maxItems: 5000; readonly items: { readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["id", "kind"]; readonly properties: { readonly id: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 256; }; readonly kind: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 64; }; readonly description: { readonly type: "string"; readonly maxLength: 512; }; }; }; }; readonly handoffs: { readonly type: "object"; readonly additionalProperties: { readonly type: "object"; }; }; readonly lookup: { readonly type: "object"; }; }; }; declare const DocBridgeJsonSchemas: { readonly agentHandoffV1: { readonly $schema: "https://json-schema.org/draft/2020-12/schema"; readonly $id: "https://agentskit.io/schemas/doc-bridge/agent-handoff-v1.schema.json"; readonly title: "AgentHandoff v1"; readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["type", "schemaVersion", "source", "target", "startHere", "readBeforeEditing", "editRoots", "checks", "notes"]; readonly properties: { readonly type: { readonly const: "agent-handoff"; }; readonly schemaVersion: { readonly const: 1; }; readonly source: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 512; }; readonly target: { readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["type", "id"]; readonly properties: { readonly type: { readonly enum: readonly ["package", "area", "module", "document", "app", "screen", "flow", "component", "intent", "change", "search"]; }; readonly id: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 256; }; readonly path: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 512; }; readonly group: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 128; }; readonly layer: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 32; }; }; }; readonly startHere: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 512; }; readonly readBeforeEditing: JsonSchema; readonly editRoots: JsonSchema; readonly checks: JsonSchema; readonly humanDoc: { readonly anyOf: readonly [{ readonly type: "string"; readonly minLength: 1; readonly maxLength: 512; }, { readonly type: "null"; }]; }; readonly playbookPatterns: { readonly type: "array"; readonly items: { readonly type: "string"; readonly format: "uri"; }; readonly maxItems: 16; }; readonly notes: JsonSchema; readonly related: { readonly type: "array"; readonly maxItems: 16; readonly items: { readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["id", "path", "direction", "strength", "evidence"]; readonly properties: { readonly id: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 256; }; readonly path: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 512; }; readonly direction: { readonly enum: readonly ["imports", "imported-by"]; }; readonly strength: { readonly type: "integer"; readonly minimum: 1; }; readonly evidence: JsonSchema; }; }; }; readonly explain: { readonly type: "object"; readonly additionalProperties: JsonSchema; }; readonly evidence: { readonly type: "array"; readonly maxItems: 32; readonly items: { readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["source", "path"]; readonly properties: { readonly source: { readonly enum: readonly ["code", "configuration", "documentation", "agent", "derived"]; }; readonly path: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 512; }; readonly lineStart: { readonly type: "integer"; readonly minimum: 1; }; readonly lineEnd: { readonly type: "integer"; readonly minimum: 1; }; readonly contentHash: { readonly type: "string"; readonly pattern: "^[a-f0-9]{64}$"; }; readonly context: { readonly type: "string"; readonly maxLength: 1024; }; }; }; }; readonly metadata: { readonly type: "object"; }; }; }; readonly docBridgeIndexV1: { readonly $schema: "https://json-schema.org/draft/2020-12/schema"; readonly $id: "https://agentskit.io/schemas/doc-bridge/doc-bridge-index-v1.schema.json"; readonly title: "DocBridgeIndex v1"; readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["schemaVersion", "contentHash", "contentHashAlgo", "knowledge"]; readonly properties: { readonly schemaVersion: { readonly const: 1; }; readonly contentHash: { readonly type: "string"; readonly pattern: "^[a-f0-9]{64}$"; }; readonly contentHashAlgo: { readonly const: "sha256-normalized-v1"; }; readonly generatedAt: { readonly type: "string"; readonly format: "date-time"; }; readonly project: { readonly type: "object"; readonly additionalProperties: false; readonly properties: { readonly name: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 128; }; readonly root: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 512; }; }; }; readonly properties: { readonly type: "array"; readonly maxItems: 16; readonly items: { readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["id", "name"]; readonly properties: { readonly id: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 64; }; readonly name: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 128; }; readonly url: { readonly type: "string"; readonly format: "uri"; }; readonly llms: { readonly type: "string"; readonly format: "uri"; }; }; }; }; readonly knowledge: { readonly type: "array"; readonly maxItems: 50000; readonly items: { readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["id", "type", "title", "path"]; readonly properties: { readonly id: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 256; }; readonly type: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 128; }; readonly title: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 256; }; readonly path: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 512; }; readonly description: { readonly type: "string"; readonly maxLength: 2048; }; readonly body: { readonly type: "string"; readonly maxLength: 8000; }; readonly links: JsonSchema; readonly tags: JsonSchema; }; }; }; readonly capabilities: { readonly type: "array"; readonly maxItems: 5000; readonly items: { readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["id", "kind"]; readonly properties: { readonly id: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 256; }; readonly kind: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 64; }; readonly description: { readonly type: "string"; readonly maxLength: 512; }; }; }; }; readonly handoffs: { readonly type: "object"; readonly additionalProperties: { readonly type: "object"; }; }; readonly lookup: { readonly type: "object"; }; }; }; readonly memoryCandidateV1: { readonly $schema: "https://json-schema.org/draft/2020-12/schema"; readonly $id: "https://agentskit.io/schemas/doc-bridge/memory-candidate-v1.schema.json"; readonly title: "MemoryCandidate v1"; readonly type: "object"; readonly additionalProperties: false; readonly required: readonly ["schemaVersion", "id", "source", "fact", "suggestedType", "confidence", "references"]; readonly properties: { readonly schemaVersion: { readonly const: 1; }; readonly id: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 256; }; readonly source: { readonly enum: readonly ["cursor", "claude", "codex", "copilot", "agent-memory", "manual"]; }; readonly rawPath: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 512; }; readonly fact: { readonly type: "string"; readonly minLength: 1; readonly maxLength: 8000; }; readonly why: { readonly type: "string"; readonly maxLength: 4000; }; readonly howToApply: { readonly type: "string"; readonly maxLength: 4000; }; readonly suggestedType: { readonly enum: readonly ["user", "feedback", "project", "reference", "unknown"]; }; readonly confidence: { readonly type: "number"; readonly minimum: 0; readonly maximum: 1; }; readonly references: JsonSchema; }; }; }; declare const KNOWLEDGE_SCHEMA_VERSION: 1; declare const KNOWLEDGE_CONTENT_HASH_ALGO: "sha256-normalized-v1"; declare const ProvenanceSchema: z.ZodEnum<{ observed: "observed"; declared: "declared"; proposed: "proposed"; }>; type Provenance = z.infer; declare const FindingStatusSchema: z.ZodEnum<{ confirmed: "confirmed"; undocumented: "undocumented"; "stale-or-unverified": "stale-or-unverified"; conflict: "conflict"; unresolved: "unresolved"; "not-analyzed": "not-analyzed"; }>; type FindingStatus = z.infer; declare const DiagnosticSeveritySchema: z.ZodEnum<{ error: "error"; off: "off"; info: "info"; warn: "warn"; }>; type DiagnosticSeverity = z.infer; declare const EvidenceSourceSchema: z.ZodEnum<{ agent: "agent"; documentation: "documentation"; code: "code"; configuration: "configuration"; derived: "derived"; }>; declare const EvidenceSchema$1: z.ZodObject<{ source: z.ZodEnum<{ agent: "agent"; documentation: "documentation"; code: "code"; configuration: "configuration"; derived: "derived"; }>; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>; type Evidence = z.infer; declare const CoverageSchema: z.ZodObject<{ analyzer: z.ZodString; analyzerVersion: z.ZodOptional; scope: z.ZodString; status: z.ZodEnum<{ "not-analyzed": "not-analyzed"; complete: "complete"; partial: "partial"; "not-applicable": "not-applicable"; }>; reason: z.ZodOptional; evidence: z.ZodOptional; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>>; }, z.core.$strict>; type Coverage = z.infer; declare const ProjectIdentitySchema: z.ZodObject<{ name: z.ZodString; root: z.ZodOptional; }, z.core.$strict>; declare const EntitySchema: z.ZodObject<{ id: z.ZodString; kind: z.ZodString; name: z.ZodString; path: z.ZodOptional; aliases: z.ZodOptional>; provenance: z.ZodEnum<{ observed: "observed"; declared: "declared"; proposed: "proposed"; }>; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; metadata: z.ZodOptional>; }, z.core.$strict>; type KnowledgeEntity = z.infer; declare const RelationSchema: z.ZodObject<{ id: z.ZodString; kind: z.ZodString; from: z.ZodString; to: z.ZodString; discriminator: z.ZodOptional; provenance: z.ZodEnum<{ observed: "observed"; declared: "declared"; proposed: "proposed"; }>; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; metadata: z.ZodOptional>; }, z.core.$strict>; type KnowledgeRelation = z.infer; declare const DiscoverySnapshotV1Schema: z.ZodObject<{ entities: z.ZodArray; aliases: z.ZodOptional>; provenance: z.ZodEnum<{ observed: "observed"; declared: "declared"; proposed: "proposed"; }>; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; metadata: z.ZodOptional>; }, z.core.$strict>>; relations: z.ZodArray; provenance: z.ZodEnum<{ observed: "observed"; declared: "declared"; proposed: "proposed"; }>; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; metadata: z.ZodOptional>; }, z.core.$strict>>; coverage: z.ZodArray; scope: z.ZodString; status: z.ZodEnum<{ "not-analyzed": "not-analyzed"; complete: "complete"; partial: "partial"; "not-applicable": "not-applicable"; }>; reason: z.ZodOptional; evidence: z.ZodOptional; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>>; }, z.core.$strict>>; schemaVersion: z.ZodLiteral<1>; contentHash: z.ZodString; contentHashAlgo: z.ZodLiteral<"sha256-normalized-v1">; project: z.ZodObject<{ name: z.ZodString; root: z.ZodOptional; }, z.core.$strict>; sourceRevision: z.ZodString; sourceRevisionKind: z.ZodEnum<{ git: "git"; content: "content"; }>; configurationHash: z.ZodString; pipelineVersion: z.ZodString; analyzerVersions: z.ZodRecord; type: z.ZodLiteral<"discovery-snapshot">; }, z.core.$strict>; type DiscoverySnapshotV1 = z.infer; declare const DiagnosticSchema: z.ZodObject<{ id: z.ZodString; code: z.ZodString; status: z.ZodEnum<{ confirmed: "confirmed"; undocumented: "undocumented"; "stale-or-unverified": "stale-or-unverified"; conflict: "conflict"; unresolved: "unresolved"; "not-analyzed": "not-analyzed"; }>; severity: z.ZodEnum<{ error: "error"; off: "off"; info: "info"; warn: "warn"; }>; message: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; entityIds: z.ZodOptional>; relationIds: z.ZodOptional>; remediation: z.ZodOptional; }, z.core.$strict>; type KnowledgeDiagnostic = z.infer; declare const ReconciliationReportV1Schema: z.ZodObject<{ snapshotHash: z.ZodString; diagnostics: z.ZodArray; severity: z.ZodEnum<{ error: "error"; off: "off"; info: "info"; warn: "warn"; }>; message: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; entityIds: z.ZodOptional>; relationIds: z.ZodOptional>; remediation: z.ZodOptional; }, z.core.$strict>>; summary: z.ZodObject<{ entityCount: z.ZodNumber; relationCount: z.ZodNumber; diagnosticCount: z.ZodNumber; scope: z.ZodOptional>; requiredRelationKinds: z.ZodOptional>; requiredRelationTargets: z.ZodOptional>; diagnosticsByCode: z.ZodOptional>; diagnosticsByStatus: z.ZodOptional>; documentation: z.ZodOptional; documentedDocumentClassificationCounts: z.ZodRecord; packageCount: z.ZodNumber; packageStatus: z.ZodObject<{ fresh: z.ZodNumber; stale: z.ZodNumber; missing: z.ZodNumber; unverified: z.ZodNumber; }, z.core.$strict>; }, z.core.$strict>>; }, z.core.$strict>; schemaVersion: z.ZodLiteral<1>; contentHash: z.ZodString; contentHashAlgo: z.ZodLiteral<"sha256-normalized-v1">; project: z.ZodObject<{ name: z.ZodString; root: z.ZodOptional; }, z.core.$strict>; sourceRevision: z.ZodString; sourceRevisionKind: z.ZodEnum<{ git: "git"; content: "content"; }>; configurationHash: z.ZodString; pipelineVersion: z.ZodString; analyzerVersions: z.ZodRecord; type: z.ZodLiteral<"reconciliation-report">; }, z.core.$strict>; type ReconciliationReportV1 = z.infer; declare const WorkflowStateSchema: z.ZodEnum<{ proposed: "proposed"; stale: "stale"; created: "created"; discovering: "discovering"; analyzed: "analyzed"; compared: "compared"; "awaiting-agent": "awaiting-agent"; "awaiting-approval": "awaiting-approval"; validating: "validating"; delivered: "delivered"; failed: "failed"; cancelled: "cancelled"; superseded: "superseded"; }>; type WorkflowState = z.infer; declare const WorkflowStepSchema: z.ZodObject<{ name: z.ZodString; status: z.ZodEnum<{ failed: "failed"; pending: "pending"; running: "running"; completed: "completed"; skipped: "skipped"; }>; inputHash: z.ZodString; outputHash: z.ZodOptional; artifactRefs: z.ZodOptional>; }, z.core.$strict>; declare const WorkflowTransitionSchema: z.ZodObject<{ from: z.ZodNullable>; to: z.ZodEnum<{ proposed: "proposed"; stale: "stale"; created: "created"; discovering: "discovering"; analyzed: "analyzed"; compared: "compared"; "awaiting-agent": "awaiting-agent"; "awaiting-approval": "awaiting-approval"; validating: "validating"; delivered: "delivered"; failed: "failed"; cancelled: "cancelled"; superseded: "superseded"; }>; at: z.ZodString; reason: z.ZodOptional; }, z.core.$strict>; /** Optional identity envelope shared with AgentsKit runtime and Chat events. */ declare const CorrelationContextV1Schema: z.ZodObject<{ operationId: z.ZodString; runId: z.ZodOptional; sessionId: z.ZodOptional; turnId: z.ZodOptional; actionId: z.ZodOptional; traceId: z.ZodOptional; }, z.core.$strict>; type CorrelationContextV1 = z.infer; declare const WorkflowRunV1Schema: z.ZodObject<{ runId: z.ZodString; correlation: z.ZodOptional; sessionId: z.ZodOptional; turnId: z.ZodOptional; actionId: z.ZodOptional; traceId: z.ZodOptional; }, z.core.$strict>>; state: z.ZodEnum<{ proposed: "proposed"; stale: "stale"; created: "created"; discovering: "discovering"; analyzed: "analyzed"; compared: "compared"; "awaiting-agent": "awaiting-agent"; "awaiting-approval": "awaiting-approval"; validating: "validating"; delivered: "delivered"; failed: "failed"; cancelled: "cancelled"; superseded: "superseded"; }>; steps: z.ZodArray; inputHash: z.ZodString; outputHash: z.ZodOptional; artifactRefs: z.ZodOptional>; }, z.core.$strict>>; transitions: z.ZodArray>; to: z.ZodEnum<{ proposed: "proposed"; stale: "stale"; created: "created"; discovering: "discovering"; analyzed: "analyzed"; compared: "compared"; "awaiting-agent": "awaiting-agent"; "awaiting-approval": "awaiting-approval"; validating: "validating"; delivered: "delivered"; failed: "failed"; cancelled: "cancelled"; superseded: "superseded"; }>; at: z.ZodString; reason: z.ZodOptional; }, z.core.$strict>>; artifactRefs: z.ZodArray; schemaVersion: z.ZodLiteral<1>; contentHash: z.ZodString; contentHashAlgo: z.ZodLiteral<"sha256-normalized-v1">; project: z.ZodObject<{ name: z.ZodString; root: z.ZodOptional; }, z.core.$strict>; sourceRevision: z.ZodString; sourceRevisionKind: z.ZodEnum<{ git: "git"; content: "content"; }>; configurationHash: z.ZodString; pipelineVersion: z.ZodString; analyzerVersions: z.ZodRecord; type: z.ZodLiteral<"workflow-run">; }, z.core.$strict>; type WorkflowRunV1 = z.infer; declare const ProposalOriginSchema: z.ZodObject<{ kind: z.ZodEnum<{ deterministic: "deterministic"; "registry-agent": "registry-agent"; manual: "manual"; }>; id: z.ZodOptional; version: z.ZodOptional; provider: z.ZodOptional; model: z.ZodOptional; capabilities: z.ZodOptional>; }, z.core.$strict>; declare const AgentProposalV1Schema: z.ZodObject<{ proposalId: z.ZodString; baseSnapshotHash: z.ZodString; baseReportHash: z.ZodString; baseDocumentationAuditHash: z.ZodOptional; relatedDiagnosticIds: z.ZodArray; rationale: z.ZodString; confidence: z.ZodNumber; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; intendedChanges: z.ZodArray; origin: z.ZodObject<{ kind: z.ZodEnum<{ deterministic: "deterministic"; "registry-agent": "registry-agent"; manual: "manual"; }>; id: z.ZodOptional; version: z.ZodOptional; provider: z.ZodOptional; model: z.ZodOptional; capabilities: z.ZodOptional>; }, z.core.$strict>; checks: z.ZodArray; schemaVersion: z.ZodLiteral<1>; contentHash: z.ZodString; contentHashAlgo: z.ZodLiteral<"sha256-normalized-v1">; project: z.ZodObject<{ name: z.ZodString; root: z.ZodOptional; }, z.core.$strict>; sourceRevision: z.ZodString; sourceRevisionKind: z.ZodEnum<{ git: "git"; content: "content"; }>; configurationHash: z.ZodString; pipelineVersion: z.ZodString; analyzerVersions: z.ZodRecord; type: z.ZodLiteral<"agent-proposal">; }, z.core.$strict>; type AgentProposalV1 = z.infer; declare const FixProposalStatusSchema: z.ZodEnum<{ proposed: "proposed"; stale: "stale"; failed: "failed"; approved: "approved"; rejected: "rejected"; applied: "applied"; }>; declare const AffectedFileSchema: z.ZodObject<{ path: z.ZodString; contentHash: z.ZodString; }, z.core.$strict>; declare const FixChangeSchema: z.ZodObject<{ path: z.ZodString; before: z.ZodString; after: z.ZodString; }, z.core.$strict>; type FixChange = z.infer; declare const FixProposalV1Schema: z.ZodObject<{ proposalId: z.ZodString; baseRevision: z.ZodString; affectedFiles: z.ZodArray>; changes: z.ZodOptional>>; preconditions: z.ZodArray; diff: z.ZodString; postconditions: z.ZodArray; approval: z.ZodOptional>; status: z.ZodEnum<{ proposed: "proposed"; stale: "stale"; failed: "failed"; approved: "approved"; rejected: "rejected"; applied: "applied"; }>; schemaVersion: z.ZodLiteral<1>; contentHash: z.ZodString; contentHashAlgo: z.ZodLiteral<"sha256-normalized-v1">; project: z.ZodObject<{ name: z.ZodString; root: z.ZodOptional; }, z.core.$strict>; sourceRevision: z.ZodString; sourceRevisionKind: z.ZodEnum<{ git: "git"; content: "content"; }>; configurationHash: z.ZodString; pipelineVersion: z.ZodString; analyzerVersions: z.ZodRecord; type: z.ZodLiteral<"fix-proposal">; }, z.core.$strict>; type FixProposalV1 = z.infer; type KnowledgeArtifactV1 = DiscoverySnapshotV1 | ReconciliationReportV1 | WorkflowRunV1 | AgentProposalV1 | FixProposalV1; type ParseIssue = { readonly path: string; readonly message: string; }; type ParseResult = { readonly ok: true; readonly value: T; } | { readonly ok: false; readonly issues: readonly ParseIssue[]; }; declare const safeParseAgentHandoff: (input: unknown) => ParseResult; declare const parseAgentHandoff: (input: unknown) => AgentHandoffV1; declare const parseAgentSearch: (input: unknown) => AgentSearchV1; declare const parseDocBridgeIndex: (input: unknown) => DocBridgeIndexV1; declare const parseMemoryCandidate: (input: unknown) => MemoryCandidateV1; declare const parseDiscoverySnapshot: (input: unknown) => DiscoverySnapshotV1; declare const parseReconciliationReport: (input: unknown) => ReconciliationReportV1; declare const parseWorkflowRun: (input: unknown) => WorkflowRunV1; declare const parseAgentProposal: (input: unknown) => AgentProposalV1; declare const parseFixProposal: (input: unknown) => FixProposalV1; declare const parseDocBridgeConfig: (input: unknown) => DocBridgeConfigV1; /** * Typed enrichment proposals and the overlay that stores what became of them. * * `AgentProposalV1` could say "review this finding"; it could not say that a document is * canonical for an area, that an alias should resolve to an entity, or that a relation exists * with a given confidence. Each of those is a different claim with a different validator and a * different acceptance policy, so each is its own kind here, and the union is closed: a kind * this file does not know is rejected as `invalid-kind` rather than carried along. * * Nothing in an overlay is authority. An accepted entry is layered over the observed snapshot * at projection time, bound to the content hash of the entity it describes, and expires the * moment that hash moves. No entry can delete or alter an observed fact. */ declare const ENRICHMENT_SCHEMA_VERSION: 1; declare const ENRICHMENT_KINDS: readonly ["classify-document", "summarize", "add-alias", "add-intent", "mark-canonical", "propose-relation", "flag-contradiction", "flag-redundancy", "flag-gap", "rank-hint", "suggest-area"]; type EnrichmentKind = (typeof ENRICHMENT_KINDS)[number]; /** * What acceptance means per kind. * * `policy`: low-risk, reversible, and expiring with its target — accepted by the validators. * `human`: structural — a relation, a canonical marker, a conflict — held for a person. * `finding`: accepted by policy, but only ever as a finding to review, never as a fact the * projection ranks on. */ type EnrichmentPolicy = 'policy' | 'human' | 'finding'; declare const ENRICHMENT_POLICY: Readonly>; declare const isEnrichmentKind: (value: unknown) => value is EnrichmentKind; /** Relation kinds an agent may propose. Structural kinds the analyzers observe are not for an agent to assert. */ declare const PROPOSABLE_RELATION_KINDS: readonly ["covers", "mentions", "links-to", "depends-on", "related-to", "documents"]; declare const EnrichmentOriginSchema: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; type EnrichmentOrigin = z.infer; declare const SUMMARY_MAX = 400; declare const ALIAS_MAX = 64; declare const INTENT_MAX = 120; declare const payloads: { readonly 'classify-document': z.ZodObject<{ type: z.ZodEnum<{ index: "index"; reference: "reference"; other: "other"; policy: "policy"; guide: "guide"; runbook: "runbook"; adr: "adr"; spec: "spec"; changelog: "changelog"; }>; audience: z.ZodEnum<{ agent: "agent"; human: "human"; "human-and-agent": "human-and-agent"; }>; lifecycle: z.ZodEnum<{ draft: "draft"; active: "active"; deprecated: "deprecated"; archived: "archived"; }>; criticality: z.ZodEnum<{ "tier-0": "tier-0"; "tier-1": "tier-1"; "tier-2": "tier-2"; }>; }, z.core.$strict>; readonly summarize: z.ZodObject<{ summary: z.ZodString; language: z.ZodString; }, z.core.$strict>; readonly 'add-alias': z.ZodObject<{ alias: z.ZodString; }, z.core.$strict>; readonly 'add-intent': z.ZodObject<{ phrase: z.ZodString; language: z.ZodString; }, z.core.$strict>; readonly 'mark-canonical': z.ZodObject<{ scope: z.ZodString; }, z.core.$strict>; readonly 'propose-relation': z.ZodObject<{ from: z.ZodString; to: z.ZodString; kind: z.ZodEnum<{ covers: "covers"; "links-to": "links-to"; mentions: "mentions"; "depends-on": "depends-on"; documents: "documents"; "related-to": "related-to"; }>; detection: z.ZodString; }, z.core.$strict>; readonly 'flag-contradiction': z.ZodObject<{ against: z.ZodString; claim: z.ZodString; observed: z.ZodString; }, z.core.$strict>; readonly 'flag-redundancy': z.ZodObject<{ with: z.ZodString; }, z.core.$strict>; readonly 'flag-gap': z.ZodObject<{ area: z.ZodString; missing: z.ZodString; }, z.core.$strict>; readonly 'rank-hint': z.ZodObject<{ relevance: z.ZodEnum<{ strong: "strong"; weak: "weak"; }>; }, z.core.$strict>; readonly 'suggest-area': z.ZodObject<{ directories: z.ZodArray; name: z.ZodString; }, z.core.$strict>; }; type EnrichmentPayloads = { readonly [K in EnrichmentKind]: z.infer<(typeof payloads)[K]>; }; declare const EnrichmentProposalV1Schema: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"classify-document">; payload: z.ZodObject<{ type: z.ZodEnum<{ index: "index"; reference: "reference"; other: "other"; policy: "policy"; guide: "guide"; runbook: "runbook"; adr: "adr"; spec: "spec"; changelog: "changelog"; }>; audience: z.ZodEnum<{ agent: "agent"; human: "human"; "human-and-agent": "human-and-agent"; }>; lifecycle: z.ZodEnum<{ draft: "draft"; active: "active"; deprecated: "deprecated"; archived: "archived"; }>; criticality: z.ZodEnum<{ "tier-0": "tier-0"; "tier-1": "tier-1"; "tier-2": "tier-2"; }>; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"summarize">; payload: z.ZodObject<{ summary: z.ZodString; language: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"add-alias">; payload: z.ZodObject<{ alias: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"add-intent">; payload: z.ZodObject<{ phrase: z.ZodString; language: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"mark-canonical">; payload: z.ZodObject<{ scope: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"propose-relation">; payload: z.ZodObject<{ from: z.ZodString; to: z.ZodString; kind: z.ZodEnum<{ covers: "covers"; "links-to": "links-to"; mentions: "mentions"; "depends-on": "depends-on"; documents: "documents"; "related-to": "related-to"; }>; detection: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"flag-contradiction">; payload: z.ZodObject<{ against: z.ZodString; claim: z.ZodString; observed: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"flag-redundancy">; payload: z.ZodObject<{ with: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"flag-gap">; payload: z.ZodObject<{ area: z.ZodString; missing: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"rank-hint">; payload: z.ZodObject<{ relevance: z.ZodEnum<{ strong: "strong"; weak: "weak"; }>; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"suggest-area">; payload: z.ZodObject<{ directories: z.ZodArray; name: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>], "kind">; type EnrichmentProposalV1 = z.infer; type EnrichmentProposalOf = Extract; /** * The part of a payload that makes two proposals of one kind about one entity different things. * * A summary, a classification, a canonical marker and a rank hint are slots: one per entity per * agent and prompt, so a re-run replaces rather than accumulates. An alias, an intent, a relation * or a flag can legitimately exist several times for one entity, so the field that tells them * apart is part of the identity. */ declare const enrichmentProposalKey: (kind: EnrichmentKind, payload: unknown) => unknown; type EnrichmentIdentity = { readonly kind: EnrichmentKind; readonly entity: string; readonly targetContentHash: string; readonly origin: Pick; readonly payload?: unknown; }; /** The proposal id: kind, entity, target hash, agent identity, prompt version — and the payload key. */ declare const enrichmentProposalId: (identity: EnrichmentIdentity) => string; /** Why a proposal was not accepted. A closed list, so the histogram in `stats` is comparable across runs. */ declare const ENRICHMENT_REJECTION_REASONS: readonly ["invalid-kind", "schema", "no-evidence", "unknown-entity", "stale-target", "base-snapshot-mismatch", "unknown-diagnostic", "evidence-outside-artifacts", "proposal-id-mismatch", "entity-outside-pack", "entity-kind", "redaction", "summary-unchanged", "alias-collision", "unknown-scope", "canonical-conflict", "unknown-endpoint", "relation-already-observed", "evidence-outside-endpoints", "evidence-missing-for-endpoint", "already-duplicate", "already-covered", "unknown-directory", "area-overlap", "self-approval", "self-adjudication", "adjudicated", "human-rejected", "expired"]; type EnrichmentRejectionReason = (typeof ENRICHMENT_REJECTION_REASONS)[number]; declare const AcceptedEnrichmentSchema: z.ZodObject<{ proposal: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"classify-document">; payload: z.ZodObject<{ type: z.ZodEnum<{ index: "index"; reference: "reference"; other: "other"; policy: "policy"; guide: "guide"; runbook: "runbook"; adr: "adr"; spec: "spec"; changelog: "changelog"; }>; audience: z.ZodEnum<{ agent: "agent"; human: "human"; "human-and-agent": "human-and-agent"; }>; lifecycle: z.ZodEnum<{ draft: "draft"; active: "active"; deprecated: "deprecated"; archived: "archived"; }>; criticality: z.ZodEnum<{ "tier-0": "tier-0"; "tier-1": "tier-1"; "tier-2": "tier-2"; }>; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"summarize">; payload: z.ZodObject<{ summary: z.ZodString; language: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"add-alias">; payload: z.ZodObject<{ alias: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"add-intent">; payload: z.ZodObject<{ phrase: z.ZodString; language: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"mark-canonical">; payload: z.ZodObject<{ scope: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"propose-relation">; payload: z.ZodObject<{ from: z.ZodString; to: z.ZodString; kind: z.ZodEnum<{ covers: "covers"; "links-to": "links-to"; mentions: "mentions"; "depends-on": "depends-on"; documents: "documents"; "related-to": "related-to"; }>; detection: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"flag-contradiction">; payload: z.ZodObject<{ against: z.ZodString; claim: z.ZodString; observed: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"flag-redundancy">; payload: z.ZodObject<{ with: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"flag-gap">; payload: z.ZodObject<{ area: z.ZodString; missing: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"rank-hint">; payload: z.ZodObject<{ relevance: z.ZodEnum<{ strong: "strong"; weak: "weak"; }>; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"suggest-area">; payload: z.ZodObject<{ directories: z.ZodArray; name: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>], "kind">; acceptedAt: z.ZodString; acceptedBy: z.ZodString; approvalId: z.ZodOptional; }, z.core.$strict>; type AcceptedEnrichment = z.infer; declare const PendingEnrichmentSchema: z.ZodObject<{ proposal: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"classify-document">; payload: z.ZodObject<{ type: z.ZodEnum<{ index: "index"; reference: "reference"; other: "other"; policy: "policy"; guide: "guide"; runbook: "runbook"; adr: "adr"; spec: "spec"; changelog: "changelog"; }>; audience: z.ZodEnum<{ agent: "agent"; human: "human"; "human-and-agent": "human-and-agent"; }>; lifecycle: z.ZodEnum<{ draft: "draft"; active: "active"; deprecated: "deprecated"; archived: "archived"; }>; criticality: z.ZodEnum<{ "tier-0": "tier-0"; "tier-1": "tier-1"; "tier-2": "tier-2"; }>; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"summarize">; payload: z.ZodObject<{ summary: z.ZodString; language: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"add-alias">; payload: z.ZodObject<{ alias: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"add-intent">; payload: z.ZodObject<{ phrase: z.ZodString; language: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"mark-canonical">; payload: z.ZodObject<{ scope: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"propose-relation">; payload: z.ZodObject<{ from: z.ZodString; to: z.ZodString; kind: z.ZodEnum<{ covers: "covers"; "links-to": "links-to"; mentions: "mentions"; "depends-on": "depends-on"; documents: "documents"; "related-to": "related-to"; }>; detection: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"flag-contradiction">; payload: z.ZodObject<{ against: z.ZodString; claim: z.ZodString; observed: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"flag-redundancy">; payload: z.ZodObject<{ with: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"flag-gap">; payload: z.ZodObject<{ area: z.ZodString; missing: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"rank-hint">; payload: z.ZodObject<{ relevance: z.ZodEnum<{ strong: "strong"; weak: "weak"; }>; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"suggest-area">; payload: z.ZodObject<{ directories: z.ZodArray; name: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>], "kind">; approvalId: z.ZodString; note: z.ZodOptional>; }, z.core.$strict>; type PendingEnrichment = z.infer; declare const RejectedEnrichmentSchema: z.ZodObject<{ proposalId: z.ZodString; kind: z.ZodString; entity: z.ZodOptional; reason: z.ZodEnum<{ "invalid-kind": "invalid-kind"; schema: "schema"; "no-evidence": "no-evidence"; "unknown-entity": "unknown-entity"; "stale-target": "stale-target"; "base-snapshot-mismatch": "base-snapshot-mismatch"; "unknown-diagnostic": "unknown-diagnostic"; "evidence-outside-artifacts": "evidence-outside-artifacts"; "proposal-id-mismatch": "proposal-id-mismatch"; "entity-outside-pack": "entity-outside-pack"; "entity-kind": "entity-kind"; redaction: "redaction"; "summary-unchanged": "summary-unchanged"; "alias-collision": "alias-collision"; "unknown-scope": "unknown-scope"; "canonical-conflict": "canonical-conflict"; "unknown-endpoint": "unknown-endpoint"; "relation-already-observed": "relation-already-observed"; "evidence-outside-endpoints": "evidence-outside-endpoints"; "evidence-missing-for-endpoint": "evidence-missing-for-endpoint"; "already-duplicate": "already-duplicate"; "already-covered": "already-covered"; "unknown-directory": "unknown-directory"; "area-overlap": "area-overlap"; "self-approval": "self-approval"; "self-adjudication": "self-adjudication"; adjudicated: "adjudicated"; "human-rejected": "human-rejected"; expired: "expired"; }>; detail: z.ZodOptional; origin: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>>; }, z.core.$strict>; type RejectedEnrichment = z.infer; /** * A rejection that means the agent named something that does not exist. * * It is counted on its own rather than folded into the rejection total, because it is the one * number that says whether an agent is inventing structure. A curator that classifies a document * badly is wrong about a judgement; one that proposes a relation to a module the repository does * not contain is making things up, and that number must trend to zero or the agent is unusable. */ declare const INVENTED_RELATION_REASONS: readonly ["unknown-endpoint", "unknown-entity", "unknown-scope", "unknown-directory", "unknown-diagnostic"]; declare const EnrichmentStatsSchema: z.ZodObject<{ byKind: z.ZodRecord>; rejectionReasons: z.ZodRecord; inventedReferences: z.ZodNumber; agentRuns: z.ZodNumber; cacheHits: z.ZodNumber; cacheHitRate: z.ZodNumber; packs: z.ZodNumber; inputBytes: z.ZodNumber; outputBytes: z.ZodNumber; wallTimeMs: z.ZodNumber; expired: z.ZodNumber; }, z.core.$strict>; type EnrichmentStats = z.infer; declare const EnrichmentOverlayV1Schema: z.ZodObject<{ type: z.ZodLiteral<"enrichment-overlay">; schemaVersion: z.ZodLiteral<1>; contentHash: z.ZodString; contentHashAlgo: z.ZodLiteral<"sha256-normalized-v1">; project: z.ZodObject<{ name: z.ZodString; root: z.ZodOptional; }, z.core.$strict>; sourceRevision: z.ZodString; sourceRevisionKind: z.ZodEnum<{ git: "git"; content: "content"; }>; configurationHash: z.ZodString; pipelineVersion: z.ZodString; analyzerVersions: z.ZodRecord; baseSnapshotHash: z.ZodString; accepted: z.ZodArray; payload: z.ZodObject<{ type: z.ZodEnum<{ index: "index"; reference: "reference"; other: "other"; policy: "policy"; guide: "guide"; runbook: "runbook"; adr: "adr"; spec: "spec"; changelog: "changelog"; }>; audience: z.ZodEnum<{ agent: "agent"; human: "human"; "human-and-agent": "human-and-agent"; }>; lifecycle: z.ZodEnum<{ draft: "draft"; active: "active"; deprecated: "deprecated"; archived: "archived"; }>; criticality: z.ZodEnum<{ "tier-0": "tier-0"; "tier-1": "tier-1"; "tier-2": "tier-2"; }>; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"summarize">; payload: z.ZodObject<{ summary: z.ZodString; language: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"add-alias">; payload: z.ZodObject<{ alias: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"add-intent">; payload: z.ZodObject<{ phrase: z.ZodString; language: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"mark-canonical">; payload: z.ZodObject<{ scope: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"propose-relation">; payload: z.ZodObject<{ from: z.ZodString; to: z.ZodString; kind: z.ZodEnum<{ covers: "covers"; "links-to": "links-to"; mentions: "mentions"; "depends-on": "depends-on"; documents: "documents"; "related-to": "related-to"; }>; detection: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"flag-contradiction">; payload: z.ZodObject<{ against: z.ZodString; claim: z.ZodString; observed: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"flag-redundancy">; payload: z.ZodObject<{ with: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"flag-gap">; payload: z.ZodObject<{ area: z.ZodString; missing: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"rank-hint">; payload: z.ZodObject<{ relevance: z.ZodEnum<{ strong: "strong"; weak: "weak"; }>; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"suggest-area">; payload: z.ZodObject<{ directories: z.ZodArray; name: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>], "kind">; acceptedAt: z.ZodString; acceptedBy: z.ZodString; approvalId: z.ZodOptional; }, z.core.$strict>>; pending: z.ZodArray; payload: z.ZodObject<{ type: z.ZodEnum<{ index: "index"; reference: "reference"; other: "other"; policy: "policy"; guide: "guide"; runbook: "runbook"; adr: "adr"; spec: "spec"; changelog: "changelog"; }>; audience: z.ZodEnum<{ agent: "agent"; human: "human"; "human-and-agent": "human-and-agent"; }>; lifecycle: z.ZodEnum<{ draft: "draft"; active: "active"; deprecated: "deprecated"; archived: "archived"; }>; criticality: z.ZodEnum<{ "tier-0": "tier-0"; "tier-1": "tier-1"; "tier-2": "tier-2"; }>; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"summarize">; payload: z.ZodObject<{ summary: z.ZodString; language: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"add-alias">; payload: z.ZodObject<{ alias: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"add-intent">; payload: z.ZodObject<{ phrase: z.ZodString; language: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"mark-canonical">; payload: z.ZodObject<{ scope: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"propose-relation">; payload: z.ZodObject<{ from: z.ZodString; to: z.ZodString; kind: z.ZodEnum<{ covers: "covers"; "links-to": "links-to"; mentions: "mentions"; "depends-on": "depends-on"; documents: "documents"; "related-to": "related-to"; }>; detection: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"flag-contradiction">; payload: z.ZodObject<{ against: z.ZodString; claim: z.ZodString; observed: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"flag-redundancy">; payload: z.ZodObject<{ with: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"flag-gap">; payload: z.ZodObject<{ area: z.ZodString; missing: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"rank-hint">; payload: z.ZodObject<{ relevance: z.ZodEnum<{ strong: "strong"; weak: "weak"; }>; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"suggest-area">; payload: z.ZodObject<{ directories: z.ZodArray; name: z.ZodString; }, z.core.$strict>; type: z.ZodLiteral<"enrichment-proposal">; schemaVersion: z.ZodLiteral<1>; proposalId: z.ZodString; entity: z.ZodString; targetContentHash: z.ZodString; confidence: z.ZodNumber; reason: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; relatedDiagnosticIds: z.ZodOptional>; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; baseSnapshotHash: z.ZodString; }, z.core.$strict>], "kind">; approvalId: z.ZodString; note: z.ZodOptional>; }, z.core.$strict>>; rejected: z.ZodArray; reason: z.ZodEnum<{ "invalid-kind": "invalid-kind"; schema: "schema"; "no-evidence": "no-evidence"; "unknown-entity": "unknown-entity"; "stale-target": "stale-target"; "base-snapshot-mismatch": "base-snapshot-mismatch"; "unknown-diagnostic": "unknown-diagnostic"; "evidence-outside-artifacts": "evidence-outside-artifacts"; "proposal-id-mismatch": "proposal-id-mismatch"; "entity-outside-pack": "entity-outside-pack"; "entity-kind": "entity-kind"; redaction: "redaction"; "summary-unchanged": "summary-unchanged"; "alias-collision": "alias-collision"; "unknown-scope": "unknown-scope"; "canonical-conflict": "canonical-conflict"; "unknown-endpoint": "unknown-endpoint"; "relation-already-observed": "relation-already-observed"; "evidence-outside-endpoints": "evidence-outside-endpoints"; "evidence-missing-for-endpoint": "evidence-missing-for-endpoint"; "already-duplicate": "already-duplicate"; "already-covered": "already-covered"; "unknown-directory": "unknown-directory"; "area-overlap": "area-overlap"; "self-approval": "self-approval"; "self-adjudication": "self-adjudication"; adjudicated: "adjudicated"; "human-rejected": "human-rejected"; expired: "expired"; }>; detail: z.ZodOptional; origin: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>>; }, z.core.$strict>>; stats: z.ZodObject<{ byKind: z.ZodRecord>; rejectionReasons: z.ZodRecord; inventedReferences: z.ZodNumber; agentRuns: z.ZodNumber; cacheHits: z.ZodNumber; cacheHitRate: z.ZodNumber; packs: z.ZodNumber; inputBytes: z.ZodNumber; outputBytes: z.ZodNumber; wallTimeMs: z.ZodNumber; expired: z.ZodNumber; }, z.core.$strict>; }, z.core.$strict>; type EnrichmentOverlayV1 = z.infer; /** * The overlay's own hash, over what it decided and not over when or at what cost. * * `acceptedAt` is a fact about a person's action, and `stats` describe the run that produced the * file — how many agent calls, how many cache hits. Neither is a fact about the repository, and * two runs over one unchanged repository must produce one overlay hash, so both are outside it. * What is inside: every accepted, pending and rejected entry and the hashes they bind to. */ declare const enrichmentOverlayContentHash: (overlay: Omit & { readonly contentHash?: string; }) => string; /** * An adjudication: a third agent's verdict on proposals two others could not settle — a canonical * conflict, a disputed contradiction. It judges; it never approves. The agent that made a * proposal cannot be the agent that judges it, which the validator enforces by identity. */ declare const EnrichmentAdjudicationV1Schema: z.ZodObject<{ type: z.ZodLiteral<"enrichment-adjudication">; schemaVersion: z.ZodLiteral<1>; adjudicationId: z.ZodString; judges: z.ZodArray; keep: z.ZodArray; reason: z.ZodString; origin: z.ZodObject<{ agentId: z.ZodString; agentVersion: z.ZodString; promptVersion: z.ZodString; model: z.ZodOptional; provider: z.ZodOptional; }, z.core.$strict>; }, z.core.$strict>; type EnrichmentAdjudicationV1 = z.infer; declare const enrichmentAdjudicationId: (input: Pick) => string; type BuildIndexOptions = { readonly root?: string; readonly config: DocBridgeConfigV1; readonly write?: boolean; /** * A snapshot to project instead of scanning. The build scans when none is given; a caller that * already holds the snapshot — a workflow stage, a test — passes it so the index and the * artifacts it sits next to describe the same observation. */ readonly snapshot?: DiscoverySnapshotV1; /** * Which enrichment overlay the projection reads. * * Omitted, the builder reads the one on disk while the Registry is enabled — the normal path. * `'ignore'` builds the deterministic baseline even then, and an overlay object projects that * one instead. Both exist so the retrieval delta can measure the same snapshot twice, with the * overlay and without it, rather than comparing two different repositories. */ readonly overlay?: EnrichmentOverlayV1 | 'ignore'; }; type BuildIndexResult = { readonly index: DocBridgeIndexV1; readonly indexPath: string; readonly llmsTxtPath?: string; readonly capabilitiesPath?: string; }; declare const buildDocBridgeIndex: (opts: BuildIndexOptions) => BuildIndexResult; /** * The freshness fingerprint of the index. * * This file used to be retrieval's own scanner: it walked the repository, parsed every module and * document a second time, and projected them into index records that shared nothing with the * snapshot but a path. That projection is now a function of the snapshot (`src/retrieval/project.ts`), * and what remains here is the one thing a query needs on every call: a cheap way to tell whether * the index on disk still describes the files on disk. One walk, one hash per file, no parsing. */ /** * Bumped when what the index derives from its inputs changes shape, so an index built by older * code is stale by version even when every file matches. */ declare const CORPUS_PROJECTION_VERSION: 2; /** * Entry types the projection produces into `knowledge[]`. Curated corpus entries are always * `agent-doc`, so this is what distinguishes a record retrieval discovered from one a human wrote * a sidecar for — which surfaces such as llms.txt need, since a reading order is curated, not * enumerated. */ declare const PROJECTED_ENTRY_TYPES: readonly ["document", "module"]; declare const isProjectedEntry: (entry: Pick) => boolean; declare const indexConfigurationHash: (config: DocBridgeConfigV1 | undefined) => string; type RepositoryInputsV1 = { /** Hash of every input path and its content. Equal hashes mean an equal projection. */ readonly hash: string; readonly fileCount: number; readonly projectionVersion: number; /** True when a safety limit stopped the walk, so the file set is not the whole repository. */ readonly incomplete?: boolean; }; /** * Walk the repository once and hash every input the index derives from: sources, documents and * the configuration files that decide how they resolve. */ declare const repositoryInputs: (root: string, config: DocBridgeConfigV1 | undefined) => RepositoryInputsV1; /** * Whether a committed index could have been produced by a clean checkout. * * The recommended setup commits `.doc-bridge/index.json` so a gate can verify it, and that only * works while the index is a function of committed content. A scan has no reason to know about * `.gitignore` — it walks what is on disk — so a generated module or document silently joins the * corpus on any machine that has built, and silently leaves it on one that has not. The index then * disagrees with itself between two checkouts of the same commit, `index-freshness` reports an * artifact that nothing invalidated, and regenerating cannot fix it because the next machine * disagrees in the other direction. * * Dogfooding found this the expensive way: a 25-package monorepo whose gate passed locally and * failed in CI because `pnpm lint` had generated one `.ts` file into the corpus before the index * was written. The scan cannot guess which files are generated, but Git already knows, so the * check is: of the paths this index carries, which ones does Git ignore? * * It only applies when the index is itself tracked. A consumer who regenerates on every run has * nothing to reproduce, and reporting generated files to them would be noise. */ type IgnoredIndexEntry = { readonly path: string; /** The ignore rule that matched, as `.gitignore:12:pattern`, so the fix is one lookup away. */ readonly rule: string; }; type IndexReproducibility = { /** * Whether the question was answerable. False outside a Git checkout, when Git is unavailable, or * when the index is not tracked — in all three cases `ignored` is empty and means nothing. */ readonly checked: boolean; /** Why the check did not run, for a caller that wants to say so. */ readonly skipped?: 'no-git' | 'index-untracked'; /** Indexed paths that Git ignores, in path order. */ readonly ignored: readonly IgnoredIndexEntry[]; }; /** * The paths a committed index carries that Git ignores. * * `git check-ignore` consults the index by default, so a tracked file that also matches an ignore * pattern is correctly reported as not ignored — being committed is the whole point. A test pins * that behaviour rather than trusting it. */ declare const checkIndexReproducibility: (root: string, indexPath: string, paths: readonly string[]) => IndexReproducibility; /** * The retrieval index: what ranking reads. * * It is a projection of the discovery snapshot — a pure function of the snapshot, the accepted * enrichment overlay and the configuration — and nothing else. It has no scanner of its own, * which is the invariant that makes "the index" and "the snapshot" describe the same repository: * an entity retrieval can find is an entity discovery observed, with the same id, the same * content hash and the same evidence. */ declare const RETRIEVAL_INDEX_SCHEMA_VERSION: 1; declare const RetrievalKindSchema: z.ZodEnum<{ module: "module"; area: "area"; package: "package"; document: "document"; intent: "intent"; change: "change"; }>; type RetrievalKind = z.infer; /** * How much to trust a result, from most to least. * * `observed` came from code or a manifest; `declared` from a documentation declaration or the * configuration; `fuzzy` from a reference that resolved by similarity rather than by name; * `proposed` from an agent whose proposal has not been accepted. A result's confidence is the * weakest link between the entry and the relation that surfaced it. */ declare const ConfidenceSchema: z.ZodEnum<{ observed: "observed"; declared: "declared"; proposed: "proposed"; fuzzy: "fuzzy"; }>; type Confidence = z.infer; declare const AudienceSchema: z.ZodEnum<{ agent: "agent"; human: "human"; "human-and-agent": "human-and-agent"; }>; type Audience = z.infer; /** Text the lexical ranker indexes, one string per field, already bounded. */ declare const RetrievalFieldsSchema: z.ZodObject<{ title: z.ZodString; headings: z.ZodString; path: z.ZodString; symbols: z.ZodString; summary: z.ZodString; body: z.ZodString; aliases: z.ZodString; }, z.core.$strict>; type RetrievalFields = z.infer; /** One edge into or out of an entry, with the confidence of the relation it came from. */ declare const RetrievalEdgeSchema: z.ZodObject<{ kind: z.ZodString; id: z.ZodString; confidence: z.ZodEnum<{ observed: "observed"; declared: "declared"; proposed: "proposed"; fuzzy: "fuzzy"; }>; }, z.core.$strict>; type RetrievalEdge = z.infer; declare const RetrievalGraphSchema: z.ZodObject<{ pagerank: z.ZodNumber; inboundLinks: z.ZodNumber; coveredBy: z.ZodArray; mentionedBy: z.ZodArray; areaId: z.ZodOptional; packageId: z.ZodOptional; inbound: z.ZodArray; }, z.core.$strict>>; outbound: z.ZodArray; }, z.core.$strict>>; }, z.core.$strict>; type RetrievalGraph = z.infer; declare const RetrievalEntrySchema: z.ZodObject<{ id: z.ZodString; kind: z.ZodEnum<{ module: "module"; area: "area"; package: "package"; document: "document"; intent: "intent"; change: "change"; }>; path: z.ZodString; title: z.ZodString; summary: z.ZodOptional; audience: z.ZodOptional>; aliases: z.ZodArray; symbols: z.ZodOptional>; tags: z.ZodArray; fields: z.ZodObject<{ title: z.ZodString; headings: z.ZodString; path: z.ZodString; symbols: z.ZodString; summary: z.ZodString; body: z.ZodString; aliases: z.ZodString; }, z.core.$strict>; graph: z.ZodObject<{ pagerank: z.ZodNumber; inboundLinks: z.ZodNumber; coveredBy: z.ZodArray; mentionedBy: z.ZodArray; areaId: z.ZodOptional; packageId: z.ZodOptional; inbound: z.ZodArray; }, z.core.$strict>>; outbound: z.ZodArray; }, z.core.$strict>>; }, z.core.$strict>; contentHash: z.ZodString; provenance: z.ZodEnum<{ observed: "observed"; declared: "declared"; proposed: "proposed"; }>; confidence: z.ZodEnum<{ observed: "observed"; declared: "declared"; proposed: "proposed"; fuzzy: "fuzzy"; }>; ownershipId: z.ZodOptional; agentSignal: z.ZodOptional; }, z.core.$strict>; type RetrievalEntry = z.infer; declare const RetrievalIndexV1Schema: z.ZodObject<{ type: z.ZodLiteral<"retrieval-index">; schemaVersion: z.ZodLiteral<1>; contentHash: z.ZodString; contentHashAlgo: z.ZodLiteral<"sha256-normalized-v1">; snapshotHash: z.ZodString; overlayHash: z.ZodString; configurationHash: z.ZodString; lexiconVersion: z.ZodNumber; graphMetricsVersion: z.ZodString; weights: z.ZodRecord; params: z.ZodObject<{ k1: z.ZodNumber; b: z.ZodNumber; }, z.core.$strict>; lexical: z.ZodObject<{ version: z.ZodNumber; documentCount: z.ZodNumber; fieldNames: z.ZodArray; averageFieldLength: z.ZodRecord; }, z.core.$strict>; entries: z.ZodArray; path: z.ZodString; title: z.ZodString; summary: z.ZodOptional; audience: z.ZodOptional>; aliases: z.ZodArray; symbols: z.ZodOptional>; tags: z.ZodArray; fields: z.ZodObject<{ title: z.ZodString; headings: z.ZodString; path: z.ZodString; symbols: z.ZodString; summary: z.ZodString; body: z.ZodString; aliases: z.ZodString; }, z.core.$strict>; graph: z.ZodObject<{ pagerank: z.ZodNumber; inboundLinks: z.ZodNumber; coveredBy: z.ZodArray; mentionedBy: z.ZodArray; areaId: z.ZodOptional; packageId: z.ZodOptional; inbound: z.ZodArray; }, z.core.$strict>>; outbound: z.ZodArray; }, z.core.$strict>>; }, z.core.$strict>; contentHash: z.ZodString; provenance: z.ZodEnum<{ observed: "observed"; declared: "declared"; proposed: "proposed"; }>; confidence: z.ZodEnum<{ observed: "observed"; declared: "declared"; proposed: "proposed"; fuzzy: "fuzzy"; }>; ownershipId: z.ZodOptional; agentSignal: z.ZodOptional; }, z.core.$strict>>; }, z.core.$strict>; type RetrievalIndexV1 = z.infer; /** * Project the snapshot into the index retrieval reads. * * Retrieval used to run a scanner of its own: it walked the repository, parsed every module and * document a second time, and produced records that shared nothing with the snapshot but a file * path. Two views of one repository, built by two pipelines, could disagree — and did, which is * how a search could return a module the snapshot said did not exist. * * This is a function, not a scan. Every entry is a snapshot entity (or a route the configuration * declares); every content hash is the entity's own; every graph number is computed from the * snapshot's relations. The one thing read from disk is the body text of a document the snapshot * already names, because a 4 KB search excerpt does not belong in a snapshot — and that read is * verified against the entity's content hash, so a file that changed since the scan is projected * from what the snapshot says about it rather than from what is on disk now. */ declare const RETRIEVAL_PROJECTION_VERSION: 2; /** Documentation body kept for search. Long enough to answer a question, short enough to ship. */ declare const DOCUMENT_BODY_LIMIT = 4000; /** The overlay hash when there is no overlay: the hash of an empty accepted set. */ declare const EMPTY_OVERLAY_HASH: string; /** * What the snapshot observed, without the revision it observed it at. * * `snapshot.contentHash` seals the whole artifact, `sourceRevision` included — the commit SHA when * the working tree is clean, a digest of the scanned files when it is not. That is right for an * artifact whose job is to say what one revision looked like, and wrong as a projection input: the * projection is a function of what was found, not of where it was found. Sealing the revision into * it made an index that any commit invalidates without one thing it describes having changed — so * an index committed to a repository was stale the moment it landed, because landing it is a * commit, and a freshness gate could never pass twice. * * Entities and relations are the projection's whole input; the analyzer identity comes with them, * because two analyzer versions that observe the same entities and relations have nothing left to * disagree about, and one that observes different ones is caught by the entities. */ declare const snapshotObservationHash: (snapshot: Pick) => string; /** The weaker of two confidences: a chain is as trustworthy as its least trustworthy link. */ declare const weakerConfidence: (a: Confidence, b: Confidence) => Confidence; /** What a relation's confidence is: its provenance, unless it resolved by similarity. */ declare const relationConfidence: (relation: Pick) => Confidence; /** The routes the configuration declares. Passed in rather than re-read, so the projection stays a function. */ type RetrievalRoutes = { readonly ownership?: Readonly>; readonly intents?: Readonly>; readonly changes?: Readonly>; }; /** A curated sidecar the corpus scan found: it lends its id and summary to the document it is. */ type CuratedDocument = { readonly id: string; readonly path: string; readonly title?: string; readonly description?: string; }; /** * The accepted enrichment overlay, as the projection reads it. * * Already expired against the snapshot by `projectEnrichmentOverlay`: every map here names an * entity whose content hash still matches the entry that describes it. The hash is part of the * projection's identity; everything else is additive — an alias joins the entity's own, a * summary fills a gap, a relation is one more edge with `provenance: proposed` — and nothing * here can remove or rewrite what the snapshot observed. */ type RetrievalOverlayInput = { readonly hash: string; /** Per-entry share of the bounded agent weight, 0..1. */ readonly signals?: ReadonlyMap; readonly aliases?: ReadonlyMap; /** Used only when the entity has no summary of its own; ranked in either case. */ readonly summaries?: ReadonlyMap; /** Entity id → the scope it is canonical for. */ readonly canonical?: ReadonlyMap; readonly intents?: readonly { readonly id: string; readonly title: string; readonly paths: readonly string[]; }[]; /** Accepted relations, `provenance: proposed`. Added next to the observed ones, never in place of any. */ readonly relations?: readonly KnowledgeRelation[]; }; type ProjectRetrievalOptions = { readonly snapshot: Pick; readonly config: DocBridgeConfigV1 | undefined; readonly routes?: RetrievalRoutes; readonly curated?: readonly CuratedDocument[]; readonly overlay?: RetrievalOverlayInput; /** Body text of a document entity, by path. Return `undefined` when the file is not readable. */ readonly readDocument?: (path: string) => string | undefined; }; /** * Build the retrieval index. * * Entries are emitted in id order and every list inside them is sorted, so the artifact — and * its content hash — is a function of its inputs and not of the order the snapshot arrived in. */ declare const projectRetrievalIndex: (options: ProjectRetrievalOptions) => RetrievalIndexV1; /** * The legacy record for a projected entry. * * `knowledge[]` is what the harness, llms.txt, the doctor and every older reader consume, so it * keeps carrying every document and module — but without the body, which now lives once in the * projection. A document projected here and a document ranked there are the same entry. */ declare const toKnowledgeEntry: (entry: RetrievalEntry) => KnowledgeEntry; /** * Accepted agent signals: bounded influence. * * An entry's signal is a share in 0..1 of this weight, and the weight is 15% of the exact-id * boost. That is the whole contract: an accepted rank hint or canonical marker can reorder * near-ties among lexical hits, and can never lift an entry past one the query named exactly. * Signals apply to lexical hits only, like every other tie-breaker. */ declare const ACCEPTED_SIGNALS_SHARE = 0.15; declare const ACCEPTED_SIGNALS_WEIGHT: number; declare const RELEVANCE_FLOOR: number; type ScoreComponents = { readonly lexical: number; readonly prior: number; readonly exactId: number; readonly exactPath: number; readonly exactSymbol: number; readonly graphProximity: number; readonly canonicality: number; readonly audienceFit: number; readonly acceptedAgentSignals: number; }; type RankExplanation = { /** Query terms after the lexicon: what the ranker actually looked for. */ readonly terms: readonly string[]; /** Which terms matched in which field. */ readonly matched: Readonly>; readonly components: ScoreComponents; /** * The edge proximity found this result through. When nothing matched lexically it is the only * reason the result is here; otherwise it is what the proximity component stands on. */ readonly surfacedBy?: { readonly kind: string; readonly id: string; readonly confidence: Confidence; readonly hops: number; }; }; type RankedEntry = { readonly entry: RetrievalEntry; readonly score: number; /** * The entry's own confidence when the query matched it directly; when a relation alone * surfaced it, the weaker of the entry and that relation — a result is as trustworthy as the * least trustworthy step that produced it. */ readonly confidence: Confidence; readonly explanation: RankExplanation; }; type RankOptions = { readonly limit?: number; /** The `--agent` prior: favour documentation written for an agent. */ readonly agent?: boolean; /** Per-entry accepted overlay signals (0..1), by entry id. Overrides the `agentSignal` the projection carries. */ readonly signals?: ReadonlyMap; /** * Results scoring below this share of the best score are dropped. The default spends context * on nothing weak; a caller assembling a neighbourhood rather than an answer passes 0. */ readonly floor?: number; }; /** * Rank the projection against a query. * * Ordering is total: score descending, then an exact id match, then an ownership-backed entry, * then id ascending — so two runs agree exactly and a tie never depends on insertion order. * Results below a third of the best score are dropped: retrieval exists to spend fewer tokens. */ declare const rankRetrieval: (index: RetrievalIndexV1, term: string, options?: RankOptions) => RankedEntry[]; declare const entityId: (kind: string, value: string) => string; /** Identity of an observed relation: its endpoints and kind, plus an optional discriminator. */ declare const relationId: (from: string, kind: string, to: string, discriminator?: string) => string; /** * Graph signals over the knowledge snapshot. * * The rules engine used to derive `centrality-risk` from how many undocumented-relation findings * were attached to an entity — a measure of documentation debt wearing the name of an * architectural signal. A module can be the single point every import path runs through and carry * no findings at all; a well-connected but thoroughly documented module carried the highest score. * This module computes the real thing: betweenness over the import graph, PageRank over the * documentation graph, bounded shortest paths, and cycles. * * The graph is a working structure. It is built from the snapshot on demand, never serialised, and * `DiscoverySnapshotV1` does not learn about graphology. Nodes are inserted in sorted order and * every score is rounded before it is returned, so two runs over the same snapshot agree exactly * and an artifact built from these numbers keeps its hash. */ declare const GRAPH_ANALYZER_VERSION = "1.0.0"; /** Edges that say "this documentation points at that": the canonicality signal. */ declare const DOCUMENTATION_EDGE_KINDS: readonly ["links-to", "covers"]; /** Edges that say "this code needs that": the centrality and cycle signal. */ declare const IMPORT_EDGE_KINDS: readonly ["imports", "re-exports"]; type BuildGraphOptions = { /** Relation kinds to include. Every other relation is left out of this view. */ readonly kinds?: readonly string[]; /** Undirected graphs are for community detection; everything else is directed. */ readonly undirected?: boolean; /** Keep external and unresolved endpoints. Off by default: they are not project architecture. */ readonly includeExternal?: boolean; }; /** * Build a view of the snapshot as a graph. * * Nodes are added in sorted order, then edges in sorted order, so the library's internal iteration * order is a function of the snapshot's content and not of how the snapshot happened to be built. * That is what makes a metric reproducible after the input order is shuffled. */ declare const buildKnowledgeGraph: (snapshot: Pick, options?: BuildGraphOptions) => GraphologyGraph; type GraphSignal = ReadonlyMap; /** * Canonicality: PageRank over the documentation graph. * * A page many documents link to, or that covers many entities, is where a reader should start. A * leaf note nothing points at is not, however recently it was edited. PageRank says that without * anyone maintaining a list of entry points. */ declare const canonicality: (snapshot: Pick, options?: { readonly alpha?: number; }) => GraphSignal; /** * Centrality: betweenness over the import graph. * * How much of the repository's dependency structure runs through this module. High betweenness is * a review signal — a change here reaches further than its diff suggests — and nothing more: it is * a static count of shortest paths, not a statement about runtime availability. */ declare const centrality: (snapshot: Pick, options?: { readonly kinds?: readonly string[]; }) => GraphSignal; type ProximityOptions = { readonly kinds?: readonly string[]; /** Hops beyond which two entities are not usefully related. */ readonly maxDepth?: number; }; declare const DEFAULT_PROXIMITY_DEPTH = 3; /** * Relation kinds that make two entities *related*, as opposed to merely filed together. * * `contains` is left out on purpose: it is hierarchy, and including it puts every module in an * area two hops from every other one, which is true and tells a reader nothing. What makes a * module close to a document is that the document covers or mentions it; what makes two modules * close is that one imports the other. */ declare const PROXIMITY_EDGE_KINDS: readonly ["imports", "re-exports", "links-to", "covers", "mentions", "mentions-symbol", "depends-on"]; /** * Proximity: how many hops from one entity to another, bounded. * * Bounded because an unbounded answer is not useful — at ten hops everything is related to * everything — and because ranking and handoff selection need a cheap neighbourhood, not a * complete distance matrix. */ declare const proximity: (snapshot: Pick, from: string, options?: ProximityOptions) => GraphSignal; type ImportCycle = { /** The nodes of the cycle, rotated so the lexicographically smallest is first. */ readonly nodes: readonly string[]; readonly relationIds: readonly string[]; readonly evidence: readonly Evidence[]; }; /** A cycle beyond this many is the same architectural problem reported again. */ declare const MAX_REPORTED_CYCLES = 16; /** * Import cycles, with the edges that form them. * * `graphology-dag` answers whether a cycle exists; reporting one needs the path, because a * diagnostic without the edges is a claim a reader cannot check. This is a depth-first search that * records the stack when it closes a loop, bounded in both count and depth, and deterministic * because the graph iterates in sorted order. */ declare const importCycles: (snapshot: Pick, options?: { readonly kinds?: readonly string[]; readonly limit?: number; }) => readonly ImportCycle[]; /** Deterministic pseudo-randomness, so a community run is reproducible. */ declare const seededRandom: (seed: number) => (() => number); declare const DEFAULT_COMMUNITY_SEED = 20260401; type AreaSuggestion = { /** Suggested area label, from the deepest directory the members share. */ readonly label: string; readonly members: readonly string[]; }; /** * Area suggestions from seeded Louvain communities over the import graph. * * A community is a hypothesis: these modules move together, so perhaps they are one unit. It is * never an area on its own — an area is derived from the repository's own structure or declared by * a human, and a clustering algorithm is neither. Suggestions travel as `coverage` entries for a * person or the curator agent to promote into configuration, which keeps a guess out of the graph * while still surfacing it. */ declare const areaSuggestions: (snapshot: Pick, options?: { readonly seed?: number; readonly minMembers?: number; readonly limit?: number; }) => readonly AreaSuggestion[]; /** * Community suggestions as coverage. * * `status: 'not-analyzed'` is the honest status: the clustering ran, but whether the cluster is an * area is a question nobody has answered yet. */ declare const areaSuggestionCoverage: (snapshot: Pick, options?: { readonly seed?: number; readonly minMembers?: number; readonly limit?: number; }) => readonly Coverage[]; /** * The repository graph behind the ecosystem's `GraphMemory` contract. * * An agent built on AgentsKit already walks its own memory with `getNode`, `findEdges` and * `neighbors`. This exposes the repository's structure through the same three calls, so asking * "what does this module import, and what documents cover it" needs no Doc Bridge-specific client. * * The contract is mirrored rather than imported: `@agentskit/memory` is an optional peer, and a * projection that only typechecked when an optional package happened to be installed would be a * published type that breaks on a clean install. `tests/graph.test.ts` asserts this implementation * is assignable to the real `GraphMemory` and behaves like `createInMemoryGraph` on the same * inputs, so the mirror cannot drift. */ type GraphNode> = { id: string; /** Type or label — here the entity kind: `module`, `document`, `area`, `package`. */ kind: string; properties?: TProps; createdAt?: string; updatedAt?: string; }; type GraphEdge> = { id: string; /** Verb — here the relation kind: `imports`, `covers`, `links-to`, `contains`. */ label: string; from: string; to: string; weight?: number; properties?: TProps; }; type GraphQuery = { kind?: string; label?: string; from?: string; to?: string; }; type GraphMemory = { upsertNode: (node: GraphNode) => Promise>; upsertEdge: (edge: GraphEdge) => Promise>; getNode: (id: string) => Promise | null>; findNodes: (query?: GraphQuery) => Promise[]>; findEdges: (query?: GraphQuery) => Promise[]>; /** Breadth-first neighbours of `id` up to `depth`, in both directions. Default 1. */ neighbors: (id: string, options?: { depth?: number; label?: string; }) => Promise[]>; deleteNode: (id: string) => Promise; deleteEdge: (id: string) => Promise; clear?: () => Promise; }; /** * Extra entities and relations layered over the observed snapshot. * * Same vocabulary as the snapshot, so the approved enrichment overlay plugs in unchanged when it * exists. Overlay records win over observed ones with the same id, which is what "approved" has to * mean for it to be worth approving. */ type KnowledgeOverlay = { readonly entities?: readonly KnowledgeEntity[]; readonly relations?: readonly KnowledgeRelation[]; }; /** * Project a snapshot, and an optional overlay, as a `GraphMemory`. * * Writes are accepted and kept in process: the snapshot is an observation and cannot be edited by * a caller, so `upsertNode` and `upsertEdge` land in a working layer above it and `deleteNode` * masks rather than erases. That keeps the contract honest in both directions — an agent can * annotate what it is exploring without any of it being mistaken for something the repository * said. `clear` drops the working layer, never the projection. */ declare const createDocBridgeGraphMemory: (snapshot: Pick, overlay?: KnowledgeOverlay) => GraphMemory; /** * Code areas: the unit of architecture between a package and a file. * * Reconciliation could only compare at file, module or package level, and most repositories are a * single package — so every internal relation aggregated into one self-loop, which the comparison * skips. The result was a repository with a thousand observed relations reporting zero * diagnostics, and a health score of 100 out of 100 saying nothing at all. * * An area is a directory that groups modules. It is derived, not declared: the first directory * level under a package's source roots, plus any path an ownership record already names — because * a configuration saying `path: "src/mcp"` is a human telling us that directory is a unit, and the * graph had no entity for it. */ declare const AREA_ANALYZER_VERSION = "1.0.0"; /** * Directories that contain areas rather than being one. * * `src` is not an area in any useful sense; `src/query` is. When a package keeps its code under * one of these, the area is the level below it. */ declare const DEFAULT_AREA_ROOTS: readonly ["src", "lib", "app", "source", "server", "client", "packages", "apps"]; declare const DEFAULT_AREA_DEPTH = 1; type AreaModule = { readonly moduleId: string; /** Repository-relative module path. */ readonly path: string; readonly packageId: string; /** Repository-relative package path; `.` for the root package. */ readonly packagePath: string; }; type AreaOwnership = { readonly id: string; readonly path: string; }; type DerivedArea = { readonly id: string; readonly path: string; readonly name: string; readonly packageId: string; /** The most specific area that encloses this one, when there is one. */ readonly parentId?: string; readonly moduleIds: readonly string[]; /** The ownership record that names exactly this path. */ readonly ownershipId?: string; }; type DeriveAreasOptions = { readonly modules: readonly AreaModule[]; readonly ownership?: readonly AreaOwnership[]; readonly depth?: number; readonly roots?: readonly string[]; /** * Glob patterns for directories that hold code without being a unit of architecture. * * A candidate that matches is not derived as an area, and its modules fall to the most * specific area that still encloses them — or to none, which is the honest answer for a * folder of fixtures. An ownership record naming the same path still wins: a person saying * a directory is a unit outranks a pattern saying it is not. */ readonly exclude?: readonly string[]; }; /** * The area a module belongs to by convention: `depth` directory levels, counted below a source * root when the module sits under one. A module directly in the package or in a bare source root * has no conventional area — there is no directory grouping it with anything. */ declare const conventionalAreaPath: (module: AreaModule, depth?: number, roots?: readonly string[]) => string | undefined; /** * Derive the areas of a repository. * * Every module is assigned to exactly one area — the most specific one containing it — so the * containment graph stays a tree and an aggregation at area scope has one answer per module. * Nested areas keep their shape: `src` names the area that holds what is directly in `src`, and * `src/query` its own, with `src` recorded as the parent. */ declare const deriveAreas: (options: DeriveAreasOptions) => readonly DerivedArea[]; /** * Ownership paths no observed entity lives under. * * A configured path that matches nothing is almost always a rename or a typo, and it is invisible * until something looks: the handoff still resolves, it just points at a directory that no longer * holds what it claims. */ declare const unobservedOwnershipPaths: (ownership: readonly AreaOwnership[], observedPaths: readonly string[]) => readonly AreaOwnership[]; /** * Jaro-Winkler similarity, mirroring `fuzzyMatchList` from `@agentskit/core/fuzzy-match`. * * The ecosystem owns this contract; it is mirrored rather than imported for the same reason the * eval format is: `@agentskit/core` is an optional peer, loaded dynamically, and discovery is * synchronous — an analyzer that resolved a reference only when an optional package happened to * be installed would make the snapshot depend on the installation. A test cross-checks these * functions against the real ones when the peer is present, so the mirror cannot drift. */ type FuzzyMatch = { readonly candidate: string; readonly score: number; }; /** Jaro similarity: matching characters within a sliding window, minus half the transpositions. */ declare const jaro: (a: string, b: string) => number; /** Jaro, plus a bonus for up to four shared leading characters. Case-insensitive by default. */ declare const jaroWinkler: (a: string, b: string, options?: { readonly caseSensitive?: boolean; }) => number; /** * Candidates grouped by length, so a scan only visits the lengths that can pass. * * Built once per universe and reused by every query. Without it, resolving references across a * repository is quadratic: each document rebuilt the candidate list and ran the full similarity * scan per reference, which on a four-thousand-document repository did not finish. */ type IndexedCandidate = { readonly value: string; /** Length after normalization, which is what the similarity compares. */ readonly length: number; readonly counts: Uint16Array; /** Position in the universe the index was built from, so a filtered scan stays in the caller's order. */ readonly order: number; }; type FuzzyCandidateIndex = { readonly byLength: ReadonlyMap; }; declare const fuzzyMatchList: (query: string, candidates: readonly string[] | FuzzyCandidateIndex, options?: { readonly threshold?: number; readonly topK?: number; readonly caseSensitive?: boolean; }) => FuzzyMatch[]; /** * Resolve a reference only when the evidence is unambiguous. * * A near-miss is a guess, and a guess in a knowledge graph is worse than a gap: it sends an agent * to the wrong file with the same confidence as a fact. So a fuzzy resolution requires a high * score *and* a single candidate at that score — two plausible targets mean the reference stays * unresolved and is reported instead. */ declare const FUZZY_RESOLUTION_THRESHOLD = 0.92; declare const resolveFuzzyReference: (query: string, candidates: readonly string[] | FuzzyCandidateIndex, threshold?: number) => { readonly candidate: string; readonly score: number; } | undefined; /** * The Markdown analyzer. * * Documentation was previously read with regular expressions: frontmatter by one, the `docbridge` * block by a hand-written YAML subset, and the prose not at all. Headings, links and inline code * were discarded — so a repository where 23 documents linked to other documents and 14 cited * source paths produced no edges from any of it, and one document in ninety-two counted as * documented. A real parser turns that prose into evidence-backed relations with line numbers, * which is the difference between a graph that knows what its documentation says and one that * only knows the documentation exists. * * Every edge here is `observed` with file and line evidence from the node's own position. Nothing * is inferred from a near-match unless the near-match is unambiguous. */ declare const MARKDOWN_ANALYZER_VERSION = "1.0.0"; /** A document with more relations than this is an index page; the tail adds noise, not knowledge. */ declare const MARKDOWN_RELATION_CAP = 64; type MarkdownHeading = { readonly depth: number; readonly text: string; readonly line: number; }; type MarkdownReference = { /** The link target, or the inline code token. */ readonly value: string; /** Link text, when the reference came from a link. */ readonly text?: string; readonly line: number; }; type MarkdownGeneratedRegion = { readonly lineStart: number; readonly lineEnd: number; readonly hash?: string; }; /** The frontmatter fields the knowledge model understands. Everything else is left alone. */ type MarkdownFrontmatter = { readonly type?: string; readonly audience?: string; readonly owner?: string; readonly lifecycle?: string; readonly tier?: string; }; type MarkdownDocumentV1 = { readonly path: string; readonly title?: string; readonly headings: readonly MarkdownHeading[]; readonly summary?: string; readonly wordCount: number; readonly frontmatter: MarkdownFrontmatter; readonly generatedRegions: readonly MarkdownGeneratedRegion[]; readonly contentHash: string; /** Links outside generated regions. */ readonly links: readonly MarkdownReference[]; /** Inline code tokens outside generated regions. */ readonly codeTokens: readonly MarkdownReference[]; /** Raw frontmatter text and the line it starts on, for the declaration parser. */ readonly frontmatterBlock?: { readonly value: string; readonly line: number; }; }; declare const declaredAudience: (frontmatter: MarkdownFrontmatter) => string | undefined; /** * The hash of a document's content, as the entity records it. * * A byte-order mark is not content — a file that only gained one parses to the same tree — so it * is stripped before hashing. Exported because deciding whether a document needs parsing at all * means computing the same hash without parsing it. */ declare const markdownContentHash: (content: string) => string; declare const parseMarkdownDocument: (path: string, content: string) => MarkdownDocumentV1; type MarkdownResolution = { /** Repository-relative paths of every scanned document. */ readonly documents: ReadonlyMap; /** Repository-relative module path to entity id. */ readonly modules: ReadonlyMap; /** Repository-relative directory path to area entity id. */ readonly areas?: ReadonlyMap; /** Package name, and short name, to entity id. */ readonly packages: ReadonlyMap; /** Exported symbol to the entity ids of every module exporting it. */ readonly symbols: ReadonlyMap; readonly relationCap?: number; /** * Path candidates for near-miss resolution, indexed by length. * * Built once per snapshot by the caller. Deriving it here meant rebuilding it for every document * — with four thousand documents and nine thousand modules, fifty-five million string copies * before any analysis, and a similarity scan over the whole universe per unresolved reference. * `markdownPathCandidateIndex` builds it from the same three maps, so a caller that omits it * still gets identical results, only slowly. */ readonly pathIndex?: FuzzyCandidateIndex; }; type MarkdownNote = { readonly scope: string; readonly reason: string; readonly evidence: readonly Evidence[]; }; type MarkdownAnalysis = { readonly relations: readonly KnowledgeRelation[]; readonly notes: readonly MarkdownNote[]; readonly truncated: boolean; }; declare const analyzeMarkdownDocument: (document: MarkdownDocumentV1, documentId: string, resolution: MarkdownResolution) => MarkdownAnalysis; declare const DEFAULT_SAFETY_EXCLUDES: readonly ["**/.git/**", "**/node_modules/**", "**/dist/**", "**/build/**", "**/coverage/**", "**/.doc-bridge/**", "**/.next/**", "**/out/**", "**/.turbo/**", "**/.svelte-kit/**", "**/.mcpb-build/**", "**/.mcpb-output/**", "**/.env", "**/.env.*", "**/*secret*", "**/*credential*", "**/*.pem", "**/*.key"]; type SafeWalkOptions = { readonly extensions?: readonly string[]; readonly exclude?: readonly string[]; readonly maxFiles?: number; readonly maxBytes?: number; readonly maxTimeMs?: number; readonly maxMemoryMb?: number; }; type SafeWalkResult = { readonly files: readonly string[]; readonly incomplete: boolean; readonly reason?: string; }; declare const containedPath: (root: string, candidate: string) => string | undefined; declare const safeWalkFiles: (root: string, options?: SafeWalkOptions) => SafeWalkResult; declare const redactSecrets: (value: string) => string; declare const redactValue: (value: unknown) => unknown; /** * What counts as a repository input, in one place. * * The discovery snapshot and the retrieval projection must walk the same files under the same * safety limits, or the index would claim to cover entities the snapshot does not have (or miss * ones it does). Sharing these definitions makes that agreement structural instead of a comment. */ declare const SOURCE_EXTENSIONS: readonly [".js", ".jsx", ".mjs", ".cjs", ".ts", ".tsx", ".mts", ".cts"]; declare const DOCUMENT_EXTENSIONS: readonly [".md", ".mdx"]; declare const CONFIG_EXTENSIONS: readonly [".json", ".yaml", ".yml", ".js", ".ts"]; declare const safeWalkOptions: (config: DocBridgeConfigV1 | undefined, overrides?: { readonly maxFiles?: number; readonly maxBytes?: number; }) => SafeWalkOptions; /** Which audience a documentation file is written for, from its location. */ declare const documentClassification: (path: string) => string; type ExportedNamesOptions = { /** * Skip names the module only forwards (`export { x } from './y'`). * * A barrel file re-exports hundreds of names it does not define. Treating those as definitions * makes almost every symbol look like it has two owners, which turns an unambiguous reference * into an ambiguous one — so the callers that need "the module that defines this" ask for * declarations only. */ readonly declaredOnly?: boolean; }; /** Every name a module exports, sorted. `*` stands for a star re-export. */ declare const exportedNames: (sourceFile: ts.SourceFile, options?: ExportedNamesOptions) => string[]; /** * Field-weighted BM25 (BM25F). * * Retrieval used to score a record by summing token lengths over one flattened haystack, which * made a long document beat a short exact match and gave every field the same authority. BM25 * fixes both: a term that appears in nearly every record earns almost nothing (IDF), a term in a * short title outranks the same term buried in a body (per-field length normalization), and the * field a term matched in is part of the result, so ranking can be explained rather than guessed. * * Ordering is total: score descending, then `ref` ascending. Scores are rounded before comparison * so a ranking is reproducible and never depends on floating-point accumulation order. */ declare const BM25_VERSION: 1; /** Per-field multipliers. A field absent from the map is not indexed at all. */ type Bm25FieldWeights = Readonly>; type Bm25Params = { /** Term-frequency saturation. Higher rewards repetition more. */ readonly k1?: number; /** Length-normalization strength, 0 to 1. */ readonly b?: number; }; type Bm25FieldValue = string | readonly string[] | undefined; type Bm25Input = { readonly ref: string; readonly fields: Readonly>; }; type Bm25Hit = { readonly ref: string; readonly score: number; /** Query terms that matched, per field, sorted. The raw material for an explain view. */ readonly matched: Readonly>; }; type IndexedDocument = { readonly ref: string; /** field -> term -> frequency, plus the field's token length. */ readonly fields: ReadonlyMap; readonly length: number; }>; }; type Bm25Index = { readonly documents: readonly IndexedDocument[]; readonly documentFrequency: ReadonlyMap; readonly averageFieldLength: ReadonlyMap; readonly weights: Bm25FieldWeights; readonly k1: number; readonly b: number; }; declare const buildBm25Index: (inputs: readonly Bm25Input[], weights: Bm25FieldWeights, params?: Bm25Params) => Bm25Index; /** Probabilistic IDF, floored at zero so a term in every document can never subtract score. */ declare const bm25Idf: (documentCount: number, documentFrequency: number) => number; /** * Score every document against the query terms. Documents with no matched term are omitted, so an * unrelated query returns nothing rather than a list of weak guesses. */ declare const bm25Search: (index: Bm25Index, terms: readonly string[]) => Bm25Hit[]; /** * Which field an agent's query is most likely aiming at, in ranking order. * * These are a starting point, not a truth: they live in the index so a repository can retune * retrieval from configuration, and a tuning change shows up as a changed artifact rather than a * silent behaviour change. `title` sits at the top because a record is about what its title says; * `aliases` carries the ids a record answers to; `body` sits at the bottom because a passing * mention in prose is the weakest evidence a record is the answer. */ declare const DEFAULT_SEARCH_WEIGHTS: Bm25FieldWeights; declare const DEFAULT_SEARCH_PARAMS: Required; /** Configured weights override the defaults field by field; an unknown field is ignored. */ declare const resolveSearchWeights: (configured?: Readonly>) => Bm25FieldWeights; declare const resolveSearchParams: (configured?: { readonly k1?: number | undefined; readonly b?: number | undefined; }) => Required; /** * Bumped whenever a stopword list or the token expansion changes. The index records it, so a * ranking that depended on a different list is visible rather than silently incomparable. */ declare const SEARCH_LEXICON_VERSION: 1; /** * Strip diacritics so `reconciliacao` and `reconciliação` are the same term. * * Non-English documentation is written with accents and queried without them at least as often as * the reverse, and a retrieval path that treats the two as different words fails a question it has * the answer to. Folding happens on both sides — the indexed text and the query — so the two can * never disagree. */ declare const foldAccents: (value: string) => string; declare const SEARCH_STOPWORDS: ReadonlySet; declare const isSearchStopword: (token: string) => boolean; /** Keep the deterministic search path usable for non-English documentation too. */ declare const tokenizeSearchText: (value: string) => string[]; /** * A code identifier or path, plus the words inside it. * * `reconcileKnowledge` yields the whole identifier and `reconcile` and `knowledge`, so an agent * that types the exact symbol gets an exact match while a human who half-remembers it still * lands nearby. `src/mcp/server.ts` yields the whole path and each segment without its extension. */ declare const expandSearchToken: (token: string) => string[]; /** * Collapse a plural to its singular so `schema` finds `schemas`. * * The substring matcher this path replaced accepted an optional plural suffix, and losing that * would have made an exact-term index quietly worse at the most ordinary query there is. These * are the safe rules only: applied to both the indexed text and the query, an imperfect stem * still matches itself, so the worst case is a missed relation rather than a wrong one. */ declare const singularizeSearchToken: (token: string) => string; type SearchTokenizeOptions = { /** Drop stopwords. On for queries and for indexed text; off only when a caller needs raw tokens. */ readonly dropStopwords?: boolean; /** Also emit the words inside an identifier or path. */ readonly expand?: boolean; }; /** * The tokenizer both indexing and querying use, so a term can never be present on one side and * absent on the other. */ declare const searchTokens: (value: string, options?: SearchTokenizeOptions) => string[]; declare const hasSearchToken: (hay: string, token: string) => boolean; /** * Reusing what has not changed. * * `EvidenceSchema.contentHash` has always existed and discovery never filled it, so every cache * and every overlay could only be keyed on "the whole repository changed" — true between any two * commits, and therefore useless. With a hash per file-backed entity, a second scan can tell which * files it has already read and skip the expensive part: the TypeScript parse and the Markdown * parse, which is where nearly all of discovery's time goes. * * Reuse is only sound when the answer cannot have changed, and two different things can change it: * * - An entity's own fields depend on its own bytes alone, so a hash match is enough to reuse it. * - A relation depends on what else exists. A module importing `./new.js` resolved to nothing * before that file was added and resolves to a module after; a document mentioning `src/new.ts` * gains an edge the moment the module appears. So relation reuse also requires that the universe * the references resolve against is identical, which is what the fingerprints below capture. * * The consequence is that a fast run and a cold run produce the same snapshot, byte for byte, or * the fast run does not happen. A cache that is only usually right is worse than no cache. */ declare const fileContentHash: (text: string) => string; /** Kinds whose entity is one file, and therefore hashable. */ declare const FILE_BACKED_KINDS: readonly ["module", "document", "package"]; type PriorFile = { readonly entity: KnowledgeEntity; readonly contentHash: string; /** Relations this entity is the source of. */ readonly outgoing: readonly KnowledgeRelation[]; /** Coverage entries scoped to this file. */ readonly coverage: readonly Coverage[]; }; /** What a caller may hand back from a previous scan. */ type PreviousSnapshot = Pick & Partial>; type PriorSnapshot = { readonly modules: ReadonlyMap; readonly documents: ReadonlyMap; readonly moduleUniverse: string; readonly resolution: string; /** Every entity by id, for re-adding an endpoint a reused relation still points at. */ readonly entities: ReadonlyMap; }; /** * Which names a module declares itself, as opposed to forwarding from somewhere else. * * The distinction decides where a documented symbol resolves to, and it is only visible in the * syntax tree — so a module that skipped its parse has to read it back from what the previous scan * recorded. `exports` minus `reexports` is that record. */ declare const declaredExportsOf: (entity: KnowledgeEntity) => readonly string[]; declare const exportsOf: (entity: KnowledgeEntity) => readonly string[]; /** * What a module's references resolve against: the module paths, the packages, and the compiler * options that decide how a specifier becomes a path. A change to any of them can turn an * unresolved import into a relation, so it invalidates relation reuse for every module. */ declare const moduleUniverseFingerprint: (input: { readonly modulePaths: readonly string[]; readonly packages: readonly { readonly id: string; readonly path: string; readonly name?: string; }[]; readonly compilerOptions: unknown; }) => string; /** * What a document's references resolve against: everything a module resolves against, plus the * documents, the areas, the package names and which module declares each exported symbol. */ declare const resolutionFingerprint: (input: { readonly moduleUniverse: string; readonly documentPaths: readonly string[]; readonly areaPaths: readonly string[]; readonly symbols: ReadonlyMap; }) => string; /** * Index a previous snapshot for reuse, and recompute the fingerprints it was built under. * * The fingerprints are derived rather than stored: everything they cover is in the snapshot * already, and a stored fingerprint is one more thing that can be stale or forged. */ declare const indexPriorSnapshot: (previous: PreviousSnapshot, compilerOptions: unknown) => PriorSnapshot; type ReuseLedger = { /** Entities taken from the previous snapshot instead of recomputed. */ reusedEntities: number; /** Files whose syntax tree or Markdown tree had to be built. */ parsedFiles: string[]; /** Files whose parse was skipped entirely. */ skippedFiles: string[]; /** Why relation reuse was refused, when it was. */ invalidated: string[]; }; /** * The reuse, as coverage. * * A run that is ten times faster than the last one has to be able to say why, or nobody can tell * a working cache from a broken scan. */ declare const reuseCoverage: (ledger: ReuseLedger) => Coverage; /** * Replay a reused entity's outgoing relations against the entity set that exists now. * * A relation whose internal target is gone is dropped rather than carried: the file it pointed at * was renamed or deleted, and a graph that keeps the edge is lying about the repository. An * external endpoint is re-added instead, because an external entity only exists in the snapshot * because something referenced it, and the thing that referenced it is exactly what was reused. */ declare const replayableRelations: (outgoing: readonly KnowledgeRelation[], existing: (id: string) => boolean) => { readonly relations: readonly KnowledgeRelation[]; readonly missingEndpoints: readonly string[]; readonly dropped: readonly KnowledgeRelation[]; }; type DiscoveryOptions = { readonly root?: string; readonly config?: DocBridgeConfigV1; readonly maxFiles?: number; readonly maxBytes?: number; /** * A snapshot from a previous scan. * * Entities whose file hash is unchanged are taken from it instead of parsed again. Supplying one * cannot change the result: a reused run either produces the same snapshot a cold run would, or * the reuse is refused. Omit it to scan from scratch. */ readonly previous?: PreviousSnapshot; }; declare const discoverRepository: (opts?: DiscoveryOptions) => DiscoverySnapshotV1; type DocumentationDiagnostic = { readonly code: string; readonly message: string; readonly path: string; readonly evidence: Evidence; }; type DocumentationDeclarationInput = { readonly path: string; readonly content: string; }; type DocumentationDeclarationOptions = { readonly snapshot: Pick; readonly documentId?: string; /** Agent corpus root used for conservative package/app path inference. */ readonly agentRoot?: string; readonly entityLookup?: EntityLookup; }; type DocumentationDeclarationResult = { readonly hasDocbridge: boolean; readonly entities: readonly KnowledgeEntity[]; readonly relations: readonly KnowledgeRelation[]; readonly diagnostics: readonly DocumentationDiagnostic[]; }; type DocumentationAnalysisResult = { readonly snapshot: DiscoverySnapshotV1; readonly diagnostics: readonly DocumentationDiagnostic[]; }; type EntityLookup = ReadonlyMap; declare const parseDocumentationDeclarations: (input: DocumentationDeclarationInput, options: DocumentationDeclarationOptions) => DocumentationDeclarationResult; declare const applyDocumentationDeclarations: (snapshot: DiscoverySnapshotV1, documents: readonly DocumentationDeclarationInput[], options?: Pick) => DocumentationAnalysisResult; declare const DOCUMENTATION_AUDIT_SCHEMA_VERSION: 1; declare const DocumentationAuditFindingSchema: z.ZodObject<{ id: z.ZodString; code: z.ZodString; category: z.ZodEnum<{ coverage: "coverage"; stale: "stale"; quality: "quality"; "structure-gap": "structure-gap"; contradiction: "contradiction"; redundancy: "redundancy"; "generated-freshness": "generated-freshness"; limitation: "limitation"; }>; status: z.ZodEnum<{ confirmed: "confirmed"; undocumented: "undocumented"; "stale-or-unverified": "stale-or-unverified"; conflict: "conflict"; unresolved: "unresolved"; "not-analyzed": "not-analyzed"; }>; severity: z.ZodEnum<{ error: "error"; off: "off"; info: "info"; warn: "warn"; }>; confidence: z.ZodEnum<{ high: "high"; medium: "medium"; low: "low"; }>; blocking: z.ZodBoolean; message: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; remediation: z.ZodOptional; }, z.core.$strict>; declare const DocumentationAuditDocumentSchema: z.ZodObject<{ path: z.ZodString; classification: z.ZodObject<{ type: z.ZodString; audience: z.ZodString; lifecycle: z.ZodString; tier: z.ZodEnum<{ "tier-0": "tier-0"; "tier-1": "tier-1"; "tier-2": "tier-2"; }>; critical: z.ZodBoolean; }, z.core.$strict>; metadata: z.ZodObject<{ owner: z.ZodBoolean; lifecycle: z.ZodBoolean; sourceOfTruth: z.ZodBoolean; validationPath: z.ZodBoolean; complete: z.ZodBoolean; missing: z.ZodArray>; }, z.core.$strict>; dimensions: z.ZodObject<{ correctness: z.ZodObject<{ status: z.ZodEnum<{ "not-analyzed": "not-analyzed"; partial: "partial"; validated: "validated"; }>; reason: z.ZodString; }, z.core.$strict>; completeness: z.ZodObject<{ status: z.ZodEnum<{ "not-analyzed": "not-analyzed"; partial: "partial"; validated: "validated"; }>; reason: z.ZodString; }, z.core.$strict>; clarity: z.ZodObject<{ status: z.ZodEnum<{ "not-analyzed": "not-analyzed"; partial: "partial"; validated: "validated"; }>; reason: z.ZodString; }, z.core.$strict>; agentEfficiency: z.ZodObject<{ status: z.ZodEnum<{ "not-analyzed": "not-analyzed"; partial: "partial"; validated: "validated"; }>; reason: z.ZodString; }, z.core.$strict>; maintainability: z.ZodObject<{ status: z.ZodEnum<{ "not-analyzed": "not-analyzed"; partial: "partial"; validated: "validated"; }>; reason: z.ZodString; }, z.core.$strict>; }, z.core.$strict>; example: z.ZodObject<{ present: z.ZodBoolean; validation: z.ZodEnum<{ "not-analyzed": "not-analyzed"; partial: "partial"; validated: "validated"; }>; }, z.core.$strict>; }, z.core.$strict>; type DocumentationAuditDocument = z.infer; declare const DocumentationAuditReportV1Schema: z.ZodObject<{ type: z.ZodLiteral<"documentation-audit-report">; schemaVersion: z.ZodLiteral<1>; contentHash: z.ZodString; contentHashAlgo: z.ZodLiteral<"sha256-normalized-v1">; project: z.ZodObject<{ name: z.ZodString; root: z.ZodOptional; }, z.core.$strict>; sourceRevision: z.ZodString; sourceRevisionKind: z.ZodEnum<{ git: "git"; content: "content"; }>; configurationHash: z.ZodString; pipelineVersion: z.ZodString; analyzerVersions: z.ZodRecord; snapshotHash: z.ZodString; reconciliationHash: z.ZodString; status: z.ZodEnum<{ pass: "pass"; "needs-review": "needs-review"; blocked: "blocked"; }>; findings: z.ZodArray; status: z.ZodEnum<{ confirmed: "confirmed"; undocumented: "undocumented"; "stale-or-unverified": "stale-or-unverified"; conflict: "conflict"; unresolved: "unresolved"; "not-analyzed": "not-analyzed"; }>; severity: z.ZodEnum<{ error: "error"; off: "off"; info: "info"; warn: "warn"; }>; confidence: z.ZodEnum<{ high: "high"; medium: "medium"; low: "low"; }>; blocking: z.ZodBoolean; message: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; remediation: z.ZodOptional; }, z.core.$strict>>; metrics: z.ZodObject<{ documentCount: z.ZodNumber; generatedDocumentCount: z.ZodNumber; packageCount: z.ZodNumber; coveredPackageCount: z.ZodNumber; coverageUnit: z.ZodOptional>; coverageRate: z.ZodNullable; documentsWithTitle: z.ZodNumber; titleRate: z.ZodNullable; documentsWithExamples: z.ZodNumber; examplesRate: z.ZodNullable; documentsMeetingRequiredSections: z.ZodNumber; requiredSectionsRate: z.ZodNullable; exactDuplicateGroups: z.ZodNumber; structureGapCount: z.ZodNumber; contradictionCount: z.ZodNumber; staleCount: z.ZodNumber; notAnalyzedCount: z.ZodNumber; blockingCount: z.ZodNumber; tierCounts: z.ZodObject<{ 'tier-0': z.ZodNumber; 'tier-1': z.ZodNumber; 'tier-2': z.ZodNumber; }, z.core.$strict>; criticalDocumentCount: z.ZodNumber; criticalDocumentsWithOwner: z.ZodNumber; criticalDocumentsWithLifecycle: z.ZodNumber; criticalDocumentsWithSourceOfTruth: z.ZodNumber; criticalDocumentsWithValidationPath: z.ZodNumber; dimensionStatus: z.ZodObject<{ correctness: z.ZodObject<{ validated: z.ZodNumber; partial: z.ZodNumber; 'not-analyzed': z.ZodNumber; }, z.core.$strict>; completeness: z.ZodObject<{ validated: z.ZodNumber; partial: z.ZodNumber; 'not-analyzed': z.ZodNumber; }, z.core.$strict>; clarity: z.ZodObject<{ validated: z.ZodNumber; partial: z.ZodNumber; 'not-analyzed': z.ZodNumber; }, z.core.$strict>; agentEfficiency: z.ZodObject<{ validated: z.ZodNumber; partial: z.ZodNumber; 'not-analyzed': z.ZodNumber; }, z.core.$strict>; maintainability: z.ZodObject<{ validated: z.ZodNumber; partial: z.ZodNumber; 'not-analyzed': z.ZodNumber; }, z.core.$strict>; }, z.core.$strict>; }, z.core.$strict>; documentAssessments: z.ZodArray; critical: z.ZodBoolean; }, z.core.$strict>; metadata: z.ZodObject<{ owner: z.ZodBoolean; lifecycle: z.ZodBoolean; sourceOfTruth: z.ZodBoolean; validationPath: z.ZodBoolean; complete: z.ZodBoolean; missing: z.ZodArray>; }, z.core.$strict>; dimensions: z.ZodObject<{ correctness: z.ZodObject<{ status: z.ZodEnum<{ "not-analyzed": "not-analyzed"; partial: "partial"; validated: "validated"; }>; reason: z.ZodString; }, z.core.$strict>; completeness: z.ZodObject<{ status: z.ZodEnum<{ "not-analyzed": "not-analyzed"; partial: "partial"; validated: "validated"; }>; reason: z.ZodString; }, z.core.$strict>; clarity: z.ZodObject<{ status: z.ZodEnum<{ "not-analyzed": "not-analyzed"; partial: "partial"; validated: "validated"; }>; reason: z.ZodString; }, z.core.$strict>; agentEfficiency: z.ZodObject<{ status: z.ZodEnum<{ "not-analyzed": "not-analyzed"; partial: "partial"; validated: "validated"; }>; reason: z.ZodString; }, z.core.$strict>; maintainability: z.ZodObject<{ status: z.ZodEnum<{ "not-analyzed": "not-analyzed"; partial: "partial"; validated: "validated"; }>; reason: z.ZodString; }, z.core.$strict>; }, z.core.$strict>; example: z.ZodObject<{ present: z.ZodBoolean; validation: z.ZodEnum<{ "not-analyzed": "not-analyzed"; partial: "partial"; validated: "validated"; }>; }, z.core.$strict>; }, z.core.$strict>>; generatedDocuments: z.ZodArray; }, z.core.$strict>>; limitations: z.ZodArray; }, z.core.$strict>; type DocumentationAuditFinding = z.infer; type DocumentationAuditReportV1 = z.infer; type DocumentationAuditOptions = { readonly root: string; readonly snapshot: DiscoverySnapshotV1; readonly declared: DiscoverySnapshotV1; readonly reconciliation: ReconciliationReportV1; readonly declarationDiagnostics?: readonly DocumentationDiagnostic[]; readonly config?: DocumentationAuditConfig; }; declare const auditDocumentation: (options: DocumentationAuditOptions) => DocumentationAuditReportV1; declare const formatDocumentationAuditText: (report: DocumentationAuditReportV1) => readonly string[]; declare const DEFAULT_REGISTRY_AGENT_ID = "ecosystem-doc-bridge-corpus-scanner"; declare const RegistryAgentMetadataSchema: z.ZodObject<{ id: z.ZodString; version: z.ZodString; provider: z.ZodOptional; model: z.ZodOptional; capabilities: z.ZodDefault>; }, z.core.$strict>; type RegistryAgentMetadata = z.infer & { readonly root: string; }; type RegistryAgentContext = { readonly snapshot: DiscoverySnapshotV1; readonly report: ReconciliationReportV1; readonly evidence: readonly ReconciliationReportV1['diagnostics'][number]['evidence'][number][]; readonly documentation?: Pick; readonly capabilities: readonly ['snapshot.read', 'evidence.read', 'proposal.write']; readonly network: false; readonly shell: false; readonly deterministic: boolean; }; type RegistryAgentRunner = (context: RegistryAgentContext) => Promise | unknown; /** * The v2 protocol: a task and a bounded set of context packs, never the snapshot. * * `curate` and `review` return `proposals` — `EnrichmentProposalV1` values, validated by the * enrich stage, never here; `adjudicate` returns adjudications under the same key. The adapter * checks transport and budget and returns the raw array: grounding is the validators' job, and * keeping it there is what makes a stored overlay reproducible from its proposals. */ declare const REGISTRY_AGENT_PROTOCOL_V2 = "doc-bridge.registry-agent.v2"; type RegistryEnrichmentContext = { readonly protocol: typeof REGISTRY_AGENT_PROTOCOL_V2; readonly task: 'curate' | 'review' | 'adjudicate'; readonly role: string; readonly promptVersion: string; readonly packs: readonly unknown[]; readonly capabilities: readonly ['pack.read', 'proposal.write']; readonly network: false; readonly shell: false; readonly deterministic: boolean; }; type RegistryAgentAdapter = { readonly metadata: RegistryAgentMetadata; readonly run: (snapshot: DiscoverySnapshotV1, report: ReconciliationReportV1, evidence?: readonly RegistryAgentContext['evidence'][number][], documentation?: DocumentationAuditReportV1) => Promise; /** Send packs for a task and return the raw `proposals` array. Throws on transport, budget or shape failure. */ readonly enrich: (task: RegistryEnrichmentContext['task'], packs: readonly unknown[], options?: { readonly role?: string; readonly promptVersion?: string; }) => Promise; }; declare const loadRegistryAgentRunner: (root: string, config: DocBridgeConfigV1) => Promise; declare const loadRegistryAgentMetadata: (root: string, config: DocBridgeConfigV1) => RegistryAgentMetadata; declare const createRegistryAgentAdapter: (root: string, config: DocBridgeConfigV1, runner?: RegistryAgentRunner) => RegistryAgentAdapter; declare const persistRegistryAgentProposal: (stateDir: string, proposal: AgentProposalV1) => string; type ReconciliationOptions = { /** Compare declarations at a semantic level while retaining raw discovery evidence. */ readonly scope?: 'file' | 'module' | 'area' | 'package'; /** Omit for backwards-compatible all-relation checking; [] disables missing-declaration findings. */ readonly requiredRelationKinds?: readonly string[]; /** Limit missing-declaration findings to relations between internal project entities. */ readonly requiredRelationTargets?: 'all' | 'internal'; /** Emit one bounded finding for each observed Markdown document without declarations. */ readonly includeOrphanedDocuments?: boolean; /** * Configured ownership records, so a path that matches nothing observed can be reported. * Omit to skip the check. */ readonly ownership?: readonly { readonly id: string; readonly path: string; }[]; /** Where the ownership records were configured, for the evidence trail. */ readonly ownershipSource?: string; /** Report import cycles. On by default; a cycle is structure, and structure is what this compares. */ readonly reportImportCycles?: boolean; }; declare const reconcileKnowledge: (observed: DiscoverySnapshotV1, declared: DiscoverySnapshotV1, options?: ReconciliationOptions) => ReconciliationReportV1; type OfflineReportInput = { readonly snapshot: DiscoverySnapshotV1; readonly report: ReconciliationReportV1; }; type OfflineReportOptions = { readonly includeSnippets?: boolean; readonly privacy?: 'private' | 'anonymized'; }; type OfflineReportArtifact = { readonly mode: 'single-file' | 'directory'; readonly indexHtml: string; readonly files: Readonly>; readonly manifest: string; }; declare const DEFAULT_LARGE_REPORT_THRESHOLD_BYTES = 5000000; declare const renderOfflineReport: (input: unknown, options?: OfflineReportOptions) => string; declare const renderOfflineReportArtifact: (input: unknown, options?: OfflineReportOptions & { readonly thresholdBytes?: number; }) => OfflineReportArtifact; type FixProposalOptions = { readonly baseRevision: string; readonly configurationHash: string; readonly projectName?: string; readonly toolVersion?: string; }; type FixApplyOptions = { readonly currentRevision?: string; readonly verify?: (changedPaths: readonly string[]) => void; }; declare const createMarkdownLinkFixProposal: (root: string, options: FixProposalOptions) => FixProposalV1 | undefined; declare const createArtifactNormalizationProposal: (root: string, artifactPath: string, options: FixProposalOptions) => FixProposalV1 | undefined; declare const approveFixProposal: (proposalInput: unknown, approvedBy: string, approvedAt?: string) => FixProposalV1; declare const applyFixProposal: (root: string, proposalInput: unknown, options?: FixApplyOptions) => FixProposalV1; /** * `enrich` sits between `reconcile` and `evaluate` and is run only by `ak-docs enrich` or * `check --enrich`: a plain `check` leaves its step pending, and `evaluate` reads a null * previous output rather than an overlay. A missing, failed or stale enrich step never changes * what `evaluate` or `report` produce. */ declare const WORKFLOW_STAGES: readonly ["collect", "normalize", "reconcile", "enrich", "evaluate", "report"]; type WorkflowStage = (typeof WORKFLOW_STAGES)[number]; type WorkflowStageContext = { readonly root: string; readonly stage: WorkflowStage; readonly input: unknown; readonly previousOutput: unknown; }; type WorkflowStageHandler = (context: WorkflowStageContext) => unknown; type WorkflowOptions = { readonly root: string; readonly stateDir?: string; readonly sourceRevision: string; readonly configurationHash: string; readonly toolVersion?: string; readonly pipelineVersion?: string; readonly analyzerVersions?: Readonly>; readonly runId?: string; readonly correlation?: CorrelationContextV1; readonly stage?: WorkflowStage | 'all'; readonly inputs?: Partial>; readonly handlers: Partial>; readonly shouldCancel?: () => boolean; }; type WorkflowExecutionResult = { readonly run: WorkflowRunV1; readonly stateDir: string; readonly reusedStages: readonly WorkflowStage[]; }; declare const runWorkflow: (options: WorkflowOptions) => WorkflowExecutionResult; declare const loadWorkflowManifest: (stateDir: string) => WorkflowRunV1; declare const loadWorkflowStepOutput: (stateDir: string, stage: WorkflowStage) => unknown; declare const STUDY_PROVIDER_CLI_SCHEMA_VERSION: 1; declare const STUDY_PROVIDER_CLI_CONTENT_HASH_ALGO: "sha256-normalized-v1"; declare const pricing: z.ZodObject<{ currency: z.ZodLiteral<"USD">; inputPerMillionUsd: z.ZodNumber; cachedInputPerMillionUsd: z.ZodNumber; outputPerMillionUsd: z.ZodNumber; }, z.core.$strict>; declare const adjudicatorConfig: z.ZodObject<{ command: z.ZodString; args: z.ZodDefault>; envAllowlist: z.ZodDefault>; providerNetwork: z.ZodBoolean; maxInputBytes: z.ZodNumber; maxOutputBytes: z.ZodNumber; pricing: z.ZodOptional; inputPerMillionUsd: z.ZodNumber; cachedInputPerMillionUsd: z.ZodNumber; outputPerMillionUsd: z.ZodNumber; }, z.core.$strict>>; id: z.ZodString; modelId: z.ZodString; }, z.core.$strict>; declare const StudyProviderCliConfigV1Schema: z.ZodObject<{ type: z.ZodLiteral<"study-provider-cli-config">; schemaVersion: z.ZodLiteral<1>; configVersion: z.ZodString; providers: z.ZodArray>; envAllowlist: z.ZodDefault>; providerNetwork: z.ZodBoolean; maxInputBytes: z.ZodNumber; maxOutputBytes: z.ZodNumber; pricing: z.ZodOptional; inputPerMillionUsd: z.ZodNumber; cachedInputPerMillionUsd: z.ZodNumber; outputPerMillionUsd: z.ZodNumber; }, z.core.$strict>>; modelId: z.ZodString; scenarioIds: z.ZodArray>; }, z.core.$strict>>; adjudicator: z.ZodOptional>; envAllowlist: z.ZodDefault>; providerNetwork: z.ZodBoolean; maxInputBytes: z.ZodNumber; maxOutputBytes: z.ZodNumber; pricing: z.ZodOptional; inputPerMillionUsd: z.ZodNumber; cachedInputPerMillionUsd: z.ZodNumber; outputPerMillionUsd: z.ZodNumber; }, z.core.$strict>>; id: z.ZodString; modelId: z.ZodString; }, z.core.$strict>>; contentHash: z.ZodString; contentHashAlgo: z.ZodLiteral<"sha256-normalized-v1">; }, z.core.$strict>; type StudyProviderCliConfigV1 = z.infer; type StudyProviderCli = StudyProviderCliConfigV1['providers'][number]; type StudyProviderCostPricing = z.infer; type StudyAdjudicatorCli = z.infer; declare const createStudyProviderCliConfig: (input: unknown) => StudyProviderCliConfigV1; declare const parseStudyProviderCliConfig: (input: unknown) => StudyProviderCliConfigV1; declare const providerForStudyExecution: (config: StudyProviderCliConfigV1, modelId: string, scenarioId: StudyProviderCli["scenarioIds"][number]) => StudyProviderCli; declare const calculateStudyCostUsd: (pricing: StudyProviderCostPricing | undefined, usage: { readonly inputTokens?: number; readonly cachedInputTokens?: number; readonly outputTokens?: number; }) => number | undefined; declare const validateStudyProviderCommand: (provider: Pick, cwd: string) => void; declare const formatStudyProviderCliText: (config: StudyProviderCliConfigV1) => readonly string[]; declare const STUDY_RUNNER_SCHEMA_VERSION: 1; declare const STUDY_RUNNER_CONTENT_HASH_ALGO: "sha256-normalized-v1"; declare const TaskExecutionSchema: z.ZodObject<{ taskId: z.ZodString; repositoryId: z.ZodString; category: z.ZodEnum<{ documentation: "documentation"; discovery: "discovery"; architecture: "architecture"; implementation: "implementation"; }>; scenarioId: z.ZodEnum<{ "repository-only": "repository-only"; "deterministic-doc-bridge": "deterministic-doc-bridge"; "registry-assisted": "registry-assisted"; }>; modelId: z.ZodString; replicate: z.ZodNumber; variantId: z.ZodString; difficulty: z.ZodOptional>; }, z.core.$strict>; declare const ControlledStudyRunPlanV1Schema: z.ZodObject<{ type: z.ZodLiteral<"controlled-study-run-plan">; schemaVersion: z.ZodLiteral<1>; planVersion: z.ZodString; protocolVersion: z.ZodString; protocolHash: z.ZodString; taskSuiteHash: z.ZodString; sourceRevisionHash: z.ZodString; configurationHash: z.ZodString; docBridgeVersion: z.ZodString; models: z.ZodArray; provider: z.ZodString; model: z.ZodString; version: z.ZodString; parametersHash: z.ZodString; contextLimit: z.ZodNumber; toolConfigurationHash: z.ZodString; promptContractHash: z.ZodString; }, z.core.$strict>>; scenarios: z.ZodArray; agentId: z.ZodOptional; agentVersion: z.ZodOptional; promptVersion: z.ZodOptional; agentBudget: z.ZodOptional>; network: z.ZodLiteral; }, z.core.$strict>>; taskIds: z.ZodArray; sampling: z.ZodDiscriminatedUnion<[z.ZodObject<{ strategy: z.ZodLiteral<"balanced-task-strata">; sampleSize: z.ZodNumber; }, z.core.$strict>, z.ZodObject<{ strategy: z.ZodLiteral<"pairwise-task-strata">; sampleSize: z.ZodNumber; scenarioIds: z.ZodArray>; }, z.core.$strict>], "strategy">; budget: z.ZodObject<{ maxTokens: z.ZodNumber; maxRuntimeMs: z.ZodNumber; maxOutputBytes: z.ZodNumber; maxAttempts: z.ZodNumber; }, z.core.$strict>; runId: z.ZodString; contentHash: z.ZodString; contentHashAlgo: z.ZodLiteral<"sha256-normalized-v1">; }, z.core.$strict>; type ControlledStudyRunPlanV1 = z.infer; type TaskExecutionV1 = z.infer; declare const ControlledStudyObservationV1Schema: z.ZodObject<{ type: z.ZodLiteral<"controlled-study-observation">; schemaVersion: z.ZodLiteral<1>; observationVersion: z.ZodString; observedAt: z.ZodString; runId: z.ZodString; planHash: z.ZodString; task: z.ZodObject<{ taskId: z.ZodString; repositoryId: z.ZodString; category: z.ZodEnum<{ documentation: "documentation"; discovery: "discovery"; architecture: "architecture"; implementation: "implementation"; }>; scenarioId: z.ZodEnum<{ "repository-only": "repository-only"; "deterministic-doc-bridge": "deterministic-doc-bridge"; "registry-assisted": "registry-assisted"; }>; modelId: z.ZodString; replicate: z.ZodNumber; variantId: z.ZodString; difficulty: z.ZodOptional>; }, z.core.$strict>; model: z.ZodObject<{ id: z.ZodString; role: z.ZodEnum<{ reference: "reference"; "low-cost": "low-cost"; }>; provider: z.ZodString; model: z.ZodString; version: z.ZodString; parametersHash: z.ZodString; contextLimit: z.ZodNumber; toolConfigurationHash: z.ZodString; promptContractHash: z.ZodString; }, z.core.$strict>; scenario: z.ZodObject<{ id: z.ZodEnum<{ "repository-only": "repository-only"; "deterministic-doc-bridge": "deterministic-doc-bridge"; "registry-assisted": "registry-assisted"; }>; agentId: z.ZodOptional; agentVersion: z.ZodOptional; promptVersion: z.ZodOptional; agentBudget: z.ZodOptional>; network: z.ZodLiteral; }, z.core.$strict>; execution: z.ZodObject<{ status: z.ZodEnum<{ failed: "failed"; completed: "completed"; "timed-out": "timed-out"; unavailable: "unavailable"; "invalid-output": "invalid-output"; "budget-exceeded": "budget-exceeded"; }>; exitCode: z.ZodNullable; signal: z.ZodNullable; durationMs: z.ZodNumber; responseBytes: z.ZodNumber; stderrBytes: z.ZodNumber; stdoutHash: z.ZodOptional; stderrHash: z.ZodOptional; inputTokens: z.ZodOptional; outputTokens: z.ZodOptional; tokenMethod: z.ZodOptional>; toolCalls: z.ZodOptional; firstEvidenceLatencyMs: z.ZodOptional; errorCode: z.ZodOptional; }, z.core.$strict>; contextBytes: z.ZodNumber; contextTokens: z.ZodOptional; contextTokenMethod: z.ZodOptional>; evidenceIds: z.ZodArray; round: z.ZodOptional; taskOutcome: z.ZodOptional>; evidenceQuality: z.ZodOptional>; safetyOutcome: z.ZodOptional>; firstEvidenceLatencyMs: z.ZodOptional; clarificationRequests: z.ZodOptional; reworkCount: z.ZodOptional; measurements: z.ZodOptional>; adjudication: z.ZodObject<{ status: z.ZodEnum<{ pending: "pending"; "human-rejected": "human-rejected"; automated: "automated"; "human-approved": "human-approved"; }>; actor: z.ZodOptional; method: z.ZodOptional; outcome: z.ZodOptional>; confidence: z.ZodOptional; reasonCodes: z.ZodOptional>; tokenMethod: z.ZodOptional>; configurationHash: z.ZodOptional; reason: z.ZodOptional; }, z.core.$strict>; contentHash: z.ZodString; contentHashAlgo: z.ZodLiteral<"sha256-normalized-v1">; }, z.core.$strict>; type ControlledStudyObservationV1 = z.infer; declare const ControlledStudyObservationLedgerV1Schema: z.ZodObject<{ type: z.ZodLiteral<"controlled-study-observation-ledger">; schemaVersion: z.ZodLiteral<1>; ledgerVersion: z.ZodString; observations: z.ZodArray; schemaVersion: z.ZodLiteral<1>; observationVersion: z.ZodString; observedAt: z.ZodString; runId: z.ZodString; planHash: z.ZodString; task: z.ZodObject<{ taskId: z.ZodString; repositoryId: z.ZodString; category: z.ZodEnum<{ documentation: "documentation"; discovery: "discovery"; architecture: "architecture"; implementation: "implementation"; }>; scenarioId: z.ZodEnum<{ "repository-only": "repository-only"; "deterministic-doc-bridge": "deterministic-doc-bridge"; "registry-assisted": "registry-assisted"; }>; modelId: z.ZodString; replicate: z.ZodNumber; variantId: z.ZodString; difficulty: z.ZodOptional>; }, z.core.$strict>; model: z.ZodObject<{ id: z.ZodString; role: z.ZodEnum<{ reference: "reference"; "low-cost": "low-cost"; }>; provider: z.ZodString; model: z.ZodString; version: z.ZodString; parametersHash: z.ZodString; contextLimit: z.ZodNumber; toolConfigurationHash: z.ZodString; promptContractHash: z.ZodString; }, z.core.$strict>; scenario: z.ZodObject<{ id: z.ZodEnum<{ "repository-only": "repository-only"; "deterministic-doc-bridge": "deterministic-doc-bridge"; "registry-assisted": "registry-assisted"; }>; agentId: z.ZodOptional; agentVersion: z.ZodOptional; promptVersion: z.ZodOptional; agentBudget: z.ZodOptional>; network: z.ZodLiteral; }, z.core.$strict>; execution: z.ZodObject<{ status: z.ZodEnum<{ failed: "failed"; completed: "completed"; "timed-out": "timed-out"; unavailable: "unavailable"; "invalid-output": "invalid-output"; "budget-exceeded": "budget-exceeded"; }>; exitCode: z.ZodNullable; signal: z.ZodNullable; durationMs: z.ZodNumber; responseBytes: z.ZodNumber; stderrBytes: z.ZodNumber; stdoutHash: z.ZodOptional; stderrHash: z.ZodOptional; inputTokens: z.ZodOptional; outputTokens: z.ZodOptional; tokenMethod: z.ZodOptional>; toolCalls: z.ZodOptional; firstEvidenceLatencyMs: z.ZodOptional; errorCode: z.ZodOptional; }, z.core.$strict>; contextBytes: z.ZodNumber; contextTokens: z.ZodOptional; contextTokenMethod: z.ZodOptional>; evidenceIds: z.ZodArray; round: z.ZodOptional; taskOutcome: z.ZodOptional>; evidenceQuality: z.ZodOptional>; safetyOutcome: z.ZodOptional>; firstEvidenceLatencyMs: z.ZodOptional; clarificationRequests: z.ZodOptional; reworkCount: z.ZodOptional; measurements: z.ZodOptional>; adjudication: z.ZodObject<{ status: z.ZodEnum<{ pending: "pending"; "human-rejected": "human-rejected"; automated: "automated"; "human-approved": "human-approved"; }>; actor: z.ZodOptional; method: z.ZodOptional; outcome: z.ZodOptional>; confidence: z.ZodOptional; reasonCodes: z.ZodOptional>; tokenMethod: z.ZodOptional>; configurationHash: z.ZodOptional; reason: z.ZodOptional; }, z.core.$strict>; contentHash: z.ZodString; contentHashAlgo: z.ZodLiteral<"sha256-normalized-v1">; }, z.core.$strict>>; contentHash: z.ZodString; contentHashAlgo: z.ZodLiteral<"sha256-normalized-v1">; }, z.core.$strict>; type ControlledStudyObservationLedgerV1 = z.infer; declare const createControlledStudyRunPlan: (input: unknown) => ControlledStudyRunPlanV1; declare const parseControlledStudyRunPlan: (input: unknown) => ControlledStudyRunPlanV1; declare const createControlledStudyObservation: (input: unknown) => ControlledStudyObservationV1; declare const parseControlledStudyObservation: (input: unknown) => ControlledStudyObservationV1; declare const createControlledStudyLedger: (input: unknown) => ControlledStudyObservationLedgerV1; declare const parseControlledStudyLedger: (input: unknown) => ControlledStudyObservationLedgerV1; declare const upsertControlledStudyObservation: (ledger: ControlledStudyObservationLedgerV1, observation: ControlledStudyObservationV1) => ControlledStudyObservationLedgerV1; type ControlledCommandRequest = { readonly plan: ControlledStudyRunPlanV1; readonly execution: TaskExecutionV1; readonly command: string; readonly args?: readonly string[]; readonly cwd: string; readonly input?: string; readonly envAllowlist?: readonly string[]; readonly maxRuntimeMs?: number; readonly maxOutputBytes?: number; readonly contextBytes: number; readonly contextTokens?: number; readonly contextTokenMethod?: 'provider' | 'estimate'; readonly round?: string; readonly taskOutcome?: 'success' | 'partial' | 'incorrect' | 'incomplete' | 'blocked'; readonly evidenceQuality?: 'high' | 'medium' | 'low'; readonly safetyOutcome?: 'safe' | 'unsafe' | 'not-applicable'; readonly firstEvidenceLatencyMs?: number; readonly clarificationRequests?: number; readonly reworkCount?: number; readonly measurements?: Readonly>; readonly providerPricing?: StudyProviderCostPricing; }; declare const runControlledCommand: (request: ControlledCommandRequest) => Promise; declare const persistControlledStudyLedger: (path: string, ledger: ControlledStudyObservationLedgerV1) => string; declare const formatControlledStudyRunPlanText: (plan: ControlledStudyRunPlanV1) => readonly string[]; declare const STUDY_METRICS_SCHEMA_VERSION: 1; declare const StudyMetricSetSchema: z.ZodObject<{ observationCount: z.ZodNumber; completedRate: z.ZodNumber; completedConfidence95: z.ZodObject<{ low: z.ZodNumber; high: z.ZodNumber; }, z.core.$strict>; adjudicatedRate: z.ZodNumber; successRate: z.ZodNullable; successConfidence95: z.ZodNullable>; evidenceCitationRate: z.ZodNumber; evidenceQualityRate: z.ZodNullable; searchHitRate: z.ZodNullable; acceptanceCheckRate: z.ZodNullable; errorRate: z.ZodNullable; safetyRate: z.ZodNullable; adjudicatedSuccessRate: z.ZodNullable; documentationFindingCount: z.ZodNullable; documentationExampleRate: z.ZodNullable; documentationFreshnessRate: z.ZodNullable; documentationCorrectnessRate: z.ZodNullable; documentationCompletenessRate: z.ZodNullable; documentationClarityRate: z.ZodNullable; documentationMaintainabilityRate: z.ZodNullable; providerTokens: z.ZodNullable; estimatedTokens: z.ZodNullable; tokensToCorrectAnswerP95: z.ZodNullable; tokensToFirstEvidenceP95: z.ZodNullable; latencyP95Ms: z.ZodNumber; timeToCorrectAnswerP95Ms: z.ZodNullable; contextBytesP95: z.ZodNumber; responseBytesP95: z.ZodNumber; averageToolCalls: z.ZodNullable; clarificationRate: z.ZodNullable; reworkRate: z.ZodNullable; analysisCostUsd: z.ZodNullable; agentCostUsd: z.ZodNullable; registryAgentCostUsd: z.ZodNullable; registryAgentRuns: z.ZodNullable; totalCostUsd: z.ZodNullable; providerTokenCostUnits: z.ZodNullable; missingMetrics: z.ZodArray; }, z.core.$strict>; declare const StudyMetricGroupSchema: z.ZodObject<{ scope: z.ZodEnum<{ model: "model"; repository: "repository"; category: "category"; task: "task"; aggregate: "aggregate"; scenario: "scenario"; replicate: "replicate"; difficulty: "difficulty"; }>; key: z.ZodString; round: z.ZodString; metrics: z.ZodObject<{ observationCount: z.ZodNumber; completedRate: z.ZodNumber; completedConfidence95: z.ZodObject<{ low: z.ZodNumber; high: z.ZodNumber; }, z.core.$strict>; adjudicatedRate: z.ZodNumber; successRate: z.ZodNullable; successConfidence95: z.ZodNullable>; evidenceCitationRate: z.ZodNumber; evidenceQualityRate: z.ZodNullable; searchHitRate: z.ZodNullable; acceptanceCheckRate: z.ZodNullable; errorRate: z.ZodNullable; safetyRate: z.ZodNullable; adjudicatedSuccessRate: z.ZodNullable; documentationFindingCount: z.ZodNullable; documentationExampleRate: z.ZodNullable; documentationFreshnessRate: z.ZodNullable; documentationCorrectnessRate: z.ZodNullable; documentationCompletenessRate: z.ZodNullable; documentationClarityRate: z.ZodNullable; documentationMaintainabilityRate: z.ZodNullable; providerTokens: z.ZodNullable; estimatedTokens: z.ZodNullable; tokensToCorrectAnswerP95: z.ZodNullable; tokensToFirstEvidenceP95: z.ZodNullable; latencyP95Ms: z.ZodNumber; timeToCorrectAnswerP95Ms: z.ZodNullable; contextBytesP95: z.ZodNumber; responseBytesP95: z.ZodNumber; averageToolCalls: z.ZodNullable; clarificationRate: z.ZodNullable; reworkRate: z.ZodNullable; analysisCostUsd: z.ZodNullable; agentCostUsd: z.ZodNullable; registryAgentCostUsd: z.ZodNullable; registryAgentRuns: z.ZodNullable; totalCostUsd: z.ZodNullable; providerTokenCostUnits: z.ZodNullable; missingMetrics: z.ZodArray; }, z.core.$strict>; }, z.core.$strict>; declare const StudyMetricComparisonSchema: z.ZodObject<{ scope: z.ZodEnum<{ model: "model"; repository: "repository"; category: "category"; task: "task"; aggregate: "aggregate"; scenario: "scenario"; replicate: "replicate"; difficulty: "difficulty"; }>; key: z.ZodString; baselineRound: z.ZodString; currentRound: z.ZodString; baselineSampleSize: z.ZodNumber; currentSampleSize: z.ZodNumber; metrics: z.ZodObject<{ completedRate: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; successRate: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; evidenceCitationRate: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; evidenceQualityRate: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; searchHitRate: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; acceptanceCheckRate: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; errorRate: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; safetyRate: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; adjudicatedSuccessRate: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; documentationFindingCount: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; documentationExampleRate: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; documentationFreshnessRate: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; documentationCorrectnessRate: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; documentationCompletenessRate: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; documentationClarityRate: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; documentationMaintainabilityRate: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; providerTokens: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; estimatedTokens: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; tokensToCorrectAnswerP95: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; tokensToFirstEvidenceP95: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; registryAgentCostUsd: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; latencyP95Ms: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; timeToCorrectAnswerP95Ms: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; contextBytesP95: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; responseBytesP95: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; clarificationRate: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; reworkRate: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; analysisCostUsd: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; agentCostUsd: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; totalCostUsd: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; providerTokenCostUnits: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; }, z.core.$strict>; status: z.ZodEnum<{ "not-analyzed": "not-analyzed"; improved: "improved"; unchanged: "unchanged"; regressed: "regressed"; inconclusive: "inconclusive"; }>; regressions: z.ZodArray; limitations: z.ZodArray; }, z.core.$strict>; declare const StudyMetricsReportV1Schema: z.ZodObject<{ type: z.ZodLiteral<"controlled-study-metrics">; schemaVersion: z.ZodLiteral<1>; metricsVersion: z.ZodString; contentHash: z.ZodString; contentHashAlgo: z.ZodLiteral<"sha256-normalized-v1">; observationCount: z.ZodNumber; rounds: z.ZodArray; baselineRound: z.ZodNullable; currentRound: z.ZodNullable; baselineRunId: z.ZodOptional>; currentRunId: z.ZodOptional>; groups: z.ZodArray; key: z.ZodString; round: z.ZodString; metrics: z.ZodObject<{ observationCount: z.ZodNumber; completedRate: z.ZodNumber; completedConfidence95: z.ZodObject<{ low: z.ZodNumber; high: z.ZodNumber; }, z.core.$strict>; adjudicatedRate: z.ZodNumber; successRate: z.ZodNullable; successConfidence95: z.ZodNullable>; evidenceCitationRate: z.ZodNumber; evidenceQualityRate: z.ZodNullable; searchHitRate: z.ZodNullable; acceptanceCheckRate: z.ZodNullable; errorRate: z.ZodNullable; safetyRate: z.ZodNullable; adjudicatedSuccessRate: z.ZodNullable; documentationFindingCount: z.ZodNullable; documentationExampleRate: z.ZodNullable; documentationFreshnessRate: z.ZodNullable; documentationCorrectnessRate: z.ZodNullable; documentationCompletenessRate: z.ZodNullable; documentationClarityRate: z.ZodNullable; documentationMaintainabilityRate: z.ZodNullable; providerTokens: z.ZodNullable; estimatedTokens: z.ZodNullable; tokensToCorrectAnswerP95: z.ZodNullable; tokensToFirstEvidenceP95: z.ZodNullable; latencyP95Ms: z.ZodNumber; timeToCorrectAnswerP95Ms: z.ZodNullable; contextBytesP95: z.ZodNumber; responseBytesP95: z.ZodNumber; averageToolCalls: z.ZodNullable; clarificationRate: z.ZodNullable; reworkRate: z.ZodNullable; analysisCostUsd: z.ZodNullable; agentCostUsd: z.ZodNullable; registryAgentCostUsd: z.ZodNullable; registryAgentRuns: z.ZodNullable; totalCostUsd: z.ZodNullable; providerTokenCostUnits: z.ZodNullable; missingMetrics: z.ZodArray; }, z.core.$strict>; }, z.core.$strict>>; comparisons: z.ZodArray; key: z.ZodString; baselineRound: z.ZodString; currentRound: z.ZodString; baselineSampleSize: z.ZodNumber; currentSampleSize: z.ZodNumber; metrics: z.ZodObject<{ completedRate: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; successRate: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; evidenceCitationRate: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; evidenceQualityRate: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; searchHitRate: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; acceptanceCheckRate: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; errorRate: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; safetyRate: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; adjudicatedSuccessRate: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; documentationFindingCount: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; documentationExampleRate: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; documentationFreshnessRate: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; documentationCorrectnessRate: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; documentationCompletenessRate: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; documentationClarityRate: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; documentationMaintainabilityRate: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; providerTokens: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; estimatedTokens: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; tokensToCorrectAnswerP95: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; tokensToFirstEvidenceP95: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; registryAgentCostUsd: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; latencyP95Ms: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; timeToCorrectAnswerP95Ms: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; contextBytesP95: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; responseBytesP95: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; clarificationRate: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; reworkRate: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; analysisCostUsd: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; agentCostUsd: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; totalCostUsd: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; providerTokenCostUnits: z.ZodObject<{ baseline: z.ZodNullable; current: z.ZodNullable; absoluteChange: z.ZodNullable; relativeChange: z.ZodNullable; }, z.core.$strict>; }, z.core.$strict>; status: z.ZodEnum<{ "not-analyzed": "not-analyzed"; improved: "improved"; unchanged: "unchanged"; regressed: "regressed"; inconclusive: "inconclusive"; }>; regressions: z.ZodArray; limitations: z.ZodArray; }, z.core.$strict>>; limitations: z.ZodArray; }, z.core.$strict>; type StudyMetricSetV1 = z.infer; type StudyMetricGroupV1 = z.infer; type StudyMetricComparisonV1 = z.infer; type StudyMetricsReportV1 = z.infer; declare const calculateStudyMetrics: (observations: readonly ControlledStudyObservationV1[], options?: { readonly baselineRound?: string; readonly currentRound?: string; readonly baselineRunId?: string; readonly currentRunId?: string; }) => StudyMetricsReportV1; declare const parseStudyMetrics: (input: unknown) => StudyMetricsReportV1; declare const formatStudyMetricsText: (report: StudyMetricsReportV1) => readonly string[]; declare const STUDY_VERIFICATION_SCHEMA_VERSION: 1; declare const STUDY_VERIFICATION_CONTENT_HASH_ALGO: "sha256-normalized-v1"; declare const StudyVerificationBindingV1Schema: z.ZodObject<{ type: z.ZodLiteral<"controlled-study-verification">; schemaVersion: z.ZodLiteral<1>; verificationRunId: z.ZodString; sourceRevisionHash: z.ZodString; protocolHash: z.ZodString; configurationHash: z.ZodString; baselineHash: z.ZodString; artifactHashes: z.ZodRecord; privacy: z.ZodObject<{ mode: z.ZodLiteral<"anonymized">; checkedArtifactCount: z.ZodNumber; forbiddenMatchCount: z.ZodLiteral<0>; publicationReview: z.ZodEnum<{ pending: "pending"; approved: "approved"; }>; }, z.core.$strict>; budget: z.ZodObject<{ maxTokens: z.ZodNumber; usedTokens: z.ZodNumber; maxRuntimeMs: z.ZodNumber; usedRuntimeMs: z.ZodNumber; }, z.core.$strict>; contentHash: z.ZodString; contentHashAlgo: z.ZodLiteral<"sha256-normalized-v1">; }, z.core.$strict>; type StudyVerificationBindingV1 = z.infer; declare const ControlledStudyVerifiedResultV1Schema: z.ZodObject<{ type: z.ZodLiteral<"controlled-study-verified-result">; schemaVersion: z.ZodLiteral<1>; verification: z.ZodObject<{ type: z.ZodLiteral<"controlled-study-verification">; schemaVersion: z.ZodLiteral<1>; verificationRunId: z.ZodString; sourceRevisionHash: z.ZodString; protocolHash: z.ZodString; configurationHash: z.ZodString; baselineHash: z.ZodString; artifactHashes: z.ZodRecord; privacy: z.ZodObject<{ mode: z.ZodLiteral<"anonymized">; checkedArtifactCount: z.ZodNumber; forbiddenMatchCount: z.ZodLiteral<0>; publicationReview: z.ZodEnum<{ pending: "pending"; approved: "approved"; }>; }, z.core.$strict>; budget: z.ZodObject<{ maxTokens: z.ZodNumber; usedTokens: z.ZodNumber; maxRuntimeMs: z.ZodNumber; usedRuntimeMs: z.ZodNumber; }, z.core.$strict>; contentHash: z.ZodString; contentHashAlgo: z.ZodLiteral<"sha256-normalized-v1">; }, z.core.$strict>; result: z.ZodUnknown; contentHash: z.ZodString; contentHashAlgo: z.ZodLiteral<"sha256-normalized-v1">; }, z.core.$strict>; type ControlledStudyVerifiedResultV1 = z.infer; declare const createStudyVerificationBinding: (input: unknown) => StudyVerificationBindingV1; declare const parseStudyVerificationBinding: (input: unknown) => StudyVerificationBindingV1; declare const createControlledStudyVerifiedResult: (result: unknown, binding: StudyVerificationBindingV1) => ControlledStudyVerifiedResultV1; declare const parseControlledStudyVerifiedResult: (input: unknown) => ControlledStudyVerifiedResultV1; type StudyPrivacyScan = { readonly ok: boolean; readonly checkedStrings: number; readonly forbiddenMatches: readonly string[]; }; declare const scanStudyPublicationArtifact: (input: unknown) => StudyPrivacyScan; declare const formatStudyVerificationText: (binding: StudyVerificationBindingV1) => readonly string[]; type RuleMode = 'default' | 'recommended' | 'strict'; type RuleEngineOptions = { readonly config?: RulesConfig; /** * Betweenness per entity, from `centrality` in the graph layer. * * Required for `centrality-risk`: without it the rule reports nothing. It used to count how * many undocumented-relation findings an entity had, which measures documentation debt and * calls it architecture — a module every import path runs through scored zero if it happened to * be documented. Reporting nothing is better than reporting the wrong thing under a name people * will act on. */ readonly centrality?: ReadonlyMap; readonly preset?: RuleMode; readonly severity?: Partial>; readonly ignore?: readonly RuleId[]; readonly criticalEntities?: readonly string[]; readonly criticalPaths?: readonly string[]; readonly warningThresholds?: Partial>; }; type RuleFinding = { readonly id: string; readonly ruleId: RuleId; readonly code: string; readonly status: ReconciliationReportV1['diagnostics'][number]['status']; readonly severity: RuleSeverity; readonly message: string; readonly evidence: ReconciliationReportV1['diagnostics'][number]['evidence']; readonly entityIds?: readonly string[]; readonly relationIds?: readonly string[]; readonly remediation?: string; readonly sourceDiagnosticCode?: string; }; type RuleEvaluationResult = { readonly mode: RuleMode; readonly findings: readonly RuleFinding[]; readonly exitCode: 0 | 1; }; declare const evaluateRules: (report: ReconciliationReportV1, options?: RuleEngineOptions) => RuleEvaluationResult; declare const parseRuleId: (value: string) => RuleId; declare const parseRuleSeverity: (value: string) => RuleSeverity; /** * Canonical AgentsKit ecosystem section for llms.txt (and similar machine indexes). * * All products should render this block with the same heading and line shape so * agents can parse the seven-product mesh without per-repo inventiveness. */ type EcosystemLlmsProduct = { readonly id: string; readonly name: string; readonly role?: string; readonly promise: string; readonly maturity?: string; readonly surfaces: { readonly home?: string; readonly docs?: string; readonly llms?: string; }; }; type FormatEcosystemLlmsBlockOptions = { readonly products: readonly EcosystemLlmsProduct[]; /** When set, marks this product with **(current)**. */ readonly currentProductId?: string; /** Heading line without leading hashes — default `AgentsKit ecosystem`. */ readonly heading?: string; /** * Prefer docs URL when available; otherwise home. * Default: home, falling back to docs. */ readonly prefer?: 'home' | 'docs'; }; /** * Returns markdown lines for the shared ecosystem block, including a trailing blank line. */ declare function formatEcosystemLlmsBlock(options: FormatEcosystemLlmsBlockOptions): string[]; /** Join the block into a single string ending with a newline. */ declare function formatEcosystemLlmsSection(options: FormatEcosystemLlmsBlockOptions): string; type HumanDocRecord = { readonly id: string; readonly url: string; readonly path: string; }; type HumanDocMap = Record; declare const scanHumanDocRecords: (root: string, config: DocBridgeConfigV1) => HumanDocRecord[]; declare const scanHumanDocs: (root: string, config: DocBridgeConfigV1) => HumanDocMap; declare const DOCUMENTATION_STANDARD_V1_ID: "documentation-standard-v1"; declare const DOCUMENTATION_STANDARD_V1_STATUS: "stable"; type DocumentationStandardRuleLevel = 'required' | 'recommended'; type DocumentationStandardRuleStatus = 'pass' | 'fail' | 'excepted'; type DocumentationStandardEvidence = { readonly path: string; readonly detail: string; }; type DocumentationStandardRemediation = { readonly command: string; readonly detail: string; }; type DocumentationStandardRuleResult = { readonly id: DocumentationStandardRuleId; readonly level: DocumentationStandardRuleLevel; readonly status: DocumentationStandardRuleStatus; readonly ok: boolean; readonly message: string; readonly evidence: readonly DocumentationStandardEvidence[]; readonly remediation: DocumentationStandardRemediation; readonly exception?: { readonly reason: string; readonly approvedBy: string; readonly trackingUrl: string; }; }; type DocumentationConformanceReportV1 = { readonly schemaVersion: 1; readonly profile: { readonly id: typeof DOCUMENTATION_STANDARD_V1_ID; readonly version: 1; readonly status: typeof DOCUMENTATION_STANDARD_V1_STATUS; }; readonly ok: boolean; readonly recommendedOk: boolean; readonly summary: { readonly required: { readonly passed: number; readonly failed: number; readonly excepted: number; }; readonly recommended: { readonly passed: number; readonly failed: number; readonly excepted: number; }; }; readonly results: readonly DocumentationStandardRuleResult[]; }; declare const runDocumentationStandardV1: (root: string, config: DocBridgeConfigV1) => DocumentationConformanceReportV1; declare const formatDocumentationStandardText: (report: DocumentationConformanceReportV1) => string[]; type GateId = 'index-freshness' | 'index-reproducible' | 'human-guide-links' | 'okf-type' | 'docs-style' | 'documentation-standard-v1'; type GateResult = { readonly id: GateId; readonly ok: boolean; readonly message: string; readonly expected?: string; readonly actual?: string; readonly details?: DocumentationConformanceReportV1; }; type GateRunResult = { readonly ok: boolean; readonly results: GateResult[]; }; declare const runGate: (root: string, config: DocBridgeConfigV1, id: GateId) => GateResult; declare const runGates: (root: string, config: DocBridgeConfigV1, ids?: readonly GateId[]) => GateRunResult; declare const resolveGateIds: (config: DocBridgeConfigV1) => GateId[]; type JsonRpcRequest = { readonly jsonrpc?: '2.0'; readonly id?: string | number | null; readonly method?: string; readonly params?: unknown; }; type McpContext = { readonly root: string; readonly config: DocBridgeConfigV1; readonly loadIndex?: () => DocBridgeIndexV1; }; declare const MCP_TOOLS: readonly [{ readonly name: "handoff.resolve"; readonly title: "Resolve repository handoff"; readonly description: "Resolve a package or ownership id to its deterministic AgentHandoff."; readonly annotations: { readonly readOnlyHint: true; }; readonly inputSchema: { readonly type: "object"; readonly properties: { readonly id: { readonly type: "string"; }; readonly kind: { readonly type: "string"; readonly enum: readonly ["package", "ownership"]; }; readonly budgetTokens: { readonly type: "number"; }; }; readonly required: readonly ["id"]; }; }, { readonly name: "doc.search"; readonly title: "Search repository documentation"; readonly description: "Search the deterministic Doc Bridge index for repository documentation."; readonly annotations: { readonly readOnlyHint: true; }; readonly inputSchema: { readonly type: "object"; readonly properties: { readonly term: { readonly type: "string"; }; readonly limit: { readonly type: "number"; }; readonly agent: { readonly type: "boolean"; }; readonly mode: { readonly type: "string"; readonly enum: readonly ["discovery", "editing", "debugging", "documentation"]; }; readonly contextBudgetTokens: { readonly type: "number"; }; }; readonly required: readonly ["term"]; }; }, { readonly name: "doc.get"; readonly title: "Read indexed documentation"; readonly description: "Read one indexed agent documentation file by id or indexed path."; readonly annotations: { readonly readOnlyHint: true; }; readonly inputSchema: { readonly type: "object"; readonly properties: { readonly id: { readonly type: "string"; }; readonly path: { readonly type: "string"; }; }; }; }, { readonly name: "gate.status"; readonly title: "Check documentation gates"; readonly description: "Evaluate documentation gates without writing files."; readonly annotations: { readonly readOnlyHint: true; }; readonly inputSchema: { readonly type: "object"; readonly properties: {}; }; }, { readonly name: "retriever.query"; readonly title: "Retrieve documentation context"; readonly description: "Return relevant local Doc Bridge index chunks for a query."; readonly annotations: { readonly readOnlyHint: true; }; readonly inputSchema: { readonly type: "object"; readonly properties: { readonly query: { readonly type: "string"; }; readonly limit: { readonly type: "number"; }; }; readonly required: readonly ["query"]; }; }, { readonly name: "memory.classify"; readonly title: "Classify memory candidates"; readonly description: "Classify local memory candidates into agent, human, playbook, or discard routes."; readonly annotations: { readonly readOnlyHint: true; }; readonly inputSchema: { readonly type: "object"; readonly properties: {}; }; }, { readonly name: "memory.promoteDraft"; readonly title: "Draft memory promotion"; readonly description: "Build a reviewable draft promotion body from local memory candidates without publishing it."; readonly annotations: { readonly readOnlyHint: true; }; readonly inputSchema: { readonly type: "object"; readonly properties: {}; }; }, { readonly name: "registry.topology"; readonly title: "Inspect registry topology"; readonly description: "Return the static Doc Bridge curator and delegate topology."; readonly annotations: { readonly readOnlyHint: true; }; readonly inputSchema: { readonly type: "object"; readonly properties: {}; }; }, { readonly name: "docbridge.snapshot"; readonly title: "Read the latest discovery snapshot"; readonly description: "Read the bounded canonical repository snapshot from the latest workflow run."; readonly annotations: { readonly readOnlyHint: true; }; readonly inputSchema: { readonly type: "object"; readonly properties: { readonly runId: { readonly type: "string"; }; }; }; }, { readonly name: "docbridge.report"; readonly title: "Read the latest reconciliation report"; readonly description: "Read the canonical reconciliation report from the latest workflow run."; readonly annotations: { readonly readOnlyHint: true; }; readonly inputSchema: { readonly type: "object"; readonly properties: { readonly runId: { readonly type: "string"; }; }; }; }, { readonly name: "docbridge.diagnostics"; readonly title: "Read reconciliation diagnostics"; readonly description: "Read bounded diagnostics from the latest canonical reconciliation report."; readonly annotations: { readonly readOnlyHint: true; }; readonly inputSchema: { readonly type: "object"; readonly properties: { readonly status: { readonly type: "string"; }; readonly severity: { readonly type: "string"; }; readonly format: { readonly type: "string"; readonly enum: readonly ["diagnostic", "finding"]; }; }; }; }, { readonly name: "docbridge.relations"; readonly title: "Read architecture relations"; readonly description: "Read bounded observed and declared relations from the latest canonical snapshot."; readonly annotations: { readonly readOnlyHint: true; }; readonly inputSchema: { readonly type: "object"; readonly properties: { readonly kind: { readonly type: "string"; }; readonly limit: { readonly type: "number"; }; }; }; }, { readonly name: "docbridge.run"; readonly title: "Read workflow state"; readonly description: "Read the latest resumable workflow state and artifact references."; readonly annotations: { readonly readOnlyHint: true; }; readonly inputSchema: { readonly type: "object"; readonly properties: {}; }; }, { readonly name: "docbridge.proposals"; readonly title: "Read or approve proposals"; readonly description: "Create, inspect, approve and apply deterministic proposals through the shared human-gated workflow."; readonly inputSchema: { readonly type: "object"; readonly properties: { readonly action: { readonly type: "string"; readonly enum: readonly ["list", "propose-links", "propose-normalize", "suggest", "approve", "apply", "enrich-list", "enrich-approve", "enrich-reject"]; }; readonly proposalHash: { readonly type: "string"; }; readonly artifactPath: { readonly type: "string"; }; readonly approvedBy: { readonly type: "string"; }; readonly proposal: { readonly type: "object"; }; readonly proposalId: { readonly type: "string"; }; readonly reason: { readonly type: "string"; }; }; }; }, { readonly name: "knowledge.search"; readonly title: "Search the knowledge graph"; readonly description: "Rank every indexed entity for a query, optionally by kind, with an explanation and within a token budget."; readonly annotations: { readonly readOnlyHint: true; }; readonly inputSchema: { readonly type: "object"; readonly properties: { readonly query: { readonly type: "string"; }; readonly kinds: { readonly type: "array"; readonly items: { readonly type: "string"; readonly enum: readonly ["document", "module", "area", "package", "intent", "change"]; }; }; readonly limit: { readonly type: "number"; }; readonly explain: { readonly type: "boolean"; }; readonly budgetTokens: { readonly type: "number"; }; readonly format: { readonly type: "string"; readonly enum: readonly ["json", "text"]; }; }; readonly required: readonly ["query"]; }; }, { readonly name: "knowledge.lookup"; readonly title: "Look up one entity"; readonly description: "Return an entity with its neighbours by relation kind, the documents about it, its handoff, its open diagnostics and its evidence, within a token budget."; readonly annotations: { readonly readOnlyHint: true; }; readonly inputSchema: { readonly type: "object"; readonly properties: { readonly id: { readonly type: "string"; }; readonly path: { readonly type: "string"; }; readonly depth: { readonly type: "number"; }; readonly budgetTokens: { readonly type: "number"; }; readonly format: { readonly type: "string"; readonly enum: readonly ["json", "text"]; }; }; }; }]; declare const handleMcpRequest: (ctx: McpContext, request: JsonRpcRequest) => unknown; type StdioFraming = 'content-length' | 'json-line'; declare const respondMcpRequest: (ctx: McpContext, request: JsonRpcRequest, framing: StdioFraming) => Promise; declare const startMcpStdioServer: (ctx: McpContext) => void; type McpInstallTarget = 'cursor' | 'claude'; type McpInstallResult = { readonly ok: boolean; readonly target: McpInstallTarget; readonly configPath: string; readonly created: boolean; readonly serverName: string; readonly nextSteps: readonly string[]; }; declare const installMcpConfig: (root: string, target: McpInstallTarget) => McpInstallResult; declare const mcpSnippet: (root: string) => string; type DoctorBadgeMetrics = { readonly handoffPct: number; readonly bridgePct: number; readonly score: number; readonly grade: DoctorReport['grade']; readonly packages: number; }; declare const doctorBadgeMetrics: (report: DoctorReport) => DoctorBadgeMetrics; declare const formatDoctorBadgeMarkdown: (metrics: DoctorBadgeMetrics) => string; declare const formatDoctorBadgeJson: (metrics: DoctorBadgeMetrics) => string; type DoctorIssue = { readonly severity: 'error' | 'warn' | 'info'; readonly code: string; readonly message: string; readonly action?: string; }; /** The share of the snapshot's documents an agent can retrieve: present in the retrieval projection. */ type DoctorReachability = { readonly documentsTotal: number; readonly documentsReachable: number; readonly unreachable: readonly string[]; readonly pct: number; }; /** * Whether the graph connects documentation to code both ways: an area with at least one document * that covers or mentions it, and a document with at least one edge into code (an area, a module * or a package it covers or mentions). `pct` is the mean of the two shares. */ type DoctorConnectivity = { readonly areasTotal: number; readonly areasDocumented: number; readonly undocumentedAreas: readonly string[]; readonly documentsTotal: number; readonly documentsLinked: number; readonly unlinkedDocuments: readonly string[]; readonly pct: number; }; type DoctorBenchmark = { readonly status: 'measured'; readonly suite: string; readonly caseCount: number; readonly hitAt1: number; readonly hitAt3: number; readonly meanReciprocalRank: number; } | { /** No golden suite, or one that could not be run: reported, never silently omitted. */ readonly status: 'not-analyzed'; readonly suite: string; readonly reason: string; }; /** Which of the three measured dimensions meet the bar an A requires, and why not when one does not. */ type DoctorGrading = { readonly reachability: boolean; readonly connectivity: boolean; readonly benchmark: boolean; readonly unmet: readonly string[]; }; type DoctorCoverage = { readonly reachability: DoctorReachability; readonly connectivity: DoctorConnectivity; readonly benchmark: DoctorBenchmark; readonly packages: { readonly total: number; readonly withAgentDoc: number; readonly withHumanDoc: number; readonly missingAgentDoc: readonly string[]; readonly missingHumanDoc: readonly string[]; }; readonly agentDocs: { readonly total: number; readonly indexed: number; readonly unindexed: readonly string[]; }; readonly freshness: { readonly ok: boolean; readonly message: string; readonly hasIndex: boolean; }; readonly gates: GateRunResult; /** Whether a clean checkout would rebuild this index, or whether generated files leak into it. */ readonly reproducibility: IndexReproducibility; }; type DoctorReport = { readonly ok: boolean; readonly score: number; readonly grade: 'A' | 'B' | 'C' | 'D' | 'F'; readonly grading: DoctorGrading; readonly coverage: DoctorCoverage; readonly badge: DoctorBadgeMetrics; readonly issues: readonly DoctorIssue[]; readonly nextActions: readonly string[]; }; declare const runDoctor: (root: string, config: DocBridgeConfigV1) => DoctorReport; declare const formatDoctorText: (report: DoctorReport) => string[]; type WatchIndexOptions = { readonly root: string; readonly config: DocBridgeConfigV1; readonly configPath?: string; readonly debounceMs?: number; readonly onRebuild?: (summary: { knowledgeCount: number; handoffCount: number; hash: string; }) => void; }; declare const watchDocBridgeIndex: (opts: WatchIndexOptions) => Promise; type ScorecardStatus = 'pass' | 'partial' | 'not-analyzed' | 'fail'; type ScorecardCriterion = { readonly id: string; readonly dimension: string; readonly status: ScorecardStatus; readonly observed: number | null; readonly threshold: number | null; readonly unit: string; readonly required: boolean; readonly evidence: readonly string[]; readonly reason: string; }; type ScorecardDimension = { readonly id: string; readonly status: ScorecardStatus; readonly criteria: readonly string[]; }; type QualityScorecard = { readonly type: 'doc-bridge-quality-scorecard'; readonly schemaVersion: 1; readonly decision: 'ready' | 'not-ready'; readonly criteria: readonly ScorecardCriterion[]; readonly dimensions: readonly ScorecardDimension[]; readonly summary: { readonly pass: number; readonly partial: number; readonly notAnalyzed: number; readonly fail: number; }; }; type QualityScorecardInput = { readonly semanticFixture: { readonly precision: number; readonly recall: number; readonly evidenceRatio: number; }; readonly semanticTask: { readonly repositoryOnlySuccessRate: number; readonly docBridgeSuccessRate: number; }; readonly acceptanceInstrumentation: { readonly observations: number; readonly complete: number; }; readonly tokenPilot: { readonly reductionPct: number; readonly replicates: number; }; readonly cost: { readonly observedUsd: number | null; }; readonly generalization: { readonly populations: number; readonly models: number; readonly replicates: number; }; readonly documentation: { readonly titleRate: number; readonly requiredSectionsRate: number; readonly examplesRate: number; readonly contradictions: number; readonly stale: number; readonly structureGaps: number; readonly exactDuplicateGroups: number; readonly criticalMetadataCoverage: number; readonly semanticNotAnalyzed: number; readonly semanticReviewed: number; readonly semanticCorpus: number; readonly semanticContradictionCandidates: number; readonly semanticRedundancyCandidates: number; readonly semanticMissingCandidates: number; readonly semanticClaimCandidates: number; }; readonly evidence: { readonly contentHashes: number; readonly requiredHashes: number; }; readonly latency: { readonly reductionPct: number; }; readonly thresholds: { readonly fixturePrecision: number; readonly fixtureRecall: number; readonly fixtureEvidenceRatio: number; readonly taskSuccessRate: number; readonly tokenReductionPct: number; readonly tokenReplicates: number; readonly populationCount: number; readonly modelCount: number; readonly generalizationReplicates: number; readonly documentationRate: number; readonly examplesRate: number; readonly criticalMetadataCoverage: number; readonly semanticNotAnalyzedMaximum: number; readonly semanticReviewCoverage: number; readonly acceptanceInstrumentationCoverage: number; readonly latencyReductionPct: number; }; }; declare const evaluateQualityScorecard: (input: QualityScorecardInput) => QualityScorecard; type MemoryRoute = 'agent' | 'human' | 'playbook' | 'discard'; type MemoryClassification = { readonly candidate: MemoryCandidateV1; readonly route: MemoryRoute; readonly reason: string; readonly target?: string; readonly duplicateOf?: string; }; type SafetyFinding = { readonly candidateId: string; readonly kind: 'secret' | 'private-email'; readonly message: string; }; type MemoryPromotionDraft = { readonly ok: boolean; readonly title: string; readonly body: string; readonly findings: SafetyFinding[]; readonly classifications: MemoryClassification[]; }; declare const classifyMemoryCandidates: (candidates: readonly MemoryCandidateV1[], index: DocBridgeIndexV1) => MemoryClassification[]; declare const scanMemorySafety: (classifications: readonly MemoryClassification[]) => SafetyFinding[]; declare const draftMemoryPromotion: (classifications: readonly MemoryClassification[]) => MemoryPromotionDraft; type GithubPrOptions = { readonly dryRun?: boolean; readonly force?: boolean; readonly branch?: string; readonly base?: string; }; type GithubPrResult = { readonly ok: boolean; readonly dryRun: boolean; readonly draftPath: string; readonly branch: string; readonly prUrl?: string; readonly previewUrl?: string; readonly commands: readonly string[]; readonly message: string; }; declare const defaultPromotionDraftPath: (root: string) => string; declare const writePromotionDraft: (root: string, draft: MemoryPromotionDraft, path?: string) => string; declare const promoteMemoryToGithubPr: (root: string, draft: MemoryPromotionDraft, options?: GithubPrOptions) => GithubPrResult; declare const canonicalJsonV1: (payload: unknown) => string; declare const sha256NormalizedV1: (payload: unknown) => string; declare const contentHashForArtifactV1: (artifact: T) => string; declare const ANALYZER_PLUGIN_CONTRACT_VERSION: 1; declare const AnalyzerPluginManifestSchema: z.ZodObject<{ id: z.ZodString; version: z.ZodString; languages: z.ZodArray; frameworks: z.ZodDefault>; capabilities: z.ZodArray; knowledgeSchemaVersion: z.ZodLiteral<1>; compatibility: z.ZodObject<{ pipelineMajor: z.ZodNumber; }, z.core.$strict>; unsupportedConstructs: z.ZodDefault>; resourceLimits: z.ZodDefault; maxBytes: z.ZodOptional; }, z.core.$strict>>; }, z.core.$strict>; type AnalyzerPluginManifest = z.infer; declare const AnalyzerPluginOutputSchema: z.ZodObject<{ entities: z.ZodDefault; aliases: z.ZodOptional>; provenance: z.ZodEnum<{ observed: "observed"; declared: "declared"; proposed: "proposed"; }>; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; metadata: z.ZodOptional>; }, z.core.$strict>>>; relations: z.ZodDefault; provenance: z.ZodEnum<{ observed: "observed"; declared: "declared"; proposed: "proposed"; }>; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; metadata: z.ZodOptional>; }, z.core.$strict>>>; coverage: z.ZodDefault; scope: z.ZodString; status: z.ZodEnum<{ "not-analyzed": "not-analyzed"; complete: "complete"; partial: "partial"; "not-applicable": "not-applicable"; }>; reason: z.ZodOptional; evidence: z.ZodOptional; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>>; }, z.core.$strict>>>; diagnostics: z.ZodDefault; severity: z.ZodEnum<{ error: "error"; off: "off"; info: "info"; warn: "warn"; }>; message: z.ZodString; evidence: z.ZodArray; path: z.ZodString; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; contentHash: z.ZodOptional; context: z.ZodOptional; }, z.core.$strict>>; entityIds: z.ZodOptional>; relationIds: z.ZodOptional>; remediation: z.ZodOptional; }, z.core.$strict>>>; }, z.core.$strict>; type AnalyzerPluginOutput = z.infer; type AnalyzerPluginInput = { readonly language: string; readonly framework?: string; readonly files: readonly { readonly path: string; readonly bytes: number; }[]; readonly value?: unknown; }; type AnalyzerPlugin = { readonly manifest: AnalyzerPluginManifest; readonly analyze: (input: AnalyzerPluginInput) => Promise | unknown; }; type AnalyzerRegistry = { readonly register: (plugin: AnalyzerPlugin) => void; readonly list: () => readonly AnalyzerPluginManifest[]; readonly analyze: (id: string, input: AnalyzerPluginInput) => Promise; }; declare const createAnalyzerRegistry: (options?: { readonly pipelineVersion?: string; readonly maxPlugins?: number; }) => AnalyzerRegistry; declare const BENCHMARK_SCHEMA_VERSION: 1; declare const BenchmarkFixtureV1Schema: z.ZodObject<{ schemaVersion: z.ZodLiteral<1>; supported: z.ZodObject<{ entities: z.ZodDefault>; relations: z.ZodDefault>; findings: z.ZodDefault>; }, z.core.$strict>; excluded: z.ZodOptional>; relations: z.ZodDefault>; findings: z.ZodDefault>; }, z.core.$strict>>; }, z.core.$strict>; type BenchmarkFixtureV1 = z.infer; type BenchmarkObservation = { readonly entities: readonly string[]; readonly relations: readonly string[]; readonly findings: readonly string[]; readonly evidenced?: readonly string[]; readonly findingCategories?: Readonly>; }; type BenchmarkSetMetrics = { readonly truePositives: number; readonly falsePositives: number; readonly falseNegatives: number; readonly precision: number; readonly recall: number; readonly duplicateCount: number; }; type BenchmarkResult = { readonly schemaVersion: typeof BENCHMARK_SCHEMA_VERSION; readonly quality: { readonly entities: BenchmarkSetMetrics; readonly relations: BenchmarkSetMetrics; readonly findings: BenchmarkSetMetrics; }; readonly evidenceRatio: number; readonly findingDensity: number; readonly findingCategoryDistribution: Readonly>; readonly excludedCaseCount: number; readonly excludedCaseIds: Readonly<{ entities: number; relations: number; findings: number; }>; readonly thresholds: { readonly precision: number; readonly recall: number; }; readonly regressions: readonly string[]; }; declare const benchmarkFixture: (fixture: unknown) => BenchmarkFixtureV1; declare const measureBenchmark: (observation: BenchmarkObservation, fixture: BenchmarkFixtureV1, thresholds?: { readonly precision?: number; readonly recall?: number; }) => BenchmarkResult; type BenchmarkSnapshot = Readonly>; type BenchmarkSnapshotDiff = { readonly added: number; readonly removed: number; readonly unchanged: number; readonly reclassified: number; readonly unchangedEvidence: number; }; declare const compareBenchmarkSnapshots: (previous: BenchmarkSnapshot, current: BenchmarkSnapshot) => BenchmarkSnapshotDiff; type AgentEfficiencyObservation = { readonly hits: number; readonly queries: number; readonly latencyMs: readonly number[]; readonly responseBytes: readonly number[]; readonly estimatedTokens: readonly number[]; readonly corpusBytes: number; }; declare const measureAgentEfficiency: (observation: AgentEfficiencyObservation) => { hitRate: number; latencyP95Ms: number; responseBytesP95: number; estimatedTokensP95: number; corpusBytes: number; contextReduction: number; }; type AgentTaskEfficiencyObservation = { readonly correct: boolean; readonly latencyMs: number; readonly responseBytes: number; readonly estimatedTokens: number; }; declare const measureAgentTaskEfficiency: (observations: readonly AgentTaskEfficiencyObservation[]) => { taskCount: number; correctTaskCount: number; correctnessRate: number; latencyP95Ms: number; responseBytesP95: number; estimatedTokensP95: number; tokensToCorrectAnswerP95: number | null; timeToCorrectAnswerP95Ms: number | null; }; declare const formatBenchmarkText: (result: BenchmarkResult) => string; type SearchMatch = { /** The record kind as consumers have always read it: `ownership`, `intent`, `change`, or the entry kind. */ readonly type: string; readonly id: string; readonly path: string; readonly summary?: string; readonly score: number; /** The snapshot entity this result stands for, when it stands for one. */ readonly entityId?: string; readonly kind?: RetrievalKind; readonly provenance?: 'observed' | 'declared' | 'proposed'; readonly confidence?: Confidence; readonly evidence?: readonly Evidence[]; readonly explain?: RankExplanation; }; type SearchOptions = { /** Attach the matched terms and each scoring component to every result. Never changes the ranking. */ readonly explain?: boolean; /** The `--agent` prior. */ readonly agent?: boolean; }; /** * Search the index. * * An index that carries the retrieval projection is ranked over it — every snapshot entity, with * evidence, provenance and confidence on each result. An index built before the projection * existed is ranked the way it always was, over its `knowledge[]` and lookup records, so an older * artifact keeps answering until it is rebuilt. */ declare const searchIndex: (index: DocBridgeIndexV1, term: string, limit?: number, options?: SearchOptions) => SearchMatch[]; declare const RETRIEVAL_BENCH_SCHEMA_VERSION: 1; /** * Open Eval Format version this suite conforms to (`@agentskit/core/eval-format`). * * The format is mirrored here with Zod rather than imported so `ak-docs bench retrieval` * stays in the deterministic layer: `@agentskit/core` is an optional peer, and the * benchmark must run with no peer installed, no network and no API key. A test * cross-validates every committed suite against the real `validateEvalSuite`, so the * two definitions cannot drift apart silently. */ declare const EVAL_FORMAT_VERSION: "2026-04"; declare const RetrievalSuiteCaseSchema: z.ZodObject<{ id: z.ZodString; input: z.ZodString; expected: z.ZodOptional; regex: z.ZodOptional; }, z.core.$strict>>; equalsNormalized: z.ZodOptional; semanticSimilarity: z.ZodOptional; }, z.core.$strict>, z.ZodString]>>; metadata: z.ZodObject<{ expectedTargets: z.ZodArray; lang: z.ZodOptional>; kind: z.ZodOptional>; agent: z.ZodOptional; }, z.core.$loose>; }, z.core.$strict>; declare const RetrievalSuiteSchema: z.ZodObject<{ evalFormatVersion: z.ZodLiteral<"2026-04">; name: z.ZodString; description: z.ZodOptional; tags: z.ZodOptional>; cases: z.ZodArray; regex: z.ZodOptional; }, z.core.$strict>>; equalsNormalized: z.ZodOptional; semanticSimilarity: z.ZodOptional; }, z.core.$strict>, z.ZodString]>>; metadata: z.ZodObject<{ expectedTargets: z.ZodArray; lang: z.ZodOptional>; kind: z.ZodOptional>; agent: z.ZodOptional; }, z.core.$loose>; }, z.core.$strict>>; }, z.core.$strict>; type RetrievalSuite = z.infer; type RetrievalSuiteCase = z.infer; declare const MetricsSchema: z.ZodObject<{ caseCount: z.ZodNumber; hitAt1: z.ZodNumber; hitAt3: z.ZodNumber; meanReciprocalRank: z.ZodNumber; meanContextBytes: z.ZodNumber; meanApproxTokens: z.ZodNumber; zeroResultRate: z.ZodNumber; tokenMethod: z.ZodLiteral<"approximate">; }, z.core.$strict>; type RetrievalMetrics = z.infer; declare const CaseOutcomeSchema: z.ZodObject<{ id: z.ZodString; input: z.ZodString; lang: z.ZodOptional>; kind: z.ZodOptional>; expectedTargets: z.ZodArray; rankedTargets: z.ZodArray; rank: z.ZodNullable; hitAt1: z.ZodBoolean; hitAt3: z.ZodBoolean; reciprocalRank: z.ZodNumber; resultCount: z.ZodNumber; contextBytes: z.ZodNumber; approxTokens: z.ZodNumber; expectationMatched: z.ZodNullable; }, z.core.$strict>; type RetrievalCaseOutcome = z.infer; declare const RetrievalBenchResultV1Schema: z.ZodObject<{ type: z.ZodLiteral<"retrieval-benchmark-result">; schemaVersion: z.ZodLiteral<1>; contentHash: z.ZodString; contentHashAlgo: z.ZodLiteral<"sha256-normalized-v1">; suite: z.ZodObject<{ name: z.ZodString; caseCount: z.ZodNumber; contentHash: z.ZodString; }, z.core.$strict>; index: z.ZodObject<{ contentHash: z.ZodString; entryCount: z.ZodNumber; }, z.core.$strict>; limit: z.ZodNumber; metrics: z.ZodObject<{ caseCount: z.ZodNumber; hitAt1: z.ZodNumber; hitAt3: z.ZodNumber; meanReciprocalRank: z.ZodNumber; meanContextBytes: z.ZodNumber; meanApproxTokens: z.ZodNumber; zeroResultRate: z.ZodNumber; tokenMethod: z.ZodLiteral<"approximate">; }, z.core.$strict>; byLang: z.ZodRecord; }, z.core.$strict>>; byKind: z.ZodRecord; }, z.core.$strict>>; cases: z.ZodArray>; kind: z.ZodOptional>; expectedTargets: z.ZodArray; rankedTargets: z.ZodArray; rank: z.ZodNullable; hitAt1: z.ZodBoolean; hitAt3: z.ZodBoolean; reciprocalRank: z.ZodNumber; resultCount: z.ZodNumber; contextBytes: z.ZodNumber; approxTokens: z.ZodNumber; expectationMatched: z.ZodNullable; }, z.core.$strict>>; }, z.core.$strict>; type RetrievalBenchResultV1 = z.infer; declare const parseRetrievalSuite: (raw: unknown) => RetrievalSuite; declare const parseRetrievalBenchResult: (raw: unknown) => RetrievalBenchResultV1; /** * Portable Open Eval Format expectation, evaluated against the newline-joined ranking the * deterministic agent function returns. Kept behaviour-compatible with * `matchesExpectation` from `@agentskit/core/eval-format`. */ declare const matchesRetrievalExpectation: (output: string, expected: RetrievalSuiteCase["expected"]) => boolean; /** The deterministic agent function: a query in, the ranked identities out, one per line. */ declare const rankedOutput: (matches: readonly SearchMatch[]) => string; type RunRetrievalBenchOptions = { readonly index: DocBridgeIndexV1; readonly suite: RetrievalSuite; readonly limit?: number; }; /** * Measure the deterministic retrieval path against a golden suite. * * The result carries no timestamp and no latency, so two runs over the same index and * suite are byte-identical and their content hashes match. Wall time belongs in the * caller's output, never in a comparable artifact. */ declare const runRetrievalBench: (options: RunRetrievalBenchOptions) => RetrievalBenchResultV1; declare const formatRetrievalBenchText: (result: RetrievalBenchResultV1) => readonly string[]; declare const RetrievalBaselineV1Schema: z.ZodObject<{ type: z.ZodLiteral<"retrieval-benchmark-baseline">; schemaVersion: z.ZodLiteral<1>; contentHash: z.ZodString; contentHashAlgo: z.ZodLiteral<"sha256-normalized-v1">; suite: z.ZodObject<{ name: z.ZodString; caseCount: z.ZodNumber; contentHash: z.ZodString; }, z.core.$strict>; metrics: z.ZodObject<{ caseCount: z.ZodNumber; hitAt1: z.ZodNumber; hitAt3: z.ZodNumber; meanReciprocalRank: z.ZodNumber; meanContextBytes: z.ZodNumber; meanApproxTokens: z.ZodNumber; zeroResultRate: z.ZodNumber; tokenMethod: z.ZodLiteral<"approximate">; }, z.core.$strict>; approval: z.ZodObject<{ approvedAt: z.ZodString; approvedBy: z.ZodString; reason: z.ZodOptional; resultHash: z.ZodString; indexHash: z.ZodString; }, z.core.$strict>; }, z.core.$strict>; type RetrievalBaselineV1 = z.infer; declare const parseRetrievalBaseline: (raw: unknown) => RetrievalBaselineV1; type CreateRetrievalBaselineOptions = { readonly result: RetrievalBenchResultV1; readonly approvedBy: string; readonly reason?: string; readonly approvedAt?: string; }; /** Record a measured result as the figure future runs are gated against. */ declare const createRetrievalBaseline: (options: CreateRetrievalBaselineOptions) => RetrievalBaselineV1; type RetrievalComparisonStatus = 'pass' | 'regressed' | 'suite-changed'; type RetrievalMetricDelta = { readonly metric: keyof RetrievalMetrics; readonly baseline: number; readonly current: number; readonly delta: number; }; type RetrievalComparison = { readonly status: RetrievalComparisonStatus; readonly blocking: boolean; readonly tolerance: number; readonly suiteChanged: boolean; /** Reasons the gate fails. Empty when it passes. */ readonly regressions: readonly string[]; /** Non-blocking movements worth reading before merging. */ readonly warnings: readonly string[]; readonly improvements: readonly string[]; readonly deltas: readonly RetrievalMetricDelta[]; }; type CompareRetrievalBaselineOptions = { /** Slack allowed on the blocking metric before a drop counts as a regression. Default 0. */ readonly tolerance?: number; }; /** * Compare a fresh result with an approved baseline. * * A changed suite fails the gate rather than being silently compared: the figures were * measured over different questions, so neither a pass nor a regression would mean * anything. Resolving it is an explicit baseline update. */ declare const compareRetrievalBaseline: (result: RetrievalBenchResultV1, baseline: RetrievalBaselineV1, options?: CompareRetrievalBaselineOptions) => RetrievalComparison; declare const formatRetrievalComparisonText: (comparison: RetrievalComparison) => readonly string[]; declare const STUDY_PROTOCOL_SCHEMA_VERSION: 1; declare const STUDY_PROTOCOL_CONTENT_HASH_ALGO: "sha256-normalized-v1"; declare const StudyProtocolV1Schema: z.ZodObject<{ type: z.ZodLiteral<"study-protocol">; schemaVersion: z.ZodLiteral<1>; protocolVersion: z.ZodString; title: z.ZodString; evidenceClasses: z.ZodArray>; repositories: z.ZodArray; role: z.ZodEnum<{ product: "product"; consumer: "consumer"; }>; }, z.core.$strict>>; taskCategories: z.ZodArray>; models: z.ZodArray; status: z.ZodEnum<{ planned: "planned"; pinned: "pinned"; }>; provider: z.ZodOptional; model: z.ZodOptional; version: z.ZodOptional; promptContractHash: z.ZodOptional; }, z.core.$strict>>; scenarios: z.ZodArray; modelIds: z.ZodArray; registryAgent: z.ZodOptional>; requiresHumanApproval: z.ZodBoolean; }, z.core.$strict>>; metrics: z.ZodArray; unit: z.ZodEnum<{ tokens: "tokens"; count: "count"; milliseconds: "milliseconds"; bytes: "bytes"; ratio: "ratio"; percent: "percent"; currency: "currency"; }>; source: z.ZodEnum<{ provider: "provider"; human: "human"; adjudicator: "adjudicator"; runner: "runner"; "doc-bridge": "doc-bridge"; }>; required: z.ZodBoolean; description: z.ZodString; }, z.core.$strict>>; outcomes: z.ZodArray>>; notApplicableReason: z.ZodOptional; }, z.core.$strict>>; budget: z.ZodObject<{ maxTokensPerTask: z.ZodNumber; maxRuntimeMsPerTask: z.ZodNumber; maxRuns: z.ZodNumber; maxNetworkRequests: z.ZodNumber; }, z.core.$strict>; privacy: z.ZodObject<{ mode: z.ZodLiteral<"anonymized">; forbiddenFields: z.ZodArray>; publicationRequiresHumanReview: z.ZodLiteral; }, z.core.$strict>; stopping: z.ZodObject<{ minControlledRounds: z.ZodNumber; consecutiveNoMaterialImprovementRounds: z.ZodNumber; targets: z.ZodArray; threshold: z.ZodNumber; }, z.core.$strict>>; }, z.core.$strict>; contentHash: z.ZodString; contentHashAlgo: z.ZodLiteral<"sha256-normalized-v1">; }, z.core.$strict>; type StudyProtocolV1 = z.infer; declare const HistoricalEvidenceRecordV1Schema: z.ZodObject<{ id: z.ZodString; evidenceClass: z.ZodLiteral<"historical">; observedAt: z.ZodString; subject: z.ZodObject<{ kind: z.ZodEnum<{ consumer: "consumer"; aggregate: "aggregate"; }>; id: z.ZodString; }, z.core.$strict>; source: z.ZodObject<{ kind: z.ZodEnum<{ benchmark: "benchmark"; "validation-plan": "validation-plan"; "verification-run": "verification-run"; "study-artifact": "study-artifact"; issue: "issue"; "pull-request": "pull-request"; }>; reference: z.ZodString; }, z.core.$strict>; docBridgeVersion: z.ZodOptional; sourceRevisionHash: z.ZodOptional; snapshotHash: z.ZodOptional; reportHash: z.ZodOptional; workflowRunId: z.ZodOptional; verificationRunId: z.ZodOptional; status: z.ZodEnum<{ "not-analyzed": "not-analyzed"; "not-applicable": "not-applicable"; validated: "validated"; blocked: "blocked"; "partially-validated": "partially-validated"; }>; metrics: z.ZodDefault>; missingMetrics: z.ZodDefault; reason: z.ZodString; }, z.core.$strict>>>; limitations: z.ZodArray; }, z.core.$strict>; type HistoricalEvidenceRecordV1 = z.infer; declare const HistoricalEvidenceRegistryV1Schema: z.ZodObject<{ type: z.ZodLiteral<"historical-evidence-registry">; schemaVersion: z.ZodLiteral<1>; registryVersion: z.ZodString; records: z.ZodArray; observedAt: z.ZodString; subject: z.ZodObject<{ kind: z.ZodEnum<{ consumer: "consumer"; aggregate: "aggregate"; }>; id: z.ZodString; }, z.core.$strict>; source: z.ZodObject<{ kind: z.ZodEnum<{ benchmark: "benchmark"; "validation-plan": "validation-plan"; "verification-run": "verification-run"; "study-artifact": "study-artifact"; issue: "issue"; "pull-request": "pull-request"; }>; reference: z.ZodString; }, z.core.$strict>; docBridgeVersion: z.ZodOptional; sourceRevisionHash: z.ZodOptional; snapshotHash: z.ZodOptional; reportHash: z.ZodOptional; workflowRunId: z.ZodOptional; verificationRunId: z.ZodOptional; status: z.ZodEnum<{ "not-analyzed": "not-analyzed"; "not-applicable": "not-applicable"; validated: "validated"; blocked: "blocked"; "partially-validated": "partially-validated"; }>; metrics: z.ZodDefault>; missingMetrics: z.ZodDefault; reason: z.ZodString; }, z.core.$strict>>>; limitations: z.ZodArray; }, z.core.$strict>>; contentHash: z.ZodString; contentHashAlgo: z.ZodLiteral<"sha256-normalized-v1">; }, z.core.$strict>; type HistoricalEvidenceRegistryV1 = z.infer; declare const createStudyProtocol: (input: unknown) => StudyProtocolV1; declare const parseStudyProtocol: (input: unknown) => StudyProtocolV1; declare const createHistoricalEvidenceRegistry: (input: unknown) => HistoricalEvidenceRegistryV1; declare const parseHistoricalEvidenceRegistry: (input: unknown) => HistoricalEvidenceRegistryV1; declare const validateHistoricalEvidenceRegistry: (registry: HistoricalEvidenceRegistryV1, protocol: StudyProtocolV1) => void; declare const formatStudyProtocolText: (protocol: StudyProtocolV1) => readonly string[]; declare const formatHistoricalEvidenceText: (registry: HistoricalEvidenceRegistryV1) => readonly string[]; declare const STUDY_TASK_SUITE_SCHEMA_VERSION: 1; declare const STUDY_TASK_SUITE_CONTENT_HASH_ALGO: "sha256-normalized-v1"; declare const categories: readonly ["discovery", "architecture", "documentation", "implementation"]; declare const outcomes: readonly ["success", "partial", "incorrect", "incomplete", "blocked"]; /** * What mechanically checks a rubric item, when anything does. * * `acceptance-checks` is the task's own commands and their exit status; `evidence-coverage` is * whether each required evidence id was cited; `retrieval-expectations` is the entities and * documents the task expects retrieval to return, measured by `ak-docs bench retrieval`. An item * that names one of these is decided by the runner and never shown to the model adjudicator. */ declare const RUBRIC_MECHANICAL_CHECKS: readonly ["acceptance-checks", "evidence-coverage", "retrieval-expectations"]; type RubricMechanicalCheck = (typeof RUBRIC_MECHANICAL_CHECKS)[number]; /** * A rubric item: prose, or prose with the mechanical check that decides it. * * The plain string is kept because most of a rubric is a judgement — "the answer identifies a * wrong entrypoint" is not something a checker can settle — and a suite written before this * existed stays valid, with every item going to the adjudicator exactly as before. */ declare const RubricItemSchema: z.ZodUnion; }, z.core.$strict>]>; type RubricItem = z.infer; declare const rubricItemText: (item: RubricItem) => string; declare const rubricItemCheck: (item: RubricItem) => RubricMechanicalCheck | undefined; declare const StudyTaskSuiteV1Schema: z.ZodObject<{ type: z.ZodLiteral<"study-task-suite">; schemaVersion: z.ZodLiteral<1>; suiteVersion: z.ZodString; protocolVersion: z.ZodString; title: z.ZodString; population: z.ZodArray; modelIds: z.ZodArray; scenarioIds: z.ZodArray; maxTokensPerTask: z.ZodNumber; maxRuntimeMsPerTask: z.ZodNumber; maxRuns: z.ZodNumber; replicatesPerTask: z.ZodNumber; ordering: z.ZodObject<{ strategy: z.ZodLiteral<"balanced-counter-order">; seed: z.ZodString; }, z.core.$strict>; tasks: z.ZodArray; difficulty: z.ZodEnum<{ medium: "medium"; easy: "easy"; hard: "hard"; }>; objective: z.ZodString; initialContext: z.ZodArray; allowedTools: z.ZodArray; forbiddenActions: z.ZodArray; expectedOutcome: z.ZodString; evidenceRequirements: z.ZodArray; }, z.core.$strict>>; acceptanceChecks: z.ZodArray>; budget: z.ZodObject<{ maxTokens: z.ZodNumber; maxRuntimeMs: z.ZodNumber; }, z.core.$strict>; surfaces: z.ZodObject<{ cli: z.ZodObject<{ required: z.ZodBoolean; reason: z.ZodOptional; }, z.core.$strict>; mcp: z.ZodObject<{ required: z.ZodBoolean; reason: z.ZodOptional; }, z.core.$strict>; docs: z.ZodObject<{ required: z.ZodBoolean; reason: z.ZodOptional; }, z.core.$strict>; endpoint: z.ZodObject<{ required: z.ZodBoolean; reason: z.ZodOptional; }, z.core.$strict>; logic: z.ZodObject<{ required: z.ZodBoolean; reason: z.ZodOptional; }, z.core.$strict>; database: z.ZodObject<{ required: z.ZodBoolean; reason: z.ZodOptional; }, z.core.$strict>; ui: z.ZodObject<{ required: z.ZodBoolean; reason: z.ZodOptional; }, z.core.$strict>; }, z.core.$strict>; rubric: z.ZodObject<{ success: z.ZodArray; }, z.core.$strict>]>>; partial: z.ZodArray; }, z.core.$strict>]>>; incorrect: z.ZodArray; }, z.core.$strict>]>>; incomplete: z.ZodArray; }, z.core.$strict>]>>; blocked: z.ZodArray; }, z.core.$strict>]>>; }, z.core.$strict>; variantGroup: z.ZodString; variants: z.ZodArray>; expectedEntities: z.ZodOptional>; expectedDocuments: z.ZodOptional>; retrievalQueries: z.ZodOptional>; }, z.core.$strict>>; contentHash: z.ZodString; contentHashAlgo: z.ZodLiteral<"sha256-normalized-v1">; }, z.core.$strict>; type StudyTaskSuiteV1 = z.infer; type StudyTaskV1 = StudyTaskSuiteV1['tasks'][number]; type TaskOutcomeStatus = typeof outcomes[number]; /** Whether a task can be checked without asking a model anything. */ declare const hasRetrievalExpectations: (task: StudyTaskV1) => boolean; /** The queries a task is checked with: its own, or its objective. */ declare const taskRetrievalQueries: (task: StudyTaskV1) => readonly string[]; /** The rubric items a checker decides, by outcome. */ declare const mechanicalRubricItems: (task: StudyTaskV1) => readonly { readonly outcome: TaskOutcomeStatus; readonly text: string; readonly check: RubricMechanicalCheck; }[]; /** * The rubric items no checker can decide — the only ones a model adjudicator should ever see. * * Handing a model an item the runner already settled invites it to disagree with a measurement, * which is how a study ends up with an opinion where it had a number. */ declare const modelRubricItems: (task: StudyTaskV1) => Readonly>; type ValidateStudyTaskSuiteOptions = { /** * Require every task to declare retrieval expectations. * * Off by default, because a suite written before expectations existed is still a valid suite. * A study that wants a mechanical answer turns it on and finds out which tasks cannot give one. */ readonly requireExpectations?: boolean; }; declare const validateStudyTaskSuite: (suite: StudyTaskSuiteV1, options?: ValidateStudyTaskSuiteOptions) => void; declare const createStudyTaskSuite: (input: unknown) => StudyTaskSuiteV1; declare const parseStudyTaskSuite: (input: unknown) => StudyTaskSuiteV1; type TaskExecution = { readonly taskId: string; readonly repositoryId: string; readonly category: typeof categories[number]; readonly scenarioId: string; readonly modelId: string; readonly replicate: number; readonly variantId: string; }; declare const selectTaskExecutions: (suite: StudyTaskSuiteV1, sampleSize?: number, sampling?: { readonly strategy?: "balanced-task-strata" | "pairwise-task-strata"; readonly scenarioIds?: readonly string[]; }) => readonly TaskExecution[]; type TaskEvaluationInput = { readonly acceptanceChecksPassed: number; readonly evidenceItemsPresent: number; readonly blocked?: boolean; readonly incorrect?: boolean; }; type TaskEvaluation = TaskEvaluationInput & { readonly status: TaskOutcomeStatus; }; declare const evaluateStudyTask: (task: StudyTaskV1, result: TaskEvaluationInput) => TaskEvaluation; declare const formatStudyTaskSuiteText: (suite: StudyTaskSuiteV1) => readonly string[]; declare const STUDY_ADJUDICATION_METHOD: "independent-rubric-v1"; /** * What the adjudicator is asked, and what it is not. * * A rubric item with a mechanical check has already been decided by the runner — acceptance * commands and their exit status, evidence coverage, retrieval expectations. Showing such an item * to a model invites it to disagree with a measurement, which is how a study ends up with an * opinion where it had a number. So the input carries only the items no checker can settle, and * the settled ones travel next to them as `mechanical`: verdicts, for context, not for review. */ declare const adjudicatorRubric: (task: StudyTaskV1) => { readonly rubric: ReturnType; readonly mechanical: ReturnType; }; declare const independentlyAdjudicateStudyObservation: (task: StudyTaskV1, observation: ControlledStudyObservationV1, config: StudyAdjudicatorCli, cwd: string, maxRuntimeMs: number, configurationHash: string) => Promise; type IndependentStudyAdjudicationOptions = { readonly ledger: ControlledStudyObservationLedgerV1; readonly taskSuite: ReturnType; readonly config: StudyAdjudicatorCli; readonly configurationHash: string; readonly cwd: string; readonly maxRuntimeMs: number; readonly runId?: string; readonly limit?: number; readonly offset?: number; }; declare const independentlyAdjudicateStudyLedger: (options: IndependentStudyAdjudicationOptions) => Promise; declare const persistIndependentlyAdjudicatedLedger: (path: string, ledger: ControlledStudyObservationLedgerV1) => string; declare const adjudicatedLedgerInputHash: (task: StudyTaskV1, observation: ControlledStudyObservationV1) => string; type ProviderToolTelemetry = { readonly observedToolEventCount: number; readonly observedToolInputBytes: number; readonly observedToolOutputBytes: number; }; declare const measureProviderToolTelemetry: (events: readonly unknown[]) => ProviderToolTelemetry; declare const STUDY_REPOSITORY_CONFIG_SCHEMA_VERSION: 1; declare const STUDY_REPOSITORY_CONFIG_CONTENT_HASH_ALGO: "sha256-normalized-v1"; declare const StudyRepositoryConfigV1Schema: z.ZodObject<{ type: z.ZodLiteral<"controlled-study-repository-config">; schemaVersion: z.ZodLiteral<1>; configVersion: z.ZodString; repositories: z.ZodArray>; contentHash: z.ZodString; contentHashAlgo: z.ZodLiteral<"sha256-normalized-v1">; }, z.core.$strict>; type StudyRepositoryConfigV1 = z.infer; type ControlledStudyRunOptions = { readonly plan: ControlledStudyRunPlanV1; readonly suite: StudyTaskSuiteV1; readonly providers: StudyProviderCliConfigV1; readonly repositories: StudyRepositoryConfigV1; readonly ledgerPath: string; readonly round?: string; readonly dryRun?: boolean; }; /** * Whether the assisted arm can run at all, and why not when it cannot. * * The `registry-assisted` scenario has been reserved since the first suite and has never * executed. It must be possible to run a study without it — a missing Registry is a fact about * the environment, not a reason to lose the other two arms — so the arm reports itself * unavailable and its executions are recorded as unavailable observations. */ type AssistedArmStatus = { readonly status: 'ready' | 'unavailable'; readonly reason?: string; /** * Fields the arm ran without: `promptVersion`, `agentBudget`. It still runs — losing the third * arm over a missing declaration would be worse than running it — but a run that cannot name * the prompt it used, or cost the enrichment agent apart from the model, says so here. */ readonly undeclared?: readonly string[]; /** Executions recorded as unavailable because the arm could not run. */ readonly recorded: number; }; type ControlledStudyRunSummary = { readonly status: 'dry-run' | 'completed'; readonly runId: string; readonly planned: number; readonly executed: number; readonly skipped: number; readonly ledgerPath?: string; readonly ledgerHash?: string; readonly providerConfigHash: string; readonly repositoryConfigHash: string; readonly assistedArm: AssistedArmStatus; }; declare const createStudyRepositoryConfig: (input: unknown) => StudyRepositoryConfigV1; declare const parseStudyRepositoryConfig: (input: unknown) => StudyRepositoryConfigV1; declare const ASSISTED_SCENARIO: "registry-assisted"; /** * What the assisted arm needs before it is allowed to run: a provider for every model, and a * scenario that declares the agent, its version, its prompt version and its own budget. */ declare const assistedArmReadiness: (plan: ControlledStudyRunPlanV1, providers: StudyProviderCliConfigV1, suite: StudyTaskSuiteV1) => Omit; declare const adjudicateControlledStudyObservation: (task: StudyTaskV1, observation: ControlledStudyObservationV1) => ControlledStudyObservationV1; declare const runControlledStudy: (options: ControlledStudyRunOptions) => Promise; declare const formatControlledStudyRunText: (summary: ControlledStudyRunSummary) => readonly string[]; declare class IndexNotFoundError extends Error { readonly path: string; constructor(path: string); } declare class IndexStaleError extends Error { readonly path: string; readonly actual: string; readonly expected: string; constructor(path: string, actual: string, expected: string); } declare const indexFilePath: (root: string, config: DocBridgeConfigV1) => string; declare const loadDocBridgeIndex: (root: string, config: DocBridgeConfigV1) => DocBridgeIndexV1; /** * Load only an index whose content matches the current repository inputs. * * Every query goes through here, so the check has to be cheap. An index that records its inputs * is verified by re-hashing those inputs — one walk — instead of rebuilding the whole index, * which on a repository of any size meant projecting and parsing the corpus on every search. The * hash covers the input files and the configuration, and the recorded lexicon version is checked * too, because a changed stopword list changes ranking without changing a single file. * * An index built before inputs were recorded falls back to the full rebuild, so an older artifact * is still validated rather than trusted. */ declare const loadFreshDocBridgeIndex: (root: string, config: DocBridgeConfigV1) => DocBridgeIndexV1; declare const resolveRoot: (cwd?: string) => string; /** * A handoff for any entity the projection knows. * * `handoffForPackage` could answer for an ownership record and nothing else: an agent asking * about a module, an area or a document got "unknown package". Now the answer is derived from * the graph — which documents cover the target, which mention it, what its code depends on — and * every field says which relations produced it, so a handoff that points somewhere odd is a * finding about the repository rather than a mystery about the tool. */ type HandoffOptions = { /** The project root, for the package-script fallback when nothing declares checks. */ readonly root?: string; }; /** * Which entry an identifier names: an entity id, an ownership id, an alias, or a path. * * Ownership ids win over aliases because they are what a routing command has always accepted; * a path is accepted last, since `src/query` is a directory before it is a name. */ declare const resolveHandoffEntry: (projection: RetrievalIndexV1, id: string) => RetrievalEntry | undefined; /** * Build the handoff for a package, an area, a module or a document. * * `editRoots` is the unit an agent may write in: the area or package itself, a module's area, * a document's own path. `startHere` and `readBeforeEditing` come from the documentation graph. * `related` names the areas this unit's code depends on and that depend on it, with the import * that proves each. `explain` says which relation produced each field. */ declare const handoffForEntity: (index: DocBridgeIndexV1, id: string, config: DocBridgeConfigV1, options?: HandoffOptions) => AgentHandoffV1; type QueryKind = 'package' | 'ownership' | 'intent' | 'change' | 'search'; type QueryRequest = { readonly kind: QueryKind; readonly id?: string; readonly term?: string; readonly agent?: boolean; /** Attach the matched terms and scoring components to search results. Never changes the ranking. */ readonly explain?: boolean; readonly mode?: AgentQueryMode; readonly contextBudgetTokens?: number; }; type QueryResult = { readonly type: 'package' | 'ownership' | 'intent' | 'change' | 'search'; readonly data: unknown; } | AgentHandoffV1 | AgentSearchV1; declare const runQuery: (index: DocBridgeIndexV1, config: DocBridgeConfigV1, req: QueryRequest, options?: HandoffOptions) => QueryResult; declare const ingestCursorRules: (root: string) => MemoryCandidateV1[]; declare const ingestAgentMemory: (root: string) => MemoryCandidateV1[]; declare const ingestMemoryCandidates: (root: string) => MemoryCandidateV1[]; /** * Doc Bridge as a `Retriever`. * * The types below mirror `RetrievedDocument`, `RetrieverRequest` and `Retriever` from * `@agentskit/core`, which is an optional peer: a published type that only resolves when an * optional package is installed breaks a clean install. A test asserts assignability against the * real package and runs the real hybrid retriever over this one, so a drift fails there rather * than at a consumer. */ type RetrievedDocument = { readonly id: string; readonly content: string; readonly source?: string; readonly score?: number; readonly metadata?: Record; }; type RetrieverRequest = { readonly query: string; readonly messages: readonly unknown[]; }; type Retriever = { readonly retrieve: (request: RetrieverRequest) => RetrievedDocument[] | Promise; }; type DocBridgeRetrieverOptions = { readonly property?: string; readonly limit?: number; /** The `--agent` prior. */ readonly agent?: boolean; }; type DocBridgeRetrievedChunk = { readonly chunkKey: string; readonly property: string; readonly type: string; readonly id: string; readonly path: string; readonly title?: string; readonly summary?: string; readonly score: number; }; type DocBridgeRetriever = Retriever & { /** The original calling convention, kept: a query string and an optional limit. */ readonly retrieve: ((request: RetrieverRequest) => RetrievedDocument[]) & ((query: string, options?: Pick) => RetrievedDocument[]); }; declare const retrieveDocBridgeChunks: (index: DocBridgeIndexV1, query: string, options?: DocBridgeRetrieverOptions) => DocBridgeRetrievedChunk[]; /** * Rank the index and return the results as `RetrievedDocument`s. * * `metadata` carries what the ecosystem consumers read after the content: the record kind, its * path, the evidence that backs it, the explanation of its rank and its confidence. A hybrid or * reranked retriever wraps this one with no adapter, because the shape is the contract's. */ declare const retrieveDocBridgeDocuments: (index: DocBridgeIndexV1, query: string, options?: DocBridgeRetrieverOptions) => RetrievedDocument[]; declare const createDocBridgeRetriever: (index: DocBridgeIndexV1, options?: DocBridgeRetrieverOptions) => DocBridgeRetriever; /** * The prose rendering of retrieved documents, as `formatRetrievedDocuments` in `@agentskit/core` * renders them: a numbered block per document, its source when it has one, then its content. * Mirrored for the same reason the types above are — the peer is optional and the knowledge * tools must render text without it — and asserted identical to the real function by test. */ declare const formatRetrievedDocuments: (documents: readonly RetrievedDocument[]) => string; type FetchText = (url: string) => Promise; type FederatedRetrieverOptions = { readonly fetchText?: FetchText; readonly limit?: number; }; declare const parseLlmsTxtLinks: (raw: string) => { title: string; url: string; description?: string; }[]; declare const chunksFromMarkdown: (property: string, raw: string, sourceUrl: string) => DocBridgeRetrievedChunk[]; declare const loadFederatedChunks: (root: string, config: DocBridgeConfigV1, options?: FederatedRetrieverOptions) => Promise; declare const retrieveHybridChunks: (root: string, config: DocBridgeConfigV1, index: DocBridgeIndexV1, query: string, options?: FederatedRetrieverOptions) => Promise; declare const PACKAGE_VERSION = "1.11.1"; type FrontmatterValue = string | boolean | readonly string[]; type FrontmatterData = Record; type CorpusDoc = KnowledgeEntry & { readonly absPath: string; readonly relPath: string; readonly frontmatter: FrontmatterData; }; type DiscoveredPackage = { readonly id: string; readonly path: string; readonly name?: string; readonly checks?: readonly string[]; }; type IndexLookup = { packages: string[]; ownership: Record; intents: Record; changes: Record; }; type OwnershipRecord = { id: string; path: string; group?: string; layer?: string; purpose?: string; checks: string[]; checksSource?: 'ownership' | 'frontmatter' | 'package-scripts' | 'default'; agentDoc?: string; humanDoc?: string; readme?: string; }; type IntentRecord = { id: string; title: string; paths: string[]; }; type ChangeRecord = { id: string; title: string; startHere: string; relatedPackages?: string[]; }; /** * Merge package identity from: * 1. routing.options.ownership (explicit) * 2. pnpm / workspace discovery * 3. agent-doc frontmatter (package + editRoot) * 4. corpus path heuristics (packages/.md, pillars patterns, etc.) */ declare const collectPackages: (config: DocBridgeConfigV1, discovered: readonly DiscoveredPackage[], corpus: readonly CorpusDoc[]) => DiscoveredPackage[]; declare const buildLookup: (config: DocBridgeConfigV1, packages: readonly DiscoveredPackage[], corpus: readonly CorpusDoc[], indexOutFile: string, humanDocs?: HumanDocMap, root?: string) => { lookup: IndexLookup; handoffs: Record; }; declare const discoverNxProjects: (root: string, config: DocBridgeConfigV1) => DiscoveredPackage[]; type RagSearchHit = { readonly id?: string; readonly content: string; readonly score?: number; readonly source?: string; readonly metadata?: Record; }; type DocBridgeRag = { readonly ingest: () => Promise<{ documentCount: number; storePath: string; }>; readonly search: (query: string, topK?: number) => Promise; readonly retriever: unknown; readonly storePath: string; }; declare const createDocBridgeRag: (root: string, config: DocBridgeConfigV1, index: DocBridgeIndexV1) => Promise; declare const runChatOnce: (root: string, config: DocBridgeConfigV1, index: DocBridgeIndexV1, question: string) => Promise<{ content: string; handoffPrefixed: boolean; }>; declare const startInkChat: (root: string, config: DocBridgeConfigV1, index: DocBridgeIndexV1) => Promise; declare class PeerMissingError extends Error { readonly peer: string; readonly installHint: string; constructor(peer: string, installHint: string); } declare const layer1InstallHint: () => string; declare const DOC_BRIDGE_PATTERN_ID: "doc-bridge-pattern"; declare const DOC_BRIDGE_PATTERN_META: { readonly id: "doc-bridge-pattern"; readonly title: "Doc Bridge Pattern"; readonly slug: "pillars/ai-collaboration/doc-bridge-pattern"; readonly license: "CC-BY-4.0"; readonly visibility: "public"; readonly playbookUrl: "https://playbook.agentskit.io/patterns/doc-bridge-pattern"; readonly npmPackage: "@agentskit/doc-bridge"; readonly cli: "ak-docs"; }; declare const docBridgePatternMarkdown: () => string; declare const docBridgePatternPayload: () => { format: string; body: string; id: "doc-bridge-pattern"; title: "Doc Bridge Pattern"; slug: "pillars/ai-collaboration/doc-bridge-pattern"; license: "CC-BY-4.0"; visibility: "public"; playbookUrl: "https://playbook.agentskit.io/patterns/doc-bridge-pattern"; npmPackage: "@agentskit/doc-bridge"; cli: "ak-docs"; }; /** * Token budgets, in the shape `@agentskit/core` gives them. * * `compileBudget` and `approximateCounter` below mirror the functions of the same name in * `@agentskit/core`, restricted to what a deterministic payload needs: the `drop-oldest` * strategy over plain role/content messages, with no system prompt, tools or summariser. The * core package is an optional peer and every query surface must answer with no peer installed, * so the algorithm lives here and a test runs the real `compileBudget` over the same messages * and asserts the two agree on every token count, every dropped message and `fits`. * * The mirror is synchronous where the original is a promise: nothing here can await, and the * MCP handlers that call it answer in one turn. */ type BudgetMessage = { readonly role: string; readonly content: string; }; type BudgetTokenCounter = { readonly name: string; readonly count: (messages: readonly BudgetMessage[]) => number; }; /** * Four characters per token, plus two per message, over role and content — the rule of thumb * `@agentskit/core` uses. Good enough for budget planning, and reported as such. */ declare const approximateCounter: BudgetTokenCounter; declare const TOKEN_METHOD: "approximate"; type CompileBudgetInput = { /** Hard upper bound on the tokens of what is kept. */ readonly budget: number; /** Oldest first: the front of the list is dropped first. */ readonly messages: readonly BudgetMessage[]; readonly counter?: BudgetTokenCounter; /** Never drop below this many messages, counted from the end. Default 1. */ readonly keepRecent?: number; readonly reserveForOutput?: number; }; type CompileBudgetResult = { readonly messages: readonly BudgetMessage[]; readonly tokens: { readonly system: number; readonly messages: number; readonly tools: number; readonly total: number; readonly budget: number; }; readonly dropped: readonly BudgetMessage[]; readonly fits: boolean; readonly strategy: 'drop-oldest'; }; /** * Drop the oldest messages until the rest fits the budget, keeping at least `keepRecent`. * * The last message is never dropped by default, which is what makes the strategy usable for a * payload: the section that must survive is placed last, and the sections that may go are placed * first, in the order they may go. `fits` is false only when what could not be dropped still * exceeds the budget — an honest answer rather than a truncated one. */ declare const compileBudget: (input: CompileBudgetInput) => CompileBudgetResult; /** * The sections a budgeted payload may shed, in the order it sheds them. * * Excerpts go first: they are the longest text and the easiest to fetch again. Then the related * areas, then the neighbourhood, then the summaries. What is never on this list — the entity, * the evidence paths and hashes, the handoff fields an agent acts on, the open diagnostics — * is never dropped: a payload that no longer fits reports `fits: false` rather than losing them. */ declare const BUDGET_SECTION_ORDER: readonly ["evidenceExcerpts", "related", "neighbours", "summaries"]; declare const BudgetSectionSchema: z.ZodEnum<{ evidenceExcerpts: "evidenceExcerpts"; related: "related"; neighbours: "neighbours"; summaries: "summaries"; }>; type BudgetSection = z.infer; declare const BudgetReportSchema: z.ZodObject<{ budgetTokens: z.ZodNumber; tokens: z.ZodObject<{ total: z.ZodNumber; budget: z.ZodNumber; core: z.ZodNumber; sections: z.ZodRecord & z.core.$partial, z.ZodNumber>; }, z.core.$strict>; fits: z.ZodBoolean; order: z.ZodArray>; kept: z.ZodArray>; dropped: z.ZodArray>; tokenMethod: z.ZodLiteral<"approximate">; }, z.core.$strict>; type BudgetReport = z.infer; /** * One droppable section of a payload: what it contributes, and the payload without it. * * `content` is what the section costs — the strings a reader would lose — and `strip` removes * exactly that from the payload, so the payload with the section stripped and the section's * content together are the whole payload. A section whose content is empty is absent from the * report rather than reported kept: nothing was there to keep. */ type BudgetedSection = { readonly name: BudgetSection; readonly content: unknown; readonly strip: (payload: T) => T; }; /** * Trim a payload to a token budget, section by section, in the declared order. * * Each present section becomes one message, oldest first in the order they may be dropped, and * the payload with every section stripped becomes the last message — the one `compileBudget` * never drops. The result is the payload with the dropped sections stripped and a report of what * it cost, what was dropped and whether it fits. Two calls over the same payload and budget give * the same report: the counter is arithmetic over the serialised sections. */ declare const applyBudget: (payload: T, sections: readonly BudgetedSection[], budgetTokens: number) => { readonly payload: T; readonly budget: BudgetReport; }; /** * The two calls an agent makes before editing: search, and one lookup that answers "tell me * about this" with the entity, its neighbourhood, the documents about it, its handoff, its open * diagnostics and its evidence — bounded by a declared token budget when the caller has one. * * Both read the retrieval projection the CLI reads and rank with the same `searchIndex`, so a * result here is the result `ak-docs search` prints for the same query and index; a test compares * the two rather than assuming it. Neither imports anything under `src/agents`: this is the * deterministic layer, and a lookup costs milliseconds with no model in the loop. */ declare const KNOWLEDGE_TOOLS_SCHEMA_VERSION: 1; declare const MAX_LOOKUP_DEPTH = 3; type KnowledgeSearchRequest = { readonly query: string; /** Keep only these entry kinds. Filtering happens after ranking, so it never changes an order. */ readonly kinds?: readonly RetrievalKind[] | undefined; readonly limit?: number | undefined; readonly explain?: boolean | undefined; readonly budgetTokens?: number | undefined; /** The `--agent` prior. */ readonly agent?: boolean | undefined; }; type KnowledgeSearchResult = SearchMatch & { readonly title?: string; /** The opening of the projected body: the evidence excerpt a budget sheds first. */ readonly excerpt?: string; }; type KnowledgeSearchResponse = { readonly type: 'knowledge-search'; readonly schemaVersion: typeof KNOWLEDGE_TOOLS_SCHEMA_VERSION; readonly source: string; readonly query: string; readonly kinds?: readonly RetrievalKind[]; readonly limit: number; readonly count: number; readonly results: readonly KnowledgeSearchResult[]; readonly budget?: BudgetReport; }; type KnowledgeLookupRequest = { readonly id?: string | undefined; readonly path?: string | undefined; /** How many hops of the graph to include as neighbours. 1 by default, at most `MAX_LOOKUP_DEPTH`. */ readonly depth?: number | undefined; readonly budgetTokens?: number | undefined; }; type KnowledgeLookupEntity = { readonly id: string; readonly kind: RetrievalKind; readonly path: string; readonly title: string; readonly summary?: string; readonly audience?: RetrievalEntry['audience']; readonly aliases: readonly string[]; readonly symbols?: readonly string[]; readonly tags: readonly string[]; readonly provenance: RetrievalEntry['provenance']; readonly confidence: Confidence; readonly contentHash: string; readonly ownershipId?: string; readonly areaId?: string; readonly packageId?: string; readonly pagerank: number; }; type KnowledgeNeighbour = { readonly id: string; readonly kind: RetrievalKind; readonly path: string; readonly title: string; readonly summary?: string; /** Whether the edge points at the entity or away from it. */ readonly direction: 'inbound' | 'outbound'; readonly confidence: Confidence; /** Hops from the entity. */ readonly distance: number; /** The entry this one was reached through, when it is more than one hop away. */ readonly via?: string; }; type KnowledgeDocumentRef = { readonly id: string; readonly path: string; readonly title: string; readonly summary?: string; readonly audience?: RetrievalEntry['audience']; readonly pagerank: number; }; type KnowledgeEvidence = Evidence & { readonly excerpt?: string; }; type KnowledgeLookupResponse = { readonly type: 'knowledge-lookup'; readonly schemaVersion: typeof KNOWLEDGE_TOOLS_SCHEMA_VERSION; readonly source: string; readonly depth: number; readonly entity: KnowledgeLookupEntity; /** Neighbours by relation kind, keys sorted, each list by distance then id. */ readonly neighbours: Readonly>; readonly documents: { readonly covering: readonly KnowledgeDocumentRef[]; readonly mentioning: readonly KnowledgeDocumentRef[]; }; readonly handoff: AgentHandoffV1; readonly diagnostics: { /** The reconciliation report the diagnostics came from, or null when no workflow run exists. */ readonly reportHash: string | null; readonly open: readonly KnowledgeDiagnostic[]; }; readonly evidence: readonly KnowledgeEvidence[]; readonly budget?: BudgetReport; }; type KnowledgeLookupOptions = { readonly root?: string; /** The latest reconciliation report, when a workflow run has produced one. */ readonly report?: () => ReconciliationReportV1 | undefined; }; /** * Ranked entries for a query. * * With no `kinds`, this is exactly `searchIndex(index, query, limit)` — the CLI's call — with a * title and an excerpt added to each result. With `kinds`, the ranking is fetched deeper and * filtered, because a filter applied before the limit would return fewer than `limit` results * for a query that mostly matched another kind. */ declare const knowledgeSearch: (index: DocBridgeIndexV1, request: KnowledgeSearchRequest) => KnowledgeSearchResponse; /** Which entry a lookup names: by id first, then by path, through the same resolution the handoff uses. */ declare const resolveLookupEntry: (projection: RetrievalIndexV1, request: Pick) => RetrievalEntry; /** * Everything an agent wants to know about one entity before editing, in one bounded response. * * The handoff is the one `handoff.resolve` returns for the same entity; the documents are the * projection's `coveredBy` and `mentionedBy`, most canonical first; the diagnostics are the open * ones from the latest reconciliation report that name the entity or its file; the evidence is * the entity's own path and hash and those of the documents about it, each with the opening of * its body as an excerpt — the first thing a budget sheds. */ declare const knowledgeLookup: (index: DocBridgeIndexV1, config: DocBridgeConfigV1, request: KnowledgeLookupRequest, options?: KnowledgeLookupOptions) => KnowledgeLookupResponse; /** * A handoff trimmed to a budget. Its droppable sections are `related` and the note that repeats * the target's summary; `startHere`, `readBeforeEditing`, `editRoots`, `checks` and `evidence` * are what an agent acts on and are never shed. */ declare const budgetedHandoff: (index: DocBridgeIndexV1, handoff: AgentHandoffV1, budgetTokens: number) => AgentHandoffV1; /** The search payload as prose: one numbered block per result, through `formatRetrievedDocuments`. */ declare const formatKnowledgeSearchText: (response: KnowledgeSearchResponse) => string; /** The lookup payload as prose: the entity, then one block per section that has content. */ declare const formatKnowledgeLookupText: (response: KnowledgeLookupResponse) => string; /** * The canonical finding, as the rest of the ecosystem consumes it. * * `Finding` and `SEVERITY_ORDER` mirror `@agentskit/core/finding`, which is an optional peer: * Code Review, AKOS and dashboards read this shape, so a Doc Bridge diagnostic reported in it * needs no parser of its own. A test imports the real package and asserts that what is emitted * here is assignable to it and that the severities are drawn from the real order. * * This is a reporter, not a migration. `KnowledgeDiagnostic`, `RuleFinding` and * `DocumentationAuditFinding` keep their shapes; all three carry the fields the reporter reads. */ /** Ordered most to least severe, as the ecosystem orders them. */ declare const SEVERITY_ORDER: readonly ["critical", "high", "medium", "low", "info"]; type Severity = (typeof SEVERITY_ORDER)[number]; type Finding = { id: string; severity: Severity; title: string; detail: string; category?: string; location?: string; confidence?: number; remediation?: string; ref?: string; metadata?: Record; }; /** What the three internal shapes have in common, which is all the reporter needs. */ type ReportableDiagnostic = Pick & { readonly entityIds?: readonly string[] | undefined; readonly relationIds?: readonly string[] | undefined; readonly remediation?: string | undefined; }; declare const findingFromDiagnostic: (diagnostic: ReportableDiagnostic) => Finding; /** Every diagnostic as a finding, most severe first and by id within a severity, so output is stable. */ declare const findingsFromDiagnostics: (diagnostics: readonly ReportableDiagnostic[]) => Finding[]; /** * The template engine behind every Markdown rendering. * * Templates are knap templates: knap's parser produces the AST, knap's validators reject an * unknown filter or a malformed tag before anything is rendered, and knap's own filters run on * the values. What is not knap's is the walk over the AST. knap renders asynchronously — its * evaluator awaits at every node so filters and variable resolvers may be promises — and the * index pipeline that writes `llms.txt`, the conformance profile that re-renders it to check * freshness, and the gates that run both are synchronous. Making them asynchronous to render a * template would change the signature of every artifact writer for a property the templates do * not use: the application computes every variable before rendering, and none of them is a * promise. * * So the evaluator below is a synchronous port of knap's, node for node, including its * whitespace rules — a `for` body is trimmed and joined line by line, `-%}` marks a pending trim * that the next text node consumes — and a test renders every bundled template through knap's * real engine as well and asserts byte-identical output. The port exists to keep the pipeline * synchronous, not to diverge from knap; when the pipeline becomes asynchronous, delete it and * call `renderTemplateWithKnap`. */ type TemplateVariables = Record; declare class TemplateError extends Error { readonly line?: number | undefined; readonly column?: number | undefined; constructor(message: string, line?: number | undefined, column?: number | undefined); } type CompiledTemplate = { readonly name: string; readonly source: string; readonly ast: readonly ASTNode[]; }; /** Parse and validate a template. A template that references an unknown filter fails here, not mid-render. */ declare const compileTemplate: (source: string, name?: string) => CompiledTemplate; /** Render a compiled template synchronously. The variables are copied: `{% set %}` never reaches the caller. */ declare const renderCompiledTemplate: (template: CompiledTemplate, variables: TemplateVariables) => string; declare const renderTemplate: (source: string, variables: TemplateVariables, name?: string) => string; /** * The same template through knap's own engine. Tests hold the synchronous evaluator to this; * a caller that can await may use it directly. */ declare const renderTemplateWithKnap: (source: string, variables: TemplateVariables) => Promise; declare const GENERATED_REGION_CLOSE = ""; declare const generatedRegionOpen: (hash: string) => string; /** * The hash of a region body. Line endings are normalised first: an editor that converts a file * to CRLF has not changed what the generator wrote. */ declare const generatedRegionHash: (body: string) => string; /** Wrap a body in markers. The body is stripped of surrounding blank lines so the hash covers exactly the lines between the markers. */ declare const wrapGeneratedRegion: (body: string) => string; type GeneratedRegionRef = { readonly lineStart: number; readonly lineEnd: number; readonly hash?: string | undefined; }; type GeneratedRegionMismatch = { readonly lineStart: number; readonly lineEnd: number; readonly expected: string; readonly actual: string; }; /** * Which regions of a document no longer hash to what their marker claims. * * The regions come from the analyzer, which is the one detector of markers; this only recomputes * the hash of the lines strictly between the opening and closing marker lines. A region whose * marker carries no hash was written by an older generator and cannot be verified, so it is not * reported. */ declare const verifyGeneratedRegions: (content: string, regions: readonly GeneratedRegionRef[]) => GeneratedRegionMismatch[]; /** * The bundled templates. * * They live in a TypeScript module rather than next to it as `.md` files because the package * ships `dist/` built by tsup, which bundles source and nothing else: a template on disk is a * template the published package does not have. `ak-docs render --print-template` prints * one, which is how a project starts an override under `render.templates`. * * knap syntax, with one rule the syntax does not advertise: a block tag whose output is empty * swallows the line break after it, and a block whose output is not empty swallows the line * break at its own start instead. So a list is written as `{% for %}` followed by a standalone * `{% if not … %}` block for its empty state — exactly one of the two renders, exactly one line * break is consumed, and the blank line before the next heading survives either way. A test * renders every template through knap's own engine to keep these shapes honest. */ declare const RENDER_TEMPLATE_NAMES: readonly ["llms.txt", "area", "ownership", "change-digest", "overlay-review"]; type RenderTemplateName = (typeof RENDER_TEMPLATE_NAMES)[number]; type RenderTemplateInfo = { readonly name: RenderTemplateName; readonly description: string; /** What `--data` may point at, in place of the default source. */ readonly data: string; /** Whether the output is one Markdown page per unit rather than a single file. */ readonly multiPage: boolean; /** Whether the output carries generated-region markers. `llms.txt` is a whole-file artifact with its own consumers and carries none. */ readonly generatedRegion: boolean; }; declare const RENDER_TEMPLATES: Readonly>; declare const isRenderTemplateName: (value: string) => value is RenderTemplateName; declare const BUNDLED_TEMPLATES: Readonly>; /** * Which template renders a name: the project's, when `render.templates` names one, otherwise * the bundled one. An override is a file the project owns; it replaces the bundled template * entirely and is compiled against the same engine, so a project changes its house style without * a code change and a template that does not parse fails before anything is written. */ type TemplateSource = { readonly name: RenderTemplateName; readonly source: string; /** `bundled`, or the override path as configured. */ readonly origin: string; }; declare const resolveTemplateSource: (name: RenderTemplateName, config: DocBridgeConfigV1, root?: string) => TemplateSource; declare const renderNamedTemplate: (name: RenderTemplateName, variables: TemplateVariables, config: DocBridgeConfigV1, root?: string) => string; /** * The view models the templates render. * * Every value a template can print is computed here, from the canonical artifacts and nothing * else: the index and its projection, a reconciliation report, two snapshots, an overlay. Lists * are sorted before they reach a template and nothing carries a timestamp, so the same artifacts * render to the same bytes. The templates decide how a value looks; this decides what the values * are, which is the boundary that keeps rendering deterministic and keeps a template from ever * needing to call anything. */ type RenderedPage = { /** Where the page belongs, relative to the output directory. */ readonly path: string; readonly content: string; }; /** * A file name for a unit: `src/query` becomes `src-query.md`, and nothing escapes the output * directory. The ends are trimmed with a loop, because an alternation anchored at the end * backtracks quadratically on a value that is mostly separators. */ declare const pageFileName: (value: string) => string; type RelatedView = { readonly path: string; readonly direction: string; readonly strength: number; readonly evidence: string; }; type AreaPageView = { readonly id: string; readonly path: string; readonly purpose: string; readonly ownership: string; readonly modules: readonly { readonly path: string; readonly symbols: string; }[]; readonly documents: readonly { readonly title: string; readonly path: string; readonly relation: string; }[]; readonly related: readonly RelatedView[]; readonly checks: readonly string[]; readonly checksSource: string; readonly findings: readonly { readonly code: string; readonly severity: string; readonly status: string; readonly message: string; readonly evidence: string; }[]; readonly findingsEmpty: string; }; type AreaPagesOptions = { readonly root?: string; /** The reconciliation report whose diagnostics become "open findings". Without one the page says so. */ readonly reconciliation?: ReconciliationReportV1; }; declare const areaPagesView: (index: DocBridgeIndexV1, config: DocBridgeConfigV1, options?: AreaPagesOptions) => AreaPageView[]; type OwnershipPageView = { readonly id: string; readonly kind: string; readonly path: string; readonly humanDoc: string; readonly purpose: string; readonly startHere: string; readonly readBeforeEditing: readonly string[]; readonly editRoots: readonly string[]; readonly checks: readonly string[]; readonly checksSource: string; readonly related: readonly RelatedView[]; }; declare const ownershipPagesView: (index: DocBridgeIndexV1, config: DocBridgeConfigV1, options?: { readonly root?: string; }) => OwnershipPageView[]; type SnapshotForDigest = Pick; type ChangeDigestView = { readonly summary: string; readonly changed: readonly { readonly id: string; readonly kind: string; readonly path: string; readonly previousHash: string; readonly currentHash: string; }[]; readonly added: readonly { readonly id: string; readonly kind: string; readonly path: string; readonly currentHash: string; }[]; readonly removed: readonly { readonly id: string; readonly kind: string; readonly path: string; readonly previousHash: string; }[]; readonly documentsToReview: readonly { readonly path: string; readonly because: string; }[]; }; declare const changeDigestView: (previous: SnapshotForDigest, current: SnapshotForDigest) => ChangeDigestView; /** * The shape the review page reads from an enrichment overlay. Deliberately loose: the overlay * artifact is defined by the enrichment workstream, and the page needs only what a human needs * to judge a proposal — what it proposes about which entity, why, how sure the agent was, and * where in the repository the evidence is. */ type OverlayReviewInput = { readonly pending?: readonly { readonly proposalId: string; readonly kind: string; readonly entity: string; readonly reason?: string; readonly confidence?: number | string; readonly evidence?: readonly { readonly path: string; readonly lineStart?: number; readonly lineEnd?: number; }[]; }[]; }; type OverlayReviewView = { readonly present: boolean; readonly summary: string; readonly pending: readonly { readonly proposalId: string; readonly kind: string; readonly entity: string; readonly reason: string; readonly confidence: string; readonly evidence: readonly { readonly link: string; }[]; }[]; }; declare const overlayReviewView: (overlay: OverlayReviewInput | undefined, source?: string) => OverlayReviewView; /** * `ak-docs render`: the canonical artifacts, rendered as Markdown a person can read. * * Rendering never calls an agent and never reads the Registry: its inputs are the index (built * in memory from the working tree, or the artifact `--data` names), the workflow's last * reconciliation report and snapshot, and an overlay file. Equal inputs, equal bytes. */ type RenderArtifactOptions = { readonly root: string; readonly config: DocBridgeConfigV1; readonly template: RenderTemplateName; /** An artifact to render instead of the default source for the template. Relative to `root`. */ readonly dataPath?: string; }; type RenderArtifactResult = { readonly template: RenderTemplateName; /** `bundled`, or the project override path. */ readonly origin: string; readonly pages: readonly RenderedPage[]; }; declare const applyGeneratedRegions: (output: string, name: string) => string; declare const renderArtifact: (options: RenderArtifactOptions) => RenderArtifactResult; /** * Write the pages. A single page goes to `target` itself unless `target` is an existing * directory; several pages go under `target` as a directory. Returns what was written, relative * to `root`, in page order. */ declare const writeRenderedPages: (result: RenderArtifactResult, target: string, root: string) => string[]; type LlmsTxtEntry = { readonly title: string; readonly url: string; readonly description?: string; }; type LlmsTxtVariables = { readonly project: string; readonly preamble: string; readonly entries: readonly LlmsTxtEntry[]; }; /** What the `llms.txt` template sees. Exported so a project overriding the template knows the variables. */ declare const llmsTxtVariables: (config: DocBridgeConfigV1, knowledge: readonly KnowledgeEntry[], projectName: string) => LlmsTxtVariables; /** * Deterministic validators: what a proposal must prove before anything stores it. * * The agent is untrusted by design. It may be wrong, it may be inventing, and it may be the * same model on a different day; the only thing that makes its output usable is that every * claim is checked against the artifacts it was given and against the kind's own rules, with no * judgement call anywhere in the path. Every check here has a name in the rejection list, so a * run can be graded — how many proposals were invented, how many collided — and two runs of the * validators over one stored overlay produce one partition. */ /** An alias closer than this to an existing name is a collision, not a synonym. */ declare const ALIAS_COLLISION_THRESHOLD = 0.95; type EnrichmentSnapshot = Pick; type EnrichmentValidationContext = { readonly snapshot: EnrichmentSnapshot; readonly report?: Pick; /** Entries already in the overlay: what a new proposal must not collide with. */ readonly existing?: { readonly accepted?: readonly AcceptedEnrichment[]; readonly pending?: readonly PendingEnrichment[]; }; }; type EnrichmentVerdict = { readonly status: 'accepted'; readonly proposal: EnrichmentProposalV1; } | { readonly status: 'pending'; readonly proposal: EnrichmentProposalV1; readonly note?: PendingEnrichment['note']; } | { readonly status: 'rejected'; readonly rejection: RejectedEnrichment; }; type EnrichmentPartition = { readonly accepted: readonly EnrichmentProposalV1[]; readonly pending: readonly { readonly proposal: EnrichmentProposalV1; readonly note?: PendingEnrichment['note']; }[]; readonly rejected: readonly RejectedEnrichment[]; }; /** * The hash an entry binds to: the entity's file hash when it has one, otherwise a hash of the * entity as recorded — an area has no file, but it still has a content the proposal was about. */ declare const entityContentHash: (entity: KnowledgeEntity) => string; /** * Validate one raw proposal at the boundary. * * Envelope first — kind, schema, evidence, entity, hashes, identity — then the kind's own rule. * A rejection names the first thing that failed; a proposal that fails the envelope never * reaches a kind validator, so a kind validator can assume its entity exists. */ declare const validateEnrichmentProposal: (raw: unknown, context: EnrichmentValidationContext) => EnrichmentVerdict; /** * Validate a batch and partition it. * * Each verdict is made against the context plus what the batch has already decided, in a fixed * order (by proposal id), so two proposals for the same slot resolve the same way every run: the * first survives, the second collides. A proposal already decided in the stored overlay keeps its * decision — an accepted entry is not re-accepted, a pending one not re-requested. */ declare const partitionEnrichmentProposals: (raws: readonly unknown[], context: EnrichmentValidationContext) => EnrichmentPartition; /** * Re-run the validators over a stored overlay. * * Reproducibility is the guardrail: the partition an overlay records must be the partition the * validators produce from its proposals against the same snapshot. Anything else means the * overlay was edited by hand, or the validators changed under it, and either way the file is * not evidence of a decision any more. */ declare const revalidateEnrichmentOverlay: (overlay: { readonly accepted: readonly AcceptedEnrichment[]; readonly pending: readonly PendingEnrichment[]; }, context: Omit) => { readonly accepted: readonly string[]; readonly pending: readonly string[]; readonly rejected: readonly RejectedEnrichment[]; }; type AdjudicationVerdict = { readonly status: 'accepted'; readonly adjudication: EnrichmentAdjudicationV1; } | { readonly status: 'rejected'; readonly reason: EnrichmentRejectionReason; readonly detail?: string; }; /** * Validate an adjudication against the pending entries it claims to judge. * * The one rule that cannot be configured away: an agent may not judge its own proposal. An * adjudication whose origin matches any judged proposal's origin is rejected outright, whatever * the roles say — a different role name over the same identity is still the same agent. */ declare const validateEnrichmentAdjudication: (raw: unknown, pending: readonly PendingEnrichment[]) => AdjudicationVerdict; /** * Apply an adjudication to the pending set: the losers are rejected as `adjudicated`, the * survivors stay pending with their conflict note cleared. Nothing an agent decides becomes * accepted — the winner still waits for the person the kind's policy requires. */ declare const applyEnrichmentAdjudication: (pending: readonly PendingEnrichment[], adjudication: EnrichmentAdjudicationV1) => { readonly pending: PendingEnrichment[]; readonly rejected: RejectedEnrichment[]; }; /** * The overlay on disk, and what the deterministic layer reads from it. * * The file is written by the enrich stage and by an approval; it is never written by a read. * `index`, `search`, `query` and MCP consult it through `projectEnrichmentOverlay`, which is a * pure function of the overlay and the snapshot: an accepted entry whose target hash no longer * matches its entity is expired *in the result*, not in the file, so a stale entry costs nothing * and a read leaves no trace. */ declare const ENRICHMENT_DIR = ".doc-bridge/enrich"; declare const ENRICHMENT_OVERLAY_FILE = "overlay.json"; declare const enrichmentOverlayPath: (root: string) => string; /** * Read the overlay, or nothing. * * Missing, unreadable, malformed or failing its own hash all mean the same thing to a reader: * there is no overlay. Failing closed here is what keeps a corrupt file from changing a `check` * result — a reader that threw would make the deterministic layer depend on the enrichment one. */ declare const readEnrichmentOverlay: (root: string) => EnrichmentOverlayV1 | undefined; /** Parse an overlay from memory with the same rules as a read: schema and hash, or nothing. */ declare const parseEnrichmentOverlay: (value: unknown) => EnrichmentOverlayV1 | undefined; declare const writeEnrichmentOverlay: (root: string, overlay: EnrichmentOverlayV1) => string; /** Seal an overlay: every list sorted, the hash recomputed. The shape every writer goes through. */ declare const sealEnrichmentOverlay: (overlay: Omit) => EnrichmentOverlayV1; type EffectiveOverlay = { /** Accepted entries whose target still has the hash they were made against. */ readonly live: readonly AcceptedEnrichment[]; /** Accepted entries whose target moved: excluded from every projection, left in the file. */ readonly expired: readonly AcceptedEnrichment[]; }; /** * Per-entry staleness. * * An entry binds to the content hash of the entity it describes, not to the snapshot hash, so one * changed file expires one entry and its siblings survive. An entity that no longer exists expires * its entries too: there is nothing left to describe. */ declare const effectiveEnrichment: (overlay: Pick, snapshot: Pick) => EffectiveOverlay; /** The hash of what an overlay contributes: the live accepted set. Empty when nothing is live. */ declare const enrichmentOverlayHash: (live: readonly AcceptedEnrichment[]) => string; /** * What the projection reads from an overlay: aliases, summaries, intents, canonical markers, * rank hints and relations, each already expired against the snapshot. * * Findings (`flag-*`) and area suggestions contribute nothing here on purpose. A gap is a thing to * review, not a fact to rank on; an area suggestion becomes configuration or nothing. */ declare const projectEnrichmentOverlay: (overlay: EnrichmentOverlayV1 | undefined, snapshot: Pick) => RetrievalOverlayInput | undefined; /** * The snapshot plus the live accepted relations, for the graph, the report and the memory view. * * Additive only: every observed entity and relation is carried unchanged, and a proposed relation * whose id collides with an observed one is dropped rather than allowed to shadow it. The * assertion below is what the projection tests run; it is here so any consumer can run it. */ declare const withAcceptedRelations: >(snapshot: T, overlay: EnrichmentOverlayV1 | undefined) => T; /** Every observed entity and relation must be present, unchanged, after enrichment. */ declare const assertObservedSurvive: (observed: Pick, enriched: Pick) => void; /** Accepted entries that are findings rather than facts, for a reviewer or a renderer. */ declare const enrichmentFindings: (overlay: EnrichmentOverlayV1) => readonly AcceptedEnrichment[]; /** * Context packs: what an agent receives instead of the snapshot. * * `ak-docs suggest` sent the whole redacted snapshot — 740 KB on this repository — in one call, * for every question. A pack is one entity, its depth-one neighbours, the open diagnostics that * touch it and a bounded excerpt of its own file, built in a fixed order and truncated in a fixed * order under a byte budget. Cost becomes proportional to what changed, because the pack hash * covers exactly the content hashes the pack is built from, and a pack whose hash has not moved * is a pack the cache already answered. */ declare const CONTEXT_PACK_VERSION: 1; declare const DEFAULT_PACK_BYTES: number; declare const MAX_PACK_NEIGHBOURS = 32; type EnrichmentTask = 'curate' | 'review' | 'adjudicate'; type PackNeighbour = { readonly id: string; readonly kind: string; readonly name: string; readonly path?: string; readonly contentHash: string; readonly relation: string; readonly direction: 'out' | 'in'; }; type PackDiagnostic = Pick & { readonly message: string; }; type PackEvidence = { readonly path: string; readonly contentHash: string; /** Redacted, bounded, possibly truncated — `truncated` says so. */ readonly excerpt: string; readonly truncated: boolean; }; type ContextPack = { readonly type: 'context-pack'; readonly schemaVersion: typeof CONTEXT_PACK_VERSION; /** Over the target's and every neighbour's content hash: the pack's identity for the cache. */ readonly packHash: string; readonly baseSnapshotHash: string; readonly areaId: string; readonly target: { readonly id: string; readonly kind: string; readonly name: string; readonly path?: string; readonly contentHash: string; readonly aliases: readonly string[]; /** The entity's own evidence items: what a proposal about it may cite, verbatim. */ readonly evidence: readonly Pick[]; readonly metadata: Readonly>; }; readonly neighbours: readonly PackNeighbour[]; readonly diagnostics: readonly PackDiagnostic[]; readonly evidence: readonly PackEvidence[]; /** * `bytes` is the serialised size measured with this field at its widest (`maxBytes`), so the * value written is never smaller than the pack it describes and never exceeds the budget. */ readonly budget: { readonly maxBytes: number; readonly bytes: number; readonly dropped: readonly string[]; }; }; type BuildContextPacksOptions = { readonly snapshot: Pick; readonly report?: Pick; readonly config?: DocBridgeConfigV1; /** Which entity kinds to build packs for. Defaults to documents. */ readonly kinds?: readonly string[]; /** Only these entity ids. Unset means every entity of the selected kinds. */ readonly targets?: ReadonlySet; /** File contents by repository-relative path. Defaults to reading under `root`. */ readonly readFile?: (path: string) => string | undefined; readonly root?: string; }; declare const packByteBudget: (config: DocBridgeConfigV1 | undefined) => number; /** * Fit a pack under its budget by dropping in a declared order: excerpt bytes first (halved * until it fits, then dropped), then diagnostics from the end, then neighbours from the end. * The target itself is never dropped — a pack with no target is not a pack. * * This mirrors `compileBudget` from `@agentskit/core` with a byte counter and the * `drop-oldest` strategy over sections ordered least-important-first; a test cross-checks the * two so the mirror cannot drift, and the mirror is what runs, because a pack must be the same * pack whether or not an optional peer is installed. */ declare const fitContextPack: (pack: ContextPack, maxBytes: number) => ContextPack; /** The pack hash: the target and its neighbours by content hash, nothing else. */ declare const contextPackHash: (target: { readonly id: string; readonly contentHash: string; }, neighbours: readonly Pick[]) => string; /** * Build one pack per target entity, in id order. * * Neighbours are the other ends of every relation touching the target, sorted by kind then id * and capped; diagnostics are the open ones naming the target or citing its file; the excerpt is * the target's own file, read only if its bytes still hash to what the snapshot recorded. */ declare const buildContextPacks: (options: BuildContextPacksOptions) => ContextPack[]; /** Packs grouped by area, areas in id order, packs in id order within each: one batch per call. */ declare const batchContextPacks: (packs: readonly ContextPack[]) => readonly { readonly areaId: string; readonly packs: readonly ContextPack[]; }[]; /** * The persistent enrichment cache. * * The old deterministic cache was an in-process `Map`: it saved a second call inside one * process and nothing across two. This one is keyed on everything that could change an answer — * the task, the agent identity and version, the prompt version, and the pack hash, which covers * the target and every neighbour by content hash — and lives under `.doc-bridge/enrich/cache/`, * so an unchanged repository makes zero agent calls and a one-document change re-runs only the * packs whose hash moved. An empty answer is cached like any other: "the agent had nothing to * say about this" is an answer, and asking again costs the same. */ type EnrichmentCacheKeyInput = { readonly task: EnrichmentTask; readonly agentId: string; readonly agentVersion: string; readonly promptVersion: string; readonly packHash: string; }; declare const enrichmentCacheKey: (input: EnrichmentCacheKeyInput) => string; type EnrichmentCache = { readonly read: (input: EnrichmentCacheKeyInput) => readonly unknown[] | undefined; readonly write: (input: EnrichmentCacheKeyInput, proposals: readonly unknown[]) => string; }; /** A file-backed cache under the enrich directory. A read never writes; a corrupt entry is a miss. */ declare const createEnrichmentCache: (root: string) => EnrichmentCache; /** An in-memory cache with the same contract, for callers that must not touch disk. */ declare const createMemoryEnrichmentCache: () => EnrichmentCache; /** * Approvals through the ecosystem gate. * * `createApprovalGate` from `@agentskit/core/hitl` is the contract every AgentsKit surface uses * to pause at a decision point and record what a person decided. Doc Bridge records its * approvals through it — the enrichment overlay's, and `ak-docs fix approve`'s — so the CLI, * MCP and a rendered review page share one record rather than three ways of writing "approved". * * The store is a directory of JSON files, one per approval, because the repository is the only * persistence Doc Bridge has. The gate contract is mirrored here for the same reason every other * ecosystem contract is: `@agentskit/core` is an optional peer, and the real `createApprovalGate` * is used through `importPeer` when it is installed. A test runs both over the same store and * asserts the same records. */ type ApprovalDecision = 'approved' | 'rejected'; type Approval = { id: string; name: string; payload: TPayload; status: 'pending' | ApprovalDecision | 'cancelled'; createdAt: string; decidedAt?: string; decisionMetadata?: Record; }; type ApprovalStore = { put: (approval: Approval) => Promise; get: (id: string) => Promise | null>; patch: (id: string, update: Partial>) => Promise | null>; }; type RequestApprovalInput = { name: string; payload: TPayload; id: string; }; type ApprovalGate = { request: (input: RequestApprovalInput) => Promise>; await: (id: string, options?: { timeoutMs?: number; pollMs?: number; signal?: AbortSignal; }) => Promise>; decide: (id: string, decision: ApprovalDecision, metadata?: Record) => Promise>; cancel: (id: string) => Promise>; }; declare const APPROVALS_DIR = ".doc-bridge/approvals"; declare const ENRICHMENT_APPROVAL_GATE = "doc-bridge.enrichment"; declare const FIX_APPROVAL_GATE = "doc-bridge.fix"; declare const approvalsDir: (root: string) => string; /** The id an enrichment approval binds to: the proposal and the exact content it was made about. */ declare const enrichmentApprovalId: (proposalId: string, targetContentHash: string) => string; /** The id a fix approval binds to: the proposal id and the hash of its exact content. */ declare const fixApprovalId: (proposalId: string, proposalHash: string) => string; declare const createFileApprovalStore: (dir: string) => ApprovalStore; /** Every approval in the store, by id. For a reviewer listing what is waiting. */ declare const listApprovals: (dir: string) => Approval[]; /** The mirror of `createApprovalGate`: create-or-load, poll, patch. */ declare const createApprovalGateMirror: (store: ApprovalStore) => ApprovalGate; /** * The gate over a store: the ecosystem's when the peer is installed, the mirror otherwise. * * Both write the same records to the same files, which is the point — a record written by one * is read by the other, and by any AgentsKit surface that opens the same store. */ declare const loadApprovalGate: (store: ApprovalStore) => Promise<{ readonly gate: ApprovalGate; readonly source: "ecosystem" | "mirror"; }>; type RecordedApproval = { readonly approval: Approval; readonly source: 'ecosystem' | 'mirror'; }; /** * Record a decision a person already made — the shape `ak-docs fix approve` needs: request * (idempotent, so a re-run finds the same record) then decide, in one call. */ declare const recordApproval: (root: string, input: { readonly id: string; readonly name: string; readonly payload: unknown; readonly decision: ApprovalDecision; readonly by: string; readonly reason?: string; }) => Promise; /** * What the overlay cost and whether it can be trusted. * * An enrichment stage that reports only what it accepted is unauditable: an agent that proposes * a hundred things and has ninety rejected looks the same as one that proposes ten good ones. So * the overlay carries the whole shape of the run — per kind, per rejection reason, what it * invented, what it cost — and two numbers that say whether the thing is stable at all. */ /** Rejections that named something the repository does not contain. */ declare const inventedReferenceCount: (rejected: readonly RejectedEnrichment[]) => number; declare const cacheHitRate: (cacheHits: number, agentRuns: number) => number; type EnrichmentStability = { /** * Whether the two runs decided identically. A deterministic agent must reach this; a live model * usually will not, which is why the proposal-identifier share is reported next to it. */ readonly overlayHashIdentical: boolean; readonly previousOverlayHash?: string; readonly overlayHash: string; /** Proposal identifiers present in both runs, over the identifiers of the union. */ readonly proposalIdShare: number; readonly sharedProposalIds: number; readonly proposalIds: number; readonly previousProposalIds: number; }; /** Every proposal identifier an overlay decided on, whatever the decision was. */ declare const overlayProposalIds: (overlay: Pick) => ReadonlySet; /** * Compare this run with the one before it. * * Both halves of the issue's stability requirement fall out of the same comparison: two * deterministic runs over an unchanged repository produce one overlay hash, and two live-model * runs produce a share of identical proposal identifiers. The share is over the union, so a run * that merely proposes fewer things does not score as more stable. */ declare const enrichmentStability: (current: EnrichmentOverlayV1, previous: EnrichmentOverlayV1 | undefined) => EnrichmentStability; /** The cost side of `stats`, as its own object for a reader that only wants the bill. */ declare const enrichmentCost: (stats: EnrichmentStats) => { readonly agentRuns: number; readonly inputBytes: number; readonly outputBytes: number; readonly cacheHits: number; readonly cacheHitRate: number; readonly wallTimeMs: number; }; declare const formatEnrichmentStatsText: (stats: EnrichmentStats, stability: EnrichmentStability) => readonly string[]; /** * The enrich stage: packs out, proposals in, validators between, an overlay at the end. * * It runs only when asked — `ak-docs enrich`, `check --enrich` — and never sits on the path of * `check`, `index`, `search` or `query`. What it writes is advisory until a validator or a person * accepts it, expires with the entity it describes, and adds to the observed graph without ever * subtracting from it. Its cost is proportional to what changed: a pack whose hash has not moved * is answered by the cache, so an unchanged repository makes no agent call at all. */ type EnrichmentRole = 'curator' | 'reviewer' | 'adjudicator'; declare const ROLE_TASK: Readonly>; /** What each role is for. The curator reads documents; the reviewer reads structure. */ declare const ROLE_TARGET_KINDS: Readonly, readonly string[]>>; type ResolvedRole = { readonly role: EnrichmentRole; readonly agentId: string; readonly promptVersion: string; }; /** * Roles from configuration. The default is the configured agent as curator only — the existing * corpus scanner, doing the one job it did before, over packs instead of the snapshot. */ declare const resolveEnrichmentRoles: (config: DocBridgeConfigV1) => readonly ResolvedRole[]; /** The seam the stage calls an agent through. The CLI wires the Registry adapter; a test wires a function. */ type EnrichmentAgent = (input: { readonly role: ResolvedRole; readonly task: EnrichmentTask; readonly packs: readonly ContextPack[]; readonly agentVersion: string; }) => Promise; type EnrichmentRunOptions = { readonly root: string; readonly config: DocBridgeConfigV1; readonly snapshot: DiscoverySnapshotV1; readonly report: ReconciliationReportV1; /** Replaces the Registry adapter. `agentVersion` is what the cache and the origin check use. */ readonly agent?: { readonly call: EnrichmentAgent; readonly version: (role: ResolvedRole) => string; }; readonly cache?: EnrichmentCache; readonly gate?: ApprovalGate; /** File contents by path, for packs. Defaults to reading under `root`. */ readonly readFile?: (path: string) => string | undefined; readonly now?: () => string; /** Monotonic milliseconds, for wall time. A test passes a stub so the figure is deterministic. */ readonly clock?: () => number; /** Persist the overlay under `.doc-bridge/enrich/`. Default true. */ readonly write?: boolean; }; type EnrichmentRunResult = { readonly overlay: EnrichmentOverlayV1; readonly overlayPath?: string; readonly agentCalls: number; readonly cacheHits: number; readonly packs: number; /** Target ids whose packs were sent to an agent this run. */ readonly rerun: readonly string[]; readonly expired: number; readonly roles: readonly ResolvedRole[]; /** This run against the one before it: one hash for a deterministic agent, a share for a live one. */ readonly stability: EnrichmentStability; }; /** * Run enrichment over a snapshot and report. * * 1. Build packs for every role's target kinds; batch by area. * 2. Answer each pack from the cache or from the agent, caching what the agent said per pack — * including nothing, so silence is not asked for twice. * 3. Validate everything through the partition, against the snapshot, the report and the * overlay already on disk; policy kinds are accepted, human kinds requested from the gate. * 4. Adjudicate what two roles could not settle, if a third identity is configured. * 5. Merge with the stored overlay — decisions people made survive while their target does — * seal, write. */ declare const runEnrichment: (options: EnrichmentRunOptions) => Promise; /** A human-readable line per stat, for `--text`. */ declare const formatEnrichmentText: (result: EnrichmentRunResult) => string[]; /** * Reviewing the overlay: what a person does with it. * * Shared by `ak-docs enrich list|approve|reject`, the MCP `docbridge.proposals` tool and a * rendered review page, so there is one way to decide and one record of the decision. A * decision goes through the approval gate first and the overlay second: if the gate refuses — * already decided, unknown — the overlay is untouched. */ type EnrichmentReview = { readonly overlayHash: string; readonly baseSnapshotHash: string; readonly accepted: readonly AcceptedEnrichment[]; readonly pending: readonly PendingEnrichment[]; readonly rejected: readonly RejectedEnrichment[]; readonly stats: EnrichmentOverlayV1['stats']; }; declare const listEnrichment: (root: string) => EnrichmentReview | undefined; type DecideEnrichmentOptions = { readonly root: string; readonly proposalId: string; readonly decision: 'approved' | 'rejected'; /** Who decided. Must not be the proposal's author, and must not be `policy`. */ readonly by: string; readonly reason?: string; /** When given, the proposal must still describe the entity as it is now. */ readonly snapshot?: Pick; readonly gate?: ApprovalGate; readonly now?: () => string; }; type DecideEnrichmentResult = { readonly overlay: EnrichmentOverlayV1; readonly approvalId: string; readonly entry: AcceptedEnrichment | RejectedEnrichment; readonly gateSource: 'ecosystem' | 'mirror' | 'supplied'; }; /** * Approve or reject one pending proposal. * * Binding is to both the proposal id and the target content hash: the approval record's id is * their hash, so an approval given for one version of a document cannot be replayed against the * next one. A person approving their own agent's output is refused by identity, and `policy` is * not a person. */ declare const decideEnrichment: (options: DecideEnrichmentOptions) => Promise; /** * Does the overlay earn its cost? * * An enrichment stage that nobody measures is a stage nobody can defend. The question is narrow * and answerable: run the golden suite twice over the same snapshot — once with the accepted * overlay projected, once without it — and report the difference. Everything else about the * agent is opinion; this is the number. * * The rule is asymmetric on purpose. An overlay may leave retrieval unchanged, and it may improve * it, but it must not lower hit@3: aliases and summaries an agent proposed are supposed to help * an agent find things. A drop is reported as a regression of the overlay, never as a new * baseline — it is a finding about the agent, not about the benchmark. */ /** The metrics compared, in the order a reader wants them. */ declare const OVERLAY_DELTA_METRICS: readonly ["hitAt1", "hitAt3", "meanReciprocalRank", "meanContextBytes", "meanApproxTokens", "zeroResultRate"]; /** The one metric an overlay is not allowed to lower. */ declare const OVERLAY_BLOCKING_METRIC: keyof RetrievalMetrics; type OverlayMetricDelta = { readonly metric: (typeof OVERLAY_DELTA_METRICS)[number]; readonly withoutOverlay: number; readonly withOverlay: number; readonly delta: number; readonly improved: boolean; readonly worsened: boolean; }; type OverlayRetrievalDelta = { readonly status: 'improved' | 'unchanged' | 'regressed'; /** True when the overlay lowered hit@3. The caller fails the run on this. */ readonly regression: boolean; readonly overlayHash: string; readonly suite: { readonly name: string; readonly caseCount: number; readonly contentHash: string; }; readonly withoutOverlay: RetrievalMetrics; readonly withOverlay: RetrievalMetrics; readonly deltas: readonly OverlayMetricDelta[]; /** Case ids the overlay lost, and gained, at hit@3 — what a regression is actually made of. */ readonly lostCases: readonly string[]; readonly gainedCases: readonly string[]; readonly messages: readonly string[]; }; type MeasureOverlayRetrievalDeltaOptions = { readonly root: string; readonly config: DocBridgeConfigV1; readonly snapshot: DiscoverySnapshotV1; readonly overlay: EnrichmentOverlayV1; readonly suite: RetrievalSuite; readonly limit?: number; }; /** * Measure the suite with and without the overlay. * * Both indexes are built from the one snapshot the caller passes, so the only difference between * the two runs is the overlay — not a re-scan, not a different revision, not a different * configuration. */ declare const measureOverlayRetrievalDelta: (options: MeasureOverlayRetrievalDeltaOptions) => OverlayRetrievalDelta; declare const formatOverlayRetrievalDeltaText: (delta: OverlayRetrievalDelta) => readonly string[]; /** * The mechanical half of a study task, and why it lives in two files. * * The last controlled round recorded zero semantic successes in both arms, which means it could * not tell a working retrieval layer from a broken one. The cause was structural: a task whose * only success criterion is a model's opinion produces no signal. The fix is to state what * retrieval is expected to return and check it — with `ak-docs bench retrieval`, deterministically. * * The expectations are split across two artifacts on purpose. The task suite is * publication-bound, so it may only carry opaque references (`primary-entrypoint`), never a path. * This file is the local resolution — references to concrete entity ids and document paths for a * repository on the operator's disk — and it must never be published. Putting it under * `docs/study/` would fail the privacy gate, which is the intended outcome rather than a bug. */ declare const STUDY_EXPECTATIONS_SCHEMA_VERSION: 1; declare const StudyExpectationsV1Schema: z.ZodObject<{ type: z.ZodLiteral<"controlled-study-expectations">; schemaVersion: z.ZodLiteral<1>; configVersion: z.ZodString; scope: z.ZodLiteral<"local">; taskSuiteHash: z.ZodString; repositories: z.ZodArray>; }, z.core.$strict>>; contentHash: z.ZodString; contentHashAlgo: z.ZodLiteral<"sha256-normalized-v1">; }, z.core.$strict>; type StudyExpectationsV1 = z.infer; declare const createStudyExpectations: (input: unknown) => StudyExpectationsV1; declare const parseStudyExpectations: (input: unknown) => StudyExpectationsV1; /** A reference a task expects that the local file does not resolve. Reported, never ignored. */ type UnresolvedExpectation = { readonly taskId: string; readonly repositoryId: string; readonly reference: string; readonly kind: 'entity' | 'document'; }; type StudyRetrievalSuite = { readonly suite: RetrievalSuite; readonly unresolved: readonly UnresolvedExpectation[]; /** Task ids that declare no expectations, so nothing about them is checked here. */ readonly withoutExpectations: readonly string[]; }; type StudyRetrievalSuiteOptions = { readonly taskSuite: StudyTaskSuiteV1; readonly expectations: StudyExpectationsV1; /** Check one repository instead of every one the expectations resolve. */ readonly repositoryId?: string; }; /** * Turn the study's expectations into a retrieval suite. * * One case per task query, whose expected targets are the resolved references. The result is an * ordinary Open Eval Format suite, so the same command, the same ranking and the same metrics * that gate this repository's retrieval also answer the study's mechanical questions — rather * than a second, study-shaped checker nobody else exercises. */ declare const studyRetrievalSuite: (options: StudyRetrievalSuiteOptions) => StudyRetrievalSuite; type StudyExpectationOutcome = { readonly taskId: string; readonly repositoryId: string; readonly caseId: string; readonly hit: boolean; readonly rank: number | null; readonly expectedTargets: readonly string[]; readonly rankedTargets: readonly string[]; }; type StudyExpectationCheck = { /** True when every case hit and every reference resolved: the mechanical verdict, with no model. */ readonly ok: boolean; readonly checkedTasks: number; readonly withoutExpectations: readonly string[]; readonly unresolved: readonly UnresolvedExpectation[]; readonly outcomes: readonly StudyExpectationOutcome[]; readonly result?: RetrievalBenchResultV1; }; type CheckStudyExpectationsOptions = StudyRetrievalSuiteOptions & { readonly index: DocBridgeIndexV1; readonly limit?: number; }; /** * Run the study's mechanical expectations through the retrieval benchmark. * * A task with no expectations is reported as unchecked rather than counted as a pass, and an * unresolved reference fails the check: an expectation nobody resolved is an expectation nobody * tested, and calling that a success is exactly the failure this replaces. */ declare const checkStudyExpectations: (options: CheckStudyExpectationsOptions) => StudyExpectationCheck; declare const formatStudyExpectationsText: (check: StudyExpectationCheck) => readonly string[]; /** * What this repository says in public, and where the truth lives. * * Documentation drifts silently. The four study figures in `README.md` also appear in * `docs/study/README.md`, and both are only as current as the artifacts under `docs/study/`: an * edit to one of the three would leave the other two stating a number the repository has moved * past, and nothing compared them, because nothing said which repository fact each public * sentence was standing in for. (A sample that declares itself illustrative — the doctor block in * `README.md` says so in as many words — is not a claim, and the registry does not name it.) * * A claim names that fact. It declares where the canonical value comes from (`evidence`), how the * claim appears in prose (`template`), and which public surfaces are expected to carry it. The * checker resolves the value, finds the occurrences, and reports the difference — so a stale * sentence is a finding with a file, a line and a remediation rather than something a reader * happens to notice. */ declare const PUBLIC_CLAIMS_SCHEMA_VERSION: 1; declare const PUBLIC_CLAIMS_CONTENT_HASH_ALGO: "sha256-normalized-v1"; declare const CLAIM_VALUE_TYPES: readonly ["number", "percent", "semver", "text"]; type ClaimValueType = (typeof CLAIM_VALUE_TYPES)[number]; declare const CLAIM_TRANSFORMS: readonly ["identity", "round", "percent-1dp", "percent-0dp", "negative-percent-2dp", "negative-seconds-2dp"]; type ClaimTransform = (typeof CLAIM_TRANSFORMS)[number]; /** * Where a canonical value comes from. Every kind is deterministic and local: a field in a committed * file, a count over the snapshot this run produced, a figure the doctor measured, or the existence * of a CLI command. Nothing here reaches the network, and nothing asks a model. */ declare const EvidenceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"package-field">; field: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"artifact-field">; path: z.ZodString; field: z.ZodString; transform: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"artifact-sum">; path: z.ZodString; arrayField: z.ZodString; field: z.ZodString; transform: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"snapshot-count">; entityKind: z.ZodEnum<{ module: "module"; area: "area"; package: "package"; document: "document"; }>; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"doctor-metric">; metric: z.ZodEnum<{ score: "score"; grade: "grade"; "agent-docs-indexed": "agent-docs-indexed"; "agent-docs-total": "agent-docs-total"; "reachability-pct": "reachability-pct"; "connectivity-pct": "connectivity-pct"; "benchmark-hit-at-3-pct": "benchmark-hit-at-3-pct"; }>; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"cli-command">; command: z.ZodString; }, z.core.$strict>], "kind">; type ClaimEvidence = z.infer; declare const ClaimSchema: z.ZodObject<{ claimId: z.ZodString; statement: z.ZodString; owner: z.ZodString; valueType: z.ZodEnum<{ number: "number"; text: "text"; percent: "percent"; semver: "semver"; }>; template: z.ZodOptional; evidence: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"package-field">; field: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"artifact-field">; path: z.ZodString; field: z.ZodString; transform: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"artifact-sum">; path: z.ZodString; arrayField: z.ZodString; field: z.ZodString; transform: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"snapshot-count">; entityKind: z.ZodEnum<{ module: "module"; area: "area"; package: "package"; document: "document"; }>; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"doctor-metric">; metric: z.ZodEnum<{ score: "score"; grade: "grade"; "agent-docs-indexed": "agent-docs-indexed"; "agent-docs-total": "agent-docs-total"; "reachability-pct": "reachability-pct"; "connectivity-pct": "connectivity-pct"; "benchmark-hit-at-3-pct": "benchmark-hit-at-3-pct"; }>; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"cli-command">; command: z.ZodString; }, z.core.$strict>], "kind">; templates: z.ZodOptional>; required: z.ZodArray; optional: z.ZodOptional>; severity: z.ZodEnum<{ error: "error"; warn: "warn"; }>; remediation: z.ZodString; }, z.core.$strict>; type PublicClaim = z.infer; /** A finding a maintainer decided to accept. The reason is mandatory: silence is what drift needs. */ declare const ExceptionSchema: z.ZodObject<{ claimId: z.ZodString; surface: z.ZodString; reason: z.ZodString; acceptedBy: z.ZodString; }, z.core.$strict>; type PublicClaimException = z.infer; declare const PublicClaimsV1Schema: z.ZodObject<{ type: z.ZodLiteral<"public-claims">; schemaVersion: z.ZodLiteral<1>; registryVersion: z.ZodString; claims: z.ZodArray; template: z.ZodOptional; evidence: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"package-field">; field: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"artifact-field">; path: z.ZodString; field: z.ZodString; transform: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"artifact-sum">; path: z.ZodString; arrayField: z.ZodString; field: z.ZodString; transform: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"snapshot-count">; entityKind: z.ZodEnum<{ module: "module"; area: "area"; package: "package"; document: "document"; }>; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"doctor-metric">; metric: z.ZodEnum<{ score: "score"; grade: "grade"; "agent-docs-indexed": "agent-docs-indexed"; "agent-docs-total": "agent-docs-total"; "reachability-pct": "reachability-pct"; "connectivity-pct": "connectivity-pct"; "benchmark-hit-at-3-pct": "benchmark-hit-at-3-pct"; }>; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"cli-command">; command: z.ZodString; }, z.core.$strict>], "kind">; templates: z.ZodOptional>; required: z.ZodArray; optional: z.ZodOptional>; severity: z.ZodEnum<{ error: "error"; warn: "warn"; }>; remediation: z.ZodString; }, z.core.$strict>>; exceptions: z.ZodArray>; contentHash: z.ZodString; contentHashAlgo: z.ZodLiteral<"sha256-normalized-v1">; }, z.core.$strict>; type PublicClaimsV1 = z.infer; declare const createPublicClaims: (input: unknown) => PublicClaimsV1; declare const parsePublicClaims: (input: unknown) => PublicClaimsV1; /** Every surface the registry addresses, in a stable order. */ declare const claimSurfaces: (registry: PublicClaimsV1) => readonly string[]; declare const exceptionFor: (registry: PublicClaimsV1, claimId: string, surface: string) => PublicClaimException | undefined; /** The wording a surface is expected to use: its own, or the claim's default. */ declare const templateFor: (claim: PublicClaim, surface: string) => string; declare const claimPattern: (claim: PublicClaim, surface?: string) => RegExp; /** What the claim reads like once the canonical value is in it: the sentence a surface should carry. */ declare const renderClaim: (claim: PublicClaim, value: string, surface?: string) => string; /** * Resolving the canonical value, and what to do when it cannot be resolved. * * A resolver reads one repository fact: a field in a committed file, a count over the snapshot this * run produced, a figure the doctor measured, or whether a CLI command exists. When a resolver * cannot answer — the artifact is absent, the field is missing, the doctor was not run — the claim * is reported `not-analyzed`. It is never reported as a match: a claim nobody could check is not a * claim anybody verified, and quietly passing it is how a parity report becomes decoration. */ type ResolvedClaim = { readonly status: 'resolved'; readonly value: string; } | { readonly status: 'not-analyzed'; readonly reason: string; }; type ResolveContext = { readonly root: string; readonly config: DocBridgeConfigV1; /** The snapshot this run produced. Absent when the caller could not build one. */ readonly snapshot?: DiscoverySnapshotV1; /** The doctor's report. Absent unless the caller measured it; a doctor claim is then unchecked. */ readonly doctor?: DoctorReport; }; declare const resolveClaim: (claim: PublicClaim, context: ResolveContext) => ResolvedClaim; /** * Compare what this repository says in public with what it can prove. * * The four outcomes are kept apart on purpose, because they need different actions. `stale` means a * surface states a value the repository has moved past — someone edits one line. `missing` means a * surface that promised to carry the claim does not. `contradiction` means two public surfaces * disagree with each other, which is the one an agent cannot resolve on its own and the reason this * check exists. `not-analyzed` means the claim could not be resolved at all: reported, never * counted as a pass. * * The report is publication-safe by construction. It carries claim ids, repository-relative surface * paths, line numbers, the two values, and a bounded excerpt with secrets redacted — never a * document's contents, never an absolute path. */ declare const PUBLIC_PARITY_SCHEMA_VERSION: 1; declare const PARITY_EXCERPT_LIMIT = 160; declare const PARITY_CODES: readonly ["PARITY_STALE", "PARITY_MISSING", "PARITY_CONTRADICTION", "PARITY_NOT_ANALYZED"]; type ParityCode = (typeof PARITY_CODES)[number]; declare const ParityFindingSchema: z.ZodObject<{ id: z.ZodString; code: z.ZodEnum<{ PARITY_STALE: "PARITY_STALE"; PARITY_MISSING: "PARITY_MISSING"; PARITY_CONTRADICTION: "PARITY_CONTRADICTION"; PARITY_NOT_ANALYZED: "PARITY_NOT_ANALYZED"; }>; claimId: z.ZodString; owner: z.ZodString; severity: z.ZodEnum<{ error: "error"; info: "info"; warn: "warn"; }>; blocking: z.ZodBoolean; surface: z.ZodOptional; line: z.ZodOptional; stated: z.ZodOptional; canonical: z.ZodOptional; message: z.ZodString; remediation: z.ZodString; excerpt: z.ZodOptional; acceptedReason: z.ZodOptional; }, z.core.$strict>; type ParityFinding = z.infer; declare const PublicParityReportV1Schema: z.ZodObject<{ type: z.ZodLiteral<"public-parity-report">; schemaVersion: z.ZodLiteral<1>; contentHash: z.ZodString; contentHashAlgo: z.ZodLiteral<"sha256-normalized-v1">; project: z.ZodObject<{ name: z.ZodString; }, z.core.$strict>; sourceRevision: z.ZodString; sourceRevisionKind: z.ZodEnum<{ git: "git"; content: "content"; }>; registryVersion: z.ZodString; registryHash: z.ZodString; status: z.ZodEnum<{ pass: "pass"; "needs-review": "needs-review"; blocked: "blocked"; }>; metrics: z.ZodObject<{ claims: z.ZodNumber; surfaces: z.ZodNumber; matched: z.ZodNumber; stale: z.ZodNumber; missing: z.ZodNumber; contradictions: z.ZodNumber; notAnalyzed: z.ZodNumber; accepted: z.ZodNumber; blocking: z.ZodNumber; }, z.core.$strict>; findings: z.ZodArray; claimId: z.ZodString; owner: z.ZodString; severity: z.ZodEnum<{ error: "error"; info: "info"; warn: "warn"; }>; blocking: z.ZodBoolean; surface: z.ZodOptional; line: z.ZodOptional; stated: z.ZodOptional; canonical: z.ZodOptional; message: z.ZodString; remediation: z.ZodString; excerpt: z.ZodOptional; acceptedReason: z.ZodOptional; }, z.core.$strict>>; missingSurfaces: z.ZodArray; limitations: z.ZodArray; }, z.core.$strict>; type PublicParityReportV1 = z.infer; type CheckParityOptions = ResolveContext & { readonly registry: PublicClaimsV1; readonly project: { readonly name: string; }; readonly sourceRevision: string; readonly sourceRevisionKind: 'git' | 'content'; /** File contents by surface path. Defaults to reading under `root`. */ readonly readSurface?: (path: string) => string | undefined; }; declare const checkPublicParity: (options: CheckParityOptions) => PublicParityReportV1; declare const parsePublicParityReport: (input: unknown) => PublicParityReportV1; declare const formatPublicParityText: (report: PublicParityReportV1) => readonly string[]; export { ACCEPTED_SIGNALS_SHARE, ACCEPTED_SIGNALS_WEIGHT, ALIAS_COLLISION_THRESHOLD, ALIAS_MAX, ANALYZER_PLUGIN_CONTRACT_VERSION, APPROVALS_DIR, AREA_ANALYZER_VERSION, ASSISTED_SCENARIO, type AcceptedEnrichment, AcceptedEnrichmentSchema, AffectedFileSchema, type AgentEfficiencyObservation, AgentHandoffLegacySchema, type AgentHandoffV1, AgentHandoffV1JsonSchema, AgentHandoffV1Schema, type AgentProposalV1, AgentProposalV1Schema, type AgentQueryMode, AgentQueryModeSchema, type AgentSearchV1, AgentSearchV1Schema, type AgentTaskEfficiencyObservation, type AnalyzerPlugin, type AnalyzerPluginInput, type AnalyzerPluginManifest, AnalyzerPluginManifestSchema, type AnalyzerPluginOutput, AnalyzerPluginOutputSchema, type AnalyzerRegistry, type Approval, type ApprovalDecision, type ApprovalGate, type ApprovalStore, type AreaModule, type AreaOwnership, type AreaPageView, type AreaSuggestion, type AssistedArmStatus, type Audience, AudienceSchema, BENCHMARK_SCHEMA_VERSION, BM25_VERSION, BUDGET_SECTION_ORDER, BUNDLED_TEMPLATES, type BenchmarkFixtureV1, BenchmarkFixtureV1Schema, type BenchmarkObservation, type BenchmarkResult, type BenchmarkSetMetrics, type BenchmarkSnapshot, type BenchmarkSnapshotDiff, type Bm25FieldWeights, type Bm25Hit, type Bm25Index, type Bm25Input, type Bm25Params, type BudgetMessage, type BudgetReport, BudgetReportSchema, type BudgetSection, BudgetSectionSchema, type BudgetTokenCounter, type BudgetedSection, type BuildContextPacksOptions, type BuildGraphOptions, type BuildIndexOptions, type BuildIndexResult, CLAIM_TRANSFORMS, CLAIM_VALUE_TYPES, CONFIG_EXTENSIONS, CONTEXT_PACK_VERSION, CORPUS_PROJECTION_VERSION, type ChangeDigestView, type CheckParityOptions, type CheckStudyExpectationsOptions, type ClaimEvidence, type ClaimTransform, type ClaimValueType, type CompareRetrievalBaselineOptions, type CompileBudgetInput, type CompileBudgetResult, type CompiledTemplate, type Confidence, ConfidenceSchema, type ContextPack, type ControlledCommandRequest, type ControlledStudyObservationLedgerV1, ControlledStudyObservationLedgerV1Schema, type ControlledStudyObservationV1, ControlledStudyObservationV1Schema, type ControlledStudyRunOptions, type ControlledStudyRunPlanV1, ControlledStudyRunPlanV1Schema, type ControlledStudyRunSummary, type ControlledStudyVerifiedResultV1, ControlledStudyVerifiedResultV1Schema, type CorrelationContextV1, CorrelationContextV1Schema, CoverageSchema, type CreateRetrievalBaselineOptions, type CuratedDocument, DEFAULT_AREA_DEPTH, DEFAULT_AREA_ROOTS, DEFAULT_COMMUNITY_SEED, DEFAULT_LARGE_REPORT_THRESHOLD_BYTES, DEFAULT_PACK_BYTES, DEFAULT_PROXIMITY_DEPTH, DEFAULT_REGISTRY_AGENT_ID, DEFAULT_SAFETY_EXCLUDES, DEFAULT_SEARCH_PARAMS, DEFAULT_SEARCH_WEIGHTS, DOCUMENTATION_AUDIT_SCHEMA_VERSION, DOCUMENTATION_EDGE_KINDS, DOCUMENTATION_STANDARD_V1_ID, DOCUMENTATION_STANDARD_V1_STATUS, DOCUMENT_BODY_LIMIT, DOCUMENT_EXTENSIONS, DOC_BRIDGE_PATTERN_ID, DOC_BRIDGE_PATTERN_META, type DecideEnrichmentOptions, type DecideEnrichmentResult, type DeriveAreasOptions, type DerivedArea, type DiagnosticSeverity, DiagnosticSeveritySchema, type DiscoveryOptions, type DiscoverySnapshotV1, DiscoverySnapshotV1Schema, DocBridgeConfigV1, type DocBridgeIndexV1, DocBridgeIndexV1JsonSchema, DocBridgeIndexV1Schema, DocBridgeJsonSchemas, type DocBridgeRetrievedChunk, type DocBridgeRetriever, type DocBridgeRetrieverOptions, type DoctorBadgeMetrics, type DoctorCoverage, type DoctorIssue, type DoctorReport, type DocumentationAnalysisResult, DocumentationAuditConfig, type DocumentationAuditDocument, DocumentationAuditDocumentSchema, type DocumentationAuditFinding, DocumentationAuditFindingSchema, type DocumentationAuditOptions, type DocumentationAuditReportV1, DocumentationAuditReportV1Schema, type DocumentationConformanceReportV1, type DocumentationDeclarationInput, type DocumentationDeclarationOptions, type DocumentationDeclarationResult, type DocumentationDiagnostic, type DocumentationStandardEvidence, type DocumentationStandardRemediation, DocumentationStandardRuleId, type DocumentationStandardRuleLevel, type DocumentationStandardRuleResult, type DocumentationStandardRuleStatus, EMPTY_OVERLAY_HASH, ENRICHMENT_APPROVAL_GATE, ENRICHMENT_DIR, ENRICHMENT_KINDS, ENRICHMENT_OVERLAY_FILE, ENRICHMENT_POLICY, ENRICHMENT_REJECTION_REASONS, ENRICHMENT_SCHEMA_VERSION, EVAL_FORMAT_VERSION, type EcosystemLlmsProduct, type EffectiveOverlay, type EnrichmentAdjudicationV1, EnrichmentAdjudicationV1Schema, type EnrichmentAgent, type EnrichmentCache, type EnrichmentCacheKeyInput, type EnrichmentKind, type EnrichmentOrigin, EnrichmentOriginSchema, type EnrichmentOverlayV1, EnrichmentOverlayV1Schema, type EnrichmentPartition, type EnrichmentPayloads, type EnrichmentPolicy, type EnrichmentProposalOf, type EnrichmentProposalV1, EnrichmentProposalV1Schema, type EnrichmentRejectionReason, type EnrichmentReview, type EnrichmentRole, type EnrichmentRunOptions, type EnrichmentRunResult, type EnrichmentStability, type EnrichmentStats, type EnrichmentTask, type EnrichmentValidationContext, type EnrichmentVerdict, EntitySchema, type Evidence, EvidenceSchema$1 as EvidenceSchema, EvidenceSourceSchema, FILE_BACKED_KINDS, FIX_APPROVAL_GATE, FUZZY_RESOLUTION_THRESHOLD, type FederatedRetrieverOptions, type FetchText, type Finding, type FindingStatus, FindingStatusSchema, type FixApplyOptions, type FixChange, FixChangeSchema, type FixProposalOptions, FixProposalStatusSchema, type FixProposalV1, FixProposalV1Schema, type FormatEcosystemLlmsBlockOptions, type FuzzyMatch, GENERATED_REGION_CLOSE, GRAPH_ANALYZER_VERSION, type GateId, type GateResult, type GateRunResult, type GeneratedRegionMismatch, type GeneratedRegionRef, type GithubPrOptions, type GithubPrResult, type GraphEdge, type GraphMemory, type GraphNode, type GraphQuery, type GraphSignal, HANDOFF_SCHEMA_VERSION, type HandoffBridge, HandoffBridgeSchema, type HandoffOptions, type HandoffTarget, type HandoffTargetType, HandoffTargetTypeSchema, type HistoricalEvidenceRecordV1, HistoricalEvidenceRecordV1Schema, type HistoricalEvidenceRegistryV1, HistoricalEvidenceRegistryV1Schema, type HumanDocMap, type HumanDocRecord, IMPORT_EDGE_KINDS, INDEX_SCHEMA_VERSION, INTENT_MAX, INVENTED_RELATION_REASONS, type IgnoredIndexEntry, type ImportCycle, type IndependentStudyAdjudicationOptions, IndexNotFoundError, type IndexReproducibility, IndexStaleError, KNOWLEDGE_CONTENT_HASH_ALGO, KNOWLEDGE_SCHEMA_VERSION, KNOWLEDGE_TOOLS_SCHEMA_VERSION, type KnowledgeArtifactV1, type KnowledgeDiagnostic, type KnowledgeDocumentRef, type KnowledgeEntity, type KnowledgeEntry, KnowledgeEntrySchema, type KnowledgeEvidence, type KnowledgeLookupEntity, type KnowledgeLookupOptions, type KnowledgeLookupRequest, type KnowledgeLookupResponse, type KnowledgeNeighbour, type KnowledgeOverlay, type KnowledgeRelation, type KnowledgeSearchRequest, type KnowledgeSearchResponse, type KnowledgeSearchResult, type LlmsTxtEntry, type LlmsTxtVariables, MARKDOWN_ANALYZER_VERSION, MARKDOWN_RELATION_CAP, MAX_LOOKUP_DEPTH, MAX_PACK_NEIGHBOURS, MAX_REPORTED_CYCLES, MCP_TOOLS, MEMORY_CANDIDATE_SCHEMA_VERSION, type MarkdownAnalysis, type MarkdownDocumentV1, type MarkdownFrontmatter, type MarkdownGeneratedRegion, type MarkdownHeading, type MarkdownNote, type MarkdownReference, type MarkdownResolution, type McpInstallResult, type McpInstallTarget, type MeasureOverlayRetrievalDeltaOptions, type MemoryCandidateV1, MemoryCandidateV1JsonSchema, MemoryCandidateV1Schema, type MemoryClassification, type MemoryPromotionDraft, type MemoryRoute, OVERLAY_BLOCKING_METRIC, OVERLAY_DELTA_METRICS, type OfflineReportArtifact, type OfflineReportInput, type OfflineReportOptions, type OverlayMetricDelta, type OverlayRetrievalDelta, type OverlayReviewInput, type OverlayReviewView, type OwnershipPageView, PACKAGE_VERSION, PARITY_CODES, PARITY_EXCERPT_LIMIT, PROJECTED_ENTRY_TYPES, PROPOSABLE_RELATION_KINDS, PROXIMITY_EDGE_KINDS, PUBLIC_CLAIMS_CONTENT_HASH_ALGO, PUBLIC_CLAIMS_SCHEMA_VERSION, PUBLIC_PARITY_SCHEMA_VERSION, type ParityCode, type ParityFinding, type ParseIssue, type ParseResult, PeerMissingError, type PendingEnrichment, PendingEnrichmentSchema, type PriorFile, type PriorSnapshot, ProjectIdentitySchema, type ProjectRetrievalOptions, ProposalOriginSchema, type Provenance, ProvenanceSchema, type ProviderToolTelemetry, type ProximityOptions, type PublicClaim, type PublicClaimException, type PublicClaimsV1, PublicClaimsV1Schema, type PublicParityReportV1, PublicParityReportV1Schema, type QualityScorecard, type QualityScorecardInput, type QueryKind, type QueryRequest, type QueryResult, REGISTRY_AGENT_PROTOCOL_V2, RELEVANCE_FLOOR, RENDER_TEMPLATES, RENDER_TEMPLATE_NAMES, RETRIEVAL_BENCH_SCHEMA_VERSION, RETRIEVAL_INDEX_SCHEMA_VERSION, RETRIEVAL_PROJECTION_VERSION, ROLE_TARGET_KINDS, ROLE_TASK, RUBRIC_MECHANICAL_CHECKS, type RankExplanation, type RankOptions, type RankedEntry, type ReconciliationReportV1, ReconciliationReportV1Schema, type RegistryAgentAdapter, type RegistryAgentContext, type RegistryAgentMetadata, type RegistryAgentRunner, type RegistryEnrichmentContext, type RejectedEnrichment, RejectedEnrichmentSchema, RelationSchema, type RenderArtifactOptions, type RenderArtifactResult, type RenderTemplateInfo, type RenderTemplateName, type RenderedPage, type ReportableDiagnostic, type RepositoryInputs, RepositoryInputsSchema, type RepositoryInputsV1, type ResolveContext, type ResolvedClaim, type ResolvedRole, type RetrievalBaselineV1, RetrievalBaselineV1Schema, type RetrievalBenchResultV1, RetrievalBenchResultV1Schema, type RetrievalCaseOutcome, type RetrievalComparison, type RetrievalComparisonStatus, type RetrievalEdge, type RetrievalEntry, RetrievalEntrySchema, type RetrievalFields, type RetrievalGraph, type RetrievalIndexV1, RetrievalIndexV1Schema, type RetrievalKind, RetrievalKindSchema, type RetrievalMetadata, RetrievalMetadataSchema, type RetrievalMetricDelta, type RetrievalMetrics, type RetrievalOverlayInput, type RetrievalRoutes, type RetrievalSuite, type RetrievalSuiteCase, RetrievalSuiteCaseSchema, RetrievalSuiteSchema, type RetrievedDocument, type Retriever, type RetrieverRequest, type ReuseLedger, type RubricItem, type RubricMechanicalCheck, type RuleEngineOptions, type RuleEvaluationResult, type RuleFinding, RuleId, type RuleMode, RuleSeverity, RulesConfig, type RunRetrievalBenchOptions, SEARCH_LEXICON_VERSION, SEARCH_STOPWORDS, SEVERITY_ORDER, SOURCE_EXTENSIONS, STUDY_ADJUDICATION_METHOD, STUDY_EXPECTATIONS_SCHEMA_VERSION, STUDY_METRICS_SCHEMA_VERSION, STUDY_PROTOCOL_CONTENT_HASH_ALGO, STUDY_PROTOCOL_SCHEMA_VERSION, STUDY_PROVIDER_CLI_CONTENT_HASH_ALGO, STUDY_PROVIDER_CLI_SCHEMA_VERSION, STUDY_REPOSITORY_CONFIG_CONTENT_HASH_ALGO, STUDY_REPOSITORY_CONFIG_SCHEMA_VERSION, STUDY_RUNNER_CONTENT_HASH_ALGO, STUDY_RUNNER_SCHEMA_VERSION, STUDY_TASK_SUITE_CONTENT_HASH_ALGO, STUDY_TASK_SUITE_SCHEMA_VERSION, STUDY_VERIFICATION_CONTENT_HASH_ALGO, STUDY_VERIFICATION_SCHEMA_VERSION, SUMMARY_MAX, type SafeWalkOptions, type SafeWalkResult, type SafetyFinding, type ScoreComponents, type ScorecardCriterion, type ScorecardDimension, type ScorecardStatus, type SearchMatch, type SearchOptions, type SearchTokenizeOptions, type Severity, type SnapshotForDigest, type StudyAdjudicatorCli, type StudyExpectationCheck, type StudyExpectationOutcome, type StudyExpectationsV1, StudyExpectationsV1Schema, type StudyMetricComparisonV1, type StudyMetricGroupV1, type StudyMetricSetV1, type StudyMetricsReportV1, StudyMetricsReportV1Schema, type StudyPrivacyScan, type StudyProtocolV1, StudyProtocolV1Schema, type StudyProviderCli, type StudyProviderCliConfigV1, StudyProviderCliConfigV1Schema, type StudyProviderCostPricing, type StudyRepositoryConfigV1, StudyRepositoryConfigV1Schema, type StudyRetrievalSuite, type StudyTaskSuiteV1, StudyTaskSuiteV1Schema, type StudyTaskV1, type StudyVerificationBindingV1, StudyVerificationBindingV1Schema, TOKEN_METHOD, type TaskEvaluation, type TaskEvaluationInput, type TaskExecution, type TaskExecutionV1, type TaskOutcomeStatus, TemplateError, type TemplateSource, type TemplateVariables, type UnresolvedExpectation, type ValidateStudyTaskSuiteOptions, WORKFLOW_STAGES, type WatchIndexOptions, type WorkflowExecutionResult, type WorkflowOptions, type WorkflowRunV1, WorkflowRunV1Schema, type WorkflowStage, type WorkflowStageContext, type WorkflowStageHandler, type WorkflowState, WorkflowStateSchema, WorkflowStepSchema, WorkflowTransitionSchema, adjudicateControlledStudyObservation, adjudicatedLedgerInputHash, adjudicatorRubric, analyzeMarkdownDocument, applyBudget, applyDocumentationDeclarations, applyEnrichmentAdjudication, applyFixProposal, applyGeneratedRegions, approvalsDir, approveFixProposal, approximateCounter, areaPagesView, areaSuggestionCoverage, areaSuggestions, assertObservedSurvive, assistedArmReadiness, auditDocumentation, batchContextPacks, benchmarkFixture, bm25Idf, bm25Search, budgetedHandoff, buildBm25Index, buildContextPacks, buildDocBridgeIndex, buildKnowledgeGraph, buildLookup, cacheHitRate, calculateStudyCostUsd, calculateStudyMetrics, canonicalJsonV1, canonicality, centrality, changeDigestView, checkIndexReproducibility, checkPublicParity, checkStudyExpectations, chunksFromMarkdown, claimPattern, claimSurfaces, classifyMemoryCandidates, collectPackages, compareBenchmarkSnapshots, compareRetrievalBaseline, compileBudget, compileTemplate, containedPath, contentHashForArtifactV1, contextPackHash, conventionalAreaPath, createAnalyzerRegistry, createApprovalGateMirror, createArtifactNormalizationProposal, createControlledStudyLedger, createControlledStudyObservation, createControlledStudyRunPlan, createControlledStudyVerifiedResult, createDocBridgeGraphMemory, createDocBridgeRag, createDocBridgeRetriever, createEnrichmentCache, createFileApprovalStore, createHistoricalEvidenceRegistry, createMarkdownLinkFixProposal, createMemoryEnrichmentCache, createPublicClaims, createRegistryAgentAdapter, createRetrievalBaseline, createStudyExpectations, createStudyProtocol, createStudyProviderCliConfig, createStudyRepositoryConfig, createStudyTaskSuite, createStudyVerificationBinding, decideEnrichment, declaredAudience, declaredExportsOf, defaultPromotionDraftPath, deriveAreas, discoverNxProjects, discoverRepository, docBridgePatternMarkdown, docBridgePatternPayload, doctorBadgeMetrics, documentClassification, draftMemoryPromotion, effectiveEnrichment, enrichmentAdjudicationId, enrichmentApprovalId, enrichmentCacheKey, enrichmentCost, enrichmentFindings, enrichmentOverlayContentHash, enrichmentOverlayHash, enrichmentOverlayPath, enrichmentProposalId, enrichmentProposalKey, enrichmentStability, entityContentHash, entityId, evaluateQualityScorecard, evaluateRules, evaluateStudyTask, exceptionFor, expandSearchToken, exportedNames, exportsOf, fileContentHash, findingFromDiagnostic, findingsFromDiagnostics, fitContextPack, fixApprovalId, foldAccents, formatBenchmarkText, formatControlledStudyRunPlanText, formatControlledStudyRunText, formatDoctorBadgeJson, formatDoctorBadgeMarkdown, formatDoctorText, formatDocumentationAuditText, formatDocumentationStandardText, formatEcosystemLlmsBlock, formatEcosystemLlmsSection, formatEnrichmentStatsText, formatEnrichmentText, formatHistoricalEvidenceText, formatKnowledgeLookupText, formatKnowledgeSearchText, formatOverlayRetrievalDeltaText, formatPublicParityText, formatRetrievalBenchText, formatRetrievalComparisonText, formatRetrievedDocuments, formatStudyExpectationsText, formatStudyMetricsText, formatStudyProtocolText, formatStudyProviderCliText, formatStudyTaskSuiteText, formatStudyVerificationText, fuzzyMatchList, generatedRegionHash, generatedRegionOpen, handleMcpRequest, handoffForEntity, hasRetrievalExpectations, hasSearchToken, importCycles, independentlyAdjudicateStudyLedger, independentlyAdjudicateStudyObservation, indexConfigurationHash, indexFilePath, indexPriorSnapshot, ingestAgentMemory, ingestCursorRules, ingestMemoryCandidates, installMcpConfig, inventedReferenceCount, isEnrichmentKind, isProjectedEntry, isRenderTemplateName, isSearchStopword, jaro, jaroWinkler, knowledgeLookup, knowledgeSearch, layer1InstallHint, listApprovals, listEnrichment, llmsTxtVariables, loadApprovalGate, loadDocBridgeIndex, loadFederatedChunks, loadFreshDocBridgeIndex, loadRegistryAgentMetadata, loadRegistryAgentRunner, loadWorkflowManifest, loadWorkflowStepOutput, markdownContentHash, matchesRetrievalExpectation, mcpSnippet, measureAgentEfficiency, measureAgentTaskEfficiency, measureBenchmark, measureOverlayRetrievalDelta, measureProviderToolTelemetry, mechanicalRubricItems, modelRubricItems, moduleUniverseFingerprint, normalizeAgentHandoff, overlayProposalIds, overlayReviewView, ownershipPagesView, packByteBudget, pageFileName, parseAgentHandoff, parseAgentProposal, parseAgentSearch, parseControlledStudyLedger, parseControlledStudyObservation, parseControlledStudyRunPlan, parseControlledStudyVerifiedResult, parseDiscoverySnapshot, parseDocBridgeConfig, parseDocBridgeIndex, parseDocumentationDeclarations, parseEnrichmentOverlay, parseFixProposal, parseHistoricalEvidenceRegistry, parseLlmsTxtLinks, parseMarkdownDocument, parseMemoryCandidate, parsePublicClaims, parsePublicParityReport, parseReconciliationReport, parseRetrievalBaseline, parseRetrievalBenchResult, parseRetrievalSuite, parseRuleId, parseRuleSeverity, parseStudyExpectations, parseStudyMetrics, parseStudyProtocol, parseStudyProviderCliConfig, parseStudyRepositoryConfig, parseStudyTaskSuite, parseStudyVerificationBinding, parseWorkflowRun, partitionEnrichmentProposals, persistControlledStudyLedger, persistIndependentlyAdjudicatedLedger, persistRegistryAgentProposal, projectEnrichmentOverlay, projectRetrievalIndex, promoteMemoryToGithubPr, providerForStudyExecution, proximity, rankRetrieval, rankedOutput, readEnrichmentOverlay, reconcileKnowledge, recordApproval, redactSecrets, redactValue, relationConfidence, relationId, renderArtifact, renderClaim, renderCompiledTemplate, renderNamedTemplate, renderOfflineReport, renderOfflineReportArtifact, renderTemplate, renderTemplateWithKnap, replayableRelations, repositoryInputs, resolutionFingerprint, resolveClaim, resolveEnrichmentRoles, resolveFuzzyReference, resolveGateIds, resolveHandoffEntry, resolveLookupEntry, resolveRoot, resolveSearchParams, resolveSearchWeights, resolveTemplateSource, respondMcpRequest, retrieveDocBridgeChunks, retrieveDocBridgeDocuments, retrieveHybridChunks, reuseCoverage, revalidateEnrichmentOverlay, rubricItemCheck, rubricItemText, runChatOnce, runControlledCommand, runControlledStudy, runDoctor, runDocumentationStandardV1, runEnrichment, runGate, runGates, runQuery, runRetrievalBench, runWorkflow, safeParseAgentHandoff, safeWalkFiles, safeWalkOptions, scanHumanDocRecords, scanHumanDocs, scanMemorySafety, scanStudyPublicationArtifact, sealEnrichmentOverlay, searchIndex, searchTokens, seededRandom, selectTaskExecutions, sha256NormalizedV1, singularizeSearchToken, snapshotObservationHash, startInkChat, startMcpStdioServer, studyRetrievalSuite, taskRetrievalQueries, templateFor, toKnowledgeEntry, tokenizeSearchText, unobservedOwnershipPaths, upsertControlledStudyObservation, validateEnrichmentAdjudication, validateEnrichmentProposal, validateHistoricalEvidenceRegistry, validateStudyProviderCommand, validateStudyTaskSuite, verifyGeneratedRegions, watchDocBridgeIndex, weakerConfidence, withAcceptedRelations, wrapGeneratedRegion, writeEnrichmentOverlay, writePromotionDraft, writeRenderedPages };