@vue-skuilder/db 0.2.26 → 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 +43 -15
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +43 -15
- 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 +43 -15
- package/dist/impl/couch/index.js.map +1 -1
- package/dist/impl/couch/index.mjs +43 -15
- 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 +43 -21
- package/dist/impl/static/index.js.map +1 -1
- package/dist/impl/static/index.mjs +43 -21
- 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 +85 -36
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +85 -36
- 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/generators/prescribed.ts +43 -14
- 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/tests/core/navigators/prescribedIntroExposure.test.ts +29 -0
- package/tsup.config.ts +1 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as PackerConfig, a as PackedCourseData, S as StaticCourseManifest } from './types-
|
|
1
|
+
import { P as PackerConfig, a as PackedCourseData, S as StaticCourseManifest } from './types-dXWfyz9B.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Abstraction for file system operations needed by the migrator.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as PackerConfig, a as PackedCourseData, S as StaticCourseManifest } from './types-
|
|
1
|
+
import { P as PackerConfig, a as PackedCourseData, S as StaticCourseManifest } from './types-D0oQeJAi.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Abstraction for file system operations needed by the migrator.
|
package/dist/index.d.cts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
export { A as AdminDBInterface, d as AssignedCard, a as AssignedContent, c as AssignedCourse, b as AssignedTag, C as ClassroomDBInterface, S as StudentClassroomDBInterface, T as TeacherClassroomDBInterface } from './classroomDB-DLTtLZct.cjs';
|
|
2
|
+
import { U as UserDBInterface, c as CourseRegistrationDoc, f as SessionEloEvent, j as StudySessionItem, W as WeightedCard, R as ReplanHints, m as StudyContentSource, v as SessionStateSnapshotProvider, G as GeneratorResult, C as CourseDBInterface } from './contentSource-DpQqTG3m.cjs';
|
|
3
|
+
export { K as ActivityRecord, a9 as CardGenerator, ab as CardGeneratorFactory, F as ClassroomRegistration, E as ClassroomRegistrationDesignation, H as ClassroomRegistrationDoc, k as ContentNavigationStrategyData, l as ContentNavigator, t as ContentSourceID, i as CourseInfo, L as CourseRegistration, a as CoursesDBInterface, at as DocumentUpdater, al as FilterImpact, aa as GeneratorContext, ak as GeneratorSummary, T as HYDRATION_MARKER_ID, V as HydrationMarker, an as LearnableWeight, X as NavigatorConstructor, a5 as NavigatorRole, a6 as NavigatorRoles, a4 as Navigators, ao as OrchestrationContext, am as PipelineForecaster, ai as PipelineRunReport, aj as RunReportCard, b as ScheduledCard, d as SessionStateSnapshot, I as SessionTrackingData, a2 as StrategyContribution, S as StudySessionDoc, n as StudySessionFailedItem, o as StudySessionFailedNewItem, p as StudySessionFailedReviewItem, q as StudySessionNewItem, r as StudySessionReviewItem, g as StudySessionRunCard, h as StudySessionRunCardTrail, e as StudySessionRunSummary, J as UserConfig, A as UserCourseSetting, z as UserCourseSettings, y as UserDBAuthenticator, w as UserDBReader, x as UserDBWriter, P as UserHydrationState, Q as UserHydrationStatus, M as UserOutcomeRecord, B as UsrCrsDataInterface, ap as computeDeviation, ar as computeEffectiveWeight, aq as computeSpread, as as createOrchestrationContext, ah as drainCapturedRuns, ae as getActivePipeline, a3 as getCardOrigin, aw as getLapses, Z as getRegisteredNavigator, a0 as getRegisteredNavigatorNames, $ as getRegisteredNavigatorRole, ag as getRunsForSession, av as getStreak, u as getStudySource, _ as hasRegisteredNavigator, a1 as initializeNavigatorRegistry, a8 as isFilter, a7 as isGenerator, s as isReview, N as makeStudySessionId, ad as mountPipelineDebugger, au as newInterval, O as newSessionId, ac as pipelineDebugAPI, Y as registerNavigator, af as setDebugSessionId } from './contentSource-DpQqTG3m.cjs';
|
|
4
|
+
import { D as DataLayerProvider } from './dataLayerProvider-Dl3cAAvQ.cjs';
|
|
5
|
+
import { c as CardHistory, b as CardRecord, Q as QuestionRecord } from './types-legacy-BkOYOR6U.cjs';
|
|
6
|
+
export { C as CardData, g as CourseListData, h as DataShapeData, a as DisplayableData, D as DocType, f as DocTypePrefixes, F as Field, G as GuestUsername, d as QualifiedCardID, i as QuestionData, S as SkuilderCourseData, T as Tag, e as TagStub, l as log } from './types-legacy-BkOYOR6U.cjs';
|
|
6
7
|
import { SrsBacklogDebug, StrategyPressureDebug, Loggable } from './core/index.cjs';
|
|
7
8
|
export { BulkCardProcessorConfig, CardFilter, CardFilterFactory, DIVERSITY_FLOOR, DIVERSITY_STRENGTH, DiversityRerankOptions, FilterContext, GradientObservation, GradientResult, ImportResult, PeriodUpdateInput, PeriodUpdateResult, PressureGaugeDebug, SignalConfig, StrategyLearningState, StrategyStateDoc, StrategyStateId, aggregateOutcomesForGradient, areQuestionRecords, buildStrategyStateId, captureStrategyPressure, clearSrsBacklogDebug, clearStrategyPressureDebug, computeOutcomeSignal, computeStrategyGradient, diversityRerank, docIsDeleted, getCardHistoryID, getDefaultLearnableWeight, getSrsBacklogDebug, getStrategyPressureDebug, importParsedCards, isQuestionRecord, mountUserDBDebugger, parseCardHistoryID, recordUserOutcome, runPeriodUpdate, scoreAccuracyInZone, updateLearningState, updateStrategyWeight, userDBDebugAPI, validateProcessorConfig } from './core/index.cjs';
|
|
8
9
|
import { TaggedPerformance, TagFilter, DataShape, CourseConfig } from '@vue-skuilder/common';
|
|
9
|
-
import { S as StaticCourseManifest } from './types-
|
|
10
|
-
export { A as AttachmentData, C as ChunkMetadata, D as DesignDocument, I as IndexMetadata, a as PackedCourseData, P as PackerConfig } from './types-
|
|
11
|
-
import { F as FileSystemAdapter } from './index-
|
|
12
|
-
export { C as CouchDBToStaticPacker, a as FileStats, b as FileSystemError } from './index-
|
|
10
|
+
import { S as StaticCourseManifest } from './types-D0oQeJAi.cjs';
|
|
11
|
+
export { A as AttachmentData, C as ChunkMetadata, D as DesignDocument, I as IndexMetadata, a as PackedCourseData, P as PackerConfig } from './types-D0oQeJAi.cjs';
|
|
12
|
+
import { F as FileSystemAdapter } from './index-Ktg72jKb.cjs';
|
|
13
|
+
export { C as CouchDBToStaticPacker, a as FileStats, b as FileSystemError } from './index-Ktg72jKb.cjs';
|
|
13
14
|
import moment from 'moment';
|
|
14
15
|
|
|
15
16
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
export { A as AdminDBInterface, d as AssignedCard, a as AssignedContent, c as AssignedCourse, b as AssignedTag, C as ClassroomDBInterface, S as StudentClassroomDBInterface, T as TeacherClassroomDBInterface } from './classroomDB-DLTtLZct.js';
|
|
2
|
+
import { U as UserDBInterface, c as CourseRegistrationDoc, f as SessionEloEvent, j as StudySessionItem, W as WeightedCard, R as ReplanHints, m as StudyContentSource, v as SessionStateSnapshotProvider, G as GeneratorResult, C as CourseDBInterface } from './contentSource-BoFBwvYa.js';
|
|
3
|
+
export { K as ActivityRecord, a9 as CardGenerator, ab as CardGeneratorFactory, F as ClassroomRegistration, E as ClassroomRegistrationDesignation, H as ClassroomRegistrationDoc, k as ContentNavigationStrategyData, l as ContentNavigator, t as ContentSourceID, i as CourseInfo, L as CourseRegistration, a as CoursesDBInterface, at as DocumentUpdater, al as FilterImpact, aa as GeneratorContext, ak as GeneratorSummary, T as HYDRATION_MARKER_ID, V as HydrationMarker, an as LearnableWeight, X as NavigatorConstructor, a5 as NavigatorRole, a6 as NavigatorRoles, a4 as Navigators, ao as OrchestrationContext, am as PipelineForecaster, ai as PipelineRunReport, aj as RunReportCard, b as ScheduledCard, d as SessionStateSnapshot, I as SessionTrackingData, a2 as StrategyContribution, S as StudySessionDoc, n as StudySessionFailedItem, o as StudySessionFailedNewItem, p as StudySessionFailedReviewItem, q as StudySessionNewItem, r as StudySessionReviewItem, g as StudySessionRunCard, h as StudySessionRunCardTrail, e as StudySessionRunSummary, J as UserConfig, A as UserCourseSetting, z as UserCourseSettings, y as UserDBAuthenticator, w as UserDBReader, x as UserDBWriter, P as UserHydrationState, Q as UserHydrationStatus, M as UserOutcomeRecord, B as UsrCrsDataInterface, ap as computeDeviation, ar as computeEffectiveWeight, aq as computeSpread, as as createOrchestrationContext, ah as drainCapturedRuns, ae as getActivePipeline, a3 as getCardOrigin, aw as getLapses, Z as getRegisteredNavigator, a0 as getRegisteredNavigatorNames, $ as getRegisteredNavigatorRole, ag as getRunsForSession, av as getStreak, u as getStudySource, _ as hasRegisteredNavigator, a1 as initializeNavigatorRegistry, a8 as isFilter, a7 as isGenerator, s as isReview, N as makeStudySessionId, ad as mountPipelineDebugger, au as newInterval, O as newSessionId, ac as pipelineDebugAPI, Y as registerNavigator, af as setDebugSessionId } from './contentSource-BoFBwvYa.js';
|
|
4
|
+
import { D as DataLayerProvider } from './dataLayerProvider-D_LJT3F4.js';
|
|
5
|
+
import { c as CardHistory, b as CardRecord, Q as QuestionRecord } from './types-legacy-BkOYOR6U.js';
|
|
6
|
+
export { C as CardData, g as CourseListData, h as DataShapeData, a as DisplayableData, D as DocType, f as DocTypePrefixes, F as Field, G as GuestUsername, d as QualifiedCardID, i as QuestionData, S as SkuilderCourseData, T as Tag, e as TagStub, l as log } from './types-legacy-BkOYOR6U.js';
|
|
6
7
|
import { SrsBacklogDebug, StrategyPressureDebug, Loggable } from './core/index.js';
|
|
7
8
|
export { BulkCardProcessorConfig, CardFilter, CardFilterFactory, DIVERSITY_FLOOR, DIVERSITY_STRENGTH, DiversityRerankOptions, FilterContext, GradientObservation, GradientResult, ImportResult, PeriodUpdateInput, PeriodUpdateResult, PressureGaugeDebug, SignalConfig, StrategyLearningState, StrategyStateDoc, StrategyStateId, aggregateOutcomesForGradient, areQuestionRecords, buildStrategyStateId, captureStrategyPressure, clearSrsBacklogDebug, clearStrategyPressureDebug, computeOutcomeSignal, computeStrategyGradient, diversityRerank, docIsDeleted, getCardHistoryID, getDefaultLearnableWeight, getSrsBacklogDebug, getStrategyPressureDebug, importParsedCards, isQuestionRecord, mountUserDBDebugger, parseCardHistoryID, recordUserOutcome, runPeriodUpdate, scoreAccuracyInZone, updateLearningState, updateStrategyWeight, userDBDebugAPI, validateProcessorConfig } from './core/index.js';
|
|
8
9
|
import { TaggedPerformance, TagFilter, DataShape, CourseConfig } from '@vue-skuilder/common';
|
|
9
|
-
import { S as StaticCourseManifest } from './types-
|
|
10
|
-
export { A as AttachmentData, C as ChunkMetadata, D as DesignDocument, I as IndexMetadata, a as PackedCourseData, P as PackerConfig } from './types-
|
|
11
|
-
import { F as FileSystemAdapter } from './index-
|
|
12
|
-
export { C as CouchDBToStaticPacker, a as FileStats, b as FileSystemError } from './index-
|
|
10
|
+
import { S as StaticCourseManifest } from './types-dXWfyz9B.js';
|
|
11
|
+
export { A as AttachmentData, C as ChunkMetadata, D as DesignDocument, I as IndexMetadata, a as PackedCourseData, P as PackerConfig } from './types-dXWfyz9B.js';
|
|
12
|
+
import { F as FileSystemAdapter } from './index-CVGehe_t.js';
|
|
13
|
+
export { C as CouchDBToStaticPacker, a as FileStats, b as FileSystemError } from './index-CVGehe_t.js';
|
|
13
14
|
import moment from 'moment';
|
|
14
15
|
|
|
15
16
|
/**
|
package/dist/index.js
CHANGED
|
@@ -834,7 +834,7 @@ function parseCardElo(provenance) {
|
|
|
834
834
|
const match = eloEntry.reason.match(/card:\s*(\d+)/);
|
|
835
835
|
return match ? parseInt(match[1], 10) : void 0;
|
|
836
836
|
}
|
|
837
|
-
function buildRunReport(courseId, courseName, generatorName, generators, generatedCount, filters, allCards, selectedCards, userElo, hints) {
|
|
837
|
+
function buildRunReport(courseId, courseName, generatorName, generators, generatedCount, filters, allCards, selectedCards, userElo, hints, scoredCards) {
|
|
838
838
|
const selectedIds = new Set(selectedCards.map((c) => c.cardId));
|
|
839
839
|
const toReport = (card) => ({
|
|
840
840
|
cardId: card.cardId,
|
|
@@ -887,6 +887,23 @@ function buildRunReport(courseId, courseName, generatorName, generators, generat
|
|
|
887
887
|
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.`
|
|
888
888
|
};
|
|
889
889
|
}
|
|
890
|
+
const isUnselectedNew = (c) => !c.reviewID && !selectedIds.has(c.cardId);
|
|
891
|
+
const generatorScore = (c) => c.provenance[0]?.score ?? 0;
|
|
892
|
+
const keptIds = new Set(allCards.map((c) => c.cardId));
|
|
893
|
+
const hintExcluded = (c) => c.score > 0 && !keptIds.has(c.cardId);
|
|
894
|
+
let nextInLine;
|
|
895
|
+
for (const c of allCards) {
|
|
896
|
+
if (isUnselectedNew(c) && (!nextInLine || c.score > nextInLine.score)) nextInLine = c;
|
|
897
|
+
}
|
|
898
|
+
let topGenerated;
|
|
899
|
+
for (const c of scoredCards ?? allCards) {
|
|
900
|
+
if (!isUnselectedNew(c) || hintExcluded(c)) continue;
|
|
901
|
+
if (!topGenerated || generatorScore(c) > generatorScore(topGenerated)) topGenerated = c;
|
|
902
|
+
}
|
|
903
|
+
const unselectedNew = nextInLine || topGenerated ? {
|
|
904
|
+
...nextInLine ? { nextInLine: toReport(nextInLine) } : {},
|
|
905
|
+
...topGenerated && topGenerated.cardId !== nextInLine?.cardId ? { topGenerated: toReport(topGenerated) } : {}
|
|
906
|
+
} : void 0;
|
|
890
907
|
const reviewsSelected = selectedCards.filter((c) => getOrigin(c) === "review").length;
|
|
891
908
|
const newSelected = selectedCards.filter((c) => getOrigin(c) === "new").length;
|
|
892
909
|
return {
|
|
@@ -902,6 +919,7 @@ function buildRunReport(courseId, courseName, generatorName, generators, generat
|
|
|
902
919
|
reviewsSelected,
|
|
903
920
|
newSelected,
|
|
904
921
|
cards,
|
|
922
|
+
unselectedNew,
|
|
905
923
|
discardedTail
|
|
906
924
|
};
|
|
907
925
|
}
|
|
@@ -2000,7 +2018,8 @@ var init_generators = __esm({
|
|
|
2000
2018
|
// src/core/navigators/generators/prescribed.ts
|
|
2001
2019
|
var prescribed_exports = {};
|
|
2002
2020
|
__export(prescribed_exports, {
|
|
2003
|
-
default: () => PrescribedCardsGenerator
|
|
2021
|
+
default: () => PrescribedCardsGenerator,
|
|
2022
|
+
unmetIntroExposeTags: () => unmetIntroExposeTags
|
|
2004
2023
|
});
|
|
2005
2024
|
function dedupe(arr) {
|
|
2006
2025
|
return [...new Set(arr)];
|
|
@@ -2040,6 +2059,19 @@ function formatAge(ms) {
|
|
|
2040
2059
|
if (hours < 24) return `${hours}h`;
|
|
2041
2060
|
return `${Math.round(hours / 24)}d`;
|
|
2042
2061
|
}
|
|
2062
|
+
function unmetIntroExposeTags(tags, userTagElo, minCount) {
|
|
2063
|
+
if (minCount <= 0) return [];
|
|
2064
|
+
const exposeTags = new Set(tags.filter((tag) => tag.startsWith("gpc:expose:")));
|
|
2065
|
+
for (const tag of tags) {
|
|
2066
|
+
if (!tag.startsWith("gpc:intro:")) continue;
|
|
2067
|
+
const suffix = tag.slice("gpc:intro:".length);
|
|
2068
|
+
if (suffix) exposeTags.add(`gpc:expose:${suffix}`);
|
|
2069
|
+
}
|
|
2070
|
+
return [...exposeTags].filter((tag) => {
|
|
2071
|
+
const tagElo = userTagElo[tag];
|
|
2072
|
+
return !tagElo || tagElo.count < minCount;
|
|
2073
|
+
});
|
|
2074
|
+
}
|
|
2043
2075
|
function pickTopByScore(cards, limit) {
|
|
2044
2076
|
return [...cards].sort((a, b) => b.score - a.score || a.cardId.localeCompare(b.cardId)).slice(0, limit);
|
|
2045
2077
|
}
|
|
@@ -2338,6 +2370,7 @@ var init_prescribed = __esm({
|
|
|
2338
2370
|
freshnessWindowSessions: typeof raw.freshnessWindowSessions === "number" ? raw.freshnessWindowSessions : DEFAULT_FRESHNESS_WINDOW,
|
|
2339
2371
|
maxDirectTargetsPerRun: typeof raw.maxDirectTargetsPerRun === "number" ? raw.maxDirectTargetsPerRun : DEFAULT_MAX_DIRECT_PER_RUN,
|
|
2340
2372
|
maxSupportCardsPerRun: typeof raw.maxSupportCardsPerRun === "number" ? raw.maxSupportCardsPerRun : DEFAULT_MAX_SUPPORT_PER_RUN,
|
|
2373
|
+
introExposeMinCount: typeof raw.introExposeMinCount === "number" ? raw.introExposeMinCount : DEFAULT_MIN_COUNT,
|
|
2341
2374
|
hierarchyWalk: {
|
|
2342
2375
|
enabled: raw.hierarchyWalk?.enabled !== false,
|
|
2343
2376
|
maxDepth: typeof raw.hierarchyWalk?.maxDepth === "number" ? raw.hierarchyWalk.maxDepth : DEFAULT_HIERARCHY_DEPTH
|
|
@@ -2413,18 +2446,11 @@ var init_prescribed = __esm({
|
|
|
2413
2446
|
group.hierarchyWalk?.enabled !== false,
|
|
2414
2447
|
group.hierarchyWalk?.maxDepth ?? DEFAULT_HIERARCHY_DEPTH
|
|
2415
2448
|
);
|
|
2416
|
-
const
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
exposeTags.add(`gpc:expose:${suffix}`);
|
|
2422
|
-
}
|
|
2423
|
-
}
|
|
2424
|
-
const unmetExposeTags = [...exposeTags].filter((tag) => {
|
|
2425
|
-
const tagElo = userTagElo[tag];
|
|
2426
|
-
return !tagElo || tagElo.count < DEFAULT_MIN_COUNT;
|
|
2427
|
-
});
|
|
2449
|
+
const unmetExposeTags = unmetIntroExposeTags(
|
|
2450
|
+
tags,
|
|
2451
|
+
userTagElo,
|
|
2452
|
+
group.introExposeMinCount ?? DEFAULT_MIN_COUNT
|
|
2453
|
+
);
|
|
2428
2454
|
if (unmetExposeTags.length > 0) {
|
|
2429
2455
|
unmetExposeTags.forEach((tag) => supportTags.add(tag));
|
|
2430
2456
|
}
|
|
@@ -4713,6 +4739,7 @@ var init_Pipeline = __esm({
|
|
|
4713
4739
|
}
|
|
4714
4740
|
logger.debug(`[Pipeline] Filter '${filter.name}': ${beforeScores.size} \u2192 ${cards.length} cards (\u2191${boosted} \u2193${penalized} =${passed})`);
|
|
4715
4741
|
}
|
|
4742
|
+
const scoredCards = cards;
|
|
4716
4743
|
cards = cards.filter((c) => c.score > 0);
|
|
4717
4744
|
const hints = this._ephemeralHints;
|
|
4718
4745
|
if (hints) {
|
|
@@ -4749,7 +4776,8 @@ var init_Pipeline = __esm({
|
|
|
4749
4776
|
cards,
|
|
4750
4777
|
result,
|
|
4751
4778
|
context.userElo,
|
|
4752
|
-
hints ?? void 0
|
|
4779
|
+
hints ?? void 0,
|
|
4780
|
+
scoredCards
|
|
4753
4781
|
);
|
|
4754
4782
|
captureRun(report);
|
|
4755
4783
|
} catch (e) {
|
|
@@ -11150,7 +11178,41 @@ Example:
|
|
|
11150
11178
|
});
|
|
11151
11179
|
|
|
11152
11180
|
// src/study/SessionController.ts
|
|
11153
|
-
|
|
11181
|
+
function sig4(x) {
|
|
11182
|
+
return Number(x.toPrecision(4));
|
|
11183
|
+
}
|
|
11184
|
+
function toRunCard(c) {
|
|
11185
|
+
return {
|
|
11186
|
+
cardId: c.cardId,
|
|
11187
|
+
origin: c.origin,
|
|
11188
|
+
...c.generator ? { generator: c.generator } : {},
|
|
11189
|
+
score: sig4(c.finalScore),
|
|
11190
|
+
selected: c.selected
|
|
11191
|
+
};
|
|
11192
|
+
}
|
|
11193
|
+
function toRunCardTrail(c) {
|
|
11194
|
+
return {
|
|
11195
|
+
...toRunCard(c),
|
|
11196
|
+
trail: c.provenance.filter((p) => p.action !== "passed").map((p) => ({
|
|
11197
|
+
strategyName: p.strategyName,
|
|
11198
|
+
action: p.action,
|
|
11199
|
+
score: sig4(p.score),
|
|
11200
|
+
reason: p.reason
|
|
11201
|
+
}))
|
|
11202
|
+
};
|
|
11203
|
+
}
|
|
11204
|
+
function persistedRunCards(run) {
|
|
11205
|
+
const selected = run.cards.filter((c) => c.selected);
|
|
11206
|
+
const runnersUp = run.cards.filter((c) => !c.selected).slice(0, PERSISTED_RUNNERS_UP);
|
|
11207
|
+
return [...selected, ...runnersUp].map(toRunCard);
|
|
11208
|
+
}
|
|
11209
|
+
function persistedUnselectedNew(u) {
|
|
11210
|
+
return {
|
|
11211
|
+
...u.nextInLine ? { nextInLine: toRunCardTrail(u.nextInLine) } : {},
|
|
11212
|
+
...u.topGenerated ? { topGenerated: toRunCardTrail(u.topGenerated) } : {}
|
|
11213
|
+
};
|
|
11214
|
+
}
|
|
11215
|
+
var PERSISTED_RUNNERS_UP, SessionController;
|
|
11154
11216
|
var init_SessionController = __esm({
|
|
11155
11217
|
"src/study/SessionController.ts"() {
|
|
11156
11218
|
"use strict";
|
|
@@ -11172,6 +11234,7 @@ var init_SessionController = __esm({
|
|
|
11172
11234
|
init_SessionDebugger();
|
|
11173
11235
|
init_SessionOverlay();
|
|
11174
11236
|
init_logger();
|
|
11237
|
+
PERSISTED_RUNNERS_UP = 5;
|
|
11175
11238
|
SessionController = class _SessionController extends Loggable {
|
|
11176
11239
|
_className = "SessionController";
|
|
11177
11240
|
services;
|
|
@@ -11454,13 +11517,16 @@ var init_SessionController = __esm({
|
|
|
11454
11517
|
newSelected: run.newSelected,
|
|
11455
11518
|
// Compact detail projected off the full report so a persisted run is
|
|
11456
11519
|
// self-explanatory once the in-memory ring buffer has rolled over.
|
|
11457
|
-
// Per-card provenance
|
|
11458
|
-
//
|
|
11520
|
+
// Per-card provenance is the dominant cost, so it's kept only for the
|
|
11521
|
+
// (at most two) `unselectedNew` cards, and only its score-changing
|
|
11522
|
+
// entries. Everything else is ids and scores.
|
|
11459
11523
|
...typeof run.userElo === "number" ? { userElo: run.userElo } : {},
|
|
11460
11524
|
...run.generators ? { generators: run.generators } : {},
|
|
11461
11525
|
...run.filters ? { filters: run.filters } : {},
|
|
11462
11526
|
...run.hints ? { hints: run.hints } : {},
|
|
11463
|
-
...run.discardedTail ? { discardedTail: run.discardedTail } : {}
|
|
11527
|
+
...run.discardedTail ? { discardedTail: run.discardedTail } : {},
|
|
11528
|
+
cards: persistedRunCards(run),
|
|
11529
|
+
...run.unselectedNew ? { unselectedNew: persistedUnselectedNew(run.unselectedNew) } : {}
|
|
11464
11530
|
});
|
|
11465
11531
|
}
|
|
11466
11532
|
}
|
|
@@ -14089,7 +14155,6 @@ var init_PouchDataLayerProvider = __esm({
|
|
|
14089
14155
|
"use strict";
|
|
14090
14156
|
init_logger();
|
|
14091
14157
|
init_dataDirectory();
|
|
14092
|
-
init_auth();
|
|
14093
14158
|
init_adminDB2();
|
|
14094
14159
|
init_classroomDB2();
|
|
14095
14160
|
init_courseDB();
|
|
@@ -14163,16 +14228,6 @@ var init_PouchDataLayerProvider = __esm({
|
|
|
14163
14228
|
getAdminDB() {
|
|
14164
14229
|
return new AdminDB();
|
|
14165
14230
|
}
|
|
14166
|
-
async createUserReaderForUser(targetUsername) {
|
|
14167
|
-
const requestingUsername = await getLoggedInUsername();
|
|
14168
|
-
if (requestingUsername !== "admin") {
|
|
14169
|
-
throw new Error("Unauthorized: Only admin users can access other users' data");
|
|
14170
|
-
}
|
|
14171
|
-
logger.info(`Admin user '${requestingUsername}' requesting UserDBReader for '${targetUsername}'`);
|
|
14172
|
-
const syncStrategy = new CouchDBSyncStrategy();
|
|
14173
|
-
const targetUserDB = await BaseUser.instance(syncStrategy, targetUsername);
|
|
14174
|
-
return targetUserDB;
|
|
14175
|
-
}
|
|
14176
14231
|
isReadOnly() {
|
|
14177
14232
|
return false;
|
|
14178
14233
|
}
|
|
@@ -15185,12 +15240,6 @@ var init_StaticDataLayerProvider = __esm({
|
|
|
15185
15240
|
getAdminDB() {
|
|
15186
15241
|
throw new Error("Admin functions not supported in static mode");
|
|
15187
15242
|
}
|
|
15188
|
-
async createUserReaderForUser(targetUsername) {
|
|
15189
|
-
logger.warn(`StaticDataLayerProvider: Multi-user access not supported in static mode`);
|
|
15190
|
-
logger.warn(`Request: trying to access data for ${targetUsername}`);
|
|
15191
|
-
logger.warn(`Returning current user's data instead`);
|
|
15192
|
-
return this.getUserDB();
|
|
15193
|
-
}
|
|
15194
15243
|
isReadOnly() {
|
|
15195
15244
|
return true;
|
|
15196
15245
|
}
|