learnermodel

package module
v0.1.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 9 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

learner-model

CI CodeQL Go version Coverage OpenSSF Scorecard License

Code Smells Reliability Rating Security Rating Maintainability Rating Vulnerabilities

The NovaTrail learner model: how well a learner has mastered each skill, estimated from the evidence of attempts — the outcome of each attempt, weighed by that outcome and by the provenance of the task's key. It is a Go library of pure computation with no input or output of its own: api hands it the skill graph and the evidence, the time comes from outside and it takes no seed, needing no randomness, and the engine reads its estimates to pick the next lesson or task. Its starting point is the learner model of MathTrail's standalone — a Rasch model with a guessing floor, updated Elo-style, with a trial series and a cautious "mastered" — with the level kept for each module rather than for the whole learner model (R03), with forgetting added as each skill's retention, whose stability grows with spaced practice (R04), and with evidence weighed by its outcome, the provenance of its key and the series it belongs to: each item's first verdict counts, a hint only withholds "mastered", and a page of many items counts for less than their sum (R06). Whether a learner has an anchor skill of the shared taxonomy, which links one module to another, it reads from the mastered skills that teach it (R07). The log of evidence is the source of truth and the state a cache of it: each evidence record carries every observation that recompute reads, appending a record gives the recomputed state bit for bit on any build, and a retired skill's evidence counts in full for each skill that replaced it (R08). Its code imports nothing but Go's standard library and gives the same bits on every build, WebAssembly included, so that it could also run on the device (R09), and it encodes evidence and state in protobuf's binary form by a schema of its own (R10).

A component of NovaTrail, a universal open platform for adaptive learning, interactive lessons and AI tutoring. It belongs to stage 1, Format and core, with spec, modules, module-kit, engine and sim; it comes together with engine and sim, since the learner simulator needs both the model and the rule of choice, and no change to the model after its first version goes in without passing it.

Status

Detailing is done: the first epic of RUN.md decided what the component's card left open, and section 3 of docs/architecture.md is what to build. One question came later with О-25 — how much an answer typed in place of handwriting weighs — and spec answered it: as much as handwriting (section 2.7). Another came with format 0.4, which spec released with v0.10.0: how much the task's leading question weighs, which the learner gets on asking for help before a wrong answer — and the author decided it: as help, like a technique on request, in a field of the evidence of its own, from format 0.4 on (section 2.8; R21). That field, leading_question_on_request, and the check kind time came into the code through the simulator's gate, with kind 2 of the evidence, which records the field, while kind 1 does not (R28). The code comes in epic E2 of RUN.md, and the model is written and released as v0.1.0: the Go module; its types — the graph, the task, the evidence, the state and what reading gives — with the schema of the evidence and the state in proto/ and the codec of their bytes; its package detmath — exp, log, the logistic function, a power and the retention of a skill, the same bits on every build, which the engine may take too; the level of each module and the mastery of each skill — BandByGrade, Append and Recompute, the step of one piece of evidence and the trial series, held to standalone's test vectors (R03), and forgetting: the retention of each skill in the chance of an answer and in the step, its stability, the review date of a mastered skill, and, after a pause of the module of 14 days, the forgetting of its level, which brings the weight of its answers back to 20 so that the level moves faster (R04); and the evidence read whole: the outcome, help, which masters nothing, the provenance of the key and the skill tags, and the traps the program found (R06); and the transfer of a retired skill's evidence, in full, to each skill that replaced it, by the graph of the module's current version (R08); and reading — Read and Readout.Task: at the time of reading, the estimates, retention and review dates of the skills, the starting point of a module without evidence, the two flags of the trial series, the chance of each item of a candidate task, and whether the learner has each anchor skill, with its reason and the skills that teach it (R07); and its checks — just ci-lint, ci-test, ci-proto, ci-release, ci-vuln and ci-licenses, which CI runs too (R13). CI holds the code to the same bits on every build from the start, by the jobs of .github's shared Go workflow with its input same-bits: the rules of code, by .github's tool and this repository's lists in .github/coderules.json, the tests on amd64 with and without fusion, on 386, in js/wasm and on arm64, and a comparison of the assembler with fusion and without it (R09, R18). Its first version, v0.1.0, checked by its own tests and standalone's test vectors, came out signed before the simulator's first tag (R16), and every change after it passes the simulator against a criterion written down before the first candidate (R12): CI's job Gate builds the simulator at its tag, v0.1.13 — the packages of modules v0.2.5 in format 0.4, both maths with checks of time and leading questions, learner-model at the commit of the candidate theta and engine v0.1.6, and 250 learners a cell, with the bands recorded on theta — on the code of each pull request and each commit of main — the release waits for it — and holds its numbers to the bands of the simulator's gate file, red when one leaves them, for the better or the worse (R20). The first candidates — new numbers for what the first version still guesses, chosen by rough runs of the simulator — went to the simulator's judgement in epic E3 of RUN.md: all three scored better than the base, none held every "no worse" check, and the base stays (R22, R24). Epic E4 of RUN.md brought format 0.4 into the model: the check kind time and the leading question in one release through the gate, which the simulator reads from its v0.1.9 on, with the packages of modules v0.2.5 that ship them (R25), and then Readout.Task faster, with the same chance of each item to the bit and the same API: a call copies nothing but the slice it gives, and Read works out the retention of each skill at the time of reading once, so that the engine's choice on a pool of 772 tasks takes some 1.5 to 1.8 times less (R29). Epic E5, the current one, is the second round of candidates: first why the model with the first round's numbers of forgetting catches up after a break more slowly, then scouting at the size of the decisive run, draft candidates and the simulator's judgement (R30): the judgement model-2 chose theta, the forgetting of a module's level after a pause, the held-out learners confirmed it, and the merge of its pull request releases it as v0.1.8 (R04, R32).

