/** * SMI-1535: Neural Test Infrastructure - Mock Implementations * * Mock implementations of learning interfaces for testing. * * @see packages/core/src/learning/interfaces.ts * @see packages/core/src/learning/types.ts */ import type { ISignalCollector, IPreferenceLearner, IPersonalizationEngine, IUserPreferenceRepository } from '../../../src/learning/interfaces.js'; import { type SignalEvent, type SignalFilter, type RecommendationContext, type SignalMetadata, type DismissReason, type UserPreferenceProfile, type LearningConfig, type PersonalizedRecommendation } from '../../../src/learning/types.js'; export { MockPrivacyManager, MockUserPreferenceRepository } from './neural-mocks-privacy.js'; /** * Mock implementation of ISignalCollector for testing */ export declare class MockSignalCollector implements ISignalCollector { private signals; recordAccept(skillId: string, context: RecommendationContext, metadata?: SignalMetadata): Promise; recordDismiss(skillId: string, context: RecommendationContext, reason?: DismissReason): Promise; recordUsage(skillId: string, frequency: 'daily' | 'weekly'): Promise; recordAbandonment(skillId: string, daysSinceInstall: number): Promise; recordUninstall(skillId: string, daysSinceInstall: number): Promise; getSignals(filter: SignalFilter, limit?: number): Promise; getSignalCount(): Promise; getSignalsForSkill(skillId: string): Promise; clear(): void; getAllSignals(): SignalEvent[]; addSignal(signal: SignalEvent): void; removeOldSignals(cutoffTimestamp: number): number; } /** * Mock implementation of IPreferenceLearner for testing */ export declare class MockPreferenceLearner implements IPreferenceLearner { private config; updateProfile(profile: UserPreferenceProfile, signal: SignalEvent): Promise; batchUpdateProfile(profile: UserPreferenceProfile, signals: SignalEvent[]): Promise; decayWeights(profile: UserPreferenceProfile, decayFactor?: number): Promise; calculatePersonalizedScore(skillData: { id: string; category?: string; trustTier?: string; keywords?: string[]; triggerPhrases?: string[]; }, baseScore: number, profile: UserPreferenceProfile): PersonalizedRecommendation; getConfig(): LearningConfig; setConfig(config: Partial): void; private clampWeight; } /** * Mock implementation of IPersonalizationEngine for testing */ export declare class MockPersonalizationEngine implements IPersonalizationEngine { private learner; private profileRepo; private signalCollector; constructor(learner: MockPreferenceLearner, profileRepo: IUserPreferenceRepository, signalCollector: MockSignalCollector); personalizeRecommendations(baseRecommendations: Array<{ skill_id: string; base_score: number; skill_data: { category?: string; trustTier?: string; keywords?: string[]; }; }>, userId?: string): Promise; /** * Determine if personalization should be applied. * * IMPORTANT: Mock Implementation Limitation * ----------------------------------------- * This mock checks the GLOBAL signal count across all users, not the * per-user signal count. This is a simplification for testing purposes. * * In a real implementation, shouldPersonalize should: * 1. Look up the user's profile by userId * 2. Check that user's individual signal_count against the threshold * 3. Return true only if that specific user has enough signals * * The mock behavior works for single-user test scenarios but does not * accurately model multi-user environments where each user has their * own signal history and personalization threshold. * * @param _userId - User ID (ignored in mock - uses global count) * @returns Promise - True if global signal count meets threshold */ shouldPersonalize(_userId?: string): Promise; getUserProfile(userId?: string): Promise; resetToDefault(userId?: string): Promise; } //# sourceMappingURL=neural-mocks.d.ts.map