Skip to content
26 changes: 17 additions & 9 deletions .abcd/development/brief/04-surfaces/35-drain.md
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,10 @@ pace and bundle cap again, holds the drive's one lane in work, takes the start's
flags (`DrainOptions.paceNewOnly`: a typed start's first move also gives them to a
drain in progress it finds, as a bare move does; after that move, and on a
re-execution, they go only to the drains the drive begins), keeps the pending hand-backs and
takes the ended drain's skip list as its state left it (`carrySkips`), the list
clearing when the drive ends. An ended drain that opened a lane, asked or took a
takes the ended drain's skip list as its state left it (`carrySkips`). The drive clears
the list as it ends only where its drain has ended; a drive that ends with a drain still in
progress leaves the list on that drain, to clear as that drain ends (`clearKeptSkips`
passes over a live drain). An ended drain that opened a lane, asked or took a
judgement, or handed an issue back is copied to `.abcd/.work.local/run/drains/` as
the new one is first written (one that did none of these is not), named by the move's
clock, the newest twenty kept, and no copy is added to a folder holding more than
Expand All @@ -411,8 +413,12 @@ so neither begins again. A bounded drive waits on an empty ledger (spc-261125181
step 5): a drain that stops `empty` is followed by one wait of `drainWaitMinutes`
(`terminal.awaitEmpty`), said once as "nothing is eligible; looking again at <time>", and
the next move begins a drain that reads origin afresh and takes the ended drain's skip list
(`DrainOptions.waitsOnEmpty` keeps it through `drainGoesOn`). The wait's state reads
`waiting` on "an empty queue" with its `Until` at the next look, one of the four named
(`DrainOptions.waitsOnEmpty` keeps it through `drainGoesOn`). Where the next look would
fall after the end time, the wait is said as "nothing is eligible; the drive ends at
<time>, before it would look again", is cut at the end time, and the drive ends there
with `TerminalUntil`. The wait's state reads
`waiting` on "an empty queue" with its `Until` at the next look, or at the end time in
that last wait, one of the four named
ends `driveWait` lists, so the empty ledger alone never makes it read `stalled`; a streak
of lanes handed back still does (`handBackStreak.over`). A drain that found nothing takes no
number and no copy under `run/drains/`; the "began drain" line after one that worked is
Expand All @@ -424,8 +430,8 @@ that drain under the drain's lock (`drainKeptRel`). A drain so named, while the
held (`driveAlive`), left its skip list, empty or not, to that drive, whatever word the
drive's state shows: a move that only adds or removes a skip over it
changes the list and begins no drain (`keptSkipMove`), a drain begun over it takes the list
and keeps it if it ends in the same move, and the drive clears it as it ends
(`clearKeptSkips`). A list a drive left by dying is no one's, and a move over it begins a
and keeps it if it ends in the same move, and the drive clears it as it ends where the
drain holding it has ended (`clearKeptSkips`). A list a drive left by dying is no one's, and a move over it begins a
drain without it. The drive's end and its state's lane counts sum every drain it worked
(`terminal.driveCounts`), and a re-execution carries the sum of the drains it went on past
(`TerminalOptions.Carried` and `Folded`), as it carries its lanes opened. The
Expand Down Expand Up @@ -1547,11 +1553,13 @@ naming it among the passed issues with the check `skipped`, the entry and its
reason. Several targets may be held back at once, all with the one reason; a
target already on the list takes the new reason; an entry can be taken off
again. The list is the drain's, not the ledger's: nothing is written onto the
issue, and the list clears when the drain ends, so a hold for now never
outlives the drain it was given to. A drain left with only held-back issues has
issue, and the list clears when the drain ends, so a hold for now outlives the
drain it was given to only where a drive carries it on. A drain left with only held-back issues has
nothing eligible to take and ends, clearing the list, unless a drive goes on past
it, at the drain's own cap or, under an end time, on the empty ledger, when the next
drain the drive begins takes the list (`drainGoesOn`). A target that is neither
drain the drive begins takes the list (`drainGoesOn`). The drive clears a list it
carries as it ends where its drain has ended; a drain still in progress at the
drive's end keeps the list until it ends (`clearKeptSkips`). A target that is neither
an issue id nor a clean repository-relative path, a hold without a reason or a
reason without a hold, and a list past sixty-four entries are refused with
nothing written.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
schema_version: 1
id: "iss-2612030838336459"
slug: "abcd-land-keeps-a-landing-report-for-a"
severity: "minor"
category: "drift"
source: "drift-detection"
found_during: "manual-capture"
origin: researcher-authored
production_mode: hand-written
found_at: "internal/core/landing/land.go"
remedy: "keep the report only after origin's URLs are read again unchanged, and say on the land page that the store keeps the newest 200 reports"
resolution: "land keeps the report only after origin's URLs are read again unchanged; land.md says so and names the 200-report cap"
impact: fix
---