Releases

Releases come out by themselves: each commit of main whose CI has passed and which changes the code, the schema or what builds the release's file gets the next patch of the line 0.1 — the first, v0.1.0, came out on 2026-11-07 — with its tag, by .github's shared release workflow (R16). Nobody tags by hand, and a release is immutable.

  • Go code takes the library as a Go module, by the tag: go get github.com/altnovatrail/learner-model@v0.1.0. go.sum and the Go checksum database hold the version from then on.
  • The release's one file is the schema of the evidence and the state, for what reads them without Go: learner-model-proto-<tag>.tar.gz, with LICENSE, buf.yaml and the .proto files of proto/, signed without a key. Its .proto files are the ones api puts into a learner's export, under api/proto/novatrail/learnermodel/v1/, beside the JSON of the evidence log and the state they describe, so their comments say what each field is without the code (R135 spec). Verify it where it enters NovaTrail with spec's recipe, just -f spec/justfile release-verify learner-model <tag> learner-model-proto-<tag>.tar.gz, with its bundle <file>.sigstore.json beside it. just release-files <tag>, in the toolchain stage of the tag's .devcontainer/Dockerfile, builds the same bytes from the tag's tree.

Documents

The documents are in Russian.

  • docs/architecture.md — the component: what it does and does not do, its data and links, what was deliberately deferred, and what to build.
  • docs/decisions.md — the decision log: what was decided, why, and what was rejected.
  • RUN.md — the work plan, in epics.

The working rules, for people and coding agents alike, are in CLAUDE.md and AGENTS.md. The platform's shared vocabulary, formats, contracts and decisions are in spec, checked out here as a git submodule at v0.15.0: clone this repository with git clone --recurse-submodules.

License

Apache-2.0.

Documentation

Overview

Package learnermodel is NovaTrail's learner model: it estimates how well a learner has mastered each skill of a module from the evidence of finished attempts, and computes each skill's state.

It is a library with no input or output of its own. The api service hands it the evidence and the module's skill graph, keeps the evidence log and the state the library computes from it, and passes the time in as a number; the engine reads that state to pick what comes next. The library picks no lesson or task, gives no verdict, calls no AI model and reads no module package or database.

The state is a fold of the evidence log, so appending a record gives, bit for bit, the state recomputed from the whole log, on any build of one version of this module, WebAssembly included. The code imports nothing but Go's standard library, and only the packages its rules allow.

What the library computes and why is in docs/architecture.md, section 3, and in docs/decisions.md of this repository.

Index

Constants

View Source
const EvidenceKind = 2

EvidenceKind is the kind of evidence this version writes. It reads every kind up to it, and a later one too, skipping what it does not know (docs/architecture.md, section 3.5). Kind 2 adds LeadingQuestionOnRequest, which kind 1 does not record.

View Source
const StateKind = 1

StateKind is the kind of state this version writes.

Variables

