spec

package module
v0.17.4 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 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

spec

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

Code Smells Reliability Rating Security Rating Maintainability Rating Vulnerabilities

Official standards, schemas, and guidelines for NovaTrail, a universal open platform for adaptive learning, interactive lessons, and AI tutoring.

NovaTrail turns any subject into interactive lessons with an AI tutor, for children and adults alike. A subject comes as a module that anyone can author: a graph of skills, lessons, tasks, typical mistakes, and the kind of canvas the learner works on. The learner writes, draws, types, moves things or speaks. The AI reads the work and talks with the learner, but whether an answer is right is decided by a program against the task's key, never by the model. A learner model brings together the skills of every module, and an engine picks what comes next.

Status

Early design. This repository holds the platform's documents and the module format, in format/: its text, schemas, examples and test vectors. Version 0.1 came out as files for code from the release v0.3.0, with its types for Go from v0.3.4 and for TypeScript from v0.4.0; version 0.2, whose digit on a crop is 24 px high unless the module gives it, came out from v0.6.0; version 0.3, which names the version of go.starlark.net that runs all its Starlark and brings the rules by which the versions of a module compare, came out from v0.9.0; and version 0.4, which brings what the three modules of the first slice asked of it — times, words written by hand, the page of a workbook, worked examples on it and leading questions among them —, comes out from v0.10.0. The first contract between components, the types of the element <novatrail-canvas> between canvas and app, comes out from v0.5.0 (R74), and the other contracts come after it. NovaTrail succeeds MathTrail, olympiad maths for grades 1–6, which is now frozen.

Repositories

All under altnovatrail. Created now, for stages 0–2:

Repository What it is
spec this repository: the vocabulary, formats, contracts and platform documents
.github the organization's profile, community files and shared CI workflows
modules the official modules: olympiad maths, school maths for grade 3 and short essays in English
module-kit the module format in code — validation, packages, open views, check kinds — and the authors' CLI
learner-model the learner model: how well each skill is mastered, from the evidence of attempts
engine picks the next lesson or task
sim virtual learners that test the learner model and the engine
tutor the AI side: reading the work, the tutor's words, routes to AI, eval; a library inside api
api the backend and the platform's only service: accounts, attempts, checks, the learner model, the engine
canvas the canvases the learner works on, and their layers
skill-map the learner's skill map
app the web app for learners and the adults beside them
infra shared infrastructure: OpenTofu, domains, deployment, self-hosting

Later: site (stage 3); module-registry, module-pipeline and widget-template (stage 4).

How the parts fit together is in docs/architecture.md. The order in which the repositories appear, and how to set one up, is in docs/repositories.md; every repository starts from the same template, repo-template/, and follows the same rules, RULES.md.

Releases

A release comes out by itself once the checks pass on main: the next patch of the current line, tagged vX.Y.Z with the release, and nobody tags by hand. The module format has a version of its own, and a change that gives it a new version always starts a new line (R44); so do the admission table (R96), the deployment configuration (R85), the legal texts (R130), the table of the age of digital consent (R134) and the format of the export (R135). Other repositories take its tag as the spec submodule, for the documents and rules, and their code takes the release's files. From the line 0.3 on, a release carries the module format as format-<version>.tar.gz, with its cosign bundle format-<version>.tar.gz.sigstore.json beside it, and Go code takes the same tag as the version of the Go module github.com/altnovatrail/spec, whose package holds the format as spec.Format, with the types of the format in the packages types/formatv0 and types/formatv0/open (R72). From the line 0.4 on, a release carries the same types for TypeScript too, as the npm package @altnovatrail/spec in altnovatrail-spec-<version>.tgz, signed the same way; the package in npm is that file, which the release publishes there itself, by trusted publishing (R37, R73). From the line 0.5 on, the package also holds the types of the element <novatrail-canvas> as @altnovatrail/spec/canvas. They are the contract between canvas and app, written by hand in types/canvas/ (R74). From the line 0.8 on, a release carries the admission table too, as admission-<version>.tar.gz: Go code takes it as spec.Admission, with its types in the package types/admissionv0, and TypeScript its types as @altnovatrail/spec/admissionv0 (R96). From the line 0.11 on, a release carries the format of the deployment configuration too, as deployment-<version>.tar.gz, its version an integer: Go code takes it as spec.Deployment, with its types in the package types/deploymentv1, and TypeScript its types as @altnovatrail/spec/deploymentv1 (R85). From the line 0.13 on, a release carries the legal texts as legal-<version>.tar.gz, taken by Go code as spec.Legal, with their types in types/legalv3 and @altnovatrail/spec/legalv3, of the part's version 3, from the line 0.17 on, legalv2 in the lines 0.15 and 0.16, and legalv1 before (R130, R141); and from the line 0.14 on the table of the age of digital consent as consent-age-<version>.tar.gz, taken as spec.ConsentAge, with its types in types/consentagev1 and @altnovatrail/spec/consentagev1 (R134), and the format of the export as export-<version>.tar.gz, taken as spec.Export, with its types in types/exportv2 and @altnovatrail/spec/exportv2, of the part's version 2, from the line 0.17 on, and exportv1 before (R135), each version an integer. From the line 0.7 on, a release carries the code of the API contracts too, generated from contracts/ (R83). Go code takes it from the Go module github.com/altnovatrail/spec/contracts, at the tag contracts/vX.Y.Z that the release sets on the same commit, with the number of the release, and TypeScript from the npm package @altnovatrail/contracts in altnovatrail-contracts-<version>.tgz, signed the same way, which its README describes; the package in npm is that file too, which the release publishes there itself, as it does the types' package. A repository moves the spec submodule, both Go modules and both npm packages together, at one tag, and leaves them out of Dependabot: a release comes out with each change of a document. Releases are immutable, so a tag stays on its commit and no file changes once it is out, and GitHub attests each one with its files. A file of a release, spec's or any NovaTrail repository's, is checked by just release-verify, with its bundle beside it, and the packages of @altnovatrail in an npm lock file by just release-verify-npm (R77). They check the file's signature against Sigstore's trust root and everything its certificate names — who signed, at whose call, on which branch and of which commit — and, for a file of spec, the commit or version the file itself holds; that is the check NovaTrail's code and CI rely on. Another repository runs them from its submodule, just -f spec/justfile release-verify …. The attestation, which ties a file to a release rather than to a commit, gh release verify and gh release verify-asset check apart:

just release-verify spec v0.5.6 format-0.1.tar.gz
just release-verify spec v0.7.0 altnovatrail-contracts-0.7.0.tgz
just release-verify-npm package-lock.json
gh release verify v0.5.6 -R altnovatrail/spec
gh release verify-asset v0.5.6 format-0.1.tar.gz -R altnovatrail/spec

Documents

