Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

v1 state

Back to all declarations

MaxReports

untyped bigint

Value

(100 <untyped> bigint)

MaxNotes

untyped bigint

Value

(50 <untyped> bigint)

Report

type

Report is one snapshot of the running totals, kept forever.

Value

v1.Report

Note

type

Note is a public remark by the owner, for example a change of plan that readers should know about. Notes are added, never edited or removed.

Value

v1.Note

Experiment

type

Experiment is one locked plan and everything recorded against it.

Value

v1.Experiment

experiments

*v0.Tree

// key(id) -> \*Experiment

Open
OID
0bf4cb…8539:4
experiments details

Inspect pointer

lastID

uint64

Value

2

Register

func(title string, hypothesis string, metric string, control string, variant string, direction string, target string, minSample int64) uint64

Register locks a new plan and returns its id. The caller becomes the owner. direction is "increase" or "decrease". target is the smallest relative change that counts as a win, as a percentage such as "15" or "12.5". minSample is the number of exposures each arm must reach before the result can count.

Open
OID
0bf4cb…8539:7
Register details

Inspect func

AddReport

func(id uint64, controlExposures int64, controlConversions int64, variantExposures int64, variantConversions int64, source string)

AddReport records the running totals for both arms. Only the owner can report, only while the experiment is open, and no total may go down. source says where the numbers came from, for example a dashboard link.

Open
OID
0bf4cb…8539:9
AddReport details

Inspect func

AddCorrection

func(id uint64, controlExposures int64, controlConversions int64, variantExposures int64, variantConversions int64, reason string)

AddCorrection replaces the running totals after a mistake, for example a mistyped count. Unlike AddReport it may lower a total, so it asks for a reason and is shown on the page as a correction. The mistaken report stays on the record: a correction is added after it, never written over it. Only the owner can correct, and only while the experiment is open.

Open
OID
0bf4cb…8539:10
AddCorrection details

Inspect func

AddNote

func(id uint64, text string)

AddNote attaches a public remark to an experiment. Only the owner can add one, at any time, including after the experiment is closed.

Open
OID
0bf4cb…8539:11
AddNote details

Inspect func

Close

func(id uint64) string

Close ends an experiment and stores the verdict of its last report judged against the locked plan. Only the owner can close, once, and only after at least one report. It returns the outcome: "met", "missed" or "inconclusive".

Open
OID
0bf4cb…8539:12
Close details

Inspect func

Count

func() int

Count returns how many experiments have been registered.

Open
OID
0bf4cb…8539:13
Count details

Inspect func

Status

func(id uint64) string

Status returns "open" while an experiment is running, and afterwards its outcome: "met", "missed" or "inconclusive". Other realms can call it to act on a result, for example to release a reward only when a target was met.

Open
OID
0bf4cb…8539:14
Status details

Inspect func

OwnerOf

func(id uint64) .uverse.address
Open
OID
0bf4cb…8539:15
OwnerOf details

Inspect func

DigestOf

func(id uint64) string

DigestOf returns the fingerprint of the locked plan.

Open
OID
0bf4cb…8539:16
DigestOf details

Inspect func

Matches

func(id uint64, title string, hypothesis string, metric string, control string, variant string, direction string, target string, minSample int64) bool

Matches reports whether the given plan text is exactly what was locked under id. It recomputes the fingerprint from the arguments, so anyone can check a plan they were shown against the public record.

Open
OID
0bf4cb…8539:17
Matches details

Inspect func

LiftOf

func(id uint64) (liftBps int64, ok bool)

LiftOf returns the lift of the latest report in basis points. ok is false when there is no report yet or the lift is undefined.

Open
OID
0bf4cb…8539:18
LiftOf details

Inspect func

mustGet

func(id uint64) *v1.Experiment

mustGet returns the experiment or stops the transaction.

Open
OID
0bf4cb…8539:19
mustGet details

Inspect func

assertOwner

func(caller .uverse.address, exp *v1.Experiment)

assertOwner stops the transaction unless caller owns exp. Pass the direct caller of the crossing function: cur.Previous().Address().

Open
OID
0bf4cb…8539:20
assertOwner details

Inspect func

checkOptionalText

func(name string, s string)

checkOptionalText allows an empty value, and otherwise a single line within the package text limit.

Open
OID
0bf4cb…8539:21
checkOptionalText details

Inspect func

key