View Source
var (
	// ErrInvalid is an input that breaks a rule the library relies on: a duplicate ID, a place
	// outside the bands, a skill the graph does not know.
	ErrInvalid = errors.New("learnermodel: invalid input")
	// ErrCorrupt is bytes that are no encoding of evidence or a state.
	ErrCorrupt = errors.New("learnermodel: corrupt bytes")
	// ErrNotFinite is a NaN or an infinity, which the encoding refuses both ways.
	ErrNotFinite = errors.New("learnermodel: a number that is not finite")
)

The kinds of error the library returns, as values and never by panicking (docs/architecture.md, section 3.7). errors.Is tells them apart; the message says where.

Functions

func Append

func Append(s State, e Evidence, g Graphs) (State, Evidence, error)

Append appends a piece of evidence to a state — the cache api keeps — against the graphs of the current versions of the modules, and gives the new state and the evidence with the start band the step took: the module's, when it has a state, and the evidence's own otherwise. api writes both in one transaction. The zero State is the empty one; the state Append gives is of StateKind and shares no memory with s, while the evidence it gives shares e's lists.

The step reads only the graph of the evidence's module, and gives the evidence of a skill that graph retired to each skill that replaced it, in full (docs/architecture.md, section 3.5). A module whose entry says it has no current version moves nothing: its evidence waits in the log. Evidence with no answer moves nothing either, and gives a module no state; nor does evidence whose key or skill tags came from AI, or whose provenance is not given or one this version does not know (docs/architecture.md, section 3.3).

It refuses, with ErrInvalid:

  • a state of a kind outside 1 to StateKind, unless it is the zero State, one not in its canonical order, one with a skill of a stability below τ₀, and one EncodeState would refuse;
  • evidence of a kind below 1, evidence EncodeEvidence would refuse but for a later kind, and evidence whose task ID names no module, whose task is not of a difficulty from 1 to 5, or whose task band or start band is at a place below 1;
  • a choice without its number of options or with fewer than two, an item with reasons of submissions that was never submitted, and an item with an answer, in evidence that weighs, and no slot;
  • a module with no entry in g, and a graph whose module is not its entry's, whose lists — its skills, the bands each is taught at, its retired skills and the replacements of each — are not in the order NewGraph gives, or with a retired skill that is still a skill or a replacement that is not one.

func EncodeEvidence

func EncodeEvidence(e Evidence) ([]byte, error)

EncodeEvidence gives the bytes of e. It refuses, with ErrInvalid: a kind outside 1 to EvidenceKind; a string that is no UTF-8; a duplicate place, skill or trap; items of the task and answers whose places do not match one for one; a value set without its flag of presence — a rung without HasRung, say; and a leading question on request in evidence of kind 1, which does not record it.

func EncodeState

func EncodeState(s State) ([]byte, error)

EncodeState gives the bytes of s. It refuses, with ErrNotFinite, a NaN or an infinity, and, with ErrInvalid, a kind outside 1 to StateKind, a string that is no UTF-8, a duplicate module, skill or trap, and a mastery band without Mastered.

Types

type AnchorReadout

type AnchorReadout struct {
	Anchor   string
	Status   AnchorStatus
	Reason   AnchorReason
	Teachers []TeacherReadout // ordered by skill ID byte by byte
}

AnchorReadout is the status of an anchor skill, with its reason and the skills that teach it.

type AnchorReason

type AnchorReason int32

AnchorReason is why an anchor skill has its status: for AnchorHasNot, not mastered or no evidence; for AnchorUnknown, no one teaches it or only skills that may not be mastered do — without a verdict, or with no band they are taught at, as in a module with no tasks —, which AnchorReasonNoVerdictTeacher names.

const (
	AnchorReasonNone AnchorReason = iota
	AnchorReasonNotMastered
	AnchorReasonNoEvidence
	AnchorReasonNoTeacher
	AnchorReasonNoVerdictTeacher
)

type AnchorStatus

type AnchorStatus int32

AnchorStatus is whether a learner has an anchor skill (docs/architecture.md, section 3.4).

const (
	AnchorUnspecified AnchorStatus = iota
	AnchorHas
	AnchorHasNot
	AnchorUnknown
)

type Assessability

type Assessability int32

Assessability is how the platform can know a learner's command of a skill. Only a skill with AssessabilityVerdict has a state.

const (
	AssessabilityUnspecified Assessability = iota
	AssessabilityVerdict
	AssessabilityRubric
	AssessabilityNone
)

type Band

