repositories / dotfiles
dotfiles
bugabingas dorkfiles
owned by bugabinga
pi/agent/extensions/prune/src/constants.ts
RawFile outline
- DEFAULT_SECTION_LIMIT line 7
- DEFAULT_TRANSCRIPT_LIMIT line 8
- DEFAULT_TOOL_CAP line 9
- TRUNCATE_USER line 11
- TRUNCATE_ASSISTANT line 12
- BLOCKER_RE line 16
- SELF_TALK_PREFIX_RE line 20
- GOAL_VERBS line 24
- GOAL_RE line 32
- SCOPE_CHANGE_RE line 37
- NOISE_SHORT_RE line 39
- NON_GOAL_RE line 41
- TEMPLATE_SIGNAL_RE line 43
- INTERROGATIVE_RE line 45
- PREF_PATTERNS line 49
- GENERATED_PREF_FALSE_POSITIVE_RE line 58
- FILE_PATH_RE line 62
- SECTION_SESSION line 66
- SECTION_FILES line 67
- SECTION_CONTEXT line 68
- SECTION_PREFS line 69
- SECTION_COMMITS line 70
- SEPARATOR line 71
- RECALL_NOTE line 73
/**
* 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*(<skill\b|```|For each\b|Do NOT\b|Analyze and propose\b|If [Tt]ask|Output:\s*$|here'?s a|ticket:)\b/i;
export const INTERROGATIVE_RE = /^\s*(what|why|how|when|where|who|which|is|are|was|were|do|does|did|should|could|would)\b/i;
// ─── Preference patterns ─────────────────────────────────────────────────
export const PREF_PATTERNS = [
/\bprefer(?:s|red|ring)?\s+\w/i,
/\bdon'?t want\b/i,
/\balways (?:use|do|run|prefer|keep|make|format|write|add|set|put|prefix|start|include|append|check)\b/i,
/\bnever (?:use|do|run|push|commit|write|ignore|add|set|put|remove|delete|include|deploy)\b/i,
/\bplease (?:use|avoid|keep|make|don'?t|do not|format|write)\b/i,
/\b(?:style|format|language|naming)\s*[:=]\s*\S/i,
];
export const GENERATED_PREF_FALSE_POSITIVE_RE = /\bPOV\b.*\bformat\s*[:=]\s*engagement\b/i;
// ─── File path patterns ─────────────────────────────────────────────────
export const FILE_PATH_RE = /(?:^|\/)([^\/\s]+\.[a-zA-Z0-9]+$)/;
// ─── Section headers ─────────────────────────────────────────────────────
export const SECTION_SESSION = '[Session Goal]';
export const SECTION_FILES = '[Files And Changes]';
export const SECTION_CONTEXT = '[Outstanding Context]';
export const SECTION_PREFS = '[User Preferences]';
export const SECTION_COMMITS = '[Commits]';
export const SEPARATOR = '\n\n---\n\n';
export const RECALL_NOTE = 'Use prune_recall to search for prior work, decisions, and context from before this summary.\nDo not redo work already completed.';