/** * Provider-neutral content-coherence decomposition. * * This module owns membership. Consumers may aggregate presentation metadata * over the returned components, but they must not split, merge, or reorder * those components. */ import { z } from "zod"; export declare const CONTENT_COHERENCE_SCORES: Readonly<{ readonly call_import_reference_adjacency: 70; readonly same_directory: 10; readonly shared_critical_flow: 60; readonly shared_file: 100; readonly shared_semantic_tag_or_same_lens: 30; readonly shared_unit: 80; }>; export declare const CONTENT_COHERENCE_THRESHOLD = 60; /** * Which pairs may join at all — the ONE policy axis of the shared core, never a * fork. Both draws run the identical scan, union-find, and canonical ordering; * they differ only in this predicate and in {@link ContentCoherencePolicy.refineAtModularityPeak}. * * - `weighted_score_threshold` — a pair joins when its summed evidence weight * reaches {@link CONTENT_COHERENCE_THRESHOLD}. Disjunctive: four of the six * classes clear 60 alone. * - `shared_file_and_same_lens` — a pair joins only when it shares a FILE **and** * a lens. Measured on the promoted 2026-08-18 run (3,230 findings): the * threshold rule left 99.97% of findings in a single component, and no * class-COUNT variant fixed it, because `shared_unit`/`same_lens`/`same_directory` * are near-vacuous partitions at audit scale. The conjunction bounds by * STRUCTURE, not density — `same_lens` is a hard partition no edge may cross. */ export type ContentCoherenceEligibility = "weighted_score_threshold" | "shared_file_and_same_lens"; /** The per-draw policy. Every difference between the draws lands here. */ export interface ContentCoherencePolicy { readonly eligibility: ContentCoherenceEligibility; /** * Refine each eligible-edge component at its modularity peak (below), so a * loose component splits at its own data-derived thin seam while a true clique * survives whole. No budget, ceiling, or size target participates. */ readonly refineAtModularityPeak: boolean; } /** * The audit TASK draw. Unmeasured for collapse — its eligibility is deliberately * left as-is until it is measured on its own lap (`docs/backlog/open-bugs.md`). */ export declare const TASK_DRAW_COHERENCE_POLICY: ContentCoherencePolicy; /** The FINDINGS draw (work blocks + the findings deliverable). Owner cut, 2026-08-19. */ export declare const FINDINGS_DRAW_COHERENCE_POLICY: ContentCoherencePolicy; export type ContentCoherenceEvidence = { -readonly [Kind in keyof typeof CONTENT_COHERENCE_SCORES]: boolean; }; export interface ContentCoherenceItem { id: string; file_paths: readonly string[]; unit_ids: readonly string[]; tags: readonly string[]; critical_flow_ids?: readonly string[]; annotations?: Readonly>; } export type ContentCoherenceRelationshipKind = "shared_file" | "cross_lens_same_file" | "same_unit" | "call_adjacent" | "same_flow" | "same_lens" | "same_dir"; export interface ContentCoherenceRelationship { left: string; right: string; kind: ContentCoherenceRelationshipKind | string; } export interface ContentCoherenceInput { items: readonly ContentCoherenceItem[]; relationships?: readonly ContentCoherenceRelationship[]; } export interface NormalizedContentCoherenceItem { id: string; file_paths: string[]; unit_ids: string[]; tags: string[]; critical_flow_ids?: string[]; } export interface ContentCoherenceTrace { normalized_items: NormalizedContentCoherenceItem[]; components: string[][]; } export declare const NormalizedContentCoherenceItemSchema: z.ZodObject<{ id: z.ZodString; file_paths: z.ZodArray; unit_ids: z.ZodArray; tags: z.ZodArray; critical_flow_ids: z.ZodOptional>; }, "strict", z.ZodTypeAny, { id: string; file_paths: string[]; unit_ids: string[]; tags: string[]; critical_flow_ids?: string[] | undefined; }, { id: string; file_paths: string[]; unit_ids: string[]; tags: string[]; critical_flow_ids?: string[] | undefined; }>; export declare const ContentCoherenceTraceSchema: z.ZodObject<{ normalized_items: z.ZodArray; unit_ids: z.ZodArray; tags: z.ZodArray; critical_flow_ids: z.ZodOptional>; }, "strict", z.ZodTypeAny, { id: string; file_paths: string[]; unit_ids: string[]; tags: string[]; critical_flow_ids?: string[] | undefined; }, { id: string; file_paths: string[]; unit_ids: string[]; tags: string[]; critical_flow_ids?: string[] | undefined; }>, "many">; components: z.ZodArray, "many">; }, "strict", z.ZodTypeAny, { normalized_items: { id: string; file_paths: string[]; unit_ids: string[]; tags: string[]; critical_flow_ids?: string[] | undefined; }[]; components: string[][]; }, { normalized_items: { id: string; file_paths: string[]; unit_ids: string[]; tags: string[]; critical_flow_ids?: string[] | undefined; }[]; components: string[][]; }>; /** * Build the complete canonical trace used by both audit and findings draws. * * `policy` is REQUIRED and has no default: a draw that forgot to declare its * eligibility would otherwise silently inherit the other draw's, which is * exactly the class of latent failure this project refuses to leave to a * caller's memory. Pass {@link TASK_DRAW_COHERENCE_POLICY} or * {@link FINDINGS_DRAW_COHERENCE_POLICY}. */ export declare function buildContentCoherenceTrace(input: ContentCoherenceInput | Record, policy: ContentCoherencePolicy): ContentCoherenceTrace; //# sourceMappingURL=contentCoherence.d.ts.map