type Band struct {
	Place  int32
	ID     string
	Grades []int32 // the grades the band names, ascending; empty in a module without grades
}

Band is a band of a module's difficulty scale, in the order of the manifest's `bands`.

type BandRef

type BandRef struct {
	Place int32
	ID    string
}

BandRef names a band of a module's difficulty scale by its place in the `bands` of the module version, from 1, and by its ID in the manifest. The model reads the place; the ID is kept.

func BandByGrade

func BandByGrade(grade Grade, bands []Band) (BandRef, error)

BandByGrade gives the start band of a module for a learner's grade, from the bands of the version the attempt ran on, in their order (docs/architecture.md, sections 3.1 and 3.5): the band whose grades name the grade; for a grade no band names, the band nearest by the distance to its nearest grade, and the lower of two as near; without a grade, or in a module without grades, the first band. api puts it in the evidence it builds, and Append keeps it only for a module with no state yet.

It refuses, with ErrInvalid, no bands, bands out of their places 1, 2, … and a band ID twice, as NewGraph does.

type CheckKind

type CheckKind int32

CheckKind is how the answer in a slot is checked: the kinds that give a verdict. A value this version does not know is kept as its number, and its item reads as one with no answer.

const (
	CheckKindUnspecified CheckKind = iota
	CheckKindNumber
	CheckKindFraction
	CheckKindChoice
	CheckKindPredicate
	CheckKindTime
)

type Evidence

type Evidence struct {
	Kind      int32
	Task      Task
	StartBand BandRef
	Outcome   Outcome
	// PracticeTime is the time of the attempt's last action, in whole seconds of Unix time, UTC.
	PracticeTime       int64
	TechniqueOnStep    bool
	TechniqueOnRequest bool
	// LeadingQuestionOnRequest is whether a hint the learner asked for gave the task's leading
	// question, which a hint gives only before the first wrong answer. Kind 1 does not record it, and
	// it is false there.
	LeadingQuestionOnRequest bool
	ExplainAgainCount        int32
	SolutionSeenBefore       bool
	HasSolutionSeenFact      bool // false for a template, whose instances differ
	// Items holds what happened to each item; the slots and the item's own skills are in Task.
	Items []ItemAnswer
	Traps []FoundTrap // ordered by ID byte by byte
}

Evidence is the evidence of one finished attempt (docs/architecture.md, section 3.5): its observations, not the model's conclusions.

func DecodeEvidence

func DecodeEvidence(b []byte) (Evidence, error)

DecodeEvidence reads evidence from b, of any kind from 1: a later kind too.

type FoundTrap

type FoundTrap struct {
	ID         string
	Skills     []string // its skills in the trap catalog of the attempt's version, by full ID
	ItemPlaces []int32  // where it was found, ascending
}

FoundTrap is a trap the program found in the attempt by a wrong value.

type Grade

type Grade struct {
	Value int32
	Known bool
}

Grade is a learner's school grade, or no grade: Known is false for a learner without one, and Value is then 0. "No grade" is a case of its own, not grade 0.

type Graph

type Graph struct {
	Module  string
	Bands   []Band         // by place, from 1
	Skills  []Skill        // ordered by ID byte by byte
	Retired []RetiredSkill // ordered by ID byte by byte
}

Graph is the graph of one version of a module, as the model and the engine read it.

func NewGraph

func NewGraph(module string, bands []Band, skills []Skill, retired []RetiredSkill, tasks []Task) (Graph, error)

NewGraph builds the graph of a module version from its bands, its skills, its retired skills and the descriptions of its tasks, so that api and sim build one graph of one module alike (R10). It derives each skill's BandsTaught — the BandsTaught given is ignored — and orders every list canonically. It copies what it is given: the graph shares nothing with its input.

A skill is taught at the band of a task where it is a primary skill of an item: of the item's own skills, or of the task's for an item without its own, or for a task without items.

It refuses, with ErrInvalid: bands out of their places 1, 2, …; a duplicate band, skill or retired ID, and an ID or grade twice in one list; a retired ID that is a skill; a replacement or a primary skill of a task or an item the module does not have; a task band outside the bands or whose ID is not the ID of the band at its place; and a difficulty outside 1 to 5.

type Graphs

type Graphs map[string]ModuleGraph

Graphs gives each module the graph of its current version, by the module's full ID. The model looks modules up in it and never ranges over it, so its order cannot matter.

type ItemAnswer

type ItemAnswer struct {
	Place     int32
	Submitted bool
	// Unverdicted is why each submission before the first verdict gave none, in their order.
	Unverdicted []UnverdictedReason
	// FirstVerdict is the item's first verdict, when HasFirstVerdict, and WrongBeforeFirst the
	// number of wrong answers in the attempt before the submission that gave it.
	FirstVerdict     Verdict
	HasFirstVerdict  bool
	WrongBeforeFirst int32
	// FinalVerdict is the item's verdict at the end, when HasFinalVerdict.
	FinalVerdict    Verdict
	HasFinalVerdict bool
	// WrongBeforeFirstCorrect is the number of wrong answers in the attempt before the item's
	// first correct verdict, when HasFirstCorrect.
	WrongBeforeFirstCorrect int32
	HasFirstCorrect         bool
}

ItemAnswer is what happened to one item in the attempt, by its place.

type ItemProbability

type ItemProbability struct {
	Place       int32
	Probability float64
	HasVerdict  bool
}

ItemProbability is the probability of a right answer to an item of a candidate task at t₀: Probability, when HasVerdict; an item without a verdict has none.

type ModuleGraph

type ModuleGraph struct {
	Graph   Graph
	Current bool
}

ModuleGraph is the entry of a module in Graphs: the graph of its current version, or no current version, when Current is false and Graph is empty (docs/architecture.md, section 3.5).

type ModuleReadout

type ModuleReadout struct {
	Module string
	// HasEvidence is false for a module of the engine with no evidence yet, whose StartBand is
	// then the starting point by the learner's grade, or the zero BandRef when the module's
	// current version has no bands.
	HasEvidence bool
	StartBand   BandRef
	// TrialOver tells whether the module's trial series is over, and LastInTrial whether the last
	// evidence that moved the module was still in it, the evidence that ended it too (R104 of
	// spec). Both are false before the module's first evidence.
	TrialOver   bool
	LastInTrial bool
	// Traps are the traps the program found that have no skill with a state, counted at the module
	// (docs/architecture.md, section 3.3).
	Traps  []TrapCount
	Skills []SkillReadout // ordered by skill ID byte by byte
}

ModuleReadout is what reading gives of a module.

type ModuleState

type ModuleState struct {
	Module       string
	Level        float64 // θ
	AnswerWeight float64 // n
	StartBand    BandRef
	Trial        []TrialAnswer // in the order of the log, while the trial series lasts
	Traps        []TrapCount   // the traps with no skill that has a state
	Skills       []SkillState  // ordered by skill ID byte by byte
	// LastInTrial tells whether the last piece of evidence that moved the module was still in the
	// trial series, the one that ended it too: that one clears the series' answers, and the engine
	// still needs to know (R104 of spec). Evidence that moves nothing leaves it as it is.
	LastInTrial bool
}

ModuleState is the state of a learner in one module.

type Outcome

type Outcome struct {
	Kind    OutcomeKind
	Rung    int32
	HasRung bool
}

Outcome is the outcome of an attempt, with the rung of the hint after which it ended, when HasRung: from 1, for OutcomeAfterHint.

type OutcomeKind

type OutcomeKind int32

OutcomeKind is how an attempt ended (concepts 11 of spec). A value this version does not know is kept as its number and weighs nothing.

const (
	OutcomeUnspecified OutcomeKind = iota
	OutcomeFirstSubmission
	OutcomeAfterHint
	OutcomeWithSketch
	OutcomeSolutionShown
	OutcomeLeftUnfinished
	OutcomeUnchecked
)

type Provenance

type Provenance int32

Provenance is where a key or the skill tags of a task came from (concepts 9.4 of spec).

const (
	ProvenanceUnspecified Provenance = iota
	ProvenanceAuthor
	ProvenanceSolver
	ProvenanceAdult
	ProvenanceAI
)

type Readout

type Readout struct {
	Modules []ModuleReadout // ordered by module ID byte by byte
	Anchors []AnchorReadout // ordered by anchor ID byte by byte
	// contains filtered or unexported fields
}

Readout is what reading the state at t₀ gives. It keeps what Task needs: a copy of the state, the graphs, t₀ and the grade.

func Read

func Read(s State, g Graphs, at int64, grade Grade, engineModules []string) (Readout, error)

