contracts

package module
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: Apache-2.0 Imports: 2 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

The NovaTrail API contracts

This is the text of the API contracts: how the messages and services that NovaTrail's parts exchange are written in protobuf, which rules buf holds them to, how they are versioned, which code is generated from them, and what each contract means and which rules its parts follow. It is normative, as are the .proto files beside it. The documents under docs/ describe the platform in Russian and add no rules to the contracts.

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 (RFC 2119, RFC 8174) when, and only when, they appear in all capitals, as shown here.

1. About the contracts

  • An API contract — a contract, in this text — is a protobuf package: its messages, and the services one part of the platform calls on another. The contract of the element <novatrail-canvas> with app is not one: it is TypeScript types, written by hand. The first ones are the observation, which tutor, module-kit and api exchange in one process, and the contract between app and api.
  • The contracts are the .proto files under contracts/ and this text. The code generated from them is no part of the contract: it follows from the files (see Generated code, below).
  • The names in the contracts are the English terms of the glossary of docs/concepts.md. A value or an ID of the module format keeps the spelling the format gives it (see Fields, below).
  • The first package is novatrail.observation.v1, the observation. The second is novatrail.eval.v1, the eval protocol: the sample file with its markup, the rules of the strokes on a sheet that the device and the runner share, eval sets and the runner's report. The third is novatrail.api.v1, the contract between app and api. The fourth is novatrail.paper.v1, of a task from the learner's paper, which tutor, module-kit and api exchange in one process: the answer of the Check, in which a model judges the work, the reading of "Recognise", and the key of the solver of module-kit, which no task from paper is checked by. The other tasks of epic E3 add theirs, each by the rules of this text.

2. Versions

  • A contract has no version of its own beside its package. Its version is the last component of its package, v1, and the tag of spec in which a file came out.
  • Within a package a change MUST only add: a new message, field, enum value, service or method. buf breaking holds this against the previous release of spec (see buf's rules, below). Such a change comes out in any release of the line.
  • A change of what a contract means breaks it too, though buf sees none: another meaning of a field or an enum value, or another rule of how a part of the platform reads a message — such as how two observations are joined, or which verdict an observation gives. Whatever can give another result on the same message is such a change. A new enum value, or a new field, whose meaning changes none of the old ones, only adds.
  • A change that would break a package MUST come as a new package, v2, beside the old one. A package vN with N of 2 or more, beside its v(N−1), opens a new line of spec, as a new version of the module format does. The first package v1 of a new part opens none. A version of a package is never reused.
  • A server holds two major packages of a contract: the current one and the previous one. A client reads the package it was built with. Within a major package, a client older than the server works with it, since both sides of the transport skip the fields they do not know.

3. Files and names

  • A file MUST lie at contracts/novatrail/<part>/v1/<name>.proto, and its package MUST be novatrail.<part>.v1: the path from contracts/ repeats the package, as buf's rule PACKAGE_DIRECTORY_MATCH asks. <part> and <name> are lower snake case.
  • The test vectors of a package lie at contracts/vectors/<part>/v1/<case>.json, <case> in kebab case; a package has them when this text gives it rules that a program follows, as it does the observation and, in the rules the device and the runner share, the eval protocol.
  • The examples of a package lie at contracts/examples/<part>/v1/<case>.json, <case> in kebab case: messages of the package written by the rules of JSON below, which spec's checks hold to the rules of this text, as they do the sample file. Where a package's examples show more than one message, the case names the message: of novatrail.eval.v1, an example whose case begins with report- is a runner's report, and any other a sample file.
  • The prefix novatrail keeps every name unique: a Go program refuses to start with two protobuf declarations of one name linked into it.
  • buf.yaml, version 2, lies at the root of spec, with one module, contracts, and no deps: the build MUST NOT depend on the Buf Schema Registry or any other service outside the repository.
  • Comments in the files are in English. Every message, field, enum, enum value, oneof, service and method MUST have a leading comment that says what it is, as a schema of the format describes each property.

4. Syntax

  • A file MUST begin with syntax = "proto3";. Editions are not used: moving to them is a decision of its own, and it changes neither the wire nor JSON.
  • A scalar field where "absent" and zero differ MUST be optional, as absence differs from a zero value in the module format's types.

5. Fields

  • A field's name is the glossary's English term in snake case, and a repeated field's name is plural.
  • A place and a crop on the canvas, in thousandths of the crop, and the other small integers of the platform, are int32. A field MUST NOT be int64 unless its value can exceed 2³¹ − 1, the largest int32: in JSON an int64 is a string, and in TypeScript a bigint. Unsigned types are not used.
  • The zero value of an enum MUST be <ENUM>_UNSPECIFIED and means nothing. A field or an enum value is never removed from a package (see Versions, above): what a contract no longer needs stays, its comment says so, and the next major package leaves it out.
  • A value or an ID of the module format — a canvas kind such as handwriting_sheet, a task's ID — is a string holding the format's own spelling, not an enum of the contract, so that one value has one spelling.
  • One of several alternatives is a oneof.
  • A PNG, or any other file, is bytes; in JSON it is a base64 string.
  • A moment is google.protobuf.Timestamp; in JSON it is a string of RFC 3339, in UTC.

6. JSON

  • A field's name in JSON MUST be its protobuf name, in snake case, the same as in the module format. Whatever writes JSON of a contract — a file of spec, a sample file, a codec of the transport — MUST print the protobuf names: UseProtoNames of protojson in Go, useProtoFieldName in protobuf-es.
  • The option json_name MUST NOT be used.
  • A reader MUST accept both the protobuf name and the lowerCamelCase name, as ProtoJSON requires of every parser.

7. buf's rules

  • buf lint holds every file to the categories STANDARD, COMMENTS and UNARY_RPC, with no exceptions, and with disallow_comment_ignores: true: a comment in a file MUST NOT switch a rule off. A method streams nothing.
  • buf breaking holds every package to the category FILE against the previous release of spec: the newest release tag in the history of the commit checked, other than the commit's own, with buf.yaml and contracts/ as git holds them at that tag. A working tree that changes buf.yaml or contracts/ is checked as the commit that would follow its HEAD, so a release of HEAD is the previous one then. A release in which a package first appears has nothing to compare it with.
  • No rule of protovalidate is used: its module lives in the Buf Schema Registry.
  • Beside buf's rules, spec's checks hold every rule of this text that a program can read: the syntax, the path and the package, no json_name and no unsigned type, buf.yaml as the rules of files and names and this section have it, and a template of buf generate with local plugins alone. optional where absence differs from zero, and int64 only past 2³¹ − 1, are held by review. The rules of the observation and those the device and the runner share are held by their test vectors, which spec's checks compute (the "Test vectors" of each), those of the sample file and of the rules the device and the runner share by the check of each example (the sample file's "Examples") and of each sample file another repository names (the sample file's "Checking a sample"), and those of eval sets that need neither a module's package nor a key by the check of a module's eval set (the sample file's "Checking a sample"), and the form of a report by the check of its examples (the runner's report's "Examples") and of each report another repository names (its "Checking a report"). The rules of eval sets and of the runner's report are rules of the runner, which tutor's tests and review hold, beyond what the check of a module's eval set holds of eval sets and the check of a report of the report: the measures of the runner's report have no vectors, since one implementation counts them, and a report's records let anyone count them again. The contract between app and api has no vectors either: its rules are what app and api do, which their tests and review hold. That a change of any of them is a change of meaning, which breaks the package (see Versions, above), review holds.

8. Generated code

  • The code is generated from the files by buf with local plugins at exact versions; no remote plugin of the Buf Schema Registry is used. buf.gen.yaml at the root of spec names them: protoc-gen-go and protoc-gen-connect-go are tools of contracts/go.mod, so that each comes at the version of the runtime the module requires, and protoc-gen-es is a package of spec's tools. The code lies in the repository beside the files, and spec's checks verify that it is what buf generates.
  • Go. The code is the module github.com/altnovatrail/spec/contracts, whose go.mod lies in contracts/: the messages from protoc-gen-go and the services from protoc-gen-connect-go. Beside them, written by hand, the package contracts at the root of the module embeds the test vectors as contracts.Vectors, an fs.FS whose root is contracts/vectors/, and requires nothing beyond Go's standard library. The module carries the examples too, as files of contracts/examples/. Its tag is contracts/vX.Y.Z, with the number of the tag of spec, on the same commit: from the line 0.7 on, the release of spec sets it once the release is out. It requires the protobuf runtime and Connect at exact versions, while the module github.com/altnovatrail/spec at the root still requires nothing. Code on Go MUST take a contract from this module and MUST NOT generate its own: two copies of one contract in one program refuse to start.
  • TypeScript. The code is the npm package @altnovatrail/contracts, JavaScript with its declarations from protoc-gen-es, and no types of JSON: they would spell the fields in lowerCamelCase, which no writer of a contract writes (see JSON, above). The package exports each file of code by its path, the path of its .proto file with _pb.js in the place of .proto: @altnovatrail/contracts/novatrail/observation/v1/observation_pb.js. It depends on @bufbuild/protobuf at the exact version of the protoc-gen-es that wrote it. It carries the test vectors of the packages whose rules code on TypeScript follows, too, each exported by its path from contracts/: @altnovatrail/contracts/vectors/eval/v1/groups.json, the rules the device and the runner share. The vectors of the observation it does not carry: TypeScript gives no verdict. A release of spec carries it from the line 0.7 on, as altnovatrail-contracts-<version>.tgz; its version is the tag of spec without v, and a consumer verifies it as it verifies @altnovatrail/spec. spec's checks build it and run it under TypeScript and Node.

9. Transport

  • app and api talk by Connect: the server is connect-go, and the client connect-es. Every call is unary.
  • Between app and api the wire is binary protobuf: a new enum value reaches an older client as a number, while in JSON connect-es skips a name it does not know and reads the field as unset (see Versions, above). The server takes JSON too, for debugging, and writes it with the protobuf names.
  • Both sides skip the fields they do not know, so a client and a server within one major package understand each other.

10. The observation

  • The observation is what AI read in a learner's work, answer slot by answer slot, before any check runs: the message Observation of the package novatrail.observation.v1. A reader of tutor gives one, without the key. module-kit joins two of them into one and gives the verdict on it. api passes them from one to the other in its process and keeps the one joined. Which models read is tutor's to decide, by eval, and the mode single, in which one of the pair reads alone, is the operator's choice.
  • An answer slot whose answer AI reads is in the observation once, in the task's order: items by their place, answer slots by their place in the item, each named by its place (AnswerSlotPlace).
    • On a handwriting sheet, these are the slots bound anywhere, zone and sheet (the module format's text, on the task).
    • On a workbook, every box. A box that the learner left empty sends no crop, and its reader gives it as blank without calling a model. The reader takes the boxes from the open view of the task, since the work lists only the filled ones.
    • A slot bound choice is tapped, not read, and is not in the observation. Its value is the text of the option tapped (the module format's text, on checks), which api gives module-kit beside the observation and keeps beside it.
  • A task whose answer slot is bound sheet, an essay, is read by one reader, and so is a task from paper, by one model at a time of up to three in turn (see the contract between app and api, below). Any other task that AI reads is read by two readers of one provider, in two calls: so in the reading mode pair, the default. In the mode single, which the operator of a deployment chooses at any rung, the admission of the pair's entry deciding, it is read by one reader, and its observation goes to the verdict as it is, with nothing to join.

What a reader gives.

  • A reader gets the work — the crop of a handwriting sheet, or the crops of the filled boxes of a workbook — and the open view of the task, with the age category and the path to AI for admission. It gets no key, no solution of the task, and nothing of an answer slot's check: neither its kind nor the options of a choice written by hand. A statement that wants an answer in a form says so (the module format's text, on checks).
  • For each answer slot it gives value, what is written there, or unreadable, why it gives none.
    • A value is given only when the reader sees it in the writing itself, and as it is written: normalizing it is the check kind's, and module-kit's, not the reader's. A fraction written with a bar is given on one line, numerator first, as the module format's checks say. A value is never empty, nor only white space: where nothing is written, the slot is blank.
    • UNREADABLE_BLANK: nothing is written in the slot.
    • UNREADABLE_ILLEGIBLE: something is written, and it cannot be read.
    • UNREADABLE_AMBIGUOUS: what is written can be read more than one way. A digit written mirrored is such a case, as the module format's checks say; so is a value that the reader sees another reading of, and a value that the reader cannot point to in the writing.
    • UNREADABLE_NO_FINAL_ANSWER and UNREADABLE_SEVERAL_FINAL_ANSWERS, only in a slot bound anywhere: AI finds no final answer in the work, or more than one, and the learner is asked to circle the answer (the module format's text, on the task).
  • In a slot bound sheet, the value is the text of the essay as it is written, the learner's mistakes kept; or the slot is blank, or illegible: the essay as a whole cannot be read. A word that cannot be read does not make the essay illegible; how the reader gives such a word is open (Т-37). The essay is read without the rubric, and the text goes to the rubric's assessment, without the picture.
  • The place. crop_box stands only in a slot bound anywhere: the box of the final answer on the crop that the device sent, in whole thousandths of its height and width, when the reader names one. tutor's adapter turns the provider's units into thousandths, and gives no box that is not valid: whole numbers from 0 to 1000, ymin less than ymax and xmin less than xmax. In a slot bound zone and in a box of a workbook, the place is the answer slot itself. A group's label as a place comes only if the frames of the groups go with the work (Т-31).
  • The parts of a free writing, the other readings that a reader sees, and whether a digit is mirrored are the reader's own: they lead it to the value or the reason it gives, and the observation holds neither.
  • An observation is valid when it holds every answer slot of the task that AI reads, each once and in order, and no other — neither a slot bound choice nor a place the task does not have; each with a value that is not empty nor only white space, the characters with the Unicode property White_Space, as step 4 of the module format's numbers has it, or with a reason other than UNREADABLE_UNSPECIFIED; when only a slot bound anywhere gives UNREADABLE_NO_FINAL_ANSWER, UNREADABLE_SEVERAL_FINAL_ANSWERS or a crop_box, and the box stands only beside a value and is valid; and when a slot bound sheet gives only a value, UNREADABLE_BLANK or UNREADABLE_ILLEGIBLE. A reason added to the package after a release of module-kit is not valid to that release, as UNREADABLE_UNSPECIFIED is not. Nor is an observation with a value that is not UTF-8: proto3 carries no such string, and the vectors none, but a structure of Go that tutor hands to module-kit within one process of api can hold one.
  • An observation that is not valid is no observation: it is as a failure of AI (below), and no refusal of the server.

What is no observation. A failure of AI, an exhausted limit or quota, a refusal of admission and a refusal of the learner's own key are outcomes of the call, not observations. After such an outcome, every answer slot whose check gives a verdict and that AI reads gets unchecked, while an essay does not reach the assessment and its submission ends unchecked, which is no verdict; how the learner's app shows it is the contract between app and api. When the call of one of two readers ends in such an outcome, the reading gives no observation at all, not even the other reader's: the pair holds the verdict.

Joining two observations. module-kit joins the observations of two readers into one, answer slot by answer slot, before it gives a verdict. The first observation is that of the reader whom tutor names first in the pair.

  • A value that the kind normalizes to nothing, such as = under number, is UNREADABLE_BLANK before any pairing: with UNREADABLE_BLANK, or with another such value, it joins into UNREADABLE_BLANK, and with a value or another reason into UNREADABLE_AMBIGUOUS.
  • Two values join when the check of the answer slot compares them equal — as it compares a value with a trap value, after the same normalization (the module format's text, on checks) — and gives them the same verdict. The joined value is the first. So 0.5 and 1/2 join under number, and 07:30 and 7:30 under time, while 2/4 and 1/2 do not under fraction with form: reduced, nor 7:30 and 19:30 under time. A predicate compares the integers read: 12 and 24 do not join, though the predicate holds for both. Two values that are not in the kind's notation join when they are the same once normalized as the kind normalizes them — steps 1 to 7 of a number, its units dropped, and of a time, and a choice's normal form in lowercase —, so that 7² and 7³ join, both a 7 and U+FFFD; a value in the notation and one out of it never join.
  • Beside a joined value, the joined crop_box is the first's, or, when the first gives none, the second's. A joined reason has none.
  • Two reasons that are the same join into that reason.
  • Every other pair joins into UNREADABLE_AMBIGUOUS: two values that do not join, a value and a reason, or two reasons that differ. The readers read the slot differently.
  • When either observation is not valid, there is no joined observation: as after a failure of AI, every answer slot that AI reads gets unchecked. A slot bound choice still gets the verdict of the option tapped, and the item's verdict is made of all its answer slots'.
  • The observation of an essay has one reader and nothing to join, and so has every observation in the reading mode single: module-kit gives the verdict on it as given, once it is valid, and one that is not valid is as a failure of AI.

The verdict. module-kit gives the verdict on the observation once the reading has ended, on the whole observation, not on parts of it while they come: each answer slot's, and then the item's, as the module format's checks make it of its answer slots'.

  • A value gets the verdict that the module format's checks give that value read, with its reason and its trap. A value that the kind normalizes to nothing is blank.

  • A reason gets unreadable, with the reason of the verdict named after it. This holds in a slot whose check gives a verdict; an essay gives none (below).

    Unreadable Reason of the verdict
    UNREADABLE_BLANK blank
    UNREADABLE_ILLEGIBLE illegible
    UNREADABLE_AMBIGUOUS ambiguous
    UNREADABLE_NO_FINAL_ANSWER no_final_answer
    UNREADABLE_SEVERAL_FINAL_ANSWERS several_final_answers

    blank is the module format's reason too, and so is notation, which only a value gets: the check kind's.

  • A slot bound choice gets the verdict that the module format's checks give the text of the option tapped.

  • A rubric gives no verdict. An essay with a value goes on to the assessment by the rubric; a blank or illegible one does not: its submission ends unreadable, which is no verdict either, and the learner writes the sheet again.

What is kept. api keeps the joined observation, or in the mode single the one reader's, with the values of the slots tapped, and the same release of module-kit gives the same verdict on them again, with no AI. The two readers' observations are not kept. Of an essay, api keeps no observation: the text read lives in the memory of the request and on the device. It keeps how each submission ended and, with feedback, the mark of each criterion (П-19).

Test vectors. The test vectors hold the rules of this section: contracts/vectors/observation/v1/<case>.json. spec's checks compute each, as a second implementation (just contracts-check), and module-kit's CI passes them all, from contracts.Vectors at the tag it takes.

  • A vector is a JSON file: description, what it holds; canvas, the task's canvas, and items, the task's items, as the module format writes them, with the checks of their answer slots; and cases.
  • A case has its description; observations, the readers' observations in the order of the pair — two, or one for an essay —, each written by the rules of JSON above, with every field, its zero too (EmitDefaultValues of protojson, alwaysEmitImplicit of protobuf-es), and a reason that the package does not know as its number; and valid, whether each is valid. An observation that is not valid breaks one condition alone, so that the vector shows which.
  • Where the task has answer slots bound choice, tapped lists each, in order, as { answer_slot, value }: the text of the option tapped, as written, or null when the learner tapped none.
  • A case of an essay has submission: assessment, when the submission goes on to the assessment by the rubric, unreadable or unchecked. Every other case has joined, the joined observation, or null when either observation is not valid, and verdicts, each item's in order: its answer slots' verdicts, each { verdict, reason, trap } as the test vectors of verdicts of the module format write them, and its own.
  • The verdict of a predicate on a value in its notation is Starlark's, which spec's checks do not run: they take the vector's, and only module-kit's CI computes it. The join of two such values, which compares the integers read, they compute.
  • Together, the vectors give every reason of the table above in a joined observation, every check kind of the module format, an observation that is not valid and an option tapped. The check refuses a reason added to the package until the table above names it and a vector gives it.

11. The sample file

  • The sample file is one sample of writing on a handwriting sheet or a page of a workbook, as the samples page of canvas saves it on the device and the eval runner of tutor reads it: the message Sample of the package novatrail.eval.v1, one JSON file to a sample. It holds no key of its task and nothing that AI read. What a sample is meant to say is its markup (below); which samples make an eval set, and how the runner reads them, are the rules of eval sets, and what the runner reports of a run, the runner's report, below; the rules that the device and the runner share — how the history of writing folds, the groups of strokes, the crop and how it draws the strokes' styles, how the tutor's marks snap and which box a stroke fills — have their own section below, with their test vectors.
  • protocol names the package, "novatrail.eval.v1". A reader reads it first, and reads a file of no other protocol. The version of the protocol is that of a contract (see Versions, above).
  • id is the sample's ID: 1 to 64 lowercase Latin letters, digits and hyphens, so that it can name the sample's file. A person's sample gets one at random; a synthetic sample's comes from its seed, so that one seed gives the same file.

What a sample holds. Its purpose and who wrote it set which fields it holds:

purpose writer Strokes writer_code license
PURPOSE_EVAL_SET WRITER_ADULT, WRITER_ADULT_AS_CHILD geometry none "Apache-2.0"
PURPOSE_MEASUREMENT WRITER_ADULT, WRITER_ADULT_AS_CHILD history REQUIRED none
PURPOSE_MEASUREMENT WRITER_CHILD geometry REQUIRED none
  • A child writes no sample of an eval set. A sample of an eval set has no writer's code, which would link published samples with each other, and names its license, under which modules publishes it.
  • The origin — person, or synthetic with its seed, an unsigned integer of 64 bits in decimal digits — does not change which fields a sample holds, and a synthetic sample comes in each of the three.
  • writer_code is 6 to 16 digits and capital Latin letters, which the samples page makes at random; text_set_version, the version of the set of texts that the page showed, is 1 to 32 Latin letters, digits, dots and hyphens, and from the legal part on the set's ID and version joined by a hyphen, such as child-sample-1 (the legal texts, on the passport); canvas_version is the version of canvas whose samples page wrote the file, MAJOR.MINOR.PATCH. A file that the samples page did not write — a synthetic sample, a sheet recorded on a board, a sheet converted from an earlier file — has canvas_version "0.0.0" and text_set_version "none", which no samples page writes: no release of canvas is 0.0.0, and the page MUST NOT name a set of texts none. A synthetic sample always has these two, since code, not the page, drew it.
  • No field holds a name, an email, an account, the device, the browser, the screen, a language, a date, an age or a class, and since a reader refuses a field the message does not have (below), none can be added.
  • The history of writing is the events in the order they happened, each at its time on the sheet's clock, whole milliseconds never decreasing: write, a stroke with its ID, unique and from 1, the type of the pointer that wrote it, its style, and its points, each across and down in units of the sheet to a tenth and at its time, which never goes back along the stroke, the last no later than the event's: a stroke is written when its last point is, or later, when another action landed while it was written (see the rules the device and the runner share, below); erase, the strokes the eraser took off whole; cut, the strokes an eraser that takes a part crossed, which it took off, and the pieces of them it left; clear, every stroke the sheet showed; and undo, the strokes it took off and those it put back. Erase, cut, clear and undo take off only strokes the sheet shows, and undo puts back only strokes written and not shown. The history holds no pressure: no input of a model takes it, and nothing is kept that nobody reads.
  • A stroke's style is how the learner chose it to look before writing it: its kind of pen — PEN_KIND_PEN, whose line the device draws wider and finer by a pen's pressure or the pointer's speed, PEN_KIND_LINER, one width all along, or PEN_KIND_MARKER, one width, multiplied with what lies under it —, its colour, any of sRGB as # and six lowercase hexadecimal digits, its width in units of the sheet to a tenth, from 0.1 to 50, and its opacity in whole percent, from 10 to 100. A stroke of a history written before strokes had a style has none, and is drawn as the pen then drew: of the kind pen, black and opaque. The final geometry keeps each stroke's style, since the strokes shown are drawn by it.
  • A cut is one stroke of an eraser that takes only what it passes over: it names the strokes it crossed, at least one, in the order of the sheet, and the pieces of them it left, in that order and along each stroke — none of a stroke it covered whole. A piece is a new stroke: an ID no stroke had before, the ID of the stroke it was cut of, of, one the cut names, that stroke's pointer and style, and a run of its points, with one point of its own at most at each end, where the eraser's edge crossed the stroke, at a time within the stroke's first and last. So the groups, the marks and the IDs stay those of whole strokes, and a reader that folds the history takes a piece as it takes any stroke written.
  • The final geometry is the strokes the sheet shows at the end, numbered by their place from 1, each with its points along the stroke in its canonical direction, to a tenth, and its style: no time, no pointer, no order of writing and nothing erased. The groups and the table of boxes name the strokes by these numbers.
  • A sheet gives its width and height in units, the height of a digit that the module asks a crop to be drawn at, the groups of the visible strokes — labelled A, B and on by their place, every visible stroke in one, by the rule of groups — and their crops. A workbook gives the page's width and height, the same height of a digit, every box of the page in the task's order, each by its place (AnswerSlotPlace) with its rectangle in whole units, and the filled boxes in the task's order: the IDs of the strokes in each, the table "box → stroke IDs" that the device built by the rule of boxes, and its crops. A workbook has no groups. In the final geometry of a workbook every stroke is in a box: the draft goes nowhere.
  • The crops of one set of strokes — the sheet's visible strokes, or a filled box's — are a CropSet: the box of their points and h_med, the lower median of the heights of their bundles, both in whole tenths of a unit, and a crop at each height of a digit of eval, 16, 24, 32 and 48 px, and at the module's, by the height ascending. Each crop gives the height asked for and the height drawn, its size and margins in px, its scale, the width of its widest line, its sheet_box, the frames of the groups in the order of their labels — on a workbook none —, and its PNG. A sheet with no stroke has no crops. These numbers are those the rule of the crop gives the strokes the sample holds: the strokes a history shows at the end, or the final geometry, with the sheet's groups, or a filled box's strokes with none.
  • A history holds the strokes as they came, so its groups on a sheet and its table of boxes on a workbook are those the rules give the strokes it shows. The final geometry holds them no more as the device saw them — no time, and the points maybe other along a stroke —, so its groups and its table are the device's, and a reader does not compute them again.
  • The task is named without its key: its source — modules, by the tag of a release of modules, the module, its version and the digest of its package; tutor, by the tag of a release of tutor, the digest of its file of open tasks, the bank and the bank's digest; or file, a file of tasks outside any release, by its digest, the bank and the bank's digest —, the task's ID, the seed of the instance when the task is a template, and the digest of its open view: sha256: and the SHA-256 of its canonical text, in 64 lowercase hexadecimal digits (the module format's text, on packages), of an instance with its numbers in place. The runner finds the key by them.

The markup. markup is what the sample is meant to say: the truth the runner compares what AI reads with. Every writer — the samples page, and the code that draws a synthetic sample — writes it into every sample. A file without it is still a sample, and a reader reads it, but the runner measures nothing on it (see eval sets, below).

  • Who makes it follows from the origin and the writer, and the file says no more. An adult, writing in their own hand or imitating a child's, marks what they wrote, by what the samples page showed them before and while they wrote; for a child, an adult marks it after the writing, from what the child says; code marks a synthetic sample by what it drew. The page calls no AI, so a markup never follows what a model reads. The markup is made before the file is saved and does not change after it, but for the people's marks of an essay (below).
  • Code that draws a synthetic sample gets no key of its task and knows no subject, so of its markup only what it drew is a truth: the truth of the answer slots, the parts with their texts and strokes, and the notes. A synthetic sample's first_error and an essay's marks are what the code chose by its seed, as it chose the values it drew: they say nothing of whether the solution went wrong or the essay meets a criterion. A runner reads them as it reads any markup, and on synthetic samples the CI of tutor checks only that its runner reads them; but a measure that rests on them — the assessment of the runner's report, or the analysis of a solution by its first error — measures nothing of AI on a synthetic sample, and the rule of admission counts none.
  • truth is an observation (see the observation, above): every answer slot that AI reads, in the task's order, with its value as it is written, or the reason why a reader that reads right gives none — a digit written mirrored is UNREADABLE_AMBIGUOUS, as the observation's rules have it —, and with no crop_box. On a workbook it names every box of the page, and a box that holds no stroke is UNREADABLE_BLANK; on a sheet that shows no stroke, every answer slot is. The outcome and the trap are not written: the runner gets them as the verdict on the truth, by the task's key (see the runner's report, below).
  • notes set apart the answer slots whose rows the runner measures apart, ascending by place, each noting one at least: mirrored, a digit written mirrored, whose truth is then UNREADABLE_AMBIGUOUS; crossed_out, something crossed out and written again.
  • On a sheet the markup gives one of two, and on a workbook neither, since its boxes are its places:
    • parts, the parts of a solution in the order it reads, each what the writer meant as one, a text or a drawing (by the glossary of docs/concepts.md), with its text — a text as it is written, a drawing described in words, with every number and label on it — and its strokes. Every stroke the sheet shows is in one part, and the strokes that cross a part out are in it. crossed_out says that the writer crossed the part out, so it is no part of the solution; illegible, that the part, or something in it, is written illegibly on purpose — or, in a child's sample, whose markup an adult gives from the child's words after the writing, and where only the writer would know what was on purpose, that it cannot be read even from those words; final_answer, that it holds the final answer of the task's answer slot bound anywhere, which is the one answer slot of its task (the module format's text, on the task), and a part crossed out holds none. One such part gives that slot a value, UNREADABLE_ILLEGIBLE or UNREADABLE_AMBIGUOUS, and two or more UNREADABLE_SEVERAL_FINAL_ANSWERS; a truth of UNREADABLE_NO_FINAL_ANSWER has none. first_error is the place, from 1, of the part where the solution went wrong, even when its calculation is right, and in a drawing too, but never a part crossed out; there is none when the solution did not go wrong.
    • marks, an essay's: whether it meets each criterion, by the criterion's place in the rubric from 1, ascending, as the people who marked it agreed. A criterion they did not agree on has no mark, and the runner counts it nowhere. The essay's truth is its one answer slot, bound sheet: its text as it is written, or UNREADABLE_BLANK or UNREADABLE_ILLEGIBLE, and an essay that cannot be read has no mark, since it reaches no assessment. The marks come after the writing: the organizer of the eval set or of the measurement adds them once the people have agreed, before the sample goes into a set or a run, and code marks a synthetic essay. How many people mark an essay, and how they agree, is the volunteer's form's to say (П-16).
  • What only the task holds, the runner holds: that the truth is a valid observation of the task and gets a verdict, that a final answer stands only where the task's slot is bound anywhere, and that the marks name criteria its rubric has (see eval sets, below).

