@vue-skuilder/db 0.2.27 → 0.2.28
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/classroomDB-DLTtLZct.d.cts +86 -0
- package/dist/classroomDB-DLTtLZct.d.ts +86 -0
- package/dist/{contentSource-LPf044hY.d.ts → contentSource-BoFBwvYa.d.ts} +65 -98
- package/dist/{contentSource-D3c1fMAk.d.cts → contentSource-DpQqTG3m.d.cts} +65 -98
- package/dist/core/index.d.cts +6 -5
- package/dist/core/index.d.ts +6 -5
- package/dist/core/index.js +22 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +22 -2
- package/dist/core/index.mjs.map +1 -1
- package/dist/{dataLayerProvider-DaAootVV.d.ts → dataLayerProvider-D_LJT3F4.d.ts} +2 -8
- package/dist/{dataLayerProvider-CeLiFbHv.d.cts → dataLayerProvider-Dl3cAAvQ.d.cts} +2 -8
- package/dist/diagnostics/index.d.cts +370 -0
- package/dist/diagnostics/index.d.ts +370 -0
- package/dist/diagnostics/index.js +778 -0
- package/dist/diagnostics/index.js.map +1 -0
- package/dist/diagnostics/index.mjs +729 -0
- package/dist/diagnostics/index.mjs.map +1 -0
- package/dist/impl/couch/index.d.cts +4 -3
- package/dist/impl/couch/index.d.ts +4 -3
- package/dist/impl/couch/index.js +22 -2
- package/dist/impl/couch/index.js.map +1 -1
- package/dist/impl/couch/index.mjs +22 -2
- package/dist/impl/couch/index.mjs.map +1 -1
- package/dist/impl/static/index.d.cts +5 -5
- package/dist/impl/static/index.d.ts +5 -5
- package/dist/impl/static/index.js +22 -8
- package/dist/impl/static/index.js.map +1 -1
- package/dist/impl/static/index.mjs +22 -8
- package/dist/impl/static/index.mjs.map +1 -1
- package/dist/{index-BkBJlGDX.d.ts → index-CVGehe_t.d.ts} +1 -1
- package/dist/{index-D7WdMDAs.d.cts → index-Ktg72jKb.d.cts} +1 -1
- package/dist/index.d.cts +10 -9
- package/dist/index.d.ts +10 -9
- package/dist/index.js +64 -23
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +64 -23
- package/dist/index.mjs.map +1 -1
- package/dist/{types-DjiFOZxJ.d.cts → types-D0oQeJAi.d.cts} +1 -1
- package/dist/{types-uJ2Xn3_X.d.ts → types-dXWfyz9B.d.ts} +1 -1
- package/dist/{types-legacy-CrwyZIvI.d.cts → types-legacy-BkOYOR6U.d.cts} +1 -1
- package/dist/{types-legacy-CrwyZIvI.d.ts → types-legacy-BkOYOR6U.d.ts} +1 -1
- package/dist/util/packer/index.d.cts +3 -3
- package/dist/util/packer/index.d.ts +3 -3
- package/package.json +15 -3
- package/src/core/interfaces/dataLayerProvider.ts +3 -8
- package/src/core/navigators/Pipeline.ts +5 -2
- package/src/core/navigators/PipelineDebugger.ts +64 -16
- package/src/core/navigators/index.ts +1 -0
- package/src/core/types/studySession.ts +37 -0
- package/src/diagnostics/dataset.ts +231 -0
- package/src/diagnostics/derive.ts +555 -0
- package/src/diagnostics/index.ts +24 -0
- package/src/diagnostics/loader.ts +191 -0
- package/src/diagnostics/text.ts +242 -0
- package/src/impl/couch/PouchDataLayerProvider.ts +0 -23
- package/src/impl/static/StaticDataLayerProvider.ts +0 -11
- package/src/study/SessionController.ts +56 -2
- package/tsup.config.ts +1 -0
package/dist/index.mjs
CHANGED
|
@@ -812,7 +812,7 @@ function parseCardElo(provenance) {
|
|
|
812
812
|
const match = eloEntry.reason.match(/card:\s*(\d+)/);
|
|
813
813
|
return match ? parseInt(match[1], 10) : void 0;
|
|
814
814
|
}
|
|
815
|
-
function buildRunReport(courseId, courseName, generatorName, generators, generatedCount, filters, allCards, selectedCards, userElo, hints) {
|
|
815
|
+
function buildRunReport(courseId, courseName, generatorName, generators, generatedCount, filters, allCards, selectedCards, userElo, hints, scoredCards) {
|
|
816
816
|
const selectedIds = new Set(selectedCards.map((c) => c.cardId));
|
|
817
817
|
const toReport = (card) => ({
|
|
818
818
|
cardId: card.cardId,
|
|
@@ -865,6 +865,23 @@ function buildRunReport(courseId, courseName, generatorName, generators, generat
|
|
|
865
865
|
note: `${discardedTailCards.length} additional candidate(s) scored below the top ${DISCARDED_KEEP_TOP} near-misses and were not retained (score ${scoreMin.toExponential(2)}\u2013${scoreMax.toExponential(2)}${eloFragment}). Likely ELO-window pull remnants filtered out by hierarchy/lesson/priority gates.`
|
|
866
866
|
};
|
|
867
867
|
}
|
|
868
|
+
const isUnselectedNew = (c) => !c.reviewID && !selectedIds.has(c.cardId);
|
|
869
|
+
const generatorScore = (c) => c.provenance[0]?.score ?? 0;
|
|
870
|
+
const keptIds = new Set(allCards.map((c) => c.cardId));
|
|
871
|
+
const hintExcluded = (c) => c.score > 0 && !keptIds.has(c.cardId);
|
|
872
|
+
let nextInLine;
|
|
873
|
+
for (const c of allCards) {
|
|
874
|
+
if (isUnselectedNew(c) && (!nextInLine || c.score > nextInLine.score)) nextInLine = c;
|
|
875
|
+
}
|
|
876
|
+
let topGenerated;
|
|
877
|
+
for (const c of scoredCards ?? allCards) {
|
|
878
|
+
if (!isUnselectedNew(c) || hintExcluded(c)) continue;
|
|
879
|
+
if (!topGenerated || generatorScore(c) > generatorScore(topGenerated)) topGenerated = c;
|
|
880
|
+
}
|
|
881
|
+
const unselectedNew = nextInLine || topGenerated ? {
|
|
882
|
+
...nextInLine ? { nextInLine: toReport(nextInLine) } : {},
|
|
883
|
+
...topGenerated && topGenerated.cardId !== nextInLine?.cardId ? { topGenerated: toReport(topGenerated) } : {}
|
|
884
|
+
} : void 0;
|
|
868
885
|
const reviewsSelected = selectedCards.filter((c) => getOrigin(c) === "review").length;
|
|
869
886
|
const newSelected = selectedCards.filter((c) => getOrigin(c) === "new").length;
|
|
870
887
|
return {
|
|
@@ -880,6 +897,7 @@ function buildRunReport(courseId, courseName, generatorName, generators, generat
|
|
|
880
897
|
reviewsSelected,
|
|
881
898
|
newSelected,
|
|
882
899
|
cards,
|
|
900
|
+
unselectedNew,
|
|
883
901
|
discardedTail
|
|
884
902
|
};
|
|
885
903
|
}
|
|
@@ -4699,6 +4717,7 @@ var init_Pipeline = __esm({
|
|
|
4699
4717
|
}
|
|
4700
4718
|
logger.debug(`[Pipeline] Filter '${filter.name}': ${beforeScores.size} \u2192 ${cards.length} cards (\u2191${boosted} \u2193${penalized} =${passed})`);
|
|
4701
4719
|
}
|
|
4720
|
+
const scoredCards = cards;
|
|
4702
4721
|
cards = cards.filter((c) => c.score > 0);
|
|
4703
4722
|
const hints = this._ephemeralHints;
|
|
4704
4723
|
if (hints) {
|
|
@@ -4735,7 +4754,8 @@ var init_Pipeline = __esm({
|
|
|
4735
4754
|
cards,
|
|
4736
4755
|
result,
|
|
4737
4756
|
context.userElo,
|
|
4738
|
-
hints ?? void 0
|
|
4757
|
+
hints ?? void 0,
|
|
4758
|
+
scoredCards
|
|
4739
4759
|
);
|
|
4740
4760
|
captureRun(report);
|
|
4741
4761
|
} catch (e) {
|
|
@@ -11148,7 +11168,41 @@ Example:
|
|
|
11148
11168
|
});
|
|
11149
11169
|
|
|
11150
11170
|
// src/study/SessionController.ts
|
|
11151
|
-
|
|
11171
|
+
function sig4(x) {
|
|
11172
|
+
return Number(x.toPrecision(4));
|
|
11173
|
+
}
|
|
11174
|
+
function toRunCard(c) {
|
|
11175
|
+
return {
|
|
11176
|
+
cardId: c.cardId,
|
|
11177
|
+
origin: c.origin,
|
|
11178
|
+
...c.generator ? { generator: c.generator } : {},
|
|
11179
|
+
score: sig4(c.finalScore),
|
|
11180
|
+
selected: c.selected
|
|
11181
|
+
};
|
|
11182
|
+
}
|
|
11183
|
+
function toRunCardTrail(c) {
|
|
11184
|
+
return {
|
|
11185
|
+
...toRunCard(c),
|
|
11186
|
+
trail: c.provenance.filter((p) => p.action !== "passed").map((p) => ({
|
|
11187
|
+
strategyName: p.strategyName,
|
|
11188
|
+
action: p.action,
|
|
11189
|
+
score: sig4(p.score),
|
|
11190
|
+
reason: p.reason
|
|
11191
|
+
}))
|
|
11192
|
+
};
|
|
11193
|
+
}
|
|
11194
|
+
function persistedRunCards(run) {
|
|
11195
|
+
const selected = run.cards.filter((c) => c.selected);
|
|
11196
|
+
const runnersUp = run.cards.filter((c) => !c.selected).slice(0, PERSISTED_RUNNERS_UP);
|
|
11197
|
+
return [...selected, ...runnersUp].map(toRunCard);
|
|
11198
|
+
}
|
|
11199
|
+
function persistedUnselectedNew(u) {
|
|
11200
|
+
return {
|
|
11201
|
+
...u.nextInLine ? { nextInLine: toRunCardTrail(u.nextInLine) } : {},
|
|
11202
|
+
...u.topGenerated ? { topGenerated: toRunCardTrail(u.topGenerated) } : {}
|
|
11203
|
+
};
|
|
11204
|
+
}
|
|
11205
|
+
var PERSISTED_RUNNERS_UP, SessionController;
|
|
11152
11206
|
var init_SessionController = __esm({
|
|
11153
11207
|
"src/study/SessionController.ts"() {
|
|
11154
11208
|
"use strict";
|
|
@@ -11170,6 +11224,7 @@ var init_SessionController = __esm({
|
|
|
11170
11224
|
init_SessionDebugger();
|
|
11171
11225
|
init_SessionOverlay();
|
|
11172
11226
|
init_logger();
|
|
11227
|
+
PERSISTED_RUNNERS_UP = 5;
|
|
11173
11228
|
SessionController = class _SessionController extends Loggable {
|
|
11174
11229
|
_className = "SessionController";
|
|
11175
11230
|
services;
|
|
@@ -11452,13 +11507,16 @@ var init_SessionController = __esm({
|
|
|
11452
11507
|
newSelected: run.newSelected,
|
|
11453
11508
|
// Compact detail projected off the full report so a persisted run is
|
|
11454
11509
|
// self-explanatory once the in-memory ring buffer has rolled over.
|
|
11455
|
-
// Per-card provenance
|
|
11456
|
-
//
|
|
11510
|
+
// Per-card provenance is the dominant cost, so it's kept only for the
|
|
11511
|
+
// (at most two) `unselectedNew` cards, and only its score-changing
|
|
11512
|
+
// entries. Everything else is ids and scores.
|
|
11457
11513
|
...typeof run.userElo === "number" ? { userElo: run.userElo } : {},
|
|
11458
11514
|
...run.generators ? { generators: run.generators } : {},
|
|
11459
11515
|
...run.filters ? { filters: run.filters } : {},
|
|
11460
11516
|
...run.hints ? { hints: run.hints } : {},
|
|
11461
|
-
...run.discardedTail ? { discardedTail: run.discardedTail } : {}
|
|
11517
|
+
...run.discardedTail ? { discardedTail: run.discardedTail } : {},
|
|
11518
|
+
cards: persistedRunCards(run),
|
|
11519
|
+
...run.unselectedNew ? { unselectedNew: persistedUnselectedNew(run.unselectedNew) } : {}
|
|
11462
11520
|
});
|
|
11463
11521
|
}
|
|
11464
11522
|
}
|
|
@@ -14087,7 +14145,6 @@ var init_PouchDataLayerProvider = __esm({
|
|
|
14087
14145
|
"use strict";
|
|
14088
14146
|
init_logger();
|
|
14089
14147
|
init_dataDirectory();
|
|
14090
|
-
init_auth();
|
|
14091
14148
|
init_adminDB2();
|
|
14092
14149
|
init_classroomDB2();
|
|
14093
14150
|
init_courseDB();
|
|
@@ -14161,16 +14218,6 @@ var init_PouchDataLayerProvider = __esm({
|
|
|
14161
14218
|
getAdminDB() {
|
|
14162
14219
|
return new AdminDB();
|
|
14163
14220
|
}
|
|
14164
|
-
async createUserReaderForUser(targetUsername) {
|
|
14165
|
-
const requestingUsername = await getLoggedInUsername();
|
|
14166
|
-
if (requestingUsername !== "admin") {
|
|
14167
|
-
throw new Error("Unauthorized: Only admin users can access other users' data");
|
|
14168
|
-
}
|
|
14169
|
-
logger.info(`Admin user '${requestingUsername}' requesting UserDBReader for '${targetUsername}'`);
|
|
14170
|
-
const syncStrategy = new CouchDBSyncStrategy();
|
|
14171
|
-
const targetUserDB = await BaseUser.instance(syncStrategy, targetUsername);
|
|
14172
|
-
return targetUserDB;
|
|
14173
|
-
}
|
|
14174
14221
|
isReadOnly() {
|
|
14175
14222
|
return false;
|
|
14176
14223
|
}
|
|
@@ -15183,12 +15230,6 @@ var init_StaticDataLayerProvider = __esm({
|
|
|
15183
15230
|
getAdminDB() {
|
|
15184
15231
|
throw new Error("Admin functions not supported in static mode");
|
|
15185
15232
|
}
|
|
15186
|
-
async createUserReaderForUser(targetUsername) {
|
|
15187
|
-
logger.warn(`StaticDataLayerProvider: Multi-user access not supported in static mode`);
|
|
15188
|
-
logger.warn(`Request: trying to access data for ${targetUsername}`);
|
|
15189
|
-
logger.warn(`Returning current user's data instead`);
|
|
15190
|
-
return this.getUserDB();
|
|
15191
|
-
}
|
|
15192
15233
|
isReadOnly() {
|
|
15193
15234
|
return true;
|
|
15194
15235
|
}
|