@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
package/dist/impl/couch/index.js
CHANGED
|
@@ -737,6 +737,7 @@ var MAX_RUNS, runHistory, pipelineDebugAPI;
|
|
|
737
737
|
var init_PipelineDebugger = __esm({
|
|
738
738
|
"src/core/navigators/PipelineDebugger.ts"() {
|
|
739
739
|
"use strict";
|
|
740
|
+
init_navigators();
|
|
740
741
|
init_logger();
|
|
741
742
|
MAX_RUNS = 10;
|
|
742
743
|
runHistory = [];
|
|
@@ -879,6 +880,66 @@ var init_PipelineDebugger = __esm({
|
|
|
879
880
|
runHistory.length = 0;
|
|
880
881
|
logger.info("[Pipeline Debug] Run history cleared.");
|
|
881
882
|
},
|
|
883
|
+
/**
|
|
884
|
+
* Show the navigator registry: all registered classes and their roles.
|
|
885
|
+
*
|
|
886
|
+
* Useful for verifying that consumer-defined navigators were registered
|
|
887
|
+
* before pipeline assembly.
|
|
888
|
+
*/
|
|
889
|
+
showRegistry() {
|
|
890
|
+
const names = getRegisteredNavigatorNames();
|
|
891
|
+
if (names.length === 0) {
|
|
892
|
+
logger.info("[Pipeline Debug] Navigator registry is empty.");
|
|
893
|
+
return;
|
|
894
|
+
}
|
|
895
|
+
console.group("\u{1F4E6} Navigator Registry");
|
|
896
|
+
console.table(
|
|
897
|
+
names.map((name) => {
|
|
898
|
+
const registryRole = getRegisteredNavigatorRole(name);
|
|
899
|
+
const builtinRole = NavigatorRoles[name];
|
|
900
|
+
const effectiveRole = builtinRole || registryRole || "\u26A0\uFE0F NONE";
|
|
901
|
+
const source = builtinRole ? "built-in" : registryRole ? "consumer" : "unclassified";
|
|
902
|
+
return {
|
|
903
|
+
name,
|
|
904
|
+
role: effectiveRole,
|
|
905
|
+
source,
|
|
906
|
+
isGenerator: isGenerator(name),
|
|
907
|
+
isFilter: isFilter(name)
|
|
908
|
+
};
|
|
909
|
+
})
|
|
910
|
+
);
|
|
911
|
+
console.groupEnd();
|
|
912
|
+
},
|
|
913
|
+
/**
|
|
914
|
+
* Show strategy documents from the last pipeline run and how they mapped
|
|
915
|
+
* to the registry.
|
|
916
|
+
*
|
|
917
|
+
* If no runs are captured yet, falls back to showing just the registry.
|
|
918
|
+
*/
|
|
919
|
+
showStrategies() {
|
|
920
|
+
this.showRegistry();
|
|
921
|
+
if (runHistory.length === 0) {
|
|
922
|
+
logger.info("[Pipeline Debug] No pipeline runs captured yet \u2014 cannot show strategy doc mapping.");
|
|
923
|
+
return;
|
|
924
|
+
}
|
|
925
|
+
const run = runHistory[0];
|
|
926
|
+
console.group("\u{1F50C} Pipeline Strategy Mapping (last run)");
|
|
927
|
+
logger.info(`Generator: ${run.generatorName}`);
|
|
928
|
+
if (run.generators && run.generators.length > 0) {
|
|
929
|
+
for (const g of run.generators) {
|
|
930
|
+
logger.info(` \u{1F4E5} ${g.name}: ${g.cardCount} cards (${g.newCount} new, ${g.reviewCount} reviews)`);
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
if (run.filters.length > 0) {
|
|
934
|
+
logger.info("Filters:");
|
|
935
|
+
for (const f of run.filters) {
|
|
936
|
+
logger.info(` \u{1F538} ${f.name}: \u2191${f.boosted} \u2193${f.penalized} =${f.passed} \u2715${f.removed}`);
|
|
937
|
+
}
|
|
938
|
+
} else {
|
|
939
|
+
logger.info("Filters: (none)");
|
|
940
|
+
}
|
|
941
|
+
console.groupEnd();
|
|
942
|
+
},
|
|
882
943
|
/**
|
|
883
944
|
* Show help.
|
|
884
945
|
*/
|
|
@@ -891,6 +952,8 @@ Commands:
|
|
|
891
952
|
.showRun(id|index) Show summary of a specific run (by index or ID suffix)
|
|
892
953
|
.showCard(cardId) Show provenance trail for a specific card
|
|
893
954
|
.explainReviews() Analyze why reviews were/weren't selected
|
|
955
|
+
.showRegistry() Show navigator registry (classes + roles)
|
|
956
|
+
.showStrategies() Show registry + strategy mapping from last run
|
|
894
957
|
.listRuns() List all captured runs in table format
|
|
895
958
|
.export() Export run history as JSON for bug reports
|
|
896
959
|
.clear() Clear run history
|
|
@@ -1153,19 +1216,20 @@ var init_elo = __esm({
|
|
|
1153
1216
|
const scored = newCards.map((c, i) => {
|
|
1154
1217
|
const cardElo = cardEloData[i]?.global?.score ?? 1e3;
|
|
1155
1218
|
const distance = Math.abs(cardElo - userGlobalElo);
|
|
1156
|
-
const
|
|
1219
|
+
const rawScore = Math.max(0, 1 - distance / 500);
|
|
1220
|
+
const samplingKey = rawScore > 0 ? Math.random() ** (1 / rawScore) : 0;
|
|
1157
1221
|
return {
|
|
1158
1222
|
cardId: c.cardID,
|
|
1159
1223
|
courseId: c.courseID,
|
|
1160
|
-
score,
|
|
1224
|
+
score: samplingKey,
|
|
1161
1225
|
provenance: [
|
|
1162
1226
|
{
|
|
1163
1227
|
strategy: "elo",
|
|
1164
1228
|
strategyName: this.strategyName || this.name,
|
|
1165
1229
|
strategyId: this.strategyId || "NAVIGATION_STRATEGY-ELO-default",
|
|
1166
1230
|
action: "generated",
|
|
1167
|
-
score,
|
|
1168
|
-
reason: `ELO distance ${Math.round(distance)} (card: ${Math.round(cardElo)}, user: ${Math.round(userGlobalElo)}),
|
|
1231
|
+
score: samplingKey,
|
|
1232
|
+
reason: `ELO distance ${Math.round(distance)} (card: ${Math.round(cardElo)}, user: ${Math.round(userGlobalElo)}), raw ${rawScore.toFixed(3)}, key ${samplingKey.toFixed(3)}`
|
|
1169
1233
|
}
|
|
1170
1234
|
]
|
|
1171
1235
|
};
|