Writing and reading.

  • A writer writes the file by the rules of JSON above, with every field, its zero too (EmitDefaultValues of protojson, alwaysEmitImplicit of protobuf-es), as the test vectors of the observation are written.
  • A reader reads it strictly: a field that the message does not have is refused, as protojson.Unmarshal and fromJson refuse one by default, while the transport skips one. So a file of a later tag of spec, with a field added, is refused by a reader of an earlier one, which names the field, until the reader takes the later tag.
  • A crop's PNG is an image of 8 bits, not interlaced, of the crop's width and height — grey, colour type 0, when none of the strokes it draws has a style, and RGB, colour type 2, when one has —, whose IDAT is one zlib stream with nothing after it, each row with a filter of PNG, 0 to 4; and its chunks are IHDR, IDAT and IEND alone: no ancillary chunk, neither tEXt, iTXt, zTXt, eXIf and tIME, which hold text, metadata and a time, nor any other, a private one too. A decoder may skip an ancillary chunk, so nothing of the crop is in one.
  • A sample that breaks a rule of this section is not valid, and a reader refuses it.

Where a sample goes.

  • A sample of measurement by an adult goes to the organizer of the measurement, outside git and outside the platform's server, and from there to the providers of AI that the measurement names (П-18).
  • A sample of an eval set goes to the organizer of the eval set, who adds it to a module's eval set in modules, where it is published under Apache-2.0 and never withdrawn (П-16). Its markup is published with it, the texts of its parts and an essay's truth too, so the organizer looks for a name in them as on the sheet.
  • A sample of a child lies outside every repository, in the operator's closed bucket, with a separate consent, for two years from its session. A runner MUST NOT send a sample whose writer is WRITER_CHILD to a provider of AI until the admission table admits to that provider the work of a child under 13, the strictest category, since the file holds no category.
  • No sample goes to the platform's server.

Checking a sample. A repository other than spec checks its sample files by the code that holds the examples below to this section, at the tag of spec it pins, and MUST NOT write a check of its own: just -f spec/justfile sample-check <file>…, from its root, in its toolchain stage.

  • Each path is the repository's, from the folder the check runs from, its root: a path that leaves it, a link in it that leads out too, or a path that names no file stops the check before it reads any, and a file named twice is read once.
  • The message is the one of the image buf builds of the contracts/ of the repository's spec submodule. buf reaches no service, since buf.yaml has no deps, and no key is needed, so a pull request from a fork runs the check too.
  • Each file is read and held to this section and to the rules the device and the runner share as an example is, and nothing is asked of the files together but in the mode of a module's eval set (below). A rule a file breaks is named by its file and line, file:line: message, and the check exits with the status 1. A path it refuses, an image buf cannot build or one with no Sample, and a call that names no file stop it with the status 2: a check of no file passes none.
  • The files are read one at a time: only the file being read is held whole, and of a file read only what the files together are held to stays — its ID, and for report-check what a report is held to of it, its markup among it —, so that one call checks a module's eval set of hundreds of large samples with no batches.
  • A module's eval set: just -f spec/justfile sample-check --eval-set <module> <file>…, with the module's ID, <publisher>/<name>, and the files of its folder eval/. Each file is checked as above, and the files that hold are held together to the rules of eval sets that need neither the module's package nor a key: each is of the purpose PURPOSE_EVAL_SET, with its markup, of a task whose source is modules with that ID, and no two share an ID. That the files are the whole set, the task itself and the digest of its open view are not checked: the repository names the files, and the runner checks the task by the package. An ID that is no module's stops it with the status 2, as a call that names no file does.

Examples. contracts/examples/eval/v1/<case>.json, but those whose case begins with report-, a runner's report, holds synthetic samples, each with its markup.

  • One of each row of the table above: a sheet of measurement by an adult, a sheet of an eval set by an adult imitating a child, and a workbook of measurement by a child. Their strokes come from the test vectors of canvas, and their groups, crops and PNG from the code of canvas, at its commit 602945b.
  • Two more: a sheet of measurement by an adult whose solution has a drawing, a number line with its first error, and an essay of an eval set by an adult, with the people's marks. Their strokes were drawn by the synthetic hand of tutor at its tag v0.1.1, their groups and the numbers of their crops come from spec's implementation of the rules the device and the runner share, and the pixels of their crops from the code of canvas at 602945b, whose numbers are the same.
  • One more: a sheet of measurement by an adult in styles — «123» in liner and in pen and an underline in marker, which an eraser that takes a part cut short. Its strokes were drawn for spec, its groups and the numbers of its crops come from spec's implementation of the rules the device and the runner share, and the pixels of its RGB crops were drawn by those rules outside the repository.
  • None was written by the samples page, so each has canvas_version "0.0.0" and text_set_version "none".
  • They answer tasks of the file of open tasks of tutor v0.1.1, and each markup says what its strokes show, which is not always a right answer to its task.

spec's checks hold each to this section and to the rules the device and the runner share (just contracts-check), and Go reads each back as it is written (the test of the module of the contracts). Together they show every purpose, writer, ink, surface and event of the history, a stroke with a style and one without, every kind of part, parts and marks, a first error, a final answer and a workbook's truth; the check refuses a purpose, a writer or a kind of part added to the package until this section names it.

12. The rules the device and the runner share

  • The device, canvas, and the eval runner of tutor follow the same rules of the strokes on a sheet and a page: how a history of writing folds, which strokes make a group, how a crop is drawn, which strokes a box of a model takes, and which box of a workbook a stroke fills. They are canvas's rules as it wrote them, and every writer and reader of a sample file follows them.
  • Every rule counts in whole numbers. A place is taken in whole tenths of a unit, round(10 × v), a half rounded up: 100.05 units are 1001 tenths. A time is taken in whole milliseconds, round(t), a half rounded up too. After that a rule only adds, subtracts, multiplies and compares, and each number that is not whole is one division of two whole numbers. Every whole number stays below 2^53, so a double holds it exactly, and so does an int64, and IEEE 754 rounds each division alike in every language. A sample writes its places to a tenth and its times whole, as the sample file says, so the rules round nothing of a sample.

The history of writing. A history folds into the strokes the sheet shows at the end by adding and taking off IDs alone, with no rule of the stack of undo: write adds its stroke, erase and clear take off the strokes they name — a clear reads as an erase —, cut takes off the strokes it names and adds its pieces, and undo takes off the strokes it removed and adds back those it restored: of a cut, the pieces, and the strokes it cut.

  • The history the element keeps holds one event more, tutor, the tutor's act in grown-up mode: it adds its strokes, new IDs of the pointer "tutor", and takes off the strokes it names, and an undo of it takes off its strokes and adds back those it took off. A sample file never holds one — its message HistoryEvent has no such event —: the tutor's strokes are no learner's writing.
  • A stroke is written when its last point is, or later: a stroke that ended without its pointer coming up, while another action landed, lands no sooner than that action, so that the events stay in the order of their times.
  • The history the element <novatrail-canvas> keeps, HistoryEvent of @altnovatrail/spec/canvas, is that of a sample written otherwise: its event's kind is the field the event sets, its t is t_ms, a stroke's kind is its pointer, a style's pen is PEN_KIND_ and its kind in capitals, a piece's of and stroke are its own, and a point's t its t_ms, each time rounded to a whole millisecond. A point's pressure, p, does not go into a sample; the element keeps it to draw the width of a pen's line, and never makes it up: without a pen's pressure, the width of a line of the kind pen comes from the pointer's speed, by the times of its points.

The groups of strokes. The groups are made of the strokes the sheet shows at the end, each with its points and their times.

  • A stroke's box is the box of its points, in tenths, and its span runs from the earliest time of its points to the latest.
  • Two strokes are neighbours when the pause between them is no more than 2000 ms and the gap between their boxes no more than 500 tenths, 50 units, across, and no more than 500 tenths down. The pause runs from the end of the earlier's span to the start of the later's, and is 0 when the spans overlap; a gap is 0 where the boxes touch or overlap. Each bound is in.
  • A group is the strokes that a chain of neighbours joins. The groups are labelled by their place, A to Z, then AA, AB and on: by the box of the group's points in tenths — its top, then its left, its bottom and its right —, then by the earliest start of its strokes, then by its least ID. A group names its strokes' IDs ascending.
  • A stroke written and not shown at the end — erased, cut, cleared or taken off by an undo — is in the groups of the strokes shown that would be its neighbours, by the same rule with its own box and span: in none when it would neighbour none, and in each of two groups when it would neighbour a stroke of each. tutor's runner counts by it what was erased, and in which group.

The crop. The crops of a set of strokes are drawn from their points, with their groups — on a workbook, none —, at each height of a digit D asked for, a whole number of px from 1 to 256.

  • B is the box of all their points, in tenths.
  • A stroke whose points span 150 tenths, 15 units, or more from top to bottom is in a bundle; a lower one is a line — a dot, a minus, the bar of a fraction, an underline — and joins nothing. Strokes whose boxes touch or overlap, a gap of 0 both across and down, are one bundle, by a chain, whatever their times. A bundle's height is that of the box of its points.
  • h_med is the lower median of the heights of the bundles, the ⌊(n − 1) / 2⌋-th from the lowest, in tenths, or 150 when there is no bundle. The scale takes H = min(h_med, 1000). The rule takes printed lowercase letters as it takes any stroke: each is a bundle about half a digit tall, and where they are half the bundles, h_med falls to their height.
  • A stroke's line on a crop drawn at D′ is N / (12 × H) px wide: without a style, N = H × max(D′, 12), the line max(D′, 12) / 12 px; with a style of width W, in whole tenths, N = 12 × max(W × D′, H), the line its width at the crop's scale and 1 px at least. A pen's line is drawn at its width, with no pressure and no speed. A set's widest line has the largest N, N_max.
  • D′, the height drawn, is the first from D down for which the crop fits: with the margin m = max(12, ⌈N_max / (24 × H)⌉ + 1) px, half the widest line and a pixel, 12 px at least, w₀ = ⌈(B.xmax − B.xmin) × D′ / H⌉ + 2 × m and h₀ = ⌈(B.ymax − B.ymin) × D′ / H⌉ + 2 × m, the width is max(w₀, 200) and the left margin m + ⌊(width − w₀) / 2⌋, and the height and the top margin alike; it fits when max(width, height) ≤ 1568 and ⌈width / 28⌉ × ⌈height / 28⌉ ≤ 1568, the limits taken from Claude's standard size of an image. At D′ = 1 a crop always fits.
  • scale, s, is 10 × D′ / H px to a unit, and line_width is N_max / (12 × H) px.
  • sheet_box, where the crop with its margins lies on the sheet, in units, is [(B.ymin × D′ − top × H) / (10 × D′), (B.xmin × D′ − left × H) / (10 × D′), (B.ymin × D′ − top × H + height × H) / (10 × D′), (B.xmin × D′ − left × H + width × H) / (10 × D′)].
  • The frame of a group, with g the box of its points in tenths, r = N + 24 × H for the largest N of its strokes, X(x) = 24 × ((x − B.xmin) × D′ + left × H) and Y(y) = 24 × ((y − B.ymin) × D′ + top × H), is [⌊1000 × (Y(g.ymin) − r) / (24 × H × height)⌋, ⌊1000 × (X(g.xmin) − r) / (24 × H × width)⌋, ⌈1000 × (Y(g.ymax) + r) / (24 × H × height)⌉, ⌈1000 × (X(g.xmax) + r) / (24 × H × width)⌉] in whole thousandths of the crop: the group's ink, its points widened by half its widest line and the pixel at its edge, rounded outward, so that every pixel the ink touches lies within it, and its min is less than its max.
  • A crop is drawn on white, its strokes by their IDs ascending, each a line through its points, round at its ends and joins, of its line's width, laid as one layer, so that where it crosses itself it is no darker: a stroke without a style black and opaque; of the kind pen or liner, its colour at its opacity over what lies under it; of the kind marker, what lies under it multiplied by its colour, at its opacity.
  • The rule gives the numbers of a crop, not its pixels: two implementations may draw a crop a level of a channel apart. The form of a crop's PNG is the sample file's.

