seance-cli 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/README.md +40 -2
- package/dist/commands/init.d.ts +29 -0
- package/dist/commands/init.js +310 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/mcp.d.ts +19 -0
- package/dist/commands/mcp.js +38 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/commands/quiz.d.ts +23 -0
- package/dist/commands/quiz.js +187 -0
- package/dist/commands/quiz.js.map +1 -0
- package/dist/commands/review.d.ts +4 -0
- package/dist/commands/review.js +115 -0
- package/dist/commands/review.js.map +1 -0
- package/dist/commands/sync.d.ts +17 -0
- package/dist/commands/sync.js +367 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/git.d.ts +33 -0
- package/dist/git.js +103 -0
- package/dist/git.js.map +1 -0
- package/dist/hosted-api.d.ts +24 -0
- package/dist/hosted-api.js +85 -0
- package/dist/hosted-api.js.map +1 -0
- package/dist/hosted-consent.d.ts +8 -0
- package/dist/hosted-consent.js +37 -0
- package/dist/hosted-consent.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +108 -0
- package/dist/index.js.map +1 -0
- package/dist/init-fs.d.ts +51 -0
- package/dist/init-fs.js +220 -0
- package/dist/init-fs.js.map +1 -0
- package/dist/init-questions.d.ts +21 -0
- package/dist/init-questions.js +161 -0
- package/dist/init-questions.js.map +1 -0
- package/dist/mcp-handlers.d.ts +22 -0
- package/dist/mcp-handlers.js +185 -0
- package/dist/mcp-handlers.js.map +1 -0
- package/dist/mcp-server.d.ts +4 -0
- package/dist/mcp-server.js +39 -0
- package/dist/mcp-server.js.map +1 -0
- package/dist/prompter.d.ts +29 -0
- package/dist/prompter.js +42 -0
- package/dist/prompter.js.map +1 -0
- package/dist/quiz-backend.d.ts +40 -0
- package/dist/quiz-backend.js +116 -0
- package/dist/quiz-backend.js.map +1 -0
- package/dist/quiz-input.d.ts +12 -0
- package/dist/quiz-input.js +52 -0
- package/dist/quiz-input.js.map +1 -0
- package/dist/quiz-io.d.ts +30 -0
- package/dist/quiz-io.js +83 -0
- package/dist/quiz-io.js.map +1 -0
- package/dist/quiz-ui.d.ts +18 -0
- package/dist/quiz-ui.js +51 -0
- package/dist/quiz-ui.js.map +1 -0
- package/node_modules/@seance/ai/LICENSE +21 -0
- package/node_modules/@seance/ai/dist/chain.d.ts +31 -0
- package/node_modules/@seance/ai/dist/chain.js +114 -0
- package/node_modules/@seance/ai/dist/chain.js.map +1 -0
- package/node_modules/@seance/ai/dist/grade.d.ts +14 -0
- package/node_modules/@seance/ai/dist/grade.js +44 -0
- package/node_modules/@seance/ai/dist/grade.js.map +1 -0
- package/node_modules/@seance/ai/dist/hosted-config.d.ts +9 -0
- package/node_modules/@seance/ai/dist/hosted-config.js +27 -0
- package/node_modules/@seance/ai/dist/hosted-config.js.map +1 -0
- package/node_modules/@seance/ai/dist/index.d.ts +9 -0
- package/node_modules/@seance/ai/dist/index.js +9 -0
- package/node_modules/@seance/ai/dist/index.js.map +1 -0
- package/node_modules/@seance/ai/dist/providers.d.ts +54 -0
- package/node_modules/@seance/ai/dist/providers.js +149 -0
- package/node_modules/@seance/ai/dist/providers.js.map +1 -0
- package/node_modules/@seance/ai/dist/quiz.d.ts +26 -0
- package/node_modules/@seance/ai/dist/quiz.js +41 -0
- package/node_modules/@seance/ai/dist/quiz.js.map +1 -0
- package/node_modules/@seance/ai/package.json +25 -0
- package/node_modules/@seance/core/LICENSE +21 -0
- package/node_modules/@seance/core/dist/ai-check.d.ts +58 -0
- package/node_modules/@seance/core/dist/ai-check.js +460 -0
- package/node_modules/@seance/core/dist/ai-check.js.map +1 -0
- package/node_modules/@seance/core/dist/ai-prompts.d.ts +29 -0
- package/node_modules/@seance/core/dist/ai-prompts.js +221 -0
- package/node_modules/@seance/core/dist/ai-prompts.js.map +1 -0
- package/node_modules/@seance/core/dist/ai-schemas.d.ts +155 -0
- package/node_modules/@seance/core/dist/ai-schemas.js +92 -0
- package/node_modules/@seance/core/dist/ai-schemas.js.map +1 -0
- package/node_modules/@seance/core/dist/api-client.d.ts +26 -0
- package/node_modules/@seance/core/dist/api-client.js +71 -0
- package/node_modules/@seance/core/dist/api-client.js.map +1 -0
- package/node_modules/@seance/core/dist/api-errors.d.ts +37 -0
- package/node_modules/@seance/core/dist/api-errors.js +66 -0
- package/node_modules/@seance/core/dist/api-errors.js.map +1 -0
- package/node_modules/@seance/core/dist/api-schemas.d.ts +284 -0
- package/node_modules/@seance/core/dist/api-schemas.js +67 -0
- package/node_modules/@seance/core/dist/api-schemas.js.map +1 -0
- package/node_modules/@seance/core/dist/decision-log.d.ts +73 -0
- package/node_modules/@seance/core/dist/decision-log.js +239 -0
- package/node_modules/@seance/core/dist/decision-log.js.map +1 -0
- package/node_modules/@seance/core/dist/dependency-guard.d.ts +20 -0
- package/node_modules/@seance/core/dist/dependency-guard.js +732 -0
- package/node_modules/@seance/core/dist/dependency-guard.js.map +1 -0
- package/node_modules/@seance/core/dist/gate.d.ts +11 -0
- package/node_modules/@seance/core/dist/gate.js +26 -0
- package/node_modules/@seance/core/dist/gate.js.map +1 -0
- package/node_modules/@seance/core/dist/git-parse.d.ts +11 -0
- package/node_modules/@seance/core/dist/git-parse.js +23 -0
- package/node_modules/@seance/core/dist/git-parse.js.map +1 -0
- package/node_modules/@seance/core/dist/index.d.ts +65 -0
- package/node_modules/@seance/core/dist/index.js +47 -0
- package/node_modules/@seance/core/dist/index.js.map +1 -0
- package/node_modules/@seance/core/dist/init-checklist.d.ts +153 -0
- package/node_modules/@seance/core/dist/init-checklist.js +200 -0
- package/node_modules/@seance/core/dist/init-checklist.js.map +1 -0
- package/node_modules/@seance/core/dist/init-detect.d.ts +9 -0
- package/node_modules/@seance/core/dist/init-detect.js +84 -0
- package/node_modules/@seance/core/dist/init-detect.js.map +1 -0
- package/node_modules/@seance/core/dist/init-templates.d.ts +36 -0
- package/node_modules/@seance/core/dist/init-templates.js +257 -0
- package/node_modules/@seance/core/dist/init-templates.js.map +1 -0
- package/node_modules/@seance/core/dist/map-basics.d.ts +13 -0
- package/node_modules/@seance/core/dist/map-basics.js +19 -0
- package/node_modules/@seance/core/dist/map-basics.js.map +1 -0
- package/node_modules/@seance/core/dist/map-summary.d.ts +5 -0
- package/node_modules/@seance/core/dist/map-summary.js +50 -0
- package/node_modules/@seance/core/dist/map-summary.js.map +1 -0
- package/node_modules/@seance/core/dist/markers.d.ts +51 -0
- package/node_modules/@seance/core/dist/markers.js +84 -0
- package/node_modules/@seance/core/dist/markers.js.map +1 -0
- package/node_modules/@seance/core/dist/mcp-quiz.d.ts +94 -0
- package/node_modules/@seance/core/dist/mcp-quiz.js +130 -0
- package/node_modules/@seance/core/dist/mcp-quiz.js.map +1 -0
- package/node_modules/@seance/core/dist/mcp-tools.d.ts +82 -0
- package/node_modules/@seance/core/dist/mcp-tools.js +136 -0
- package/node_modules/@seance/core/dist/mcp-tools.js.map +1 -0
- package/node_modules/@seance/core/dist/mcp-views.d.ts +21 -0
- package/node_modules/@seance/core/dist/mcp-views.js +83 -0
- package/node_modules/@seance/core/dist/mcp-views.js.map +1 -0
- package/node_modules/@seance/core/dist/quiz-assembly.d.ts +21 -0
- package/node_modules/@seance/core/dist/quiz-assembly.js +43 -0
- package/node_modules/@seance/core/dist/quiz-assembly.js.map +1 -0
- package/node_modules/@seance/core/dist/quiz-cards.d.ts +183 -0
- package/node_modules/@seance/core/dist/quiz-cards.js +215 -0
- package/node_modules/@seance/core/dist/quiz-cards.js.map +1 -0
- package/node_modules/@seance/core/dist/quiz-session.d.ts +67 -0
- package/node_modules/@seance/core/dist/quiz-session.js +141 -0
- package/node_modules/@seance/core/dist/quiz-session.js.map +1 -0
- package/node_modules/@seance/core/dist/quiz-subjects.d.ts +13 -0
- package/node_modules/@seance/core/dist/quiz-subjects.js +63 -0
- package/node_modules/@seance/core/dist/quiz-subjects.js.map +1 -0
- package/node_modules/@seance/core/dist/rate-limit.d.ts +33 -0
- package/node_modules/@seance/core/dist/rate-limit.js +114 -0
- package/node_modules/@seance/core/dist/rate-limit.js.map +1 -0
- package/node_modules/@seance/core/dist/scoring.d.ts +48 -0
- package/node_modules/@seance/core/dist/scoring.js +95 -0
- package/node_modules/@seance/core/dist/scoring.js.map +1 -0
- package/node_modules/@seance/core/dist/seance-config.d.ts +177 -0
- package/node_modules/@seance/core/dist/seance-config.js +43 -0
- package/node_modules/@seance/core/dist/seance-config.js.map +1 -0
- package/node_modules/@seance/core/dist/seance-state.d.ts +125 -0
- package/node_modules/@seance/core/dist/seance-state.js +61 -0
- package/node_modules/@seance/core/dist/seance-state.js.map +1 -0
- package/node_modules/@seance/core/dist/sm2.d.ts +18 -0
- package/node_modules/@seance/core/dist/sm2.js +87 -0
- package/node_modules/@seance/core/dist/sm2.js.map +1 -0
- package/node_modules/@seance/core/dist/stored-schemas.d.ts +29 -0
- package/node_modules/@seance/core/dist/stored-schemas.js +29 -0
- package/node_modules/@seance/core/dist/stored-schemas.js.map +1 -0
- package/node_modules/@seance/core/dist/structural-questions.d.ts +31 -0
- package/node_modules/@seance/core/dist/structural-questions.js +575 -0
- package/node_modules/@seance/core/dist/structural-questions.js.map +1 -0
- package/node_modules/@seance/core/dist/structure-map-schema.d.ts +84 -0
- package/node_modules/@seance/core/dist/structure-map-schema.js +73 -0
- package/node_modules/@seance/core/dist/structure-map-schema.js.map +1 -0
- package/node_modules/@seance/core/dist/structure-map.d.ts +78 -0
- package/node_modules/@seance/core/dist/structure-map.js +750 -0
- package/node_modules/@seance/core/dist/structure-map.js.map +1 -0
- package/node_modules/@seance/core/dist/sync-changes.d.ts +38 -0
- package/node_modules/@seance/core/dist/sync-changes.js +89 -0
- package/node_modules/@seance/core/dist/sync-changes.js.map +1 -0
- package/node_modules/@seance/core/dist/sync-render.d.ts +28 -0
- package/node_modules/@seance/core/dist/sync-render.js +113 -0
- package/node_modules/@seance/core/dist/sync-render.js.map +1 -0
- package/node_modules/@seance/core/dist/terminal-text.d.ts +8 -0
- package/node_modules/@seance/core/dist/terminal-text.js +33 -0
- package/node_modules/@seance/core/dist/terminal-text.js.map +1 -0
- package/node_modules/@seance/core/dist/write-plan.d.ts +51 -0
- package/node_modules/@seance/core/dist/write-plan.js +173 -0
- package/node_modules/@seance/core/dist/write-plan.js.map +1 -0
- package/node_modules/@seance/core/package.json +26 -0
- package/package.json +42 -6
|
@@ -0,0 +1,575 @@
|
|
|
1
|
+
// Structural questions: turns a structure map into multiple-choice quiz questions with no AI.
|
|
2
|
+
// Pure and deterministic: the same map and options always give the same questions.
|
|
3
|
+
import { MAX_MENTIONED_NAMES } from "./map-basics.js";
|
|
4
|
+
import { normalizeSubject } from "./quiz-subjects.js";
|
|
5
|
+
const DEFAULT_COUNT = 5;
|
|
6
|
+
const MAX_COUNT = 50;
|
|
7
|
+
const MAX_DISTRACTORS = 3;
|
|
8
|
+
// ---------------------------------------------------------------------------
|
|
9
|
+
// Hashing
|
|
10
|
+
// ---------------------------------------------------------------------------
|
|
11
|
+
const encoder = new TextEncoder(); // made once; creating one per call is slow
|
|
12
|
+
/**
|
|
13
|
+
* FNV-1a, a tiny 32-bit hash. It gives the same number for the same text on every machine,
|
|
14
|
+
* which is what we need instead of Math.random: order and picks stay repeatable.
|
|
15
|
+
*/
|
|
16
|
+
export function fnv1a32(text) {
|
|
17
|
+
let hash = 0x811c9dc5; // the FNV offset basis
|
|
18
|
+
for (const byte of encoder.encode(text)) {
|
|
19
|
+
hash ^= byte;
|
|
20
|
+
hash = Math.imul(hash, 0x01000193); // multiply by the FNV prime, keeping 32 bits
|
|
21
|
+
}
|
|
22
|
+
return hash >>> 0; // show it as an unsigned number
|
|
23
|
+
}
|
|
24
|
+
function compareText(a, b) {
|
|
25
|
+
if (a < b)
|
|
26
|
+
return -1;
|
|
27
|
+
return a > b ? 1 : 0;
|
|
28
|
+
}
|
|
29
|
+
/** Sorts a copy by hash value, computing each hash once. Equal hashes fall back to text order. */
|
|
30
|
+
function sortByHash(items, keyOf, hash) {
|
|
31
|
+
const keyed = items.map((item) => {
|
|
32
|
+
const key = keyOf(item);
|
|
33
|
+
return { item, key, value: hash(key) };
|
|
34
|
+
});
|
|
35
|
+
keyed.sort((a, b) => a.value - b.value || compareText(a.key, b.key));
|
|
36
|
+
return keyed.map((entry) => entry.item);
|
|
37
|
+
}
|
|
38
|
+
function lastSegment(name) {
|
|
39
|
+
return name.slice(name.lastIndexOf(".") + 1);
|
|
40
|
+
}
|
|
41
|
+
function isRelativeModule(source) {
|
|
42
|
+
return source.startsWith("./") || source.startsWith("../");
|
|
43
|
+
}
|
|
44
|
+
function readScope(file) {
|
|
45
|
+
const scope = { names: new Set(), namespaces: new Set() };
|
|
46
|
+
for (const imp of file.imports) {
|
|
47
|
+
if (!isRelativeModule(imp.source))
|
|
48
|
+
continue;
|
|
49
|
+
for (const name of imp.names)
|
|
50
|
+
scope.names.add(name);
|
|
51
|
+
if (imp.defaultName !== undefined)
|
|
52
|
+
scope.names.add(imp.defaultName);
|
|
53
|
+
if (imp.namespace !== undefined)
|
|
54
|
+
scope.namespaces.add(imp.namespace);
|
|
55
|
+
}
|
|
56
|
+
return scope;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Keeps the calls that point at something inside the project (req 2.16): a top-level function of
|
|
60
|
+
* the map or a name imported from a relative module; `this.m` for a method of the same class;
|
|
61
|
+
* `obj.x` when `obj` is a namespace import from a relative module. `console.log` and the like drop out.
|
|
62
|
+
*/
|
|
63
|
+
function resolveCalls(calls, scope, topLevel, ownMethods) {
|
|
64
|
+
const resolved = [];
|
|
65
|
+
for (const call of calls) {
|
|
66
|
+
const dot = call.indexOf(".");
|
|
67
|
+
if (dot === -1) {
|
|
68
|
+
if (topLevel.has(call) || scope.names.has(call))
|
|
69
|
+
resolved.push(call);
|
|
70
|
+
}
|
|
71
|
+
else if (call.slice(0, dot) === "this") {
|
|
72
|
+
if (ownMethods?.has(call.slice(dot + 1)))
|
|
73
|
+
resolved.push(call);
|
|
74
|
+
}
|
|
75
|
+
else if (scope.namespaces.has(call.slice(0, dot))) {
|
|
76
|
+
resolved.push(call);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return resolved;
|
|
80
|
+
}
|
|
81
|
+
function toPoolFunction(display, path, entry, scope, topLevel, ownMethods) {
|
|
82
|
+
return {
|
|
83
|
+
display,
|
|
84
|
+
isMethod: ownMethods !== undefined,
|
|
85
|
+
path,
|
|
86
|
+
line: entry.line,
|
|
87
|
+
params: entry.params,
|
|
88
|
+
plainParams: entry.plainParams,
|
|
89
|
+
async: entry.async,
|
|
90
|
+
calledNames: new Set(entry.calledNames),
|
|
91
|
+
mentioned: new Set(entry.mentionedNames),
|
|
92
|
+
mentionsCut: entry.mentionedNames.length >= MAX_MENTIONED_NAMES,
|
|
93
|
+
resolvedCalls: resolveCalls(entry.calls, scope, topLevel, ownMethods),
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
/** Functions and methods whose display name occurs once in the map. Ambiguous names and `default` are dropped. */
|
|
97
|
+
function buildPool(files, scopes, topLevel) {
|
|
98
|
+
const all = [];
|
|
99
|
+
for (const file of files) {
|
|
100
|
+
const scope = scopes.get(file.path) ?? { names: new Set(), namespaces: new Set() };
|
|
101
|
+
for (const fn of file.functions) {
|
|
102
|
+
if (fn.name === "default")
|
|
103
|
+
continue;
|
|
104
|
+
all.push(toPoolFunction(fn.name, file.path, fn, scope, topLevel, undefined));
|
|
105
|
+
}
|
|
106
|
+
for (const cls of file.classes) {
|
|
107
|
+
if (cls.name === "default")
|
|
108
|
+
continue;
|
|
109
|
+
const ownMethods = new Set(cls.methods.map((m) => m.name));
|
|
110
|
+
for (const m of cls.methods)
|
|
111
|
+
all.push(toPoolFunction(`${cls.name}.${m.name}`, file.path, m, scope, topLevel, ownMethods));
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
const counts = new Map();
|
|
115
|
+
for (const f of all)
|
|
116
|
+
counts.set(f.display, (counts.get(f.display) ?? 0) + 1);
|
|
117
|
+
return all.filter((f) => counts.get(f.display) === 1);
|
|
118
|
+
}
|
|
119
|
+
function groupImports(files) {
|
|
120
|
+
const pairs = new Map();
|
|
121
|
+
for (const file of files) {
|
|
122
|
+
for (const imp of file.imports) {
|
|
123
|
+
// NUL cannot be part of a path or a module name, so it is a safe separator.
|
|
124
|
+
const key = `${file.path}\u0000${imp.source}`;
|
|
125
|
+
let pair = pairs.get(key);
|
|
126
|
+
if (!pair) {
|
|
127
|
+
pair = { path: file.path, source: imp.source, line: imp.line, names: new Set(), everything: new Set() };
|
|
128
|
+
pairs.set(key, pair);
|
|
129
|
+
}
|
|
130
|
+
pair.line = Math.min(pair.line, imp.line);
|
|
131
|
+
for (const name of imp.names) {
|
|
132
|
+
pair.names.add(name);
|
|
133
|
+
pair.everything.add(name);
|
|
134
|
+
}
|
|
135
|
+
// A default, namespace or whole-module `require` name is the module itself (`const fs = require("fs")`), so it is never an answer.
|
|
136
|
+
if (imp.defaultName !== undefined)
|
|
137
|
+
pair.everything.add(imp.defaultName);
|
|
138
|
+
if (imp.namespace !== undefined)
|
|
139
|
+
pair.everything.add(imp.namespace);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return pairs;
|
|
143
|
+
}
|
|
144
|
+
function buildContext(map, seed, attempt) {
|
|
145
|
+
const files = map.files.filter((f) => f.parsed);
|
|
146
|
+
const scopes = new Map();
|
|
147
|
+
const topLevel = new Set();
|
|
148
|
+
const classes = [];
|
|
149
|
+
const classNameCounts = new Map();
|
|
150
|
+
const classesByName = new Map();
|
|
151
|
+
const exportOwners = new Map();
|
|
152
|
+
const exportNamesByFile = new Map();
|
|
153
|
+
const filesWithUnknownExports = new Set();
|
|
154
|
+
for (const file of files) {
|
|
155
|
+
scopes.set(file.path, readScope(file));
|
|
156
|
+
for (const fn of file.functions)
|
|
157
|
+
if (fn.name !== "default")
|
|
158
|
+
topLevel.add(fn.name);
|
|
159
|
+
for (const cls of file.classes) {
|
|
160
|
+
const sameName = classesByName.get(cls.name);
|
|
161
|
+
if (sameName)
|
|
162
|
+
sameName.push(cls);
|
|
163
|
+
else
|
|
164
|
+
classesByName.set(cls.name, [cls]);
|
|
165
|
+
if (cls.name === "default")
|
|
166
|
+
continue;
|
|
167
|
+
classes.push({ path: file.path, cls });
|
|
168
|
+
classNameCounts.set(cls.name, (classNameCounts.get(cls.name) ?? 0) + 1);
|
|
169
|
+
}
|
|
170
|
+
if (file.hasUnknownExports)
|
|
171
|
+
filesWithUnknownExports.add(file.path);
|
|
172
|
+
const names = new Set(file.commonjsExports);
|
|
173
|
+
for (const e of file.exports) {
|
|
174
|
+
names.add(e.name);
|
|
175
|
+
if (e.kind !== "named" || e.name === "default")
|
|
176
|
+
continue;
|
|
177
|
+
const owner = { path: file.path, line: e.line };
|
|
178
|
+
const owners = exportOwners.get(e.name);
|
|
179
|
+
if (owners)
|
|
180
|
+
owners.push(owner);
|
|
181
|
+
else
|
|
182
|
+
exportOwners.set(e.name, [owner]);
|
|
183
|
+
}
|
|
184
|
+
exportNamesByFile.set(file.path, names);
|
|
185
|
+
}
|
|
186
|
+
const pool = buildPool(files, scopes, topLevel);
|
|
187
|
+
const poolByFile = new Map();
|
|
188
|
+
const calleeToCallers = new Map();
|
|
189
|
+
for (const f of pool) {
|
|
190
|
+
const inFile = poolByFile.get(f.path);
|
|
191
|
+
if (inFile)
|
|
192
|
+
inFile.push(f);
|
|
193
|
+
else
|
|
194
|
+
poolByFile.set(f.path, [f]);
|
|
195
|
+
for (const callee of f.resolvedCalls) {
|
|
196
|
+
const callers = calleeToCallers.get(callee);
|
|
197
|
+
if (callers)
|
|
198
|
+
callers.push(f);
|
|
199
|
+
else
|
|
200
|
+
calleeToCallers.set(callee, [f]);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
return {
|
|
204
|
+
files,
|
|
205
|
+
attempt,
|
|
206
|
+
hash: (text) => fnv1a32(`${seed}|${text}`),
|
|
207
|
+
choiceHash: (text) => fnv1a32(`${seed}|${attempt}|${text}`),
|
|
208
|
+
pool,
|
|
209
|
+
poolByFile,
|
|
210
|
+
calleeToCallers,
|
|
211
|
+
topLevelNames: pool.filter((f) => !f.isMethod).map((f) => f.display),
|
|
212
|
+
classes,
|
|
213
|
+
classNameCounts,
|
|
214
|
+
classesByName,
|
|
215
|
+
exportOwners,
|
|
216
|
+
exportNamesByFile,
|
|
217
|
+
filesWithUnknownExports,
|
|
218
|
+
importPairs: groupImports(files),
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
/** Up to 3 wrong answers: the pool without the correct answer and duplicates, in hash order. */
|
|
222
|
+
function pickDistractors(ctx, id, correct, pool) {
|
|
223
|
+
const candidates = [...new Set(pool)].filter((choice) => choice !== correct);
|
|
224
|
+
return sortByHash(candidates, (choice) => `${id}|${choice}`, ctx.hash).slice(0, MAX_DISTRACTORS);
|
|
225
|
+
}
|
|
226
|
+
/** Builds the question, or returns undefined when there is no wrong answer to offer (req 2.6). */
|
|
227
|
+
function makeQuestion(ctx, spec) {
|
|
228
|
+
if (spec.distractors.length === 0)
|
|
229
|
+
return undefined;
|
|
230
|
+
const id = `${spec.template}:${spec.key}`;
|
|
231
|
+
const all = [spec.correct, ...spec.distractors];
|
|
232
|
+
// The choice order depends on the attempt; everything else does not.
|
|
233
|
+
const choices = spec.numeric && ctx.attempt === 0
|
|
234
|
+
? all.sort((a, b) => Number(a) - Number(b))
|
|
235
|
+
: sortByHash(all, (choice) => `${id}#${choice}`, ctx.choiceHash);
|
|
236
|
+
return {
|
|
237
|
+
id,
|
|
238
|
+
concept: spec.concept,
|
|
239
|
+
kind: "mcq",
|
|
240
|
+
choices,
|
|
241
|
+
answerIndex: choices.indexOf(spec.correct),
|
|
242
|
+
prompt: spec.prompt,
|
|
243
|
+
source: spec.source,
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
// ---------------------------------------------------------------------------
|
|
247
|
+
// The six templates. Each lists cheap candidates; the choices are made later, only for the
|
|
248
|
+
// candidates that are really needed.
|
|
249
|
+
// ---------------------------------------------------------------------------
|
|
250
|
+
/**
|
|
251
|
+
* caller (concept: call-graph). "In `file`, which function calls `Y`?"
|
|
252
|
+
* Subject: a call `Y` that points inside the project (req 2.16) and has at least one caller.
|
|
253
|
+
* The correct answer is one of its callers; `file` is that caller's file.
|
|
254
|
+
* Wrong answers: functions of the same file that do not call anything named like Y (req 2.17),
|
|
255
|
+
* so `obj.a.helper()` or `console.log()` makes a function an invalid wrong answer.
|
|
256
|
+
*/
|
|
257
|
+
function callerCandidates(ctx) {
|
|
258
|
+
const candidates = [];
|
|
259
|
+
for (const [callee, callers] of ctx.calleeToCallers) {
|
|
260
|
+
const id = `caller:${callee}`;
|
|
261
|
+
candidates.push({ id, subject: normalizeSubject(callee), build: () => buildCaller(ctx, id, callee, callers) });
|
|
262
|
+
}
|
|
263
|
+
return candidates;
|
|
264
|
+
}
|
|
265
|
+
function buildCaller(ctx, id, callee, callers) {
|
|
266
|
+
const correct = sortByHash(callers, (f) => `${id}|${f.display}`, ctx.hash)[0];
|
|
267
|
+
if (!correct)
|
|
268
|
+
return undefined;
|
|
269
|
+
const name = lastSegment(callee);
|
|
270
|
+
const others = [];
|
|
271
|
+
for (const f of ctx.poolByFile.get(correct.path) ?? []) {
|
|
272
|
+
// A wrong answer must not touch the name in any way: not by a call, not as a callback or alias.
|
|
273
|
+
// A function whose mention list was cut may hide the name, so it is never offered.
|
|
274
|
+
const touches = f.calledNames.has(name) || f.mentioned.has(name) || f.mentionsCut;
|
|
275
|
+
if (lastSegment(f.display) !== name && !touches)
|
|
276
|
+
others.push(f.display);
|
|
277
|
+
}
|
|
278
|
+
return makeQuestion(ctx, {
|
|
279
|
+
template: "caller",
|
|
280
|
+
key: callee,
|
|
281
|
+
concept: "call-graph",
|
|
282
|
+
prompt: `In \`${correct.path}\`, which function calls \`${callee}\`?`,
|
|
283
|
+
correct: correct.display,
|
|
284
|
+
distractors: pickDistractors(ctx, id, correct.display, others),
|
|
285
|
+
source: { path: correct.path, line: correct.line },
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* class-method (concept: classes). "Which of these is a method of class `C`?"
|
|
290
|
+
* Subject: a class with at least one method whose name is used by only one class.
|
|
291
|
+
* Wrong answers: methods of other classes and top-level function names, minus every method, getter
|
|
292
|
+
* and setter of C and of its parent classes (a subclass has its parents' methods too). When a parent
|
|
293
|
+
* is not in the map (`extends React.Component`), the question is skipped: its methods are unknown.
|
|
294
|
+
*/
|
|
295
|
+
function classMethodCandidates(ctx) {
|
|
296
|
+
const candidates = [];
|
|
297
|
+
for (const { path, cls } of ctx.classes) {
|
|
298
|
+
if (cls.methods.length === 0 || ctx.classNameCounts.get(cls.name) !== 1)
|
|
299
|
+
continue;
|
|
300
|
+
const id = `class-method:${cls.name}`;
|
|
301
|
+
candidates.push({ id, subject: normalizeSubject(cls.name), build: () => buildClassMethod(ctx, id, path, cls) });
|
|
302
|
+
}
|
|
303
|
+
return candidates;
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Method, getter and setter names that `cls` gets from its parent classes, found by class name
|
|
307
|
+
* inside the map, up the whole chain. Returns undefined when some parent is not in the map.
|
|
308
|
+
* A name that was already visited is not visited again, so a loop (`A extends B`, `B extends A`) ends.
|
|
309
|
+
*/
|
|
310
|
+
function inheritedNames(ctx, cls) {
|
|
311
|
+
const names = new Set();
|
|
312
|
+
const visited = new Set();
|
|
313
|
+
const todo = cls.superClass === undefined ? [] : [cls.superClass];
|
|
314
|
+
for (let parentName = todo.pop(); parentName !== undefined; parentName = todo.pop()) {
|
|
315
|
+
if (visited.has(parentName))
|
|
316
|
+
continue;
|
|
317
|
+
visited.add(parentName);
|
|
318
|
+
const parents = ctx.classesByName.get(parentName);
|
|
319
|
+
if (!parents)
|
|
320
|
+
return undefined;
|
|
321
|
+
for (const parent of parents) {
|
|
322
|
+
for (const m of parent.methods)
|
|
323
|
+
names.add(m.name);
|
|
324
|
+
for (const accessor of parent.accessors)
|
|
325
|
+
names.add(accessor);
|
|
326
|
+
if (parent.superClass !== undefined)
|
|
327
|
+
todo.push(parent.superClass);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
return names;
|
|
331
|
+
}
|
|
332
|
+
function buildClassMethod(ctx, id, path, cls) {
|
|
333
|
+
const own = new Set(cls.methods.map((m) => m.name));
|
|
334
|
+
const correct = sortByHash([...own], (name) => `${id}|${name}`, ctx.hash)[0];
|
|
335
|
+
if (correct === undefined)
|
|
336
|
+
return undefined;
|
|
337
|
+
const inherited = inheritedNames(ctx, cls);
|
|
338
|
+
if (inherited === undefined)
|
|
339
|
+
return undefined;
|
|
340
|
+
// Names that must not be offered as wrong answers because the class has them too.
|
|
341
|
+
const hasToo = new Set([...own, ...cls.accessors, ...inherited]);
|
|
342
|
+
const others = [];
|
|
343
|
+
for (const other of ctx.classes) {
|
|
344
|
+
if (other.cls === cls)
|
|
345
|
+
continue;
|
|
346
|
+
for (const m of other.cls.methods)
|
|
347
|
+
if (!hasToo.has(m.name))
|
|
348
|
+
others.push(m.name);
|
|
349
|
+
}
|
|
350
|
+
for (const name of ctx.topLevelNames)
|
|
351
|
+
if (!hasToo.has(name))
|
|
352
|
+
others.push(name);
|
|
353
|
+
return makeQuestion(ctx, {
|
|
354
|
+
template: "class-method",
|
|
355
|
+
key: cls.name,
|
|
356
|
+
concept: "classes",
|
|
357
|
+
prompt: `Which of these is a method of class \`${cls.name}\`?`,
|
|
358
|
+
correct,
|
|
359
|
+
distractors: pickDistractors(ctx, id, correct, others),
|
|
360
|
+
source: { path, line: cls.line },
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* import-from (concept: imports). "Which of these does `file` import from `module`?"
|
|
365
|
+
* Subject: a (file, module) pair with at least one named import (`import { a } from`, `const { a } = require(...)`).
|
|
366
|
+
* A default, namespace or whole-module `require` name is never asked about (changed Dec 2 after manual test: for
|
|
367
|
+
* `const fs = require("fs")` the answer was "fs", the module itself).
|
|
368
|
+
* Wrong answers: named imports of other pairs, minus every name this file takes from this module.
|
|
369
|
+
*/
|
|
370
|
+
function importFromCandidates(ctx) {
|
|
371
|
+
const candidates = [];
|
|
372
|
+
for (const [key, pair] of ctx.importPairs) {
|
|
373
|
+
if (pair.names.size === 0)
|
|
374
|
+
continue;
|
|
375
|
+
const id = `import-from:${key}`;
|
|
376
|
+
candidates.push({ id, build: () => buildImportFrom(ctx, id, key, pair) });
|
|
377
|
+
}
|
|
378
|
+
return candidates;
|
|
379
|
+
}
|
|
380
|
+
function buildImportFrom(ctx, id, key, pair) {
|
|
381
|
+
const correct = sortByHash([...pair.names], (name) => `${id}|${name}`, ctx.hash)[0];
|
|
382
|
+
if (correct === undefined)
|
|
383
|
+
return undefined;
|
|
384
|
+
const others = [];
|
|
385
|
+
for (const other of ctx.importPairs.values()) {
|
|
386
|
+
if (other === pair)
|
|
387
|
+
continue;
|
|
388
|
+
for (const name of other.names)
|
|
389
|
+
if (!pair.everything.has(name))
|
|
390
|
+
others.push(name);
|
|
391
|
+
}
|
|
392
|
+
return makeQuestion(ctx, {
|
|
393
|
+
template: "import-from",
|
|
394
|
+
key,
|
|
395
|
+
concept: "imports",
|
|
396
|
+
prompt: `Which of these does \`${pair.path}\` import from \`${pair.source}\`?`,
|
|
397
|
+
correct,
|
|
398
|
+
distractors: pickDistractors(ctx, id, correct, others),
|
|
399
|
+
source: { path: pair.path, line: pair.line },
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* export-owner (concept: exports). "Which file exports `X`?"
|
|
404
|
+
* Subject: a named export that exactly one file has.
|
|
405
|
+
* Wrong answers: parsed files with no export called X (ES or CommonJS), no `export *`, and no
|
|
406
|
+
* `module.exports` whose names are unknown, so a file that re-exports or may export X is never
|
|
407
|
+
* offered as a wrong answer.
|
|
408
|
+
*/
|
|
409
|
+
function exportOwnerCandidates(ctx) {
|
|
410
|
+
const candidates = [];
|
|
411
|
+
for (const [name, owners] of ctx.exportOwners) {
|
|
412
|
+
const owner = owners[0];
|
|
413
|
+
if (owners.length !== 1 || !owner)
|
|
414
|
+
continue;
|
|
415
|
+
const id = `export-owner:${name}`;
|
|
416
|
+
candidates.push({ id, subject: normalizeSubject(name), build: () => buildExportOwner(ctx, id, name, owner) });
|
|
417
|
+
}
|
|
418
|
+
return candidates;
|
|
419
|
+
}
|
|
420
|
+
function buildExportOwner(ctx, id, name, owner) {
|
|
421
|
+
const others = [];
|
|
422
|
+
for (const file of ctx.files) {
|
|
423
|
+
if (ctx.filesWithUnknownExports.has(file.path))
|
|
424
|
+
continue;
|
|
425
|
+
const exported = ctx.exportNamesByFile.get(file.path);
|
|
426
|
+
if (!exported?.has(name) && !exported?.has("*"))
|
|
427
|
+
others.push(file.path);
|
|
428
|
+
}
|
|
429
|
+
return makeQuestion(ctx, {
|
|
430
|
+
template: "export-owner",
|
|
431
|
+
key: name,
|
|
432
|
+
concept: "exports",
|
|
433
|
+
prompt: `Which file exports \`${name}\`?`,
|
|
434
|
+
correct: owner.path,
|
|
435
|
+
distractors: pickDistractors(ctx, id, owner.path, others),
|
|
436
|
+
source: owner,
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
/**
|
|
440
|
+
* async-pick (concept: async-functions). "In `file`, which function is async?"
|
|
441
|
+
* Subject: each async function. Wrong answers: functions of the same file that are not async,
|
|
442
|
+
* so the prompt is true for every choice.
|
|
443
|
+
*/
|
|
444
|
+
function asyncPickCandidates(ctx) {
|
|
445
|
+
const candidates = [];
|
|
446
|
+
for (const f of ctx.pool) {
|
|
447
|
+
if (!f.async)
|
|
448
|
+
continue;
|
|
449
|
+
const id = `async-pick:${f.display}`;
|
|
450
|
+
candidates.push({ id, subject: normalizeSubject(f.display), build: () => buildAsyncPick(ctx, id, f) });
|
|
451
|
+
}
|
|
452
|
+
return candidates;
|
|
453
|
+
}
|
|
454
|
+
function buildAsyncPick(ctx, id, f) {
|
|
455
|
+
const notAsync = [];
|
|
456
|
+
for (const other of ctx.poolByFile.get(f.path) ?? [])
|
|
457
|
+
if (!other.async)
|
|
458
|
+
notAsync.push(other.display);
|
|
459
|
+
return makeQuestion(ctx, {
|
|
460
|
+
template: "async-pick",
|
|
461
|
+
key: f.display,
|
|
462
|
+
concept: "async-functions",
|
|
463
|
+
prompt: `In \`${f.path}\`, which function is async?`,
|
|
464
|
+
correct: f.display,
|
|
465
|
+
distractors: pickDistractors(ctx, id, f.display, notAsync),
|
|
466
|
+
source: { path: f.path, line: f.line },
|
|
467
|
+
});
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* param-count (concept: parameters). "How many parameters does `fn` in `file` take?"
|
|
471
|
+
* Subject: each function whose parameters are all plain identifiers (a default, rest or
|
|
472
|
+
* destructured parameter makes the count unclear). Wrong answers: three of the nearby numbers
|
|
473
|
+
* p-2, p-1, p+1, p+2, p+3 (not below 0), picked by hash like every other template. A fixed set of
|
|
474
|
+
* offsets would put the correct number at the same place in the sorted list every time.
|
|
475
|
+
*/
|
|
476
|
+
function paramCountCandidates(ctx) {
|
|
477
|
+
const candidates = [];
|
|
478
|
+
for (const f of ctx.pool) {
|
|
479
|
+
if (!f.plainParams)
|
|
480
|
+
continue;
|
|
481
|
+
const id = `param-count:${f.display}`;
|
|
482
|
+
candidates.push({ id, subject: normalizeSubject(f.display), build: () => buildParamCount(ctx, id, f) });
|
|
483
|
+
}
|
|
484
|
+
return candidates;
|
|
485
|
+
}
|
|
486
|
+
function buildParamCount(ctx, id, f) {
|
|
487
|
+
const p = f.params;
|
|
488
|
+
const nearby = [p - 2, p - 1, p + 1, p + 2, p + 3].filter((n) => n >= 0).map(String);
|
|
489
|
+
return makeQuestion(ctx, {
|
|
490
|
+
template: "param-count",
|
|
491
|
+
key: f.display,
|
|
492
|
+
concept: "parameters",
|
|
493
|
+
prompt: `How many parameters does \`${f.display}\` in \`${f.path}\` take?`,
|
|
494
|
+
correct: String(p),
|
|
495
|
+
distractors: pickDistractors(ctx, id, String(p), nearby),
|
|
496
|
+
source: { path: f.path, line: f.line },
|
|
497
|
+
numeric: true,
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
/** The fixed order of the templates, from the idea that is most useful to learn to the simplest (req 2.9). */
|
|
501
|
+
const TEMPLATE_ORDER = [
|
|
502
|
+
callerCandidates,
|
|
503
|
+
classMethodCandidates,
|
|
504
|
+
importFromCandidates,
|
|
505
|
+
exportOwnerCandidates,
|
|
506
|
+
asyncPickCandidates,
|
|
507
|
+
paramCountCandidates,
|
|
508
|
+
];
|
|
509
|
+
// ---------------------------------------------------------------------------
|
|
510
|
+
// Ordering and options
|
|
511
|
+
// ---------------------------------------------------------------------------
|
|
512
|
+
/**
|
|
513
|
+
* Round-robin over the templates in their fixed order, so a short quiz covers many concepts.
|
|
514
|
+
* Inside a template the candidates are ordered by the hash of their id. Questions are built one at
|
|
515
|
+
* a time and only until `count` exist; a candidate that cannot be built is skipped. The sequence
|
|
516
|
+
* does not depend on `count`, so a longer quiz always starts with the shorter one (req 2.12).
|
|
517
|
+
*
|
|
518
|
+
* Spread over subjects (changed Dec 2 after manual test: one function was the subject of 4 questions): the first
|
|
519
|
+
* pass skips a candidate whose subject name an earlier question already used. Only when no template has a candidate
|
|
520
|
+
* left on those terms does a second pass take the skipped ones, with the same round-robin. The two passes make one
|
|
521
|
+
* fixed sequence, so the prefix rule above still holds.
|
|
522
|
+
*/
|
|
523
|
+
function pickQuestions(ctx, count) {
|
|
524
|
+
const result = [];
|
|
525
|
+
if (count === 0)
|
|
526
|
+
return result;
|
|
527
|
+
const queues = TEMPLATE_ORDER.map((candidatesOf) => ({
|
|
528
|
+
list: sortByHash(candidatesOf(ctx), (c) => c.id, ctx.hash),
|
|
529
|
+
done: new Set(), // candidates already built or found unbuildable
|
|
530
|
+
}));
|
|
531
|
+
const usedSubjects = new Set();
|
|
532
|
+
for (const spread of [true, false]) {
|
|
533
|
+
let madeOne = true;
|
|
534
|
+
while (madeOne && result.length < count) {
|
|
535
|
+
madeOne = false;
|
|
536
|
+
for (const queue of queues) {
|
|
537
|
+
if (result.length >= count)
|
|
538
|
+
break;
|
|
539
|
+
for (let index = 0; index < queue.list.length; index += 1) {
|
|
540
|
+
const candidate = queue.list[index];
|
|
541
|
+
if (candidate === undefined || queue.done.has(index))
|
|
542
|
+
continue;
|
|
543
|
+
if (spread && candidate.subject !== undefined && usedSubjects.has(candidate.subject))
|
|
544
|
+
continue;
|
|
545
|
+
queue.done.add(index);
|
|
546
|
+
const question = candidate.build();
|
|
547
|
+
if (question) {
|
|
548
|
+
result.push(question);
|
|
549
|
+
if (candidate.subject !== undefined)
|
|
550
|
+
usedSubjects.add(candidate.subject);
|
|
551
|
+
madeOne = true;
|
|
552
|
+
break;
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
return result;
|
|
559
|
+
}
|
|
560
|
+
function checkNonNegativeInteger(name, value) {
|
|
561
|
+
if (!Number.isSafeInteger(value) || value < 0) {
|
|
562
|
+
throw new RangeError(`${name} must be a non-negative safe integer, got ${String(value)}`);
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
/** Makes up to `count` multiple-choice questions from the map. Throws RangeError for bad options. */
|
|
566
|
+
export function generateStructuralQuestions(map, options = {}) {
|
|
567
|
+
const { count = DEFAULT_COUNT, seed = 0, attempt = 0 } = options;
|
|
568
|
+
if (!Number.isInteger(count) || count < 0 || count > MAX_COUNT) {
|
|
569
|
+
throw new RangeError(`count must be an integer from 0 to ${MAX_COUNT}, got ${String(count)}`);
|
|
570
|
+
}
|
|
571
|
+
checkNonNegativeInteger("seed", seed);
|
|
572
|
+
checkNonNegativeInteger("attempt", attempt);
|
|
573
|
+
return pickQuestions(buildContext(map, seed, attempt), count);
|
|
574
|
+
}
|
|
575
|
+
//# sourceMappingURL=structural-questions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structural-questions.js","sourceRoot":"","sources":["../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