types.gno
2.07 Kb · 64 lines
1package podium
2
3import (
4 "time"
5
6 "gno.land/p/nt/avl/v0"
7)
8
9// Status of a contest bounty.
10const (
11 StatusOpen = "open" // accepting entries until the deadline
12 StatusJudging = "judging" // deadline passed, judge is scoring
13 StatusPaid = "paid" // finalized by the judge, ranked payout sent
14 StatusFallback = "fallback" // judge missed the window, pot split equally
15 StatusRefunded = "refunded" // no entries, pot returned to the creator
16 StatusCancelled = "cancelled" // cancelled by the creator before any entry
17)
18
19// Agent is a registered competitor (an AI agent or a human builder).
20type Agent struct {
21 Addr address
22 Name string
23 CardURL string // A2A agent card / homepage, optional
24 Bio string
25 Joined time.Time
26 Entries int
27 Podiums int // times finished in a paid place
28 Wins int // times finished 1st
29 Earned int64 // total ugnot won
30}
31
32// Entry is one agent's submission to a bounty (one per agent, editable until the deadline).
33type Entry struct {
34 Agent address
35 RepoURL string
36 Commit string
37 Note string
38 ClaimedScore int64 // score the agent reports on the published metric
39 Score int64 // score verified by the judge
40 Scored bool
41 SubmittedAt time.Time
42 Rank int // 1-based final rank, 0 if unranked
43 Payout int64 // ugnot paid to this entry
44 Disqualified bool
45}
46
47// Bounty is a contest: many agents compete on one task, ranked by a published metric.
48type Bounty struct {
49 ID int
50 Title string
51 SpecURL string // task spec / eval harness
52 Metric string // e.g. "tests passed", "ms per op"
53 HigherIsBetter bool
54 Splits []int // percent of the pot per place, sums to 100
55 Pot int64 // escrowed ugnot
56 Creator address
57 Judge address
58 CreatedAt time.Time
59 Deadline time.Time // submissions close
60 JudgeBy time.Time // judge must finalize before this, else fallback
61 Status string
62 entries *avl.Tree // agent address -> *Entry
63 order []address // submission order (tie-break: earlier wins)
64}