Snapping. A tutor's mark on a sheet takes the strokes that a box of a model, on a crop of the work, snaps to. The box is in whole thousandths of the crop's height and width, a CropBox as the observation writes it, and the strokes are those of the submission, of its groups: a stroke written after it is in none, and no box takes it.

  • With the crop's D′, width w and height h, its margins my at the top and mx at the left, and B and H of its set, a point (x, y) in tenths lies on the crop at X = 1000 × ((x − B.xmin) × D′ + mx × H) and Y = 1000 × ((y − B.ymin) × D′ + my × H): its place in px, times 1000 × H.
  • The box widened by 250 thousandths of D′ holds the point when (xmin × w − 250 × D′) × H ≤ X ≤ (xmax × w + 250 × D′) × H and (ymin × h − 250 × D′) × H ≤ Y ≤ (ymax × h + 250 × D′) × H, its edges in. That is the box laid on the sheet by sheet_box and widened there by H / 4; it widens first, and is clipped to the sheet after.
  • The box takes a stroke when it holds k of its n points with k ≥ 1 and 3 × k ≥ 2 × n: two thirds of them at least. What it gives is the IDs of the strokes taken, ascending, and the box of their points, in tenths; or none, when it takes no stroke, and the mark then has no place on the sheet.
  • The margin, 250, and the share, two thirds, are parameters of eval: eval may choose them anew by its own data.
  • Snapping takes the strokes as they came: on the device, those of the submission; in eval, those a history of writing shows. The final geometry of a sample is no input of it: its points along a stroke may be other than those that came, as the sample file allows, so a box holds another share of them than of the strokes as they were written, though their boxes, groups and crops are the same. So eval chooses the margin and the share, and measures snapping, on samples with a history alone.

The boxes of a workbook. A stroke on a workbook's page is in one box or in none — the draft —, each stroke by itself and with no time. A box's L, T, W and H are its left, top, width and height in tenths, 10 × those of its PageBox, and x0, x1, y0 and y1 the least and the most of the stroke's points in tenths.

  • A box holds the stroke when its size and its middle do: 1000 × (x1 − x0) ≤ 1600 × W and 1000 × (y1 − y0) ≤ 1600 × H; and 2 × (1000 × L − 120 × W) ≤ 1000 × (x0 + x1) ≤ 2 × (1000 × (L + W) + 120 × W), and the same down with y, T and H.
  • Of the boxes that hold it, the stroke's is the one with the most of its points in the box widened by 120 thousandths — 1000 × L − 120 × W ≤ 1000 × x ≤ 1000 × (L + W) + 120 × W, and the same down —, and of those the earliest in the task's order, by item, then by slot. A stroke no box holds is the draft.
  • A box is filled when it is a stroke's box. The table "box → stroke IDs" lists the filled boxes in the task's order, the IDs of each ascending. The draft goes into no box and onto no crop.

Test vectors. The test vectors hold these rules: contracts/vectors/eval/v1/, four files, each { description, rule, cases }. rule gives the numbers of its rule above. Each case is { name, description, … }, its name unique in its file and in kebab case, with the input of the rule and what the rule gives: messages of the package written in JSON as the rules of JSON above have it, with every field, its zero too, and beside them what no message holds. Their sheet is canvas's, 1000 units across and 1400 down, and so is a workbook's page; every point lies on it.

  • groups.json: history, a History; visible, the IDs of the strokes the sheet shows at the end, ascending; neighbours, the pairs of them that are neighbours, [a, b] with a less than b, in order; groups, each a Group, and group_boxes, the box of each group's points, a TenthsBox; and erased, each stroke written and not shown, by ID ascending, { stroke_id, labels }, the labels of its groups in their order.
  • crops.json: digit_height, the module's; strokes, each a FinalStroke, and groups; bundles, the IDs of each bundle, ascending, the bundles by their least ID; and crops, a CropSet, its PNG empty: the vectors hold no pixels.
  • snaps.json: digit_height, strokes, groups and crops, as in crops.json; and snaps, each { digit_height, box, stroke_ids, snapped }: a box of a model, a CropBox, on the crop drawn at that height, the IDs of the strokes it takes, and the box of their points, a TenthsBox, or null.
  • boxes.json: boxes, the page's, each a PageBox, in the task's order; strokes; verdicts, each stroke's box by its ID, { stroke_id, answer_slot }, an AnswerSlotPlace or null; and filled_boxes, each a FilledBox without its crops.
  • The cases are those of canvas's vectors at its tag v0.1.2, commit 8e9c6f6, written in this form, a history without pressure and in whole milliseconds; groups.json adds the groups of the strokes taken off, which canvas does not draw, and cases of its own. The cases of strokes with a style and of a cut — the last two of groups.json and of crops.json — are spec's own, computed by its implementation, until canvas writes its own.
  • spec's checks compute each, as a second implementation (just contracts-check). canvas's CI passes them all, from the npm package @altnovatrail/contracts, and tutor's, from contracts.Vectors, each at the tag of spec it takes.
  • A rule changes only in spec, by a task that changes this section, the vectors and spec's implementation together; canvas and tutor bring a change as a row «в реестр spec» of their RUN.md. A change that gives another result for the same input — another group, another number of a crop, another stroke taken or box filled, the margin and the share of snapping too — changes what the package means, and comes as a new package, as the rules of versions say. A case that pins what this section says already only adds.
  • Together, the vectors give a history with each event that takes strokes off, a cut among them, a stroke taken off in no group and one in two, a crop with no bundle, one with h_med above 1000, one drawn below the height asked, one of strokes with a style and one whose margin a wide line widens, a box of a model that takes strokes and one that takes none, a stroke of the draft and a filled box.