The documents are in English, but for the work plan, its technical debt, the cross-repository plan and the archives of its epics, which are in Russian (R143); the module format is in English and normative.

  • docs/product.md — what we build and why: who it is for, the principles, the first slice, the roadmap and the open product questions.
  • docs/concepts.md — the shared vocabulary: module, skill, lesson, task, canvas, check, tutor, learner model and engine, with a glossary that names each term as code and schemas will.
  • docs/privacy.md — privacy and age: kinds of data, age categories, the two routes to AI, and what each AI provider's terms say about minors.
  • docs/architecture.md — the platform's big parts and how they connect: the components, one overall diagram, the main flows, and how the interface is put together.
  • docs/repositories.md — how the platform is split into repositories: their roles, dependencies, how changes flow between them, the order they appear in, how to set one up, and what is carried over from MathTrail.
  • docs/decisions.md — the decision log: what was decided, why, and what was rejected.
  • docs/sources.md — the sources the documents rest on: providers' terms, laws, standards, other programs' documentation and MathTrail's texts, each with its date and its quote.
  • docs/measurements.md — the results of measurements: where the tokens of the Claude Code sessions go, and what each change of epic E10 gave.
  • admission/ — the admission table: to which AI provider, on which route to AI, the work of a learner of each age category may go, and which capability of AI may serve each category, with the facts of a deployment that open a cell. Its text, the table, its schemas, examples and test vectors, and just admission-check checks them (R96).
  • deployment/ — the deployment configuration: the file /deployment.json that the learner's app reads at its start, with the origin of the platform's API and the parameters of the sign-in service, and the rules by which a reader accepts it. Its text, its schemas, examples and test vectors, and just deployment-check checks them (R85).
  • legal/ — the legal texts of the platform: the privacy policy, the terms of use, the consents, and the sets of texts of the samples page with the volunteer's form, each in versions numbered from 1 that never change once in force, with their gist in the languages of the interface. The app gets them from the API, and the samples page and the organizer from a release file. Its text, the passport, the texts, their schemas, examples and test vectors, and just legal-check checks them (R130).
  • consent-age/ — the table of the age of digital consent: for each country of the EU and the EEA, the United Kingdom and the United States, the age from which a learner gives consent themselves, from the day it applies, with the law and its provision, a quote, the source and the date it was read; a country outside the table has 18. The API puts a learner in an age category by it. Its text, the table, their schemas, examples and test vectors, and just consent-age-check checks them (R134).
  • export/ — the format of the export of a learner's profile or of a whole account: a ZIP of files of JSON, with the part of the API byte for byte, what the device holds, and the evidence log and the model's state as the JSON of their protobuf messages beside their .proto files. The app builds it, and anyone reads it with no library. Its text, its schemas, examples and test vectors, and just export-check checks them (R135).
  • format/ — the module format: what a module may and must contain and how the platform checks it. Its text, the schemas of the manifest, the skill graph, the trap and technique catalogs, the solving steps, the task, with the checks of the task's answer slots, its hints and its templates, and the lesson, the generator of randomness, the shared taxonomy of skills, the layout of a module, the package of a module — its canonical view and its inventory — and the module index, which names every published version of every module, are written, with their examples, the test vectors of the YAML rules, of a whole module, of the manifest, of the skill graph, of the trap catalog, of the task and of the lesson, and the test vectors of the open view, of verdicts, of the leak check, of the generator, of templates, of tiers, of packages and of the module index, and just format-check checks them; the other parts of a module come as they are written.
  • RUN.md — the work plan, in epics: the current epic broken into small tasks, run and reviewed one at a time, and the epics that come later.
  • DEBT.md — the technical debt, in Russian: what was put off on purpose, what it risks and when to return; table 4 of the work plan.
  • COORDINATION.md — the cross-repository plan, in Russian: in what order the other repositories' tasks run, by repositories 6, and which task waits for which, each row pointing to a task in that repository's RUN.md (R76).
  • draft/ — a clickable prototype of the learner's app, and where it differs from the documents.

Contributing

Report a bug or propose a change in an issue, in English or Russian, and open one before a pull request unless the pull request fixes a typo or a broken link. How a change comes in, with every commit signed off, and what every change keeps to are in the organization's CONTRIBUTING.md; the rules every NovaTrail repository shares are in RULES.md. Report a vulnerability privately, as the security policy says, never in a public issue.

