@altnovatrail/canvas 0.3.5 → 0.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +17 -3
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -44,19 +44,33 @@ just -f spec/justfile release-verify canvas v<version> samples-page_v<version>.h
44
44
 
45
45
  with its bundle, `samples-page_v<version>.html.sigstore.json`, beside it.
46
46
 
47
+ ## The generator of a module's eval set
48
+
49
+ Each release carries the generator of a module's synthetic samples as one file, `synthetic-module_v<version>.mjs`: one ES module that Node 24 runs with no package of npm beside it, which writes what `just synthetic-module` writes, byte for byte. A module's CI takes it from a release by its exact tag and digest, checked as any file of a NovaTrail release, and runs it with the arguments of `just synthetic-module` (below):
50
+
51
+ ```sh
52
+ just -f spec/justfile release-verify canvas v<version> synthetic-module_v<version>.mjs
53
+ node synthetic-module_v<version>.mjs --module <package> <tag> <folder> <task>:<seed>...
54
+ node synthetic-module_v<version>.mjs --digest <package> <task>...
55
+ ```
56
+
57
+ `--digest` prints a line for each task named, its ID and the digest of its open view, `sha256:` and 64 hexadecimal digits, by the same projection the samples name a task by: a module's CI holds people's samples to the package of its commit with it. A task the generator draws no sample of — a choice, an essay, a zone — has its digest too. A template has no open view, and a task the package does not have no digest: the call prints the other tasks' lines all the same, names each of those after them, and exits 1.
58
+
59
+ The file opens with a comment that says what it is and holds the license notices of all the code it carries, and its code is not minified, so that whoever runs it can read it.
60
+
47
61
  ## Code
48
62
 
49
63
  - `src/core/` — the DOM-free part, `@altnovatrail/canvas/core`: it runs the same in a browser and in Node, and its entry point gives the sheet's size, the types of the data and the fold of a history into its strokes.
50
64
  - `src/element/` — the element `<novatrail-canvas>`, `@altnovatrail/canvas`: importing it registers the element. The types of its contract with the app — the element as `CanvasElement` has it, its events, the media, the tutor's marks, the history of writing, the work for checking and its context — are spec's, from `@altnovatrail/spec/canvas`, and this entry point gives them under spec's names, the same types; the DOM-free part gives the data's among them, the history of writing and the context of a submission. The app takes them from spec's package, `import type { CanvasElement } from "@altnovatrail/spec/canvas"`, at the version canvas has in its `dependencies`; canvas's own are only what the contract does not name: the commands `undo()` and `clear()`, and the task's temporary tools.
51
65
  - `src/eval/` — the sample file of spec's eval protocol, which the samples page and the synthetic samples write: a sample of each composition, on a sheet or a workbook, its final geometry and its crops, written and read by the code of `@altnovatrail/contracts`; and the synthetic samples themselves, which code draws from a seed, with a hand of its own, on tasks of tutor's file of open tasks or, for a module's eval set, of the module's package. It runs the same in a browser and in Node, and is no part of the package.
52
- - `scripts/` — the check of the package as a consumer takes it, and of the archive a release puts out, the script that writes the synthetic samples into a folder and the one that packs them for a release, and the script that writes the row's icons, `src/element/icons.ts`, and `NOTICE` from the set of icons the lock file pins: `just icons` runs it, and `just ci` fails if they are not what it writes.
66
+ - `scripts/` — the check of the package as a consumer takes it, and of the archive a release puts out, the script that writes the synthetic samples into a folder and the one that packs them for a release, the generator of a module's eval set and the builder of its file, and the script that writes the row's icons, `src/element/icons.ts`, and `NOTICE` from the set of icons the lock file pins: `just icons` runs it, and `just ci` fails if they are not what it writes.
53
67
  - `demo/` — a page to try the element on by hand, as the app is to have it: it gives the element a language and its task the tools allowed, keeps the history of writing as the element tells it and opens the sheet again from it, draws the groups of the strokes and the crop for checking under the sheet, gives the tutor's marks back over the crop Check sent, and shows a workbook's pages in the font and the language it gives, how many boxes are filled, the crop of each filled box Check sent and a mark given back on a box, and a lesson's worked example on a new element, on which nothing is written, whose demo opens part by part — a picture on an area of the sheet on the sheet itself — the page keeping how far it has gone and giving it back to the next element. `just demo` serves it on this machine.