13. Eval sets

  • An eval set is samples, each a sample file with its markup, on which the eval runner of tutor measures how AI reads work. A model is admitted for a capability of AI once it passes the eval set of the capability and the eval sets of every published module with that capability; the rule of admission — its bounds, its targets, how many repeats — is tutor's.

  • A module's eval set is every file in its folder eval/, at any depth, whose name ends in .json, letter case and all; a file or folder whose name begins with . is no part of it, as it is none of the module by the module format's rules of a module. Any other file in eval/ is no sample, and the runner reads none. Where the samples lie within eval/ is for the repository that holds the modules to decide: the layout of a module lets it hold any file at eval/<path>, and the format does not change.

    • Each file is a sample of the purpose PURPOSE_EVAL_SET, with its markup, of a task of its own module: its source is modules, with the module's ID. No two samples of a set share an ID. These rules need neither the module's package nor a key, and sample-check --eval-set holds them, as the CI of modules runs it on every pull request, from a fork too (see "Checking a sample" in the sample file, above); the rules below that need the package are the runner's.
    • The eval set is no part of the module's package, by the module format's rules of packages: a new sample changes neither a verdict nor a digest, and the runner takes the samples from the module's folder at the commit it checks.
  • The task. Of a module's eval set, the runner takes a sample's task from the package that module-kit builds of the module at the commit checked — in the CI of modules, the pull request's —, by the task's ID and, of a template, the seed. The tag, the version and the package's digest that the sample names say only what it was made on, and are not compared, but the digest of the task's open view MUST be the sample's. Of any other eval set, the runner takes the task at the source and the digests that the sample names.

  • Refusal. The runner refuses a sample, sends nothing of it to AI, and names it in its report with the reason (see the runner's report, below), when:

    • it breaks a rule of the sample file or of the rules the device and the runner share, which the runner holds by the same code as sample-check, or its markup does not fit its task: a truth that is no valid observation of the task or gets no verdict, a final answer where the task has no slot bound anywhere, a mark of a criterion its rubric does not have;
    • it has no markup;
    • its task is not the one it names: no such task, in a module's eval set a task of another module, or an open view of another digest;
    • a child wrote it, until a contract with the provider admits children (П-3).

    A run of a module's eval set that refuses a sample does not pass, and neither does the pull request it checks. A pull request that changes the open view of a task re-makes or removes its samples in the same pull request.

  • A capability's eval set is tutor's: samples of any purpose, of tasks of any source, by their tags and digests. Where it lies and what it holds is tutor's to decide, and samples of measurement and of children stay outside git (П-10 and П-18). A capability whose input is no sample — the tutor's words, with their points on gender and safety — has an eval set of its own form, tutor's too.

14. The runner's report

  • The runner's report is what the eval runner measured in one run of an eval set, for one capability of AI: the message Report of the package novatrail.eval.v1, one JSON file to a run, written and read as the sample file is (see "Writing and reading" in the sample file, above). It holds no value, text, stroke or crop of any work: only the IDs of samples, places, verdicts and marks. The CI of modules reads it, and so does tutor's rule of admission; the log of a run, with what each model answered, and the reports for people, in Markdown or CSV, are tutor's own.
  • protocol is as in a sample file; runner, the tag of the release of tutor whose runner made the run; capability, CAPABILITY_HANDWRITING_READING, reading the values of the answer slots on a sheet or a workbook, or CAPABILITY_RUBRIC_ASSESSMENT, assessing an essay by its rubric on the whole path: the essay read, and what was read assessed. A run of reading measures no essay, and a run of assessment nothing but essays.
  • readers are the models that read, each by its provider and by the model as the list of admitted models names it, with its setting: in a run of reading the two of a pair, in its order, or one; in a run of assessment one, beside assessor, the model that assessed.
  • verdicts names the code that gave the verdicts, with the tag of its release: VERDICT_CODE_MODULE_KIT, as in the platform's work, or VERDICT_CODE_RUNNER, the runner's own. Only a report whose verdicts module-kit gave admits a model; one of the runner's own code is a measurement.
  • The eval set is module, a module's, by its ID and the commit of modules whose eval/ was read, or capability_set, a capability's, by the name tutor gives it; repeats, how many times each sample was read.
  • samples holds each sample of the set that the capability measures, ascending by ID, with refused and the reason of its refusal, as eval sets have it — REFUSAL_INVALID, REFUSAL_NO_MARKUP, REFUSAL_OTHER_TASK or REFUSAL_CHILD —, or measured:
    • in a run of reading, each answer slot that a model reads and whose check gives a verdict, in the task's order — on a workbook its filled boxes, since an empty box goes to no model, and on a sheet that shows no stroke none, since it has no crop and nothing of it goes to a model, so that it is measured with no answer slot, as a page with no filled box is: truth, the verdict on the truth of the markup; mirrored and crossed_out, its notes; and readings, one for each repeat, in order: the verdict on the observation of the readers, joined when they are two, as the observation joins them, and beside unchecked alone its cause, UNCHECKED_CAUSE_FAILURE when AI failed, UNCHECKED_CAUSE_LIMIT when a limit or a quota ran out, UNCHECKED_CAUSE_INVALID when an observation is not valid, or UNCHECKED_CAUSE_CHECK when the check of the answer slot gave no verdict on a valid observation — its predicate gave an error or a result that is not a bool, or ran to its bound of steps or to the clock of the code that gives the verdicts, as the module format's checks have them;
    • in a run of assessment, essay: truth, set only when the truth holds no text, UNREADABLE_BLANK or UNREADABLE_ILLEGIBLE; people, the marks of the markup; and readings, one for each repeat: assessment, when AI marked one criterion of the rubric at least, with the mark it gave each criterion the people marked, in their order — met, not met or none, so that each is none when AI marked only criteria the people did not agree on —; unreadable, the essay read as blank or illegible; or unchecked with its cause, among them UNCHECKED_CAUSE_NO_MARK, an assessment that marked no criterion of the rubric, and never UNCHECKED_CAUSE_CHECK: a rubric has no predicate.
  • A verdict is written as the test vectors of verdicts of the module format write one: verdict, correct, not_yet, unreadable or unchecked; reason, beside unreadable alone; and trap, the trap that a wrong value shows, beside not_yet alone; each empty where there is none.

The measures. A report holds no totals: the measures are counted from its records, all repeats together, by these rules, and any reader can count them again. T is the verdict on the truth, and R the verdict on a reading.

  • In a run of reading, the unit is an answer slot in one repeat.
    • False alarm, the main measure: R is not_yet, and T is not. Its share is among the readings whose T is not not_yet and whose R is not unchecked. A digit written mirrored, whose T is unreadable, counts in it.
    • False correct: R is correct, and T is not; among the readings whose T is not correct and whose R is not unchecked.
    • Needless "unreadable": R is unreadable, and T is correct or not_yet; among the readings whose T is one of those and whose R is not unchecked.
    • "Unreadable" kept: T and R are both unreadable; among the readings whose T is unreadable and whose R is not unchecked.
    • Another trap: T and R are both not_yet, with different traps; among the readings whose T and R are both not_yet.
    • Unchecked: R is unchecked, by its cause; among all the readings. UNCHECKED_CAUSE_CHECK is the task's, not the model's: a predicate that fails on a value the model read is a flaw of the module's condition, and the measure, counted by its cause, does not lay it on the model.
    • Each measure is counted apart too on the answer slots noted mirrored, and on those noted crossed_out.
  • In a run of assessment, a reading of an essay whose truth holds its text, and which ends unreadable, is needless, among those that do not end unchecked. The unit of the rubric is a criterion that the people marked, in a repeat whose essay was assessed, and which AI marked met or not met:
    • False alarm, the main measure: AI marks the criterion not met, and the people met. Its share is among the people's marks met, by criterion and in all. AI's marks of none are counted apart.
    • Agreement: the share of AI's marks that are the people's.
    • Cohen's kappa, for each criterion: (p_o − p_e) / (1 − p_e), with p_o the agreement, and p_e the sum, over met and not met, of the share of the people's marks and the share of AI's that are it, multiplied; when p_e is 1, there is none.
  • The bounds of a share, its target and how many repeats a run takes are the rule of admission's, tutor's. So are the measures of the other capabilities, such as the analysis of a solution by its parts and its first error, and a hint: the markup holds their data. Of a synthetic sample, the first error and an essay's marks are its code's choice, and the rule of admission counts no measure on them, as the sample file says.

Where a report goes. A report names its models and their providers. A run of an eval set at a provider, and a report of it published, follow that provider's terms: beyond OpenAI and Anthropic, some providers forbid benchmarking, and one its publication without consent. A log of CI that anyone can read publishes what it prints. A report that names samples of measurement or of a child is not published: it lies where they do (П-10 and П-18).

Examples. contracts/examples/eval/v1/report-<case>.json holds synthetic reports of the samples beside them (see the sample file's examples, above): a run of reading on a capability set of those samples, which refuses the child's, and a run of assessment of the essay, in three repeats. No runner made them: their runner and the code of their verdicts are v0.0.0, their models are stand-ins named example, and their readings are made up; the verdict on each truth is the one the check number gives with the key of its task in tutor's bank at v0.1.1. spec's checks hold each to the form of this section and, once the samples beside it hold their own rules, to them: it names each that its capability measures, and only those, a child's is refused as such, the answer slots are those of the truth that a model reads — none on a sheet that shows no stroke —, with its notes, and an essay's people's marks are its markup's. Go reads each back as it is written. Together they show every capability, a refused and a measured sample, every verdict a reading gives and every mark AI gives a criterion, and the check refuses a value that the package adds to an enum of the report until this section names it.

Checking a report. A repository other than spec checks its files of the runner's report by the code that holds the examples above to this section, at the tag of spec it pins, and MUST NOT write a check of its own: just -f spec/justfile report-check <report>… [--samples <sample>…], from its root, in its toolchain stage. Each report is read strictly, by the image buf builds of the contracts/ of its spec submodule, and held to the form of this section. With --samples, each sample named after it is checked as "Checking a sample", in the sample file, checks it, one file at a time, no two of them have one ID, since a report names a sample by its ID, and, once all of them hold, each report is held to them as the examples are held to the samples beside them: a report on a capability set names every one of them that its capability measures, and each sample a report names is one of them. Its paths and statuses are those of sample-check, and so is its line file:line: message for each error, while its last line, report-check: ok — … or report-check: <n> errors, is its own. The measures are not checked: the runner counts them (above).

15. The contract between app and api

  • The contract between app and api is the package novatrail.api.v1: the services that app calls on api by Connect, one package for all of them, with one list of causes. This section is its text: the checking of an attempt, AttemptService of attempt.proto; the account and its profiles, AccountService of account.proto; and the way from a module to a task — what a package gives by its digest, PackageService of package.proto, the modules of a learner, ModuleService of module.proto, the engine's choice, the preview of the goal for the tutor, the beginning of an attempt and lessons, LearningService of learning.proto, and the skill map, the cognitive map with its history and indicators, the adult's progress and the adult's correction of a module's level, ProgressService of progress.proto; the legal texts, LegalService of legal.proto; the stored works, WorkService of work.proto; and the task from the learner's paper, PaperService of paper.proto; and the debug mode, DebugService of debug.proto. cause.proto holds what they share: the causes, and the values that come both in answers and in refusals. Which requests there are, with what comes and goes in each, api's detailing proposed; what both sides know is the contract's, and how api keeps it is api's code: the order of its checks, its records of idempotency keys and how long they live, the reserve of its quota, CORS, its codecs and which place the program gives a mark.
  • Every request on an attempt, a lesson run or an engine's choice names the profile, profile_id, and the attempt, the run or the choice by its ID: api reads each by the pair. One of another profile, or none, gets CAUSE_NOT_FOUND, and a profile that is not the account's CAUSE_NO_PROFILE. A request whose form the contract refuses — a field it needs left out, a place the task does not have, a method the task's kind does not take — gets the code invalid_argument with no Refusal.

Refusals and outcomes.

  • A request that was not done is refused: an error of Connect with the standard code that the cause's comment gives, and the detail Refusal, its cause and what it tells beside it. A method's comment names its refusals.
  • A request that was done answers, and the answer says what changed for the learner. A call of AI in it that gave no reading or no words is an outcome, Outcome, in the answer, not a refusal: a failure of AI, the quota with when the next family day begins, the limit of platform AI, no admission, and of the learner's own key the limit reached, with why, or the key refused. "Explain differently" is the one request on an attempt that makes no call of platform AI without the reserve of the quota: there the quota, the limit of platform AI and no admission are refusals, and the right to it on the rung stays.
  • A request's message larger than api reads — 11 MiB, so that the scan of a consent form, up to 10 MiB, fits with its request — gets the code resource_exhausted with no Refusal, before it is parsed; PutWork names how app reads it.
  • Cause is one list for both: why a request was refused, or what a call of AI came to. A verdict's reason is no cause: it is the module format's and the observation's. Why an attempt was closed, CloseReason, how a lesson run ended, RunEndReason, and how a submission of an essay ended, SubmissionEnd, are values of their own, which come in answers and in the data of a refusal.
  • A cause that the build of app does not know, it reads by the code of the error; an outcome it does not know, as a failure of AI. It words neither: the words are app's, in the language of its screen, and the server sends no text of a cause.

Sign-in. Every request carries the ID token of the sign-in service in the header Authorization, as Bearer <token>; only the open views of PackageService, the files of a package's device part and the legal texts of LegalService go without one (below). The comment of AccountService names the refusals that every request with a token may get, and what app does on each:

  • app reads the cause of a refusal before it refreshes any token.
  • unauthenticated with no Refusal — the token has expired, is revoked, or its user is disabled: app refreshes the token and repeats the request, and opens the sign-in window only if the refresh failed. Signing in again is signing in as the same user, without signing out, since signing out erases everything of the account on the device.
  • CAUSE_FRESH_SIGN_IN_NEEDED, also unauthenticated: the action needs a sign-in no older than the refusal's max_auth_age_seconds. app signs in again by the window, on a press, and repeats the action. Whether a sign-in is fresh it reads by the authTime of a token it has just refreshed, against that token's issuedAtTime, not against the clock of the device; on auth/user-mismatch it asks GetAccount.
  • CAUSE_ACCOUNT_GONE, also unauthenticated, with no data: the account is being deleted or was deleted, or the sign-in service has no such user. app erases everything of the account and signs out, without refreshing the token: a refresh would sign the deleted user out with the error of a revoked token, and the device would not know why.
  • CAUSE_NO_ACCESS: the user has no account, and may only create one. While the registry of the device holds an account, it means that another account has signed in, and app erases what is left of the one before it opens anything.
  • unavailable with no Refusal: the token could not be checked, and app repeats the request after a growing pause, for a short while.
  • A request without the right it needs gets the code permission_denied with no Refusal. A method on a profile names its right, can_manage, can_learn or can_view, which lets an adult view the skill map, the cognitive map, the progress and the share of the quota; a method on the account itself — the PIN, the creation of a profile, the account's export and deletion — needs the account of the token alone: it is an action of an adult, and the PIN in front of it is a barrier of the interface. The fresh sign-in is checked last, after the right.

Versions and origin.

  • app reads the major package it was built with, as the rules of versions say, and api holds the current one and the one before. A method that api no longer holds answers unimplemented, and only then, or for an open view in a version of the module format that its build does not read, or for a part of the export in a version its build does not write, does app offer to reload. The contract names no version of api: inside the major package an older build works with a newer api.
  • A value of an enum that its build does not know app reads as the comment of the enum says, and never writes it back: a change of a profile sends only the fields that changed.
  • api stands on the origin of app or on its own (Т-17). On its own, it answers CORS to the exact origin of app on every path and every answer, errors among them, and exposes Retry-After. A request carries no headers but Authorization, Content-Type, Connect-Protocol-Version and Connect-Timeout-Ms, so whatever else a request says is a field of its message. How long a preflight's answer lives, and where the origin is configured, are api's.

The idempotency key. A request that must not be done twice carries idempotency_key, a field of its message, since CORS lets through Authorization and the headers of Connect alone: SubmitWork, SubmitEssay, GetRungWords, GetCorrectAnswerWords, ExplainDifferently, GetOpeningWords, AskTutor, AskGrownUp, ShowSolution, ChooseNext, BeginAttempt, FindTasks, BeginPaperAttempts, ReportProblem, RequestChildConsent, SendConsentForm, RestateAge and the requests of the PIN, SetPin, VerifyPin, ChangePin and ResetPin.

  • app makes a key for each action and sends it with every repeat of the action.

  • The same key with another method, another attempt, another profile or another request gets CAUSE_KEY_ALREADY_USED, and a repeat while the first request goes, CAUSE_STILL_GOING, the code aborted: no failure of the service, so that a repeat waiting for a long first one is no server error to a count of 5xx. app knows it by its cause, whatever its code, and repeats it until the limit of its method.

  • A repeat once it is done is answered by what is recorded, with no AI:

    Method A repeat gets
    SubmitWork the verdicts and the reading recorded, and the same next; of the Check that solved a task from paper, solved alone, since its close erased its submissions with their verdicts
    SubmitEssay how the submission ended, repeated, without the text read and the words of the feedback: they are nowhere on the server
    GetRungWords, ExplainDifferently the words the attempt keeps, while it is open; the words of a rung repeated and without marks, which the server does not keep
    GetCorrectAnswerWords an answer repeated without words: the server keeps none, and a response lost is words lost
    GetOpeningWords the model's words the attempt keeps, repeated, while it is open; a fallback text, the same answer
    AskTutor an answer repeated without words: the server keeps neither the question nor the answer
    AskGrownUp an answer repeated alone, with no words and no act: the server keeps nothing of the request or the answer
    ShowSolution no longer used: api answers unimplemented
    ChooseNext the same choice
    BeginAttempt the same attempt and the open view of its task
    FindTasks an answer repeated without frames: the server keeps none
    BeginPaperAttempts the same attempts
    ReportProblem the same report
    RequestChildConsent the same consent, at the limit of consents too
    SendConsentForm the same consent, with the form it sent
    RestateAge the same profile
    SetPin, VerifyPin, ChangePin, ResetPin the same answer: a wrong PIN is not counted again, and a PIN changed or set already is not read as wrong
  • Done and GetHint carry no key: they repeat by the attempt's state. Nor do the other requests of AccountService, which repeat by the state of the account, of ModuleService, PackageService, ProgressService, LegalService and WorkService, and GetOpenAttempt, OpenLesson, GetLessonRun and CompleteLesson, which repeat by the state of the profile, the attempt or the run: two openings of a lesson at once give the one run, and a second "lesson done" on a run that ended passed gets the same answer. A creation of what is there already gets CAUSE_ALREADY_EXISTS, which CreateAccount checks before the code, so that its repeat is not refused for the code it redeemed; a deletion of a profile deleted already CAUSE_NO_PROFILE, and of an account deleted already CAUSE_ACCOUNT_GONE; a change sets the same values again.

The own key and the clock.

  • own_key, the key and its provider by its code in the admission table, goes with every request of a profile of its owner that calls AI, "explain differently" too.
    • api takes it with a profile of the age category adult alone, and otherwise refuses CAUSE_KEY_NOT_FOR_PROFILE.
    • It holds the key in the memory of the request alone, and writes it nowhere.
    • Neither the limit reached nor the key refused moves the call to platform AI.
  • own_key_provider, the provider alone, without the key, goes with BeginAttempt of a profile of the owner that checks the task by the own key, so that api chooses the route to AI for the checks of the beginning and checks no quota; another profile gets CAUSE_KEY_NOT_FOR_PROFILE. Each later request on the attempt that calls AI goes by the own_key it carries, or on platform AI without one, and meets the quota there as an outcome.
  • An engine's choice goes by the route of the request whose answer or refusal gives it, so that it gives nothing that BeginAttempt by the same route would refuse. On a profile of the owner that checks the tasks by the own key, every request that may give a choice names the route: SubmitWork by the provider of its own_key, and when it sends no work, which AI would read, by own_key_provider; BeginAttempt by its own; and ChooseNext, OpenLesson, GetLessonRun, CompleteLesson and Done, which call no AI, by own_key_provider. A submission with own_key_provider beside work or own_key gets invalid_argument. Without a provider, the choice goes by platform AI; another profile that names a provider gets CAUSE_KEY_NOT_FOR_PROFILE. On the own key neither the quota nor the limit of platform AI closes the AI that checks the tasks, and only admission may.
  • clock_offset_minutes, the offset of the device's clock from UTC, goes with a request on platform AI alone, for the family day of its quota, and not with the own key (П-23). A request that calls no AI carries none — BeginAttempt, ChooseNext, the others that may give a choice, and GetQuota: the end of the family day that their refusals, outcomes and shares name is the one api keeps with the account.

What never reaches the device. Before the task is solved, an answer holds no key, no solution, nothing of a check, and no trap: neither the trap catalog nor the trap that a wrong value shows, which the tutor's words alone get, in api, as the module format's trap catalog has it. Nor does any answer hold a technique of the task beyond the IDs given on request, its leading question beyond what a hint asked for gives, the simpler case, a leak phrase, the seed of the attempt, or, to the learner, the marks of the criteria of a rubric. The skill map holds no trap, and the description and trap_advice of a trap reach the adult's progress alone, for a trap that repeats in closed attempts; the titles of a task's skills reach it alone too, for a solved attempt. Once the task is solved, SolvedTask comes (below), with what comes next.

The work.

  • On a handwriting sheet, the PNG of the one crop, without its sheet_box, SheetWork. A task of a module is solved on the sheet of a task from paper, and its crop is the strokes drawn without the tracing paper under them.
  • WorkbookWork, the crops of a workbook's filled boxes, is no longer used: no task is solved on a workbook, app sends none, and api answers it invalid_argument.
  • On a task from paper, PaperWork, the three images of the Check: the task's crop as app cut it, without strokes, statement; the PNG of the crop of the work, crop — the tracing paper at its place with the strokes on it, and the sheet's visible strokes, the tracing paper shown or hidden —, each stroke drawn in its style, in colour; and the crop of the instruction above the task, instruction, as app cut it by the instruction's frame the finding gave, without strokes, a JPEG or a PNG of at most 4 MiB, empty when the finding gave none. An attempt of a task from paper takes paper alone, and one of a task of a module takes sheet, but for AskGrownUp, which takes paper on either.
  • With a sheet, the text of each option the learner tapped on the tracing paper, by its answer slot.
  • Nothing of the writing history goes, nor the context of the submission, which app keeps on the device to give the canvas its marks, nor the groups of strokes and their frames (Т-31), nor the text of an item.
  • The server keeps no crop, so the work goes again for the tutor's words.

The verdict. SubmitWork sends the work of a task with a verdict and answers once the reading has ended, with the verdict on the whole observation.

  • items holds each item of the task, in order, with its verdict, and each of its answer slots with its own. The verdicts and their reasons are written as the module format's checks and the observation have them. value is what was read, which the learner sees, "Read: 6": the value of the observation, or the text of the option tapped.
  • When a call of AI gives no reading, the answer slots that AI reads get unchecked, and outcome says why; a slot bound choice keeps its verdict.
  • wrong_answers counts the attempt's wrong answers, this one's too: a wrong answer is a submission with an answer slot not_yet, and an unreadable, unchecked or so_far_correct one raises no rung.
  • On a task from paper, a slot may be so_far_correct, "So far correct": it has no answer yet, and the Check read a solution with no error in it. It is no verdict: it closes nothing, and app draws no mark for it. tutor_words holds the tutor's words of the Check, after every verdict.
  • solved comes when every item is correct, and the attempt is closed CLOSE_REASON_CORRECT; beside it, next says what comes next (below).

Two requests. The words come in a request of their own, after the verdict: there is no channel of real time (Т-25). A task from paper is the exception: the Check gives the verdict, the tutor's words and the ladder in one call, and the words come in the answer of SubmitWork. After a wrong answer, app asks GetRungWords; after a correct one, GetCorrectAnswerWords: while the tutor's panel is open, or once when the learner opens it, for the last submission of the task on screen that gave "not yet" or "correct"; with the panel closed, app asks neither. An essay is one request, SubmitEssay.

The tutor's words.

  • The words come whole, once they passed the leak check and the form check, or as the fallback text, never in parts.

  • The rung's words. The k-th wrong answer gives the rung k, up to 3; from the fourth on, no rung is new.

    • GetRungWords names the wrong answer it asks for by the wrong_answers of its submission's answer, and sends that submission's work again. A wrong answer that is no longer the last gets CAUSE_NOT_CURRENT, with how many there are, so that the words never speak of a work the learner has written over.
    • The answer is the rung, its words and the marks they come with.
    • When a call of AI came to an outcome, the words are the rung's fallback text and outcome says why; when the words failed a check, they are the fallback text with no outcome.
    • The same wrong answer asked again, or a repeat, gets the words the attempt keeps, with no AI and no marks.
  • After a correct answer, GetCorrectAnswerWords sends the work again, while the profile has begun no other attempt. The right is one answer with words: api spends it when it gives the words, and only then. An answer without words — a call that gave none, with its outcome, or words that failed a check, with none — leaves it, and a request with a new idempotency key sends the work and calls AI again, bounded by the quota on platform AI and on an own key by the key's limit at its provider. An answer with words that was lost has spent it: its repeat gets repeated without words (above). On an attempt that no correct answer closed, and once the words were given, it gets CAUSE_NO_MORE_WORDS. app keeps the work until an answer comes, and with the tutor's panel closed, while the task's screen is open, until the panel opens.

  • Explain differently, ExplainDifferently, is one call of AI on a rung, without the work. It names the wrong answer whose words the learner reads, as GetRungWords does, and one that is no longer the last gets CAUSE_NOT_CURRENT. CAUSE_NO_OTHER_WORDS is its outcome when the words are the ones the learner reads already: the right to it on that rung is spent.

  • The opening question, GetOpeningWords, is "Hint" on a task from paper while the attempt keeps no ladder, before its first Check, which has no techniques and no leading question of an author: it sends the work as it stands, work, to the Check, one call of AI, and gives the first rung of the ladder the Check gives, a question on how to begin the task, or the first of a frame of several. The attempt keeps the Check's answer and its ladder as after a submission, but its verdicts are not shown and count no wrong answer. The model's words the attempt keeps, and every later request gets them, repeated, with no AI; a fallback text, the platform's opening question in the language of the words, it does not keep, so a request with a new idempotency key calls AI again. Once the attempt keeps a ladder it gets CAUSE_NOT_CURRENT, and "Hint" is GetHint's rung. It reserves the quota as SubmitWork does.

  • A question to the tutor, AskTutor, is the learner's own words about a task from paper, typed in the tutor's field or said into it and read before Send: question, at most 500 code points, not empty, with no control character but a line break, else invalid_argument, as is a task of a module. It sends the conversation on the task before it, turns, oldest first, as app holds it in the tab's memory — the learner's questions and the tutor's words, at most 8 turns of at most 1000 code points each —, and the work as it stands, work. One call of AI, the words of a task from paper under hint, by their cascade, gets the question and the conversation as data between their tags, never as instructions, with the tasks of the frame as the Check the attempt keeps gave them and the hints given, and no work; the answer is the tutor's, never the answer or a step the learner has not written, no nearer than the current rung, and passes the leak check and the form check of the tutor's words, else it is the opening question's fallback text, with no outcome. A call that gives no words — a failure, the quota, the limit of platform AI, no admission — is no refusal: the answer holds the fallback text and names the outcome. While the attempt keeps no Check, the Check reads work first, as GetOpeningWords has it, and the attempt keeps it with no verdict shown and no wrong answer counted; it reserves the quota as SubmitWork does. The server keeps neither the question, the conversation nor the answer — not in the log, not in the record of the idempotency key —, so a repeat gets repeated with no words; a question is no rung, moves no rung and counts no wrong answer. What an adult says into the field is the browser's recognition, on the device: the contract carries its text alone, never audio.

  • Grown-up mode, AskGrownUp, is a grown-up's request on a task from paper or of a module, behind the grown-ups' PIN that app asks: an action of an adult, with the right can_manage. It sends the request, question, as AskTutor's, the conversation before it, turns, as AskTutor's, the work as it stands, work, paper alone — on a task of a module its statement the picture app drew of the module's text —, and the strokes the crop of the work shows, strokes, in the order of the sheet, at most 3000: each a SheetStroke, its ID on the sheet and its points across and down in pixels of PaperWork.crop, in pairs, which app thinned to at most 128, with no time and no pressure — the one request whose strokes reach AI as points —, and the free sheet beyond the crop as the element measured it, each a FreeBand in its pixels, absent when none: free_below, across the crop's width, from below the lowest stroke or task's crop there, or from the crop's bottom edge when that is lower, down to the sheet's edge or at most 5000 on, 1 at least; free_right, across its height, the same to the right. One call of AI, drawing of the admission table, by its own cascade, gets them as data between their tags, never as instructions, and has none of the tutor's limits: it may give the whole solution, and its words pass no leak check and no form check. The answer is whole: the tutor's words, words, the strokes to write, strokes, each a TutorStroke of at least two points in the crop's pixels, in the crop or in the free sheet the request named beyond it, with its colour #rrggbb and its width, and the IDs to take off, erase, each one the request named; api holds the act to that, and a model whose act breaks it does not do. A call that gives no act — a failure, the quota, the limit of platform AI, no admission — is no refusal: the answer holds no words and no act, and names the outcome. It reserves the quota as AskTutor does. The server keeps neither the request, the strokes nor the answer — not in the log, not in the record of the idempotency key —, so a repeat gets repeated alone. An attempt of a task from paper gives no evidence, nor does an attempt of a task of a module once the mode acted on it, the one thing api keeps of it, its verdicts still shown: the act moves no progress, and the attempt stays open. app puts the act on the sheet by the element's drawTutor, one event tutor of the history ("The history of writing" below).

  • Hint, GetHint, asks for no AI and sends no work:

    • before the first wrong answer, and on a task with a rubric, it gives the IDs of the task's techniques, empty when the task names none, which is the answer that there is nothing to hint, and the task's leading_question, of the instance the attempt got, empty when it has none — a closed field of the module format's task, which only this answer brings to the learner's app. It MUST be empty with the rung's words: after the first wrong answer the question is no more given. The server records it as given only when it is not empty, as a technique on request, and an open attempt holds it in requested_leading_question;
    • after it, the current rung and its words.

    "What is known and what to find" app shows from the open view of the task: they are open, and the server records nothing of them.

  • A step. No screen leads a task's solving steps: BeginStep and PackageService.GetSolvingSteps are no longer used, app sends neither, and api no longer holds them and answers unimplemented; the open attempt's step_technique_ids is empty. The server records each technique given on request.

The solution shown. No solution is shown on any task: ShowSolution is no longer used, app sends none, and api no longer holds it and answers unimplemented. CAUSE_LADDER_NOT_PASSED, CAUSE_NO_SHOWING and CLOSE_REASON_SOLUTION_SHOWN are no longer given, but for an attempt closed so before.

Marks. A mark of the tutor, Mark, is its kind and its place; the program places it, and it belongs to the words of the answer that brings it, the rung's one question.

  • Its kind is MARK_KIND_FRAME, a frame round the place, or MARK_KIND_WAVY_LINE, a wavy line under it, on a task from paper alone, at a box on its crop, and only while the profile's hint mode is "Show where", HINT_MODE_SHOW_WHERE; with "Questions only" a task from paper gets the words alone, and a task of a module keeps its frame in either mode.
  • Its place is an answer slot by its place, answer_slot, or a box on the crop the device sent, crop_box, in whole thousandths, as the observation writes them.
    • On a workbook, only an answer slot: the box, framed with its strokes, or alone when it is empty.
    • The box of the first mistake that the analysis gives goes as it is, with no translation. On a task from paper it is the box of the first mistake the Check gave, a box on the crop of the Check's work, and the wavy line comes only with the model's words, never with a fallback text or a repeat; app draws it while the tutor's panel is open, and drops it once the work changes or the tracing paper moves, since the box would no longer be under the place it names.
    • A group's label as a place comes only if the frames of the groups go with the work, as a field added to place (Т-31).
  • Its name, which a screen reader reads, app writes in the language of its screen from its kind, its number and its place: "Tutor's mark 1 of 2".
  • app gives the canvas the marks with the context of the submission it kept, as the types of the element <novatrail-canvas> have them: Marks, Mark and Anchor of @altnovatrail/spec/canvas, written by hand and checked against this message.

An essay. SubmitEssay sends the crop of the sheet of a task with a rubric, and its answer is how the submission ended, end, which is no verdict:

  • SUBMISSION_END_FEEDBACK: the essay was read and assessed. text is what was read, as it is written, and feedback the words of the feedback; without them, they failed the leak check or the rule of feedback, and app shows its own phrase "no feedback this time", which is no neutral phrase.
  • SUBMISSION_END_UNREADABLE, with reason, blank or illegible, as a verdict's reason is written: it reached no assessment, and the learner writes the sheet again.
  • SUBMISSION_END_UNCHECKED: outcome says why, and is absent when the assessment assessed no criterion; text is there if the essay was read.
  • closed names why the attempt was closed while the submission went, CLOSE_REASON_UNSPECIFIED when it is open: the feedback comes all the same. A submission on an attempt closed already gets CAUSE_ATTEMPT_CLOSED before any call of AI.
  • Neither the marks of the criteria nor their justifications reach the device.
  • The attempt stays open for writing again, and the learner ends it with Done, after one submission at least, whatever it came to; earlier, CAUSE_NO_SUBMISSION. Done closes it CLOSE_REASON_DONE, and the task is solved: its answer is SolvedTask with next.

The task solved. SolvedTask comes once an attempt is closed by a correct answer or by "Done":

  • keys, each answer slot's key as the module format writes it, of the instance when the task is a template; a predicate or a rubric has none.
  • solution, the task's field solution as JSON of the module format, bytes, and module_format_version, its version; empty when the task has none. app reads it by the types of @altnovatrail/spec, and for a version of the format that its build does not read, it offers to reload.
  • criteria, on a task with a rubric, the text of each criterion, without the marks of the assessment.

The account. GetAccount gives the account of the user signed in: account_id, the ID of the account in api, not the user's ID at the sign-in service; whether the PIN is set; the account's profiles; and the consents for a child that have no profile yet.

  • app reads it when it starts and after signing in, and erases on the device the databases of the profiles that the list does not hold: a profile deleted on another device. It erases only by an answer that came, and for the account that the registry of the device names; a failure of the network erases nothing.
  • A user with no account gets CAUSE_NO_ACCESS, and app asks for an invite code. CreateAccount takes the code, the owner's statement that they are 18 or older, which api keeps with its date (П-6), and the versions of privacy-policy and terms-of-use the owner accepted (below); a code that is not valid, or was redeemed, gets CAUSE_CODE_NOT_ACCEPTED.
  • The tariff of the account comes with what is decided of tariffs (О-14).

Profiles. Profile is a learner in the account as api keeps it: its pseudonym, avatar, age category, country, presentation style, hint mode, language of the interface, grade and goal for the tutor (below). default_mode and ask_before_showing are no longer used — no screen has a mode, and no solution is shown —: api gives them unset, keeps none, and ignores them in ProfileSettings, and app sends none. owner marks the profile of the account's owner, who is of the category adult; a child's profile is of another category.

  • The avatar is the code of a picture of the set of app: no picture is uploaded.
  • The presentation style holds the voicing for now: whether it is on and its speed. Only what changes the words goes to AI from it, and neither the voicing nor the hint mode goes there; of the language, only the name of the one the words of a task from paper are written in. The voice is chosen on the device.
  • The hint mode is "Show where", HINT_MODE_SHOW_WHERE, or "Questions only", HINT_MODE_QUESTIONS_ONLY: whether a task from paper gets the wavy line with the rung's words.
  • The language of the interface is a well-formed tag of BCP 47, which api keeps with no list of its own; absent, app speaks the language of the device.
  • The grade is from 1 to 12, as a module with grades asks for it.
  • The interests of a learner come only once the module format gives a task a look by interests: a field that nothing reads is not kept.
  • The date the age was given and the last activity stay in api.

Settings. ProfileSettings is what an adult sets when a profile is created and changed. A field sent is set; a field left out stays as it is, and on a new profile takes its default, which api gives — whether the voicing is on is such a field of its own, apart from its speed: the hint mode "Show where"; the voicing on at the category under_13 and off at the others, at normal speed. An empty language of the interface or avatar, or a grade 0, clears it. The pseudonym is from 1 to 30 Unicode code points once the spaces at its ends are trimmed, the avatar's code up to 64 ASCII characters, and a country ISO 3166-1 alpha-2; a field of another form gets invalid_argument.

  • UpdateProfile is an action of an adult, with the right can_manage. SetVoicing sets the voicing alone, from the screen of a task: a learning request, with the right can_learn, so the learner sets it as well as the adult, and it holds on every device. SetHintMode sets the hint mode alone, from the profile's menu, the same way, for a learner of the category adult; a child's profile gets CAUSE_ADULT_NEEDED, whose mode an adult sets with UpdateProfile on the profile's page.
  • The country and the age are given again only by RestateAge (below).

The owner's profile and a child's. CreateOwnerProfile creates the owner's profile, of the category adult by the owner's statement, with no age asked. A child's profile is created in two steps, since a consent comes before it:

  1. RequestChildConsent sends the child's age in years, from 0 to 17, and country; an age left out gets invalid_argument. api works out the age category, records a consent that waits, with the category and the country alone, and keeps the age nowhere. A country that the deployment does not take gets CAUSE_COUNTRY_NOT_ACCEPTED, here and on CreateOwnerProfile, the requests that name a country (П-2); the child's profile takes the consent's.
  2. Once a parent's consent is confirmed, CreateChildProfile creates the profile by its ID, with its pseudonym and settings; while it waits, CAUSE_NO_CONSENT. By a consent that the learner gives themselves it creates the profile at once, and the profile waits for it.

The consent. Who consents for a learner is set by the age category, as the table of the age of digital consent sets the category; ChildConsent and the profile's ProfileConsent say it as giver:

  • A parent, for a learner below the age of digital consent of their country. The consent has a code of its request, request_code: ten characters of Crockford's base32 in two groups of five, ABCDE-FGHJK, unique among the consents that wait, which app shows beside the form parent-consent and the parent writes on it. The parent signs the form, and the adult sends its scan, a photo or a PDF of up to 10 MiB, by SendConsentForm; api keeps it apart from its database, in a closed bucket of its own, where the operator checks it against the code and confirms the consent by a command of api, or does not accept it: then form is FORM_STATE_NOT_ACCEPTED, and a new scan takes the place of the one before. A card transaction comes before the public launch (П-28).
  • The learner, from that age on. The profile is created at once, and the learner gives the consent in it before their first work, GiveOwnConsent, by the text teen-consent: a learning request, which a profile below that age gets CAUSE_ADULT_NEEDED for: its consent is an adult's. A learner who reached the age gives it the same way, and confirms by it the consent a parent gave.
  • The owner of their own profile, by the statement that they are 18 or older (CreateAccount).
  • ProfileConsent.need says what the profile waits for before its next work: nothing, the learner's own consent, a parent's — waiting, with its code —, or the age given again. While it waits, a learning request of the profile gets CAUSE_NO_CONSENT, and while the age is to be given again, CAUSE_AGE_NEEDED — but for the requests on the consent itself, which neither refuses: GiveOwnConsent, WithdrawOwnConsent, the learner's ExportProfile, SetWorkStorage switching the storage off, DeleteWork, which goes as switching it off goes, the learner's ListWorks and GetWork, by which app builds the export as by the learner's ExportProfile, and ReportProblem. Only these two causes are lifted: each request keeps its other refusals, and the learner's ListWorks and GetWork get no CAUSE_ADULT_NEEDED, which the learner's ExportProfile gets at a profile whose consent an adult gave. Switching the storage on while the profile waits gets CAUSE_NO_CONSENT.
  • Taking back. CancelChildConsent takes back a consent with no profile: one that waits with its scan, so that nothing of it is left, and one confirmed as a withdrawal, which leaves its minimal record and its scan for their term. Either no longer counts toward the limit.
  • The limit. An account has as many consents that wait, without a profile, as api lets it have, a number api holds; RequestChildConsent beyond it gets CAUSE_TOO_MANY_CONSENTS, code resource_exhausted, with no data, checked after the key: a repeat with the same key gets the same consent, at the limit too.
  • Withdrawal is as easy as giving, by the same interface (GDPR, art. 7(3)), and it is the deletion of the profile with everything of it, which leaves the minimal record of the consent: a parent's consent the adult withdraws by DeleteProfile, and their own the learner by WithdrawOwnConsent, a learning request at a profile whose consent they gave, which a profile whose consent an adult gave gets CAUSE_ADULT_NEEDED for — but for one that waits for the learner's own consent, CONSENT_NEED_OWN: a learner who reached the age of digital consent while a parent's consent stands confirms it by GiveOwnConsent or withdraws it by WithdrawOwnConsent. app offers the export first. DeleteProfile deletes a profile whose learner gave their own consent too, since the owner holds the account, and app says so before. GetAccount shows nothing of a consent taken back or withdrawn.
  • The age again. RestateAge gives the age and the country of a profile again, by an action of an adult: once the country of a learner who gave their own consent raised its age of digital consent — need is then CONSENT_NEED_AGE —; at the yearly refinement, which age_check_due marks a year after the age was given, while the category stays as it is until then; and with a new country. The owner's profile gives its country alone. api works out the category as RequestChildConsent does, and keeps the age nowhere; a new category that needs another consent leaves the profile waiting for it, a parent's with a new code of the request and the version of parent-consent the request names.

The storage of works. SetWorkStorage switches the storage of a profile's works on the server on or off. Switching it on is a consent by the text storage-consent, given by whoever consents for the learner: an action of an adult, ACTION_ADULT with the right can_manage, and at a profile whose learner gave their own consent, the learner's, ACTION_LEARNING with the right can_learn. The other kind of action gets CAUSE_LEARNER_DECIDES or CAUSE_ADULT_NEEDED. Switching it off records when, and erases the copies on the server; Profile.work_storage says whether it is on. A learner who confirmed a parent's consent, at whose profile an adult had switched the storage on, is asked by app whether to keep it, on a screen of its own: a yes is the learner's SetWorkStorage switching it on, which is no repeat there but records the learner's own consent, the learner its giver, in place of the adult's; a no switches it off, after app has offered the export.

Stored works. While the storage of a profile's works is on, the server keeps each work of the profile as the device holds it — the handwriting on a task with a key as well as an essay or a drawing —, put, listed, read back and erased one at a time by WorkService. The server keeps the bytes and reads none of them, and gives none to an AI provider: a work is checked by its picture from the device, as before.

  • StoredWork is the work of one attempt: its writing history, the JSON of what <novatrail-canvas> gives in its own names, in UTF-8; each submission's context, the same way, with how many events of the history it covers, as the device keeps them by the rules the device and the runner share (above); and its picture, the PNG of the strokes the surface shows at the end, as the device draws it. Its size is the sum of the bytes of the history, the contexts and the picture: at most 4 MiB, 4,194,304 bytes. api sets its kind by the attempt's task, or by the work kept of it before — handwriting on an item checked by a key or a predicate, an essay on a task with a rubric, a drawing otherwise — and when it kept it.
  • PutWork keeps the work of an attempt of the profile in place of the one kept of it before: a learning request with the right can_learn, the profile's own. app puts the work when it writes it to the device, at each submission and when the attempt closes at least, and the last one put stands. While the storage is off it gets CAUSE_STORAGE_OFF, and a work over the limit CAUSE_WORK_TOO_LARGE; a message larger than api reads (above, "Refusals and outcomes"), app reads as CAUSE_WORK_TOO_LARGE too. api takes the work's kind from the attempt's task, or from the work kept of it before: a digest of the attempt's package that the index of the image does not know gets CAUSE_PACKAGE_UNKNOWN, whatever work was kept before, which app repeats after a growing pause; a version out of the window of formats that api reads, with no work of the attempt kept before, CAUSE_VERSION_NOT_GIVEN; and a withdrawn version, which the image still holds, gives the kind by its task. On each refusal api keeps nothing of the work, and app keeps it on the device alone. api checks the form alone — the history a JSON array and each context a JSON object, in UTF-8, each history_length from 0, and the picture a PNG by its signature — and a work of another form gets the code invalid_argument with no Refusal, so that every stored work goes into the export.
  • ListWorks names the works kept, newest first, with their kind, when each was kept and its size, without their bytes, and GetWork gives one whole, CAUSE_NOT_FOUND when there is none: a learning request with can_learn, to go on with a work on another device or to export it, or an action of an adult with can_manage. While the storage is off the list is empty.
  • DeleteWork erases one stored work, by whoever decides the storage, as SetWorkStorage, and goes while the profile waits for a consent or for its age, as switching the storage off goes: the other kind of action gets CAUSE_LEARNER_DECIDES or CAUSE_ADULT_NEEDED. Its answer is "erased", for an attempt of the profile with no work kept too; the work on the device stays. Switching the storage off erases them all at once, and deleting the profile or the account erases them with everything else.
  • The export of a profile carries its stored works beside api.zip, not in it, so that no answer is larger than a work: the profile's file of api.zip names them, works of its file, as ListWorks names them, and app reads each by GetWork, one at a time, and writes it into the file of the export, the history and the contexts as the JSON values their bytes hold, not as protobuf's JSON mapping writes bytes, and the picture in base64, as the files of the format of the export hold them.

The versions of the texts. A request that gives a consent names the version of its text that the person saw, LegalTextRef, as GetLegalTexts gave it, and the record of the consent keeps it: CreateAccount those of privacy-policy and terms-of-use, RequestChildConsent and RestateAge that of parent-consent, GiveOwnConsent that of teen-consent, and SetWorkStorage that of storage-consent. A text with no current version is named by no request. RequestChildConsent and RestateAge name parent-consent whenever it has a current version, whoever the category makes give the consent, since only api works the category out, and api records it with a parent's consent alone. A version that is not the current one — a next version before its day among them —, or a text with a current version left out, gets CAUSE_TEXT_NOT_CURRENT: app reads GetLegalTexts again and shows the current version before the person consents once more.

A problem reported. AttemptService.ReportProblem reports a problem with the tutor's words of an attempt, open or closed, from the screen of the task, a learning request with the right can_learn; who sees it, app decides (П-26). It names the answer that brought the words, reply, and beside a rung its number; the words as app showed them, since api keeps none of the words of a correct answer, of the feedback of an essay and of an answer to a question; a word of the closed set, kind — wrong, unclear, not for the age, harmful, personal, other —; and the person's text, up to 1000 code points. The answer is the report's ID and when the operator reviews it by, 3 days after it came. api keeps the report until it is reviewed and for a year after, and the deletion of the profile or the account leaves it to its term without the IDs of the account, the profile and the attempt: the operator may have passed it on. Its words and text stay as they were written, so app asks the person to write no name in it. The operator reads it by a command of api and follows the platform's path of escalation for reports.

The PIN. The PIN of the section for adults is from 4 to 6 digits. It is a barrier of the interface, not of the server: when to ask for it app decides, and no request carries proof that it was asked.

  • Each request of the PIN carries an idempotency key, so that a repeat after a lost answer counts no wrong PIN that was not (above).
  • SetPin sets it while the account has none, and otherwise gets CAUSE_PIN_ALREADY_SET. VerifyPin and ChangePin on an account with none get CAUSE_NO_PIN.
  • VerifyPin answers PinCheck. A wrong PIN counts toward closing the input, and the answer says how many wrong PINs are left before it closes, and when it opens, once this one closed it; while it is closed, CAUSE_PIN_LOCKED says when it opens. app words it in the language of its screen, what went wrong and what to do, and keeps no counter of its own, which would part from the server's (WCAG 2.2, 3.3.1 and 3.3.3).
  • ChangePin changes it by the PIN before it, which counts toward closing the input as VerifyPin counts it. ResetPin changes a forgotten PIN by a fresh sign-in, and opens the input if it was closed.

Checking the own key. CheckOwnKey checks a key of the owner's at its provider when it is connected, on the page where the key is entered, by a request with nothing of a learner's: an action of an adult on the owner's profile of the category adult, which another profile's request gets CAUSE_KEY_NOT_FOR_PROFILE for. The answer is the key accepted, not valid, with no right to the models, or the provider closed to it at the profile, with no call; a provider that gave no answer is the outcome CAUSE_AI_FAILURE. An account has as many checks in a sliding window as api lets it have, a number and a window api holds, and every check counts, a provider closed among them, but a request refused before it — by the profile, the form of the key or the category, which api checks first —: beyond them CheckOwnKey gets CAUSE_KEY_CHECKS_EXHAUSTED, code resource_exhausted, with no call and with when the next check opens, next_key_check, which app tells the owner. ListOwnKeyProviders names the providers whose own key tutor admits at the profile's category for one kind of call of AI that api makes at least — the reading of a work, the words sent with the work, and "explain differently", sent without it —, by the admission table and the models admitted at the deployment's rung, each by its code and name in the table, so that app builds no list in and offers no provider that the check finds closed; at a profile whose category is not adult, none (Т-20).

The quota. AccountService.GetQuota gives the share of the family day's quota of platform AI that a profile has spent, never a sum in dollars and no cap:

  • A learning action, ACTION_LEARNING with the right can_learn, gets the share of its own profile alone, which app shows where the learner begins their work; an action of an adult, ACTION_ADULT with the right can_view, gets the share of the account beside it, in the section for adults. A child never sees what the family spends.
  • A share, QuotaShare, is what the spending of the family day takes of a cap, the profile's or the account's, as its calls were settled, without the reserves of calls still going, so that within a day it only grows: in whole percent from 0 to 100, rounded down, so that 100 is the cap reached; spending past the cap is 100 too. An account whose tariff has no caps has platform AI closed and gets no share.
  • cap_reached says that the settled spending of the profile or of the account has reached its cap, so that no request of the profile on platform AI goes until the next family day: a learner whose share is below 100 may have it closed by the account's cap. Beside a learning action it tells what a refusal CAUSE_QUOTA of a beginning tells with no call of AI — that the quota is closed to the profile —, and no share of the account goes with it. Below the caps, a request may still meet the quota when its reserve does not fit beside the reserves of calls still going, and a new task by handwriting when what is left holds no typical task.
  • next_family_day is when the next family day begins, by the day api keeps with the account: the request calls no AI and carries no clock offset (П-23).
  • The limit of platform AI, which closes it to everyone until the operator opens it again, is no share: app meets it as CAUSE_PLATFORM_LIMIT. The own key spends no quota. The tariff comes with what is decided of tariffs (О-14).
  • The request carries no idempotency key: it repeats by the state of the quota.

Deletion and export.

  • DeleteProfile and DeleteAccount need a fresh sign-in, not the PIN. Their answer is "deleted": of a profile, app erases its database, and of the account, everything of the account on the device, and signs out without refreshing the token. The owner's profile is deleted the same way, and the last profile leaves the account without profiles.
  • Other devices learn of a deleted profile by the list of profiles, and of a deleted account by CAUSE_ACCOUNT_GONE while their token lives, about an hour, and later by CAUSE_NO_ACCESS once the sign-in service has signed them out and a new sign-in is a new user.
  • ExportProfile is an action of an adult, and at a profile whose learner gave their own consent the learner's learning request too, ACTION_LEARNING; a profile whose consent an adult gave gets CAUSE_ADULT_NEEDED for it.
  • ExportProfile and ExportAccount give the part of the export that api holds, with no fresh sign-in: api.zip of the format of the export and its version, the integer of its VERSION in decimal, which app puts into the file of the export as they are, beside the manifest, what the device holds and the stored works, as the files of the format of the export name them. The own key is no part of it.
  • The IDs of an account's profiles, and of the attempts of a profile, that api gives MUST NOT be one once the capital letters A–Z are read as small: they name files and folders of the export, and a reader refuses an export with two such IDs (the rule export.case of reading the format of the export). UUIDs written in one case meet it.
  • A part whose export_format_version is not the version its build of app writes goes into no file: app offers to reload, as it does on unimplemented. A new version of the export reaches api before app, so the build that meets it is the older one, and the reloaded build writes that version.

The legal texts. LegalService.GetLegalTexts gives the legal texts that app shows as its own pages and with its consents: the current version of every text whose place is app, texts — its version in force with the highest number whose day has come, on the day of the request in UTC, by the versions and the passport of the legal texts —, in the order of their IDs by code units. A text with no such version is absent, and while none applies the list is empty.

  • The next version. next_texts gives, in the same order, the next version of every text whose place is app that has one: the version that becomes current on the nearest day still to come, its version in force with the highest number among those of that day. app shows it before it applies, beside the current one, as the version that applies from its day, so that a person reads a change before it concerns them and can withdraw a consent first (sources 3.11). A consent names the current version, never the next one: a request that names the next version before its day gets CAUSE_TEXT_NOT_CURRENT (below).
  • LegalText is the text's ID; the number of its version; in_force_since, the day from which the version applies, YYYY-MM-DD, from 00:00 UTC, a date with no time of day, which a Timestamp would not write; body, the Markdown of the version, in English, as the legal texts write it, with no HTML, no image and no link; summary, the gist of the version, plain text; summary_language, the tag of the language the gist is in, as the passport writes it; and translation and translation_language, the version's translation into the language asked and its tag, empty when the version has none.
  • app names the language of its screen in the request, interface_language, a field of its message, not the header Accept-Language. The texts are in English, and the English text is the one in force: on a screen in another language app says so in it, and shows the gist beside the text, and a version's translation into that language, when it has one, with no force of its own. api gives the gist in the language asked when the passport has it, found as the lookup of RFC 4647 finds it — the tag, then the tag cut by its last subtag, with no regard to case, so that ru-RU finds ru — and else in English; an empty tag asks for English. The translation is found the same way, and when the version has none in the language found, it is empty, with no English in its place: the body is the English. A tag that is not a well-formed one of BCP 47 gets invalid_argument with no Refusal, and the method has no refusal of its own.
  • The method has the idempotency level NO_SIDE_EFFECTS, and app calls it by Connect GET with no token and no ID of a profile, as it calls the open views of PackageService: the policy is read before signing in. The request holds the language alone, in the address, and sets no header, Connect-Timeout-Ms neither, so that it is simple and goes with no preflight; on its own origin api answers it with CORS (above).
  • An HTTP cache may keep the answer, but not for ever, as it keeps an open view, which its digest fixes: the same request gets another answer once a new version comes into force, which a new image of api brings, or, in a self-hosted copy, its operator's folder, which api reads when it starts, and once the day of a next version comes, at 00:00 UTC. api gives the answer a lifetime in Cache-Control of an hour at most, and no longer than until the next 00:00 UTC on which a next version it gives applies. A stale answer misleads no one: each text comes with its version, a version replaced stays readable for ever, and a screen that showed it showed a version of record.
  • The platform's api serves the legal part of spec, legal/, which it takes from the Go module spec at the tag it pins, as spec.Legal. A self-hosted copy's api serves the folder of its own operator, of the same layout, from the path its configuration names, and refuses to start when the folder breaks the rules of reading the part that the legal texts set. The contract is the same for both.
  • Which version of a text a consent was given to, the request that gives it names, and the record of the consent keeps (above, "The versions of the texts").

Open views by digest. PackageService gives the open views of the manifest, the skill graph, the technique catalog and the example tasks of a package by its digest: of the package of an attempt or of a lesson run, and of the current version of a module in the catalog or connected, as long as the image of api gives it.

  • An open view is OpenView: its bytes, JSON of the module format, and beside them module_format_version, MAJOR.MINOR. app and api read it by the types of the module format, and for a version its build does not read app offers to reload. The open views of a lesson and of a task come the same way, with the token, in the answers of LearningService.
  • Its methods of open views have the idempotency level NO_SIDE_EFFECTS, and app calls them by Connect GET, with no token and no ID of a profile: the request holds the digest alone, in the address. It sets no header, Connect-Timeout-Ms neither, so that the request is simple, goes with no preflight, and an HTTP cache may keep its answer.
  • The tiers of the skills, skill_tiers, come with the open view of the skill graph: they are no field of the graph, and the skill map draws them (the module format, on the skill graph).
  • The area of each skill, skill_areas, comes with it too, as the canonical view of the package holds it: the skill's own area, or else the fallback area of its module's subject, which the open view of the graph does not fill in. The cognitive map groups the skills by it (below, "The cognitive map").
  • The counts of tasks and lessons come with the open view of the manifest, task_count, skill_task_counts and lesson_count, which api counts in the package, the same for every viewer: every task once, a template too, for each skill the tasks of which it is a primary skill of an item — the item's own, or the task's for an item that names none —, and every lesson once, whatever age categories it suits. The page of the module shows them, of a module not connected too, which ListLessons gives no lessons of.
  • The example tasks, GetExamples, are those the manifest names in examples, in its order: each by the open view of its task, the same as an attempt of it gets, with its band, its difficulty and the primary skills of its items, which the module format opens for an example alone. An example is no attempt: api records nothing of it, gives no seed, answers no work on it, and the request names no profile, so the page shows every viewer the same examples, and app takes the pictures of their statements as the files of the device part. A manifest that names no examples gets an answer with none.
  • A part the module does not have — a skill graph, a technique catalog, examples — is an answer without its view.
  • A version the image no longer gives, withdrawn or out of the window of formats that api reads, gets CAUSE_VERSION_NOT_GIVEN; a digest that the index of the image does not know, while a deployment goes on, CAUSE_PACKAGE_UNKNOWN, which app repeats after a growing pause.

Files of a device part. The files of a package's device part — LICENSE, NOTICE and the media files (the module format, on packages) — are no method of the contract. app takes each by HTTP GET at the address of api that it reads from /deployment.json, followed by /packages/sha256-<hex>/device/<path>:

  • sha256-<hex> is the package digest with - in the place of :, as the archive of a package in a release of modules is named;
  • <path> is the file's path in the device part of a package as files: LICENSE, NOTICE, or media/ and the file's path from media/, each segment percent-encoded as RFC 3986 encodes a segment of a path.

The request carries no token and no header, so that fetch goes with no preflight and through the HTTP cache, and app gives a media file to the canvas as a Blob. On its own origin api answers each with CORS (above). The answers:

Answer When
200 the file
404 the device part of the package has no such path
410 the image no longer gives the version: withdrawn, or out of the window. app asks CheckPackages
503 with Retry-After the index of the image does not know the digest: a deployment is going on, and app repeats after the time it names

Withdrawal. The device learns of a withdrawal from api, not from the module index. CheckPackages names digests, by the account of the token and with no ID of a profile, and api keeps none of them. The answer gives each PACKAGE_STATUS_GIVEN; PACKAGE_STATUS_NOT_GIVEN, withdrawn or out of the window; or PACKAGE_STATUS_UNKNOWN, while a deployment goes on.

  • app asks it when it starts, about the digests whose open views it keeps, and after CAUSE_VERSION_NOT_GIVEN, an answer 410, a lesson run ended RUN_END_REASON_UNCHECKED or an attempt closed CLOSE_REASON_UNCHECKED.
  • Of a digest no longer given it erases the open views, in its cache and in the databases of the profiles, and the state of the lessons on it; about a digest not known it asks later.
  • It is an answer of its own, apart from a failure: a refusal to give an open view tells no withdrawal by itself. The refusals stay all the same, so that a withdrawal shows in the middle of the work too.

Modules. A module comes to a learner by ModuleService, from the learner's session, with the right can_learn:

  • The current version of a module is the newest by semver that the pinned index of api does not mark withdrawn and whose module format is in the window of api, one for every learner. A version suits a learner by its audience: the learner's age category is one of its age_categories. The explanation language chooses nothing: the card of a module names it when it is not the language of the screen, and the adult chooses.
  • ListCatalog gives the modules of the pinned index whose current version suits the profile, connected ones too, each with the digest of the current version.
  • ConnectModule and DisconnectModule connect and disconnect a module, with no version: what the learner begins outside an open lesson run goes on the module's current version. A module disconnected keeps its evidence, loses its task skill, and its open lesson run ends RUN_END_REASON_NOT_SUITABLE at its next request.
  • SetTaskSkill sets a connected module's task skill: the skill the learner chose for its tasks, on the tile of its tasks or on the skill map, which ChooseNext with the module gives its tasks on until the learner gives the choice back to the tutor with an empty skill. The learner chooses among the skills the map opens, and app offers no other; api holds only that the skill is one of the graph of the current version, else CAUSE_NOT_FOUND, and a module solved on the sheet gets invalid_argument. ConnectedModule.task_skill gives it back, empty while the tutor chooses or once the current version no longer has the skill.
  • ListConnectedModules gives each connected module with the digest of its current version, by which app takes its manifest and skill graph before the first attempt: the title and the explanation language of the module, and the tiers by which app reads a sequential module. For a module on the sheet, sheet_solved has one entry for each task its page holds for the learner now, in the page's order, by the same rule as BeginPaperAttempts with its ID: whether an attempt of the task closed correct, on any version; so Home names the number of its tasks and shows which are solved before the page is begun. It is empty for every other module and for one with no current version.
  • A module is on the sheet, ConnectedModule.on_sheet, when its current version is a fixed set, selection: fixed of its manifest (the module format, on the manifest): its tasks are one page, and the engine chooses none of them.
  • ListCourses gives the courses of the pinned index (the module format, on courses), each by its current version — its newest whose format version is in the window of api; a course has no withdrawal — with its title, description, subject, explanation language, whether it is evolving, and those of its grades whose module ListCatalog gives the profile, from the lowest grade; a course left with no grade is not given. A course only joins its modules: Home shows a course's connected modules as one card, one grade at a time, and Subjects shows its grades as rows of one card, each connected by ConnectModule with its module's ID. Which grade Home shows is the device's to keep, not api's.
  • A module with no current version for the learner — none at all, or one whose audience the learner is not in — comes with no digest. It has no attempts and no lessons, and may be disconnected. app names it by the title of a manifest it keeps of an earlier version, or else by its ID.

The goal for the tutor. Profile.goal is what the tutor leads to first across the modules: up to three items in order of importance, each an area — a code of the closed list of the module format, by its spelling — or a skill, by its full ID. It changes only which reachable skill and module the engine's choice across the modules takes, by the turns of its items, which the rule of engine sets: in two of every three such choices the goal's skill takes the place of a new skill, the author's order and the queue, and the third is the modules' turn, as with no goal; the lesson of an open run, the corridor, consolidation, repetition and probes stay as they are, and while the module of the goal's skill still places the learner — its trial series and its first skills —, the goal's turn is that module's own, with its codes and no item. With none, the tutor leads the modules evenly. A choice of a module's tasks reads no goal, and api gives it none: the task skill stays a choice inside one module.

  • AccountService.SetGoal sets the whole goal, and a goal with no items removes it: an action of an adult with the right can_manage, at every profile of the account, as the adult's correction of the level (below) — the owner's, so an adult learner sets their own, a child's, and that of a learner who gave their own consent. The learner sees the goal, a child too, and in a profile not of the category adult app asks for the PIN of the section for adults before the goal sheet and before "★ Make it the goal", a barrier of the interface (above, "The PIN"). The answer is the profile; no method of its own gives the goal back, which GetAccount gives with the profile.
  • Three items at most, none twice, each an area or a skill, else invalid_argument. api holds each item new to the goal: an area of the list, or a skill of the graph of the current version of a module connected to the profile, not solved on the sheet — else invalid_argument, CAUSE_NOT_FOUND or CAUSE_NO_CURRENT_VERSION, as the method's comment names them. app offers no other: which skills a goal may take — not mastered, with tasks for the learner, with a verdict — is the interface's, as the task skill's is the map's. A profile whose consent is not confirmed, or whose age is to be given again, gets CAUSE_NO_CONSENT or CAUSE_AGE_NEEDED, as a learning request: the goal is processing of the learner's data.
  • An item stays as it was set. One whose skill the current version of its module retired leads to the skills that replaced it, by the graph's retired_skills, as the learner's progress is carried to them. One whose skill's module is disconnected, has no current version for the learner or is solved on the sheet, or whose area a later version of the format leaves out, leads to no skill until it is back, and the engine takes the goal's other items. SetGoal takes an item the goal holds already as it is, so that the adult may reorder or remove it. app shows an item that leads to no skill as such, and names its skill by a graph it keeps of an earlier version, or else by its full ID. Why it leads to none the contract does not carry: app reads it off the map — a skill mastered, an area whose every skill with a verdict is mastered, an item whose skills left have no tasks for the learner, else nothing within reach —, and names none in the rare case where the engine finds no skill and the map finds one, a skill behind skills that give no verdict or have no tasks.
  • api appends each goal set to the evidence log, a fact for learner-model beside the attempts and the adult's corrections of a level: its items in order, none when it was removed, and when. The model reads it not: it gives no evidence of a skill and moves no level. It is a kind of evidence of its own, which a version of learner-model before that kind refuses: api sets a goal only with a version that gives the kind, and each reader of the log in api leaves out a record its version refuses. By it a repeat of an engine's choice over the log knows the goal the choice was made by, and the history of the cognitive map when each item was set. A request that names the goal the profile has, the same items in the same order, appends nothing and answers as the profile is, so the method repeats by the state of the profile, with no idempotency key. The fact goes into the export and is deleted with the evidence log; the goal in force is kept with the profile and deleted with it.
  • LearningService.PreviewGoal is "The tutor will start with", on Next of the cognitive map and in the goal sheet: the first five skills toward the goal, each once, with its module and the number of the item it leads to, by the turns of the goal's items from the first — for the goal the profile has, or for a draft of the sheet not saved. The engine computes it by its rule of the goal, from the learner model and the skill graphs of the modules connected at the time of the request; consolidation, repetition, probes and a module's placement come in their own time and are not in it, nor is a skill mastered or out of reach, nor one with no tasks, as GetSkillMap counts it (below, "The skill map"), whose pool by the profile's category api gives the engine. It writes nothing — no choice is made, the open attempt stays open, nothing goes to the evidence log — and judges no route to AI and no quota, so Start, which is ChooseNext without a module, may give another skill. It gives skills, not tasks: which task follows depends on how the attempts before it end. A learning action, Next, needs the right can_learn, and an action of an adult, the goal sheet, can_view; either may name a draft, and either at a profile whose consent is not confirmed, or whose age is to be given again, gets CAUSE_NO_CONSENT or CAUSE_AGE_NEEDED. A draft of more than three items, with an item twice, or with an item of neither an area nor a skill gets invalid_argument; an item of it is read as an item of a saved goal, and one that leads to no skill gives none.

The engine's choice. The engine chooses what comes next, a lesson or a task outside a lesson, and api calls it:

  • when the learner asks for it: ChooseNext. With module_id — Solve on the tile of a module's tasks — the choice is a task of that module alone, on its task skill when it has one, and never a lesson: api gives the engine that one module with no lessons and the task skill as the skill chosen. A task skill on which the module's pool holds no task gives nothing, with no outcome; a module not connected gets CAUSE_NOT_FOUND, and one with no current version for the learner CAUSE_NO_CURRENT_VERSION. Without it — Next on the cognitive map — the choice is among all the modules connected, a lesson or a task, by the goal for the tutor as it is then (above), or on the skill skill names when it names one, which reads no goal; app sends no skill, and a module and a skill both named get invalid_argument. It closes the open attempt CLOSE_REASON_LEFT, and app warns beforehand that the attempt cannot be gone back to. api keeps the module and the skill with the choice, for its repeat. next after a task of a module's choice stays in that module, on the module's task skill as it is when the next choice is made; after a choice that named a skill alone, on that skill; after one that named neither, among all the modules, by the goal as it is when the next choice is made;
  • when an attempt outside a lesson is closed by a correct answer or by "Done": in the answer that closes it, next (below);
  • when a lesson run ends by a request: in its answer, RunEnd, or in the data of CAUSE_RUN_ENDED, and again on a repeat of the "lesson done" that ended it. It is a choice of the lesson's module, of its tasks alone, as ChooseNext with the module gives: app offers it as Solve beside the module's next lesson. When the module is no longer connected or has no current version for the learner, it gives nothing, with no outcome. A run that had ended before the request, by a job of the operator or by another request, gives no choice, and app asks ChooseNext with the module while it is connected.

EngineChoice names the choice by its ID and gives a lesson, CHOICE_KIND_LESSON, which OpenLesson opens, or a task, CHOICE_KIND_TASK, which BeginAttempt begins: a choice begins nothing by itself. When the AI that checks the tasks is closed to the learner on the route of the request (above, "The own key and the clock") and no task that a tap checks is left, it gives nothing, CHOICE_KIND_NOTHING, with the outcome that says why — CAUSE_QUOTA with when the next family day begins, CAUSE_PLATFORM_LIMIT or CAUSE_NOT_ADMITTED, and on the own key CAUSE_NOT_ADMITTED alone —, and with none when there is nothing to give for another reason. A choice toward the goal for the tutor names the item it leads to, goal_item, as the goal held it then, and every other choice none: api keeps it with the choice, and it goes into the export with the choice's reason code. app shows the learner, a child too, which item of the goal the task is for, by its number in the goal as the profile has it, and the item alone once the goal holds it no more.

The reason code. The engine gives each choice of a lesson or a task a reason code, ReasonCode: why it gave it, while ChoiceKind says what. The list is closed, and a code carries no parameter: what was given — the task, the lesson, the version — is in the record beside it.

  • REASON_CODE_CONSOLIDATION: after a wrong answer, another task on the same skill, while the skill is within reach;
  • REASON_CODE_NEW_SKILL: a skill not given before, whose prerequisites the engine's rule counts as met, or which has none;
  • REASON_CODE_QUEUE: of the skills within reach that were given before and are not mastered, the one not given for longest in its module;
  • REASON_CODE_REPETITION: the review date of a mastered skill has come;
  • REASON_CODE_PROBE: a skill put aside comes back as a check;
  • REASON_CODE_SKILL_CHOSEN: the learner chose the skill — the task skill of the module, on the tile of its tasks or on the skill map, or a skill ChooseNext names —, and the engine the lesson or the task on it;
  • REASON_CODE_AUTHOR_ORDER: a skill with a rubric or without assessment comes next in the author's order, by the skill graph, without the learner model;
  • REASON_CODE_OPEN_RUN: the lesson of a run that is open, which the learner goes on with;
  • REASON_CODE_ROTATION: a skill given before comes round again, the one not given for longest first, though it does not fit the queue of REASON_CODE_QUEUE: it is mastered, or no skill is within reach;
  • REASON_CODE_LESSON_CHOSEN: the learner chose the lesson on the lessons of its module, and OpenLesson opened it; no branch of the engine's rule made it;
  • REASON_CODE_TO_GOAL: a choice across the modules on a reachable skill that an item of the goal for the tutor leads to, by the turns of the goal's items (above): in the goal's turn, two choices of three, in place of a new skill, the author's order and the queue; the lesson of an open run, consolidation, repetition and probes keep their codes, and so does a module's turn while it places the learner.

A choice has one code: that of the branch of the engine's rule that made it, a lesson's as a task's, or REASON_CODE_LESSON_CHOSEN for a lesson the learner chose. A choice for a skill the learner chose is REASON_CODE_SKILL_CHOSEN, and a choice of a lesson whose run is open REASON_CODE_OPEN_RUN, whatever else would fit them. A choice of nothing has no code, and neither has an attempt that the learner began again.

  • api keeps the code with the choice, and it goes into the export. The adult sees it in the progress, AttemptRecord: an attempt outside a lesson with the code of the choice of its task, and an attempt of a lesson run with the code of the choice that began the run, so that REASON_CODE_OPEN_RUN is never in the progress. No answer to a learning request carries it, EngineChoice included: a child is not told it, and no one on the learner's screen reads it. REASON_CODE_TO_GOAL alone the learner sees too, a child as well, by the item that EngineChoice.goal_item names: the learner sees the goal, and the item tells no more than it.
  • app words each code for the adult, in the languages of its interface, and a code its build does not know with words that name no reason. api sends no text of a code.
  • A code kept with a choice is never rewritten, and a value never changes its meaning, as the versions of the contracts have it (above). A branch of the engine's rule that the list does not name comes as a new value, as a row «в реестр spec» of the RUN.md of engine; the value of a branch the engine drops stays, and its comment says that it is no longer given. Consolidation within a lesson, which the rule of engine does not bring in its first slice, would come the same way, and an early end of a run, which it does not bring either, as a new reason of its end.

Beginning an attempt. BeginAttempt begins an attempt in one of three ways:

  • by an engine's choice of a task, on the current version of its module;
  • on a task segment of an open lesson run, named by the run's ID and the segment's place, on the run's package. Every task segment before it has ended, and it has not, or else CAUSE_SEGMENT_UNAVAILABLE;
  • again: the same task as an earlier attempt, outside a lesson, on the current version. A task the current version does not have gets CAUSE_NO_CURRENT_VERSION.

A profile has one open attempt of a task of a module: a new one closes the one before CLOSE_REASON_LEFT, and leaves as they are the open attempts of tasks from paper (below). A choice begins one attempt: once it has, another request by it gets CAUSE_ALREADY_EXISTS, and app reads the open attempt of the profile, GetAccount; a choice of a lesson gets invalid_argument, as a choice of a task does in OpenLesson.

  • api gives a task only to a learner in one of its age categories, and otherwise refuses CAUSE_NOT_SUITABLE. A task that platform AI checks it begins only while the quota holds enough for a typical task, and otherwise refuses CAUSE_QUOTA, CAUSE_PLATFORM_LIMIT or CAUSE_NOT_ADMITTED; a lesson run stays open on them.
  • The answer, AttemptStart, is the ID of the attempt, the open view of its task — of an instance when the task is a template, which the seed of the attempt chooses (the module format, on packages) — and the package digest, by which app takes the manifest and the technique catalog, and an attempt of a lesson run names its segment; it names the primary skills of the task's items too, as an example does, by which app goes on with a module's open attempt only for the skill chosen, and starts a task of that skill otherwise. The seed never goes to the device.

The open attempt. While an attempt is open, the learner goes on with it on any device, with a clean sheet: the strokes stay on the device that wrote them, but for a profile whose storage of works is on, where app may take the work another device put back from GetWork and give the canvas its history and contexts again ("Stored works" above). GetOpenAttempt gives the attempt as the server keeps it: its beginning; the verdicts and the reading of its last submission with a verdict; its wrong answers; the current rung with its words, and whether "explain differently" was asked for on it; the techniques given on request, and the leading question given on request; and on a task with a rubric, how each submission ended and when. The list of profiles names each profile's open attempt, open_attempt, so that a device that keeps no state of it finds it. An attempt closed meanwhile gets CAUSE_ATTEMPT_CLOSED with its close reason: on a version no longer given CLOSE_REASON_UNCHECKED, and after 7 days without an action CLOSE_REASON_ABANDONED.

A task from paper. A task from the learner's own page, open to every profile, goes by PaperService and then AttemptService.

  • The finding gives a frame to each task as the page sets it, and each sum or equation that says by itself what to do, as each of a column under one instruction, is a task of its own, its frame without the instruction; examples that the instruction alone explains, as numbers under "Round to the nearest ten", stay one task with it, and so do the parts of one task that share its statement or its picture, as a), b) and c) of one word problem.
  • Each call of AI of a task from paper asks up to three models of one provider in turn — Haiku 5.5, Sonnet 5.5, Opus 5.5; the drawing of grown-up mode, Haiku 5.5 and Sonnet 5.5 alone —, the next only when the one before did not do: the finding when it found no task, the statement when it failed, the Check when a slot's confidence is low, a slot is unreadable or the answer is off its schema. An unsure "Not yet" of the last model is shown, and the tutor's words say it more softly. The outcome is the last model's that answered, and its usage every attempt's. So FindTasks, SubmitWork, GetOpeningWords and AskTutor, whose Check reads the work as it stands, run up to 90 s at api, and app names that deadline in Connect-Timeout-Ms for them and waits as long for one CAUSE_STILL_GOING; AskGrownUp runs up to 300 s, the drawing's own budget, app naming that deadline; every other request runs 30 s.
  • FindTasks sends the photo of the page in one request: a JPEG or a PNG of at most 4 MiB, without the metadata of its file, which app scales down to fit. One call of AI, the capability task_finding of the admission table, its attempts as above, gives the task frames alone, each a box in whole thousandths of the photo, in the order of the page, and above each the frame of its instruction, instruction, when the page prints one; no text of the page comes back. Each attempt without a request first asks its model which way up the page is, and the program turns the photo upright before the model finds the tasks on it, by any angle; turn_degrees gives the turn, clockwise, and the frames are on the photo so turned: app turns its photo the same way — about its centre onto the smallest upright rectangle that holds it, rounded to whole pixels, its corners white —, at any scale, and goes on with it, so that a request sends the photo turned and its attempts ask no turn. It makes no call without the reserve of the quota: there the quota, the limit of platform AI and no admission are refusals. A call that gives no frames is an outcome, and the learner frames the tasks by hand. The server keeps neither the photo nor the frames.
  • The learner's request. The learner may ask the tutor in words, on the page to pick from, which tasks to take and how to split them, as "only the first column, each example a task of its own". FindTasks then sends the photo again with the request, request — at most 200 code points, with no control character, not spaces alone —, the frames the AI found that are on the page now, found, at most 20, and those the learner drew, drawn, at most 40; frames without a request, or any of these out of bounds, get invalid_argument. The call is the same capability, its attempts as above, and gets the request as data between its tags, never as an instruction, with the frames numbered as the page shows them. Its answer is frames alone: the program keeps those inside the photo, at most 20, and drops each that covers a frame the learner drew, its overlap at least 0.8 of their union. app puts them in place of the frames the AI found before and keeps the learner's own, and offers Undo, the frames before, until the learner changes anything; an answer of no frames leaves the page as it was. Neither the request nor the frames are kept: not in the log, not in the record of the idempotency key.
  • app cuts each picked task's crop on the device, by a frame the AI found or one the learner drew, and the crop of its instruction, by the instruction's frame the AI found, and BeginPaperAttempts begins one attempt for each, from 1 to 20, its IDs in the order of the tasks, on the page page_id names — the ID app gives the page, which names its file of the export, 1 to 200 letters, digits, -, _ and ., the first not a ., else invalid_argument. It closes the open attempts of tasks from paper that the profile has on another page, CLOSE_REASON_LEFT, and none of the same page, which "Add" begins more tasks on; api keeps the page's ID on each attempt while it is open; the open attempt of a task of a module stays, and beginning one closes no attempt of paper. So a profile has, beside its one open attempt of a module, the open attempts of one page, each closed by a correct answer, by a new page or after 7 days without an action. It meets the quota and the route to AI as BeginAttempt does. With module_id, a module the profile has connected whose ConnectedModule.on_sheet is true, tasks is 0 and the page is the module's: api begins an attempt of a task from paper for each task of the module's current version that suits the learner and is no template, by the order of their IDs, at most 20, and the answer gives the open view of each, tasks, in the order of the attempts, and the package's digest; app draws each statement's text as the picture the tracing paper shows and PaperWork.statement sends. A module not on the sheet, or tasks beside it, is invalid_argument; one not connected CAUSE_NOT_FOUND, and one with no current version for the learner, or no task that suits, CAUSE_NO_CURRENT_VERSION. A later attempt of one of its tasks names the page alone, as a task from paper's does, and the attempt it begins anew, renews: api keeps on each attempt of a module's task, and after it closes, the module and the task — neither the photo, nor a crop, nor the work —, and the new attempt takes the task of the one it renews; an attempt of a page from paper keeps none. renews beside a module or tasks other than 1, or an ID that is no attempt of the profile from paper, is invalid_argument.
  • A task's crop may hold several tasks, each with an answer of its own, as a frame drawn round a column of sums: the Check gives them, from 1 to 20, in the order of the page — top to bottom, and left to right in a row —, and the parts of one task under one statement, as a), b) and c) of one word problem, are one (see the Check of a task from paper, below). An attempt of a task from paper has an item for each task of its crop, the task at the place n the item n, each with one answer slot, at the place n, 1. Its work is PaperWork ("The work" above), which every request that carries a work sends whole.
  • Recognise. ReadStatement makes the reading of the statement of the attempt's crop, statement_reading, on the learner's press, by the route of the attempt and its attempts as above, and gives the statement of each task as the page prints it — "□" for each box an answer goes in, a fraction with a bar \frac{…}{…}, nested as printed, and a raised power ^{…}, LaTeX's way and no more of it, without the task's label, as 1), or the sign that parts it from the next, as ; —, never a formula. It makes no call without the reserve of the quota. api keeps the reading, Reading of novatrail.paper.v1, on the attempt while it is open, and erases it with the Check's answer once it ends; an attempt that keeps a reading answers from it, repeated, with no AI. The Check takes none of it: the model reads the crop itself. A call that gives no reading is an outcome, and the next press asks again. app shows the statements in place of the photo until the learner goes back to it; the device keeps none of them.
  • The Check. Each SubmitWork of the attempt is one Check, the capability task_checking, its attempts as above: the model gets the three images of PaperWork, their sizes, the language of the words, the learner's age category and the attempt's history, which api gathers — the verdicts of the Checks before, the rungs shown and the tutor's words before —, and judges the work (see the Check of a task from paper, below). The strokes go only as drawn in the crop of the work, with no stroke's points and no writing history. api turns each slot's verdict into the verdict of the attempt's answer slot, at the box of what was read, crop_box, by which app marks each answer right or not, and puts the tutor's words in tutor_words. A Check in which the model read nothing of a solution in any slot gets the outcome CAUSE_NO_KEY, "Couldn't check this one", and the hints are still given; the next submission checks again. app sends no empty sheet. A call of AI that gives no Check — a failure, the quota, a limit, no admission — is an outcome as any, the slots unchecked, and the next submission tries again.
  • The Check's progress. While its SubmitWork waits, app asks GetCheckProgress of the attempt every 2 s, from 2 s after it sent the work: going while a SubmitWork of the attempt is going, and once the Check went on to a later model, model — which one reads the work now, from 0 — and models, how many it may ask. It names no model, calls no AI and changes nothing: the card of the reading says by it that the work went on to the next model. An account with the right of the debug mode reads the models' names from GetDebug; the others see the models as dots.
  • api keeps the Check's answer, Check of novatrail.paper.v1, on the attempt while it is open — the model's hidden solution and answer, the ladder, the boxes of the errors, the verdicts, the count of wrong answers and the words of the hints —, and erases it once the attempt ends; none of it reaches the device but the verdicts, what was read with its box, the tutor's words, a rung's words and the box of the first mistake as the wavy line. Each Check gives the attempt a new ladder in place of the one before.
  • Each submission reserves the quota for its Check, the expected price of its three attempts, as any request reserves its calls, and is settled attempt by attempt.
  • The attempt is solved when every task is correct, and a submission with any task not_yet is one wrong answer; so_far_correct counts none. A solved attempt closes CLOSE_REASON_CORRECT with an empty solved, no key and no solution, and no next: no engine chooses after a task from paper, and its attempts give no evidence.
  • The tutor's words of a task from paper are the Check's and those of "explain differently", in the language of the screens app shows the learner, which each request that gives words names, words_language — SubmitWork, GetOpeningWords, GetHint, GetRungWords, ExplainDifferently, AskTutor and AskGrownUp —, so that the words and the voice that says them are in the language the learner reads; a request that names none, from an older build, gets the language of the profile's interface, else English. The leak check looks in the tutor's words and in each rung of the ladder for the hidden answer of each task not yet answered correctly, a number the statement prints or the learner wrote being no leak: words that name it are left out, and a rung gives way to its rung's fallback text, the platform's template of the rung in that language. GetRungWords and GetHint give a rung of the ladder the attempt keeps, the rung k after the k-th wrong answer, with no call of AI; with "Show where", the rung's words come with the wavy line under the box of the first mistake the Check gave. "Explain differently" is one call of AI on a rung, without the work, as on any attempt, to up to three models in turn. The words after a correct answer are the Check's tutor_words: GetCorrectAnswerWords gets CAUSE_NO_MORE_WORDS. A report of a problem goes as on any attempt. "Hint" before the first Check is GetOpeningWords ("The tutor's words" above): GetHint gives empty techniques and no leading question, since the task has none. ShowSolution gets CAUSE_NO_SHOWING; BeginStep, SubmitEssay, Done, GetOpenAttempt and PutWork get invalid_argument: a task from paper has no steps, no rubric and no open view, its work is never a stored work, and only the device that holds its page goes on with it. Profile.open_attempt names the attempt of a module alone.

