@@ -208,6 +208,56 @@ export class SessionController<TView = unknown> extends Loggable {
208208 return `${ this . reviewQ . dequeueCount } Reviews, ${ this . newQ . dequeueCount } New, ${ this . failedQ . dequeueCount } failed` ;
209209 }
210210
211+ /**
212+ * Returns debug information about the current session state.
213+ * Used by SessionControllerDebug component for runtime inspection.
214+ */
215+ public getDebugInfo ( ) {
216+ const extractQueueItems = ( queue : ItemQueue < any > , limit : number = 10 ) => {
217+ const items = [ ] ;
218+ for ( let i = 0 ; i < Math . min ( queue . length , limit ) ; i ++ ) {
219+ const item = queue . peek ( i ) ;
220+ items . push ( {
221+ courseID : item . courseID || 'unknown' ,
222+ cardID : item . cardID || 'unknown' ,
223+ status : item . status || 'unknown' ,
224+ } ) ;
225+ }
226+ return items ;
227+ } ;
228+
229+ const extractHydratedItems = ( limit : number = 10 ) => {
230+ const items = [ ] ;
231+ const hydratedCount = this . hydrationService . hydratedCount ;
232+ // We can't easily iterate the hydrated queue without dequeuing,
233+ // so we'll just report the count
234+ return items ;
235+ } ;
236+
237+ return {
238+ reviewQueue : {
239+ length : this . reviewQ . length ,
240+ dequeueCount : this . reviewQ . dequeueCount ,
241+ items : extractQueueItems ( this . reviewQ ) ,
242+ } ,
243+ newQueue : {
244+ length : this . newQ . length ,
245+ dequeueCount : this . newQ . dequeueCount ,
246+ items : extractQueueItems ( this . newQ ) ,
247+ } ,
248+ failedQueue : {
249+ length : this . failedQ . length ,
250+ dequeueCount : this . failedQ . dequeueCount ,
251+ items : extractQueueItems ( this . failedQ ) ,
252+ } ,
253+ hydratedCache : {
254+ count : this . hydrationService . hydratedCount ,
255+ failedCacheSize : this . hydrationService . failedCacheSize ,
256+ items : extractHydratedItems ( ) ,
257+ } ,
258+ } ;
259+ }
260+
211261 private async getScheduledReviews ( ) {
212262 const reviews = await Promise . all (
213263 this . sources . map ( ( c ) =>
0 commit comments