evalsample

package
v0.1.74 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: 35 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.

Documentation

Overview

Package evalsample is a sheet of the measurement as a sample file of spec's eval protocol, the message Sample of novatrail.eval.v1: Of writes a sheet that internal/synth drew as one, and Read reads one back into the sample that tutor's runner takes, internal/sample's, with what its plan sheet says and the protocol does not — the scenario, the planned erasure and the trap. Read refuses a sample as the protocol has the runner refuse one: one that spec's check sample-check finds invalid, one without its markup, one of another task, one whose markup does not fit its task, and a child's.

A sample that the samples page of canvas did not write, a drawn one, names canvas 0.0.0 and the set of texts "none", the values of no release, which sample-check asks of a synthetic sample.

Index

Constants

View Source
const (
	CanvasVersion  = "0.0.0"
	TextSetVersion = "none"
)

What a drawn sample names that only the samples page of canvas has: no version of canvas and no set of texts, since neither wrote or showed anything.

View Source
const OpenTasks = "eval/open-tasks.json"

OpenTasks is the file of open tasks in tutor's tree, which a release of tutor carries as tutor_<version>_open-tasks.json, byte for byte: a sample that names a task of a release names it by that file's digest.

View Source
const Pointer = "pen"

Pointer is the pointer a drawn stroke names: the synthetic hand writes as a pen does.

Variables

View Source
var ErrNotEssay = errors.New("evalsample: the sample is no essay on a sheet with its history, and the runner of the essays reads only those")

ErrNotEssay is the error of a sample that is no essay on a sheet with its history: a final geometry, or a page of a workbook, which the runner of the essays does not read.

View Source
var ErrNotPage = errors.New("evalsample: the sample is no page of a workbook with its history, and the runner of the workbook reads only those")

ErrNotPage is the error of a sample that is no page of a workbook with its history: a final geometry, or a sheet, which the runner of the workbook does not read.

View Source
var ErrNotSheet = errors.New("evalsample: the sample is no sheet of measurement with its history, and the runner of sheets reads only those")

ErrNotSheet is the error of a sample that is no sheet of measurement with its history: a final geometry, or a page of a workbook, which the runner of sheets does not read.

View Source
var ErrOtherFile = errors.New("evalsample: the file of its task is neither a bank of sheets nor the workbook, and the runner reads samples of tutor's releases of only those")

ErrOtherFile is the error of a sample whose task's file at its tag is neither a bank of sheets nor the workbook: the essays, or a file of no tasks, whose samples the check of canvas's synthetic samples does not read.

View Source
var ErrUnmarked = errors.New("evalsample: the run of the workbook cannot stand for the markup of the page")

ErrUnmarked is the error of a page whose markup the run of the workbook cannot stand for: what it writes in its boxes, and what a right reader reads there, are the values of the page's file.

Functions

func CropSet

func CropSet(strokes []sample.Stroke, groups []lines.StrokeGroup, heights []int) (*evalv1.CropSet, error)

CropSet is the set of crops of strokes, with the frames of their groups (none on a workbook), at each of the heights: the box of their points and h_med in whole tenths, and each crop's numbers and PNG, as the rule of the crop gives them.

func Digest

func Digest(data []byte) string

Digest is the digest of a file as the protocol names one: "sha256:" and the SHA-256 of its bytes.

func EssayDifferences added in v0.1.7

func EssayDifferences(es *evalv1.Sample, f *Essays, e *sample.Essay) []string

EssayDifferences are where an essay's sample is off what its file says of the essay, by paths alone, nothing of the handwriting: its truth and its marks, which must be essayMarkup's.

func EssayFile added in v0.1.7

func EssayFile(number int) string

EssayFile is the name of the sample of an essay in its directory, essay-01.json for the first.

func EssayTask added in v0.1.7

func EssayTask(es *sample.Essays, e *sample.Essay) string

EssayTask is the ID of an essay's task, as its sample names it.

func Groups

func Groups(strokes []sample.Stroke, erasures []sample.Erasure) ([]*evalv1.Group, error)