The debug mode. DebugService lets an account with the right of the debug mode choose the models of the calls of a task from paper and see what every call of a model made for the account returned and cost, wherever it was made, on a local run and on the deployment:

  • The right is the account's, api's to keep; on a local run with api's debug flag every account has it. A method from an account without it answers permission_denied with no Refusal, and on a run with the stub of tutor unimplemented. app asks GetDebug in every build, and shows the debug button, in every profile, only when the answer comes: a refusal of it shows none and is no error to the learner.
  • GetDebug gives the models that can be chosen — those of the adapters of tutor with a key on this run, with the prices of tutor, their efforts and the efforts at which their thinking may be off —, the models the admission list of tutor gives each call for an adult on platform AI, a DebugAdmitted for each in the order of their attempts, and the choice now. SetDebugModels sets the choice: the model of every call of a task from paper — task_finding, statement_reading, task_checking and the words of "explain differently" and of a question to the tutor —, or none, each call its models of the admission list of tutor, in turn. A model chosen is one attempt, with no later ones, and there is no second: the Check is one call of one model, and api ignores second. The choice bypasses the admission list.
  • TakeDebugCalls gives the account's actions since the last take — every request of the account that called a model, of a task from paper, of a task of a module or of an essay, with its calls in the order they ended, each attempt of a call apart with its place, attempt, 1 to 3, and each reader of a sheet with its place, reader, 1 or 2: the model as the provider gave it back, its effort and thinking, what it returned as it returned it, the tokens, the time, the retries, the cost and what it came to, failure — and forgets them. A SubmitWork of a task from paper has one call, DEBUG_CALL_KIND_TASK_CHECKING, and so has a GetOpeningWords; an AskTutor has DEBUG_CALL_KIND_TUTOR_WORDS, after a DEBUG_CALL_KIND_TASK_CHECKING while the attempt kept no Check; the drawing of an AskGrownUp, of either kind of task, is DEBUG_CALL_KIND_DRAWING; a GetRungWords of a task from paper makes none. A SubmitWork of a task of a module has a DEBUG_CALL_KIND_WORK_READING of each reader; a SubmitEssay a DEBUG_CALL_KIND_WORK_READING, the essay read by its one reader, then a DEBUG_CALL_KIND_ESSAY_ASSESSMENT; its GetRungWords, ExplainDifferently and GetCorrectAnswerWords a DEBUG_CALL_KIND_TUTOR_WORDS each. The choice serves none of a module's calls: they keep their models of the admission list. api holds them and the choice in the memory of its process, for the account of the token, and writes neither to its log nor to its database: the readings of the work and the model's hidden solutions and answers are in them.
  • Each call is charged to the quota as any call is, by its cost: the sum app shows is the sum of the costs it took.
  • A Check in the log exports as a DebugCase: app puts in it the PaperWork it sent and the action it took, and the developer the truth — for each task, the value read and its verdict, and the verdict of the whole —, which app fills in first from what the Check gave, beside what the Check answered for each task's slot, check_verdict and check_read. Its JSON, a file a case, is a case of the set of a task from paper of tutor-eval, which reads a folder of them. The file holds the pictures of the work of the profile it was made in: tutor's eval keeps only the developer's own paper. The answer that closes an attempt by a correct answer, SubmitWork, or by "Done", Done, holds next beside the solved task, and its repeat the same:
  • in a lesson run, the place of the next segment, or segments_ended when no segment is left after it;
  • outside a lesson, the engine's choice.

