Skip to content

Commit 0bb4ab5

Browse files
authored
The row counts candidates dropped while building for a member (#22)
* Count the passing candidates thrown away unlanded in the daily row A candidate that passed and is deleted before any plan lands it is a whole build that proved a tree and landed nothing. The live row counts them once each, with how many had a member whose head moved and how many a member that left the queue, and the daily row trips at more than 3. * The thrown-away tripwire reads hey-native-apps' row only The limit of three a day was set for hey-native-apps. The table line stays in every queue's row. * The daily row holds no limit on builds per landing The limits of 0.60 and 1.3 were replaced on 23 Nov by the count of passing candidates thrown away and by live builds per landing against the replay of the same day, which the comparison states. The table line stays. * The daily row also gives the four hours before its window A landing between 21:17Z and 01:17Z fell outside every row. The row now reads the live score (with -clone, without -like) and the take-outs of the day before's 21:17Z to the day's 01:17Z, keeps them under before and as <day>.before.*.json, and renders them after the day's tripwires. They judge no tripwire and add no column to rows.tsv. Four hours with no tick record say so; a failed read of them fails the row. * The row fetches the records its four hours before read back over The score of the four hours before the window reads 72 hours of records before they open, as the day's does before its own. The fetch started 72 hours before the day's window, so a first run for a queue left those four hours with 68. * The daily row gives its busiest hour, and judges it only when a backlog stood The charter's landings an hour while a backlog stands had no live measure: landings_per_hour is landings over every hour anything was queued. The live score now gives busiest_hour_landings, the most landings in 60 minutes from one of them, and backlog_longest_minutes, the longest run of records after whose own actions a ready pull request is in no pending candidate or push and every slot is held. The row judges the busiest hour against 12 for hey2 and 16 for hey-native-apps only on a day that backlog stood 60 minutes, and trips under it; the four hours before show it unjudged. * A pull request that conflicts with the trunk is no backlog It reads as ready and can never be built until its author changes it, so a full queue beside it is not a queue falling behind. The backlog now asks the rule the ready-wait measure already uses. * The row says the busiest hour is of a backlog day, not within the backlog On both recorded days a backlog stood an hour, the busiest sixty minutes began as it cleared. The line and the tripwire no longer say the two coincide. * The row counts candidates dropped while building for a member With cancels on, a candidate dropped because a member's head moved or a member left stops before it has a verdict, so the count of passing candidates thrown away never sees it. The row now says how many were dropped mid-build, why, how many other members started again and the longest any had built. Shown only. * A backlog is judged after everything its record does A record that deletes the only pending candidate, or lands or ejects the only waiter, leaves no backlog, and the record's own note on a pull request stands for its last one. A queue with no slots recorded never stands as a backlog, and a queue with no busiest-hour target is not called judged. Three tests now fail when what they name is broken: the window's upper edge, a busiest hour after the first landing, and a day landing exactly its target. * A dropped candidate is one a member's own push or leaving dropped The dropped count keeps its own map, so a candidate deleted while building and seen passing at the next delete still counts as thrown away. A member no longer queued counts toward a drop only when it neither landed at that head nor was ejected by the queue since it was last queued. The last figure is renamed dropped_members_still_queued and says only that those pull requests stayed queued at the same head. A candidate with no push time has no age, and the row line gives none when no dropped candidate has one. With a detail missing, the row line says the details were not measured rather than failing the row or printing null. * Only candidates hold a slot in the backlog The engine counts pending candidates and its own candidate pushes against the slots, and runs a round's probes and checks beside them. The backlog now counts the same, so a pending probe no longer stands as a full queue. A test now holds that a deleted candidate's members are not started. * A dropped candidate's age comes from its first push, and the evening shows drops A deleted commit with two entries is counted from the first entry that counts, as before. A candidate whose deleting world has no push time takes the one an earlier record read or the tick that planned its push. The four hours before the window, with records and no landing, show the thrown-away and dropped rows when either is above zero. The skill says only candidates hold a slot.
1 parent 4cf525b commit 0bb4ab5

5 files changed

Lines changed: 267 additions & 26 deletions

File tree

‎.agents/skills/operate/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Each tick records what it read and what it planned, where the workflow passes `-
3232

3333
- **Plan one again:** `go run ./eval -replay <recording>` in Banyan's repository prints the actions that world calls for. It is the same function the tick ran, so a surprise replays exactly on the release that recorded it.
3434
- **Score a stretch of them:** `go run ./eval -live <dir>` in Banyan's repository, with every recording in one folder. The row has the simulator's columns, so it sits beside `eval/scoreboard.tsv`.
35-
- **A day's row:** `eval/daily-row <owner/repo> <YYYY-MM-DD> [<shape>]` fetches the day's recordings (`eval/fetch-ticks`), scores 01:17Z to 21:17Z (`go run ./eval -live <dir> -from <time> -to <time> -row`, one JSON object, with the simulated row beside it where a shape is named) and reads the day's take-outs from the comments that carry the eject marker (`go run ./eval -takeouts <owner/repo> -from <time> -to <time>`): who made each, whether the same head landed since, and whether a check that had failed passed later on the same commit. It reads the same two for the four hours before the window, 21:17Z the day before to 01:17Z, with no simulated row, so no landing falls outside every row: they go under `before` in the JSON and in a block after the day's tripwires, and judge no tripwire and add no column to `rows.tsv`. The row's `busiest_hour_landings` is the most pull requests landed in the window within 60 minutes of one of its landings. Its `backlog_longest_minutes` is the longest run of records, none more than 10 minutes after the last, after whose own actions a pull request that could be built (ready, and not in conflict with the trunk) is in no pending candidate or push and every slot holds a pending build or a push. The busiest hour is judged against the charter's landings an hour only on a day that backlog stood 60 minutes, wherever in the day the hour falls (on 19 and 25 Nov 2026 it was the hour after the backlog cleared); `landings_per_hour` is landings over every hour anything was queued, which is not the charter's measure. It keeps the row as JSON and Markdown with a line in `rows.tsv`, and hands the Markdown to `$BANYAN_ROW_POST` once a day. Reads go through `$BANYAN_GH`. With `$BANYAN_CLONE` naming a clone that holds the blamed heads, the row checks a landing after an ejection as the cause; without it, the row says how many it could not check.
35+
- **A day's row:** `eval/daily-row <owner/repo> <YYYY-MM-DD> [<shape>]` fetches the day's recordings (`eval/fetch-ticks`), scores 01:17Z to 21:17Z (`go run ./eval -live <dir> -from <time> -to <time> -row`, one JSON object, with the simulated row beside it where a shape is named) and reads the day's take-outs from the comments that carry the eject marker (`go run ./eval -takeouts <owner/repo> -from <time> -to <time>`): who made each, whether the same head landed since, and whether a check that had failed passed later on the same commit. It reads the same two for the four hours before the window, 21:17Z the day before to 01:17Z, with no simulated row, so no landing falls outside every row: they go under `before` in the JSON and in a block after the day's tripwires, and judge no tripwire and add no column to `rows.tsv`. The row's `busiest_hour_landings` is the most pull requests landed in the window within 60 minutes of one of its landings. Its `backlog_longest_minutes` is the longest run of records, none more than 10 minutes after the last, after whose own actions a pull request that could be built (ready, and not in conflict with the trunk) is in no pending candidate or push and every slot holds a pending candidate or a candidate's push (a round's probes and checks run beside the slots and hold none). The busiest hour is judged against the charter's landings an hour only on a day that backlog stood 60 minutes, wherever in the day the hour falls (on 19 and 25 Nov 2026 it was the hour after the backlog cleared); `landings_per_hour` is landings over every hour anything was queued, which is not the charter's measure. Its `building_candidates_dropped` counts the candidates a tick deleted while they were still building because a member's head had moved or a member had left the queue without landing or being ejected, with `dropped_members_still_queued`, how many of their pull requests stayed queued at the same head (a lower candidate may still land one without a new build), and the longest any had built; it is shown and trips nothing. It keeps the row as JSON and Markdown with a line in `rows.tsv`, and hands the Markdown to `$BANYAN_ROW_POST` once a day. Reads go through `$BANYAN_GH`. With `$BANYAN_CLONE` naming a clone that holds the blamed heads, the row checks a landing after an ejection as the cause; without it, the row says how many it could not check.
3636

3737
A surprise from a real queue becomes a case in `eval/cases/` before its fix. The hillclimb skill says how.
3838

‎eval/daily-row.jq‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ def busiest_row($target; $day):
2121
elif backlog_judged then (if $target == null then "\(.busiest_hour_landings), with no target for this queue" else "\(.busiest_hour_landings) against a target of \($target), judged: a backlog stood for \(.backlog_longest_minutes | floor) min that day" end)
2222
else "\(.busiest_hour_landings), not judged: no backlog stood for an hour (the longest stood \(.backlog_longest_minutes | floor) min)" end) |";
2323
def thrown_row: "| Passing candidates thrown away unlanded | \(if .passing_candidates_thrown_away == null then "not measured" elif .passing_candidates_thrown_away == 0 then "none" else "\(.passing_candidates_thrown_away): \(.thrown_away_head_moved) with a member's head moved, \(.thrown_away_member_left) with a member gone from the queue" end) |";
24+
def dropped_row: "| Candidates dropped while building | \(if .building_candidates_dropped == null then "not measured" elif .building_candidates_dropped == 0 then "none"
25+
elif [.dropped_head_moved, .dropped_member_left, .dropped_members_still_queued, .dropped_longest_built_minutes] | any(. == null) then "\(.building_candidates_dropped); details not measured"
26+
else "\(.building_candidates_dropped): \(.dropped_head_moved) with a member's head moved, \(.dropped_member_left) with a member gone from the queue; \(.dropped_members_still_queued) of their pull requests stayed queued at the same head\(if .dropped_longest_built_minutes > 0 then ", the longest \(.dropped_longest_built_minutes | floor) min into its build" else "" end)" end) |";
2427
def takeouts_row:
2528
(.by_class // {}) as $c | (.takeouts // []) as $outs
2629
| ([$outs[] | select(.class as $k | classes | index($k) | not)] | group_by(.attributed) | map({name: .[0].attributed, count: length})) as $others
@@ -51,7 +54,7 @@ def later_row:
5154
"| Minutes the queue adds, median / p90 / p95 | \($l.queue_added_p50_minutes | n1) / \($l.queue_added_p90_minutes | n1) / \($l.queue_added_p95_minutes | n1) |",
5255
($l | held_row, builds_row, busiest_row($target; true), gap_row, red_row),
5356
"| Trunk moves no recorded tick planned | \($l.unplanned_trunk_moves | n1)\(if ($l.unplanned_trunk_moves // 0) > 0 then " (a merge outside the queue, or a tick whose record is missing; its landings are not counted)" else "" end) |",
54-
($l | thrown_row),
57+
($l | thrown_row, dropped_row),
5558
(if ($l.unconfirmed_landing_plans // 0) > 0 then "| Landing plans in the window the records never confirm | \($l.unconfirmed_landing_plans) (a refused push, or a landing confirmed after the records end) |" else empty end),
5659
"| Wrong ejections by the engine | \($l.wrong_ejections | n1)\(if $unjudged > 0 then ", with \($unjudged) landing(s) not checked" else "" end) |",
5760
($t | takeouts_row, later_row),
@@ -65,5 +68,5 @@ def later_row:
6568
| "The four hours before the window, \(.from | hm) on \(.from[0:10]) to \(.to | hm) on \(.to[0:10])" as $title
6669
| "",
6770
(if .live == null or .live.ticks == 0 then "**\($title)**: no records cover them."
68-
elif (.live.landed // 0) == 0 then .live | summary($title; "no landings")
69-
else (.live | summary($title; "no landings"), "", "| | |", "|---|---|", ready_row, held_row, builds_row, busiest_row(null; false), gap_row, red_row, thrown_row), (.takeouts | takeouts_row, later_row) end))
71+
elif (.live.landed // 0) == 0 then .live | summary($title; "no landings"), (if (.passing_candidates_thrown_away // 0) > 0 or (.building_candidates_dropped // 0) > 0 then "", "| | |", "|---|---|", thrown_row, dropped_row else empty end)
72+
else (.live | summary($title; "no landings"), "", "| | |", "|---|---|", ready_row, held_row, builds_row, busiest_row(null; false), gap_row, red_row, thrown_row, dropped_row), (.takeouts | takeouts_row, later_row) end))

‎eval/daily_row_test.go‎

Lines changed: 64 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,56 @@ func TestDailyRowTripsOverThreePassingCandidatesThrownAwayInHeyNativeApps(t *tes
177177
}
178178
}
179179

180+
func TestDailyRowShowsCandidatesDroppedWhileBuildingAndTripsOnNone(t *testing.T) {
181+
const thrown = `,"passing_candidates_thrown_away":4,"thrown_away_head_moved":2,"thrown_away_member_left":2`
182+
read := func(t *testing.T, live string) (row, trips string) {
183+
t.Helper()
184+
dir := standIns(t)
185+
if status, _ := dailyRowOf(t, dir, "basecamp/hey-native-apps", "COMMIT="+strings.Repeat("a", 40), "LIVE="+thrown+live); status != 0 {
186+
t.Fatalf("%s: status %d", live, status)
187+
}
188+
data, _ := os.ReadFile(filepath.Join(dir, "state", "hey-native-apps", "rows", "2026-11-18.md"))
189+
for _, line := range strings.Split(string(data), "\n") {
190+
if strings.HasPrefix(line, "**Tripwires:** ") || line == "No tripwire breached." {
191+
trips = line
192+
}
193+
}
194+
return string(data), trips
195+
}
196+
_, without := read(t, "")
197+
for _, c := range []struct {
198+
live, line string
199+
}{
200+
{`,"building_candidates_dropped":3,"dropped_head_moved":2,"dropped_member_left":1,"dropped_members_still_queued":11,"dropped_longest_built_minutes":21.9`,
201+
"3: 2 with a member's head moved, 1 with a member gone from the queue; 11 of their pull requests stayed queued at the same head, the longest 21 min into its build"},
202+
{`,"building_candidates_dropped":1,"dropped_head_moved":0,"dropped_member_left":1,"dropped_members_still_queued":1,"dropped_longest_built_minutes":0`,
203+
"1: 0 with a member's head moved, 1 with a member gone from the queue; 1 of their pull requests stayed queued at the same head"},
204+
{`,"building_candidates_dropped":0,"dropped_head_moved":0,"dropped_member_left":0,"dropped_members_still_queued":0,"dropped_longest_built_minutes":0`, "none"},
205+
{`,"building_candidates_dropped":1,"dropped_head_moved":1,"dropped_member_left":0,"dropped_members_still_queued":1,"dropped_longest_built_minutes":null`, "1; details not measured"},
206+
{`,"building_candidates_dropped":1,"dropped_head_moved":1,"dropped_member_left":null,"dropped_members_still_queued":1,"dropped_longest_built_minutes":4`, "1; details not measured"},
207+
{`,"building_candidates_dropped":2`, "2; details not measured"},
208+
{``, "not measured"},
209+
} {
210+
row, trips := read(t, c.live)
211+
if !strings.Contains(row, "| Passing candidates thrown away unlanded | 4: 2 with a member's head moved, 2 with a member gone from the queue |\n| Candidates dropped while building | "+c.line+" |\n") || trips != without {
212+
t.Fatalf("dropped while building, with tripwires %q, reads:\n%s", without, row)
213+
}
214+
}
215+
}
216+
217+
func TestDailyRowTripsOnNoCandidatesDroppedWhileBuilding(t *testing.T) {
218+
dir := standIns(t)
219+
live := `LIVE=,"passing_candidates_thrown_away":0,"ready_gaps_over_90":0,"queue_added_p50_minutes":1,"wrong_ejections":0,` +
220+
`"building_candidates_dropped":4,"dropped_head_moved":4,"dropped_member_left":0,"dropped_members_still_queued":9,"dropped_longest_built_minutes":30`
221+
if status, _ := dailyRowOf(t, dir, "basecamp/hey-native-apps", "COMMIT="+strings.Repeat("a", 40), live); status != 0 {
222+
t.Fatalf("status %d", status)
223+
}
224+
data, _ := os.ReadFile(filepath.Join(dir, "state", "hey-native-apps", "rows", "2026-11-18.md"))
225+
if row := string(data); !strings.Contains(row, "| Candidates dropped while building | 4: ") || !strings.Contains(row, "\nNo tripwire breached.\n") {
226+
t.Fatalf("four dropped and no other tripwire reads:\n%s", row)
227+
}
228+
}
229+
180230
func TestDailyRowHoldsNoLimitOnBuildsPerLanding(t *testing.T) {
181231
for _, repo := range []string{"basecamp/hey-native-apps", "basecamp/hey2"} {
182232
dir := standIns(t)
@@ -195,7 +245,7 @@ const (
195245
`"queue_added_p50_minutes":9,"queue_added_p90_minutes":20,"queue_added_over_30":1,"split_landings":3,"unsplit_landings":0,"builds_per_landing":0.5,` +
196246
`"ready_gaps":2,"longest_ready_gap_minutes":95,"longest_ready_gap_from":"2026-11-17T22:00:00Z","longest_ready_gap_to":"2026-11-17T23:35:00Z","ready_gaps_over_90":1,` +
197247
`"red_candidates":1,"red_pull_requests":4,"red_read_n":1,"red_read_median_minutes":12,` +
198-
`"passing_candidates_thrown_away":5,"thrown_away_head_moved":4,"thrown_away_member_left":1,"wrong_ejections":3,"unchecked":2,` +
248+
`"passing_candidates_thrown_away":5,"thrown_away_head_moved":4,"thrown_away_member_left":1,"building_candidates_dropped":3,"dropped_head_moved":3,"dropped_member_left":0,"dropped_members_still_queued":11,"dropped_longest_built_minutes":22.4,"wrong_ejections":3,"unchecked":2,` +
199249
`"busiest_hour_landings":9,"backlog_longest_minutes":75`
200250
beforeOuts = `{"takeouts":[{"at":"2026-11-17T23:00:00Z","number":7,"head":"abc","attributed":"checks","class":"own check","failed_then_passed":["build"],"landed_same_head":false},` +
201251
`{"at":"2026-11-17T23:30:00Z","number":7,"head":"abc","attributed":"bob","class":"bob","failed_then_passed":[],"landed_same_head":false}],` +
@@ -212,6 +262,7 @@ const (
212262
"| Longest wait of a ready head with no landing | 95 min, 22:00Z to 23:35Z |\n" +
213263
"| Red candidates | 1, holding 4 pull requests; failed job seen to read red 12 min at the median over 1 |\n" +
214264
"| Passing candidates thrown away unlanded | 5: 4 with a member's head moved, 1 with a member gone from the queue |\n" +
265+
"| Candidates dropped while building | 3: 3 with a member's head moved, 0 with a member gone from the queue; 11 of their pull requests stayed queued at the same head, the longest 22 min into its build |\n" +
215266
"| Take-outs | 2: 0 blamed in a candidate, 1 own check, 0 no gate, 0 conflict, 1 bob |\n" +
216267
"| Of those, a failed check passed later on the same commit | 1 (1 own check) |\n"
217268
)
@@ -354,6 +405,17 @@ func TestDailyRowSaysWhenTheFourHoursBeforeHoldNoRecordsOrNoLanding(t *testing.T
354405
{"no tick in the four hours", false, nil, beforeTitle + ": no records cover them.\n"},
355406
{"no tick the eval counts", true, []string{"BEFORE_TICKS=0"}, beforeTitle + ": no records cover them.\n"},
356407
{"ticks and no landing", true, []string{`BEFORE_LIVE=,"landed":0,"red_candidates":2`}, beforeTitle + ": no landings.\n"},
408+
{"no landing and none thrown away or dropped", true, []string{`BEFORE_LIVE=,"landed":0,"passing_candidates_thrown_away":0,"building_candidates_dropped":0`}, beforeTitle + ": no landings.\n"},
409+
{"no landing and candidates thrown away and dropped", true, []string{`BEFORE_LIVE=,"landed":0,"passing_candidates_thrown_away":2,"thrown_away_head_moved":1,"thrown_away_member_left":1,` +
410+
`"building_candidates_dropped":1,"dropped_head_moved":1,"dropped_member_left":0,"dropped_members_still_queued":2,"dropped_longest_built_minutes":9.5`},
411+
beforeTitle + ": no landings.\n\n| | |\n|---|---|\n" +
412+
"| Passing candidates thrown away unlanded | 2: 1 with a member's head moved, 1 with a member gone from the queue |\n" +
413+
"| Candidates dropped while building | 1: 1 with a member's head moved, 0 with a member gone from the queue; 2 of their pull requests stayed queued at the same head, the longest 9 min into its build |\n"},
414+
{"no landing and candidates dropped", true, []string{`BEFORE_LIVE=,"landed":0,"passing_candidates_thrown_away":0,` +
415+
`"building_candidates_dropped":3,"dropped_head_moved":2,"dropped_member_left":1,"dropped_members_still_queued":4,"dropped_longest_built_minutes":0`},
416+
beforeTitle + ": no landings.\n\n| | |\n|---|---|\n" +
417+
"| Passing candidates thrown away unlanded | none |\n" +
418+
"| Candidates dropped while building | 3: 2 with a member's head moved, 1 with a member gone from the queue; 4 of their pull requests stayed queued at the same head |\n"},
357419
} {
358420
dir := standIns(t)
359421
if c.records {
@@ -364,7 +426,7 @@ func TestDailyRowSaysWhenTheFourHoursBeforeHoldNoRecordsOrNoLanding(t *testing.T
364426
}
365427
data, _ := os.ReadFile(filepath.Join(dir, "state", "app", "rows", "2026-11-18.md"))
366428
row := string(data)
367-
if !strings.HasSuffix(row, " comments.\n\n"+c.line) || strings.Count(row, "| | |") != 1 {
429+
if !strings.HasSuffix(row, " comments.\n\n"+c.line) || strings.Count(row, "| | |") != 1+strings.Count(c.line, "| | |") {
368430
t.Fatalf("%s reads:\n%s", c.name, row)
369431
}
370432
asked, _ := os.ReadFile(filepath.Join(dir, "asked"))

0 commit comments

Comments
 (0)