tutorstub

package
v0.1.76 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 23 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 tutorstub is the stub of tutor in api's dev mode (R66; R146 spec): it stands behind the ports through which api calls tutor — the readings of a sheet, a workbook page and an essay, the assessment of an essay, the tutor's words, the finding of the tasks on the photo of a page and the check of a task from paper — so that a run of the path on the dev projects calls no provider and costs nothing. Admission and the prices stay tutor's own, on the real table, by the gate the dev mode builds with the stub's adapter (admission.StubAdapters); only the calls are the stub's.

The stub reads a sheet by the shape of its crop: wider than tall is the right value, taller than wide a wrong one — the slot's first trap value, or the first value its check holds not right —, and square is illegible. It reads each filled box of a workbook page the same way, by the shape of the box's crop. It finds the values by module-kit's verdict on the instance, the key with it, which the stub alone is given: tutor sees the open view (R67 spec). It reads an essay by the shape of the sheet's crop too — wider than tall a text of its own, taller than wide a blank sheet, square illegible —, and assesses the text every criterion met but the last. It finds the tasks on the photo of a page by its shape as well: taller than wide five tasks, one under another, wider than tall none, and square a failure of AI. A task from paper it checks by shapes too: the statement wider than tall reads into a formula the solver takes, at least twice as tall as wide is several tasks, which have no key, otherwise taller than wide is none and a solution of AI gives the same answer, and square has no one answer, so the task has no key; the work it reads by the shape of its crop, which takes in the tracing paper: more than twice as wide as tall right, wider but not twice wrong, else illegible. Its words — a rung's questions, the praise after a correct answer and the feedback on an essay — are its own, which pass the leak check and the form check. Each call spends what tutor expects a call of its kind to cost on its route, so that the quota runs out as on the models.

On an own key a call ends by how the key ends, as a provider would refuse it (KeyRefused and the endings beside it): api hands the stub the key's value beside the call, which tutor takes from the route alone, and the stub reads its ending and keeps nothing of it.

api takes the stub off a deployment alone: the configuration refuses it there, as R32 refuses the emulator of the sign-in service.

Index

Constants

View Source
const (
	KeyRefused      = "-refused"
	KeyLimit        = "-limit"
	KeyLimitOwner   = "-limit-owner"
	KeyLimitTier    = "-limit-tier"
	KeyLimitBalance = "-limit-balance"
	KeyLimitPayment = "-limit-payment"
)

The endings of a synthetic own key that a call of AI on the stub reads, past the checks of the request's form, as a provider would answer it (R66): the key refused, or a limit — named by none of tutor's reasons, or by one; the ceiling of the tier with when access returns, as tutor's adapter of Claude gives it. A key that ends in none of them calls the stub as platform AI does. docs/build.md names them for app; CheckOwnKey takes them all.

View Source
const Model = "stub"

Model is the model the stub's usage names in the log's line ai_usage, so that no line of it is taken for a model's.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gate

type Gate interface {
	Reads(call tutor.Call, category formatv0.AgeCategory, ownKeyProvider string) bool
	Words(withWork bool, category formatv0.AgeCategory, ownKeyProvider string) bool
	PaperWords(withWork bool, category formatv0.AgeCategory, ownKeyProvider string) bool
	CorrectWords(category formatv0.AgeCategory, ownKeyProvider string) bool
	Price(call tutor.Call, route tutor.Route) tutor.CallPrice
	Reading() tutor.Reading
}

Gate is what the stub asks of the gate of admission: whether a reading and the tutor's words are admitted, what a call is expected to cost, and the mode tutor reads handwriting by, which says how many readers read a sheet or a workbook page (R88).

type Stub

type Stub struct {
	// contains filtered or unexported fields
}

Stub reads sheets, workbook pages and essays, assesses essays and words the tutor's words in place of tutor.

func New

func New(gate Gate) *Stub

New is the stub over gate, the dev mode's gate of admission.

func (*Stub) AssessEssay added in v0.1.49

func (s *Stub) AssessEssay(ctx context.Context, r tutor.RubricAssessment, own string) tutor.RubricAssessed