Lessons. A lesson goes by a lesson run: the lesson of one learner on the package it began on, with an ID of its own, one open run for a profile and a lesson on every device. The place in the lesson and the state of its demos are app's, by the key "lesson's full ID, package digest", and api does not know them.

  • ListLessons gives a connected module's lessons, for the tile of its lesson and its page of lessons: those of the current version that suit the learner whole, in the author's order — by the skill graph, a lesson after those whose skills its own need, then by tier and by ID, as the engine orders them —, each with its full ID, its title, how many segments it has, the place of its group, its state, its tier — the least of the tiers of its skills, as skill_tiers numbers them, by which the cells of the lessons stand in the tiers of the skill map — and, beside an open run, the places of its task segments that have ended. The lessons of one group have no order between them by the graph, and the page shows a group of more than one "in any order". A lesson is new, open — a run of it is open — or passed — a run of it ended RUN_END_REASON_PASSED, on any version, and none is open. The lesson of an open run that the current version does not list, or that no longer suits the learner, comes after them, each in a group of its own, by the run's package, since a run goes on on the package it began on, and so does its tier. tile_lesson names the lesson the tile shows, one of the list: the lesson of an open run, the one begun last when there are several; else the first in the order not passed; else the first. It is a look: it writes nothing, ends no run and makes no choice, so the tile and the page cost the learner nothing.
  • OpenLesson opens a lesson: of an engine's choice by its ID, or the one the learner chose on the page of lessons by its full ID, lesson, one and only one of the two. It gives the open run of the lesson when the profile has one, or else a new run on the package of the current version. A lesson the learner chose opens with a choice of its own that api records, REASON_CODE_LESSON_CHOSEN, which the run names: so every run has a choice, as the summary of issues and the adult's progress need. Its record holds what a choice of the engine's would at that moment — the versions of engine and learner-model that api runs, the digests and which are the engine's modules, the release of modules, the last evidence, whether the pool was limited and the age category —, and a replay does not run the engine for it: no branch of the rule made it, as its code says. A lesson by its ID with no open run that the current version does not have gets CAUSE_NO_CURRENT_VERSION, as a new run of it would. A choice opens one run: once that run has ended, the choice gets CAUSE_RUN_ENDED; a new run takes a new choice, or the lesson by its ID again, and a lesson passed opens a new run.
  • GetLessonRun gives an open run again by its ID, after a restart and on another device. The list of profiles names each profile's open runs, open_lesson_runs, with the lesson's full ID and the package digest.
  • Both answer LessonRun: the ID of the run; the open view of the lesson, whole, without its skills and age categories (the module format, on lessons); the package digest; the places of the task segments that have ended; and the open attempt of a segment, if there is one. app opens the lesson at the later of that attempt and the place it keeps.
  • Before each of these answers, and before an attempt of a segment, api checks the run whole: the module is connected and has a current version for the learner, and the lesson and each of its tasks suit the age category of the profile — by the package of the current version for a new run, and by the run's own for an open one. An open run that fails ends RUN_END_REASON_NOT_SUITABLE, and one whose package the image no longer gives RUN_END_REASON_UNCHECKED: the request gets CAUSE_RUN_ENDED, and app asks CheckPackages. A new run that fails is refused CAUSE_NOT_SUITABLE, or CAUSE_NO_CURRENT_VERSION when the current version has no such lesson.
  • A task segment begins by BeginAttempt, and ends when its attempt is closed CLOSE_REASON_CORRECT or CLOSE_REASON_SOLUTION_SHOWN, or on a task with a rubric CLOSE_REASON_DONE. An attempt left or abandoned does not end it: the learner begins it again.
  • "Lesson done", CompleteLesson, is the usual end of a lesson. app sends it when the learner presses "Continue" on the last segment, and repeats it until api answers. api ends the run RUN_END_REASON_PASSED once every task segment has ended, and earlier refuses CAUSE_SEGMENTS_NOT_ENDED, with the places of those that have; a second "lesson done" is no error.
  • api ends a run by itself too: RUN_END_REASON_UNCHECKED when the run's package is no longer given or an attempt of it is closed CLOSE_REASON_UNCHECKED, RUN_END_REASON_NOT_SUITABLE, and RUN_END_REASON_ABANDONED after 30 days without a request on the run or its attempts. A request on an ended run gets CAUSE_RUN_ENDED with how it ended. "Early" would come as a new reason, should the rule of engine bring it: its first slice does not.
  • app drops the state of another run kept under the same key, and erases the state of a lesson at every end of its run, in an answer or in a refusal.