Groups are the groups of a sheet's strokes as the protocol writes them, by the rule of groups (lines.Groups): in the order of their labels, A to Z and then AA, each with the IDs of the strokes the sheet shows in it, ascending.

func GroupsOf

func GroupsOf(groups []*evalv1.Group) []lines.StrokeGroup

GroupsOf are a sheet's groups as the crop takes them: each label with its strokes, as tutor's code names them (protocol.StrokeID).

func Heights

func Heights(module int) []int

Heights are the heights of a digit a set of crops is drawn at: those of eval, render.Heights, and the module's, ascending and each once, as the protocol has them.

func HistoryOf added in v0.1.10

func HistoryOf(s *sample.Sample, pointer string) (*evalv1.History, map[string]int32, error)

HistoryOf is the sheet's strokes and erasures as a history of writing, each stroke written by the pointer given: the strokes numbered from 1 in the order they were written, which ids gives by their IDs in the sheet; a stroke written at its last point, and an erasure at its time; at one millisecond the strokes come before the erasures, so that an erasure takes off a stroke that ended as it touched.

func ID

func ID(plan string, seed uint64, shift float64, sheet int) (string, error)

ID is the ID of a sample drawn from the seed for the sheet of the number of a plan, by the name of the plan's file: synthetic-<seed>-<plan>-<NN>, and -shift-<thousandths> before the number when the share of the shift of a near sheet is not synth.SimilarShift. It comes from the seed, as the protocol has a synthetic sample's, and the plan, the shift and the sheet tell apart the samples one seed draws: two sets drawn with one seed, and two shares of the shift, share no ID.

func LineList added in v0.1.11

func LineList(at []int) string

LineList names lines of a file, as a refusal by sample-check names them.

func Loose added in v0.1.10

func Loose(s *sample.Sample) string

Loose is the first stroke a sheet shows, in the order they were written, that is in no line and no inscription, or "" when there is none.

func NewID added in v0.1.10

func NewID() (string, error)

NewID is a person's sample's ID, at random: 128 bits in 26 lowercase Latin letters and digits.

func Of

func Of(s *sample.Sample, sh *sample.PlanSheet, b *Bank, seed uint64, id string) (*evalv1.Sample, error)

Of is a sheet that internal/synth drew from the seed for its plan sheet, as a sample of measurement of the protocol, from an adult, with its history of writing: the strokes numbered from 1 in the order they were written, their points to a tenth of a unit, each stroke written at its last point and each erasure at its time; the sheet's groups and crops, which the protocol's rules give the strokes the history shows; the task of the bank by its open view's digest; and the markup that the plan sheet drew: the truth of its one answer slot, the parts in the order they read and the first error.

A sheet with an inscription to steer the model, which the markup has no part for, is no sheet of a plan of the measurement, and Of refuses it.

func OfEssay added in v0.1.7

func OfEssay(e *sample.Essay, f *Essays, seed uint64, id string) (*evalv1.Sample, error)

OfEssay is an essay that internal/synth drew from the seed, as a sample of measurement of the protocol, from an adult, with its history of writing: its strokes numbered from 1 in the order they were written; the sheet, synth.EssayWidth × synth.EssayHeight, with the groups of its strokes and their crops; the essay's task by its open view's digest (task.Essay); and the markup it was drawn with (essayMarkup).

func OfPage added in v0.1.7

func OfPage(drawn *synth.Page, pg *sample.WorkbookPage, w *Workbook, seed uint64, id string) (*evalv1.Sample, error)

OfPage is a page of the workbook that internal/synth drew from the seed, as a sample of measurement of the protocol, from an adult, with its history of writing: its strokes numbered from 1 in the order they were written, box by box, their points to a tenth of a unit; the page, synth.PageWidth × synth.PageHeight, with every box of the page in the task's order and the filled ones, by the rule of boxes, each with its crops at each height the protocol names; the task of the page by its open view's digest (task.Page); and the markup the page was drawn with (pageMarkup). A page whose boxes the rule of boxes does not give the strokes code wrote in them is drawn wrong, and OfPage refuses it.

