@vue-skuilder/db 0.1.30 → 0.1.31-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.
@@ -592,6 +592,7 @@ var MAX_RUNS, runHistory, pipelineDebugAPI;
592
592
  var init_PipelineDebugger = __esm({
593
593
  "src/core/navigators/PipelineDebugger.ts"() {
594
594
  "use strict";
595
+ init_navigators();
595
596
  init_logger();
596
597
  MAX_RUNS = 10;
597
598
  runHistory = [];
@@ -734,6 +735,66 @@ var init_PipelineDebugger = __esm({
734
735
  runHistory.length = 0;
735
736
  logger.info("[Pipeline Debug] Run history cleared.");
736
737
  },
738
+ /**
739
+ * Show the navigator registry: all registered classes and their roles.
740
+ *
741
+ * Useful for verifying that consumer-defined navigators were registered
742
+ * before pipeline assembly.
743
+ */
744
+ showRegistry() {
745
+ const names = getRegisteredNavigatorNames();
746
+ if (names.length === 0) {
747
+ logger.info("[Pipeline Debug] Navigator registry is empty.");
748
+ return;
749
+ }
750
+ console.group("\u{1F4E6} Navigator Registry");
751
+ console.table(
752
+ names.map((name) => {
753
+ const registryRole = getRegisteredNavigatorRole(name);
754
+ const builtinRole = NavigatorRoles[name];
755
+ const effectiveRole = builtinRole || registryRole || "\u26A0\uFE0F NONE";
756
+ const source = builtinRole ? "built-in" : registryRole ? "consumer" : "unclassified";
757
+ return {
758
+ name,
759
+ role: effectiveRole,
760
+ source,
761
+ isGenerator: isGenerator(name),
762
+ isFilter: isFilter(name)
763
+ };
764
+ })
765
+ );
766
+ console.groupEnd();
767
+ },
768
+ /**
769
+ * Show strategy documents from the last pipeline run and how they mapped
770
+ * to the registry.
771
+ *
772
+ * If no runs are captured yet, falls back to showing just the registry.
773
+ */
774
+ showStrategies() {
775
+ this.showRegistry();
776
+ if (runHistory.length === 0) {
777
+ logger.info("[Pipeline Debug] No pipeline runs captured yet \u2014 cannot show strategy doc mapping.");
778
+ return;
779
+ }
780
+ const run = runHistory[0];
781
+ console.group("\u{1F50C} Pipeline Strategy Mapping (last run)");
782
+ logger.info(`Generator: ${run.generatorName}`);
783
+ if (run.generators && run.generators.length > 0) {
784
+ for (const g of run.generators) {
785
+ logger.info(` \u{1F4E5} ${g.name}: ${g.cardCount} cards (${g.newCount} new, ${g.reviewCount} reviews)`);
786
+ }
787
+ }
788
+ if (run.filters.length > 0) {
789
+ logger.info("Filters:");
790
+ for (const f of run.filters) {
791
+ logger.info(` \u{1F538} ${f.name}: \u2191${f.boosted} \u2193${f.penalized} =${f.passed} \u2715${f.removed}`);
792
+ }
793
+ } else {
794
+ logger.info("Filters: (none)");
795
+ }
796
+ console.groupEnd();
797
+ },
737
798
  /**
738
799
  * Show help.
739
800
  */
@@ -746,6 +807,8 @@ Commands:
746
807
  .showRun(id|index) Show summary of a specific run (by index or ID suffix)
747
808
  .showCard(cardId) Show provenance trail for a specific card
748
809
  .explainReviews() Analyze why reviews were/weren't selected
810
+ .showRegistry() Show navigator registry (classes + roles)
811
+ .showStrategies() Show registry + strategy mapping from last run
749
812
  .listRuns() List all captured runs in table format
750
813
  .export() Export run history as JSON for bug reports
751
814
  .clear() Clear run history
@@ -1008,19 +1071,20 @@ var init_elo = __esm({
1008
1071
  const scored = newCards.map((c, i) => {
1009
1072
  const cardElo = cardEloData[i]?.global?.score ?? 1e3;
1010
1073
  const distance = Math.abs(cardElo - userGlobalElo);
1011
- const score = Math.max(0, 1 - distance / 500);
1074
+ const rawScore = Math.max(0, 1 - distance / 500);
1075
+ const samplingKey = rawScore > 0 ? Math.random() ** (1 / rawScore) : 0;
1012
1076
  return {
1013
1077
  cardId: c.cardID,
1014
1078
  courseId: c.courseID,
1015
- score,
1079
+ score: samplingKey,
1016
1080
  provenance: [
1017
1081
  {
1018
1082
  strategy: "elo",
1019
1083
  strategyName: this.strategyName || this.name,
1020
1084
  strategyId: this.strategyId || "NAVIGATION_STRATEGY-ELO-default",
1021
1085
  action: "generated",
1022
- score,
1023
- reason: `ELO distance ${Math.round(distance)} (card: ${Math.round(cardElo)}, user: ${Math.round(userGlobalElo)}), new card`
1086
+ score: samplingKey,
1087
+ reason: `ELO distance ${Math.round(distance)} (card: ${Math.round(cardElo)}, user: ${Math.round(userGlobalElo)}), raw ${rawScore.toFixed(3)}, key ${samplingKey.toFixed(3)}`
1024
1088
  }
1025
1089
  ]
1026
1090
  };