The skill map. GetSkillMap gives the state of the skills of a connected module's current version, as learner-model reads it at the time of the request, by a learning action with the right can_learn or by an action of an adult with can_view:

  • each skill whose assessability is verdict: how many pieces of evidence it has and when it was last practised; once practised, its estimate and uncertainty on the scale of the module's bands and its retention; once mastered, its mastery band, its cautious probability with retention, and its review date, or that the review is due already; and whether its tasks are passed, tasks_passed, which api counts from its records of attempts: each task of its pool — the tasks of the module's current version where the skill is primary that the deployment can give the profile's age category —, a template being one task, has had an attempt, and at more than half of them the first attempt gave each item where the skill is primary the first verdict "correct"; or whether it has no tasks, no_tasks: its pool is empty, and tasks_passed is false. A prerequisite counts for "ready to start" when it is mastered, its tasks are passed or it has no tasks, by the same count api gives the engine, and a skill with no tasks, mastered or not, is offered for no module's tasks;
  • each anchor skill that the graph names: whether the learner holds it, why not or why unknown, the full IDs of the skills that teach it, and, whatever the holding, the modules of the catalog not connected to the profile that teach it — those of the pinned index whose current version suits the profile by its audience and names it in teaches (the module format, on the module index) —, which app offers beside an anchor skill whose holding is unknown;
  • the module's level: the band it stands in, as learner-model reads it on the scale of the module's bands — the highest band above it, and none while it stands below the lowest band, where a learner whose grade is in the lowest band starts; and when an adult last set it, which every learner sees, a learner who gave their own consent too.

The graph and its tiers app takes by the digest of the answer, so a skill that the current version no longer names, or names nowhere yet, is not on the map. No trap is on the map: the trap catalog is closed. How the map shows the state is the detailing of skill-map, and what it needs beyond this comes as a field added.