AssessEssay assesses the text of r by the criteria of its rubric as the stub does: every criterion met but the last, each with the stub's synthetic evidence, and the stub's feedback in the language of r — English for a language it has no words of —, which passes the leak check and words.Feedback against any text, since it quotes none (R66). Of tutor's checks before its call the stub keeps those of the request's form: no text, no criterion or a blank one, no topic, no style, or a language words.Feedback cannot check, fails, as does a request whose context ended, every criterion without a mark. Past those checks an own key of an ending of the stub's, own being its value, is refused by it. The call spends the expected price of CallRubric on the route, tutor's by the entry the author's word admits (R90); with none, nothing priced, so the quota keeps its reserve by the value of the kind as spent (R12, R82).

func (*Stub) CorrectWords added in v0.1.45

func (s *Stub) CorrectWords(category formatv0.AgeCategory, ownKeyProvider string) bool

CorrectWords says whether the tutor's words after a correct answer are admitted, as the gate says.

func (*Stub) FindTasks added in v0.1.72

func (s *Stub) FindTasks(ctx context.Context, f tutor.TaskFinding, own string) tutor.TasksFound

FindTasks finds the tasks on the photo of f by its shape (R66): taller than wide, pageTasks of them, one under another across the page, in its order; wider than tall, none, which the learner frames by hand; square, a failure of AI, which spends as a call that went. With the learner's request a photo not square has columnTasks of them, one under another in the left quarter, less those that cover a frame the learner drew, by tutor's own check (R99). Of tutor's checks before its call the stub keeps the photo's form: one that is no JPEG or PNG fails with no usage. Past it an own key of an ending of the stub's, own being its value, is refused by it. The call spends the expected price of CallFinding, tutor's; with none, nothing priced, so the quota keeps its reserve by the value of the kind as spent (R12). It turns no photo: its turn is 0, the page taken as upright.

func (*Stub) PaperWords added in v0.1.72

func (s *Stub) PaperWords(withWork bool, category formatv0.AgeCategory, ownKeyProvider string) bool

PaperWords says whether the tutor's words of a task from paper are admitted, as the gate says.

func (*Stub) ReadEssay added in v0.1.49

func (s *Stub) ReadEssay(ctx context.Context, r tutor.EssayReading, task formatv0.Task, own string) tutor.EssayRead

ReadEssay reads the essay of r, on task, by the shape of the crop of its sheet, as ReadSheet reads a sheet: wider than tall the stub's text, essayText; taller than wide a blank sheet, UNREADABLE_BLANK; square illegible, UNREADABLE_ILLEGIBLE (R66). One reader reads it, as tutor's one model does, and the observation is of the one answer slot bound to the sheet, a value with no crop box, as tutor's. Of tutor's checks before its call the stub keeps those of the request's form: a task that is no handwriting sheet, has no slot bound to the sheet, more than one, or a slot bound otherwise, no open view of the task, a crop that is no PNG or is larger than maxCropSide on a side, and a request whose context ended, fail. Past those checks an own key of an ending of the stub's, own being its value, is refused by it. The call spends the expected price of CallEssay on the route, tutor's by the entry the author's word admits (R90); with none, nothing priced, so the quota keeps its reserve by the value of the kind as spent (R12, R82).

func (*Stub) ReadPaper added in v0.1.72

func (s *Stub) ReadPaper(ctx context.Context, r tutor.PaperReading, own string) tutor.SheetRead

ReadPaper reads the work on a task from paper by the shape of its crop, which takes in the tracing paper, a line of print as a rule: more than twice as wide as tall — the task with a short answer — the stub's key, stubKey; wider than tall but not twice — a stroke that reaches below the task — a wrong value; square or taller, illegible. Of several tasks it reads stubKey in each, in a band of the crop of its own, one under another. One reader reads it in any mode, as tutor's one model, the task n in the place n, 1.

func (*Stub) ReadSheet

func (s *Stub) ReadSheet(ctx context.Context, r tutor.SheetReading, task formatv0.Task, own string) tutor.SheetRead

ReadSheet reads the crop of r by its shape, on task, the instance whose open view r holds: each reader of the gate's mode reads the same, so module-kit joins the pair's as they are. A value stands with the crop box of the whole crop, in thousandths, and a reason with none, as an observation has them (R53 spec). A task with no answer slot bound anywhere, a crop that is no PNG, or a request whose context ended while the stub looked for a value, fails, as tutor's reading does. Past those checks an own key of an ending of the stub's is refused by it, own being its value.

func (*Stub) ReadStatement added in v0.1.72

func (s *Stub) ReadStatement(ctx context.Context, p tutor.PaperTask, own string) tutor.StatementRead

ReadStatement reads the statement of a task from paper by the shape of its crop (R66): wider than tall, one task of the formula stubFormula, which the solver takes; at least twice as tall as wide, the three tasks severalTasks; otherwise taller than wide or square, one task of no formula, so that a solution of AI is asked. Of tutor's checks before its call the stub keeps the crop's form: one that is no JPEG or PNG fails with no usage. Past it an own key of an ending of the stub's, own being its value, is refused by it.

func (*Stub) ReadWorkbook added in v0.1.49

func (s *Stub) ReadWorkbook(ctx context.Context, r tutor.WorkbookReading, task formatv0.Task, own string) tutor.WorkbookRead

ReadWorkbook reads the filled boxes of the workbook page of r, on task, the instance whose open view r holds, each by the shape of its crop as ReadSheet reads a sheet's: wider than tall the box's right value, taller than wide a wrong one, square illegible. The observation holds every box of the page in the task's order, a box that sent no crop unreadable, blank, and a value with no crop box, as tutor's does; each reader of the gate's mode reads the same. Of tutor's checks before its call the stub keeps those of the request's form: a task that is no workbook page, a crop of a place the page has no box of or of one box twice, more than maxBoxes crops, or a crop that is no PNG or is larger than maxBoxSide on a side fails, as does a request whose context ended while the stub looked for the values. A page with no crop goes to no model and spends nothing, as tutor's does; past those checks an own key of an ending of the stub's, own being its value, is refused by it. The call spends the expected price of CallWorkbook on the route, tutor's by the entry the author's word admits (R90); with none, nothing priced, so the quota keeps its reserve by the value of the kind as spent (R12, R81).

func (*Stub) Reads added in v0.1.49

func (s *Stub) Reads(call tutor.Call, category formatv0.AgeCategory, ownKeyProvider string) bool

Reads says whether the reading by the call of the kind is admitted for a learner of category, on the route of ownKeyProvider, as the gate says: admission is tutor's, so the stub admits no kind of call itself (R90).

func (*Stub) SolveTask added in v0.1.72

func (s *Stub) SolveTask(ctx context.Context, p tutor.PaperTask, tasks []tutor.TaskToSolve, own string) tutor.TasksSolved

SolveTask solves the tasks of a crop from paper it is asked by the shape of the crop, as ReadStatement reads it: square, no one answer, which leaves each task no key; otherwise the number stubKey for each.

func (*Stub) TellCorrectWords added in v0.1.45

func (s *Stub) TellCorrectWords(ctx context.Context, c tutor.CorrectRequest, own string) tutor.CorrectAnswer

TellCorrectWords words the stub's praise in the language of c — of a step of the work when the work went, of the option chosen when it did not — with a question on the technique that helped as its last sentence, or, when the task names no technique, on how the answer was found, as tutor's prompt asks (R112 tutor). They hold no number and tell no sex, so they pass the leak check and words.Correct. A language the stub has no words of gets English. Of tutor's checks before its call the stub keeps those of the request's form: no task, no style, no language, or a crop that is no PNG fails with no usage; the words of the task and the size of the crop it does not read. The call spends the expected price of CallCorrect, with the work or without it. Past those checks an own key of an ending of the stub's, own being its value, is refused by it.

func (*Stub) TellPaperWords added in v0.1.72

func (s *Stub) TellPaperWords(ctx context.Context, w tutor.PaperWordsRequest, own string) tutor.WordsAnswer

TellPaperWords words a question of the stub's own in the language of w, as TellWords does, for the opening question, a rung and a rung put another way alike. A rung's words come with the box of the first mistake: the band of the crop of the rung's task, as ReadPaper reads the tasks of a crop one under another, the whole crop for one task. Of tutor's checks before its call the stub keeps those of the request's form: no style, a rung with no PNG of the work, or an opening question with no crop of the task fails with no usage. Past them an own key of an ending of the stub's, own being its value, is refused by it.

func (*Stub) TellWords

func (s *Stub) TellWords(ctx context.Context, w tutor.WordsRequest, own string) tutor.WordsAnswer

TellWords words a question of the stub's own in the language of w: the first one of its list that w has not asked yet, so "explain differently" gets other words, and, once all were asked, the list again from its start. A language the stub has no list of gets English, which the form check turns down into the rung's fallback text. An own key of an ending of the stub's, own being its value, is refused by it.

func (*Stub) Words

func (s *Stub) Words(withWork bool, category formatv0.AgeCategory, ownKeyProvider string) bool

Words says whether the tutor's words are admitted, as the gate says.

Jump to

Keyboard shortcuts

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