@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.
@@ -1685,6 +1685,7 @@ var init_hierarchyDefinition = __esm({
1685
1685
  "src/core/navigators/filters/hierarchyDefinition.ts"() {
1686
1686
  "use strict";
1687
1687
  init_navigators();
1688
+ init_logger();
1688
1689
  DEFAULT_MIN_COUNT = 3;
1689
1690
  HierarchyDefinitionNavigator = class extends ContentNavigator {
1690
1691
  config;
@@ -1852,6 +1853,9 @@ var init_hierarchyDefinition = __esm({
1852
1853
  finalScore *= maxBoost;
1853
1854
  action = "boosted";
1854
1855
  finalReason = `${reason} | preReqBoost \xD7${maxBoost.toFixed(2)} for ${boostedPrereqs.join(", ")}`;
1856
+ logger.info(
1857
+ `[HierarchyDefinition] preReqBoost \xD7${maxBoost.toFixed(2)} applied to card ${card.cardId} via tags [${boostedPrereqs.join(", ")}] (score: ${card.score.toFixed(3)} \u2192 ${finalScore.toFixed(3)})`
1858
+ );
1855
1859
  }
1856
1860
  }
1857
1861
  gated.push({
@@ -2361,7 +2365,7 @@ var init_relativePriority = __esm({
2361
2365
  const cardTags = card.tags ?? [];
2362
2366
  const priority = this.computeCardPriority(cardTags);
2363
2367
  const boostFactor = this.computeBoostFactor(priority);
2364
- const finalScore = Math.max(0, Math.min(1, card.score * boostFactor));
2368
+ const finalScore = Math.max(0, card.score * boostFactor);
2365
2369
  const action = boostFactor > 1 ? "boosted" : boostFactor < 1 ? "penalized" : "passed";
2366
2370
  const reason = this.buildPriorityReason(cardTags, priority, boostFactor, finalScore);
2367
2371
  return {
@@ -2880,7 +2884,7 @@ var init_Pipeline = __esm({
2880
2884
  card.provenance.push({
2881
2885
  strategy: "ephemeralHint",
2882
2886
  strategyId: "ephemeral-hint",
2883
- strategyName: "Replan Hint",
2887
+ strategyName: hints._label ? `Replan Hint (${hints._label})` : "Replan Hint",
2884
2888
  action: "boosted",
2885
2889
  score: card.score,
2886
2890
  reason: `boostTag ${pattern} \xD7${factor}`
@@ -2897,7 +2901,7 @@ var init_Pipeline = __esm({
2897
2901
  card.provenance.push({
2898
2902
  strategy: "ephemeralHint",
2899
2903
  strategyId: "ephemeral-hint",
2900
- strategyName: "Replan Hint",
2904
+ strategyName: hints._label ? `Replan Hint (${hints._label})` : "Replan Hint",
2901
2905
  action: "boosted",
2902
2906
  score: card.score,
2903
2907
  reason: `boostCard ${pattern} \xD7${factor}`
@@ -2907,6 +2911,7 @@ var init_Pipeline = __esm({
2907
2911
  }
2908
2912
  }
2909
2913
  const cardIds = new Set(cards.map((c) => c.cardId));
2914
+ const hintLabel = hints._label ? `Replan Hint (${hints._label})` : "Replan Hint";
2910
2915
  const inject = (card, reason) => {
2911
2916
  if (!cardIds.has(card.cardId)) {
2912
2917
  const floorScore = Math.max(card.score, 1);
@@ -2918,7 +2923,7 @@ var init_Pipeline = __esm({
2918
2923
  {
2919
2924
  strategy: "ephemeralHint",
2920
2925
  strategyId: "ephemeral-hint",
2921
- strategyName: "Replan Hint",
2926
+ strategyName: hintLabel,
2922
2927
  action: "boosted",
2923
2928
  score: floorScore,
2924
2929
  reason
@@ -4214,10 +4219,18 @@ ${above.rows.map((r) => ` ${r.id}-${r.key}
4214
4219
  * @param limit - Maximum number of cards to return
4215
4220
  * @returns Cards sorted by score descending
4216
4221
  */
4222
+ _pendingHints = null;
4223
+ setEphemeralHints(hints) {
4224
+ this._pendingHints = hints;
4225
+ }
4217
4226
  async getWeightedCards(limit) {
4218
4227
  const u = await this._getCurrentUser();
4219
4228
  try {
4220
4229
  const navigator = await this.createNavigator(u);
4230
+ if (this._pendingHints) {
4231
+ navigator.setEphemeralHints(this._pendingHints);
4232
+ this._pendingHints = null;
4233
+ }
4221
4234
  return navigator.getWeightedCards(limit);
4222
4235
  } catch (e) {
4223
4236
  logger.error(`[courseDB] Error getting weighted cards: ${e}`);