model

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2026 License: MIT Imports: 14 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 model defines dockhand's v3 records and the vocabulary the domain packages share (docs/design-v3.md §3).

A Branch is the unit of work: a Git branch of the ports tree, its base, title, lifecycle, and at most one pull request. A Revision is an immutable candidate source, either a commit or a numbered snapshot of working files. A Plan freezes what a check of one revision covers: its changed targets in dependency order, the extras and prerequisites it builds, the exclusions with their reasons, and anything left unresolved. A Run is one accepted check request; a GuestExecution owns one provider environment for that run and holds a TargetResult per target as each finishes.

The package is a leaf: it imports nothing from dockhand, so every other package can use its vocabulary. Records are ordinary values; validation and state rules live beside them, and progression belongs to the engine.

Index

Constants

View Source
const (
	RuleSourceMoved     = "source-moved"
	RuleTagMoved        = "tag-moved"
	RuleReleaseMoved    = "release-moved"
	RuleAssessmentMoved = "assessment-moved"
)

The rules of findings about which commit a Git-fetched port's source is, outside its files: where its git.branch, or the tag a GitHub archive is fetched by, points now against what the check planned; and the commit the update chose, or the assessment read, against it.

View Source
const (
	FindingPatchRejected     = "patch-rejected"
	FindingPatchUnchecked    = "patch-unchecked"
	FindingWorksrcdirMissing = "worksrcdir-missing"
	FindingInstruction       = "instruction"
	FindingPlainHTTP         = "plain-http"
	FindingOtherPullRequest  = "other-pull-request"
	FindingClosedBefore      = "closed-before"
	FindingCrossesMajor      = "crosses-major"
	FindingLeavesStable      = "leaves-stable"
	FindingRenamed           = "renamed"
	FindingStealth           = "stealth"
	FindingChecksumLeft      = "checksum-left"
	FindingChecksumDiffers   = "checksum-differs"
	// Fixed.
	FindingPatchDropped      = "patch-dropped"
	FindingPatchRefreshed    = "patch-refreshed"
	FindingFollowed          = "followed"
	FindingRegenerated       = "regenerated"
	FindingLintFixed         = "lint-fixed"
	FindingDistSubdirRemoved = "dist-subdir-removed"
)

The kinds of finding an update records (docs/designs/ preparation-and-request.md at 6829407e, "What is stored of engine.Update"). Left, unless the edit dealt with it.

View Source
const BranchPrefix = "dockhand/"

BranchPrefix begins the name of every branch dockhand creates.

View Source
const ConcernNotCompared = "not-compared"

ConcernNotCompared names an upstream comparison that couldn't be made.

View Source
const LaunchUnrecorded = "unrecorded: started before dockhand noted launches"

LaunchUnrecorded is the Launch of an attempt that was unfinished when dockhand began noting launches (schema 63): what it started was never noted, so its provider stops it by its reference, or says it isn't known to have stopped, where an empty Launch since says nothing was started.

View Source
const MaxAttempts = 3

MaxAttempts is how many times a run's environment is tried in all: the first attempt and two retries after infrastructure failures (decision 30).

View Source
const ScopeSeparator = "\x1f"

ScopeSeparator joins a scope's parts.

View Source
const ScopeUnknown = "?"

ScopeUnknown stands for a part of a scope the evaluator couldn't name. A scope with one compares with no scope, itself included: two unknowns are never taken as equal.

Variables

View Source
var ErrInvalid = errors.New("invalid record")

ErrInvalid reports a record that breaks one of this package's rules.

Finished are the states of a run that ended with its results, as a branch's evidence reads them: passed, failed, or stopped for a person, and not canceled.

PublicationSteps are every step, in the order they are made.

Steps are the steps a build takes, in the order it takes them.

Functions

func AssetNames added in v0.9.0

func AssetNames(assets []ReleaseAsset) []string

AssetNames are the assets' names, in their order.

func CompareTargets

func CompareTargets(a, b Target) int

CompareTargets orders targets by their complete selection. Empty and nil variant maps represent the same selection.

func ConcernSubject added in v0.7.0

func ConcernSubject(c Concern) string

ConcernSubject is what a decision on a concern names: its port and rule, as "jq license-changed", one decision for each; for a moving source, the commits too, abbreviated, as "jq source-moved 1a2b3c4..5d6e7f8", so a later move is a new concern.

func Digest

func Digest(data []byte) string

Digest is the hex SHA-256 of data, the form in which records and the files beside them identify content.

func EnvironmentEvidence added in v0.5.0

func EnvironmentEvidence(dependency FailedDependency, identity string) string

EnvironmentEvidence is what a standing acceptance of a dependency's failure rests on: the dependency's version and revision as the tree has them, and the identity of the image it failed on. Either changing lapses it.

func IsRunName added in v0.5.0

func IsRunName(word string) bool

IsRunName reports whether a word is a run's name as Name says it, check-42, which no finding's code or branch's name is.

func MovedSubject added in v0.7.0

func MovedSubject(from, to ObjectID) string

MovedSubject is a moving source's concern's subject, the two commits it compares, from..to: the commit checked and the one current, or the one the update prepared or the assessment read and the one checked.

func MovingSource added in v0.7.0

func MovingSource(rule string) bool

MovingSource says whether a rule's finding is about which commit a port's source is, its subject the two commits it compares (MovedSubject). A decision on one holds for those commits, where a decision on any other holds while the port's directory does: the source can move with the port's files as they were, and an acceptance of the move to B answered a later move to C (Codex's workflow review of 2ad896d2, D1; decisions.md).

func PatchScope added in v0.9.0

func PatchScope(parts ...string) string

PatchScope is the scope a patch list was read in, from its parts in a fixed order (macports.PatchScope names them). A part left empty is unknown; the tools part (ScopeTools) is kept as it is.

func ScopeTools added in v0.9.0

func ScopeTools(xcode, tools string) string

ScopeTools is a scope's developer-tools part: the Xcode and Command Line Tools versions as the evaluator saw them, each read, not read, or unknown (macports.ToolsNotRead). It is recorded and never compared (amended 2026-11-22): MacPorts reads the Xcode version for every port, so comparing it would leave a rejection no later update could end after any Xcode update.

func ScopesComparable added in v0.9.0

func ScopesComparable(a, b string) bool

ScopesComparable reports whether two patch lists' scopes let one be compared with the other: every part equal and known, but the tools part, which is recorded and not compared (ScopeTools). Equal scopes are the standard for comparing, and no proof: a Portfile can read what no record names. This is the one place scopes are compared.

func ValidArchiveName

func ValidArchiveName(name string) bool

ValidArchiveName reports whether a name is one file's, as MacPorts names an archive: no directory, and nothing a path could make more of.

Types

type ActionOutcome added in v0.9.0

type ActionOutcome struct {
	// Action is version, source, moves, obsolete, dependents or closes.
	Action string
	Result ActionResult
	Why    string `json:",omitempty"`
	// JudgedBy are the inputs a setting supplied when the action was
	// judged, each with its value then, as "Source.KeepHTTP": "true": a
	// fact of a past judgment, not configuration carried forward. The
	// outcome is judged again where one differs from what the setting
	// gives now; an input a flag gave is the ask's, and isn't here
	// (#195, Codex's read of step 3, P2-2).
	JudgedBy map[string]string `json:",omitempty"`
	// AppliedWith are the shaping asks a written edit was made with, as
	// "Source.KeepHTTP": "false", on a version refused because one of
	// them changed after the edit: given as it was again, the refusal
	// goes and the version is done again (#195, AW).
	AppliedWith map[string]string `json:",omitempty"`
}

ActionOutcome is what became of one action of a request.

type ActionResult added in v0.9.0

type ActionResult string

ActionResult is how an action was concluded.

const (
	// ActionDone is an action carried out.
	ActionDone ActionResult = "done"
	// ActionSatisfied is one already so.
	ActionSatisfied ActionResult = "satisfied"
	// ActionRefused is one concluded and not carried out, which blocks
	// until its ask changes.
	ActionRefused ActionResult = "refused"
)

type ActionsAsk added in v0.9.0

type ActionsAsk struct {
	WithObsolete      Flag[bool]     `json:",omitzero"`
	RevbumpDependents Flag[bool]     `json:",omitzero"`
	Except            Flag[[]string] `json:",omitzero"`
	Closes            Flag[[]string] `json:",omitzero"`
}

ActionsAsk is what is asked beside the version.

type ActivePort

type ActivePort struct {
	Name string
	// Spec is the port's version, revision, and variants, as MacPorts
	// names an installed port: @1.88.0_3+no_single.
	Spec string
	// Directory is where the port's name resolved in the ports tree the
	// build read, relative to its root; empty where MacPorts couldn't
	// say.
	Directory string `json:",omitempty"`
	// Tree is that directory's tree in the revision the build read.
	Tree ObjectID `json:",omitempty"`
	// Archive is the digest of the archive the port was activated from,
	// sha256:<hex>; empty where the environment kept none.
	Archive string `json:",omitempty"`
	// PortGroups are the PortGroup files the port's build loaded, each by
	// its blob ID, by its path in the ports tree, where the environment
	// built it from source for the check, an earlier target or a
	// dependency it had no archive of: the target read what that build
	// made, so a change to one of them is a change to what it read
	// (prioritization's ruling, 2026-11-01). A port installed from an
	// archive dockhand kept of such a build carries that build's, as
	// recorded with the archive or its result's inputs (Codex's review of
	// 03b380f1, F1). Nil for a port installed from MacPorts' archive, or
	// from a kept one whose build's are unknown, which its archive names,
	// and in every record before, so each keeps its key.
	PortGroups map[string]ObjectID `json:",omitempty"`
}

ActivePort is a port that was active as a target built, other than the target itself: an input of its build (decision 28).

type Answered added in v0.4.0

type Answered string

Answered is how a decision a person would make was made: a person asked on a terminal, --yes for a script, or nobody there to ask. Holds, an unasked tidy, and the unattended build profile read it alike, since a terminal alone doesn't say whether a person looked (the command package review's concept 4).

const (
	AnsweredAsked  Answered = "asked"
	AnsweredYes    Answered = "--yes"
	AnsweredNobody Answered = "nobody there"
)

type Archive

type Archive struct {
	// Digest is the archive's sha256, sha256:<hex>, which names it.
	Digest string
	// Name is MacPorts' file name for it, which a guest's MacPorts looks
	// for: jq-1.8.1_0.darwin_25.arm64.tbz2.
	Name   string
	Size   int64
	KeptAt time.Time
}

Archive is a port's archive, as a check's build made it, that dockhand keeps for a later build to install rather than build the port again (decision 28). It is kept once it is whole and matches the digest its build reported, and only then is it ready for dependents (decision 44).

type Asked added in v0.9.0

type Asked struct {
	Draft, NoCheck, SkipNotification Flag[bool]
	Rewrite                          bool
	Types                            Flag[[]string] `json:",omitzero"`
}

