tutor

package module
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: Apache-2.0 Imports: 0 Imported by: 0 modules, 0 packages

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

tutor

CI Release CodeQL Latest release Go version Coverage OpenSSF Best Practices OpenSSF Scorecard License

Code Smells Reliability Rating Security Rating Maintainability Rating Vulnerabilities

The AI side of the NovaTrail tutor: it reads the learner's work, handwriting or text, into an observation, reviews the working for the first mistake, assesses an essay against the module author's rubric, and words the hint for the rung of the hint ladder that the platform's program chose. It holds the platform's prompts, one per AI capability and each with its own eval set, the adapters to AI providers, the exact models admitted for each capability, and the one function that admits an AI route for the learner's age category before every request; it reports each call's usage, by which api counts the platform AI quotas, and its eval runner is a CLI on the same code. It is a library inside api: it decides no verdict, picks no lesson or task and stores nothing, and its requests carry no identifier of the learner or the account: on the own-key route only the key itself goes along, to its own provider, which ties each call to the key owner's account.

A component of NovaTrail, a universal open platform for adaptive learning, interactive lessons and AI tutoring. It belongs to stage 2, First slice with learners, with canvas, api, app, skill-map and infra; together with canvas it brings the stage's first code, which for tutor is the check board below.

Status

The MVP is the check board: you solve eleven fixed maths tasks by hand in the browser and press Check at any step, before you finish too. Five are solved in lines; the other six, tasks 6 to 11, in free form: on a number line, with a drawing, or with the working at the side. The Claude models you tick read the work, each at the effort you choose, and Claude Haiku 5.5 and Sonnet 5.5 without thinking if you like. Each gives only a verdict: correct, no mistakes so far, an error, which the model marks on the board in its own colour, or cannot read. You mark whether each was right. Each answer shows its time, when its first token came, its price and its tokens, thinking included; the summary shows, for each model at each effort, how often it was right and what an answer costs and takes. On 2026-10-23 Claude Opus 5.5 at high effort judged all five tasks the board then had right, at about a cent and five seconds a check (R20 in docs/decisions.md); GPT-6 Astra, which the board can also ask, is not used. The reading measurement of epic E2 asked one question: does the writing process, stroke order and erasures, help Claude judge a finished sheet? On 40 sheets, 39 of them drawn by code with the solution in lines from the top down, it did not show any help: Claude Opus 5.5 judged every sheet right from the picture alone (R27). Epic E4 (R28) came next and was done on 2026-10-29: solutions in free form, with a number line, a drawing or notes at the side, then reading the work into an observation with and without the key, hints, workbook cells and essays. It started with a pilot on this board, and spec recorded its conclusions in v0.3.2 (R49 in docs/decisions.md). Its extended measurement followed in the same epic (R50): more Claude configurations, hundreds of sheets, pages and essays that code draws, and ten sheets the author wrote messily; spec recorded what it showed in v0.3.3 (R51). The epic ended with the workbook reading under that tag's rule for a digit written mirrored: such a digit is not read as a digit, the box counts as ambiguous, and the learner writes it again. Start the board in a terminal of the devcontainer:

just board

It asks for the Anthropic and OpenAI keys for eval without showing them, so no key lands in the shell's history; Enter skips a model. When the terminal says the board is at http://127.0.0.1:8080, open that address, or the one the Ports tab of VS Code shows if it forwarded the port under another number. Until then the page only keeps loading: VS Code forwards the port, but nothing answers on it yet.

The measurement's sheets are written in the board's record mode, which asks no model and so needs no key:

just record

Pick a sheet of the plan, write what it shows with a pen or a mouse, press Done, check the markup the plan filled in and press Save. If the board grouped the strokes into lines wrongly, pick strokes on the sheet and move them to another line, or join two lines. The board checks the markup after every change, and its words show beside the fields. On a sheet with a planned erasure, the board takes the move of the eraser on the plan's line for it, and you check that too. The sheet is saved with every stroke's points, their time and pressure, and every erasure, as a sample in samples/sheets, outside git.

