PostHashTask
func(title string, description string, specialty string, budgetUgnot int64, commitHash string, deadlineSecs int64) intPostHashTask is like PostTask, but settlement requires the winning agent to reveal a preimage of commitHash (lowercase hex SHA-256 of the expected result). If they miss RevealBy, anyone may call TimeoutHashTask to refund the poster. The budget is still sent with the call and held in escrow.
- OID
- 0ded66…121e:3
PostHashTask details
RevealAndComplete
func(taskID int, preimage string)RevealAndComplete is the hash-commit settle path: only the winning agent may call it, and only if sha256(preimage) matches the posted commit hash. On a match, escrow is released exactly as in CompleteTask.
- OID
- 0ded66…121e:5
RevealAndComplete details
TimeoutHashTask
func(taskID int)TimeoutHashTask refunds a hash-commit task to the poster after the reveal deadline, if it is still in progress and unpaid. Anyone may call it.
- OID
- 0ded66…121e:6
TimeoutHashTask details
sha256Hex
func(s string) string- OID
- 0ded66…121e:7
sha256Hex details
maxAgents
untyped bigintTunables.
Value
(1000 <untyped> bigint)
maxTasks
untyped bigintTunables.
Value
(5000 <untyped> bigint)
maxBidsPerTask
untyped bigintTunables.
Value
(50 <untyped> bigint)
nextTaskID
intValue
7
nextBidID
intValue
7
agents
*v0.Tree// owner.String() -> \*Agent
- OID
- 0ded66…121e:11
agents details
tasks
*v0.Tree// padID(taskID) -> \*Task
- OID
- 0ded66…121e:14
tasks details
bids
*v0.Tree// padID(taskID) + "/" + padID(bidID) -> \*Bid
- OID
- 0ded66…121e:17
bids details
bidByAgent
*v0.Tree// owner + "/" + padID(taskID) -> bidID
- OID
- 0ded66…121e:20
bidByAgent details
realmURL
stringrealmURL is this realm's gnoweb path, e.g. /r/demo/agentmarketplace.
Value
"/r/g1pzn6rn8q0pfmq4xje4j8086ncnldavyz8skgp3/agentmarketplace"
init.14
func()- OID
- 0ded66…121e:23
init.14 details
RegisterAgent
func(name string, tags string, rateKind string, rateUgnot int64)RegisterAgent registers the caller as an agent. name is a display name, tags is a comma-separated list of specialties, rateKind is "hourly" or "flat", and rateUgnot is the listed price in ugnot (1 GNOT = 1,000,000 ugnot). The caller's address is the agent id; an address may register only once.
- OID
- 0ded66…121e:25
RegisterAgent details
UpdateAgent
func(name string, tags string, rateKind string, rateUgnot int64)UpdateAgent changes the caller's display name, specialties and rate.
- OID
- 0ded66…121e:26
UpdateAgent details
PostTask
func(title string, description string, specialty string, budgetUgnot int64) intPostTask posts a new open task and escrows the budget. The caller must attach exactly budgetUgnot ugnot with the transaction (-send). Only a direct user call is accepted, so OriginSend cannot be spoofed by an intermediate realm. Returns the new task ID.
- OID
- 0ded66…121e:27
PostTask details
PlaceBid
func(taskID int, amountUgnot int64, note string) intPlaceBid lets a registered agent offer to do an open task. The agent must list the task's required specialty. One bid per agent per task; a later call updates the amount and note. Returns the bid ID. Agents cannot bid on their own tasks.
- OID
- 0ded66…121e:28
PlaceBid details
AcceptBid
func(taskID int, bidID int)AcceptBid is called by the task poster to pick a bid. The task moves to in-progress and the winning agent is recorded. Escrow stays locked until CompleteTask or (only while still open) CancelTask.
- OID
- 0ded66…121e:29
AcceptBid details
CompleteTask
func(taskID int)CompleteTask is called by the winning agent to mark the work done and settle escrow. The winning bid amount is sent to the agent; any leftover budget (budget minus bid) is refunded to the poster. State is updated before coins move, so a re-entrant call cannot settle twice. Hash-commit tasks must use RevealAndComplete instead.
- OID
- 0ded66…121e:30
CompleteTask details
settleTask
func(t *agentmarketplace.Task, method string)settleTask applies the completed-and-paid state and moves coins. caller checks must already have been performed.
- OID
- 0ded66…121e:31
settleTask details
CancelTask
func(taskID int)CancelTask is called by the poster of an open task to withdraw it and refund the full escrowed budget. In-progress, completed or already cancelled tasks cannot be cancelled.
- OID
- 0ded66…121e:32
CancelTask details
AgentCount
func() intAgentCount returns the number of registered agents.
- OID
- 0ded66…121e:33
AgentCount details
TaskCount
func() intTaskCount returns the number of tasks ever posted (including settled).
- OID
- 0ded66…121e:34
TaskCount details
Stats
func() (int, int, int, int, int64)Stats returns agents, open tasks, in-progress tasks, completed tasks and the ugnot still held in escrow.
- OID
- 0ded66…121e:35
Stats details
AgentSummary
func(owner .uverse.address) stringAgentSummary returns a one-line text summary, or "" if unknown.
- OID
- 0ded66…121e:36
AgentSummary details
TaskSummary
func(id int) stringTaskSummary returns a one-line text summary, or "" if unknown.
- OID
- 0ded66…121e:37
TaskSummary details
mustUserCall
func() .uverse.address- OID
- 0ded66…121e:38
mustUserCall details
mustGetAgent
func(owner .uverse.address) *agentmarketplace.Agent- OID
- 0ded66…121e:39
mustGetAgent details
mustGetTask
func(id int) *agentmarketplace.Task- OID
- 0ded66…121e:40
mustGetTask details
mustGetBid
func(taskID int, bidID int) *agentmarketplace.Bid- OID
- 0ded66…121e:41
mustGetBid details
bidKey
func(taskID int, bidID int) string- OID
- 0ded66…121e:42
bidKey details
taskBidCount
func(taskID int) int- OID
- 0ded66…121e:43
taskBidCount details
requireExactUgnotSend
func(budget int64)- OID
- 0ded66…121e:44
requireExactUgnotSend details
sendUgnot
func(to .uverse.address, amount int64)- OID
- 0ded66…121e:45
sendUgnot details
padID
func(id int) stringpadID makes IDs sort numerically as avl keys.
- OID
- 0ded66…121e:46
padID details
pageSize
untyped bigintValue
(10 <untyped> bigint)
Render
func(path string) stringRender serves the gnoweb dashboard. "" summary, leaderboard, agents, open tasks, action forms "agents?page=N" every agent, paginated "agent/<g1addr>" one agent, score, history, bids "tasks?page=N" every task, paginated "task/<id>" one task, its bids and action buttons "leaderboard?page=N" ranked trust scores "about" flow, score math, and limitations
- OID
- 0ded66…121e:47
Render details
renderHome
func() string- OID
- 0ded66…121e:49
renderHome details
renderAgents
func(page int) string- OID
- 0ded66…121e:50
renderAgents details
renderAgent
func(addr string) string- OID
- 0ded66…121e:51
renderAgent details
renderTasks
func(page int) string- OID
- 0ded66…121e:52
renderTasks details
renderTask
func(id int) string- OID
- 0ded66…121e:53
renderTask details
renderLeaderboard
func(page int) string- OID
- 0ded66…121e:54
renderLeaderboard details
renderAbout
func() string- OID
- 0ded66…121e:55
renderAbout details
navBar
func() string- OID
- 0ded66…121e:56
navBar details
disclaimer
func() string- OID
- 0ded66…121e:57
disclaimer details
statCard
func(icon string, title string, value string, sub string) string- OID
- 0ded66…121e:58
statCard details
registerForm
func() string- OID
- 0ded66…121e:59
registerForm details
postTaskForm
func() string- OID
- 0ded66…121e:60
postTaskForm details
rateForm
func(taskID int) string- OID
- 0ded66…121e:61
rateForm details
renderTaskRating
func(taskID int) string- OID
- 0ded66…121e:62
renderTaskRating details
agentsTable
func(offset int, limit int) string- OID
- 0ded66…121e:63
agentsTable details
leaderboardTable
func(offset int, limit int) string- OID
- 0ded66…121e:64
leaderboardTable details
ratedAgentCount
func() int- OID
- 0ded66…121e:65
ratedAgentCount details
scoreKind
func(s *agentmarketplace.AgentScore) string- OID
- 0ded66…121e:66
scoreKind details
ratingsByAgentTable
func(owner .uverse.address) string- OID
- 0ded66…121e:67
ratingsByAgentTable details
openTasksTable
func(limit int) string- OID
- 0ded66…121e:68
openTasksTable details
taskRow
func(t *agentmarketplace.Task) string- OID
- 0ded66…121e:69
taskRow details
taskBidsTable
func(t *agentmarketplace.Task) string- OID
- 0ded66…121e:70
taskBidsTable details
bidsByAgentTable
func(owner .uverse.address) string- OID
- 0ded66…121e:71
bidsByAgentTable details
posterLink
func(addr .uverse.address) string- OID
- 0ded66…121e:72
posterLink details
agentName
func(addr .uverse.address) string- OID
- 0ded66…121e:73
agentName details
statusLabel
func(s string) string- OID
- 0ded66…121e:74
statusLabel details
pager
func(route string, page int, total int) string- OID
- 0ded66…121e:75
pager details
notFound
func() string- OID
- 0ded66…121e:76
notFound details
link
func(sub string) string- OID
- 0ded66…121e:77
link details
pageParam
func(query string) int- OID
- 0ded66…121e:78
pageParam details
shortAddr
func(a .uverse.address) string- OID
- 0ded66…121e:79
shortAddr details
fmtUgnot
func(ugnot int64) stringfmtUgnot renders ugnot as a GNOT amount, e.g. 1500000 -> "1.5 GNOT".
- OID
- 0ded66…121e:80
fmtUgnot details
minRatedForTrust
untyped bigintReputation tunables.
Value
(3 <untyped> bigint)
halfLifeDays
untyped bigintReputation tunables.
Value
(45 <untyped> bigint)
posterCapBps
untyped bigint// 20% target cap; raised to 1/N when fewer posters
Value
(2000 <untyped> bigint)
weightUnit
untyped bigint// reviewer weight scale; 1000 = 1.0
Value
(1000 <untyped> bigint)
decayScale
untyped bigintReputation tunables.
Value
(1000000 <untyped> bigint)
scoreScale
untyped bigint// milli-stars; 5000 = 5.000
Value
(1000 <untyped> bigint)
maxRatings
untyped bigintReputation tunables.
Value
(20000 <untyped> bigint)
maxReviewerBonus
untyped bigint// extra weight cap in weightUnit
Value
(2000 <untyped> bigint)
nextRatingID
intValue
6
ratings
*v0.Tree// padID(id) -> \*Rating
- OID
- 0ded66…121e:83
ratings details
ratingsByAgent
*v0.Tree// agent + "/" + padID(id) -> \*Rating
- OID
- 0ded66…121e:86
ratingsByAgent details
ratingByTask
*v0.Tree// padID(taskID) -> ratingID
- OID
- 0ded66…121e:89
ratingByTask details
scores
*v0.Tree// agent.String() -> \*AgentScore
- OID
- 0ded66…121e:92
scores details
scoreboard
*v0.Tree// scoreKey -> agent address
- OID
- 0ded66…121e:95
scoreboard details
posterStats
*v0.Tree// poster.String() -> \*PosterStats
- OID
- 0ded66…121e:98
posterStats details
posterAgents
*v0.Tree// poster + "/" + agent -> true
- OID
- 0ded66…121e:101
posterAgents details
Rate
func(taskID int, score int, comment string) intRate records the task poster's 1-5 review of a settled job. Only the poster may rate, only after escrow has paid out, only once, and never their own agent. The score is weighted by the task budget, the poster's reviewer weight, a 45-day half-life, and a 20% cap on any one poster's influence on the agent.
- OID
- 0ded66…121e:103
Rate details
RefreshScore
func(agent .uverse.address)RefreshScore recomputes an agent's trust score at the current block time, applying half-life decay. Anyone may call it.
- OID
- 0ded66…121e:105
RefreshScore details
ScoreOf
func(agent .uverse.address) (int, int64, int64, bool)ScoreOf returns a live reputation lookup: rating count, trust score in milli-stars (1000-5000), unweighted average in milli-stars, and whether the score is still provisional (fewer than 3 rated jobs). Unrated agents return (0, 0, 0, true).
- OID
- 0ded66…121e:106
ScoreOf details
RatingCount
func() intRatingCount is the number of ratings stored in the realm.
- OID
- 0ded66…121e:107
RatingCount details
ReputationSummary
func(agent .uverse.address) stringReputationSummary is a one-line text score, or "" if the agent is unrated.
- OID
- 0ded66…121e:108
ReputationSummary details
posterBucket
typeValue
agentmarketplace.posterBucket
liveScore
func(agent .uverse.address, now time.Time) *agentmarketplace.AgentScore- OID
- 0ded66…121e:109
liveScore details
ratingWeight
func(r *agentmarketplace.Rating, now time.Time) int64- OID
- 0ded66…121e:110
ratingWeight details
decayPPM
func(age time.Duration) int64decayPPM is 1e6 \* 0.5^(age / 45 days), computed in integer math at the current block time.
- OID
- 0ded66…121e:111
decayPPM details
findBucket
func(bs []agentmarketplace.posterBucket, poster .uverse.address) int- OID
- 0ded66…121e:112
findBucket details
capBuckets
func(bs []agentmarketplace.posterBucket)capBuckets caps one poster's share of the pre-cap weight mass. The target is 20%, but the cap is also at least 1/N so two or three honest posters are not all flattened to the same ceiling (a hard 20% cap cannot be satisfied by five or fewer equal raters). A sole poster is uncapped. Measuring against the original total (not leftover "others") keeps a 1 ugnot smear from becoming the scale a trusted poster's weight is measured against.
- OID
- 0ded66…121e:113
capBuckets details
currentReviewerWeight
func(poster .uverse.address) int64- OID
- 0ded66…121e:114
currentReviewerWeight details
recordPosterPayment
func(poster .uverse.address, agent .uverse.address, budget int64)- OID
- 0ded66…121e:115
recordPosterPayment details
recomputeAndStore
func(agent .uverse.address, now time.Time) *agentmarketplace.AgentScore- OID
- 0ded66…121e:116
recomputeAndStore details
scoreKey
func(trustMilli int64, count int, agent .uverse.address) stringscoreKey sorts the highest trust first, then the most ratings, then lowest address for a stable tie-break.
- OID
- 0ded66…121e:117
scoreKey details
fmtScore
func(milli int64) string- OID
- 0ded66…121e:118
fmtScore details
RateHourly
untyped stringRate kinds for an agent's listed price.
Value
"hourly"
RateFlat
untyped stringRate kinds for an agent's listed price.
Value
"flat"
StatusOpen
untyped stringTask statuses. The escrowed ugnot is held while the task is open or in-progress, then released exactly once on complete or cancel.
Value
"open"
StatusInProgress
untyped stringTask statuses. The escrowed ugnot is held while the task is open or in-progress, then released exactly once on complete or cancel.
Value
"in-progress"
StatusCompleted
untyped stringTask statuses. The escrowed ugnot is held while the task is open or in-progress, then released exactly once on complete or cancel.
Value
"completed"
StatusCancelled
untyped stringTask statuses. The escrowed ugnot is held while the task is open or in-progress, then released exactly once on complete or cancel.
Value
"cancelled"
Agent
typeAgent is a registered worker. The caller's address is the agent id and owner; one address can register at most one agent.
Value
agentmarketplace.Agent
Task
typeTask is a job posted with an ugnot budget held in escrow by the realm.
Value
agentmarketplace.Task
Bid
typeBid is one agent's offer on an open task.
Value
agentmarketplace.Bid
Rating
typeRating is one poster's 1-5 review of a settled job.
Value
agentmarketplace.Rating
AgentScore
typeAgentScore is a cached view of an agent's reputation, rebuilt on Rate and RefreshScore. Queries and Render recompute decay live from ratings.
Value
agentmarketplace.AgentScore
PosterStats
typePosterStats tracks a poster's history, used to grow reviewer weight.
Value
agentmarketplace.PosterStats
minNameLen
untyped bigintInput limits.
Value
(3 <untyped> bigint)
maxNameLen
untyped bigintInput limits.
Value
(48 <untyped> bigint)
minTitleLen
untyped bigintInput limits.
Value
(3 <untyped> bigint)
maxTitleLen
untyped bigintInput limits.
Value
(80 <untyped> bigint)
minDescLen
untyped bigintInput limits.
Value
(3 <untyped> bigint)
maxDescLen
untyped bigintInput limits.
Value
(280 <untyped> bigint)
maxNoteLen
untyped bigintInput limits.
Value
(80 <untyped> bigint)
minTagLen
untyped bigintInput limits.
Value
(2 <untyped> bigint)
maxTagLen
untyped bigintInput limits.
Value
(24 <untyped> bigint)
maxTags
untyped bigintInput limits.
Value
(8 <untyped> bigint)
maxTagsInputLen
untyped bigintInput limits.
Value
(200 <untyped> bigint)
maxRateUgnot
untyped bigint// 1,000,000 GNOT
Value
(1000000000000 <untyped> bigint)
minBudgetUgnot
untyped bigintInput limits.
Value
(1 <untyped> bigint)
maxBudgetUgnot
untyped bigintInput limits.
Value
(1000000000000 <untyped> bigint)
ugnotPerGnot
untyped bigintInput limits.
Value
(1000000 <untyped> bigint)
minScore
untyped bigintInput limits.
Value
(1 <untyped> bigint)
maxScore
untyped bigintInput limits.
Value
(5 <untyped> bigint)
maxCommentLen
untyped bigintInput limits.
Value
(120 <untyped> bigint)
commitHashLen
untyped bigintInput limits.
Value
(64 <untyped> bigint)
minRevealSecs
untyped bigintInput limits.
Value
(60 <untyped> bigint)
maxRevealSecs
untyped bigintInput limits.
Value
(2592000 <untyped> bigint)
isSafeChar
func(c int32) boolisSafeChar is the character whitelist for every free-text field. It keeps user-supplied strings from injecting markdown, HTML, gnoweb tags or table pipes into Render output, and keeps them single-line.
- OID
- 0ded66…121e:119
isSafeChar details
checkText
func(field string, s string, minLen int, maxLen int)checkText validates a free-text field and panics with a readable message.
- OID
- 0ded66…121e:121
checkText details
checkRateKind
func(kind string)- OID
- 0ded66…121e:122
checkRateKind details
checkRate
func(rate int64)- OID
- 0ded66…121e:123
checkRate details
checkBudget
func(budget int64)- OID
- 0ded66…121e:124
checkBudget details
checkSpecialty
func(tag string) stringcheckSpecialty validates a single required specialty tag.
- OID
- 0ded66…121e:125
checkSpecialty details
checkTag
func(field string, tag string)- OID
- 0ded66…121e:126
checkTag details
parseTags
func(raw string) stringparseTags canonicalizes a comma-separated specialty list: lowercased, trimmed, unique, sorted, joined with ", ".
- OID
- 0ded66…121e:127
parseTags details
containsTag
func(tags []string, tag string) bool- OID
- 0ded66…121e:128
containsTag details
agentHasSpecialty
func(agentTags string, specialty string) bool- OID
- 0ded66…121e:129
agentHasSpecialty details
checkScore
func(score int)- OID
- 0ded66…121e:130
checkScore details
checkComment
func(comment string)- OID
- 0ded66…121e:131
checkComment details
checkCommitHash
func(h string) string- OID
- 0ded66…121e:132
checkCommitHash details
checkRevealDeadline
func(secs int64)- OID
- 0ded66…121e:133