54
68
  - `vectors/` — the test vectors of the workbook's page layout, which its test writes and keeps current. The vectors of the rules the sheet shares with tutor's eval runner — the groups of strokes, the crop for checking, the snapping of a model's box to the strokes and the rule of boxes — are spec's, from its npm package `@altnovatrail/contracts`, and the tests hold the sheet's code to them.
55
69
  - `examples/` — synthetic sample files, one of each composition, which the test of `src/eval/` writes and keeps current, and which spec's `sample-check` checks in CI.
56
- - `tasks/` — the file of open tasks of a release of tutor that the synthetic samples answer, as the release has it, with its signature, which spec's `release-verify` checks in CI; and the index of a release of modules, signed too, with the inventory and canonical view of one package it names, on which CI writes the samples of a module's eval set.
70
+ - `tasks/` — the file of open tasks of a release of tutor that the synthetic samples answer, as the release has it, with its signature, which spec's `release-verify` checks in CI; and the index of a release of modules, signed too, with the inventory and canonical view of two packages it names: grade-3-math, on which CI writes the samples of a module's eval set, and english-essays, whose essays and choices the tests hold to the digests of their open views that module-kit gives.
57
71
  - `licenses.json` — the packages the license check accepts by name, each with why.
58
72
 
59
- `just build` builds the package into `lib/`, and `just release-files v0.1.0` writes the files of that release into `dist/` — the package's archive, with NOTICE in it, the synthetic samples' archive and the list of what each shows, the samples page, LICENSE and SHA256SUMS — and prints the sums, which a build of the same commit gives again. `just synthetic <folder>` writes the synthetic samples into a folder, one file each, and prints what each shows: no tree holds them. `just synthetic-module <package> <tag> <folder> <task>:<seed>...` writes synthetic samples of a module's eval set: run it from a clone of canvas at a release's tag, with the package that `module-kit build` wrote of the module at the commit the samples go into, the tag of the newest release of modules, and the module's `eval/` folder; it writes `synthetic-<seed>.json` for each task and seed named, writes a seed's file anew only when it is a sample of the same task, and refuses a template, a choice, an essay or a zone, writing nothing then. `just ci` runs the checks CI runs: format, lint and types; the tests in Node and in Chromium; advisories; licenses. They run in the devcontainer, whose toolchain stage holds the browser the tests run in. The license check is spec's recipe, run from the `spec/` submodule with the exceptions in `licenses.json`, so it needs `spec/` checked out: see [CLAUDE.md](CLAUDE.md), Environment.
73
+ `just build` builds the package into `lib/`, and `just release-files v0.1.0` writes the files of that release into `dist/` — the package's archive, with NOTICE in it, the synthetic samples' archive and the list of what each shows, the samples page, the generator of a module's eval set, LICENSE and SHA256SUMS — and prints the sums, which a build of the same commit gives again. `just synthetic <folder>` writes the synthetic samples into a folder, one file each, and prints what each shows: no tree holds them. `just synthetic-module <package> <tag> <folder> <task>:<seed>...` writes synthetic samples of a module's eval set, by the same file a release carries, built from the tree: to write what a release's file writes in a module's CI, run that file, or the recipe in a clone of canvas at its tag, with the package that `module-kit build` wrote of the module at the commit the samples go into, the tag of the newest release of modules, and the module's `eval/` folder; it writes `synthetic-<seed>.json` for each task and seed named, writes a seed's file anew only when it is a sample of the same task, and refuses a template, a choice, an essay or a zone, writing nothing then. `just ci` runs the checks CI runs: format, lint and types; the tests in Node and in Chromium; advisories; licenses. They run in the devcontainer, whose toolchain stage holds the browser the tests run in. The license check is spec's recipe, run from the `spec/` submodule with the exceptions in `licenses.json`, so it needs `spec/` checked out: see [CLAUDE.md](CLAUDE.md), Environment.
60
74
 
61
75
  ## Documents
62
76
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altnovatrail/canvas",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "description": "NovaTrail's canvases: the workplace of a task, where the learner writes, draws and types.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {