@vue-skuilder/db 0.2.33 → 0.2.35
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-JmWYu8IK.d.ts → contentSource-BteiDpxH.d.ts} +2 -2
- package/dist/{contentSource-CTQ4kWhR.d.cts → contentSource-FQZcZopC.d.cts} +2 -2
- package/dist/core/index.d.cts +5 -5
- package/dist/core/index.d.ts +5 -5
- package/dist/core/index.js +2 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +2 -1
- package/dist/core/index.mjs.map +1 -1
- package/dist/{dataLayerProvider-DfI_KYAe.d.cts → dataLayerProvider-3y21KtF-.d.cts} +1 -1
- package/dist/{dataLayerProvider-rlLE2Mf-.d.ts → dataLayerProvider-C_QWzHf-.d.ts} +1 -1
- package/dist/diagnostics/index.d.cts +108 -5
- package/dist/diagnostics/index.d.ts +108 -5
- package/dist/diagnostics/index.js +129 -0
- package/dist/diagnostics/index.js.map +1 -1
- package/dist/diagnostics/index.mjs +128 -0
- package/dist/diagnostics/index.mjs.map +1 -1
- package/dist/impl/couch/index.d.cts +3 -3
- package/dist/impl/couch/index.d.ts +3 -3
- package/dist/impl/couch/index.js +2 -1
- package/dist/impl/couch/index.js.map +1 -1
- package/dist/impl/couch/index.mjs +2 -1
- package/dist/impl/couch/index.mjs.map +1 -1
- package/dist/impl/static/index.d.cts +4 -4
- package/dist/impl/static/index.d.ts +4 -4
- package/dist/impl/static/index.js +2 -1
- package/dist/impl/static/index.js.map +1 -1
- package/dist/impl/static/index.mjs +2 -1
- package/dist/impl/static/index.mjs.map +1 -1
- package/dist/{index-Ktg72jKb.d.cts → index-BIum9Ue2.d.cts} +1 -1
- package/dist/{index-CVGehe_t.d.ts → index-C745YB_6.d.ts} +1 -1
- package/dist/index.d.cts +12 -10
- package/dist/index.d.ts +12 -10
- package/dist/index.js +27 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +32 -18
- package/dist/index.mjs.map +1 -1
- package/dist/{types-D0oQeJAi.d.cts → types-BcWVH4ww.d.cts} +1 -1
- package/dist/{types-dXWfyz9B.d.ts → types-DF0JuPbs.d.ts} +1 -1
- package/dist/{types-legacy-BkOYOR6U.d.cts → types-legacy-DdVjg81H.d.cts} +1 -1
- package/dist/{types-legacy-BkOYOR6U.d.ts → types-legacy-DdVjg81H.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 +3 -3
- package/src/core/navigators/filters/eloDistance.ts +10 -0
- package/src/courseConfigRegistration.ts +22 -10
- package/src/diagnostics/derive.ts +6 -0
- package/src/diagnostics/index.ts +1 -0
- package/src/diagnostics/tagElo.ts +257 -0
- package/src/study/SpacedRepetition.ts +23 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { U as UserDBInterface, C as CourseDBInterface, a as CoursesDBInterface } from './contentSource-
|
|
1
|
+
import { U as UserDBInterface, C as CourseDBInterface, a as CoursesDBInterface } from './contentSource-FQZcZopC.cjs';
|
|
2
2
|
import { C as ClassroomDBInterface, A as AdminDBInterface } from './classroomDB-DLTtLZct.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { U as UserDBInterface, C as CourseDBInterface, a as CoursesDBInterface } from './contentSource-
|
|
1
|
+
import { U as UserDBInterface, C as CourseDBInterface, a as CoursesDBInterface } from './contentSource-BteiDpxH.js';
|
|
2
2
|
import { C as ClassroomDBInterface, A as AdminDBInterface } from './classroomDB-DLTtLZct.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { C as CardData,
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
4
|
-
import '@vue-skuilder/common';
|
|
1
|
+
import { C as CardData, b as DisplayableData, a as Tag, c as CardRecord, d as QuestionRecord, e as CardHistory } from '../types-legacy-DdVjg81H.cjs';
|
|
2
|
+
import { c as ContentNavigationStrategyData, e as StudySessionDoc, f as ScheduledCard, g as CourseRegistrationDoc, h as SessionStateSnapshot, i as StudySessionRunSummary, j as RegulatorReading, k as StudySessionRunCard, F as FilterKind, l as RegulatorName } from '../contentSource-FQZcZopC.cjs';
|
|
3
|
+
export { m as SessionEloEvent, n as StudySessionRunCardTrail } from '../contentSource-FQZcZopC.cjs';
|
|
4
|
+
import { TagRole, TagPresentation, EloRank, CourseElo } from '@vue-skuilder/common';
|
|
5
5
|
import 'moment';
|
|
6
6
|
|
|
7
7
|
type RawDoc = {
|
|
@@ -158,6 +158,104 @@ declare function userDbName(username: string): string;
|
|
|
158
158
|
*/
|
|
159
159
|
declare function fetchLearnerDump(opts: FetchLearnerDumpOptions): Promise<LearnerDump>;
|
|
160
160
|
|
|
161
|
+
/**
|
|
162
|
+
* A learner's per-tag ELO, read for display: one row per tag on their course
|
|
163
|
+
* registration, the batches a view filters those rows by, and each rating's
|
|
164
|
+
* trajectory through the dataset's sessions.
|
|
165
|
+
*
|
|
166
|
+
* The source is the learner's `CourseElo` (global + per-tag `{score, count,
|
|
167
|
+
* recent}`). Session `eloEvents` add trajectories (per-tag before → after,
|
|
168
|
+
* from when sessions began recording them); card-history records add when a
|
|
169
|
+
* tag was first and last named by a response.
|
|
170
|
+
*/
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* A set of tags to view together, as data: every criterion given must hold.
|
|
174
|
+
*
|
|
175
|
+
* Plain data on purpose. Choosing which tags count is the same question the
|
|
176
|
+
* tag-aware ELO distance filter has open (`tagAwareGap` in
|
|
177
|
+
* `filters/eloDistance.ts`); a serializable batch can later move into a
|
|
178
|
+
* strategy config and serve both.
|
|
179
|
+
*/
|
|
180
|
+
interface TagBatch {
|
|
181
|
+
id: string;
|
|
182
|
+
label: string;
|
|
183
|
+
/** Tag namespaces (see {@link tagNamespace}); `''` is tags with none. */
|
|
184
|
+
namespaces?: string[];
|
|
185
|
+
/** Tag roles; `'none'` is tags without one. */
|
|
186
|
+
roles?: Array<TagRole | 'none'>;
|
|
187
|
+
/** Tags starting with any of these. */
|
|
188
|
+
prefixes?: string[];
|
|
189
|
+
/** Tags starting with any of these are left out. */
|
|
190
|
+
excludePrefixes?: string[];
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* The colon-delimited segments that scope a tag: what comes before its role
|
|
194
|
+
* (`gpc:exercise:x` → `gpc`), else its first segment (`concept:match:x` →
|
|
195
|
+
* `concept`). `''` for a tag with neither (`femur`, `expose:x`).
|
|
196
|
+
*/
|
|
197
|
+
declare function tagNamespace(tag: string): string;
|
|
198
|
+
declare function matchesTagBatch(tag: string, batch: TagBatch, role?: "intro" | "exercise" | "expose" | null): boolean;
|
|
199
|
+
/** The namespace × role batch a tag falls in, e.g. `gpc:exercise`, `concept`, or `(no namespace)`. */
|
|
200
|
+
declare function tagGroupBatch(tag: string): TagBatch;
|
|
201
|
+
interface TagEloRow {
|
|
202
|
+
tag: string;
|
|
203
|
+
role: TagRole | null;
|
|
204
|
+
namespace: string;
|
|
205
|
+
/** Id of the tag's {@link tagGroupBatch}. */
|
|
206
|
+
group: string;
|
|
207
|
+
/**
|
|
208
|
+
* The learner's rating on the tag. Null for a count-only tag: a bookkeeping
|
|
209
|
+
* role (`intro`, `expose`), or the count-only sentinel.
|
|
210
|
+
*/
|
|
211
|
+
score: number | null;
|
|
212
|
+
/**
|
|
213
|
+
* A real score stored on a bookkeeping-role tag, from before roles were
|
|
214
|
+
* count-only. Not a rating: the framework ignores it.
|
|
215
|
+
*/
|
|
216
|
+
staleScore?: number;
|
|
217
|
+
count: number;
|
|
218
|
+
/** `score − global`; null when score is. */
|
|
219
|
+
vsGlobal: number | null;
|
|
220
|
+
/** The rating's ring buffer of recent first attempts, oldest first. */
|
|
221
|
+
recent: TagPresentation[];
|
|
222
|
+
/** First-attempt correct entries in `recent`. */
|
|
223
|
+
recentOk: number;
|
|
224
|
+
/** First and last response whose per-tag performance named the tag, or a recent entry. */
|
|
225
|
+
firstSeen: string | null;
|
|
226
|
+
lastSeen: string | null;
|
|
227
|
+
/** ELO events on the tag in the dataset's sessions. */
|
|
228
|
+
events: number;
|
|
229
|
+
}
|
|
230
|
+
interface EloPoint {
|
|
231
|
+
at: string;
|
|
232
|
+
score: number;
|
|
233
|
+
}
|
|
234
|
+
interface TagEloView {
|
|
235
|
+
global: EloRank;
|
|
236
|
+
/** Every tag on the registration, highest score first, count-only tags last. */
|
|
237
|
+
rows: TagEloRow[];
|
|
238
|
+
/** The namespace × role batches present, graded ones first. */
|
|
239
|
+
groups: TagBatch[];
|
|
240
|
+
/**
|
|
241
|
+
* Ratings through the dataset's ELO events: each series starts at its first
|
|
242
|
+
* event's `before`, has a point per event, and ends at the current score at
|
|
243
|
+
* `asOf`. A move between recorded events (a session that didn't save its
|
|
244
|
+
* events) shows as a step at the next event, or at `asOf`. Tags with no
|
|
245
|
+
* events have no series; count-only tags have none.
|
|
246
|
+
*/
|
|
247
|
+
series: {
|
|
248
|
+
global: EloPoint[];
|
|
249
|
+
tags: Record<string, EloPoint[]>;
|
|
250
|
+
};
|
|
251
|
+
/** The first ELO event, or null: trajectories start here. */
|
|
252
|
+
seriesFrom: string | null;
|
|
253
|
+
}
|
|
254
|
+
/** The learner's `CourseElo` for the dataset's course, or null if not registered. */
|
|
255
|
+
declare function learnerCourseElo(ds: LearnerDataset): CourseElo | null;
|
|
256
|
+
/** The learner's per-tag ELO for display. Null if the dataset has no registration for its course. */
|
|
257
|
+
declare function tagEloView(ds: LearnerDataset): TagEloView | null;
|
|
258
|
+
|
|
161
259
|
/**
|
|
162
260
|
* Derivations over a `LearnerDataset`: pure functions that views, text
|
|
163
261
|
* exports, and (later) detectors share. Ported from LettersPractice's admin
|
|
@@ -183,6 +281,11 @@ interface DiagnosticsInterpreters {
|
|
|
183
281
|
snapshotMetrics?(snapshot: SessionStateSnapshot): Record<string, number>;
|
|
184
282
|
/** Which `snapshotMetrics` labels count as progress (for `stalled`). Default: none. */
|
|
185
283
|
progressMetrics?: string[];
|
|
284
|
+
/**
|
|
285
|
+
* Named tag batches for the ELO view, offered beside the namespace × role
|
|
286
|
+
* batches it finds on its own. Default: none.
|
|
287
|
+
*/
|
|
288
|
+
tagBatches?: TagBatch[];
|
|
186
289
|
}
|
|
187
290
|
declare const isSkillTag: (i: DiagnosticsInterpreters | undefined, tag: string) => boolean;
|
|
188
291
|
declare const shortTag: (i: DiagnosticsInterpreters | undefined, tag: string) => string;
|
|
@@ -455,4 +558,4 @@ declare function pipelineRunStats(ds: LearnerDataset, opts?: {
|
|
|
455
558
|
since?: string;
|
|
456
559
|
}): PipelineRunStats;
|
|
457
560
|
|
|
458
|
-
export { type CardDossier, type CardSummary, type CouchAuth, type CourseSlice, type DatasetCardHistory, type DatasetRecord, type DiagnosticsInterpreters, type EloLedger, type FetchLearnerDumpOptions, FilterKind, type FilterRunStat, type GeneratorRunStat, type LearnerDataset, type LearnerDump, type PipelineRunStats, RegulatorName, RegulatorReading, type RegulatorRunStat, type ResponseEloDelta, SESSION_FLAGS, SESSION_FLAG_THRESHOLDS, type ServedTagStat, type SessionDetail, type SessionFlag, type SessionStateRow, SessionStateSnapshot, type SessionSummary, StudySessionDoc, StudySessionRunCard, StudySessionRunSummary, type TimelineEntry, type TimelineResponse, type TimelineRun, cardDossiers, dumpFileName, eloLedger, fetchLearnerDump, fmtAnswer, fmtDelta, fmtDuration, fmtScore, fromDump, isSkillTag, parseLearnerDump, pipelineRunStats, recordPerformance, regulatorText, runCardSource, runText, scoredTagDeltas, selectedBySource, servedTags, sessionDetail, sessionText, shortTag, summarizeSession, summarizeSessions, toIsoTimestamp, userDbName };
|
|
561
|
+
export { type CardDossier, type CardSummary, type CouchAuth, type CourseSlice, type DatasetCardHistory, type DatasetRecord, type DiagnosticsInterpreters, type EloLedger, type EloPoint, type FetchLearnerDumpOptions, FilterKind, type FilterRunStat, type GeneratorRunStat, type LearnerDataset, type LearnerDump, type PipelineRunStats, RegulatorName, RegulatorReading, type RegulatorRunStat, type ResponseEloDelta, SESSION_FLAGS, SESSION_FLAG_THRESHOLDS, type ServedTagStat, type SessionDetail, type SessionFlag, type SessionStateRow, SessionStateSnapshot, type SessionSummary, StudySessionDoc, StudySessionRunCard, StudySessionRunSummary, type TagBatch, type TagEloRow, type TagEloView, type TimelineEntry, type TimelineResponse, type TimelineRun, cardDossiers, dumpFileName, eloLedger, fetchLearnerDump, fmtAnswer, fmtDelta, fmtDuration, fmtScore, fromDump, isSkillTag, learnerCourseElo, matchesTagBatch, parseLearnerDump, pipelineRunStats, recordPerformance, regulatorText, runCardSource, runText, scoredTagDeltas, selectedBySource, servedTags, sessionDetail, sessionText, shortTag, summarizeSession, summarizeSessions, tagEloView, tagGroupBatch, tagNamespace, toIsoTimestamp, userDbName };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { C as CardData,
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
4
|
-
import '@vue-skuilder/common';
|
|
1
|
+
import { C as CardData, b as DisplayableData, a as Tag, c as CardRecord, d as QuestionRecord, e as CardHistory } from '../types-legacy-DdVjg81H.js';
|
|
2
|
+
import { c as ContentNavigationStrategyData, e as StudySessionDoc, f as ScheduledCard, g as CourseRegistrationDoc, h as SessionStateSnapshot, i as StudySessionRunSummary, j as RegulatorReading, k as StudySessionRunCard, F as FilterKind, l as RegulatorName } from '../contentSource-BteiDpxH.js';
|
|
3
|
+
export { m as SessionEloEvent, n as StudySessionRunCardTrail } from '../contentSource-BteiDpxH.js';
|
|
4
|
+
import { TagRole, TagPresentation, EloRank, CourseElo } from '@vue-skuilder/common';
|
|
5
5
|
import 'moment';
|
|
6
6
|
|
|
7
7
|
type RawDoc = {
|
|
@@ -158,6 +158,104 @@ declare function userDbName(username: string): string;
|
|
|
158
158
|
*/
|
|
159
159
|
declare function fetchLearnerDump(opts: FetchLearnerDumpOptions): Promise<LearnerDump>;
|
|
160
160
|
|
|
161
|
+
/**
|
|
162
|
+
* A learner's per-tag ELO, read for display: one row per tag on their course
|
|
163
|
+
* registration, the batches a view filters those rows by, and each rating's
|
|
164
|
+
* trajectory through the dataset's sessions.
|
|
165
|
+
*
|
|
166
|
+
* The source is the learner's `CourseElo` (global + per-tag `{score, count,
|
|
167
|
+
* recent}`). Session `eloEvents` add trajectories (per-tag before → after,
|
|
168
|
+
* from when sessions began recording them); card-history records add when a
|
|
169
|
+
* tag was first and last named by a response.
|
|
170
|
+
*/
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* A set of tags to view together, as data: every criterion given must hold.
|
|
174
|
+
*
|
|
175
|
+
* Plain data on purpose. Choosing which tags count is the same question the
|
|
176
|
+
* tag-aware ELO distance filter has open (`tagAwareGap` in
|
|
177
|
+
* `filters/eloDistance.ts`); a serializable batch can later move into a
|
|
178
|
+
* strategy config and serve both.
|
|
179
|
+
*/
|
|
180
|
+
interface TagBatch {
|
|
181
|
+
id: string;
|
|
182
|
+
label: string;
|
|
183
|
+
/** Tag namespaces (see {@link tagNamespace}); `''` is tags with none. */
|
|
184
|
+
namespaces?: string[];
|
|
185
|
+
/** Tag roles; `'none'` is tags without one. */
|
|
186
|
+
roles?: Array<TagRole | 'none'>;
|
|
187
|
+
/** Tags starting with any of these. */
|
|
188
|
+
prefixes?: string[];
|
|
189
|
+
/** Tags starting with any of these are left out. */
|
|
190
|
+
excludePrefixes?: string[];
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* The colon-delimited segments that scope a tag: what comes before its role
|
|
194
|
+
* (`gpc:exercise:x` → `gpc`), else its first segment (`concept:match:x` →
|
|
195
|
+
* `concept`). `''` for a tag with neither (`femur`, `expose:x`).
|
|
196
|
+
*/
|
|
197
|
+
declare function tagNamespace(tag: string): string;
|
|
198
|
+
declare function matchesTagBatch(tag: string, batch: TagBatch, role?: "intro" | "exercise" | "expose" | null): boolean;
|
|
199
|
+
/** The namespace × role batch a tag falls in, e.g. `gpc:exercise`, `concept`, or `(no namespace)`. */
|
|
200
|
+
declare function tagGroupBatch(tag: string): TagBatch;
|
|
201
|
+
interface TagEloRow {
|
|
202
|
+
tag: string;
|
|
203
|
+
role: TagRole | null;
|
|
204
|
+
namespace: string;
|
|
205
|
+
/** Id of the tag's {@link tagGroupBatch}. */
|
|
206
|
+
group: string;
|
|
207
|
+
/**
|
|
208
|
+
* The learner's rating on the tag. Null for a count-only tag: a bookkeeping
|
|
209
|
+
* role (`intro`, `expose`), or the count-only sentinel.
|
|
210
|
+
*/
|
|
211
|
+
score: number | null;
|
|
212
|
+
/**
|
|
213
|
+
* A real score stored on a bookkeeping-role tag, from before roles were
|
|
214
|
+
* count-only. Not a rating: the framework ignores it.
|
|
215
|
+
*/
|
|
216
|
+
staleScore?: number;
|
|
217
|
+
count: number;
|
|
218
|
+
/** `score − global`; null when score is. */
|
|
219
|
+
vsGlobal: number | null;
|
|
220
|
+
/** The rating's ring buffer of recent first attempts, oldest first. */
|
|
221
|
+
recent: TagPresentation[];
|
|
222
|
+
/** First-attempt correct entries in `recent`. */
|
|
223
|
+
recentOk: number;
|
|
224
|
+
/** First and last response whose per-tag performance named the tag, or a recent entry. */
|
|
225
|
+
firstSeen: string | null;
|
|
226
|
+
lastSeen: string | null;
|
|
227
|
+
/** ELO events on the tag in the dataset's sessions. */
|
|
228
|
+
events: number;
|
|
229
|
+
}
|
|
230
|
+
interface EloPoint {
|
|
231
|
+
at: string;
|
|
232
|
+
score: number;
|
|
233
|
+
}
|
|
234
|
+
interface TagEloView {
|
|
235
|
+
global: EloRank;
|
|
236
|
+
/** Every tag on the registration, highest score first, count-only tags last. */
|
|
237
|
+
rows: TagEloRow[];
|
|
238
|
+
/** The namespace × role batches present, graded ones first. */
|
|
239
|
+
groups: TagBatch[];
|
|
240
|
+
/**
|
|
241
|
+
* Ratings through the dataset's ELO events: each series starts at its first
|
|
242
|
+
* event's `before`, has a point per event, and ends at the current score at
|
|
243
|
+
* `asOf`. A move between recorded events (a session that didn't save its
|
|
244
|
+
* events) shows as a step at the next event, or at `asOf`. Tags with no
|
|
245
|
+
* events have no series; count-only tags have none.
|
|
246
|
+
*/
|
|
247
|
+
series: {
|
|
248
|
+
global: EloPoint[];
|
|
249
|
+
tags: Record<string, EloPoint[]>;
|
|
250
|
+
};
|
|
251
|
+
/** The first ELO event, or null: trajectories start here. */
|
|
252
|
+
seriesFrom: string | null;
|
|
253
|
+
}
|
|
254
|
+
/** The learner's `CourseElo` for the dataset's course, or null if not registered. */
|
|
255
|
+
declare function learnerCourseElo(ds: LearnerDataset): CourseElo | null;
|
|
256
|
+
/** The learner's per-tag ELO for display. Null if the dataset has no registration for its course. */
|
|
257
|
+
declare function tagEloView(ds: LearnerDataset): TagEloView | null;
|
|
258
|
+
|
|
161
259
|
/**
|
|
162
260
|
* Derivations over a `LearnerDataset`: pure functions that views, text
|
|
163
261
|
* exports, and (later) detectors share. Ported from LettersPractice's admin
|
|
@@ -183,6 +281,11 @@ interface DiagnosticsInterpreters {
|
|
|
183
281
|
snapshotMetrics?(snapshot: SessionStateSnapshot): Record<string, number>;
|
|
184
282
|
/** Which `snapshotMetrics` labels count as progress (for `stalled`). Default: none. */
|
|
185
283
|
progressMetrics?: string[];
|
|
284
|
+
/**
|
|
285
|
+
* Named tag batches for the ELO view, offered beside the namespace × role
|
|
286
|
+
* batches it finds on its own. Default: none.
|
|
287
|
+
*/
|
|
288
|
+
tagBatches?: TagBatch[];
|
|
186
289
|
}
|
|
187
290
|
declare const isSkillTag: (i: DiagnosticsInterpreters | undefined, tag: string) => boolean;
|
|
188
291
|
declare const shortTag: (i: DiagnosticsInterpreters | undefined, tag: string) => string;
|
|
@@ -455,4 +558,4 @@ declare function pipelineRunStats(ds: LearnerDataset, opts?: {
|
|
|
455
558
|
since?: string;
|
|
456
559
|
}): PipelineRunStats;
|
|
457
560
|
|
|
458
|
-
export { type CardDossier, type CardSummary, type CouchAuth, type CourseSlice, type DatasetCardHistory, type DatasetRecord, type DiagnosticsInterpreters, type EloLedger, type FetchLearnerDumpOptions, FilterKind, type FilterRunStat, type GeneratorRunStat, type LearnerDataset, type LearnerDump, type PipelineRunStats, RegulatorName, RegulatorReading, type RegulatorRunStat, type ResponseEloDelta, SESSION_FLAGS, SESSION_FLAG_THRESHOLDS, type ServedTagStat, type SessionDetail, type SessionFlag, type SessionStateRow, SessionStateSnapshot, type SessionSummary, StudySessionDoc, StudySessionRunCard, StudySessionRunSummary, type TimelineEntry, type TimelineResponse, type TimelineRun, cardDossiers, dumpFileName, eloLedger, fetchLearnerDump, fmtAnswer, fmtDelta, fmtDuration, fmtScore, fromDump, isSkillTag, parseLearnerDump, pipelineRunStats, recordPerformance, regulatorText, runCardSource, runText, scoredTagDeltas, selectedBySource, servedTags, sessionDetail, sessionText, shortTag, summarizeSession, summarizeSessions, toIsoTimestamp, userDbName };
|
|
561
|
+
export { type CardDossier, type CardSummary, type CouchAuth, type CourseSlice, type DatasetCardHistory, type DatasetRecord, type DiagnosticsInterpreters, type EloLedger, type EloPoint, type FetchLearnerDumpOptions, FilterKind, type FilterRunStat, type GeneratorRunStat, type LearnerDataset, type LearnerDump, type PipelineRunStats, RegulatorName, RegulatorReading, type RegulatorRunStat, type ResponseEloDelta, SESSION_FLAGS, SESSION_FLAG_THRESHOLDS, type ServedTagStat, type SessionDetail, type SessionFlag, type SessionStateRow, SessionStateSnapshot, type SessionSummary, StudySessionDoc, StudySessionRunCard, StudySessionRunSummary, type TagBatch, type TagEloRow, type TagEloView, type TimelineEntry, type TimelineResponse, type TimelineRun, cardDossiers, dumpFileName, eloLedger, fetchLearnerDump, fmtAnswer, fmtDelta, fmtDuration, fmtScore, fromDump, isSkillTag, learnerCourseElo, matchesTagBatch, parseLearnerDump, pipelineRunStats, recordPerformance, regulatorText, runCardSource, runText, scoredTagDeltas, selectedBySource, servedTags, sessionDetail, sessionText, shortTag, summarizeSession, summarizeSessions, tagEloView, tagGroupBatch, tagNamespace, toIsoTimestamp, userDbName };
|
|
@@ -32,6 +32,8 @@ __export(diagnostics_exports, {
|
|
|
32
32
|
fmtScore: () => fmtScore,
|
|
33
33
|
fromDump: () => fromDump,
|
|
34
34
|
isSkillTag: () => isSkillTag,
|
|
35
|
+
learnerCourseElo: () => learnerCourseElo,
|
|
36
|
+
matchesTagBatch: () => matchesTagBatch,
|
|
35
37
|
parseLearnerDump: () => parseLearnerDump,
|
|
36
38
|
pipelineRunStats: () => pipelineRunStats,
|
|
37
39
|
recordPerformance: () => recordPerformance,
|
|
@@ -46,6 +48,9 @@ __export(diagnostics_exports, {
|
|
|
46
48
|
shortTag: () => shortTag,
|
|
47
49
|
summarizeSession: () => summarizeSession,
|
|
48
50
|
summarizeSessions: () => summarizeSessions,
|
|
51
|
+
tagEloView: () => tagEloView,
|
|
52
|
+
tagGroupBatch: () => tagGroupBatch,
|
|
53
|
+
tagNamespace: () => tagNamespace,
|
|
49
54
|
toIsoTimestamp: () => toIsoTimestamp,
|
|
50
55
|
userDbName: () => userDbName
|
|
51
56
|
});
|
|
@@ -934,6 +939,125 @@ function sessionText(username, detail, extras = {}, interp) {
|
|
|
934
939
|
}
|
|
935
940
|
return L.join("\n");
|
|
936
941
|
}
|
|
942
|
+
|
|
943
|
+
// src/diagnostics/tagElo.ts
|
|
944
|
+
var import_common = require("@vue-skuilder/common");
|
|
945
|
+
function beforeRole(tag, role) {
|
|
946
|
+
const match = new RegExp(`(^|:)${role}:(?=.)`).exec(tag);
|
|
947
|
+
return match ? tag.slice(0, match.index) : "";
|
|
948
|
+
}
|
|
949
|
+
function tagNamespace(tag) {
|
|
950
|
+
const role = (0, import_common.tagRole)(tag);
|
|
951
|
+
if (role) return beforeRole(tag, role);
|
|
952
|
+
const colon = tag.indexOf(":");
|
|
953
|
+
return colon > 0 ? tag.slice(0, colon) : "";
|
|
954
|
+
}
|
|
955
|
+
function matchesTagBatch(tag, batch, role = (0, import_common.tagRole)(tag)) {
|
|
956
|
+
if (batch.namespaces && !batch.namespaces.includes(tagNamespace(tag))) return false;
|
|
957
|
+
if (batch.roles && !batch.roles.includes(role ?? "none")) return false;
|
|
958
|
+
if (batch.prefixes && !batch.prefixes.some((p) => tag.startsWith(p))) return false;
|
|
959
|
+
if (batch.excludePrefixes?.some((p) => tag.startsWith(p))) return false;
|
|
960
|
+
return true;
|
|
961
|
+
}
|
|
962
|
+
function tagGroupBatch(tag) {
|
|
963
|
+
const role = (0, import_common.tagRole)(tag);
|
|
964
|
+
const ns = tagNamespace(tag);
|
|
965
|
+
const id = [ns, role].filter(Boolean).join(":") || "(no namespace)";
|
|
966
|
+
return { id, label: id, namespaces: [ns], roles: [role ?? "none"] };
|
|
967
|
+
}
|
|
968
|
+
function learnerCourseElo(ds) {
|
|
969
|
+
const elo = ds.registration?.courses?.find((c) => c.courseID === ds.courseId)?.elo;
|
|
970
|
+
if (typeof elo === "number") return { global: { score: elo, count: 0 }, tags: {}, misc: {} };
|
|
971
|
+
if (!elo || typeof elo !== "object" || !elo.global) return null;
|
|
972
|
+
return { ...elo, tags: elo.tags ?? {}, misc: elo.misc ?? {} };
|
|
973
|
+
}
|
|
974
|
+
function minIso(a, b) {
|
|
975
|
+
return a === null || b < a ? b : a;
|
|
976
|
+
}
|
|
977
|
+
function maxIso(a, b) {
|
|
978
|
+
return a === null || b > a ? b : a;
|
|
979
|
+
}
|
|
980
|
+
function step(line, at, before, after) {
|
|
981
|
+
if (before !== import_common.COUNT_ONLY_SCORE && line[line.length - 1]?.score !== before)
|
|
982
|
+
line.push({ at, score: before });
|
|
983
|
+
line.push({ at, score: after });
|
|
984
|
+
}
|
|
985
|
+
function tagEloView(ds) {
|
|
986
|
+
const elo = learnerCourseElo(ds);
|
|
987
|
+
if (!elo) return null;
|
|
988
|
+
const seen = /* @__PURE__ */ new Map();
|
|
989
|
+
for (const h of ds.cardHistories) {
|
|
990
|
+
for (const r of h.records) {
|
|
991
|
+
const p = r.performance;
|
|
992
|
+
if (!p || typeof p !== "object") continue;
|
|
993
|
+
for (const tag of Object.keys(p)) {
|
|
994
|
+
if (tag === "_global") continue;
|
|
995
|
+
const s = seen.get(tag) ?? { first: null, last: null };
|
|
996
|
+
s.first = minIso(s.first, r.timeStamp);
|
|
997
|
+
s.last = maxIso(s.last, r.timeStamp);
|
|
998
|
+
seen.set(tag, s);
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
const events = ds.sessions.flatMap((s) => s.eloEvents ?? []).sort((a, b) => a.at.localeCompare(b.at));
|
|
1003
|
+
const globalSeries = [];
|
|
1004
|
+
const tagSeries = {};
|
|
1005
|
+
const eventCounts = /* @__PURE__ */ new Map();
|
|
1006
|
+
for (const e of events) {
|
|
1007
|
+
step(globalSeries, e.at, e.global.before, e.global.after);
|
|
1008
|
+
for (const [tag, t] of Object.entries(e.tags ?? {})) {
|
|
1009
|
+
eventCounts.set(tag, (eventCounts.get(tag) ?? 0) + 1);
|
|
1010
|
+
if (t.score === null || (0, import_common.isCountOnlyTag)(tag) || t.after === import_common.COUNT_ONLY_SCORE) continue;
|
|
1011
|
+
step(tagSeries[tag] ??= [], e.at, t.before, t.after);
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
const rows = Object.entries(elo.tags).map(([tag, rank]) => {
|
|
1015
|
+
const role = (0, import_common.tagRole)(tag);
|
|
1016
|
+
const countOnly = (0, import_common.isCountOnlyTag)(tag) || rank.score === import_common.COUNT_ONLY_SCORE;
|
|
1017
|
+
const score = countOnly ? null : rank.score;
|
|
1018
|
+
const recent = rank.recent ?? [];
|
|
1019
|
+
let { first, last } = seen.get(tag) ?? { first: null, last: null };
|
|
1020
|
+
for (const p of recent) {
|
|
1021
|
+
first = minIso(first, p.at);
|
|
1022
|
+
last = maxIso(last, p.at);
|
|
1023
|
+
}
|
|
1024
|
+
return {
|
|
1025
|
+
tag,
|
|
1026
|
+
role,
|
|
1027
|
+
namespace: tagNamespace(tag),
|
|
1028
|
+
group: tagGroupBatch(tag).id,
|
|
1029
|
+
score,
|
|
1030
|
+
...countOnly && rank.score !== import_common.COUNT_ONLY_SCORE ? { staleScore: rank.score } : {},
|
|
1031
|
+
count: rank.count,
|
|
1032
|
+
vsGlobal: score === null ? null : score - elo.global.score,
|
|
1033
|
+
recent,
|
|
1034
|
+
recentOk: recent.filter((p) => p.ok).length,
|
|
1035
|
+
firstSeen: first,
|
|
1036
|
+
lastSeen: last,
|
|
1037
|
+
events: eventCounts.get(tag) ?? 0
|
|
1038
|
+
};
|
|
1039
|
+
});
|
|
1040
|
+
rows.sort(
|
|
1041
|
+
(a, b) => a.score === null || b.score === null ? Number(a.score === null) - Number(b.score === null) || a.tag.localeCompare(b.tag) : b.score - a.score || a.tag.localeCompare(b.tag)
|
|
1042
|
+
);
|
|
1043
|
+
if (globalSeries.length > 0) globalSeries.push({ at: ds.asOf, score: elo.global.score });
|
|
1044
|
+
for (const row of rows) {
|
|
1045
|
+
const line = tagSeries[row.tag];
|
|
1046
|
+
if (line && row.score !== null) line.push({ at: ds.asOf, score: row.score });
|
|
1047
|
+
}
|
|
1048
|
+
const groups = /* @__PURE__ */ new Map();
|
|
1049
|
+
for (const row of rows) if (!groups.has(row.group)) groups.set(row.group, tagGroupBatch(row.tag));
|
|
1050
|
+
const countOnlyGroup = (b) => b.roles?.some((r) => r === "intro" || r === "expose") ?? false;
|
|
1051
|
+
return {
|
|
1052
|
+
global: elo.global,
|
|
1053
|
+
rows,
|
|
1054
|
+
groups: [...groups.values()].sort(
|
|
1055
|
+
(a, b) => Number(countOnlyGroup(a)) - Number(countOnlyGroup(b)) || a.id.localeCompare(b.id)
|
|
1056
|
+
),
|
|
1057
|
+
series: { global: globalSeries, tags: tagSeries },
|
|
1058
|
+
seriesFrom: events[0]?.at ?? null
|
|
1059
|
+
};
|
|
1060
|
+
}
|
|
937
1061
|
// Annotate the CommonJS export names for ESM import in node:
|
|
938
1062
|
0 && (module.exports = {
|
|
939
1063
|
SESSION_FLAGS,
|
|
@@ -948,6 +1072,8 @@ function sessionText(username, detail, extras = {}, interp) {
|
|
|
948
1072
|
fmtScore,
|
|
949
1073
|
fromDump,
|
|
950
1074
|
isSkillTag,
|
|
1075
|
+
learnerCourseElo,
|
|
1076
|
+
matchesTagBatch,
|
|
951
1077
|
parseLearnerDump,
|
|
952
1078
|
pipelineRunStats,
|
|
953
1079
|
recordPerformance,
|
|
@@ -962,6 +1088,9 @@ function sessionText(username, detail, extras = {}, interp) {
|
|
|
962
1088
|
shortTag,
|
|
963
1089
|
summarizeSession,
|
|
964
1090
|
summarizeSessions,
|
|
1091
|
+
tagEloView,
|
|
1092
|
+
tagGroupBatch,
|
|
1093
|
+
tagNamespace,
|
|
965
1094
|
toIsoTimestamp,
|
|
966
1095
|
userDbName
|
|
967
1096
|
});
|