Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

maintainer source realm

Package maintainer models an AI agent stewarding a versioned on-chain package — without ever letting it deploy on its...

Overview

Package maintainer models an AI agent stewarding a versioned on-chain package — without ever letting it deploy on its own authority.

The agent can do the tedious, valuable parts: open a version proposal, collect reviews, record CI test attestations, write release notes, deprecate a vulnerable version, keep a compatibility matrix. What it cannot do is ship. Approval is gated by an explicit, machine-checked policy:

Example
1tests pass  AND  ≥ MinReviewers independent reviews  AND
2every review scores ≥ MinScore  AND  the challenge window has elapsed

This is the difference between "an agent with commit access" and "an agent that drives a process a human (or a DAO, or a policy) still gates." The realm records *approved* releases; the actual package publish is a separate, deliberately human/authority step.

Constants 1

const MinReviewers, MinScore

1const (
2	MinReviewers = 2  // independent reviews required
3	MinScore     = 80 // minimum score every reviewer must give
4)
source

Functions 9

func AddReview

crossing Action
1func AddReview(cur realm, propID uint64, score uint8, note string)
source

AddReview records a reviewer's score. Reviewers must be independent of the proposer, and each address reviews at most once.

func Approve

crossing Action
1func Approve(cur realm, propID uint64)
source

Approve promotes a proposal to a release iff every policy condition holds. It panics with the first unmet condition — the policy is the gate, not a suggestion.

func AttestTests

crossing Action
1func AttestTests(cur realm, propID uint64, pass bool)
source

AttestTests records whether CI's test suite passed for the proposal.

func Deprecate

crossing Action
1func Deprecate(cur realm, version, reason string)
source

Deprecate flags a released version (e.g. a vulnerability was found).

func IsDeprecated

Action
1func IsDeprecated(version string) bool
source

IsDeprecated reports whether a released version is deprecated.

func Propose

crossing Action
1func Propose(cur realm, version, artifactHash string, challengeBlocks int64) uint64
source

Propose opens a version proposal with a challenge window of the given number of blocks (during which reviews accrue and approval is blocked).

func Render

1func Render(path string) string
source

Render shows the release matrix + open proposals, or one proposal at :<id>.

Types 3

type Proposal

struct
 1type Proposal struct {
 2	ID             uint64
 3	Version        string
 4	ArtifactHash   string // commitment to the package source
 5	Proposer       address
 6	Reviews        []Review
 7	TestsPass      bool
 8	TestsAttestor  address
 9	OpenedAt       int64
10	ChallengeUntil int64 // approval blocked until height passes this
11	Approved       bool
12	ApprovedAt     int64
13}
source

Proposal is a candidate new version working its way toward approval.

type Release

struct
1type Release struct {
2	Version          string
3	ArtifactHash     string
4	ReleasedAt       int64
5	Deprecated       bool
6	DeprecatedReason string
7}
source

Release is an approved (and possibly later deprecated) version.

type Review

struct
1type Review struct {
2	By     address
3	Score  uint8 // 0..100
4	Note   string
5	Height int64
6}
source

Review is one reviewer's score for a proposal.

Imports 4

Source Files 2