abcd land keeps a landing report for a head it then refuses to push because the preflight rewrote origin's URLs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
schema_version: 1
id: "iss-2612030838386015"
slug: "the-drain-page-and-help-say-a-held-back"
severity: "minor"
category: "drift"
source: "drift-detection"
found_during: "manual-capture"
origin: researcher-authored
production_mode: hand-written
found_at: "commands/drain.md"
remedy: "say that a drive going on past a drain's end keeps its skip list, that its end clears only an ended drain's list, that a bounded drive ends on refusals and on lanes it passed over, and that a look publishes pending hand-backs"
resolution: "the drain page, the drain help, the brief's drain chapter and the skip-list messages say the list clears as the drain ends, and a list a drive carries as the drive ends unless its drain is still in progress, when it clears as that drain ends; they say how a bounded drive ends, that the last empty wait ends the drive at its end time, and what a look pushes"
impact: fix
---

the drain page and help say a held-back issue's skip list clears when the drain or the drive ends, and misstate how a bounded drive ends and what an empty look pushes
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
schema_version: 1
id: "iss-2612030911418988"
slug: "the-pre-push-receipt-tests-read-the"
severity: "major"
category: "bug"
source: "agent-finding"
found_during: "manual-capture"
origin: researcher-authored
production_mode: hand-written
found_at: "internal/surface/cli/githook_prepush_test.go"
remedy: "build every pre-push case's environment without an inherited ABCD_PREFLIGHT_CLOCK, so only a test that names its own clock has one"
resolution: "the pre-push cases build their environment without an inherited ABCD_PREFLIGHT_CLOCK; only mintTimed names one"
impact: fix
---

the pre-push receipt tests read the clock the outer make preflight exports, so on the records-only rule a fixture's minted receipt carries that run's time lines and TestPreflightReceiptNamesItsScope fails
60 changes: 42 additions & 18 deletions commands/drain.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,12 @@ hand-in refuses that run until you discard its lanes (`abcd implement step --run
--discard <lane>`) or restore its state and remove the stop the message names.

It prints one line per step and logs them under `.abcd/.work.local/logs/`. It ends
at its own cap, at the bound below, or on a stop; a drive with no bound also ends
when nothing is eligible.
at its own cap, at the bound below, on a stop, on a refusal it cannot go past, on a
check that no longer holds, or with only lanes it passed over left in progress, none
of them one it set aside, which it waits on and tries again once an hour instead (**A
lane it may not save** and **A lane it sets aside**, below); a drive with no bound also ends when nothing is
eligible, and on the eight-hour endings and the drain's stops on an outage or on
origin that the bound turns into waits (below).

