@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.
@@ -1760,6 +1760,7 @@ var init_hierarchyDefinition = __esm({
1760
1760
  "src/core/navigators/filters/hierarchyDefinition.ts"() {
1761
1761
  "use strict";
1762
1762
  init_navigators();
1763
+ init_logger();
1763
1764
  DEFAULT_MIN_COUNT = 3;
1764
1765
  HierarchyDefinitionNavigator = class extends ContentNavigator {
1765
1766
  config;
@@ -1927,6 +1928,9 @@ var init_hierarchyDefinition = __esm({
1927
1928
  finalScore *= maxBoost;
1928
1929
  action = "boosted";
1929
1930
  finalReason = `${reason} | preReqBoost \xD7${maxBoost.toFixed(2)} for ${boostedPrereqs.join(", ")}`;
1931
+ logger.info(
1932
+ `[HierarchyDefinition] preReqBoost \xD7${maxBoost.toFixed(2)} applied to card ${card.cardId} via tags [${boostedPrereqs.join(", ")}] (score: ${card.score.toFixed(3)} \u2192 ${finalScore.toFixed(3)})`
1933
+ );
1930
1934
  }
1931
1935
  }
1932
1936
  gated.push({
@@ -2436,7 +2440,7 @@ var init_relativePriority = __esm({
2436
2440
  const cardTags = card.tags ?? [];
2437
2441
  const priority = this.computeCardPriority(cardTags);
2438
2442
  const boostFactor = this.computeBoostFactor(priority);
2439
- const finalScore = Math.max(0, Math.min(1, card.score * boostFactor));
2443
+ const finalScore = Math.max(0, card.score * boostFactor);
2440
2444
  const action = boostFactor > 1 ? "boosted" : boostFactor < 1 ? "penalized" : "passed";
2441
2445
  const reason = this.buildPriorityReason(cardTags, priority, boostFactor, finalScore);
2442
2446
  return {
@@ -3201,7 +3205,7 @@ var init_Pipeline = __esm({
3201
3205
  card.provenance.push({
3202
3206
  strategy: "ephemeralHint",
3203
3207
  strategyId: "ephemeral-hint",
3204
- strategyName: "Replan Hint",
3208
+ strategyName: hints._label ? `Replan Hint (${hints._label})` : "Replan Hint",
3205
3209
  action: "boosted",
3206
3210
  score: card.score,
3207
3211
  reason: `boostTag ${pattern} \xD7${factor}`
@@ -3218,7 +3222,7 @@ var init_Pipeline = __esm({
3218
3222
  card.provenance.push({
3219
3223
  strategy: "ephemeralHint",
3220
3224
  strategyId: "ephemeral-hint",
3221
- strategyName: "Replan Hint",
3225
+ strategyName: hints._label ? `Replan Hint (${hints._label})` : "Replan Hint",
3222
3226
  action: "boosted",
3223
3227
  score: card.score,
3224
3228
  reason: `boostCard ${pattern} \xD7${factor}`
@@ -3228,6 +3232,7 @@ var init_Pipeline = __esm({
3228
3232
  }
3229
3233
  }
3230
3234
  const cardIds = new Set(cards.map((c) => c.cardId));
3235
+ const hintLabel = hints._label ? `Replan Hint (${hints._label})` : "Replan Hint";
3231
3236
  const inject = (card, reason) => {
3232
3237
  if (!cardIds.has(card.cardId)) {
3233
3238
  const floorScore = Math.max(card.score, 1);
@@ -3239,7 +3244,7 @@ var init_Pipeline = __esm({
3239
3244
  {
3240
3245
  strategy: "ephemeralHint",
3241
3246
  strategyId: "ephemeral-hint",
3242
- strategyName: "Replan Hint",
3247
+ strategyName: hintLabel,
3243
3248
  action: "boosted",
3244
3249
  score: floorScore,
3245
3250
  reason
@@ -4448,10 +4453,18 @@ ${above.rows.map((r) => ` ${r.id}-${r.key}
4448
4453
  * @param limit - Maximum number of cards to return
4449
4454
  * @returns Cards sorted by score descending
4450
4455
  */
4456
+ _pendingHints = null;
4457
+ setEphemeralHints(hints) {
4458
+ this._pendingHints = hints;
4459
+ }
4451
4460
  async getWeightedCards(limit) {
4452
4461
  const u = await this._getCurrentUser();
4453
4462
  try {
4454
4463
  const navigator = await this.createNavigator(u);
4464
+ if (this._pendingHints) {
4465
+ navigator.setEphemeralHints(this._pendingHints);
4466
+ this._pendingHints = null;
4467
+ }
4455
4468
  return navigator.getWeightedCards(limit);
4456
4469
  } catch (e) {
4457
4470
  logger.error(`[courseDB] Error getting weighted cards: ${e}`);