Asked is what a person chose for a submission, kept so that finishing it needs none of it typed again: each of --draft, --no-check, --skip-notification and the types as taken, with whether it was given, so a false given is told from one left out (#195). A record from before holds plain values, read as not given (UnmarshalJSON).

func (*Asked) UnmarshalJSON added in v0.9.0

func (a *Asked) UnmarshalJSON(data []byte) error

UnmarshalJSON reads an Asked as recorded now, or as a publication recorded before its asks kept their given-ness had it: plain booleans and a list, each read as its value, not given.

type Assessment

type Assessment struct {
	Branch BranchID
	// Tree is the revision's files, and Base the commit they're assessed
	// against, the revision's captured base.
	Tree ObjectID
	Base ObjectID
	// Port is the port assessed, a target of the revision, and Directory
	// its port directory.
	Port      string
	Directory string
	// Comparison is what the assessment found. Its Problem says what kept
	// it from being finished, where something did, which holds as what
	// couldn't be checked does (D4); what it did find stands.
	Comparison UpstreamComparison
	// Policy is the version of the rules it was made under; one made
	// under earlier rules no longer stands.
	Policy int
	// Build is the dockhand build that made it, buildinfo's; an
	// incomplete one another build made is made again. Empty for one
	// recorded before schema 42.
	Build string
	At    time.Time
}

Assessment is what upstream's change means for one port a revision changes, against the revision's base (the assessment design, D). It's the revision's, not an edit's: whoever changed the port, an update, a hand edit, or someone else's pull request, its net change from the base is what's assessed. It applies to the revision's files, its base, and the policy it was made under, and to nothing else.

func (Assessment) Validate

func (a Assessment) Validate() error

Validate checks the rules every recorded assessment keeps.

type Branch

type Branch struct {
	ID         BranchID
	Repository RepositoryID
	// Name is the Git branch name, such as dockhand/jq-4k2p.
	Name string
	// Base is the master commit the branch started from, or was last rebased onto.
	Base ObjectID
	// Worktree is the directory the branch is checked out in: a managed sparse
	// worktree, or the person's own checkout when Managed is false.
	Worktree string
	Managed  bool
	// Title is kept from any step that set one; empty until then.
	Title       string
	State       BranchState
	PullRequest *PullRequest
	// Publication is a submission of the branch dockhand began and hasn't
	// seen finished, with what it still owes; nil where there is none
	// (docs/designs/publication-record.md at 0e0ad767).
	Publication *Publication
	// Request is what was asked of the branch's work: its targets and
	// what became of each action (#194; #195 keeps the rest). Nil on a
	// branch from before it was kept.
	Request *ChangeRequest `json:",omitempty"`
	// RenameTo is the name a rename is moving the branch to, recorded
	// before Git's branch is renamed; empty but while one is under way.
	RenameTo  string `json:",omitempty"`
	CreatedAt time.Time
	// Origin is who started it: a person, or serve for your outdated
	// ports. serve submits only its own (Design v3 §11).
	Origin Origin
	// Note is a person's note for the pull request, which its description
	// gives under Description each time dockhand writes it (submit
	// --note); empty for none. dockhand writes the whole description, so
	// a person had no way to say in it why rust's tests failed (the rust
	// run, #35084). It is the branch's, not the pull request's, so a note
	// given before one opens is kept for it.
	Note string
	// TestedBinaries and TestedVariants are the person's statements for
	// the pull request template's last two items, that they tested its
	// binaries and its variants, kept with the branch as its note is, so
	// a later submission says them without being told again (#91); nil
	// where none was made. Each is about the files it was made for, and
	// stands only while they're the same (TestedStatement.Stands, #153).
	TestedBinaries, TestedVariants *TestedStatement
	// Ports are the ports it was started for, by name: start --port's, or
	// the port an authoring command started it for. -p, status --port,
	// and its ports read them beside what it changes, so a branch started
	// for jq is jq's before it changes jq (the command-line UX second
	// look's §1).
	Ports []string
	// Closes are the Trac tickets update, ship, or bump's --closes named,
	// by number, which tidy writes as Closes: trailers with each one's URL
	// (the docs dig's I41).
	Closes []string
	// EndedAt is when it left open, merged, closed, or archived, which
	// cleanup times what it keeps of its checks from (D6); zero while it's
	// open. The store records the moment it leaves open where it's zero.
	EndedAt time.Time
	// CleanKept says what clean kept of the branch, as "fork branch kept:
	// moved after merge", which status --all says; empty where it kept
	// nothing, or hasn't cleaned it.
	CleanKept string
	// ForgottenAt is when clean --delete forgot the archived branch, which
	// nothing then reads as a branch: its record stays only for what
	// other branches' results name of its checks. Zero for one remembered.
	ForgottenAt time.Time
}

Branch is the unit of work.

func (Branch) ShortName

func (b Branch) ShortName() string

ShortName is the name people type: the Git name without dockhand's prefix.

func (Branch) Validate

func (b Branch) Validate() error

Validate checks the rules every stored branch keeps.

type BranchID

type BranchID string

BranchID identifies a branch's record independently of its Git ref name, which a person may rename (Design v3 §15, point 8).

type BranchState

type BranchState string

BranchState is where a branch is in its life.

const (
	BranchOpen     BranchState = "open"
	BranchMerged   BranchState = "merged"
	BranchClosed   BranchState = "closed"
	BranchArchived BranchState = "archived"
)

func (BranchState) CanBecome

func (s BranchState) CanBecome(next BranchState) bool

CanBecome reports whether a branch in state s may move to next. A merge is final. A closed pull request can be reopened, and archived work can be taken up again, so both return to open.

func (BranchState) Valid

func (s BranchState) Valid() bool

Valid reports whether the state is one this package defines.

type BuilderObserved

type BuilderObserved struct {
	// Builder names it, as its parts of results do (BuilderResult).
	Builder string `json:"builder"`
	// MacOS is its macOS release alone, 15; empty where it didn't say.
	MacOS string `json:"macos,omitempty"`
	// Version is its macOS version, 15.8.2, and Architecture the
	// machine's, arm64.
	Version      string `json:"version,omitempty"`
	Architecture string `json:"architecture,omitempty"`
	// Xcode is Xcode's version, 16.4, where there is Xcode; Tools is the
	// Command Line Tools package's version.
	Xcode string `json:"xcode,omitempty"`
	Tools string `json:"tools,omitempty"`
	// MacPorts is the MacPorts that built the ports, 2.12.7.
	MacPorts string `json:"macports,omitempty"`
}

BuilderObserved is what one builder of an environment reported about itself: a GitHub runner, its macOS release as the label its job ran on names it, and the rest as MacPorts Base's header in its log says it.

func (BuilderObserved) ToolsKnown added in v0.8.0

func (b BuilderObserved) ToolsKnown() bool

ToolsKnown reports whether the builder reported more than its release.

type BuilderResult

type BuilderResult struct {
	Builder string
	Outcome Outcome
	Phase   Phase       `json:",omitempty"`
	Tests   TestOutcome `json:",omitempty"`
	Log     string      `json:",omitempty"`
}

BuilderResult is one builder's part of a result: a runner's outcome, phase, tests, and log. A runner that didn't build the port, as MacPorts' workflow leaves a port off a macOS it doesn't support, is not run.

type CICause added in v0.5.0

type CICause string

CICause is what made a CI job fail, as its log was read.

const (
	// CIFetch is an archive MacPorts' fetch couldn't get, which another
	// run, its mirrors answering, may get.
	CIFetch CICause = "fetch"
	// CIUnclassified is a failure no reading named: the log was gone,
	// withheld, or held nothing a reading knows.
	CIUnclassified CICause = "unclassified"
)

type CIFailure added in v0.5.0

type CIFailure struct {
	Branch BranchID
	Head   ObjectID
	Run    int64
	// Attempt is the run's attempt the job was; a re-run is another.
	Attempt int
	Job     int64
	Check   string
	Cause   CICause
	// File, URL, and Status are the archive a fetch failed, the last site
	// tried, and the HTTP status it answered (0 for none), for CIFetch;
	// Reason is the site's reason, or, for CIUnclassified, why the log
	// said nothing a reading knows.
	File, URL string
	Status    int
	Reason    string
	// Error is the log's first error line, read as a local log's is, where
	// the job wasn't a fetch's; Ports are each port the job built, as
	// MacPorts' workflow marked it, in name order (schema 44, Then's item
	// 7). Empty for a job read before them.
	Error string
	Ports []CIPort `json:",omitempty"`
	At    time.Time
}

CIFailure is one of a pull request's failed CI jobs, classified once from its log: the head it ran at, its run, attempt, and job, its check's name, and what made it fail, where a reading found it (schema 37).

func (CIFailure) Validate added in v0.5.0

func (f CIFailure) Validate() error

Validate checks that a CI failure says which job, and what it was.

type CIPort added in v0.7.0

type CIPort struct {
	Port    string  `json:"port"`
	Outcome Outcome `json:"outcome"`
	Phase   Phase   `json:"phase,omitempty"`
}

CIPort is one port a CI job built, and how: passed, or failed at a phase.

type Carried added in v0.8.0

type Carried struct {
	Check    string      `json:"check"`
	Commit   ObjectID    `json:"commit,omitempty"`
	Ports    []InertPort `json:"ports"`
	Linted   bool        `json:"linted,omitempty"`
	LintKept string      `json:"lint_kept,omitempty"`
}

Carried is how a reused result stands for a revision whose port directories differ from what its build read only in options no build reads: the check that built it and the commit it built, each port judged, the target's own first where its directory differs, and lint's, where the target's own Portfile changed: Linted where lint ran again on this revision's Portfile, the result's lines its, or LintKept, why it couldn't, the result's lines the earlier Portfile's.

type ChangeRecord

type ChangeRecord struct {
	Branch    BranchID
	Tree      ObjectID
	Base      ObjectID
	Directory string
	// Platform is the context both sides were evaluated in: this Mac's.
	Platform Platform
	// Runtime is what both sides were evaluated under, as provenance
	// (CX-6): the MacPorts Base and Tcl, and the platform modelled where
	// it isn't the host's. Zero for a record made before it was kept;
	// the record's JSON is kept whole, so nothing migrates.
	Runtime EvaluatedUnder
	// Ports are the directory's subports at the base and the revision,
	// main port first, each with what moved.
	Ports []SubportChange
	// Problem says what kept the record from being made, where something
	// did: a side that couldn't be evaluated. Its readers then take the
	// directory's text scope, as without a record.
	Problem string
	// Unseen are subports whose Portfile text changed under a condition
	// this Mac's evaluation doesn't take, a platform block or a platform
	// condition (portfile.UnseenChanges): the record can't say they're
	// unchanged. AllUnseen is such a change outside any subport's block,
	// which leaves the record saying nothing of any subport it finds
	// unchanged.
	Unseen    []string `json:",omitempty"`
	AllUnseen bool     `json:",omitempty"`
	// Resources are the PortGroups of _resources whose files differ
	// between the two sides, each with the ports it moved, said before
	// them: what moved those ports is the shared code, not their own.
	Resources []ResourceChange `json:",omitempty"`
	Policy    int
	At        time.Time
}

ChangeRecord is what a revision changed in one port directory, against the revision's base, as MacPorts evaluates both (the evaluated-change model's step 1): per subport, the evaluated fields that moved, from what, to what. Like an assessment, it's the revision's, by its tree and base, whoever made the change: an update, a hand edit, or a rebase. It applies to the revision's files, its base, and the policy it was made under. A directory's text changing says it may have changed; its record says which of its subports did.

func (ChangeRecord) Changed

func (r ChangeRecord) Changed() []string

Changed are the subports the revision changes: added, removed, or changed, in the record's order. A record with a Problem names none of its own; its readers take the directory's text scope.

func (ChangeRecord) MovedVersion added in v0.7.0

func (r ChangeRecord) MovedVersion(port string) (string, bool)

MovedVersion is the version the record moves a subport it changes to, and false where it doesn't move one's version, as a revbump, a port the branch adds, or one it removes doesn't.

func (ChangeRecord) RenamedFrom added in v0.8.0

func (r ChangeRecord) RenamedFrom(port string) (string, bool)

RenamedFrom is the old name of a subport the record says the revision renamed, compared with the base's port of that name, and false for any other.

func (ChangeRecord) RevisionOnly

func (r ChangeRecord) RevisionOnly(port string) bool

RevisionOnly says whether the record changes a subport by its revision alone, as a rebuild does.

func (ChangeRecord) Scope

func (r ChangeRecord) Scope() ([]string, bool)

Scope is the subports a revision may change as far as the record can say, and whether it narrows the directory's text scope at all: those it finds changed, and those whose text changed where it can't see. It never narrows further than it covered: a record with a Problem, one that finds nothing changed though the files did, and one with a change it can't see outside any subport's block leave the text scope, every subport.

func (ChangeRecord) Validate

func (r ChangeRecord) Validate() error

Validate checks the rules every recorded change keeps.

type ChangeRequest added in v0.9.0

type ChangeRequest struct {
	// ID is new whenever what was asked changes.
	ID string
	// Origin is the command that asked: update, bump, ship or serve.
	Origin  string
	Targets []RequestTarget `json:",omitempty"`
	// Shared is --shared-release.
	Shared Flag[bool] `json:",omitzero"`
	// Source is how the edit is shaped: --source, --keep-http,
	// --keep-old-checksums, --keep-modeline and --follow-moves.
	Source SourceAsk `json:",omitzero"`
	// Actions are what is asked beside the version: --with-obsolete,
	// --revbump-dependents with --except, and --closes.
	Actions ActionsAsk `json:",omitzero"`
	// Outcomes are the request's own actions' outcomes, the dependents'
	// and the tickets', once each is concluded; a target's are on it.
	Outcomes []ActionOutcome `json:",omitempty"`
	// To is ship's stage, where --to was given: commit, check or submit.
	To Flag[string] `json:",omitzero"`
	// Check is the check's place, --on or --build as one choice, and its
	// --tests.
	Check CheckAsk `json:",omitzero"`
	// Publish is the submission's: --draft, --type, --skip-notification,
	// and the tested statements as asked, until they are bound.
	Publish PublishAsk `json:",omitzero"`
}

ChangeRequest is what was asked of one branch's work, one value kept with the branch (docs/designs/preparation-and-request.md at 6829407e, "The request"). #194 keeps its targets, each with the actions concluded for it; the flags as asked are #195's.

func (ChangeRequest) Clone added in v0.9.0

func (r ChangeRequest) Clone() ChangeRequest

Clone is a deep copy of the request: its targets with their releases and outcomes, every ask's list, and each outcome's JudgedBy and AppliedWith, so a change to the copy never reaches the request it was made from.

type CheckAsk added in v0.9.0

type CheckAsk struct {
	On    Flag[[]string] `json:",omitzero"`
	Build Flag[string]   `json:",omitzero"`
	Tests Flag[string]   `json:",omitzero"`
}

CheckAsk is the check's place and tests. The place is one choice: --on and --build each replace the other.

type CheckBuilds added in v0.9.0

type CheckBuilds struct {
	Targets      []PlanTarget
	Dependencies map[TargetID][]TargetID
}