Work in the devcontainer: open the repository in VS Code and choose "Reopen in Container". It holds every tool at the version the repository pins. The checks are recipes of the justfile, and just --list names each with its arguments:

  • just docs-check checks the documents: links, cited sections, the registers and Mermaid diagrams;
  • just format-check checks the module format in format/: its schemas, examples and test vectors, and computes the verdicts and traps of the vectors of verdicts, what the leak check finds in the vectors of the leak check and in the lessons of a module, the numbers of the vectors of the generator, the instances of the vectors of templates, with the results of their solvers as the vectors give them, the tiers of the vectors of tiers, the package of each module of the vectors of packages — its canonical view, the listing of its device part, its inventory and their digests —, and the module index that each vector of the index builds of its release, or the rule of the index that refuses it;
  • just admission-check checks the admission table in admission/: its schemas, the table and the rows of privacy 5.3 and decisions it cites, its examples, and its test vectors, whose answers it computes as the admission function does;
  • just deployment-check checks the format of the deployment configuration in deployment/: its schemas, examples and test vectors, whose files it reads as the app and the rollout read them, by the schema and then by the rules of reading;
  • just legal-check checks the legal texts in legal/: their schemas, examples and test vectors, and the part itself, read by the schema and then by its rules, against the part of the release before, so that a version in force never changes; a self-hosted copy checks its own texts by just -f spec/justfile legal-check-dir <folder>;
  • just consent-age-check checks the table of the age of digital consent in consent-age/: its schemas, examples and test vectors — of reading the table and of the category it gives a learner —, and the table itself, read by the schema and then by its rules, against the table of the release before, so that an age once given never changes;
  • just export-check checks the format of the export in export/: its schemas, examples and test vectors of reading an export, unpacked, by the schemas and then by its rules;
  • just types-check checks the types of the module format, of the admission table, of the deployment configuration, of the legal texts, of the table of the age of digital consent and of the files of an export under types/, in Go and TypeScript. They must be what just types generates from the schemas. Each value of format/, admission/, deployment/, legal/, consent-age/ and export/ that passes a schema must be read by its Go type and written back as it was, and tsc must take it as a value of its TypeScript type from the npm package. tsc must also take tools/types/canvas.check.ts, the check of the hand-written types of <novatrail-canvas> in types/canvas/, with the DOM and with the npm package of the contracts' code, whose message Mark the element's marks are held to;
  • just contracts-check checks the API contracts in contracts/: buf's format, lint and comparison with the previous release, the rules of the contracts that buf does not hold, the code buf generates, which just contracts writes, and its npm package, which tsc and Node take, and computes the test vectors of the observation — whether each observation is valid, how two join and which verdicts the joined one gives —, which the module of the contracts carries as contracts.Vectors, and the test vectors of the rules the device and the runner share — how a history of writing folds, the groups of strokes, the crop, snapping and the boxes of a workbook —, which the module carries there too and the npm package by their paths, and holds the examples of the sample file of the eval protocol to their rules — the fields a sample's purpose and writer give it, its strokes, crops and their PNG, its markup, and the numbers of its crops and the groups and boxes of its history by the rules of the strokes — and the examples of the runner's report to its form and to the samples they name;
  • just go-check checks the Go modules code takes from a release — the module at the root and the module of the contracts: what each requires, and its zip as the Go module proxy will build it;
  • just ci-lint, just ci-test, just ci-vuln and just ci-licenses check every Go module of spec — the Go module and the modules of tools/ — as the shared Go checks of every NovaTrail repository run them: gofmt and go vet, the tests with the race detector, govulncheck and go-licenses. ci-test writes the coverage of the tests to coverage/go.out;
  • just licenses-check checks the licenses of the packages of tools/;
  • just release-version prints the version the next release takes, and just release-files HEAD <folder> <tag> builds the files it carries, the npm packages of that tag among them;
  • just coverage runs every test of tools/ and writes their coverage to coverage/lcov.info, then the tests of the Go modules, as ci-test runs them.

A check prints a line for each problem it finds, file:line: message for the documents, the format and the contracts, and exits with a non-zero status if it finds any. CI runs them all on every pull request and on main, and a pull request merges only when they pass. Another NovaTrail repository checks its own documents with just -f spec/justfile docs-check-repo, and its sample files of the eval protocol with just -f spec/justfile sample-check <file>…, by the code that checks the examples. The environment and the checks are described in more detail in the Environment section of CLAUDE.md.

License

Apache-2.0.

Documentation

Overview

Package spec is what Go code of the NovaTrail platform takes from spec: its normative parts as files, at the tag of a release, which is the version of this module (R64). Code takes them from here rather than from the spec/ submodule its repository keeps for the documents (R21):

go get github.com/altnovatrail/spec@v0.3.0

go.sum and the Go checksum database then hold the files to the bytes of that tag.

Index

Constants

This section is empty.

Variables

View Source
var Admission fs.FS = &part{&admissionFiles, "admission"}

Admission is the admission table as the release has it (R96): admission/ at its tag, with the text, VERSION, the table, its schemas, its examples and its test vectors (admission/README.md, section 3). Its root is admission/, so that the table is "admission-table.json".

View Source
var ConsentAge fs.FS = &part{&consentAgeFiles, "consent-age"}

ConsentAge is the table of the age of digital consent as the release has it (R134): consent-age/ at its tag, with the text, VERSION, the table, the schemas, the examples and the test vectors (consent-age/README.md, section 3). Its root is consent-age/, so that the table is "consent-age.yaml". api computes a learner's age category by it (consent-age/README.md, section 6).

View Source
var Deployment fs.FS = &part{&deploymentFiles, "deployment"}

Deployment is the format of the deployment configuration as the release has it (R85): deployment/ at its tag, with the text, VERSION, the schemas, the examples and the test vectors (deployment/README.md, section 3). Its root is deployment/, so that the schema of the file is "schemas/deployment.schema.json".

View Source
var Export fs.FS = &part{&exportFiles, "export"}

Export is the format of the export as the release has it (R135): export/ at its tag, with the text, VERSION, the schemas of the files of an export, the examples and the test vectors (export/README.md, section 3). Its root is export/, so that the schema of a profile's file is "schemas/profile.schema.json". api writes its part of an export by it (export/README.md, section 8).