**One drive, many drains.** `--max <n>` is the drive's own cap: the lanes it opens
across every drain it works, counted each time a move opens one, with none by default,
Expand All @@ -221,8 +225,10 @@ typed start's first move also gives them to a drain in progress it finds, as a b
move does; after that move, and on the drive's own re-execution, they go only to the
drains it begins), keeps the pending
hand-backs, and takes the ended drain's skip list as that drain's state left it, so a
`--skip` or `--unskip` made from another terminal mid-drive carries on, and the list
clears when the drive ends. Before the new drain's state is written over the old,
`--skip` or `--unskip` made from another terminal mid-drive carries on. As the drive
ends it clears the list of an ended drain; a drive that ends while a drain is still in
progress, at its bound with a lane in progress or on a stop or a refusal mid-drain, leaves
the list on that drain until that drain ends. Before the new drain's state is written over the old,
the ended one, where it opened a lane, asked or took a judgement or handed an issue
back, is copied to `.abcd/.work.local/run/drains/drain-<UTC time>.json`,
named by the move's own clock and never by a time the state carries, the newest twenty
Expand All @@ -237,18 +243,24 @@ opened, its pace and its cap, or an ended one as ended, after which a new drain
held or not, ends without ending the drive. The drive says `nothing is eligible; looking
again at <time>` once per wait, waits fifteen minutes, and its next move begins a drain,
which reads origin afresh, so an issue another machine captures, or one put back in the
queue, is taken at the next look. A look that finds nothing reserves and pushes nothing,
keeps the skip list for the next drain, and leaves no copy under `run/drains/`; it is
queue, is taken at the next look. Where the next look would fall after its end time, the
drive says `nothing is eligible; the drive ends at <time>, before it would look again`
instead, waits until its end time, and ends there with no further look. A look that finds
nothing reserves nothing. What it pushes is what every move pushes before it looks: each
pending hand-back (one a `yes` routed and could not publish) whose issue's release on
`origin` it can now be published over (`pending_hand_backs`, below). It keeps the skip
list for the next drain, and leaves no copy under `run/drains/`; it is
no drain of the drive's, so no `began drain` line names it, and the line is said when a
drain after a quiet spell opens its first lane or asks its first judgement. The drive's
state reads `waiting` on an empty queue with its `until` at the next look, so the empty
state reads `waiting` on an empty queue with its `until` at the next look, or at the end
time in the last wait, so the empty
ledger never makes it `stalled`, however long it stays empty; lanes handed back in a row
still read `stalled`, since they ask for a look. The wait ends at the end time, on a
stop, and the drive's own cap still ends it. A drain a session steps still stops as
`empty`. While the drive waits, the ended drain's state holds the drive's skip list, empty
or not: a `--skip` or `--unskip` from another terminal changes that list and begins no
drain, a bare `abcd drain` there begins one that keeps the list, and the drive clears it as
it ends. A list a drive left by dying is no one's, and the next drain begins without it.
it ends where the drain holding it has ended. A list a drive left by dying is no one's, and the next drain begins without it.
The drive's end counts its lanes across every drain it worked, a re-execution onto a
release included.

Expand All @@ -261,12 +273,13 @@ as a process table that could not be read, among them. For the rest of the run t
nothing for that lane: no save, no claim, no reservation pushed or renewed, no line in its
record, and no agent starts for it. Each move leaves the lane, the drive's waits leave a passed
lane's reservation and record alone, and its halts and its release at the end pass it by. Where
the drive would have ended at the cap or with nothing eligible left and such a lane is still in
progress, the drain stays open, and the drive ends instead on an ending of its own, at exit 3,
naming each lane it passed over with why and the command to resume with. Where a lane it set
the drain would have stopped, at a cap or with nothing eligible left, and such a lane is still in
progress, the drain stays open, and the drive ends on an ending of its own, at exit 3,
naming each lane it passed over with why and the command to resume with. A drive with an end
time ends so too, where an empty ledger alone is waited on. Where a lane it set
aside is among them, it waits instead and tries that lane again once an hour, until its
bound. The drain's other
stops, on a connection a run gave up on and on origin it cannot read, end it as before. A
bound. Without a bound the drain's other stops, on a connection a run gave up on and on
origin it cannot read, end the drive; under a bound the move waits both out inside the drain. A
passed lane another session finishes still counts as in progress, so it keeps the drain open
until a later drive routes it. A later drive comes to the lane again, where its own claim and
the same judge decide whether it may take it up. The drive keeps the lanes it passed over in
Expand Down Expand Up @@ -406,7 +419,12 @@ bound and keeps the eight-hour endings below.

