@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.d.cts
CHANGED
|
@@ -463,6 +463,20 @@ declare const pipelineDebugAPI: {
|
|
|
463
463
|
* Clear run history.
|
|
464
464
|
*/
|
|
465
465
|
clear(): void;
|
|
466
|
+
/**
|
|
467
|
+
* Show the navigator registry: all registered classes and their roles.
|
|
468
|
+
*
|
|
469
|
+
* Useful for verifying that consumer-defined navigators were registered
|
|
470
|
+
* before pipeline assembly.
|
|
471
|
+
*/
|
|
472
|
+
showRegistry(): void;
|
|
473
|
+
/**
|
|
474
|
+
* Show strategy documents from the last pipeline run and how they mapped
|
|
475
|
+
* to the registry.
|
|
476
|
+
*
|
|
477
|
+
* If no runs are captured yet, falls back to showing just the registry.
|
|
478
|
+
*/
|
|
479
|
+
showStrategies(): void;
|
|
466
480
|
/**
|
|
467
481
|
* Show help.
|
|
468
482
|
*/
|
package/dist/core/index.d.ts
CHANGED
|
@@ -463,6 +463,20 @@ declare const pipelineDebugAPI: {
|
|
|
463
463
|
* Clear run history.
|
|
464
464
|
*/
|
|
465
465
|
clear(): void;
|
|
466
|
+
/**
|
|
467
|
+
* Show the navigator registry: all registered classes and their roles.
|
|
468
|
+
*
|
|
469
|
+
* Useful for verifying that consumer-defined navigators were registered
|
|
470
|
+
* before pipeline assembly.
|
|
471
|
+
*/
|
|
472
|
+
showRegistry(): void;
|
|
473
|
+
/**
|
|
474
|
+
* Show strategy documents from the last pipeline run and how they mapped
|
|
475
|
+
* to the registry.
|
|
476
|
+
*
|
|
477
|
+
* If no runs are captured yet, falls back to showing just the registry.
|
|
478
|
+
*/
|
|
479
|
+
showStrategies(): void;
|
|
466
480
|
/**
|
|
467
481
|
* Show help.
|
|
468
482
|
*/
|
package/dist/core/index.js
CHANGED
|
@@ -813,6 +813,7 @@ var MAX_RUNS, runHistory, pipelineDebugAPI;
|
|
|
813
813
|
var init_PipelineDebugger = __esm({
|
|
814
814
|
"src/core/navigators/PipelineDebugger.ts"() {
|
|
815
815
|
"use strict";
|
|
816
|
+
init_navigators();
|
|
816
817
|
init_logger();
|
|
817
818
|
MAX_RUNS = 10;
|
|
818
819
|
runHistory = [];
|
|
@@ -955,6 +956,66 @@ var init_PipelineDebugger = __esm({
|
|
|
955
956
|
runHistory.length = 0;
|
|
956
957
|
logger.info("[Pipeline Debug] Run history cleared.");
|
|
957
958
|
},
|
|
959
|
+
/**
|
|
960
|
+
* Show the navigator registry: all registered classes and their roles.
|
|
961
|
+
*
|
|
962
|
+
* Useful for verifying that consumer-defined navigators were registered
|
|
963
|
+
* before pipeline assembly.
|
|
964
|
+
*/
|
|
965
|
+
showRegistry() {
|
|
966
|
+
const names = getRegisteredNavigatorNames();
|
|
967
|
+
if (names.length === 0) {
|
|
968
|
+
logger.info("[Pipeline Debug] Navigator registry is empty.");
|
|
969
|
+
return;
|
|
970
|
+
}
|
|
971
|
+
console.group("\u{1F4E6} Navigator Registry");
|
|
972
|
+
console.table(
|
|
973
|
+
names.map((name) => {
|
|
974
|
+
const registryRole = getRegisteredNavigatorRole(name);
|
|
975
|
+
const builtinRole = NavigatorRoles[name];
|
|
976
|
+
const effectiveRole = builtinRole || registryRole || "\u26A0\uFE0F NONE";
|
|
977
|
+
const source = builtinRole ? "built-in" : registryRole ? "consumer" : "unclassified";
|
|
978
|
+
return {
|
|
979
|
+
name,
|
|
980
|
+
role: effectiveRole,
|
|
981
|
+
source,
|
|
982
|
+
isGenerator: isGenerator(name),
|
|
983
|
+
isFilter: isFilter(name)
|
|
984
|
+
};
|
|
985
|
+
})
|
|
986
|
+
);
|
|
987
|
+
console.groupEnd();
|
|
988
|
+
},
|
|
989
|
+
/**
|
|
990
|
+
* Show strategy documents from the last pipeline run and how they mapped
|
|
991
|
+
* to the registry.
|
|
992
|
+
*
|
|
993
|
+
* If no runs are captured yet, falls back to showing just the registry.
|
|
994
|
+
*/
|
|
995
|
+
showStrategies() {
|
|
996
|
+
this.showRegistry();
|
|
997
|
+
if (runHistory.length === 0) {
|
|
998
|
+
logger.info("[Pipeline Debug] No pipeline runs captured yet \u2014 cannot show strategy doc mapping.");
|
|
999
|
+
return;
|
|
1000
|
+
}
|
|
1001
|
+
const run = runHistory[0];
|
|
1002
|
+
console.group("\u{1F50C} Pipeline Strategy Mapping (last run)");
|
|
1003
|
+
logger.info(`Generator: ${run.generatorName}`);
|
|
1004
|
+
if (run.generators && run.generators.length > 0) {
|
|
1005
|
+
for (const g of run.generators) {
|
|
1006
|
+
logger.info(` \u{1F4E5} ${g.name}: ${g.cardCount} cards (${g.newCount} new, ${g.reviewCount} reviews)`);
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
if (run.filters.length > 0) {
|
|
1010
|
+
logger.info("Filters:");
|
|
1011
|
+
for (const f of run.filters) {
|
|
1012
|
+
logger.info(` \u{1F538} ${f.name}: \u2191${f.boosted} \u2193${f.penalized} =${f.passed} \u2715${f.removed}`);
|
|
1013
|
+
}
|
|
1014
|
+
} else {
|
|
1015
|
+
logger.info("Filters: (none)");
|
|
1016
|
+
}
|
|
1017
|
+
console.groupEnd();
|
|
1018
|
+
},
|
|
958
1019
|
/**
|
|
959
1020
|
* Show help.
|
|
960
1021
|
*/
|
|
@@ -967,6 +1028,8 @@ Commands:
|
|
|
967
1028
|
.showRun(id|index) Show summary of a specific run (by index or ID suffix)
|
|
968
1029
|
.showCard(cardId) Show provenance trail for a specific card
|
|
969
1030
|
.explainReviews() Analyze why reviews were/weren't selected
|
|
1031
|
+
.showRegistry() Show navigator registry (classes + roles)
|
|
1032
|
+
.showStrategies() Show registry + strategy mapping from last run
|
|
970
1033
|
.listRuns() List all captured runs in table format
|
|
971
1034
|
.export() Export run history as JSON for bug reports
|
|
972
1035
|
.clear() Clear run history
|
|
@@ -1229,19 +1292,20 @@ var init_elo = __esm({
|
|
|
1229
1292
|
const scored = newCards.map((c, i) => {
|
|
1230
1293
|
const cardElo = cardEloData[i]?.global?.score ?? 1e3;
|
|
1231
1294
|
const distance = Math.abs(cardElo - userGlobalElo);
|
|
1232
|
-
const
|
|
1295
|
+
const rawScore = Math.max(0, 1 - distance / 500);
|
|
1296
|
+
const samplingKey = rawScore > 0 ? Math.random() ** (1 / rawScore) : 0;
|
|
1233
1297
|
return {
|
|
1234
1298
|
cardId: c.cardID,
|
|
1235
1299
|
courseId: c.courseID,
|
|
1236
|
-
score,
|
|
1300
|
+
score: samplingKey,
|
|
1237
1301
|
provenance: [
|
|
1238
1302
|
{
|
|
1239
1303
|
strategy: "elo",
|
|
1240
1304
|
strategyName: this.strategyName || this.name,
|
|
1241
1305
|
strategyId: this.strategyId || "NAVIGATION_STRATEGY-ELO-default",
|
|
1242
1306
|
action: "generated",
|
|
1243
|
-
score,
|
|
1244
|
-
reason: `ELO distance ${Math.round(distance)} (card: ${Math.round(cardElo)}, user: ${Math.round(userGlobalElo)}),
|
|
1307
|
+
score: samplingKey,
|
|
1308
|
+
reason: `ELO distance ${Math.round(distance)} (card: ${Math.round(cardElo)}, user: ${Math.round(userGlobalElo)}), raw ${rawScore.toFixed(3)}, key ${samplingKey.toFixed(3)}`
|
|
1245
1309
|
}
|
|
1246
1310
|
]
|
|
1247
1311
|
};
|