func PageDifferences added in v0.1.7

func PageDifferences(es *evalv1.Sample, pg *sample.WorkbookPage) []string

PageDifferences are where a page's sample is off what its file says of the page, by paths alone, nothing of the handwriting: the boxes, which must be the page's in its order; the truth of each box and the notes, which must be pageMarkup's; and the filled boxes, which must be those the file writes a value in. A sample off its file is a problem of its page, as a sheet off its plan is (sheets.Differences).

func PageFile added in v0.1.7

func PageFile(number int) string

PageFile is the name of the sample of a page of the workbook in its directory, page-01.json for the first: by the page's number in its file, which its task names too.

func PageTask added in v0.1.7

func PageTask(pg *sample.WorkbookPage) string

PageTask is the ID of a page's task, as its sample names it.

func PersonOf added in v0.1.10

func PersonOf(s *sample.Sample, sh *sample.PlanSheet, b *Bank, h *evalv1.History, ids map[string]int32, id, code string) (*evalv1.Sample, error)

PersonOf is a sheet that a person wrote for its plan sheet, as a sample of measurement of the protocol, from an adult in their own hand or imitating a child's, with the history of writing h, whose strokes ids numbers: a person's origin, the sample's ID id, which they give at random (NewID), and their writer's code, code; and the sheet's groups and crops, its task and its markup as Of has them. A sheet the record mode of the board wrote, or one converted from a file of tutor-sample v0, names canvas 0.0.0 and the set of texts "none", as the samples page of canvas wrote neither.

func PlannedErasure added in v0.1.10

func PlannedErasure(s *sample.Sample, sh *sample.PlanSheet, slips []bool) int

PlannedErasure is the erasure of a sheet the runner takes for the one its plan sheet plans, by its place among the erasures, or -1: the last move of the eraser whose strokes stood where the plan's erasure took them from, the line or the part it names, as sheets.ErasurePlace finds it. What Undo and Clear took away, slips says for each erasure, is never the planned one; the other erasures are slips of the pen. A sample of the protocol keeps no pick of the planned erasure, so the record mode holds the author's pick to this one.

func Read

func Read(es *evalv1.Sample, sh *sample.PlanSheet, b *Bank) (*Sheet, *Refusal, error)

Read reads a sample of the protocol, which sample-check has found valid, as the plan sheet its file's name saves, of the bank of its set. It refuses the sample, as the protocol has it, when:

  • it has no markup;
  • its task is not the plan sheet's: another source than its set's bank, a bank of another digest, no such task, or an open view of another digest;
  • its markup does not fit its task: its truth is no valid observation of the task's, or gets no verdict (module-kit), or it marks criteria of a sheet with no rubric;
  • a child wrote it, whom no contract with a provider admits yet (П-3): nothing of it goes to AI.

What the runner takes of a sample is a sheet of measurement with its history: the strokes and erasures of the history (protocol.Ink), and its parts as the lines. Its scenario, its planned erasure and its trap are its plan sheet's, since the protocol names none; its outcome is the verdict of module-kit on the truth, by the task's key, and its first error the markup's. A sample of another ink or surface is no sheet the runner reads, and Read gives an error, not a refusal.

func ReadEssay added in v0.1.7

func ReadEssay(es *evalv1.Sample, f *Essays) (*Essay, *Refusal, error)

ReadEssay reads a sample of the protocol, which sample-check has found valid, as the essay of the file its task names. It refuses the sample, as the protocol has it, when:

  • it has no markup;
  • its task is not of the essays: another source, a file of another digest, no such essay, or an open view of another digest;
  • its markup does not fit its task: its truth is no valid observation of the essay's (module-kit), it has parts, which an essay has not, a mark names a criterion its rubric has not, or an essay that cannot be read has marks, since it reaches no assessment;
  • a child wrote it (П-3).

A sample of another ink or surface is no essay the runner reads, and ReadEssay gives ErrNotEssay.

