export const TASK_TYPES = [
    'debugging',
    'implementation',
    'refactor',
    'review',
    'planning',
    'exploration',
    'testing',
    'unknown',
];
export const TASK_TYPE_ALIASES = new Map([
    ['bug', 'debugging'],
    ['bug_fix', 'debugging'],
    ['bugfix', 'debugging'],
    ['coding', 'implementation'],
    ['development', 'implementation'],
    ['investigation', 'debugging'],
]);
/** Normalize a raw taskType string: trim, lowercase, collapse spaces/hyphens to underscore. */
export function taskTypeToken(value) {
    return value.trim().toLowerCase().replace(/[\s-]+/g, '_');
}
/** Type guard: is `t` a canonical TaskType (not just an alias)? */
export const isTaskType = (t) => TASK_TYPES.includes(t);
export const CONTEXT_MODES = ['compact', 'layered'];
export const CONTEXT_NOISE_TOLERANCES = ['balanced', 'strict'];
export const KNOWLEDGE_ITEM_TYPES = [
    'spec',
    'workflow',
    'memory',
    'bugfix',
    'code_ref',
    'rule',
    'wiki',
    'conversation',
];
export const TRIGGER_TYPES = [
    'complex_task_success',
    'error_recovery',
    'user_correction',
    'non_trivial_workflow',
    'manual',
];
export const LABEL_TYPES = [
    'project',
    'repo',
    'domain',
    'business_area',
    'task_type',
    'technology',
    'workflow_stage',
    'severity',
    'file',
    'symbol',
    'error',
    'user_preference',
];
export const REFERENCE_TYPES = ['file', 'url', 'commit', 'tool', 'conversation', 'external'];
export const KNOWLEDGE_RELATION_TYPES = [
    'contains',
    'references',
    'mentions_file',
    'mentions_symbol',
    'resolves_error',
    'supersedes',
    'depends_on',
    'related_to',
    'derived_from_session',
];
export const KNOWLEDGE_RELATION_TARGET_KINDS = [
    'knowledge',
    'file',
    'symbol',
    'error',
    'session',
    'reference',
];
export const INGESTION_MODES = ['document', 'atomic'];
export const FEEDBACK_TYPES = [
    'selected',
    'rejected',
    'irrelevant',
    'stale',
    'missing_context',
    'selected_but_noisy',
    'too_much_adjacent_context',
    'missing_orientation',
    'missing_current_handoff',
    'missing_verification_commands',
];
export const CONTEXT_QUALITY_FEEDBACK_TYPES = [
    'selected_but_noisy',
    'too_much_adjacent_context',
    'missing_orientation',
    'missing_current_handoff',
    'missing_verification_commands',
];
export const AGENT_SESSION_OUTCOMES = ['completed', 'failed', 'blocked', 'cancelled'];
export const AGENT_LEARNING_MODES = ['auto', 'draft_only', 'off'];
export const KNOWLEDGE_STATUSES = ['approved', 'needs_review', 'archived', 'blocked'];
export const KNOWLEDGE_REVIEW_FILTERS = [
    'questionable',
    'unsafe',
    'low_trust',
    'stale',
    'rejected',
    'irrelevant',
    'orphaned',
    'auto_memory',
    'risky_auto_memory',
];
export const KNOWLEDGE_CONFLICT_STATUSES = ['open', 'resolved', 'dismissed'];
export const LEARNING_REVIEW_STATUSES = ['open', 'approved', 'dismissed', 'needs_changes'];
export const LEARNING_PROPOSAL_TYPES = [
    'missing_label',
    'missing_reference',
    'missing_relation',
    'supersedes',
    'auto_memory_cleanup',
    'user_style_candidate',
];
export const REFLECTION_DRAFT_STATUSES = [
    'pending',
    'approved',
    'rejected',
    'needs_changes',
];
export const REFLECTION_REVIEW_DECISIONS = ['approve', 'reject', 'needs_changes'];
export const REFLECTION_REVIEW_GRADES = ['pass', 'concern', 'fail'];
export const REFLECTION_DUPLICATE_RISKS = ['low', 'medium', 'high'];
export const ERROR_LOG_CATEGORIES = [
    'mcp',
    'http',
    'cli',
    'database',
    'cache',
    'model_provider',
    'retrieval',
    'ingestion',
    'reflection',
    'agent_session',
    'agent_tool',
    'test',
    'unknown',
];
export const ERROR_LOG_SEVERITIES = [
    'debug',
    'info',
    'notice',
    'warning',
    'error',
    'critical',
    'alert',
    'emergency',
];
export const ERROR_LOG_STATUSES = ['open', 'triaged', 'fixed', 'wont_fix', 'archived'];
export const AGENT_LEARNING_SIGNAL_KINDS = [
    'tip',
    'decision',
    'mistake',
    'verification',
    'file_change',
    'user_preference',
    'follow_up',
];
export const AGENT_LEARNING_SIGNAL_SOURCES = ['user', 'agent', 'tool', 'system', 'reviewer'];
export const RESEARCH_TRACE_STEP_KINDS = ['thought', 'action', 'observation', 'decision'];
export const MAINTENANCE_ITEM_KINDS = [
    'duplicate_memory',
    'stale_relation',
    'superseded_reflection',
    'weak_label',
];
export const MAINTENANCE_RISKS = ['low', 'medium', 'high'];
export const MAINTENANCE_EVIDENCE_SOURCES = ['write_gate', 'relation_expiry', 'label_provenance'];
export const MAINTENANCE_RISK_DEFAULTS = {
    duplicate_memory: 'low',
    weak_label: 'low',
    stale_relation: 'medium',
    superseded_reflection: 'high',
};
export const RESOLVE_ERROR_LOG_STATUSES = ['fixed', 'wont_fix'];
