@vue-skuilder/db 0.1.31 → 0.1.32-b

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.
@@ -174,6 +174,8 @@ declare class StaticCourseDB implements CourseDBInterface {
174
174
  * to build a Pipeline. Falls back to default pipeline if no strategies found.
175
175
  */
176
176
  createNavigator(user: UserDBInterface): Promise<ContentNavigator>;
177
+ private _pendingHints;
178
+ setEphemeralHints(hints: Record<string, unknown>): void;
177
179
  getWeightedCards(limit: number): Promise<WeightedCard[]>;
178
180
  /**
179
181
  * Get attachment URL for a document and attachment name
@@ -174,6 +174,8 @@ declare class StaticCourseDB implements CourseDBInterface {
174
174
  * to build a Pipeline. Falls back to default pipeline if no strategies found.
175
175
  */
176
176
  createNavigator(user: UserDBInterface): Promise<ContentNavigator>;
177
+ private _pendingHints;
178
+ setEphemeralHints(hints: Record<string, unknown>): void;
177
179
  getWeightedCards(limit: number): Promise<WeightedCard[]>;
178
180
  /**
179
181
  * Get attachment URL for a document and attachment name
@@ -1586,6 +1586,7 @@ var init_hierarchyDefinition = __esm({
1586
1586
  "use strict";
1587
1587
  init_navigators();
1588
1588
  import_common6 = require("@vue-skuilder/common");
1589
+ init_logger();
1589
1590
  DEFAULT_MIN_COUNT = 3;
1590
1591
  HierarchyDefinitionNavigator = class extends ContentNavigator {
1591
1592
  config;
@@ -1753,6 +1754,9 @@ var init_hierarchyDefinition = __esm({
1753
1754
  finalScore *= maxBoost;
1754
1755
  action = "boosted";
1755
1756
  finalReason = `${reason} | preReqBoost \xD7${maxBoost.toFixed(2)} for ${boostedPrereqs.join(", ")}`;
1757
+ logger.info(
1758
+ `[HierarchyDefinition] preReqBoost \xD7${maxBoost.toFixed(2)} applied to card ${card.cardId} via tags [${boostedPrereqs.join(", ")}] (score: ${card.score.toFixed(3)} \u2192 ${finalScore.toFixed(3)})`
1759
+ );
1756
1760
  }
1757
1761
  }
1758
1762
  gated.push({
@@ -2262,7 +2266,7 @@ var init_relativePriority = __esm({
2262
2266
  const cardTags = card.tags ?? [];
2263
2267
  const priority = this.computeCardPriority(cardTags);
2264
2268
  const boostFactor = this.computeBoostFactor(priority);
2265
- const finalScore = Math.max(0, Math.min(1, card.score * boostFactor));
2269
+ const finalScore = Math.max(0, card.score * boostFactor);
2266
2270
  const action = boostFactor > 1 ? "boosted" : boostFactor < 1 ? "penalized" : "passed";
2267
2271
  const reason = this.buildPriorityReason(cardTags, priority, boostFactor, finalScore);
2268
2272
  return {
@@ -2781,7 +2785,7 @@ var init_Pipeline = __esm({
2781
2785
  card.provenance.push({
2782
2786
  strategy: "ephemeralHint",
2783
2787
  strategyId: "ephemeral-hint",
2784
- strategyName: "Replan Hint",
2788
+ strategyName: hints._label ? `Replan Hint (${hints._label})` : "Replan Hint",
2785
2789
  action: "boosted",
2786
2790
  score: card.score,
2787
2791
  reason: `boostTag ${pattern} \xD7${factor}`
@@ -2798,7 +2802,7 @@ var init_Pipeline = __esm({
2798
2802
  card.provenance.push({
2799
2803
  strategy: "ephemeralHint",
2800
2804
  strategyId: "ephemeral-hint",
2801
- strategyName: "Replan Hint",
2805
+ strategyName: hints._label ? `Replan Hint (${hints._label})` : "Replan Hint",
2802
2806
  action: "boosted",
2803
2807
  score: card.score,
2804
2808
  reason: `boostCard ${pattern} \xD7${factor}`
@@ -2808,6 +2812,7 @@ var init_Pipeline = __esm({
2808
2812
  }
2809
2813
  }
2810
2814
  const cardIds = new Set(cards.map((c) => c.cardId));
2815
+ const hintLabel = hints._label ? `Replan Hint (${hints._label})` : "Replan Hint";
2811
2816
  const inject = (card, reason) => {
2812
2817
  if (!cardIds.has(card.cardId)) {
2813
2818
  const floorScore = Math.max(card.score, 1);
@@ -2819,7 +2824,7 @@ var init_Pipeline = __esm({
2819
2824
  {
2820
2825
  strategy: "ephemeralHint",
2821
2826
  strategyId: "ephemeral-hint",
2822
- strategyName: "Replan Hint",
2827
+ strategyName: hintLabel,
2823
2828
  action: "boosted",
2824
2829
  score: floorScore,
2825
2830
  reason
@@ -5924,9 +5929,17 @@ var init_courseDB3 = __esm({
5924
5929
  }
5925
5930
  }
5926
5931
  // Study Content Source implementation
5932
+ _pendingHints = null;
5933
+ setEphemeralHints(hints) {
5934
+ this._pendingHints = hints;
5935
+ }
5927
5936
  async getWeightedCards(limit) {
5928
5937
  try {
5929
5938
  const navigator = await this.createNavigator(this.userDB);
5939
+ if (this._pendingHints) {
5940
+ navigator.setEphemeralHints(this._pendingHints);
5941
+ this._pendingHints = null;
5942
+ }
5930
5943
  return navigator.getWeightedCards(limit);
5931
5944
  } catch (e) {
5932
5945
  logger.error(`[static/courseDB] Error getting weighted cards: ${e}`);