func ReadMarkedPage added in v0.1.11

func ReadMarkedPage(es *evalv1.Sample, w *Workbook) (*Page, *Refusal, error)

ReadMarkedPage reads a sample of a page of a set of a capability, as canvas's synthetic samples are: a page whose values are its own, not those the workbook's file writes in its boxes. It refuses the sample as ReadPage does, and reads a final geometry as well as a history. Its Page is the file's page with each box written as the sample's markup has it (markedPage), the checks and keys the file's: markup that the run of the workbook cannot stand for is an error, not a refusal.

func ReadPage added in v0.1.7

func ReadPage(es *evalv1.Sample, w *Workbook) (*Page, *Refusal, error)

ReadPage reads a sample of the protocol, which sample-check has found valid, as the page of the workbook its task names. It refuses the sample, as the protocol has it, when:

  • it has no markup;
  • its task is not of the workbook: another source, a file of another digest, no such page, or an open view of another digest;
  • its markup does not fit its task: its truth is no valid observation of the page's, or gets no verdict (module-kit); it has parts or marks, which a page has not; or a note names no box;
  • a child wrote it (П-3).

A sample of another ink or surface is no page the runner reads, and ReadPage gives ErrNotPage.

func ReadSheet added in v0.1.11

func ReadSheet(es *evalv1.Sample, b *Bank) (*Sheet, *sample.PlanSheet, *Refusal, error)

ReadSheet reads a sample of a sheet of a set of a capability, as canvas's synthetic samples are: a sample of any purpose, which no plan sheet of tutor's names. It refuses the sample as Read does, but for the plan sheet, and reads a final geometry as the strokes it shows, with no erasure and no time, as well as a history. Its plan sheet is the sample's own (planOf), which it gives with the sheet; a sheet that shows no stroke has no answer slot a model reads.

func ReadSource added in v0.1.7

func ReadSource(file string) (string, []byte, error)

ReadSource reads a file of tasks and gives its path as a sample names it, from the root of the repository that holds it: the nearest folder above it with a go.mod, tutor's root. A file outside any is named by its name alone, wherever it is read from, and nothing of the folders above it goes into a sample; its digest tells two files of one name apart.

func Reason

func Reason(r evalv1.Refusal) string

Reason is a reason of refusal as the summary and the run name it: the end of its name in the protocol, in lowercase words.

func SampleID added in v0.1.9

func SampleID(data []byte) string

SampleID is the ID that a file of a sample names, read leniently, so that a sample refused because it breaks a rule is still named by it in the report; "" when the file names none that is an ID.

func Shown

func Shown(strokes []sample.Stroke, f protocol.Folded) []sample.Stroke

Shown are the strokes of a history that the sheet shows at the end, in the order they were written.

func WriterCode

func WriterCode(seed uint64) string

WriterCode is the writer's code of the sheets drawn from the seed: one hand, one code, as the samples page gives a person one at random. It is the first 8 hexadecimal digits of the SHA-256 of "tutor-synthetic:" and the seed, in capitals, which the protocol's 6 to 16 digits and capital Latin letters take.

func WriterCodeAt added in v0.1.10

func WriterCodeAt(path string) (string, error)

WriterCodeAt is the writer's code kept in the file at path: the author's, which every sample of theirs names, the record mode's and the converter's alike. A file that is not there yet is made, with a code at random, readable by its owner alone; a file that holds no code of the protocol is an error, never written over, since the samples already saved name the code it held.

Types

type Bank

type Bank struct {
	Source
	Bank *sample.Bank
}

Bank is a bank of tasks as a sample names it, as the source file of its task reference, and the bank it holds.

func BankOf

func BankOf(at string, data []byte) (*Bank, error)

BankOf is the bank of the bytes data at the path given, from the repository's root.

func ReadBank

func ReadBank(file string) (*Bank, error)

ReadBank reads the bank at a path, which a sample names from the root of the repository that holds it (ReadSource).

type Dir added in v0.1.7

type Dir[T any] struct {
	Drawn []Drawn[T]
	Other []string
}

