@vue-skuilder/db 0.1.30 → 0.1.31-a

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.
@@ -1008,19 +1008,20 @@ var init_elo = __esm({
1008
1008
  const scored = newCards.map((c, i) => {
1009
1009
  const cardElo = cardEloData[i]?.global?.score ?? 1e3;
1010
1010
  const distance = Math.abs(cardElo - userGlobalElo);
1011
- const score = Math.max(0, 1 - distance / 500);
1011
+ const rawScore = Math.max(0, 1 - distance / 500);
1012
+ const samplingKey = rawScore > 0 ? Math.random() ** (1 / rawScore) : 0;
1012
1013
  return {
1013
1014
  cardId: c.cardID,
1014
1015
  courseId: c.courseID,
1015
- score,
1016
+ score: samplingKey,
1016
1017
  provenance: [
1017
1018
  {
1018
1019
  strategy: "elo",
1019
1020
  strategyName: this.strategyName || this.name,
1020
1021
  strategyId: this.strategyId || "NAVIGATION_STRATEGY-ELO-default",
1021
1022
  action: "generated",
1022
- score,
1023
- reason: `ELO distance ${Math.round(distance)} (card: ${Math.round(cardElo)}, user: ${Math.round(userGlobalElo)}), new card`
1023
+ score: samplingKey,
1024
+ reason: `ELO distance ${Math.round(distance)} (card: ${Math.round(cardElo)}, user: ${Math.round(userGlobalElo)}), raw ${rawScore.toFixed(3)}, key ${samplingKey.toFixed(3)}`
1024
1025
  }
1025
1026
  ]
1026
1027
  };
@@ -2713,7 +2714,6 @@ __export(navigators_exports, {
2713
2714
  getCardOrigin: () => getCardOrigin,
2714
2715
  getRegisteredNavigator: () => getRegisteredNavigator,
2715
2716
  getRegisteredNavigatorNames: () => getRegisteredNavigatorNames,
2716
- getRegisteredNavigatorRole: () => getRegisteredNavigatorRole,
2717
2717
  hasRegisteredNavigator: () => hasRegisteredNavigator,
2718
2718
  initializeNavigatorRegistry: () => initializeNavigatorRegistry,
2719
2719
  isFilter: () => isFilter,
@@ -2722,19 +2722,16 @@ __export(navigators_exports, {
2722
2722
  pipelineDebugAPI: () => pipelineDebugAPI,
2723
2723
  registerNavigator: () => registerNavigator
2724
2724
  });
2725
- function registerNavigator(implementingClass, constructor, role) {
2726
- navigatorRegistry.set(implementingClass, { constructor, role });
2727
- logger.debug(`[NavigatorRegistry] Registered: ${implementingClass}${role ? ` (${role})` : ""}`);
2725
+ function registerNavigator(implementingClass, constructor) {
2726
+ navigatorRegistry.set(implementingClass, constructor);
2727
+ logger.debug(`[NavigatorRegistry] Registered: ${implementingClass}`);
2728
2728
  }
2729
2729
  function getRegisteredNavigator(implementingClass) {
2730
- return navigatorRegistry.get(implementingClass)?.constructor;
2730
+ return navigatorRegistry.get(implementingClass);
2731
2731
  }
2732
2732
  function hasRegisteredNavigator(implementingClass) {
2733
2733
  return navigatorRegistry.has(implementingClass);
2734
2734
  }
2735
- function getRegisteredNavigatorRole(implementingClass) {
2736
- return navigatorRegistry.get(implementingClass)?.role;
2737
- }
2738
2735
  function getRegisteredNavigatorNames() {
2739
2736
  return Array.from(navigatorRegistry.keys());
2740
2737
  }
@@ -2780,12 +2777,10 @@ function getCardOrigin(card) {
2780
2777
  return "new";
2781
2778
  }
2782
2779
  function isGenerator(impl) {
2783
- if (NavigatorRoles[impl] === "generator" /* GENERATOR */) return true;
2784
- return getRegisteredNavigatorRole(impl) === "generator" /* GENERATOR */;
2780
+ return NavigatorRoles[impl] === "generator" /* GENERATOR */;
2785
2781
  }
2786
2782
  function isFilter(impl) {
2787
- if (NavigatorRoles[impl] === "filter" /* FILTER */) return true;
2788
- return getRegisteredNavigatorRole(impl) === "filter" /* FILTER */;
2783
+ return NavigatorRoles[impl] === "filter" /* FILTER */;
2789
2784
  }
2790
2785
  var navigatorRegistry, Navigators, NavigatorRole, NavigatorRoles, ContentNavigator;
2791
2786
  var init_navigators = __esm({