CheckBuilds names the builds available in one environment and the builds each dependent is already known to consume (#236).

func (CheckBuilds) Consumed added in v0.9.0

func (b CheckBuilds) Consumed(dependent TargetID, active []ActivePort) (map[string]TargetID, error)

Consumed names the build of each in-check port active as a dependent built. A planned prerequisite missing from the active ports cannot be established as consumed, and leaves the inputs unknown (#236).

func (CheckBuilds) Planned added in v0.9.0

func (b CheckBuilds) Planned(dependent TargetID) (map[string]TargetID, error)

Planned names the builds a dependent is planned to consume before it runs. Missing target metadata or ambiguous edges cannot establish a selection, even for a request joining itself (#236).

func (CheckBuilds) Resolve added in v0.9.0

func (b CheckBuilds) Resolve(dependent TargetID, port string) (TargetID, error)

Resolve says which build of port satisfies dependent. An explicit dependency selects it first, otherwise the default build does, or the sole configured build. Two configured builds with no selection leave the plan unresolved: ordering after both cannot select an image (#236).

func (CheckBuilds) SameInputs added in v0.9.0

func (b CheckBuilds) SameInputs(dependent TargetID, inputs TargetInputs) bool

SameInputs reports whether the recorded in-check builds are the ones this check would consume. Old inputs with no such record stand only where no in-check port was consumed (#236).

type Checkpoint

type Checkpoint struct {
	// Number counts a repository's checkpoints from 1, whatever their kind.
	Number int
	Kind   CheckpointKind
	State  CheckpointState
	Branch BranchID
	// Before is the branch head it replaced, and After the one it wrote.
	Before, After ObjectID
	// BaseBefore and BaseAfter are the master the branch started from
	// before and after: a rebase moves it, and a tidy doesn't.
	BaseBefore, BaseAfter ObjectID
	// Index is the tree the index held before the rewrite, which can hold
	// staged content neither Before nor the working files have. IndexRef
	// keeps it reachable. Empty when nothing was recorded, as for a
	// rebase, which only runs with nothing uncommitted.
	Index      ObjectID
	At         time.Time
	RestoredAt *time.Time
}

Checkpoint keeps a branch's history from before tidy or rebase rewrote it, for restore. Its Git ref, refs/dockhand/checkpoints/<name>, keeps the old commits reachable. It is recorded, prepared, before the change it keeps is made, and settled, applied or abandoned, after, so a process that stops between them leaves a checkpoint the next one can finish.

func (Checkpoint) IndexRef

func (c Checkpoint) IndexRef() string

IndexRef is the Git ref that keeps the replaced index: a commit of its tree on Before.

func (Checkpoint) Name

func (c Checkpoint) Name() string

Name is what people type: tidy-3, or rebase-4.

func (Checkpoint) Ref

func (c Checkpoint) Ref() string

Ref is the Git ref that keeps the old history.

func (Checkpoint) Validate

func (c Checkpoint) Validate() error

Validate checks the rules every stored checkpoint keeps.

type CheckpointKind

type CheckpointKind string

CheckpointKind names what rewrote the history a checkpoint keeps.

const (
	CheckpointTidy   CheckpointKind = "tidy"
	CheckpointRebase CheckpointKind = "rebase"
)

type CheckpointState

type CheckpointState string

CheckpointState is how far the change a checkpoint keeps has come.

const (
	// CheckpointPrepared is recorded before its Git change is made.
	CheckpointPrepared CheckpointState = "prepared"
	// CheckpointApplied is a change made: the branch holds After.
	CheckpointApplied CheckpointState = "applied"
	// CheckpointAbandoned is a change that wasn't made; nothing restores it.
	CheckpointAbandoned CheckpointState = "abandoned"
)

type Concern

type Concern struct {
	Origin                    ConcernOrigin
	Port, Rule, Path, Subject string
	// Source is the archive an upstream finding is in, where the port
	// fetches more than one.
	Source string
	Class  ConcernClass
	Detail string
}

Concern is one thing a submission nobody reviews waits on a person's look for (the assessment design, E): where it came from, what raised it and what it's about, which are its identity, how the candidate stands on it, and its words, which aren't.

func (Concern) Key

func (c Concern) Key() string

Key identifies a concern: the same concern for two ports, or in two places, is two. One raised by no named rule is known by its words too.

func (Concern) Unported added in v0.4.0

func (c Concern) Unported() string

Unported is the concern as it reads for any port, its key without the port: the same finding of two subports is said once (the py-kubernetes run's "…follow; upstream's setup.py changed; …follow").

type ConcernClass

type ConcernClass string

ConcernClass is how a candidate stands against its base on a finding.

const (
	// Introduced is new with the candidate, as any change is.
	Introduced ConcernClass = "introduced"
	// Present is the base's too: said, and holding nothing, since an
	// update isn't an audit of everything the port already was.
	Present ConcernClass = "present"
	// UnknownBaseline is where the base couldn't be assessed, which
	// holds as what couldn't be checked does (D4).
	UnknownBaseline ConcernClass = "unknown-baseline"
)

type ConcernOrigin

type ConcernOrigin string

ConcernOrigin is where a concern came from.

const (
	// FromUpstream is an assessment of what upstream's change means for
	// a port.
	FromUpstream ConcernOrigin = "upstream"
	// FromCommitRules is a commit-rule finding.
	FromCommitRules ConcernOrigin = "commit-rules"
	// FromOtherPullRequests is another open pull request for a port, or
	// not knowing whether there is one.
	FromOtherPullRequests ConcernOrigin = "other-pull-requests"
	// FromSubmission is what stops the submission itself: a blocking
	// reason, or a plan that couldn't be made.
	FromSubmission ConcernOrigin = "submission"
	// FromHolds is a hold the configuration asks for, holds.majors's.
	FromHolds ConcernOrigin = "holds"
)

type Coverage

type Coverage struct {
	Path string `json:"path"`
	// Source is the archive Path is in, as a finding's is.
	Source string `json:"source,omitempty"`
	System string `json:"system,omitempty"`
	// Relevance is used, irrelevant, or unknown: whether the port's build
	// is known to read the file.
	Relevance string `json:"relevance"`
	// Treatment is inspected, or set-apart, and Policy the rule that set it
	// apart, with Reason in words.
	Treatment string `json:"treatment"`
	Policy    string `json:"policy,omitempty"`
	Reason    string `json:"reason,omitempty"`
}

Coverage is one thing an assessment read, or set apart, and why: a file, with the evidence of whether the port's build reads it (Relevance) kept apart from what the assessment did with it (Treatment), so a policy's setting apart is never mistaken for a proof.

type Decision added in v0.5.0

type Decision struct {
	// Branch is the branch it was made on; empty for a standing decision,
	// which answers its finding on any branch while its evidence holds.
	Branch  BranchID
	Finding FindingKind
	// Subject is what the finding is about: the port whose failure is
	// accepted.
	Subject string
	// Evidence is what it rests on: the commit a failure was accepted at.
	Evidence string
	Answer   DecisionAnswer
	// Words are the decision's words, whoever wrote them: dockhand's
	// refusal a hand edit answers (Refusal), or, as the person's voice
	// plans, the person's reason. Empty where none were given.
	Words string `json:",omitempty"`
	At    time.Time
}

Decision is a person's answer to a finding, which a later command reads in place of asking again (the direction synthesis's decision record): the finding it answers, by its kind and subject, the evidence it rests on, and the answer. It lapses when its evidence changes, since it's read only for that evidence: an acceptance of a port's failure at one commit says nothing of the next (Design v3 §3's publication rule).

func (Decision) Validate added in v0.5.0

func (d Decision) Validate() error

Validate checks the rules every stored decision keeps.

type DecisionAnswer added in v0.5.0

type DecisionAnswer string

DecisionAnswer is how a person answered a finding.

const Accepted DecisionAnswer = "accepted"

Accepted takes a finding as it is: a failure that isn't the branch's doing, submitted with the failure disclosed.

const ByHand DecisionAnswer = "by-hand"

ByHand takes an edit dockhand refused as the person's own to make, from dockhand's attempt (FindingHandEdit).

const Waiting DecisionAnswer = "waiting"

Waiting leaves a concern for later, awaiting what its words say, as upstream's answer: it blocks the submission until decided otherwise (FindingConcern).

type Declared added in v0.8.0

type Declared struct {
	Ports  []DeclaredPort `json:"ports"`
	MachOs int            `json:"machos"`
}

Declared is what a passed build's declared libraries install, as its guest read them: each port its depends_lib names, and the count of the Mach-O files the build installed.

type DeclaredPort added in v0.8.0

type DeclaredPort struct {
	Port      string            `json:"port"`
	Libraries []string          `json:"libraries"`
	Modules   []PkgConfigModule `json:"modules"`
}

DeclaredPort is what one port a target declares in depends_lib installs that a build could link: its dynamic libraries' files, and its pkg-config modules.

type DependencyArchive

type DependencyArchive struct {
	Archive
	Port        string
	Environment Environment
	PortGroups  map[string]ObjectID
}

DependencyArchive is a kept archive (Archive) a guest installed a port it didn't build as a target from, for a later guest in the same environment to install rather than build: rust and cargo, built from source where MacPorts had no archive for the release yet (batch 90). The port is one the check's revision had as its base did; one the branch changed is a target, whose archive is its result's.

PortGroups are the PortGroup files the guest built it with, each by its blob ID, by its path in the ports tree, where it built it from source (ActivePort.PortGroups): a check offers it only while its revision holds the same files. Nil for an archive a guest installed from MacPorts' own, and for those kept before (schema 54), each offered as before.

type DeveloperTools

type DeveloperTools string

DeveloperTools are the compilers and SDKs a build environment offers.

const (
	// DeveloperToolsCommandLine is the Command Line Tools alone.
	DeveloperToolsCommandLine DeveloperTools = "command-line-tools"
	// DeveloperToolsXcode is Xcode, with the Command Line Tools beside it.
	DeveloperToolsXcode DeveloperTools = "xcode"
)

type Edit

type Edit struct {
	ID     EditID
	Branch BranchID
	Kind   EditKind
	Port   string
	// Directory is the port's directory, such as textproc/jq.
	Directory string
	// Subject is the commit subject the edit carries, such as
	// "jq: update to 1.8.1".
	Subject string
	Files   []EditedFile
	At      time.Time
	// Upstream is what comparing the old and new upstream archives found,
	// for an update that compared them; nil when it did not.
	Upstream *UpstreamComparison
	// Release is the release an update chose, as it was found: its forge,
	// repository, tag, and upstream commit, or its distfiles. Nil for
	// other edits.
	Release *Release `json:",omitempty"`
	// Excepted are, for a revision bump, the dependents --except left out
	// of the same rebuild, which the pull request's description lists.
	Excepted []string `json:",omitempty"`
	// HTTPS are the plain-HTTP links the edit switched to https, which
	// answered there, which tidy's commit and the pull request say.
	HTTPS []HTTPSLink `json:",omitempty"`
	// Source is, for an update that moved a GitHub port's source, the
	// move, which tidy's commit and the pull request say; nil for every
	// other edit.
	Source *SourceMove `json:",omitempty"`
	// Written is when the edit's files were seen written; zero until
	// then, where the edit is recorded before its files are (#194).
	Written time.Time `json:",omitzero"`
	// Result is what preparing the edit found and did; nil on an edit
	// from before it was kept, or one no preparation made.
	Result *EditResult `json:",omitempty"`
}

Edit is what an authoring command wrote in a branch's working files. It is kept so tidy can tell a port's edits that are exactly dockhand's from ones a person changed afterwards, and use the subject dockhand wrote.

func (Edit) Validate

func (e Edit) Validate() error

Validate checks the rules every stored edit keeps.

type EditID

type EditID string

EditID identifies an authoring command's record.

type EditIntent

type EditIntent struct {
	// SharedRelease authorizes moving every subport that shares the
	// selected port's release source.
	SharedRelease bool `json:",omitempty"`
	// Stub names the port a person selected when the edit targets its
	// newest versioned subport instead: the branch and commit carry this
	// name, and the editor honors the redirect.
	Stub string `json:",omitempty"`
	// KeepOldChecksums refreshes a legacy checksum group's values in place,
	// md5 and sha1 included, instead of rewriting it as rmd160, sha256, and
	// size.
	KeepOldChecksums bool `json:",omitempty"`
}

EditIntent is what a person asked of an update beyond the version: the choices that shape the commit. It is set once from the command line and travels unchanged to the editor, so an option is one field rather than one copied through every type on the way.

type EditKind

type EditKind string

EditKind is what an authoring command does: what an update asks the editor for, and what its edit records.

const (
	// EditUpdate moves a port to a new version, with its source metadata.
	EditUpdate EditKind = "update"
	// EditChecksums refreshes a port's distfile checksums for its source.
	EditChecksums EditKind = "checksums"
	// EditRevbump increments a port's revision without changing its
	// version.
	EditRevbump EditKind = "revbump"
	// EditCreate is a new port's first Portfile, which create writes; the
	// editor is never asked for it.
	EditCreate EditKind = "create"
	// EditRename is a port renamed, its Portfile and files at the new
	// name's directory and an obsolete stub at the old one; EditMove a
	// port moved to another category's directory, keeping its name.
	EditRename EditKind = "rename"
	EditMove   EditKind = "move"
)

type EditResult added in v0.9.0

type EditResult struct {
	// Before and After are the port's version and revision on each side.
	Before, After string
	// Patches are the port's patches as the prepared Portfile declares
	// them, after anything the edit dropped or refreshed; nil where that
	// final declaration wasn't read, which is not a list with nothing in
	// it.
	Patches  *PatchCheck `json:",omitempty"`
	Findings []Finding   `json:",omitempty"`
}

EditResult is what preparing one edit found and did (docs/designs/ preparation-and-request.md at 6829407e, "The records", #194).

type EditedFile

type EditedFile struct {
	Path   string
	Before ObjectID
	After  ObjectID
	// BeforeMode and AfterMode are Git's mode for the file on each side,
	// such as 100644; empty where it is absent there, or on an edit from
	// before modes were kept (#194).
	BeforeMode string `json:",omitempty"`
	AfterMode  string `json:",omitempty"`
}

EditedFile is one file an authoring command wrote: its blob before and after, empty where the file was absent.

type Entry added in v0.8.0

type Entry struct {
	At          time.Time   `json:"at"`
	Environment Environment `json:"environment"`
	Command     string      `json:"command,omitempty"`
}

Entry is a shell opened in a running check's guest: when, in which environment, and the command, empty for an interactive shell.

type Environment

type Environment struct {
	Provider string
	Platform Platform
	// DeveloperTools are what builds there have, when the provider states
	// them: Tart's release image, with Xcode when the release has an
	// Xcode image, else the Command Line Tools alone. Unstated for a
	// provider whose builders have their own.
	DeveloperTools DeveloperTools `json:",omitempty"`
	// Prefix is the MacPorts installation on this Mac a local check builds
	// in, /opt/macports-test: two prefixes are two environments, each with
	// its own evidence. Empty for every other provider.
	Prefix string `json:",omitempty"`
}

Environment is one provider and platform a plan is checked on.

type EnvironmentPlan

type EnvironmentPlan struct {
	Environment Environment
	// Order is the plan's targets built here, in this environment's own
	// dependency order. Unmet ones are in it: they are planned here, and
	// never sent to its provider.
	Order []TargetID
	// Dependencies are what each target in Order needs built first here,
	// among Order.
	Dependencies map[TargetID][]TargetID `json:",omitempty"`
	// NeedsXcode are the targets in Order that need Xcode here, not only
	// the Command Line Tools: their use_xcode, as MacPorts decides it with
	// the environment's tools.
	NeedsXcode []TargetID `json:",omitempty"`
	// MinimumXcode is, for each target in Order whose
	// minimum_xcodeversions this environment's Xcode doesn't meet, the
	// Xcode it requires here.
	MinimumXcode map[TargetID]string `json:",omitempty"`
	// Xcode is the Xcode this environment was evaluated with, where a
	// target's minimum isn't met by it, "none" for the Command Line Tools
	// alone; empty where every minimum is met, or in a plan made before it
	// was kept.
	Xcode string `json:",omitempty"`
	// Untested are the targets in Order that declare no tests here, their
	// test.run off as MacPorts evaluates it: they pass whatever the test
	// policy, which a plan requiring tests says of them.
	Untested []TargetID `json:",omitempty"`
	// Unmet are the targets in Order this environment can't build, decided
	// when the check is accepted.
	Unmet []Unmet `json:",omitempty"`
	// Exclusions are the ports the plan doesn't build here, and that
	// needn't pass here, those --only left out included.
	Exclusions []Exclusion `json:",omitempty"`
	// Git are the targets in Order fetched with Git here, each with the
	// source its build is expected to fetch: the commit its git.branch
	// named when the check was planned (batch 20). The changed targets
	// --only left out that would be built here have theirs too: the check
	// doesn't build them, but an earlier check's result of one stands only
	// where it fetched that commit, and a submission compares that commit
	// with what the tag names then.
	Git map[TargetID]GitSource `json:",omitempty"`
	// Tags are the targets here fetched as a GitHub tag's archive, each
	// with the commit its tag named when the check was planned, read with
	// git ls-remote: a tag binds nothing, and an archive fetched by a moved
	// tag isn't the one the Portfile's checksums describe (the rc8 full
	// stage's D-N5, dh-fixture-retag). Reuse and a submission read them.
	Tags map[TargetID]GitSource `json:",omitempty"`
}

EnvironmentPlan is what a check builds in one environment, from that environment's own evaluation of the ports: which of the plan's targets it builds, in its own dependency order, what they need there, and why it doesn't build the rest.

func (EnvironmentPlan) Builds

func (p EnvironmentPlan) Builds(id TargetID) bool

Builds reports whether the environment's plan has the target in its order: built here, or planned here and unmet.

type Evaluated added in v0.8.0

type Evaluated struct {
	Target                               TargetID
	Environment                          Environment
	Variants                             []string
	DependsBuild, DependsLib, DependsRun []string
	ConfigureArgs, ConfigureEnv          string
}

Evaluated is a planned target as an environment evaluated it: its variants as MacPorts resolves them, its defaults not negated and those asked, its dependencies by type, and its configure.args and configure.env as MacPorts writes them, evaluated on this Mac with the environment's platform.

type EvaluatedUnder added in v0.5.0

type EvaluatedUnder struct {
	BaseVersion, TclVersion string `json:",omitempty"`
	Platform                Platform
	Host                    Platform `json:",omitzero"`
	// DarwinVersion is the kernel's full version, and Xcode and Tools the
	// developer tools' versions, as the evaluator read them (#194).
	DarwinVersion string `json:",omitempty"`
	Xcode, Tools  string `json:",omitempty"`
}

EvaluatedUnder is the evaluator's runtime a record was made under: MacPorts Base's version and Tcl's, the platform the interpreter described to the Portfile, and the host's where that was a model.

type EvaluationConsent added in v0.9.0

type EvaluationConsent struct {
	// Repository is the pull request's base repository, such as
	// macports/macports-ports.
	Repository string
	Number     int
	Head       ObjectID
	At         time.Time
}

EvaluationConsent is the person's yes to dockhand evaluating another person's Portfiles on this Mac: for the pull request, at the author's commit it was given for, and when (#162). A new push from the author is another commit, and asks again.

func (EvaluationConsent) Validate added in v0.9.0

func (c EvaluationConsent) Validate() error

type Event

type Event struct {
	// Sequence orders events; the store assigns it.
	Sequence int64
	At       time.Time
	Session  SessionID
	Branch   BranchID
	Run      RunID
	Target   TargetID
	// Kind is a stable name for the event's type, such as run.state;
	// observers show kinds they do not know generically.
	Kind    EventKind
	Level   EventLevel
	Message string
}

Event is one entry in a repository's journal: a transition, a provider milestone, a capacity wait, a retry, or a problem. Observers tail events by sequence, so every terminal tells the same story.

type EventKind added in v0.4.0

type EventKind string

EventKind names an event's type in the journal: what the engine emits and what command, watch, and serve match it by (C4b's typed half; the command package review's 7a row 14), one constant each.

const (
	EventSessionStart EventKind = "session.start"
	EventSessionEnd   EventKind = "session.end"
	EventLeaseAcquire EventKind = "lease.acquire"
	EventRunState     EventKind = "run.state"
	EventRunCancel    EventKind = "run.cancel"
	EventProgress     EventKind = "progress"
	// EventWaiting is a run waiting on something outside it, a slot or
	// the Mac's VMs, which every level says (rc1's D-R2).
	EventWaiting        EventKind = "waiting"
	EventTargetResult   EventKind = "target.result"
	EventExecutionState EventKind = "execution.state"
	EventExecutionRetry EventKind = "execution.retry"
	// EventArchiveGone says a dependency's kept archive is gone, and
	// EventArchiveAltered one changed since it was kept.
	EventArchiveGone    EventKind = "archive.gone"
	EventArchiveAltered EventKind = "archive.altered"
	EventCleanup        EventKind = "cleanup"
	// EventServeSubmit is a pull request serve opened unattended, which
	// its daily limit counts.
	EventServeSubmit         EventKind = "serve.submit"
	EventPullRequestObserved EventKind = "pr.observed"
	EventReview              EventKind = "review"
	EventBranchStart         EventKind = "branch.start"
	EventBranchAdopt         EventKind = "branch.adopt"
	EventBranchEdit          EventKind = "branch.edit"
	EventBranchRename        EventKind = "branch.rename"
	EventBranchWorktree      EventKind = "branch.worktree"
	EventBranchState         EventKind = "branch.state"
	EventBranchSubmit        EventKind = "branch.submit"
	EventBranchRerequest     EventKind = "branch.rerequest"
	// EventBranchPush records a submission's push in the timeline.
	EventBranchPush    EventKind = "branch.push"
	EventBranchReady   EventKind = "branch.ready"
	EventBranchRestore EventKind = "branch.restore"
	EventBranchClean   EventKind = "branch.clean"
)

func CheckpointEvent added in v0.4.0

func CheckpointEvent(kind CheckpointKind) EventKind

CheckpointEvent is the event a tidy's or a rebase's checkpoint is recorded by: branch.tidy, branch.rebase.

func (EventKind) ChangesStatus added in v0.4.0

func (k EventKind) ChangesStatus() bool

ChangesStatus reports whether an event of the kind can change what status shows: a run's state, a branch's, a pull request's, and serve's work, as against a check's progress, a target's result before its run ends, and sessions' comings and goings, which a live status needn't redraw for (SQL-O6). A checkpoint is a branch's.

type EventLevel

type EventLevel string

EventLevel is the output level at which an event is shown, as v2 defined them (docs/v2/output.md, at tag v2-final).

const (
	LevelInfo    EventLevel = "info"
	LevelVerbose EventLevel = "verbose"
	LevelDebug   EventLevel = "debug"
)

func (EventLevel) AtLeast added in v0.4.0

func (l EventLevel) AtLeast() []EventLevel

AtLeast are the levels at least as important as l, info first: info alone for info, and every level for debug. An empty level is every one.

type Exclusion

type Exclusion struct {
	Target Target
	Reason string
	// Span is a minmax profile's choice: the port builds on its oldest
	// and newest releases, and not this one. Nothing about the port keeps
	// it from building there, so a result table leaves it out rather than
	// saying "not built" (the person's word, 2026-10-16).
	Span bool `json:",omitempty"`
}

Exclusion is a port a plan doesn't build in one environment, and needn't pass there, with the reason: as MacPorts CI would exclude it, or because the environment's evaluation doesn't define it.

type ExecutionID

type ExecutionID string

ExecutionID identifies one guest execution.

type ExecutionState

type ExecutionState string

ExecutionState is where a guest execution is.

const (
	// ExecutionWaiting is admitted work waiting for its environment:
	// capacity, a clone, or a boot.
	ExecutionWaiting  ExecutionState = "waiting"
	ExecutionRunning  ExecutionState = "running"
	ExecutionFinished ExecutionState = "finished"
	// ExecutionInfrastructure ended without a verdict for every target
	// because the environment failed: the VM did not boot, the guest was
	// lost. Finished targets keep their results; a retry is a new execution.
	ExecutionInfrastructure ExecutionState = "infrastructure-failed"
	ExecutionCanceled       ExecutionState = "canceled"
)

func (ExecutionState) CanBecome

func (s ExecutionState) CanBecome(next ExecutionState) bool

CanBecome reports whether an execution in state s may move to next.

func (ExecutionState) Terminal

func (s ExecutionState) Terminal() bool

Terminal reports whether nothing further happens to an execution in this state.

type FailedDependency added in v0.5.0

type FailedDependency struct {
	Name, Version string
}

FailedDependency is a dependency whose failure failed a target: its name, and its version and revision as the ports tree had them, 15.2.0_1, where the provider could say.

type FieldChange

type FieldChange struct {
	Field    string
	From, To string
}

FieldChange is one evaluated field that moved: an option, the version, revision, or epoch, the dependencies, or the fetch's kind.

type Finding added in v0.9.0

type Finding struct {
	// Kind is a stable name: patch-rejected, plain-http, …
	Kind string
	// Subject is what it is about: the patch, the URL, the repository or
	// the pull request.
	Subject string `json:",omitempty"`
	// Fixed is the edit having dealt with it; otherwise it is left.
	Fixed bool `json:",omitempty"`
	// Detail are the tool's own lines, kept as captured: the hunks that
	// failed, a comment quoted.
	Detail []string `json:",omitempty"`
}

Finding is one thing preparing an edit found: data, worded when it is shown, so a kind a reader doesn't know is shown by its name and detail.

type FindingKind added in v0.5.0

type FindingKind string

FindingKind is the kind of finding a decision answers.

const (
	// FindingFailure is a port's failure in a check: a failed revision-only
	// target or extra, or a changed port whose base fails it alike.
	FindingFailure FindingKind = "failure"
	// FindingEnvironmentFailure is a dependency failing in an environment,
	// whatever port needs it: Monterey's Xcode image refusing lang/gcc15 at
	// pre-fetch, so that anything pulling in libgcc15 fails there, master
	// included (the person's choice, 2026-10-18). Its decision is standing,
	// its subject the dependency, and its evidence the dependency's
	// version on the image (EnvironmentEvidence).
	FindingEnvironmentFailure FindingKind = "environment-failure"
	// FindingHandEdit is an update dockhand refused, whose best attempt it
	// wrote for the person to finish (update --hand-edit, Then's item 3):
	// its subject the port's directory, its evidence the digest of the
	// attempted files, its words the refusal (HandRefusal), and its answer
	// ByHand.
	FindingHandEdit FindingKind = "hand-edit"
	// FindingConcern is a concern that holds a submission nobody looks
	// over, one finding the person answered with their reason (the
	// person's voice, Then's item 13): its subject the concern's
	// (ConcernSubject), its evidence the branch's files, the tree it was
	// decided on, its words the reason, and its answer Accepted,
	// "acceptable because…", or Waiting, "awaiting…".
	FindingConcern FindingKind = "concern"
)

type Flag added in v0.9.0

type Flag[T any] struct {
	Given bool `json:",omitempty"`
	Value T    `json:",omitzero"`
}

Flag is a flag with whether it was given: a flag left out is told from one given false or empty (#195). (The design calls it Asked, which a publication's record already names.)

func Set added in v0.9.0

func Set[T any](value T) Flag[T]

Set is a flag given with value.

func (Flag[T]) Or added in v0.9.0

func (a Flag[T]) Or(fallback T) T

Or is the flag's value where it was given, else fallback.

type GitSource

type GitSource struct {
	URL string
	// Ref is git.branch: a tag, a branch, or a commit, which MacPorts
	// checks out after cloning; empty for the repository's default branch.
	Ref string `json:",omitempty"`
	// Commit is what Ref named at ResolvedAt: Ref itself where it is a
	// whole commit.
	Commit ObjectID `json:",omitempty"`
	// Abbreviation is set instead where Ref is no ref of the repository but
	// an abbreviated commit, which only a clone expands: the commit a build
	// fetches begins with it.
	Abbreviation string `json:",omitempty"`
	// ResolvedAt is when the repository's refs were read.
	ResolvedAt time.Time `json:",omitzero"`
	// Unresolved says why neither is known: the repository couldn't be
	// read, or none of its refs is Ref.
	Unresolved string `json:",omitempty"`
	// Missing is an Unresolved repository that was read, and has no ref
	// Ref names, which a day may change, as a tag not yet pushed; one not
	// Missing couldn't be read, which another try may meet at once (C8-5).
	Missing bool `json:",omitempty"`
}

GitSource is a Git-fetched port's source as a check expects its build to fetch it (the assessment design's source, A). As declared, it is git.url and git.branch as MacPorts evaluates them where the port builds; as observed, the commit git.branch named when dockhand resolved it from the repository's refs, and when. A tag binds nothing, as an archive's checksums do, so what a build fetched is a fact of its own, which its result keeps (TargetInputs.Fetched), and which a resolution made later never stands in for.

func (GitSource) AgainstFetched added in v0.9.0

func (s GitSource) AgainstFetched(fetched ObjectID) SourceStanding

AgainstFetched judges a resolution and the whole commit a build says it fetched, empty where it said none. It never answers other.

func (GitSource) Expected

func (s GitSource) Expected() string

Expected is what a build of the source must check out: the commit, or the abbreviation the commit begins with; empty where Ref couldn't be resolved, and nothing is expected.

type GroupedExclusion added in v0.4.0

type GroupedExclusion struct {
	Targets      []TargetID
	Reason       string
	Environments []Environment
}

GroupedExclusion is ports a plan doesn't build, for one reason, and the environments that leave each of them out for it.

func (GroupedExclusion) Everywhere added in v0.4.0

func (x GroupedExclusion) Everywhere(plan Plan) bool

Everywhere reports whether every environment of plan leaves the port out for this reason.

type GuestExecution

type GuestExecution struct {
	ID          ExecutionID
	Run         RunID
	Environment Environment
	// Attempt counts from 1 up to MaxAttempts.
	Attempt int
	State   ExecutionState
	Detail  string
	// ProviderRef is the provider's own name for the environment: a VM
	// clone, a workflow run.
	ProviderRef string
	// Launch is the provider's own note of what it is about to start, in
	// a form its Stop reads: saved under the attempt's launch lock before
	// anything is started, and never replaced by ProviderRef, which stays
	// where a person looks (the lifecycle design's "What a provider
	// launched is kept"). Empty where nothing was launched, and on an
	// attempt recorded before it.
	Launch string
	// Observed is what the environment reported about itself, when its
	// provider can say; once reported, it stays.
	Observed Observed
	// Identity is the environment's identity by origin when the execution
	// began (buildenv.IdentityProvider): what it was made from and with.
	// Empty where its provider can't say.
	Identity string
	// Reused is true for an execution that built nothing: every target it
	// had to build would read what an earlier build of it read, whose
	// result it keeps (decision 28, TargetResult.ReusedFrom).
	Reused     bool
	CreatedAt  time.Time
	FinishedAt *time.Time
}

GuestExecution is one provider run: the one owner of a provider environment for a run, on one environment and attempt. Its targets' results are checkpointed beneath it as each finishes. Its ID is unique, and named for its provider, tart_7y62p4sigena6xlr.

func (GuestExecution) Validate

func (e GuestExecution) Validate() error

Validate checks the rules every stored execution keeps.

type HTTPSLink struct {
	Option string `json:"option"`
	URL    string `json:"url"`
}

HTTPSLink is a plain-HTTP link an edit switched to https: the option that names it, such as homepage, and its URL as it was.

type InertPort added in v0.8.0

type InertPort struct {
	Port    string   `json:"port"`
	Options []string `json:"options,omitempty"`
	From    string   `json:"from,omitempty"`
	// Declared are the ports its Portfile declares since, each one the
	// build had active (reuse.Declared).
	Declared []string `json:"declared,omitempty"`
}

InertPort is one port a carried result judged: its name, the inert options its Portfile changed, and the directory it moved from, where it moved.

type KeptCloneReplacement added in v0.9.0

type KeptCloneReplacement struct {
	Check   string `json:"check"`
	Release string `json:"release"`
}

KeptCloneReplacement is an earlier asked clone a new kept check replaces.

type Lease

type Lease struct {
	Resource string
	// Holder is empty when the lease is free.
	Holder     SessionID
	Generation uint64
	AcquiredAt time.Time
}

Lease is the fenced claim on one resource: a run, an execution, a provider reservation, or a repository's leadership. Generation increases with every acquisition and survives release, so a write carrying an older generation is refused.

type Library added in v0.7.0

type Library struct {
	File          string `json:"file"`
	Name          string `json:"name"`
	Compatibility string `json:"compatibility,omitempty"`
}

Library is one of a build's own dynamic libraries: its file, the LC_ID_DYLIB install name its dependents link it by, and its compatibility version, which a change of breaks them until rebuilt.

type Link struct {
	Binary  string `json:"binary"`
	Library string `json:"library"`
	Port    string `json:"port,omitempty"`
	// Declared is the target's path: dependency that reaches Port through
	// its symbolic links, as openssl's lib/libssl.dylib reaches
	// openssl3's file, which declares the link; empty where none does.
	Declared string `json:"declared,omitempty"`
}

Link is one library a target's installed binary links: the binary, the library as the link resolves under the prefix, and the port that provides it, empty where no port does.

type LogStep

type LogStep struct {
	Name Step
	Line int
}

LogStep is where a step of a target's build begins in its log: the line its output starts on, counting from 1.

type ObjectID

type ObjectID string

ObjectID is a full Git object identifier for a commit, tree, or blob.

func (ObjectID) Short added in v0.4.0

func (id ObjectID) Short() string

Short abbreviates a commit for people: its first seven characters (the architecture review's H1: three copies and engine.Short, one now).

type Observed

type Observed struct {
	// MacOS and Build are sw_vers's product and build versions, 26.6.2
	// and 25G71.
	MacOS string `json:"macos,omitempty"`
	Build string `json:"build,omitempty"`
	// Architecture is the machine's, arm64.
	Architecture string `json:"architecture,omitempty"`
	// Xcode and XcodeBuild are xcodebuild -version's, where there is
	// Xcode; Tools is the Command Line Tools package's version.
	Xcode      string `json:"xcode,omitempty"`
	XcodeBuild string `json:"xcode_build,omitempty"`
	Tools      string `json:"tools,omitempty"`
	// DeveloperDir is xcode-select's, the developer tools MacPorts uses.
	DeveloperDir string `json:"developer_dir,omitempty"`
	// MacPorts is the MacPorts that built the ports, 2.12.6.
	MacPorts string `json:"macports,omitempty"`
	// ActivePorts is how many ports were active in a local check's prefix
	// as it began, which a build as-is builds among; Foreign are the other
	// package managers found on the Mac, /opt/homebrew. Both empty for a
	// clean VM's.
	ActivePorts int      `json:"active_ports,omitempty"`
	Foreign     []string `json:"foreign,omitempty"`
	// Builders are what each builder reported, where the environment has
	// several, as MacPorts' workflow has a runner for each macOS release
	// (TargetResult.Builders); the fields above then say nothing. Empty
	// for one builder.
	Builders []BuilderObserved `json:"builders,omitempty"`
}

Observed is what a build environment reported about itself, in the words MacPorts' pull request template asks for under Tested on: the macOS product and build versions, the architecture, and the developer tools' versions. A field is empty where the environment didn't say.

func (Observed) Equal

func (o Observed) Equal(other Observed) bool

Equal reports whether two reports say the same, builder by builder.

func (Observed) IsZero

func (o Observed) IsZero() bool

IsZero reports a report that says nothing.

type Origin

type Origin string

Origin says who asked for a run, which decides its place in the queue: work a person asked for comes before work serve started by itself.

const (
	OriginPerson Origin = "person"
	OriginServe  Origin = "serve"
)

type Outcome

type Outcome string

Outcome is what happened to one target in one execution.

const (
	OutcomePassed Outcome = "passed"
	OutcomeFailed Outcome = "failed"
	// OutcomeBlocked is a target whose changed dependency failed; it did
	// not fail itself.
	OutcomeBlocked Outcome = "blocked"
	// OutcomeInterrupted is a target that was building when its
	// environment was lost.
	OutcomeInterrupted Outcome = "interrupted"
	// OutcomeNotRun is a target the execution never reached.
	OutcomeNotRun Outcome = "not-run"
	// OutcomeUnmet is a target its environment can't build, because it
	// lacks what the target needs (Plan.Unmet). The plan decides it when
	// the check is accepted, and no provider records it. It says nothing
	// about the port, and the target still needs a check somewhere that
	// has what it needs.
	OutcomeUnmet Outcome = "unmet"
)

func (Outcome) Complete

func (o Outcome) Complete() bool

Complete reports whether the outcome is a verdict a retry keeps rather than repeats.

type PatchCheck added in v0.9.0

type PatchCheck struct {
	// Scope is the evaluation the list was read in (PatchScope); two
	// lists are compared only where their scopes are equal and known
	// (ScopesComparable).
	Scope string
	// Declared is every patch declared there; empty where none is.
	Declared []PatchResult
}

PatchCheck is the port's declared patches, with what the check found, read in one evaluation.

type PatchResult added in v0.9.0

type PatchResult struct {
	Name  string
	State PatchState
}

PatchResult is one declared patch and what the check found of it.

type PatchState added in v0.9.0

type PatchState string

PatchState is a declared patch's state as an update's check left it.

const (
	PatchApplied   PatchState = "applied"
	PatchRejected  PatchState = "rejected"
	PatchUnchecked PatchState = "unchecked"
)

type Phase

type Phase string

Phase is where a target's check stopped.

const (
	PhaseLint Phase = "lint"
	// PhaseDependencies is the install of a target's dependencies, whose
	// failure is a dependency's: it read as the target's own install's,
	// "luminance-hdr failed at install", where qt5-qtwebengine had failed
	// to build (the exiv2 session's notes, 2026-10-21).
	PhaseDependencies Phase = "dependencies"
	PhaseFetch        Phase = "fetch"
	PhaseChecksum     Phase = "checksum"
	PhaseInstall      Phase = "install"
	PhaseTest         Phase = "test"
	// The phases MacPorts runs within the install, which a failure there
	// names: "Failed to patch kitty" read as "failed at install" (field
	// testing's kitty 0.50.0, check-791).
	PhaseExtract   Phase = "extract"
	PhasePatch     Phase = "patch"
	PhaseConfigure Phase = "configure"
	PhaseBuild     Phase = "build"
	PhaseDestroot  Phase = "destroot"
	PhaseActivate  Phase = "activate"
)

func (Phase) FailureWords added in v0.5.0

func (p Phase) FailureWords() string

FailureWords say a failure at the phase: "failed at install", and "a dependency failed" for a dependency's.

func (Phase) Installing added in v0.8.0

func (p Phase) Installing() bool

Installing reports the install or one of the phases MacPorts runs within it.

func (Phase) Step added in v0.8.0

func (p Phase) Step() Step

Step is the step of a target's build the phase is in: the install for a phase MacPorts runs within it, else the step of its name.

func (Phase) Valid

func (p Phase) Valid() bool

Valid reports one of the phases a check stops at.

type PkgConfigModule added in v0.8.0

type PkgConfigModule struct {
	Name     string   `json:"name"`
	Libs     []string `json:"libs"`
	Requires []string `json:"requires"`
}

PkgConfigModule is a .pc file's module: its name, the -l names of its Libs: line, and the modules its Requires: line names.

type Plan

type Plan struct {
	ID       PlanID
	Revision RevisionID
	// Environments are all required: several mean every one must pass.
	Environments []Environment
	// Profile is the build profile that named them, as minmax; empty
	// where --on did.
	Profile string `json:",omitempty"`
	// Asked says the person named where it builds, with --on or --build:
	// submit then needs exactly its environments, where a check that
	// named none needs the profile in effect, build.default (D17). A
	// check recorded before it was kept named none.
	Asked bool `json:",omitempty"`
	// Targets are what the check builds in some environment, in the
	// environments' orders merged: the first environment's, and what each
	// other one adds, after what comes before it there.
	Targets []PlanTarget
	// Builds are each environment's own plan, one for each of
	// Environments, found by the whole environment.
	Builds     []EnvironmentPlan
	Unresolved []Unresolved
	// Omitted are the changed targets --only left out. The check doesn't
	// build them, but submission still requires them wherever they aren't
	// excluded: a narrowed check never shrinks what submit requires
	// (Design v3 §7).
	Omitted []PlanTarget `json:",omitempty"`
	// Removed are the port directories the branch deletes, moved nowhere,
	// which no environment builds.
	Removed []string `json:",omitempty"`
	// Only and Also record the selection as given, for status and the PR.
	Only  []string
	Also  []string
	Tests TestPolicy
	// Fresh builds every target, reusing no earlier build's result
	// (decision 28).
	Fresh bool `json:",omitempty"`
	// Keep keeps each environment's clone, stopped, where its guest
	// finished, whether its targets passed or failed, for dockhand shell:
	// a check a person runs, never serve's or ship's.
	Keep bool `json:",omitempty"`
	// Unattended marks a person-started check run with --yes. Its failure
	// clone isn't kept as a cache, since nobody is there to inspect it.
	Unattended bool `json:",omitempty"`
	// ReplacesKept names asked clones this plan's --keep will replace,
	// before its own clones exist.
	ReplacesKept []KeptCloneReplacement `json:"replaces_kept,omitempty"`
	// Variants are the variants --variants built its one port with, as
	// MacPorts writes them, beside its default variants, which MacPorts
	// adds but where one is negated: a build in place of its default
	// build. EachVariant is --variants each, which built it with its
	// defaults and then with each variant it declares.
	Variants    string `json:",omitempty"`
	EachVariant bool   `json:",omitempty"`
	CreatedAt   time.Time
	// Evaluated are each planned target's evaluation in each environment
	// it builds in, as planning read it, for check --plan -v and --json
	// to print (field testing's curl +sectrust notes, note 8b). Planning's
	// alone: a recorded plan has none.
	Evaluated []Evaluated `json:"-"`
}

Plan freezes what a check of one revision covers. What the branch changes and what the person selected are the plan's own: Targets, Omitted, Only, and Also. What each environment builds, in what order, and why not the rest, is that environment's plan, in Builds.

func (Plan) BuildCount added in v0.4.0

func (p Plan) BuildCount() int

BuildCount is how many builds the plan makes: each target once in each environment that builds it.

func (Plan) CheckBuilds added in v0.9.0

func (p Plan) CheckBuilds(environment Environment) CheckBuilds

CheckBuilds are the builds the plan makes available in environment.

func (Plan) DependsOnIn

func (p Plan) DependsOnIn(environment Environment, id TargetID) []TargetID

DependsOnIn is what a target needs built first in one environment.

func (Plan) Excludes

func (p Plan) Excludes(target PlanTarget, environment Environment) bool

Excludes reports whether the plan leaves a target out in an environment, where it is not built and not required to pass.

func (Plan) ExclusionIn

func (p Plan) ExclusionIn(environment Environment, id TargetID) (Exclusion, bool)

ExclusionIn is why an environment doesn't build a target, when it doesn't: by the target's identity, so a port's variant build is its own.

func (Plan) GitIn

func (p Plan) GitIn(environment Environment, id TargetID) (GitSource, bool)

GitIn is the source a target's build in an environment is expected to fetch, where it is fetched with Git there.

func (Plan) GroupedExclusions added in v0.4.0

func (p Plan) GroupedExclusions() []GroupedExclusion

GroupedExclusions are the plan's exclusions grouped by reason and the environments that say it, across ports, in the order they're first said: terraform's 19 subports minmax leaves out of the same four releases are one, where a line a port said 25 (field testing's terraform replay, 2026-10-22). One every environment says has them all (Everywhere).

func (Plan) In

func (p Plan) In(environment Environment) (EnvironmentPlan, bool)

In is an environment's plan.

func (Plan) NeedsXcodeIn

func (p Plan) NeedsXcodeIn(environment Environment, id TargetID) bool

NeedsXcodeIn reports whether a target needs Xcode in an environment.

func (Plan) Runnable

func (p Plan) Runnable() bool

Runnable reports whether the plan may be checked: nothing is unresolved and there is something to build somewhere.

func (Plan) SameOrder added in v0.4.0

func (p Plan) SameOrder() bool

SameOrder reports whether every environment builds its targets in the plan's own order, so one order says them all.

func (Plan) TagIn added in v0.9.0

func (p Plan) TagIn(environment Environment, id TargetID) *GitSource

TagIn is the GitHub tag a target's archive is fetched by in an environment, as the plan resolved it; nil where it isn't fetched that way, or the plan is from before plans kept tags.

func (Plan) Target

func (p Plan) Target(id TargetID) (PlanTarget, bool)

Target finds a plan target by ID.

func (Plan) UnmetIn

func (p Plan) UnmetIn(environment Environment, id TargetID) (Unmet, bool)

UnmetIn is why an environment can't build a target, when it can't.

func (Plan) Untested added in v0.4.0

func (p Plan) Untested() (tested, untested []string)

Untested are the plan's targets that declare no tests in some environment, and Tested those that do somewhere, each named once: what a plan requiring tests asks nothing of, and what it does.

func (Plan) Validate

func (p Plan) Validate() error

Validate checks the plan's structure: unique targets, kinds that fit roles, one plan for each environment, and in each, an order that builds only the plan's targets, each after what it needs there.

type PlanID

type PlanID string

PlanID identifies a frozen verification plan.

type PlanTarget

type PlanTarget struct {
	ID     TargetID
	Target Target
	// Directory is the port directory relative to the tree root.
	Directory string
	Kind      TargetKind
	Role      TargetRole
	// Added is a port whose Portfile the branch adds: lint checks it with
	// --nitpick, and its warnings hold submit (the docs dig's I13).
	Added bool `json:",omitempty"`
	// MovedFrom is the base's directory of a port the branch moves to
	// Directory, which it isn't adding (macports.Scope.Placed).
	MovedFrom string `json:",omitempty"`
}

PlanTarget is one target of a plan, as the branch sees it: which port, where, and why the plan has it. What it needs in an environment, and whether it is built there, is that environment's (EnvironmentPlan).

func (PlanTarget) Names added in v0.9.0

func (t PlanTarget) Names(port string) bool

Names reports whether a person's port names the target: its ID, its port's name, or its subport's, as logs and shell take a port.

type Platform

type Platform struct {
	OS           string
	Version      string
	Architecture string
}

Platform identifies the operating system, release, and CPU architecture requested for evaluation or verification.

type Provenance added in v0.9.0

type Provenance string

Provenance is how dockhand came to know a pull request: GitHub's answer to its own create, or a read that found it. Empty on a record from before the publication, which keeps the rights it has.

const (
	Opened Provenance = "opened"
	Found  Provenance = "found"
)

type Publication added in v0.9.0

type Publication struct {
	// ID is random; every write of the publication checks it is still the
	// branch's.
	ID string
	// Commit is the commit being published; every step is for it.
	Commit ObjectID
	At     time.Time
	// By is the GitHub login it was recorded under: who, never a
	// permission. Served is serve's recording it.
	By     string
	Served bool `json:",omitempty"`
	// Head is owner/repo:branch it pushes to, Base owner/repo:branch the
	// pull request is asked of, and Number the pull request it updates, 0
	// where it sets out to open one.
	Head, Base string
	Number     int `json:",omitempty"`
	// Earlier is the newest pull request the plan found for Head and Base
	// that wasn't open, 0 where none: only one numbered above it settles
	// open.
	Earlier int `json:",omitempty"`
	// Expected is the head branch as the plan saw it, empty where it
	// didn't exist.
	Expected ObjectID `json:",omitempty"`
	// Title and Body are what it set out to write, and Written dockhand's
	// parts of Body; all three empty where it writes none.
	Title   string `json:",omitempty"`
	Body    string `json:",omitempty"`
	Written string `json:",omitempty"`
	// Asked is what the person asked of the submission, and Review the
	// reviewers to ask again, where the push calls for it.
	Asked  Asked      `json:",omitzero"`
	Review *ReviewAsk `json:",omitempty"`
	// RequestID is the ID of the branch's change request this publication
	// took, a stage's submission planned and judged under it; empty for a
	// person's own submit, which takes none. Its finishing ends the
	// request only where the request's ID is still this one (#195).
	RequestID string `json:",omitempty"`
	// Drafted is GitHub's answer to returning the pull request to draft,
	// kept for settling to fold where the branch had no record of the
	// pull request to take it.
	Drafted bool `json:",omitempty"`
	// Owes are the steps still owed, in order.
	Owes []PublicationStep
}

Publication is a submission of one commit that dockhand has begun and has not yet seen finished (docs/designs/publication-record.md at 0e0ad767, #191). It is recorded before the first remote effect, names its whole destination, and owes its steps in order until a read shows each done. A branch has one at a time, beside its PullRequest, which is what dockhand knows GitHub has from it.

func (Publication) Same added in v0.9.0

func (p Publication) Same(q Publication) bool

Same reports whether two publications are the same record: every field, the reviewers' marks among them, with times compared as instants and an empty list the same as none, as a record read back from the store has them. A write's witness reads it, so a mark that didn't commit is never taken for one that did (#191).

type PublicationStep added in v0.9.0

type PublicationStep string

PublicationStep is one of a publication's steps.

const (
	StepDraft     PublicationStep = "draft"
	StepPush      PublicationStep = "push"
	StepOpen      PublicationStep = "open"
	StepEdit      PublicationStep = "edit"
	StepReady     PublicationStep = "ready"
	StepRerequest PublicationStep = "rerequest"
)

func (PublicationStep) Words added in v0.9.0

func (s PublicationStep) Words() string

Words are a step still owed as a person reads it: never the step's internal name alone.

type PublishAsk added in v0.9.0

type PublishAsk struct {
	Draft            Flag[bool]     `json:",omitzero"`
	Type             Flag[[]string] `json:",omitzero"`
	SkipNotification Flag[bool]     `json:",omitzero"`
	NoCheck          Flag[bool]     `json:",omitzero"`
	TestedBinaries   Flag[bool]     `json:",omitzero"`
	TestedVariants   Flag[bool]     `json:",omitzero"`
}

PublishAsk is the submission's flags, and the tested statements as asked, which are bound to their files where they are bound today and taken out of the request then.

type PullRequest

type PullRequest struct {
	// Repository is the base repository, such as macports/macports-ports.
	Repository string
	Number     int
	// Head is the head repository and branch, such as ada/macports-ports:dockhand/jq-4k2p.
	Head string
	// Pushed is the commit dockhand last pushed to the head branch. A push
	// that finds anything else there stops, since someone else pushed.
	Pushed ObjectID
	// PushedAt is when dockhand recorded its last push to this pull request;
	// zero for a push recorded before the time was kept (#248).
	PushedAt time.Time `json:",omitzero"`
	// Body is the description dockhand last wrote, so a person's edits to
	// it are recognized and kept.
	Body  string
	Draft bool
	// Adopted is someone else's pull request, adopted with adopt --pr: its
	// Portfile isn't the person's, so nothing evaluates it for a change
	// record until the trust rule is in code.
	Adopted bool
	// Author is the login of the pull request's author, for an adopted
	// one, whose Portfiles the trust rule names as theirs (Then's item
	// 12); empty for one adopted before it was kept.
	Author string `json:",omitempty"`
	// AuthorHead is the author's commit an adopted branch was adopted at
	// or last moved to, which the person's answer to evaluating its
	// Portfiles is for (EvaluationConsent); Pushed becomes the person's
	// own push once they submit to it. Empty for the person's own.
	AuthorHead ObjectID `json:",omitempty"`
	// Observed is what the forge last reported about it; nil until then.
	Observed *PullRequestObservation `json:",omitempty"`
	// Provenance is how dockhand knows it: opened, where GitHub answered
	// dockhand's own create with it; found, where a read found it; empty
	// on a record from before the publication record, read as before.
	Provenance Provenance `json:",omitempty"`
	// Rerequested is the last reviewer request dockhand set out to make,
	// as a receipt: the head it was for, and each login with what became
	// of it. It outlives the publication, and the next one replaces it.
	Rerequested *ReviewReceipt `json:",omitempty"`
}

PullRequest is the one pull request a branch became.

func (PullRequest) HeadParts

func (p PullRequest) HeadParts() (repository, branch string)

HeadParts are the pull request's head repository and branch, as Head joins them; empty where Head names none.

type PullRequestChecks added in v0.4.0

type PullRequestChecks string

PullRequestChecks is how a pull request's checks stand at its head, as last observed: failing where any failed, pending where any hasn't finished, passing where all passed, and none where it has none.

const (
	ChecksNone    PullRequestChecks = "none"
	ChecksPending PullRequestChecks = "pending"
	ChecksPassing PullRequestChecks = "passing"
	ChecksFailing PullRequestChecks = "failing"
)

type PullRequestObservation

type PullRequestObservation struct {
	State  PullRequestState
	Draft  bool `json:",omitempty"`
	Review PullRequestReview
	// ChangesRequestedBy are the reviewers whose latest review asks for
	// changes.
	ChangesRequestedBy []string `json:",omitempty"`
	// ReviewedAt is when the review that sets Review was made; zero where
	// none does, or for an observation from before it was kept.
	ReviewedAt time.Time `json:",omitzero"`
	// CommentedBy and CommentedAt identify the waiting reviewer's comment (#248).
	CommentedBy string    `json:",omitempty"`
	CommentedAt time.Time `json:",omitzero"`
	// CommentsRead is transient: a preserved answer was not read again (#248).
	CommentsRead bool `json:"-"`
	// Failing names the checks that concluded unsuccessfully.
	Checks  PullRequestChecks
	Failing []string `json:",omitempty"`
	// Head is the commit the pull request was at.
	Head ObjectID
	At   time.Time
	// Conflicts is a pull request GitHub says doesn't merge cleanly into
	// master, which a rebase onto master settles; false where it merges
	// or GitHub hasn't computed it yet (the docs dig's I2).
	Conflicts bool `json:",omitempty"`
	// Opened is when the pull request was opened, Author who opened it,
	// Mentioned the logins its description mentions, and ApprovedBy the
	// reviewers whose latest review approves it: what its merge's fitness
	// is read from (macports.MergeFitness). Zero or empty for an
	// observation from before they were kept, or of one not open.
	Opened     time.Time `json:",omitzero"`
	Author     string    `json:",omitempty"`
	Mentioned  []string  `json:",omitempty"`
	ApprovedBy []string  `json:",omitempty"`
}

PullRequestObservation is a pull request as the forge last reported it.

type PullRequestReview added in v0.4.0

type PullRequestReview string

PullRequestReview is what a pull request's reviews ask, as last observed: the latest review of each reviewer, changes requested by any of them deciding it.

const (
	ReviewNone             PullRequestReview = "none"
	ReviewApproved         PullRequestReview = "approved"
	ReviewChangesRequested PullRequestReview = "changes-requested"
)

type PullRequestState added in v0.4.0

type PullRequestState string

PullRequestState is a pull request's state as last observed.

const (
	PullRequestOpen   PullRequestState = "open"
	PullRequestClosed PullRequestState = "closed"
	PullRequestMerged PullRequestState = "merged"
)

type Release

type Release struct {
	// Archive selects a Portfile version whose source is established by
	// evaluated download locations and prepared checksums, without a forge
	// tag.
	Archive bool            `json:",omitempty"`
	Listing *ReleaseListing `json:",omitempty"`
	ReleaseSelection
	Version string
	// SourceVersion is the version as the source spells it when the
	// Portfile derives its own from that spelling, such as a perl5 module
	// version that MacPorts normalizes into the port version; empty when
	// the two agree. It is what the version input is edited to; Version
	// is always the evaluated result.
	SourceVersion string `json:",omitempty"`
	// Pinned is a release that moves a commit pin, as wezterm's
	// github.setup names a commit: its Tag and Commit are the commit, which
	// is its SourceVersion too, and its Version the port's own literal.
	Pinned     bool `json:",omitempty"`
	Forge      string
	Instance   string
	Repository string
	Tag        string
	Commit     string
	// Page is the forge's page of the release, where its listing gave one,
	// and FromTag the tag of the version it updates from, where the
	// listing names it: what an update's commit body links (CommitBody).
	Page    string `json:",omitempty"`
	FromTag string `json:",omitempty"`
	// CapturedFrom is the prerelease's name a livecheck read the version
	// from, where it read it from the start of one, ap-utils's 1.4.2 from
	// 1.4.2pre1, which only a port on a prerelease takes: a distfile not
	// found for it says so. Empty for any other release.
	CapturedFrom string `json:",omitempty"`
}

Release identifies the upstream source selected for a version bump: the frozen fact of forge, repository, tag, and commit, or an archive listing, together with the selection that produced it.

func (Release) CapturedWords added in v0.8.0

func (r Release) CapturedWords() string

CapturedWords say where a version read from the start of a prerelease's name came from, for a distfile not found for it: "1.4.2 was read from 1.4.2pre1, a prerelease's name, by the port's livecheck"; empty for any other release.

func (Release) CommitBody added in v0.7.0

func (r Release) CommitBody() string

CommitBody is what an update's commit says of its release beyond its subject, at best effort: the version it updates from, and a link to the release's page, else to the compare page between the two tags where both are known; empty where none of it is (the docs dig's I11). A reviewer looked each up by hand.

func (Release) Names

func (r Release) Names(source GitSource) bool

Names reports whether a Git fetch of a source fetches this release: its git.branch is the release's tag, or its commit where the Portfile pins one, and its git.url is the release's repository on its forge, as a forge PortGroup writes it, the repository's address with ".git" after it, whose case the forge doesn't read. An archive's release, or one found without a repository, names no Git source.

func (Release) SourceSpelling

func (r Release) SourceSpelling() string

SourceSpelling is the version the source names: SourceVersion when the Portfile derives its version from it, otherwise Version itself.

type ReleaseAsset added in v0.9.0

type ReleaseAsset struct {
	Name      string
	URL       string
	Size      int64
	SizeKnown bool
}

ReleaseAsset is a file uploaded to a forge release, as the forge describes it: its name, where the forge serves it, and its size in bytes, SizeKnown false where the forge gave none, so an unknown size is told from an empty file.

type ReleaseListing

type ReleaseListing struct {
	URL          string
	ETag         string `json:",omitempty"`
	LastModified string `json:",omitempty"`
	SHA256       string
}

ReleaseListing retains compact discovery evidence; source archives are bound separately by their evaluated locations and prepared checksums.

type ReleaseSelection

type ReleaseSelection struct {
	Requested      string
	CurrentVersion string `json:",omitempty"`
	NoUpdate       bool   `json:",omitempty"`
	Stability      string `json:",omitempty"`
	LeavesStable   bool   `json:",omitempty"`
	// Lowers marks a version MacPorts' vercmp orders below the current
	// one, which `port upgrade` takes only where the epoch rises
	// (macports::_plan_upgrade), so the update raises it.
	Lowers bool `json:",omitempty"`
}

ReleaseSelection records how a release was chosen, as distinct from what it is. Requested is the spelling a person typed, empty for automatic selection; CurrentVersion is what the selection was compared against, and NoUpdate says the port is already current. Stability classifies the selected version and LeavesStable marks a move from a stable current version to a prerelease; an explicit version is honored either way, and these only inform reporting. Embedded in Release, so its shape is flat.

type RepositoryID

type RepositoryID string

RepositoryID identifies a registered ports repository: one clone, with its linked worktrees.

type RequestTarget added in v0.9.0

type RequestTarget struct {
	Port string
	// Action is update, or stub for an obsolete stub that follows.
	Action string
	// Named is the version the person named; empty for the newest.
	Named string `json:",omitempty"`
	// Release is the release selected for it, kept from when it is
	// selected, so the same command again prepares it and not a newer.
	Release *Release `json:",omitempty"`
	// Current is the version it was found at, where nothing newer was
	// selected; that concludes the version alone.
	Current string `json:",omitempty"`
	// Outcomes are each action asked of the port, once it is concluded.
	Outcomes []ActionOutcome `json:",omitempty"`
}

RequestTarget is one port of a branch's work.

func (RequestTarget) Finished added in v0.9.0

func (t RequestTarget) Finished(edits []Edit) bool

Finished reports whether a target's version is concluded: by its outcome, by the version it was found current at, or by a written edit of its port at the release kept for it. An edit at another release, an earlier ask's, leaves it unfinished (Codex's read of #194's 2c, P2-2).

func (RequestTarget) Outcome added in v0.9.0

func (t RequestTarget) Outcome(action string) (ActionOutcome, bool)

Outcome is the outcome recorded for action, where one is.

func (*RequestTarget) Unconclude added in v0.9.0

func (t *RequestTarget) Unconclude(action string)

Unconclude makes an action owed again: its outcome goes, and for the version the version found current goes too, since Current concludes it as an outcome does (Finished). The one rule for an outcome whose ask or judgment changed (#194's H5, #195).

type Requirement

type Requirement string

Requirement is something a target needs of the environment it builds in, beyond what every environment has.

const RequiresXcode Requirement = "Xcode"

RequiresXcode is Xcode, not only the Command Line Tools.

func RequiresXcodeVersion

func RequiresXcodeVersion(version string) Requirement

RequiresXcodeVersion is an Xcode of a version or later, as a port's minimum_xcodeversions asks of the macOS it builds on: Xcode 26.0.

func (Requirement) XcodeVersion

func (r Requirement) XcodeVersion() string

XcodeVersion is the version an Xcode requirement names; empty for RequiresXcode, or another requirement.

type ResourceChange added in v0.8.0

type ResourceChange struct {
	File     string
	From, To ObjectID
	Ports    []string `json:",omitempty"`
}

ResourceChange is one PortGroup file of _resources whose contents differ between a change record's two sides: its file in the tree, its blob on each, and the ports that load it whose evaluation moved.

func (ResourceChange) Line added in v0.8.0

func (c ResourceChange) Line() string

Line is the change as one line, the file and the ports it moved: "_resources/port1.0/group/golang-1.0.tcl changed, moving csvtk".

type ResourcesRead added in v0.8.0

type ResourcesRead struct {
	// Shared are the entries of _resources beside the PortGroups, each a
	// tree or a file: the compiler lists, the fetch and livecheck
	// definitions, the SDK lists, the variant descriptions, which MacPorts
	// itself reads for any port. An entry added or gone since is a change.
	Shared map[string]ObjectID
	// PortGroups are the PortGroup files the build loaded, as the guest
	// that built it recorded them, not as the host's evaluation did, each
	// by its blob; empty where it loaded none.
	PortGroups map[string]ObjectID
}

ResourcesRead is what of _resources a build read: what every port's build may read there, and the PortGroups it loaded, each by its object in the revision it read, by its path in the ports tree.

type Review

type Review struct {
	// Repository is the pull request's base repository, such as
	// macports/macports-ports.
	Repository string
	Number     int
	Head       ObjectID
	Findings   []ReviewFinding
	// Posted is how it was posted: "comment", "request-changes", or ""
	// when it was not.
	Posted string
	At     time.Time
}

Review is one review dockhand made of a pull request: what it found at which head, and whether it was posted (Design v3 §6.11). The next review of the same pull request reads it to say which findings are resolved.

func (Review) Validate

func (r Review) Validate() error

Validate checks the rules every stored review keeps.

type ReviewAnswer added in v0.9.0

type ReviewAnswer string

ReviewAnswer is the person's answer about the reviewers: yes, no, or not asked yet.

const (
	ReviewYes      ReviewAnswer = "yes"
	ReviewNo       ReviewAnswer = "no"
	ReviewNotAsked ReviewAnswer = ""
)

type ReviewAsk added in v0.9.0

type ReviewAsk struct {
	Answer    ReviewAnswer
	Reviewers []Reviewer
}

ReviewAsk is "ask them to review again?", its answer, and what became of each request.

type ReviewFinding

type ReviewFinding struct {
	Code     string `json:"code"`
	Severity string `json:"severity"`
	Where    string `json:"where,omitempty"`
	Message  string `json:"message"`
}

ReviewFinding is one finding of a review, as it was reported.

type ReviewReceipt added in v0.9.0

type ReviewReceipt struct {
	Head      ObjectID
	Reviewers []Reviewer `json:",omitempty"`
	Unasked   bool       `json:",omitempty"`
}

ReviewReceipt is a reviewer request's outcome, kept after its publication ends: the head it was for, and each login's mark. Unasked says the reviewers may not have been asked at all, as an upgrade finds an old submission's left-over.

type Reviewer added in v0.9.0

type Reviewer struct {
	Login string
	// Reviewed is GitHub's time of this login's own latest review when
	// the question was put: a newer review makes the answer another
	// review's.
	Reviewed time.Time
	Sent     Sent
	// Why are GitHub's words, where it refused.
	Why string `json:",omitempty"`
	// Lapsed is a request GitHub acknowledged that it no longer shows
	// pending, at the last reading: they were asked, and it was answered
	// or withdrawn since.
	Lapsed bool `json:",omitempty"`
}

Reviewer is one login to ask, and how far asking got.

type Revision

type Revision struct {
	ID     RevisionID
	Branch BranchID
	Kind   RevisionKind
	// Snapshot numbers a branch's snapshots from 1; zero for a commit.
	Snapshot int
	Source   Source
	// Head is the commit checked out when a snapshot was captured. It is
	// provenance, not a claim that the commit contains the captured edits.
	Head      ObjectID
	CreatedAt time.Time
}

Revision is an immutable candidate: a source tree and its base. The changed scope derives from it, never from the branch's commits.

func (Revision) SameTree

func (r Revision) SameTree(other Revision) bool

SameTree reports whether two revisions hold identical files, which is what lets a result for a snapshot apply to the commit tidy makes of it.

func (Revision) Validate

func (r Revision) Validate() error

Validate checks the rules every stored revision keeps.

type RevisionID

type RevisionID string

RevisionID identifies one immutable candidate source of a branch.

type RevisionKind

type RevisionKind string

RevisionKind says whether a revision is committed source or captured working files.

const (
	// RevisionCommit is a commit on the branch.
	RevisionCommit RevisionKind = "commit"
	// RevisionSnapshot is the working files captured by a check, which has a
	// tree but no commit (Design v3 §7).
	RevisionSnapshot RevisionKind = "snapshot"
)

type Run

type Run struct {
	ID       RunID
	Branch   BranchID
	Revision RevisionID
	Plan     PlanID
	// Number counts runs within a repository; people type check-<Number>.
	Number    int
	Origin    Origin
	State     RunState
	Detail    string
	CreatedAt time.Time
	// StartedAt is when the run took its slot, the lease its driver holds,
	// which it waited for from CreatedAt; nil for one queued still, and for
	// runs recorded before admission kept it (schema 53).
	StartedAt *time.Time
	// FinishedAt is set when the run reaches a terminal state.
	FinishedAt *time.Time
	// CancelRequested is when someone asked for the run to stop; whoever
	// holds the run applies it.
	CancelRequested *time.Time
	// StopAsked is when its providers were last asked to stop its work,
	// for a cancel that isn't finished, which serve's loop and a worker,
	// any process, ask again no sooner than a provider polls; kept apart
	// from the run's updates (store.Tx.SetStopAsked).
	StopAsked *time.Time
	// BaselineOf is the run whose failed ports a baseline run builds at the
	// branch's base; empty for the branch's own checks. A baseline is
	// evidence about that run, never the branch's check.
	BaselineOf RunID
	// Entered are the shells opened in the run's guests while it ran
	// (dockhand shell check-N): a result on that release recorded after
	// one opened isn't evidence, since the shell could have touched it.
	Entered []Entry `json:",omitempty"`
}

Run is one accepted check request, immutable in what it asks: editing the branch afterwards never changes what the run means.

func (Run) BranchCheck added in v0.5.0

func (r Run) BranchCheck() bool

BranchCheck reports whether r, queued or running, is the branch's one check (decision 29): a baseline looks beside the check it explains, and a run asked to stop is on its way out, so neither is. The queue, the check a new one would replace, and the branch's standing all read it.

func (Run) Name

func (r Run) Name() string

Name is how people refer to a run.

func (Run) Validate

func (r Run) Validate() error

Validate checks the rules every stored run keeps.

func (Run) Waited added in v0.8.0

func (r Run) Waited() (time.Duration, bool)

Waited is how long the run waited for its slot, from being queued to taking it; false where no start is recorded.

type RunID

type RunID string

RunID identifies one accepted check request.

type RunState

type RunState string

RunState is where a run is.

const (
	RunQueued  RunState = "queued"
	RunRunning RunState = "running"
	RunPassed  RunState = "passed"
	RunFailed  RunState = "failed"
	// RunAttention is a run that stopped for a person: infrastructure that
	// failed past its retries, or a target that broke the guest twice.
	RunAttention RunState = "attention"
	RunCanceled  RunState = "canceled"
)

func (RunState) CanBecome

func (s RunState) CanBecome(next RunState) bool

CanBecome reports whether a run in state s may move to next.

func (RunState) Finished added in v0.5.0

func (s RunState) Finished() bool

Finished reports a run that ended with its results (Finished).

func (RunState) Terminal

func (s RunState) Terminal() bool

Terminal reports whether nothing further happens to a run in this state.

type Sent added in v0.9.0

type Sent string

Sent is how far a request that can't be read back got: a mark recorded before the call, cleared only by GitHub's own answer.

const (
	NotSent      Sent = ""
	MaySent      Sent = "may-have-been-sent"
	SentRequest  Sent = "sent"
	RefusedToAsk Sent = "refused"
	// ReviewedAgain is a login that reviewed since the question was put:
	// the answer was for an older review, so it isn't asked.
	ReviewedAgain Sent = "reviewed-since"
)

type ServeOpening added in v0.9.0

type ServeOpening struct {
	// ID is the row's, 0 before it is recorded.
	ID         int64
	Base, Head string
	// After is the newest pull request known for Head and Base when the
	// row was written, 0 where none: only one numbered above it is the
	// row's.
	After int
	// Holding is a place held for a publication that still owes open.
	Holding bool
	// Tried is when a create was first marked, written before it is sent;
	// Unanswered a create of it that got no answer.
	Tried      time.Time
	Unanswered bool
	// Number and Opened are the pull request found for it, and GitHub's
	// time for its creation.
	Number int
	Opened time.Time
	// Gone is when its head was first seen gone from the fork.
	Gone time.Time
}

ServeOpening is one row of serve's count: a pull request serve opened, may have opened, or holds a place to open (docs/designs/ publication-record.md at 0e0ad767, "serve's count"). It isn't deleted with a branch, which is what let #155's opening leave the count.

func (ServeOpening) Counts added in v0.9.0

func (o ServeOpening) Counts(day time.Time) bool

Counts reports whether a row counts against the day that starts at day: a place held counts every day while its publication owes open; a create that may have landed counts every day, since no length of time settles it; an opening counts on the day GitHub says it was created. The day ends at the next local midnight, which on a day the clocks change is 23 or 25 hours on, not 24.

func (ServeOpening) FoundFor added in v0.9.0

func (o ServeOpening) FoundFor(number int, created time.Time) (ServeOpening, bool)

FoundFor charges a pull request found for a row that was tried: one numbered above After, with GitHub's creation time, is its opening; one at or below it was there before the create and says nothing of it, nor does one with no creation time (case AN).

func (ServeOpening) GoneLook added in v0.9.0

func (o ServeOpening) GoneLook(present bool, now time.Time) (ServeOpening, bool)

GoneLook is a look at the row's head on the fork: present, the mark is cleared; gone at a first look, when is written down; gone again at a look at least ten minutes after, with no pull request found above After, the row is released. That is an escape the person chose, not a proof (the design's choice 8, case AR).

func (ServeOpening) Refused added in v0.9.0

func (o ServeOpening) Refused() bool

Refused reports whether GitHub refusing a create releases the row: only where it was the only create the row ever sent, so nothing of it is left unanswered (case AK).

func (ServeOpening) Since added in v0.9.0

func (o ServeOpening) Since() time.Time

Since is when a row took its place: its create, else its opening.

type Session

type Session struct {
	ID         SessionID
	Repository RepositoryID
	Kind       SessionKind
	PID        int
	// ProcessStart is the operating system's record of when the process
	// started, in its own opaque form, so a reused PID cannot pass for it.
	ProcessStart string
	// Version is the dockhand build, so a newer database or an older peer
	// can be named.
	Version     string
	StartedAt   time.Time
	HeartbeatAt time.Time
	// EndedAt is set when the process ended cleanly.
	EndedAt *time.Time
	// Schema is the newest database schema the process's build writes,
	// which the store records; 0 for a session an earlier build recorded.
	Schema int
}

Session is one dockhand process that runs or watches work. Its death is known directly: every process is on one Mac, so a PID that is gone, or that now names a process started at another time, is a dead session.

func (Session) Validate

func (s Session) Validate() error

Validate checks the rules every stored session keeps.

type SessionID

type SessionID string

SessionID identifies one dockhand process's session with the database.

type SessionKind

type SessionKind string

SessionKind is the part a process plays in coordination (Design v3 §11).

const (
	// SessionServe drives the queue, as leader or standby.
	SessionServe SessionKind = "serve"
	// SessionForeground runs its own request because no serve leads.
	SessionForeground SessionKind = "foreground"
	// SessionObserver only reads: status, watch, a followed check.
	SessionObserver SessionKind = "observer"
)

type Source

type Source struct {
	// Commit identifies the source commit, when the snapshot has one.
	Commit ObjectID
	// Tree identifies the immutable root tree, including shared PortGroups.
	Tree ObjectID
	// Base identifies the upstream base commit, when known.
	Base ObjectID
}

Source identifies the complete ports-tree snapshot used by an operation.

type SourceAsk added in v0.9.0

type SourceAsk struct {
	Source           Flag[string] `json:",omitzero"`
	KeepHTTP         Flag[bool]   `json:",omitzero"`
	KeepOldChecksums Flag[bool]   `json:",omitzero"`
	KeepModeline     Flag[bool]   `json:",omitzero"`
	FollowMoves      Flag[bool]   `json:",omitzero"`
}

SourceAsk is how the edit is shaped.

type SourceMove added in v0.8.0

type SourceMove struct {
	From       string   `json:"from"`
	To         string   `json:"to"`
	Release    string   `json:"release,omitempty"`
	Asset      string   `json:"asset,omitempty"`
	Submodules []string `json:"submodules,omitempty"`
	Lines      []string `json:"lines,omitempty"`
}

SourceMove is an update's move of a GitHub port's source: from tarball, archive, or git, its clone, to releases or archive; the release asset taken, with the Git submodules it carries; and the lines the edit wrote for it.

func (SourceMove) Words added in v0.8.0

func (m SourceMove) Words() string

Words say the move for the commit's body and the pull request, which say it in place of a Portfile comment (the roadmap's D3): "Fetches release 2.5.0's mindforger_2.5.0_tarball.tgz, which carries the repository's Git submodules (deps/cmark-gfm), instead of a Git checkout."

type SourceStanding added in v0.9.0

type SourceStanding int

SourceStanding is what one reading of a source says of another (#192): the one judgment joining, coverage, evidence, reuse, a run's verdict and submit read, each with its own policy for what it isn't told.

const (
	// SourceUnknown is one repository and ref, one side naming a commit and
	// the other none, or a whole commit against an abbreviation.
	SourceUnknown SourceStanding = iota
	// SourceUnresolved is one repository and ref, neither side naming a
	// commit.
	SourceUnresolved
	// SourceSame is one repository and ref and one commit, or neither side
	// fetching this way.
	SourceSame
	// SourceMoved is one repository and ref and two commits.
	SourceMoved
	// SourceOther is another repository or ref, or only one side fetching
	// this way. An older release's tag and a newer one's are other, never
	// moved.
	SourceOther
)

func SourceAgainst added in v0.9.0

func SourceAgainst(have, want *GitSource) SourceStanding

SourceAgainst judges two plans' resolutions of a target's source; nil is a target a plan doesn't fetch this way. Two abbreviations under one ref are that ref, so the same; a whole commit and an abbreviation say nothing of each other, even where one begins with the other.

type Step

type Step string

Step is one of the steps a target's build takes, each writing to its log in turn: those that are phases are named for them, and the others prepare for its build.

const (
	// StepDeactivate deactivates the ports an earlier target left active,
	// so that only this one's dependencies are.
	StepDeactivate Step = "deactivate"
	// StepClean removes an earlier build's work.
	StepClean Step = "clean"
	StepLint  Step = Step(PhaseLint)
	// StepDependencies installs the target's dependencies, which can be
	// most of its log.
	StepDependencies Step = Step(PhaseDependencies)
	StepFetch        Step = Step(PhaseFetch)
	StepChecksum     Step = Step(PhaseChecksum)
	StepInstall      Step = Step(PhaseInstall)
	StepTest         Step = Step(PhaseTest)
)

func (Step) Valid

func (s Step) Valid() bool

Valid reports one of the steps a build takes.

type SubportChange

type SubportChange struct {
	Port string
	Kind SubportChangeKind
	// Fields are the evaluated fields that moved, normalized for where
	// each side was evaluated.
	Fields []FieldChange `json:",omitempty"`
	// Unstable are fields that moved where they're known to move without
	// an edit; they don't make the subport changed, and are said so as
	// not to be dropped silently.
	Unstable []FieldChange `json:",omitempty"`
	// Maintainers is its maintainers option as evaluated, a Tcl list, at
	// the base, or the revision for a subport added; empty for a record
	// made before it was kept.
	Maintainers string `json:",omitempty"`
}

SubportChange is one subport's part of a change record.

type SubportChangeKind

type SubportChangeKind string

SubportChangeKind is how a subport stands against the base.

const (
	SubportAdded     SubportChangeKind = "added"
	SubportRemoved   SubportChangeKind = "removed"
	SubportChanged   SubportChangeKind = "changed"
	SubportUnchanged SubportChangeKind = "unchanged"
)

type Target

type Target struct {
	Name string
	// Portfile is the Portfile path relative to the source tree root.
	Portfile string
	// Subport selects a subport defined by the Portfile when nonempty.
	Subport string
	// Variants records explicit choices: true enables a variant and false
	// disables it. An absent key leaves that variant unspecified.
	Variants map[string]bool
}

Target selects a port, optional subport, and variant choices within a Source.

func (Target) ID

func (t Target) ID() TargetID

ID is a target's identity in a plan: its port's name, and its variant choices after it where it has any, "s2n-tls +tests", since a check may build one port with several.

func (Target) VariantSpec

func (t Target) VariantSpec() string

VariantSpec is a target's variant choices as MacPorts writes them on a command line, sorted by name: "+docs -tests"; empty for its defaults.

type TargetID

type TargetID string

TargetID identifies a target within a plan.

type TargetInputs

type TargetInputs struct {
	Environment string
	Directory   string
	Tree        ObjectID
	// Resources is _resources' tree, where the build is taken to have read
	// all of it: its provider didn't say which PortGroups it loaded, or it
	// was recorded before any provider said. Empty where ResourcesRead
	// names what it read instead.
	Resources ObjectID
	// ResourcesRead is what of _resources the build read, where its
	// provider said which PortGroups it loaded: a result then lasts until
	// one of those or a file every port reads changes, where a change to
	// any PortGroup voided it (the oracle survey's Q2). Left out when nil,
	// so a key recorded before it is the same key still, and holds as a
	// stricter one.
	ResourcesRead *ResourcesRead  `json:",omitempty"`
	Variants      map[string]bool `json:",omitempty"`
	// Active are in name order: empty for a build that read no other
	// port, and nil where its provider couldn't say, as one that reports
	// only what a Git fetch checked out can't.
	Active []ActivePort
	// Targets names the build ID of each in-check port consumed, by its
	// lower-case port name. Older inputs omit it; builds with in-check
	// dependencies gain a new key once their consumption is recorded (#236).
	Targets map[string]TargetID `json:",omitempty"`
	// Fetched is the commit a Git-fetched target's build checked out, as
	// its provider reported it (batch 20): the source it built, which its
	// Portfile's tag doesn't bind. It is empty for a port fetched
	// otherwise, and where the provider couldn't say, which the plan the
	// build was checked by tells apart (EnvironmentPlan.Git). Left out when
	// empty, so a key recorded before it is the same key still.
	Fetched ObjectID `json:",omitempty"`
	// NotReusable is why no later build can reuse this one, where what it
	// read couldn't be recorded, kept so a later check that builds it
	// again can say why, where it rebuilt for an hour in silence (the
	// architecture review's L3a). Left out when empty.
	NotReusable string `json:",omitempty"`
}

TargetInputs are what a target's build read, as far as dockhand can name them (decision 28): the environment by its identity; the target's own directory by its tree; _resources, by its tree or by what of it the build read (ResourcesRead); the variants it was asked for; the ports active as it built; and for a port fetched with Git, the commit it fetched.

func NewTargetInputs

func NewTargetInputs(environment, directory string, tree, resources ObjectID, variants map[string]bool, active []ActivePort) TargetInputs

NewTargetInputs gathers a build's inputs, the active ports in name order, so the same inputs have one form.

func (TargetInputs) Complete

func (i TargetInputs) Complete() bool

Complete reports whether every input is identified by content: the environment, the target's directory and _resources, and each active port's directory and archive, which are known. Only complete inputs can stand for another build's.

func (TargetInputs) Key

func (i TargetInputs) Key() string

Key identifies inputs by their content.

type TargetKind

type TargetKind string

TargetKind decides which publication rule applies to a target.

const (
	// Substantive is every target not proven revision-only; unknown is
	// substantive (decision 44).
	Substantive TargetKind = "substantive"
	// RevisionOnly is a target whose Portfile diff touches nothing but
	// revision declarations, with no files/ change, proven from the source.
	RevisionOnly TargetKind = "revision-only"
	// Unchanged is a target the branch does not change: an extra from --also.
	Unchanged TargetKind = "unchanged"
)

type TargetResult

type TargetResult struct {
	Execution ExecutionID
	Target    TargetID
	Outcome   Outcome
	// Phase is where a failed target stopped; empty otherwise.
	Phase Phase
	Tests TestOutcome
	// Log locates the target's log beside the database.
	Log string
	// Steps are where each step of the build begins in Log, in the order
	// they ran, as its provider recorded them; empty where it didn't, as
	// for a result recorded before providers did (the hugo exercise:
	// hugo's own phases began near line 46,400 of 47,000, after its
	// dependencies').
	Steps []LogStep
	// Detail is why the target stopped, in its provider's words, where the
	// provider says: MacPorts' last errors for a failed target, or the
	// changed dependency that blocked one.
	Detail string
	// Builders are the parts of the result, where the provider's run has
	// several builders, as MacPorts' workflow has a runner for each macOS
	// release; the result is theirs together. Empty for one builder.
	Builders []BuilderResult
	// ReusedFrom is the execution that built the target, where this result
	// is an earlier build's, reused because the build would read the same
	// (decision 28); empty for a result built here.
	ReusedFrom ExecutionID
	// Inputs is the key of what the build read (TargetInputs), for reuse
	// (decision 28); empty where the provider couldn't say.
	Inputs string
	// Archive is the digest of the archive the build made, sha256:<hex>;
	// empty where the environment kept none, or the target wasn't
	// installed.
	Archive string
	// Dependency is the dependency whose failure failed the target at its
	// dependencies phase, where its provider said which; zero otherwise.
	Dependency FailedDependency
	// Links are what the Mach-O files a passed build installed link under
	// the prefix, each with the port that provides it (part 6): an
	// observation of the build, not an input, so reuse never reads it. Nil
	// where its provider couldn't read them, empty where nothing links.
	Links []Link
	// Declared is what each port its depends_lib names installs that a
	// build could link, and how many Mach-O files it installed, which a
	// declaration nothing links is read from (protocol 2); nil where its
	// provider didn't read them, as an older result's.
	Declared *Declared
	// Installed are the files a passed build installed, as port contents
	// lists them, and Libraries its own dynamic libraries, each with its
	// install name and compatibility version: observations a check of the
	// port's next version compares with (Then's item 9). Nil where its
	// provider couldn't read them.
	Installed []string  `json:",omitempty"`
	Libraries []Library `json:",omitempty"`
	// Configure are the configure phase's summary lines in the build's
	// log, autoconf's "checking for", CMake's "-- Found" and "-- Could NOT
	// find", meson's "Dependency … found", each once, as found and not
	// where: what a check of the next version diffs (Then's item 10). Nil
	// where its provider didn't read them.
	Configure []string `json:",omitempty"`
	// Lint is what port lint warned of, each "Warning:" line without its
	// prefix, and Nitpicked says lint ran with --nitpick, as it does for a
	// port the branch adds (the docs dig's I13). Nil where its provider
	// didn't read them.
	Lint      []string `json:",omitempty"`
	Nitpicked bool     `json:",omitempty"`
	// Carried is how a reused result stands for a revision whose port
	// directories differ from what its build read only in options no
	// build reads (decision 28's inert difference); nil for every other
	// result.
	Carried    *Carried `json:",omitempty"`
	RecordedAt time.Time
}

TargetResult is the checkpoint for one target in one execution.

func (TargetResult) OwnBuild

func (r TargetResult) OwnBuild() (LogStep, bool)

OwnBuild is the step a target's own build begins with in its log, the one after its dependencies were installed: theirs come first, and can be most of the log (the hugo exercise: hugo's own phases began near line 46,400 of 47,000). None where no dependencies' step was recorded, so little but the target's own comes before, or where none followed it, as when a dependency failed to install.

func (TargetResult) ReplacedBy

func (r TargetResult) ReplacedBy(next TargetResult) bool

ReplacedBy reports whether next may replace r as the same execution's checkpoint for the target. A complete verdict is final; anything else can be followed by a verdict, and an interruption can be recorded over a target that had not run.

func (TargetResult) Validate

func (r TargetResult) Validate() error

Validate checks the rules every stored result keeps.

type TargetRole

type TargetRole string

TargetRole is why a target is in the plan.

const (
	// Changed targets derive from the diff against the base.
	Changed TargetRole = "changed"
	// Also targets are unchanged ports built against the branch on request.
	Also TargetRole = "also"
	// Prerequisite targets are changed ports that selected coverage needs:
	// with --only appB, the changed libA appB depends on. They are built,
	// never substituted by an old binary.
	Prerequisite TargetRole = "prerequisite"
)

type TestOutcome

type TestOutcome string

TestOutcome reports a target's tests apart from its verdict, since tests are advisory unless the plan requires them.

const (
	TestsPassed   TestOutcome = "passed"
	TestsFailed   TestOutcome = "failed"
	TestsTimedOut TestOutcome = "timed-out"
	// TestsNone is a port with no test suite enabled.
	TestsNone    TestOutcome = "none"
	TestsSkipped TestOutcome = "skipped"
)

func (TestOutcome) Failed

func (t TestOutcome) Failed() bool

Failed reports tests that ran and didn't pass: failed, or timed out.

func (TestOutcome) Valid

func (t TestOutcome) Valid() bool

Valid reports one of the tests' outcomes.

type TestPolicy

type TestPolicy string

TestPolicy says whether port tests run and whether they decide.

const (
	// TestsDeclared runs declared tests and reports them without deciding,
	// as MacPorts CI does.
	TestsDeclared TestPolicy = "declared"
	TestsRequired TestPolicy = "required"
	TestsSkip     TestPolicy = "skip"
)

func (TestPolicy) Judge

func (p TestPolicy) Judge(result TargetResult) TargetResult

Judge decides a target's recorded outcome from what its provider reported, under this test policy (Design v3 §7). Providers report facts, the build's outcome and the tests' outcome, and the runner judges every result by this rule as it records it, whichever provider built it: tests that failed or timed out fail a port that built only when the policy requires them, at the test phase. A port that declares no tests passes under any policy, and the tests' own outcome is always kept.

Tart's guest program applies the same rule while it builds, since it must not build a port against a dependency that failed its required tests; the verdict recorded is this one, so the two can't disagree.

func (TestPolicy) Stands

func (p TestPolicy) Stands(result TargetResult) bool

Stands reports whether an earlier passed result stands for a check under this policy, reused rather than built again (decision 28): it still passes when judged under it, as a result whose tests failed doesn't under required, and its tests ran unless this policy skips them.

func (TestPolicy) Valid

func (p TestPolicy) Valid() bool

Valid reports whether the policy is one of the three.

type TestedStatement added in v0.8.0

type TestedStatement struct {
	Trees map[string]ObjectID `json:"trees,omitempty"`
}

TestedStatement is a person's statement that they tested a branch's binaries or its variants, about the files it was made for: each port directory the branch changed, with its Git tree there, at the commit it was recorded for (#153). Kept as a branch's boolean, it ticked the template's item at every later submission, the Portfile changed since.

func (*TestedStatement) Stands added in v0.8.0

func (s *TestedStatement) Stands(trees map[string]ObjectID) bool

Stands reports whether a statement holds for the port directories a branch changes now, by their trees: every one recorded, with the same tree. Any change under one, or a port the branch starts to change, clears it; a directory the branch no longer changes doesn't, nor does anything outside the directories, a message, a squash, or a rebase that leaves them alone. A statement kept with no trees, from before #153, stands for nothing.

type Unmet

type Unmet struct {
	Target      TargetID
	Environment Environment
	Needs       Requirement
	// Has is the Xcode the environment has, where what's needed is a newer
	// one (RequiresXcodeVersion): a version, or "none" for the Command
	// Line Tools alone; empty where it isn't known, as in a plan made
	// before it was kept.
	Has string `json:",omitempty"`
	// Through is the prerequisite that needs it; empty when the target
	// needs it itself.
	Through TargetID `json:",omitempty"`
}

Unmet is a target an environment can't build, because the environment lacks what the target needs: Xcode, where there are only the Command Line Tools. The target needs it itself, or through a prerequisite: a changed port the plan builds before it, from source, never from an archive. Unlike an exclusion, which MacPorts CI makes too, the target still needs a check somewhere that has what it needs. Unlike a failure, it says nothing about the port.

type Unresolved

type Unresolved struct {
	Target Target
	Reason string
}

Unresolved is a changed target whose evaluation failed. A plan with one cannot run; the target is never dropped as ineligible.

type UpstreamChange

type UpstreamChange struct {
	Kind    string `json:"kind"`
	Path    string `json:"path"`
	Message string `json:"message"`
	Hold    bool   `json:"hold"`
	// Rule is what raised it, and Subject what it's about within its
	// path, such as a dependency's name: with the path, its identity,
	// which its message isn't. Empty in a finding recorded before they
	// were kept.
	Rule    string `json:"rule,omitempty"`
	Subject string `json:"subject,omitempty"`
	// Class says how the candidate stands against the base on it.
	Class ConcernClass `json:"class,omitempty"`
	// Source is the archive it was found in, by its identity from one
	// version to the next (macports.SourceMatch.Identity), where the port
	// fetches more than one: two archives' LICENSE changes are two
	// findings. Empty for a port of one archive.
	Source string `json:"source,omitempty"`
}

UpstreamChange is one finding of an assessment: a license file, a build file, or a declared dependency that changed; a file the comparison couldn't read (kind "unread"); or what a change asks of the port, such as a Python requirement its dependency doesn't meet. One that holds is a concern: it asks a person's look before a submission nobody reviews.

func (UpstreamChange) Concern added in v0.9.0

func (c UpstreamChange) Concern(port string) Concern

Concern is the upstream hold raised by this finding for port.

func (UpstreamChange) Key

func (c UpstreamChange) Key() string

Key identifies a finding: its rule, source, path, and subject, or where it was recorded without a rule, its kind, path, and message.

type UpstreamComparison

type UpstreamComparison struct {
	Changes []UpstreamChange `json:"changes"`
	// Problem says why the archives could not be compared.
	Problem string `json:"problem,omitempty"`
	// Coverage says what the assessment read, and what it set apart and
	// why; none in a comparison recorded before it did.
	Coverage []Coverage `json:"coverage,omitempty"`
	// ProblemKind is the Problem's kind (refusal.Kind), which says whether
	// another try may meet it, a network's failure or a forge's rate
	// limit, which collecting the assessment again tries; a refusal, as a
	// 404, or a port that doesn't evaluate, stands for its files. It's
	// where a Transient flag was (R3-6); one recorded with that flag reads
	// as the network's.
	ProblemKind string `json:"problem_kind,omitempty"`
	// Commit is the commit a Git-fetched port's source was read at, as
	// its git.branch named it when it was assessed; empty for one read
	// from archives, and for one assessed before it was kept.
	Commit string `json:"commit,omitempty"`
}

UpstreamComparison is what an update's upstream archives showed: an assessment of what upstream's change means for the port (the assessment design, C).

func (*UpstreamComparison) Concerns added in v0.4.0

func (c *UpstreamComparison) Concerns(port string) []Concern

Concerns are Holds, typed, each a concern of the port's: each change a passing build can't catch, and the problem that kept the archives from being compared.

func (*UpstreamComparison) Held

func (c *UpstreamComparison) Held() bool

Held reports whether the comparison holds the update for a person's look before a submission nobody reviews, serve's or bump's (Holds).

func (*UpstreamComparison) Holds

func (c *UpstreamComparison) Holds() []string

Holds are why the comparison holds the update: each change a passing build can't catch, and, since what couldn't be checked holds too (D4), the problem that kept the archives from being compared.

func (*UpstreamComparison) UnmarshalJSON added in v0.5.0

func (c *UpstreamComparison) UnmarshalJSON(data []byte) error

UnmarshalJSON reads a comparison as recorded, one recorded with the Transient flag that ProblemKind replaced as the network's, which another try may meet.

Jump to

Keyboard shortcuts

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