/** * SMI-1535: Neural Test Infrastructure - Privacy and Repository Mocks * * Mock implementations of privacy manager and user preference repository. * * @see packages/core/src/learning/interfaces.js * @see packages/core/src/learning/types.js */ import type { IPrivacyManager, IUserPreferenceRepository } from '../../../src/learning/interfaces.js'; import { type SignalEvent, type UserPreferenceProfile, type UserDataExport, type AggregateStats } from '../../../src/learning/types.js'; /** * Interface for signal collector methods used by MockPrivacyManager */ interface ISignalCollectorForPrivacy { removeOldSignals(cutoffTimestamp: number): number; getAllSignals(): SignalEvent[]; getSignalCount(): Promise; clear(): void; } /** * Mock implementation of IPrivacyManager for testing */ export declare class MockPrivacyManager implements IPrivacyManager { private signalCollector; private profileRepo; private auditLog; constructor(signalCollector: ISignalCollectorForPrivacy, profileRepo: MockUserPreferenceRepository); purgeOldSignals(retentionDays: number): Promise; exportUserData(): Promise; wipeAllData(): Promise; anonymizeForAnalytics(): Promise; getStorageSize(): Promise; /** * Verify that no PII (Personally Identifiable Information) is stored. * * Mock Implementation Details * --------------------------- * This mock always returns true because the test environment uses * controlled, synthetic data that never contains real PII. * * A real implementation should: * 1. Scan signal events for PII patterns (emails, names, IPs, etc.) * 2. Check that skill_id values don't contain user identifiers * 3. Verify context fields don't leak sensitive project paths * 4. Ensure keyword_weights don't contain personal identifiers * 5. Validate that exported data is properly anonymized * * The mock skips these checks since test data is constructed with * known-safe values (UUIDs, generic skill names, etc.). * * @returns Promise - Always true in mock (no real PII checks) */ verifyPrivacy(): Promise; getAuditLog(): Array<{ operation: string; timestamp: number; details?: string; }>; /** * Clear the audit log. * Used in test cleanup to reset state between tests. */ clearAuditLog(): void; } /** * Mock implementation of IUserPreferenceRepository for testing */ export declare class MockUserPreferenceRepository implements IUserPreferenceRepository { private profiles; private readonly defaultUserId; getProfile(userId?: string): Promise; saveProfile(profile: UserPreferenceProfile, userId?: string): Promise; deleteProfile(userId?: string): Promise; exists(userId?: string): Promise; clear(): void; } export {}; //# sourceMappingURL=neural-mocks-privacy.d.ts.map