@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/core/index.mjs
CHANGED
|
@@ -790,6 +790,7 @@ var MAX_RUNS, runHistory, pipelineDebugAPI;
|
|
|
790
790
|
var init_PipelineDebugger = __esm({
|
|
791
791
|
"src/core/navigators/PipelineDebugger.ts"() {
|
|
792
792
|
"use strict";
|
|
793
|
+
init_navigators();
|
|
793
794
|
init_logger();
|
|
794
795
|
MAX_RUNS = 10;
|
|
795
796
|
runHistory = [];
|
|
@@ -932,6 +933,66 @@ var init_PipelineDebugger = __esm({
|
|
|
932
933
|
runHistory.length = 0;
|
|
933
934
|
logger.info("[Pipeline Debug] Run history cleared.");
|
|
934
935
|
},
|
|
936
|
+
/**
|
|
937
|
+
* Show the navigator registry: all registered classes and their roles.
|
|
938
|
+
*
|
|
939
|
+
* Useful for verifying that consumer-defined navigators were registered
|
|
940
|
+
* before pipeline assembly.
|
|
941
|
+
*/
|
|
942
|
+
showRegistry() {
|
|
943
|
+
const names = getRegisteredNavigatorNames();
|
|
944
|
+
if (names.length === 0) {
|
|
945
|
+
logger.info("[Pipeline Debug] Navigator registry is empty.");
|
|
946
|
+
return;
|
|
947
|
+
}
|
|
948
|
+
console.group("\u{1F4E6} Navigator Registry");
|
|
949
|
+
console.table(
|
|
950
|
+
names.map((name) => {
|
|
951
|
+
const registryRole = getRegisteredNavigatorRole(name);
|
|
952
|
+
const builtinRole = NavigatorRoles[name];
|
|
953
|
+
const effectiveRole = builtinRole || registryRole || "\u26A0\uFE0F NONE";
|
|
954
|
+
const source = builtinRole ? "built-in" : registryRole ? "consumer" : "unclassified";
|
|
955
|
+
return {
|
|
956
|
+
name,
|
|
957
|
+
role: effectiveRole,
|
|
958
|
+
source,
|
|
959
|
+
isGenerator: isGenerator(name),
|
|
960
|
+
isFilter: isFilter(name)
|
|
961
|
+
};
|
|
962
|
+
})
|
|
963
|
+
);
|
|
964
|
+
console.groupEnd();
|
|
965
|
+
},
|
|
966
|
+
/**
|
|
967
|
+
* Show strategy documents from the last pipeline run and how they mapped
|
|
968
|
+
* to the registry.
|
|
969
|
+
*
|
|
970
|
+
* If no runs are captured yet, falls back to showing just the registry.
|
|
971
|
+
*/
|
|
972
|
+
showStrategies() {
|
|
973
|
+
this.showRegistry();
|
|
974
|
+
if (runHistory.length === 0) {
|
|
975
|
+
logger.info("[Pipeline Debug] No pipeline runs captured yet \u2014 cannot show strategy doc mapping.");
|
|
976
|
+
return;
|
|
977
|
+
}
|
|
978
|
+
const run = runHistory[0];
|
|
979
|
+
console.group("\u{1F50C} Pipeline Strategy Mapping (last run)");
|
|
980
|
+
logger.info(`Generator: ${run.generatorName}`);
|
|
981
|
+
if (run.generators && run.generators.length > 0) {
|
|
982
|
+
for (const g of run.generators) {
|
|
983
|
+
logger.info(` \u{1F4E5} ${g.name}: ${g.cardCount} cards (${g.newCount} new, ${g.reviewCount} reviews)`);
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
if (run.filters.length > 0) {
|
|
987
|
+
logger.info("Filters:");
|
|
988
|
+
for (const f of run.filters) {
|
|
989
|
+
logger.info(` \u{1F538} ${f.name}: \u2191${f.boosted} \u2193${f.penalized} =${f.passed} \u2715${f.removed}`);
|
|
990
|
+
}
|
|
991
|
+
} else {
|
|
992
|
+
logger.info("Filters: (none)");
|
|
993
|
+
}
|
|
994
|
+
console.groupEnd();
|
|
995
|
+
},
|
|
935
996
|
/**
|
|
936
997
|
* Show help.
|
|
937
998
|
*/
|
|
@@ -944,6 +1005,8 @@ Commands:
|
|
|
944
1005
|
.showRun(id|index) Show summary of a specific run (by index or ID suffix)
|
|
945
1006
|
.showCard(cardId) Show provenance trail for a specific card
|
|
946
1007
|
.explainReviews() Analyze why reviews were/weren't selected
|
|
1008
|
+
.showRegistry() Show navigator registry (classes + roles)
|
|
1009
|
+
.showStrategies() Show registry + strategy mapping from last run
|
|
947
1010
|
.listRuns() List all captured runs in table format
|
|
948
1011
|
.export() Export run history as JSON for bug reports
|
|
949
1012
|
.clear() Clear run history
|
|
@@ -1206,19 +1269,20 @@ var init_elo = __esm({
|
|
|
1206
1269
|
const scored = newCards.map((c, i) => {
|
|
1207
1270
|
const cardElo = cardEloData[i]?.global?.score ?? 1e3;
|
|
1208
1271
|
const distance = Math.abs(cardElo - userGlobalElo);
|
|
1209
|
-
const
|
|
1272
|
+
const rawScore = Math.max(0, 1 - distance / 500);
|
|
1273
|
+
const samplingKey = rawScore > 0 ? Math.random() ** (1 / rawScore) : 0;
|
|
1210
1274
|
return {
|
|
1211
1275
|
cardId: c.cardID,
|
|
1212
1276
|
courseId: c.courseID,
|
|
1213
|
-
score,
|
|
1277
|
+
score: samplingKey,
|
|
1214
1278
|
provenance: [
|
|
1215
1279
|
{
|
|
1216
1280
|
strategy: "elo",
|
|
1217
1281
|
strategyName: this.strategyName || this.name,
|
|
1218
1282
|
strategyId: this.strategyId || "NAVIGATION_STRATEGY-ELO-default",
|
|
1219
1283
|
action: "generated",
|
|
1220
|
-
score,
|
|
1221
|
-
reason: `ELO distance ${Math.round(distance)} (card: ${Math.round(cardElo)}, user: ${Math.round(userGlobalElo)}),
|
|
1284
|
+
score: samplingKey,
|
|
1285
|
+
reason: `ELO distance ${Math.round(distance)} (card: ${Math.round(cardElo)}, user: ${Math.round(userGlobalElo)}), raw ${rawScore.toFixed(3)}, key ${samplingKey.toFixed(3)}`
|
|
1222
1286
|
}
|
|
1223
1287
|
]
|
|
1224
1288
|
};
|