Documentation
¶
Overview ¶
Package backlog decides what becomes of a role's acts on a project's issues (docs/spec/backlog-acts.md): each is checked against the code and the forge, then done, proposed to a person, or dropped. Closing is the first act built.
Index ¶
- Constants
- Variables
- func Accepted(is forge.Issue) bool
- func Agreement(notes []forge.Note, is forge.Issue, role string) string
- func AnnounceMarker(role string) string
- func AnnouncementComment(author string, c Proposal, role string, a Announcement, days int) string
- func Ask(author, questions string, round int) string
- func AskMarker(role string, round int) string
- func Basis(body string) map[string]string
- func Before(is forge.Issue) string
- func Blockers(is forge.Issue) []int
- func BodyBlockers(body string) []int
- func BodyDigest(body string) string
- func CappedByRole(f forge.Backlog, role string, open []forge.Issue) []int
- func ChildBody(parent int, ch Child, role string) string
- func ClosedByRole(f forge.Backlog, role string, open []forge.Issue) []int
- func ClosingComment(c Proposal, role string) string
- func CodeKey(path, line string) string
- func Comment(c Proposal, role string) string
- func CompareMilestones(a, b string) int
- func CycleText(c []int) string
- func Day(s string) string
- func Days(day string, now time.Time) int
- func DraftLine(role string) string
- func EngineMarker(comment string) (string, bool)
- func ExemptLabel(is forge.Issue, s Setting) string
- func FormatRecord(r Record) string
- func FormatState(s State) string
- func ImportKey(q Quote) string
- func Imported(body string) (path string, from, to int, ok bool)
- func JudgeMaterial(repo string, is forge.Issue, a Announcement, code string) string
- func KeptComment(why string) string
- func KeptMarker(role string) string
- func Less(a, b forge.Issue) bool
- func LinesChange(repo, path string, from, to int, opened, base, head string) (was, now string, nfrom, nto int, changed bool, err error)
- func ListChildren(body string, ids []int) string
- func Locate(repo, path, text string) (from, to int, original string, ok bool)
- func LocateIn(lines []string, text string) (from, to int, original string, ok bool)
- func ModesLine(modes []KindMode) string
- func MovedPercent(settings map[string]any) int
- func Next(open []forge.Issue, report, n int) []forge.Issue
- func NextMilestone(repo string, open []string) string
- func NextReady(ordered []forge.Issue, open map[int]bool) *forge.Issue
- func NotReady(body string, accepted bool) []string
- func ObsoleteKey(q Quote) string
- func Offered(is forge.Issue, open map[int]bool) bool
- func OpenedBy(body string) string
- func Order(issues []forge.Issue) (cycles [][]int)
- func Parts(is forge.Issue) []int
- func PeopleComments(comments []string) int
- func Place(is forge.Issue) string
- func Priority(is forge.Issue) int
- func PriorityLabel(n int) string
- func PriorityLabels(is forge.Issue) []int
- func ProposalComment(author string, c Proposal, role string) string
- func ProposalMarker(role string, round int) string
- func RecordMarker(role string) string
- func RecordOpening(runDir string, index int, outcome string, issue int) error
- func RecordedOpenings(runDir string) map[int]Recorded
- func Refine(body string, c Proposal, role string) (string, []string, []string)
- func Released(repo, milestone string) bool
- func ReportTitle(role string) string
- func Revisable(is forge.Issue, st *State, r *SpecReview) []string
- func Rewritten(st *State, body string) []string
- func Round(comment, role string) bool
- func RoundsMax(settings map[string]Setting) int
- func SectionAt(body string, line int) string
- func SectionDigest(body, name string) string
- func Settings(settings map[string]any) map[string]Setting
- func SpecHold(is forge.Issue, comments []string) (rule, why string)
- func SplitInto(is forge.Issue, st *State) []int
- func SplitKey(parent int, title string) string
- func StateMarker(role string) string
- func StripDrafts(body string) string
- func SuggestFromActs(level string, done, undone int) (string, string)
- func TickMarker(key string) string
- func TitleKey(title string) string
- func VerificationItems(body string) []string
- func Waiting(is forge.Issue, open map[int]bool) []int
- func WithBlockers(body string, add []int) string
- type Acts
- type Announcement
- type Backlog
- type Board
- type Change
- type Child
- type Closing
- type Config
- type Coverage
- type Decision
- type Did
- type Done
- type Evidence
- type Exchange
- type Hand
- type ImportOpen
- type ImportShare
- type Judged
- type KindMode
- type Mapped
- type Measure
- type Obsolete
- type Opening
- type Openings
- type Part
- type Pending
- type Plan
- type Proposal
- type Quote
- type Record
- type Recorded
- type Setting
- type Skip
- type SpecReview
- type State
- type TickBy
- type Touch
- type Undo
- type Wait
Constants ¶
const ( Cautious = "cautious" Normal = "normal" Enterprising = "enterprising" )
The autonomy levels, from the least to the most the role does alone.
const ( FromLevel = "level" // the autonomy level's preset FromSetting = "setting" // the project set this kind itself FromDemoted = "demoted" // a person undid one of its acts: proposed until a tick sets it back )
Where a kind's mode comes from, as the task and the report say it.
const ( SuggestAfter = 10 SuggestTicked = 80 )
SuggestAfter is the proposals a person settled at a level before the report suggests another; SuggestTicked, the share ticked, in percent, past which a cautious role is told it could do more alone.
const ( Act = "act" Propose = "propose" Off = "off" )
Modes of an act.
const ( LabelToRefine = "workline:to-refine" LabelDraft = "workline:draft" // the role drafted its Need or Validation LabelAccepted = "workline:accepted" // a person accepted the drafts: only who may triage sets a label LabelReady = "workline:ready" )
The labels of an issue on its way to ready (docs/spec/routing.md).
const ( NextMax = 5 NextMaxLimit = 20 StuckDays = 14 StuckDaysLimit = 365 )
The defaults and bounds of `next-max` and `stuck-days`.
const ( WaitsReady = "ready" // ready, nothing started since WaitsAsked = "asked" // its reporter's answer WaitsProposed = "proposed" // a person's tick on a proposal of the report WaitsObsolete = "obsolete" // a second judge, its announcement due )
What a stuck issue waits on, in the order an issue is said for the first: an issue appears once.
const ( TouchPart = "part" // a part of the changed issue: read again TouchWaits = "waits" // waits on it: listed for a person TouchSources = "sources" // names the same code: listed for a person TouchImport = "import" // opened from the lines that changed: read again )
How an issue is touched by a change.
const ( ItemOpened = "opened" // opened by this import ItemWouldOpen = "would-open" // without --apply: would be opened ItemAlreadyOpen = "already-open" // an open issue held it before the import ItemClosed = "closed" // a closed issue holds it: not opened again ItemPastCap = "past-cap" // proposed in the report, past the cap of open; the import run again opens it ItemDone = "done" // judged done, the words that say so quoted ItemNotItem = "not-item" // not a requirement: an introduction, a history, a heading )
What became of an item of a file an import read, as its map says (docs/spec/backlog-acts.md, "Importing a file").
const ( KeyResume = "resume" KeyAct = "act/" )
KeyResume is the box that resumes a paused role; KeyAct, followed by a kind of act, the box that sets that kind back to act.
const ( Opened = "opened" // a new issue StillOpen = "open" // an open issue holds the subject: nothing written Settled = "settled" // closed as not planned or as a duplicate: a person's no, nothing written FoundAgain = "found-again" // closed otherwise, the subject found again: said once on it, not reopened Capped = "capped" // new, past the run's cap: not opened, found again at a later run )
Outcomes of an opening.
const ( SpecReviewer = "reviewer" SpecKey = "spec" )
SpecReviewer is the role whose comment on an issue holds its spec's review; SpecKey keys that comment (`sticky=reviewer/spec`).
const AgreeWord = "agreed"
AgreeWord is the reply that agrees to a text proposed to a reporter: its first line, case, spaces and a final "." or "!" aside (ADR-0021).
const (
DidDays = 35
)
The acts the record keeps: those of the last DidDays days, at most didMax, each said in at most didLine characters — the record is one comment.
const EvidenceKey = "parts"
EvidenceKey is the sticky comment's key on a parent: <!-- workline:sticky=<role>/parts -->.
const IgnoredRunsMax = 20
IgnoredRunsMax bounds `ignored-runs-max`; 0 never pauses.
const JudgeKeyPrefix = "obsolete-"
JudgeKeyPrefix names the folder of a judge's question on an announced issue, its number after it: in/judge/obsolete-12/.
const JudgeQuestion = "" /* 244-byte string literal not displayed */
JudgeQuestion is what the second judge is asked of an announced issue.
const Keeper = "product-owner"
Keeper is the role whose state comment an opened issue is given: the product owner reads it from its next run, as any other issue.
const LabelObsolete = "workline:obsolete"
LabelObsolete marks an issue announced as obsolete: taking it off keeps the issue open.
const LabelTriage = "needs-triage"
LabelTriage marks an issue a role opened on a finding of its own, until a person or the product owner takes it (ADR-0018, "Opening issues, for every role").
const Levels = 4
Levels are the priorities an issue takes: 1, the most pressing, to 4 (docs/spec/backlog-acts.md, "Ordering").
const ObsoleteDays = 7
ObsoleteDays is how long an announcement waits, in days, when the role's settings do not say.
const PriorityPrefix = "workline:priority/"
PriorityPrefix starts each priority label: workline:priority/1 to /4.
const SubIssuesHeading = "## Sub-issues"
SubIssuesHeading heads the task list of a parent's children, on a forge without sub-issues.
const SuggestUndone = 10
SuggestUndone is the share of the acts done alone, in percent, a person may undo before the sample suggests the level below.
Variables ¶
var ActKinds = []string{"sources", "close-duplicate", "close-obsolete", "milestone", "order", "refine", "ready", "ask", "split", "depend", "rename", "open"}
ActKinds are the kinds of act as the settings name them, in the order the task and the report list them.
var AutonomyLevels = []string{Cautious, Normal, Enterprising}
AutonomyLevels are the autonomy levels a project may pick.
var BlockedByMarker = forge.Marker("blocked-by")
BlockedByMarker ends the line the engine keeps in a body on a forge without the relation.
var DefaultExempt = []string{"pinned", "security"}
DefaultExempt are the labels that keep an issue from being announced obsolete, when the role's settings do not say.
var DraftMarker = forge.Marker("draft")
DraftMarker marks a section the role drafted and no person made theirs.
var ErrRecordBroken = errors.New("the record of what the role did does not read")
ErrRecordBroken is a record on the report that does not read.
var Kinds = []string{"open", "close", "keep", "sources", "milestone", "order", "refine", "ready", "unready", "ask", "split", "rename", "depend"}
Kinds are the intentions that are acts on the backlog.
var Sections = []string{"Need", "Verification", "Validation", "Scope"}
Sections are an issue's, in the order they are written.
var SpecMarker = forge.Marker("sticky=" + SpecReviewer + "/" + SpecKey)
SpecMarker marks the reviewer's comment on an issue's spec.
var Watched = []string{"Need", "Scope"}
Watched are the sections whose change touches the issues built on an issue: what it needs, and the part of the code it holds.
Functions ¶
func Accepted ¶ added in v0.7.0
Accepted says whether a person accepted an issue's drafts, by its label — read on the issue, never taken from a proposal.
func Agreement ¶ added in v0.11.0
Agreement is who agreed, in a reply, to the text last proposed to an issue's reporter (ADR-0021): after the last round, that round a proposal, the last comment of the reporter or of a person of the project — never a bot's, nor someone's the forge does not name — has AgreeWord as its first line. "" when there is none.
func AnnounceMarker ¶ added in v0.12.0
AnnounceMarker marks the comment announcing an issue obsolete.
func AnnouncementComment ¶ added in v0.12.0
AnnouncementComment is the comment announcing an issue obsolete: to its reporter and its watchers, why, the code quoted, from when it may be closed and how to keep it open; then the block the engine reads back.
func Ask ¶ added in v0.6.0
Ask is the comment asking the reporter what is missing; a later round says it follows their answer.
func AskMarker ¶ added in v0.6.0
AskMarker marks the comment asking an issue's reporter: the first round's as it always was, a later one's with its round.
func Basis ¶ added in v0.15.0
Basis is what an issue's state keeps of its watched sections, to tell a person's change from the engine's: their text, the engine's own lines (a draft line, a blocked-by line) left out.
func Before ¶ added in v0.8.0
Before says an issue's place in the order, to put it back: its priority and its milestone.
func Blockers ¶ added in v0.14.0
Blockers are the issues one waits on, open or closed: the forge's relation and its body's lines, by number.
func BodyBlockers ¶ added in v0.14.0
BodyBlockers are the issues a body's "Blocked by" lines name.
func BodyDigest ¶ added in v0.6.0
BodyDigest is what the state keeps of a body, to tell when a person changed it.
func CappedByRole ¶ added in v0.7.1
CappedByRole lists the issues an act was proposed on only because a run's cap was reached: they are read again, though nothing changed on them.
func ChildBody ¶ added in v0.11.0
ChildBody is a split's child's body: a line naming its parent, then its four sections, Need and Validation as drafts.
func ClosedByRole ¶
ClosedByRole lists the issues the role's record says it closed, read from its report issue's comments; nil when there is none or it does not read.
func ClosingComment ¶ added in v0.12.0
ClosingComment is what an obsolete issue is told as it is closed after its announcement.
func CodeKey ¶ added in v0.10.0
CodeKey is the subject of a finding on a line of code: its file and the line as it reads, spaces aside. Two roles finding the same line get the same key; the line changed, it is another subject.
func CompareMilestones ¶ added in v0.8.0
CompareMilestones orders two milestone titles as versions: their numbers compared as numbers (v1.9 before v1.10), the rest as text.
func Day ¶ added in v0.15.0
Day reads a forge's time — RFC 3339 or YYYY-MM-DD — as its day in UTC; "" when it does not read.
func DraftLine ¶ added in v0.6.0
DraftLine opens a drafted section; deleting it makes the section a person's.
func EngineMarker ¶ added in v0.11.0
EngineMarker says whether the engine wrote a comment, and its marker: the engine ends each of its comments with one; a person quoting one holds it inside, and is a person's all the same.
func ExemptLabel ¶ added in v0.12.0
ExemptLabel is the first of an issue's labels that keeps it from being announced or closed as obsolete, or "".
func FormatRecord ¶
FormatRecord is the body of the report's record comment.
func FormatState ¶
FormatState is the body of an issue's state comment, its marker left to the forge's Sticky.
func ImportKey ¶
ImportKey is the marker key of an issue opened from a file's text: the file and a digest of the text, so the same text is never opened twice.
func Imported ¶ added in v0.15.0
Imported is the file and lines an issue was opened from by an import, ok false when its body no longer says so or holds no import key.
func JudgeMaterial ¶ added in v0.12.0
JudgeMaterial is what the second judge reads: the issue, the announcement's evidence, and the code quoted as it is now.
func KeptComment ¶ added in v0.12.0
KeptComment tells an announced issue why it stays open, when no person kept it.
func KeptMarker ¶ added in v0.12.0
KeptMarker marks the comment saying why an announced issue stays open.
func Less ¶ added in v0.8.0
Less is the backlog's order (docs/spec/backlog-acts.md, "Ordering"): the nearest milestone first, an issue in none after every one in one; then the priority, an issue with none after priority 4; then the lowest number.
func LinesChange ¶ added in v0.15.0
func LinesChange(repo, path string, from, to int, opened, base, head string) (was, now string, nfrom, nto int, changed bool, err error)
LinesChange says whether a commit between base and head changed lines [from, to] of path as they were at opened — the commit the issue was opened at, its lines then — with the text at base and at head, and where the lines are now; an empty now when they are gone. A commit git cannot read — gone after a force-push, beyond a shallow clone — is an error, never read as no change.
func ListChildren ¶ added in v0.11.0
ListChildren is a parent's body with its children as a task list under SubIssuesHeading: added after its text, or the list already there rewritten.
func Locate ¶
Locate finds a quote in a file, as written but for spaces: the lines it spans, from 1, and those lines as the file has them.
func MovedPercent ¶ added in v0.8.0
MovedPercent reads the role's `moved-percent-max` setting: the share of the open issues a run may move, in percent; a fifth when it is not set.
func Next ¶ added in v0.15.0
Next lists the first n issues of the order bearing workline:ready that wait on no open issue and have no parts, the report left out: where to start (ADR-0028, ADR-0031).
func NextMilestone ¶ added in v0.8.0
NextMilestone is the nearest open milestone not released, in version order; "" when there is none.
func NextReady ¶ added in v0.14.0
NextReady is the first issue of an ordered list bearing workline:ready that waits on no open issue: the one offered to whoever builds next (ADR-0028); nil when there is none. A parent is never offered: its parts are what is built, and a person accepts it (ADR-0029).
func NotReady ¶ added in v0.6.0
NotReady says what keeps an issue's body from ready: a section missing or empty, Need or Validation still a draft no person accepted.
func ObsoleteKey ¶ added in v0.12.0
ObsoleteKey names a quote's evidence: its file or issue, and a digest of its text, spaces aside.
func Offered ¶ added in v0.15.0
Offered says whether an issue may be offered to whoever builds next: ready, waiting on no open issue, no parent (ADR-0028, ADR-0029).
func OpenedBy ¶ added in v0.10.0
OpenedBy is the role that opened an issue on a finding of its own through Openings, or "".
func Order ¶ added in v0.8.0
Order sorts issues in the backlog's order (docs/spec/backlog-acts.md, "Ordering"): Kahn's, the next the first by Less whose blockers among them are all placed. When none can be, those left hold a cycle: it is returned, the cycle's first by Less placed, and the order goes on — a cycle is reported, never followed (ADR-0028).
func Parts ¶ added in v0.14.0
Parts are an issue's children as the forge shows them, one rule for the report, the order and the comment: its relation (GitHub's sub-issues, GitLab's tasks) and the task list under "## Sub-issues" in its body — where a split links its children, or lists them. A part a person unlinked is no longer one.
func PeopleComments ¶
PeopleComments counts an issue's comments that are not the engine's.
func Place ¶ added in v0.15.0
Place says an issue's milestone and priority: "milestone v1.0, priority 2", "no milestone, no priority".
func Priority ¶ added in v0.8.0
Priority is an issue's level, the most pressing of its labels; 0 when it has none.
func PriorityLabel ¶ added in v0.8.0
PriorityLabel is the label of a priority level.
func PriorityLabels ¶ added in v0.8.0
PriorityLabels lists the levels an issue's priority labels give, in the order of its labels; more than one is a person's doing.
func ProposalComment ¶ added in v0.11.0
ProposalComment is the comment proposing an outsider's issue refined: what the role understood, its sections as it would write them, what it needs, and how to agree. Nothing is written in the body before (ADR-0021). The sections are kept in a YAML block, read back when it is agreed to.
func ProposalMarker ¶ added in v0.11.0
ProposalMarker marks the comment proposing an outsider's issue refined.
func RecordMarker ¶
RecordMarker marks the report's comment holding what the role did.
func RecordOpening ¶ added in v0.15.0
RecordOpening adds what opening the intention at index did to the run folder: a forge's list may not show an issue opened a moment ago, and an import's map reads it from here.
func RecordedOpenings ¶ added in v0.15.0
RecordedOpenings reads what the openings of a run did, by intention index.
func Refine ¶ added in v0.6.0
Refine is an issue's body with the sections it lacks written: one there but empty (an issue form's "_No response_") filled in place, one missing added after the text, which stays as it is; added and kept name the sections written and those already there, left alone.
func Released ¶ added in v0.8.0
Released says whether a tag named after the milestone exists: the release it was for is out.
func ReportTitle ¶
ReportTitle is the title of the role's report issue.
func Revisable ¶ added in v0.20.0
func Revisable(is forge.Issue, st *State, r *SpecReview) []string
Revisable are the sections of a body the role may rewrite to answer the reviewer's findings (#128): those the findings lie in that are still the role's own — a draft no person accepted, or a text as the role wrote it (the state's `wrote`). A person's section is theirs: never rewritten.
func Rewritten ¶ added in v0.15.0
Rewritten are the watched sections a person rewrote since the state was kept, spaces aside: a section written where there was none is not a change to what others were built on, nor is a state that kept none yet.
func Round ¶ added in v0.11.0
Round says whether a comment is one of the engine's rounds with an issue's reporter: an ask or a proposal.
func RoundsMax ¶ added in v0.11.0
RoundsMax is how many times an issue's reporter is written to — asked, or proposed a refined text — before a person takes it: acts.ask.rounds, three when it is not set (ADR-0021).
func SectionAt ¶ added in v0.20.0
SectionAt is the section of a body a line lies in, by its `## ` (or `### `) heading above it; "" above the first.
func SectionDigest ¶ added in v0.20.0
SectionDigest is the digest of a section's text, as the role wrote it: another text there is a person's.
func SpecHold ¶ added in v0.20.0
SpecHold says why an issue's spec holds it from ready, "" when nothing does: rule and why, as a dropped act says them. A person's label `workline:accepted` is their yes to the issue as it reads: it lifts the hold, whatever the reviewer found.
func SplitInto ¶ added in v0.14.0
SplitInto are its parts and the children the role's split recorded in its state (st may be nil): never closed by the role, nor split again.
func SplitKey ¶ added in v0.11.0
SplitKey is the marker key of a split's child: its parent and its title, so a split run again finds the children it opened.
func StateMarker ¶
StateMarker marks the comment holding an issue's state.
func StripDrafts ¶ added in v0.7.0
StripDrafts takes the draft lines out of a body: the drafts are a person's once accepted.
func SuggestFromActs ¶ added in v0.16.0
SuggestFromActs is the level the weekly sample suggests from the acts done alone at a level and those a person undid, and why; "" when none. Below SuggestAfter acts, none: too few to say. At cautious, the role does alone only what checks facts: the report suggests from the proposals.
func TickMarker ¶ added in v0.12.0
TickMarker is the hidden key that ends a line of the report a person may tick.
func TitleKey ¶ added in v0.10.0
TitleKey is the subject of a finding that names no code: its title, spaces and case aside.
func VerificationItems ¶ added in v0.14.0
VerificationItems are the items of a body's Verification section: each list item, or, with no list, the section whole.
func Waiting ¶ added in v0.14.0
Waiting are the open issues one waits on: a blocker closed, or not an open issue, holds nothing back.
func WithBlockers ¶ added in v0.14.0
WithBlockers is a body with the engine's line naming these blockers too: the line there rewritten with them added, or added after the text. A person's own "Blocked by" line is left as it is.
Types ¶
type Acts ¶ added in v0.16.0
Acts is what the weekly sample reads of the role's acts on the forge: those its record keeps, the level in force at its last run, and the acts a person undid, with what shows it.
type Announcement ¶ added in v0.12.0
type Announcement struct {
Quote Quote `yaml:"quote"`
Why string `yaml:"why"`
Commit string `yaml:"commit"`
Announced string `yaml:"announced"` // the day it was announced, YYYY-MM-DD
By string `yaml:"by,omitempty"` // the model that proposed it
}
Announcement is what the engine wrote when it announced an issue obsolete, read back from its comment's block.
func LastAnnouncement ¶ added in v0.12.0
LastAnnouncement reads the last announcement on an issue, and the notes written after it; nil when there is none, or it does not read.
func (Announcement) Key ¶ added in v0.12.0
func (a Announcement) Key() string
Key is the evidence an announcement rests on: kept open once, not announced again for it.
type Backlog ¶ added in v0.14.0
type Backlog struct {
Next *forge.Issue
Waiting map[int][]int // each issue waiting on an open one, and on which
Blocked []int // those issues, in the backlog's order
Cycles [][]int
}
Backlog is what the order says of the open issues: the first ready one offered, those waiting, the cycles (ADR-0028). The report issue is left out.
type Board ¶ added in v0.15.0
type Board struct {
NextMax int
StuckDays int
Next []forge.Issue
Stuck []Wait
// contains filtered or unexported fields
}
Board is the report's opening: what is next and what is stuck.
func MakeBoard ¶ added in v0.15.0
func MakeBoard(open []forge.Issue, report int, waits []Wait, proposed []Pending, cfg Config, now time.Time) Board
MakeBoard reads the board from the open issues, the report left out; the waits pre found on the forge; the proposals the report holds. An issue appears once, in its first list; a wait not past stuck-days, an announcement aside, is not stuck.
type Change ¶ added in v0.15.0
type Change struct {
Issue int `yaml:"issue"` // the issue whose sections changed, or the one opened from the lines
What []string `yaml:"what,flow,omitempty"` // the sections a person rewrote
Path string `yaml:"path,omitempty"` // an imported file whose lines changed
Lines string `yaml:"lines,omitempty"` // those lines then, and now: "7-8 → 7-9"
Since string `yaml:"since,omitempty"` // the day it was found, YYYY-MM-DD
Touch []Touch `yaml:"touched"` // the open issues it touches
Was string `yaml:"was,omitempty"` // the text before, for the agent (not kept in the record)
Now string `yaml:"now,omitempty"` // the text after, for the agent (not kept in the record)
}
Change is a change to what open issues were built on, as the record keeps it until a person ticks it seen or its issues are closed.
type Child ¶ added in v0.11.0
type Child struct {
Title string `yaml:"title"`
Need string `yaml:"need"`
Verification string `yaml:"verification"`
Validation string `yaml:"validation"`
Scope string `yaml:"scope"`
Sources []string `yaml:"sources,omitempty"`
After []int `yaml:"after,flow,omitempty"` // the children it waits on, by their place in the split, from 1 (ADR-0028)
}
Child is one part of a split need: an issue of its own, with its four sections (ADR-0022).
type Closing ¶
type Closing struct {
Issue int `yaml:"issue"`
Act string `yaml:"act"`
Level string `yaml:"level,omitempty"` // the autonomy level it was done at
}
Closing is one issue the role closed.
type Config ¶ added in v0.13.0
type Config struct {
Level string // cautious, normal or enterprising
Acts map[string]Setting // each kind's mode and cap, the project's laid over the level's
Origins map[string]string // each kind's: level or setting
MovedPercent int // the share of the open issues a run moves
IgnoredMax int // runs nobody answered before the role pauses; 0 never
NextMax int // the ready issues the report lists first; 0 none (ADR-0031)
StuckDays int // the days an issue waits on a person before the report says it stuck
// SpecReview: the project's line runs the reviewer after the role, so
// ready is held while the reviewer's important findings on the spec are
// open (#128); set by the caller, from the routing.
SpecReview bool
}
Config is how far the role goes in a run, read from its settings.
func ReadConfig ¶ added in v0.13.0
ReadConfig reads the role's settings: the level, the acts, the moved share, the runs before a pause, and what the report lists first. A level or a number out of range is an error, never read as a default (principle 12).
type Coverage ¶ added in v0.15.0
type Coverage struct {
File string `json:"file"`
Items []Mapped `json:"items"`
NotCovered []Mapped `json:"not-covered"`
}
Coverage is an import's map: every item of the file to its issue or its reason, and the lines left with neither.
func Cover ¶ added in v0.15.0
func Cover(repo, file string, lines []string, shares []ImportShare, before, after []forge.Issue, applied bool) (*Coverage, []verdict.Finding)
Cover builds an import's map from the shares the engine cut and the agent's answers, checking each reason: a quote found in the file, an issue that is there. Before and after are the forge's issues, open and closed, before the import and after it; applied, whether it wrote. A line not blank that no item nor reason holds is not covered, and the share that was to answer for it is flagged.
type Decision ¶
type Decision struct {
Index int `yaml:"index"` // the intention's place in the run
Mode string `yaml:"mode"` // act, propose, or off (dropped)
Act Proposal `yaml:"act"`
Capped bool `yaml:"capped,omitempty"` // proposed only for the cap
}
Decision is what becomes of one act.
type Did ¶ added in v0.16.0
type Did struct {
Issue int `yaml:"issue"`
Act string `yaml:"act"` // its kind, as the settings name it: close-duplicate, rename…
Level string `yaml:"level"` // the autonomy level it was done at
Day string `yaml:"day"` // the day, YYYY-MM-DD, UTC
Line string `yaml:"line,omitempty"`
}
Did is one act the role did alone.
type Done ¶ added in v0.13.0
type Done struct {
Issue int `yaml:"issue"`
Act string `yaml:"act"`
Was string `yaml:"was,omitempty"`
Set string `yaml:"set,omitempty"`
Level string `yaml:"level,omitempty"` // the autonomy level it was done at
}
Done is one act of the role's a person may undo: its issue, its kind, the value it had and the value the role set.
type Evidence ¶ added in v0.14.0
type Evidence struct {
Body string
Parts int
Closed int // the parts closed, or gone from the forge
Undone []int // the parts closed without delivering: not planned, a duplicate, gone
Unproved []string // the Verification items no part delivered quotes
Unread []Part // the parts whose closer the forge refused to say, with why
AllClosed bool
}
Evidence is a parent's report, as the engine writes it.
func ReadEvidence ¶ added in v0.14.0
ReadEvidence writes a parent's report from its parts: what each became and what closed it; each item of its Verification proved by a part delivered that quotes it — in its own Verification, or in the text of the pull request or commit that closed it — or said not proved.
type Exchange ¶ added in v0.11.0
type Exchange struct {
Rounds int // the engine's comments to the reporter
Answered bool // a person's comment after the last of them
Asked []string // each one's text, its marker left out
}
Exchange is the conversation with an issue's reporter, read from its comments: the engine's asks and proposals, in order, and whether a person wrote after the last one.
func ReadExchange ¶ added in v0.11.0
ReadExchange reads the conversation with an issue's reporter.
type Hand ¶ added in v0.12.0
type Hand struct {
Report int
Record Record
Broken error // the record does not read
Ticks []TickBy // the boxes ticked in the report's body now
Comments int // comments of people of the project on the report
Signs []string // what a person did since the last run: a tick, a comment, a closing or an act undone, a proposal settled
// Undone are the role's acts a person undid since the last run, other
// than closings; Standing, those still watched (ADR-0026).
Undone []Undo
Standing []Done
}
Hand is what people did on the report since the last run.
func ReadHand ¶ added in v0.12.0
ReadHand reads the report: its record, the boxes ticked in its body with who ticked them, the people's comments on it, and the signs of a person since the last run. No report: an empty hand.
func (*Hand) Demoted ¶ added in v0.13.0
Demoted are the kinds of act back to propose: those the record holds, and those a person undid since the last run, a closing reopened or another act.
func (*Hand) Paused ¶ added in v0.12.0
Paused says whether the role pauses: max runs in a row nobody answered (ignored-runs-max; 0 never pauses), and no person's hand since.
type ImportOpen ¶ added in v0.15.0
type ImportOpen struct {
Title string
Quote Quote
Capped bool // proposed in the report, past the cap of open
Dropped bool // refused by the engine, a finding saying why
// Opening is what opening it did, as the run recorded it: the issue
// that holds it, and whether it was opened then.
Opening *Recorded
}
ImportOpen is an item the agent proposed to open, and what the engine decided of it.
type ImportShare ¶ added in v0.15.0
type ImportShare struct {
ImportShare is one share of the file an import read, and the agent's answer on it.
type Judged ¶ added in v0.12.0
type Judged struct {
Yes *bool `yaml:"yes"`
Why string `yaml:"why"`
Model string `yaml:"model"`
Level string `yaml:"level"`
Author string `yaml:"author"`
Error string `yaml:"error"`
}
Judged is a second judge's answer on an announced issue (ADR-0005), written by the engine beside the question pre asked.
type KindMode ¶ added in v0.13.0
type KindMode struct {
Kind string
Mode string
Max int
Drafts string // refine: Need and Validation proposed when "propose"
Origin string
}
KindMode is one kind of act's mode in a run, and where it comes from.
type Mapped ¶ added in v0.15.0
type Mapped struct {
Lines string `json:"lines"`
From int `json:"from"`
To int `json:"to"`
Words string `json:"words"`
State string `json:"state,omitempty"`
Issue int `json:"issue,omitempty"`
Why string `json:"why,omitempty"`
}
Mapped is one entry of an import's map: an item, by its lines and first words, and the issue that holds it or why none does.
type Measure ¶ added in v0.13.0
type Measure struct {
Level string `yaml:"level"`
Ticked int `yaml:"ticked,omitempty"` // proposals a person of the project ticked: done as proposed
Other int `yaml:"other,omitempty"` // proposals settled otherwise: their issue closed, or opened by hand
}
Measure is what a person did with the proposals at the level in force: the report suggests another level from it, never changes the setting.
type Obsolete ¶ added in v0.12.0
type Obsolete struct {
Announcement *Announcement // nil: none waiting
Due bool // its delay passed, nothing cancels it: a judge decides
From string // the day it may be closed from
Keep string // why it is kept open, when it is
Say bool // the issue is told why it is kept: no person did it
}
Obsolete is where an issue's announcement stands.
func ReadObsolete ¶ added in v0.12.0
func ReadObsolete(repo string, is forge.Issue, notes []forge.Note, st *State, role string, s Setting, now time.Time) Obsolete
ReadObsolete says where an issue's announcement stands: none waiting (none, or settled already — its evidence in the state's kept), kept open (someone wrote, the label taken off, an exempt label, the code quoted gone), waiting for its day, or due for the judge.
type Opening ¶ added in v0.10.0
type Opening struct {
Role string // the role that found it, named in the issue
Key string // the marker's key: issue=<subject>, or import=<a file's text>
Also []string // older keys the same subject was opened under
Title string
Body string
From string // where it was opened from, said after "Opened": " from `ROADMAP.md`"
Sources []string // the code it is about, for the keeper's state
Commit string // the commit it was seen at
Triage bool // a role's finding: labelled needs-triage, capped, said once when found after it was closed
Wrote []string // the sections the role wrote in its body, recorded in the keeper's state (#128)
}
Opening is a subject a role opens an issue for.
type Openings ¶ added in v0.10.0
type Openings struct {
Max int // a run's findings opened as issues, at most; the rest Capped
// contains filtered or unexported fields
}
Openings is the one way every role opens an issue (ADR-0018): a stable key per subject, hidden in the issue's body; the issues open and closed looked in, once a run; no AI. A subject an issue holds is never opened again: open, it is left as it is; closed as not planned or as a duplicate, it is a person's no, left as it is; closed otherwise, it is said once on it that it was found again, and it stays closed.
func NewOpenings ¶ added in v0.10.0
NewOpenings prepares a run's openings on f, at most max findings opened.
type Part ¶ added in v0.14.0
Part is one child as the parent's report reads it: the issue, open or closed, and what closed it; Gone when the forge no longer has it; Unread when the forge refused to say what closed it.
type Pending ¶
type Pending struct {
Issue int `yaml:"issue"`
Act string `yaml:"act"`
Line string `yaml:"line"`
Key string `yaml:"key,omitempty"` // an issue to open: the text it would be opened from (ImportKey)
// Capped: proposed only because the run's cap was reached, not left to
// a person by its mode: its issue is read again at the next run.
Capped bool `yaml:"capped,omitempty"`
// Proposal is what the engine would do, as decided: done as it says
// when a person of the project ticks its box (ADR-0025).
Proposal *Proposal `yaml:"proposal,omitempty"`
// Since is the day it was first proposed, YYYY-MM-DD: the report says
// it stuck past stuck-days (ADR-0031).
Since string `yaml:"since,omitempty"`
}
Pending is an act proposed to a person, as the report says it.
type Plan ¶
type Plan struct {
Decisions []Decision `yaml:"decisions"`
Findings []verdict.Finding `yaml:"findings"`
Record Record `yaml:"record"`
Report int `yaml:"report"` // the report issue, 0 when none is open yet
Changed bool `yaml:"changed"` // the record changed: wrong closings found, proposals settled
// Opening is what the report opens with, what is next and what is
// stuck, as this run reads it (ADR-0031): kept with the plan so a
// resumed run writes the same, never in the record.
Opening string `yaml:"opening,omitempty"`
// contains filtered or unexported fields
}
Plan is what a run does with its acts, decided once, so a resumed run does the same.
func Decide ¶
func Decide(f forge.Backlog, repo, role string, cfg Config, closes map[int]Proposal, read []int, judged map[int]Judged, waits []Wait, changes []Change) (*Plan, error)
Decide plans the acts proposed, given at their place in the run, as far as the config lets the role go (ADR-0026). read lists the issues the run read: a proposal made only for a cap is dropped once its issue was read again, decided again or not. A run moves at most cfg.MovedPercent of the open issues (milestone and order). judged holds the second judge's answers on the issues announced obsolete (ADR-0024); waits, the issues pre found waiting on a person, for the report's opening (ADR-0031); changes, what open issues were built on that pre found changed, and the issues it read again for them (ADR-0032).
func (*Plan) ReportBody ¶
ReportBody is the report issue's body: what the run did and proposes.
type Proposal ¶
type Proposal struct {
Do string `yaml:"do"` // close or sources: the intention's kind
Issue int `yaml:"issue"`
Reason string `yaml:"reason,omitempty"`
DuplicateOf int `yaml:"duplicate-of,omitempty"`
Sources []string `yaml:"sources,omitempty"`
Milestone string `yaml:"milestone,omitempty"`
Title string `yaml:"title,omitempty"` // an issue to open, or an issue's new title (rename)
Into []Child `yaml:"into,omitempty"` // the children of a split
BlockedBy []int `yaml:"blocked-by,flow,omitempty"` // depend: the issues it waits on (ADR-0028)
Quote *Quote `yaml:"quote"`
Why string `yaml:"why"`
// Refining: the sections written, Need and Validation as drafts; Added,
// the engine's, says which the body did not have yet.
Scope string `yaml:"scope,omitempty"`
Verification string `yaml:"verification,omitempty"`
Need string `yaml:"need,omitempty"`
Validation string `yaml:"validation,omitempty"`
Added []string `yaml:"added,omitempty"`
// Revise, the engine's: the sections with text this refine may rewrite,
// to answer the reviewer's findings on the spec (#128) — the role's own
// only (Revisable); never taken from the agent.
Revise []string `yaml:"revise,omitempty"`
Questions string `yaml:"questions,omitempty"` // asking the reporter; for an outsider's refine, what it still needs
// The engine's, for the conversation with the reporter: the round this
// comment would be, and whether a refine is proposed to the reporter in
// a comment rather than written in the body (an outsider's issue).
Round int `yaml:"round,omitempty"`
ToReporter bool `yaml:"to-reporter,omitempty"`
// Agreed, the engine's: who agreed in a reply to the text last proposed
// to the reporter, which this refine writes; checked again on the forge
// (Agreement), never taken from the agent.
Agreed string `yaml:"agreed,omitempty"`
Spent bool `yaml:"spent,omitempty"` // the rounds spent: proposed to a person
// Ordering: the priority set (1 to 4); a milestone left because it is
// released (From, the engine's); and, the engine's, the issue's
// priority and milestone before the run, written in the report.
Priority int `yaml:"priority,omitempty"`
From string `yaml:"from,omitempty"`
Before string `yaml:"before,omitempty"`
// Obsolete (ADR-0024): Announced, on the engine's closing, the day of
// the announcement it follows; Announce and Until, the engine's, that
// this act announces rather than closes, and the day from which it may
// close; Judge, the engine's, the second judge's yes and its level;
// Say, on a keep, that the issue is told why.
Announced string `yaml:"announced,omitempty"`
Announce bool `yaml:"announce,omitempty"`
Until string `yaml:"until,omitempty"`
Judge string `yaml:"judge,omitempty"`
Say bool `yaml:"say,omitempty"`
// Ticked, the engine's: who ticked this proposal's box in the report, a
// person of the project — checked again on the forge, the act done as
// the record says, never as the intention does (ADR-0025).
Ticked string `yaml:"ticked,omitempty"`
}
Proposal is an act on an issue the agent proposed: a closing, or the code it is about named as its sources.
func LastProposal ¶ added in v0.11.0
LastProposal reads the sections of the last refined text proposed to an issue's reporter; nil when none was, or it does not read.
type Quote ¶
type Quote struct {
Path string `yaml:"path,omitempty"`
Issue int `yaml:"issue,omitempty"`
Text string `yaml:"text"`
}
Quote is the evidence an act cites: a text in a file, or in an issue.
type Record ¶
type Record struct {
Closed []Closing `yaml:"closed,omitempty"`
Wrong []Closing `yaml:"wrong,omitempty"` // closings found wrong: their issue open again
Propose []string `yaml:"propose,flow,omitempty"` // kinds of act back to propose, until the person says
// Done are the role's own acts a person may undo, other than closings:
// a rename, a priority, a milestone, ready, a split (ADR-0026); Undone,
// those a person undid, with what shows it.
Done []Done `yaml:"done,omitempty"`
Undone []Undo `yaml:"undone,omitempty"`
Proposed []Pending `yaml:"proposed,omitempty"` // acts proposed, kept until their issue is closed or proposed again
// The person's hand (ADR-0025): the runs in a row whose report proposed
// something and that nobody answered, and the comments of people of the
// project on the report when last read.
Ignored int `yaml:"ignored,omitempty"`
Comments int `yaml:"comments,omitempty"`
// Measure is what people did with the proposals at the level in force,
// for the report to suggest another (ADR-0026).
Measure *Measure `yaml:"measure,omitempty"`
// ToAccept are the open parents whose parts are all closed, as the
// report lists them for a person to accept (ADR-0029).
ToAccept []int `yaml:"to-accept,flow,omitempty"`
// Changes are what open issues were built on that changed, kept until
// a person ticks each seen or its issues are closed (ADR-0032).
Changes []Change `yaml:"changes,omitempty"`
// Did are the acts the role did alone, with their day and level, for
// the weekly sample to draw (ADR-0033).
Did []Did `yaml:"did,omitempty"`
}
Record is what the role did, kept on its report issue.
type Recorded ¶ added in v0.15.0
type Recorded struct {
Index int `yaml:"index"` // the intention's place in the run
Outcome string `yaml:"outcome"`
Issue int `yaml:"issue"`
}
Recorded is what one opening of a run did (RecordOpening).
type Setting ¶
type Setting struct {
Mode string
Max int
Rounds int // asking: the times an issue's reporter is written to, then a person (ask only)
Days *int // close-obsolete: the days an announcement waits; ObsoleteDays when nil
Exempt []string // close-obsolete: labels that keep an issue from it; DefaultExempt when nil
Drafts string // refine: propose has Need and Validation drafts proposed, Scope and Verification written (ADR-0026)
}
Setting is a kind of act's mode and cap.
type Skip ¶ added in v0.15.0
type Skip struct {
Lines any `yaml:"lines"` // "12", or "12-14"
Reason string `yaml:"reason"`
Quote *Quote `yaml:"quote,omitempty"`
Issue int `yaml:"issue,omitempty"`
Why string `yaml:"why,omitempty"`
}
Skip is an item of a file an import read and does not open, and why, as the agent answers it: done, the words that say so quoted; held, the issue that holds it; not-item, why.
type SpecReview ¶ added in v0.20.0
type SpecReview struct {
Body string // the digest of the body it read (BodyDigest); "" when no review was whole
Round int // the reviews in a row that found an important finding open, this one included
Open int // the important findings open, as it read the body
In []string // the sections their causes lie in
Stopped bool // the rounds spent: put to a person, not read again
}
SpecReview is what the reviewer's comment records of the spec it read.
func ReadSpecReview ¶ added in v0.20.0
func ReadSpecReview(comments []string) *SpecReview
ReadSpecReview reads the reviewer's record from an issue's comments: nil when it has none, or one that does not read. The last comment carrying the marker is read (GitLab: one another token wrote is left behind).
func SpecCleared ¶ added in v0.20.0
func SpecCleared(is forge.Issue, comments []string) (*SpecReview, bool)
SpecCleared says whether the reviewer read the issue's body as it is and found no important finding open.
func SpecOpen ¶ added in v0.20.0
func SpecOpen(is forge.Issue, comments []string) *SpecReview
SpecOpen is the reviewer's record when it holds important findings open on the body as it is, for the product owner to answer; nil otherwise.
func (SpecReview) String ¶ added in v0.20.0
func (r SpecReview) String() string
String is the record as the comment hides it.
type State ¶
type State struct {
Sources []string `yaml:"sources"`
Confirmed string `yaml:"confirmed"`
Judged string `yaml:"judged,omitempty"` // the commit the role last read it at
Comments int `yaml:"comments,omitempty"` // people's comments when it was last read
Body string `yaml:"body,omitempty"` // a digest of its body, when the role last read or wrote it
Priority int `yaml:"priority,omitempty"` // the priority the role last set: another on the issue is a person's
Title string `yaml:"title,omitempty"` // the title the role last set: another on the issue is a person's
Split []int `yaml:"split,omitempty"` // the children the role split it into: it is not split again
Kept []string `yaml:"kept,omitempty"` // the evidence an announcement as obsolete rested on, kept open: not announced again for it
// Sections are its Need and Scope as last read or written (Basis): a
// person's change to them touches the issues built on it (ADR-0032).
Sections map[string]string `yaml:"sections,omitempty"`
// Wrote are the sections the role wrote, each the digest of its text:
// another text there is a person's (SectionDigest). Answered is the
// review of its spec the role was last given, by the digest of the
// body that review read (#128): a review restarting at round 1 is
// another review, never taken for one answered.
Wrote map[string]string `yaml:"wrote,omitempty"`
Answered string `yaml:"answered,omitempty"`
}
State is what the engine knows of an issue, kept in one comment on it.
type TickBy ¶ added in v0.12.0
type TickBy struct {
Key string
forge.Note
Known bool // the forge says who ticked it: by name, or as a person of the project
}
TickBy is a box ticked in the report now, with who ticked it.
type Touch ¶ added in v0.15.0
type Touch struct {
Issue int `yaml:"issue"`
How string `yaml:"how"`
Files string `yaml:"files,omitempty"` // the code shared, for TouchSources
Read bool `yaml:"read,omitempty"` // read again by the run that found it, with the change
}
Touch is an open issue a change touches, and how.
func Touched ¶ added in v0.15.0
Touched lists the open issues a change to issue id's sections touches, none twice, a part first: its open parts (read again), the open issues that wait on it, and — its Scope changed — those whose sources share a file with its own: a Need rewritten moves what is built on it, not every issue on the same code.
type Undo ¶ added in v0.13.0
type Undo struct {
Issue int `yaml:"issue"`
Act string `yaml:"act"`
Evidence string `yaml:"evidence"`
Day string `yaml:"day,omitempty"` // when a run found it, YYYY-MM-DD: the weekly sample counts it against one act
}
Undo is an act a person undid, and what shows it.
type Wait ¶ added in v0.15.0
type Wait struct {
Issue int `yaml:"issue"`
Waits string `yaml:"waits"`
Since string `yaml:"since"` // the day it started waiting, YYYY-MM-DD
Act string `yaml:"act,omitempty"` // proposed: the kind of act
Line string `yaml:"line,omitempty"` // proposed with no issue (an issue to open): its line
}
Wait is an issue waiting on a person, and since when.
func AskedWait ¶ added in v0.15.0
AskedWait is an issue's wait on its reporter: since the last round written to them, when no person wrote after it; known false when the forge does not say that round's day.
func ObsoleteWait ¶ added in v0.15.0
ObsoleteWait is an announced issue's wait on a second judge: since the day its delay ended, while due and neither closed nor kept.