Read reads a state — the cache api keeps — at the time at, in whole seconds of Unix time, UTC, for a learner of a grade, against the graphs of the current versions of the modules and the modules of the engine: those connected and fit for the learner, whose graphs the engine gets. g gives an entry to every module of the state and of the engine; the Readout keeps g for Task, and the caller changes neither while it reads.

Modules are the modules of the state and of the engine. A module with a state gives its start band, the two flags of the trial series and its skills; a module of the engine with no state and a current version gives the starting point by the grade, BandByGrade, or none when that version has no bands, as a module with no tasks may have none; one with neither is left out. Anchors are the anchor skills a graph of a module of the engine names as a prerequisite or a skill it teaches, each with its status (docs/architecture.md, section 3.4): held, when a skill that teaches it is mastered in any of the modules with a current version; otherwise not held, when a skill of the engine's modules that may be mastered teaches it — a skill with a verdict and a band it is taught at —, not mastered when one of them has answers, no evidence otherwise; and unknown otherwise: no one teaches it, or only skills that may not be mastered do. A module with no current version gives no graph, so its mastery is not seen.

It refuses, with ErrInvalid, a state Append would refuse, a module of the engine twice or not named by the full ID of a module, a module with no entry in g, a graph Append would refuse, and bands, other than none, that BandByGrade would refuse.

func (Readout) Task

func (r Readout) Task(t Task) (TaskReadout, error)

Task gives the probability of a right answer to each item of a candidate task at the time of reading, by place: the P the step would take of evidence at that time (docs/architecture.md, sections 3.1 and 3.2), by the same function — with the retention of the item's skills at t₀, and without it, R̄ = 1, while the module's trial series lasts. A module with no state starts at the starting point by the grade. An item with no slot, or with one of a kind of check this version does not know, has no verdict and so no P. The provenance of the task's key and skill tags does not change P: evidence that weighs nothing by it moves nothing, but the chance of a right answer is the same.

It refuses, with ErrInvalid, a task the codec would refuse, one whose ID names no module, one not of a difficulty from 1 to 5 or at a band place below 1, a choice without its number of options or with fewer than two, a module with no entry in the graphs or with no current version, a graph Append would refuse, bands BandByGrade would, and a module with no state whose current version has no bands: a task of it would have none to be in.

It copies nothing it need not: tags and items already in their order are read as they are, and R at t₀ and the start of a module Read has read come from Read (docs/architecture.md, section 3.7; R29).

type RetiredSkill

type RetiredSkill struct {
	ID         string
	ReplacedBy []string
}

RetiredSkill is an entry of `retired_skills`: a skill of an earlier version of the module and the skills of this one that replaced it. An empty ReplacedBy is `[]`: no skill took over.

type ReviewDate

type ReviewDate struct {
	At      int64
	Already bool
}

ReviewDate is when a mastered skill is due for review: At, in whole seconds of Unix time, UTC, or Already, when it is due whatever the time.

type Skill

type Skill struct {
	ID            string
	Assessability Assessability
	Teaches       []string // the anchor skills it teaches, `core.<name>`, ordered byte by byte
	// BandsTaught is the places of the bands where the skill is taught: the bands of the tasks
	// where it is a primary skill of the task or of an item, ascending. NewGraph derives it.
	BandsTaught   []int32
	Prerequisites []string // skills of the module by full ID and anchor skills; the engine reads them
	Tier          int32    // the skill's tier, `skill_tiers` of the server part; the engine reads it
}

Skill is a skill of a module's graph, by its full ID.

type SkillReadout

type SkillReadout struct {
	Skill         string
	EvidenceCount int64
	LastPractice  int64
	Estimate      float64 // θ + δ
	Uncertainty   float64 // v
	Retention     float64 // R at t₀
	Traps         []TrapCount
	// For a mastered skill: its mastery band — the ID from the graph of the module's current
	// version, empty without one —, the cautious probability with retention at t₀, R · q, and
	// the review date. Zero while the skill is not mastered.
	Mastered            bool
	MasteryBand         BandRef
	CautiousProbability float64
	Review              ReviewDate
}

SkillReadout is what reading gives of a skill with practice.

type SkillState

type SkillState struct {
	Skill         string
	Correction    float64 // δ
	AnswerWeight  float64 // m
	EvidenceCount int64
	LastPractice  int64   // whole seconds of Unix time, UTC
	Stability     float64 // τ, in days
	Traps         []TrapCount
	// MasteryBand is the place of the mastery band, when Mastered.
	MasteryBand    int32
	Mastered       bool
	FailuresInARow int32
}

