@vue-skuilder/db 0.2.30 → 0.2.31
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/{contentSource-CqJmbOZN.d.ts → contentSource-DMduBjDC.d.ts} +19 -4
- package/dist/{contentSource-B6FrSihy.d.cts → contentSource-Doh1aVBJ.d.cts} +19 -4
- package/dist/core/index.d.cts +3 -3
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.js +88 -76
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +40 -27
- package/dist/core/index.mjs.map +1 -1
- package/dist/{dataLayerProvider-DUxDqMtZ.d.cts → dataLayerProvider-BW1CBAbb.d.cts} +1 -1
- package/dist/{dataLayerProvider-B9_UCvkR.d.ts → dataLayerProvider-Cxfe4nSK.d.ts} +1 -1
- package/dist/diagnostics/index.d.cts +18 -3
- package/dist/diagnostics/index.d.ts +18 -3
- package/dist/diagnostics/index.js +159 -135
- package/dist/diagnostics/index.js.map +1 -1
- package/dist/diagnostics/index.mjs +156 -135
- package/dist/diagnostics/index.mjs.map +1 -1
- package/dist/impl/couch/index.d.cts +2 -2
- package/dist/impl/couch/index.d.ts +2 -2
- package/dist/impl/couch/index.js +92 -80
- package/dist/impl/couch/index.js.map +1 -1
- package/dist/impl/couch/index.mjs +40 -27
- package/dist/impl/couch/index.mjs.map +1 -1
- package/dist/impl/static/index.d.cts +2 -2
- package/dist/impl/static/index.d.ts +2 -2
- package/dist/impl/static/index.js +79 -67
- package/dist/impl/static/index.js.map +1 -1
- package/dist/impl/static/index.mjs +40 -27
- package/dist/impl/static/index.mjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +141 -110
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +65 -33
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/core/navigators/PipelineDebugger.ts +42 -23
- package/src/core/navigators/filters/eloDistance.ts +7 -8
- package/src/core/navigators/generators/elo.ts +8 -2
- package/src/core/navigators/generators/prescribed.ts +7 -5
- package/src/core/types/studySession.ts +12 -1
- package/src/diagnostics/derive.ts +5 -2
- package/src/diagnostics/pipeline.ts +28 -0
- package/src/diagnostics/text.ts +11 -4
- package/src/study/SessionController.ts +3 -1
- package/src/study/services/EloService.ts +33 -6
|
@@ -481,13 +481,12 @@ function clearRunHistory() {
|
|
|
481
481
|
_pendingRuns = [];
|
|
482
482
|
}
|
|
483
483
|
function getOrigin(card) {
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
return "unknown";
|
|
484
|
+
return card.reviewID ? "review" : "new";
|
|
485
|
+
}
|
|
486
|
+
function requiredBy(card) {
|
|
487
|
+
return card.provenance.find(
|
|
488
|
+
(p) => p.strategy === "ephemeralHint" && p.score === Number.POSITIVE_INFINITY
|
|
489
|
+
)?.strategyName;
|
|
491
490
|
}
|
|
492
491
|
function captureRun(report) {
|
|
493
492
|
const fullReport = {
|
|
@@ -511,17 +510,23 @@ function parseCardElo(provenance) {
|
|
|
511
510
|
}
|
|
512
511
|
function buildRunReport(courseId, courseName, generatorName, generators, generatedCount, filters, allCards, selectedCards, userElo, hints, scoredCards, regulators) {
|
|
513
512
|
const selectedIds = new Set(selectedCards.map((c) => c.cardId));
|
|
514
|
-
const toReport = (card) =>
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
513
|
+
const toReport = (card) => {
|
|
514
|
+
const required = requiredBy(card);
|
|
515
|
+
const first = card.provenance[0];
|
|
516
|
+
const generator = first && first.strategy !== "ephemeralHint" ? first.strategyName || first.strategy : void 0;
|
|
517
|
+
return {
|
|
518
|
+
cardId: card.cardId,
|
|
519
|
+
courseId: card.courseId,
|
|
520
|
+
origin: getOrigin(card),
|
|
521
|
+
...generator ? { generator } : {},
|
|
522
|
+
...required ? { required } : {},
|
|
523
|
+
finalScore: card.score,
|
|
524
|
+
cardElo: card.cardElo ?? parseCardElo(card.provenance),
|
|
525
|
+
provenance: card.provenance,
|
|
526
|
+
tags: card.tags,
|
|
527
|
+
selected: selectedIds.has(card.cardId)
|
|
528
|
+
};
|
|
529
|
+
};
|
|
525
530
|
const selectedReported = [];
|
|
526
531
|
const nearMissReported = [];
|
|
527
532
|
const discardedTailCards = [];
|
|
@@ -1650,10 +1655,14 @@ var init_elo = __esm({
|
|
|
1650
1655
|
const userElo = toCourseElo2(courseReg.elo);
|
|
1651
1656
|
userGlobalElo = userElo.global.score;
|
|
1652
1657
|
}
|
|
1653
|
-
const activeCards = await
|
|
1658
|
+
const [activeCards, seenCards] = await Promise.all([
|
|
1659
|
+
this.user.getActiveCards(),
|
|
1660
|
+
this.user.getSeenCards(this.course.getCourseID()).catch(() => [])
|
|
1661
|
+
]);
|
|
1662
|
+
const notNew = /* @__PURE__ */ new Set([...activeCards.map((ac) => ac.cardID), ...seenCards]);
|
|
1654
1663
|
const newCards = (await this.course.getCardsCenteredAtELO(
|
|
1655
1664
|
{ limit, elo: "user" },
|
|
1656
|
-
(c) => !
|
|
1665
|
+
(c) => !notNew.has(c.cardID)
|
|
1657
1666
|
)).map((c) => ({ ...c, status: "new" }));
|
|
1658
1667
|
const scored = newCards.map((c) => {
|
|
1659
1668
|
const cardElo = c.elo ?? 1e3;
|
|
@@ -1706,6 +1715,7 @@ __export(prescribed_exports, {
|
|
|
1706
1715
|
default: () => PrescribedCardsGenerator,
|
|
1707
1716
|
unmetIntroExposeTags: () => unmetIntroExposeTags
|
|
1708
1717
|
});
|
|
1718
|
+
import { tagRole, withTagRole } from "@vue-skuilder/common";
|
|
1709
1719
|
function dedupe(arr) {
|
|
1710
1720
|
return [...new Set(arr)];
|
|
1711
1721
|
}
|
|
@@ -1746,11 +1756,11 @@ function formatAge(ms) {
|
|
|
1746
1756
|
}
|
|
1747
1757
|
function unmetIntroExposeTags(tags, userTagElo, minCount) {
|
|
1748
1758
|
if (minCount <= 0) return [];
|
|
1749
|
-
const exposeTags = new Set(tags.filter((tag) => tag
|
|
1759
|
+
const exposeTags = new Set(tags.filter((tag) => tagRole(tag) === "expose"));
|
|
1750
1760
|
for (const tag of tags) {
|
|
1751
|
-
if (
|
|
1752
|
-
const
|
|
1753
|
-
if (
|
|
1761
|
+
if (tagRole(tag) !== "intro") continue;
|
|
1762
|
+
const expose = withTagRole(tag, "expose");
|
|
1763
|
+
if (expose) exposeTags.add(expose);
|
|
1754
1764
|
}
|
|
1755
1765
|
return [...exposeTags].filter((tag) => {
|
|
1756
1766
|
const tagElo = userTagElo[tag];
|
|
@@ -2952,6 +2962,7 @@ __export(eloDistance_exports, {
|
|
|
2952
2962
|
mountMultiDimEloToggle: () => mountMultiDimEloToggle,
|
|
2953
2963
|
tagAwareGap: () => tagAwareGap
|
|
2954
2964
|
});
|
|
2965
|
+
import { COUNT_ONLY_SCORE, isCountOnlyTag } from "@vue-skuilder/common";
|
|
2955
2966
|
function computeMultiplier(distance, halfLife, minMultiplier, maxMultiplier) {
|
|
2956
2967
|
const normalizedDistance = distance / halfLife;
|
|
2957
2968
|
const decay = Math.exp(-(normalizedDistance * normalizedDistance));
|
|
@@ -2994,7 +3005,9 @@ function tagAwareGap(cardTags, cardElo, userElo, minTagCount) {
|
|
|
2994
3005
|
const tags = [];
|
|
2995
3006
|
for (const tag of cardTags) {
|
|
2996
3007
|
const user = userElo.tags[tag];
|
|
2997
|
-
if (!user || user.score ===
|
|
3008
|
+
if (isCountOnlyTag(tag) || !user || user.score === COUNT_ONLY_SCORE || user.count < minTagCount) {
|
|
3009
|
+
continue;
|
|
3010
|
+
}
|
|
2998
3011
|
const card = cardElo.tags[tag]?.score ?? cardElo.global.score;
|
|
2999
3012
|
tags.push({
|
|
3000
3013
|
tag,
|
|
@@ -3066,7 +3079,7 @@ function createEloDistanceFilter(config) {
|
|
|
3066
3079
|
transform: (cards, context) => applyEloDistance(cards, context, resolved, source)
|
|
3067
3080
|
};
|
|
3068
3081
|
}
|
|
3069
|
-
var DEFAULT_ELO_DISTANCE_CONFIG, TAG_CONFIDENCE_HALF,
|
|
3082
|
+
var DEFAULT_ELO_DISTANCE_CONFIG, TAG_CONFIDENCE_HALF, DEFAULT_CARD_ELO, MULTI_DIM_ELO_KEY, multiDimElo, EloDistanceFilter;
|
|
3070
3083
|
var init_eloDistance = __esm({
|
|
3071
3084
|
"src/core/navigators/filters/eloDistance.ts"() {
|
|
3072
3085
|
"use strict";
|
|
@@ -3080,7 +3093,6 @@ var init_eloDistance = __esm({
|
|
|
3080
3093
|
minTagCount: 3
|
|
3081
3094
|
};
|
|
3082
3095
|
TAG_CONFIDENCE_HALF = 10;
|
|
3083
|
-
COUNT_ONLY_SENTINEL = -1;
|
|
3084
3096
|
DEFAULT_CARD_ELO = 1e3;
|
|
3085
3097
|
MULTI_DIM_ELO_KEY = "skuilder:multiDimElo";
|
|
3086
3098
|
multiDimElo = readMultiDimElo();
|
|
@@ -5752,6 +5764,7 @@ var init_tagRecent = __esm({
|
|
|
5752
5764
|
import {
|
|
5753
5765
|
adjustCourseScores,
|
|
5754
5766
|
adjustCourseScoresPerTag,
|
|
5767
|
+
isCountOnlyTag as isCountOnlyTag2,
|
|
5755
5768
|
toCourseElo as toCourseElo7
|
|
5756
5769
|
} from "@vue-skuilder/common";
|
|
5757
5770
|
var init_EloService = __esm({
|