func(id uint64) string

key turns an id into a fixed-width string so the tree keeps numeric order.

Open
OID
0bf4cb…8539:22
key details

Inspect func

listLimit

untyped bigint

Value

(30 <untyped> bigint)

webPath

untyped string

Value

"/r/g1v9mz7rtgkvwkw90ey6496h5fk6pj6cgyawkvft/dokimi/v1"

rulesPath

untyped string

Value

"gno.land/p/g1v9mz7rtgkvwkw90ey6496h5fk6pj6cgyawkvft/dokimi/v1"

Render

func(path string) string

Render draws the registry for gnoweb. "" the home page: the list and the form to lock a new plan "<id>" one experiment: its plan, reports, notes and verdict

Open
OID
0bf4cb…8539:23
Render details

Inspect func

renderExperiment

func(exp *v1.Experiment) string
Open
OID
0bf4cb…8539:26
renderExperiment details

Inspect func

corrections

func(exp *v1.Experiment) int

corrections counts the reports that were added as corrections.

Open
OID
0bf4cb…8539:27
corrections details

Inspect func

statusLabel

func(exp *v1.Experiment) string

statusLabel is the one-word state shown in lists and headers.

Open
OID
0bf4cb…8539:28
statusLabel details

Inspect func

outcomeLabel

func(o v1.Outcome) string
Open
OID
0bf4cb…8539:29
outcomeLabel details

Inspect func

targetLabel

func(p v1.Plan) string

targetLabel renders the target with the sign of the expected direction.

Open
OID
0bf4cb…8539:30
targetLabel details

Inspect func

tallyLabel

func(t v1.Tally) string

tallyLabel renders "268 of 1,530 (17.51%)".

Open
OID
0bf4cb…8539:31
tallyLabel details

Inspect func

span

func(d time.Duration) string

span renders how long passed between two block times, in plain words.

Open
OID
0bf4cb…8539:32
span details

Inspect func

stamp

func(t time.Time) string

stamp renders a block time in UTC.

Open
OID
0bf4cb…8539:33
stamp details

Inspect func
MaxReports : untyped bigint =(100 <untyped> bigint)
MaxNotes : untyped bigint =(50 <untyped> bigint)
Report : type =v1.Report
Note : type =v1.Note
Experiment : type =v1.Experiment
experiments : *v0.Tree Inspect
lastID : uint64 =2
Register : func(title string, hypothesis string, metric string, control string, variant string, direction string, target string, minSample int64) uint64 Inspect
AddReport : func(id uint64, controlExposures int64, controlConversions int64, variantExposures int64, variantConversions int64, source string) Inspect
AddCorrection : func(id uint64, controlExposures int64, controlConversions int64, variantExposures int64, variantConversions int64, reason string) Inspect
AddNote : func(id uint64, text string) Inspect
Close : func(id uint64) string Inspect
Count : func() int Inspect
Status : func(id uint64) string Inspect
OwnerOf : func(id uint64) .uverse.address Inspect
DigestOf : func(id uint64) string Inspect
Matches : func(id uint64, title string, hypothesis string, metric string, control string, variant string, direction string, target string, minSample int64) bool Inspect
LiftOf : func(id uint64) (liftBps int64, ok bool) Inspect
mustGet : func(id uint64) *v1.Experiment Inspect
assertOwner : func(caller .uverse.address, exp *v1.Experiment) Inspect
checkOptionalText : func(name string, s string) Inspect
key : func(id uint64) string Inspect
listLimit : untyped bigint =(30 <untyped> bigint)
webPath : untyped string ="/r/g1v9mz7rtgkvwkw90ey6496h5fk6pj6cgyawkvft/dokimi/v1"
rulesPath : untyped string ="gno.land/p/g1v9mz7rtgkvwkw90ey6496h5fk6pj6cgyawkvft/dokimi/v1"
Render : func(path string) string Inspect
renderHome : func() string Inspect
renderExperiment : func(exp *v1.Experiment) string Inspect
corrections : func(exp *v1.Experiment) int Inspect
statusLabel : func(exp *v1.Experiment) string Inspect
outcomeLabel : func(o v1.Outcome) string Inspect
targetLabel : func(p v1.Plan) string Inspect
tallyLabel : func(t v1.Tally) string Inspect
span : func(d time.Duration) string Inspect
stamp : func(t time.Time) string Inspect