Progress. GetProgress gives an adult, with the right can_view, the progress of a profile, a page at a time, by page_token and next_page_token:

  • its attempts, newest first: the task's full ID; the version of its module; the lesson's full ID when the attempt is one of a lesson run's segments, and the lesson's title; the close reason and the wrong answers, from which how the attempt came out follows; when it began and was closed, and when the engine chose the task or its lesson, with the reason code of that choice. On a task with a rubric, each submission with how it ended, and beside a feedback the mark of each criterion, met, not met or not assessed, in the order of the rubric;
  • of a solved attempt, one closed CLOSE_REASON_CORRECT, CLOSE_REASON_SOLUTION_SHOWN or CLOSE_REASON_DONE, the titles of the skills that its task trains: the primary skills of its items, each item's own or else the task's, each once, in the order of the items and of their lists. Any other attempt has none: the skills of a task are closed, since their titles could tell how to solve it, an attempt open or not solved may be begun again, and on the owner's profile the adult and the learner are one person (the module format, on the task). The titles, of the lesson and of the skills, are in the module's explanation language, from the package of the version the attempt went on, as the description of a trap is; when api no longer reads that package they are empty, and app names the lesson by its ID;
  • the traps that repeat, on the first page alone, the one asked for with an empty page_token. A trap repeats when the program found it in two closed attempts of the profile or more, counted by its full ID (the module format, on a module); an attempt on a version withdrawn wrong_key counts none. Each comes with its description and trap_advice, from the trap catalog of the version of the last attempt that found it, with the number of such attempts and when the last was closed. These are the only texts of a trap that reach a device, and only an adult's view of closed attempts (the module format, on the trap catalog);
  • the adult's last correction of the level of each module of the profile that has one, connected or not since, while the evidence log keeps it, on the first page alone: the module, the band set, and when.

The cognitive map. GetCognitiveMap gives the cognitive map: the skill map of every module connected to the profile at once, which app groups by areas. A learning action needs the right can_learn — the learner on their own screen, a child too —, and an action of an adult can_view; so do the history and the indicators (below). A learning action at a profile whose consent is not confirmed, or whose age is to be given again, gets CAUSE_NO_CONSENT or CAUSE_AGE_NEEDED; an adult's action views the profile whatever its consent, as on the skill map. Each of the three requests names the device's time zone, time_zone, by its name in the IANA time zone database: by it a day begins at midnight and a week at midnight on Monday. api reads it for the request alone and writes it nowhere; one it does not know, or none, gets invalid_argument.

  • Each module comes with the digest of its current version and the state of its skills, SkillState, as GetSkillMap gives it at the time of the request (above, "The skill map"); the graph, its tiers and the area of each skill, skill_areas, app takes by the digest, GetSkillGraph, as it does for the skill map.
  • It leaves out a module with no current version for the learner, which app names by ListConnectedModules, and a module on the sheet: its tasks are judged as tasks from paper, give no evidence and are chosen by no engine, so its skills never move, and no goal takes them. A skill with a rubric or without assessment has no state, as on the skill map, and app draws it by the graph. A profile with no module to show gets none, and app shows the empty map.
  • window_start names the skills of the map that were mastered at the start of the window of the indicators (below), by which app counts "+N this month" of the whole map and of each area: the skills mastered now, less those mastered then. That is the change of the indicator of the skills mastered, so the title, the areas and the portrait give one number. While the profile was created inside the window it is absent, and the map shows no change over a month.

The history of the map. GetMapHistory gives the tab Progress: the state of the skills of the map at the end of each of the last twelve weeks, Monday to Sunday by the time zone of the request, the current week last and as at the request.

  • A past week's state is learner-model replayed over the records of the evidence log before the end of the week, midnight on the Monday after it, in the order of the log, leaving out a record its version refuses, as api's fold of the log leaves it out: each field of SkillState as GetSkillMap would have given it at that moment with the learner's grade now, which sets only the start of a module with no evidence, the retention and whether the review is due among them, and tasks_passed by the attempts before then on the pool of the current version. The current week's is the map of the request, every record of the log in it.
  • It is read through the modules' current versions: every piece of evidence goes to the skill of the module's current graph, and of a skill that the current version retired to the skills that replaced it, by the graph's retired_skills, as the learner's progress is carried to them. So a past week shows today's graphs as the learner stood then, not the map that week showed: a skill a later version added has the evidence on it alone, a module connected later none before, and a new current version of a module changes the past weeks too.
  • Its modules are those of the map, in the same order and with the same digests; a module disconnected is in no week, though the evidence log keeps its evidence. No week before the one the profile was created in is given: a profile in its first week has the current week alone, and app shows that there is no history yet.
  • goal_items gives each item of the goal for the tutor with since when it has stood in the goal: the moment of the goal set, a fact of the evidence log (above, "The goal for the tutor"), from which it has stood there without a break; a goal set that only reorders the items keeps it, and an item removed and set again takes the moment it was set again. By it app marks the week each item was set and counts what the goal did since.
  • api keeps the replay as a cache, never as a record of its own: it rebuilds it from the evidence log and the current versions, deletes it with the profile, and puts it into no export.

The indicators. GetIndicators gives the tab Portrait its indicators, which the learner sees, a child too: api computes them when read, from the evidence log and its records of attempts, and stores nothing new for them.

  • The window is the 28 days that end with the day of the request, that day included, and while the profile is younger, the days from the one it was created on, window_days. current counts over the window; previous over the 28 days before it, for the change over the month, and is absent while the profile was created inside the window; and weeks over each week of the history, the weeks GetMapHistory gives, for the sparklines.
  • The skills mastered: the skills of the map mastered at the end of the period — of the window and of the current week the request —, by the replay of the history. The skills due for review: those of them whose review date has come, or whose review is due already; and of those due at the request, when the one practised longest ago was last practised.
  • Right at the first try and needed a hint: of the attempts begun in the period and closed whose evidence the learner model reads, those where a rung of the hint ladder was given — a wrong answer, the k-th giving the rung k —, or a technique or the leading question on request, and of the others those closed by a correct answer with no wrong answer, so that no attempt is in both; app shows each as a share of those attempts. An attempt of a task with a rubric gives no evidence and is in neither, nor is one left unfinished — left, abandoned or not suitable — with no wrong answer, one grown-up mode acted on, one closed "unchecked", which has no outcome of the learner's to count, or one on a package withdrawn for a wrong key, whose evidence the model leaves out.
  • The days and the minutes of practice: the days on which an attempt of a task of a module began, of a task with a rubric and one grown-up mode acted on too, and the practice time of each such attempt — from its beginning to its last action, 30 minutes at most, so that a pause counts no more —, summed and rounded down to whole minutes. Nothing outside a task is counted: the worked examples and demos of a lesson are no attempt, and api does not know them.
  • Every count of attempts takes those of any module, connected or not since, and none of a task from paper or of a module on the sheet: they give no evidence, and api keeps no time of them once they end.

The adult's correction of the level. SetModuleLevel is "Easier" or "Harder" at a module's level in the section for adults, an action of an adult with the right can_manage, at every profile of the account: the owner's, a child's and that of a learner who gave their own consent, whom the adult of the account corrects as well. It names the profile, a connected module and the band to set the level in:

  • the band next to the band of the level that GetSkillMap gives, the one before it, easier, or the one after it, harder, in the order of the bands of the manifest of the module's current version, and the lowest band while the level stands below it. No band comes before the lowest, so at the lowest band there is no "Easier" to offer, and at the highest no "Harder"; a band keeps its place and its ID in every version (the module format, on versions of a module), so the current manifest names the band of the level. Any other band is refused CAUSE_BAND_NOT_NEXT: the level has moved since app read the map, by evidence or by another adult's correction, and app reads the map again before it offers a band once more. A module not connected gets CAUSE_NOT_FOUND, one with no current version CAUSE_NO_CURRENT_VERSION, and a profile whose consent is not confirmed, or whose age is to be given again, CAUSE_NO_CONSENT or CAUSE_AGE_NEEDED, as a learning request: the fact is processing of the learner's data.
  • api appends the correction to the evidence log, a fact for learner-model beside the attempts: the module, the band set, and when. It gives no evidence of a skill, and the model sets the module's level in that band in one step. The answer gives the band of the level and when the adult set it.
  • It names the band, not a step, so that it repeats by the state of the profile, with no idempotency key: a request that names the band of the level already appends nothing and answers as the level is. A repeat after an answer lost sets the band the adult chose, and changes nothing once the level stands in it; should evidence have moved the level meanwhile, the repeat is judged against where it stands, as a new request is.
  • The fact goes into the export and is deleted with the evidence log.

16. The Check of a task from paper

  • A task from the learner's paper has no key: no formula, no solver and no key of a program judge it. A model judges the work, in one call of AI, the Check, task_checking of the admission table, at each SubmitWork, and before the first Check at GetOpeningWords (above, "A task from paper"). The verdict is the model's, shown with no mark that a model gave it. check.proto of the package novatrail.paper.v1 is the Check's answer, which tutor gives and api keeps on the attempt while it is open.
  • tutor holds the answer to its form and checks the words for a leak; api turns it into the verdicts of the attempt's answer slots and the tutor's words and marks. The images and the history are data, never instructions to the model.

What the model gets. Image 1, the task's crop as printed, with no strokes, PaperWork.statement; Image 2, the work, PaperWork.crop, each stroke drawn in its style, in colour; Image 3, the crop of the instruction above the frame, PaperWork.instruction, when the finding gave one; the sizes of the three; the language of the words; the learner's age category; and the attempt's history, which api gathers: the verdicts of the Checks before, the rungs shown and the tutor's words before. No stroke's points and no writing history go.

What it gives back. Check:

  • slots, one SlotCheck for each task of the frame, task from 1 to 20 in the order of the page — top to bottom, and left to right in a row —, the task n the item n of the attempt, with one answer slot at the place n, 1:
    • verdict, correct, incorrect, unreadable, or no_answer when the work holds no answer of the task yet;
    • confidence, low, medium or high;
    • read, what the model read of the task's work, as written — its answer, or, with no answer yet, the solution so far —, and read_box, its box in whole thousandths of Image 2, absent when nothing was read;
    • assumptions, what the model took for given that the statement does not say, as "each number from 1 to 9 once";
    • errors, each CheckError a box on Image 2, box, the place in words, where, its kind, kind, and what is wrong there, note, the first mistake first;
    • solution and answer, the model's own, hidden: api keeps them on the server alone and never sends them to the device, since they name the answer.
  • tutor_words, the tutor's words on the work; and hints, a ladder of 2 or 3 rungs, from a question to a pointer at the place of the mistake. The place of a mistake and the hints come with the verdict, with no second call.

The program's part. The verdict itself is the model's. The program holds the answer to its form — 1 to 20 slots, each task once and in order, a verdict and a confidence of their values, a box inside 0 to 1000, 2 or 3 rungs —, and an answer off it is an answer the cascade goes on from. It checks the tutor's words and each rung for the hidden answer of each task not yet answered correctly, a number the statement prints or the learner wrote being no leak: words that name it are left out, and a rung gives way to its rung's fallback text. Each slot's verdict becomes the verdict of the attempt's answer slot, AnswerSlotVerdict, with value the slot's read and crop_box its read_box:

SlotCheck AnswerSlotVerdict
correct correct
incorrect not_yet, a wrong answer
unreadable unreadable, the reason illegible: the learner is asked to rewrite, as on any task
no_answer with an error not_yet at its first error, a wrong answer, as after an answer
no_answer with a solution read and no error so_far_correct, "So far correct": no verdict, no wrong answer, and nothing closed
no_answer with nothing read unreadable, the reason blank, with no mark on the crop
  • A Check in which the model read nothing of a solution in any slot — each no_answer, with an empty read and no error — gets the outcome CAUSE_NO_KEY, "Couldn't check this one", and its slots unchecked.
  • Unsure. The cascade goes on to the next model at a slot's confidence low, a slot unreadable or an answer off its form. An unsure "Not yet" of the last model is shown, and the tutor's words say it more softly.
  • The marks. A frame of several tasks is "Correct · 4 of 4" when every task is correct, and "Not yet · 3 of 4 correct" otherwise, with a tick or a cross by each answer at its crop_box; a task with nothing written has no mark. With "Show where", after "Not yet" the wavy line goes under the box of the slot's first error, with the rung's words.

17. The solver of module-kit

  • The messages of the key in key.proto of novatrail.paper.v1 — Answer, Key, TaskKey and Provenance — are the key that the solver of module-kit, its package paper, computes and judges by: a formula, the solver of it, the rules an answer holds before it is a key, and the verdict by a key. No task from paper is checked by them: its verdict is the Check's (above). They stay for module-kit's solver and the test vectors it passes. Reading and ReadTask are what "Recognise" gives, the statements and, when the reading gives one, a formula; api keeps the reading on the attempt while it is open, and none of it but the statements reaches the device.

The formula. A reading of a statement gives the tasks on a crop, from 1 to 20 in the order of the page, or none: each with its statement as the page prints it, as ReadStatement gives it, at most 200 bytes of UTF-8, and as a formula, one line of ASCII of at most 200 bytes, or nothing, when the statement is no formula. Each sum or equation with an answer of its own is a task, though one instruction stands above several; the parts of one task under one statement or picture, as a), b) and c) of one word problem, are one task, and so are the numbers under an instruction that alone says what to do with them.

  • A formula is a statement that is written as an expression or an equation, as 37 + 48 =, 3x − 5 = 16 and ☐ + 5 = 12 are. A word problem, one that asks to count in a picture, to compare, to draw or to prove is no formula, and the reader gives none: to put words into a formula is to solve the task, which is AI's solution, not a reading.

  • The grammar, in EBNF, with any number of spaces, U+0020, between two tokens and at either end:

    formula    = expression [ "=" expression ] ;
    expression = term { ( "+" | "-" ) term } ;
    term       = factor { ( "*" | "/" ) factor } ;
    factor     = "-" factor | power ;
    power      = primary [ "^" exponent ] ;
    primary    = number | unknown | "(" expression ")" ;
    number     = digits [ "." digits ] ;
    exponent   = digits ;
    digits     = digit { digit } ;
    unknown    = "a" | "b" | … | "z" ;
    

    ^ binds tighter than a minus before it, so -2^2 is −4; * and /, and + and -, go from left to right. A number has at most 15 digits, and an exponent is from 0 to 10.

  • The reader writes every sign of the statement in this grammar: × and · as *, ÷ and : as /, the minus sign − as -, a decimal comma as ., a fraction with a bar as (3/4) and a mixed number as (2+1/2), and every multiplication with its *, so 3x is 3*x. A box, a blank or a gap to fill is the unknown, x unless the statement names its letter, and the = at the end, with the empty place after it, goes: 37 + 48 = is 37+48, ☐ + 5 = 12 is x+5=12. The words of the instruction, such as "Solve" or "Compute", go too.

The solver. The solver of module-kit computes in rational numbers, exactly, with no floating point, no Starlark and no network.

  • A formula with no = is an expression, with no unknown: its answer is its value.

  • A formula with = is an equation in one unknown, one letter in it once or more, linear in it: each side is a·x + b once its operations are done, and its answer is its one root.

  • b^0 is 1 for every b, 0 too. A power of what holds the unknown is that itself for the exponent 1, 1 for 0, and not linear from 2 on.

  • The answer is a Number: value the integer, or the fraction in lowest terms p/q with its sign before p, such as -7/2; no units; and unknown, the letter of an equation, empty for an expression.

  • The solver does not take a formula, and names why:

    Reason The formula
    syntax is not of the grammar, is longer than 200 bytes, or holds a number of more than 15 digits or an exponent above 10
    unknown_in_expression is an expression with an unknown
    no_unknown is an equation with no unknown
    two_unknowns holds two letters or more
    not_linear multiplies two parts whose coefficients of the unknown are not 0, divides by such a part, or raises it to 2 or more, as the operations come out: x*x, 1/x and (x+1)^2, but not (x-x)*x
    division_by_zero divides by zero
    no_root is an equation that no number solves, as x+1=x
    every_root is an equation that every number solves, as x+1=1+x
    too_large has, on the way, a numerator or a denominator of more than 100 digits, or an answer longer than 16 characters

    Of several reasons, the first that applies is named: syntax, then two_unknowns, then unknown_in_expression and no_unknown; then those of the operations, not_linear, division_by_zero and too_large, as the operations are done, each part before its operation and the left before the right; then no_root and every_root; and last too_large of the answer.

    A formula it does not take is no outcome of a task from paper, which the solver does not check.

An answer. An Answer is a key the program may compare only when it holds these, and none otherwise, as for a task with no one answer of these kinds — a proof, a drawing, a construction, several answers, a text:

  • a Number: value in the notation of number, at most 16 characters (the module format, on checks); units, the words that may follow it, none empty and no two the same once they went through the steps of units; unknown, one letter from a to z, or empty;
  • a Choice: options, from 2 to 10 labels as the statement prints them without their brackets, each from 1 to 16 characters, and none empty and no two the same once normalized as a choice; and key, one of them as written.

An answer that breaks any of these is none. With none, the task has no key: its TaskKey has no answer, and its item is unchecked.

The key. Each task's: the solver's answer, with the provenance PROVENANCE_SOLVER, or an answer of AI, with PROVENANCE_AI. The verdict by a key is the same "Correct" or "Not yet" by either.

The verdict. Each task's key gives it its item, the task n the item n, with one answer slot bound anywhere at the place n, 1, and its check:

  • a Number, the check kind number with its value as key and its units;
  • a Choice, the check kind choice written by hand, with its key, its options and notation: options.

The check has no trap values. The readings are joined and judged by the rules of the observation, above, and by the checks of the module format, as on a task of a module, once each value read is brought to the key:

  • with a Number whose unknown is a letter, a value that after steps 1 to 4 of numbers begins with that letter, in either case, an optional space and =, loses the letter and the space, and step 5 drops the =: x = 4 and X=4 read as 4;
  • with a Choice, a value that after NFKC and steps 3 and 4 of numbers is a label in brackets — (C), [C], or C) with a bracket at its end alone — loses its brackets.

Test vectors. The test vectors hold the rules of this section, the solver's of module-kit alone, and none of the Check: contracts/vectors/paper/v1/<case>.json. spec's checks compute each, as a second implementation (just contracts-check), and module-kit's CI passes them all, from contracts.Vectors at the tag it takes (see the generated code, above).

  • solver.json: description and cases, each with its description, formula, and either answer, the Number the solver gives, or refused, the reason it does not take the formula.
  • answers.json: description and cases, each with its description, answer, an Answer, and key, whether it is an answer, true, or none, false.
  • verdicts.json: description and cases, each with its description, key, the Answer of the key, value, the value read, or null when nothing was, and verdict, { verdict, reason } as the test vectors of verdicts of the module format write them.
  • The messages are written as the rules of JSON, above, have it, with the protobuf names. Together the vectors give every reason of the solver, every rule of an answer, and both ways a value is brought to the key.

Documentation

Overview

Package contracts holds the test vectors of the API contracts, which Go code takes at the tag of a release of the module, contracts/vX.Y.Z, as it takes the code of the contracts:

go get github.com/altnovatrail/spec/contracts@vX.Y.Z

The package is there from the first release after v0.7.0. What the vectors hold and how a reader passes them is the text of the contracts, contracts/README.md.

Index

Constants

This section is empty.

Variables

View Source
var Vectors = sub("vectors")

Vectors is the test vectors of the contracts as the release has them: vectors/ at its tag, with a folder for each package that has them, <part>/vN/, such as observation/v1/boxes.json.

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
novatrail
api/v1/apiv1connect
The account and its profiles in the contract between `app` and `api`: the account and the list of its profiles, by which `app` erases on the device what was deleted elsewhere; the profile of the account's owner and a child's profile, which a consent comes before; how a consent is given, confirmed by a parent's signed form, withdrawn and taken back, and the age given again; the PIN of the section for adults; the voicing and the hint mode a learner sets; the goal for the tutor an adult sets; the storage of works; the own key checked when it is connected; the share of the quota of platform AI; deletion and export.
The account and its profiles in the contract between `app` and `api`: the account and the list of its profiles, by which `app` erases on the device what was deleted elsewhere; the profile of the account's owner and a child's profile, which a consent comes before; how a consent is given, confirmed by a parent's signed form, withdrawn and taken back, and the age given again; the PIN of the section for adults; the voicing and the hint mode a learner sets; the goal for the tutor an adult sets; the storage of works; the own key checked when it is connected; the share of the quota of platform AI; deletion and export.

Jump to

Keyboard shortcuts

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