/** * Structured Distillation for trajectory content (#2241 §SOTA — arXiv:2603.13017). * * The arXiv paper compresses agent exchanges from ~371 to ~38 tokens (11×) using * a four-field schema, and reports retrieval MRR going from 0.745 (raw) to * 0.759 (distilled) on a 214 K-pair consensus-graded corpus. The schema is * domain-portable; we adopt it for trajectory step content so SONA's recall * works against a denser, higher-signal representation. * * This module is the RULE-BASED extractor. A future round can plug in a * learned distiller (cross-encoder / LLM); the schema and the harness stay * the same so the swap is drop-in. * * Schema: * summary — first sentence (capped); the headline of the exchange * detail — the rest of the content (capped); kept for fidelity * labels — domain tokens: verbs, nouns, and recognised actions * paths — file paths and file:line references (high-signal anchors) */ /** Distilled trajectory content. */ export interface DistilledContent { summary: string; detail: string; labels: string[]; paths: string[]; } /** * Distill a raw trajectory step's content into the 4-field schema. * Deterministic, dependency-free, sub-millisecond. */ export declare function distillTrajectoryContent(raw: string): DistilledContent; /** * Serialise a distilled object into a compact embedding-ready string. The * resulting form is what gets embedded for retrieval — labels and paths come * first so they get high attention weight in the embedding. * * The paper's MRR uplift comes from the ordering: high-signal tokens (labels, * paths) lead, so the embedder allocates more probability mass to them. */ export declare function serialiseDistilled(d: DistilledContent): string; /** Convenience: distill then serialise. */ export declare function distillAndSerialise(raw: string): string; /** * Compression ratio: raw bytes / distilled bytes. >1 means distilled is * smaller. Used by the benchmark harness. */ export declare function compressionRatio(raw: string): number; //# sourceMappingURL=structured-distill.d.ts.map