/** * PM-comment classifier — 0.16.0-α.7. * * Each element-anchored review-overlay comment on a slowcook-mockup PR * gets categorized so plate knows what to do with it: * * - "cosmetic" → amend the mock with minimum diff * - "spec-altering" → ESCALATE: would invalidate a spec assertion or * acceptance scenario; PM must confirm the spec * change before plate touches the mock * - "mock-divergence" → the mock diverged from the spec; align mock * to spec; note in summary why the PM ask is * being interpreted this way * * α.7 ships a deterministic heuristic. Each classification has a clear * rationale string so the escalation comment can quote the trigger. * * Heuristic structure: * 1. Parse the spec YAML to extract the salient assertion targets: * - acceptance_scenarios prose lines * - api_contract response field names * - invariants prose * - ui_behavior viewport prose * → a flat set of "spec terms" (lowercased, normalized words). * 2. Score the comment prose against those terms: * - any direct mention of an acceptance keyword phrase → spec-altering * - mention of a domain noun + a "remove/change/replace" → spec-altering * - mentions only adjective/style words (color, padding, → cosmetic * font, spacing, alignment, shadow, etc.) * - else → mock-divergence * * The heuristic is intentionally conservative on spec-altering: false * positives only cost a PM confirm round; false negatives let plate * silently weaken the spec, which is the failure mode the architecture * is designed to prevent. When in doubt → escalate. * * No LLM dep here — pure functions over inputs. LLM-backed classifier * is a future α.7.1 upgrade if heuristic shows real misses. */ export type Classification = "cosmetic" | "spec-altering" | "mock-divergence"; export interface ClassifyResult { classification: Classification; /** Why this classification — included verbatim in escalation comments. */ rationale: string; /** The spec terms (if any) that matched in the comment prose. */ matchedSpecTerms: string[]; } export interface ClassifyArgs { /** Free prose written by the PM in the review-overlay comment. */ prose: string; /** * Spec YAML body. Hand-parsed for the assertion targets; we don't * need a full YAML parser since the heuristic only needs salient * words from acceptance_scenarios / invariants / api_contract. */ specYaml: string; } export declare function classifyComment(args: ClassifyArgs): ClassifyResult; /** * Extract candidate "spec terms" — lowercase, deduplicated significant * tokens from the spec sections plate cares about. Used by the * classifier to detect overlap between PM prose and spec assertions. */ export declare function extractSpecTerms(specYaml: string): string[]; //# sourceMappingURL=classify.d.ts.map