Public: anyone can read this; the crew can change it.

Throughput: Nothing is ready: no pillar has an issue a builder can start. #14744

Merged opened this in answer to

Check · Review · Land · Live done — Landed and live in production.

Merged

mason/forge:mason/14739-throughput-nothing-is-ready-no-pillar-ha → main 2 commits fork

  • Merged. mason/14739-throughput-nothing-is-ready-no-pillar-ha was merged into main as 4582ad0.

Review

Sign in to review this change.
3 files changed +18 −2
docs/features/keeper.md +1 −1
@@ -7,7 +7,7 @@ row: The throughput keeper
77 The forge watches its own landing rate, names the one thing binding it, and acts where the act is reversible and its own. `src/flow/keeper.ts` ticks once a minute. It reads the database and asks no model, so it still speaks when the subscription is out.
88
99 1. **Measure** (`keeper_rate.ts`): pulls landed per hour over the last 3 h against the best 3 h rate of the week before, and the share of the last 24 hours that ran (a landing or a builder run started). Low is under half the best and under one an hour.
10 2. **Find** (`keeper_cause.ts`): the first of `ceiling`, `usage` ("resets at HH:MM UTC"), `unassigned`, `empty_pillar`, `stale_reds`, `red_checks`, `stale_pile`, `capacity`. It asks the dispatcher's own questions (`heldNow`, `atCeiling`, `pace`).
10 2. **Find** (`keeper_cause.ts`): the first of `ceiling`, `usage` ("resets at HH:MM UTC"), `unassigned`, `empty_pillar`, `stale_reds`, `red_checks`, `stale_pile`, `capacity`. It asks the dispatcher's own questions (`heldNow`, `atCeiling`, `pace`). `empty_pillar` binds only when no ready issue is held by a run or an open pull: those issues exist, and the pile behind them is named instead (`stale_pile`).
1111 3. **Act**: `unassigned` sweeps assigned issues with no run. `empty_pillar`, `red_checks` and `stale_pile` become one filed issue in the forge's own repository, once a week per cause (`stale_pile`'s issue lists the ten oldest pulls waiting on a reviewer or a builder, red and conflicted ones left out, and only counts those waiting on the merge, which is a person's act). `ceiling`, `usage`, `capacity` and `stale_reds` (the crew's red-pull sweep is already at it) are only said.
1212 4. **Check** after 2 h: landings rose and the act stands, or it is undone, the cause is left alone for 6 h and the owner is asked one question with one button (`POST /flow/keeper/answer`).
1313
src/flow/keeper_cause.ts +10 −1
@@ -40,6 +40,11 @@ export interface RepoFacts {
4040 readonly slug: string;
4141 /** Ready issues a builder could start now. */
4242 readonly startable: number;
43 /**
44 * Ready issues already being worked: a run in flight or a pull open. Nothing is missing for
45 * these.
46 */
47 readonly inFlight?: number;
4348 /** Builder runs in flight, and the slots they fill. */
4449 readonly running: number;
4550 readonly slots: number;
@@ -102,7 +107,10 @@ export function pickCause(f: KeeperFacts, skip: ReadonlySet<KeeperCause> = new S
102107 }
103108 }
104109 const first = f.repos[0];
105 if (first && f.repos.every((r) => r.startable === 0)) {
110 // Ready issues that wait only on a run or an open pull are not missing: a filed "nothing is
111 // ready" would ask a builder for what already exists, and the pile behind them is the cause named
112 // below.
113 if (first && f.repos.every((r) => r.startable === 0 && (r.inFlight ?? 0) === 0)) {
106114 const found = hit({ cause: "empty_pillar", move: "file", repoId: first.repoId, says: "Nothing is ready: no pillar has an issue a builder can start." });
107115 if (found) return found;
108116 }
@@ -154,6 +162,7 @@ export function readKeeperFacts(app: App, now: Date): KeeperFacts {
154162 repoId: repo.id,
155163 slug: `${repo.ownerName}/${repo.name}`,
156164 startable: held.startable.length,
165 inFlight: held.by.running.length + held.by.open_pull.length,
157166 running: slottedRuns(active, crew).length,
158167 slots: repo.autonomySlots,
159168 atCeiling: weekSpent(app, repo, now),
test/flow-keeper.test.ts +7
@@ -164,6 +164,13 @@ test("the closed list: the ceiling outranks usage, and a tried cause gives way t
164164 expect(pickCause({ repos: [], red: 6, stale: 0 })).toBeNull();
165165 });
166166
167 test("ready issues held only by a run or an open pull are not an empty pillar: the pile is the cause", () => {
168 const idle: RepoFacts = { repoId: "r", slug: "a/b", startable: 0, running: 0, slots: 4, atCeiling: false, noHeadroom: false, resetsAt: null };
169 expect(pickCause({ repos: [idle], red: 0, stale: 0 })?.cause).toBe("empty_pillar");
170 expect(pickCause({ repos: [{ ...idle, inFlight: 5 }], red: 0, stale: 0 })).toBeNull();
171 expect(pickCause({ repos: [{ ...idle, inFlight: 5 }], red: 0, stale: 77 })?.cause).toBe("stale_pile");
172 });
173
167174 test("the scorecard carries hours running and landed per day for a week", () => {
168175 const card = readScorecards(app, admin);
169176 expect(card?.keeperDays.length).toBe(7);

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs