@vue-skuilder/db 0.1.40 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -544,6 +544,19 @@ declare class SessionController<TView = unknown> extends Loggable {
544
544
  * know or care which strategy assigned the score.
545
545
  */
546
546
  private static readonly WELL_INDICATED_SCORE;
547
+ /**
548
+ * newQ length at or below which the opportunistic depletion-prefetch
549
+ * fires. Sets the lead time available for the background replan to land
550
+ * before the user actually empties the queue and falls into the
551
+ * (synchronous) wedge-breaker path.
552
+ *
553
+ * Set to a small absolute value (not a fraction of batch limit) because
554
+ * pipeline latency is roughly fixed regardless of batch size — what
555
+ * matters is "how many cards of user-pace do we have left." 3 cards
556
+ * × ~3-5s/card = ~10-15s of lead time, comfortably exceeding typical
557
+ * pipeline latency.
558
+ */
559
+ private static readonly DEPLETION_PREFETCH_THRESHOLD;
547
560
  /**
548
561
  * Internal replan execution. Runs the pipeline, builds a new newQ,
549
562
  * atomically swaps it in, and triggers hydration for the new contents.
package/dist/index.d.ts CHANGED
@@ -544,6 +544,19 @@ declare class SessionController<TView = unknown> extends Loggable {
544
544
  * know or care which strategy assigned the score.
545
545
  */
546
546
  private static readonly WELL_INDICATED_SCORE;
547
+ /**
548
+ * newQ length at or below which the opportunistic depletion-prefetch
549
+ * fires. Sets the lead time available for the background replan to land
550
+ * before the user actually empties the queue and falls into the
551
+ * (synchronous) wedge-breaker path.
552
+ *
553
+ * Set to a small absolute value (not a fraction of batch limit) because
554
+ * pipeline latency is roughly fixed regardless of batch size — what
555
+ * matters is "how many cards of user-pace do we have left." 3 cards
556
+ * × ~3-5s/card = ~10-15s of lead time, comfortably exceeding typical
557
+ * pipeline latency.
558
+ */
559
+ private static readonly DEPLETION_PREFETCH_THRESHOLD;
547
560
  /**
548
561
  * Internal replan execution. Runs the pipeline, builds a new newQ,
549
562
  * atomically swaps it in, and triggers hydration for the new contents.
package/dist/index.js CHANGED
@@ -9835,9 +9835,14 @@ var init_UserDBDebugger = __esm({
9835
9835
  */
9836
9836
  async showScheduledReviews(courseId) {
9837
9837
  const userDB = getUserDB();
9838
- if (!userDB) return;
9838
+ if (!userDB) {
9839
+ logger.info("[UserDB Debug] Data layer not available");
9840
+ return;
9841
+ }
9842
+ logger.info(`[UserDB Debug] Fetching pending reviews${courseId ? ` for course: ${courseId}` : ""}...`);
9839
9843
  try {
9840
9844
  const reviews = await userDB.getPendingReviews(courseId);
9845
+ logger.info(`[UserDB Debug] Got ${reviews.length} reviews`);
9841
9846
  console.group(`\u{1F4C5} Scheduled Reviews${courseId ? ` (${courseId})` : ""}`);
9842
9847
  logger.info(`Total: ${reviews.length}`);
9843
9848
  if (reviews.length > 0) {
@@ -13696,6 +13701,19 @@ var SessionController = class _SessionController extends Loggable {
13696
13701
  * know or care which strategy assigned the score.
13697
13702
  */
13698
13703
  static WELL_INDICATED_SCORE = 0.1;
13704
+ /**
13705
+ * newQ length at or below which the opportunistic depletion-prefetch
13706
+ * fires. Sets the lead time available for the background replan to land
13707
+ * before the user actually empties the queue and falls into the
13708
+ * (synchronous) wedge-breaker path.
13709
+ *
13710
+ * Set to a small absolute value (not a fraction of batch limit) because
13711
+ * pipeline latency is roughly fixed regardless of batch size — what
13712
+ * matters is "how many cards of user-pace do we have left." 3 cards
13713
+ * × ~3-5s/card = ~10-15s of lead time, comfortably exceeding typical
13714
+ * pipeline latency.
13715
+ */
13716
+ static DEPLETION_PREFETCH_THRESHOLD = 3;
13699
13717
  /**
13700
13718
  * Internal replan execution. Runs the pipeline, builds a new newQ,
13701
13719
  * atomically swaps it in, and triggers hydration for the new contents.
@@ -14002,7 +14020,7 @@ var SessionController = class _SessionController extends Loggable {
14002
14020
  this.log("nextCard: queues empty, awaiting in-flight replan before drawing");
14003
14021
  await this._replanPromise;
14004
14022
  }
14005
- if (this.newQ.length <= 1 && this._secondsRemaining > 0 && !this._replanPromise) {
14023
+ if (this.newQ.length <= _SessionController.DEPLETION_PREFETCH_THRESHOLD && this._secondsRemaining > 0 && !this._replanPromise) {
14006
14024
  this._suppressQualityReplan = false;
14007
14025
  const otherContent = this.reviewQ.length + this.failedQ.length;
14008
14026
  this.log(