/** * prune — constants */ // ─── Limits ───────────────────────────────────────────────────────────────── export const DEFAULT_SECTION_LIMIT = 8; export const DEFAULT_TRANSCRIPT_LIMIT = 120; export const DEFAULT_TOOL_CAP = 8; export const TRUNCATE_USER = 256; export const TRUNCATE_ASSISTANT = 200; // ─── Blockers ───────────────────────────────────────────────────────────── export const BLOCKER_RE = /\b(fail(ed|s|ure|ing)?|broken|cannot|can't|won't work|does not work|doesn't work|still (broken|failing|wrong)|blocked|blocker|not (fixed|resolved|working)|crash(es|ed|ing)?)\b/i; // ─── Self-talk prefixes ────────────────────────────────────────────────── export const SELF_TALK_PREFIX_RE = /^\s*(?:hmm|wait|actually|oh|okay|ok|well|so)[,.!\s-]+/i; // ─── Goal patterns ──────────────────────────────────────────────────────── export const GOAL_VERBS = [ 'scan', 'check', 'fix', 'implement', 'add', 'create', 'build', 'refactor', 'debug', 'investigate', 'update', 'remove', 'delete', 'migrate', 'deploy', 'test', 'write', 'set up', 'spin', 'run', 'execute', 'verify', 'review', 'analyze', 'explain', 'describe', 'explore', 'call', 'use', 'switch', 'clean', 'lint', 'format', 'do', ]; export const GOAL_RE = new RegExp( `\\b(${GOAL_VERBS.map(v => v.replace(/ /g, '\\s+')).join('|')})\\b`, 'i', ); export const SCOPE_CHANGE_RE = /\b(also|instead|actually|change of plan|forget that|new task|switch to|now i want|pivot|let'?s do|stop .* and|while we'?re at it|for now)\b/i; export const NOISE_SHORT_RE = /^(ok|okay|yes|no|yep|nope|go|hi|hey|thanks?|thx|k|y|n|done|go ahead|looks good|sounds good|lgtm|sounds right|makes sense|sure|please|thank|noop)\s*[.!?]*$/i; export const NON_GOAL_RE = /^\s*[\[│├└─╭╰─]|```|^\s*(=[A-Z_]+\(|function |const |let |var |import |export |class |async |await |interface |type )|^(https?:\/\/|file:|\/[a-z])|^\s*```|\s*```\s*$|^\s*\| |^\s*For each\b|\bin full\b[^\n]*\b(comments?|issues?|PRs?|linked)\b|^@[\w\/.-]+\s*$/i; export const TEMPLATE_SIGNAL_RE = /^\s*(