Documentation
¶
Overview ¶
Package loop is the implement loop's engine (itd-2609201916151817, spc-2609202134338445): the state file a run lives in, the checks that decide whether a run may start, and the step interface a driving host calls. `abcd build <itd-N>` starts a run; `abcd implement step` performs the next stage of the current lane and exits; `abcd implement receipt <path>` hands back what an agent stage waited on; `abcd implement status` renders the state. Nothing here holds a run in memory between invocations: every call reads the state file first, does at most one stage, writes the state file last and returns (decisions 1 and 2), so a killed process loses only the stage it was in, which the next call repeats.
The state lives in the checkout's local tier:
.abcd/.work.local/run/<run-id>/state.json the run: its key, lanes, clock and record .abcd/.work.local/run/.lock the advisory lock every mutation takes
The tier is never created here: only a repository abcd manages has it, which is what keeps a run managed-only without a check of its own to drift from (internal/core/mode draws the same line). The run directories beneath it are created one level at a time and proved real (fsutil.EnsureRealDirAll), and the state is written through the package's one atomic writer inside an os.Root, so a symlinked component is refused rather than followed.
The lane's stages are a sequence (Sequence), and each stage's body is a Handler the piece of the spec that delivers it registers in DefaultStages: the worktree (piece 6, lane.go), the brief (piece 5, brief.go), the implement stage and its receipt's verifier (piece 7, receipt.go), the validators (piece 8) and the landing (piece 9). A stage whose body this build does not carry is refused by name, with the piece that delivers it, and the run is left unchanged. A lane's files live in its own directory of the run:
.abcd/.work.local/run/<run-id>/<lane-id>/brief.md the brief the loop renders .abcd/.work.local/run/<run-id>/<lane-id>/receipt.json the implementer's receipt
and its worktree in the machine-scoped store, ~/.abcd.noindex/worktrees/<root-sha>/<run-id>-<lane-id>. The process driver (piece 3, drive.go) is the same loop: Drive performs the next stage and, when it hands the lane to a role routed to a command-line runner (itd-2609201916056194), starts that agent through the runner and hands its receipt back through Receipt.
Core never writes to stdout; the CLI front door formats what these functions return.
Index ¶
- Constants
- Variables
- func AcceptConfigChange(repoRoot, runID string, o Options) ([]string, error)
- func ConfigTripwire(repoRoot string) error
- func CurrentOutage(repoRoot string) (*implement.Outage, error)
- func DrainSummaryLine(r DrainRoute) string
- func HeldWorktrees(repoRoot string) (worktree.Held, error)
- func JudgementSummary(j DrainJudgement) string
- func LatestRun(repoRoot string) (string, error)
- func LoadRunners(r layered.Roots) (*runner.Config, error)
- func ReleaseReservation(repoRoot, key string, o Options) (claim.Result, error)
- func Resolve(repoRoot, runID string) (string, error)
- func RunCountRefusal(max int) error
- func StateRelPath(runID string) string
- func StatusLanes(repoRoot string) ([]statusblock.Started, error)
- func StatusPeers(repoRoot string) (statusblock.HeldBy, error)
- func ValidLaneID(id string) bool
- func ValidRunID(id string) bool
- type AliveLane
- type AuditRun
- type AutoPlan
- type Await
- type CandidateSet
- type CheckResult
- type CheckRow
- type Checkpoint
- type Comparison
- type Context
- type DoDRun
- type DrainCounts
- type DrainFinished
- type DrainHold
- type DrainJudgement
- type DrainJudging
- type DrainLane
- type DrainLapse
- type DrainOptions
- type DrainOrigin
- type DrainOriginWait
- type DrainParked
- type DrainPendingHandBack
- type DrainPreview
- type DrainResult
- type DrainRoute
- type DrainSkip
- type DrainSpend
- type DrainState
- type Driver
- type Entry
- type Excluded
- type HandBack
- type Handler
- type Hold
- type JudgementAnswer
- type Landing
- type Lane
- type LaneAwait
- type LaneHandBack
- type LaneReceipt
- type LaneRefused
- type LaneWorktree
- type NextOptions
- type NextResult
- type NextSeries
- type Options
- type OutageDone
- type OutageInfo
- type OutageLane
- type OutageLeft
- type OutagePR
- type Outcome
- type Pace
- type PaceValue
- type PendingStep
- type PlanReview
- type RateLimit
- type ReceiptRecord
- type RecordComparison
- type RecordLane
- type RecordPick
- type RecordVerdict
- type Refusal
- type Resolution
- type RestartAside
- type RestartResult
- type Retry
- type ReviewClass
- type ReviewJudge
- type ReviewRoute
- type ReviewSet
- type Reviewer
- type RoleReviewers
- type Round
- type RouteAnswer
- type RoutedJudgementAnswer
- type RunPick
- type RunRecord
- type RunRenewal
- type RunnerClaim
- type RunnerPause
- type Runners
- type SeriesFlags
- type SeriesPick
- type SeriesResult
- type Stage
- type StageDef
- type Stages
- type StartResult
- type State
- type StepResult
- func Discard(repoRoot, runID, laneID string, o Options) (StepResult, error)
- func Drive(ctx context.Context, repoRoot, runID string, steps Stages, o Options, ...) (StepResult, error)
- func DriveReview(ctx context.Context, repoRoot, runID string, res StepResult, steps Stages, ...) (StepResult, error)
- func Receipt(repoRoot, runID, receiptPath string, steps Stages, o Options) (StepResult, error)
- func Release(repoRoot, runID, laneID string, o Options) (StepResult, error)
- type Sync
- type Tiering
- type Transcript
- type TranscriptCapturer
- type Unattended
- type ValidationRound
- type ValidatorRun
- type Verifier
- type Waiting
- type WidenResult
Constants ¶
const ( LensDesign = "design" LensRecord = "record" )
The two lenses of the plan review, one fresh reviewer each (the adversarial-review principle's proven pair).
const ( BriefFileName = "brief.md" ReceiptFileName = "receipt.json" ReportFileName = "report.md" DoDFileName = "dod.log" )
The files of a lane's directory, .abcd/.work.local/run/<run-id>/<lane-id>/. The loop writes the brief; the implementer writes the other three.
const ( CheckKey = "key" CheckReady = "ready" CheckOpenQuestions = intent.StartCheckOpenQuestions CheckClaimSections = intent.StartCheckClaimSections CheckHold = intent.StartCheckHold CheckBlocked = intent.StartCheckBlocked CheckSteps = intent.StartCheckSteps CheckPeers = "peers" // CheckEligible is an issue key's row: the drained repository's own rule // takes the issue (itd-82 scope 2; decision 10 on the parent). CheckEligible = "eligible" )
Check names, in the fixed order Check reports them.
const ( MergeableConflicting = "CONFLICTING" MergeableUnknown = "UNKNOWN" )
The forge's mergeable verdicts.
const ( // DrainStoppedCap: the drain opened --max lanes. DrainStoppedCap = "cap" // DrainStoppedEmpty: no eligible issue is left that this drain has not // taken, held by another or not; with held work left the drain waits // (drain_wait.go). DrainStoppedEmpty = "empty" )
Why a drain ended.
const ( DrainLaneInProgress = "in-progress" // DrainLanePullRequest: the landing opened the lane's pull request and // armed it or left it open; the merge is a person's gate. DrainLanePullRequest = "pull-request" DrainLaneHandedBack = "handed-back" // DrainLaneDone: the run is complete. DrainLaneDone = "done" )
The outcomes of a lane the drain opened, as the drain reads its run.
const ( // RoutePromoted: a user moment, promoted to an intent draft with // `capture promote`; the issue gains the draft in related_intents and // nothing else is written. RoutePromoted = "promoted" // RouteDecisionRecord: a rule about trust or safety, flagged as needing a // decision record with the question stated, in the summary and as the // `decision_needed:` marker on the open issue (itd-82 decision 10), which // is the only write; nothing is minted. RouteDecisionRecord = "decision-record" // RouteRule: above the rule's severity, outside its categories, or held // by another of its rules; flagged naming the rule. RouteRule = "rule" // RouteHome: anything else, flagged with the home the decision belongs in. RouteHome = "home" )
The routes a hand-back takes, by kind (scope 5).
const ( ParkedWaiting = "waiting" ParkedConflicting = "conflicting" ParkedClosed = "closed" ParkedMerged = "merged" ParkedUnread = "unread" // ParkedSyncing: the pull request conflicts only on files origin's // default branch declares generated, or not at all as this checkout // merges, so the lane went back through its sync (step 13). ParkedSyncing = "syncing" // ParkedDropped: the armed pull request left the merge queue disarmed (a // failed merge-group check, named in the note), or its head moved under // it, or the loop's own toggle of its arming left it disarmed (the // refusal, naming the command that re-arms it, is the note), so it will // not merge on its own (iss-2610090642376032). It is still // renewed: a person re-arms it, and a release's hold, which withdraws // armed merges and re-arms them after, reads the same in the listing. ParkedDropped = "dropped" )
What a move read a parked lane's pull request as.
const ( // DrainOriginFetch: the fetch from origin failed. DrainOriginFetch = "fetch" // DrainOriginDefaultBranch: the fetch could not read origin's default // branch (renamed since this checkout last knew it), or its commit could // not be resolved. DrainOriginDefaultBranch = "default-branch" // DrainOriginHead: this checkout names no default branch of origin (no // origin/HEAD, and no origin/main, master, trunk or develop). DrainOriginHead = "origin-head" )
Why a drain move could not read origin: the kinds an origin wait records.
const ( // DrainWaitCap: the drain's holder is at the cap of live reservations. DrainWaitCap = "cap" // DrainWaitHeld: every eligible issue left is held by another. DrainWaitHeld = "held" )
The waits a drain makes, in waiting.
const ( StageRunner = "runner" StageFallback = "fallback" )
StageRunner is the record's stage for a role a runner ran, and StageFallback for one a runner did not.
const ( DrainJudgementRequestRel = RunRelDir + "/drain-judgement.request.md" DrainJudgementAnswerRel = RunRelDir + "/drain-judgement.json" )
DrainJudgementRequestRel is the request the drain writes for the host, and DrainJudgementAnswerRel where the host writes its answer. One judgement is awaited at a time, so each is one file beside the drain's state.
const ( // JudgementYes: the remedy changes what a user sees or a trust boundary; // the issue is handed back. JudgementYes = "yes" // JudgementNo: it changes neither; the lane opens. JudgementNo = "no" )
The answers to the one question.
const ( // Remote is the remote a lane lands through: the one the default branch // is read from. Remote = "origin" // LandDirName is the lane's directory the landing writes into. LandDirName = "land" // PRBodyFileName is the pull request's body as the loop composed it, and // PRStrippedFileName the body re-read from the forge and stripped. PRBodyFileName = "pr-body.md" PRStrippedFileName = "pr-body.stripped.md" )
The landing's fixed names.
const ( // SeriesStoppedCap: the series made --max picks. SeriesStoppedCap = "cap" // SeriesStoppedEmpty: no candidate is left. SeriesStoppedEmpty = "empty" )
Why a series ended.
const ( SeriesPickInProgress = "in-progress" // SeriesPickDelivered: the run is complete. SeriesPickDelivered = "delivered" // SeriesPickHandedBack: a lane of the run was handed back, so the lane // stopped; the run stays for the person. SeriesPickHandedBack = "handed-back" // SeriesPickRemoved: the run's directory was removed, the way out of a // handed-back run. SeriesPickRemoved = "removed" )
What a series' pick has come to, as the series reads its run.
const ( StageOutage = "outage" DrainStoppedOutage = "outage" )
StageOutage is the refusal stage of a run that gave up on an outage, and DrainStoppedOutage why a drain ended on one.
const ( BundledWorkMinutes = 120 BundledPauseMinutes = 0 BundledSubAgents = 2 )
The bundled pace: 120 minutes of work, no pause, two lanes (decision 5, the product thinker's numbers for this repository's runs on 2026-09-20, with the pause removed by the product thinker's ruling of 2026-10-10). A repository that wants a pause writes its own under `pace` in its .abcd/config.json.
const ( StageRateLimit = "rate-limit" StageCheckpoint = "checkpoint" )
StageRateLimit is the run record's stage for a rate-limit response, and StageCheckpoint for a lane it checkpointed.
const ( HandBackUserVisible = "user-visible" HandBackTrustRule = "trust-rule" HandBackDesignFinding = "design-finding" HandBackSecondPackage = "second-package" )
The kinds a lane hands an issue back as (itd-82: a reviewer's design finding, a second package, a user-visible change the remedy did not name, and a rule about trust or safety).
const ( StageTranscript = "transcript" StageRecord = "record" )
StageTranscript is the run record's stage for a captured transcript, and StageRecord the refusal stage of the record's own verb.
const ( StageReservationRenewed = "reservation_renewed" StageReservationRenewFailed = "reservation_renew_failed" // StageReservationReleased is a step's release of an issue run's // reservation when its lane is handed back. StageReservationReleased = "reservation_released" // StageReservationReleaseFailed is a step's release of an issue run's // reservation that could not push the tombstone: the drain routing the // hand-back tries it again. StageReservationReleaseFailed = "reservation_release_failed" )
The run record's stages for the run's reservation.
const ( StageReservation = "reservation" CheckReservation = "reservation" )
StageReservation is the refusal stage, and the run record's stage, of a run's start that reserves its key; CheckReservation is the check a drain names when it passes over an issue another holds.
const ( AsideDirName = "aside" AsideFileName = "aside.json" AsidePatchName = "changes.patch" )
The aside a restart saves, under the lane's directory of the run: <lane-dir>/aside/<UTC stamp>/.
const ( WhyDied = "agent died" // NetworkLinePrefix opens the line an agent yielding on a network failure // hands back. NetworkLinePrefix = "NETWORK:" )
The reasons a restart records.
const ( ClassTop = "top" ClassMiddle = "middle" ClassBelow = "below" ClassSmallest = "smallest" )
The model classes, top to smallest (the scale of iss-2610140652230444's ruling of 2026-10-14).
const ( StageRetry = "retry" StagePaused = "paused" )
StageRetry is the record's stage for a held role retried on its runner, and StagePaused for a role its runner failed to start.
const ( HoldBeforePush = "push" HoldBeforeArm = "arm" )
The landing steps a hold stops before.
const ( ModelAsked = "asked" ModelReported = "reported" ModelUnsent = "unsent" )
The statuses of a reviewer's model.
const ( ComparisonAgree = "agree" ComparisonDisagree = "disagree" ComparisonNone = "none" )
The outcomes of a comparison.
const ( BundledStuckRefusals = 3 BundledStuckMinutes = 60 )
The bundled stuck bounds (dcn-2610161040382067): three identical refusals, or sixty minutes refusing at one stage. A repository sets its own under `pace` in .abcd/config.json, a machine in ~/.abcd.noindex/config.json.
const ( UnattendedBuild = "build" UnattendedDrain = "drain" )
The kinds of unattended work.
const ( RoleRuthless = "ruthless-reviewer" RoleSecurity = "security-reviewer" RoleAuditor = "intent-auditor" )
The validators, by the agent definition each is started as.
const ( ValidateDirName = "validate" FixDirName = "fix" ReturnFileName = "return.md" VerdictFileName = "verdict.json" AuditRequestFileName = "request.md" )
The files of a validation round.
const AcceptConfigFlag = "--accept-config-change"
AcceptConfigFlag is the `implement step` flag that accepts a changed configuration once the person has looked at it.
const BranchPrefix = "build/"
BranchPrefix is the namespace every lane branch is cut under.
const BundledFixRounds = 3
BundledFixRounds is the fix rounds a lane may take before it is handed back when nothing sets it (ruling DR1 of 2026-09-29: "tied to the pace settings, a per-run value set alongside --pace, default 3"; itd-50 decision 2).
const (
BundledMaxReviewers = 2
)
BundledMaxReviewers is the ceiling on reviewers per role when the machine sets none, and maxReviewers the most any ceiling may be.
const CheckBudget = "budget"
CheckBudget is the budget check's row among the start's checks, and the run record's stage for it.
const CheckFootprint = "footprint"
CheckFootprint is the exclusion of a planned intent whose spec names no footprint packages to reserve it with, or names one by prose rather than by its path, in a checkout with a remote named origin: its start would be refused at the reservation.
const CheckLapsed = "lapsed"
CheckLapsed is the pass-over of an issue whose judgement request lapsed unanswered, while its cool-down runs.
const CheckRun = "run"
CheckRun is the exclusion of a planned intent this checkout already has a run in progress for: the pick starts a run, never resumes one.
const CheckSeries = "series"
CheckSeries is the exclusion of a planned intent the series in progress has already picked: a series picks each intent once, whatever its run came to.
const CheckSkipped = "skipped"
CheckSkipped is the pass-over of an issue the drain's skip list holds back.
const ConfigFingerprintFileName = "config-fingerprint.json"
ConfigFingerprintFileName is the tripwire's file, beside the run's state.
const ConventionsFile = "AGENTS.md"
ConventionsFile is the file a brief's conventions are read from.
const DrainFromJudgement = "judgement"
DrainFromJudgement marks a hand-back the host judgement made, in a DrainRoute's From.
const DrainFromReservation = "reservation"
DrainFromReservation is a hand-back's From when the drain could not reserve the issue: its found_at names no path to reserve it with.
const DrainJudgementSchemaVersion = 1
DrainJudgementSchemaVersion is the answer's shape.
const DrainSchemaVersion = 3
DrainSchemaVersion is the drain state's shape.
Version 2 added a route's pins and override to a routed judge's stored route: a judgement's route carries the pin and sealed configuration's SHA-256 of a pinned opencode run (`provider_pin`, `pin_config_sha256`), a route to a model on this machine its local pin, what its server reported and that it is local (`local_pin`, `local_served`, `local`), and the route record's `override`, as the run state's version 16 does. The field comes with the route record the two share; no drain flag sets it. Version 1 is its strict subset, read as a drain whose judge was pointed at no pin and carries no override, and written back at version 2; a file of version 1 carrying any of them is not one its version wrote, and is refused naming the key. v0.15.1 reads no version first, so it refuses a version-2 file as one that does not parse; releases after it that write version 1 refuse it as a newer abcd's before any strict decode.
Version 3 added a judge fallback receipt's `spent`, as the run state's version 19 does (iss-2611021751406429): what a judge's launch killed past its time spent. Versions 1 and 2 are its strict subsets, read as a drain no killed judge fell back from, and written back at version 3; a file of version 2 or lower carrying it is refused naming it. Releases that write version 2 refuse a version-3 file as a newer abcd's before any strict decode.
const DrainStateRel = RunRelDir + "/drain.json"
DrainStateRel is the drain's state file, beside the runs. Its name is not a run id, so the run listing never reads it as one.
const DrainStoppedOrigin = "origin"
DrainStoppedOrigin is why a drain ended that waited on origin through the outage schedule's hourly stage and gave up.
const HandBackClosed = claim.HandBackClosed
HandBackClosed is the kind a parked lane whose pull request was closed unmerged is handed back as; a lane's receipt cannot name it.
const HandBackNotPlanned = "not-planned"
HandBackNotPlanned is the verdict an auto-plan lane is handed back with: the substitute did not hold, so the draft is the person's to plan.
const HandBackStuck = claim.HandBackStuck
HandBackStuck is the kind a stuck lane is handed back as; a lane's receipt cannot name it.
const NextSeriesRel = RunRelDir + "/next.json"
NextSeriesRel is the series' state file, beside the runs. Its name is not a run id, so the run listing never reads it as one.
const NextSeriesSchemaVersion = 1
NextSeriesSchemaVersion is the series state's shape.
const PlanReviewDirName = "plan-review"
PlanReviewDirName is the lane's directory of plan reviews.
const QueueStateQuery = `` /* 340-byte string literal not displayed */
QueueStateQuery is the forge's GraphQL query for an armed pull request's place in the merge queue: `gh pr view --json` has no merge-queue field, so it is read through the forge's API, as `abcd land` reads it. It reads the node id the enqueue call names, the head (the queue and a re-arm are pinned to it), whether it is queued, the arming and its age, the merge state, and the last removal from the queue with the forge's reason. Every field is pinned in internal/ghcontract.
const ReceiptSchemaVersion = 1
ReceiptSchemaVersion is the receipt's shape.
const ReviewRequestFileName = "request.md"
ReviewRequestFileName is the request a reviewer route is sent, beside the reviewer's brief.
const RoleDrainJudge = "drain-judge"
RoleDrainJudge is the drain's judge, the role roles.drain-judge.runner routes.
const RoleImplementer = "implementer"
RoleImplementer is the agent the implement stage hands a lane to.
const RunIDFamily = "run"
RunIDFamily is the run id's prefix; the id is minted through the record-id seam (adr-45), so two checkouts starting runs in one second draw distinct ids.
const RunRelDir = TierRelDir + "/run"
RunRelDir is the directory every run of this checkout lives under.
const SchemaVersion = 20
SchemaVersion is the state file's shape. A file carrying a version this build does not know is refused rather than read as this one: a field a later build added and this one would drop on its next write is a run silently losing state.
Version 2 added the run's pace (itd-2609201925079472). Version 1 is its strict subset, so a version-1 file is read as a run started before the loop paced a run: it carries no pace, runs unpaced, and is written back at version 2 by its next mutation. A version-1 file carrying a pace is not one version 1 wrote, and is refused.
Version 3 added the pick `abcd build next` made (itd-2609211116005482): the run's `pick` and a lane's `pick_sha`. Versions 1 and 2 are its strict subsets, read as runs no pick started and written back at version 3; one of them carrying a pick is not one its version wrote, and is refused.
Version 4 renamed the lane's stage (BU1, iss-2609291313276243): a lane's and a record line's `step` became `stage`, so the word "step" names only the spec's steps. Versions 1 to 3 wrote `step`, and are migrated on read: the read carries each `step` over to `stage` and writes nothing, and the run's next mutation writes the file back at version 4, as it does for the versions before. One of them that already says `stage` is not one its version wrote, and is refused.
Version 5 added the validate stage's record (spc-2609202134338445 piece 8): a lane's `validation`, its rounds and the verdicts the loop recorded. Version 4 is its strict subset, read as a run no validator has judged yet and written back at version 5; a version-4 file carrying a validation is not one version 4 wrote, and is refused.
Version 6 added the fix-round cap (ruling DR1, 2026-09-29): the pace's `fix_rounds`, and a lane's `hand_back` when it takes its cap of fix rounds without passing. Version 5 is its strict subset, read as a run started before the pace carried the cap, which runs on the bundled one, and written back at version 6; a version-5 file carrying either is not one version 5 wrote, and is refused.
Version 7 added the landing and the run record's transcripts (spc-2609202134338445 pieces 9 and 10): a lane's `landing`, the captures its receipts declared fixed (`resolves`) and the receipts it verified (`receipts`, each with the model its runner reported), and the run's `transcripts`. Version 6 is its strict subset, read as a run nothing has landed yet and written back at version 7; a version-6 file carrying any of them is not one version 6 wrote, and is refused.
Version 8 added the runner's record (itd-2609201916056194, spc-2609202134338445 piece 3): the run's `fallbacks`, one receipt per role a runner did not run, and the `route` a verified receipt or a validator's return names when a runner, not the host, ran its agent. Version 7 is its strict subset, read as a run the host ran every agent of and written back at the current version; a version-7 file carrying either is not one version 7 wrote, and is refused.
Version 9 made a run work in parallel up to its ceiling (ruling DR6, spc-2609202134341288): a lane's `awaits`, a list replacing the one `awaiting`, the run's `waiting`, a lane's `syncs` and `hold`, a pending step's `needs`, and the lane stages `held` and `discarded`. A file of version 8 or lower reads as a run whose lanes each await zero or one agent (its `awaiting` becomes a one-entry `awaits`) and is written back at version 9; a landing's `check_wait_since` (ruling DR6d-2) is version 9's too, added before any release wrote the version; one of them carrying anything only version 9 writes is refused, and so is a file of version 9 or later carrying `awaiting`, which no version since 8 writes.
Version 10 added an await's `kept` (iss-2610100913086397): why a rate-limit checkpoint kept the await when it could not save the gone agent's return aside, which `--restart` re-tells. Version 9 is its strict subset, read as a run no rate limit kept an await of and written back at version 10; a file of version 9 or lower carrying `kept` is not one its version wrote, and is refused. Releases that write version 9 (up to v0.13.4) decode a newer file strictly before they check its version: a version-10 file carrying `kept` reaches them as a file that does not parse, with a remedy to restore it or remove the run directory, and one without `kept` as a version they do not know.
Version 11 added the run's reservation on the shared remote (itd-2609091034175565, spc-2610031753359849 spec 2): the run's `reserved_at`, which `implement step` renews, fences and tombstones. Version 10 is its strict subset, read as a run that holds no reservation and written back at the current version; a file of version 10 or lower carrying `reserved_at` is not one its version wrote, and is refused.
Version 12 added an await's `answered` (itd-6): the reviewer route and the SHA-256 of the answer its step placed at the await's return path, under the run's lock, so the receipt records the review as the route's when the return its verifier reads is that answer. Version 11 is its strict subset, read as a run no route placed an answer for, its `reserved_at` kept, and written back at version 12; a file of version 11 or lower carrying `answered` is not one its version wrote, and is refused. Releases that write version 10 (v0.14.0 and v0.14.1), and builds that write version 11, decode a newer file strictly before they check its version: a version-12 file carrying `answered` or `reserved_at` reaches them as a file that does not parse (`unknown field`), with a remedy to restore it or remove the run directory, which would throw the run away; the run is intact, and the newer abcd that wrote it reads it. A version-12 file carrying neither reaches them as a version they do not know. From version 12 on, decodeState refuses a version above its own before any strict decode, so whatever a later version adds is read as a newer abcd's file, never as one that does not parse.
Version 13 added a lane's `refused` (spc-2610161044461448 step 5): an issue run's lane logs its run of refused steps, which a drain reads to hand a stuck lane back. Version 12 is its strict subset, read as a run whose lanes have refused nothing and written back at the current version; a file of version 12 or lower carrying `refused` is not one its version wrote, and is refused. Releases that write version 12 refuse a version-13 file as a newer abcd's.
Version 14 added both sides of a run (itd-166): a runner's route record on a verified receipt or a validator's return carries the model the runner asked for, the prompt's hash, the served models, provider, finish reason and harness version the harness reported, the token counts and cost, and the fields it could not pin (runner.Sides). Version 13 is its strict subset, read as a run whose routes recorded neither side, its lanes' `refused` kept, and written back at the current version; a file of version 13 or lower carrying either side is not one its version wrote, and is refused. Releases that write version 13 (v0.15.1) refuse a version-14 file as a newer abcd's before any strict decode.
Version 15 added the run's review set (itd-2610240922461281, spc-2610240951109420 step 1): the run's `review`, each role's reviewers at their model classes, the judge and the ceiling, with the layer of each. Version 14 is its strict subset, read as a run started before review sets, which carries none, and written back at the current version; a file of version 14 or lower carrying `review` is not one its version wrote, and is refused. Releases that write version 14 refuse a version-15 file as a newer abcd's.
Version 16 added a route's pins: a pinned opencode run's route carries its pin and the SHA-256 of the sealed configuration that held it (`provider_pin`, `pin_config_sha256`, iss-2610161734413178), and a route to a model on this machine its local pin, what its server reported and that it is local (`local_pin`, `local_served`, `local`, iss-2610161734428291). Version 15 is its strict subset, read as a run whose routes were pointed at no pin, its review set kept, and written back at version 16; a file of version 14 or 15 carrying any of them is not one its version wrote, and is refused naming the key, and one of version 13 or lower carrying any of them is refused with the sides it carries. Releases that write version 15 refuse a version-16 file as a newer abcd's before any strict decode. A route record's `override` (iss-2610161801358637), the `implement step --route` text verbatim on the verified receipt or the validator's return a runner ran under it, is version 16's too: it joined version 16 before any release wrote that version, so a file of version 15 or lower carrying it is not one its version wrote, and is refused naming the key. So is a validation round's `routes` (spc-2609251028149555, AC 10): the tier each role of the round ran at, the tier a failed round moved it up from, and the failing gate output that caused the switch.
Version 17 added a lane's `auto_plan` (spc-2609202134338445 step 11, adr-2610310235000654): the `abcd build --auto-plan` lane's draft and its digest, its two plan reviews with the verdicts the loop recorded, and the planned record and spec, beside the stages `plan-review` and `plan`. Version 16 is its strict subset, read as a run with no auto-plan lane and written back at version 17; a file of version 16 or lower carrying `auto_plan` is not one its version wrote, and is refused naming it. Releases that write version 16 refuse a version-17 file as a newer abcd's before any strict decode.
Version 18 added an await's `paused` and `running` (iss-2611012047534449, dcn-2611012113432054): why a role waits for the runner that failed to start it, rather than being handed to the host, and the runner a step started for it, claimed so no second step starts another. Version 17 is its strict subset, read as a run no runner paused and none holds, and written back at version 18; a file of version 17 or lower carrying either is not one its version wrote, and is refused naming it. Releases that write version 17 refuse a version-18 file as a newer abcd's before any strict decode.
Version 19 added a fallback receipt's `spent` (iss-2611021751406429): what a launch killed past its time or with its step spent, read from its transcript, or the agent run it is charged when that shows no cost. Version 18 is its strict subset, read as a run no killed launch fell back from, and written back at version 19; a file of version 18 or lower carrying it is not one its version wrote, and is refused naming it. Releases that write version 18 refuse a version-19 file as a newer abcd's before any strict decode.
Version 20 keyed a round by reviewer (itd-2610240922461281, spc-2610240951109420 step 3): a validator's `reviewer` index among its role's reviewers, the `class` the run's review set asked it for, the `model` the class resolved to and its `model_status` (asked, reported by the runner that ran it, or unsent when the reviewer route answered); an await's `reviewer`, `class` and `model`; and a round's `comparisons`, how each role's reviewers compared once all of them returned. Version 19 is its strict subset, read as a run whose rounds each ran one reviewer per role: that reviewer is index 0, at the path index 0 still takes, and asked for no class. It is written back at version 20; a file of version 19 or lower carrying any of them is not one its version wrote, and is refused naming it. Releases that write version 19 refuse a version-20 file as a newer abcd's before any strict decode.
const StageClaim = "claim"
StageClaim is the refusal stage of a start whose shared-run claim is refused for a reason of the caller's own (a session that has not joined, a bound).
const StageConfig = "config"
StageConfig is the refusal stage of a step the run tripwire stopped.
const StageDrain = "drain"
StageDrain is the refusal stage of the drain run.
const StageKilled = "killed"
StageKilled is the record's stage for a role killed after its work stood: the lane is kept at its stage for its receipt, not paused.
const StagePace = "pace"
StagePace is the refusal stage of a pace or ceiling the loop cannot run on.
const StagePick = "pick"
StagePick is the refusal stage of a pick that takes nothing.
const StageRefused = "refused"
StageRefused is the run record's stage for a lane's refused step.
const StageReservationLost = "reservation_lost"
StageReservationLost is the run record's stage for a reservation the view shows held by another person or copy.
const StageReview = "review"
StageReview is the refusal stage of the reviewer route.
const StageRoute = "route"
StageRoute is the record's stage for a --route the step did not use.
const StageRouting = "routing"
StageRouting is the refusal stage of a routing table or provider configuration the step cannot read.
const StageUnpaused = "unpaused"
StageUnpaused is the record's stage for a paused role the person has since routed to the host: the pause is cleared and the host's agent takes it.
const StateFileName = "state.json"
StateFileName is the name of a run's state file inside its directory.
const SyncDirName = "sync"
SyncDirName is the lane's directory a sync's brief and receipt live in.
const TierRelDir = landing.TierRelDir
TierRelDir is the local-ephemeral tier the run state lives in, the tier the preflight's receipts live in too (landing.TierRelDir). It is never created here.
const VerdictUnachievable = "unachievable"
VerdictUnachievable is the verdict a lane is handed back with: the run's fix rounds could not bring it to a passing round (itd-50's UNACHIEVABLE).
Variables ¶
var BundledClasses = map[string]string{ ClassTop: "anthropic/claude-fable-5", ClassMiddle: "anthropic/claude-opus-5-5", ClassBelow: "anthropic/claude-sonnet-5-5", ClassSmallest: "anthropic/claude-haiku-4-5", }
BundledClasses is the bundled class map: one vendor's models, a default and not part of the rule (decision 3). For that vendor today the classes are Fable, Opus, Sonnet and Haiku (iss-2610140652230444).
var BundledReviewers = []string{ClassMiddle, ClassBelow}
BundledReviewers is the bundled list each role runs: the middle class and the class below it, the pair the first paired reviews used (decision 1).
var Classes = []string{ClassTop, ClassMiddle, ClassBelow, ClassSmallest}
Classes are the class names the class map carries, top first.
var PlanSequence = []Stage{StagePlanReview, StagePlan}
PlanSequence is an auto-plan lane's stages (autoplan.go): its two plan reviews, then the plan.
var Sequence = []Stage{StageWorktree, StageBrief, StageImplement, StageValidate, StageLand}
Sequence is the lane's stages in the order the loop performs them: make the lane's worktree, render its brief, hand it to an implementer and take the receipt, run the validators, land it. A lane past its last stage is StageDone.
Functions ¶
func AcceptConfigChange ¶ added in v0.14.0
AcceptConfigChange re-records the run's fingerprint from the repository as it stands, on the person's word once they have looked at what changed (`abcd implement step --accept-config-change`), and names in the run record each key or file it accepted. It returns those names; nothing changed (or a run with no fingerprint yet) accepts nothing and records the fingerprint alone.
func ConfigTripwire ¶ added in v0.14.0
ConfigTripwire checks every run in progress in the checkout, as a step would, for a git step taken outside a run's own step (the shared network probe `abcd implement outage probe` runs): the first changed run refuses it.
func CurrentOutage ¶ added in v0.13.4
CurrentOutage is the shared run's outage in force for the checkout, nil when there is none or the checkout has no shared run state. It writes nothing.
func DrainSummaryLine ¶ added in v0.12.0
func DrainSummaryLine(r DrainRoute) string
DrainSummaryLine is a route in one line, for the text surfaces.
func HeldWorktrees ¶ added in v0.16.0
HeldWorktrees is what the build loop holds in the worktree store, for the store's prune (spc-2609301811532881): every lane of a run whose state is not complete, by the name laneName gives it in the store, read across the local tier of every checkout git lists for the repository, because a run's state lives in the checkout that started it. A state file that cannot be read holds every worktree named after its run; a run directory that cannot be listed fails the read, so prune removes nothing. It is a worktree.HeldReader.
func JudgementSummary ¶ added in v0.14.0
func JudgementSummary(j DrainJudgement) string
JudgementSummary is a judgement in one line, for the text surfaces.
func LatestRun ¶ added in v0.12.0
LatestRun names the run a record read addresses when none is named: the one run in progress when there is one, else the most recently started run in this checkout. Several runs in progress are refused, naming them; a handed-back issue run a newer run of the issue followed is not one (superseded).
func LoadRunners ¶ added in v0.12.0
LoadRunners reads the runner configuration (runner.Load) at the roots a lane starts from, and refuses in the loop's refusal shape on any fault, a model route its provider's allowlist does not admit included, before a run is created or a runner launched (itd-2609201916056194 criterion 5). The configuration's diagnostics are the caller's to print.
func ReleaseReservation ¶ added in v0.15.0
ReleaseReservation is `abcd build <id> --release`: it pushes a tombstone over this person's reservation on id from this copy, and changes nothing in any run's state; a later step of the run meets the release at the land fence (C36). A key that is not an intent or issue id is refused by name.
func Resolve ¶
Resolve names the run a call addresses. An explicit id is checked for shape and presence; no id addresses the one run in this checkout that is not complete, and is refused naming them when there are several, or none. An issue run handed back that a newer run of the issue has followed (superseded) is not counted: the newer run is the issue's.
func RunCountRefusal ¶ added in v0.14.2
RunCountRefusal is the pick's refusal of a --max below 1, which names no run count. Next refuses a negative Max with it; Max reads 0 when --max is not given, so a front door refuses an explicit --max 0 with it before calling Next, rather than let it read as no count (iss-2610121210280182).
func StateRelPath ¶
StateRelPath is a run's state file, relative to the checkout root.
func StatusLanes ¶ added in v0.12.0
func StatusLanes(repoRoot string) ([]statusblock.Started, error)
StatusLanes is the state file read the status block's Now takes (itd-2609212103568351): one entry per run in progress, naming its intent and every lane of it alive (ruling DR6) — each lane's next stage and the roles it waits on, a held lane included — or, while no lane is alive and a spec step still waits, the run with its stage "pending". A complete run is not in a lane. An absent tier or run directory holds none. It is a statusblock.LaneReader.
func StatusPeers ¶ added in v0.12.0
func StatusPeers(repoRoot string) (statusblock.HeldBy, error)
StatusPeers is the peers read the status block's head takes (ruling CC1 of 2026-09-29): build next's own peers check, read once for the block and judged per intent, so the board's "next up" passes over exactly the intents another checkout holds that the pick passes over. It judges on behalf of no session, so every live claim is a peer's. A peer the listing cannot read fails closed on each record, as it does for the pick. It is a statusblock.PeerReader.
func ValidLaneID ¶
ValidLaneID reports whether id is a lane id the loop opens.
func ValidRunID ¶
ValidRunID reports whether id is a run id this package mints.
Types ¶
type AliveLane ¶ added in v0.13.0
type AliveLane struct {
Lane string `json:"lane"`
SpecStep int `json:"spec_step"`
Stage Stage `json:"stage"`
Awaits []Await `json:"awaits"`
Hold *Hold `json:"hold,omitempty"`
// Waiting is the lane's wait for its full check, with the time it began
// (ruling DR6d-2); empty when it waits for none.
Waiting string `json:"waiting,omitempty"`
}
AliveLane is one lane of a run with anything left, as a result reports it.
type AuditRun ¶ added in v0.12.0
type AuditRun struct {
ReceiptID string `json:"receipt_id"`
Request string `json:"request"`
// BaseSHA..HeadSHA is the whole delivery: from the base of the run's first
// lane to this lane's head.
BaseSHA string `json:"base_sha"`
HeadSHA string `json:"head_sha"`
// Worst, NotMet and Inconclusive are read from the verdict.
Worst string `json:"worst,omitempty"`
NotMet []string `json:"not_met,omitempty"`
Inconclusive []string `json:"inconclusive,omitempty"`
}
AuditRun is the fidelity audit the lane that closes the spec takes, once, over the whole delivery (ruling AI): the receipt the close parks for the same record, the request, the range it reads, and what the loop read from the verdict. The verdict itself is the return the run names; the close consumes it (piece 9).
type AutoPlan ¶ added in v0.16.1
type AutoPlan struct {
// Draft is the draft's path when the run started, relative to the
// checkout root, and Digest the "sha256:<hex>" of its bytes then.
Draft string `json:"draft"`
Digest string `json:"digest"`
// Checkout is the "sha256:<hex>" of the checkout as the start found it:
// its HEAD, its index's entries and their flags, and its working tree
// outside the local tier (checkoutDigest).
Checkout string `json:"checkout"`
// Reviews are the two reviews, the design lens first.
Reviews []PlanReview `json:"reviews"`
// Planned and Spec are the planned record's path and the spec plan
// minted; empty until the plan stage ran.
Planned string `json:"planned,omitempty"`
Spec string `json:"spec,omitempty"`
// UncopiedIndex is why the start's checkout digest did not copy the
// checkout's index (indexNotRegular, indexReplaced or indexPastBound), and
// empty when it copied it. A digest of an uncopied index never matches
// again, so the end check could only hand the lane back: the lane's first
// step hands it back at once, before any plan review is handed out.
UncopiedIndex string `json:"uncopied_index,omitempty"`
// PlanStarted is written, with both reviews passing and the substitute
// checked again, by the plan stage's first step, before the step that
// runs `intent plan`. Only a begun plan records what it made; a record
// found in planned/ is never taken as this run's plan, and the mark only
// says, in the hand-back, whether this run might have made it.
PlanStarted bool `json:"plan_started,omitempty"`
}
AutoPlan is an auto-plan lane's record: the draft as the start checked it, each review with the verdict the loop parsed from its return, and what the plan made.
type Await ¶
type Await struct {
// Role is the agent the host starts: an implementer, or a validator that
// did not implement.
Role string `json:"role"`
// Brief is the file the agent is handed.
Brief string `json:"brief"`
// Receipt is where the agent writes its receipt; `implement receipt` is
// called with this path.
Receipt string `json:"receipt"`
Since time.Time `json:"since"`
// Kept is why a rate-limit checkpoint kept the await: its agent is gone,
// but what it left could not be saved aside (ratelimit.go). A restart
// re-tells an await so marked; "" for every other await.
Kept string `json:"kept,omitempty"`
// Answered is the reviewer route's answer its step placed at Receipt
// (itd-6), recorded under the run's lock as it placed it; nil for every
// other await, the host's included.
Answered *RouteAnswer `json:"answered,omitempty"`
// Paused is why the role waits for its runner, which failed to start it
// (runner_pause.go): it is handed to no one, the host included, and a
// later step retries it; nil for every other await.
Paused *RunnerPause `json:"paused,omitempty"`
// Running is the runner a step started for the role, claimed under the
// lock so no other step starts a second one; nil when none is running.
Running *RunnerClaim `json:"running,omitempty"`
// Reviewer, Class and Model name a review set's reviewer (reviewers.go):
// its index among its role's reviewers, the class it is asked for and the
// <provider>/<model> route the class resolves to, which a runner is
// handed as the request's model and a host is asked to start the agent
// on. Nil and empty for every other await.
Reviewer *int `json:"reviewer,omitempty"`
Class string `json:"class,omitempty"`
Model string `json:"model,omitempty"`
}
Await is what a lane waits on: the agent a host must start, the brief it is handed and the receipt it writes.
type CandidateSet ¶ added in v0.12.0
type CandidateSet struct {
// Candidates pass every check, in the pick order.
Candidates []intent.PickCandidate `json:"candidates"`
// Excluded fail one, in record order.
Excluded []Excluded `json:"excluded"`
}
CandidateSet is the pick's view of the planned intents.
type CheckResult ¶
type CheckResult struct {
Key string `json:"key"`
Intent string `json:"intent,omitempty"`
Spec string `json:"spec,omitempty"`
OK bool `json:"ok"`
Checks []CheckRow `json:"checks"`
// contains filtered or unexported fields
}
CheckResult is every pre-start check for one key.
func Check ¶
func Check(repoRoot, key string) (CheckResult, error)
Check runs the pre-start checks for key against the checkout at repoRoot. It returns an error only for a fault in reading this checkout (the store will not load, git will not answer); a record that may not start is a result with OK false.
The rows, in order:
- key: an intent id, or an issue id (decision 10's key). An issue key takes two rows after it and no others: eligible (the drained repository's own rule takes the issue, as `abcd drain` reads it) and peers (no peer holds it out of open/, and no session claims it).
- ready: the implement-readiness gate (intent.Ready) — planned, criteria, the spec linked and written. Its advisory rows stay advisory here.
- open_questions: no open question under `## Open Questions` (intent.StartChecksIn: every list item, less the settled markers).
- claim_sections: no unanswered claim section — the mechanism prompt answered or the section absent, the scope conditions recorded.
- hold: no `held:` on the record (iss-2609200830076665).
- blocked: nothing the record names in `blocked_by` is unshipped (itd-2609211116005482: an intent with an unshipped blocker is not one a run may take); a superseded blocker is followed along `superseded_by` to its replacement, transitively (ruling BZ2 of 2026-09-29).
- steps: the spec's `## Steps` reads, and leaves a step to build.
- peers: no peer holds the record — no sibling worktree or local branch holds it in another bucket having changed it since its merge-base with this checkout, no session holds a live claim on it, and, for an intent, no other copy holds a reservation on it on origin as this checkout last fetched them (read from disk alone).
type CheckRow ¶
type CheckRow struct {
Name string `json:"name"`
OK bool `json:"ok"`
Detail string `json:"detail"`
Remedy string `json:"remedy,omitempty"`
// contains filtered or unexported fields
}
CheckRow is one pre-start check's verdict.
type Checkpoint ¶ added in v0.14.0
type Checkpoint struct {
Lane string `json:"lane"`
Branch string `json:"branch"`
// Head is the branch's last commit, "" when git cannot name it.
Head string `json:"head"`
// Aside is where the rate-limited agent's uncommitted work and partial
// receipt were saved, relative to the checkout root; "" for a lane whose
// agents were not the ones limited.
Aside string `json:"aside,omitempty"`
// Out are the roles of the lane's agents still out after the checkpoint,
// each of which may hand back its receipt inside the pause.
Out []string `json:"out"`
// Kept is why the limited agent's await was kept and its worktree left as
// it was (the save aside was refused); "" when it was not.
Kept string `json:"kept,omitempty"`
}
Checkpoint is one lane with work in flight, as a rate limit left it.
type Comparison ¶ added in v0.16.1
type Comparison struct {
Role string `json:"role"`
Reviewers int `json:"reviewers"`
Outcome string `json:"outcome"`
// Verdicts are the role's verdicts, in reviewer order, as the loop
// recorded them.
Verdicts []string `json:"verdicts"`
}
Comparison is how one role's reviewers in a round compared once every one of them had returned (reviewers.go): Outcome is ComparisonAgree, ComparisonDisagree (one verdict passes and another fails), or ComparisonNone when the role ran one reviewer, so no comparison was made. The round's verdict does not hang on it: any failing reviewer fails the round, which is the stricter verdict.
type Context ¶
type Context struct {
RepoRoot string
// RunDir is the run's directory, relative to RepoRoot.
RunDir string
State State
Now time.Time
// Await is the await a verifier is handed the receipt of; nil for a body.
Await *Await
// Route is the route that ran the agent whose receipt a verifier is
// handed, when a runner ran it, with the model the runner reported; nil
// for a body, a host-run agent and a placed answer (iss-2611022247103872).
Route *runner.RouteRecord
// contains filtered or unexported fields
}
Context is what a stage's body is handed: where the checkout and the run live, the run as it stood before the stage, and the clock.
type DoDRun ¶
type DoDRun struct {
Command string `json:"command"`
ExitCode *int `json:"exit_code"`
// Output is the run's whole output, a path inside the lane's directory.
Output string `json:"output"`
}
DoDRun is one run of the definition of done.
type DrainCounts ¶ added in v0.14.0
type DrainCounts struct {
LanesOpened int `json:"lanes_opened"`
InProgress int `json:"in_progress"`
// PullRequests are the lanes whose landing opened a pull request, done
// or not; whether one merged is a person's gate, and not counted.
PullRequests int `json:"pull_requests"`
LanesHandedBack int `json:"lanes_handed_back"`
// Promotions, DecisionRecords and Homes are the hand-backs the drain
// routed, from its lanes and from the host judgement, by route.
Promotions int `json:"promotions"`
DecisionRecords int `json:"decision_records"`
Homes int `json:"homes"`
// RuleFlags are the rule's hand-backs over the ledger as this call read it,
// less the issues this drain promoted itself, which Promotions counts.
RuleFlags int `json:"rule_flags"`
Judgements int `json:"judgements"`
Passed int `json:"passed"`
Spend DrainSpend `json:"spend"`
}
DrainCounts are the drain's totals (itd-82 scope 8): its lanes by outcome, the pull requests they opened, its hand-backs by route, the rule's flags, the host judgements, the issues this call passed over, and the spend.
type DrainFinished ¶ added in v0.14.0
type DrainFinished struct {
Issue string `json:"issue"`
RunID string `json:"run_id"`
PR int `json:"pr,omitempty"`
Done bool `json:"done"`
Note string `json:"note"`
}
DrainFinished is one merged lane a drain move took the landing's last step for: Done when its worktree and branch were removed and the lane marked done, otherwise Note says why the landing refused.
type DrainHold ¶ added in v0.15.1
type DrainHold struct {
Commit string `json:"commit"`
ClaimedAt time.Time `json:"claimed_at"`
ExpiresAt time.Time `json:"expires_at"`
ForkUnchecked string `json:"fork_unchecked,omitempty"`
ForkAllowed string `json:"fork_allowed,omitempty"`
}
DrainHold is a reservation the drain took on an issue to judge it: the commit its push made, and when it was claimed and lapses. The drain releases that commit and no other, so a reservation this person made or renewed by hand since is left as it stands. ForkUnchecked and ForkAllowed are the fork check the act could not make or waived (claim's Result), kept so the lane a no opens on the hold says so as a lane that reserved for itself does (spc-2610161044461448 step 10).
type DrainJudgement ¶ added in v0.14.0
type DrainJudgement struct {
Issue string `json:"issue"`
RemedySHA256 string `json:"remedy_sha256"`
Answer string `json:"answer"`
Kind string `json:"kind,omitempty"`
Reason string `json:"reason"`
Applied bool `json:"applied"`
Note string `json:"note,omitempty"`
At time.Time `json:"at"`
// Hold is the reservation the answer was asked on, nil when the drain
// took none: the lane a no opens on it, in this move or a later one,
// names the fork check it could not make or waived.
Hold *DrainHold `json:"hold,omitempty"`
// Route is the runner that answered, when the drain's judge is routed to
// one (drain_judge.go); nil for the host's answer.
Route *runner.RouteRecord `json:"route,omitempty"`
}
DrainJudgement is one answer the drain took: the question's answer, the kind a yes names, the host's reason, and whether it decided the issue's disposition (Applied) or, the issue having left the eligible set since the request, decided nothing (Note says why).
type DrainJudging ¶ added in v0.14.0
type DrainJudging struct {
Issue string `json:"issue"`
RemedySHA256 string `json:"remedy_sha256"`
Request string `json:"request"`
Answer string `json:"answer"`
RequestedAt time.Time `json:"requested_at"`
// Hold is the reservation the drain took on the issue to ask this
// judgement; nil when it took none (no origin, or this person already
// held the issue from this copy, which is theirs and never the drain's
// to release).
Hold *DrainHold `json:"hold,omitempty"`
// RoutedAsked and AdapterAsked mark who was asked this request and did
// not answer, so the polls that follow while the host's request stands
// ask neither again. RoutedAsked is the judge routed to a runner, true
// once its runner was started (drain_judge.go): a judge that never
// started (its directory not made, its request refused before any
// launch) leaves it false, so the next move starts it. AdapterAsked is
// the decision adapter, with eligibility-residual turned on, true once
// it was asked and gave no answer the move could take (drain_decide.go).
// Each is marked alone, so a failed adapter never stands for a runner
// that never started.
RoutedAsked bool `json:"routed_asked,omitempty"`
AdapterAsked bool `json:"adapter_asked,omitempty"`
}
DrainJudging is the judgement the drain awaits before it opens an issue's lane: the issue, the digest of the remedy the request showed, and where the request and the answer are.
type DrainLane ¶ added in v0.12.0
type DrainLane struct {
Issue string `json:"issue"`
RunID string `json:"run_id"`
OpenedAt time.Time `json:"opened_at"`
Outcome string `json:"outcome"`
PR int `json:"pr,omitempty"`
}
DrainLane is one issue the drain handed to a lane.
type DrainLapse ¶ added in v0.15.1
type DrainLapse struct {
Issue string `json:"issue"`
RequestedAt time.Time `json:"requested_at"`
LapsedAt time.Time `json:"lapsed_at"`
DroppedAt time.Time `json:"dropped_at"`
}
DrainLapse is a judgement request the drain dropped unanswered: its issue, when it was asked, when the hold taken for it lapsed, and when the move that dropped it released that hold. The issue is not asked again before its cool-down has passed (coolDownEnds), so another account has a window to take it, and then only after the drain's other eligible work; the entry is pruned once the issue is asked again or answered.
type DrainOptions ¶ added in v0.12.0
type DrainOptions struct {
// Max is --max as typed; 0 when not given, which is all.
Max int
// Judgement is --judgement: the path of the host's answer to the
// judgement the drain awaits; empty when not given.
Judgement string
// Transcripts is where a routed judge's transcript lands
// (drain_judge.go); nil leaves the judgement on the host's request,
// routed or not.
Transcripts runner.TranscriptStore
// JudgeTimeout bounds one routed judgement; drainJudgeTimeout when zero.
JudgeTimeout time.Duration
// Context ends the move's routed judge: the front door ends it on an
// interrupt or a termination. context.Background when nil.
Context context.Context
// Skip are --skip's targets, issue ids or paths, held back for now with
// SkipReason, --reason; Unskip are --unskip's, taken off the list
// (drain_skip.go).
Skip []string
SkipReason string
Unskip []string
}
DrainOptions are the drain's own flags.
type DrainOrigin ¶ added in v0.15.1
type DrainOrigin struct {
// Ref is the branch as a person names it (origin/main), and Commit its
// commit as fetched.
Ref string `json:"ref"`
Commit string `json:"commit"`
// FetchedAt is when abcd last fetched here, nil when nothing here stamped
// a fetch; AgeMinutes is the view's age then, at the plan's time.
FetchedAt *time.Time `json:"fetched_at"`
AgeMinutes int `json:"age_minutes"`
// Behind counts the commits of Ref this checkout's HEAD lacks.
Behind int `json:"behind"`
// Finished are the issues open in this checkout's ledger that Ref holds
// resolved or wontfix: the work a stale checkout would repeat.
Finished []string `json:"finished"`
}
DrainOrigin is the view of origin's default branch a plan was read from.
type DrainOriginWait ¶ added in v0.15.1
type DrainOriginWait struct {
Since time.Time `json:"since"`
Kind string `json:"kind"`
Probes int `json:"probes"`
NextProbeAt time.Time `json:"next_probe_at"`
// HourlySince is the probe that began the hourly stage, nil before it.
HourlySince *time.Time `json:"hourly_since,omitempty"`
}
DrainOriginWait is a drain waiting on origin: since when, why (one of the DrainOrigin* kinds), the probes that failed, and when the next is due.
type DrainParked ¶ added in v0.15.1
type DrainParked struct {
Issue string `json:"issue"`
RunID string `json:"run_id"`
PR int `json:"pr"`
State string `json:"state"`
Note string `json:"note"`
}
DrainParked is one lane parked at land whose head is not on the default branch, as the move read its pull request (spc-2610161044461448 step 8).
type DrainPendingHandBack ¶ added in v0.15.1
type DrainPendingHandBack struct {
Issue string `json:"issue"`
Kind string `json:"kind"`
Blob string `json:"blob,omitempty"`
Why string `json:"why"`
At time.Time `json:"at"`
}
DrainPendingHandBack is a hand-back a yes routed that the move could not publish on origin: its issue, its kind, the blob of the issue's record on origin's default branch the yes was judged over ("" when it could not be read), why it is pending, and when it was routed.
type DrainPreview ¶ added in v0.15.1
type DrainPreview struct {
capture.DrainPlan
Origin *DrainOrigin `json:"origin"`
OriginUnread string `json:"origin_unread,omitempty"`
// OrderDrawnAtFirstMove is true when this copy has no key yet, so the
// preview takes each group oldest first: this copy's own order within
// each group is drawn at its first move, which mints the key, and the
// dry run, which writes nothing, mints none.
OrderDrawnAtFirstMove bool `json:"order_drawn_at_first_move"`
}
DrainPreview is `abcd drain --dry-run`: the plan, and the view of origin it was read from. Origin is nil in two cases, and the plan is then the checkout's own ledger: in a checkout with no remote named origin, where OriginUnread is empty, since there is no origin to read; and when origin's default branch as last fetched cannot be read (this checkout names none, or its commit does not resolve), where OriginUnread says why.
func DrainDryRun ¶ added in v0.15.1
func DrainDryRun(repoRoot string, now time.Time) (DrainPreview, error)
DrainDryRun plans the drain as its next move would, from origin's default branch as last fetched, and fetches and writes nothing.
type DrainResult ¶ added in v0.12.0
type DrainResult struct {
State string `json:"state"`
// Started is true when this invocation began a new drain.
Started bool `json:"started"`
Rule string `json:"rule"`
Loosened []string `json:"loosened"`
Order string `json:"order"`
Max int `json:"max"`
Pace *Pace `json:"pace"`
// Lanes are every lane the drain opened, with its outcome as last read.
Lanes []DrainLane `json:"lanes"`
// Lane is the lane in progress after this call, if any.
Lane *DrainLane `json:"lane"`
// Start is the run this call started, when it opened a lane.
Start *StartResult `json:"start"`
// Routed are the hand-backs this call routed; HandBacks every one the
// drain has routed; Flags the rule's hand-backs over the ledger as this
// call read it, each naming its rule, written nowhere, less the issues
// this drain promoted itself (fieldFlags).
Routed []DrainRoute `json:"routed"`
HandBacks []DrainRoute `json:"hand_backs"`
Flags []DrainRoute `json:"flags"`
// Judging is the host judgement the drain awaits after this call, if any;
// Judged the answer this call took; Judgements every answer the drain
// has taken, each with whether it decided the issue's disposition.
Judging *DrainJudging `json:"judging"`
Judged *DrainJudgement `json:"judged,omitempty"`
Judgements []DrainJudgement `json:"judgements"`
// Passed are eligible issues this call did not take, each with why.
Passed []Excluded `json:"passed"`
Dispositions []capture.DrainVerdict `json:"dispositions"`
NextEligibleAt *time.Time `json:"next_eligible_at"`
// WaitingUntil is when a drain waiting at the cap, or on held work alone,
// looks again, and Waiting which it waits on (drain_wait.go).
WaitingUntil *time.Time `json:"waiting_until"`
Waiting string `json:"waiting,omitempty"`
Stopped string `json:"stopped,omitempty"`
Complete bool `json:"complete"`
// Finished are the merged lanes this call took the landing's last step
// for, outside the window clock (drain_finish.go).
Finished []DrainFinished `json:"finished"`
// Parked are the lanes parked at land whose head is not on the default
// branch, each as its pull request read (drain_finish.go).
Parked []DrainParked `json:"parked"`
// Counts are the drain's totals as this call leaves it (scope 8).
Counts DrainCounts `json:"counts"`
Next string `json:"next"`
// Origin is the view of origin's default branch this move planned from,
// and OriginWait the wait a move that could not read it is in
// (drain_origin.go); both nil in a checkout with no remote named origin.
Origin *DrainOrigin `json:"origin,omitempty"`
OriginWait *DrainOriginWait `json:"origin_wait,omitempty"`
// PendingHandBacks are the hand-backs routed and not yet published on
// origin, as this call leaves them (drain_pending.go).
PendingHandBacks []DrainPendingHandBack `json:"pending_hand_backs,omitempty"`
// Skips is the drain's skip list as this call leaves it: empty once the
// drain has ended, which clears it (drain_skip.go).
Skips []DrainSkip `json:"skips"`
}
DrainResult is one drain invocation's summary.
func Drain ¶ added in v0.12.0
func Drain(repoRoot string, o Options, d DrainOptions) (DrainResult, error)
Drain performs one move of the drain run: it begins a drain when none is in progress, honours the window clock, routes the last lane's outcome, and opens the next eligible issue's lane, or says why it opens none. A drain without the repository's rule is refused before anything is written.
type DrainRoute ¶ added in v0.12.0
type DrainRoute struct {
Issue string `json:"issue"`
// From is "lane" for a lane's hand-back, "judgement" for the host
// judgement's before any lane opened, "reservation" for an issue the
// drain could not reserve (its found_at names no path), "field" for the
// rule's.
From string `json:"from"`
Kind string `json:"kind"`
Route string `json:"route"`
// Draft is the intent draft a promotion made; Question the question a
// decision-record flag states; Rule the rule a field hand-back names; Home
// the home a flag names.
Draft string `json:"draft,omitempty"`
Question string `json:"question,omitempty"`
Rule string `json:"rule,omitempty"`
Home string `json:"home,omitempty"`
Reason string `json:"reason"`
// Wrote is the record change the route made, in words; "nothing" for a
// flag.
Wrote string `json:"wrote"`
At *time.Time `json:"at,omitempty"`
// Blob is the blob id of the issue's record on origin's default branch
// when the hand-back was routed, "" without origin: once that record
// changes, the drain takes the issue up again (drain_readmit.go).
Blob string `json:"blob,omitempty"`
}
DrainRoute is one hand-back and where it went.
type DrainSkip ¶ added in v0.16.0
type DrainSkip struct {
Target string `json:"target"`
Reason string `json:"reason"`
At time.Time `json:"at"`
}
DrainSkip is one entry of the drain's skip list: an issue id, or a repository-relative path that holds back every issue whose found_at path lies in it or contains it, with the person's reason and when it was given.
type DrainSpend ¶ added in v0.14.0
type DrainSpend struct {
AgentRuns int `json:"agent_runs"`
Implementers int `json:"implementers"`
Validators int `json:"validators"`
Unread []string `json:"unread"`
}
DrainSpend is what the drain's lanes have spent, in agent runs, the unit the budget check estimates a run in: each implementer's receipt the loop verified (the implement stage's, each fix round's, a hand-back's) and each validator's return it parsed a verdict from. No runner reports tokens or money, so neither is counted. Unread names a lane's run whose state could not be read, which makes the counts a floor.
type DrainState ¶ added in v0.12.0
type DrainState struct {
SchemaVersion int `json:"schema_version"`
StartedAt time.Time `json:"started_at"`
UpdatedAt time.Time `json:"updated_at"`
// Rule is the decision record the rule was read from when the drain began.
Rule string `json:"rule"`
// Max is the cap on lanes the drain opens; 0 is all (the default).
Max int `json:"max"`
// Pace is the pace the drain started on; its window and pause bound the
// drain as they bound a run.
Pace *Pace `json:"pace"`
WindowStartedAt *time.Time `json:"window_started_at,omitempty"`
NextEligibleAt *time.Time `json:"next_eligible_at,omitempty"`
Lanes []DrainLane `json:"lanes"`
HandBacks []DrainRoute `json:"hand_backs"`
// Judging is the host judgement the drain awaits before it opens the next
// issue's lane (scope 3), and Judgements every answer it has taken.
Judging *DrainJudging `json:"judging,omitempty"`
Judgements []DrainJudgement `json:"judgements,omitempty"`
// JudgeFallbacks are the receipts of every routed judgement a runner did
// not answer, each left to the host's request (drain_judge.go).
JudgeFallbacks []runner.FallbackReceipt `json:"judge_fallbacks,omitempty"`
// Lapsed are the judgement requests dropped unanswered once the hold the
// drain took for them lapsed, the latest last; their issues are asked
// again only once a cool-down has passed, and then only after the
// drain's other eligible work (drain_hold.go).
Lapsed []DrainLapse `json:"lapsed,omitempty"`
// PendingHandBacks are the hand-backs a yes routed whose tombstone the
// move could not publish (drain_pending.go); each is published over the
// issue's next release on origin, and carried into the next drain.
PendingHandBacks []DrainPendingHandBack `json:"pending_hand_backs,omitempty"`
// Stopped says why the drain ended, and EndedAt when; empty while it runs.
Stopped string `json:"stopped,omitempty"`
EndedAt *time.Time `json:"ended_at,omitempty"`
// OriginWait is the wait on origin a move that could not read it began
// (drain_origin.go); nil while origin answers.
OriginWait *DrainOriginWait `json:"origin_wait,omitempty"`
// WaitingUntil is when a drain waiting at its holder's cap, or on work
// others hold alone, looks again, and Waiting which of the two it waits
// on (DrainWaitCap, DrainWaitHeld); both empty otherwise. It is kept
// apart from NextEligibleAt, so a wait never resets the pace window
// (drain_wait.go).
WaitingUntil *time.Time `json:"waiting_until,omitempty"`
Waiting string `json:"waiting,omitempty"`
// Skips are the issues and paths a person holds back for now, each with
// its reason; the list clears when the drain ends (drain_skip.go).
Skips []DrainSkip `json:"skips,omitempty"`
}
DrainState is one drain, between invocations.
type Driver ¶
type Driver string
Driver names what drives the loop. The host session is decision 5's default; the process driver is piece 3's, opt-in by configuration.
const DriverHost Driver = "host"
DriverHost is a host session calling `implement step` and `implement receipt` itself.
type Entry ¶
type Entry struct {
At time.Time `json:"at"`
Lane string `json:"lane,omitempty"`
// Stage is the stage the entry records: a lane stage, "start", "open" (a
// later lane opened for its spec step) or "receipt".
Stage string `json:"stage"`
Note string `json:"note,omitempty"`
}
Entry is one line of the run record.
type Excluded ¶ added in v0.12.0
type Excluded struct {
ID string `json:"id"`
Check string `json:"check"`
Reason string `json:"reason"`
}
Excluded is a planned intent the pick did not consider, with the first check that excluded it.
type HandBack ¶ added in v0.12.0
type HandBack struct {
At time.Time `json:"at"`
// Kind, Reason and Home are set when the lane's own receipt handed the work
// back (itd-82 scope 5): the kind of decision it found, what it found, and
// where the decision belongs. Discarded is the lane's head the loop
// discarded with its worktree and branch. The fields below are then empty.
Kind string `json:"kind,omitempty"`
Reason string `json:"reason,omitempty"`
Home string `json:"home,omitempty"`
Discarded string `json:"discarded,omitempty"`
// Verdict is VerdictUnachievable.
Verdict string `json:"verdict,omitempty"`
// Round is the round that did not pass once the cap was reached, and
// FixRounds the cap the run held the lane to.
Round int `json:"round,omitempty"`
FixRounds int `json:"fix_rounds,omitempty"`
// Verdicts is the last round's verdicts as the loop recorded them, and
// Findings the returns of the validators that did not pass, relative to
// the checkout root.
Verdicts string `json:"verdicts,omitempty"`
Findings []string `json:"findings,omitempty"`
// NotMet and Undecided name the criteria the last audit judged not met and
// could not decide, when the lane took the audit.
NotMet []string `json:"not_met,omitempty"`
Undecided []string `json:"undecided,omitempty"`
}
HandBack is a lane stopped and handed back to the person, with what the last round found (ruling DR1 on itd-50's criterion 2).
type Handler ¶
Handler performs one stage for a lane, writing what it made into lane. It must be idempotent: a process killed after the body's effect and before the state write runs the body again on the next call, so a body finds what it made last time rather than making it twice. An error leaves the state as it was; a *Refusal error is passed to the caller as the refusal.
type Hold ¶ added in v0.13.0
type Hold struct {
Since time.Time `json:"since"`
Cause string `json:"cause"`
Head string `json:"head"`
Before string `json:"before"`
Released bool `json:"released,omitempty"`
}
Hold is a lane held after a sibling's hand-back (ruling DR6c): when, the handed-back lane that caused it, the head its passing round judged, and the landing step it stopped before (HoldBeforePush or HoldBeforeArm). Released is set once the person released it to land as it is.
type JudgementAnswer ¶ added in v0.14.0
type JudgementAnswer struct {
SchemaVersion int `json:"schema_version"`
Issue string `json:"issue"`
RemedySHA256 string `json:"remedy_sha256"`
Answer string `json:"answer"`
Kind string `json:"kind,omitempty"`
Reason string `json:"reason"`
}
JudgementAnswer is the host's answer file, read strictly: any other field refuses it.
type Landing ¶ added in v0.12.0
type Landing struct {
// Closes is whether this lane's landing closes the spec (and ships the
// intent): the lane that took the fidelity audit.
Closes bool `json:"closes"`
// MarkStep is the spec step whose `- landed:` line the records write on
// the open spec (iss-2610110918418459): the lane's step, on an intent lane
// of a spec that lists its steps; 0 when there is none to mark.
MarkStep int `json:"mark_step,omitempty"`
// Records is the loop's records commit on the lane's branch, and
// RecordsDone is set once it is made, or once there was nothing to record.
Records string `json:"records,omitempty"`
RecordsDone bool `json:"records_done"`
// PreflightReceipt is the preflight receipt that named the pushed head,
// home-redacted, and Pushed the head the loop pushed.
PreflightReceipt string `json:"preflight_receipt,omitempty"`
Pushed string `json:"pushed,omitempty"`
// Body is the pull request's body as the loop composed it, relative to the
// checkout root; PRURL is the pull request, and BodyChecked is set once the
// body the forge holds was re-read and found clean.
Body string `json:"body,omitempty"`
PRURL string `json:"pr_url,omitempty"`
BodyChecked bool `json:"body_checked"`
// Merge is the merge rule the ruleset gave, and Armed whether auto-merge
// was armed by it. Nothing is pushed to the lane once Merge is set.
Merge string `json:"merge,omitempty"`
Armed bool `json:"armed"`
// Merged is the default branch's tip, as the remote held it, that carried
// the pushed head when the landing cleaned the lane up.
Merged string `json:"merged,omitempty"`
// CheckWaitSince is when the landing began waiting for its full check: the
// preflight receipt naming the head it pushes (ruling DR6d-2). It is set
// by the first call that finds no receipt, kept until the push, and
// cleared by it.
CheckWaitSince *time.Time `json:"check_wait_since,omitempty"`
}
Landing is the land stage's progress on one lane.
type Lane ¶
type Lane struct {
// ID is the lane's name inside the run: lane-1, lane-2, ….
ID string `json:"id"`
// Key is the record the lane delivers: itd-N, or iss-N (decision 10).
Key string `json:"key"`
// SpecStep is the number of the spec step the lane lands, and StepTitle its
// title. An unstepped spec is one implicit step, number 1.
SpecStep int `json:"spec_step"`
StepTitle string `json:"step_title"`
// Stage is the next stage the loop performs for this lane; StageDone when the
// lane has nothing left.
Stage Stage `json:"stage"`
// Awaits are the agents the lane waits on: one while its implementer
// works, one per validator while its round is out. Each is a slot of the
// run's ceiling until its receipt is verified (criterion 8, ruling DR6).
Awaits []Await `json:"awaits,omitempty"`
// Syncs are the merges of the default branch into the lane after a sibling
// landed; Hold is set while the lane is held after a sibling's hand-back.
Syncs []Sync `json:"syncs,omitempty"`
Hold *Hold `json:"hold,omitempty"`
// The lane's footprint, filled by the stages that make it.
Branch string `json:"branch,omitempty"`
BaseSHA string `json:"base_sha,omitempty"`
HeadSHA string `json:"head_sha,omitempty"`
Worktree string `json:"worktree,omitempty"`
Brief string `json:"brief,omitempty"`
Receipt string `json:"receipt,omitempty"`
PR int `json:"pr,omitempty"`
// PickSHA is the record-only commit at the branch base carrying the run's
// pick entry, on the lane a picked run commits it on; the receipt verifier
// counts the implementer's commits from after it.
PickSHA string `json:"pick_sha,omitempty"`
// Validation is the validate stage's record (piece 8): one round per head
// the validators judged, the last the current one. Only the loop writes a
// verdict into it, parsed from the validator's own return (itd-58).
Validation []ValidationRound `json:"validation,omitempty"`
// HandBack is set when the lane was stopped and handed back to the person:
// its Stage is then StageHandedBack.
HandBack *HandBack `json:"hand_back,omitempty"`
// Receipts are the implementers' receipts the loop verified for the lane,
// the implement stage's and each fix round's, with the model each runner
// reported (criterion 10).
Receipts []ReceiptRecord `json:"receipts,omitempty"`
// Resolves are the captures the lane's receipts declared fixed, each with
// the lane's commit that fixed it; the landing resolves each (piece 9).
Resolves []Resolution `json:"resolves,omitempty"`
// Landing is the landing stage's progress (piece 9): each of its steps is
// recorded as it completes, so a killed landing resumes at the step that
// did not.
Landing *Landing `json:"landing,omitempty"`
// Refused is the lane's run of refused steps in an issue run (stuck.go):
// the stage, check and reason of the last, how many in a row were the
// same, and since when the lane has refused at that stage. Nil while the
// lane's steps succeed, and in an intent's run.
Refused *LaneRefused `json:"refused,omitempty"`
// AutoPlan is the `abcd build --auto-plan` lane's record (autoplan.go):
// the draft as the start checked it, its two plan reviews and what the
// plan made. Nil on every other lane.
AutoPlan *AutoPlan `json:"auto_plan,omitempty"`
}
Lane is one lane: one spec step, one branch, one pull request.
type LaneHandBack ¶ added in v0.12.0
type LaneHandBack struct {
Kind string `json:"kind"`
Reason string `json:"reason"`
Home string `json:"home,omitempty"`
}
LaneHandBack is a lane's own hand-back: the kind of decision it found, the reason in a sentence, and, for the kinds routed to a home, where the decision belongs.
type LaneReceipt ¶
type LaneReceipt struct {
SchemaVersion int `json:"schema_version"`
RunID string `json:"run_id"`
Lane string `json:"lane"`
Branch string `json:"branch"`
// Commits are the full object names of the commits the implementer made on
// the lane's branch.
Commits []string `json:"commits"`
// DefinitionOfDone is the repository's definition of done as the
// implementer ran it.
DefinitionOfDone *DoDRun `json:"definition_of_done"`
// Report is the implementer's report, a path inside the lane's directory.
Report string `json:"report"`
// Model is the model the implementer's harness reported, as reported: the
// binary cannot verify it.
Model string `json:"model,omitempty"`
// Resolves are the captures the lane fixed, each with the commit of the
// lane that fixed it and the judgements a resolution records; the landing
// resolves each with `capture resolve` (spec piece 9).
Resolves []Resolution `json:"resolves,omitempty"`
// HandBack stops the lane: the implementer found a decision inside the
// work and hands it back rather than deciding it (itd-82 scope 5, the
// `handback:` of decision 10 on the parent). The loop reads it before the
// validators, discards the lane's work and ends the lane with it.
HandBack *LaneHandBack `json:"handback,omitempty"`
}
LaneReceipt is the file an implementer writes when its lane is built.
type LaneRefused ¶ added in v0.15.1
type LaneRefused struct {
Stage string `json:"stage"`
Check string `json:"check,omitempty"`
Reason string `json:"reason"`
Count int `json:"count"`
Since time.Time `json:"since"`
Last time.Time `json:"last"`
Final string `json:"final,omitempty"`
}
LaneRefused is a lane's run of refused steps: the stage, check and reason of the last refusal, how many in a row were that same refusal, since when the lane has refused at that stage with no quiet longer than stuckGap, and when it last refused. Final names why the refusal cannot change, "" when it can.
type LaneWorktree ¶
type LaneWorktree struct {
// Home is the caller's home, the base the store is proved real from.
Home string
// RootSHA keys the store on the repository.
RootSHA string
// StoreRel is the lane's store directory, relative to Home.
StoreRel string
// Path is the worktree, Home/StoreRel/<name>.
Path string
// Branch is the lane's branch, build/<name>.
Branch string
// contains filtered or unexported fields
}
LaneWorktree is where a lane's worktree lives and what it is called.
type NextOptions ¶ added in v0.12.0
type NextOptions struct {
// Max is --max as typed; 0 when not given. An explicit --max 0 is told
// apart from an absent flag only at the front door, which refuses it with
// RunCountRefusal.
Max int
// UntilEmpty is --until-empty.
UntilEmpty bool
}
NextOptions are the run count the caller asked for.
type NextResult ¶ added in v0.12.0
type NextResult struct {
CandidateSet
Pick *intent.Pick `json:"pick"`
Entry string `json:"entry"`
Start *StartResult `json:"start"`
Series *SeriesResult `json:"series"`
Next string `json:"next"`
}
NextResult is what Next returns: the candidate set, the pick, the entry it writes, and the run it started; Pick and Start are nil when a series' move picked nothing (its last pick is in progress, its window has elapsed, or it ended). Series is the series the call moved, nil for the default single pick; Next is the move to make.
func Next ¶ added in v0.12.0
func Next(repoRoot string, o Options, n NextOptions) (NextResult, error)
Next picks the readiest planned intent and starts its run. An empty candidate set is refused naming every excluded intent and its check, and writes nothing. With --max above 1 or --until-empty it begins a series (nextseries.go); while a series is in progress every call continues it, and a count other than the series' own is refused. The pick's entry is checked against the grounds writer's own gate before the run starts, so a pick never starts a run whose reason it cannot write.
type NextSeries ¶ added in v0.14.0
type NextSeries struct {
SchemaVersion int `json:"schema_version"`
StartedAt time.Time `json:"started_at"`
UpdatedAt time.Time `json:"updated_at"`
// Max is the cap on picks; 0 with UntilEmpty, which picks until no
// candidate is left.
Max int `json:"max"`
UntilEmpty bool `json:"until_empty"`
// Flags are the pace flags as typed when the series began; every run the
// series starts is started with them, so each runs on the series' pace.
Flags SeriesFlags `json:"flags"`
// Pace is the pace the series began on; its window and pause bound when
// the series picks.
Pace *Pace `json:"pace"`
WindowStartedAt *time.Time `json:"window_started_at,omitempty"`
NextEligibleAt *time.Time `json:"next_eligible_at,omitempty"`
Picks []SeriesPick `json:"picks"`
// Stopped says why the series ended, and EndedAt when; empty while it
// runs.
Stopped string `json:"stopped,omitempty"`
EndedAt *time.Time `json:"ended_at,omitempty"`
}
NextSeries is one series of picks, between invocations.
type Options ¶
type Options struct {
// Now is the clock; nil means time.Now.
Now func() time.Time
// Minter mints the run id; the zero value is production.
Minter recordid.Minter
// Session is the joined session of the shared run state
// (~/.abcd.noindex/runs/<root-sha>/) a new run is started for. When set, Start
// claims the intent for it there, so a build of the same intent from any
// other checkout of the repository sees the run before its lane has moved
// or claimed anything (iss-2609252050506863). Empty, the run holds no
// claim and is invisible to another checkout until its lane shows.
Session string
// Pace, SubAgents and FixRounds are the --pace, --sub-agents and
// --fix-rounds flags as typed; nil when the flag was not given. They set a
// new run's pace over every configured layer.
Pace, SubAgents, FixRounds *string
// Roots are where the pace's configuration layers are read; nil reads
// them at layered.RootsFor(repoRoot).
Roots *layered.Roots
// NetworkProbe proves the network back for the shared outage probe a
// step runs when it is due; nil is implement.RemoteProbe at the checkout.
NetworkProbe func() (bool, string)
// Runners is the runner configuration read before a run is created
// (LoadRunners). A new run's budget check (budget.go) asks each runner a
// role of the run is routed to for its remaining quota; nil leaves every
// role on the host, which reports none.
Runners *runner.Config
// Quota asks the named runner for its remaining quota, under ctx's
// deadline; nil asks Runners.
Quota func(ctx context.Context, name string) (runner.Quota, bool, error)
// Tiers is the model-tier routing a step resolves the tier of each role
// its rounds hand out through (escalate.go; spc-2609251028149555, AC 10):
// the routing tables and the machine's connections. Nil records no route.
Tiers *Tiering
// AutoPlan is `abcd build --auto-plan` (autoplan.go): a draft intent is
// planned by the run, on adr-2610310235000654's substitute for the
// sign-off, in place of being refused as not planned. An intent already
// planned is built as it would be without it; an issue key is refused.
AutoPlan bool
// PlanGuard is the front door's rule for a step that writes the intent
// and spec records in this checkout, as an auto-plan lane's plan does
// (autoplan.go): it is called under the run's lock immediately before
// `intent plan` runs, and an error refuses the step as it is, the lane
// left at its plan and the run's state unwritten. Nil guards nothing.
PlanGuard func() error
// TakeOver is `abcd build --take-over`: the start's reservation moves
// this person's own live reservation from another copy to this one. It
// never moves another person's.
TakeOver bool
// contains filtered or unexported fields
}
Options are the seams tests set; the zero value is production.
type OutageDone ¶ added in v0.13.4
type OutageDone struct {
Landed []string `json:"landed"`
PullRequests []OutagePR `json:"pull_requests"`
}
OutageDone is what a run that gave up had done: the lanes landed and the pull requests it opened that have not landed.
type OutageInfo ¶ added in v0.13.4
type OutageInfo struct {
Since time.Time `json:"since"`
Services []string `json:"services"`
Down []string `json:"down"`
Probes int `json:"probes"`
NextProbeAt *time.Time `json:"next_probe_at,omitempty"`
// Retried is what the lanes were doing when they lost the connection.
Retried []string `json:"retried"`
GaveUpAt *time.Time `json:"gave_up_at,omitempty"`
Done *OutageDone `json:"done,omitempty"`
Left *OutageLeft `json:"left,omitempty"`
// Notify is true from the give-up until a session acknowledges it.
Notify bool `json:"notify"`
}
OutageInfo is what an outage holds a refusal or a step to: when it began, the services down, the probes so far and the next one due; for a run that gave up, when it did, what the run had done and what is left, and whether the product thinker's notification is still pending.
type OutageLane ¶ added in v0.13.4
type OutageLane struct {
Lane string `json:"lane"`
SpecStep int `json:"spec_step"`
Stage Stage `json:"stage"`
}
OutageLane is one lane left, at its stage.
type OutageLeft ¶ added in v0.13.4
type OutageLeft struct {
Lanes []OutageLane `json:"lanes"`
Pending []PendingStep `json:"pending"`
}
OutageLeft is what a run that gave up has left: each lane with work and its stage, and the spec steps no lane has opened for.
type OutagePR ¶ added in v0.13.4
type OutagePR struct {
Lane string `json:"lane"`
PR int `json:"pr"`
// Merge is what the landing did with it: armed, or left open.
Merge string `json:"merge,omitempty"`
}
OutagePR is one pull request a lane opened.
type Outcome ¶
type Outcome struct {
Await *Await
// HandBack stops the lane: it is handed back to the person with what the
// stage found, and the loop starts nothing further for it (itd-50,
// criterion 2). Set only with no Await.
HandBack *HandBack
// Stay records a step of a stage that takes several invocations (the
// landing): the lane's changes are written and the record gets the note,
// and the lane stays at the stage for the next invocation's step. Set only
// with no Await and no HandBack.
Stay bool
// Goto sends the lane back to an earlier stage (the landing's sync sends
// it to a fresh round); set only with no Await, HandBack or Stay.
Goto Stage
// LandLeft is set by a landing body that sends the lane back (the sync)
// once it has reserved an issue's whole found_at again, before it changed
// anything locally (reserveOnLeavingLand), so the move does not judge
// the reservation a second time; Reservation is the run record's line for
// a widening it made, "" when the reservation already covered the found_at.
LandLeft bool
Reservation string
// Note is the run record's line for the stage.
Note string
}
Outcome is what a stage's body returns. A body that hands its work to an agent returns Await: the lane then waits on the receipt it names and the stage completes only when Receipt verifies it.
type Pace ¶ added in v0.12.0
type Pace struct {
WorkMinutes PaceValue `json:"work_minutes"`
PauseMinutes PaceValue `json:"pause_minutes"`
SubAgents PaceValue `json:"sub_agents"`
FixRounds PaceValue `json:"fix_rounds,omitzero"`
}
Pace is a run's pace: the working window, the pause after it, the ceiling on this run's lanes and validators alive at once, and the fix rounds a lane may take before it is handed back. FixRounds is zero in a run a state file before version 6 holds: it started before the pace carried the cap, and FixRoundCap reads the bundled value for it.
type PaceValue ¶ added in v0.12.0
type PaceValue struct {
Value int `json:"value"`
Layer string `json:"layer"`
Origin string `json:"origin"`
}
PaceValue is one of the pace's numbers with the layer that supplied it: "flag", "repo", "machine" or "bundled", and the origin — the flag as typed, the file, or "bundled".
type PendingStep ¶
type PendingStep struct {
Number int `json:"number"`
Title string `json:"title"`
// Needs are the spec steps it waits for, as its `- needs:` line or the
// default (every earlier step, ruling DR6b) resolved them; nil in a file
// before version 9, which reads as the default.
Needs []int `json:"needs"`
}
PendingStep is a spec step the run will open a lane for.
type PlanReview ¶ added in v0.16.1
type PlanReview struct {
Lens string `json:"lens"`
Role string `json:"role"`
Brief string `json:"brief"`
Return string `json:"return"`
Verdict string `json:"verdict,omitempty"`
Pass bool `json:"pass"`
}
PlanReview is one review of the draft: the lens it judges by, the agent it is started as, its brief and return, and the verdict the loop parsed.
type RateLimit ¶ added in v0.14.0
type RateLimit struct {
Lane string `json:"lane"`
Role string `json:"role"`
Runner string `json:"runner"`
Response string `json:"response"`
Checkpoints []Checkpoint `json:"checkpoints"`
}
RateLimit is a runner's rate-limit response as a step reports it: the lane and the agent it came from, the runner, the response in abcd's words, and every lane it checkpointed.
type ReceiptRecord ¶ added in v0.12.0
type ReceiptRecord struct {
Role string `json:"role"`
Receipt string `json:"receipt"`
// Model is the model the runner reported, as reported; empty when it
// reported none. The binary cannot verify it.
Model string `json:"model,omitempty"`
// Route is the route that ran the agent when a runner ran it: the runner
// asked for, the one that ran and the model it reported. Absent when the
// host ran it, so a host-run receipt reads as it always has.
Route *runner.RouteRecord `json:"route,omitempty"`
}
ReceiptRecord is one implementer's receipt the loop verified.
type RecordComparison ¶ added in v0.16.1
type RecordComparison struct {
Round int `json:"round"`
Comparison
}
RecordComparison is how one role's reviewers compared in one round (reviewers.go).
type RecordLane ¶ added in v0.12.0
type RecordLane struct {
ID string `json:"id"`
Key string `json:"key"`
SpecStep int `json:"spec_step"`
StepTitle string `json:"step_title"`
Stage Stage `json:"stage"`
Branch string `json:"branch,omitempty"`
BaseSHA string `json:"base_sha,omitempty"`
HeadSHA string `json:"head_sha,omitempty"`
// Receipts are the implementers' receipts the loop verified, each with the
// model its runner reported.
Receipts []ReceiptRecord `json:"receipts"`
// Verdicts are every verdict the loop recorded, round by round.
Verdicts []RecordVerdict `json:"verdicts"`
// Comparisons are how each reviewer role's reviewers compared, round by
// round, where a review set asked them for classes (reviewers.go).
Comparisons []RecordComparison `json:"comparisons,omitempty"`
// Resolves are the captures the lane fixed.
Resolves []string `json:"resolves"`
// PR is the lane's pull request, and Landing what its landing did.
PR int `json:"pr,omitempty"`
Landing *Landing `json:"landing,omitempty"`
HandBack *HandBack `json:"hand_back,omitempty"`
// AutoPlan is the auto-plan lane's record: the draft, its digest, the
// plan reviews' verdicts as the loop recorded them, and what the plan
// made. Absent on every other lane.
AutoPlan *AutoPlan `json:"auto_plan,omitempty"`
}
RecordLane is one lane of the run record.
type RecordPick ¶ added in v0.14.0
type RecordPick struct {
Lane string `json:"lane"`
Entry string `json:"entry"`
intent.Pick
Excluded []Excluded `json:"excluded"`
// Falsified is true once a lane of the run was handed back as
// unachievable after the run's fix rounds, and FalsifiedBy names it.
Falsified bool `json:"falsified"`
FalsifiedBy string `json:"falsified_by,omitempty"`
}
RecordPick is a run's pick as its record reads it (itd-2609211116005482 criterion 6, spc-2609212015048113 scope 8): the candidates in the pick order with their scores, the rule, the runner-up and the falsifier, as the pick made them; the planned intents the checks excluded; and whether the lane's state has met the falsifier. The intent's grounds entry is never edited: a falsified pick is named here and in the run record's lines.
type RecordVerdict ¶ added in v0.12.0
type RecordVerdict struct {
Round int `json:"round"`
HeadSHA string `json:"head_sha"`
Role string `json:"role"`
Verdict string `json:"verdict"`
Pass bool `json:"pass"`
// Return is the validator's return the verdict was parsed from.
Return string `json:"return"`
// Route is the runner route that ran the validator; absent when the host
// ran it.
Route *runner.RouteRecord `json:"route,omitempty"`
// Reviewer, Class, Model and ModelStatus are a review set's reviewer
// (reviewers.go): its index among its role's reviewers, the class it was
// asked for, the model the class resolved to, and whether that model was
// only asked for, its runner reported one (beside it on Route), or the
// reviewer route answered, which is sent no model (unsent); absent for a
// validator no review set asked for a class.
Reviewer int `json:"reviewer,omitempty"`
Class string `json:"class,omitempty"`
Model string `json:"model,omitempty"`
ModelStatus string `json:"model_status,omitempty"`
}
RecordVerdict is one verdict the loop recorded from a validator's return.
type Refusal ¶
type Refusal struct {
// Stage is where the loop refused: "check" before a run starts, "state" for
// a run that cannot be read, "pause" for the window clock, or the lane stage
// ("worktree", "implement", …) and "receipt" inside a run.
Stage string `json:"stage"`
// Check names the pre-start check that failed, when Stage is "check".
Check string `json:"check,omitempty"`
// Lane names the lane, inside a run.
Lane string `json:"lane,omitempty"`
Reason string `json:"reason"`
Remedy string `json:"remedy"`
// Contention marks a refusal that is somebody else's hold rather than the
// caller's fault — a peer holding the record, a run locked by another
// invocation, a pause: back off and take other work. The CLI maps it to
// exit 3, as `abcd implement` does.
Contention bool `json:"contention,omitempty"`
// Checks is every pre-start check's row, when Stage is "check", so a caller
// sees the whole picture rather than the first failure.
Checks []CheckRow `json:"checks,omitempty"`
// Excluded is every planned intent a pick excluded and the check that
// excluded it, when a pick found no candidate.
Excluded []Excluded `json:"excluded,omitempty"`
// Outage is the run's lost connection a refusal is held by: the shared
// probe a lane waits on, or, at the stage "outage", the give-up with what
// the run had done and what is left (iss-2610080620372731).
Outage *OutageInfo `json:"outage,omitempty"`
// contains filtered or unexported fields
}
Refusal is the one shape every refusal of the loop takes (criterion 13): the stage it happened at, the reason and the remedy, in text and in --json. A refusal writes nothing: the state file is as it was before the call, except for the time a landing began waiting for its full check (ruling DR6d-2), which the call that finds the wait writes once, whatever the call answers.
type Resolution ¶ added in v0.12.0
type Resolution struct {
Issue string `json:"issue"`
Commit string `json:"commit"`
Note string `json:"note"`
Impact string `json:"impact"`
Grounds string `json:"grounds"`
}
Resolution is one capture a lane fixed: the issue, the lane's commit that fixed it, and what `abcd capture resolve` records — the note, the product impact and the grounds. The loop checks the shape and that the commit is one the receipt names; the capture store judges the rest when the landing resolves it.
type RestartAside ¶ added in v0.13.4
type RestartAside struct {
RunID string `json:"run_id"`
Lane string `json:"lane"`
At time.Time `json:"at"`
// Path is the aside's directory, relative to the checkout root.
Path string `json:"path"`
// Head is the lane's last commit, the one the patch applies to and the one
// the fresh agent starts from.
Head string `json:"head"`
// Files are the paths the patch changes; empty when nothing was left
// uncommitted, and Patch is then empty too.
Files []string `json:"files"`
Patch string `json:"patch,omitempty"`
// Why is WhyDied, or "agent yielded: NETWORK: <cmd>".
Why string `json:"why"`
// Receipt is the partial receipt copied aside, by its name there; empty
// when the gone agent wrote none.
Receipt string `json:"receipt,omitempty"`
}
RestartAside is what a restart saved aside, as aside.json holds it.
type RestartResult ¶ added in v0.13.4
type RestartResult struct {
StepResult
Aside RestartAside `json:"aside"`
}
RestartResult is what restartLane returns: the lane's step result, re-telling the implementer await, and the aside.
func RestartDrive ¶ added in v0.16.1
func RestartDrive(ctx context.Context, repoRoot, runID, laneID, yielded string, steps Stages, o Options, rs Runners) (RestartResult, error)
RestartDrive is restartLane under the run's routes (iss-2611012047534449): a re-told role routed to a runner, by the configuration or a --route, is started on its runner at once, as a held role is retried (runner_pause.go), rather than re-told to the host; one the runner fails to start pauses the lane. A --route for a role the restart does not re-tell is refused before anything is changed. With rs.Config nil, or in an auto-plan run, it is restartLane. The first routed role re-told is started; any other is retried by a later step.
type Retry ¶ added in v0.16.1
type Retry struct {
Lane string `json:"lane"`
Role string `json:"role"`
Runner string `json:"runner"`
Why string `json:"why"`
Paused *RunnerPause `json:"paused,omitempty"`
}
Retry is a held role a step retried on its runner: the lane, the role, the runner, why it was held, and, when the runner failed to start it again, the pause it stays in.
type ReviewClass ¶ added in v0.16.0
type ReviewClass struct {
Class string `json:"class"`
Model string `json:"model"`
MapLayer string `json:"map_layer"`
MapOrigin string `json:"map_origin"`
}
ReviewClass is one class of a review set with the model the class map resolves it to, and the map layer ("machine" or "bundled") and origin that supplied the model.
type ReviewJudge ¶ added in v0.16.0
type ReviewJudge struct {
Class string `json:"class"`
Model string `json:"model"`
MapLayer string `json:"map_layer"`
MapOrigin string `json:"map_origin"`
Layer string `json:"layer"`
Origin string `json:"origin"`
}
ReviewJudge is a review set's judge: its class, the model it resolves to, and the layer and origin of review.judge.
type ReviewRoute ¶ added in v0.14.2
type ReviewRoute struct {
// Name is the route as oracle.review names it; the record names it.
Name string
// Reviewer reaches the route; nil when this machine names no server for
// it, and Absent says so.
Reviewer Reviewer
Absent string
// AgentPrompt is a reviewer's agent definition, the head of its request.
AgentPrompt func(role string) (string, error)
}
ReviewRoute is the reviewer route the configuration selected.
func LoadReviewRoute ¶ added in v0.14.2
func LoadReviewRoute(r layered.Roots, agentPrompt func(role string) (string, error)) (*ReviewRoute, error)
LoadReviewRoute reads the reviewer route (oracle.LoadReview) at the roots a step starts from and refuses in the loop's refusal shape on a fault, before anything moves. nil is the host's route: nothing differs from a run that configures none.
type ReviewSet ¶ added in v0.16.0
type ReviewSet struct {
Roles []RoleReviewers `json:"roles"`
Judge *ReviewJudge `json:"judge"`
MaxReviewers PaceValue `json:"max_reviewers"`
}
ReviewSet is a run's review set: each role's reviewers, the judge (nil for none) and the ceiling the lists were held to.
type Reviewer ¶ added in v0.14.2
Reviewer is the validator interface a reviewer route other than the host implements: the request the loop renders in, the reviewer's whole return out. The loop reads the verdict from the return and records it, as it does a host reviewer's. An error is a review that did not come back: one with a Reason method names the fallback's reason, and its text is the detail.
type RoleReviewers ¶ added in v0.16.0
type RoleReviewers struct {
Role string `json:"role"`
Reviewers []ReviewClass `json:"reviewers"`
Layer string `json:"layer"`
Origin string `json:"origin"`
Clamped int `json:"clamped,omitempty"`
}
RoleReviewers is one role's reviewers, with the layer and origin of the list. Clamped is the length the list named before the machine's ceiling cut it; 0 when it was not cut.
type Round ¶ added in v0.16.0
type Round struct {
Role string `json:"role"`
// Tier is the tier the role was asked to run at, the receipt's tier asked;
// "" when its route names no tier.
Tier oracle.Tier `json:"tier,omitempty"`
// EscalatedFrom is the tier the role ran at in the round before, when the
// failed round moved it up; "" when it did not move.
EscalatedFrom oracle.Tier `json:"escalated_from,omitempty"`
// GateOutput is the failing output of the round before this role ran, the
// verdicts and findings that caused any switch, bounded; "" when the role
// did not follow a failed round.
GateOutput string `json:"gate_output,omitempty"`
// Note says why the role did not move after a failed round: its route
// names no tier, or it is at the top of the ladder.
Note string `json:"note,omitempty"`
}
Round is the route one role of a lane's round ran at (spc-2609251028149555, AC 10; itd-2609170822093401's Decision 1, "a rule, not a router"). A round whose gates failed moves the next round's tier one step up the ladder local, economy, frontier (oracle.Escalate), and the switch is recorded here as a fact: the tier the role ran at, the tier it moved from, and the failing gate output that caused it. A route that names no tier (a runner and model, a role pointed at a provider, host-decides, or a role with no routing row) does not move, and says why in Note.
type RouteAnswer ¶ added in v0.14.2
RouteAnswer is the answer a reviewer route placed at an await's return path: the route, and the SHA-256 (hex) of the bytes it placed. The receipt records the review as the route's only when the return its verifier reads has that digest.
type RoutedJudgementAnswer ¶ added in v0.15.1
type RoutedJudgementAnswer struct {
SchemaVersion int `json:"schema_version"`
Issue string `json:"issue"`
Answer string `json:"answer"`
Kind string `json:"kind,omitempty"`
Reason string `json:"reason"`
}
RoutedJudgementAnswer is the routed judge's answer, read strictly: the host's shape less the digest, which abcd computes itself.
type RunPick ¶ added in v0.12.0
type RunPick struct {
// Lane is the lane whose branch carries the pick's entry as its first
// commit: the run's first lane.
Lane string `json:"lane"`
// Entry is the grounds entry's text, written after the `pursued:` token.
Entry string `json:"entry"`
// Pick is the choice: the candidates in the pick order with their scores,
// the rule, the runner-up.
Pick intent.Pick `json:"pick"`
// Excluded are the planned intents the checks excluded.
Excluded []Excluded `json:"excluded"`
}
RunPick is the pick a run was started from, as the state carries it.
type RunRecord ¶ added in v0.12.0
type RunRecord struct {
RunID string `json:"run_id"`
Key string `json:"key"`
Intent string `json:"intent"`
Spec string `json:"spec"`
Driver Driver `json:"driver"`
Complete bool `json:"complete"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
// Pace is the pace the run ran on, nil for a run started before the loop
// paced a run.
Pace *Pace `json:"pace"`
// Review is the review set the run ran on, nil for a run started before
// review sets.
Review *ReviewSet `json:"review"`
Lanes []RecordLane `json:"lanes"`
Pending []PendingStep `json:"pending"`
Transcripts []Transcript `json:"transcripts"`
// Fallbacks are the run's fallback receipts, and FallbackCounts their
// count per runner asked for and per role (itd-2609201916056194
// criterion 4).
Fallbacks []runner.FallbackReceipt `json:"fallbacks"`
FallbackCounts runner.Counts `json:"fallback_counts"`
// Outages are the lost connections the shared run's log records over the
// run's lifetime, each with its minutes, its outcome and what was retried,
// so a short outage nobody was told of still appears.
Outages []implement.OutageSpan `json:"outages"`
// Pick is the pick `abcd build next` started the run from, with its score
// table and whether its falsifier was met; nil for a run `abcd build
// <itd-N>` started.
Pick *RecordPick `json:"pick"`
Record []Entry `json:"record"`
}
RunRecord is a run's record as it is read at the end.
func CaptureTranscripts ¶ added in v0.12.0
func CaptureTranscripts(repoRoot, runID string, paths []string, capture TranscriptCapturer, o Options) (RunRecord, error)
CaptureTranscripts captures each path into the history store through capture, one capture per path, and records each in the run's state. It is refused on a run that is not complete: the record's transcripts are the run's, captured at its end. A capture that fails stops the call: the ones before it are recorded, and the refusal names the path that failed, so the call can be made again with the rest. A path captured before is captured again (the store's capture is idempotent) and recorded once.
func ReadRecord ¶ added in v0.12.0
ReadRecord reads a run's record.
type RunRenewal ¶ added in v0.16.0
type RunRenewal struct {
// Root is the checkout the run lives in.
Root string
// RunID and Key name the run and the record it reserves.
RunID string
Key string
// Renewed is true for a renewal pushed and logged as reservation_renewed.
Renewed bool
// Note is what the run record logged: the renewal's line when Renewed,
// else why it failed, or that the reservation is another person's or
// copy's.
Note string
}
RunRenewal is one renewal of a run's reservation RenewRuns or RenewRunsIn made or tried.
func RenewRuns ¶ added in v0.16.0
func RenewRuns(waiterRoot string, now time.Time) []RunRenewal
RenewRuns renews, as at now, the due reservation of each run in progress the gated waiter in waiterRoot serves: each that lives in waiterRoot, and each that lives in another worktree of the repository (git worktree list) with a lane, not yet done, whose worktree is waiterRoot, compared by real path. A worktree whose runs cannot be read, and a listing git refuses, renew nothing. It never refuses: the waiter's wait and its command go on whatever it finds.
func RenewRunsIn ¶ added in v0.16.0
func RenewRunsIn(repoRoot, runID string, now time.Time) []RunRenewal
RenewRunsIn renews, as at now, the due reservation of each run in progress that lives in repoRoot, or of the one runID names ("" for every run): implement status's renewal of the runs it shows.
type RunnerClaim ¶ added in v0.16.1
type RunnerClaim struct {
Runner string `json:"runner"`
Session string `json:"session"`
Until time.Time `json:"until"`
}
RunnerClaim is a runner a step started for an await: the runner, the session it was started under, and when the claim lapses.
type RunnerPause ¶ added in v0.16.1
type RunnerPause struct {
Runner string `json:"runner"`
Reason runner.Reason `json:"reason"`
Detail string `json:"detail"`
// Stderr is the first line the runner wrote to stderr, redacted, one line
// and bounded; "" when it wrote none.
Stderr string `json:"stderr,omitempty"`
Since time.Time `json:"since"`
At time.Time `json:"at"`
Tries int `json:"tries"`
}
RunnerPause is why a role waits for its runner: the runner that failed to start it, the reason in abcd's words, the first line the runner wrote to stderr, when the pause began and when the latest start failed, and how many starts have failed.
func (RunnerPause) Why ¶ added in v0.16.1
func (p RunnerPause) Why() string
Why is the pause's reason as one clause.
type Runners ¶ added in v0.12.0
type Runners struct {
// Config is the runner configuration read when the call began
// (runner.Load); nil drives nothing and leaves every role on the host.
Config *runner.Config
// Transcripts is where each runner's transcript lands: abcd's own store
// (runner.HistoryStore) in production.
Transcripts runner.TranscriptStore
// Timeout bounds one runner's run; the role's Config.TimeoutFor when zero.
Timeout time.Duration
}
Runners is what the process driver starts a routed role through.
type SeriesFlags ¶ added in v0.14.0
type SeriesFlags struct {
Pace *string `json:"pace,omitempty"`
SubAgents *string `json:"sub_agents,omitempty"`
FixRounds *string `json:"fix_rounds,omitempty"`
}
SeriesFlags are --pace, --sub-agents and --fix-rounds as typed; absent when not given.
type SeriesPick ¶ added in v0.14.0
type SeriesPick struct {
Intent string `json:"intent"`
RunID string `json:"run_id"`
PickedAt time.Time `json:"picked_at"`
Outcome string `json:"outcome"`
// Falsified is true once the run's state met the pick's falsifier.
Falsified bool `json:"falsified"`
}
SeriesPick is one pick of a series and what its run has come to.
type SeriesResult ¶ added in v0.14.0
type SeriesResult struct {
// State is the series' state file, relative to the checkout root.
State string `json:"state"`
// Started is true when this call began the series.
Started bool `json:"started"`
NextSeries
Complete bool `json:"complete"`
}
SeriesResult is the series as one call leaves it.
type Stage ¶ added in v0.12.0
type Stage string
Stage is one stage of a lane: the loop performs a lane's stages in order, and the lane as a whole lands one step of the spec (a spec's steps keep that word; BU1, iss-2609291313276243).
The auto-plan lane's stages.
const ( StageWorktree Stage = "worktree" StageBrief Stage = "brief" StageImplement Stage = "implement" StageValidate Stage = "validate" StageLand Stage = "land" StageDone Stage = "done" // StageHandedBack is a lane that took its run's cap of fix rounds and still // did not pass (itd-50, criterion 2): the loop starts nothing further for // it, and its intent is the person's to replan. StageHandedBack Stage = "handed-back" // StageHeld is a lane whose round passed after a sibling was handed back // (ruling DR6c): it holds no slot, starts nothing and is never armed until // the person releases it (`implement step --release`) or discards it. StageHeld Stage = "held" // StageDiscarded is a held lane the person discarded: its pull request // closed, its worktree and branch removed, its step left unlanded. StageDiscarded Stage = "discarded" )
The lane's stages, in the order Sequence performs them. StageDone is the state of a lane with nothing left to do, and StageHandedBack of a lane stopped and handed back to the person; neither is a stage with a body.
type StageDef ¶ added in v0.12.0
StageDef is one stage of the lane sequence: its name, the spec piece that delivers its body, and the body — nil when this build does not carry it.
A stage that hands the lane to several agents in turn (the validators, and the fresh implementer their findings go to) sets Repeats: a verified receipt then returns the lane to the stage's body rather than completing the stage, and the body decides, on the next step, whom it hands the lane to next or that the stage is complete.
type Stages ¶ added in v0.12.0
type Stages []StageDef
Stages is the lane sequence with its bodies.
func DefaultStages ¶ added in v0.12.0
func DefaultStages() Stages
DefaultStages is the lane sequence this build carries, each stage with the spec piece that delivers its body: the worktree (lane.go), the brief (brief.go), the implement stage with its receipt's verifier (receipt.go) and the validators with theirs (validate.go), and the landing (land.go).
type StartResult ¶
type StartResult struct {
RunID string `json:"run_id"`
// State is the state file, relative to the checkout root.
State string `json:"state"`
// Resumed is true when a live run for the key already existed: the call
// created nothing and names that run.
Resumed bool `json:"resumed"`
Lane Lane `json:"lane"`
Pending []PendingStep `json:"pending"`
// Checks are the pre-start checks' rows when the call created the run; a
// resumed start runs none, and carries none.
Checks []CheckRow `json:"checks"`
// Claim is the shared-run claim a new run took for Options.Session; nil when
// no session was named or the start resumed a run, and then null in the
// JSON, never absent, so the payload says the run holds no claim.
Claim *implement.ClaimResult `json:"claim"`
// Pace is the run's pace, each number with the layer that supplied it.
// Null for a run started before the loop paced a run.
Pace *Pace `json:"pace"`
// Review is the run's review set (reviewset.go), each value with the
// layer that supplied it. Null for a run started before review sets.
Review *ReviewSet `json:"review"`
// Diagnostics are the review set's non-fatal reports when the call
// created the run (a list clamped to the machine's ceiling, a
// repository's class map skipped), one line each, for the front door to
// print on stderr; never in the payload.
Diagnostics []string `json:"-"`
// HandBack is set when the run's lane stands handed back to the person.
HandBack *HandBack `json:"hand_back,omitempty"`
// Reservation is what the start did with the run's reservation on the
// shared remote (reserved, renewed or took it over, until when, with what
// footprint); empty when it reserved nothing (no remote named origin, or
// a resumed run handed back).
Reservation string `json:"reservation,omitempty"`
// ReservationWarnings is each warning the start's reservation act gave:
// a footprint path naming a directory git tracks, with the tracked files
// beneath it (iss-2610230016544142), reserved all the same. Every act
// that names the run's footprint gives them, a reserve that renews this
// copy's own tip included; it is empty when the footprint names no such
// directory, when a resume renewed the reservation keeping the tip's
// footprint (a renewal names none), or when nothing was reserved.
ReservationWarnings []string `json:"reservation_warnings,omitempty"`
// ForkUnchecked is why the start's reservation could not ask the forge
// whether origin is a fork, so it went on without the check (claim's
// Result.ForkUnchecked); "" when it asked, or asked nothing.
ForkUnchecked string `json:"fork_unchecked,omitempty"`
// ForkAllowed is the fork, as owner/name, the start's reservation was let
// through on because reservation.fork_origin names it (claim's
// Result.ForkAllowed); "" when none was.
ForkAllowed string `json:"fork_allowed,omitempty"`
Next string `json:"next"`
}
StartResult is what Start returns.
func Start ¶
func Start(repoRoot, key string, o Options) (StartResult, error)
Start resumes the live run for key, or runs the checks and, when every one passes and the budget check (budget.go) finds no runner's quota under the run's estimate, creates the run: the state file with one lane at the sequence's first stage, the spec's other unlanded steps pending, and the record's first line. A refused check writes nothing.
A live run for the same key in this checkout is looked up first, under the lock, and resumed — named, not duplicated, and not re-judged. The checks judged the record when the run was created; since then the run's own lanes change the tree they read (a lane's worktree moves the intent to shipped/, a lane claims it), so judging again would refuse the run as its own peer. So starting again after a kill loses nothing and repeats nothing, and the checks run only when a run is created. Only the key's shape is checked before the lookup, so a path is never built from a key that is not an intent id.
With o.Session named, a new run also claims its intent in the shared run state for that session, with the run id as the lane and the longest lease a claim takes: the peers check then counts that session's own live claim on the intent as its own, and a build from another checkout counts it as a peer's. A session that has not joined is refused before anything is created; a claim refused under the lock (a racing holder, a second session's bound) leaves no run behind; and a run whose state cannot be written releases the claim it took.
type State ¶
type State struct {
SchemaVersion int `json:"schema_version"`
// RunID names the run and its directory.
RunID string `json:"run_id"`
// Key is the record the run was started for: an intent id, or an issue id
// (decision 10), for which Intent and Spec are empty.
Key string `json:"key"`
// Intent and Spec are the intent the run delivers and the open spec it
// builds against, as the readiness gate judged them.
Intent string `json:"intent"`
Spec string `json:"spec"`
// Driver is what drives the loop (DriverHost unless configured).
Driver Driver `json:"driver"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
// WindowStartedAt and NextEligibleAt are the window clock the pacing intent
// (itd-2609201925079472) writes and reads. The loop honours NextEligibleAt:
// before it, a stage is refused as a pause and nothing moves (decision 2).
WindowStartedAt *time.Time `json:"window_started_at,omitempty"`
NextEligibleAt *time.Time `json:"next_eligible_at,omitempty"`
// Pace is the pace the run started on, each number with the layer that
// supplied it (itd-2609201925079472). Nil in a run a version-1 state file
// holds: it started before the loop paced a run, and runs unpaced.
Pace *Pace `json:"pace,omitempty"`
// Review is the review set the run started on (reviewset.go), each value
// with the layer that supplied it. Nil in a run a state file before
// version 15 holds: it started before review sets.
Review *ReviewSet `json:"review,omitempty"`
// Pick is the pick `abcd build next` made to start the run: the
// candidates, their scores and the grounds entry its first lane commits.
// Nil for a run `abcd build <itd-N>` started.
Pick *RunPick `json:"pick,omitempty"`
// Lanes are the lanes opened so far, in the order they opened; several may
// be open at once, up to the ceiling (ruling DR6). A lane lands one step of
// the spec's `## Steps` (the whole spec when it lists none).
Lanes []Lane `json:"lanes"`
// Waiting is the work the ceiling holds back: each item's lane, role and
// the time the ceiling first held it. An item leaves it when it takes a
// slot, with a record entry naming the minutes it waited.
Waiting []Waiting `json:"waiting,omitempty"`
// Pending are the spec's unlanded steps no lane has been opened for yet.
Pending []PendingStep `json:"pending"`
// Record is the run record, accumulated as stages complete.
Record []Entry `json:"record"`
// Transcripts are the transcripts the run's record captured into the
// history store once the run was complete, one capture per path (piece 10).
Transcripts []Transcript `json:"transcripts,omitempty"`
// Fallbacks are the run's fallback receipts, one per role a runner it was
// routed to did not run (itd-2609201916056194 criterion 3): the role, the
// runner asked for, the reason and the route that ran instead. The run's
// summary counts them per runner and per role (runner.Tally).
Fallbacks []runner.FallbackReceipt `json:"fallbacks,omitempty"`
// ReservedAt is when the run reserved its key on the shared remote
// (itd-2609091034175565): the reservation `implement step` renews, fences
// and tombstones. Nil for a run that holds none.
ReservedAt *time.Time `json:"reserved_at,omitempty"`
}
State is one run: everything the loop needs between two invocations.
func ReadState ¶
ReadState is the state file's one reader. It refuses a run id of the wrong shape before building a path from it, reads through the checkout's os.Root (so a symlinked component cannot walk the read out of the checkout), decodes strictly — an unknown field is a file some other writer produced — and holds the file to the version and the id it is stored under.
func Runs ¶
Runs lists this checkout's runs, oldest first. An absent tier or run directory holds none. A state file that cannot be read fails the listing, naming it: a run the loop cannot read is not one it may skip past.
func (State) Complete ¶
Complete reports whether the run has nothing left: every lane is done (or, in an issue run, discarded) and no spec step is waiting for one.
func (State) FixRoundCap ¶ added in v0.12.0
FixRoundCap is the fix rounds a lane of the run may take before it is handed back: the run's own, or the bundled value for a run that started before the pace carried one (an unpaced run, or a state file before version 6).
func (State) Issue ¶ added in v0.12.0
Issue is the issue an issue-keyed run fixes (decision 10), or "" for a run that builds an intent.
func (State) SlotsInUse ¶ added in v0.13.0
SlotsInUse is the agents the run has out: its outstanding awaits.
type StepResult ¶
type StepResult struct {
RunID string `json:"run_id"`
Lane string `json:"lane,omitempty"`
// PerformedStage is the stage this call completed; empty when it completed none
// (the lane awaits a receipt, or the run is complete).
PerformedStage Stage `json:"performed_stage,omitempty"`
// Stage is the lane's next stage after the call.
Stage Stage `json:"stage,omitempty"`
// Awaiting is what the lane waits on, when it waits on an agent.
Awaiting *Await `json:"awaiting,omitempty"`
// Tier is the model tier the round asks the awaited agent to run at
// (escalate.go), one step up after a round that did not pass; omitted
// when its route names no tier.
Tier oracle.Tier `json:"tier,omitempty"`
Complete bool `json:"complete"`
// NextEligibleAt is set when this call closed the run's window: nothing
// was performed, and no stage is taken before this time.
NextEligibleAt *time.Time `json:"next_eligible_at,omitempty"`
// HandBack is set when the lane was handed back to the person: this call
// stopped it, or it stood stopped when the run was started again.
HandBack *HandBack `json:"hand_back,omitempty"`
// Slots is the agents the run has out after the call, and Ceiling the most
// it may have (the run's pace.sub_agents); CeilingReached is set when this
// call found every slot taken and handed nothing out.
Slots int `json:"slots"`
Ceiling int `json:"ceiling"`
CeilingReached bool `json:"ceiling_reached,omitempty"`
// Alive is every lane of the run with anything left, with its stage and
// each agent it awaits, the held lanes included.
Alive []AliveLane `json:"alive,omitempty"`
// Blocked are the landings that waited on the forge's merge this call
// while another lane moved: each holds only its own lane. Any other refused
// stage is the call's answer, and no lane moves.
Blocked []Refusal `json:"blocked,omitempty"`
// Route is the route that ran the agent when the process driver started
// it through a runner (Drive); absent when the host is to run it.
Route *runner.RouteRecord `json:"route,omitempty"`
// Fallback is the fallback receipt this call recorded when the reviewer
// route did not return a review and the host is handed it.
Fallback *runner.FallbackReceipt `json:"fallback,omitempty"`
// Paused is the lane's role its runner failed to start, with why
// (Await.Paused): it waits for the runner, and no agent is to be started
// for it (runner_pause.go). Awaiting is then empty.
Paused *Await `json:"paused,omitempty"`
// Retried is the held role this call retried on its runner, with why it
// was held and, when the runner did not start it again, its pause.
Retried *Retry `json:"retried,omitempty"`
// Outage is the run's lost connection while one is open: the lanes that
// reach the network or an agent wait on its shared probe (Blocked names
// them) while the others move.
Outage *OutageInfo `json:"outage,omitempty"`
// RateLimit is the runner's rate-limit response that ended the run's
// window early in this call, with the lanes it checkpointed
// (ratelimit.go); NextEligibleAt is then the pause's end.
RateLimit *RateLimit `json:"rate_limit,omitempty"`
// AcceptedConfigChange names each changed git setting or file the call
// accepted (`implement step --accept-config-change`) before its step:
// names alone, a URL subsection hidden, never a value (configwatch.go).
AcceptedConfigChange []string `json:"accepted_config_change,omitempty"`
// RouteUnused is each `implement step --route` the step did not use: a
// landing ahead of its role moved first (route_use.go). Every other
// --route the step would not use is refused before anything is written.
RouteUnused []string `json:"route_unused,omitempty"`
Next string `json:"next"`
// contains filtered or unexported fields
}
StepResult is what advance and Receipt return.
func Discard ¶ added in v0.13.0
func Discard(repoRoot, runID, laneID string, o Options) (StepResult, error)
Discard does not land a held lane, on the person's word (`implement step --discard <lane>`): its worktree is removed from the machine store and its branch deleted, then its pull request is closed if it opened one, and its stage is `discarded`; its step stays unlanded in the spec, so a replanned remainder carries it. The local removals come first, so a refused one leaves the pull request open and the lane held, and a retry finds nothing half done: a worktree or branch already gone is passed over. It changes nothing when the lane is not held or any lane is still at work.
While the network is down a lane with a pull request to close waits on the shared probe, changing nothing, and a close the network refuses is recorded as the run's outage (outage.go).
func Drive ¶ added in v0.12.0
func Drive(ctx context.Context, repoRoot, runID string, steps Stages, o Options, rs Runners) (StepResult, error)
Drive performs the next stage as advance does and, when the stage hands the lane to an agent whose role is routed to a runner, starts that agent through the runner and hands its receipt back through Receipt. A role on the host returns the await for the host to act on, as advance returns it; a runner that did not start its role pauses the lane, and the result names the role as paused (runner_pause.go). A step that hands no agent out retries one held role once on its runner, and a --route for a held role retries it at once.
func DriveReview ¶ added in v0.14.2
func DriveReview(ctx context.Context, repoRoot, runID string, res StepResult, steps Stages, o Options, rr *ReviewRoute) (StepResult, error)
DriveReview sends the review this call handed to the host to rr instead: a ruthless or security reviewer res hands out, which no runner ran or fell back from. The route's return is written to the review's return path and handed back through the receipt, which verifies it and records its verdict with the route that ran it. Anything else, and a nil rr, is res unchanged.
A review the route does not return falls back (scope 3): no server on this machine, a refused connection, a bound run out, the server's error, an answer that is not the protocol's, or a return with no verdict the loop can record. The host's own agent is handed the same brief and return path, as res already names them, and one fallback receipt (the role, the route asked for, the reason and abcd's detail, the host as the route that runs it) is written to the run's state and record, which the summary counts per route and per role. No return is written for it, so nothing stands where the host's agent writes. A step interrupted while the route works (the person, or a host's command timeout) falls back too, as interrupted, so every review the route was asked for and did not return has its receipt.
func Receipt ¶
func Receipt(repoRoot, runID, receiptPath string, steps Stages, o Options) (StepResult, error)
Receipt hands back the receipt an agent stage waited on. The path is looked up among every outstanding await of the run, not only one lane's, and the lane that await belongs to is advanced (ruling DR6): a verified receipt frees its slot, which the next `implement step` fills. It is refused when no await names the path, when this build carries no verifier for the stage, and when the verifier refuses it; in every refusal the run stays where it was and the agent's slot stays taken.
func Release ¶ added in v0.13.0
func Release(repoRoot, runID, laneID string, o Options) (StepResult, error)
Release lands a held lane as it is, on the person's word (`implement step --release <lane>`): its stage returns to `land` and its landing resumes at the step it stopped before, synced first when a sibling landed since its base. It changes nothing when the lane is not held or any lane is still at work.
type Sync ¶ added in v0.13.0
type Sync struct {
At time.Time `json:"at"`
Siblings []string `json:"siblings"`
Merged string `json:"merged"`
Conflicted bool `json:"conflicted"`
Paths []string `json:"paths,omitempty"`
Brief string `json:"brief,omitempty"`
Receipt string `json:"receipt,omitempty"`
// Head is the head the sync produced: the merge commit, or the verified
// head of the implementer who resolved the conflict; empty until then.
Head string `json:"head,omitempty"`
// Round is the fresh round that judges Head, once it has opened.
Round int `json:"round,omitempty"`
}
Sync is one merge of the default branch into a lane after a sibling lane of the run landed (spc-2609202134341288, "Two lanes that touch the same files"): the siblings whose landing caused it, the default branch's sha merged in, whether it conflicted, and the head it produced. A conflicting sync goes to a fresh implementer with the brief and receipt named here.
type Tiering ¶ added in v0.16.0
type Tiering struct {
Table *oracle.Layered
Conns oracle.Connections
// Reviewer is the reviewer route oracle.review selects (ReviewRoute.Name),
// which takes the ruthless and the security review the stage hands to the
// host; "" when it selects none.
Reviewer string
}
Tiering is the model-tier routing a step resolves each role's tier through: the routing tables (oracle.Load) and the machine's provider connections (oracle.APIConfig.Connections). A step with none records no route.
func LoadTiering ¶ added in v0.16.0
LoadTiering reads the model-tier routing a step resolves each role's tier through, at the roots a step starts from: the routing tables (oracle.Load) and the machine's provider connections (oracle.LoadAPI), with reviewer the reviewer route the step sends its reviews to (nil for none). A fault is refused in the loop's refusal shape before anything moves, as a delegating verb refuses it: the table decides which tier a round asks for, so it is never guessed past. The provider configuration's diagnostics and the tables' (an orphan row) are the caller's to print, as a delegating verb prints them.
type Transcript ¶ added in v0.12.0
type Transcript struct {
At time.Time `json:"at"`
// Path is the transcript as it was handed to the capture, home-redacted.
Path string `json:"path"`
// Session is the session the history store recorded it under, and Stored
// where it lives there, home-redacted.
Session string `json:"session"`
Stored string `json:"stored"`
// Wrote is false when the store already held it (an idempotent capture).
Wrote bool `json:"wrote"`
// ScanGap is the capture's scan gap, home-redacted: the repository armed a
// scanner augmenter (gitleaks) that did not run, so the transcript was
// stored masked by the native scanner alone. Empty when there is none.
ScanGap string `json:"scan_gap,omitempty"`
}
Transcript is one transcript the run record captured into the history store.
type TranscriptCapturer ¶ added in v0.12.0
type TranscriptCapturer func(path string) (Transcript, error)
TranscriptCapturer captures one transcript by path into the history store, as `abcd history capture <path>` does, and reports what it stored.
type Unattended ¶ added in v0.16.0
type Unattended struct {
// Kind is UnattendedBuild or UnattendedDrain.
Kind string
// RunID and Key name a build's run and the record it builds; both are
// empty for a drain. Key is empty too when the state names no record id
// (an itd- or an iss- id): it is read from a local-tier file and quoted
// to the agent, so nothing else is passed on.
RunID string
Key string
}
Unattended is the build or drain a session's checkout is running.
func RunningUnattended ¶ added in v0.16.0
RunningUnattended reports the build or drain running for the session whose checkout is sessionRoot, as of now. A build counts while its run is not complete and its state was written within lease.Default of now; a drain while it has not stopped and its state was written within the same window. The window is the reservation lease's: a run idle past it is the run the reservation system already treats as abandoned, so a checkout holding old unfinished runs (the main checkout keeps many from 2026-10-12) does not count as running one. A state dated more than lease.Skew ahead of now is not counted either, so a planted far-future date cannot hold it on. Nor is a run waiting on the person (waitsOnPerson): the person is at the terminal by then, taking the work over, and their own prompts must show.
The session also counts when sessionRoot is the worktree of a lane of a counting build in any other worktree of the same repository: a lane's checkout lives in the machine's worktree store, while its run's state lives in the checkout that started it.
A run or drain state that cannot be read does not count and is passed over. The error is returned only when nothing could be read: the checkout cannot be opened, or every state it holds failed and no lane matched. The caller reads an error as no answer, never as a run.
type ValidationRound ¶ added in v0.12.0
type ValidationRound struct {
Round int `json:"round"`
// HeadSHA is the lane's head the round's validators judge.
HeadSHA string `json:"head_sha"`
Validators []ValidatorRun `json:"validators"`
// Fix is the verified receipt of the fresh implementer the round's
// findings were handed to; once set, the next step opens the next round.
Fix string `json:"fix,omitempty"`
// Routes is the tier each agent the round handed out ran at, one record
// per role, in the order the round handed them out (spc-2609251028149555,
// AC 10): the validators, and the fresh implementer the round's findings
// went to. Empty for a round handed out with no routing read.
Routes []Round `json:"routes,omitempty"`
// Comparisons is how each reviewer role's reviewers compared, one per
// role, written as the last of the role's returns is recorded; empty for
// a round opened with no review set (reviewers.go).
Comparisons []Comparison `json:"comparisons,omitempty"`
}
ValidationRound is one round of the validate stage: the validators it hands the lane's head to, one at a time, and the fresh implementer it hands their findings to when one of them did not pass.
type ValidatorRun ¶ added in v0.12.0
type ValidatorRun struct {
Role string `json:"role"`
Brief string `json:"brief"`
Return string `json:"return"`
// Verdict is the verdict the loop parsed from the return; empty until the
// return is handed back. Pass is whether it lets the lane advance.
Verdict string `json:"verdict,omitempty"`
Pass bool `json:"pass"`
// Audit is the fidelity audit's request and reading, on the
// intent-auditor's run.
Audit *AuditRun `json:"audit,omitempty"`
// Route is the route that ran the validator when a runner ran it; absent
// when the host ran it. It is the one field a runner-run review's record
// differs in from a host-run one's (itd-2609201916056194 criterion 7).
Route *runner.RouteRecord `json:"route,omitempty"`
// Reviewer is the validator's index among its role's reviewers in the
// round, from 0 (reviewers.go): absent reads as 0, the role's first or
// only reviewer, which is how a round written before version 20 reads.
Reviewer int `json:"reviewer,omitempty"`
// Class is the model class the run's review set asked the reviewer for,
// and Model the <provider>/<model> route the class map resolved it to;
// both empty for a round opened with no review set and for the
// intent-auditor, which keeps its single run.
Class string `json:"class,omitempty"`
Model string `json:"model,omitempty"`
// ModelStatus says how far Model is known to be the model that ran, once
// the verdict is recorded: ModelReported when the runner that ran the
// reviewer reported a model (Route.Model, beside it), ModelAsked when
// only the asking is known, as for every host-run reviewer, whose model
// is asked for and never confirmed, and ModelUnsent when the reviewer
// route answered (Route.Ran is oracle.ReviewRP): that route is sent no
// model, so Model was never asked of what ran. Empty while the reviewer
// is out and wherever Model is.
ModelStatus string `json:"model_status,omitempty"`
}
ValidatorRun is one validator of a round: the fresh agent handed the lane, its brief, the return it writes, and the verdict the loop parsed from that return.
type Verifier ¶
Verifier checks the receipt an agent stage waited on. An error refuses the receipt and the lane stays where it was.
type Waiting ¶ added in v0.13.0
type Waiting struct {
Lane string `json:"lane"`
Role string `json:"role"`
Since time.Time `json:"since"`
}
Waiting is one piece of work the ceiling held back.
type WidenResult ¶ added in v0.16.1
type WidenResult struct {
RunID string `json:"run_id"`
Lane string `json:"lane"`
Record string `json:"record"`
Added []string `json:"added"`
Footprint []string `json:"footprint"`
Note string `json:"note"`
}
WidenResult is a widening's outcome: the run and lane, the paths newly held (none when the reservation already covered every one), the footprint the reservation holds after, and the run record's line.
func Widen ¶ added in v0.16.1
func Widen(repoRoot, runID, laneID string, paths []string, o Options) (WidenResult, error)
Widen widens the reservation of issue run runID, for its current lane laneID, to cover paths before the lane's implementer edits them. A path the reservation already covers adds nothing, and when it covers every one nothing is pushed. A run that holds no reservation (no origin) has nothing to widen and says so. Refused for a person (exit 2): an intent's run, whose footprint is its spec's; a lane that is not the run's current one or not at an editing stage; a path no reservation may carry; a reservation the view does not show this copy holding. Contention (exit 3): another copy's live hold on one of the paths, with nothing pushed and a run record line saying the widening backed off; or a locked run state.
Source Files
¶
- autoplan.go
- brief.go
- budget.go
- check.go
- composed_attribution.go
- configwatch.go
- conflict.go
- drain.go
- drain_decide.go
- drain_finish.go
- drain_handback.go
- drain_hold.go
- drain_judge.go
- drain_lease.go
- drain_origin.go
- drain_pace.go
- drain_pending.go
- drain_readmit.go
- drain_skip.go
- drain_text.go
- drain_unreadable.go
- drain_wait.go
- drive.go
- escalate.go
- handback.go
- hold.go
- issuebrief.go
- judgement.go
- land.go
- lane.go
- localstate.go
- loop.go
- narrow.go
- newer_remedy.go
- next.go
- nextseries.go
- outage.go
- pace.go
- pickcommit.go
- queue.go
- ratelimit.go
- receipt.go
- record.go
- refusal.go
- renewruns.go
- reservation.go
- restart.go
- reviewers.go
- reviewset.go
- route_use.go
- runner_pause.go
- schedule.go
- state.go
- state_mask.go
- state_text.go
- stuck.go
- sync.go
- unattended.go
- validate.go
- widen.go