@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.
- package/dist/core/index.d.cts +14 -0
- package/dist/core/index.d.ts +14 -0
- package/dist/core/index.js +68 -4
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +68 -4
- package/dist/core/index.mjs.map +1 -1
- package/dist/impl/couch/index.js +68 -4
- package/dist/impl/couch/index.js.map +1 -1
- package/dist/impl/couch/index.mjs +68 -4
- package/dist/impl/couch/index.mjs.map +1 -1
- package/dist/impl/static/index.js +68 -4
- package/dist/impl/static/index.js.map +1 -1
- package/dist/impl/static/index.mjs +68 -4
- package/dist/impl/static/index.mjs.map +1 -1
- package/dist/index.js +83 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +74 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/core/navigators/PipelineDebugger.ts +80 -0
- package/src/core/navigators/generators/elo.ts +17 -6
- package/src/study/SpacedRepetition.ts +4 -1
|
@@ -715,6 +715,7 @@ var MAX_RUNS, runHistory, pipelineDebugAPI;
|
|
|
715
715
|
var init_PipelineDebugger = __esm({
|
|
716
716
|
"src/core/navigators/PipelineDebugger.ts"() {
|
|
717
717
|
"use strict";
|
|
718
|
+
init_navigators();
|
|
718
719
|
init_logger();
|
|
719
720
|
MAX_RUNS = 10;
|
|
720
721
|
runHistory = [];
|
|
@@ -857,6 +858,66 @@ var init_PipelineDebugger = __esm({
|
|
|
857
858
|
runHistory.length = 0;
|
|
858
859
|
logger.info("[Pipeline Debug] Run history cleared.");
|
|
859
860
|
},
|
|
861
|
+
/**
|
|
862
|
+
* Show the navigator registry: all registered classes and their roles.
|
|
863
|
+
*
|
|
864
|
+
* Useful for verifying that consumer-defined navigators were registered
|
|
865
|
+
* before pipeline assembly.
|
|
866
|
+
*/
|
|
867
|
+
showRegistry() {
|
|
868
|
+
const names = getRegisteredNavigatorNames();
|
|
869
|
+
if (names.length === 0) {
|
|
870
|
+
logger.info("[Pipeline Debug] Navigator registry is empty.");
|
|
871
|
+
return;
|
|
872
|
+
}
|
|
873
|
+
console.group("\u{1F4E6} Navigator Registry");
|
|
874
|
+
console.table(
|
|
875
|
+
names.map((name) => {
|
|
876
|
+
const registryRole = getRegisteredNavigatorRole(name);
|
|
877
|
+
const builtinRole = NavigatorRoles[name];
|
|
878
|
+
const effectiveRole = builtinRole || registryRole || "\u26A0\uFE0F NONE";
|
|
879
|
+
const source = builtinRole ? "built-in" : registryRole ? "consumer" : "unclassified";
|
|
880
|
+
return {
|
|
881
|
+
name,
|
|
882
|
+
role: effectiveRole,
|
|
883
|
+
source,
|
|
884
|
+
isGenerator: isGenerator(name),
|
|
885
|
+
isFilter: isFilter(name)
|
|
886
|
+
};
|
|
887
|
+
})
|
|
888
|
+
);
|
|
889
|
+
console.groupEnd();
|
|
890
|
+
},
|
|
891
|
+
/**
|
|
892
|
+
* Show strategy documents from the last pipeline run and how they mapped
|
|
893
|
+
* to the registry.
|
|
894
|
+
*
|
|
895
|
+
* If no runs are captured yet, falls back to showing just the registry.
|
|
896
|
+
*/
|
|
897
|
+
showStrategies() {
|
|
898
|
+
this.showRegistry();
|
|
899
|
+
if (runHistory.length === 0) {
|
|
900
|
+
logger.info("[Pipeline Debug] No pipeline runs captured yet \u2014 cannot show strategy doc mapping.");
|
|
901
|
+
return;
|
|
902
|
+
}
|
|
903
|
+
const run = runHistory[0];
|
|
904
|
+
console.group("\u{1F50C} Pipeline Strategy Mapping (last run)");
|
|
905
|
+
logger.info(`Generator: ${run.generatorName}`);
|
|
906
|
+
if (run.generators && run.generators.length > 0) {
|
|
907
|
+
for (const g of run.generators) {
|
|
908
|
+
logger.info(` \u{1F4E5} ${g.name}: ${g.cardCount} cards (${g.newCount} new, ${g.reviewCount} reviews)`);
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
if (run.filters.length > 0) {
|
|
912
|
+
logger.info("Filters:");
|
|
913
|
+
for (const f of run.filters) {
|
|
914
|
+
logger.info(` \u{1F538} ${f.name}: \u2191${f.boosted} \u2193${f.penalized} =${f.passed} \u2715${f.removed}`);
|
|
915
|
+
}
|
|
916
|
+
} else {
|
|
917
|
+
logger.info("Filters: (none)");
|
|
918
|
+
}
|
|
919
|
+
console.groupEnd();
|
|
920
|
+
},
|
|
860
921
|
/**
|
|
861
922
|
* Show help.
|
|
862
923
|
*/
|
|
@@ -869,6 +930,8 @@ Commands:
|
|
|
869
930
|
.showRun(id|index) Show summary of a specific run (by index or ID suffix)
|
|
870
931
|
.showCard(cardId) Show provenance trail for a specific card
|
|
871
932
|
.explainReviews() Analyze why reviews were/weren't selected
|
|
933
|
+
.showRegistry() Show navigator registry (classes + roles)
|
|
934
|
+
.showStrategies() Show registry + strategy mapping from last run
|
|
872
935
|
.listRuns() List all captured runs in table format
|
|
873
936
|
.export() Export run history as JSON for bug reports
|
|
874
937
|
.clear() Clear run history
|
|
@@ -1131,19 +1194,20 @@ var init_elo = __esm({
|
|
|
1131
1194
|
const scored = newCards.map((c, i) => {
|
|
1132
1195
|
const cardElo = cardEloData[i]?.global?.score ?? 1e3;
|
|
1133
1196
|
const distance = Math.abs(cardElo - userGlobalElo);
|
|
1134
|
-
const
|
|
1197
|
+
const rawScore = Math.max(0, 1 - distance / 500);
|
|
1198
|
+
const samplingKey = rawScore > 0 ? Math.random() ** (1 / rawScore) : 0;
|
|
1135
1199
|
return {
|
|
1136
1200
|
cardId: c.cardID,
|
|
1137
1201
|
courseId: c.courseID,
|
|
1138
|
-
score,
|
|
1202
|
+
score: samplingKey,
|
|
1139
1203
|
provenance: [
|
|
1140
1204
|
{
|
|
1141
1205
|
strategy: "elo",
|
|
1142
1206
|
strategyName: this.strategyName || this.name,
|
|
1143
1207
|
strategyId: this.strategyId || "NAVIGATION_STRATEGY-ELO-default",
|
|
1144
1208
|
action: "generated",
|
|
1145
|
-
score,
|
|
1146
|
-
reason: `ELO distance ${Math.round(distance)} (card: ${Math.round(cardElo)}, user: ${Math.round(userGlobalElo)}),
|
|
1209
|
+
score: samplingKey,
|
|
1210
|
+
reason: `ELO distance ${Math.round(distance)} (card: ${Math.round(cardElo)}, user: ${Math.round(userGlobalElo)}), raw ${rawScore.toFixed(3)}, key ${samplingKey.toFixed(3)}`
|
|
1147
1211
|
}
|
|
1148
1212
|
]
|
|
1149
1213
|
};
|