View Source
var Format fs.FS = &part{&formatFiles, "format"}

Format is the module format as the release has it: format/ at its tag, with the text, VERSION, the schemas, the examples and the test vectors (format/README.md, section 3). Its root is format/, so that VERSION is "VERSION" and a schema is "schemas/task.schema.json".

View Source
var Legal fs.FS = &part{&legalFiles, "legal"}

Legal is the legal texts as the release has them (R130): legal/ at its tag, with the text, VERSION, the passport, the versions of the texts, the schemas, the examples and the test vectors (legal/README.md, section 3). Its root is legal/, so that the passport is "legal.yaml" and a version of a text is "texts/privacy-policy/1.md". api serves the texts from it (legal/README.md, section 8).

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
contracts module
types
admissionv0
Package admissionv0 holds the types of the admission table, major version 0, generated from the schemas of version 0.3 in admission/schemas by tools/types (R72 and R96 in spec's docs/decisions.md): the table, and the vectors of answers of the admission function.
Package admissionv0 holds the types of the admission table, major version 0, generated from the schemas of version 0.3 in admission/schemas by tools/types (R72 and R96 in spec's docs/decisions.md): the table, and the vectors of answers of the admission function.
consentagev1
Package consentagev1 holds the types of the table of the age of digital consent, version 1 of the part, generated from the schemas in consent-age/schemas by tools/types (R72 and R134 in spec's docs/decisions.md): the table consent-age/consent-age.yaml, with the age of each country from a day on and the law that sets it, the vectors of reading and the vectors of the category.
Package consentagev1 holds the types of the table of the age of digital consent, version 1 of the part, generated from the schemas in consent-age/schemas by tools/types (R72 and R134 in spec's docs/decisions.md): the table consent-age/consent-age.yaml, with the age of each country from a day on and the law that sets it, the vectors of reading and the vectors of the category.
deploymentv1
Package deploymentv1 holds the types of the deployment configuration, version 1, generated from the schemas in deployment/schemas by tools/types (R72 and R85 in spec's docs/decisions.md): the file /deployment.json, whose fields keep the names of R09 app, in camelCase, as their JSON tags, and the vectors of reading.
Package deploymentv1 holds the types of the deployment configuration, version 1, generated from the schemas in deployment/schemas by tools/types (R72 and R85 in spec's docs/decisions.md): the file /deployment.json, whose fields keep the names of R09 app, in camelCase, as their JSON tags, and the vectors of reading.
exportv2
Package exportv2 holds the types of the format of the export, version 2 of the part, generated from the schemas in export/schemas by tools/types (R72 and R135 in spec's docs/decisions.md): the files of an export — the manifest, the account, a profile with every record of it and what a device holds of it — and the vectors of reading.
Package exportv2 holds the types of the format of the export, version 2 of the part, generated from the schemas in export/schemas by tools/types (R72 and R135 in spec's docs/decisions.md): the files of an export — the manifest, the account, a profile with every record of it and what a device holds of it — and the vectors of reading.
formatv0
Package formatv0 holds the types of the module format, major version 0, generated from the schemas of version 0.4 in format/schemas by tools/types (R72 in spec's docs/decisions.md).
Package formatv0 holds the types of the module format, major version 0, generated from the schemas of version 0.4 in format/schemas by tools/types (R72 in spec's docs/decisions.md).
formatv0/open
Package open holds the open view of each part of a module (format/README.md, section 6): the struct of each type the open view of a part reaches, by the name it has in formatv0, with the fields marked x-open alone, of version 0.4.
Package open holds the open view of each part of a module (format/README.md, section 6): the struct of each type the open view of a part reaches, by the name it has in formatv0, with the fields marked x-open alone, of version 0.4.
legalv3
Package legalv3 holds the types of the legal texts, version 3 of the part, generated from the schemas in legal/schemas by tools/types (R72 and R130 in spec's docs/decisions.md): the passport legal/legal.yaml, with the texts, their versions and the sets of texts of the samples page, and the vectors of reading.
Package legalv3 holds the types of the legal texts, version 3 of the part, generated from the schemas in legal/schemas by tools/types (R72 and R130 in spec's docs/decisions.md): the passport legal/legal.yaml, with the texts, their versions and the sets of texts of the samples page, and the vectors of reading.

Jump to

Keyboard shortcuts

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