Dir is a directory of samples of pages or essays read against their file: each page or essay of the file in its order, and the names of the other files of the directory, which are not read.

func ReadEssaysDir added in v0.1.7

func ReadEssaysDir(dir string, f *Essays, check samplecheck.Check) (*Dir[Essay], error)

ReadEssaysDir reads a directory of samples of the essays of a file, as ReadPagesDir reads one of pages: the sample of each essay is essay-NN.json (EssayFile), read as ReadEssay reads it and held to its file (EssayDifferences).

func ReadPagesDir added in v0.1.7

func ReadPagesDir(dir string, w *Workbook, check samplecheck.Check) (*Dir[Page], error)

ReadPagesDir reads a directory of samples of the pages of a workbook: the sample of each page is page-NN.json, its number's (PageFile), read as ReadPage reads it and held to its file (PageDifferences). A sample of the protocol is held to its rules by check, spec's code (samplecheck.Run), and refused when it breaks one; with no check, as tutor-eval draw reads the directory only to see which pages it holds, it is not. The error is a directory that cannot be read, or a check that cannot run.

func (*Dir[T]) Seeds added in v0.1.7

func (d *Dir[T]) Seeds() []string

Seeds are the seeds the samples read were drawn from, each once, ascending as numbers: one, when one seed drew the directory.

type Drawn added in v0.1.7

type Drawn[T any] struct {
	Number   int
	File     string
	Read     *T
	Refused  *Refusal
	Problems []string
	Seed     string
}

Drawn is a page or an essay of the file as a directory of samples holds it: its number, and the name of its sample's file, or "" when the directory holds none. Read is the sample read, once it is refused for nothing and fits the file; Refused is why the runner refuses it, as the protocol has it; Problems are where it is off its file, by paths alone, nothing of the handwriting; and Seed is the seed it was drawn from, or "" for a person's.

type Essay added in v0.1.7

type Essay struct {
	Essay   *sample.Essay
	Strokes []sample.Stroke
	Seed    string
	// ID is the sample's, People the marks of its markup, and Unreadable the reason its truth gives
	// no text, or "": what the runner's report takes of the essay.
	ID         string
	People     []Mark
	Unreadable string
}

Essay is a sample of the protocol read as an essay of its file: the essay, the strokes the sheet shows at the end, in the order they were written, and the seed it was drawn from, or "" for a person's.

type Essays added in v0.1.7

type Essays struct {
	Source
	Essays *sample.Essays
}

Essays is the file of the essays as a sample names it, the source file of its task reference, and the rubric and essays it holds.

func EssaysOf added in v0.1.7

func EssaysOf(at string, data []byte) (*Essays, error)

EssaysOf is the essays of the bytes data at the path given, from the repository's root.

func ReadEssays added in v0.1.7

func ReadEssays(file string) (*Essays, error)

ReadEssays reads the file of the essays at a path, as a sample names it (ReadSource), and checks it.

type Mark added in v0.1.9

type Mark struct {
	Criterion int  `json:"criterion"`
	Met       bool `json:"met"`
}

Mark is a criterion of an essay's rubric as the people marked it in the markup: its place in the rubric, from 1, and whether the essay meets it.

type Page added in v0.1.7

type Page struct {
	Page *sample.WorkbookPage
	Ink  *synth.Page
	// ID is the sample's, and Truth the truth of each filled box, which a model reads, in the
	// task's order: what the runner's report takes of the page.
	ID    string
	Truth []Truth
}

Page is a sample of the protocol read as a page of the workbook: the page of its file, and its boxes as code draws them (synth.Page), each with the strokes the sample's table of boxes puts in it, as the history writes them; a blank box has none.

type Refusal

type Refusal struct {
	Reason evalv1.Refusal
	Detail string
	// Sample is the ID the sample's file names, or "" when it names none that can be read: the
	// runner's report names a refused sample by it.
	Sample string
}

Refusal is why the runner refuses a sample, by the protocol's reasons that its report names (evalv1.Refusal), and what of the sample it is, in words: nothing of the handwriting, neither a point nor the text of a part.

