/** * SMI-1535: Neural Test Infrastructure - Helpers * * Provides signal generation utilities and test data factories * for the Recommendation Learning Loop integration tests. * * @see packages/core/src/learning/interfaces.ts * @see packages/core/src/learning/types.ts */ import { type SignalEvent, type RecommendationContext, type SignalMetadata, SignalType, DismissReason, SkillCategory } from '../../../src/learning/types.js'; /** * Options for generating a signal event */ export interface SignalGeneratorOptions { type?: SignalType; skillId?: string; timestamp?: number; category?: SkillCategory; trustTier?: string; originalScore?: number; installedSkills?: string[]; dismissReason?: DismissReason; metadata?: SignalMetadata; } /** * Generate a single signal event with sensible defaults */ export declare function generateSignal(options?: SignalGeneratorOptions): SignalEvent; /** * Generate multiple signal events in a batch */ export declare function generateSignalBatch(count: number, options?: SignalGeneratorOptions): SignalEvent[]; /** * Generate a sequence of signals simulating realistic user behavior * Returns signals in chronological order */ export declare function generateUserJourney(skillId: string, outcome: 'successful' | 'abandoned' | 'uninstalled', category?: SkillCategory): SignalEvent[]; /** * Generate signals representing a mix of user interactions across categories */ export declare function generateMixedCategorySignals(signalsPerCategory: number): Map; /** * Generate dismiss signals with various reasons */ export declare function generateDismissSignals(count: number, category?: SkillCategory): SignalEvent[]; /** * Create a timestamp offset by a number of days from now. * Returns a Unix timestamp (milliseconds) representing a point in the past. * * @param days - Number of days in the past (must be non-negative) * @returns Unix timestamp in milliseconds * @throws {RangeError} If days is negative * @example * const thirtyDaysAgo = daysAgo(30) // timestamp 30 days before now */ export declare function daysAgo(days: number): number; /** * Create a timestamp offset by a number of hours from now. * Returns a Unix timestamp (milliseconds) representing a point in the past. * * @param hours - Number of hours in the past (must be non-negative) * @returns Unix timestamp in milliseconds * @throws {RangeError} If hours is negative * @example * const twoHoursAgo = hoursAgo(2) // timestamp 2 hours before now */ export declare function hoursAgo(hours: number): number; /** * Create a timestamp offset by a number of minutes from now. * Returns a Unix timestamp (milliseconds) representing a point in the past. * * @param minutes - Number of minutes in the past (must be non-negative) * @returns Unix timestamp in milliseconds * @throws {RangeError} If minutes is negative * @example * const fiveMinutesAgo = minutesAgo(5) // timestamp 5 minutes before now */ export declare function minutesAgo(minutes: number): number; /** * Generate a recommendation context for testing */ export declare function generateContext(options?: { installedSkills?: string[]; originalScore?: number; category?: SkillCategory; trustTier?: string; projectContext?: string; }): RecommendationContext; /** * Generate metadata for signal events */ export declare function generateMetadata(options?: { timeToAction?: number; suggestionCount?: number; extra?: Record; }): SignalMetadata; /** * Generate test skill data for personalization testing */ export declare function generateSkillData(id: string, options?: { category?: SkillCategory; trustTier?: string; keywords?: string[]; triggerPhrases?: string[]; }): { id: string; category?: string; trustTier?: string; keywords?: string[]; triggerPhrases?: string[]; }; /** * Generate a set of skills with varied categories for recommendation testing */ export declare function generateSkillSet(count: number): Array<{ skill_id: string; base_score: number; skill_data: { category?: string; trustTier?: string; keywords?: string[]; }; }>; /** * Assert that signals are in chronological order */ export declare function assertChronological(signals: SignalEvent[]): void; /** * Wait for a specified number of milliseconds */ export declare function delay(ms: number): Promise; //# sourceMappingURL=helpers.d.ts.map