The three free-form sheets of epic E4 that you write yourself are made of parts: a number line, a drawing, notes at the side. just free-record starts the same mode on them and saves them in samples/free. After Done the board frames each group of strokes as a part, in the order you wrote them. A drawing you drew on after a pause comes in two frames, so join them; to move strokes to another part, drag a rectangle around them to pick them.

The sheets you do not write, code draws: go run ./cmd/tutor-eval draw draws every sheet of the plan that has no file yet, saves it beside yours with the writer synthetic, and leaves yours as they are. With -png DIR it also saves, in DIR, the final picture of each sheet it draws and its frame before each erasure. For epic E4, code draws into synthetic/, out of git too. No handwriting is in it, so coding agents work with it and run the measurements on it themselves, and the board never writes there: your handwriting stays in samples/.

Once the sheets are written and split into a development and a test part (tutor-eval sheets, then tutor-eval split once), the measurement runs on a part:

just measure -part dev

The measurement of free writing of epic E4 runs the same way on the 40 sheets code draws, just free -part dev, in the judge's prompt for free writing; -part all runs every sheet of a plan without the split, as for your three sheets. Either run first says how many calls it makes and what they are expected to cost, and starts only when you type yes. It starts no call that could take it past its cap, $3 for the development part, $6 for the test and $2 for all the sheets, and logs every answer in runs beside the folder of the sheets, outside git. With -stub it asks no model: a stub answers by the markup, and the run needs no key. For the extended measurement, go run ./cmd/tutor-eval gen sheets|near makes a bank of tasks and a plan of their sheets with their truth by construction, as new files, and gen workbook|essays the pages of the workbook or the essays, and draw -shift leans the answer's digit of a near sheet as far as it says. run -kind essay -two assesses an essay in two calls, reading it and then assessing the text read. -readers names the Claude configurations a run asks: the three of E4 by default, and for the extended measurement four more, Opus 5.5 at medium, Sonnet 5.5 at low with thinking and without, and Haiku 5.5 at medium (R50). For it you write ten more sheets in free form, messily on purpose, with just messy-record: they go to samples/free-messy, out of git. go run ./cmd/tutor-eval report LOG then turns the log into the report, asking no model: whether the writing process helps each judge, by the criterion of section 3.1 of docs/architecture.md, and the other numbers, in Markdown and CSV beside the log.

The workbook of epic E4 is 20 pages that code draws in memory from eval/workbook.json: ten items a page, each with its boxes, and in each box a value written by hand, plainly or with a digit leaning toward its pair, mirrored or crossed out and written again. Its pages are listed in docs/workbook.md, and go run ./cmd/tutor-eval workbook -png synthetic/png/workbook saves the crop of every filled box, what a reading sees. The essays of epic E4 are 20 short essays in English with one rubric of six criteria, and whether each essay meets each criterion as planned: eval/essays.json, listed in docs/essays.md. Code draws them in memory too, and go run ./cmd/tutor-eval essays -png synthetic/png/essays saves the crop of every page.

How it works is section 3.3 of docs/architecture.md, and the plan of epic E4's measurements is its section 3.4; what the library is to be, call by call, is sections 3.5 to 3.10. The plan is RUN.md: epics E4 and E1, detailing, are done. The current epic is E3, deferred since 2026-10-25 and back on 2026-11-01: its first tasks gave tutor its releases, moved it to spec's 0.6 line, put the open views of the measurement's tasks into the releases, below, and moved it to spec v0.9.3, which carries the eval protocol; the runner's move to that protocol comes next, and the check of canvas's synthetic samples waits for canvas. The library's code, epic E5, is proposed but not yet taken.

Releases

A release comes out by itself after each merge into main that changes what the module is built from: its Go code, the files that code embeds, go.mod, go.sum, the justfile, the license, the Dockerfile, the release workflow or the file of open views below (R62 in docs/decisions.md). Its number is the next patch of line 0.1, from v0.1.0. A release is the tag of the Go module, which api builds from, go get github.com/altnovatrail/tutor@v0.1.0, and its files: the source of that commit, tutor_<version>_source.tar.gz; from the first release after 2026-11-02, the open views of the measurement's tasks, tutor_<version>_open-tasks.json; and SHA256SUMS over them. The open views are what a learner sees of each of the 56 tasks of the measurements — its statement, its canvas and its answer slots, in spec's module format 0.2 up to v0.1.1 and 0.3 from the first release after task T30 of RUN.md — and none of its key, solution, traps or checks: until the modules repository has content, canvas's CI puts them into the build of its sample page, by the release's tag and the file's sum (R64). The file is eval/open-tasks.json, and just open-tasks writes it anew from the banks. Each file comes with its Sigstore bundle, <file>.sigstore.json. The releases are immutable, and gh release verify <tag> -R altnovatrail/tutor and gh release verify-asset <tag> <file> -R altnovatrail/tutor check a release and a file you downloaded. The Go command checks the module itself against the Go checksum database.

Documents

The documents are in Russian.

  • docs/architecture.md — the component: what it does and does not do, its data and links, and what is still to decide.
  • 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.9.3: clone this repository with git clone --recurse-submodules.

License

Apache-2.0.

Documentation

Overview

Package tutor is the AI side of NovaTrail's tutor, a library that api calls in its own process. It reads the learner's work into an observation, reviews the working and words the tutor's replies, through the AI routes and models it admits, and reports each call's usage. It decides no verdict and stores nothing, and its requests carry no identifier of the learner or the account.

The AI providers are reached only through the port in package provider. The eval runner, cmd/tutor-eval, runs on the same code.

Directories