func ReadChecked added in v0.1.11

func ReadChecked(data []byte, broken []int) (*evalv1.Sample, *Refusal)

ReadChecked reads the bytes of a sample's file once spec's sample-check has held them to the rules of the protocol: a file it finds breaking a rule, at the lines broken, and one that cannot be read strictly as a sample of the protocol are refused as invalid, by the ID the file names, if it names one that can be read.

func (*Refusal) Error

func (r *Refusal) Error() string

type Releases added in v0.1.11

type Releases struct {
	Dir string
	// contains filtered or unexported fields
}

Releases are the files of tasks of tutor's releases, as the samples of a set of a capability name them: each tag's tree of tutor under Dir, Dir/<tag>/eval/…, as git archive writes it. A sample of a release is read with the bank it names at the tag it names, not with the bank of the work tree, so a bank changed since that release takes nothing from the samples made on it.

func NewReleases added in v0.1.11

func NewReleases(dir string) *Releases

NewReleases are the trees of tutor's tags under dir.

func (*Releases) Of added in v0.1.11

func (rs *Releases) Of(ref *evalv1.TaskReference) (*Bank, *Workbook, *Refusal, error)

Of is the file of tasks that a sample's task reference names, at its tag: a bank of sheets or the workbook, whose Source holds the tag and the digest of the tree's file of open tasks, so that the file refuses a sample of another release or digest (Source.refuse). A reference to no release of tutor, a tag of no version, or a file the tree does not hold, is refused as another task; a file of another kind is ErrOtherFile. The error is a tree that is not there, which the recipe that fetches the samples writes, or a file of the tree that cannot be read.

type Sheet

type Sheet struct {
	Sample *sample.Sample
	Mouse  bool
	ID     string
	Truth  []Truth
}

Sheet is a sample of the protocol read as a sheet of its plan: the sample tutor's runner takes, whether a mouse wrote any of its strokes, and what the runner's report takes of it, its ID and the truth of its answer slot.

type Source added in v0.1.7

type Source struct {
	Path   string
	Digest string
	Tag    string
	Open   string
}

Source is a file of tasks as a sample names it, the source file of its task reference: its path in the repository, from the root, with slashes, and the digest of the file, "sha256:" and 64 lowercase hexadecimal digits. A bank of sheets, the workbook and the essays are named alike. A file of tutor's tree at the tag of a release, which a sample names by that release (Releases), has its tag too, and the digest of the release's file of open tasks, that tree's OpenTasks.

func SourceOf added in v0.1.7

func SourceOf(at string, data []byte) Source

SourceOf is the source of the bytes data at the path given, from the repository's root.

type Truth added in v0.1.9

type Truth struct {
	Item       int    `json:"item"`
	Slot       int    `json:"slot"`
	Verdict    string `json:"verdict"`
	Reason     string `json:"reason,omitempty"`
	Trap       string `json:"trap,omitempty"`
	Mirrored   bool   `json:"mirrored,omitempty"`
	CrossedOut bool   `json:"crossed_out,omitempty"`
}

Truth is what the runner's report takes of an answer slot of a sample that a model reads and whose check gives a verdict: its place, module-kit's verdict on the truth of the markup, with its reason or trap, and the markup's notes. The log of a run writes it so, and the report is made of it.

type Workbook added in v0.1.7

type Workbook struct {
	Source
	Workbook *sample.Workbook
}

Workbook is the file of the pages of the workbook as a sample names it, the source file of its task reference, and the pages it holds.

func ReadWorkbook added in v0.1.7

func ReadWorkbook(file string) (*Workbook, error)

ReadWorkbook reads the file of the workbook at a path, as a sample names it (ReadSource), and checks it, the format and the layout of every page.

func WorkbookOf added in v0.1.7

func WorkbookOf(at string, data []byte) (*Workbook, error)

WorkbookOf is the workbook of the bytes data at the path given, from the repository's root.

Jump to

Keyboard shortcuts

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