/** * Principle Semantic Selector v0 — Owner Decision Experience v1 (SPEC §10.2). * * Selects the most human-readable EXISTING principle text for the Owner's * first layer. v0 is whole-field selection only: no sentence extraction, no * word deletion, no rewriting, no LLM. If no source field qualifies as a * standalone human behavior principle, the answer is UNKNOWN — the technical * original stays reachable in Technical Details. * * Source order (constrained by lineage/version FIRST, then tier): * 1. Scribe principleDraft.statement (same lineage/revision as the decision artifact) * 2. Distiller abstractedPrinciple (same candidate) * 3. Philosopher principleCandidate.title (exact verifiable relation) * 4. candidate.description (only kind=principle AND whole-field qualified) * 5. UNKNOWN * * Qualification is deliberately conservative: ANY technical residue (paths, * file names, regex, hashes, internal ids, tool/hook names, snake_case * identifiers) disqualifies the whole field. Borderline → UNKNOWN, never a * partial cleanup. The audit's 34%/54% implementation-leakage labels are test * fixtures, not runtime inputs — there is no per-id special casing here. */ /** Ordered candidate sources handed to the selector by the collector. */ export interface SemanticSource { tier: 'scribe' | 'distiller' | 'philosopher' | 'candidate_principle'; /** Whole-field text as persisted. */ text: string; /** Artifact/principle version anchor (e.g. artifact id or 'ledger'), for display only. */ sourceVersion: string; } export interface SemanticSelection { status: 'known'; text: string; sourceTier: SemanticSource['tier']; selectionMode: 'whole_field' | 'extracted_sentence'; selectionReason: string; sourceVersion: string; } export interface SemanticUnknown { status: 'unknown'; reasonCode: 'no_qualified_source' | 'only_technical_recommendation_available' | 'no_sources'; reasonText: string; } export type SemanticSelectionResult = SemanticSelection | SemanticUnknown; /** Whole-field human-readability gate. True = safe for the Owner first layer. */ export declare function isWholeFieldHumanReadable(text: string): boolean; /** * Semantic Selector v0: first qualified source in tier order. Sources must * already be lineage-constrained by the caller (only scribe artifacts bound * to THIS principle's revision, only the same candidate's distiller field…). */ export declare function selectLearnedPrincipleV0(sources: SemanticSource[]): SemanticSelectionResult; /** * Extracts the first standalone human behavior sentence (verbatim) from the * given sources, or null when none qualifies. A sentence qualifies when it * (a) passes the same whole-field technical-residue gate per sentence, * (b) carries an explicit behavioral obligation marker, and * (c) is long enough to be a standalone obligation. * Extraction only helps multi-sentence fields: a single-sentence field that * failed the whole-field gate fails the same gate per sentence. */ export declare function extractStandaloneBehaviorSentence(sources: SemanticSource[]): { text: string; tier: SemanticSource['tier']; sourceVersion: string; } | null; /** * Semantic Selector v1: v0 whole-field selection first; bounded verbatim * sentence extraction as the only fallback. No rewriting, ever. */ export declare function selectLearnedPrincipleV1(sources: SemanticSource[]): SemanticSelectionResult; //# sourceMappingURL=semantic-selector.d.ts.map