Path Synopsis
cmd
tutor-eval command
Command tutor-eval is tutor's eval runner: it runs the AI capabilities on eval samples, on the same code that api calls, and reports how they did.
Command tutor-eval is tutor's eval runner: it runs the AI capabilities on eval samples, on the same code that api calls, and reports how they did.
internal
board
Package board is the check board: a local page where a person solves fixed tasks by hand, the models read the work and judge it, and the person marks whether each model was right.
Package board is the check board: a local page where a person solves fixed tasks by hand, the models read the work and judge it, and the person marks whether each model was right.
essay
Package essay is the assessment of an essay by the module author's rubric in the measurement of epic E4 (T82; docs/architecture.md, 3.4, «Сочинения»): what a model sees of a synthetic essay.
Package essay is the assessment of an essay by the module author's rubric in the measurement of epic E4 (T82; docs/architecture.md, 3.4, «Сочинения»): what a model sees of a synthetic essay.
gen
Package gen builds the synthetic sets of the extended measurement (T94; R50 in docs/decisions.md): pages of the workbook in the format tutor-workbook and essays in the format tutor-essays, as many as a run needs, each with its truth by construction.
Package gen builds the synthetic sets of the extended measurement (T94; R50 in docs/decisions.md): pages of the workbook in the format tutor-workbook and essays in the format tutor-essays, as many as a run needs, each with its truth by construction.
hint
Package hint is the call of the review and the hint (T74; docs/architecture.md, 3.4, «Подсказка»): once the program has found the final answer not yet right, a model finds the first mistake in the work and words the tutor's question for the rung of the hint ladder that the program chose, in one call, as architecture 4.1 spec draws it (R28).
Package hint is the call of the review and the hint (T74; docs/architecture.md, 3.4, «Подсказка»): once the program has found the final answer not yet right, a model finds the first mistake in the work and words the tutor's question for the rung of the hint ladder that the program chose, in one call, as architecture 4.1 spec draws it (R28).
journal
Package journal tells how a sheet was written, for the forms of the measurement that show the model the writing process (R11, R24): a journal of numbered steps in English, and up to two frames of the sheet just before erasures.
Package journal tells how a sheet was written, for the forms of the measurement that show the model the writing process (R11, R24): a journal of numbered steps in English, and up to two frames of the sheet just before erasures.
judge
Package judge holds what the measurement asks of a model and how it reads the answer (R24): the judge's instructions, the request of each form, and the schema of the answer.
Package judge holds what the measurement asks of a model and how it reads the answer (R24): the judge's instructions, the request of each form, and the schema of the answer.
leak
Package leak is the leak check of the module format (R57 spec; the format text of spec, section 20, «The leak check»): the program's search for the answer in a text the learner will see, the tutor's words before they reach the learner.
Package leak is the leak check of the module format (R57 spec; the format text of spec, section 20, «The leak check»): the program's search for the answer in a text the learner will see, the tutor's words before they reach the learner.
lines
Package lines finds the lines of a sheet: the strokes that stand at one height, told apart by the gaps between them down the sheet.
Package lines finds the lines of a sheet: the strokes that stand at one height, told apart by the gaps between them down the sheet.
measure
Package measure is the judge's kind of call on the runner (T67): the measurement of the writing process (R24).
Package measure is the judge's kind of call on the runner (T67): the measurement of the writing process (R24).
newfile
Package newfile writes the files tutor's tools keep: each a new file, never one written over.
Package newfile writes the files tutor's tools keep: each a new file, never one written over.
openview
Package openview builds the open views of the measurement's tasks: the file that tutor's release carries for canvas's sample page, until modules has content (T37; R64 in docs/decisions.md; the 2026-10-21 amendment to R25 spec).
Package openview builds the open views of the measurement's tasks: the file that tutor's release carries for canvas's sample page, until modules has content (T37; R64 in docs/decisions.md; the 2026-10-21 amendment to R25 spec).
protocol
Package protocol is spec's eval protocol in tutor's code: the package novatrail.eval.v1, whose messages Sample and Report are the sample file and the runner's report (contracts/README.md of spec, sections 11 and 14; R93, R95 spec).
Package protocol is spec's eval protocol in tutor's code: the package novatrail.eval.v1, whose messages Sample and Report are the sample file and the runner's report (contracts/README.md of spec, sections 11 and 14; R93, R95 spec).
protocol/protocoltest
Package protocoltest gives tests spec's examples of the eval protocol: the synthetic sample files and reports of contracts/examples/eval/v1/ (contracts/README.md of spec, sections 11 and 14).
Package protocoltest gives tests spec's examples of the eval protocol: the synthetic sample files and reports of contracts/examples/eval/v1/ (contracts/README.md of spec, sections 11 and 14).
reading
Package reading is the reading of a sheet into an observation (T68; docs/architecture.md, 3.4, «Чтение в наблюдение»): a model reads the work as it is written, part by part, and its final answer, without deciding whether it is right (concepts 9.1 spec).
Package reading is the reading of a sheet into an observation (T68; docs/architecture.md, 3.4, «Чтение в наблюдение»): a model reads the work as it is written, part by part, and its final answer, without deciding whether it is right (concepts 9.1 spec).
render
Package render draws a sheet of handwriting from its strokes, as the board shows it: ink of the board's pen, #111, 3 px wide with round ends and joins, on white, one pixel to a unit of the sheet.
Package render draws a sheet of handwriting from its strokes, as the board shows it: ink of the board's pen, #111, 3 px wide with round ends and joins, on white, one pixel to a unit of the sheet.
report
Package report turns the log of a run into the measurement's numbers and its criterion (R24; docs/architecture.md, 3.1, «Замер хода решения»), asking no model, and writes them as Markdown and CSV.
Package report turns the log of a run into the measurement's numbers and its criterion (R24; docs/architecture.md, 3.1, «Замер хода решения»), asking no model, and writes them as Markdown and CSV.
runner
Package runner runs the calls of a measurement, whatever their kind (T67): the judge of the writing process, and in epic E4 also reading, the hint, the cells of the workbook and the rubric (docs/architecture.md, 3.4).
Package runner runs the calls of a measurement, whatever their kind (T67): the judge of the writing process, and in epic E4 also reading, the hint, the cells of the workbook and the rubric (docs/architecture.md, 3.4).
sample
Package sample is the format of the reading measurement's samples, of its bank of tasks, of its sheet plan and of the split of its sheets: their types, how they are read from JSON and how they are checked.
Package sample is the format of the reading measurement's samples, of its bank of tasks, of its sheet plan and of the split of its sheets: their types, how they are read from JSON and how they are checked.
sheets
Package sheets reads the directory where the record mode of the board saves the measurement's sheets (R25), against the sheet plan: for each plan sheet its last file, read and checked as a sample.
Package sheets reads the directory where the record mode of the board saves the measurement's sheets (R25), against the sheet plan: for each plan sheet its last file, read and checked as a sample.
states
Package states chooses the states of a sheet for the reading of unfinished work (О-8, О-21; T69): the moments of the writing at which a device that read on its own, without the learner asking, would read, and what the sheet shows at each.
Package states chooses the states of a sheet for the reading of unfinished work (О-8, О-21; T69): the moments of the writing at which a device that read on its own, without the learner asking, would read, and what the sheet shows at each.
synth
Package synth draws synthetic samples and a synthetic bank of tasks for tests, and for the recording page until the measurement's own bank exists.
Package synth draws synthetic samples and a synthetic bank of tasks for tests, and for the recording page until the measurement's own bank exists.
task
Package task gives each task of tutor's measurements — a task of a bank, solved on a sheet; a page of the workbook; an essay — the task of spec's module format 0.3 it is, with its checks: formatv0.Task (T103; R68 in docs/decisions.md).
Package task gives each task of tutor's measurements — a task of a bank, solved on a sheet; a page of the workbook; an essay — the task of spec's module format 0.3 it is, with its checks: formatv0.Task (T103; R68 in docs/decisions.md).
value
Package value is the checks of the kinds number and fraction of the module format (R56 spec; the format text of spec, section 15, «Checks»): it reads a value as it is written in the steps the format gives, takes it only in a notation of the kind, and compares it with the key as a rational number, exactly; a fraction asked in lowest terms is right only in them.
Package value is the checks of the kinds number and fraction of the module format (R56 spec; the format text of spec, section 15, «Checks»): it reads a value as it is written in the steps the format gives, takes it only in a notation of the kind, and compares it with the key as a rational number, exactly; a fraction asked in lowest terms is right only in them.
workbook
Package workbook is the measurement of the workbook in epic E4 (T78–T80; docs/architecture.md, 3.4, «Рабочая тетрадь»): its pages, which code draws in memory from eval/workbook.json, and the crop of each filled box, which is all a reading of the page sees (R53 spec, amendment of 2026-10-27): the ink of the box's strokes alone, cut by the rule of the eval protocol, without the box's frame and the print of its line.
Package workbook is the measurement of the workbook in epic E4 (T78–T80; docs/architecture.md, 3.4, «Рабочая тетрадь»): its pages, which code draws in memory from eval/workbook.json, and the crop of each filled box, which is all a reading of the page sees (R53 spec, amendment of 2026-10-27): the ink of the box's strokes alone, cut by the rule of the eval protocol, without the box's frame and the print of its line.
Package provider is the port through which tutor reaches the AI providers.
Package provider is the port through which tutor reaches the AI providers.
claude
Package claude is the adapter of Anthropic's Claude models, through the official Go SDK.
Package claude is the adapter of Anthropic's Claude models, through the official Go SDK.
gpt
Package gpt is the adapter of OpenAI's GPT models, through the official Go SDK and the Responses API.
Package gpt is the adapter of OpenAI's GPT models, through the official Go SDK and the Responses API.

Jump to

Keyboard shortcuts

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