@mmon-co/ncept-default-theory 2.0.0 → 3.0.1
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 +105 -21
- package/README.md +4 -4
- package/dist/catalog.js +1 -1
- package/dist/chat.d.ts +1 -1
- package/dist/chat.js +29 -11
- package/dist/evaluation.d.ts +8 -0
- package/dist/evaluation.js +12 -3
- package/dist/implementation.d.ts +7 -4
- package/dist/index.d.ts +8 -5
- package/dist/index.js +2 -2
- package/dist/migrations.d.ts +11 -3
- package/dist/migrations.js +89 -4
- package/dist/path.d.ts +3 -1
- package/dist/path.js +12 -8
- package/dist/release.d.ts +1 -1
- package/dist/release.js +1 -1
- package/dist/schedules.d.ts +51 -0
- package/dist/schedules.js +170 -0
- package/dist/skills/sources.d.ts +3 -3
- package/dist/skills/sources.js +3 -3
- package/dist/state.d.ts +3 -21
- package/dist/state.js +16 -76
- package/dist/tags.d.ts +1 -0
- package/dist/tags.js +7 -8
- package/dist/tools.js +8 -9
- package/package.json +15 -4
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type Observation, type ObservationId } from "@mmon-co/ncept-core/observations";
|
|
2
|
+
import type { Demonstration, Grade, HomedRecord, Lapse } from "./state.js";
|
|
3
|
+
export declare const REVIEW_PROPERTY = "pedagogy:review";
|
|
4
|
+
export type ReviewSchedule = {
|
|
5
|
+
kind: "fsrs";
|
|
6
|
+
} | {
|
|
7
|
+
kind: "never";
|
|
8
|
+
} | {
|
|
9
|
+
kind: "interval";
|
|
10
|
+
days: number;
|
|
11
|
+
};
|
|
12
|
+
export type DefaultParameters = Readonly<{
|
|
13
|
+
retention: Readonly<{
|
|
14
|
+
due: number;
|
|
15
|
+
fading: number;
|
|
16
|
+
claimStabilityDays: number;
|
|
17
|
+
}>;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const DEFAULT_PARAMETERS: DefaultParameters;
|
|
20
|
+
interface ScheduleEvidence {
|
|
21
|
+
readonly lastReview: string;
|
|
22
|
+
/** Observed forgetting stays due independently of the decay curve. */
|
|
23
|
+
readonly lapsed: boolean;
|
|
24
|
+
readonly citations: readonly ObservationId[];
|
|
25
|
+
}
|
|
26
|
+
export type ReplayedSchedule = ScheduleEvidence & ({
|
|
27
|
+
readonly kind: "fsrs";
|
|
28
|
+
readonly stability: number;
|
|
29
|
+
readonly stabilityFast: number;
|
|
30
|
+
readonly difficulty: number;
|
|
31
|
+
readonly reps: number;
|
|
32
|
+
readonly lapses: number;
|
|
33
|
+
} | {
|
|
34
|
+
readonly kind: "interval";
|
|
35
|
+
readonly days: number;
|
|
36
|
+
});
|
|
37
|
+
export type NodeSchedule = ReplayedSchedule & {
|
|
38
|
+
readonly retrievability: number;
|
|
39
|
+
};
|
|
40
|
+
type RetentionEvidence = {
|
|
41
|
+
readonly records: readonly HomedRecord[];
|
|
42
|
+
readonly direct: readonly Observation<Demonstration | Lapse>[];
|
|
43
|
+
readonly implicit: readonly HomedRecord[];
|
|
44
|
+
readonly grades: readonly Observation<Grade>[];
|
|
45
|
+
};
|
|
46
|
+
type Replay = (evidence: RetentionEvidence) => ReplayedSchedule | undefined;
|
|
47
|
+
export declare function validateReviewSchedule(value: unknown): void;
|
|
48
|
+
export declare function prepareReviewReplay(schedule: ReviewSchedule): Replay;
|
|
49
|
+
export declare function sameReviewCurve(a: NodeSchedule, b: NodeSchedule): boolean;
|
|
50
|
+
export declare function retrievabilityAt(schedule: ReplayedSchedule, time: number): number;
|
|
51
|
+
export {};
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
// Use the static srs-kit entry points to avoid bundling legacy models into Convex.
|
|
2
|
+
import { defineScheduler, Rating } from "#fsrs-scheduler";
|
|
3
|
+
import { dateChrono } from "#fsrs-date";
|
|
4
|
+
import { schedulerStatsMiddleware } from "ts-fsrs/middlewares";
|
|
5
|
+
import { FSRS7_DEFAULT_WEIGHTS, FSRS7Model } from "ts-fsrs/models/fsrs-7";
|
|
6
|
+
import { compareObservations } from "@mmon-co/ncept-core/observations";
|
|
7
|
+
export const REVIEW_PROPERTY = "pedagogy:review";
|
|
8
|
+
export const DEFAULT_PARAMETERS = { retention: { due: 0.9, fading: 0.7, claimStabilityDays: 1 } };
|
|
9
|
+
const DAY_MS = 86_400_000;
|
|
10
|
+
/** Daily reviews have no learning steps; replay uses fractional days and no fuzz. */
|
|
11
|
+
const SCHEDULER = defineScheduler({ model: FSRS7Model, chrono: dateChrono })
|
|
12
|
+
.use(schedulerStatsMiddleware)
|
|
13
|
+
.create({ config: { weights: FSRS7_DEFAULT_WEIGHTS, fractionalDays: true, clearStatsOnForget: false } });
|
|
14
|
+
const review = (card, at, grade) => {
|
|
15
|
+
const now = new Date(at);
|
|
16
|
+
return SCHEDULER.review({ card: card ?? SCHEDULER.newCard({ now }), now, grade }).card;
|
|
17
|
+
};
|
|
18
|
+
/** Accepted whole-day grades are the only direct reviews. Ungraded direct days also
|
|
19
|
+
* suppress implicit credit. The host supplies the learner's day boundaries. */
|
|
20
|
+
function reviews({ records, direct, implicit, grades }) {
|
|
21
|
+
const directDays = new Set(direct.map(({ learnerDay }) => learnerDay?.id));
|
|
22
|
+
let implicitDay;
|
|
23
|
+
return [...records.filter(({ payload }) => payload.kind === "claim"), ...implicit, ...grades]
|
|
24
|
+
.sort(compareObservations)
|
|
25
|
+
.filter(({ payload, learnerDay }) => {
|
|
26
|
+
if (payload.kind === "claim" || payload.kind === "grade")
|
|
27
|
+
return true;
|
|
28
|
+
if (!learnerDay || directDays.has(learnerDay.id) || learnerDay.id === implicitDay)
|
|
29
|
+
return false;
|
|
30
|
+
implicitDay = learnerDay.id;
|
|
31
|
+
return true;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
const schedulers = {
|
|
35
|
+
fsrs: {
|
|
36
|
+
validate: (value) => Object.keys(value).length === 1,
|
|
37
|
+
replay(_schedule, evidence) {
|
|
38
|
+
let card;
|
|
39
|
+
let initializingClaim;
|
|
40
|
+
let lapsed = false;
|
|
41
|
+
const citations = [];
|
|
42
|
+
for (const record of reviews(evidence)) {
|
|
43
|
+
const { payload, at, id } = record;
|
|
44
|
+
if (payload.kind === "claim") {
|
|
45
|
+
if (payload.stance !== "knows" || card !== undefined)
|
|
46
|
+
continue;
|
|
47
|
+
card = {
|
|
48
|
+
...review(undefined, at, Rating.Good),
|
|
49
|
+
stability: DEFAULT_PARAMETERS.retention.claimStabilityDays,
|
|
50
|
+
stabilityFast: 0.8 * DEFAULT_PARAMETERS.retention.claimStabilityDays,
|
|
51
|
+
reps: 0,
|
|
52
|
+
};
|
|
53
|
+
initializingClaim = at;
|
|
54
|
+
}
|
|
55
|
+
else if (payload.kind === "grade") {
|
|
56
|
+
const earlierSuccess = (initializingClaim !== undefined && Date.parse(initializingClaim) < Date.parse(payload.day.start)) ||
|
|
57
|
+
evidence.direct.some(({ at, payload: evidence }) => evidence.kind === "demonstration" &&
|
|
58
|
+
evidence.outcome === "success" &&
|
|
59
|
+
Date.parse(at) < Date.parse(payload.day.start));
|
|
60
|
+
card = review(card, payload.day.end, Rating[payload.rating]);
|
|
61
|
+
lapsed = payload.rating === "Again" && earlierSuccess;
|
|
62
|
+
citations.push(...(record.cites ?? []));
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
card = review(card, at, Rating.Good);
|
|
66
|
+
}
|
|
67
|
+
citations.push(id);
|
|
68
|
+
}
|
|
69
|
+
if (!card?.lastReviewAt)
|
|
70
|
+
return undefined;
|
|
71
|
+
return {
|
|
72
|
+
kind: "fsrs",
|
|
73
|
+
stability: card.stability,
|
|
74
|
+
stabilityFast: card.stabilityFast,
|
|
75
|
+
difficulty: card.difficulty,
|
|
76
|
+
reps: card.reps,
|
|
77
|
+
lapses: card.lapses,
|
|
78
|
+
lastReview: card.lastReviewAt.toISOString(),
|
|
79
|
+
lapsed,
|
|
80
|
+
citations: [...new Set(citations)],
|
|
81
|
+
};
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
never: {
|
|
85
|
+
validate: (value) => Object.keys(value).length === 1,
|
|
86
|
+
replay: () => undefined,
|
|
87
|
+
},
|
|
88
|
+
interval: {
|
|
89
|
+
validate: (value) => Object.keys(value).length === 2 &&
|
|
90
|
+
Object.hasOwn(value, "days") &&
|
|
91
|
+
typeof value.days === "number" &&
|
|
92
|
+
Number.isFinite(value.days) &&
|
|
93
|
+
value.days > 0,
|
|
94
|
+
replay(schedule, evidence) {
|
|
95
|
+
let lastReview;
|
|
96
|
+
let days = schedule.days;
|
|
97
|
+
let lapsed = false;
|
|
98
|
+
const citations = [];
|
|
99
|
+
for (const record of reviews(evidence)) {
|
|
100
|
+
const { payload, at, id } = record;
|
|
101
|
+
if (payload.kind === "claim") {
|
|
102
|
+
if (payload.stance !== "knows" || lastReview !== undefined)
|
|
103
|
+
continue;
|
|
104
|
+
lastReview = at;
|
|
105
|
+
days = DEFAULT_PARAMETERS.retention.claimStabilityDays;
|
|
106
|
+
}
|
|
107
|
+
else if (payload.kind === "grade") {
|
|
108
|
+
lastReview = payload.day.end;
|
|
109
|
+
days = schedule.days;
|
|
110
|
+
lapsed = payload.rating === "Again";
|
|
111
|
+
citations.push(...(record.cites ?? []));
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
lastReview = at;
|
|
115
|
+
days = schedule.days;
|
|
116
|
+
lapsed = false;
|
|
117
|
+
}
|
|
118
|
+
citations.push(id);
|
|
119
|
+
}
|
|
120
|
+
return lastReview === undefined
|
|
121
|
+
? undefined
|
|
122
|
+
: { kind: "interval", days, lastReview, lapsed, citations: [...new Set(citations)] };
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
};
|
|
126
|
+
function isSchedulerKind(kind) {
|
|
127
|
+
return typeof kind === "string" && Object.hasOwn(schedulers, kind);
|
|
128
|
+
}
|
|
129
|
+
export function validateReviewSchedule(value) {
|
|
130
|
+
if (value === undefined)
|
|
131
|
+
return;
|
|
132
|
+
if (typeof value === "object" &&
|
|
133
|
+
value !== null &&
|
|
134
|
+
!Array.isArray(value) &&
|
|
135
|
+
"kind" in value &&
|
|
136
|
+
Object.hasOwn(value, "kind")) {
|
|
137
|
+
const { kind } = value;
|
|
138
|
+
if (isSchedulerKind(kind) && schedulers[kind].validate(value))
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
throw new Error(`${REVIEW_PROPERTY}: expected { kind: "fsrs" }, { kind: "never" }, or { kind: "interval", days: a positive finite number }`);
|
|
142
|
+
}
|
|
143
|
+
export function prepareReviewReplay(schedule) {
|
|
144
|
+
switch (schedule.kind) {
|
|
145
|
+
case "fsrs":
|
|
146
|
+
return (evidence) => schedulers.fsrs.replay(schedule, evidence);
|
|
147
|
+
case "interval":
|
|
148
|
+
return (evidence) => schedulers.interval.replay(schedule, evidence);
|
|
149
|
+
case "never":
|
|
150
|
+
return schedulers.never.replay;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
export function sameReviewCurve(a, b) {
|
|
154
|
+
if (a.lastReview !== b.lastReview)
|
|
155
|
+
return false;
|
|
156
|
+
return a.kind === "fsrs"
|
|
157
|
+
? b.kind === "fsrs" &&
|
|
158
|
+
a.stability === b.stability &&
|
|
159
|
+
a.stabilityFast === b.stabilityFast &&
|
|
160
|
+
a.difficulty === b.difficulty
|
|
161
|
+
: b.kind === "interval" && a.days === b.days;
|
|
162
|
+
}
|
|
163
|
+
export function retrievabilityAt(schedule, time) {
|
|
164
|
+
const elapsed = (time - Date.parse(schedule.lastReview)) / DAY_MS;
|
|
165
|
+
if (schedule.kind === "fsrs")
|
|
166
|
+
return SCHEDULER.model.forgettingCurve(schedule, elapsed);
|
|
167
|
+
// The FSRS-5 power curve supplies a single trace normalized to 0.9 at the named interval.
|
|
168
|
+
const retention = Number(Math.pow(1 + ((19 / 81) * elapsed) / schedule.days, -0.5).toFixed(8));
|
|
169
|
+
return elapsed >= schedule.days && retention === 0.9 ? retention - Number.EPSILON : retention;
|
|
170
|
+
}
|
package/dist/skills/sources.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export declare const sources: {
|
|
2
2
|
readonly "base.md": "# Tutor base\n\nHelp the learner accomplish what they want and expand what they can do. Think first about the learner's goal, what they can do now, which way of learning fits, and what would move them furthest next.\n\nTalk with the learner about what they're after in their terms. Tool names, identifiers, labels, Skills and bookkeeping are yours, not theirs; name content by its display label and quote what they said.\n\n## Terms\n\n- **Node**: one thing someone can show or has done, defined by what shows it. Nodes are shared content; nothing about a learner is a Node, and a topic or a lesson is not one.\n- **Edge**: a prerequisite by definition: demonstrating the dependent demonstrates the prerequisite. Not teaching order, and not relatedness.\n- **Tag**: a named set of Nodes. Guidance on a tag reaches each of its Nodes; a `lesson:` tag groups a Lesson.\n- **Guidance**: instructions on a Node, tag or Mission about how to teach and check it, cascading onto the Nodes it reaches.\n- **Patch**: a versioned unit of graph content. The learner's own graph is their Personal Patch; others are adopted from the Hub.\n- **Mission**: a learner's goal, possibly not yet charted: target Nodes, the View of what they depend on, and the numbered path through it.\n- **View**: a saved selection of Nodes; a Mission's View is its targets and their prerequisites.\n- **Milestone**: a Node whose check is a whole performance closing a section of the path.\n- **Lesson**: one numbered stop on a path, a few Nodes worked on and checked in one Session. A Review rechecks due Nodes.\n- **Material**: a document, quiz, card, applet, roleplay, reference or audio the learner works in.\n- **Record**: what the learner did or claimed on a Node. The theory interprets Records into labels; you never set a label.\n\n## Teaching\n\n- Converse in the language the learner uses, unless there is a pedagogical reason to use another language. Treat practice in a target language as practice, not by itself as a request to switch the conversation's language.\n- Choose how to teach for this goal as stated, not for how the subject is usually taught. A method from another domain may fit better; the learner's own preferred method or a course they like is a legitimate choice.\n- Follow the learner's saved preferences and the guidance on the Nodes in play before choosing or making Material; pace work to their Session length and suggest wrapping up as active minutes reach it.\n- When the current mode permits Material work, teach and assess in Materials, and keep conversation for goals, reports, questions and confusion.\n- Present knowledge easily; difficulty spent on understanding is working memory lost. Make practice effortful: retrieval, spacing and interleaving build lasting strength where easy fluency only feels like mastery.\n- After no unaided success, show a worked example and then a similar problem. When guided work succeeds, fade help toward an unaided check. For multi-step work, give feedback on the step just taken as immediately as the medium allows.\n- Read prefetched Node memory and `theory {name:'trail',input}` for the current scope; notice what another Session added. Memory is context, not evidence. Never match learning styles or prescribe rereading as retrieval practice.\n- Tailor from an explicit preference or a cited Record, never a presumed learner trait. Testing a skill in the world can mean finding a well-moderated community of practitioners, unless the learner has said they do not want one.\n\n## Evidence\n\n- Describe what happened; the theory interprets it. Record an actual attempt at a posed, failable task that informs a decision, including a real step the learner reports taking. Reading, explanation or a remark in passing shows nothing.\n- What a Record will do to a label is never a reason to record, withhold or home it differently. When tempted to diagnose an error, retain what the learner did and name a misconception only when the response supports it.\n- Cite a Record identity or Patch provenance for factual claims about the learner or the content. Summaries are never evidence.\n";
|
|
3
|
-
readonly "chart/SKILL.md": "---\nname: chart\ndescription: A Mission, or the next section of one, needs graph content; or content is being designed for others to adopt.\n---\n\nCharting is dependency resolution from a settled Mission. With no learner, as for a Patch others will adopt, chart for a typical adopter's Mission.\n\n## Method\n\n1. **Survey how people get there.** Within the approach the Mission settled, find how courses, textbooks and syllabi organize this ground, or how practitioners who reached a goal in the world sequenced it: playbooks and postmortems. Read the structures, not their contents; Lessons pull in materials later. These are your checklist for comprehensiveness, against charting only what comes to mind first.\n\n2. **Find the macro organization.** What's the macro level organization of the Mission's prerequisites? Is it a sequence of real steps and the capabilities they need, or several separate, independently valuable skills or understandings, as with a knowledge domain? Should it be broken into separately practiced paths, like vocab vs grammar for a language? Is it fractal-like via \"making smaller circles\"? Separately practiced paths are strand tags; the practice serving one is guidance on its tag, not a Node.\n\n3. **Choose milestones.** A few milestones mark sections of progress toward the targets. Each is a smaller Mission: a whole performance worth having on its own, checked by using its section together. First is whichever gets the learner doing the real thing soonest, even crudely. Set `pedagogy:milestone: true` on the Node ending each section, and give its criterion a ladder of simpler conditions down to the lowest viable whole task. An outcome that also depends on the world, such as a stranger paying, suits a milestone; a miss leads to re-charting at its check-in. Where the Mission's approach is a conjecture, the next milestone is also its measure: name in the Mission's assessment guidance the few-minute task from it that a Lesson can open on, with its number where it has one (a time, a rate, a count). Milestone 0 holds what the learner says they already have or did, their words quoted as claims.\n\n4. **Elaborate the first section.** Recursively, starting from its milestone Node: does its new part fit one Session at the learner's minutes per Node? If not, how can that new part be broken into smaller prerequisites? Leave later sections coarse with `pedagogy:elaborate: true`, for the check-in before them.\n\n5. **Propose** the draft as a revision setting the Mission's targets, or as a graph diff when they don't change; content for others carries no claims. Don't write a syllabus; the theory derives the path.\n\n## The graph\n\n- A Node is one thing the learner can show or has done, defined by what shows it. Steps depend on what the learner can and will do themselves; work an agent could simply do is done by the tutor or left out, and coordinating other people stays outside. Different presentations of one task are one Node.\n- An Edge means the dependent can't be demonstrated without the prerequisite; give the reason in `pedagogy:because`. Teaching order is `pedagogy:priority`, never an Edge.\n- A part too big for one Lesson lacks a prerequisite step or capability (a child Node), volume (tiers: the top 50 words, then 100) or consolidation (thresholds: 60, then 90 words a minute).\n- Set `pedagogy:review:
|
|
3
|
+
readonly "chart/SKILL.md": "---\nname: chart\ndescription: A Mission, or the next section of one, needs graph content; or content is being designed for others to adopt.\n---\n\nCharting is dependency resolution from a settled Mission. With no learner, as for a Patch others will adopt, chart for a typical adopter's Mission.\n\n## Method\n\n1. **Survey how people get there.** Within the approach the Mission settled, find how courses, textbooks and syllabi organize this ground, or how practitioners who reached a goal in the world sequenced it: playbooks and postmortems. Read the structures, not their contents; Lessons pull in materials later. These are your checklist for comprehensiveness, against charting only what comes to mind first.\n\n2. **Find the macro organization.** What's the macro level organization of the Mission's prerequisites? Is it a sequence of real steps and the capabilities they need, or several separate, independently valuable skills or understandings, as with a knowledge domain? Should it be broken into separately practiced paths, like vocab vs grammar for a language? Is it fractal-like via \"making smaller circles\"? Separately practiced paths are strand tags; the practice serving one is guidance on its tag, not a Node.\n\n3. **Choose milestones.** A few milestones mark sections of progress toward the targets. Each is a smaller Mission: a whole performance worth having on its own, checked by using its section together. First is whichever gets the learner doing the real thing soonest, even crudely. Set `pedagogy:milestone: true` on the Node ending each section, and give its criterion a ladder of simpler conditions down to the lowest viable whole task. An outcome that also depends on the world, such as a stranger paying, suits a milestone; a miss leads to re-charting at its check-in. Where the Mission's approach is a conjecture, the next milestone is also its measure: name in the Mission's assessment guidance the few-minute task from it that a Lesson can open on, with its number where it has one (a time, a rate, a count). Milestone 0 holds what the learner says they already have or did, their words quoted as claims.\n\n4. **Elaborate the first section.** Recursively, starting from its milestone Node: does its new part fit one Session at the learner's minutes per Node? If not, how can that new part be broken into smaller prerequisites? Leave later sections coarse with `pedagogy:elaborate: true`, for the check-in before them.\n\n5. **Propose** the draft as a revision setting the Mission's targets, or as a graph diff when they don't change; content for others carries no claims. Don't write a syllabus; the theory derives the path.\n\n## The graph\n\n- A Node is one thing the learner can show or has done, defined by what shows it. Steps depend on what the learner can and will do themselves; work an agent could simply do is done by the tutor or left out, and coordinating other people stays outside. Different presentations of one task are one Node.\n- An Edge means the dependent can't be demonstrated without the prerequisite; give the reason in `pedagogy:because`. Teaching order is `pedagogy:priority`, never an Edge.\n- A part too big for one Lesson lacks a prerequisite step or capability (a child Node), volume (tiers: the top 50 words, then 100) or consolidation (thresholds: 60, then 90 words a minute).\n- Set `pedagogy:review` to `{ \"kind\": \"fsrs\" }` for what must be remembered, `{ \"kind\": \"never\" }` for one-off steps, or `{ \"kind\": \"interval\", \"days\": 30 }` for maintained states or capabilities that detrain, choosing how often to check them. If unset, milestones use `never` and other Nodes use `fsrs`.\n- Reuse an existing Node only unchanged: its metadata is shared with every Mission that uses it.\n- Group small Nodes taught together with a `lesson:<name>` tag, inside one section.\n- A learner's override of adopted guidance goes in their Mission's guidance, scoped to its Node.\n";
|
|
4
4
|
readonly "checkpoint/SKILL.md": "---\nname: checkpoint\ndescription: The Session opened on a check-in, or the learner says the course, or some of its content, isn't working.\n---\n\nA checkpoint adjusts a Mission in progress to what its Lessons have shown.\n\n## Method\n\n1. **Reflect.** After a milestone, start from its outcome and closing note in the Session opening: tell the learner what they showed, what came easy and what was hard, and ask whether what they want has shifted. After a complaint, ask what isn't working and read the cited Records. A check-in with no milestone behind it has nothing to reflect on; go to step 3.\n\n2. **Diagnose.** Warnings and outcomes point at a cause without proving it; read the task and response they cite first.\n - The goal moved: revise the Mission (see `mission`).\n - The milestone failed: re-chart a plan that didn't work in the world; for a capability miss, a follow-up Lesson under a simpler condition from its ladder, a blocking Review for components that regressed, or new Nodes for what the map missed. Fix the map, not the learner.\n - The map is wrong (grain, Edges, order, method): edit it (see `chart`). An edited Node keeps its Records, so change its criterion only while it still asserts the same capability; otherwise replace it.\n - A Record is wrong: that's a recording error, corrected in a Lesson, not a content problem.\n\n3. **Elaborate the next section** as charting does, folding in what Lessons deferred to this check-in, move the Mission's measure to the next milestone, and set `pedagogy:elaborate: false` on what you refine.\n\n4. **Propose** the changes as a graph diff for the Mission. At the final check-in, this is the Mission's retrospective: what they can do now, then retire the Mission, which is how it finishes, with an extension or a next Mission if they want one.\n";
|
|
5
5
|
readonly "material/SKILL.md": "---\nname: material\ndescription: A Lesson or Review is starting or its Materials have run, or a Material needs making or changing.\n---\n\nMaterials carry the learner into the work: teaching and assessment, or a brief and preparation for a real step. Reuse the Materials already about a Node (`theory items`) before making new ones.\n\nA Material can teach, assess or both, like a game whose levels get harder and are retried until beaten. Assess with unaided checks at the Nodes' criteria under the Mission's assessment guidance, enough independent checks to demonstrate each Node, graded mechanically wherever the answer is mechanical. When the real work is the check, use its outcome rather than a separate practice set.\n\nLoad the guide for the Session with `skill {name:'material', resource}`:\n\n- A Lesson: [lesson.md](lesson.md), and for a milestone also [milestone.md](milestone.md).\n- A Review: [review.md](review.md).\n\n## Which Material\n\n- **Document:** prose, worked examples and reference, for what the learner reads and comes back to.\n- **Quiz:** graded tasks, each answered by a choice, short or long text, or work in an applet or roleplay; for any posed practice or assessment that needs a verdict.\n- **Applet:** an interactive environment, for capabilities practised by acting on something like a board, simulation or diagram. To grade work in one, pose it in a quiz task.\n- **Roleplay:** a conversation with a character, for performances done with another person. To grade one, pose it in a quiz task.\n- **Cards:** spaced-retention items, for what to remember or practise through repetition.\n- **Reference:** an outside book, course or site located at the Nodes it teaches, for when an existing source teaches well.\n- **Audio:** generated speech, for listening and spoken prompts.\n\n## Assessing\n\n- A choice shows recognition, so production is checked by producing. Competing options are alike in length and form, and each wrong one can reveal the error it stands for.\n- Pose separate questions as separate short tasks. Give feedback on each answer in practice; hold results to the end for prior-capability, retention and milestone checks. Reserve one integrated response (an explanation, essay, project) for showing several capabilities at once, and describe what a response visibly does so a grader can tell shown from absent from mistaken.\n- Help sets how far a task teaches. In a Lesson, show a hint after a mistake, or add the correction if the mistake persists; prior-capability, retention and milestone checks only measure. Help costs no evidence: one response counts once per Node however many checks touch it, and where help touches a check, that Node is recorded unaided as its checks stood before help and aided as they ended.\n";
|
|
6
6
|
readonly "material/lesson.md": "# lesson\n\nThe host tells you when the Lesson reads complete. Recount what the learner did and end the Session when it makes sense to stop; keep going if the learner is mid-question or the attempt was shaky. Weigh active minutes against the learner's session length and the size of the conversation.\n\n1. **Read the Lesson:** its focus Nodes (the path in `theory mission`), their criteria and guidance, memory, trail, and the Materials already about them; where the Mission names a measure, also the next milestone's trail, for each attempt and what it broke on. A Lesson whose Materials shipped with an adopted Patch is already open; wait for the learner.\n\n2. **First turn: give the work the focus Nodes' guidance names and set completion.** For memory work, add the cards in one step and open them; set the Nodes' `pedagogy:completion` queries to their card recalls. For a real step, open a brief Material: what to do, what it serves (its dependents), what done looks like, and preparation that helps, such as working through a draft or rehearsing a conversation in a Roleplay. Set the Node's `pedagogy:completion` query to the evidence its criterion requires. The work itself is the check; record the learner's report as `records` directs. Leave a return reminder through the host's mechanics. For other exercise-based work, add teaching Material and one assessment set of short, single-question tasks, with `completion` queries for its focus Nodes sized to their criteria; end the teaching Document with `::next{id=\"<assessment set id>\" title=\"<Set title>\"}` and open only that Document: the learner opens the set from it. Where the Mission names a measure, open an attempt at it first and hold the teaching until it ends: the measure's task, cut to a few minutes and to what the focus Nodes are needed for, without help, recorded on the milestone Node with the conditions it was tried under. Then build the teaching and the set around what broke, leaving out what the attempt already showed.\n\n3. **Teach as the Mission's and Nodes' guidance directs,** including the sequence it sets.\n\n4. **When a run ends unmet,** read results, teach what's missed, and add new assessment items against the same checklist; rerun only assessments generating their own instances. An error that traces to no Node is a `missing-capability` proposal; a prerequisite that keeps failing gets its Review proposed.\n\n5. **When the measure hasn't moved** over the Lessons since the Mission's method was set, the method failed: propose a Mission revision that replaces it and keeps what the old one did to the measure. Involve the learner in method as far as their saved preference asks; with none, say in a sentence what's changing and why.\n\n**Cheat sheet:** Lessons are rarely revisited; reference is. Keep one cheat-sheet document per Patch, with a glossary where the subject has its own terms, adding a term once the learner can use it. The first Lesson to use one of a Node's `pedagogy:resources` adds it to a references Material, with locators for its Nodes.\n";
|
|
7
7
|
readonly "material/milestone.md": "# milestone\n\nA milestone assessment shows its section's capability whole: a few tasks at the milestone's full conditions, each using several of its Nodes, with no hints or feedback until submitted. Milestone 0 checks the learner's claims with tasks they weren't taught.\n\nWhen it fails, tell apart:\n\n- **Integration:** the parts hold alone but break together. Step down the criterion's ladder of conditions, then back up.\n- **A regressed prerequisite:** propose its Review.\n- **A missing capability:** the error traces to no Node; make a `missing-capability` proposal.\n\nAfter two or three rounds without gain, offer to revisit the map in Chart.\n";
|
|
8
|
-
readonly "material/review.md": "# review\n\nA Review rechecks its frozen batch for retention, assessing before any teaching.\n\n1. Assess with 3–4 realistic text tasks each covering several Nodes, with one check per batch Node. Open them as one sequential set; the host refuses missing or duplicate batch Node checks, so fix what a refusal names.\n2. After submission, give each miss a one- or two-sentence corrective and reopen the Material that taught it, one per turn, naming where the others were taught.\n3. Close with `evaluation` close-recount once every Node has a verdict and every miss its corrective.\n";
|
|
8
|
+
readonly "material/review.md": "# review\n\nA Review rechecks its frozen batch for retention, assessing before any teaching.\n\n1. Assess with 3–4 realistic text tasks each covering several Nodes, with one check per batch Node. For an `interval` Node, ask whether its criterion still holds and take the learner's word. Open them as one sequential set; the host refuses missing or duplicate batch Node checks, so fix what a refusal names.\n2. After submission, give each miss a one- or two-sentence corrective and reopen the Material that taught it, one per turn, naming where the others were taught.\n3. Close with `evaluation` close-recount once every Node has a verdict and every miss its corrective.\n";
|
|
9
9
|
readonly "mission/SKILL.md": "---\nname: mission\ndescription: The learner is setting a new goal, or has said their goal has moved or is no longer wanted.\n---\n\nA Mission is a concretely demonstrable long term goal that the learner wants directly. It's associated with a View representing how to get there. The Mission decides the content of the subgraph that backs it. Finding or creating graph content can be thought of as dependency resolution from Missions, so it's important to frame the Mission right first.\n\n## Method\n\n1. **Read the learner's existing Missions.** A goal that has moved is a revision of its Mission, one they no longer want is retired, and only an unrelated goal is a new Mission.\n\n2. **Research the goal on the Hub and the web.** Find what high-level approaches exist, reading only what you don't already know. If a Hub template fits this learner's approach as well as you'd chart it yourself, tell them what it covers and how it differs, and propose charting from it.\n\n3. **Interview the learner maieutically.** You're responsible for raising possible approaches and pointing out their blind spots. They're responsible for deciding what exactly they want. If the learner seems unaware of something relevant (eg existing materials, pedagogical approaches, or lines of thought), you should tell them about it rather than affirming what they feel to be novel. Don't be afraid to be a bit disagreeable. Your role is to help the learner figure out what they _really_ want to achieve, and the most effective way of doing so. Don't always take the learner's words at face value.\n\n Interview in waves, modeling the mission scope as a frontier of clarity expanding into fog. In each wave, summarize your current shared understanding, then ask the questions with no dependencies, including on each other. If a question you want to ask depends on the answer to another question you're asking, save the dependent one for next round. Continue until the understanding is sufficient to start concretely \"resolving\" the mission into nodes. Such an understanding should include\n - exactly what the learner wants to accomplish or be able to do, by when (if there's a time constraint), and why\n - what's not included, and how the learner's situation and motives differ from the assumptions of \"typical\" adjacent pedagogy\n - the learner's existing context - what they already know that might give them a head start or allow certain transfers/analogies\n - the learner's pedagogical preferences, especially as informed by their past experience of what's been effective or not, and how much say they want over method as it changes\n - whether they want capabilities checked on their real work rather than exercises; settle what work and what standard\n\n4. **Backbrief, record, and proceed to charting.** Give a full backbrief and propose the Mission from it, with the learner's preferences and context as its teaching guidance and the agreed work and standard as its assessment guidance, overriding generic criteria, so later Sessions don't ask again. Unless the approach is an adopted Patch's or an established course's, record it in the teaching guidance as a conjecture: where it comes from and what would count against it. Once the learner accepts, start charting.\n";
|
|
10
10
|
readonly "publish/SKILL.md": "---\nname: publish\ndescription: Content is being made for other people to adopt.\n---\n\nContent for others is charted (see `chart`) for the Mission a typical adopter would have, not for the author: don't prune by what the author knows, test them, or write claims.\n\n## Method\n\n1. **Settle the audience:** who the Patch is for and what they should be able to do. The author records it as the Patch's intended audience when publishing.\n\n2. **Start from what exists.** From scratch, chart the agreed scope. From a Mission the author has followed (an Author Session opened on a copy of it), generalize it: criteria, guidance and the Mission's own guidance that assume this learner (their known languages, their pace, what they skipped) are rewritten for the audience, and Nodes the audience needs that the author already had are charted in.\n\n3. **Choose the grain.** A complete course is charted throughout. A template is charted as method for adopters to fill with their own content: its Nodes are strands or stages whose criteria range over what each adopter's Mission charts (\"translates the words of every band the Mission charts\"), they're marked `pedagogy:elaborate: true`, and its guidance is written to the tutor who will chart an adopter's Mission: what to ask, how to resolve each strand into Nodes, what milestones look like. Milestone 0 places the adopter. A template can also be a Mission alone, with no Nodes.\n\n4. **Propose the Missions it ships:** what an adopter would choose, with the method as Mission guidance.\n\n5. **Make only the Materials the design needs,** for adopters (see `material`).\n\n6. **Check sources' licenses** permit redistribution before embedding their content, and keep source and license attribution. If permission is unclear, cite rather than copy.\n\n7. **Propose** the draft as one graph diff whose View is named for the Patch. Once accepted, the author captures and publishes that View from the Hub. Trying it as a learner means adopting the release into another Profile.\n";
|
|
11
|
-
readonly "records/SKILL.md": "---\nname: records\ndescription: You're about to grade a learner's attempt, or a recorded task, outcome or claim seems wrong.\n---\n\n## Grading\n\nDelegate chat capability checks to a grader (`evaluation` watch or judge) unless you're judging free work yourself. When you record by hand:\n\n- A task's `unaided` is fixed when you pose it. Help on the checked capability before the outcome makes it aided; glossing other unfamiliar words, said to the learner and kept in the recorded task, doesn't. Never gloss the capability being checked.\n- \"I don't know\" in answer to a posed task is a `dont-know` demonstration. Closing without answering records nothing.\n- A correct keyed choice doesn't demonstrate a production capability; a chat answer makes no timing claim and doesn't demonstrate a timed criterion. Measure it in a Material that reports its timings.\n- Read the trail first; don't record a task component twice.\n- For a real step, record the step as the task and the learner's report verbatim as the response. Use `grader: learner` for their word, `tutor` when you inspected the artifact (a file, repository or URL with your own tools), or `mechanical` for a runner's reading. `unaided` says whether they did it themselves. Their word is enough unless the criterion sets a bar someone must inspect; they are the authority on what they did, so this is a demonstration. A step done before the Mission began is a claim. The Node's completion query sets which evidence counts and how many; ten applications is a count of ten.\n\n## Corrections\n\nRead the Record's task, response and the standard applied to it. A learner disputing a standard correctly applied often means the Material assumes a typical context their Mission only resembles, or they want to deviate from it. Settle the standard they want and propose a Mission revision adding it as assessment guidance, so later checks hold to it. A Record that's actually wrong (wrong Node, wrong outcome) is confirmed with the learner, retracted, and recorded again with the same task and response; a delegated verdict is overridden instead. If the replacement fails, say the retraction happened and retry. \"I've forgotten\" is a new claim, not a reason to retract an earlier success. A complaint about the map itself (its grain, order or scope) is a checkpoint (propose Chart).\n";
|
|
11
|
+
readonly "records/SKILL.md": "---\nname: records\ndescription: You're about to grade a learner's attempt, or a recorded task, outcome or claim seems wrong.\n---\n\n## Grading\n\nDelegate chat capability checks to a grader (`evaluation` watch or judge) unless you're judging free work yourself. When you record by hand:\n\n- A task's `unaided` is fixed when you pose it. Help on the checked capability before the outcome makes it aided; glossing other unfamiliar words, said to the learner and kept in the recorded task, doesn't. Never gloss the capability being checked.\n- \"I don't know\" in answer to a posed task is a `dont-know` demonstration. Closing without answering records nothing.\n- A correct keyed choice doesn't demonstrate a production capability; a chat answer makes no timing claim and doesn't demonstrate a timed criterion. Measure it in a Material that reports its timings.\n- Read the trail first; don't record a task component twice.\n- For a real step, record the step as the task and the learner's report verbatim as the response. Use `grader: learner` for their word, `tutor` when you inspected the artifact (a file, repository or URL with your own tools), or `mechanical` for a runner's reading. `unaided` says whether they did it themselves. Their word is enough unless the criterion sets a bar someone must inspect; they are the authority on what they did, so this is a demonstration. A step done before the Mission began is a claim; a state the learner shows still holds now is a demonstration observed now. The Node's completion query sets which evidence counts and how many; ten applications is a count of ten.\n\n## Corrections\n\nRead the Record's task, response and the standard applied to it. A learner disputing a standard correctly applied often means the Material assumes a typical context their Mission only resembles, or they want to deviate from it. Settle the standard they want and propose a Mission revision adding it as assessment guidance, so later checks hold to it. A Record that's actually wrong (wrong Node, wrong outcome) is confirmed with the learner, retracted, and recorded again with the same task and response; a delegated verdict is overridden instead. If the replacement fails, say the retraction happened and retry. \"I've forgotten\" is a new claim, not a reason to retract an earlier success. A complaint about the map itself (its grain, order or scope) is a checkpoint (propose Chart).\n";
|
|
12
12
|
};
|
package/dist/skills/sources.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// Generated by build-skills.ts from Markdown; do not edit.
|
|
2
2
|
export const sources = {
|
|
3
3
|
"base.md": "# Tutor base\n\nHelp the learner accomplish what they want and expand what they can do. Think first about the learner's goal, what they can do now, which way of learning fits, and what would move them furthest next.\n\nTalk with the learner about what they're after in their terms. Tool names, identifiers, labels, Skills and bookkeeping are yours, not theirs; name content by its display label and quote what they said.\n\n## Terms\n\n- **Node**: one thing someone can show or has done, defined by what shows it. Nodes are shared content; nothing about a learner is a Node, and a topic or a lesson is not one.\n- **Edge**: a prerequisite by definition: demonstrating the dependent demonstrates the prerequisite. Not teaching order, and not relatedness.\n- **Tag**: a named set of Nodes. Guidance on a tag reaches each of its Nodes; a `lesson:` tag groups a Lesson.\n- **Guidance**: instructions on a Node, tag or Mission about how to teach and check it, cascading onto the Nodes it reaches.\n- **Patch**: a versioned unit of graph content. The learner's own graph is their Personal Patch; others are adopted from the Hub.\n- **Mission**: a learner's goal, possibly not yet charted: target Nodes, the View of what they depend on, and the numbered path through it.\n- **View**: a saved selection of Nodes; a Mission's View is its targets and their prerequisites.\n- **Milestone**: a Node whose check is a whole performance closing a section of the path.\n- **Lesson**: one numbered stop on a path, a few Nodes worked on and checked in one Session. A Review rechecks due Nodes.\n- **Material**: a document, quiz, card, applet, roleplay, reference or audio the learner works in.\n- **Record**: what the learner did or claimed on a Node. The theory interprets Records into labels; you never set a label.\n\n## Teaching\n\n- Converse in the language the learner uses, unless there is a pedagogical reason to use another language. Treat practice in a target language as practice, not by itself as a request to switch the conversation's language.\n- Choose how to teach for this goal as stated, not for how the subject is usually taught. A method from another domain may fit better; the learner's own preferred method or a course they like is a legitimate choice.\n- Follow the learner's saved preferences and the guidance on the Nodes in play before choosing or making Material; pace work to their Session length and suggest wrapping up as active minutes reach it.\n- When the current mode permits Material work, teach and assess in Materials, and keep conversation for goals, reports, questions and confusion.\n- Present knowledge easily; difficulty spent on understanding is working memory lost. Make practice effortful: retrieval, spacing and interleaving build lasting strength where easy fluency only feels like mastery.\n- After no unaided success, show a worked example and then a similar problem. When guided work succeeds, fade help toward an unaided check. For multi-step work, give feedback on the step just taken as immediately as the medium allows.\n- Read prefetched Node memory and `theory {name:'trail',input}` for the current scope; notice what another Session added. Memory is context, not evidence. Never match learning styles or prescribe rereading as retrieval practice.\n- Tailor from an explicit preference or a cited Record, never a presumed learner trait. Testing a skill in the world can mean finding a well-moderated community of practitioners, unless the learner has said they do not want one.\n\n## Evidence\n\n- Describe what happened; the theory interprets it. Record an actual attempt at a posed, failable task that informs a decision, including a real step the learner reports taking. Reading, explanation or a remark in passing shows nothing.\n- What a Record will do to a label is never a reason to record, withhold or home it differently. When tempted to diagnose an error, retain what the learner did and name a misconception only when the response supports it.\n- Cite a Record identity or Patch provenance for factual claims about the learner or the content. Summaries are never evidence.\n",
|
|
4
|
-
"chart/SKILL.md": "---\nname: chart\ndescription: A Mission, or the next section of one, needs graph content; or content is being designed for others to adopt.\n---\n\nCharting is dependency resolution from a settled Mission. With no learner, as for a Patch others will adopt, chart for a typical adopter's Mission.\n\n## Method\n\n1. **Survey how people get there.** Within the approach the Mission settled, find how courses, textbooks and syllabi organize this ground, or how practitioners who reached a goal in the world sequenced it: playbooks and postmortems. Read the structures, not their contents; Lessons pull in materials later. These are your checklist for comprehensiveness, against charting only what comes to mind first.\n\n2. **Find the macro organization.** What's the macro level organization of the Mission's prerequisites? Is it a sequence of real steps and the capabilities they need, or several separate, independently valuable skills or understandings, as with a knowledge domain? Should it be broken into separately practiced paths, like vocab vs grammar for a language? Is it fractal-like via \"making smaller circles\"? Separately practiced paths are strand tags; the practice serving one is guidance on its tag, not a Node.\n\n3. **Choose milestones.** A few milestones mark sections of progress toward the targets. Each is a smaller Mission: a whole performance worth having on its own, checked by using its section together. First is whichever gets the learner doing the real thing soonest, even crudely. Set `pedagogy:milestone: true` on the Node ending each section, and give its criterion a ladder of simpler conditions down to the lowest viable whole task. An outcome that also depends on the world, such as a stranger paying, suits a milestone; a miss leads to re-charting at its check-in. Where the Mission's approach is a conjecture, the next milestone is also its measure: name in the Mission's assessment guidance the few-minute task from it that a Lesson can open on, with its number where it has one (a time, a rate, a count). Milestone 0 holds what the learner says they already have or did, their words quoted as claims.\n\n4. **Elaborate the first section.** Recursively, starting from its milestone Node: does its new part fit one Session at the learner's minutes per Node? If not, how can that new part be broken into smaller prerequisites? Leave later sections coarse with `pedagogy:elaborate: true`, for the check-in before them.\n\n5. **Propose** the draft as a revision setting the Mission's targets, or as a graph diff when they don't change; content for others carries no claims. Don't write a syllabus; the theory derives the path.\n\n## The graph\n\n- A Node is one thing the learner can show or has done, defined by what shows it. Steps depend on what the learner can and will do themselves; work an agent could simply do is done by the tutor or left out, and coordinating other people stays outside. Different presentations of one task are one Node.\n- An Edge means the dependent can't be demonstrated without the prerequisite; give the reason in `pedagogy:because`. Teaching order is `pedagogy:priority`, never an Edge.\n- A part too big for one Lesson lacks a prerequisite step or capability (a child Node), volume (tiers: the top 50 words, then 100) or consolidation (thresholds: 60, then 90 words a minute).\n- Set `pedagogy:review:
|
|
4
|
+
"chart/SKILL.md": "---\nname: chart\ndescription: A Mission, or the next section of one, needs graph content; or content is being designed for others to adopt.\n---\n\nCharting is dependency resolution from a settled Mission. With no learner, as for a Patch others will adopt, chart for a typical adopter's Mission.\n\n## Method\n\n1. **Survey how people get there.** Within the approach the Mission settled, find how courses, textbooks and syllabi organize this ground, or how practitioners who reached a goal in the world sequenced it: playbooks and postmortems. Read the structures, not their contents; Lessons pull in materials later. These are your checklist for comprehensiveness, against charting only what comes to mind first.\n\n2. **Find the macro organization.** What's the macro level organization of the Mission's prerequisites? Is it a sequence of real steps and the capabilities they need, or several separate, independently valuable skills or understandings, as with a knowledge domain? Should it be broken into separately practiced paths, like vocab vs grammar for a language? Is it fractal-like via \"making smaller circles\"? Separately practiced paths are strand tags; the practice serving one is guidance on its tag, not a Node.\n\n3. **Choose milestones.** A few milestones mark sections of progress toward the targets. Each is a smaller Mission: a whole performance worth having on its own, checked by using its section together. First is whichever gets the learner doing the real thing soonest, even crudely. Set `pedagogy:milestone: true` on the Node ending each section, and give its criterion a ladder of simpler conditions down to the lowest viable whole task. An outcome that also depends on the world, such as a stranger paying, suits a milestone; a miss leads to re-charting at its check-in. Where the Mission's approach is a conjecture, the next milestone is also its measure: name in the Mission's assessment guidance the few-minute task from it that a Lesson can open on, with its number where it has one (a time, a rate, a count). Milestone 0 holds what the learner says they already have or did, their words quoted as claims.\n\n4. **Elaborate the first section.** Recursively, starting from its milestone Node: does its new part fit one Session at the learner's minutes per Node? If not, how can that new part be broken into smaller prerequisites? Leave later sections coarse with `pedagogy:elaborate: true`, for the check-in before them.\n\n5. **Propose** the draft as a revision setting the Mission's targets, or as a graph diff when they don't change; content for others carries no claims. Don't write a syllabus; the theory derives the path.\n\n## The graph\n\n- A Node is one thing the learner can show or has done, defined by what shows it. Steps depend on what the learner can and will do themselves; work an agent could simply do is done by the tutor or left out, and coordinating other people stays outside. Different presentations of one task are one Node.\n- An Edge means the dependent can't be demonstrated without the prerequisite; give the reason in `pedagogy:because`. Teaching order is `pedagogy:priority`, never an Edge.\n- A part too big for one Lesson lacks a prerequisite step or capability (a child Node), volume (tiers: the top 50 words, then 100) or consolidation (thresholds: 60, then 90 words a minute).\n- Set `pedagogy:review` to `{ \"kind\": \"fsrs\" }` for what must be remembered, `{ \"kind\": \"never\" }` for one-off steps, or `{ \"kind\": \"interval\", \"days\": 30 }` for maintained states or capabilities that detrain, choosing how often to check them. If unset, milestones use `never` and other Nodes use `fsrs`.\n- Reuse an existing Node only unchanged: its metadata is shared with every Mission that uses it.\n- Group small Nodes taught together with a `lesson:<name>` tag, inside one section.\n- A learner's override of adopted guidance goes in their Mission's guidance, scoped to its Node.\n",
|
|
5
5
|
"checkpoint/SKILL.md": "---\nname: checkpoint\ndescription: The Session opened on a check-in, or the learner says the course, or some of its content, isn't working.\n---\n\nA checkpoint adjusts a Mission in progress to what its Lessons have shown.\n\n## Method\n\n1. **Reflect.** After a milestone, start from its outcome and closing note in the Session opening: tell the learner what they showed, what came easy and what was hard, and ask whether what they want has shifted. After a complaint, ask what isn't working and read the cited Records. A check-in with no milestone behind it has nothing to reflect on; go to step 3.\n\n2. **Diagnose.** Warnings and outcomes point at a cause without proving it; read the task and response they cite first.\n - The goal moved: revise the Mission (see `mission`).\n - The milestone failed: re-chart a plan that didn't work in the world; for a capability miss, a follow-up Lesson under a simpler condition from its ladder, a blocking Review for components that regressed, or new Nodes for what the map missed. Fix the map, not the learner.\n - The map is wrong (grain, Edges, order, method): edit it (see `chart`). An edited Node keeps its Records, so change its criterion only while it still asserts the same capability; otherwise replace it.\n - A Record is wrong: that's a recording error, corrected in a Lesson, not a content problem.\n\n3. **Elaborate the next section** as charting does, folding in what Lessons deferred to this check-in, move the Mission's measure to the next milestone, and set `pedagogy:elaborate: false` on what you refine.\n\n4. **Propose** the changes as a graph diff for the Mission. At the final check-in, this is the Mission's retrospective: what they can do now, then retire the Mission, which is how it finishes, with an extension or a next Mission if they want one.\n",
|
|
6
6
|
"material/SKILL.md": "---\nname: material\ndescription: A Lesson or Review is starting or its Materials have run, or a Material needs making or changing.\n---\n\nMaterials carry the learner into the work: teaching and assessment, or a brief and preparation for a real step. Reuse the Materials already about a Node (`theory items`) before making new ones.\n\nA Material can teach, assess or both, like a game whose levels get harder and are retried until beaten. Assess with unaided checks at the Nodes' criteria under the Mission's assessment guidance, enough independent checks to demonstrate each Node, graded mechanically wherever the answer is mechanical. When the real work is the check, use its outcome rather than a separate practice set.\n\nLoad the guide for the Session with `skill {name:'material', resource}`:\n\n- A Lesson: [lesson.md](lesson.md), and for a milestone also [milestone.md](milestone.md).\n- A Review: [review.md](review.md).\n\n## Which Material\n\n- **Document:** prose, worked examples and reference, for what the learner reads and comes back to.\n- **Quiz:** graded tasks, each answered by a choice, short or long text, or work in an applet or roleplay; for any posed practice or assessment that needs a verdict.\n- **Applet:** an interactive environment, for capabilities practised by acting on something like a board, simulation or diagram. To grade work in one, pose it in a quiz task.\n- **Roleplay:** a conversation with a character, for performances done with another person. To grade one, pose it in a quiz task.\n- **Cards:** spaced-retention items, for what to remember or practise through repetition.\n- **Reference:** an outside book, course or site located at the Nodes it teaches, for when an existing source teaches well.\n- **Audio:** generated speech, for listening and spoken prompts.\n\n## Assessing\n\n- A choice shows recognition, so production is checked by producing. Competing options are alike in length and form, and each wrong one can reveal the error it stands for.\n- Pose separate questions as separate short tasks. Give feedback on each answer in practice; hold results to the end for prior-capability, retention and milestone checks. Reserve one integrated response (an explanation, essay, project) for showing several capabilities at once, and describe what a response visibly does so a grader can tell shown from absent from mistaken.\n- Help sets how far a task teaches. In a Lesson, show a hint after a mistake, or add the correction if the mistake persists; prior-capability, retention and milestone checks only measure. Help costs no evidence: one response counts once per Node however many checks touch it, and where help touches a check, that Node is recorded unaided as its checks stood before help and aided as they ended.\n",
|
|
7
7
|
"material/lesson.md": "# lesson\n\nThe host tells you when the Lesson reads complete. Recount what the learner did and end the Session when it makes sense to stop; keep going if the learner is mid-question or the attempt was shaky. Weigh active minutes against the learner's session length and the size of the conversation.\n\n1. **Read the Lesson:** its focus Nodes (the path in `theory mission`), their criteria and guidance, memory, trail, and the Materials already about them; where the Mission names a measure, also the next milestone's trail, for each attempt and what it broke on. A Lesson whose Materials shipped with an adopted Patch is already open; wait for the learner.\n\n2. **First turn: give the work the focus Nodes' guidance names and set completion.** For memory work, add the cards in one step and open them; set the Nodes' `pedagogy:completion` queries to their card recalls. For a real step, open a brief Material: what to do, what it serves (its dependents), what done looks like, and preparation that helps, such as working through a draft or rehearsing a conversation in a Roleplay. Set the Node's `pedagogy:completion` query to the evidence its criterion requires. The work itself is the check; record the learner's report as `records` directs. Leave a return reminder through the host's mechanics. For other exercise-based work, add teaching Material and one assessment set of short, single-question tasks, with `completion` queries for its focus Nodes sized to their criteria; end the teaching Document with `::next{id=\"<assessment set id>\" title=\"<Set title>\"}` and open only that Document: the learner opens the set from it. Where the Mission names a measure, open an attempt at it first and hold the teaching until it ends: the measure's task, cut to a few minutes and to what the focus Nodes are needed for, without help, recorded on the milestone Node with the conditions it was tried under. Then build the teaching and the set around what broke, leaving out what the attempt already showed.\n\n3. **Teach as the Mission's and Nodes' guidance directs,** including the sequence it sets.\n\n4. **When a run ends unmet,** read results, teach what's missed, and add new assessment items against the same checklist; rerun only assessments generating their own instances. An error that traces to no Node is a `missing-capability` proposal; a prerequisite that keeps failing gets its Review proposed.\n\n5. **When the measure hasn't moved** over the Lessons since the Mission's method was set, the method failed: propose a Mission revision that replaces it and keeps what the old one did to the measure. Involve the learner in method as far as their saved preference asks; with none, say in a sentence what's changing and why.\n\n**Cheat sheet:** Lessons are rarely revisited; reference is. Keep one cheat-sheet document per Patch, with a glossary where the subject has its own terms, adding a term once the learner can use it. The first Lesson to use one of a Node's `pedagogy:resources` adds it to a references Material, with locators for its Nodes.\n",
|
|
8
8
|
"material/milestone.md": "# milestone\n\nA milestone assessment shows its section's capability whole: a few tasks at the milestone's full conditions, each using several of its Nodes, with no hints or feedback until submitted. Milestone 0 checks the learner's claims with tasks they weren't taught.\n\nWhen it fails, tell apart:\n\n- **Integration:** the parts hold alone but break together. Step down the criterion's ladder of conditions, then back up.\n- **A regressed prerequisite:** propose its Review.\n- **A missing capability:** the error traces to no Node; make a `missing-capability` proposal.\n\nAfter two or three rounds without gain, offer to revisit the map in Chart.\n",
|
|
9
|
-
"material/review.md": "# review\n\nA Review rechecks its frozen batch for retention, assessing before any teaching.\n\n1. Assess with 3–4 realistic text tasks each covering several Nodes, with one check per batch Node. Open them as one sequential set; the host refuses missing or duplicate batch Node checks, so fix what a refusal names.\n2. After submission, give each miss a one- or two-sentence corrective and reopen the Material that taught it, one per turn, naming where the others were taught.\n3. Close with `evaluation` close-recount once every Node has a verdict and every miss its corrective.\n",
|
|
9
|
+
"material/review.md": "# review\n\nA Review rechecks its frozen batch for retention, assessing before any teaching.\n\n1. Assess with 3–4 realistic text tasks each covering several Nodes, with one check per batch Node. For an `interval` Node, ask whether its criterion still holds and take the learner's word. Open them as one sequential set; the host refuses missing or duplicate batch Node checks, so fix what a refusal names.\n2. After submission, give each miss a one- or two-sentence corrective and reopen the Material that taught it, one per turn, naming where the others were taught.\n3. Close with `evaluation` close-recount once every Node has a verdict and every miss its corrective.\n",
|
|
10
10
|
"mission/SKILL.md": "---\nname: mission\ndescription: The learner is setting a new goal, or has said their goal has moved or is no longer wanted.\n---\n\nA Mission is a concretely demonstrable long term goal that the learner wants directly. It's associated with a View representing how to get there. The Mission decides the content of the subgraph that backs it. Finding or creating graph content can be thought of as dependency resolution from Missions, so it's important to frame the Mission right first.\n\n## Method\n\n1. **Read the learner's existing Missions.** A goal that has moved is a revision of its Mission, one they no longer want is retired, and only an unrelated goal is a new Mission.\n\n2. **Research the goal on the Hub and the web.** Find what high-level approaches exist, reading only what you don't already know. If a Hub template fits this learner's approach as well as you'd chart it yourself, tell them what it covers and how it differs, and propose charting from it.\n\n3. **Interview the learner maieutically.** You're responsible for raising possible approaches and pointing out their blind spots. They're responsible for deciding what exactly they want. If the learner seems unaware of something relevant (eg existing materials, pedagogical approaches, or lines of thought), you should tell them about it rather than affirming what they feel to be novel. Don't be afraid to be a bit disagreeable. Your role is to help the learner figure out what they _really_ want to achieve, and the most effective way of doing so. Don't always take the learner's words at face value.\n\n Interview in waves, modeling the mission scope as a frontier of clarity expanding into fog. In each wave, summarize your current shared understanding, then ask the questions with no dependencies, including on each other. If a question you want to ask depends on the answer to another question you're asking, save the dependent one for next round. Continue until the understanding is sufficient to start concretely \"resolving\" the mission into nodes. Such an understanding should include\n - exactly what the learner wants to accomplish or be able to do, by when (if there's a time constraint), and why\n - what's not included, and how the learner's situation and motives differ from the assumptions of \"typical\" adjacent pedagogy\n - the learner's existing context - what they already know that might give them a head start or allow certain transfers/analogies\n - the learner's pedagogical preferences, especially as informed by their past experience of what's been effective or not, and how much say they want over method as it changes\n - whether they want capabilities checked on their real work rather than exercises; settle what work and what standard\n\n4. **Backbrief, record, and proceed to charting.** Give a full backbrief and propose the Mission from it, with the learner's preferences and context as its teaching guidance and the agreed work and standard as its assessment guidance, overriding generic criteria, so later Sessions don't ask again. Unless the approach is an adopted Patch's or an established course's, record it in the teaching guidance as a conjecture: where it comes from and what would count against it. Once the learner accepts, start charting.\n",
|
|
11
11
|
"publish/SKILL.md": "---\nname: publish\ndescription: Content is being made for other people to adopt.\n---\n\nContent for others is charted (see `chart`) for the Mission a typical adopter would have, not for the author: don't prune by what the author knows, test them, or write claims.\n\n## Method\n\n1. **Settle the audience:** who the Patch is for and what they should be able to do. The author records it as the Patch's intended audience when publishing.\n\n2. **Start from what exists.** From scratch, chart the agreed scope. From a Mission the author has followed (an Author Session opened on a copy of it), generalize it: criteria, guidance and the Mission's own guidance that assume this learner (their known languages, their pace, what they skipped) are rewritten for the audience, and Nodes the audience needs that the author already had are charted in.\n\n3. **Choose the grain.** A complete course is charted throughout. A template is charted as method for adopters to fill with their own content: its Nodes are strands or stages whose criteria range over what each adopter's Mission charts (\"translates the words of every band the Mission charts\"), they're marked `pedagogy:elaborate: true`, and its guidance is written to the tutor who will chart an adopter's Mission: what to ask, how to resolve each strand into Nodes, what milestones look like. Milestone 0 places the adopter. A template can also be a Mission alone, with no Nodes.\n\n4. **Propose the Missions it ships:** what an adopter would choose, with the method as Mission guidance.\n\n5. **Make only the Materials the design needs,** for adopters (see `material`).\n\n6. **Check sources' licenses** permit redistribution before embedding their content, and keep source and license attribution. If permission is unclear, cite rather than copy.\n\n7. **Propose** the draft as one graph diff whose View is named for the Patch. Once accepted, the author captures and publishes that View from the Hub. Trying it as a learner means adopting the release into another Profile.\n",
|
|
12
|
-
"records/SKILL.md": "---\nname: records\ndescription: You're about to grade a learner's attempt, or a recorded task, outcome or claim seems wrong.\n---\n\n## Grading\n\nDelegate chat capability checks to a grader (`evaluation` watch or judge) unless you're judging free work yourself. When you record by hand:\n\n- A task's `unaided` is fixed when you pose it. Help on the checked capability before the outcome makes it aided; glossing other unfamiliar words, said to the learner and kept in the recorded task, doesn't. Never gloss the capability being checked.\n- \"I don't know\" in answer to a posed task is a `dont-know` demonstration. Closing without answering records nothing.\n- A correct keyed choice doesn't demonstrate a production capability; a chat answer makes no timing claim and doesn't demonstrate a timed criterion. Measure it in a Material that reports its timings.\n- Read the trail first; don't record a task component twice.\n- For a real step, record the step as the task and the learner's report verbatim as the response. Use `grader: learner` for their word, `tutor` when you inspected the artifact (a file, repository or URL with your own tools), or `mechanical` for a runner's reading. `unaided` says whether they did it themselves. Their word is enough unless the criterion sets a bar someone must inspect; they are the authority on what they did, so this is a demonstration. A step done before the Mission began is a claim. The Node's completion query sets which evidence counts and how many; ten applications is a count of ten.\n\n## Corrections\n\nRead the Record's task, response and the standard applied to it. A learner disputing a standard correctly applied often means the Material assumes a typical context their Mission only resembles, or they want to deviate from it. Settle the standard they want and propose a Mission revision adding it as assessment guidance, so later checks hold to it. A Record that's actually wrong (wrong Node, wrong outcome) is confirmed with the learner, retracted, and recorded again with the same task and response; a delegated verdict is overridden instead. If the replacement fails, say the retraction happened and retry. \"I've forgotten\" is a new claim, not a reason to retract an earlier success. A complaint about the map itself (its grain, order or scope) is a checkpoint (propose Chart).\n",
|
|
12
|
+
"records/SKILL.md": "---\nname: records\ndescription: You're about to grade a learner's attempt, or a recorded task, outcome or claim seems wrong.\n---\n\n## Grading\n\nDelegate chat capability checks to a grader (`evaluation` watch or judge) unless you're judging free work yourself. When you record by hand:\n\n- A task's `unaided` is fixed when you pose it. Help on the checked capability before the outcome makes it aided; glossing other unfamiliar words, said to the learner and kept in the recorded task, doesn't. Never gloss the capability being checked.\n- \"I don't know\" in answer to a posed task is a `dont-know` demonstration. Closing without answering records nothing.\n- A correct keyed choice doesn't demonstrate a production capability; a chat answer makes no timing claim and doesn't demonstrate a timed criterion. Measure it in a Material that reports its timings.\n- Read the trail first; don't record a task component twice.\n- For a real step, record the step as the task and the learner's report verbatim as the response. Use `grader: learner` for their word, `tutor` when you inspected the artifact (a file, repository or URL with your own tools), or `mechanical` for a runner's reading. `unaided` says whether they did it themselves. Their word is enough unless the criterion sets a bar someone must inspect; they are the authority on what they did, so this is a demonstration. A step done before the Mission began is a claim; a state the learner shows still holds now is a demonstration observed now. The Node's completion query sets which evidence counts and how many; ten applications is a count of ten.\n\n## Corrections\n\nRead the Record's task, response and the standard applied to it. A learner disputing a standard correctly applied often means the Material assumes a typical context their Mission only resembles, or they want to deviate from it. Settle the standard they want and propose a Mission revision adding it as assessment guidance, so later checks hold to it. A Record that's actually wrong (wrong Node, wrong outcome) is confirmed with the learner, retracted, and recorded again with the same task and response; a delegated verdict is overridden instead. If the replacement fails, say the retraction happened and retry. \"I've forgotten\" is a new claim, not a reason to retract an earlier success. A complaint about the map itself (its grain, order or scope) is a checkpoint (propose Chart).\n",
|
|
13
13
|
};
|
package/dist/state.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type { Speaker } from "@mmon-co/ncept-core/theory/speaker";
|
|
2
2
|
import { type TheoryState } from "@mmon-co/ncept-core/theory";
|
|
3
|
+
import { type NodeSchedule } from "./schedules.js";
|
|
4
|
+
export { DEFAULT_PARAMETERS, type DefaultParameters, type NodeSchedule } from "./schedules.js";
|
|
3
5
|
import { type Completion, type CompletionProgress } from "./completion.js";
|
|
4
6
|
import { type ExactPatchRef, type MetadataSet, type NodeId, type ResolvedGraph } from "@mmon-co/ncept-core/patch";
|
|
5
7
|
import { type LearnerDay, type Observation, type ObservationId, type SurfaceId } from "@mmon-co/ncept-core/observations";
|
|
6
8
|
export declare const DEFAULT_THEORY_ID = "default";
|
|
7
9
|
export declare const DEFAULT_THEORY_REF: {
|
|
8
10
|
readonly theory: "default";
|
|
9
|
-
readonly version: "1.
|
|
11
|
+
readonly version: "1.4.0";
|
|
10
12
|
};
|
|
11
13
|
export interface NodeRef {
|
|
12
14
|
readonly node: NodeId;
|
|
@@ -224,25 +226,6 @@ export declare function homingCandidates(graph: ResolvedGraph): readonly HomingC
|
|
|
224
226
|
/** Provisional interpretations for a graph edit: the target revision restates every decision in force. */
|
|
225
227
|
export declare function projectGraphChange(state: Pick<DefaultState, "records" | "homing">, graph: ResolvedGraph, next: ResolvedGraph, successors?: Readonly<Partial<Record<NodeId, readonly NodeId[]>>>): readonly Homing[];
|
|
226
228
|
export type NodeLabel = "demonstrated" | "probably-known" | "unknown";
|
|
227
|
-
export type DefaultParameters = Readonly<{
|
|
228
|
-
retention: Readonly<{
|
|
229
|
-
due: number;
|
|
230
|
-
fading: number;
|
|
231
|
-
claimStabilityDays: number;
|
|
232
|
-
}>;
|
|
233
|
-
}>;
|
|
234
|
-
export declare const DEFAULT_PARAMETERS: DefaultParameters;
|
|
235
|
-
export interface NodeSchedule {
|
|
236
|
-
readonly stability: number;
|
|
237
|
-
readonly difficulty: number;
|
|
238
|
-
readonly reps: number;
|
|
239
|
-
readonly lapses: number;
|
|
240
|
-
readonly lastReview: string;
|
|
241
|
-
readonly retrievability: number;
|
|
242
|
-
/** Observed forgetting stays due until a later non-Again day grade, independently of FSRS R. */
|
|
243
|
-
readonly lapsed: boolean;
|
|
244
|
-
readonly citations: readonly ObservationId[];
|
|
245
|
-
}
|
|
246
229
|
export interface NodeState {
|
|
247
230
|
readonly completion: CompletionProgress & {
|
|
248
231
|
readonly query?: Completion;
|
|
@@ -313,4 +296,3 @@ export declare function defaultProjectionBasis(state: DefaultState): ProjectionB
|
|
|
313
296
|
export declare function initDefaultState(graph: ResolvedGraph): TheoryState<DefaultState>;
|
|
314
297
|
/** Pure default policy, derived from the same reducer used by retained replays. */
|
|
315
298
|
export declare function stateDefault(graph: ResolvedGraph, supplied: readonly Observation[], now: string): DefaultState;
|
|
316
|
-
export {};
|
package/dist/state.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { createEmptyCard, forgetting_curve, fsrs, generatorParameters, Rating } from "ts-fsrs";
|
|
2
1
|
import { readTheoryState } from "@mmon-co/ncept-core/theory";
|
|
3
2
|
import { dependentCones } from "./dependent-cone.js";
|
|
3
|
+
import { nodeReviewSchedule } from "./path.js";
|
|
4
|
+
import { prepareReviewReplay, retrievabilityAt } from "./schedules.js";
|
|
5
|
+
export { DEFAULT_PARAMETERS } from "./schedules.js";
|
|
4
6
|
import { COMPLETION_PROPERTY, compileCompletion, completionBoundary, prepareCompletionHistory, } from "./completion.js";
|
|
5
7
|
import { provenanceOf, exactPatchRefKey, lastMetadataContribution, metadataSetsForEntity, NODE_CRITERION_PROPERTY, sameExactPatchRef, } from "@mmon-co/ncept-core/patch";
|
|
6
8
|
import { compareObservations, isObservationId, isObservationTimestamp, } from "@mmon-co/ncept-core/observations";
|
|
7
9
|
export const DEFAULT_THEORY_ID = "default";
|
|
8
|
-
export const DEFAULT_THEORY_REF = { theory: DEFAULT_THEORY_ID, version: "1.
|
|
10
|
+
export const DEFAULT_THEORY_REF = { theory: DEFAULT_THEORY_ID, version: "1.4.0" };
|
|
9
11
|
function object(value) {
|
|
10
12
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
11
13
|
}
|
|
@@ -360,12 +362,6 @@ export function projectGraphChange(state, graph, next, successors = {}) {
|
|
|
360
362
|
];
|
|
361
363
|
});
|
|
362
364
|
}
|
|
363
|
-
export const DEFAULT_PARAMETERS = {
|
|
364
|
-
retention: { due: 0.9, fading: 0.7, claimStabilityDays: 1 },
|
|
365
|
-
};
|
|
366
|
-
const DAY_MS = 86_400_000;
|
|
367
|
-
/** Daily reviews have no learning steps; disabling fuzz keeps replay deterministic. */
|
|
368
|
-
const SCHEDULER = fsrs(generatorParameters({ enable_fuzz: false, enable_short_term: false }));
|
|
369
365
|
/** The latest tentative competence report, newer than any actual failure. */
|
|
370
366
|
function knowsClaim(records) {
|
|
371
367
|
const latest = records.findLast((record) => record.payload.kind === "claim");
|
|
@@ -393,64 +389,6 @@ export function labelDefaultNode(input) {
|
|
|
393
389
|
records,
|
|
394
390
|
};
|
|
395
391
|
}
|
|
396
|
-
/** Accepted whole-day grades are the only direct FSRS reviews. Ungraded direct days also
|
|
397
|
-
* suppress implicit credit. Core uses host boundaries, never a clock-zone or UTC-day fallback. */
|
|
398
|
-
function scheduleDefaultNode(records, implicit, lapses, grades, parameters) {
|
|
399
|
-
const direct = [
|
|
400
|
-
...records.flatMap((record) => record.payload.kind === "demonstration" && record.payload.unaided ? [{ ...record, payload: record.payload }] : []),
|
|
401
|
-
...lapses,
|
|
402
|
-
];
|
|
403
|
-
const accepted = activeNodeGrades(grades, direct);
|
|
404
|
-
const directDays = new Set(direct.flatMap(({ learnerDay }) => (learnerDay === undefined ? [] : [learnerDay.id])));
|
|
405
|
-
const credit = implicit.filter(({ learnerDay }) => learnerDay !== undefined && !directDays.has(learnerDay.id));
|
|
406
|
-
const claims = records.filter((record) => record.payload.kind === "claim");
|
|
407
|
-
let card;
|
|
408
|
-
let reviewDay;
|
|
409
|
-
let initializingClaim;
|
|
410
|
-
let lapsed = false;
|
|
411
|
-
const citations = [];
|
|
412
|
-
for (const record of [...claims, ...credit, ...accepted].sort(compareObservations)) {
|
|
413
|
-
const { payload, at, id } = record;
|
|
414
|
-
if (payload.kind === "claim") {
|
|
415
|
-
if (payload.stance !== "knows" || card !== undefined)
|
|
416
|
-
continue;
|
|
417
|
-
card = {
|
|
418
|
-
...SCHEDULER.next(createEmptyCard(at), at, Rating.Good).card,
|
|
419
|
-
stability: parameters.retention.claimStabilityDays,
|
|
420
|
-
reps: 0,
|
|
421
|
-
};
|
|
422
|
-
initializingClaim = at;
|
|
423
|
-
}
|
|
424
|
-
else if (payload.kind === "grade") {
|
|
425
|
-
const earlierSuccess = (initializingClaim !== undefined && Date.parse(initializingClaim) < Date.parse(payload.day.start)) ||
|
|
426
|
-
direct.some(({ at, payload: evidence }) => evidence.kind === "demonstration" &&
|
|
427
|
-
evidence.outcome === "success" &&
|
|
428
|
-
Date.parse(at) < Date.parse(payload.day.start));
|
|
429
|
-
card = SCHEDULER.next(card ?? createEmptyCard(payload.day.end), payload.day.end, Rating[payload.rating]).card;
|
|
430
|
-
lapsed = payload.rating === "Again" && earlierSuccess;
|
|
431
|
-
citations.push(...(record.cites ?? []));
|
|
432
|
-
}
|
|
433
|
-
else {
|
|
434
|
-
const day = record.learnerDay;
|
|
435
|
-
if (day === undefined || day.id === reviewDay)
|
|
436
|
-
continue;
|
|
437
|
-
card = SCHEDULER.next(card ?? createEmptyCard(at), at, Rating.Good).card;
|
|
438
|
-
reviewDay = day.id;
|
|
439
|
-
}
|
|
440
|
-
citations.push(id);
|
|
441
|
-
}
|
|
442
|
-
if (card?.last_review === undefined)
|
|
443
|
-
return undefined;
|
|
444
|
-
return {
|
|
445
|
-
stability: card.stability,
|
|
446
|
-
difficulty: card.difficulty,
|
|
447
|
-
reps: card.reps,
|
|
448
|
-
lapses: card.lapses,
|
|
449
|
-
lastReview: card.last_review.toISOString(),
|
|
450
|
-
lapsed,
|
|
451
|
-
citations: [...new Set(citations)],
|
|
452
|
-
};
|
|
453
|
-
}
|
|
454
392
|
/** Resolved Node and tag metadata share the ordinary Patch precedence. */
|
|
455
393
|
export function defaultNodeCompletion(graph, node, index) {
|
|
456
394
|
const value = lastMetadataContribution(graph, (index === undefined
|
|
@@ -1204,6 +1142,10 @@ export function initDefaultState(graph) {
|
|
|
1204
1142
|
const query = defaultNodeCompletion(graph, id, graphIndex);
|
|
1205
1143
|
return query === undefined ? [] : [[id, { query, evaluate: compileCompletion(query, id) }]];
|
|
1206
1144
|
}));
|
|
1145
|
+
const reviewPlans = new Map(graph.nodes.flatMap(({ id }) => {
|
|
1146
|
+
const schedule = nodeReviewSchedule(graph, id);
|
|
1147
|
+
return schedule.kind === "never" ? [] : [[id, prepareReviewReplay(schedule)]];
|
|
1148
|
+
}));
|
|
1207
1149
|
const own = new Map();
|
|
1208
1150
|
const successes = new Map();
|
|
1209
1151
|
const schedules = new Map();
|
|
@@ -1215,6 +1157,7 @@ export function initDefaultState(graph) {
|
|
|
1215
1157
|
let homeless;
|
|
1216
1158
|
function read(now) {
|
|
1217
1159
|
const prepared = evidence.read(now);
|
|
1160
|
+
const at = Date.parse(now);
|
|
1218
1161
|
const { index, homed } = prepared;
|
|
1219
1162
|
const changedOwn = new Set();
|
|
1220
1163
|
for (const id of prepared.dirtyNodes) {
|
|
@@ -1253,13 +1196,15 @@ export function initDefaultState(graph) {
|
|
|
1253
1196
|
}
|
|
1254
1197
|
const facts = indexed(acquisition.get(id));
|
|
1255
1198
|
const featureUses = index.featureUses.get(id) ?? [];
|
|
1256
|
-
|
|
1199
|
+
const replay = reviewPlans.get(id);
|
|
1200
|
+
if (replay !== undefined && (!initialized || dirtySchedules.has(id))) {
|
|
1257
1201
|
const implicit = (graphIndex.dependents.get(id) ?? []).flatMap((node) => successes.get(node) ?? []);
|
|
1258
1202
|
const records = own.get(id) ?? [];
|
|
1259
|
-
const
|
|
1203
|
+
const direct = [
|
|
1260
1204
|
...records.flatMap((record) => isDemonstration(record.payload) && record.payload.unaided ? [{ ...record, payload: record.payload }] : []),
|
|
1261
1205
|
...(index.lapses.get(id) ?? []),
|
|
1262
|
-
]
|
|
1206
|
+
];
|
|
1207
|
+
const grades = activeNodeGrades(index.grades.get(id) ?? [], direct);
|
|
1263
1208
|
const supportedSuccesses = new Set(records
|
|
1264
1209
|
.filter(({ payload }) => isDemonstration(payload) && payload.unaided && payload.outcome === "success")
|
|
1265
1210
|
.map(({ id }) => id));
|
|
@@ -1268,15 +1213,10 @@ export function initDefaultState(graph) {
|
|
|
1268
1213
|
!grades.some(({ payload }) => Date.parse(payload.day.end) > Date.parse(pass.at))));
|
|
1269
1214
|
// Grade/support changes and late direct evidence replace the affected day's review;
|
|
1270
1215
|
// replay only this Node's chronology rather than retaining a second retention state.
|
|
1271
|
-
schedules.set(id,
|
|
1216
|
+
schedules.set(id, replay({ records, direct, implicit, grades }));
|
|
1272
1217
|
}
|
|
1273
1218
|
const card = schedules.get(id);
|
|
1274
|
-
const schedule = card
|
|
1275
|
-
? undefined
|
|
1276
|
-
: {
|
|
1277
|
-
...card,
|
|
1278
|
-
retrievability: forgetting_curve((Date.parse(now) - Date.parse(card.lastReview)) / DAY_MS, card.stability),
|
|
1279
|
-
};
|
|
1219
|
+
const schedule = card && { ...card, retrievability: retrievabilityAt(card, at) };
|
|
1280
1220
|
nodes[id] = {
|
|
1281
1221
|
...facts,
|
|
1282
1222
|
featureUses,
|
package/dist/tags.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export declare function defaultNodeState(state: DefaultState, node: NodeId): Nod
|
|
|
6
6
|
export declare function isDefaultKnown(node: NodeState): boolean;
|
|
7
7
|
/** Acquisition withdrawal does not discard a completion-bound Node’s recall schedule. */
|
|
8
8
|
export declare function isDefaultReviewable(node: NodeState): boolean;
|
|
9
|
+
export declare function isDefaultReviewDue(node: NodeState): boolean;
|
|
9
10
|
/** A shared reachability answer travels in, so a projection walks the graph for it once. */
|
|
10
11
|
type QueryToken = (state: DefaultState, graph: ResolvedGraph, reached?: ReadonlySet<NodeId>) => ReadonlySet<NodeId>;
|
|
11
12
|
export declare const defaultQueryTokens: {
|
package/dist/tags.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { dependentCones } from "./dependent-cone.js";
|
|
2
|
-
import { nodePriority, teachingPath, pathProperty
|
|
2
|
+
import { nodePriority, teachingPath, pathProperty } from "./path.js";
|
|
3
3
|
import { NODE_ELABORATE_PROPERTY } from "@mmon-co/ncept-core/patch";
|
|
4
4
|
import { completionCaption } from "./completion.js";
|
|
5
5
|
import { defaultProjectionBasis, DEFAULT_PARAMETERS, } from "./state.js";
|
|
@@ -16,8 +16,11 @@ export function isDefaultKnown(node) {
|
|
|
16
16
|
export function isDefaultReviewable(node) {
|
|
17
17
|
return isDefaultKnown(node) || (node.completion.query !== undefined && node.schedule !== undefined);
|
|
18
18
|
}
|
|
19
|
+
export function isDefaultReviewDue(node) {
|
|
20
|
+
return node.schedule?.lapsed === true || (node.schedule?.retrievability ?? 1) < DEFAULT_PARAMETERS.retention.due;
|
|
21
|
+
}
|
|
19
22
|
function select(predicate) {
|
|
20
|
-
return (state, graph) => new Set(graph.nodes.filter(({ id }) => predicate(defaultNodeState(state, id)
|
|
23
|
+
return (state, graph) => new Set(graph.nodes.filter(({ id }) => predicate(defaultNodeState(state, id))).map(({ id }) => id));
|
|
21
24
|
}
|
|
22
25
|
function reachableNodes(state, graph) {
|
|
23
26
|
return new Set(graph.nodes
|
|
@@ -39,12 +42,8 @@ export const defaultQueryTokens = {
|
|
|
39
42
|
}),
|
|
40
43
|
reachable: (state, graph, reached = reachableNodes(state, graph)) => reached,
|
|
41
44
|
frontier: (state, graph, reached = reachableNodes(state, graph)) => new Set([...reached].filter((id) => !isDefaultKnown(defaultNodeState(state, id)))),
|
|
42
|
-
"review:due": select((node
|
|
43
|
-
|
|
44
|
-
isDefaultReviewable(node) &&
|
|
45
|
-
(node.schedule?.lapsed === true || (node.schedule?.retrievability ?? 1) < DEFAULT_PARAMETERS.retention.due)),
|
|
46
|
-
"review:fading": select((node, graph, id) => nodeAllowsReview(graph, id) &&
|
|
47
|
-
!node.reviewCleared &&
|
|
45
|
+
"review:due": select((node) => !node.reviewCleared && isDefaultReviewable(node) && isDefaultReviewDue(node)),
|
|
46
|
+
"review:fading": select((node) => !node.reviewCleared &&
|
|
48
47
|
isDefaultReviewable(node) &&
|
|
49
48
|
(node.schedule?.lapsed === true || (node.schedule?.retrievability ?? 1) < DEFAULT_PARAMETERS.retention.fading)),
|
|
50
49
|
};
|