SkillState is the state of one skill of the module whose assessability is verdict (docs/architecture.md, sections 3.1–3.3).

type Slot

type Slot struct {
	Check CheckKind
	// Options is the number of options of a choice, and is meaningful only when HasOptions.
	Options    int32
	HasOptions bool
}

Slot is an answer slot of an item, as the model needs it for the guessing of the item.

type State

type State struct {
	Kind    int32
	Modules []ModuleState // ordered by module ID byte by byte
}

State is the state of one learner: the fold of the evidence log.

func DecodeState

func DecodeState(b []byte) (State, error)

DecodeState reads a state from b.

func Recompute

func Recompute(log []Evidence, g Graphs) (State, error)

Recompute folds the evidence log, in the order of its numbers, from the empty state, against the graphs of the current versions of the modules: Append of each piece of evidence in turn. Its errors are Append's, with the index of the evidence in log, from 0. It checks the graph of each module once.

type Task

type Task struct {
	ID         string // the full ID of the task; of a template, of the template
	Template   bool
	Band       BandRef
	Difficulty int32 // from 1 to 5
	Primary    []string
	Supporting []string // full IDs or anchor skills, `core.<name>`
	// KeyProvenance and SkillTagsProvenance are where the key and the skill tags came from.
	KeyProvenance       Provenance
	SkillTagsProvenance Provenance
	Items               []TaskItem // by place
}

Task describes a task, the same for evidence and for a candidate task of the engine.

type TaskItem

type TaskItem struct {
	Place int32
	// OwnSkills tells whether the item names skills of its own, Primary and Supporting, which take
	// the place of the task's for it.
	OwnSkills  bool
	Primary    []string
	Supporting []string
	Slots      []Slot // in their order
}

TaskItem is an item of a task, by its place, from 1.

type TaskReadout

type TaskReadout struct {
	Items []ItemProbability
}

TaskReadout is what Readout.Task gives of a candidate task: the P of each item, by place.

type TeacherReadout

type TeacherReadout struct {
	Skill       string
	HighestBand BandRef
	Practised   bool
	Estimate    float64
	Mastered    bool
	MasteryBand BandRef
	Retention   float64
	Review      ReviewDate
}

TeacherReadout is a skill that teaches an anchor skill, as reading gives it with the anchor: the highest band it is taught at — Place 0 when there is none —, and, when Practised, its estimate, mastery, retention at t₀ and review date, as its SkillReadout has them.

type TrapCount

type TrapCount struct {
	ID    string
	Count int64
	Last  int64
}

TrapCount is a trap the program found, with the number of pieces of evidence it was found in and the practice time of the latest.

type TrialAnswer

type TrialAnswer struct {
	BandPlace  int32
	Difficulty int32
	Slots      []Slot
	Verdict    Verdict
	Weight     float64 // u, the answer's weight in its series
}

TrialAnswer is one answer of the trial series, as its likelihood needs it.

type UnverdictedReason

type UnverdictedReason int32

UnverdictedReason is why a submission gave no verdict (concepts 9.1 of spec).

const (
	UnverdictedUnspecified UnverdictedReason = iota
	UnverdictedUnreadableBlank
	UnverdictedUnreadableOther
	UnverdictedUnchecked
)

type Verdict

type Verdict int32

Verdict is an item's verdict: right or not yet. A value this version does not know is kept as its number, and its item reads as one with no answer.

const (
	VerdictUnspecified Verdict = iota
	VerdictCorrect
	VerdictNotYet
)

Directories

Path Synopsis
Package detmath is the arithmetic of the learner model that package math would give differently on different builds: exp, log, the logistic function σ, a power and the retention of a skill.
Package detmath is the arithmetic of the learner model that package math would give differently on different builds: exp, log, the logistic function σ, a power and the retention of a skill.
internal
wire
Package wire writes and reads the binary form of protobuf, the part of it the schema of learner-model uses, on Go's standard library alone (R10 in docs/decisions.md; docs/architecture.md, section 3.7): varints, 64-bit fixed numbers in little-endian, and length-delimited strings, messages and packed lists.
Package wire writes and reads the binary form of protobuf, the part of it the schema of learner-model uses, on Go's standard library alone (R10 in docs/decisions.md; docs/architecture.md, section 3.7): varints, 64-bit fixed numbers in little-endian, and length-delimited strings, messages and packed lists.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL