/** * FEAT-552 sub-scope B — deterministic type-hint rules (zero-LLM tier). * * A small, STRONG-pattern-only regex tier applied at memory-normalize time * (src/distill/stages/07-memory-normalize.ts) that corrects the model's atom * `type` when the atom's own text carries an unambiguous surface signal the * model missed. Measured basis (2026-07-18 deterministic-hardening * analysis): "X was chosen over Y" / "we decided to use X instead of Y" * style decisions are literally regexable, yet typeAcc measured 43-63% * across all models — a chunk of that gap is mechanically recoverable * without any additional LLM call. * * Design constraint (spec): STRONG patterns only, no hint on ambiguity. * `getTypeHint` fires at most one hint per atom — if more than one type's * pattern matches the same text, that is treated as ambiguous and no hint is * returned (logged, never guessed). This is verified against the full * 55-fixture extraction-bench gold set in tests/distill/type-hints.test.ts * (AC-B1): every pattern that fires must hit >=95% precision on the type it * claims, and no two rules ever fire on the same gold atom in that corpus. * * Each individual pattern was tuned against that same gold set to hit the * precision floor — see that test file's inline notes for why, e.g., the * decision "instead of|rather than" comparators require an imperative-verb * sentence opener (bare "instead of" alone false-fires on narrative * lesson/fact/todo text that merely mentions a comparison, not a decision). */ export type TypeHint = 'command' | 'decision' | 'lesson' | 'event'; export interface TypeHintMatch { hint: TypeHint; /** Stable label for the rule that fired — surfaced in census/logging, not * meant to be parsed. */ matchedPattern: string; } /** * Evaluate every STRONG rule against `text` and return the single hint that * fired — or `null` when zero rules fired, OR when more than one fired * (ambiguous; logged, never guessed). Callers with a `type` to compare * against (07-memory-normalize.ts) treat the returned hint as an OVERRIDE * only when it differs from the model's own type — see that file. */ export declare function getTypeHint(text: string, opts?: { log?: (message: string) => void; }): TypeHintMatch | null;