/** * Per-clause intent interpreter. * * Extends the free-form intent pipeline with per-clause encodability assessment. * Fixes CE-005 (compound intent silently drops unrecognised directives) and * CE-206 (total-encoding-failure check too coarse — single bad clause blocks * all encodable clauses). Satisfies OBL-S10 / OBL-X07. * * Key invariant: ANY clause that cannot be encoded independently triggers a * blocking checkpoint question; encodable clauses proceed regardless. * * All logic is pure and synchronous — no I/O, no LLM calls. */ /** The three signal kinds a clause can encode to. */ export type IntentClauseKind = "lens_weight" | "priority_signal" | "scope_emphasis"; /** Result of decomposing and assessing a single clause. */ export interface IntentClause { /** * Stable identity of this clause — the resolution key for the blocking * escalation gate (CE-004). The rendered `checkpoint_question` is a derived * presentation string and is NOT injective: two distinct clauses can render to * the same question (e.g. duplicated directive text), so keying resolution on * it collapses them and answering one silently resolves both. The clause * identity is keyed on the normalized clause text instead, so every distinct * directive must be answered individually. */ clause_id: string; /** The original clause text (trimmed). */ text: string; /** Whether this clause maps to at least one recognised signal. */ encodable: boolean; /** Present when encodable is true. */ encoded_as?: { kind: IntentClauseKind; detail: string; }; /** Present when encodable is false — a human/host-answerable blocking question. */ checkpoint_question?: string; } /** Output of interpretIntent — the top-level clause-aware result. */ export interface ClauseInterpretResult { /** One entry per discrete clause in the input. */ clauses: IntentClause[]; /** * Subset of clauses that could not be encoded, promoted to blocking * checkpoint questions that must be answered before planning proceeds. */ checkpoint_questions: string[]; /** True when at least one clause could not be encoded. */ has_unencodable: boolean; } /** * Split a compound free-form intent string into discrete single-purpose * clauses. Splits on semicolons, " and ", newlines, and sentence boundaries * (". " followed by an uppercase letter or end-of-string). Returns an empty * array for empty/whitespace-only input. * * **Why commas do NOT split here:** * This function is used in the *blocking-checkpoint* intent pipeline where * each clause must be an independently assessable directive. A comma within a * clause (e.g. "focus on modules A, B, and C") is part of that directive, not * a clause separator. Splitting on commas would fragment such directives into * unrecognisable pieces, producing spurious unencodable clauses. * * **Compare with `freeFormIntentInterpreter.decomposeClauses`:** * That function splits on commas because it processes brief hint lists where * commas are the primary separator (e.g. "security, performance"). Its output * is a set of keyword-match inputs, not independently assessable directives. * * The two functions intentionally have different splitting rules. See * `tests/maintainability-split-rules.test.mjs` for a regression assertion. */ export declare function decomposeIntent(free_form_intent: string): IntentClause[]; /** * Stable identity for a clause — the resolution key for the blocking escalation * gate (CE-004). Derived deterministically from the clause's own text * (case-folded, whitespace-collapsed, trailing punctuation trimmed) so the same * directive always yields the same id across passes/runs, while two textually * different directives that happen to render to the same `checkpoint_question` * get distinct ids and must each be answered. Pure — no IO, no hashing. */ export declare function clauseIdentity(text: string): string; /** * Assess whether a single clause can be encoded as a planning signal. * * Returns a structured assessment — encodable: true if it maps to at least * one signal kind; encodable: false with a checkpoint_question if it cannot. */ export declare function assessClauseEncodability(clause: string): { encodable: boolean; kind?: IntentClauseKind; detail?: string; checkpoint_question?: string; }; /** * Top-level clause-aware intent interpretation. * * Decomposes the free-form intent into clauses, assesses each independently, * and promotes any unencodable clauses to blocking checkpoint questions. * Encodable clauses proceed regardless of whether other clauses fail. */ export declare function interpretIntent(free_form_intent: string): ClauseInterpretResult; //# sourceMappingURL=clauseInterpreter.d.ts.map