The bound is a time, not a limit on what the run spends: the yes's estimate is what
the work costs if nothing fails, and retries and probes add to it. Under a bound
nothing but the bound, the cap or a stop ends the run:
none of what follows ends the run, and an empty ledger is waited on. The run ends at the
bound, at the cap or on a stop, and otherwise only on a check that no longer holds, on a
refusal it cannot go past (the refusal of a held value that changed, at a boundary or before
it, among them), or with only lanes it passed over left in progress, none of them one it
set aside, which it waits on and tries again once an hour until the bound (**A lane it may
not save** and **A lane it sets aside**, above):

- **A limit or an outage at the live check.** A limit met by the check before the
first move is no failed check, nor is a launch that came to no verdict on any check.
Expand Down Expand Up @@ -1293,8 +1311,14 @@ drive keeps, where it changes that list and begins nothing; every move that take
issues passes a held-back issue over before anything is pushed or asked, in `passed` with check `skipped` and
the reason. `--skip` may be repeated, all with the one `--reason`; a target
already listed takes the new reason; `--unskip` takes an entry off. The list
lives in the drain's state, writes nothing onto the issue, and clears when the
drain ends; a drain left with only held-back issues ends, clearing it.
lives in the drain's state and writes nothing onto the issue. It clears when the
drain ends, unless a drive goes on past that end: a drain the drive works that
ends at a cap of its own, or `empty` under the drive's end time, keeps its list,
and the drive's next drain takes it. A drain left with only held-back issues
ends `empty`, clearing its list, unless a drive with an end time goes on past
it: then the list is kept, and the issue stays held back at every look until
`--unskip` takes it off or the list clears (**One drive, many drains** says
when).

### The hand-back, by kind

Expand Down Expand Up @@ -1393,8 +1417,8 @@ for an answer over an issue that left the eligible set before it was taken,
`hold` the reservation it was asked on, and `route` the runner that answered
(`asked`, `ran`, `model`) when the judge is routed, absent for yours;
`skips` is the drain's skip list (`target`, an issue id or a path; `reason`;
`at`), empty once the drain has ended, which the text form lists as
`held back:` lines;
`at`), which the text form lists as `held back:` lines, empty once the drain has
ended unless a drive keeps it for the next drain it begins;
`pending_hand_backs` are the hand-backs routed and not yet published on
`origin` (`issue`, `kind`, `blob`, `why`, `at`), which the text form lists as
`hand-back pending:` lines;
Expand Down
11 changes: 6 additions & 5 deletions commands/land.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,12 @@ that name with none at this head, since the proof may lie past the bound.
branch's own preflight could add a push URL or a `pushInsteadOf`). A
repository whose make file declares no `preflight` target gets no push. The receipt is a convenience check, not a security
boundary: CI re-runs every gate on the pushed commit. Once the gate
passes, land keeps a copy of the receipt it counted, with its reuse counts
and times, as the landing's report in
`~/.abcd.noindex/landing-reports/<root-sha>/<head>`; a report it cannot
keep (a symlinked folder, a receipt over 64 KiB) is a notice, and the
landing goes on.
passes, `origin`'s URLs included, land keeps a copy of the receipt it
counted, with its reuse counts and times, as the landing's report in
`~/.abcd.noindex/landing-reports/<root-sha>/<head>`, and a landing the gate
refuses keeps none. The store keeps a repository's newest 200 reports. A
report it cannot keep (a symlinked folder, a receipt over 64 KiB) is a
notice, and the landing goes on.
2. **announce** (with `land.push` on, after the release hold below): the
announcements above. Each item is announced once: one you already
announced `merging` that still stands for more than a minute is not
Expand Down
Loading
Loading